@syncfusion/ej2-pivotview 28.1.36 → 28.1.37
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,2 +1,11 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* filename: ej2-pivotview.umd.min.js
|
|
3
|
+
* version : 28.1.37
|
|
4
|
+
* Copyright Syncfusion Inc. 2001 - 2024. All rights reserved.
|
|
5
|
+
* Use of this code is subject to the terms of our license.
|
|
6
|
+
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
|
+
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
|
+
* applicable laws.
|
|
9
|
+
*/
|
|
1
10
|
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-pdf-export"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-grids"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-splitbuttons"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-charts"),require("@syncfusion/ej2-svg-base"),require("@syncfusion/ej2-file-utils"),require("@syncfusion/ej2-excel-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-data","@syncfusion/ej2-pdf-export","@syncfusion/ej2-popups","@syncfusion/ej2-grids","@syncfusion/ej2-navigations","@syncfusion/ej2-inputs","@syncfusion/ej2-dropdowns","@syncfusion/ej2-calendars","@syncfusion/ej2-splitbuttons","@syncfusion/ej2-buttons","@syncfusion/ej2-charts","@syncfusion/ej2-svg-base","@syncfusion/ej2-file-utils","@syncfusion/ej2-excel-export"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Data,e.ej2PdfExport,e.ej2Popups,e.ej2Grids,e.ej2Navigations,e.ej2Inputs,e.ej2Dropdowns,e.ej2Calendars,e.ej2Splitbuttons,e.ej2Buttons,e.ej2Charts,e.ej2SvgBase,e.ej2FileUtils,e.ej2ExcelExport)}(this,function(e,Ue,K,j,P,w,O,V,G,N,E,Y,y,F,I,R){"use strict";n.getType=function(e){var t=new Date(e),t="boolean"==typeof e?"boolean":isNaN(Number(e))?t instanceof Date&&!isNaN(t.valueOf())?t&&t.getDay()&&(0<t.getHours()||0<t.getMinutes()||0<t.getSeconds()||0<t.getMilliseconds())?"datetime":"date":typeof e:"number";return t},n.resetTime=function(e){return e.setHours(0,0,0,0),e},n.getClonedData=function(e){var t=[];if(e)for(var i=0,a=e;i<a.length;i++){for(var r=a[i],n=Object.keys(r),s=0,o={};s<n.length;)o[n[s]]=r[n[s]],s++;t.push(o)}return t},n.getClonedCSVData=function(e){return e.map(function(e){return e.slice()})},n.getDefinedObj=function(e){var t=0,i={};if(null!=e)for(var a=Object.keys(e);t<a.length;)null!==e[a[t]]&&void 0!==e[a[t]]&&(i[a[t]]=e[a[t]]),t++;else i=e;return i},n.inArray=function(e,t){if(t)for(var i=0,a=t.length;i<a;i++)if(t[i]===e)return i;return-1},n.setPivotProperties=function(e,t){e.allowServerDataBinding=!1,e.pivotGridModule&&(e.pivotGridModule.allowServerDataBinding=!1),e.setProperties(t,!0),e.allowServerDataBinding=!0,e.pivotGridModule&&(e.pivotGridModule.allowServerDataBinding=!0)},n.getClonedDataSourceSettings=function(e){return this.getDefinedObj({type:e.type,catalog:e.catalog,cube:e.cube,providerType:e.providerType,url:e.url,localeIdentifier:e.localeIdentifier,excludeFields:Ue.isNullOrUndefined(e.excludeFields)?[]:e.excludeFields.slice(),expandAll:e.expandAll,allowLabelFilter:e.allowLabelFilter,allowValueFilter:e.allowValueFilter,allowMemberFilter:e.allowMemberFilter,enableSorting:!!e.enableSorting,rows:this.cloneFieldSettings(e.rows),columns:this.cloneFieldSettings(e.columns),filters:this.cloneFieldSettings(e.filters),values:this.cloneFieldSettings(e.values),filterSettings:this.cloneFilterSettings(e.filterSettings),sortSettings:this.cloneSortSettings(e.sortSettings),drilledMembers:this.cloneDrillMemberSettings(e.drilledMembers),valueSortSettings:this.CloneValueSortObject(e.valueSortSettings),valueAxis:e.valueAxis,valueIndex:e.valueIndex,grandTotalsPosition:e.grandTotalsPosition,formatSettings:this.cloneFormatSettings(e.formatSettings),calculatedFieldSettings:this.cloneCalculatedFieldSettings(e.calculatedFieldSettings),fieldMapping:this.cloneFieldSettings(e.fieldMapping),showSubTotals:e.showSubTotals,showRowSubTotals:e.showRowSubTotals,showColumnSubTotals:e.showColumnSubTotals,subTotalsPosition:e.subTotalsPosition,showGrandTotals:e.showGrandTotals,showRowGrandTotals:e.showRowGrandTotals,showColumnGrandTotals:e.showColumnGrandTotals,showHeaderWhenEmpty:e.showHeaderWhenEmpty,alwaysShowValueHeader:e.alwaysShowValueHeader,conditionalFormatSettings:this.cloneConditionalFormattingSettings(e.conditionalFormatSettings),emptyCellsTextContent:e.emptyCellsTextContent,groupSettings:this.cloneGroupSettings(e.groupSettings),showAggregationOnValueField:e.showAggregationOnValueField,authentication:this.CloneAuthenticationObject(e.authentication)})},n.getClonedFieldList=function(e){for(var t=Object.keys(e),i={},a=0,r=t.length;a<r;a++){var n=e[t[a]];e[t[a]]&&(i[t[a]]={type:n.type,caption:n.caption,id:n.id,isSelected:n.isSelected,sort:n.sort,filterType:n.filterType,index:n.index,filter:n.filter,isCustomField:n.isCustomField,showRemoveIcon:n.showRemoveIcon,showFilterIcon:n.showFilterIcon,showSortIcon:n.showSortIcon,showNoDataItems:n.showNoDataItems,isCalculatedField:n.isCalculatedField,showEditIcon:n.showEditIcon,showValueTypeIcon:n.showValueTypeIcon,allowDragAndDrop:n.allowDragAndDrop,showSubTotals:n.showSubTotals,expandAll:n.expandAll,pid:n.pid,aggregateType:n.aggregateType,baseField:n.baseField,baseItem:n.baseItem,dateMember:this.cloneDateMembers(n.dateMember),members:this.cloneFormatMembers(n.members),formatString:n.formatString,format:n.format,formula:n.formula,isExcelFilter:n.isExcelFilter,membersOrder:n.membersOrder&&n.membersOrder.slice(),isAlphanumeric:n.isAlphanumeric,tag:n.tag,expanded:n.expanded,spriteCssClass:n.spriteCssClass,name:n.name,defaultHierarchy:n.defaultHierarchy,hasAllMember:n.hasAllMember,allMember:n.allMember,isChecked:n.isChecked,filterMembers:this.cloneFieldMembers(n.filterMembers),childMembers:this.cloneFieldMembers(n.childMembers),searchMembers:this.cloneFieldMembers(n.searchMembers),htmlAttributes:this.getDefinedObj(n.htmlAttributes),currrentMembers:this.cloneFormatMembers(n.currrentMembers),isHierarchy:n.isHierarchy,isNamedSets:n.isNamedSets,actualFilter:n.actualFilter&&n.actualFilter.slice(),levels:this.cloneFieldMembers(n.levels),levelCount:n.levelCount,fieldType:n.fieldType,memberType:n.memberType,parentHierarchy:n.parentHierarchy})}return i},n.cloneDateMembers=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push({formattedText:r.formattedText,actualText:r.actualText})}return t}return e},n.cloneFormatMembers=function(e){if(e){for(var t=Object.keys(e),i={},a=0,r=t.length;a<r;a++){var n=e[t[a]];i[t[a]]={index:n.index&&n.index.slice(),isDrilled:n.isDrilled,ordinal:n.ordinal}}return i}return e},n.cloneFieldMembers=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push({caption:r.caption,hasChildren:r.hasChildren,id:r.id,isSelected:r.isSelected,name:r.name,tag:r.tag,htmlAttributes:this.getDefinedObj(r.htmlAttributes),type:r.type,spriteCssClass:r.spriteCssClass,pid:r.pid,isChecked:r.isChecked})}return t}return e},n.updateDataSourceSettings=function(e,t){e&&this.setPivotProperties(e,{dataSourceSettings:this.getDefinedObj({type:t.type,catalog:t.catalog,cube:t.cube,providerType:t.providerType,url:t.url,localeIdentifier:t.localeIdentifier,excludeFields:Ue.isNullOrUndefined(t.excludeFields)?[]:t.excludeFields,expandAll:t.expandAll,allowLabelFilter:t.allowLabelFilter,allowValueFilter:t.allowValueFilter,allowMemberFilter:t.allowMemberFilter,enableSorting:!!t.enableSorting,rows:t.rows,columns:t.columns,filters:t.filters,values:t.values,filterSettings:t.filterSettings,sortSettings:t.sortSettings,drilledMembers:t.drilledMembers,valueSortSettings:t.valueSortSettings,valueAxis:t.valueAxis,grandTotalsPosition:t.grandTotalsPosition,formatSettings:t.formatSettings,calculatedFieldSettings:t.calculatedFieldSettings,fieldMapping:t.fieldMapping,showSubTotals:t.showSubTotals,showRowSubTotals:t.showRowSubTotals,showColumnSubTotals:t.showColumnSubTotals,subTotalsPosition:t.subTotalsPosition,showGrandTotals:t.showGrandTotals,showRowGrandTotals:t.showRowGrandTotals,showColumnGrandTotals:t.showColumnGrandTotals,showHeaderWhenEmpty:t.showHeaderWhenEmpty,alwaysShowValueHeader:t.alwaysShowValueHeader,conditionalFormatSettings:t.conditionalFormatSettings,emptyCellsTextContent:t.emptyCellsTextContent,groupSettings:t.groupSettings,showAggregationOnValueField:t.showAggregationOnValueField,authentication:this.CloneAuthenticationObject(t.authentication)})})},n.cloneFieldSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({name:r.name,caption:r.caption,axis:r.axis,baseField:r.baseField,baseItem:r.baseItem,isCalculatedField:r.isCalculatedField,isNamedSet:r.isNamedSet,showNoDataItems:r.showNoDataItems,showSubTotals:r.showSubTotals,type:r.type,dataType:r.dataType,showFilterIcon:r.showFilterIcon,showSortIcon:r.showSortIcon,showRemoveIcon:r.showRemoveIcon,showValueTypeIcon:r.showValueTypeIcon,showEditIcon:r.showEditIcon,allowDragAndDrop:r.allowDragAndDrop,expandAll:r.expandAll,groupName:r.groupName}))}return t}return e},n.cloneOlapFieldSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({caption:r.caption,hasChildren:r.hasChildren,id:r.id,isSelected:r.isSelected,name:r.name,spriteCssClass:r.spriteCssClass,tag:r.tag,type:r.type,pid:r.pid,expanded:r.expanded,defaultHierarchy:r.defaultHierarchy,hasAllMember:r.hasAllMember,allMember:r.allMember,isChecked:r.isChecked,filterMembers:r.filterMembers,childMembers:r.childMembers,searchMembers:r.searchMembers,htmlAttributes:this.getDefinedObj(r.htmlAttributes),currrentMembers:r.currrentMembers,isHierarchy:r.isHierarchy,isNamedSets:r.isNamedSets,formatString:r.formatString,actualFilter:r.actualFilter,levels:r.levels,levelCount:r.levelCount,memberType:r.memberType,fieldType:r.fieldType,parentHierarchy:r.parentHierarchy}))}return t}return e},n.cloneFilterSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({name:r.name,type:r.type,condition:r.condition,items:r.items&&r.items.slice(),levelCount:r.levelCount,measure:r.measure,selectedField:r.selectedField,showDateFilter:r.showDateFilter,showLabelFilter:r.showLabelFilter,showNumberFilter:r.showNumberFilter,value1:r.value1,value2:r.value2}))}return t}return e},n.cloneSortSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({name:r.name,order:r.order,membersOrder:r.membersOrder&&r.membersOrder.slice()}))}return t}return e},n.getFormattedHeader=function(e,t){var i,a,r=n.frameHeaderWithKeys(e);return r.valueSort&&r.valueSort.axis&&(i=r.valueSort.axis,a=this.isDateField(i,t),r.formattedText=(a||!t.formatFields[i]||!0===e.isSum?r:t.getFormattedValue(r.actualText,i)).formattedText),r},n.getFormattedMembers=function(e,t,i){var a=this.isDateField(t,i);if(a||i.groupingFields[t]){for(var r={},n=Object.keys(e),s=i.fieldList[t].dateMember,o=0,l=n.length;o<l;o++){var d=e[n[o]];a?r[d.caption]=d:r[s[d.ordinal-1].actualText]=d}return r}return e},n.isDateField=function(e,t){return t.formatFields[e]&&-1<["date","dateTime","time"].indexOf(t.formatFields[e].type)},n.formatChartHeaders=function(e,t,i){for(var a=[],r=0,n=e.length;r<n;r++){var s=i?0<t.parent.dataSourceSettings.columns.length&&!Ue.isNullOrUndefined(t.parent.dataSourceSettings.columns[r])?t.parent.dataSourceSettings.columns[r].name:void 0:0<t.parent.dataSourceSettings.rows.length&&!Ue.isNullOrUndefined(t.parent.dataSourceSettings.rows[r])?t.parent.dataSourceSettings.rows[r].name:void 0;Ue.isNullOrUndefined(s)||t.engineModule.formatFields[s]&&-1<["date","dateTime","time"].indexOf(t.engineModule.formatFields[s].type)?a.push(e[r]):a.push(t.engineModule.getFormattedValue(e[r],s).formattedText)}return a.join(" - ")},n.cloneDrillMemberSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({name:r.name,delimiter:r.delimiter,items:r.items&&r.items.slice()}))}return t}return e},n.cloneFormatSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({name:r.name,calendar:r.calendar,currency:r.currency,format:r.format,maximumFractionDigits:r.maximumFractionDigits,maximumSignificantDigits:r.maximumSignificantDigits,minimumFractionDigits:r.minimumFractionDigits,minimumIntegerDigits:r.minimumIntegerDigits,minimumSignificantDigits:r.minimumSignificantDigits,skeleton:r.skeleton,type:r.type,useGrouping:r.useGrouping}))}return t}return e},n.CloneValueSortObject=function(e){return e&&{columnIndex:e.columnIndex,headerDelimiter:e.headerDelimiter,headerText:e.headerText,measure:e.measure,sortOrder:e.sortOrder}},n.CloneAuthenticationObject=function(e){return e&&{userName:e.userName,password:e.password}},n.cloneCalculatedFieldSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({name:r.name,formatString:r.formatString,formula:r.formula,hierarchyUniqueName:r.hierarchyUniqueName}))}return t}return e},n.cloneConditionalFormattingSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({applyGrandTotals:r.applyGrandTotals,conditions:r.conditions,label:r.label,measure:r.measure,style:r.style&&{backgroundColor:r.style.backgroundColor,color:r.style.color,fontFamily:r.style.fontFamily,fontSize:r.style.fontSize},value1:r.value1,value2:r.value2}))}return t}return e},n.cloneGroupSettings=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({name:r.name,caption:r.caption,customGroups:this.cloneCustomGroups(r.customGroups),endingAt:r.endingAt,startingAt:r.startingAt,groupInterval:r.groupInterval,rangeInterval:r.rangeInterval,type:r.type}))}return t}return e},n.cloneCustomGroups=function(e){if(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];t.push(this.getDefinedObj({groupName:r.groupName,items:r.items&&r.items.slice()}))}return t}return e},n.getFilterItemByName=function(e,t){t=new K.DataManager({json:t}).executeLocal((new K.Query).where("name","equal",e));if(t&&0<t.length)return t[t.length-1]},n.getFieldByName=function(e,t){return new K.DataManager({json:t}).executeLocal((new K.Query).where("name","equal",e))[0]},n.getFieldInfo=function(e,t,i){if(!i)for(var a=[this.cloneFieldSettings(t.dataSourceSettings.rows),this.cloneFieldSettings(t.dataSourceSettings.columns),this.cloneFieldSettings(t.dataSourceSettings.values),this.cloneFieldSettings(t.dataSourceSettings.filters)],r=0,n=a.length;r<n;r++)for(var s=0,o=a[r]?a[r].length:0;s<o;s++)if(a[r][s]&&a[r][s].name===e)return{fieldName:e,fieldItem:a[r][s],axis:0===r?"rows":1===r?"columns":2===r?"values":"filters",position:s};i=("olap"===t.dataType?t.olapEngineModule:t.engineModule).fieldList[e];return{fieldName:e,fieldItem:i?{name:e,caption:i.caption,baseField:i.baseField,baseItem:i.baseItem,isCalculatedField:i.isCalculatedField,isNamedSet:i.isNamedSets,showNoDataItems:i.showNoDataItems,showSubTotals:i.showSubTotals,type:i.aggregateType,showFilterIcon:i.showFilterIcon,showSortIcon:i.showSortIcon,showRemoveIcon:i.showRemoveIcon,showValueTypeIcon:i.showValueTypeIcon,showEditIcon:i.showEditIcon,allowDragAndDrop:i.allowDragAndDrop,expandAll:i.expandAll}:void 0,axis:"fieldlist",position:-1}},n.isButtonIconRefesh=function(e,t,i){var a=!1;try{if("dataSourceSettings"===e&&t.dataSourceSettings&&i.dataSourceSettings){var r=["notAvail","notAvail","notAvail","notAvail"],n=Object.keys(t.dataSourceSettings),s=Object.keys(i.dataSourceSettings);if(n&&s&&0<s.length&&n.length===s.length)for(var o=["rows","columns","values","filters"],l=0;l<s.length;l++){var d=s[l]in t.dataSourceSettings&&!Ue.isNullOrUndefined(t.dataSourceSettings[s[l]])?Object.keys(t.dataSourceSettings[s[l]]):[],p=s[l]in i.dataSourceSettings&&!Ue.isNullOrUndefined(i.dataSourceSettings[s[l]])?Object.keys(i.dataSourceSettings[s[l]]):[];if(-1!==o.indexOf(s[l])&&-1!==o.indexOf(n[l])&&d&&p&&0<p.length&&d.length===p.length)for(var h=["showFilterIcon","showSortIcon","showRemoveIcon","showValueTypeIcon","showEditIcon","allowDragAndDrop","expandAll"],u=0;u<p.length;u++){for(var c=Object.keys(t.dataSourceSettings[s[l]][p[u]]),g=Object.keys(i.dataSourceSettings[s[l]][p[u]]),m=0;m<g.length;m++){if(-1===h.indexOf(g[m])||-1===h.indexOf(c[m])){r[l]="break";break}r[l]="update"}if("break"===r[l])break}else r[l]="break";if("break"===r[l])break}for(var S=0,f=0,v=0,y=0,b=r;y<b.length;y++){var C=b[y];"break"===C&&S++,"notAvail"===C&&f++,"update"===C&&v++}a=!(0<S||4===f)&&0===S&&f<4&&0<v}}catch(e){a=!1}return a},n.formatPivotValues=function(e){for(var t=[],i=0;i<e.length;i++)if(e[i]){t[i]=[];for(var a=0;a<e[i].length;a++)e[i][a]&&(t[i][a]={axis:e[i][a].Axis,actualText:e[i][a].ActualText,indexObject:e[i][a].IndexObject,index:e[i][a].Index,rowHeaders:e[i][a].RowHeaders,columnHeaders:e[i][a].ColumnHeaders,formattedText:e[i][a].FormattedText,actualValue:e[i][a].ActualValue,rowIndex:e[i][a].RowIndex,colIndex:e[i][a].ColIndex,colSpan:e[i][a].ColSpan,level:e[i][a].Level,rowSpan:e[i][a].RowSpan,isSum:e[i][a].IsSum,isGrandSum:e[i][a].IsGrandSum,valueSort:e[i][a].ValueSort,ordinal:e[i][a].Ordinal,hasChild:e[i][a].HasChild,isDrilled:e[i][a].IsDrilled,value:e[i][a].Value,type:e[i][a].Type,members:e[i][a].Members})}return t},n.formatFieldList=function(e){for(var t=Object.keys(e),i={},a=0;a<t.length;a++)e[t[a]]&&(i[t[a]]={id:e[t[a]].Id,caption:e[t[a]].Caption,type:e[t[a]].Type,formatString:e[t[a]].FormatString,index:e[t[a]].Index,members:e[t[a]].Members,formattedMembers:e[t[a]].FormattedMembers,dateMember:e[t[a]].DateMember,filter:e[t[a]].Filter,sort:e[t[a]].Sort,aggregateType:e[t[a]].AggregateType,baseField:e[t[a]].BaseField,baseItem:e[t[a]].BaseItem,filterType:e[t[a]].FilterType,format:e[t[a]].Format,formula:e[t[a]].Formula,isSelected:e[t[a]].IsSelected,isExcelFilter:e[t[a]].IsExcelFilter,showNoDataItems:e[t[a]].ShowNoDataItems,isCustomField:e[t[a]].IsCustomField,showFilterIcon:e[t[a]].ShowFilterIcon,showSortIcon:e[t[a]].ShowSortIcon,showRemoveIcon:e[t[a]].ShowRemoveIcon,showEditIcon:e[t[a]].ShowEditIcon,showValueTypeIcon:e[t[a]].ShowValueTypeIcon,allowDragAndDrop:e[t[a]].AllowDragAndDrop,isCalculatedField:e[t[a]].IsCalculatedField,showSubTotals:e[t[a]].ShowSubTotals,expandAll:e[t[a]].expandAll,groupName:e[t[a]].groupName});return i},n.frameContent=function(e,t,i,a){var r=[];if(0<a.dataSourceSettings.values.length&&!a.engineModule.isEmptyData&&(a.enableValueSorting||!a.engineModule.isEngineUpdated))for(var n=0,s="value"===t?e.length:i,o="value"===t?i:0;o<s;o++)if(e[o]){r[n="header"===t?o:n]={};for(var l=0;l<e[o].length;l++)e[o][l]&&(r[n][l]=e[o][l]);n++}return r},n.getLocalizedObject=function(e){var t={};return t.Null=e.localeObj.getConstant("null"),t.Years=e.localeObj.getConstant("Years"),t.Quarters=e.localeObj.getConstant("Quarters"),t.Months=e.localeObj.getConstant("Months"),t.Days=e.localeObj.getConstant("Days"),t.Hours=e.localeObj.getConstant("Hours"),t.Minutes=e.localeObj.getConstant("Minutes"),t.Seconds=e.localeObj.getConstant("Seconds"),t.QuarterYear=e.localeObj.getConstant("QuarterYear"),t.Of=e.localeObj.getConstant("of"),t.Qtr=e.localeObj.getConstant("qtr"),t.Undefined=e.localeObj.getConstant("undefined"),t.GroupOutOfRange=e.localeObj.getConstant("groupOutOfRange"),t.Group=e.localeObj.getConstant("group"),t},n.updateReport=function(e,t){e.setProperties({dataSourceSettings:{rows:[]}},!0),e.setProperties({dataSourceSettings:{columns:[]}},!0),e.setProperties({dataSourceSettings:{formatSettings:[]}},!0);for(var i=0;i<t.Rows.length;i++)e.dataSourceSettings.rows.push({name:t.Rows[i].Name,caption:t.Rows[i].Caption,showNoDataItems:t.Rows[i].ShowNoDataItems,baseField:t.Rows[i].BaseField,baseItem:t.Rows[i].BaseItem,showFilterIcon:t.Rows[i].ShowFilterIcon,showSortIcon:t.Rows[i].ShowSortIcon,showEditIcon:t.Rows[i].ShowEditIcon,showRemoveIcon:t.Rows[i].ShowRemoveIcon,showSubTotals:t.Rows[i].ShowValueTypeIcon,allowDragAndDrop:t.Rows[i].AllowDragAndDrop,axis:t.Rows[i].Axis,dataType:t.Rows[i].DataType,isCalculatedField:t.Rows[i].IsCalculatedField,showValueTypeIcon:t.Rows[i].ShowValueTypeIcon,type:t.Rows[i].Type,expandAll:t.Rows[i].expandAll});for(i=0;i<t.Columns.length;i++)e.dataSourceSettings.columns.push({name:t.Columns[i].Name,caption:t.Columns[i].Caption,showNoDataItems:t.Columns[i].ShowNoDataItems,baseField:t.Columns[i].BaseField,baseItem:t.Columns[i].BaseItem,showFilterIcon:t.Columns[i].ShowFilterIcon,showSortIcon:t.Columns[i].ShowSortIcon,showEditIcon:t.Columns[i].ShowEditIcon,showRemoveIcon:t.Columns[i].ShowRemoveIcon,showSubTotals:t.Columns[i].ShowValueTypeIcon,allowDragAndDrop:t.Columns[i].AllowDragAndDrop,axis:t.Columns[i].Axis,dataType:t.Columns[i].DataType,isCalculatedField:t.Columns[i].IsCalculatedField,showValueTypeIcon:t.Columns[i].ShowValueTypeIcon,type:t.Columns[i].Type,expandAll:t.Columns[i].expandAll});for(i=0;i<t.FormatSettings.length;i++)e.dataSourceSettings.formatSettings.push({name:t.FormatSettings[i].Name,format:t.FormatSettings[i].Format,type:t.FormatSettings[i].Type,currency:t.FormatSettings[i].Currency,maximumFractionDigits:t.FormatSettings[i].MaximumFractionDigits,maximumSignificantDigits:t.FormatSettings[i].MaximumSignificantDigits,minimumFractionDigits:t.FormatSettings[i].MinimumFractionDigits,minimumIntegerDigits:t.FormatSettings[i].MinimumIntegerDigits,minimumSignificantDigits:t.FormatSettings[i].MinimumSignificantDigits,skeleton:t.FormatSettings[i].Skeleton,useGrouping:t.FormatSettings[i].UseGrouping})},n.generateUUID=function(){var i=(new Date).getTime(),a=performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var t=16*Math.random();return 0<i?(t=(i+t)%16|0,i=Math.floor(i/16)):(t=(a+t)%16|0,a=Math.floor(a/16)),("x"===e?t:3&t|8).toString(16)})},n.applyCustomSort=function(e,t,i,a,r){var n,s=[],s=e.IsOrderChanged?e.members:"Ascending"===e.sortOrder||"None"===e.sortOrder||void 0===e.sortOrder?[].concat(e.members):[].concat(e.members).reverse(),o=[],l=void 0===i||"string"===i||"number"===i;"Grand Total"===t[0].actualText&&(n=t[0],t.shift());for(var d=0,p=0;d<t.length;d++){var h=t[d],u=r?h.formattedText:l?h.actualText:!0===i?h.actualText.toString():h.dateText;if(s[p]===u){if(t.splice(p++,0,h),t.splice(++d,1),!(p<s.length)){a||o.splice(--p,0,u);break}d=-1}0<=d&&!a&&(o[d]=u)}if(!a){for(d=o.length;d<t.length;d++){h=t[d],u=r?h.formattedText:l?h.actualText:!0===i?h.actualText.toString():h.dateText;o[d]=u}"Grand Total"===o[o.length-1]&&o.pop(),e.members=o}return n&&t.splice(0,0,n),t},n.applyHeadersSort=function(e,i,t,a){return e=a?e.sort(function(e,t){e=e.actualText,t=t.actualText;return"Grand Total"===e||"Grand Total"===t?0:"Out of Range"===e?1:"Out of Range"===t?-1:isNaN(parseFloat(e))||isNaN(parseFloat(t))?"Ascending"===i?e.localeCompare(t,void 0,{numeric:!0,sensitivity:"base"}):t.localeCompare(e,void 0,{numeric:!0,sensitivity:"base"}):"Ascending"===i?parseFloat(e)-parseFloat(t):parseFloat(t)-parseFloat(e)}):"datetime"===t||"date"===t||"time"===t?"Ascending"===i?e.sort(function(e,t){return"Out of Range"===e.dateText?1:"Out of Range"===t.dateText?-1:e.dateText>t.dateText?1:e.dateText<t.dateText?-1:0}):"Descending"===i?e.sort(function(e,t){return"Out of Range"===e.dateText?1:"Out of Range"===t.dateText?-1:e.dateText<t.dateText?1:e.dateText>t.dateText?-1:0}):e:!0===t?"Ascending"===i?e.sort(function(e,t){return"Grand Total"===e.actualText||"Grand Total"===t.actualText?0:"Out of Range"===e.actualText?1:"Out of Range"===t.actualText?-1:Number(e.actualText.toString().match(/\d+/))>Number(t.actualText.toString().match(/\d+/))?1:Number(t.actualText.toString().match(/\d+/))>Number(e.actualText.toString().match(/\d+/))?-1:0}):"Descending"===i?e.sort(function(e,t){return"Grand Total"===e.actualText||"Grand Total"===t.actualText?0:"Out of Range"===e.actualText?-1:"Out of Range"===t.actualText||Number(e.actualText.toString().match(/\d+/))<Number(t.actualText.toString().match(/\d+/))?1:Number(t.actualText.toString().match(/\d+/))<Number(e.actualText.toString().match(/\d+/))?-1:0}):e:"Ascending"===i?e.sort(function(e,t){return"Grand Total"===e.actualText||"Grand Total"===t.actualText?0:e.actualText>t.actualText?1:t.actualText>e.actualText?-1:0}):"Descending"===i?e.sort(function(e,t){return"Grand Total"===e.actualText||"Grand Total"===t.actualText?0:e.actualText<t.actualText?1:t.actualText<e.actualText?-1:0}):e},n.renderOlapEngine=function(t,e){try{t.olapEngineModule.renderEngine(t.dataSourceSettings,e||t.frameCustomProperties(t.olapEngineModule.fieldListData,t.olapEngineModule.fieldList),t.onHeadersSort?t.getHeaderSortInfo.bind(t):void 0),t.setProperties({dataSourceSettings:{valueIndex:t.olapEngineModule.measureIndex}},!0)}catch(e){t.actionObj.actionName="engineFormation",t.olapEngineModule.errorInfo?(t.actionFailureMethod(t.olapEngineModule.errorInfo),t.olapEngineModule.errorInfo=void 0):t.actionFailureMethod(e)}},n.frameHeaderWithKeys=function(e){for(var t=Object.keys(e),i=0,a={};i<t.length;)a[t[i]]=e[t[i]],i++;return a},n.getPageSize=function(e){switch(e){case"Letter":return new j.SizeF(612,792);case"Note":return new j.SizeF(540,720);case"Legal":return new j.SizeF(612,1008);case"A0":return new j.SizeF(2380,3368);case"A1":return new j.SizeF(1684,2380);case"A2":return new j.SizeF(1190,1684);case"A3":return new j.SizeF(842,1190);case"A5":return new j.SizeF(421,595);case"A6":return new j.SizeF(297,421);case"A7":return new j.SizeF(210,297);case"A8":return new j.SizeF(148,210);case"A9":return new j.SizeF(105,148);case"B0":return new j.SizeF(2836,4008);case"B1":return new j.SizeF(2004,2836);case"B2":return new j.SizeF(1418,2004);case"B3":return new j.SizeF(1002,1418);case"B4":return new j.SizeF(709,1002);case"B5":return new j.SizeF(501,709);case"Archa":return new j.SizeF(648,864);case"Archb":return new j.SizeF(864,1296);case"Archc":return new j.SizeF(1296,1728);case"Archd":return new j.SizeF(1728,2592);case"Arche":return new j.SizeF(2592,3456);case"Flsa":return new j.SizeF(612,936);case"HalfLetter":return new j.SizeF(396,612);case"Letter11x17":return new j.SizeF(792,1224);case"Ledger":return new j.SizeF(1224,792);default:return new j.SizeF(595,842)}},n.getSortedValue=function(e,i){return e.sort(function(e,t){return"Descending"===i?(t.value||"grand sum"===t.header.type?t.value:0)-(e.value||"grand sum"===e.header.type?e.value:0):(e.value||"grand sum"===e.header.type?e.value:0)-(t.value||"grand sum"===t.header.type?t.value:0)}),e.map(function(e){return e.header})};var Ce=n;function n(){}var L=function(){return(L=Object.assign||function(e){for(var t,i=1,a=arguments.length;i<a;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},A=(t.prototype.clearProperties=function(e){this.isPagingOrVirtualizationEnabled||e||(this.columnKeys={},this.headerCollection={rowHeaders:[],columnHeaders:[],rowHeadersCount:0,columnHeadersCount:0}),this.enableValueSorting&&(this.valueContent=[]),this.saveDataHeaders=this.allowValueFilter?this.saveDataHeaders:{},this.rMembers=[],this.cMembers=[],this.slicedHeaders=[],this.fieldFilterMem={},this.filterPosObj={},this.selectedHeaders={selectedHeader:[],values:[]},this.rowGrandTotal=null,this.columnGrandTotal=null,this.rawIndexObject={},-1<this.dataSourceSettings.valueIndex&&(this.valueAxisFields={}),this.headerObjectsCollection={},this.fieldDrillCollection={}},t.prototype.renderEngine=function(e,t,i,a){if(this.getValueCellInfo=i,this.getHeaderSortInfo=a,this.customProperties=t,this.fieldList)for(var r=0,n=e.formatSettings;r<n.length;r++)!this.formatFields[n[r].name]&&this.fieldList[n[r].name]&&(this.fieldList[n[r].name].members={},this.fieldList[n[r].name].formattedMembers={},this.fieldList[n[r].name].dateMember=[]);if(this.formatFields={},this.dateFormatFunction={},this.calculatedFields={},this.calculatedFormulas={},this.valueAxis=0,this.saveDataHeaders={},this.columnCount=0,this.rowCount=0,this.columnPageCount=0,this.rowPageCount=0,this.colFirstLvl=0,this.rowFirstLvl=0,this.rowStartPos=0,this.colStartPos=0,this.dataSourceSettings.excludeFields=Ue.isNullOrUndefined(e.excludeFields)?[]:e.excludeFields,this.enableValueSorting=!1,this.headerCollection={rowHeaders:[],columnHeaders:[],rowHeadersCount:0,columnHeadersCount:0},this.aggregatedValueMatrix=[],this.rMembers=[],this.cMembers=[],this.memberCnt=-1,this.pageInLimit=!1,this.endPos=0,this.removeCount=0,this.colHdrBufferCalculated=!1,this.colValuesLength=1,this.rowValuesLength=1,this.slicedHeaders=[],this.fieldFilterMem={},this.filterPosObj={},this.selectedHeaders={selectedHeader:[],values:[]},this.rowGrandTotal=null,this.columnGrandTotal=null,this.removeRowGrandTotal=!1,this.removeColumnGrandTotal=!1,this.isValueHasAdvancedAggregate=!1,this.rawIndexObject={},this.isLastHeaderHasMeasures=!0,this.isEditing=!1,this.globalize=t&&t.globalize?t.globalize:new Ue.Internationalization,this.currencyCode=t&&t.currenyCode?t.currenyCode:void 0,this.localeObj=t?t.localeObj:void 0,this.fieldsType=t?t.fieldsType:{},this.clonedReport=t?t.clonedReport&&t.clonedReport.properties?t.clonedReport.properties:t.clonedReport:{},this.enablePaging=t.enablePaging,this.enableVirtualization=t.enableVirtualization,this.enableOptimizedRendering=t.enableOptimizedRendering,this.enableHtmlSanitizer=t.enableHtmlSanitizer,this.isPagingOrVirtualizationEnabled=this.enablePaging||this.enableVirtualization,this.enableSort=e.enableSorting,this.dataSourceSettings.alwaysShowValueHeader=e.alwaysShowValueHeader,this.dataSourceSettings.showHeaderWhenEmpty=!!Ue.isNullOrUndefined(e.showHeaderWhenEmpty)||e.showHeaderWhenEmpty,this.dataSourceSettings.showSubTotals=!!Ue.isNullOrUndefined(e.showSubTotals)||e.showSubTotals,this.dataSourceSettings.showRowSubTotals=!!Ue.isNullOrUndefined(e.showRowSubTotals)||e.showRowSubTotals,this.dataSourceSettings.showColumnSubTotals=!!Ue.isNullOrUndefined(e.showColumnSubTotals)||e.showColumnSubTotals,this.dataSourceSettings.showGrandTotals=!!Ue.isNullOrUndefined(e.showGrandTotals)||e.showGrandTotals,this.dataSourceSettings.grandTotalsPosition=Ue.isNullOrUndefined(e.grandTotalsPosition)?"Bottom":e.grandTotalsPosition,this.dataSourceSettings.showRowGrandTotals=!!Ue.isNullOrUndefined(e.showRowGrandTotals)||e.showRowGrandTotals,this.dataSourceSettings.showColumnGrandTotals=!!Ue.isNullOrUndefined(e.showColumnGrandTotals)||e.showColumnGrandTotals,this.showSubTotalsAtTop=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&"Top"===e.subTotalsPosition&&!t.isTabularLayout,this.showSubTotalsAtBottom=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals&&"Bottom"===e.subTotalsPosition||t.isTabularLayout,this.allowValueFilter=e.allowValueFilter,this.isValueFilterEnabled=!1,this.enableValueSorting=!!t&&t.enableValueSorting,this.isDrillThrough=t&&t.isDrillThrough||!1,this.valueContent=[],this.dataSourceSettings=Ce.getClonedDataSourceSettings(e),e.dataSource instanceof K.DataManager||(this.data=e.dataSource),this.data&&this.data[0]){if(!this.fieldList){"CSV"===e.type?this.fields=this.data.shift():this.fields=Object.keys(this.data[0]);for(r=0;r<this.fields.length;r++)this.fieldKeys[this.fields[r]]="CSV"===e.type?r:this.fields[r]}t&&t.pageSettings&&t.allowDataCompression&&(this.actualData=this.data,this.data=this.getGroupedRawData(e)),this.dataSourceSettings.rows=e.rows||[],this.dataSourceSettings.columns=e.columns||[],this.dataSourceSettings.filters=e.filters||[],this.dataSourceSettings.values=e.values||[],this.dataSourceSettings.formatSettings=e.formatSettings||[],this.dataSourceSettings.groupSettings=e.groupSettings||[],this.dataSourceSettings.calculatedFieldSettings=e.calculatedFieldSettings||[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.dataSourceSettings.fieldMapping=e.fieldMapping||[],this.valueAxisFields={};for(var s=0,o=this.dataSourceSettings.values;s<o.length;s++){var l=o[s];this.valueAxisFields[l.name]=l}for(i=this.getGroupData(this.data),r=0;r<this.fields.length;r++)this.fieldKeys[this.fields[r]]="CSV"===e.type?r:this.fields[r];this.validateFilters(e),this.isExpandAll=!(!this.isValueFiltersAvail||!e.allowValueFilter)||e.expandAll,this.drilledMembers=!e.drilledMembers||this.isValueFiltersAvail&&e.allowValueFilter?[]:e.drilledMembers,this.isMultiMeasures=1<this.dataSourceSettings.values.length,this.valueAxis="row"===e.valueAxis?1:0,this.measureIndex=Ue.isNullOrUndefined(e.valueIndex)?-1:e.valueIndex,this.emptyCellTextContent=e.emptyCellsTextContent||"",this.rowValuesLength=1===this.valueAxis?this.dataSourceSettings.values.length:1,this.colValuesLength=0===this.valueAxis?this.dataSourceSettings.values.length:1,this.valueSortSettings=e.valueSortSettings||{sortOrder:"None",headerDelimiter:".",headerText:"",columnIndex:void 0},this.valueSortData=[],this.pageSettings=t?t.pageSettings||this.pageSettings:void 0,this.allowDataCompression=t&&t.allowDataCompression,this.savedFieldList=t?t.savedFieldList:void 0,this.getFieldList(i,this.enableSort,e.allowValueFilter),this.removeIrrelevantFields(Object.keys(this.fieldList)),this.fillFieldMembers(),this.updateSortSettings(e.sortSettings,this.enableSort),this.filterMembers=[];var d=this.dataSourceSettings.columns.length-1;for(this.columnKeys={};-1<d;)this.columnKeys[this.dataSourceSettings.columns[d].name]=this.dataSourceSettings.columns[d],d--;this.updateFilterMembers(e),this.generateGridData(e)}},t.prototype.removeIrrelevantFields=function(e){for(var t={},i=(t[0]=this.dataSourceSettings.rows,t[1]=this.dataSourceSettings.columns,t[2]=this.dataSourceSettings.values,t[3]=this.dataSourceSettings.filters,0);i<4;){if(t[i])for(var a=0;a<t[i].length;a++){var r=t[i][a].name;-1<this.dataSourceSettings.excludeFields.indexOf(r)||!Ue.isNullOrUndefined(e)&&-1===e.indexOf(r)?(t[i].splice(a,1),a--):2===i&&(this.measureNames[r]=t[i][a].caption||r,this.measureNames[t[i][a].caption||r]=r)}i++}this.isMultiMeasures=1<this.dataSourceSettings.values.length,this.measureIndex=-1===this.measureIndex?(this.valueAxis?t[0]:t[1]).length:this.measureIndex},t.prototype.updateDataSourceSettings=function(e,t){t&&(this.emptyCellTextContent=e.emptyCellsTextContent||"",this.valueAxis="row"===e.valueAxis?1:0,this.rowValuesLength=1===this.valueAxis?this.dataSourceSettings.values.length:1,this.colValuesLength=0===this.valueAxis?this.dataSourceSettings.values.length:1,this.measureIndex=Ue.isNullOrUndefined(e.valueIndex)?-1:e.valueIndex,this.enableSort=e.enableSorting,this.dataSourceSettings.alwaysShowValueHeader=e.alwaysShowValueHeader,this.dataSourceSettings.showHeaderWhenEmpty=!!Ue.isNullOrUndefined(e.showHeaderWhenEmpty)||e.showHeaderWhenEmpty,this.dataSourceSettings.showSubTotals=!!Ue.isNullOrUndefined(e.showSubTotals)||e.showSubTotals,this.dataSourceSettings.showRowSubTotals=!!Ue.isNullOrUndefined(e.showRowSubTotals)||e.showRowSubTotals,this.dataSourceSettings.showColumnSubTotals=!!Ue.isNullOrUndefined(e.showColumnSubTotals)||e.showColumnSubTotals,this.dataSourceSettings.showGrandTotals=!!Ue.isNullOrUndefined(e.showGrandTotals)||e.showGrandTotals,this.dataSourceSettings.grandTotalsPosition=Ue.isNullOrUndefined(e.grandTotalsPosition)?"Bottom":e.grandTotalsPosition,this.dataSourceSettings.showRowGrandTotals=!!Ue.isNullOrUndefined(e.showRowGrandTotals)||e.showRowGrandTotals,this.dataSourceSettings.showColumnGrandTotals=!!Ue.isNullOrUndefined(e.showColumnGrandTotals)||e.showColumnGrandTotals,this.showSubTotalsAtTop=this.dataSourceSettings.showSubTotals&&"Top"===e.subTotalsPosition&&e.showColumnSubTotals,this.showSubTotalsAtBottom=!!this.customProperties.isTabularLayout||this.dataSourceSettings.showSubTotals&&"Bottom"===e.subTotalsPosition&&e.showRowSubTotals,this.allowValueFilter=e.allowValueFilter,this.dataSourceSettings.formatSettings=e.formatSettings||[],this.dataSourceSettings.groupSettings=e.groupSettings||[],this.dataSourceSettings.calculatedFieldSettings=e.calculatedFieldSettings||[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.dataSourceSettings.fieldMapping=e.fieldMapping||[],this.dataSourceSettings.values=e.values||[],this.dataSourceSettings.rows=e.rows||[],this.dataSourceSettings.columns=e.columns||[],this.dataSourceSettings.filters=e.filters||[],this.dataSourceSettings.filterSettings=e.filterSettings||[],this.dataSourceSettings.sortSettings=e.sortSettings||[],this.dataSourceSettings.conditionalFormatSettings=e.conditionalFormatSettings||[],this.dataSourceSettings.valueSortSettings=e.valueSortSettings||{},this.removeIrrelevantFields(Object.keys(this.fieldList)))},t.prototype.getGroupedRawData=function(e){this.data=[];for(var t=0,i=this.actualData;t<i.length;t++){var a=i[t];this.data[this.data.length]=Ce.frameHeaderWithKeys(a)}for(var r=e.values.filter(function(e){return"Count"===e.type||"DistinctCount"===e.type}).map(function(e){return e.name}),n=0<r.length,s=this.data,o=e.rows.concat(e.columns.concat(e.filters)).map(function(e){return e.name}),l={},d=[],p=(this.groupRawIndex={},{}),h=0,u=0;u<s.length;u++){var c=s[u],g=[];if(n)for(var m=0;m<r.length;m++)c[this.fieldKeys[r[m]]]=Ue.isNullOrUndefined(c[this.fieldKeys[r[m]]])?c[this.fieldKeys[r[m]]]:1;for(var S=0;S<o.length;S++)g.push(c[this.fieldKeys[o[S]]]);var f=g.join("-");if(l[f]){for(m=0;m<e.values.length;m++){var v=e.values[m].name,y=c[this.fieldKeys[v]],b=l[f],C=e.values[m].type;Ue.isNullOrUndefined(y)||("number"==typeof y&&"DistinctCount"!==C||(C="Count"),Ue.isNullOrUndefined(b[v])?b[v]="Product"===C?1:"Min"===C||"Max"===C?void 0:0:"number"!=typeof b[v]&&(b[v]=1),"Count"===C?b[v]+=1:"Min"===C?Ue.isNullOrUndefined(b[v])||(b[v]=b[v]>y?y:b[v]):"Max"===C?Ue.isNullOrUndefined(b[v])||(b[v]=b[v]<y?y:b[v]):"Product"===C?b[v]*=y:b[v]+=y)}this.isDrillThrough&&this.groupRawIndex[p[f]].push(u)}else l[f]=c,d.push(c),this.isDrillThrough&&(this.groupRawIndex[h]=[u],p[f]=h,h++)}return d},t.prototype.getGroupData=function(fe){for(var ve=this,ye=fe[0],be=this,e=0,t=this.dataSourceSettings.groupSettings;e<t.length;e++){var i=function(e){var i=e.name,t=e.caption;if(!(-1<be.fields.indexOf(i)))return{value:ye};var a={},k=void 0;if("Date"===e.type&&be.groupingFields[i]||"Custom"===e.type&&be.groupingFields[i])return{value:ye};if("Number"===e.type){if("number"!==Ce.getType(ye[i])&&be.groupingFields[i])return{value:ye};e.rangeInterval&&fe.sort(function(e,t){return Number(e[ve.fieldKeys[i]])>Number(t[ve.fieldKeys[i]])?1:Number(t[ve.fieldKeys[i]])>Number(e[ve.fieldKeys[i]])?-1:0})}for(var j=fe.length;j--;){var r=fe[j];if(r[be.fieldKeys[i]]&&"Date"===e.type){var n=new Date(r[be.fieldKeys[i]].toString());if(!Ue.isNullOrUndefined(n)&&0<e.groupInterval.length)for(var s=0,q=e.groupInterval.length;s<q;s++){var o=e.groupInterval[s],l=be.getRange(e,n.getTime()),d=Ce.resetTime(new Date);switch(o){case"Years":a[p=s===e.groupInterval.length-1?i:i+"_date_group_years"]=o,be.fieldKeys[p]="CSV"===be.dataSourceSettings.type?be.fieldKeys[p]||be.fields.length:p,-1===be.fields.indexOf(p)&&be.fields.push(p),r[be.fieldKeys[p]]=l?void 0:new Date(d.setFullYear(n.getFullYear())).toString();break;case"Quarters":a[p=s===e.groupInterval.length-1?i:i+"_date_group_quarters"]=o;var V=Math.ceil((n.getMonth()+1)/3);be.fieldKeys[p]="CSV"===be.dataSourceSettings.type?be.fieldKeys[p]||be.fields.length:p,-1===be.fields.indexOf(p)&&be.fields.push(p),r[be.fieldKeys[p]]=l?void 0:(be.localeObj?be.localeObj.getConstant("qtr"):"Qtr")+V.toString();break;case"QuarterYear":V=(a[p=s===e.groupInterval.length-1?i:i+"_date_group_quarterYear"]=o,Math.ceil((n.getMonth()+1)/3));be.fieldKeys[p]="CSV"===be.dataSourceSettings.type?be.fieldKeys[p]||be.fields.length:p,-1===be.fields.indexOf(p)&&be.fields.push(p),r[be.fieldKeys[p]]=l?void 0:(be.localeObj?be.localeObj.getConstant("qtr"):"Qtr")+V.toString()+" "+(be.localeObj?be.localeObj.getConstant("of"):"of")+" "+n.getFullYear().toString();break;case"Months":a[p=s===e.groupInterval.length-1?i:i+"_date_group_months"]=o,be.fieldKeys[p]="CSV"===be.dataSourceSettings.type?be.fieldKeys[p]||be.fields.length:p,-1===be.fields.indexOf(p)&&be.fields.push(p),r[be.fieldKeys[p]]=l?void 0:new Date(d.setMonth(n.getMonth(),1)).toString();break;case"Days":a[p=s===e.groupInterval.length-1?i:i+"_date_group_days"]=o,be.fieldKeys[p]="CSV"===be.dataSourceSettings.type?be.fieldKeys[p]||be.fields.length:p,-1===be.fields.indexOf(p)&&be.fields.push(p),r[be.fieldKeys[p]]=l?void 0:new Date(d.setMonth(n.getMonth(),n.getDate())).toString();break;case"Hours":a[p=s===e.groupInterval.length-1?i:i+"_date_group_hours"]=o,be.fieldKeys[p]="CSV"===be.dataSourceSettings.type?be.fieldKeys[p]||be.fields.length:p,-1===be.fields.indexOf(p)&&be.fields.push(p),r[be.fieldKeys[p]]=l?void 0:new Date(d.setHours(n.getHours())).toString();break;case"Minutes":a[p=s===e.groupInterval.length-1?i:i+"_date_group_minutes"]=o,be.fieldKeys[p]="CSV"===be.dataSourceSettings.type?be.fieldKeys[p]||be.fields.length:p,-1===be.fields.indexOf(p)&&be.fields.push(p),r[be.fieldKeys[p]]=l?void 0:new Date(d.setMinutes(n.getMinutes())).toString();break;case"Seconds":a[p=s===e.groupInterval.length-1?i:i+"_date_group_seconds"]=o,be.fieldKeys[p]="CSV"===be.dataSourceSettings.type?be.fieldKeys[p]||be.fields.length:p,-1===be.fields.indexOf(p)&&be.fields.push(p),r[be.fieldKeys[p]]=l?void 0:new Date(d.setSeconds(n.getSeconds())).toString()}}}else if(isNaN(Number(r[be.fieldKeys[i]]))||"Number"!==e.type){if(r[be.fieldKeys[i]]&&"Custom"===e.type&&e.customGroups&&0<e.customGroups.length){var p=i+"_custom_group",H=e.customGroups,h=void 0;be.groupingFieldsInfo[i]=i,be.groupingFieldsInfo[p]=i;for(var s=0,_=H.length;s<_;s++){var U,u=H[s];u.items&&1<u.items.length&&(be.fieldKeys[k=p]="CSV"===be.dataSourceSettings.type?be.fieldKeys[p]||be.fields.length:p,-1===be.fields.indexOf(p)&&be.fields.push(p),U=-1!==Ce.inArray(r[be.fieldKeys[i]].toString(),u.items),r[be.fieldKeys[p]]=U?u.groupName&&""!==u.groupName?u.groupName:be.localeObj.getConstant("group")+" "+s:h&&h!==r[be.fieldKeys[i]].toString()?h:r[be.fieldKeys[i]].toString(),h=r[be.fieldKeys[p]])}}}else{l=be.getRange(e,Number(r[be.fieldKeys[i]]));r[be.fieldKeys[i]]=l?void 0:r[be.fieldKeys[i]]}for(var c=[],B=0,G=se=Object.keys(r);B<G.length;B++){var z=G[B];c.push(!!r[z])}ye=-1===c.indexOf(!1)&&se.length===Object.keys(fe[0]).length?r:ye}if("Date"===e.type){for(var g=!1,m=[be.dataSourceSettings.rows,be.dataSourceSettings.columns,be.dataSourceSettings.values,be.dataSourceSettings.filters],S=Object.keys(a),f=Object.keys(S).length,v=void 0,W=0,Q=m;W<Q.length;W++){var y=Q[W];if(!g&&y){for(var Y,b,K,C=y.length,s=0;s<C;){if(y[s].name===i){g=!0;var x=y[s];for(y.splice(s,1),I=(I=be.dataSourceSettings.rows).concat(be.dataSourceSettings.columns,be.dataSourceSettings.values,be.dataSourceSettings.filters);f--;){var w,T=x.caption||x.name;be.clonedReport&&(w=(w=be.clonedReport.rows).concat(be.clonedReport.columns,be.clonedReport.values,be.clonedReport.filters),w=Ce.getFieldByName(S[f],w))&&(T=w.caption||w.name),Ce.getFieldByName(S[f],I)?be.groupingFieldsInfo[S[f]]=i:(v=a[S[f]],T=-1!==T.indexOf(" (")&&-1!==T.indexOf(")")?T.slice(T.indexOf("(")+1,T.length-1):T,R={name:S[f],caption:(be.localeObj?be.localeObj.getConstant(v):v)+" ("+T+")",type:"Count",showNoDataItems:x.showNoDataItems,baseField:x.baseField,baseItem:x.baseItem,showFilterIcon:x.showFilterIcon,showSortIcon:x.showSortIcon,showEditIcon:x.showEditIcon,showRemoveIcon:x.showRemoveIcon,showSubTotals:x.showValueTypeIcon,allowDragAndDrop:x.allowDragAndDrop,expandAll:x.expandAll,groupName:x.groupName},y.splice(s,0,R),be.groupingFieldsInfo[R.name]=i)}break}-1<y[s].name.indexOf(i)&&(Y=a[y[s].name],b=y.filter(function(e){return e.name===i})[0],Ue.isNullOrUndefined(b)||(K=-1!==b.caption.indexOf(" (")&&-1!==b.caption.indexOf(")")?b.caption.slice(b.caption.indexOf("(")+1,b.caption.length-1):b.caption,y[s].caption=(be.localeObj?be.localeObj.getConstant(Y):b)+" ("+K+")")),s++}if(g)break}}for(var f=Object.keys(S).length,X=(F=be.getMappingField(i,(be.clonedReport||be.dataSourceSettings).fieldMapping)).caption||i;f--;){v=a[S[f]];for(var J,M,s=0,Z=be.dataSourceSettings.formatSettings.length;s<Z;s++)if(be.dataSourceSettings.formatSettings[s].name===S[f]){be.dataSourceSettings.formatSettings.splice(s,1);break}"Quarters"!==v&&"QuarterYear"!==v&&(J={name:S[f],type:-1<["Years","Months","Days"].indexOf(v)?"date":"time",format:"Years"===v?"yyyy":"Months"===v?"MMM":"Days"===v?"d-MMM":"Hours"===v?"hh a":"Minutes"===v?":mm":"Seconds"===v?":ss":void 0},be.dataSourceSettings.formatSettings.push(J)),g||(M=be.getMappingField(S[f],be.dataSourceSettings.fieldMapping),S[f]!==i&&Ue.isNullOrUndefined(M.name)?(R={name:S[f],caption:(be.localeObj?be.localeObj.getConstant(v):v)+" ("+X+")"},be.dataSourceSettings.fieldMapping.push(R),be.groupingFieldsInfo[R.name]=i):S[f]!==i&&(M.caption=(be.localeObj?be.localeObj.getConstant(v):v)+" ("+X+")",be.groupingFieldsInfo[M.name]=i))}g||(M=be.getMappingField(i,be.dataSourceSettings.fieldMapping),v=a[i],S[f]!==i&&Ue.isNullOrUndefined(M.name)?(R={name:i,caption:(be.localeObj?be.localeObj.getConstant(v):v)+" ("+X+")"},be.dataSourceSettings.fieldMapping.push(R),be.groupingFieldsInfo[R.name]=i):(M.caption=(be.localeObj?be.localeObj.getConstant(v):v)+" ("+X+")",be.groupingFieldsInfo[M.name]=i))}else if("Number"===e.type&&e.rangeInterval){for(var $=[],ee=[],te=fe.length,C=0,D=(be.groupingFields[i]=i,[]);C<te;){var ie=Number(fe[C][i]);ee.push(ie),isNaN(ie)||-1!==$.indexOf(ie)||$.push(ie),C++}for(te=fe.length,C=0;C<te;){var O=fe[C];if(O&&!isNaN(Number(O[i]))){var ae=("string"==typeof e.endingAt?parseInt(e.endingAt,10):e.endingAt)||Math.max.apply(Math,$),P=Math.round(Number(O[i])),re=Math.round(P+(e.rangeInterval-1));if(P>=D[0]&&P<=D[D.length-1]){var N=D[0],E=D[D.length-1];O[i]=be.getNumberGroupHeaders(N,E,ae),Ue.isNullOrUndefined(be.groupedDataType[i])&&(be.groupedDataType[i]="string")}else if(0===D.length){for(s=P;s<=re;s++)D.push(s);N=D[0],E=D[D.length-1];O[i]=be.getNumberGroupHeaders(N,E,ae),Ue.isNullOrUndefined(be.groupedDataType[i])&&(be.groupedDataType[i]="string")}else{var E=(N=D[D.length-1]+1)+(e.rangeInterval-1),ne=!0;for(D.splice(0,D.length);ne;)N<=P&&P<=E&&(O[i]=be.getNumberGroupHeaders(N,E,ae),Ue.isNullOrUndefined(be.groupedDataType[i])&&(be.groupedDataType[i]="string"),D.push(N),D.push(E),ne=!1),E=(N=E+1)+(e.rangeInterval-1)}for(var se,c=[],oe=0,le=se=Object.keys(O);oe<le.length;oe++){z=le[oe];c.push(!!O[z])}ye=-1===c.indexOf(!1)&&se.length===Object.keys(fe[0]).length?O:ye}C++}for(var de=0,pe=m=[be.dataSourceSettings.rows,be.dataSourceSettings.columns,be.dataSourceSettings.values,be.dataSourceSettings.filters];de<pe.length;de++){var F,he=pe[de];(F=Ce.getFieldByName(i,he))&&((F=F.properties||F).type="Count")}for(var s=0,ue=be.dataSourceSettings.formatSettings.length;s<ue;s++)if(be.dataSourceSettings.formatSettings[s].name===i){be.dataSourceSettings.formatSettings.splice(s,1);break}}else if("Custom"===e.type&&k){for(var I,L=k,g=!1,m=[be.dataSourceSettings.rows,be.dataSourceSettings.columns,be.dataSourceSettings.values,be.dataSourceSettings.filters],ce=(I=(I=be.dataSourceSettings.rows).concat(be.dataSourceSettings.columns,be.dataSourceSettings.values,be.dataSourceSettings.filters),[]),ge=(t&&""!==t||(ce=L.match(/_custom_group/g)),Ce.getFieldByName(i.replace(/_custom_group/g,""),I)),A=Ce.getFieldByName(L,I),me=0,Se=m;me<Se.length;me++){y=Se[me];if(!g&&y){for(C=y.length,s=0;s<C;){if(y[s].name===e.name&&!A){g=!0;var x=y[s],R={name:L,caption:t&&""!==t?t:(ge.caption||ge.name)+(ce.length+1),type:"Count",showNoDataItems:x.showNoDataItems,baseField:x.baseField,baseItem:x.baseItem,showSubTotals:x.showValueTypeIcon,allowDragAndDrop:x.allowDragAndDrop,showFilterIcon:x.showFilterIcon,showSortIcon:x.showSortIcon,showRemoveIcon:x.showRemoveIcon,showEditIcon:x.showEditIcon,expandAll:x.expandAll,groupName:x.groupName};y.splice(s,0,R),be.groupingFieldsInfo[R.name]=i,be.groupingFieldsInfo[i]=i;break}if(y[s].name===L&&A){R={name:A.name,caption:t&&""!==t?t:A.caption,type:A.type,showNoDataItems:A.showNoDataItems,baseField:A.baseField,baseItem:A.baseItem,showRemoveIcon:A.showRemoveIcon,showSubTotals:A.showValueTypeIcon,allowDragAndDrop:A.allowDragAndDrop,showFilterIcon:A.showFilterIcon,showSortIcon:A.showSortIcon,showEditIcon:A.showEditIcon,expandAll:A.expandAll,groupName:A.groupName};y.splice(s,1,R),be.groupingFieldsInfo[R.name]=i,be.groupingFieldsInfo[i]=i;break}s++}if(g)break}}m=Ce.getFieldByName(i,Ce.cloneFormatSettings(be.dataSourceSettings.formatSettings));m&&(m.name=L,be.dataSourceSettings.formatSettings.push(m)),be.groupingFields[i]=i}be.groupingFields=Ue.extend(be.groupingFields,a)}(t[e]);if("object"==typeof i)return i.value}return ye},t.prototype.getNumberGroupHeaders=function(e,t,i){return e===t?e.toString():e<=i&&i<=t?i===e?e.toString():e.toString()+"-"+i.toString():e.toString()+"-"+t.toString()},t.prototype.getRange=function(e,t){var i,a,r;return"Date"===e.type?(r=new Date(t),a="string"==typeof e.startingAt?new Date(e.startingAt):e.startingAt,i="string"==typeof e.endingAt?new Date(e.endingAt):e.endingAt,!!(a&&r.getTime()<a.getTime()||i&&r.getTime()>i.getTime())):(a="string"==typeof e.startingAt?parseInt(e.startingAt,10):e.startingAt,r="string"==typeof e.endingAt?parseInt(e.endingAt,10):e.endingAt,!isNaN(a)&&t<a||!isNaN(r)&&r<t)},t.prototype.getPercentFormat=function(e,t){e=Ue.isNullOrUndefined(e[t])||Ue.isNullOrUndefined(this.formatFields[t].format)?void 0:this.formatFields[t].format.toLowerCase().match(/p[0-9]/);return Ue.isNullOrUndefined(e)?2:Number(this.formatFields[t].format.replace(/[^0-9]/g,""))},t.prototype.getFormattedFields=function(e){this.formatFields=this.setFormattedFields(e.formatSettings)},t.prototype.setFormattedFields=function(e){for(var t=e.length,i={};t--;)i[e[t].name]=e[t],e[t].type&&(this.dateFormatFunction[e[t].name]={exactFormat:this.globalize.getDateFormat(e[t]),fullFormat:this.globalize.getDateFormat({format:"yyyy/MM/dd/HH/mm/ss",type:e[t].type})});return i},t.prototype.getFieldList=function(e,t,i){for(var a=this.dataSourceSettings.excludeFields.length-1;-1<a;){var r=this.fields.indexOf(this.dataSourceSettings.excludeFields[a]);-1!==r&&this.fields.splice(r,1),this.fieldList&&delete this.fieldList[this.dataSourceSettings.excludeFields[a]],a--}var n=this.fields,s=(s=Ue.extend([],this.dataSourceSettings.rows,null,!0)).concat(this.dataSourceSettings.columns,this.dataSourceSettings.values,this.dataSourceSettings.filters);this.getFormattedFields(this.dataSourceSettings),this.getCalculatedField(n);var o=(n=this.fields).length,l=["string","number","datetime","date","boolean"];if(this.savedFieldList)for(this.fieldList=this.savedFieldList;o--;){var d=n[o],p=this.getMappingField(d,this.dataSourceSettings.fieldMapping);this.fieldList[d]?(this.fieldList[d].isSelected=!1,this.fieldList[d].index=o,this.fieldList[d].filter=[],this.fieldList[d].sort=t?"Ascending":"None",this.fieldList[d].isExcelFilter=!1,this.fieldList[d].filterType="",this.fieldList[d].showFilterIcon=!(p&&"showFilterIcon"in p)||p.showFilterIcon,this.fieldList[d].showRemoveIcon=!(p&&"showRemoveIcon"in p)||p.showRemoveIcon,this.fieldList[d].showSortIcon=!(p&&"showSortIcon"in p)||p.showSortIcon,this.fieldList[d].showEditIcon=!(p&&"showEditIcon"in p)||p.showEditIcon,this.fieldList[d].showValueTypeIcon=!(p&&"showValueTypeIcon"in p)||p.showValueTypeIcon,this.fieldList[d].allowDragAndDrop=!(p&&"allowDragAndDrop"in p)||p.allowDragAndDrop,this.fieldList[d].isCalculatedField=!!(p&&"isCalculatedField"in p)&&p.isCalculatedField,this.fieldList[d].showNoDataItems=!!(p&&"showNoDataItems"in p)&&p.showNoDataItems,this.fieldList[d].showSubTotals=!(p&&"showSubTotals"in p)||p.showSubTotals,this.fieldList[d].expandAll=!!(p&&"expandAll"in p)&&p.expandAll,this.fieldList[d].pid=p&&"groupName"in p&&p.groupName?p.groupName:this.groupingFieldsInfo[d]||void 0,this.isValueFiltersAvail&&i&&(this.fieldList[d].dateMember=[],this.fieldList[d].members={},this.fieldList[d].isMembersFilled=!1)):(h=Ue.isNullOrUndefined(this.groupedDataType[d])?p&&"dataType"in p&&p.dataType&&-1<l.indexOf(p.dataType.toLowerCase())?p.dataType.toLowerCase():h:this.groupedDataType[d],this.fieldList[d]={caption:p&&"caption"in p&&p.caption?p.caption:d,id:d,type:-1!==d.indexOf("_custom_group")||-1!==d.indexOf("_date_group")?"string":void 0===h||"undefined"===h?"number":h,isSelected:!1,sort:t?"Ascending":"None",filterType:"",index:o,filter:[],isCustomField:-1!==d.indexOf("_custom_group")||-1!==d.indexOf("_date_group"),showRemoveIcon:!(p&&"showRemoveIcon"in p)||p.showRemoveIcon,showFilterIcon:!(p&&"showFilterIcon"in p)||p.showFilterIcon,showSortIcon:!(p&&"showSortIcon"in p)||p.showSortIcon,showNoDataItems:!!(p&&"showNoDataItems"in p)&&p.showNoDataItems,isCalculatedField:!!(p&&"isCalculatedField"in p)&&p.isCalculatedField,showEditIcon:!(p&&"showEditIcon"in p)||p.showEditIcon,showValueTypeIcon:!(p&&"showValueTypeIcon"in p)||p.showValueTypeIcon,allowDragAndDrop:!(p&&"allowDragAndDrop"in p)||p.allowDragAndDrop,showSubTotals:!(p&&"showSubTotals"in p)||p.showSubTotals,expandAll:!!(p&&"expandAll"in p)&&p.expandAll,pid:p&&"groupName"in p&&p.groupName?p.groupName:this.groupingFieldsInfo[d]||void 0,aggregateType:p&&"type"in p?p.type:"number"===(-1!==d.indexOf("_custom_group")||-1!==d.indexOf("_date_group")?"string":void 0===h||"undefined"===h?"number":h)?"Sum":"Count",baseField:p&&"baseField"in p?p.baseField:void 0,baseItem:p&&"baseItem"in p?p.baseItem:void 0}),this.updateMembersOrder(d)}else for(this.fieldList={};o--;){var d=n[o],p=this.getMappingField(d,this.dataSourceSettings.fieldMapping),h=Ue.isNullOrUndefined(this.groupedDataType[d])?p&&"dataType"in p&&p.dataType&&-1<l.indexOf(p.dataType.toLowerCase())?p.dataType.toLowerCase():Ce.getType(e[this.fieldKeys[d]]):this.groupedDataType[d];this.fieldList[d]={id:d,pid:p&&"groupName"in p&&p.groupName?p.groupName:this.groupingFieldsInfo[d]||void 0,caption:p&&"caption"in p&&p.caption?p.caption:d,type:-1!==d.indexOf("_custom_group")||-1!==d.indexOf("_date_group")?"string":void 0===h||"undefined"===h?"number":h,filterType:"",index:o,filter:[],sort:t?"Ascending":"None",isSelected:!1,isCustomField:-1!==d.indexOf("_custom_group")||-1!==d.indexOf("_date_group"),showFilterIcon:!(p&&"showFilterIcon"in p)||p.showFilterIcon,showRemoveIcon:!(p&&"showRemoveIcon"in p)||p.showRemoveIcon,showSortIcon:!(p&&"showSortIcon"in p)||p.showSortIcon,showEditIcon:!(p&&"showEditIcon"in p)||p.showEditIcon,showValueTypeIcon:!(p&&"showValueTypeIcon"in p)||p.showValueTypeIcon,allowDragAndDrop:!(p&&"allowDragAndDrop"in p)||p.allowDragAndDrop,showSubTotals:!(p&&"showSubTotals"in p)||p.showSubTotals,showNoDataItems:!!(p&&"showNoDataItems"in p)&&p.showNoDataItems,isCalculatedField:!!(p&&"isCalculatedField"in p)&&p.isCalculatedField,expandAll:!!(p&&"expandAll"in p)&&p.expandAll,aggregateType:p&&"type"in p?p.type:"number"===(-1!==d.indexOf("_custom_group")||-1!==d.indexOf("_date_group")?"string":void 0===h||"undefined"===h?"number":h)?"Sum":"Count",baseField:p&&"baseField"in p?p.baseField:void 0,baseItem:p&&"baseItem"in p?p.baseItem:void 0},this.updateMembersOrder(d)}this.groupedDataType={},this.updateTreeViewData(s)},t.prototype.updateMembersOrder=function(e){for(var t=0,i=this.dataSourceSettings.sortSettings;t<i.length;t++){var a=i[t];if(e===a.name&&a.membersOrder){this.fieldList[e].membersOrder=a.membersOrder;break}}},t.prototype.getMappingField=function(e,t){var i={};if(t&&0<t.length)for(var a=0,r=t.length;a<r;a++)if(t[a].name===e){i=t[a];break}return i},t.prototype.updateFieldList=function(e){for(var t=this.fields,i=t.length;i--;)this.fieldList[t[i]].isExcelFilter=e[t[i]].isExcelFilter},t.prototype.updateTreeViewData=function(e){for(var t,r=this,i=e.length,a=this.dataSourceSettings.calculatedFieldSettings.length;i--;)this.fieldList[e[i].name]&&((t=this.fieldList[e[i].name]).type=e[i].dataType?e[i].dataType.toLowerCase():t.type,t.caption=e[i].caption||e[i].name,t.isSelected=!0,t.showNoDataItems=e[i].showNoDataItems,t.aggregateType=e[i].type,t.baseField=e[i].baseField,t.baseItem=e[i].baseItem,t.allowDragAndDrop=e[i].allowDragAndDrop,t.showFilterIcon=e[i].showFilterIcon,t.showSortIcon=e[i].showSortIcon,t.showRemoveIcon=e[i].showRemoveIcon,t.showValueTypeIcon=e[i].showValueTypeIcon,t.showEditIcon=e[i].showEditIcon,t.showSubTotals=e[i].showSubTotals,t.expandAll=e[i].expandAll);for(;a--;)this.fieldList[this.dataSourceSettings.calculatedFieldSettings[a].name]&&(this.fieldList[this.dataSourceSettings.calculatedFieldSettings[a].name].aggregateType="CalculatedField",this.fieldList[this.dataSourceSettings.calculatedFieldSettings[a].name].isCalculatedField=!0,this.fieldList[this.dataSourceSettings.calculatedFieldSettings[a].name].formula=this.dataSourceSettings.calculatedFieldSettings[a].formula);var n=this.dataSourceSettings.groupSettings.filter(function(t){return!e.some(function(e){return t.name===e.name})}),s=["_date_group_years","_date_group_quarters","_date_group_quarterYear","_date_group_months","_date_group_days","_date_group_hours","_date_group_minutes","_date_group_seconds"];n.forEach(function(e){var i=e.name,a=e.type.toLowerCase();Object.keys(r.fieldList).forEach(function(t){"date"!==a||Ue.isNullOrUndefined(e.caption)||!s.some(function(e){return t===""+i+e})&&t!==i?("custom"===a&&!Ue.isNullOrUndefined(e.caption)&&t===i+"_custom_group"||"number"===a&&!Ue.isNullOrUndefined(e.caption)&&t===i)&&(r.fieldList[t].caption=e.caption):r.fieldList[t].caption=r.fieldList[t].caption.replace(e.name,e.caption)})})},t.prototype.getCalculatedField=function(h){for(var e=0,t=this.dataSourceSettings.calculatedFieldSettings;e<t.length;e++){var i=t[e];this.calculatedFields[i.name]=Ue.extend({},i,null,!0),this.calculatedFields[i.name].actualFormula=i.formula}for(var u=Object.keys(this.calculatedFields),c=this,a=0,r=u.length;a<r;a++)!function(e){for(var t=c.calculatedFields[u[e]],e=t.properties,i=(e||t).formula.trim(),a=i.replace(/"/g,""),r=(t.formula=-1<a.indexOf("^")?c.powerFunction(a):a,-1===t.formula.indexOf("Math.min(")&&-1<t.formula.indexOf("min(")&&(t.formula=t.formula.replace(/min\(/g,"Math.min(")),-1===t.formula.indexOf("Math.max(")&&-1<t.formula.indexOf("max(")&&(t.formula=t.formula.replace(/max\(/g,"Math.max(")),-1===t.formula.indexOf("Math.abs(")&&-1<t.formula.indexOf("abs(")&&(t.formula=t.formula.replace(/abs\(/g,"Math.abs(")),t.name=(e||t).name,"CSV"===c.dataSourceSettings.type?-1===h.indexOf(t.name)&&h.push(t.name):(h=h.filter(function(e){return e!==t.name})).push(t.name),i.split('"')),n=0,s=r.length;n<s;n++){var o=r[n].trim(),l=o.split(/[ .:;?!~,`"&|()<>{}[\]\r\n/\\]+/),d=o.match(/^([^()]+)\((.*)\)$/),p="DistinctCount"===l[0]?"DistinctCount":"PopulationStDev"===l[0]?"PopulationStDev":"SampleStDev"===l[0]?"SampleStDev":"PopulationVar"===l[0]?"PopulationVar":"SampleVar"===l[0]?"SampleVar":l[0];-1!==["Sum","Count","Min","Max","Avg","Product","DistinctCount","PopulationStDev","SampleStDev","PopulationVar","SampleVar","Median"].indexOf(p)&&(d=-1===h.indexOf(l[1])&&d[2]?h.indexOf(d[2]):h.indexOf(l[1]),c.calculatedFormulas[t.name]?c.calculatedFormulas[t.name].push({index:d,type:p,formula:o}):c.calculatedFormulas[t.name]=[{index:d,type:p,formula:o}])}}(a);this.fields=h},t.prototype.validateFilters=function(e){this.isValueFiltersAvail=!1;for(var e=e.filterSettings||[],t=(t=Ue.extend([],this.dataSourceSettings.rows,null,!0)).concat(this.dataSourceSettings.columns),i=0,a=e;i<a.length;i++){for(var r=a[i],n=0,s=t;n<s.length;n++){var o=s[n];if(r.name===o.name&&"Value"===r.type){this.isValueFiltersAvail=!0;break}}if(this.isValueFiltersAvail)break}},t.prototype.validateValueFields=function(){this.isValueHasAdvancedAggregate=!1;for(var e=0,t=this.dataSourceSettings.values;e<t.length;e++){var i=t[e];if(-1!==["DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal","RunningTotals"].indexOf(i.type)){this.isValueHasAdvancedAggregate=!0;break}}},t.prototype.fetchFieldMembers=function(e){e=this.fieldList[e].index;this.generateMembers(e,new Set)},t.prototype.generateMembers=function(e,t){var i=this.data.length,a=this.fields,r=this.fieldList,n=a[e],s=(r[n].members&&!this.allowDataCompression||(r[n].members={},this.allowDataCompression&&(r[n].isMembersFilled=!1)),r[n].dateMember&&!this.allowDataCompression||(r[n].dateMember=[]),r[n].members),o=r[n].dateMember;if((r[n].isSelected||t.has(e))&&!r[n].isMembersFilled){for(var l=0<Object.keys(s).length,d=0,p=r[n].expandAll,h=Ce.isDateField(n,this),u=0;u<i;u++){var c=this.data[u][this.fieldKeys[n]],g=c,g=this.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(g):g,m=(l||(m=h?this.getFormattedValue(g,n):{formattedText:null===g?this.localeObj?this.localeObj.getConstant("null"):String(g):void 0===g?this.localeObj?n in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(g):g.toString(),actualText:null===g?this.localeObj?this.localeObj.getConstant("null"):String(g):void 0===g?this.localeObj?n in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(g):g},Object.prototype.hasOwnProperty.call(s,g)?s[g].index.push(u):(d++,s[g]={index:[u],ordinal:d,isDrilled:this.isExpandAll||p,caption:m.formattedText},o.push({formattedText:m.formattedText,actualText:h?m.dateText:m.actualText}))),Ue.isNullOrUndefined(c)?c:"number"===r[n].type?isNaN(Number(c))?void 0:Number(c):1),c={ordinal:s[g].ordinal,member:m};this.valueMatrix[u]||(this.valueMatrix[u]=[]),this.valueMatrix[u][e]=c}r[n].isMembersFilled=!0}},t.prototype.fillFieldMembers=function(){var e=this.fields,t=this.fieldList,i=e.length,a=(this.data.length-this.valueMatrix.length<0&&(this.valueMatrix=this.valueMatrix.slice(0,this.data.length)),new Set);if(this.calculatedFormulas&&0<Object.keys(this.calculatedFormulas).length)for(var r in this.calculatedFormulas)if(t[r]&&t[r].isSelected)for(var n=this.calculatedFormulas[r],s=0;s<n.length;s++){var o=n[s];a.add(o.index)}for(var l=0;l<i;l++)this.generateMembers(l,a)},t.prototype.generateValueMatrix=function(){for(var e=this.fields,t=this.data.length,i=e.length,a=this.fieldList;t--;)for(var r=i;r--;){var n=e[r],s=a[n];s.isMembersFilled&&(n=this.data[t][this.fieldKeys[n]],this.valueMatrix[t][r].member=Ue.isNullOrUndefined(n)?n:"number"===s.type?isNaN(Number(n))?void 0:Number(n):1)}},t.prototype.updateSortSettings=function(e,t){for(var i=0,a=e?e.length:0;i<a&&t;i++)this.fieldList[e[i].name]&&(this.fieldList[e[i].name].sort=e[i].order)},t.prototype.updateFilterMembers=function(e){var t=this.filterMembers,i={},e=this.getFilters(e,i),a=this.valueMatrix.length;if(e)for(var r=i.include.index,n=0;n<r.length;n++)void 0!==i.exclude&&void 0!==i.exclude.indexObject[r[n]]||t.push(r[n]);else for(n=0;n<a;n++)void 0!==i.exclude&&void 0!==i.exclude.indexObject[n]||t.push(n)},t.prototype.getFilters=function(e,t){for(var i=e.filterSettings||[],a=!1,r=[],n=0,s=i.length;n<s;n++){var o=i[n].properties||i[n];this.fieldList[o.name]&&this.fieldList[o.name].isSelected&&this.isValidFilterField(o,e.allowMemberFilter,e.allowLabelFilter)&&(this.applyLabelFilter(o),o&&(r=o.items),o.type&&"Include"===o.type?(this.frameFilterList(r,o.name,t,"include",o.showLabelFilter,a),a=!0):this.frameFilterList(r,o.name,t,"exclude",o.showLabelFilter),o.showLabelFilter)&&(o.items=[],o.type=o.showDateFilter?"Date":o.showNumberFilter?"Number":"Label")}return a},t.prototype.isValidFilterField=function(e,t,i){var a=e.name,r=!1,n=(n=Ue.extend([],this.dataSourceSettings.rows,null,!0)).concat(this.dataSourceSettings.columns);if(this.fieldList[a].isSelected&&t&&0<=["Include","Exclude"].indexOf(e.type)){for(var r=!0,s=0,o=this.dataSourceSettings.values;s<o.length;s++)if(a===o[s].name){r=!1;break}}else if(i)for(var l=0,d=n;l<d.length;l++)if(a===d[l].name&&0<=["Label","Date","Number"].indexOf(e.type)){r=!0;break}return r},t.prototype.applyLabelFilter=function(e){if(0<=["Label","Date","Number"].indexOf(e.type)){var t=Object.keys(this.fieldList[e.name].members);if(e.showLabelFilter=!0,"Label"===e.type)e.items=this.getLabelFilterMembers(t,e.condition,e.value1,e.value2);else if("Date"===e.type){e.showDateFilter=!0;var i="string"==typeof e.value1?new Date(e.value1):e.value1,a="string"==typeof e.value2?new Date(e.value2):e.value2;e.items=this.getDateFilterMembers(t,e.name,e.condition,i,a)}else{e.showNumberFilter=!0,e.items=[];for(var r=0,n=t;r<n.length;r++){var s=n[r],o=this.getParsedValue(e.name,e.value1),l=this.getParsedValue(e.name,e.value2),d=this.getParsedValue(e.name,s);this.validateFilterValue(d,e.condition,o,l)&&e.items.push(s)}}e.type=!e.condition||-1<["DoesNotBeginWith","DoesNotContains","DoesNotEndsWith","DoesNotEquals","NotBetween"].indexOf(e.condition)&&!e.showNumberFilter?"Exclude":"Include"}else e.showLabelFilter=!1},t.prototype.getLabelFilterMembers=function(e,t,i,a){for(var r=[],n=0,s=e;n<s.length;n++){var o=s[n],l=o.toLowerCase();if(i.toString())switch(t){case"Equals":case"DoesNotEquals":l===i.toLowerCase()&&r.push(o);break;case"BeginWith":case"DoesNotBeginWith":0===l.indexOf(i.toLowerCase())&&r.push(o);break;case"EndsWith":case"DoesNotEndsWith":null!==l.match(i.toLowerCase()+"$")&&r.push(o);break;case"Contains":case"DoesNotContains":-1<l.indexOf(i.toLowerCase())&&r.push(o);break;case"GreaterThan":l>i.toLowerCase()&&r.push(o);break;case"GreaterThanOrEqualTo":l>=i.toLowerCase()&&r.push(o);break;case"LessThan":l<i.toLowerCase()&&r.push(o);break;case"LessThanOrEqualTo":l<=i.toLowerCase()&&r.push(o);break;case"Between":case"NotBetween":l>=i.toLowerCase()&&l<=a.toLowerCase()&&r.push(o);break;default:l===i.toLowerCase()&&r.push(o)}}return r},t.prototype.getDateFilterMembers=function(e,t,i,a,r){for(var n=[],s=0,o=e;s<o.length;s++){var l=o[s],d=new Date(l);if(a)switch(i){case"Equals":case"DoesNotEquals":this.getFormattedValue(d.toString(),t).formattedText===this.getFormattedValue(a.toString(),t).formattedText&&n.push(this.getFormattedValue(l,t).formattedText);break;case"After":d.getTime()>a.getTime()&&n.push(this.getFormattedValue(l,t).formattedText);break;case"AfterOrEqualTo":d.getTime()>=a.getTime()&&n.push(this.getFormattedValue(l,t).formattedText);break;case"Before":d.getTime()<a.getTime()&&n.push(this.getFormattedValue(l,t).formattedText);break;case"BeforeOrEqualTo":d.getTime()<=a.getTime()&&n.push(this.getFormattedValue(l,t).formattedText);break;case"Between":case"NotBetween":d.getTime()>=a.getTime()&&d.getTime()<=r.getTime()&&n.push(this.getFormattedValue(l,t).formattedText);break;default:this.getFormattedValue(d.toString(),t).formattedText===this.getFormattedValue(a.toString(),t).formattedText&&n.push(this.getFormattedValue(l,t).formattedText)}}return n},t.prototype.validateFilterValue=function(e,t,i,a){var r=!1;if("number"==typeof i)switch(t){case"Equals":e===i&&(r=!0);break;case"DoesNotEquals":e!==i&&(r=!0);break;case"GreaterThan":i<e&&(r=!0);break;case"GreaterThanOrEqualTo":i<=e&&(r=!0);break;case"LessThan":e<i&&(r=!0);break;case"LessThanOrEqualTo":e<=i&&(r=!0);break;case"Between":i<=e&&e<=a&&(r=!0);break;case"NotBetween":i<=e&&e<=a||(r=!0);break;default:e!==i&&(r=!0)}return r},t.prototype.frameFilterList=function(e,t,i,a,r,n){i[a]||(i[a]={indexObject:{},index:[]}),this.updateFilter(e,t,i,a,r,n)},t.prototype.updateFilter=function(e,t,i,a,r,n){var s=0,o=this.fieldList[t],l=(o.filter=e,o.filterType=a,o.isExcelFilter=r,Ce.getFormattedMembers(o.members,t,this)),d=n,p={},h={};for(p[a]={indexObject:{},index:[]},this.fieldFilterMem[t]={memberObj:{}};!Ue.isNullOrUndefined(e[s]);){if(l[e[s]]){var u=l[e[s]].index;if("include"===a)for(var c=0,g=u.length;c<g;c++)d&&void 0===i[a].indexObject[u[c]]||(p[a].indexObject[u[c]]=u[c],p[a].index.push(u[c]));else{for(c=0,g=u.length;c<g;c++)void 0===i[a].indexObject[u[c]]&&(i[a].indexObject[u[c]]=u[c],i[a].index.push(u[c]));this.fieldFilterMem[t].memberObj[e[s]]=e[s]}}s++}if("include"===a){i[a]=p[a];for(c=0;c<e.length;c++)l[e[c]]&&(h[e[c]]=e[c]);for(var m=Object.keys(l),c=0,g=m.length;c<g;c++)void 0===h[m[c]]&&(this.fieldFilterMem[t].memberObj[m[c]]=m[c])}},t.prototype.applyValueFiltering=function(e,t,i,a,r,n,s){this.isValueFiltered=!1;var o=Ue.extend({},"row"===s&&this.rowGrandTotal?this.rowGrandTotal:"column"===s&&this.columnGrandTotal?this.columnGrandTotal:"Top"!==this.dataSourceSettings.grandTotalsPosition?i[i.length-1]:i[0],null,!0);return this.getFilteredData(i,a,r,n,t,e.name,o,s),this.isValueFiltered&&(("row"===s&&null===this.rowGrandTotal||"column"===s&&null===this.columnGrandTotal)&&n.push(o),i=n),i},t.prototype.getFilteredData=function(e,t,i,a,r,n,s,o){for(var l,d,p,h,u=e.length,c=0;c<u;c++)i[n]&&(e[c].level===r?(this.isValueFiltered=!0,this.fieldList[n].isExcelFilter=!0,l=0,h=i[n].measure,p=this.fieldList[h].index,d=this.fieldList[h].aggregateType,this.rawIndexObject={},l="row"===o?this.getAggregateValue(e[c].index,t.indexObject,p,d,!1):this.getAggregateValue(t.index,e[c].indexObject,p,d,!1),p={fieldName:h,row:e[c],column:t,value:l,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:e[c].hasChild&&e[c].isDrilled?"subTotal":"grand sum"===e[c].type?"grandTotal":"value",columnCellType:t.hasChild&&t.isDrilled?"subTotal":"grand sum"===t.type?"grandTotal":"value",aggregateType:d,skipFormatting:!1},this.getValueCellInfo&&this.getValueCellInfo(p),l=p.value,this.rawIndexObject={},d=this.getParsedValue(h,i[n].value1),p=this.getParsedValue(h,i[n].value2),this.validateFilterValue(l,i[n].condition,d,p)||"grand sum"===e[c].type?"grand sum"!==e[c].type&&(a.push(Ue.extend({},e[c],null,!0)),a[a.length-1].isLevelFiltered=!0):(h=this.removefilteredData(e[c],this.valueFilteredData)||e[c],this.validateFilteredParentData(h,this.valueFilteredData,s,0,r,o))):e[c].hasChild&&0<e[c].members.length&&"grand sum"!==e[c].type&&(a.push(Ue.extend({},e[c],null,!0)),a[a.length-1].members=[],a[a.length-1].isLevelFiltered=!0,this.getFilteredData(e[c].members,t,i,a[a.length-1].members,r,n,s,o)))},t.prototype.getParsedValue=function(e,t){var i=t?t.toString():"";return this.formatFields[e]&&t?(delete(t=Ue.extend({},this.formatFields[e],null,!0)).name,this.globalize.parseNumber(i,t)):this.globalize.parseNumber(i,{format:"N"})},t.prototype.removefilteredData=function(e,t){for(var i,a=Ue.extend([],t,null,!0),r=0;r<a.length;r++){if(e.isLevelFiltered&&e.axis===a[r].axis&&e.valueSort.levelName===a[r].valueSort.levelName&&e.actualText===a[r].actualText&&e.axis===a[r].axis&&e.level===a[r].level&&e.ordinal===a[r].ordinal){i=a[r],t.splice(r,1);break}t[r].hasChild&&0<t[r].members.length&&this.removefilteredData(e,t[r].members)}return i},t.prototype.validateFilteredParentData=function(e,t,i,a,r,n){if(0<t.length)for(var s=0,o=t;s<o.length;s++){var l=o[s];if(l.level===a){if("row"===n)for(var d=0,p=u=e.index;d<p.length;d++){var h=p[d];0<=i.index.indexOf(h)&&i.index.splice(i.index.indexOf(h),1),0<=e.valueSort.levelName.toString().indexOf(l.valueSort.levelName.toString())&&l.level!==r&&0<=l.index.indexOf(h)&&l.index.splice(l.index.indexOf(h),1)}else for(var u=e.indexObject,c=0,g=Object.keys(u);c<g.length;c++){h=g[c];Object.prototype.hasOwnProperty.call(u,h)&&(delete i.indexObject[h],0<=e.valueSort.levelName.toString().indexOf(l.valueSort.levelName.toString()))&&l.level!==r&&delete l.indexObject[h]}l&&0<l.members.length&&l.members[0].level===a+1&&l.members[0].level!==r&&this.validateFilteredParentData(e,l.members,i,a+1,r,n)}}else if("row"===n)for(var m=0,S=u=e.index;m<S.length;m++){h=S[m];0<=i.index.indexOf(h)&&i.index.splice(i.index.indexOf(h),1)}else for(var u=e.indexObject,f=0,v=Object.keys(u);f<v.length;f++){h=v[f];Object.prototype.hasOwnProperty.call(u,h)&&delete i.indexObject[h]}},t.prototype.updateFramedHeaders=function(e,t,i,a,r){for(var n=0,s=e;n<s.length;n++){var o=s[n];this.isHeaderAvail=!1,(this.validateFilteredHeaders(o,i,r)||"grand sum"===o.type)&&("row"===r?this.rowCount+=this.rowValuesLength:this.columnCount+=this.customProperties.isTabularLayout?this.rowMaxLevel+this.colValuesLength:this.colValuesLength,a.push(Ue.extend({},o,null,!0)),a[a.length-1].members=[],o.hasChild)&&o.isDrilled&&0<o.members.length&&this.updateFramedHeaders(o.members,t,i,a[a.length-1].members,r)}return this.filterFramedHeaders},t.prototype.validateFilteredHeaders=function(e,t,i){for(var a=0,r=t;a<r.length;a++){var n=r[a];if(!this.isHeaderAvail){if(e.actualText===n.actualText&&e.level===n.level&&e.valueSort.levelName===n.valueSort.levelName)return"row"===i?0<n.index.length?(this.isHeaderAvail=!0,e.index=n.index,!0):(this.isHeaderAvail=!1,e.index=n.index,!1):0<Object.keys(n.indexObject).length?(this.isHeaderAvail=!0,e.indexObject=n.indexObject,!0):(this.isHeaderAvail=!1,e.indexObject=n.indexObject,!1);n.hasChild&&0<n.members.length&&"grand sum"!==n.type&&this.validateFilteredHeaders(e,n.members,i)}}return this.isHeaderAvail},t.prototype.isEmptyDataAvail=function(e,t){this.isEmptyData=!1,0<e.length&&"grand sum"===e[e.length-1].type&&0===e[e.length-1].index.length&&(this.isEmptyData=!0),0<t.length&&"grand sum"===t[t.length-1].type&&0===Object.keys(t[t.length-1].indexObject).length&&(this.isEmptyData=!0),0!==e.length&&0!==t.length||(this.isEmptyData=!0)},t.prototype.updateGridData=function(e){this.updateDataSourceSettings(e,!0),this.data=e.dataSource,this.allowDataCompression&&(this.actualData=this.data,this.data=this.getGroupedRawData(e));for(var t=0,i=this.fields;t<i.length;t++){var a=i[t];this.fieldList[a].members={},this.fieldList[a].dateMember=[],this.fieldList[a].isMembersFilled=!1}this.fillFieldMembers(),this.filterMembers=[],this.cMembers=[],this.rMembers=[],this.updateFilterMembers(e),this.isEditing=!0,this.isDrillThrough=!0,this.generateGridData(e),this.isEditing=!1},t.prototype.generateGridData=function(e,t,i,a){void 0===t&&(t=!1),Ue.isNullOrUndefined(a)&&this.customProperties.isTabularLayout&&(this.rowMaxLevel=0),this.updateDataSourceSettings(e,t);var r=e.columns||[],t=this.data,n=e.rows||[],s=e.filterSettings,o=e.values||[],l=(this.removeCount=0,this.isExpandAll=e.expandAll,this.drilledMembers=e.drilledMembers||[],this.isEmptyData=!1,[]);if(n[0]&&n[0].showNoDataItems||r[0]&&r[0].showNoDataItems)for(var d=0;d<this.valueMatrix.length;d++)l.push(d);for(d=0;d<this.filterMembers.length;d++)this.filterPosObj[this.filterMembers[d]]=this.filterMembers[d];this.valueSortSettings.columnIndex=void 0,this.validateValueFields(),this.frameDrillObject(),this.isValueFilterEnabled&&!this.isEditing||a||(this.isLastHeaderHasMeasures=!0,this.columnCount=0,this.rowCount=0,this.cMembers=[],this.rMembers=[],0!==n.length&&0!==o.length&&(this.rMembers=this.getIndexedHeaders(n,t,0,n[0].showNoDataItems?l:this.filterMembers,"row","",this.allowValueFilter)),0!==r.length&&0!==o.length&&(this.cMembers=this.getIndexedHeaders(r,t,0,r[0].showNoDataItems?l:this.filterMembers,"column","",this.allowValueFilter)),this.insertAllMembersCommon(),this.saveDataHeaders=this.isValueFiltersAvail&&e.allowValueFilter?{rowHeaders:Ue.extend([],this.rMembers,null,!0),columnHeaders:Ue.extend([],this.cMembers,null,!0)}:{}),this.customProperties.isTabularLayout&&(this.showSubTotalsAtBottom=!0),this.pivotValues=[],this.headerContent=[],this.valueContent=[],this.valueFilteredData=[],this.filterFramedHeaders=[];var p=[],h=[],u=[],c=[],g=[],m=this.dataSourceSettings.values.length;if(this.isValueFiltersAvail&&e.allowValueFilter&&!a){this.valueFilteredData=[];var S=this.saveDataHeaders.rowHeaders||[],f=this.saveDataHeaders.columnHeaders||[];if(0<s.length){for(var v={},y={},b=0,C=o;b<C.length;b++){var x=C[b];y[x.name]=x}for(var w=0,T=s;w<T.length;w++){var M=T[w],S=0<u.length?u:S,f=0<c.length?c:f,D=(this.valueFilteredData=[],M.properties||M);if("Value"===D.type&&this.fieldList[M.name]&&this.fieldList[M.name].isSelected){v[M.name]=M;for(var O=!(D.items=[]),P=n.length,N=r.length,E=0;E<P;E++)if(D.name===n[E].name&&y[D.measure]&&!O){O=!0,u=this.applyValueFiltering(n[E],E,S,this.columnGrandTotal||("Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals?f[0]:f[f.length-1]),v,this.valueFilteredData,"row");break}for(var F=0;F<N;F++)if(D.name===r[F].name&&y[D.measure]&&!O){O=!0,c=this.applyValueFiltering(r[F],F,f,this.rowGrandTotal||("Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals?S[0]:S[S.length-1]),v,this.valueFilteredData,"column");break}}}}u=0<u.length?u:S,c=0<c.length?c:f,this.isEmptyDataAvail(u,c);var s=Ce.getClonedFieldList(this.fieldList),I=this.data[0];this.getFieldList(I,this.enableSort,e.allowValueFilter),this.fillFieldMembers(),this.updateSortSettings(e.sortSettings,this.enableSort),this.filterMembers=[],this.updateFilterMembers(e),this.isLastHeaderHasMeasures=!0,this.rMembers=0!==n.length?this.getIndexedHeaders(n,t,0,n[0].showNoDataItems?l:this.filterMembers,"row",""):[],this.cMembers=0!==r.length?this.getIndexedHeaders(r,t,0,r[0].showNoDataItems?l:this.filterMembers,"column",""):[],this.insertAllMembersCommon(),this.updateFieldList(s),this.rowCount=0,this.columnCount=0,this.rMembers=this.updateFramedHeaders(this.rMembers,this.rMembers,u,this.filterFramedHeaders,"row"),this.filterFramedHeaders=[],this.cMembers=this.updateFramedHeaders(this.cMembers,this.cMembers,c,this.filterFramedHeaders,"column"),this.isValueFilterEnabled=!0}a||this.applyValueSorting(),this.isPagingOrVirtualizationEnabled&&(a?(this.rMembers=a.rowHeaders,this.cMembers=a.columnHeaders,this.rowCount=this.customProperties.isTabularLayout?this.rowCount+this.emptyRowsLength:a.rowHeadersCount,this.columnCount=a.columnHeadersCount):(this.headerCollection.rowHeaders=this.rMembers,this.headerCollection.columnHeaders=this.cMembers,this.headerCollection.rowHeadersCount=this.rowCount,this.headerCollection.columnHeadersCount=this.columnCount),this.calculatePagingValues()),!this.valueAxis&&this.isLastHeaderHasMeasures&&this.getAggregatedHeaders(n,r,this.rMembers,this.cMembers,o),this.getHeaderData(n,r,o,g,this.cMembers,h,this.pivotValues,0,this.valueAxis?1:m),this.insertSubTotals(),this.getTableData(0<g.length?g:this.rMembers,p,h,0,this.pivotValues,m,0,this.rowGrandTotal||this.rMembers[this.rMembers.length-1],this.columnGrandTotal||this.cMembers[this.cMembers.length-1]),this.applyAdvancedAggregate(p,h,this.pivotValues),this.customProperties.isTabularLayout&&(this.pivotValues=this.getTabularPivotValues(),this.setRowSpan(),this.rowCount=this.rowCount-this.emptyRowsLength),this.isEngineUpdated=!0,this.isEmptyDataAvail(this.rMembers,this.cMembers),this.clearProperties(i)},t.prototype.updateHeaders=function(e,t){e=Ue.isNullOrUndefined(e)?!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)&&0<this.dataSourceSettings.rows.length):e,(this.pageSettings&&this.removeRowGrandTotal||!e&&!this.rowGrandTotal)&&"grand sum"===this.rMembers[this.rMembers.length-1].type&&(this.rMembers=this.rMembers.slice(0,this.rMembers.length-1)),t=Ue.isNullOrUndefined(t)?!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)&&0<this.dataSourceSettings.columns.length):t,(this.pageSettings&&this.removeColumnGrandTotal||!t&&!this.columnGrandTotal)&&"grand sum"===this.cMembers[this.cMembers.length-1].type&&(this.cMembers=this.cMembers.slice(0,this.cMembers.length-1))},t.prototype.updatePivotValues=function(e){var t=!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)&&0<this.dataSourceSettings.rows.length),i=!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)&&0<this.dataSourceSettings.columns.length);if(e&&this.updateHeaders(t,i),(this.pageSettings&&this.removeRowGrandTotal||!t&&!this.rowGrandTotal)&&0<this.valueContent.length&&(a=1,this.valueAxis&&0<this.dataSourceSettings.values.length&&(a=1+this.dataSourceSettings.values.length),this.pivotValues[this.pivotValues.length-a])&&"grand sum"===this.pivotValues[this.pivotValues.length-a][0].type&&(this.pivotValues=this.pivotValues.slice(0,this.pivotValues.length-a),this.valueContent=this.valueContent.slice(0,this.valueContent.length-a)),(this.pageSettings&&this.removeColumnGrandTotal||!i&&!this.columnGrandTotal)&&0<this.headerContent.length){var a=this.dataSourceSettings.values.length;if(this.valueAxis&&0<this.dataSourceSettings.values.length&&(a=1),this.pivotValues[0][this.pivotValues[0].length-a]&&"grand sum"===this.pivotValues[0][this.pivotValues[0].length-a].type)for(var r=0;r<this.pivotValues.length;r++)if(this.pivotValues[r]&&(this.pivotValues[r]=this.pivotValues[r].slice(0,this.pivotValues[r].length-a)),this.headerContent[r])for(var n=this.pivotValues[r].length;n<this.pivotValues[r].length+a;n++)delete this.headerContent[r][n]}this.removeRowGrandTotal=this.removeColumnGrandTotal=!1},t.prototype.onDrill=function(e){this.enableVirtualization||this.enablePaging||!this.customProperties.isTabularLayout||(this.rowMaxLevel=0),this.frameDrillObject(e);var t=this.getHeadersInfo(e.fieldName,e.axis);this.performDrillOperation(t.headers,e,t.fields,t.position,0),this.headerCollection.rowHeadersCount=this.rowCount,this.headerCollection.columnHeadersCount=this.columnCount,"row"===t.axis?this.headerCollection.rowHeaders=t.headers:this.headerCollection.columnHeaders=t.headers,this.updateEngine()},t.prototype.onSort=function(e,t){t&&this.updateDataSourceSettings(t,!0);t=this.getHeadersInfo(e.name,"");this.fieldList[e.name].sort=e.order,this.performSortOperation(t.headers,e,t,0),this.updateEngine()},t.prototype.onFilter=function(e,t){this.updateDataSourceSettings(t,!0);for(var i=this.getHeadersInfo(e.name,""),a=(this.isLastHeaderHasMeasures=!!(this.valueAxis&&"row"===i.axis||!this.valueAxis&&"column"===i.axis)||this.isLastHeaderHasMeasures,"Include"===e.type&&e.items.length===this.fieldList[e.name].dateMember.length?(this.fieldList[e.name].filter=[],this.fieldList[e.name].filterType=""):(this.fieldList[e.name].filter=e.items,this.fieldList[e.name].filterType=e.type),{}),r=0,n=this.filterMembers;r<n.length;r++){var s=n[r];a[s]=s}this.filterMembers=[],this.fieldFilterMem={},this.updateFilterMembers(t);for(var o=this.filterMembers.filter(function(e){return void 0===a[e]}),l=0,d=e.items;l<d.length;l++)d[l];t=this.dataSourceSettings.rows[0]&&this.dataSourceSettings.rows[0].showNoDataItems||this.dataSourceSettings.columns[0]&&this.dataSourceSettings.columns[0].showNoDataItems;if(t&&this.columnKeys[e.name]?t=!(!this.dataSourceSettings.columns[0]||!this.dataSourceSettings.columns[0].showNoDataItems):t&&"row"===i.axis&&(t=!(!this.dataSourceSettings.rows[0]||!this.dataSourceSettings.rows[0].showNoDataItems)),t){var p=[];this.filterPosObj={};for(var h=0;h<o.length;h++)this.filterPosObj[o[h]]=o[h];for(h=0;h<this.valueMatrix.length;h++)p.push(h);o=p}this.performFilterCommonUpdate(e,i,o),this.frameHeaderObjectsCollection=!1,this.headerObjectsCollection={},this.customProperties.isTabularLayout&&(this.rowCount=this.rowCount-this.emptyRowsLength),this.updateEngine()},t.prototype.onAggregation=function(e,t){t&&this.updateDataSourceSettings(t,!0),this.fieldList[e.name].aggregateType=e.type,this.rMembers=this.headerCollection.rowHeaders,this.cMembers=this.headerCollection.columnHeaders,this.allowDataCompression&&(this.data=this.getGroupedRawData(this.dataSourceSettings),this.generateValueMatrix()),this.updateEngine()},t.prototype.onCalcOperation=function(e,t){this.dataSourceSettings.calculatedFieldSettings=t.calculatedFieldSettings||[],this.dataSourceSettings.values=t.values||[],this.rMembers=this.headerCollection.rowHeaders,this.cMembers=this.headerCollection.columnHeaders,this.getCalculatedField(this.fields),this.fieldList[e.name]?this.fieldList[e.name].formula=e.formula:(this.fieldList[e.name]={id:e.name,caption:e.name,type:"number",aggregateType:"CalculatedField",filterType:"",index:this.fields.length-1,filter:[],sort:this.enableSort?"Ascending":"None",isSelected:!0,isExcelFilter:!1,formula:e.formula},1===this.valueAxis?this.headerCollection.rowHeadersCount=this.rowCount=this.rowCount/(this.dataSourceSettings.values.length-1)*this.dataSourceSettings.values.length:this.headerCollection.columnHeadersCount=this.columnCount=this.columnCount/(this.dataSourceSettings.values.length-1)*this.dataSourceSettings.values.length),this.getFormattedFields(t),this.fillFieldMembers(),this.updateEngine()},t.prototype.performDrillOperation=function(e,t,i,a,r){for(var n=0;n<e.length;){if(a===r){var s,o=e[n].valueSort.levelName.split(this.valueSortSettings.headerDelimiter);if(t.memberName===o.join(t.delimiter||"**")){"down"===t.action?(e[n].isDrilled=!0,e[n].members=this.getIndexedHeaders(i,this.data,a+1,e[n].index,t.axis,t.memberName.split(t.delimiter||"**").join(this.valueSortSettings.headerDelimiter)),o=void 0,"row"===t.axis?(o=this.applyValueSorting(e[n].members,this.cMembers),e[n].members=o.rMembers,this.rowCount+=this.showSubTotalsAtBottom?1:0):(s=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&i[a].showSubTotals,this.columnCount-=s?0:this.colValuesLength,o=this.applyValueSorting(this.rMembers,e[n].members),e[n].members=o.cMembers)):(e[n].isDrilled=!1,this.updateHeadersCount(e[n].members,t.axis,a,i,"minus",!0),e[n].members=[],"row"===t.axis&&(this.rowCount-=this.showSubTotalsAtBottom?1:0));break}}else 0<e[n].members.length&&(e[n].members=this.performDrillOperation(e[n].members,t,i,a,r+1));n++}return e},t.prototype.performSortOperation=function(e,t,i,a){for(var r=0;r<e.length;){if(i.position===a){e=this.getSortedHeaders(e,t.order.toString());break}0<e[r].members.length&&(e[r].members=this.performSortOperation(e[r].members,t,i,a+1)),r++}return e},t.prototype.performFilterDeletion=function(e,i,a,r,n){for(var s=0,o=!0,l=this;s<e.length&&o;)!function(){var t;a.position===n?(t=l,e=e.filter(function(e){return""!==t.fieldFilterMem[i.name].memberObj[e.formattedText]&&(!t.fieldFilterMem[i.name].memberObj[e.formattedText]||"grand sum"===e.type)}),o=!1):0<e[s].members.length&&(e[s].members=l.performFilterDeletion(e[s].members,i,a,r,n+1)),s++}();var t=this;return e.filter(function(e){return 0<e.members.length||"grand sum"===e.type||t.matchIndexes(e.indexObject,r)})},t.prototype.matchIndexes=function(e,t){var i=Object.keys(e),a=i.length;if(0===a)return!0;for(;-1<a;){if(void 0!==t[e[i[a]]])return!0;a--}return!1},t.prototype.performFilterAddition=function(s,o,l){for(var d=0,p=this;d<s.length;)!function(){var e=s[d].valueSort.levelName;if(p.headerObjectsCollection[e]){for(var t={},i=0,a=s[d].members;i<a.length;i++){var r=a[i];t[r.valueSort.levelName.toString()]=r.valueSort.levelName.toString()}var n=p.headerObjectsCollection[e].filter(function(e){return!t[e.valueSort.levelName.toString()]});s[d].members=s[d].members.concat(n),s[d].members=p.getSortedHeaders(s[d].members,p.fieldList[l.fields[s[d].members[0].level].name].sort),delete p.headerObjectsCollection[e]}0<s[d].members.length&&(s[d].members=p.performFilterAddition(s[d].members,o,l)),d++}();return s},t.prototype.performFilterCommonUpdate=function(e,t,i){if("row"===t.axis||"column"===t.axis){for(var a="row"===t.axis?this.rMembers:this.cMembers,r={},n=0,s=this.filterMembers;n<s.length;n++){var o=s[n];r[o]=o}if(this.fieldFilterMem[e.name]&&(a=this.performFilterDeletion(t.headers,e,t,r,0)),0<i.length&&0<t.fields.length){if(this.frameHeaderObjectsCollection=!0,0<t.fields.filter(function(e){return e.showNoDataItems}).length)for(var l=0;l<this.data.length;l++)i.push(l);this.headerObjectsCollection.parent=this.getIndexedHeaders(t.fields,this.data,0,i,t.axis,"");for(var a=this.performFilterAddition(a,t.fields,t),d={},p=0,h=a;p<h.length;p++){var u=h[p];d[u.valueSort.levelName.toString()]=u.valueSort.levelName.toString()}var e=this.headerObjectsCollection.parent.filter(function(e){return!d[e.valueSort.levelName.toString()]}),c=a.filter(function(e){return"grand sum"===e.type});0<c.length&&a.pop(),a=this.getSortedHeaders(a.concat(e),this.fieldList[t.fields[0].name].sort).concat(c),"row"===t.axis?(this.cMembers=this.getIndexedHeaders(this.dataSourceSettings.columns,this.data,0,this.filterMembers,"column",""),this.insertAllMember(this.cMembers,this.filterMembers,"","column")):(this.rMembers=this.getIndexedHeaders(this.dataSourceSettings.rows,this.data,0,this.filterMembers,"row",""),this.insertAllMember(this.rMembers,this.filterMembers,"","row"))}"row"===t.axis?this.rowCount=0:this.columnCount=0,this.updateHeadersCount(a,t.axis,0,t.fields,"plus",!1),"row"===t.axis?(0<t.position&&this.insertPosition(this.dataSourceSettings.rows,this.data,0,this.filterMembers,"row","",a),this.insertTotalPosition(a),this.rMembers=this.headerCollection.rowHeaders=a,this.headerCollection.rowHeadersCount=this.rowCount):(0<t.position&&this.insertPosition(this.dataSourceSettings.columns,this.data,0,this.filterMembers,"column","",a),this.insertTotalPosition(a),this.cMembers=this.headerCollection.columnHeaders=a,this.headerCollection.columnHeadersCount=this.columnCount)}else{e=this.dataSourceSettings.rows[0]&&this.dataSourceSettings.rows[0].showNoDataItems||this.dataSourceSettings.columns[0]&&this.dataSourceSettings.columns[0].showNoDataItems;this.rMembers=this.getIndexedHeaders(this.dataSourceSettings.rows,this.data,0,e?i:this.filterMembers,"row",""),this.cMembers=this.getIndexedHeaders(this.dataSourceSettings.columns,this.data,0,e?i:this.filterMembers,"column",""),this.insertAllMembersCommon(),this.rowCount=0,this.columnCount=0,this.updateHeadersCount(this.cMembers,"column",0,this.dataSourceSettings.columns,"plus",!1),this.updateHeadersCount(this.rMembers,"row",0,this.dataSourceSettings.rows,"plus",!1),e&&(this.insertPosition(this.dataSourceSettings.rows,this.data,0,this.filterMembers,"row","",this.rMembers),this.insertPosition(this.dataSourceSettings.columns,this.data,0,this.filterMembers,"column","",this.cMembers)),this.headerCollection.rowHeaders=this.rMembers,this.headerCollection.rowHeadersCount=this.rowCount,this.headerCollection.columnHeaders=this.cMembers,this.headerCollection.columnHeadersCount=this.columnCount}this.applyValueSorting()},t.prototype.getHeadersInfo=function(e,t){this.rMembers=this.headerCollection.rowHeaders,this.cMembers=this.headerCollection.columnHeaders;for(var i="row"===(t=""===t?this.getAxisByFieldName(e):t)?this.rMembers:this.cMembers,a="row"===t?this.dataSourceSettings.rows:this.dataSourceSettings.columns,r=0,n=0,s=a;n<s.length&&s[n].name!==e;n++)r++;return{axis:t,fields:a,headers:i,position:r}},t.prototype.updateEngine=function(){this.customProperties.isTabularLayout&&(this.rowCount=this.rowCount+this.emptyRowsLength),this.removeCount=0,this.validateValueFields(),this.calculatePagingValues(),this.pivotValues=[],this.headerContent=[],this.valueContent=[];var e=[],t=[],i=[],a=this.dataSourceSettings.values.length;this.frameDrillObject(),this.getAggregatedHeaders(this.dataSourceSettings.rows,this.dataSourceSettings.columns,this.rMembers,this.cMembers,this.dataSourceSettings.values),this.getHeaderData(this.dataSourceSettings.rows,this.dataSourceSettings.columns,this.dataSourceSettings.values,i,this.cMembers,t,this.pivotValues,0,this.valueAxis?1:a),this.insertSubTotals(),this.getTableData(0<i.length?i:this.rMembers,e,t,0,this.pivotValues,a,0,this.rowGrandTotal||this.rMembers[this.rMembers.length-1],this.columnGrandTotal||this.cMembers[this.cMembers.length-1]),this.applyAdvancedAggregate(e,t,this.pivotValues),this.customProperties.isTabularLayout&&(this.pivotValues=this.getTabularPivotValues(),this.setRowSpan(),this.rowCount=this.rowCount-this.emptyRowsLength),this.isEngineUpdated=!0,this.isEmptyDataAvail(this.rMembers,this.cMembers)},t.prototype.getAxisByFieldName=function(e){for(var t=0,i="";t<4&&""===i;){switch(t){case 0:i=this.getFieldByName(e,this.dataSourceSettings.rows)?"row":"";break;case 1:i=this.getFieldByName(e,this.dataSourceSettings.columns)?"column":""}t++}return i},t.prototype.getFieldByName=function(e,t){return new K.DataManager({json:t}).executeLocal((new K.Query).where("name","equal",e))[0]},t.prototype.updateHeadersCount=function(e,t,i,a,r,n){for(var s=0,o=a[i],l=!0,l="column"===t?this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&(!o||o.showSubTotals):this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals&&(!o||o.showSubTotals);s<e.length;)"row"===t?this.rowCount=this.rowCount-("plus"===r?-(1===this.valueAxis?this.dataSourceSettings.values.length:1):1===this.valueAxis?this.dataSourceSettings.values.length:1):this.columnCount=this.columnCount-("plus"===r?-(1===this.valueAxis?1:this.dataSourceSettings.values.length):1===this.valueAxis?1:this.dataSourceSettings.values.length),0<e[s].members.length&&(this.updateHeadersCount(e[s].members,t,i+1,a,r,!0),"row"===t)&&(this.rowCount+=this.showSubTotalsAtBottom&&e[s].hasChild&&e[s].isDrilled?1:0),s++;"column"===t&&!l&&n&&(this.columnCount+="plus"===r?-this.colValuesLength:this.colValuesLength)},t.prototype.getSortedHeaders=function(e,t){var i=("Grand Total"!==e[0].actualText?e[0]:e[1]).valueSort.axis,a=!(this.formatFields&&this.formatFields[i]&&this.formatFields[i].type),r=this.fieldList[i];if(a){if(r&&"number"===r.type&&0<e.length&&"string"==typeof e[0].actualText){for(var n=[],s=[],o=[],l=0;l<e.length;l++)if(isNaN(Number(e[l].actualText.toString().charAt(0))))n.push(e[l]);else{if(""!==e[l].actualText){s.push(e[l]);break}o.push(e[l])}return 0<s.length&&(s=this.sortHeaders(i,r,e,r.sort,r.isAlphanumeric)),e}return this.sortHeaders(i,r,e,t,r.type)}return this.sortHeaders(i,r,e,t,"date")},t.prototype.sortHeaders=function(e,t,i,a,r){var n,s=!1,o=this.fieldList[e]&&this.fieldList[e].membersOrder?this.fieldList[e].membersOrder.slice():[],l={fieldName:e,sortOrder:a,members:o&&0<o.length?o:Object.keys(t.members),IsOrderChanged:!1},d="datetime"===(r="datetime"!==r&&"date"!==r&&"time"!==r||this.formatFields[e]&&-1<["date","dateTime","time"].indexOf(this.formatFields[e].type)?r:"string")||"date"===r||"time"===r,e=!1;if(0<this.dataSourceSettings.groupSettings.length&&(n=this.dataSourceSettings.groupSettings.filter(function(e){return e.name===t.id}),!Ue.isNullOrUndefined(n))&&0<n.length&&(e="number"===n[0].type.toLocaleLowerCase()&&"string"===t.type.toLocaleLowerCase()),o&&0<o.length?Ce.applyCustomSort(l,i,r):(Ce.applyHeadersSort(i,a,r,e),s=!0),s&&this.getHeaderSortInfo){for(var p=[],h=0,u=0;h<i.length;h++){var c=i[h],g=d?c.dateText:c.actualText;"Grand Total"!==c.actualText&&(p[u++]=g)}l.members=p}return this.getHeaderSortInfo&&this.getHeaderSortInfo(l),l.IsOrderChanged&&Ce.applyCustomSort(l,i,r,!0),i},t.prototype.applyValueSorting=function(e,t){var i=!1;if(void 0===e||void 0===t){if(this.valueSortHeaderText=void 0,this.enableValueSorting&&this.valueSortSettings.headerText&&!this.valueSortHeaderText&&""!==this.valueSortSettings.headerText&&0<this.dataSourceSettings.values.length){this.valueSortHeaderText=this.valueSortSettings.headerText;for(var a=this.valueSortHeaderText.split(this.valueSortSettings.headerDelimiter),r=0,n=this.dataSourceSettings.values;r<n.length;r++){var s=n[r],s=s.caption||s.name,o=a.indexOf(s);if(-1<o){a.splice(o,1),a.push(s),this.valueSortHeaderText=a.join(this.valueSortSettings.headerDelimiter);break}}}e=this.rMembers,t=this.cMembers,i=!0}if(this.valueSortHeaderText){for(var a=this.valueSortHeaderText.split(this.valueSortSettings.headerDelimiter),l="",d=void 0,p=void 0,h=void 0,u=0;u<this.dataSourceSettings.values.length;u++){if(this.dataSourceSettings.values[u].caption===a[a.length-1]){h=this.dataSourceSettings.values[u].name;break}h=a[a.length-1]}if((1===this.dataSourceSettings.values.length&&0===this.dataSourceSettings.columns.length||1<this.dataSourceSettings.values.length)&&h&&this.fieldList[h]){for(u=0;u<a.length-1;u++)l=""===l?a[u]:l+this.valueSortSettings.headerDelimiter+a[u];d=this.fieldList[h].index,p=this.fieldList[h].aggregateType}else{if(this.dataSourceSettings.alwaysShowValueHeader&&1!==a.length)for(u=0;u<a.length-1;u++)l=""===l?a[u]:l+this.valueSortSettings.headerDelimiter+a[u];else l=this.valueSortHeaderText;d=this.fieldList[this.dataSourceSettings.values[0].name].index,p=this.fieldList[this.dataSourceSettings.values[0].name].aggregateType}var c=void 0;0===this.valueAxis?(c=this.getMember(t,l))&&(e=this.sortByValueRow(e,c,this.valueSortSettings.sortOrder,d,p)):(c=this.getMember(e,l))&&(t=this.sortByValueRow(t,c,this.valueSortSettings.sortOrder,d,p)),i&&(this.rMembers=e,this.cMembers=t,this.isPagingOrVirtualizationEnabled)&&(this.headerCollection.rowHeaders=this.rMembers,this.headerCollection.columnHeaders=this.cMembers)}return{rMembers:e,cMembers:t}},t.prototype.getMember=function(e,t){for(var i,a=e.length,r=0;r<a;r++){if(e[r].valueSort.levelName===t){i=e[r];break}if(i=0<e[r].members.length?this.getMember(e[r].members,t):i)return i}return i},t.prototype.sortByValueRow=function(e,t,i,a,r){for(var n,s,o=[],l=0,d=e;l<d.length;l++)"grand sum"===(p=d[l]).type?o.push({header:p}):(this.rawIndexObject={},n=this.getAggregateValue(p.index,t.indexObject,a,r,!1),s={fieldName:this.fields[a],row:p,column:t,value:n,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:p.hasChild&&p.isDrilled?"subTotal":"grand sum"===p.type?"grandTotal":"value",columnCellType:t.hasChild&&t.isDrilled?"subTotal":"grand sum"===t.type?"grandTotal":"value",aggregateType:r,skipFormatting:!1},this.getValueCellInfo&&this.getValueCellInfo(s),n=s.value,this.rawIndexObject={},o.push({header:p,value:n}));for(var p,h=0,u=e=Ce.getSortedValue(o,i);h<u.length;h++)0<(p=u[h]).members.length&&(p.members=this.sortByValueRow(p.members,t,i,a,r));return e},t.prototype.insertAllMembersCommon=function(){this.rowGrandTotal=this.columnGrandTotal=null;var e=!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)&&0<this.dataSourceSettings.rows.length),t=!((!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)&&0<this.dataSourceSettings.columns.length);this.isValueHasAdvancedAggregate?(this.insertAllMember(this.rMembers,this.filterMembers,"","row"),e&&(this.rowCount+=this.rowValuesLength),this.insertAllMember(this.cMembers,this.filterMembers,"","column"),t&&(this.columnCount+=this.colValuesLength)):(e?(this.insertAllMember(this.rMembers,this.filterMembers,"","row"),this.rowCount+=this.rowValuesLength):this.rowGrandTotal=this.insertAllMember([],this.filterMembers,"","row")[0],t?(this.insertAllMember(this.cMembers,this.filterMembers,"","column"),this.columnCount+=this.colValuesLength):this.columnGrandTotal=this.insertAllMember([],this.filterMembers,"","column")[0])},t.prototype.insertSubTotals=function(){for(var e=this.pivotValues.length,t=0;t<e;t++){var i=this.pivotValues[t];if(i)for(var a=void 0,r=1,n=i.length,s=void 0,o=1,l=this.showSubTotalsAtTop?this.reformAxisCount:n,d=this.showSubTotalsAtTop?o:l-1,p=void 0,h=void 0;o<l;){var u,c=i[d];if(c){a&&(a.colSpan=r,a.colIndex=this.showSubTotalsAtTop?a.colIndex+(r-1):a.colIndex-(r-1)),this.showSubTotalsAtTop&&(p=h=this.getMemberSpanCount(this.pivotValues[t],d)),s={index:c.index,indexObject:c.indexObject},c.index=[],c.indexObject={},a=Ue.extend({},c,null,!0),c.index=s.index,c.indexObject=s.indexObject;for(var g=t+1;this.pivotValues[g]&&!this.pivotValues[g][d];){var m=this.pivotValues[t][d],S=(m.isDrilled||!this.valueAxis&&!this.isLastHeaderHasMeasures&&m.members&&0<m.members.length&&g>this.measureIndex||(m.rowSpan=g-t+1,a.rowSpan=g-t+1),"sum"===c.type||"grand sum"===c.type?c.type:"sum"),f=(this.pivotValues[g][d]=this.headerContent[g][d]={type:S,formattedText:"sum"===c.type||"grand sum"===c.type?c.formattedText:c.formattedText+" Total",axis:"column",hierarchyName:c.hierarchyName,level:-1,colIndex:d,rowIndex:g,valueSort:c.valueSort},c.valueSort&&c.valueSort[this.valueSortSettings.headerText]&&(this.valueSortSettings.columnIndex=d),!1);"grand sum"===S?(m.rowSpan=g-t+1,a.rowSpan=g-t+1):"sum"!==m.type&&(m.isDrilled||this.valueAxisFields[m.actualText]&&!this.valueAxis&&!this.isLastHeaderHasMeasures&&m.members&&0<m.members.length)?(this.pivotValues[t+1][d].rowSpan=g-t,f=!0):this.pivotValues[g][d].rowSpan=-1,t+1<g&&("sum"===m.type||f)&&(this.pivotValues[g][d].rowSpan=-1),g++}r=1}else i[d]=this.headerContent[t][d]=Ue.extend({},a,null,!0),i[d].index=this.headerContent[t][d].index=s.index,i[d].indexObject=this.headerContent[t][d].indexObject=s.indexObject,r++,this.showSubTotalsAtTop?(h--,i[d].colSpan=h,i[d].colIndex=i[d].colIndex+(r-1)):(i[d].colSpan=r,i[d].colIndex=i[d].colIndex-(r-1));1===d&&a&&(this.showSubTotalsAtTop?(a.colSpan=p,a.colIndex=a.colIndex+(r-1)):(a.colSpan=r,a.colIndex=a.colIndex-(r-1))),this.showSubTotalsAtTop&&(i[d+1]||d+1===this.reformAxisCount)&&((u=this.pivotValues[t][d-r+1]).colSpan=p,this.pivotValues[t][d-r+1]=u),d=this.showSubTotalsAtTop?d+1:d-1,o++}}},t.prototype.getMemberSpanCount=function(e,t){for(var i=1,a=t+1;a<this.reformAxisCount&&!e[a];a++)i++;return i},t.prototype.frameDrillObject=function(e){void 0===e&&(e=null),this.fieldDrillCollection={};for(var t=0;t<this.drilledMembers.length;t++){for(var i=this.drilledMembers[t],a=!1,r=1,n=!1,s=this.fieldList[i.name],o=s&&s.expandAll,l=0;l<this.dataSourceSettings.rows.length;l++)if(this.dataSourceSettings.rows[l].name===i.name){r=((d=this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&-1<this.measureIndex&&this.measureIndex<=l)?l+1:l)+1,a=!!d,n=!0;break}if(!n)for(var d,l=0;l<this.dataSourceSettings.columns.length;l++)if(this.dataSourceSettings.columns[l].name===i.name){r=((d=!this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&-1<this.measureIndex&&this.measureIndex<=l)?l+1:l)+1,a=!!d,n=!0;break}for(var p=0,h=i.items;p<h.length;p++){var u=h[p],c=u.split(i.delimiter);if(r===c.length){var g=i.name+this.valueSortSettings.headerDelimiter+c.join(this.valueSortSettings.headerDelimiter);if(this.fieldDrillCollection[g]=g,a){var m=!1;if(this.isExpandAll||o)for(var S=0,f=this.dataSourceSettings.values;S<f.length;S++){var v=f[S],v=v.caption||v.name;if(c[this.measureIndex]=v,!(-1<i.items.indexOf(c.join(i.delimiter)))){m=!1;break}m=!0}(!this.isExpandAll&&!o||!m)&&this.isExpandAll&&o||((c=u.split(i.delimiter)).splice(this.measureIndex,1),e&&e.memberName===u&&(e.memberName=c.join(i.delimiter)),g=i.name+this.valueSortSettings.headerDelimiter+c.join(this.valueSortSettings.headerDelimiter),this.fieldDrillCollection[g]=g)}}}}},t.prototype.getIndexedHeaders=function(e,t,i,a,r,n,s){var o=[];if(e&&0<e.length){0;var l=e.length,d={},p=e[i].name,h=e[i],u=this.fieldList[p];if(Ue.isNullOrUndefined(this.reportDataType)){this.reportDataType={};for(var c=0;c<this.dataSourceSettings.rows.length;c++)this.reportDataType[this.dataSourceSettings.rows[c].name]=this.dataSourceSettings.rows[c].dataType;for(c=0;c<this.dataSourceSettings.columns.length;c++)this.reportDataType[this.dataSourceSettings.columns[c].name]=this.dataSourceSettings.columns[c].dataType;for(c=0;c<this.dataSourceSettings.values.length;c++)this.reportDataType[this.dataSourceSettings.values[c].name]=this.dataSourceSettings.values[c].dataType}u.type=Ue.isNullOrUndefined(this.reportDataType[u.id])?u.type:this.reportDataType[u.id];var g=!1,m=this.formatFields[p]&&-1<["date","dateTime","time"].indexOf(this.formatFields[p].type),S=a.length<1&&0<i||h.showNoDataItems,f={};if(S){for(var v=Object.keys(u.members),y=0,b=v.length;y<b;y++)(this.dataSourceSettings.showHeaderWhenEmpty||this.localeObj&&v[y]!==this.localeObj.getConstant("undefined"))&&(f[v[y]]=v[y]);a.length<1&&(g=!0,a.length=v.length)}r===this.dataSourceSettings.valueAxis&&this.measureIndex===i&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&(this.isLastHeaderHasMeasures=!1);for(y=0,b=a.length;y<b;y++){var C,x,w={},T=(Ue.isNullOrUndefined(e[i].showSubTotals)||e[i].showSubTotals||(w.showSubTotals=!1),w.hasChild=i<l-1,w.level=i,w.axis=r,w.colSpan=1,this.rowMaxLevel="row"===r&&this.rowMaxLevel<i?i:this.rowMaxLevel,(g?u.members[Object.keys(f)[0]]:this.valueMatrix[a[y]][u.index]).ordinal),M=g?Object.keys(f)[0]:t[a[y]][this.fieldKeys[p]];M=this.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(M):M,(Ue.isNullOrUndefined(M)||this.localeObj&&M===this.localeObj.getConstant("undefined"))&&!this.dataSourceSettings.showHeaderWhenEmpty?S&&!g&&0<i&&y+1===a.length&&0<Object.keys(f).length&&(b=Object.keys(f).length,g=!0,y=-1):(delete f[M],S&&this.fieldFilterMem[p]&&this.fieldFilterMem[p].memberObj[M]===M||(x=m?{actualText:M,formattedText:u.dateMember[T-1].formattedText,dateText:u.dateMember[T-1].actualText}:{formattedText:null===M?this.localeObj?this.localeObj.getConstant("null"):String(M):void 0===M&&this.localeObj?p in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(M),actualText:null===M?this.localeObj?this.localeObj.getConstant("null"):String(M):void 0===M?this.localeObj?p in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(M):M},w.actualText=x.actualText,w.formattedText=x.formattedText,m&&(w.dateText=x.dateText),x=!S||void 0!==this.filterPosObj[a[y]]&&!g,C=!1,S&&0<u.filter.length&&"include"===u.filterType&&(C=!0),d&&d[T]||C&&!(-1<u.filter.indexOf(M.toString()))?x&&(d[T].index.push(a[y]),d[T].indexObject[a[y]]=a[y]):(d[T]={index:[],indexObject:{}},w.index=d[T].index,w.indexObject=d[T].indexObject,x&&(w.index=d[T].index=[a[y]],d[T].indexObject[a[y]]=a[y],w.indexObject=d[T].indexObject),w.ordinal=T,w.valueSort={},w.valueSort.axis=p,0!==i?(w.valueSort.levelName=n+this.valueSortSettings.headerDelimiter+w.formattedText,w.valueSort[n+this.valueSortSettings.headerDelimiter+w.formattedText]=1,w.valueSort.uniqueName=n+this.valueSortSettings.headerDelimiter+(w.actualText||w.formattedText),w.valueSort[n+this.valueSortSettings.headerDelimiter+(w.actualText||w.formattedText)]=1):(w.valueSort[w.formattedText]=1,w.valueSort.levelName=w.formattedText,w.valueSort[w.actualText||w.formattedText]=1,w.valueSort.uniqueName=w.actualText||w.formattedText),C=w.valueSort.axis+this.valueSortSettings.headerDelimiter+w.valueSort.levelName,x=this.isExpandAll||h&&h.expandAll,w.isDrilled=!(!s||!this.isValueFiltersAvail)||(w.hasChild&&this.fieldDrillCollection[C]?!x||!this.valueAxis&&!this.isLastHeaderHasMeasures&&this.measureIndex<=1:x),w.members=[],o.push(w)),S&&!g&&0<i&&y+1===a.length&&0<Object.keys(f).length&&(g=!0,b=Object.keys(f).length,y=-1)))}for(var D=0,O=o.length;D<O;D++){this.frameHeaderObjectsCollection||("row"===r?this.rowCount+=this.rowValuesLength+(o[D].isDrilled&&o[D].hasChild&&this.showSubTotalsAtBottom?1:0):this.columnCount+=this.colValuesLength);var P=null;if(n=(P=o[D].valueSort&&o[D].valueSort.levelName?o[D].valueSort.levelName:P)||o[D].formattedText,!this.dataSourceSettings.showHeaderWhenEmpty&&i<l-1&&o[D].index&&0<o[D].index.length)if(S&&e[i+1]&&e[i+1].name&&0<Object.keys(this.fieldList[e[i+1].name].members).length)o[D].hasChild=!0;else{for(var N=o[D].index.length,E=0,F=0;F<N;F++){M=t[o[D].index[F]][this.fieldKeys[e[i+1].name]];(Ue.isNullOrUndefined(M)||this.localeObj&&M===this.localeObj.getConstant("undefined"))&&E++}o[D].hasChild=E!==N}i<l-1&&o[D].isDrilled&&(this.columnCount-=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&h.showSubTotals||"column"!==r?0:this.colValuesLength,P=o[D].index,o[D].members=this.getIndexedHeaders(e,t,i+1,void 0===P?[]:P,r,n,s),this.frameHeaderObjectsCollection)&&(this.headerObjectsCollection[n]=o[D].members)}if(this.enableSort){if(m)return this.sortHeaders(p,u,o,u.sort,"date");if("number"===u.type.toLowerCase()&&0<o.length&&"string"==typeof o[0].actualText&&o[0].actualText.match(/[a-zA-Z]+/g)){for(var I=[],L=void 0,A=[],R=[],c=0;c<o.length;c++)if(Ue.isNullOrUndefined(o[c].actualText.toString().match(/\d+/)))I.push(o[c]),L||"None"===u.sort||"Out of Range"===o[c].actualText&&(L=o[c],o.splice(c,1));else{if(""!==o[c].actualText){this.fieldList[p].isAlphanumeric=!0,A.push(o[c]);break}R.push(o[c])}return L&&("Ascending"===u.sort?"Grand Total"===o[0].actualText?o.splice(1,0,L):o.splice(0,0,L):"Grand Total"===o[o.length-1].actualText?o.splice(o.length-1,0,L):o.splice(o.length,0,L)),0<A.length&&this.sortHeaders(p,u,o,u.sort,u.isAlphanumeric),o}return this.sortHeaders(p,u,o,u.sort,u.type)}}return o},t.prototype.getOrderedIndex=function(e){for(var t={},i=0;i<e.length;i++)"grand sum"!==e[i].type&&(t[e[i].ordinal]=i);return t},t.prototype.insertPosition=function(e,t,i,a,r,n,s){var o=[],l=this.getOrderedIndex(s);if(e){for(var d={},p=e[i].name,h=this.fieldList[p],u=0,c=a.length;u<c;u++){var g={},m=this.valueMatrix[a[u]][h.index].ordinal,S=s[l[m]],f=null===(f=t[a[u]][this.fieldKeys[p]])?this.localeObj?this.localeObj.getConstant("null"):String(f):f,f=this.formatFields[p]&&-1<["date","dateTime","time"].indexOf(this.formatFields[p].type)?this.getFormattedValue(f,p):{formattedText:f.toString(),actualText:f.toString()};S&&S.formattedText===f.formattedText&&(d&&d[m]?(d[m].index.push(a[u]),d[m].indexObject[a[u]]=a[u]):(d[m]={index:[],indexObject:{}},S.index=d[m].index=[a[u]],d[m].indexObject[a[u]]=a[u],S.indexObject=d[m].indexObject,S.valueSort={},S.valueSort.axis=p,0!==i?(S.valueSort.levelName=n+this.valueSortSettings.headerDelimiter+S.formattedText,S.valueSort[n+this.valueSortSettings.headerDelimiter+S.formattedText]=1,S.valueSort.uniqueName=n+this.valueSortSettings.headerDelimiter+(S.actualText||S.formattedText),S.valueSort[n+this.valueSortSettings.headerDelimiter+(S.actualText||S.formattedText)]=1):(S.valueSort[S.formattedText]=1,S.valueSort.levelName=S.formattedText,S.valueSort[S.actualText||S.formattedText]=1,S.valueSort.uniqueName=S.actualText||S.formattedText),g.members=[],o.push(g)))}for(var v=s.length-o.length;0<v;)o.push({members:[]}),v--;for(var y,b=0,C=o.length;b<C;b++)0<s[b].members.length&&(y=null,n=(y=s[b].valueSort&&s[b].valueSort.levelName?s[b].valueSort.levelName:y)||s[b].formattedText,o[b].members=this.insertPosition(e,t,i+1,s[b].index,r,n,s[b].members))}return o},t.prototype.insertTotalPosition=function(e){var t=e[e.length-1];if(t&&"grand sum"===t.type){t.index=this.filterMembers,t.indexObject={};for(var i=0,a=this.filterMembers.length;i<a;i++)t.indexObject[this.filterMembers[i]]=this.filterMembers[i]}return e},t.prototype.calculatePagingValues=function(){var e,t;this.isPagingOrVirtualizationEnabled&&(1===this.valueAxis?this.rowValuesLength=this.dataSourceSettings.values.length:this.colValuesLength=this.dataSourceSettings.values.length,this.columnPageCount=Math.ceil(this.columnCount/this.pageSettings.columnPageSize),this.rowPageCount=Math.ceil(this.rowCount/this.pageSettings.rowPageSize),this.pageSettings.currentColumnPage=this.pageSettings.currentColumnPage>=this.columnPageCount||this.enableOptimizedRendering&&1<this.pageSettings.currentColumnPage&&(this.pageSettings.currentColumnPage+1)*this.colValuesLength>=this.columnPageCount?this.columnPageCount:this.pageSettings.currentColumnPage,this.pageSettings.currentRowPage=this.pageSettings.currentRowPage>=this.rowPageCount||this.enableOptimizedRendering&&1<this.pageSettings.currentRowPage&&(this.pageSettings.currentRowPage+1)*this.rowValuesLength>=this.rowPageCount?this.rowPageCount:this.pageSettings.currentRowPage,e=this.enablePaging?1:this.enableOptimizedRendering?1.5:3,this.memberCnt=this.enablePaging?0:-this.rowValuesLength,this.rowStartPos=(this.pageSettings.currentRowPage*this.pageSettings.rowPageSize-this.pageSettings.rowPageSize)*(this.enablePaging?1:this.rowValuesLength)+(this.enablePaging?1:0),(t=!this.enablePaging&&this.rowStartPos+this.pageSettings.rowPageSize*e*this.rowValuesLength>this.rowCount?this.rowCount-this.pageSettings.rowPageSize*e*this.rowValuesLength:this.rowStartPos)<0&&(t=this.rowStartPos=0,this.pageSettings.currentRowPage=1),this.rowFirstLvl=(this.rowStartPos-t)%this.pageSettings.rowPageSize,this.rowStartPos=t,this.endPos=this.rowStartPos+this.pageSettings.rowPageSize*e*(this.enablePaging?1:this.rowValuesLength)-(this.enablePaging?1:0),this.endPos=this.endPos>this.rowCount+1?this.rowCount+1:this.endPos,this.rMembers=this.performSlicing(this.rMembers,[],this.rowStartPos,"row"),this.memberCnt=this.enablePaging?0:-this.colValuesLength,this.pageInLimit=!1,this.colHdrBufferCalculated=!1,this.colStartPos=(this.pageSettings.currentColumnPage*this.pageSettings.columnPageSize-this.pageSettings.columnPageSize)*(this.enablePaging?1:this.colValuesLength)+(this.enablePaging?1:0),(t=!this.enablePaging&&this.colStartPos+this.pageSettings.columnPageSize*e*this.colValuesLength>this.columnCount?this.columnCount-this.pageSettings.columnPageSize*e*this.colValuesLength:this.colStartPos)<0&&(t=this.colStartPos=0,this.pageSettings.currentColumnPage=1),this.colFirstLvl=(this.colStartPos-t)%this.pageSettings.columnPageSize,this.colStartPos=t,this.endPos=this.colStartPos+this.pageSettings.columnPageSize*e*(this.enablePaging?1:this.colValuesLength)-(this.enablePaging?1:0),this.endPos=this.endPos>this.columnCount+1?this.columnCount+1:this.endPos,this.cMembers=this.performSlicing(this.cMembers,[],this.colStartPos,"column"),this.memberCnt=-1,this.pageInLimit=!1,this.isValueHasAdvancedAggregate?("grand sum"!==this.rMembers[this.rMembers.length-1].type&&"grand sum"===this.headerCollection.rowHeaders[this.headerCollection.rowHeaders.length-1].type&&(this.rMembers.push(this.headerCollection.rowHeaders[this.headerCollection.rowHeaders.length-1]),this.removeRowGrandTotal=!0),"grand sum"!==this.cMembers[this.cMembers.length-1].type&&"grand sum"===this.headerCollection.columnHeaders[this.headerCollection.columnHeaders.length-1].type&&(this.cMembers.push(this.headerCollection.columnHeaders[this.headerCollection.columnHeaders.length-1]),this.removeColumnGrandTotal=!0)):(this.rowGrandTotal=this.rowGrandTotal||this.headerCollection.rowHeaders[this.headerCollection.rowHeaders.length-1],this.columnGrandTotal=this.columnGrandTotal||this.headerCollection.columnHeaders[this.headerCollection.columnHeaders.length-1]))},t.prototype.performSlicing=function(e,t,i,a){for(var r=0;e[r]&&!(this.enablePaging&&this.endPos<=this.memberCnt&&0!==r);){if(this.memberCnt+=e[r].level<=this.measureIndex?"column"===a?this.colValuesLength:this.rowValuesLength:1,i<=this.memberCnt&&this.endPos>=this.memberCnt&&!this.pageInLimit&&("column"===a?this.colFirstLvl=this.colFirstLvl+e[r].level:this.rowFirstLvl=this.rowFirstLvl+e[r].level,this.pageInLimit=!0),this.pageInLimit&&!this.enablePaging&&this.endPos<=this.memberCnt){if("column"!==a)break;if(0===e[r].members.length){if(this.colHdrBufferCalculated)break;this.colHdrBufferCalculated=!0,this.endPos+=e[r].level*this.colValuesLength}else if(this.colHdrBufferCalculated)break}if(t.push(0<e[r].members.length?this.removeChildMembers(e[r]):e[r]),0<e[r].members.length&&("column"===a?this.memberCnt-=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&this.columnKeys[e[r].valueSort.axis].showSubTotals?0:this.colValuesLength:this.showSubTotalsAtBottom&&this.memberCnt++,t[t.length-1].members=this.performSlicing(e[r].members,[],i,a)),this.pageInLimit||t.pop(),0===e[r].level&&this.pageInLimit&&this.endPos<=this.memberCnt)break;r++}return t},t.prototype.removeChildMembers=function(e){for(var t=Object.keys(e),i=0,a={};i<t.length;)a[t[i]]=e[t[i]],"members"===t[i]&&(a.members=[]),i++;return a},t.prototype.insertAllMember=function(e,t,i,a){var r=e.length,n={hasChild:!" Total",index:t,level:0,axis:a,isDrilled:!1,indexObject:{},members:[],actualText:"Grand Total",formattedText:this.localeObj?this.localeObj.getConstant("grandTotal"):"Grand Total",ordinal:r,type:"grand sum",valueSort:{}};n.valueSort[n.formattedText]=1,n.valueSort.levelName=n.formattedText,n.valueSort[n.actualText]=1,n.valueSort.uniqueName=n.actualText;for(var s=0,o=t.length;s<o;s++)n.indexObject[t[s]]=t[s];return"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals?e.unshift(n):e.push(n),e},t.prototype.getTableData=function(e,t,i,a,r,n,s,o,l,d){for(var p=e.length,h=0;h<p;h++){var u=!this.valueAxis&&!this.isLastHeaderHasMeasures&&r.length<this.dataSourceSettings.columns.length+1?this.dataSourceSettings.columns.length+1:r.length,c=e[h],g=(t[u]=c,u-Number(Object.keys(t)[0])),m=!t[u].members.length,S=(c.colIndex=0,c.rowIndex=u,!1),f=this.dataSourceSettings.valueSortSettings.headerDelimiter;if(this.valueAxis&&0===this.dataSourceSettings.rows.length&&1<this.dataSourceSettings.values.length&&(this.rowIndex=Ue.isNullOrUndefined(this.rowIndex)&&!m&&0===this.dataSourceSettings.rows.length?c.index:this.rowIndex,S=this.valueAxis&&0===this.dataSourceSettings.rows.length&&c.valueSort.levelName&&0!==c.valueSort.levelName.toString().indexOf("Grand Total"+f),this.valueAxis)&&0===this.dataSourceSettings.rows.length&&0===c.valueSort.levelName.toString().indexOf("Grand Total"+f)&&(c.index=this.rowIndex),S)m||this.recursiveRowData(e,t,i,u,r,n,m,h,0,s,o,l);else{var v=!1;if(this.showSubTotalsAtBottom&&t[a]&&t[a].hasChild)for(var y=0,b=t[a].members;y<b.length;y++)if("value"===b[y].type){v=!0;break}if(!v||t[u].isSum||!t[u].members||0!==t[u].members.length)if(r[u]||(r[u]=[],this.valueContent[g]={}),r[u][0]=t[u]=this.valueContent[g][0]=Ce.getFormattedHeader(c,this),this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)){var C=u,x=g,f=u,w=!1;if(((0!==s||0!==this.measureIndex)&&!m||m)&&"value"===c.type&&!c.valueSort.axis||s>this.measureIndex&&"row"===c.axis&&c.valueSort.axis)for(var T=0,M=!1,D=c.valueSort.uniqueName?c.valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter):[],O=0,P=1,N=i.length;O<N;++O){if(!M)for(T=0;T<n;T++)if(-1<D.indexOf(this.dataSourceSettings.values[T].name)){w=M=!0;break}if(s>this.measureIndex&&"row"===c.axis&&c.valueSort.axis)this.updateRowData(e,i,u,r,T,h,O,P,g,o,l);else{if(!t[a]){w=!1;break}var E=this.showSubTotalsAtBottom&&d?d:a;this.updateRowData(t,i,u,r,T,E,O,P,g,o,l)}P=r[u].length}if(!w)for(O=0,P=1,N=i.length;O<N;++O)P=r[u].length,r[C][P]=this.valueContent[x][P]={axis:"value",actualText:"",colSpan:1,colIndex:P,formattedText:"",hasChild:!1};this.recursiveRowData(e,t,i,f,r,n,m,h,n,s,o,l)}else{for(O=0,P=1,N=i.length;O<N;++O)for(var F=i[O].valueSort.uniqueName?i[O].valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter):[],T=0;T<n;T++)(this.valueAxis||this.isLastHeaderHasMeasures||-1<F.indexOf(this.dataSourceSettings.values[T].name))&&(this.updateRowData(e,i,u,r,T,h,O,P,g,o,l),P=r[u].length);this.recursiveRowData(e,t,i,u,r,n,m,h,0,s,o,l)}}}},t.prototype.insertRowSubTotals=function(e,t,i,a,r,n,s,o){var l=!!e[i].type&&"value"===e[i].type&&e[i].valueSort.levelName!==e[i].actualText;if(e[i].hasChild&&0<e[i].members.length){var d=[],p=Ce.frameHeaderWithKeys(e[i]);if("value"===e[i].members[0].type){for(var h=0,u=[],c=1,g=0,m=p.members;g<m.length;g++){var S=m[g];"value"===S.type&&(u[u.length]=S)}for(;h<u.length;){for(var f=Ce.frameHeaderWithKeys(u[h]),v=void 0;c<e.length;c++)if(e[c]&&e[c].valueSort.levelName===f.valueSort.levelName){v=e.indexOf(e[c]);break}-1<v&&(d[d.length]=v),f.formattedText=p.formattedText+" "+f.formattedText,f.isSum=!0,f.members=[],this.getTableData([f],e,t,i,a,r,n,s,o),h++}}else{p.formattedText=p.formattedText+" Total",p.members=[],p.isDrilled=!1,p.hasChild=!1,p.isSum=!0,p.type="sum";l=l?this.getParentIndex(e,p):0;this.getTableData([p],e,t,i,a,r,n,s,o,l),d=[i]}for(v=0;v<d.length;v++){var y=(y=a[d[v]]).map(function(e){return e.formattedText=0===e.colIndex?e.formattedText:"",e});a[d[v]]=y}}},t.prototype.getParentIndex=function(e,t){for(var i=0,a=e.length-1;0<a;a--)if(t.level===e[a].level&&e[a].index){i=a;break}return i},t.prototype.getAggregatedHeaders=function(e,t,i,a,r){this.selectedHeaders={selectedHeader:[],values:[]};for(var n=r.length,s=0;s<n;s++)switch(r[s].type){case"DifferenceFrom":case"PercentageOfDifferenceFrom":for(var o=void 0,l=void 0,d=(this.selectedHeaders.values.push(r[s].name),r[s].baseField&&r[s].baseItem?(o=r[s].baseField,l=r[s].baseItem):this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&0<t.length?(o=t[0].name,l=Object.keys(this.fieldList[t[0].name].members)[0]):0<e.length&&(o=e[0].name,l=Object.keys(this.fieldList[e[0].name].members)[0]),!1),p=0,h=e;p<h.length;p++)if(h[p].name===o){this.getAggregatedHeaderData(i,r[s].name,l,!1,"row",r[s].type,this.selectedHeaders.selectedHeader,s),d=!0;break}if(!d)for(var u=0,c=t;u<c.length;u++)if(c[u].name===o){this.getAggregatedHeaderData(a,r[s].name,l,!1,"column",r[s].type,this.selectedHeaders.selectedHeader,s);break}break;case"PercentageOfParentRowTotal":case"PercentageOfParentColumnTotal":this.selectedHeaders.values.push(r[s].name),this.getAggregatedHeaderData("PercentageOfParentRowTotal"===r[s].type?i:a,r[s].name,void 0,!1,"PercentageOfParentRowTotal"===r[s].type?"row":"column",r[s].type,this.selectedHeaders.selectedHeader,s);break;case"RunningTotals":this.selectedHeaders.values.push(r[s].name),this.getAggregatedHeaderData(this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)?a:i,r[s].name,void 0,!1,this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)?"column":"row",r[s].type,this.selectedHeaders.selectedHeader,s);break;case"PercentageOfParentTotal":for(var o=void 0,d=(this.selectedHeaders.values.push(r[s].name),r[s].baseField?o=r[s].baseField:this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&0<t.length?o=t[0].name:0<e.length&&(o=e[0].name),!1),g=e.length,m=0;m<g;m++)if(e[m].name===o){var S=m>=this.measureIndex?m+1:m;this.getAggregatedHeaderData(i,r[s].name,void 0,!1,"row",r[s].type,this.selectedHeaders.selectedHeader,s,S),d=!0;break}if(!d)for(g=t.length,m=0;m<g;m++)if(t[m].name===o){S=m;this.valueAxis||this.isLastHeaderHasMeasures||(S=m>=this.measureIndex?m+1:m),this.getAggregatedHeaderData(a,r[s].name,void 0,!1,"column",r[s].type,this.selectedHeaders.selectedHeader,s,S);break}}},t.prototype.getAggregatedHeaderData=function(e,t,i,a,r,n,s,o,l){for(var d=0,p=e;d<p.length;d++){var h=p[d];switch(n){case"DifferenceFrom":case"PercentageOfDifferenceFrom":if(-1!==h.valueSort.levelName.toString().split(this.valueSortSettings.headerDelimiter).indexOf(i)){var u=[];if(!a&&"row"===r)for(var c=0,g=e;c<g.length;c++){var m=g[c];m.level>=h.level&&u.push(m)}if(s.push(this.updateSelectedHeaders(i,h.level,r,a,t,n,h.valueSort.levelName,a?[h]:"column"===r?e:u,o+1)),0<h.members.length){var S=!1,f=[];if("row"===r)for(var v=0,y=h.members;v<y.length;v++){if("value"!==(w=y[v]).type||0!==w.members.length){f.push(w),S=!1;break}S=!0}(!S&&0<f.length||"column"===r)&&this.getAggregatedHeaderData("column"===r?h.members:f,t,i,!0,r,n,s[s.length-1].childMembers,o)}}else 0<h.members.length&&this.getAggregatedHeaderData(h.members,t,i,!1,r,n,s,o);break;case"RunningTotals":case"PercentageOfParentRowTotal":case"PercentageOfParentColumnTotal":"grand sum"===h.type?s.push(this.updateSelectedHeaders(void 0,h.level,r,!1,t,n,h.valueSort.levelName,e,o+1)):0<h.members.length&&(s.push(this.updateSelectedHeaders(void 0,h.level,r,!1,t,n,h.valueSort.levelName,h.members,o+1)),this.getAggregatedHeaderData(h.members,t,void 0,!1,r,n,s,o));break;case"PercentageOfParentTotal":if("grand sum"!==h.type)if(h.valueSort.levelName.split(this.valueSortSettings.headerDelimiter).length-1===l)if(0<h.members.length){if(a)for(var b=s[s.length-1].aggregateHeaders,C=0,x=h.members;C<x.length;C++){var w=x[C];b.push(Ue.extend({},w,null,!0))}else{var T=Ue.extend([],h.members,null,!0);s.push(this.updateSelectedHeaders(void 0,h.level,r,!1,t,n,h.valueSort.levelName,T,o+1)),(b=s[s.length-1].aggregateHeaders).push(Ue.extend({},h,null,!0))}this.getAggregatedHeaderData(h.members,t,void 0,!0,r,n,s,o,l+1)}else a||s.push(this.updateSelectedHeaders(void 0,h.level,r,!1,t,n,h.valueSort.levelName,[h],o+1));else 0<h.members.length&&this.getAggregatedHeaderData(h.members,t,void 0,!1,r,n,s,o,l)}}},t.prototype.updateSelectedHeaders=function(e,t,i,a,r,n,s,o,l){return{name:e,level:t,axis:i,isChild:a,value:r,type:n,uniqueName:s,aggregateHeaders:Ue.extend([],o,null,!0),childMembers:[],valueCount:l}},t.prototype.applyAdvancedAggregate=function(e,t,i){if(this.aggregatedValueMatrix=[],0<this.selectedHeaders.values.length){for(var a={},r=[],n=[],s=!1,o=i.length,l=0;l<o;l++)if(void 0!==i[l]&&void 0!==i[l][0]){if(!s)for(var d=i[l].length,p=0;p<d;p++){var h=i[l][p].actualText;"value"===i[l][p].axis&&-1!==this.selectedHeaders.values.indexOf(h)&&(r.push(p),s=!0)}var u=this.showSubTotalsAtBottom&&i[l][0].isDrilled&&i[l][0].hasChild;if(!u&&0<r.length&&"value"===i[l][r[0]].axis&&-1!==this.selectedHeaders.values.indexOf(i[l][r[0]].actualText)){n.push(l);for(var c=0,g=r;c<g.length;c++)a[l+","+(m=g[c])]=[l,m]}}this.updateAggregates(e,t,i,this.selectedHeaders.selectedHeader,r,n,a);for(var m,S=0,f=Object.keys(a);S<f.length;S++)i[a[m=f[S]][0]][a[m][1]].formattedText=0<this.selectedHeaders.selectedHeader.length?this.emptyCellTextContent:"#N/A",this.aggregatedValueMatrix[a[m][0]]||(this.aggregatedValueMatrix[a[m][0]]=[]),this.aggregatedValueMatrix[a[m][0]][a[m][1]]=0;this.updatePivotValues(!0)}},t.prototype.updateAggregates=function(e,t,i,k,a,r,n){for(var s=0,j=k;s<j.length;s++){var o=j[s],l=o.aggregateHeaders,d=o.value,q=o.type,p=o.uniqueName,h="row"===o.axis,u=void 0,c=[],g=[],m=[],S=[],f=[],v=[];if(-1!==["DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal","RunningTotals"].indexOf(o.type))if(h){if("RunningTotals"!==o.type)for(var V=0,H=r;V<H.length;V++){var y=H[V];if(void 0!==e[y]&&e[y].valueSort[p]){u=e[y],f=0===this.valueAxis||this.valueAxis&&i[y]&&i[y][1]&&i[y][1].actualText===d?i[y]:[];break}}}else{for(var _=i.length,b=0;b<_&&(void 0!==i[b]&&void 0===i[b][0]);b++)m.push(i[b]);for(var C=m.length;C--;){var U=(M=m[C][a[0]]).actualText;-1===this.selectedHeaders.values.indexOf(U)&&(g=m[C],C=0)}if("RunningTotals"!==o.type){for(var x=g.length,w=0;w<x;w++){var T=!1;if(void 0!==g[w]&&g[w].valueSort[p]){for(var u=g[w],B=i.length,b=0;b<B;b++)void 0!==(M=i[b])&&void 0!==M[0]&&"value"===M[w].axis&&-1!==this.selectedHeaders.values.indexOf(M[w].actualText)&&(T=!0,v[b]=M[w],S.push(b));if(T)break}}if(0===v.length&&0===S.length)for(x=g.length,w=0;w<x;w++){T=!1;if(void 0!==g[w]&&0===g[w].valueSort.levelName.indexOf(p)){u=g[w];for(var M,G=i.length,D=0;D<G;D++)void 0!==(M=i[D])&&void 0!==M[0]&&"value"===M[w].axis&&-1!==this.selectedHeaders.values.indexOf(M[w].actualText)&&(T=!0,S.push(D));if(T)break}}}}switch(o.type){case"DifferenceFrom":case"PercentageOfDifferenceFrom":var z=o.isChild;if(h){if(z)for(var O=p.split(this.valueSortSettings.headerDelimiter),W=0,Q=r;W<Q.length;W++){var P=Q[W];if(void 0!==e[P])if(-1!==e[P].valueSort.levelName.split(this.valueSortSettings.headerDelimiter).indexOf(O[O.length-1])&&u&&e[P].level===u.level)for(var Y=0,K=a;Y<K.length;Y++){E=K[Y];"value"===(F=i[P][E]).axis&&F.actualText===d&&(c.push([P,E]),n[P+","+E])&&delete n[P+","+E]}}else for(var X=0,J=l;X<J.length;X++)for(var N=J[X],Z=0,$=r;Z<$.length;Z++){y=$[Z];if(void 0!==e[y]&&e[y].valueSort[N.valueSort.levelName]&&e[y].level===u.level&&"grand sum"!==e[y].type)for(var ee=0,te=a;ee<te.length;ee++){var E=te[ee];"value"===(F=i[y][E]).axis&&F.actualText===d&&(c.push([y,E]),n[y+","+E])&&delete n[y+","+E]}}for(var ie=0,ae=c;ie<ae.length;ie++){var F=i[(E=ae[ie])[0]][E[1]],re=Ue.isNullOrUndefined(f[E[1]].actualValue)?0:f[E[1]].actualValue,I=(Ue.isNullOrUndefined(F.actualValue)?0:F.actualValue)-re;I=isNaN(I)||0===F.value&&0===f[E[1]].value?0:I,this.aggregatedValueMatrix[E[0]]||(this.aggregatedValueMatrix[E[0]]=[]),"DifferenceFrom"===q?(this.aggregatedValueMatrix[E[0]][E[1]]=I,F.formattedText=0===I?this.emptyCellTextContent:this.getFormattedValue(I,d).formattedText):(this.aggregatedValueMatrix[E[0]][E[1]]=I=0===re?0:I/re,F.formattedText=F.showSubTotals?0!==I?this.globalize.formatNumber(I,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,F.actualText)}):this.emptyCellTextContent:F.formattedText)}}else{if(z)for(var O=p.split(this.valueSortSettings.headerDelimiter),x=g.length,L=0;L<x;L++){T=!1;if(void 0!==g[L])if(-1!==g[L].valueSort.levelName.split(this.valueSortSettings.headerDelimiter).indexOf(O[O.length-1])&&g[L].level===u.level){for(var ne=0,se=S;ne<se.length;ne++)"value"===(F=i[E=se[ne]][L]).axis&&F.actualText===d&&(T=!0,c.push([E,L]),n[E+","+L])&&delete n[E+","+L];if(T)break}}else for(var oe=0,le=l;oe<le.length;oe++)for(N=le[oe],x=g.length,w=0;w<x;w++){var T=!1;if(void 0!==g[w]&&g[w].valueSort[N.valueSort.levelName]&&u&&g[w].level===u.level&&"grand sum"!==g[w].type){for(var de=0,pe=S;de<pe.length;de++)"value"===(F=i[E=pe[de]][w]).axis&&F.actualText===d&&(T=!0,c.push([E,w]),n[E+","+w])&&delete n[E+","+w];if(T)break}}var he=void 0;0===v.length&&(he=this.getSelectedColumn(o.uniqueName,t));for(var ue=0,ce=c;ue<ce.length;ue++){var F=i[(E=ce[ue])[0]][E[1]],ge=0,I=(ge=0===v.length?(A=this.getSelectedRow(F.rowHeaders,e),this.getAggregateValue(A.index,he.indexObject,this.fieldList[d].index,o.type,!1)):v[E[0]].value,F.value-ge);I=isNaN(I)?0:I,this.aggregatedValueMatrix[E[0]]||(this.aggregatedValueMatrix[E[0]]=[]),"DifferenceFrom"===q?F.formattedText=0===I?this.emptyCellTextContent:this.getFormattedValue(I,d).formattedText:(I=0===v[E[0]].value?0:I/v[E[0]].value,F.formattedText=0!==I?this.globalize.formatNumber(I,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,F.actualText)}):this.emptyCellTextContent),this.aggregatedValueMatrix[E[0]][E[1]]=I}}0<o.childMembers.length&&this.updateAggregates(e,t,i,o.childMembers,a,r,n);break;case"PercentageOfParentRowTotal":case"PercentageOfParentColumnTotal":case"PercentageOfParentTotal":if(h){for(var me=0,Se=l;me<Se.length;me++)for(var N=Se[me],fe=0,ve=r;fe<ve.length;fe++){b=ve[fe];if(void 0!==e[b]&&e[b].valueSort[N.valueSort.levelName]&&e[b].level===N.level)for(var ye=0,be=a;ye<be.length;ye++){E=be[ye];"value"===(F=i[b][E]).axis&&F.actualText===d&&(c.push([b,E]),n[b+","+E])&&delete n[b+","+E]}}for(var Ce=0,xe=c;Ce<xe.length;Ce++){var F=i[(b=xe[Ce])[0]][b[1]],we=0,we=0===f.length&&u?this.getAggregateValue(u.index,t[b[1]-1].indexObject,this.fieldList[d].index,o.type,!1):f[b[1]]?f[b[1]].actualValue:0,I=F.value/we;I=isNaN(I)?0:I,F.formattedText=F.showSubTotals?0!==I?this.globalize.formatNumber(I,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,F.actualText)}):this.emptyCellTextContent:F.formattedText,this.aggregatedValueMatrix[b[0]]||(this.aggregatedValueMatrix[b[0]]=[]),this.aggregatedValueMatrix[b[0]][b[1]]=I}}else{for(var Te=0,Me=l;Te<Me.length;Te++)for(N=Me[Te],x=g.length,D=0;D<x;D++){T=!1;if(void 0!==g[D]&&g[D].valueSort[N.valueSort.levelName]){for(var De=0,Oe=S;De<Oe.length;De++){E=Oe[De];this.showSubTotalsAtBottom&&i[E][0].isDrilled&&i[E][0].hasChild||"value"===(F=i[E][D]).axis&&F.actualText===d&&(T=!0,c.push([E,D]),n[E+","+D])&&delete n[E+","+D]}if(T)break}}var Pe=void 0;0===v.length&&(Pe=this.getSelectedColumn(o.uniqueName,t));for(var Ne=0,Ee=c;Ne<Ee.length;Ne++){var A,F=i[(b=Ee[Ne])[0]][b[1]],R=0,R=(R=0===v.length?(A=this.getSelectedRow(F.rowHeaders,e),this.getAggregateValue(A.index,Pe.indexObject,this.fieldList[d].index,o.type,!1)):v[b[0]].value,F.value/R),R=isNaN(R)?0:R;F.formattedText=0!=R?this.globalize.formatNumber(R,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,F.actualText)}):this.emptyCellTextContent,this.aggregatedValueMatrix[b[0]]||(this.aggregatedValueMatrix[b[0]]=[]),this.aggregatedValueMatrix[b[0]][b[1]]=R}}break;case"RunningTotals":if(h){for(var Fe=0,Ie=a;Fe<Ie.length;Fe++)for(var E=Ie[Fe],I=0,Le=0,Ae=l;Le<Ae.length;Le++)for(var N=Ae[Le],Re=0,ke=r;Re<ke.length;Re++)if(void 0!==e[P=ke[Re]]){F=i[P][E];if(void 0!==e[P]&&e[P].valueSort[N.valueSort.levelName]&&e[P].level===N.level&&"value"===F.axis&&F.actualText===d){"grand sum"!==e[P].type&&(I+=F.showSubTotals||!Ue.isNullOrUndefined(F.actualValue)&&isNaN(F.actualValue)?Ue.isNullOrUndefined(F.value)||isNaN(F.value)?null:F.value:F.actualValue,F.formattedText=F.showSubTotals?0===I&&F.actualValue&&0!==F.actualValue?"":this.getFormattedValue(I,d).formattedText:F.formattedText,this.aggregatedValueMatrix[P]||(this.aggregatedValueMatrix[P]=[]),this.aggregatedValueMatrix[P][E]=I),n[P+","+E]&&delete n[P+","+E];break}}}else for(var je=0,qe=r;je<qe.length;je++)if(void 0!==i[y=qe[je]])for(var I=0,Ve=0,He=l;Ve<He.length;Ve++)for(var N=He[Ve],_e=e[y].hasChild&&e[y].isDrilled&&(!Ue.isNullOrUndefined(e[y].showSubTotals)&&!e[y].showSubTotals||!this.dataSourceSettings.showSubTotals||!this.dataSourceSettings.showRowSubTotals),x=g.length,w=0;w<x;w++){F=i[y][w];if(void 0!==g[w]&&g[w].valueSort[N.valueSort.levelName]&&"value"===F.axis&&F.actualText===d){"grand sum"!==g[w].type&&(Ue.isNullOrUndefined(F.value)||(I+=F.value),F.formattedText=_e?"":this.getFormattedValue(I,d).formattedText,this.aggregatedValueMatrix[y]||(this.aggregatedValueMatrix[y]=[]),this.aggregatedValueMatrix[y][w]=I),n[y+","+w]&&delete n[y+","+w];break}}}}},t.prototype.getSelectedColumn=function(e,t){for(var i={axis:"column",index:[],indexObject:{}},a=0,r=t;a<r.length;a++){var n=r[a];n&&n.valueSort&&0===n.valueSort.levelName.indexOf(e)&&(i.index=i.index.concat(n.index).sort(function(e,t){return e-t}),i.indexObject=L({},i.indexObject,n.indexObject))}return i},t.prototype.getSelectedRow=function(e,t){for(var i=0,a=t;i<a.length;i++){var r=a[i];if(r){if(r.valueSort&&r.valueSort.levelName===e)return r;if(""===e&&"grand sum"===r.type)return r}}return null},t.prototype.recursiveRowData=function(e,t,i,a,r,n,s,o,l,d,p,h){s||this.getTableData(t[a].members,t,i,a,r,n,d+1,p,h),this.showSubTotalsAtBottom&&(Ue.isNullOrUndefined(e[o].showSubTotals)||e[o].showSubTotals)&&this.insertRowSubTotals(t,i,a,r,n,d,p,h),this.isPagingOrVirtualizationEnabled||(t[a].members=[])},t.prototype.updateRowData=function(e,t,i,a,r,n,s,o,l,d,p){var h=this.fieldList[this.dataSourceSettings.values[r].name].index,u=this.fieldList[this.dataSourceSettings.values[r].name].aggregateType,c=this.dataSourceSettings.values[r].name,g=[],m={},S=0,f=0;switch(u){case"Index":for(var v=["cVal","rTotalVal","cTotalVal","gTotalVal"],y=0,b=0,C=g=[[e[n],t[s]],[e[n],p],[d,t[s]],[d,p]];b<C.length;b++){var x=C[b];m[v[y]]=this.getAggregateValue(x[0].index,x[1].indexObject,h,u,0!==y),y++}var w=m.cVal*m.gTotalVal/(m.rTotalVal*m.cTotalVal),S=!(0<e[n].members.length&&e[n].hasChild&&e[n].isDrilled)||(Ue.isNullOrUndefined(e[n].showSubTotals)||e[n].showSubTotals)&&this.dataSourceSettings.showRowSubTotals&&this.dataSourceSettings.showSubTotals?Ue.isNullOrUndefined(m.cVal)?m.cVal:isNaN(w)?0:w:void 0,f=Ue.isNullOrUndefined(m.cVal)?m.cVal:isNaN(w)?0:w;break;case"PercentageOfGrandTotal":case"PercentageOfColumnTotal":case"PercentageOfRowTotal":(g=[[e[n],t[s]]]).push("PercentageOfGrandTotal"===u?[d,p]:"PercentageOfColumnTotal"===u?[d,t[s]]:[e[n],p]);for(var v=["cVal","gTotalVal"],y=0,T=0,M=g;T<M.length;T++){x=M[T];m[v[y]]=this.getAggregateValue(x[0].index,x[1].indexObject,h,u,0!==y),y++}w=m.cVal/m.gTotalVal;S=!(0<e[n].members.length&&e[n].hasChild&&e[n].isDrilled)||(Ue.isNullOrUndefined(e[n].showSubTotals)||e[n].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals?Ue.isNullOrUndefined(m.cVal)?m.cVal:isNaN(w)?0:w:void 0,f=Ue.isNullOrUndefined(m.cVal)?m.cVal:isNaN(w)?0:w;break;default:w=this.getAggregateValue(e[n].index,t[s].indexObject,h,u,!1);S=!(0<e[n].members.length&&e[n].hasChild&&e[n].isDrilled)||(Ue.isNullOrUndefined(e[n].showSubTotals)||e[n].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals?w:void 0,f=w}var r={fieldName:this.dataSourceSettings.values[r].name,row:e[n],column:t[s],value:S,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:e[n].hasChild&&e[n].isDrilled?"subTotal":"grand sum"===e[n].type?"grandTotal":"value",columnCellType:t[s].hasChild&&t[s].isDrilled?"subTotal":"grand sum"===t[s].type?"grandTotal":"value",aggregateType:u,skipFormatting:!1},D=(this.getValueCellInfo&&this.getValueCellInfo(r),S=r.value,e[n].hasChild||t[s].hasChild||"grand sum"===e[n].type||"grand sum"===t[s].type||this.showSubTotalsAtBottom&&e[n].isSum),O="grand sum"===e[n].type||"grand sum"===t[s].type,P=0<e[n].members.length&&e[n].hasChild&&e[n].isDrilled&&(!Ue.isNullOrUndefined(e[n].showSubTotals)&&!e[n].showSubTotals||!this.dataSourceSettings.showSubTotals||!this.dataSourceSettings.showRowSubTotals),N=P?"":void 0===S?this.emptyCellTextContent:"Count"===u||"DistinctCount"===u?S.toLocaleString():this.getFormattedValue(S,c).formattedText;!isNaN(S)&&!Ue.isNullOrUndefined(S)&&0<=["PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal"].indexOf(u)?N=this.globalize.formatNumber(S,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,r.fieldName)}):P||!isNaN(S)||Ue.isNullOrUndefined(S)||-1===["PopulationStDev","SampleStDev","PopulationVar","SampleVar"].indexOf(u)||(N="#DIV/0!",S=0),N=r.skipFormatting?Ue.isNullOrUndefined(S)?this.emptyCellTextContent:S.toString():N,a[i][o]=this.valueContent[l][o]={axis:"value",actualText:c,indexObject:this.isDrillThrough?this.rawIndexObject:{},rowHeaders:"grand sum"===e[n].type?"":e[n].valueSort.levelName,columnHeaders:"grand sum"===t[s].type?"":t[s].valueSort.levelName,formattedText:N,value:S,hierarchyName:t[s].hierarchyName,actualValue:f,rowIndex:i,colIndex:o,isSum:D,isGrandSum:O,showSubTotals:!P},this.rawIndexObject={}},t.prototype.getCellSet=function(e){for(var t=[],i=0,a=Object.keys(e);i<a.length;i++){var r=a[i];this.data[parseInt(r,10)]&&t.push(this.data[parseInt(r,10)])}return t},t.prototype.updateValueMembers=function(e,t,i,a,r,n,s){var o=i&&!Ue.isNullOrUndefined(i.levelName)?i.levelName.toString():void 0,l=i&&!Ue.isNullOrUndefined(i.uniqueName)?i.uniqueName.toString():void 0;if(e)for(var d=0;d<n;d++){var p=this.dataSourceSettings.values[d],h=p.caption||p.name,u={axis:this.valueAxis?"row":"column",rowIndex:this.valueAxis?0:t&&s<=t.rowIndex?t.rowIndex+1:s,actualText:p.name,formattedText:h,level:0,valueSort:{},members:[],type:this.valueAxis?"value":t?t.type:null,index:!this.valueAxis&&t?t.index:null,indexObject:!this.valueAxis&&t?t.indexObject:null},c=(0<r.length&&(u.showSubTotals=p.showSubTotals),u.valueSort);c.axis=this.valueAxis?void 0:p.name,c[(o?o+this.valueSortSettings.headerDelimiter:"")+h]=1,c[(l?l+this.valueSortSettings.headerDelimiter:"")+p.name]=1,c.levelName=(o?o+this.valueSortSettings.headerDelimiter:"")+h,c.uniqueName=(l?l+this.valueSortSettings.headerDelimiter:"")+p.name,a.push(u),this.updateValueMembers(!1,t,c,u.members,r,n,s+1)}else for(var g=0,m=r.length;g<m;g++){var S=Ce.frameHeaderWithKeys(r[g]),f=(S.members=[],S.rowIndex=this.valueAxis?S.rowIndex:s<0?0:s,{}),v=(f.axis=S.valueSort.axis,f[(o?o+this.valueSortSettings.headerDelimiter:"")+S.formattedText]=1,f[(l?l+this.valueSortSettings.headerDelimiter:"")+S.actualText]=1,f.levelName=(o?o+this.valueSortSettings.headerDelimiter:"")+S.formattedText,f.uniqueName=(l?l+this.valueSortSettings.headerDelimiter:"")+S.actualText,S.hierarchyName=S.valueSort.uniqueName,(S.valueSort=f).axis+this.valueSortSettings.headerDelimiter+f.levelName),y=this.fieldList[f.axis];S.isDrilled&&((this.isExpandAll||y.expandAll)&&this.fieldDrillCollection[v]||!this.isExpandAll&&!y.expandAll&&!this.fieldDrillCollection[v])&&(S.isDrilled=!1),a.push(S),S.isDrilled&&0<r[g].members.length?(this.valueAxis&&s<this.measureIndex&&this.measureIndex!==s+1&&(!r[g].hasChild||(Ue.isNullOrUndefined(r[g].showSubTotals)||r[g].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals)&&this.updateValueMembers(!0,S,f,a[a.length-1].members,[],n,s),this.updateValueMembers(this.measureIndex===s+1,S,f,a[a.length-1].members,r[g].members,n,s+1),!this.valueAxis&&s<this.measureIndex&&this.measureIndex!==s+1&&(!r[g].hasChild||(Ue.isNullOrUndefined(r[g].showSubTotals)||r[g].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals)&&this.updateValueMembers(!0,S,f,a[a.length-1].members,[],n,s)):s<this.measureIndex&&this.updateValueMembers(!0,S,f,a[a.length-1].members,[],n,s)}},t.prototype.reArrangeValueMember=function(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];this.valueAxisFields[r.actualText]&&(t[t.length]=r)}return t.concat(e).slice(0,e.length)},t.prototype.frameDefinedHeaderData=function(e,t,i,a,r,n){for(var s=0,o=e.length;s<o;s++){var l,d,p=!0,h=(!(0<e[s].members.length)||(Ue.isNullOrUndefined(e[s].showSubTotals)||e[s].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals||(p=!1),this.measureIndex<a&&p?1:this.measureIndex>a&&0<e[s].members.length||this.measureIndex!==a+1||!e[s].isDrilled?this.measureIndex===a&&0!==this.measureIndex&&p||this.measureIndex>a&&p&&e[s].valueSort&&e[s].valueSort.axis&&this.measureNames[e[s].valueSort.axis.toString()]?1:0:0!==this.measureIndex&&p?1:0),p=(e[s].members.length&&(l=void 0,d=e[s].members,this.showSubTotalsAtTop?a+1<this.measureIndex&&p?(l=r,d=this.reArrangeValueMember(d)):l=r+h:l=r,this.frameDefinedHeaderData(d,t,i,a+1,l,n)),this.measureIndex>a&&e[s].valueSort&&e[s].valueSort.axis&&this.measureNames[e[s].valueSort.axis.toString()]?this.measureIndex:a);t[(r=this.showSubTotalsAtTop?r+1:t.length+h)-1]||(t[r-1]=Ce.frameHeaderWithKeys(e[s])),e[s].colIndex=r,i[p]||(i[p]=[],this.headerContent[p]={}),i[p][r]=this.headerContent[p][r]=Ce.frameHeaderWithKeys(e[s]),this.isPagingOrVirtualizationEnabled||this.showSubTotalsAtTop&&0==h||t[r-1]&&(t[r-1].members=[]),this.showSubTotalsAtTop&&(r=t.length,s+1===o)&&0===e[s].level&&(this.reformAxisCount=t.length+1)}},t.prototype.getHeaderData=function(e,t,i,a,r,n,s,o,l){if(this.valueAxis||this.isLastHeaderHasMeasures){if(0===a.length&&this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&0<this.dataSourceSettings.values.length&&(this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&"grand sum"===this.rMembers[this.rMembers.length-1].type?(this.updateValueMembers(0===this.measureIndex&&1<this.rMembers.length,null,null,a,this.rMembers.slice(0,this.rMembers.length-1),this.dataSourceSettings.values.length,0),this.updateValueMembers(!1,null,null,a,this.rMembers.slice(this.rMembers.length-1,this.rMembers.length),this.dataSourceSettings.values.length,-1)):"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&0===this.measureIndex?(this.updateValueMembers(!1,null,null,a,this.rMembers.slice(0,1),this.dataSourceSettings.values.length,-1),this.updateValueMembers(0===this.measureIndex&&1<this.rMembers.length,null,null,a,this.rMembers.slice(1,this.rMembers.length),this.dataSourceSettings.values.length,0)):(M=0===e.length&&1===this.rMembers.length&&"grand sum"===this.rMembers[0].type,this.updateValueMembers(!M&&0===this.measureIndex,null,null,a,this.rMembers,this.dataSourceSettings.values.length,M?-1:0)),this.getAggregatedHeaders(e,t,a,r,i),0<this.selectedHeaders.values.length))for(O=this.selectedHeaders.selectedHeader.length,P=0;P<O;P++)if("row"===(D=this.selectedHeaders.selectedHeader[P]).axis)for(var d=D.aggregateHeaders.length,p=0;p<d;p++)if(D.aggregateHeaders[p].actualText===D.value)if(-1!==D.aggregateHeaders[p].valueSort.levelName.indexOf(D.uniqueName))D.uniqueName=D.aggregateHeaders[p].valueSort.levelName,D.aggregateHeaders.splice(p,1),p--,d--;else for(var h,u=D.aggregateHeaders[p].members.length,c=0;c<u;c++)"value"!==(E=D.aggregateHeaders[p].members[c]).type&&E.level===D.aggregateHeaders[p].level&&(h=Ue.extend([],D.aggregateHeaders[p].members,null,!0),D.aggregateHeaders=[].concat(D.aggregateHeaders,h,D.aggregateHeaders.splice(p)),D.aggregateHeaders.splice(h.length+p,1),p=h.length+p-1,d=D.aggregateHeaders.length);else if(D.aggregateHeaders[p].actualText!==D.value&&0<D.aggregateHeaders[p].members.length)for(u=D.aggregateHeaders[p].members.length,c=0;c<u;c++)if((E=D.aggregateHeaders[p].members[c]).actualText===D.value){D.uniqueName===D.aggregateHeaders[p].valueSort.levelName&&(D.uniqueName=E.valueSort.levelName),D.aggregateHeaders[p].members.splice(c,1),D.aggregateHeaders[p]=E;break}for(var g=r.length,m=this.dataSourceSettings.columns.length,S=this.valueSortSettings.headerText,f=0;f<g;f++){var v=!Ue.isNullOrUndefined(r[f].showSubTotals)&&!r[f].showSubTotals,y=(r[f].members.length&&this.getHeaderData(e,t,i,a,r[f].members,n,s,this.showSubTotalsAtTop&&!v?o+1:o,l),!0),v=(o=this.showSubTotalsAtTop?o:n.length,!v&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals?n[o]=Ce.frameHeaderWithKeys(r[f]):(0<r[f].members.length?(this.removeCount++,y=!1):n[this.showSubTotalsAtTop?o:n.length]=Ce.frameHeaderWithKeys(r[f]),o=this.showSubTotalsAtTop?o:n.length-1),r[f].level),b=(r[f].rowIndex=v,o*l+(this.showSubTotalsAtTop?1:l)),v=(r[f].colIndex=b,s[v]||(s[v]=[],this.headerContent[v]={}),s[v][b]=this.headerContent[v][b]=Ce.getFormattedHeader(r[f],this),0===this.dataSourceSettings.columns.length&&1===this.dataSourceSettings.values.length);if((this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader||v)&&!this.valueAxis&&y)for(var C=0;C<l;C++){var x=this.dataSourceSettings.values[C].caption||this.dataSourceSettings.values[C].name,w={axis:"column",actualText:this.dataSourceSettings.values[C].name,formattedText:x,level:0,valueSort:{},colIndex:o*l+1+C,rowIndex:m},w=(s[m]||(s[m]=[],this.headerContent[m]={}),s[m][o*l+1+C]=this.headerContent[m][o*l+1+C]=w,s[m][o*l+1+C].valueSort);w[r[f].valueSort.levelName+this.valueSortSettings.headerDelimiter+x]=1,w.levelName=r[f].valueSort.levelName+this.valueSortSettings.headerDelimiter+x,w[r[f].valueSort.uniqueName+this.valueSortSettings.headerDelimiter+this.dataSourceSettings.values[C].name]=1,w.uniqueName=r[f].valueSort.uniqueName+this.valueSortSettings.headerDelimiter+this.dataSourceSettings.values[C].name,w&&w[S]&&(this.valueSortSettings.columnIndex=o*l+1+C)}else r[f].valueSort&&r[f].valueSort[S]&&(this.valueSortSettings.columnIndex=o*l+1);this.isPagingOrVirtualizationEnabled||(n[o].members=[]),this.showSubTotalsAtTop&&(o=n.length,0===r[f].level)&&f+1===g&&(this.reformAxisCount=n.length*l+1)}}else{var T,M=[];if(this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals&&"grand sum"===r[r.length-1].type?(this.updateValueMembers(0===this.measureIndex&&1<r.length,null,null,M,r.slice(0,r.length-1),l,0),this.updateValueMembers(!1,null,null,M,r.slice(r.length-1,r.length),l,-1)):"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&0===this.measureIndex?(this.updateValueMembers(!1,null,null,M,r.slice(0,1),l,-1),this.updateValueMembers(0===this.measureIndex&&1<r.length,null,null,M,r.slice(1,r.length),l,0)):(T=0===t.length&&1===r.length&&"grand sum"===r[0].type,this.updateValueMembers(!T&&0===this.measureIndex,null,null,M,r,l,T?-1:0)),this.getAggregatedHeaders(e,t,this.rMembers,M,i),0<this.selectedHeaders.values.length)for(var D,O=this.selectedHeaders.selectedHeader.length,P=0;P<O;P++)if("column"===(D=this.selectedHeaders.selectedHeader[P]).axis)if(D.uniqueName===D.value)this.selectedHeaders.selectedHeader.splice(P,1),P--,O--;else if("Grand Total"===D.uniqueName)for(var N=D.aggregateHeaders.length,p=0;p<N;p++)if(D.aggregateHeaders[p]&&0<D.aggregateHeaders[p].members.length)for(var E,F=0,I=D.aggregateHeaders[p].members;F<I.length;F++)(E=I[F]).actualText===D.value&&"grand sum"===(D.aggregateHeaders[p]=E).type&&(D.uniqueName=E.valueSort.levelName);this.frameDefinedHeaderData(M,n,s,0,this.showSubTotalsAtTop?0:1,l)}},t.prototype.getAggregateValue=function(e,t,i,a,r){var n=0,s=0,o=0,l=!0,d=!1;switch(a.toLowerCase()){case"median":for(var p=[],h=0;void 0!==e[n];)void 0!==t[C=e[n]]&&(d=!0,this.rawIndexObject[C]=C,Ue.isNullOrUndefined(this.valueMatrix[C][i].member)||p.push(this.valueMatrix[C][i].member)),n++;0<(O=p.length)&&(p.sort(function(e,t){return e-t}),s=O%2==0?(p[h=O/2<=1?0:O/2-1]+p[h+1])/2:p[h=(O+1)/2<=1?0:(O+1)/2-1]);break;case"count":for(;void 0!==e[n];)void 0!==t[C=e[n]]&&(d=!0,this.rawIndexObject[C]=C,s+=Ue.isNullOrUndefined(this.valueMatrix[C][i].member)?0:this.allowDataCompression?this.valueMatrix[C][i].member:1),n++;break;case"distinctcount":for(var u=[];void 0!==e[n];)void 0!==t[e[n]]&&(this.rawIndexObject[e[n]]=e[n],d=!0,m=this.data[e[n]][this.fieldKeys[this.fields[i]]],!Ue.isNullOrUndefined(m))&&(c=m.toString(),0===u.length||0<u.length&&-1===u.indexOf(c))&&(s+=this.allowDataCompression&&"number"==typeof m?m:1,u.push(c)),n++;break;case"product":for(;void 0!==e[n];)void 0!==t[C=e[n]]&&(this.rawIndexObject[C]=C,d=!0,c=this.valueMatrix[C][i].member,Ue.isNullOrUndefined(c)?l&&(s=c):(s=l||Ue.isNullOrUndefined(s)?1:s,s*=c),l=!1),n++;break;case"populationstdev":case"samplestdev":case"populationvar":case"samplevar":for(var c,g=0,m=0,S=[],h=0,f=0;void 0!==e[n];)void 0!==t[C=e[n]]&&(d=!0,this.rawIndexObject[C]=C,c=this.valueMatrix[C][i].member,Ue.isNullOrUndefined(c)||(m+=c,S.push(c),g++)),n++;if(0<g){for(var v=m/g,y=0,b=S;y<b.length;y++){var C=b[y];f+=Math.pow(C-v,2)}s=0===(h=-1!==["populationstdev","samplestdev"].indexOf(a.toLowerCase())?Math.sqrt(f/("populationstdev"===a.toLowerCase()?g:g-1)):f/("populationvar"===a.toLowerCase()?g:g-1))?NaN:h}else s=m;break;case"min":for(var x=!0,s=void 0;void 0!==e[n];)void 0!==t[C=e[n]]&&void 0!==this.valueMatrix[C][i].member&&(d=!0,this.rawIndexObject[C]=C,Ue.isNullOrUndefined(s)&&Ue.isNullOrUndefined(this.valueMatrix[C][i].member)?s=this.valueMatrix[C][i].member:x?(s=this.valueMatrix[C][i].member,x=!1):s=this.valueMatrix[C][i].member<s?this.valueMatrix[C][i].member:s),n++;break;case"max":for(var w=!0;void 0!==e[n];)void 0!==t[C=e[n]]&&void 0!==this.valueMatrix[C][i].member&&(d=!0,this.rawIndexObject[C]=C,w?(s=this.valueMatrix[C][i].member,w=!1):s=this.valueMatrix[C][i].member>s?this.valueMatrix[C][i].member:s),n++;break;case"calculatedfield":d=!0;var h=this.calculatedFields[this.fields[i]],T=h.formula,M={};if(this.calculatedFormulas[h.name])for(var D=this.calculatedFormulas[h.name],O=0,P=D.length;O<P;O++){var N,E=D[O],F=M[E.formula];void 0===F&&(N=E.type,F=this.getAggregateValue(e,t,E.index,N,!1),M[E.formula]=F),T=T.replace(E.formula,String(F))}s=(s=this.evaluate(T))===1/0||s===-1/0?1/0:void 0===s||isNaN(s)?void 0:JSON.parse(String(s));break;default:for(s=void 0;void 0!==e[n];)void 0!==t[C=e[n]]&&(d=!0,r||(this.rawIndexObject[C]=C),c=this.valueMatrix[C][i].member,Ue.isNullOrUndefined(s)&&Ue.isNullOrUndefined(c)?s=c:(Ue.isNullOrUndefined(s)&&(s=0),s+=Ue.isNullOrUndefined(c)?0:c),Ue.isNullOrUndefined(c)||o++),n++}return a&&"avg"===a.toLowerCase()&&0!==s&&!Ue.isNullOrUndefined(s)?s/o:d?s:void 0},t.prototype.evaluate=function(e){return Function('"use strict";return ('+e+")")()},t.prototype.getFormattedValue=function(e,t){var i=null===e?this.localeObj?this.localeObj.getConstant("null"):String(e):void 0===e?this.localeObj?t in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(e):e,a={formattedText:i.toString(),actualText:i,dateText:i};if(this.formatFields[t]&&(this.formatFields[t].format||this.formatFields[t].skeleton)&&!Ue.isNullOrUndefined(e))try{var r=this.formatFields[t].properties||this.formatFields[t],n=Ue.extend({},r,null,!0);delete n.name,!n.minimumSignificantDigits&&n.minimumSignificantDigits<1&&delete n.minimumSignificantDigits,!n.maximumSignificantDigits&&n.maximumSignificantDigits<1&&delete n.maximumSignificantDigits,n.type?(a.formattedText=this.dateFormatFunction[t].exactFormat(new Date(e)),a.actualText=e):(delete n.type,n.format&&!this.formatRegex.test(n.format)&&(Ue.isNullOrUndefined(n.minimumFractionDigits)&&delete n.minimumFractionDigits,Ue.isNullOrUndefined(n.maximumFractionDigits)&&delete n.maximumFractionDigits,Ue.isNullOrUndefined(n.minimumIntegerDigits))&&delete n.minimumIntegerDigits,a.formattedText=this.globalize.formatNumber(isNaN(Number(e))?e:Number(e),n),a.actualText=isNaN(Number(e))?e:Number(e),a.dateText=isNaN(Number(e))?e:Number(e)),"None"!==this.fieldList[t].sort&&n.type&&-1<["date","dateTime","time"].indexOf(this.formatFields[t].type)&&(a.dateText=this.dateFormatFunction[t].fullFormat(new Date(e))),this.fieldList[t].isCustomField&&(a.formattedText="NaN"===a.formattedText?i.toString():a.formattedText,a.dateText="NaN"===a.dateText?i.toString():a.dateText)}catch(e){if(!this.fieldList[t].isCustomField)throw e}finally{this.fieldList[t].isCustomField&&(a.formattedText=Ue.isNullOrUndefined(a.formattedText)||"NaN"===a.formattedText?i.toString():a.formattedText,a.dateText=Ue.isNullOrUndefined(a.dateText)||"NaN"===a.dateText?i.toString():a.dateText)}return a},t.prototype.powerFunction=function(e){if(-1<e.indexOf("^")){for(var i=[];-1<e.indexOf("(");)e=e.replace(/(\([^()]*\))/g,function(e,t){return i.push(t),"~"+(i.length-1)});for(i.push(e),e="~"+(i.length-1);-1<e.indexOf("~");)e=e.replace(new RegExp("~(\\d+)","g"),function(e,t){return i[t].replace(/(\w*)\^(\w*)/g,"Math.pow($1,$2)")})}return e},t.prototype.getTabularPivotValues=function(){this.tabularPivotValues=[];for(var e=this.emptyRowsLength=0;e<this.pivotValues.length;e++){for(var t=void 0;Ue.isNullOrUndefined(this.pivotValues[e])&&e<this.pivotValues.length;)this.tabularPivotValues.length++,e++;var i=(t=e<this.pivotValues.length?this.pivotValues[e]:t)[0]||void 0;if(Ue.isNullOrUndefined(i)||"row"!==i.axis){for(var a=[],r=this.rowMaxLevel+1,n=0;n<this.rowMaxLevel;n++)a.push(void 0);a.push(i);for(var s=t.slice(1,t.length),o=0;o<s.length;o++)s[o].colIndex=r,s[o].rowIndex=this.tabularPivotValues.length,r++;a=a.concat(s),this.tabularPivotValues.push(a)}else if(Ue.isNullOrUndefined(t[1])||i.hasChild&&i.isDrilled)this.emptyRowsLength++;else{for(var l,d=i.valueSort.levelName.split(this.dataSourceSettings.valueSortSettings.headerDelimiter),p=i.colIndex,h=[],u=d[0],c=0,g=0;g<d.length-1||g<this.rowMaxLevel;g++)g<d.length-1&&(0<g&&(u=u+"."+d[g]),l=i.isDrilled,(1<d.length||0===g)&&(l=!0),h.push({axis:i.axis,formattedText:d[g],rowIndex:this.tabularPivotValues.length,hasChild:i.hasChild,isDrilled:l,level:c,valueSort:{levelName:u},colIndex:p++,colSpan:1,rowSpan:1})),g>=i.level&&(l=0===g?this.rowMaxLevel:this.rowMaxLevel-1,h.push({axis:i.axis,formattedText:i.formattedText,rowIndex:this.tabularPivotValues.length,hasChild:i.hasChild,isDrilled:i.isDrilled,level:c,valueSort:{levelName:i.valueSort.levelName},colIndex:p++,colSpan:l,rowSpan:1})),c++;i.colIndex=p,i.rowIndex=this.tabularPivotValues.length,i.colSpan=1,i.rowSpan=1,h.push(i),this.setColumnSpan(h);for(var s=t.slice(1,t.length),m=1;m<t.length;m++){var S=t[m];S.colIndex=p+1,S.rowIndex=this.tabularPivotValues.length,p++}h=h.concat(s),this.tabularPivotValues.push(h)}}return this.tabularPivotValues},t.prototype.setColumnSpan=function(e){for(var t=1,i=e.length-1;0<=i;i--){0!==i&&e[i].formattedText===e[i-1].formattedText&&(e[i].colSpan=0,t++,e[i-1].colSpan=t);var a=e[i].formattedText.split(" ");if(i<e.length-1&&"Total"!==a[a.length-1]){e[i].hasChild=!0;for(var r=this.dataSourceSettings.drilledMembers,n=0;n<r.length;n++)for(var s=0;s<r[n].items.length;s++)r[n].items[s]===e[i].formattedText&&(e[i].isDrilled=!!e[i].isDrilled)}}},t.prototype.setRowSpan=function(){for(var e=this.headerContent.length,t=0;t<this.rowMaxLevel;t++){var i=1;if(this.tabularPivotValues.length>this.rowMaxLevel+e)for(var a=this.tabularPivotValues.length-1;e-1<=a;a--)if(a!==e-1){var r=this.tabularPivotValues;if(Ue.isNullOrUndefined(r[a-1]))break;Ue.isNullOrUndefined(r[a-1][t])||r[a][t].formattedText!==r[a-1][t].formattedText?i=1:(r[a][t].rowSpan=0,i++,r[a-1][t].rowSpan=i)}}},t);function t(){this.aggregatedValueMatrix=[],this.valueContent=[],this.formatFields={},this.groupingFieldsInfo={},this.dateFormatFunction={},this.calculatedFields={},this.calculatedFormulas={},this.valueAxis=0,this.saveDataHeaders={},this.columnCount=0,this.rowCount=0,this.columnPageCount=0,this.rowPageCount=0,this.colFirstLvl=0,this.rowFirstLvl=0,this.rowStartPos=0,this.colStartPos=0,this.enableValueSorting=!1,this.headerCollection={rowHeaders:[],columnHeaders:[],rowHeadersCount:0,columnHeadersCount:0},this.rMembers=[],this.cMembers=[],this.groupingFields={},this.isLastHeaderHasMeasures=!0,this.measureIndex=-1,this.isPagingOrVirtualizationEnabled=!1,this.rowMaxLevel=0,this.valueMatrix=[],this.memberCnt=-1,this.pageInLimit=!1,this.endPos=0,this.removeCount=0,this.colHdrBufferCalculated=!1,this.colValuesLength=1,this.rowValuesLength=1,this.slicedHeaders=[],this.fieldFilterMem={},this.filterPosObj={},this.selectedHeaders={selectedHeader:[],values:[]},this.rowGrandTotal=null,this.columnGrandTotal=null,this.removeRowGrandTotal=!1,this.removeColumnGrandTotal=!1,this.isValueHasAdvancedAggregate=!1,this.rawIndexObject={},this.reformAxisCount=0,this.isEditing=!1,this.valueAxisFields={},this.data=[],this.actualData=[],this.groupRawIndex={},this.fieldKeys={},this.allowDataCompression=!1,this.dataSourceSettings={},this.frameHeaderObjectsCollection=!1,this.headerObjectsCollection={},this.columnKeys={},this.fieldDrillCollection={},this.formatRegex=/^(?:[ncpae])(?:([0-9]|1[0-9]|20))?$/i,this.measureNames={},this.enablePaging=!1,this.enableVirtualization=!1,this.enableHtmlSanitizer=!1,this.enableOptimizedRendering=!1,this.groupedDataType={},this.emptyRowsLength=0,this.tabularPivotValues=[]}var k="load",_="enginePopulating",U="enginePopulated",q="onFieldDropped",H="fieldDrop",B="beforeExport",X="exportComplete",J="excelHeaderQueryCellInfo",Z="pdfHeaderQueryCellInfo",$="excelQueryCellInfo",ee="pdfQueryCellInfo",te="onPdfCellRender",ie="dataBound",ae="queryCellInfo",re="headerCellInfo",ne="hyperlinkCellClick",se="resizing",oe="resizeStop",le="cellClick",de="drillThrough",pe="beforeColumnsRender",he="selected",ue="cellSelecting",ce="drill",ge="cellSelected",me="cellDeselected",Se="rowSelected",fe="rowDeselected",ve="beginDrillThrough",ye="editCompleted",be="multiLevelLabelClick",xe="saveReport",we="fetchReport",Te="loadReport",Me="renameReport",De="removeReport",Oe="newReport",Pe="toolbarRender",Ne="toolbarClick",Ee="chartTooltipRender",Fe="chartLegendClick",Ie="chartLoaded",Le="multiLevelLabelRender",Ae="beforePrint",Re="animationComplete",ke="legendRender",je="textRender",qe="pointRender",Ve="seriesRender",He="chartMouseMove",_e="chartMouseClick",Be="pointMove",Ge="chartMouseLeave",ze="chartMouseDown",We="chartMouseUp",Qe="dragComplete",Ye="zoomComplete",Ke="scrollStart",Xe="scrollEnd",Je="scrollChanged",Ze="chartLoad",$e="chartResized",et="chartAxisLabelRender",tt="chartSeriesCreated",it="aggregateCellInfo",at="onHeadersSort",rt="contextMenuClick",nt="contextMenuOpen",st="fieldListRefreshed",ot="conditionalFormatting",lt="beforeExcelExport",dt="memberFiltering",pt="calculatedFieldCreate",ht="memberEditorOpen",ut="fieldRemove",ct="numberFormatting",gt="aggregateMenuOpen",mt="fieldDragStart",St="chartPointClick",ft="beforeServiceInvoke",vt="afterServiceInvoke",yt="actionBegin",bt="actionComplete",Ct="actionFailure",xt="initial-load",wt="ui-update",Tt="vertical-scroll",Mt="horizontal-scroll",Dt="content-ready",Ot="data-ready",Pt="init-groupingbar",Nt="tree-view-update",Et="pivot-button-update",Ft="init-calculatedfield",It="init-toolbar",Lt="init-pivotPager",At="init-formatting",Rt="init-grouping",kt="Sort value",jt="Drill up",qt="Drill down",Vt="Add new report",Ht="Save current report",_t="Save as current report",Ut="Rename current report",Bt="Remove current report",Gt="Load report",zt="Open conditional formatting dialog",Wt="Open number formatting dialog",Qt="MdxQuery",Yt="Open field list",Kt="Show table view",Xt="Show chart view",Jt="Multiple Axis",Zt="Show legend",$t="PDF export",ei="PNG export",ti="Excel export",ii="CSV export",ai="JPEG export",ri="SVG export",ni="Hide sub-totals",si="Show row sub-totals",oi="Show column sub-totals",li="Show sub-totals",di="Hide grand totals",pi="Show row grand totals",hi="Show column grand totals",ui="Show grand totals",ci="Number Formatting menu",gi="Conditional Formatting menu",mi="Report change",Si="Sort field tree",fi="Edit calculated field",vi="Sort field",yi="Filter field",bi="Remove field",Ci="Open calculated field dialog",xi="Edit record",wi="Save edited records",Ti="Add new record",Mi="Remove record",Di="Aggregate field",Oi="Window resize",Pi="Navigate row page",Ni="Navigate column page",Ei="Calculated field applied",Fi="Edited records saved",Ii="New record added",Li="Record removed",Ai="Field list closed",Ri="Field tree sorted",ki="Report saved",ji="New report added",qi="Report re-saved",Vi="Report renamed",Hi="Report removed",_i="Excel exported",Ui="CSV exported",Bi="PDF exported",Gi="PNG exported",zi="JPEG exported",Wi="SVG exported",Qi="Conditional formatting applied",Yi="Number formatting applied",Ki="Table view shown",Xi="Chart view shown",Ji="Sub-totals hidden",Zi="Row sub-totals shown",$i="Column sub-totals shown",ea="Sub-totals shown",ta="Grand totals hidden",ia="Row grand totals shown",aa="Column grand totals shown",ra="Grand totals shown",na="Value sorted",sa="Calculated field edited",oa="Field sorted",la="Field filtered",da="Field removed",pa="Field aggregated",ha="Record edited",ua="Report changed",ca="Window resized",ga="Records updated",ma="Drill-through closed",Sa="Vertically scrolled",fa="Horizontally scrolled",va="Row page navigated",ya="Column page navigated",ba="Action dropped",Ca="e-pivotfieldlist",xa="e-rtl",wa="e-device",z="e-icons",W="e-disable",Ta="e-hide",Ma="e-icon-first",Da="e-icon-last",Oa="e-icon-prev",Pa="e-icon-next",Na="e-dropdown-icon",Ea="e-pivotfieldlist-container",Fa="e-toggle-field-list",Ia="e-static",La="e-draggable",Aa="e-field-list",Ra="e-field-list-tree-outer-div",ka="e-field-list-tree-outer-div-searchMode",ja="e-search-mode",qa="e-pivot-parent",Va="e-pivot-child",Ha="e-field-list-footer",_a="e-left-axis-fields",Ua="e-right-axis-fields",Ba="e-all-fields-axis",Ga="e-hscroll",za="e-axis-content",Wa="e-draggable-prompt",Qa="e-pvt-btn-div",Q="e-pivot-button",Ya="e-content",Ka="e-pvt-btn-content",Xa="e-sort",Ja="e-member-sort",Za="e-descend",$a="e-btn-filter",er="e-pv-filter",tr="e-pv-filtered",ir="e-remove",ar="e-drag",rr="e-disable-drag",nr="e-drop-indicator",sr="e-drop-hover",or="e-member-editor-outer-container",lr="e-member-editor-container",dr="e-drillthrough-body-header",pr="e-drillthrough-body-header-common",hr="e-drillthrough-body-header-value",ur="e-frame",cr="e-check",gr="e-stop",mr="e-ok-btn",Sr="e-cancel-btn",fr="e-pivot-error-dialog",vr="e-droppable",yr="e-rows",br="e-columns",Cr="e-values",xr="e-filters",wr="e-grouping-bar",Tr="e-group-all-fields",Mr="e-group-rows",Dr="e-group-columns",Or="e-group-values",Pr="e-group-filters",Nr="e-drag-restrict",Er="e-list-selected",Fr="e-title-header",Ir="e-text-content",Lr="e-field-list-btn",Ar="e-calculated-field-btn",Rr="e-small",kr="e-round",jr="e-add-icon",qr="e-list-text",Vr="e-selected-node",Hr="e-selected-option-icon",_r="e-selected-level-icon",Ur="e-between-text-div",Br="e-filter-input-div-2",Gr="e-value-options",zr="e-filter-operator",Wr="e-filter-sort",Qr="e-sort-ascend-icon",Yr="e-sort-descend-icon",Kr="e-active",Xr="e-collapse",Jr="e-expand",c="e-table",Zr="e-columnsheader",$r="e-rowsheader",en="e-headercell",tn="e-cellvalue",an="e-tooltipheader",rn="e-tooltipcontent",nn="e-nextspan",sn="e-lastspan",on="e-editor-search-container",ln="e-editor-search",dn="e-select-all",pn="e-pivot-calc-check",hn="e-pivot-calc-input",un="e-custom-format-input",cn="e-olap-calc-hierarchy-list-div",gn="e-pivot-calc-format-type-div",mn="e-olap-calc-member-type-div",Sn="e-member-options",fn="e-format",vn="e-pivot-formula",yn="e-pivot-treeview",bn="e-pivot-treeview-outer",Cn="e-treeContainer",xn="e-pivot-ok-button",wn="e-pivot-button-div",Tn="e-axis",Mn="e-axis-filter",Dn="e-grid",On="e-pivotview",Pn="e-pivot-all-field-title",b="e-disabled",Nn="e-menu-hide",En="e-member-prompt",Fn="e-edit",In="e-edited",Ln="e-empty-field",An="e-format-condition-button",Rn="e-format-table",kn="e-input",jn="e-visible-hide",qn="e-format-color-picker",Vn="e-dlg-header",Hn="e-virtualtrack",_n="e-movablescrolldiv",Un="e-content-virtualtable",Bn="e-movablescroll",Gn="e-headercontent",zn="e-cellselectionbackground",Wn="e-selectionbackground",Qn="e-checkbox-wrapper",Yn="e-headercontent",Kn="e-field-list-back-icon",Xn="e-rowcell",Jn="e-active",Zn="e-spanclicked",$n="e-rowselect",es="e-gridheader",ts="e-gridcontent",is="e-pivotview-pdf-export",as="e-pivotview-excel-export",rs="e-pivotview-csv-export",ns="e-remove-report",ss="e-pivot-toolbar",os="e-pivotview-report-input",ls="e-toolbar-grid",ds="e-toolbar-chart",ps="e-pivotchart",hs="e-group-chart-rows",us="e-group-chart-columns",cs="e-group-chart-values",gs="e-group-chart-values-drodown-div",ms="e-group-chart-columns-dropdown-div",Ss="e-chart-grouping-bar",r="e-pivotview-disable-icon",s="e-pivotview-select-icon",fs="e-pivot-grouping-bar",vs="e-mdx-query-content",ys="e-pivotchart-inner",bs="e-group-pivot-rows",Cs="e-pivot-toolbar-menu",xs="e-pivot-pager",ws="e-pagercontainer",Ts="e-page-size-disable",Ms="e-node-limit",Ds="e-leftfreeze",Os="e-pivot-content-loader",Ps="e-hide-loader",Ns="e-icon-collapsible",Es="e-icon-expandable",Fs="e-pivotview-autofit",Is="e-group-row",Ls="e-freezeleftborder",As=(Rs.prototype.render=function(e,t){this.parentElement=t,this.openContextMenu(e)},Rs.prototype.openContextMenu=function(t){var i=this,e=t.target.parentElement.getAttribute("data-uid"),a=Ce.getFieldInfo(e,this.parent),r=(this.buttonElement=t.target.parentElement,"number"!==this.parent.engineModule.fieldList[e].type?1:0),n=this.getMenuItem(r).slice();if(this.parent.actionObj.actionName=Di,this.parent.actionObj.fieldInfo=a.fieldItem,!this.parent.actionBeginMethod()){a={cancel:!1,fieldName:e,aggregateTypes:n,displayMenuCount:7},e="pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent;try{e.trigger(gt,a,function(e){e.cancel||(n=e.aggregateTypes,i.createContextMenu(r,n,e.displayMenuCount),i.currentMenu=t.target,e=i.currentMenu.getBoundingClientRect(),i.parent.enableRtl?i.menuInfo[r].open(e.top+(window.scrollY||document.documentElement.scrollTop),e.left-105):i.menuInfo[r].open(e.top+(window.scrollY||document.documentElement.scrollTop),e.left))})}catch(e){this.parent.actionFailureMethod(e)}}},Rs.prototype.createContextMenu=function(e,t,i){for(var a=this,r=[],n=(r[e]=[],this.menuInfo[e]&&!this.menuInfo[e].isDestroyed&&this.menuInfo[e].destroy(),[]),s=0;s<t.length;s++){var o=t[s];e?-1<this.stringAggregateTypes.indexOf(o)&&n.indexOf(o)<0&&(r[e].push({text:this.parent.localeObj.getConstant(o),id:this.parent.element.id+"StringMenu_"+o}),n.push(o)):-1<this.parent.getAllSummaryType().indexOf(o)&&n.indexOf(o)<0&&(r[e].push({text:this.parent.localeObj.getConstant(o),id:this.parent.element.id+"_"+o}),n.push(o))}r[e].length>i&&(r[e].splice(i),r[e].push({text:this.parent.localeObj.getConstant("MoreOption"),id:this.parent.element.id+"_MoreOption"}));var i={items:r[e],enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:this.parent.cssClass,beforeOpen:this.beforeMenuOpen.bind(this,e),onClose:function(){Ue.select("#"+a.buttonElement.id,a.parentElement).focus()},select:this.selectOptionInContextMenu.bind(this)},l=document.getElementById(this.parent.element.id+(e?"valueFieldStringContextMenu":"valueFieldContextMenu"));null!==l?l.innerHTML="":l=Ue.createElement("ul",{id:this.parent.element.id+(e?"valueFieldStringContextMenu":"valueFieldContextMenu")}),this.parent.element.appendChild(l),this.menuInfo[e]=new O.ContextMenu(i),this.menuInfo[e].isStringTemplate=!0,this.menuInfo[e].appendTo(l)},Rs.prototype.getMenuItem=function(e){for(var t=[],i=0;i<this.parent.aggregateTypes.length;i++){var a=this.parent.aggregateTypes[i];e?-1<this.stringAggregateTypes.indexOf(a)&&-1===t.indexOf(a)&&t.push(a):-1<this.parent.getAllSummaryType().indexOf(a)&&-1===t.indexOf(a)&&t.push(a)}return t},Rs.prototype.beforeMenuOpen=function(e,t){t.element.style.zIndex=(this.menuInfo[e].element.style.zIndex+3).toString(),t.element.style.display="inline"},Rs.prototype.createValueSettingsDialog=function(e,t,i){this.parentElement=t;var t=Ue.createElement("div",{id:this.parentElement.id+"_ValueDialog",className:"e-value-field-settings",attrs:{"data-field":e.getAttribute("data-uid")?e.getAttribute("data-uid"):e.getAttribute("data-field")}}),a=(this.parentElement.appendChild(t),new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("valueFieldSettings"),content:this.createFieldOptions(e,i),isModal:!0,visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"320px",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:this.updateValueSettings.bind(this),isFlat:!1,buttonModel:{cssClass:mr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){a.hide()},isFlat:!1,buttonModel:{cssClass:Sr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:"pivotfieldlist"!==this.parent.getModuleName()||"Popup"!==this.parent.renderMode,target:this.parentElement,close:this.removeDialog.bind(this),cssClass:this.parent.cssClass}));a.isStringTemplate=!0,a.appendTo(t)},Rs.prototype.createFieldOptions=function(e,t){for(var a=this,i=e.getAttribute("data-caption"),t=t&&"MoreOption"!==t?t:e.getAttribute("data-type"),r=e.getAttribute("data-basefield"),n=e.getAttribute("data-baseitem"),t="undefined"!==t.toString()?t:"Sum",s=[],o=this.parent.aggregateTypes,l=[],d=0;d<o.length;d++)-1<this.parent.getAllSummaryType().indexOf(o[d])&&l.indexOf(o[d])<0&&(s.push({value:o[d],text:this.parent.localeObj.getConstant(o[d])}),l.push(o[d]));for(var p,h,u=["DifferenceFrom","PercentageOfDifferenceFrom"],c=["DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"],g=(g=Ue.extend([],this.parent.dataSourceSettings.rows,null,!0)).concat(this.parent.dataSourceSettings.columns),m=[],S=[],f=0,v=g;f<v.length;f++){var y=v[f],k=y.name,y=y.caption||y.name;m.push({value:k,text:y})}S=0===Object.keys(m).length?(m.push({value:"",text:""}),r="",[]):(p="undefined"!==(r=r&&"undefined"!==r.toString()&&"null"!==r.toString()?r:m[0].value).toString()?r:m[0].value,h=Ce.isDateField(p,this.parent.engineModule),this.parent.engineModule.fieldList[p].dateMember.map(function(e){return(h?e:a.parent.engineModule.getFormattedValue(e.actualText,p)).formattedText}));var n="undefined"!==n.toString()?n:S[0],g=Ue.createElement("div",{className:"e-value-field-div-content",id:this.parentElement.id+"_field_div_content",attrs:{"data-type":t,"data-caption":i,"data-basefield":r,"data-baseitem":n}}),b=Ue.createElement("div",{className:"e-field-name-text-container"}),C=Ue.createElement("div",{className:"e-field-option-container"}),x=Ue.createElement("div",{className:"e-type-option-container"}),w=Ue.createElement("div",{className:"e-base-field-option-container"}),T=Ue.createElement("div",{className:"e-base-item-option-container"}),M=Ue.createElement("div",{className:"e-field-name-title"}),D=(M.innerText=this.parent.localeObj.getConstant("sourceName")+" ",Ue.createElement("div",{className:"e-field-name-content"})),e=(D.innerText=this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(e.getAttribute("data-uid")?e.getAttribute("data-uid"):e.getAttribute("data-field")):e.getAttribute("data-uid")?e.getAttribute("data-uid"):e.getAttribute("data-field"),this.buttonElement=this.buttonElement||document.getElementsByClassName(D.innerText)[0],Ue.createElement("div",{className:"e-type-option-text"})),O=(e.innerText=this.parent.localeObj.getConstant("sourceCaption"),Ue.createElement("div",{className:"e-base-field-option-text"})),P=(O.innerText=this.parent.localeObj.getConstant("summarizeValuesBy"),Ue.createElement("div",{className:"e-base-item-option-text"})),N=(P.innerText=this.parent.localeObj.getConstant("baseField"),Ue.createElement("div",{className:"e-type-option-text"})),E=(N.innerText=this.parent.localeObj.getConstant("baseItem"),Ue.createElement("div",{className:"e-caption-input-container"})),F=Ue.createElement("div",{id:this.parentElement.id+"_type_option"}),I=Ue.createElement("div",{id:this.parentElement.id+"_base_field_option"}),L=Ue.createElement("div",{id:this.parentElement.id+"_base_item_option"}),j=Ue.createElement("input",{id:this.parentElement.id+"type_input_option",className:"e-caption-input-text",attrs:{type:"text"}}),q=(b.appendChild(M),b.appendChild(D),E.appendChild(e),E.appendChild(j),x.appendChild(O),w.appendChild(P),T.appendChild(N),x.appendChild(F),w.appendChild(I),T.appendChild(L),C.appendChild(b),C.appendChild(E),C.appendChild(x),C.appendChild(w),C.appendChild(T),g.appendChild(C),this),M=new G.DropDownList({dataSource:s,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:t,cssClass:Gr+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){A.enabled=-1!==c.indexOf(e.value),R.enabled=-1!==u.indexOf(e.value),R.enabled&&1===R.dataSource.length&&(R.dataSource=S,R.dataBind())}}),A=(M.isStringTemplate=!0,M.appendTo(F),new G.DropDownList({dataSource:m,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:r,enabled:-1!==c.indexOf(t),cssClass:Gr+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(t){var i=Ce.isDateField(t.value,a.parent.engineModule);S=q.parent.engineModule.fieldList[t.value].dateMember.map(function(e){return(i?e:a.parent.engineModule.getFormattedValue(e.actualText,t.value)).formattedText}),R.dataSource=S,R.value=S[0],R.filterBarPlaceholder=q.parent.localeObj.getConstant("example")+" "+S[0],R.itemData=null,R.dataBind()}})),R=(A.isStringTemplate=!0,A.appendTo(I),new G.DropDownList({dataSource:S,enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:n,allowFiltering:!0,filterBarPlaceholder:this.parent.localeObj.getConstant("example")+" "+S[0],enabled:-1!==u.indexOf(t),cssClass:zr+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%"})),D=(R.isStringTemplate=!0,R.appendTo(L),new V.MaskedTextBox({placeholder:"Enter field caption",enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:i,width:"100%",cssClass:this.parent.cssClass}));return D.isStringTemplate=!0,D.appendTo(j),g},Rs.prototype.selectOptionInContextMenu=function(e){if(null!==e.item.text){var t=this.currentMenu.parentElement,i=Ce.getFieldInfo(t?t.getAttribute("data-uid"):"",this.parent);if(this.parent.actionObj.actionName=Di,this.parent.actionObj.fieldInfo=i.fieldItem,!this.parent.actionBeginMethod()){var a=e.item.id.split("_").pop();try{if("MoreOption"===a||"PercentageOfDifferenceFrom"===a||"PercentageOfParentTotal"===a||"DifferenceFrom"===a)this.createValueSettingsDialog(t,this.parentElement,a);else{var r=t.getAttribute("data-uid"),n=this.parent.dataSourceSettings.values,s=t.querySelector("."+Ka),o=e.item.text+" "+this.parent.localeObj.getConstant("of")+" "+this.parent.engineModule.fieldList[r].caption,o=this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(o):o;this.parent.dataSourceSettings.showAggregationOnValueField&&(s.innerText=o),s.setAttribute("title",o),t.setAttribute("data-type",a);for(var l,d=0;d<this.parent.dataSourceSettings.values.length;d++)this.parent.dataSourceSettings.values[d].name===r&&((l=Ue.extend({},n[d].properties||n[d],null,!0)).type=a,this.parent.engineModule.fieldList[r].aggregateType=a,n.splice(d,1,l),this.parent.lastAggregationInfo=l);this.updateDataSource()}}catch(e){this.parent.actionFailureMethod(e)}}}},Rs.prototype.updateDataSource=function(e){!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotview"===this.parent.getModuleName()?this.parent.updateDataSource(e):"pivotfieldlist"===this.parent.getModuleName()&&"Popup"===this.parent.renderMode?(this.parent.pivotGridModule.setProperties({dataSourceSettings:this.parent.dataSourceSettings.properties},!0),this.parent.pivotGridModule.notify(wt,this),this.parent.pivotGridModule.engineModule=this.parent.engineModule):this.parent.triggerPopulateEvent()},Rs.prototype.updateValueSettings=function(){var e,t,i=Ue.getInstance(Ue.select("#"+this.parentElement.id+"_ValueDialog",document),P.Dialog),a=i.element,r=Ue.getInstance(Ue.select("#"+this.parentElement.id+"type_input_option"),V.MaskedTextBox),n=Ue.getInstance(Ue.select("#"+this.parentElement.id+"_type_option"),G.DropDownList),s=Ue.getInstance(Ue.select("#"+this.parentElement.id+"_base_field_option"),G.DropDownList),o=Ue.getInstance(Ue.select("#"+this.parentElement.id+"_base_item_option"),G.DropDownList),a=a.getAttribute("data-field"),l=((e=this.parentElement.querySelector("."+Q)?this.parentElement.getElementsByClassName(Q+" "+a.replace(/[^A-Z0-9]/gi,""))[0]:e)&&(l=e.querySelector("."+Ka),t=this.parent.dataSourceSettings.showAggregationOnValueField?this.parent.localeObj.getConstant(n.value)+" "+this.parent.localeObj.getConstant("of")+" "+r.value:r.value,t=this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(t):t,l.innerText=t,l.setAttribute("title",t),e.setAttribute("data-type",n.value),e.setAttribute("data-caption",r.value),e.setAttribute("data-basefield",s.value),e.setAttribute("data-baseitem",o.value)),Ce.getFieldByName(a,this.parent.dataSourceSettings.values));(l=l.properties||l).caption=r.value,l.type=n.value,l.baseField=s.value,l.baseItem=o.value,i.close(),this.parent.lastAggregationInfo=l,this.updateDataSource(!0)},Rs.prototype.removeDialog=function(){this.buttonElement&&Ue.select("#"+this.buttonElement.id,this.parentElement)&&Ue.select("#"+this.buttonElement.id,this.parentElement).focus();var e=Ue.select("#"+this.parentElement.id+"_ValueDialog",document),e=e?Ue.getInstance(e,P.Dialog):null;e&&!e.isDestroyed&&e.destroy(),document.getElementById(this.parentElement.id+"_ValueDialog")&&Ue.remove(document.getElementById(this.parentElement.id+"_ValueDialog"))},Rs.prototype.destroy=function(){this.parent.isDestroyed||this.menuInfo&&(void 0===this.menuInfo[1]||this.menuInfo[1].isDestroyed||this.menuInfo[1].destroy(),void 0===this.menuInfo[0]||this.menuInfo[0].isDestroyed||this.menuInfo[0].destroy())},Rs);function Rs(e){this.menuInfo=[],this.stringAggregateTypes=["Count","DistinctCount"],this.parent=e}i.prototype.render=function(e){e&&this.initProperties(),this.resColWidth=this.parent.isTabular?this.gridSettings.columnWidth:this.parent.showGroupingBar&&this.parent.groupingBarModule?this.parent.isAdaptive?180:250:this.parent.isAdaptive?140:200,this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.gridSettings=this.parent.gridSettings,this.formatList=this.getFormatList(),this.parent.gridCellCollection={},this.injectGridModules(this.parent),this.rowStartPos=this.getRowStartPos(),this.parent.grid&&this.parent.grid.element&&this.parent.element.querySelector("."+Dn)?(this.parent.notEmpty=!0,this.engine.isEngineUpdated?"olap"!==this.parent.dataType&&(this.parent.isTabular&&(this.engine.headerContent=this.frameDataSource("header")),this.parent.enableValueSorting||this.parent.isTabular)&&(this.engine.valueContent=this.frameDataSource("value")):(this.engine.headerContent=this.frameDataSource("header"),this.engine.valueContent=this.frameDataSource("value")),this.engine.isEngineUpdated=!1,e=this.parent.isTabular?this.parent.engineModule.rowMaxLevel+1:1,this.parent.grid.setProperties({frozenColumns:e,columns:this.frameStackedHeaders(),dataSource:("olap"===this.parent.dataType&&""!==this.parent.dataSourceSettings.url||this.parent.dataSourceSettings.dataSource&&0<this.parent.engineModule.data.length&&0<this.parent.dataSourceSettings.values.length)&&!this.engine.isEmptyData?this.frameGridDataSource(this.engine.valueContent):this.frameDataSource("value")},!0),this.parent.grid.notify("datasource-modified",{}),this.parent.isScrolling&&(this.parent.resizeInfo={}),this.parent.grid.refreshColumns(),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+wr)&&this.parent.groupingBarModule.setGridRowWidth(),this.isAutoFitEnabled?this.addPivotAutoFitClass():this.removePivotAutoFitClass(),this.parent.element.querySelector("."+Dn).querySelector("colGroup").innerHTML=this.parent.grid.getHeaderContent().querySelector("colgroup").innerHTML,this.parent.grid.width=this.calculateGridWidth(),!this.gridSettings.allowAutoResizing&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+wr)&&this.parent.groupingBarModule.refreshUI(),this.parent.isScrolling||this.calculateGridHeight(!0)):(this.parent.element.innerHTML="",this.bindGrid(this.parent,!!this.engine.isEmptyData),e=Ue.createElement("div",{id:this.parent.element.id+"_grid"}),this.parent.element.appendChild(e),this.parent.grid.isStringTemplate=!0,this.parent.grid.appendTo(e)),this.parent.grid.on(w.headerRefreshed,this.refreshHeader,this)},i.prototype.initProperties=function(){this.rowStartPos=void 0,this.maxIndent=void 0,this.resColWidth=void 0,this.isOverflows=void 0,this.indentCollection={},this.formatList=void 0,this.colPos=0,this.colGrandPos=void 0,this.rowGrandPos=void 0,this.lastSpan=0,this.field=void 0,this.fieldCaption=void 0,this.lvlCollection={},this.hierarchyCollection={},this.lvlPosCollection={},this.hierarchyPosCollection={},this.position=0,this.measurePos=0,this.maxMeasurePos=0,this.hierarchyCount=0,this.actualText="",this.timeOutObj=void 0},i.prototype.refreshHeader=function(){var e,t,i,a=this.parent.element.querySelector("."+Un);this.parent.enableVirtualization&&!Ue.isNullOrUndefined(a)&&(e=Ue.closest(a,"."+ts).querySelector("."+_n),t=this.parent.element.querySelector("."+Gn),i=a.querySelector("."+Hn),this.parent.virtualHeaderDiv=t.querySelector("."+Hn),t.querySelector("."+Hn)?Ue.remove(t.querySelector("."+Hn)):this.parent.virtualHeaderDiv=Ue.createElement("div",{className:Hn}),t.appendChild(this.parent.virtualHeaderDiv),i&&Ue.setStyleAttribute(this.parent.virtualHeaderDiv,{height:0,width:i.style.width}),t.querySelector("."+c)&&(Ue.setStyleAttribute(t.querySelector("."+c),{transform:a.querySelector("."+c).style.transform.split(",")[0]+",0px)"}),i=parseInt(t.querySelector("."+c).style.transform.split("(")[1].split(",")[0].split("px")[0],10),this.parent.enableRtl?this.parent.element.querySelector("."+Ds).style.right=Number(i)+"px":this.parent.element.querySelector("."+Ds).style.left=Number(-i)+"px"),i=this.parent.isAdaptive?a:e&&"none"!==e.style.display?e:a.parentElement,t.scrollLeft=i.scrollLeft)},i.prototype.bindGrid=function(e,t){this.injectGridModules(e),this.parent.grid=new w.Grid({cssClass:this.parent.cssClass,frozenColumns:1,frozenRows:0,enableHover:!1,dataSource:t?this.frameEmptyData():this.frameDataSource("value"),columns:t?this.frameEmptyColumns():this.frameStackedHeaders(),height:t?"auto":this.calculateGridHeight(),width:t?this.gridSettings.allowAutoResizing?this.parent.width:400:this.calculateGridWidth(),locale:e.locale,enableRtl:e.enableRtl,allowExcelExport:e.allowExcelExport,allowPdfExport:e.allowPdfExport,allowResizing:this.gridSettings.allowResizing,allowTextWrap:this.gridSettings.allowTextWrap,clipMode:this.gridSettings.clipMode,allowReordering:this.gridSettings.allowReordering,allowSelection:this.gridSettings.allowSelection,contextMenuItems:this.gridSettings.contextMenuItems,selectedRowIndex:this.gridSettings.selectedRowIndex,selectionSettings:this.gridSettings.selectionSettings,textWrapSettings:this.gridSettings.textWrapSettings,printMode:this.gridSettings.printMode,rowHeight:this.gridSettings.rowHeight,gridLines:this.gridSettings.gridLines,contextMenuClick:this.contextMenuClick.bind(this),contextMenuOpen:this.contextMenuOpen.bind(this),beforeCopy:this.gridSettings.beforeCopy?this.gridSettings.beforeCopy.bind(this.parent):void 0,beforePrint:this.gridSettings.beforePrint?this.gridSettings.beforePrint.bind(this.parent):void 0,printComplete:this.gridSettings.printComplete?this.gridSettings.printComplete.bind(this.parent):void 0,rowSelecting:this.gridSettings.rowSelecting?this.gridSettings.rowSelecting.bind(this.parent):void 0,rowSelected:this.rowSelected.bind(this),rowDeselecting:this.gridSettings.rowDeselecting?this.gridSettings.rowDeselecting.bind(this.parent):void 0,rowDeselected:this.rowDeselected.bind(this),cellSelecting:this.gridSettings.cellSelecting?this.gridSettings.cellSelecting.bind(this.parent):void 0,cellSelected:this.cellSelected.bind(this),cellDeselecting:this.gridSettings.cellDeselecting?this.gridSettings.cellDeselecting.bind(this.parent):void 0,cellDeselected:this.cellDeselected.bind(this),resizeStart:this.gridSettings.resizeStart?this.gridSettings.resizeStart.bind(this.parent):void 0,columnDragStart:this.gridSettings.columnDragStart?this.gridSettings.columnDragStart.bind(this):void 0,columnDrag:this.gridSettings.columnDrag?this.gridSettings.columnDrag.bind(this):void 0,columnDrop:this.gridSettings.columnDrop?this.gridSettings.columnDrop.bind(this):void 0,beforeExcelExport:this.beforeExcelExport.bind(this),resizing:this.setGroupWidth.bind(this),resizeStop:this.onResizeStop.bind(this),queryCellInfo:this.queryCellInfo.bind(this),dataBound:this.dataBound.bind(this),headerCellInfo:this.headerCellInfo.bind(this),excelHeaderQueryCellInfo:this.excelHeaderQueryCellInfo.bind(this),pdfHeaderQueryCellInfo:this.pdfHeaderQueryCellInfo.bind(this),excelQueryCellInfo:this.excelQueryCellInfo.bind(this),pdfQueryCellInfo:this.pdfQueryCellInfo.bind(this),beforePdfExport:this.gridSettings.beforePdfExport?this.gridSettings.beforePdfExport.bind(this):void 0,pdfExportComplete:this.pdfExportComplete.bind(this),excelExportComplete:this.excelExportComplete.bind(this),actionComplete:this.actionComplete.bind(this)}),this.parent.grid.on("header-refreshed",this.headerRefreshed.bind(this)),this.parent.grid.on("export-DataBound",this.excelDataBound.bind(this))},i.prototype.actionComplete=function(e){e&&"refresh"===e.requestType&&this.isAutoFitEnabled&&this.removePivotAutoFitClass()},i.prototype.addPivotAutoFitClass=function(){document.body.classList.contains(On)||document.body.classList.add(On),document.body.classList.contains(Fs)||document.body.classList.add(Fs)},i.prototype.removePivotAutoFitClass=function(){document.body.classList.contains(On)&&document.body.classList.remove(On),document.body.classList.contains(Fs)&&document.body.classList.remove(Fs)},i.prototype.headerRefreshed=function(){var e=this.parent.element.querySelector("."+Gn);this.parent.lastGridSettings&&-1<Object.keys(this.parent.lastGridSettings).indexOf("allowResizing")&&!Ue.isNullOrUndefined(e)&&e.querySelector("."+c)&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+wr)&&(this.parent.lastGridSettings=void 0,this.parent.groupingBarModule.setGridRowWidth())},i.prototype.beforeExcelExport=function(e){Ue.isNullOrUndefined(e.gridObject.columns)||Ue.isNullOrUndefined(this.parent.pivotColumns)||(e.gridObject.columns[e.gridObject.columns.length-1].width=this.parent.pivotColumns[this.parent.pivotColumns.length-1].width),this.parent.trigger(lt,e)},i.prototype.rowSelected=function(e){this.parent.renderModule.selected(),this.parent.trigger(Se,e)},i.prototype.rowDeselected=function(e){this.parent.renderModule.selected(),this.parent.trigger(fe,e)},i.prototype.cellSelected=function(e){this.parent.rowRangeSelection.enable?(this.parent.grid.selectionModule.selectRowsByRange(this.parent.rowRangeSelection.startIndex,this.parent.rowRangeSelection.endIndex),this.parent.rowRangeSelection.enable=!1):(this.parent.renderModule.selected(),this.parent.trigger(he,e))},i.prototype.cellSelecting=function(e){this.parent.trigger(ue,e)},i.prototype.cellDeselected=function(e){this.parent.renderModule.selected(),this.parent.trigger(me,e)},i.prototype.queryCellInfo=function(e){this.parent.renderModule.rowCellBoundEvent(e)},i.prototype.headerCellInfo=function(e){this.parent.renderModule.columnCellBoundEvent(e)},i.prototype.excelHeaderQueryCellInfo=function(e){this.parent.renderModule.excelColumnEvent(e)},i.prototype.pdfQueryCellInfo=function(e){this.parent.renderModule.pdfRowEvent(e)},i.prototype.excelQueryCellInfo=function(e){this.parent.renderModule.excelRowEvent(e)},i.prototype.pdfHeaderQueryCellInfo=function(e){this.parent.renderModule.pdfColumnEvent(e)},i.prototype.pdfExportComplete=function(e){void 0!==this.parent.lastColumn&&"auto"!==this.parent.lastColumn.width&&(this.parent.lastColumn.width="auto",this.parent.lastColumn=void 0);e={type:"PDF",promise:e.promise};this.parent.trigger(X,e)},i.prototype.excelExportComplete=function(e){void 0!==this.parent.lastColumn&&"auto"!==this.parent.lastColumn.width&&(this.parent.lastColumn.width="auto",this.parent.lastColumn=void 0);e={type:"Excel/CSV",promise:e.promise};this.parent.trigger(X,e)},i.prototype.dataBound=function(){this.parent.notEmpty&&this.calculateGridHeight(!0),this.parent.isScrolling=!1,this.setFocusOnLastCell(),Ue.isNullOrUndefined(this.parent.renderReactTemplates)||this.parent.renderReactTemplates(),this.parent.isInitial&&(this.parent.isInitial=!1,this.parent.refreshData(),this.parent.enableVirtualization)&&this.parent.onContentReady(),this.parent.notify(Dt,{})},i.prototype.setFocusOnLastCell=function(){var e;this.parent.keyboardModule&&this.parent.keyboardModule.event&&"TD"===this.parent.keyboardModule.event.target.nodeName&&((e=this.parent.grid.serviceLocator.getService("focus")).setFocusedElement(this.parent.keyboardModule.event.target),e.focus(this.parent.keyboardModule.event),Ue.addClass([this.parent.keyboardModule.event.target],["e-focused","e-focus"]),this.parent.keyboardModule.event.target.setAttribute("tabindex","0"),this.parent.keyboardModule.event=void 0)},i.prototype.getCellElement=function(e){var t=Ue.closest(e,"td");return t=Ue.isNullOrUndefined(t)?Ue.closest(e,"th"):t},i.prototype.contextMenuOpen=function(f){for(var v=this,y=(f.element&&this.parent.cssClass&&Ue.addClass([f.element.parentElement],this.parent.cssClass),this),e=0,t=f.items;e<t.length;e++){var i=function(n){var e=y.parent.lastCellClicked||(y.parent.isAdaptive?f.event.target:y.parent.lastCellClicked),s=y.getCellElement(e),t=void 0,i=void 0;if(!s||0===Number(s.getAttribute("index"))&&0===Number(s.getAttribute("data-colindex")))return f.cancel=!0,{value:void 0};(s.classList.contains("e-valuesheader")||s.classList.contains("e-stot"))&&(t=!0),y.parent.allowGrouping&&y.parent.groupingModule&&!y.validateField(s)&&(i=!0);var o,e=Number(s.getAttribute("index")),a=Number(s.getAttribute("data-colindex")),r=y.parent.pivotValues[e][a];switch(n.id){case y.parent.element.id+"_expand":0<s.querySelectorAll("."+Jr).length?(Ue.selectAll("#"+y.parent.element.id+"_expand",f.element)&&Ue.select("#"+y.parent.element.id+"_expand",f.element).classList.add(b),Ue.select("#"+y.parent.element.id+"_expand",f.element).classList.contains(b)&&Ue.select("#"+y.parent.element.id+"_expand",f.element).classList.remove(b),Ue.select("#"+y.parent.element.id+"_expand",f.element).classList.contains(Nn)&&(Ue.select("#"+y.parent.element.id+"_expand",f.element).classList.remove(Nn),Ue.select("#"+y.parent.element.id+"_collapse",f.element).classList.remove(Nn))):t?Ue.select("#"+y.parent.element.id+"_expand",f.element).classList.add(Nn):Ue.select("#"+y.parent.element.id+"_expand",f.element).classList.add(b);break;case y.parent.element.id+"_collapse":0<s.querySelectorAll("."+Xr).length?(Ue.select("#"+y.parent.element.id+"_expand",f.element)&&Ue.select("#"+y.parent.element.id+"_expand",f.element).classList.add(b),Ue.select("#"+y.parent.element.id+"_collapse",f.element).classList.contains(b)&&Ue.select("#"+y.parent.element.id+"_collapse",f.element).classList.remove(b),Ue.select("#"+y.parent.element.id+"_collapse",f.element).classList.contains(Nn)&&(Ue.select("#"+y.parent.element.id+"_collapse",f.element).classList.remove(Nn),Ue.select("#"+y.parent.element.id+"_expand",f.element).classList.remove(Nn))):t?Ue.select("#"+y.parent.element.id+"_collapse",f.element).classList.add(Nn):Ue.select("#"+y.parent.element.id+"_collapse",f.element).classList.add(b);break;case y.parent.element.id+"_custom_group":i||2!==f.items.length||(f.cancel=!0),Ue.selectAll("#"+y.parent.element.id+"_custom_group",f.element)&&Ue.addClass([Ue.select("#"+y.parent.element.id+"_custom_group",f.element)],Nn),i&&Ue.selectAll("#"+y.parent.element.id+"_custom_group",f.element)&&Ue.removeClass([Ue.select("#"+y.parent.element.id+"_custom_group",f.element)],Nn);break;case y.parent.element.id+"_custom_ungroup":if(Ue.selectAll("#"+y.parent.element.id+"_custom_ungroup",f.element)&&Ue.addClass([Ue.select("#"+y.parent.element.id+"_custom_ungroup",f.element)],Nn),i){var l=!1,d=s.getAttribute("fieldname"),p=Ce.getFieldByName(d,y.parent.dataSourceSettings.groupSettings);if(p&&"Custom"===p.type||y.parent.engineModule.fieldList[d].isCustomField&&-1<d.indexOf("_custom_group")){if(p=Ce.getFieldByName(d.replace("_custom_group",""),y.parent.dataSourceSettings.groupSettings))for(var h=y.parent.engineModule.pivotValues[Number(s.getAttribute("index"))][Number(s.getAttribute("data-colindex"))],u=y.parent.groupingModule.getSelectedCells(h.axis,d,h.actualText.toString()),c=(u.push({axis:h.axis,fieldName:d,name:h.actualText.toString(),cellInfo:h}),y.parent.groupingModule.getSelectedOptions(u)),g=0,m=p.customGroups;g<m.length;g++){var S=m[g];if(-1<c.indexOf(S.groupName)){l=!0;break}}}else(p&&("Date"===p.type||"Number"===p.type)||y.parent.engineModule.fieldList[d].isCustomField&&-1<d.indexOf("_date_group"))&&(l=!0);Ue.selectAll("#"+y.parent.element.id+"_custom_ungroup",f.element)&&l&&Ue.removeClass([Ue.select("#"+y.parent.element.id+"_custom_ungroup",f.element)],Nn)}break;case y.parent.element.id+"_drillthrough":y.parent.allowDrillThrough?s.classList.contains("e-summary")?Ue.select("#"+y.parent.element.id+"_drillthrough",f.element).classList.contains(b)&&Ue.select("#"+y.parent.element.id+"_drillthrough",f.element).classList.remove(b):""===s.innerText&&Ue.select("#"+y.parent.element.id+"_drillthrough",f.element)&&Ue.select("#"+y.parent.element.id+"_drillthrough",f.element).classList.add(b):Ue.select("#"+y.parent.element.id+"_drillthrough",f.element)&&Ue.select("#"+y.parent.element.id+"_drillthrough",f.element).classList.add(b);break;case y.parent.element.id+"_sortasc":y.parent.enableValueSorting?0<s.querySelectorAll(".e-icon-descending").length?(Ue.select("#"+y.parent.element.id+"_sortdesc",f.element)?Ue.select("#"+y.parent.element.id+"_sortdesc",f.element).classList.add(b):Ue.select("#"+y.parent.element.id+"_sortdesc",f.element).classList.remove(b),Ue.select("#"+y.parent.element.id+"_sortasc",f.element).classList.contains(b)&&Ue.select("#"+y.parent.element.id+"_sortasc",f.element).classList.remove(b)):Ue.select("#"+y.parent.element.id+"_sortdesc",f.element).classList.contains(b)&&Ue.select("#"+y.parent.element.id+"_sortdesc",f.element).classList.remove(b):Ue.select("#"+y.parent.element.id+"_sortasc",f.element)&&Ue.select("#"+y.parent.element.id+"_sortasc",f.element).classList.add(b);break;case y.parent.element.id+"_sortdesc":y.parent.enableValueSorting?0<s.querySelectorAll(".e-icon-ascending").length?(Ue.select("#"+y.parent.element.id+"_sortasc",f.element)?Ue.select("#"+y.parent.element.id+"_sortasc",f.element).classList.add(b):Ue.select("#"+y.parent.element.id+"_sortasc",f.element).classList.remove(b),Ue.select("#"+y.parent.element.id+"_sortdesc",f.element).classList.contains(b)&&Ue.select("#"+y.parent.element.id+"_sortdesc",f.element).classList.remove(b)):Ue.select("#"+y.parent.element.id+"_sortasc",f.element).classList.contains(b)&&Ue.select("#"+y.parent.element.id+"_sortasc",f.element).classList.remove(b):Ue.select("#"+y.parent.element.id+"_sortdesc",f.element)&&Ue.select("#"+y.parent.element.id+"_sortdesc",f.element).classList.add(b);break;case y.parent.element.id+"_CalculatedField":y.parent.allowCalculatedField||Ue.select("#"+y.parent.element.id+"_CalculatedField",f.element).classList.add(b);break;case y.parent.element.id+"_pdf":y.parent.allowPdfExport||Ue.select("#"+y.parent.element.id+"_pdf",f.element).classList.add(b);break;case y.parent.element.id+"_excel":y.parent.allowExcelExport||Ue.select("#"+y.parent.element.id+"_excel",f.element).classList.add(b);break;case y.parent.element.id+"_csv":y.parent.allowExcelExport||Ue.select("#"+y.parent.element.id+"_csv",f.element).classList.add(b);break;case y.parent.element.id+"_exporting":y.parent.allowExcelExport||y.parent.allowPdfExport||Ue.select("#"+y.parent.element.id+"_exporting",f.element).classList.add(b);break;case y.parent.element.id+"_aggregate":Ue.select("#"+y.parent.element.id+"_aggregate",f.element)&&!Ue.select("#"+y.parent.element.id+"_aggregate",f.element).classList.contains(b)&&Ue.select("#"+y.parent.element.id+"_aggregate",f.element).classList.add(b),(s.classList.contains("e-valuesheader")||s.classList.contains("e-valuescontent")||s.classList.contains("e-stot")&&s.classList.contains("e-rowsheader"))&&"olap"!==y.parent.dataType&&(""!==s.innerText&&(o=y.parent.engineModule.fieldList[r.actualText.toString()].type),h={cancel:!1,fieldName:r.actualText.toString(),aggregateTypes:y.getMenuItem(o).slice(),displayMenuCount:7},y.parent.trigger(gt,h,function(e){if(!e.cancel&&""!==s.innerText){for(var t=[],i=[],a=0;a<e.aggregateTypes.length;a++){var r=e.aggregateTypes[a];"number"!==o?-1<["Count","DistinctCount"].indexOf(r)&&i.indexOf(r)<0&&(t.push({text:v.parent.localeObj.getConstant(r),id:v.parent.element.id+"_Agg"+r}),i.push(r)):-1<v.parent.getAllSummaryType().indexOf(r)&&i.indexOf(r)<0&&(t.push({text:v.parent.localeObj.getConstant(r),id:v.parent.element.id+"_Agg"+r}),i.push(r))}t.length>e.displayMenuCount&&(t.splice(e.displayMenuCount),t.push({text:v.parent.localeObj.getConstant("MoreOption"),id:v.parent.element.id+"_AggMoreOption"})),t&&1<=t.length&&(n.items=t,Ue.select("#"+v.parent.element.id+"_aggregate",f.element).classList.remove(b))}}))}}(t[e]);if("object"==typeof i)return i.value}this.parent.trigger(nt,f)},i.prototype.getMenuItem=function(e){for(var t=[],i=0;i<this.parent.aggregateTypes.length;i++){var a=this.parent.aggregateTypes[i];"string"!==e?-1<this.parent.getAllSummaryType().indexOf(a)&&-1===t.indexOf(a)&&t.push(a):-1<["Count","DistinctCount"].indexOf(a)&&-1===t.indexOf(a)&&t.push(a)}return t},i.prototype.contextMenuClick=function(e){var t,i=this,a=this.parent.lastCellClicked,r=e.item.id,n=this.getCellElement(a),a=Number(n.getAttribute("index")),s=Number(n.getAttribute("data-colindex")),o=this.parent.pivotValues[a][s];switch(-1<e.item.id.indexOf(this.parent.element.id+"_Agg")&&(this.field=this.parent.engineModule.fieldList[o.actualText.toString()].id,this.fieldCaption=this.parent.engineModule.fieldList[o.actualText.toString()].caption,t=e.item.id.split("_Agg")[1]),r){case this.parent.element.id+"_pdf":this.parent.trigger(B,{pdfDoc:void 0,isBlob:!1,isMultipleExport:!1,pdfExportProperties:{fileName:"Export.pdf"}},function(e){i.parent.pdfExport(e.pdfExportProperties,e.isMultipleExport,e.pdfDoc,e.isBlob)});break;case this.parent.element.id+"_excel":this.parent.trigger(B,{isBlob:!1,isMultipleExport:!1,workbook:void 0,excelExportProperties:{fileName:"Export.xlsx"}},function(e){i.parent.excelExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"_csv":this.parent.trigger(B,{isBlob:!1,workbook:void 0,isMultipleExport:!1,excelExportProperties:{fileName:"Export.csv"}},function(e){i.parent.csvExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"_drillthrough_menu":var l=new MouseEvent("dblclick",{view:window,bubbles:!0,cancelable:!0});n.dispatchEvent(l);break;case this.parent.element.id+"_sortasc":this.parent.setProperties({dataSourceSettings:{valueSortSettings:{headerText:o.valueSort.levelName,headerDelimiter:this.parent.dataSourceSettings.valueSortSettings.headerDelimiter}}}),this.parent.dataSourceSettings.valueSortSettings.sortOrder="Ascending";break;case this.parent.element.id+"_sortdesc":this.parent.setProperties({dataSourceSettings:{valueSortSettings:{headerText:o.valueSort.levelName,headerDelimiter:this.parent.dataSourceSettings.valueSortSettings.headerDelimiter}}}),this.parent.dataSourceSettings.valueSortSettings.sortOrder="Descending";break;case this.parent.element.id+"_expand":n.querySelectorAll("."+Jr)&&(l=n.querySelectorAll("."+Jr)[0],this.parent.onDrill(l));break;case this.parent.element.id+"_collapse":n.querySelectorAll("."+Xr)&&(l=n.querySelectorAll("."+Xr)[0],this.parent.onDrill(l));break;case this.parent.element.id+"_CalculatedField":this.parent.calculatedFieldModule.createCalculatedFieldDialog();break;case this.parent.element.id+"_AggMoreOption":case this.parent.element.id+"_AggDifferenceFrom":case this.parent.element.id+"_AggPercentageOfDifferenceFrom":case this.parent.element.id+"_AggPercentageOfParentTotal":n.setAttribute("id",this.field),n.setAttribute("data-caption",this.fieldCaption),n.setAttribute("data-field",this.field),n.setAttribute("data-type",this.engine.fieldList[o.actualText.toString()].aggregateType),n.setAttribute("data-basefield",this.engine.fieldList[o.actualText.toString()].baseField),n.setAttribute("data-baseItem",this.engine.fieldList[o.actualText.toString()].baseItem),this.aggMenu.createValueSettingsDialog(n,this.parent.element,t);break;case this.parent.element.id+"_Agg"+t:this.updateAggregate(t);break;case this.parent.element.id+"_custom_group":case this.parent.element.id+"_custom_ungroup":this.parent.groupingModule&&(l={target:n,option:r,parentElement:this.parent.element},this.parent.notify(Rt,l),this.parent.grid.contextMenuModule.contextMenu.close())}this.parent.trigger(rt,e)},i.prototype.validateColumnTotalcell=function(e){for(var t=Object.keys(this.engine.headerContent),i=!1,a="",r=t.length-1;0<=r;r--){var n=this.engine.headerContent[Number(t[r])][e];if(!n)return!1;if(i=!(!i||""===a)&&a===n.valueSort.axis,a=n.valueSort.axis?n.valueSort.axis.toString():"",(i="sum"===n.type?!0:i)&&n.members&&0<n.members.length)return!0}return!1},i.prototype.validateField=function(e){var t=!1;if(e.classList.contains("e-stot")||e.classList.contains("e-gtot")||e.classList.contains("e-valuescontent")||e.classList.contains("e-valuesheader"))t=!0;else for(var i,a=e.getAttribute("fieldName"),r=(a&&""!==a||(i=Number(e.getAttribute("index")),e=Number(e.getAttribute("data-colindex")),a=this.engine.pivotValues[i][e].actualText),this.parent.dataSourceSettings.values),n=0;n<r.length;n++)if(this.parent.dataSourceSettings.values[n].name===a){t=!0;break}return t},i.prototype.updateAggregate=function(e){if(-1<this.parent.getAllSummaryType().indexOf(e))for(var t=this.parent.dataSourceSettings.values,i=0;i<this.parent.dataSourceSettings.values.length;i++)this.parent.dataSourceSettings.values[i].name===this.field&&(t[i].type=e)},i.prototype.injectGridModules=function(e){w.Grid.Inject(w.Freeze),e.allowExcelExport&&w.Grid.Inject(w.ExcelExport),e.allowPdfExport&&w.Grid.Inject(w.PdfExport),w.Grid.Inject(w.Selection,w.Reorder,w.Resize),this.gridSettings.contextMenuItems&&w.Grid.Inject(w.ContextMenu)},i.prototype.updateGridSettings=function(){var e;this.injectGridModules(this.parent),this.parent.grid.allowResizing=this.gridSettings.allowResizing,this.parent.grid.clipMode=this.gridSettings.clipMode,this.parent.grid.allowTextWrap=this.gridSettings.allowTextWrap,this.parent.grid.allowReordering=this.gridSettings.allowReordering,this.parent.grid.allowSelection=this.gridSettings.allowSelection,this.parent.grid.contextMenuItems=this.gridSettings.contextMenuItems,this.parent.grid.selectedRowIndex=this.gridSettings.selectedRowIndex,this.parent.grid.selectionSettings=this.gridSettings.selectionSettings,this.parent.grid.textWrapSettings=this.gridSettings.textWrapSettings,this.parent.grid.printMode=this.gridSettings.printMode,this.parent.grid.rowHeight=this.gridSettings.rowHeight,this.parent.grid.gridLines=this.gridSettings.gridLines,this.parent.lastGridSettings&&(-1<(e=Object.keys(this.parent.lastGridSettings)).indexOf("height")&&(this.parent.grid.height=this.gridSettings.height),-1<e.indexOf("width")&&(this.parent.grid.width=this.gridSettings.width),this.updatePivotColumns(),-1<e.indexOf("allowTextWrap")||-1<e.indexOf("clipMode"))&&this.parent.layoutRefresh(),this.clearColumnSelection()},i.prototype.updatePivotColumns=function(){for(var e=Object.keys(this.parent.lastGridSettings),t=0;t<this.parent.pivotColumns.length;t++)for(var i=this.parent.pivotColumns[t],a=0;a<e.length;a++){var r=e[a];Ue.isNullOrUndefined(this.parent.pivotColumns[t][r])||(i[r]=this.parent.lastGridSettings[r])}this.parent.fillGridColumns(this.parent.grid.columns)},i.prototype.clearColumnSelection=function(){Ue.removeClass(this.parent.element.querySelectorAll("."+Jn),[Jn,Wn])},i.prototype.appendValueSortIcon=function(e,t,i,a,r){var n,s,o="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,l=this.parent.dataSourceSettings.valueSortSettings;return this.parent.enableValueSorting&&l&&""!==l.headerText&&(n="grand sum"===e.type&&1===this.parent.dataSourceSettings.values.length&&!this.parent.dataSourceSettings.alwaysShowValueHeader||!(1<this.parent.dataSourceSettings.values.length||this.parent.dataSourceSettings.alwaysShowValueHeader)&&0===this.parent.dataSourceSettings.columns.length?0:o.headerContent.length-1,s=l&&l.headerText?e.valueSort.levelName===l.headerText:a===l.columnIndex,void 0!==l)&&s&&(i===n||i+1===n&&-1<e.level&&o.headerContent[i+1][a]&&-1===o.headerContent[i+1][a].level)&&"column"===this.parent.dataSourceSettings.valueAxis&&t.querySelector("div div").appendChild(Ue.createElement("span",{className:("Descending"===l.sortOrder?"e-icon-descending e-icons e-descending e-sortfilterdiv e-value-sort-icon":"e-icon-ascending e-icons e-ascending e-sortfilterdiv e-value-sort-icon")+(e.hasChild?" e-value-sort-align":""),styles:"Right"===r.headerTextAlign?"float : left":""})),t},i.prototype.onResizeStop=function(e){var t;e.column.columns&&0<e.column.columns.length?this.getChildColumnWidth(e.column.columns):(t="0.formattedText"===e.column.field?"0.formattedText":e.column.customAttributes.cell.valueSort.levelName,this.parent.resizeInfo[t]=Number(e.column.width.toString().split("px")[0])),this.parent.enableVirtualization&&"0.formattedText"===e.column.field&&(1<this.parent.dataSourceSettings.values.length&&!Ue.isNullOrUndefined(this.parent.grid.columns[this.parent.grid.columns.length-1].columns)?(t=this.parent.grid.columns[this.parent.grid.columns.length-1].columns)[t.length-1].minWidth=this.parent.gridSettings.columnWidth:this.parent.grid.columns[this.parent.grid.columns.length-1].minWidth=this.parent.gridSettings.columnWidth,this.parent.layoutRefresh()),this.setGroupWidth(e),this.calculateGridHeight(!0),this.parent.grid.hideScroll()},i.prototype.getChildColumnWidth=function(e){for(var t=0,i=e;t<i.length;t++){var a,r=i[t];r.columns&&0<r.columns.length?this.getChildColumnWidth(r.columns):(a=r.customAttributes.cell.valueSort.levelName,this.parent.resizeInfo[a]=Number(r.width.toString().split("px")[0]))}},i.prototype.setGroupWidth=function(e){var t;this.parent.enableVirtualization&&"0.formattedText"===e.column.field&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+wr)&&Number(e.column.width.toString().split("px")[0])<250&&(e.cancel=!0),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+wr)&&(this.parent.groupingBarModule.refreshUI(),this.parent.element.querySelector(".e-group-row").offsetWidth<245&&!this.parent.firstColWidth&&(e.cancel=!0,(t=this.parent.grid.columns)&&0<t.length&&(t[0].width=this.resColWidth),this.parent.element.querySelector("."+Yn).querySelector("col").style.width=this.resColWidth+"px",this.parent.element.querySelector("."+Ya).querySelector("col").style.width=this.resColWidth+"px"),this.parent.element.querySelector(".e-group-rows").style.height="auto",this.parent.element.querySelector(".e-group-values").style.width=this.parent.element.querySelector(".e-group-row").offsetWidth+"px",t=this.parent.element.querySelector("."+Yn).offsetHeight,this.parent.element.querySelector(".e-group-rows").style.height=t+"px"),e.cancel&&(t="0.formattedText"===e.column.field?"0.formattedText":e.column.customAttributes.cell.valueSort.levelName,this.parent.resizeInfo[t]=Number(e.column.width.toString().split("px")[0]),this.parent.enableVirtualization)&&this.parent.layoutRefresh(),this.parent.enableVirtualization&&(this.parent.resizedValue=e.cancel||"0.formattedText"!==e.column.field?this.parent.resizedValue:Number(e.column.width.toString().split("px")[0])),this.parent.trigger("touchend"===e.e.type||"mouseup"===e.e.type?oe:se,e)},i.prototype.selected=function(){clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.onSelect.bind(this),300)},i.prototype.onSelect=function(){for(var e={selectedCellsInfo:[],pivotValues:this.parent.pivotValues,currentCell:null},t=this.parent.element.querySelectorAll("."+zn+",."+Wn),i=0;i<t.length;i++){var a=t[i],r=Number(a.getAttribute("data-colindex")),a=Number(a.getAttribute("index")),a=this.engine.pivotValues[a][r];a&&("value"===a.axis?e.selectedCellsInfo.push({currentCell:a,value:a.value,columnHeaders:a.columnHeaders,rowHeaders:a.rowHeaders,measure:a.actualText.toString()}):"column"===a.axis?e.selectedCellsInfo.push({currentCell:a,value:a.formattedText,columnHeaders:a.valueSort.levelName,rowHeaders:"",measure:""}):e.selectedCellsInfo.push({currentCell:a,value:a.formattedText,columnHeaders:"",rowHeaders:a.valueSort.levelName,measure:""}))}this.parent.trigger(ge,e)},i.prototype.rowCellBoundEvent=function(e){var t=e.cell;if(t&&this.parent.notEmpty&&this.engine.headerContent){var i=this.parent.hyperlinkSettings.cssClass,a=this.parent.isTabular?t.getAttribute("data-colindex"):"0",a=e.data[Number(a)],r=a.valueSort&&a.valueSort.levelName===(0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis&&this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+a.formattedText),n=(t.setAttribute("index",a.rowIndex?a.rowIndex.toString():"0"),this.parent.pivotValues[a.rowIndex]&&this.parent.pivotValues[a.rowIndex][Number(t.getAttribute("data-colindex"))]?this.parent.pivotValues[a.rowIndex][Number(t.getAttribute("data-colindex"))]:null),s=this.parent.isTabular?this.parent.engineModule.rowMaxLevel:0;if(Number(t.getAttribute("data-colindex"))<=s){if("pivot"===this.parent.dataType){var s=a.type&&"value"===a.type,o=(t.innerText="",a.valueSort?a.valueSort.levelName.toString():""),l=a.actualText?a.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,l=o.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(l&&l-1),d=l?l-1:0;if("Bottom"!==this.parent.dataSourceSettings.subTotalsPosition||Ue.isNullOrUndefined(o)||(m=a.isSum?"value"===a.type?o.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+(this.parent.engineModule.valueAxisFields[a.actualText].caption||this.parent.engineModule.valueAxisFields[a.actualText].name))[0]:"":o,a.isSum&&("value"!==a.type||this.drilledLevelInfo[m])?d-=1:a.isSum||(1===m.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length&&(this.drilledLevelInfo={}),a.members&&0<a.members.length&&(this.drilledLevelInfo[m]=a.isDrilled))),!this.parent.isTabular){for(;0<d&&t.appendChild(Ue.createElement("span",{className:0===d?"":nn})),-1<--d;);d=l?l-1:0,this.lastSpan=l?this.lastSpan:0,!a.hasChild&&0<(s?0:d)&&t.appendChild(Ue.createElement("span",{className:sn}))}var p=void 0;if(0<this.parent.dataSourceSettings.rows.length&&(!a.valueSort||0<Object.keys(a.valueSort).length)){if(s)for(var h=0,u=this.parent.dataSourceSettings.values;h<u.length;h++){var c=u[h],g=c.caption||c.name;if(-1<o.indexOf(g)){p=c.name;break}}else p=-1<a.level&&this.parent.dataSourceSettings.rows[a.level]?this.parent.dataSourceSettings.rows[a.level].name:"";t.setAttribute("fieldname",p)}}else t=this.onOlapRowCellBoundEvent(t,a);var m=a.formattedText,s=(a.type&&("grand sum"===a.type?(this.rowGrandPos=a.rowIndex,t.classList.add("e-gtot"),l=this.parent.dataSourceSettings.values,m=Ue.isNullOrUndefined(a.valueSort.axis)?0===this.parent.dataSourceSettings.rows.length&&1===l.length&&"row"===this.parent.dataSourceSettings.valueAxis?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(l[l.length-1].type)+" "+this.parent.localeObj.getConstant("of")+" "+(Ue.isNullOrUndefined(l[l.length-1].caption)?l[l.length-1].name:l[l.length-1].caption):this.parent.localeObj.getConstant("grandTotal"):a.formattedText):a.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+a.formattedText?(t.classList.add("e-gtot"),m=r?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[a.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+a.formattedText:m):"sum"===a.type&&3!==a.memberType?m=a.formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total"):t.classList.add("e-stot")),this.parent.isTabular?(this.setSpanAttributes("rowspan",a.rowSpan,t),this.setSpanAttributes("colspan",a.colSpan,t)):t.classList.add($r),!0!==a.hasChild||a.isNamedSet||t.appendChild(Ue.createElement("div",{className:(!0===a.isDrilled?Xr:Jr)+" "+z,attrs:{title:!0===a.isDrilled?this.parent.localeObj.getConstant("collapse"):this.parent.localeObj.getConstant("expand")}})),t.appendChild(Ue.createElement("span",{className:tn,innerHTML:this.parent.isRowCellHyperlink||a.enableHyperlink?'<a data-url="'+m+'" class="e-hyperlinkcell '+i+'">'+m+"</a>":m})),this.parent.pivotView.dataSourceSettings.valueSortSettings);this.parent.enableValueSorting&&s&&s.headerText&&"row"===this.parent.dataSourceSettings.valueAxis&&this.parent.pivotValues[Number(t.getAttribute("index"))][0]&&this.parent.pivotValues[Number(t.getAttribute("index"))][0].valueSort.levelName&&this.parent.pivotValues[Number(t.getAttribute("index"))][0].valueSort.levelName===s.headerText&&t.appendChild(Ue.createElement("span",{className:("Descending"===s.sortOrder?"e-icon-descending e-icons e-descending e-sortfilterdiv e-value-sort-icon":"e-icon-ascending e-icons e-ascending e-sortfilterdiv e-value-sort-icon")+(a.hasChild?" e-value-sort-align":""),styles:"right"===t.style.textAlign?"float: left":""}))}else{l=t.innerText,m=(t.innerText="",t.classList.add("e-valuescontent"),a=e.data[Number(t.getAttribute("data-colindex"))],(a=Ue.isNullOrUndefined(a)?e.column.customAttributes.cell:a).isGrandSum=!!r||a.isGrandSum,a.isSum&&t.classList.add("e-summary"),Ue.isNullOrUndefined(a.isGrandSum)&&!Ue.isNullOrUndefined(this.parent.olapEngineModule)&&"column"===this.parent.olapEngineModule.olapValueAxis&&"olap"===this.parent.dataType&&this.colGrandPos-this.parent.dataSourceSettings.values.length<Number(t.getAttribute("data-colindex")));a.isGrandSum||m||this.colGrandPos===Number(t.getAttribute("data-colindex"))||this.rowGrandPos===Number(t.getAttribute("index"))?t.classList.add("e-gtot"):("olap"===this.parent.dataType?a.isSum:this.validateColumnTotalcell(a.colIndex))&&t.classList.add("e-colstot"),n&&n.cssClass&&t.classList.add(n.cssClass),t.appendChild(Ue.createElement("span",{className:tn,innerHTML:-1!==t.className.indexOf("e-summary")&&this.parent.isSummaryCellHyperlink||-1===t.className.indexOf("e-summary")&&this.parent.isValueCellHyperlink||a.enableHyperlink?'<a data-url="'+l+'" class="e-hyperlinkcell '+i+'">'+l+"</a>":l})),this.parent.gridSettings.allowReordering&&t.setAttribute("data-colindex",(e.column.customAttributes?e.column.customAttributes.cell.colIndex:e.column.index).toString())}this.parent.cellTemplate&&this.appendTemplate(t,n),this.unWireEvents(t),this.wireEvents(t)}e.pivotview=this.parent,this.parent.trigger(ae,e)},i.prototype.appendTemplate=function(e,t){var i,t=this.parent.getCellTemplate()({targetCell:e,cellInfo:t},this.parent,"cellTemplate",this.parent.element.id+"_cellTemplate",null,null,e);t&&""!==t&&0<t.length&&(this.parent.enableHtmlSanitizer?this.parent.isVue||this.parent.isVue3?((i=Ue.createElement("div")).innerHTML=Ue.SanitizeHtmlHelper.sanitize(t),Ue.append([i.firstChild],e)):this.parent.appendHtml(e,Ue.SanitizeHtmlHelper.sanitize(t[0].outerHTML)):this.parent.isVue||this.parent.isVue3?Ue.append(t,e):this.parent.appendHtml(e,t[0].outerHTML))},i.prototype.onOlapRowCellBoundEvent=function(e,t){e.innerText="";var i=this.engine.rowMeasurePos;if(this.parent.enableVirtualization){if(-1<t.ordinal&&0<this.parent.olapEngineModule.tupRowInfo.length){for(var a=this.parent.olapEngineModule.tupRowInfo[t.ordinal],r=(3===t.memberType?this.engine.fieldList[t.actualText.toString()].tag:t.actualText).toString(),r=a.uNameCollection.indexOf(r),n=(a.uNameCollection.substring(0,r)+(3===t.memberType?"":t.actualText.toString())).split("::[").map(function(e){return"["===e[0]?e:"["+e}),s=(3===t.memberType&&i&&n.push(t.actualText.toString()),-1),o=0,l=!1,d=0;d<n.length;d++){s+=n[d].split("~~").length;var p="2"!==a.typeCollection[d]&&(!!(this.engine.fieldList[a.members[d].getAttribute("Hierarchy")]&&this.engine.fieldList[a.members[d].getAttribute("Hierarchy")].isHierarchy&&d<this.parent.dataSourceSettings.rows.length-1&&!this.parent.dataSourceSettings.rows[d+1].isNamedSet&&this.parent.dataSourceSettings.rows[d+1].name.indexOf("[Measures]")<0&&this.engine.fieldList[this.parent.dataSourceSettings.rows[d+1].name]&&this.engine.fieldList[this.parent.dataSourceSettings.rows[d+1].name].hasAllMember)||0<Number(a.members[d].querySelector("CHILDREN_CARDINALITY").textContent));o+=0<d&&l&&!p?1:0,l=p}for(var h=0,u=0;u<s;u++)e.appendChild(Ue.createElement("span",{className:nn})),h++;for(u=0;u<o&&0<s;u++)e.appendChild(Ue.createElement("span",{className:sn}));this.indentCollection[t.rowIndex]=h,this.maxIndent=this.maxIndent>h?this.maxIndent:h}}else{var r=t.hierarchy,c=t.valueSort?t.valueSort.levelName.toString():"",c=-1===t.level?this.measurePos:c.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-1,c=3===t.memberType?c+"."+t.levelUniqueName:t.levelUniqueName,p=t.hasChild,g=!1;if(t.isSum&&3===t.memberType){for(var m=this.lvlCollection[t.parentUniqueName].position,S=m+1;S<this.position;S++)delete this.lvlCollection[this.lvlPosCollection[S]],delete this.lvlPosCollection[S];this.position=this.position>m+1?m+1:this.position,g=!0,this.measurePos=this.lvlCollection[t.parentUniqueName].position}if(!this.lvlCollection[c]&&c)this.lvlPosCollection[this.position]=c,this.lvlCollection[c]={position:this.position,hasChild:p},this.position++;else if(c){for(var m=this.lvlCollection[c].position,f=m+1;f<this.position;f++)delete this.lvlCollection[this.lvlPosCollection[f]],delete this.lvlPosCollection[f];this.position=this.position>m+1?m+1:this.position}if(!this.hierarchyCollection[r]&&r)this.hierarchyPosCollection[this.hierarchyCount]=r,this.hierarchyCollection[r]={lvlPosition:this.position-1,hierarchyPOs:this.hierarchyCount},this.hierarchyCount++;else if(r){for(m=this.hierarchyCollection[r].hierarchyPOs,f=m+1;f<this.hierarchyCount;f++)delete this.hierarchyCollection[this.hierarchyPosCollection[f]],delete this.hierarchyPosCollection[f];this.hierarchyCount=this.hierarchyCount>m+1?m+1:this.hierarchyCount}3!==t.memberType&&c&&this.lvlCollection[c]&&(m=this.hierarchyCollection[r]?this.hierarchyCollection[r].hierarchyPOs:-1,this.measurePos=i<=m&&this.hierarchyPosCollection[i+1]?this.measurePos:this.lvlCollection[c].position);for(var v=this.lvlCollection[c]?this.lvlCollection[c].position:-1,v=g?v-1:v,y=0,h=0;y<=v&&0<v&&-1<t.level;){var b=this.lvlCollection[this.lvlPosCollection[y]].hasChild;(l=0<y&&this.lvlCollection[this.lvlPosCollection[y-1]].hasChild)&&!b&&e.appendChild(Ue.createElement("span",{className:sn})),y!==v&&(e.appendChild(Ue.createElement("span",{className:nn})),h++),y++}"Top"!==this.parent.dataSourceSettings.grandTotalsPosition||Ue.isNullOrUndefined(this.parent.olapEngineModule)||"row"!==this.parent.olapEngineModule.olapValueAxis||"olap"!==this.parent.dataType||0!==t.valueSort.levelName.toString().indexOf(this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter)||e.appendChild(Ue.createElement("span",{className:nn})),3===t.memberType&&-1===t.level&&1<Object.keys(this.lvlCollection).length&&(e.appendChild(Ue.createElement("span",{className:nn})),h++),this.indentCollection[t.rowIndex]=h,this.maxIndent=this.maxIndent>h?this.maxIndent:h}return e.setAttribute("fieldname",t.hierarchy),!this.parent.olapEngineModule.tupRowInfo[t.ordinal]||(0===this.parent.olapEngineModule.tupRowInfo[t.ordinal].measurePosition?1!==this.parent.olapEngineModule.tupRowInfo[t.ordinal].allStartPos:0!==this.parent.olapEngineModule.tupRowInfo[t.ordinal].allStartPos)||e.classList.add("e-gtot"),e},i.prototype.columnCellBoundEvent=function(e){if(e.cell.column&&e.cell.column.customAttributes){var t=e.cell.column.customAttributes.cell,i=e.node;if(t){for(var a=this.parent.hyperlinkSettings.cssClass,r=!1,n=0,s=this.parent.dataSourceSettings.values;n<s.length;n++){var o=s[n];o.name===t.actualText&&(r=!0,i.setAttribute("fieldname",o.name))}-1===t.level&&!t.rowSpan||-1===t.rowSpan?e.node.style.display="none":1<t.rowSpan&&(e.node.setAttribute("rowspan",t.rowSpan.toString()),e.node.setAttribute("aria-rowspan",t.rowSpan.toString()),t.rowIndex+t.rowSpan===this.engine.headerContent.length)&&(e.node.style.borderBottomWidth="0px"),e.node.setAttribute("data-colindex",t.colIndex.toString()),e.node.setAttribute("index",t.rowIndex.toString());"pivot"===this.parent.dataType?(!r&&!(this.parent.dataSourceSettings.values&&"column"===this.parent.dataSourceSettings.valueAxis&&1<this.parent.dataSourceSettings.values.length&&r&&t.rowIndex===this.engine.headerContent.length-1)&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length&&(p=-1<t.level&&this.parent.dataSourceSettings.columns[t.level]?this.parent.dataSourceSettings.columns[t.level].name:"",i.setAttribute("fieldname",p)),this.validateColumnTotalcell(t.colIndex)&&i.classList.add("e-colstot")):i=this.onOlapColumnCellBoundEvent(i,t);for(var l,d,p=0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis&&t.valueSort&&t.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+t.formattedText,h=((t.type||p)&&(i.classList.add("grand sum"===t.type?"e-gtot":"e-stot"),"grand sum"===t.type?this.colGrandPos=t.colIndex:t.type&&i.classList.add("e-colstot"),d="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,c="grand sum"===t.type?Ue.isNullOrUndefined(t.valueSort.axis)||"olap"===this.parent.dataType?this.parent.localeObj.getConstant("grandTotal"):t.formattedText:t.formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total"),c=p&&d.fieldList?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(d.fieldList[t.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+t.formattedText:c,null!==i.querySelector(".e-headertext")?i.querySelector(".e-headertext").innerText=c:i.querySelector(".e-stackedheadercelldiv").innerText=c),i.classList.add(Zr),(this.parent.isColumnCellHyperlink||t.enableHyperlink)&&(i.querySelector(".e-stackedheadercelldiv")?(l=i.querySelector(".e-stackedheadercelldiv").innerText,i.querySelector(".e-stackedheadercelldiv").innerHTML='<a data-url="'+l+'" class="e-hyperlinkcell '+a+'">'+l+"</a>"):i.querySelector(".e-headertext")&&(l=i.querySelector(".e-headertext").innerText,i.querySelector(".e-headertext").innerHTML='<a data-url="'+l+'" class="e-hyperlinkcell '+a+'">'+l+"</a>")),!0!==t.hasChild||t.isNamedSet?this.updateWrapper(i):((p=i.querySelector(".e-headercelldiv"))&&(p.style.height="auto",p.style.lineHeight="normal"),d=Ue.createElement("div",{className:(!0===t.isDrilled?Xr:Jr)+" "+z,attrs:{title:!0===t.isDrilled?this.parent.localeObj.getConstant("collapse"):this.parent.localeObj.getConstant("expand")}}),-1<window.navigator.userAgent.indexOf("Edge")||-1<window.navigator.userAgent.indexOf("Trident")?i.children[0].style.display="table":i.children[0].style.display="block",this.updateWrapper(i,d)),i=this.appendValueSortIcon(t,i,t.rowIndex,t.colIndex,e.cell.column),this.parent.cellTemplate&&this.appendTemplate(i,t),this.parent.dataSourceSettings.values.length),u=0;u<h;u++)this.parent.dataSourceSettings.values[u].name===t.actualText&&("olap"===this.parent.dataType&&this.parent.olapEngineModule.tupColumnInfo[t.ordinal]&&(0===this.parent.olapEngineModule.tupColumnInfo[t.ordinal].measurePosition?1===this.parent.olapEngineModule.tupColumnInfo[t.ordinal].allStartPos:0===this.parent.olapEngineModule.tupColumnInfo[t.ordinal].allStartPos)&&i.classList.add("e-gtot"),t.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+t.formattedText||t.valueSort.levelName==="Grand Total"+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+t.formattedText?i.classList.add("e-gtot"):i.classList.add("e-valuesheader"));this.unWireEvents(i),this.wireEvents(i)}}else{var c;this.parent.isTabular&&(c=this.parent.engineModule.rowMaxLevel+1,e.cell&&e.cell.column&&0===e.cell.column.index?(e.node.setAttribute("colspan",c.toString()),e.node.classList.add(Ls)):e.node.style.display="none")}this.parent.trigger(re,e)},i.prototype.updateWrapper=function(e,t){var i,a;return(0<e.querySelectorAll(".e-headercelldiv").length||0<e.querySelectorAll(".e-stackedheadercelldiv").length)&&(i=Ue.createElement("div",{className:"e-pivotcell-container"}),a=Ue.createElement("div",{className:(t?"e-stackedheadertext":"e-headertext")+" "+tn,innerHTML:(0<e.querySelectorAll(".e-headercelldiv").length?e.querySelector(".e-headercelldiv"):e.querySelector(".e-stackedheadercelldiv")).innerHTML}),t&&i.append(t),i.append(a),e.children[0].innerHTML="",e.children[0].append(i)),e},i.prototype.onOlapColumnCellBoundEvent=function(e,t){e.setAttribute("fieldname",3===t.memberType?t.actualText.toString():t.hierarchy);var i=this.engine.headerContent[t.rowIndex]?this.engine.headerContent[t.rowIndex][t.colIndex-1]:void 0;return i&&i.actualText===t.actualText&&i.type===t.type&&1<i.colSpan&&(e.style.display="none"),t.rowIndex===this.engine.headerContent.length-1&&2===t.memberType&&(e.style.display=this.isSpannedCell(this.engine.headerContent.length,t)?"none":e.style.display),e},i.prototype.isSpannedCell=function(e,t){for(var i,a,r=this.engine.headerContent[t.rowIndex-1]?this.engine.headerContent[t.rowIndex-1][t.colIndex]:void 0;r&&(r.memberType===t.memberType||r.type&&t.type);)0<r.rowSpan&&(i=r.rowSpan,a=r.rowIndex),r=this.engine.headerContent[r.rowIndex-1]?this.engine.headerContent[r.rowIndex-1][t.colIndex]:void 0;return e<=a+i},i.prototype.onHyperCellClick=function(e){var t=e.target.parentElement.parentElement,i={currentCell:t=-1<t.className.indexOf("e-headercelldiv")?t.parentElement:t,data:this.engine.pivotValues[Number(t.getAttribute("index"))][Number(t.getAttribute("data-colindex"))],cancel:!0,nativeEvent:e};this.parent.trigger(ne,i,function(e){e.cancel||(i.currentCell=Ue.getElement(i.currentCell),e=(i.currentCell.getAttribute("data-url")?i.currentCell:i.currentCell.querySelector("a")).getAttribute("data-url"),window.open(e))})},i.prototype.getRowStartPos=function(){for(var e,t=this.parent.pivotValues,i=0;i<(t?t.length:0);i++)if(t[i]&&t[i][0]&&"row"===t[i][0].axis){e=i;break}return e},i.prototype.frameDataSource=function(e){var t=[];if(("pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&0<this.parent.engineModule.data.length||"olap"===this.parent.dataType&&""!==this.parent.dataSourceSettings.url||"Server"===this.parent.dataSourceSettings.mode&&""!==this.parent.dataSourceSettings.url&&0<this.engine.pivotValues.length)&&0<this.parent.dataSourceSettings.values.length&&!this.engine.isEmptyData)if(this.parent.enableValueSorting||!this.engine.isEngineUpdated||"Tabular"===this.gridSettings.layout){for(var i=0,a=this.parent.pivotValues,r="value"===e?this.rowStartPos:0,n="value"===e?a?a.length:0:this.rowStartPos,s=r;s<n;s++)if(a[s]){t[i="header"===e?s:i]={};for(var o=0;o<a[s].length;o++)a[s][o]&&(t[i][o]=a[s][o]);i++}}else t="value"===e?this.engine.valueContent:this.engine.headerContent;else t=this.frameEmptyData();return t},i.prototype.frameEmptyData=function(){return[{0:{formattedText:this.parent.localeObj.getConstant("grandTotal")},1:{formattedText:this.parent.localeObj.getConstant("emptyData")}}]},i.prototype.calculateColWidth=function(e){Ue.isNullOrUndefined(this.parent.resizedValue)||(this.parent.resizedValue=this.parent.showGroupingBar&&this.parent.resizedValue<250?250:this.parent.resizedValue),this.resColWidth=Ue.isNullOrUndefined(this.parent.resizedValue)?this.resColWidth:this.parent.resizedValue;var t,i=this.calculateGridWidth(),i=isNaN(this.parent.width)?-1<this.parent.width.toString().indexOf("%")?parseFloat(this.parent.width.toString())/100*i:i:Number(this.parent.width),a=(i-=this.gridSettings.columnWidth>this.resColWidth?this.gridSettings.columnWidth:this.parent.isTabular?(this.parent.engineModule.rowMaxLevel+1)*this.resColWidth:this.resColWidth,e=this.parent.isTabular?e-(this.parent.engineModule.rowMaxLevel+1):e-1,this.isOverflows=!(e*this.gridSettings.columnWidth<i),this.isOverflows||(t="auto"===(t=this.calculateGridHeight())?this.parent.getHeightAsNumber():t,a=this.engine&&this.engine.headerContent?Object.keys(this.engine.headerContent).length:1,t=t-this.gridSettings.rowHeight*a,this.engine&&this.engine.valueContent&&this.gridSettings.rowHeight*this.engine.valueContent.length>t&&(i-=w.getScrollBarWidth())),e*this.gridSettings.columnWidth<i?i/e:this.gridSettings.columnWidth);return this.isOverflows||this.gridSettings.allowAutoResizing?Math.floor(a):this.gridSettings.columnWidth},i.prototype.resizeColWidth=function(e){Ue.isNullOrUndefined(this.parent.resizedValue)||(this.parent.resizedValue=this.parent.showGroupingBar&&this.parent.resizedValue<250?250:this.parent.resizedValue),this.resColWidth=Ue.isNullOrUndefined(this.parent.resizedValue)?this.resColWidth:this.parent.resizedValue;var t=isNaN(this.parent.width)?-1<this.parent.width.toString().indexOf("%")?parseFloat(this.parent.width.toString())/100*this.parent.element.offsetWidth:this.parent.element.offsetWidth:Number(this.parent.width),t=(t-=this.gridSettings.columnWidth>this.resColWidth?this.gridSettings.columnWidth:this.resColWidth,this.isOverflows=!((e-=1)*this.gridSettings.columnWidth<t),e*this.gridSettings.columnWidth<t?t/e:this.gridSettings.columnWidth);return this.isOverflows||this.gridSettings.allowAutoResizing?Math.floor(t):this.gridSettings.columnWidth},i.prototype.calculateGridWidth=function(){var e=this.parent.width,t=this.parent.element.getBoundingClientRect().width?this.parent.element.getBoundingClientRect().width:this.parent.element.offsetWidth;return 0===t&&(t=this.parent.element.parentElement.getBoundingClientRect().width?this.parent.element.parentElement.getBoundingClientRect().width:this.parent.element.parentElement.offsetWidth),"auto"===this.gridSettings.width?"auto"===this.parent.width?e=t:-1<this.parent.width.toString().indexOf("%")?e=parseFloat(this.parent.width.toString())/100*t:-1<this.parent.width.toString().indexOf("px")&&(e=this.parent.width.toString().split("px")[0]):e=this.gridSettings.width,!this.gridSettings.allowAutoResizing&&e>this.parent.totColWidth?this.parent.totColWidth:e},i.prototype.calculateGridHeight=function(e){var t,i=this.parent.element.querySelector(".e-grid ."+Ya),a=this.parent.height,r=this.parent.getHeightAsNumber();return i&&(r=isNaN(r)?r>this.parent.minHeight?r:this.parent.minHeight:i.offsetWidth<i.querySelector("."+c).offsetWidth?r-w.getScrollBarWidth():r,this.parent.showToolbar&&"Chart"!==this.parent.currentView||!this.parent.showToolbar&&"Chart"!==this.parent.displayOption.view)&&("auto"===this.gridSettings.height&&r&&this.parent.element.querySelector("."+es)?(a=(a=r-(this.parent.element.querySelector("."+es).offsetHeight+(this.parent.element.querySelector("."+fs)?this.parent.element.querySelector("."+fs).offsetHeight:0)+(this.parent.element.querySelector("."+ss)?42:0)+(this.parent.element.querySelector("."+xs)?this.parent.element.querySelector("."+xs).offsetHeight:0))-1)<40?40:a,e?(r=i.querySelector("."+c).offsetHeight,e=i.querySelector("."+c).offsetHeight,t=i.querySelector("."+c).offsetWidth,i=i.offsetWidth<=t,r<=a&&(!i||e<=a)&&!(i&&a-r<18)?this.parent.grid.height="auto":(this.parent.grid.height=a,this.parent.grid.dataBind())):a>this.engine.valueContent.length*this.gridSettings.rowHeight&&(a="auto")):a=this.gridSettings.height),a<this.parent.gridSettings.rowHeight?this.parent.gridSettings.rowHeight:a},i.prototype.frameStackedHeaders=function(){var e=this.parent.pivotColumns,t="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,i=this.parent.grid.columnModel,a=!1,r=!(!this.parent.toolbarModule||!this.parent.toolbarModule.isReportChange)||!!this.parent.actionObj&&("Sort value"===this.parent.actionObj.actionName&&1===t.valueAxis||"Sort field"===this.parent.actionObj.actionName&&"columns"===this.parent.actionObj.fieldInfo.axis||this.parent.pivotFieldListModule&&"Sort field"===this.parent.pivotFieldListModule.actionObj.actionName&&"columns"===this.parent.pivotFieldListModule.actionObj.fieldInfo.axis);if(this.pivotColumns=[],("olap"===this.parent.dataType&&""!==this.parent.dataSourceSettings.url||0<this.parent.dataSourceSettings.values.length&&this.parent.dataSourceSettings.dataSource&&0<this.parent.engineModule.data.length||"Server"===this.parent.dataSourceSettings.mode&&""!==this.parent.dataSourceSettings.url&&0<this.engine.pivotValues.length)&&!this.engine.isEmptyData){var n=this.engine.headerContent.length,s=[],o=[],l=this.calculateColWidth(this.engine.pivotValues&&this.engine.pivotValues[0]?this.engine.pivotValues[0].length:0),d="olap"===this.parent.dataType&&!Ue.isNullOrUndefined(this.engine.colMeasurePos)&&this.engine.colDepth-1===this.parent.olapEngineModule.colMeasurePos;do{var p=[],h=0,u=(n--,this.engine.headerContent[n]),c=u?Object.keys(u).length:0;if(u)for(var g=this.parent.isTabular?this.parent.engineModule.rowMaxLevel+1:u[0]?0:1,m=0,S=Object.keys(u).length+g;m<S;m++){var f=u[m]&&u[m].colSpan?3!==u[m].memberType||3===u[m].memberType&&!d||0===n?u[m].colSpan:s[m]:1,f="olap"===this.parent.dataType&&Ue.isNullOrUndefined(f)?1:f,v=u[m]?"grand sum"===u[m].type?Ue.isNullOrUndefined(u[m].valueSort.axis)?this.parent.localeObj.getConstant("grandTotal"):u[m].formattedText:"sum"===u[m].type?u[m].formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total"):u[m].formattedText:"",v=this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(v):v;if(n===this.engine.headerContent.length-1)a=e.length-(f=1)===c&&!r&&!this.parent.isEmptyGrid&&e[h]&&e[h].autoFit,p[h]={field:m+".formattedText",headerText:v,customAttributes:{cell:this.cloneDataWithoutIndex(u[m])},width:a?i[h].width:u[m]&&u[m].valueSort?this.setSavedWidth(u[m].valueSort.levelName,l):this.resColWidth,minWidth:a&&h===c?i[i.length-1].minWidth:30,allowReordering:this.parent.gridSettings.allowReordering,allowResizing:this.parent.gridSettings.allowResizing,visible:!0,textAlign:this.parent.enableRtl?"Left":"Right",headerTextAlign:this.parent.enableRtl?"Right":"Left"},m===c&&(p[h].width=p[h].width-3,this.lastColumn=p[h]);else if(s[m]){for(var y=f,b=[],C=m;0<y;){if(p[h]){if(!this.pivotColumns[o[C]])break;b.push(this.pivotColumns[o[C]])}else p[h]={headerText:v,field:u[m]?u[m].valueSort.levelName:"",customAttributes:{cell:this.cloneDataWithoutIndex(u[m])},width:a&&0===h&&!r&&!this.parent.isEmptyGrid&&e[0].autoFit?i[0].width:u[m]?this.setSavedWidth(u[m].valueSort.levelName,l):this.resColWidth,minWidth:30,allowReordering:this.parent.gridSettings.allowReordering,allowResizing:this.parent.gridSettings.allowResizing,visible:!0,headerTextAlign:this.parent.enableRtl?"Right":"Left"},b=[this.pivotColumns[o[C]]];this.isAutoFitEnabled=!!this.isAutoFitEnabled||a,y-=s[C],C+=s[C]}p[h].columns=b}p[h]&&(p[h].clipMode=this.gridSettings.clipMode),s[m]=f,o[m]=h,h++,m=m+f-1}}while(this.pivotColumns=0<p.length?p:this.pivotColumns,0<n);if(this.parent.isTabular)for(var x=0;x<this.parent.engineModule.rowMaxLevel+1;x++)if(this.parent.showGroupingBar&&!this.parent.isAdaptive){var w=this.parent.element.querySelector("."+Is),T=w.querySelectorAll(".e-pvt-btn-div"),M=0;M=this.parent.engineModule.rowMaxLevel!==T.length-1&&x===this.parent.engineModule.rowMaxLevel?this.getTotalColumnWidth(T,x):1===w.querySelectorAll(".e-pvt-btn-div").length?250:.8*this.parent.element.getBoundingClientRect().width<=this.getTotalColumnWidth(T,0)?this.gridSettings.columnWidth:(w.querySelectorAll(".e-pvt-btn-div")[x].getBoundingClientRect().width<this.parent.gridSettings.columnWidth?this.parent.gridSettings.columnWidth:w.querySelectorAll(".e-pvt-btn-div")[x].getBoundingClientRect().width)+6,this.pivotColumns[x]={field:x+".formattedText",width:M>this.gridSettings.columnWidth?M:this.resColWidth,minWidth:30,headerText:"",allowReordering:!1,allowResizing:!this.parent.isTabular&&this.parent.gridSettings.allowResizing,visible:!0,clipMode:this.parent.gridSettings.clipMode}}else for(var D=0;D<this.parent.engineModule.rowMaxLevel+1;D++)this.updatePivotColumn(this.pivotColumns,D,a,r,i);else this.updatePivotColumn(this.pivotColumns,0,a,r,i)}else this.pivotColumns=this.frameEmptyColumns();return this.parent.toolbarModule&&this.parent.showToolbar&&(this.parent.toolbarModule.isReportChange=!1),this.parent.triggerColumnRenderEvent(this.pivotColumns),a=0<this.parent.pivotColumns.length&&this.parent.pivotColumns[this.parent.pivotColumns.length-1].autoFit,this.pivotColumns},i.prototype.setSavedWidth=function(e,t){if("0.formattedText"!==e||Ue.isNullOrUndefined(this.parent.resizedValue)){if(this.parent.isTabular&&this.parent.element.querySelector(".e-row").querySelector(".e-rowcell")&&this.parent.showGroupingBar&&"0.formattedText"===e&&0===this.parent.dataSourceSettings.values.length){for(var i=0,a=this.parent.element.querySelector("."+Is).querySelectorAll(".e-pvt-btn-div"),r=0;r<a.length;r++)i+=a[r].getBoundingClientRect().width+6;t=i}t=this.parent.resizeInfo[e]||t}else t=this.parent.resizedValue;return t},i.prototype.frameEmptyColumns=function(){var e=[],t=this.calculateColWidth(2);return e.push({field:"0.formattedText",headerText:"",minWidth:30,width:this.resColWidth}),e.push({field:"1.formattedText",headerText:this.parent.localeObj.getConstant("grandTotal"),minWidth:30,width:t-3}),e},i.prototype.getFormatList=function(){for(var e={},t=0;t<this.parent.dataSourceSettings.values.length;t++){var i,a=this.parent.dataSourceSettings.values[t],r="N";if("olap"===this.parent.dataType)this.parent.olapEngineModule.fieldList[a.name]&&!Ue.isNullOrUndefined(this.parent.olapEngineModule.fieldList[a.name].formatString)&&(r=-1<(i="Standard"===(i=this.parent.olapEngineModule.formatFields[a.name]?this.parent.olapEngineModule.formatFields[a.name].format:this.parent.olapEngineModule.fieldList[a.name].formatString)?"Number":i).indexOf("#")||null!==i.match(/\d/)?i:i[0]+"2");else if(-1<["PercentageOfDifferenceFrom","PercentageOfRowTotal","PercentageOfColumnTotal","PercentageOfGrandTotal","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal"].indexOf(a.type)?r="P2":-1<["PopulationStDev","SampleStDev","PopulationVar","SampleVar","Index"].indexOf(a.type)&&(r=void 0),0<this.parent.dataSourceSettings.formatSettings.length)for(var n=0;n<this.parent.dataSourceSettings.formatSettings.length;n++){var s=this.parent.dataSourceSettings.formatSettings[n];if(a.name===s.name){r=s.format;break}}e[a.name]=r}return e},i.prototype.getValidHeader=function(e,t){var i,a=this.parent.dataSourceSettings.values;if("row"===t){var r=e;if(0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length){if(0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis&&this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+r.value===r.data[0].valueSort.levelName)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[r.value.toString()].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+r.value.toString();if(1===a.length&&0===this.parent.dataSourceSettings.rows.length)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(a[a.length-1].type)+" "+this.parent.localeObj.getConstant("of")+" "+(Ue.isNullOrUndefined(a[a.length-1].caption)?a[a.length-1].name:a[a.length-1].caption)}i=r.value}else if("column"===t){r=e;if((0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length)&&!Ue.isNullOrUndefined(e.gridCell.column.customAttributes)&&0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis&&this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+r.gridCell.column.customAttributes.cell.formattedText===r.gridCell.column.customAttributes.cell.valueSort.levelName)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[r.gridCell.column.customAttributes.cell.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+r.gridCell.column.customAttributes.cell.formattedText;i=r.cell.value}return i},i.prototype.excelColumnEvent=function(e){0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis&&(e.cell.value=this.getValidHeader(e,"column")),void 0!==e.gridCell&&"auto"===e.gridCell.column.width&&(this.parent.lastColumn=e.gridCell.column,e.gridCell.column.width=e.gridCell.column.minWidth),e=this.exportHeaderEvent(e,"XLSX"),this.parent.trigger(J,e)},i.prototype.pdfColumnEvent=function(e){0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis&&(e.cell.value=this.getValidHeader(e,"column")),void 0!==e.gridCell&&"auto"===e.gridCell.column.width&&(this.parent.lastColumn=e.gridCell.column,e.gridCell.column.width=e.gridCell.column.minWidth),this.parent.trigger(Z,e)},i.prototype.excelRowEvent=function(e){var t,i,a,r,n;"0.formattedText"===e.column.field?(i=(n=e.data[0]).type&&"value"===n.type,r=0,r="olap"===this.parent.dataType?this.indentCollection[n.rowIndex]:(a=n.valueSort?n.valueSort.levelName.toString():"",n=n.actualText?n.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,(a=a.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(n&&n-1))?a-1:0),this.colPos=0,e.style={hAlign:"Left",indent:2*r},this.lastSpan=i?this.lastSpan:r):(this.colPos++,t=e.data[e.column.customAttributes.cell?e.column.customAttributes.cell.colIndex:this.colPos],Ue.isNullOrUndefined(t.value)||Ue.isNullOrUndefined(t.formattedText)||""===t.formattedText?e.value="Excel"===this.parent.exportType?null:"":(n="pivot"===this.parent.dataType&&this.parent.engineModule?this.parent.engineModule.aggregatedValueMatrix:void 0)&&n[t.rowIndex]&&n[t.rowIndex][t.colIndex]?e.value=n[t.rowIndex][t.colIndex]:e.value=Ue.isNullOrUndefined(t.value)||"#DIV/0!"===t.formattedText?t.formattedText:t.value),e=this.exportContentEvent(e),0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis&&(e.value="0.formattedText"===e.column.field?this.getValidHeader(e,"row"):e.value),this.parent.trigger($,e),t&&(e.style&&this.formatList[t.actualText]?(e.style.type="number",e.style.numberFormat=e.style.numberFormat||this.formatList[t.actualText]):this.formatList[t.actualText]&&(e.style={numberFormat:this.formatList[t.actualText]}),e.column.format=this.formatList[t.actualText])},i.prototype.pdfRowEvent=function(e){var t,i,a,r;"0.formattedText"===(e=this.exportContentEvent(e)).column.field&&(t=(i=e.data[r=0]).type&&"value"===i.type,r="olap"===this.parent.dataType?this.indentCollection[i.rowIndex]:(a=i.valueSort?i.valueSort.levelName.toString():"",i=i.actualText?i.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,(a=a.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(i&&i-1))?a-1:0),e.style={paragraphIndent:10*r},this.lastSpan=t?this.lastSpan:r,0===this.parent.dataSourceSettings.rows.length)&&"row"===this.parent.dataSourceSettings.valueAxis&&(e.value=this.getValidHeader(e,"row")),this.parent.trigger(ee,e)},i.prototype.excelDataBound=function(e){for(var t=e.excelRows,i=Object.keys(this.engine.headerContent).length,a=0;a<i;a++){for(var r=t[a].cells,n=[],s=0;s<r.length;s++)-1!==r[s].rowSpan&&n.push(r[s]);t[a].cells=n}},i.prototype.exportHeaderEvent=function(e,t){var i,a=1;return e.gridCell.column.customAttributes?(a=0<(i=e.gridCell.column.customAttributes.cell).rowSpan?i.rowSpan:1,"XLSX"===t&&(0<i.rowSpan?a=i.rowSpan:Ue.isNullOrUndefined(i.type)||0===i.level||(e.cell.rowSpan=a=1)),this.actualText=i.actualText):a=Object.keys(this.engine.headerContent).length,e.cell.rowSpan!==a&&0<a&&(e.cell.rowSpan=a),e},i.prototype.frameGridDataSource=function(e){for(var t=[],i=0;i<e.length;i++)for(var a=0,r=(t[i]={},Object.keys(e[i])),n=0;null!=e[i]&&n<r.length;n++)for(;a<r.length;)t[i][Number(r[a])]=this.cloneDataWithoutIndex(e[i][Number(r[a])]),a++;return t},i.prototype.cloneDataWithoutIndex=function(e){if(Ue.isNullOrUndefined(e))return e;for(var t=Object.keys(e),i=0,a={};i<t.length;)"indexObject"!==t[i]&&"index"!==t[i]&&(a[t[i]]=e[t[i]]),i++;return a},i.prototype.exportContentEvent=function(e){var t=e.data[Number(e.column.field.split(".formattedText")[0])];return e.value="grand sum"===t.type?Ue.isNullOrUndefined(t.valueSort.axis)?this.parent.localeObj.getConstant("grandTotal"):t.formattedText:e.value,e},i.prototype.unWireEvents=function(e){e.querySelector(".e-hyperlinkcell")&&Ue.EventHandler.remove(e.querySelector(".e-hyperlinkcell"),this.parent.isAdaptive?"touchend":"click",this.onHyperCellClick)},i.prototype.wireEvents=function(e){e.querySelector(".e-hyperlinkcell")&&Ue.EventHandler.add(e.querySelector(".e-hyperlinkcell"),this.parent.isAdaptive?"touchend":"click",this.onHyperCellClick,this)},i.prototype.setSpanAttributes=function(e,t,i){i.setAttribute(e,t?t.toString():"1"),i.classList.add($r,Ls,"e-tabular-layout-header"),0===t&&i.classList.add(W)},i.prototype.updatePivotColumn=function(e,t,i,a,r){e[t]={field:t+".formattedText",width:i&&!a&&!this.parent.isEmptyGrid&&e[t].autoFit?r[t].width:this.resColWidth,minWidth:30,headerText:"",allowReordering:!1,allowResizing:!this.parent.isTabular&&this.parent.gridSettings.allowResizing,visible:!0,clipMode:this.parent.gridSettings.clipMode}},i.prototype.getTotalColumnWidth=function(e,t){for(var i=0,a=t;a<e.length;a++)i+=(e[a].getBoundingClientRect().width<this.parent.gridSettings.columnWidth?this.parent.gridSettings.columnWidth:e[a].getBoundingClientRect().width)+6;return i};var ks=i;function i(e){this.isAutoFitEnabled=!1,this.pivotColumns=[],this.indentCollection={},this.colPos=0,this.lastSpan=0,this.lvlCollection={},this.hierarchyCollection={},this.lvlPosCollection={},this.hierarchyPosCollection={},this.position=0,this.measurePos=0,this.maxMeasurePos=0,this.hierarchyCount=0,this.actualText="",this.drilledLevelInfo={},this.parent=e,this.resColWidth=this.parent.showGroupingBar&&this.parent.groupingBarModule?this.parent.isAdaptive?180:250:this.parent.isAdaptive?140:200,this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.gridSettings=this.parent.gridSettings,this.formatList=this.getFormatList(),this.aggMenu=new As(this.parent)}qs.prototype.keyActionHandler=function(e){switch(e.action){case"shiftF":this.processFilter(e);break;case"shiftS":this.processSort(e);break;case"shiftE":this.processEdit(e);break;case"delete":this.processDelete(e);break;case"enter":this.processEnter(e);break;case"escape":this.processClose(e);break;case"upArrow":case"downArrow":this.processFilterNodeSelection(e);break;case"altJ":this.processComponentFocus(e)}},qs.prototype.processComponentFocus=function(e){this.parent.element&&(this.parent.element.focus(),e.stopPropagation(),e.preventDefault())},qs.prototype.getButtonElement=function(e){for(var t=[].slice.call(this.parent.element.querySelectorAll("."+Q)),i=0,a=t.length;i<a;i++)if(t[i].getAttribute("data-uid")===e.getAttribute("data-uid"))return t[i];return e},qs.prototype.processEnter=function(e){var t=e.target;t&&Ue.closest(t,"."+Q)&&(t.querySelector("."+Na)&&Ue.closest(t,"."+Cr)?t.querySelector("."+Na).click():t.querySelector("."+Fn)?t.querySelector("."+Fn).click():!t.querySelector("."+Xa)||Ue.closest(t,"."+Cr)||Ue.closest(t,"."+Mn)?t.querySelector("."+$a)&&!Ue.closest(t,"."+Cr)&&t.querySelector("."+$a).click():(t.querySelector("."+Xa).click(),this.getButtonElement(t).focus()),e.preventDefault())},qs.prototype.processSort=function(e){var t=e.target;t&&Ue.closest(t,"."+Q)&&t.querySelector("."+Xa)&&!Ue.closest(t,"."+Cr)&&!Ue.closest(t,"."+Mn)&&(t.querySelector("."+Xa).click(),this.getButtonElement(t).focus(),e.preventDefault())},qs.prototype.processEdit=function(e){var t=e.target;t&&Ue.closest(t,"."+Q)&&t.querySelector("."+Fn)&&(t.querySelector("."+Fn).click(),e.preventDefault())},qs.prototype.processFilter=function(e){var t,i,a=e.target;a&&Ue.closest(a,"."+Q)&&a.querySelector("."+$a)&&!Ue.closest(a,"."+Cr)&&(a.querySelector("."+$a).click(),this.parent&&this.parent.control&&"pivotview"===this.parent.moduleName&&this.parent.control.grid&&this.parent.control.showGroupingBar&&this.parent.control.groupingBarModule&&Ue.closest(a,"."+Mr)&&this.parent.filterDialog&&this.parent.filterDialog.dialogPopUp&&!this.parent.filterDialog.dialogPopUp.isDestroyed&&this.parent.filterDialog.dialogPopUp.element&&(t=this.parent.filterDialog.dialogPopUp.element,i=this.parent.filterDialog.allowExcelLikeFilter,clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){t&&t.classList.contains("e-popup-open")&&(i&&t.querySelector(".e-dlg-closeicon-btn")?t.querySelector(".e-dlg-closeicon-btn").focus():t.querySelector("input")&&t.querySelector("input").focus())})),e.preventDefault())},qs.prototype.processFilterNodeSelection=function(e){var t,i,a=e.target;a&&Ue.closest(a,"."+dn)&&40===e.keyCode?(t=Ue.closest(a,"."+or).querySelector("."+lr))&&t.querySelector("li")&&(i=t.querySelector("li"),t.querySelector("li#_active")&&(Ue.removeClass([t.querySelector("li#_active")],["e-node-focus"]),t.querySelector("li#_active").removeAttribute("id")),i.setAttribute("id","_active"),Ue.addClass([i],["e-node-focus"]),i.focus(),e.preventDefault()):a&&Ue.closest(a,"."+lr)&&38===e.keyCode?(t=Ue.closest(a,"."+lr)).querySelector("li#_active.e-node-focus")&&t.querySelector("li")&&t.querySelector("li").classList.contains("e-prev-active-node")&&t.querySelector("li")===t.querySelector("li#_active.e-node-focus")&&(Ue.removeClass(t.querySelectorAll("li.e-prev-active-node"),"e-prev-active-node"),t=Ue.closest(a,"."+or).querySelector("."+dn))&&t.querySelector("li")&&((i=t.querySelector("li")).setAttribute("id","_active"),Ue.addClass([i],["e-node-focus"]),i.focus(),e.preventDefault()):a&&a.id===this.parent.parentID+"_inputbox"&&("upArrow"===e.action?a.parentElement.querySelector(".e-spin-up").click():"downArrow"===e.action&&a.parentElement.querySelector(".e-spin-down").click())},qs.prototype.processDelete=function(e){var t=e.target;t&&Ue.closest(t,"."+Q)&&t.querySelector("."+ir)&&(t.querySelector("."+ir).click(),e.preventDefault())},qs.prototype.processClose=function(e){var t=e.target;if(t&&Ue.closest(t,".e-popup.e-popup-open")){t=Ue.getInstance(Ue.closest(t,".e-popup.e-popup-open"),P.Dialog);if(t&&!t.closeOnEscape){var i=t.element.getAttribute("data-fieldName");if(t.hide(),this.parent.element)for(var a=0,r=[].slice.call(this.parent.element.querySelectorAll(".e-pivot-button"));a<r.length;a++){var n=r[a];if(n.getAttribute("data-uid")===i){n.focus();break}}e.preventDefault()}}},qs.prototype.destroy=function(){this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null)};var js=qs;function qs(e){this.keyConfigs={shiftF:"shift+F",shiftS:"shift+S",shiftE:"shift+E",delete:"delete",enter:"enter",escape:"escape",upArrow:"upArrow",downArrow:"downArrow",altJ:"alt+J"},this.parent=e,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.keyboardModule=new Ue.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})}Hs.prototype.updateSorting=function(e){if(!e.target.classList.contains($a)&&!e.target.classList.contains(ir)){this.parent.filterDialog.dialogPopUp&&this.parent.filterDialog.dialogPopUp.close();var e=e.target,t=void 0,i=void 0,i=0!==(e.id?(t=e.getAttribute("data-uid"),[].slice.call(e.querySelectorAll("."+Za))):(t=e.parentElement.getAttribute("data-uid"),[].slice.call(e.parentElement.querySelectorAll("."+Za)))).length,a=Ce.getFieldByName(t,this.parent.dataSourceSettings.sortSettings),r=this.parent.engineModule&&this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].membersOrder?this.parent.engineModule.fieldList[t].membersOrder.slice():[];if(!Ue.isNullOrUndefined(a))for(var n=0;n<this.parent.dataSourceSettings.sortSettings.length;n++)if(this.parent.dataSourceSettings.sortSettings[n].name===t){this.parent.dataSourceSettings.sortSettings.splice(n,1);break}a={name:t,order:i?"Ascending":"Descending",membersOrder:a?a.membersOrder:r};this.parent.dataSourceSettings.sortSettings.push(a),this.parent.control.lastSortInfo=this.parent.dataSourceSettings.sortSettings[this.parent.dataSourceSettings.sortSettings.length-1],i?Ue.removeClass([e],Za):Ue.addClass([e],Za)}},Hs.prototype.updateFiltering=function(e){var e=e.target,t=e.parentElement.getAttribute("data-uid"),e=e.parentElement.textContent,i=!1,a=[],r=[];if(this.parent.dataSourceSettings.allowMemberFilter)if("olap"===this.parent.dataType)r=this.getOlapData(t,i);else{var n=this.parent.engineModule.fieldList[t],s=Ce.getClonedData(n.dateMember),o=(this.parent.isDateField=Ce.isDateField(t,this.parent.engineModule),n&&n.membersOrder?n.membersOrder.slice():[]),l=void 0,d=("Out of Range"===s[0].actualText?(l=s[0],s.splice(0,1)):"Out of Range"===s[s.length-1].actualText&&(l=s[s.length-1],s.splice(s.length-1,1)),{fieldName:t,sortOrder:n.sort,members:o&&0<o.length?o:Object.keys(s),IsOrderChanged:!1}),p=!1,n=!(!n||!n.isAlphanumeric)||void 0,o=(o&&0<o.length?s=Ce.applyCustomSort(d,s,n):(o=this.parent.dataSourceSettings.groupSettings.filter(function(e){return e.name===t&&"number"===e.type.toLocaleLowerCase()}),o=!Ue.isNullOrUndefined(o)&&0<o.length,s=Ce.applyHeadersSort(s,d.sortOrder,n,o),p=!0),Ce.getFilterItemByName(t,this.parent.dataSourceSettings.filterSettings));if(Ue.isNullOrUndefined(o)||(i=!(!this.isValidFilterItemsAvail(t,o)||"Include"!==o.type),a=o.items||[]),l&&("Ascending"===d.sortOrder?"Grand Total"===s[s.length-1].actualText?s.splice(s.length-1,0,l):s.splice(s.length,0,l):"Grand Total"===s[0].actualText?s.splice(1,0,l):s.splice(0,0,l)),p){for(var h=[],u=0,c=0;u<s.length;u++)"Grand Total"!==s[u].actualText&&(h[c++]=s[u].actualText);d.members=h}this.parent.control.trigger(at,d),d.IsOrderChanged&&(s=Ce.applyCustomSort(d,s,n,!0)),r=this.getTreeData(i,s,a,t)}this.parent.filterDialog.dialogPopUp&&this.parent.filterDialog.dialogPopUp.close();o=this.parent.control.filterTargetID;Ue.isNullOrUndefined(o)&&(o="pivotfieldlist"!==this.parent.moduleName?this.parent.element:document.getElementById(this.parent.parentID+"_Container")),this.parent.filterDialog.createFilterDialog(r,t,e,o)},Hs.prototype.isValidFilterItemsAvail=function(e,t){var i=!1;if(t&&0<=["Include","Exclude"].indexOf(t.type))if("Include"===t.type&&0===t.items.length)i=!0;else for(var a=this.parent.engineModule,r=a.fieldList[e],n="olap"===this.parent.dataType?r.members:Ce.getFormattedMembers(r.members,e,a),s=0,o=t.items;s<o.length;s++)if(n[o[s]]){i=!0;break}return i},Hs.prototype.getOlapData=function(e,t){var i=[],a=(this.parent.filterDialog.isSearchEnabled=!1,this.parent.engineModule),r=Ce.getFilterItemByName(e,this.parent.dataSourceSettings.filterSettings),n=(0===a.fieldList[e].filterMembers.length?this.parent.control.loadOnDemandInMemberEditor?r&&1<r.levelCount&&1<a.fieldList[e].levels.length?a.getFilterMembers(this.parent.dataSourceSettings,e,r.levelCount):(a.fieldList[e].levelCount=1,a.getMembers(this.parent.dataSourceSettings,e)):a.getMembers(this.parent.dataSourceSettings,e,!0):(a.fieldList[e].currrentMembers={},a.fieldList[e].searchMembers=[]),a.fieldList[e].isHierarchy),s=a.fieldList[e].filterMembers;Ue.isNullOrUndefined(r)||(t=!r.type||"Include"===r.type,i=r.items||[]);for(var o={},l={},d=a.fieldList[e].members,p=0,h=i;p<h.length;p++){var u=h[p];d[l[o[u]=u]=u]&&(l=this.getParentNode(e,u,l))}return s=this.getFilteredTreeNodes(e,s,l,[]),s=this.getOlapTreeData(t,Ce.getClonedData(s),o,e,n),this.sortOlapFilterData(s,a.fieldList[e].sort)},Hs.prototype.sortOlapFilterData=function(e,t){if(0<e.length){for(var i=!1,a=[],r=0;r<e.length;r++)a.push(e[r].caption);var n=("Grand Total"!==e[0].caption||void 0===e[0].caption?e[0]:e[1]).htmlAttributes["data-fieldName"],s=this.parent.engineModule.fieldList[n],s=s&&s.membersOrder?s.membersOrder.slice():[],n={fieldName:n,sortOrder:t,members:s&&0<s.length?s:a,IsOrderChanged:!1};if(s&&0<s.length?this.applyFilterCustomSort(e,n):(e="Ascending"===t?e.sort(function(e,t){return e.caption>t.caption?1:t.caption>e.caption?-1:0}):"Descending"===t?e.sort(function(e,t){return e.caption<t.caption?1:t.caption<e.caption?-1:0}):e,i=!0),i){for(var o=[],l=0,d=0;l<e.length;l++)"Grand Total"!==e[l].caption&&(o[d++]=e[l].caption);n.members=o}this.parent.control.trigger(at,n),n.IsOrderChanged&&this.applyFilterCustomSort(e,n,!0)}return e},Hs.prototype.applyFilterCustomSort=function(e,t,i){var a,r=[],n=[],r=t.IsOrderChanged?t.members:"Ascending"===t.sortOrder||"None"===t.sortOrder||void 0===t.sortOrder?[].concat(t.members):[].concat(t.members).reverse();"Grand Total"===e[0].caption&&(a=e[0],e.shift());for(var s=0,o=0;s<e.length;s++){var l=e[s].caption;if(r[o]===l){if(e.splice(o++,0,e[s]),e.splice(++s,1),!(o<r.length)){i||n.splice(--o,0,l);break}s=-1}0<=s&&!i&&(n[s]=e[s].caption)}if(!i){for(s=n.length;s<e.length;s++)n[s]=e[s].caption;"Grand Total"===n[n.length-1]&&n.pop(),t.members=n}return a&&e.splice(0,0,a),e},Hs.prototype.getParentIDs=function(e,t,i){for(var a,r=0,n=e.fields.dataSource;r<n.length;r++){var s=n[r];if(s.id===t){a=s.pid;break}}return a&&(i.push(a),this.getParentIDs(e,a,i)),i},Hs.prototype.getChildIDs=function(e,t,i){for(var a,r=0,n=e.fields.dataSource;r<n.length;r++){var s=n[r];if(s.pid===t){a=s.id;break}}return a&&(i.push(a),this.getParentIDs(e,a,i)),i},Hs.prototype.searchTreeNodes=function(e,t,i,a){if(i){for(var r=[],n=[],s=0,o=[].slice.call(t.element.querySelectorAll("li"));s<o.length;s++){var l=o[s];(-1<l.querySelector(".e-list-text").textContent.toLowerCase().indexOf(e.value.toLowerCase())?r:n).push(l)}if(t.enableNodes(r),Ue.removeClass(r,W),t.disableNodes(n),Ue.addClass(n,W),0<r.length&&0<n.length)for(var d=0,p=r;d<p.length;d++){var h=p[d].getAttribute("data-uid"),u=this.getParentIDs(t,h,[]),c=this.getChildIDs(t,h,[]),g=[];if(0<u.length)for(var m=0,S=n;m<S.length;m++){var f=S[m];-1!==Ce.inArray(f.getAttribute("data-uid"),u)&&g.push(f)}if(0<c.length)for(var v=0,y=n;v<y.length;v++){f=y[v];-1!==Ce.inArray(f.getAttribute("data-uid"),c)&&g.push(f)}t.enableNodes(g),Ue.removeClass(g,W)}0===[].slice.call(t.element.querySelectorAll("li."+W)).length?t.collapseAll():t.expandAll(void 0,void 0,!0),this.searchListItem=r}else if(this.parent.searchTreeItems=[],"olap"!==this.parent.dataType||a){for(var r=[],b=0,b=1,C=0,x=this.parent.currentTreeItems;C<x.length;C++){var w=x[C];-1<w.name.toLowerCase().indexOf(e.value.toLowerCase())&&(this.parent.searchTreeItems.push(w),b<=this.parent.control.maxNodeLimitInMemberEditor&&r.push(w),b++)}--b>this.parent.control.maxNodeLimitInMemberEditor?(this.parent.editorLabelElement.innerText=b-this.parent.control.maxNodeLimitInMemberEditor+this.parent.control.localeObj.getConstant("editorDataLimitMsg"),this.parent.filterDialog.dialogPopUp.height=this.parent.filterDialog.allowExcelLikeFilter?"440px":"400px",this.parent.isDataOverflow=!0):(this.parent.editorLabelElement.innerText="",this.parent.filterDialog.dialogPopUp.height=this.parent.filterDialog.allowExcelLikeFilter?"400px":"350px",this.parent.isDataOverflow=!1),this.parent.isDataOverflow=b>this.parent.control.maxNodeLimitInMemberEditor,this.parent.editorLabelElement.parentElement.style.display=this.parent.isDataOverflow?"block":"none",t.fields={dataSource:r,id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},t.dataBind()}else this.updateOlapSearchTree(e,t,a)},Hs.prototype.updateOlapSearchTree=function(e,t,i){var a=[],r=this.parent.filterDialog.dialogPopUp.element.getAttribute("data-fieldname");if(""===e.value.toLowerCase()){this.parent.filterDialog.isSearchEnabled=!1,this.parent.engineModule.fieldList[r].searchMembers=[];for(var n={},s={},o=this.parent.engineModule.fieldList[r].members,l=[],d=0,p=Object.keys(o);d<p.length;d++)!o[h=p[d]].isSelected||o[h].parent&&o[o[h].parent].isSelected||l.push(h);for(var h,u=0,c=l;u<c.length;u++)o[s[n[h=c[u]]=h]=h]&&(s=this.getParentNode(r,h,s));var g=this.parent.engineModule.fieldList[r].filterMembers,a=this.getFilteredTreeNodes(r,g,s,[]);a=this.getOlapTreeData(!0,Ce.getClonedData(a),n,r,i,!0)}else{this.parent.filterDialog.isSearchEnabled=!0;g=this.parent.engineModule.fieldList[r].searchMembers;a=Ce.getClonedData(g),a=this.getOlapSearchTreeData(!0,a,r)}t.fields={dataSource:a,id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},t.dataBind()},Hs.prototype.getTreeData=function(e,t,i,a){this.parent.currentTreeItems=[],this.parent.searchTreeItems=[],this.parent.currentTreeItemsPos={},this.parent.savedTreeFilterPos={};for(var r=this.parent.engineModule,n=[],s=1,o={},l=0,d=i;l<d.length;l++){var p=d[l];o[p]=p}for(var h=a.replace(/[^a-zA-Z0-9 ]/g,"_"),u=0,c=t;u<c.length;u++){var g=c[u],m=g.actualText.toString(),m=this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(m):m,S=this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(g.actualText):g.actualText,f={id:h+"_"+s,htmlAttributes:{"data-fieldName":a,"data-memberId":S.toString()},actualText:S,name:(this.parent.isDateField?g:r.getFormattedValue(S,a)).formattedText,isSelected:!e};void 0!==o[this.parent.isDateField?g.formattedText:m]&&(f.isSelected=!!e),s<=this.parent.control.maxNodeLimitInMemberEditor&&n.push(f),f.isSelected||(this.parent.savedTreeFilterPos[s-1]=this.parent.isDateField?g.formattedText:m),this.parent.currentTreeItems.push(f),this.parent.searchTreeItems.push(f),this.parent.currentTreeItemsPos[S]={index:s-1,isSelected:f.isSelected},s++}return this.parent.isDataOverflow=s-1>this.parent.control.maxNodeLimitInMemberEditor,n},Hs.prototype.getOlapTreeData=function(e,t,i,a,r,n){for(var s=this.parent.engineModule.fieldList[a],o=(this.parent.currentTreeItems=[],this.parent.searchTreeItems=[],this.parent.currentTreeItemsPos={},[]),l=1,d=0,p=t;d<p.length;d++){var h=p[d],u=h,c=h.id.toString();n||(u.isSelected=!e),void 0!==i[c]&&(u.isSelected=!!e),!n&&h.hasChildren&&this.updateChildNodeStates(s.filterMembers,a,h.id,u.isSelected),s.members[c].isSelected=u.isSelected,s.currrentMembers&&s.currrentMembers[c]&&(s.currrentMembers[c].isSelected=u.isSelected),l<=this.parent.control.maxNodeLimitInMemberEditor&&r&&o.push(u),this.parent.currentTreeItems.push(u),this.parent.searchTreeItems.push(u),this.parent.currentTreeItemsPos[c]={index:l-1,isSelected:u.isSelected},l++}return this.parent.isDataOverflow=!!r&&l-1>this.parent.control.maxNodeLimitInMemberEditor,r?o:t},Hs.prototype.getOlapSearchTreeData=function(e,t,i){for(var a=this.parent.engineModule.fieldList[i].members,r=0,n=t;r<n.length;r++){var s=n[r],o=s.id.toString();a[o]&&(s.isSelected=a[o].isSelected),this.parent.searchTreeItems.push(s)}return t},Hs.prototype.updateChildNodeStates=function(e,t,i,a){for(var r=this.parent.engineModule.fieldList[t].members,n=this.parent.engineModule.fieldList[t].currrentMembers,s=0,o=e;s<o.length;s++){var l=o[s];l.pid&&l.pid.toString()===i&&(r[l.id].isSelected=a,n&&n[l.id]&&(n[l.id].isSelected=a),l.hasChildren)&&this.updateChildNodeStates(e,t,l.id,a)}},Hs.prototype.getParentNode=function(e,t,i){var a=this.parent.engineModule.fieldList[e].members;return a[t].parent&&t!==a[t].parent&&(i[a=a[t].parent]=a,this.getParentNode(e,a,i)),i},Hs.prototype.getFilteredTreeNodes=function(e,t,i,a){for(var r=[],n=this.parent.engineModule.fieldList[e].members,s=0,o=i?Object.keys(i):[];s<o.length;s++){var l=o[s],l=n[l]?n[l].parent:void 0;void 0!==l&&-1===Ce.inArray(l,r)&&r.push(l)}for(var d=0,p=t;d<p.length;d++){var h=p[d];Ue.isNullOrUndefined(h.pid)||-1!==Ce.inArray(h.pid,r)?(a.push(h),Ue.isNullOrUndefined(h.pid)&&-1!==Ce.inArray(h.id,r)?n[h.id].isNodeExpand=!0:Ue.isNullOrUndefined(h.pid)||-1===Ce.inArray(h.pid,r)?n[h.id].isNodeExpand=!1:(n[h.id].isNodeExpand=!1,n[h.pid].isNodeExpand=!0)):n[h.id].isNodeExpand=!1}return a};var Vs=Hs;function Hs(e){this.searchListItem=[],this.parent=e}Us.prototype.onStateModified=function(e,t){var i="",a=Ue.closest(e.target,"."+vr),r=-1;if(this.parent.dataSourceUpdate.btnElement=e.element?e.element.parentElement:void 0,a&&(i=a.classList[1]===yr?"rows":a.classList[1]===br?"columns":a.classList[1]===Cr?"values":a.classList[1]===xr?"filters":""),"olap"===this.parent.dataType||"pivot"===this.parent.dataType){var n,s,o="olap"===this.parent.dataType&&this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].isCalculatedField?this.parent.engineModule.fieldList[t].tag:t;if(e.cancel&&""===i)return!1;if(this.parent.dataSourceUpdate.btnElement&&"true"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&("filters"===i||"values"===i)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&-1<o.toLowerCase().indexOf("[measures].")&&"olap"===this.parent.dataType&&("filters"===i||"rows"===i||"columns"===i)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&"olap"===this.parent.dataType&&-1===o.toLowerCase().indexOf("[measures].")&&this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].isNamedSets&&("filters"===i||"values"===i)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&"olap"===this.parent.dataType&&-1===o.toLowerCase().indexOf("[measures].")&&"values"===i)return n=this.parent.localeObj.getConstant("warning"),s=this.parent.localeObj.getConstant("fieldDropErrorAction"),this.parent.errorDialog.createErrorDialog(n,s),!1}else if(e.cancel&&""===i||this.parent.dataSourceUpdate.btnElement&&"true"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&("filters"===i||"values"===i||-1<i.indexOf(this.parent.dataSourceSettings.valueAxis)))return!1;if(""!==i){if("olap"===this.parent.dataType||"pivot"===this.parent.dataType)if(-1<(o="olap"===this.parent.dataType&&this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].isCalculatedField?this.parent.engineModule.fieldList[t].tag:t).toLowerCase().indexOf("[measures].")&&"olap"===this.parent.dataType&&("filters"===i||"rows"===i||"columns"===i)||this.parent.engineModule.fieldList[t]&&this.parent.engineModule.fieldList[t].isNamedSets&&"filters"===i||"olap"===this.parent.dataType&&"values"===i&&-1===o.toLowerCase().indexOf("[measures]."))return n=this.parent.localeObj.getConstant("warning"),s=this.parent.localeObj.getConstant("fieldDropErrorAction"),this.parent.errorDialog.createErrorDialog(n,s),!1;if("pivot"===this.parent.dataType&&this.parent.engineModule.fieldList[t]&&"CalculatedField"===this.parent.engineModule.fieldList[t].aggregateType&&"values"!==i)return n=this.parent.localeObj.getConstant("warning"),s=this.parent.localeObj.getConstant("dropAction"),this.parent.errorDialog.createErrorDialog(n,s),!1;r=this.getButtonPosition(e.target,i)}else this.parent.engineModule.fieldList[t]&&(this.parent.engineModule.fieldList[t].isSelected=!1,"olap"===this.parent.dataType)&&this.parent.engineModule.updateFieldlistData(t);return this.parent.dataSourceUpdate.updateDataSource(t,i,r)},Us.prototype.getButtonPosition=function(e,t){var i=-1,a=Ue.closest(e,"."+Qa);if(!Ue.isNullOrUndefined(a))for(var a=a.querySelector("."+Q),e=this.parent.element.querySelector(".e-"+t),r=[].slice.call(e.querySelectorAll("."+Q)),n=0,s=r.length;n<s;n++)if(r[n].id===a.id){i=n;break}return i};var _s=Us;function Us(e){this.parent=e}Gs.prototype.updateDataSource=function(i,a,r){for(var n,s,o=this,l=-1,d=!0,e=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],t=0,p=e.length;t<p;t++)if(e[t])for(var h=0,u=e[t].length;h<u;h++)(e[t][h].name===i||"olap"===this.parent.dataType&&"[measures]"===e[t][h].name.toLowerCase()&&e[t][h].name.toLowerCase()===i)&&(s=0===t?"rows":1===t?"columns":2===t?"values":"filters",l=h),s=s||"fieldList";var c={fieldName:i,dropField:Ce.getFieldInfo(i,this.control).fieldItem,dataSourceSettings:Ce.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:a,dropPosition:r,draggedAxis:s,cancel:!1},g="pivotfieldlist"===this.control.getModuleName()&&this.control.isPopupView?this.control.pivotGridModule:this.control;return g.trigger(H,c,function(e){if(e.cancel)d=!1;else{var t;if(a=e.dropAxis,r=e.dropPosition,i=e.dropField?e.dropField.name:e.fieldName,n=e.dropField,o.control&&o.btnElement&&"true"===o.btnElement.getAttribute("isvalue"))switch(a){case"":o.control.setProperties({dataSourceSettings:{values:[]}},!0);break;case"rows":r=r===o.parent.dataSourceSettings.rows.length?-1:r,o.control.setProperties({dataSourceSettings:{valueAxis:"row",valueIndex:r}},!0);break;case"columns":r=r===o.parent.dataSourceSettings.columns.length?-1:r,o.control.setProperties({dataSourceSettings:{valueAxis:"column",valueIndex:r}},!0)}else o.removeFieldFromReport(i.toString()),"pivot"===o.parent.dataType&&o.control.showValuesButton&&1<o.parent.dataSourceSettings.values.length&&(t="row"===o.parent.dataSourceSettings.valueAxis&&"rows"===a?o.parent.dataSourceSettings.rows:"column"===o.parent.dataSourceSettings.valueAxis&&"columns"===a?o.parent.dataSourceSettings.columns:void 0,l<o.parent.dataSourceSettings.valueIndex&&("row"===o.parent.dataSourceSettings.valueAxis&&"rows"===s||"column"===o.parent.dataSourceSettings.valueAxis&&"columns"===s)&&o.control.setProperties({dataSourceSettings:{valueIndex:o.parent.dataSourceSettings.valueIndex-1}},!0),Ue.isNullOrUndefined(t)||(-1===r&&-1===o.parent.dataSourceSettings.valueIndex?o.control.setProperties({dataSourceSettings:{valueIndex:t.length}},!0):-1<r&&r<=o.parent.dataSourceSettings.valueIndex?o.control.setProperties({dataSourceSettings:{valueIndex:o.parent.dataSourceSettings.valueIndex+1}},!0):-1<o.parent.dataSourceSettings.valueIndex&&r>o.parent.dataSourceSettings.valueIndex&&(r-=1))),"CalculatedField"===(n=o.getNewField(i.toString(),e.dropField)).type&&""!==a&&(a="values");"olap"===o.parent.dataType&&(o.removeFieldFromReport(i.toString()),n=o.getNewField(i.toString(),e.dropField),0===o.parent.dataSourceSettings.values.length&&o.removeFieldFromReport("[measures]"),"CalculatedField"===n.type)&&""!==a&&(a="values"),o.control&&(t={fieldName:i,droppedField:n,dataSourceSettings:Ce.getClonedDataSourceSettings(o.parent.dataSourceSettings),droppedAxis:a,droppedPosition:r},g.trigger(q,t,function(e){if(n=e.droppedField){switch(r=e.droppedPosition,a=e.droppedAxis){case"filters":-1!==r?o.parent.dataSourceSettings.filters.splice(r,0,n):o.parent.dataSourceSettings.filters.push(n);break;case"rows":-1!==r?o.parent.dataSourceSettings.rows.splice(r,0,n):o.parent.dataSourceSettings.rows.push(n);break;case"columns":-1!==r?o.parent.dataSourceSettings.columns.splice(r,0,n):o.parent.dataSourceSettings.columns.push(n);break;case"values":-1!==r?o.parent.dataSourceSettings.values.splice(r,0,n):o.parent.dataSourceSettings.values.push(n),"olap"!==o.parent.dataType||o.parent.engineModule.isMeasureAvail||1<o.parent.dataSourceSettings.values.length||("row"===o.parent.dataSourceSettings.valueAxis?o.parent.dataSourceSettings.rows:o.parent.dataSourceSettings.columns).push({name:"[Measures]",caption:"Measures",showRemoveIcon:!0,allowDragAndDrop:!0})}e="columns"===a?g.dataSourceSettings.columns.length:"rows"===a?g.dataSourceSettings.rows.length:0;0!==e&&g.dataSourceSettings.valueIndex===e&&o.control.setProperties({dataSourceSettings:{valueIndex:-1}},!0)}}))}}),d},Gs.prototype.removeFieldFromReport=function(e){for(var t=!1,i=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],a=this.parent.engineModule.fieldList[e],r=0,n=i.length;r<n;r++)if(!t&&i[r])for(var s,o,l=0,d=i[r].length;l<d;l++)if(i[r][l].name===e||"olap"===this.parent.dataType&&"[measures]"===i[r][l].name.toLowerCase()&&i[r][l].name.toLowerCase()===e){(o=i[r][l].properties||i[r][l]).type=a&&"number"===a.type?o.type:"Count",i[r].splice(l,1),"olap"===this.parent.dataType&&(s=this.parent.engineModule)&&s.fieldList[e]&&(s.fieldList[e].currrentMembers={},s.fieldList[e].searchMembers=[]),t=!0;break}return o},Gs.prototype.getNewField=function(e,t){var i;return"olap"===this.parent.dataType?(i=this.parent.engineModule.fieldList[e],{name:t?t.name:e,caption:(t||i).caption,isNamedSet:t?t.isNamedSet:i.isNamedSets,isCalculatedField:(t||i).isCalculatedField,type:t?void 0===t.type?"number"===i.type?"Sum":"Count":t.type:void 0===i.aggregateType?"number"===i.type?"Sum":"Count":i.aggregateType,showFilterIcon:(t||i).showFilterIcon,showSortIcon:(t||i).showSortIcon,showEditIcon:(t||i).showEditIcon,showRemoveIcon:(t||i).showRemoveIcon,showValueTypeIcon:(t||i).showValueTypeIcon,allowDragAndDrop:(t||i).allowDragAndDrop,showSubTotals:(t||i).showSubTotals,expandAll:(t||i).expandAll}):(i=this.parent.engineModule.fieldList[e],{name:t?t.name:e,caption:(t||i).caption,type:t?void 0===t.type||null===t.type?"number"===i.type?"Sum":"Count":t.type:void 0===i.aggregateType||null===i.aggregateType?"number"===i.type?"Sum":"Count":i.aggregateType,showNoDataItems:(t||i).showNoDataItems,baseField:(t||i).baseField,baseItem:(t||i).baseItem,allowDragAndDrop:(t||i).allowDragAndDrop,showSubTotals:(t||i).showSubTotals,showFilterIcon:(t||i).showFilterIcon,showSortIcon:(t||i).showSortIcon,showEditIcon:(t||i).showEditIcon,showRemoveIcon:(t||i).showRemoveIcon,showValueTypeIcon:(t||i).showValueTypeIcon,expandAll:(t||i).expandAll})};var Bs=Gs;function Gs(e){this.parent=e}Ws.prototype.createErrorDialog=function(e,t){var i=Ue.createElement("div",{id:this.parent.parentID+"_ErrorDialog",className:fr});this.parent.element.appendChild(i),this.errorPopUp=new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!1,header:e,content:t,isModal:!0,visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:this.closeErrorDialog.bind(this),isFlat:!1,buttonModel:{cssClass:mr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}}],cssClass:this.parent.cssClass,closeOnEscape:!0,target:document.body,close:this.removeErrorDialog.bind(this)}),this.errorPopUp.isStringTemplate=!0,this.errorPopUp.appendTo(i)},Ws.prototype.closeErrorDialog=function(){this.errorPopUp.close()},Ws.prototype.removeErrorDialog=function(){this.errorPopUp&&!this.errorPopUp.isDestroyed&&(this.errorPopUp.destroy(),this.errorPopUp=null),document.getElementById(this.parent.parentID+"_ErrorDialog")&&Ue.remove(document.getElementById(this.parent.parentID+"_ErrorDialog"))};var zs=Ws;function Ws(e){this.parent=e}Ys.prototype.createFilterDialog=function(t,i,a,e){var r=this,n=Ue.createElement("div",{id:this.parent.parentID+"_EditorTreeView",className:"e-member-editor-dialog "+("olap"===this.parent.dataType?"e-olap-editor-dialog":"")+(this.parent.isDataOverflow?" "+Ms:""),attrs:{"data-fieldName":i,"aria-label":a}}),s=this.parent.engineModule.fieldList[i].caption,o=this.parent.localeObj.getConstant("filter")+' "'+a+'" '+this.parent.localeObj.getConstant("by"),o=(this.filterObject=this.getFilterObject(i),this.isSearchEnabled=!1,this.allowExcelLikeFilter=this.isExcelFilter(i),this.parent.element.appendChild(n),this.dialogPopUp=new P.Dialog({animationSettings:{effect:this.allowExcelLikeFilter?"None":"Fade"},allowDragging:!1,header:this.allowExcelLikeFilter?o:s,content:"",isModal:!0,visible:!0,showCloseIcon:!!this.allowExcelLikeFilter,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"320px",height:this.parent.isDataOverflow?this.allowExcelLikeFilter?"440px":"400px":this.allowExcelLikeFilter?"400px":"350px",position:{X:"center",Y:"center"},buttons:[{isFlat:!1,buttonModel:{cssClass:"e-clear-filter-button"+(this.allowExcelLikeFilter?"":" "+W)+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:"e-icons e-clear-filter-icon",enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("clearFilter"),disabled:!this.filterObject}},{isFlat:!1,buttonModel:{cssClass:mr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:this.closeFilterDialog.bind(this),isFlat:!1,buttonModel:{cssClass:Sr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:"Popup"!==this.parent.renderMode,target:e,cssClass:this.parent.cssClass,close:this.removeFilterDialog.bind(this)}),this.dialogPopUp.isStringTemplate=!0,this.dialogPopUp.appendTo(n),{cancel:!1,fieldName:i,fieldMembers:this.parent.dataSourceSettings.allowMemberFilter?t:[],filterSetting:this.filterObject});("pivotfieldlist"===this.parent.moduleName&&this.parent.control.isPopupView?this.parent.control.pivotGridModule:this.parent.control).trigger(ht,o,function(e){e.cancel?(r.dialogPopUp.close(),r.dialogPopUp=void 0):(t=e.fieldMembers,r.allowExcelLikeFilter?(r.createTabMenu(t,a,i),Ue.addClass([r.dialogPopUp.element],"e-excel-filter")):r.dialogPopUp.content=r.createTreeView(t,a,i),r.updateCheckedState(),Ue.setStyleAttribute(r.dialogPopUp.element,{visibility:"visible"}),r.allowExcelLikeFilter&&r.dialogPopUp.element.querySelector(".e-dlg-closeicon-btn").focus(),r.memberTreeView.nodeChecked=r.parent.control.pivotButtonModule.nodeStateModified.bind(r.parent.control.pivotButtonModule),r.allMemberSelect.nodeChecked=r.parent.control.pivotButtonModule.nodeStateModified.bind(r.parent.control.pivotButtonModule))})},Ys.prototype.createTreeView=function(e,t,i){var a=this,r=Ue.createElement("div",{id:this.parent.parentID+"EditorDiv",className:or+(this.allowExcelLikeFilter?" e-excelfilter":"")}),n=Ue.createElement("button",{id:this.parent.parentID+"_LevelDiv",className:"e-level-container-class",attrs:{type:"button"}}),s=Ue.createElement("div",{id:this.parent.parentID+"_SearchDiv",attrs:{tabindex:"-1"},className:on}),o=this.parent.engineModule.fieldList[i].caption,l=Ue.createElement("input",{attrs:{type:"text",className:"e-editor-search-input"}}),d=this.parent.isDataOverflow?this.parent.currentTreeItems.length-this.parent.control.maxNodeLimitInMemberEditor+this.parent.control.localeObj.getConstant("editorDataLimitMsg"):"",p=Ue.createElement("div",{id:this.parent.parentID+"_LabelDiv",attrs:{tabindex:"-1",title:d},className:"e-editor-label-container"}),d=(this.parent.editorLabelElement=Ue.createElement("label",{className:"e-editor-label"}),this.parent.editorLabelElement.innerText=d,p.style.display=this.parent.isDataOverflow?"block":"none",p.appendChild(this.parent.editorLabelElement),s.appendChild(l),this.createSortOptions(i,s,e),Ue.createElement("div",{id:this.parent.parentID+"_AllDiv",attrs:{tabindex:"-1"},className:"e-select-all-container"})),h=Ue.createElement("div",{id:this.parent.parentID+"_SelectAllContainer",className:dn}),u=Ue.createElement("div",{className:lr+"-outer-div"}),c=Ue.createElement("div",{className:lr}),g=Ue.createElement("div",{className:En+" "+W}),n=(g.innerText=this.parent.localeObj.getConstant("noMatches"),"olap"!==this.parent.dataType||!this.parent.control.loadOnDemandInMemberEditor||this.parent.engineModule.fieldList[i].isHierarchy||this.parent.engineModule.fieldList[i].isNamedSets||(s.appendChild(n),this.createLevelWrapper(n,i)),d.appendChild(h),r.appendChild(s),r.appendChild(d),r.appendChild(g),this.editorSearch=new V.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("search")+" “"+o+"“",enableRtl:this.parent.enableRtl,cssClass:ln+(this.parent.cssClass?" "+this.parent.cssClass:""),showClearButton:!0,change:function(e){"olap"===a.parent.dataType?a.searchOlapTreeView(e,g):(a.parent.eventBase.searchTreeNodes(e,a.memberTreeView,!1),e=a.dialogPopUp.element,0===[].slice.call(a.memberTreeView.element.querySelectorAll("li")).length?(a.allMemberSelect.disableNodes([a.allMemberSelect.element.querySelector("li")]),e.querySelector("."+mr).setAttribute("disabled","disabled"),Ue.removeClass([g],W)):(a.allMemberSelect.enableNodes([a.allMemberSelect.element.querySelector("li")]),e.querySelector("."+mr).removeAttribute("disabled"),Ue.addClass([g],W)),a.updateCheckedState())}}),this.editorSearch.isStringTemplate=!0,this.editorSearch.appendTo(l),{"data-fieldName":i,"data-memberId":"all"}),s=[{id:"all",name:this.parent.localeObj.getConstant("all"),isSelected:!0,htmlAttributes:n}];if(this.allMemberSelect=new O.TreeView({fields:{dataSource:s,id:"id",text:"name",isChecked:"isSelected"},showCheckBox:!0,expandOn:"None",enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,nodeClicked:this.nodeCheck.bind(this,!0),keyPress:this.nodeCheck.bind(this,!0),nodeSelected:function(e){Ue.removeClass([e.node],"e-active"),e.cancel=!0},cssClass:this.parent.cssClass}),this.allMemberSelect.isStringTemplate=!0,!Ue.isNullOrUndefined(this.parent.currentTreeItems))for(var m=0;m<this.parent.currentTreeItems.length;m++)!this.parent.currentTreeItems[m].id.indexOf("\n")&&0!==this.parent.currentTreeItems[m].id.indexOf("\n")||(this.parent.currentTreeItems[m].id=this.parent.currentTreeItems[m].id.replace("\n"," "));return this.allMemberSelect.appendTo(h),u.appendChild(c),r.appendChild(u),this.memberTreeView=new O.TreeView({fields:{dataSource:e,id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},showCheckBox:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,nodeChecking:this.validateTreeNode.bind(this),nodeClicked:this.nodeCheck.bind(this,!1),keyPress:this.nodeCheck.bind(this,!1),nodeExpanding:this.updateChildNodes.bind(this),nodeSelected:function(e){Ue.removeClass([e.node],"e-active"),e.cancel=!0},expandOn:"None",cssClass:this.parent.cssClass}),this.memberTreeView.isStringTemplate=!0,this.memberTreeView.appendTo(c),this.parent.isDataOverflow&&this.parent.control.maxNodeLimitInMemberEditor<this.parent.currentTreeItems.length&&r.appendChild(p),r},Ys.prototype.createSortOptions=function(e,t,i){var a,r;"pivot"===this.parent.dataType&&i&&0<i.length&&(i=this.parent.engineModule.fieldList[e].sort,a=Ue.createElement("div",{className:Wr+" e-btn-group"+(this.parent.enableRtl?" "+xa:"")+(this.parent.cssClass?" "+this.parent.cssClass:""),id:this.parent.element.id+"_Member_Sort"}),this.parent.element.appendChild(a),r=Ue.createElement("button",{className:("Ascending"===i?Kr+" ":"")+Ja,id:this.parent.element.id+"_Sort_Ascend",attrs:{type:"button","aria-label":"button"}}),i=Ue.createElement("button",{className:("Descending"===i?Kr+" ":"")+Ja,id:this.parent.element.id+"_Sort_Descend",attrs:{type:"button","aria-label":"button"}}),new Y.Button({iconCss:z+" "+Qr,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}).appendTo(r),new Y.Button({iconCss:z+" "+Yr,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}).appendTo(i),a.appendChild(r),a.appendChild(i),t.appendChild(a),this.unWireEvent(r),this.unWireEvent(i),this.wireEvent(r,e),this.wireEvent(i,e))},Ys.prototype.createLevelWrapper=function(e,n){for(var s=this,t=this.parent.engineModule,i=t.fieldList[n].levels,t=t.fieldList[n].levelCount,o=[],a=0,r=i.length;a<r;a++)o.push({id:i[a].id,text:i[a].name});this.dropMenu=new E.DropDownButton({cssClass:"e-level-drop e-caret-hide"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:o,iconCss:"e-icons e-dropdown-icon",disabled:t===i.length,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeOpen:function(e){var t=[].slice.call(e.element.querySelectorAll("li")),i=s.parent.engineModule.fieldList[n].levelCount;Ue.removeClass(t,b);for(var a=0,r=t.length;a<r;a++)a<i&&Ue.addClass([t[a]],b)},select:function(e){for(var t,i=s.dialogPopUp.element.getAttribute("data-fieldname"),a=s.parent.engineModule,r=0,n=o.length;r<n;r++)o[r].id===e.item.id&&(t=r);a.getFilterMembers(s.parent.dataSourceSettings,i,t+1,!1,!0)},close:function(){var e=s.parent.engineModule,t=e.fieldList[n].levels;e.fieldList[n].levelCount===t.length?(s.dropMenu.disabled=!0,s.dropMenu.dataBind()):s.dropMenu.disabled=!1}}),this.dropMenu.appendTo(e)},Ys.prototype.searchOlapTreeView=function(n,s){var o=this;clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){var e,t=o.parent.engineModule,i=o.dialogPopUp.element,a=i.getAttribute("data-fieldname"),r=o.parent.control.maxNodeLimitInMemberEditor||5e3;t.fieldList[a].isHierarchy?o.parent.eventBase.searchTreeNodes(n,o.memberTreeView,!1,!0):(o.dropMenu&&""!==n.value?o.dropMenu.disabled=!0:o.dropMenu.disabled=!1,o.parent.control.loadOnDemandInMemberEditor?(e=t.fieldList[a].levelCount||1,t.getSearchMembers(o.parent.dataSourceSettings,a,n.value.toLowerCase(),r,!1,e)):t.getSearchMembers(o.parent.dataSourceSettings,a,n.value.toLowerCase(),r,!0),o.parent.eventBase.searchTreeNodes(n,o.memberTreeView,!1,!1)),0===[].slice.call(o.memberTreeView.element.querySelectorAll("li")).length?(o.allMemberSelect.disableNodes([o.allMemberSelect.element.querySelector("li")]),i.querySelector("."+mr).setAttribute("disabled","disabled"),Ue.removeClass([s],W)):(o.allMemberSelect.enableNodes([o.allMemberSelect.element.querySelector("li")]),i.querySelector("."+mr).removeAttribute("disabled"),Ue.addClass([s],W)),o.updateCheckedState()},500)},Ys.prototype.nodeCheck=function(e,t){var i,a=[t.node];t.event.target.classList.contains("e-fullrow")||"Enter"===t.event.key?"true"===(i=e?this.allMemberSelect:this.memberTreeView).getNode(t.node).isChecked?i.uncheckAll(a):i.checkAll(a):38!==t.event.keyCode||e||(Ue.removeClass(this.memberTreeView.element.querySelectorAll("li.e-prev-active-node"),"e-prev-active-node"),Ue.addClass(a,"e-prev-active-node"))},Ys.prototype.applySorting=function(e,t){var i,t=Ue.closest(t.target,"."+Ja);t&&(i=[].slice.call(Ue.closest(t,"."+Wr).querySelectorAll("."+Ja)),t.querySelector("."+Qr)&&!t.classList.contains(Kr)?(this.updateFilterMembers("Ascending",e),Ue.addClass([t],Kr),Ue.removeClass([i[1]],Kr)):t.querySelector("."+Yr)&&!t.classList.contains(Kr)?(this.updateFilterMembers("Descending",e),Ue.addClass([t],Kr),Ue.removeClass([i[0]],Kr)):(this.updateFilterMembers("None",e),Ue.removeClass(i,Kr)))},Ys.prototype.updateFilterMembers=function(e,t){var i=this.parent.engineModule.fieldList[t],a="None"===e?Ce.getClonedData(i.dateMember):this.parent.currentTreeItems.slice(),r=!!i.isAlphanumeric||void 0,n=!1,i=i&&i.membersOrder?i.membersOrder.slice():[],s={fieldName:t,sortOrder:e,members:i&&0<i.length?i:Object.keys(a),IsOrderChanged:!1},i=(i&&0<i.length?a=Ce.applyCustomSort(s,a,r):(i=this.parent.dataSourceSettings.groupSettings.filter(function(e){return e.name===t&&"number"===e.type.toLocaleLowerCase()}),i=!Ue.isNullOrUndefined(i)&&0<i.length,a=Ce.applyHeadersSort(a,s.sortOrder,r,i),n=!0),"pivotfieldlist"===this.parent.moduleName&&this.parent.control.isPopupView?this.parent.control.pivotGridModule:this.parent.control);if(n){for(var o=[],l=0,d=0;l<a.length;l++)"Grand Total"!==a[l].actualText&&(o[d++]=a[l].actualText);s.members=o}i.trigger(at,s),s.IsOrderChanged&&(a=Ce.applyCustomSort(s,a,r,!0)),this.parent.currentTreeItems=[],this.parent.searchTreeItems=[];for(var p,h=[],u=t.replace(/[^a-zA-Z0-9 ]/g,"_"),c=this.parent.engineModule,g=0,m=a.length;g<m;g++)"None"===e?(p=a[g].actualText.toString(),p={id:u+"_"+(g+1),htmlAttributes:{"data-fieldName":t,"data-memberId":p},actualText:a[g].actualText,name:(this.parent.isDateField?a[g]:c.getFormattedValue(p,t)).formattedText,isSelected:this.parent.currentTreeItemsPos[a[g].actualText].isSelected},this.parent.currentTreeItems.push(p),(""===this.editorSearch.value||-1<p.name.toLowerCase().indexOf(this.editorSearch.value.toLowerCase()))&&(this.parent.searchTreeItems.push(p),h.push(p))):(this.parent.currentTreeItems.push(a[g]),(""===this.editorSearch.value||-1<a[g].name.toLowerCase().indexOf(this.editorSearch.value.toLowerCase()))&&(this.parent.searchTreeItems.push(a[g]),h.push(a[g]))),this.parent.currentTreeItemsPos[a[g].actualText].index=g;n=this.memberTreeView.fields.dataSource.length;this.memberTreeView.fields={dataSource:h.slice(0,n),id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},this.memberTreeView.dataBind()},Ys.prototype.updateChildNodes=function(e){if("olap"===this.parent.dataType){var t=this.parent.engineModule,i=e.node.getAttribute("data-fieldname"),a=t.fieldList[i],r=[];if(a&&0<a.filterMembers.length&&!this.isSearchEnabled&&!a.members[e.nodeData.id].isNodeExpand){for(var n=[],s=0,o=a.filterMembers;s<o.length;s++){var l=o[s];l.pid===e.nodeData.id.toString()&&n.push(l)}0===n.length&&(a.childMembers=[],t.getChildMembers(this.parent.dataSourceSettings,e.nodeData.id.toString(),i),n=a.childMembers,a.childMembers=[]);var d=Ce.getClonedData(n),p=this.memberTreeView.fields.dataSource,h=!1;Ue.isNullOrUndefined(this.filterObject)||(h="Include"===this.filterObject.type,r=this.filterObject.items||[]),d=this.updateChildData(h,d,r,i,e.nodeData);for(var u=0,c=d=this.parent.eventBase.sortOlapFilterData(d,t.fieldList[i].sort);u<c.length;u++){var g=c[u];p.push(g)}a.members[e.nodeData.id].isNodeExpand=!0,this.memberTreeView.addNodes(d,e.node)}}},Ys.prototype.updateChildData=function(e,t,i,a,r){for(var n=Object.keys(this.parent.currentTreeItemsPos).length,s=this.parent.engineModule.fieldList[a],o=[],l=1,d=0,p=t;d<p.length;d++){var h=p[d],u=h,c=h.id.toString();s.members[c].isNodeExpand=!1,h.isSelected="true"===r.isChecked,l<=this.parent.control.maxNodeLimitInMemberEditor&&o.push(u),this.parent.currentTreeItems.push(u),this.parent.searchTreeItems.push(u),this.parent.currentTreeItemsPos[c]={index:n,isSelected:u.isSelected},n++,l++}return this.parent.isDataOverflow=!1,o},Ys.prototype.createTabMenu=function(e,t,i){for(var a=Ue.createElement("div",{id:this.parent.parentID+"_FilterTabContainer",className:"e-filter-tab-container",attrs:{tabindex:"-1"}}),r=(this.dialogPopUp.content=a,this.dialogPopUp.dataBind(),["Label","Value","Include","Exclude"]),n="((-|\\+)?[0-9]+(\\.[0-9]+)?)+",s=Object.keys(this.parent.engineModule.fieldList[i].members)[0],o=this.parent.engineModule.fieldList[i].type,l=Ce.getFieldByName(i,this.parent.dataSourceSettings.formatSettings),d=[{header:{text:this.parent.localeObj.getConstant("member"),iconCss:this.filterObject&&1<r.indexOf(this.filterObject.type)?Hr:""},content:this.createTreeView(e,t,i)}],p=0,h=r;p<h.length;p++){var u=h[p];("Label"===u&&this.parent.dataSourceSettings.allowLabelFilter||"Value"===u&&this.parent.dataSourceSettings.allowValueFilter)&&(u={header:{text:"Number"===(u="Label"===u&&s&&s.match(n)&&s.match(n)[0].length===s.length&&"number"===o?"Number":"Label"===u&&s&&"Invalid Date"!==new Date(s).toString()&&(l&&l.type||this.filterObject&&"Date"===this.filterObject.type)?"Date":u)?this.parent.localeObj.getConstant("label"):this.parent.localeObj.getConstant(u.toLowerCase()),iconCss:this.filterObject&&this.filterObject.type===u?Hr:""},content:this.createCustomFilter(i,this.filterObject&&this.filterObject.type===u?this.filterObject:void 0,u.toLowerCase())},d.push(u))}e=this.filterObject?0<=["Label","Date","Number"].indexOf(this.filterObject.type)?1:"Value"===this.filterObject.type?this.parent.dataSourceSettings.allowLabelFilter&&this.parent.dataSourceSettings.allowValueFilter?2:1:0:0,e=this.parent.dataSourceSettings.allowMemberFilter||0!=e?e:1;this.tabObj=new O.Tab({heightAdjustMode:"Auto",items:d,height:"100%",selectedItem:e,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass}),this.tabObj.isStringTemplate=!0,this.tabObj.appendTo(a),this.parent.dataSourceSettings.allowMemberFilter||this.tabObj.hideTab(0),0<e&&Ue.addClass([this.dialogPopUp.element.querySelector(".e-filter-div-content."+(1==e&&this.parent.dataSourceSettings.allowLabelFilter?"e-label-filter":"e-value-filter"))],"e-selected-tab")},Ys.prototype.createCustomFilter=function(e,t,i){for(var a=[],r=[],n=[],s=this.parent.dataSourceSettings.values,o="DoesNotEquals",l=0,d=0,p={label:["Equals","DoesNotEquals","BeginWith","DoesNotBeginWith","EndsWith","DoesNotEndsWith","Contains","DoesNotContains","GreaterThan","GreaterThanOrEqualTo","LessThan","LessThanOrEqualTo","Between","NotBetween"],date:["Equals","DoesNotEquals","Before","BeforeOrEqualTo","After","AfterOrEqualTo","Between","NotBetween"],value:["Equals","DoesNotEquals","GreaterThan","GreaterThanOrEqualTo","LessThan","LessThanOrEqualTo","Between","NotBetween"]},h=["Between","NotBetween"],u="label"===i?p.label:"date"===i?p.date:p.value,c=0,g=u;c<g.length;c++){var m=g[c],o=t&&m===t.condition?0<=u.indexOf(t.condition)?t.condition:u[0]:o;a.push({value:m,text:this.parent.localeObj.getConstant(m)})}for(var S=s.length;S--;)r.unshift({value:s[S].name,text:s[S].caption||s[S].name}),l=t&&"Value"===t.type&&t.measure===s[S].name&&t.condition===o?S:l;if("olap"===this.parent.dataType){var p=this.parent.engineModule,f=p.fieldList[e].levels;if(this.parent.engineModule.fieldList[e].isHierarchy){for(var v=void 0,y=0,b=this.parent.engineModule.fieldListData;y<b.length;y++){var C=b[y];if(C&&C.pid===e){v=C;break}}n.push({value:v?v.id:e,text:v?v.caption:p.fieldList[e].name}),d=0,t&&t.name===e&&t.type.toLowerCase()===i&&(n[n.length-1].iconClass=z+" "+_r)}else for(var x=0,k=f.length;x<k;x++){d=t&&t.selectedField===f[x].id?x:d,n.push({value:f[x].id,text:f[x].name});for(var w=0,T=this.parent.dataSourceSettings.filterSettings;w<T.length;w++){var M=T[w];if(M.name===e&&M.selectedField===f[x].id&&M.type.toLowerCase()===i){n[n.length-1].iconClass=z+" "+_r;break}}}}var p=Ue.createElement("div",{className:"e-filter-div-content e-"+(0<=["date","number"].indexOf(i)?"label":i)+"-filter"+(this.parent.isDataOverflow?" "+Ms:""),id:this.parent.parentID+"_"+i+"_filter_div_content",attrs:{"data-type":i,"data-fieldName":e,"data-operator":o,"data-selectedField":"olap"===this.parent.dataType&&0<n.length?n[d].value.toString():"","data-measure":0<this.parent.dataSourceSettings.values.length?this.parent.dataSourceSettings.values[l].name:"","data-value1":t&&o===t.condition&&t.value1?t.value1.toString():"","data-value2":t&&o===t.condition&&t.value2?t.value2.toString():""}}),D=Ue.createElement("div",{className:"e-filter-text-div"}),O=(D.innerText=this.parent.localeObj.getConstant(i+"TextContent"),Ue.createElement("div",{className:Ur+" "+(-1===h.indexOf(o)?W:"")})),P=(O.innerText=this.parent.localeObj.getConstant("And"),Ue.createElement("div",{className:"e-separator-div"})),N=Ue.createElement("div",{className:"e-filter-option-container-1"}),E=Ue.createElement("div",{className:"e-level-option-container "+("olap"===this.parent.dataType?"":W)}),F=Ue.createElement("div",{className:"e-measure-option-container "+(0<=["label","date","number"].indexOf(i)?W:"")}),I=Ue.createElement("div",{className:"e-condition-option-container"}),L=Ue.createElement("div",{className:"e-filter-option-container-2"}),A=Ue.createElement("div",{id:this.parent.parentID+"_"+i+"_level_option_container"}),R=Ue.createElement("div",{id:this.parent.parentID+"_"+i+"_measure_option_container"}),j=Ue.createElement("div",{id:this.parent.parentID+"_"+i+"_contition_option_container"}),q=Ue.createElement("div",{className:"e-filter-input-div-1"}),V=Ue.createElement("div",{className:Br+" "+(-1===h.indexOf(o)?W:"")}),H=Ue.createElement("input",{id:this.parent.parentID+"_"+i+"_input_option_1",attrs:{type:"text"}}),_=Ue.createElement("input",{id:this.parent.parentID+"_"+i+"_input_option_2",attrs:{type:"text"}});return q.appendChild(H),V.appendChild(_),E.appendChild(A),E.appendChild(P.cloneNode(!0)),F.appendChild(R),F.appendChild(P),I.appendChild(j),N.appendChild(E),N.appendChild(F),N.appendChild(I),L.appendChild(q),L.appendChild(O),L.appendChild(V),this.createElements(t,h,R,j,H,_,r,a,l,o,i,A,n,d),p.appendChild(D),p.appendChild(N),p.appendChild(L),p},Ys.prototype.createElements=function(e,n,t,i,p,h,u,a,r,s,o,l,d,c){var g,m,S,f,v,y,b=this,C=("olap"===this.parent.dataType&&((d=new G.DropDownList({dataSource:d,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text",iconCss:"iconClass"},index:c,cssClass:"e-level-options"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var t,i=b.dialogPopUp.element.querySelector(".e-selected-tab"),a=i.getAttribute("data-fieldName"),r=i.getAttribute("data-type");if(!Ue.isNullOrUndefined(i)){b.updateInputValues(i,r,p,h),w.setStyleAndAttributes(i,{"data-selectedField":e.value});for(var n,s,o=0,l=b.parent.dataSourceSettings.filterSettings;o<l.length;o++){var d=l[o];if(d.name===a&&d.selectedField===e.value){t=d;break}}t&&("value"===r&&t.measure&&""!==t.measure&&(C.value=t.measure||u[0].value),t.condition?x.value=t.condition||"DoesNotEquals":x.value="DoesNotEquals",s=n=void 0,"value"===r?(n=Ue.getInstance(p,V.NumericTextBox),s=Ue.getInstance(h,V.NumericTextBox),n&&(n.value=t.value1?parseInt(t.value1,10):void 0),s&&(s.value=t.value2?parseInt(t.value2,10):void 0)):(n=Ue.getInstance(p,V.MaskedTextBox),s=Ue.getInstance(h,V.MaskedTextBox),n&&(n.value=t.value1||""),s&&(s.value=t.value2||""))),b.updateInputValues(i,r,p,h)}}})).isStringTemplate=!0,d.appendTo(l)),new G.DropDownList({dataSource:u,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text"},index:r,cssClass:Gr+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");Ue.isNullOrUndefined(t)||(b.updateInputValues(t,o,p,h),w.setStyleAndAttributes(t,{"data-measure":e.value}))}})),x=(C.isStringTemplate=!0,C.appendTo(t),new G.DropDownList({dataSource:a,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text"},value:s,cssClass:zr+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");if(!Ue.isNullOrUndefined(t)){b.updateInputValues(t,o,p,h);for(var i=0,a=[Ur,Br];i<a.length;i++){var r=a[i];0<=n.indexOf(e.value)?Ue.removeClass([t.querySelector("."+r)],W):Ue.addClass([t.querySelector("."+r)],W)}w.setStyleAndAttributes(t,{"data-operator":e.value})}}}));x.isStringTemplate=!0,x.appendTo(i),("date"===o?(g=new N.DateTimePicker({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,format:"dd/MM/yyyy hh:mm:ss a",showClearButton:!0,value:e&&s===e.condition?"string"==typeof e.value1?new Date(e.value1):e.value1:null,change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");Ue.isNullOrUndefined(t)||w.setStyleAndAttributes(t,{"data-value1":e.value,"data-value2":m.value})},width:"100%",cssClass:this.parent.cssClass}),m=new N.DateTimePicker({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,format:"dd/MM/yyyy hh:mm:ss a",showClearButton:!0,value:e&&s===e.condition?"string"==typeof e.value2?new Date(e.value2):e.value2:null,change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");Ue.isNullOrUndefined(t)||w.setStyleAndAttributes(t,{"data-value1":g.value,"data-value2":e.value})},width:"100%",cssClass:this.parent.cssClass}),g.isStringTemplate=!0,g.appendTo(p),m.isStringTemplate=!0,m):"value"===o?(S=new V.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,format:"###.##",value:e&&s===e.condition?parseInt(e.value1,10):void 0,change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");Ue.isNullOrUndefined(t)||w.setStyleAndAttributes(t,{"data-value1":e.value?e.value.toString():"0","data-value2":f.value?f.value.toString():"0"})},width:"100%",cssClass:this.parent.cssClass}),f=new V.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,format:"###.##",value:e&&s===e.condition?parseInt(e.value2,10):void 0,change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");Ue.isNullOrUndefined(t)||w.setStyleAndAttributes(t,{"data-value1":S.value?S.value.toString():"0","data-value2":e.value?e.value.toString():"0"})},width:"100%",cssClass:this.parent.cssClass}),S.isStringTemplate=!0,S.appendTo(p),f.isStringTemplate=!0,f):(v=new V.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,value:e&&s===e.condition?e.value1:"",change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");Ue.isNullOrUndefined(t)||w.setStyleAndAttributes(t,{"data-value1":e.value,"data-value2":y.value})},width:"100%",cssClass:this.parent.cssClass}),y=new V.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,value:e&&s===e.condition?e.value2:"",change:function(e){var t=b.dialogPopUp.element.querySelector(".e-selected-tab");Ue.isNullOrUndefined(t)||w.setStyleAndAttributes(t,{"data-value1":v.value,"data-value2":e.value})},width:"100%",cssClass:this.parent.cssClass}),v.isStringTemplate=!0,v.appendTo(p),y.isStringTemplate=!0,y)).appendTo(h)},Ys.prototype.updateInputValues=function(e,t,i,a){i=Ue.getInstance(i,"date"===t?N.DateTimePicker:"value"===t?V.NumericTextBox:V.MaskedTextBox),a=Ue.getInstance(a,"date"===t?N.DateTimePicker:"value"===t?V.NumericTextBox:V.MaskedTextBox),t=Ue.isNullOrUndefined(i.value)?"":i.value.toString(),i=Ue.isNullOrUndefined(a.value)?"":a.value.toString();w.setStyleAndAttributes(e,{"data-value1":t,"data-value2":i})},Ys.prototype.validateTreeNode=function(e){e.node.classList.contains(W)&&(e.cancel=!0)},Ys.prototype.updateCheckedState=function(){var e=this.dialogPopUp.element,t=[].slice.call(this.memberTreeView.element.querySelectorAll("li")),i=e.getAttribute("data-fieldname"),a=this.getUnCheckedNodes(i),r=this.getCheckedNodes(i),n=this.allMemberSelect.element.querySelector("li").querySelector("span."+ur);0<t.length?0<r?(0<a?(Ue.removeClass([n],cr),Ue.addClass([n],gr),this.allMemberSelect.element.querySelector("li").setAttribute("aria-checked","false")):0===a&&(Ue.removeClass([n],gr),Ue.addClass([n],cr)),this.dialogPopUp.buttons[0].buttonModel.disabled=!1,e.querySelector("."+mr).removeAttribute("disabled")):0<a&&0===r&&(Ue.removeClass([n],[cr,gr]),this.getCheckedNodes(i)===r)&&(this.dialogPopUp.buttons[0].buttonModel.disabled=!0,e.querySelector("."+mr).setAttribute("disabled","disabled")):(this.dialogPopUp.buttons[0].buttonModel.disabled=!0,e.querySelector("."+mr).setAttribute("disabled","disabled"))},Ys.prototype.getCheckedNodes=function(e){var t=this.parent.engineModule,i=[];if("olap"===this.parent.dataType&&t&&!t.fieldList[e].isHierarchy)return this.memberTreeView.getAllCheckedNodes().length;for(var a=0,r=this.parent.searchTreeItems;a<r.length;a++){var n=r[a];n.isSelected&&i.push(n)}return i.length},Ys.prototype.getUnCheckedNodes=function(e){var t=[],i=this.parent.engineModule;if("olap"===this.parent.dataType&&i&&!i.fieldList[e].isHierarchy)return i=this.memberTreeView.getAllCheckedNodes(),this.memberTreeView.fields.dataSource.length-i.length;for(var a=0,r=this.parent.searchTreeItems;a<r.length;a++){var n=r[a];n.isSelected||t.push(n)}return t.length},Ys.prototype.isExcelFilter=function(e){for(var t=!1,i=0,a=this.parent.dataSourceSettings.filters;i<a.length;i++)if(a[i].name===e){t=!0;break}return!(t||!this.parent.dataSourceSettings.allowLabelFilter&&!this.parent.dataSourceSettings.allowValueFilter)},Ys.prototype.getFilterObject=function(e){var t=Ce.getFilterItemByName(e,Ce.cloneFilterSettings(this.parent.dataSourceSettings.filterSettings));if(t&&(0<=["Label","Date","Number"].indexOf(t.type)&&this.parent.dataSourceSettings.allowLabelFilter||"Value"===t.type&&this.parent.dataSourceSettings.allowValueFilter||0<=["Include","Exclude"].indexOf(t.type)&&this.parent.eventBase.isValidFilterItemsAvail(e,t)))return t},Ys.prototype.wireEvent=function(e,t){Ue.EventHandler.add(e,"click",this.applySorting.bind(this,t),this)},Ys.prototype.unWireEvent=function(e){Ue.EventHandler.remove(e,"click",this.applySorting)},Ys.prototype.closeFilterDialog=function(){this.dialogPopUp.close()},Ys.prototype.removeFilterDialog=function(){this.editorSearch&&!this.editorSearch.isDestroyed&&(this.editorSearch.destroy(),this.editorSearch=null),this.allowExcelLikeFilter&&this.tabObj&&!this.tabObj.isDestroyed&&(this.tabObj.destroy(),this.tabObj=null),this.dropMenu&&!this.dropMenu.isDestroyed&&(this.dropMenu.destroy(),this.dropMenu=null),this.memberTreeView&&!this.memberTreeView.isDestroyed&&(this.memberTreeView.destroy(),this.memberTreeView=null),this.allMemberSelect&&!this.allMemberSelect.isDestroyed&&(this.allMemberSelect.destroy(),this.allMemberSelect=null),document.getElementById(this.parent.parentID+"_LevelDiv-popup")&&Ue.remove(document.getElementById(this.parent.parentID+"_LevelDiv-popup")),this.dialogPopUp&&!this.dialogPopUp.isDestroyed&&(this.dialogPopUp.destroy(),this.dialogPopUp=null,setTimeout(this.setFocus.bind(this))),document.getElementById(this.parent.parentID+"_EditorTreeView")&&Ue.remove(document.getElementById(this.parent.parentID+"_EditorTreeView"))},Ys.prototype.setFocus=function(){if(this.parent.control.pivotButtonModule.parentElement)for(var e=0,t=[].slice.call(this.parent.control.pivotButtonModule.parentElement.querySelectorAll(".e-pivot-button"));e<t.length;e++){var i=t[e];if(i.getAttribute("data-uid")===this.parent.control.pivotButtonModule.fieldName){i.focus();break}}};var Qs=Ys;function Ys(e){this.parent=e}Xs.prototype.destroy=function(){this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null)};var Ks=Xs;function Xs(e){return this.currentTreeItems=[],this.savedTreeFilterPos={},this.currentTreeItemsPos={},this.searchTreeItems=[],this.isDataOverflow=!1,this.isDateField=!1,this.element=e.element,this.moduleName=e.moduleName,this.dataSourceSettings=e.dataSourceSettings,this.engineModule=e.pivotEngine,this.enableRtl=e.enableRtl,this.enableHtmlSanitizer=e.enableHtmlSanitizer,this.isAdaptive=e.isAdaptive,this.renderMode=e.renderMode,this.parentID=e.id,this.localeObj=e.localeObj,this.dataType=e.dataType,this.cssClass=e.cssClass,this.nodeStateModified=new _s(this),this.dataSourceUpdate=new Bs(this),this.eventBase=new Vs(this),this.filterDialog=new Qs(this),this.errorDialog=new zs(this),this.keyboardModule=new js(this),this}Zs.prototype.getModuleName=function(){return"common"},Zs.prototype.initiateCommonModule=function(){var e;this.parent.pivotCommon?(this.parent.pivotCommon.element=this.parent.element,this.parent.pivotCommon.engineModule="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.parent.pivotCommon.parentID=this.parent.element.id,this.parent.pivotCommon.dataSourceSettings=this.parent.dataSourceSettings.properties||this.parent.dataSourceSettings,this.parent.pivotCommon.moduleName=this.parent.getModuleName(),this.parent.pivotCommon.enableRtl=this.parent.enableRtl,this.parent.pivotCommon.isAdaptive=Ue.Browser.isDevice,this.parent.pivotCommon.renderMode="Popup",this.parent.pivotCommon.localeObj=this.parent.localeObj,this.parent.pivotCommon.dataType=this.parent.dataType,this.parent.pivotCommon.cssClass=this.parent.cssClass):(e={pivotEngine:"olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,dataSourceSettings:this.parent.dataSourceSettings.properties||this.parent.dataSourceSettings,id:this.parent.element.id,element:this.parent.element,moduleName:this.parent.getModuleName(),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,isAdaptive:Ue.Browser.isDevice,renderMode:"Popup",localeObj:this.parent.localeObj,dataType:this.parent.dataType,cssClass:this.parent.cssClass},this.parent.pivotCommon=new Ks(e)),this.parent.pivotCommon.control=this.parent},Zs.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(xt,this.initiateCommonModule,this),this.parent.on(wt,this.initiateCommonModule,this))},Zs.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(xt,this.initiateCommonModule),this.parent.off(wt,this.initiateCommonModule))},Zs.prototype.destroy=function(){this.removeEventListener(),this.parent.pivotCommon&&(this.parent.pivotCommon.destroy(),this.parent.pivotCommon=null)};var Js=Zs;function Zs(e){this.parent=e,(this.parent.commonModule=this).addEventListener()}$s=function(e,t){return($s=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var $s,eo,to=function(e,t){function i(){this.constructor=e}$s(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},a=function(e,t,i,a){var r,n=arguments.length,s=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(n<3?r(s):3<n?r(t,i,s):r(t,i))||s);return 3<n&&s&&Object.defineProperty(t,i,s),s},io=(eo=Ue.ChildProperty,to(ao,eo),a([Ue.Property()],ao.prototype,"name",void 0),a([Ue.Property()],ao.prototype,"caption",void 0),a([Ue.Property("Sum")],ao.prototype,"type",void 0),a([Ue.Property()],ao.prototype,"axis",void 0),a([Ue.Property(!1)],ao.prototype,"showNoDataItems",void 0),a([Ue.Property()],ao.prototype,"baseField",void 0),a([Ue.Property()],ao.prototype,"baseItem",void 0),a([Ue.Property(!0)],ao.prototype,"showSubTotals",void 0),a([Ue.Property(!1)],ao.prototype,"isNamedSet",void 0),a([Ue.Property(!1)],ao.prototype,"isCalculatedField",void 0),a([Ue.Property(!0)],ao.prototype,"showFilterIcon",void 0),a([Ue.Property(!0)],ao.prototype,"showSortIcon",void 0),a([Ue.Property(!0)],ao.prototype,"showRemoveIcon",void 0),a([Ue.Property(!0)],ao.prototype,"showValueTypeIcon",void 0),a([Ue.Property(!0)],ao.prototype,"showEditIcon",void 0),a([Ue.Property(!0)],ao.prototype,"allowDragAndDrop",void 0),a([Ue.Property()],ao.prototype,"dataType",void 0),a([Ue.Property(!1)],ao.prototype,"expandAll",void 0),a([Ue.Property()],ao.prototype,"groupName",void 0),ao);function ao(){return null!==eo&&eo.apply(this,arguments)||this}to(so,ro=io);var ro,no=so;function so(){return null!==ro&&ro.apply(this,arguments)||this}oo=Ue.ChildProperty,to(po,oo),a([Ue.Property()],po.prototype,"backgroundColor",void 0),a([Ue.Property()],po.prototype,"color",void 0),a([Ue.Property()],po.prototype,"fontFamily",void 0),a([Ue.Property()],po.prototype,"fontSize",void 0);var oo,lo=po;function po(){return null!==oo&&oo.apply(this,arguments)||this}ho=Ue.ChildProperty,to(co,ho),a([Ue.Property()],co.prototype,"name",void 0),a([Ue.Property("Include")],co.prototype,"type",void 0),a([Ue.Property()],co.prototype,"items",void 0),a([Ue.Property("DoesNotEquals")],co.prototype,"condition",void 0),a([Ue.Property()],co.prototype,"value1",void 0),a([Ue.Property()],co.prototype,"value2",void 0),a([Ue.Property()],co.prototype,"measure",void 0),a([Ue.Property(1)],co.prototype,"levelCount",void 0),a([Ue.Property()],co.prototype,"selectedField",void 0);var ho,uo=co;function co(){return null!==ho&&ho.apply(this,arguments)||this}go=Ue.ChildProperty,to(So,go),a([Ue.Property()],So.prototype,"measure",void 0),a([Ue.Property()],So.prototype,"label",void 0),a([Ue.Property()],So.prototype,"conditions",void 0),a([Ue.Property()],So.prototype,"value1",void 0),a([Ue.Property()],So.prototype,"value2",void 0),a([Ue.Property()],So.prototype,"style",void 0),a([Ue.Property(!0)],So.prototype,"applyGrandTotals",void 0);var go,mo=So;function So(){return null!==go&&go.apply(this,arguments)||this}fo=Ue.ChildProperty,to(yo,fo),a([Ue.Property()],yo.prototype,"name",void 0),a([Ue.Property("Ascending")],yo.prototype,"order",void 0),a([Ue.Property([])],yo.prototype,"membersOrder",void 0);var fo,vo=yo;function yo(){return null!==fo&&fo.apply(this,arguments)||this}bo=Ue.ChildProperty,to(xo,bo),a([Ue.Property()],xo.prototype,"name",void 0),a([Ue.Property()],xo.prototype,"minimumFractionDigits",void 0),a([Ue.Property()],xo.prototype,"maximumFractionDigits",void 0),a([Ue.Property()],xo.prototype,"minimumSignificantDigits",void 0),a([Ue.Property()],xo.prototype,"maximumSignificantDigits",void 0),a([Ue.Property(!0)],xo.prototype,"useGrouping",void 0),a([Ue.Property()],xo.prototype,"skeleton",void 0),a([Ue.Property()],xo.prototype,"type",void 0),a([Ue.Property()],xo.prototype,"currency",void 0),a([Ue.Property()],xo.prototype,"minimumIntegerDigits",void 0),a([Ue.Property()],xo.prototype,"format",void 0);var bo,Co=xo;function xo(){return null!==bo&&bo.apply(this,arguments)||this}wo=Ue.ChildProperty,to(Mo,wo),a([Ue.Property()],Mo.prototype,"name",void 0),a([Ue.Property()],Mo.prototype,"groupInterval",void 0),a([Ue.Property()],Mo.prototype,"startingAt",void 0),a([Ue.Property()],Mo.prototype,"endingAt",void 0),a([Ue.Property("Date")],Mo.prototype,"type",void 0),a([Ue.Property()],Mo.prototype,"rangeInterval",void 0),a([Ue.Property()],Mo.prototype,"caption",void 0),a([Ue.Property()],Mo.prototype,"customGroups",void 0);var wo,To=Mo;function Mo(){return null!==wo&&wo.apply(this,arguments)||this}Do=Ue.ChildProperty,to(Po,Do),a([Ue.Property()],Po.prototype,"groupName",void 0),a([Ue.Property([])],Po.prototype,"items",void 0);var Do,Oo=Po;function Po(){return null!==Do&&Do.apply(this,arguments)||this}No=Ue.ChildProperty,to(Fo,No),a([Ue.Property()],Fo.prototype,"name",void 0),a([Ue.Property()],Fo.prototype,"formula",void 0),a([Ue.Property()],Fo.prototype,"hierarchyUniqueName",void 0),a([Ue.Property()],Fo.prototype,"formatString",void 0);var No,Eo=Fo;function Fo(){return null!==No&&No.apply(this,arguments)||this}Io=Ue.ChildProperty,to(Ao,Io),a([Ue.Property()],Ao.prototype,"name",void 0),a([Ue.Property()],Ao.prototype,"items",void 0),a([Ue.Property()],Ao.prototype,"delimiter",void 0);var Io,Lo=Ao;function Ao(){return null!==Io&&Io.apply(this,arguments)||this}Ro=Ue.ChildProperty,to(jo,Ro),a([Ue.Property()],jo.prototype,"headerText",void 0),a([Ue.Property(".")],jo.prototype,"headerDelimiter",void 0),a([Ue.Property("None")],jo.prototype,"sortOrder",void 0),a([Ue.Property()],jo.prototype,"measure",void 0);var Ro,ko=jo;function jo(){return null!==Ro&&Ro.apply(this,arguments)||this}qo=Ue.ChildProperty,to(Ho,qo),a([Ue.Property()],Ho.prototype,"userName",void 0),a([Ue.Property()],Ho.prototype,"password",void 0);var qo,Vo=Ho;function Ho(){return null!==qo&&qo.apply(this,arguments)||this}_o=Ue.ChildProperty,to(o,_o),a([Ue.Property("Local")],o.prototype,"mode",void 0),a([Ue.Property()],o.prototype,"catalog",void 0),a([Ue.Property()],o.prototype,"cube",void 0),a([Ue.Property()],o.prototype,"roles",void 0),a([Ue.Property("Relational")],o.prototype,"providerType",void 0),a([Ue.Property()],o.prototype,"url",void 0),a([Ue.Property(1033)],o.prototype,"localeIdentifier",void 0),a([Ue.Property()],o.prototype,"dataSource",void 0),a([Ue.Collection([],io)],o.prototype,"rows",void 0),a([Ue.Collection([],io)],o.prototype,"columns",void 0),a([Ue.Collection([],io)],o.prototype,"values",void 0),a([Ue.Collection([],io)],o.prototype,"filters",void 0),a([Ue.Collection([],io)],o.prototype,"fieldMapping",void 0),a([Ue.Property([])],o.prototype,"excludeFields",void 0),a([Ue.Property(!1)],o.prototype,"expandAll",void 0),a([Ue.Property("column")],o.prototype,"valueAxis",void 0),a([Ue.Property(-1)],o.prototype,"valueIndex",void 0),a([Ue.Collection([],uo)],o.prototype,"filterSettings",void 0),a([Ue.Collection([],vo)],o.prototype,"sortSettings",void 0),a([Ue.Property(!0)],o.prototype,"enableSorting",void 0),a([Ue.Property("JSON")],o.prototype,"type",void 0),a([Ue.Property(!0)],o.prototype,"allowMemberFilter",void 0),a([Ue.Property(!1)],o.prototype,"allowLabelFilter",void 0),a([Ue.Property(!1)],o.prototype,"allowValueFilter",void 0),a([Ue.Property(!0)],o.prototype,"showSubTotals",void 0),a([Ue.Property(!0)],o.prototype,"showRowSubTotals",void 0),a([Ue.Property(!0)],o.prototype,"showColumnSubTotals",void 0),a([Ue.Property("Auto")],o.prototype,"subTotalsPosition",void 0),a([Ue.Property(!0)],o.prototype,"showGrandTotals",void 0),a([Ue.Property("Bottom")],o.prototype,"grandTotalsPosition",void 0),a([Ue.Property(!0)],o.prototype,"showRowGrandTotals",void 0),a([Ue.Property(!0)],o.prototype,"showColumnGrandTotals",void 0),a([Ue.Property(!1)],o.prototype,"alwaysShowValueHeader",void 0),a([Ue.Property(!0)],o.prototype,"showHeaderWhenEmpty",void 0),a([Ue.Property(!0)],o.prototype,"showAggregationOnValueField",void 0),a([Ue.Collection([],Co)],o.prototype,"formatSettings",void 0),a([Ue.Collection([],Lo)],o.prototype,"drilledMembers",void 0),a([Ue.Complex({},ko)],o.prototype,"valueSortSettings",void 0),a([Ue.Collection([],Eo)],o.prototype,"calculatedFieldSettings",void 0),a([Ue.Collection([],mo)],o.prototype,"conditionalFormatSettings",void 0),a([Ue.Property()],o.prototype,"emptyCellsTextContent",void 0),a([Ue.Collection([],To)],o.prototype,"groupSettings",void 0),a([Ue.Complex({},Vo)],o.prototype,"authentication",void 0);var _o,to=o;function o(){return null!==_o&&_o.apply(this,arguments)||this}Uo=function(e,t){return(Uo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Uo,Bo,a=function(e,t){function i(){this.constructor=e}Uo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},l=function(e,t,i,a){var r,n=arguments.length,s=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(n<3?r(s):3<n?r(t,i,s):r(t,i))||s);return 3<n&&s&&Object.defineProperty(t,i,s),s};Bo=Ue.ChildProperty,a(Go,Bo),l([Ue.Property("Row")],Go.prototype,"mode",void 0),l([Ue.Property("Flow")],Go.prototype,"cellSelectionMode",void 0),l([Ue.Property("Single")],Go.prototype,"type",void 0),l([Ue.Property(!1)],Go.prototype,"checkboxOnly",void 0),l([Ue.Property(!1)],Go.prototype,"persistSelection",void 0),l([Ue.Property("Default")],Go.prototype,"checkboxMode",void 0),l([Ue.Property(!1)],Go.prototype,"enableSimpleMultiRowSelection",void 0);function Go(){return null!==Bo&&Bo.apply(this,arguments)||this}zo=Ue.ChildProperty,a(d,zo),l([Ue.Property("auto")],d.prototype,"height",void 0),l([Ue.Property("auto")],d.prototype,"width",void 0),l([Ue.Property("Both")],d.prototype,"gridLines",void 0),l([Ue.Property(!1)],d.prototype,"allowTextWrap",void 0),l([Ue.Property(!1)],d.prototype,"allowReordering",void 0),l([Ue.Property(!0)],d.prototype,"allowResizing",void 0),l([Ue.Property(!0)],d.prototype,"allowAutoResizing",void 0),l([Ue.Property(null)],d.prototype,"rowHeight",void 0),l([Ue.Property(110)],d.prototype,"columnWidth",void 0),l([Ue.Property("Compact")],d.prototype,"layout",void 0),l([Ue.Property("Ellipsis")],d.prototype,"clipMode",void 0),l([Ue.Property(!1)],d.prototype,"allowSelection",void 0),l([Ue.Property(-1)],d.prototype,"selectedRowIndex",void 0),l([Ue.Property({mode:"Row",cellSelectionMode:"Flow",type:"Single"})],d.prototype,"selectionSettings",void 0),l([Ue.Property({wrapMode:"Both"})],d.prototype,"textWrapSettings",void 0),l([Ue.Property("AllPages")],d.prototype,"printMode",void 0),l([Ue.Property()],d.prototype,"contextMenuItems",void 0),l([Ue.Event()],d.prototype,"beforeCopy",void 0),l([Ue.Event()],d.prototype,"printComplete",void 0),l([Ue.Event()],d.prototype,"beforePrint",void 0),l([Ue.Event()],d.prototype,"beforePdfExport",void 0),l([Ue.Event()],d.prototype,"beforeExcelExport",void 0),l([Ue.Event()],d.prototype,"contextMenuOpen",void 0),l([Ue.Event()],d.prototype,"contextMenuClick",void 0),l([Ue.Event()],d.prototype,"queryCellInfo",void 0),l([Ue.Event()],d.prototype,"headerCellInfo",void 0),l([Ue.Event()],d.prototype,"rowSelecting",void 0),l([Ue.Event()],d.prototype,"rowSelected",void 0),l([Ue.Event()],d.prototype,"rowDeselecting",void 0),l([Ue.Event()],d.prototype,"rowDeselected",void 0),l([Ue.Event()],d.prototype,"cellSelecting",void 0),l([Ue.Event()],d.prototype,"cellSelected",void 0),l([Ue.Event()],d.prototype,"cellDeselecting",void 0),l([Ue.Event()],d.prototype,"cellDeselected",void 0),l([Ue.Event()],d.prototype,"resizeStart",void 0),l([Ue.Event()],d.prototype,"resizing",void 0),l([Ue.Event()],d.prototype,"resizeStop",void 0),l([Ue.Event()],d.prototype,"pdfHeaderQueryCellInfo",void 0),l([Ue.Event()],d.prototype,"pdfQueryCellInfo",void 0),l([Ue.Event()],d.prototype,"excelHeaderQueryCellInfo",void 0),l([Ue.Event()],d.prototype,"excelQueryCellInfo",void 0),l([Ue.Event()],d.prototype,"columnDragStart",void 0),l([Ue.Event()],d.prototype,"columnDrag",void 0),l([Ue.Event()],d.prototype,"columnDrop",void 0),l([Ue.Event()],d.prototype,"columnRender",void 0);var zo,a=d;function d(){return null!==zo&&zo.apply(this,arguments)||this}Qo.prototype.keyActionHandler=function(e){switch(e.action){case"tab":this.processTab(e);break;case"shiftTab":this.processShiftTab(e);break;case"enter":case"shiftEnter":case"ctrlEnter":this.processEnter(e);break;case"shiftUp":case"shiftDown":case"shiftLeft":case"shiftRight":case"upArrow":case"downArrow":case"leftArrow":case"rightArrow":this.processSelection(e);break;case"escape":this.clearSelection();break;case"ctrlShiftF":this.toggleFieldList(e)}},Qo.prototype.getNextButton=function(e){var t=this.allpivotButtons(e);if(Ue.removeClass(t,"e-btn-focused"),this.parent.grid.element.querySelector("."+Q))for(var i=t.length,a=0;a<i;a++)if(t[a].getAttribute("data-uid")===e.getAttribute("data-uid"))return t[a+1]||e;return e},Qo.prototype.getPrevButton=function(e){var t=this.allpivotButtons(e);if(Ue.removeClass(t,"e-btn-focused"),this.parent.grid.element.querySelector("."+Q))for(var i=t.length,a=0;a<i;a++)if(t[a].getAttribute("data-uid")===e.getAttribute("data-uid"))return t[a-1]||e;return e},Qo.prototype.allpivotButtons=function(e){var t,i,a,r,n,s,o=[];return e&&this.parent.showGroupingBar&&(n=Ue.closest(e,"."+fs),s=Ue.closest(e,"."+bs),t=Ue.closest(e,"."+Ss),e=e.classList.contains($r),r=a=i=void 0,null!==n?a=n.classList.contains(fs):null!==s?r=s.classList.contains(bs):null!==t&&(i=t.classList.contains(Ss)),a||r||e?(n=[].slice.call(this.parent.element.querySelector("."+fs).querySelectorAll("."+Q)),s=[].slice.call(this.parent.element.querySelector("."+bs).querySelectorAll("."+Q)),o=n.concat(s)):i&&(o=[].slice.call(this.parent.element.querySelector("."+Ss).querySelectorAll("."+Q)))),o},Qo.prototype.processTab=function(e){var t=e.target;if(t&&(Ue.closest(t,"."+Q)||t.classList.contains("e-group-row"))){if(this.parent.grid){var i=this.parent.grid.serviceLocator.getService("focus");if(t.classList.contains("e-group-row")&&t.querySelector(".e-btn-focused"))t=t.querySelector(".e-btn-focused");else if(t.classList.contains("e-group-row"))return i.focus(),a=i.getFocusedElement(),Ue.addClass([a],["e-focused","e-focus"]),a.setAttribute("tabindex","0"),void e.preventDefault();var a,r=this.getNextButton(t);r.getAttribute("data-uid")!==t.getAttribute("data-uid")?(this.parent.element.querySelector(".e-focused")?(this.parent.element.querySelector(".e-focused").setAttribute("tabindex","-1"),Ue.removeClass(this.parent.element.querySelectorAll(".e-focus"),"e-focus"),Ue.removeClass(this.parent.element.querySelectorAll(".e-focused"),"e-focused"),i.setFocusedElement(this.parent.element.querySelector(".e-headercell")),this.parent.element.querySelector(".e-headercell").setAttribute("tabindex","0")):i.currentInfo.skipAction=!0,Ue.addClass([r],"e-btn-focused"),r.focus()):(i.focus(),a=i.getFocusedElement(),Ue.addClass([a],["e-focused","e-focus"]),a.setAttribute("tabindex","0")),e.preventDefault()}}else!this.parent.showGroupingBar&&this.parent.showFieldList&&t&&Ue.closest(t,"."+Fa)?this.parent.grid&&((i=this.parent.grid.serviceLocator.getService("focus")).focus(),a=i.getFocusedElement(),Ue.addClass([a],["e-focused","e-focus"]),a.setAttribute("tabindex","0"),e.preventDefault()):this.parent.showGroupingBar||this.parent.showFieldList||!t||!Ue.closest(t,"."+On)||Ue.closest(t,".e-popup.e-popup-open")?t&&Ue.closest(t,"."+ss)&&this.parent.toolbar&&this.parent.toolbarModule?(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){Ue.removeClass(Ue.closest(t,"."+ss).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),document.activeElement&&document.activeElement.classList.contains("e-menu-item")&&Ue.addClass([document.activeElement],"e-focused")})):t.classList.contains("e-numerictextbox")&&((i=this.parent.grid.serviceLocator.getService("focus")).focus(),a=i.getFocusedElement(),Ue.removeClass([a],["e-focused","e-focus"]),a.setAttribute("tabindex","0"),e.preventDefault()):this.parent.grid&&(r=Ue.closest(t,"."+On),i=this.parent.grid.serviceLocator.getService("focus"),r=[].slice.call(r.getElementsByTagName("tr")),t.innerHTML===r[r.length-1].lastChild.innerHTML?i.currentInfo.skipAction=!0:(i.focus(),a=i.getFocusedElement(),Ue.addClass([a],["e-focused","e-focus"]),a.setAttribute("tabindex","0"),e.preventDefault()))},Qo.prototype.processShiftTab=function(e){var t,i,a=e.target;if(a&&(Ue.closest(a,"."+Q)||a.classList.contains("e-group-row"))){if(this.parent.grid){var r=this.parent.grid.serviceLocator.getService("focus");if(a.classList.contains("e-group-row")&&a.querySelector(".e-btn-focused"))a=a.querySelector(".e-btn-focused");else if(a.classList.contains("e-group-row")){var a=this.parent.element.querySelector(".e-btn-focused")?this.parent.element.querySelector(".e-btn-focused"):this.parent.element.querySelector("."+fs),n=this.allpivotButtons(a);if(0<n.length&&n[n.length-1])return r.currentInfo.skipAction=!0,n[n.length-1].focus(),Ue.removeClass(n,"e-btn-focused"),Ue.addClass([n[n.length-1]],"e-btn-focused"),void e.preventDefault()}n=this.getPrevButton(a);n.getAttribute("data-uid")!==a.getAttribute("data-uid")&&(r.currentInfo.skipAction=!0,n.focus(),e.preventDefault())}}else a&&this.parent.grid&&(a.classList.contains("e-movablefirst")||a.classList.contains("e-rowsheader")&&Ue.closest(a,"tr").getAttribute("data-uid")===this.parent.grid.element.querySelector(".e-frozencontent tr").getAttribute("data-uid"))?(r=this.parent.grid.serviceLocator.getService("focus"),a.classList.contains("e-movablefirst")&&(a=this.parent.element.querySelector("."+Mr+" .e-btn-focused")?this.parent.element.querySelector("."+Mr+" .e-btn-focused"):this.parent.element.querySelector("."+Mr),i=r.getFocusedElement(),Ue.removeClass([i],["e-focused","e-focus"])),0<(t=this.allpivotButtons(a)).length&&(r.currentInfo.skipAction=!0,setTimeout(function(){t[t.length-1].focus()}),Ue.removeClass(t,"e-btn-focused"),Ue.addClass([t[t.length-1]],"e-btn-focused"),e.preventDefault())):a&&Ue.closest(a,"."+ss)&&this.parent.toolbar&&this.parent.toolbarModule?(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){Ue.removeClass(Ue.closest(a,"."+ss).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),document.activeElement&&document.activeElement.classList.contains("e-menu-item")&&Ue.addClass([document.activeElement],"e-focused")})):a.classList.contains("e-numerictextbox")&&((r=this.parent.grid.serviceLocator.getService("focus")).focus(),i=r.getFocusedElement(),Ue.removeClass([i],["e-focused","e-focus"]),i.setAttribute("tabindex","0"),e.preventDefault())},Qo.prototype.processEnter=function(e){var t,i,a=e.target;a&&Ue.closest(a,"."+Dn)&&(t=this.parent.grid.serviceLocator.getService("focus"),13!==e.keyCode||e.shiftKey||e.ctrlKey?13===e.keyCode&&e.shiftKey&&!e.ctrlKey?this.parent.enableValueSorting&&(this.event=e,a.click(),t.focus(),i=t.getFocusedElement(),Ue.addClass([i],["e-focused","e-focus"]),i.setAttribute("tabindex","0")):13===e.keyCode&&!e.shiftKey&&e.ctrlKey&&this.parent.hyperlinkSettings&&a.querySelector("a")&&a.querySelector("a").click():a.querySelector("."+z)?(this.event=e,a.querySelector("."+z).click(),t.focus(),i=t.getFocusedElement(),Ue.addClass([i],["e-focused","e-focus"]),i.setAttribute("tabindex","0")):a.classList.contains("e-valuescontent")?(a.dispatchEvent(new MouseEvent("dblclick",{view:window,bubbles:!0,cancelable:!0})),a.querySelector(".e-numerictextbox")&&a.click()):a.classList.contains("e-numerictextbox")&&(t.focus(),i=t.getFocusedElement(),Ue.removeClass([i],["e-focused","e-focus"])),e.preventDefault())},Qo.prototype.clearSelection=function(){var e=this.parent;Ue.removeClass(e.element.querySelectorAll("."+zn+",."+Wn),[Wn,zn,Jn]),this.parent.renderModule.selected()},Qo.prototype.processSelection=function(t){var i,a,r,n,s,e,o=t.target;this.parent.grid&&this.parent.gridSettings.allowSelection&&"Row"!==this.parent.gridSettings.selectionSettings.mode&&!o.classList.contains("e-numerictextbox")?(i=this.parent,r=Number(t.target.getAttribute("data-colindex")),n=Number(t.target.getAttribute("index")),"TH"!==o.nodeName&&"TD"!==o.nodeName||(a="shiftUp"===t.action||"upArrow"===t.action?0===n||0===r||"TH"!==o.nodeName&&i.renderModule.rowStartPos!==n?null:this.getParentElement(i,a,r,n-1):"shiftDown"===t.action||"downArrow"===t.action?i.element.querySelector('th[data-colindex="'+r+'"][index="'+(n+1)+'"]'):"shiftLeft"===t.action||"leftArrow"===t.action?t.target.previousSibling:t.target.nextSibling),Ue.isNullOrUndefined(a)?("upArrow"===t.action?(a=i.element.querySelector('[data-colindex="'+r+'"][index="'+(n-1)+'"]'),n--):"downArrow"===t.action&&(a=i.element.querySelector('[data-colindex="'+r+'"][index="'+(n+1)+'"]'),n++),Ue.isNullOrUndefined(a)||i.clearSelection(a,t)):"Both"===i.gridSettings.selectionSettings.mode&&a.classList.contains(Xn)?i.clearSelection(a,t):(r=Number(a.getAttribute("data-colindex")),n=Number(a.getAttribute("index")),s=Number(a.getAttribute("aria-colspan")),i.clearSelection(a,t),e={cancel:!1,isCellClick:!0,currentCell:a,data:i.pivotValues[n][r]},i.trigger(ue,e,function(e){e.cancel||i.applyColumnSelection(t,a,r,r+(0<s?s-1:0),n)}))):o&&(37===t.keyCode||38===t.keyCode)&&this.parent&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&!o.classList.contains("e-numerictextbox")?this.parent.grid&&this.parent.element.querySelector(".e-frozenheader")&&0<this.parent.element.querySelector(".e-frozenheader").querySelectorAll(".e-focus").length&&(Ue.removeClass(this.parent.element.querySelector(".e-frozenheader").querySelectorAll(".e-focus"),"e-focus"),Ue.removeClass(this.parent.element.querySelector(".e-frozenheader").querySelectorAll(".e-focused"),"e-focused"),this.parent.element.querySelector(".e-headercell").setAttribute("tabindex","-1"),this.parent.grid.serviceLocator.getService("focus").setFocusedElement(o),Ue.addClass([o],["e-focused","e-focus"]),o.setAttribute("tabindex","0"),o.focus(),t.preventDefault()):!o.classList.contains("e-numerictextbox")||"rightArrow"!==t.action&&"leftArrow"!==t.action||o.click()},Qo.prototype.getParentElement=function(e,t,i,a){for(;!t;)t=e.element.querySelector('[data-colindex="'+i+'"][index="'+a+'"]'),i--;return t},Qo.prototype.toggleFieldList=function(e){this.parent&&!this.parent.isDestroyed&&this.parent.showFieldList&&this.parent.pivotFieldListModule&&!this.parent.pivotFieldListModule.isDestroyed&&this.parent.element.querySelector("."+Fa)&&(this.parent.element.querySelector("."+Fa).classList.contains(Ta)?this.parent.element.querySelector("."+Fa).classList.contains(Ta)&&this.parent.pivotFieldListModule.dialogRenderer&&this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog&&!this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.isDestroyed&&this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.hide():(this.parent.element.querySelector("."+Fa).click(),e.preventDefault()))},Qo.prototype.destroy=function(){this.pivotViewKeyboardModule&&this.pivotViewKeyboardModule.destroy()};var Wo=Qo;function Qo(e){this.keyConfigs={tab:"tab",shiftTab:"shift+tab",enter:"enter",shiftUp:"shift+upArrow",shiftDown:"shift+downArrow",shiftLeft:"shift+leftArrow",shiftRight:"shift+rightArrow",shiftEnter:"shift+enter",ctrlEnter:"ctrl+enter",upArrow:"upArrow",downArrow:"downArrow",leftArrow:"leftArrow",rightArrow:"rightArrow",escape:"escape",ctrlShiftF:"ctrl+shift+f"},this.parent=e,this.event=void 0,this.parent.element.tabIndex=-1===this.parent.element.tabIndex?0:this.parent.element.tabIndex,this.pivotViewKeyboardModule=new Ue.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})}Ko.prototype.render=function(){this.renderContextMenu()},Ko.prototype.renderContextMenu=function(){var e=[{text:this.parent.localeObj.getConstant("addToFilter"),id:this.parent.element.id+"_Filters"},{text:this.parent.localeObj.getConstant("addToRow"),id:this.parent.element.id+"_Rows"},{text:this.parent.localeObj.getConstant("addToColumn"),id:this.parent.element.id+"_Columns"},{text:this.parent.localeObj.getConstant("addToValue"),id:this.parent.element.id+"_Values"}],e={cssClass:"e-pivot-context-menu"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:e,enableRtl:this.parent.enableRtl,locale:this.parent.locale,beforeOpen:this.onBeforeMenuOpen.bind(this),select:this.onSelectContextMenu.bind(this)},t=Ue.createElement("ul",{id:this.parent.element.id+"_PivotContextMenu"});this.parent.element.appendChild(t),this.menuObj=new O.ContextMenu(e),this.menuObj.isStringTemplate=!0,this.menuObj.appendTo(t)},Ko.prototype.onBeforeMenuOpen=function(e){var e=[].slice.call(e.element.querySelectorAll("li")),t=("olap"===this.parent.dataType?this.fieldElement:this.fieldElement.querySelector("."+Ka)).getAttribute("data-type");if(Ue.removeClass(e,b),"CalculatedField"===t||"isMeasureFieldsAvail"===t)for(var i=0,a=e;i<a.length;i++)(l=a[i]).textContent!==this.parent.localeObj.getConstant("addToValue")&&Ue.addClass([l],b);else if("isMeasureAvail"===t)for(var r=0,n=e;r<n.length;r++)(l=n[r]).textContent!==this.parent.localeObj.getConstant("addToRow")&&l.textContent!==this.parent.localeObj.getConstant("addToColumn")&&Ue.addClass([l],b);else if("olap"===this.parent.dataType){for(var s=0,o=e;s<o.length;s++)if((l=o[s]).textContent===this.parent.localeObj.getConstant("addToValue")){Ue.addClass([l],b);break}}else if("true"===this.fieldElement.getAttribute("isvalue"))for(var l,d=0,p=e;d<p.length;d++)(l=p[d]).textContent!==this.parent.localeObj.getConstant("addToValue")&&l.textContent!==this.parent.localeObj.getConstant("addToFilter")||Ue.addClass([l],b)},Ko.prototype.onSelectContextMenu=function(e){var t;null!==e.element.textContent&&(t=this.fieldElement.getAttribute("data-uid"),e=e.item.id.replace(this.parent.element.id+"_","").toLowerCase(),this.parent.pivotCommon.dataSourceUpdate.control="pivotview"!==this.parent.getModuleName()&&this.parent.pivotGridModule||this.parent,this.parent.pivotCommon.dataSourceUpdate.btnElement=this.fieldElement,this.parent.pivotCommon.dataSourceUpdate.updateDataSource(t,e,-1),this.parent.updateDataSource(!0),this.fieldElement=void 0)},Ko.prototype.destroy=function(){this.parent.isDestroyed&&this.menuObj&&!this.menuObj.isDestroyed&&(this.menuObj.destroy(),Ue.select("#"+this.parent.element.id+"_PivotContextMenu",document))&&Ue.remove(Ue.select("#"+this.parent.element.id+"_PivotContextMenu",document))};var Yo=Ko;function Ko(e){this.parent=e,this.parent.contextMenuModule=this}Jo.prototype.getModuleName=function(){return"virtualscroll"},Jo.prototype.addInternalEvents=function(){this.parent.isDestroyed||this.parent.on(Dt,this.wireEvents,this)},Jo.prototype.wireEvents=function(){var e,t,i,a;this.engineModule="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,"Chart"!==this.parent.displayOption.view&&(e=this.parent.element.querySelector("."+Un),a=this.parent.element.querySelector("."+ts),t=this.parent.element.querySelector("."+Gn),i=a.querySelector("."+_n),Ue.EventHandler.clearEvents(e),this.isFireFox&&Ue.EventHandler.clearEvents(t),this.engineModule&&(a=this.parent.isAdaptive?e:a.querySelector("."+_n),Ue.EventHandler.add(a,"scroll touchmove pointermove",this.onHorizondalScroll(t,e),this),Ue.EventHandler.add(e.parentElement,"scroll wheel touchmove pointermove keyup keydown",this.onVerticalScroll(e.parentElement,e),this),this.isFireFox?(Ue.EventHandler.add(a,"mouseup touchend scroll",this.common(t,e,e),this),this.parent.isAdaptive||Ue.EventHandler.add(e.parentElement,"mouseup touchend scroll",this.common(t,e.parentElement,e),this)):(Ue.EventHandler.add(a,"mouseup touchend",this.common(t,e,e),this),this.parent.isAdaptive||Ue.EventHandler.add(e.parentElement,"mouseup touchend",this.common(t,e.parentElement,e),this)),Ue.EventHandler.add(i,"scroll",this.onCustomScrollbarScroll(e,t),this),Ue.EventHandler.add(e,"scroll",this.onCustomScrollbarScroll(i,t),this),Ue.EventHandler.add(t,"scroll",this.onCustomScrollbarScroll(i,e),this),Ue.EventHandler.add(t,"touchstart pointerdown",this.setPageXY(),this),Ue.EventHandler.add(t,"touchmove pointermove",this.onTouchScroll(t,e),this),Ue.EventHandler.add(e,"touchstart pointerdown",this.setPageXY(),this),Ue.EventHandler.add(e,"touchmove pointermove",this.onTouchScroll(t,e),this)),this.parent.grid.on("check-scroll-reset",function(e){e.cancel=!0}),this.parent.grid.on("prevent-frozen-scroll-refresh",function(e){e.cancel=!0}),this.parent.grid.isPreventScrollEvent=!0)},Jo.prototype.onWheelScroll=function(e){var i=this,a=e;return function(e){var t=a.scrollTop+(1===e.deltaMode?30*e.deltaY:e.deltaY);i.frozenPreviousValues.top!==t&&(e.preventDefault(),i.frozenPreviousValues.top=t,i.eventType=e.type)}},Jo.prototype.getPointXY=function(e){var t={x:0,y:0};return e.touches&&e.touches.length?(t.x=e.touches[0].pageX,t.y=e.touches[0].pageY):(t.x=e.pageX,t.y=e.pageY),t},Jo.prototype.onCustomScrollbarScroll=function(e,t){var i=this,a=e,r=t;return function(e){var t;null===i.parent.element.querySelector("."+Ya).querySelector("tbody")||(t=(e=e.target).scrollLeft,i.previousValues.left===t)||i.isFireFox&&e.classList.contains(Gn)||(a.scrollLeft=t,r.scrollLeft=t,i.parent.isDestroyed)}},Jo.prototype.onTouchScroll=function(n,s){var o=this,l=s;return function(e){var t,i,a,r;"mouse"===e.pointerType||(t=o.getPointXY(e),i=o.parent.element.querySelector(".e-grid ."+Ya).scrollTop+(o.pageXY.y-t.y),r=(a=o.parent.isAdaptive?s:l.parentElement.parentElement.querySelector("."+_n)).scrollLeft+(o.pageXY.x-t.x),o.frozenPreviousValues.left===r)||r<0||(n.scrollLeft=r,a.scrollLeft=r,o.pageXY.x=t.x,o.frozenPreviousValues.left=r,o.frozenPreviousValues.top===i)||i<0||(o.pageXY.y=t.y,o.frozenPreviousValues.top=i,o.eventType=e.type)}},Jo.prototype.update=function(e,t,i,a,r,n){var s=this,o=this.parent.element.querySelector("."+Un),l=(this.parent.isScrolling=!0,"pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule),d={dataSourceSettings:Ce.getClonedDataSourceSettings(this.parent.dataSourceSettings)},p=this.parent.virtualScrollSettings&&this.parent.virtualScrollSettings.allowSinglePage&&"pivot"===this.parent.dataType;if(this.parent.pageSettings&&l.pageSettings){if("vertical"===this.direction){var h=n.parentElement.scrollHeight-(e+n.parentElement.offsetHeight),u="pivot"===this.parent.dataType&&"row"===this.parent.dataSourceSettings.valueAxis?this.parent.dataSourceSettings.values.length:1,c=this.parent.pageSettings.rowPageSize*u*this.parent.gridSettings.rowHeight,g=Math.ceil(e/c);if((this.parent.scrollPosObject.vertical===(g+=p&&h<=0?1:0)||l.pageSettings.rowPageSize>=l.rowCount||o&&o.scrollHeight<3*o.parentElement.clientHeight)&&!p)return;this.parent.actionObj.actionName=Tt,p&&this.parent.grid&&this.parent.grid.element.querySelector(".e-spinner-inner")&&Ue.addClass([this.parent.grid.element.querySelector(".e-spinner-inner")],[Ps]),this.parent.actionBeginMethod(),p||this.parent.showWaitingPopup(),this.parent.scrollPosObject.vertical=g,this.parent.pageSettings.currentRowPage=l.pageSettings.currentRowPage=1<g?g:1;var m=0;this.parent.trigger(_,d,function(){"pivot"===s.parent.dataType?"Server"===s.parent.dataSourceSettings.mode?s.parent.getEngine("onScroll",null,null,null,null,null,null):(s.parent.engineModule.generateGridData(s.parent.dataSourceSettings,!0,!1,s.parent.engineModule.headerCollection),m=s.parent.engineModule.rowStartPos):(s.parent.olapEngineModule.scrollPage(),m=s.parent.olapEngineModule.pageRowStartPos),s.enginePopulatedEventMethod(l)});h=c*Math.ceil(m/(this.parent.pageSettings.rowPageSize*u))-l.rowFirstLvl*u*this.parent.gridSettings.rowHeight;this.parent.scrollPosObject.verticalSection=h}else{e=a.scrollWidth-(a.scrollLeft+a.offsetWidth),p="pivot"===this.parent.dataType&&"column"===this.parent.dataSourceSettings.valueAxis?this.parent.dataSourceSettings.values.length:1,c=this.parent.pageSettings.columnPageSize*p*this.parent.gridSettings.columnWidth,g=Math.ceil(Math.abs(t)/c),u=this.parent.virtualScrollSettings&&this.parent.virtualScrollSettings.allowSinglePage&&"pivot"===this.parent.dataType;if((this.parent.scrollPosObject.horizontal===(g+=u&&e<=0?1:0)||o&&o.scrollWidth<3*o.parentElement.clientWidth)&&!u)return;this.parent.actionObj.actionName=Mt,u&&this.parent.grid&&this.parent.grid.element.querySelector(".e-spinner-inner")&&(Ue.addClass([this.parent.grid.element.querySelector(".e-spinner-inner")],[Ps]),r)&&Ue.removeClass([r,n],["e-virtual-pivot-content"]),this.parent.actionBeginMethod(),u||this.parent.showWaitingPopup();var S=this.parent,f=(S.scrollPosObject.horizontal=g,this.parent.pageSettings.currentColumnPage=l.pageSettings.currentColumnPage=1<g?g:1,0);this.parent.trigger(_,d,function(){"pivot"===S.dataType?"Server"===s.parent.dataSourceSettings.mode?s.parent.getEngine("onScroll",null,null,null,null,null,null):(S.engineModule.generateGridData(S.dataSourceSettings,!0,!1,S.engineModule.headerCollection),f=S.engineModule.colStartPos):(S.olapEngineModule.scrollPage(),f=S.olapEngineModule.pageColStartPos),s.enginePopulatedEventMethod(l)});h=c*Math.ceil(f/(S.pageSettings.columnPageSize*p))-l.colFirstLvl*p*S.gridSettings.columnWidth;S.scrollPosObject.horizontalSection=h}this.parent.actionObj.actionName=this.parent.getActionCompleteName(),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()}},Jo.prototype.enginePopulatedEventMethod=function(e,t){var i=this,t=t||this.parent,e={dataSourceSettings:t.dataSourceSettings,pivotValues:e.pivotValues};t.trigger(U,e,function(e){i.parent.pivotValues=e.pivotValues})},Jo.prototype.setPageXY=function(){var t=this;return function(e){"mouse"!==e.pointerType&&(t.pageXY=t.getPointXY(e))}},Jo.prototype.common=function(i,a,r){var n=this;return function(e){var t=n.parent.isAdaptive?a:Ue.closest(a,"."+ts).querySelector("."+_n);n.parent.virtualScrollSettings&&n.parent.virtualScrollSettings.allowSinglePage&&"pivot"===n.parent.dataType&&("vertical"===n.direction?n.parent.element.querySelector("."+Os)&&(Ue.addClass([r],["e-virtual-pivot-content"]),Ue.removeClass([n.parent.element.querySelector("."+Os)],[Ps])):n.parent.element.querySelector("."+Os)&&(Ue.addClass([i,a],["e-virtual-pivot-content"]),Ue.removeClass([n.parent.element.querySelector("."+Os)],[Ps]))),n.update(n.parent.element.querySelector(".e-grid ."+Ya).scrollTop*n.parent.verticalScrollScale,t.scrollLeft*n.parent.horizontalScrollScale,e,t,i,a)}},Jo.prototype.onHorizondalScroll=function(n,s){var o,l=this,d=this.parent.isAdaptive?s:Ue.closest(s,"."+ts).querySelector("."+_n),p=Math.abs(d.scrollLeft),h=p*this.parent.horizontalScrollScale,u=h-this.parent.scrollPosObject.horizontalSection-p,u=this.parent.enableRtl?u:-u;return"none"!==d.style.display&&this.alignFreezedCells(u,!1),function(e){var t,i,a,r;p=Math.abs(d.scrollLeft),h=p*l.parent.horizontalScrollScale,"wheel"!==e.type&&"touchmove"!==e.type&&"wheel"!==l.eventType&&"touchmove"!==l.eventType||(clearTimeout(o),o=setTimeout(function(){h="touchmove"===e.type?p:h,l.update(s.parentElement.scrollTop*l.parent.verticalScrollScale,h,e,d,n,s)},300)),l.previousValues.left!==h&&(l.parent.scrollDirection=l.direction="horizondal",u=h-l.parent.scrollPosObject.horizontalSection-p,u=l.parent.enableRtl?u:-u,t=1<s.querySelector("."+c).style.transform.split(",").length?s.querySelector("."+c).style.transform.split(",")[1].trim():"0px)",p<l.parent.scrollerBrowserLimit&&(Ue.setStyleAttribute(s.querySelector("."+c),{transform:"translate("+u+"px,"+t}),Ue.setStyleAttribute(n.querySelector("."+c),{transform:"translate("+u+"px,0px)"}),l.alignFreezedCells(u,!1)),r=l.parent.scrollPosObject.horizontalSection>h?-(l.parent.scrollPosObject.horizontalSection-h):h+(n.offsetWidth-n.querySelector(".e-headercell.e-leftfreeze").offsetWidth)-(l.parent.scrollPosObject.horizontalSection+(s.querySelector("."+c).offsetWidth-s.querySelector("."+c).querySelector(".e-leftfreeze.e-rowsheader").offsetWidth)),i=Math.ceil(l.parent.scrollPosObject.horizontalSection/l.parent.horizontalScrollScale)<l.parent.scrollerBrowserLimit,(l.parent.scrollPosObject.horizontalSection>h||1<r&&i)&&(l.parent.virtualScrollSettings&&l.parent.virtualScrollSettings.allowSinglePage&&"pivot"===l.parent.dataType&&l.parent.element.querySelector("."+Os)&&(Ue.addClass([n,s],["e-virtual-pivot-content"]),Ue.removeClass([l.parent.element.querySelector("."+Os)],[Ps])),r=h>n.clientWidth?(l.parent.scrollPosObject.left<1&&(l.parent.scrollPosObject.left=n.clientWidth),l.parent.scrollPosObject.left=l.parent.scrollPosObject.left-50,l.parent.scrollPosObject.horizontalSection>h?r-l.parent.scrollPosObject.left:r+l.parent.scrollPosObject.left):-l.parent.scrollPosObject.horizontalSection,u=-(h-(l.parent.scrollPosObject.horizontalSection+r)-Ue.closest(s,"."+ts).querySelector("."+_n).scrollLeft),(i=l.parent.gridSettings.columnWidth*l.engineModule.columnCount)>l.parent.scrollerBrowserLimit&&(l.parent.horizontalScrollScale=i/l.parent.scrollerBrowserLimit,i=l.parent.scrollerBrowserLimit),i<u&&h<u&&(u=h,r=0),Ue.setStyleAttribute(s.querySelector("."+c),{transform:"translate("+u+"px,"+t}),Ue.setStyleAttribute(n.querySelector("."+c),{transform:"translate("+u+"px,0px)"}),l.alignFreezedCells(u,!1),l.parent.scrollPosObject.horizontalSection=l.parent.scrollPosObject.horizontalSection+r),(i=d.scrollWidth-(p+(d.offsetWidth-l.parent.element.querySelector("."+Dn).querySelector("."+en+"."+Ds).offsetWidth)))<=0&&((r=s.querySelector("."+Hn)).style.display="none",a=s.scrollWidth-(s.scrollLeft+s.offsetWidth),r.style.display="",r=s.scrollWidth-(s.scrollLeft+s.offsetWidth),l.parent.scrollPosObject.horizontalSection-=i<a?a:-r,u=p>l.parent.scrollerBrowserLimit?Number(s.querySelector("."+c).style.transform.split(",")[0].split("px")[0].trim()):-(p*l.parent.horizontalScrollScale-l.parent.scrollPosObject.horizontalSection-p),Ue.setStyleAttribute(s.querySelector("."+c),{transform:"translate("+u+"px,"+t}),Ue.setStyleAttribute(n.querySelector("."+c),{transform:"translate("+u+"px,0px)"}),l.alignFreezedCells(u,!1)),l.previousValues.left=h,l.frozenPreviousValues.left=h,l.eventType="",n.scrollLeft=d.scrollLeft,s.scrollLeft=d.scrollLeft)}},Jo.prototype.alignFreezedCells=function(e,t){for(var i,a=0,r=this.parent.element.querySelectorAll("."+Ds);a<r.length;a++)this.parent.isTabular&&1<this.parent.dataSourceSettings.rows.length?(i=this.parent.element.querySelector("."+Ds),t?this.parent.enableRtl?r[a].style.right=-e+"px":this.setFrozenColumnPosition(e,i,a,r):this.parent.enableRtl?r[a].style.right=Number(e)+"px":this.setFrozenColumnPosition(e,i,a,r)):t?this.parent.enableRtl?r[a].style.right=-e+"px":r[a].style.left=e+"px":this.parent.enableRtl?r[a].style.right=Number(e)+"px":r[a].style.left=Number(-e)+"px"},Jo.prototype.onVerticalScroll=function(o,l){var d,p=this,h=o.querySelector("."+Un)?o.querySelector("."+Un):o;return function(i){var e,a,t,r,n,s;(p.parent.isAdaptive||h.scrollHeight>3*h.parentElement.clientHeight)&&(e=o.scrollTop*p.parent.verticalScrollScale,"wheel"!==i.type&&"touchmove"!==i.type&&"scroll"!==i.type&&"wheel"!==p.eventType&&"touchmove"!==p.eventType&&"keyup"!==i.type&&"keydown"!==i.type||(a=p.parent.isAdaptive?o:Ue.closest(o,"."+ts).querySelector("."+_n),clearTimeout(d),d=setTimeout(function(){var e,t=0;t=(!p.parent.isAdaptive||(e=a.querySelector("."+Un),a.scrollLeft===e.scrollLeft)?a:e).scrollLeft,p.update(o.scrollTop*p.parent.verticalScrollScale,t*p.parent.horizontalScrollScale,i,a,null,o)},300)),p.previousValues.top!==e)&&(p.parent.scrollPosObject.horizontalSection<0&&(p.parent.scrollPosObject.horizontalSection=0),p.parent.scrollDirection=p.direction="vertical",n=-(e-p.parent.scrollPosObject.verticalSection-o.scrollTop),t=o.querySelector("."+c).style.transform.split(",")[0].trim(),n>p.parent.virtualDiv.clientHeight&&(n=p.parent.virtualDiv.clientHeight),o.scrollTop<p.parent.scrollerBrowserLimit&&(Ue.setStyleAttribute(o.querySelector("."+c),{transform:"translate(0px,"+n+"px)"}),Ue.setStyleAttribute(o.querySelector("."+c),{transform:t+","+n+"px)"})),r=p.parent.scrollPosObject.verticalSection>e?-(p.parent.scrollPosObject.verticalSection-e):e+o.clientHeight-(p.parent.scrollPosObject.verticalSection+o.querySelector("."+c).offsetHeight),s=Math.ceil(p.parent.scrollPosObject.verticalSection/p.parent.verticalScrollScale)<p.parent.scrollerBrowserLimit,(p.parent.scrollPosObject.verticalSection>e||1<r&&s)&&(p.parent.virtualScrollSettings&&p.parent.virtualScrollSettings.allowSinglePage&&"pivot"===p.parent.dataType&&p.parent.element.querySelector("."+Os)&&(Ue.addClass([l],["e-virtual-pivot-content"]),Ue.removeClass([p.parent.element.querySelector("."+Os)],[Ps])),r=e>o.clientHeight?(p.parent.scrollPosObject.top<1&&(p.parent.scrollPosObject.top=o.clientHeight),p.parent.scrollPosObject.top=p.parent.scrollPosObject.top-50,p.parent.scrollPosObject.verticalSection>e?r-p.parent.scrollPosObject.top:r+p.parent.scrollPosObject.top):-p.parent.scrollPosObject.verticalSection,s=p.parent.element.querySelector("."+Ya).querySelector("."+c),n=-(e-(p.parent.scrollPosObject.verticalSection+r)-o.scrollTop),(s=p.parent.gridSettings.rowHeight*p.engineModule.rowCount+.1-s.clientHeight)>p.parent.scrollerBrowserLimit&&(p.parent.verticalScrollScale=s/p.parent.scrollerBrowserLimit,s=p.parent.scrollerBrowserLimit),s<n&&e<n&&(n=e,r=0),n>p.parent.virtualDiv.clientHeight&&(n=p.parent.virtualDiv.clientHeight),Ue.setStyleAttribute(o.querySelector("."+c),{transform:"translate(0px,"+n+"px)"}),Ue.setStyleAttribute(o.querySelector("."+c),{transform:t+","+n+"px)"}),p.parent.scrollPosObject.verticalSection=p.parent.scrollPosObject.verticalSection+r),p.previousValues.top=e,p.frozenPreviousValues.top=e,p.eventType="")}},Jo.prototype.removeInternalEvents=function(){this.parent.isDestroyed||this.parent.off(Dt,this.wireEvents)},Jo.prototype.destroy=function(){this.removeInternalEvents()},Jo.prototype.setFrozenColumnPosition=function(e,t,i,a){t?0<(t=Number(t.getAttribute("data-colIndex")))&&t<=this.parent.engineModule.rowMaxLevel+1&&(a[i].style.left=t*this.parent.gridSettings.columnWidth+"px"):a[i].style.left=e+"px"};var Xo=Jo;function Jo(e){this.previousValues={top:0,left:0},this.frozenPreviousValues={top:0,left:0},this.eventType="",this.isFireFox=-1<Ue.Browser.userAgent.toLowerCase().indexOf("firefox"),this.parent=e,this.addInternalEvents()}$o.prototype.showDrillThroughDialog=function(e){for(var t,C=this,x=e.rawData,w=[],T={},i=0;i<e.rawData.length;i++)w.push(Ce.frameHeaderWithKeys(e.rawData[i]));try{"Table"===this.parent.currentView&&this.parent.editSettings.allowInlineEditing&&this.parent.editSettings.allowEditing&&1===e.rawData.length?(this.parent.actionObj.actionName=xi,this.parent.actionBeginMethod()||this.editCell(e,x)):(this.removeDrillThroughDialog(),t=Ue.createElement("div",{id:this.parent.element.id+"_drillthrough",className:"e-drillthrough-dialog"}),this.parent.element.appendChild(t),this.dialogPopUp=new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!1,header:this.parent.localeObj.getConstant("details"),content:this.createDrillThroughGrid(e,x),cssClass:this.parent.cssClass,beforeOpen:function(){C.drillThroughGrid.setProperties({dataSource:C.parent.editSettings.allowEditing?C.dataWithPrimarykey(e,x,T):x,height:C.parent.editSettings.allowEditing?220:300},!1)},beforeClose:function(){if(C.parent.editSettings.allowEditing&&C.isUpdated){"CSV"===C.parent.dataSourceSettings.type&&C.updateData(C.drillThroughGrid.dataSource);for(var e=[],t=0,i=Object.keys(T);t<i.length;t++){var a=i[t];e.push(T[a])}for(var r=Object.keys(T).length,n=[],s=[],o=0,l=0,d=C.drillThroughGrid.dataSource;l<d.length;l++){if("0"===(S=d[l]).__index||""===S.__index){for(var p=0,h=C.engine.fields;p<h.length;p++){var u=h[p];Ue.isNullOrUndefined(S[u])&&delete S[u]}delete S.__index,n.push(S)}else 0<r&&(delete T[S.__index.toString()],s.push(S),r--);"Server"===C.parent.dataSourceSettings.mode&&(S.__index&&delete S.__index,x[o].__index)&&delete x[o].__index,o++}if(r=0,"Server"===C.parent.dataSourceSettings.mode){for(var c=[],g=Object.keys(T),m=0;m<g.length;m++)delete C.parent.drillThroughValue.indexObject[T[g[m]]],c.push({Key:g[m],Value:T[g[m]]});C.parent.getEngine("updateRawData",null,null,null,null,null,null,null,{addedData:n,removedData:c,updatedData:s,indexObject:C.parent.drillThroughValue.indexObject})}else{for(var S,f=[],v=0,y=C.parent.allowDataCompression?C.parent.engineModule.actualData:C.parent.engineModule.data;v<y.length;v++)delete(S=y[v]).__index,void 0===T[r.toString()]&&f.push(S),r++;var f=f.concat(n),b={currentData:C.drillThroughGrid.dataSource,previousData:w,previousPosition:e,cancel:!1};C.parent.trigger(ye,b),b.cancel||(C.parent.setProperties({dataSourceSettings:{dataSource:f}},!0),C.engine.updateGridData(C.parent.dataSourceSettings),C.parent.pivotValues=C.engine.pivotValues)}C.parent.actionObj.actionName=ga;b={editInfo:{type:C.drillThroughGrid.editSettings.mode,action:"Update",currentData:C.drillThroughGrid.dataSource,previousData:w,previousPosition:e}};C.parent.actionObj.actionInfo=b}C.isUpdated=!1,T={}},isModal:!0,visible:!0,showCloseIcon:!0,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:this.parent.isAdaptive?"100%":"60%",position:{X:"center",Y:"center"},closeOnEscape:!this.parent.editSettings.allowEditing,target:document.body,close:this.removeDrillThroughDialog.bind(this)}),this.dialogPopUp.isStringTemplate=!0,this.dialogPopUp.appendTo(t),Ue.setStyleAttribute(this.dialogPopUp.element,{visibility:"visible"}),this.parent.editSettings.allowEditing&&(this.drillthroughKeyboardModule=new Ue.KeyboardEvents(this.dialogPopUp.element,{keyAction:this.drillthroughKeyActionHandler.bind(this),keyConfigs:{escape:"escape"},eventName:"keydown"})))}catch(e){this.parent.actionFailureMethod(e)}},$o.prototype.editCell=function(i,e){var a=this,t=this.parent.gridSettings.allowResizing,r=i.currentCell.actualText.toString(),n=Number(Object.keys(i.currentCell.indexObject)),s=(i.currentTarget.firstElementChild.style.display="none",Number(i.rawData[0][r])),o=Ce.frameHeaderWithKeys(i.rawData[i.rawData.length-1]),l=i.rawData[i.rawData.length-1],d=(this.parent.actionObj.actionInfo={editInfo:{type:"Inline editing",action:"update",data:e}},new V.NumericTextBox({value:s,enableRtl:this.parent.enableRtl,enabled:!0,format:"####.##",locale:this.parent.locale,cssClass:this.parent.cssClass,change:function(){var e=Ue.isNullOrUndefined(d.value)?0:d.value,t=i.currentCell.indexObject[n];i.rawData[0][r]=e,a.parent.engineModule.data[t]=i.rawData[0]},blur:function(){var e={currentData:[l],previousData:[o],previousPosition:[l.index],cancel:!1};a.parent.trigger(ye,e),e.cancel||("Server"===a.parent.dataSourceSettings.mode&&((e={})[n]=n,a.parent.getEngine("updateRawData",null,null,null,null,null,null,null,{addedData:[],removedData:[],updatedData:[l],indexObject:e})),a.parent.setProperties({dataSourceSettings:{dataSource:a.parent.engineModule.data}},!0),a.engine.updateGridData(a.parent.dataSourceSettings),a.parent.pivotValues=a.engine.pivotValues,a.parent.gridSettings.allowResizing=t)}})),e=Ue.createElement("input",{id:this.parent.element.id+"_inputbox"});i.currentTarget.appendChild(e),d.appendTo(e),i.currentCell.value=d.value,d.focusIn(),this.parent.gridSettings.allowResizing=!1},$o.prototype.updateData=function(e){for(var t=0,i=this.parent.allowDataCompression?this.parent.engineModule.actualData:this.parent.engineModule.data;t<e.length;){for(var a=Object.keys(e[t]),r=0,n=[];r<a.length;)Ue.isNullOrUndefined(this.parent.engineModule.fieldKeys[a[r]])||(n[this.parent.engineModule.fieldKeys[a[r]]]=e[t][a[r]]),r++;i[Number(e[t].__index)]=n,t++}this.parent.allowDataCompression?this.parent.engineModule.actualData=i:this.parent.engineModule.data=i},$o.prototype.removeDrillThroughDialog=function(){this.dialogPopUp&&!this.dialogPopUp.isDestroyed&&(this.parent.actionObj.actionName=ma,this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.dialogPopUp.destroy());var e=document.getElementById(this.parent.element.id+"_drillthrough");e&&Ue.remove(e),document.getElementById(this.parent.element.id+"_drillthroughgrid_ccdlg")&&Ue.remove(document.getElementById(this.parent.element.id+"_drillthroughgrid_ccdlg"))},$o.prototype.createDrillThroughGrid=function(e,i){var a=this,t=Ue.createElement("div",{id:this.parent.element.id+"_drillthroughbody",className:"e-drillthrough-body"}),r=Ue.createElement("div",{id:this.parent.element.id+"_drillthroughbodyheader",className:"e-drillthrough-body-header-container"}),n=(""!==e.rowHeaders&&(r.innerHTML="<span class="+pr+"><span class="+dr+">"+this.parent.localeObj.getConstant("row")+"</span> : <span class="+hr+">"+e.rowHeaders+"</span></span>"),""!==e.columnHeaders&&(r.innerHTML=r.innerHTML+"<span class="+pr+"><span class="+dr+">"+this.parent.localeObj.getConstant("column")+"</span> : <span class="+hr+">"+e.columnHeaders+"</span></span>"),""!==e.value&&(n=e.value.split("(")[0],"0"!==(s=e.value.split("(")[1].split(")")[0]))&&(r.innerHTML=r.innerHTML+"<span class="+pr+"><span class="+dr+">"+n+"</span> : <span class="+hr+">"+s+"</span></span>"),["ColumnChooser"]),s=(this.parent.editSettings.allowEditing&&(n=this.parent.editSettings.allowCommandColumns?["ColumnChooser","Add"]:"Batch"===this.parent.editSettings.mode?["ColumnChooser","Add","Delete","Update","Cancel"]:"Dialog"===this.parent.editSettings.mode?["ColumnChooser","Add","Edit","Delete"]:["ColumnChooser","Add","Edit","Delete","Update","Cancel"]),Ue.createElement("div",{id:this.parent.element.id+"_drillthroughgrid",className:"e-drillthrough-grid"})),o=(w.Grid.Inject(w.Selection,w.Reorder,w.Resize,w.Toolbar,w.ColumnChooser),this.drillThroughGrid=new w.Grid({cssClass:this.parent.cssClass,gridLines:"Default",allowResizing:!0,allowReordering:!0,showColumnChooser:!0,enableHover:!1,toolbar:n,columns:e.gridColumns,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableVirtualization:!this.parent.editSettings.allowEditing,allowPaging:this.parent.editSettings.allowEditing,pageSettings:{pageSize:20},rowHeight:this.parent.gridSettings.rowHeight,height:"100%"}),"olap"===this.parent.dataType&&this.formatData(i),this);if(this.parent.trigger(ve,{cellInfo:e,gridObj:this.drillThroughGrid,type:"editing"}),this.drillThroughGrid.allowExcelExport&&w.Grid.Inject(w.ExcelExport),this.drillThroughGrid.allowPdfExport&&w.Grid.Inject(w.PdfExport),this.parent.editSettings.allowEditing){w.Grid.Inject(w.Edit,w.Page);try{this.drillThroughGrid.editSettings=this.parent.editSettings,this.drillThroughGrid.actionBegin=function(e){e="save"===e.requestType?wi:"add"===e.requestType?Ti:"delete"===e.requestType?Mi:"";a.parent.actionObj.actionName=e,a.parent.actionObj.actionName&&a.parent.actionBeginMethod()},this.parent.editSettings.allowCommandColumns?(this.drillThroughGrid.editSettings.mode="Normal",this.drillThroughGrid.editSettings.allowEditOnDblClick=!1,w.Grid.Inject(w.CommandColumn),this.drillThroughGrid.columns.push({headerText:this.parent.localeObj.getConstant("manageRecords"),width:160,showInColumnChooser:!1,commands:[{type:"Edit",buttonOption:{iconCss:" e-icons e-edit",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:"")}},{type:"Delete",buttonOption:{iconCss:"e-icons e-delete",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:"")}},{type:"Save",buttonOption:{iconCss:"e-icons e-update",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:"")}},{type:"Cancel",buttonOption:{iconCss:"e-icons e-cancel-icon",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:"")}}]})):this.drillThroughGrid.editSettings.allowEditOnDblClick=this.parent.editSettings.allowEditOnDblClick,this.drillThroughGrid.columns.push({field:"__index",visible:!1,isPrimaryKey:!0,type:"string",showInColumnChooser:!1,defaultValue:"0",validationRules:{required:!0}})}catch(e){this.parent.actionFailureMethod(e)}this.drillThroughGrid.actionComplete=function(e){"batchsave"!==e.requestType&&"save"!==e.requestType&&"delete"!==e.requestType||(o.isUpdated=!0),a.parent.actionObj.actionName=a.parent.getActionCompleteName();var t={editInfo:{type:a.drillThroughGrid.editSettings.mode,action:e.requestType,data:i}};a.parent.actionObj.actionInfo=t,a.parent.actionObj.actionName&&a.parent.actionCompleteMethod(),("Normal"===o.drillThroughGrid.editSettings.mode&&"save"===e.requestType&&0<o.drillThroughGrid.element.querySelectorAll(".e-tbar-btn:hover").length&&!o.parent.editSettings.allowCommandColumns||"batchsave"===e.requestType)&&o.dialogPopUp.hide()},this.drillThroughGrid.beforeBatchSave=function(){o.isUpdated=!0}}else w.Grid.Inject(w.VirtualScroll);return document.body.appendChild(s),this.drillThroughGrid.isStringTemplate=!0,this.drillThroughGrid.appendTo(s),t.appendChild(r),t.appendChild(s),t},$o.prototype.frameGridColumns=function(e){this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;var t="olap"===this.parent.dataType?e[0]?Object.keys(e[0]):[]:Object.keys(this.engine.fieldList),i=[],a={};if(0<this.parent.dataSourceSettings.formatSettings.length)for(var r=0;r<this.parent.dataSourceSettings.formatSettings.length;r++)a[this.parent.dataSourceSettings.formatSettings[r].name]=this.parent.dataSourceSettings.formatSettings[r].format;if("olap"===this.parent.dataType)for(var n=0,s=t;n<s.length;n++){var o=s[n];i.push({field:o.replace(/_x005B_|_x0020_|_x005D_|_x0024_/g,"").replace("].[","").split(".").reverse().join(""),headerText:o.replace(/_x005B_|_x005D_|_x0024_/g,"").replace(/_x0020_/g," ").replace("].[","").split(".").reverse().join("."),width:120,visible:!0,validationRules:{required:!0},format:Ue.isNullOrUndefined(a[o])?null:a[o],type:Ue.isNullOrUndefined(a[o])?"string":null})}else for(var l=0,d=t;l<d.length;l++){var p,h,o=d[l];"CalculatedField"!==this.engine.fieldList[o].aggregateType&&(p="",h=!("date"!==this.engine.fieldList[o].type&&"datetime"!==this.engine.fieldList[o].type||!(this.isDateFieldExist(o)||e[0]&&e[0][o]&&-1===e[0][o].toString().indexOf(" "))),p="number"===this.engine.fieldList[o].type?"numericedit":"date"===this.engine.fieldList[o].type&&h?"datepickeredit":"datetime"===this.engine.fieldList[o].type&&h?"datetimepickeredit":"defaultedit",h=this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(this.engine.fieldList[o].caption):this.engine.fieldList[o].caption,i.push({field:o,headerText:h,width:120,visible:this.engine.fieldList[o].isSelected,validationRules:{required:!0},editType:p,format:Ue.isNullOrUndefined(a[o])?void 0:a[o],type:Ue.isNullOrUndefined(a[o])?"string":null}))}return i},$o.prototype.isDateFieldExist=function(e){for(var t=0;t<this.parent.dataSourceSettings.formatSettings.length;t++)if(this.parent.dataSourceSettings.formatSettings[t].name===e&&-1<this.parent.dataSourceSettings.formatSettings[t].type.indexOf("date"))return!0;for(t=0;t<this.parent.dataSourceSettings.fieldMapping.length;t++)if(this.parent.dataSourceSettings.fieldMapping[t].name===e&&this.parent.dataSourceSettings.fieldMapping[t].dataType&&-1<this.parent.dataSourceSettings.fieldMapping[t].dataType.indexOf("date"))return!0;return!1},$o.prototype.formatData=function(e){for(var t=0;t<e.length;){for(var i=e[t],a=Object.keys(e[t]),r={},n=0;n<a.length;)r[a[n].replace(/_x005B_|_x0020_|_x005D_|_x0024_/g,"").replace("].[","").split(".").reverse().join("")]=i[a[n]],n++;e[t]=r,t++}},$o.prototype.dataWithPrimarykey=function(e,t,i){for(var a=0<this.indexString.length?this.indexString:Object.keys(e.currentCell.indexObject),e=t,r=0,n=0,s=e;n<s.length;n++)s[n].__index=a[r],i[a[r].toString()]=Number(a[r]),r++;return e},$o.prototype.drillthroughKeyActionHandler=function(e){"escape"===e.action&&this.processClose(e)},$o.prototype.processClose=function(e){var t=e.target;if(t&&Ue.closest(t,".e-popup.e-popup-open")){t=Ue.getInstance(Ue.closest(t,".e-popup.e-popup-open"),P.Dialog);if(t&&!t.closeOnEscape){var i=t.element.getAttribute("data-fieldName");if(t.hide(),this.parent.element)for(var a=0,r=[].slice.call(this.parent.element.querySelectorAll(".e-pivot-button"));a<r.length;a++){var n=r[a];if(n.getAttribute("data-uid")===i){n.focus();break}}e.preventDefault()}}},$o.prototype.destroy=function(){this.parent.isDestroyed||this.drillthroughKeyboardModule&&!this.drillthroughKeyboardModule.isDestroyed&&(this.drillthroughKeyboardModule.destroy(),this.drillthroughKeyboardModule=null)};var Zo=$o;function $o(e){this.indexString=[],this.isUpdated=!1,this.parent=e,this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule}tl.prototype.getModuleName=function(){return"drillThrough"},tl.prototype.addInternalEvents=function(){this.parent.on(Dt,this.wireEvents,this)},tl.prototype.wireEvents=function(){this.unWireEvents(),Ue.EventHandler.add(this.parent.element,"dblclick",this.mouseClickHandler,this)},tl.prototype.unWireEvents=function(){this.parent.isDestroyed||Ue.EventHandler.remove(this.parent.element,"dblclick",this.mouseClickHandler)},tl.prototype.mouseClickHandler=function(e){var t,e=e.target,i=null;e.classList.contains("e-stackedheadercelldiv")||e.classList.contains("e-headercelldiv")||e.classList.contains("e-stackedheadertext")||e.classList.contains("e-headertext")?i=Ue.closest(e.parentElement,"th"):e.classList.contains("e-cellvalue")?i=e.parentElement:(e.classList.contains("e-headercell")||e.classList.contains("e-rowcell"))&&(i=e),i&&0<this.parent.pivotValues.length&&(this.parent.allowDrillThrough&&i.classList.contains("e-valuescontent")||this.parent.editSettings.allowEditing)&&(e=Number(i.getAttribute("data-colindex")),t=Number(i.getAttribute("index")),this.executeDrillThrough(this.parent.pivotValues[t][e],t,e,i))},tl.prototype.executeDrillThrough=function(e,t,i,a){this.parent.drillThroughElement=a,this.parent.drillThroughValue=e;var r="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,n="",s="",o=[];if(!Ue.isNullOrUndefined(e.rowHeaders)&&!Ue.isNullOrUndefined(e.columnHeaders)){if("olap"===this.parent.dataType){var l=void 0,l=(l="row"===this.parent.dataSourceSettings.valueAxis?r.tupRowInfo[e.rowOrdinal]:r.tupColumnInfo[e.colOrdinal])?r.getUniqueName(l.measureName):e.actualText;if(r.fieldList[l]&&r.fieldList[l].isCalculatedField)return void this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("drillError"));n=r.fieldList[l||e.actualText].caption,s=r.fieldList[l||e.actualText].aggregateType;try{this.parent.olapEngineModule.getDrillThroughData(e,this.parent.maxRowsInDrillThrough),o=JSON.parse(r.gridJSON)}catch(e){return this.parent.olapEngineModule.errorInfo&&this.parent.actionFailureMethod(this.parent.olapEngineModule.errorInfo),this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.olapEngineModule.errorInfo||r.gridJSON),void(this.parent.olapEngineModule.errorInfo=void 0)}}else if(n=r.fieldList[e.actualText.toString()]?r.fieldList[e.actualText.toString()].caption:e.actualText.toString(),s=r.fieldList[e.actualText]?r.fieldList[e.actualText].aggregateType:"","Server"===this.parent.dataSourceSettings.mode)this.parent.getEngine("fetchRawData",null,null,null,null,null,null,{rowIndex:t,columnIndex:i});else if(this.parent.allowDataCompression){var d=Object.keys(e.indexObject);this.drillThroughDialog.indexString=[];for(var p=0,h=d;p<h.length;p++)for(var u=h[p],c=0,g=this.parent.engineModule.groupRawIndex[Number(u)];c<g.length;c++){var m=g[c];o.push(this.parent.engineModule.actualData[m]),this.drillThroughDialog.indexString.push(m.toString())}}else for(var S=0,f=d=Object.keys(e.indexObject);S<f.length;S++){var v=f[S];o.push(this.parent.engineModule.data[Number(v)])}"Server"!==this.parent.dataSourceSettings.mode&&this.triggerDialog(n,s,o,e,a)}},tl.prototype.frameData=function(e){for(var t=0,i=0,a=[];i<e.rawData.length;){for(var r={};t<e.gridColumns.length;)r[e.gridColumns[t].field]="Server"===this.parent.dataSourceSettings.mode?e.rawData[i][-1!==this.parent.engineModule.fields.indexOf(e.gridColumns[t].field)?this.parent.engineModule.fields.indexOf(e.gridColumns[t].field):0]:e.rawData[i][this.parent.engineModule.fieldKeys[e.gridColumns[t].field]],t++;a.push(r),i++,t=0}return e.rawData=a,e},tl.prototype.triggerDialog=function(e,t,i,a,r){var t="CalculatedField"===t?e.toString():""!==t?this.parent.localeObj.getConstant(t)+" "+this.parent.localeObj.getConstant("of")+" "+e:e,t=this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(t):t,e="row"===this.parent.dataSourceSettings.valueAxis?this.parent.getRowText(Number(r.getAttribute("index")),0):""===a.rowHeaders?"":a.rowHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - "),n={currentTarget:r,currentCell:a,rawData:i,rowHeaders:e,columnHeaders:""===a.columnHeaders?"":a.columnHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - "),value:t+"("+a.formattedText+")",gridColumns:this.drillThroughDialog.frameGridColumns(i),cancel:!1},s=("CSV"===this.parent.dataSourceSettings.type&&(n=this.frameData(n)),this);this.parent.trigger(de,n,function(e){n.cancel||s.drillThroughDialog.showDrillThroughDialog(e)})},tl.prototype.destroy=function(){this.unWireEvents(),this.drillThroughDialog&&(this.drillThroughDialog.destroy(),this.drillThroughDialog=null)};var el=tl;function tl(e){this.parent=e,this.drillThroughDialog=new Zo(this.parent),this.addInternalEvents()}p.prototype.getModuleName=function(){return"pivotChart"},p.prototype.loadChart=function(e,t){if(this.parent=e,this.measuresNames={},this.engineModule="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.dataSourceSettings=this.parent.dataSourceSettings,this.chartSettings=t,!("olap"===e.dataType?""!==e.dataSourceSettings.url&&!e.olapEngineModule.isEmptyData&&0<e.olapEngineModule.tupColumnInfo.length&&0<e.olapEngineModule.tupRowInfo.length&&(!Ue.isNullOrUndefined(e.olapEngineModule.colMeasurePos)||!Ue.isNullOrUndefined(e.olapEngineModule.rowMeasurePos)):"Server"===this.parent.dataSourceSettings.mode?!Ue.isNullOrUndefined(e.dataSourceSettings.url)&&""!==e.dataSourceSettings.url&&0<e.dataSourceSettings.values.length&&!e.engineModule.isEmptyData:0<e.dataSourceSettings.values.length&&e.dataSourceSettings.dataSource&&(0<e.dataSourceSettings.dataSource.length||e.dataSourceSettings.dataSource instanceof K.DataManager)&&!e.engineModule.isEmptyData))return this.parent.chart?(this.parent.element.querySelector(".e-chart")?(this.parent.chart.series=[],this.parent.chart.rows=[],this.parent.chart.primaryXAxis.title="",this.parent.chart.primaryYAxis.title="",this.parent.chart.primaryXAxis.multiLevelLabels=[],this.parent.chart.primaryYAxis.multiLevelLabels=[],0<this.parent.chart.axes.length&&(this.parent.chart.axes[0].title=""),this.parent.chart.primaryXAxis.zoomFactor=Ue.isNullOrUndefined(this.parent.chartSettings.primaryXAxis.zoomFactor)?1:this.parent.chartSettings.primaryXAxis.zoomFactor):this.parent.element.querySelector(".e-accumulationchart")&&(this.parent.chart.series[0].dataSource=[{}],this.parent.chart.series[0].dataLabel={}),void this.parent.chart.refresh()):(this.parent.appendChartElement(),this.parent.enableVirtualization&&this.isChartInitial&&(this.isChartInitial=!1,this.parent.onContentReady()),void this.parent.notify(Dt,{}));this.parent.chart||!this.parent.element.querySelector(".e-chart")&&!this.parent.element.querySelector(".e-accumulationchart")||Ue.remove(Ue.select("#"+this.parent.element.id+"_chart",this.parent.element)),this.chartSettings.enableMultipleAxis&&this.accumulationType.indexOf(t.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type?this.measureList=this.dataSourceSettings.values.map(function(e){return e.name}):this.measureList=[""===t.value?this.dataSourceSettings.values[0].name:t.value];for(var i=0,k=this.dataSourceSettings.values;i<k.length;i++){var a=(l=k[i]).name.replace(/[^A-Z0-9]+/gi,"_");this.measuresNames[l.name]=a,this.measuresNames[a]=l.name,"Polar"!==this.chartSettings.chartSeries.type&&"Radar"!==this.chartSettings.chartSeries.type||(this.measuresNames[l.caption||l.name]=l.name)}this.columnGroupObject={},this.accEmptyPoint=!1;for(var r,n,s,o,l,d,p=this.engineModule.pivotValues,j=(this.currentMeasure=t.enableMultipleAxis&&this.accumulationType.indexOf(t.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type?this.measureList[0]:(""===t.value||0===this.dataSourceSettings.values.filter(function(e){return e.name===t.value}).length)&&0<this.dataSourceSettings.values.length?this.dataSourceSettings.values[0].name:t.value,this.getColumnTotalIndex(p)),e=Object.keys(p),h={},u=0,c=-.5,q=(this.headerColl={},this.maxLevel=0,{}),g="",m="",S="",f=(this.chartSeriesInfo={},this.selectedLegend=0,!1),v={},y=!1,b=this.parent.dataSourceSettings.valueSortSettings.headerDelimiter,C=0,V=this.dataSourceSettings.values;C<V.length;C++)v[a=(l=V[C]).name]=l.caption||a,v[l.caption||a]=a;"olap"===this.parent.dataType&&(q=this.groupHierarchyWithLevels(p,d=[]),g=d[d.length-1],S=m=this.measurePos===d.length-1&&1<d.length?d[d.length-2]:g);for(var H=0,_=e;H<_.length;H++){var x=_[H],w=Number(x);if(!Ue.isNullOrUndefined(p[w])){var x=p[w][0],T=x&&x.valueSort&&!Ue.isNullOrUndefined(x.valueSort.levelName)?x.valueSort.levelName.toString().split(b):void 0,y=!1;if(T&&"Grand Total"!==T[0]&&!(y=t.enableMultipleAxis&&this.accumulationType.indexOf(t.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type||-1<T.indexOf(v[this.currentMeasure])?!0:y)){for(var U=0,B=T;U<B.length;U++)if(v[z=B[U]]){y=!0;break}y=!y}if(x&&"row"===x.axis&&(0===this.dataSourceSettings.rows.length||"grand sum"!==x.type&&y)){var M=p[w][0];if(!M.isSum){var D="olap"===this.parent.dataType?this.engineModule.tupRowInfo[M.ordinal]:void 0,G=-1,T=M.level,x=("olap"===this.parent.dataType?(f="[Measures]"===M.hierarchy?f:this.isAttributeDrill(M.hierarchy,D.drillInfo),S=S===m||"[Measures]"===M.hierarchy||M.isNamedSet||this.engineModule.fieldList[M.hierarchy]&&!this.engineModule.fieldList[M.hierarchy].hasAllMember?m:S,G=D.drillInfo.length-1,3===M.memberType||D.measureName&&D.measureName!==this.dataSourceSettings.values[0].name||(h=0===(u=(n=void 0===n?M.levelUniqueName:n)===M.levelUniqueName?0:u)?{}:h,u=s&&n!==M.levelUniqueName?s.hierarchy===M.hierarchy?u+(M.level-s.level):Ue.isNullOrUndefined(h[M.levelUniqueName])?q[M.hierarchy].start:h[M.levelUniqueName]:u,T=h[M.levelUniqueName]=u,c+=!s||S!==s.hierarchy||s.isDrilled&&s.hasChild?0:1,S=f?M.hierarchy:m,r=u,s=M)):"value"!==M.type&&(void 0===r||r<T||c++,r=T),this.maxLevel=T>this.maxLevel?T:this.maxLevel,"olap"===this.parent.dataType?M.formattedText:(M.actualText||M.formattedText).toString()),O=this.engineModule.fieldList[this.currentMeasure],O=0===this.parent.dataSourceSettings.rows.length?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(O.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+(Ue.isNullOrUndefined(O.caption)?O.name:O.caption):M.formattedText?M.formattedText.toString():x,O=M.hasChild&&!M.isNamedSet?(M.isDrilled?" - ":" + ")+O:O,z=D?D.uNameCollection:M.valueSort.levelName.toString(),x={name:x,text:O,hasChild:M.hasChild,isDrilled:M.isDrilled,levelName:z,level:T,fieldName:M.valueSort.axis?M.valueSort.axis.toString():"",rowIndex:w,colIndex:0,cell:M},O=(("olap"===this.parent.dataType?3!==M.memberType:"value"!==M.type)&&(this.headerColl[c]||(this.headerColl[c]={}),this.headerColl[c][T]=x),p[w]),T=Object.keys(O),P=void 0;if("olap"===this.parent.dataType)o=3!==M.memberType?M:o;else if(o="value"!==M.type?M:o,"value"!==M.type)o=M;else{var x=M&&M.valueSort&&M.valueSort.levelName&&M.valueSort.levelName.toString().split(b),W=void 0;if(x&&0<x.length&&(x.splice(x.length-1,1),W=x.join(b)),!(this.parent.dataSourceSettings.valueIndex<=0||this.engineModule.valueAxis&&this.dataSourceSettings.rows.length===this.engineModule.measureIndex||Ue.isNullOrUndefined(o.valueSort)||W===o.valueSort.levelName))for(var N=w;-1<N;)p[N]&&p[N][0]&&p[N][0].valueSort&&p[N][0].valueSort.levelName===W&&(o=p[N][0],N=0),N--}for(var Q=0,Y=T;Q<Y.length;Q++){var E=Y[Q],E=Number(E),F=p[w][E],I=!Ue.isNullOrUndefined(F.rowHeaders)||0===this.dataSourceSettings.rows.length,L="olap"===this.parent.dataType&&D&&D.measureName?D.measureName:F.actualText;if(("olap"!==this.parent.dataType||!F.isGrandSum)&&!j[F.colIndex]&&"value"===F.axis&&"header"!==M.type&&""!==L&&(t.enableMultipleAxis&&this.accumulationType.indexOf(t.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type||L===this.currentMeasure)){if(Ue.isNullOrUndefined(M.members)&&(M.members=[]),"olap"===this.parent.dataType?g!==M.hierarchy&&!f||(3===M.memberType&&P?G!==this.measurePos||P.isDrilled&&P.hasChild:M.isDrilled&&M.hasChild):("value"===M.type&&P?!Ue.isNullOrUndefined(P.members)&&P.hasChild&&P.isDrilled:M.hasChild&&M.isDrilled)||!I)break;if("olap"===this.parent.dataType&&!0===F.isSum&&"row"===this.parent.dataSourceSettings.valueAxis)continue;var I="",A=(I="olap"===this.parent.dataType?F.columnHeaders.toString().split(/~~|::/).join(" - "):(A=F.columnHeaders.toString().split(b),Ce.formatChartHeaders(A,this,!0)),""),R=(A="olap"===this.parent.dataType?F.rowHeaders.toString().split(/~~|::/).join(" - "):(R=F.rowHeaders.toString().split(b),Ce.formatChartHeaders(R,this,!1)),I+" | "+L),L=(this.chartSeriesInfo[I]={uniqueName:I,caption:F.hierarchyName&&F.hierarchyName.toString().split(b).join(" - "),colorIndex:[]},this.chartSeriesInfo[this.chartSeriesInfo[I].caption]=this.chartSeriesInfo[I],"pivot"===this.parent.dataType&&this.engineModule.aggregatedValueMatrix[w]&&!Ue.isNullOrUndefined(this.engineModule.aggregatedValueMatrix[w][E])?Number(this.engineModule.aggregatedValueMatrix[w][E]):Ue.isNullOrUndefined(F.value)?F.value:Number(F.value));0===(L=L===1/0?null:L)&&(this.accEmptyPoint=!0),this.columnGroupObject[R]?this.columnGroupObject[R].push({x:0===this.dataSourceSettings.rows.length?M.formattedText:A,y:L,rIndex:w,cIndex:E}):this.columnGroupObject[R]=[{x:0===this.dataSourceSettings.rows.length?M.formattedText:A,y:L,rIndex:w,cIndex:E}]}P=o}}}}}this.refreshChart()},p.prototype.refreshChart=function(){this.chartSeries=[];for(var e=0,t={},i=Object.keys(this.columnGroupObject),a=(this.persistSettings=JSON.parse(this.parent.getChartSettings()).chartSettings,this.persistSettings.palettes&&0<this.persistSettings.palettes.length?this.persistSettings.palettes:y.getSeriesColor(this.chartSettings.theme)),r=this.parent.chartSettings.columnDelimiter||"-",r=this.parent.chartSettings.columnHeader&&""!==this.parent.chartSettings.columnHeader?this.parent.chartSettings.columnHeader.split(r).join(" - "):"",n=this.chartSettings.chartSeries?this.chartSettings.chartSeries.type:void 0,s={},o=0;o<this.parent.dataSourceSettings.values.length;o++)s[this.parent.dataSourceSettings.values[o].name]=Ue.isNullOrUndefined(this.parent.dataSourceSettings.values[o].caption)?void 0:this.parent.dataSourceSettings.values[o].caption;if(-1<this.accumulationType.indexOf(n)&&0<i.length){this.currentColumn=-1<i.indexOf(r+" | "+this.currentMeasure)&&void 0!==r?r+" | "+this.currentMeasure:i[0];var l={};l=this.persistSettings.chartSeries?this.frameChartSeries(this.persistSettings.chartSeries):l,(Ue.isNullOrUndefined(l.palettes)||0===l.palettes.length)&&!Ue.isNullOrUndefined(this.persistSettings.palettes)&&0<this.persistSettings.palettes.length&&(l.palettes=this.persistSettings.palettes),l.dataSource=this.columnGroupObject[this.currentColumn],l.xName="x",l.yName="y",this.persistSettings.chartSeries&&this.persistSettings.chartSeries.dataLabel?(l.dataLabel=this.persistSettings.chartSeries.dataLabel,l.dataLabel.name="x"):(l.dataLabel={visible:!0,position:"Outside",name:"x"},this.parent.setProperties({chartSettings:{chartSeries:{dataLabel:{visible:!0,position:"Outside"}}}},!0)),this.accEmptyPoint&&l.emptyPointSettings?l.emptyPointSettings.mode="Zero":this.accEmptyPoint&&(l.emptyPointSettings={mode:"Zero"}),l.name=this.currentColumn,"Doughnut"===n?(l.type="Pie",l.innerRadius=this.chartSettings.chartSeries.innerRadius||"40%"):"Pie"===n&&(l.innerRadius=this.chartSettings.chartSeries.innerRadius||"0"),this.chartSeries=this.chartSeries.concat(l)}else for(var d=0,p=i;d<p.length;d++){var h=p[d],l={};l=this.persistSettings.chartSeries?this.frameChartSeries(this.persistSettings.chartSeries):l,!Ue.isNullOrUndefined(l.palettes)&&0<l.palettes.length&&(Ue.isNullOrUndefined(this.persistSettings.palettes)||0===this.persistSettings.palettes.length)&&(this.chartSettings.palettes=l.palettes);for(o=0;o<this.columnGroupObject[h].length;o++){var u=this.engineModule.fieldList[this.currentMeasure];this.columnGroupObject[h][o].x=0!==this.parent.dataSourceSettings.rows.length||this.chartSettings.showMultiLevelLabels?""===this.columnGroupObject[h][o].x?this.parent.localeObj.getConstant("blank"):this.columnGroupObject[h][o].x:this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(u.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+(Ue.isNullOrUndefined(u.caption)?u.name:u.caption)}l.dataSource=this.columnGroupObject[h],l.xName="x",l.yName="y",l.visible=!0;for(var c,g=void 0,m=void 0,S=void 0,o=0,f=h.split(" | ");o<f.length;o++)this.measuresNames&&this.measuresNames[f[o]]&&(m=f[o],S=h.split(" | "+m)[0]);this.chartSettings.enableMultipleAxis&&(c=m,g=S+" | "+(c=Ue.isNullOrUndefined(s[c])?c:s[c])),l.name=this.chartSettings.enableMultipleAxis?g:S,this.chartSettings.showPointColorByMembers&&this.chartSettings.enableMultipleAxis&&(l.name=S,c=this.chartSeriesInfo[l.name].caption,l.name=null!=c?c:l.name,t[l.name]?(l.fill=t[l.name].color,this.chartSeriesInfo[l.name].colorIndex.push(this.selectedLegend++),l.name=void 0):(e=a[e]?e:0,t[l.name]={name:l.name,color:a[e]},l.fill=a[e++],this.chartSeriesInfo[l.name].colorIndex.push(this.selectedLegend++))),["Radar","Polar"].indexOf(n)<0&&(g=m,l.tooltipMappingName=this.measuresNames[g],l.yAxisName=this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.measureList.join("_"):this.measuresNames[g]||g),this.persistSettings.chartSeries&&this.persistSettings.chartSeries.emptyPointSettings&&(l.emptyPointSettings=this.persistSettings.chartSeries.emptyPointSettings),l.emptyPointSettings||(l.emptyPointSettings={mode:"Zero"}),this.chartSeries=this.chartSeries.concat(l)}var r={series:this.chartSeries,cancel:!1},v=this;this.parent.trigger(tt,r,function(e){e.cancel?(v.element&&Ue.remove(v.element),v.parent.notify(Dt,{})):v.bindChart()})},p.prototype.frameObjectWithKeys=function(e){for(var t=Object.keys(e),i=0,a={};i<t.length;)a[t[i]]=e[t[i]],i++;return a},p.prototype.frameChartSeries=function(e){for(var t=Object.keys(e),i=0,a={};i<t.length;)-1<this.accumulationType.indexOf(this.parent.chartSettings.chartSeries.type)&&-1<["fill","dashArray","width","segmentAxis","drawType","isClosed","segments","stackingGroup","marker","errorBar","trendlines","minRadius","splineType","maxRadius","cardinalSplineTension","columnWidth","columnSpacing","cornerRadius"].indexOf(t[i])||this.accumulationType.indexOf(this.parent.chartSettings.chartSeries.type)<0&&-1<["endAngle","explode","explodeAll","explodeIndex","explodeOffset","gapRatio","groupMode","groupTo","neckHeight","neckWidth","pyramidMode","startAngle","dataLabel","innerRadius"].indexOf(t[i])||(a[t[i]]=e[t[i]]),i++;return a},p.prototype.bindChart=function(){this.parent.showWaitingPopup();var e=this.configXAxis(),t=this.configTooltipSettings(),i=this.configLegendSettings(),a=this.configZoomSettings(),r=this.frameAxesWithRows(),n=this.chartSettings.chartSeries.type,s=("Both"===this.parent.displayOption.view?this.element="Chart"===this.parent.displayOption.primary?this.parent.element.insertBefore(this.element||Ue.createElement("div",{className:ps,id:this.parent.element.id+"_chart"}),this.parent.element.querySelector("."+Dn)):this.parent.element.appendChild(this.element||Ue.createElement("div",{className:ps,id:this.parent.element.id+"_chart"})):this.element||(this.element=this.parent.element.appendChild(Ue.createElement("div",{className:ps,id:this.parent.element.id+"_chart"}))),!this.chartElement&&this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&"Pareto"!==this.chartSettings.chartSeries.type&&(this.parent.element.querySelector("."+ps).innerHTML="",this.chartElement=this.parent.element.querySelector("."+ps).appendChild(Ue.createElement("div",{className:ys,id:this.parent.element.id+"_chartInner"}))),this.parent.element.querySelector("."+ys)&&(this.parent.element.querySelector("."+ys).innerHTML=""),this.parent.showGroupingBar?this.element.style.minWidth="400px !important":this.element.style.minWidth="310px !important",this.parent.width.toString()),o=(this.parent.showToolbar&&this.parent.grid&&(s=this.parent.getGridWidthAsNumber().toString()),this.getChartHeight());this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&this.accumulationType.indexOf(n)<0&&"Pareto"!==this.chartSettings.chartSeries.type&&(this.parent.element.querySelector("."+ps).style.height=("auto"===o?this.getChartAutoHeight():o)+"px",this.parent.element.querySelector("."+ps).style.width=s+"px","Polar"!==this.parent.chartSettings.chartSeries.type)&&"Radar"!==this.parent.chartSettings.chartSeries.type&&(this.parent.element.querySelector("."+ps).style.overflow="auto",this.parent.element.querySelector("."+ps).style.overflowX="hidden"),this.parent.chart&&("accumulationchart"===this.parent.chart.getModuleName()&&this.accumulationType.indexOf(n)<0||"chart"===this.parent.chart.getModuleName()&&-1<this.accumulationType.indexOf(n)&&"Pareto"!==this.chartSettings.chartSeries.type)&&(this.parent.chart.destroy(),Ue.select("#"+this.parent.element.id+"_chart",this.parent.element))&&(Ue.select("#"+this.parent.element.id+"_chart",this.parent.element).innerHTML="",Ue.select("#"+this.parent.element.id+"_chart",this.parent.element).appendChild(Ue.createElement("div",{className:ys,id:this.parent.element.id+"_chartInner"}))),!(this.parent.chart&&this.parent.chart.element&&this.parent.element.querySelector(".e-chart")||this.parent.element.querySelector(".e-accumulationchart"))||this.parent.toolbarModule&&this.parent.toolbarModule.isMultiAxisChange?(this.parent.toolbarModule&&this.parent.toolbarModule.isMultiAxisChange&&this.parent.chart&&(this.parent.chart.isDestroyed||this.parent.chart.destroy(),this.parent.chart=void 0,Ue.select("#"+this.parent.element.id+"_chart",this.parent.element).innerHTML="",Ue.select("#"+this.parent.element.id+"_chart",this.parent.element).appendChild(Ue.createElement("div",{className:ys,id:this.parent.element.id+"_chartInner"})),this.parent.toolbarModule.isMultiAxisChange=!1),y.Chart.Inject(y.ColumnSeries,y.StackingColumnSeries,y.RangeColumnSeries,y.BarSeries,y.StackingBarSeries,y.ScatterSeries,y.BubbleSeries,y.LineSeries,y.StepLineSeries,y.SplineSeries,y.SplineAreaSeries,y.MultiColoredLineSeries,y.PolarSeries,y.RadarSeries,y.AreaSeries,y.RangeAreaSeries,y.StackingAreaSeries,y.StepAreaSeries,y.StackingLineSeries,y.MultiColoredAreaSeries,y.ParetoSeries,y.Legend,y.Tooltip,y.Category,y.MultiLevelLabel,y.ScrollBar,y.Zoom,y.Export,y.Crosshair,y.Selection,y.StripLine,y.DataLabel),y.AccumulationChart.Inject(y.PieSeries,y.FunnelSeries,y.PyramidSeries,y.AccumulationDataLabel,y.AccumulationLegend,y.AccumulationTooltip,y.Export),-1<this.accumulationType.indexOf(n)?this.parent.chart=new y.AccumulationChart({series:0<this.chartSeries.length?this.chartSeries:[{}],legendSettings:i,tooltip:t,width:s,height:o.toString(),title:this.chartSettings.title,enableSmartLabels:this.chartSettings.enableSmartLabels,center:this.chartSettings.pieCenter,enableBorderOnMouseMove:this.chartSettings.enableBorderOnMouseMove,highlightMode:this.chartSettings.highlightMode,highlightPattern:this.chartSettings.highlightPattern,titleStyle:this.chartSettings.titleStyle,subTitle:this.chartSettings.subTitle,subTitleStyle:this.chartSettings.subTitleStyle,margin:this.chartSettings.margin,border:this.chartSettings.border,background:this.chartSettings.background,theme:this.chartSettings.theme,selectionMode:this.chartSettings.accumulationSelectionMode,isMultiSelect:this.chartSettings.isMultiSelect,enableExport:this.parent.allowPdfExport,selectedDataIndexes:this.chartSettings.selectedDataIndexes,enableAnimation:this.chartSettings.enableAnimation,useGroupingSeparator:this.chartSettings.useGroupingSeparator,locale:this.parent.locale,enableRtl:this.parent.enableRtl,beforePrint:this.beforePrint.bind(this),animationComplete:this.animationComplete.bind(this),legendRender:this.legendRender.bind(this),textRender:this.textRender.bind(this),pointRender:this.pointRender.bind(this),seriesRender:this.seriesRender.bind(this),chartMouseMove:this.chartMouseMove.bind(this),chartMouseClick:this.chartMouseClick.bind(this),pointMove:this.pointMove.bind(this),pointClick:this.pointClick.bind(this),chartMouseLeave:this.chartMouseLeave.bind(this),chartMouseDown:this.chartMouseDown.bind(this),chartMouseUp:this.chartMouseUp.bind(this),tooltipRender:this.tooltipRender.bind(this),loaded:this.loaded.bind(this),load:this.load.bind(this),resized:this.resized.bind(this)}):this.parent.chart=new y.Chart({series:0<this.chartSeries.length?this.chartSeries:[{}],legendSettings:i,tooltip:t,zoomSettings:a,axes:"Polar"===n||"Radar"===n?[]:r.axes,rows:"Polar"===n||"Radar"===n?[{}]:"Bar"===n||"StackingBar"===n||"StackingBar100"===n||"Pareto"===n&&this.chartSettings.enableMultipleAxis?[{height:"100%"}]:r.rows,columns:"Polar"===n||"Radar"===n?[{}]:"Bar"===n||"StackingBar"===n||"StackingBar100"===n&&this.chartSettings.enableMultipleAxis?r.columns:[{width:"100%"}],primaryYAxis:"Polar"===n||"Radar"===n?r.axes[0]:{visible:!1},primaryXAxis:e,width:s,height:("Polar"!==this.parent.chartSettings.chartSeries.type&&"Radar"!==this.parent.chartSettings.chartSeries.type&&this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&"Pareto"!==this.parent.chartSettings.chartSeries.type&&0<this.parent.dataSourceSettings.values.length?Number(o)>235*this.parent.dataSourceSettings.values.length+100?isNaN(Number(o))?o:Number(o)-5:!isNaN(Number(o))||1<this.parent.dataSourceSettings.values.length?235*this.parent.dataSourceSettings.values.length+100:o:o).toString(),title:this.chartSettings.title,titleStyle:this.chartSettings.titleStyle,subTitle:this.chartSettings.subTitle,subTitleStyle:this.chartSettings.subTitleStyle,margin:this.chartSettings.margin,border:this.chartSettings.border,background:this.chartSettings.background,chartArea:(Ue.isNullOrUndefined(this.persistSettings.chartArea)?this.chartSettings:this.persistSettings).chartArea,palettes:this.chartSettings.palettes,theme:this.chartSettings.theme,crosshair:this.chartSettings.crosshair,selectionMode:this.chartSettings.selectionMode,isMultiSelect:this.chartSettings.isMultiSelect,enableExport:this.parent.allowPdfExport,selectedDataIndexes:this.chartSettings.selectedDataIndexes,isTransposed:this.chartSettings.isTransposed,enableAnimation:this.chartSettings.enableAnimation,enableCanvas:this.chartSettings.enableCanvas,useGroupingSeparator:this.chartSettings.useGroupingSeparator,description:this.chartSettings.description,tabIndex:this.chartSettings.tabIndex,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableSideBySidePlacement:this.chartSettings.enableSideBySidePlacement,beforePrint:this.beforePrint.bind(this),animationComplete:this.animationComplete.bind(this),legendRender:this.legendRender.bind(this),textRender:this.textRender.bind(this),pointRender:this.pointRender.bind(this),seriesRender:this.seriesRender.bind(this),chartMouseMove:this.chartMouseMove.bind(this),chartMouseClick:this.chartMouseClick.bind(this),pointMove:this.pointMove.bind(this),pointClick:this.pointClick.bind(this),chartMouseLeave:this.chartMouseLeave.bind(this),chartMouseDown:this.chartMouseDown.bind(this),chartMouseUp:this.chartMouseUp.bind(this),dragComplete:this.dragComplete.bind(this),zoomComplete:this.zoomComplete.bind(this),scrollStart:this.scrollStart.bind(this),scrollEnd:this.scrollEnd.bind(this),scrollChanged:this.scrollChanged.bind(this),tooltipRender:this.tooltipRender.bind(this),legendClick:this.legendClick.bind(this),loaded:this.loaded.bind(this),load:this.load.bind(this),resized:this.resized.bind(this),axisLabelRender:this.axisLabelRender.bind(this),multiLevelLabelClick:this.multiLevelLabelClick.bind(this),axisMultiLabelRender:this.multiLevelLabelRender.bind(this)}),this.parent.chart.isStringTemplate=!0):(this.parent.chart.series=this.chartSeries,this.parent.chart.title=this.parent.chartSettings.title,this.parent.chart.subTitle=this.parent.chartSettings.subTitle,this.parent.chart.background=this.parent.chartSettings.background,this.parent.chart.theme=this.parent.chartSettings.theme,this.parent.chart.legendSettings=i,this.parent.chart.selectionMode=this.parent.chartSettings.selectionMode,this.parent.chart.enableExport=this.parent.allowPdfExport,this.parent.chart.isMultiSelect=this.parent.chartSettings.isMultiSelect,this.parent.chart.enableAnimation=this.parent.chartSettings.enableAnimation,this.parent.chart.useGroupingSeparator=this.parent.chartSettings.useGroupingSeparator,this.parent.chart.highlightPattern=this.parent.chartSettings.highlightPattern,-1<this.accumulationType.indexOf(n)?(this.parent.chart.enableBorderOnMouseMove=this.parent.chartSettings.enableBorderOnMouseMove,this.parent.chart.highlightMode=this.parent.chartSettings.highlightMode,this.parent.chart.enableSmartLabels=this.parent.chartSettings.enableSmartLabels):(this.parent.chart.palettes=this.parent.chartSettings.palettes,this.parent.chart.isTransposed=this.parent.chartSettings.isTransposed,this.parent.chart.enableSideBySidePlacement=this.parent.chartSettings.enableSideBySidePlacement,this.parent.chart.tabIndex=this.parent.chartSettings.tabIndex,this.parent.chart.description=this.parent.chartSettings.description,this.parent.chart.enableCanvas=this.parent.chartSettings.enableCanvas),"Polar"===n||"Radar"===n?(this.parent.chart.primaryXAxis=e,this.parent.chart.primaryYAxis.visible=!0,this.parent.chart.primaryYAxis=r.axes[0],this.parent.chart.axes=[],this.parent.chart.rows=[{}]):this.accumulationType.indexOf(n)<0&&"chart"===this.parent.chart.getModuleName()&&(this.parent.chart.primaryYAxis.visible=!1,this.parent.chart.primaryXAxis=e,this.parent.chart.axes=r.axes,"Bar"===n||"StackingBar"===n||"StackingBar100"===n&&this.chartSettings.enableMultipleAxis?(this.parent.chart.rows=[{height:"100%"}],this.parent.chart.columns=r.columns):("Pareto"===n&&this.chartSettings.enableMultipleAxis?this.parent.chart.rows=[{height:"100%"}]:this.parent.chart.rows=r.rows,this.parent.chart.columns=[{width:"100%"}])),this.parent.chart.refresh(),-1<this.accumulationType.indexOf(n)&&"accumulationchart"===this.parent.chart.getModuleName()&&(0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length)&&(this.parent.hideWaitingPopup(),this.parent.pivotFieldListModule)&&P.hideSpinner(this.parent.pivotFieldListModule.fieldListSpinnerElement)),this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis?this.parent.chart.appendTo(Ue.select("#"+this.parent.element.id+"_chartInner",this.parent.element)):this.parent.chart.appendTo(Ue.select("#"+this.parent.element.id+"_chart",this.parent.element))},p.prototype.legendClick=function(e){if(this.chartSettings.showPointColorByMembers&&this.chartSettings.enableMultipleAxis)for(var t=this.chartSeriesInfo[e.legendText].colorIndex,i=1;i<t.length;i++)e.chart.series[t[i]].visible=!e.chart.series[t[i]].visible;this.parent.trigger(Fe,e)},p.prototype.pointClick=function(e){var t,i,a=e.series.dataSource||this.parent.chart.series[e.seriesIndex].dataSource;(-1<["Pie","Funnel","Doughnut","Pyramid","Radar","Polar"].indexOf(this.parent.chartSettings.chartSeries.type)||!this.parent.chartSettings.showMultiLevelLabels)&&("olap"===this.parent.dataType||1<this.parent.dataSourceSettings.rows.length)?(this.pivotIndex={rIndex:a?a[e.pointIndex].rIndex:void 0,cIndex:a?a[e.pointIndex].cIndex:void 0},this.creatMenu(),i=this.parent.element.getBoundingClientRect(),t=(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:0)+(this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:0)+(window.scrollY||document.documentElement.scrollTop)+i.top,this.accumulationMenu.open(t+e.y,e.x+i.left+(window.scrollX||document.documentElement.scrollLeft))):(this.parent.allowDrillThrough||this.parent.editSettings.allowEditing)&&this.parent.drillThroughModule&&(t=a[e.pointIndex].rIndex,i=a[e.pointIndex].cIndex,this.parent.drillThroughModule.executeDrillThrough(this.parent.pivotValues[t][i],t,i)),this.parent.trigger(St,e)},p.prototype.frameAxesWithRows=function(){var e=[],t=[],i=[],a=[],r=this.persistSettings.chartSeries&&("StackingColumn100"===this.persistSettings.chartSeries.type||"StackingBar100"===this.persistSettings.chartSeries.type||"StackingArea100"===this.persistSettings.chartSeries.type||"StackingLine100"===this.persistSettings.chartSeries.type),n=["PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfDifferenceFrom","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal"];if(this.chartSettings.enableMultipleAxis)for(var s=0,o=100/this.dataSourceSettings.values.length+"%",l=0,d=this.dataSourceSettings.values;l<d.length;l++){for(var p=d[l],h=this.engineModule.fieldList[p.name],u=("olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(h.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" ")+h.caption,c=(a.push(u),void 0),g=0,m=this.dataSourceSettings.formatSettings;g<m.length;g++){var S=m[g];if(S.name===p.name){c=S;break}}var f=-1!==Ce.inArray(h.aggregateType,n)?"P2":c?null===c.format.toLowerCase().match(/n|p|c/)?"N":c.format:"olap"===this.parent.dataType?this.getFormat(h.formatString):"N",v="Polar"===this.chartSettings.chartSeries.type||"Radar"===this.chartSettings.chartSeries.type,y={};(y=this.persistSettings.primaryYAxis?this.frameObjectWithKeys(this.persistSettings.primaryYAxis):y).labelFormat=y.labelFormat||(r?"":v?"N":f),y.title="Combined"===this.chartSettings.multipleAxisMode?a.join(" - "):y.title||u,y.zoomFactor=Ue.isNullOrUndefined(this.chartSettings.primaryYAxis.zoomFactor)?1:this.chartSettings.primaryYAxis.zoomFactor,y.edgeLabelPlacement=this.chartSettings.primaryYAxis.edgeLabelPlacement||this.persistSettings.primaryYAxis.edgeLabelPlacement,"Bar"===this.chartSettings.chartSeries.type||"StackingBar"===this.chartSettings.chartSeries.type||"StackingBar100"===this.chartSettings.chartSeries.type?y.plotOffsetRight=y.plotOffsetRight||30:y.plotOffsetTop=y.plotOffsetTop||30,v||(y.name="Combined"===this.chartSettings.multipleAxisMode?this.measureList.join("_"):this.measuresNames[p.name]||p.name),e=e.concat(y),"Combined"===this.chartSettings.multipleAxisMode&&(e=[e[e.length-1]]),"Stacked"===this.chartSettings.multipleAxisMode?(y.rowIndex=s,y.columnIndex=s,t.push({height:o}),i.push({width:o})):(y.rowIndex=0,y.columnIndex=0,t=[{height:"100%"}],i=[{width:"100%"}]),s++}else{for(var h=this.engineModule.fieldList[this.currentMeasure],u=("olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(h.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" ")+h.caption,c=void 0,b=0,C=this.dataSourceSettings.formatSettings;b<C.length;b++)if((p=C[b]).name===this.currentMeasure){c=p;break}var x=void 0,y=(c&&(x=c.format.length),{}),f=-1!==Ce.inArray(h.aggregateType,n)?"P2":c?null===c.format.toLowerCase().match(/n[0-10]|p[0-10]|c[0-10]/)||3<x?"N":c.format:"olap"===this.parent.dataType?this.getFormat(h.formatString):"N";(y=this.persistSettings.primaryYAxis?this.frameObjectWithKeys(this.persistSettings.primaryYAxis):y).zoomFactor=Ue.isNullOrUndefined(this.chartSettings.primaryYAxis.zoomFactor)?1:this.chartSettings.primaryYAxis.zoomFactor,y.rowIndex=0,y.columnIndex=0,y.edgeLabelPlacement=this.chartSettings.primaryYAxis.edgeLabelPlacement||this.persistSettings.primaryYAxis.edgeLabelPlacement,"Polar"!==this.chartSettings.chartSeries.type&&"Radar"!==this.chartSettings.chartSeries.type&&(y.name=this.measuresNames[this.currentMeasure]||this.currentMeasure),y.labelFormat=y.labelFormat||(r?"":f),y.title=y.title||u,e=e.concat(y),t.push({height:"100%"}),i.push({width:"100%"})}return{axes:e,rows:t,columns:i}},p.prototype.getFormat=function(e){return e="Currency"===e?"C":"Percent"===e?"P":"N"},p.prototype.getColumnTotalIndex=function(e){for(var t={},i=0,a=Object.keys(e);i<a.length;i++){var r=a[i],n=e[Number(r)];if(!Ue.isNullOrUndefined(n))for(var s=0,o=Object.keys(n);s<o.length;s++){var l=o[s],l=n[Number(l)];if(!Ue.isNullOrUndefined(l)){if("column"!==l.axis)return t;"sum"!==l.type&&(this.dataSourceSettings&&this.dataSourceSettings.columns&&0===this.dataSourceSettings.columns.length||"grand sum"!==l.type)||-1===l.rowSpan||(t[l.colIndex]=l.colIndex)}}}return t},p.prototype.groupHierarchyWithLevels=function(e,t){var i,a={},r=0,n={};this.measurePos=this.engineModule.tupRowInfo[0].measurePosition;for(var s=0;s<e.length;s++){var o=e[s][0];o&&"row"===o.axis&&"grand sum"!==o.type&&(Ue.isNullOrUndefined(a[o.hierarchy])?(3===o.memberType?r===this.measurePos?(t[this.measurePos]=o.hierarchy,a[o.hierarchy]=((i={})[o.levelUniqueName]=o.levelUniqueName,i)):r--:(t[r]=o.hierarchy,a[o.hierarchy]=((i={})[o.levelUniqueName]=o.levelUniqueName,i)),r++):a[o.hierarchy][o.levelUniqueName]=o.levelUniqueName)}for(var l=-1,d=0;d<t.length;d++)this.measurePos!==d&&(n[t[d]]={start:l+1,end:l+Object.keys(a[t[d]]).length},l=n[t[d]].end);return n},p.prototype.frameMultiLevelLabels=function(){for(var e=Object.keys(this.headerColl),t=this.headerColl[-.5],i=0,a=e;i<a.length;i++){for(var r=a[i],n=Number(r),s=this.headerColl[n],o=0,l=!1;o<=this.maxLevel;)l?s[o]||(s[o]={name:s[o-1].name,text:"",hasChild:s[o-1].hasChild,isDrilled:s[o-1].isDrilled,levelName:s[o-1].levelName,level:s[o-1].level,fieldName:s[o-1].fieldName,rowIndex:s[o-1].rowIndex,colIndex:s[o-1].colIndex,span:-1}):s[o]?l=!0:s[o]=t[o],o++;t=this.headerColl[n]}for(var d={},p=0,h=e;p<h.length;p++){for(var r=h[p],n=Number(r),s=this.headerColl[n],u=0,c=Object.keys(s);u<c.length;u++){var g,m=c[u],m=Number(m);d[m]?(g=d[m].length,s[m].levelName===t[m].levelName?d[m][g-1].end=d[m][g-1].end+1:d[m].push({start:n,end:n+1,text:s[m].text,type:-1===s[m].span?"WithoutTopandBottomBorder":"WithoutTopBorder",customAttributes:s[m]})):d[m]=[{start:n,end:n+1,text:s[m].text,type:-1===s[m].span?"WithoutTopandBottomBorder":"WithoutTopBorder",customAttributes:s[m]}]}t=s}for(var S=[],f=Object.keys(d).length-1;-1<f;f--)S.push({categories:d[f],border:{width:1},overflow:"Trim"});return S},p.prototype.getZoomFactor=function(){this.calculatedWidth=this.getCalulatedWidth();var e=120<10*this.chartSeries.length?10*this.chartSeries.length:120,e=0<this.chartSeries.length?this.calculatedWidth/(Object.keys(this.chartSeries[0].dataSource).length*e):1;return e<1&&0<e?e:1},p.prototype.getCalulatedWidth=function(){return isNaN(Number(this.parent.width))?-1<this.parent.width.indexOf("%")?this.calculatedWidth=this.parent.element.clientWidth*(parseFloat(this.parent.width)/100):-1<this.parent.width.indexOf("px")?this.calculatedWidth=Number(this.parent.width.toString().split("px")[0]):this.calculatedWidth=this.parent.element.clientWidth:this.calculatedWidth=Number(this.parent.width),this.calculatedWidth},p.prototype.configTooltipSettings=function(){var e=this.persistSettings.tooltip||this.chartSettings.tooltip;return e.enable=void 0===e.enable||e.enable,e.enable&&e.template&&(this.templateFn=this.parent.templateParser(e.template)),this.parent.tooltipTemplate&&(e.template=e.template||this.parent.tooltipTemplate),e.header=e.header||"",e.enableMarker=void 0===e.enableMarker||e.enableMarker,e},p.prototype.configLegendSettings=function(){var e={};if(this.chartSettings.legendSettings)for(var t=0,i=Object.keys(this.chartSettings.legendSettings);t<i.length;)e[i[t]]=this.chartSettings.legendSettings[i[t]],t++;return e.visible=!1!==e.visible,e.padding=e.padding||25,e.shapePadding=e.shapePadding||10,e},p.prototype.configXAxis=function(){var e={};return(e=this.persistSettings.primaryXAxis?this.frameObjectWithKeys(this.persistSettings.primaryXAxis):e).valueType="Category",e.labelIntersectAction=e.labelIntersectAction||"Rotate45",e.title=e.title||this.dataSourceSettings.rows.map(function(e){return e.caption||e.name}).join(" / "),e.zoomFactor=Ue.isNullOrUndefined(this.parent.chartSettings.primaryXAxis.zoomFactor)?this.getZoomFactor():this.parent.chartSettings.primaryXAxis.zoomFactor,this.parent.chartSettings.zoomSettings.enableScrollbar||(e.zoomFactor=1),this.chartSettings.showMultiLevelLabels&&"Pareto"!==this.chartSettings.chartSeries.type?(e.multiLevelLabels=this.frameMultiLevelLabels(),e.border={width:1,type:"WithoutTopandBottomBorder"},e.majorTickLines={width:0,height:-10}):(e.multiLevelLabels=[],e.border={width:1,type:"Rectangle"},e.majorTickLines={width:0,height:5}),e},p.prototype.configZoomSettings=function(){var e=this.chartSettings.zoomSettings;return e.enableSelectionZooming=void 0===e.enableSelectionZooming||e.enableSelectionZooming,e.enableScrollbar=void 0===e.enableScrollbar||e.enableScrollbar,e},p.prototype.tooltipRender=function(e){var t=this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode&&this.accumulationType.indexOf(this.chartSettings.chartSeries.type)<0&&"Radar"!==this.chartSettings.chartSeries.type&&"Polar"!==this.chartSettings.chartSeries.type?e.series.tooltipMappingName:e.series.yAxisName?e.series.yAxisName.split("_CumulativeAxis")[0]:this.chartSettings.enableMultipleAxis&&this.accumulationType.indexOf(this.chartSettings.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type?e.series.name?e.series.name.split(" | ")[1]:e.data.seriesName?e.data.seriesName.split(" | ")[1]:this.currentMeasure:this.measuresNames[this.currentMeasure]||this.currentMeasure,i=e.series.dataSource||this.parent.chart.series[e.data.seriesIndex].dataSource,a=i?i[e.data.pointIndex].rIndex:void 0,r=i?i[e.data.pointIndex].cIndex:void 0,t=this.engineModule.fieldList[this.measuresNames[t]||t],n="olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(t.aggregateType),s=("olap"===this.parent.dataType?"":n+" "+this.parent.localeObj.getConstant("of")+" ")+t.caption,o=this.engineModule.pivotValues[a][r].formattedText,l=this.engineModule.formatFields[t.id],d=this.engineModule.getFormattedValue(e.point.y,t.id,o),l=l&&l.format&&null!==l.format.toLowerCase().match(/n|p|c/)&&this.chartSettings.useGroupingSeparator?"olap"===this.parent.dataType?d.toString():d.formattedText:o,d=this.parent.pivotValues[a][r].columnHeaders,o="",p=(o=Ue.isNullOrUndefined(d)?void 0:("olap"===this.parent.dataType?this.chartSeriesInfo[d.toString().split(/~~|::/).join(" - ")]:(p=d.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter),d=Ce.formatChartHeaders(p,this,!0),this.chartSeriesInfo[d.toString()])).uniqueName,e.point.x);this.parent.tooltipTemplate&&void 0!==this.parent.getTooltipTemplate()||this.chartSettings.tooltip.template?(d=i?this.parent.getHeaderField(a,r,"row"):"",i=i?this.parent.getHeaderField(a,r,"Column"):"",a={rowHeaders:p,columnHeaders:o,aggregateType:n,value:l,valueField:t.caption,rowFields:d,columnFields:i},r=void 0,r=(this.parent.chartSettings&&this.parent.chartSettings.tooltip&&this.parent.chartSettings.tooltip.enable&&this.parent.chartSettings.tooltip.template?this.tooltipTemplateFn()(a,this,"tooltipTemplate",this.element.id+"1tooltipTemplate"):this.parent.getTooltipTemplate()(a,this,"tooltipTemplate",this.element.id+"tooltipTemplate"))[0].outerHTML,e.template=r):(e.text=s+": "+l+(0===this.dataSourceSettings.columns.length?"":" <br/>"+this.parent.localeObj.getConstant("column")+": "+o)+(0===this.dataSourceSettings.rows.length?"":" <br/>"+this.parent.localeObj.getConstant("row")+": "+p)+(e.data&&"Pareto"===e.data.seriesName?" <br/>"+this.parent.localeObj.getConstant("pareto")+": "+e.data.pointY+"%":""),this.parent.trigger(Ee,e))},p.prototype.tooltipTemplateFn=function(){return this.templateFn},p.prototype.loaded=function(e){this.parent.isChartLoaded=!0;var t=(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()).toString(),i=(this.parent.chart&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.showFieldList&&"Chart"===this.parent.currentView&&this.parent.groupingBarModule.alignIcon(),this.chartSettings.showMultiLevelLabels&&(i=-1<Ce.inArray(this.chartSettings.chartSeries.type,["Bar","StackingBar","StackingBar100"])?"_chartYAxisMultiLevelLabel0":"_chartXAxisMultiLevelLabel0",Ue.isNullOrUndefined(Ue.select("#"+this.parent.element.id+i,this.parent.element))||this.parent.element.querySelector("#"+this.parent.element.id+i).setAttribute("cursor","pointer")),this.getChartHeight());this.parent.chart.height=i,this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&(0<=["Pie","Funnel","Pyramid","Doughnut","Radar","Polar","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)?this.parent.element.querySelector("."+ps).style.overflow="visible":(this.parent.element.querySelector("."+ps).style.overflow="auto",this.parent.element.querySelector("."+ps).style.overflowX="hidden"),this.parent.element.querySelector("."+ps).style.width=t+"px",this.parent.element.querySelector("."+ps).style.height=i+"px"),this.updateView(),"Chart"!==this.parent.displayOption.primary&&"Chart"!==this.parent.displayOption.view||this.parent.notify(Dt,{}),this.parent.trigger(Ie,e),("Server"===this.parent.dataSourceSettings.mode&&this.parent.isServerWaitingPopup||"Local"===this.parent.dataSourceSettings.mode)&&this.parent.hideWaitingPopup()},p.prototype.updateView=function(){var e,t;this.parent.grid&&this.parent.chart&&this.parent.showToolbar&&(e=this.parent.element.querySelector(".e-pivot-grouping-bar"),t=this.parent.element.querySelector(".e-chart-grouping-bar"),"Table"===this.parent.currentView?(this.parent.grid.element.style.display="",this.parent.chart.element.style.display="none",this.parent.showGroupingBar&&this.parent.groupingBarModule&&(e&&(e.style.display="",e.querySelector("."+Ba))&&null!=this.parent.groupingBarModule.gridPanel&&!this.parent.groupingBarModule.gridPanel.isDestroyed&&this.parent.groupingBarModule.gridPanel.refreshOverflow(),t)&&(t.style.display="none"),this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.enableScrollOnMultiAxis&&(this.parent.element.querySelector(".e-pivotchart").style.display="none")):(this.parent.grid.element.style.display="none",this.parent.chart.element.style.display="",this.parent.showGroupingBar&&this.parent.groupingBarModule&&(e&&(e.style.display="none"),t)&&(t.style.display="",t.querySelector("."+Ba))&&null!=this.parent.groupingBarModule.chartPanel&&!this.parent.groupingBarModule.chartPanel.isDestroyed&&this.parent.groupingBarModule.chartPanel.refreshOverflow(),this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.enableScrollOnMultiAxis&&(this.parent.element.querySelector(".e-pivotchart").style.display="")))},p.prototype.creatMenu=function(){this.accumulationMenu&&!this.accumulationMenu.isDestroyed&&this.accumulationMenu.destroy();for(var e=(this.parent.allowDrillThrough||this.parent.editSettings.allowEditing)&&this.parent.drillThroughModule?["expand","collapse","drillThrough","exit"]:["expand","collapse","exit"],t=[],i=0;i<e.length;i++)t.push({id:this.parent.element.id+"_DrillMenuChart_"+e[i],text:this.parent.localeObj.getConstant(e[i]),items:[]});for(var a=this.getMenuItems(),r=[],n=[],i=0;i<a.length;i++)"expand"===a[i].type?r.push({id:this.element.id+"drillExpand_"+a[i].key,text:a[i].value}):n.push({id:this.element.id+"drillCollapse_"+a[i].key,text:a[i].value});0<r.length&&(t[0].items=r),0<n.length&&(t[1].items=n);var s,o={cssClass:this.parent.element.id+"_accumulationChart"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:t,enableRtl:this.parent.enableRtl,beforeOpen:this.drillMenuOpen.bind(this),select:this.drillMenuSelect.bind(this),locale:this.parent.locale};this.accumulationMenu=new O.ContextMenu(o),Ue.select("#"+this.parent.element.id+"_accumulationChart",this.parent.element)?(s=Ue.select("#"+this.parent.element.id+"_accumulationChart",this.parent.element)).innerHTML="":(s=Ue.createElement("ul",{id:this.parent.element.id+"_accumulationChart"}),this.parent.element.appendChild(s)),this.accumulationMenu.isStringTemplate=!0,this.accumulationMenu.appendTo(s)},p.prototype.drillMenuOpen=function(e){e.items[0]&&e.items[0].text===this.parent.localeObj.getConstant("expand")&&e.items[0].items&&0===e.items[0].items.length&&this.accumulationMenu.enableItems([this.parent.localeObj.getConstant("expand")],!1),e.items[1]&&e.items[1].text===this.parent.localeObj.getConstant("collapse")&&e.items[1].items&&0===e.items[1].items.length&&this.accumulationMenu.enableItems([this.parent.localeObj.getConstant("collapse")],!1)},p.prototype.getMenuItems=function(){for(var e=this.pivotIndex.rIndex,t=[],i=this.engineModule.pivotValues,a=[],r=i[e][this.pivotIndex.cIndex],n=!i[e][0].isNamedSet&&i[e][0].hasChild?i[e][0].level:void 0,s="olap"===this.parent.dataType?r.rowHeaders.toString().split(/~~|::/):r.rowHeaders.toString().split(this.engineModule.valueSortSettings.headerDelimiter);i[e][0];){var o,r=i[e][0];0!==s.length&&s.indexOf(r.formattedText.toString())===s.length-1&&(r.hasChild&&!r.isNamedSet&&a.indexOf(r.level)<0&&(n?n>=r.level:0!==n||0===r.level)&&(r.isDrilled&&r.hasChild?t.push({key:e,type:"collapse",value:r.formattedText}):t.push({key:e,type:"expand",value:r.formattedText}),a.push(r.level),n=n?n-1:r.level-1),o=s.indexOf(r.formattedText.toString()),s.splice(o,1)),0===r.level&&r.hasChild&&!r.isNamedSet&&(n=void 0,a=[]),e--}return t},p.prototype.drillMenuSelect=function(e){var t,i,a,r,n=("olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule).pivotValues,s=e.element.id.split("_DrillMenuChart_")[1];0===e.element.id.indexOf(this.element.id+"drill")?(t=0<=e.element.id.split(this.element.id+"drill")[1].indexOf("Expand")?"drillExpand":"drillCollapse",t=n[e=Number(e.element.id.split(this.element.id+t+"_")[1])][0],i="olap"===this.parent.dataType?t.formattedText:(t.actualText||t.formattedText).toString(),a=t.formattedText?t.formattedText.toString():i,a=t.hasChild&&!t.isNamedSet?(t.isDrilled?" - ":" + ")+a:a,r=(r="olap"===this.parent.dataType?this.engineModule.tupRowInfo[t.ordinal]:void 0)?r.uNameCollection:t.valueSort.levelName.toString(),r={fieldName:t.valueSort.axis,level:t.level,hasChild:t.hasChild,levelName:r,name:i,text:a,rowIndex:e,colIndex:0,isDrilled:t.isDrilled,cell:t},"olap"===this.parent.dataType?this.parent.onDrill(void 0,r):this.onDrill({customAttributes:r})):"drillThrough"===s?this.parent.drillThroughModule.executeDrillThrough(n[this.pivotIndex.rIndex][this.pivotIndex.cIndex],this.pivotIndex.rIndex,this.pivotIndex.rIndex):"exit"===s&&this.accumulationMenu.close()},p.prototype.getChartHeight=function(){var e,t,i;return Ue.isNullOrUndefined(this.parent.getHeightAsNumber())?e="auto":(t=this.parent.showToolbar?6:5,e=(this.parent.getHeightAsNumber()-t).toString(),t=this.parent.getHeightAsNumber()-t),Ue.isNullOrUndefined(this.parent.getHeightAsNumber())?e="auto":(i=!1,null!==this.parent.element.querySelector(".e-chart-grouping-bar")&&"none"===this.parent.element.querySelector(".e-chart-grouping-bar").style.display.toLowerCase()&&(i=!0,this.parent.element.querySelector(".e-chart-grouping-bar").style.display="block"),this.parent.showToolbar&&this.parent.showGroupingBar?e=(t-(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:42)-(this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:62)).toString():this.parent.showToolbar?e=(t-(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:42)).toString():this.parent.showGroupingBar?e=(t-(this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:62)).toString():(this.parent.chart&&parseInt(this.parent.chart.height,10)<200||t<200)&&(e="200"),i&&(this.parent.element.querySelector(".e-chart-grouping-bar").style.display="none")),e},p.prototype.getChartAutoHeight=function(){var e=this.parent.element.offsetHeight<this.parent.minHeight?this.parent.minHeight:this.parent.element.offsetHeight;return this.parent.showToolbar&&this.parent.showGroupingBar?e=e-(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:42)-(this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:62):this.parent.showToolbar?e-=this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").clientHeight:42:this.parent.showGroupingBar&&(e-=this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").clientHeight:62),e},p.prototype.axisLabelRender=function(e){var t,i;this.chartSettings.showMultiLevelLabels&&"Pareto"!==this.chartSettings.chartSeries.type&&"primaryXAxis"===e.axis.name&&(e.text=""),"primaryXAxis"!==e.axis.name&&(i=this.engineModule.formatFields[this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.currentMeasure:e.axis.name],t=this.engineModule.getFormattedValue(e.value,this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.currentMeasure:e.axis.name,e.text),i=i&&i.format&&this.chartSettings.useGroupingSeparator?"olap"===this.parent.dataType?t.toString():t.formattedText:e.value.toString(),e.text=i),this.parent.trigger(et,e)},p.prototype.multiLevelLabelClick=function(e){var t={axis:e.axis,text:e.text,cell:Ue.isNullOrUndefined(e.customAttributes)?void 0:e.customAttributes.cell,cancel:!1};this.parent.trigger(be,t),!t.cancel&&e.customAttributes&&e.customAttributes.hasChild&&!e.customAttributes.cell.isNamedSet&&("olap"===this.parent.dataType?this.parent.onDrill(void 0,e.customAttributes):this.onDrill(e))},p.prototype.onDrill=function(e){var e=e.customAttributes,t=this.dataSourceSettings.drilledMembers[0]&&this.dataSourceSettings.drilledMembers[0].delimiter?this.dataSourceSettings.drilledMembers[0].delimiter:"**",i=e.fieldName,a=this.engineModule.pivotValues[e.rowIndex][e.colIndex],r=a.valueSort.levelName.split(this.engineModule.valueSortSettings.headerDelimiter).join(t),n=!1;if(0===this.dataSourceSettings.drilledMembers.length)this.parent.setProperties({dataSourceSettings:{drilledMembers:[{name:i,items:[r],delimiter:t}]}},!0);else{for(var s=0;s<this.dataSourceSettings.drilledMembers.length;s++){var o,l=this.dataSourceSettings.drilledMembers[s],r=r.split(t).join(l.delimiter||t),t=l.delimiter=l.delimiter||t;l.name===i&&(n=!0,-1<(o=l.items.indexOf(r))?l.items.splice(o,1):l.items.push(r))}n||this.dataSourceSettings.drilledMembers.push({name:i,items:[r],delimiter:t})}this.parent.showWaitingPopup();var d=this,e={fieldName:i,memberName:r,delimiter:t,axis:"row",action:e.isDrilled?"up":"down",currentCell:a},a={drillInfo:e,pivotview:d.parent},a=(d.parent.trigger(ce,a),{dataSourceSettings:Ce.getClonedDataSourceSettings(this.parent.dataSourceSettings)}),a=(this.parent.trigger(_,a),this.parent.setProperties({dataSourceSettings:a.dataSourceSettings},!0),d.parent.enableVirtualization||d.parent.enablePaging?"Server"===d.parent.dataSourceSettings.mode?d.parent.getEngine("onDrill",e,null,null,null,null,null):(d.engineModule.drilledMembers=d.dataSourceSettings.drilledMembers,d.engineModule.onDrill(e)):"Server"===d.parent.dataSourceSettings.mode?d.parent.getEngine("onDrill",e,null,null,null,null,null):d.engineModule.generateGridData(d.dataSourceSettings,!0),d.parent.allowServerDataBinding=!1,d.parent.setProperties({pivotValues:d.engineModule.pivotValues},!0),d.parent.allowServerDataBinding=!0,{dataSourceSettings:Ce.getClonedDataSourceSettings(this.parent.dataSourceSettings),pivotValues:this.parent.pivotValues});this.parent.trigger(U,a),d.engineModule.pivotValues=a.pivotValues,d.parent.renderPivotGrid()},p.prototype.isAttributeDrill=function(e,t){for(var i=!1,a=0;a<this.dataSourceSettings.drilledMembers.length;a++)if(this.dataSourceSettings.drilledMembers[a].name===e)for(var r=0;r<this.dataSourceSettings.drilledMembers[a].items.length;r++){for(var n=this.dataSourceSettings.drilledMembers[a].items[r].split(this.dataSourceSettings.drilledMembers[a].delimiter),s="",o=0;o<n.length;o++)t[o]&&t[o].uName&&(s=s+(""===s?"":this.dataSourceSettings.drilledMembers[a].delimiter)+(-1<t[o].uName.indexOf("[Measures]")?"[Measures]":t[o].uName));if(s===this.dataSourceSettings.drilledMembers[a].items[r]){i=!0;break}}return i},p.prototype.load=function(e){e.chart.zoomModule&&(e.chart.zoomModule.isZoomed=!0),this.parent.trigger(Ze,e)},p.prototype.beforePrint=function(e){this.parent.trigger(Ae,e)},p.prototype.animationComplete=function(e){this.parent.trigger(Re,e)},p.prototype.legendRender=function(e){this.parent.trigger(ke,e)},p.prototype.textRender=function(e){this.parent.trigger(je,e)},p.prototype.pointRender=function(e){this.parent.trigger(qe,e)},p.prototype.seriesRender=function(e){this.parent.trigger(Ve,e)},p.prototype.chartMouseMove=function(e){this.parent.trigger(He,e)},p.prototype.chartMouseClick=function(e){this.parent.trigger(_e,e)},p.prototype.pointMove=function(e){this.parent.trigger(Be,e)},p.prototype.chartMouseLeave=function(e){this.parent.trigger(Ge,e)},p.prototype.chartMouseDown=function(e){this.parent.trigger(ze,e)},p.prototype.chartMouseUp=function(e){this.parent.trigger(We,e)},p.prototype.dragComplete=function(e){this.parent.trigger(Qe,e)},p.prototype.zoomComplete=function(e){this.parent.trigger(Ye,e)},p.prototype.scrollStart=function(e){this.parent.trigger(Ke,e)},p.prototype.scrollEnd=function(e){this.parent.trigger(Xe,e)},p.prototype.scrollChanged=function(e){this.parent.trigger(Je,e)},p.prototype.multiLevelLabelRender=function(e){this.parent.trigger(Le,e)},p.prototype.resized=function(e){this.accumulationType.indexOf(this.chartSettings.chartSeries.type)<0&&(e.chart.primaryXAxis.zoomFactor=Ue.isNullOrUndefined(this.parent.chartSettings.primaryXAxis.zoomFactor)?this.getZoomFactor():this.parent.chartSettings.primaryXAxis.zoomFactor,this.parent.chartSettings.zoomSettings.enableScrollbar||(e.chart.primaryXAxis.zoomFactor=Ue.isNullOrUndefined(this.parent.chartSettings.primaryXAxis.zoomFactor)?1:this.parent.chartSettings.primaryXAxis.zoomFactor)),this.parent.trigger($e,e)},p.prototype.getResizedChartHeight=function(){return(["Pie","Funnel","Pyramid","Doughnut","Radar","Polar","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)<0&&this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&0<this.parent.dataSourceSettings.values.length?Number(this.parent.chart.height)>235*this.parent.dataSourceSettings.values.length+100?isNaN(Number(this.getChartHeight()))?this.getChartHeight():Number(this.getChartHeight())-5:!isNaN(Number(this.getChartHeight()))||1<this.parent.dataSourceSettings.values.length?235*this.parent.dataSourceSettings.values.length+100:this.getChartHeight():this.getChartHeight()).toString()},p.prototype.destroy=function(){this.parent&&this.parent.isDestroyed||(this.engineModule&&!this.parent.destroyEngine&&(this.engineModule.fieldList={},this.engineModule={}),this.chartSeries&&(this.chartSeries=null),this.columnGroupObject&&(this.columnGroupObject=null),this.chartSeriesInfo&&(this.chartSeriesInfo={},this.selectedLegend=null),this.chartSettings&&(this.chartSettings=null),this.dataSourceSettings&&(this.dataSourceSettings=null),this.accumulationMenu&&!this.accumulationMenu.isDestroyed&&(this.accumulationMenu.destroy(),this.accumulationMenu=null),this.parent&&this.parent.chart&&!this.parent.chart.isDestroyed&&(this.parent.chart.destroy(),this.parent.chart=null))};var il=p;function p(e){this.headerColl={},this.maxLevel=0,this.columnGroupObject={},this.selectedLegend=0,this.chartSeriesInfo={},this.measurePos=-1,this.measuresNames={},this.accumulationType=["Pie","Pyramid","Doughnut","Funnel"],this.isChartInitial=!0,this.parent=e}var al,rl,l={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},nl={size:"14px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},sl={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},ol={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},ll={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},dl={size:"12px",fontWeight:"Regular",color:"#353535",fontStyle:"Normal",fontFamily:"Segoe UI"},h=(al=function(e,t){return(al=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)},function(e,t){function i(){this.constructor=e}al(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),u=function(e,t,i,a){var r,n=arguments.length,s=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(n<3?r(s):3<n?r(t,i,s):r(t,i))||s);return 3<n&&s&&Object.defineProperty(t,i,s),s},pl=(rl=Ue.ChildProperty,h(hl,rl),u([Ue.Property(!0)],hl.prototype,"enable",void 0),u([Ue.Property(1e3)],hl.prototype,"duration",void 0),u([Ue.Property(0)],hl.prototype,"delay",void 0),hl);function hl(){return null!==rl&&rl.apply(this,arguments)||this}ul=Ue.ChildProperty,h(gl,ul),u([Ue.Property(null)],gl.prototype,"value",void 0),u([Ue.Property(null)],gl.prototype,"color",void 0),u([Ue.Property("0")],gl.prototype,"dashArray",void 0);var ul,cl=gl;function gl(){return null!==ul&&ul.apply(this,arguments)||this}ml=Ue.ChildProperty,h(fl,ml),u([Ue.Property("Normal")],fl.prototype,"fontStyle",void 0),u([Ue.Property("16px")],fl.prototype,"size",void 0),u([Ue.Property("Normal")],fl.prototype,"fontWeight",void 0),u([Ue.Property("")],fl.prototype,"color",void 0),u([Ue.Property("Center")],fl.prototype,"textAlignment",void 0),u([Ue.Property("Segoe UI")],fl.prototype,"fontFamily",void 0),u([Ue.Property(1)],fl.prototype,"opacity",void 0),u([Ue.Property("Trim")],fl.prototype,"textOverflow",void 0);var ml,Sl=fl;function fl(){return null!==ml&&ml.apply(this,arguments)||this}vl=Ue.ChildProperty,h(bl,vl),u([Ue.Property(10)],bl.prototype,"left",void 0),u([Ue.Property(10)],bl.prototype,"right",void 0),u([Ue.Property(10)],bl.prototype,"top",void 0),u([Ue.Property(10)],bl.prototype,"bottom",void 0);var vl,yl=bl;function bl(){return null!==vl&&vl.apply(this,arguments)||this}Cl=Ue.ChildProperty,h(wl,Cl),u([Ue.Property("")],wl.prototype,"color",void 0),u([Ue.Property(1)],wl.prototype,"width",void 0);var Cl,xl=wl;function wl(){return null!==Cl&&Cl.apply(this,arguments)||this}Tl=Ue.ChildProperty,h(Dl,Tl),u([Ue.Property(0)],Dl.prototype,"x",void 0),u([Ue.Property(0)],Dl.prototype,"y",void 0);var Tl,Ml=Dl;function Dl(){return null!==Tl&&Tl.apply(this,arguments)||this}Ol=Ue.ChildProperty,h(Nl,Ol),u([Ue.Property(0)],Nl.prototype,"series",void 0),u([Ue.Property(0)],Nl.prototype,"point",void 0);var Ol,Pl=Nl;function Nl(){return null!==Ol&&Ol.apply(this,arguments)||this}El=Ue.ChildProperty,h(Il,El),u([Ue.Complex({},xl)],Il.prototype,"border",void 0),u([Ue.Property("transparent")],Il.prototype,"background",void 0),u([Ue.Property(1)],Il.prototype,"opacity",void 0),u([Ue.Property(null)],Il.prototype,"backgroundImage",void 0);var El,Fl=Il;function Il(){return null!==El&&El.apply(this,arguments)||this}Ll=Ue.ChildProperty,h(Rl,Ll),u([Ue.Property(!1)],Rl.prototype,"enable",void 0),u([Ue.Property("")],Rl.prototype,"dashArray",void 0),u([Ue.Complex({color:null,width:1},xl)],Rl.prototype,"line",void 0),u([Ue.Property("Both")],Rl.prototype,"lineType",void 0);var Ll,Al=Rl;function Rl(){return null!==Ll&&Ll.apply(this,arguments)||this}kl=Ue.ChildProperty,h(ql,kl),u([Ue.Property(!1)],ql.prototype,"visible",void 0),u([Ue.Property(null)],ql.prototype,"name",void 0),u([Ue.Property("transparent")],ql.prototype,"fill",void 0),u([Ue.Property(1)],ql.prototype,"opacity",void 0),u([Ue.Property(0)],ql.prototype,"angle",void 0),u([Ue.Property(!1)],ql.prototype,"enableRotation",void 0),u([Ue.Property("Auto")],ql.prototype,"position",void 0),u([Ue.Property(5)],ql.prototype,"rx",void 0),u([Ue.Property(5)],ql.prototype,"ry",void 0),u([Ue.Property("Center")],ql.prototype,"alignment",void 0),u([Ue.Complex({width:null,color:null},xl)],ql.prototype,"border",void 0),u([Ue.Complex({left:5,right:5,top:5,bottom:5},yl)],ql.prototype,"margin",void 0),u([Ue.Complex({size:"11px",color:"",fontStyle:"Normal",fontWeight:"Normal",fontFamily:"Segoe UI"},Sl)],ql.prototype,"font",void 0),u([Ue.Property(null)],ql.prototype,"template",void 0);var kl,jl=ql;function ql(){return null!==kl&&kl.apply(this,arguments)||this}Vl=Ue.ChildProperty,h(_l,Vl),u([Ue.Property("Line")],_l.prototype,"type",void 0),u([Ue.Property(null)],_l.prototype,"color",void 0),u([Ue.Property(1)],_l.prototype,"width",void 0),u([Ue.Property(null)],_l.prototype,"length",void 0),u([Ue.Property("")],_l.prototype,"dashArray",void 0);var Vl,Hl=_l;function _l(){return null!==Vl&&Vl.apply(this,arguments)||this}Ul=Ue.ChildProperty,h(Bl,Ul),u([Ue.Property(!0)],Bl.prototype,"visible",void 0),u([Ue.Complex({width:null,color:null},xl)],Bl.prototype,"border",void 0),u([Ue.Complex({size:"11px",color:"",fontStyle:"Normal",fontWeight:"Normal",fontFamily:"Segoe UI"},Sl)],Bl.prototype,"font",void 0),u([Ue.Property("transparent")],Bl.prototype,"fill",void 0),u([Ue.Property(0)],Bl.prototype,"angle",void 0),u([Ue.Property(!1)],Bl.prototype,"enableRotation",void 0),u([Ue.Property("Outside")],Bl.prototype,"position",void 0),u([Ue.Property(5)],Bl.prototype,"rx",void 0),u([Ue.Property(5)],Bl.prototype,"ry",void 0),u([Ue.Property(null)],Bl.prototype,"template",void 0),u([Ue.Complex({},Hl)],Bl.prototype,"connectorStyle",void 0);var Ul,Hl=Bl;function Bl(){return null!==Ul&&Ul.apply(this,arguments)||this}Gl=Ue.ChildProperty,h(zl,Gl),u([Ue.Property(!1)],zl.prototype,"visible",void 0),u([Ue.Property("Circle")],zl.prototype,"shape",void 0),u([Ue.Property("")],zl.prototype,"imageUrl",void 0),u([Ue.Property(5)],zl.prototype,"width",void 0),u([Ue.Property(5)],zl.prototype,"height",void 0),u([Ue.Complex({width:2,color:null},xl)],zl.prototype,"border",void 0),u([Ue.Complex({x:0,y:0},Ml)],zl.prototype,"offset",void 0),u([Ue.Property(null)],zl.prototype,"fill",void 0),u([Ue.Property(1)],zl.prototype,"opacity",void 0),u([Ue.Complex({},jl)],zl.prototype,"dataLabel",void 0);var Gl,Ml=zl;function zl(){return null!==Gl&&Gl.apply(this,arguments)||this}Wl=Ue.ChildProperty,h(Yl,Wl),u([Ue.Property(1)],Yl.prototype,"width",void 0),u([Ue.Property(10)],Yl.prototype,"length",void 0),u([Ue.Property(null)],Yl.prototype,"color",void 0),u([Ue.Property(1)],Yl.prototype,"opacity",void 0);var Wl,Ql=Yl;function Yl(){return null!==Wl&&Wl.apply(this,arguments)||this}Kl=Ue.ChildProperty,h(Xl,Kl),u([Ue.Property(!1)],Xl.prototype,"visible",void 0),u([Ue.Property("Fixed")],Xl.prototype,"type",void 0),u([Ue.Property("Both")],Xl.prototype,"direction",void 0),u([Ue.Property("Vertical")],Xl.prototype,"mode",void 0),u([Ue.Property(1)],Xl.prototype,"verticalError",void 0),u([Ue.Property(null)],Xl.prototype,"color",void 0),u([Ue.Property(1)],Xl.prototype,"width",void 0),u([Ue.Property(1)],Xl.prototype,"horizontalError",void 0),u([Ue.Property(3)],Xl.prototype,"verticalNegativeError",void 0),u([Ue.Property(3)],Xl.prototype,"verticalPositiveError",void 0),u([Ue.Property(1)],Xl.prototype,"horizontalNegativeError",void 0),u([Ue.Property(1)],Xl.prototype,"horizontalPositiveError",void 0),u([Ue.Complex(null,Ql)],Xl.prototype,"errorBarCap",void 0);var Kl,g=Xl;function Xl(){return null!==Kl&&Kl.apply(this,arguments)||this}Jl=Ue.ChildProperty,h($l,Jl),u([Ue.Property("")],$l.prototype,"name",void 0),u([Ue.Property("0")],$l.prototype,"dashArray",void 0),u([Ue.Property(!0)],$l.prototype,"visible",void 0),u([Ue.Property(2)],$l.prototype,"period",void 0),u([Ue.Property("Linear")],$l.prototype,"type",void 0),u([Ue.Property(0)],$l.prototype,"backwardForecast",void 0),u([Ue.Property(0)],$l.prototype,"forwardForecast",void 0),u([Ue.Property(2)],$l.prototype,"polynomialOrder",void 0),u([Ue.Complex({},Ml)],$l.prototype,"marker",void 0),u([Ue.Property(!0)],$l.prototype,"enableTooltip",void 0),u([Ue.Complex({},pl)],$l.prototype,"animation",void 0),u([Ue.Property("")],$l.prototype,"fill",void 0),u([Ue.Property(1)],$l.prototype,"width",void 0),u([Ue.Property(null)],$l.prototype,"intercept",void 0),u([Ue.Property("SeriesType")],$l.prototype,"legendShape",void 0);var Jl,Zl=$l;function $l(){return null!==Jl&&Jl.apply(this,arguments)||this}ed=Ue.ChildProperty,h(id,ed),u([Ue.Property(null)],id.prototype,"fill",void 0),u([Ue.Complex({color:"transparent",width:0},xl)],id.prototype,"border",void 0),u([Ue.Property("Zero")],id.prototype,"mode",void 0);var ed,td=id;function id(){return null!==ed&&ed.apply(this,arguments)||this}ad=Ue.ChildProperty,h(nd,ad),u([Ue.Property(0)],nd.prototype,"topLeft",void 0),u([Ue.Property(0)],nd.prototype,"topRight",void 0),u([Ue.Property(0)],nd.prototype,"bottomLeft",void 0),u([Ue.Property(0)],nd.prototype,"bottomRight",void 0);var ad,rd=nd;function nd(){return null!==ad&&ad.apply(this,arguments)||this}sd=Ue.ChildProperty,h(ld,sd),u([Ue.Property(!1)],ld.prototype,"enable",void 0),u([Ue.Property(null)],ld.prototype,"fill",void 0),u([Ue.Complex(sl,Sl)],ld.prototype,"textStyle",void 0);var sd,od=ld;function ld(){return null!==sd&&sd.apply(this,arguments)||this}dd=Ue.ChildProperty,h(hd,dd),u([Ue.Property(!0)],hd.prototype,"visible",void 0),u([Ue.Property(!1)],hd.prototype,"startFromAxis",void 0),u([Ue.Property(null)],hd.prototype,"start",void 0),u([Ue.Property(null)],hd.prototype,"end",void 0),u([Ue.Property(null)],hd.prototype,"size",void 0),u([Ue.Property("#808080")],hd.prototype,"color",void 0),u([Ue.Property(null)],hd.prototype,"dashArray",void 0),u([Ue.Property("Auto")],hd.prototype,"sizeType",void 0),u([Ue.Property(!1)],hd.prototype,"isRepeat",void 0),u([Ue.Property(null)],hd.prototype,"repeatEvery",void 0),u([Ue.Property(null)],hd.prototype,"repeatUntil",void 0),u([Ue.Property(!1)],hd.prototype,"isSegmented",void 0),u([Ue.Property(null)],hd.prototype,"segmentStart",void 0),u([Ue.Property(null)],hd.prototype,"segmentEnd",void 0),u([Ue.Property(null)],hd.prototype,"segmentAxisName",void 0),u([Ue.Complex({color:"transparent",width:1},xl)],hd.prototype,"border",void 0),u([Ue.Property("")],hd.prototype,"text",void 0),u([Ue.Property(null)],hd.prototype,"rotation",void 0),u([Ue.Property("Middle")],hd.prototype,"horizontalAlignment",void 0),u([Ue.Property("Middle")],hd.prototype,"verticalAlignment",void 0),u([Ue.Complex(dl,Sl)],hd.prototype,"textStyle",void 0),u([Ue.Property("Behind")],hd.prototype,"zIndex",void 0),u([Ue.Property(1)],hd.prototype,"opacity",void 0);var dd,pd=hd;function hd(){return null!==dd&&dd.apply(this,arguments)||this}ud=Ue.ChildProperty,h(gd,ud),u([Ue.Property("")],gd.prototype,"color",void 0),u([Ue.Property(1)],gd.prototype,"width",void 0),u([Ue.Property("Rectangle")],gd.prototype,"type",void 0);var ud,cd=gd;function gd(){return null!==ud&&ud.apply(this,arguments)||this}md=Ue.ChildProperty,h(fd,md),u([Ue.Property(1)],fd.prototype,"width",void 0),u([Ue.Property("")],fd.prototype,"dashArray",void 0),u([Ue.Property(null)],fd.prototype,"color",void 0);var md,Sd=fd;function fd(){return null!==md&&md.apply(this,arguments)||this}vd=Ue.ChildProperty,h(bd,vd),u([Ue.Property(.7)],bd.prototype,"width",void 0),u([Ue.Property("")],bd.prototype,"dashArray",void 0),u([Ue.Property(null)],bd.prototype,"color",void 0);var vd,yd=bd;function bd(){return null!==vd&&vd.apply(this,arguments)||this}Cd=Ue.ChildProperty,h(wd,Cd),u([Ue.Property(1)],wd.prototype,"width",void 0),u([Ue.Property("")],wd.prototype,"dashArray",void 0),u([Ue.Property(null)],wd.prototype,"color",void 0);var Cd,xd=wd;function wd(){return null!==Cd&&Cd.apply(this,arguments)||this}Td=Ue.ChildProperty,h(Dd,Td),u([Ue.Property(1)],Dd.prototype,"width",void 0),u([Ue.Property(5)],Dd.prototype,"height",void 0),u([Ue.Property(null)],Dd.prototype,"color",void 0);var Td,Md=Dd;function Dd(){return null!==Td&&Td.apply(this,arguments)||this}Od=Ue.ChildProperty,h(Nd,Od),u([Ue.Property(.7)],Nd.prototype,"width",void 0),u([Ue.Property(5)],Nd.prototype,"height",void 0),u([Ue.Property(null)],Nd.prototype,"color",void 0);var Od,Pd=Nd;function Nd(){return null!==Od&&Od.apply(this,arguments)||this}Ed=Ue.ChildProperty,h(Id,Ed),u([Ue.Property(0)],Id.prototype,"x",void 0),u([Ue.Property(0)],Id.prototype,"y",void 0);var Ed,Fd=Id;function Id(){return null!==Ed&&Ed.apply(this,arguments)||this}u([Ue.Property("")],Ld.prototype,"color",void 0),u([Ue.Property(1)],Ld.prototype,"width",void 0);function Ld(){}u([Ue.Property(!0)],Ad.prototype,"enable",void 0),u([Ue.Property(1e3)],Ad.prototype,"duration",void 0),u([Ue.Property(0)],Ad.prototype,"delay",void 0);function Ad(){}u([Ue.Property(null)],Rd.prototype,"value",void 0),u([Ue.Property(null)],Rd.prototype,"color",void 0),u([Ue.Property("0")],Rd.prototype,"dashArray",void 0);function Rd(){}u([Ue.Property(!1)],kd.prototype,"visible",void 0),u([Ue.Property("Circle")],kd.prototype,"shape",void 0),u([Ue.Property("")],kd.prototype,"imageUrl",void 0),u([Ue.Property(5)],kd.prototype,"height",void 0),u([Ue.Property(5)],kd.prototype,"width",void 0),u([Ue.Complex({width:2,color:null},xl)],kd.prototype,"border",void 0),u([Ue.Property(null)],kd.prototype,"fill",void 0),u([Ue.Property(1)],kd.prototype,"opacity",void 0),u([Ue.Complex({},jl)],kd.prototype,"dataLabel",void 0);function kd(){}u([Ue.Property(!1)],jd.prototype,"visible",void 0),u([Ue.Property("Fixed")],jd.prototype,"type",void 0),u([Ue.Property("Both")],jd.prototype,"direction",void 0),u([Ue.Property("Vertical")],jd.prototype,"mode",void 0),u([Ue.Property(null)],jd.prototype,"color",void 0),u([Ue.Property(1)],jd.prototype,"verticalError",void 0),u([Ue.Property(1)],jd.prototype,"width",void 0),u([Ue.Property(1)],jd.prototype,"horizontalError",void 0),u([Ue.Property(3)],jd.prototype,"verticalPositiveError",void 0),u([Ue.Property(3)],jd.prototype,"verticalNegativeError",void 0),u([Ue.Property(1)],jd.prototype,"horizontalPositiveError",void 0),u([Ue.Property(1)],jd.prototype,"horizontalNegativeError",void 0),u([Ue.Complex(null,Ql)],jd.prototype,"errorBarCap",void 0);function jd(){}u([Ue.Property("")],qd.prototype,"name",void 0),u([Ue.Property("Linear")],qd.prototype,"type",void 0),u([Ue.Property(2)],qd.prototype,"period",void 0),u([Ue.Property(2)],qd.prototype,"polynomialOrder",void 0),u([Ue.Property(0)],qd.prototype,"backwardForecast",void 0),u([Ue.Property(0)],qd.prototype,"forwardForecast",void 0),u([Ue.Complex({},pl)],qd.prototype,"animation",void 0),u([Ue.Complex({},Ml)],qd.prototype,"marker",void 0),u([Ue.Property(!0)],qd.prototype,"enableTooltip",void 0),u([Ue.Property(null)],qd.prototype,"intercept",void 0),u([Ue.Property("")],qd.prototype,"fill",void 0),u([Ue.Property(1)],qd.prototype,"width",void 0),u([Ue.Property("SeriesType")],qd.prototype,"legendShape",void 0);function qd(){}u([Ue.Property(null)],Vd.prototype,"fill",void 0),u([Ue.Complex({color:"transparent",width:0},xl)],Vd.prototype,"border",void 0),u([Ue.Property("Zero")],Vd.prototype,"mode",void 0);function Vd(){}u([Ue.Property(0)],Hd.prototype,"topLeft",void 0),u([Ue.Property(0)],Hd.prototype,"topRight",void 0),u([Ue.Property(0)],Hd.prototype,"bottomLeft",void 0),u([Ue.Property(0)],Hd.prototype,"bottomRight",void 0);function Hd(){}u([Ue.Property("Normal")],_d.prototype,"fontStyle",void 0),u([Ue.Property("16px")],_d.prototype,"size",void 0),u([Ue.Property("Normal")],_d.prototype,"fontWeight",void 0),u([Ue.Property("")],_d.prototype,"color",void 0),u([Ue.Property("Center")],_d.prototype,"textAlignment",void 0),u([Ue.Property("Segoe UI")],_d.prototype,"fontFamily",void 0),u([Ue.Property(1)],_d.prototype,"opacity",void 0),u([Ue.Property("Trim")],_d.prototype,"textOverflow",void 0);function _d(){}u([Ue.Property(!1)],Ud.prototype,"enable",void 0),u([Ue.Property(null)],Ud.prototype,"fill",void 0),u([Ue.Complex(sl,Sl)],Ud.prototype,"textStyle",void 0);function Ud(){}u([Ue.Property(1)],Bd.prototype,"width",void 0),u([Ue.Property(5)],Bd.prototype,"height",void 0),u([Ue.Property(null)],Bd.prototype,"color",void 0);function Bd(){}u([Ue.Property(1)],Gd.prototype,"width",void 0),u([Ue.Property("")],Gd.prototype,"dashArray",void 0),u([Ue.Property(null)],Gd.prototype,"color",void 0);function Gd(){}u([Ue.Property(.7)],zd.prototype,"width",void 0),u([Ue.Property(5)],zd.prototype,"height",void 0),u([Ue.Property(null)],zd.prototype,"color",void 0);function zd(){}u([Ue.Property(.7)],Wd.prototype,"width",void 0),u([Ue.Property("")],Wd.prototype,"dashArray",void 0),u([Ue.Property(null)],Wd.prototype,"color",void 0);function Wd(){}u([Ue.Property(1)],Qd.prototype,"width",void 0),u([Ue.Property("")],Qd.prototype,"dashArray",void 0),u([Ue.Property(null)],Qd.prototype,"color",void 0);function Qd(){}u([Ue.Property(!0)],Yd.prototype,"visible",void 0),u([Ue.Property(!1)],Yd.prototype,"startFromAxis",void 0),u([Ue.Property(null)],Yd.prototype,"start",void 0),u([Ue.Property(null)],Yd.prototype,"end",void 0),u([Ue.Property(null)],Yd.prototype,"size",void 0),u([Ue.Property("#808080")],Yd.prototype,"color",void 0),u([Ue.Property(null)],Yd.prototype,"dashArray",void 0),u([Ue.Property("Auto")],Yd.prototype,"sizeType",void 0),u([Ue.Property(!1)],Yd.prototype,"isRepeat",void 0),u([Ue.Property(null)],Yd.prototype,"repeatEvery",void 0),u([Ue.Property(null)],Yd.prototype,"repeatUntil",void 0),u([Ue.Property(!1)],Yd.prototype,"isSegmented",void 0),u([Ue.Property(null)],Yd.prototype,"segmentStart",void 0),u([Ue.Property(null)],Yd.prototype,"segmentEnd",void 0),u([Ue.Property(null)],Yd.prototype,"segmentAxisName",void 0),u([Ue.Complex({color:"transparent",width:1},xl)],Yd.prototype,"border",void 0),u([Ue.Property("")],Yd.prototype,"text",void 0),u([Ue.Property(null)],Yd.prototype,"rotation",void 0),u([Ue.Property("Middle")],Yd.prototype,"horizontalAlignment",void 0),u([Ue.Property("Middle")],Yd.prototype,"verticalAlignment",void 0),u([Ue.Complex(dl,Sl)],Yd.prototype,"textStyle",void 0),u([Ue.Property("Behind")],Yd.prototype,"zIndex",void 0),u([Ue.Property(1)],Yd.prototype,"opacity",void 0);function Yd(){}u([Ue.Property("")],Kd.prototype,"color",void 0),u([Ue.Property(1)],Kd.prototype,"width",void 0),u([Ue.Property("Rectangle")],Kd.prototype,"type",void 0);function Kd(){}u([Ue.Complex({},xl)],Xd.prototype,"border",void 0),u([Ue.Property("transparent")],Xd.prototype,"background",void 0),u([Ue.Property(1)],Xd.prototype,"opacity",void 0);function Xd(){}u([Ue.Property(!1)],Jd.prototype,"enable",void 0),u([Ue.Property("")],Jd.prototype,"dashArray",void 0),u([Ue.Complex({color:null,width:1},xl)],Jd.prototype,"line",void 0),u([Ue.Property("Both")],Jd.prototype,"lineType",void 0);function Jd(){}u([Ue.Property(!0)],Zd.prototype,"visible",void 0),u([Ue.Property(null)],Zd.prototype,"height",void 0),u([Ue.Property(null)],Zd.prototype,"width",void 0),u([Ue.Complex({x:0,y:0},Fd)],Zd.prototype,"location",void 0),u([Ue.Property("Auto")],Zd.prototype,"position",void 0),u([Ue.Property(8)],Zd.prototype,"padding",void 0),u([Ue.Property("Center")],Zd.prototype,"alignment",void 0),u([Ue.Complex(ll,Sl)],Zd.prototype,"textStyle",void 0),u([Ue.Property(10)],Zd.prototype,"shapeHeight",void 0),u([Ue.Property(10)],Zd.prototype,"shapeWidth",void 0),u([Ue.Complex({},xl)],Zd.prototype,"border",void 0),u([Ue.Complex({left:0,right:0,top:0,bottom:0},yl)],Zd.prototype,"margin",void 0),u([Ue.Property(5)],Zd.prototype,"shapePadding",void 0),u([Ue.Property("transparent")],Zd.prototype,"background",void 0),u([Ue.Property(1)],Zd.prototype,"opacity",void 0),u([Ue.Property(!0)],Zd.prototype,"toggleVisibility",void 0),u([Ue.Property(null)],Zd.prototype,"description",void 0),u([Ue.Property(3)],Zd.prototype,"tabIndex",void 0);function Zd(){}u([Ue.Property(0)],$d.prototype,"series",void 0),u([Ue.Property(0)],$d.prototype,"point",void 0);function $d(){}u([Ue.Property(10)],ep.prototype,"left",void 0),u([Ue.Property(10)],ep.prototype,"right",void 0),u([Ue.Property(10)],ep.prototype,"top",void 0),u([Ue.Property(10)],ep.prototype,"bottom",void 0);function ep(){}tp=Ue.ChildProperty,h(m,tp),u([Ue.Property(null)],m.prototype,"fill",void 0),u([Ue.Property(null)],m.prototype,"endAngle",void 0),u([Ue.Property(!1)],m.prototype,"explode",void 0),u([Ue.Property(!1)],m.prototype,"explodeAll",void 0),u([Ue.Property(null)],m.prototype,"explodeIndex",void 0),u([Ue.Property(null)],m.prototype,"innerRadius",void 0),u([Ue.Property("30%")],m.prototype,"explodeOffset",void 0),u([Ue.Property(0)],m.prototype,"gapRatio",void 0),u([Ue.Property("Value")],m.prototype,"groupMode",void 0),u([Ue.Property(null)],m.prototype,"groupTo",void 0),u([Ue.Property("20%")],m.prototype,"neckHeight",void 0),u([Ue.Property("20%")],m.prototype,"neckWidth",void 0),u([Ue.Property("Linear")],m.prototype,"pyramidMode",void 0),u([Ue.Property([])],m.prototype,"palettes",void 0),u([Ue.Property(0)],m.prototype,"startAngle",void 0),u([Ue.Complex(null,pl)],m.prototype,"animation",void 0),u([Ue.Complex(null,Hl)],m.prototype,"dataLabel",void 0),u([Ue.Property("0")],m.prototype,"dashArray",void 0),u([Ue.Property(1)],m.prototype,"width",void 0),u([Ue.Property("X")],m.prototype,"segmentAxis",void 0),u([Ue.Property("Line")],m.prototype,"drawType",void 0),u([Ue.Property(!0)],m.prototype,"isClosed",void 0),u([Ue.Collection([],cl)],m.prototype,"segments",void 0),u([Ue.Property("")],m.prototype,"stackingGroup",void 0),u([Ue.Complex({color:"transparent",width:0},xl)],m.prototype,"border",void 0),u([Ue.Property(!0)],m.prototype,"visible",void 0),u([Ue.Property(1)],m.prototype,"opacity",void 0),u([Ue.Property("Line")],m.prototype,"type",void 0),u([Ue.Complex(null,Ml)],m.prototype,"marker",void 0),u([Ue.Complex(null,g)],m.prototype,"errorBar",void 0),u([Ue.Property(!0)],m.prototype,"enableTooltip",void 0),u([Ue.Collection([],Zl)],m.prototype,"trendlines",void 0),u([Ue.Property("")],m.prototype,"tooltipMappingName",void 0),u([Ue.Property("SeriesType")],m.prototype,"legendShape",void 0),u([Ue.Property(1)],m.prototype,"minRadius",void 0),u([Ue.Property(null)],m.prototype,"selectionStyle",void 0),u([Ue.Property("Natural")],m.prototype,"splineType",void 0),u([Ue.Property(3)],m.prototype,"maxRadius",void 0),u([Ue.Property(.5)],m.prototype,"cardinalSplineTension",void 0),u([Ue.Property(null)],m.prototype,"columnWidth",void 0),u([Ue.Complex(null,td)],m.prototype,"emptyPointSettings",void 0),u([Ue.Complex(null,rd)],m.prototype,"cornerRadius",void 0),u([Ue.Property(0)],m.prototype,"columnSpacing",void 0);var tp,jl=m;function m(){return null!==tp&&tp.apply(this,arguments)||this}ip=Ue.ChildProperty,h(ap,ip),u([Ue.Property("Rotate45")],ap.prototype,"labelIntersectAction",void 0),u([Ue.Complex(l,Sl)],ap.prototype,"labelStyle",void 0),u([Ue.Property("")],ap.prototype,"title",void 0),u([Ue.Property(null)],ap.prototype,"zoomFactor",void 0),u([Ue.Complex({},od)],ap.prototype,"crosshairTooltip",void 0),u([Ue.Property("")],ap.prototype,"labelFormat",void 0),u([Ue.Complex(nl,Sl)],ap.prototype,"titleStyle",void 0),u([Ue.Property(!1)],ap.prototype,"isIndexed",void 0),u([Ue.Property(0)],ap.prototype,"plotOffset",void 0),u([Ue.Property("Shift")],ap.prototype,"edgeLabelPlacement",void 0),u([Ue.Property("BetweenTicks")],ap.prototype,"labelPlacement",void 0),u([Ue.Property("Outside")],ap.prototype,"tickPosition",void 0),u([Ue.Property(!1)],ap.prototype,"opposedPosition",void 0),u([Ue.Property(!0)],ap.prototype,"visible",void 0),u([Ue.Property("Outside")],ap.prototype,"labelPosition",void 0),u([Ue.Property(0)],ap.prototype,"labelRotation",void 0),u([Ue.Property(0)],ap.prototype,"minorTicksPerInterval",void 0),u([Ue.Property(null)],ap.prototype,"maximum",void 0),u([Ue.Property(null)],ap.prototype,"minimum",void 0),u([Ue.Property(34)],ap.prototype,"maximumLabelWidth",void 0),u([Ue.Property(null)],ap.prototype,"interval",void 0),u([Ue.Complex({},Md)],ap.prototype,"majorTickLines",void 0),u([Ue.Property(!1)],ap.prototype,"enableTrim",void 0),u([Ue.Complex({},Sd)],ap.prototype,"majorGridLines",void 0),u([Ue.Complex({},Pd)],ap.prototype,"minorTickLines",void 0),u([Ue.Complex({},xd)],ap.prototype,"lineStyle",void 0),u([Ue.Complex({},yd)],ap.prototype,"minorGridLines",void 0),u([Ue.Property(!1)],ap.prototype,"isInversed",void 0),u([Ue.Property(null)],ap.prototype,"description",void 0),u([Ue.Property(0)],ap.prototype,"startAngle",void 0),u([Ue.Property(100)],ap.prototype,"coefficient",void 0),u([Ue.Collection([],pd)],ap.prototype,"stripLines",void 0),u([Ue.Property(2)],ap.prototype,"tabIndex",void 0),u([Ue.Complex({color:null,width:0,type:"Rectangle"},cd)],ap.prototype,"border",void 0);var ip,Ql=ap;function ap(){return null!==ip&&ip.apply(this,arguments)||this}rp=Ue.ChildProperty,h(np,rp),u([Ue.Property(!1)],np.prototype,"enableMarker",void 0),u([Ue.Property(!0)],np.prototype,"enable",void 0),u([Ue.Property(null)],np.prototype,"fill",void 0),u([Ue.Property(!1)],np.prototype,"shared",void 0),u([Ue.Property(.75)],np.prototype,"opacity",void 0),u([Ue.Property(null)],np.prototype,"header",void 0),u([Ue.Property(null)],np.prototype,"format",void 0),u([Ue.Complex(ol,Sl)],np.prototype,"textStyle",void 0),u([Ue.Property(null)],np.prototype,"template",void 0),u([Ue.Complex({color:"#cccccc",width:.5},xl)],np.prototype,"border",void 0),u([Ue.Property(!0)],np.prototype,"enableAnimation",void 0);var rp,Fd=np;function np(){return null!==rp&&rp.apply(this,arguments)||this}sp=Ue.ChildProperty,h(op,sp),u([Ue.Property("50%")],op.prototype,"x",void 0),u([Ue.Property("50%")],op.prototype,"y",void 0);var sp,pl=op;function op(){return null!==sp&&sp.apply(this,arguments)||this}lp=Ue.ChildProperty,h(dp,lp),u([Ue.Property(!1)],dp.prototype,"enablePinchZooming",void 0),u([Ue.Property(!0)],dp.prototype,"enableSelectionZooming",void 0),u([Ue.Property(!1)],dp.prototype,"enableDeferredZooming",void 0),u([Ue.Property(!1)],dp.prototype,"enableMouseWheelZooming",void 0),u([Ue.Property("XY")],dp.prototype,"mode",void 0),u([Ue.Property(["Zoom","ZoomIn","ZoomOut","Pan","Reset"])],dp.prototype,"toolbarItems",void 0),u([Ue.Property(!0)],dp.prototype,"enableScrollbar",void 0),u([Ue.Property(!1)],dp.prototype,"enablePan",void 0);var lp,Hl=dp;function dp(){return null!==lp&&lp.apply(this,arguments)||this}pp=Ue.ChildProperty,h(S,pp),u([Ue.Complex({},jl)],S.prototype,"chartSeries",void 0),u([Ue.Complex({},Ql)],S.prototype,"primaryXAxis",void 0),u([Ue.Complex({},Ql)],S.prototype,"primaryYAxis",void 0),u([Ue.Property("")],S.prototype,"value",void 0),u([Ue.Property("")],S.prototype,"columnHeader",void 0),u([Ue.Property("-")],S.prototype,"columnDelimiter",void 0),u([Ue.Property(!1)],S.prototype,"enableMultipleAxis",void 0),u([Ue.Property("Stacked")],S.prototype,"multipleAxisMode",void 0),u([Ue.Property(!1)],S.prototype,"enableScrollOnMultiAxis",void 0),u([Ue.Property(!1)],S.prototype,"showMemberSeries",void 0),u([Ue.Property(!1)],S.prototype,"showPointColorByMembers",void 0),u([Ue.Complex({border:{color:null,width:.5},background:"transparent"},y.titleSettings)],S.prototype,"titleStyle",void 0),u([Ue.Property("")],S.prototype,"title",void 0),u([Ue.Complex({border:{color:null,width:.5},background:"transparent"},y.titleSettings)],S.prototype,"subTitleStyle",void 0),u([Ue.Property("")],S.prototype,"subTitle",void 0),u([Ue.Complex({color:"#DDDDDD",width:0},xl)],S.prototype,"border",void 0),u([Ue.Complex({},yl)],S.prototype,"margin",void 0),u([Ue.Complex({border:{color:null,width:.5},background:"transparent"},Fl)],S.prototype,"chartArea",void 0),u([Ue.Property(null)],S.prototype,"background",void 0),u([Ue.Property("Material")],S.prototype,"theme",void 0),u([Ue.Property([])],S.prototype,"palettes",void 0),u([Ue.Complex({},Al)],S.prototype,"crosshair",void 0),u([Ue.Complex({},Fd)],S.prototype,"tooltip",void 0),u([Ue.Complex(null,pl)],S.prototype,"pieCenter",void 0),u([Ue.Complex({},Hl)],S.prototype,"zoomSettings",void 0),u([Ue.Property()],S.prototype,"legendSettings",void 0),u([Ue.Property("None")],S.prototype,"selectionMode",void 0),u([Ue.Property("None")],S.prototype,"accumulationSelectionMode",void 0),u([Ue.Property(!0)],S.prototype,"enableSmartLabels",void 0),u([Ue.Property(!0)],S.prototype,"enableBorderOnMouseMove",void 0),u([Ue.Property("None")],S.prototype,"highlightMode",void 0),u([Ue.Property("None")],S.prototype,"highlightPattern",void 0),u([Ue.Property(!0)],S.prototype,"enableExport",void 0),u([Ue.Property(!1)],S.prototype,"isMultiSelect",void 0),u([Ue.Collection([],Pl)],S.prototype,"selectedDataIndexes",void 0),u([Ue.Property(!0)],S.prototype,"enableAnimation",void 0),u([Ue.Property(!1)],S.prototype,"enableCanvas",void 0),u([Ue.Property(!0)],S.prototype,"useGroupingSeparator",void 0),u([Ue.Property(!1)],S.prototype,"isTransposed",void 0),u([Ue.Property(1)],S.prototype,"tabIndex",void 0),u([Ue.Property(null)],S.prototype,"description",void 0),u([Ue.Event()],S.prototype,"resized",void 0),u([Ue.Property(!0)],S.prototype,"enableSideBySidePlacement",void 0),u([Ue.Event()],S.prototype,"loaded",void 0),u([Ue.Event()],S.prototype,"beforePrint",void 0),u([Ue.Event()],S.prototype,"animationComplete",void 0),u([Ue.Event()],S.prototype,"load",void 0),u([Ue.Event()],S.prototype,"textRender",void 0),u([Ue.Event()],S.prototype,"legendRender",void 0),u([Ue.Event()],S.prototype,"seriesRender",void 0),u([Ue.Event()],S.prototype,"multiLevelLabelRender",void 0),u([Ue.Event()],S.prototype,"pointRender",void 0),u([Ue.Event()],S.prototype,"tooltipRender",void 0),u([Ue.Event()],S.prototype,"legendClick",void 0),u([Ue.Event()],S.prototype,"axisLabelRender",void 0),u([Ue.Event()],S.prototype,"multiLevelLabelClick",void 0),u([Ue.Event()],S.prototype,"chartMouseClick",void 0),u([Ue.Event()],S.prototype,"chartMouseMove",void 0),u([Ue.Event()],S.prototype,"pointMove",void 0),u([Ue.Event()],S.prototype,"pointClick",void 0),u([Ue.Event()],S.prototype,"chartMouseDown",void 0),u([Ue.Event()],S.prototype,"chartMouseLeave",void 0),u([Ue.Event()],S.prototype,"dragComplete",void 0),u([Ue.Event()],S.prototype,"chartMouseUp",void 0),u([Ue.Event()],S.prototype,"scrollStart",void 0),u([Ue.Event()],S.prototype,"zoomComplete",void 0),u([Ue.Event()],S.prototype,"scrollChanged",void 0),u([Ue.Event()],S.prototype,"scrollEnd",void 0),u([Ue.Property(!0)],S.prototype,"showMultiLevelLabels",void 0);var pp,cl=S;function S(){return null!==pp&&pp.apply(this,arguments)||this}up.getCellSets=function(e,t,i,a,r){this.engine=t,this.isMondrian=t.isMondrian,this.isMeasureAvail=t.isMeasureAvail,this.isPaging=t.isPaging,this.pageSettings=t.pageSettings,this.rows=t.rows,this.columns=t.columns,this.values=t.values,this.filters=t.filters,this.allowLabelFilter=t.allowLabelFilter,this.allowValueFilter=t.allowValueFilter,this.drilledMembers=t.updateDrilledItems(e.drilledMembers),this.calculatedFieldSettings=t.calculatedFieldSettings,this.valueAxis="row"===e.valueAxis?"rows":"columns",a&&(a.axis="row"===a.axis?"rows":"columns"),this.filterMembers=Ue.extend({},t.filterMembers,null,!0),this.fieldDataObj=t.fieldListObj,this.fieldList=t.fieldList,this.cellSetInfo="\nDIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE";var n=this.getMeasuresQuery(this.values),s=this.getDimensionsQuery(this.rows,n,"rows",a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),n=this.getDimensionsQuery(this.columns,n,"columns",a).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),o=(this.isPaging&&i&&void 0!==this.pageSettings?(s=(o=this.getPagingQuery(s,n)).rowQuery,n=o.columnQuery):this.isPaging&&!i&&void 0!==this.pageSettings&&(s=(o=this.getPagingCountQuery(s,n)).rowQuery,n=o.columnQuery),s=0<s.length?s+(this.isPaging&&!i?"":this.cellSetInfo+" ON ROWS"):"",n=0<n.length?n+(this.isPaging&&!i?"":this.cellSetInfo+" ON COLUMNS"):"",this.getSlicersQuery(this.filters,"filters").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""")),l=this.getfilterQuery(this.filterMembers,e.cube).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),d=this.getCalculatedFieldQuery(this.calculatedFieldSettings).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),s=this.frameMDXQuery(s,n,o,l,d,i),n={catalog:e.catalog,cube:e.cube,url:e.url,request:s,LCID:e.localeIdentifier.toString(),roles:e.roles};t.mdxQuery=s.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/%280/g,'"').replace(/'/g,"'"),a&&(a.axis="rows"===a.axis?"row":"column"),r||this.getTableCellData(n,(this.isPaging&&!i?this.engine.generatePagingData:this.engine.generateEngine).bind(this.engine),a?{action:a.action,drillInfo:a}:{dataSourceSettings:e,action:"loadTableElements"})},up.getTableCellData=function(e,t,i){var a=this.engine.getConnectionInfo(e.url,e.LCID),e='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Header></Header> <Body> <Execute xmlns="urn:schemas-microsoft-com:xml-analysis"> <Command> <Statement>'+e.request+"</Statement> </Command> <Properties> <PropertyList> <Catalog>"+e.catalog+"</Catalog> <LocaleIdentifier>"+a.LCID+"</LocaleIdentifier>"+(e.roles?"<Roles>"+e.roles+"</Roles>":"")+"</PropertyList> </Properties></Execute> </Body> </Envelope>";if(this.engine.doAjaxPost("POST",a.url,e,t,i),this.engine.errorInfo)throw this.engine.errorInfo},up.frameMDXQuery=function(e,t,i,a,r,n){var s=this.isPaging&&!n?""!==r?"":"\nWITH":"\nSelect ";return 0<t.length&&(s+=t),s=r+(s=0<e.length?s+(!(0<t.length)||this.isPaging&&!n?"":", ")+e:s)+(this.isPaging&&!n?"\nMEMBER [Measures].[3d268ce0-664d-4092-b9cb-fece97175006] AS Count([e16a30d0-2174-4874-8dae-a5085a75a3e2]) MEMBER [Measures].[8d7fe8c1-f09f-410e-b9ba-eaab75a1fc3e] AS Count ([d1876d2b-e50e-4547-85fe-5b8ed9d629de])\nSELECT { [Measures].[3d268ce0-664d-4092-b9cb-fece97175006] , [Measures].[8d7fe8c1-f09f-410e-b9ba-eaab75a1fc3e] } ON AXIS(0)":"")+" "+a+i+"\nCELL PROPERTIES VALUE, FORMAT_STRING, FORMATTED_VALUE\n"},up.getPagingQuery=function(e,t){e=e.replace("NON EMPTY ( ","").slice(0,-1),t=t.replace("NON EMPTY ( ","").slice(0,-1);var i=e,a=(this.pageSettings.currentRowPage-1)*this.pageSettings.rowPageSize,r=(this.pageSettings.currentColumnPage-1)*this.pageSettings.columnPageSize,n=this.engine.isExporting&&this.engine.exportSpeciedPages&&this.engine.exportSpeciedPages.rowSize?this.engine.exportSpeciedPages.rowSize:3*this.pageSettings.rowPageSize,s=this.engine.isExporting&&this.engine.exportSpeciedPages&&this.engine.exportSpeciedPages.columnSize?this.engine.exportSpeciedPages.columnSize:3*this.pageSettings.columnPageSize,a=this.engine.rowCount<a+n?this.engine.rowCount>n?this.engine.rowCount-n:0:a;return this.engine.pageRowStartPos=a,r=this.engine.columnCount<r+s?this.engine.columnCount>s?this.engine.columnCount-s:0:r,this.engine.pageColStartPos=r,{rowQuery:""!==e?"\nSUBSET ({ "+(this.isMondrian?"":"NONEMPTY")+" ("+e+(this.isMondrian||""===t?"":","+t)+")},"+a+","+n+")":"",columnQuery:""!==t?"\nSUBSET ({ "+(this.isMondrian?"":"NONEMPTY")+" ("+t+(this.isMondrian||""===i?"":","+i)+")},"+r+","+s+")":""}},up.getPagingCountQuery=function(e,t){e=e.replace("NON EMPTY ( ","").slice(0,-1),t=t.replace("NON EMPTY ( ","").slice(0,-1);var i=e;return{rowQuery:""!==e?"SET [d1876d2b-e50e-4547-85fe-5b8ed9d629de] as "+(this.isMondrian?"":"NONEMPTY")+" ("+e+(this.isMondrian||""===t?"":","+t)+")\n":"",columnQuery:""!==t?"\nSET [e16a30d0-2174-4874-8dae-a5085a75a3e2] as "+(this.isMondrian?"":"NONEMPTY")+" ("+t+(this.isMondrian||""===i?"":","+i)+")\n":""}},up.getDimensionsQuery=function(e,t,i,a){var r="";if(0<e.length){for(var r="\nNON EMPTY ( "+(0<this.drilledMembers.length?"HIERARCHIZE ({":""),n=0;n<e.length;)0===n?"[measures]"===e[n].name.toLowerCase()?""!==t&&(r+=t):r+="({"+this.getDimensionQuery(e[n],i)+"})":"[measures]"===e[n].name.toLowerCase()?""!==t&&(r=r+" * "+t):r=r+" * "+("({"+this.getDimensionQuery(e[n],i)+"})"),n++;var s=this.getDrillQuery(e,t,i,a),s=(r=a&&a.axis===i?"\nNON EMPTY ( "+(0<this.drilledMembers.length?"HIERARCHIZE ({":"")+s.query:r+(""!==s.query?",":"")+s.query,this.getAttributeDrillQuery(e,t,i,a));r=r+(this.isPaging?(""!==s?"-":"")+s:"")+(0<this.drilledMembers.length?"})":"")+(this.isPaging?"":(""!==s?"-":"")+s)+")"}return r},up.getAttributeDrillQuery=function(e,t,i,a){for(var r="",n=[],n=a&&a.axis===i&&"down"===a.action.toLowerCase()?[{name:a.fieldName,items:[a.memberName],delimiter:"~~"}]:this.drilledMembers,s=i===this.valueAxis?this.getMeasurePos(i):0,o=0,l=n;o<l.length;o++){var d=l[o];if(!!this.engine.fieldList[d.name]&&this.engine.fieldList[d.name].isHierarchy)for(var p=0,h=d.items;p<h.length;p++){for(var u=h[p],c=[],g=u.split(d.delimiter||"~~"),m=this.getDrillLevel(e,g),S=this.getDimensionPos(i,d.name),f=e.length-(S<s?1:0),v=!!this.isPaging&&this.isAttributeMemberExist(d.name,u.split(d.delimiter||"~~"),d.delimiter,g,i);0<m.level&&m.isDrill&&S+1!==s&&!v;){for(var y=[],b=0;b<e.length;){if("[measures]"===e[b].name.toLowerCase())""!==t&&y.push(g[b]?"({{"+g[b]+"}})":"("+t+")");else if(g[b]&&(-1!==g[b].indexOf(e[b].name)||e[b].isNamedSet&&this.fieldList[e[b].name]&&-1!==g[b].indexOf(this.fieldList[e[b].name].pid.split("Sets_")[1])))y.push(this.getHierarchyQuery(g[b],!1,!1,!1,m.level,!0));else{if(g[b]||!e[b]){y=[];break}y.push(this.getHierarchyQuery(e[b].name,!!(this.isPaging&&2===m.level||!this.isPaging&&b<f),e[b].isNamedSet,e[b].isCalculatedField,m.level,!1))}b++}0<y.length&&c.push("("+y.join("*")+")"),m.level--,f--}0<c.length&&(r=r+(""!==r?"-":"")+c.join(this.isPaging?"+":"-"))}}return r},up.getDimensionPos=function(e,t){for(var i=0,a="rows"===e?this.rows:this.columns,r=0;r<a.length;r++)if(a[r].name===t){i=r;break}return i},up.getMeasurePos=function(e){for(var t=0,i="rows"===e?this.rows:this.columns,a=0;a<i.length;a++)if(0===i[a].name.indexOf("[Measures]")){t=a;break}return t},up.getDrillLevel=function(e,t){for(var i=e.length,a=!1,r=0;r<e.length;)t[r]&&-1!==t[r].indexOf(e[r].name)?(--i,e[r+1]&&!(e[r+1].isNamedSet||0===e[r+1].name.indexOf("[Measures]")||this.fieldList[e[r+1].name]&&!this.fieldList[e[r+1].name].hasAllMember)&&(a=!0)):(e[r].isNamedSet||0===e[r].name.indexOf("[Measures]")||this.fieldList[e[r].name]&&!this.fieldList[e[r].name].hasAllMember)&&--i,r++;return{level:this.isPaging?2:i,isDrill:a}},up.getHierarchyQuery=function(e,t,i,a,r,n){return e=a?this.fieldList[e].tag:e,!this.fieldList[e]||this.fieldList[e].hasAllMember||i||a?i||a?"({"+e+"})":this.isPaging?"({"+e+(t?".CHILDREN})":n||1!==r?"})":".[All]})"):"({DrilldownLevel({"+e+(t?".CHILDREN":"")+"},,,INCLUDE_CALC_MEMBERS)})":"(("+e+").levels(0).AllMembers)"},up.isAttributeMemberExist=function(e,t,i,a,r){t.splice(a.length-1,1);var n=!1;if(""!==t.join(i)&&(!this.isPaging||1!==t.length||"[Measures]"!==t.join(i))&&this.engine.fieldList[e]&&this.engine.fieldList[e].hasAllMember)for(var s=this.getDimensionPos(r,e),o=0;o<this.drilledMembers.length;o++)if(e!==this.drilledMembers[o].name)if(!!this.engine.fieldList[this.drilledMembers[o].name]&&this.engine.fieldList[this.drilledMembers[o].name].isHierarchy)for(var l=this.getDimensionPos(r,this.drilledMembers[o].name),d=0;d<this.drilledMembers[o].items.length;d++){var p=this.getDrillLevel("rows"===r?this.rows:this.columns,this.drilledMembers[o].items[d].split(this.drilledMembers[o].delimiter||"~~"));if((!this.isPaging||l<s&&p.isDrill)&&(0===this.drilledMembers[o].items[d].indexOf(t.join(i))||0===t.join(i).indexOf(this.drilledMembers[o].items[d]))){n=!0;break}}return n},up.getDrillQuery=function(e,t,i,a){for(var r="",n=[],s=!1,o="",l=0,d=a&&a.axis===i&&"down"===a.action.toLowerCase()?(s=!0,[{name:a.fieldName,items:[a.memberName],delimiter:"~~"}]):this.drilledMembers;l<d.length;l++){var p=d[l];if(!(!!this.engine.fieldList[p.name]&&this.engine.fieldList[p.name].isHierarchy))for(var h=0,u=p.items;h<u.length;h++){for(var c,g=u[h],m=[],S=[],f=0,v=g.split(p.delimiter||"~~"),y=this.isAttributeMemberExist(p.name,g.split(p.delimiter||"~~"),p.delimiter||"~~",v,i);f<e.length&&!y;){if(v[f]&&-1!==v[f].indexOf(e[f].name))-1!==v[v.length-1].indexOf(e[f].name)?s?o=o+(""!==o?" * ":"")+"({"+v[f]+".CHILDREN})":(m.push("("+v[f]+".CHILDREN)"),S.push("("+v[f]+")")):"[measures]"===v[f].toLowerCase()&&""!==t?s?o=o+(""!==o?" * ":"")+"("+t+")":(m.push("("+t+")"),S.push("("+t+")")):-1!==v[f].toLowerCase().indexOf("[measures]")?s?o=o+(""!==o?" * ":"")+"({"+v[f]+"})":(m.push("({"+v[f]+"})"),S.push("({"+v[f]+"})")):s?o=o+(""!==o?" * ":"")+"({"+v[f]+"})":(m.push("("+v[f]+")"),S.push("("+v[f]+")"));else{if(v[f]||!e[f]){m=[];break}"[measures]"===e[f].name.toLowerCase()&&""!==t?s?o=o+(""!==o?" * ":"")+"("+t+")":(m.push("("+t+")"),S.push("("+t+")")):(c=this.getDimensionQuery(e[f],i),s?o=o+(""!==o?" * ":"")+"({"+c+"})":(m.push("("+c+")"),S.push("("+c+")")))}f++}0<m.length&&m.length<v.length&&(m=[],S=[]),r=r+(""!==r&&0<m.length?",":"")+(0<m.length?"("+m.toString()+")":""),0<S.length&&n.push("("+S.toString()+")")}}return{query:s?o:r,collection:s?[o]:n}},up.getSlicersQuery=function(i,e){var a=this,t="",r=(r=Ue.extend([],this.rows,null,!0)).concat(this.columns);if(0<i.length){for(var n=0;n<i.length;)0<r.filter(function(e){var e=a.getDimensionUniqueName(e.name),t=a.getDimensionUniqueName(i[n].name);return e===t&&!(a.isMondrian&&""===t&&""===e)}).length||(void 0===i[n].name||this.filterMembers[i[n].name]?this.filterMembers[i[n].name]&&(t=t+(""!==t?" * ":"")+"{"+this.filterMembers[i[n].name].toString()+"}"):t=t+(""!==t?" * ":"")+"{"+this.getDimensionQuery(i[n],e)+"}"),n++;t=""===t?"":"\nWHERE ("+t.replace(/DrilldownLevel/g,"")+")"}return t},up.getDimensionQuery=function(e,t){var i=e.isCalculatedField?this.fieldList[e.name].tag:e.name;return this.fieldList[e.name]&&this.fieldList[e.name].hasAllMember||e.isNamedSet||e.isCalculatedField?e.isNamedSet||e.isCalculatedField?"{"+i+"}":this.isPaging?i+".CHILDREN":"DrilldownLevel({"+i+"}"+("rows"===t||"columns"===t?",,,INCLUDE_CALC_MEMBERS":"")+")":"(("+i+").levels(0).AllMembers)"},up.getDimensionUniqueName=function(e){var t=this.fieldDataObj.hierarchy,i=[];if(t){for(var a=0,r=t;a<r.length;a++){var n=r[a];n.id.toLowerCase()===e.toLowerCase()&&i.push(n)}return 0<i.length?i[0].pid:""}return e.split(".")[0]},up.getMeasuresQuery=function(e){var t="";if(0<e.length){for(var t="{{",i="",a=0,r=e;a<r.length;a++)var n=r[a],n=n.isCalculatedField?this.fieldList[n.name].tag:n.name,i=0<i.length?i+", "+n:n;t=t+i+"}}"}return t},up.getfilterQuery=function(e,t){for(var t="\nFROM ["+t+"]",i="\nFROM( SELECT (",a=[],r=[],n=[],s=[],o=0,l=this.rows;o<l.length;o++)e[(g=l[o]).name]&&0<e[g.name].length&&("string"==typeof e[g.name][0]?n.push(e[g.name]):(e[g.name][1]=e[g.name][0].type,a.push(e[g.name]),delete e[g.name]));for(var d,p=0,h=this.columns;p<h.length;p++)e[(g=h[p]).name]&&0<e[g.name].length&&("string"==typeof e[g.name][0]?s.push(e[g.name]):((d=e[g.name])[1]=d[0].type,a.push(e[g.name]),delete e[g.name]));for(var u=0,c=this.filters;u<c.length;u++){for(var g=c[u],m=!1,S=0,f=this.columns;S<f.length;S++){var v=f[S];m||this.getDimensionUniqueName(v.name)!==this.getDimensionUniqueName(g.name)||e[g.name]&&(s.push(e[g.name]),m=!0)}if(!m)for(var y=0,b=this.rows;y<b.length;y++){var C=b[y];m||this.getDimensionUniqueName(C.name)!==this.getDimensionUniqueName(g.name)||e[g.name]&&(n.push(e[g.name]),m=!0)}}if((this.allowLabelFilter||this.allowValueFilter)&&0<a.length)for(var x=0,w=["Value","Label"];x<w.length;x++)for(var T=w[x],M=0,D=a;M<D.length;M++){var O=D[M];O&&2===O.length&&"string"==typeof O[1]&&O[1]===T&&r.push(this.getAdvancedFilterQuery(O[0],i,"COLUMNS"))}for(var P=0,N=s.length;P<N;P++)i=0===P?i+"{"+s[P].toString()+"}":i+",{"+s[P].toString()+"}";0<s.length&&(i=0<n.length?i+" ) ON COLUMNS ,(":i+" ) ON COLUMNS");for(P=0,N=n.length;P<N;P++)i=0<P?i+",{"+n[P].toString()+"}":i+"{"+n[P].toString()+"}";var i=0<s.length&&0<n.length?i+") ON ROWS ":0===s.length&&0<n.length?i+") ON COLUMNS ":i,E="";return 0<(E=0<r.length?r.join(" ")+" "+(0<s.length||0<n.length?i:"")+" "+t+Array(r.length+1+(0<s.length||0<n.length?1:0)).join(")"):E).length?E:0===s.length&&0===n.length?t:i+t+")"},up.getAdvancedFilterQuery=function(e,t,i){return"\nFROM (SELECT Filter("+e.selectedField+".AllMembers, "+this.getAdvancedFilterCondtions(e.name,e.condition,e.value1,e.value2,e.type,e.measure)+")) on "+i},up.getAdvancedFilterCondtions=function(e,t,i,a,r,n){var s="";switch(t){case"Equals":s="("+("Value"!==r?e+'.CurrentMember.member_caption ="'+i+'"':n+" = "+i);break;case"DoesNotEquals":s="("+("Value"!==r?e+'.CurrentMember.member_caption <>"'+i+'"':n+" <>"+i);break;case"Contains":s="( InStr (1,"+e+'.CurrentMember.member_caption,"'+i+'") >0';break;case"DoesNotContains":s="( InStr (1,"+e+'.CurrentMember.member_caption,"'+i+'")=0';break;case"BeginWith":s="( Left ("+e+".CurrentMember.member_caption,"+i.length+')="'+i+'"';break;case"DoesNotBeginWith":s="( Left ("+e+".CurrentMember.member_caption,"+i.length+') <>"'+i+'"';break;case"EndsWith":s="( Right ("+e+".CurrentMember.member_caption,"+i.length+')="'+i+'"';break;case"DoesNotEndsWith":s="( Right ("+e+".CurrentMember.member_caption,"+i.length+') <>"'+i+'"';break;case"GreaterThan":s="("+("Value"!==r?e+'.CurrentMember.member_caption >"'+i+'"':n+" >"+i);break;case"GreaterThanOrEqualTo":s="("+("Value"!==r?e+'.CurrentMember.member_caption >="'+i+'"':n+" >="+i);break;case"LessThan":s="("+("Value"!==r?e+'.CurrentMember.member_caption <"'+i+'"':n+" <"+i);break;case"LessThanOrEqualTo":s="("+("Value"!==r?e+'.CurrentMember.member_caption <="'+i+'"':n+" <="+i);break;case"Between":s="("+("Value"!==r?e+'.CurrentMember.member_caption >="'+i+'"AND '+e+'.CurrentMember.member_caption <="'+a+'"':n+" >="+i+" AND "+n+" <="+a);break;case"NotBetween":s="("+("Value"!==r?e+'.CurrentMember.member_caption >="'+i+'"OR '+e+'.CurrentMember.member_caption <="'+a+'"':n+" >="+i+" OR "+n+" <="+a);break;default:s="( InStr (1,"+e+'.CurrentMember.member_caption,"'+i+'") >0'}return s},up.getCalculatedFieldQuery=function(e){var t="";if(0<e.length)for(var t="\nWITH",i=0,a=e;i<a.length;i++){var r=a[i],n=(-1<r.formula.indexOf("Measure")?"[Measures].":r.hierarchyUniqueName+".")+"["+r.name+"]",s=Ue.isNullOrUndefined(r.formatString)?null:r.formatString;t+="\nMEMBER "+n+"as ("+r.formula+") "+(Ue.isNullOrUndefined(s)?"":', FORMAT_STRING ="'+s.trim()+'"')}return t};var hp=up;function up(){}f.prototype.renderEngine=function(e,t,i){this.isEmptyData=!1,this.getHeaderSortInfo=i,this.mdxQuery="",this.isMeasureAvail=!1,this.allowMemberFilter=!1,this.allowLabelFilter=!1,this.allowValueFilter=!1,this.isMondrian=!1,this.aggregatedValueMatrix=[],this.measureReportItems=[],this.calcChildMembers=[],this.selectedItems=[],this.savedFieldList=void 0,this.savedFieldListData=void 0,this.formatFields={},this.filterMembers={},this.dataFields={},this.valueAxis="",this.columnCount=0,this.rowCount=0,this.colFirstLvl=0,this.rowFirstLvl=0,this.pageColStartPos=0,this.sortObject={},this.globalize=new Ue.Internationalization,this.locale=this.globalize.culture||"en-US",this.localeObj=t?t.localeObj:void 0,this.enableValueSorting=!!t&&t.enableValueSorting,e.url&&(this.dataSourceSettings=e,this.measureIndex=Ue.isNullOrUndefined(e.valueIndex)?-1:e.valueIndex,this.valueAxis="row"===e.valueAxis?"row":"column",this.getAxisFields(),this.formats=e.formatSettings||[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.valueSortSettings=e.valueSortSettings||void 0,this.filterSettings=e.filterSettings||[],this.sortSettings=e.sortSettings||[],this.allowMemberFilter=!!e.allowMemberFilter,this.allowLabelFilter=!!e.allowLabelFilter,this.allowValueFilter=!!e.allowValueFilter,this.drilledMembers=e.drilledMembers?this.updateDrilledItems(e.drilledMembers):[],this.calculatedFieldSettings=e.calculatedFieldSettings||[],this.emptyCellTextContent=e.emptyCellsTextContent||"",this.pageSettings=t?t.pageSettings||this.pageSettings:void 0,this.isPaging=!(!this.pageSettings||!t.enablePaging&&!t.enableVirtualization),this.frameSortObject(),this.getFormattedFields(this.formats),this.savedFieldList=t?t.savedFieldList:void 0,this.savedFieldListData=t?t.savedFieldListData:void 0,this.fieldListData=[],this.fieldListObj={},this.setNamedSetsPosition(),this.savedFieldList&&0<Object.keys(this.savedFieldList).length&&this.savedFieldListData?this.updateFieldlist(!0):(this.getCubes(e),this.getFieldList(e)),this.loadCalculatedMemberElements(this.calculatedFieldSettings),i=this.getMeasureInfo(),this.olapVirtualization=this.isPaging&&e.showSubTotals&&i.measureIndex===("column"===i.measureAxis?e.columns.length-1:e.rows.length-1)&&!Ue.isNullOrUndefined(this.pageSettings)&&e.showGrandTotals,this.isPaging=this.isPaging&&!this.olapVirtualization,this.measureReportItems=[],this.updateFilterItems(this.filterSettings),this.generateGridData(e))},f.prototype.generateGridData=function(e,t){t=!(!t||"navPaging"!==t||!this.isPaging||void 0===this.pageSettings);0<this.rows.length||0<this.columns.length||0<this.values.length||0<this.filters.length?hp.getCellSets(e,this,t):(hp.getCellSets(e,this,!0,void 0,!0),this.generateEngine(void 0,void 0,{dataSourceSettings:e,action:"loadTableElements"}))},f.prototype.generatePagingData=function(e,t,i){e=[].slice.call(e.querySelectorAll("Axes, CellData")),e=e[1]?e[1].querySelectorAll("FmtValue"):null,e&&0<e.length&&(this.columnCount=Number(e[0].textContent),this.rowCount=Number(e[1].textContent)),e=i.dataSourceSettings;hp.getCellSets(e,this,!0)},f.prototype.scrollPage=function(){var e;this.olapVirtualization?((e=this.getVirtualScrollingData(this.clonedColumnTuple,this.clonedRowTuple)).isCalculated&&(this.pivotValues=[],this.clearEngineProperties(),this.performEngine(e.columnTuple,e.rowTuple,e.valueTuple)),this.pivotValues=this.pivotValues.slice()):hp.getCellSets(this.dataSourceSettings,this,!0)},f.prototype.getVirtualScrollingData=function(e,t){var i,a,r,n,s,o,l,d,p,h,u,c=this.clonedValTuple.slice(),g=!1,m=(this.pageSettings.currentColumnPage-1)*this.pageSettings.columnPageSize,S=(this.pageSettings.currentRowPage-1)*this.pageSettings.rowPageSize,f=3*this.pageSettings.columnPageSize,v=3*this.pageSettings.rowPageSize,m=this.columnCount<m+f?this.columnCount>f?this.columnCount-f:0:m,S=this.rowCount<S+v?this.rowCount>v?this.rowCount-v:0:S;return m===this.pageColStartPos&&S===this.pageRowStartPos&&e.length<=f&&t.length<=v||(g=!0,n=this.getMeasureInfo(),l=!Ue.isNullOrUndefined(e[0])&&0===Number(e[0].querySelectorAll("Member")[0].querySelector("LNum").textContent),i=!Ue.isNullOrUndefined(t[0])&&0===Number(t[0].querySelectorAll("Member")[0].querySelector("LNum").textContent),o=l&&m+f>=e.length-1,a=i&&S+v>=t.length-1,r=l?this.getAxisdepth(e):"column"===n.measureAxis?n.valueInfo.length:1,n=i?this.getAxisdepth(t):"row"===n.measureAxis?n.valueInfo.length:1,d=(i?n:0)+S,p=e.slice(l=(l?r:0)+m,l+f),h=t.slice(d,d+v),s=p[0]?Number(p[0].querySelectorAll("Member")[0].querySelector("LNum").textContent):0,u=h[0]?Number(h[0].querySelectorAll("Member")[0].querySelector("LNum").textContent):0,s=this.getVirtualTotals(e.slice(0,l),s,o,"column",r),o=this.getVirtualTotals(t.slice(0,d),u,a,"row",n),l=p.length+s.totalsCollection.length>f?Math.max(p.length+s.totalsCollection.length-f):0,d=h.length+o.totalsCollection.length>v?Math.max(h.length+o.totalsCollection.length-v):0,p=s.totalsCollection.concat(p.slice(l,p.length)),h=o.totalsCollection.concat(h.slice(d,h.length)),u=this.getVirtualValues(c,m+l,S+d,f,v,s.indexCollection,o.indexCollection,e.length,t.length,r,n,i),e=p.slice(),t=h.slice(),c=u.slice()),this.pageColStartPos=m,this.pageRowStartPos=S,{columnTuple:e,rowTuple:t,valueTuple:c,isCalculated:g}},f.prototype.getAxisdepth=function(e){for(var t=0,i=0;i<e.length&&0===Number(e[i].querySelectorAll("Member")[0].querySelector("LNum").textContent);i++)t++;return t},f.prototype.getVirtualTotals=function(e,t,i,a,r){var n=[],s=[];if(1!==t)for(var o=e.length-1;0<o;o--){var l=Number(e[o].querySelectorAll("Member")[0].querySelector("LNum").textContent);if(0===l)break;if(l<t)if(t=l,Number(e[o-1].querySelectorAll("Member")[0].querySelector("LNum").textContent)===l){for(var d=0;d<r;d++)n[n.length]=e[o-d],s[s.length]=o-d;o=1<r?o-(r-1):o}else n[n.length]=e[o],s[s.length]=o;else if(1===l)break}if(i)for(o=r;0<o;o--)n=n.concat([e[o-1]]),s=s.concat([o-1]);return{totalsCollection:n.reverse(),indexCollection:s.reverse()}},f.prototype.getVirtualValues=function(e,t,i,a,r,n,s,o,l,d,p,h){var u=[],c=e;if(r<l){for(var l=((h?p:0)+i)*o,c=e.slice(l,l+r*o),g=[],m=0;m<s.length;m++)g=g.concat(e.slice(s[m]*o,s[m]*o+o));c=g.concat(c)}for(var m=0,S=c.length/o;m<S;m++){for(var f=c.slice(m*o,m*o+o),v=f.slice(t+d,t+d+a),y=[],b=0;b<n.length;b++)y[y.length]=f[n[b]];u=u.concat(y.concat(v))}return u},f.prototype.generateEngine=function(e,t,i){"down"!==i.action&&this.clearEngineProperties(),this.xmlDoc=e?e.cloneNode(!0):void 0,this.request=t,this.customArgs=i,this.parentObjCollection={},this.curDrillEndPos=-1,this.onDemandDrillEngine=[],this.getSubTotalsVisibility(),this.xmlaCellSet=e?e.querySelectorAll("Axes, CellData"):void 0;var t=this.xmlaCellSet&&0<this.xmlaCellSet.length?[].slice.call(this.xmlaCellSet[0].querySelectorAll('Axis[name|="Axis0"] Tuple')):[],i=this.xmlaCellSet&&0<this.xmlaCellSet.length?[].slice.call(this.xmlaCellSet[0].querySelectorAll('Axis[name|="Axis1"] Tuple')):[],a=this.xmlaCellSet&&1<this.xmlaCellSet.length?[].slice.call(this.xmlaCellSet[1].querySelectorAll("Cell")):[];if(this.olapVirtualization&&!Ue.isNullOrUndefined(this.pageSettings)){if(t.length*i.length!==a.length){for(var r=[],n=0;n<a.length;n++)Ue.isNullOrUndefined(a[n])||(r[Number(a[n].getAttribute("CellOrdinal"))]=a[n]);a=r}this.clonedValTuple=a;var e=this.getDrillInfo("columns"),s=this.getActualTuples(t,e),e=this.getDrillInfo("rows"),e=this.getActualTuples(i,e,s.indexColls,t.length),s=(this.clonedColumnTuple=s.tupColls,this.clonedRowTuple=e.tupColls,this.columnCount=this.clonedColumnTuple.length,this.rowCount=this.clonedRowTuple.length,this.getVirtualScrollingData(this.clonedColumnTuple,this.clonedRowTuple));this.performEngine(s.columnTuple,s.rowTuple,s.valueTuple)}else this.performEngine(t,i,a)},f.prototype.getDrillInfo=function(e){var t={},i=[];if("columns"===e?i=this.dataSourceSettings.columns.map(function(e){return e.name}):"rows"===e&&(i=this.dataSourceSettings.rows.map(function(e){return e.name})),0<i.length)for(var a=0,r=this.drilledMembers.length;a<r;a++){var n=this.drilledMembers[a],s=i.indexOf(n.name);-1<s&&(t[s]||(t[s]=[]),t[s]=t[s].concat(n.items))}return t},f.prototype.getActualTuples=function(u,c,g,m){var t,S=[],f=[],v=[];if(0<u.length)for(var y=this,e=0,i=u.length;e<i;e++)!function(e){for(var t,i=u[e],a=!0,r=!1,n=!1,s=i.getElementsByTagName("MEMBER_TYPE"),o=i.getElementsByTagName("UName"),l=0,d=s.length;l<d;l++){var p=Number(s[l].textContent),h=o[l].textContent;if(n&&p<2?a=!1:2===p?r=!0:r&&p<2&&(a=!1),c[l]&&-1<c[l].indexOf(h)&&(n=!0),!a)break}a&&(S[S.length]=i,g?(t=y.clonedValTuple.slice(e*m,e*m+m),v=v.concat(g.map(function(e){return t[e]}))):f[f.length]=e)}(e);else g&&(t=this.clonedValTuple.slice(0,m),v=v.concat(g.map(function(e){return t[e]})));return 0<v.length&&(this.clonedValTuple=v),{tupColls:S,indexColls:f}},f.prototype.clearEngineProperties=function(){this.pivotValues=[],this.valueContent=[],this.headerContent=[],this.colDepth=0,this.tupColumnInfo=[],this.tupRowInfo=[],this.colMeasures={},this.colMeasurePos=void 0,this.rowMeasurePos=void 0,this.rowStartPos=-1},f.prototype.performEngine=function(e,t,i){this.totalCollection=[];for(var a,r,n=this.getMeasureInfo(),s=(0<this.drilledMembers.length&&(a=void 0,e=(a=this.frameMeasureOrder(n,"column",e,i,e.length,e.length*t.length)).orderedHeaderTuples,i=a.orderedValueTuples,t=(a=this.frameMeasureOrder(n,"row",t,i,e.length,e.length*t.length)).orderedHeaderTuples,i=a.orderedValueTuples),"down"===this.customArgs.action&&this.updateTupCollection(("row"===this.customArgs.drillInfo.axis?t:e).length),{}),o=0;o<i.length;o++)Ue.isNullOrUndefined(i[o])||(s[this.olapVirtualization?o:Number(i[o].getAttribute("CellOrdinal"))]=i[o]);if(this.valueSortSettings.columnIndex=void 0,this.enableValueSorting&&this.valueSortSettings&&!this.isPaging&&!this.olapVirtualization&&(r=this.getValueSortInfo(e,t,n)),"down"===this.customArgs.action&&"column"!==this.customArgs.drillInfo.axis||(this.frameColumnHeader(e),this.isPaging)||this.olapVirtualization||this.performColumnSorting(s,r),"down"===this.customArgs.action&&"row"!==this.customArgs.drillInfo.axis||(this.frameRowHeader(t),this.isPaging)||this.olapVirtualization||this.performRowSorting(s,r),this.frameValues(s,e.length),this.performColumnSpanning(),!this.isPaging&&!this.olapVirtualization&&this.enableSort)for(var l=0;l<this.headerContent.length;l++)this.headerContent[l]=this.pivotValues[l];this.isEngineUpdated=!0,this.isEmptyData=0===e.length},f.prototype.getValueSortInfo=function(e,t,i){if(this.valueSortSettings.headerText){for(var a,r,n=this.valueSortSettings.headerText.split(this.valueSortSettings.headerDelimiter),s=n.indexOf("Grand Total"),o=(-1<s&&(a=n.join("").split(n[s]).join(""),(n=[])[i.measureIndex]=a),""),l=i.measureIndex,d=0;d<this.dataSourceSettings.values.length;d++)if(l=n.indexOf(this.dataSourceSettings.values[d].caption),this.dataSourceSettings.values[d].caption===n[l]){n[l]=this.fieldList[this.dataSourceSettings.values[d].name].name,o=n[l];break}-1!==l&&(l<i.measureIndex&&(n=this.reArrangeHeaders(n,i.measureIndex,o)),0<(a="column"===this.olapValueAxis?e:t).length)&&(r=a[0].getElementsByTagName("Member").length-(-1<s?l:0),r=this.getParentElement(a,n,r,i.measureIndex,o,-1<s)[0],r=a.indexOf(r))}return{memberIndex:r,columnLength:e.length,rowLength:t.length,isValueSorting:-1<r}},f.prototype.getParentElement=function(e,t,i,a,r,n){for(var s=[],o=0,l=!1,d=!1,p=e[0].getElementsByTagName("Member").length-i,h=0;h<e.length;h++){if(Ue.isNullOrUndefined(e[h].getElementsByTagName("Member")[p])){s=[];break}var u=e[h].getElementsByTagName("UName")[p].textContent,c=e[h].getElementsByTagName("Caption")[p].textContent,g=Number(e[h].getElementsByTagName("LNum")[p].textContent),u=u===t[p]||c===t[p]||Ue.isNullOrUndefined(t[p])&&0===g;if(u){if(s[s.length]=e[h],l=!0,o=g,n)break}else{if(l&&o<g){for(var m=[],S=h;S<e.length;S++){var f=e[S].getElementsByTagName("UName")[p].textContent,v=e[S].getElementsByTagName("Caption")[p].textContent,y=Number(e[S].getElementsByTagName("LNum")[p].textContent),f=f===t[1+p]||v===t[1+p]||Ue.isNullOrUndefined(t[1+p])&&0===y;if(o+1===y&&f)m[m.length]=e[S],d=!0;else if(o+1<y){if(!d)break;m[m.length]=e[S]}else if(y<o+1)break}d&&((c=t.slice(0,p).concat(t.slice(1+p,t.length))).indexOf(r)<a&&(c=this.reArrangeHeaders(c,a,r)),s=this.getParentElement(m,c,m[0].getElementsByTagName("Member").length,a,r));break}if(l&&!u)break}}return n||p<t.length-1&&0<s.length&&!d&&(s=this.getParentElement(s,t,i-1,a,r)),s},f.prototype.reArrangeHeaders=function(e,t,i){var i=e.indexOf(i),a=e.slice(0,i),r=e.slice(i+1,e.length);return a[t]=e[i],a.concat(r)},f.prototype.getSubTotalsVisibility=function(){this.showRowSubTotals=this.dataSourceSettings.showRowSubTotals&&this.dataSourceSettings.showSubTotals,this.showColumnSubTotals=this.dataSourceSettings.showColumnSubTotals&&this.dataSourceSettings.showSubTotals,this.showSubTotalsAtTop=this.showColumnSubTotals&&"Top"===this.dataSourceSettings.subTotalsPosition,this.showSubTotalsAtBottom=this.showRowSubTotals&&"Bottom"===this.dataSourceSettings.subTotalsPosition,this.hideRowTotalsObject={},this.hideColumnTotalsObject={};var e=1;do{if(1===e){if(this.showColumnSubTotals)for(var t=0;t<this.dataSourceSettings.columns.length;t++)!1===this.dataSourceSettings.columns[t].showSubTotals&&(this.hideColumnTotalsObject[this.dataSourceSettings.columns[t].name]=t)}else if(this.showRowSubTotals)for(var i=0;i<this.dataSourceSettings.rows.length;i++)!1===this.dataSourceSettings.rows[i].showSubTotals&&(this.hideRowTotalsObject[this.dataSourceSettings.rows[i].name]=i)}while(++e<3)},f.prototype.frameRowHeader=function(e){for(var t,i,a,r=this,k=(this.headerGrouping={},this.lastLevel=[],!0),n=this.pivotValues.length,s=[],o=[],l=("down"!==this.customArgs.action?(s=this.pivotValues,o=this.valueContent):n=this.customArgs.drillInfo.currentCell.rowIndex+1,this.rowStartPos=0<this.rowStartPos?this.rowStartPos:n,0),d=[],p={},j=[],h=!1,u=-1,c=-1,g=[],m=[{actualText:"Grand Total",axis:"row",colIndex:0,formattedText:"Grand Total",hasChild:!1,level:-1,rowIndex:0,index:[],type:"grand sum",ordinal:0,colSpan:1,rowSpan:1,memberType:2,isDrilled:!1,valueSort:{"Grand Total":1,levelName:"Grand Total"}}],q=[],V=this.customArgs.drillInfo&&"row"===this.customArgs.drillInfo.axis?this.customArgs.drillInfo.currentCell.ordinal+1:0;l<e.length;){var S=e[l].querySelectorAll("Member"),q=this.frameTupCollection(S,q,l+V,this.tupRowInfo,this.showRowSubTotals,this.hideRowTotalsObject,"row");l++}l=0;for(var f,H=e.length,_=("down"===this.customArgs.action&&(H+=l=f=this.customArgs.drillInfo.currentCell.ordinal+1,i=this.tupRowInfo[f-1].allCount,t=this.tupRowInfo[f-1].allStartPos,F=this.tupRowInfo[f-1]),l),v=0,y=[];l<H;){var S=e["down"===this.customArgs.action?l-(this.customArgs.drillInfo.currentCell.ordinal+1):l].querySelectorAll("Member"),b=0,C=void 0,x=this.tupRowInfo[l].allCount,w=this.tupRowInfo[l].allStartPos,T=this.tupRowInfo[l].measure,M=this.tupRowInfo[l].typeCollection,D=this.tupRowInfo[l].drillStartPos,U=this.tupRowInfo[l].startDrillUniquename;if(0===l||l===_){for(var O="down"===this.customArgs.action?this.tupRowInfo[0].members:S;b<O.length;)"1"===O[b].querySelector("MEMBER_TYPE").textContent&&0===Number(O[b].querySelector("LNum").textContent)?g[b]=0:g[b]=Number(O[b].querySelector("LNum").textContent),"1"===O[b].querySelector("MEMBER_TYPE").textContent?(p[b]=0,u=-1===u?b:u,c=b):(p[b]=1,h="3"!==O[b].querySelector("MEMBER_TYPE").textContent||h),b++;a=M.indexOf("3")}if((b=0)===l&&(S.length>x+(T?1:0)||1===S.length&&T)&&m.pop(),0===l&&this.isPaging?0===m.length:!h||x===i||w!==t||1===S.length&&T){var P=this.checkAttributeDrill(this.tupRowInfo[l].drillInfo,"rows"),N=!(-1<D)||!(0<x)||P||D<w,N=F&&N&&-1<D?F.startDrillUniquename!==U||!(c>F.measurePosition||F.measureName===this.tupRowInfo[l].measureName||w!==D+1&&this.tupRowInfo[l].measurePosition!==D+1):N,U=!(-1<u&&0<x)||P||c<w;if((D="Top"===this.dataSourceSettings.grandTotalsPosition&&0===this.olapRowValueIndex&&"row"===this.olapValueAxis&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&("row"!==this.olapValueAxis||1<this.dataSourceSettings.rows.length))&&1===m.length&&(m=this.frameGrandTotalValues(e,m,M,a)),S.length===x+(T?1:0)&&T&&!D){var E="Grand Total"+this.valueSortSettings.headerDelimiter+this.dataFields[this.getUniqueName(S[a].querySelector("UName").textContent)].caption?this.dataFields[this.getUniqueName(S[a].querySelector("UName").textContent)].caption:S[a].querySelector("Caption").textContent,P="3"===M[a]&&this.dataFields[this.getUniqueName(S[a].querySelector("UName").textContent)]&&this.dataFields[this.getUniqueName(S[a].querySelector("UName").textContent)].caption?this.dataFields[this.getUniqueName(S[a].querySelector("UName").textContent)].caption:S[a].querySelector("Caption").textContent;(m=this.frameGrandTotalAxisSet(m,this.getUniqueName(S[a].querySelector("UName").textContent),P,n,l,Number(M[a]),S[a].querySelector("PARENT_UNIQUE_NAME")?S[a].querySelector("PARENT_UNIQUE_NAME").textContent:void 0,S[a].querySelector("LName").textContent,S[a].getAttribute("Hierarchy"),{levelName:E,axis:S[a].getAttribute("Hierarchy")}))[m.length-1].valueSort[E]=1}else if(0!==w&&(0!==a||1!==w)&&N&&U){"Top"===this.dataSourceSettings.grandTotalsPosition&&k&&this.dataSourceSettings.showGrandTotals&&("row"!==this.olapValueAxis||1<this.dataSourceSettings.rows.length)&&(this.insertRowGrandTotal(m,o,s,e,n),n=this.pivotValues.length,k=!1);for(var F=this.tupRowInfo[l],B=n,I=b,C={},G=!1;b<S.length;){var L=S[b];if(L.querySelector("UName").textContent!==d[b]&&"2"!==M[b]&&(!(0<Object.keys(C).length?C.isDrilled&&!this.fieldList[C.hierarchy].isHierarchy:G)||"3"===M[b]&&p[b-1]&&0!==p[b+1])){var z=Number(L.querySelector("LNum").textContent)-(p[b]&&"3"!==M[b]?1:g[b]),W=!!this.namedSetsPosition.row[b],A=this.getUniqueName(L.querySelector("UName").textContent),Q=this.getDepth(this.tupRowInfo[l],A,Number(M[b])),E=this.getCaptionCollectionWithMeasure(this.tupRowInfo[l],b,!0);if(this.showSubTotalsAtBottom&&n>this.rowStartPos&&(B=n=this.insertRowSubTotal(s,o,y,n,z,E)),!(this.isPaging&&s[v][0]&&this.fieldList[s[v][0].hierarchy]&&this.fieldList[s[v][0].hierarchy].isHierarchy&&s[v][0].hasChild&&!s[v][0].isDrilled&&!this.rows[b].isNamedSet&&(0===this.rows[b].name.indexOf("[Measures]")||this.fieldList[L.getAttribute("Hierarchy")]&&(this.fieldList[L.getAttribute("Hierarchy")].isHierarchy||this.fieldList[L.getAttribute("Hierarchy")].hasAllMember))&&s[v][0].depth<Q)){s[n]=[{axis:"row",actualText:A,colIndex:0,formattedText:"3"===M[b]&&this.dataFields[A]&&this.dataFields[A].caption?this.dataFields[A].caption:L.querySelector("Caption").textContent,hasChild:!!(this.fieldList[L.getAttribute("Hierarchy")]&&this.fieldList[L.getAttribute("Hierarchy")].isHierarchy&&b<this.rows.length-1&&!this.rows[b+1].isNamedSet&&this.rows[b+1].name.indexOf("[Measures]")<0&&this.fieldList[this.rows[b+1].name]&&this.fieldList[this.rows[b+1].name].hasAllMember)||0<Number(L.querySelector("CHILDREN_CARDINALITY").textContent),level:z,depth:Q,rowIndex:n,index:[],ordinal:l,type:"header",colSpan:1,rowSpan:1,memberType:Number(M[b]),isDrilled:!(!this.fieldList[L.getAttribute("Hierarchy")]||!this.fieldList[L.getAttribute("Hierarchy")].isHierarchy||this.isAttributeDrill(L.getAttribute("Hierarchy"),this.tupRowInfo[l].drillInfo,"rows"))||this.tupRowInfo[l].drillInfo[b].isDrilled,parentUniqueName:L.querySelector("PARENT_UNIQUE_NAME")?L.querySelector("PARENT_UNIQUE_NAME").textContent:void 0,levelUniqueName:L.querySelector("LName").textContent,hierarchy:L.getAttribute("Hierarchy"),isNamedSet:W,valueSort:{levelName:"",axis:L.getAttribute("Hierarchy")}}],this.olapVirtualization&&"header"===s[n][0].type&&delete s[n][0].type,(C="3"!==M[b]?s[n][0]:C)||j.push(L.querySelector("Caption").textContent),E=this.getCaptionCollectionWithMeasure(this.tupRowInfo[l],b,!1),s[n][0].valueSort.levelName=E,s[n][0].valueSort[E]=1,o[n-this.rowStartPos]={},o[n-this.rowStartPos][0]=s[n][0],T&&b<a&&(d[a]="");for(var R=b+1;R<S.length;R++)d[R]="";d[b]=L.querySelector("UName").textContent,v=3!==Number(M[b])?n:v,n++,I=b}}else"2"===M[b]?I=b:this.tupRowInfo[l].drillInfo[b].isDrilled&&0===p[b]&&(G=!0);this.tupRowInfo[l].drillInfo[b].isDrilled&&this.tupRowInfo[l].showTotals&&(this.tupRowInfo[l].showTotals=!!this.showRowSubTotals&&void 0===this.hideRowTotalsObject[this.tupRowInfo[l].drillInfo[b].hierarchy]),b++}B<n&&I>=S.length-1&&(s[n-1][0].ordinal=l,"header"===s[n-1][0].type)&&delete s[n-1][0].type}i=x,t=w}l++}this.showSubTotalsAtBottom&&0<y.length&&(y.reverse(),y.forEach(function(e){s[n]=[e],o[n-r.rowStartPos]={},o[n-r.rowStartPos][0]=s[n][0],n++})),("Top"!==this.dataSourceSettings.grandTotalsPosition||"row"===this.olapValueAxis&&1===this.dataSourceSettings.rows.length&&"Top"===this.dataSourceSettings.grandTotalsPosition||0===this.dataSourceSettings.rows.length)&&this.insertRowGrandTotal(m,o,s,e,n)},f.prototype.insertRowSubTotal=function(e,t,i,a,r,n){var s=Ce.frameHeaderWithKeys(e[a-1][0]);if(s.level<r&&"grand sum"!==s.type&&(s.isDrilled||3===s.memberType))if(3===s.memberType){for(var o=[],l=1;3===e[a-l][0].memberType;)o[o.length]=e[a-l][0],l++;if(e[a-l][0].isDrilled&&0!==o.length){for(var d=0,p=o.length;d<p;d++)o[d].formattedText=e[a-l][0].formattedText+" "+o[d].formattedText,o[d].isSum=!0,o[d].type="sum",o[d].parentUniqueName=e[a-l][0].levelUniqueName,i[i.length]=o[d];a-=--l}}else s.hasChild=!1,s.isDrilled=!1,s.isSum=!0,s.type="sum",s.formattedText=s.formattedText+" Total",i[Object.keys(i).length]=s;if(0<i.length)for(var h=i.length-1,u=i[h].valueSort.levelName.split(".").length,c=n.split(".").length;c<=u&&(e[a]=[i[h]],t[a-this.rowStartPos]={},t[a-this.rowStartPos][0]=e[a][0],a++,i.splice(i.length-1,1),0<Object.keys(i).length);)u=i[--h].valueSort.levelName.split(".").length;return a},f.prototype.insertRowGrandTotal=function(e,t,i,a,r){if(1<e.length&&3!==e[0].memberType&&(e[0].ordinal=-1),"down"!==this.customArgs.action){var n=0===this.dataSourceSettings.rows.length||1===this.dataSourceSettings.rows.length&&"[Measures]"===this.dataSourceSettings.rows[0].name;if(this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals||n)for(var s=0;s<e.length;s++)i[e[s].rowIndex=r]=[e[s]],t[r-this.rowStartPos]={},t[r-this.rowStartPos][0]=i[r][0],r++}else this.updateRowEngine(i,t,a.length),this.onDemandDrillEngine=i;return e},f.prototype.frameGrandTotalAxisSet=function(e,t,i,a,r,n,s,o,l,d){return e.push({axis:"row",actualText:t,colIndex:0,formattedText:i,hasChild:!1,level:-1,rowIndex:a,index:[],ordinal:r,colSpan:1,rowSpan:1,memberType:n,isDrilled:!1,parentUniqueName:s,levelUniqueName:o,hierarchy:l,valueSort:d}),e},f.prototype.getDepth=function(e,t,i){for(var a=e.uNameCollection.indexOf(t),r=(e.uNameCollection.substring(0,a)+(3===i?"":t)).split("::[").map(function(e){return"["===e[0]?e:"["+e}),n=(3===i&&this.rowMeasurePos===r.length&&r.push(t),-1),s=0;s<r.length;s++)n+=r[s].split("~~").length;return n},f.prototype.checkAttributeDrill=function(e,t){for(var i=!1,a=0;a<e.length&&!(i=this.isAttributeDrill(e[a].hierarchy,e,t));a++);return i},f.prototype.frameTupCollection=function(e,t,i,a,r,n,s){for(var o,l,d,p,h=0,u=0,c=[],g=[],m=[],S="",f="",v=!0,y=-1;h<e.length;){var b=e[h],C=Number(b.querySelector("LNum").textContent),x=b.querySelector("UName").textContent,w=(3<Number(b.querySelector("MEMBER_TYPE").textContent)&&(b.querySelector("MEMBER_TYPE").textContent=0===x.indexOf("[Measures]")?"3":"1"),0===x.indexOf("[Measures]")?"3":3<Number(b.querySelector("MEMBER_TYPE").textContent)?"1":b.querySelector("MEMBER_TYPE").textContent),T=b.querySelector("Caption").textContent,M=(this.fieldList[T]&&"CalculatedField"===this.fieldList[T].type&&(T=this.fieldList[T].caption,b.querySelector("Caption").textContent=T),b.getAttribute("Hierarchy")),D=b.querySelector("PARENT_UNIQUE_NAME")?b.querySelector("PARENT_UNIQUE_NAME").textContent:"";if("2"===w?(this.isPaging||u++,o=Ue.isNullOrUndefined(o)?h:o):"3"===w?(l=b,d=x,p=h,"column"===s?(this.colMeasures[x]=b,this.colMeasurePos=h):this.rowMeasurePos=h):y=n[M],"2"!==w){if(this.headerGrouping[h]){if(C>this.lastLevel[h])this.lastLevel[h]=C;else if(C<this.lastLevel[h]){for(var O=this.lastLevel[h];C<=O;)delete this.headerGrouping[h].UName[O],delete this.headerGrouping[h].Caption[O],O--;this.lastLevel[h]=C}this.headerGrouping[h].UName[C]=x,this.headerGrouping[h].Caption[C]=T}else this.lastLevel[h]=C,this.headerGrouping[h]={UName:((b={})[C]=x,b),Caption:((b={})[C]=T,b)};if(this.isPaging)for(var P=D;this.drilledSets[P];){var k=this.drilledSets[P].querySelector("Caption").textContent,N=Number(this.drilledSets[P].querySelector("LNum").textContent);this.headerGrouping[h].UName[N]=P,this.headerGrouping[h].Caption[N]=k,P=null===this.drilledSets[P].querySelector("PARENT_UNIQUE_NAME")?"":this.drilledSets[P].querySelector("PARENT_UNIQUE_NAME").textContent}for(var E="",F=Object.keys(this.headerGrouping[h].UName),I=0;I<F.length;I++)var L=F[I],E=0===I?this.headerGrouping[h].UName[Number(L)]:E+"~~"+this.headerGrouping[h].UName[Number(L)];for(var S=""===S?E:S+"::"+E,A="",R=Object.keys(this.headerGrouping[h].Caption),I=0;I<R.length;I++)L=R[I],A=0===I?this.headerGrouping[h].Caption[Number(L)]:A+"~~"+this.headerGrouping[h].Caption[Number(L)];h!==p&&(f=""===f?A:f+"::"+A)}c.push(w),g.push(C),(Ue.isNullOrUndefined(t[h])||t[h]<C)&&(t[h]=C),m.push({level:C,uName:x,hierarchy:M,isDrilled:!1}),a[i-1]&&"1"===a[i-1].typeCollection[h]&&m[h].level>a[i-1].drillInfo[h].level&&((T=S.split(/~~|::\[/).map(function(e){return"["===e[0]?e:"["+e})).pop(),b=T.join("~~"),this.setDrillInfo(D,b,h,i,a)),h++}return-1<y&&(v="2"!==c[y+1]),a[i]={allCount:u,allStartPos:o,measure:l,measureName:d,measurePosition:p,members:e,typeCollection:c,uNameCollection:S,captionCollection:f,levelCollection:g,drillInfo:m,drillStartPos:-1,drillEndPos:-1,showTotals:!(!r&&0<u&&(0===p?1:0)<o)&&v},t},f.prototype.getCaptionCollectionWithMeasure=function(e,t,i){e.captionCollection;var a,r,n=!0;if(!i&&"3"!==e.typeCollection[t])for(var s=0;s<this.measurePosition;s++)if(e.drillInfo[t].hierarchy===this.dataSourceSettings.rows[s].name){n=!1;break}return(e.measure&&n?(i=this.getUniqueName(e.measure.querySelector("UName").textContent),i=this.dataFields[i]&&this.dataFields[i].caption?this.dataFields[i].caption:e.measure.querySelector("Caption").textContent,a=e.uNameCollection.split(/[~~::]+/g).indexOf(e.measureName),(r=e.captionCollection.split(/[~~::]+/g)).splice(a,0,i),r):r=e.captionCollection.split(/[~~::]+/g)).join(this.valueSortSettings.headerDelimiter)},f.prototype.setNamedSetsPosition=function(){this.namedSetsPosition={};var e=0;do{for(var t={},i=e?this.dataSourceSettings.rows:this.dataSourceSettings.columns,a=0;a<i.length;a++)i[a].isNamedSet&&(t[a]=i[a].name)}while(this.namedSetsPosition[e?"row":"column"]=t,++e<2)},f.prototype.updateRowEngine=function(e,t,i){for(var a=this.pivotValues.length-1,r=Object.keys(e).length;a>this.customArgs.drillInfo.currentCell.rowIndex;)this.pivotValues[a+r]=this.pivotValues[a],this.pivotValues[a+r][0].ordinal+=i,this.pivotValues[a+r][0].rowIndex+=r,this.valueContent[a+r-this.rowStartPos]=this.valueContent[a-this.rowStartPos],a--;for(var n=0;n<e.length;n++)this.pivotValues[n]=e[n],this.valueContent[Number(n)-this.rowStartPos]=t[Number(n)-this.rowStartPos];this.pivotValues[this.customArgs.drillInfo.currentCell.rowIndex][0].isDrilled=!0},f.prototype.updateTupCollection=function(e){for(var t="row"===this.customArgs.drillInfo.axis?this.tupRowInfo:this.tupColumnInfo,i=t.length-1;i>this.customArgs.drillInfo.currentCell.ordinal;)t[i+e]=t[i],i--},f.prototype.frameGrandTotalValues=function(e,t,i,a){for(var r=0,n=!1;r<e.length&&!n;){var s=e["down"===this.customArgs.action?r-(this.customArgs.drillInfo.currentCell.ordinal+1):r].querySelectorAll("Member"),o=this.tupRowInfo[r].allCount,l=(this.tupRowInfo[r].allStartPos,this.tupRowInfo[r].measure),d=this.tupRowInfo[r].typeCollection;this.tupRowInfo[r].drillStartPos,this.tupRowInfo[r].startDrillUniquename;0===r&&(s.length>o+(l?1:0)||1===s.length&&l)&&t.pop(),0===r&&this.isPaging&&0!==t.length||(this.checkAttributeDrill(this.tupRowInfo[r].drillInfo,"rows"),s.length===o+(l?1:0)&&l&&(o="Grand Total"+this.valueSortSettings.headerDelimiter+s[a].querySelector("Caption").textContent,l="3"===d[a]&&this.dataFields[this.getUniqueName(s[a].querySelector("UName").textContent)]&&this.dataFields[this.getUniqueName(s[a].querySelector("UName").textContent)].caption?this.dataFields[this.getUniqueName(s[a].querySelector("UName").textContent)].caption:s[a].querySelector("Caption").textContent,(t=this.frameGrandTotalAxisSet(t,this.getUniqueName(s[a].querySelector("UName").textContent),l,this.pivotValues.length,r,Number(d[a]),s[a].querySelector("PARENT_UNIQUE_NAME")?s[a].querySelector("PARENT_UNIQUE_NAME").textContent:void 0,s[a].querySelector("LName").textContent,s[a].getAttribute("Hierarchy"),{levelName:o,axis:s[a].getAttribute("Hierarchy")}))[t.length-1].valueSort["Grand Total"+this.valueSortSettings.headerDelimiter+s[a].querySelector("Caption").textContent]=1)),n=this.dataSourceSettings.values.length+1===t.length,r++}return t},f.prototype.frameColumnHeader=function(S){for(var f=this,v=(this.headerGrouping={},this.lastLevel=[],0),y=[],b=[],C=[],x=-1,w=-1,e=this.customArgs.drillInfo&&"column"===this.customArgs.drillInfo.axis?this.customArgs.drillInfo.currentCell.ordinal+1:0;v<S.length;){var t=S[v].querySelectorAll("Member"),y=this.frameTupCollection(t,y,v+e,this.tupColumnInfo,this.showColumnSubTotals,this.hideColumnTotalsObject,"column");v++}if(this.olapVirtualization&&(y=y.slice(0,y.length-1).map(function(e){return 0===e?1:e}).concat(y.slice(y.length-1))),0<S.length)for(var t=S[0].querySelectorAll("Member"),i=0;i<t.length;)C[i]="1"===t[i].querySelector("MEMBER_TYPE").textContent&&0===Number(t[i].querySelector("LNum").textContent)?0:Number(t[i].querySelector("LNum").textContent),"1"!==t[i].querySelector("MEMBER_TYPE").textContent||!this.isPaging&&0!==Number(t[i].querySelector("LNum").textContent)?b[i]=1:(b[i]=0,x=-1===x?i:x,w=i),i++;for(var T,v=0,M=1,D={},O=!0,P=!1,N=this;v<S.length;)!function(){var e=S[v].querySelectorAll("Member"),t=N.tupColumnInfo[v].allCount,i=N.tupColumnInfo[v].allStartPos,a=N.tupColumnInfo[v].measure,r=N.tupColumnInfo[v].typeCollection,n=N.tupColumnInfo[v].drillInfo,s=N.tupColumnInfo[v].drillStartPos,o=N.tupColumnInfo[v].startDrillUniquename,l=N.tupColumnInfo[v].endDrillUniquename,d=N.tupColumnInfo[v].drillEndPos,p=N.tupColumnInfo[v].levelCollection,h="2"!==r[0]&&("3"!==r[0]||"2"!==r[1]),u=0,a=(y.map(function(e,t){u+=0===b[t]?e+(1-(1<C[t]?1:C[t])):0===e?f.isPaging&&"2"===r[t]?0:1:e}),N.colDepth=N.colDepth>u?N.colDepth:u,0===v&&e.length>t+(a?1:0)&&(P=!0,h=0<t&&h?x<i:h),!1);if("Top"===N.dataSourceSettings.grandTotalsPosition&&N.dataSourceSettings.showGrandTotals&&N.dataSourceSettings.showColumnGrandTotals){for(var c=0,g=0;g<e.length;g++)0===e[g].querySelector("Caption").textContent.indexOf("All")&&c++;a=c===("column"===N.olapValueAxis?N.dataSourceSettings.columns.length-1:N.dataSourceSettings.columns.length)}!h&&!a||0!==t&&!a||(m=[-1,-1,-1],N.tupColumnInfo[v-1]&&0===N.tupColumnInfo[v-1].allCount?m=N.levelCompare(p,N.tupColumnInfo[v-1].levelCollection):P&&T&&(m=N.levelCompare(p,T.levelCollection)),N.tupColumnInfo[v].drillStartPos<0||N.showSubTotalsAtTop?(!O&&-1<m[0]&&-1<m[2]&&(M=N.mergeTotCollection(M,t,y,C,b,i,n,m)),N.setParentCollection(e),N.frameCommonColumnLoop(e,v,M,y,b,C),N.tupColumnInfo[v].showTotals||M--,!O&&-1<m[0]&&-1<m[2]&&(M=N.mergeTotCollection(M,t,y,C,b,i,n,m)),O=!1,N.isColDrill?N.isColDrill=!1:M++):(D.drillStartPos!==s||D.startDrillUniquename!==o||D.allCount===t)&&(!O&&-1<m[0]&&-1<m[2]&&(M=N.mergeTotCollection(M,t,y,C,b,i,n,m),O=!0),N.setParentCollection(e),!P||w<=s)&&(a||(N.totalCollection[N.totalCollection.length]={allCount:t,ordinal:v,members:e,drillInfo:n}),D.allCount=t,D.allStartPos=i,D.drillStartPos=s,D.startDrillUniquename=o,D.endDrillUniquename=l),T=N.tupColumnInfo[v]);var m,p=N.checkAttributeDrill(N.tupColumnInfo[v].drillInfo,"columns");0<t&&(!P||h&&(p||w<i))&&(t!==D.allCount&&i===D.allStartPos||(m=d===s||D.endDrillUniquename===l,h=i!==D.allStartPos?D.startDrillUniquename!==o:m,-1<s&&!h)||(O||(M=N.mergeTotCollection(M,t,y,C,b,i,n),O=!0),N.setParentCollection(e),P&&-1<s&&!(w<=s))||(a||(N.totalCollection[N.totalCollection.length]={allCount:t,ordinal:v,members:e,allStartPos:i,drillInfo:n}),D.allCount=t,D.allStartPos=i,D.drillStartPos=s,D.startDrillUniquename=o,D.endDrillUniquename=l)),v++}();if(0<this.totalCollection.length)if(1<Object.keys(this.colMeasures).length)this.orderTotals(M,y,b,C);else{this.totalCollection=this.totalCollection.reverse();for(var a=0,r=this.totalCollection;a<r.length;a++){var n,s=r[a];(!(0===this.tupColumnInfo[s.ordinal].measurePosition?1===this.tupColumnInfo[s.ordinal].allStartPos:0===this.tupColumnInfo[s.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals)&&(this.frameCommonColumnLoop(s.members,s.ordinal,M,y,C,b),n=this.checkAttributeDrill(this.tupColumnInfo[s.ordinal].drillInfo,"columns"),this.tupColumnInfo[s.ordinal].showTotals||n)&&M++}}},f.prototype.orderTotals=function(e,t,i,a){for(var r={},n=1,s=0,o=this.totalCollection;s<o.length;s++){var l,d=o[s];(!(0===this.tupColumnInfo[d.ordinal].measurePosition?1===this.tupColumnInfo[d.ordinal].allStartPos:0===this.tupColumnInfo[d.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals)&&(r[l=this.tupColumnInfo[d.ordinal].measure.querySelector("UName").textContent]?(r[l].coll.push(d),r[l].count++,n=n<r[l].count?r[l].count:n):r[l]={coll:[d],count:1})}for(var p=Object.keys(r),h=n-1;-1<h;){for(var u=0,c=p;u<c.length;u++)(d=r[c[u]].coll[h])&&(this.frameCommonColumnLoop(d.members,d.ordinal,e,t,i,a),this.tupColumnInfo[d.ordinal].showTotals)&&e++;h--}},f.prototype.setParentCollection=function(e){for(var t=0;e.length>t;){var i,a,r=e[t],n=2<Number(r.querySelector("MEMBER_TYPE").textContent)?"3":r.querySelector("MEMBER_TYPE").textContent,s=Number(r.querySelector("LNum").textContent),o=r.querySelector("UName").textContent,l=r.querySelector("PARENT_UNIQUE_NAME")?r.querySelector("PARENT_UNIQUE_NAME").textContent:"",d=!0,p=!1;this.parentObjCollection[t]&&(i=Object.keys(this.parentObjCollection[t]),d=(a=this.parentObjCollection[t][s-1])?l===a.querySelector("UName").textContent:0===i.length,p="1"===this.tupColumnInfo[0].typeCollection[t]),"2"===n?delete this.parentObjCollection[t]:(!this.isPaging&&!p||d||delete this.parentObjCollection[t],this.parentObjCollection[t]?this.parentObjCollection[t][s]&&this.parentObjCollection[t][s].querySelector("UName").textContent===o||(this.parentObjCollection[t][s]=r):(this.parentObjCollection[t]={},this.parentObjCollection[t][s]=r)),t++}},f.prototype.setDrillInfo=function(e,t,i,a,r){for(a--;r[a]&&r[a].drillInfo[i].uName===e;){if(r[a].uNameCollection.split(/~~|::\[/).map(function(e){return"["===e[0]?e:"["+e}).join("~~").indexOf(t)<0)break;r[a].drillInfo[i].isDrilled=!0,this.curDrillEndPos<=i&&(r[a].drillEndPos=this.curDrillEndPos=i,r[a].endDrillUniquename=e),(r[a].drillStartPos>i||-1===r[a].drillStartPos)&&(r[a].drillStartPos=i),r[a].startDrillUniquename=e,a--}},f.prototype.levelCompare=function(e,t){for(var i=[-1,0],a=0;a<t.length;a++)if(e[a]!==t[a]){i=[a,e[a],t[a]-e[a]];break}return i},f.prototype.mergeTotCollection=function(e,t,i,a,r,n,s,o){for(var l=Ue.isNullOrUndefined(n)?o[0]:n-(this.colMeasurePos===n-1?2:1),d=s[l]&&s[l].level,p=this.getLevelsAsString(l-1,s),h={},u=1,c=!1,g=0,m=this.totalCollection;g<m.length;g++){var S,f=m[g];(c||f.allCount<=t&&(!(-1<d&&f.drillInfo[l])||f.drillInfo[l].level>=d&&this.getLevelsAsString(l-1,f.drillInfo)===p))&&(h[S=this.tupColumnInfo[f.ordinal].measure?this.tupColumnInfo[f.ordinal].measure.querySelector("UName").textContent:"measure"]?(h[S].coll.push(f),h[S].count++,u=u<h[S].count?h[S].count:u):h[S]={coll:[f],count:1},c=!1)}for(var v=Object.keys(h),y=u-1;-1<y;){for(var b=0,C=v;b<C.length;b++){var x=h[C[b]].coll[y];x&&((!(0===this.tupColumnInfo[x.ordinal].measurePosition?1===this.tupColumnInfo[x.ordinal].allStartPos:0===this.tupColumnInfo[x.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals)&&(this.frameCommonColumnLoop(x.members,x.ordinal,e,i,r,a),this.tupColumnInfo[x.ordinal].showTotals)&&e++,this.totalCollection.pop())}y--}return e},f.prototype.getLevelsAsString=function(e,t){for(var i=[],a=0;a<e;a++)i[a]=t[a].level;return 0<i.length?i.toString():""},f.prototype.frameCommonColumnLoop=function(e,t,i,a,r,n){var s=-1;if(this.tupColumnInfo[t].showTotals)for(var o=0,l=0;o<e.length;)l+=0<n[o]&&this.getMeasurePosition(this.tupColumnInfo[t].uNameCollection,this.tupColumnInfo[t].measurePosition)!==o?a[o]:a[o]+(1-r[o]),this.tupColumnInfo[t].drillInfo[o].isDrilled&&this.tupColumnInfo[t].showTotals&&(this.tupColumnInfo[t].showTotals=!!this.showColumnSubTotals&&void 0===this.hideColumnTotalsObject[this.tupColumnInfo[t].drillInfo[o].hierarchy],l-=a[o]-this.tupColumnInfo[t].levelCollection[o],s=this.tupColumnInfo[t].showTotals?-1:l-1),o++;var d=this.checkAttributeDrill(this.tupColumnInfo[t].drillInfo,"columns");if(this.tupColumnInfo[t].showTotals||d)for(var p=0,h=0,u={},c="0"===e[0].querySelector("LNum").textContent;p<e.length;){for(var g=e[p],m=2<Number(g.querySelector("MEMBER_TYPE").textContent)?"3":g.querySelector("MEMBER_TYPE").textContent,S=0,f=g.querySelector("LNum").textContent,v="2"===m||n[p]?1:r[p];v<=("3"===m?1:a[p]);v++){for(var y=!1,b=(this.pivotValues[h]||(this.pivotValues[h]=[]),Number(e[p].querySelector("LNum").textContent)>v&&"2"!==m?(this.parentObjCollection[p][v]||this.getDrilledParent(e[p],v,this.parentObjCollection[p]),this.parentObjCollection[p][v]&&(g=this.parentObjCollection[p][v]),y=!0):(g=e[p],S++),this.getUniqueName(g.querySelector("UName").textContent)),C=("2"!==m?u[b]="3"===m&&this.dataFields[b]&&this.dataFields[b].caption?this.dataFields[b].caption:g.querySelector("Caption").textContent:"2"===m&&"0"===f&&(c=c&&!(u[b]="Grand Total")),Object.keys(u)),x=p>=this.measurePosition&&0===Number(g.getElementsByTagName("LNum")[0].textContent)&&1===C.length?"Grand Total"+this.valueSortSettings.headerDelimiter:"",w=0;w<C.length;w++){var T=C[w];0===w?x+=u[T]:x=x+this.valueSortSettings.headerDelimiter+u[T]}var M=!!this.namedSetsPosition.column[p],D=this.getDepth(this.tupColumnInfo[t],b,Number(m));if(this.isPaging&&this.pivotValues[h-1]&&this.pivotValues[h-1][i]&&this.fieldList[this.pivotValues[h-1][i].hierarchy]&&this.fieldList[this.pivotValues[h-1][i].hierarchy].isHierarchy&&this.pivotValues[h-1][i].hasChild&&!this.pivotValues[h-1][i].isDrilled&&!this.columns[p].isNamedSet&&this.fieldList[g.getAttribute("Hierarchy")]&&(this.fieldList[g.getAttribute("Hierarchy")].isHierarchy||this.fieldList[g.getAttribute("Hierarchy")].hasAllMember)&&this.pivotValues[h-1][i].depth<D){this.isColDrill=!0;break}this.pivotValues[h][i]={axis:"column",actualText:b,colIndex:i,formattedText:"3"===m&&this.dataFields[b]&&this.dataFields[b].caption?this.dataFields[b].caption:g.querySelector("Caption").textContent,hasChild:!!(this.fieldList[g.getAttribute("Hierarchy")]&&this.fieldList[g.getAttribute("Hierarchy")].isHierarchy&&p<this.columns.length-1&&!this.columns[p+1].isNamedSet&&this.columns[p+1].name.indexOf("[Measures]")<0&&this.fieldList[this.columns[p+1].name]&&this.fieldList[this.columns[p+1].name].hasAllMember)||0<Number(g.querySelector("CHILDREN_CARDINALITY").textContent),level:1<S?-1:Number(g.querySelector("LNum").textContent)-(n[p]&&"3"!==m?1:0),rowIndex:h,ordinal:t,memberType:Number(m),depth:D,isDrilled:!(!this.fieldList[g.getAttribute("Hierarchy")]||!this.fieldList[g.getAttribute("Hierarchy")].isHierarchy||this.isAttributeDrill(g.getAttribute("Hierarchy"),this.tupColumnInfo[t].drillInfo,"columns"))||y||this.tupColumnInfo[t].drillInfo[p].isDrilled,parentUniqueName:g.querySelector("PARENT_UNIQUE_NAME")?g.querySelector("PARENT_UNIQUE_NAME").textContent:void 0,levelUniqueName:g.querySelector("LName").textContent,hierarchy:g.getAttribute("Hierarchy"),isNamedSet:M,valueSort:((b={levelName:x})[x]=1,b.axis=g.getAttribute("Hierarchy"),b)},this.headerContent[h]||(this.headerContent[h]={}),this.headerContent[h][i]=this.pivotValues[h][i],h++}p++}else if(-1<s)this.pivotValues[s][i-1].ordinal=t;else if(0<this.tupColumnInfo[t].allCount){for(o=0,l=0;o<this.tupColumnInfo[t].allStartPos;)l+=0<n[o]&&this.getMeasurePosition(this.tupColumnInfo[t].uNameCollection,this.tupColumnInfo[t].measurePosition)!==o?a[o]:a[o]+(1-r[o]),o++;this.tupColumnInfo[t].allStartPos===this.tupColumnInfo[t].measurePosition+1?l-=a[this.tupColumnInfo[t].allStartPos-2]-this.tupColumnInfo[t].levelCollection[this.tupColumnInfo[t].allStartPos-2]+1:l-=a[this.tupColumnInfo[t].allStartPos-1]-this.tupColumnInfo[t].levelCollection[this.tupColumnInfo[t].allStartPos-1],this.pivotValues[l-1]&&(this.pivotValues[l-1][i-1].ordinal=t)}},f.prototype.isAttributeDrill=function(e,t,i){var a=!1;if(!this.isAdjacentToMeasure(e,i))for(var r=0;r<this.drilledMembers.length;r++)if(this.drilledMembers[r].name===e)for(var n=0;n<this.drilledMembers[r].items.length;n++){for(var s=this.drilledMembers[r].delimiter,o=this.drilledMembers[r].items[n].split(s),l="",d=0;d<o.length;d++)t[d]&&t[d].uName&&(l=l+(""===l?"":this.drilledMembers[r].delimiter)+t[d].uName);if(l===this.drilledMembers[r].items[n]){a=!0;break}}return a},f.prototype.isAdjacentToMeasure=function(e,t){for(var i=!1,a="rows"===t?this.rows:this.columns,r=0;r<a.length;r++)if(a[r].name===e&&a[r+1]&&("[Measures]"===a[r+1].name||a[r+1].isNamedSet||this.fieldList[a[r+1].name]&&!this.fieldList[a[r+1].name].hasAllMember)){i=!0;break}return i},f.prototype.getDrilledParent=function(e,t,i){for(var a=Number(e.querySelector("LNum").textContent),r=e,n=a-1;t<=n;n--){var s=this.drilledSets[r.querySelector("PARENT_UNIQUE_NAME").textContent];if(!s)break;r=i[n]=s}},f.prototype.performRowSorting=function(e,t){if((this.enableSort||this.enableValueSorting)&&0<this.tupRowInfo.length){for(var i=this.pivotValues.length,a={},r={},n=[],s=!1,o=this.tupRowInfo[0].typeCollection.lastIndexOf("1"),l=void 0,d=this.colDepth;d<i;d++){var p,h,u=this.pivotValues[d][0];this.showSubTotalsAtBottom&&u.isSum&&3!==u.memberType||(""!==(p=(h=this.tupRowInfo[u.ordinal])?0===h.measurePosition&&3===u.memberType?h.measureName:h.uNameCollection:"")&&(h=(p=-1<o?this.frameUniqueName(p,u,h):p).split(/~~|::\[/).length,3===u.memberType&&0<this.tupRowInfo[0].measurePosition?r[L=this.getParentUname(p,u,!0,!0)]?r[L].push(u):r[L]=[u]:a[h]?a[h][p]=[u]:a[h]=((h={})[p]=[u],h)),s&&n.push(u),"grand sum"===u.type&&(s=!0))}for(var c=0<Object.keys(r).length&&0<this.tupRowInfo[0].measurePosition,g=Object.keys(a).map(function(e){return Number(e)}).sort(function(e,t){return t<e?1:e<t?-1:0}),m={},S=g.length-1;0<=S;S--){for(var f={},v=a[g[S]],y=Object.keys(v),b=0;b<y.length;b++)f[L=0===S?"parent":this.getParentUname(y[b],v[y[b]][0],c,!1)]?f[L].push(v[y[b]][0]):f[L]=v[y[b]];for(var C=Object.keys(f),x=0;x<C.length;x++)f[C[x]]=this.sortRowHeaders(f[C[x]],e,t);if(m[g[S+1]])for(x=0;x<C.length;x++){for(var w=[],T=f[C[x]],M=0;M<T.length;M++){var D=this.tupRowInfo[T[M].ordinal],O=0===D.measurePosition&&3===T[M].memberType?D.measureName:D.uNameCollection,k=(w.push(T[M]),-1<o&&(O=this.frameUniqueName(O,T[M],D)),!1);if(c)if(r[L=this.getParentUname(O,T[M],c,!0)]){r[L]=this.sortRowHeaders(r[L],e,t);var P=O.lastIndexOf("::[")===O.indexOf("::[Measures]"),j=O.split("::[").length-1===D.measurePosition,q=!D.drillInfo[D.measurePosition-1].isDrilled,D=D.members.length>D.measurePosition+1;if(P&&j&&q&&D)for(var k=!0,N=0;N<r[L].length;N++){w.push(r[L][N]);var E=O.substring(0,O.indexOf("::[Measures]"))+"::"+r[L][N].actualText;m[g[S+1]][E]&&(w=w.concat(m[g[S+1]][E]))}else l=this.showSubTotalsAtBottom&&w[w.length-1].isDrilled,w=w.concat(r[L])}if(!k&&m[g[S+1]][O])if(this.showSubTotalsAtBottom&&3===w[w.length-1].memberType&&-1<w[w.length-1].level&&l){for(var F=[],V=0,I=w.length-1;0<=I;I--){if(3!==w[I].memberType){F=F.reverse(),V=I+1;break}F[F.length]=w[I]}w=w.slice(0,V).concat(m[g[S+1]][O]).concat(F)}else{u=w[w.length-1],P=void 0;this.showSubTotalsAtBottom&&u.isDrilled&&((P=Ce.frameHeaderWithKeys(u)).hasChild=!1,P.isDrilled=!1,P.isSum=!0,P.formattedText=P.formattedText+" Total"),w=w.concat(m[g[S+1]][O]),P&&(w[w.length]=P)}}f[C[x]]=w}else if(c)for(x=0;x<C.length;x++){for(T=f[C[x]],w=[],M=0;M<T.length;M++){w.push(T[M]);var L,O=this.tupRowInfo[T[M].ordinal].uNameCollection;-1<o&&(O=this.frameUniqueName(O,T[M],this.tupRowInfo[T[M].ordinal])),r[L=this.getParentUname(O,T[M],!0,!0)]&&(r[L]=this.sortRowHeaders(r[L],e,t),w=w.concat(r[L]))}f[C[x]]=w}m[g[S]]=f}for(var A=0,H=0,_=0,s=!1,n=this.sortRowHeaders(n,e,t),d=this.colDepth;d<i;d++){"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&("column"===this.olapValueAxis&&this.colDepth+1===d||"row"===this.olapValueAxis&&this.colDepth+this.dataSourceSettings.values.length+1===d)&&(A=0,s=!1);var R=s?n:m[g[0]].parent,U="Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&this.colDepth===d?R.length:s?A-H:A;R[U]&&(this.pivotValues[d]=[R[U]],this.pivotValues[d][0].rowIndex=d,this.valueContent[_][0]=this.pivotValues[d][0]),A++,_++,"grand sum"===this.pivotValues[d][0].type&&(s=!0,H=A)}}},f.prototype.performColumnSorting=function(e,t){if(this.enableSort||this.enableValueSorting)for(var i=0;i<this.dataSourceSettings.columns.length;i++){for(var a=[],r=0,n=[],s=0;s<this.pivotValues.length;s++){for(var o=this.pivotValues[s],l=void 0,d={},p=[],h=1,u=(n[r]=[],a[r]=[],1),c=o[u].hierarchy,g=o[u].levelUniqueName;u<o.length;u++)if(!o[u].isNamedSet){if(2!==o[u].memberType&&"[Measures]"!==o[u].hierarchy&&-1!==o[u].level){if(Ue.isNullOrUndefined(d[o[u].formattedText])||Ue.isNullOrUndefined(this.pivotValues[s-1]))d[o[u].formattedText]||(d[o[u].formattedText]=[]),o[u+1]&&o[u].formattedText===o[u+1].formattedText||(p[p.length]=o[u]),d[o[u].formattedText][o[u].colIndex]=o[u];else if(d[o[u].formattedText]&&this.pivotValues[s-1]){var m=this.pivotValues[s-1][o[u].colIndex],S=Number(Object.keys(d[o[u].formattedText])[0]),S=d[o[u].formattedText][S].colIndex,S=this.pivotValues[s-1][S];if(m.formattedText!==S.formattedText){l=this.sortColumnHeaders(d,p,this.sortObject[o[u-1].levelUniqueName]||this.sortObject[o[u].hierarchy],e,t,c,g),a[r]=Ue.isNullOrUndefined(a[r])?[]:a[r];for(var f=0;f<l.length;f++)for(var v=Object.keys(d[l[f]]).length,y=0;y<v;y++)h=0===a[r].length?1:0,a[r][a[r].length+h]=d[l[f]][Number(Object.keys(d[l[f]])[y])];p=[],(d={})[o[u].formattedText]=[],p[p.length]=o[u]}d[o[u].formattedText][o[u].colIndex]=o[u]}}else if(0<Object.keys(d).length){n[r][n[r].length+h]=o[u],l=this.sortColumnHeaders(d,p,this.sortObject[o[u-1].levelUniqueName]||this.sortObject[o[u].hierarchy],e,t,c,g),a[r]=Ue.isNullOrUndefined(a[r])?[]:a[r];for(var b=0;b<l.length;b++)for(var C=Object.keys(d[l[b]]).length,x=0;x<C;x++)h=0===a[r].length?1:0,a[r][a[r].length+h]=d[l[b]][Number(Object.keys(d[l[b]])[x])]}else(-1===o[u].level||0===o[u].level)&&0<=Object.keys(d).length&&"[Measures]"!==o[u].hierarchy&&(n[r][n[r].length+h]=o[u]);if(-1!==o[u].level&&1===Object.keys(d).length&&"[Measures]"!==o[u].hierarchy&&!Ue.isNullOrUndefined(o[u+1])&&-1===o[u+1].level){var w=Object.keys(d[o[u].formattedText]).length,T=Object.keys(d[o[u].formattedText]);if(1<w)for(var M=0;M<w;M++)h=0===n[r].length?1:0,n[r][n[r].length+h]=d[o[u].formattedText][Number(T[M])];else n[r][n[r].length+h]=o[u]}if(0<Object.keys(n[r]).length){var h=0===a[r].length?1:0,D=n[r].length;if(2<D)for(var O=1;O<D;O++)h=0===a[r].length?1:0,a[r][a[r].length+h]=n[r][O];else a[r][a[r].length+h]=n[r][1]||n[r][0];d={},p=[],n[r]=[]}}if(0<Object.keys(d).length){n[r][n[r].length+h]=o[u];var P=this.sortObject[o[u-1].levelUniqueName]||this.sortObject[o[u-1].hierarchy],l=this.sortColumnHeaders(d,p,P,e,t,c,g);a[r]=Ue.isNullOrUndefined(a[r])?[]:a[r];for(var N=0;N<l.length;N++)for(var k=Object.keys(d[l[N]]).length,x=0;x<k;x++)h=0===a[r].length?1:0,a[r][a[r].length+h]=d[l[N]][Number(Object.keys(d[l[N]])[x])]}for(var E=1;E<a[r].length;E++)this.pivotValues[r][E]=a[r][E];for(var F=s;F<this.pivotValues.length;F++){var I=Ue.extend({},this.pivotValues[F+1],null,!0),L=Ue.extend({},this.pivotValues[F],null,!0);if(Object.keys(I).length===Object.keys(L).length&&2<Object.keys(I).length){for(var A=1;A<this.pivotValues[s].length;A++)0<Object.keys(I).length&&L[A].colIndex!==I[A].colIndex&&(this.pivotValues[F+1][A]=I[L[A].colIndex]);break}}r++,d={}}for(var R=0;R<this.pivotValues.length;R++)for(o=this.pivotValues[R],s=1;s<o.length;s++)o[s].colIndex=s}},f.prototype.frameUniqueName=function(e,t,i){var a=-1<e.indexOf(t.actualText.toString()+"::[Measures]"),t=(e=e.substring(0,e.indexOf(t.actualText.toString()))+t.actualText.toString()).split("::[").length<=this.getMeasurePosition(e,i.measurePosition);return e+=a||t?"::"+i.measureName:""},f.prototype.getMeasurePosition=function(e,t){for(var i=t,a=e.split("::["),r=0;r<a.length;r++)if(a[r]&&-1<a[r].indexOf("Measures")){i=r;break}return i},f.prototype.sortRowHeaders=function(e,t,i){if(this.enableValueSorting&&"column"===this.olapValueAxis&&i.isValueSorting&&!Ue.isNullOrUndefined(this.valueSortSettings)){for(var a=[],r=0;r<e.length;r++){var n=e[r],s=t[n.ordinal*i.columnLength+i.memberIndex],o=s?s.getElementsByTagName("Value"):void 0,s=s&&0<o.length?Number(o[0].textContent):0;a.push({header:n,value:s})}e=Ce.getSortedValue(a,this.valueSortSettings.sortOrder)}else if(this.enableSort&&0<e.length&&3!==e[0].memberType&&!e[0].isNamedSet){for(var l=[],r=0;r<e.length;r++)l[r]=e[r].actualText;var d=!1,p=("Grand Total"!==e[0].actualText?e[0]:e[1]).hierarchy,h=this.fieldList[p]&&this.fieldList[p].membersOrder?this.fieldList[p].membersOrder.slice():[],p={fieldName:p,levelName:e[0].levelUniqueName,sortOrder:this.sortObject[e[0].hierarchy]||this.sortObject[e[0].levelUniqueName],members:h&&0<h.length?h:l,IsOrderChanged:!1};if(h&&0<h.length?Ce.applyCustomSort(p,e,"string",!1,!0):("Ascending"===p.sortOrder||void 0===p.sortOrder?e.sort(function(e,t){return e.formattedText>t.formattedText?1:t.formattedText>e.formattedText?-1:0}):"Descending"===p.sortOrder&&e.sort(function(e,t){return e.formattedText<t.formattedText?1:t.formattedText<e.formattedText?-1:0}),d=!0),d&&this.getHeaderSortInfo){for(var u=[],c=0,g=0;c<e.length;c++)"Grand Total"!==e[c].actualText&&(u[g++]=e[c].formattedText);p.members=u}this.getHeaderSortInfo&&this.getHeaderSortInfo(p),p.IsOrderChanged&&Ce.applyCustomSort(p,e,"string",!0,!0)}return e},f.prototype.sortColumnHeaders=function(e,t,i,a,r,n,s){var o=Object.keys(e);if(this.enableValueSorting&&"row"===this.olapValueAxis&&r.isValueSorting&&!Ue.isNullOrUndefined(this.valueSortSettings)){for(var l=[],d=0;d<o.length;d++){var p=e[o[d]],p=this.showSubTotalsAtTop?p[0]:p[p.length-1],h=a[r.memberIndex*r.columnLength+p.ordinal],u=h?h.getElementsByTagName("Value"):void 0,h=h&&0<u.length?Number(u[0].textContent):0;l.push({header:p,value:h})}o=Ce.getSortedValue(l,this.valueSortSettings.sortOrder).map(function(e){return e.formattedText})}else if(this.enableSort){var c=!1,g=this.fieldList[n]&&this.fieldList[n].membersOrder?this.fieldList[n].membersOrder.slice():[],n={fieldName:n,levelName:s,sortOrder:i,members:g&&0<g.length?g:o,IsOrderChanged:!1};if(g&&0<g.length?this.applyCustomSort(o,n):("Ascending"===n.sortOrder||void 0===n.sortOrder?o.sort(function(e,t){return t<e?1:e<t?-1:0}):"Descending"===n.sortOrder&&o.sort(function(e,t){return e<t?1:t<e?-1:0}),c=!0),c&&this.getHeaderSortInfo){for(var m=[],S=0,f=0;S<o.length;S++)"Grand Total"!==o[S]&&(m[f++]=o[S]);n.members=m}this.getHeaderSortInfo&&this.getHeaderSortInfo(n),n.IsOrderChanged&&this.applyCustomSort(o,n,!0)}return o},f.prototype.applyCustomSort=function(e,t,i){var a,r=[],n=[],r=t.IsOrderChanged?t.members:"Ascending"===t.sortOrder||"None"===t.sortOrder||void 0===t.sortOrder?[].concat(t.members):[].concat(t.members).reverse();"Grand Total"===e[0]&&(a=e[0],e.shift());for(var s=0,o=0;s<e.length;s++){var l=e[s];if(r[o]===l){if(e.splice(o++,0,l),e.splice(++s,1),!(o<r.length)){i||n.splice(--o,0,l);break}s=-1}0<=s&&!i&&(n[s]=e[s])}if(!i){for(s=n.length;s<e.length;s++)n[s]=e[s];"Grand Total"===n[n.length-1]&&n.pop(),t.members=n}return a&&e.splice(0,0,a),e},f.prototype.frameSortObject=function(){if(this.enableSort)for(var e=0;e<this.sortSettings.length;e++)this.sortObject[this.sortSettings[e].name]=this.sortSettings[e].order},f.prototype.getParentUname=function(e,t,i,a){var r="";if(i&&!a){for(var n,i=this.tupRowInfo[t.ordinal],s=[],o={},l=0;l<e.length;l++)"~"!==e[l]&&":"!==e[l]||(s.push(l),o[l]=e[l]+e[l],l++);r=this.getMeasurePosition(e,i.measurePosition)>=e.split("::[").length-1?-1<s[s.length-2]?e.substring(0,s[s.length-2])+o[s[s.length-1]]+i.measureName:"parent":-1<(n=e.lastIndexOf("~~")>e.lastIndexOf("::[")?e.lastIndexOf("~~"):e.lastIndexOf("::["))?e.substring(0,n):"parent"}else r=-1<(n=e.lastIndexOf("~~")>e.lastIndexOf("::[")?e.lastIndexOf("~~"):e.lastIndexOf("::["))?e.substring(0,n):"parent";return r},f.prototype.performColumnSpanning=function(){for(var e={},t=this.rowStartPos-1,i=Object.keys(this.colMeasures).length,a=this.tupColumnInfo[0]?this.tupColumnInfo[0].measurePosition:this.measureIndex,r=t;-1<r;r--)if(3===this.pivotValues[r][1].memberType){a=r;break}for(;-1<t;){e[t]={};for(var n=this.pivotValues[t].length-1;0<n;){e[t][n]=1;var s=this.pivotValues[t][n+1],o=this.pivotValues[t+1]&&1<this.rowStartPos-t?this.pivotValues[t+1][n]:void 0,l=this.pivotValues[t][n],d=!1,p=!1,h=this.tupColumnInfo[l.ordinal],u=h.allStartPos>("3"===h.typeCollection[0]?1:0),h=this.checkAttributeDrill(h.drillInfo,"columns");this.showSubTotalsAtTop&&l.isDrilled&&s&&s.actualText!==l.actualText&&-1<l.level&&(l.ordinal=this.getOrdinal(l,this.pivotValues[t+1])),o&&s&&(2===l.memberType||-1===l.level?s.actualText===l.actualText:3===l.memberType&&l.actualText===s.actualText||s.valueSort.levelName===l.valueSort.levelName)&&(2===l.memberType?u&&"sum"!==s.type?l.colSpan=1:l.colSpan=s.colSpan+1>(t<a?i:0)?1:s.colSpan+1:(l.colSpan=s.colSpan+1,l.ordinal=s.ordinal),d=!0),2===l.memberType?(u?(h||(l.type="sum"),l.formattedText="Total",l.valueSort[l.valueSort.levelName.toString()]=1):(l.type="grand sum",l.formattedText="Grand Total",t<this.measureIndex&&(l.valueSort.levelName=s="Grand Total",l.valueSort[s.toString()]=1)),l.hasChild=!1):-1===l.level&&(l.type="sum",l.formattedText="Total",l.hasChild=!1,l.valueSort[l.valueSort.levelName.toString()]=1),o?2===l.memberType&&2===o.memberType||o.actualText===l.actualText?(e[t][n]=e[t+1]?e[t+1][n]+1:1,0===t||1===l.memberType&&-1<l.level&&1===o.memberType&&-1===o.level?(l.rowSpan=!l.isDrilled||this.fieldList[l.hierarchy]&&this.fieldList[l.hierarchy].isHierarchy&&!l.hasChild?e[t+1][n]+1:1,o.rowSpan=!o.isDrilled||this.fieldList[o.hierarchy]&&this.fieldList[o.hierarchy].isHierarchy&&!o.hasChild||-1!==o.level?o.rowSpan:e[t+1][n]):3===l.memberType?l.rowSpan=1:l.rowSpan=-1,p=!0):!l.isDrilled||this.fieldList[l.hierarchy]&&this.fieldList[l.hierarchy].isHierarchy&&!l.hasChild||-1!==l.level||2!==o.memberType?(l.rowSpan=0===t?e[t][n]:-1,o.rowSpan=-1<o.level&&(!o.isDrilled||this.fieldList[o.hierarchy]&&this.fieldList[o.hierarchy].isHierarchy&&!o.hasChild)||2!==l.memberType&&2===o.memberType?e[t+1][n]:1):(e[t][n]=e[t+1]?e[t+1][n]+1:1,l.rowSpan=-1,p=!0):l.rowSpan=-1<l.level||1===this.rowStartPos?e[t][n]:-1,d||(l.colSpan=1),p||(e[t][n]=1),n--}t--}},f.prototype.getOrdinal=function(e,t){for(var i=0,a=e.colIndex;0<a;a--)if(-1===t[a].level){i=t[a].ordinal;break}return i},f.prototype.frameValues=function(e,t){var i,a=this.colDepth,r=this.pivotValues.length,n=0;"down"===this.customArgs.action&&(i=Object.keys(this.onDemandDrillEngine),a=Number(i[0]),r=Number(i[i.length-1])+1,n=this.onDemandDrillEngine[a][0].ordinal);for(var s=a;s<r;s++)for(var o,l,d,p,h,u,c,g=this.pivotValues[s],m=g[0].ordinal,S=1;S<this.pivotValues[0].length;S++)this.pivotValues[this.colDepth-1][S]&&(o=this.pivotValues[this.colDepth-1][S].ordinal,l=this.pivotValues[this.colDepth-1][S],l=3===g[0].memberType?g[0].actualText.toString():this.tupColumnInfo[l.ordinal]&&this.tupColumnInfo[l.ordinal].measure?this.tupColumnInfo[l.ordinal].measure.querySelector("UName").textContent:g[0].actualText,"header"===g[0].type?g[S]={axis:"value",actualText:this.getUniqueName(l),formattedText:"",value:0,colIndex:S,rowIndex:s}:(p=void 0,h="0",l=this.getUniqueName(l),c=!0,u=!this.fieldList[g[0].hierarchy]||!this.fieldList[g[0].hierarchy].isHierarchy||g[0].isDrilled,c=this.tupRowInfo[m]?this.tupRowInfo[m].showTotals:(d=0===this.dataSourceSettings.rows.length||1===this.dataSourceSettings.rows.length&&"[Measures]"===this.dataSourceSettings.rows[0].name,this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals||d),d=e[(m-n)*t+o],p=this.showSubTotalsAtBottom&&g[0].isDrilled||!c&&u?"":Ue.isNullOrUndefined(d)||Ue.isNullOrUndefined(d.querySelector("FmtValue"))?this.emptyCellTextContent:d.querySelector("FmtValue").textContent,h=!c&&u?"0":Ue.isNullOrUndefined(d)||Ue.isNullOrUndefined(d.querySelector("Value"))?null:d.querySelector("Value").textContent,p=this.showSubTotalsAtBottom&&g[0].isDrilled?"":c&&!Ue.isNullOrUndefined(h)?this.getFormattedValue(Number(h),l,""!==p?p:h):p,u=!this.tupColumnInfo[o]||0<this.tupColumnInfo[o].allCount||-1<this.tupColumnInfo[o].drillStartPos||!this.tupRowInfo[m]||0<this.tupRowInfo[m].allCount||-1<this.tupRowInfo[m].drillStartPos,c=!!this.tupRowInfo[m]&&(0===this.tupRowInfo[m].measurePosition?1===this.tupRowInfo[m].allStartPos:0===this.tupRowInfo[m].allStartPos)||!!this.tupColumnInfo[o]&&(0===this.tupColumnInfo[o].measurePosition?1===this.tupColumnInfo[o].allStartPos:0===this.tupColumnInfo[o].allStartPos),g[S]={axis:"value",actualText:l,formattedText:p,colOrdinal:o,rowOrdinal:m,columnHeaders:this.tupColumnInfo[o]?this.tupColumnInfo[o].captionCollection:"",rowHeaders:this.tupRowInfo[m]?this.tupRowInfo[m].captionCollection:"",value:Ue.isNullOrUndefined(h)?null:Number(h),colIndex:S,rowIndex:s,isSum:u,isGrandSum:c}),this.valueContent[s-this.rowStartPos][S]=g[S])},f.prototype.getFormattedValue=function(e,t,i){return this.formatFields[t]&&!Ue.isNullOrUndefined(e)&&(t=this.formatFields[t].properties||this.formatFields[t],delete(t=Ue.extend({},t,null,!0)).name,!t.minimumSignificantDigits&&t.minimumSignificantDigits<1&&delete t.minimumSignificantDigits,!t.maximumSignificantDigits&&t.maximumSignificantDigits<1&&delete t.maximumSignificantDigits,i=t.type?this.globalize.formatDate(new Date(e.toString()),t):(delete t.type,this.globalize.formatNumber(e,t))),i},f.prototype.getMeasureInfo=function(){this.olapValueAxis=void 0,this.olapRowValueIndex=void 0;for(var e,t="column",i=[],a=0,r=this.values;a<r.length;a++){var n=r[a];i[i.length]=n.isCalculatedField?this.fieldList[n.name].tag:n.name}if(0<i.length){if(this.isMeasureAvail){for(var s=!1,o=0,l=0,d=this.rows.length;l<d;l++)if("[measures]"===this.rows[l].name.toLowerCase()){t="row",e=l,s=!0,o=this.dataSourceSettings.rows.length,this.olapRowValueIndex=e;break}if(!s)for(l=0,d=this.columns.length;l<d;l++)if("[measures]"===this.columns[l].name.toLowerCase()){t="column",e=l,s=!0,o=this.dataSourceSettings.columns.length;break}this.olapValueAxis=t,this.measurePosition=e,this.measureIndex=e===o-1?-1:e}else e="row"===(t=this.valueAxis)?this.rows.length-1:this.columns.length-1;return{measureAxis:t,measureIndex:e,valueInfo:i}}return{measureAxis:t,measureIndex:-1,valueInfo:[]}},f.prototype.frameMeasureOrder=function(e,k,t,i,a,j){var r=[],n=[],s=[],o={},l=[],d=e.measureAxis,p=e.measureIndex,h=e.valueInfo;if(d===k&&0<h.length){for(var u={},c=[],g=0,q=t.length;g<q;g++){for(var m=t[g],V=[].slice.call(m.querySelectorAll("Member")),S="",f="",v=0;v<V.length;)S=S+(""!==S?"~~":"")+V[v].querySelector("UName").textContent,(v===p&&0===p||v===p-1)&&(f=S),v++;u[f]?u[f][u[f].length]=S:(u[f]=[S],c[c.length]=f),o[S]={index:g,node:m},l[l.length]=S}if(0<l.length&&0<c.length)if(0===p){for(var y=0,H=h;y<H.length;y++)for(var _=H[y],b=0,U=c;b<U.length;b++)if((w=U[b])===_)for(var C=0,B=u[w];C<B.length;C++){S=B[C];s[s.length]=o[S].index,r[r.length]=o[S].node}}else for(var x=0,G=c;x<G.length;x++)for(var w=G[x],T=0,z=h;T<z.length;T++)for(var W=z[T],M=0,Q=u[w];M<Q.length;M++)(S=Q[M]).split("~~")[p]===W&&(s[s.length]=o[S].index,r[r.length]=o[S].node);var Y=[];if(0<i.length){for(var D=[],O=[],P=0,N=0,E=0,g=0,F=j;g<F;g++){a-1<N?(N=0,D[++E]||(D[E]=[])):D[E]||(D[E]=[]),D[E][N]=g,N++;var I=void 0;i[P]?I=this.olapVirtualization?g:Number(i[P].getAttribute("CellOrdinal")):P++,I===g&&(Y[O[g]=I]=i[P],P++)}if(i=Y,"column"===d){if(0<D.length&&D[0].length===s.length)for(v=0,F=s.length;v<F;v++)for(g=0;g<D.length;){var L=g*a+v;!Ue.isNullOrUndefined(D[g])&&!Ue.isNullOrUndefined(s[v])&&(R=(O[L]||L).toString(),A=i[Number(D[g][s[v]])])&&(A.setAttribute("CellOrdinal",R.toString()),n[L]=A),g++}}else if(D.length===s.length)for(v=0,F=s.length;v<F;v++)for(g=0;g<D[s[v]].length;){var A,R=(O[L=v*a+g]||L).toString();(A=i[Number(D[s[v]][g])])&&(A.setAttribute("CellOrdinal",R.toString()),n[n.length]=A),g++}}return{orderedHeaderTuples:r,orderedValueTuples:n}}return{orderedHeaderTuples:t,orderedValueTuples:i}},f.prototype.getDrilledSets=function(e,t,i,a){for(var r=[],n=t.actualText.toString(),s="row"===a?this.tupRowInfo:this.tupColumnInfo,a=s[t.ordinal],o=0===s[0].typeCollection.indexOf("3")?1:0,l=0,d="1"===s[0].typeCollection[i];l<s.length;)(Ue.isNullOrUndefined(s[l].allStartPos)||s[l].allStartPos>o)&&(r[r.length]=s[l].uNameCollection),l++;for(var p=e.split("::[").map(function(e){return"["===e[0]?e:"["+e}),h=[],u=0;u<=i;u++)if(p[u])if((d||this.isPaging)&&u===i){for(var c=p[u].split("~~"),g=c.indexOf(n),m=[],S=0;S<=g;S++)m.push(c[S]);h[h.length]=0<m.length?m.join("~~"):p[u]}else h[h.length]=p[u];e=h.join("::");for(var f=[],v={},y=0,b=r;y<b.length;y++){var C=b[y];if(0===C.indexOf(e)&&(f.push(C),this.isPaging))for(var C=C.split("::[")[i],x=(M=(C="["===C[0]?C:"["+C).split("~~")).indexOf(n);x<M.length;x++)v[M[x]]=M[x]}if(this.isPaging){for(var w=a.uNameCollection.split("::[").map(function(e){return"["===e[0]?e:"["+e}),T=[],x=0;x<w.length;x++)x!==i&&(T[x]=w[x]);for(var M=Object.keys(v),x=0;x<M.length;x++)T[i]=M[x],f.push(T.join("::"))}for(var D={},O=0,P=f;O<P.length;O++){for(var N=P[O].split("::[").map(function(e){return"["===e[0]?e:"["+e}),E="",F=0;F<=i;F++){var I=N[F];I&&(E=E+(""!==E?"~~":"")+(I=I.split("~~"))[I.length-1])}D[E]=E}return D},f.prototype.updateDrilledInfo=function(e){this.dataSourceSettings=e,this.drilledMembers=e.drilledMembers?this.updateDrilledItems(e.drilledMembers):[],this.generateGridData(e)},f.prototype.updateCalcFields=function(e,t){this.dataSourceSettings=e,this.calculatedFieldSettings=e.calculatedFieldSettings||[],this.getAxisFields(),this.updateFieldlist(),this.loadCalculatedMemberElements(this.calculatedFieldSettings),this.dataFields[t.name]?this.generateGridData(e):hp.getCellSets(e,this,!0,void 0,!0)},f.prototype.onSort=function(e,t){this.dataSourceSettings=e,t||(this.sortSettings=e.sortSettings||[],this.getAxisFields(),this.frameSortObject(),this.updateFieldlist()),0<this.xmlaCellSet.length&&this.xmlDoc?this.generateEngine(this.xmlDoc,this.request,this.customArgs):this.generateGridData(e)},f.prototype.updateFieldlist=function(e){for(var t=0;t<this.savedFieldListData.length;){var i,a=this.savedFieldListData[t].id,r=this.savedFieldListData[t].pid;if(this.savedFieldList[a]&&(i=this.enableSort?this.sortObject[a]||"Ascending":"None",this.savedFieldList[a].isSelected=!1,this.savedFieldList[a].isExcelFilter=!1,this.savedFieldList[a].sort=i,this.savedFieldList[a].allowDragAndDrop=!0,this.savedFieldList[a].showFilterIcon=!0,this.savedFieldList[a].showSortIcon=!0,this.savedFieldList[a].showEditIcon=!0,this.savedFieldList[a].showRemoveIcon=!0,this.savedFieldList[a].showValueTypeIcon=!0,this.savedFieldList[a].showSubTotals=!0,this.savedFieldListData[t].sort=i,this.savedFieldListData[t].allowDragAndDrop=!0,this.savedFieldListData[t].showFilterIcon=!0,this.savedFieldListData[t].showSortIcon=!0,this.savedFieldListData[t].showEditIcon=!0,this.savedFieldListData[t].showRemoveIcon=!0,this.savedFieldListData[t].showValueTypeIcon=!0,this.savedFieldListData[t].showSubTotals=!0,e)&&(this.savedFieldList[a].filter=[],this.savedFieldList[a].actualFilter=[]),this.dataFields[a]&&this.savedFieldList[a]&&-1<this.selectedItems.indexOf(a)?(this.savedFieldList[a].isSelected=!0,this.savedFieldList[a].allowDragAndDrop=!this.dataFields[a]||this.dataFields[a].allowDragAndDrop,this.savedFieldList[a].showFilterIcon=!this.dataFields[a]||this.dataFields[a].showFilterIcon,this.savedFieldList[a].showSortIcon=!this.dataFields[a]||this.dataFields[a].showSortIcon,this.savedFieldList[a].showEditIcon=!this.dataFields[a]||this.dataFields[a].showEditIcon,this.savedFieldList[a].showRemoveIcon=!this.dataFields[a]||this.dataFields[a].showRemoveIcon,this.savedFieldList[a].showValueTypeIcon=!this.dataFields[a]||this.dataFields[a].showValueTypeIcon,this.savedFieldList[a].showSubTotals=!this.dataFields[a]||this.dataFields[a].showSubTotals,this.savedFieldListData[t].isSelected=!0,this.savedFieldListData[t].allowDragAndDrop=!this.dataFields[a]||this.dataFields[a].allowDragAndDrop,this.savedFieldListData[t].showFilterIcon=!this.dataFields[a]||this.dataFields[a].showFilterIcon,this.savedFieldListData[t].showSortIcon=!this.dataFields[a]||this.dataFields[a].showSortIcon,this.savedFieldListData[t].showEditIcon=!this.dataFields[a]||this.dataFields[a].showEditIcon,this.savedFieldListData[t].showRemoveIcon=!this.dataFields[a]||this.dataFields[a].showRemoveIcon,this.savedFieldListData[t].showValueTypeIcon=!this.dataFields[a]||this.dataFields[a].showValueTypeIcon,this.savedFieldListData[t].showSubTotals=!this.dataFields[a]||this.dataFields[a].showSubTotals):this.dataFields[r]&&this.savedFieldList[r]&&-1<this.selectedItems.indexOf(r)?this.savedFieldListData[t].isSelected=!0:this.savedFieldListData[t].isSelected=!1,this.savedFieldList[a]&&this.savedFieldList[a].isCalculatedField||"[calculated members].[_0]"===a.toLowerCase()){for(var n=!1,s=0,o=this.calculatedFieldSettings;s<o.length;s++){var l,d,p=o[s];a===p.name&&(l=p.formula,d=p.formatString,this.savedFieldListData[t].formula=l,this.savedFieldListData[t].formatString=d,this.savedFieldListData[t].parentHierarchy=-1<l.toLowerCase().indexOf("measure")?void 0:p.hierarchyUniqueName,this.savedFieldList[a].formula=l,this.savedFieldList[a].formatString=d,this.savedFieldList[a].parentHierarchy=this.savedFieldListData[t].parentHierarchy,n=!0)}(!n&&"[calculated members].[_0]"!==a.toLowerCase()||"[calculated members].[_0]"===a.toLowerCase()&&0===this.calculatedFieldSettings.length)&&(this.savedFieldListData.splice(t,1),t--,this.savedFieldList[a])&&delete this.savedFieldList[a]}t++}this.fieldList=this.savedFieldList,this.fieldListData=this.savedFieldListData},f.prototype.updateFieldlistData=function(e,t){for(var i=0,a=this.fieldListData;i<a.length;i++){var r=a[i];if(r.id===e){r.isSelected=!!t;break}}},f.prototype.getFormattedFields=function(e){this.formatFields={};for(var t=e.length;t--;)this.formatFields[e[t].name]=e[t]},f.prototype.getCubes=function(e){var t=this.getConnectionInfo(e.url,e.localeIdentifier.toString()),i='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><Discover xmlns="urn:schemas-microsoft-com:xml-analysis"><RequestType>MDSCHEMA_CUBES</RequestType><Restrictions><RestrictionList><CATALOG_NAME>'+e.catalog+"</CATALOG_NAME></RestrictionList></Restrictions><Properties><PropertyList><Catalog>"+e.catalog+"</Catalog> <LocaleIdentifier>"+t.LCID+"</LocaleIdentifier>"+(e.roles?"<Roles>"+e.roles+"</Roles>":"")+"</PropertyList></Properties></Discover></Body></Envelope>";if(this.doAjaxPost("POST",t.url,i,this.validateCube.bind(this),{dataSourceSettings:e,action:"getCubes"}),this.errorInfo)throw this.errorInfo},f.prototype.validateCube=function(e,t,i){for(var e=[].slice.call(e.querySelectorAll("row")),a=!1,r=0,n=e;r<n.length;r++)if(n[r].querySelector("CUBE_NAME").textContent===i.dataSourceSettings.cube){a=!0;break}!a&&0<e.length&&(this.errorInfo="Invalid cube name "+this.dataSourceSettings.cube)},f.prototype.getFieldList=function(e){var t={catalog:e.catalog,cube:e.cube,url:e.url,LCID:e.localeIdentifier.toString(),request:"MDSCHEMA_HIERARCHIES",roles:e.roles};this.getTreeData(t,this.getFieldListItems.bind(this),{dataSourceSettings:e,action:"loadFieldElements"})},f.prototype.getTreeData=function(e,t,i){var a=this.getConnectionInfo(e.url,e.LCID),e='<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"><Header/><Body><Discover xmlns="urn:schemas-microsoft-com:xml-analysis"><RequestType>'+e.request+"</RequestType><Restrictions><RestrictionList><CATALOG_NAME>"+e.catalog+"</CATALOG_NAME><CUBE_NAME>"+e.cube+"</CUBE_NAME></RestrictionList></Restrictions><Properties><PropertyList><Catalog>"+e.catalog+"</Catalog> <LocaleIdentifier>"+a.LCID+"</LocaleIdentifier>"+(e.roles?"<Roles>"+e.roles+"</Roles>":"")+"</PropertyList></Properties></Discover></Body></Envelope>";if(this.doAjaxPost("POST",a.url,e,t,i),this.errorInfo)throw this.errorInfo},f.prototype.getAxisFields=function(){this.rows=this.dataSourceSettings.rows||[],this.columns=this.dataSourceSettings.columns||[],this.filters=this.dataSourceSettings.filters||[],this.values=this.dataSourceSettings.values||[];for(var e=Ue.extend([],this.rows,null,!0),t=(e=e.concat(this.columns,this.values,this.filters)).length;t--;)this.dataFields[e[t].name]=e[t],"[measures]"===e[t].name.toLowerCase()?this.isMeasureAvail=!0:this.selectedItems.push(e[t].name);if(this.mappingFields={},this.dataSourceSettings.fieldMapping)for(var i=0,a=this.dataSourceSettings.fieldMapping;i<a.length;i++){var r=a[i];this.mappingFields[r.name]=r}!this.isMeasureAvail&&0<this.values.length&&(("row"===this.valueAxis?this.rows:this.columns).push({name:"[Measures]",caption:"Measures",showRemoveIcon:!0,allowDragAndDrop:!0}),this.isMeasureAvail=!0)},f.prototype.getAggregateType=function(e,t){var i;switch(t){case"1":i="Sum";break;case"2":i="Count";break;case"3":i="Min";break;case"4":i="Max";break;case"5":i="Avg";break;case"8":i="DistinctCount";break;case"127":i="CalculatedField";break;default:i=void 0}if(i)return i},f.prototype.getUniqueName=function(e){for(var t=e,i=0,a=this.calculatedFieldSettings;i<a.length;i++){var r=a[i];if(e===(-1<r.formula.toLowerCase().indexOf("measure")?"[Measures].":r.hierarchyUniqueName+".")+"["+r.name+"]"){t=r.name;break}}return t},f.prototype.updateFilterItems=function(e){for(var t=(t=Ue.extend([],this.rows,null,!0)).concat(this.columns),i=0,a=e;i<a.length;i++){var r=a[i];if("Include"===r.type&&this.allowMemberFilter&&this.fieldList[r.name]){var n=this.fieldList[r.name].members,s=n&&0<Object.keys(n).length,o=(this.fieldList[r.name].actualFilter=r.items.slice(),Ue.extend([],r.items,null,!0));if(s)for(var l=0;l<o.length;){for(var d=0,p=this.getParentNode(o[l],n,[]);d<p.length;d++){var h=p[d],h=Ce.inArray(h,r.items);-1!==h&&r.items.splice(h,1)}l++}for(var u=[],c=0,g=r.items;c<g.length;c++){var m=g[c],S=void 0;s||1!==r.items.length||(this.getMembers(this.dataSourceSettings,r.name,void 0,void 0,void 0,r.items[0]),S=this.fieldList[r.name].actualFilter[0]),u.push(m),s?this.fieldList[r.name].filter.push(n[m].caption):this.fieldList[r.name].filter.push(S||m)}this.filterMembers[r.name]=u,this.fieldList[r.name].isExcelFilter=!1}else if((this.allowValueFilter||this.allowLabelFilter)&&-1!==["Date","Label","Number","Value"].indexOf(r.type))for(var f=0,v=t;f<v.length;f++)if(v[f].name===r.name){var y=this.filterMembers[r.name];y&&"object"==typeof y[0]&&y[0].type===r.type?y[y.length]=r:this.filterMembers[r.name]=[r],this.fieldList[r.name].isExcelFilter=!0;break}}},f.prototype.getParentNode=function(e,t,i){return t[e].parent&&e!==t[e].parent&&(e=t[e].parent,i.push(e),this.getParentNode(e,t,i)),i},f.prototype.updateDrilledItems=function(e){for(var t=[],i=(i=Ue.extend([],this.rows,null,!0)).concat(this.columns),a=0,r=e;a<r.length;a++)for(var n=r[a],s=0,o=i;s<o.length;s++){var l=o[s];if(n.name===l.name){t.push(n);break}}return t},f.prototype.getDrillThroughData=function(e,t){for(var i,a=this.tupColumnInfo[e.colOrdinal]&&this.tupColumnInfo[e.colOrdinal].uNameCollection&&""!==this.tupColumnInfo[e.colOrdinal].uNameCollection?this.tupColumnInfo[e.colOrdinal].uNameCollection.split("::[").map(function(e){return"["===e[0]?e:"["+e}):[],r=this.tupRowInfo[e.rowOrdinal]&&this.tupRowInfo[e.rowOrdinal].uNameCollection&&""!==this.tupRowInfo[e.rowOrdinal].uNameCollection?this.tupRowInfo[e.rowOrdinal].uNameCollection.split("::[").map(function(e){return"["===e[0]?e:"["+e}):[],n=[],s="",o=0;o<this.filters.length;o++)if(i=this.filterMembers[this.filters[o].name]){for(var l=0;l<i.length;l++)s+=i[l],s=l<i.length-1?s+",":s+"";n[o]=s,s=""}for(o=0;o<n.length;o++)s=""===s?"{"+n[o]+"}":s+",{"+n[o]+"}";for(var d="",p="",o=0;o<a.length;o++)d=(0<d.length?d+",":"")+(1<a[o].split("~~").length?a[o].split("~~")[a[o].split("~~").length-1]:a[o]);for(o=0;o<r.length;o++)p=(0<p.length?p+",":"")+(1<r[o].split("~~").length?r[o].split("~~")[r[o].split("~~").length-1]:r[o]);e=(e="DRILLTHROUGH MAXROWS "+t+" Select("+(0<d.length?d:"")+(0<d.length&&0<p.length?",":"")+(0<p.length?p:"")+") on 0 from "+(""===s?"["+this.dataSourceSettings.cube+"]":"(SELECT ("+s+") ON COLUMNS FROM ["+this.dataSourceSettings.cube+"])")).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),t=this.getSoapMsg(this.dataSourceSettings,e),e=this.getConnectionInfo(this.dataSourceSettings.url,this.dataSourceSettings.localeIdentifier);if(this.doAjaxPost("POST",e.url,t,this.drillThroughSuccess.bind(this),{dataSourceSettings:this.dataSourceSettings,action:"drillThrough"}),this.errorInfo)throw this.errorInfo},f.prototype.drillThroughSuccess=function(e){var t=[].slice.call(e.querySelectorAll("row")),i="";if(0<t.length){for(var a=[],r=0;r<t.length;){for(var n=[].slice.call(t[r].children),s=0;s<n.length;)a.push('"'+n[s].tagName+'":"'+n[s].textContent+'"'),s++;r++}for(var o=a[0],l=0;l<a.length;)Object.keys(JSON.parse("[{"+a[l]+"}]")[0])[0]===Object.keys(JSON.parse("[{"+o+"}]")[0])[0]?i+=""===i?"[{"+a[l]:"}, {"+a[l]:i+=","+a[l],l++;i+="}]"}else for(var d=[].slice.call(e.querySelectorAll("faultstring")),r=0;r<d.length;)i+=d[r].textContent,r++;this.gridJSON=i},f.prototype.getFilterMembers=function(e,t,i,a,r){var n=this.fieldList[t].levels,s=this.fieldList[t].levelCount,s=r?"Descendants({"+n[s].id+"}, "+n[i-1].id+", "+(i-s==1?"SELF)":"SELF_AND_BEFORE)"):t+", Descendants({"+n[0].id+"}, "+n[i-1].id+", SELF_AND_BEFORE)";return this.fieldList[t].levelCount=i,a||this.getMembers(e,t,!1,s,r),s},f.prototype.getMembers=function(e,t,i,a,r,n){var s="DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE",o=this.fieldList[t].hasAllMember,l=(o?t:t+".LEVELS(0)").replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),i=i||n?n?"SELECT {"+(n=n.replace(/&/g,"&"))+"} ON 0 FROM ["+e.cube+"] WHERE {}":"SELECT ({"+l+".ALLMEMBERS})"+s+" ON 0 FROM ["+e.cube+"]":"SELECT ({"+(a||(o?l+", "+l+".CHILDREN":l+".ALLMEMBERS"))+"})"+s+" ON 0 FROM ["+e.cube+"]",a=this.getSoapMsg(e,i),o=this.getConnectionInfo(e.url,e.localeIdentifier);if(r||(this.fieldList[t].filterMembers=[],this.fieldList[t].childMembers=[],this.fieldList[t].searchMembers=[],this.fieldList[t].members={},this.fieldList[t].currrentMembers={}),this.doAjaxPost("POST",o.url,a,(n?this.getOlapFilterText:this.generateMembers).bind(this),{dataSourceSettings:e,fieldName:t,loadLevelMembers:r,action:"fetchMembers"}),this.errorInfo)throw this.errorInfo},f.prototype.getOlapFilterText=function(e,t,i){e=[].slice.call(e.querySelectorAll('Axis[name="Axis0"] Tuple'));0<e.length&&this.fieldList[i.fieldName]&&e[e.length-1].getElementsByTagName("Caption")&&e[e.length-1].getElementsByTagName("Caption")[0]&&(this.fieldList[i.fieldName].actualFilter[0]=e[e.length-1].getElementsByTagName("Caption")[0].textContent)},f.prototype.getChildMembers=function(e,t,i){var t="SELECT ({"+t.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,""")+".CHILDREN})DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE ON 0 FROM ["+e.cube+"]",t=this.getSoapMsg(e,t),a=this.getConnectionInfo(e.url,e.localeIdentifier);if(this.doAjaxPost("POST",a.url,t,this.generateMembers.bind(this),{dataSourceSettings:e,fieldName:i,action:"fetchChildMembers"}),this.errorInfo)throw this.errorInfo},f.prototype.getCalcChildMembers=function(e,t){this.calcChildMembers=[];var t="SELECT ({"+t.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,""")+".MEMBERS})DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE ON 0 FROM ["+e.cube+"]",i=this.getConnectionInfo(e.url,e.localeIdentifier),t=this.getSoapMsg(e,t);if(this.doAjaxPost("POST",i.url,t,this.generateMembers.bind(this),{dataSourceSettings:e,action:"fetchCalcChildMembers"}),this.errorInfo)throw this.errorInfo},f.prototype.getSearchMembers=function(e,t,i,a,r,n){if(this.fieldList[t].searchMembers=[],this.fieldList[t].currrentMembers={},""!==i){var s=t.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),r="WITH SET [SearchMembersSet] AS 'FILTER("+(r?s+".ALLMEMBERS, ":"{"+(1<n?this.getFilterMembers(e,t,n,!0):s+", "+s+".CHILDREN")+"},")+"(INSTR(1, "+s+'.CurrentMember.member_caption, "'+i+'") > 0))'SET [SearchParentsSet] AS 'GENERATE([SearchMembersSet], ASCENDANTS([SearchMembersSet].Current))'SET [SearchSet] AS 'HIERARCHIZE(DISTINCT({[SearchMembersSet], [SearchParentsSet]}))'SELECT SUBSET([SearchSet], 0, '+a+")DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE ON 0 FROM ["+e.cube+"]",n=this.getSoapMsg(e,r),s=this.getConnectionInfo(e.url,e.localeIdentifier);if(this.doAjaxPost("POST",s.url,n,this.generateMembers.bind(this),{dataSourceSettings:e,fieldName:t,action:"fetchSearchMembers"}),this.errorInfo)throw this.errorInfo}},f.prototype.generateMembers=function(e,t,i){for(var a,e=[].slice.call(e.querySelectorAll('Axis[name="Axis0"] Tuple')),r=i.fieldName,n={},s=0,o=e;s<o.length;s++){var l,d=o[s],p=d.querySelector("Member"),h=p.querySelector("MEMBER_TYPE").textContent,u=p.querySelector("UName").textContent,c=p.querySelector("Caption").textContent,p=p.querySelector("PARENT_UNIQUE_NAME")?p.querySelector("PARENT_UNIQUE_NAME").textContent:"",g={"data-fieldName":r,"data-memberId":u};""===p&&"1"===h?(n={hasChildren:!!d.querySelector("CHILDREN_CARDINALITY")&&"0"!==d.querySelector("CHILDREN_CARDINALITY").textContent,isSelected:!1,id:u,tag:u,name:c,caption:c,htmlAttributes:g},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[r].members[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1},this.fieldList[r].filterMembers.push(n),this.fieldList[r].childMembers.push(n)):"fetchSearchMembers"===i.action?(this.fieldList[r].currrentMembers[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1},this.fieldList[r].searchMembers.push(n),n.expanded=!0):this.calcChildMembers.push(n)):""!==p&&"1"===h?p===a&&"1"===h?(n={hasChildren:!!d.querySelector("CHILDREN_CARDINALITY")&&"0"!==d.querySelector("CHILDREN_CARDINALITY").textContent,id:u,name:c,isSelected:!1,caption:c,htmlAttributes:g,tag:u},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[r].filterMembers.push(n),this.fieldList[r].childMembers.push(n),this.fieldList[r].members[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1}):"fetchSearchMembers"===i.action?(n.expanded=!0,this.fieldList[r].searchMembers.push(n),this.fieldList[r].currrentMembers[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1}):this.calcChildMembers.push(n)):"fetchMembers"===i.action&&this.fieldList[r].members[u]||(l=!!i.loadLevelMembers&&this.fieldList[r].members[p].isSelected,n={hasChildren:!!d.querySelector("CHILDREN_CARDINALITY")&&"0"!==d.querySelector("CHILDREN_CARDINALITY").textContent,htmlAttributes:g,isSelected:!1,id:u,pid:p,name:c,caption:c,tag:u},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[r].isHierarchy=!1,this.fieldList[r].filterMembers.push(n),this.fieldList[r].childMembers.push(n),this.fieldList[r].members[u]={name:u,caption:c,parent:p,isNodeExpand:!1,isSelected:l}):"fetchSearchMembers"===i.action?(this.fieldList[r].searchMembers.push(n),n.expanded=!0,this.fieldList[r].currrentMembers[u]={name:u,caption:c,parent:p,isNodeExpand:!1,isSelected:!1}):this.calcChildMembers.push(n)):"2"===h&&(a=u)}},f.prototype.getFieldListItems=function(e,t,i){for(var a=[],r=0,n=[].slice.call(e.querySelectorAll("row"));r<n.length;r++){var s=n[r],o=0<[].slice.call(s.querySelectorAll("ALL_MEMBER")).length,l=s.querySelector("DIMENSION_UNIQUE_NAME").textContent,d=s.querySelector("HIERARCHY_UNIQUE_NAME").textContent,p=l===d&&"[measures]"!==l.toLowerCase()&&"[measures]"!==d.toLowerCase();a.push({pid:this.isMondrian||p?l+"~#^Dim":l,id:d,name:s.querySelector("HIERARCHY_CAPTION").textContent,caption:s.querySelector("HIERARCHY_CAPTION").textContent,tag:d,hasAllMember:o,allMember:o?s.querySelectorAll("ALL_MEMBER")[0].textContent:void 0,type:"string"})}this.fieldListObj={hierarchy:a,hierarchySuccess:e,measures:[]};e={catalog:i.dataSourceSettings.catalog,cube:i.dataSourceSettings.cube,url:i.dataSourceSettings.url,LCID:i.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_DIMENSIONS",roles:i.dataSourceSettings.roles};this.getTreeData(e,this.loadDimensionElements.bind(this),i)},f.prototype.loadCalculatedMemberElements=function(e){if(0<e.length){var t=this.fieldListData,i={hasChildren:!0,isSelected:!1,id:"[Calculated Members].[_0]",name:"[Calculated Members].[_0]",caption:"Calculated Members",spriteCssClass:"e-calcMemberGroupCDB "+z,tag:"[Calculated Members].[_0]",type:"string"};0<t.length&&"[measures]"===t[0].id.toLowerCase()&&t.splice(0,0,i);for(var a=0,r=e;a<r.length;a++){var n,s,o,l,d=r[a];this.fieldList[d.name]||(s=(-1<(n=d.formula).toLowerCase().indexOf("measure")?"[Measures].":d.hierarchyUniqueName+".")+"["+d.name+"]",l=this.dataFields[d.name]&&this.dataFields[d.name].caption?this.dataFields[d.name].caption:this.mappingFields[d.name]&&this.mappingFields[d.name].caption?this.mappingFields[d.name].caption:d.name,o=d.formatString,l={hasChildren:!1,isSelected:!1,id:d.name,pid:"[Calculated Members].[_0]",name:d.name,caption:l,spriteCssClass:"e-calc-member "+(-1<n.toLowerCase().indexOf("measure")?"e-calc-measure-icon":"e-calc-dimension-icon")+" "+z,tag:s,formula:n,formatString:o,aggregateType:void 0,type:"CalculatedField",filter:[],dateMember:[],sort:"Ascending",actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},isHierarchy:!0,isExcelFilter:!1,isCalculatedField:!0,allowDragAndDrop:this.dataFields[d.name]?this.dataFields[d.name].allowDragAndDrop:!this.mappingFields[d.name]||this.mappingFields[d.name].allowDragAndDrop,showFilterIcon:this.dataFields[d.name]?this.dataFields[d.name].showFilterIcon:!this.mappingFields[d.name]||this.mappingFields[d.name].showFilterIcon,showSortIcon:this.dataFields[d.name]?this.dataFields[d.name].showSortIcon:!this.mappingFields[d.name]||this.mappingFields[d.name].showSortIcon,showEditIcon:this.dataFields[d.name]?this.dataFields[d.name].showEditIcon:!this.mappingFields[d.name]||this.mappingFields[d.name].showEditIcon,showRemoveIcon:this.dataFields[d.name]?this.dataFields[d.name].showRemoveIcon:!this.mappingFields[d.name]||this.mappingFields[d.name].showRemoveIcon,showValueTypeIcon:this.dataFields[d.name]?this.dataFields[d.name].showValueTypeIcon:!this.mappingFields[d.name]||this.mappingFields[d.name].showValueTypeIcon,showSubTotals:this.dataFields[d.name]?this.dataFields[d.name].showSubTotals:!this.mappingFields[d.name]||this.mappingFields[d.name].showSubTotals,fieldType:-1<n.toLowerCase().indexOf("measure")?"Measure":"Dimension",parentHierarchy:-1<n.toLowerCase().indexOf("measure")?void 0:d.hierarchyUniqueName},t.push(l),this.fieldList[l.id]=l,this.updateMembersOrder(d.name))}}},f.prototype.loadDimensionElements=function(e,t,i){for(var a=[],r=[].slice.call(e.querySelectorAll("row")),n={},s=0,o=r;s<o.length;s++){var l=o[s],d=l.querySelector("DIMENSION_UNIQUE_NAME").textContent,p=l.querySelector("DEFAULT_HIERARCHY").textContent,h=l.querySelector("DIMENSION_CAPTION").textContent,p=d===p;0<=d.toLowerCase().indexOf("[measure")?n={hasChildren:!0,isSelected:!1,id:d,name:d,caption:h,spriteCssClass:"[measures]"===d.toLowerCase()?"e-measureGroupCDB-icon "+z:"e-dimensionCDB-icon "+z,tag:d,type:"string"}:Ue.isNullOrUndefined(r[0].querySelector("HIERARCHY_CAPTION"))&&a.push({hasChildren:!0,isSelected:!1,id:this.isMondrian||p?d+"~#^Dim":d,name:d,caption:h,spriteCssClass:"e-dimensionCDB-icon "+z,tag:d,defaultHierarchy:l.querySelector("DEFAULT_HIERARCHY").textContent,type:"string"})}a.splice(0,0,n),this.fieldListData=a;e={catalog:i.dataSourceSettings.catalog,cube:i.dataSourceSettings.cube,url:i.dataSourceSettings.url,LCID:i.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_SETS",roles:i.dataSourceSettings.roles};this.getTreeData(e,this.loadNamedSetElements.bind(this),i)},f.prototype.loadNamedSetElements=function(e,t,i){for(var a=(a=Ue.extend([],this.rows,null,!0)).concat(this.columns,this.filters),r=this.fieldListData,n=[],s=0,o=a;s<o.length;s++){var l=o[s];n.push(l.name)}for(var d=[],p=0,h=[].slice.call(e.querySelectorAll("row"));p<h.length;p++){var l=h[p],u=(0<=d.indexOf(l.querySelector("DIMENSIONS").textContent.split(".")[0])||(r.push({hasChildren:!0,isSelected:!1,pid:l.querySelector("DIMENSIONS").textContent.split(".")[0],id:l.querySelector("SET_DISPLAY_FOLDER").textContent+"_"+l.querySelector("DIMENSIONS").textContent.split(".")[0],name:l.querySelector("SET_DISPLAY_FOLDER").textContent,spriteCssClass:"e-folderCDB-icon "+z+" namedSets",caption:l.querySelector("SET_DISPLAY_FOLDER").textContent,type:"string"}),d.push(l.querySelector("DIMENSIONS").textContent.split(".")[0])),"["+l.querySelector("SET_NAME").textContent.trim()+"]"),c={hasChildren:!0,isNamedSets:!0,isSelected:0<=n.indexOf("["+l.querySelector("SET_NAME").textContent+"]"),pid:l.querySelector("SET_DISPLAY_FOLDER").textContent+"_"+l.querySelector("DIMENSIONS").textContent.split(".")[0],id:u,name:l.querySelector("SET_CAPTION").textContent,caption:this.dataFields[u]&&this.dataFields[u].caption?this.dataFields[u].caption:this.mappingFields[u]&&this.mappingFields[u].caption?this.mappingFields[u].caption:l.querySelector("SET_CAPTION").textContent,spriteCssClass:"e-namedSetCDB-icon "+z,tag:l.querySelector("EXPRESSION").textContent,type:"string",filter:[],dateMember:[],actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},isHierarchy:!0,isExcelFilter:!1,allowDragAndDrop:this.dataFields[u]?this.dataFields[u].allowDragAndDrop:!this.mappingFields[u]||this.mappingFields[u].allowDragAndDrop,showFilterIcon:this.dataFields[u]?this.dataFields[u].showFilterIcon:!this.mappingFields[u]||this.mappingFields[u].showFilterIcon,showSortIcon:this.dataFields[u]?this.dataFields[u].showSortIcon:!this.mappingFields[u]||this.mappingFields[u].showSortIcon,showEditIcon:this.dataFields[u]?this.dataFields[u].showEditIcon:!this.mappingFields[u]||this.mappingFields[u].showEditIcon,showRemoveIcon:this.dataFields[u]?this.dataFields[u].showRemoveIcon:!this.mappingFields[u]||this.mappingFields[u].showRemoveIcon,showValueTypeIcon:this.dataFields[u]?this.dataFields[u].showValueTypeIcon:!this.mappingFields[u]||this.mappingFields[u].showValueTypeIcon,showSubTotals:this.dataFields[u]?this.dataFields[u].showSubTotals:!this.mappingFields[u]||this.mappingFields[u].showSubTotals};r.push(c),this.fieldList[u]=c,this.updateMembersOrder(u)}i.hierarchy=this.fieldListData,i.hierarchySuccess=this.fieldListObj.hierarchySuccess,this.loadHierarchyElements(i)},f.prototype.loadHierarchyElements=function(e){for(var t=e.hierarchySuccess,i=e.hierarchy,a=[],r=0,n=Ue.extend([],this.rows,null,!0).concat(this.columns,this.filters);r<n.length;r++){var s=n[r];a.push(s.name)}for(var o=0,l=[].slice.call(t.querySelectorAll("row"));o<l.length;o++){for(var d=(s=l[o]).querySelector("DIMENSION_UNIQUE_NAME").textContent,p=s.querySelector("HIERARCHY_UNIQUE_NAME").textContent,h=0<[].slice.call(s.querySelectorAll("ALL_MEMBER")).length,u=void 0,c=(u=h?(c=s.querySelectorAll("ALL_MEMBER")[0].textContent.replace(/[&[\]']+/g,"").split("."))[c.length-1].trim():void 0,s.querySelector("HIERARCHY_DISPLAY_FOLDER")?s.querySelector("HIERARCHY_DISPLAY_FOLDER").textContent:""),g=[],m=0,S=i;m<S.length;m++)(y=S[m]).tag===d&&g.push(y);if(0<g.length){var f=d===p&&"[measures]"!==d.toLowerCase()&&"[measures]"!==p.toLowerCase();if("[measures]"!==d.toLowerCase()&&"[measures]"!==p.toLowerCase()){var v=d+(this.isMondrian||f?"~#^Dim":"");if(""!==c){for(var y,b=d+(this.isMondrian||f?"~#^Dim":"")+"_"+c,C=[],x=0,w=i;x<w.length;x++)(y=w[x]).tag===b&&y.pid===v&&C.push(y);0===C.length&&(f={hasChildren:!0,isSelected:!1,pid:d+(this.isMondrian||f?"~#^Dim":""),id:b,name:c,spriteCssClass:"e-folderCDB-icon "+z,tag:b,caption:c,type:"string"},i.push(f)),v=b}f={hasChildren:!s.querySelector("HIERARCHY_ORIGIN")||"2"!==s.querySelector("HIERARCHY_ORIGIN").textContent&&"6"!==s.querySelector("HIERARCHY_ORIGIN").textContent,isSelected:0<=a.indexOf(p),pid:v,id:p,name:s.querySelector("HIERARCHY_CAPTION").textContent,spriteCssClass:(!s.querySelector("HIERARCHY_ORIGIN")||"2"!==s.querySelector("HIERARCHY_ORIGIN").textContent&&"6"!==s.querySelector("HIERARCHY_ORIGIN").textContent?"e-hierarchyCDB-icon":"e-attributeCDB-icon")+" "+z,hasAllMember:h,allMember:u,tag:p,caption:this.dataFields[p]&&this.dataFields[p].caption?this.dataFields[p].caption:this.mappingFields[p]&&this.mappingFields[p].caption?this.mappingFields[p].caption:s.querySelector("HIERARCHY_CAPTION").textContent,type:"string",filter:[],dateMember:[],sort:this.enableSort?this.sortObject[p]||"Ascending":"None",actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},levels:[],levelCount:1,isHierarchy:!!s.querySelector("HIERARCHY_ORIGIN")&&("2"===s.querySelector("HIERARCHY_ORIGIN").textContent||"6"===s.querySelector("HIERARCHY_ORIGIN").textContent),isExcelFilter:!1,allowDragAndDrop:this.dataFields[p]?this.dataFields[p].allowDragAndDrop:!this.mappingFields[p]||this.mappingFields[p].allowDragAndDrop,showFilterIcon:this.dataFields[p]?this.dataFields[p].showFilterIcon:!this.mappingFields[p]||this.mappingFields[p].showFilterIcon,showSortIcon:this.dataFields[p]?this.dataFields[p].showSortIcon:!this.mappingFields[p]||this.mappingFields[p].showSortIcon,showEditIcon:this.dataFields[p]?this.dataFields[p].showEditIcon:!this.mappingFields[p]||this.mappingFields[p].showEditIcon,showRemoveIcon:this.dataFields[p]?this.dataFields[p].showRemoveIcon:!this.mappingFields[p]||this.mappingFields[p].showRemoveIcon,showValueTypeIcon:this.dataFields[p]?this.dataFields[p].showValueTypeIcon:!this.mappingFields[p]||this.mappingFields[p].showValueTypeIcon,showSubTotals:this.dataFields[p]?this.dataFields[p].showSubTotals:!this.mappingFields[p]||this.mappingFields[p].showSubTotals};i.push(f),this.fieldList[p]=f,this.updateMembersOrder(p)}}}t={catalog:e.dataSourceSettings.catalog,cube:e.dataSourceSettings.cube,url:e.dataSourceSettings.url,LCID:e.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_LEVELS",roles:e.dataSourceSettings.roles};this.getTreeData(t,this.loadLevelElements.bind(this),e)},f.prototype.updateMembersOrder=function(e){for(var t=0,i=this.sortSettings;t<i.length;t++){var a=i[t];if(e===a.name&&a.membersOrder){this.fieldList[e].membersOrder=a.membersOrder;break}}},f.prototype.loadLevelElements=function(e,t,i){for(var a=[],r=this.fieldListData,a=[],n=0,s=[].slice.call(e.querySelectorAll("row"));n<s.length;n++){var o,l,d,p=s[n];1!==parseInt(p.querySelector("LEVEL_TYPE").textContent,10)&&"[measures]"!==p.querySelector("HIERARCHY_UNIQUE_NAME").textContent.toLowerCase()&&(o=p.querySelector("HIERARCHY_UNIQUE_NAME").textContent,d=p.querySelector("LEVEL_UNIQUE_NAME").textContent,l=p.querySelector("LEVEL_CAPTION").textContent,d={hasChildren:!1,isChecked:!1,isSelected:this.fieldList[o].isSelected,pid:o,id:d,name:l,tag:d,spriteCssClass:"e-level-members e-hierarchy-level-"+parseInt(p.querySelector("LEVEL_NUMBER").textContent,10)+"-icon "+z,caption:l,type:"string"},a.push(d),this.fieldList[o]&&this.fieldList[o].spriteCssClass&&-1===this.fieldList[o].spriteCssClass.indexOf("e-attributeCDB-icon")?(this.fieldList[o].levels.push(d),this.fieldList[o].isHierarchy=!1):this.fieldList[o].isHierarchy=!0)}this.fieldListData=r=r.concat(a);e={catalog:i.dataSourceSettings.catalog,cube:i.dataSourceSettings.cube,url:i.dataSourceSettings.url,LCID:i.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_MEASURES",roles:i.dataSourceSettings.roles};this.getTreeData(e,this.loadMeasureElements.bind(this),i)},f.prototype.loadMeasureElements=function(e,t,i){for(var a,r,n=this.fieldListData,s=[],o=[],l=0,d=Ue.extend([],this.values,null,!0);l<d.length;l++){var p=d[l];o.push(p.name)}"en-US"!==this.locale&&(r={catalog:i.dataSourceSettings.catalog,cube:i.dataSourceSettings.cube,url:i.dataSourceSettings.url,LCID:i.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_MEASUREGROUPS",roles:i.dataSourceSettings.roles},this.getTreeData(r,this.loadMeasureGroups.bind(this),i));for(var h=0,u=[].slice.call(e.querySelectorAll("row"));h<u.length;h++){var p=u[h],c=Ue.isNullOrUndefined(p.querySelector("MEASUREGROUP_NAME"))?"":p.querySelector("MEASUREGROUP_NAME").textContent,g=p.querySelector("MEASURE_UNIQUE_NAME").textContent,m=p.querySelector("DEFAULT_FORMAT_STRING")?p.querySelector("DEFAULT_FORMAT_STRING").textContent:"#,#",S=p.querySelector("MEASURE_AGGREGATOR")?p.querySelector("MEASURE_AGGREGATOR").textContent:"1";if(!(0<=s.indexOf(c))){if("en-US"!==this.locale){for(var f=[],v=0,y=this.fieldListObj.measuresGroups;v<y.length;v++){var b=y[v];b.querySelector("MEASUREGROUP_NAME").textContent===c&&f.push(b)}a=0<f.length?f[0].querySelector("MEASUREGROUP_CAPTION").textContent:c}else a=c;""!==c&&(n.push({hasChildren:!0,isChecked:!1,isSelected:!1,pid:"[Measures]",id:c,name:a,spriteCssClass:"e-measureCDB e-folderCDB-icon "+z,tag:c,caption:a,aggregateType:this.getAggregateType(c,S),type:"string"}),s.push(c))}S={hasChildren:!1,isSelected:0<=o.indexOf(g),pid:""===c?"[Measures]":c,id:g,name:p.querySelector("MEASURE_CAPTION").textContent,spriteCssClass:"e-measure-icon "+z,tag:g,caption:this.dataFields[g]&&this.dataFields[g].caption?this.dataFields[g].caption:this.mappingFields[g]&&this.mappingFields[g].caption?this.mappingFields[g].caption:p.querySelector("MEASURE_CAPTION").textContent,aggregateType:this.getAggregateType(g,S),type:"number",filter:[],actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},formatString:m,allowDragAndDrop:this.dataFields[g]?this.dataFields[g].allowDragAndDrop:!this.mappingFields[g]||this.mappingFields[g].allowDragAndDrop,showFilterIcon:this.dataFields[g]?this.dataFields[g].showFilterIcon:!this.mappingFields[g]||this.mappingFields[g].showFilterIcon,showSortIcon:this.dataFields[g]?this.dataFields[g].showSortIcon:!this.mappingFields[g]||this.mappingFields[g].showSortIcon,showEditIcon:this.dataFields[g]?this.dataFields[g].showEditIcon:!this.mappingFields[g]||this.mappingFields[g].showEditIcon,showRemoveIcon:this.dataFields[g]?this.dataFields[g].showRemoveIcon:!this.mappingFields[g]||this.mappingFields[g].showRemoveIcon,showValueTypeIcon:this.dataFields[g]?this.dataFields[g].showValueTypeIcon:!this.mappingFields[g]||this.mappingFields[g].showValueTypeIcon,showSubTotals:this.dataFields[g]?this.dataFields[g].showSubTotals:!this.mappingFields[g]||this.mappingFields[g].showSubTotals};n.push(S),this.fieldList[g]=S,0<=o.indexOf(g)&&o.splice(o.indexOf(g),1)}this.measureReportItems=o},f.prototype.loadMeasureGroups=function(e){Ue.isNullOrUndefined(this.fieldListObj)&&(this.fieldListObj={}),this.fieldListObj.measuresGroups=[].slice.call(e.querySelectorAll("row"))},f.prototype.doAjaxPost=function(e,t,i,a,r){var n=this;new Ue.Ajax({mode:!1,contentType:"text/xml",url:t,data:i,dataType:"xml",type:e,beforeSend:this.beforeSend.bind(this),onSuccess:function(e,t){var e=(new DOMParser).parseFromString(e,"text/xml"),i=e.querySelector("Body");i.querySelector("OlapInfo")||i.querySelector("DiscoverResponse")||(i.querySelector("Fault")&&i.querySelector("Fault").querySelector("faultstring")?n.errorInfo=i.querySelector("Fault").querySelector("faultstring").innerHTML:i.querySelector("return")&&i.querySelector("return").querySelector("Error")&&(n.errorInfo=i.querySelector("return").querySelector("Error").getAttribute("Description"))),a(e,t,r)},onFailure:function(e){n.errorInfo=e}}).send()},f.prototype.beforeSend=function(e){this.dataSourceSettings.authentication.userName&&this.dataSourceSettings.authentication.password&&e.httpRequest.setRequestHeader("Authorization","Basic "+btoa(this.dataSourceSettings.authentication.userName+":"+this.dataSourceSettings.authentication.password))},f.prototype.getSoapMsg=function(e,t){var i=this.getConnectionInfo(e.url,e.localeIdentifier);return this.isMondrian?'<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><SOAP-ENV:Body><Execute xmlns="urn:schemas-microsoft-com:xml-analysis"><Command><Statement><![CDATA['+t+"]]></Statement></Command><Properties><PropertyList><DataSourceInfo></DataSourceInfo><Catalog>"+e.catalog+"</Catalog><AxisFormat>TupleFormat</AxisFormat><Content>Data</Content><Format>Multidimensional</Format></PropertyList></Properties></Execute></SOAP-ENV:Body></SOAP-ENV:Envelope>":'<Envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/"> <Header></Header> <Body> <Execute xmlns="urn:schemas-microsoft-com:xml-analysis"> <Command> <Statement> '+t+" </Statement> </Command> <Properties> <PropertyList> <Catalog>"+e.catalog+"</Catalog> <LocaleIdentifier>"+i.LCID+"</LocaleIdentifier>"+(e.roles?"<Roles>"+e.roles+"</Roles>":"")+"</PropertyList> </Properties> </Execute> </Body> </Envelope>"},f.prototype.getConnectionInfo=function(e,t){var i={url:"",LCID:Ue.isNullOrUndefined(t)?"1033":t.toString()};if(""!==e)for(var a=0,r=e.split(";");a<r.length;a++){var n=r[a];n.toLowerCase().indexOf("locale")<0&&0===i.url.length?i.url=n:0<=n.toLowerCase().indexOf("locale")&&(i.LCID=n.replace(/ /g,"").split("=")[1])}return i},f.prototype.getMDXQuery=function(e){return hp.getCellSets(e,this,!0,void 0,!0),this.mdxQuery};var cp=f;function f(){this.fieldList={},this.columnCount=0,this.rowCount=0,this.colFirstLvl=0,this.rowFirstLvl=0,this.pageColStartPos=0,this.enableSort=!1,this.enableValueSorting=!1,this.dataFields={},this.formatFields={},this.filterMembers={},this.drilledSets={},this.isExporting=!1,this.aggregatedValueMatrix=[],this.mappingFields={},this.formatRegex=/^(?:[ncpae])(?:([0-9]|1[0-9]|20))?$/i,this.clonedValTuple=[],this.clonedColumnTuple=[],this.clonedRowTuple=[],this.pivotValues=[],this.valueContent=[],this.headerContent=[],this.rowStartPos=0,this.pageRowStartPos=0,this.tupColumnInfo=[],this.tupRowInfo=[],this.gridJSON="",this.namedSetsPosition={},this.colDepth=0,this.totalCollection=[],this.parentObjCollection={},this.curDrillEndPos=-1,this.headerGrouping={},this.lastLevel=[],this.showRowSubTotals=!0,this.showColumnSubTotals=!0,this.hideRowTotalsObject={},this.hideColumnTotalsObject={},this.sortObject={},this.isColDrill=!1}mp.prototype.drawHeader=function(e,t){var i=t.pageSettings.size,e=e.header,a=new j.PointF(0,e&&e.fromTop?e.fromTop:0),i=new j.SizeF(i.width-80,e&&e.height?.75*e.height:50),a=new j.RectangleF(a,i);t.template.top=this.drawPageTemplate(new j.PdfPageTemplateElement(a),e)},mp.prototype.drawFooter=function(e,t){var i=t.pageSettings.size,e=e.footer,a=new j.PointF(0,i.width-80-(e&&e.fromBottom?.75*e.fromBottom:0)),i=new j.SizeF(i.width-80,e&&e.height?.75*e.height:50),a=new j.RectangleF(a,i);t.template.bottom=this.drawPageTemplate(new j.PdfPageTemplateElement(a),e)},mp.prototype.drawPageTemplate=function(e,t){for(var i=0,a=t.contents;i<a.length;i++){var r=a[i];switch(this.processContentValidation(r),r.type){case"Text":if(""===r.value||Ue.isNullOrUndefined(r.value)||"string"!=typeof r.value)throw new Error("please enter the valid input value in text content...");this.drawText(e,r);break;case"PageNumber":this.drawPageNumber(e,r);break;case"Image":if(Ue.isNullOrUndefined(r.src)||""===r.src)throw new Error("please enter the valid base64 string in image content...");this.drawImage(e,r);break;case"Line":this.drawLine(e,r)}}return e},mp.prototype.processContentValidation=function(e){if(Ue.isNullOrUndefined(e.type))throw new Error("please set valid content type...");if("Line"===e.type){if(Ue.isNullOrUndefined(e.points))throw new Error("please enter valid points in "+e.type+" content...");if(Ue.isNullOrUndefined(e.points.x1)||"number"!=typeof e.points.x1)throw new Error("please enter valid x1 co-ordinate in "+e.type+" points...");if(Ue.isNullOrUndefined(e.points.y1)||"number"!=typeof e.points.y1)throw new Error("please enter valid y1 co-ordinate in "+e.type+" points...");if(Ue.isNullOrUndefined(e.points.x2)||"number"!=typeof e.points.x2)throw new Error("please enter valid x2 co-ordinate in "+e.type+" points...");if(Ue.isNullOrUndefined(e.points.y2)||"number"!=typeof e.points.y2)throw new Error("please enter valid y2 co-ordinate in "+e.type+" points...")}else{if(Ue.isNullOrUndefined(e.position))throw new Error("please enter valid position in "+e.type+" content...");if(Ue.isNullOrUndefined(e.position.x)||"number"!=typeof e.position.x)throw new Error("please enter valid x co-ordinate in "+e.type+" position...");if(Ue.isNullOrUndefined(e.position.y)||"number"!=typeof e.position.y)throw new Error("please enter valid y co-ordinate in "+e.type+" position...")}},mp.prototype.drawText=function(e,t){var i=this.getFontFromContent(t),a=this.getBrushFromContent(t),r=null,n=(Ue.isNullOrUndefined(t.style)||Ue.isNullOrUndefined(t.style.textPenColor)||(n=this.hexDecToRgb(t.style.textPenColor),r=new j.PdfPen(new j.PdfColor(n.r,n.g,n.b))),null==a&&null==r&&(a=new j.PdfSolidBrush(new j.PdfColor(0,0,0))),t.value.toString()),s=.75*t.position.x,o=.75*t.position.y,l=new j.PdfStringFormat,t=(Ue.isNullOrUndefined(t.stringFormat)||(l=t.stringFormat),this.setContentFormat(t,l));null===t||Ue.isNullOrUndefined(t.format)||Ue.isNullOrUndefined(t.size)?e.graphics.drawString(n,i,r,a,s,o,l):e.graphics.drawString(n,i,r,a,s,o,t.size.width,t.size.height,t.format)},mp.prototype.drawPageNumber=function(e,t){var i,a,r,n=this.getFontFromContent(t),s=null,o=(s=Ue.isNullOrUndefined(t.style)||Ue.isNullOrUndefined(t.style.textBrushColor)?new j.PdfSolidBrush(new j.PdfColor(0,0,0)):(o=this.hexDecToRgb(t.style.textBrushColor),new j.PdfSolidBrush(new j.PdfColor(o.r,o.g,o.b))),new j.PdfPageNumberField(n,s)),o=(o.numberStyle=this.getPageNumberStyle(t.pageNumberType),r=Ue.isNullOrUndefined(t.format)?new j.PdfCompositeField(n,s,a="{0}",o):(r="$current",-1!==t.format.indexOf(l="$total")&&-1!==t.format.indexOf(r)?((i=new j.PdfPageCountField(n)).numberStyle=this.getPageNumberStyle(t.pageNumberType),a=t.format.indexOf(l)>t.format.indexOf(r)?(a=t.format.replace(r,"0")).replace(l,"1"):(a=t.format.replace(r,"1")).replace(l,"0"),new j.PdfCompositeField(n,s,a,o,i)):-1!==t.format.indexOf(r)&&-1===t.format.indexOf(l)?(a=t.format.replace(r,"0"),new j.PdfCompositeField(n,s,a,o)):(i=new j.PdfPageCountField(n),a=t.format.replace(l,"0"),new j.PdfCompositeField(n,s,a,i))),.75*t.position.x),l=.75*t.position.y,n=this.setContentFormat(t,r.stringFormat);null===n||Ue.isNullOrUndefined(n.format)||Ue.isNullOrUndefined(n.size)||(r.stringFormat=n.format,r.bounds=new j.RectangleF(o,l,n.size.width,n.size.height)),r.draw(e.graphics,o,l)},mp.prototype.drawImage=function(e,t){var i=.75*t.position.x,a=.75*t.position.y,r=Ue.isNullOrUndefined(t.size)||Ue.isNullOrUndefined(t.size.width)?void 0:.75*t.size.width,n=Ue.isNullOrUndefined(t.size)||Ue.isNullOrUndefined(t.size.height)?void 0:.75*t.size.height,t=new j.PdfBitmap(t.src);Ue.isNullOrUndefined(r)?e.graphics.drawImage(t,i,a):e.graphics.drawImage(t,i,a,r,n)},mp.prototype.drawLine=function(e,t){var i=.75*t.points.x1,a=.75*t.points.y1,r=.75*t.points.x2,n=.75*t.points.y2,s=this.getPenFromContent(t);Ue.isNullOrUndefined(t.style)||(Ue.isNullOrUndefined(t.style.penSize)||"number"!=typeof t.style.penSize||(s.width=.75*t.style.penSize),s.dashStyle=this.getDashStyle(t.style.dashStyle)),e.graphics.drawLine(s,i,a,r,n)},mp.prototype.getFontFromContent=function(e){var t=Ue.isNullOrUndefined(e.font)||Ue.isNullOrUndefined(e.font.fontSize)?Ue.isNullOrUndefined(e.style)||Ue.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize:.75*e.font.fontSize,i=Ue.isNullOrUndefined(e.font)||Ue.isNullOrUndefined(e.font.pdfFontFamily)?j.PdfFontFamily.TimesRoman:e.font.pdfFontFamily,a=j.PdfFontStyle.Regular;return Ue.isNullOrUndefined(e.font)||Ue.isNullOrUndefined(e.font.bold)||(a|=j.PdfFontStyle.Bold),Ue.isNullOrUndefined(e.font)||Ue.isNullOrUndefined(e.font.italic)||(a|=j.PdfFontStyle.Italic),Ue.isNullOrUndefined(e.font)||Ue.isNullOrUndefined(e.font.underline)||(a|=j.PdfFontStyle.Underline),Ue.isNullOrUndefined(e.font)||Ue.isNullOrUndefined(e.font.strikeout)||(a|=j.PdfFontStyle.Strikeout),new j.PdfStandardFont(i,t,a)},mp.prototype.getPenFromContent=function(e){var t=new j.PdfPen(new j.PdfColor(0,0,0));return Ue.isNullOrUndefined(e.style)||null===e.style||Ue.isNullOrUndefined(e.style.penColor)||(e=this.hexDecToRgb(e.style.penColor),t=new j.PdfPen(new j.PdfColor(e.r,e.g,e.b))),t},mp.prototype.getBrushFromContent=function(e){var t=null;return Ue.isNullOrUndefined(e.style)||Ue.isNullOrUndefined(e.style.textBrushColor)||(e=this.hexDecToRgb(e.style.textBrushColor),t=new j.PdfSolidBrush(new j.PdfColor(e.r,e.g,e.b))),t},mp.prototype.setContentFormat=function(e,t){if(Ue.isNullOrUndefined(e.size))return null;var i=.75*e.size.width,a=.75*e.size.height;if(t=new j.PdfStringFormat(j.PdfTextAlignment.Left,j.PdfVerticalAlignment.Middle),!Ue.isNullOrUndefined(e.style)&&!Ue.isNullOrUndefined(e.style.hAlign))switch(e.style.hAlign){case"Right":t.alignment=j.PdfTextAlignment.Right;break;case"Center":t.alignment=j.PdfTextAlignment.Center;break;case"Justify":t.alignment=j.PdfTextAlignment.Justify}if(!Ue.isNullOrUndefined(e.style)&&!Ue.isNullOrUndefined(e.style.vAlign))switch(e.style.vAlign){case"Bottom":t.lineAlignment=j.PdfVerticalAlignment.Bottom;break;case"Top":t.lineAlignment=j.PdfVerticalAlignment.Top}return{format:t,size:new j.SizeF(i,a)}},mp.prototype.getPageNumberStyle=function(e){switch(e){case"LowerLatin":return 2;case"LowerRoman":return 3;case"UpperLatin":return 4;case"UpperRoman":return 5;default:return 1}},mp.prototype.getDashStyle=function(e){switch(e){case"Dash":return 1;case"Dot":return 2;case"DashDot":return 3;case"DashDotDot":return 4;default:return 0}},mp.prototype.hexDecToRgb=function(e){if(null===e||""===e||7!==e.length)throw new Error("please set valid hex value for color..");e=e.substring(1);e=parseInt(e,16);return{r:e>>16&255,g:e>>8&255,b:255&e}};var gp=mp;function mp(){}fp.prototype.getModuleName=function(){return"chartExport"},fp.prototype.pdfChartExport=function(i,a,r,n){var s=this,e=[this.parent.chart],e=this.getChartInfo(e),o=e.width,l=e.height,d=this.parent.chart.svgObject,p=(this.parent.chart.enableCanvas||(d=Ue.createElement("canvas",{id:"ej2-canvas",attrs:{width:o.toString(),height:l.toString()}})),window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(e.svg)],{type:"image/svg+xml"}))),h=new Image,u=d.getContext("2d");return h.src=p,new Promise(function(t){h.onload=function(){var e=Ue.isNullOrUndefined(a)?new j.PdfDocument:a;u.drawImage(h,0,0),window.URL.revokeObjectURL(p),s.exportPdf(d,e,r,n,o,l,i),t(e)}})},fp.prototype.getChartInfo=function(e,a){var r,n=0,s=0,o=this.parent.chart.enableCanvas,l=new F.SvgRenderer("").createSvg({id:"Svg_Export_Element",width:200,height:200});return e.map(function(e){var t=e.svgObject.cloneNode(!0),i=e.renderer.createGroup({style:Ue.isNullOrUndefined(a)||a?"transform: translateY("+s+"px)":"transform: translateX("+n+"px)"});"transparent"===(r=t.childNodes[0]?t.childNodes[0].getAttribute("fill"):"transparent")&&(r=-1<e.theme.indexOf("Dark")||"HighContrast"===e.theme?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)"),o||i.appendChild(t),n=e.availableSize.width,s=e.availableSize.height,o||l.appendChild(i)}),o||(l.setAttribute("width",n+""),l.setAttribute("height",s+""),l.setAttribute("style","background-color: "+r+";")),{width:n,height:s,svg:l}},fp.prototype.exportPdf=function(e,t,i,a,r,n,s){var o,l=t.sections.add(),d=t.pageSettings.width,p=t.pageSettings.height,h=t.pageSettings.margins,r=r+h.left+h.right,h=(t.pageSettings.size=new j.SizeF(r,p),this.exportProperties.fileName||(Ue.isNullOrUndefined(s)||Ue.isNullOrUndefined(s.fileName)?"default":s.fileName)),p=(this.exportProperties.width||this.exportProperties.height?(t.pageSettings.orientation=this.exportProperties.width>this.exportProperties.height||!this.exportProperties.height&&this.exportProperties.width>p||!this.exportProperties.width&&d>this.exportProperties.height?j.PdfPageOrientation.Landscape:j.PdfPageOrientation.Portrait,t.pageSettings.size=new j.SizeF(this.exportProperties.width||d,this.exportProperties.height||p)):(t.pageSettings.orientation=0===this.exportProperties.orientation||this.exportProperties.orientation?this.exportProperties.orientation:Ue.isNullOrUndefined(s)||Ue.isNullOrUndefined(s.pageOrientation)||"Landscape"===s.pageOrientation?j.PdfPageOrientation.Landscape:j.PdfPageOrientation.Portrait,Ue.isNullOrUndefined(s)||Ue.isNullOrUndefined(s.pageSize)||(t.pageSettings.size=Ce.getPageSize(s.pageSize))),Ue.isNullOrUndefined(this.exportProperties.pdfMargins)||((d=t.pageSettings.margins).top=(Ue.isNullOrUndefined(this.exportProperties.pdfMargins.top)?d:this.exportProperties.pdfMargins).top,d.bottom=(Ue.isNullOrUndefined(this.exportProperties.pdfMargins.bottom)?d:this.exportProperties.pdfMargins).bottom,d.left=(Ue.isNullOrUndefined(this.exportProperties.pdfMargins.left)?d:this.exportProperties.pdfMargins).left,d.right=(Ue.isNullOrUndefined(this.exportProperties.pdfMargins.right)?d:this.exportProperties.pdfMargins).right),l.setPageSettings(t.pageSettings),t.pageSettings.height),d=(d=e.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream")).slice(d.indexOf(",")+1),e=new j.PdfBitmap(d),d=l.pages.add(),l=(Ue.isNullOrUndefined(s)||Ue.isNullOrUndefined(s.header)||this.pdfExportHelper.drawHeader(s,t),Ue.isNullOrUndefined(s)||Ue.isNullOrUndefined(s.footer)||this.pdfExportHelper.drawFooter(s,t),d.graphics.drawImage(e,0,0,p<n||this.exportProperties.width||t.pageSettings.size?d.getClientSize().width:r,p<n?d.getClientSize().height:n),a||i?a&&(o=t.save()):(t.save(h+".pdf"),t.destroy()),{type:"PDF",promise:a?o:null});return this.parent.trigger(X,l),new Promise(function(){})},fp.prototype.destroy=function(){this.exportProperties&&(this.exportProperties=null),this.pdfExportHelper&&(this.pdfExportHelper=null)};var Sp=fp;function fp(e){this.parent=e,this.pdfExportHelper=new gp}vp=function(e,t){return(vp=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var vp,yp,Ml=function(e,t){function i(){this.constructor=e}vp(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},g=function(e,t,i,a){var r,n=arguments.length,s=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(n<3?r(s):3<n?r(t,i,s):r(t,i))||s);return 3<n&&s&&Object.defineProperty(t,i,s),s},Zl=(yp=Ue.ChildProperty,Ml(bp,yp),g([Ue.Property(!0)],bp.prototype,"showFilterIcon",void 0),g([Ue.Property(!0)],bp.prototype,"showSortIcon",void 0),g([Ue.Property(!0)],bp.prototype,"showRemoveIcon",void 0),g([Ue.Property(!0)],bp.prototype,"showValueTypeIcon",void 0),g([Ue.Property("Both")],bp.prototype,"displayMode",void 0),g([Ue.Property(!0)],bp.prototype,"allowDragAndDrop",void 0),g([Ue.Property(!1)],bp.prototype,"showFieldsPanel",void 0),bp);function bp(){return null!==yp&&yp.apply(this,arguments)||this}Cp=Ue.ChildProperty,Ml(xp,Cp),g([Ue.Property(!1)],xp.prototype,"allowAdding",void 0),g([Ue.Property(!1)],xp.prototype,"allowEditing",void 0),g([Ue.Property(!1)],xp.prototype,"allowDeleting",void 0),g([Ue.Property(!1)],xp.prototype,"allowCommandColumns",void 0),g([Ue.Property(!1)],xp.prototype,"allowInlineEditing",void 0),g([Ue.Property("Normal")],xp.prototype,"mode",void 0),g([Ue.Property(!0)],xp.prototype,"allowEditOnDblClick",void 0),g([Ue.Property(!0)],xp.prototype,"showConfirmDialog",void 0),g([Ue.Property(!1)],xp.prototype,"showDeleteConfirmDialog",void 0);var Cp,td=xp;function xp(){return null!==Cp&&Cp.apply(this,arguments)||this}wp=Ue.ChildProperty,Ml(Tp,wp),g([Ue.Property()],Tp.prototype,"measure",void 0),g([Ue.Property()],Tp.prototype,"label",void 0),g([Ue.Property("NotEquals")],Tp.prototype,"conditions",void 0),g([Ue.Property()],Tp.prototype,"value1",void 0),g([Ue.Property()],Tp.prototype,"value2",void 0);var wp,rd=Tp;function Tp(){return null!==wp&&wp.apply(this,arguments)||this}Mp=Ue.ChildProperty,Ml(Dp,Mp),g([Ue.Property(!1)],Dp.prototype,"showHyperlink",void 0),g([Ue.Property(!1)],Dp.prototype,"showRowHeaderHyperlink",void 0),g([Ue.Property(!1)],Dp.prototype,"showColumnHeaderHyperlink",void 0),g([Ue.Property(!1)],Dp.prototype,"showValueCellHyperlink",void 0),g([Ue.Property(!1)],Dp.prototype,"showSummaryCellHyperlink",void 0),g([Ue.Collection([],rd)],Dp.prototype,"conditionalSettings",void 0),g([Ue.Property()],Dp.prototype,"headerText",void 0),g([Ue.Property("")],Dp.prototype,"cssClass",void 0);var Mp,od=Dp;function Dp(){return null!==Mp&&Mp.apply(this,arguments)||this}Op=Ue.ChildProperty,Ml(Pp,Op),g([Ue.Property(5)],Pp.prototype,"columnPageSize",void 0),g([Ue.Property(5)],Pp.prototype,"rowPageSize",void 0),g([Ue.Property(1)],Pp.prototype,"currentColumnPage",void 0),g([Ue.Property(1)],Pp.prototype,"currentRowPage",void 0);var Op,Md=Pp;function Pp(){return null!==Op&&Op.apply(this,arguments)||this}Np=Ue.ChildProperty,Ml(Ep,Np),g([Ue.Property("Bottom")],Ep.prototype,"position",void 0),g([Ue.Property(!1)],Ep.prototype,"isInversed",void 0),g([Ue.Property(!0)],Ep.prototype,"showRowPager",void 0),g([Ue.Property(!0)],Ep.prototype,"showColumnPager",void 0),g([Ue.Property(!0)],Ep.prototype,"showRowPageSize",void 0),g([Ue.Property(!0)],Ep.prototype,"showColumnPageSize",void 0),g([Ue.Property([10,50,100,200])],Ep.prototype,"rowPageSizes",void 0),g([Ue.Property([5,10,20,50,100])],Ep.prototype,"columnPageSizes",void 0),g([Ue.Property(!1)],Ep.prototype,"enableCompactView",void 0),g([Ue.Property()],Ep.prototype,"template",void 0);var Np,Sd=Ep;function Ep(){return null!==Np&&Np.apply(this,arguments)||this}Fp=Ue.ChildProperty,Ml(Ip,Fp),g([Ue.Property("Table")],Ip.prototype,"view",void 0),g([Ue.Property("Table")],Ip.prototype,"primary",void 0);var Fp,Pd=Ip;function Ip(){return null!==Fp&&Fp.apply(this,arguments)||this}Lp=Ue.ChildProperty,Ml(Ap,Lp),g([Ue.Property(!1)],Ap.prototype,"allowSinglePage",void 0);var Lp,xd=Ap;function Ap(){return null!==Lp&&Lp.apply(this,arguments)||this}Rp=Ue.Component,Ml(v,Rp),v.prototype.requiredModules=function(){var e=[];return this.showGroupingBar&&e.push({args:[this],member:"groupingBar"}),this.allowConditionalFormatting&&e.push({args:[this],member:"conditionalFormatting"}),this.allowNumberFormatting&&e.push({args:[this],member:"numberFormatting"}),this.allowCalculatedField&&e.push({args:[this],member:"calculatedField"}),this.showToolbar&&(0<this.toolbar.length||this.toolbarTemplate)&&e.push({args:[this],member:"toolbar"}),this.showFieldList&&e.push({args:[this],member:"fieldList"}),this.allowExcelExport&&e.push({args:[this],member:"excelExport"}),this.allowPdfExport&&e.push({args:[this],member:"pdfExport"}),this.enableVirtualization&&e.push({args:[this],member:"virtualscroll"}),this.allowGrouping&&e.push({args:[this],member:"grouping"}),(this.allowDrillThrough||this.editSettings&&this.editSettings.allowEditing)&&e.push({args:[this],member:"drillThrough"}),this.enablePaging&&e.push({args:[this],member:"pager"}),e},v.prototype.preRender=function(){this.dataSourceSettings&&"SSAS"===this.dataSourceSettings.providerType?(this.dataType="olap",this.olapEngineModule=new cp):(this.dataType="pivot",this.engineModule=new A),this.isAdaptive=Ue.Browser.isDevice,Ue.Browser.isIE||"edge"===Ue.Browser.info.name?this.scrollerBrowserLimit=15e5:"chrome"===Ue.Browser.info.name&&(this.scrollerBrowserLimit=15e6),this.isTouchMode=!!Ue.closest(this.element,"e-bigger"),this.initProperties(),this.renderToolTip(),this.keyboardModule=new Wo(this),this.contextMenuModule=new Yo(this),this.globalize=new Ue.Internationalization(this.locale),(this.showFieldList||this.showGroupingBar||this.allowNumberFormatting||this.allowCalculatedField||this.toolbar&&this.showToolbar||this.allowGrouping||this.gridSettings.contextMenuItems||this.allowDrillThrough)&&(this.commonModule=new Js(this)),!this.allowPdfExport||"Both"!==this.displayOption.view&&"Chart"!==this.displayOption.view||(this.chartExportModule=new Sp(this)),this.defaultLocale={applyToGrandTotal:"Apply to Grand Total",grandTotal:"Grand Total",total:"Total",value:"Value",noValue:"No value",row:"Row",column:"Column",collapse:"Collapse",expand:"Expand",rowAxisPrompt:"Drop row here",columnAxisPrompt:"Drop column here",valueAxisPrompt:"Drop value here",filterAxisPrompt:"Drop filter here",filter:"Filter",filtered:"Filtered",sort:"Sort",filters:"Filters",rows:"Rows",columns:"Columns",values:"Values",close:"Close",cancel:"Cancel",delete:"Delete",CalculatedField:"Calculated Field",createCalculatedField:"Create Calculated Field",fieldName:"Enter the field name",error:"Error",invalidFormula:"Invalid formula.",dropText:'Example: ("Sum(Order_Count)" + "Sum(In_Stock)") * 250',dropTextMobile:"Add fields and edit formula here.",dropAction:"Calculated field cannot be place in any other region except value axis.",alert:"Alert",warning:"Warning",ok:"OK",search:"Search",drag:"Drag",remove:"Remove",allFields:"All Fields",formula:"Formula",addToRow:"Add to Row",addToColumn:"Add to Column",addToValue:"Add to Value",addToFilter:"Add to Filter",emptyData:"No records to display",fieldExist:"A field already exists in this name. Please enter a different name.",confirmText:"A calculation field already exists in this name. Do you want to replace it?",noMatches:"No matches",format:"Summaries values by",edit:"Edit",clear:"Clear",sortAscending:"Sort ascending order",sortDescending:"Sort descending order",sortNone:"Sort data order",clearCalculatedField:"Clear edited field info",editCalculatedField:"Edit calculated field",formulaField:"Drag and drop fields to formula",dragField:"Drag field to formula",clearFilter:"Clear",by:"by",all:"All",multipleItems:"Multiple items",member:"Member",label:"Label",date:"Date",enterValue:"Enter value",chooseDate:"Enter date",Before:"Before",BeforeOrEqualTo:"Before Or Equal To",After:"After",AfterOrEqualTo:"After Or Equal To",labelTextContent:"Show the items for which the label",dateTextContent:"Show the items for which the date",valueTextContent:"Show the items for which",Equals:"Equals",DoesNotEquals:"Does Not Equal",BeginWith:"Begins With",DoesNotBeginWith:"Does Not Begin With",EndsWith:"Ends With",DoesNotEndsWith:"Does Not End With",Contains:"Contains",DoesNotContains:"Does Not Contain",GreaterThan:"Greater Than",GreaterThanOrEqualTo:"Greater Than Or Equal To",LessThan:"Less Than",LessThanOrEqualTo:"Less Than Or Equal To",Between:"Between",NotBetween:"Not Between",And:"and",Sum:"Sum",Count:"Count",DistinctCount:"Distinct Count",Product:"Product",Avg:"Avg",Median:"Median",Min:"Min",SampleVar:"Sample Var",PopulationVar:"Population Var",RunningTotals:"Running Totals",Max:"Max",Index:"Index",SampleStDev:"Sample StDev",PopulationStDev:"Population StDev",PercentageOfRowTotal:"% of Row Total",PercentageOfParentTotal:"% of Parent Total",PercentageOfParentColumnTotal:"% of Parent Column Total",PercentageOfParentRowTotal:"% of Parent Row Total",DifferenceFrom:"Difference From",PercentageOfDifferenceFrom:"% of Difference From",PercentageOfGrandTotal:"% of Grand Total",PercentageOfColumnTotal:"% of Column Total",MoreOption:"More...",NotEquals:"Not Equals",AllValues:"All Values",conditionalFormatting:"Conditional Formatting",apply:"Apply",condition:"Add Condition",formatLabel:"Format",valueFieldSettings:"Value field settings",baseField:"Base field",baseItem:"Base item",summarizeValuesBy:"Summarize values by",sourceName:"Field name :",sourceCaption:"Field caption",example:"e.g:",editorDataLimitMsg:" more items. Search to refine further.",details:"Details",manageRecords:"Manage Records",Years:"Years",Quarters:"Quarters",Months:"Months",Days:"Days",Hours:"Hours",Minutes:"Minutes",Seconds:"Seconds",save:"Save a report",new:"Create a new report",load:"Load",saveAs:"Save as current report",rename:"Rename a current report",deleteReport:"Delete a current report",export:"Export",subTotals:"Sub totals",grandTotals:"Grand totals",reportName:"Report Name :",pdf:"PDF",excel:"Excel",csv:"CSV",png:"PNG",jpeg:"JPEG",svg:"SVG",mdxQuery:"MDX Query",showSubTotals:"Show subtotals",doNotShowSubTotals:"Do not show subtotals",showSubTotalsRowsOnly:"Show subtotals rows only",showSubTotalsColumnsOnly:"Show subtotals columns only",showGrandTotals:"Show grand totals",doNotShowGrandTotals:"Do not show grand totals",showGrandTotalsRowsOnly:"Show grand totals rows only",showGrandTotalsColumnsOnly:"Show grand totals columns only",fieldList:"Show fieldlist",grid:"Show table",toolbarFormatting:"Conditional formatting",chart:"Chart",reportMsg:"Please enter valid report name!!!",reportList:"Report list",removeConfirm:"Are you sure you want to delete this report?",emptyReport:"No reports found!!",bar:"Bar",pie:"Pie",funnel:"Funnel",doughnut:"Doughnut",pyramid:"Pyramid",stackingcolumn:"Stacked Column",stackingarea:"Stacked Area",stackingbar:"Stacked Bar",stackingline:"Stacked Line",stepline:"Step Line",steparea:"Step Area",splinearea:"Spline Area",spline:"Spline",stackingcolumn100:"100% Stacked Column",stackingbar100:"100% Stacked Bar",stackingarea100:"100% Stacked Area",stackingline100:"100% Stacked Line",bubble:"Bubble",pareto:"Pareto",radar:"Radar",line:"Line",area:"Area",scatter:"Scatter",polar:"Polar",of:"of",emptyFormat:"No format found!!!",emptyInput:"Enter a value",newReportConfirm:"Do you want to save the changes to this report?",emptyReportName:"Enter a report name",qtr:"Qtr",null:"null",undefined:"undefined",groupOutOfRange:"Out of Range",fieldDropErrorAction:"The field you are moving cannot be placed in that area of the report",aggregate:"Aggregate",drillThrough:"Drill Through",ascending:"Ascending",descending:"Descending",number:"Number",currency:"Currency",percentage:"Percentage",formatType:"Format Type",customText:"Currency Symbol",symbolPosition:"Symbol Position",left:"Left",right:"Right",grouping:"Grouping",true:"True",false:"False",decimalPlaces:"Decimal Places",numberFormat:"Number Formatting",memberType:"Field Type",formatString:"Format",expressionField:"Expression",customFormat:"Enter custom format string",numberFormatString:"Example: C, P, 0000 %, ###0.##0#, etc.",selectedHierarchy:"Parent Hierarchy",olapDropText:"Example: [Measures].[Order Quantity] + ([Measures].[Order Quantity] * 0.10)",Percent:"Percent",Currency:"Currency",Custom:"Custom",Measure:"Measure",Dimension:"Dimension",Standard:"Standard",blank:"(Blank)",fieldTooltip:'Drag and drop fields to create an expression. And, if you want to edit the existing calculated fields! You can achieve it by simply selecting the field under "Calculated Members".',fieldTitle:"Field Name",QuarterYear:"Quarter Year",drillError:"Cannot show the raw items of calculated fields.",caption:"Field Caption",copy:"Copy",defaultReport:"Sample Report",customFormatString:"Custom Format",invalidFormat:"Invalid Format.",group:"Group",unGroup:"Ungroup",invalidSelection:"Cannot group that selection.",groupName:"Enter the caption to display in header",captionName:"Enter the caption for group field",selectedItems:"Selected items",groupFieldCaption:"Field caption",groupTitle:"Group name",startAt:"Starting at",endAt:"Ending at",groupBy:"Interval by",selectGroup:"Select groups",multipleAxes:"Multiple Axis",showLegend:"Show Legend",exit:"Exit",chartTypeSettings:"Chart Type Settings",ChartType:"Chart Type",yes:"Yes",no:"No",numberFormatMenu:"Number Formatting...",conditionalFormattingMenu:"Conditional Formatting...",removeCalculatedField:"Are you sure you want to delete this calculated field?",replaceConfirmBefore:"A report named ",replaceConfirmAfter:" already exists. Do you want to replace it?",invalidJSON:"Invalid JSON data",invalidCSV:"Invalid CSV data",stacked:"Stacked",single:"Single",combined:"Combined",multipleAxisMode:"Multiple Axis Mode",grandTotalPosition:"Grand totals position",top:"Top",bottom:"Bottom",None:"None",rowPage:"Row pager",rowPerPage:"Rows per page",columnPage:"Column pager",columnPerPage:"Columns per page",goToFirstPage:"Go to first page",goToPreviousPage:"Go to previous page",goToNextPage:"Go to next page",goToLastPage:"Go to last page",subTotalPosition:"Subtotals position",auto:"Auto",loading:"Loading...",add:"Add"},this.localeObj=new Ue.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.renderContextMenu(),this.isDragging=!1,this.pivotDeferLayoutUpdate=Ue.isNullOrUndefined(this.pivotDeferLayoutUpdate)?this.allowDeferLayoutUpdate:this.pivotDeferLayoutUpdate,this.addInternalEvents()},v.prototype.onBeforeTooltipOpen=function(e){e.element.classList.add("e-pivottooltipwrap")},v.prototype.renderToolTip=function(){this.showTooltip?(this.tooltipTemplate?this.tooltip=new P.Tooltip({target:"td.e-valuescontent",cssClass:"e-pivottooltiptemplate"+(this.cssClass?" "+this.cssClass:""),showTipPointer:!1,position:"BottomRight",mouseTrail:!0,enableRtl:this.enableRtl,locale:this.locale,enableHtmlSanitizer:this.enableHtmlSanitizer,beforeRender:this.setToolTip.bind(this),beforeOpen:this.onBeforeTooltipOpen}):this.tooltip=new P.Tooltip({target:"td.e-valuescontent",cssClass:this.cssClass,showTipPointer:!1,position:"BottomRight",mouseTrail:!0,enableRtl:this.enableRtl,locale:this.locale,enableHtmlSanitizer:this.enableHtmlSanitizer,beforeRender:this.setToolTip.bind(this),beforeOpen:this.onBeforeTooltipOpen}),this.tooltip.isStringTemplate=!0,this.tooltip.appendTo(this.element)):this.tooltip&&this.tooltip.destroy()},v.prototype.renderContextMenu=function(){if(this.gridSettings.contextMenuItems||this.allowGrouping&&"pivot"===this.dataType){var e=[],t=[],i=[],a=[],r=[],n=[],s=[];if(this.gridSettings.contextMenuItems)for(var o=0,l=this.gridSettings.contextMenuItems;o<l.length;o++){var d,p=l[o];"string"==typeof p&&-1!==this.getDefaultItems().indexOf(p)?-1!==p.toString().toLowerCase().indexOf("aggregate")&&"pivot"===this.dataType?(s=[{text:this.localeObj.getConstant("Sum")}],(d=this.buildDefaultItems("Aggregate")).items=s,r.push(d)):(-1!==p.toString().toLowerCase().indexOf("export")?a:e).push(this.buildDefaultItems(p)):"string"!=typeof p&&i.push(p)}this.allowGrouping&&"pivot"===this.dataType&&(this.getFieldByID(this.element.id+"_custom_group",this.gridSettings.contextMenuItems)||t.push(this.buildDefaultItems("Group")),this.getFieldByID(this.element.id+"_custom_ungroup",this.gridSettings.contextMenuItems)||t.push(this.buildDefaultItems("Ungroup"))),0<a.length&&((h=this.buildDefaultItems("export")).items=a,n.push(h));var h=[];Array.prototype.push.apply(h,r),Array.prototype.push.apply(h,e),Array.prototype.push.apply(h,t),Array.prototype.push.apply(h,n),Array.prototype.push.apply(h,i),this.setProperties({gridSettings:{contextMenuItems:h}},!0)}},v.prototype.getFieldByID=function(e,t){return new K.DataManager({json:t}).executeLocal((new K.Query).where("id","equal",e))[0]},v.prototype.getAllSummaryType=function(){return["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"]},v.prototype.getDefaultItems=function(){return["Drillthrough","Expand","Collapse","Pdf Export","Excel Export","Csv Export","Sort Ascending","Sort Descending","Aggregate","CalculatedField"]},v.prototype.buildDefaultItems=function(e){var t;switch(e){case"Aggregate":t={text:this.localeObj.getConstant("aggregate"),target:"th.e-valuesheader,td.e-valuescontent,.e-stot.e-rowsheader",id:this.element.id+"_aggregate"};break;case"CalculatedField":t={text:this.localeObj.getConstant("CalculatedField"),target:"td.e-valuescontent",id:this.element.id+"_CalculatedField"};break;case"Drillthrough":t={text:this.localeObj.getConstant("drillThrough"),target:"td.e-valuescontent",id:this.element.id+"_drillthrough_menu",iconCss:"e-pivotview-grid "+z};break;case"export":t={text:this.localeObj.getConstant("export"),target:"td.e-valuescontent",id:this.element.id+"_exporting",iconCss:"e-pivotview-export "+z};break;case"Pdf Export":t={text:this.localeObj.getConstant("pdf"),id:this.element.id+"_pdf",iconCss:is+" "+z};break;case"Excel Export":t={text:this.localeObj.getConstant("excel"),id:this.element.id+"_excel",iconCss:as+" "+z};break;case"Csv Export":t={text:this.localeObj.getConstant("csv"),id:this.element.id+"_csv",iconCss:rs+" "+z};break;case"Expand":t={text:this.localeObj.getConstant("expand"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_expand",iconCss:"e-pivotview-expand "+z};break;case"Collapse":t={text:this.localeObj.getConstant("collapse"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_collapse",iconCss:"e-pivotview-collapse "+z};break;case"Sort Ascending":t={text:this.localeObj.getConstant("ascending"),target:"th.e-valuesheader,.e-stot",id:this.element.id+"_sortasc",iconCss:"e-icon-ascending "+z};break;case"Sort Descending":t={text:this.localeObj.getConstant("descending"),target:"th.e-valuesheader,.e-stot",id:this.element.id+"_sortdesc",iconCss:"e-icon-descending "+z};break;case"Group":t={text:this.localeObj.getConstant("group"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_custom_group",iconCss:"e-pivotview-group "+z};break;case"Ungroup":t={text:this.localeObj.getConstant("unGroup"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_custom_ungroup",iconCss:"e-pivotview-ungroup "+z}}return this.defaultItems[e]={text:t.text,id:t.id,target:t.target,iconCss:t.iconCss},this.defaultItems[e]},v.prototype.initProperties=function(){this.isTabular="Tabular"===this.gridSettings.layout,this.pivotRefresh=Ue.Component.prototype.refresh,this.minHeight=Ue.isNullOrUndefined(this.minHeight)?300:this.minHeight<10?10:this.minHeight,this.isScrolling=!1,this.allowServerDataBinding=!1,this.isStaticRefresh=!1,this.setProperties({pivotValues:[]},!0),this.allowServerDataBinding=!0,this.scrollPosObject={vertical:0,horizontal:0,verticalSection:0,horizontalSection:0,top:0,left:0,scrollDirection:{direction:"",position:0}},this.queryCellInfo=this.gridSettings.queryCellInfo?this.gridSettings.queryCellInfo.bind(this):void 0,this.headerCellInfo=this.gridSettings.headerCellInfo?this.gridSettings.headerCellInfo.bind(this):void 0,this.resizing=this.gridSettings.resizing?this.gridSettings.resizing.bind(this):void 0,this.resizeStop=this.gridSettings.resizeStop?this.gridSettings.resizeStop.bind(this):void 0,this.pdfHeaderQueryCellInfo=this.gridSettings.pdfHeaderQueryCellInfo||void 0,this.pdfQueryCellInfo=this.gridSettings.pdfQueryCellInfo||void 0,this.excelHeaderQueryCellInfo=this.gridSettings.excelHeaderQueryCellInfo||void 0,this.excelQueryCellInfo=this.gridSettings.excelQueryCellInfo||void 0,this.columnDragStart=this.gridSettings.columnDragStart?this.gridSettings.columnDragStart.bind(this):void 0,this.columnDrag=this.gridSettings.columnDrag?this.gridSettings.columnDrag.bind(this):void 0,this.columnDrop=this.gridSettings.columnDrop?this.gridSettings.columnDrop.bind(this):void 0,this.beforeColumnsRender=this.gridSettings.columnRender||void 0,this.selected=this.gridSettings.cellSelected||void 0,this.cellDeselected=this.gridSettings.cellDeselected||void 0,this.rowSelected=this.gridSettings.rowSelected||void 0,this.rowDeselected=this.gridSettings.rowDeselected||void 0,this.chartTooltipRender=this.chartSettings.tooltipRender||void 0,this.chartLegendClick=this.chartSettings.legendClick||void 0,this.chartLoaded=this.chartSettings.loaded||void 0,this.chartLoad=this.chartSettings.load||void 0,this.chartResized=this.chartSettings.resized||void 0,this.chartAxisLabelRender=this.chartSettings.axisLabelRender||void 0,this.multiLevelLabelClick=this.chartSettings.multiLevelLabelClick||void 0,this.chartPointClick=this.chartSettings.pointClick||void 0,this.contextMenuClick=this.gridSettings.contextMenuClick||void 0,this.contextMenuOpen=this.gridSettings.contextMenuOpen||void 0,this.beforePdfExport=this.gridSettings.beforePdfExport?this.gridSettings.beforePdfExport.bind(this):void 0,this.beforeExcelExport=this.gridSettings.beforeExcelExport?this.gridSettings.beforeExcelExport.bind(this):void 0,this.beforePrint=this.chartSettings.beforePrint||void 0,this.animationComplete=this.chartSettings.animationComplete||void 0,this.legendRender=this.chartSettings.legendRender||void 0,this.textRender=this.chartSettings.textRender||void 0,this.pointRender=this.chartSettings.pointRender||void 0,this.seriesRender=this.chartSettings.seriesRender||void 0,this.chartMouseMove=this.chartSettings.chartMouseMove||void 0,this.chartMouseClick=this.chartSettings.chartMouseClick||void 0,this.pointMove=this.chartSettings.pointMove||void 0,this.chartMouseLeave=this.chartSettings.chartMouseLeave||void 0,this.chartMouseDown=this.chartSettings.chartMouseDown||void 0,this.chartMouseUp=this.chartSettings.chartMouseUp||void 0,this.dragComplete=this.chartSettings.dragComplete||void 0,this.zoomComplete=this.chartSettings.zoomComplete||void 0,this.scrollStart=this.chartSettings.scrollStart||void 0,this.scrollEnd=this.chartSettings.scrollEnd||void 0,this.scrollChanged=this.chartSettings.scrollChanged||void 0,this.multiLevelLabelRender=this.chartSettings.multiLevelLabelRender||void 0,null===this.gridSettings.rowHeight&&(this.isTouchMode?this.setProperties({gridSettings:{rowHeight:36}},!0):this.setProperties({gridSettings:{rowHeight:this.isAdaptive?36:30}},!0)),this.chartSettings&&this.chartSettings.showMemberSeries&&!this.chartSettings.showPointColorByMembers&&this.setProperties({chartSettings:{showPointColorByMembers:!0}},!0),this.element.style.height="100%",this.enableVirtualization&&this.updatePageSettings(!0),this.isCellBoxMultiSelection=this.gridSettings.allowSelection&&"Box"===this.gridSettings.selectionSettings.cellSelectionMode&&"Cell"===this.gridSettings.selectionSettings.mode&&"Multiple"===this.gridSettings.selectionSettings.type,this.allowGrouping&&!this.isCellBoxMultiSelection&&(this.isCellBoxMultiSelection=!0,this.setProperties({gridSettings:{allowSelection:!0,selectionSettings:{cellSelectionMode:"Box",mode:"Cell",type:"Multiple"}}},!0)),"Table"!==this.displayOption.view&&(this.pivotChartModule=new il(this)),this.currentView=this.currentView||("Both"===this.displayOption.view?this.displayOption.primary:this.displayOption.view)},v.prototype.updatePageSettings=function(e){var t,i,a;this.enableVirtualization&&((i=t=1)<this.dataSourceSettings.values.length&&"pivot"===this.dataType&&("row"===this.dataSourceSettings.valueAxis?i=this.dataSourceSettings.values.length:t=this.dataSourceSettings.values.length),a=this.getHeightAsNumber(),isNaN(a)&&(a=this.element.offsetHeight),this.pageSettings={currentColumnPage:e?1:this.pageSettings.currentColumnPage,currentRowPage:e?1:this.pageSettings.currentRowPage,columnPageSize:Math.ceil((Math.floor(this.getWidthAsNumber()/this.gridSettings.columnWidth)-1)/t),rowPageSize:Math.ceil(Math.floor(a/this.gridSettings.rowHeight)/i)})},v.prototype.render=function(){this.loadData()},v.prototype.loadData=function(){if(0<this.dataSourceSettings.formatSettings.length)for(var e=this.dataSourceSettings.formatSettings,t=0;t<e.length;t++)Ue.isNullOrUndefined(e[t].maximumFractionDigits)&&Ue.isNullOrUndefined(e[t].minimumFractionDigits)||null!==e[t].format.match(/^(P|N|C|P[0-9]|C[0-9]|N[0-9])$/g)||(e[t].maximumFractionDigits=void 0,e[t].minimumIntegerDigits=void 0);"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url?"Server"===this.dataSourceSettings.mode?(this.guid=Ce.generateUUID(),this.initialLoad(),"Chart"!==this.displayOption.view?this.renderEmptyGrid():this.refreshData(),this.showWaitingPopup()):new Ue.Fetch(this.dataSourceSettings.url,"GET").send().then(function(e){return"string"==typeof e?e:e.text()}).then(this.onReadyStateChange.bind(this)):this.initialLoad()},v.prototype.onSuccess=function(e){if(this.request.readyState===XMLHttpRequest.DONE)if("onExcelExport"===this.currentAction||"onCsvExport"===this.currentAction)200===this.request.status&&(O=this.request.response,e=Ue.isNullOrUndefined(e.fileName)?"onExcelExport"===this.currentAction?"default.xlsx":"default.csv":e.fileName,I.Save.save(e,O));else{this.isServerWaitingPopup=!0;try{var t={action:this.currentAction,response:this.request.responseText},i=(this.trigger(vt,t),JSON.parse(this.request.responseText));if("fetchFieldMembers"===this.currentAction){for(var a=JSON.parse(i.members),r=[],n={},s=(this.engineModule.globalize=Ue.isNullOrUndefined(this.globalize)?new Ue.Internationalization:this.globalize,this.engineModule.formatFields=this.engineModule.setFormattedFields(this.dataSourceSettings.formatSettings),Ce.isDateField(i.memberName,this.engineModule)),o="number"===this.engineModule.fieldList[i.memberName].type,l=Object.keys(a),d=0,p=l.length;d<p;d++){var h=a[l[d]],u=s?this.engineModule.getFormattedValue(h.Name,i.memberName):{formattedText:h.Caption};n[l[d]]={index:h.Index,ordinal:h.Ordinal,isDrilled:h.IsDrilled,caption:u.formattedText},r.push({formattedText:u.formattedText,actualText:s?u.dateText:!o||isNaN(Number(h.Name))?h.Name:Number(h.Name)})}this.engineModule.fieldList[i.memberName].members=n,this.engineModule.fieldList[i.memberName].dateMember=r,(this.showGroupingBar?this:this.pivotFieldListModule).pivotButtonModule.updateFilterEvents()}else if("fetchRawData"===this.currentAction){for(var c=this.engineModule.fieldList[this.drillThroughValue.actualText.toString()]?this.engineModule.fieldList[this.drillThroughValue.actualText.toString()].caption:this.drillThroughValue.actualText.toString(),g=this.engineModule.fieldList[this.drillThroughValue.actualText]?this.engineModule.fieldList[this.drillThroughValue.actualText].aggregateType:"",m=JSON.parse(i.rawData),S=JSON.parse(i.indexObject),f={},v=0;v<S.length;v++)f[S[v].Key]=S[v].Value;this.drillThroughValue.indexObject=f,this.drillThroughModule.triggerDialog(c,g,m,this.drillThroughValue,this.drillThroughElement),this.hideWaitingPopup()}else{var y=Ce.formatFieldList(JSON.parse(i.fieldList));if(this.engineModule.fieldList)for(l=Object.keys(this.engineModule.fieldList),d=0;d<l.length;d++)this.engineModule.fieldList[l[d]]&&y[l[d]]&&(y[l[d]].dateMember=this.engineModule.fieldList[l[d]].dateMember,y[l[d]].formattedMembers=this.engineModule.fieldList[l[d]].formattedMembers,y[l[d]].members=this.engineModule.fieldList[l[d]].members);this.engineModule.fieldList=y,this.engineModule.fields=JSON.parse(i.fields),this.engineModule.rowCount=JSON.parse(i.pivotCount).RowCount,this.engineModule.columnCount=JSON.parse(i.pivotCount).ColumnCount,this.engineModule.rowStartPos=JSON.parse(i.pivotCount).RowStartPosition,this.engineModule.colStartPos=JSON.parse(i.pivotCount).ColumnStartPosition,this.engineModule.rowFirstLvl=JSON.parse(i.pivotCount).RowFirstLevel,this.engineModule.colFirstLvl=JSON.parse(i.pivotCount).ColumnFirstLevel,this.engineModule.columnPageCount=JSON.parse(i.pivotCount).ColumnPageCount,this.engineModule.rowPageCount=JSON.parse(i.pivotCount).RowPageCount;for(var b=void 0,C=Ce.formatPivotValues(JSON.parse(i.pivotValue)),x=0;x<C.length;x++)if(C[x]&&C[x][0]&&"row"===C[x][0].axis){b=x;break}this.engineModule.headerContent=Ce.frameContent(C,"header",b,this),this.engineModule.pageSettings=this.pageSettings,0<this.dataSourceSettings.groupSettings.length&&Ce.updateReport(this,JSON.parse(i.dataSourceSettings));var w=JSON.parse(i.dataSourceSettings).ValueSortSettings;this.engineModule.valueSortSettings={headerText:w.HeaderText,headerDelimiter:w.HeaderDelimiter,sortOrder:w.SortOrder,columnIndex:w.ColumnIndex},this.engineModule.pivotValues=C,this.engineModule.isEmptyData=0===this.dataSourceSettings.values.length;for(var T=0,M=this.dataSourceSettings.values;T<M.length;T++){var D=M[T];this.engineModule.valueAxisFields[D.name]=D}}}catch(e){this.engineModule.pivotValues=[]}var O,P;"onScroll"===this.currentAction&&("vertical"===this.scrollDirection?(e="row"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1,P=this.pageSettings.rowPageSize*e*this.gridSettings.rowHeight*Math.ceil(this.engineModule.rowStartPos/(this.pageSettings.rowPageSize*e))-this.engineModule.rowFirstLvl*e*this.gridSettings.rowHeight,this.scrollPosObject.verticalSection=P):"horizondal"===this.scrollDirection&&(O="column"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1,P=this.pageSettings.columnPageSize*O*this.gridSettings.columnWidth*Math.ceil(this.engineModule.colStartPos/(this.pageSettings.columnPageSize*O))-this.engineModule.colFirstLvl*O*this.gridSettings.columnWidth,this.scrollPosObject.horizontalSection=P)),"fetchFieldMembers"!==this.currentAction&&"fetchRawData"!==this.currentAction&&(this.initEngine(),this.calculatedFieldModule&&this.calculatedFieldModule.isRequireUpdate&&(this.calculatedFieldModule.endDialog(),this.calculatedFieldModule.isRequireUpdate=!1),this.pivotFieldListModule)&&this.pivotFieldListModule.calculatedFieldModule&&this.pivotFieldListModule.calculatedFieldModule.isRequireUpdate&&(this.pivotFieldListModule.calculatedFieldModule.endDialog(),this.pivotFieldListModule.calculatedFieldModule.isRequireUpdate=!1)}},v.prototype.getEngine=function(e,t,i,a,r,n,s,o,l,d){for(var p=this,h=(this.engineModule.isEmptyData=!1,this.element.querySelector(".e-spin-hide")&&"onExcelExport"!==e&&"onCsvExport"!==e&&this.showWaitingPopup(),this.currentAction=e,this.isServerWaitingPopup=!1,{pageSettings:JSON.parse(this.getPageSettings()).pageSettings,enableValueSorting:this.enableValueSorting,enablePaging:this.enablePaging,enableVirtualization:this.enableVirtualization,allowDataCompression:this.allowDataCompression,enableDrillThrough:this.allowDrillThrough||this.editSettings.allowEditing,locale:JSON.stringify(Ce.getLocalizedObject(this)),enableOptimizedRendering:this.enableVirtualization&&this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage,requestType:"string",headers:{"Content-type":"application/json"}}),u=(this.request.readyState!==XMLHttpRequest.UNSENT&&this.request.readyState!==XMLHttpRequest.OPENED||(this.request.withCredentials=!1),{request:this.request,dataSourceSettings:JSON.parse(this.getPersistData()).dataSourceSettings,action:e,customProperties:{},internalProperties:h,drillItem:t,sortItem:i,aggregatedItem:a,calculatedItem:r,filterItem:n,memberName:s,fetchRawDataArgs:o,editArgs:l,hash:this.guid,excelExportProperties:d,exportAllPages:this.exportAllPages,isGroupingUpdated:"onRefresh"===this.currentAction&&0<this.dataSourceSettings.groupSettings.length||!!this.groupingModule&&this.groupingModule.isUpdate}),c=(this.trigger(ft,u,function(e){p.request=e.request,u.internalProperties=e.internalProperties,u.customProperties=e.customProperties,u.dataSourceSettings=e.dataSourceSettings,u.calculatedItem=e.calculatedItem,u.drillItem=e.drillItem,u.editArgs=e.editArgs,u.fetchRawDataArgs=e.fetchRawDataArgs,u.filterItem=e.filterItem,u.hash=e.hash,u.memberName=e.memberName,u.sortItem=e.sortItem,u.excelExportProperties=e.excelExportProperties,u.exportAllPages=e.exportAllPages}),this.request.open("POST",this.dataSourceSettings.url,!0),this.request.onreadystatechange=this.onSuccess.bind(this,u.excelExportProperties),"onExcelExport"===u.action||"onCsvExport"===u.action?this.request.responseType="blob":this.request.responseType="",Object.keys(u.internalProperties.headers)),g=0;g<c.length;g++){var m=c[g],S=String(u.internalProperties.headers[m]);this.request.setRequestHeader(m,S)}"string"===u.internalProperties.requestType?this.request.send(JSON.stringify(u)):"base64"===u.internalProperties.requestType&&this.request.send(btoa(JSON.stringify(u)))},v.prototype.getChartSettings=function(){var e=this.chartSettings.load,t=this.chartSettings.loaded,i=this.chartSettings.textRender,a=this.chartSettings.pointRender,r=this.chartSettings.seriesRender,n=this.chartSettings.legendRender,s=this.chartSettings.pointClick,o=this.chartSettings.tooltipRender,l=this.chartSettings.legendClick,d=this.chartSettings.multiLevelLabelRender,p=this.chartSettings.beforePrint,h=this.chartSettings.animationComplete,u=this.chartSettings.chartMouseMove,c=this.chartSettings.chartMouseClick,g=this.chartSettings.pointMove,m=this.chartSettings.chartMouseLeave,S=this.chartSettings.chartMouseDown,f=this.chartSettings.chartMouseUp,v=this.chartSettings.dragComplete,y=this.chartSettings.zoomComplete,b=this.chartSettings.scrollStart,C=this.chartSettings.scrollEnd,x=this.chartSettings.scrollChanged,w=(this.chartSettings.load=void 0,this.chartSettings.loaded=void 0,this.chartSettings.textRender=void 0,this.chartSettings.pointRender=void 0,this.chartSettings.seriesRender=void 0,this.chartSettings.legendRender=void 0,this.chartSettings.pointClick=void 0,this.chartSettings.tooltipRender=void 0,this.chartSettings.legendClick=void 0,this.chartSettings.multiLevelLabelRender=void 0,this.chartSettings.beforePrint=void 0,this.chartSettings.animationComplete=void 0,this.chartSettings.chartMouseMove=void 0,this.chartSettings.chartMouseClick=void 0,this.chartSettings.pointMove=void 0,this.chartSettings.chartMouseLeave=void 0,this.chartSettings.chartMouseDown=void 0,this.chartSettings.chartMouseUp=void 0,this.chartSettings.dragComplete=void 0,this.chartSettings.zoomComplete=void 0,this.chartSettings.scrollStart=void 0,this.chartSettings.scrollEnd=void 0,this.chartSettings.scrollChanged=void 0,this.addOnPersist(["chartSettings"]));return this.chartSettings.load=e,this.chartSettings.loaded=t,this.chartSettings.textRender=i,this.chartSettings.pointRender=a,this.chartSettings.seriesRender=r,this.chartSettings.legendRender=n,this.chartSettings.pointClick=s,this.chartSettings.tooltipRender=o,this.chartSettings.legendClick=l,this.chartSettings.multiLevelLabelRender=d,this.chartSettings.beforePrint=p,this.chartSettings.animationComplete=h,this.chartSettings.chartMouseMove=u,this.chartSettings.chartMouseClick=c,this.chartSettings.pointMove=g,this.chartSettings.chartMouseLeave=m,this.chartSettings.chartMouseDown=S,this.chartSettings.chartMouseUp=f,this.chartSettings.dragComplete=v,this.chartSettings.zoomComplete=y,this.chartSettings.scrollStart=b,this.chartSettings.scrollEnd=C,this.chartSettings.scrollChanged=x,w},v.prototype.getPageSettings=function(){return this.addOnPersist(["pageSettings"])},v.prototype.onReadyStateChange=function(e){var t=[];if("CSV"===this.dataSourceSettings.type)for(var i=e.split(/\r?\n|\r/),a=0;a<i.length;a++)Ue.isNullOrUndefined(i[a])||""===i[a]||t.push(i[a].split(","));else try{t=JSON.parse(e)}catch(e){t=[]}t&&0<t.length&&this.setProperties({dataSourceSettings:{dataSource:t}},!0),this.initialLoad()},v.prototype.initialLoad=function(){var t=this;try{this.cellTemplateFn=this.templateParser(this.cellTemplate),this.tooltipTemplateFn=this.templateParser(this.tooltipTemplate),this.spinnerTemplate?P.createSpinner({target:this.element,template:this.spinnerTemplate,cssClass:this.cssClass||void 0},this.createElement):P.createSpinner({target:this.element,cssClass:this.cssClass||void 0},this.createElement);var i={dataSourceSettings:this.dataSourceSettings,pivotview:this,fieldsType:{},defaultFieldListOrder:this.defaultFieldListOrder};this.trigger(k,i,function(e){t.dataSourceSettings=e.dataSourceSettings,t.fieldsType=e.fieldsType,t.defaultFieldListOrder=i.defaultFieldListOrder,t.updateClass(),t.notify(Pt,{}),"Server"!==t.dataSourceSettings.mode&&t.notify(xt,{}),t.isAdaptive&&t.contextMenuModule.render(),t.notify(It,{}),t.notify(Lt,{})})}catch(e){this.actionFailureMethod(e)}},v.prototype.addInternalEvents=function(){this.on(xt,this.generateData,this),this.on(Ot,this.renderPivotGrid,this),this.on(Dt,this.onContentReady,this)},v.prototype.removeInternalEvents=function(){this.off(xt,this.generateData),this.off(Ot,this.renderPivotGrid),this.off(Dt,this.onContentReady)},v.prototype.getPersistData=function(e){var t=this.gridSettings.columnRender,i=this.gridSettings.excelQueryCellInfo,a=this.gridSettings.excelHeaderQueryCellInfo,r=this.gridSettings.pdfQueryCellInfo,n=this.gridSettings.pdfHeaderQueryCellInfo,s=this.chartSettings.load,o=this.chartSettings.loaded,l=this.chartSettings.textRender,d=this.chartSettings.pointRender,p=this.chartSettings.seriesRender,h=this.chartSettings.legendRender,u=this.chartSettings.pointClick,c=this.chartSettings.tooltipRender,g=this.chartSettings.legendClick,m=this.chartSettings.multiLevelLabelRender,S=this.chartSettings.beforePrint,f=this.chartSettings.animationComplete,v=this.chartSettings.chartMouseMove,y=this.chartSettings.chartMouseClick,b=this.chartSettings.pointMove,C=this.chartSettings.chartMouseLeave,x=this.chartSettings.chartMouseDown,w=this.chartSettings.chartMouseUp,T=this.chartSettings.dragComplete,M=this.chartSettings.zoomComplete,D=this.chartSettings.scrollStart,O=this.chartSettings.scrollEnd,P=this.chartSettings.scrollChanged,N=(this.gridSettings.columnRender=void 0,this.gridSettings.excelQueryCellInfo=void 0,this.gridSettings.excelHeaderQueryCellInfo=void 0,this.gridSettings.pdfQueryCellInfo=void 0,this.gridSettings.pdfHeaderQueryCellInfo=void 0,this.chartSettings.tooltipRender=void 0,this.chartSettings.legendClick=void 0,this.chartSettings.multiLevelLabelRender=void 0,this.chartSettings.load=void 0,this.chartSettings.loaded=void 0,this.chartSettings.textRender=void 0,this.chartSettings.pointRender=void 0,this.chartSettings.seriesRender=void 0,this.chartSettings.legendRender=void 0,this.chartSettings.pointClick=void 0,this.chartSettings.beforePrint=void 0,this.chartSettings.animationComplete=void 0,this.chartSettings.chartMouseMove=void 0,this.chartSettings.chartMouseClick=void 0,this.chartSettings.pointMove=void 0,this.chartSettings.chartMouseLeave=void 0,this.chartSettings.chartMouseDown=void 0,this.chartSettings.chartMouseUp=void 0,this.chartSettings.dragComplete=void 0,this.chartSettings.zoomComplete=void 0,this.chartSettings.scrollStart=void 0,this.chartSettings.scrollEnd=void 0,this.chartSettings.scrollChanged=void 0,[]),E=(e&&(N=!this.dataSourceSettings.dataSource||this.dataSourceSettings.dataSource instanceof K.DataManager?this.dataSourceSettings.dataSource:this.dataSourceSettings.dataSource.slice(),this.setProperties({dataSourceSettings:{dataSource:[]}},!0)),this.addOnPersist(["dataSourceSettings","pivotValues","gridSettings","chartSettings","displayOption","pageSettings"]));return this.gridSettings.columnRender=t,this.gridSettings.excelQueryCellInfo=i,this.gridSettings.excelHeaderQueryCellInfo=a,this.gridSettings.pdfQueryCellInfo=r,this.gridSettings.pdfHeaderQueryCellInfo=n,this.chartSettings.load=s,this.chartSettings.loaded=o,this.chartSettings.textRender=l,this.chartSettings.pointRender=d,this.chartSettings.seriesRender=p,this.chartSettings.legendRender=h,this.chartSettings.pointClick=u,this.chartSettings.tooltipRender=c,this.chartSettings.legendClick=g,this.chartSettings.multiLevelLabelRender=m,this.chartSettings.beforePrint=S,this.chartSettings.animationComplete=f,this.chartSettings.chartMouseMove=v,this.chartSettings.chartMouseClick=y,this.chartSettings.pointMove=b,this.chartSettings.chartMouseLeave=C,this.chartSettings.chartMouseDown=x,this.chartSettings.chartMouseUp=w,this.chartSettings.dragComplete=T,this.chartSettings.zoomComplete=M,this.chartSettings.scrollStart=D,this.chartSettings.scrollEnd=O,this.chartSettings.scrollChanged=P,e&&this.setProperties({dataSourceSettings:{dataSource:N}},!0),E},v.prototype.loadPersistData=function(e){e=JSON.parse(e);this.allowServerDataBinding=!1,this.setProperties({gridSettings:e.gridSettings,pivotValues:e.pivotValues,chartSettings:e.chartSettings,displayOption:e.displayOption},!0),"Chart"===e.displayOption.primary?this.currentView="Chart":this.currentView="Table",this.allowServerDataBinding=!0,this.dataSourceSettings&&this.dataSourceSettings.dataSource&&this.dataSourceSettings.dataSource instanceof K.DataManager&&e.dataSourceSettings&&e.dataSourceSettings.dataSource&&e.dataSourceSettings.dataSource.dataSource&&this.dataSourceSettings.dataSource.dataSource&&e.dataSourceSettings.dataSource.dataSource.url===this.dataSourceSettings.dataSource.dataSource.url&&(e.dataSourceSettings.dataSource=this.dataSourceSettings.dataSource),this.dataSourceSettings=e.dataSourceSettings},v.prototype.mergePersistPivotData=function(){var e=window.localStorage.getItem(this.getModuleName()+this.element.id);Ue.isNullOrUndefined(e)||""===e||(e=JSON.parse(e),this.dataSourceSettings&&this.dataSourceSettings.dataSource&&this.dataSourceSettings.dataSource instanceof K.DataManager&&e.dataSourceSettings&&e.dataSourceSettings.dataSource&&e.dataSourceSettings.dataSource.dataSource&&this.dataSourceSettings.dataSource.dataSource&&e.dataSourceSettings.dataSource.dataSource.url===this.dataSourceSettings.dataSource.dataSource.url&&(e.dataSourceSettings.dataSource=this.dataSourceSettings.dataSource),this.setProperties(e,!0))},v.prototype.showConditionalFormattingDialog=function(){this.conditionalFormattingModule&&this.conditionalFormattingModule.showConditionalFormattingDialog()},v.prototype.createCalculatedFieldDialog=function(){this.calculatedFieldModule&&this.calculatedFieldModule.createCalculatedFieldDialog()},v.prototype.getModuleName=function(){return"pivotview"},v.prototype.copy=function(e){this.grid.copy(e)},v.prototype.onPropertyChanged=function(e,t){for(var i=!1,a=0,r=Object.keys(e);a<r.length;a++){var n,s,o=r[a];switch(o){case"dataSourceSettings":case"hyperlinkSettings":case"allowDrillThrough":case"editSettings":case"allowDataCompression":e.dataSourceSettings&&(!Ue.isNullOrUndefined(e.dataSourceSettings.dataSource)&&!Ue.isNullOrUndefined(this.clonedDataSet)&&this.clonedDataSet!==e.dataSourceSettings.dataSource&&!Ue.isNullOrUndefined(e.dataSourceSettings.groupSettings)&&0<e.dataSourceSettings.groupSettings.length||1===Object.keys(e.dataSourceSettings).length&&"dataSource"===Object.keys(e.dataSourceSettings)[0]&&0<this.dataSourceSettings.groupSettings.length)&&(this.clonedDataSet=e.dataSourceSettings.dataSource,this.engineModule.groupingFields={}),e.dataSourceSettings&&1===Object.keys(e.dataSourceSettings).length&&e.dataSourceSettings.groupSettings&&"pivot"===this.dataType&&this.updateGroupingReport(e.dataSourceSettings.groupSettings,"Date"),-1<(Ue.isNullOrUndefined(e.dataSourceSettings)?[]:Object.keys(e.dataSourceSettings)).indexOf("dataSource")&&"CSV"!==e.dataSourceSettings.type?(!Ue.isNullOrUndefined(this.savedDataSourceSettings)&&0<this.dataSourceSettings.dataSource.length&&(Ce.updateDataSourceSettings(this,this.savedDataSourceSettings),this.savedDataSourceSettings=void 0),e.dataSourceSettings.dataSource&&0===e.dataSourceSettings.dataSource.length&&(this.savedDataSourceSettings=Ce.getClonedDataSourceSettings(this.dataSourceSettings),this.setProperties({dataSourceSettings:{rows:[]}},!0),this.setProperties({dataSourceSettings:{columns:[]}},!0),this.setProperties({dataSourceSettings:{values:[]}},!0),this.setProperties({dataSourceSettings:{filters:[]}},!0)),this.isStaticRefresh||(this.pivotValues=[],"pivot"===this.dataType?(this.engineModule.fieldList=null,this.engineModule.isEmptyData=!0,this.engineModule.data=[],this.engineModule.groupingFieldsInfo={}):"olap"===this.dataType&&(this.olapEngineModule.fieldList={},this.olapEngineModule.fieldListData=void 0,this.olapEngineModule.isEmptyData=!0)),this.showWaitingPopup(),this.notify(xt,{})):Ce.isButtonIconRefesh(o,t,e)?(this.showGroupingBar&&this.groupingBarModule&&this.axisFieldModule.render(),this.showFieldList&&this.pivotFieldListModule&&(l=Ce.cloneFieldSettings(this.dataSourceSettings.rows),d=Ce.cloneFieldSettings(this.dataSourceSettings.columns),s=Ce.cloneFieldSettings(this.dataSourceSettings.values),n=Ce.cloneFieldSettings(this.dataSourceSettings.filters),this.pivotFieldListModule.setProperties({dataSourceSettings:{rows:l,columns:d,values:s,filters:n}},!0),this.pivotFieldListModule.axisFieldModule.render(),this.pivotFieldListModule.treeViewModule.fieldTable)&&!this.isAdaptive&&this.pivotFieldListModule.notify(Nt,{})):(this.remoteData=[],"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url&&("type"in e.dataSourceSettings||"url"in e.dataSourceSettings)?(this.engineModule.fieldList=null,this.loadData()):(e.dataSourceSettings&&("pivot"===this.dataType&&"dataSource"in e.dataSourceSettings||"olap"===this.dataType&&"url"in e.dataSourceSettings)&&(this.isStaticRefresh||("pivot"===this.dataType?(this.engineModule.fieldList=null,this.engineModule.isEmptyData=!0,this.engineModule.data=[],this.engineModule.groupingFieldsInfo={}):"olap"===this.dataType&&(this.olapEngineModule.fieldList={},this.olapEngineModule.fieldListData=void 0,this.olapEngineModule.isEmptyData=!0),this.pivotValues=[])),this.notify(xt,{})));break;case"height":case"width":this.layoutRefresh();break;case"pivotValues":case"displayOption":if(e.displayOption&&1===Object.keys(e.displayOption).length&&e.displayOption.view)switch(this.currentView="Both"===e.displayOption.view?this.displayOption.primary:e.displayOption.view,(this.showGroupingBar||this.showFieldList)&&(this.showFieldList&&this.pivotFieldListModule&&(this.pivotFieldListModule.destroyEngine=!0,this.pivotFieldListModule.destroy(),null!==Ue.select("#"+this.element.id+"_PivotFieldList",this.element)&&Ue.remove(Ue.select("#"+this.element.id+"_PivotFieldList",this.element)),this.pivotFieldListModule.destroyEngine=!1),this.notify(Pt,this)),e.displayOption.view){case"Both":this.pivotChartModule||(this.pivotChartModule=new il(this)),this.grid||this.renderEmptyGrid();break;case"Chart":this.grid&&(this.grid.destroy(),this.grid=void 0),this.pivotChartModule||(this.pivotChartModule=new il(this));break;case"Table":this.grid||this.renderEmptyGrid(),this.pivotChartModule&&(this.destroyEngine=!0,this.pivotChartModule.destroy(),this.destroyEngine=!1,this.chart=void 0,this.pivotChartModule=void 0)}else this.showToolbar&&!Ue.isNullOrUndefined(e.displayOption)&&e.displayOption.view&&(this.currentView="Both"===e.displayOption.view?this.displayOption.primary:e.displayOption.view);this.showToolbar&&!Ue.isNullOrUndefined(e.displayOption)&&e.displayOption.view&&("Chart"===e.displayOption.view?(this.toolbarModule.createChartMenu(),this.toggleButtonState(ls,"add"),this.toggleButtonState(ds,"remove")):"Table"===e.displayOption.view?(Ue.select("#"+this.element.id+"_grid",this.element).style.display="block",this.toggleButtonState(ds,"add"),this.toggleButtonState(ls,"remove")):(this.toolbarModule.createChartMenu(),this.toggleButtonState(ls,"remove"),this.toggleButtonState(ds,"remove")));var l="pivot"===this.dataType?this.engineModule:this.olapEngineModule;Ue.isNullOrUndefined(l.fieldList)&&Ue.isNullOrUndefined(l.pivotValues)||this.notify(Ot,{});break;case"gridSettings":this.isTabular="Tabular"===this.gridSettings.layout,this.lastGridSettings=e.gridSettings,this.isCellBoxMultiSelection=this.gridSettings.allowSelection&&"Box"===this.gridSettings.selectionSettings.cellSelectionMode&&"Cell"===this.gridSettings.selectionSettings.mode&&"Multiple"===this.gridSettings.selectionSettings.type,this.allowGrouping&&this.groupingModule&&!this.isCellBoxMultiSelection&&(this.setProperties({gridSettings:{allowSelection:!0,selectionSettings:{cellSelectionMode:"Box",mode:"Cell",type:"Multiple"}}},!0),this.isCellBoxMultiSelection=!0),this.renderModule.updateGridSettings(),e.gridSettings.layout&&this.initialLoad();break;case"chartSettings":this.showGroupingBar&&this.groupingBarModule&&(-1!==Object.keys(e.chartSettings).indexOf("enableMultipleAxis")||e.chartSettings.chartSeries&&-1!==Object.keys(e.chartSettings.chartSeries).indexOf("type"))&&(this.groupingBarModule.renderLayout(),this.pivotChartModule)&&this.groupingBarModule.appendToElement(),Ue.isNullOrUndefined(this.pivotChartModule)&&"Table"!==this.displayOption.view&&(this.pivotChartModule=new il(this));var d="pivot"===this.dataType?this.engineModule:this.olapEngineModule;Ue.isNullOrUndefined(this.pivotChartModule)||Ue.isNullOrUndefined(d.pivotValues)||this.pivotChartModule.loadChart(this,this.chartSettings),Ue.isNullOrUndefined(d.pivotValues)||Ue.isNullOrUndefined(d.fieldList)||this.notify(wt,this);break;case"locale":case"currencyCode":case"enableRtl":this.tooltip&&this.tooltip.destroy(),this.dataSourceSettings.groupSettings&&0<this.dataSourceSettings.groupSettings.length&&this.clonedDataSet&&(s="CSV"===this.dataSourceSettings.type?Ce.getClonedCSVData(this.clonedDataSet):Ce.getClonedData(this.clonedDataSet),this.setProperties({dataSourceSettings:{dataSource:s}},!0)),Rp.prototype.refresh.call(this),this.updateClass();break;case"enableValueSorting":this.enableValueSorting=e.enableValueSorting,this.updateDataSource();break;case"showGroupingBar":this.element.querySelector(".e-grouping-bar")?this.element.querySelector(".e-grouping-bar").remove():this.groupingBarModule&&this.groupingBarModule.renderLayout(),Ue.isNullOrUndefined(e.showFieldList)&&this.renderPivotGrid();break;case"showFieldList":this.initialLoad();break;case"groupingBarSettings":this.showGroupingBar&&this.groupingBarModule&&(e.groupingBarSettings&&-1<Object.keys(e.groupingBarSettings).indexOf("showFieldsPanel")?(this.groupingBarModule.RefreshFieldsPanel(),this.layoutRefresh()):this.axisFieldModule.render());break;case"showValuesButton":this.showGroupingBar&&this.groupingBarModule&&this.axisFieldModule&&this.axisFieldModule.render(),this.showFieldList&&this.pivotFieldListModule&&this.pivotFieldListModule.axisFieldModule&&(this.pivotFieldListModule.setProperties({showValuesButton:e.showValuesButton},!0),this.pivotFieldListModule.axisFieldModule.render());break;case"showTooltip":this.renderToolTip();break;case"showToolbar":case"toolbar":this.toolbarModule&&this.showToolbar&&this.toolbarModule.refreshToolbar();break;case"chartTypes":this.toolbarModule&&this.toolbarModule.createChartMenu();break;case"aggregateTypes":this.showGroupingBar&&this.groupingBarModule&&this.axisFieldModule&&this.axisFieldModule.render(),this.showFieldList&&this.pivotFieldListModule&&this.pivotFieldListModule.axisFieldModule&&(this.pivotFieldListModule.setProperties({aggregateTypes:e.aggregateTypes},!0),this.pivotFieldListModule.axisFieldModule.render());break;case"enableFieldSearching":this.pivotFieldListModule&&(this.pivotFieldListModule.enableFieldSearching=this.enableFieldSearching);break;case"pageSettings":this.enableVirtualization||(this.engineModule.pageSettings=this.pageSettings,this.engineModule.fieldList?this.refreshPageData():this.initialLoad());break;case"pagerSettings":case"enablePaging":this.notify(Lt,this),this.initialLoad();break;case"cellTemplate":this.cellTemplateFn=this.templateParser(this.cellTemplate),i=!0;break;case"tooltipTemplate":this.tooltipTemplateFn=this.templateParser(this.tooltipTemplate),i=!0;break;case"allowCalculatedField":this.pivotFieldListModule&&(this.pivotFieldListModule.allowCalculatedField=this.allowCalculatedField);break;case"allowDeferLayoutUpdate":this.pivotFieldListModule&&(this.pivotFieldListModule.allowDeferLayoutUpdate=this.allowDeferLayoutUpdate);break;case"allowGrouping":this.refresh()}}i&&this.grid&&this.grid.refreshColumns()},v.prototype.toggleButtonState=function(e,t){var e=this.element.querySelector("."+e);e&&(e=e.closest(".e-toolbar-item"))&&("add"===t?e.classList.add(b):"remove"===t&&e.classList.remove(b))},v.prototype.templateParser=function(t){if(t)try{return"function"!=typeof t&&document.querySelectorAll(t).length?Ue.compile(document.querySelector(t).innerHTML.trim()):Ue.compile(t)}catch(e){return Ue.compile(t)}},v.prototype.getCellTemplate=function(){return this.cellTemplateFn},v.prototype.appendHtml=function(e,t){var i=document.createElement("div");return i.innerHTML=t,Ue.isNullOrUndefined(i.firstChild)||e.appendChild(i.firstChild),e},v.prototype.renderPivotGrid=function(){this.isEmptyGrid=!1,this.notEmpty=!0,this.clearTemplate(),this.showGroupingBar&&(this.pivotChartModule&&this.appendChartElement(),this.groupingBarModule.appendToElement()),this.pivotChartModule&&(this.pivotChartModule.engineModule=this.engineModule,this.pivotChartModule.loadChart(this,this.chartSettings),this.enableRtl)&&this.chart&&"rtl"!==document.body.getAttribute("dir")&&Ue.addClass([this.chart.element],"e-ltr"),this.enableVirtualization&&(this.virtualscrollModule=new Xo(this)),(this.allowDrillThrough||this.editSettings.allowEditing)&&(this.drillThroughModule=new el(this)),this.enablePaging&&this.notify(Lt,this),"Chart"!==this.displayOption.view?(this.hyperlinkSettings&&(this.isRowCellHyperlink=!!this.hyperlinkSettings.showRowHeaderHyperlink||!!this.hyperlinkSettings.showHyperlink,this.isColumnCellHyperlink=!!this.hyperlinkSettings.showColumnHeaderHyperlink||!!this.hyperlinkSettings.showHyperlink,this.isValueCellHyperlink=!!this.hyperlinkSettings.showValueCellHyperlink||!!this.hyperlinkSettings.showHyperlink,this.isSummaryCellHyperlink=!!this.hyperlinkSettings.showSummaryCellHyperlink||!!this.hyperlinkSettings.showHyperlink,this.applyHyperlinkSettings()),this.renderModule=this.renderModule||new ks(this),this.renderModule.render(!0)):this.grid&&Ue.remove(this.grid.element),(this.showFieldList||this.allowNumberFormatting||this.allowCalculatedField||this.toolbar||this.allowGrouping||this.gridSettings.contextMenuItems)&&(this.notify(wt,this),this.pivotFieldListModule)&&this.allowDeferLayoutUpdate&&(this.pivotFieldListModule.clonedDataSource=Ce.getClonedDataSourceSettings(this.dataSourceSettings)),this.allowConditionalFormatting&&this.applyFormatting(this.pivotValues),this.showToolbar&&"Both"===this.displayOption.view&&this.chart&&this.grid&&(this.showGroupingBar&&this.groupingBarModule&&this.element.querySelector("."+wr)&&this.groupingBarModule.refreshUI(),this.toolbarModule&&this.toolbarModule.toolbar&&(this.toolbarModule.toolbar.width=this.getGridWidthAsNumber()),this.chartSettings.enableScrollOnMultiAxis&&this.chartSettings.enableMultipleAxis&&(this.element.querySelector("."+ps).style.width=Ue.formatUnit(this.getGridWidthAsNumber())),this.chart.width=Ue.formatUnit(this.getGridWidthAsNumber()),"Table"===this.currentView?(this.grid.element.style.display="",this.chart.element.style.display="none",this.chartSettings.enableMultipleAxis&&this.chartSettings.enableScrollOnMultiAxis&&(this.element.querySelector(".e-pivotchart").style.display="none")):(this.grid.element.style.display="none",this.chart.element.style.display="",this.chartSettings.enableMultipleAxis&&this.chartSettings.enableScrollOnMultiAxis&&(this.element.querySelector(".e-pivotchart").style.display=""))),this.toolbarModule&&(this.showFieldList&&Ue.select("#"+this.element.id+"_PivotFieldList",this.element)&&(this.toolbar&&-1!==this.toolbar.indexOf("FieldList")?Ue.select("#"+this.element.id+"_PivotFieldList",this.element).style.display="none":(Ue.select("#"+this.element.id+"_PivotFieldList",this.element).style.top=this.element.querySelector("."+ss).offsetHeight.toString()+"px",Ue.select("#"+this.element.id+"_PivotFieldList",this.element).style.position="relative")),this.toolbar&&-1!==this.toolbar.indexOf("FieldList")&&this.showToolbar&&this.element.querySelector(".e-toggle-field-list")&&(this.element.querySelector(".e-toggle-field-list").style.display="none"),this.toolbarModule&&"New"!==this.toolbarModule.action&&"Load"!==this.toolbarModule.action&&"Remove"!==this.toolbarModule.action&&(this.isModified=!0),this.isInitialRendering||(this.isModified=!1,this.isInitialRendering=!this.isInitialRendering),this.toolbarModule.action="")},v.prototype.appendChartElement=function(){var e,t;Ue.select("#"+this.element.id+"_chart",this.element)||("Both"===this.displayOption.view&&"Chart"===this.displayOption.primary?this.element.insertBefore(Ue.createElement("div",{className:ps,id:this.element.id+"_chart"}),this.element.querySelector("."+Dn)):this.element.appendChild(Ue.createElement("div",{className:ps,id:this.element.id+"_chart"})),e=this.width.toString(),this.showToolbar&&this.grid&&(e=this.getGridWidthAsNumber().toString()),t=this.pivotChartModule.getChartHeight(),new(this.chartSettings&&this.chartSettings.chartSeries&&-1<this.pivotChartModule.accumulationType.indexOf(this.chartSettings.chartSeries.type)?y.AccumulationChart:y.Chart)({width:e,height:t}).appendTo(Ue.select("#"+this.element.id+"_chart",this.element)),this.showToolbar&&("Both"===this.displayOption.view&&"Chart"===this.currentView&&(this.grid.element.style.display="none"),"Chart"!==this.currentView)&&(Ue.select("#"+this.element.id+"_chart",this.element).style.display="none"))},v.prototype.showWaitingPopup=function(){this.grid&&this.grid.element&&!this.spinnerTemplate&&"Table"===this.currentView?P.showSpinner(this.grid.element):P.showSpinner(this.element)},v.prototype.hideWaitingPopup=function(){this.grid&&this.grid.element&&!this.spinnerTemplate&&"Table"===this.currentView?P.hideSpinner(this.grid.element):P.hideSpinner(this.element)},v.prototype.updateDataSource=function(){var i=this,a=(this.showWaitingPopup(),this),r=!Ue.isNullOrUndefined(a.lastSortInfo)&&0<Object.keys(a.lastSortInfo).length,n=!Ue.isNullOrUndefined(a.lastFilterInfo)&&0<Object.keys(a.lastFilterInfo).length,s=!Ue.isNullOrUndefined(a.lastAggregationInfo)&&0<Object.keys(a.lastAggregationInfo).length,o=!Ue.isNullOrUndefined(a.lastCalcFieldInfo)&&0<Object.keys(a.lastCalcFieldInfo).length,e={dataSourceSettings:Ce.getClonedDataSourceSettings(a.dataSourceSettings)};a.trigger(_,e,function(e){var t;(a.enableVirtualization||a.enablePaging)&&(r||n||s||o)||Ce.updateDataSourceSettings(a,e.dataSourceSettings),a.updatePageSettings(!1),r&&""!==a.dataSourceSettings.valueSortSettings.headerText&&a.setProperties({dataSourceSettings:{valueSortSettings:{headerText:""}}},!0),"pivot"===a.dataType&&(a.enableVirtualization||a.enablePaging)&&(r||n||s||o)?(r&&("Server"===i.dataSourceSettings.mode?a.getEngine("onSort",null,a.lastSortInfo,null,null,null,null):a.engineModule.onSort(a.lastSortInfo,a.dataSourceSettings),a.lastSortInfo={}),s&&("Server"===i.dataSourceSettings.mode?a.getEngine("onAggregation",null,null,a.lastAggregationInfo,null,null,null):a.engineModule.onAggregation(a.lastAggregationInfo,a.dataSourceSettings),a.lastAggregationInfo={}),o&&("Server"===i.dataSourceSettings.mode?a.getEngine("onCalcOperation",null,null,null,a.lastCalcFieldInfo,null,null):a.engineModule.onCalcOperation(a.lastCalcFieldInfo,a.dataSourceSettings),a.lastCalcFieldInfo={}),n&&("Server"===i.dataSourceSettings.mode?a.getEngine("onFilter",null,null,null,null,a.lastFilterInfo,null):a.engineModule.onFilter(a.lastFilterInfo,a.dataSourceSettings),a.lastFilterInfo={}),a.allowServerDataBinding=!1,a.setProperties({pivotValues:a.engineModule.pivotValues},!0),a.allowServerDataBinding=!0,"Server"!==a.dataSourceSettings.mode&&a.enginePopulatedEventMethod("updateDataSource")):"olap"===a.dataType?(t={mode:"",savedFieldList:a.olapEngineModule.fieldList,savedFieldListData:a.olapEngineModule.fieldListData,pageSettings:a.pageSettings,enableValueSorting:a.enableValueSorting,isDrillThrough:a.allowDrillThrough||a.editSettings.allowEditing,localeObj:a.localeObj,enableVirtualization:i.enableVirtualization},o||r?(a.olapEngineModule.savedFieldList=a.olapEngineModule.fieldList,a.olapEngineModule.savedFieldListData=a.olapEngineModule.fieldListData,o?(a.olapEngineModule.updateCalcFields(a.dataSourceSettings,a.lastCalcFieldInfo),a.lastCalcFieldInfo={}):(a.olapEngineModule.onSort(a.dataSourceSettings),a.lastSortInfo={})):Ce.renderOlapEngine(a,t),a.allowServerDataBinding=!1,a.setProperties({pivotValues:a.olapEngineModule.pivotValues},!0),a.allowServerDataBinding=!0,a.enginePopulatedEventMethod("updateDataSource")):(t={mode:"",savedFieldList:a.engineModule.fieldList,pageSettings:a.pageSettings,enableValueSorting:a.enableValueSorting,isDrillThrough:a.allowDrillThrough||a.editSettings.allowEditing,localeObj:a.localeObj,fieldsType:a.fieldsType,clonedReport:a.clonedReport,globalize:a.globalize,currenyCode:a.currencyCode,enablePaging:i.enablePaging,enableVirtualization:i.enableVirtualization,allowDataCompression:i.allowDataCompression,enableHtmlSanitizer:i.enableHtmlSanitizer,enableOptimizedRendering:i.enableVirtualization&&i.virtualscrollModule&&i.virtualScrollSettings.allowSinglePage,isTabularLayout:i.isTabular},"Server"===a.dataSourceSettings.mode?r?a.getEngine("onSort",null,a.lastSortInfo,null,null,null,null):s?a.getEngine("onAggregation",null,null,a.lastAggregationInfo,null,null,null):o?a.getEngine("onCalcOperation",null,null,null,a.lastCalcFieldInfo,null,null):n?a.getEngine("onFilter",null,null,null,null,a.lastFilterInfo,null):a.getEngine("onDrop",null,null,null,null,null,null):(a.engineModule.renderEngine(a.dataSourceSettings,t,a.aggregateCellInfo?a.getValueCellInfo.bind(a):void 0,a.onHeadersSort?a.getHeaderSortInfo.bind(a):void 0),a.allowServerDataBinding=!1,a.setProperties({pivotValues:a.engineModule.pivotValues},!0),a.allowServerDataBinding=!0,a.enginePopulatedEventMethod("updateDataSource")),a.lastSortInfo={},a.lastAggregationInfo={},a.lastCalcFieldInfo={},a.lastFilterInfo={})})},v.prototype.refreshPageData=function(){var e={dataSourceSettings:Ce.getClonedDataSourceSettings(this.dataSourceSettings)};this.actionBeginMethod(),this.showWaitingPopup(),this.trigger(_,e),"pivot"===this.dataType&&("Server"===this.dataSourceSettings.mode?this.getEngine("onPageChange",null,null,null,null,null,null):this.engineModule.generateGridData(this.dataSourceSettings,!0,!1,this.engineModule.headerCollection),this.setProperties({pivotValues:this.engineModule.pivotValues},!0),this.enginePopulatedEventMethod("updateDataSource")),this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&this.actionCompleteMethod()},v.prototype.excelExport=function(e,t,i,a){"Server"===this.dataSourceSettings.mode?this.getEngine("onExcelExport",null,null,null,null,null,null,null,null,e):(this.enableVirtualization||this.enablePaging||this.allowEngineExport||this.allowConditionalFormatting&&0<this.dataSourceSettings.conditionalFormatSettings.length?this.excelExportModule.exportToExcel("Excel",e,a):(this.exportType="Excel",this.grid.excelExport(e,t,i,a)),this.actionObj.actionName=this.getActionCompleteName(),t={exportInfo:{type:this.exportType,info:e}},this.actionObj.actionInfo=t,this.actionObj.actionName&&this.actionCompleteMethod())},v.prototype.csvExport=function(e,t,i,a){"Server"===this.dataSourceSettings.mode?this.getEngine("onCsvExport",null,null,null,null,null,null,null,null,e):(this.enableVirtualization||this.enablePaging||this.allowEngineExport||this.allowConditionalFormatting&&0<this.dataSourceSettings.conditionalFormatSettings.length?this.excelExportModule.exportToExcel("CSV",e,a):(this.exportType="CSV",this.grid.csvExport(e,t,i,a)),this.actionObj.actionName=this.getActionCompleteName(),t={exportInfo:{type:this.exportType,info:e}},this.actionObj.actionInfo=t,this.actionObj.actionName&&this.actionCompleteMethod())},v.prototype.gridPdfExport=function(e,t,i,a){t={pdfExportProperties:e,isMultipleExport:t,isBlob:a,pdfDoc:i,currentExportView:"Table",pdfMargins:{}},a=null,this.trigger(B,t),this.pdfExportModule&&(this.pdfExportModule.exportProperties=t),a=this.enableVirtualization||this.enablePaging||this.allowEngineExport||0<Object.keys(t.pdfMargins).length||t.height||t.width||this.allowConditionalFormatting&&0<this.dataSourceSettings.conditionalFormatSettings.length&&("Server"!==this.dataSourceSettings.mode||(this.enableVirtualization||this.enablePaging)&&"Server"===this.dataSourceSettings.mode&&this.allowConditionalFormatting&&0<this.dataSourceSettings.conditionalFormatSettings.length)?this.pdfExportModule.exportToPDF(t.pdfExportProperties,t.isMultipleExport,t.pdfDoc,t.isBlob):this.grid.pdfExport(t.pdfExportProperties,t.isMultipleExport,t.pdfDoc,t.isBlob),this.actionObj.actionName=this.getActionCompleteName(),i={exportInfo:{type:"PDF",info:e}};return this.actionObj.actionInfo=i,this.actionObj.actionName&&this.actionCompleteMethod(),a},v.prototype.chartExport=function(e,t,i,a,r){i={pdfExportProperties:t,isMultipleExport:i,isBlob:r,pdfDoc:a,type:e,currentExportView:"Chart",pdfMargins:{}},this.trigger(B,i),r=(this.chartExportModule.exportProperties=i).fileName||(Ue.isNullOrUndefined(t)||Ue.isNullOrUndefined(t.fileName)?"default":t.fileName),t="PDF"===e?this.chartExportModule.pdfChartExport(i.pdfExportProperties,i.pdfDoc,i.isMultipleExport,i.isBlob):(a=0===i.orientation||i.orientation?i.orientation:Ue.isNullOrUndefined(t)||Ue.isNullOrUndefined(t.pageOrientation)||"Landscape"===t.pageOrientation?j.PdfPageOrientation.Landscape:j.PdfPageOrientation.Portrait,this.chart.exportModule.export(i.type,r,a,null)),this.actionObj.actionName=this.getActionCompleteName(),i={exportInfo:{type:e,info:r}};return this.actionObj.actionInfo=i,this.actionObj.actionName&&this.actionCompleteMethod(),t},v.prototype.pdfExport=function(i,a,r,n,s){var o=this,l=null;return new Promise(function(t){var e;s&&"Both"===o.displayOption.view?"Chart"===o.displayOption.primary?o.chartExport("PDF",i,!0,r,!1).then(function(e){l=o.gridPdfExport(i,a,e,n),t(l)}):o.gridPdfExport(i,!0,r,!1).then(function(e){l=o.chartExport("PDF",i,a,e,n),t(l)}):(e=o.gridPdfExport(i,a,r,n),t(e))})},v.prototype.printChart=function(){this.chart&&this.chart.print()},v.prototype.onDrill=function(e,t){var i=this,a=this.dataSourceSettings.drilledMembers[0]&&this.dataSourceSettings.drilledMembers[0].delimiter?this.dataSourceSettings.drilledMembers[0].delimiter:"**",r="",n="",s="",s=t?(r=t.fieldName,n=t.cell.axis,t.isDrilled?"up":"down"):(r=("row"===(n=e.parentElement.classList.contains($r)?"row":"column")?Ue.closest(e,"td"):Ue.closest(e,"th")).getAttribute("fieldname"),e.classList.contains(Xr)?"up":"down");if("pivot"===this.dataType){var o=Ce.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers),l="row"===n?Number(Ue.closest(e,"td").getAttribute("data-colindex")):Number(Ue.closest(e,"th").getAttribute("data-colindex")),d="row"===n?Number(Ue.closest(e,"td").getAttribute("index")):Number(Ue.closest(e,"th").getAttribute("index")),d=t?t.cell:this.engineModule.pivotValues[d][l],p=d.valueSort.levelName.split(this.engineModule.valueSortSettings.headerDelimiter).join(a),h=!1;if(0===this.dataSourceSettings.drilledMembers.length)this.setProperties({dataSourceSettings:{drilledMembers:[{name:r,items:[p],delimiter:a}]}},!0);else{for(var u=Ce.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers),c=0;c<u.length;c++){var g,m=u[c],p=p.split(a).join(m.delimiter||a),a=m.delimiter=m.delimiter||a;m.name===r&&(h=!0,-1<(g=m.items.indexOf(p))?m.items.splice(g,1):m.items.push(p))}this.setProperties({dataSourceSettings:{drilledMembers:u}},!0),h||this.dataSourceSettings.drilledMembers.push({name:r,items:[p],delimiter:a})}this.showWaitingPopup();var S=this,f={fieldName:r,memberName:p,delimiter:a,axis:n,action:s,currentCell:d};S.trigger(ce,{drillInfo:f,pivotview:S,cancel:!1},function(e){e.cancel?(i.hideWaitingPopup(),i.setProperties({dataSourceSettings:{drilledMembers:o}},!0)):(e={dataSourceSettings:Ce.getClonedDataSourceSettings(i.dataSourceSettings)},S.trigger(_,e),S.setProperties({dataSourceSettings:e.dataSourceSettings},!0),S.enableVirtualization||S.enablePaging?"Server"===i.dataSourceSettings.mode?i.getEngine("onDrill",f,null,null,null,null,null):(S.engineModule.drilledMembers=S.dataSourceSettings.drilledMembers,S.engineModule.onDrill(f)):"Server"===i.dataSourceSettings.mode?i.getEngine("onDrill",f,null,null,null,null,null):S.engineModule.generateGridData(S.dataSourceSettings,!0),S.allowServerDataBinding=!1,S.setProperties({pivotValues:S.engineModule.pivotValues},!0),S.allowServerDataBinding=!0,e={dataSourceSettings:Ce.getClonedDataSourceSettings(e.dataSourceSettings),pivotValues:i.pivotValues},i.trigger(U,e),S.engineModule.pivotValues=e.pivotValues,i.actionObj.actionInfo={drillInfo:f},S.renderPivotGrid())})}else this.onOlapDrill(r,n,s,a,e,t)},v.prototype.onOlapDrill=function(k,e,t,j,i,a){var r=this,n=this,s=Ce.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers),a=(i=a?a.cell:(a="row"===e?Number(Ue.closest(i,"td").getAttribute("data-colindex")):Number(Ue.closest(i,"th").getAttribute("data-colindex")),i="row"===e?Number(Ue.closest(i,"td").getAttribute("index")):Number(Ue.closest(i,"th").getAttribute("index")),this.olapEngineModule.pivotValues[i][a]),("row"===e?this.olapEngineModule.tupRowInfo:this.olapEngineModule.tupColumnInfo)[i.ordinal]),o={axis:e,action:t,fieldName:k,delimiter:"~~",memberName:a.uNameCollection,currentCell:i},t=(this.showWaitingPopup(),{drillInfo:o,pivotview:n,cancel:!1}),l=this.olapEngineModule.fieldList[o.fieldName]&&this.olapEngineModule.fieldList[o.fieldName].isHierarchy,d=a.drillInfo.map(function(e){return e.hierarchy}).indexOf(i.hierarchy.toString()),p=Ce.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers);if(o&&"down"===o.action){for(var h=a.drillInfo.map(function(e){return e.uName}),u="",c=0;c<=d;c++)u=u+(""!==u?"~~":"")+(P=(O=h[c]).split("~~"))[P.length-1];for(var g=this.olapEngineModule.getDrilledSets(o.memberName,i,this.olapEngineModule.fieldList[i.hierarchy]&&!this.olapEngineModule.fieldList[i.hierarchy].hasAllMember?i.valueSort.levelName.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length-1:d,e),m=0,S=N=Object.keys(g);m<S.length;m++)for(var f=g[S[m]],v=0,y=p.length;v<y;v++){for(var b=p[v],C=f,x=(b.delimiter&&(C=C.replace(/~~/g,b.delimiter)),[]),w=0;w<b.items.length;w++)0!==b.items[w].indexOf(C)&&(x[x.length]=b.items[w]);b.items=x}this.olapEngineModule.drilledSets[i.actualText]=a.members[d],o.memberName=u;for(var T=[],M=0,D=p;M<D.length;M++)(O=D[M]).name===o.fieldName&&T.push(O);if(0<T.length){if(T[0].delimiter&&(u=u.replace(/~~/g,T[0].delimiter)),-1===Ce.inArray(u,T[0].items)&&T[0].items.push(u),l)for(v=0;v<T[0].items.length;)T[0].items[v]===u?T[0].items.splice(v,1):++v}else l||(I={name:o.fieldName,items:[u],delimiter:"~~"},p?p.push(I):p=[I]);t.drillInfo.memberName=u,this.setProperties({dataSourceSettings:{drilledMembers:p}},!0),n.trigger(ce,t,function(e){e.cancel?(r.hideWaitingPopup(),r.setProperties({dataSourceSettings:{drilledMembers:s}},!0)):(e={dataSourceSettings:Ce.getClonedDataSourceSettings(r.dataSourceSettings)},r.trigger(_,e),r.setProperties({dataSourceSettings:e.dataSourceSettings},!0),r.olapEngineModule.updateDrilledInfo(r.dataSourceSettings),r.allowServerDataBinding=!1,r.setProperties({pivotValues:r.olapEngineModule.pivotValues},!0),r.allowServerDataBinding=!0,e={dataSourceSettings:Ce.getClonedDataSourceSettings(e.dataSourceSettings),pivotValues:n.olapEngineModule.pivotValues},r.trigger(U,e),r.olapEngineModule.pivotValues=e.pivotValues,r.renderPivotGrid())})}else{delete this.olapEngineModule.drilledSets[i.actualText];for(var O,P,g=this.olapEngineModule.getDrilledSets(o.memberName,i,d,e),N=Object.keys(g),h=a.drillInfo.map(function(e){return e.uName}),u="",c=0;c<=d;c++)u=u+(""!==u?"~~":"")+(P=(O=h[c]).split("~~"))[P.length-1];for(var E=0,F=N;E<F.length;E++){for(var I,f=g[F[E]],L=[],v=0,y=p.length;v<y;v++){var A=f;if((T=p[v]).name===o.fieldName&&L.push(T),T.delimiter&&(A=f.replace(/~~/g,T.delimiter)),!l){for(x=[],w=0;w<T.items.length;w++)0!==T.items[w].indexOf(A)&&(x[x.length]=T.items[w]);T.items=x}}l&&(0<L.length?(L[0].delimiter&&(u=u.replace(/~~/g,L[0].delimiter)),-1===Ce.inArray(u,L[0].items)&&L[0].items.push(u)):(I={name:o.fieldName,items:[u],delimiter:"~~"},p?p.push(I):p=[I]))}for(var q=[],R=0,V=p;R<V.length;R++){var H=V[R];0<H.items.length&&q.push(H)}this.setProperties({dataSourceSettings:{drilledMembers:p}},!0),n.trigger(ce,t,function(e){e.cancel?(r.hideWaitingPopup(),r.setProperties({dataSourceSettings:{drilledMembers:s}},!0)):(e={dataSourceSettings:Ce.getClonedDataSourceSettings(r.dataSourceSettings)},r.trigger(_,e),r.setProperties({dataSourceSettings:e.dataSourceSettings},!0),r.setProperties({dataSourceSettings:{drilledMembers:q}},!0),r.olapEngineModule.updateDrilledInfo(r.dataSourceSettings),r.allowServerDataBinding=!1,r.setProperties({pivotValues:r.olapEngineModule.pivotValues},!0),r.allowServerDataBinding=!0,e={dataSourceSettings:Ce.getClonedDataSourceSettings(e.dataSourceSettings),pivotValues:n.olapEngineModule.pivotValues},r.trigger(U,e),r.olapEngineModule.pivotValues=e.pivotValues,r.renderPivotGrid())})}},v.prototype.onContentReady=function(){var e,t,i,a,r,n,s,o,l=w.getScrollBarWidth(),d=(this.isPopupClicked=!1,this.showFieldList&&this.pivotFieldListModule&&"Server"!==this.dataSourceSettings.mode?(this.pivotFieldListModule.element.style.display="block",P.hideSpinner(this.pivotFieldListModule.fieldListSpinnerElement)):this.fieldListSpinnerElement&&P.hideSpinner(this.fieldListSpinnerElement),this.isEmptyGrid?0<this.pivotValues.length&&(this.isEmptyGrid=!1,this.notEmpty=!0):("Server"===this.dataSourceSettings.mode&&this.isServerWaitingPopup||"Local"===this.dataSourceSettings.mode)&&this.hideWaitingPopup(),this.element.querySelector("."+Un)?this.element.querySelector("."+Un):this.element.querySelector("."+Ya)),p=this.element.querySelector("."+Gn),h=this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage&&"pivot"===this.dataType;this.grid&&(n=this.element.querySelector("."+ts),o=d.parentElement.offsetWidth<d.querySelector("."+c).offsetWidth,s="pivot"===this.dataType?this.engineModule:this.olapEngineModule,this.enableVirtualization&&s&&this.virtualscrollModule&&(h&&this.element.querySelector("."+Os)&&(Ue.removeClass([p,d],["e-virtual-pivot-content"]),Ue.addClass([this.element.querySelector("."+Os)],[Ps]),this.grid)&&this.grid.element.querySelector(".e-spinner-inner")&&Ue.removeClass([this.grid.element.querySelector(".e-spinner-inner")],[Ps]),h&&((r=this.element.querySelector("."+Os))||(r=Ue.createElement("div",{className:Os+" "+Ps,innerHTML:this.localeObj.getConstant("loading")}),this.grid.element&&!this.element.querySelector("."+Os)&&this.grid.element.insertBefore(r,this.grid.element.firstElementChild)),this.element.querySelector("."+Yn))&&this.element.querySelector("."+ts)&&(t=this.element.querySelector("."+ts).offsetHeight+this.element.querySelector("."+Yn).offsetHeight,Ue.setStyleAttribute(r,{height:t+"px",width:this.element.querySelector("."+Yn).offsetWidth+"px",padding:Math.floor(t/2)+"px"})),this.element.querySelector("."+Ya)&&!this.element.querySelector("."+Ya).querySelector("."+Hn)&&(this.virtualDiv=Ue.createElement("div",{className:Hn}),this.element.querySelector("."+Ya).appendChild(this.virtualDiv)),this.element.querySelector("."+Gn)&&!this.element.querySelector("."+Gn).querySelector("."+Hn)?(this.virtualHeaderDiv=Ue.createElement("div",{className:Hn}),this.element.querySelector("."+Gn).appendChild(this.virtualHeaderDiv)):this.virtualHeaderDiv=this.element.querySelector("."+Gn).querySelector("."+Hn),r=n.querySelector("."+_n),n&&!r&&(this.virtualTableDiv=Ue.createElement("div",{className:_n}),n.appendChild(this.virtualTableDiv),r=n.querySelector("."+_n),this.virtualScrollDiv=Ue.createElement("div",{className:Bn}),r.appendChild(this.virtualScrollDiv),Ue.setStyleAttribute(r,{minHeight:l+"px",maxHeight:l+"px",overflowX:"scroll"}),Ue.setStyleAttribute(this.virtualScrollDiv,{height:"0.1px"}),(t=Ue.createElement("div",{className:Un})).append.apply(t,Array.prototype.slice.call(d.childNodes)),d.appendChild(t),t.scrollLeft=0),t=this.element.querySelector("."+Ya).querySelector("."+c),(t=this.gridSettings.rowHeight*s.rowCount+.1-t.clientHeight)>this.scrollerBrowserLimit&&(this.verticalScrollScale=t/this.scrollerBrowserLimit,t=this.scrollerBrowserLimit),(e=this.gridSettings.columnWidth*s.columnCount)>this.scrollerBrowserLimit&&(this.horizontalScrollScale=e/this.scrollerBrowserLimit,e=this.scrollerBrowserLimit),Ue.setStyleAttribute(this.virtualDiv,{height:(.1<t?t:.1)+"px",width:(.1<e?e:.1)+"px"}),Ue.setStyleAttribute(this.virtualHeaderDiv,{height:0,width:(.1<e?e:.1)+"px"}),this.isAdaptive&&(d.style.minHeight="1px",d.style.minHeight="1px"),s=!this.isAdaptive&&n.querySelector("."+_n)?n.querySelector("."+_n):d,t=d.parentElement.scrollTop>this.scrollerBrowserLimit?d.querySelector("."+c).style.transform.split(",")[1].trim():(h?d.parentElement.scrollTop:-(d.parentElement.scrollTop*this.verticalScrollScale-this.scrollPosObject.verticalSection-d.parentElement.scrollTop))+"px)",Number(t.split("px")[0])>this.virtualDiv.clientHeight&&(t=this.virtualDiv.clientHeight+"px)"),a=(i=Math.abs(s.scrollLeft))>this.scrollerBrowserLimit?d.querySelector("."+c).style.transform.split(",")[0].trim()+",":"translate("+(this.enableRtl?1:-1)*(i*this.horizontalScrollScale-this.scrollPosObject.horizontalSection-i)+"px,",Ue.setStyleAttribute(d.querySelector("."+c),{transform:a+t}),Ue.setStyleAttribute(p.querySelector("."+c),{transform:a+"0px)"}),!o&&n&&r||this.isAdaptive?r.style.display="none":r.style.display="block",r=Number(-d.querySelector("."+c).style.transform.split("(")[1].split(",")[0].split("px")[0]),this.virtualscrollModule.alignFreezedCells(r,!0),o&&(o=0,o=this.pivotColumns.length<25?e+d.querySelector("."+c).querySelector("."+Ds).offsetWidth+(n.offsetWidth-n.clientWidth):e+(n.offsetWidth-n.clientWidth),"auto"!==this.grid.height?this.grid.element.querySelector("."+Bn).style.width=o+l+"px":this.grid.element.querySelector("."+Bn).style.width=o+"px"),this.grid.element.querySelector("."+Un)&&d.parentElement.scrollHeight===d.scrollHeight&&(d.style.overflowY=""),n="pivot"===this.dataType&&"column"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1,o=this.pageSettings.columnPageSize*n*this.gridSettings.columnWidth,n=s.scrollWidth-(Math.abs(i)+s.offsetWidth),this.virtualscrollModule)&&0<o&&n<=o&&0<i&&(s=void 0,(o=d.scrollWidth-(Math.abs(d.scrollLeft)+d.parentElement.offsetWidth))<1&&"horizondal"===this.scrollDirection&&(0<d.parentElement.scrollTop&&(s=d.parentElement.scrollTop),this.virtualDiv.style.display="none",o=d.scrollWidth-(Math.abs(d.scrollLeft)+d.parentElement.offsetWidth)),this.virtualDiv.style.display="",s&&(d.parentElement.scrollTop=s),s=d.scrollWidth-(Math.abs(d.scrollLeft)+d.parentElement.offsetWidth),1<o&&(this.scrollPosObject.horizontalSection-=n<=0?n<o?o:-s:s===o?o-n:o<s&&(n==s||o<n)?-(s-o):0,"auto"!==this.grid.height&&(this.scrollPosObject.horizontalSection-=l),this.scrollPosObject.horizontalSection=this.scrollPosObject.horizontalSection>=-this.element.querySelector("."+Dn).querySelector("."+en+"."+Ds).offsetWidth?this.scrollPosObject.horizontalSection:-this.element.querySelector("."+Dn).querySelector("."+en+"."+Ds).offsetWidth),a=i>this.scrollerBrowserLimit?d.querySelector("."+c).style.transform.split(",")[0].trim()+",":"translate("+(this.enableRtl?1:-1)*(i*this.horizontalScrollScale-this.scrollPosObject.horizontalSection-i)+"px,",Ue.setStyleAttribute(d.querySelector("."+c),{transform:a+t}),Ue.setStyleAttribute(p.querySelector("."+c),{transform:a+"0px)"}),r=Number(-d.querySelector("."+c).style.transform.split("(")[1].split(",")[0].split("px")[0]),this.virtualscrollModule.alignFreezedCells(r,!0)),"Chart"!==this.currentView&&this.grid.hideScroll(),this.showGroupingBar?(this.groupingBarModule&&this.element.querySelector("."+wr)&&this.groupingBarModule.setGridRowWidth(),this.actionObj.fieldInfo&&this.actionObj.fieldInfo.fieldName&&(n=this.pivotButtonModule.parentElement.querySelector('[data-uid="'+this.actionObj.fieldInfo.fieldName+'"]'),Ue.isNullOrUndefined(n)||n.focus()),this.element.style.minWidth="400px",this.grid.element.style.minWidth="400px"):(this.element.style.minWidth="310px",this.grid.element.style.minWidth="310px")),this.unwireEvents(),this.wireEvents(),this.isChartLoaded=!1,this.isEmptyGrid||this.trigger(ie),this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&(this.actionObj.actionName===la&&this.pivotCommon&&this.pivotCommon.filterDialog&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.pivotCommon.filterDialog.setFocus.bind(this.pivotCommon.filterDialog))),this.actionObj.actionName!==Oi)&&this.actionCompleteMethod(),this.groupingModule&&(this.groupingModule.isUpdate=!1),this.engineModule&&this.engineModule.clearProperties(),this.virtualscrollModule&&this.grid&&this.virtualscrollModule.onHorizondalScroll(p,d),!this.isAdaptive&&this.enableVirtualization&&d&&this.virtualscrollModule&&!h&&(s=d.parentElement.parentElement.querySelector(".e-movablescrolldiv"),e<3*d.parentElement.clientWidth?(d.style.overflowX="visible",s.style.display="none",p.scrollLeft=d.parentElement.scrollLeft,Ue.setStyleAttribute(d.querySelector("."+c),{transform:"translate(0px,"+t}),Ue.setStyleAttribute(p.querySelector("."+c),{transform:"translate(0px, 0px)"}),this.virtualscrollModule.alignFreezedCells(0,!0)):(Ue.EventHandler.remove(this.element.querySelector("."+ts).querySelector("."+Ya),"scroll",this.headerScrollUpdate),o=this.element.querySelector("."+ts).querySelector("."+Ya).scrollLeft,d.style.overflowX="auto",s.style.display="block",0!==o&&(s.scrollLeft=o),s.scrollLeft!==d.scrollLeft&&0!==d.scrollLeft&&(s.scrollLeft=d.scrollLeft)))},v.prototype.setToolTip=function(e){var t,i,a,r,n,s,o,l=this,d=Number(e.target.getAttribute("data-colindex")),p=Number(e.target.getAttribute("index")),h=0<this.dataSourceSettings.values.length&&this.pivotValues&&this.pivotValues[p]&&this.pivotValues[p][d]?this.pivotValues[p][d]:void 0,u=(this.tooltip.content="",!1);h&&"olap"===this.dataType?(a=h.actualText,Ue.isNullOrUndefined(a)||!this.olapEngineModule.fieldList||this.olapEngineModule.fieldList[a]||(n=this.olapEngineModule.tupRowInfo,a=-1<h.rowOrdinal&&0<n.length&&n[h.rowOrdinal]&&!Ue.isNullOrUndefined(n[h.rowOrdinal].measureName)?n[h.rowOrdinal].measureName:a),this.olapEngineModule.fieldList&&this.olapEngineModule.fieldList[a]&&(t=(r=this.olapEngineModule.fieldList[a]).isCalculatedField?r.type:r.aggregateType,i=(this.olapEngineModule.dataFields[a]&&this.olapEngineModule.dataFields[a].caption?this.olapEngineModule.dataFields[a]:r).caption,u=!0)):h&&this.engineModule.fieldList&&this.engineModule.fieldList[h.actualText]&&(t="DistinctCount"===(t=(r=this.engineModule.fieldList[h.actualText]).aggregateType)||"number"===r.type&&"include"!==r.type&&"exclude"!==r.type?void 0===t?"Sum":r.aggregateType:"Count",i=r.caption,u=!0),h&&u?(n=this.isTabular&&0<this.engineModule.rowMaxLevel?this.engineModule.rowMaxLevel:0,a=this.getRowText(p,n),r=this.getColText(0,d,p),u=""===h.formattedText?this.localeObj.getConstant("noValue"):h.formattedText,this.tooltipTemplate&&void 0!==this.getTooltipTemplate()?(n={rowHeaders:a,columnHeaders:r,aggregateType:t,valueField:i,value:u,rowFields:this.getHeaderField(p,d,"row"),columnFields:this.getHeaderField(p,d,"column")},"function"==typeof this.tooltipTemplate&&this.isReact?(s=document.createElement("div"),this.getTooltipTemplate()(n,this,"tooltipTemplate",this.element.id+"tooltipTemplate",null,null,s),this.renderReactTemplates(function(){l.enableHtmlSanitizer?l.tooltip.content=Ue.SanitizeHtmlHelper.sanitize(s.outerHTML):l.tooltip.content=s.outerHTML})):(p=this.getTooltipTemplate()(n,this,"tooltipTemplate",this.element.id+"tooltipTemplate")[0].outerHTML,this.enableHtmlSanitizer?this.tooltip.content=Ue.SanitizeHtmlHelper.sanitize(p):this.tooltip.content=p)):(o="<div class=e-pivottooltip><p class="+an+">"+this.localeObj.getConstant("row")+":</p><p class="+rn+">"+a+"</p></br><p class="+an+">"+this.localeObj.getConstant("column")+":</p><p class="+rn+">"+r+"</p></br>"+(""!==h.actualText?"<p class="+an+">"+("olap"===this.dataType?"":this.localeObj.getConstant(t)+" "+this.localeObj.getConstant("of")+" ")+i+":</p><p class="+rn+">"+u+"</p></div>":""),this.tooltip.content=Ue.initializeCSPTemplate(function(){return o}))):e.cancel=!0},v.prototype.getTooltipTemplate=function(){return this.tooltipTemplateFn},v.prototype.getHeaderField=function(e,t,i){var a="",r="olap"===this.dataType?this.olapEngineModule:this.engineModule,n=r.valueSortSettings.headerDelimiter;if("row"===i)for(var s=this.pivotValues[e][0].valueSort.levelName.toString().split(n).length,o=0;o<s&&0<this.dataSourceSettings.rows.length&&this.dataSourceSettings.rows[o];o++)a+=(o?" - ":"")+(this.dataSourceSettings.rows[o].caption||this.dataSourceSettings.rows[o].name);else{0<this.dataSourceSettings.columns.length&&(i=0===this.dataSourceSettings.values.length?0:Number(Object.keys(r.headerContent)[Object.keys(r.headerContent).length-1]),s=this.pivotValues[i][t].valueSort.levelName.toString().split(n).length,s=1<this.dataSourceSettings.values.length?s-1:s);for(var l=0;l<s&&0<this.dataSourceSettings.columns.length&&this.dataSourceSettings.columns[l];l++)a+=(l?" - ":"")+(this.dataSourceSettings.columns[l].caption||this.dataSourceSettings.columns[l].name)}return a},v.prototype.getLevel=function(e){var t=e.valueSort?e.valueSort.levelName.toString():"",e=e.actualText?e.actualText.toString().split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,t=t.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length-(e&&e-1);return t?t-1:0},v.prototype.getRowText=function(e,t){var i=this.pivotValues[e][t],a="";if(i){var r=this.getLevel(i),a="grand sum"===i.type?this.localeObj.getConstant("grandTotal"):i.formattedText;if("row"===this.dataSourceSettings.valueAxis)a=(a=0===this.dataSourceSettings.rows.length&&1<this.dataSourceSettings.values.length?this.pivotValues[e][0].valueSort.levelName.toString().slice((this.localeObj.getConstant("grandTotal")+this.dataSourceSettings.valueSortSettings.headerDelimiter).length).toString():1===this.dataSourceSettings.values.length?Ue.isNullOrUndefined(this.dataSourceSettings.values[0].caption)?this.dataSourceSettings.values[0].name:this.dataSourceSettings.values[0].caption:this.pivotValues[e][0].valueSort.levelName.toString()).split(this.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - ");else if(this.isTabular)a=(i=this.pivotValues[e][t]).valueSort.levelName.toString();else for(;0<r||void 0===i.index;)void 0!==(i=this.pivotValues[--e][t]).index&&r>i.level&&(a=a+this.dataSourceSettings.valueSortSettings.headerDelimiter+i.formattedText,r-=1);a=(this.isTabular?a.split(this.dataSourceSettings.valueSortSettings.headerDelimiter):a.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).reverse()).join(" - ")}return a},v.prototype.getColText=function(e,t,i){for(var a=this.pivotValues[0][t],r=a.axis,n="grand sum"===a.type?this.localeObj.getConstant("grandTotal"):a.formattedText;"value"!==r&&e<i;)this.pivotValues[++e]&&(r=(a=this.pivotValues[e][t]).axis,"sum"!==a.type)&&"grand sum"!==a.type&&"value"!==r&&(n=n+" - "+a.formattedText);return n},v.prototype.updateClass=function(){this.enableRtl?Ue.addClass([this.element],xa):Ue.removeClass([this.element],xa),this.isAdaptive?Ue.addClass([this.element],wa):Ue.removeClass([this.element],wa),this.cssClass&&Ue.addClass([this.element],this.cssClass.split(" "))},v.prototype.mouseRclickHandler=function(e){3!==e.which&&0!==e.which||(this.lastCellClicked=e.target),this.lastCellClicked=e.target},v.prototype.mouseDownHandler=function(e){3===e.which&&(this.lastCellClicked=e.target),this.isCellBoxMultiSelection&&(this.isMouseDown=!0,this.isMouseUp=!1,this.lastSelectedElement=void 0)},v.prototype.mouseMoveHandler=function(e){var t,i,a=this;this.isCellBoxMultiSelection&&(e.preventDefault(),this.isMouseDown)&&e.target&&(i="column"==((i=e.target).parentElement.classList.contains($r)||i.classList.contains($r)?"row":"column")?Ue.closest(i,"th"):Ue.closest(i,"td"))&&(e=Number(i.getAttribute("data-colindex")),t=Number(i.getAttribute("index")),t={cancel:!1,isCellClick:!0,currentCell:i,data:this.pivotValues[t][e]},this.trigger(ue,t,function(e){e.cancel||(a.grid.clearSelection(),e=a.parentAt(i,"TH"),a.lastSelectedElement&&a.lastSelectedElement!==e&&e.classList.contains(Wn)?(a.lastSelectedElement.classList.remove(Jn),a.lastSelectedElement.classList.remove(Wn),a.lastSelectedElement=e):(a.lastSelectedElement=e).classList.contains(en)&&e.classList.contains(Ds)||(e.classList.add(Jn),e.classList.add(Wn)),a.renderModule.selected())}))},v.prototype.mouseUpHandler=function(){this.isCellBoxMultiSelection&&(this.isMouseDown=!1,this.isMouseUp=!0)},v.prototype.parentAt=function(e,t){for(;e.tagName!==t&&e.parentElement;)e=e.parentElement;return e},v.prototype.mouseClickHandler=function(e){3!==e.which&&0!==e.which||(this.lastCellClicked=e.target);var t=e.target;if(!Ue.closest(t,"."+Q)){var i=null,a=t.parentElement&&t.parentElement.classList.contains($r)||t.classList.contains($r)?"row":"column",i="column"==a?Ue.closest(t,"th"):Ue.closest(t,"td");if("column"!=a||i||"Row"===this.gridSettings.selectionSettings.mode||(i=Ue.closest(t,"td")),t.classList.contains(Xr)||t.classList.contains(Jr)||!this.enableValueSorting||t.classList.contains("e-resized")||t.classList.contains("e-rhandler")&&t.classList.contains("e-rcursor")||"olap"===this.dataType&&this.enableVirtualization)if(t.classList.contains(Xr)||t.classList.contains(Jr)){a=t.parentElement.getAttribute("fieldname"),n=Ce.getFieldInfo(a,this),a=t.classList.contains(Xr)?this.actionObj.actionName=jt:t.classList.contains(Jr)?this.actionObj.actionName=qt:"";if(this.actionObj.actionName=a,this.actionObj.fieldInfo=n.fieldItem,!this.actionBeginMethod())try{this.onDrill(t)}catch(e){this.actionFailureMethod(e)}}else this.cellClicked(t,i,e);else{a="pivot"===this.dataType?this.engineModule:this.olapEngineModule;this.cellClicked(t,i,e);try{if(i&&(i.parentElement.parentElement.parentElement.parentElement.classList.contains(Yn)&&"column"===this.dataSourceSettings.valueAxis&&!i.classList.contains(Ds)||i.parentElement.classList.contains("e-row")&&"row"===this.dataSourceSettings.valueAxis&&(i.classList.contains("e-rowsheader")||i.classList.contains("e-stot")))){var r=i.getAttribute("fieldname"),n=Ce.getFieldInfo(r,this);if(this.actionObj.actionName=kt,this.actionObj.fieldInfo=n.fieldItem,!this.actionBeginMethod()){var s,o=Number(i.getAttribute("data-colindex")),l=Number(i.getAttribute("index")),d=("row"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)?(s=this.pivotValues[l][o],l=-1===this.dataSourceSettings.valueIndex?"value"===s.type||3===s.memberType?l:l+1:this.getLevel(s)<=a.measureIndex&&s.members&&0<s.members.length?s.members[0].rowIndex:l):"column"===this.dataSourceSettings.valueAxis&&(1<this.dataSourceSettings.values.length||this.dataSourceSettings.alwaysShowValueHeader)&&(o=Number(i.getAttribute("data-colindex"))+Number(i.getAttribute("aria-colspan"))-1,l=a.headerContent.length-1),this.setProperties({dataSourceSettings:{valueSortSettings:{columnIndex:Number(i.getAttribute("data-colindex"))+Number(i.getAttribute("aria-colspan"))-1,sortOrder:"Descending"===this.dataSourceSettings.valueSortSettings.sortOrder?"Ascending":"Descending",headerText:this.pivotValues[l][o].valueSort.levelName,headerDelimiter:this.dataSourceSettings.valueSortSettings.headerDelimiter||"."}}},!0),this.showWaitingPopup(),this);if(a.enableValueSorting=!0,d.enableVirtualization||d.enablePaging){if(d.dataSourceSettings.enableSorting){for(var p=0,h=Object.keys(d.engineModule.fieldList);p<h.length;p++){var u=h[p];d.engineModule.fieldList[u].sort="Ascending"}d.setProperties({dataSourceSettings:{sortSettings:[]}},!0)}"Server"===d.dataSourceSettings.mode?d.getEngine("onValueSort",null,null,null,null,null,null):(d.engineModule.rMembers=d.engineModule.headerCollection.rowHeaders,d.engineModule.cMembers=d.engineModule.headerCollection.columnHeaders,d.engineModule.applyValueSorting(),d.engineModule.updateEngine())}else"Server"===d.dataSourceSettings.mode?d.getEngine("onValueSort",null,null,null,null,null,null):"olap"===this.dataType?d.olapEngineModule.onSort(d.dataSourceSettings,!0):d.engineModule.generateGridData(d.dataSourceSettings,!0);d.allowServerDataBinding=!1,d.setProperties({pivotValues:a.pivotValues},!0),d.allowServerDataBinding=!0;var c={valueSortInfo:a.valueSortSettings};this.actionObj.actionInfo=c,d.renderPivotGrid()}}}catch(e){this.actionFailureMethod(e)}}}},v.prototype.updateTotColWidth=function(){for(var e=this.totColWidth=0,t=this.pivotColumns;e<t.length;e++){var i=t[e];this.totColWidth=this.totColWidth+i.width}},v.prototype.framePivotColumns=function(e){for(var t=0,i=e;t<i.length;t++){var a,r,n=i[t];n.columns&&0<n.columns.length?this.framePivotColumns(n.columns):(a="0.formattedText"!==n.field&&n.customAttributes&&n.customAttributes.cell&&n.customAttributes.cell.valueSort?n.customAttributes.cell.valueSort.levelName:"",r=this.renderModule.setSavedWidth("0.formattedText"===n.field?n.field:a,Number("auto"===n.width?n.minWidth:n.width)),this.pivotColumns.push({allowReordering:n.allowReordering,allowResizing:n.allowResizing,headerText:a,width:r,autoFit:n.autoFit}),this.totColWidth=this.totColWidth+Number(r))}},v.prototype.setGridColumns=function(e){if(!Ue.isNullOrUndefined(this.totColWidth)&&0<this.totColWidth||this.renderModule.isAutoFitEnabled){for(var t=0,i=e;t<i.length;t++){var a,r=i[t];r.columns&&0<r.columns.length?this.setGridColumns(r.columns):this.renderModule.isAutoFitEnabled?(r.autoFit=this.pivotColumns[this.posCount].autoFit,this.posCount++):(a="0.formattedText"!==r.field&&r.customAttributes?r.customAttributes.cell.valueSort.levelName:"",r.allowReordering=this.pivotColumns[this.posCount].allowReordering,r.allowResizing=this.pivotColumns[this.posCount].allowResizing,r.autoFit=this.pivotColumns[this.posCount].autoFit,a=this.renderModule.setSavedWidth("0.formattedText"===r.field?r.field:a,Number(this.pivotColumns[this.posCount].width)),r.autoFit?this.renderModule.isAutoFitEnabled=!0:"auto"!==r.width?r.width=a:r.minWidth=a,this.posCount++,r.allowReordering&&(this.gridSettings.allowReordering=!0),r.allowResizing&&(this.gridSettings.allowResizing=!0))}this.gridSettings.allowReordering&&w.Grid.Inject(w.Reorder),this.gridSettings.allowResizing&&w.Grid.Inject(w.Resize)}},v.prototype.fillGridColumns=function(e){for(var t=0,i=e;t<i.length;t++){var a=i[t];a.allowReordering=this.gridSettings.allowReordering,a.allowResizing=this.gridSettings.allowResizing,a.clipMode=this.gridSettings.clipMode,this.posCount++,a.columns&&0<a.columns.length&&this.fillGridColumns(a.columns)}},v.prototype.triggerColumnRenderEvent=function(e){this.pivotColumns=[],this.totColWidth=0,this.framePivotColumns(e);var t=this.pivotColumns[0].width,i={columns:this.pivotColumns,dataSourceSettings:this.dataSourceSettings,stackedColumns:this.getStackedColumns(e,[])};this.trigger(pe,i),this.updateTotColWidth(),t!==this.pivotColumns[0].width&&(this.firstColWidth=this.pivotColumns[0].width,this.renderModule.resColWidth=parseInt(this.firstColWidth.toString(),10)),this.posCount=0,this.setGridColumns(e)},v.prototype.setCommonColumnsWidth=function(e,t){for(var i=0,a=e;i<a.length;i++){var r=a[i];this.isTabular?r.index>this.engineModule.rowMaxLevel?r.columns?this.setCommonColumnsWidth(r.columns,t):this.setColumnWidth(r,t):r.width=this.firstColWidth||r.width:"0.formattedText"!==r.field?r.columns?this.setCommonColumnsWidth(r.columns,t):this.setColumnWidth(r,t):r.width=this.firstColWidth||r.width}},v.prototype.getHeightAsNumber=function(){var e,t;return isNaN(this.height)?-1<this.height.toString().indexOf("%")?(this.isAngular&&this.element&&this.element.style&&(t=window.getComputedStyle(this.element).display,this.element.style.display="block"),e=parseFloat(this.height.toString())/100*this.element.offsetHeight,this.isAngular&&this.element&&this.element.style&&(this.element.style.display=t)):-1<this.height.toString().indexOf("px")&&(e=Number(this.height.toString().split("px")[0])):e=Number(this.height),e=e<this.minHeight||"auto"===this.height?this.minHeight:e},v.prototype.getWidthAsNumber=function(){var e;return isNaN(this.width)?(-1<this.width.toString().indexOf("%")?e=parseFloat(this.width.toString())/100*this.element.offsetWidth:-1<this.width.toString().indexOf("px")&&(e=Number(this.width.toString().split("px")[0])),isNaN(e)&&(e=this.element.offsetWidth)):e=Number(this.width),e=e<400?400:e},v.prototype.getGridWidthAsNumber=function(){var e,t=this.element.offsetWidth||this.element.getBoundingClientRect().width;return isNaN(this.grid.width)?(-1<this.grid.width.toString().indexOf("%")?e=parseFloat(this.grid.width.toString())/100*t:-1<this.grid.width.toString().indexOf("px")&&(e=Number(this.grid.width.toString().split("px")[0])),isNaN(e)&&(e=t)):e=Number(this.grid.width),e},v.prototype.onWindowResize=function(){this.actionObj.actionName=Oi,this.actionBeginMethod()||(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.layoutRefresh.bind(this),500),this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&this.actionCompleteMethod())},v.prototype.refresh=function(){this.pivotRefresh()},v.prototype.layoutRefresh=function(){var e;this.element&&this.element.classList.contains("e-pivotview")&&("olap"===this.dataType?this.olapEngineModule&&this.olapEngineModule.pivotValues:this.engineModule&&this.engineModule.pivotValues)&&(this.grid&&(e="olap"===this.dataType&&0<this.olapEngineModule.pivotValues.length?this.olapEngineModule.pivotValues[0].length:0<this.dataSourceSettings.values.length&&this.engineModule&&0<this.engineModule.pivotValues.length?this.engineModule.pivotValues[0].length:2,e=this.renderModule.calculateColWidth(e),this.grid.width=this.renderModule.calculateGridWidth(),this.renderModule.calculateGridHeight(!0),this.gridSettings.allowAutoResizing&&this.setCommonColumnsWidth(this.grid.columns,e),this.triggerColumnRenderEvent(this.grid.columns),this.grid.refreshColumns(),this.renderModule.isAutoFitEnabled?this.renderModule.addPivotAutoFitClass():this.renderModule.removePivotAutoFitClass(),this.element.querySelector("."+Dn).querySelector("colGroup").innerHTML=this.grid.getHeaderContent().querySelector("colgroup").innerHTML,this.showGroupingBar&&this.groupingBarModule&&this.element.querySelector("."+wr)&&this.groupingBarModule.setGridRowWidth(),this.chart)&&this.pivotChartModule&&(this.chart.height=this.pivotChartModule.getResizedChartHeight()),this.showToolbar&&this.toolbarModule&&this.toolbarModule.toolbar&&(this.toolbarModule.toolbar.width=this.grid?this.getGridWidthAsNumber():this.getWidthAsNumber()),this.enablePaging&&this.notify(Lt,this),this.chart)&&(this.showToolbar&&"Chart"===this.currentView||!this.showToolbar)&&(this.chart.width=(this.showToolbar&&this.grid||"Both"===this.displayOption.view&&this.grid?this.getGridWidthAsNumber():this.getWidthAsNumber()).toString(),this.chart.height=this.pivotChartModule.getResizedChartHeight(),"Chart"===this.displayOption.view)&&this.showGroupingBar&&this.groupingBarModule&&this.element.querySelector("."+Ss)&&this.groupingBarModule.refreshUI()},v.prototype.cellClicked=function(e,t,i){var a,r,n,s=this;e.classList.contains($n)&&(e.classList.contains(Zn)?this.isPopupClicked=!1:this.isPopupClicked=!0),t&&!Ue.isNullOrUndefined(this.pivotValues)&&0<this.pivotValues.length?(a=Number(t.getAttribute("data-colindex")),r=Number(t.getAttribute("index")),n=Number(t.getAttribute("aria-colspan")),e={cancel:!1,isCellClick:!0,currentCell:t,data:this.pivotValues[r][a]},this.trigger(ue,e,function(e){s.gridSettings.allowSelection&&(("Both"===s.gridSettings.selectionSettings.mode?t.classList.contains(Xn):"Row"===s.gridSettings.selectionSettings.mode)?s.clearSelection(t,i):e.cancel||(s.clearSelection(t,i),s.applyColumnSelection(i,t,a,a+(0<n?n-1:0),r)),"Column"===s.gridSettings.selectionSettings.mode||t.classList.contains(Zr)||s.rowDeselect(t,i,r,s.gridSettings.selectionSettings.mode,e),"Column"===s.gridSettings.selectionSettings.mode||e.cancel||(("Multiple"===s.gridSettings.selectionSettings.type?i.ctrlKey||i.shiftKey:s.selectedRowIndex===r)?s.selectedRowIndex=void 0:(s.selectedRowIndex=r,s.grid.selectionModule.selectRow(r-s.renderModule.rowStartPos)))),s.cellClick&&e.isCellClick&&s.trigger(le,{currentCell:t,data:s.pivotValues[r][a],nativeEvent:i}),s.getSelectedCellsPos()})):this.clearSelection(null,i)},v.prototype.rowDeselect=function(e,t,i,a,r){!t.shiftKey&&!t.ctrlKey&&"Both"!==this.gridSettings.selectionSettings.mode||"Single"===this.gridSettings.selectionSettings.type?e.classList.contains(zn)||e.classList.contains(Wn)||e.classList.contains(Jn)?(Ue.removeClass(this.element.querySelectorAll("."+zn),zn),Ue.removeClass(this.element.querySelectorAll("."+Wn),Wn),Ue.removeClass(this.element.querySelectorAll("."+Jn),Jn),r.cancel?this.setSavedSelectedCells():"Cell"===a?Ue.addClass([e],[zn]):"Row"!==a&&"Single"!==this.gridSettings.selectionSettings.type||(Ue.addClass(this.element.querySelectorAll('[index="'+i+'"]'),[Wn,Jn]),"Row"!==a&&e.classList.add(zn))):r.cancel?this.setSavedSelectedCells():(Ue.removeClass(this.element.querySelectorAll("."+zn),zn),Ue.removeClass(this.element.querySelectorAll("."+Wn),Wn),Ue.removeClass(this.element.querySelectorAll("."+Jn),Jn)):(t.shiftKey||t.ctrlKey||"Both"===this.gridSettings.selectionSettings.mode)&&r.cancel&&(Ue.removeClass(this.element.querySelectorAll("."+zn),zn),Ue.removeClass(this.element.querySelectorAll("."+Wn),Wn),Ue.removeClass(this.element.querySelectorAll("."+Jn),Jn),this.setSavedSelectedCells())},v.prototype.clearSelection=function(e,t){if(!t.shiftKey&&!t.ctrlKey||"Single"===this.gridSettings.selectionSettings.type)if("Cell"===this.gridSettings.selectionSettings.mode)e&&e.classList.contains(Zr)?Ue.removeClass(this.element.querySelectorAll("."+Xn+"."+zn),zn):Ue.removeClass(this.element.querySelectorAll("."+Zr+"."+Jn),[Jn,Wn]);else if("Both"===this.gridSettings.selectionSettings.mode)if(e&&e.classList.contains(Xn))for(var i=0,a=[].slice.call(this.element.querySelectorAll("."+Wn+", ."+zn));i<a.length;i++){var r=a[i];Ue.removeClass([r],[Jn,Wn,zn])}else Ue.removeClass(this.element.querySelectorAll("."+zn),zn)},v.prototype.applyRowSelection=function(e,t,i){var a=this.engineModule.pivotValues[t][e];if(i.ctrlKey||i.shiftKey||!a||this.selectedRowIndex===t)this.selectedRowIndex=void 0;else{this.selectedRowIndex=t;for(var r=a.level,n=t;(a=this.engineModule.pivotValues[++n][e])&&r<a.level;);this.isAdaptive?this.rowRangeSelection={enable:!0,startIndex:t-this.renderModule.rowStartPos,endIndex:n-(1+this.renderModule.rowStartPos)}:this.grid.selectionModule.selectRowsByRange(t-this.renderModule.rowStartPos,n-(1+this.renderModule.rowStartPos))}},v.prototype.applyColumnSelection=function(e,t,i,a,r){if(!t.classList.contains($r)&&("Cell"!==this.gridSettings.selectionSettings.mode||t.classList.contains(Zr))){for(var n=e.ctrlKey,s=(this.isAdaptive&&"Multiple"===this.gridSettings.selectionSettings.type&&(this.grid.selectionModule.showPopup(e),n=this.isPopupClicked?(this.element.querySelector("."+$n).classList.add(Zn),!0):(this.element.querySelector("."+$n).classList.remove(Zn),!1)),[]),o=this.gridSettings.selectionSettings.type,l=t.classList.contains(Jn),d=[],p={},h=i;h<=a;h++)d.push(h.toString());if(n&&"Single"!==o)l=!1;else{for(var u=0,c=[].slice.call(this.element.querySelectorAll("."+Jn));u<c.length;u++){var g=c[u],m=(Ue.removeClass([g],[Jn,Wn]),-1===d.indexOf(g.getAttribute("data-colindex"))&&(l=!1),Number(g.getAttribute("data-colindex")));p[m]=m}d=0<Object.keys(p).length?Object.keys(p).sort(function(e,t){return parseInt(e,10)-parseInt(t,10)}):d}"Multiple"===o&&e.shiftKey?(this.shiftLockedPos=0===this.shiftLockedPos.length?d:this.shiftLockedPos,Number(this.shiftLockedPos[0])<=i?i=Number(this.shiftLockedPos[0]):a=a<Number(this.shiftLockedPos[this.shiftLockedPos.length-1])?Number(this.shiftLockedPos[this.shiftLockedPos.length-1]):a):this.shiftLockedPos=[];var S=[];if(e.ctrlKey&&"Both"===this.gridSettings.selectionSettings.mode&&"Multiple"===o&&!t.classList.contains($r))for(var f=0,v=[].slice.call(this.element.querySelectorAll("."+$r+"."+zn));f<v.length;f++){g=v[f];S.push(g.getAttribute("index"))}for(var y=i;y<=a;)s.push('[data-colindex="'+y+'"]'+("Cell"===this.gridSettings.selectionSettings.mode?'[index="'+r+'"]':"")),y++;if(!l){r=t.classList.contains(en)?r:this.renderModule.rowStartPos-1;for(var b=t.classList.contains(Jn),C=0,x=[].slice.call(this.element.querySelectorAll(s.toString()));C<x.length;C++){g=x[C];Number(g.getAttribute("index"))>=r&&(b&&n&&-1===S.indexOf(g.getAttribute("index"))?Ue.removeClass([g],[Jn,Wn]):Ue.addClass([g],[Jn,Wn]))}}this.renderModule.selected()}},v.prototype.getSelectedCellsPos=function(){this.savedSelectedCellsPos=[],this.cellSelectionPos=[];for(var e=0,t=[].slice.call(this.element.querySelectorAll("."+Wn));e<t.length;e++){var i=t[e];this.savedSelectedCellsPos.push({rowIndex:i.getAttribute("index"),colIndex:i.getAttribute("data-colindex")})}for(var a=0,r=[].slice.call(this.element.querySelectorAll("."+zn));a<r.length;a++){i=r[a];this.cellSelectionPos.push({rowIndex:i.getAttribute("index"),colIndex:i.getAttribute("data-colindex")})}},v.prototype.setSavedSelectedCells=function(){for(var e=0,t=[].slice.call(this.savedSelectedCellsPos);e<t.length;e++){var i='[data-colindex="'+(n=t[e]).colIndex+'"][index="'+n.rowIndex+'"]';Ue.addClass([this.element.querySelector(i)],[Jn,Wn])}for(var a=0,r=[].slice.call(this.cellSelectionPos);a<r.length;a++){var n,i='[data-colindex="'+(n=r[a]).colIndex+'"][index="'+n.rowIndex+'"]';Ue.addClass([this.element.querySelector(i)],[zn])}},v.prototype.renderEmptyGrid=function(){var e,t=this;this.isEmptyGrid=!0,this.notEmpty=!1,this.isInitial=!0,this.renderModule=this.renderModule||new ks(this),this.grid&&this.grid.element&&this.element.querySelector("."+Dn)?(this.notEmpty=!0,this.grid.setProperties({columns:this.renderModule.frameEmptyColumns(),dataSource:this.renderModule.frameEmptyData()},!0),this.grid.notify("datasource-modified",{}),this.grid.refreshColumns()):(this.element.querySelector("."+Dn)&&Ue.remove(this.element.querySelector("."+Dn)),this.renderModule.bindGrid(this,!0),this.grid.showSpinner=function(){},this.grid.hideSpinner=function(){},e=Ue.createElement("div",{id:this.element.id+"_grid"}),this.element.appendChild(e),this.grid.isStringTemplate=!0,this.grid.appendTo(e),this.grid.off("data-ready",this.grid.dataReady),this.grid.on("data-ready",function(){t.grid.scrollModule.setWidth(),t.grid.scrollModule.setHeight()}))},v.prototype.initEngine=function(){var i=this;if(this.element.querySelector(".e-spin-hide")&&this.showWaitingPopup(),"pivot"===this.dataType){var e=Ue.isNullOrUndefined(this.dataSourceSettings.dataSource)?Ue.isNullOrUndefined(this.engineModule.data)?void 0:this.engineModule.data[0]:this.dataSourceSettings.dataSource[0];if(e&&this.pivotCommon){e="[object Array]"===Object.prototype.toString.call(e);if(e&&"JSON"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidJSON"));if(!e&&"CSV"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidCSV"))}}e={dataSourceSettings:Ce.getClonedDataSourceSettings(this.dataSourceSettings)};this.trigger(_,e,function(e){Ce.updateDataSourceSettings(i,e.dataSourceSettings),i.updatePageSettings(!1);var t,e={mode:"",savedFieldList:void 0,pageSettings:i.pageSettings,enableValueSorting:i.enableValueSorting,isDrillThrough:i.allowDrillThrough||i.editSettings.allowEditing,localeObj:i.localeObj,fieldsType:i.fieldsType,clonedReport:i.clonedReport,globalize:i.globalize,currenyCode:i.currencyCode,enablePaging:i.enablePaging,enableVirtualization:i.enableVirtualization,allowDataCompression:i.allowDataCompression,enableHtmlSanitizer:i.enableHtmlSanitizer,enableOptimizedRendering:i.enableVirtualization&&i.virtualScrollSettings&&i.virtualScrollSettings.allowSinglePage,isTabularLayout:i.isTabular};"pivot"===i.dataType?(i.dataSourceSettings.groupSettings&&0<i.dataSourceSettings.groupSettings.length&&(t=i.engineModule.data,i.clonedDataSet=i.clonedDataSet||("CSV"===i.dataSourceSettings.type?Ce.getClonedCSVData(t):Ce.getClonedData(t)),(t=JSON.parse(i.getPersistData()).dataSourceSettings).dataSource=[],i.clonedReport=i.clonedReport||t),"Server"!==i.dataSourceSettings.mode&&i.engineModule.renderEngine(i.dataSourceSettings,e,i.aggregateCellInfo?i.getValueCellInfo.bind(i):void 0,i.onHeadersSort?i.getHeaderSortInfo.bind(i):void 0),i.allowServerDataBinding=!1,i.setProperties({pivotValues:i.engineModule.pivotValues},!0),i.allowServerDataBinding=!0,i.enginePopulatedEventMethod("initEngine")):"SSAS"===i.dataSourceSettings.providerType&&"olap"===i.dataType&&(e.savedFieldList=i.olapEngineModule.fieldList,e.savedFieldListData=i.olapEngineModule.fieldListData,Ce.renderOlapEngine(i,e),i.allowServerDataBinding=!1,i.setProperties({pivotValues:i.olapEngineModule.pivotValues},!0),i.allowServerDataBinding=!0,i.enginePopulatedEventMethod("initEngine"))})},v.prototype.enginePopulatedEventMethod=function(e,t){var i,a;"initEngine"===e?(i=t||this,this.trigger(U,{pivotValues:this.pivotValues},function(e){"olap"===i.dataType?(i.olapEngineModule.pivotValues=e.pivotValues,i.pivotValues=i.olapEngineModule.pivotValues):(i.setProperties(i.engineModule.pivotValues=e.pivotValues,!0),i.setProperties(i.pivotValues=i.engineModule.pivotValues,!0)),i.notify(Ot,{}),i.notEmpty=!0})):(e={dataSourceSettings:(a=t||this).dataSourceSettings,pivotValues:a.pivotValues},a.trigger(U,e,function(e){a.dataSourceSettings=e.dataSourceSettings,"olap"===a.dataType?(a.olapEngineModule.pivotValues=e.pivotValues,a.allowServerDataBinding=!1,a.setProperties({pivotValues:a.olapEngineModule.pivotValues},!0)):(a.engineModule.pivotValues=e.pivotValues,a.allowServerDataBinding=!1,a.setProperties({pivotValues:a.engineModule.pivotValues},!0)),a.allowServerDataBinding=!0,a.pivotCommon&&(a.pivotCommon.engineModule="olap"===a.dataType?a.olapEngineModule:a.engineModule,a.pivotCommon.dataSourceSettings=a.dataSourceSettings),a.renderPivotGrid()}))},v.prototype.generateData=function(){this.isStaticRefresh||("Chart"!==this.displayOption.view&&Ue.isNullOrUndefined(this.grid)?(this.renderEmptyGrid(),this.showWaitingPopup()):(this.showWaitingPopup(),clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.refreshData.bind(this),100)))},v.prototype.refreshData=function(){var e=this;e.isStaticRefresh?(e.isStaticRefresh=!1,e.hideWaitingPopup()):e.dataSourceSettings&&(e.dataSourceSettings.dataSource||e.dataSourceSettings.url)?e.dataSourceSettings.dataSource instanceof K.DataManager?"pivot"===e.dataType&&0<e.remoteData.length?(this.element.querySelector(".e-spinner-pane")||this.showWaitingPopup(),this.engineModule.data=e.remoteData,this.initEngine()):Ue.isNullOrUndefined(e.engineModule.data)||0!==e.engineModule.data.length?e.initEngine():(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(e.getData.bind(e),100)):""!==this.dataSourceSettings.url&&"olap"===this.dataType||e.dataSourceSettings.dataSource&&0<e.dataSourceSettings.dataSource.length||this.engineModule.data&&0<this.engineModule.data.length?("pivot"===e.dataType&&(this.hideWaitingPopup(),e.engineModule.data=e.dataSourceSettings.dataSource),e.initEngine()):"Server"===this.dataSourceSettings.mode?this.getEngine("onRefresh"):(this.notify(Ot,{}),this.hideWaitingPopup()):(this.notify(Ot,{}),this.hideWaitingPopup())},v.prototype.getValueCellInfo=function(e){return this.trigger(it,e),e},v.prototype.getHeaderSortInfo=function(e){return this.trigger(at,e),e},v.prototype.bindTriggerEvents=function(e){this.trigger(w.getObject("name",e),e)},v.prototype.getData=function(){(this.dataSourceSettings.dataSource.defaultQuery?this.dataSourceSettings.dataSource.executeQuery(this.dataSourceSettings.dataSource.defaultQuery):this.dataSourceSettings.dataSource.executeQuery(new K.Query)).then(this.executeQuery.bind(this))},v.prototype.executeQuery=function(e){this.element.querySelector(".e-spinner-pane")||this.showWaitingPopup();this.engineModule.data=e.result,this.isEmptyGrid&&!Ue.isNullOrUndefined(this.engineModule.data)&&0===this.engineModule.data.length?this.hideWaitingPopup():!Ue.isNullOrUndefined(this.engineModule.data)&&0<this.engineModule.data.length?(this.isEmptyGrid=!1,this.initEngine()):(this.isEmptyGrid=!0,this.hideWaitingPopup(),this.renderEmptyGrid(),this.engineModule.fieldList=null,this.engineModule.isEmptyData=!0,this.pivotValues=[],this.engineModule.data=[],this.notify(Ot,{}))},v.prototype.applyFormatting=function(e){if(e){for(var t=[],i=e.length,a=0;a<i;a++)void 0!==e[a]&&void 0===e[a][0]&&t.push(a);for(a=0;a<e.length;a++)for(var r=1;e[a]&&r<e[a].length;r++)if("value"===e[a][r].axis&&""!==e[a][r].formattedText){e[a][r].style=void 0,e[a][r].cssClass=void 0;for(var n=this.dataSourceSettings.conditionalFormatSettings,s=0;s<n.length;s++)!0!==n[s].applyGrandTotals&&!Ue.isNullOrUndefined(n[s].applyGrandTotals)&&e[a][r].isGrandSum||!this.checkCondition(e[a][r].value,n[s].conditions,n[s].value1,n[s].value2)||n[s].measure&&e[a][r].actualText!==n[s].measure||void 0!==n[s].measure&&""===n[s].measure||void 0!==n[s].label&&""===n[s].label||!(!n[s].label||-1<e[a][0].valueSort.levelName.indexOf(n[s].label)||-1<e[a][r].rowHeaders.indexOf(n[s].label)||-1<e[a][r].columnHeaders.indexOf(n[s].label))||(n[s].style&&n[s].style.backgroundColor&&(n[s].style.backgroundColor="#"===n[s].style.backgroundColor.charAt(0)&&this.conditionalFormattingModule.isHex(n[s].style.backgroundColor.substr(1))?n[s].style.backgroundColor:this.conditionalFormattingModule.colourNameToHex(n[s].style.backgroundColor)),n[s].style&&n[s].style.color&&(n[s].style.color="#"===n[s].style.color.charAt(0)&&this.conditionalFormattingModule.isHex(n[s].style.color.substr(1))?n[s].style.color:this.conditionalFormattingModule.colourNameToHex(n[s].style.color)),e[a][r].style=n[s].style,e[a][r].cssClass="format"+this.element.id+s)}for(var o=this.dataSourceSettings.conditionalFormatSettings,s=0;s<o.length;s++){var l=this.createStyleSheet.bind(this)(),d="color: "+o[s].style.color+"!important;background-color: "+o[s].style.backgroundColor+"!important;font-size: "+o[s].style.fontSize+"!important;font-family: "+o[s].style.fontFamily+" !important;",p=".format"+this.element.id+s;l.insertRule(p+", "+p+" .e-cellvalue{"+d+"}",0)}}},v.prototype.createStyleSheet=function(){var e=document.createElement("style");return e.appendChild(document.createTextNode("")),document.head.appendChild(e),e.sheet},v.prototype.applyHyperlinkSettings=function(){if(this.pivotValues){for(var e=this.pivotValues,t=[],i=e.length,a=0;a<i;a++)Ue.isNullOrUndefined(e[a])||void 0!==e[a][0]||t.push(a);if(0<this.hyperlinkSettings.conditionalSettings.length)for(a=0;a<e.length;a++)for(var r=1;e[a]&&r<e[a].length;r++)if("value"===e[a][r].axis){e[a][r].enableHyperlink=!1;for(var n,s,o=this.hyperlinkSettings.conditionalSettings,l=0;l<o.length;l++)this.checkCondition(e[a][r].value,o[l].conditions,o[l].value1,o[l].value2)&&(n="row"===this.dataSourceSettings.valueAxis?a:"pivot"===this.dataType?this.engineModule.headerContent.length-1:this.olapEngineModule.headerContent.length-1,s="row"===this.dataSourceSettings.valueAxis?0:r,!o[l].measure||1===this.dataSourceSettings.values.length||e[n][s].valueSort&&e[n][s].actualText===o[l].measure)&&(!o[l].label||e[t[o[l].label.split(".").length-1]]&&e[t[o[l].label.split(".").length-1]][r]&&e[t[o[l].label.split(".").length-1]][r].valueSort&&e[t[o[l].label.split(".").length-1]][r].valueSort[o[l].label]||-1<e[a][0].valueSort.levelName.indexOf(o[l].label))&&(e[a][r].enableHyperlink=!0)}if(!Ue.isNullOrUndefined(this.hyperlinkSettings.headerText))for(var d=this.dataSourceSettings.valueSortSettings.headerDelimiter||".",a=0;a<e.length;a++)for(r=1;e[a]&&r<e[a].length;r++)if("value"===e[a][r].axis){var p=this.hyperlinkSettings.headerText;if(-1<e[a][0].valueSort.levelName.indexOf(p))e[a][0].enableHyperlink=!0,e[a][r].enableHyperlink=!0;else{for(var h=!1,l=0;l<t.length;l++)p=d+this.hyperlinkSettings.headerText,-1<(d+e[t[l]][r].valueSort.levelName).indexOf(p)&&(h=e[t[l]][r].enableHyperlink=!0);e[a][r].enableHyperlink=h}}}},v.prototype.checkCondition=function(e,t,i,a){switch(t){case"LessThan":return e<i;case"LessThanOrEqualTo":return e<=i;case"GreaterThan":return i<e;case"GreaterThanOrEqualTo":return i<=e;case"Equals":return e===i;case"NotEquals":return e!==i;case"Between":return i<a&&i<=e&&e<=a||a<i&&e<=i&&a<=e;case"NotBetween":return!(i<a&&i<=e&&e<=a||a<i&&e<=i&&a<=e);default:return!1}},v.prototype.updateGroupingReport=function(e,t){this.clonedDataSet||this.clonedReport||(i=this.engineModule.data,this.clonedDataSet="CSV"===this.dataSourceSettings.type?Ce.getClonedCSVData(i):Ce.getClonedData(i),(i=JSON.parse(this.getPersistData()).dataSourceSettings).dataSource=[],this.clonedReport=this.clonedReport||i);var o=/_date_group_years|_date_group_quarters|_date_group_quarterYear|_date_group_months|_date_group_days|_date_group_hours|_date_group_minutes|_date_group_seconds/g,i="CSV"===this.dataSourceSettings.type?Ce.getClonedCSVData(this.clonedDataSet):Ce.getClonedData(this.clonedDataSet),l=this.dataSourceSettings,a=this.clonedReport.properties||this.clonedReport,d=[l.rows,l.columns,l.values,l.filters],r=[l.filterSettings,l.sortSettings,l.formatSettings,l.drilledMembers],p=(p=a.rows).concat(a.columns,a.values,a.filters);if(0===e.length||0<e.length){this.engineModule.groupingFields={},this.setProperties({dataSourceSettings:{dataSource:i,groupSettings:0<e.length?l.groupSettings:[]}},!0);for(var h,u="Date"===t,c=[],g=0,n=d.length;g<n;g++)for(var m,S,s=0,f=d[g].length;s<f;s++)!function(e,t){var i=d[g][e].name,a=(-1===c.indexOf(i)&&c.push(i),c.indexOf(i));if(!Ue.isNullOrUndefined(i.match(o))&&u||-1!==i.indexOf("_custom_group")&&!Ce.getFieldByName(i.replace("_custom_group",""),l.groupSettings)){d[g].splice(e,1),c.splice(a,1),e--,t--;for(var r,i=i.split("_")[0],n=!1,s=0;s<d.length&&!(n=0<d[s].filter(function(e){return e.name===i}).length);s++);n||(h=i.split("_")[0],r=Ce.getFieldByName(h,p),p=p.filter(function(e){return e.name!==h}),c.push(h),r&&(n?d[g].splice(e,1,r):d[g].splice(++e,0,r)))}else(r=Ce.getFieldByName(i,p))?d[g].splice(e,1,r):h===i&&d[g].splice(e,1);m=e,S=t}(s,f),s=m,f=S;for(var v=0,y=c;v<y.length;v++)for(var b=y[v],C=Ce.getFilterItemByName(b,a.filterSettings),x=Ce.getFieldByName(b,a.sortSettings),w=Ce.getFieldByName(b,a.formatSettings),T=Ce.getFieldByName(b,a.drilledMembers),M=[C,x,w,T],g=0,n=r.length;g<n;g++){for(var D=!1,s=0,f=r[g].length;s<f;s++){var O=r[g][s].name;if(!Ue.isNullOrUndefined(O.match(o))&&u||-1!==O.indexOf("_custom_group")&&!Ce.getFieldByName(O.replace("_custom_group",""),l.groupSettings))r[g].splice(s,1),s--,f--;else if(b===r[g][s].name){D=!0,M[g]?r[g].splice(s,1,M[g]):(r[g].splice(s,1),s--,f--);break}}!D&&0===g&&C&&r[g].push(C),!D&&1===g&&x&&r[g].push(x),!D&&2===g&&w&&r[g].push(w),!D&&3===g&&T&&r[g].push(T)}}},v.prototype.removeButtonFocus=function(){document.querySelectorAll(".e-btn-focused")&&Ue.removeClass(document.querySelectorAll(".e-btn-focused"),"e-btn-focused")},v.prototype.wireEvents=function(){var e=this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage&&"pivot"===this.dataType;"Chart"!==this.displayOption.view&&(Ue.EventHandler.add(this.element,this.isAdaptive?"touchend":"click",this.mouseClickHandler,this),Ue.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),Ue.EventHandler.add(this.element.querySelector("."+es),"mousemove",this.mouseMoveHandler,this),Ue.EventHandler.add(this.element,"mouseup",this.mouseUpHandler,this),Ue.EventHandler.add(this.element,this.isAdaptive?"touchend":"contextmenu",this.mouseRclickHandler,this),this.virtualscrollModule)&&this.enableVirtualization&&!e&&Ue.EventHandler.add(this.element.querySelector("."+ts).querySelector("."+Ya),"scroll",this.headerScrollUpdate,this),Ue.EventHandler.add(document,this.isAdaptive?"touchend":"click",this.removeButtonFocus,this),window.addEventListener("resize",this.onWindowResize.bind(this),!0)},v.prototype.headerScrollUpdate=function(){this.element.querySelector("."+Gn).scrollLeft!==this.element.querySelector("."+ts).querySelector("."+Ya).scrollLeft&&(this.virtualscrollModule.direction="horizondal"),this.element.querySelector("."+Gn).scrollLeft=this.element.querySelector("."+ts).querySelector("."+Ya).scrollLeft},v.prototype.unwireEvents=function(){"Chart"!==this.displayOption.view&&(Ue.EventHandler.remove(this.element,this.isAdaptive?"touchend":"click",this.mouseClickHandler),Ue.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),this.element.querySelector("."+es)&&Ue.EventHandler.remove(this.element.querySelector("."+es),"mousemove",this.mouseMoveHandler),Ue.EventHandler.remove(this.element,"mouseup",this.mouseUpHandler),Ue.EventHandler.remove(this.element,this.isAdaptive?"touchend":"contextmenu",this.mouseRclickHandler),this.virtualscrollModule)&&this.enableVirtualization&&this.element.querySelector("."+ts)&&Ue.EventHandler.remove(this.element.querySelector("."+ts).querySelector("."+Ya),"scroll",this.headerScrollUpdate),Ue.EventHandler.remove(document,this.isAdaptive?"touchend":"click",this.removeButtonFocus),window.removeEventListener("resize",this.onWindowResize.bind(this),!0)},v.prototype.actionBeginMethod=function(){var e={dataSourceSettings:Ce.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,cancel:!1};return this.trigger(yt,e),e.cancel},v.prototype.actionCompleteMethod=function(){var e={dataSourceSettings:Ce.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,actionInfo:this.actionObj.actionInfo};this.trigger(bt,e),this.actionObj.actionName="",this.actionObj.actionInfo=void 0,this.actionObj.fieldInfo=void 0},v.prototype.actionFailureMethod=function(e){e={actionName:this.actionObj.actionName,errorInfo:e};this.trigger(Ct,e)},v.prototype.getActionCompleteName=function(){var e;switch(this.actionObj.actionName){case zt:e=Qi;break;case Wt:e=Yi;break;case Kt:e=Ki;break;case Xt:e=Xi;break;case ni:e=Ji;break;case si:e=Zi;break;case oi:e=$i;break;case li:e=ea;break;case di:e=ta;break;case pi:e=ia;break;case hi:e=aa;break;case ui:e=ra;break;case kt:e=na;break;case Ci:e=Ei;break;case fi:e=sa;break;case vi:e=oa;break;case yi:e=la;break;case bi:e=da;break;case Di:e=pa;break;case xi:e=ha;break;case mi:e=ua;break;case wi:e=Fi;break;case Ti:e=Ii;break;case Mi:e=Li;break;case ei:e=Gi;break;case ai:e=zi;break;case ri:e=Wi;break;case $t:e=Bi;break;case ii:e=Ui;break;case ti:e=_i;break;case Oi:e=ca;break;case Ht:e=ki;break;case Vt:e=ji;break;case _t:e=qi;break;case Ut:e=Vi;break;case Mt:e=fa;break;case Tt:e=Sa;break;case Pi:e=va;break;case Ni:e=ya;break;default:e=this.actionObj.actionName}return e},v.prototype.getStackedColumns=function(e,t){for(var i=0,a=e;i<a.length;i++){var r=a[i];t.push(r),r.columns&&0<r.columns.length&&this.getStackedColumns(r.columns,t)}return t},v.prototype.destroy=function(){this.removeInternalEvents(),this.engineModule&&(this.engineModule.fieldList={},this.engineModule.rMembers=null,this.engineModule.cMembers=null,this.engineModule.valueMatrix=[],this.engineModule={}),this.olapEngineModule&&(this.olapEngineModule.fieldList={},this.olapEngineModule={}),this.showGroupingBar&&this.groupingBarModule&&this.groupingBarModule.destroy(),this.allowGrouping&&this.groupingModule&&this.groupingModule.destroy(),this.showToolbar&&this.toolbarModule&&this.toolbarModule.destroy(),this.enablePaging&&this.pagerModule&&this.pagerModule.destroy(),this.enableVirtualization&&this.virtualscrollModule&&this.virtualscrollModule.destroy(),this.allowConditionalFormatting&&this.conditionalFormattingModule&&this.conditionalFormattingModule.destroy(),this.allowNumberFormatting&&this.numberFormattingModule&&this.numberFormattingModule.destroy(),this.contextMenuModule&&this.contextMenuModule.destroy(),this.keyboardModule&&this.keyboardModule.destroy(),this.tooltip&&!this.tooltip.isDestroyed&&this.tooltip.destroy(),this.calculatedFieldModule&&this.calculatedFieldModule.destroy(),this.chart&&!this.chart.isDestroyed&&(this.chart.destroy(),this.chart.isDestroyed)&&Ue.select("#"+this.element.id+"_chart",this.element)&&Ue.remove(Ue.select("#"+this.element.id+"_chart",this.element)),this.grid&&!this.grid.isDestroyed&&(this.grid.destroy(),this.grid.isDestroyed)&&Ue.select("#"+this.element.id+"_grid",this.element)&&Ue.remove(Ue.select("#"+this.element.id+"_grid",this.element)),this.commonModule&&this.commonModule.destroy(),this.pivotChartModule&&this.pivotChartModule.destroy(),this.pivotButtonModule&&!this.pivotButtonModule.isDestroyed&&this.pivotButtonModule.destroy(),this.pivotFieldListModule&&!this.pivotFieldListModule.isDestroyed&&(this.pivotFieldListModule.destroy(),this.pivotFieldListModule.isDestroyed)&&null!==Ue.select("#"+this.element.id+"_PivotFieldList",this.element)&&Ue.remove(Ue.select("#"+this.element.id+"_PivotFieldList",this.element)),(this.allowDrillThrough||this.editSettings&&this.editSettings.allowEditing)&&this.drillThroughModule&&this.drillThroughModule.destroy(),this.chartExportModule&&this.chartExportModule.destroy(),this.unwireEvents(),Rp.prototype.destroy.call(this),this.groupingBarModule&&(this.groupingBarModule=null),this.groupingModule&&(this.groupingModule=null),this.pivotFieldListModule&&(this.pivotFieldListModule=null),this.calculatedFieldModule&&(this.calculatedFieldModule=null),this.conditionalFormattingModule&&(this.conditionalFormattingModule=null),this.numberFormattingModule&&(this.numberFormattingModule=null),this.toolbarModule&&(this.toolbarModule=null),this.pagerModule&&(this.pagerModule=null),this.virtualscrollModule&&(this.virtualscrollModule=null),this.contextMenuModule&&(this.contextMenuModule=null),this.keyboardModule&&(this.keyboardModule=null),this.tooltip&&(this.tooltip=null),this.chart&&(this.chart=null),this.grid&&(this.grid=null),this.commonModule&&(this.commonModule=null),this.pivotChartModule&&(this.pivotChartModule=null),this.pivotButtonModule&&(this.pivotButtonModule=null),this.renderModule&&(this.renderModule=null),this.axisFieldModule&&(this.axisFieldModule=null),this.pdfExportModule&&(this.pdfExportModule=null),this.excelExportModule&&(this.excelExportModule=null),this.drillThroughModule&&(this.drillThroughModule=null),this.clonedDataSet&&(this.clonedDataSet=null),this.clonedReport&&(this.clonedReport=null),this.pagerModule&&(this.pagerModule=null),this.chartExportModule&&(this.chartExportModule=null),this.exportSpecifiedPages&&(this.exportSpecifiedPages=void 0),this.element.innerHTML="",Ue.removeClass([this.element],Ca),Ue.removeClass([this.element],xa),Ue.removeClass([this.element],wa),this.globalize=null,this.localeObj=null,this.currentView=null,this.fieldListSpinnerElement=null,this.lastSortInfo=null,this.lastFilterInfo=null,this.lastAggregationInfo=null,this.lastCalcFieldInfo=null,this.lastCellClicked=null,this.lastColumn=null,this.pivotCommon=null},v.prototype.showNumberFormattingDialog=function(){this.allowNumberFormatting&&this.numberFormattingModule.showNumberFormattingDialog()},v.prototype.getValuesHeader=function(e,t){var i=this.dataSourceSettings.values;return"value"===t&&!Ue.isNullOrUndefined(e.valueSort)&&this.localeObj.getConstant("grandTotal")+this.dataSourceSettings.valueSortSettings.headerDelimiter+e.formattedText===e.valueSort.levelName&&("column"===e.axis&&0===this.dataSourceSettings.columns.length&&"column"===this.dataSourceSettings.valueAxis||"row"===e.axis&&0===this.dataSourceSettings.rows.length&&"row"===this.dataSourceSettings.valueAxis)?this.localeObj.getConstant("total")+" "+this.localeObj.getConstant(this.engineModule.fieldList[e.actualText].aggregateType)+" "+this.localeObj.getConstant("of")+" "+e.formattedText:"grandTotal"===t&&1===i.length&&"row"===this.dataSourceSettings.valueAxis&&e.formattedText===this.localeObj.getConstant("grandTotal")?this.localeObj.getConstant("total")+" "+this.localeObj.getConstant(i[i.length-1].type)+" "+this.localeObj.getConstant("of")+" "+(Ue.isNullOrUndefined(i[i.length-1].caption)?i[i.length-1].name:i[i.length-1].caption):e.formattedText},v.prototype.setColumnWidth=function(e,t){e.autoFit||("auto"!==e.width?e.width=this.renderModule.lastColumn&&e.field===this.renderModule.lastColumn.field?t-3:t:e.minWidth=t)},g([Ue.Property("USD")],v.prototype,"currencyCode",void 0),g([Ue.Property(!1)],v.prototype,"showFieldList",void 0),g([Ue.Complex({},a)],v.prototype,"gridSettings",void 0),g([Ue.Complex({},cl)],v.prototype,"chartSettings",void 0),g([Ue.Complex({},Zl)],v.prototype,"groupingBarSettings",void 0),g([Ue.Complex({},od)],v.prototype,"hyperlinkSettings",void 0),g([Ue.Complex({},Md)],v.prototype,"pageSettings",void 0),g([Ue.Complex({},Sd)],v.prototype,"pagerSettings",void 0),g([Ue.Complex({},to)],v.prototype,"dataSourceSettings",void 0),g([Ue.Complex({},td)],v.prototype,"editSettings",void 0),g([Ue.Complex({},Pd)],v.prototype,"displayOption",void 0),g([Ue.Complex({},xd)],v.prototype,"virtualScrollSettings",void 0),g([Ue.Property()],v.prototype,"pivotValues",void 0),g([Ue.Property(!1)],v.prototype,"showGroupingBar",void 0),g([Ue.Property(!0)],v.prototype,"showTooltip",void 0),g([Ue.Property(!1)],v.prototype,"showToolbar",void 0),g([Ue.Property([])],v.prototype,"toolbar",void 0),g([Ue.Property(!1)],v.prototype,"showValuesButton",void 0),g([Ue.Property(!1)],v.prototype,"allowCalculatedField",void 0),g([Ue.Property(!1)],v.prototype,"enableFieldSearching",void 0),g([Ue.Property(!1)],v.prototype,"enableValueSorting",void 0),g([Ue.Property(!1)],v.prototype,"allowConditionalFormatting",void 0),g([Ue.Property(!1)],v.prototype,"allowNumberFormatting",void 0),g([Ue.Property("auto")],v.prototype,"height",void 0),g([Ue.Property("auto")],v.prototype,"width",void 0),g([Ue.Property(!1)],v.prototype,"allowExcelExport",void 0),g([Ue.Property(!1)],v.prototype,"enableVirtualization",void 0),g([Ue.Property(!1)],v.prototype,"enablePaging",void 0),g([Ue.Property(!1)],v.prototype,"allowDrillThrough",void 0),g([Ue.Property(!1)],v.prototype,"allowPdfExport",void 0),g([Ue.Property(!1)],v.prototype,"allowDeferLayoutUpdate",void 0),g([Ue.Property(!1)],v.prototype,"allowDataCompression",void 0),g([Ue.Property(1e3)],v.prototype,"maxNodeLimitInMemberEditor",void 0),g([Ue.Property(1e4)],v.prototype,"maxRowsInDrillThrough",void 0),g([Ue.Property(!0)],v.prototype,"loadOnDemandInMemberEditor",void 0),g([Ue.Property(!1)],v.prototype,"enableHtmlSanitizer",void 0),g([Ue.Property()],v.prototype,"cellTemplate",void 0),g([Ue.Property()],v.prototype,"toolbarTemplate",void 0),g([Ue.Property()],v.prototype,"tooltipTemplate",void 0),g([Ue.Property()],v.prototype,"spinnerTemplate",void 0),g([Ue.Property(!1)],v.prototype,"allowGrouping",void 0),g([Ue.Property(!0)],v.prototype,"exportAllPages",void 0),g([Ue.Property(["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"])],v.prototype,"aggregateTypes",void 0),g([Ue.Property(["Column","Bar","Line","Area","Scatter","Polar","StackingColumn","StackingArea","StackingBar","StackingLine","StepLine","StepArea","SplineArea","Spline","StackingColumn100","StackingBar100","StackingArea100","StackingLine100","Bubble","Pareto","Radar","Pie","Doughnut","Funnel","Pyramid"])],v.prototype,"chartTypes",void 0),g([Ue.Property("")],v.prototype,"cssClass",void 0),g([Ue.Event()],v.prototype,"queryCellInfo",void 0),g([Ue.Event()],v.prototype,"headerCellInfo",void 0),g([Ue.Event()],v.prototype,"resizing",void 0),g([Ue.Event()],v.prototype,"resizeStop",void 0),g([Ue.Event()],v.prototype,"pdfHeaderQueryCellInfo",void 0),g([Ue.Event()],v.prototype,"pdfQueryCellInfo",void 0),g([Ue.Event()],v.prototype,"excelHeaderQueryCellInfo",void 0),g([Ue.Event()],v.prototype,"excelQueryCellInfo",void 0),g([Ue.Event()],v.prototype,"columnDragStart",void 0),g([Ue.Event()],v.prototype,"columnDrag",void 0),g([Ue.Event()],v.prototype,"columnDrop",void 0),g([Ue.Event()],v.prototype,"beforePdfExport",void 0),g([Ue.Event()],v.prototype,"beforeExcelExport",void 0),g([Ue.Event()],v.prototype,"beforeColumnsRender",void 0),g([Ue.Event()],v.prototype,"selected",void 0),g([Ue.Event()],v.prototype,"cellDeselected",void 0),g([Ue.Event()],v.prototype,"rowSelected",void 0),g([Ue.Event()],v.prototype,"rowDeselected",void 0),g([Ue.Event()],v.prototype,"chartTooltipRender",void 0),g([Ue.Event()],v.prototype,"chartLegendClick",void 0),g([Ue.Event()],v.prototype,"beforePrint",void 0),g([Ue.Event()],v.prototype,"animationComplete",void 0),g([Ue.Event()],v.prototype,"legendRender",void 0),g([Ue.Event()],v.prototype,"textRender",void 0),g([Ue.Event()],v.prototype,"pointRender",void 0),g([Ue.Event()],v.prototype,"seriesRender",void 0),g([Ue.Event()],v.prototype,"chartMouseMove",void 0),g([Ue.Event()],v.prototype,"chartMouseClick",void 0),g([Ue.Event()],v.prototype,"pointMove",void 0),g([Ue.Event()],v.prototype,"chartMouseLeave",void 0),g([Ue.Event()],v.prototype,"chartMouseDown",void 0),g([Ue.Event()],v.prototype,"chartMouseUp",void 0),g([Ue.Event()],v.prototype,"dragComplete",void 0),g([Ue.Event()],v.prototype,"zoomComplete",void 0),g([Ue.Event()],v.prototype,"scrollStart",void 0),g([Ue.Event()],v.prototype,"scrollEnd",void 0),g([Ue.Event()],v.prototype,"scrollChanged",void 0),g([Ue.Event()],v.prototype,"multiLevelLabelRender",void 0),g([Ue.Event()],v.prototype,"chartLoaded",void 0),g([Ue.Event()],v.prototype,"chartLoad",void 0),g([Ue.Event()],v.prototype,"chartResized",void 0),g([Ue.Event()],v.prototype,"chartAxisLabelRender",void 0),g([Ue.Event()],v.prototype,"multiLevelLabelClick",void 0),g([Ue.Event()],v.prototype,"chartPointClick",void 0),g([Ue.Event()],v.prototype,"contextMenuClick",void 0),g([Ue.Event()],v.prototype,"contextMenuOpen",void 0),g([Ue.Event()],v.prototype,"onPdfCellRender",void 0),g([Ue.Event()],v.prototype,"saveReport",void 0),g([Ue.Event()],v.prototype,"fetchReport",void 0),g([Ue.Event()],v.prototype,"loadReport",void 0),g([Ue.Event()],v.prototype,"renameReport",void 0),g([Ue.Event()],v.prototype,"removeReport",void 0),g([Ue.Event()],v.prototype,"newReport",void 0),g([Ue.Event()],v.prototype,"toolbarRender",void 0),g([Ue.Event()],v.prototype,"toolbarClick",void 0),g([Ue.Event()],v.prototype,"load",void 0),g([Ue.Event()],v.prototype,"enginePopulating",void 0),g([Ue.Event()],v.prototype,"enginePopulated",void 0),g([Ue.Event()],v.prototype,"onFieldDropped",void 0),g([Ue.Event()],v.prototype,"fieldDrop",void 0),g([Ue.Event()],v.prototype,"fieldDragStart",void 0),g([Ue.Event()],v.prototype,"dataBound",void 0),g([Ue.Event()],v.prototype,"created",void 0),g([Ue.Event()],v.prototype,"destroyed",void 0),g([Ue.Event()],v.prototype,"beforeExport",void 0),g([Ue.Event()],v.prototype,"exportComplete",void 0),g([Ue.Event()],v.prototype,"conditionalFormatting",void 0),g([Ue.Event()],v.prototype,"memberFiltering",void 0),g([Ue.Event()],v.prototype,"cellClick",void 0),g([Ue.Event()],v.prototype,"drillThrough",void 0),g([Ue.Event()],v.prototype,"editCompleted",void 0),g([Ue.Event()],v.prototype,"beginDrillThrough",void 0),g([Ue.Event()],v.prototype,"hyperlinkCellClick",void 0),g([Ue.Event()],v.prototype,"cellSelecting",void 0),g([Ue.Event()],v.prototype,"drill",void 0),g([Ue.Event()],v.prototype,"cellSelected",void 0),g([Ue.Event()],v.prototype,"chartSeriesCreated",void 0),g([Ue.Event()],v.prototype,"aggregateCellInfo",void 0),g([Ue.Event()],v.prototype,"fieldListRefreshed",void 0),g([Ue.Event()],v.prototype,"memberEditorOpen",void 0),g([Ue.Event()],v.prototype,"calculatedFieldCreate",void 0),g([Ue.Event()],v.prototype,"numberFormatting",void 0),g([Ue.Event()],v.prototype,"aggregateMenuOpen",void 0),g([Ue.Event()],v.prototype,"fieldRemove",void 0),g([Ue.Event()],v.prototype,"beforeServiceInvoke",void 0),g([Ue.Event()],v.prototype,"afterServiceInvoke",void 0),g([Ue.Event()],v.prototype,"actionBegin",void 0),g([Ue.Event()],v.prototype,"actionComplete",void 0),g([Ue.Event()],v.prototype,"actionFailure",void 0),g([Ue.Event()],v.prototype,"onHeadersSort",void 0);var Rp,kp=g([Ue.NotifyPropertyChanges],v);function v(e,t){e=Rp.call(this,e,t)||this;return e.verticalScrollScale=1,e.horizontalScrollScale=1,e.scrollerBrowserLimit=8e6,e.lastSortInfo={},e.lastFilterInfo={},e.lastAggregationInfo={},e.lastCalcFieldInfo={},e.isScrolling=!1,e.allowEngineExport=!1,e.isInitial=!0,e.shiftLockedPos=[],e.savedSelectedCellsPos=[],e.cellSelectionPos=[],e.isPopupClicked=!1,e.isMouseDown=!1,e.isMouseUp=!1,e.fieldsType={},e.remoteData=[],e.defaultItems={},e.isCellBoxMultiSelection=!1,e.gridCellCollection={},e.rowRangeSelection={enable:!1,startIndex:0,endIndex:0},e.isStaticRefresh=!1,e.resizeInfo={},e.scrollPosObject={vertical:0,horizontal:0,verticalSection:0,horizontalSection:0,top:0,left:0,scrollDirection:{direction:"",position:0}},e.pivotColumns=[],e.totColWidth=0,e.posCount=0,e.isModified=!1,e.isInitialRendering=!1,e.needsID=!0,e.pivotRefresh=Ue.Component.prototype.refresh,e.request="undefined"!=typeof window?new XMLHttpRequest:null,e.isServerWaitingPopup=!1,e.actionObj={},e.defaultFieldListOrder="None",e.destroyEngine=!1,e.pivotView=e,Ue.setValue("mergePersistData",e.mergePersistPivotData,e),e}qp.getClonedPivotValues=function(e){for(var t=[],i=0;i<e.length;i++)if(e[i]){t[i]=[];for(var a=0;a<e[i].length;a++)e[i][a]&&(t[i][a]=this.getClonedPivotValueObj(e[i][a]))}return t},qp.getClonedPivotValueObj=function(e){var t=0,i={};if(null!=e)for(var a=Object.keys(e);t<a.length;)i[a[t]]=e[a[t]],t++;else i=e;return i},qp.isContainCommonElements=function(e,t){for(var i=0,a=e.length;i<a;i++)for(var r=0,n=t.length;r<n;r++)if(t[r]===e[i])return!0;return!1};var jp=qp;function qp(){}Vp.prototype.getModuleName=function(){return"excelExport"},Vp.prototype.addHeaderAndFooter=function(e,t,i,a){var r=[];if(Ue.isNullOrUndefined(e.rows))""!==t&&("footer"===i&&this.actualrCnt++,r.push({index:1,value:t}),this.rows.push({index:this.actualrCnt+1,cells:r}),this.actualrCnt="header"===i?this.actualrCnt+2:this.actualrCnt);else{this.actualrCnt="footer"===i?this.actualrCnt+a-e.rows[0].cells.length:this.actualrCnt;for(var n=e.rows,s=0;s<n.length;s++){for(var o=0,r=[],l=n[s],d=0;d<l.cells.length;d++)r.push({index:o+1,value:l.cells[d].value,colSpan:l.cells[d].colSpan,rowSpan:l.cells[d].rowSpan,style:l.cells[d].style}),o+=r[d].colSpan;this.actualrCnt++,this.rows.push({index:this.actualrCnt,cells:r})}this.actualrCnt="header"===i?a:this.actualrCnt}},Vp.prototype.exportToExcel=function(e,t,i){this.rows=[],this.actualrCnt=0;for(var a,r,n,s,o,l=!Ue.isNullOrUndefined(t)&&!Ue.isNullOrUndefined(t.header),d=!Ue.isNullOrUndefined(t)&&!Ue.isNullOrUndefined(t.footer),p=!Ue.isNullOrUndefined(t)&&!Ue.isNullOrUndefined(t.fileName),h=(this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,jp.getClonedPivotValues(this.engine.pivotValues)),p=p?t.fileName:"CSV"===e?"default.csv":"default.xlsx",u=(this.parent.exportAllPages&&(this.parent.enableVirtualization||this.parent.enablePaging)?(L=this.engine.pageSettings,A=void 0,this.engine.isPagingOrVirtualizationEnabled=!1,"olap"===this.parent.dataType?(this.updateOlapPageSettings(!0),A=this.parent.olapEngineModule.mdxQuery.slice(0)):this.engine.pageSettings=null,this.engine.generateGridData(this.parent.dataSourceSettings,!0,!0),this.parent.applyFormatting(this.engine.pivotValues),a=jp.getClonedPivotValues(this.engine.pivotValues),this.engine.pivotValues=h,this.engine.pageSettings=L,this.engine.isPagingOrVirtualizationEnabled=!0,"olap"===this.parent.dataType&&(this.updateOlapPageSettings(!1),this.parent.olapEngineModule.mdxQuery=A)):a=h,{fileName:p,header:"",footer:"",dataCollections:[a],excelExportProperties:t}),c=(this.parent.trigger(B,u,function(e){r=e.fileName,n=e.header,s=e.footer,o=e.dataCollections}),!l&&Ue.isNullOrUndefined(u.excelExportProperties)&&""!==n?this.addHeaderAndFooter({},n,"header",void 0):Ue.isNullOrUndefined(u.excelExportProperties)||Ue.isNullOrUndefined(u.excelExportProperties.header)||this.addHeaderAndFooter(u.excelExportProperties.header,"","header",u.excelExportProperties.header.headerRows),[]),g=0;g<o.length;g++){for(var m=o[g],S=0,f=m.length,v=this.parent.renderModule.getFormatList(),y=0,b=0;b<f;b++)if(m[b]){this.actualrCnt++;for(var C,x,w,T,M,D,O,P,S=m[b].length,N=[],E=0;E<S;E++)m[b][E]?((O=m[b][E])&&"value"===O.axis&&""===O.formattedText&&(O.value=Number(O.formattedText)),C="row"===this.parent.dataSourceSettings.valueAxis&&"olap"===this.parent.dataType&&O.rowOrdinal&&this.engine.tupRowInfo[O.rowOrdinal]?this.engine.tupRowInfo[O.rowOrdinal].measureName:O.actualText,C="row"===O.axis?{hAlign:"Left",bold:!0,wrapText:!0}:{numberFormat:v[C],bold:!1,wrapText:!0},x={bold:!0,vAlign:"Center",wrapText:!0,indent:0===E?10*O.level:0},(-1!==O.level||O.rowSpan)&&(D=this.engine.aggregatedValueMatrix,D="value"===O.axis?D[b]&&D[b][E]?D[b][E]:"#DIV/0!"===O.formattedText?O.formattedText:O.value:O.formattedText,w=0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis||0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis,D="grand sum"!==O.type||1===this.parent.dataSourceSettings.values.length&&"row"===this.parent.dataSourceSettings.valueAxis&&"column"===O.axis?"sum"===O.type?D.toString().replace("Total",this.parent.localeObj.getConstant("total")):!Ue.isNullOrUndefined(O.valueSort)&&this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+O.formattedText===O.valueSort.levelName&&w?this.parent.getValuesHeader(O,"value"):D:w?this.parent.getValuesHeader(O,"grandTotal"):this.parent.localeObj.getConstant("grandTotal"),-1!==O.level||O.rowSpan)&&(N.push({index:E+1,value:D,colSpan:O.colSpan,rowSpan:-1===O.rowSpan?1:O.rowSpan}),w=N[N.length-1],"value"===O.axis?((isNaN(O.value)||""===O.formattedText||void 0===O.formattedText||Ue.isNullOrUndefined(O.value))&&(w.value="Excel"===e?null:""),C.numberFormat="string"==typeof D?void 0:C.numberFormat,w.style=Ue.isNullOrUndefined(w.value)?{bold:!1,wrapText:!0}:C):(w.style=x,"row"===O.axis&&0===E&&(w.style=C,y="olap"===this.parent.dataType?(T=this.parent.renderModule.indentCollection[b],w.style.indent=2*T,T<y?y:T):(T=O.valueSort?O.valueSort.levelName.toString():"",P=O.actualText?O.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,P=T.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(P&&P-1),w.style.indent=2*(P=P?P-1:0),y<P?P:y))),(O.style||w.style.backColor||w.style.fontColor||w.style.fontName||w.style.fontSize)&&(w.style.backColor=w.style.backColor||O.style.backgroundColor,w.style.fontColor=w.style.fontColor||O.style.color,w.style.fontName=w.style.fontName||O.style.fontFamily,Ue.isNullOrUndefined(w.style.fontSize)&&Ue.isNullOrUndefined(O.style.fontSize)||(w.style.fontSize=Ue.isNullOrUndefined(w.style.fontSize)?Number(O.style.fontSize.split("px")[0]):Number(w.style.fontSize))),P=void(w.style.borders={color:"#000000",lineStyle:"thin"}),M=void 0,"column"===O.axis?this.parent.trigger(J,P={style:x,cell:O}):this.parent.trigger($,M={style:C,cell:O,column:void 0,data:m,value:D}),w.value="column"===O.axis?P.cell.formattedText:M.value,w.style=("column"===O.axis?P:M).style),E+=O.colSpan?O.colSpan-1:0):(P=void 0,(O={formattedText:""})&&this.parent.trigger(J,P={style:void 0,cell:O}),N.push({index:E+1,colSpan:1,rowSpan:1,value:O.formattedText,style:P.style}));this.rows.push({index:this.actualrCnt,cells:N})}d?this.addHeaderAndFooter(t.footer,"","footer",t.footer.footerRows):!d&&""!==s&&Ue.isNullOrUndefined(u.excelExportProperties)?this.addHeaderAndFooter({},s,"footer",void 0):Ue.isNullOrUndefined(u.excelExportProperties)||Ue.isNullOrUndefined(u.excelExportProperties.footer)||this.addHeaderAndFooter(u.excelExportProperties.footer,"","footer",u.excelExportProperties.footer.footerRows);for(var F=[],E=0;E<S;E++)F.push({index:E+1,width:100});0<y&&(F[0].width=100+20*y),c.push({columns:F,rows:this.rows})}var I,L=new R.Workbook({worksheets:c},"Excel"===e?"xlsx":"csv",void 0,this.parent.currencyCode),A=r.split(".").pop(),h=(i?I=L.saveAsBlob("xlsx"===A||"Excel"===e?"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"text/csv"):L.save("xlsx"===A||"csv"===A?r:r+("Excel"===e?".xlsx":".csv")),{type:e,promise:i?I:null});this.parent.trigger(X,h)},Vp.prototype.updateOlapPageSettings=function(e){this.parent.olapEngineModule.isExporting=!!e,this.parent.exportSpecifiedPages?this.parent.olapEngineModule.exportSpeciedPages=this.parent.exportSpecifiedPages=e?this.parent.exportSpecifiedPages:void 0:(this.parent.olapEngineModule.pageSettings=e?null:this.parent.olapEngineModule.pageSettings,this.parent.olapEngineModule.isPaging=!e)},Vp.prototype.destroy=function(){this.engine&&(this.engine=null)};yd=Vp;function Vp(e){this.actualrCnt=0,this.parent=e}Hp.prototype.getModuleName=function(){return"pdfExport"},Hp.prototype.addPage=function(e,t){t=t||this.exportProperties.pdfExportProperties;var i=e.document.sections.add(),a=e.document.pageSettings.height,r=e.document.pageSettings.width,a=(this.exportProperties.width||this.exportProperties.height?(e.document.pageSettings.orientation=this.exportProperties.width>this.exportProperties.height||!this.exportProperties.height&&this.exportProperties.width>a||!this.exportProperties.width&&r>this.exportProperties.height?j.PdfPageOrientation.Landscape:j.PdfPageOrientation.Portrait,e.document.pageSettings.size=new j.SizeF(this.exportProperties.width||r,this.exportProperties.height||a)):(e.document.pageSettings.orientation=0===this.exportProperties.orientation||this.exportProperties.orientation?this.exportProperties.orientation:Ue.isNullOrUndefined(t)||Ue.isNullOrUndefined(t.pageOrientation)||"Landscape"===t.pageOrientation?j.PdfPageOrientation.Landscape:j.PdfPageOrientation.Portrait,Ue.isNullOrUndefined(t)||Ue.isNullOrUndefined(t.pageSize)||(e.document.pageSettings.size=Ce.getPageSize(t.pageSize))),Ue.isNullOrUndefined(this.exportProperties.pdfMargins)||((r=e.document.pageSettings.margins).top=(Ue.isNullOrUndefined(this.exportProperties.pdfMargins.top)?r:this.exportProperties.pdfMargins).top,r.bottom=(Ue.isNullOrUndefined(this.exportProperties.pdfMargins.bottom)?r:this.exportProperties.pdfMargins).bottom,r.left=(Ue.isNullOrUndefined(this.exportProperties.pdfMargins.left)?r:this.exportProperties.pdfMargins).left,r.right=(Ue.isNullOrUndefined(this.exportProperties.pdfMargins.right)?r:this.exportProperties.pdfMargins).right),i.setPageSettings(e.document.pageSettings),i.pages.add());return Ue.isNullOrUndefined(t)||Ue.isNullOrUndefined(t.header)||this.pdfExportHelper.drawHeader(t,e.document),Ue.isNullOrUndefined(t)||Ue.isNullOrUndefined(t.footer)||this.pdfExportHelper.drawFooter(t,e.document),a},Hp.prototype.getFontStyle=function(e){var t=j.PdfFontStyle.Regular;return!Ue.isNullOrUndefined(e)&&e.bold&&(t|=j.PdfFontStyle.Bold),!Ue.isNullOrUndefined(e)&&e.italic&&(t|=j.PdfFontStyle.Italic),!Ue.isNullOrUndefined(e)&&e.underline&&(t|=j.PdfFontStyle.Underline),!Ue.isNullOrUndefined(e)&&e.strikeout&&(t|=j.PdfFontStyle.Strikeout),t},Hp.prototype.getBorderStyle=function(e){var t,i,a,r=new j.PdfBorders;return Ue.isNullOrUndefined(e)?(t=new j.PdfColor(234,234,234),r.all=new j.PdfPen(t)):(t=e.width,t=Ue.isNullOrUndefined(t)||"number"!=typeof t?void 0:.75*t,i=new j.PdfColor(196,196,196),Ue.isNullOrUndefined(e.color)||(a=this.pdfExportHelper.hexDecToRgb(e.color),i=new j.PdfColor(a.r,a.g,a.b)),a=new j.PdfPen(i,t),Ue.isNullOrUndefined(e.dashStyle)||(a.dashStyle=this.pdfExportHelper.getDashStyle(e.dashStyle)),r.all=a),r},Hp.prototype.getStyle=function(){var e,t,i,a,r=new j.PdfBorders;return Ue.isNullOrUndefined(this.gridStyle)?{brush:new j.PdfSolidBrush(new j.PdfColor),border:r,font:void 0}:(r=Ue.isNullOrUndefined(this.gridStyle.header.fontName)?j.PdfFontFamily.Helvetica:this.getFontFamily(this.gridStyle.header.fontName),e=this.getFontStyle(this.gridStyle.header),t=Ue.isNullOrUndefined(this.gridStyle.header.fontSize)?10.5:this.gridStyle.header.fontSize,i=new j.PdfColor,Ue.isNullOrUndefined(this.gridStyle.header.fontColor)||(a=this.pdfExportHelper.hexDecToRgb(this.gridStyle.header.fontColor),i=new j.PdfColor(a.r,a.g,a.b)),a=new j.PdfStandardFont(r,t,e),Ue.isNullOrUndefined(this.gridStyle.header.font)||(a=this.gridStyle.header.font),{border:this.getBorderStyle(this.gridStyle.header.border),font:a,brush:new j.PdfSolidBrush(i)})},Hp.prototype.setRecordThemeStyle=function(e,t){Ue.isNullOrUndefined(this.gridStyle)||Ue.isNullOrUndefined(this.gridStyle.record)||(r=Ue.isNullOrUndefined(this.gridStyle.record.fontName)?j.PdfFontFamily.Helvetica:this.getFontFamily(this.gridStyle.record.fontName),a=Ue.isNullOrUndefined(this.gridStyle.record.fontSize)?9.75:this.gridStyle.record.fontSize,i=this.getFontStyle(this.gridStyle.record),r=new j.PdfStandardFont(r,a,i),Ue.isNullOrUndefined(this.gridStyle.record.font)||(r=this.gridStyle.record.font),e.style.setFont(r),a=new j.PdfColor,Ue.isNullOrUndefined(this.gridStyle.record.fontColor)||(i=this.pdfExportHelper.hexDecToRgb(this.gridStyle.record.fontColor),a=new j.PdfColor(i.r,i.g,i.b)),e.style.setTextBrush(new j.PdfSolidBrush(a)));var i,a,r=this.gridStyle&&this.gridStyle.record&&this.gridStyle.record.border?this.getBorderStyle(this.gridStyle.record.border):t;return e.style.setBorder(r),e},Hp.prototype.exportToPDF=function(e,i,t,a){for(var r=this,n=(this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.gridStyle=Ue.isNullOrUndefined(this.exportProperties.pdfExportProperties)?void 0:this.exportProperties.pdfExportProperties.theme,this.applyEvent()),s=(Ue.isNullOrUndefined(t)||(n.document=t),this.getStyle()),o=Ue.isNullOrUndefined(this.exportProperties)||Ue.isNullOrUndefined(this.exportProperties.fileName)?Ue.isNullOrUndefined(e)||Ue.isNullOrUndefined(e.fileName)?"default":e.fileName:this.exportProperties.fileName,t=this.parent.renderModule.maxIndent||5,l=Math.floor((540-(100+20*t))/90)+1,d=0,p=n.args.pivotValues[d],h=((this.exportProperties.columnSize||this.exportProperties.width||this.exportProperties.height)&&(l=0<this.exportProperties.columnSize?this.exportProperties.columnSize:p[0].length),this.exportProperties.allowRepeatHeader=!0===this.exportProperties.allowRepeatHeader||Ue.isNullOrUndefined(this.exportProperties.allowRepeatHeader),this.exportProperties.allowRepeatHeader||!1),u=0;h&&1<l&&u<p.length;u++)for(var c=l;p[u]&&c<p[u].length;c+=l)p[u].splice(c,0,p[u][0]);var g=p&&0<p.length?p[0].length:0,m=0;do{Ue.isNullOrUndefined(e)||(this.exportProperties.header=Ue.isNullOrUndefined(e.header)||Ue.isNullOrUndefined(e.header.contents)||Ue.isNullOrUndefined(e.header.contents[0].value)?this.exportProperties.header:e.header.contents[0].value,this.exportProperties.footer=Ue.isNullOrUndefined(e.footer)||Ue.isNullOrUndefined(e.footer.contents)||Ue.isNullOrUndefined(e.footer.contents[0].value)?this.exportProperties.footer:e.footer.contents[0].value);var S=this.addPage(n,e),f=new j.PdfGrid,v=0<l?l:5;if(p&&0<p.length){f.columns.add(p[0].length-m>=v?v:p[0].length-m);for(var y=p.length,b=0,C=0,x=0,w=0;w<y;w++)if(p[w]){for(var T=!(p[w][0]&&"row"===p[w][0].axis),k=p[w].length>m+v?m+v:p[w].length,M=(T&&f.headers.add(1),T?f.headers.getHeader(b):f.rows.addRow()),D=(T?(M.style.setBorder(s.border),s.font&&M.style.setFont(s.font),M.style.setTextBrush(s.brush)):this.setRecordThemeStyle(M,s.border),0),O=!0,P=m;P<k;P++){var N,E,F,I,L,A=!1,R=(p[w][P]?(R=(E=p[w][P]).formattedText,R=0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length?this.parent.getValuesHeader(E,"value"):R,R="grand sum"===E.type?0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length?this.parent.getValuesHeader(E,"grandTotal"):this.parent.localeObj.getConstant("grandTotal"):"sum"===E.type?R.toString().replace("Total",this.parent.localeObj.getConstant("total")):R,-1===E.level&&!E.rowSpan||(-1===E.level&&!E.rowSpan||(M.cells.getCell(D).columnSpan=E.colSpan?v-D<E.colSpan?v-D:E.colSpan:1,T&&E.rowSpan&&1<E.rowSpan&&(M.cells.getCell(D).rowSpan=E.rowSpan||1),M.cells.getCell(D).value=R?R.toString():""),""===R)||(O=!1),C=E.level>C?E.level:C,A="value"===E.axis,P+=M.cells.getCell(D).columnSpan?M.cells.getCell(D).columnSpan-1:0,D+=M.cells.getCell(D).columnSpan?M.cells.getCell(D).columnSpan-1:0,N={style:void 0,pivotCell:E,cell:(M=E.style?this.applyStyle(M,E,D):M).cells.getCell(D),column:f.columns.getColumn(D)},this.parent.trigger(te,N),"column"===E.axis?(N={style:N.style,cell:N.cell,gridCell:N.pivotCell},this.parent.trigger(Z,N),M.cells.getCell(D).value=N.gridCell.formattedText||R):(N={style:N.style,cell:N.cell,column:void 0,data:N.pivotCell,value:R},this.parent.trigger(ee,N),M.cells.getCell(D).value=N.value||R),N.style&&this.processCellStyle(M.cells.getCell(D),N)):(N={style:void 0,pivotCell:void 0,cell:M.cells.getCell(D),column:f.columns.getColumn(D)},this.parent.trigger(te,N),x=N.column.width,"column"===(E={formattedText:""}).axis&&(N={style:N.style,cell:N.cell,gridCell:N.pivotCell},this.parent.trigger(Z,N)),N.style&&this.processCellStyle(M.cells.getCell(D),N),M.cells.getCell(D).value="",(0===P&&T&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length||0!==P&&T&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length&&f.headers.getHeader(0).cells.getCell(0).rowSpan<Object.keys(this.engine.headerContent).length)&&f.headers.getHeader(0).cells.getCell(0).rowSpan++),new j.PdfStringFormat);"olap"===this.parent.dataType?(F=!T&&0===D&&p[w][P]?this.parent.renderModule.indentCollection[p[w][P].rowIndex]:0,R.paragraphIndent=15*F,C=F<C?C:F):(R.paragraphIndent=0,!T&&0===D&&p[w][P]&&-1!==p[w][P].level&&(L=(F=p[w][P]).valueSort?F.valueSort.levelName.toString():"",I=F.actualText?F.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,L=L.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(I&&I-1),R.paragraphIndent=10*(L?L-1:0))),R.alignment=A?j.PdfTextAlignment.Right:j.PdfTextAlignment.Left,R.lineAlignment=j.PdfVerticalAlignment.Middle,M.cells.getCell(D).style.stringFormat=R,D++}O&&(M.height=16),b++}f.columns.getColumn(0).width=0<x?x:100+20*C}}while(0===m&&this.parent.dataSourceSettings.columns&&0<this.parent.dataSourceSettings.columns.length&&f.headers.getHeader(0).cells.getCell(0).rowSpan--,f.draw(S,new j.PointF(10,20)),g<=(m+=v)&&n.args.pivotValues.length>d+1&&(g=(p=n.args.pivotValues[++d])&&0<p.length?p[0].length:0,m=0),m<g);return new Promise(function(e){var t;a||i?a&&(t=n.document.save()):(n.document.save(o+".pdf"),n.document.destroy()),r.parent.trigger(X,{type:"PDF",promise:a?t:null}),e(n.document)})},Hp.prototype.applyStyle=function(e,t,i){var a=this.parent.conditionalFormattingModule.hexToRgb(t.style.backgroundColor),r=new j.PdfSolidBrush(new j.PdfColor(a.r,a.g,a.b)),n=(e.cells.getCell(i).style.backgroundBrush=r,Number(t.style.fontSize.split("px")[0])),n=new j.PdfStandardFont(j.PdfFontFamily.TimesRoman,n,j.PdfFontStyle.Regular);return e.cells.getCell(i).style.font=n,a=this.parent.conditionalFormattingModule.hexToRgb(t.style.color),r=new j.PdfSolidBrush(new j.PdfColor(a.r,a.g,a.b)),e.cells.getCell(i).style.textBrush=r,e},Hp.prototype.getFontFamily=function(e){switch(e){case"TimesRoman":return 2;case"Courier":return 1;case"Symbol":return 3;case"ZapfDingbats":return 4;default:return 0}},Hp.prototype.getFont=function(e){var t,i,a;return e.style.font||(t=e.cell.cellStyle.font&&e.cell.cellStyle.font.fontSize?e.cell.cellStyle.font.fontSize:Ue.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize,i=Ue.isNullOrUndefined(e.style.fontFamily)?j.PdfFontFamily.TimesRoman:this.getFontFamily(e.style.fontFamily),a=j.PdfFontStyle.Regular,!Ue.isNullOrUndefined(e.style.bold)&&e.style.bold&&(a|=j.PdfFontStyle.Bold),!Ue.isNullOrUndefined(e.style.italic)&&e.style.italic&&(a|=j.PdfFontStyle.Italic),!Ue.isNullOrUndefined(e.style.underline)&&e.style.underline&&(a|=j.PdfFontStyle.Underline),!Ue.isNullOrUndefined(e.style.strikeout)&&e.style.strikeout&&(a|=j.PdfFontStyle.Strikeout),new j.PdfStandardFont(i,t,a))},Hp.prototype.processCellStyle=function(e,t){var i,a,r,n;Ue.isNullOrUndefined(t.style.backgroundColor)||(i=this.pdfExportHelper.hexDecToRgb(t.style.backgroundColor),e.style.backgroundBrush=new j.PdfSolidBrush(new j.PdfColor(i.r,i.g,i.b))),Ue.isNullOrUndefined(t.style.textBrushColor)||(i=this.pdfExportHelper.hexDecToRgb(t.style.textBrushColor),e.style.textBrush=new j.PdfSolidBrush(new j.PdfColor(i.r,i.g,i.b))),Ue.isNullOrUndefined(t.style.textPenColor)||(i=this.pdfExportHelper.hexDecToRgb(t.style.textPenColor),e.style.textPen=new j.PdfPen(new j.PdfColor(i.r,i.g,i.b))),Ue.isNullOrUndefined(t.style.fontFamily)&&Ue.isNullOrUndefined(t.style.fontSize)&&Ue.isNullOrUndefined(t.style.bold)&&Ue.isNullOrUndefined(t.style.italic)&&Ue.isNullOrUndefined(t.style.underline)&&Ue.isNullOrUndefined(t.style.strikeout)||(e.style.font=this.getFont(t)),Ue.isNullOrUndefined(t.style.border)||(i=new j.PdfBorders,a=t.style.border.width,a=Ue.isNullOrUndefined(a)||"number"!=typeof a?void 0:.75*a,r=new j.PdfColor(196,196,196),Ue.isNullOrUndefined(t.style.border.color)||(n=this.pdfExportHelper.hexDecToRgb(t.style.border.color),r=new j.PdfColor(n.r,n.g,n.b)),n=new j.PdfPen(r,a),Ue.isNullOrUndefined(t.style.border.dashStyle)||(n.dashStyle=this.pdfExportHelper.getDashStyle(t.style.border.dashStyle)),i.all=n,e.style.borders=i)},Hp.prototype.applyEvent=function(){var e,t,i=jp.getClonedPivotValues(this.engine.pivotValues),a=(this.parent.exportAllPages&&(this.parent.enableVirtualization||this.parent.enablePaging)&&"Server"!==this.parent.dataSourceSettings.mode?(a=this.engine.pageSettings,this.engine.isPagingOrVirtualizationEnabled=!1,"olap"===this.parent.dataType?(this.updateOlapPageSettings(!0),t=this.parent.olapEngineModule.mdxQuery.slice(0)):this.engine.pageSettings=null,this.engine.generateGridData(this.parent.dataSourceSettings,!0,!0),this.parent.applyFormatting(this.engine.pivotValues),e=jp.getClonedPivotValues(this.engine.pivotValues),this.engine.pivotValues=i,this.engine.pageSettings=a,this.engine.isPagingOrVirtualizationEnabled=!0,"olap"===this.parent.dataType&&(this.updateOlapPageSettings(!1),this.parent.olapEngineModule.mdxQuery=t)):e=i,{pivotValues:[e]});return this.parent.trigger(U,a),this.document=new j.PdfDocument,{document:this.document,args:a}},Hp.prototype.updateOlapPageSettings=function(e){this.parent.olapEngineModule.isExporting=!!e,this.parent.exportSpecifiedPages?this.parent.olapEngineModule.exportSpeciedPages=this.parent.exportSpecifiedPages=e?this.parent.exportSpecifiedPages:void 0:(this.parent.olapEngineModule.pageSettings=e?null:this.parent.olapEngineModule.pageSettings,this.parent.olapEngineModule.isPaging=!e)},Hp.prototype.destroy=function(){this.engine&&(this.engine=null),this.exportProperties&&(this.exportProperties=null),this.document&&(this.document=null),this.pdfExportHelper&&(this.pdfExportHelper=null)};pd=Hp;function Hp(e){this.parent=e,this.pdfExportHelper=new gp}_p.prototype.getModuleName=function(){return"pager"},_p.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Lt,this.createPager,this)},_p.prototype.removeEventListener=function(){this.parent.isDestroyed||(Ue.isNullOrUndefined(this.parent.pagerSettings.template)&&this.unWireEvent(),this.parent.off(Lt,this.createPager))},_p.prototype.createPager=function(){null!==Ue.select("#"+this.parent.element.id+"pivot-pager",this.parent.element)&&(Ue.remove(Ue.select("#"+this.parent.element.id+"pivot-pager",this.parent.element)),this.destroy(),this.addEventListener());var e,t,i=this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber(),a=this.parent.pagerSettings;this.parent.enablePaging&&(t=Ue.createElement("div",{id:this.parent.element.id+"pivot-pager",className:xs+" "+(this.parent.isAdaptive||i<650?wa:"")+" "+(this.parent.enableRtl?xa:"")+" "+("Top"===this.parent.pagerSettings.position?" e-pivot-pager-top":" e-pivot-pager-bottom")+" "+(a.enableCompactView||i<400?"e-compact-view":""),styles:"width:"+(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())+"px"}),this.parent.showFieldList&&Ue.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)&&"Top"===a.position?this.parent.element.insertBefore(t,Ue.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)):this.parent.showGroupingBar&&Ue.select("#"+this.parent.element.id+" ."+fs,this.parent.element)&&"Top"===a.position?this.parent.element.insertBefore(t,Ue.select("#"+this.parent.element.id+" ."+fs,this.parent.element)):"Top"===this.parent.pagerSettings.position?this.parent.element.insertBefore(t,Ue.select("#"+this.parent.element.id+"_grid",this.parent.element)):this.parent.element.append(t),(e=this).pager=new w.Pager({enableRtl:this.parent.enableRtl,locale:this.parent.locale,template:""===a.template||a.template?a.template:Ue.initializeCSPTemplate(function(){return e.createPagerContainer()}),cssClass:this.parent.cssClass}),this.pager.isVue=this.parent.isVue,this.pager.appendTo(t),Ue.isNullOrUndefined(a.template))&&(a.showRowPager&&(!a.enableCompactView&&400<i&&new V.NumericTextBox({min:1,max:this.parent.engineModule.rowPageCount,showSpinButton:!1,format:"#",validateDecimalOnType:!0,decimals:0,strictMode:!0,value:this.parent.pageSettings.currentRowPage,enableRtl:this.parent.enableRtl,locale:this.parent.locale,width:i<669?"50px":"64px",change:this.rowPageChange.bind(this),cssClass:this.parent.cssClass}).appendTo(Ue.select("#"+this.parent.element.id+"_row_textbox",this.parent.element)),a.showRowPageSize)&&(t=this.parent.pagerSettings.rowPageSizes.slice(0),-1===this.parent.pagerSettings.rowPageSizes.indexOf(this.parent.pageSettings.rowPageSize)&&(t.push(this.parent.pageSettings.rowPageSize),t.sort(function(e,t){return e-t})),new G.DropDownList({dataSource:t,value:this.parent.pageSettings.rowPageSize,enableRtl:this.parent.enableRtl,locale:this.parent.locale,change:this.rowPageSizeChange.bind(this),popupHeight:"300px",popupWidth:"100%",width:"64px",cssClass:this.parent.cssClass}).appendTo(Ue.select("#"+this.parent.element.id+"_row_size_list",this.parent.element))),a.showColumnPager&&(!a.enableCompactView&&400<i&&new V.NumericTextBox({min:1,max:this.parent.engineModule.columnPageCount,showSpinButton:!1,format:"#",validateDecimalOnType:!0,decimals:0,strictMode:!0,value:this.parent.pageSettings.currentColumnPage,enableRtl:this.parent.enableRtl,locale:this.parent.locale,width:i<669?"50px":"64px",change:this.columnPageChange.bind(this),cssClass:this.parent.cssClass}).appendTo(Ue.select("#"+this.parent.element.id+"_column_textbox",this.parent.element)),a.showColumnPageSize)&&(t=this.parent.pagerSettings.columnPageSizes.slice(0),-1===this.parent.pagerSettings.columnPageSizes.indexOf(this.parent.pageSettings.columnPageSize)&&(t.push(this.parent.pageSettings.columnPageSize),t.sort(function(e,t){return e-t})),new G.DropDownList({dataSource:t,value:this.parent.pageSettings.columnPageSize,enableRtl:this.parent.enableRtl,locale:this.parent.locale,change:this.columnPageSizeChange.bind(this),popupHeight:"300px",popupWidth:"100%",width:"64px",cssClass:this.parent.cssClass}).appendTo(Ue.select("#"+this.parent.element.id+"_column_size_list",this.parent.element))),this.unWireEvent(),this.wireEvent())},_p.prototype.wireEvent=function(){for(var e=[].slice.call(this.parent.element.querySelectorAll("."+Ma+", ."+Oa+", ."+Pa+", ."+Da)),t=0;t<e.length;t++)Ue.EventHandler.add(e[t],"click",this.updatePageSettings,this)},_p.prototype.unWireEvent=function(){for(var e=[].slice.call(this.parent.element.querySelectorAll("."+Ma+", ."+Oa+", ."+Pa+", ."+Da)),t=0;t<e.length;t++)Ue.EventHandler.remove(e[t],"click",this.updatePageSettings)},_p.prototype.columnPageChange=function(e){this.parent.pageSettings.currentColumnPage=e.value},_p.prototype.rowPageChange=function(e){this.parent.pageSettings.currentRowPage=e.value},_p.prototype.columnPageSizeChange=function(e){this.parent.pageSettings.columnPageSize=Number(e.value)},_p.prototype.rowPageSizeChange=function(e){this.parent.pageSettings.rowPageSize=Number(e.value)},_p.prototype.updatePageSettings=function(e){e=e.target.id;switch(e){case this.parent.element.id+"_row_firstIcon":this.parent.pageSettings.currentRowPage=1;break;case this.parent.element.id+"_row_prevIcon":this.parent.pageSettings.currentRowPage=1<this.parent.pageSettings.currentRowPage?this.parent.pageSettings.currentRowPage-1:this.parent.pageSettings.currentRowPage;break;case this.parent.element.id+"_row_nextIcon":this.parent.pageSettings.currentRowPage=this.parent.pageSettings.currentRowPage<this.parent.engineModule.rowPageCount?this.parent.pageSettings.currentRowPage+1:this.parent.pageSettings.currentRowPage;break;case this.parent.element.id+"_row_lastIcon":this.parent.pageSettings.currentRowPage=this.parent.engineModule.rowPageCount;break;case this.parent.element.id+"_column_firstIcon":this.parent.pageSettings.currentColumnPage=1;break;case this.parent.element.id+"_column_prevIcon":this.parent.pageSettings.currentColumnPage=1<this.parent.pageSettings.currentColumnPage?this.parent.pageSettings.currentColumnPage-1:this.parent.pageSettings.currentColumnPage;break;case this.parent.element.id+"_column_nextIcon":this.parent.pageSettings.currentColumnPage=this.parent.pageSettings.currentColumnPage<this.parent.engineModule.columnPageCount?this.parent.pageSettings.currentColumnPage+1:this.parent.pageSettings.currentColumnPage;break;case this.parent.element.id+"_column_lastIcon":this.parent.pageSettings.currentColumnPage=this.parent.engineModule.columnPageCount}-1!==e.indexOf("_row")?this.parent.actionObj.actionName=Pi:-1!==e.indexOf("_column")&&(this.parent.actionObj.actionName=Ni)},_p.prototype.createPagerContainer=function(){var e,t,i=this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber(),a=this.parent.pagerSettings,r=(a.showRowPager&&(e=this.createPagerItems("row",a,i)),a.showColumnPager&&(t=this.createPagerItems("column",a,i)),Ue.createElement("div",{id:this.parent.element.id+"_mainDiv",className:"e-pivot-pager-maindiv "+(a.showRowPager&&a.showColumnPager?"":"e-pivot-pager-single-maindiv")+" "+(a.isInversed?"e-inverse-view":"")})),i=Ue.createElement("div",{id:this.parent.element.id+"_vertical_separator",className:this.parent.isAdaptive||i<650?"e-pivotview-hseparator":"e-pivotview-vseparator"});return a.isInversed&&a.showColumnPager&&a.showRowPager?r.append(t,i,e):a.showColumnPager&&a.showRowPager?r.append(e,i,t):a.showRowPager&&!a.showColumnPager?r.append(e):!a.showRowPager&&a.showColumnPager&&r.append(t),r.outerHTML},_p.prototype.createPagerItems=function(e,t,i){var a=!t.showRowPager||!t.showColumnPager,r=Ue.createElement("div",{id:this.parent.element.id+"_"+e+"_mainDiv",className:"row"===e?"e-pivot-pager-row-maindiv "+(t.showRowPageSize?"":Ts):"e-pivot-pager-column-maindiv "+(t.showColumnPageSize?"":Ts)}),n=Ue.createElement("div",{id:this.parent.element.id+"_"+e+"_pagerSettings",className:"row"===e?"e-pivot-row-pager-settings":"e-pivot-column-pager-settings"}),s=(this.parent.pagerSettings.showColumnPager&&this.parent.pagerSettings.showRowPager&&n.classList.add("e-pivot-both-pager-settings"),"column"===e&&1===this.parent.pageSettings.currentColumnPage||"row"===e&&1===this.parent.pageSettings.currentRowPage),o="column"===e&&this.parent.pageSettings.currentColumnPage===this.parent.engineModule.columnPageCount||"row"===e&&this.parent.pageSettings.currentRowPage===this.parent.engineModule.rowPageCount,l=Ue.createElement("div",{id:this.parent.element.id+"_"+e+"_NavContainer",attrs:{class:"e-pivot-pager-nav-container "+ws}}),d=Ue.createElement("div",{id:this.parent.element.id+"_"+e+"_PageInfoContainer",attrs:{class:"e-pivot-pager-info-container "+ws}}),p=Ue.createElement("div",{id:this.parent.element.id+"_"+e+"_firstIcon",attrs:{class:"e-first e-icons e-icon-first"+(s?" e-firstpagedisabled "+W:" e-firstpage e-pager-default"),title:this.parent.localeObj.getConstant("goToFirstPage"),"aria-label":this.parent.localeObj.getConstant("goToFirstPage"),tabindex:"0",role:"button"}}),s=Ue.createElement("div",{id:this.parent.element.id+"_"+e+"_prevIcon",attrs:{class:"e-prev e-icons e-icon-prev"+(s?" e-prevpagedisabled "+W:" e-prevpage e-pager-default"),title:this.parent.localeObj.getConstant("goToPreviousPage"),"aria-label":this.parent.localeObj.getConstant("goToPreviousPage"),tabindex:"0",role:"button"}}),h=Ue.createElement("span",{id:this.parent.element.id+"_"+e+"_pagerString",className:"row"===e?"e-pivotview-row-pagerString":"e-pivotview-column-pagerString"}),u=(h.innerText="row"===e?this.parent.localeObj.getConstant("rowPage"):this.parent.localeObj.getConstant("columnPage"),Ue.createElement("input",{id:this.parent.element.id+"_"+e+"_textbox",className:"row"===e?"e-pivot-pager-row-dropdown":"e-pivot-pager-column-dropdown",attrs:{placeholder:"1"}})),c=Ue.createElement("div",{id:this.parent.element.id+"_"+e+"_of_string_mainDiv",className:"row"===e?"e-pivot-row-of-string-maindiv":"e-pivot-column-of-string-maindiv"}),g=Ue.createElement("span",{id:this.parent.element.id+"_"+e+"_ofString",className:"row"===e?"e-pivot-row-of-string":"e-pivot-column-of-string"}),m=(g.innerText=this.parent.localeObj.getConstant("of")+" ",Ue.createElement("span",{id:this.parent.element.id+"_"+e+"_pagerNumber",className:"row"===e?"e-pivotview-row-pagerNumber":"e-pivotview-column-pagerNumber"})),S=(m.innerText=("row"===e?this.parent.engineModule.rowPageCount:this.parent.engineModule.columnPageCount).toString(),Ue.createElement("div",{id:this.parent.element.id+"_"+e+"_nextIcon",attrs:{class:"e-next e-icons e-icon-next"+(o?" e-nextpagedisabled "+W:" e-nextpage e-pager-default"),title:this.parent.localeObj.getConstant("goToNextPage"),"aria-label":this.parent.localeObj.getConstant("goToNextPage"),tabindex:"0",role:"button"}})),o=Ue.createElement("div",{id:this.parent.element.id+"_"+e+"_lastIcon",attrs:{class:"e-last e-icons e-icon-last"+(o?" e-lastpagedisabled "+W:" e-lastpage e-pager-default"),title:this.parent.localeObj.getConstant("goToLastPage"),"aria-label":this.parent.localeObj.getConstant("goToLastPage"),tabindex:"0",role:"button"}}),f=Ue.createElement("span",{id:this.parent.element.id+"_"+e+"_size",className:"row"===e?"e-pivotview-row-size":"e-pivotview-column-size"}),v=(f.innerText="row"===e?this.parent.localeObj.getConstant("rowPerPage"):this.parent.localeObj.getConstant("columnPerPage"),Ue.createElement("div",{id:this.parent.element.id+"_"+e+"_size_list_maindiv",className:"e-pager-dropdown "+ws})),y=Ue.createElement("div",{id:this.parent.element.id+"_"+e+"_size_list",className:"row"===e?"e-pivot-row-size-list":"e-pivot-column-size-list"}),b=Ue.createElement("div",{id:this.parent.element.id+"_"+e+"_text_div",className:"e-pivotview-text-div"}),C=Ue.createElement("div",{id:this.parent.element.id+"_"+e+"_text_div_1",className:"e-pivotview-text-div-1"});return v.append(y),t.enableCompactView||i<400?(l.append(s,S),n.append(l)):(c.append(g,m),l.append(p,s,S,o),d.append(u,c),n.append(l,d)),("row"===e&&t.showRowPager||"column"===e&&t.showColumnPager)&&(("column"===e&&!t.showRowPager||"row"===e&&!t.showColumnPager)&&a&&C.append(f,v),t.showColumnPager&&t.showRowPager||!a?("row"===e&&t.showRowPageSize||"column"===e&&t.showColumnPageSize?!t.enableCompactView&&400<i?(b.append(h,f),C.append(n,v)):(b.append(h,n),C.append(f,v)):("row"===e&&!t.showRowPageSize||"column"===e&&!t.showColumnPageSize)&&(b.append(h),C.append(n)),r.append(b,C)):("row"===e&&(t.showRowPageSize?r.append(n,h,C):r.append(n,h)),"column"===e&&(t.showColumnPageSize?r.append(n,h,C):r.append(n,h)))),r},_p.prototype.destroy=function(){var e,t;this.removeEventListener(),this.parent.pagerModule&&((t=(e=Ue.select("#"+this.parent.element.id+"_column_textbox",this.parent.element))?Ue.getInstance(e,V.NumericTextBox):null)&&(t.destroy(),t=null),(t=(e=Ue.select("#"+this.parent.element.id+"_row_textbox",this.parent.element))?Ue.getInstance(e,V.NumericTextBox):null)&&(t.destroy(),t=null),(t=(e=Ue.select("#"+this.parent.element.id+"_column_size_list",this.parent.element))?Ue.getInstance(e,G.DropDownList):null)&&(t.destroy(),t=null),(t=(e=Ue.select("#"+this.parent.element.id+"_row_size_list",this.parent.element))?Ue.getInstance(e,G.DropDownList):null)&&(t.destroy(),t=null),this.pager&&this.pager.destroy(),this.pager=null)};cd=_p;function _p(e){this.parent=e,(this.parent.pagerModule=this).addEventListener()}Bp.prototype.render=function(){var e=Ue.createElement("div",{id:this.parent.element.id+"_Container",className:Ea+" "+("olap"===this.parent.dataType?"e-olapfieldlist-container":""),styles:"width:"+this.parent.element.style.width});this.parent.isAdaptive?Ue.addClass([e],wa):Ue.removeClass([e],wa),this.parent.enableRtl?Ue.addClass([e],xa):Ue.removeClass([e],xa),this.parent.cssClass&&Ue.addClass([e],this.parent.cssClass.split(" ")),this.parent.enableFieldSearching?Ue.addClass([e],ja):Ue.removeClass([e],ja),this.parentElement=Ue.createElement("div",{className:"e-field-list-container"}),this.parent.element.appendChild(e),this.parent.isAdaptive&&(e.removeAttribute("style"),this.parentElement=Ue.createElement("div",{className:"e-adaptive-container"}),this.renderAdaptiveLayout(e)),"Popup"===this.parent.renderMode?(this.renderFieldListDialog(e),this.unWireDialogEvent(this.parent.element.querySelector("."+Fa)),this.wireDialogEvent(this.parent.element.querySelector("."+Fa))):this.renderStaticLayout(e)},Bp.prototype.renderStaticLayout=function(e){var t,i;this.parent.isAdaptive||(t=Ue.createElement("div",{className:"e-field-list-title"}),(i=Ue.createElement("div",{className:"e-title-content"})).innerText=this.parent.localeObj.getConstant("staticFieldList"),t.appendChild(i),t.appendChild(this.createCalculatedButton()),Ue.addClass([e],Ia),e.appendChild(t),e.appendChild(this.parentElement),Ue.addClass([e],Ia),this.parent.allowDeferLayoutUpdate&&(e.appendChild(this.createDeferUpdateButtons()),this.renderDeferUpdateButtons(e)))},Bp.prototype.renderDeferUpdateButtons=function(e){this.parent.allowDeferLayoutUpdate&&(this.deferUpdateCheckBox=new Y.CheckBox({label:this.parent.localeObj.getConstant("deferLayoutUpdate"),checked:this.parent.isPopupView&&this.parent.pivotGridModule?!!Ue.isNullOrUndefined(this.parent.pivotGridModule.pivotDeferLayoutUpdate)||this.parent.pivotGridModule.pivotDeferLayoutUpdate:!!Ue.isNullOrUndefined(this.parent.isDeferLayoutUpdate)||this.parent.isDeferLayoutUpdate,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,change:this.onCheckChange.bind(this),cssClass:this.parent.cssClass}),this.deferUpdateCheckBox.isStringTemplate=!0,this.deferUpdateCheckBox.appendTo(Ue.select("#"+this.parent.element.id+"DeferUpdateCheckBox",e)),this.deferUpdateApplyButton=new Y.Button({cssClass:"e-defer-apply-button e-defer-update-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("apply"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,isPrimary:!0,disabled:this.parent.isPopupView&&this.parent.pivotGridModule?!Ue.isNullOrUndefined(this.parent.pivotGridModule.pivotDeferLayoutUpdate)&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate:!Ue.isNullOrUndefined(this.parent.isDeferLayoutUpdate)&&!this.parent.isDeferLayoutUpdate}),this.deferUpdateApplyButton.isStringTemplate=!0,this.deferUpdateApplyButton.appendTo(Ue.select("#"+this.parent.element.id+"_DeferUpdateButton1",e)),this.deferUpdateApplyButton.element.onclick=("Fixed"===this.parent.renderMode?this.applyButtonClick:this.onDeferUpdateClick).bind(this)),this.deferUpdateCancelButton=new Y.Button({cssClass:"e-defer-cancel-button "+Sr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.allowDeferLayoutUpdate?this.parent.localeObj.getConstant("cancel"):this.parent.localeObj.getConstant("close"),enableRtl:this.parent.enableRtl,isPrimary:!this.parent.allowDeferLayoutUpdate,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,disabled:this.parent.isPopupView&&this.parent.pivotGridModule&&this.parent.pivotGridModule.refreshing?!(!this.parent.allowDeferLayoutUpdate||Ue.isNullOrUndefined(this.parent.pivotGridModule.pivotDeferLayoutUpdate)||this.parent.pivotGridModule.pivotDeferLayoutUpdate):!(!this.parent.refreshing||Ue.isNullOrUndefined(this.parent.isDeferLayoutUpdate)||!this.parent.allowDeferLayoutUpdate||this.parent.isDeferLayoutUpdate)}),this.deferUpdateCancelButton.isStringTemplate=!0,this.deferUpdateCancelButton.appendTo(Ue.select("#"+this.parent.element.id+"_DeferUpdateButton2",e)),this.parent.allowDeferLayoutUpdate&&(!this.parent.isDeferLayoutUpdate&&"Popup"===this.parent.renderMode&&this.parent.refreshing||this.parent.isPopupView&&this.parent.pivotGridModule&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate&&this.parent.pivotGridModule.refreshing)&&(this.deferUpdateApplyButton.element.style.display="none",this.deferUpdateCancelButton.setProperties({content:this.parent.localeObj.getConstant("close")}),this.deferUpdateCancelButton.isPrimary=!0,this.deferUpdateApplyButton.disabled=this.parent.isPopupView?this.parent.pivotGridModule.pivotDeferLayoutUpdate:this.parent.isDeferLayoutUpdate,this.deferUpdateCancelButton.disabled=this.parent.isPopupView?this.parent.pivotGridModule.pivotDeferLayoutUpdate:this.parent.isDeferLayoutUpdate),this.deferUpdateCancelButton.element.onclick=this.onCloseFieldList.bind(this)},Bp.prototype.createDeferUpdateButtons=function(){var e=Ue.createElement("div",{className:"e-layout-footer"}),t=(this.parent.allowDeferLayoutUpdate&&(i=Ue.createElement("div",{className:"e-checkbox-layout",attrs:{title:this.parent.localeObj.getConstant("deferLayoutUpdate")}}),t=Ue.createElement("input",{id:this.parent.element.id+"DeferUpdateCheckBox"}),i.appendChild(t),e.appendChild(i)),Ue.createElement("div",{className:"e-button-layout"})),i=(this.parent.allowDeferLayoutUpdate&&(i=Ue.createElement("button",{id:this.parent.element.id+"_DeferUpdateButton1",attrs:{type:"button",title:this.parent.localeObj.getConstant("apply")}}),t.appendChild(i)),Ue.createElement("button",{id:this.parent.element.id+"_DeferUpdateButton2",attrs:{type:"button",title:this.parent.localeObj.getConstant("cancel")}}));return t.appendChild(i),e.appendChild(t),e},Bp.prototype.onCheckChange=function(e){e.checked&&(this.parent.clonedDataSource=Ce.getClonedDataSourceSettings(this.parent.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=Ce.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),this.parent.clonedFieldList=Ce.getClonedFieldList(this.parent.pivotFieldList)),this.parent.isDeferLayoutUpdate=e.checked,this.parent.isPopupView&&this.parent.pivotGridModule&&(this.parent.pivotGridModule.pivotDeferLayoutUpdate=e.checked),"Fixed"===this.parent.renderMode?(this.deferUpdateApplyButton.setProperties({disabled:!e.checked}),this.deferUpdateCancelButton.setProperties({disabled:!e.checked})):this.parent.allowDeferLayoutUpdate&&e.checked?(this.deferUpdateApplyButton.element.style.display="",this.deferUpdateCancelButton.setProperties({content:this.parent.localeObj.getConstant("cancel")}),this.deferUpdateCancelButton.isPrimary=!1):(this.deferUpdateApplyButton.element.style.display="none",this.deferUpdateCancelButton.setProperties({content:this.parent.localeObj.getConstant("close")}),this.deferUpdateCancelButton.isPrimary=!0),Object.keys(this.parent.clonedFieldList).length!==Object.keys(this.parent.pivotFieldList).length&&this.parent.calculatedFieldModule&&this.parent.calculatedFieldModule.field&&"pivot"===this.parent.dataType&&(this.parent.engineModule.fields=Object.keys(this.parent.clonedFieldList)),this.onCloseFieldList(null,!0)},Bp.prototype.applyButtonClick=function(){"pivotfieldlist"===this.parent.getModuleName()&&this.parent.allowDeferLayoutUpdate&&(this.parent.pivotChange=!1),this.parent.isDeferUpdateApplied=!0,this.parent.updateDataSource(!1);var e=this.parent;e.axisFieldModule.render(),e.clonedDataSource=Ce.getClonedDataSourceSettings(e.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=Ce.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),e.clonedFieldList=Ce.getClonedFieldList(e.pivotFieldList)},Bp.prototype.onCloseFieldList=function(e,t){if((this.parent.allowDeferLayoutUpdate||t)&&(!this.parent.isPopupView||this.parent.pivotGridModule&&""!==this.parent.pivotGridModule.actionObj.actionName||""!==this.parent.actionObj.actionName)){if(this.parent.setProperties({dataSourceSettings:this.parent.clonedDataSource},!0),"olap"===this.parent.dataType)if(this.parent.olapEngineModule.fieldList=Ce.getClonedFieldList(this.parent.clonedFieldList),this.parent.olapEngineModule.fieldListData=Ce.cloneOlapFieldSettings(this.parent.clonedFieldListData),this.parent.isPopupView)this.parent.isPopupView&&this.parent.clonedFieldListData&&0<Object.keys(this.parent.clonedFieldListData).length&&(this.parent.olapEngineModule.fieldListData=this.parent.clonedFieldListData);else for(var i=0,a=Object.keys(this.parent.clonedFieldList);i<a.length;i++){var r=a[i],r=this.parent.clonedFieldList[r];this.parent.olapEngineModule.updateFieldlistData(r.id,r.isSelected)}else this.parent.engineModule.fieldList=Ce.getClonedFieldList(this.parent.clonedFieldList);this.parent.updateDataSource(!1,!0)}var n,s;(!this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate)&&t&&(this.parent.pivotChange=!1),this.parent.allowDeferLayoutUpdate&&this.parent.isPopupView&&this.parent.pivotGridModule&&!this.parent.isAdaptive&&(this.parent.pivotGridModule.actionObj.actionName="",this.parent.pivotGridModule.engineModule=this.parent.engineModule,this.parent.pivotGridModule.olapEngineModule=this.parent.olapEngineModule,this.parent.pivotGridModule.setProperties({dataSourceSettings:this.parent.clonedDataSource},!0)),this.parent.allowDeferLayoutUpdate&&this.parent.allowCalculatedField&&"pivot"===this.parent.dataType&&!this.parent.isAdaptive&&(this.parent.engineModule.fieldList=this.parent.pivotFieldList=Ce.getClonedFieldList(this.parent.clonedFieldList),n=Object.keys(this.parent.engineModule.fieldList),this.parent.allowCalculatedField)&&n.length!==this.parent.engineModule.fields.length&&(s=[],this.parent.engineModule.fields.forEach(function(e){-1!==n.indexOf(e)&&(s[s.length]=e)}),this.parent.engineModule.fields=s),"Popup"!==this.parent.renderMode||t?this.parent.actionObj.actionName=ba:(this.parent.dialogRenderer.fieldListDialog.hide(),this.parent.actionObj.actionName=Ai),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()},Bp.prototype.renderFieldListDialog=function(e){var t,i=Ue.createElement("div",{className:Fa+" "+z+" e-select-table",attrs:{tabindex:"0",title:this.parent.localeObj.getConstant("fieldList"),"aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("fieldList"),role:"button"}});this.parent.element.appendChild(i),this.parent.isAdaptive?(t='<div class=e-title-mobile-header><span class="'+z+" "+Kn+'"></span><div class=e-title-mobile-content>'+this.parent.localeObj.getConstant("fieldList")+"</div></div>",i=[{click:this.showFieldListDialog.bind(this),isFlat:!1,buttonModel:{cssClass:Lr+" "+Rr+" "+kr+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:z+" "+jr,isPrimary:!0}},{click:this.showCalculatedField.bind(this),isFlat:!1,buttonModel:{cssClass:Ar+" "+Rr+" "+kr+" "+W+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:z+" "+jr,enableRtl:this.parent.enableRtl,isPrimary:!0}}],this.fieldListDialog=new P.Dialog({animationSettings:{effect:this.parent.enableRtl?"SlideRight":"SlideLeft"},header:t,content:this.parentElement,isModal:!0,showCloseIcon:!1,visible:!1,allowDragging:!1,closeOnEscape:!1,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"100%",height:"100%",position:{X:"center",Y:"center"},buttons:i,target:document.body,cssClass:this.parent.cssClass,close:this.removeFieldListIcon.bind(this),open:this.dialogOpen.bind(this)}),this.fieldListDialog.isStringTemplate=!0,this.fieldListDialog.appendTo(e),Ue.setStyleAttribute(Ue.select("#"+e.id+"_dialog-content",e),{padding:"0"}),i=e.querySelector(".e-footer-content"),Ue.addClass([i],Ha),Ue.removeClass([i.querySelector("."+Ar)],"e-flat"),Ue.removeClass([i.querySelector("."+Lr)],"e-flat"),this.fieldListDialog.element.querySelector("."+Kn).onclick=(this.parent.allowDeferLayoutUpdate?this.onDeferUpdateClick:this.onCloseFieldList).bind(this)):(i=this.createDeferUpdateButtons().outerHTML,t="<div class="+Fr+"><div class=e-title-content>"+this.parent.localeObj.getConstant("fieldList")+"</div></div>",this.fieldListDialog=new P.Dialog({animationSettings:{effect:"Zoom"},header:t,content:this.parentElement,isModal:!1,showCloseIcon:!1,visible:!1,allowDragging:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:this.parent.element.style.width,position:{X:"center",Y:this.parent.element.offsetTop},footerTemplate:i,closeOnEscape:!1,cssClass:this.parent.cssClass,target:Ue.isNullOrUndefined(this.parent.target)?document.body:"string"==typeof this.parent.target?document.querySelector(this.parent.target):this.parent.target,close:this.removeFieldListIcon.bind(this)}),this.fieldListDialog.isStringTemplate=!0,this.fieldListDialog.appendTo(e),this.renderDeferUpdateButtons(e),Ue.setStyleAttribute(Ue.select("#"+e.id+"_title",e),{width:"100%"}),e.querySelector("."+Fr).appendChild(this.createCalculatedButton()))},Bp.prototype.dialogOpen=function(){4===this.lastTabIndex?(this.adaptiveElement.items[this.lastTabIndex].content="",this.adaptiveElement.dataBind(),this.parent.notify(Ft,{})):this.adaptiveElement.refresh()},Bp.prototype.updateDataSource=function(e){for(var t=["filters","columns","rows","values"],i=0,a=e;i<a.length;i++){var r=a[i],n=t[this.adaptiveElement.selectedItem];this.parent.pivotCommon.dataSourceUpdate.control="pivotview"!==this.parent.getModuleName()&&this.parent.pivotGridModule||this.parent,this.parent.pivotCommon.dataSourceUpdate.updateDataSource(r,n,-1)}this.parent.axisFieldModule.render(),this.parent.allowDeferLayoutUpdate?this.parent.triggerPopulateEvent():this.parent.updateDataSource(!0)},Bp.prototype.onDeferUpdateClick=function(){this.parent.updateDataSource(),this.parent.dialogRenderer.fieldListDialog.hide()},Bp.prototype.renderAdaptiveLayout=function(e){var t=Ue.createElement("div",{className:Ha}),i=(e.appendChild(this.parentElement),[{header:{text:this.parent.localeObj.getConstant("filters")},content:this.createAxisTable("filters")},{header:{text:this.parent.localeObj.getConstant("columns")},content:this.createAxisTable("columns")},{header:{text:this.parent.localeObj.getConstant("rows")},content:this.createAxisTable("rows")},{header:{text:this.parent.localeObj.getConstant("values")},content:this.createAxisTable("values")},{header:{text:this.parent.localeObj.getConstant("createCalculatedField")},content:"Calculated Field Related UI"}]);this.parent.allowCalculatedField||i.pop(),this.adaptiveElement=new O.Tab({heightAdjustMode:"Auto",items:i,height:"100%",enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,selected:this.tabSelect.bind(this),cssClass:this.parent.cssClass}),"Fixed"===this.parent.renderMode?(t.appendChild(this.createAddButton()),Ue.addClass([e],Ia),this.adaptiveElement.isStringTemplate=!0,this.adaptiveElement.appendTo(this.parentElement),this.parentElement.appendChild(t)):(this.adaptiveElement.isStringTemplate=!0,this.adaptiveElement.appendTo(this.parentElement))},Bp.prototype.tabSelect=function(e){var t=Ue.closest(this.parentElement,"."+Ea);this.lastTabIndex=e.selectedIndex,t&&t.querySelector("."+Lr)&&(4!==e.selectedIndex?(Ue.addClass([t.querySelector("."+Ar)],W),Ue.removeClass([t.querySelector("."+Lr)],W)):(Ue.removeClass([t.querySelector("."+Ar)],W),Ue.addClass([t.querySelector("."+Lr)],W))),4===e.selectedIndex?(this.adaptiveElement.items[4].content="",this.adaptiveElement.dataBind(),this.parent.notify(Ft,{})):this.parent.axisFieldModule.render()},Bp.prototype.createCalculatedButton=function(){var e=Ue.createElement("button",{id:this.parent.element.id+"_CalculatedField",attrs:{type:"button",tabindex:"0","aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("CalculatedField")}}),t=new Y.Button({cssClass:"e-calculated-field "+W+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("CalculatedField"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});return t.isStringTemplate=!0,t.appendTo(e),this.parent.calculatedFieldModule&&Ue.removeClass([e],W),t.element.onclick=this.showCalculatedField.bind(this),e},Bp.prototype.createAddButton=function(){var e=Ue.createElement("div",{className:Ha+"-content"}),t=Ue.createElement("div",{}),i=Ue.createElement("div",{}),a=new Y.Button({cssClass:Ar+" "+Rr+" "+kr+" "+W+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:z+" "+jr,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),r=new Y.Button({cssClass:Lr+" "+Rr+" "+kr+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:z+" "+jr,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});return r.isStringTemplate=!0,r.appendTo(t),a.isStringTemplate=!0,a.appendTo(i),e.appendChild(t),e.appendChild(i),a.element.onclick=this.showCalculatedField.bind(this),r.element.onclick=this.showFieldListDialog.bind(this),e},Bp.prototype.createAxisTable=function(e){var t=Ue.createElement("div",{className:Aa+"-"+e}),e=Ue.createElement("div",{className:za+" e-"+e}),i=Ue.createElement("span",{className:Wa});return i.innerText=this.parent.localeObj.getConstant("addPrompt"),t.appendChild(e),t.appendChild(i),t},Bp.prototype.showCalculatedField=function(){try{if(!this.parent.isAdaptive){if(this.parent.actionObj.actionName=Ci,this.parent.actionBeginMethod())return;this.parent.dialogRenderer.fieldListDialog&&(this.parent.dialogRenderer.fieldListDialog.hide(),Ue.addClass([this.parent.element.querySelector("."+Fa)],Ta))}this.parent.notify(Ft,{})}catch(e){this.parent.actionFailureMethod(e)}},Bp.prototype.showFieldListDialog=function(){var e=this.adaptiveElement.selectedItem;this.parent.treeViewModule.render(e)},Bp.prototype.onShowFieldList=function(){if(this.parent.actionObj.actionName=Yt,!this.parent.actionBeginMethod()){this.parent.actionObj.actionName="";try{this.parent.allowDeferLayoutUpdate&&(this.parent.isAdaptive&&this.parent.axisFieldModule.render(),this.parent.clonedDataSource=Ce.getClonedDataSourceSettings(this.parent.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=Ce.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),this.parent.clonedFieldList=Ce.getClonedFieldList(this.parent.pivotFieldList)),Ue.addClass([this.parent.element.querySelector("."+Fa)],Ta),this.parent.dialogRenderer.fieldListDialog.show(),this.parent.dialogRenderer.fieldListDialog.element.style.top=parseInt(this.parent.dialogRenderer.fieldListDialog.element.style.top,10)<0?"0px":this.parent.dialogRenderer.fieldListDialog.element.style.top}catch(e){this.parent.actionFailureMethod(e)}}},Bp.prototype.removeFieldListIcon=function(){this.parent.isAdaptive&&this.parent.allowCalculatedField&&this.parent.calculatedFieldModule&&this.adaptiveElement&&4===this.adaptiveElement.selectedItem&&(Ue.select("#"+this.parent.element.id+"droppable",this.adaptiveElement.element)?this.parent.calculatedFieldModule.updateAdaptiveCalculatedField(!1):this.parent.notify(Ft,{edit:!1})),document.getElementById(this.parent.element.id+"calculateddialog")||Ue.removeClass([this.parent.element.querySelector("."+Fa)],Ta)},Bp.prototype.keyPress=function(e){13===e.keyCode&&e.target&&(e.target.click(),e.preventDefault())},Bp.prototype.wireDialogEvent=function(e){Ue.EventHandler.add(e,"keydown",this.keyPress,this),Ue.EventHandler.add(e,"click",this.onShowFieldList,this)},Bp.prototype.unWireDialogEvent=function(e){Ue.EventHandler.remove(e,"keydown",this.keyPress),Ue.EventHandler.remove(e,"click",this.onShowFieldList)},Bp.prototype.destroy=function(){"Popup"===this.parent.renderMode&&this.unWireDialogEvent(this.parent.element.querySelector("."+Fa)),this.deferUpdateCheckBox&&!this.deferUpdateCheckBox.isDestroyed&&(this.deferUpdateCheckBox.destroy(),this.deferUpdateCheckBox=null),this.deferUpdateApplyButton&&!this.deferUpdateApplyButton.isDestroyed&&(this.deferUpdateApplyButton.destroy(),this.deferUpdateApplyButton=null),this.deferUpdateCancelButton&&!this.deferUpdateCancelButton.isDestroyed&&(this.deferUpdateCancelButton.destroy(),this.deferUpdateCancelButton=null),this.adaptiveElement&&!this.adaptiveElement.isDestroyed&&(this.adaptiveElement.destroy(),this.adaptiveElement=null),"Popup"===this.parent.renderMode&&(this.fieldListDialog&&!this.fieldListDialog.isDestroyed&&(this.fieldListDialog.destroy(),this.fieldListDialog=null),document.getElementById(this.parent.element.id+"_Container"))&&Ue.remove(document.getElementById(this.parent.element.id+"_Container"))};var Up=Bp;function Bp(e){this.parent=e}C.prototype.render=function(e){var t,i,a;this.parentElement=this.parent.dialogRenderer.parentElement,this.fieldListSort=(this.parent.pivotGridModule||this.parent).defaultFieldListOrder,this.fieldListSort="Ascending"===this.fieldListSort?"Ascend":"Descending"===this.fieldListSort?"Descend":"None",this.parent.isAdaptive?this.renderTreeDialog(e):(e=Ue.createElement("div",{className:"e-field-table "+("olap"===this.parent.dataType?"e-olap-field-table":"")}),(i=Ue.createElement("div",{className:"e-field-header",attrs:{title:this.parent.localeObj.getConstant("allFields")}})).innerText=this.parent.localeObj.getConstant("allFields"),t=Ue.createElement("div",{className:Ra+" "+Cn}),this.treeViewElement=Ue.createElement("div",{id:this.parent.element.id+"_TreeView",className:Aa+" "+("olap"===this.parent.dataType?"e-olap-field-list-tree":"")}),(a=Ue.createElement("div",{className:"e-field-header-container"})).appendChild(i),e.appendChild(a),this.updateSortElements(a),this.parent.enableFieldSearching&&(i=Ue.createElement("div",{id:this.parent.element.id+"_SearchDiv",attrs:{tabindex:"-1"},className:"e-field-list-search"}),a=Ue.createElement("input",{attrs:{type:"text"}}),i.appendChild(a),this.fieldSearch=new V.TextBox({placeholder:this.parent.localeObj.getConstant("search"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-field-list-search-input"+(this.parent.cssClass?" "+this.parent.cssClass:""),input:this.textChange.bind(this),showClearButton:!0}),this.fieldSearch.isStringTemplate=!0,this.fieldSearch.appendTo(a),this.fieldSearch.addIcon("append","e-field-list-search-icon "+z),(a=Ue.createElement("div",{className:En+" "+W})).innerText=this.parent.localeObj.getConstant("noMatches"),e.appendChild(i),e.appendChild(a)),t.appendChild(this.treeViewElement),e.appendChild(t),this.parentElement.appendChild(e),"Fixed"===this.parent.renderMode&&(i=Ue.createElement("div",{className:"e-center-div"}),(a=Ue.createElement("div",{className:"e-center-title"})).innerText=this.parent.localeObj.getConstant("centerHeader"),this.parentElement.appendChild(i),this.parentElement.appendChild(a)),this.renderTreeView())},C.prototype.updateSortElements=function(e){for(var t={None:"sortNone",Ascend:"sortAscending",Descend:"sortDescending"},i=0,a=Object.keys(t);i<a.length;i++){var r=a[i],r=Ue.createElement("span",{attrs:{tabindex:"0","aria-disabled":"false","aria-label":"Sort "+r,"data-sort":r,title:this.parent.localeObj.getConstant(t[r]),role:"button"},className:z+" e-sort-"+r.toLowerCase()+" "+(this.fieldListSort===r?"e-selected":"")});e.appendChild(r),this.unWireFieldListEvent(r),this.wireFieldListEvent(r)}},C.prototype.renderTreeView=function(){this.fieldTable=new O.TreeView({fields:{dataSource:this.getTreeData(),id:"id",text:"caption",isChecked:"isSelected",parentID:"pid",iconCss:"spriteCssClass"},nodeChecked:this.nodeChecked.bind(this),nodeClicked:this.nodeStateChange.bind(this),keyPress:this.nodeStateChange.bind(this),cssClass:"e-field-list-tree"+(this.parent.cssClass?" "+this.parent.cssClass:""),showCheckBox:!0,allowDragAndDrop:!0,sortOrder:"None",loadOnDemand:"olap"!==this.parent.dataType&&!this.parent.enableFieldSearching,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,nodeDragStart:this.dragStart.bind(this),nodeDragStop:this.dragStop.bind(this),drawNode:this.updateTreeNode.bind(this),nodeExpanding:this.updateNodeIcon.bind(this),nodeCollapsed:this.updateNodeIcon.bind(this),nodeSelected:function(e){Ue.removeClass([e.node],"e-active"),e.cancel=!0}}),this.treeViewElement.innerHTML="",this.fieldTable.isStringTemplate=!0,this.fieldTable.appendTo(this.treeViewElement);var e="Fixed"===this.parent.renderMode?this.parent.element:this.parentElement;Ue.isNullOrUndefined(e.querySelector("."+Aa))||(Ue.getInstance(e.querySelector("."+Aa),O.TreeView).dragObj.enableAutoScroll=!1)},C.prototype.updateNodeIcon=function(e){var t;"olap"===this.parent.dataType&&(e.node&&e.node.querySelector(".e-list-icon")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-icon")?(t=e.node.querySelector(".e-list-icon"),Ue.removeClass([t],"e-folderCDB-icon"),Ue.addClass([t],"e-folderCDB-open-icon")):e.node&&e.node.querySelector(".e-list-icon")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-open-icon")&&(t=e.node.querySelector(".e-list-icon"),Ue.removeClass([t],"e-folderCDB-open-icon"),Ue.addClass([t],"e-folderCDB-icon")))},C.prototype.updateTreeNode=function(e){var t,i=!1,a=("olap"===this.parent.dataType?i=this.updateOlapTreeNode(e):e.nodeData.hasChildren?(i=!1,e.node.querySelector("."+Qn).style.display="none",Ue.addClass([e.node],qa)):i=!0,Ue.isNullOrUndefined(e.nodeData.pid)||Ue.addClass([e.node],Va),e.node.querySelector("."+Ir));if(e.node.querySelector(".e-list-icon")&&a&&(t=e.node.querySelector(".e-list-icon"),a.insertBefore(t,e.node.querySelector(".e-list-text"))),i&&!this.parent.isAdaptive&&(t=Ce.getFieldInfo(e.nodeData.id,this.parent),i=!1,i=Ue.createElement("span",{attrs:{tabindex:"-1",title:!t.fieldItem||t.fieldItem.allowDragAndDrop?this.parent.localeObj.getConstant("drag"):"","aria-disabled":"false"},className:z+" "+ar+" "+(!t.fieldItem||t.fieldItem.allowDragAndDrop?"":rr)}),e.node.querySelector("."+Qn))&&!e.node.querySelector(".cls.DRAG_CLASS")&&a&&a.insertBefore(i,e.node.querySelector("."+Qn)),e.node.querySelector("."+cr)&&Ue.addClass([e.node.querySelector("."+qr)],Vr),this.parent.enableFieldSearching&&this.isSearching){var r=e.node;if("olap"===this.parent.dataType)for(var n=r.getAttribute("data-uid"),s=this.parent.pivotCommon.eventBase.searchListItem,o=0;o<this.parentIDs.length;o++){n===this.parentIDs[o]&&Ue.addClass([r],W);for(var l=0,d=s;l<d.length;l++){var p=d[l],p=this.parent.pivotCommon.eventBase.getParentIDs(this.fieldTable,p.getAttribute("data-uid"),[]);if(-1<Ce.inArray(n,p)){Ue.removeClass([r],W);break}}}else for(o=0;o<this.nonSearchList.length;o++){if(r.textContent===this.nonSearchList[o].textContent){Ue.addClass([r],W);break}if(r.innerText===this.nonSearchList[o].textContent){Ue.addClass([r],W);break}}}},C.prototype.updateOlapTreeNode=function(e){var t=!1;return"olap"===this.parent.dataType?(e.node&&e.node.querySelector(".e-calcMemberGroupCDB,.e-measureGroupCDB-icon,.e-folderCDB-icon,.e-folderCDB-open-icon,.e-dimensionCDB-icon,.e-kpiCDB-icon")&&(e.node.querySelector("."+Qn).style.display="none"),e.node&&e.node.querySelector(".e-list-icon")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-level-members")&&(this.parent.isAdaptive?e.node.querySelector("."+Qn).style.display="none":e.node.querySelector("."+Qn).style.visibility="hidden"),e.node&&(e.node.querySelector(".e-hierarchyCDB-icon,.e-attributeCDB-icon,.e-namedSetCDB-icon")||e.node.querySelector(".e-measure-icon,.e-kpiGoal-icon,.e-kpiStatus-icon,.e-kpiTrend-icon,.e-kpiValue-icon")||e.node.querySelector(".e-calc-measure-icon,.e-calc-dimension-icon"))&&(t=(e.node.querySelector(".e-measure-icon")&&(e.node.querySelector(".e-list-icon").style.display="none"),!0))):t=!0,t},C.prototype.renderTreeDialog=function(e){var t=Ue.createElement("div",{id:this.parent.element.id+"_FieldListTreeView",className:"e-adaptive-field-list-dialog "+("olap"===this.parent.dataType?"e-olap-editor-dialog":"")});this.parentElement.appendChild(t),this.fieldDialog=new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!1,header:this.parent.localeObj.getConstant("adaptiveFieldHeader"),content:this.createTreeView(this.getTreeData(e)),isModal:!0,visible:!0,showCloseIcon:!1,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,width:"320px",height:"350px",position:{X:"center",Y:"center"},buttons:[{click:this.closeTreeDialog.bind(this),isFlat:!1,buttonModel:{cssClass:Sr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}},{click:this.onFieldAdd.bind(this),isFlat:!1,buttonModel:{cssClass:mr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("add"),isPrimary:!0}}],closeOnEscape:!1,cssClass:this.parent.cssClass,close:this.closeTreeDialog.bind(this),target:Ue.closest(this.parentElement,"."+Ea)}),this.fieldDialog.isStringTemplate=!0,this.fieldDialog.appendTo(t)},C.prototype.createTreeView=function(e){var t=Ue.createElement("div",{id:this.parent.element.id+"EditorDiv",className:or}),i=Ue.createElement("div",{id:this.parent.element.id+"_SearchDiv",attrs:{tabindex:"-1"},className:on}),a=Ue.createElement("input",{attrs:{type:"text"}}),r=(i.appendChild(a),Ue.createElement("div",{className:Ra})),n=Ue.createElement("div",{className:lr+" "+("olap"===this.parent.dataType?"e-olap-field-list-tree":"")}),i=(t.appendChild(i),this.editorSearch=new V.MaskedTextBox({showClearButton:!0,placeholder:this.parent.localeObj.getConstant("search"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:ln+(this.parent.cssClass?" "+this.parent.cssClass:""),change:this.textChange.bind(this)}),this.editorSearch.isStringTemplate=!0,this.editorSearch.appendTo(a),Ue.createElement("div",{className:En+" "+W}));return i.innerText=this.parent.localeObj.getConstant("noMatches"),t.appendChild(i),r.appendChild(n),t.appendChild(r),this.fieldTable=new O.TreeView({fields:{dataSource:e,id:"id",text:"caption",isChecked:"isSelected",parentID:"pid",iconCss:"spriteCssClass"},showCheckBox:!0,loadOnDemand:"olap"!==this.parent.dataType,sortOrder:"olap"===this.parent.dataType?"None":"Ascending",enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,nodeChecked:this.nodeChecked.bind(this),nodeClicked:this.addNode.bind(this),keyPress:this.addNode.bind(this),drawNode:this.updateTreeNode.bind(this),nodeExpanding:this.updateNodeIcon.bind(this),nodeCollapsed:this.updateNodeIcon.bind(this),nodeSelected:function(e){Ue.removeClass([e.node],"e-active"),e.cancel=!0}}),this.fieldTable.isStringTemplate=!0,this.fieldTable.appendTo(n),t},C.prototype.textChange=function(e){this.parent.pivotCommon.eventBase.searchTreeNodes(e,this.fieldTable,!0),this.parent.isAdaptive?t=this.fieldDialog.element.querySelector("."+En):(t=this.parentElement.querySelector("."+En),i=this.parentElement.querySelector("."+Cn));var t,i,a=[].slice.call(this.fieldTable.element.querySelectorAll("li")),e=[].slice.call(this.fieldTable.element.querySelectorAll("li."+W));if(a.length===e.length?(Ue.removeClass([t],W),this.parent.isAdaptive||(Ue.addClass([i],W),Ue.removeClass([i],ka))):(Ue.addClass([t],W),this.parent.isAdaptive||(Ue.removeClass([i],W),Ue.addClass([i],ka))),this.isSearching=0<e.length,this.nonSearchList=e,"olap"===this.parent.dataType){this.parentIDs=[];for(var r,n=0;n<a.length;n++)a[n].classList.contains("e-level-1")&&(r=a[n].getAttribute("data-uid"),this.parentIDs.push(r))}},C.prototype.dragStart=function(a){var e,r=this;a.event.target.classList.contains(ar)&&!a.event.target.classList.contains(rr)?(e={fieldName:(e=Ce.getFieldInfo(a.draggedNode.getAttribute("data-uid"),this.parent)).fieldName,fieldItem:e.fieldItem,axis:e.axis,dataSourceSettings:this.parent.dataSourceSettings,cancel:!1},(this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(mt,e,function(e){if(e.cancel)r.parent.isDragging=!1,a.cancel=!0;else{r.parent.isDragging=!0,Ue.addClass([a.draggedNode.querySelector("."+qr)],Er);e=void 0;if((e=("olap"===r.parent.dataType?r.parent.olapEngineModule:r.parent.engineModule).fieldList[a.draggedNode.getAttribute("data-uid")])&&"CalculatedField"===e.aggregateType)for(var t=0,i=[yr,br,xr];t<i.length;t++)Ue.addClass([r.parentElement.querySelector("."+i[t])],Nr);e=a.clonedNode;e&&"Popup"===("pivotfieldlist"===r.parent.getModuleName()&&r.parent.renderMode)&&(e.style.zIndex=(r.parent.dialogRenderer.fieldListDialog.zIndex+1).toString())}})):(this.parent.isDragging=!1,a.cancel=!0)},C.prototype.dragStop=function(e){e.cancel=!0,this.parent.isDragging=!1;for(var t=0,i=[yr,br,xr];t<i.length;t++)Ue.removeClass([this.parentElement.querySelector("."+i[t])],Nr);Ue.removeClass([e.draggedNode.querySelector("."+qr)],Er),this.parent.pivotCommon.filterDialog.dialogPopUp&&this.parent.pivotCommon.filterDialog.dialogPopUp.close();var a,r=e.draggedNodeData.id.toString();this.isNodeDropped(e,r)&&(a=this.parent.pivotFieldList[r],this.parent.pivotCommon.dataSourceUpdate.control="pivotview"!==this.parent.getModuleName()&&this.parent.isPopupView&&this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent,this.parent.pivotCommon.nodeStateModified.onStateModified(e,r))&&((this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&this.parent.pivotGridModule.pivotDeferLayoutUpdate?(a.isSelected=!0,this):this.parent).updateDataSource(),this.parent.axisFieldModule.render())},C.prototype.isNodeDropped=function(e,t){var i=!0;if("true"===e.draggedNodeData.isChecked){var a=this.getButton(t),t=Ue.closest(a,"."+vr),r=Ue.closest(e.target,"."+vr);if(a&&t===r){for(var n,s=[].slice.call(t.querySelectorAll("."+Q)),o=Ue.closest(e.target,"."+Qa),l=void 0,d=-1,p=0,h=s.length;p<h;p++)s[p].id===a.id&&(l=p),o&&(n=o.querySelector("."+Q),s[p].id===n.id)&&(d=p);(l===d||l===s.length-1&&-1===d)&&(r=document.getElementById(this.parent.element.id+"_Container"),Ue.removeClass([].slice.call(r.querySelectorAll("."+nr)),sr),i=!1)}}return i},C.prototype.getButton=function(e){for(var t,i=document.getElementById(this.parent.element.id+"_Container"),a=[].slice.call(i.querySelectorAll("."+Q)),r=0,n=a.length;r<n;r++)if(a[r].getAttribute("data-uid")===e){t=a[r];break}return t},C.prototype.nodeChecked=function(e){var t,i;this.isSpaceKey&&(t=Ue.closest(e.node,"."+Ir),Ue.isNullOrUndefined(t)||(i=Ue.closest(t,"li").getAttribute("data-uid"),this.parent.isAdaptive?this.addNode(void 0,i,"check"===e.action,t):this.nodeStateChange(void 0,i,"check"===e.action,t))),this.isSpaceKey=!1},C.prototype.nodeStateChange=function(e,i,a,r){var n=this;r=Ue.isNullOrUndefined(r)?e.node:r,i=Ue.isNullOrUndefined(i)?r.getAttribute("data-uid"):i,this.parent.pivotCommon.filterDialog.dialogPopUp&&this.parent.pivotCommon.filterDialog.dialogPopUp.close();var s=this.parent.pivotFieldList[i];if(!Ue.isNullOrUndefined(e)){if(this.isSpaceKey=e.event.action&&"space"===e.event.action,Ue.isNullOrUndefined(s)||r.classList.contains(W)||e.event.target&&(e.event.target.classList.contains(Ns)||e.event.target.classList.contains(Es))||e.event.action&&"enter"!==e.event.action)return;a=!1;var t=this.fieldTable.getNode(r);a=e.event&&e.event.target&&!e.event.target.closest("."+Qn)?"true"===t.isChecked?(this.fieldTable.uncheckAll([r]),!1):(this.fieldTable.checkAll([r]),!0):"true"===t.isChecked}var o=this.parent.isPopupView?this.parent.pivotGridModule:this.parent,l=Ce.getFieldInfo(i,this.parent),d=r.closest("."+qa);a?(e={fieldName:i,dropField:l.fieldItem,dataSourceSettings:Ce.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:"number"===s.type||"CalculatedField"===s.type&&s.formula&&-1<s.formula.indexOf("Measure")&&"olap"===this.parent.dataType?"values":"rows",dropPosition:l.position,draggedAxis:"fieldlist",cancel:!1},o.trigger(H,e,function(e){var t;e.cancel?n.updateCheckState(s,"check"):(Ue.addClass([r.querySelector("."+qr)],Vr),d&&Ue.addClass([d.querySelector("."+qr)],Vr),n.updateSelectedNodes(r,"check"),t=n.parent.pivotCommon.dataSourceUpdate.getNewField(i,l.fieldItem),n.updateReportSettings(t,e),n.updateNodeStateChange(i,s,a))})):(t={cancel:!1,fieldName:i,dataSourceSettings:Ce.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:l.fieldItem,axis:l.axis},o.trigger(ut,t,function(e){e.cancel?n.updateCheckState(s,"uncheck"):(Ue.removeClass([r.querySelector("."+qr)],Vr),d&&Ue.isNullOrUndefined(d.querySelector("."+Va+" ."+cr))&&Ue.removeClass([d.querySelector("."+qr)],Vr),n.updateSelectedNodes(r,"uncheck"),n.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(i),"pivot"===n.parent.dataType&&n.parent.showValuesButton&&1<n.parent.dataSourceSettings.values.length&&l&&l.position<n.parent.dataSourceSettings.valueIndex&&("row"===n.parent.dataSourceSettings.valueAxis&&"rows"===l.axis||"column"===n.parent.dataSourceSettings.valueAxis&&"columns"===l.axis)&&o.setProperties({dataSourceSettings:{valueIndex:n.parent.dataSourceSettings.valueIndex-1}},!0),"olap"===n.parent.dataType&&0===n.parent.dataSourceSettings.values.length&&n.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport("[Measures]"),n.updateNodeStateChange(i,s,a))}))},C.prototype.updateReportSettings=function(e,t){var i,a=t.dropPosition,t=t.dropAxis;switch("pivot"===this.parent.dataType&&this.parent.showValuesButton&&1<this.parent.dataSourceSettings.values.length&&(i="row"===this.parent.dataSourceSettings.valueAxis&&"rows"===t?this.parent.dataSourceSettings.rows:"column"===this.parent.dataSourceSettings.valueAxis&&"columns"===t?this.parent.dataSourceSettings.columns:void 0,Ue.isNullOrUndefined(i)||(-1===a&&-1===this.parent.dataSourceSettings.valueIndex?this.parent.setProperties({dataSourceSettings:{valueIndex:i.length}},!0):-1<a&&a<=this.parent.dataSourceSettings.valueIndex?this.parent.setProperties({dataSourceSettings:{valueIndex:this.parent.dataSourceSettings.valueIndex+1}},!0):-1<this.parent.dataSourceSettings.valueIndex&&a>this.parent.dataSourceSettings.valueIndex&&(a-=1))),t){case"filters":-1!==a?this.parent.dataSourceSettings.filters.splice(a,0,e):this.parent.dataSourceSettings.filters.push(e);break;case"rows":-1!==a?this.parent.dataSourceSettings.rows.splice(a,0,e):this.parent.dataSourceSettings.rows.push(e);break;case"columns":-1!==a?this.parent.dataSourceSettings.columns.splice(a,0,e):this.parent.dataSourceSettings.columns.push(e);break;case"values":-1!==a?this.parent.dataSourceSettings.values.splice(a,0,e):this.parent.dataSourceSettings.values.push(e),"olap"!==this.parent.dataType||!this.parent.olapEngineModule||this.parent.olapEngineModule.isMeasureAvail||1<this.parent.dataSourceSettings.values.length||("row"===this.parent.dataSourceSettings.valueAxis?this.parent.dataSourceSettings.rows:this.parent.dataSourceSettings.columns).push({name:"[Measures]",caption:"Measures",baseField:void 0,baseItem:void 0})}},C.prototype.updateCheckState=function(e,t){for(var i=this.fieldTable.element.querySelectorAll("."+Qn),a=this.fieldTable.element.querySelectorAll(".e-list-text"),r=0;r<i.length;r++)e.caption===a[r].textContent&&("check"===t?this.fieldTable.uncheckAll([e.id]):this.fieldTable.checkAll([e.id]))},C.prototype.updateNodeStateChange=function(e,t,i){!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate?this.parent.updateDataSource(!0):(t.isSelected=i,"olap"===this.parent.dataType&&this.parent.olapEngineModule.updateFieldlistData(e,i),this.updateDataSource());var t=this.treeViewElement.querySelector('[data-uid="'+e+'"]'),a=(t.focus(),Ue.removeClass([t],"e-hover"),this.parent);setTimeout(function(){a.axisFieldModule.render()})},C.prototype.updateSelectedNodes=function(e,t){if(e&&e.querySelector("ul"))for(var i=0,a=[].slice.call(e.querySelectorAll("li"));i<a.length;i++){var r=a[i];"check"===t?Ue.addClass([r.querySelector("."+qr)],Vr):Ue.removeClass([r.querySelector("."+qr)],Vr)}},C.prototype.updateDataSource=function(){this.parent.isPopupView?("olap"===this.parent.dataType?this.parent.pivotGridModule.olapEngineModule=this.parent.olapEngineModule:this.parent.pivotGridModule.engineModule=this.parent.engineModule,this.parent.pivotGridModule.setProperties({dataSourceSettings:this.parent.dataSourceSettings.properties},!0),this.parent.pivotGridModule.notify(wt,this)):this.parent.triggerPopulateEvent()},C.prototype.addNode=function(e,t,i,a){var r=this;a=Ue.isNullOrUndefined(a)?e.node:a,t=Ue.isNullOrUndefined(t)?a.getAttribute("data-uid"):t;var n=this.parent.pivotFieldList[t];if(!Ue.isNullOrUndefined(e)){if(this.isSpaceKey=e.event.key&&" "===e.event.key,Ue.isNullOrUndefined(n)||e.node.classList.contains(W)||e.event.target&&(e.event.target.classList.contains(Ns)||e.event.target.classList.contains(Es))||e.event.key&&"Enter"!==e.event.key)return;i=!1;a=this.fieldTable.getNode(e.node);i=e.event&&e.event.target&&!e.event.target.classList.contains(ur)?"true"===a.isChecked?(this.fieldTable.uncheckAll([e.node]),!1):(this.fieldTable.checkAll([e.node]),!0):"true"===a.isChecked}t=Ce.getFieldInfo(n.id.toString(),this.parent),e=this.parent.isPopupView?this.parent.pivotGridModule:this.parent;i?(a={fieldName:t.fieldName,dropField:t.fieldItem,dataSourceSettings:Ce.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:["filters","columns","rows","values"][this.parent.dialogRenderer.adaptiveElement.selectedItem],draggedAxis:"fieldlist",cancel:!1},e.trigger(H,a,function(e){e.cancel?r.updateCheckState(n,"check"):r.selectedNodes.push(n.id.toString())})):(i={cancel:!1,fieldName:t.fieldName,dataSourceSettings:Ce.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:t.fieldItem,axis:t.axis},e.trigger(ut,i,function(e){if(e.cancel)r.updateCheckState(n,"uncheck");else for(var t=r.selectedNodes.length;t--;)if(r.selectedNodes[t]===n.id.toString()){r.selectedNodes.splice(t,1);break}}))},C.prototype.refreshTreeView=function(){var e;this.fieldTable&&(e=this.getUpdatedData(),this.fieldTable.fields={dataSource:e,id:"id",text:"caption",isChecked:"isSelected",parentID:"pid",iconCss:"spriteCssClass"},this.fieldTable.dataBind())},C.prototype.getUpdatedData=function(){var e=this.getTreeData(),t=this.fieldTable.expandedNodes;return this.updateExpandedNodes(e,t),this.applySorting(e,this.fieldListSort)},C.prototype.getTreeData=function(e){var t=[];if("olap"===this.parent.dataType)t=this.getOlapTreeData(e);else{for(var i=this.parent.pivotFieldList?Object.keys(this.parent.pivotFieldList):[],a={},r=0,n=i;r<n.length;r++){var s,o=n[r],l=this.parent.pivotFieldList[o];a[o]={id:l.id,pid:l.pid,caption:l.caption,isSelected:l.isSelected},Ue.isNullOrUndefined(l.pid)||a[o].hasChildren||(s=l.pid+"_group_name",a[o].pid=s,a[s]={id:s,caption:l.pid,isSelected:(a[s]&&a[s].isSelected?a[s]:l).isSelected,hasChildren:!0})}if(this.parent.isAdaptive){for(var e=[this.parent.dataSourceSettings.filters,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.values][e],d=i.length;d--;)a[i[d]].isSelected=!1;for(var p=0,h=e;p<h.length;p++)a[h[p].name].isSelected=!0}for(var u=0,c=Object.keys(a);u<c.length;u++){l=c[u];t.push(a[l])}}return t},C.prototype.getOlapTreeData=function(e){var t=[],i=this.parent.olapEngineModule.fieldListData||[];if(this.parent.isAdaptive)for(var a=[this.parent.dataSourceSettings.filters,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.values][e],r=0;r<i.length;){var n=i[r],s=void 0;if(3===e){if("[measures]"!==n.id.toLowerCase()&&(0===n.id.toLowerCase().indexOf("[measures]")||n.spriteCssClass&&-1!==n.spriteCssClass.indexOf("e-measureCDB"))||"[calculated members].[_0]"===n.id.toLowerCase()||n.spriteCssClass&&-1!==n.spriteCssClass.indexOf("e-calc-measure-icon")){(s={id:n.id,caption:n.caption,hasChildren:n.hasChildren,type:n.type,aggregateType:n.aggregateType,isSelected:n.isSelected,pid:n.pid,spriteCssClass:n.spriteCssClass}).isSelected=!1,s.spriteCssClass&&-1!==s.spriteCssClass.indexOf("e-measureCDB")&&(s.spriteCssClass=s.spriteCssClass.replace("e-folderCDB-icon","e-measureGroupCDB-icon"),s.pid=void 0);for(var o=0,l=a;o<l.length;o++){var d=l[o];if(s.id===d.name){s.isSelected=!0;break}}t.push(s)}}else if(!(0===n.id.toLowerCase().indexOf("[measures]")||n.spriteCssClass&&-1!==n.spriteCssClass.indexOf("e-measureCDB")||n.spriteCssClass&&-1!==n.spriteCssClass.indexOf("e-calc-measure-icon"))){(s={id:n.id,caption:n.caption,hasChildren:n.hasChildren,type:n.type,aggregateType:n.aggregateType,isSelected:n.isSelected,pid:n.pid,spriteCssClass:n.spriteCssClass}).isSelected=!1;for(var p=0,h=a;p<h.length;p++){var u=h[p];if(s.id===u.name){s.isSelected=!0;break}}t.push(s)}r++}else t=Ue.isNullOrUndefined(this.parent.olapEngineModule.fieldListData)?[]:Ce.getClonedData(this.parent.olapEngineModule.fieldListData);return t},C.prototype.updateExpandedNodes=function(e,t){if(0<t.length)for(var i=0,a=0,r=e;a<r.length;a++){var n=r[a];if(-1<t.indexOf(n.id)&&(i++,n.expanded=!0,n.spriteCssClass=n.spriteCssClass&&-1<n.spriteCssClass.toString().indexOf("e-folderCDB-icon")?n.spriteCssClass.toString().replace("e-folderCDB-icon","e-folderCDB-open-icon"):n.spriteCssClass,i===t.length))break}},C.prototype.updateSorting=function(e){var t=e.target,e=t.getAttribute("data-sort");if(this.parent.actionObj.actionName=Si,!this.parent.actionBeginMethod()){try{if(-1===t.className.indexOf("e-selected")){switch(e){case"None":this.fieldListSort="None",Ue.addClass([t],"e-selected"),Ue.removeClass([this.parentElement.querySelector(".e-sort-ascend")],"e-selected"),Ue.removeClass([this.parentElement.querySelector(".e-sort-descend")],"e-selected");break;case"Ascend":this.fieldListSort="Ascend",Ue.addClass([t],"e-selected"),Ue.removeClass([this.parentElement.querySelector(".e-sort-none")],"e-selected"),Ue.removeClass([this.parentElement.querySelector(".e-sort-descend")],"e-selected");break;case"Descend":this.fieldListSort="Descend",Ue.addClass([t],"e-selected"),Ue.removeClass([this.parentElement.querySelector(".e-sort-ascend")],"e-selected"),Ue.removeClass([this.parentElement.querySelector(".e-sort-none")],"e-selected")}this.refreshTreeView()}}catch(e){this.parent.actionFailureMethod(e)}this.parent.actionObj.actionName=this.parent.getActionCompleteName(),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()}},C.prototype.applySorting=function(e,t){var i,a;return 0<e.length&&("olap"===this.parent.dataType?(a=i=void 0,0<this.parent.dataSourceSettings.calculatedFieldSettings.length&&"[calculated members].[_0]"===e[0].id.toLowerCase()?(a=e[0],i=e[1],e.splice(0,2)):(i=e[0],e.splice(0,1)),e="Ascend"===t?e.sort(function(e,t){return e.caption>t.caption?1:t.caption>e.caption?-1:0}):"Descend"===t?e.sort(function(e,t){return e.caption<t.caption?1:t.caption<e.caption?-1:0}):e,a?e.splice(0,0,a,i):e.splice(0,0,i)):this.fieldTable.sortOrder="Ascend"===t?"Ascending":"Descend"===t?"Descending":"None"),e},C.prototype.onFieldAdd=function(){this.parent.dialogRenderer.updateDataSource(this.selectedNodes),this.closeTreeDialog()},C.prototype.closeTreeDialog=function(){this.selectedNodes=[],this.fieldDialog.hide(),this.fieldDialog.destroy(),document.getElementById(this.parent.element.id+"_FieldListTreeView")&&Ue.remove(document.getElementById(this.parent.element.id+"_FieldListTreeView")),this.fieldDialog=null},C.prototype.keyPress=function(e){13===e.keyCode&&e.target&&(e.target.click(),e.preventDefault())},C.prototype.wireFieldListEvent=function(e){Ue.EventHandler.add(e,"keydown",this.keyPress,this),Ue.EventHandler.add(e,"click",this.updateSorting,this)},C.prototype.unWireFieldListEvent=function(e){Ue.EventHandler.remove(e,"keydown",this.keyPress),Ue.EventHandler.remove(e,"click",this.updateSorting)},C.prototype.addEventListener=function(){this.parent.on(Nt,this.refreshTreeView,this)},C.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Nt,this.refreshTreeView)},C.prototype.destroy=function(){this.removeEventListener(),this.editorSearch&&!this.editorSearch.isDestroyed&&(this.editorSearch.destroy(),this.editorSearch=null),this.fieldSearch&&!this.fieldSearch.isDestroyed&&(this.fieldSearch.destroy(),this.fieldSearch=null),this.fieldTable&&!this.fieldTable.isDestroyed&&(this.fieldTable.destroy(),this.fieldTable=null),this.fieldDialog&&!this.fieldDialog.isDestroyed&&(this.fieldDialog.destroy(),this.fieldDialog=null)};var Gp=C;function C(e){this.selectedNodes=[],this.isSearching=!1,this.parentIDs=[],this.isSpaceKey=!1,this.parent=e,this.addEventListener()}Wp.prototype.render=function(){var e;this.parent.isAdaptive||(e=Ue.createElement("div",{className:"e-axis-table "+("olap"===this.parent.dataType?"e-olap-axis-table":"")}),this.leftAxisPanel=Ue.createElement("div",{className:_a}),this.rightAxisPanel=Ue.createElement("div",{className:Ua}),this.parent.dialogRenderer.parentElement.appendChild(e),e.appendChild(this.leftAxisPanel),e.appendChild(this.rightAxisPanel),this.axisTable=e,this.renderAxisTable()),this.parent.axisFieldModule.render()},Wp.prototype.renderAxisTable=function(){for(var e=["filters","rows","columns","values"],t=0,i=e.length;t<i;t++){var a=Ue.createElement("div",{className:Aa+"-"+e[t]}),r=Ue.createElement("div",{className:Tn+"-container"}),n=Ue.createElement("div",{className:"e-axis-header",attrs:{title:this.parent.localeObj.getConstant(e[t])}}),n=(n.innerText=this.parent.localeObj.getConstant(e[t]),r.appendChild(this.getIconupdate(e[t])),r.appendChild(n),Ue.createElement("div",{className:za+" e-"+e[t]})),s=void 0,s="rows"===e[t]?this.parent.localeObj.getConstant("dropRowPrompt"):"columns"===e[t]?this.parent.localeObj.getConstant("dropColPrompt"):"values"===e[t]?this.parent.localeObj.getConstant("dropValPrompt"):this.parent.localeObj.getConstant("dropFilterPrompt"),o=Ue.createElement("span",{className:Wa});o.innerText=s,new Ue.Droppable(n,{}),a.appendChild(r),a.appendChild(n),a.appendChild(o),(t<=1?this.leftAxisPanel:this.rightAxisPanel).appendChild(a),this.unWireEvent(n),this.wireEvent(n)}},Wp.prototype.getIconupdate=function(e){var t=Ue.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:Tn+"-icon-container"}),e=Ue.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:z+" "+Tn+"-"+e});return t.appendChild(e),t},Wp.prototype.wireEvent=function(e){Ue.EventHandler.add(e,"mouseover",this.updateDropIndicator,this),Ue.EventHandler.add(e,"mouseleave",this.updateDropIndicator,this)},Wp.prototype.unWireEvent=function(e){Ue.EventHandler.remove(e,"mouseover",this.updateDropIndicator),Ue.EventHandler.remove(e,"mouseleave",this.updateDropIndicator)},Wp.prototype.updateDropIndicator=function(e){var t,i=this.parent.dialogRenderer.parentElement;this.parent.isDragging&&e.target.classList.contains(za)&&"mouseover"===e.type?(Ue.removeClass([].slice.call(i.querySelectorAll("."+nr)),sr),Ue.removeClass([].slice.call(i.querySelectorAll("."+nr+"-last")),sr),0<(t=[].slice.call(e.target.querySelectorAll("."+Qa))).length&&Ue.addClass([t[t.length-1].querySelector("."+nr+"-last")],sr)):this.parent.isDragging&&(e.target.classList.contains(vr)||"mouseleave"!==e.type)||(Ue.removeClass([].slice.call(i.querySelectorAll("."+nr)),sr),Ue.removeClass([].slice.call(i.querySelectorAll("."+nr+"-last")),sr))};var zp=Wp;function Wp(e){this.parent=e}x.prototype.renderPivotButton=function(e){var t,i=this,r=(this.parentElement="pivotview"===this.parent.getModuleName()?this.parent.element:document.getElementById(this.parent.element.id+"_Container"),Array.prototype.slice.call(this.parentElement.querySelectorAll(".e-group-"+e.axis))),n=("rows"===e.axis&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&Ue.isNullOrUndefined(this.parentElement.querySelector("."+bs))&&(r.push(this.parent.groupingBarModule.rowPanel),t=this.parent.groupingBarModule.rowPanel),Ue.extend([],e.field,null,!0)),a=e.axis,s=-1,o="pivot"===this.parent.dataType&&("pivotfieldlist"===this.parent.getModuleName()&&this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent).showValuesButton;if(("row"===this.parent.dataSourceSettings.valueAxis&&"rows"===e.axis||"column"===this.parent.dataSourceSettings.valueAxis&&"columns"===e.axis)&&o&&1<this.parent.dataSourceSettings.values.length&&Ue.isNullOrUndefined(Ce.getFieldByName("[Measures]",n))&&(o=Ce.getFieldByName("[Measures]",this.parent.dataSourceSettings.fieldMapping),e={name:"[Measures]",caption:this.parent.localeObj.getConstant("values"),axis:e.axis,showRemoveIcon:!(o&&"showRemoveIcon"in o)||o.showRemoveIcon,allowDragAndDrop:!(o&&"allowDragAndDrop"in o)||o.allowDragAndDrop},-1===this.parent.dataSourceSettings.valueIndex||this.parent.dataSourceSettings.valueIndex>n.length?(s=n.length,n.push(e),this.parent.setProperties({dataSourceSettings:{valueIndex:-1}},!0)):(s=this.parent.dataSourceSettings.valueIndex,n.splice(s,0,e))),"pivotfieldlist"===this.parent.getModuleName()){if(this.parentElement=document.getElementById(this.parent.element.id+"_Container"),!this.parentElement.querySelector("."+Aa+"-"+a))return;var l=this.parentElement.querySelector("."+Aa+"-"+a).querySelector("."+Wa);0===n.length?Ue.removeClass([l],W):Ue.addClass([l],W),t=this.parentElement.querySelector("."+Aa+"-"+a).querySelector("."+za)}else this.parentElement=this.parent.element,Ue.isNullOrUndefined(this.parentElement.querySelector(".e-group-"+a))||(t=this.parentElement.querySelector(".e-group-"+a));if(t)if("pivotview"===this.parent.getModuleName()&&0===n.length)for(var d=0;d<r.length;d++)(b=r[d]).classList.contains(cs)||b.classList.contains(us)||((l=Ue.createElement("span",{className:Wa})).innerText=this.parent.groupingBarSettings.allowDragAndDrop?"rows"===a?this.parent.localeObj.getConstant("rowAxisPrompt"):"columns"===a?this.parent.localeObj.getConstant("columnAxisPrompt"):"values"===a?this.parent.localeObj.getConstant("valueAxisPrompt"):"filters"===a?this.parent.localeObj.getConstant("filterAxisPrompt"):this.parent.localeObj.getConstant("allFields"):"",b.appendChild(l));else{for(var d=0,k=n.length;d<k;d++)for(var p="pivotfieldlist"===this.parent.getModuleName()?[t]:r,h=0;h<p.length;h++){var u,c,g,m,S,f,v,y,b=p[h];(this.parent.olapEngineModule&&(this.parent.olapEngineModule.fieldList[n[d].name]||"[Measures]"===n[d].name)||this.parent.engineModule)&&(u="olap"===this.parent.dataType&&("[measures]"===n[d].name.toLowerCase()||"values"===a),g="olap"===this.parent.dataType&&"values"===a,b.classList.contains(cs)||b.classList.contains(us)||(c=Ue.createElement("div",{className:Qa+(0===d&&"all-fields"!==a?" e-first-btn":"")+(this.parent.isTabular?" e-tabular-pvt-btn":""),attrs:{"data-tag":a+":"+n[d].name}}),this.parent.isTabular&&(c.style.width="auto"),m=n[d].caption||n[d].name,m=this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(m):m,g=Ue.createElement("div",{id:this.parent.element.id+"_"+n[d].name,className:Q+" "+n[d].name.replace(/[^A-Z0-9]/gi,"")+(this.parent.isTabular?" e-tabular-row-btn":""),attrs:{"data-uid":n[d].name,tabindex:"pivotview"===this.parent.getModuleName()&&this.parent.grid&&"rows"===a&&!b.classList.contains(hs)?"-1":"0",isvalue:d===s||u&&!g?"true":"false","aria-disabled":"false","aria-label":m,"data-type":"olap"===this.parent.dataType?g?"isMeasureFieldsAvail":u?"isMeasureAvail":n[d].type:n[d].type,"data-caption":m,"data-basefield":this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(n[d].baseField):n[d].baseField,"data-baseitem":this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(n[d].baseItem):n[d].baseItem,role:"button"}}),m=Ue.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:nr}),y=Ue.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:nr+"-last"}),S=this.createButtonDragIcon(n[d],g),f=this.createButtonText(n,d,a,s),g.appendChild(f),"all-fields"!==a?(u||n[d].isNamedSet||n[d].isCalculatedField||(-1!==["filters","values"].indexOf(a)||s===d||"olap"===this.parent.dataType&&("pivotview"===this.parent.getModuleName()&&this.parent.enableVirtualization||"pivotfieldlist"===this.parent.getModuleName()&&void 0!==this.parent.pivotGridModule&&this.parent.pivotGridModule.enableVirtualization)||this.createSortOption(g,n[d].name,n[d]),"values"!==a&&s!==d&&this.createFilterOption(g,n[d].name,a,n[d]),"values"===a&&this.getTypeStatus(n,d,g)),!n[d].isCalculatedField&&"CalculatedField"!==n[d].type||(v=Ue.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("editCalculatedField")},className:z+" "+Fn}),this.parent.allowCalculatedField&&this.parent.calculatedFieldModule&&(n[d].showEditIcon||void 0===n[d].showEditIcon)?Ue.removeClass([v],W):Ue.addClass([v],W),g.appendChild(v)),v=Ue.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("remove")},className:z+" "+ir}),"pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.showRemoveIcon&&(n[d].showRemoveIcon||void 0===n[d].showRemoveIcon)?Ue.removeClass([v],W):Ue.addClass([v],W):n[d].showRemoveIcon||void 0===n[d].showRemoveIcon?Ue.removeClass([v],W):Ue.addClass([v],W),g.appendChild(v),c.appendChild(m),c.appendChild(g),c.appendChild(y)):(c.appendChild(m),c.appendChild(g)),b.appendChild(c),(y=new Y.Button({enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass})).isStringTemplate=!0,y.appendTo(g),this.unWireEvent(c,d===s&&"all-fields"!==a?"values":a,u),this.wireEvent(c,d===s&&"all-fields"!==a?"values":a,u),("pivotview"!==this.parent.getModuleName()||this.parent.isAdaptive)&&"pivotfieldlist"!==this.parent.getModuleName())||(this.createDraggable(n[d],"pivotview"===this.parent.getModuleName()?f:S),Ue.getInstance(g.querySelector("."+La),Ue.Draggable).enableAutoScroll=!1))}if("values"===a)for(var C=Ue.select("."+gs,this.parentElement)?Ue.getInstance(Ue.select("."+gs,this.parentElement),G.DropDownList):null,x=this,d=0;d<r.length;d++)!function(e){var t,i,a,e=r[e];e.classList.contains(cs)&&x.parent.pivotChartModule&&(t=n.map(function(e){return{text:e.caption||e.name,value:e.name}}),i=x.parent,C&&e.querySelector("."+gs)?(C.dataSource=t,C.value=i.chartSettings.enableMultipleAxis?t[0].value:i.pivotChartModule.currentMeasure):(a=Ue.createElement("div",{className:gs}),e.appendChild(a),(C=new G.DropDownList({dataSource:t,enableRtl:x.parent.enableRtl,locale:x.parent.locale,value:i.chartSettings.enableMultipleAxis?t[0].value:i.pivotChartModule.currentMeasure,width:200,fields:{value:"value",text:"text"},cssClass:"e-group-chart-values-drodown"+(x.parent.cssClass?" "+x.parent.cssClass:""),change:function(e){e.e&&null!==e.e&&(i.chartSettings.value=e.value)}})).isStringTemplate=!0,C.appendTo(a)))}(d);else if("columns"===a)for(var w=void 0,T=Ue.select("."+ms,this.parentElement)?Ue.getInstance(Ue.select("."+ms,this.parentElement),G.DropDownList):null,d=0;d<r.length;d++)if((b=r[d]).classList.contains(us)&&this.parent.pivotChartModule){for(var j=this.parent.pivotChartModule.currentMeasure,M=this.parent.chartSettings.columnDelimiter||"-",q=this.parent.chartSettings.columnHeader&&""!==this.parent.chartSettings.columnHeader?this.parent.chartSettings.columnHeader.split(M).join(" - "):"",D="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,O=D.pivotValues,V=this.parent.pivotChartModule.getColumnTotalIndex(O),P=[],N=!1,E=0,H=Object.keys(O);E<H.length;E++){var _=H[E];if(N)break;var F=Number(_);if(O[F][0]&&"row"===O[F][0].axis&&(0===this.parent.dataSourceSettings.rows.length||"grand sum"!==O[F][0].type))for(var U=O[F][0],I="olap"===this.parent.dataType?D.tupRowInfo[U.ordinal]:void 0,_=O[F],L=0,B=Object.keys(_);L<B.length;L++){var A=B[L],A=Number(A),A=O[F][A],R="olap"===this.parent.dataType&&I&&I.measureName?I.measureName:A.actualText;V[A.colIndex]||"value"!==A.axis||"header"===U.type||""===R||R!==j||(N=!0,R=("olap"===this.parent.dataType?A.columnHeaders.toString().split(/~~|::/):A.columnHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter)).join(" - "),P.push({value:R,text:R,title:((A={}).title=R,A)}),R===q&&(w=P.length))}}T&&b.querySelector("."+ms)?(T.dataSource=P,T.value=(void 0!==w?P[w-1]:P[0]).value):(M=Ue.createElement("div",{className:ms}),b.appendChild(M),(T=new G.DropDownList({dataSource:P,enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:w?P[w-1].value:P[0]?P[0].value:"",width:"200",fields:{value:"value",text:"text",htmlAttributes:"title"},cssClass:"e-group-chart-columns-dropdown"+(this.parent.cssClass?" "+this.parent.cssClass:""),change:function(e){var t;e.e&&null!==e.e&&(t=i.parent.chartSettings.columnDelimiter||"-",i.parent.chartSettings.columnHeader=e.value.split(" - ").join(t))}})).isStringTemplate=!0,T.appendTo(M))}}},x.prototype.createButtonText=function(e,t,i,a){"filters"===i&&(n=this.updateButtontext(e[t].name)),(s="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule).fieldList&&void 0!==s.fieldList[e[t].name]&&(r="DistinctCount"===(r=s.fieldList[e[t].name].aggregateType)||"number"===s.fieldList[e[t].name].type&&"include"!==s.fieldList[e[t].name].type&&"exclude"!==s.fieldList[e[t].name].type?void 0===r?"Sum":s.fieldList[e[t].name].aggregateType:"Count");var r,n,s,o=e[t].caption||e[t].name,o=this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(o):o,a=Ue.createElement("span",{attrs:{title:"filters"===i?"olap"===this.parent.dataType&&"CalculatedField"===s.fieldList[e[t].name].type?o:o+" ("+n+")":"olap"!==this.parent.dataType&&this.parent.dataSourceSettings.showAggregationOnValueField&&"values"===i&&"CalculatedField"!==r?this.parent.localeObj.getConstant(r)+" "+this.parent.localeObj.getConstant("of")+" "+o:o,tabindex:"-1","aria-disabled":"false",oncontextmenu:"return false;","data-type":a===t?"":r},className:Ka+" "+("pivotview"!==this.parent.getModuleName()||this.parent.groupingBarSettings.allowDragAndDrop&&(e[t].allowDragAndDrop||void 0===e[t].allowDragAndDrop)?"":rr)});return a.innerText="filters"===i?"olap"===this.parent.dataType&&"CalculatedField"===s.fieldList[e[t].name].type?o:o+" ("+n+")":"olap"!==this.parent.dataType&&this.parent.dataSourceSettings.showAggregationOnValueField&&"values"===i&&"CalculatedField"!==r?this.parent.localeObj.getConstant(r)+" "+this.parent.localeObj.getConstant("of")+" "+o:o,a},x.prototype.getTypeStatus=function(e,t,i){var a="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;a.fieldList&&(a=a.fieldList[e[t].name])&&"CalculatedField"!==a.aggregateType&&this.validateDropdown(a.type)&&this.createSummaryType(i,e[t].name,e[t])},x.prototype.validateDropdown=function(e){var t=this.parent.aggregateTypes;if("number"!==e)return-1<t.indexOf("Count")||-1<t.indexOf("DistinctCount");for(var i=0;i<t.length;i++)if(-1<this.parent.getAllSummaryType().indexOf(t[i]))return!0;return!1},x.prototype.createSummaryType=function(e,t,i){var a=Ue.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("format")},className:z+" "+Na});return"pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.showValueTypeIcon&&i.showValueTypeIcon?Ue.removeClass([a],W):Ue.addClass([a],W):i.showValueTypeIcon?Ue.removeClass([a],W):Ue.addClass([a],W),e.appendChild(a),a},x.prototype.createMenuOption=function(e){this.menuOption.render(e,this.parentElement),this.parent.pivotButtonModule=this},x.prototype.openCalculatedFieldDialog=function(e){var e=e.target.parentElement.getAttribute("data-uid"),t=Ce.getFieldInfo(e,this.parent);if(this.parent.actionObj.actionName=fi,this.parent.actionObj.fieldInfo=t,!this.parent.actionBeginMethod())try{"pivotview"===this.parent.getModuleName()?this.parent.isAdaptive&&this.parent.showFieldList&&this.parent.pivotFieldListModule&&!this.parent.pivotFieldListModule.isDestroyed?(this.parent.pivotFieldListModule.element.querySelector("."+Fa).click(),this.parent.pivotFieldListModule.dialogRenderer.adaptiveElement.select(4),this.parent.pivotFieldListModule.calculatedFieldModule.updateAdaptiveCalculatedField(!0,e)):(this.parent.isAdaptive||(this.parent.calculatedFieldModule.buttonCall=!0),this.parent.notify(Ft,{edit:!0,fieldName:e})):"pivotfieldlist"===this.parent.getModuleName()&&(this.parent.isAdaptive?(this.parent.dialogRenderer.adaptiveElement.select(4),this.parent.calculatedFieldModule.updateAdaptiveCalculatedField(!0,e),this.parent.calculatedFieldModule.buttonCall=!0):(this.parent.dialogRenderer.fieldListDialog&&(this.parent.dialogRenderer.fieldListDialog.hide(),Ue.addClass([this.parent.element.querySelector("."+Fa)],Ta)),this.parent.notify(Ft,{edit:!0,fieldName:e}),this.parent.calculatedFieldModule&&(this.parent.calculatedFieldModule.buttonCall=!0)))}catch(e){this.parent.actionFailureMethod(e)}},x.prototype.createDraggable=function(e,t){this.draggable=new Ue.Draggable(t,{clone:!0,enableTailMode:!0,enableAutoScroll:!0,helper:this.createDragClone.bind(this),dragStart:this.onDragStart.bind(this),drag:this.onDragging.bind(this),dragStop:this.onDragStop.bind(this),abort:"pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.allowDragAndDrop&&e.allowDragAndDrop?"":"."+Q:e.allowDragAndDrop?"":"."+Q})},x.prototype.createButtonDragIcon=function(e,t){var i=Ue.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false"}}),e=Ue.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("drag")},className:z+" "+ar+" "+(e.allowDragAndDrop||void 0===e.allowDragAndDrop?"":rr)});return i.appendChild(e),"pivotfieldlist"===this.parent.getModuleName()&&t.appendChild(i),i},x.prototype.createSortOption=function(e,t,i){var a="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;if(!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate)r="Descending"===a.fieldList[t].sort?Za:"";else for(var r="",n=0;n<this.parent.dataSourceSettings.sortSettings.length;n++)this.parent.dataSourceSettings.sortSettings[n].name===t&&(r="Descending"===this.parent.dataSourceSettings.sortSettings[n].order?Za:"");return a=a.fieldList&&"None"===a.fieldList[t].sort?Ue.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("sort")},className:z}):Ue.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("sort")},className:z+" "+Xa+" "+r}),this.parent.dataSourceSettings.enableSorting?"pivotview"===this.parent.getModuleName()?i.showSortIcon&&this.parent.groupingBarSettings.showSortIcon?Ue.removeClass([a],W):Ue.addClass([a],W):i.showSortIcon?Ue.removeClass([a],W):Ue.addClass([a],W):Ue.addClass([a],W),e.appendChild(a),a},x.prototype.createFilterOption=function(e,t,i,a){var r="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,n=Ce.getFieldByName(t,this.parent.dataSourceSettings.filterSettings);if(!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate)r.fieldList[t].filter=null===r.fieldList[t].filter?[]:r.fieldList[t].filter,s=!("Server"===this.parent.dataSourceSettings.mode&&!n||"Local"===this.parent.dataSourceSettings.mode&&0===r.fieldList[t].filter.length)||r.fieldList[t].isExcelFilter?tr:er;else for(var s=er,o=0;o<this.parent.dataSourceSettings.filterSettings.length;o++)this.parent.dataSourceSettings.filterSettings[o].name===t&&(s=tr);n=Ue.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("filter")},className:$a+" "+z+" "+s});return(this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==i||this.parent.dataSourceSettings.allowMemberFilter?Ue.removeClass([n],W):Ue.addClass([n],W),"pivotview"===this.parent.getModuleName()?((this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==i||this.parent.dataSourceSettings.allowMemberFilter)&&this.parent.groupingBarSettings.showFilterIcon&&a.showFilterIcon?Ue.removeClass([n],W):Ue.addClass([n],W):a.showFilterIcon&&((this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==i||this.parent.dataSourceSettings.allowMemberFilter)?Ue.removeClass([n],W):Ue.addClass([n],W),e.appendChild(n),n},x.prototype.updateButtontext=function(e){var t,i="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,a=i.fieldList[e].filter.length,r=i.fieldList[e].filterType,n=i.fieldList[e].dateMember.length,s=i.fieldList[e].filter[0];if("olap"===this.parent.dataType)t=this.updateOlapButtonText(i,e,s,a);else if("include"===r)1===a?t=s:1<a&&(t=a===n?this.parent.localeObj.getConstant("all"):this.parent.localeObj.getConstant("multipleItems"));else if("exclude"===r){if(1===a)t=2===n?s!==i.fieldList[e].dateMember[0].actualText?s:i.fieldList[e].dateMember[0].actualText:this.parent.localeObj.getConstant("multipleItems");else if(1<a){var o=void 0,l=Object.keys(i.fieldList[e].members),d=i.fieldList[e].filter;if(a===l.length-1)for(o=0;o<l.length;o++){var p=l[o];if(-1===d.indexOf(p)){t=l[o];break}}else t=this.parent.localeObj.getConstant("multipleItems")}}else t=this.parent.localeObj.getConstant("all");return t},x.prototype.updateOlapButtonText=function(e,t,i,a){var r,n=e.fieldList[t].actualFilter;if(0<n.length){var s=e.fieldList[t].members,o=[];if(0<e.fieldList[t].filterMembers.length){for(var l={},d=0,p=n;d<p.length;d++)s[l[h=p[d]]=h]&&(l=this.parent.pivotCommon.eventBase.getParentNode(t,h,l));for(var h,u=0,c=l?Object.keys(l):[];u<c.length;u++)!s[h=c[u]].isSelected||s[h].parent&&s[s[h].parent].isSelected||o.push(h);i=1===o.length?s[o[0]].caption:i}a=0===o.length?a:o.length}return 0===a?r=e.fieldList[t].allMember||this.parent.localeObj.getConstant("all"):1===a?r=i:1<a&&(r=this.parent.localeObj.getConstant("multipleItems")),r},x.prototype.createDragClone=function(e){var e=Ue.closest(e.element,"."+Q),t=Ue.createElement("div",{id:this.parent.element.id+"_DragClone",className:"e-button-drag-clone"+(this.parent.cssClass?" "+this.parent.cssClass:"")}),i=Ue.createElement("span",{className:Ir});return i.innerText=this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(e.textContent):e.textContent,t.appendChild(i),document.body.appendChild(t),t},x.prototype.onDragStart=function(s){var o=this,l=Ue.closest(s.element,"."+Q),d=document.getElementById(this.parent.element.id+"_DragClone"),e=Ce.getFieldInfo(l.getAttribute("data-uid"),this.parent),e={fieldName:e.fieldName,fieldItem:e.fieldItem,axis:e.axis,dataSourceSettings:Ce.getClonedDataSourceSettings(this.parent.dataSourceSettings),cancel:!1};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(mt,e,function(e){if(e.cancel)o.parent.isDragging=!1,o.draggable.intDestroy(s.event),Ue.detach(d);else{o.parent.isDragging=!0;var t,e=("olap"===o.parent.dataType?o.parent.olapEngineModule:o.parent.engineModule).fieldList[l.getAttribute("data-uid")],i=[yr,br,xr];if(Ue.addClass([l],Er),d&&"Popup"===("pivotfieldlist"===o.parent.getModuleName()&&o.parent.renderMode)&&(t=o.parent,d.style.zIndex=(t.dialogRenderer.fieldListDialog.zIndex+1).toString()),e&&"CalculatedField"===e.aggregateType)for(var a=0,r=i;a<r.length;a++){var n=r[a];Ue.addClass([o.parentElement.querySelector("."+n)],Nr),o.parentElement.querySelector("."+n).querySelectorAll(".e-pivot-button").forEach(function(e){e.style.cursor="no-drop"})}}})},x.prototype.onDragging=function(e){this.draggable.setProperties({cursorAt:{top:!Ue.isNullOrUndefined(e.event.targetTouches)||Ue.Browser.isDevice?60:-20}})},x.prototype.onDragStop=function(e){this.parent.isDragging=!1,e.target&&e.element&&Ue.closest(e.element,"."+Tr)&&!Ue.closest(e.target,"."+vr)&&(e.cancel=!0);var t=Ue.closest(e.element,"."+Q);Ue.removeClass([].slice.call(this.parentElement.querySelectorAll("."+Q)),Er),Ue.removeClass([].slice.call(this.parentElement.querySelectorAll("."+nr)),sr);for(var i=0,a=[yr,br,xr];i<a.length;i++){var r=a[i];Ue.removeClass([this.parentElement.querySelector("."+r)],Nr),this.parentElement.querySelector("."+r).querySelectorAll(".e-pivot-button").forEach(function(e){e.style.cursor="default"})}this.parent.pivotCommon.filterDialog.dialogPopUp&&this.parent.pivotCommon.filterDialog.dialogPopUp.close(),document.getElementById(this.parent.element.id+"_DragClone")&&Ue.remove(document.getElementById(this.parent.element.id+"_DragClone")),document.body.style.cursor="auto",this.isButtonDropped(e.target,t)&&!e.cancel&&(this.parent.pivotCommon.dataSourceUpdate.control="pivotview"!==this.parent.getModuleName()&&this.parent.pivotGridModule||this.parent,this.parent.pivotCommon.nodeStateModified.onStateModified(e,t.getAttribute("data-uid")))&&(this.updateDataSource(),this.parent.axisFieldModule.render())},x.prototype.isButtonDropped=function(e,t){var i=Ue.closest(t,"."+vr),a=Ue.closest(e,"."+vr),r=!0;if(i&&i===a){for(var n,s=[].slice.call(i.querySelectorAll("."+Q)),o=Ue.closest(e,"."+Qa),l=void 0,d=-1,p=0,h=s.length;p<h;p++)s[p].id===t.id&&(l=p),o&&(n=o.querySelector("."+Q),s[p].id===n.id)&&(d=p);(l===d||l===s.length-1&&-1===d)&&(Ue.removeClass([].slice.call(this.parentElement.querySelectorAll("."+nr)),sr),r=!1)}return r},x.prototype.updateSorting=function(e){var t,i=Ue.closest(e.target,"."+Q),a=Ce.getFieldInfo(i?i.getAttribute("data-uid"):"",this.parent);if(!e.target.classList.contains($a)&&!e.target.classList.contains(ir)&&!e.target.classList.contains(ar)&&i&&a.fieldItem&&(a.fieldItem.showSortIcon||Ue.isNullOrUndefined(a.fieldItem.showSortIcon))&&!a.fieldItem.isCalculatedField&&(this.parent.actionObj.actionName=vi,this.parent.actionObj.fieldInfo=a,!this.parent.actionBeginMethod()))try{!(this.parent instanceof eh||this.parent.groupingBarSettings.showSortIcon)||!this.parent.dataSourceSettings.enableSorting||"olap"===this.parent.dataType&&("pivotfieldlist"===this.parent.getModuleName()&&void 0!==this.parent.pivotGridModule&&this.parent.pivotGridModule.enableVirtualization||"pivotview"===this.parent.getModuleName()&&this.parent.enableVirtualization)||(this.parent.pivotCommon.eventBase.updateSorting(e),this.parent.staticPivotGridModule&&(this.parent.staticPivotGridModule.actionObj=this.parent.actionObj),(!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotfieldlist"!==this.parent.getModuleName())&&(t={sortInfo:this.parent.lastSortInfo},this.parent.actionObj.actionInfo=t,this.updateDataSource(!0)),this.parent instanceof eh&&(this.axisField.render(),this.parent.isPopupView&&this.parent.pivotGridModule?this.parent.pivotGridModule.notify(wt,this):this.parent.staticPivotGridModule&&this.parent.staticPivotGridModule.notify(wt,this)))}catch(e){this.parent.actionFailureMethod(e)}},x.prototype.updateDataSource=function(e){!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotview"===this.parent.getModuleName()?this.parent.updateDataSource(e):"pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView&&this.parent.pivotGridModule?("olap"===this.parent.dataType?this.parent.pivotGridModule.olapEngineModule=this.parent.olapEngineModule:this.parent.pivotGridModule.engineModule=this.parent.engineModule,this.parent.pivotGridModule.notify(wt,this),this.parent.pivotGridModule.setProperties({dataSourceSettings:this.parent.dataSourceSettings.properties},!0)):this.parent.triggerPopulateEvent()},x.prototype.updateFiltering=function(e){var t=this.parent.pivotGridModule||this.parent,i=e.target.parentElement.getAttribute("data-uid"),a=Ce.getFieldInfo(i,this.parent);if(this.parent.actionObj.actionName=yi,this.parent.actionObj.fieldInfo=a,!this.parent.actionBeginMethod())try{"pivotfieldlist"===t.getModuleName()?P.showSpinner(t.fieldListSpinnerElement):t.showWaitingPopup(),t.mouseEventArgs=e,t.filterTargetID="pivotfieldlist"!==this.parent.pivotCommon.moduleName?this.parent.element:document.getElementById(this.parent.pivotCommon.parentID+"_Container"),"Server"===t.dataSourceSettings.mode?this.parent.engineModule.fieldList[i].members&&0<Object.keys(this.parent.engineModule.fieldList[i].members).length?this.updateFilterEvents():t.getEngine("fetchFieldMembers",null,null,null,null,null,i):("pivot"!==t.dataType||this.parent.engineModule.fieldList[i].isMembersFilled||this.parent.engineModule.fetchFieldMembers(i),this.updateFilterEvents())}catch(e){this.parent.actionFailureMethod(e)}},x.prototype.updateFilterEvents=function(){var e=this.parent.pivotGridModule||this.parent,t=(this.parent.pivotCommon.eventBase.updateFiltering(e.mouseEventArgs),e.mouseEventArgs.target);this.fieldName=t.parentElement.getAttribute("data-uid"),this.parent.pivotCommon.filterDialog.dialogPopUp&&this.bindDialogEvents(),"pivotfieldlist"===e.getModuleName()?P.hideSpinner(e.fieldListSpinnerElement):e.hideWaitingPopup()},x.prototype.bindDialogEvents=function(){this.parent.pivotCommon.filterDialog.allowExcelLikeFilter&&this.parent.pivotCommon.filterDialog.tabObj?(this.index=this.parent.pivotCommon.filterDialog.tabObj.selectedItem,this.updateDialogButtonEvents(),this.parent.pivotCommon.filterDialog.dialogPopUp.buttons=this.buttonModel(),this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind(),this.parent.pivotCommon.filterDialog.tabObj.selected=this.tabSelect.bind(this)):this.parent.dataSourceSettings.allowMemberFilter&&(this.index=0,this.updateDialogButtonEvents())},x.prototype.buttonModel=function(){return[{isFlat:!1,buttonModel:{cssClass:"e-clear-filter-button"+(this.parent.pivotCommon.filterDialog.allowExcelLikeFilter?"":" "+W)+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:"e-icons e-clear-filter-icon",enableRtl:this.parent.enableRtl,content:this.parent.localeObj.getConstant("clearFilter"),disabled:!this.parent.pivotCommon.filterDialog.filterObject},click:this.ClearFilter.bind(this)},{isFlat:!1,buttonModel:{cssClass:mr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0},click:0===this.index?this.updateFilterState.bind(this,this.fieldName):this.updateCustomFilter.bind(this)},{isFlat:!1,click:this.parent.pivotCommon.filterDialog.closeFilterDialog.bind(this.parent.pivotCommon.filterDialog),buttonModel:{cssClass:Sr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}]},x.prototype.tabSelect=function(e){this.index=e.selectedIndex,this.updateDialogButtonEvents(),Ue.removeClass([].slice.call(this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelectorAll(".e-selected-tab")),"e-selected-tab"),0<e.selectedIndex&&Ue.addClass([this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector(".e-filter-div-content."+(1===e.selectedIndex&&this.parent.dataSourceSettings.allowLabelFilter?"e-label-filter":"e-value-filter"))],"e-selected-tab"),0===e.selectedIndex?this.parent.pivotCommon.filterDialog.updateCheckedState():(this.parent.pivotCommon.filterDialog.dialogPopUp.buttons[0].buttonModel.disabled=!1,this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector("."+mr).removeAttribute("disabled"))},x.prototype.updateDialogButtonEvents=function(){this.parent.pivotCommon.filterDialog.dialogPopUp.buttons=this.buttonModel(),this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind()},x.prototype.updateCustomFilter=function(){var t,i=this,e=this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector(".e-selected-tab"),a=e.getAttribute("data-fieldname"),r=e.getAttribute("data-selectedField"),n=e.getAttribute("data-type"),s=e.getAttribute("data-measure"),o=e.getAttribute("data-operator"),l=e.getAttribute("data-value1"),d=e.getAttribute("data-value2"),p="value"===n?"Value":"date"===n?"Date":"number"===n?"Number":"Label",h={name:a,type:p,measure:s,condition:o,value1:"date"===n?new Date(l):l,value2:"date"===n?new Date(d):d};if("olap"===this.parent.dataType){h.selectedField=r,this.removeDataSourceSettings(a,r,p);for(var u=0,c=this.parent.dataSourceSettings.filterSettings;u<c.length;u++){var g=c[u];g.name===a&&g.selectedField===r&&(t=g)}}else t=Ce.getFilterItemByName(a,this.parent.dataSourceSettings.filterSettings);Ue.isNullOrUndefined(l)||""===l||-1<["Between","NotBetween"].indexOf(o)&&(Ue.isNullOrUndefined(d)||""===d)?(s=p.toLowerCase()+(Ue.isNullOrUndefined(l)||""===l?"_input_option_1":"_input_option_2"),n=Ue.select("#"+this.parent.element.id+"_"+s,e),Ue.addClass([n],Ln),n.focus()):(o={cancel:!1,filterSettings:h,dataSourceSettings:Ce.getClonedDataSourceSettings(this.parent.dataSourceSettings)},("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(dt,o,function(e){e.cancel||(h=e.filterSettings,t?((t=t.properties||t).type=h.type,t.measure=h.measure,t.condition=h.condition,t.value1=h.value1,t.value2=h.value2,"olap"===i.parent.dataType&&(t.selectedField=h.selectedField)):i.parent.dataSourceSettings.filterSettings.push(h)),"Value"!==p&&(i.parent.lastFilterInfo=Ce.getFilterItemByName(a,i.parent.dataSourceSettings.filterSettings),i.parent.lastFilterInfo=i.parent.lastFilterInfo.properties||i.parent.lastFilterInfo),i.parent.pivotCommon.filterDialog.dialogPopUp.close(),e.cancel||(i.refreshPivotButtonState(a,!0),i.updateDataSource(!0))}))},x.prototype.ClearFilter=function(){var e=this.parent.pivotCommon.filterDialog.dialogPopUp.element,t=e.getAttribute("data-fieldname"),e=e.querySelector(".e-selected-tab"),e=(this.parent.pivotCommon.filterDialog.dialogPopUp.close(),"olap"===this.parent.dataType&&e?(e=e.getAttribute("data-selectedField"),this.removeDataSourceSettings(t,e)):this.removeDataSourceSettings(t),Ce.getFilterItemByName(t,this.parent.dataSourceSettings.filterSettings));this.refreshPivotButtonState(t,!!e),this.updateDataSource(!0)},x.prototype.removeButton=function(e){var t=this,i=e.target,a=i.parentElement.getAttribute("data-uid"),r=Ce.getFieldInfo(a,this.parent);if(this.parent.actionObj.actionName=bi,this.parent.actionObj.fieldInfo=r,!this.parent.actionBeginMethod()){e={cancel:!1,fieldName:a,dataSourceSettings:Ce.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:r.fieldItem,axis:r.axis};try{("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(ut,e,function(e){e.cancel||("true"===i.parentElement.getAttribute("isvalue")?(t.parent.setProperties({dataSourceSettings:{values:[]}},!0),"olap"===t.parent.dataType&&t.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport("[Measures]")):(t.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(a),"pivot"===t.parent.dataType&&t.parent.showValuesButton&&1<t.parent.dataSourceSettings.values.length&&r.position<t.parent.dataSourceSettings.valueIndex&&("row"===t.parent.dataSourceSettings.valueAxis&&"rows"===e.axis||"column"===t.parent.dataSourceSettings.valueAxis&&"columns"===e.axis)&&t.parent.setProperties({dataSourceSettings:{valueIndex:t.parent.dataSourceSettings.valueIndex-1}},!0),"olap"===t.parent.dataType&&0===t.parent.dataSourceSettings.values.length&&t.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport("[Measures]")),"pivotfieldlist"===t.parent.getModuleName()&&t.parent.axisFieldModule.render(),t.updateDataSource())})}catch(e){this.parent.actionFailureMethod(e)}}},x.prototype.nodeStateModified=function(e){var t,i=Ue.closest(e.node,"li"),a=i.getAttribute("data-fieldname");"all"===i.getAttribute("data-memberId")?(this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked=null,"check"===e.action?this.parent.pivotCommon.filterDialog.memberTreeView.checkAll():this.parent.pivotCommon.filterDialog.memberTreeView.uncheckAll(),"olap"===this.parent.dataType&&this.parent.olapEngineModule&&!this.parent.olapEngineModule.fieldList[a].isHierarchy&&this.updateNodeStates(this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(),a),this.checkedStateAll(e.action),this.parent.pivotCommon.filterDialog.memberTreeView.nodeChecked=this.nodeStateModified.bind(this)):("olap"===this.parent.dataType&&this.parent.olapEngineModule&&!this.parent.olapEngineModule.fieldList[a].isHierarchy&&(t=this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(),this.updateNodeStates(t,a)),t=this.parent.pivotCommon.currentTreeItemsPos[i.getAttribute("data-memberId")].index,this.parent.pivotCommon.currentTreeItems[t]&&(this.parent.pivotCommon.currentTreeItems[t].isSelected="check"===e.action,this.parent.pivotCommon.currentTreeItemsPos[i.getAttribute("data-memberId")].isSelected="check"===e.action)),this.parent.pivotCommon.filterDialog.updateCheckedState()},x.prototype.checkedStateAll=function(e){for(var t={},i=0,a=this.parent.pivotCommon.searchTreeItems;i<a.length;i++)(r=a[i]).isSelected="check"===e,t[r.htmlAttributes["data-memberId"]]=r.htmlAttributes["data-memberId"];for(var r,n=0,s=this.parent.pivotCommon.currentTreeItems;n<s.length;n++)void 0!==t[(r=s[n]).htmlAttributes["data-memberId"]]&&(r.isSelected="check"===e,this.parent.pivotCommon.currentTreeItemsPos[r.htmlAttributes["data-memberId"]].isSelected="check"===e)},x.prototype.updateNodeStates=function(e,t){var i=this.parent.pivotCommon.engineModule.fieldList[t],a=i.members,r=i.currrentMembers;if(0<i.searchMembers.length){for(var n=0,s=Object.keys(r);n<s.length;n++)r[p=s[n]]&&(r[p].isSelected=!1),a[p]&&(a[p].isSelected=!1,this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+p+'"]'))&&(o=this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+p+'"]'))&&!o.querySelector("ul")&&this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,p,!1);for(var o,l=0,d=e;l<d.length;l++)a[c=d[l]]&&this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+c+'"]')&&(o=this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+c+'"]'))&&!o.querySelector("ul")&&(a[c].isSelected=!0,this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,c,!0)),r[c]&&(r[c].isSelected=!0)}else{for(var p,h=0,u=Object.keys(a);h<u.length;h++)a[p=u[h]].isSelected&&(a[p].isSelected=!1);for(var c,g=0,m=e;g<m.length;g++)a[c=m[g]]&&(a[c].isSelected=!0,this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,c,!0))}},x.prototype.updateFilterState=function(n){var s=this,o=!1,l={items:[],name:n,type:"Include"},e="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;if("olap"===this.parent.dataType&&e&&!e.fieldList[n].isHierarchy){var t=e.fieldList[n].members,i=e.fieldList[n].currrentMembers;l.items=this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(),l.levelCount=e.fieldList[n].levelCount,o=l.items.length!==this.parent.pivotCommon.filterDialog.memberTreeView.fields.dataSource.length,0<e.fieldList[n].searchMembers.length&&!o&&(g=Object.keys(t).length,o=g!==Object.keys(i).length||g!==l.items.length);for(var a=0,r=l.items;a<r.length;a++){var d=r[a];0<e.fieldList[n].searchMembers.length&&i[d]?i[d].isSelected=!0:t[d]&&(t[d].isSelected=!0)}}else{for(var p=0,h=this.parent.pivotCommon.searchTreeItems;p<h.length;p++){var u=h[p];u.isSelected&&(this.parent.pivotCommon.isDateField?l.items.push(u.name):l.items.push(u.htmlAttributes["data-memberId"]))}o=l.items.length!==this.parent.pivotCommon.currentTreeItems.length}if("olap"===this.parent.dataType&&this.removeDataSourceSettings(n),this.parent.allowDeferLayoutUpdate){e.fieldList[l.name].filterType=l.type.toLowerCase(),e.fieldList[l.name].filter=[];for(var c=0;c<l.items.length;c++)e.fieldList[l.name].filter.push(l.items[c])}var g={filterSettings:l,dataSourceSettings:Ce.getClonedDataSourceSettings(this.parent.dataSourceSettings),cancel:!1};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(dt,g,function(e){if(l=e.filterSettings,!e.cancel){if(Ce.getFilterItemByName(n,s.parent.dataSourceSettings.filterSettings))for(var t=0;t<s.parent.dataSourceSettings.filterSettings.length;t++)if(s.parent.dataSourceSettings.filterSettings[t].name===n){s.parent.dataSourceSettings.filterSettings.splice(t,1);break}s.parent.dataSourceSettings.filterSettings.push(l)}s.parent.pivotCommon.filterDialog.dialogPopUp.close(),e.cancel||(s.refreshPivotButtonState(n,o),o||(s.removeDataSourceSettings(n),l={}),s.parent.lastFilterInfo=l,e={filterInfo:s.parent.lastFilterInfo},s.parent.actionObj.actionInfo=e,s.updateDataSource(!0),(e=s).parent instanceof eh&&e.axisField.render());for(var i=0,a=[].slice.call(s.parentElement.querySelectorAll(".e-pivot-button"));i<a.length;i++){var r=a[i];if(r.getAttribute("data-uid")===n){r.focus();break}}})},x.prototype.refreshPivotButtonState=function(e,t){for(var i,a=0,r=[].slice.call(this.parentElement.querySelectorAll(".e-pivot-button"));a<r.length;a++){var n=r[a];if(n.getAttribute("data-uid")===e){i=n.querySelector("."+$a);break}}i&&(t?(Ue.removeClass([i],er),Ue.addClass([i],tr)):(Ue.removeClass([i],tr),Ue.addClass([i],er)))},x.prototype.removeDataSourceSettings=function(e,t,i){for(var a=this.parent.dataSourceSettings.filterSettings,r=0,n=a.length;r<n;r++)if("olap"===this.parent.dataType&&t){if(!i&&a[r].name===e&&a[r].selectedField===t){a.splice(r,1);break}i&&a[r].type!==i&&a[r].name===e&&(a.splice(r,1),n--,r--)}else if(a[r].name===e){if(a.splice(r,1),"olap"!==this.parent.dataType)break;n--,r--}},x.prototype.updateDropIndicator=function(e){this.parent.isDragging&&(Ue.removeClass([].slice.call(this.parentElement.querySelectorAll("."+nr+"-last")),sr),Ue.removeClass([].slice.call(this.parentElement.querySelectorAll("."+nr)),sr),Ue.closest(e.target,"."+vr))&&(e=Ue.closest(e.target,"."+Qa),Ue.addClass([e.querySelector("."+nr)],sr))},x.prototype.wireEvent=function(e,t,i){Ue.EventHandler.add(e,"mouseover",this.updateDropIndicator,this),i||(-1===["filters","values"].indexOf(t)&&null!==e.querySelector("."+Q)&&Ue.EventHandler.add(e.querySelector("."+Q),"click",this.updateSorting,this),"values"!==t&&null!==e.querySelector("."+$a)&&Ue.EventHandler.add(e.querySelector("."+$a),"click",this.updateFiltering,this),"values"===t&&null!==e.querySelector("."+Na)&&Ue.EventHandler.add(e.querySelector("."+Na),"click",this.createMenuOption,this)),null!==e.querySelector("."+Fn)&&Ue.EventHandler.add(e.querySelector("."+Fn),"click",this.openCalculatedFieldDialog,this),null!==e.querySelector("."+ir)&&Ue.EventHandler.add(e.querySelector("."+ir),"click",this.removeButton,this)},x.prototype.unWireEvent=function(e,t,i){Ue.EventHandler.remove(e,"mouseover",this.updateDropIndicator),i||(-1===["filters","values"].indexOf(t)&&null!==e.querySelector("."+Q)&&Ue.EventHandler.remove(e.querySelector("."+Q),"click",this.updateSorting),"values"!==t&&null!==e.querySelector("."+$a)&&Ue.EventHandler.remove(e.querySelector("."+$a),"click",this.updateFiltering),"values"===t&&null!==e.querySelector("."+Na)&&Ue.EventHandler.remove(e.querySelector("."+Na),"click",this.createMenuOption)),null!==e.querySelector("."+Fn)&&Ue.EventHandler.remove(e.querySelector("."+Fn),"click",this.openCalculatedFieldDialog),null!==e.querySelector("."+ir)&&Ue.EventHandler.remove(e.querySelector("."+ir),"click",this.removeButton)},x.prototype.addEventListener=function(){this.handlers={load:this.renderPivotButton},this.parent.isDestroyed||this.parent.on(Et,this.handlers.load,this)},x.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Et,this.handlers.load)},x.prototype.destroy=function(){this.menuOption&&(this.menuOption.destroy(),this.menuOption=null);var e=Ue.select("."+gs,this.parentElement),t=e?Ue.getInstance(e,G.DropDownList):null,t=(t&&!t.isDestroyed&&t.destroy(),(e=Ue.select("."+ms,this.parentElement))?Ue.getInstance(e,G.DropDownList):null);t&&!t.isDestroyed&&(t.destroy(),t=null),this.draggable&&!this.draggable.isDestroyed&&(this.draggable.destroy(),this.draggable=null),this.axisField&&(this.axisField=null),this.removeEventListener(),this.isDestroyed=!0};var Qp=x;function x(e){this.parent=e,this.menuOption=new As(this.parent),(this.parent.pivotButtonModule=this).addEventListener(),this.parent instanceof eh&&(this.axisField=new Yp(this.parent)),this.isDestroyed=!1}Kp.prototype.render=function(){(!this.parent.pivotButtonModule||this.parent.pivotButtonModule&&this.parent.pivotButtonModule.isDestroyed)&&new Qp(this.parent),this.createPivotButtons()},Kp.prototype.createPivotButtons=function(){var e=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],t=this.parent.dialogRenderer.parentElement;if(t.querySelector("."+Aa+"-filters")&&(t.querySelector("."+Aa+"-filters").querySelector("."+za).innerHTML=""),t.querySelector("."+Aa+"-rows")&&(t.querySelector("."+Aa+"-rows").querySelector("."+za).innerHTML=""),t.querySelector("."+Aa+"-columns")&&(t.querySelector("."+Aa+"-columns").querySelector("."+za).innerHTML=""),t.querySelector("."+Aa+"-values")&&(t.querySelector("."+Aa+"-values").querySelector("."+za).innerHTML=""),"pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&(!(this.parent.dataSourceSettings.dataSource instanceof K.DataManager)&&0<this.parent.dataSourceSettings.dataSource.length||this.parent.dataSourceSettings.dataSource instanceof K.DataManager&&this.parent.engineModule.data&&0<this.parent.engineModule.data.length)||"olap"===this.parent.dataType&&this.parent.dataSourceSettings.url&&""!==this.parent.dataSourceSettings.url||"Server"===this.parent.dataSourceSettings.mode&&""!==this.parent.dataSourceSettings.url)for(var i,a=["rows","columns","values","filters"],r=0,n=e.length;r<n;r++)e[r]&&(i={field:e[r],axis:a[r].toString()},this.parent.notify(Et,i))};var Yp=Kp;function Kp(e){this.parent=e}Jp.prototype.render=function(){this.parent.dialogRenderer.render(),this.parent.isAdaptive||this.parent.treeViewModule.render(),this.parent.axisTableModule.render()};var Xp=Jp;function Jp(e){this.parent=e,this.parent.dialogRenderer=new Up(this.parent),this.parent.treeViewModule=new Gp(this.parent),this.parent.axisTableModule=new zp(this.parent),this.parent.axisFieldModule=new Yp(this.parent)}Zp=function(e,t){return(Zp=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Zp,$p,Sl=function(e,t){function i(){this.constructor=e}Zp(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},h=function(e,t,i,a){var r,n=arguments.length,s=n<3?t:null===a?a=Object.getOwnPropertyDescriptor(t,i):a;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,a);else for(var o=e.length-1;0<=o;o--)(r=e[o])&&(s=(n<3?r(s):3<n?r(t,i,s):r(t,i))||s);return 3<n&&s&&Object.defineProperty(t,i,s),s},eh=($p=Ue.Component,Sl(T,$p),T.prototype.requiredModules=function(){var e=[];return this.allowCalculatedField&&e.push({args:[this],member:"calculatedField"}),e},T.prototype.getAllSummaryType=function(){return["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"]},T.prototype.preRender=function(){this.dataSourceSettings&&"SSAS"===this.dataSourceSettings.providerType?(this.olapEngineModule=new cp,this.dataType="olap"):(this.engineModule=new A,this.dataType="pivot"),this.isAdaptive=Ue.Browser.isDevice,this.globalize=new Ue.Internationalization(this.locale),this.renderModule=new Xp(this),this.defaultLocale={staticFieldList:"Pivot Field List",fieldList:"Field List",dropFilterPrompt:"Drop filter here",dropColPrompt:"Drop column here",dropRowPrompt:"Drop row here",dropValPrompt:"Drop value here",addPrompt:"Add field here",adaptiveFieldHeader:"Choose field",centerHeader:"Drag fields between axes below:",add:"Add",drag:"Drag",filter:"Filter",filtered:"Filtered",sort:"Sort",remove:"Remove",filters:"Filters",rows:"Rows",columns:"Columns",values:"Values",CalculatedField:"Calculated Field",createCalculatedField:"Create Calculated Field",fieldName:"Enter the field name",error:"Error",invalidFormula:"Invalid formula.",dropText:'Example: ("Sum(Order_Count)" + "Sum(In_Stock)") * 250',dropTextMobile:"Add fields and edit formula here.",dropAction:"Calculated field cannot be place in any other region except value axis.",search:"Search",close:"Close",cancel:"Cancel",delete:"Delete",alert:"Alert",warning:"Warning",ok:"OK",allFields:"All Fields",formula:"Formula",fieldExist:"A field already exists in this name. Please enter a different name.",confirmText:"A calculation field already exists in this name. Do you want to replace it?",noMatches:"No matches",format:"Summaries values by",edit:"Edit",clear:"Clear",clearCalculatedField:"Clear edited field info",editCalculatedField:"Edit calculated field",sortAscending:"Sort ascending order",sortDescending:"Sort descending order",sortNone:"Sort data order",formulaField:"Drag and drop fields to formula",dragField:"Drag field to formula",clearFilter:"Clear",by:"by",enterValue:"Enter value",chooseDate:"Enter date",all:"All",multipleItems:"Multiple items",Equals:"Equals",DoesNotEquals:"Does Not Equal",BeginWith:"Begins With",DoesNotBeginWith:"Does Not Begin With",EndsWith:"Ends With",DoesNotEndsWith:"Does Not End With",Contains:"Contains",DoesNotContains:"Does Not Contain",GreaterThan:"Greater Than",GreaterThanOrEqualTo:"Greater Than Or Equal To",LessThan:"Less Than",LessThanOrEqualTo:"Less Than Or Equal To",Between:"Between",NotBetween:"Not Between",Before:"Before",BeforeOrEqualTo:"Before Or Equal To",After:"After",AfterOrEqualTo:"After Or Equal To",member:"Member",label:"Label",date:"Date",value:"Value",labelTextContent:"Show the items for which the label",dateTextContent:"Show the items for which the date",valueTextContent:"Show the items for which",And:"and",Sum:"Sum",Count:"Count",DistinctCount:"Distinct Count",Product:"Product",Avg:"Avg",Median:"Median",Min:"Min",Max:"Max",Index:"Index",SampleStDev:"Sample StDev",PopulationStDev:"Population StDev",SampleVar:"Sample Var",PopulationVar:"Population Var",RunningTotals:"Running Totals",DifferenceFrom:"Difference From",PercentageOfDifferenceFrom:"% of Difference From",PercentageOfGrandTotal:"% of Grand Total",PercentageOfColumnTotal:"% of Column Total",PercentageOfRowTotal:"% of Row Total",PercentageOfParentTotal:"% of Parent Total",PercentageOfParentColumnTotal:"% of Parent Column Total",PercentageOfParentRowTotal:"% of Parent Row Total",MoreOption:"More...",Years:"Years",Quarters:"Quarters",Months:"Months",Days:"Days",Hours:"Hours",Minutes:"Minutes",Seconds:"Seconds",apply:"Apply",valueFieldSettings:"Value field settings",sourceName:"Field name :",sourceCaption:"Field caption",summarizeValuesBy:"Summarize values by",baseField:"Base field",baseItem:"Base item",example:"e.g:",editorDataLimitMsg:" more items. Search to refine further.",deferLayoutUpdate:"Defer Layout Update",null:"null",undefined:"undefined",groupOutOfRange:"Out of Range",fieldDropErrorAction:"The field you are moving cannot be placed in that area of the report",memberType:"Field Type",selectedHierarchy:"Parent Hierarchy",formatString:"Format",expressionField:"Expression",olapDropText:"Example: [Measures].[Order Quantity] + ([Measures].[Order Quantity] * 0.10)",customFormat:"Enter custom format string",numberFormatString:"Example: C, P, 0000 %, ###0.##0#, etc.",Measure:"Measure",Dimension:"Dimension",Standard:"Standard",Currency:"Currency",Percent:"Percent",Custom:"Custom",blank:"(Blank)",fieldTooltip:'Drag and drop fields to create an expression. And, if you want to edit the existing calculated fields! You can achieve it by simply selecting the field under "Calculated Members".',fieldTitle:"Field Name",QuarterYear:"Quarter Year",caption:"Field Caption",copy:"Copy",of:"of",group:"Group",removeCalculatedField:"Are you sure you want to delete this calculated field?",yes:"Yes",no:"No",None:"None",qtr:"Qtr",grandTotal:"Grand Total"},this.localeObj=new Ue.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.isDragging=!1,this.isDeferLayoutUpdate=Ue.isNullOrUndefined(this.isDeferLayoutUpdate)&&!this.isPopupView?this.allowDeferLayoutUpdate:this.isDeferLayoutUpdate,this.wireEvent()},T.prototype.frameCustomProperties=function(e,t){this.pivotGridModule&&this.pivotGridModule.updatePageSettings(!1);var i=!!this.pivotGridModule&&this.pivotGridModule.isTabular,a=(this.pivotGridModule||this).pageSettings,r=!!this.pivotGridModule&&this.pivotGridModule.enablePaging,n=!!this.pivotGridModule&&this.pivotGridModule.enableVirtualization,s=(this.pivotGridModule||this).enableHtmlSanitizer,o=(this.pivotGridModule||this.staticPivotGridModule||this).localeObj,l=!this.pivotGridModule||this.pivotGridModule.allowDrillThrough||this.pivotGridModule.editSettings.allowEditing,d=this.pivotGridModule?this.pivotGridModule.enableValueSorting:void 0,p=!(!this.pivotGridModule||!this.pivotGridModule.allowDataCompression)&&this.pivotGridModule.allowDataCompression,h=this.pivotGridModule&&this.pivotGridModule.enableVirtualization&&this.pivotGridModule.virtualScrollSettings&&this.pivotGridModule.virtualScrollSettings.allowSinglePage,t="olap"===this.dataType?{mode:"",savedFieldList:t||void 0,savedFieldListData:e||void 0,pageSettings:a,enableValueSorting:d,isDrillThrough:l,localeObj:o,enableVirtualization:n,allowDataCompression:p}:{mode:"",savedFieldList:void 0,pageSettings:a,enableValueSorting:d,isDrillThrough:l,localeObj:o,clonedReport:this.clonedReport,globalize:this.globalize,currenyCode:this.currencyCode,enablePaging:r,enableVirtualization:n,enableHtmlSanitizer:s,allowDataCompression:p,enableOptimizedRendering:h,isTabularLayout:i};return t},T.prototype.render=function(){"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url?"Server"===this.dataSourceSettings.mode?(this.guid=Ce.generateUUID(),this.initialLoad()):new Ue.Fetch(this.dataSourceSettings.url,"GET").send().then(function(e){return"string"==typeof e?e:e.text()}).then(this.onReadyStateChange.bind(this)):this.initialLoad()},T.prototype.getEngine=function(e,t,i,a,r,n,s,o,l){for(var d=this,p=(this.currentAction=e,this.pivotGridModule&&this.pivotGridModule.updatePageSettings(!1),{pageSettings:this.pivotGridModule?JSON.parse(this.pivotGridModule.getPageSettings()).pageSettings:void 0,enableValueSorting:this.pivotGridModule?this.pivotGridModule.enableValueSorting:void 0,enableDrillThrough:!this.pivotGridModule||this.pivotGridModule.allowDrillThrough||this.pivotGridModule.editSettings.allowEditing,locale:JSON.stringify(Ce.getLocalizedObject(this)),enableOptimizedRendering:this.pivotGridModule&&this.pivotGridModule.enableVirtualization&&this.pivotGridModule.virtualScrollSettings&&this.pivotGridModule.virtualScrollSettings.allowSinglePage,requestType:"string",headers:{"Content-type":"application/json"}}),h=(this.request.readyState!==XMLHttpRequest.UNSENT&&this.request.readyState!==XMLHttpRequest.OPENED||(this.request.withCredentials=!1),{request:this.request,dataSourceSettings:JSON.parse(this.getPersistData()).dataSourceSettings,action:e,customProperties:{},internalProperties:p,drillItem:t,sortItem:i,aggregatedItem:a,calculatedItem:r,filterItem:n,memberName:s,fetchRawDataArgs:o,editArgs:l,hash:(this.pivotGridModule||this).guid,isGroupingUpdated:"onRefresh"===this.currentAction&&0<this.dataSourceSettings.groupSettings.length||!(!this.pivotGridModule||!this.pivotGridModule.groupingModule)&&this.pivotGridModule.groupingModule.isUpdate}),u=(this.trigger(ft,h,function(e){d.request=e.request,h.internalProperties=e.internalProperties,h.customProperties=e.customProperties,h.dataSourceSettings=e.dataSourceSettings,h.calculatedItem=e.calculatedItem,h.drillItem=e.drillItem,h.editArgs=e.editArgs,h.fetchRawDataArgs=e.fetchRawDataArgs,h.filterItem=e.filterItem,h.hash=e.hash,h.memberName=e.memberName,h.sortItem=e.sortItem}),this.request.open("POST",this.dataSourceSettings.url,!0),this.request.onreadystatechange=this.onSuccess.bind(this),Object.keys(h.internalProperties.headers)),c=0;c<u.length;c++){var g=u[c],m=String(h.internalProperties.headers[g]);this.request.setRequestHeader(g,m)}"string"===h.internalProperties.requestType?this.request.send(JSON.stringify(h)):"base64"===h.internalProperties.requestType&&this.request.send(btoa(JSON.stringify(h)))},T.prototype.onSuccess=function(){if(this.request.readyState===XMLHttpRequest.DONE){try{var e={action:this.currentAction,response:this.request.responseText},t=(this.trigger(vt,e),JSON.parse(this.request.responseText));if("fetchFieldMembers"===this.currentAction){for(var i=JSON.parse(t.members),a=[],r={},n=(this.engineModule.globalize=Ue.isNullOrUndefined(this.globalize)?new Ue.Internationalization:this.globalize,this.engineModule.formatFields=this.engineModule.setFormattedFields(this.dataSourceSettings.formatSettings),Ce.isDateField(t.memberName,this.engineModule)),s="number"===this.engineModule.fieldList[t.memberName].type,o=Object.keys(i),l=0,d=o.length;l<d;l++){var p=i[o[l]],h=n?this.engineModule.getFormattedValue(p.Name,t.memberName):{formattedText:p.Caption};r[o[l]]={index:p.Index,ordinal:p.Ordinal,isDrilled:p.IsDrilled,caption:h.formattedText},a.push({formattedText:h.formattedText,actualText:n?h.dateText:!s||isNaN(Number(p.Name))?p.Name:Number(p.Name)})}this.engineModule.fieldList[t.memberName].members=r,this.engineModule.fieldList[t.memberName].dateMember=a,this.pivotButtonModule.updateFilterEvents()}else{var u=Ce.formatFieldList(JSON.parse(t.fieldList));if(this.engineModule.fieldList)for(o=Object.keys(this.engineModule.fieldList),l=0;l<o.length;l++)this.engineModule.fieldList[o[l]]&&u[o[l]]&&(u[o[l]].dateMember=this.engineModule.fieldList[o[l]].dateMember,u[o[l]].formattedMembers=this.engineModule.fieldList[o[l]].formattedMembers,u[o[l]].members=this.engineModule.fieldList[o[l]].members);this.engineModule.fieldList=u,this.engineModule.fields=JSON.parse(t.fields),this.engineModule.rowCount=JSON.parse(t.pivotCount).RowCount,this.engineModule.columnCount=JSON.parse(t.pivotCount).ColumnCount,this.engineModule.rowStartPos=JSON.parse(t.pivotCount).RowStartPosition,this.engineModule.colStartPos=JSON.parse(t.pivotCount).ColumnStartPosition,this.engineModule.rowFirstLvl=JSON.parse(t.pivotCount).RowFirstLevel,this.engineModule.colFirstLvl=JSON.parse(t.pivotCount).ColumnFirstLevel;for(var c=void 0,g=Ce.formatPivotValues(JSON.parse(t.pivotValue)),m=0;m<g.length;m++)if(g[m]&&g[m][0]&&"row"===g[m][0].axis){c=m;break}this.engineModule.headerContent=Ce.frameContent(g,"header",c,this),this.engineModule.pageSettings=this.pivotGridModule?this.pivotGridModule.pageSettings:void 0;var S=JSON.parse(t.dataSourceSettings).ValueSortSettings;this.engineModule.valueSortSettings={headerText:S.HeaderText,headerDelimiter:S.HeaderDelimiter,sortOrder:S.SortOrder,columnIndex:S.ColumnIndex},this.engineModule.pivotValues=g,this.engineModule.isEmptyData=0===this.dataSourceSettings.values.length}}catch(e){this.engineModule.pivotValues=[]}"fetchFieldMembers"!==this.currentAction&&(this.isInitial&&!this.isPopupView?(this.initEngine(),this.isInitial=!1):this.enginePopulatedEventMethod(this,!0,!1),this.calculatedFieldModule&&"onCalcOperation"===this.currentAction&&(this.calculatedFieldModule.endDialog(),this.calculatedFieldModule.isRequireUpdate)&&(this.calculatedFieldModule.isRequireUpdate=!1),this.pivotGridModule)&&this.pivotGridModule.calculatedFieldModule&&this.pivotGridModule.calculatedFieldModule.isRequireUpdate&&(this.pivotGridModule.calculatedFieldModule.endDialog(),this.pivotGridModule.calculatedFieldModule.isRequireUpdate=!1)}},T.prototype.onReadyStateChange=function(e){var t=[];if("CSV"===this.dataSourceSettings.type)for(var i=e.split(/\r?\n|\r/),a=0;a<i.length;a++)Ue.isNullOrUndefined(i[a])||""===i[a]||t.push(i[a].split(","));else try{t=JSON.parse(e)}catch(e){t=[]}t&&0<t.length&&this.setProperties({dataSourceSettings:{dataSource:t}},!0),this.initialLoad()},T.prototype.initialLoad=function(){var t=this,i={dataSourceSettings:this.dataSourceSettings,defaultFieldListOrder:this.defaultFieldListOrder};this.trigger(k,i,function(e){t.dataSourceSettings=e.dataSourceSettings,t.defaultFieldListOrder=i.defaultFieldListOrder,Ue.addClass([t.element],Ca),t.enableRtl?Ue.addClass([t.element],xa):Ue.removeClass([t.element],xa),t.isAdaptive?Ue.addClass([t.element],wa):Ue.removeClass([t.element],wa),t.cssClass&&Ue.addClass([t.element],t.cssClass.split(" ")),t.notify(xt,{})})},T.prototype.wireEvent=function(){this.on(xt,this.generateData,this),this.on(Ot,this.fieldListRender,this)},T.prototype.unWireEvent=function(){this.pivotGridModule&&this.pivotGridModule.isDestroyed||(this.off(xt,this.generateData),this.off(Ot,this.fieldListRender))},T.prototype.getPersistData=function(){return this.addOnPersist(["dataSourceSettings"])},T.prototype.getModuleName=function(){return"pivotfieldlist"},T.prototype.onPropertyChanged=function(e,t){for(var i=!1,a=0,r=Object.keys(e);a<r.length;a++){var n,s,o,l,d,p=r[a];switch(p){case"locale":$p.prototype.refresh.call(this);break;case"dataSourceSettings":e.dataSourceSettings&&(!Ue.isNullOrUndefined(e.dataSourceSettings.dataSource)&&this.clonedDataSet!==e.dataSourceSettings.dataSource&&e.dataSourceSettings.groupSettings||1===Object.keys(e.dataSourceSettings).length&&"dataSource"===Object.keys(e.dataSourceSettings)[0]&&0<this.dataSourceSettings.groupSettings.length)&&(this.clonedDataSet=e.dataSourceSettings.dataSource,this.engineModule.groupingFields={}),(Ue.isNullOrUndefined(e.dataSourceSettings.dataSource)||e.dataSourceSettings.groupSettings&&0<e.dataSourceSettings.groupSettings.length)&&("olap"!==this.dataType||Ue.isNullOrUndefined(e.dataSourceSettings.url))||("olap"!==this.dataType&&(Ue.isNullOrUndefined(this.savedDataSourceSettings)||(Ce.updateDataSourceSettings(this.staticPivotGridModule,this.savedDataSourceSettings),this.savedDataSourceSettings=void 0),e.dataSourceSettings.dataSource)&&0===e.dataSourceSettings.dataSource.length&&!Ue.isNullOrUndefined(this.staticPivotGridModule)&&(this.savedDataSourceSettings=Ce.getClonedDataSourceSettings(this.staticPivotGridModule.dataSourceSettings),this.staticPivotGridModule.setProperties({dataSourceSettings:{rows:[],columns:[],values:[],filters:[]}},!0)),"pivot"===this.dataType?(this.engineModule.fieldList=null,this.engineModule.isEmptyData=!0,this.engineModule.data=[],this.engineModule.pivotValues=[],this.engineModule.groupingFieldsInfo={}):"olap"===this.dataType&&(this.olapEngineModule.fieldList={},this.olapEngineModule.fieldListData=void 0,this.olapEngineModule.isEmptyData=!0),Ue.isNullOrUndefined(this.staticPivotGridModule)||(this.staticPivotGridModule.pivotValues=[]),this.initialLoad()),Ce.isButtonIconRefesh(p,t,e)&&(this.isPopupView&&this.pivotGridModule&&this.pivotGridModule.showGroupingBar&&this.pivotGridModule.groupingBarModule?(d=Ce.cloneFieldSettings(this.dataSourceSettings.filters),l=Ce.cloneFieldSettings(this.dataSourceSettings.values),s=Ce.cloneFieldSettings(this.dataSourceSettings.rows),o=Ce.cloneFieldSettings(this.dataSourceSettings.columns),this.pivotGridModule.setProperties({dataSourceSettings:{rows:s,columns:o,values:l,filters:d}},!0),this.pivotGridModule.axisFieldModule.render()):this.isPopupView||!this.staticPivotGridModule||this.staticPivotGridModule.isDestroyed||((n=this.staticPivotGridModule).showGroupingBar&&n.groupingBarModule&&n.axisFieldModule.render(),n.showFieldList&&n.pivotFieldListModule&&(s=Ce.cloneFieldSettings(n.dataSourceSettings.rows),o=Ce.cloneFieldSettings(n.dataSourceSettings.columns),l=Ce.cloneFieldSettings(n.dataSourceSettings.values),d=Ce.cloneFieldSettings(n.dataSourceSettings.filters),n.pivotFieldListModule.setProperties({dataSourceSettings:{rows:s,columns:o,values:l,filters:d}},!0),n.pivotFieldListModule.axisFieldModule.render(),n.pivotFieldListModule.treeViewModule.fieldTable)&&!n.isAdaptive&&n.pivotFieldListModule.notify(Nt,{})),this.axisFieldModule.render(),this.treeViewModule.fieldTable)&&!this.isAdaptive&&this.notify(Nt,{});break;case"aggregateTypes":this.axisFieldModule&&this.axisFieldModule.render(),this.pivotGridModule&&this.pivotGridModule.axisFieldModule&&(this.pivotGridModule.setProperties({aggregateTypes:e.aggregateTypes},!0),this.pivotGridModule.axisFieldModule.render());break;case"showValuesButton":this.axisFieldModule&&this.axisFieldModule.render(),this.pivotGridModule&&this.pivotGridModule.showGroupingBar&&this.pivotGridModule.groupingBarModule&&this.pivotGridModule.axisFieldModule&&(this.pivotGridModule.setProperties({showValuesButton:e.showValuesButton},!0),this.pivotGridModule.axisFieldModule.render());break;case"enableRtl":this.enableRtl?Ue.addClass([this.element],xa):Ue.removeClass([this.element],xa),i=!0;break;case"enableFieldSearching":case"allowDeferLayoutUpdate":case"allowCalculatedField":this.refresh()}i&&this.fieldListRender()}},T.prototype.initEngine=function(){var r=this;if("pivot"===this.dataType){var e=Ue.isNullOrUndefined(this.dataSourceSettings.dataSource)?Ue.isNullOrUndefined(this.engineModule.data)?void 0:this.engineModule.data[0]:this.dataSourceSettings.dataSource[0];if(e&&this.pivotCommon){e="[object Array]"===Object.prototype.toString.call(e);if(e&&"JSON"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidJSON"));if(!e&&"CSV"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidCSV"))}}var e={dataSourceSettings:Ce.getClonedDataSourceSettings(this.dataSourceSettings)},n=this.isPopupView?this.pivotGridModule:this;n.trigger(_,e,function(e){var t,i,a;Ce.updateDataSourceSettings(r,e.dataSourceSettings),"pivot"===r.dataType?(r.dataSourceSettings.groupSettings&&0<r.dataSourceSettings.groupSettings.length&&(e=r.dataSourceSettings.dataSource,r.clonedDataSet=r.clonedDataSet||("CSV"===r.dataSourceSettings.type?Ce.getClonedCSVData(e):Ce.getClonedData(e)),(e=JSON.parse(r.getPersistData()).dataSourceSettings).dataSource=[],r.clonedReport=r.clonedReport||e),(e=r.frameCustomProperties()).enableValueSorting=(r.staticPivotGridModule||r).enableValueSorting,"Server"!==r.dataSourceSettings.mode&&r.engineModule.renderEngine(r.dataSourceSettings,e,r.aggregateCellInfo?r.getValueCellInfo.bind(r):void 0,r.onHeadersSort?r.getHeaderSortInfo.bind(r):void 0),r.pivotFieldList=r.engineModule.fieldList,i={pivotFieldList:r.pivotFieldList,pivotValues:r.engineModule.pivotValues},t=r,n.trigger(U,i,function(e){t.pivotFieldList=e.pivotFieldList,t.engineModule.pivotValues=e.pivotValues,t.notify(Ot,{}),t.trigger(ie)})):"olap"===r.dataType&&(Ce.renderOlapEngine(r),r.pivotFieldList=r.olapEngineModule.fieldList,i={pivotFieldList:r.pivotFieldList,pivotValues:r.olapEngineModule.pivotValues},a=r,n.trigger(U,i,function(e){a.pivotFieldList=e.pivotFieldList,a.olapEngineModule.pivotValues=e.pivotValues,a.notify(Ot,{}),a.trigger(ie)}))}),"None"!==this.defaultFieldListOrder&&this.treeViewModule.fieldTable&&!this.isAdaptive&&this.notify(Nt,{})},T.prototype.generateData=function(){this.pivotFieldList={},this.dataSourceSettings&&(this.dataSourceSettings.dataSource||this.dataSourceSettings.url)?""!==this.dataSourceSettings.url&&"olap"===this.dataType||!Ue.isNullOrUndefined(this.dataSourceSettings.dataSource)&&0<this.dataSourceSettings.dataSource.length?("pivot"===this.dataType&&(this.engineModule.data=this.dataSourceSettings.dataSource),this.initEngine()):this.dataSourceSettings.dataSource instanceof K.DataManager?"pivot"===this.dataType&&0<this.remoteData.length?(this.engineModule.data=this.remoteData,this.initEngine()):setTimeout(this.getData.bind(this),100):"Server"===this.dataSourceSettings.mode?this.getEngine("onRefresh"):this.notify(Ot,{}):(this.notify(Ot,{}),this.trigger(ie))},T.prototype.getValueCellInfo=function(e){return this.trigger(it,e),e},T.prototype.getHeaderSortInfo=function(e){return this.trigger(at,e),e},T.prototype.getData=function(){(this.dataSourceSettings.dataSource.defaultQuery?this.dataSourceSettings.dataSource.executeQuery(this.dataSourceSettings.dataSource.defaultQuery):this.dataSourceSettings.dataSource.executeQuery(new K.Query)).then(this.executeQuery.bind(this))},T.prototype.executeQuery=function(e){this.engineModule.data=e.result,this.initEngine()},T.prototype.fieldListRender=function(){this.element.innerHTML="","Popup"===this.renderMode&&this.dialogRenderer.fieldListDialog&&!this.dialogRenderer.fieldListDialog.isDestroyed&&(e=this.dialogRenderer.fieldListDialog.visible,this.dialogRenderer.fieldListDialog.destroy(),Ue.remove(document.getElementById(this.element.id+"_Container"))),this.renderModule.render(),"Popup"===this.renderMode?(this.fieldListSpinnerElement=this.dialogRenderer.fieldListDialog.element,e&&this.dialogRenderer.fieldListDialog.show()):this.fieldListSpinnerElement=this.element.querySelector(".e-pivotfieldlist-container"),this.spinnerTemplate?P.createSpinner({target:this.fieldListSpinnerElement,template:this.spinnerTemplate,cssClass:this.cssClass||void 0},this.createElement):P.createSpinner({target:this.fieldListSpinnerElement,cssClass:this.cssClass||void 0},this.createElement);var e={pivotEngine:"olap"===this.dataType?this.olapEngineModule:this.engineModule,dataSourceSettings:this.dataSourceSettings,id:this.element.id,element:"Popup"===this.renderMode?this.dialogRenderer.fieldListDialog.element:Ue.select("#"+this.element.id+"_Container",this.element),moduleName:this.getModuleName(),enableRtl:this.enableRtl,enableHtmlSanitizer:this.enableHtmlSanitizer,isAdaptive:this.isAdaptive,renderMode:this.renderMode,localeObj:this.localeObj,dataType:this.dataType,cssClass:this.cssClass};this.pivotCommon=new Ks(e),(this.pivotCommon.control=this).allowDeferLayoutUpdate&&(this.clonedDataSource=Ce.getClonedDataSourceSettings(this.dataSourceSettings),"olap"===this.dataType&&(this.clonedFieldListData=Ce.cloneOlapFieldSettings(this.olapEngineModule.fieldListData)),this.clonedFieldList=Ce.getClonedFieldList(this.pivotFieldList))},T.prototype.getFieldCaption=function(e){var t=this.getFields(e),i="olap"===this.dataType?this.olapEngineModule:this.engineModule;if(0<t.length&&i&&i.fieldList)for(var a=t.length;a--;)if(t[a])for(var r=0,n=t[a];r<n.length;r++){var s=n[r];s&&i.fieldList[s.name]&&(s.caption?i.fieldList[s.name].caption=s.caption:i.fieldList[s.name].caption=s.name)}},T.prototype.getFields=function(e){return[e.rows,e.columns,e.values,e.filters]},T.prototype.updateDataSource=function(i,a){var r=this,n=(this.pivotGridModule&&this.pivotGridModule.showWaitingPopup(),P.showSpinner(this.fieldListSpinnerElement),this),s=n.isPopupView?n.pivotGridModule:n,o=!1,l=n.pivotGridModule&&(n.pivotGridModule.enableVirtualization||n.pivotGridModule.enablePaging)?n.pivotGridModule.pageSettings:void 0,d=0<Object.keys(n.lastCalcFieldInfo).length,p=0<Object.keys(n.lastSortInfo).length,h=0<Object.keys(n.lastAggregationInfo).length,u=0<Object.keys(n.lastFilterInfo).length,e={dataSourceSettings:Ce.getClonedDataSourceSettings(n.dataSourceSettings)};s.trigger(_,e,function(e){var t;l&&(p||u||h||d)||(Ce.updateDataSourceSettings(n,e.dataSourceSettings),Ce.updateDataSourceSettings(n.pivotGridModule,e.dataSourceSettings)),Ue.isNullOrUndefined(a)?(e=!p&&(n.staticPivotGridModule||n).enableValueSorting,p&&""!==n.dataSourceSettings.valueSortSettings.headerText&&(n.pivotGridModule&&n.pivotGridModule.setProperties({dataSourceSettings:{valueSortSettings:{headerText:""}}},!0),n.setProperties({dataSourceSettings:{valueSortSettings:{headerText:""}}},!0)),"pivot"===n.dataType?((t=n.frameCustomProperties()).enableValueSorting=e,t.savedFieldList=n.pivotFieldList,l&&(p||u||h||d)&&!n.allowDeferLayoutUpdate?(p&&("Server"===s.dataSourceSettings.mode?s.getEngine("onSort",null,n.lastSortInfo,null,null,null,null):n.engineModule.onSort(n.lastSortInfo),n.lastSortInfo={}),u&&("Server"===s.dataSourceSettings.mode?s.getEngine("onFilter",null,null,null,null,n.lastFilterInfo,null):n.engineModule.onFilter(n.lastFilterInfo,n.dataSourceSettings),n.lastFilterInfo={}),h&&("Server"===s.dataSourceSettings.mode?s.getEngine("onAggregation",null,null,n.lastAggregationInfo,null,null,null):n.engineModule.onAggregation(n.lastAggregationInfo),n.lastAggregationInfo={}),d&&("Server"===s.dataSourceSettings.mode?s.getEngine("onCalcOperation",null,null,null,n.lastCalcFieldInfo,null,null):n.engineModule.onCalcOperation(n.lastCalcFieldInfo,n.dataSourceSettings),n.lastCalcFieldInfo={})):("Server"===n.dataSourceSettings.mode?p?n.getEngine("onSort",null,n.lastSortInfo,null,null,null,null):h?n.getEngine("onAggregation",null,null,n.lastAggregationInfo,null,null,null):d?n.getEngine("onCalcOperation",null,null,null,n.lastCalcFieldInfo,null,null):u?n.getEngine("onFilter",null,null,null,null,n.lastFilterInfo,null):n.getEngine("onDrop",null,null,null,null,null,null):n.engineModule.renderEngine(n.dataSourceSettings,t,n.aggregateCellInfo?n.getValueCellInfo.bind(n):void 0,n.onHeadersSort?n.getHeaderSortInfo.bind(n):void 0),n.lastSortInfo={},n.lastAggregationInfo={},n.lastCalcFieldInfo={},n.lastFilterInfo={})):o=n.updateOlapDataSource(n,p,d,o,e,u),n.getFieldCaption(n.dataSourceSettings)):(n.axisFieldModule.render(),n.pivotGridModule&&n.pivotGridModule.notify(wt,n),n.isRequiredUpdate=!1),"Server"!==n.dataSourceSettings.mode?n.enginePopulatedEventMethod(n,i,o):(n.allowDeferLayoutUpdate&&!n.isRequiredUpdate||n.isRequiredUpdate)&&(P.hideSpinner(r.fieldListSpinnerElement),r.pivotGridModule)&&r.pivotGridModule.hideWaitingPopup()})},T.prototype.enginePopulatedEventMethod=function(t,i,a){var r=this,e=t.isPopupView?t.pivotGridModule:t,n={dataSourceSettings:t.dataSourceSettings,pivotFieldList:("pivot"===t.dataType?t.engineModule:t.olapEngineModule).fieldList,pivotValues:("pivot"===t.dataType?t.engineModule:t.olapEngineModule).pivotValues},e=(e.trigger(U,n,function(e){t.dataSourceSettings=e.dataSourceSettings,t.pivotCommon.dataSourceSettings=t.dataSourceSettings,t.pivotFieldList=e.pivotFieldList,"olap"===t.dataType?(t.olapEngineModule.pivotValues=e.pivotValues,t.pivotCommon.engineModule=t.olapEngineModule):(t.engineModule.pivotValues=e.pivotValues,t.pivotCommon.engineModule=t.engineModule),i||!t.treeViewModule.fieldTable||t.isAdaptive||t.notify(Nt,{}),t.isRequiredUpdate?(t.allowDeferLayoutUpdate&&(t.clonedDataSource=Ce.getClonedDataSourceSettings(t.dataSourceSettings),"olap"===r.dataType&&(r.clonedFieldListData=Ce.cloneOlapFieldSettings(r.olapEngineModule.fieldListData)),t.clonedFieldList=Ce.getClonedFieldList(t.pivotFieldList)),t.updateView(t.pivotGridModule)):r.isPopupView&&(r.isDeferLayoutUpdate||t.pivotGridModule&&t.pivotGridModule.pivotDeferLayoutUpdate)&&(t.pivotGridModule.engineModule=t.engineModule,t.pivotGridModule.setProperties({dataSourceSettings:t.dataSourceSettings.properties},!0),t.pivotGridModule.notify(wt,t),P.hideSpinner(t.fieldListSpinnerElement)),(r.isPopupView&&t.pivotGridModule&&t.pivotGridModule.allowDeferLayoutUpdate&&!t.isRequiredUpdate||!Ue.isNullOrUndefined(t.pivotGridModule))&&(P.hideSpinner(t.fieldListSpinnerElement),t.pivotGridModule.hideWaitingPopup()),t.isRequiredUpdate=!0,!t.pivotGridModule||a?P.hideSpinner(t.fieldListSpinnerElement):t.pivotGridModule.fieldListSpinnerElement=t.fieldListSpinnerElement}),this.getActionCompleteName());this.actionObj.actionName=e,this.actionObj.actionName&&this.actionCompleteMethod()},T.prototype.updateOlapDataSource=function(e,t,i,a,r,n){var s=e.frameCustomProperties(e.olapEngineModule.fieldListData,e.olapEngineModule.fieldList);return s.enableValueSorting=r,s.savedFieldList=e.pivotFieldList,!i&&!t||n?Ce.renderOlapEngine(e,s):(e.olapEngineModule.savedFieldList=e.pivotFieldList,e.olapEngineModule.savedFieldListData=e.olapEngineModule.fieldListData,i?(e.olapEngineModule.updateCalcFields(e.dataSourceSettings,e.lastCalcFieldInfo),e.lastCalcFieldInfo={},a=!e.olapEngineModule.dataFields[e.lastCalcFieldInfo.name],e.pivotGridModule&&e.pivotGridModule.hideWaitingPopup()):e.olapEngineModule.onSort(e.dataSourceSettings)),e.lastSortInfo={},e.lastAggregationInfo={},e.lastCalcFieldInfo={},e.lastFilterInfo={},a},T.prototype.update=function(e){e&&(this.clonedDataSet=e.clonedDataSet,this.clonedReport=e.clonedReport,this.setProperties({dataSourceSettings:e.dataSourceSettings,showValuesButton:e.showValuesButton},!0),this.engineModule=e.engineModule,this.olapEngineModule=e.olapEngineModule,this.dataType=e.dataType,this.pivotFieldList=("olap"===this.dataType?e.olapEngineModule:e.engineModule).fieldList,this.isPopupView?this.pivotGridModule=e:this.staticPivotGridModule=e,this.getFieldCaption(e.dataSourceSettings),this.pivotCommon.engineModule="olap"===this.dataType?this.olapEngineModule:this.engineModule,this.pivotCommon.dataSourceSettings=this.dataSourceSettings,(this.pivotCommon.control=this).treeViewModule.fieldTable&&!this.isAdaptive&&this.notify(Nt,{}),this.axisFieldModule.render(),!this.isPopupView)&&this.allowDeferLayoutUpdate&&(this.clonedDataSource=Ce.getClonedDataSourceSettings(this.dataSourceSettings),"olap"===this.dataType&&(this.clonedFieldListData=Ce.cloneOlapFieldSettings(this.olapEngineModule.fieldListData)),this.clonedFieldList=Ce.getClonedFieldList(this.pivotFieldList))},T.prototype.updateView=function(e){var t;e&&(t="Calculated field applied"===this.actionObj.actionName&&"olap"===e.dataType,!e.element.querySelector(".e-spin-hide")||t||this.allowDeferLayoutUpdate&&!this.isDeferUpdateApplied&&!e.isInitial||e.showWaitingPopup(),e.clonedDataSet=this.clonedDataSet,e.clonedReport=this.clonedReport,e.setProperties({dataSourceSettings:this.dataSourceSettings,showValuesButton:this.showValuesButton},!0),e.engineModule=this.engineModule,e.olapEngineModule=this.olapEngineModule,e.dataType=this.dataType,this.pivotChange||(e.pivotValues=("olap"===this.dataType?this.olapEngineModule:this.engineModule).pivotValues),t={dataSourceSettings:Ce.getClonedDataSourceSettings(e.dataSourceSettings),pivotValues:e.pivotValues},e.trigger(st,t),this.isPopupView||(e.guid=this.guid,(this.staticPivotGridModule=e).isStaticRefresh=!0),this.isDeferUpdateApplied=!1,this.staticPivotGridModule&&(this.staticPivotGridModule.isServerWaitingPopup=!0),e.dataBind())},T.prototype.triggerPopulateEvent=function(){var t=this,e=this.isPopupView?this.pivotGridModule:this,i={dataSourceSettings:this.dataSourceSettings,pivotFieldList:("olap"===this.dataType?this.olapEngineModule:this.engineModule).fieldList,pivotValues:("olap"===this.dataType?this.olapEngineModule:this.engineModule).pivotValues};e.trigger(U,i,function(e){t.dataSourceSettings=e.dataSourceSettings,t.pivotFieldList=e.pivotFieldList,"olap"===t.dataType?t.olapEngineModule.pivotValues=e.pivotValues:t.engineModule.pivotValues=e.pivotValues})},T.prototype.actionBeginMethod=function(){var e={dataSourceSettings:Ce.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,cancel:!1};return(this.isPopupView?this.pivotGridModule:this).trigger(yt,e),e.cancel},T.prototype.actionCompleteMethod=function(){var e={dataSourceSettings:Ce.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,actionInfo:this.actionObj.actionInfo};(this.isPopupView?this.pivotGridModule:this).trigger(bt,e),this.actionObj.actionName="",this.actionObj.actionInfo=void 0,this.actionObj.fieldInfo=void 0},T.prototype.actionFailureMethod=function(e){e={actionName:this.actionObj.actionName,errorInfo:e};(this.isPopupView?this.pivotGridModule:this).trigger(Ct,e)},T.prototype.getActionCompleteName=function(){return this.actionObj.actionName===Ci?Ei:this.actionObj.actionName===fi?sa:this.actionObj.actionName===vi?oa:this.actionObj.actionName===yi?la:this.actionObj.actionName===bi?da:this.actionObj.actionName===Di?pa:this.actionObj.actionName===Si?Ri:this.actionObj.actionName},T.prototype.destroy=function(){this.unWireEvent(),this.engineModule&&!this.destroyEngine&&(this.engineModule.fieldList={},this.engineModule.rMembers=null,this.engineModule.cMembers=null,this.engineModule.valueMatrix=[],this.engineModule={}),this.olapEngineModule&&!this.destroyEngine&&(this.olapEngineModule.fieldList={},this.olapEngineModule={}),this.pivotFieldList&&(this.pivotFieldList={}),this.contextMenuModule&&this.contextMenuModule.destroy(),this.treeViewModule&&this.treeViewModule.destroy(),this.pivotButtonModule&&this.pivotButtonModule.destroy(),this.pivotCommon&&this.pivotCommon.destroy(),this.dialogRenderer&&this.dialogRenderer.destroy(),this.calculatedFieldModule&&this.calculatedFieldModule.destroy(),$p.prototype.destroy.call(this),this.contextMenuModule&&(this.contextMenuModule=null),this.treeViewModule&&(this.treeViewModule=null),this.pivotButtonModule&&(this.pivotButtonModule=null),this.pivotCommon&&(this.pivotCommon=null),this.dialogRenderer&&(this.dialogRenderer=null),this.calculatedFieldModule&&(this.calculatedFieldModule=null),this.axisFieldModule&&(this.axisFieldModule=null),this.axisTableModule&&(this.axisTableModule=null),this.renderModule&&(this.renderModule=null),this.clonedDataSet&&(this.clonedDataSet=null),this.clonedReport&&(this.clonedReport=null),this.clonedFieldList&&(this.clonedFieldList=null),this.clonedFieldListData&&(this.clonedFieldListData=null),this.localeObj&&(this.localeObj=null),this.defaultLocale&&(this.defaultLocale=null),this.element.innerHTML="",Ue.removeClass([this.element],Ca),Ue.removeClass([this.element],xa),Ue.removeClass([this.element],wa)},h([Ue.Complex({},to)],T.prototype,"dataSourceSettings",void 0),h([Ue.Property("Popup")],T.prototype,"renderMode",void 0),h([Ue.Property()],T.prototype,"target",void 0),h([Ue.Property("")],T.prototype,"cssClass",void 0),h([Ue.Property(!1)],T.prototype,"enableHtmlSanitizer",void 0),h([Ue.Property(!1)],T.prototype,"allowCalculatedField",void 0),h([Ue.Property(!1)],T.prototype,"enableFieldSearching",void 0),h([Ue.Property(!1)],T.prototype,"showValuesButton",void 0),h([Ue.Property(!1)],T.prototype,"allowDeferLayoutUpdate",void 0),h([Ue.Property(1e3)],T.prototype,"maxNodeLimitInMemberEditor",void 0),h([Ue.Property(!0)],T.prototype,"loadOnDemandInMemberEditor",void 0),h([Ue.Property()],T.prototype,"spinnerTemplate",void 0),h([Ue.Property(["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"])],T.prototype,"aggregateTypes",void 0),h([Ue.Property("USD")],T.prototype,"currencyCode",void 0),h([Ue.Event()],T.prototype,"load",void 0),h([Ue.Event()],T.prototype,"enginePopulating",void 0),h([Ue.Event()],T.prototype,"memberFiltering",void 0),h([Ue.Event()],T.prototype,"enginePopulated",void 0),h([Ue.Event()],T.prototype,"onFieldDropped",void 0),h([Ue.Event()],T.prototype,"fieldDrop",void 0),h([Ue.Event()],T.prototype,"fieldDragStart",void 0),h([Ue.Event()],T.prototype,"aggregateCellInfo",void 0),h([Ue.Event()],T.prototype,"memberEditorOpen",void 0),h([Ue.Event()],T.prototype,"calculatedFieldCreate",void 0),h([Ue.Event()],T.prototype,"aggregateMenuOpen",void 0),h([Ue.Event()],T.prototype,"fieldRemove",void 0),h([Ue.Event()],T.prototype,"dataBound",void 0),h([Ue.Event()],T.prototype,"created",void 0),h([Ue.Event()],T.prototype,"destroyed",void 0),h([Ue.Event()],T.prototype,"beforeServiceInvoke",void 0),h([Ue.Event()],T.prototype,"afterServiceInvoke",void 0),h([Ue.Event()],T.prototype,"actionBegin",void 0),h([Ue.Event()],T.prototype,"actionComplete",void 0),h([Ue.Event()],T.prototype,"actionFailure",void 0),h([Ue.Event()],T.prototype,"onHeadersSort",void 0),h([Ue.NotifyPropertyChanges],T));function T(e,t){e=$p.call(this,e,t)||this;return e.pivotChange=!1,e.isRequiredUpdate=!0,e.lastSortInfo={},e.lastFilterInfo={},e.lastAggregationInfo={},e.lastCalcFieldInfo={},e.isPopupView=!1,e.enableValueSorting=!1,e.request="undefined"!=typeof window?new XMLHttpRequest:null,e.remoteData=[],e.actionObj={},e.destroyEngine=!1,e.defaultFieldListOrder="None",e.isDeferUpdateApplied=!1,e.isInitial=!0,e}var th="Count",ih="Sum",ah="DistinctCount",rh="Product",nh="SampleStDev",sh="PopulationStDev",oh="SampleVar",lh="PopulationVar",dh="CalculatedField",jl=(M.prototype.getModuleName=function(){return"calculatedField"},M.prototype.keyActionHandler=function(e){var t=e.currentTarget.querySelector(".e-node-focus");if(t)switch(e.action){case"moveRight":case"shiftE":"pivot"===this.parent.dataType&&this.displayMenu(t);break;case"delete":"LI"===t.tagName&&!t.querySelector(".e-list-icon.e-format")&&!t.querySelector(".e-list-icon").classList.contains(".e-icons")&&t.querySelector("."+ns)&&t.querySelector("."+ns).classList.contains("e-list-icon")&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,t);break;case"enter":var i=t.getAttribute("data-field"),a=Ue.getInstance(Ue.select("#"+this.parentID+"calculateddialog",document),P.Dialog),r=t.getAttribute("data-type"),a=Ue.select("#"+this.parentID+"droppable",a.element);"pivot"===this.parent.dataType?""===a.value?a.value=r===dh?t.getAttribute("data-uid"):'"'+r+"("+i+')"':""!==a.value&&(a.value=r===dh?a.value+t.getAttribute("data-uid"):a.value+'"'+r+"("+i+')"'):(this.parent.olapEngineModule&&this.parent.olapEngineModule.fieldList[i]&&this.parent.olapEngineModule.fieldList[i].isCalculatedField&&(i=this.parent.olapEngineModule.fieldList[i].tag),""===a.value?a.value=i:""!==a.value&&(a.value=a.value+i))}},M.prototype.fieldClickHandler=function(e){var t=Ue.closest(e.event.target,"li");(e.event.target.classList.contains(fn)||e.event.target.classList.contains(Fn)||e.event.target.classList.contains(In)||e.event.target.classList.contains(ns))&&(this.parent.isAdaptive?"olap"===this.parent.dataType&&this.parent.isAdaptive&&("LI"===t.tagName&&t.querySelector(".e-list-edit-icon").classList.contains(Fn)&&e.event.target.classList.contains(Fn)?(this.isEdit=!0,this.currentFieldName=t.getAttribute("data-field"),this.fieldText=t.getAttribute("data-caption"),this.formulaText=t.getAttribute("data-formula"),this.formatType=t.getAttribute("data-formatString"),this.formatText="Custom"===this.formatType?t.getAttribute("data-customformatstring"):null,this.fieldType=t.getAttribute("data-membertype"),this.parentHierarchy="Dimension"===this.fieldType?t.getAttribute("data-hierarchy"):null,Ue.addClass([t.querySelector(".e-list-edit-icon")],In),Ue.removeClass([t.querySelector(".e-list-edit-icon")],Fn),this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)):"LI"===t.tagName&&t.querySelector(".e-list-edit-icon").classList.contains(In)&&e.event.target.classList.contains(In)?(this.isEdit=!1,this.fieldText=this.formatText=this.formulaText=this.currentFieldName=null,this.parentHierarchy=this.fieldType=this.formatType=null,Ue.addClass([t.querySelector(".e-list-edit-icon")],Fn),Ue.removeClass([t.querySelector(".e-list-edit-icon")],In)):"LI"===t.tagName&&t.querySelector("."+ns).classList.contains("e-icons")&&e.event.target.classList.contains(ns)&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,e.node)):this.displayMenu(t,e.node,e.event.target))},M.prototype.accordionClickHandler=function(e){var t,i,a,r,n,s;e.item&&-1!==e.item.iconCss.indexOf("e-list-icon")&&Ue.closest(e.originalEvent.target,".e-acrdn-header-icon")&&(i=(t=Ue.closest(e.originalEvent.target,".e-acrdn-header").querySelector("."+pn)).getAttribute("data-field"),a=t.getAttribute("data-caption"),r=Ce.getFieldByName(i,this.parent.dataSourceSettings.formatSettings),n=Ue.closest(e.originalEvent.target,".e-acrdn-header-icon"),r&&(s=(s=this.getFormat(r.format))?-1<this.formatTypes.indexOf(s)?r.format:"Custom":"None",this.formatType=s),n.querySelector("."+Fn)&&e.originalEvent.target.classList.contains(Fn)?(this.isEdit=!0,this.currentFieldName=i,this.fieldText=a||i,this.formulaText=this.parent.engineModule.fieldList[i].formula,this.formatText=r?r.format:"",Ue.addClass([n.querySelector(".e-list-icon")],In),Ue.removeClass([n.querySelector(".e-list-icon")],Fn),this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)):n.querySelector("."+In)&&e.originalEvent.target.classList.contains(In)?(this.isEdit=!1,this.fieldText=this.formatText=this.formulaText=this.currentFieldName=null,Ue.addClass([n.querySelector(".e-list-icon")],Fn),Ue.removeClass([n.querySelector(".e-list-icon")],In)):n.querySelector("."+ns)&&e.originalEvent.target.classList.contains(ns)&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,t))},M.prototype.accordionCreated=function(){for(var e,t=Ue.getInstance(Ue.select("#"+this.parentID+"accordDiv",document),O.Accordion).element.querySelectorAll(".e-acrdn-item"),i=0;i<t.length;i++)(t[i].querySelector("."+Fn)||t[i].querySelector("."+In))&&(e=Ue.createElement("span",{className:"e-list-icon "+ns+" e-icons"}),Ue.append([e],t[i].querySelector(".e-acrdn-header-icon")),Ue.addClass([t[i]],"e-select"))},M.prototype.clearFormula=function(){this.treeObj&&this.treeObj.element.querySelector("li")&&(Ue.removeClass(this.treeObj.element.querySelectorAll("li"),"e-active"),this.displayMenu(this.treeObj.element.querySelector("li")))},M.prototype.displayMenu=function(e,t,i){var a,r,n,s,o,l,d,p,h,u,c,g,m,S,f,v,y=!i||i.classList.contains(Fn),b=!i||i.classList.contains(In),C=Ue.getInstance(Ue.select("#"+this.parentID+"calculateddialog",document),P.Dialog),x=Ue.getInstance(Ue.select("#"+this.parentID+"ddlelement",document),V.MaskedTextBox);try{"pivot"!==this.parent.dataType||!e.querySelector(".e-list-icon.e-format")||!e.querySelector(".e-list-icon.e-format").classList.contains(z)||e.querySelector(".e-list-icon").classList.contains(In)||e.querySelector(".e-list-icon").classList.contains(ns)||e.querySelector(".e-list-icon").classList.contains(Fn)||"LI"!==e.tagName?"LI"===e.tagName&&(e.querySelector("."+Fn)&&e.querySelector("."+Fn).classList.contains("e-list-icon")&&y||"olap"===this.parent.dataType&&e.getAttribute("data-type")===dh&&e.classList.contains("e-active")&&(i&&!i.classList.contains(ns)||!i))?(this.isEdit=!0,a=e.getAttribute("data-field"),r=e.getAttribute("data-caption"),this.currentFieldName=a,x.value=r,x.dataBind(),n=e.getAttribute("data-formatString"),p=C.element,c=Ue.getInstance(Ue.select("#"+this.parentID+"Format_Div",p),G.DropDownList),h=Ue.getInstance(Ue.select("#"+this.parentID+"Custom_Format_Element",p),V.MaskedTextBox),s=e.getAttribute("data-customformatstring"),"olap"===this.parent.dataType?(o=e.getAttribute("data-membertype"),l=e.getAttribute("data-hierarchy"),d=e.getAttribute("data-formula"),m=Ue.select("#"+this.parentID+"_FieldNameTitle",p),g=Ue.getInstance(Ue.select("#"+this.parentID+"Member_Type_Div",p),G.DropDownList),u=Ue.getInstance(Ue.select("#"+this.parentID+"Hierarchy_List_Div",p),G.DropDownList),m.innerText=this.parent.localeObj.getConstant("caption"),Ue.select("#"+this.parentID+"droppable",document).value=d,g.readonly=!0,g.value=o,g.dataBind(),"Dimension"===o&&(u.value=l)):(Ue.addClass(this.treeObj.element.querySelectorAll("."+In),Fn),Ue.removeClass(this.treeObj.element.querySelectorAll("."+In),In),Ue.addClass([e.querySelector(".e-list-icon")],In),Ue.removeClass([e.querySelector(".e-list-icon")],Fn),e.querySelector("."+In).setAttribute("title",this.parent.localeObj.getConstant("clearCalculatedField")),Ue.select("#"+this.parentID+"droppable",document).value=e.getAttribute("data-uid")),""!==n&&(c.value=n,c.dataBind()),h.value=s,h.dataBind()):"LI"===e.tagName&&(e.querySelector("."+In)&&e.querySelector("."+In).classList.contains("e-list-icon")&&b||"olap"===this.parent.dataType&&!e.classList.contains("e-active"))?(this.isEdit=!1,x.value="",x.dataBind(),p=C.element,(h=Ue.getInstance(Ue.select("#"+this.parentID+"Custom_Format_Element",p),V.MaskedTextBox)).value="",h.dataBind(),"olap"===this.parent.dataType?(u=Ue.getInstance(Ue.select("#"+this.parentID+"Hierarchy_List_Div",p),G.DropDownList),c=Ue.getInstance(Ue.select("#"+this.parentID+"Format_Div",p),G.DropDownList),g=Ue.getInstance(Ue.select("#"+this.parentID+"Member_Type_Div",p),G.DropDownList),(m=Ue.select("#"+this.parentID+"_FieldNameTitle",p)).innerText=this.parent.localeObj.getConstant("fieldTitle"),u.index=0,u.dataBind(),c.index=0,c.dataBind(),g.index=0,g.readonly=!1,g.dataBind()):(Ue.addClass(this.treeObj.element.querySelectorAll("."+In),Fn),Ue.removeClass(this.treeObj.element.querySelectorAll("."+In),In),e.querySelector("."+Fn).setAttribute("title",this.parent.localeObj.getConstant("edit"))),Ue.select("#"+this.parentID+"droppable",document).value=""):"LI"===e.tagName&&e.querySelector("."+ns)&&e.querySelector("."+ns).classList.contains("e-list-icon")&&!y&&!b&&(this.parent.actionObj.actionName=bi,this.parent.actionBeginMethod()||(S=Ue.select("#"+this.parentID+"droppable",document),f={name:this.isEdit?this.currentFieldName:x.value,caption:x.value,formula:S.value},this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),f,!0,t))):((v=Ue.select("#"+this.parentID+"CalcContextmenu",document)?Ue.getInstance(Ue.select("#"+this.parentID+"CalcContextmenu",document),O.ContextMenu):null)&&!v.isDestroyed&&v.destroy(),this.curMenu=e.querySelector("."+qr),this.openContextMenu(e))}catch(e){this.parent.actionFailureMethod(e)}},M.prototype.removeCalcField=function(e){var t=this.parent.dataSourceSettings,i=e.getAttribute("data-field"),a=t.calculatedFieldSettings;"pivot"===this.parent.dataType&&(this.parent.isAdaptive?"number"==typeof(d=parseInt(e.getAttribute("id").split(this.parentID+"_")[1],10))&&Ue.getInstance(Ue.select("#"+this.parentID+"accordDiv",document),O.Accordion).hideItem(d):this.treeObj.removeNodes([e]));for(var r=0;r<a.length;r++)if(a[r]&&a[r].name===i){a.splice(r,1);break}if("olap"===this.parent.dataType){for(var n,s=(n=this.parent.olapEngineModule).fieldListData||[],o=0,l=Object.keys(s);o<l.length;o++){var d,p=l[o];if(s[parseInt(p,10)].name===i)if("number"==typeof(d=parseInt(p,10))){s.splice(d,1);break}}var h=this.treeObj.getNode(e).parentID;this.treeObj.removeNodes([e]),a.length<=0&&this.treeObj.removeNodes([h])}else n=this.parent.engineModule;if(n.fields)for(r=0;r<n.fields.length;r++)if(n.fields[r]===i){n.fields.splice(r,1);break}n.savedFieldList&&n.savedFieldList[i]&&delete n.savedFieldList[i],n.fieldList&&n.fieldList[i]&&delete n.fieldList[i];for(var u=t.formatSettings,r=0;r<u.length;r++)if(u[r]&&u[r].name===i){u.splice(r,1);break}for(var c=[t.values,t.rows,t.columns,t.filters],r=0,g=c.length;r<g;r++)for(var m=0,S=c[r].length;m<S;m++)if(c[r][m].name===i){c[r].splice(m,1);break}this.isEdit&&this.currentFieldName===i&&(e=Ue.getInstance(Ue.select("#"+this.parentID+"ddlelement",document),V.MaskedTextBox),this.isEdit=!1,e.value="",this.currentFieldName=this.formatText=this.fieldText=this.formatType=null,this.formulaText=this.fieldType=this.parentHierarchy=null),(!Ue.isNullOrUndefined(this.parent.isDeferLayoutUpdate)&&!this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotfieldlist"!==this.parent.getModuleName())&&this.parent.updateDataSource(),this.closeErrorDialog()},M.prototype.openContextMenu=function(l){var d=this,e=l.getAttribute("data-field"),t="number"!==this.parent.engineModule.fieldList[e].type?"string":"number",p="string"==t?this.getValidSummaryType().slice(0,2):this.getValidSummaryType(),e={cancel:!1,fieldName:e,aggregateTypes:this.getMenuItems(t).slice()};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(gt,e,function(e){if(!e.cancel){for(var t=[],i=[],a=0,r=e.aggregateTypes;a<r.length;a++){var n=r[a];-1<p.indexOf(n)&&-1===t.indexOf(n)&&(t.push(n),i.push({id:d.parent.element.id+"Calc_"+n,text:d.parent.localeObj.getConstant(n)}))}d.createMenu(i,l);var e=l.getBoundingClientRect(),s=window.scrollY||document.documentElement.scrollTop,o=Ue.getInstance(Ue.select("#"+d.parentID+"CalcContextmenu",document),O.ContextMenu);d.parent.enableRtl?o.open(e.top+s,e.left-100):o.open(e.top+s,e.left+150)}})},M.prototype.selectContextMenu=function(e){var t;null!==e.element.textContent&&(t=Ue.closest(this.curMenu,".e-list-item").getAttribute("data-caption"),Ue.closest(this.curMenu,".e-list-item").setAttribute("data-type",e.element.id.split("_").pop()),this.curMenu.textContent=t+" ("+e.element.textContent+")",Ue.addClass([this.curMenu.parentElement.parentElement],["e-node-focus","e-hover"]),this.curMenu.parentElement.parentElement.setAttribute("tabindex","0"),this.curMenu.parentElement.parentElement.focus())},M.prototype.createMenu=function(e,t){var i=this,e={cssClass:this.parentID+"calculatedmenu"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:e,enableRtl:this.parent.enableRtl,locale:this.parent.locale,select:this.selectContextMenu.bind(this),onClose:function(){i.treeObj.element.focus(),Ue.addClass([t],["e-hover","e-node-focus"])}},a=Ue.select("#"+this.parentID+"CalcContextmenu",document)?Ue.select("#"+this.parentID+"CalcContextmenu",document):Ue.createElement("ul",{id:this.parentID+"CalcContextmenu"}),e=(Ue.getInstance(Ue.select("#"+this.parentID+"calculateddialog",document),P.Dialog).element.appendChild(a),new O.ContextMenu(e));e.isStringTemplate=!0,e.appendTo(a)},M.prototype.applyFormula=function(){var S=this,f=this,v=!1,e=(Ue.removeClass([document.getElementById(this.parentID+"ddlelement")],Ln),Ue.getInstance(Ue.select("#"+this.parentID+"ddlelement",document),V.MaskedTextBox)),e=(this.newFields=Ue.extend([],this.parent.dataSourceSettings.calculatedFieldSettings,null,!0),{fieldName:this.isEdit?this.currentFieldName:e.value,calculatedField:this.getCalculatedFieldInfo(),calculatedFieldSettings:Ce.cloneCalculatedFieldSettings(this.parent.dataSourceSettings.calculatedFieldSettings),cancel:!1});("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(pt,e,function(e){if(e.cancel)S.endDialog(),S.parent.lastCalcFieldInfo={},S.isFormula=!1;else{var t=e.calculatedField;if(!S.isEdit)if("olap"===f.parent.dataType){var i=t.name;f.parent.olapEngineModule.fieldList[i]&&"CalculatedField"!==f.parent.olapEngineModule.fieldList[i].type&&(v=!0)}else for(var a=0,r=Object.keys(f.parent.engineModule.fieldList);a<r.length;a++){var n=r[a];t.name&&t.name===n&&"CalculatedField"!==f.parent.engineModule.fieldList[n].aggregateType&&(v=!0)}if(v)f.parent.pivotCommon.errorDialog.createErrorDialog(f.parent.localeObj.getConstant("error"),f.parent.localeObj.getConstant("fieldExist"));else{S.existingReport=Ue.extend({},S.parent.dataSourceSettings,null,!0);var s=S.parent.dataSourceSettings;if(Ue.isNullOrUndefined(t.name)||""===t.name||Ue.isNullOrUndefined(t.caption)||""===t.caption||!t.formula||""===t.formula)Ue.isNullOrUndefined(t.name)||""===t.name||Ue.isNullOrUndefined(t.caption)||""===t.caption?(Ue.getInstance(Ue.select("#"+S.parentID+"ddlelement",document),V.MaskedTextBox).value="",Ue.addClass([document.getElementById(S.parentID+"ddlelement")],Ln),document.getElementById(S.parentID+"ddlelement").focus()):S.parent.pivotCommon.errorDialog.createErrorDialog(S.parent.localeObj.getConstant("error"),S.parent.localeObj.getConstant("invalidFormula"));else{i=void 0;if("olap"===S.parent.dataType){if(i={name:t.name,formula:t.formula,formatString:t.formatString},Ue.isNullOrUndefined(t.hierarchyUniqueName)||(i.hierarchyUniqueName=t.hierarchyUniqueName),S.isFieldExist=!1,S.isEdit){for(c=0;c<s.calculatedFieldSettings.length;c++)if(s.calculatedFieldSettings[c].name===i.name&&S.isEdit){s.calculatedFieldSettings[c].hierarchyUniqueName=t.hierarchyUniqueName,S.parent.olapEngineModule.fieldList[i.name].caption=t.caption,s.calculatedFieldSettings[c].formatString=i.formatString,s.calculatedFieldSettings[c].formula=i.formula,i=s.calculatedFieldSettings[c],S.updateFormatSettings(s,i.name,t.formatString),S.parent.olapEngineModule.getFormattedFields(s.formatSettings),S.parent.olapEngineModule.formatFields[i.name]&&(S.parent.olapEngineModule.formatFields[i.name].format?S.parent.olapEngineModule.formatFields[i.name].format=S.getFormat(i.formatString):delete S.parent.olapEngineModule.formatFields[i.name]),S.isFieldExist=!0;break}for(var o=!1,l=0,d=[s.rows,s.columns,s.values,s.filters];l<d.length;l++){for(var p=0,h=d[l];p<h.length;p++){var u=h[p];if(u.isCalculatedField&&null!==i.name&&u.name===i.name&&S.isEdit){u.caption=t.caption,o=S.isFieldExist=!0;break}}if(o)break}}else for(var c=0;c<s.calculatedFieldSettings.length;c++)if(s.calculatedFieldSettings[c].name===i.name)return void S.createConfirmDialog(f.parent.localeObj.getConstant("alert"),f.parent.localeObj.getConstant("confirmText"),t);S.isFieldExist||(s.calculatedFieldSettings.push(i),S.updateFormatSettings(s,i.name,t.formatString),S.parent.olapEngineModule.getFormattedFields(s.formatSettings),S.parent.olapEngineModule.formatFields[i.name]&&(S.parent.olapEngineModule.formatFields[i.name].format?S.parent.olapEngineModule.formatFields[i.name].format=S.getFormat(i.formatString):delete S.parent.olapEngineModule.formatFields[i.name])),S.parent.lastCalcFieldInfo=i}else{i={name:t.name,caption:t.caption,type:"CalculatedField"};var g={name:t.name,formula:t.formula};if(Ue.isNullOrUndefined(t.formatString)||(g.formatString=t.formatString),S.isFieldExist=!0,S.isEdit){for(c=0;c<s.values.length;c++)if(s.values[c].type===dh&&null!==i.name&&s.values[c].name===i.name&&S.isEdit)for(m=0;m<s.calculatedFieldSettings.length;m++)s.calculatedFieldSettings[m].name===i.name&&(s.values.splice(c,1),s.values.splice(c,0,i),S.currentFormula=s.calculatedFieldSettings[m].formula,s.calculatedFieldSettings.splice(m,1),s.calculatedFieldSettings.splice(m,0,g),S.updateFormatSettings(s,i.name,t.formatString),S.isFieldExist=!1)}else for(var c=0;c<s.values.length;c++)if(s.values[c].type===dh&&s.values[c].name===i.name){for(var m=0;m<s.calculatedFieldSettings.length;m++)if(s.calculatedFieldSettings[m].name===i.name)return void S.createConfirmDialog(f.parent.localeObj.getConstant("alert"),f.parent.localeObj.getConstant("confirmText"),t);S.isFieldExist=!1}S.isFieldExist&&(s.values.push(i),s.calculatedFieldSettings.push(g),S.updateFormatSettings(s,i.name,t.formatString)),S.parent.lastCalcFieldInfo=g}S.addFormula(s,i.name)}}}})},M.prototype.getCalculatedFieldInfo=function(){var e=Ue.select("#"+this.parentID+"calculateddialog",document),e=e?Ue.getInstance(e,P.Dialog):void 0,t=Ue.getInstance(Ue.select("#"+this.parentID+"ddlelement",document),V.MaskedTextBox),i=Ue.select("#"+this.parentID+"droppable",document),e=(this.parent.isAdaptive?this.parent.dialogRenderer.adaptiveElement:e).element,a=Ue.getInstance(Ue.select("#"+this.parentID+"Custom_Format_Element",e),V.MaskedTextBox),t={name:this.isEdit?this.currentFieldName:t.value,caption:t.value,formula:i.value},i=Ue.getInstance(Ue.select("#"+this.parentID+"Format_Div",e),G.DropDownList);return t.formatString="Custom"===i.value?a.value:"None"===i.value?null:i.value,"olap"===this.parent.dataType&&(a=Ue.getInstance(Ue.select("#"+this.parentID+"Member_Type_Div",e),G.DropDownList),i=Ue.getInstance(Ue.select("#"+this.parentID+"Hierarchy_List_Div",e),G.DropDownList),"Dimension"===a.value)&&(t.hierarchyUniqueName=i.value),t},M.prototype.updateFormatSettings=function(e,t,i){for(var a={name:t,format:i,useGrouping:!0},r=!1,n=0;n<e.formatSettings.length;n++)if(e.formatSettings[n].name===t){if("undefined"===i||void 0===i||""===i){e.formatSettings.splice(n,1),r=!0;break}var s=e.formatSettings[n].properties||e.formatSettings[n];s.format=i,e.formatSettings.splice(n,1,s),r=!0;break}r||""===i||Ue.isNullOrUndefined(i)||e.formatSettings.push(a)},M.prototype.addFormula=function(e,t){this.isFormula=!0,this.field=t,this.parent.setProperties({dataSourceSettings:e},!0),"pivotfieldlist"===this.parent.getModuleName()&&(this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&this.parent.pivotGridModule.pivotDeferLayoutUpdate)&&(this.parent.isRequiredUpdate=!1);try{var i={calculatedFieldInfo:this.parent.lastCalcFieldInfo},a=(this.parent.actionObj.actionInfo=i,this.parent.actionObj.actionName===fi?sa:Ei),r=(this.parent.actionObj.actionName=a,this.parent.updateDataSource(!1),"pivotfieldlist"===this.parent.getModuleName()&&this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent);r&&"Server"!==r.dataSourceSettings.mode?this.endDialog():this.isRequireUpdate=!0,"pivotfieldlist"===this.parent.getModuleName()&&"Fixed"===this.parent.renderMode&&this.parent.isDeferLayoutUpdate&&(this.parent.pivotChange=!0)}catch(e){this.showError()}},M.prototype.endDialog=function(){this.isEdit=!1;var e,t,i=Ue.select("#"+this.parentID+"calculateddialog",document),i=i?Ue.getInstance(i,P.Dialog):void 0;i?i.close():(Ue.getInstance(Ue.select("#"+this.parentID+"ddlelement",document),V.MaskedTextBox).value="",this.currentFieldName=this.formatText=this.fieldText=this.formatType=null,this.formulaText=this.fieldType=this.parentHierarchy=null,i=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:i.element,this.parent.dialogRenderer.parentElement.querySelector("."+hn).value="",Ue.select("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement).value="",Ue.select("#"+this.parentID+"Custom_Format_Element",this.parent.dialogRenderer.parentElement).value="","olap"===this.parent.dataType&&(e=Ue.getInstance(Ue.select("#"+this.parentID+"Member_Type_Div",i),G.DropDownList),t=Ue.getInstance(Ue.select("#"+this.parentID+"Hierarchy_List_Div",i),G.DropDownList),e.index=0,e.readonly=!1,e.dataBind(),t.index=0,t.enabled=!1,t.dataBind()),e=Ue.getInstance(Ue.select("#"+this.parentID+"Custom_Format_Element",i),V.MaskedTextBox),(t=Ue.getInstance(Ue.select("#"+this.parentID+"Format_Div",i),G.DropDownList)).index="olap"===this.parent.dataType?0:4,t.dataBind(),e.enabled=!1,e.dataBind())},M.prototype.showError=function(){if(this.parent.engineModule.fieldList[this.field]&&delete this.parent.engineModule.fieldList[this.field],this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("invalidFormula")),this.parent.setProperties({dataSourceSettings:this.existingReport},!0),this.isEdit){for(var e=this.parent.dataSourceSettings.calculatedFieldSettings,t=0;e&&t<e.length;t++)if(e[t].name===this.field){e[t].formula=this.currentFormula;break}}else if(this.parent.engineModule.fields)for(t=0;t<this.parent.engineModule.fields.length;t++)if(this.parent.engineModule.fields[t]===this.field){this.parent.engineModule.fields.splice(t,1);break}this.parent.lastCalcFieldInfo={},this.parent.updateDataSource(!1),this.isFormula=!1},M.prototype.getFieldListData=function(e){var t=[];if("olap"===this.parent.dataType)for(var i=0,a=t=Ce.getClonedData(e.olapEngineModule.fieldListData||[]);i<a.length;i++){var r=a[i];r.spriteCssClass&&(-1<r.spriteCssClass.indexOf("e-attributeCDB-icon")||-1<r.spriteCssClass.indexOf("e-level-members"))?r.hasChildren=!0:r.spriteCssClass&&-1<r.spriteCssClass.indexOf("e-namedSetCDB-icon")?r.hasChildren=!1:r.spriteCssClass&&-1<r.spriteCssClass.indexOf("e-calcMemberGroupCDB")&&(r.expanded=this.isEdit)}else for(var n=0,s=e.engineModule.fieldList?Object.keys(e.engineModule.fieldList):[];n<s.length;n++){var o=s[n],l=null,d=e.engineModule.fieldList[o],l="number"===d.type&&"include"!==e.engineModule.fieldList[o].type&&"exclude"!==e.engineModule.fieldList[o].type||"DistinctCount"===d.aggregateType?void 0!==d.aggregateType?d.aggregateType:ih:th,p=this.parent.localeObj.getConstant(l);t.push({index:d.index,name:(this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(d.caption):d.caption)+" ("+p+")",type:l,icon:fn+" "+z,formula:this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(d.formula):d.formula,field:this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(o):o,caption:this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(d.caption||o):d.caption||o})}return t},M.prototype.fieldDropped=function(e){e.cancel=!0;var t,i,a,r,n,s,o=Ue.getInstance(Ue.select("#"+this.parentID+"calculateddialog",document),P.Dialog),o=Ue.select("#"+this.parentID+"droppable",o.element),l=(Ue.removeClass([o],"e-copy-drop"),Ue.removeClass([e.draggedNode.querySelector("."+qr)],Er),e.draggedNode.getAttribute("data-field"));"olap"===this.parent.dataType?(this.parent.olapEngineModule.fieldList[l]&&this.parent.olapEngineModule.fieldList[l].isCalculatedField&&(l=this.parent.olapEngineModule.fieldList[l].tag),e.target.id===this.parentID+"droppable"&&""===o.value?(o.value=l,o.focus()):e.target.id===this.parentID+"droppable"&&""!==o.value?(r=o.value,a=o.selectionStart,s=r.substring(a,r.length),i=(n=r.substring(0,a))+l,o.value=n+l+s,o.focus(),o.setSelectionRange(i.length,i.length)):e.cancel=!0):(t=e.draggedNode.getAttribute("data-type"),e.target.id===this.parentID+"droppable"&&""===o.value?(o.value=t===dh?e.draggedNodeData.id.toString():'"'+t+"("+l+')"',o.focus()):e.target.id===this.parentID+"droppable"&&""!==o.value?(i=void 0,a=o.selectionStart,n=(r=o.value).substring(0,a),s=r.substring(a,r.length),t===dh?(i=n+e.draggedNodeData.id.toString(),o.value=n+e.draggedNodeData.id.toString()+s):o.value=(i=n+'"'+t+"("+l+')"')+s,o.focus(),o.setSelectionRange(i.length,i.length)):e.cancel=!0)},M.prototype.createDialog=function(){var e=this;if(null!==Ue.select("#"+this.parentID+"calculateddialog",document))for(Ue.remove(Ue.select("#"+this.parentID+"calculateddialog",document));!Ue.isNullOrUndefined(document.querySelector("."+this.parentID+"calculatedmenu"));)Ue.remove(document.querySelector("."+this.parentID+"calculatedmenu"));var t,i=Ue.createElement("div",{id:this.parentID+"calculateddialog",className:"e-pivot-calc-dialog-div "+("olap"===this.parent.dataType?"e-olap-calc-dialog-div":"")}),a=(this.parent.element.appendChild(i),[{click:this.applyFormula.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("ok"),isPrimary:!0,cssClass:this.parent.cssClass}},{click:this.cancelClick.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("cancel"),cssClass:this.parent.cssClass}}]),r=("olap"===this.parent.dataType&&(t={click:this.clearFormula.bind(this),isFlat:!1,buttonModel:{cssClass:"e-calc-clear-btn"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("clear")}},a.splice(0,0,t)),new P.Dialog({allowDragging:!0,position:{X:"center",Y:"center"},buttons:a,close:this.closeDialog.bind(this),beforeOpen:this.beforeOpen.bind(this),open:function(){Ue.select("#"+e.parentID+"ddlelement",r.element)&&Ue.select("#"+e.parentID+"ddlelement",r.element).focus()},animationSettings:{effect:"Zoom"},width:"25%",isModal:!0,closeOnEscape:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,showCloseIcon:!0,header:this.parent.localeObj.getConstant("createCalculatedField"),target:document.body,cssClass:this.parent.cssClass}));r.isStringTemplate=!0,r.appendTo(i)},M.prototype.cancelClick=function(){Ue.getInstance(Ue.select("#"+this.parentID+"calculateddialog",document),P.Dialog).close(),this.isEdit=!1},M.prototype.beforeOpen=function(){Ue.getInstance(Ue.select("#"+this.parentID+"calculateddialog",document),P.Dialog).element.querySelector(".e-dlg-header").setAttribute("title",this.parent.localeObj.getConstant("createCalculatedField"))},M.prototype.closeDialog=function(){"pivotfieldlist"===this.parent.getModuleName()&&(this.parent.axisFieldModule.render(),"Fixed"!==this.parent.renderMode)&&(Ue.addClass([this.parent.element.querySelector("."+Fa)],Ta),this.parent.dialogRenderer.fieldListDialog.show()),this.destroy(),Ue.isNullOrUndefined(document.getElementById(this.parentID+"calculateddialog"))||Ue.remove(document.getElementById(this.parentID+"calculateddialog")),Ue.isNullOrUndefined(document.querySelector("."+this.parentID+"calculatedmenu"))||Ue.remove(document.querySelector("."+this.parentID+"calculatedmenu"));var e="pivotview"===this.parent.getModuleName()||"pivotfieldlist"===this.parent.getModuleName()&&"Fixed"===this.parent.renderMode?0:500;this.buttonCall&&(this.buttonCall=!1,setTimeout(this.setFocus.bind(this),e))},M.prototype.setFocus=function(){var e;if("pivotview"===this.parent.getModuleName()&&this.parent.element?e=this.parent.element:document.getElementById(this.parent.element.id+"_Container")&&(e=document.getElementById(this.parent.element.id+"_Container")),e)for(var t=0,i=[].slice.call(e.querySelectorAll(".e-pivot-button"));t<i.length;t++){var a=i[t];if(a.getAttribute("data-uid")===this.currentFieldName){a.focus();break}}},M.prototype.renderDialogElements=function(){var e,t,i,a,r,n,s,o=Ue.createElement("div",{id:this.parentID+"outerDiv",className:("olap"===this.parent.dataType?"e-olap-calc-outer-div ":"")+"e-pivot-calc-outer-div"}),l=Ue.createElement("div",{id:this.parentID+"Olap_Tree_Div",className:"e-olap-field-tree-div"}),d=Ue.createElement("div",{id:this.parentID+"Pivot_Calc_Div",className:"e-pivot-calculated-div"});return"pivotfieldlist"===this.parent.getModuleName()&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+vn)&&this.parent.isAdaptive?(a=Ue.createElement("div",{id:this.parentID+"accordDiv",className:"e-pivot-accord"}),o.appendChild(a),a=Ue.createElement("div",{id:this.parentID+"buttonDiv",className:wn}),(e=Ue.createElement("button",{id:this.parentID+"addBtn",className:"e-pivot-add-button",attrs:{type:"button"}})).innerText=this.parent.localeObj.getConstant("add"),(i=Ue.createElement("button",{id:this.parentID+"cancelBtn",className:"e-pivot-cancel-button",attrs:{type:"button"}})).innerText=this.parent.localeObj.getConstant("cancel"),a.appendChild(i),a.appendChild(e),o.appendChild(a)):(this.parent.isAdaptive||"olap"!==this.parent.dataType||((t=Ue.createElement("div",{className:"e-pivot-field-name-title",id:this.parentID+"_FieldNameTitle"})).innerText=this.parent.localeObj.getConstant("fieldTitle"),d.appendChild(t)),i=Ue.createElement("div",{id:this.parentID+"innerDiv",className:"e-pivot-calc-input-div"}),e=Ue.createElement("input",{id:this.parentID+"ddlelement",attrs:{type:"text"},className:hn}),i.appendChild(e),("olap"!==this.parent.dataType||this.parent.isAdaptive?o:d).appendChild(i),e=Ue.createElement("div",{id:this.parentID+"control_container",className:bn}),this.parent.isAdaptive||((i=Ue.createElement("div",{className:Pn})).innerText="olap"===this.parent.dataType?this.parent.localeObj.getConstant("allFields"):this.parent.localeObj.getConstant("formulaField"),"olap"===this.parent.dataType?((n=Ue.createElement("div",{className:Pn+"-container"})).appendChild(i),r=Ue.createElement("span",{attrs:{tabindex:"0","aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("fieldTooltip"),role:"button"},className:z+" e-info"}),n.appendChild(r),new P.Tooltip({content:this.parent.localeObj.getConstant("fieldTooltip"),position:this.parent.enableRtl?"RightCenter":"LeftCenter",target:".e-info",offsetY:(this.parent.enableRtl,-10),locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:220,cssClass:this.parent.cssClass}).appendTo(n),e.appendChild(n)):o.appendChild(i)),r=Ue.createElement("div",{className:yn+"-outer-div"}),e.appendChild(r),n=Ue.createElement("div",{id:this.parentID+"tree",className:yn}),r.appendChild(n),("olap"!==this.parent.dataType||this.parent.isAdaptive?o:l).appendChild(e),this.parent.isAdaptive||((t=Ue.createElement("div",{className:"e-pivot-formula-title"})).innerText="olap"===this.parent.dataType?this.parent.localeObj.getConstant("expressionField"):this.parent.localeObj.getConstant("formula"),("olap"===this.parent.dataType?d:o).appendChild(t)),i=Ue.createElement("textarea",{id:this.parentID+"droppable",className:vn+" e-control e-textbox e-input",attrs:{placeholder:this.parent.isAdaptive?this.parent.localeObj.getConstant("dropTextMobile"):"olap"===this.parent.dataType?this.parent.localeObj.getConstant("olapDropText"):this.parent.localeObj.getConstant("dropText")}}),("olap"!==this.parent.dataType||this.parent.isAdaptive?o:d).appendChild(i),this.parent.isAdaptive&&(a=Ue.createElement("div",{id:this.parentID+"buttonDiv",className:wn}),(s=Ue.createElement("button",{id:this.parentID+"okBtn",className:xn,attrs:{type:"button"}})).innerText=this.parent.localeObj.getConstant("apply"),a.appendChild(s),o.appendChild(a)),"olap"===this.parent.dataType&&(this.parent.isAdaptive||((r=Ue.createElement("div",{className:"e-olap-member-title"})).innerText=this.parent.localeObj.getConstant("memberType"),d.appendChild(r)),n=Ue.createElement("div",{id:this.parentID+"Member_Type_Div",className:mn}),this.parent.isAdaptive?o.appendChild(n):(d.appendChild(n),(e=Ue.createElement("div",{className:"e-olap-hierarchy-title"})).innerText=this.parent.localeObj.getConstant("selectedHierarchy"),d.appendChild(e)),t=Ue.createElement("div",{id:this.parentID+"Hierarchy_List_Div",className:cn}),(this.parent.isAdaptive?o:d).appendChild(t)),this.parent.isAdaptive||((i=Ue.createElement("div",{className:"e-pivot-format-title"})).innerText=this.parent.localeObj.getConstant("formatString"),d.appendChild(i)),a=Ue.createElement("div",{id:this.parentID+"Format_Div",className:gn}),(this.parent.isAdaptive?o:d).appendChild(a),r=Ue.createElement("div",{id:this.parentID+"custom_Format_Div",className:"e-pivot-calc-custom-format-div"}),n=Ue.createElement("input",{id:this.parentID+"Custom_Format_Element",attrs:{type:"text"},className:un}),r.appendChild(n),d.appendChild(r),(this.parent.isAdaptive?o:d).appendChild(r),"pivotfieldlist"===this.parent.getModuleName()&&null===this.parent.dialogRenderer.parentElement.querySelector("."+vn)&&this.parent.isAdaptive?(s=o.querySelector("."+xn),o.appendChild(s)):("olap"===this.parent.dataType&&o.appendChild(l),o.appendChild(d))),o},M.prototype.renderAdaptiveLayout=function(e){var t=this.parent.dialogRenderer.adaptiveElement;e?(Ue.select("#"+this.parentID+"droppable",t.element)&&(e=Ue.getInstance(Ue.select("#"+this.parentID+"ddlelement",document),V.MaskedTextBox),this.formulaText=Ue.select("#"+this.parentID+"droppable",document).value,this.fieldText=e.value),t.element.querySelector("."+mn)&&(e=Ue.getInstance(Ue.select("#"+this.parentID+"Member_Type_Div",t.element),G.DropDownList),this.fieldType=e.value),t.element.querySelector("."+cn)&&(e=Ue.getInstance(Ue.select("#"+this.parentID+"Hierarchy_List_Div",t.element),G.DropDownList),this.parentHierarchy="Dimension"===this.fieldType?e.value:null),t.element.querySelector("."+gn)&&(e=Ue.getInstance(Ue.select("#"+this.parentID+"Format_Div",t.element),G.DropDownList),this.formatType=e.value),t.element.querySelector("."+un)&&(e=Ue.getInstance(Ue.select("#"+this.parentID+"Custom_Format_Element",t.element),V.MaskedTextBox),this.formatText="Custom"===("olap"===this.parent.dataType?this.formatType:this.getFormat(this.formatType))?e.value:null)):(this.currentFieldName=this.formulaText=this.fieldText=this.formatText=null,this.fieldType=this.formatType=this.parentHierarchy=null),this.renderMobileLayout(t)},M.prototype.updateAdaptiveCalculatedField=function(e,t){var i=this.parent.dialogRenderer.adaptiveElement.element,a=(this.isEdit=e)?("pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule).fieldList[t]:{id:null,caption:null,formula:null,fieldType:"Measure",formatString:"pivot"===this.parent.dataType?null:"Standard",parentHierarchy:null},r=(this.currentFieldName=a.id,Ue.getInstance(Ue.select("#"+this.parentID+"ddlelement",document),V.MaskedTextBox));Ue.select("#"+this.parentID+"droppable",document)&&(this.formulaText=Ue.select("#"+this.parentID+"droppable",document).value=a.formula,this.fieldText=r.value=a.caption,r.dataBind()),i.querySelector("."+mn)&&(r=Ue.getInstance(Ue.select("#"+this.parentID+"Member_Type_Div",i),G.DropDownList),this.fieldType=r.value=a.fieldType,r.readonly=!!e,r.dataBind()),i.querySelector("."+cn)&&(e=Ue.getInstance(Ue.select("#"+this.parentID+"Hierarchy_List_Div",i),G.DropDownList),"Dimension"===this.fieldType?this.parentHierarchy=e.value=a.parentHierarchy:(this.parentHierarchy=null,e.index=0),e.dataBind()),i.querySelector("."+gn)&&(r=Ue.getInstance(Ue.select("#"+this.parentID+"Format_Div",i),G.DropDownList),this.formatType=r.value=-1<this.formatTypes.indexOf(a.formatString)?a.formatString:"Custom"),i.querySelector("."+un)&&(e=Ue.getInstance(Ue.select("#"+this.parentID+"Custom_Format_Element",i),V.MaskedTextBox),r=Ce.getFieldByName(t,this.parent.dataSourceSettings.formatSettings),"pivot"===this.parent.dataType?this.formatText=e.value=r?r.format:null:this.formatText=e.value="Custom"===this.formatType?a.formatString:null,e.dataBind())},M.prototype.createDropElements=function(){for(var t=this,e=Ue.select("#"+this.parentID+"calculateddialog",document)?Ue.getInstance(Ue.select("#"+this.parentID+"calculateddialog",document),P.Dialog):null,e=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:e.element,i=[],a=[],r=0,n=this.formatTypes;r<n.length;r++){var s=n[r];i.push({value:"pivot"===this.parent.dataType?this.getFormat(s):s,text:this.parent.localeObj.getConstant(s)})}if("olap"===this.parent.dataType){for(var o=[],l=0,d=["Measure","Dimension"];l<d.length;l++){var p=d[l];o.push({value:p,text:this.parent.localeObj.getConstant(p)})}for(var h=0,u=Ce.getClonedData(this.parent.olapEngineModule.fieldListData);h<u.length;h++){var c=u[h];c.spriteCssClass&&(-1<c.spriteCssClass.indexOf("e-attributeCDB-icon")||-1<c.spriteCssClass.indexOf("e-hierarchyCDB-icon"))&&a.push({value:c.id,text:c.caption})}var g=new G.DropDownList({dataSource:o,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:null!==this.fieldType?this.fieldType:o[0].value,readonly:this.isEdit,cssClass:Sn+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){m.enabled="Dimension"===e.value,t.fieldType=e.value,t.formulaText=Ue.select("#"+t.parentID+"droppable",document).value,m.dataBind()}}),m=(g.isStringTemplate=!0,g.appendTo(Ue.select("#"+this.parentID+"Member_Type_Div",e)),new G.DropDownList({dataSource:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,allowFiltering:!0,enabled:"Dimension"===g.value,filterBarPlaceholder:this.parent.localeObj.getConstant("example")+" "+a[0].text.toString(),fields:{value:"value",text:"text"},value:null!==this.parentHierarchy&&"Dimension"===g.value?this.parentHierarchy:a[0].value,cssClass:Sn+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){t.parentHierarchy=e.value,t.formulaText=Ue.select("#"+t.parentID+"droppable",document).value}}));m.isStringTemplate=!0,m.appendTo(Ue.select("#"+this.parentID+"Hierarchy_List_Div",e))}var g=new G.DropDownList({dataSource:i,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:this.parent.isAdaptive&&null!==this.formatType?this.formatType:("olap"===this.parent.dataType?i[0]:i[4]).value,cssClass:Sn+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){S.enabled="Custom"===e.value,t.formatType=e.value,t.formulaText=Ue.select("#"+t.parentID+"droppable",document).value,S.dataBind()}}),S=(g.isStringTemplate=!0,g.appendTo(Ue.select("#"+this.parentID+"Format_Div",e)),new V.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("customFormat"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,value:null!==this.formatText&&"Custom"===g.value?this.formatText:null,enabled:"Custom"===g.value,change:function(e){t.formatText=e.value,t.formulaText=Ue.select("#"+t.parentID+"droppable",document).value},cssClass:this.parent.cssClass}));S.isStringTemplate=!0,S.appendTo(Ue.select("#"+this.parentID+"Custom_Format_Element",e))},M.prototype.getFormat=function(e){var t=e;if("olap"!==this.parent.dataType)switch(t){case"Standard":t="N";break;case"Currency":t="C";break;case"Percent":t="P";break;case"N":t="Standard";break;case"C":t="Currency";break;case"P":t="Percent"}else switch(t){case"Standard":t="N";break;case"Currency":t="C";break;case"Percent":t="P"}return t},M.prototype.createTreeView=function(){var t=this,e=Ue.select("#"+this.parentID+"calculateddialog",document)?Ue.getInstance(Ue.select("#"+this.parentID+"calculateddialog",document),P.Dialog):null,e=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:e.element;"olap"===this.parent.dataType?this.treeObj=new O.TreeView({fields:{dataSource:this.getFieldListData(this.parent),id:"id",text:"caption",parentID:"pid",iconCss:"spriteCssClass"},allowDragAndDrop:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,nodeDragStart:this.dragStart.bind(this),nodeDragging:function(e){e.event.target&&e.event.target.classList.contains(vn)?(Ue.removeClass([e.clonedNode],Nr),Ue.addClass([e.event.target],"e-copy-drop")):(Ue.addClass([e.clonedNode],Nr),Ue.removeClass([e.event.target],"e-copy-drop"),e.dropIndicator="e-no-drop",Ue.addClass([e.clonedNode.querySelector("."+z)],"e-icon-expandable"),Ue.removeClass([e.clonedNode.querySelector("."+z)],"e-list-icon"))},nodeClicked:this.fieldClickHandler.bind(this),nodeSelected:function(e){e.node.getAttribute("data-type")===dh?t.displayMenu(e.node):(Ue.removeClass([e.node],"e-active"),e.cancel=!0)},nodeDragStop:this.fieldDropped.bind(this),drawNode:this.drawTreeNode.bind(this),nodeExpanding:this.updateNodeIcon.bind(this),nodeCollapsed:this.updateNodeIcon.bind(this),sortOrder:"None",cssClass:this.parent.cssClass}):this.treeObj=new O.TreeView({fields:{dataSource:this.getFieldListData(this.parent),id:"formula",text:"name",iconCss:"icon"},allowDragAndDrop:!0,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,locale:this.parent.locale,cssClass:this.parent.cssClass,nodeCollapsing:this.nodeCollapsing.bind(this),nodeDragStart:this.dragStart.bind(this),nodeClicked:this.fieldClickHandler.bind(this),nodeDragStop:this.fieldDropped.bind(this),drawNode:this.drawTreeNode.bind(this),keyPress:function(e){39===e.event.keyCode&&(e.cancel=!0)},sortOrder:"Ascending"}),this.treeObj.isStringTemplate=!0,this.treeObj.appendTo(Ue.select("#"+this.parentID+"tree",e))},M.prototype.updateNodeIcon=function(e){if(e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-icon-expandable.e-process")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-icon")){var t=e.node.querySelector(".e-list-icon");Ue.removeClass([t],"e-folderCDB-icon"),Ue.addClass([t],"e-folderCDB-open-icon")}else if(e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-icon-expandable")&&-1<e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-open-icon")){t=e.node.querySelector(".e-list-icon");Ue.removeClass([t],"e-folderCDB-open-icon"),Ue.addClass([t],"e-folderCDB-icon")}else{for(var i=this.treeObj.fields.dataSource,a=[],r=0,n=i;r<n.length;r++){var s=n[r];s.pid===e.nodeData.id.toString()&&a.push(s)}if(0===a.length){this.parent.olapEngineModule.calcChildMembers=[],this.parent.olapEngineModule.getCalcChildMembers(this.parent.dataSourceSettings,e.nodeData.id.toString()),a=this.parent.olapEngineModule.calcChildMembers,this.parent.olapEngineModule.calcChildMembers=[];for(var o=0,l=a;o<l.length;o++)(t=l[o]).pid=e.nodeData.id.toString(),t.hasChildren=!1,t.spriteCssClass="e-level-members",t.caption=""===t.caption?this.parent.localeObj.getConstant("blank"):t.caption,i.push(t);this.treeObj.addNodes(a,e.node)}}},M.prototype.nodeCollapsing=function(e){e.cancel=!0},M.prototype.dragStart=function(e){var t=!1,i=e.clonedNode;(t=i&&("olap"===this.parent.dataType&&(i.querySelector(".e-calc-dimension-icon,.e-calc-measure-icon,.e-measure-icon")||i.querySelector(".e-attributeCDB-icon,.e-hierarchyCDB-icon")||i.querySelector(".e-level-members,.e-namedSetCDB-icon"))||"pivot"===this.parent.dataType&&e.event.target.classList.contains(ar))?!0:t)?(Ue.addClass([e.draggedNode.querySelector("."+qr)],Er),Ue.addClass([i],"e-pivot-calc"),t=Ue.getInstance(Ue.select("#"+this.parentID+"calculateddialog",document),P.Dialog),i.style.zIndex=(t.zIndex+1).toString(),i.style.display="inline"):e.cancel=!0},M.prototype.drawTreeNode=function(e){var t,i,a,r,n,s;"olap"===this.parent.dataType?(e.node.querySelector(".e-measure-icon")&&(e.node.querySelector(".e-list-icon").style.display="none"),t=e.nodeData,e.node.setAttribute("data-field",t.id),e.node.setAttribute("data-caption",t.caption),i=e.node.querySelector("."+Ir),e.nodeData&&e.nodeData.type===dh&&i&&e.node.querySelector(".e-list-icon.e-calc-member")&&(e.node.setAttribute("data-type",t.type),e.node.setAttribute("data-membertype",t.fieldType),e.node.setAttribute("data-hierarchy",t.parentHierarchy||""),e.node.setAttribute("data-formula",t.formula),r=t.formatString?-1<this.formatTypes.indexOf(t.formatString)?t.formatString:"Custom":"None",e.node.setAttribute("data-formatString",r),e.node.setAttribute("data-customformatstring","Custom"===r?t.formatString:""),a=Ue.createElement("span",{className:ns+" e-icons e-list-icon"}),i.classList.add("e-calcfieldmember"),this.parent.isAdaptive?(n=Ue.createElement("span",{className:"e-list-edit-icon"+(this.isEdit&&this.currentFieldName===t.id?" e-edited ":" e-edit ")+z}),(s=Ue.createElement("div",{className:"e-list-header-icon"})).appendChild(n),s.appendChild(a),i.appendChild(s)):i.appendChild(a)),this.parent.isAdaptive&&(n=e.node.querySelector("."+Ir),e.node&&e.node.querySelector(".e-list-icon")&&n&&(s=e.node.querySelector(".e-list-icon"),n.insertBefore(s,e.node.querySelector(".e-list-text"))),e.node&&e.node.querySelector(".e-calcMemberGroupCDB,.e-measureGroupCDB-icon,.e-folderCDB-icon")&&(e.node.querySelector("."+Qn).style.display="none"),e.node)&&e.node.querySelector(".e-level-members")&&(e.node.querySelector(".e-list-icon").style.display="none"),(e.node.querySelector(".e-calc-dimension-icon,.e-calc-measure-icon,.e-measure-icon")||e.node.querySelector(".e-attributeCDB-icon,.e-hierarchyCDB-icon")||e.node.querySelector(".e-level-members,.e-namedSetCDB-icon"))&&Ue.addClass([e.node],La)):(t=e.nodeData.field,e.node.setAttribute("data-field",t),e.node.setAttribute("data-caption",e.nodeData.caption),e.node.setAttribute("data-type",e.nodeData.type),i=Ce.getFieldByName(t,this.parent.dataSourceSettings.formatSettings),e.node.setAttribute("data-formatString",i?i.format:""),i&&(r=(a=this.getFormat(i.format))?-1<this.formatTypes.indexOf(a)?i.format:"Custom":"None",e.node.setAttribute("data-customformatstring","Custom"===r?a:""),e.node.setAttribute("data-formatString",i?r:"")),n=Ue.createElement("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("dragField")},className:z+" e-drag"}),s=Ue.createElement("div",{className:" e-iconspace"}),Ue.prepend([n],e.node.querySelector("."+Ir)),Ue.append([s,e.node.querySelector("."+fn)],e.node.querySelector("."+Ir)),this.getMenuItems(this.parent.engineModule.fieldList[t].type).length<=0?Ue.removeClass([e.node.querySelector("."+fn)],z):e.node.querySelector("."+fn).setAttribute("title",this.parent.localeObj.getConstant("format")),this.parent.engineModule.fieldList[t].aggregateType===dh&&(e.node.querySelector("."+fn).setAttribute("title",this.parent.localeObj.getConstant("remove")),Ue.addClass([e.node.querySelector("."+fn)],ns),Ue.addClass([e.node.querySelector(".e-iconspace")],[Fn,z,"e-list-icon"]),e.node.querySelector("."+Fn).setAttribute("title",this.parent.localeObj.getConstant("edit")),e.node.querySelector("."+Fn).setAttribute("aria-disabled","false"),e.node.querySelector("."+Fn).setAttribute("tabindex","-1"),Ue.removeClass([e.node.querySelector("."+fn)],fn),Ue.removeClass([e.node.querySelector(".e-iconspace")],"e-iconspace")))},M.prototype.createTypeContainer=function(e){for(var t=Ue.createElement("div",{id:this.parentID+"control_container",className:bn}),i=this.getMenuItems(this.parent.engineModule.fieldList[e].type),a=0;a<i.length;a++){var r=Ue.createElement("input",{id:this.parentID+"radio"+e+i[a],attrs:{type:"radio","data-ftxt":e,"data-value":i[a]},className:"e-pivot-calc-radio"});t.appendChild(r)}return t},M.prototype.getMenuItems=function(e,t){for(var i=Ue.isNullOrUndefined(t)?this.parent.aggregateTypes:t,a=[],r=this.getValidSummaryType(),n=0;n<i.length;n++)-1<r.indexOf(i[n])&&a.indexOf(i[n])<0&&((i[n]!==th&&i[n]!==ah||"number"===e)&&"number"!==e||a.push(i[n]));return a},M.prototype.getValidSummaryType=function(){return[th,ah,ih,"Avg","Median","Min","Max",rh,nh,sh,oh,lh]},M.prototype.getAccordionData=function(e){for(var t=[],i=Object.keys(e.engineModule.fieldList),a=0,r=i.length;a<r;a++){var n=i[a];t.push({header:"<input id="+this.parentID+"_"+a+" class="+pn+' type="checkbox" data-field='+n+' data-caption="'+this.parent.engineModule.fieldList[n].caption+'" data-type='+this.parent.engineModule.fieldList[n].type+"/>",content:this.parent.engineModule.fieldList[n].aggregateType===dh||this.getMenuItems(this.parent.engineModule.fieldList[n].type).length<1?"":this.createTypeContainer(n).outerHTML,iconCss:this.parent.engineModule.fieldList[n].aggregateType===dh?"e-list-icon "+(this.isEdit&&this.currentFieldName===n?"e-edited":"e-edit"):""})}return t},M.prototype.renderMobileLayout=function(e){var t,i=this,e=(e.items[4].content=this.renderDialogElements().outerHTML,e.dataBind(),Ue.select("#"+this.parentID+"calculateddialog",document)?Ue.getInstance(Ue.select("#"+this.parentID+"calculateddialog",document),P.Dialog):null),e=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:e.element,a=(this.parent.isAdaptive&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+vn)&&this.createDropElements(),new Y.Button({cssClass:this.parent.cssClass,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}));a.isStringTemplate=!0,a.appendTo(Ue.select("#"+this.parentID+"cancelBtn",e)),a.element&&(a.element.onclick=this.cancelBtnClick.bind(this)),null!==this.parent.dialogRenderer.parentElement.querySelector("."+vn)&&this.parent.isAdaptive?((a=new Y.Button({cssClass:this.parent.cssClass,isPrimary:!0,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer})).isStringTemplate=!0,a.appendTo(Ue.select("#"+this.parentID+"okBtn",e)),(t=new V.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("fieldName"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:function(e){i.fieldText=e.value,i.formulaText=Ue.select("#"+i.parentID+"droppable",document).value},cssClass:this.parent.cssClass})).isStringTemplate=!0,t.appendTo(Ue.select("#"+this.parentID+"ddlelement",e)),null!==this.formulaText&&null!==Ue.select("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement)&&(Ue.select("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement).value=this.formulaText),null!==this.fieldText&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+hn)&&(this.parent.dialogRenderer.parentElement.querySelector("."+hn).value=this.fieldText,t.value=this.fieldText),a.element&&(a.element.onclick=this.applyFormula.bind(this))):this.parent.isAdaptive&&((t=new Y.Button({cssClass:this.parent.cssClass,isPrimary:!0,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer})).isStringTemplate=!0,t.appendTo(Ue.select("#"+this.parentID+"addBtn",e)),"olap"===this.parent.dataType?(this.treeObj=new O.TreeView({fields:{dataSource:this.getFieldListData(this.parent),id:"id",text:"caption",parentID:"pid",iconCss:"spriteCssClass"},showCheckBox:!0,autoCheck:!1,sortOrder:"None",enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,nodeClicked:this.fieldClickHandler.bind(this),drawNode:this.drawTreeNode.bind(this),nodeExpanding:this.updateNodeIcon.bind(this),nodeCollapsed:this.updateNodeIcon.bind(this),nodeSelected:function(e){Ue.removeClass([e.node],"e-active"),e.cancel=!0},cssClass:this.parent.cssClass}),this.treeObj.isStringTemplate=!0,this.treeObj.appendTo(Ue.select("#"+this.parentID+"accordDiv",e))):((a=new O.Accordion({items:this.getAccordionData(this.parent),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,expanding:this.accordionExpand.bind(this),clicked:this.accordionClickHandler.bind(this),created:this.accordionCreated.bind(this)})).isStringTemplate=!0,a.appendTo(Ue.select("#"+this.parentID+"accordDiv",e)),this.updateType()),t.element)&&(t.element.onclick=this.addBtnClick.bind(this))},M.prototype.accordionExpand=function(e){if(0===e.element.querySelectorAll(".e-radio-wrapper").length)for(var t=Object.keys(this.parent.engineModule.fieldList),i=0,a=t.length;i<a;i++){var r=t[i],n="number"!==this.parent.engineModule.fieldList[r].type?[th,ah]:[ih,th,"Avg","Median","Min","Max",ah,rh,nh,sh,oh,lh],s=void 0;if(r===e.element.querySelector("[data-field").getAttribute("data-field"))for(var o=0;o<n.length;o++)(s=new Y.RadioButton({label:this.parent.localeObj.getConstant(n[o]),name:"AggregateType"+r,checked:e.element.querySelector("[data-type").getAttribute("data-type")===n[o],change:this.onChange.bind(this),locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass})).isStringTemplate=!0,s.appendTo(Ue.select("#"+this.parentID+"radio"+r+n[o],e.element))}},M.prototype.onChange=function(e){var t=e.event.target.parentElement.querySelector(".e-label").innerText,i=e.event.target.closest(".e-acrdn-item").querySelector("[data-field").getAttribute("data-caption");e.event.target.closest(".e-acrdn-item").querySelector(".e-label").innerText=i+" ("+t+")",e.event.target.closest(".e-acrdn-item").querySelector("[data-type").setAttribute("data-type",e.event.target.getAttribute("data-value"))},M.prototype.updateType=function(){for(var e=Object.keys(this.parent.engineModule.fieldList),t=Ue.select("#"+this.parentID+"calculateddialog",document)?Ue.getInstance(Ue.select("#"+this.parentID+"calculateddialog",document),P.Dialog):null,i=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:t.element,a=0,r=e.length;a<r;a++){var n=e[a],s=null,s="number"===this.parent.engineModule.fieldList[n].type&&"include"!==this.parent.engineModule.fieldList[n].type&&"exclude"!==this.parent.engineModule.fieldList[n].type||"DistinctCount"===this.parent.engineModule.fieldList[n].aggregateType?void 0!==this.parent.engineModule.fieldList[n].aggregateType?this.parent.engineModule.fieldList[n].aggregateType:ih:th,o=new Y.CheckBox({label:this.parent.engineModule.fieldList[n].caption+" ("+this.parent.localeObj.getConstant(s)+")",locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass});o.isStringTemplate=!0,o.appendTo(Ue.select("#"+this.parentID+"_"+a,i)),Ue.select("#"+this.parentID+"_"+a,i).setAttribute("data-field",n),Ue.select("#"+this.parentID+"_"+a,i).setAttribute("data-type",s)}},M.prototype.cancelBtnClick=function(){this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)},M.prototype.addBtnClick=function(){var e,t="",i=null;if("pivot"===this.parent.dataType){for(var a=document.querySelectorAll(".e-accordion .e-check"),r=0;r<a.length;r++)if(e=a[r].parentElement.querySelector("[data-field]").getAttribute("data-field"),-1===(i=a[r].parentElement.querySelector("[data-field]").getAttribute("data-type")).indexOf(dh))t=t+'"'+i+"("+e+')"';else for(var n=0;n<this.parent.dataSourceSettings.calculatedFieldSettings.length;n++)if(this.parent.dataSourceSettings.calculatedFieldSettings[n].name===e){t+=this.parent.dataSourceSettings.calculatedFieldSettings[n].formula;break}}else for(var s=this.treeObj.getAllCheckedNodes(),o=this.parent.olapEngineModule,l=0,d=s;l<d.length;l++){var p=d[l];t+=o.fieldList[p]&&o.fieldList[p].type===dh?o.fieldList[p].tag:p}this.formulaText=null!==this.formulaText?this.formulaText+t:t,this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)},M.prototype.createCalculatedFieldDialog=function(e){var t;this.parent.isAdaptive&&"pivotfieldlist"===this.parent.getModuleName()?(this.renderAdaptiveLayout(!e||void 0===e.edit||e.edit),this.isEdit=e&&void 0!==e.edit?e.edit:this.isEdit):this.parent.isAdaptive||(this.isEdit=!(!e||void 0===e.edit)&&e.edit,this.renderDialogLayout(),e&&e.edit&&(e=this.treeObj.element.querySelector('li[data-field="'+e.fieldName+'"]'))&&(Ue.addClass([e],["e-active","e-node-focus"]),e.setAttribute("aria-selected","true"),e.id=this.treeObj.element.id+"_active","pivot"===this.parent.dataType?(t={event:{target:e.querySelector(".e-list-icon.e-edit.e-icons")}},this.fieldClickHandler(t)):this.displayMenu(e)),(t=Ue.getInstance(Ue.select("#"+this.parentID+"calculateddialog",document),P.Dialog)).element.style.top=parseInt(t.element.style.top,10)<0?"0px":t.element.style.top)},M.prototype.renderDialogLayout=function(){this.newFields=Ue.extend([],this.parent.dataSourceSettings.calculatedFieldSettings,null,!0),this.createDialog();var e=Ue.getInstance(Ue.select("#"+this.parentID+"calculateddialog",document),P.Dialog),t=(e.content=this.renderDialogElements(),e.refresh(),new V.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("fieldName"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass}));t.isStringTemplate=!0,t.appendTo(Ue.select("#"+this.parentID+"ddlelement",e.element)),this.createDropElements(),this.createTreeView(),this.droppable=new Ue.Droppable(Ue.select("#"+this.parentID+"droppable",e.element)),this.keyboardEvents=new Ue.KeyboardEvents(e.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:{moveRight:"rightarrow",enter:"enter",shiftE:"shift+E",delete:"delete"},eventName:"keydown"})},M.prototype.createConfirmDialog=function(e,t,i,a,r){var n=Ue.createElement("div",{id:this.parentID+"_CalculatedFieldErrorDialog",className:fr}),r=(this.parent.element.appendChild(n),new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!1,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:a?this.removeCalcField.bind(this,r):this.replaceFormula.bind(this,i),isFlat:!1,buttonModel:{cssClass:mr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:a?this.parent.localeObj.getConstant("yes"):this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:this.closeErrorDialog.bind(this),isFlat:!1,buttonModel:{cssClass:Sr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:a?this.parent.localeObj.getConstant("no"):this.parent.localeObj.getConstant("cancel")}}],header:e,content:t,isModal:!0,visible:!0,closeOnEscape:!0,target:document.body,cssClass:this.parent.cssClass,close:this.removeErrorDialog.bind(this)}));r.isStringTemplate=!0,r.appendTo(n)},M.prototype.replaceFormula=function(e){var t=this.parent.dataSourceSettings;if("olap"===this.parent.dataType){for(var i=0;i<t.calculatedFieldSettings.length;i++)if(t.calculatedFieldSettings[i].name===e.name){Ue.isNullOrUndefined(e.hierarchyUniqueName)||(t.calculatedFieldSettings[i].hierarchyUniqueName=e.hierarchyUniqueName),t.calculatedFieldSettings[i].formatString=e.formatString,t.calculatedFieldSettings[i].formula=e.formula,this.parent.lastCalcFieldInfo=t.calculatedFieldSettings[i];break}}else for(var a=0;a<t.values.length;a++)if(t.values[a].type===dh&&t.values[a].name===e.name)for(i=0;i<t.calculatedFieldSettings.length;i++)t.calculatedFieldSettings[i].name===e.name&&(t.calculatedFieldSettings[i].formula=e.formula,this.parent.lastCalcFieldInfo=t.calculatedFieldSettings[i],this.updateFormatSettings(t,e.name,e.formatString));this.addFormula(t,e.name),this.removeErrorDialog()},M.prototype.removeErrorDialog=function(){var e=Ue.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document),e=e?Ue.getInstance(e,P.Dialog):null;e&&!e.isDestroyed&&e.destroy(),null!==Ue.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document)&&Ue.remove(Ue.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document))},M.prototype.closeErrorDialog=function(){Ue.getInstance(Ue.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document),P.Dialog).close()},M.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Ft,this.createCalculatedFieldDialog,this)},M.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Ft,this.createCalculatedFieldDialog)},M.prototype.destroy=function(){this.treeObj&&!this.treeObj.isDestroyed&&this.treeObj.destroy(),this.treeObj&&(this.treeObj=null),this.newFields&&(this.newFields=null),this.curMenu&&(this.curMenu=null),this.droppable&&(this.droppable=null),this.keyboardEvents&&(this.keyboardEvents=null);var e=Ue.select("#"+this.parentID+"ddlelement",document);e&&Ue.getInstance(e,V.MaskedTextBox).destroy(),(e=Ue.select("#"+this.parentID+"calculateddialog",document))&&Ue.getInstance(e,P.Dialog).destroy(),(e=Ue.select("#"+this.parentID+"CalcContextmenu",document))&&Ue.getInstance(e,O.ContextMenu).destroy(),(e=Ue.select("#"+this.parentID+"accordDiv",document))&&Ue.getInstance(e,O.Accordion).destroy(),(e=Ue.select("#"+this.parentID+"_CalculatedFieldErrorDialog",document))&&Ue.getInstance(e,P.Dialog).destroy()},M);function M(e){this.isFormula=!1,this.isRequireUpdate=!1,this.formatTypes=["Standard","Currency","Percent","Custom","None"],this.parent=e,this.existingReport=null,(this.parent.calculatedFieldModule=this).removeEventListener(),this.addEventListener(),this.parentID=this.parent.element.id,this.treeObj=null,this.droppable=null,this.newFields=null,this.isFieldExist=!0,this.formulaText=null,this.fieldText=null,this.formatText=null,this.formatType=null,this.fieldType=null,this.parentHierarchy=null,this.isEdit=!1,this.currentFieldName=null}eh.Inject(jl);ph.prototype.getModuleName=function(){return"fieldList"},ph.prototype.initiateModule=function(){var e;Ue.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)||(this.element=Ue.createElement("div",{id:this.parent.element.id+"_PivotFieldList",styles:"position:"+(this.parent.enableRtl?"static":"absolute")+";height:0;width:"+this.parent.element.style.width+";display:none"}),null===Ue.select("#"+this.parent.element.id+"containerwrapper",document)?(e=Ue.createElement("div",{id:this.parent.element.id+"containerwrapper",styles:"height:"+(isNaN(this.parent.height)?this.parent.height:this.parent.height+"px")}),this.parent.element.parentElement.appendChild(e),e.appendChild(this.element),e.appendChild(this.parent.element)):Ue.select("#"+this.parent.element.id+"containerwrapper",document).appendChild(this.element),this.parent.pivotFieldListModule=new eh({dataSourceSettings:{providerType:this.parent.dataSourceSettings.providerType,rows:[],columns:[],values:[],filters:[]},spinnerTemplate:this.parent.spinnerTemplate,allowDeferLayoutUpdate:this.parent.allowDeferLayoutUpdate,renderMode:"Popup",allowCalculatedField:this.parent.allowCalculatedField,showValuesButton:this.parent.showValuesButton,enableRtl:this.parent.enableRtl,locale:this.parent.locale,target:this.parent.element.parentElement,aggregateTypes:this.parent.aggregateTypes,maxNodeLimitInMemberEditor:this.parent.maxNodeLimitInMemberEditor,aggregateCellInfo:this.parent.bindTriggerEvents.bind(this.parent),onHeadersSort:this.parent.bindTriggerEvents.bind(this.parent),cssClass:this.parent.cssClass,enableFieldSearching:this.parent.enableFieldSearching,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),this.parent.pivotFieldListModule.isPopupView=!0,this.parent.pivotFieldListModule.pivotGridModule=this.parent,this.parent.pivotFieldListModule.appendTo(this.element))},ph.prototype.updateControl=function(){if(this.parent.allowDeferLayoutUpdate&&(this.parent.actionObj.actionName="Field list refreshed"),this.element){for(var e=void 0,t=0;t<this.parent.toolbar.length;t++)"FieldList"===this.parent.toolbar[t]&&(e=!0);e&&"Server"===this.parent.dataSourceSettings.mode?this.element.style.display="none":this.element.style.display="block",Ue.prepend([this.element],this.parent.element),this.parent.showGroupingBar&&this.parent.groupingBarModule?(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.update.bind(this))):Ue.isNullOrUndefined(this.element.querySelector("."+Fa))||(Ue.setStyleAttribute(this.element.querySelector("."+Fa),{left:"auto"}),this.parent.enableRtl?Ue.removeClass([this.element.querySelector("."+Fa)],"e-fieldlist-left"):Ue.addClass([this.element.querySelector("."+Fa)],"e-fieldlist-left")),Ue.setStyleAttribute(this.element,{width:Ue.formatUnit(this.parent.element.offsetWidth)})}this.parent.pivotFieldListModule.update(this.parent)},ph.prototype.update=function(){var e="Table"!==this.parent.currentView?this.parent.chart?this.parent.pivotChartModule.getCalulatedWidth():e:this.parent.grid?this.parent.grid.element.offsetWidth:e;e&&!Ue.isNullOrUndefined(this.element.querySelector("."+Fa))&&(e=e<400?400:e,Ue.setStyleAttribute(this.element.querySelector("."+Fa),{left:Ue.formatUnit(this.parent.enableRtl?-Math.abs(e-this.element.querySelector("."+Fa).offsetWidth):e-this.element.querySelector("."+Fa).offsetWidth),top:this.parent.element.querySelector("."+Ga)?this.parent.element.querySelector("."+Fa).offsetHeight.toString()+"px":""}),this.parent.enableRtl?Ue.addClass([this.element.querySelector("."+Fa)],"e-fieldlist-left"):Ue.removeClass([this.element.querySelector("."+Fa)],"e-fieldlist-left"))},ph.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Pt,this.initiateModule,this),this.parent.on(wt,this.updateControl,this))},ph.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Pt,this.initiateModule),this.parent.off(wt,this.updateControl))},ph.prototype.destroy=function(){this.removeEventListener(),this.parent.pivotFieldListModule&&!this.parent.pivotFieldListModule.isDestroyed&&(this.parent.pivotFieldListModule.destroy(),this.parent.pivotFieldListModule=null,Ue.isNullOrUndefined(Ue.select("#"+this.parent.element.id+"_PivotFieldList",document))||Ue.remove(Ue.select("#"+this.parent.element.id+"_PivotFieldList",document)))};Ql=ph;function ph(e){this.parent=e,this.addEventListener()}uh.prototype.render=function(){(!this.parent.pivotButtonModule||this.parent.pivotButtonModule&&this.parent.pivotButtonModule.isDestroyed)&&new Qp(this.parent),this.createPivotButtons();for(var e=[],t=(e=e.concat([].slice.call(this.parent.groupingBarModule.rowPanel.querySelectorAll("."+Qa)))).length,i=0;i<t;i++){var a;this.parent.isTabular||(a=Ue.createElement("span",{className:"e-indent-div",styles:this.parent.isTabular?"auto":"width:"+24*i+"px"}),Ue.prepend([a],e[i]))}},uh.prototype.createPivotButtons=function(){var e=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],t=Array.prototype.slice.call(this.parent.element.querySelectorAll("."+Tr+",."+Mr+",."+Dr+",."+Or+",."+Pr));Ue.isNullOrUndefined(this.parent.element.querySelector("."+bs))&&t.push(this.parent.groupingBarModule.rowPanel);for(var i=0;i<t.length;i++){var a=t[i];0<this.parent.dataSourceSettings.values.length&&a.classList.contains(cs)&&0<this.parent.dataSourceSettings.columns.length&&a.classList.contains(us)||(a.innerHTML="")}if("pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&(!(this.parent.dataSourceSettings.dataSource instanceof K.DataManager)&&0<this.parent.dataSourceSettings.dataSource.length||this.parent.dataSourceSettings.dataSource instanceof K.DataManager&&this.parent.engineModule.data&&0<this.parent.engineModule.data.length)||"olap"===this.parent.dataType&&this.parent.dataSourceSettings.url&&""!==this.parent.dataSourceSettings.url||"Server"===this.parent.dataSourceSettings.mode&&this.parent.dataSourceSettings.url&&""!==this.parent.dataSourceSettings.url){var r=["rows","columns","values","filters"];if("pivot"===this.parent.dataType&&this.parent.groupingBarSettings.showFieldsPanel){r.push("all-fields"),e.push([]);for(var n=0,s=this.parent.engineModule&&this.parent.engineModule.fieldList?Object.keys(this.parent.engineModule.fieldList):[];n<s.length;n++){var o=s[n];this.parent.engineModule.fieldList[o]&&!this.parent.engineModule.fieldList[o].isSelected&&e[e.length-1].push(Ce.getFieldInfo(o,this.parent,!0).fieldItem)}}for(var l,i=0,d=e.length;i<d;i++)e[i]&&(l={field:e[i],axis:r[i].toString()},this.parent.notify(Et,l))}};var hh=uh;function uh(e){this.parent=e}ch.prototype.getModuleName=function(){return"groupingBar"},ch.prototype.renderLayout=function(){this.groupingTable=Ue.createElement("div",{className:wr});var e=Ue.createElement("div",{className:_a}),t=(this.rightAxisPanel=Ue.createElement("div",{className:Ua}),Ue.createElement("div",{className:"e-axis-row e-axiscontainer"})),i=Ue.createElement("div",{className:"e-axis-column e-axiscontainer"}),a=Ue.createElement("div",{className:"e-axis-value e-axiscontainer"}),r=Ue.createElement("div",{className:Mn+" "+Tn+"container"}),n=(this.rowPanel=Ue.createElement("div",{className:Mr+" "+yr+(this.parent.isTabular?" e-tabular-group-rows":"")}),Ue.createElement("div",{className:Dr+" "+br})),s=Ue.createElement("div",{className:Or+" "+Cr}),o=Ue.createElement("div",{className:Pr+" "+xr});t.appendChild(this.rowPanel),i.appendChild(n),a.appendChild(s),r.appendChild(o),this.rowAxisPanel=t,e.appendChild(a),e.appendChild(t),this.rightAxisPanel.appendChild(r),this.rightAxisPanel.appendChild(i),this.groupingTable.appendChild(Ue.createElement("div",{styles:"display:flex;"})),this.groupingTable.firstElementChild.appendChild(e),this.groupingTable.firstElementChild.appendChild(this.rightAxisPanel),"pivot"===this.parent.dataType&&null!=this.parent.groupingBarSettings&&this.parent.groupingBarSettings.showFieldsPanel&&(this.gridPanel=this.createToolbarUI(this.groupingTable)),this.groupingTable.classList.add(fs),this.groupingTable.querySelector("."+Mr).classList.add(bs);for(var l=0,d=[this.rowPanel,n,s,o];l<d.length;l++){var p=d[l];this.parent.groupingBarSettings.allowDragAndDrop&&new Ue.Droppable(p,{}),this.unWireEvent(p),this.wireEvent(p)}"Table"!==this.parent.displayOption.view&&"Table"!==this.parent.groupingBarSettings.displayMode?(this.groupingChartTable=this.groupingTable.cloneNode(!0),Ue.select("#"+this.parent.element.id+"_AllFields",this.groupingChartTable)&&(Ue.select("#"+this.parent.element.id+"_AllFields",this.groupingChartTable).remove(),this.chartPanel=this.createToolbarUI(this.groupingChartTable)),this.groupingChartTable.classList.add(Ss),this.groupingChartTable.classList.remove(fs),this.groupingChartTable.querySelector("."+Mr).classList.add(hs),this.groupingChartTable.querySelector("."+Mr).classList.remove(bs),this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.chartSeries&&["Pie","Pyramid","Doughnut","Funnel"].indexOf(this.parent.chartSettings.chartSeries.type)<0?this.groupingChartTable.querySelector("."+Or).classList.add("e-group-chart-multi-values"):this.groupingChartTable.querySelector("."+Or).classList.add(cs),this.parent.chartSettings.chartSeries&&-1<["Pie","Pyramid","Doughnut","Funnel"].indexOf(this.parent.chartSettings.chartSeries.type)?this.groupingChartTable.querySelector("."+Dr).classList.add(us):this.groupingChartTable.querySelector("."+Dr).classList.add("e-group-chart-accumulation-column"),this.groupingChartTable.querySelector("."+Pr).classList.add("e-group-chart-filters")):this.groupingChartTable=void 0,"Chart"!==this.parent.displayOption.view&&"Chart"!==this.parent.groupingBarSettings.displayMode||(this.groupingTable=void 0)},ch.prototype.appendToElement=function(){var e=this.groupingTable||this.groupingChartTable;if(!Ue.isNullOrUndefined(e)){var t=e.getElementsByClassName(_a)[0],i=e.getElementsByClassName(Pr+" "+xr)[0],a=e.getElementsByClassName(Dr+" "+br)[0],e=e.getElementsByClassName(Or+" "+Cr)[0];if((this.parent.element.querySelector("."+Dn)||this.parent.element.querySelector("."+ps))&&this.parent.showGroupingBar){if(this.parent.element.querySelector("."+wr))for(var r=this.parent.element.querySelectorAll("."+wr),n=0;n<r.length;n++){var s=r[n];Ue.remove(s)}if(this.groupingChartTable&&(Ue.select("#"+this.parent.element.id+"_chart",this.parent.element)?(Ue.setStyleAttribute(this.groupingChartTable,{width:Ue.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.parent.element.insertBefore(this.groupingChartTable,Ue.select("#"+this.parent.element.id+"_chart",this.parent.element)),this.groupingChartTable.querySelector("."+Ba)&&null!=this.chartPanel&&!this.chartPanel.isDestroyed&&(o=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2,this.chartPanel.width=o<400?"398px":o,this.chartPanel.refreshOverflow(),this.parent.showFieldList)&&this.parent.pivotFieldListModule&&this.parent.pivotFieldListModule.element&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.alignIcon.bind(this)))):this.groupingChartTable=void 0),"Chart"!==this.parent.displayOption.view&&this.groupingTable){this.parent.isAdaptive&&(this.parent.isTabular?(t.style.minWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth+"px",e.style.minWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth+"px"):(t.style.minWidth="180px",e.style.minWidth="180px")),this.parent.firstColWidth&&(t.style.minWidth="auto",e.style.minWidth="auto"),i.removeAttribute("style"),a.removeAttribute("style"),this.rowPanel.removeAttribute("style");var o=void 0,o="olap"===this.parent.dataType?this.parent.olapEngineModule.headerContent?Object.keys(this.parent.olapEngineModule.headerContent).length:0:this.parent.engineModule.headerContent?Object.keys(this.parent.engineModule.headerContent).length:0,t=(Ue.isNullOrUndefined(o)||((t=this.parent.element.querySelector("."+Yn).querySelector(".e-columnheader")).removeAttribute("style"),Ue.addClass([t.querySelector("."+en)],"e-group-row"),t.querySelector(".e-group-row").querySelector(".e-headercelldiv").style.display="none",t.querySelector(".e-group-row").querySelector(".e-sortfilterdiv").style.display="none"),this.parent.element.insertBefore(this.groupingTable,this.parent.element.querySelector("."+Dn)),Ue.setStyleAttribute(this.groupingTable,{width:Ue.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingTable&&this.groupingTable.querySelector("."+Ba)&&null!=this.gridPanel&&!this.gridPanel.isDestroyed&&(o=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2,this.gridPanel.width=o,this.gridPanel.refreshOverflow()),this.groupingTable.style.minWidth="400px",this.parent.axisFieldModule.render(),this.setGridRowWidth(),this.parent.element.querySelector("."+Yn).querySelector("colgroup").children[0]),o=this.parent.isTabular?this.rowAxisWidth:parseInt(t.style.width,10),t=Ue.formatUnit(this.groupingTable.offsetWidth-o),o=(Ue.setStyleAttribute(e,{width:o+"px"}),Ue.setStyleAttribute(this.rightAxisPanel,{width:t}),this.groupingTable.style.display="",e.offsetHeight/2),t=("Chart"===this.parent.displayOption.primary&&(this.groupingTable.style.display="none"),o>a.offsetHeight&&(Ue.setStyleAttribute(i,{height:Ue.formatUnit(o)}),Ue.setStyleAttribute(a,{height:Ue.formatUnit(2+o)})),this.parent.element.querySelector("."+Yn).offsetHeight);Ue.setStyleAttribute(this.rowPanel,{height:t+"px"}),this.parent.element.querySelector("."+Yn).querySelector(".e-rhandler")&&(this.parent.element.querySelector("."+Yn).querySelector(".e-rhandler").style.height=t+"px");for(var e=[].slice.call(this.parent.element.querySelector("."+Yn).querySelector("thead").querySelectorAll("tr")).filter(function(e){return 0<e.childNodes.length}),l=t/e.length,d=0,p=e;d<p.length;d++){var h=p[d];Ue.setStyleAttribute(h,{height:l+"px"});for(var u=0,c=[].slice.call(h.querySelectorAll(".e-rhandler"));u<c.length;u++){var g=c[u];Ue.setStyleAttribute(g,{height:l+"px"})}}}else this.parent.axisFieldModule.render(),this.updateChartAxisHeight();this.parent.showToolbar&&"Both"===this.parent.displayOption.view&&(i="Table"===this.parent.currentView?".e-chart-grouping-bar":".e-pivot-grouping-bar",a=this.parent.element.querySelector(i))&&(a.style.display="none")}}},ch.prototype.updateChartAxisHeight=function(){var e,t,i,a,r;this.groupingChartTable&&Ue.select("#"+this.parent.element.id+"_chart",this.parent.element)&&(e=this.groupingChartTable.querySelector("."+Mr),t=this.groupingChartTable.querySelector("."+Or),i=this.groupingChartTable.querySelector("."+Pr),a=this.groupingChartTable.querySelector("."+Dr),e&&a&&(e.style.height="auto",a.style.height="auto",0<e.offsetHeight)&&0<a.offsetHeight&&(r=(e.offsetHeight>a.offsetHeight?e:a).offsetHeight,Ue.setStyleAttribute(e,{height:Ue.formatUnit(r)}),Ue.setStyleAttribute(a,{height:Ue.formatUnit(r)})),t)&&i&&(t.style.height="auto",i.style.height="auto",0<t.offsetHeight)&&0<i.offsetHeight&&(r=(t.offsetHeight>i.offsetHeight?t:i).offsetHeight,Ue.setStyleAttribute(t,{height:Ue.formatUnit(r)}),Ue.setStyleAttribute(i,{height:Ue.formatUnit(r)}))},ch.prototype.refreshUI=function(){if(this.groupingChartTable&&(Ue.setStyleAttribute(this.groupingChartTable,{width:Ue.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingChartTable.querySelector("."+Ba)&&null!=this.chartPanel&&!this.chartPanel.isDestroyed&&(e=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2,this.chartPanel.width=e<400?"398px":e,this.chartPanel.refreshOverflow()),this.updateChartAxisHeight(),this.parent.showFieldList)&&this.parent.pivotFieldListModule&&this.parent.pivotFieldListModule.element&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.alignIcon.bind(this))),this.groupingTable){var e=this.groupingTable.getElementsByClassName(Or+" "+Cr)[0],t=(Ue.setStyleAttribute(this.groupingTable,{width:Ue.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingTable&&this.groupingTable.querySelector("."+Ba)&&null!=this.gridPanel&&!this.gridPanel.isDestroyed&&(t=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2,this.gridPanel.width=t<400?"398px":t,this.gridPanel.refreshOverflow()),this.groupingTable.style.minWidth="400px",this.parent.element.querySelector("."+Yn).querySelector("colgroup").children[0]),t=this.parent.isTabular?this.rowAxisWidth:parseInt(t.style.width,10),i=Ue.formatUnit(this.groupingTable.offsetWidth-t);if(Ue.setStyleAttribute(e,{width:t+"px"}),Ue.setStyleAttribute(this.rightAxisPanel,{width:i}),this.parent.showFieldList&&this.parent.pivotFieldListModule&&this.parent.pivotFieldListModule.element&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.alignIcon.bind(this))),!this.parent.grid.element.querySelector(".e-group-row")){e=this.parent.element.querySelector("."+Yn).querySelector(".e-columnheader"),t=(Ue.addClass([e.querySelector("."+en)],"e-group-row"),Ue.setStyleAttribute(this.rowPanel,{height:this.parent.element.querySelector("."+Yn).offsetHeight+"px"}),e.querySelector(".e-group-row").appendChild(this.rowAxisPanel),Ue.setStyleAttribute(e.querySelector(".e-group-row").querySelector(".e-headercelldiv"),{display:"none"}),Ue.setStyleAttribute(e.querySelector(".e-group-row").querySelector(".e-sortfilterdiv"),{display:"none"}),this.parent.element.querySelector("."+Yn).offsetHeight);Ue.setStyleAttribute(this.rowPanel,{height:t+"px"}),this.parent.element.querySelector("."+Yn).querySelector(".e-rhandler")&&(this.parent.element.querySelector("."+Yn).querySelector(".e-rhandler").style.height=t+"px");for(var i=[].slice.call(this.parent.element.querySelector("."+Yn).querySelector("thead").querySelectorAll("tr")).filter(function(e){return 0<e.childNodes.length}),a=t/i.length,r=0,n=i;r<n.length;r++){var s=n[r];Ue.setStyleAttribute(s,{height:a+"px"});for(var o=0,l=[].slice.call(s.querySelectorAll(".e-rhandler"));o<l.length;o++){var d=l[o];d.parentElement.parentElement.querySelector("."+Ds)||Ue.setStyleAttribute(d,{height:a+"px"})}}}}},ch.prototype.alignIcon=function(){var e,t,i;this.parent.pivotFieldListModule&&(e=this.parent.pivotFieldListModule.element,i=void 0,i="Table"===this.parent.currentView?this.parent.grid?this.parent.grid.element.offsetWidth:i:this.parent.chart?this.parent.pivotChartModule.getCalulatedWidth():i)&&(t=i<(t=this.parent.isAdaptive?300:400)?t:i,Ue.setStyleAttribute(e.querySelector("."+Fa),{left:Ue.formatUnit(this.parent.enableRtl?-Math.abs(t-e.querySelector("."+Fa).offsetWidth):t-e.querySelector("."+Fa).offsetWidth),top:this.parent.element.querySelector("."+Ga)?this.parent.element.querySelector("."+Fa).offsetHeight.toString()+"px":""}))},ch.prototype.setGridRowWidth=function(){var e=this.parent.element.querySelector("."+Yn).querySelector(".e-columnheader"),e=(Ue.addClass([e.querySelector("."+en)],"e-group-row"),e.querySelector(".e-group-row").appendChild(this.rowAxisPanel),this.parent.element.querySelector("."+Yn).querySelector("colgroup").children[0]);if(this.rowPanel.querySelector("."+Q))if(this.parent.isAdaptive){if(!this.parent.firstColWidth){if((i=this.parent.grid.columns)&&0<i.length)if(this.parent.isTabular){this.rowAxisWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth;for(var t=0;t<this.parent.engineModule.rowMaxLevel;t++)i[t].width=this.parent.gridSettings.columnWidth}else i[0].width=this.resColWidth;this.parent.posCount=0,this.parent.grid.headerModule.refreshUI()}}else{for(var i,a,r=[].slice.call(this.rowPanel.querySelectorAll("."+Qa)),r=r[r.length-1],n=this.parent.isTabular?0:r.querySelector(".e-indent-div").offsetWidth+20,r=r.querySelector("."+Q).offsetWidth+n,n=Ue.formatUnit(r<this.resColWidth?this.resColWidth:r),r=this.parent.element.querySelector("."+Yn).querySelector("."+en),s=this.parent.element.querySelector("."+Ya).querySelector("colgroup").children[0],o=parseInt(n,10),l=0<this.parent.pivotColumns.length,d=((i=this.parent.grid.columns)&&0<i.length&&(i[0].width=i[0].autoFit?i[0].width:o>this.resColWidth?o:this.resColWidth),void 0),d="olap"===this.parent.dataType?this.parent.renderModule.calculateColWidth(0<this.parent.olapEngineModule.pivotValues.length?this.parent.olapEngineModule.pivotValues[0].length:2):this.parent.renderModule.calculateColWidth(0<this.parent.dataSourceSettings.values.length&&0<this.parent.engineModule.pivotValues.length?this.parent.engineModule.pivotValues[0].length:2),p=0;p<i.length;p++)0!==p&&(i[p].columns?this.parent.setCommonColumnsWidth(this.parent.renderModule.pivotColumns[p].columns,d):"auto"!==i[p].width?(a=i[p].customAttributes?i[p].customAttributes.cell.valueSort.levelName:"",a=this.parent.renderModule.setSavedWidth(a,d),i[p].width=i[p].autoFit||l&&this.parent.pivotColumns[p].autoFit?i[p].width:this.parent.renderModule.lastColumn&&this.parent.renderModule.lastColumn.field===i[p].field?a-3:a):i[p].minWidth=d);this.parent.isTabular&&(o=this.rowAxisPanel.querySelectorAll("."+Qa),this.rowAxisWidth=this.getPivotButtonsTotalWidth(o),0===this.parent.engineModule.rowMaxLevel&&1===o.length&&(this.rowAxisWidth=250),.8*this.parent.element.getBoundingClientRect().width<=this.rowAxisWidth)&&(this.rowAxisWidth=o.length*this.parent.gridSettings.columnWidth),this.parent.posCount=0,this.parent.setGridColumns(this.parent.grid.columns),this.parent.grid.headerModule.refreshUI(),this.parent.firstColWidth||(n=i[0].autoFit?i[0].width.toString():n,e.style.width=n,s.style.width=n,r.style.width=n,Ue.setStyleAttribute(r,{width:n}))}else this.parent.grid.columns&&0<this.parent.grid.columns.length&&(this.parent.grid.columns[0].width=this.parent.grid.columns[0].width>this.resColWidth?this.parent.grid.columns[0].width:this.resColWidth),this.parent.grid.headerModule.refreshUI();(this.groupingTable||this.groupingChartTable)&&this.refreshUI()},ch.prototype.wireEvent=function(e){Ue.EventHandler.add(e,"mouseover",this.dropIndicatorUpdate,this),Ue.EventHandler.add(e,"mouseleave",this.dropIndicatorUpdate,this)},ch.prototype.unWireEvent=function(e){Ue.EventHandler.remove(e,"mouseover",this.dropIndicatorUpdate),Ue.EventHandler.remove(e,"mouseleave",this.dropIndicatorUpdate)},ch.prototype.dropIndicatorUpdate=function(e){(this.parent.isDragging&&e.target.classList.contains(vr)&&"mouseover"===e.type||!this.parent.isDragging||!e.target.classList.contains(vr)&&"mouseleave"===e.type)&&(Ue.removeClass([].slice.call(this.parent.element.querySelectorAll("."+nr)),sr),Ue.removeClass([].slice.call(this.parent.element.querySelectorAll("."+nr+"-last")),sr))},ch.prototype.tapHoldHandler=function(e){var t,e=Ue.closest(e.originalEvent.target,"."+Q);!Ue.isNullOrUndefined(e)&&this.parent.isAdaptive&&(t=e.getBoundingClientRect(),this.parent.contextMenuModule.fieldElement=e,this.parent.contextMenuModule.menuObj.open(t.top,t.left))},ch.prototype.RefreshFieldsPanel=function(){if("pivot"===this.parent.dataType&&null!=this.parent.groupingBarSettings){if(0<Ue.selectAll("#"+this.parent.element.id+"_AllFields",this.parent.element).length)for(var e=0,t=Ue.selectAll("#"+this.parent.element.id+"_AllFields",this.parent.element);e<t.length;e++)t[e].remove();this.parent.groupingBarSettings.showFieldsPanel&&(this.groupingChartTable&&"Table"!==this.parent.displayOption.view&&"Table"!==this.parent.groupingBarSettings.displayMode&&(this.chartPanel=this.createToolbarUI(this.groupingChartTable)),this.groupingTable&&(this.gridPanel=this.createToolbarUI(this.groupingTable)),this.parent.axisFieldModule.render(),this.refreshUI())}},ch.prototype.createToolbarUI=function(e){Ue.select("#"+this.parent.element.id+"_AllFields",e)&&Ue.select("#"+this.parent.element.id+"_AllFields",e).remove(),e.prepend(Ue.createElement("div",{id:this.parent.element.id+"_AllFields"}));var t=new O.Toolbar({cssClass:Ba+(this.parent.cssClass?" "+this.parent.cssClass:""),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,items:[{template:"<div class="+Tr+"></div>"}],allowKeyboard:!1,width:this.parent.gridSettings.allowAutoResizing?"auto":this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2});return t.appendTo(Ue.select("#"+this.parent.element.id+"_AllFields",e)),t},ch.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Pt,this.renderLayout,this),this.parent.on(wt,this.appendToElement,this))},ch.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(wt,this.appendToElement),this.parent.off(Pt,this.renderLayout))},ch.prototype.destroy=function(){this.removeEventListener(),this.parent.pivotButtonModule&&(this.parent.pivotButtonModule.destroy(),this.parent.pivotButtonModule=null),this.groupingTable&&this.groupingTable.querySelector("."+Ba)&&null!=this.gridPanel&&!this.gridPanel.isDestroyed&&(this.gridPanel.destroy(),this.gridPanel=null),this.groupingChartTable&&this.groupingChartTable.querySelector("."+Ba)&&null!=this.chartPanel&&!this.chartPanel.isDestroyed&&(this.chartPanel.destroy(),this.chartPanel=null),this.touchObj&&!this.touchObj.isDestroyed&&this.touchObj.destroy(),this.parent.element.querySelector("."+wr)&&Ue.remove(this.parent.element.querySelector("."+wr))},ch.prototype.getPivotButtonsTotalWidth=function(e){for(var t=0,i=0;i<e.length;i++)t+=(e[i].getBoundingClientRect().width<this.parent.gridSettings.columnWidth?this.parent.gridSettings.columnWidth:e[i].getBoundingClientRect().width)+6;return t};xl=ch;function ch(e){this.rowAxisWidth=0,this.parent=e,(this.parent.groupingBarModule=this).resColWidth=this.parent.isAdaptive?180:249,this.addEventListener(),this.parent.axisFieldModule=new hh(this.parent),this.touchObj=new Ue.Touch(this.parent.element,{tapHold:this.tapHoldHandler.bind(this)})}gh.prototype.getModuleName=function(){return"conditionalFormatting"},gh.prototype.createDialog=function(){null!==Ue.select("#"+this.parentID+"conditionalformatting",document)&&Ue.remove(Ue.select("#"+this.parentID+"conditionalformatting",document));var e=Ue.createElement("div",{id:this.parentID+"conditionalformatting",className:"e-pivot-formatting-dialog"}),t=(this.parent.element.appendChild(e),[{click:this.addButtonClick.bind(this),isFlat:!1,buttonModel:{cssClass:(this.parent.isAdaptive?"e-small e-round "+An:An)+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:z+" "+jr,content:this.parent.isAdaptive?"":this.parent.localeObj.getConstant("condition")}},{click:this.applyButtonClick.bind(this),isFlat:!1,buttonModel:{isPrimary:!0,cssClass:"e-format-apply-button"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("apply")}},{click:this.cancelButtonClick.bind(this),isFlat:!1,buttonModel:{cssClass:"e-format-cancel-button"+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}]),t=this.parent.isAdaptive?new P.Dialog({animationSettings:{effect:"Zoom"},isModal:!0,width:"100%",height:"100%",showCloseIcon:!1,closeOnEscape:!1,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,position:{X:"center",Y:"center"},allowDragging:!0,buttons:t,beforeOpen:this.beforeOpen.bind(this),close:this.removeDialog.bind(this),cssClass:this.parent.cssClass,header:this.parent.localeObj.getConstant("conditionalFormatting"),target:document.body}):new P.Dialog({allowDragging:!0,position:{X:"center",Y:this.parent.element.offsetTop},buttons:t,beforeOpen:this.beforeOpen.bind(this),close:this.removeDialog.bind(this),cssClass:this.parent.cssClass,isModal:!0,closeOnEscape:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,showCloseIcon:!0,header:this.parent.localeObj.getConstant("conditionalFormatting"),target:this.parent.element});t.isStringTemplate=!0,t.appendTo(e)},gh.prototype.beforeOpen=function(){Ue.select("#"+this.parentID+"conditionalformatting",document).querySelector("."+Vn).setAttribute("title",this.parent.localeObj.getConstant("conditionalFormatting"))},gh.prototype.addButtonClick=function(){var t=this,i=this;this.parent.trigger(ot,{conditions:"LessThan",value1:0,applyGrandTotals:!0,style:{backgroundColor:"white",color:"black",fontFamily:"Arial",fontSize:"12px"}},function(e){i.refreshConditionValues(),t.destroyColorPickers(),i.newFormat.push(e),i.addFormat()})},gh.prototype.applyButtonClick=function(){var e;this.refreshConditionValues()&&(this.parent.setProperties({dataSourceSettings:{conditionalFormatSettings:this.newFormat}},!0),e={conditionalFormattingInfo:this.parent.dataSourceSettings.conditionalFormatSettings},this.parent.actionObj.actionInfo=e,0<this.parent.dataSourceSettings.values.length&&this.parent.renderPivotGrid(),Ue.getInstance(Ue.select("#"+this.parentID+"conditionalformatting",document),P.Dialog).close())},gh.prototype.cancelButtonClick=function(){Ue.getInstance(Ue.select("#"+this.parentID+"conditionalformatting",document),P.Dialog).close(),this.newFormat=[]},gh.prototype.refreshConditionValues=function(){for(var e=0;e<this.newFormat.length;e++){if(""===Ue.select("#"+this.parentID+"conditionvalue1"+e,document).value||""===Ue.select("#"+this.parentID+"conditionvalue2"+e,document).value)return(""===Ue.select("#"+this.parentID+"conditionvalue1"+e,document).value?Ue.select("#"+this.parentID+"conditionvalue1"+e,document):Ue.select("#"+this.parentID+"conditionvalue2"+e,document)).focus(),!1;this.newFormat[e].value1=Number(Ue.select("#"+this.parentID+"conditionvalue1"+e,document).value),this.newFormat[e].value2=Number(Ue.select("#"+this.parentID+"conditionvalue2"+e,document).value)}return!0},gh.prototype.addFormat=function(){for(var e,t,i=Ue.createElement("div",{id:this.parentID+"formatDiv",className:"e-new-format"}),a=0;a<this.newFormat.length;a++)i.appendChild(this.createDialogElements(a));0===this.newFormat.length&&(e=this.createDialogElements(),(t=Ue.createElement("p",{id:this.parentID+"emptyFormat",className:"e-pivot-conditional-empty-format"})).innerText=this.parent.localeObj.getConstant("emptyFormat"),e.appendChild(t),i.appendChild(e)),Ue.getInstance(Ue.select("#"+this.parentID+"conditionalformatting",document),P.Dialog).setProperties({content:i},!1);for(a=0;a<this.newFormat.length;a++)this.renderDropDowns(a),this.renderColorPicker(a)},gh.prototype.createDialogElements=function(e){var t,i,a,r,n,s,o,l,d,p=Ue.createElement("div",{id:this.parentID+"outerDiv"+e,className:"e-format-outer-div"});return void 0!==e&&(n=this.newFormat[e],t=Ue.createElement("button",{id:this.parentID+"removeButton"+e,className:"e-format-delete-button",attrs:{type:"button",title:this.parent.localeObj.getConstant("delete")}}),p.appendChild(t),t=Ue.createElement("div",{id:this.parentID+"innerDiv"+e,className:"e-format-inner-div"}),o=Ue.createElement("table",{id:this.parentID+"_valueTable"+e,className:Rn,attrs:{role:"table"}}),r=Ue.createElement("tr"),a=Ue.createElement("td"),(l=Ue.createElement("span",{id:this.parentID+"valuelabel"+e,className:"e-format-value-label"})).innerText=this.parent.localeObj.getConstant("value"),a.appendChild(l),r.appendChild(a),o.appendChild(r),r=Ue.createElement("tr"),a=Ue.createElement("td"),l=Ue.createElement("div",{id:this.parentID+"measure"+e}),i=Ue.createElement("input",{id:this.parentID+"measureinput"+e,attrs:{type:"text",tabindex:"0"}}),l.appendChild(i),a.appendChild(l),r.appendChild(a),a=Ue.createElement("td"),i=Ue.createElement("div",{id:this.parentID+"condition"+e}),l=Ue.createElement("input",{id:this.parentID+"conditioninput"+e,attrs:{type:"text",tabindex:"0"}}),i.appendChild(l),a.appendChild(i),r.appendChild(a),a=Ue.createElement("td",{attrs:{style:"display:table"},className:"e-format-input-value"}),l="Between"!==n.conditions&&"NotBetween"!==n.conditions?jn:"",i=Ue.createElement("div",{attrs:{style:"display: table-row;"}}),d=Ue.createElement("div",{id:this.parentID+"ConditionValue1"+e,attrs:{style:"display: table-cell;"}}),s=Ue.createElement("input",{id:this.parentID+"conditionvalue1"+e,attrs:{type:"text",tabindex:"0",value:Ue.isNullOrUndefined(n.value1)?"0":n.value1.toString(),placeholder:this.parent.localeObj.getConstant("emptyInput")}}),d.appendChild(s),i.appendChild(d),s=Ue.createElement("span",{id:this.parentID+"valuespan"+e,className:"e-format-value-span "+l,innerHTML:"&"}),i.appendChild(s),d=Ue.createElement("div",{id:this.parentID+"ConditionValue2"+e,attrs:{style:"display: table-cell;"}}),l=Ue.createElement("input",{id:this.parentID+"conditionvalue2"+e,attrs:{type:"text",tabindex:"0",value:Ue.isNullOrUndefined(n.value2)?"0":n.value2.toString(),placeholder:this.parent.localeObj.getConstant("emptyInput")}}),d.appendChild(l),i.appendChild(d),a.appendChild(i),r.appendChild(a),o.appendChild(r),t.appendChild(o),s=Ue.createElement("table",{id:this.parentID+"_grandTotalTable"+e,className:Rn+" e-grandtotal-checkbox-table",attrs:{role:"table"}}),n=Ue.createElement("tr"),l=Ue.createElement("td"),s.appendChild(n),d=Ue.createElement("input",{id:this.parentID+"grandtotalcheckbox"+e,attrs:{type:"checkbox",tabindex:"0"}}),l.appendChild(d),n.appendChild(l),s.appendChild(n),t.appendChild(s),i=Ue.createElement("table",{id:this.parentID+"_formatTable"+e,className:Rn,attrs:{role:"table"}}),a=Ue.createElement("tr"),r=Ue.createElement("td"),(o=Ue.createElement("span",{id:this.parentID+"formatlabel"+e,className:"e-format-label"})).innerText=this.parent.localeObj.getConstant("formatLabel"),r.appendChild(o),a.appendChild(r),i.appendChild(a),a=Ue.createElement("tr"),r=Ue.createElement("td"),d=Ue.createElement("div",{id:this.parentID+"fontname"+e}),l=Ue.createElement("input",{id:this.parentID+"fontnameinput"+e,attrs:{type:"text",tabindex:"0"}}),d.appendChild(l),r.appendChild(d),a.appendChild(r),r=Ue.createElement("td"),n=Ue.createElement("div",{id:this.parentID+"fontsize"+e}),s=Ue.createElement("input",{id:this.parentID+"fontsizeinput"+e,attrs:{type:"text",tabindex:"0"}}),n.appendChild(s),r.appendChild(n),a.appendChild(r),this.parent.isAdaptive&&(i.appendChild(a),a=Ue.createElement("tr"),i.appendChild(a),a=Ue.createElement("tr")),r=Ue.createElement("td"),o=Ue.createElement("input",{id:this.parentID+"fontcolor"+e,attrs:{type:"color",tabindex:"0"},className:"e-format-font-color"}),r.appendChild(o),l=Ue.createElement("input",{id:this.parentID+"backgroundcolor"+e,attrs:{type:"color",tabindex:"0"},className:"e-format-back-color"}),r.appendChild(l),a.appendChild(r),r=Ue.createElement("td"),d=Ue.createElement("input",{id:this.parentID+"valuepreview"+e,className:kn+" e-format-value-preview",attrs:{tabindex:"-1",readonly:"true",value:"123.45"}}),r.appendChild(d),a.appendChild(r),i.appendChild(a),t.appendChild(i),p.appendChild(t)),p},gh.prototype.renderDropDowns=function(e){var t=Ue.getInstance(Ue.select("#"+this.parentID+"conditionalformatting",document),P.Dialog).element,i=this.newFormat[e],a=[];a.push({index:0,name:this.parent.localeObj.getConstant("AllValues"),field:this.parent.localeObj.getConstant("AllValues")});for(var r=0;r<this.parent.dataSourceSettings.values.length;r++){var n=this.parent.dataSourceSettings.values[r].caption||this.parent.dataSourceSettings.values[r].name,n=this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(n):n;a.push({index:r+1,name:n,field:this.parent.dataSourceSettings.values[r].name})}var s=Ue.isNullOrUndefined(i.measure)?this.parent.localeObj.getConstant("AllValues"):i.measure,o=[],o=(o[e]=new G.DropDownList({dataSource:a,fields:{text:"name",value:"field"},value:s,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.measureChange.bind(this,e)}),o[e].isStringTemplate=!0,o[e].appendTo(Ue.select("#"+this.parentID+"measureinput"+e,t)),[{value:"LessThan",name:this.parent.localeObj.getConstant("LessThan")},{value:"LessThanOrEqualTo",name:this.parent.localeObj.getConstant("LessThanOrEqualTo")},{value:"GreaterThan",name:this.parent.localeObj.getConstant("GreaterThan")},{value:"GreaterThanOrEqualTo",name:this.parent.localeObj.getConstant("GreaterThanOrEqualTo")},{value:"Equals",name:this.parent.localeObj.getConstant("Equals")},{value:"NotEquals",name:this.parent.localeObj.getConstant("NotEquals")},{value:"Between",name:this.parent.localeObj.getConstant("Between")},{value:"NotBetween",name:this.parent.localeObj.getConstant("NotBetween")}]),s=Ue.isNullOrUndefined(i.conditions)?"LessThan":i.conditions,l=[],o=(l[e]=new G.DropDownList({dataSource:o,fields:{value:"value",text:"name"},value:s,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.conditionChange.bind(this,e)}),l[e].isStringTemplate=!0,l[e].appendTo(Ue.select("#"+this.parentID+"conditioninput"+e,t)),"Between"!==this.newFormat[e].conditions&&"NotBetween"!==this.newFormat[e].conditions?jn:""),l=new V.TextBox({enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-format-value1 "+this.parent.cssClass,width:"auto"}),l=(l.isStringTemplate=!0,l.appendTo(Ue.select("#"+this.parentID+"conditionvalue1"+e,t)),new V.TextBox({enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-format-value2 "+o+" "+this.parent.cssClass,width:"auto"})),o=(l.isStringTemplate=!0,l.appendTo(Ue.select("#"+this.parentID+"conditionvalue2"+e,t)),new Y.CheckBox({label:this.parent.localeObj.getConstant("applyToGrandTotal"),checked:this.newFormat[e].applyGrandTotals,enableRtl:this.parent.enableRtl,locale:this.parent.locale,change:this.onCheckChange.bind(this,e),cssClass:this.parent.cssClass})),l=(o.isStringTemplate=!0,o.appendTo(Ue.select("#"+this.parentID+"grandtotalcheckbox"+e,t)),s=Ue.isNullOrUndefined(i.style.fontFamily)?"Arial":i.style.fontFamily,[]),o=(l[e]=new G.DropDownList({dataSource:[{index:0,name:"Arial"},{index:1,name:"San Serif"},{index:2,name:"Impact"},{index:3,name:"Trebuchet MS"},{index:4,name:"Serif"},{index:5,name:"Verdana"},{index:6,name:"Courier New"},{index:7,name:"Times New Roman"},{index:8,name:"Tahoma"},{index:9,name:"Gerogia"}],fields:{text:"name"},value:s,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.fontNameChange.bind(this,e)}),l[e].isStringTemplate=!0,l[e].appendTo(Ue.select("#"+this.parentID+"fontnameinput"+e,t)),s=Ue.isNullOrUndefined(i.style.fontSize)?"12px":i.style.fontSize,[]);o[e]=new G.DropDownList({dataSource:[{index:0,name:"9px"},{index:1,name:"10px"},{index:2,name:"11px"},{index:3,name:"12px"},{index:4,name:"13px"},{index:5,name:"14px"},{index:6,name:"15px"},{index:6,name:"16px"}],fields:{text:"name"},popupHeight:"200px",popupWidth:"auto",value:s,width:"100%",change:this.fontSizeChange.bind(this,e),locale:this.parent.locale,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass}),o[e].isStringTemplate=!0,o[e].appendTo(Ue.select("#"+this.parentID+"fontsizeinput"+e,t))},gh.prototype.conditionChange=function(e,t){this.newFormat[e].conditions=t.value;var i=Ue.select("#"+this.parentID+"valuespan"+e,document),e=Ue.select("#"+this.parentID+"conditionvalue2"+e,document);"Between"===t.value||"NotBetween"===t.value?(i.classList.remove(jn),e.parentElement.classList.remove(jn)):(i.classList.add(jn),e.parentElement.classList.add(jn))},gh.prototype.onCheckChange=function(e,t){this.newFormat[e].applyGrandTotals=t.checked},gh.prototype.fontNameChange=function(e,t){this.newFormat[e].style.fontFamily=t.value.toString(),Ue.select("#"+this.parentID+"valuepreview"+e,document).style.fontFamily=t.value},gh.prototype.fontSizeChange=function(e,t){this.newFormat[e].style.fontSize=t.value.toString(),Ue.select("#"+this.parentID+"valuepreview"+e,document).style.fontSize=t.value},gh.prototype.measureChange=function(e,t){this.newFormat[e].measure=t.value.toString()===this.parent.localeObj.getConstant("AllValues")?void 0:t.value.toString()},gh.prototype.renderColorPicker=function(e){var t=Ue.getInstance(Ue.select("#"+this.parentID+"conditionalformatting",document),P.Dialog).element,i=this.newFormat[e],a=Ue.isNullOrUndefined(i.style.color)?"black":i.style.color,r="#"===a.charAt(0)&&this.isHex(a.substr(1))?a:this.colourNameToHex(a),a=(Ue.select("#"+this.parentID+"valuepreview"+e,document).style.color=r,this.fontColor[e]=new V.ColorPicker({cssClass:qn+" e-format-font-color-picker"+(this.parent.cssClass?" "+this.parent.cssClass:""),value:r,mode:"Palette",change:this.fontColorChange.bind(this,e),locale:this.parent.locale,enableRtl:this.parent.enableRtl}),this.fontColor[e].isStringTemplate=!0,this.fontColor[e].appendTo(Ue.select("#"+this.parentID+"fontcolor"+e,t)),Ue.addClass([this.fontColor[e].element.nextElementSibling.querySelector(".e-selected-color")],z),r="#"===(a=Ue.isNullOrUndefined(i.style.backgroundColor)?"white":i.style.backgroundColor).charAt(0)&&this.isHex(a.substr(1))?a:this.colourNameToHex(a),Ue.select("#"+this.parentID+"valuepreview"+e,document).style.backgroundColor=r,Ue.select("#"+this.parentID+"valuepreview"+e,document).style.fontFamily=i.style.fontFamily,Ue.select("#"+this.parentID+"valuepreview"+e,document).style.fontSize=i.style.fontSize,this.backgroundColor[e]=new V.ColorPicker({cssClass:qn+(this.parent.cssClass?" "+this.parent.cssClass:""),value:r,mode:"Palette",change:this.backColorChange.bind(this,e),locale:this.parent.locale,enableRtl:this.parent.enableRtl}),this.backgroundColor[e].isStringTemplate=!0,this.backgroundColor[e].appendTo(Ue.select("#"+this.parentID+"backgroundcolor"+e,t)),Ue.addClass([this.backgroundColor[e].element.nextElementSibling.querySelector(".e-selected-color")],z),new Y.Button({iconCss:z+" e-format-delete-icon",cssClass:"e-flat"+(this.parent.cssClass?" "+this.parent.cssClass:""),locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}));a.isStringTemplate=!0,a.appendTo(Ue.select("#"+this.parentID+"removeButton"+e,t)),a.element.onclick=this.toggleButtonClick.bind(this,e)},gh.prototype.backColorChange=function(e,t){this.newFormat[e].style.backgroundColor=t.currentValue.hex,Ue.select("#"+this.parentID+"valuepreview"+e,document).style.backgroundColor=t.currentValue.hex},gh.prototype.fontColorChange=function(e,t){this.newFormat[e].style.color=t.currentValue.hex,Ue.select("#"+this.parentID+"valuepreview"+e,document).style.color=t.currentValue.hex},gh.prototype.toggleButtonClick=function(e){this.destroyColorPickers(),this.newFormat.splice(e,1),this.addFormat()},gh.prototype.isHex=function(e){for(var t=parseInt(e,16);"0"===e.charAt(0);)e=e.substr(1);return t.toString(16)===e.toLowerCase()||0===t&&""===e},gh.prototype.hexToRgb=function(e){e=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null},gh.prototype.colourNameToHex=function(e){var t={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",gold:"#ffd700",goldenrod:"#daa520",gray:"#808080",green:"#008000",greenyellow:"#adff2f",honeydew:"#f0fff0",hotpink:"#ff69b4","indianred ":"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavender:"#e6e6fa",lavenderblush:"#fff0f5",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgrey:"#d3d3d3",lightgreen:"#90ee90",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370d8",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#d87093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};if(void 0!==t[e.toLowerCase()])return t[e.toLowerCase()];if(0===e.search("rgba")){for(var i=e.substr(5).split(")")[0].split(","),a="",r=0;r<i.length-1;r++)i[r]=(+i[r]).toString(16),1===i[r].length&&(i[r]="0"+i[r]),a+=i[r];return"#"+a+Math.round(255*+i[3]).toString(16)}if(0!==e.search("rgb"))return"#d5d5d5";for(i=e.substr(4).split(")")[0].split(","),a="",r=0;r<i.length;r++)i[r]=(+i[r]).toString(16),1===i[r].length&&(i[r]="0"+i[r]),a+=i[r];return"#"+a},gh.prototype.removeDialog=function(){var e=Ue.select("#"+this.parentID+"conditionalformatting",document),t=e?Ue.getInstance(e,P.Dialog):null;t&&!t.isDestroyed&&(this.destroyColorPickers(),t.destroy()),e&&Ue.remove(e),this.fontColor=[],this.backgroundColor=[],this.newFormat=[]},gh.prototype.destroyColorPickers=function(){for(var e=0;e<(this.newFormat?this.newFormat.length:0);e++)this.fontColor&&this.fontColor[e]&&!this.fontColor[e].isDestroyed&&this.fontColor[e].destroy(),this.backgroundColor&&this.backgroundColor[e]&&!this.backgroundColor[e].isDestroyed&&this.backgroundColor[e].destroy()},gh.prototype.showConditionalFormattingDialog=function(){this.newFormat=[];for(var e=0;e<this.parent.dataSourceSettings.conditionalFormatSettings.length;e++)this.newFormat.push(Ue.extend({},this.parent.dataSourceSettings.conditionalFormatSettings[e].properties,null,!0));this.createDialog(),Ue.getInstance(Ue.select("#"+this.parentID+"conditionalformatting",document),P.Dialog).refresh(),this.addFormat()},gh.prototype.destroy=function(){var e=Ue.select("#"+this.parentID+"conditionalformatting",document),e=e?Ue.getInstance(e,P.Dialog):null;e&&!e.isDestroyed&&e.close()};yl=gh;function gh(e){this.parent=e,(this.parent.conditionalFormattingModule=this).parentID=this.parent.element.id,this.fontColor=[],this.backgroundColor=[],this.newFormat=[]}D.prototype.getModuleName=function(){return"toolbar"},D.prototype.createToolbar=function(){this.parent.isModified=!1,this.renderDialog(),null!==Ue.select("#"+this.parent.element.id+"pivot-toolbar",this.parent.element)&&Ue.remove(Ue.select("#"+this.parent.element.id+"pivot-toolbar",this.parent.element));var e=Ue.createElement("div",{id:this.parent.element.id+"pivot-toolbar",className:ss}),t=(this.parent.showFieldList&&Ue.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)?this.parent.element.insertBefore(e,Ue.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)):this.parent.showGroupingBar&&Ue.select("#"+this.parent.element.id+" .e-pivot-grouping-bar",this.parent.element)?this.parent.element.insertBefore(e,Ue.select("#"+this.parent.element.id+" .e-pivot-grouping-bar",this.parent.element)):this.parent.element.insertBefore(e,Ue.select("#"+this.parent.element.id+"_grid",this.parent.element)),this.toolbar=new O.Toolbar({created:this.create.bind(this),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,items:this.getItems(),allowKeyboard:!1,cssClass:this.parent.cssClass,width:this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()}),this.toolbar.isStringTemplate=!0,"viewContainerRef");this.parent[t]&&(Ue.setValue("registeredTemplate",{},this.toolbar),this.toolbar[t]=this.parent[t]),this.parent.toolbarTemplate&&"string"==typeof this.parent.toolbarTemplate?(this.toolbar.appendTo(this.parent.toolbarTemplate),this.parent.element.replaceChild(this.toolbar.element,this.parent.element.querySelector("."+ss)),this.toolbar.element.classList.add(ss)):this.toolbar.appendTo(e),this.toolbar.width=this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber(),this.parent.chart&&this.parent.chart.setProperties({width:(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()).toString()},!0),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+wr)&&this.parent.groupingBarModule.refreshUI()},D.prototype.fetchReports=function(){var e={reportName:[]};return this.parent.trigger(we,e),e},D.prototype.fetchReportsArgs=function(){var t=new K.Deferred;return this.parent.trigger(we,{reportName:[]},function(e){t.resolve(e)}),t},D.prototype.getItems=function(){for(var e=this.parent.toolbar.filter(function(e,t,i){return i.indexOf(e)===t}),t=[],i=0,a=e;i<a.length;i++){var r=a[i];switch(r){case"New":t.push({prefixIcon:"e-new-report "+z,tooltipText:this.parent.localeObj.getConstant("new"),click:this.actionClick.bind(this),id:this.parent.element.id+"new"});break;case"Save":t.push({prefixIcon:"e-save-report "+z,tooltipText:this.parent.localeObj.getConstant("save"),click:this.actionClick.bind(this),id:this.parent.element.id+"save"});break;case"SaveAs":t.push({prefixIcon:"e-saveas-report "+z,tooltipText:this.parent.localeObj.getConstant("saveAs"),click:this.actionClick.bind(this),id:this.parent.element.id+"saveas"});break;case"Rename":t.push({prefixIcon:"e-rename-report "+z,tooltipText:this.parent.localeObj.getConstant("rename"),click:this.actionClick.bind(this),id:this.parent.element.id+"rename"});break;case"Remove":t.push({prefixIcon:ns+" "+z,tooltipText:this.parent.localeObj.getConstant("deleteReport"),click:this.actionClick.bind(this),id:this.parent.element.id+"remove"});break;case"Load":t.push({template:"<div><input class=e-load-report id="+this.parent.element.id+"_reportlist></input></div>",click:this.actionClick.bind(this),id:this.parent.element.id+"load"});break;case"Grid":var n="Chart"===this.parent.displayOption.view;t.push({prefixIcon:ls+" "+z,tooltipText:this.parent.localeObj.getConstant("grid"),id:this.parent.element.id+"grid",cssClass:(n?b:"")+(this.parent.cssClass?" "+this.parent.cssClass:""),click:this.menuItemClick.bind(this)});break;case"Chart":n="Table"===this.parent.displayOption.view;t.push({template:'<ul id="'+this.parent.element.id+'chart_menu"></ul>',id:this.parent.element.id+"chartmenu",cssClass:(n?b:"")+(this.parent.cssClass?" "+this.parent.cssClass:"")});break;case"MDX":"olap"===this.parent.dataType&&t.push({prefixIcon:"e-mdx "+z,id:this.parent.element.id+"mdxQuery",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("mdxQuery")});break;case"Export":t.push({template:'<ul id="'+this.parent.element.id+'export_menu"></ul>',id:this.parent.element.id+"exportmenu"});break;case"SubTotal":t.push({template:'<ul id="'+this.parent.element.id+'subtotal_menu"></ul>',id:this.parent.element.id+"subtotalmenu"});break;case"GrandTotal":t.push({template:'<ul id="'+this.parent.element.id+'grandtotal_menu"></ul>',id:this.parent.element.id+"grandtotalmenu"});break;case"ConditionalFormatting":t.push({prefixIcon:"e-toolbar-formatting "+z,id:this.parent.element.id+"formatting",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("toolbarFormatting")});break;case"NumberFormatting":t.push({prefixIcon:"e-pivot-format-toolbar "+z,id:this.parent.element.id+"numberFormatting",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("numberFormat")});break;case"Formatting":t.push({template:'<ul id="'+this.parent.element.id+'formatting_menu"></ul>',id:this.parent.element.id+"formattingmenu"});break;case"FieldList":t.push({prefixIcon:"e-toolbar-fieldlist "+z,tooltipText:this.parent.localeObj.getConstant("fieldList"),click:this.actionClick.bind(this),align:"Right",id:this.parent.element.id+"fieldlist"}),this.parent.element.querySelector(".e-toggle-field-list")&&(this.parent.element.querySelector(".e-toggle-field-list").style.display="none");break;default:"object"==typeof r&&t.push(r)}}return this.parent.showFieldList&&-1===e.indexOf("FieldList")&&Ue.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)&&"none"===Ue.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element).style.display&&(Ue.select("#"+this.parent.element.id+"_PivotFieldList",this.parent.element).style.display="block"),this.parent.trigger(Pe,{customToolbar:t}),t},D.prototype.reportChange=function(e){if(this.parent.actionObj.actionName=mi,this.isReportChange=!0,this.parent.actionBeginMethod())e.cancel=!0;else try{this.dropArgs=e,this.parent.isModified&&""!==this.currentReport?this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("newReportConfirm")):this.reportLoad(e)}catch(e){this.parent.actionFailureMethod(e)}},D.prototype.reportLoad=function(e){var t,i=this;"Save"!==this.action&&"Rename"!==this.action&&"New"!==this.action&&(t={reportName:e.itemData.value},e={reportName:e.itemData.value},this.parent.actionObj.actionInfo=e,this.parent.trigger(Te,t,function(e){i.currentReport=e.reportName,i.parent.isModified=!1}))},D.prototype.saveReport=function(e){var t,i;this.currentReport&&""!==this.currentReport&&e.item.id===this.parent.element.id+"save"?(t={report:this.getCurrentReport(),reportName:this.currentReport},this.parent.actionObj.actionName=this.parent.getActionCompleteName(),i={reportName:this.currentReport},this.parent.actionObj.actionInfo=i,this.parent.trigger(xe,t),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.parent.isModified=!1):""!==this.currentReport||e.item.id!==this.parent.element.id+"save"&&e.item.id!==this.parent.element.id+"saveas"?this.dialogShow(e,"saveAs"):this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("emptyReport"))},D.prototype.mdxQueryDialog=function(){Ue.select("#"+this.parent.element.id+"mdx-dialog",document)||this.renderMDXDialog();var e=Ue.getInstance(Ue.select("#"+this.parent.element.id+"mdx-dialog",document),P.Dialog),t=Ue.createElement("div",{className:"e-mdx-query"}),i=Ue.createElement("textarea",{className:vs,attrs:{readonly:"readonly","aria-label":this.parent.localeObj.getConstant("mdxQuery")}});i.innerText=this.parent.olapEngineModule.getMDXQuery(this.parent.dataSourceSettings).trim(),t.appendChild(i),e.content=t,e.show()},D.prototype.dialogShow=function(e,t){var i,a,r;e&&((i=Ue.getInstance(Ue.select("#"+this.parent.element.id+"report-dialog",document),P.Dialog)).header=e.item.tooltipText,e=Ue.createElement("div",{className:"e-report-outer"}),(a=Ue.createElement("div",{className:"e-pivotview-report-label"})).innerText=this.parent.localeObj.getConstant("reportName"),(r=Ue.createElement("input",{className:os+" "+kn,attrs:{placeholder:this.parent.localeObj.getConstant("emptyReportName"),value:t&&"rename"===t?this.currentReport:""}})).innerText=t&&"rename"===t?this.currentReport:"",r.setSelectionRange(r.textContent.length,r.textContent.length),e.appendChild(a),e.appendChild(r),i.content=e,i.refresh(),i.show())},D.prototype.renameReport=function(e){this.parent.trigger(Ne,e),this.currentReport&&""!==this.currentReport?this.dialogShow(e,"rename"):this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("emptyReport"))},D.prototype.actionClick=function(e){var t=e.item.id===this.parent.element.id+"new"?Vt:e.item.id===this.parent.element.id+"save"?Ht:e.item.id===this.parent.element.id+"saveas"?_t:e.item.id===this.parent.element.id+"rename"?Ut:e.item.id===this.parent.element.id+"remove"?Bt:e.item.id===this.parent.element.id+"load"?Gt:e.item.id===this.parent.element.id+"formatting"?zt:e.item.id===this.parent.element.id+"numberFormatting"?Wt:e.item.id===this.parent.element.id+"mdxQuery"?Qt:e.item.id===this.parent.element.id+"fieldlist"?Yt:"";if(this.parent.actionObj.actionName=t,!this.parent.actionBeginMethod())try{switch(e.item.id){case this.parent.element.id+"save":case this.parent.element.id+"saveas":this.saveReport(e);break;case this.parent.element.id+"remove":return this.action="Remove",void(this.currentReport&&""!==this.currentReport?this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeConfirm")):this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("emptyReport")));case this.parent.element.id+"rename":this.renameReport(e);break;case this.parent.element.id+"new":this.action="New",this.newArgs=e,this.parent.isModified&&this.currentReport&&""!==this.currentReport?this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("newReportConfirm")):this.createNewReport(e);break;case this.parent.element.id+"load":this.action="Load";break;case this.parent.element.id+"fieldlist":this.parent.pivotFieldListModule&&this.parent.pivotFieldListModule.dialogRenderer&&this.parent.pivotFieldListModule.dialogRenderer.onShowFieldList();break;case this.parent.element.id+"formatting":this.parent.conditionalFormattingModule&&this.parent.conditionalFormattingModule.showConditionalFormattingDialog();break;case this.parent.element.id+"mdxQuery":this.mdxQueryDialog();break;case this.parent.element.id+"numberFormatting":this.parent.numberFormattingModule&&this.parent.numberFormattingModule.showNumberFormattingDialog()}}catch(e){this.parent.actionFailureMethod(e)}},D.prototype.renderDialog=function(){null!==Ue.select("#"+this.parent.element.id+"report-dialog",this.parent.element)&&Ue.remove(Ue.select("#"+this.parent.element.id+"report-dialog",this.parent.element));var e=Ue.createElement("div",{id:this.parent.element.id+"report-dialog",className:"e-pivotview-report-dialog"}),t=(this.parent.element.appendChild(e),new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,position:{X:"center",Y:"center"},buttons:[{click:this.okBtnClick.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:this.cancelBtnClick.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("cancel")}}],isModal:!0,visible:!1,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",zIndex:1000001,closeOnEscape:!0,target:document.body,cssClass:this.parent.cssClass}));t.isStringTemplate=!0,t.appendTo(e)},D.prototype.renderMDXDialog=function(){null!==Ue.select("#"+this.parent.element.id+"mdx-dialog",this.parent.element)&&Ue.remove(Ue.select("#"+this.parent.element.id+"mdx-dialog",this.parent.element));var e=Ue.createElement("div",{id:this.parent.element.id+"mdx-dialog",className:"e-pivotview-mdx-dialog"}),t=(this.parent.element.appendChild(e),new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,position:{X:"center",Y:"center"},buttons:[{click:this.copyMDXQuery.bind(this),isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("copy"),isPrimary:!0}}],header:this.parent.localeObj.getConstant("mdxQuery"),isModal:!0,visible:!1,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",zIndex:1000001,closeOnEscape:!0,target:document.body,cssClass:this.parent.cssClass}));t.isStringTemplate=!0,t.appendTo(e)},D.prototype.copyMDXQuery=function(){var e=Ue.getInstance(Ue.select("#"+this.parent.element.id+"mdx-dialog",document),P.Dialog).element.querySelector("."+vs);try{e.select(),document.execCommand("copy")}catch(e){window.alert("Oops, unable to copy")}},D.prototype.okBtnClick=function(){var r=this,e=Ue.getInstance(Ue.select("#"+this.parent.element.id+"report-dialog",document),P.Dialog),n=e.element.querySelector("."+os);if(n&&""===n.value)n.focus();else{if(this.parent.localeObj||(this.parent=Ue.getInstance(Ue.select("#"+this.parent.element.id,document),kp)),e.header!==this.parent.localeObj.getConstant("save")&&e.header!==this.parent.localeObj.getConstant("saveAs")||!n.value||""===n.value){if(e.header===this.parent.localeObj.getConstant("new")&&n.value&&""!==n.value){this.action="New",this.currentReport=n.value;var s=!1,o=this,l={reportName:[]};this.parent.trigger(we,l,function(e){for(var t,i,a=0;a<e.reportName.length;a++)if(n.value===l.reportName[a]){s=!0;break}s?o.createConfirmDialog(o.parent.localeObj.getConstant("alert"),o.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+n.value+'"'+o.parent.localeObj.getConstant("replaceConfirmAfter")):(o.parent.trigger(Oe),t={report:o.getCurrentReport(),reportName:n.value},i={reportName:n.value},r.parent.actionObj.actionInfo=i,o.parent.trigger(xe,t),o.parent.isModified=!1,o.updateReportList(),Ue.getInstance(Ue.select("#"+r.parent.element.id+"report-dialog",document),P.Dialog).hide())})}else if(e.header===this.parent.localeObj.getConstant("rename")&&n.value&&""!==n.value){if(this.currentReport===n.value)return void e.hide();for(var t=!(this.action="Rename"),i=(this.renameText=n.value,this.fetchReports()),a=0;a<i.reportName.length;a++)if(n.value===i.reportName[a]){t=!0;break}if(t)return void this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+n.value+'"'+this.parent.localeObj.getConstant("replaceConfirmAfter"));var d={reportName:this.currentReport,rename:n.value},p={reportName:{oldName:this.currentReport,newName:n.value}};this.parent.actionObj.actionInfo=p,this.parent.trigger(Me,d),this.currentReport=n.value,this.updateReportList(),e.hide()}}else{this.action="Save",this.currentReport=n.value;var h=!1,u=this,i={reportName:[]};this.parent.trigger(we,i,function(e){for(var t,i,a=0;a<e.reportName.length;a++)if(n.value===e.reportName[a]){h=!0;break}h?u.createConfirmDialog(u.parent.localeObj.getConstant("alert"),u.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+n.value+'"'+u.parent.localeObj.getConstant("replaceConfirmAfter")):(t={report:u.getCurrentReport(),reportName:n.value},i={reportName:n.value},r.parent.actionObj.actionInfo=i,u.parent.trigger(xe,t),u.parent.isModified=!1,u.updateReportList(),Ue.getInstance(Ue.select("#"+r.parent.element.id+"report-dialog",document),P.Dialog).hide())})}this.parent.actionObj.actionName=this.parent.getActionCompleteName(),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()}},D.prototype.createNewReport=function(e){this.dialogShow(e)},D.prototype.cancelBtnClick=function(){Ue.getInstance(Ue.select("#"+this.parent.element.id+"report-dialog",document),P.Dialog).hide()},D.prototype.createConfirmDialog=function(e,t){document.getElementById(this.parent.element.id+"_ConfirmDialog")&&Ue.remove(document.getElementById(this.parent.element.id+"_ConfirmDialog").parentElement);var i=Ue.createElement("div",{id:this.parent.element.id+"_ConfirmDialog",className:fr}),t=(this.parent.element.appendChild(i),new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,header:e,content:t,isModal:!0,visible:!0,closeOnEscape:!0,target:document.body,cssClass:this.parent.cssClass,width:"auto",height:"auto",position:{X:"center",Y:"center"},buttons:[{isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("yes"),isPrimary:!0,cssClass:mr+(this.parent.cssClass?" "+this.parent.cssClass:"")},click:this.okButtonClick.bind(this)},{isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("no"),cssClass:Sr+(this.parent.cssClass?" "+this.parent.cssClass:"")},click:this.cancelButtonClick.bind(this)}]}));t.isStringTemplate=!0,t.appendTo(i),t.element.querySelector(".e-dlg-header").innerText=this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(e):e},D.prototype.okButtonClick=function(){var e,t,i,a,r=this,n=Ue.getInstance(Ue.select("#"+this.parent.element.id+"report-dialog",document),P.Dialog);"Remove"===this.action?(e={reportName:this.currentReport},t={reportName:this.currentReport},this.parent.actionObj.actionInfo=t,this.parent.trigger(De,e),(e=this.fetchReports()).reportName&&0<e.reportName.length?(a={reportName:e.reportName[e.reportName.length-1]},this.parent.trigger(Te,a,function(e){r.currentReport=e.reportName,r.parent.isModified=!1}),this.currentReport=e.reportName[e.reportName.length-1]):(this.currentReport="",this.parent.isModified=!1,this.action=""),this.updateReportList(),this.parent.actionObj.actionName=Hi,this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()):"New"===this.action||"Save"!==this.action&&"Rename"!==this.action&&"New"!==this.action?this.currentReport&&""!==this.currentReport&&this.parent.isModified?(i={report:this.getCurrentReport(),reportName:this.currentReport},t={reportName:this.currentReport},this.parent.actionObj.actionInfo=t,this.parent.actionObj.actionName=ki,this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.parent.trigger(xe,i),this.parent.isModified=!1,"New"===this.action?(this.parent.actionObj.actionName=Vt,this.createNewReport(this.newArgs)):(this.parent.actionObj.actionName=mi,this.reportLoad(this.dropArgs))):"New"===this.action&&(this.parent.trigger(Oe),i={report:this.getCurrentReport(),reportName:this.currentReport},this.parent.trigger(xe,i),this.parent.isModified=!1,this.updateReportList(),n.hide()):"Save"===this.action?(i={report:this.getCurrentReport(),reportName:this.currentReport},this.parent.trigger(xe,i),this.parent.isModified=!1,this.updateReportList(),n.hide()):"Rename"===this.action&&(a={reportName:this.currentReport,rename:this.renameText,isReportExists:!0},this.parent.trigger(Me,a),this.currentReport=this.renameText,this.parent.isModified=!1,this.updateReportList(),n.hide()),Ue.getInstance(Ue.select("#"+this.parent.element.id+"_ConfirmDialog",document),P.Dialog).hide()},D.prototype.cancelButtonClick=function(){var e,t=Ue.getInstance(Ue.select("#"+this.parent.element.id+"report-dialog",document),P.Dialog);"New"===this.action?this.parent.isModified?this.createNewReport(this.newArgs):t.hide():"Save"===this.action?(Ue.select("#"+this.parent.element.id+"_reportlist",this.parent.element)&&(e=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_reportlist",this.parent.element),G.DropDownList),this.currentReport=e.value),t.hide()):"Rename"===this.action?t.hide():this.dropArgs&&"Remove"!==this.action&&this.reportLoad(this.dropArgs),Ue.getInstance(Ue.select("#"+this.parent.element.id+"_ConfirmDialog",document),P.Dialog).hide()},D.prototype.createChartMenu=function(){var e=this;if(Ue.select("#"+this.parent.element.id+"chart_menu",this.parent.element)){for(var t=Ue.select("#"+this.parent.element.id+"chart_menu",this.parent.element),i=[],a=this.getValidChartType(),r=0;r<a.length&&r<7;r++){var n=a[r];i.push({text:this.parent.localeObj.getConstant(n.toLowerCase()),id:this.parent.element.id+"_"+n})}7===i.length&&(i.splice(6),i.push({text:this.parent.localeObj.getConstant("MoreOption"),id:this.parent.element.id+"_ChartMoreOption"}));var s=i.length<=0||"Table"===this.parent.displayOption.view,s=(i.push({separator:!0}),i.push({text:this.parent.localeObj.getConstant("multipleAxes"),id:this.parent.element.id+"_multipleAxes"}),i.push({text:this.parent.localeObj.getConstant("showLegend"),id:this.parent.element.id+"_showLegend"}),[{iconCss:ds+" "+z,items:s?[]:i}]),o=t?Ue.getInstance(t,O.Menu):null;o&&!o.isDestroyed&&(o.destroy(),o=null),(o=new O.Menu({items:s,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:Cs+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.whitespaceRemove.bind(this),onClose:function(){e.focusToolBar()},beforeItemRender:this.multipleAxesCheckbox.bind(this)})).isStringTemplate=!0,o.appendTo(t)}},D.prototype.create=function(){var e,t,i=this,a=(Ue.select("#"+this.parent.element.id+"chart_menu",this.parent.element)&&this.createChartMenu(),Ue.select("#"+this.parent.element.id+"export_menu",this.parent.element)&&(e=Ue.select("#"+this.parent.element.id+"export_menu",this.parent.element),a=[{iconCss:"e-export "+z,items:[{text:this.parent.localeObj.getConstant("pdf"),iconCss:is+" "+z,id:this.parent.element.id+"pdf"},{text:this.parent.localeObj.getConstant("excel"),iconCss:as+" "+z,id:this.parent.element.id+"excel"},{text:this.parent.localeObj.getConstant("csv"),iconCss:rs+" "+z,id:this.parent.element.id+"csv"},{text:this.parent.localeObj.getConstant("png"),iconCss:"e-pivotview-png-export "+z,id:this.parent.element.id+"png"},{text:this.parent.localeObj.getConstant("jpeg"),iconCss:"e-pivotview-jpeg-export "+z,id:this.parent.element.id+"jpeg"},{text:this.parent.localeObj.getConstant("svg"),iconCss:"e-pivotview-svg-export "+z,id:this.parent.element.id+"svg"}]}],(t=new O.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:Cs+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateExportMenu.bind(this),onClose:function(){i.focusToolBar()}})).isStringTemplate=!0,t.appendTo(e)),Ue.select("#"+this.parent.element.id+"subtotal_menu",this.parent.element)&&(t=Ue.select("#"+this.parent.element.id+"subtotal_menu",this.parent.element),a=[{iconCss:"e-sub-total "+z,items:[{text:this.parent.localeObj.getConstant("showSubTotals"),id:this.parent.element.id+"subtotal",iconCss:s+" "+z},{text:this.parent.localeObj.getConstant("doNotShowSubTotals"),id:this.parent.element.id+"notsubtotal",iconCss:s+" "+z},{text:this.parent.localeObj.getConstant("showSubTotalsRowsOnly"),id:this.parent.element.id+"subtotalrow",iconCss:s+" "+z},{text:this.parent.localeObj.getConstant("showSubTotalsColumnsOnly"),id:this.parent.element.id+"subtotalcolumn",iconCss:s+" "+z},{separator:!0},{text:this.parent.localeObj.getConstant("subTotalPosition"),id:this.parent.element.id+"subtotalpositions",iconCss:r+" "+z,items:[{text:this.parent.localeObj.getConstant("auto"),id:this.parent.element.id+"sub-none-position",iconCss:s+" "+z},{text:this.parent.localeObj.getConstant("top"),id:this.parent.element.id+"sub-top-position",iconCss:s+" "+z},{text:this.parent.localeObj.getConstant("bottom"),id:this.parent.element.id+"sub-bottom-position",iconCss:s+" "+z}]}]}],(e=new O.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:Cs+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateSubtotalSelection.bind(this),onClose:function(){i.focusToolBar()}})).isStringTemplate=!0,e.appendTo(t)),Ue.select("#"+this.parent.element.id+"grandtotal_menu",this.parent.element)&&(e=Ue.select("#"+this.parent.element.id+"grandtotal_menu",this.parent.element),a=[{iconCss:"e-grand-total "+z,items:[{text:this.parent.localeObj.getConstant("showGrandTotals"),id:this.parent.element.id+"grandtotal",iconCss:s+" "+z},{text:this.parent.localeObj.getConstant("doNotShowGrandTotals"),id:this.parent.element.id+"notgrandtotal",iconCss:s+" "+z},{text:this.parent.localeObj.getConstant("showGrandTotalsRowsOnly"),id:this.parent.element.id+"grandtotalrow",iconCss:s+" "+z},{text:this.parent.localeObj.getConstant("showGrandTotalsColumnsOnly"),id:this.parent.element.id+"grandtotalcolumn",iconCss:s+" "+z},{separator:!0},{text:this.parent.localeObj.getConstant("grandTotalPosition"),id:this.parent.element.id+"grandtotalpositions",iconCss:r+" "+z,items:[{text:this.parent.localeObj.getConstant("top"),id:this.parent.element.id+"top-position",iconCss:s+" "+z},{text:this.parent.localeObj.getConstant("bottom"),id:this.parent.element.id+"bottom-position",iconCss:s+" "+z}]}]}],(t=new O.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:Cs+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateGrandtotalSelection.bind(this),onClose:function(){i.focusToolBar()}})).isStringTemplate=!0,t.appendTo(e)),Ue.select("#"+this.parent.element.id+"formatting_menu",this.parent.element)&&(t=Ue.select("#"+this.parent.element.id+"formatting_menu",this.parent.element),a=[{iconCss:"e-pivot-format-menu "+z,items:[{text:this.parent.localeObj.getConstant("numberFormatMenu"),iconCss:"e-pivot-number-format-menu "+z,id:this.parent.element.id+"numberFormattingMenu"},{text:this.parent.localeObj.getConstant("conditionalFormattingMenu"),iconCss:"e-pivot-conditional-format-menu "+z,id:this.parent.element.id+"conditionalFormattingMenu"}]}],(e=new O.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:Cs+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this)})).isStringTemplate=!0,e.appendTo(t)),{report:this.parent.getPersistData(),reportName:this.parent.localeObj.getConstant("defaultReport")});this.currentReport=this.parent.localeObj.getConstant("defaultReport"),this.parent.trigger(xe,a),Ue.select("#"+this.parent.element.id+"_reportlist",this.parent.element)&&(e=Ue.select("#"+this.parent.element.id+"_reportlist",this.parent.element),t=this.fetchReports(),(a=new G.DropDownList({dataSource:t.reportName,width:"150px",popupHeight:"200px",placeholder:""===this.currentReport?this.parent.localeObj.getConstant("reportList"):"",enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-reportlist-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.reportChange.bind(this),value:this.currentReport})).isStringTemplate=!0,a.appendTo(e)),this.updateItemElements()},D.prototype.getCurrentReport=function(){var e,t=this.parent.getPersistData();return"CSV"===this.parent.dataSourceSettings.type&&"Server"!==this.parent.dataSourceSettings.mode&&((e=JSON.parse(t)).dataSourceSettings.dataSource.splice(0,0,this.parent.engineModule.fields),t=JSON.stringify(e)),t},D.prototype.updateItemElements=function(){for(var e=0,t=[].slice.call(this.toolbar.element.querySelectorAll(".e-toolbar-item"));e<t.length;e++){var i=t[e];i.querySelector("button")?i.querySelector("button").setAttribute("tabindex","0"):i.querySelector(".e-menu.e-menu-parent")&&(i.querySelector(".e-menu.e-menu-parent").setAttribute("tabindex","-1"),i.querySelector(".e-menu-item.e-menu-caret-icon"))&&i.querySelector(".e-menu-item.e-menu-caret-icon").setAttribute("tabindex","0")}},D.prototype.whitespaceRemove=function(e){e=e.element.querySelector(".e-separator");e&&(e.style.margin="0px")},D.prototype.multipleAxesCheckbox=function(e){var t,i,a,r=this;this.parent.element.id+"_multipleAxes"===e.element.id?((t=Ue.createElement("input",{id:this.parent.element.id+"_checkBox"})).style.display="none",this.parent.element.appendChild(t),i=new Y.CheckBox({label:this.parent.localeObj.getConstant("multipleAxes"),cssClass:"e-multipleAxes"+(this.parent.cssClass?" "+this.parent.cssClass:""),checked:this.parent.chartSettings.enableMultipleAxis,change:function(){document.getElementById(r.parent.element.id+"_multipleAxes").click()},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),e.element.innerText="",i.appendTo(t),-1<["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)&&!e.element.classList.contains(b)?(e.element.classList.add(b),i.disabled=!0):["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)<0&&e.element.classList.contains(b)&&(e.element.classList.remove(b),i.disabled=!1),a=this.parent.element.querySelector("."+Qn+".e-multipleAxes"),e.element.appendChild(a)):this.parent.element.id+"_showLegend"===e.element.id&&((t=Ue.createElement("input",{id:this.parent.element.id+"_showLegendCheckBox"})).style.display="none",this.parent.element.appendChild(t),i=new Y.CheckBox({label:this.parent.localeObj.getConstant("showLegend"),checked:this.getLableState(),cssClass:"e-showLegend"+(this.parent.cssClass?" "+this.parent.cssClass:""),change:function(){document.getElementById(r.parent.element.id+"_showLegend").click()},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),e.element.innerText="",i.appendTo(t),a=this.parent.element.querySelector("."+Qn+".e-showLegend"),e.element.appendChild(a))},D.prototype.getLableState=function(){var e=JSON.parse(this.parent.getChartSettings()).chartSettings;return e&&e.legendSettings&&void 0!==e.legendSettings.visible?this.showLableState=e.legendSettings.visible:this.showLableState=!0,this.showLableState},D.prototype.getAllChartItems=function(){return["Line","Column","Area","Bar","StackingColumn","StackingArea","StackingBar","StackingLine","StepLine","StepArea","SplineArea","Scatter","Spline","StackingColumn100","StackingBar100","StackingArea100","StackingLine100","Bubble","Pareto","Polar","Radar","Pie","Pyramid","Funnel","Doughnut"]},D.prototype.updateExportMenu=function(e){e=[].slice.call(e.element.querySelectorAll("li"));"Table"===this.parent.currentView?(Ue.addClass(e.slice(3),Nn),Ue.removeClass(e.slice(1,3),Nn)):(Ue.addClass(e.slice(1,3),Nn),Ue.removeClass(e.slice(3),Nn))},D.prototype.updateSubtotalSelection=function(e){e.parentItem.id!==this.parent.element.id+"subtotalpositions"?(Ue.select("#"+this.parent.element.id+"subtotal ."+s,e.element).classList.contains(r)||Ue.select("#"+this.parent.element.id+"subtotal ."+s,e.element).classList.add(r),Ue.select("#"+this.parent.element.id+"notsubtotal ."+s,e.element).classList.contains(r)||Ue.select("#"+this.parent.element.id+"notsubtotal ."+s,e.element).classList.add(r),Ue.select("#"+this.parent.element.id+"subtotalrow ."+s,e.element).classList.contains(r)||Ue.select("#"+this.parent.element.id+"subtotalrow ."+s,e.element).classList.add(r),Ue.select("#"+this.parent.element.id+"subtotalcolumn ."+s,e.element).classList.contains(r)||Ue.select("#"+this.parent.element.id+"subtotalcolumn ."+s,e.element).classList.add(r),this.parent.dataSourceSettings.showSubTotals&&this.parent.dataSourceSettings.showRowSubTotals&&!this.parent.dataSourceSettings.showColumnSubTotals?Ue.select("#"+this.parent.element.id+"subtotalrow ."+s,e.element).classList.remove(r):this.parent.dataSourceSettings.showSubTotals&&!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?Ue.select("#"+this.parent.element.id+"subtotalcolumn ."+s,e.element).classList.remove(r):this.parent.dataSourceSettings.showSubTotals&&this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?Ue.select("#"+this.parent.element.id+"subtotal ."+s,e.element).classList.remove(r):this.parent.dataSourceSettings.showSubTotals&&(this.parent.dataSourceSettings.showRowSubTotals||this.parent.dataSourceSettings.showColumnSubTotals)||Ue.select("#"+this.parent.element.id+"notsubtotal ."+s,e.element).classList.remove(r)):(Ue.select("#"+this.parent.element.id+"sub-none-position ."+s,e.element).classList.add(r),"Auto"===this.parent.dataSourceSettings.subTotalsPosition&&Ue.select("#"+this.parent.element.id+"sub-none-position ."+s,e.element).classList.remove(r),Ue.select("#"+this.parent.element.id+"sub-top-position ."+s,e.element).classList.add(r),"Top"===this.parent.dataSourceSettings.subTotalsPosition&&Ue.select("#"+this.parent.element.id+"sub-top-position ."+s,e.element).classList.remove(r),Ue.select("#"+this.parent.element.id+"sub-bottom-position ."+s,e.element).classList.add(r),"Bottom"===this.parent.dataSourceSettings.subTotalsPosition&&Ue.select("#"+this.parent.element.id+"sub-bottom-position ."+s,e.element).classList.remove(r))},D.prototype.updateGrandtotalSelection=function(e){e.parentItem.id!==this.parent.element.id+"grandtotalpositions"?(Ue.select("#"+this.parent.element.id+"grandtotal ."+s,e.element).classList.contains(r)||Ue.select("#"+this.parent.element.id+"grandtotal ."+s,e.element).classList.add(r),Ue.select("#"+this.parent.element.id+"notgrandtotal ."+s,e.element).classList.contains(r)||Ue.select("#"+this.parent.element.id+"notgrandtotal ."+s,e.element).classList.add(r),Ue.select("#"+this.parent.element.id+"grandtotalrow ."+s,e.element).classList.contains(r)||Ue.select("#"+this.parent.element.id+"grandtotalrow ."+s,e.element).classList.add(r),Ue.select("#"+this.parent.element.id+"grandtotalcolumn ."+s,e.element).classList.contains(r)||Ue.select("#"+this.parent.element.id+"grandtotalcolumn ."+s,e.element).classList.add(r),this.parent.dataSourceSettings.showGrandTotals&&this.parent.dataSourceSettings.showRowGrandTotals&&!this.parent.dataSourceSettings.showColumnGrandTotals?Ue.select("#"+this.parent.element.id+"grandtotalrow ."+s,e.element).classList.remove(r):this.parent.dataSourceSettings.showGrandTotals&&!this.parent.dataSourceSettings.showRowGrandTotals&&this.parent.dataSourceSettings.showColumnGrandTotals?Ue.select("#"+this.parent.element.id+"grandtotalcolumn ."+s,e.element).classList.remove(r):this.parent.dataSourceSettings.showGrandTotals&&this.parent.dataSourceSettings.showRowGrandTotals&&this.parent.dataSourceSettings.showColumnGrandTotals?Ue.select("#"+this.parent.element.id+"grandtotal ."+s,e.element).classList.remove(r):this.parent.dataSourceSettings.showGrandTotals&&(this.parent.dataSourceSettings.showRowGrandTotals||this.parent.dataSourceSettings.showColumnGrandTotals)||Ue.select("#"+this.parent.element.id+"notgrandtotal ."+s,e.element).classList.remove(r)):(Ue.select("#"+this.parent.element.id+"top-position ."+s,e.element).classList.add(r),"Top"===this.parent.dataSourceSettings.grandTotalsPosition&&Ue.select("#"+this.parent.element.id+"top-position ."+s,e.element).classList.remove(r),Ue.select("#"+this.parent.element.id+"bottom-position ."+s,e.element).classList.add(r),"Bottom"===this.parent.dataSourceSettings.grandTotalsPosition&&Ue.select("#"+this.parent.element.id+"bottom-position ."+s,e.element).classList.remove(r))},D.prototype.updateReportList=function(){var e,t;Ue.select("#"+this.parent.element.id+"_reportlist",this.parent.element)&&(e=this.fetchReports(),(t=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_reportlist",this.parent.element),G.DropDownList)).dataSource=e.reportName,""===this.currentReport&&0<t.dataSource.length?(t.value=t.dataSource[t.dataSource.length-1],t.text=t.dataSource[t.dataSource.length-1],this.currentReport=t.dataSource[t.dataSource.length-1]):(t.value=this.currentReport,t.text=this.currentReport),t.refresh())},D.prototype.menuItemClick=function(e){var t,i,a=this,r={},n=e.item.id===this.parent.element.id+"grid"?Kt:e.item.id===this.parent.element.id+"_Column"||e.item.id===this.parent.element.id+"_Bar"||e.item.id===this.parent.element.id+"_Line"||e.item.id===this.parent.element.id+"_Area"||e.item.id===this.parent.element.id+"_Scatter"||e.item.id===this.parent.element.id+"_Polar"||e.item.id===this.parent.element.id+"_ChartMoreOption"?Xt:e.item.id===this.parent.element.id+"_multipleAxes"?Jt:e.item.id===this.parent.element.id+"_showLegend"?Zt:e.item.id===this.parent.element.id+"pdf"?$t:e.item.id===this.parent.element.id+"png"?ei:e.item.id===this.parent.element.id+"excel"?ti:e.item.id===this.parent.element.id+"csv"?ii:e.item.id===this.parent.element.id+"jpeg"?ai:e.item.id===this.parent.element.id+"svg"?ri:e.item.id===this.parent.element.id+"notsubtotal"?ni:e.item.id===this.parent.element.id+"subtotalrow"?si:e.item.id===this.parent.element.id+"subtotalcolumn"?oi:e.item.id===this.parent.element.id+"subtotal"?li:e.item.id===this.parent.element.id+"notgrandtotal"?di:e.item.id===this.parent.element.id+"grandtotalrow"?pi:e.item.id===this.parent.element.id+"grandtotalcolumn"?hi:e.item.id===this.parent.element.id+"grandtotal"?ui:e.item.id===this.parent.element.id+"numberFormattingMenu"?ci:e.item.id===this.parent.element.id+"conditionalFormattingMenu"?gi:"";if(this.parent.actionObj.actionName=n,!this.parent.actionBeginMethod()){(-1<this.getAllChartItems().indexOf(e.item.id.split(this.parent.element.id+"_")[1])||"ChartMoreOption"===e.item.id.split(this.parent.element.id+"_")[1]||"multipleAxes"===e.item.id.split(this.parent.element.id+"_")[1]||"showLegend"===e.item.id.split(this.parent.element.id+"_")[1])&&(t=e.item.id.split(this.parent.element.id+"_")[1]);try{switch(e.item.id){case this.parent.element.id+"grid":this.parent.grid&&this.parent.chart&&(this.parent.grid.element.style.display="",this.parent.chart.element.style.display="none",this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.enableScrollOnMultiAxis&&(this.parent.element.querySelector(".e-pivotchart").style.display="none"),this.parent.currentView="Table",this.parent.setProperties({displayOption:{primary:"Table"}},!0),this.parent.showGroupingBar&&this.parent.groupingBarModule&&(this.parent.element.querySelector(".e-pivot-grouping-bar")&&(this.parent.element.querySelector(".e-pivot-grouping-bar").style.display=""),this.parent.element.querySelector(".e-chart-grouping-bar"))&&(this.parent.element.querySelector(".e-chart-grouping-bar").style.display="none"),i={toolbarInfo:{displayOption:this.parent.displayOption,gridSettings:this.parent.gridSettings}},this.parent.actionObj.actionInfo=i,this.parent.layoutRefresh());break;case this.parent.element.id+"pdf":"Table"===this.parent.currentView?this.parent.pdfExport({fileName:"Export.pdf"},!1,void 0,!1):this.parent.chartExport("PDF",{fileName:"result"},void 0,null,void 0);break;case this.parent.element.id+"excel":r={excelExportProperties:{fileName:"Export.xlsx"},isBlob:void 0,isMultipleExport:void 0,workbook:void 0},this.parent.trigger(B,r,function(e){a.parent.excelExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"csv":r={excelExportProperties:{fileName:"Export.csv"},isBlob:!1,isMultipleExport:!1,workbook:void 0},this.parent.trigger(B,r,function(e){"Server"===a.parent.dataSourceSettings.mode?a.parent.getEngine("onCsvExport",null,null,null,null,null,null,null,null,e.excelExportProperties):a.parent.csvExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"png":this.parent.chartExport("PNG",{fileName:"result"},void 0,null,void 0);break;case this.parent.element.id+"jpeg":this.parent.chartExport("JPEG",{fileName:"result"},void 0,null,void 0);break;case this.parent.element.id+"svg":this.parent.chartExport("SVG",{fileName:"result"},void 0,null,void 0);break;case this.parent.element.id+"notsubtotal":this.parent.setProperties({dataSourceSettings:{showSubTotals:!1,showColumnSubTotals:!1,showRowSubTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"subtotalrow":this.parent.setProperties({dataSourceSettings:{showSubTotals:!0,showColumnSubTotals:!1,showRowSubTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"subtotalcolumn":this.parent.setProperties({dataSourceSettings:{showSubTotals:!0,showColumnSubTotals:!0,showRowSubTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"subtotal":this.parent.setProperties({dataSourceSettings:{showSubTotals:!0,showColumnSubTotals:!0,showRowSubTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"notgrandtotal":this.parent.setProperties({dataSourceSettings:{showGrandTotals:!1,showColumnGrandTotals:!1,showRowGrandTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"grandtotalrow":this.parent.setProperties({dataSourceSettings:{showGrandTotals:!0,showColumnGrandTotals:!1,showRowGrandTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"grandtotalcolumn":this.parent.setProperties({dataSourceSettings:{showGrandTotals:!0,showColumnGrandTotals:!0,showRowGrandTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"grandtotal":this.parent.setProperties({dataSourceSettings:{showGrandTotals:!0,showColumnGrandTotals:!0,showRowGrandTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"top-position":this.parent.setProperties({dataSourceSettings:{grandTotalsPosition:"Top"}},!0),this.parent.refreshData();break;case this.parent.element.id+"bottom-position":this.parent.setProperties({dataSourceSettings:{grandTotalsPosition:"Bottom"}},!0),this.parent.refreshData();break;case this.parent.element.id+"sub-top-position":this.parent.setProperties({dataSourceSettings:{subTotalsPosition:"Top"}},!0),this.parent.refreshData();break;case this.parent.element.id+"sub-bottom-position":this.parent.setProperties({dataSourceSettings:{subTotalsPosition:"Bottom"}},!0),this.parent.refreshData();break;case this.parent.element.id+"sub-none-position":this.parent.setProperties({dataSourceSettings:{subTotalsPosition:"Auto"}},!0),this.parent.refreshData();break;case this.parent.element.id+"numberFormattingMenu":this.parent.numberFormattingModule&&this.parent.numberFormattingModule.showNumberFormattingDialog();break;case this.parent.element.id+"conditionalFormattingMenu":this.parent.conditionalFormattingModule&&this.parent.conditionalFormattingModule.showConditionalFormattingDialog();break;case this.parent.element.id+"_"+t:e.item&&e.item.text&&("ChartMoreOption"===t?this.createChartTypeDialog():"multipleAxes"===t?(this.parent.chartSettings.enableScrollOnMultiAxis&&(this.isMultiAxisChange=!0),this.parent.chartSettings.enableMultipleAxis=!this.parent.chartSettings.enableMultipleAxis,this.updateChartType(this.parent.chartSettings.chartSeries.type,!0)):-1<this.getAllChartItems().indexOf(t)?this.updateChartType(t,!1):"showLegend"===t&&(this.parent.chart.legendSettings.visible=!this.showLableState,this.parent.chartSettings.legendSettings?this.parent.chartSettings.legendSettings.visible=!this.showLableState:this.parent.setProperties({chartSettings:{legendSettings:{visible:!this.showLableState}}},!0),this.updateChartType(this.parent.chartSettings.chartSeries.type,!0)))}}catch(e){this.parent.actionFailureMethod(e)}}},D.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(It,this.createToolbar,this)},D.prototype.getValidChartType=function(){for(var e=[],t=0;t<=this.parent.chartTypes.length;t++){var i=this.parent.chartTypes[t];-1<this.getAllChartItems().indexOf(i)&&e.indexOf(i)<0&&e.push(i)}return e},D.prototype.createChartTypeDialog=function(){var e=this,t=this.parent.element.appendChild(Ue.createElement("div",{id:this.parent.element.id+"_ChartTypeDialog",className:"e-pivotchart-type-dialog"})),i=new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("chartTypeSettings"),content:this.getDialogContent(),isModal:!0,beforeOpen:this.beforeOpen.bind(this),visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"auto",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:function(){e.chartTypeDialogUpdate()},isFlat:!1,buttonModel:{cssClass:mr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){e.removeDialog()},isFlat:!1,buttonModel:{cssClass:Sr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:!0,target:this.parent.element,cssClass:this.parent.cssClass,close:this.removeDialog.bind(this)});i.isStringTemplate=!0,i.appendTo(t)},D.prototype.removeDialog=function(){var e=Ue.select("#"+this.parent.element.id+"_ChartTypeDialog",this.parent.element)?Ue.getInstance(Ue.select("#"+this.parent.element.id+"_ChartTypeDialog",this.parent.element),P.Dialog):null;e&&!e.isDestroyed&&e.destroy(),document.getElementById(this.parent.element.id+"_ChartTypeDialog")&&Ue.remove(document.getElementById(this.parent.element.id+"_ChartTypeDialog"))},D.prototype.chartTypeDialogUpdate=function(){var e=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_ChartTypeOption"),G.DropDownList).value,t=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_DialogMultipleAxis"),Y.CheckBox).checked,i=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_DialogShowLabel"),Y.CheckBox).checked;this.parent.chart.legendSettings.visible=i,this.chartLableState&&(this.parent.chart.legendSettings.visible=i,this.parent.chartSettings.legendSettings?this.parent.chartSettings.legendSettings.visible=i:this.parent.setProperties({chartSettings:{legendSettings:{visible:i}}},!0)),this.updateChartType(e,!1),this.parent.chartSettings.enableMultipleAxis=t,this.parent.chartSettings.multipleAxisMode=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_AxisModeOption"),G.DropDownList).value,(Ue.select("#"+this.parent.element.id+"_ChartTypeDialog",document)?Ue.getInstance(Ue.select("#"+this.parent.element.id+"_ChartTypeDialog",document),P.Dialog):null).close()},D.prototype.updateChartType=function(e,t){-1<this.getAllChartItems().indexOf(e)&&this.parent.chart&&(this.parent.currentView="Chart",this.parent.setProperties({displayOption:{primary:"Chart"}},!0),this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&(this.parent.element.querySelector("."+ps).style.width=Ue.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()),this.parent.element.querySelector("."+ps).style.height=Ue.formatUnit(this.parent.pivotChartModule.getChartHeight())),this.parent.chart.setProperties({width:Ue.formatUnit(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()),height:Ue.formatUnit(this.parent.pivotChartModule.getChartHeight())},!0),this.parent.chartSettings.chartSeries.type!==e||t?this.parent.chartSettings.chartSeries.type=e:this.parent.chart.refresh(),t={toolbarInfo:{displayOption:this.parent.displayOption,chartSettings:this.parent.chartSettings}},this.parent.actionObj.actionInfo=t)},D.prototype.getDialogContent=function(){for(var e=Ue.createElement("div",{className:"e-chart-type-div-content"}),t=Ue.createElement("div",{className:"e-chart-type-option-container"}),i=Ue.createElement("div",{className:"e-multiple-axes-mode-container"}),a=Ue.createElement("div",{className:"e-chart-type-option-text"}),r=(a.innerText=this.parent.localeObj.getConstant("ChartType"),Ue.createElement("div",{className:"e-multiple-axes-mode-text"})),n=(r.innerText=this.parent.localeObj.getConstant("multipleAxisMode"),Ue.createElement("div",{id:this.parent.element.id+"_ChartTypeOption"})),s=Ue.createElement("div",{id:this.parent.element.id+"_AxisModeOption"}),o=(t.appendChild(a),t.appendChild(n),[]),a=[{value:"Stacked",text:this.parent.localeObj.getConstant("stacked")},{value:"Single",text:this.parent.localeObj.getConstant("single")},{value:"Combined",text:this.parent.localeObj.getConstant("combined")}],l=this.getValidChartType(),d=0;d<l.length;d++)o.push({value:l[d],text:this.parent.localeObj.getConstant(l[d].toLowerCase())});var p=new G.DropDownList({dataSource:o,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:this.parent.chartSettings.chartSeries.type||this.getValidChartType()[0],width:"100%",change:this.changeDropDown.bind(this),cssClass:this.parent.cssClass}),p=(p.isStringTemplate=!0,p.appendTo(n),e.appendChild(t),Ue.createElement("input",{id:this.parent.element.id+"_DialogMultipleAxis",attrs:{type:"checkbox"}})),n=(e.appendChild(p),Ue.createElement("input",{id:this.parent.element.id+"_DialogShowLabel",attrs:{type:"checkbox"}})),t=(e.appendChild(n),i.appendChild(r),i.appendChild(s),e.appendChild(i),new G.DropDownList({dataSource:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:this.parent.chartSettings.multipleAxisMode||"Stacked",width:"100%",enabled:this.parent.chartSettings.enableMultipleAxis,cssClass:this.parent.cssClass}));return t.isStringTemplate=!0,t.appendTo(s),e},D.prototype.changeDropDown=function(e){var t=JSON.parse(this.parent.getChartSettings()).chartSettings;t&&t.legendSettings&&void 0!==t.legendSettings.visible||(Ue.getInstance(Ue.select("#"+this.parent.element.id+"_DialogShowLabel"),Y.CheckBox).checked=!0),-1<["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(e.value.toString())?(Ue.getInstance(Ue.select("#"+this.parent.element.id+"_DialogMultipleAxis"),Y.CheckBox).disabled=!0,Ue.getInstance(Ue.select("#"+this.parent.element.id+"_AxisModeOption"),G.DropDownList).enabled=!1):((t=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_DialogMultipleAxis"),Y.CheckBox)).disabled=!1,Ue.getInstance(Ue.select("#"+this.parent.element.id+"_AxisModeOption"),G.DropDownList).enabled=t.checked)},D.prototype.beforeOpen=function(){var t=this,e=new Y.CheckBox({label:this.parent.localeObj.getConstant("multipleAxes"),cssClass:"e-dialog-multiple-axis"+(this.parent.cssClass?" "+this.parent.cssClass:""),checked:this.parent.chartSettings.enableMultipleAxis||!1,change:function(e){Ue.getInstance(Ue.select("#"+t.parent.element.id+"_AxisModeOption"),G.DropDownList).enabled=e.checked},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),i=new Y.CheckBox({label:this.parent.localeObj.getConstant("showLegend"),checked:this.getLableState(),change:function(){t.chartLableState=!0},cssClass:"e-dialog-show-legend"+(this.parent.cssClass?" "+this.parent.cssClass:""),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),a=Ue.select("#"+this.parent.element.id+"_ChartTypeDialog",document)?Ue.getInstance(Ue.select("#"+this.parent.element.id+"_ChartTypeDialog",document),P.Dialog):null,i=(i.appendTo(Ue.select("#"+this.parent.element.id+"_DialogShowLabel",a.element)),e.appendTo(Ue.select("#"+this.parent.element.id+"_DialogMultipleAxis",a.element)),-1<["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)&&(e.disabled=!0,Ue.getInstance(Ue.select("#"+this.parent.element.id+"_AxisModeOption"),G.DropDownList).enabled=!1),JSON.parse(this.parent.getChartSettings()).chartSettings);i&&i.legendSettings&&void 0!==i.legendSettings.visible?this.chartLableState=!0:this.chartLableState=!1},D.prototype.refreshToolbar=function(){this.destroy(),this.createToolbar()},D.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(It,this.createToolbar)},D.prototype.destroy=function(){this.removeEventListener();var e=Ue.select("#"+this.parent.element.id+"_ConfirmDialog",document),t=e?Ue.getInstance(e,P.Dialog):null,t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=Ue.select("#"+this.parent.element.id+"report-dialog",document))?Ue.getInstance(e,P.Dialog):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=Ue.select("#"+this.parent.element.id+"mdx-dialog",document))?Ue.getInstance(e,P.Dialog):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=Ue.select("#"+this.parent.element.id+"chart_menu",document))?Ue.getInstance(e,O.Menu):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=Ue.select("#"+this.parent.element.id+"_ChartTypeDialog",document))?Ue.getInstance(e,P.Dialog):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=Ue.select("#"+this.parent.element.id+"export_menu",document))?Ue.getInstance(e,O.Menu):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=Ue.select("#"+this.parent.element.id+"subtotal_menu",document))?Ue.getInstance(e,O.Menu):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=Ue.select("#"+this.parent.element.id+"grandtotal_menu",document))?Ue.getInstance(e,O.Menu):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=Ue.select("#"+this.parent.element.id+"formatting_menu",document))?Ue.getInstance(e,O.Menu):null),t=(t&&!t.isDestroyed&&(t.destroy(),t=null),(e=Ue.select("#"+this.parent.element.id+"_reportlist",document))?Ue.getInstance(e,G.DropDownList):null);t&&!t.isDestroyed&&(t.destroy(),t=null),this.toolbar&&!this.toolbar.isDestroyed&&(this.toolbar.destroy(),this.toolbar=null),(e=Ue.select("#"+this.parent.element.id+"pivot-toolbar",document))&&Ue.remove(e)},D.prototype.focusToolBar=function(){Ue.removeClass(document.querySelector("."+ss).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),Ue.removeClass(document.querySelector("."+ss).querySelectorAll(".e-menu-item.e-selected"),"e-selected"),document.querySelector(".e-toolbar-items")&&Ue.addClass([document.querySelector(".e-toolbar-items")],"e-focused")};Fl=D;function D(e){this.isMultiAxisChange=!1,this.isReportChange=!1,this.currentReport="",this.parent=e,(this.parent.toolbarModule=this).addEventListener()}mh.prototype.getModuleName=function(){return"numberFormatting"},mh.prototype.showNumberFormattingDialog=function(){for(var e,t=this,i=Ue.createElement("div",{id:this.parent.element.id+"_FormatDialog",className:"e-pivot-format-dialog"}),a=(this.parent.element.appendChild(i),this.dialog=new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("numberFormat"),content:this.getDialogContent(),isModal:!0,visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"320px",height:"auto",position:{X:"center",Y:"center"},buttons:[{click:this.updateFormatting.bind(this),isFlat:!1,buttonModel:{cssClass:mr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("apply"),isPrimary:!0}},{click:function(){t.dialog.hide()},isFlat:!1,buttonModel:{cssClass:Sr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:!0,cssClass:this.parent.cssClass,target:this.parent.element,close:this.removeDialog.bind(this)}),this.dialog.isStringTemplate=!0,this.dialog.appendTo(i),this.dialog.element.querySelector("."+Vn).innerText=this.parent.localeObj.getConstant("numberFormat"),this.newFormat=[{name:this.parent.localeObj.getConstant("AllValues"),format:"N0",useGrouping:!0,type:void 0}],[]),r=0;r<this.parent.dataSourceSettings.formatSettings.length;r++)e={name:this.parent.dataSourceSettings.formatSettings[r].name,format:this.parent.dataSourceSettings.formatSettings[r].format,useGrouping:this.parent.dataSourceSettings.formatSettings[r].useGrouping,type:this.parent.dataSourceSettings.formatSettings[r].type},this.newFormat.push(e);for(r=0;r<this.newFormat.length;r++)a.push(this.newFormat[r].name);for(var n=0;n<this.parent.dataSourceSettings.values.length;n++)-1===a.indexOf(this.parent.dataSourceSettings.values[n].name)&&(e={name:this.parent.dataSourceSettings.values[n].name,format:"N0",useGrouping:!0},this.newFormat.push(e));this.renderControls()},mh.prototype.getDialogContent=function(){var e=Ue.createElement("div",{id:this.parent.element.id+"_FormatDialogOuter",className:"e-pivot-format-dialog-outer"}),t=Ue.createElement("table",{id:this.parent.element.id+"_FormatTable",className:"e-pivot-format-table",attrs:{role:"tableItems"}}),i=Ue.createElement("tr"),a=Ue.createElement("td"),r=Ue.createElement("div",{id:this.parent.element.id+"_FormatValueLable",className:"e-pivot-format-value-lable"}),n=(r.innerText=this.parent.localeObj.getConstant("values"),Ue.createElement("div",{id:this.parent.element.id+"_FormatValueDrop"})),r=(a.appendChild(r),a.appendChild(n),i.appendChild(a),t.appendChild(i),i=Ue.createElement("tr"),a=Ue.createElement("td"),Ue.createElement("div",{id:this.parent.element.id+"_FormatLable",className:"e-pivot-format-lable"})),n=(r.innerText=this.parent.localeObj.getConstant("formatType"),Ue.createElement("div",{id:this.parent.element.id+"_FormatDrop"})),r=(a.appendChild(r),a.appendChild(n),i.appendChild(a),t.appendChild(i),i=Ue.createElement("tr"),a=Ue.createElement("td"),Ue.createElement("div",{id:this.parent.element.id+"_GroupingLable",className:"e-pivot-format-grouping-lable"})),n=(r.innerText=this.parent.localeObj.getConstant("grouping"),Ue.createElement("div",{id:this.parent.element.id+"_GroupingDrop"})),r=(a.appendChild(r),a.appendChild(n),i.appendChild(a),t.appendChild(i),i=Ue.createElement("tr"),a=Ue.createElement("td"),Ue.createElement("div",{id:this.parent.element.id+"_DecimalLable",className:"e-pivot-format-decimal-lable"})),n=(r.innerText=this.parent.localeObj.getConstant("decimalPlaces"),Ue.createElement("div",{id:this.parent.element.id+"_DecimalDrop"}));return a.appendChild(r),a.appendChild(n),i.appendChild(a),t.appendChild(i),i=Ue.createElement("tr"),a=Ue.createElement("td"),this.customLable=Ue.createElement("div",{id:this.parent.element.id+"_CustomLable",className:"e-pivot-format-custom-lable"}),this.customLable.innerText=this.parent.localeObj.getConstant("customFormatString"),this.customText=Ue.createElement("input",{id:this.parent.element.id+"_CustomText",attrs:{type:"text",tabindex:"0"},className:kn+" e-pivot-format-custom-text"}),a.appendChild(this.customLable),a.appendChild(this.customText),i.appendChild(a),t.appendChild(i),i=Ue.createElement("tr"),t.appendChild(i),e.appendChild(t),e},mh.prototype.renderControls=function(){var e,t,i,a;if(Ue.select("#"+this.parent.element.id+"_FormatValueDrop",this.dialog.element)){var r=[];r.push({index:0,name:this.parent.localeObj.getConstant("AllValues"),field:this.parent.localeObj.getConstant("AllValues")});for(var n=0;n<this.parent.dataSourceSettings.values.length;n++){var s=this.parent.dataSourceSettings.values[n].caption||this.parent.dataSourceSettings.values[n].name,s=this.parent.enableHtmlSanitizer?Ue.SanitizeHtmlHelper.sanitize(s):s;r.push({index:n+1,name:s,field:this.parent.dataSourceSettings.values[n].name})}(e=new G.DropDownList({dataSource:r,fields:{text:"name",value:"field"},enableRtl:this.parent.enableRtl,locale:this.parent.locale,index:0,cssClass:"e-pivot-format-value-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),change:this.valueChange.bind(this),width:"100%",open:this.customUpdate.bind(this)})).isStringTemplate=!0,e.appendTo(Ue.select("#"+this.parent.element.id+"_FormatValueDrop",this.dialog.element))}Ue.select("#"+this.parent.element.id+"_FormatDrop",this.dialog.element)&&(t=[{index:0,name:this.parent.localeObj.getConstant("number")},{index:1,name:this.parent.localeObj.getConstant("currency")},{index:2,name:this.parent.localeObj.getConstant("percentage")},{index:3,name:this.parent.localeObj.getConstant("Custom")}],(a=new G.DropDownList({dataSource:t,fields:{text:"name",value:"name"},index:0,change:this.dropDownChange.bind(this),enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-pivot-format-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%"})).isStringTemplate=!0,a.appendTo(Ue.select("#"+this.parent.element.id+"_FormatDrop",this.dialog.element))),Ue.select("#"+this.parent.element.id+"_GroupingDrop",this.dialog.element)&&(t=[{index:0,name:this.parent.localeObj.getConstant("true")},{index:1,name:this.parent.localeObj.getConstant("false")}],(i=new G.DropDownList({dataSource:t,fields:{text:"name",value:"name"},enableRtl:this.parent.enableRtl,locale:this.parent.locale,index:0,cssClass:"e-pivot-format-grouping-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:this.groupingChange.bind(this)})).isStringTemplate=!0,i.appendTo(Ue.select("#"+this.parent.element.id+"_GroupingDrop",this.dialog.element))),Ue.select("#"+this.parent.element.id+"_DecimalDrop",this.dialog.element)&&((i=new G.DropDownList({dataSource:t=[{index:0,name:0},{index:1,name:1},{index:2,name:2},{index:3,name:3},{index:4,name:4},{index:5,name:5},{index:6,name:6},{index:7,name:7},{index:8,name:8},{index:9,name:9},{index:10,name:10}],fields:{text:"name",value:"name"},enableRtl:this.parent.enableRtl,locale:this.parent.locale,index:0,cssClass:"e-pivot-format-decimal-drop"+(this.parent.cssClass?" "+this.parent.cssClass:""),popupHeight:150,width:"100%",change:this.decimalChange.bind(this)})).isStringTemplate=!0,i.appendTo(Ue.select("#"+this.parent.element.id+"_DecimalDrop",this.dialog.element))),a.value!==this.parent.localeObj.getConstant("Custom")&&(this.customText.disabled=!0),0!==this.lastFormattedValue.length&&(e.value=this.lastFormattedValue[0].name,i=""===(t=this.lastFormattedValue[0].format)?"":t.split("")[0].toLowerCase(),a=this.lastFormattedValue[0].useGrouping?this.parent.localeObj.getConstant("true"):this.parent.localeObj.getConstant("false"),this.updateFormattingDialog(t,i,a))},mh.prototype.valueChange=function(e){for(var t=this.newFormat,i=!1,a=0;a<t.length;a++)if(t[a].name===e.value){var r=t[a].format,n=""===r?"":r.split("")[0].toLowerCase(),s=t[a].useGrouping?this.parent.localeObj.getConstant("true"):this.parent.localeObj.getConstant("false");this.updateFormattingDialog(r,n,s),i=!0;break}i||(Ue.getInstance(Ue.select("#"+this.parent.element.id+"_FormatDrop",this.parent.element),G.DropDownList).value=this.parent.localeObj.getConstant("number"),Ue.getInstance(Ue.select("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),G.DropDownList).value=0,Ue.getInstance(Ue.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),G.DropDownList).value=this.parent.localeObj.getConstant("true"))},mh.prototype.updateFormattingDialog=function(e,t,i){var a=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_FormatDrop",this.parent.element),G.DropDownList);2===e.length&&-1<["n","p","c"].indexOf(t)?(a.value="n"===t?this.parent.localeObj.getConstant("number"):"p"===t?this.parent.localeObj.getConstant("percentage"):"c"===t?this.parent.localeObj.getConstant("currency"):this.parent.localeObj.getConstant("number"),Ue.getInstance(Ue.select("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),G.DropDownList).value=Number(e.split("")[1]),Ue.getInstance(Ue.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),G.DropDownList).value=i):(a.value=this.parent.localeObj.getConstant("Custom"),this.customText.value=e)},mh.prototype.customUpdate=function(){var e;Ue.getInstance(Ue.select("#"+this.parent.element.id+"_FormatDrop",this.parent.element),G.DropDownList).value===this.parent.localeObj.getConstant("Custom")&&(e=this.getIndexValue(),this.newFormat[e].format=this.customText.value)},mh.prototype.dropDownChange=function(e){var t=this.getIndexValue(),i=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),G.DropDownList),a=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),G.DropDownList);e.value===this.parent.localeObj.getConstant("Custom")?(this.customText.disabled=!1,i.enabled=!1,a.enabled=!1,this.newFormat[t].format=this.customText.value):(e=this.formattedText(),this.newFormat[t].format=e,this.customText.disabled=!0,i.enabled=!0,a.enabled=!0,this.customText.value="")},mh.prototype.groupingChange=function(){var e=this.getIndexValue(),t=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),G.DropDownList);this.newFormat[e].useGrouping=t.value===this.parent.localeObj.getConstant("true")},mh.prototype.getIndexValue=function(){for(var e=[],t=0;t<this.newFormat.length;t++)e.push(this.newFormat[t].name);var i=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_FormatValueDrop",this.parent.element),G.DropDownList);return e.indexOf(i.value.toString())},mh.prototype.decimalChange=function(){var e=this.getIndexValue(),t=this.formattedText();this.newFormat[e].format=t},mh.prototype.formattedText=function(){var e=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_FormatDrop",this.parent.element),G.DropDownList),t=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),G.DropDownList);return e.value===this.parent.localeObj.getConstant("number")||e.value===this.parent.localeObj.getConstant("percentage")||e.value===this.parent.localeObj.getConstant("currency")?(e.value===this.parent.localeObj.getConstant("number")?"N":e.value===this.parent.localeObj.getConstant("currency")?"C":"P")+t.value:this.customText.value},mh.prototype.removeDialog=function(){this.dialog&&!this.dialog.isDestroyed&&this.dialog.destroy(),document.getElementById(this.parent.element.id+"_FormatDialog")&&Ue.remove(document.getElementById(this.parent.element.id+"_FormatDialog"))},mh.prototype.updateFormatting=function(){for(var t=this,e=this.formattedText(),i=this.getIndexValue(),a=(this.newFormat=this.newFormat.splice(i,1),Ue.extend([],this.newFormat,!0)),r=this.parent.dataSourceSettings.formatSettings,n=0;n<r.length;n++)this.insertFormat(r[n].name,r[n].format,r[n].type,r[n].currency,r[n].useGrouping);i=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_FormatValueDrop",this.parent.element),G.DropDownList);if(i.value===this.parent.localeObj.getConstant("AllValues"))for(n=0;n<this.parent.dataSourceSettings.values.length;n++)this.insertFormat(this.parent.dataSourceSettings.values[n].name,e);else this.insertFormat(i.value.toString(),e);i={formatSettings:Ce.cloneFormatSettings(this.newFormat),formatName:i.value.toString(),cancel:!1};this.parent.trigger(ct,i,function(e){if(e.cancel)t.dialog.close(),t.parent.setProperties({dataSourceSettings:{formatSettings:a}},!0);else{t.parent.setProperties({dataSourceSettings:{formatSettings:e.formatSettings}},!0);e={numberFormattingInfo:t.parent.dataSourceSettings.formatSettings};t.parent.actionObj.actionInfo=e;try{t.parent.updateDataSource(),t.dialog.close()}catch(e){t.parent.setProperties({dataSourceSettings:{formatSettings:a}},!0),t.parent.pivotCommon.errorDialog.createErrorDialog(t.parent.localeObj.getConstant("error"),t.parent.localeObj.getConstant("invalidFormat")),t.parent.hideWaitingPopup()}}})},mh.prototype.insertFormat=function(e,t,i,a,r){for(var n=!1,s=Ue.getInstance(Ue.select("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),G.DropDownList),o={name:e,format:t,useGrouping:Ue.isNullOrUndefined(r)?s.value===this.parent.localeObj.getConstant("true"):r,type:i,currency:a},l=this.newFormat,d=0;d<l.length;d++)l[d].name===e&&(l[d]=o,n=!0);n||l.push(o),this.lastFormattedValue=[],this.lastFormattedValue.push(o)},mh.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(At,this.showNumberFormattingDialog,this)},mh.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(At,this.showNumberFormattingDialog)},mh.prototype.destroy=function(){this.dialog&&!this.dialog.isDestroyed&&(this.dialog.destroy(),this.dialog=null),this.removeEventListener()};Al=mh;function mh(e){this.parent=e,(this.parent.numberFormattingModule=this).removeEventListener(),this.addEventListener(),this.newFormat=[],this.lastFormattedValue=[]}Sh.prototype.getModuleName=function(){return"grouping"},Sh.prototype.render=function(e){var t=e.target,i=e.option,e=e.parentElement,a=[],r=(this.parentElement=e,this.isUpdate=!1,Number(t.getAttribute("data-colindex"))),t=Number(t.getAttribute("index")),t=this.parent.engineModule.pivotValues[t][r],r=t.valueSort.axis.toString();(a=this.getSelectedCells(t.axis,r,t.actualText.toString())).push({axis:t.axis,fieldName:r,name:t.actualText.toString(),cellInfo:t}),-1!==i.replace(e.id,"").indexOf("_custom_group")?this.createGroupSettings(r,a):this.updateUnGroupSettings(r,a)},Sh.prototype.getSelectedOptions=function(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];-1===Ce.inArray(r.name,t)&&t.push(r.name)}return t},Sh.prototype.createGroupSettings=function(e,t){var i,a,r,n,s=this.parent.engineModule.fieldList[e],o=this.getGroupSettings(e);0<t.length&&(i=void 0,a=!1,s.isCustomField?o?"Custom"===o.type?1===t.length?a=!0:(a=!1,i="custom"):o&&"Number"===o.type&&(a=!1,i="number"):(r=this.getGroupSettings(e.replace(this.dateGroup,"")),n=this.getGroupSettings(e.replace(/_custom_group/g,"")),r?(a=!1,i="date",e=e.replace(this.dateGroup,"")):n&&(a=1===t.length,i="custom")):o?"Number"===o.type||"Date"===o.type?(a=!1,i="Date"===o.type?"date":"number"):"Custom"===o.type&&(a=1===t.length,i="custom"):"number"===s.type||-1!==["datetime","date"].indexOf(s.type)||this.isDateType(e)?(a=!1,i=1===t.length?-1!==["datetime","date"].indexOf(s.type)||this.isDateType(e)?"date":"number":"custom"):"string"===s.type&&(a=1===t.length,i="custom"),a?(this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("warning"),this.parent.localeObj.getConstant("invalidSelection")),this.parent.grid.clearSelection()):i&&""!==i&&this.createGroupDialog(e,i,t))},Sh.prototype.updateUnGroupSettings=function(e,t){var i,a,r=this.parent.engineModule.fieldList[e],n=Ce.cloneGroupSettings(this.parent.dataSourceSettings.groupSettings),s=this.getGroupSettings(e);0<t.length&&(i=void 0,r.isCustomField?s?"Custom"===s.type&&(i="custom"):(r=this.getGroupSettings(e.replace(this.dateGroup,"")),a=this.getGroupSettings(e.replace(/_custom_group/g,"")),r?(i="date",e=e.replace(this.dateGroup,"")):a&&(i="custom")):!s||"Number"!==s.type&&"Date"!==s.type||(i="Date"===s.type?"date":"number"),"date"===i||"number"===i?n=this.validateSettings(e,n,i,[]):"custom"===i&&(r=this.getSelectedOptions(t),n=this.validateSettings(e,n,i,r)),this.updateDateSource(n,i))},Sh.prototype.updateDateSource=function(e,t){this.isUpdate&&(this.parent.setProperties({dataSourceSettings:{groupSettings:e}},!0),this.parent.updateGroupingReport(e,"date"===t?"Date":"custom"===t?"Custom":"Number"),"Server"===this.parent.dataSourceSettings.mode?this.parent.getEngine("onRefresh"):this.parent.initEngine())},Sh.prototype.removeGroupSettings=function(e,t,i,a){var r=a.indexOf(e);if(-1!==r)for(var n,s=i[r],o=0,l=s.customGroups.length;o<l;o++)s.customGroups[o]&&(n=s.customGroups[o],-1!==Ce.inArray(n.groupName,t))&&(i=this.modifyParentGroupItems(e,i,[n.groupName],n.items,a),s.customGroups.splice(o,1),this.isUpdate=!0,o--,l--);return delete this.parent.engineModule.groupingFieldsInfo[e],i},Sh.prototype.getGroupSettings=function(e){for(var t=0,i=this.parent.dataSourceSettings.groupSettings;t<i.length;t++){var a=i[t];if(a.name===e)return a}},Sh.prototype.isDateType=function(e){for(var t=0,i=this.parent.dataSourceSettings.formatSettings;t<i.length;t++){var a=i[t];if(a.name===e&&a.type)return!0}return!1},Sh.prototype.getSelectedCells=function(e,t,i){for(var a=[],r=this.parent.element.querySelectorAll("."+zn+",."+Wn),n=0;n<r.length;n++){var s=r[n],o=Number(s.getAttribute("data-colindex")),s=Number(s.getAttribute("index")),s=this.parent.engineModule.pivotValues[s][o];s&&s.axis===e&&"grand sum"!==s.type&&"sum"!==s.type&&s.valueSort.axis===t&&i!==s.actualText.toString()&&a.push({axis:s.axis,fieldName:s.valueSort.axis.toString(),name:s.actualText.toString(),cellInfo:s})}return a},Sh.prototype.createGroupDialog=function(e,t,i){var a=Ue.createElement("div",{id:this.parentElement.id+"_GroupDialog",className:"e-group-field-settings",attrs:{"data-field":e,"data-type":t}}),r=(this.parentElement.appendChild(a),new P.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("grouping"),content:this.createGroupOptions(e,t),isModal:!0,visible:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:300,height:"auto",position:{X:"center",Y:"center"},buttons:[{click:this.updateGroupSettings.bind(this,i),isFlat:!1,buttonModel:{cssClass:mr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){r.hide()},isFlat:!1,buttonModel:{cssClass:Sr+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:!0,close:this.removeDialog.bind(this),target:this.parentElement,cssClass:this.parent.cssClass}));r.isStringTemplate=!0,r.appendTo(a)},Sh.prototype.createGroupOptions=function(e,i){var a=this,r=this,t=Ue.createElement("div",{className:"e-group-field-div-content",id:this.parentElement.id+"_group_field_div_content",attrs:{"data-fieldName":e,"data-type":i}}),n=Ue.createElement("div",{className:"e-group-option-container"}),s=(t.appendChild(n),this.parent.dataSourceSettings),o=Ce.getFieldByName(e,s.groupSettings);switch(i){case"custom":var l=void 0,d=(d=s.rows).concat(s.columns,s.values,s.filters),p=Ce.getFieldByName(e.replace(/_custom_group/g,""),d),h=Ce.getFieldByName(e,d),d=Ce.getFieldByName(e+"_custom_group",d),h=(h&&(l=d?d.caption:this.parent.engineModule.fieldList[p.name].caption+((e+"_custom_group").match(/_custom_group/g).length+1)),Ue.createElement("div",{className:"e-caption-option-text"})),d=(h.innerText=this.parent.localeObj.getConstant("groupFieldCaption"),Ue.createElement("div",{className:"e-group-caption-container"})),p=Ue.createElement("input",{id:this.parentElement.id+"group_caption_option",className:"e-group-caption-text",attrs:{type:"text"}}),h=(d.appendChild(h),d.appendChild(p),n.appendChild(d),Ue.createElement("div",{className:"e-input-option-text"})),d=(h.innerText=this.parent.localeObj.getConstant("groupTitle"),Ue.createElement("div",{className:"e-group-input-container"})),u=Ue.createElement("input",{id:this.parentElement.id+"group_input_option",className:"e-group-input-text",attrs:{type:"text"}}),h=(d.appendChild(h),d.appendChild(u),n.appendChild(d),new V.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("captionName"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:l,width:"100%",cssClass:this.parent.cssClass})),d=(h.isStringTemplate=!0,h.appendTo(p),new V.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("groupName"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,width:"100%",cssClass:this.parent.cssClass}));d.isStringTemplate=!0,d.appendTo(u);break;case"date":case"number":var c,g,m,S,l=Ue.createElement("div",{className:"e-group-start-option-container"}),h=Ue.createElement("input",{id:this.parentElement.id+"group_start_option",className:"e-group_start_option",attrs:{type:"checkbox"}}),p=Ue.createElement("input",{id:this.parentElement.id+"group_start_input",className:"e-group_start_input",attrs:{type:"text"}}),d=(l.appendChild(h),l.appendChild(p),n.appendChild(l),Ue.createElement("div",{className:"e-group-end-option-container"})),u=Ue.createElement("input",{id:this.parentElement.id+"group_end_option",className:"e-group_end_option",attrs:{type:"checkbox"}}),l=Ue.createElement("input",{id:this.parentElement.id+"group_end_input",className:"e-group_end_input",attrs:{type:"text"}}),d=(d.appendChild(u),d.appendChild(l),n.appendChild(d),Ue.createElement("div",{className:"e-group-interval-option-container"})),f=Ue.createElement("div",{className:"e-group-inerval-option-text"}),v=(f.innerText=this.parent.localeObj.getConstant("groupBy"),Ue.createElement("input",{id:this.parentElement.id+"group_interval_input",className:"e-group_interval_input",attrs:{type:"text"}})),f=(d.appendChild(f),d.appendChild(v),n.appendChild(d),void 0),d=void 0,y=("date"===i?(S=[],g=[{value:"Seconds",text:this.parent.localeObj.getConstant("Seconds")},{value:"Minutes",text:this.parent.localeObj.getConstant("Minutes")},{value:"Hours",text:this.parent.localeObj.getConstant("Hours")},{value:"Days",text:this.parent.localeObj.getConstant("Days")},{value:"Months",text:this.parent.localeObj.getConstant("Months")},{value:"QuarterYear",text:this.parent.localeObj.getConstant("QuarterYear")},{value:"Quarters",text:this.parent.localeObj.getConstant("Quarters")},{value:"Years",text:this.parent.localeObj.getConstant("Years")}],o&&"Date"===o.type?(S=o.groupInterval,f=o.startingAt?o.startingAt.toString():void 0,d=o.endingAt?o.endingAt.toString():void 0):S=["Months"],(y=new N.DateTimePicker({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,format:"dd/MM/yyyy hh:mm:ss a",enabled:!(void 0===f),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,y.appendTo(p),(m=new N.DateTimePicker({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,format:"dd/MM/yyyy hh:mm:ss a",enabled:!(void 0===d),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,m.appendTo(l),G.MultiSelect.Inject(G.CheckBoxSelection),(c=new G.MultiSelect({dataSource:g,value:S,fields:{text:"text",value:"value"},mode:"CheckBox",showDropDownIcon:!0,enableSelectionOrder:!1,placeholder:this.parent.localeObj.getConstant("selectGroup"),filterBarPlaceholder:this.parent.localeObj.getConstant("example")+" "+this.parent.localeObj.getConstant("Months"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,select:function(){Ue.getInstance(Ue.select("#"+r.parentElement.id+"_GroupDialog",document),P.Dialog).element.querySelector("."+mr).removeAttribute("disabled")},removed:function(){var e=c.liCollections,t=0;e.forEach(function(e){e.classList.contains("e-active")&&t++}),0===t&&Ue.getInstance(Ue.select("#"+r.parentElement.id+"_GroupDialog",document),P.Dialog).element.querySelector("."+mr).setAttribute("disabled","disabled")}})).isStringTemplate=!0,c.appendTo(v),y.value=void 0===f?null:new Date(f),y.dataBind(),m.value=void 0===d?null:new Date(d),m.dataBind()):(g=void 0,o&&"Number"===o.type?(g=o.rangeInterval,f=o.startingAt?o.startingAt.toString():void 0,d=o.endingAt?o.endingAt.toString():void 0):g=2,(y=new V.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###",value:void 0===f?void 0:parseInt(f,10),enabled:!(void 0===f),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,y.appendTo(p),(m=new V.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###",value:void 0===d?void 0:parseInt(d,10),enabled:!(void 0===d),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,m.appendTo(l),(S=new V.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###",min:1,value:g,width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,S.appendTo(v)),new Y.CheckBox({label:this.parent.localeObj.getConstant("startAt"),checked:!(void 0===f),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,change:function(e){var t="date"===i?Ue.getInstance(Ue.select("#"+a.parentElement.id+"group_start_input"),N.DateTimePicker):Ue.getInstance(Ue.select("#"+a.parentElement.id+"group_start_input"),V.NumericTextBox);t.enabled=e.checked,t.dataBind()}})),p=(y.isStringTemplate=!0,y.appendTo(h),new Y.CheckBox({label:this.parent.localeObj.getConstant("endAt"),checked:!(void 0===d),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,change:function(e){var t="date"===i?Ue.getInstance(Ue.select("#"+a.parentElement.id+"group_end_input"),N.DateTimePicker):Ue.getInstance(Ue.select("#"+a.parentElement.id+"group_end_input"),V.NumericTextBox);t.enabled=e.checked,t.dataBind()}}));p.isStringTemplate=!0,p.appendTo(u)}return t},Sh.prototype.updateGroupSettings=function(e){var t=Ue.getInstance(Ue.select("#"+this.parentElement.id+"_GroupDialog",document),P.Dialog),i=t.element,a=i.getAttribute("data-type"),r=i.getAttribute("data-field"),n=Ce.cloneGroupSettings(this.parent.dataSourceSettings.groupSettings);if(0!==n.length||this.parent.clonedDataSet||this.parent.clonedReport||(i=this.parent.engineModule.data,this.parent.clonedDataSet="CSV"===this.parent.dataSourceSettings.type?Ce.getClonedCSVData(i):Ce.getClonedData(i),this.parent.setProperties({dataSourceSettings:{dataSource:[]}},!0),this.parent.clonedReport=Ue.extend({},this.parent.dataSourceSettings,null,!0),this.parent.setProperties({dataSourceSettings:{dataSource:i}},!0)),"custom"===a){var i=Ue.getInstance(Ue.select("#"+this.parentElement.id+"group_input_option"),V.MaskedTextBox),s=Ue.getInstance(Ue.select("#"+this.parentElement.id+"group_caption_option"),V.MaskedTextBox);if(Ue.removeClass([i.element],Ln),null===i.value||""===i.value)return Ue.addClass([i.element],Ln),void i.element.focus();for(var o=this.getSelectedOptions(e),l={groupName:i.value,items:o},d=[],p=[],h={name:r,caption:s.value,type:"Custom",customGroups:[]},u=!1,c=0,g=n.length;c<g;c++)if(n[c].name===r){(h=n[c]).caption=s.value;for(var m,S=0,f=h.customGroups.length;S<f;S++)h.customGroups[S]&&(m=h.customGroups[S]).items&&jp.isContainCommonElements(m.items,o)&&(d=this.mergeArray(d,[m.groupName]),p=this.mergeArray(p,m.items),h.customGroups.splice(S,1),S--,f--);for(var v=0,y=o;v<y.length;v++){var b=y[v],b=p.indexOf(b);-1!==b&&p.splice(b,1)}p=this.mergeArray(p,[l.groupName]),h.customGroups.push(l),u=this.isUpdate=!0;break}u||(h.customGroups.push(l),this.isUpdate=!0,n.push(h)),n=this.validateSettings(r,n,a,0===d.length?l.items:d,p)}else if("date"===a||"number"===a){var e=Ue.getInstance(Ue.select("#"+this.parentElement.id+"group_start_option"),Y.CheckBox),i=Ue.getInstance(Ue.select("#"+this.parentElement.id+"group_end_option"),Y.CheckBox),C="date"===a?Ue.getInstance(Ue.select("#"+this.parentElement.id+"group_start_input"),N.DateTimePicker):Ue.getInstance(Ue.select("#"+this.parentElement.id+"group_start_input"),V.NumericTextBox),x="date"===a?Ue.getInstance(Ue.select("#"+this.parentElement.id+"group_end_input"),N.DateTimePicker):Ue.getInstance(Ue.select("#"+this.parentElement.id+"group_end_input"),V.NumericTextBox),w="date"===a?Ue.getInstance(Ue.select("#"+this.parentElement.id+"group_interval_input"),G.MultiSelect):Ue.getInstance(Ue.select("#"+this.parentElement.id+"group_interval_input"),V.NumericTextBox),h={name:r,startingAt:e.checked?C.value.toString():void 0,endingAt:i.checked?x.value.toString():void 0};if("date"===a){for(var T=[],M=0,D=w.value;M<D.length;M++){var O=D[M];T.push(O)}h.type="Date",h.groupInterval=T}else h.type="Number",h.rangeInterval=w.value;for(u=!1,c=0,g=n.length;c<g;c++)if(n[c].name===r){n.splice(c,1,h),u=this.isUpdate=!0;break}u||(this.isUpdate=!0,n.push(h)),n=this.validateSettings(r,n,a,[],[])}t.close(),this.updateDateSource(n,a)},Sh.prototype.getGroupBasedSettings=function(e){for(var t={},i=0,a=e;i<a.length;i++){var r=a[i];t[r.type]?t[r.type].push(r):t[r.type]=[r]}return t},Sh.prototype.getGroupByName=function(e){for(var t={},i=0,a=e;i<a.length;i++){var r=a[i],n=r.name.replace(/_custom_group/g,"");t[n]?t[n].push(r):t[n]=[r]}return t},Sh.prototype.validateSettings=function(i,e,t,a,r){var n=[],s=this.getGroupBasedSettings(e),e=["Date","Number","Custom"];if(s[e[2]]&&"custom"===t){for(var o=this.getGroupByName(s[e[2]]),l=(o[i.replace(/_custom_group/g,"")]&&(u=(f=o[i.replace(/_custom_group/g,"")]).map(function(e){return e.name}),f=r?this.modifyParentGroupItems(i,f,a,r,u):this.removeGroupSettings(i.replace("_custom_group",""),a,f,u)),[]),d=0,p=Object.keys(o);d<p.length;d++)var h=p[d],u=o[h].map(function(e){return e.name}),l=this.reOrderSettings(o[h],u,l,h,i);s[e[2]]=l}else if(("date"===t||"number"===t)&&!r){a="date"===t?s[e[0]]:s[e[1]];if("date"===t){s[e[0]]=a.filter(function(e){return e.name!==i});var c=["_date_group_years","_date_group_quarters","_date_group_quarterYear","_date_group_months","_date_group_days","_date_group_hours","_date_group_minutes","_date_group_seconds"];if(0===s[e[0]].length){delete this.parent.engineModule.groupingFieldsInfo[i];var g=this;for(m in this.parent.engineModule.groupingFieldsInfo)!function(t){c.some(function(e){return t===""+i+e})&&delete g.parent.engineModule.groupingFieldsInfo[t]}(m);var m,S=this;for(m in this.parent.engineModule.fieldList)!function(t){c.some(function(e){return t===""+i+e})&&delete S.parent.engineModule.fieldList[t]}(m);var f=this.parent.engineModule.fields.filter(function(t){return!c.some(function(e){return t===""+i+e})});this.parent.engineModule.fields=f}}else s[e[1]]=a.filter(function(e){return e.name!==i});this.isUpdate=!0}for(var v=0,y=e;v<y.length;v++){var b=y[v];s[b]&&(n=n.concat(s[b]))}return n},Sh.prototype.reOrderSettings=function(e,t,i,a,r){var n=t.indexOf(a);return-1<n&&e[n].customGroups&&0<e[n].customGroups.length?(i.push(e[n]),this.reOrderSettings(e,t,i,a+"_custom_group")):-1<n&&e[n].customGroups&&0===e[n].customGroups.length&&!Ue.isNullOrUndefined(r)&&(delete this.parent.engineModule.fieldList[r],delete this.parent.engineModule.groupingFieldsInfo[r],t=this.parent.engineModule.fields.filter(function(e){return e!==r}),this.parent.engineModule.fields=t),i},Sh.prototype.modifyParentGroupItems=function(e,t,i,a,r){r=r.indexOf(e+"_custom_group");if(-1!==r){var n=t[r];if(n.customGroups&&0<n.customGroups.length)for(var s=0,o=n.customGroups.length;s<o;s++)if(n.customGroups[s]){var l=!1,d=n.customGroups[s];if(d.items){for(var p=0,h=i;p<h.length;p++){var u=h[p],u=d.items.indexOf(u);-1!==u&&(d.items.splice(u,1),l=this.isUpdate=!0)}l&&(d.items=this.mergeArray(d.items,a))}}}return t},Sh.prototype.mergeArray=function(e,t){for(var i=[],a=e.concat(t),r=a.length,n={};r--;){var s=String(a[r]);n[s]||(i.unshift(s),n[s]=!0)}return i},Sh.prototype.removeDialog=function(){var e;this.parent.grid&&this.parent.grid.isDestroyed||Ue.isNullOrUndefined(this.parent.grid)||(this.parent.grid.clearSelection(),(e=(e=Ue.select("#"+this.parent.element.id+"_GroupDialog",document))?Ue.getInstance(e,P.Dialog):null)&&!e.isDestroyed&&e.destroy(),this.parent.element&&document.getElementById(this.parent.element.id+"_GroupDialog")&&Ue.remove(document.getElementById(this.parent.element.id+"_GroupDialog")))},Sh.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Rt,this.render,this)},Sh.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.removeDialog(),this.parent.off(Rt,this.render))},Sh.prototype.destroy=function(){this.removeEventListener()};Fd=Sh;function Sh(e){this.dateGroup=/_date_group_years|_date_group_quarters|_date_group_quarterYear|_date_group_months|_date_group_days|_date_group_hours|_date_group_minutes|_date_group_seconds/g,this.parent=e,(this.parent.groupingModule=this).addEventListener()}e.AggregateMenu=As,e.Authentication=Vo,e.AxisFieldRenderer=Yp,e.AxisTableRenderer=zp,e.CalculatedField=jl,e.CalculatedFieldSettings=Eo,e.CellEditSettings=td,e.Common=Js,e.CommonKeyboardInteraction=js,e.ConditionalFormatSettings=mo,e.ConditionalFormatting=yl,e.ConditionalSettings=rd,e.CustomGroups=Oo,e.DataSourceSettings=to,e.DataSourceUpdate=Bs,e.DialogRenderer=Up,e.DisplayOption=Pd,e.DrillOptions=Lo,e.DrillThrough=el,e.ErrorDialog=zs,e.EventBase=Vs,e.ExcelExport=yd,e.FieldList=Ql,e.FieldListFieldOptions=no,e.FieldOptions=io,e.Filter=uo,e.FilterDialog=Qs,e.FormatSettings=Co,e.GroupSettings=To,e.Grouping=Fd,e.GroupingBar=xl,e.GroupingBarSettings=Zl,e.HyperlinkSettings=od,e.KeyboardInteraction=Wo,e.MDXQuery=hp,e.MdxQuery=Qt,e.NodeStateModified=_s,e.NumberFormatting=Al,e.OlapEngine=cp,e.PDFExport=pd,e.PageSettings=Md,e.Pager=cd,e.PagerSettings=Sd,e.PivotChart=il,e.PivotCommon=Ks,e.PivotContextMenu=Yo,e.PivotEngine=A,e.PivotFieldList=eh,e.PivotUtil=Ce,e.PivotView=kp,e.Render=ks,e.Sort=vo,e.Style=lo,e.Toolbar=Fl,e.TreeViewRenderer=Gp,e.ValueSortSettings=ko,e.VirtualScroll=Xo,e.VirtualScrollSettings=xd,e.actionBegin=yt,e.actionComplete=bt,e.actionDropped=ba,e.actionFailure=Ct,e.addNewRecord=Ti,e.addNewReport=Vt,e.afterPivotTableRender="afterPivotTableRender",e.afterServiceInvoke=vt,e.aggregateCellInfo=it,e.aggregateField=Di,e.aggregateMenuOpen=gt,e.animationComplete=Re,e.axisLabelFont=l,e.axisTitleFont=nl,e.beforeColumnsRender=pe,e.beforeExcelExport=lt,e.beforeExport=B,e.beforePdfExport="beforePdfExport",e.beforePivotTableRender="beforePivotTableRender",e.beforePrint=Ae,e.beforeServiceInvoke=ft,e.beginDrillThrough=ve,e.calculatedFieldApplied=Ei,e.calculatedFieldCreate=pt,e.calculatedFieldEdited=sa,e.cellClick=le,e.cellDeselected=me,e.cellSelected=ge,e.cellSelecting=ue,e.chartAxisLabelRender=et,e.chartLegendClick=Fe,e.chartLoad=Ze,e.chartLoaded=Ie,e.chartMouseClick=_e,e.chartMouseDown=ze,e.chartMouseLeave=Ge,e.chartMouseMove=He,e.chartMouseUp=We,e.chartPointClick=St,e.chartResized=$e,e.chartSeriesCreated=tt,e.chartSubTitleFont={size:"11px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.chartTitleFont={size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.chartTooltipRender=Ee,e.chartView=Xt,e.chartViewed=Xi,e.click="click",e.closeFieldlist=Ai,e.columnPageNavigated=ya,e.columnPageNavigation=Ni,e.conditionalFormatting=ot,e.conditionalFormattingMenu=gi,e.conditionallyFormatted=Qi,e.contentReady=Dt,e.contextMenuCalculatedField="CalculatedField Context menu",e.contextMenuClick=rt,e.contextMenuOpen=nt,e.crosshairLabelFont=sl,e.csvExport=ii,e.csvExported=Ui,e.dataBound=ie,e.dataReady=Ot,e.dragComplete=Qe,e.drill=ce,e.drillDown=qt,e.drillThrough=de,e.drillThroughClosed=ma,e.drillUp=jt,e.editCalculatedField=fi,e.editCompleted=ye,e.editRecord=xi,e.editedRecordsSaved=Fi,e.enginePopulated=U,e.enginePopulating=_,e.excelExport=ti,e.excelExported=_i,e.excelHeaderQueryCellInfo=J,e.excelQueryCellInfo=$,e.exportComplete=X,e.fetchReport=we,e.fieldAggregated=pa,e.fieldDragStart=mt,e.fieldDrop=H,e.fieldFiltered=la,e.fieldListRefreshed=st,e.fieldRemove=ut,e.fieldRemoved=da,e.fieldSorted=oa,e.fieldTreeSorted=Ri,e.filterField=yi,e.grandTotalsColumn=hi,e.grandTotalsColumnShown=aa,e.grandTotalsHidden=ta,e.grandTotalsRow=pi,e.grandTotalsRowShown=ia,e.grandTotalsShown=ra,e.headerCellInfo=re,e.hideGrandTotals=di,e.hideSubTotals=ni,e.horizontalScroll=Mt,e.horizontalScrolled=fa,e.hyperlinkCellClick=ne,e.initCalculatedField=Ft,e.initFormatting=At,e.initGrouping=Rt,e.initPivotPager=Lt,e.initSubComponent=Pt,e.initToolbar=It,e.initialLoad=xt,e.jpegExport=ai,e.jpegExported=zi,e.legendLabelFont=ll,e.legendRender=ke,e.load=k,e.loadReport=Te,e.loadReports=Gt,e.memberEditorOpen=ht,e.memberFiltering=dt,e.multiLevelLabelClick=be,e.multiLevelLabelRender=Le,e.multipleAxis=Jt,e.newRecordAdded=Ii,e.newReport=Oe,e.newReportAdded=ji,e.numberFormatted=Yi,e.numberFormatting=ct,e.numberFormattingMenu=ci,e.onFieldDropped=q,e.onHeadersSort=at,e.onPdfCellRender=te,e.openCalculatedField=Ci,e.openConditionalFormatting=zt,e.openNumberFormatting=Wt,e.pdfExport=$t,e.pdfExported=Bi,e.pdfHeaderQueryCellInfo=Z,e.pdfQueryCellInfo=ee,e.pivotButtonUpdate=Et,e.pngExport=ei,e.pngExported=Gi,e.pointMove=Be,e.pointRender=qe,e.queryCellInfo=ae,e.recordEdited=ha,e.recordRemoved=Li,e.recordUpdated=ga,e.removeCurrentReport=Bt,e.removeField=bi,e.removeRecord=Mi,e.removeReport=De,e.renameCurrentReport=Ut,e.renameReport=Me,e.reportChange=mi,e.reportChanged=ua,e.reportReSaved=qi,e.reportRemoved=Hi,e.reportRenamed=Vi,e.reportSaved=ki,e.resizeStop=oe,e.resizing=se,e.rowDeselected=fe,e.rowPageNavigated=va,e.rowPageNavigation=Pi,e.rowSelected=Se,e.saveAsCurrentReport=_t,e.saveCurrentReport=Ht,e.saveEditedRecords=wi,e.saveReport=xe,e.scroll="scroll",e.scrollChanged=Je,e.scrollEnd=Xe,e.scrollStart=Ke,e.selected=he,e.seriesRender=Ve,e.showFieldList=Yt,e.showGrandTotals=ui,e.showLegend=Zt,e.showSubTotals=li,e.sortField=vi,e.sortFieldTree=Si,e.sortValue=kt,e.stockEventFont={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},e.stripLineLabelFont=dl,e.subTotalsColumn=oi,e.subTotalsColumnShown=$i,e.subTotalsHidden=Ji,e.subTotalsRow=si,e.subTotalsRowShown=Zi,e.subTotalsShown=ea,e.svgExport=ri,e.svgExported=Wi,e.tableView=Kt,e.tableViewed=Ki,e.textRender=je,e.toolbarClick=Ne,e.toolbarRender=Pe,e.tooltipLabelFont=ol,e.treeViewUpdate=Nt,e.uiUpdate=wt,e.valueSorted=na,e.verticalScroll=Tt,e.verticalScrolled=Sa,e.windowResize=Oi,e.windowResized=ca,e.zoomComplete=Ye,Object.defineProperty(e,"__esModule",{value:!0})});
|
|
2
11
|
//# sourceMappingURL=ej2-pivotview.umd.min.js.map
|