@syncfusion/ej2-pivotview
Version:
The pivot grid, or pivot table, is used to visualize large sets of relational data in a cross-tabular format, similar to an Excel pivot table.
10 lines • 1.22 MB
JavaScript
/*!
* filename: ej2-pivotview.min.js
* version : 34.2.4
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
* Use of this code is subject to the terms of our license.
* A copy of the current license can be obtained at any time by e-mailing
* licensing@syncfusion.com. Any infringement will be prosecuted under
* applicable laws.
*/
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionPdfExport"),require("SyncfusionPopups"),require("SyncfusionGrids"),require("SyncfusionNavigations"),require("SyncfusionInputs"),require("SyncfusionDropdowns"),require("SyncfusionCalendars"),require("SyncfusionSplitbuttons"),require("SyncfusionButtons"),require("SyncfusionCharts"),require("SyncfusionSvgBase"),require("SyncfusionFileUtils"),require("SyncfusionExcelExport")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionData","SyncfusionPdfExport","SyncfusionPopups","SyncfusionGrids","SyncfusionNavigations","SyncfusionInputs","SyncfusionDropdowns","SyncfusionCalendars","SyncfusionSplitbuttons","SyncfusionButtons","SyncfusionCharts","SyncfusionSvgBase","SyncfusionFileUtils","SyncfusionExcelExport"],t):"object"==typeof exports?exports.SyncfusionPivotview=t(require("SyncfusionBase"),require("SyncfusionData"),require("SyncfusionPdfExport"),require("SyncfusionPopups"),require("SyncfusionGrids"),require("SyncfusionNavigations"),require("SyncfusionInputs"),require("SyncfusionDropdowns"),require("SyncfusionCalendars"),require("SyncfusionSplitbuttons"),require("SyncfusionButtons"),require("SyncfusionCharts"),require("SyncfusionSvgBase"),require("SyncfusionFileUtils"),require("SyncfusionExcelExport")):e.SyncfusionPivotview=t(e.SyncfusionBase,e.SyncfusionData,e.SyncfusionPdfExport,e.SyncfusionPopups,e.SyncfusionGrids,e.SyncfusionNavigations,e.SyncfusionInputs,e.SyncfusionDropdowns,e.SyncfusionCalendars,e.SyncfusionSplitbuttons,e.SyncfusionButtons,e.SyncfusionCharts,e.SyncfusionSvgBase,e.SyncfusionFileUtils,e.SyncfusionExcelExport)}(self,(e,t,i,a,r,n,s,o,l,d,p,h,u,c,g)=>(()=>{"use strict";var m={766:t=>{t.exports=e},741:e=>{e.exports=p},570:e=>{e.exports=l},60:e=>{e.exports=h},74:e=>{e.exports=t},778:e=>{e.exports=o},437:e=>{e.exports=g},115:e=>{e.exports=c},707:e=>{e.exports=r},323:e=>{e.exports=s},215:e=>{e.exports=n},461:e=>{e.exports=i},197:e=>{e.exports=a},295:e=>{e.exports=d},727:e=>{e.exports=u}},f={};function v(e){var t=f[e];if(void 0!==t)return t.exports;var i=f[e]={exports:{}};return m[e](i,i.exports,v),i.exports}v.d=(e,t)=>{for(var i in t)v.o(t,i)&&!v.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},v.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),v.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var S={};return(()=>{v.r(S),v.d(S,{AggregateMenu:()=>Qs,Authentication:()=>Co,AxisFieldRenderer:()=>ed,AxisTableRenderer:()=>Zl,CalculatedField:()=>md,CalculatedFieldSettings:()=>So,CellEditSettings:()=>kl,Common:()=>no,CommonKeyboardInteraction:()=>Ks,ConditionalFormatSettings:()=>co,ConditionalFormatting:()=>yd,ConditionalSettings:()=>jl,CustomGroups:()=>vo,DataSourceSettings:()=>xo,DataSourceUpdate:()=>Zs,DialogRenderer:()=>Xl,DisplayOption:()=>Ul,DrillOptions:()=>yo,DrillThrough:()=>Io,ErrorDialog:()=>$s,EventBase:()=>Xs,ExcelExport:()=>Ql,FieldList:()=>fd,FieldListFieldOptions:()=>po,FieldOptions:()=>lo,Filter:()=>uo,FilterDialog:()=>ao,FormatSettings:()=>mo,GroupSettings:()=>fo,Grouping:()=>xd,GroupingBar:()=>Sd,GroupingBarSettings:()=>Rl,HyperlinkSettings:()=>ql,KeyboardInteraction:()=>Do,MDXQuery:()=>Tl,MdxQuery:()=>Hr,NodeStateModified:()=>Js,NumberFormatting:()=>Cd,OlapEngine:()=>Ml,PDFExport:()=>Yl,PageSettings:()=>Hl,Pager:()=>Kl,PagerSettings:()=>Vl,PivotChart:()=>Lo,PivotCommon:()=>ro,PivotContextMenu:()=>Oo,PivotEngine:()=>Us,PivotFieldList:()=>rd,PivotUtil:()=>Hs,PivotView:()=>_l,Render:()=>Ys,Sort:()=>go,Style:()=>ho,Toolbar:()=>bd,TreeViewRenderer:()=>Jl,ValueSortSettings:()=>bo,VirtualScroll:()=>No,VirtualScrollSettings:()=>Bl,actionBegin:()=>or,actionComplete:()=>lr,actionDropped:()=>Rs,actionFailure:()=>dr,addNewRecord:()=>Sn,addNewReport:()=>Pr,afterPivotTableRender:()=>Ai,afterServiceInvoke:()=>sr,aggregateCellInfo:()=>Ua,aggregateContextMenuOpen:()=>Ln,aggregateField:()=>bn,aggregateMenuClosed:()=>Qa,aggregateMenuOpen:()=>Wa,animationComplete:()=>Ca,axisLabelFont:()=>Ao,axisTitleFont:()=>Ro,beforeColumnsRender:()=>Xi,beforeExcelExport:()=>Ja,beforeExport:()=>Ri,beforePdfExport:()=>Xa,beforePivotTableRender:()=>Li,beforePrint:()=>ba,beforeServiceInvoke:()=>nr,beginDrillThrough:()=>na,calculatedFieldApplied:()=>Rn,calculatedFieldCreate:()=>$a,calculatedFieldEdited:()=>hs,cellClick:()=>Yi,cellDeselected:()=>ia,cellSelected:()=>ta,cellSelecting:()=>$i,changeColumnPageSize:()=>Nn,changeRowPageSize:()=>On,chartAxisLabelRender:()=>Ha,chartLegendClick:()=>va,chartLoad:()=>ja,chartLoaded:()=>Sa,chartMouseClick:()=>Oa,chartMouseDown:()=>Ea,chartMouseLeave:()=>Pa,chartMouseMove:()=>Da,chartMouseUp:()=>Ia,chartPointClick:()=>rr,chartResized:()=>qa,chartSeriesCreated:()=>Va,chartSubTitleFont:()=>jo,chartTitleFont:()=>ko,chartTooltipRender:()=>fa,chartTypeSettingsClosed:()=>qr,chartView:()=>Br,chartViewed:()=>ts,click:()=>Cr,closeFieldlist:()=>Hn,columnPageNavigated:()=>Ds,columnPageNavigation:()=>Dn,columnPageSizeChanged:()=>Ns,conditionalFormatting:()=>Ka,conditionalFormattingMenu:()=>on,conditionallyFormatted:()=>Zn,contentReady:()=>mr,contextMenuCalculatedField:()=>wn,contextMenuClick:()=>_a,contextMenuClose:()=>za,contextMenuOpen:()=>Ga,crosshairLabelFont:()=>qo,csvExport:()=>Yr,csvExported:()=>Qn,dataBound:()=>Bi,dataReady:()=>fr,disableDeferLayoutUpdate:()=>Fn,dragComplete:()=>Fa,drill:()=>ea,drillDown:()=>Nr,drillThrough:()=>Ki,drillThroughClosed:()=>xs,drillUp:()=>Or,editCalculatedField:()=>pn,editCompleted:()=>sa,editRecord:()=>fn,editedRecordsSaved:()=>kn,enableDeferLayoutUpdate:()=>In,enginePopulated:()=>Ei,enginePopulating:()=>Pi,excelExport:()=>Qr,excelExported:()=>Wn,excelHeaderQueryCellInfo:()=>ji,excelQueryCellInfo:()=>Hi,exportComplete:()=>ki,fetchReport:()=>da,fieldAggregated:()=>ms,fieldDragStart:()=>ar,fieldDrop:()=>Fi,fieldFiltered:()=>cs,fieldGrouped:()=>fs,fieldListRefresh:()=>js,fieldListRefreshed:()=>Ya,fieldRemove:()=>tr,fieldRemoved:()=>gs,fieldSorted:()=>us,fieldTreeSorted:()=>Vn,fieldUngrouped:()=>vs,filterField:()=>un,grandTotalsColumn:()=>rn,grandTotalsColumnShown:()=>ls,grandTotalsHidden:()=>ss,grandTotalsPosition:()=>En,grandTotalsPositionChanged:()=>Es,grandTotalsRow:()=>an,grandTotalsRowShown:()=>os,grandTotalsShown:()=>ds,groupField:()=>Cn,headerCellInfo:()=>Gi,hideGrandTotals:()=>tn,hideSubTotals:()=>Jr,horizontalScroll:()=>gr,horizontalScrolled:()=>Ts,hyperlinkCellClick:()=>zi,initCalculatedField:()=>br,initFormatting:()=>Tr,initGrouping:()=>Mr,initPivotPager:()=>wr,initSubComponent:()=>vr,initToolbar:()=>xr,initialLoad:()=>pr,invalidFormula:()=>ks,jpegExport:()=>Kr,jpegExported:()=>Xn,legendHidden:()=>Fs,legendLabelFont:()=>Vo,legendRender:()=>xa,legendShown:()=>Is,load:()=>Ni,loadReport:()=>pa,loadReports:()=>Ar,memberEditorOpen:()=>er,memberFiltering:()=>Za,multiLevelLabelClick:()=>oa,multiLevelLabelRender:()=>ya,multipleAxis:()=>_r,multipleAxisDisabled:()=>As,multipleAxisEnabled:()=>Ls,newRecordAdded:()=>jn,newReport:()=>ca,newReportAdded:()=>Bn,numberFormatted:()=>$n,numberFormatting:()=>ir,numberFormattingMenu:()=>sn,onFieldDropped:()=>Ii,onHeadersSort:()=>Ba,onPdfCellRender:()=>Ui,openCalculatedField:()=>gn,openChartTypeDialog:()=>jr,openConditionalFormatting:()=>Rr,openDrillThrough:()=>mn,openNumberFormatting:()=>kr,openValueSettingsDialog:()=>An,pdfExport:()=>zr,pdfExported:()=>Yn,pdfHeaderQueryCellInfo:()=>qi,pdfQueryCellInfo:()=>Vi,pivotButtonUpdate:()=>yr,pngExport:()=>Wr,pngExported:()=>Kn,pointMove:()=>Na,pointRender:()=>Ta,queryCellInfo:()=>_i,recordEdited:()=>Ss,recordRemoved:()=>qn,recordUpdated:()=>Cs,removeCurrentReport:()=>Lr,removeField:()=>cn,removeRecord:()=>yn,removeReport:()=>ua,renameCurrentReport:()=>Fr,renameReport:()=>ha,reportChange:()=>ln,reportChanged:()=>ys,reportReSaved:()=>_n,reportRemoved:()=>zn,reportRenamed:()=>Gn,reportSaved:()=>Un,resizeStop:()=>Qi,resizing:()=>Wi,rowDeselected:()=>ra,rowPageNavigated:()=>Ms,rowPageNavigation:()=>Mn,rowPageSizeChanged:()=>Os,rowSelected:()=>aa,saveAsCurrentReport:()=>Ir,saveCurrentReport:()=>Er,saveEditedRecords:()=>vn,saveReport:()=>la,scroll:()=>ur,scrollChanged:()=>ka,scrollEnd:()=>Ra,scrollStart:()=>Aa,selected:()=>Ji,selecting:()=>Zi,seriesRender:()=>Ma,showFieldList:()=>Vr,showGrandTotals:()=>nn,showLegend:()=>Gr,showSubTotals:()=>en,sortField:()=>hn,sortFieldTree:()=>dn,sortValue:()=>Dr,stockEventFont:()=>Bo,stripLineLabelFont:()=>Uo,subTotalsColumn:()=>$r,subTotalsColumnShown:()=>rs,subTotalsHidden:()=>is,subTotalsPosition:()=>Pn,subTotalsPositionChanged:()=>Ps,subTotalsRow:()=>Zr,subTotalsRowShown:()=>as,subTotalsShown:()=>ns,svgExport:()=>Xr,svgExported:()=>Jn,tableView:()=>Ur,tableViewed:()=>es,textRender:()=>wa,toolbarClick:()=>ma,toolbarRender:()=>ga,tooltipLabelFont:()=>Ho,treeViewUpdate:()=>Sr,uiUpdate:()=>hr,ungroupField:()=>xn,valueSettingsDialogClosed:()=>qs,valueSorted:()=>ps,verticalScroll:()=>cr,verticalScrolled:()=>ws,windowResize:()=>Tn,windowResized:()=>bs,zoomComplete:()=>La});var e,t=v(766),i=v(74),a=v(461),r="e-pivotfieldlist",n="e-rtl",s="e-device",o="e-icons",l="e-disable",d="e-hide",p="e-icon-first",h="e-icon-last",u="e-icon-prev",c="e-icon-next",g="e-dropdown-icon",m="e-pivotfieldlist-container",f="e-toggle-field-list",y="e-static",b="e-draggable",C="e-field-list",x="e-field-list-tree-outer-div",w="e-field-list-tree-outer-div-searchMode",T="e-search-mode",M="e-pivot-parent",D="e-pivot-child",O="e-field-list-footer",N="e-left-axis-fields",P="e-right-axis-fields",E="e-all-fields-axis",I="e-axis-content",F="e-draggable-prompt",L="e-pvt-btn-div",A="e-pivot-button",R="e-content",k="e-pvt-btn-content",j="e-sort",q="e-member-sort",H="e-descend",V="e-btn-filter",U="e-pv-filter",B="e-pv-filtered",_="e-remove",G="e-drag",z="e-disable-drag",W="e-drop-indicator",Q="e-drop-hover",Y="e-member-editor-outer-container",K="e-member-editor-container",X="e-drillthrough-body-header",J="e-drillthrough-body-header-common",Z="e-drillthrough-body-header-value",$="e-frame",ee="e-check",te="e-stop",ie="e-ok-btn",ae="e-cancel-btn",re="e-pivot-error-dialog",ne="e-droppable",se="e-rows",oe="e-columns",le="e-values",de="e-filters",pe="e-grouping-bar",he="e-group-all-fields",ue="e-group-rows",ce="e-group-columns",ge="e-group-values",me="e-group-filters",fe="e-drag-restrict",ve="e-list-selected",Se="e-title-header",ye="e-text-content",be="e-field-list-btn",Ce="e-calculated-field-btn",xe="e-small",we="e-round",Te="e-add-icon",Me="e-flat",De="e-list-text",Oe="e-selected-node",Ne="e-focused",Pe="e-focus",Ee="e-selected-option-icon",Ie="e-selected-level-icon",Fe="e-between-text-div",Le="e-filter-input-div-2",Ae="e-value-options",Re="e-filter-operator",ke="e-filter-sort",je="e-sort-ascend-icon",qe="e-sort-descend-icon",He="e-active",Ve="e-collapse",Ue="e-expand",Be="e-table",_e="e-columnsheader",Ge="e-rowsheader",ze="e-headercell",We="e-cellvalue",Qe="e-tooltipheader",Ye="e-tooltipcontent",Ke="e-nextspan",Xe="e-lastspan",Je="e-editor-search-container",Ze="e-editor-search",$e="e-select-all",et="e-pivot-calc-check",tt="e-pivot-calc-input",it="e-custom-format-input",at="e-olap-calc-hierarchy-list-div",rt="e-pivot-calc-format-type-div",nt="e-olap-calc-member-type-div",st="e-member-options",ot="e-format",lt="e-pivot-formula",dt="e-pivot-treeview",pt="e-pivot-treeview-outer",ht="e-treeContainer",ut="e-pivot-ok-button",ct="e-pivot-button-div",gt="e-axis",mt="e-axis-filter",ft="e-grid",vt="e-pivotview",St="e-pivot-all-field-title",yt="e-disabled",bt="e-menu-hide",Ct="e-member-prompt",xt="e-edit",wt="e-edited",Tt="e-info",Mt="e-empty-field",Dt="e-format-condition-button",Ot="e-format-table",Nt="e-input",Pt="e-visible-hide",Et="e-format-color-picker",It="e-dlg-header",Ft="e-virtualtrack",Lt="e-movablescrolldiv",At="e-content-virtualtable",Rt="e-movablescroll",kt="e-headercontent",jt="e-cellselectionbackground",qt="e-selectionbackground",Ht="e-checkbox-wrapper",Vt="e-headercontent",Ut="e-field-list-back-icon",Bt="e-rowcell",_t="e-active",Gt="e-spanclicked",zt="e-rowselect",Wt="e-gridheader",Qt="e-gridcontent",Yt="e-pivotview-pdf-export",Kt="e-pivotview-excel-export",Xt="e-pivotview-csv-export",Jt="e-remove-report",Zt="e-pivot-toolbar",$t="e-pivotview-report-input",ei="e-toolbar-grid",ti="e-toolbar-chart",ii="e-pivotchart",ai="e-group-chart-rows",ri="e-group-chart-columns",ni="e-group-chart-values",si="e-group-chart-values-drodown-div",oi="e-group-chart-columns-dropdown-div",li="e-chart-grouping-bar",di="e-pivotview-disable-icon",pi="e-pivotview-select-icon",hi="e-pivot-grouping-bar",ui="e-mdx-query-content",ci="e-pivotchart-inner",gi="e-group-pivot-rows",mi="e-pivot-toolbar-menu",fi="e-pivot-pager",vi="e-pagercontainer",Si="e-page-size-disable",yi="e-node-limit",bi="e-leftfreeze",Ci="e-pivot-content-loader",xi="e-hide-loader",wi="e-icon-collapsible",Ti="e-icon-expandable",Mi="e-pivotview-autofit",Di="e-group-row",Oi="e-row",Ni="load",Pi="enginePopulating",Ei="enginePopulated",Ii="onFieldDropped",Fi="fieldDrop",Li="beforePivotTableRender",Ai="afterPivotTableRender",Ri="beforeExport",ki="exportComplete",ji="excelHeaderQueryCellInfo",qi="pdfHeaderQueryCellInfo",Hi="excelQueryCellInfo",Vi="pdfQueryCellInfo",Ui="onPdfCellRender",Bi="dataBound",_i="queryCellInfo",Gi="headerCellInfo",zi="hyperlinkCellClick",Wi="resizing",Qi="resizeStop",Yi="cellClick",Ki="drillThrough",Xi="beforeColumnsRender",Ji="selected",Zi="selecting",$i="cellSelecting",ea="drill",ta="cellSelected",ia="cellDeselected",aa="rowSelected",ra="rowDeselected",na="beginDrillThrough",sa="editCompleted",oa="multiLevelLabelClick",la="saveReport",da="fetchReport",pa="loadReport",ha="renameReport",ua="removeReport",ca="newReport",ga="toolbarRender",ma="toolbarClick",fa="chartTooltipRender",va="chartLegendClick",Sa="chartLoaded",ya="multiLevelLabelRender",ba="beforePrint",Ca="animationComplete",xa="legendRender",wa="textRender",Ta="pointRender",Ma="seriesRender",Da="chartMouseMove",Oa="chartMouseClick",Na="pointMove",Pa="chartMouseLeave",Ea="chartMouseDown",Ia="chartMouseUp",Fa="dragComplete",La="zoomComplete",Aa="scrollStart",Ra="scrollEnd",ka="scrollChanged",ja="chartLoad",qa="chartResized",Ha="chartAxisLabelRender",Va="chartSeriesCreated",Ua="aggregateCellInfo",Ba="onHeadersSort",_a="contextMenuClick",Ga="contextMenuOpen",za="contextMenuClosed",Wa="aggregateMenuOpen",Qa="aggregateMenuClosed",Ya="fieldListRefreshed",Ka="conditionalFormatting",Xa="beforePdfExport",Ja="beforeExcelExport",Za="memberFiltering",$a="calculatedFieldCreate",er="memberEditorOpen",tr="fieldRemove",ir="numberFormatting",ar="fieldDragStart",rr="chartPointClick",nr="beforeServiceInvoke",sr="afterServiceInvoke",or="actionBegin",lr="actionComplete",dr="actionFailure",pr="initial-load",hr="ui-update",ur="scroll",cr="vertical-scroll",gr="horizontal-scroll",mr="content-ready",fr="data-ready",vr="init-groupingbar",Sr="tree-view-update",yr="pivot-button-update",br="init-calculatedfield",Cr="click",xr="init-toolbar",wr="init-pivotPager",Tr="init-formatting",Mr="init-grouping",Dr="Sort value",Or="Drill up",Nr="Drill down",Pr="Add new report",Er="Save current report",Ir="Save as current report",Fr="Rename current report",Lr="Remove current report",Ar="Load report",Rr="Open conditional formatting dialog",kr="Open number formatting dialog",jr="Open chart type settings dialog",qr="Chart type settings dialog closed",Hr="MdxQuery",Vr="Open field list",Ur="Show table view",Br="Show chart view",_r="Multiple Axis",Gr="Show legend",zr="PDF export",Wr="PNG export",Qr="Excel export",Yr="CSV export",Kr="JPEG export",Xr="SVG export",Jr="Hide sub-totals",Zr="Show row sub-totals",$r="Show column sub-totals",en="Show sub-totals",tn="Hide grand totals",an="Show row grand totals",rn="Show column grand totals",nn="Show grand totals",sn="Number Formatting menu",on="Conditional Formatting menu",ln="Report change",dn="Sort field tree",pn="Edit calculated field",hn="Sort field",un="Filter field",cn="Remove field",gn="Open calculated field dialog",mn="Open drill through dialog",fn="Edit record",vn="Save edited records",Sn="Add new record",yn="Remove record",bn="Aggregate field",Cn="Group field",xn="Ungroup field",wn="CalculatedField Context menu",Tn="Window resize",Mn="Navigate row page",Dn="Navigate column page",On="Change row page size",Nn="Change column page size",Pn="Change sub-totals position",En="Change grand totals position",In="Enable defer layout update",Fn="Disable defer layout update",Ln="Aggregate menu open",An="Open value settings dialog",Rn="Calculated field applied",kn="Edited records saved",jn="New record added",qn="Record removed",Hn="Field list closed",Vn="Field tree sorted",Un="Report saved",Bn="New report added",_n="Report re-saved",Gn="Report renamed",zn="Report removed",Wn="Excel exported",Qn="CSV exported",Yn="PDF exported",Kn="PNG exported",Xn="JPEG exported",Jn="SVG exported",Zn="Conditional formatting applied",$n="Number formatting applied",es="Table view shown",ts="Chart view shown",is="Sub-totals hidden",as="Row sub-totals shown",rs="Column sub-totals shown",ns="Sub-totals shown",ss="Grand totals hidden",os="Row grand totals shown",ls="Column grand totals shown",ds="Grand totals shown",ps="Value sorted",hs="Calculated field edited",us="Field sorted",cs="Field filtered",gs="Field removed",ms="Field aggregated",fs="Field grouped",vs="Field ungrouped",Ss="Record edited",ys="Report changed",bs="Window resized",Cs="Records updated",xs="Drill-through closed",ws="Vertically scrolled",Ts="Horizontally scrolled",Ms="Row page navigated",Ds="Column page navigated",Os="Row page size changed",Ns="Column page size changed",Ps="Sub-totals position changed",Es="Grand totals position changed",Is="Legend shown",Fs="Legend hidden",Ls="Multiple axis enabled",As="Multiple axis disabled",Rs="Action dropped",ks="Invalid formula",js="Field list refreshed",qs="Value settings dialog closed",Hs=function(){function e(){}return e.getType=function(e){var t=new Date(e);return"boolean"==typeof e?"boolean":isNaN(Number(e))?t instanceof Date&&!isNaN(t.valueOf())?t&&t.getDay()&&(t.getHours()>0||t.getMinutes()>0||t.getSeconds()>0||t.getMilliseconds()>0)?"datetime":"date":typeof e:"number"},e.resetTime=function(e){return e.setHours(0,0,0,0),e},e.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},e.getClonedCSVData=function(e){return e.map(function(e){return e.slice()})},e.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},e.inArray=function(e,t){if(t)for(var i=0,a=t.length;i<a;i++)if(t[i]===e)return i;return-1},e.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)},e.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:(0,t.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)})},e.getClonedFieldList=function(e,t){for(var i=Object.keys(e),a={},r=0,n=i.length;r<n;r++){var s=e[i[r]];e[i[r]]&&(a[i[r]]={type:s.type,caption:s.caption,id:s.id,isSelected:s.isSelected,sort:s.sort,filterType:s.filterType,index:s.index,filter:t?[]:s.filter,isCustomField:s.isCustomField,showRemoveIcon:s.showRemoveIcon,showFilterIcon:s.showFilterIcon,showSortIcon:s.showSortIcon,showNoDataItems:s.showNoDataItems,isCalculatedField:s.isCalculatedField,showEditIcon:s.showEditIcon,showValueTypeIcon:s.showValueTypeIcon,allowDragAndDrop:s.allowDragAndDrop,showSubTotals:s.showSubTotals,expandAll:s.expandAll,pid:s.pid,aggregateType:s.aggregateType,baseField:s.baseField,baseItem:s.baseItem,dateMember:t?[]:this.cloneDateMembers(s.dateMember),members:t?{}:this.cloneFormatMembers(s.members),formatString:s.formatString,format:s.format,formula:s.formula,isExcelFilter:s.isExcelFilter,membersOrder:s.membersOrder?s.membersOrder.slice():s.membersOrder,isAlphanumeric:s.isAlphanumeric,tag:s.tag,expanded:s.expanded,spriteCssClass:s.spriteCssClass,name:s.name,defaultHierarchy:s.defaultHierarchy,hasAllMember:s.hasAllMember,allMember:s.allMember,isChecked:s.isChecked,filterMembers:this.cloneFieldMembers(s.filterMembers),childMembers:t?[]:this.cloneFieldMembers(s.childMembers),searchMembers:t?[]:this.cloneFieldMembers(s.searchMembers),htmlAttributes:this.getDefinedObj(s.htmlAttributes),currrentMembers:t?{}:this.cloneFormatMembers(s.currrentMembers),isHierarchy:s.isHierarchy,isNamedSets:s.isNamedSets,actualFilter:s.actualFilter?s.actualFilter.slice():s.actualFilter,levels:t?[]:this.cloneFieldMembers(s.levels),levelCount:s.levelCount,fieldType:s.fieldType,memberType:s.memberType,parentHierarchy:s.parentHierarchy})}return a},e.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},e.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():n.index,isDrilled:n.isDrilled,ordinal:n.ordinal}}return i}return e},e.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},e.updateDataSourceSettings=function(e,i){e&&this.setPivotProperties(e,{dataSourceSettings:this.getDefinedObj({type:i.type,catalog:i.catalog,cube:i.cube,providerType:i.providerType,url:i.url,localeIdentifier:i.localeIdentifier,excludeFields:(0,t.isNullOrUndefined)(i.excludeFields)?[]:i.excludeFields,expandAll:i.expandAll,allowLabelFilter:i.allowLabelFilter,allowValueFilter:i.allowValueFilter,allowMemberFilter:i.allowMemberFilter,enableSorting:!!i.enableSorting,rows:i.rows,columns:i.columns,filters:i.filters,values:i.values,filterSettings:i.filterSettings,sortSettings:i.sortSettings,drilledMembers:i.drilledMembers,valueSortSettings:i.valueSortSettings,valueAxis:i.valueAxis,grandTotalsPosition:i.grandTotalsPosition,formatSettings:i.formatSettings,calculatedFieldSettings:i.calculatedFieldSettings,fieldMapping:i.fieldMapping,showSubTotals:i.showSubTotals,showRowSubTotals:i.showRowSubTotals,showColumnSubTotals:i.showColumnSubTotals,subTotalsPosition:i.subTotalsPosition,showGrandTotals:i.showGrandTotals,showRowGrandTotals:i.showRowGrandTotals,showColumnGrandTotals:i.showColumnGrandTotals,showHeaderWhenEmpty:i.showHeaderWhenEmpty,alwaysShowValueHeader:i.alwaysShowValueHeader,conditionalFormatSettings:i.conditionalFormatSettings,emptyCellsTextContent:i.emptyCellsTextContent,groupSettings:i.groupSettings,showAggregationOnValueField:i.showAggregationOnValueField,authentication:this.CloneAuthenticationObject(i.authentication)})})},e.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},e.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,formula:r.formula,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},e.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():r.items,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},e.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():r.membersOrder}))}return t}return e},e.getFormattedHeader=function(t,i){var a=e.frameHeaderWithKeys(t);if(a.valueSort&&a.valueSort.axis){var r=a.valueSort.axis,n=this.isDateField(r,i);a.formattedText=n||!i.formatFields[r]||!0===t.isSum?a.formattedText:i.getFormattedValue(a.actualText,r).formattedText}return a},e.getFormattedMembers=function(e,t,i,a,r){var n=this.isDateField(t,i);if(n||i.groupingFields[t]){for(var s={},o=Object.keys(e),l=i.fieldList[t].dateMember,d=0,p=o.length;d<p;d++){var h=e[o[d]];if(n&&(a||r))s[h.caption]=h;else s[l[h.ordinal-1].actualText]=h}return s}return e},e.isDateField=function(e,t){return t.formatFields[e]&&["date","dateTime","time"].indexOf(t.formatFields[e].type)>-1},e.formatChartHeaders=function(e,i,a,r){for(var n=[],s=0,o=e.length;s<o;s++){var l=a?i.parent.dataSourceSettings.columns.length>0&&!(0,t.isNullOrUndefined)(i.parent.dataSourceSettings.columns[s])?i.parent.dataSourceSettings.columns[s].name:void 0:i.parent.dataSourceSettings.rows.length>0&&!(0,t.isNullOrUndefined)(i.parent.dataSourceSettings.rows[s])?i.parent.dataSourceSettings.rows[s].name:void 0;(0,t.isNullOrUndefined)(l)?r&&r.isGrandSum?n.push(i.parent.localeObj.getConstant("grandTotal")):n.push(e[s]):i.engineModule.formatFields[l]&&["date","dateTime","time"].indexOf(i.engineModule.formatFields[l].type)>-1?n.push(e[s]):n.push(i.engineModule.getFormattedValue(e[s],l).formattedText)}return n.join(" - ")},e.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():r.items}))}return t}return e},e.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},e.CloneValueSortObject=function(e){return e?{columnIndex:e.columnIndex,headerDelimiter:e.headerDelimiter,headerText:e.headerText,measure:e.measure,sortOrder:e.sortOrder,columnHeaderText:e.columnHeaderText,rowHeaderText:e.rowHeaderText,rowSortOrder:e.rowSortOrder,columnSortOrder:e.columnSortOrder}:e},e.CloneAuthenticationObject=function(e){return e?{userName:e.userName,password:e.password}:e},e.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},e.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}:r.style,value1:r.value1,value2:r.value2}))}return t}return e},e.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},e.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():r.items}))}return t}return e},e.getFilterItemByName=function(e,t){var a=new i.DataManager({json:t}).executeLocal((new i.Query).where("name","equal",e));if(a&&a.length>0)return a[a.length-1]},e.getFieldByName=function(e,t){return new i.DataManager({json:t}).executeLocal((new i.Query).where("name","equal",e))[0]},e.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};var l="olap"===t.dataType?t.olapEngineModule.fieldList[e]:t.engineModule.fieldList[e];return{fieldName:e,fieldItem:l?{name:e,caption:l.caption,baseField:l.baseField,baseItem:l.baseItem,isCalculatedField:l.isCalculatedField,isNamedSet:l.isNamedSets,showNoDataItems:l.showNoDataItems,showSubTotals:l.showSubTotals,type:l.aggregateType,showFilterIcon:l.showFilterIcon,showSortIcon:l.showSortIcon,showRemoveIcon:l.showRemoveIcon,showValueTypeIcon:l.showValueTypeIcon,showEditIcon:l.showEditIcon,allowDragAndDrop:l.allowDragAndDrop,expandAll:l.expandAll}:void 0,axis:"fieldlist",position:-1}},e.isButtonIconRefesh=function(e,i,a){var r=!1;try{if("dataSourceSettings"===e&&i.dataSourceSettings&&a.dataSourceSettings){var n=["notAvail","notAvail","notAvail","notAvail"],s=Object.keys(i.dataSourceSettings),o=Object.keys(a.dataSourceSettings);if(s&&o&&o.length>0&&s.length===o.length)for(var l=["rows","columns","values","filters"],d=0;d<o.length;d++){var p=o[d]in i.dataSourceSettings&&!(0,t.isNullOrUndefined)(i.dataSourceSettings[o[d]])?Object.keys(i.dataSourceSettings[o[d]]):[],h=o[d]in a.dataSourceSettings&&!(0,t.isNullOrUndefined)(a.dataSourceSettings[o[d]])?Object.keys(a.dataSourceSettings[o[d]]):[];if(-1!==l.indexOf(o[d])&&-1!==l.indexOf(s[d])&&p&&h&&h.length>0&&p.length===h.length)for(var u=["showFilterIcon","showSortIcon","showRemoveIcon","showValueTypeIcon","showEditIcon","allowDragAndDrop","expandAll"],c=0;c<h.length;c++){for(var g=Object.keys(i.dataSourceSettings[o[d]][h[c]]),m=Object.keys(a.dataSourceSettings[o[d]][h[c]]),f=0;f<m.length;f++){if(-1===u.indexOf(m[f])||-1===u.indexOf(g[f])){n[d]="break";break}n[d]="update"}if("break"===n[d])break}else n[d]="break";if("break"===n[d])break}for(var v=0,S=0,y=0,b=0,C=n;b<C.length;b++){var x=C[b];"break"===x&&v++,"notAvail"===x&&S++,"update"===x&&y++}r=!(v>0||4===S)&&(0===v&&S<4&&y>0)}}catch(e){r=!1}return r},e.frameContent=function(e,t,i,a){var r=[],n=a;if(n.dataSourceSettings.values.length>0&&!n.engineModule.isEmptyData&&(n.enableValueSorting||!n.engineModule.isEngineUpdated))for(var s=0,o="value"===t?i:0,l="value"===t?e.length:i,d=o;d<l;d++)if(e[d]){r[s="header"===t?d:s]={};for(var p=0;p<e[d].length;p++)e[d][p]&&(r[s][p]=e[d][p]);s++}return r},e.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},e.generateUUID=function(){var e=(new Date).getTime(),t=performance&&performance.now&&1e3*performance.now()||0;return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){var a=16*Math.random();return e>0?(a=(e+a)%16|0,e=Math.floor(e/16)):(a=(t+a)%16|0,t=Math.floor(t/16)),("x"===i?a:3&a|8).toString(16)})},e.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()).length>t.length&&(s=s.filter(function(e){return t.some(function(t){var a=r?t.formattedText:"string"===i||"number"===i?t.actualText:t.dateText;return typeof e==typeof a&&a===e})}));var o=[],l=void 0===i||"string"===i||"number"===i;t.length>0&&"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}d>=0&&!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},e.applyHeadersSort=function(e,t,i,a){if(a)e=e.sort(function(e,i){var a=e.actualText,r=i.actualText;return"Grand Total"===a||"Grand Total"===r?0:"Out of Range"===a?1:"Out of Range"===r?-1:isNaN(parseFloat(a))||isNaN(parseFloat(r))?"Ascending"===t?a.localeCompare(r,void 0,{numeric:!0,sensitivity:"base"}):r.localeCompare(a,void 0,{numeric:!0,sensitivity:"base"}):"Ascending"===t?parseFloat(a)-parseFloat(r):parseFloat(r)-parseFloat(a)});else if("datetime"===i||"date"===i||"time"===i)e="Ascending"===t?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"===t?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;else if(!0===i)e="Ascending"===t?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"===t?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;else if("string"===i){if("None"===t)return e;e.sort(function(e,i){return"Ascending"===t?"Grand Total"===String(e.actualText)||"Grand Total"===String(i.actualText)?0:String(e.actualText).localeCompare(String(i.actualText),void 0,{sensitivity:"base"}):"Grand Total"===String(e.actualText)||"Grand Total"===String(i.actualText)?0:String(i.actualText).localeCompare(String(e.actualText),void 0,{sensitivity:"base"})})}else e="Ascending"===t?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"===t?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;return e},e.renderOlapEngine=function(e,t){try{e.olapEngineModule.renderEngine(e.dataSourceSettings,t||e.frameCustomProperties(e.olapEngineModule.fieldListData,e.olapEngineModule.fieldList),e.onHeadersSort?e.getHeaderSortInfo.bind(e):void 0,e.beforeServiceInvoke?e.getBeforeServiceInvoke.bind(e):void 0,e.afterServiceInvoke?e.getAfterServiceInvoke.bind(e):void 0),e.setProperties({dataSourceSettings:{valueIndex:e.olapEngineModule.measureIndex}},!0)}catch(t){e.actionObj.actionName="engineFormation",e.olapEngineModule.errorInfo?(e.actionFailureMethod(e.olapEngineModule.errorInfo),e.olapEngineModule.errorInfo=void 0):e.actionFailureMethod(t)}},e.frameHeaderWithKeys=function(e){for(var t=Object.keys(e),i=0,a={};i<t.length;)a[t[i]]=e[t[i]],i++;return a},e.getPageSize=function(e){switch(e){case"Letter":return new a.SizeF(612,792);case"Note":return new a.SizeF(540,720);case"Legal":return new a.SizeF(612,1008);case"A0":return new a.SizeF(2380,3368);case"A1":return new a.SizeF(1684,2380);case"A2":return new a.SizeF(1190,1684);case"A3":return new a.SizeF(842,1190);case"A5":return new a.SizeF(421,595);case"A6":return new a.SizeF(297,421);case"A7":return new a.SizeF(210,297);case"A8":return new a.SizeF(148,210);case"A9":return new a.SizeF(105,148);case"B0":return new a.SizeF(2836,4008);case"B1":return new a.SizeF(2004,2836);case"B2":return new a.SizeF(1418,2004);case"B3":return new a.SizeF(1002,1418);case"B4":return new a.SizeF(709,1002);case"B5":return new a.SizeF(501,709);case"Archa":return new a.SizeF(648,864);case"Archb":return new a.SizeF(864,1296);case"Archc":return new a.SizeF(1296,1728);case"Archd":return new a.SizeF(1728,2592);case"Arche":return new a.SizeF(2592,3456);case"Flsa":return new a.SizeF(612,936);case"HalfLetter":return new a.SizeF(396,612);case"Letter11x17":return new a.SizeF(792,1224);case"Ledger":return new a.SizeF(1224,792);default:return new a.SizeF(595,842)}},e.getSortedValue=function(e,t){return e.sort(function(e,i){return"Descending"===t?(i.value||"grand sum"===i.header.type?i.value:0)-(e.value||"grand sum"===e.header.type?e.value:0):(e.value||"grand sum"===e.header.type?e.value:0)-(i.value||"grand sum"===i.header.type?i.value:0)}),e.map(function(e){return e.header})},e.toggleFieldListIconVisibility=function(e){e.showFieldList&&(0,t.select)("#"+e.element.id+"_PivotFieldList",e.element)&&(e.toolbar&&-1!==e.toolbar.indexOf("FieldList")?(0,t.select)("#"+e.element.id+"_PivotFieldList",e.element).style.display="none":((0,t.select)("#"+e.element.id+"_PivotFieldList",e.element).style.top=e.element.querySelector("."+Zt).offsetHeight.toString()+"px",(0,t.select)("#"+e.element.id+"_PivotFieldList",e.element).style.position="relative")),e.toolbar&&-1!==e.toolbar.indexOf("FieldList")&&e.showToolbar&&e.element.querySelector("."+f)&&(e.element.querySelector("."+f).style.display="none")},e.isMemberDrilled=function(e,t,i){for(var a=!1,r=0;r<i.length;r++)for(var n=i[r].items,s=0;s<n.length&&!a;s++)for(var o=n[s].split(i[r].delimiter),l=e.formattedText.split(" "),d=[],p=0;p<l.length;p++)if(d.push(l[p]),d.join(" ")===o[o.length-1])for(var h=0;h<t.length&&o[h];h++){if(o[h]!==t[h]||o[0]!==t[0]){a=!1;break}a=!0}return a},e.getPivotEmptyInfo=function(e,i){var a=!(0,t.isNullOrUndefined)(e)&&!(0,t.isNullOrUndefined)(e.dataSourceSettings)&&e.dataSourceSettings.values&&e.dataSourceSettings.values.length>0;return"olap"===e.dataType&&""!==e.dataSourceSettings.url&&i.isEmptyData||"pivot"===e.dataType&&e.engineModule.data.length>0&&(!a||i.isEmptyData)},e.getEmptyPivotValues=function(t){var i=t&&t.localeObj,a=i?i.getConstant("emptyData"):"No records to display",r=i?i.getConstant("grandTotal"):"Grand Total",n=e.createGrandTotalCell(r);return[[null,Object.assign({},n,{axis:"column",colIndex:1,rowIndex:0})],[Object.assign({},n,{axis:"row",colIndex:0,rowIndex:1}),{axis:"value",isDrilled:!1,indexObject:{},members:[],actualText:a,formattedText:a,rowIndex:1,colIndex:1,rowSpan:1,colSpan:1}]]},e.createGrandTotalCell=function(e){return{hasChild:!1,index:[],level:0,isDrilled:!1,indexObject:{},members:[],actualText:e,formattedText:e,ordinal:0,type:"grand sum",valueSort:{"Grand Total":1,levelName:e,uniqueName:e},rowSpan:1,colSpan:1}},e.getAppendToElement=function(e,t){if(t){var i=e.closest("mat-dialog-container");if(i)return i}return document.body},e.invokeActionMethod=function(e,t,i,a,r){if(e.actionObj.actionName=i,a&&(e.actionObj.actionInfo=a),r&&(e.actionObj.fieldInfo=r),t===or)return e.actionBeginMethod();t===lr&&e.actionCompleteMethod()},e}(),Vs=function(){return Vs=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},Vs.apply(this,arguments)},Us=function(){function e(){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.lastMember={},this.rMembers=[],this.cMembers=[],this.groupingFields={},this.isLastHeaderHasMeasures=!0,this.measureIndex=-1,this.isPagingOrVirtualizationEnabled=!1,this.rowMaxLevel=0,this.valueMatrix=[],this.topBottomFilterCache={},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.tabularPivotValues=[],this.sortMembers={},this.isFilterAction=!1,this.levelMap={},this.isMultiValueRowAxis=!1,this.isTabularMultiValueRowAxis=!1,this.viewportPageCount=3}return e.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.lastMember={},this.slicedHeaders=[],this.fieldFilterMem={},this.filterPosObj={},this.selectedHeaders={selectedHeader:[],values:[]},this.rowGrandTotal=null,this.columnGrandTotal=null,this.rawIndexObject={},this.topBottomFilterCache={},this.headerObjectsCollection={},this.fieldDrillCollection={},this.sortMembers={}},e.prototype.renderEngine=function(e,a,r,n){if(this.getValueCellInfo=r,this.getHeaderSortInfo=n,this.customProperties=a,this.fieldList)for(var s=0,o=e.formatSettings;s<o.length;s++)!this.formatFields[o[s].name]&&this.fieldList[o[s].name]&&(this.fieldList[o[s].name].members={},this.fieldList[o[s].name].formattedMembers={},this.fieldList[o[s].name].dateMember=[]);var l;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=(0,t.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=a&&a.globalize?a.globalize:new t.Internationalization,this.currencyCode=a&&a.currenyCode?a.currenyCode:void 0,this.localeObj=a?a.localeObj:void 0,this.fieldsType=a?a.fieldsType:{},this.clonedReport=a?a.clonedReport&&a.clonedReport.properties?a.clonedReport.properties:a.clonedReport:{},this.enablePaging=a.enablePaging,this.enableVirtualization=a.enableVirtualization,this.enableOptimizedRendering=a.enableOptimizedRendering,this.enableHtmlSanitizer=a.enableHtmlSanitizer,this.isPagingOrVirtualizationEnabled=this.enablePaging||this.enableVirtualization,this.enableSort=e.enableSorting,this.dataSourceSettings.alwaysShowValueHeader=e.alwaysShowValueHeader,this.dataSourceSettings.showHeaderWhenEmpty=!!(0,t.isNullOrUndefined)(e.showHeaderWhenEmpty)||e.showHeaderWhenEmpty,this.dataSourceSettings.showSubTotals=!!(0,t.isNullOrUndefined)(e.showSubTotals)||e.showSubTotals,this.dataSourceSettings.showRowSubTotals=!!(0,t.isNullOrUndefined)(e.showRowSubTotals)||e.showRowSubTotals,this.dataSourceSettings.showColumnSubTotals=!!(0,t.isNullOrUndefined)(e.showColumnSubTotals)||e.showColumnSubTotals,this.dataSourceSettings.showGrandTotals=!!(0,t.isNullOrUndefined)(e.showGrandTotals)||e.showGrandTotals,this.dataSourceSettings.grandTotalsPosition=(0,t.isNullOrUndefined)(e.grandTotalsPosition)?"Bottom":e.grandTotalsPosition,this.dataSourceSettings.showRowGrandTotals=!!(0,t.isNullOrUndefined)(e.showRowGrandTotals)||e.showRowGrandTotals,this.dataSourceSettings.showColumnGrandTotals=!!(0,t.isNullOrUndefined)(e.showColumnGrandTotals)||e.showColumnGrandTotals,this.showSubTotalsAtTop=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&"Top"===e.subTotalsPosition,this.showSubTotalsAtBottom=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals&&"Bottom"===e.subTotalsPosition||a.isTabularLayout,this.allowValueFilter=e.allowValueFilter,this.isValueFilterEnabled=!1,this.enableValueSorting=!!a&&a.enableValueSorting,this.isDrillThrough=!!a&&(!!a.isDrillThrough&&a.isDrillThrough),this.valueContent=[],this.dataSourceSettings=Hs.getClonedDataSourceSettings(e),e.dataSource instanceof i.DataManager||("CSV"===e.type?(this.data=e.dataSource.map(function(e){return e.slice()}),this.fieldList&&this.data.shift()):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]),this.fieldKeys={};for(s=0;s<this.fields.length;s++)this.fieldKeys[this.fields[s]]="CSV"===e.type?s:this.fields[s]}a&&a.pageSettings&&a.allowDataCompression&&(this.actualData=this.data,this.data=this.getGroupedRawData(e)),this.dataSourceSettings.rows=e.rows?e.rows:[],this.dataSourceSettings.columns=e.columns?e.columns:[],this.dataSourceSettings.filters=e.filters?e.filters:[],this.dataSourceSettings.values=e.values?e.values:[],this.dataSourceSettings.formatSettings=e.formatSettings?e.formatSettings:[],this.dataSourceSettings.groupSettings=e.groupSettings?e.groupSettings:[],this.dataSourceSettings.calculatedFieldSettings=e.calculatedFieldSettings?e.calculatedFieldSettings:[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.dataSourceSettings.fieldMapping=e.fieldMapping?e.fieldMapping:[],this.valueAxisFields={};for(var d=0,p=this.dataSourceSettings.values;d<p.length;d++){var h=p[d];this.valueAxisFields[h.name]=h}l=this.getGroupData(this.data),this.validateFilters(e),this.isExpandAll=!(!this.isValueFiltersAvail||!e.allowValueFilter)||e.expandAll,this.drilledMembers=e.drilledMembers?this.isValueFiltersAvail&&e.allowValueFilter?[]:e.drilledMembers:[],this.isMultiMeasures=this.dataSourceSettings.values.length>1,this.valueAxis="row"===e.valueAxis?1:0,this.measureIndex=(0,t.isNullOrUndefined)(e.valueIndex)?-1:e.valueIndex,this.emptyCellTextContent=e.emptyCellsTextContent?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||{rowSortOrder:"None",rowHeaderText:"",columnSortOrder:"None",columnHeaderText:"",headerDelimiter:".",columnIndex:void 0,rowIndex:void 0},this.valueSortData=[],this.pageSettings=a?a.pageSettings?a.pageSettings:this.pageSettings:void 0,this.allowDataCompression=a&&a.allowDataCompression,this.savedFieldList=a?a.savedFieldList:void 0,this.getFieldList(l,this.enableSort,e.allowValueFilter),this.removeIrrelevantFields(Object.keys(this.fieldList)),this.fillFieldMembers(),this.updateSortSettings(e.sortSettings,this.enableSort),this.filterMembers=[];var u=this.dataSourceSettings.columns.length-1;for(this.columnKeys={};u>-1;)this.columnKeys[this.dataSourceSettings.columns[u].name]=this.dataSourceSettings.columns[u],u--;this.isMultiValueRowAxis="row"===this.dataSourceSettings.valueAxis&&(this.dataSourceSettings.values.length>1||this.dataSourceSettings.alwaysShowValueHeader)&&this.dataSourceSettings.rows.length>0,this.isTabularMultiValueRowAxis=this.isMultiValueRowAxis&&a.isTabularLayout,this.updateFilterMembers(e),this.generateGridData(e)}},e.prototype.removeIrrelevantFields=function(e){var i={};i[0]=this.dataSourceSettings.rows,i[1]=this.dataSourceSettings.columns,i[2]=this.dataSourceSettings.values,i[3]=this.dataSourceSettings.filters;for(var a=0;a<4;){if(i[a])for(var r=0;r<i[a].length;r++){var n=i[a][r].name;this.dataSourceSettings.excludeFields.indexOf(n)>-1||!(0,t.isNullOrUndefined)(e)&&-1===e.indexOf(n)?(i[a].splice(r,1),r--):2===a&&(this.measureNames[n]=i[a][r].caption?i[a][r].caption:n,this.measureNames[i[a][r].caption?i[a][r].caption:n]=n)}a++}this.isMultiMeasures=this.dataSourceSettings.values.length>1,this.measureIndex=-1===this.measureIndex?this.valueAxis?i[0].length:i[1].length:this.measureIndex},e.prototype.updateDataSourceSettings=function(e,i){i&&(this.emptyCellTextContent=e.emptyCellsTextContent?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=(0,t.isNullOrUndefined)(e.valueIndex)?-1:e.valueIndex,this.enableSort=e.enableSorting,this.dataSourceSettings.alwaysShowValueHeader=e.alwaysShowValueHeader,this.dataSourceSettings.showHeaderWhenEmpty=!!(0,t.isNullOrUndefined)(e.showHeaderWhenEmpty)||e.showHeaderWhenEmpty,this.dataSourceSettings.showSubTotals=!!(0,t.isNullOrUndefined)(e.showSubTotals)||e.showSubTotals,this.dataSourceSettings.showRowSubTotals=!!(0,t.isNullOrUndefined)(e.showRowSubTotals)||e.showRowSubTotals,this.dataSourceSettings.showColumnSubTotals=!!(0,t.isNullOrUndefined)(e.showColumnSubTotals)||e.showColumnSubTotals,this.dataSourceSettings.showGrandTotals=!!(0,t.isNullOrUndefined)(e.showGrandTotals)||e.showGrandTotals,this.dataSourceSettings.grandTotalsPosition=(0,t.isNullOrUndefined)(e.grandTotalsPosition)?"Bottom":e.grandTotalsPosition,this.dataSourceSettings.showRowGrandTotals=!!(0,t.isNullOrUndefined)(e.showRowGrandTotals)||e.showRowGrandTotals,this.dataSourceSettings.showColumnGrandTotals=!!(0,t.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?e.formatSettings:[],this.dataSourceSettings.groupSettings=e.groupSettings?e.groupSettings:[],this.dataSourceSettings.calculatedFieldSettings=e.calculatedFieldSettings?e.calculatedFieldSettings:[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.dataSourceSettings.fieldMapping=e.fieldMapping?e.fieldMapping:[],this.dataSourceSettings.values=e.values?e.values:[],this.dataSourceSettings.rows=e.rows?e.rows:[],this.dataSourceSettings.columns=e.columns?e.columns:[],this.dataSourceSettings.filters=e.filters?e.filters:[],this.dataSourceSettings.filterSettings=e.filterSettings?e.filterSettings:[],this.dataSourceSettings.sortSettings=e.sortSettings?e.sortSettings:[],this.dataSourceSettings.conditionalFormatSettings=e.conditionalFormatSettings?e.conditionalFormatSettings:[],this.dataSourceSettings.valueSortSettings=e.valueSortSettings?e.valueSortSettings:{},this.removeIrrelevantFields(Object.keys(this.fieldList)))},e.prototype.getGroupedRawData=function(e){this.data=[];for(var i=0,a=this.actualData;i<a.length;i++){var r=a[i];this.data[this.data.length]=Hs.frameHeaderWithKeys(r)}var n=e.values.filter(function(e){return"Count"===e.type||"DistinctCount"===e.type}).map(function(e){return e.name}),s=n.length>0,o=this.data,l=e.rows.concat(e.columns.concat(e.filters)).map(function(e){return e.name}),d={},p=[];this.groupRawIndex={};for(var h={},u=0,c=0;c<o.length;c++){var g=o[c],m=[];if(s)for(var f=0;f<n.length;f++)g[this.fieldKeys[n[f]]]=(0,t.isNullOrUndefined)(g[this.fieldKeys[n[f]]])?g[this.fieldKeys[n[f]]]:1;for(var v=0;v<l.length;v++)m.push(g[this.fieldKeys[l[v]]]);var S=m.join("-");if(d[S]){for(f=0;f<e.values.length;f++){var y=e.values[f].name,b=g[this.fieldKeys[y]],C=d[S],x=e.values[f].type;(0,t.isNullOrUndefined)(b)||("number"==typeof b&&"DistinctCount"!==x||(x="Count"),(0,t.isNullOrUndefined)(C[y])?C[y]="Product"===x?1:"Min"===x||"Max"===x?void 0:0:"number"!=typeof C[y]&&(C[y]=1),"Count"===x?C[y]+=1:"Min"===x?(0,t.isNullOrUndefined)(C[y])||(C[y]=C[y]>b?b:C[y]):"Max"===x?(0,t.isNullOrUndefined)(C[y])||(C[y]=C[y]<b?b:C[y]):"Product"===x?C[y]*=b:C[y]+=b)}this.isDrillThrough&&this.groupRawIndex[h[S]].push(c)}else d[S]=g,p.push(g),this.isDrillThrough&&(this.groupRawIndex[u]=[c],h[S]=u,u++)}return p},e.prototype.getGroupData=function(e){for(var i=this,a=e[0],r=function(r,s){var o=s[r],l=o.name,d=o.caption;if(!(n.fields.indexOf(l)>-1))return r<s.length-1?"continue":{value:a};var p={},h=void 0;if("Date"===o.type&&n.groupingFields[l]||"Custom"===o.type&&n.groupingFields[l])return{value:a};if("Number"===o.type){if("number"!==Hs.getType(a[l])&&n.groupingFields[l])return{value:a};o.rangeInterval&&e.sort(function(e,t){return Number(e[i.fieldKeys[l]])>Number(t[i.fieldKeys[l]])?1:Number(t[i.fieldKeys[l]])>Number(e[i.fieldKeys[l]])?-1:0})}for(var u=e.length;u--;){var c=e[u],g=c[n.fieldKeys[l]];if(!g&&""!==g||"Date"!==o.type)if(isNaN(Number(c[n.fieldKeys[l]]))||"Number"!==o.type){if(c[n.fieldKeys[l]]&&"Custom"===o.type&&o.customGroups&&o.customGroups.length>0){N=l+"_custom_group";var m=o.customGroups,f=void 0;n.groupingFieldsInfo[l]=l,n.groupingFieldsInfo[N]=l;for(var v=0,S=m.length;v<S;v++){var y=m[v];if(y.items&&y.items.length>1){h=N,n.fieldKeys[N]="CSV"===n.dataSourceSettings.type?n.fieldKeys[N]?n.fieldKeys[N]:n.fields.length:N,-1===n.fields.indexOf(N)&&n.fields.push(N);var b=-1!==Hs.inArray(c[n.fieldKeys[l]].toString(),y.items);c[n.fieldKeys[N]]=b?y.groupName&&""!==y.groupName?y.groupName:n.localeObj.getConstant("group")+" "+v:f&&f!==c[n.fieldKeys[l]].toString()?f:c[n.fieldKeys[l]].toString(),f=c[n.fieldKeys[N]]}}}}else{M=n.getRange(o,Number(c[n.fieldKeys[l]]));c[n.fieldKeys[l]]=M?void 0:c[n.fieldKeys[l]]}else{var C=new Date(g.toString());if(!(0,t.isNullOrUndefined)(C)&&o.groupInterval.length>0)for(var x=0,w=o.groupInterval.length;x<w;x++){var T=o.groupInterval[x],M=n.getRange(o,C.getTime()),D=Hs.resetTime(new Date);switch(T){case"Years":p[N=x===o.groupInterval.length-1?l:l+"_date_group_years"]=T,n.fieldKeys[N]="CSV"===n.dataSourceSettings.type?n.fieldKeys[N]?n.fieldKeys[N]:n.fields.length:N,-1===n.fields.indexOf(N)&&n.fields.push(N),c[n.fieldKeys[N]]=M?void 0:new Date(D.setFullYear(C.getFullYear())).toString();break;case"Quarters":p[N=x===o.groupInterval.length-1?l:l+"_date_group_quarters"]=T;var O=Math.ceil((C.getMonth()+1)/3);n.fieldKeys[N]="CSV"===n.dataSourceSettings.type?n.fieldKeys[N]?n.fieldKeys[N]:n.fields.length:N,-1===n.fields.indexOf(N)&&n.fields.push(N),c[n.fieldKeys[N]]=M?void 0:(n.localeObj?n.localeObj.getConstant("qtr"):"Qtr")+O.toString();break;case"QuarterYear":p[N=x===o.groupInterval.length-1?l:l+"_date_group_quarterYear"]=T;O=Math.ceil((C.getMonth()+1)/3);n.fieldKeys[N]="CSV"===n.dataSourceSettings.type?n.fieldKeys[N]?n.fieldKeys[N]:n.fields.length:N,-1===n.fields.indexOf(N)&&n.fields.push(N),c[n.fieldKeys[N]]=M?void 0:(n.localeObj?n.localeObj.getConstant("qtr"):"Qtr")+O.toString()+" "+(n.localeObj?n.localeObj.getConstant("of"):"of")+" "+C.getFullYear().toString();break;case"Months":p[N=x===o.groupInterval.length-1?l:l+"_date_group_months"]=T,n.fieldKeys[N]="CSV"===n.dataSourceSettings.type?n.fieldKeys[N]?n.fieldKeys[N]:n.fields.length:N,-1===n.fields.indexOf(N)&&n.fields.push(N),c[n.fieldKeys[N]]=M?void 0:new Date(D.setMonth(C.getMonth(),1)).toString();break;case"Days":p[N=x===o.groupInterval.length-1?l:l+"_date_group_days"]=T,n.fieldKeys[N]="CSV"===n.dataSourceSettings.type?n.fieldKeys[N]?n.fieldKeys[N]:n.fields.length:N,-1===n.fields.indexOf(N)&&n.fields.push(N),c[n.fieldKeys[N]]=M?void 0:new Date(D.setMonth(C.getMonth(),C.getDate())).toString();break;case"Hours":p[N=x===o.groupInterval.length-1?l:l+"_date_group_hours"]=T,n.fieldKeys[N]="CSV"===n.dataSourceSettings.type?n.fieldKeys[N]?n.fieldKeys[N]:n.fields.length:N,-1===n.fields.indexOf(N)&&n.fields.push(N),c[n.fieldKeys[N]]=M?void 0:new Date(D.setHours(C.getHours())).toString();break;case"Minutes":p[N=x===o.groupInterval.length-1?l:l+"_date_group_minutes"]=T,n.fieldKeys[N]="CSV"===n.dataSourceSettings.type?n.fieldKeys[N]?n.fieldKeys[N]:n.fields.length:N,-1===n.fields.indexOf(N)&&n.fields.push(N),c[n.fieldKeys[N]]=M?void 0:new Date(D.setMinutes(C.getMinutes())).toString();break;case"Seconds":var N;p[N=x===o.groupInterval.length-1?l:l+"_date_group_seconds"]=T,n.fieldKeys[N]="CSV"===n.dataSourceSettings.type?n.fieldKeys[N]?n.fieldKeys[N]:n.fields.length:N,-1===n.fields.indexOf(N)&&n.fields.push(N),c[n.fieldKeys[N]]=M?void 0:new Date(D.setSeconds(C.getSeconds())).toString()}}}for(var P=[],E=0,I=ve=Object.keys(c);E<I.length;E++){var F=I[E];P.push(!!c[F])}a=-1===P.indexOf(!1)&&ve.length===Object.keys(e[0]).length?c:a}if("Date"===o.type){for(var L=!1,A=[n.dataSourceSettings.rows,n.dataSourceSettings.columns,n.dataSourceSettings.values,n.dataSourceSettings.filters],R=Object.keys(p),k=Object.keys(R).length,j=void 0,q=0,H=A;q<H.length;q++){var V=H[q];if(!L&&V){for(var U=V.length,B=0;B<U;){if(V[B].name===l){L=!0;var _=V[B];for(V.splice(B,1),De=(De=n.dataSourceSettings.rows).concat(n.dataSourceSettings.columns,n.dataSourceSettings.values,n.dataSourceSettings.filters);k--;){var G=_.caption?_.caption:_.name;if(n.clonedReport){var z=n.clonedReport.rows;z=z.concat(n.clonedReport.columns,n.clonedReport.values,n.clonedReport.filters);var W=Hs.getFieldByName(R[k],z);W&&(G=W.caption?W.caption:W.name)}if(Hs.getFieldByName(R[k],De))n.groupingFieldsInfo[R[k]]=l;else{j=p[R[k]],G=-1!==G.indexOf(" (")&&-1!==G.indexOf(")")?G.slice(G.indexOf("(")+1,G.length-1):G;var Q={name:R[k],caption:(n.localeObj?n.localeObj.getConstant(j):j)+" ("+G+")",type:"Count",showNoDataItems:_.showNoDataItems,baseField:_.baseField,baseItem:_.baseItem,showFilterIcon:_.showFilterIcon,showSortIcon:_.showSortIcon,showEditIcon:_.showEditIcon,showRemoveIcon:_.showRemoveIcon,showSubTotals:_.showValueTypeIcon,allowDragAndDrop:_.allowDragAndDrop,expandAll:_.expandAll,groupName:_.groupName};V.splice(B,0,Q),n.groupingFieldsInfo[Q.name]=l}}break}if(V[B].name.indexOf(l)>-1){var Y=p[V[B].name],K=V.filter(function(e){return e.name===l})[0];if(!(0,t.isNullOrUndefined)(K)){var X=K.caption?-1!==K.caption.indexOf(" (")&&-1!==K.caption.indexOf(")")?K.caption.slice(K.caption.indexOf("(")+1,K.caption.length-1):K.caption:l;V[B].caption=(n.localeObj?n.localeObj.getConstant(Y):K)+" ("+X+")"}}B++}if(L)break}}k=Object.keys(R).length;for(var J=(xe=n.getMappingField(l,n.clonedReport?n.clonedReport.fieldMapping:n.dataSourceSettings.fieldMapping)).caption?xe.caption:l;k--;){j=p[R[k]];for(var Z=0,$=n.dataSourceSettings.formatSettings.length;Z<$;Z++)if(n.dataSourceSettings.formatSettings[Z].name===R[k]){n.dataSourceSettings.formatSettings.splice(Z,1);break}if("Quarters"!==j&&"QuarterYear"!==j){var ee={name:R[k],type:["Years","Months","Days"].indexOf(j)>-1?"date":"time",format:"Years"===j?"yyyy":"Months"===j?"MMM":"Days"===j?"d-MMM":"Hours"===j?"hh a":"Minutes"===j?":mm":"Seconds"===j?":ss":void 0};n.dataSourceSettings.formatSettings.push(ee)}if(!L){var te=n.getMappingField(R[k],n.dataSourceSettings.fieldMapping);if(R[k]!==l&&(0,t.isNullOrUndefined)(te.name)){Q={name:R[k],caption:(n.localeObj?n.localeObj.getConstant(j):j)+" ("+J+")"};n.dataSourceSettings.fieldMapping.push(Q),n.groupingFieldsInfo[Q.name]=l}else R[k]!==l&&(te.caption=(n.localeObj?n.localeObj.getConstant(j):j)+" ("+J+")",n.groupingFieldsInfo[te.name]=l)}}if(!L){te=n.getMappingField(l,n.dataSourceSettings.fieldMapping);if(j=p[l],R[k]!==l&&(0,t.isNullOrUndefined)(te.name)){Q={name:l,caption:(n.localeObj?n.localeObj.getConstant(j):j)+" ("+J+")"};n.dataSourceSettings.fieldMapping.push(Q),n.groupingFieldsInfo[Q.name]=l}else te.caption=(n.localeObj?n.localeObj.getConstant(j):j)+" ("+J+")",n.groupingFieldsInfo[te.name]=l}}else if("Number"===o.type&&o.rangeInterval){var ie=void 0,ae=[],re=[],ne=e.length;U=0;n.groupingFields[l]=l;for(var se=[];U<ne;){var oe=Number(e[U][l]);re.push(oe),isNaN(oe)||-1!==ae.indexOf(oe)||ae.push(oe),U++}for(ne=e.length,U=0;U<ne;){var le=e[U];if(le&&!isNaN(Number(le[l]))){ie=("string"==typeof o.endingAt?parseInt(o.endingAt,10):o.endingAt)||Math.max.apply(Math,ae);var de=Number.isInteger(o.rangeInterval)?0:n.countDecimalPlaces(o.rangeInterval),pe=void 0;switch(de){case 10:pe=1e-10;break;case 9:pe=1e-9;break;case 8:pe=1e-8;break;case 7:pe=1e-7;break;case 6:pe=1e-6;break;case 5:pe=1e-5;break;case 4:pe=1e-4;break;case 3:pe=.001;break;case 2:pe=.01;break;case 1:pe=.1;break;default:pe=1}var he=Number.isInteger(o.rangeInterval)?Math.floor(Number(le[l])):Number(le[l].toFixed(de)),ue=Number.isInteger(o.rangeInterval)?Math.floor(Number(he+(o.rangeInterval-1))):Number((he+o.rangeInterval).toFixed(de));if(he>=se[0]&&he<=se[se.length-1]){var ce=se[0],ge=Number.isInteger(o.rangeInterval)?Math.floor(se[se.length-1]):Number(se[se.length-1].toFixed(de));n.processGrouping(le,l,ce,ge,ie,o.rangeInterval,de),(0,t.isNullOrUndefined)(n.groupedDataType[l])&&(n.groupedDataType[l]="string")}else if(0===se.length){for(var me=he;me<=ue;me=Number((me+pe).toFixed(de)))se.push(me);ce=se[0],ge=Number.isInteger(o.rangeInterval)?Math.floor(se[se.length-1]):Number(se[se.length-1].toFixed(de));n.processGrouping(le,l,ce,ge,ie,o.rangeInterval,de),(0,t.isNullOrUndefined)(n.groupedDataType[l])&&(n.groupedDataType[l]="string")}else{ce=Number.isInteger(o.rangeInterval)?Math.floor(se[se.length-1])+1:Number(se[se.length-1].toFixed(de)),ge=Number.isInteger(o.rangeInterval)?Math.floor(ce+(o.rangeInterval-1)):Number((ce+o.rangeInterval).toFixed(de));var fe=!0;for(se.splice(0,se.length);fe;)he>=ce&&he<=ge&&(n.processGrouping(le,l,ce,ge,ie,o.rangeInterval,de),(0,t.isNullOrUndefined)(n.groupedDataType[l])&&(n.groupedDataType[l]="string"),se.push(ce),se.push(ge),fe=!1),ce=Number.isInteger(o.rangeInterval)?ge+1:ge,ge=Number.isInteger(o.rangeInterval)?Math.floor(ce+(o.rangeInterval-1)):Number((ce+o.rangeInterval).toFixed(de))}P=[];for(var ve,Se=0,ye=ve=Object.keys(le);Se<ye.length;Se++){F=ye[Se];P.push(!!le[F])}a=-1===P.indexOf(!1)&&ve.length===Object.keys(e[0]).length?le:a}U++}for(var be=0,Ce=A=[n.dataSourceSettings.rows,n.dataSourceSettings.columns,n.dataSourceSettings.values,n.dataSourceSettings.filters];be<Ce.length;be++){var xe,we=Ce[be];(xe=Hs.getFieldByName(l,we))&&((xe=xe.properties?xe.properties:xe).type="Count")}for(var Te=0,Me=n.dataSourceSettings.formatSettings.length;Te<Me;Te++)if(n.dataSourceSettings.formatSettings[Te].name===l){n.dataSourceSettings.formatSettings.splice(Te,1);break}}else if("Custom"===o.type&&h){var De,Oe=h;L=!1,A=[n.dataSourceSettings.rows,n.dataSourceSettings.columns,n.dataSourceSettings.values,n.dataSourceSettings.filters];De=(De=n.dataSourceSettings.rows).concat(n.dataSourceSettings.columns,n.dataSourceSettings.values,n.dataSourceSettings.filters);var Ne=[];d&&""!==d||(Ne=Oe.match(/_custom_group/g));for(var Pe=Hs.getFieldByName(l.replace(/_custom_group/g,""),De),Ee=Hs.getFieldByName(Oe,De),Ie=0,Fe=A;Ie<Fe.length;Ie++){V=Fe[Ie];if(!L&&V){U=V.length;for(var Le=0;Le<U;){if(V[Le].name===o.name&&!Ee){L=!0;_=V[Le],Q={name:Oe,caption:d&&""!==d?d:(Pe.caption?Pe.caption:Pe.name)+(Ne.length+1),type:"Count",showNoDataItems:_.showNoDataItems,baseField:_.baseField,baseItem:_.baseItem,showSubTotals:_.showValueTypeIcon,allowDragAndDrop:_.allowDragAndDrop,showFilterIcon:_.showFilterIcon,showSortIcon:_.showSortIcon,showRemoveIcon:_.showRemoveIcon,showEditIcon:_.showEditIcon,expandAll:_.expandAll,groupName:_.groupName};V.splice(Le,0,Q),n.groupingFieldsInfo[Q.name]=l,n.groupingFieldsInfo[l]=l;break}if(V[Le].name===Oe&&Ee){Q={name:Ee.name,caption:d&&""!==d?d:Ee.caption,type:Ee.type,showNoDataItems:Ee.showNoDataItems,baseField:Ee.baseField,baseItem:Ee.baseItem,showRemoveIcon:Ee.showRemoveIcon,showSubTotals:Ee.showValueTypeIcon,allowDragAndDrop:Ee.allowDragAndDrop,showFilterIcon:Ee.showFilterIcon,showSortIcon:Ee.showSortIcon,showEditIcon:Ee.showEditIcon,expandAll:Ee.expandAll,groupName:Ee.groupName};V.splice(Le,1,Q),n.groupingFieldsInfo[Q.name]=l,n.groupingFieldsInfo[l]=l;break}Le++}if(L)break}}var Ae=Hs.getFieldByName(l,Hs.cloneFormatSettings(n.dataSourceSettings.formatSettings));Ae&&(Ae.name=Oe,n.dataSourceSettings.formatSettings.push(Ae)),n.groupingFields[l]=l}n.groupingFields=(0,t.extend)(n.groupingFields,p)},n=this,s=0,o=this.dataSourceSettings.groupSettings;s<o.length;s++){var l=r(s,o);if("object"==typeof l)return l.value}return a},e.prototype.countDecimalPlaces=function(e){var t=e.toString();return t.includes(".")?t.split(".")[1].length:0},e.prototype.processGrouping=function(e,t,i,a,r,n,s){Number.isInteger(e[t])||!Number.isInteger(e[t])&&(Number(e[t])<a||r<=Number(e[t]))?e[t]=this.getNumberGroupHeaders(i,a,r):!Number.isInteger(e[t])&&Number(e[t])>=a&&(e[t]=this.getNumberGroupHeaders(Number((i+n).toFixed(s)),Number((a+n).toFixed(s)),r))},e.prototype.getNumberGroupHeaders=function(e,t,i){return e===t?e.toString():i>=e&&i<=t?i===e?e.toString():e.toString()+"-"+i.toString():e.toString()+"-"+t.toString()},e.prototype.getRange=function(e,t){var i;if("Date"===e.type){var a=new Date(t),r="string"==typeof e.startingAt?new Date(e.startingAt):e.startingAt,n="string"==typeof e.endingAt?new Date(e.endingAt):e.endingAt;i=!!(r&&a.getTime()<r.getTime()||n&&a.getTime()>n.getTime())}else{var s="string"==typeof e.startingAt?parseFloat(e.startingAt):e.startingAt,o="string"==typeof e.endingAt?parseFloat(e.endingAt):e.endingAt;i=!isNaN(s)&&t<s||!isNaN(o)&&t>o}return i},e.prototype.getPercentFormat=function(e,i){var a=(0,t.isNullOrUndefined)(e[i])||(0,t.isNullOrUndefined)(this.formatFields[i].format)?void 0:this.formatFields[i].format.toLowerCase().match(/p[0-9]/);return(0,t.isNullOrUndefined)(a)?2:Number(this.formatFields[i].format.replace(/[^0-9]/g,""))},e.prototype.getFormattedFields=function(e){this.formatFields=this.setFormattedFields(e.formatSettings)},e.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},e.prototype.getFieldList=function(e,i,a){for(var r,n=this,s=this.dataSourceSettings.excludeFields.length-1;s>-1;){-1!==(h=this.fields.indexOf(this.dataSourceSettings.excludeFields[s]))&&this.fields.splice(h,1),this.fieldList&&delete this.fieldList[this.dataSourceSettings.excludeFields[s]],s--}var o=this.fields,l=(0,t.extend)([],this.dataSourceSettings.rows,null,!0);l=l.concat(this.dataSourceSettings.columns,this.dataSourceSettings.values,this.dataSourceSettings.filters),this.getFormattedFields(this.dataSourceSettings),this.getCalculatedField(o);var d=(o=this.fields).length,p=["string","number","datetime","date","boolean"];if(this.savedFieldList){var h=0;for(this.fieldList=this.savedFieldList;h<d;){var u=o[h],c=this.getMappingField(u,this.dataSourceSettings.fieldMapping);this.fieldList[u]?(this.fieldList[u].isSelected=!1,this.fieldList[u].index=h,this.fieldList[u].filter=[],this.fieldList[u].sort=i?"Ascending":"None",this.fieldList[u].isExcelFilter=!1,this.fieldList[u].filterType="",this.fieldList[u].showFilterIcon=!c||!("showFilterIcon"in c)||c.showFilterIcon,this.fieldList[u].showRemoveIcon=!c||!("showRemoveIcon"in c)||c.showRemoveIcon,this.fieldList[u].showSortIcon=!c||!("showSortIcon"in c)||c.showSortIcon,this.fieldList[u].showEditIcon=!c||!("showEditIcon"in c)||c.showEditIcon,this.fieldList[u].showValueTypeIcon=!c||!("showValueTypeIcon"in c)||c.showValueTypeIcon,this.fieldList[u].allowDragAndDrop=!c||!("allowDragAndDrop"in c)||c.allowDragAndDrop,this.fieldList[u].isCalculatedField=!(!c||!("isCalculatedField"in c))&&c.isCalculatedField,this.fieldList[u].showNoDataItems=!(!c||!("showNoDataItems"in c))&&c.showNoDataItems,this.fieldList[u].showSubTotals=!c||!("showSubTotals"in c)||c.showSubTotals,this.fieldList[u].expandAll=!(!c||!("expandAll"in c))&&c.expandAll,this.fieldList[u].pid=c&&"groupName"in c&&c.groupName?c.groupName:this.groupingFieldsInfo[u]?this.groupingFieldsInfo[u]:void 0,this.isValueFiltersAvail&&a&&(this.fieldList[u].dateMember=[],this.fieldList[u].members={},this.fieldList[u].isMembersFilled=!1),this.updateMembersOrder(u)):(r=(0,t.isNullOrUndefined)(this.groupedDataType[u])?c&&"dataType"in c&&c.dataType&&p.indexOf(c.dataType.toLowerCase())>-1?c.dataType.toLowerCase():r:this.groupedDataType[u],this.fieldList[u]={caption:c&&"caption"in c&&c.caption?c.caption:u,id:u,type:-1!==u.indexOf("_custom_group")||-1!==u.indexOf("_date_group")?"string":void 0===r||"undefined"===r?"number":r,isSelected:!1,sort:i?"Ascending":"None",filterType:"",index:h,filter:[],isCustomField:-1!==u.indexOf("_custom_group")||-1!==u.indexOf("_date_group"),showRemoveIcon:!c||!("showRemoveIcon"in c)||c.showRemoveIcon,showFilterIcon:!c||!("showFilterIcon"in c)||c.showFilterIcon,showSortIcon:!c||!("showSortIcon"in c)||c.showSortIcon,showNoDataItems:!(!c||!("showNoDataItems"in c))&&c.showNoDataItems,isCalculatedField:!(!c||!("isCalculatedField"in c))&&c.isCalculatedField,showEditIcon:!c||!("showEditIcon"in c)||c.showEditIcon,showValueTypeIcon:!c||!("showValueTypeIcon"in c)||c.showValueTypeIcon,allowDragAndDrop:!c||!("allowDragAndDrop"in c)||c.allowDragAndDrop,showSubTotals:!c||!("showSubTotals"in c)||c.showSubTotals,expandAll:!(!c||!("expandAll"in c))&&c.expandAll,pid:c&&"groupName"in c&&c.groupName?c.groupName:this.groupingFieldsInfo[u]?this.groupingFieldsInfo[u]:void 0,aggregateType:c&&"type"in c?this.getFieldType(c):"number"===(-1!==u.indexOf("_custom_group")||-1!==u.indexOf("_date_group")?"string":void 0===r||"undefined"===r?"number":r)?"Sum":"Count",baseField:c&&"baseField"in c?c.baseField:void 0,baseItem:c&&"baseItem"in c?c.baseItem:void 0},this.updateMembersOrder(u)),h++}}else{this.fieldList={};h=0;for(var g=function(){var a=o[h],s=m.getMappingField(a,m.dataSourceSettings.fieldMapping);void 0!==(r=(0,t.isNullOrUndefined)(m.groupedDataType[a])?s&&"dataType"in s&&s.dataType&&p.indexOf(s.dataType.toLowerCase())>-1?s.dataType.toLowerCase():Hs.getType(e[m.fieldKeys[a]]):m.groupedDataType[a])&&"undefined"!==r||(m.dataSourceSettings.groupSettings.length>0?m.dataSourceSettings.groupSettings.forEach(function(e){r=n.fieldKeys[a]===e.name&&"number"===e.type.toLocaleLowerCase()?"string":"number"}):r="number"),m.fieldList[a]={id:a,pid:s&&"groupName"in s&&s.groupName?s.groupName:m.groupingFieldsInfo[a]?m.groupingFieldsInfo[a]:void 0,caption:s&&"caption"in s&&s.caption?s.caption:a,type:-1!==a.indexOf("_custom_group")||-1!==a.indexOf("_date_group")?"string":r,filterType:"",index:h,filter:[],sort:i?"Ascending":"None",isSelected:!1,isCustomField:-1!==a.indexOf("_custom_group")||-1!==a.indexOf("_date_group"),showFilterIcon:!s||!("showFilterIcon"in s)||s.showFilterIcon,showRemoveIcon:!s||!("showRemoveIcon"in s)||s.showRemoveIcon,showSortIcon:!s||!("showSortIcon"in s)||s.showSortIcon,showEditIcon:!s||!("showEditIcon"in s)||s.showEditIcon,showValueTypeIcon:!s||!("showValueTypeIcon"in s)||s.showValueTypeIcon,allowDragAndDrop:!s||!("allowDragAndDrop"in s)||s.allowDragAndDrop,showSubTotals:!s||!("showSubTotals"in s)||s.showSubTotals,showNoDataItems:!(!s||!("showNoDataItems"in s))&&s.showNoDataItems,isCalculatedField:!(!s||!("isCalculatedField"in s))&&s.isCalculatedField,expandAll:!(!s||!("expandAll"in s))&&s.expandAll,aggregateType:s&&"type"in s?m.getFieldType(s):"number"===(-1!==a.indexOf("_custom_group")||-1!==a.indexOf("_date_group")?"string":void 0===r||"undefined"===r?"number":r)?"Sum":"Count",baseField:s&&"baseField"in s?s.baseField:void 0,baseItem:s&&"baseItem"in s?s.baseItem:void 0},m.updateMembersOrder(a),h++},m=this;h<d;)g()}this.groupedDataType={},this.updateTreeViewData(l)},e.prototype.getFieldType=function(e){return(0,t.isNullOrUndefined)(e.dataType)||"number"===e.dataType||"DistinctCount"===e.type||"Count"===e.type||(e.type="Count"),e.type},e.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}}},e.prototype.getMappingField=function(e,t){var i={};if(t&&t.length>0)for(var a=0,r=t.length;a<r;a++)if(t[a].name===e){i=t[a];break}return i},e.prototype.updateFieldList=function(e){for(var t=this.fields,i=t.length;i--;)this.fieldList[t[i]].isExcelFilter=e[t[i]].isExcelFilter},e.prototype.updateTreeViewData=function(e){for(var i=this,a=e.length,r=this.dataSourceSettings.calculatedFieldSettings.length;a--;)if(this.fieldList[e[a].name]){var n=this.fieldList[e[a].name];n.type=e[a].dataType?e[a].dataType.toLowerCase():n.type,n.caption=e[a].caption?e[a].caption:e[a].name,n.isSelected=!0,n.showNoDataItems=e[a].showNoDataItems,n.aggregateType=this.getFieldType(e[a]),n.baseField=e[a].baseField,n.baseItem=e[a].baseItem,n.allowDragAndDrop=e[a].allowDragAndDrop,n.showFilterIcon=e[a].showFilterIcon,n.showSortIcon=e[a].showSortIcon,n.showRemoveIcon=e[a].showRemoveIcon,n.showValueTypeIcon=e[a].showValueTypeIcon,n.showEditIcon=e[a].showEditIcon,n.showSubTotals=e[a].showSubTotals,n.expandAll=e[a].expandAll}for(;r--;)this.fieldList[this.dataSourceSettings.calculatedFieldSettings[r].name]&&(this.fieldList[this.dataSourceSettings.calculatedFieldSettings[r].name].aggregateType="CalculatedField",this.fieldList[this.dataSourceSettings.calculatedFieldSettings[r].name].isCalculatedField=!0,this.fieldList[this.dataSourceSettings.calculatedFieldSettings[r].name].formula=this.dataSourceSettings.calculatedFieldSettings[r].formula);var s=this.dataSourceSettings.groupSettings.filter(function(t){return!e.some(function(e){return t.name===e.name})}),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"];s.forEach(function(e){var a=e.name,r=e.type.toLowerCase();Object.keys(i.fieldList).forEach(function(n){"date"!==r||(0,t.isNullOrUndefined)(e.caption)||!o.some(function(e){return n===""+a+e})&&n!==a?("custom"!==r||(0,t.isNullOrUndefined)(e.caption)||n!==a+"_custom_group")&&("number"!==r||(0,t.isNullOrUndefined)(e.caption)||n!==a)||(i.fieldList[n].caption=e.caption):i.fieldList[n].caption=i.fieldList[n].caption.replace(e.name,e.caption)})})},e.prototype.getCalculatedField=function(e){for(var i=0,a=this.dataSourceSettings.calculatedFieldSettings;i<a.length;i++){var r=a[i];this.calculatedFields[r.name]=(0,t.extend)({},r,null,!0),this.calculatedFields[r.name].actualFormula=r.formula}for(var n=Object.keys(this.calculatedFields),s=function(t,i){var a=o.calculatedFields[n[t]],r=a.properties,s=(r?r.formula:a.formula).trim(),l=s.replace(/"/g,"");a.formula=l.indexOf("^")>-1?o.powerFunction(l):l,-1===a.formula.indexOf("Math.min(")&&a.formula.indexOf("min(")>-1&&(a.formula=a.formula.replace(/min\(/g,"Math.min(")),-1===a.formula.indexOf("Math.max(")&&a.formula.indexOf("max(")>-1&&(a.formula=a.formula.replace(/max\(/g,"Math.max(")),-1===a.formula.indexOf("Math.abs(")&&a.formula.indexOf("abs(")>-1&&(a.formula=a.formula.replace(/abs\(/g,"Math.abs(")),a.name=r?r.name:a.name,"CSV"===o.dataSourceSettings.type?-1===e.indexOf(a.name)&&e.push(a.name):(e=e.filter(function(e){return e!==a.name})).push(a.name);for(var d=s.split('"'),p=0,h=d.length;p<h;p++){var u=d[p].trim(),c=u.split(/[ .:;?!~,`"&|()<>{}[\]\r\n/\\]+/),g=u.match(/^([^()]+)\((.*)\)$/),m="DistinctCount"===c[0]?"DistinctCount":"PopulationStDev"===c[0]?"PopulationStDev":"SampleStDev"===c[0]?"SampleStDev":"PopulationVar"===c[0]?"PopulationVar":"SampleVar"===c[0]?"SampleVar":c[0];if(-1!==["Sum","Count","Min","Max","Avg","Product","DistinctCount","PopulationStDev","SampleStDev","PopulationVar","SampleVar","Median"].indexOf(m)){var f=-1===e.indexOf(c[1])&&g[2]?e.indexOf(g[2]):e.indexOf(c[1]);o.calculatedFormulas[a.name]?o.calculatedFormulas[a.name].push({index:f,type:m,formula:u}):o.calculatedFormulas[a.name]=[{index:f,type:m,formula:u}]}}},o=this,l=0,d=n.length;l<d;l++)s(l);this.fields=e},e.prototype.validateFilters=function(e){this.isValueFiltersAvail=!1;var i=e.filterSettings?e.filterSettings:[],a=(0,t.extend)([],this.dataSourceSettings.rows,null,!0);a=a.concat(this.dataSourceSettings.columns);for(var r=0,n=i;r<n.length;r++){for(var s=n[r],o=0,l=a;o<l.length;o++){var d=l[o];if(s.name===d.name&&"Value"===s.type){this.isValueFiltersAvail=!0;break}}if(this.isValueFiltersAvail)break}},e.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","PercentageOfRunningTotals"].indexOf(i.type)){this.isValueHasAdvancedAggregate=!0;break}}},e.prototype.fetchFieldMembers=function(e){var t=this.fieldList[e].index;this.generateMembers(t,new Set)},e.prototype.generateMembers=function(e,i){var a=this.data.length,r=this.fields,n=this.fieldList,s=r[e];n[s].members&&!this.allowDataCompression||(n[s].members={},this.allowDataCompression&&(n[s].isMembersFilled=!1)),n[s].dateMember&&!this.allowDataCompression||(n[s].dateMember=[]);var o=n[s].members,l=n[s].dateMember;if((n[s].isSelected||i.has(e))&&!n[s].isMembersFilled){for(var d=Object.keys(o).length>0,p=0,h=n[s].expandAll,u=Hs.isDateField(s,this),c=0;c<a;c++){var g=this.data[c][this.fieldKeys[s]],m=g;if(m=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(m):m,!d){var f=u?this.getFormattedValue(m,s):{formattedText:null===m?this.localeObj?this.localeObj.getConstant("null"):String(m):void 0===m?this.localeObj?s in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(m):m.toString(),actualText:null===m?this.localeObj?this.localeObj.getConstant("null"):String(m):void 0===m?this.localeObj?s in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(m):m};Object.prototype.hasOwnProperty.call(o,m)?o[m].index.push(c):(p++,o[m]={index:[c],ordinal:p,isDrilled:this.isExpandAll||h,caption:f.formattedText},l.push({formattedText:f.formattedText,actualText:u?f.dateText:f.actualText}))}var v=(0,t.isNullOrUndefined)(g)?g:"number"===n[s].type?isNaN(Number(g))?void 0:Number(g):1,S={ordinal:o[m].ordinal,member:v};this.valueMatrix[c]||(this.valueMatrix[c]=[]),this.valueMatrix[c][e]=S}n[s].isMembersFilled=!0}},e.prototype.fillFieldMembers=function(){var e=this.fields,t=this.fieldList,i=e.length;this.data.length-this.valueMatrix.length<0&&(this.valueMatrix=this.valueMatrix.slice(0,this.data.length));var a=new Set;if(this.calculatedFormulas&&Object.keys(this.calculatedFormulas).length>0)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)},e.prototype.generateValueMatrix=function(){for(var e=this.fields,i=this.data.length,a=e.length,r=this.fieldList;i--;)for(var n=a;n--;){var s=e[n],o=r[s];if(o.isMembersFilled){var l=this.data[i][this.fieldKeys[s]];this.valueMatrix[i][n].member=(0,t.isNullOrUndefined)(l)?l:"number"===o.type?isNaN(Number(l))?void 0:Number(l):1}}},e.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)},e.prototype.updateFilterMembers=function(e){var t=this.filterMembers,i={},a=this.getFilters(e,i),r=this.valueMatrix.length;if(a)for(var n=i.include.index,s=0;s<n.length;s++)void 0!==i.exclude&&void 0!==i.exclude.indexObject[n[s]]||t.push(n[s]);else for(s=0;s<r;s++)void 0!==i.exclude&&void 0!==i.exclude.indexObject[s]||t.push(s)},e.prototype.getFilters=function(e,t){for(var i=e.filterSettings?e.filterSettings:[],a=!1,r=[],n=0,s=i.length;n<s;n++){var o=i[n].properties?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},e.prototype.isValidFilterField=function(e,i,a){var r=e.name,n=!1,s=(0,t.extend)([],this.dataSourceSettings.rows,null,!0);if(s=s.concat(this.dataSourceSettings.columns),this.fieldList[r].isSelected&&i&&["Include","Exclude"].indexOf(e.type)>=0){n=!0;for(var o=0,l=this.dataSourceSettings.values;o<l.length;o++){if(r===l[o].name){n=!1;break}}}else if(a)for(var d=0,p=s;d<p.length;d++){if(r===p[d].name&&["Label","Date","Number"].indexOf(e.type)>=0){n=!0;break}}return n},e.prototype.applyLabelFilter=function(e){if(["Label","Date","Number"].indexOf(e.type)>=0){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?["DoesNotBeginWith","DoesNotContains","DoesNotEndsWith","DoesNotEquals","NotBetween"].indexOf(e.condition)>-1&&!e.showNumberFilter?"Exclude":"Include":"Exclude"}else e.showLabelFilter=!1},e.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":default: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":l.indexOf(i.toLowerCase())>-1&&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)}}return r},e.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":default: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)}}return n},e.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":default:e!==i&&(r=!0);break;case"GreaterThan":e>i&&(r=!0);break;case"GreaterThanOrEqualTo":e>=i&&(r=!0);break;case"LessThan":e<i&&(r=!0);break;case"LessThanOrEqualTo":e<=i&&(r=!0);break;case"Between":e>=i&&e<=a&&(r=!0);break;case"NotBetween":e>=i&&e<=a||(r=!0)}return r},e.prototype.frameFilterList=function(e,t,i,a,r,n){i[a]||(i[a]={indexObject:{},index:[]}),this.updateFilter(e,t,i,a,r,n)},e.prototype.updateFilter=function(e,i,a,r,n,s){var o=0,l=this.fieldList[i];l.filter=e,l.filterType=r,l.isExcelFilter=n;var d=i in this.groupingFields,p=Hs.getFormattedMembers(l.members,i,this,n,d),h=s,u={},c={};for(u[r]={indexObject:{},index:[]},this.fieldFilterMem[i]={memberObj:{}};!(0,t.isNullOrUndefined)(e[o]);){if(p[e[o]]){var g=p[e[o]].index;if("include"===r)for(var m=0,f=g.length;m<f;m++)h&&void 0===a[r].indexObject[g[m]]||(u[r].indexObject[g[m]]=g[m],u[r].index.push(g[m]));else{for(m=0,f=g.length;m<f;m++)void 0===a[r].indexObject[g[m]]&&(a[r].indexObject[g[m]]=g[m],a[r].index.push(g[m]));this.fieldFilterMem[i].memberObj[e[o]]=e[o]}}o++}if("include"===r){a[r]=u[r];for(m=0;m<e.length;m++)p[e[m]]&&(c[e[m]]=e[m]);var v=Object.keys(p);for(m=0,f=v.length;m<f;m++)void 0===c[v[m]]&&(this.fieldFilterMem[i].memberObj[v[m]]=v[m])}},e.prototype.applyValueFiltering=function(e,i,a,r,n,s,o){this.isValueFiltered=!1;var l=(0,t.extend)({},"row"===o&&this.rowGrandTotal?this.rowGrandTotal:"column"===o&&this.columnGrandTotal?this.columnGrandTotal:"Top"!==this.dataSourceSettings.grandTotalsPosition?a[a.length-1]:a[0],null,!0);return this.getFilteredData(a,r,n,s,i,e.name,l,o),this.isValueFiltered&&(("row"===o&&null===this.rowGrandTotal||"column"===o&&null===this.columnGrandTotal)&&s.push(l),a=s),a},e.prototype.getFilteredData=function(e,i,a,r,n,s,o,l){for(var d=e.length,p=0;p<d;p++)if(a[s])if(e[p].level===n){this.isValueFiltered=!0,this.fieldList[s].isExcelFilter=!0;var h=0,u=a[s].measure,c=this.fieldList[u].index,g=this.fieldList[u].aggregateType;this.rawIndexObject={},h="row"===l?this.getAggregateValue(e[p].index,i.indexObject,c,g,!1):this.getAggregateValue(i.index,e[p].indexObject,c,g,!1);var m={fieldName:u,row:e[p],column:i,value:h,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:e[p].hasChild&&e[p].isDrilled?"subTotal":"grand sum"===e[p].type?"grandTotal":"value",columnCellType:i.hasChild&&i.isDrilled?"subTotal":"grand sum"===i.type?"grandTotal":"value",aggregateType:g,skipFormatting:!1};this.getValueCellInfo&&this.getValueCellInfo(m),h=m.value,this.rawIndexObject={};var f=a[s].condition;if("Top"===f||"Bottom"===f){var v=e[p].valueSort?e[p].valueSort.levelName:"",S=this.applyTopBottomFiltering(s,n,e,a[s],v,i,l),y=e[p].actualText;if(S.has(y)||"grand sum"===e[p].type)"grand sum"!==e[p].type&&(r.push((0,t.extend)({},e[p],null,!0)),r[r.length-1].isLevelFiltered=!0);else{var b=this.removefilteredData(e[p],this.valueFilteredData)||e[p];this.validateFilteredParentData(b,this.valueFilteredData,o,0,n,l)}}else{var C=this.getParsedValue(u,a[s].value1),x=this.getParsedValue(u,a[s].value2);if(this.validateFilterValue(h,a[s].condition,C,x)||"grand sum"===e[p].type)"grand sum"!==e[p].type&&(r.push((0,t.extend)({},e[p],null,!0)),r[r.length-1].isLevelFiltered=!0);else{b=this.removefilteredData(e[p],this.valueFilteredData)||e[p];this.validateFilteredParentData(b,this.valueFilteredData,o,0,n,l)}}}else e[p].hasChild&&e[p].members.length>0&&"grand sum"!==e[p].type&&(r.push((0,t.extend)({},e[p],null,!0)),r[r.length-1].members=[],r[r.length-1].isLevelFiltered=!0,this.getFilteredData(e[p].members,i,a,r[r.length-1].members,n,s,o,l))},e.prototype.getParsedValue=function(e,i){var a=i?i.toString():"";if(this.formatFields[e]&&i){var r=(0,t.extend)({},this.formatFields[e],null,!0);return delete r.name,this.globalize.parseNumber(a,r)}return this.globalize.parseNumber(a,{format:"N"})},e.prototype.removefilteredData=function(e,i){for(var a,r=(0,t.extend)([],i,null,!0),n=0;n<r.length;n++){if(e.isLevelFiltered&&e.axis===r[n].axis&&e.valueSort.levelName===r[n].valueSort.levelName&&e.actualText===r[n].actualText&&e.axis===r[n].axis&&e.level===r[n].level&&e.ordinal===r[n].ordinal){a=r[n],i.splice(n,1);break}i[n].hasChild&&i[n].members.length>0&&this.removefilteredData(e,i[n].members)}return a},e.prototype.applyTopBottomFiltering=function(e,t,i,a,r,n,s){var o,l=e+"_"+t+"_"+(r||"global")+"_"+a.condition+"_"+a.measure+"_"+a.value1;if(this.topBottomFilterCache[l])return this.topBottomFilterCache[l];var d=parseInt(a.value1,10);o=isNaN(d)?10:d;var p=new Set;if(o<=0)return this.topBottomFilterCache[l]=p,p;for(var h=[],u=i.length,c=a.measure,g=this.fieldList[c].index,m=this.fieldList[c].aggregateType,f=0;f<u;f++)if(i[f].level===t&&"grand sum"!==i[f].type&&"sum"!==i[f].type){var v=0,S=i[f];this.rawIndexObject={},v="row"===s?this.getAggregateValue(S.index,n.indexObject,g,m,!1):this.getAggregateValue(n.index,S.indexObject,g,m,!1),this.rawIndexObject={},h.push({memberId:S.actualText,memberName:S.actualText,aggregateValue:v,member:S})}var y=a.condition,b=h.filter(function(e){return void 0!==e.aggregateValue&&null!==e.aggregateValue&&0!==e.aggregateValue});"Top"===y?b.sort(function(e,t){return t.aggregateValue-e.aggregateValue}):"Bottom"===y&&b.sort(function(e,t){return e.aggregateValue-t.aggregateValue});var C=Math.min(o,b.length);for(f=0;f<C;f++)p.add(b[f].memberId);return this.topBottomFilterCache[l]=p,p},e.prototype.validateFilteredParentData=function(e,t,i,a,r,n){if(t.length>0)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];i.index.indexOf(h)>=0&&i.index.splice(i.index.indexOf(h),1),e.valueSort.levelName.toString().indexOf(l.valueSort.levelName.toString())>=0&&l.level!==r&&l.index.indexOf(h)>=0&&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],e.valueSort.levelName.toString().indexOf(l.valueSort.levelName.toString())>=0&&l.level!==r&&delete l.indexObject[h])}l&&l.members.length>0&&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,f=u=e.index;m<f.length;m++){h=f[m];i.index.indexOf(h)>=0&&i.index.splice(i.index.indexOf(h),1)}else{u=e.indexObject;for(var v=0,S=Object.keys(u);v<S.length;v++){h=S[v];Object.prototype.hasOwnProperty.call(u,h)&&delete i.indexObject[h]}}},e.prototype.updateFramedHeaders=function(e,i,a,r,n){for(var s=0,o=e;s<o.length;s++){var l=o[s];this.isHeaderAvail=!1,(this.validateFilteredHeaders(l,a,n)||"grand sum"===l.type)&&("row"===n?this.rowCount+=this.rowValuesLength:this.columnCount+=this.customProperties.isTabularLayout?this.rowMaxLevel+this.colValuesLength:this.colValuesLength,r.push((0,t.extend)({},l,null,!0)),r[r.length-1].members=[],l.hasChild&&l.isDrilled&&l.members.length>0&&this.updateFramedHeaders(l.members,i,a,r[r.length-1].members,n))}return this.filterFramedHeaders},e.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?n.index.length>0?(this.isHeaderAvail=!0,e.index=n.index,!0):(this.isHeaderAvail=!1,e.index=n.index,!1):Object.keys(n.indexObject).length>0?(this.isHeaderAvail=!0,e.indexObject=n.indexObject,!0):(this.isHeaderAvail=!1,e.indexObject=n.indexObject,!1);n.hasChild&&n.members.length>0&&"grand sum"!==n.type&&this.validateFilteredHeaders(e,n.members,i)}}return this.isHeaderAvail},e.prototype.isEmptyDataAvail=function(e,t){this.isEmptyData=!1,e.length>0&&"grand sum"===e[e.length-1].type&&0===e[e.length-1].index.length&&(this.isEmptyData=!0),t.length>0&&"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)},e.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},e.prototype.generateGridData=function(e,i,a,r,n){void 0===i&&(i=!1),void 0===n&&(n=!1),(0,t.isNullOrUndefined)(r)&&this.customProperties.isTabularLayout&&(this.rowMaxLevel=0),this.updateDataSourceSettings(e,i);var s=e.columns?e.columns:[],o=this.data,l=e.rows?e.rows:[],d=e.filterSettings,p=e.values?e.values:[];this.removeCount=0,this.isExpandAll=e.expandAll,this.drilledMembers=e.drilledMembers?e.drilledMembers:[],this.isEmptyData=!1;var h=[];if(l[0]&&l[0].showNoDataItems||s[0]&&s[0].showNoDataItems)for(var u=0;u<this.valueMatrix.length;u++)h.push(u);for(u=0;u<this.filterMembers.length;u++)this.filterPosObj[this.filterMembers[u]]=this.filterMembers[u];this.valueSortSettings.columnIndex=void 0,this.validateValueFields(),this.frameDrillObject(),this.isValueFilterEnabled&&!this.isEditing||r||(this.isLastHeaderHasMeasures=!0,this.columnCount=0,this.rowCount=0,this.cMembers=[],this.rMembers=[],this.levelMap={},0!==l.length&&0!==p.length&&(this.rMembers=this.getIndexedHeaders(l,o,this.customProperties.isTabularLayout?this.rowMaxLevel:0,l[0].showNoDataItems?h:this.filterMembers,"row","",this.allowValueFilter),this.updateRowMaxLevel()),0!==s.length&&0!==p.length&&(this.cMembers=this.getIndexedHeaders(s,o,0,s[0].showNoDataItems?h:this.filterMembers,"column","",this.allowValueFilter)),this.insertAllMembersCommon(),this.saveDataHeaders=this.isValueFiltersAvail&&e.allowValueFilter?{rowHeaders:(0,t.extend)([],this.rMembers,null,!0),columnHeaders:(0,t.extend)([],this.cMembers,null,!0)}:{}),this.customProperties.isTabularLayout&&(this.showSubTotalsAtBottom=!0),this.pivotValues=[],this.headerContent=[],this.valueContent=[],this.valueFilteredData=[],this.filterFramedHeaders=[];var c=[],g=[],m=[],f=[],v=[],S=this.dataSourceSettings.values.length;if(this.isValueFiltersAvail&&e.allowValueFilter&&!r){this.valueFilteredData=[];var y=this.saveDataHeaders.rowHeaders?this.saveDataHeaders.rowHeaders:[],b=this.saveDataHeaders.columnHeaders?this.saveDataHeaders.columnHeaders:[];if(d.length>0){for(var C={},x={},w=0,T=p;w<T.length;w++){var M=T[w];x[M.name]=M}for(var D=0,O=d;D<O.length;D++){var N=O[D];y=m.length>0?m:y,b=f.length>0?f:b,this.valueFilteredData=[];var P=N.properties?N.properties:N;if("Value"===P.type&&this.fieldList[N.name]&&this.fieldList[N.name].isSelected){C[N.name]=N,P.items=[];for(var E=!1,I=l.length,F=s.length,L=0;L<I;L++)if(P.name===l[L].name&&x[P.measure]&&!E){E=!0,m=this.applyValueFiltering(l[L],L,y,this.columnGrandTotal?this.columnGrandTotal:"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals?b[0]:b[b.length-1],C,this.valueFilteredData,"row");break}for(var A=0;A<F;A++)if(P.name===s[A].name&&x[P.measure]&&!E){E=!0,f=this.applyValueFiltering(s[A],A,b,this.rowGrandTotal?this.rowGrandTotal:"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals?y[0]:y[y.length-1],C,this.valueFilteredData,"column");break}}}}m=m.length>0?m:y,f=f.length>0?f:b,this.isEmptyDataAvail(m,f);var R=Hs.getClonedFieldList(this.fieldList),k=this.data[0];this.getFieldList(k,this.enableSort,e.allowValueFilter),this.fillFieldMembers(),this.updateSortSettings(e.sortSettings,this.enableSort),this.filterMembers=[],this.updateFilterMembers(e),this.isLastHeaderHasMeasures=!0,this.rMembers=0!==l.length?this.getIndexedHeaders(l,o,0,l[0].showNoDataItems?h:this.filterMembers,"row",""):[],this.cMembers=0!==s.length?this.getIndexedHeaders(s,o,0,s[0].showNoDataItems?h:this.filterMembers,"column",""):[],this.insertAllMembersCommon(),this.updateFieldList(R),this.rowCount=0,this.columnCount=0,this.rMembers=this.updateFramedHeaders(this.rMembers,this.rMembers,m,this.filterFramedHeaders,"row"),this.filterFramedHeaders=[],this.cMembers=this.updateFramedHeaders(this.cMembers,this.cMembers,f,this.filterFramedHeaders,"column"),this.isValueFilterEnabled=!0}r||this.applyValueSorting(),this.isPagingOrVirtualizationEnabled&&(r?(this.rMembers=r.rowHeaders,this.cMembers=r.columnHeaders,this.rowCount=r.rowHeadersCount,this.columnCount=r.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(l,s,this.rMembers,this.cMembers,p),this.getHeaderData(l,s,p,v,this.cMembers,g,this.pivotValues,0,this.valueAxis?1:S),this.insertSubTotals(),this.getTableData(v.length>0?v:this.rMembers,c,g,0,this.pivotValues,S,0,this.rowGrandTotal?this.rowGrandTotal:this.rMembers[this.rMembers.length-1],this.columnGrandTotal?this.columnGrandTotal:this.cMembers[this.cMembers.length-1]),this.applyAdvancedAggregate(c,g,this.pivotValues),this.customProperties.isTabularLayout&&(this.pivotValues=this.getTabularPivotValues(i),this.setRowSpan()),this.isEngineUpdated=!0,this.isEmptyDataAvail(this.rMembers,this.cMembers),this.clearProperties(a)},e.prototype.updateHeaders=function(e,i){e=(0,t.isNullOrUndefined)(e)?!(!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)||!(this.dataSourceSettings.rows.length>0):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)),i=(0,t.isNullOrUndefined)(i)?!(!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)||!(this.dataSourceSettings.columns.length>0):i,(this.pageSettings&&this.removeColumnGrandTotal||!i&&!this.columnGrandTotal)&&"grand sum"===this.cMembers[this.cMembers.length-1].type&&(this.cMembers=this.cMembers.slice(0,this.cMembers.length-1))},e.prototype.updatePivotValues=function(e){var t=!(!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)||!(this.dataSourceSettings.rows.length>0),i=!(!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)||!(this.dataSourceSettings.columns.length>0);if(e&&this.updateHeaders(t,i),(this.pageSettings&&this.removeRowGrandTotal||!t&&!this.rowGrandTotal)&&this.valueContent.length>0){var a=1;this.valueAxis&&this.dataSourceSettings.values.length>0&&(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))}if((this.pageSettings&&this.removeColumnGrandTotal||!i&&!this.columnGrandTotal)&&this.headerContent.length>0){a=this.dataSourceSettings.values.length;if(this.valueAxis&&this.dataSourceSettings.values.length>0&&(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},e.prototype.onDrill=function(e){this.frameDrillObject(e);var t=this.getHeadersInfo(e.fieldName,e.axis);this.performDrillOperation(t.headers,e,t.fields,t.position,0),"row"===t.axis&&this.updateRowMaxLevel(),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()},e.prototype.onSort=function(e,t){t&&this.updateDataSourceSettings(t,!0);var i=this.getHeadersInfo(e.name,"");this.fieldList[e.name].sort=e.order,this.performSortOperation(i.headers,e,i,0),this.updateEngine()},e.prototype.onFilter=function(e,t){this.isFilterAction=!0,this.frameDrillObject(),this.updateDataSourceSettings(t,!0);var i=this.getHeadersInfo(e.name,"");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);for(var a={},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={},d=0,p=e.items;d<p.length;d++){var h=p[d];l[h]=h}var u=this.dataSourceSettings.rows[0]&&this.dataSourceSettings.rows[0].showNoDataItems||this.dataSourceSettings.columns[0]&&this.dataSourceSettings.columns[0].showNoDataItems;if(u&&this.columnKeys[e.name]?u=!(!this.dataSourceSettings.columns[0]||!this.dataSourceSettings.columns[0].showNoDataItems):u&&"row"===i.axis&&(u=!(!this.dataSourceSettings.rows[0]||!this.dataSourceSettings.rows[0].showNoDataItems)),u){var c=[];this.filterPosObj={};for(var g=0;g<o.length;g++)this.filterPosObj[o[g]]=o[g];for(g=0;g<this.valueMatrix.length;g++)c.push(g);o=c}this.performFilterCommonUpdate(e,i,o),"column"===i.axis?(i=this.getHeadersInfo("","row"),this.performFilterCommonUpdate(e,i,o)):(i=this.getHeadersInfo("","column"),this.performFilterCommonUpdate(e,i,o)),this.frameHeaderObjectsCollection=!1,this.headerObjectsCollection={},this.updateEngine()},e.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()},e.prototype.onCalcOperation=function(e,t){this.dataSourceSettings.calculatedFieldSettings=t.calculatedFieldSettings?t.calculatedFieldSettings:[],this.dataSourceSettings.values=t.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()},e.prototype.performDrillOperation=function(e,t,i,a,r){for(var n=0;n<e.length;){if(a===r){var s=e[n].valueSort.levelName.split(this.valueSortSettings.headerDelimiter);if(t.memberName===s.join(t.delimiter?t.delimiter:"**")){if("down"===t.action){var o=this.getRowMemberContributionCount(e[n]);e[n].isDrilled=!0,e[n].members=this.getIndexedHeaders(i,this.data,a+1,e[n].index,t.axis,t.memberName.split(t.delimiter?t.delimiter:"**").join(this.valueSortSettings.headerDelimiter));var l=this.getRowMemberContributionCount(e[n])-o;this.rowCount+=l;var d=void 0;if("row"===t.axis)d=this.applyValueSorting(e[n].members,this.cMembers),e[n].members=d.rMembers,this.customProperties.isTabularLayout||(this.rowCount+=this.showSubTotalsAtBottom?1:0),this.drillDownLevel(e[n].level,!0);else{var p=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&i[a].showSubTotals;this.columnCount-=p?0:this.colValuesLength,d=this.applyValueSorting(this.rMembers,e[n].members),e[n].members=d.cMembers}}else{o=this.getRowMemberContributionCount(e[n]);e[n].isDrilled=!1,this.updateHeadersCount(e[n].members,t.axis,a,i,"minus",!0);l=this.getRowMemberContributionCount(e[n])-o;this.rowCount+=l,e[n].members=[],"row"===t.axis&&(this.drillUpLevel(e[n].level),this.customProperties.isTabularLayout||(this.rowCount-=this.showSubTotalsAtBottom?1:0))}break}}else e[n].members.length>0&&(e[n].members=this.performDrillOperation(e[n].members,t,i,a,r+1));n++}return e},e.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}e[r].members.length>0&&(e[r].members=this.performSortOperation(e[r].members,t,i,a+1)),r++}return e},e.prototype.performFilterDeletion=function(e,t,i,a,r){for(var n=0,s=!0,o=function(){if(i.position===r){var o=l;e=e.filter(function(e){return""!==o.fieldFilterMem[t.name].memberObj[e.formattedText]&&(!o.fieldFilterMem[t.name].memberObj[e.formattedText]||"grand sum"===e.type)}),s=!1}else e[n].members.length>0&&(e[n].members=l.performFilterDeletion(e[n].members,t,i,a,r+1));n++},l=this;n<e.length&&s;)o();var d=this;return e.filter(function(e){return e.members.length>0||"grand sum"===e.type||d.matchIndexes(e.indexObject,a)})},e.prototype.matchIndexes=function(e,t){var i=Object.keys(e),a=i.length;if(0===a)return!0;for(;a>-1;){if(void 0!==t[e[i[a]]])return!0;a--}return!1},e.prototype.performFilterAddition=function(e,t,i){for(var a=0,r=function(){var r=e[a].valueSort.levelName;if(n.headerObjectsCollection[r]){for(var s={},o=0,l=e[a].members;o<l.length;o++){var d=l[o];s[d.valueSort.levelName.toString()]=d.valueSort.levelName.toString()}var p=n.headerObjectsCollection[r].filter(function(e){return!s[e.valueSort.levelName.toString()]});e[a].members=e[a].members.concat(p),e[a].members=n.getSortedHeaders(e[a].members,n.fieldList[i.fields[e[a].members[0].level].name].sort),delete n.headerObjectsCollection[r]}e[a].members.length>0&&(e[a].members=n.performFilterAddition(e[a].members,t,i)),a++},n=this;a<e.length;)r();return e},e.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)),i.length>0&&t.fields.length>0){if(this.frameHeaderObjectsCollection=!0,t.fields.filter(function(e){return e.showNoDataItems}).length>0)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,""),a=this.performFilterAddition(a,t.fields,t);for(var d={},p=0,h=a;p<h.length;p++){var u=h[p];d[u.valueSort.levelName.toString()]=u.valueSort.levelName.toString()}var c=this.headerObjectsCollection.parent.filter(function(e){return!d[e.valueSort.levelName.toString()]}),g=a.filter(function(e){return"grand sum"===e.type});g.length>0&&a.pop(),a=this.getSortedHeaders(a.concat(c),this.fieldList[t.fields[0].name].sort).concat(g);var m=!(!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)||!(this.dataSourceSettings.rows.length>0),f=!(!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)||!(this.dataSourceSettings.columns.length>0);"row"===t.axis?(this.cMembers=this.getIndexedHeaders(this.dataSourceSettings.columns,this.data,0,this.filterMembers,"column",""),f&&this.insertAllMember(this.cMembers,this.filterMembers,"","column")):(this.rMembers=this.getIndexedHeaders(this.dataSourceSettings.rows,this.data,0,this.filterMembers,"row",""),m&&this.insertAllMember(this.rMembers,this.filterMembers,"","row"))}"row"===t.axis?(this.rowCount=0,this.levelMap={}):this.columnCount=0,this.updateHeadersCount(a,t.axis,0,t.fields,"plus",!1),"row"===t.axis?(t.position>0&&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,this.updateRowMaxLevel()):(t.position>0&&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{var v=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,v?i:this.filterMembers,"row",""),this.cMembers=this.getIndexedHeaders(this.dataSourceSettings.columns,this.data,0,v?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),v&&(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()},e.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;n++){if(s[n].name===e)break;r++}return{axis:t,fields:a,headers:i,position:r}},e.prototype.updateEngine=function(){this.removeCount=0,this.validateValueFields(),this.calculatePagingValues(),this.pivotValues=[],this.headerContent=[],this.valueContent=[];var e=[],t=[],i=[],a=this.dataSourceSettings.values.length;this.isFilterAction?this.isFilterAction=!1: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(i.length>0?i:this.rMembers,e,t,0,this.pivotValues,a,0,this.rowGrandTotal?this.rowGrandTotal:this.rMembers[this.rMembers.length-1],this.columnGrandTotal?this.columnGrandTotal:this.cMembers[this.cMembers.length-1]),this.applyAdvancedAggregate(e,t,this.pivotValues),this.customProperties.isTabularLayout&&(this.pivotValues=this.getTabularPivotValues(!0),this.setRowSpan()),this.isEngineUpdated=!0,this.isEmptyDataAvail(this.rMembers,this.cMembers)},e.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},e.prototype.getFieldByName=function(e,t){return new i.DataManager({json:t}).executeLocal((new i.Query).where("name","equal",e))[0]},e.prototype.updateHeadersCount=function(e,t,i,a,r,n){var s=0,o=a[i],l=!0;for(l="column"===t?this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&(!o||o.showSubTotals):this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals&&(!o||o.showSubTotals);s<e.length;){if("row"===t){var d=this.getRowMemberContributionCount(e[s]);this.rowCount+="plus"===r?d:-d}else this.columnCount-="plus"===r?-(1===this.valueAxis?1:this.dataSourceSettings.values.length):1===this.valueAxis?1:this.dataSourceSettings.values.length;e[s].members.length>0&&(this.updateHeadersCount(e[s].members,t,i+1,a,r,!0),"row"===t&&(this.rowCount-=this.showSubTotalsAtBottom&&!this.customProperties.isTabularLayout&&e[s].hasChild&&e[s].isDrilled?1:0,"plus"===r?this.drillDownLevel(e[s].level):this.drillUpLevel(e[s].level))),s++}"column"===t&&!l&&n&&(this.columnCount+="plus"===r?-this.colValuesLength:this.colValuesLength)},e.prototype.getSortedHeaders=function(e,t){var i="Grand Total"!==e[0].actualText?e[0].valueSort.axis: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&&e.length>0&&"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 s.length>0&&(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")},e.prototype.sortHeaders=function(e,i,a,r,n){var s=!1,o=this.fieldList[e]&&this.fieldList[e].membersOrder?this.fieldList[e].membersOrder.slice():[];this.sortMembers[e]||(this.sortMembers[e]=Object.keys(i.members));var l={fieldName:e,sortOrder:r,members:o&&o.length>0?o:this.sortMembers[e],IsOrderChanged:!1},d="datetime"===(n="datetime"===n||"date"===n||"time"===n?this.formatFields[e]&&["date","dateTime","time"].indexOf(this.formatFields[e].type)>-1?n:"string":n)||"date"===n||"time"===n,p=!1;if(this.dataSourceSettings.groupSettings.length>0){var h=this.dataSourceSettings.groupSettings.filter(function(e){return e.name===i.id});!(0,t.isNullOrUndefined)(h)&&h.length>0&&(p="number"===h[0].type.toLocaleLowerCase()&&"string"===i.type.toLocaleLowerCase())}if(o&&o.length>0?Hs.applyCustomSort(l,a,n):(Hs.applyHeadersSort(a,r,n,p),s=!0),s&&this.getHeaderSortInfo){for(var u=[],c=0,g=0;c<a.length;c++){var m=a[c],f=d?m.dateText:m.actualText;"Grand Total"!==m.actualText&&(u[g++]=f)}l.members=u}return this.getHeaderSortInfo&&this.getHeaderSortInfo(l),l.IsOrderChanged&&Hs.applyCustomSort(l,a,n,!0),a},e.prototype.applyValueSorting=function(e,i){var a=!1;return this.enableValueSorting&&(this.valueSortSettings.rowHeaderText||this.valueSortSettings.columnHeaderText)&&this.dataSourceSettings.values.length>0&&(void 0!==e&&void 0!==i||(this.rowValueSortHeaderText=void 0,this.columnValueSortHeaderText=void 0,(0,t.isNullOrUndefined)(this.valueSortSettings.rowHeaderText)||""===this.valueSortSettings.rowHeaderText||(this.rowValueSortHeaderText=this.prepareValueSortHeaderText(this.valueSortSettings.rowHeaderText)),(0,t.isNullOrUndefined)(this.valueSortSettings.columnHeaderText)||""===this.valueSortSettings.columnHeaderText||(this.columnValueSortHeaderText=this.prepareValueSortHeaderText(this.valueSortSettings.columnHeaderText)),e=this.rMembers,i=this.cMembers,a=!0),i=this.applySortingForAxis(this.rowValueSortHeaderText,!0,e,i,this.rowGrandTotal),e=this.applySortingForAxis(this.columnValueSortHeaderText,!1,i,e,this.columnGrandTotal),a&&(this.rMembers=e,this.cMembers=i,this.isPagingOrVirtualizationEnabled&&(this.headerCollection.rowHeaders=this.rMembers,this.headerCollection.columnHeaders=this.cMembers))),{rMembers:e,cMembers:i}},e.prototype.applySortingForAxis=function(e,t,i,a,r){if(!e)return a;var n=t?this.dataSourceSettings.showRowGrandTotals:this.dataSourceSettings.showColumnGrandTotals,s=t?this.dataSourceSettings.rows.length>0:this.dataSourceSettings.columns.length>0,o=!(!this.dataSourceSettings.showGrandTotals||!n)||!s,l=!0;e.includes(this.localeObj.getConstant("grandTotal"))&&!o&&(i.push(r),l=!1);var d=this.getHeaderDetails(e,t),p=d.hText,h=d.mIndex,u=d.mType,c=this.getMember(i,p);return c&&(a=this.sortByValueRow(a,c,t?this.valueSortSettings.rowSortOrder:this.valueSortSettings.columnSortOrder,h,u)),l||i.pop(),a},e.prototype.prepareValueSortHeaderText=function(e){for(var t=e.split(this.valueSortSettings.headerDelimiter),i=0,a=this.dataSourceSettings.values;i<a.length;i++){var r=a[i],n=r.caption?r.caption:r.name,s=t.indexOf(n);if(s>-1){t.splice(s,1),t.push(n),e=t.join(this.valueSortSettings.headerDelimiter);break}}return e},e.prototype.getHeaderDetails=function(e,i){for(var a,r,n,s=e.split(this.valueSortSettings.headerDelimiter),o="",l=0;l<this.dataSourceSettings.values.length;l++){if(this.dataSourceSettings.values[l].caption===s[s.length-1]){n=this.dataSourceSettings.values[l].name;break}n=s[s.length-1]}if((1===this.dataSourceSettings.values.length&&(!i&&"column"===this.dataSourceSettings.valueAxis&&0===this.dataSourceSettings.columns.length||i&&"row"===this.dataSourceSettings.valueAxis&&0===this.dataSourceSettings.rows.length)||this.dataSourceSettings.values.length>1&&(!i&&"column"===this.dataSourceSettings.valueAxis||i&&"row"===this.dataSourceSettings.valueAxis))&&n&&this.fieldList[n]){for(l=0;l<s.length-1;l++)o=""===o?s[l]:o+this.valueSortSettings.headerDelimiter+s[l];a=this.fieldList[n].index,r=this.fieldList[n].aggregateType}else{if(!this.dataSourceSettings.alwaysShowValueHeader||1===s.length||i&&"row"!==this.dataSourceSettings.valueAxis||!i&&"column"!==this.dataSourceSettings.valueAxis)o=e;else for(l=0;l<s.length-1;l++)o=""===o?s[l]:o+this.valueSortSettings.headerDelimiter+s[l];if((0,t.isNullOrUndefined)(this.dataSourceSettings.valueSortSettings.measure)||""===this.dataSourceSettings.valueSortSettings.measure)a=this.fieldList[this.dataSourceSettings.values[0].name].index,r=this.fieldList[this.dataSourceSettings.values[0].name].aggregateType;else for(l=0;l<this.dataSourceSettings.values.length;l++){if(this.dataSourceSettings.valueSortSettings.measure===this.dataSourceSettings.values[l].name){a=this.fieldList[this.dataSourceSettings.valueSortSettings.measure].index,r=this.fieldList[this.dataSourceSettings.valueSortSettings.measure].aggregateType;break}a=this.fieldList[this.dataSourceSettings.values[0].name].index,r=this.fieldList[this.dataSourceSettings.values[0].name].aggregateType}}return{hText:o,mIndex:a,mType:r}},e.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(e[r].members.length>0&&(i=this.getMember(e[r].members,t)),i)return i}return i},e.prototype.sortByValueRow=function(e,t,i,a,r){for(var n=[],s=0,o=e;s<o.length;s++){if("grand sum"===(u=o[s]).type)n.push({header:u});else{this.rawIndexObject={};var l=this.getAggregateValue(u.index,t.indexObject,a,r,!1),d={fieldName:this.fields[a],row:u,column:t,value:l,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:u.hasChild&&u.isDrilled?"subTotal":"grand sum"===u.type?"grandTotal":"value",columnCellType:t.hasChild&&t.isDrilled?"subTotal":"grand sum"===t.type?"grandTotal":"value",aggregateType:r,skipFormatting:!1};this.getValueCellInfo&&this.getValueCellInfo(d),l=d.value,this.rawIndexObject={},n.push({header:u,value:l})}}for(var p=0,h=e=Hs.getSortedValue(n,i);p<h.length;p++){var u;(u=h[p]).members.length>0&&(u.members=this.sortByValueRow(u.members,t,i,a,r))}return e},e.prototype.insertAllMembersCommon=function(){this.rowGrandTotal=this.columnGrandTotal=null;var e=!(!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showRowGrandTotals)||!(this.dataSourceSettings.rows.length>0),t=!(!this.dataSourceSettings.showGrandTotals||!this.dataSourceSettings.showColumnGrandTotals)||!(this.dataSourceSettings.columns.length>0);this.isValueHasAdvancedAggregate?(this.insertAllMember(this.rMembers,this.filterMembers,"","row"),e&&(this.rowCount+=this.rowValuesLength+(this.isMultiValueRowAxis&&!this.customProperties.isTabularLayout?1:0)),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.isMultiValueRowAxis&&!this.customProperties.isTabularLayout?1:0)):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])},e.prototype.insertSubTotals=function(){for(var e=this.pivotValues.length,i=0;i<e;i++){var a=this.pivotValues[i];if(a)for(var r=void 0,n=1,s=a.length,o=void 0,l=1,d=this.showSubTotalsAtTop?this.reformAxisCount:s,p=this.showSubTotalsAtTop?l:d-1,h=void 0,u=void 0;l<d;){var c=a[p];if(c){r&&(r.colSpan=n,r.colIndex=this.showSubTotalsAtTop?r.colIndex+(n-1):r.colIndex-(n-1)),this.showSubTotalsAtTop&&(h=u=this.getMemberSpanCount(this.pivotValues[i],p)),o={index:c.index,indexObject:c.indexObject},c.index=[],c.indexObject={},r=(0,t.extend)({},c,null,!0),c.index=o.index,c.indexObject=o.indexObject;for(var g=i+1;this.pivotValues[g]&&!this.pivotValues[g][p];){var m=this.pivotValues[i][p];m.isDrilled||!this.valueAxis&&!this.isLastHeaderHasMeasures&&m.members&&m.members.length>0&&g>this.measureIndex||(m.rowSpan=g-i+1,r.rowSpan=g-i+1);var f="sum"===c.type||"grand sum"===c.type?c.type:"sum";this.pivotValues[g][p]=this.headerContent[g][p]={type:f,formattedText:"sum"===c.type||"grand sum"===c.type?c.formattedText:c.formattedText+" Total",axis:"column",hierarchyName:c.hierarchyName,level:-1,colIndex:p,rowIndex:g,valueSort:c.valueSort},c.valueSort&&(c.valueSort[this.valueSortSettings.rowHeaderText]||c.valueSort[this.valueSortSettings.columnHeaderText])&&(this.valueSortSettings.columnIndex=p);var v=!1;"grand sum"===f?(m.rowSpan=g-i+1,r.rowSpan=g-i+1):"sum"!==m.type&&(m.isDrilled||this.valueAxisFields[m.actualText]&&!this.valueAxis&&!this.isLastHeaderHasMeasures&&m.members&&m.members.length>0)?(this.pivotValues[i+1][p].rowSpan=g-i,v=!0):this.pivotValues[g][p].rowSpan=-1,g>i+1&&("sum"===m.type||v)&&(this.pivotValues[g][p].rowSpan=-1),g++}n=1}else a[p]=this.headerContent[i][p]=(0,t.extend)({},r,null,!0),a[p].index=this.headerContent[i][p].index=o.index,a[p].indexObject=this.headerContent[i][p].indexObject=o.indexObject,n++,this.showSubTotalsAtTop?(u--,a[p].colSpan=u,a[p].colIndex=a[p].colIndex+(n-1)):(a[p].colSpan=n,a[p].colIndex=a[p].colIndex-(n-1));if(1===p&&r&&(this.showSubTotalsAtTop?(r.colSpan=h,r.colIndex=r.colIndex+(n-1)):(r.colSpan=n,r.colIndex=r.colIndex-(n-1))),this.showSubTotalsAtTop&&(a[p+1]||p+1===this.reformAxisCount)){var S=this.pivotValues[i][p-n+1];S.colSpan=h,this.pivotValues[i][p-n+1]=S}p=this.showSubTotalsAtTop?p+1:p-1,l++}}},e.prototype.getMemberSpanCount=function(e,t){for(var i=1,a=t+1;a<this.reformAxisCount&&!e[a];a++)i++;return i},e.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)&&this.measureIndex>-1&&this.measureIndex<=l)?l+1:l)+1,a=!!d,n=!0;break}if(!n)for(l=0;l<this.dataSourceSettings.columns.length;l++)if(this.dataSourceSettings.columns[l].name===i.name){var d;r=((d=!this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&this.measureIndex>-1&&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 f=0,v=this.dataSourceSettings.values;f<v.length;f++){var S=v[f],y=S.caption?S.caption:S.name;if(c[this.measureIndex]=y,!(i.items.indexOf(c.join(i.delimiter))>-1)){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)}}}}},e.prototype.getRowMemberContributionCount=function(e){var t=e.isDrilled&&e.hasChild,i=e.valueSort&&e.valueSort.axis,a=e.level<=this.measureIndex&&this.isMultiValueRowAxis,r=!t&&!a||!this.customProperties.isTabularLayout;return((this.dataSourceSettings.showRowSubTotals&&this.dataSourceSettings.showSubTotals&&this.fieldList[i]&&this.fieldList[i].showSubTotals?a||t&&this.showSubTotalsAtBottom:a&&!t)?this.rowValuesLength:0)+(r?1:0)},e.prototype.getIndexedHeaders=function(e,i,a,r,n,s,o){var l=[],d=0;if(e&&e.length>0){d++;var p=e.length,h={},u=e[a].name,c=e[a],g=this.fieldList[u];if((0,t.isNullOrUndefined)(this.reportDataType)){this.reportDataType={};for(var m=0;m<this.dataSourceSettings.rows.length;m++)this.reportDataType[this.dataSourceSettings.rows[m].name]=this.dataSourceSettings.rows[m].dataType;for(m=0;m<this.dataSourceSettings.columns.length;m++)this.reportDataType[this.dataSourceSettings.columns[m].name]=this.dataSourceSettings.columns[m].dataType;for(m=0;m<this.dataSourceSettings.values.length;m++)this.reportDataType[this.dataSourceSettings.values[m].name]=this.dataSourceSettings.values[m].dataType}g.type=(0,t.isNullOrUndefined)(this.reportDataType[g.id])?g.type:this.reportDataType[g.id];var f=!1,v=this.formatFields[u]&&["date","dateTime","time"].indexOf(this.formatFields[u].type)>-1,S=r.length<1&&a>0||c.showNoDataItems,y={};if(S){for(var b=Object.keys(g.members),C=0,x=b.length;C<x;C++)(this.dataSourceSettings.showHeaderWhenEmpty||this.localeObj&&b[C]!==this.localeObj.getConstant("undefined"))&&(y[b[C]]=b[C]);r.length<1&&(f=!0,r.length=b.length)}n===this.dataSourceSettings.valueAxis&&this.measureIndex===a&&(this.dataSourceSettings.values.length>1||this.dataSourceSettings.alwaysShowValueHeader)&&(this.isLastHeaderHasMeasures=!1);for(C=0,x=r.length;C<x;C++){var w={};(0,t.isNullOrUndefined)(e[a].showSubTotals)||e[a].showSubTotals||(w.showSubTotals=!1),w.hasChild=a<p-1,w.level=a,w.axis=n,w.colSpan=1;var T=f?g.members[Object.keys(y)[0]].ordinal:this.valueMatrix[r[C]][g.index].ordinal,M=f?Object.keys(y)[0]:i[r[C]][this.fieldKeys[u]];if(M=this.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(M):M,!((0,t.isNullOrUndefined)(M)||this.localeObj&&M===this.localeObj.getConstant("undefined"))||this.dataSourceSettings.showHeaderWhenEmpty){if(delete y[M],!S||!this.fieldFilterMem[u]||this.fieldFilterMem[u].memberObj[M]!==M){var D=v?{actualText:M,formattedText:g.dateMember[T-1].formattedText,dateText:g.dateMember[T-1].actualText}:{formattedText:null===M?this.localeObj?this.localeObj.getConstant("null"):String(M):void 0===M&&this.localeObj?u 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?u in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(M):M};w.actualText=D.actualText,w.formattedText=D.formattedText,v&&(w.dateText=D.dateText);var O=!S||void 0!==this.filterPosObj[r[C]]&&!f,N=!1;if(S&&g.filter.length>0&&"include"===g.filterType&&(N=!0),h&&h[T]||N&&!(N&&g.filter.indexOf(M.toString())>-1))O&&(h[T].index.push(r[C]),h[T].indexObject[r[C]]=r[C]);else{h[T]={index:[],indexObject:{}},w.index=h[T].index,w.indexObject=h[T].indexObject,O&&(w.index=h[T].index=[r[C]],h[T].indexObject[r[C]]=r[C],w.indexObject=h[T].indexObject),w.ordinal=T,w.valueSort={},w.valueSort.axis=u,0!==a?(w.valueSort.levelName=s+this.valueSortSettings.headerDelimiter+(this.customProperties.isTabularLayout?this.getFormattedValue(w.formattedText,g.caption).formattedText:w.formattedText),w.valueSort[s+this.valueSortSettings.headerDelimiter+w.formattedText]=1,w.valueSort.uniqueName=s+this.valueSortSettings.headerDelimiter+(w.actualText?w.actualText:w.formattedText),w.valueSort[s+this.valueSortSettings.headerDelimiter+(w.actualText?w.actualText:w.formattedText)]=1):(w.valueSort[w.formattedText]=1,w.valueSort.levelName=this.customProperties.isTabularLayout?this.getFormattedValue(w.formattedText,g.caption).formattedText:w.formattedText,w.valueSort[w.actualText?w.actualText:w.formattedText]=1,w.valueSort.uniqueName=w.actualText?w.actualText:w.formattedText);var P=w.valueSort.axis+this.valueSortSettings.headerDelimiter+w.valueSort.levelName,E=this.isExpandAll||c&&c.expandAll;w.isDrilled=!(!o||!this.isValueFiltersAvail)||(w.hasChild&&this.fieldDrillCollection[P]?!E||!this.valueAxis&&!this.isLastHeaderHasMeasures&&d>=this.measureIndex:E),w.members=[],l.push(w)}S&&!f&&a>0&&C+1===r.length&&Object.keys(y).length>0&&(f=!0,x=Object.keys(y).length,C=-1)}}else S&&!f&&a>0&&C+1===r.length&&Object.keys(y).length>0&&(x=Object.keys(y).length,f=!0,C=-1)}for(var I=0,F=l.length;I<F;I++){this.frameHeaderObjectsCollection||("row"===n?this.rowCount+=this.getRowMemberContributionCount(l[I]):this.columnCount+=l[I].level<=this.measureIndex?this.colValuesLength:1);var L=null;if(l[I].valueSort&&l[I].valueSort.levelName&&(L=l[I].valueSort.levelName),s=L||l[I].formattedText,!this.dataSourceSettings.showHeaderWhenEmpty&&p-1>a&&l[I].index&&l[I].index.length>0)if(S&&e[a+1]&&e[a+1].name&&Object.keys(this.fieldList[e[a+1].name].members).length>0)l[I].hasChild=!0;else{for(var A=l[I].index.length,R=0,k=0;k<A;k++){M=i[l[I].index[k]][this.fieldKeys[e[a+1].name]];((0,t.isNullOrUndefined)(M)||this.localeObj&&M===this.localeObj.getConstant("undefined"))&&R++}l[I].hasChild=R!==A}if(p-1>a&&l[I].isDrilled){this.columnCount-=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&c.showSubTotals||"column"!==n?0:this.colValuesLength;var j=l[I].index;l[I].members=this.getIndexedHeaders(e,i,a+1,void 0===j?[]:j,n,s,o),"row"===n&&l[I].members.length>0&&this.drillDownLevel(a),this.frameHeaderObjectsCollection&&(this.headerObjectsCollection[s]=l[I].members)}}if(this.enableSort){if(v)return this.sortHeaders(u,g,l,g.sort,"date");if("number"===g.type.toLowerCase()&&l.length>0&&"string"==typeof l[0].actualText&&l[0].actualText.match(/[a-zA-Z]+/g)){var q=[],H=void 0,V=[],U=[];for(m=0;m<l.length;m++)if((0,t.isNullOrUndefined)(l[m].actualText.toString().match(/\d+/)))q.push(l[m]),H||"None"===g.sort||"Out of Range"===l[m].actualText&&(H=l[m],l.splice(m,1));else{if(""!==l[m].actualText){this.fieldList[u].isAlphanumeric=!0,V.push(l[m]);break}U.push(l[m])}return H&&("Ascending"===g.sort?"Grand Total"===l[0].actualText?l.splice(1,0,H):l.splice(0,0,H):"Grand Total"===l[l.length-1].actualText?l.splice(l.length-1,0,H):l.splice(l.length,0,H)),V.length>0&&this.sortHeaders(u,g,l,g.sort,g.isAlphanumeric),l}return this.sortHeaders(u,g,l,g.sort,g.type)}return l}return l},e.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},e.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,f=s[l[m]],v=t[a[u]][this.fieldKeys[p]];v=null===v?this.localeObj?this.localeObj.getConstant("null"):String(v):v;var S=this.formatFields[p]&&["date","dateTime","time"].indexOf(this.formatFields[p].type)>-1?this.getFormattedValue(v,p):{formattedText:v.toString(),actualText:v.toString()};f&&f.formattedText===S.formattedText&&(d&&d[m]?(d[m].index.push(a[u]),d[m].indexObject[a[u]]=a[u]):(d[m]={index:[],indexObject:{}},f.index=d[m].index=[a[u]],d[m].indexObject[a[u]]=a[u],f.indexObject=d[m].indexObject,f.valueSort={},f.valueSort.axis=p,0!==i?(f.valueSort.levelName=n+this.valueSortSettings.headerDelimiter+f.formattedText,f.valueSort[n+this.valueSortSettings.headerDelimiter+f.formattedText]=1,f.valueSort.uniqueName=n+this.valueSortSettings.headerDelimiter+(f.actualText?f.actualText:f.formattedText),f.valueSort[n+this.valueSortSettings.headerDelimiter+(f.actualText?f.actualText:f.formattedText)]=1):(f.valueSort[f.formattedText]=1,f.valueSort.levelName=f.formattedText,f.valueSort[f.actualText?f.actualText:f.formattedText]=1,f.valueSort.uniqueName=f.actualText?f.actualText:f.formattedText),g.members=[],o.push(g)))}for(var y=s.length-o.length;y>0;)o.push({members:[]}),y--;for(var b=0,C=o.length;b<C;b++)if(s[b].members.length>0){var x=null;s[b].valueSort&&s[b].valueSort.levelName&&(x=s[b].valueSort.levelName),n=x||s[b].formattedText,o[b].members=this.insertPosition(e,t,i+1,s[b].index,r,n,s[b].members)}return o}return o},e.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},e.prototype.calculatePagingValues=function(){if(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&&this.pageSettings.currentColumnPage>1&&(this.pageSettings.currentColumnPage+1)*this.colValuesLength>=this.columnPageCount?this.columnPageCount:this.pageSettings.currentColumnPage,this.pageSettings.currentRowPage=this.pageSettings.currentRowPage>=this.rowPageCount||this.enableOptimizedRendering&&this.pageSettings.currentRowPage>1&&(this.pageSettings.currentRowPage+1)*this.rowValuesLength>=this.rowPageCount?this.rowPageCount:this.pageSettings.currentRowPage;var e=this.enablePaging?1:this.enableOptimizedRendering?1.5:this.viewportPageCount;this.memberCnt=0,this.rowStartPos=(this.pageSettings.currentRowPage*this.pageSettings.rowPageSize-this.pageSettings.rowPageSize)*(this.enablePaging?1:this.rowValuesLength)+(this.enablePaging?1:0);var t=this.enablePaging?this.rowStartPos:this.rowStartPos+this.pageSettings.rowPageSize*e*this.rowValuesLength>this.rowCount?this.rowCount-this.pageSettings.rowPageSize*e*this.rowValuesLength:this.rowStartPos;if(t<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.lastMember={},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.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);else{var i=function(e,t){if(e&&0!==e.length)return e.find(function(e){return e&&e.type===t})},a=this.headerCollection&&this.headerCollection.rowHeaders?i(this.headerCollection.rowHeaders,"grand sum"):void 0,r=this.headerCollection&&this.headerCollection.columnHeaders?i(this.headerCollection.columnHeaders,"grand sum"):void 0,n=!!(this.dataSourceSettings&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals),s=!!(this.dataSourceSettings&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals);if(this.rowGrandTotal=this.rowGrandTotal?this.rowGrandTotal:a&&n?a:null,this.columnGrandTotal=this.columnGrandTotal?this.columnGrandTotal:r&&s?r:null,!this.rowGrandTotal||"grand sum"!==this.rowGrandTotal.type){var o=this.insertAllMember([],this.filterMembers,"","row");o&&o.length>0&&(this.rowGrandTotal=o[0],this.removeRowGrandTotal=!0)}if(!this.columnGrandTotal||"grand sum"!==this.columnGrandTotal.type){var l=this.insertAllMember([],this.filterMembers,"","column");l&&l.length>0&&(this.columnGrandTotal=l[0],this.removeColumnGrandTotal=!0)}}}},e.prototype.performSlicing=function(e,t,i,a){for(var r=0;e[r]&&!(this.enablePaging&&this.endPos<=this.memberCnt&&0!==r);){if(this.memberCnt+="row"===a?this.getRowMemberContributionCount(e[r]):e[r].level<=this.measureIndex?this.colValuesLength:1,!this.pageInLimit&&i<=this.memberCnt&&("column"===a?this.colFirstLvl=this.colFirstLvl+e[r].level:this.customProperties.isTabularLayout||(this.rowFirstLvl=this.rowFirstLvl+e[r].level),this.pageInLimit=!0),this.pageInLimit&&!this.enablePaging&&("column"===a?this.endPos<=this.memberCnt: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("row"===a&&e[r]&&e[r].members&&e[r].members.length>0&&e[r].members[e[r].members.length-1]&&e[r].members[e[r].members.length-1].valueSort&&e[r].members[e[r].members.length-1].valueSort.levelName&&this.addLastMember(e[r].actualText,e[r].members[e[r].members.length-1].valueSort.levelName),t.push(e[r].members.length>0?this.removeChildMembers(e[r]):e[r]),e[r].members.length>0&&("column"===a&&(this.memberCnt-=this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals&&this.columnKeys[e[r].valueSort.axis].showSubTotals?0:this.colValuesLength),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},e.prototype.addLastMember=function(e,t){var i=this.lastMember[e];i?"string"==typeof i&&i!==t?this.lastMember[e]=[i,t]:Array.isArray(i)&&!i.includes(t)&&i.push(t):this.lastMember[e]=t},e.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},e.prototype.insertAllMember=function(e,t,i,a){var r=e.length,n={hasChild:!1,index:t,level:0,axis:a,isDrilled:!1,indexObject:{},members:[],actualText:"Grand"+(i=" Total"),formattedText:this.localeObj?this.localeObj.getConstant("grandTotal"):"Grand"+i,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},e.prototype.getTableData=function(e,i,a,r,n,s,o,l,d,p){for(var h=e.length,u=0;u<h;u++){var c=!this.valueAxis&&!this.isLastHeaderHasMeasures&&n.length<this.dataSourceSettings.columns.length+1?this.dataSourceSettings.columns.length+1:n.length,g=e[u];i[c]=g;var m=c-Number(Object.keys(i)[0]),f=!i[c].members.length;g.colIndex=0,g.rowIndex=c;var v=!1,S=this.dataSourceSettings.valueSortSettings.headerDelimiter;if(this.valueAxis&&0===this.dataSourceSettings.rows.length&&this.dataSourceSettings.values.length>1&&(this.rowIndex=(0,t.isNullOrUndefined)(this.rowIndex)&&!f&&0===this.dataSourceSettings.rows.length?g.index:this.rowIndex,v=this.valueAxis&&0===this.dataSourceSettings.rows.length&&g.valueSort.levelName&&0!==g.valueSort.levelName.toString().indexOf("Grand Total"+S),this.valueAxis&&0===this.dataSourceSettings.rows.length&&0===g.valueSort.levelName.toString().indexOf("Grand Total"+S)&&(g.index=this.rowIndex)),v)f||this.recursiveRowData(e,i,a,c,n,s,f,u,0,o,l,d);else{var y=!1;if(this.showSubTotalsAtBottom&&i[r]&&i[r].hasChild)for(var b=0,C=i[r].members;b<C.length;b++)if("value"===C[b].type){y=!0;break}if(y&&!i[c].isSum&&i[c].members&&0===i[c].members.length)continue;if(n[c]||(n[c]=[],this.valueContent[m]={}),n[c][0]=i[c]=this.valueContent[m][0]=Hs.getFormattedHeader(g,this),this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)){var x=c,w=m,T=c,M=!1;if(((0!==o||0!==this.measureIndex)&&!f||f)&&"value"===g.type&&!g.valueSort.axis||o>this.measureIndex&&"row"===g.axis&&g.valueSort.axis)for(var D=0,O=!1,N=g.valueSort.uniqueName?g.valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter):[],P=0,E=1,I=a.length;P<I;++P){if(!O)for(D=0;D<s;D++)if(N.indexOf(this.dataSourceSettings.values[D].name)>-1){O=!0,M=!0;break}if(o>this.measureIndex&&"row"===g.axis&&g.valueSort.axis)this.updateRowData(e,a,c,n,D,u,P,E,m,l,d);else{if(!i[r]){M=!1;break}var F=this.showSubTotalsAtBottom&&p?p:r;this.updateRowData(i,a,c,n,D,F,P,E,m,l,d)}E=n[c].length}if(!M)for(P=0,E=1,I=a.length;P<I;++P)E=n[c].length,n[x][E]=this.valueContent[w][E]={axis:"value",actualText:"",colSpan:1,colIndex:E,formattedText:"",hasChild:!1};this.recursiveRowData(e,i,a,T,n,s,f,u,s,o,l,d)}else{for(P=0,E=1,I=a.length;P<I;++P){var L=a[P].valueSort.uniqueName?a[P].valueSort.uniqueName.toString().split(this.valueSortSettings.headerDelimiter):[];for(D=0;D<s;D++)(this.valueAxis||this.isLastHeaderHasMeasures||L.indexOf(this.dataSourceSettings.values[D].name)>-1)&&(this.updateRowData(e,a,c,n,D,u,P,E,m,l,d),E=n[c].length)}this.recursiveRowData(e,i,a,c,n,s,f,u,0,o,l,d)}}}},e.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&&e[i].members.length>0){var d=[],p=Hs.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 f=m[g];"value"===f.type&&(u[u.length]=f)}for(;h<u.length;){for(var v=Hs.frameHeaderWithKeys(u[h]),S=void 0;c<e.length;c++)if(e[c]&&e[c].valueSort.levelName===v.valueSort.levelName){S=e.indexOf(e[c]);break}S>-1&&(d[d.length]=S),v.formattedText=p.formattedText+" "+v.formattedText,v.isSum=!0,v.members=[],this.getTableData([v],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";var y=l?this.getParentIndex(e,p):0,b=void 0,C=void 0,x=!1;if(e&&e[i]&&e[i].members&&e[i].members.length>0){var w=e[i].members[e[i].members.length-1];w.valueSort&&"string"==typeof w.valueSort.levelName&&(b=w.valueSort.levelName)}this.lastMember&&e&&e[i]&&this.lastMember[e[i].actualText]&&(C=this.lastMember[e[i].actualText]),"string"==typeof b&&C&&(Array.isArray(C)?x=-1!==C.indexOf(b):"string"==typeof C&&(x=C===b)),(!this.enableVirtualization||this.enableVirtualization&&x)&&this.getTableData([p],e,t,i,a,r,n,s,o,y),d=[i]}for(S=0;S<d.length;S++){var T=a[d[S]];T=T.map(function(e){return e.formattedText=0===e.colIndex?e.formattedText:"",e}),a[d[S]]=T}}},e.prototype.getParentIndex=function(e,t){for(var i=0,a=e.length-1;a>0;a--)if(t.level===e[a].level&&e[a].index){i=a;break}return i},e.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":var o=void 0,l=void 0;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)&&t.length>0?(o=t[0].name,l=Object.keys(this.fieldList[t[0].name].members)[0]):e.length>0&&(o=e[0].name,l=Object.keys(this.fieldList[e[0].name].members)[0]);for(var d=!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":case"PercentageOfRunningTotals":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":o=void 0;this.selectedHeaders.values.push(r[s].name),r[s].baseField?o=r[s].baseField:this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&t.length>0?o=t[0].name:e.length>0&&(o=e[0].name);d=!1;for(var g=e.length,m=0;m<g;m++)if(e[m].name===o){var f=m>=this.measureIndex?m+1:m;this.getAggregatedHeaderData(i,r[s].name,void 0,!1,"row",r[s].type,this.selectedHeaders.selectedHeader,s,f),d=!0;break}if(!d)for(g=t.length,m=0;m<g;m++)if(t[m].name===o){f=m;this.valueAxis||this.isLastHeaderHasMeasures||(f=m>=this.measureIndex?m+1:m),this.getAggregatedHeaderData(a,r[s].name,void 0,!1,"column",r[s].type,this.selectedHeaders.selectedHeader,s,f);break}}},e.prototype.getAggregatedHeaderData=function(e,i,a,r,n,s,o,l,d){for(var p=0,h=e;p<h.length;p++){var u=h[p];switch(s){case"DifferenceFrom":case"PercentageOfDifferenceFrom":if(-1!==u.valueSort.levelName.toString().split(this.valueSortSettings.headerDelimiter).indexOf(a)){var c=[];if(!r&&"row"===n)for(var g=0,m=e;g<m.length;g++){var f=m[g];f.level>=u.level&&c.push(f)}if(o.push(this.updateSelectedHeaders(a,u.level,n,r,i,s,u.valueSort.levelName,r?[u]:"column"===n?e:c,l+1)),u.members.length>0){var v=!1,S=[];if("row"===n)for(var y=0,b=u.members;y<b.length;y++){if("value"!==(T=b[y]).type||0!==T.members.length){S.push(T),v=!1;break}v=!0}(!v&&S.length>0||"column"===n)&&this.getAggregatedHeaderData("column"===n?u.members:S,i,a,!0,n,s,o[o.length-1].childMembers,l)}}else u.members.length>0&&this.getAggregatedHeaderData(u.members,i,a,!1,n,s,o,l);break;case"RunningTotals":case"PercentageOfRunningTotals":case"PercentageOfParentRowTotal":case"PercentageOfParentColumnTotal":"grand sum"===u.type?o.push(this.updateSelectedHeaders(void 0,u.level,n,!1,i,s,u.valueSort.levelName,e,l+1)):u.members.length>0&&(o.push(this.updateSelectedHeaders(void 0,u.level,n,!1,i,s,u.valueSort.levelName,u.members,l+1)),this.getAggregatedHeaderData(u.members,i,void 0,!1,n,s,o,l));break;case"PercentageOfParentTotal":if("grand sum"!==u.type)if(u.valueSort.levelName.split(this.valueSortSettings.headerDelimiter).length-1===d)if(u.members.length>0){if(r)for(var C=o[o.length-1].aggregateHeaders,x=0,w=u.members;x<w.length;x++){var T=w[x];C.push((0,t.extend)({},T,null,!0))}else{var M=(0,t.extend)([],u.members,null,!0);o.push(this.updateSelectedHeaders(void 0,u.level,n,!1,i,s,u.valueSort.levelName,M,l+1)),(C=o[o.length-1].aggregateHeaders).push((0,t.extend)({},u,null,!0))}this.getAggregatedHeaderData(u.members,i,void 0,!0,n,s,o,l,d+1)}else r||o.push(this.updateSelectedHeaders(void 0,u.level,n,!1,i,s,u.valueSort.levelName,[u],l+1));else u.members.length>0&&this.getAggregatedHeaderData(u.members,i,void 0,!1,n,s,o,l,d)}}},e.prototype.updateSelectedHeaders=function(e,i,a,r,n,s,o,l,d){return{name:e,level:i,axis:a,isChild:r,value:n,type:s,uniqueName:o,aggregateHeaders:(0,t.extend)([],l,null,!0),childMembers:[],valueCount:d}},e.prototype.applyAdvancedAggregate=function(e,t,i){if(this.aggregatedValueMatrix=[],this.selectedHeaders.values.length>0){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)}if(!(this.showSubTotalsAtBottom&&i[l][0].isDrilled&&i[l][0].hasChild)&&r.length>0&&"value"===i[l][r[0]].axis&&-1!==this.selectedHeaders.values.indexOf(i[l][r[0]].actualText)){n.push(l);for(var u=0,c=r;u<c.length;u++){a[l+","+(f=c[u])]=[l,f]}}}this.updateAggregates(e,t,i,this.selectedHeaders.selectedHeader,r,n,a);for(var g=0,m=Object.keys(a);g<m.length;g++){var f;i[a[f=m[g]][0]][a[f][1]].formattedText=this.selectedHeaders.selectedHeader.length>0?this.emptyCellTextContent:"#N/A",this.aggregatedValueMatrix[a[f][0]]||(this.aggregatedValueMatrix[a[f][0]]=[]),this.aggregatedValueMatrix[a[f][0]][a[f][1]]=0}this.updatePivotValues(!0)}},e.prototype.calculateColumnGrandTotals=function(e,t,i,a,r,n){for(var s={},o=0,l=t;o<l.length;o++){for(var d=l[o],p=0,h=0,u=n;h<u.length;h++)for(var c=u[h],g=0,m=e;g<m.length;g++){var f=m[g];if(void 0!==i[f]){var v=a[f][d];i[f].valueSort[c.valueSort.levelName]&&i[f].level===c.level&&"grand sum"!==i[f].type&&"value"===v.axis&&v.actualText===r&&(p+=this.extractRunningTotalValue(v))}}s[d.toString()]=p}return s},e.prototype.calculateRowGrandTotals=function(e,t,i,a,r){for(var n={},s=0,o=e;s<o.length;s++){var l=o[s],d=0;if(void 0!==i[l])for(var p=0,h=r;p<h.length;p++)for(var u=h[p],c=t.length,g=0;g<c;g++){var m=i[l][g];void 0!==t[g]&&t[g].valueSort[u.valueSort.levelName]&&"value"===m.axis&&m.actualText===a&&"grand sum"!==t[g].type&&(d+=this.extractRunningTotalValue(m))}n[l.toString()]=d}return n},e.prototype.convertRunningTotalToPercentage=function(e,t,i){var a=0===t?0:e/t;return{actualValue:a,formattedText:0===a&&0===e?this.emptyCellTextContent:this.globalize.formatNumber(a,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,i)})}},e.prototype.extractRunningTotalValue=function(e){return e.showSubTotals||!(0,t.isNullOrUndefined)(e.actualValue)&&isNaN(e.actualValue)?(0,t.isNullOrUndefined)(e.value)||isNaN(e.value)?0:e.value:e.actualValue},e.prototype.isRowSubtotal=function(e,i){return i[e]&&i[e].hasChild&&i[e].isDrilled&&(!(0,t.isNullOrUndefined)(i[e].showSubTotals)&&!i[e].showSubTotals||!this.dataSourceSettings.showSubTotals||!this.dataSourceSettings.showRowSubTotals)},e.prototype.accumulateRowBasedRunningValues=function(e,t,i,a,r,n,s,o){for(var l=0,d=e;l<d.length;l++)for(var p=d[l],h=0,u=0,c=n;u<c.length;u++)for(var g=c[u],m=0,f=t;m<f.length;m++){var v=f[m];if(void 0!==i[v]){var S=a[v][p];if(void 0!==i[v]&&i[v].valueSort[g.valueSort.levelName]&&i[v].level===g.level&&"value"===S.axis&&S.actualText===r){"grand sum"!==i[v].type&&(h+=this.extractRunningTotalValue(S));var y=o(h,p);S.formattedText=S.showSubTotals?y.formattedText:S.formattedText,this.aggregatedValueMatrix[v]||(this.aggregatedValueMatrix[v]=[]),this.aggregatedValueMatrix[v][p]=y.actualValue,s[v+","+p]&&delete s[v+","+p]}}}},e.prototype.accumulateColumnBasedRunningValues=function(e,t,i,a,r,n,s,o){for(var l=0,d=e;l<d.length;l++){var p=d[l];if(void 0!==a[p])for(var h=0,u=0,c=n;u<c.length;u++)for(var g=c[u],m=t.length,f=0;f<m;f++){var v=a[p][f];if(void 0!==t[f]&&t[f].valueSort[g.valueSort.levelName]&&"value"===v.axis&&v.actualText===r){"grand sum"!==t[f].type&&(h+=this.extractRunningTotalValue(v));var S=o(h,p);v.formattedText=v.showSubTotals?S.formattedText:v.formattedText,this.aggregatedValueMatrix[p]||(this.aggregatedValueMatrix[p]=[]),this.aggregatedValueMatrix[p][f]=S.actualValue,s[p+","+f]&&delete s[p+","+f]}}}},e.prototype.updateAggregates=function(e,i,a,r,n,s,o){for(var l=this,d=function(r){var d=r.aggregateHeaders,h=r.value,u=r.type,c=r.uniqueName,g="row"===r.axis,m=void 0,f=[],v=[],S=[],y=[],b=[],C=[];if(-1!==["DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal","RunningTotals","PercentageOfRunningTotals"].indexOf(r.type))if(g){if("RunningTotals"!==r.type&&"PercentageOfRunningTotals"!==r.type)for(var x=0,w=s;x<w.length;x++){var T=w[x];if(void 0!==e[T]&&e[T].valueSort[c]){m=e[T],b=0===p.valueAxis||p.valueAxis&&a[T]&&a[T][1]&&a[T][1].actualText===h?a[T]:[];break}}}else{for(var M=a.length,D=0;D<M&&(void 0!==a[D]&&void 0===a[D][0]);D++)S.push(a[D]);for(var O=S.length;O--;){var N=(R=S[O][n[0]]).actualText;-1===p.selectedHeaders.values.indexOf(N)&&(v=S[O],O=0)}if("RunningTotals"!==r.type&&"PercentageOfRunningTotals"!==r.type){for(var P=v.length,E=0;E<P;E++){var I=!1;if(void 0!==v[E]&&v[E].valueSort[c]){m=v[E];var F=a.length;for(D=0;D<F;D++){void 0!==(R=a[D])&&void 0!==R[0]&&"value"===R[E].axis&&-1!==p.selectedHeaders.values.indexOf(R[E].actualText)&&(I=!0,C[D]=R[E],y.push(D))}if(I)break}}if(0===C.length&&0===y.length)for(P=v.length,E=0;E<P;E++){I=!1;if(void 0!==v[E]&&0===v[E].valueSort.levelName.indexOf(c)){m=v[E];for(var L=a.length,A=0;A<L;A++){var R;void 0!==(R=a[A])&&void 0!==R[0]&&"value"===R[E].axis&&-1!==p.selectedHeaders.values.indexOf(R[E].actualText)&&(I=!0,y.push(A))}if(I)break}}}}switch(r.type){case"DifferenceFrom":case"PercentageOfDifferenceFrom":var k=r.isChild;if(g){if(k)for(var j=c.split(p.valueSortSettings.headerDelimiter),q=0,H=s;q<H.length;q++){var V=H[q];if(void 0!==e[V]&&void 0!==m)if(-1!==e[V].valueSort.levelName.split(p.valueSortSettings.headerDelimiter).indexOf(j[j.length-1])&&m&&e[V].level===m.level)for(var U=0,B=n;U<B.length;U++){X=B[U];"value"===($=a[V][X]).axis&&$.actualText===h&&(f.push([V,X]),o[V+","+X]&&delete o[V+","+X])}}else for(var _=0,G=d;_<G.length;_++)for(var z=G[_],W=0,Q=s;W<Q.length;W++){T=Q[W];if(void 0!==e[T]&&void 0!==m&&e[T].valueSort[z.valueSort.levelName]&&e[T].level===m.level&&"grand sum"!==e[T].type)for(var Y=0,K=n;Y<K.length;Y++){var X=K[Y];"value"===($=a[T][X]).axis&&$.actualText===h&&(f.push([T,X]),o[T+","+X]&&delete o[T+","+X])}}for(var J=0,Z=f;J<Z.length;J++){X=Z[J];var $=a[X[0]][X[1]],ee=(0,t.isNullOrUndefined)(b[X[1]].actualValue)?0:b[X[1]].actualValue,te=((0,t.isNullOrUndefined)($.actualValue)?0:$.actualValue)-ee;te=isNaN(te)||0===$.value&&0===b[X[1]].value?0:te,p.aggregatedValueMatrix[X[0]]||(p.aggregatedValueMatrix[X[0]]=[]),"DifferenceFrom"===u?(p.aggregatedValueMatrix[X[0]][X[1]]=te,$.formattedText=0===te?p.emptyCellTextContent:p.getFormattedValue(te,h).formattedText):(te=0===ee?0:te/ee,p.aggregatedValueMatrix[X[0]][X[1]]=te,$.formattedText=$.showSubTotals?0!==te?p.globalize.formatNumber(te,{format:"P",maximumFractionDigits:p.getPercentFormat(p.formatFields,$.actualText)}):p.emptyCellTextContent:$.formattedText)}}else{if(k){j=c.split(p.valueSortSettings.headerDelimiter),P=v.length;for(var ie=0;ie<P;ie++){I=!1;if(void 0!==v[ie])if(-1!==v[ie].valueSort.levelName.split(p.valueSortSettings.headerDelimiter).indexOf(j[j.length-1])&&v[ie].level===m.level){for(var ae=0,re=y;ae<re.length;ae++){X=re[ae];"value"===($=a[X][ie]).axis&&$.actualText===h&&(I=!0,f.push([X,ie]),o[X+","+ie]&&delete o[X+","+ie])}if(I)break}}}else for(var ne=0,se=d;ne<se.length;ne++){z=se[ne];var P=v.length;for(E=0;E<P;E++){var I=!1;if(void 0!==v[E]&&v[E].valueSort[z.valueSort.levelName]&&m&&v[E].level===m.level&&"grand sum"!==v[E].type){for(var oe=0,le=y;oe<le.length;oe++){var X=le[oe];"value"===($=a[X][E]).axis&&$.actualText===h&&(I=!0,f.push([X,E]),o[X+","+E]&&delete o[X+","+E])}if(I)break}}}var de=void 0;0===C.length&&(de=p.getSelectedColumn(r.uniqueName,i));for(var pe=0,he=f;pe<he.length;pe++){X=he[pe],$=a[X[0]][X[1]];var ue=0;if(0===C.length){var ce=p.getSelectedRow($.rowHeaders,e);ue=p.getAggregateValue(ce.index,de.indexObject,p.fieldList[h].index,r.type,!1)}else ue=C[X[0]].value;te=$.value-ue;te=isNaN(te)?0:te,p.aggregatedValueMatrix[X[0]]||(p.aggregatedValueMatrix[X[0]]=[]),"DifferenceFrom"===u?($.formattedText=0===te?p.emptyCellTextContent:p.getFormattedValue(te,h).formattedText,p.aggregatedValueMatrix[X[0]][X[1]]=te):(te=0===C[X[0]].value?0:te/C[X[0]].value,$.formattedText=0!==te?p.globalize.formatNumber(te,{format:"P",maximumFractionDigits:p.getPercentFormat(p.formatFields,$.actualText)}):p.emptyCellTextContent,p.aggregatedValueMatrix[X[0]][X[1]]=te)}}r.childMembers.length>0&&p.updateAggregates(e,i,a,r.childMembers,n,s,o);break;case"PercentageOfParentRowTotal":case"PercentageOfParentColumnTotal":case"PercentageOfParentTotal":if(g){for(var ge=0,me=d;ge<me.length;ge++){z=me[ge];for(var fe=0,ve=s;fe<ve.length;fe++){D=ve[fe];if(void 0!==e[D]&&e[D].valueSort[z.valueSort.levelName]&&e[D].level===z.level)for(var Se=0,ye=n;Se<ye.length;Se++){X=ye[Se];"value"===($=a[D][X]).axis&&$.actualText===h&&(f.push([D,X]),o[D+","+X]&&delete o[D+","+X])}}}for(var be=0,Ce=f;be<Ce.length;be++){D=Ce[be],$=a[D[0]][D[1]];var xe=0;xe=0===b.length&&m?p.getAggregateValue(m.index,i[D[1]-1].indexObject,p.fieldList[h].index,r.type,!1):b[D[1]]?b[D[1]].actualValue:0;te=$.value/xe;te=isNaN(te)?0:te,$.formattedText=$.showSubTotals?0!==te?p.globalize.formatNumber(te,{format:"P",maximumFractionDigits:p.getPercentFormat(p.formatFields,$.actualText)}):p.emptyCellTextContent:$.formattedText,p.aggregatedValueMatrix[D[0]]||(p.aggregatedValueMatrix[D[0]]=[]),p.aggregatedValueMatrix[D[0]][D[1]]=te}}else{for(var we=0,Te=d;we<Te.length;we++)for(z=Te[we],P=v.length,A=0;A<P;A++){I=!1;if(void 0!==v[A]&&v[A].valueSort[z.valueSort.levelName]){for(var Me=0,De=y;Me<De.length;Me++){X=De[Me];if(!(p.showSubTotalsAtBottom&&a[X][0].isDrilled&&a[X][0].hasChild))"value"===($=a[X][A]).axis&&$.actualText===h&&(I=!0,f.push([X,A]),o[X+","+A]&&delete o[X+","+A])}if(I)break}}var Oe=void 0;0===C.length&&(Oe=p.getSelectedColumn(r.uniqueName,i));for(var Ne=0,Pe=f;Ne<Pe.length;Ne++){D=Pe[Ne],$=a[D[0]][D[1]];var Ee=0;if(0===C.length){ce=p.getSelectedRow($.rowHeaders,e);Ee=p.getAggregateValue(ce.index,Oe.indexObject,p.fieldList[h].index,r.type,!1)}else Ee=C[D[0]].value;var Ie=$.value/Ee;Ie=isNaN(Ie)?0:Ie,$.formattedText=0!==Ie?p.globalize.formatNumber(Ie,{format:"P",maximumFractionDigits:p.getPercentFormat(p.formatFields,$.actualText)}):p.emptyCellTextContent,p.aggregatedValueMatrix[D[0]]||(p.aggregatedValueMatrix[D[0]]=[]),p.aggregatedValueMatrix[D[0]][D[1]]=Ie}}break;case"RunningTotals":g?p.accumulateRowBasedRunningValues(n,s,e,a,h,d,o,function(e,t){return{formattedText:0===e?"":l.getFormattedValue(e,h).formattedText,actualValue:e}}):p.accumulateColumnBasedRunningValues(s,v,e,a,h,d,o,function(t,i){return{formattedText:l.isRowSubtotal(i,e)?"":l.getFormattedValue(t,h).formattedText,actualValue:t}});break;case"PercentageOfRunningTotals":if(g){var Fe=p.calculateColumnGrandTotals(s,n,e,a,h,d);p.accumulateRowBasedRunningValues(n,s,e,a,h,d,o,function(e,t){var i=Fe[t.toString()]||0;return l.convertRunningTotalToPercentage(e,i,h)})}else{var Le=p.calculateRowGrandTotals(s,v,a,h,d);p.accumulateColumnBasedRunningValues(s,v,e,a,h,d,o,function(t,i){if(l.isRowSubtotal(i,e))return{formattedText:"",actualValue:t};var a=Le[i.toString()]||0;return l.convertRunningTotalToPercentage(t,a,h)})}}},p=this,h=0,u=r;h<u.length;h++){d(u[h])}},e.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=Vs({},i.indexObject,n.indexObject))}return i},e.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},e.prototype.recursiveRowData=function(e,i,a,r,n,s,o,l,d,p,h,u){o||this.getTableData(i[r].members,i,a,r,n,s,p+1,h,u),this.showSubTotalsAtBottom&&((0,t.isNullOrUndefined)(e[l].showSubTotals)||e[l].showSubTotals)&&this.insertRowSubTotals(i,a,r,n,s,p,h,u),this.isPagingOrVirtualizationEnabled||(i[r].members=[])},e.prototype.updateRowData=function(e,i,a,r,n,s,o,l,d,p,h){var u=this.fieldList[this.dataSourceSettings.values[n].name].index,c=this.fieldList[this.dataSourceSettings.values[n].name].aggregateType,g=this.dataSourceSettings.values[n].name,m=[],f={},v=0,S=0;switch(c){case"Index":for(var y=["cVal","rTotalVal","cTotalVal","gTotalVal"],b=0,C=0,x=m=[[e[s],i[o]],[e[s],h],[p,i[o]],[p,h]];C<x.length;C++){var w=x[C];f[y[b]]=this.getAggregateValue(w[0].index,w[1].indexObject,u,c,0!==b),b++}var T=f.cVal*f.gTotalVal/(f.rTotalVal*f.cTotalVal);v=!(e[s].members.length>0&&e[s].hasChild&&e[s].isDrilled)||((0,t.isNullOrUndefined)(e[s].showSubTotals)||e[s].showSubTotals)&&this.dataSourceSettings.showRowSubTotals&&this.dataSourceSettings.showSubTotals?(0,t.isNullOrUndefined)(f.cVal)?f.cVal:isNaN(T)?0:T:void 0,S=(0,t.isNullOrUndefined)(f.cVal)?f.cVal:isNaN(T)?0:T;break;case"PercentageOfGrandTotal":case"PercentageOfColumnTotal":case"PercentageOfRowTotal":(m=[[e[s],i[o]]]).push("PercentageOfGrandTotal"===c?[p,h]:"PercentageOfColumnTotal"===c?[p,i[o]]:[e[s],h]);y=["cVal","gTotalVal"],b=0;for(var M=0,D=m;M<D.length;M++){w=D[M];f[y[b]]=this.getAggregateValue(w[0].index,w[1].indexObject,u,c,0!==b),b++}T=f.cVal/f.gTotalVal;v=!(e[s].members.length>0&&e[s].hasChild&&e[s].isDrilled)||((0,t.isNullOrUndefined)(e[s].showSubTotals)||e[s].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals?(0,t.isNullOrUndefined)(f.cVal)?f.cVal:isNaN(T)?0:T:void 0,S=(0,t.isNullOrUndefined)(f.cVal)?f.cVal:isNaN(T)?0:T;break;default:T=this.getAggregateValue(e[s].index,i[o].indexObject,u,c,!1);v=!(e[s].members.length>0&&e[s].hasChild&&e[s].isDrilled)||((0,t.isNullOrUndefined)(e[s].showSubTotals)||e[s].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals?T:void 0,S=T}var O=(0,t.isNullOrUndefined)(e[s])?null:Vs({},e[s]),N=(0,t.isNullOrUndefined)(i[o])?null:Vs({},i[o]);(0,t.isNullOrUndefined)(O)||O.isSum||(O.isSum=O.hasChild&&O.isDrilled||"grand sum"===O.type),(0,t.isNullOrUndefined)(N)||N.isSum||(N.isSum=N.hasChild&&N.isDrilled||"grand sum"===N.type);var P={fieldName:this.dataSourceSettings.values[n].name,row:O,column:N,value:v,cellSets:this.getValueCellInfo?this.getCellSet(this.rawIndexObject):[],rowCellType:"grand sum"===e[s].type?"grandTotal":e[s].hasChild&&e[s].isDrilled||this.showSubTotalsAtBottom&&"sum"===e[s].type&&e[s].isSum?"subTotal":"value",columnCellType:"grand sum"===i[o].type?"grandTotal":i[o].hasChild&&i[o].isDrilled||this.showSubTotalsAtBottom&&"sum"===i[o].type&&i[o].isSum?"subTotal":"value",aggregateType:c,skipFormatting:!1};this.getValueCellInfo&&this.getValueCellInfo(P),v=P.value;var E=e[s].hasChild||i[o].hasChild||"grand sum"===e[s].type||"grand sum"===i[o].type||this.showSubTotalsAtBottom&&e[s].isSum,I="grand sum"===e[s].type||"grand sum"===i[o].type,F=e[s].members.length>0&&e[s].hasChild&&e[s].isDrilled&&(!(0,t.isNullOrUndefined)(e[s].showSubTotals)&&!e[s].showSubTotals||!this.dataSourceSettings.showSubTotals||!this.dataSourceSettings.showRowSubTotals),L=F?"":void 0===v?this.emptyCellTextContent:"Count"===c||"DistinctCount"===c?v.toLocaleString():this.getFormattedValue(v,g).formattedText;!isNaN(v)&&!(0,t.isNullOrUndefined)(v)&&["PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal"].indexOf(c)>=0?L=this.globalize.formatNumber(v,{format:"P",maximumFractionDigits:this.getPercentFormat(this.formatFields,P.fieldName)}):F||!isNaN(v)||(0,t.isNullOrUndefined)(v)||-1===["PopulationStDev","SampleStDev","PopulationVar","SampleVar"].indexOf(c)||(L="#DIV/0!",v=0),L=P.skipFormatting?(0,t.isNullOrUndefined)(v)?this.emptyCellTextContent:v.toString():L,r[a][l]=this.valueContent[d][l]={axis:"value",actualText:g,indexObject:this.isDrillThrough?this.rawIndexObject:{},rowHeaders:"grand sum"===e[s].type?"":e[s].valueSort.levelName,columnHeaders:"grand sum"===i[o].type?"":i[o].valueSort.levelName,formattedText:L,value:v,hierarchyName:i[o].hierarchyName,actualValue:S,rowIndex:a,colIndex:l,isSum:E,isGrandSum:I,showSubTotals:!F},this.rawIndexObject={}},e.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},e.prototype.updateValueMembers=function(e,i,a,r,n,s,o){var l=a&&!(0,t.isNullOrUndefined)(a.levelName)?a.levelName.toString():void 0,d=a&&!(0,t.isNullOrUndefined)(a.uniqueName)?a.uniqueName.toString():void 0;if(e)for(var p=0;p<s;p++){var h=this.dataSourceSettings.values[p],u=h.caption?h.caption:h.name,c={axis:this.valueAxis?"row":"column",rowIndex:this.valueAxis?0:i&&o<=i.rowIndex?i.rowIndex+1:o,actualText:h.name,formattedText:u,level:0,valueSort:{},members:[],type:this.valueAxis?"value":i?i.type:null,index:!this.valueAxis&&i?i.index:null,indexObject:!this.valueAxis&&i?i.indexObject:null};n.length>0&&(c.showSubTotals=h.showSubTotals);var g=c.valueSort;g.axis=this.valueAxis?void 0:h.name,g[(l?l+this.valueSortSettings.headerDelimiter:"")+u]=1,g[(d?d+this.valueSortSettings.headerDelimiter:"")+h.name]=1,g.levelName=(l?l+this.valueSortSettings.headerDelimiter:"")+u,g.uniqueName=(d?d+this.valueSortSettings.headerDelimiter:"")+h.name,r.push(c),this.updateValueMembers(!1,i,g,c.members,n,s,o+1)}else for(var m=0,f=n.length;m<f;m++){var v=Hs.frameHeaderWithKeys(n[m]);v.members=[],v.rowIndex=this.valueAxis?v.rowIndex:o<0?0:o;var S={};S.axis=v.valueSort.axis,S[(l?l+this.valueSortSettings.headerDelimiter:"")+v.formattedText]=1,S[(d?d+this.valueSortSettings.headerDelimiter:"")+v.actualText]=1,S.levelName=(l?l+this.valueSortSettings.headerDelimiter:"")+v.formattedText,S.uniqueName=(d?d+this.valueSortSettings.headerDelimiter:"")+v.actualText,v.hierarchyName=v.valueSort.uniqueName,v.valueSort=S;var y=S.axis+this.valueSortSettings.headerDelimiter+S.levelName,b=this.fieldList[S.axis];v.isDrilled&&((this.isExpandAll||b.expandAll)&&this.fieldDrillCollection[y]||!this.isExpandAll&&!b.expandAll&&!this.fieldDrillCollection[y])&&(v.isDrilled=!1),r.push(v),v.isDrilled&&n[m].members.length>0?(this.valueAxis&&o<this.measureIndex&&this.measureIndex!==o+1&&(!n[m].hasChild||((0,t.isNullOrUndefined)(n[m].showSubTotals)||n[m].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals)&&this.updateValueMembers(!0,v,S,r[r.length-1].members,[],s,o),this.updateValueMembers(this.measureIndex===o+1,v,S,r[r.length-1].members,n[m].members,s,o+1),!this.valueAxis&&o<this.measureIndex&&this.measureIndex!==o+1&&(!n[m].hasChild||((0,t.isNullOrUndefined)(n[m].showSubTotals)||n[m].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals)&&this.updateValueMembers(!0,v,S,r[r.length-1].members,[],s,o)):o<this.measureIndex&&this.updateValueMembers(!0,v,S,r[r.length-1].members,[],s,o)}},e.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)},e.prototype.frameDefinedHeaderData=function(e,i,a,r,n,s){for(var o=0,l=e.length;o<l;o++){var d=!0;!(e[o].members.length>0)||((0,t.isNullOrUndefined)(e[o].showSubTotals)||e[o].showSubTotals)&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals||(d=!1);var p=this.measureIndex<r&&d?1:this.measureIndex>r&&e[o].members.length>0||this.measureIndex!==r+1||!e[o].isDrilled?this.measureIndex===r&&0!==this.measureIndex&&d||this.measureIndex>r&&d&&e[o].valueSort&&e[o].valueSort.axis&&this.measureNames[e[o].valueSort.axis.toString()]?1:0:0!==this.measureIndex&&d?1:0;if(e[o].members.length){var h=void 0,u=e[o].members;this.showSubTotalsAtTop?r+1<this.measureIndex&&d?(h=n,u=this.reArrangeValueMember(u)):h=n+p:h=n,this.frameDefinedHeaderData(u,i,a,r+1,h,s)}var c=this.measureIndex>r&&e[o].valueSort&&e[o].valueSort.axis&&this.measureNames[e[o].valueSort.axis.toString()]?this.measureIndex:r;i[(n=this.showSubTotalsAtTop?n+1:i.length+p)-1]||(i[n-1]=Hs.frameHeaderWithKeys(e[o])),e[o].colIndex=n,a[c]||(a[c]=[],this.headerContent[c]={}),a[c][n]=this.headerContent[c][n]=Hs.frameHeaderWithKeys(e[o]),this.isPagingOrVirtualizationEnabled||this.showSubTotalsAtTop&&0===p||i[n-1]&&(i[n-1].members=[]),this.showSubTotalsAtTop&&(n=i.length,o+1===l&&0===e[o].level&&(this.reformAxisCount=i.length+1))}},e.prototype.getHeaderData=function(e,i,a,r,n,s,o,l,d){if(this.valueAxis||this.isLastHeaderHasMeasures){if(0===r.length&&this.valueAxis&&(this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader)&&this.dataSourceSettings.values.length>0){if(this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&!(0,t.isNullOrUndefined)(this.rMembers)&&this.rMembers.length>0&&"grand sum"===this.rMembers[this.rMembers.length-1].type)this.updateValueMembers(0===this.measureIndex&&this.rMembers.length>1,null,null,r,this.rMembers.slice(0,this.rMembers.length-1),this.dataSourceSettings.values.length,0),this.updateValueMembers(!1,null,null,r,this.rMembers.slice(this.rMembers.length-1,this.rMembers.length),this.dataSourceSettings.values.length,-1);else if("Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&0===this.measureIndex)this.updateValueMembers(!1,null,null,r,this.rMembers.slice(0,1),this.dataSourceSettings.values.length,-1),this.updateValueMembers(0===this.measureIndex&&this.rMembers.length>1,null,null,r,this.rMembers.slice(1,this.rMembers.length),this.dataSourceSettings.values.length,0);else{var p=0===e.length&&1===this.rMembers.length&&"grand sum"===this.rMembers[0].type;this.updateValueMembers(!p&&0===this.measureIndex,null,null,r,this.rMembers,this.dataSourceSettings.values.length,p?-1:0)}if(this.getAggregatedHeaders(e,i,r,n,a),this.selectedHeaders.values.length>0)for(E=this.selectedHeaders.selectedHeader.length,I=0;I<E;I++){if("row"===(F=this.selectedHeaders.selectedHeader[I]).axis){var h=F.aggregateHeaders.length;for(A=0;A<h;A++)if(F.aggregateHeaders[A].actualText===F.value)if(-1!==F.aggregateHeaders[A].valueSort.levelName.indexOf(F.uniqueName))F.uniqueName=F.aggregateHeaders[A].valueSort.levelName,F.aggregateHeaders.splice(A,1),A--,h--;else for(var u=F.aggregateHeaders[A].members.length,c=0;c<u;c++){if("value"!==(j=F.aggregateHeaders[A].members[c]).type&&j.level===F.aggregateHeaders[A].level){var g=(0,t.extend)([],F.aggregateHeaders[A].members,null,!0);F.aggregateHeaders=[].concat(F.aggregateHeaders,g,F.aggregateHeaders.splice(A)),F.aggregateHeaders.splice(g.length+A,1),A=g.length+A-1,h=F.aggregateHeaders.length}}else if(F.aggregateHeaders[A].actualText!==F.value&&F.aggregateHeaders[A].members.length>0)for(u=F.aggregateHeaders[A].members.length,c=0;c<u;c++){if((j=F.aggregateHeaders[A].members[c]).actualText===F.value){F.uniqueName===F.aggregateHeaders[A].valueSort.levelName&&(F.uniqueName=j.valueSort.levelName),F.aggregateHeaders[A].members.splice(c,1),F.aggregateHeaders[A]=j;break}}}}}for(var m=n.length,f=this.dataSourceSettings.columns.length,v=this.valueSortSettings.headerText,S=0;S<m;S++){var y=!(0,t.isNullOrUndefined)(n[S].showSubTotals)&&!n[S].showSubTotals;n[S].members.length&&this.getHeaderData(e,i,a,r,n[S].members,s,o,this.showSubTotalsAtTop&&!y?l+1:l,d);var b=!0;l=this.showSubTotalsAtTop?l:s.length,!y&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showColumnSubTotals?s[l]=Hs.frameHeaderWithKeys(n[S]):(n[S].members.length>0?(this.removeCount++,b=!1):s[this.showSubTotalsAtTop?l:s.length]=Hs.frameHeaderWithKeys(n[S]),l=this.showSubTotalsAtTop?l:s.length-1);var C=n[S].level;n[S].rowIndex=C;var x=l*d+(this.showSubTotalsAtTop?1:d);n[S].colIndex=x,o[C]||(o[C]=[],this.headerContent[C]={}),o[C][x]=this.headerContent[C][x]=Hs.getFormattedHeader(n[S],this);var w=0===this.dataSourceSettings.columns.length&&1===this.dataSourceSettings.values.length;if((this.isMultiMeasures||this.dataSourceSettings.alwaysShowValueHeader||w)&&!this.valueAxis&&b)for(var T=0;T<d;T++){var M=this.dataSourceSettings.values[T].caption?this.dataSourceSettings.values[T].caption:this.dataSourceSettings.values[T].name,D={axis:"column",actualText:this.dataSourceSettings.values[T].name,formattedText:M,level:0,valueSort:{},colIndex:l*d+1+T,rowIndex:f};o[f]||(o[f]=[],this.headerContent[f]={}),o[f][l*d+1+T]=this.headerContent[f][l*d+1+T]=D;var O=o[f][l*d+1+T].valueSort;O[n[S].valueSort.levelName+this.valueSortSettings.headerDelimiter+M]=1,O.levelName=n[S].valueSort.levelName+this.valueSortSettings.headerDelimiter+M,O[n[S].valueSort.uniqueName+this.valueSortSettings.headerDelimiter+this.dataSourceSettings.values[T].name]=1,O.uniqueName=n[S].valueSort.uniqueName+this.valueSortSettings.headerDelimiter+this.dataSourceSettings.values[T].name,O&&O[v]&&(this.valueSortSettings.columnIndex=l*d+1+T)}else n[S].valueSort&&n[S].valueSort[v]&&(this.valueSortSettings.columnIndex=l*d+1);this.isPagingOrVirtualizationEnabled||(s[l].members=[]),this.showSubTotalsAtTop&&(l=s.length,0===n[S].level&&S+1===m&&(this.reformAxisCount=s.length*d+1))}}else{var N=[];if(this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals&&"grand sum"===n[n.length-1].type)this.updateValueMembers(0===this.measureIndex&&n.length>1,null,null,N,n.slice(0,n.length-1),d,0),this.updateValueMembers(!1,null,null,N,n.slice(n.length-1,n.length),d,-1);else if("Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals&&0===this.measureIndex)this.updateValueMembers(!1,null,null,N,n.slice(0,1),d,-1),this.updateValueMembers(0===this.measureIndex&&n.length>1,null,null,N,n.slice(1,n.length),d,0);else{var P=0===i.length&&1===n.length&&"grand sum"===n[0].type;this.updateValueMembers(!P&&0===this.measureIndex,null,null,N,n,d,P?-1:0)}if(this.getAggregatedHeaders(e,i,this.rMembers,N,a),this.selectedHeaders.values.length>0)for(var E=this.selectedHeaders.selectedHeader.length,I=0;I<E;I++){var F;if("column"===(F=this.selectedHeaders.selectedHeader[I]).axis)if(F.uniqueName===F.value)this.selectedHeaders.selectedHeader.splice(I,1),I--,E--;else if("Grand Total"===F.uniqueName)for(var L=F.aggregateHeaders.length,A=0;A<L;A++)if(F.aggregateHeaders[A]&&F.aggregateHeaders[A].members.length>0)for(var R=0,k=F.aggregateHeaders[A].members;R<k.length;R++){var j;(j=k[R]).actualText===F.value&&(F.aggregateHeaders[A]=j,"grand sum"===j.type&&(F.uniqueName=j.valueSort.levelName))}}this.frameDefinedHeaderData(N,s,o,0,this.showSubTotalsAtTop?0:1,d)}},e.prototype.getAggregateValue=function(e,i,a,r,n){var s=0,o=0,l=0,d=!0,p=!1;switch(r.toLowerCase()){case"median":for(var h=[],u=0;void 0!==e[s];){void 0!==i[w=e[s]]&&(p=!0,this.rawIndexObject[w]=w,(0,t.isNullOrUndefined)(this.valueMatrix[w][a].member)||h.push(this.valueMatrix[w][a].member)),s++}(E=h.length)>0&&(h.sort(function(e,t){return e-t}),o=E%2==0?(h[u=E/2<=1?0:E/2-1]+h[u+1])/2:h[u=(E+1)/2<=1?0:(E+1)/2-1]);break;case"count":for(;void 0!==e[s];){void 0!==i[w=e[s]]&&(p=!0,this.rawIndexObject[w]=w,o+=(0,t.isNullOrUndefined)(this.valueMatrix[w][a].member)?0:this.allowDataCompression?this.valueMatrix[w][a].member:1),s++}break;case"distinctcount":for(var c=[];void 0!==e[s];){if(void 0!==i[e[s]]){this.rawIndexObject[e[s]]=e[s],p=!0;var g=this.data[e[s]][this.fieldKeys[this.fields[a]]];if(!(0,t.isNullOrUndefined)(g)){var m=g.toString();(0===c.length||c.length>0&&-1===c.indexOf(m))&&(o+=this.allowDataCompression&&"number"==typeof g?g:1,c.push(m))}}s++}break;case"product":for(;void 0!==e[s];){if(void 0!==i[w=e[s]]){this.rawIndexObject[w]=w,p=!0;m=this.valueMatrix[w][a].member;(0,t.isNullOrUndefined)(m)?d&&(o=m):(o=d||(0,t.isNullOrUndefined)(o)?1:o,o*=m),d=!1}s++}break;case"populationstdev":case"samplestdev":case"populationvar":case"samplevar":for(var f=0,v=(g=0,[]),S=0,y=0,b=0;void 0!==e[s];){if(void 0!==i[w=e[s]]){p=!0,this.rawIndexObject[w]=w;m=this.valueMatrix[w][a].member;(0,t.isNullOrUndefined)(m)||(g+=m,v.push(m),f++)}s++}if(f>0){S=g/f;for(var C=0,x=v;C<x.length;C++){var w=x[C];b+=Math.pow(w-S,2)}o=0===(y=-1!==["populationstdev","samplestdev"].indexOf(r.toLowerCase())?Math.sqrt(b/("populationstdev"===r.toLowerCase()?f:f-1)):b/("populationvar"===r.toLowerCase()?f:f-1))?NaN:y}else o=g;break;case"min":var T=!0;for(o=void 0;void 0!==e[s];){void 0!==i[w=e[s]]&&void 0!==this.valueMatrix[w][a].member&&(p=!0,this.rawIndexObject[w]=w,(0,t.isNullOrUndefined)(o)&&(0,t.isNullOrUndefined)(this.valueMatrix[w][a].member)?o=this.valueMatrix[w][a].member:T?(o=this.valueMatrix[w][a].member,T=!1):o=this.valueMatrix[w][a].member<o?this.valueMatrix[w][a].member:o),s++}break;case"max":for(var M=!0;void 0!==e[s];){void 0!==i[w=e[s]]&&void 0!==this.valueMatrix[w][a].member&&(p=!0,this.rawIndexObject[w]=w,M?(o=this.valueMatrix[w][a].member,M=!1):o=this.valueMatrix[w][a].member>o?this.valueMatrix[w][a].member:o),s++}break;case"calculatedfield":p=!0;var D=this.calculatedFields[this.fields[a]],O=D.formula,N={};if(this.calculatedFormulas[D.name])for(var P=this.calculatedFormulas[D.name],E=0,I=P.length;E<I;E++){var F=P[E],L=N[F.formula];if(void 0===L){var A=F.type;L=this.getAggregateValue(e,i,F.index,A,!1),N[F.formula]=L}O=O.replace(F.formula,L<0?"("+String(L)+")":String(L))}o=(o=this.evaluate(O))===1/0||o===-1/0?1/0:void 0===o||isNaN(o)?void 0:JSON.parse(String(o));break;default:for(o=void 0;void 0!==e[s];){if(void 0!==i[w=e[s]]){p=!0,n||(this.rawIndexObject[w]=w);m=this.valueMatrix[w][a].member;(0,t.isNullOrUndefined)(o)&&(0,t.isNullOrUndefined)(m)?o=m:((0,t.isNullOrUndefined)(o)&&(o=0),o+=(0,t.isNullOrUndefined)(m)?0:m),(0,t.isNullOrUndefined)(m)||l++}s++}}return r&&"avg"===r.toLowerCase()&&0!==o&&!(0,t.isNullOrUndefined)(o)?o/l:p?o:void 0},e.prototype.evaluate=function(e){return Function('"use strict";return ('+e+")")()},e.prototype.getFormattedValue=function(e,i){var a=null===e?this.localeObj?this.localeObj.getConstant("null"):String(e):void 0===e?this.localeObj?i in this.groupingFields?this.localeObj.getConstant("groupOutOfRange"):this.localeObj.getConstant("undefined"):String(e):e,r={formattedText:a.toString(),actualText:a,dateText:a};if(this.formatFields[i]&&(this.formatFields[i].format||this.formatFields[i].skeleton)&&!(0,t.isNullOrUndefined)(e))try{var n=this.formatFields[i].properties?this.formatFields[i].properties:this.formatFields[i],s=(0,t.extend)({},n,null,!0);delete s.name,!s.minimumSignificantDigits&&s.minimumSignificantDigits<1&&delete s.minimumSignificantDigits,!s.maximumSignificantDigits&&s.maximumSignificantDigits<1&&delete s.maximumSignificantDigits,s.type?(r.formattedText=null===this.dateFormatFunction[i].exactFormat(new Date(e))?r.formattedText:this.dateFormatFunction[i].exactFormat(new Date(e)),r.actualText=e):(delete s.type,s.format&&!this.formatRegex.test(s.format)&&((0,t.isNullOrUndefined)(s.minimumFractionDigits)&&delete s.minimumFractionDigits,(0,t.isNullOrUndefined)(s.maximumFractionDigits)&&delete s.maximumFractionDigits,(0,t.isNullOrUndefined)(s.minimumIntegerDigits)&&delete s.minimumIntegerDigits),r.formattedText=this.globalize.formatNumber(isNaN(Number(e))?e:Number(e),s),r.actualText=isNaN(Number(e))?e:Number(e),r.dateText=isNaN(Number(e))?e:Number(e)),"None"!==this.fieldList[i].sort&&s.type&&["date","dateTime","time"].indexOf(this.formatFields[i].type)>-1&&(r.dateText=this.dateFormatFunction[i].fullFormat(new Date(e))),this.fieldList[i].isCustomField&&(r.formattedText="NaN"===r.formattedText?a.toString():r.formattedText,r.dateText="NaN"===r.dateText?a.toString():r.dateText)}catch(e){if(!this.fieldList[i].isCustomField)throw e}finally{this.fieldList[i].isCustomField&&(r.formattedText=(0,t.isNullOrUndefined)(r.formattedText)||"NaN"===r.formattedText?a.toString():r.formattedText,r.dateText=(0,t.isNullOrUndefined)(r.dateText)||"NaN"===r.dateText?a.toString():r.dateText)}return r},e.prototype.powerFunction=function(e){if(e.indexOf("^")>-1){for(var t=[];e.indexOf("(")>-1;)e=e.replace(/(\([^()]*\))/g,function(e,i){return t.push(i),"~"+(t.length-1)});for(t.push(e),e="~"+(t.length-1);e.indexOf("~")>-1;)e=e.replace(new RegExp("~(\\d+)","g"),function(e,i){return t[i].replace(/(\w*)\^(\w*)/g,"Math.pow($1,$2)")})}return e},e.prototype.getTabularPivotValues=function(e){var i;this.tabularPivotValues=[];for(var a={},r=Object.keys(this.groupingFields).length>0,n=0;n<this.pivotValues.length;n++){for(var s=void 0,o=!1,l=!0,d=void 0,p=void 0,h=void 0,u=!1;(0,t.isNullOrUndefined)(this.pivotValues[n])&&n<this.pivotValues.length;)this.tabularPivotValues.length++,n++;n<this.pivotValues.length&&(s=this.pivotValues[n]);var c=s[0]?s[0]:void 0;if(c&&(d=p=c.valueSort.levelName.split(this.dataSourceSettings.valueSortSettings.headerDelimiter),(this.dataSourceSettings.showSubTotals||"value"===c.type)&&this.dataSourceSettings.showRowSubTotals||c.formattedText===this.localeObj.getConstant("grandTotal")||c.isSum&&(l=!1),r)){var g=this.pivotValues[n-1][0],m=this.tabularPivotValues[this.tabularPivotValues.length-1][this.rowMaxLevel-1];if(!(0,t.isNullOrUndefined)(g)||!(0,t.isNullOrUndefined)(m)){var f=g.valueSort.axis,v=void 0;!(0,t.isNullOrUndefined)(m)&&m.valueSort.axis&&(v=m.valueSort.axis),h=(f.includes("custom_group")||!(0,t.isNullOrUndefined)(v)&&v.includes("custom_group"))&&(g.formattedText===d[this.rowMaxLevel-1]&&g.formattedText!==d[d.length-1]||m&&m.formattedText===d[this.rowMaxLevel-1])?g.valueSort.axis?g.valueSort.axis:m.valueSort.axis:c.valueSort.axis}}if(c&&this.isTabularMultiValueRowAxis){if("value"===c.type&&d.length-1!==this.rowMaxLevel&&d[0]!==this.localeObj.getConstant("grandTotal"))for(var S=0;S<this.dataSourceSettings.values.length;S++)if(c.formattedText===this.dataSourceSettings.values[S].name){l=!1,c.hasChild=!1;break}d.length-1!==this.rowMaxLevel?(c.isDrilled=!0,c.hasChild||c.type?d[0]===this.localeObj.getConstant("grandTotal")&&"grand sum"===c.type?c.hasChild=!0:c.level=d.length-1:c.hasChild=!0):c.level=d.length-1,o=Hs.isMemberDrilled(c,d,this.drilledMembers)}if(l&&d&&d.length>1&&"sum"===c.type&&d[d.length-1]===d[d.length-2]&&(l=!1),(0,t.isNullOrUndefined)(c)||"row"!==c.axis){for(var y=[],b=this.rowMaxLevel+1,C=0;C<this.rowMaxLevel;C++)y.push(void 0);y.push(c);H=s.slice(1,s.length);for(var x=0;x<H.length;x++)H[x].colIndex=b,H[x].rowIndex=this.tabularPivotValues.length,b++;y=y.concat(H),this.tabularPivotValues.push(y)}else if((0,t.isNullOrUndefined)(s[1])||c.hasChild&&c.isDrilled||!l){if(this.isTabularMultiValueRowAxis&&this.dataSourceSettings.rows.length===this.measureIndex){var w=c.valueSort.levelName.toString();if(w){a[w]={index:c.index,indexObject:c.indexObject};var T=this.valueSortSettings.headerDelimiter;delete a[w.split(T).slice(0,-1).join(T)]}}}else{var M=[],D=[];if(this.isTabularMultiValueRowAxis&&(e&&o?d.length-1<this.rowMaxLevel:d.length<=this.rowMaxLevel)&&"value"===c.type&&(this.dataSourceSettings.expandAll?!o:o)||d[0]===this.localeObj.getConstant("grandTotal")){for(var O=d.length-1;O>=0;O--){if(u=!0,d[O]===d[d.length-2]){if(M[O]=d[d.length-2]+" "+d[d.length-1],D[O]=d[d.length-2]+this.valueSortSettings.headerDelimiter+d[d.length-1],0===O)break;for(;O>=0;)M[O-1]=d[O-1],D[O-1]=p[O-1],O--;break}M[O]=d[d.length-2]+" "+d[d.length-1],D[O]=d[d.length-2]+this.valueSortSettings.headerDelimiter+d[d.length-1]}d=M,p=D}i=c.colIndex;for(var N=[],P=p[0],E=0,I=0;I<d.length-1||I<this.rowMaxLevel;I++){var F=void 0,L=void 0,A=c.isDrilled,R=c.hasChild;if(this.isTabularMultiValueRowAxis){if(F=!1,L=!1,d[d.length-1]!==d[d.length-2])I<(d.length-1===this.rowMaxLevel&&this.dataSourceSettings.rows.length===this.rowMaxLevel?d.length-2:d.length-1)&&(L=!0),I<d.length-2&&(F=!0)}else I<this.rowMaxLevel&&(R=!0),(d.length>1||0===I)&&(A=!0);if(I<d.length-1&&(I>0&&(P=P+this.dataSourceSettings.valueSortSettings.headerDelimiter+p[I]),N.push({actualText:d[I],axis:c.axis,formattedText:d[I],rowIndex:this.tabularPivotValues.length,hasChild:this.isTabularMultiValueRowAxis&&"grand sum"!==c.type?L:R,isDrilled:this.isTabularMultiValueRowAxis&&"grand sum"!==c.type?F:A,level:E,valueSort:{levelName:u&&"value"===c.type&&I===this.rowMaxLevel?c.valueSort.levelName:P,axis:r?h?h.includes("custom_group")?h:this.dataSourceSettings.rows[I].name:c.valueSort.axis:this.dataSourceSettings.rows[I]?this.dataSourceSettings.rows[I].name:c.valueSort.axis},type:u?c.type:void 0,colIndex:i++,colSpan:1,rowSpan:1})),I>=c.level){var k=0===I?this.rowMaxLevel:this.rowMaxLevel-1;N.push({actualText:this.isTabularMultiValueRowAxis?void 0===d[I]?d[d.length-1]:d[I]:c.formattedText,axis:c.axis,formattedText:this.isTabularMultiValueRowAxis?void 0===d[I]?d[d.length-1]:d[I]:c.formattedText,rowIndex:this.tabularPivotValues.length,hasChild:this.isTabularMultiValueRowAxis&&"grand sum"!==c.type?L:c.hasChild,isDrilled:this.isTabularMultiValueRowAxis&&"grand sum"!==c.type?F:c.isDrilled,level:E,valueSort:{levelName:c.valueSort.levelName,axis:r?h?h.includes("custom_group")?h:this.dataSourceSettings.rows[I].name:c.valueSort.axis:this.dataSourceSettings.rows[I].name},type:u||c.type?c.type:void 0,colIndex:i++,colSpan:k,rowSpan:1})}var j=N[N.length-1],q=j.valueSort.levelName.toString();a[q]&&(j.index=a[q].index,j.indexObject=a[q].indexObject,delete a[q]),E++}c.colIndex=i,c.rowIndex=this.tabularPivotValues.length,c.colSpan=1,c.rowSpan=1,this.isTabularMultiValueRowAxis&&(c.formattedText=d[d.length-1]),N.push(c),this.setColumnSpan(N,c);for(var H=s.slice(1,s.length),V=1;V<s.length;V++){var U=s[V];U.colIndex=i+1,U.rowIndex=this.tabularPivotValues.length,i++}N=N.concat(H),this.tabularPivotValues.push(N)}}return this.tabularPivotValues},e.prototype.drillDownLevel=function(e,t){void 0===t&&(t=!1),this.levelMap[e]=(this.levelMap[e]||0)+1,t&&this.updateRowMaxLevel()},e.prototype.drillUpLevel=function(e,t){void 0===t&&(t=!1),this.levelMap[e]&&this.levelMap[e]>0&&(this.levelMap[e]--,0===this.levelMap[e]&&delete this.levelMap[e]),t&&this.updateRowMaxLevel()},e.prototype.updateRowMaxLevel=function(){var e=Object.keys(this.levelMap).map(function(e){return Number(e)});e.length>0?this.rowMaxLevel=Math.max.apply(Math,e)+1:this.rowMaxLevel=0,this.rowMaxLevel=this.isTabularMultiValueRowAxis?this.rowMaxLevel+1:this.rowMaxLevel},e.prototype.setColumnSpan=function(e,t){for(var i=1,a=e.length-1;a>=0;a--){if(0!==a&&e[a].formattedText===e[a-1].formattedText&&e[a].valueSort.levelName===e[a-1].valueSort.levelName&&(e[a].colSpan=0,i++,e[a-1].colSpan=i),a<("row"===this.dataSourceSettings.valueAxis&&(this.dataSourceSettings.values.length>1||this.dataSourceSettings.alwaysShowValueHeader)?e.length-2:e.length-1)&&!t.isSum&&e[e.length-1].formattedText!==e[e.length-2].formattedText&&"grand sum"!==t.type){e[a].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[a].formattedText&&(e[a].isDrilled=!!e[a].isDrilled)}}},e.prototype.setRowSpan=function(){for(var e=this.headerContent.length,i=0;i<this.rowMaxLevel;i++){var a=1;if(this.tabularPivotValues.length>this.rowMaxLevel+e)for(var r=this.tabularPivotValues.length-1;r>=e-1;r--)if(r!==e-1){var n=this.tabularPivotValues;if((0,t.isNullOrUndefined)(n[r-1]))break;if((0,t.isNullOrUndefined)(n[r-1][i]))a=1;else{var s=n[r-1][i].valueSort.levelName,o=s.lastIndexOf(this.dataSourceSettings.valueSortSettings.headerDelimiter),l=-1!==o?s.substring(0,o):s,d=n[r][i].valueSort.levelName,p=d.lastIndexOf(this.dataSourceSettings.valueSortSettings.headerDelimiter),h=-1!==p?d.substring(0,p):d;n[r][i].formattedText===n[r-1][i].formattedText&&h===l?(n[r][i].rowSpan=0,a++,n[r-1][i].rowSpan=a):a=1}}}},e}(),Bs=v(197),_s=v(707),Gs=v(215),zs=v(323),Ws=v(778),Qs=function(){function e(e){this.stringAggregateTypes=["Count","DistinctCount"],this.menuInfo=[],this.parent=e}return e.prototype.render=function(e,t){this.parentElement=t,this.openContextMenu(e)},e.prototype.openContextMenu=function(e){var t=this,i=e.target.parentElement.getAttribute("data-uid");Hs.getFieldInfo(i,this.parent);this.buttonElement=e.target.parentElement;var a="number"!==this.parent.engineModule.fieldList[i].type?1:0,r=this.getMenuItem(a).slice(),n={cancel:!1,fieldName:i,aggregateTypes:r,displayMenuCount:7},s="pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent;try{s.trigger(Wa,n,function(i){if(!i.cancel){r=i.aggregateTypes,t.createContextMenu(a,r,i.displayMenuCount),t.currentMenu=e.target;var n=t.currentMenu.getBoundingClientRect();t.parent.enableRtl?t.menuInfo[a].open(n.top+(window.scrollY||document.documentElement.scrollTop),n.left-105):t.menuInfo[a].open(n.top+(window.scrollY||document.documentElement.scrollTop),n.left)}})}catch(e){this.parent.actionFailureMethod(e)}},e.prototype.createContextMenu=function(e,i,a){var r=this,n=[];n[e]=[],this.menuInfo[e]&&!this.menuInfo[e].isDestroyed&&this.menuInfo[e].destroy();for(var s=[],o=0;o<i.length;o++){var l=i[o];e?this.stringAggregateTypes.indexOf(l)>-1&&s.indexOf(l)<0&&(n[e].push({text:this.parent.localeObj.getConstant(l),id:this.parent.element.id+"StringMenu_"+l}),s.push(l)):this.parent.getAllSummaryType().indexOf(l)>-1&&s.indexOf(l)<0&&(n[e].push({text:this.parent.localeObj.getConstant(l),id:this.parent.element.id+"_"+l}),s.push(l))}n[e].length>a&&(n[e].splice(a),n[e].push({text:this.parent.localeObj.getConstant("MoreOption"),id:this.parent.element.id+"_MoreOption"}));var d={items:n[e],enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:this.parent.cssClass,beforeOpen:this.beforeMenuOpen.bind(this,e),onClose:function(){(0,t.select)("#"+r.buttonElement.id,r.parentElement).focus()},select:this.selectOptionInContextMenu.bind(this)},p=document.getElementById(this.parent.element.id+(e?"valueFieldStringContextMenu":"valueFieldContextMenu"));null!==p?p.innerHTML="":p=(0,t.createElement)("ul",{id:this.parent.element.id+(e?"valueFieldStringContextMenu":"valueFieldContextMenu")}),this.parent.element.appendChild(p),this.menuInfo[e]=new Gs.ContextMenu(d),this.menuInfo[e].isStringTemplate=!0,this.menuInfo[e].isAngular=this.parent.isModalDialog,this.menuInfo[e].appendTo(p)},e.prototype.getMenuItem=function(e){for(var t=[],i=0;i<this.parent.aggregateTypes.length;i++){var a=this.parent.aggregateTypes[i];"Server"===this.parent.dataSourceSettings.mode&&"PercentageOfRunningTotals"===a||(e?this.stringAggregateTypes.indexOf(a)>-1&&-1===t.indexOf(a)&&t.push(a):this.parent.getAllSummaryType().indexOf(a)>-1&&-1===t.indexOf(a)&&t.push(a))}return t},e.prototype.beforeMenuOpen=function(e,t){Hs.invokeActionMethod(this.parent,or,Ln)?t.cancel=!0:(t.element.style.zIndex=(this.menuInfo[e].element.style.zIndex+3).toString(),t.element.style.display="inline")},e.prototype.createValueSettingsDialog=function(e,i,a){var r=this;if(!Hs.invokeActionMethod(this.parent,or,An)){this.parentElement=i;var n=(0,t.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")}});this.parentElement.appendChild(n);var s=new Bs.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("valueFieldSettings"),content:this.createFieldOptions(e,a),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:ie+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){Hs.invokeActionMethod(r.parent,lr,qs,{}),s.hide()},isFlat:!1,buttonModel:{cssClass:ae+(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});s.isStringTemplate=!0,s.isAngular=this.parent.isModalDialog,s.appendTo(n)}},e.prototype.createFieldOptions=function(e,i){var a=this,r=e.getAttribute("data-caption"),n=i&&"MoreOption"!==i?i:e.getAttribute("data-type"),s=e.getAttribute("data-basefield"),o=e.getAttribute("data-baseitem");n="undefined"!==n.toString()?n:"Sum";for(var l=[],d=this.parent.aggregateTypes,p=[],h=0;h<d.length;h++){var u=d[h];"Server"===this.parent.dataSourceSettings.mode&&"PercentageOfRunningTotals"===u||this.parent.getAllSummaryType().indexOf(u)>-1&&p.indexOf(u)<0&&(l.push({value:u,text:this.parent.localeObj.getConstant(u)}),p.push(u))}var c=["DifferenceFrom","PercentageOfDifferenceFrom"],g=["DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"],m=(0,t.extend)([],this.parent.dataSourceSettings.rows,null,!0);m=m.concat(this.parent.dataSourceSettings.columns);for(var f=[],v=[],S=0,y=m;S<y.length;S++){var b=y[S],C=b.name,x=b.caption?b.caption:b.name;f.push({value:C,text:x})}if(0===Object.keys(f).length)f.push({value:"",text:""}),s="",v=[];else{var w="undefined"!==(s=s&&"undefined"!==s.toString()&&"null"!==s.toString()?s:f[0].value).toString()?s:f[0].value,T=Hs.isDateField(w,this.parent.engineModule);v=this.parent.engineModule.fieldList[w].dateMember.map(function(e){return T?e.formattedText:a.parent.engineModule.getFormattedValue(e.actualText,w).formattedText})}o="undefined"!==o.toString()?o:v[0];var M=(0,t.createElement)("div",{className:"e-value-field-div-content",id:this.parentElement.id+"_field_div_content",attrs:{"data-type":n,"data-caption":r,"data-basefield":s,"data-baseitem":o}}),D=(0,t.createElement)("div",{className:"e-field-name-text-container"}),O=(0,t.createElement)("div",{className:"e-field-option-container"}),N=(0,t.createElement)("div",{className:"e-type-option-container"}),P=(0,t.createElement)("div",{className:"e-base-field-option-container"}),E=(0,t.createElement)("div",{className:"e-base-item-option-container"}),I=(0,t.createElement)("div",{className:"e-field-name-title"});I.innerHTML=this.parent.localeObj.getConstant("sourceName")+" ";var F=(0,t.createElement)("div",{className:"e-field-name-content"});F.innerText=this.parent.enableHtmlSanitizer?t.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?this.buttonElement:document.getElementsByClassName(F.innerText)[0];var L=(0,t.createElement)("div",{className:"e-type-option-text"});L.innerText=this.parent.localeObj.getConstant("sourceCaption");var A=(0,t.createElement)("div",{className:"e-base-field-option-text"});A.innerText=this.parent.localeObj.getConstant("summarizeValuesBy");var R=(0,t.createElement)("div",{className:"e-base-item-option-text"});R.innerText=this.parent.localeObj.getConstant("baseField");var k=(0,t.createElement)("div",{className:"e-type-option-text"});k.innerText=this.parent.localeObj.getConstant("baseItem");var j=(0,t.createElement)("div",{className:"e-caption-input-container"}),q=(0,t.createElement)("div",{id:this.parentElement.id+"_type_option"}),H=(0,t.createElement)("div",{id:this.parentElement.id+"_base_field_option"}),V=(0,t.createElement)("div",{id:this.parentElement.id+"_base_item_option"}),U=(0,t.createElement)("input",{id:this.parentElement.id+"type_input_option",className:"e-caption-input-text",attrs:{type:"text"}});D.appendChild(I),D.appendChild(F),j.appendChild(L),j.appendChild(U),N.appendChild(A),P.appendChild(R),E.appendChild(k),N.appendChild(q),P.appendChild(H),E.appendChild(V),O.appendChild(D),O.appendChild(j),O.appendChild(N),O.appendChild(P),O.appendChild(E),M.appendChild(O);var B=this,_=new Ws.DropDownList({dataSource:l,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:n,cssClass:Ae+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){G.enabled=-1!==g.indexOf(e.value),z.enabled=-1!==c.indexOf(e.value),z.enabled&&1===z.dataSource.length&&(z.dataSource=v,z.dataBind())}});_.isStringTemplate=!0,_.isAngular=this.parent.isModalDialog,_.appendTo(q);var G=new Ws.DropDownList({dataSource:f,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:s,enabled:-1!==g.indexOf(n),cssClass:Ae+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var t=Hs.isDateField(e.value,a.parent.engineModule);v=B.parent.engineModule.fieldList[e.value].dateMember.map(function(i){return t?i.formattedText:a.parent.engineModule.getFormattedValue(i.actualText,e.value).formattedText}),z.dataSource=v,z.value=v[0],z.filterBarPlaceholder=B.parent.localeObj.getConstant("example")+" "+v[0],z.itemData=null,z.dataBind()}});G.isStringTemplate=!0,G.isAngular=this.parent.isModalDialog,G.appendTo(H);var z=new Ws.DropDownList({dataSource:v,enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:o,allowFiltering:!0,filterBarPlaceholder:this.parent.localeObj.getConstant("example")+" "+v[0],enabled:-1!==c.indexOf(n),cssClass:Re+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%"});z.isStringTemplate=!0,z.isAngular=this.parent.isModalDialog,z.appendTo(V);var W=new zs.MaskedTextBox({placeholder:"Enter field caption",enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:r,width:"100%",cssClass:this.parent.cssClass});return W.isStringTemplate=!0,W.appendTo(U),M},e.prototype.selectOptionInContextMenu=function(e){if(null!==e.item.text){var i=this.currentMenu.parentElement,a=Hs.getFieldInfo(i?i.getAttribute("data-uid"):"",this.parent);this.parent.actionObj.fieldInfo=a.fieldItem;var r=e.item.id.split("_").pop();try{if("MoreOption"===r||"PercentageOfDifferenceFrom"===r||"PercentageOfParentTotal"===r||"DifferenceFrom"===r)this.createValueSettingsDialog(i,this.parentElement,r);else{if(this.parent.actionObj.actionName=bn,Hs.invokeActionMethod(this.parent,or,bn))return;var n=i.getAttribute("data-uid"),s=this.parent.dataSourceSettings.values,o=i.querySelector("."+k),l=(0,t.isNullOrUndefined)(this.parent)||(0,t.isNullOrUndefined)(this.parent.engineModule)||(0,t.isNullOrUndefined)(this.parent.engineModule.fieldList[n])?"":this.parent.engineModule.fieldList[n].caption,d=e.item.text+" "+this.parent.localeObj.getConstant("of")+" "+l;d=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(d):d,this.parent.dataSourceSettings.showAggregationOnValueField&&(o.innerText=d),o.setAttribute("title",d),i.setAttribute("data-type",r);for(var p=0;p<this.parent.dataSourceSettings.values.length;p++)if(this.parent.dataSourceSettings.values[p].name===n){var h=(0,t.extend)({},s[p].properties?s[p].properties:s[p],null,!0);h.type=r,this.parent.engineModule.fieldList[n].aggregateType=r,s.splice(p,1,h),this.parent.lastAggregationInfo=h}this.setAggregateActionInfo(r,n,l),this.parent.actionObj.actionName=ms,this.updateDataSource()}}catch(e){this.parent.actionFailureMethod(e)}}},e.prototype.updateDataSource=function(e){!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotview"===this.parent.getModuleName()||this.parent.isAdaptive&&"pivotfieldlist"===this.parent.getModuleName()&&"Popup"===this.parent.renderMode?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(hr,this),this.parent.pivotGridModule.engineModule=this.parent.engineModule):this.parent.triggerPopulateEvent()},e.prototype.updateValueSettings=function(){var e,i=(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"_ValueDialog",document),Bs.Dialog),a=i.element,r=(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"type_input_option"),zs.MaskedTextBox),n=(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"_type_option"),Ws.DropDownList),s=(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"_base_field_option"),Ws.DropDownList),o=(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"_base_item_option"),Ws.DropDownList),l=a.getAttribute("data-field");if(this.parentElement.querySelector("."+A)&&(e=this.parentElement.getElementsByClassName(A+" "+l.replace(/[^A-Z0-9]/gi,""))[0]),e){var d=e.querySelector("."+k),p=this.parent.dataSourceSettings.showAggregationOnValueField?this.parent.localeObj.getConstant(n.value)+" "+this.parent.localeObj.getConstant("of")+" "+r.value:r.value;p=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(p):p,d.innerText=p,d.setAttribute("title",p),e.setAttribute("data-type",n.value),e.setAttribute("data-caption",r.value),e.setAttribute("data-basefield",s.value),e.setAttribute("data-baseitem",o.value)}var h=Hs.getFieldByName(l,this.parent.dataSourceSettings.values);(h=h.properties?h.properties:h).caption=r.value,h.type=n.value,h.baseField=s.value,h.baseItem=o.value,this.parent.engineModule.fieldList[l].aggregateType=h.type,i.close(),this.parent.lastAggregationInfo=h;var u="PercentageOfDifferenceFrom"===h.type||"PercentageOfParentTotal"===h.type||"DifferenceFrom"===h.type;this.parent.actionObj.actionName=ms,this.setAggregateActionInfo(h.type,h.name,h.caption,u?h.baseField:void 0,u?h.baseItem:void 0),this.parent&&this.parent.allowDeferLayoutUpdate&&Hs.invokeActionMethod(this.parent,lr,ms)||this.updateDataSource(!0)},e.prototype.removeDialog=function(){this.buttonElement&&(0,t.select)("#"+this.buttonElement.id,this.parentElement)&&(0,t.select)("#"+this.buttonElement.id,this.parentElement).focus();var e=(0,t.select)("#"+this.parentElement.id+"_ValueDialog",document),i=e?(0,t.getInstance)(e,Bs.Dialog):null;i&&!i.isDestroyed&&i.destroy(),document.getElementById(this.parentElement.id+"_ValueDialog")&&(0,t.remove)(document.getElementById(this.parentElement.id+"_ValueDialog"))},e.prototype.destroy=function(){this.parent&&this.parent.isDestroyed||(this.cleanupMenuInstances(),this.cleanupDialogs(),this.cleanupDOMElements(),this.currentMenu=null,this.buttonElement=null)},e.prototype.cleanupMenuInstances=function(){if(this.menuInfo){for(var e=0;e<this.menuInfo.length;e++)this.menuInfo[e]&&!this.menuInfo[e].isDestroyed&&this.menuInfo[e].destroy();this.menuInfo=[]}for(var i=0,a=[document.getElementById(this.parent.element.id+"valueFieldContextMenu"),document.getElementById(this.parent.element.id+"valueFieldStringContextMenu")];i<a.length;i++){var r=a[i];r&&(0,t.remove)(r)}},e.prototype.cleanupDialogs=function(){if(this.parentElement){var e=(0,t.select)("#"+this.parentElement.id+"_ValueDialog",document);if(e){var i=(0,t.getInstance)(e,Bs.Dialog);i&&!i.isDestroyed&&(this.cleanupDialogComponents(e),i.destroy()),(0,t.remove)(e)}}},e.prototype.cleanupDialogComponents=function(e){if(e&&this.parentElement){var i=(0,t.select)("#"+this.parentElement.id+"type_input_option",e);if(i){var a=(0,t.getInstance)(i,zs.MaskedTextBox);a&&!a.isDestroyed&&a.destroy()}for(var r=0,n=["#"+this.parentElement.id+"_type_option","#"+this.parentElement.id+"_base_field_option","#"+this.parentElement.id+"_base_item_option"];r<n.length;r++){var s=n[r],o=(0,t.select)(s,e);if(o){var l=(0,t.getInstance)(o,Ws.DropDownList);l&&!l.isDestroyed&&l.destroy()}}}},e.prototype.cleanupDOMElements=function(){for(var e=0,i=[this.parent.element.id+"valueFieldContextMenu",this.parent.element.id+"valueFieldStringContextMenu"];e<i.length;e++){var a=i[e],r=document.getElementById(a);r&&(0,t.remove)(r)}},e.prototype.setAggregateActionInfo=function(e,t,i,a,r){this.parent.actionObj.actionInfo={aggregateInfo:{aggregateType:e,fieldName:t,fieldCaption:i,baseField:a||void 0,baseItem:r||void 0}}},e}(),Ys=function(){function e(e){this.isAutoFitEnabled=!1,this.pivotColumns=[],this.indentCollection={},this.colPos=0,this.lastSpan=0,this.lvlCollection={},this.hierarchyCollection={},this.lvlPosCollection={},this.hierarchyPosCollection={},this.isContextMenuOpened=!1,this.position=0,this.measurePos=0,this.maxMeasurePos=0,this.hierarchyCount=0,this.actualText="",this.drilledLevelInfo={},this.selectedCells=[],this.parent=e,this.resColWidth=this.parent.isTabular?this.parent.showGroupingBar&&this.parent.groupingBarModule?this.parent.isAdaptive?110:150:this.parent.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.aggMenu=new Qs(this.parent)}return e.prototype.render=function(e){if(e&&(this.timeOutObj&&(clearTimeout(this.timeOutObj),this.timeOutObj=void 0),this.removeAllHyperlinkEventHandlers(),this.initProperties()),this.resColWidth=this.parent.isTabular?this.parent.showGroupingBar&&this.parent.groupingBarModule?this.parent.isAdaptive?110:150:this.parent.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("."+ft)){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;var i=this.parent.isTabular?this.parent.engineModule.rowMaxLevel+1:1;this.parent.grid.setProperties({frozenColumns:i,columns:this.frameStackedHeaders(),dataSource:("olap"===this.parent.dataType&&""!==this.parent.dataSourceSettings.url||this.parent.dataSourceSettings.dataSource&&this.parent.engineModule.data.length>0&&this.parent.dataSourceSettings.values.length>0)&&!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.width=this.calculateGridWidth(),this.parent.grid.refreshColumns(),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+pe)&&this.parent.groupingBarModule.setGridRowWidth(),this.isAutoFitEnabled?this.addPivotAutoFitClass():this.removePivotAutoFitClass(),!this.gridSettings.allowAutoResizing&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+pe)&&this.parent.groupingBarModule.refreshUI(),this.parent.isScrolling||this.calculateGridHeight(!0)}else{this.parent.element.innerHTML="",this.bindGrid(this.parent,!!this.engine.isEmptyData);var a=(0,t.createElement)("div",{id:this.parent.element.id+"_grid"});this.parent.element.appendChild(a),this.parent.grid.isStringTemplate=!0,this.parent.grid.appendTo(a)}this.parent.grid.on(_s.headerRefreshed,this.refreshHeader,this)},e.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},e.prototype.refreshHeader=function(){var e=this.parent.element.querySelector("."+At);if(this.parent.enableVirtualization&&!(0,t.isNullOrUndefined)(e)){var i=(0,t.closest)(e,"."+Qt).querySelector("."+Lt),a=this.parent.element.querySelector("."+kt),r=e.querySelector("."+Ft);if(this.parent.virtualHeaderDiv=a.querySelector("."+Ft),a.querySelector("."+Ft)?(0,t.remove)(a.querySelector("."+Ft)):this.parent.virtualHeaderDiv=(0,t.createElement)("div",{className:Ft}),a.appendChild(this.parent.virtualHeaderDiv),r&&(0,t.setStyleAttribute)(this.parent.virtualHeaderDiv,{height:0,width:r.style.width}),a.querySelector("."+Be)){(0,t.setStyleAttribute)(a.querySelector("."+Be),{transform:e.querySelector("."+Be).style.transform.split(",")[0]+",0px)"});var n=parseInt(a.querySelector("."+Be).style.transform.split("(")[1].split(",")[0].split("px")[0],10);this.parent.enableRtl?this.parent.element.querySelector("."+bi).style.right=Number(n)+"px":this.parent.element.querySelector("."+bi).style.left=Number(-n)+"px"}var s=this.parent.isAdaptive?e:i&&"none"!==i.style.display?i:e.parentElement;a.scrollLeft=s.scrollLeft}},e.prototype.bindGrid=function(e,t){this.injectGridModules(e),this.parent.grid=new _s.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.cellSelecting.bind(this),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))},e.prototype.actionComplete=function(e){if(e&&"refresh"===e.requestType&&this.isAutoFitEnabled&&this.removePivotAutoFitClass(),this.parent&&this.parent.isWindowResized&&this.selectedCells&&this.selectedCells.length>0){this.parent.grid.clearSelection();var i=this.parent.element,a=[];this.selectedCells.forEach(function(e){if(null!=e.colIndex){var t='[aria-colindex="'+(e.colIndex+1)+'"]';null!=e.rowIndex&&(t+='[index="'+e.rowIndex+'"]');var r=i.querySelector(t);r&&a.push(r)}}),a.forEach(function(e){(0,t.addClass)([e],[_t,qt])})}this.parent.isWindowResized=!1},e.prototype.addPivotAutoFitClass=function(){document.body.classList.contains(vt)||document.body.classList.add(vt),document.body.classList.contains(Mi)||document.body.classList.add(Mi)},e.prototype.removePivotAutoFitClass=function(){document.body.classList.contains(vt)&&document.body.classList.remove(vt),document.body.classList.contains(Mi)&&document.body.classList.remove(Mi)},e.prototype.headerRefreshed=function(){var e=this.parent.element.querySelector("."+kt);this.parent.lastGridSettings&&Object.keys(this.parent.lastGridSettings).indexOf("allowResizing")>-1&&!(0,t.isNullOrUndefined)(e)&&e.querySelector("."+Be)&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+pe)&&(this.parent.lastGridSettings=void 0,this.parent.groupingBarModule.setGridRowWidth())},e.prototype.beforeExcelExport=function(e){(0,t.isNullOrUndefined)(e.gridObject.columns)||(0,t.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(Ja,e)},e.prototype.rowSelected=function(e){this.parent.renderModule.selected(),this.parent.trigger(aa,e)},e.prototype.rowDeselected=function(e){this.parent.renderModule.selected(),this.parent.trigger(ra,e)},e.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(Ji,e))},e.prototype.cellSelecting=function(e){var i=this.parent.grid.selectionModule.actualTarget;!(0,t.isNullOrUndefined)(i)&&(i.classList.contains("e-expand")||i.classList.contains("e-collapse")||this.parent.allowGrouping&&!(0,t.isNullOrUndefined)(i.closest(".e-valuescontent")))&&(e.cancel=!0),this.parent.trigger(Zi,e)},e.prototype.cellDeselected=function(e){this.parent.renderModule.selected(),this.parent.trigger(ia,e)},e.prototype.queryCellInfo=function(e){this.parent.renderModule.rowCellBoundEvent(e)},e.prototype.headerCellInfo=function(e){this.parent.renderModule.columnCellBoundEvent(e)},e.prototype.excelHeaderQueryCellInfo=function(e){this.parent.renderModule.excelColumnEvent(e)},e.prototype.pdfQueryCellInfo=function(e){this.parent.renderModule.pdfRowEvent(e)},e.prototype.excelQueryCellInfo=function(e){this.parent.renderModule.excelRowEvent(e)},e.prototype.pdfHeaderQueryCellInfo=function(e){this.parent.renderModule.pdfColumnEvent(e)},e.prototype.pdfExportComplete=function(e){void 0!==this.parent.lastColumn&&this.parent.lastColumn&&"auto"!==this.parent.lastColumn.width&&(this.parent.lastColumn.width="auto",this.parent.lastColumn=void 0);var t={type:"PDF",promise:e.promise};this.parent.trigger(ki,t)},e.prototype.excelExportComplete=function(e){void 0!==this.parent.lastColumn&&this.parent.lastColumn&&"auto"!==this.parent.lastColumn.width&&(this.parent.lastColumn.width="auto",this.parent.lastColumn=void 0);var t={type:"Excel/CSV",promise:e.promise};this.parent.trigger(ki,t)},e.prototype.dataBound=function(){if(this.parent.notEmpty&&this.calculateGridHeight(!0),this.parent.isScrolling=!1,this.setFocusOnLastCell(),(0,t.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.isTabular){var e=this.parent.element.querySelectorAll("."+ze+"."+bi),i=this.parent.enableRtl;e.forEach(function(a,r){var n=r===e.length-1;(0,t.isNullOrUndefined)(a)||i&&(!i||n)||a.style.setProperty("border-left-width","0px")})}this.parent.notify(mr,{})},e.prototype.setFocusOnLastCell=function(){if(this.parent.keyboardModule&&this.parent.keyboardModule.event&&"TD"===this.parent.keyboardModule.event.target.nodeName){var e=this.parent.grid.serviceLocator.getService("focus");e.setFocusedElement(this.parent.keyboardModule.event.target),e.focus(this.parent.keyboardModule.event),(0,t.addClass)([this.parent.keyboardModule.event.target],["e-focused","e-focus"]),this.parent.keyboardModule.event.target.setAttribute("tabindex","0"),this.parent.keyboardModule.event=void 0}},e.prototype.getCellElement=function(e){var i=(0,t.closest)(e,"td");return(0,t.isNullOrUndefined)(i)&&(i=(0,t.closest)(e,"th")),i},e.prototype.contextMenuOpen=function(e){var i,a=this;if(!this.isContextMenuOpened&&(this.isContextMenuOpened=!0,Hs.invokeActionMethod(this.parent,or,Ga,{})))return e.cancel=!0,void(this.isContextMenuOpened=!1);e.element&&this.parent.cssClass&&(0,t.addClass)([e.element.parentElement],this.parent.cssClass);var r=this.parent.lastCellClicked?this.parent.lastCellClicked:this.parent.isAdaptive?e.event.target:this.parent.lastCellClicked;r&&(i=this.getCellElement(r));for(var n=function(r){var n=void 0,o=void 0;if(!i||i&&0===Number(i.getAttribute("index"))&&parseInt(i.getAttribute("aria-colindex"),10)-1==0)return e.cancel=!0,{value:void 0};(i.classList.contains("e-valuesheader")||i.classList.contains("e-stot"))&&(n=!0),s.parent.allowGrouping&&s.parent.groupingModule&&!s.validateField(i)&&(o=!0);var l=Number(i.getAttribute("index")),d=parseInt(i.getAttribute("aria-colindex"),10)-1,p=s.parent.pivotValues[l][d];switch(r.id){case s.parent.element.id+"_expand":i.querySelectorAll("."+Ue).length>0?((0,t.selectAll)("#"+s.parent.element.id+"_expand",e.element)&&(0,t.select)("#"+s.parent.element.id+"_expand",e.element).classList.add(yt),(0,t.select)("#"+s.parent.element.id+"_expand",e.element).classList.contains(yt)&&(0,t.select)("#"+s.parent.element.id+"_expand",e.element).classList.remove(yt),(0,t.select)("#"+s.parent.element.id+"_expand",e.element).classList.contains(bt)&&((0,t.select)("#"+s.parent.element.id+"_expand",e.element).classList.remove(bt),(0,t.select)("#"+s.parent.element.id+"_collapse",e.element).classList.remove(bt))):n?(0,t.select)("#"+s.parent.element.id+"_expand",e.element).classList.add(bt):(0,t.select)("#"+s.parent.element.id+"_expand",e.element).classList.add(yt);break;case s.parent.element.id+"_collapse":i.querySelectorAll("."+Ve).length>0?((0,t.select)("#"+s.parent.element.id+"_expand",e.element)&&(0,t.select)("#"+s.parent.element.id+"_expand",e.element).classList.add(yt),(0,t.select)("#"+s.parent.element.id+"_collapse",e.element).classList.contains(yt)&&(0,t.select)("#"+s.parent.element.id+"_collapse",e.element).classList.remove(yt),(0,t.select)("#"+s.parent.element.id+"_collapse",e.element).classList.contains(bt)&&((0,t.select)("#"+s.parent.element.id+"_collapse",e.element).classList.remove(bt),(0,t.select)("#"+s.parent.element.id+"_expand",e.element).classList.remove(bt))):n?(0,t.select)("#"+s.parent.element.id+"_collapse",e.element).classList.add(bt):(0,t.select)("#"+s.parent.element.id+"_collapse",e.element).classList.add(yt);break;case s.parent.element.id+"_custom_group":o||2!==e.items.length||(e.cancel=!0),(0,t.selectAll)("#"+s.parent.element.id+"_custom_group",e.element)&&(0,t.addClass)([(0,t.select)("#"+s.parent.element.id+"_custom_group",e.element)],bt),o&&(0,t.selectAll)("#"+s.parent.element.id+"_custom_group",e.element)&&(0,t.removeClass)([(0,t.select)("#"+s.parent.element.id+"_custom_group",e.element)],bt);break;case s.parent.element.id+"_custom_ungroup":if((0,t.selectAll)("#"+s.parent.element.id+"_custom_ungroup",e.element)&&(0,t.addClass)([(0,t.select)("#"+s.parent.element.id+"_custom_ungroup",e.element)],bt),o){var h=!1,u=i.getAttribute("fieldname"),c=Hs.getFieldByName(u,s.parent.dataSourceSettings.groupSettings);if(c&&"Custom"===c.type||s.parent.engineModule.fieldList[u].isCustomField&&u.indexOf("_custom_group")>-1){if(c=Hs.getFieldByName(u.replace("_custom_group",""),s.parent.dataSourceSettings.groupSettings)){var g=s.parent.engineModule.pivotValues[Number(i.getAttribute("index"))][parseInt(i.getAttribute("aria-colindex"),10)-1],m=s.parent.groupingModule.getSelectedCells(g.axis,u,g.actualText.toString());m.push({axis:g.axis,fieldName:u,name:g.actualText.toString(),cellInfo:g});for(var f=s.parent.groupingModule.getSelectedOptions(m),v=0,S=c.customGroups;v<S.length;v++){var y=S[v];if(f.indexOf(y.groupName)>-1){h=!0;break}}}}else(c&&("Date"===c.type||"Number"===c.type)||s.parent.engineModule.fieldList[u].isCustomField&&u.indexOf("_date_group")>-1)&&(h=!0);(0,t.selectAll)("#"+s.parent.element.id+"_custom_ungroup",e.element)&&h&&(0,t.removeClass)([(0,t.select)("#"+s.parent.element.id+"_custom_ungroup",e.element)],bt)}break;case s.parent.element.id+"_drillthrough":s.parent.allowDrillThrough?i.classList.contains("e-summary")?(0,t.select)("#"+s.parent.element.id+"_drillthrough",e.element).classList.contains(yt)&&(0,t.select)("#"+s.parent.element.id+"_drillthrough",e.element).classList.remove(yt):""===i.innerText&&(0,t.select)("#"+s.parent.element.id+"_drillthrough",e.element)&&(0,t.select)("#"+s.parent.element.id+"_drillthrough",e.element).classList.add(yt):(0,t.select)("#"+s.parent.element.id+"_drillthrough",e.element)&&(0,t.select)("#"+s.parent.element.id+"_drillthrough",e.element).classList.add(yt);break;case s.parent.element.id+"_sortasc":s.parent.enableValueSorting?i.querySelectorAll(".e-icon-descending").length>0?((0,t.select)("#"+s.parent.element.id+"_sortdesc",e.element)?(0,t.select)("#"+s.parent.element.id+"_sortdesc",e.element).classList.add(yt):(0,t.select)("#"+s.parent.element.id+"_sortdesc",e.element).classList.remove(yt),(0,t.select)("#"+s.parent.element.id+"_sortasc",e.element).classList.contains(yt)&&(0,t.select)("#"+s.parent.element.id+"_sortasc",e.element).classList.remove(yt)):(0,t.select)("#"+s.parent.element.id+"_sortdesc",e.element).classList.contains(yt)&&(0,t.select)("#"+s.parent.element.id+"_sortdesc",e.element).classList.remove(yt):(0,t.select)("#"+s.parent.element.id+"_sortasc",e.element)&&(0,t.select)("#"+s.parent.element.id+"_sortasc",e.element).classList.add(yt);break;case s.parent.element.id+"_sortdesc":s.parent.enableValueSorting?i.querySelectorAll(".e-icon-ascending").length>0?((0,t.select)("#"+s.parent.element.id+"_sortasc",e.element)?(0,t.select)("#"+s.parent.element.id+"_sortasc",e.element).classList.add(yt):(0,t.select)("#"+s.parent.element.id+"_sortasc",e.element).classList.remove(yt),(0,t.select)("#"+s.parent.element.id+"_sortdesc",e.element).classList.contains(yt)&&(0,t.select)("#"+s.parent.element.id+"_sortdesc",e.element).classList.remove(yt)):(0,t.select)("#"+s.parent.element.id+"_sortasc",e.element).classList.contains(yt)&&(0,t.select)("#"+s.parent.element.id+"_sortasc",e.element).classList.remove(yt):(0,t.select)("#"+s.parent.element.id+"_sortdesc",e.element)&&(0,t.select)("#"+s.parent.element.id+"_sortdesc",e.element).classList.add(yt);break;case s.parent.element.id+"_CalculatedField":s.parent.allowCalculatedField||(0,t.select)("#"+s.parent.element.id+"_CalculatedField",e.element).classList.add(yt);break;case s.parent.element.id+"_pdf":s.parent.allowPdfExport||(0,t.select)("#"+s.parent.element.id+"_pdf",e.element).classList.add(yt);break;case s.parent.element.id+"_excel":s.parent.allowExcelExport||(0,t.select)("#"+s.parent.element.id+"_excel",e.element).classList.add(yt);break;case s.parent.element.id+"_csv":s.parent.allowExcelExport||(0,t.select)("#"+s.parent.element.id+"_csv",e.element).classList.add(yt);break;case s.parent.element.id+"_exporting":s.parent.allowExcelExport||s.parent.allowPdfExport||(0,t.select)("#"+s.parent.element.id+"_exporting",e.element).classList.add(yt);break;case s.parent.element.id+"_aggregate":if((0,t.select)("#"+s.parent.element.id+"_aggregate",e.element)&&!(0,t.select)("#"+s.parent.element.id+"_aggregate",e.element).classList.contains(yt)&&(0,t.select)("#"+s.parent.element.id+"_aggregate",e.element).classList.add(yt),(i.classList.contains("e-valuesheader")||i.classList.contains("e-valuescontent")||i.classList.contains("e-stot")&&i.classList.contains("e-rowsheader"))&&"olap"!==s.parent.dataType){var b;""!==i.innerText&&(b=s.parent.engineModule.fieldList[p.actualText.toString()].type);var C={cancel:!1,fieldName:p.actualText.toString(),aggregateTypes:s.getMenuItem(b).slice(),displayMenuCount:7};s.parent.trigger(Wa,C,function(n){if(!n.cancel&&""!==i.innerText){for(var s=[],o=[],l=0;l<n.aggregateTypes.length;l++){var d=n.aggregateTypes[l];"number"!==b?["Count","DistinctCount"].indexOf(d)>-1&&o.indexOf(d)<0&&(s.push({text:a.parent.localeObj.getConstant(d),id:a.parent.element.id+"_Agg"+d}),o.push(d)):a.parent.getAllSummaryType().indexOf(d)>-1&&o.indexOf(d)<0&&(s.push({text:a.parent.localeObj.getConstant(d),id:a.parent.element.id+"_Agg"+d}),o.push(d))}s.length>n.displayMenuCount&&(s.splice(n.displayMenuCount),s.push({text:a.parent.localeObj.getConstant("MoreOption"),id:a.parent.element.id+"_AggMoreOption"})),s&&s.length>=1&&(r.items=s,(0,t.select)("#"+a.parent.element.id+"_aggregate",e.element).classList.remove(yt))}})}}},s=this,o=0,l=e.items;o<l.length;o++){var d=n(l[o]);if("object"==typeof d)return d.value}this.parent.trigger(Ga,e)},e.prototype.getMenuItem=function(e){for(var t=[],i=0;i<this.parent.aggregateTypes.length;i++){var a=this.parent.aggregateTypes[i];"string"!==e?this.parent.getAllSummaryType().indexOf(a)>-1&&-1===t.indexOf(a)&&t.push(a):["Count","DistinctCount"].indexOf(a)>-1&&-1===t.indexOf(a)&&t.push(a)}return t},e.prototype.contextMenuClick=function(e){var t,i=this,a=this.parent.lastCellClicked,r=e.item.id,n={};if(a){t=this.getCellElement(a);var s,o=Number(t.getAttribute("index")),l=parseInt(t.getAttribute("aria-colindex"),10)-1,d=this.parent.pivotValues[o][l];switch(e.item.id.indexOf(this.parent.element.id+"_Agg")>-1&&(this.field=this.parent.engineModule.fieldList[d.actualText.toString()].id,this.fieldCaption=this.parent.engineModule.fieldList[d.actualText.toString()].caption,s=e.item.id.split("_Agg")[1]),r){case this.parent.element.id+"_pdf":if(Hs.invokeActionMethod(this.parent,or,zr,{exportInfo:{type:"PDF"}}))return;n={pdfDoc:void 0,isBlob:!1,isMultipleExport:!1,pdfExportProperties:{fileName:"Export.pdf"}},this.parent.trigger(Ri,n,function(e){i.parent.pdfExport(e.pdfExportProperties,e.isMultipleExport,e.pdfDoc,e.isBlob),Hs.invokeActionMethod(i.parent,lr,Yn)});break;case this.parent.element.id+"_excel":if(Hs.invokeActionMethod(this.parent,or,Qr,{exportInfo:{type:"Excel"}}))return;n={isBlob:!1,isMultipleExport:!1,workbook:void 0,excelExportProperties:{fileName:"Export.xlsx"}},this.parent.trigger(Ri,n,function(e){i.parent.excelExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob),Hs.invokeActionMethod(i.parent,lr,Wn)});break;case this.parent.element.id+"_csv":if(Hs.invokeActionMethod(this.parent,or,Yr,{exportInfo:{type:"CSV"}}))return;n={isBlob:!1,workbook:void 0,isMultipleExport:!1,excelExportProperties:{fileName:"Export.csv"}},this.parent.trigger(Ri,n,function(e){i.parent.csvExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob),Hs.invokeActionMethod(i.parent,lr,Qn)});break;case this.parent.element.id+"_drillthrough_menu":var p=new MouseEvent("dblclick",{view:window,bubbles:!0,cancelable:!0});t.dispatchEvent(p);break;case this.parent.element.id+"_sortasc":case this.parent.element.id+"_sortdesc":var h=r.indexOf("_sortasc")>-1?"Ascending":"Descending";if(Hs.invokeActionMethod(this.parent,or,Dr,{sortInfo:{name:d.valueSort.levelName,order:h}}))return;this.parent.setProperties({dataSourceSettings:{valueSortSettings:{columnHeaderText:d.valueSort.levelName,headerDelimiter:this.parent.dataSourceSettings.valueSortSettings.headerDelimiter}}}),this.parent.dataSourceSettings.valueSortSettings.sortOrder=h,this.parent.actionCompleteMethod();break;case this.parent.element.id+"_expand":if(Hs.invokeActionMethod(this.parent,or,Nr))return;if(t.querySelectorAll("."+Ue)){var u=t.querySelectorAll("."+Ue)[0];this.parent.onDrill(u)}break;case this.parent.element.id+"_collapse":if(Hs.invokeActionMethod(this.parent,or,Or))return;if(t.querySelectorAll("."+Ve)){var c=t.querySelectorAll("."+Ve)[0];this.parent.onDrill(c)}break;case this.parent.element.id+"_CalculatedField":if(Hs.invokeActionMethod(this.parent,or,gn,{}))return;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":t.setAttribute("id",this.field),t.setAttribute("data-caption",this.fieldCaption),t.setAttribute("data-field",this.field),t.setAttribute("data-type",this.engine.fieldList[d.actualText.toString()].aggregateType),t.setAttribute("data-basefield",this.engine.fieldList[d.actualText.toString()].baseField),t.setAttribute("data-baseItem",this.engine.fieldList[d.actualText.toString()].baseItem),this.aggMenu.createValueSettingsDialog(t,this.parent.element,s);break;case this.parent.element.id+"_Agg"+s:if(Hs.invokeActionMethod(this.parent,or,bn))return;this.updateAggregate(s),Hs.invokeActionMethod(this.parent,lr,ms,{aggregateInfo:{aggregateType:s,fieldName:d.actualText.toString(),fieldCaption:this.fieldCaption}});break;case this.parent.element.id+"_custom_group":if(this.groupingActionType="group",Hs.invokeActionMethod(this.parent,or,Cn))return;this.triggerGroupingAction(t,r);break;case this.parent.element.id+"_custom_ungroup":if(this.groupingActionType="ungroup",Hs.invokeActionMethod(this.parent,or,xn))return;this.triggerGroupingAction(t,r)}this.isContextMenuOpened=!1,this.parent.actionObj.actionName===Ga&&Hs.invokeActionMethod(this.parent,lr,Ga),this.parent.trigger(_a,e)}},e.prototype.triggerGroupingAction=function(e,t){if(this.parent.groupingModule){var i={target:e,option:t,parentElement:this.parent.element,groupingActionType:this.groupingActionType};this.parent.notify(Mr,i)}},e.prototype.validateColumnTotalcell=function(e){for(var t=Object.keys(this.engine.headerContent),i=!1,a="",r=t.length-1;r>=0;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():"","sum"===n.type&&(i=!0),i&&n.members&&n.members.length>0)return!0}return!1},e.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{var i=e.getAttribute("fieldName");if(!i||""===i){var a=Number(e.getAttribute("index")),r=parseInt(e.getAttribute("aria-colindex"),10)-1;i=this.engine.pivotValues[a][r].actualText}for(var n=this.parent.dataSourceSettings.values,s=0;s<n.length;s++)if(this.parent.dataSourceSettings.values[s].name===i){t=!0;break}}return t},e.prototype.updateAggregate=function(e){if(this.parent.getAllSummaryType().indexOf(e)>-1)for(var t=this.parent.dataSourceSettings.values,i=0;i<this.parent.dataSourceSettings.values.length;i++){if(this.parent.dataSourceSettings.values[i].name===this.field)t[i].type=e}},e.prototype.injectGridModules=function(e){_s.Grid.Inject(_s.Freeze),e.allowExcelExport&&_s.Grid.Inject(_s.ExcelExport),e.allowPdfExport&&_s.Grid.Inject(_s.PdfExport),_s.Grid.Inject(_s.Selection,_s.Reorder,_s.Resize),this.gridSettings.contextMenuItems&&_s.Grid.Inject(_s.ContextMenu)},e.prototype.updateGridSettings=function(){if(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){var e=Object.keys(this.parent.lastGridSettings);e.indexOf("height")>-1&&(this.parent.grid.height=this.gridSettings.height),e.indexOf("width")>-1&&(this.parent.grid.width=this.gridSettings.width),this.updatePivotColumns(),(e.indexOf("allowTextWrap")>-1||e.indexOf("clipMode")>-1)&&this.parent.layoutRefresh()}this.clearColumnSelection()},e.prototype.updatePivotColumns=function(){for(var e=Object.keys(this.parent.lastGridSettings),i=0;i<this.parent.pivotColumns.length;i++)for(var a=this.parent.pivotColumns[i],r=0;r<e.length;r++){var n=e[r];(0,t.isNullOrUndefined)(this.parent.pivotColumns[i][n])||(a[n]=this.parent.lastGridSettings[n])}this.parent.fillGridColumns(this.parent.grid.columns)},e.prototype.clearColumnSelection=function(){(0,t.removeClass)(this.parent.element.querySelectorAll("."+_t),[_t,qt])},e.prototype.appendValueSortIcon=function(e,i,a,r,n){var s="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,o=this.parent.dataSourceSettings.valueSortSettings,l=o&&"pivot"===this.parent.dataType&&"Server"!==this.parent.dataSourceSettings.mode?o.columnHeaderText:o.headerText,d=o&&"pivot"===this.parent.dataType&&"Server"!==this.parent.dataSourceSettings.mode?o.columnSortOrder:o.sortOrder;if(this.parent.enableValueSorting&&o&&""!==l){var p="grand sum"!==e.type||1!==this.parent.dataSourceSettings.values.length||this.parent.dataSourceSettings.alwaysShowValueHeader?this.parent.dataSourceSettings.values.length>1||this.parent.dataSourceSettings.alwaysShowValueHeader?s.headerContent.length-1:0===this.parent.dataSourceSettings.columns.length?0:s.headerContent.length-1:0,h=o&&l?e.valueSort.levelName===l:r===o.columnIndex;if(void 0!==o&&h&&(a===p||a+1===p&&e.level>-1&&s.headerContent[a+1][r]&&-1===s.headerContent[a+1][r].level))i.querySelector(".e-pivotcell-container").appendChild((0,t.createElement)("span",{className:("Descending"===d?"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"===n.headerTextAlign?"float : left":""}))}return i},e.prototype.onResizeStop=function(e){if(e.column.columns&&e.column.columns.length>0)this.getChildColumnWidth(e.column.columns);else{var i=this.parent.isTabular?e.column.index<this.parent.engineModule.rowMaxLevel+1?e.column.index+".formattedText":""+e.column.customAttributes.cell.valueSort.levelName:"0.formattedText"===e.column.field?"0.formattedText":""+e.column.customAttributes.cell.valueSort.levelName;this.parent.enableVirtualization||(this.parent.resizeInfo[i]=Number(e.column.width.toString().split("px")[0]))}if(!this.parent.isTabular&&this.parent.enableVirtualization&&"0.formattedText"===e.column.field){if(this.parent.dataSourceSettings.values.length>1&&!(0,t.isNullOrUndefined)(this.parent.grid.columns[this.parent.grid.columns.length-1].columns)){var a=this.parent.grid.columns[this.parent.grid.columns.length-1].columns;a[a.length-1].minWidth=this.parent.gridSettings.columnWidth}else this.parent.grid.columns[this.parent.grid.columns.length-1].minWidth=this.parent.gridSettings.columnWidth;this.parent.layoutRefresh()}this.setGroupWidth(e),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.setValuePanelWidth(),this.calculateGridHeight(!0),this.parent.grid.hideScroll()},e.prototype.getChildColumnWidth=function(e){for(var t=0,i=e;t<i.length;t++){var a=i[t];if(a.columns&&a.columns.length>0)this.getChildColumnWidth(a.columns);else if(!this.parent.enableVirtualization){var r=a.customAttributes.cell.valueSort.levelName;this.parent.resizeInfo[r]=Number(a.width.toString().split("px")[0])}}},e.prototype.setGroupWidth=function(e){if(this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+pe)){this.parent.groupingBarModule.refreshUI();var i=this.parent.isTabular&&e.column.index<=this.parent.engineModule.rowMaxLevel?e.column.index:0;if(this.setFirstColumnWidth(i,e),this.parent.isTabular){e.column.index<=this.parent.engineModule.rowMaxLevel&&(this.parent.element.querySelectorAll(".e-group-rows")[i].style.width=this.parent.element.querySelectorAll(".e-group-row")[i].offsetWidth-6+"px");var a=0;if(this.parent.engineModule.rowMaxLevel>0)for(var r=0;r<this.parent.engineModule.rowMaxLevel+1;r++)(0,t.isNullOrUndefined)(this.parent.element.querySelectorAll(".e-group-row")[r])||(a+=this.parent.element.querySelectorAll(".e-group-row")[r].offsetWidth);else a=this.parent.element.querySelector(".e-group-row").offsetWidth;this.parent.element.querySelector(".e-group-values").style.width=a+"px"}else{this.parent.element.querySelector(".e-group-values").style.width=this.parent.element.querySelector(".e-group-row").offsetWidth+"px";a=this.parent.element.querySelector(".e-group-row").offsetWidth;this.parent.element.querySelector(".e-group-values").style.width=a+"px"}var n=this.parent.element.querySelector("."+Vt).offsetHeight;this.parent.element.querySelector(".e-group-rows").style.height=n+"px"}if(e.cancel){var s=this.parent.isTabular?e.column.index<this.parent.engineModule.rowMaxLevel+1?e.column.index+".formattedText":""+e.column.customAttributes.cell.valueSort.levelName:"0.formattedText"===e.column.field?"0.formattedText":""+e.column.customAttributes.cell.valueSort.levelName;this.parent.enableVirtualization||(this.parent.resizeInfo[s]=Number(e.column.width.toString().split("px")[0]))}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?Qi:Wi,e)},e.prototype.setFirstColumnWidth=function(e,t){if(this.parent.element.querySelectorAll(".e-group-row")[e].offsetWidth<95&&!this.parent.firstColWidth){t.cancel=!0;var i=this.parent.grid.columns;i&&i.length>0&&(i[e].width=100),this.parent.element.querySelector("."+Vt).querySelectorAll("col")[e].style.width="100px",this.parent.element.querySelector("."+R).querySelectorAll("col")[e].style.width="100px",this.setValuePanelWidth()}},e.prototype.setValuePanelWidth=function(){var e=this.parent.element.getElementsByClassName(ge+" "+le)[0];if(!(0,t.isNullOrUndefined)(e)){e.querySelectorAll(".e-pvt-btn-div").forEach(function(t){t.style.width=e.offsetWidth<250?"100%":"auto"});var i=this.parent.element.getElementsByClassName(me+" "+de)[0],a=this.parent.element.getElementsByClassName(ce+" "+oe)[0],r=e.offsetHeight/2;r>a.offsetHeight&&((0,t.setStyleAttribute)(i,{height:(0,t.formatUnit)(r)}),(0,t.setStyleAttribute)(a,{height:(0,t.formatUnit)(r+2)}))}},e.prototype.selected=function(){clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.onSelect.bind(this),300)},e.prototype.onSelect=function(){var e={selectedCellsInfo:[],pivotValues:this.parent.pivotValues,currentCell:null},t=this.parent.element.querySelectorAll("."+jt+",."+qt);this.selectedCells=[];for(var i=0;i<t.length;i++){var a=t[i],r=parseInt(a.getAttribute("aria-colindex"),10)-1,n=Number(a.getAttribute("index")),s=this.engine.pivotValues[n][r];this.selectedCells.push({colIndex:r,rowIndex:n}),s&&("value"===s.axis?e.selectedCellsInfo.push({currentCell:s,value:s.value,columnHeaders:s.columnHeaders,rowHeaders:s.rowHeaders,measure:s.actualText.toString()}):"column"===s.axis?e.selectedCellsInfo.push({currentCell:s,value:s.formattedText,columnHeaders:s.valueSort.levelName,rowHeaders:"",measure:""}):e.selectedCellsInfo.push({currentCell:s,value:s.formattedText,columnHeaders:"",rowHeaders:s.valueSort.levelName,measure:""}))}this.parent.trigger(ta,e)},e.prototype.rowCellBoundEvent=function(e){var i=e.cell,a=(0,t.createElement)("div",{className:"e-pivotrow-container"});if(i&&this.parent.notEmpty&&this.engine.headerContent){var r=this.parent.hyperlinkSettings.cssClass,n=e.column&&e.column.customAttributes&&e.column.customAttributes.cell?e.column.customAttributes.cell.colIndex:parseInt(i.getAttribute("aria-colindex"),10)-1,s=this.parent.isTabular?n.toString():"0",l=e.data[Number(s)],d=l.valueSort&&l.valueSort.levelName===(0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis&&this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+l.formattedText);i.setAttribute("index",l.rowIndex?l.rowIndex.toString():"0");var p=this.parent.pivotValues[l.rowIndex]&&this.parent.pivotValues[l.rowIndex][n]?this.parent.pivotValues[l.rowIndex][n]:null;if(n<=(this.parent.isTabular?this.parent.engineModule.rowMaxLevel:0)){if("pivot"===this.parent.dataType){var h=l.type&&"value"===l.type;i.innerText="";var u=l.valueSort?l.valueSort.levelName.toString():"",c=l.actualText?l.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,g=u.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(c?c-1:c),m=g?g-1:0;if("Bottom"===this.parent.dataSourceSettings.subTotalsPosition&&!(0,t.isNullOrUndefined)(u)){var f=l.isSum?"value"===l.type?u.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+(this.parent.engineModule.valueAxisFields[l.actualText].caption?this.parent.engineModule.valueAxisFields[l.actualText].caption:this.parent.engineModule.valueAxisFields[l.actualText].name))[0]:"":u;l.isSum&&("value"!==l.type||this.drilledLevelInfo[f])?m-=1:l.isSum||(1===f.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length&&(this.drilledLevelInfo={}),l.members&&l.members.length>0&&(this.drilledLevelInfo[f]=l.isDrilled))}if(!this.parent.isTabular){do{m>0&&a.appendChild((0,t.createElement)("span",{className:0===m?"":Ke})),m--}while(m>-1);m=g?g-1:0,this.lastSpan=g?this.lastSpan:0,!l.hasChild&&(h?0:m)>0&&a.appendChild((0,t.createElement)("span",{className:Xe}))}var v=void 0;if(this.parent.dataSourceSettings.rows.length>0&&(!l.valueSort||Object.keys(l.valueSort).length>0)){if(h)for(var S=0,y=this.parent.dataSourceSettings.values;S<y.length;S++){var b=y[S],C=b.caption?b.caption:b.name;if(u.indexOf(C)>-1){v=b.name;break}}else v=l.level>-1&&this.parent.dataSourceSettings.rows[l.level]?this.parent.dataSourceSettings.rows[l.level].name:"";i.setAttribute("fieldname",v)}}else a=this.onOlapRowCellBoundEvent(i,a,l);var x=l.formattedText;if(l.type)if("grand sum"===l.type){this.rowGrandPos=l.rowIndex,i.classList.add("e-gtot");var w=this.parent.dataSourceSettings.values;x=0===this.parent.dataSourceSettings.rows.length&&1===w.length&&"row"===this.parent.dataSourceSettings.valueAxis?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(w[w.length-1].type)+" "+this.parent.localeObj.getConstant("of")+" "+((0,t.isNullOrUndefined)(w[w.length-1].caption)?w[w.length-1].name:w[w.length-1].caption):this.parent.localeObj.getConstant("grandTotal")}else l.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+l.formattedText?(i.classList.add("e-gtot"),x=d?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[l.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+l.formattedText:x):"sum"===l.type&&3!==l.memberType?x=l.formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total"):i.classList.add("e-stot");if(this.parent.isTabular){var T=!0===l.hasChild&&!1===l.isDrilled,M="sum"===l.type||"grand sum"===l.type;!this.parent.gridSettings.repeatItemLabels||T||M?(this.setSpanAttributes("rowspan",l.rowSpan,i),this.setSpanAttributes("colspan",l.colSpan,i)):(this.setSpanAttributes("rowspan",1,i),this.setSpanAttributes("colspan",1,i))}else i.classList.add(Ge);var D=this.parent.isTabular&&0===l.rowSpan;!0!==l.hasChild||l.isNamedSet||D||a.appendChild((0,t.createElement)("div",{className:(!0===l.isDrilled?Ve:Ue)+" "+o,attrs:{title:!0===l.isDrilled?this.parent.localeObj.getConstant("collapse"):this.parent.localeObj.getConstant("expand")}})),a.appendChild((0,t.createElement)("span",{className:We})),e.column.disableHtmlEncode?this.parent.isRowCellHyperlink||l.enableHyperlink?a.querySelector("."+We).innerHTML='<a data-url="'+x+'" class="e-hyperlinkcell '+r+'">'+x+"</a>":a.querySelector("."+We).textContent=x:a.querySelector("."+We).innerHTML=this.parent.isRowCellHyperlink||l.enableHyperlink?'<a data-url="'+x+'" class="e-hyperlinkcell '+r+'">'+x+"</a>":x;var O=this.parent.pivotView.dataSourceSettings.valueSortSettings;if(this.parent.enableValueSorting){var N=O&&"pivot"===this.parent.dataType&&"Server"!==this.parent.dataSourceSettings.mode?O.rowHeaderText:O.headerText,P=O&&"pivot"===this.parent.dataType&&"Server"!==this.parent.dataSourceSettings.mode?O.rowSortOrder:O.sortOrder,E=Number(i.getAttribute("index")),I=Number(i.getAttribute("aria-colindex")),F=this.parent.pivotValues&&this.parent.pivotValues[Number(i.getAttribute("index"))]?this.parent.pivotValues[Number(i.getAttribute("index"))][I-1]:void 0;"pivot"!==this.parent.dataType||"Server"===this.parent.dataSourceSettings.mode||"row"!==this.parent.dataSourceSettings.valueAxis||-1!==this.parent.dataSourceSettings.valueIndex||this.parent.isTabular||F.valueSort.levelName!==N||"value"===F.type||("Bottom"!==this.parent.dataSourceSettings.subTotalsPosition?this.parent.pivotValues[E+1]&&"value"===this.parent.pivotValues[E+1][I-1].type&&(E="value"===F.type||3===F.memberType?E:E+1,this.modifiedHeaderText=this.parent.pivotValues[E][I-1].valueSort.levelName):"Bottom"===this.parent.dataSourceSettings.subTotalsPosition&&this.parent.dataSourceSettings.values.length>0&&((0,t.isNullOrUndefined)(O.measure)?this.modifiedHeaderText=N+O.headerDelimiter+this.parent.dataSourceSettings.values[0].name:(0,t.isNullOrUndefined)(O.measure)||(this.modifiedHeaderText=N+O.headerDelimiter+O.measure))),N="row"===this.parent.dataSourceSettings.valueAxis&&this.modifiedHeaderText?this.modifiedHeaderText:N;var L=!("pivot"===this.parent.dataType&&"Bottom"===this.parent.dataSourceSettings.subTotalsPosition&&this.parent.dataSourceSettings.rows.length>1&&F.hasChild);O&&N&&F&&F.valueSort&&F.valueSort.levelName&&(!this.parent.isTabular&&F.valueSort.levelName===N&&L||this.parent.isTabular&&F.valueSort.levelName===N&&1===F.rowSpan)&&(a.appendChild((0,t.createElement)("span",{className:("Descending"===P?"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")+(F.hasChild?" e-value-sort-align":""),styles:"right"===a.style.textAlign?"float: left":""})),this.modifiedHeaderText=void 0)}i.appendChild(a)}else{var A=i.innerText;i.innerText="",i.classList.add("e-valuescontent"),l=e.data[n],(l=(0,t.isNullOrUndefined)(l)?e.column.customAttributes.cell:l).isGrandSum=!!d||l.isGrandSum,l.isSum&&i.classList.add("e-summary");var R=(0,t.isNullOrUndefined)(l.isGrandSum)&&!(0,t.isNullOrUndefined)(this.parent.olapEngineModule)&&"column"===this.parent.olapEngineModule.olapValueAxis&&"olap"===this.parent.dataType&&this.colGrandPos-this.parent.dataSourceSettings.values.length<n;l.isGrandSum||R||this.colGrandPos===n||this.rowGrandPos===Number(i.getAttribute("index"))?i.classList.add("e-gtot"):("olap"===this.parent.dataType?l.isSum:this.validateColumnTotalcell(l.colIndex))&&i.classList.add("e-colstot"),p&&p.cssClass&&i.classList.add(p.cssClass),i.appendChild((0,t.createElement)("span",{className:We,innerHTML:-1!==i.className.indexOf("e-summary")&&this.parent.isSummaryCellHyperlink||-1===i.className.indexOf("e-summary")&&this.parent.isValueCellHyperlink&&p||l.enableHyperlink?'<a data-url="'+A+'" class="e-hyperlinkcell '+r+'">'+A+"</a>":A})),this.parent.gridSettings.allowReordering&&i.setAttribute("aria-colindex",e.column.customAttributes?(e.column.customAttributes.cell.colIndex+1).toString():e.column.index.toString())}this.parent.cellTemplate&&this.appendTemplate(i,p),this.unWireEvents(i),this.wireEvents(i)}e.pivotview=this.parent,this.parent.trigger(_i,e)},e.prototype.appendTemplate=function(e,i){var a=this.parent.getCellTemplate()({targetCell:e,cellInfo:i},this.parent,"cellTemplate",this.parent.element.id+"_cellTemplate",null,null,e);if(a&&""!==a&&a.length>0)if(this.parent.enableHtmlSanitizer)if(this.parent.isVue||this.parent.isVue3){var r=(0,t.createElement)("div");r.innerHTML=t.SanitizeHtmlHelper.sanitize(a),(0,t.append)([r.firstChild],e)}else this.parent.appendHtml(e,t.SanitizeHtmlHelper.sanitize(a[0].outerHTML));else this.parent.isVue||this.parent.isVue3?(0,t.append)(a,e):this.parent.appendHtml(e,a[0].outerHTML)},e.prototype.onOlapRowCellBoundEvent=function(e,i,a){e.innerText="";var r=this.engine.rowMeasurePos;if(this.parent.enableVirtualization){if(a.ordinal>-1&&this.parent.olapEngineModule.tupRowInfo.length>0){var n=this.parent.olapEngineModule.tupRowInfo[a.ordinal],s=3===a.memberType?this.engine.fieldList[a.actualText.toString()].tag.toString():a.actualText.toString(),o=n.uNameCollection.indexOf(s),l=(n.uNameCollection.substring(0,o)+(3===a.memberType?"":a.actualText.toString())).split("::[").map(function(e){return"["===e[0]?e:"["+e});3===a.memberType&&r&&l.push(a.actualText.toString());for(var d=-1,p=0,h=!1,u=0;u<l.length;u++){d+=l[u].split("~~").length;var c="2"!==n.typeCollection[u]&&(!!(this.engine.fieldList[n.members[u].getAttribute("Hierarchy")]&&this.engine.fieldList[n.members[u].getAttribute("Hierarchy")].isHierarchy&&u<this.parent.dataSourceSettings.rows.length-1&&!this.parent.dataSourceSettings.rows[u+1].isNamedSet&&this.parent.dataSourceSettings.rows[u+1].name.indexOf("[Measures]")<0&&this.engine.fieldList[this.parent.dataSourceSettings.rows[u+1].name]&&this.engine.fieldList[this.parent.dataSourceSettings.rows[u+1].name].hasAllMember)||Number(n.members[u].querySelector("CHILDREN_CARDINALITY").textContent)>0);p+=u>0&&h&&!c?1:0,h=c}for(var g=0,m=0;m<d;m++)i.appendChild((0,t.createElement)("span",{className:Ke})),g++;for(m=0;m<p&&d>0;m++)i.appendChild((0,t.createElement)("span",{className:Xe}));this.indentCollection[a.rowIndex]=g,this.maxIndent=this.maxIndent>g?this.maxIndent:g}}else{var f=a.hierarchy,v=a.valueSort?a.valueSort.levelName.toString():"",S=-1===a.level?this.measurePos:v.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-1,y=3===a.memberType?S+"."+a.levelUniqueName:a.levelUniqueName,b=(c=a.hasChild,!1);if(a.isSum&&3===a.memberType){for(var C=this.lvlCollection[a.parentUniqueName].position,x=C+1;x<this.position;x++)delete this.lvlCollection[this.lvlPosCollection[x]],delete this.lvlPosCollection[x];this.position=this.position>C+1?C+1:this.position,b=!0,this.measurePos=this.lvlCollection[a.parentUniqueName].position}if(!this.lvlCollection[y]&&y)this.lvlPosCollection[this.position]=y,this.lvlCollection[y]={position:this.position,hasChild:c},this.position++;else if(y){for(var w=this.lvlCollection[y].position,T=w+1;T<this.position;T++)delete this.lvlCollection[this.lvlPosCollection[T]],delete this.lvlPosCollection[T];this.position=this.position>w+1?w+1:this.position}if(!this.hierarchyCollection[f]&&f)this.hierarchyPosCollection[this.hierarchyCount]=f,this.hierarchyCollection[f]={lvlPosition:this.position-1,hierarchyPOs:this.hierarchyCount},this.hierarchyCount++;else if(f){var M=this.hierarchyCollection[f].hierarchyPOs;for(T=M+1;T<this.hierarchyCount;T++)delete this.hierarchyCollection[this.hierarchyPosCollection[T]],delete this.hierarchyPosCollection[T];this.hierarchyCount=this.hierarchyCount>M+1?M+1:this.hierarchyCount}if(3!==a.memberType&&y&&this.lvlCollection[y]){var D=this.hierarchyCollection[f]?this.hierarchyCollection[f].hierarchyPOs:-1;this.measurePos=r<=D&&this.hierarchyPosCollection[r+1]?this.measurePos:this.lvlCollection[y].position}var O=this.lvlCollection[y]?this.lvlCollection[y].position:-1;O=b?O-1:O;var N=0;for(g=0;N<=O&&O>0&&a.level>-1;){var P=this.lvlCollection[this.lvlPosCollection[N]].hasChild;(h=N>0&&this.lvlCollection[this.lvlPosCollection[N-1]].hasChild)&&!P&&i.appendChild((0,t.createElement)("span",{className:Xe})),N!==O&&(i.appendChild((0,t.createElement)("span",{className:Ke})),g++),N++}"Top"!==this.parent.dataSourceSettings.grandTotalsPosition||(0,t.isNullOrUndefined)(this.parent.olapEngineModule)||"row"!==this.parent.olapEngineModule.olapValueAxis||"olap"!==this.parent.dataType||0!==a.valueSort.levelName.toString().indexOf(this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter)||i.appendChild((0,t.createElement)("span",{className:Ke})),3===a.memberType&&-1===a.level&&Object.keys(this.lvlCollection).length>1&&(i.appendChild((0,t.createElement)("span",{className:Ke})),g++),this.indentCollection[a.rowIndex]=g,this.maxIndent=this.maxIndent>g?this.maxIndent:g}return i.setAttribute("fieldname",a.hierarchy),e.setAttribute("fieldname",a.hierarchy),!!this.parent.olapEngineModule.tupRowInfo[a.ordinal]&&(0===this.parent.olapEngineModule.tupRowInfo[a.ordinal].measurePosition?1===this.parent.olapEngineModule.tupRowInfo[a.ordinal].allStartPos:0===this.parent.olapEngineModule.tupRowInfo[a.ordinal].allStartPos)&&e.classList.add("e-gtot"),i},e.prototype.columnCellBoundEvent=function(e){if(e.cell.column&&e.cell.column.customAttributes){var i=e.cell.column.customAttributes.cell,a=e.node;if(i){for(var r=this.parent.hyperlinkSettings.cssClass,n=!1,s=0,l=this.parent.dataSourceSettings.values;s<l.length;s++){var d=l[s];d.name===i.actualText&&(n=!0,a.setAttribute("fieldname",d.name))}-1===i.level&&!i.rowSpan||-1===i.rowSpan?e.node.style.display="none":i.rowSpan>1&&(e.node.setAttribute("rowspan",i.rowSpan.toString()),e.node.setAttribute("aria-rowspan",i.rowSpan.toString()),i.rowIndex+i.rowSpan===this.engine.headerContent.length&&(e.node.style.borderBottomWidth="0px")),e.node.setAttribute("aria-colindex",(i.colIndex+1).toString()),e.node.setAttribute("index",i.rowIndex.toString());var p=void 0;"pivot"===this.parent.dataType?(!n&&!(this.parent.dataSourceSettings.values&&"column"===this.parent.dataSourceSettings.valueAxis&&this.parent.dataSourceSettings.values.length>1&&n&&i.rowIndex===this.engine.headerContent.length-1)&&this.parent.dataSourceSettings.columns&&this.parent.dataSourceSettings.columns.length>0&&(p=i.level>-1&&this.parent.dataSourceSettings.columns[i.level]?this.parent.dataSourceSettings.columns[i.level].name:"",a.setAttribute("fieldname",p)),this.validateColumnTotalcell(i.colIndex)&&a.classList.add("e-colstot")):a=this.onOlapColumnCellBoundEvent(a,i);var h=0===this.parent.dataSourceSettings.columns.length&&"column"===this.parent.dataSourceSettings.valueAxis&&i.valueSort&&i.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+i.formattedText;if(i.type||h){a.classList.add("grand sum"===i.type?"e-gtot":"e-stot"),"grand sum"===i.type?this.colGrandPos=i.colIndex:i.type&&a.classList.add("e-colstot");var u="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,c="grand sum"===i.type?(0,t.isNullOrUndefined)(i.valueSort.axis)||"olap"===this.parent.dataType?this.parent.localeObj.getConstant("grandTotal"):i.formattedText:i.formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total");c=h&&u.fieldList&&u.fieldList[i.actualText]?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(u.fieldList[i.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+i.formattedText:c,null!==a.querySelector(".e-headertext")?a.querySelector(".e-headertext").innerText=c:a.querySelector(".e-stackedheadercelldiv").innerText=c}if(a.classList.add(_e),this.parent.isColumnCellHyperlink||i.enableHyperlink)if(a.querySelector(".e-stackedheadercelldiv")){var g=a.querySelector(".e-stackedheadercelldiv").innerText;a.querySelector(".e-stackedheadercelldiv").innerHTML='<a data-url="'+g+'" class="e-hyperlinkcell '+r+'">'+g+"</a>"}else if(a.querySelector(".e-headertext")){g=a.querySelector(".e-headertext").innerText;a.querySelector(".e-headertext").innerHTML='<a data-url="'+g+'" class="e-hyperlinkcell '+r+'">'+g+"</a>"}if(!0!==i.hasChild||i.isNamedSet)this.updateWrapper(a);else{var m=a.querySelector(".e-headercelldiv");m&&(m.style.height="auto",m.style.lineHeight="normal");var f=(0,t.createElement)("div",{className:(!0===i.isDrilled?Ve:Ue)+" "+o,attrs:{title:!0===i.isDrilled?this.parent.localeObj.getConstant("collapse"):this.parent.localeObj.getConstant("expand")}});window.navigator.userAgent.indexOf("Edge")>-1||window.navigator.userAgent.indexOf("Trident")>-1?a.children[0].style.display="table":a.children[0].style.display="block",this.updateWrapper(a,f)}a=this.appendValueSortIcon(i,a,i.rowIndex,i.colIndex,e.cell.column),this.parent.cellTemplate&&this.appendTemplate(a,i);for(var v=this.parent.dataSourceSettings.values.length,S=0;S<v;S++)if(this.parent.dataSourceSettings.values[S].name===i.actualText){if("olap"===this.parent.dataType)!!this.parent.olapEngineModule.tupColumnInfo[i.ordinal]&&(0===this.parent.olapEngineModule.tupColumnInfo[i.ordinal].measurePosition?1===this.parent.olapEngineModule.tupColumnInfo[i.ordinal].allStartPos:0===this.parent.olapEngineModule.tupColumnInfo[i.ordinal].allStartPos)&&a.classList.add("e-gtot");i.valueSort.levelName===this.parent.localeObj.getConstant("grandTotal")+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+i.formattedText||i.valueSort.levelName==="Grand Total"+this.parent.dataSourceSettings.valueSortSettings.headerDelimiter+i.formattedText?a.classList.add("e-gtot"):a.classList.add("e-valuesheader")}this.unWireEvents(a),this.wireEvents(a)}}else if(this.parent.isTabular){var y=e.cell&&e.cell.column&&e.cell.column.index;0!==y&&this.parent.engineModule.rowMaxLevel>=y&&(e.node.querySelector(".e-headercelldiv").style.display="none")}this.parent.trigger(Gi,e)},e.prototype.updateWrapper=function(e,i){if(e.querySelectorAll(".e-headercelldiv").length>0||e.querySelectorAll(".e-stackedheadercelldiv").length>0){var a=(0,t.createElement)("div",{className:"e-pivotcell-container"}),r=(0,t.createElement)("div",{className:(i?"e-stackedheadertext":"e-headertext")+" "+We,innerHTML:e.querySelectorAll(".e-headercelldiv").length>0?e.querySelector(".e-headercelldiv").innerHTML:e.querySelector(".e-stackedheadercelldiv").innerHTML});i&&a.append(i),a.append(r);var n=e.querySelector(".e-headercelldiv, .e-stackedheadercelldiv");(0,t.isNullOrUndefined)(n)?(e.children[0].innerHTML="",e.children[0].append(a)):(n.innerHTML="",n.append(a))}return e},e.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&&i.colSpan>1&&(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},e.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);)r.rowSpan>0&&(i=r.rowSpan,a=r.rowIndex),r=this.engine.headerContent[r.rowIndex-1]?this.engine.headerContent[r.rowIndex-1][t.colIndex]:void 0;return a+i>=e},e.prototype.onHyperCellClick=function(e){var i=e.target.closest("td.e-rowcell")?e.target.closest("td.e-rowcell"):e.target.closest("th"),a={currentCell:i,data:this.engine.pivotValues[Number(i.getAttribute("index"))][parseInt(i.getAttribute("aria-colindex"),10)-1],cancel:!0,nativeEvent:e};this.parent.trigger(zi,a,function(e){if(!e.cancel){a.currentCell=(0,t.getElement)(a.currentCell);var i=a.currentCell.getAttribute("data-url")?a.currentCell.getAttribute("data-url"):a.currentCell.querySelector("a").getAttribute("data-url");window.open(i)}})},e.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},e.prototype.frameDataSource=function(e){var t=[];if(("pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&this.parent.engineModule.data.length>0||"olap"===this.parent.dataType&&""!==this.parent.dataSourceSettings.url||"Server"===this.parent.dataSourceSettings.mode&&""!==this.parent.dataSourceSettings.url&&this.engine.pivotValues.length>0)&&this.parent.dataSourceSettings.values.length>0&&!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},e.prototype.frameEmptyData=function(){return[{0:{formattedText:this.parent.localeObj.getConstant("grandTotal")},1:{formattedText:this.parent.localeObj.getConstant("emptyData")}}]},e.prototype.calculateColWidth=function(e){(0,t.isNullOrUndefined)(this.parent.resizedValue)||(this.parent.resizedValue=this.parent.showGroupingBar&&this.parent.resizedValue<100?100:this.parent.resizedValue),this.resColWidth=(0,t.isNullOrUndefined)(this.parent.resizedValue)?this.resColWidth:this.parent.resizedValue;var i=this.calculateGridWidth(),a=this.parent.element.getBoundingClientRect().width?this.parent.element.getBoundingClientRect().width:this.parent.element.offsetWidth,r=isNaN(this.parent.width)?this.parent.width.toString().indexOf("%")>-1?parseFloat(this.parent.width.toString())/100*a:i:Number(this.parent.width);if(r-=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<r),!this.isOverflows){var n=this.calculateGridHeight(),s="auto"===n?this.parent.getHeightAsNumber():n,o=this.engine&&this.engine.headerContent?Object.keys(this.engine.headerContent).length:1,l=s-this.gridSettings.rowHeight*o,d=0;this.engine&&(this.engine.valueContent&&this.engine.valueContent.length>0?d=this.engine.valueContent.length:this.engine.rowCount&&this.engine.rowCount>0&&(d=this.engine.rowCount)),d>0&&this.gridSettings.rowHeight*d>l&&(r-=(0,_s.getScrollBarWidth)())}var p=e*this.gridSettings.columnWidth<r?r/e:this.gridSettings.columnWidth;return this.isOverflows||this.gridSettings.allowAutoResizing?p:this.gridSettings.columnWidth},e.prototype.resizeColWidth=function(e){(0,t.isNullOrUndefined)(this.parent.resizedValue)||(this.parent.resizedValue=this.parent.showGroupingBar&&this.parent.resizedValue<100?100:this.parent.resizedValue),this.resColWidth=(0,t.isNullOrUndefined)(this.parent.resizedValue)?this.resColWidth:this.parent.resizedValue;var i=isNaN(this.parent.width)?this.parent.width.toString().indexOf("%")>-1?parseFloat(this.parent.width.toString())/100*this.parent.element.offsetWidth:this.parent.element.offsetWidth:Number(this.parent.width);e-=1,i-=this.gridSettings.columnWidth>this.resColWidth?this.gridSettings.columnWidth:this.resColWidth,this.isOverflows=!(e*this.gridSettings.columnWidth<i);var a=e*this.gridSettings.columnWidth<i?i/e:this.gridSettings.columnWidth;return this.isOverflows||this.gridSettings.allowAutoResizing?a:this.gridSettings.columnWidth},e.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:this.parent.width.toString().indexOf("%")>-1?e=parseFloat(this.parent.width.toString())/100*t:this.parent.width.toString().indexOf("px")>-1&&(e=this.parent.width.toString().split("px")[0]):e=this.gridSettings.width,!this.gridSettings.allowAutoResizing&&e>this.parent.totColWidth?this.parent.totColWidth:e},e.prototype.calculateGridHeight=function(e){var t=this.parent.element.querySelector("."+ft+" ."+R),i=this.parent.height,a=this.parent.getHeightAsNumber();if(t&&(a=isNaN(a)?a>this.parent.minHeight?a:this.parent.minHeight:t.offsetWidth<t.querySelector("."+Be).offsetWidth?a-(0,_s.getScrollBarWidth)():a,this.parent.showToolbar&&"Chart"!==this.parent.currentView||!this.parent.showToolbar&&"Chart"!==this.parent.displayOption.view))if("auto"===this.gridSettings.height&&a&&this.parent.element.querySelector("."+Wt))if(i=(i=a-(this.parent.element.querySelector("."+Wt).offsetHeight+(this.parent.element.querySelector("."+hi)?this.parent.element.querySelector("."+hi).offsetHeight:0)+(this.parent.element.querySelector("."+Zt)?42:0)+(this.parent.element.querySelector("."+fi)?this.parent.element.querySelector("."+fi).offsetHeight:0))-1)<40?40:i,e){var r=t.querySelector("."+Be).offsetHeight,n=t.querySelector("."+Be).offsetHeight,s=t.querySelector("."+Be).offsetWidth,o=t.offsetWidth<=s,l=!!(o&&i-r<15);this.parent.grid.height=i>=r&&(!o||i>=n)&&!l?"auto":i,this.parent.grid.dataBind()}else i>this.engine.valueContent.length*this.gridSettings.rowHeight&&(i="auto");else i=this.gridSettings.height;return i<this.parent.gridSettings.rowHeight?this.parent.gridSettings.rowHeight:i},e.prototype.frameStackedHeaders=function(){var e=this.parent.pivotColumns,i="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,a=this.parent.grid.columnModel,r=!1,n=!(!this.parent.toolbarModule||!this.parent.toolbarModule.isReportChange)||!!this.parent.actionObj&&("Sort value"===this.parent.actionObj.actionName&&1===i.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||this.parent.dataSourceSettings.values.length>0&&this.parent.dataSourceSettings.dataSource&&this.parent.engineModule.data.length>0||"Server"===this.parent.dataSourceSettings.mode&&this.parent.dataSourceSettings.values.length>0&&""!==this.parent.dataSourceSettings.url&&this.engine.pivotValues.length>0)&&!this.engine.isEmptyData){var s=this.engine.headerContent.length,o=[],l=[],d=this.calculateColWidth(this.engine.pivotValues&&this.engine.pivotValues[0]?this.engine.pivotValues[0].length:0),p="olap"===this.parent.dataType&&!(0,t.isNullOrUndefined)(this.engine.colMeasurePos)&&this.engine.colDepth-1===this.parent.olapEngineModule.colMeasurePos;do{var h=[],u=0;s--;var c=this.engine.headerContent[s],g=c?Object.keys(c).length:0;if(c&&g>0)for(var m=this.parent.isTabular?this.parent.engineModule.rowMaxLevel+1:c[0]?0:1,f=0,v=Object.keys(c).length+m;f<v;f++){var S=c[f]&&c[f].colSpan?3!==c[f].memberType||3===c[f].memberType&&!p||0===s?c[f].colSpan:o[f]:1;S="olap"===this.parent.dataType&&(0,t.isNullOrUndefined)(S)?1:S;var y=c[f]?"grand sum"===c[f].type?(0,t.isNullOrUndefined)(c[f].valueSort.axis)?this.parent.localeObj.getConstant("grandTotal"):c[f].formattedText:"sum"===c[f].type?c[f].formattedText.split("Total")[0]+this.parent.localeObj.getConstant("total"):c[f].formattedText:"";if(y=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(y):y,s===this.engine.headerContent.length-1)S=1,r=e.length-1===g&&(!n&&!this.parent.isEmptyGrid&&e[u]&&e[u].autoFit),h[u]={field:f+".formattedText",headerText:y,customAttributes:{cell:this.cloneDataWithoutIndex(c[f])},width:r&&a[u]?a[u].width:c[f]&&c[f].valueSort?this.setSavedWidth(c[f].valueSort.levelName,d):this.resColWidth,minWidth:r&&u===g?a[a.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"},f===g&&(h[u].width=h[u].width-3,this.lastColumn=h[u]);else if(o[f]){for(var b=S,C=[],x=f;b>0;){if(h[u]){if(!this.pivotColumns[l[x]])break;C.push(this.pivotColumns[l[x]])}else{if(h[u]={headerText:y,field:c[f]?c[f].valueSort.levelName:"",customAttributes:{cell:this.cloneDataWithoutIndex(c[f])},width:r&&0===u&&!n&&!this.parent.isEmptyGrid&&e[0].autoFit?a[0].width:c[f]?this.setSavedWidth(c[f].valueSort.levelName,d):this.resColWidth,minWidth:30,allowReordering:this.parent.gridSettings.allowReordering,allowResizing:this.parent.gridSettings.allowResizing,visible:!0,headerTextAlign:this.parent.enableRtl?"Right":"Left"},!this.pivotColumns[l[x]])break;C=[this.pivotColumns[l[x]]]}this.isAutoFitEnabled=!!this.isAutoFitEnabled||r,b-=o[x],x+=o[x]}h[u].columns=C}h[u]&&(h[u].clipMode=this.gridSettings.clipMode),o[f]=S,l[f]=u,u++,f=f+S-1}this.pivotColumns=h.length>0?h:this.pivotColumns}while(s>0);if(this.parent.isTabular)for(var w=0;w<this.parent.engineModule.rowMaxLevel+1;w++){var T=this.parent.element.querySelectorAll("."+Di);if(!this.parent.showGroupingBar||this.parent.isAdaptive||(0,t.isNullOrUndefined)(T[w]))for(var M=0;M<this.parent.engineModule.rowMaxLevel+1;M++)this.updatePivotColumn(this.pivotColumns,M,r,n,a);else{var D=T[w].querySelectorAll(".e-pvt-btn-div"),O=0;if(this.parent.engineModule.rowMaxLevel!==D.length-1&&0!==this.parent.engineModule.rowMaxLevel&&w===this.parent.engineModule.rowMaxLevel)O=this.getTotalColumnWidth(D);else if(0===this.parent.engineModule.rowMaxLevel)O=this.parent.resizedValue?this.parent.resizedValue:250;else if(.8*this.parent.element.getBoundingClientRect().width<=this.getTotalColumnWidth(D))O=this.gridSettings.columnWidth;else O=this.parent.resizedValue?this.parent.resizedValue:150;this.pivotColumns[w]={field:w+".formattedText",width:O>this.gridSettings.columnWidth?O:this.resColWidth,minWidth:30,headerText:"",allowReordering:!1,allowResizing:this.parent.gridSettings.allowResizing,visible:!0,clipMode:this.parent.gridSettings.clipMode}}}else this.updatePivotColumn(this.pivotColumns,0,r,n,a)}else this.resColWidth=this.parent.showGroupingBar&&this.parent.groupingBarModule?this.parent.isAdaptive?180:250:this.parent.isAdaptive?140:200,this.pivotColumns=this.frameEmptyColumns();return this.parent.toolbarModule&&this.parent.showToolbar&&(this.parent.toolbarModule.isReportChange=!1),this.parent.triggerColumnRenderEvent(this.pivotColumns),r=this.parent.pivotColumns.length>0&&this.parent.pivotColumns[this.parent.pivotColumns.length-1].autoFit,this.pivotColumns},e.prototype.setSavedWidth=function(e,t){if(this.parent.isTabular&&this.parent.element.querySelector("."+Oi)&&this.parent.element.querySelector("."+Oi).querySelector(".e-rowcell")&&this.parent.showGroupingBar&&"0.formattedText"===e&&0===this.parent.dataSourceSettings.values.length){var i=0,a=this.parent.element.querySelector("."+Di).querySelectorAll(".e-pvt-btn-div");if(a.length>1){for(var r=0;r<a.length;r++)i+=a[r].getBoundingClientRect().width+6;t=i}}return t=this.parent.resizeInfo[e]?this.parent.resizeInfo[e]:t},e.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},e.prototype.getFormatList=function(){for(var e={},i=0;i<this.parent.dataSourceSettings.values.length;i++){var a=this.parent.dataSourceSettings.values[i],r="N";if("olap"===this.parent.dataType){if(this.parent.olapEngineModule.fieldList[a.name]&&!(0,t.isNullOrUndefined)(this.parent.olapEngineModule.fieldList[a.name].formatString)){var n=this.parent.olapEngineModule.formatFields[a.name]?this.parent.olapEngineModule.formatFields[a.name].format:this.parent.olapEngineModule.fieldList[a.name].formatString;r=(n="Standard"===n?"Number":n).indexOf("#")>-1||null!==n.match(/\d/)?n:n[0]+"2"}}else{var s=["PercentageOfDifferenceFrom","PercentageOfRowTotal","PercentageOfColumnTotal","PercentageOfGrandTotal","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal","PercentageOfRunningTotals"];if(s.indexOf(a.type)>-1?r="P"+this.engine.getPercentFormat(this.engine.formatFields,a.name):["PopulationStDev","SampleStDev","PopulationVar","SampleVar","Index"].indexOf(a.type)>-1&&(r=void 0),this.parent.dataSourceSettings.formatSettings.length>0)for(var o=0;o<this.parent.dataSourceSettings.formatSettings.length;o++){var l=this.parent.dataSourceSettings.formatSettings[o];if(a.name===l.name){-1===s.indexOf(a.type)&&(r=l.format);break}}}e[a.name]=r}return e},e.prototype.getValidHeader=function(e,i){var a,r=this.parent.dataSourceSettings.values;if("row"===i){var n=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+n.value===n.data[0].valueSort.levelName)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[n.value.toString()].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+n.value.toString();if(1===r.length&&0===this.parent.dataSourceSettings.rows.length)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(r[r.length-1].type)+" "+this.parent.localeObj.getConstant("of")+" "+((0,t.isNullOrUndefined)(r[r.length-1].caption)?r[r.length-1].name:r[r.length-1].caption)}a=n.value}else if("column"===i){n=e;if((0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length)&&!(0,t.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+n.gridCell.column.customAttributes.cell.formattedText===n.gridCell.column.customAttributes.cell.valueSort.levelName)return this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(this.parent.engineModule.fieldList[n.gridCell.column.customAttributes.cell.actualText].aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+n.gridCell.column.customAttributes.cell.formattedText;a=n.cell.value}return a},e.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(ji,e)},e.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),0===e.gridCell.column.index&&(e.cell.colSpan=this.parent.isTabular?this.parent.engineModule.rowMaxLevel+1:1),this.parent.trigger(qi,e)},e.prototype.excelRowEvent=function(e){var i,a=this.parent.isTabular?this.parent.engineModule.rowMaxLevel:0,r=e.column?e.column.index:void 0;if(r>=0&&r<=a){var n=e.data[r],s=n.type&&"value"===n.type,o=0;if("olap"===this.parent.dataType)o=this.indentCollection[n.rowIndex];else{var l=n.valueSort?n.valueSort.levelName.toString():"",d=n.actualText?n.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,p=l.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(d?d-1:d);o=p?p-1:0}if(this.colPos=0,e.style={hAlign:"Left",indent:2*o},this.lastSpan=s?this.lastSpan:o,(0===e.data[r].rowSpan||0===e.data[r].colSpan)&&"CSV"===this.parent.exportType&&this.parent.isTabular){var h=e.data[r],u="sum"===h.type||"grand sum"===h.type;this.parent.gridSettings.repeatItemLabels&&!u||(e.value="")}}else if(this.colPos++,i=e.data[e.column.customAttributes.cell?e.column.customAttributes.cell.colIndex:this.colPos],(0,t.isNullOrUndefined)(i.value)||(0,t.isNullOrUndefined)(i.formattedText)||""===i.formattedText)e.value="Excel"===this.parent.exportType?null:"";else{var c="pivot"===this.parent.dataType&&this.parent.engineModule?this.parent.engineModule.aggregatedValueMatrix:void 0;c&&c[i.rowIndex]&&c[i.rowIndex][i.colIndex]?e.value=c[i.rowIndex][i.colIndex]:e.value=(0,t.isNullOrUndefined)(i.value)||"#DIV/0!"===i.formattedText?i.formattedText:i.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(Hi,e),i&&!(0,t.isNullOrUndefined)(e.value)&&""!==e.value&&(e.style&&this.formatList[i.actualText]?(e.style.type="number",e.style.numberFormat=e.style.numberFormat?e.style.numberFormat:this.formatList[i.actualText]):this.formatList[i.actualText]&&(e.style={numberFormat:this.formatList[i.actualText]}),e.column.format=this.formatList[i.actualText])},e.prototype.pdfRowEvent=function(e){if("0.formattedText"===(e=this.exportContentEvent(e)).column.field){var t=0,i=e.data[0],a=i.type&&"value"===i.type;if("olap"===this.parent.dataType)t=this.indentCollection[i.rowIndex];else{var r=i.valueSort?i.valueSort.levelName.toString():"",n=i.actualText?i.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,s=r.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(n?n-1:n);t=s?s-1:0}e.style={paragraphIndent:10*t},this.lastSpan=a?this.lastSpan:t,0===this.parent.dataSourceSettings.rows.length&&"row"===this.parent.dataSourceSettings.valueAxis&&(e.value=this.getValidHeader(e,"row"))}this.parent.trigger(Vi,e)},e.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}},e.prototype.exportHeaderEvent=function(e,i){var a=1;if(e.gridCell.column.customAttributes){var r=e.gridCell.column.customAttributes.cell;a=r.rowSpan>0?r.rowSpan:1,"XLSX"===i&&(r.rowSpan>0?a=r.rowSpan:(0,t.isNullOrUndefined)(r.type)||0===r.level||(a=1,e.cell.rowSpan=1)),this.actualText=r.actualText}else a=Object.keys(this.engine.headerContent).length;return e.cell.rowSpan!==a&&a>0&&(e.cell.rowSpan=a),e},e.prototype.frameGridDataSource=function(e){for(var t=[],i=0;i<e.length;i++){var a=0;t[i]={};for(var r=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},e.prototype.cloneDataWithoutIndex=function(e){if(!(0,t.isNullOrUndefined)(e)){for(var i=Object.keys(e),a=0,r={};a<i.length;)"indexObject"!==i[a]&&"index"!==i[a]&&(r[i[a]]=e[i[a]]),a++;return r}return e},e.prototype.exportContentEvent=function(e){var i=e.data[Number(e.column.field.split(".formattedText")[0])];return i.rowSpan>0&&"row"===i.axis&&(e.cell.rowSpan=i.rowSpan),i.colSpan>0&&"row"===i.axis&&(e.colSpan=i.colSpan),this.parent.isTabular||(e.value="grand sum"===i.type?(0,t.isNullOrUndefined)(i.valueSort.axis)?this.parent.localeObj.getConstant("grandTotal"):i.formattedText:e.value),e},e.prototype.unWireEvents=function(e){e&&e.querySelector(".e-hyperlinkcell")&&t.EventHandler.remove(e.querySelector(".e-hyperlinkcell"),this.parent.isAdaptive?"touchend":"click",this.onHyperCellClick)},e.prototype.wireEvents=function(e){e.querySelector(".e-hyperlinkcell")&&t.EventHandler.add(e.querySelector(".e-hyperlinkcell"),this.parent.isAdaptive?"touchend":"click",this.onHyperCellClick,this)},e.prototype.setSpanAttributes=function(e,t,i){i.setAttribute(e,t?t.toString():"1"),i.classList.add(Ge,"e-freezeleftborder","e-tabular-layout-header"),0===t&&i.classList.add(l)},e.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.gridSettings.allowResizing,visible:!0,clipMode:this.parent.gridSettings.clipMode}},e.prototype.getTotalColumnWidth=function(e){for(var t=0,i=0;i<e.length;i++){t+=this.parent.resizedValue?this.parent.resizedValue:150}return t},e.prototype.destroy=function(){this.timeOutObj&&(clearTimeout(this.timeOutObj),this.timeOutObj=void 0),this.removeAllHyperlinkEventHandlers(),this.aggMenu&&(this.aggMenu.destroy(),this.aggMenu=void 0),this.engine=null,this.gridSettings=null,this.formatList=null,this.lastColumn=null,this.pivotColumns=[],this.indentCollection={},this.lvlCollection={},this.hierarchyCollection={},this.lvlPosCollection={},this.hierarchyPosCollection={},this.drilledLevelInfo={},this.aggMenu=null,this.selectedCells=[]},e.prototype.removeAllHyperlinkEventHandlers=function(){if(this.parent&&this.parent.element)for(var e=this.parent.element.querySelectorAll(".e-hyperlinkcell"),i=0;i<e.length;i++)t.EventHandler.remove(e[i],this.parent.isAdaptive?"touchend":"click",this.onHyperCellClick)},e}(),Ks=function(){function e(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 t.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})}return e.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)}},e.prototype.processComponentFocus=function(e){if(this.parent.element)return this.parent.element.focus(),e.stopPropagation(),void e.preventDefault()},e.prototype.getButtonElement=function(e){for(var t=[].slice.call(this.parent.element.querySelectorAll("."+A)),i=0,a=t.length;i<a;i++)if(t[i].getAttribute("data-uid")===e.getAttribute("data-uid"))return t[i];return e},e.prototype.processEnter=function(e){var i=e.target;if(i&&(0,t.closest)(i,"."+A))return i.querySelector("."+g)&&(0,t.closest)(i,"."+le)?i.querySelector("."+g).click():i.querySelector("."+xt)?i.querySelector("."+xt).click():!i.querySelector("."+j)||(0,t.closest)(i,"."+le)||(0,t.closest)(i,"."+mt)?i.querySelector("."+V)&&!(0,t.closest)(i,"."+le)&&i.querySelector("."+V).click():(i.querySelector("."+j).click(),this.getButtonElement(i).focus()),void e.preventDefault()},e.prototype.processSort=function(e){var i=e.target;if(i&&(0,t.closest)(i,"."+A)&&i.querySelector("."+j)&&!(0,t.closest)(i,"."+le)&&!(0,t.closest)(i,"."+mt))return i.querySelector("."+j).click(),this.getButtonElement(i).focus(),void e.preventDefault()},e.prototype.processEdit=function(e){var i=e.target;if(i&&(0,t.closest)(i,"."+A)&&i.querySelector("."+xt))return i.querySelector("."+xt).click(),void e.preventDefault()},e.prototype.processFilter=function(e){var i=e.target;if(i&&(0,t.closest)(i,"."+A)&&i.querySelector("."+V)&&!(0,t.closest)(i,"."+le)){if(i.querySelector("."+V).click(),this.parent&&this.parent.control&&"pivotview"===this.parent.moduleName&&this.parent.control.grid&&this.parent.control.showGroupingBar&&this.parent.control.groupingBarModule&&(0,t.closest)(i,"."+ue)&&this.parent.filterDialog&&this.parent.filterDialog.dialogPopUp&&!this.parent.filterDialog.dialogPopUp.isDestroyed&&this.parent.filterDialog.dialogPopUp.element){var a=this.parent.filterDialog.dialogPopUp.element,r=this.parent.filterDialog.allowExcelLikeFilter;clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){a&&a.classList.contains("e-popup-open")&&(r&&a.querySelector(".e-dlg-closeicon-btn")?a.querySelector(".e-dlg-closeicon-btn").focus():a.querySelector("input")&&a.querySelector("input").focus())})}e.preventDefault()}else;},e.prototype.processFilterNodeSelection=function(e){var i=e.target;if(i&&(0,t.closest)(i,"."+$e)&&40===e.keyCode){if((r=(0,t.closest)(i,"."+Y).querySelector("."+K))&&r.querySelector("li")){var a=r.querySelector("li");return r.querySelector("li#_active")&&((0,t.removeClass)([r.querySelector("li#_active")],["e-node-focus"]),r.querySelector("li#_active").removeAttribute("id")),a.setAttribute("id","_active"),(0,t.addClass)([a],["e-node-focus"]),a.focus(),void e.preventDefault()}}else if(i&&(0,t.closest)(i,"."+K)&&38===e.keyCode){var r;if((r=(0,t.closest)(i,"."+K)).querySelector("li#_active.e-node-focus")&&r.querySelector("li")&&r.querySelector("li").classList.contains("e-prev-active-node")&&r.querySelector("li")===r.querySelector("li#_active.e-node-focus")){(0,t.removeClass)(r.querySelectorAll("li.e-prev-active-node"),"e-prev-active-node");var n=(0,t.closest)(i,"."+Y).querySelector("."+$e);if(n&&n.querySelector("li"))return(a=n.querySelector("li")).setAttribute("id","_active"),(0,t.addClass)([a],["e-node-focus"]),a.focus(),void e.preventDefault()}}else i&&i.id===this.parent.parentID+"_inputbox"&&("upArrow"===e.action?i.parentElement.querySelector(".e-spin-up").click():"downArrow"===e.action&&i.parentElement.querySelector(".e-spin-down").click())},e.prototype.processDelete=function(e){var i=e.target;if(i&&(0,t.closest)(i,"."+A)&&i.querySelector("."+_))return i.querySelector("."+_).click(),void e.preventDefault()},e.prototype.processClose=function(e){var i=e.target;if(i&&(0,t.closest)(i,".e-popup.e-popup-open")){var a=(0,t.getInstance)((0,t.closest)(i,".e-popup.e-popup-open"),Bs.Dialog);if(a&&!a.closeOnEscape){var r=a.element.getAttribute("data-fieldName");if(a.hide(),this.parent.element)for(var n=0,s=[].slice.call(this.parent.element.querySelectorAll(".e-pivot-button"));n<s.length;n++){var o=s[n];if(o.getAttribute("data-uid")===r){o.focus();break}}return void e.preventDefault()}}},e.prototype.destroy=function(){this.timeOutObj&&(clearTimeout(this.timeOutObj),this.timeOutObj=null),this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null)},e}(),Xs=function(){function e(e){this.searchListItem=[],this.parent=e}return e.prototype.updateSorting=function(e){if(!e.target.classList.contains(V)&&!e.target.classList.contains(_)){this.parent.filterDialog.dialogPopUp&&this.parent.filterDialog.dialogPopUp.close();var i=e.target,a=void 0,r=void 0,n=void 0;i.id?(a=i.getAttribute("data-uid"),r=[].slice.call(i.querySelectorAll("."+H))):(a=i.parentElement.getAttribute("data-uid"),r=[].slice.call(i.parentElement.querySelectorAll("."+H))),n=0!==r.length;var s=Hs.getFieldByName(a,this.parent.dataSourceSettings.sortSettings),o=this.parent.engineModule&&this.parent.engineModule.fieldList[a]&&this.parent.engineModule.fieldList[a].membersOrder?this.parent.engineModule.fieldList[a].membersOrder.slice():[];if((0,t.isNullOrUndefined)(s)){d={name:a,order:n?"Ascending":"Descending",membersOrder:s?s.membersOrder:o};this.parent.dataSourceSettings.sortSettings.push(d)}else{for(var l=0;l<this.parent.dataSourceSettings.sortSettings.length;l++)if(this.parent.dataSourceSettings.sortSettings[l].name===a){this.parent.dataSourceSettings.sortSettings.splice(l,1);break}var d={name:a,order:n?"Ascending":"Descending",membersOrder:s?s.membersOrder:o};this.parent.dataSourceSettings.sortSettings.push(d)}this.parent.control.lastSortInfo=this.parent.dataSourceSettings.sortSettings[this.parent.dataSourceSettings.sortSettings.length-1],n?(0,t.removeClass)([i],H):(0,t.addClass)([i],H)}},e.prototype.updateFiltering=function(e){var i=e.target,a=i.parentElement.getAttribute("data-uid"),r=i.parentElement.textContent,n=!1,s=[],o=[];if(this.parent.dataSourceSettings.allowMemberFilter)if("olap"===this.parent.dataType)o=this.getOlapData(a,n);else{var l=this.parent.engineModule.fieldList[a],d=Hs.getClonedData(l.dateMember);this.parent.isDateField=Hs.isDateField(a,this.parent.engineModule);var p=l&&l.membersOrder?l.membersOrder.slice():[],h=void 0;"Out of Range"===d[0].actualText?(h=d[0],d.splice(0,1)):"Out of Range"===d[d.length-1].actualText&&(h=d[d.length-1],d.splice(d.length-1,1));var u={fieldName:a,sortOrder:l.sort,members:p&&p.length>0?p:Object.keys(d),IsOrderChanged:!1},c=!1,g=!(!l||!l.isAlphanumeric)||void 0;if(p&&p.length>0)d=Hs.applyCustomSort(u,d,g);else{var m=this.parent.dataSourceSettings.groupSettings.filter(function(e){return e.name===a&&"number"===e.type.toLocaleLowerCase()}),f=!(0,t.isNullOrUndefined)(m)&&m.length>0;d=Hs.applyHeadersSort(d,u.sortOrder,g,f),c=!0}var v=Hs.getFilterItemByName(a,this.parent.dataSourceSettings.filterSettings);if((0,t.isNullOrUndefined)(v)||(n=!(!this.isValidFilterItemsAvail(a,v)||"Include"!==v.type),s=v.items?v.items:[]),h&&("Ascending"===u.sortOrder?"Grand Total"===d[d.length-1].actualText?d.splice(d.length-1,0,h):d.splice(d.length,0,h):"Grand Total"===d[0].actualText?d.splice(1,0,h):d.splice(0,0,h)),c){for(var S=[],y=0,b=0;y<d.length;y++)"Grand Total"!==d[y].actualText&&(S[b++]=d[y].actualText);u.members=S}this.parent.control.trigger(Ba,u),u.IsOrderChanged&&(d=Hs.applyCustomSort(u,d,g,!0)),o=this.getTreeData(n,d,s,a)}this.parent.filterDialog.dialogPopUp&&this.parent.filterDialog.dialogPopUp.close();var C=this.parent.control.filterTargetID;(0,t.isNullOrUndefined)(C)&&(C="pivotfieldlist"!==this.parent.moduleName?this.parent.element:document.getElementById(this.parent.parentID+"_Container")),this.parent.filterDialog.createFilterDialog(o,a,r,C)},e.prototype.isValidFilterItemsAvail=function(e,t){var i=!1;if(t&&["Include","Exclude"].indexOf(t.type)>=0)if("Include"===t.type&&0===t.items.length)i=!0;else{var a=this.parent.engineModule,r=a.fieldList[e],n=void 0;n="Server"===this.parent.dataSourceSettings.mode||"olap"===this.parent.dataType?r.members:Hs.getFormattedMembers(r.members,e,a);var s=this.parent.engineModule;if(this.parent.isDateField&&s&&e in s.groupingFields){for(var o=[],l=0,d=Object.keys(n);l<d.length;l++){var p=d[l];o.push(n[p].caption)}for(var h=0,u=t.items;h<u.length;h++){var c=u[h];if(-1!==o.indexOf(c)){i=!0;break}}}else for(var g=0,m=t.items;g<m.length;g++){if(n[c=m[g]]){i=!0;break}}}return i},e.prototype.getOlapData=function(e,i){var a=[],r=[];this.parent.filterDialog.isSearchEnabled=!1;var n=this.parent.engineModule,s=Hs.getFilterItemByName(e,this.parent.dataSourceSettings.filterSettings);0===n.fieldList[e].filterMembers.length?this.parent.control.loadOnDemandInMemberEditor?s&&s.levelCount>1&&n.fieldList[e].levels.length>1?n.getFilterMembers(this.parent.dataSourceSettings,e,s.levelCount):(n.fieldList[e].levelCount=1,n.getMembers(this.parent.dataSourceSettings,e)):n.getMembers(this.parent.dataSourceSettings,e,!0):(n.fieldList[e].currrentMembers={},n.fieldList[e].searchMembers=[]);var o=n.fieldList[e].isHierarchy;a=n.fieldList[e].filterMembers,(0,t.isNullOrUndefined)(s)||(i=!s.type||"Include"===s.type,r=s.items?s.items:[]);for(var l={},d={},p=n.fieldList[e].members,h=0,u=r;h<u.length;h++){var c=u[h];l[c]=c,d[c]=c,p[c]&&(d=this.getParentNode(e,c,d))}return a=this.getFilteredTreeNodes(e,a,d,[]),a=this.getOlapTreeData(i,Hs.getClonedData(a),l,e,o),a=this.sortOlapFilterData(a,n.fieldList[e].sort)},e.prototype.sortOlapFilterData=function(e,t){if(e.length>0){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].htmlAttributes["data-fieldName"]:e[1].htmlAttributes["data-fieldName"],s=this.parent.engineModule,o=s.fieldList[n],l=o&&o.membersOrder?o.membersOrder.slice():[],d={fieldName:n,levelName:s.levelUniqueName[n],sortOrder:t,members:l&&l.length>0?l:a,IsOrderChanged:!1};if(l&&l.length>0?this.applyFilterCustomSort(e,d):(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 p=[],h=0,u=0;h<e.length;h++)"Grand Total"!==e[h].caption&&(p[u++]=e[h].caption);d.members=p}this.parent.control.trigger(Ba,d),d.IsOrderChanged&&this.applyFilterCustomSort(e,d,!0)}return e},e.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}s>=0&&!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},e.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},e.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},e.prototype.searchTreeNodes=function(e,i,a,r){if(a){for(var n=[],s=[],o=0,d=[].slice.call(i.element.querySelectorAll("li"));o<d.length;o++){var p=d[o];p.querySelector(".e-list-text").textContent.toLowerCase().indexOf(e.value.toLowerCase())>-1?n.push(p):s.push(p)}if(i.enableNodes(n),(0,t.removeClass)(n,l),i.disableNodes(s),(0,t.addClass)(s,l),n.length>0&&s.length>0)for(var h=0,u=n;h<u.length;h++){var c=u[h].getAttribute("data-uid"),g=this.getParentIDs(i,c,[]),m=this.getChildIDs(i,c,[]),f=[];if(g.length>0)for(var v=0,S=s;v<S.length;v++){var y=S[v];-1!==Hs.inArray(y.getAttribute("data-uid"),g)&&f.push(y)}if(m.length>0)for(var b=0,C=s;b<C.length;b++){y=C[b];-1!==Hs.inArray(y.getAttribute("data-uid"),m)&&f.push(y)}i.enableNodes(f),(0,t.removeClass)(f,l)}0===[].slice.call(i.element.querySelectorAll("li."+l)).length?i.collapseAll():i.expandAll(void 0,void 0,!0),this.searchListItem=n}else if(this.parent.searchTreeItems=[],"olap"!==this.parent.dataType||r){n=[];var x=0;x=1;for(var w=0,T=this.parent.currentTreeItems;w<T.length;w++){var M=T[w];M.name.toLowerCase().indexOf(e.value.toLowerCase())>-1&&(this.parent.searchTreeItems.push(M),x<=this.parent.control.maxNodeLimitInMemberEditor&&n.push(M),x++)}--x>this.parent.control.maxNodeLimitInMemberEditor?(this.parent.editorLabelElement.innerText=x-this.parent.control.maxNodeLimitInMemberEditor+this.parent.control.localeObj.getConstant("editorDataLimitMsg"),this.parent.isDataOverflow=!0):(this.parent.editorLabelElement.innerText="",this.parent.isDataOverflow=!1),this.parent.isDataOverflow=x>this.parent.control.maxNodeLimitInMemberEditor,this.parent.editorLabelElement.parentElement.style.display=this.parent.isDataOverflow?"block":"none",i.fields={dataSource:n,id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},i.dataBind()}else this.updateOlapSearchTree(e,i,r)},e.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[c=p[d]].isSelected&&(o[c].parent&&o[o[c].parent].isSelected||l.push(c))}for(var h=0,u=l;h<u.length;h++){var c;n[c=u[h]]=c,s[c]=c,o[c]&&(s=this.getParentNode(r,c,s))}var g=this.parent.engineModule.fieldList[r].filterMembers;a=this.getFilteredTreeNodes(r,g,s,[]),a=this.getOlapTreeData(!0,Hs.getClonedData(a),n,r,i,!0)}else{this.parent.filterDialog.isSearchEnabled=!0;g=this.parent.engineModule.fieldList[r].searchMembers;a=Hs.getClonedData(g),a=this.getOlapSearchTreeData(!0,a,r)}t.fields={dataSource:a,id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},t.dataBind()},e.prototype.getTreeData=function(e,i,a,r){this.parent.currentTreeItems=[],this.parent.searchTreeItems=[],this.parent.currentTreeItemsPos={},this.parent.savedTreeFilterPos={};for(var n=this.parent.engineModule,s=[],o=1,l={},d=0,p=a;d<p.length;d++){var h=p[d];l[h]=h}for(var u=r.replace(/[^a-zA-Z0-9 ]/g,"_"),c=0,g=i;c<g.length;c++){var m=g[c],f=(0,t.isNullOrUndefined)(m.actualText)||""===m.actualText?"":m.actualText,v=f.toString();v=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(v):v;var S=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(f):f,y={id:u+"_"+o,htmlAttributes:{"data-fieldName":r,"data-memberId":S.toString()},actualText:S,name:this.parent.isDateField?m.formattedText:n.getFormattedValue(S,r).formattedText,isSelected:!e},b=void 0;if(this.parent&&this.parent.engineModule instanceof Us){var C=r in this.parent.engineModule.groupingFields;b=this.parent.isDateField&&!C||"Server"===this.parent.dataSourceSettings.mode?f:m.formattedText}void 0!==l[this.parent.isDateField?b:v]&&(y.isSelected=!!e),o<=this.parent.control.maxNodeLimitInMemberEditor&&s.push(y),y.isSelected||(this.parent.savedTreeFilterPos[o-1]=this.parent.isDateField?m.formattedText:v),this.parent.currentTreeItems.push(y),this.parent.searchTreeItems.push(y),this.parent.currentTreeItemsPos[S]={index:o-1,isSelected:y.isSelected},o++}return this.parent.isDataOverflow=o-1>this.parent.control.maxNodeLimitInMemberEditor,s},e.prototype.getOlapTreeData=function(e,t,i,a,r,n){var s=this.parent.engineModule.fieldList[a];this.parent.currentTreeItems=[],this.parent.searchTreeItems=[],this.parent.currentTreeItemsPos={};for(var o=[],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},e.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},e.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))}},e.prototype.getParentNode=function(e,t,i){var a=this.parent.engineModule.fieldList[e].members;if(a[t].parent&&t!==a[t].parent){var r=a[t].parent;i[r]=r,this.getParentNode(e,r,i)}return i},e.prototype.getFilteredTreeNodes=function(e,i,a,r){for(var n=[],s=this.parent.engineModule.fieldList[e].members,o=0,l=a?Object.keys(a):[];o<l.length;o++){var d=l[o],p=s[d]?s[d].parent:void 0;void 0!==p&&-1===Hs.inArray(p,n)&&n.push(p)}for(var h=0,u=i;h<u.length;h++){var c=u[h];(0,t.isNullOrUndefined)(c.pid)||-1!==Hs.inArray(c.pid,n)?(r.push(c),(0,t.isNullOrUndefined)(c.pid)&&-1!==Hs.inArray(c.id,n)?s[c.id].isNodeExpand=!0:(0,t.isNullOrUndefined)(c.pid)||-1===Hs.inArray(c.pid,n)?s[c.id].isNodeExpand=!1:(s[c.id].isNodeExpand=!1,s[c.pid].isNodeExpand=!0)):s[c.id].isNodeExpand=!1}return r},e}(),Js=function(){function e(e){this.parent=e}return e.prototype.onStateModified=function(e,i){var a="",r=(0,t.closest)(e.target,"."+ne),n=-1;if(this.parent.dataSourceUpdate.btnElement=e.element?e.element.parentElement:void 0,r&&(a=r.classList[1]===se?"rows":r.classList[1]===oe?"columns":r.classList[1]===le?"values":r.classList[1]===de?"filters":""),"olap"===this.parent.dataType||"pivot"===this.parent.dataType){var s="olap"===this.parent.dataType&&this.parent.engineModule.fieldList[i]&&this.parent.engineModule.fieldList[i].isCalculatedField?this.parent.engineModule.fieldList[i].tag:i;if(e.cancel&&""===a)return!1;if(this.parent.dataSourceUpdate.btnElement&&"true"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&("filters"===a||"values"===a)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&s.toLowerCase().indexOf("[measures].")>-1&&"olap"===this.parent.dataType&&("filters"===a||"rows"===a||"columns"===a)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&"olap"===this.parent.dataType&&-1===s.toLowerCase().indexOf("[measures].")&&this.parent.engineModule.fieldList[i]&&this.parent.engineModule.fieldList[i].isNamedSets&&("filters"===a||"values"===a)||this.parent.dataSourceUpdate.btnElement&&"false"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&"olap"===this.parent.dataType&&-1===s.toLowerCase().indexOf("[measures].")&&"values"===a){var o=this.parent.localeObj.getConstant("warning"),l=this.parent.localeObj.getConstant("fieldDropErrorAction");return this.parent.errorDialog.createErrorDialog(o,l),!1}}else if(e.cancel&&""===a||this.parent.dataSourceUpdate.btnElement&&"true"===this.parent.dataSourceUpdate.btnElement.getAttribute("isValue")&&("filters"===a||"values"===a||a.indexOf(this.parent.dataSourceSettings.valueAxis)>-1))return!1;if(""!==a){if("olap"===this.parent.dataType||"pivot"===this.parent.dataType)if((s="olap"===this.parent.dataType&&this.parent.engineModule.fieldList[i]&&this.parent.engineModule.fieldList[i].isCalculatedField?this.parent.engineModule.fieldList[i].tag:i).toLowerCase().indexOf("[measures].")>-1&&"olap"===this.parent.dataType&&("filters"===a||"rows"===a||"columns"===a)||this.parent.engineModule.fieldList[i]&&this.parent.engineModule.fieldList[i].isNamedSets&&"filters"===a||"olap"===this.parent.dataType&&"values"===a&&-1===s.toLowerCase().indexOf("[measures].")){o=this.parent.localeObj.getConstant("warning"),l=this.parent.localeObj.getConstant("fieldDropErrorAction");return this.parent.errorDialog.createErrorDialog(o,l),!1}if("pivot"===this.parent.dataType&&this.parent.engineModule.fieldList[i]&&"CalculatedField"===this.parent.engineModule.fieldList[i].aggregateType&&"values"!==a){o=this.parent.localeObj.getConstant("warning"),l=this.parent.localeObj.getConstant("dropAction");return this.parent.errorDialog.createErrorDialog(o,l),!1}n=this.getButtonPosition(e.target,e.element,a)}else this.parent.engineModule.fieldList[i]&&(this.parent.engineModule.fieldList[i].isSelected=!1,"olap"===this.parent.dataType&&this.parent.engineModule.updateFieldlistData(i));return this.parent.dataSourceUpdate.updateDataSource(i,a,n)},e.prototype.getButtonPosition=function(e,i,a){var r=-1,n=(0,t.isNullOrUndefined)(i)||(0,t.isNullOrUndefined)(i.closest(".e-tabular-pvt-btn"))?"":i.closest(".e-tabular-pvt-btn").getAttribute("data-tag").split(":")[0];if(this.parent.dataSourceUpdate.control.isTabular&&"rows"===a&&"rows"===n){var s=(0,t.closest)(e,"."+L)?(0,t.closest)(e,"."+L):e.querySelector("."+L);if(!(0,t.isNullOrUndefined)(s)){s=s.querySelector("."+A);var o=i.closest(".e-pivot-button").getAttribute("data-uid"),l=s.getAttribute("data-uid");if("[Measures]"===o){var d=this.parent.element.querySelectorAll(".e-group-rows"),p=[];d.forEach(function(e){var t=[].slice.call(e.querySelectorAll("."+A));p.push.apply(p,t)});for(var h=0;h<p.length;h++)if(p[h].id===s.id){r=h;break}}else for(h=0;h<this.parent.dataSourceSettings.rows.length;h++)if(this.parent.dataSourceSettings.rows[h].name===l){r=h;break}}}else{s=(0,t.closest)(e,"."+L);if(!(0,t.isNullOrUndefined)(s)){s=s.querySelector("."+A);for(var u=this.parent.element.querySelector(".e-"+a),c=[].slice.call(u.querySelectorAll("."+A)),g=(h=0,c.length);h<g;h++)if(c[h].id===s.id){r=h;break}}}return r},e}(),Zs=function(){function e(e){this.parent=e}return e.prototype.updateDataSource=function(e,i,a){for(var r,n,s=this,o=-1,l=!0,d=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],p=0,h=d.length;p<h;p++)if(d[p])for(var u=0,c=d[p].length;u<c;u++)(d[p][u].name===e||"olap"===this.parent.dataType&&"[measures]"===d[p][u].name.toLowerCase()&&d[p][u].name.toLowerCase()===e)&&(n=0===p?"rows":1===p?"columns":2===p?"values":"filters",o=u),n||(n="fieldList");var g={fieldName:e,dropField:Hs.getFieldInfo(e,this.control).fieldItem,dataSourceSettings:Hs.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:i,dropPosition:a,draggedAxis:n,cancel:!1},m="pivotfieldlist"===this.control.getModuleName()&&this.control.isPopupView?this.control.pivotGridModule:this.control;return m.trigger(Fi,g,function(d){if(d.cancel)l=!1;else{if(i=d.dropAxis,a=d.dropPosition,e=d.dropField?d.dropField.name:d.fieldName,r=d.dropField,s.control&&s.btnElement&&"true"===s.btnElement.getAttribute("isvalue"))switch(i){case"":s.control.setProperties({dataSourceSettings:{values:[]}},!0);break;case"rows":a=a===s.parent.dataSourceSettings.rows.length?-1:a,s.control.setProperties({dataSourceSettings:{valueAxis:"row",valueIndex:a}},!0);break;case"columns":a=a===s.parent.dataSourceSettings.columns.length?-1:a,s.control.setProperties({dataSourceSettings:{valueAxis:"column",valueIndex:a}},!0)}else{if(s.removeFieldFromReport(e.toString()),"pivot"===s.parent.dataType&&s.control.showValuesButton&&s.parent.dataSourceSettings.values.length>1){var p="row"===s.parent.dataSourceSettings.valueAxis&&"rows"===i?s.parent.dataSourceSettings.rows:"column"===s.parent.dataSourceSettings.valueAxis&&"columns"===i?s.parent.dataSourceSettings.columns:void 0;o<s.parent.dataSourceSettings.valueIndex&&("row"===s.parent.dataSourceSettings.valueAxis&&"rows"===n||"column"===s.parent.dataSourceSettings.valueAxis&&"columns"===n)&&s.control.setProperties({dataSourceSettings:{valueIndex:s.parent.dataSourceSettings.valueIndex-1}},!0),(0,t.isNullOrUndefined)(p)||(-1===a&&-1===s.parent.dataSourceSettings.valueIndex?s.control.setProperties({dataSourceSettings:{valueIndex:p.length}},!0):a>-1&&a<=s.parent.dataSourceSettings.valueIndex?s.control.setProperties({dataSourceSettings:{valueIndex:s.parent.dataSourceSettings.valueIndex+1}},!0):s.parent.dataSourceSettings.valueIndex>-1&&a>s.parent.dataSourceSettings.valueIndex&&(a-=1))}"CalculatedField"===(r=s.getNewField(e.toString(),d.dropField)).type&&""!==i&&(i="values")}if("olap"===s.parent.dataType&&(s.removeFieldFromReport(e.toString()),r=s.getNewField(e.toString(),d.dropField),0===s.parent.dataSourceSettings.values.length&&s.removeFieldFromReport("[measures]"),"CalculatedField"===r.type&&""!==i&&(i="values")),s.control){var h={fieldName:e,droppedField:r,dataSourceSettings:Hs.getClonedDataSourceSettings(s.parent.dataSourceSettings),droppedAxis:i,droppedPosition:a};m.trigger(Ii,h,function(e){if(r=e.droppedField){switch(a=e.droppedPosition,i=e.droppedAxis){case"filters":-1!==a?s.parent.dataSourceSettings.filters.splice(a,0,r):s.parent.dataSourceSettings.filters.push(r);break;case"rows":-1!==a?s.parent.dataSourceSettings.rows.splice(a,0,r):s.parent.dataSourceSettings.rows.push(r);break;case"columns":-1!==a?s.parent.dataSourceSettings.columns.splice(a,0,r):s.parent.dataSourceSettings.columns.push(r);break;case"values":if(-1!==a?s.parent.dataSourceSettings.values.splice(a,0,r):s.parent.dataSourceSettings.values.push(r),!("olap"!==s.parent.dataType||s.parent.engineModule.isMeasureAvail||s.parent.dataSourceSettings.values.length>1)){("row"===s.parent.dataSourceSettings.valueAxis?s.parent.dataSourceSettings.rows:s.parent.dataSourceSettings.columns).push({name:"[Measures]",caption:"Measures",showRemoveIcon:!0,allowDragAndDrop:!0})}}var t="columns"===i?m.dataSourceSettings.columns.length:"rows"===i?m.dataSourceSettings.rows.length:0;0!==t&&m.dataSourceSettings.valueIndex===t&&s.control.setProperties({dataSourceSettings:{valueIndex:-1}},!0)}})}}}),l},e.prototype.removeFieldFromReport=function(e){for(var t,i=!1,a=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],r=this.parent.engineModule.fieldList[e],n=0,s=a.length;n<s;n++)if(!i&&a[n])for(var o=0,l=a[n].length;o<l;o++)if(a[n][o].name===e||"olap"===this.parent.dataType&&"[measures]"===a[n][o].name.toLowerCase()&&a[n][o].name.toLowerCase()===e){if((t=a[n][o].properties?a[n][o].properties:a[n][o]).type=r&&"number"===r.type?t.type:"Count",a[n].splice(o,1),"olap"===this.parent.dataType){var d=this.parent.engineModule;d&&d.fieldList[e]&&(d.fieldList[e].currrentMembers={},d.fieldList[e].searchMembers=[])}i=!0;break}return t},e.prototype.getNewField=function(e,t){var i;if("olap"===this.parent.dataType){var a=this.parent.engineModule.fieldList[e];i={name:t?t.name:e,caption:t?t.caption:a.caption,isNamedSet:t?t.isNamedSet:a.isNamedSets,isCalculatedField:t?t.isCalculatedField:a.isCalculatedField,type:t?void 0===t.type?"number"===a.type?"Sum":"Count":t.type:void 0===a.aggregateType?"number"===a.type?"Sum":"Count":a.aggregateType,showFilterIcon:t?t.showFilterIcon:a.showFilterIcon,showSortIcon:t?t.showSortIcon:a.showSortIcon,showEditIcon:t?t.showEditIcon:a.showEditIcon,showRemoveIcon:t?t.showRemoveIcon:a.showRemoveIcon,showValueTypeIcon:t?t.showValueTypeIcon:a.showValueTypeIcon,allowDragAndDrop:t?t.allowDragAndDrop:a.allowDragAndDrop,showSubTotals:t?t.showSubTotals:a.showSubTotals,expandAll:t?t.expandAll:a.expandAll}}else{a=this.parent.engineModule.fieldList[e];i={name:t?t.name:e,caption:t?t.caption:a.caption,type:t?void 0===t.type||null===t.type?"number"===a.type?"Sum":"Count":t.type:void 0===a.aggregateType||null===a.aggregateType?"number"===a.type?"Sum":"Count":a.aggregateType,showNoDataItems:t?t.showNoDataItems:a.showNoDataItems,baseField:t?t.baseField:a.baseField,baseItem:t?t.baseItem:a.baseItem,allowDragAndDrop:t?t.allowDragAndDrop:a.allowDragAndDrop,showSubTotals:t?t.showSubTotals:a.showSubTotals,showFilterIcon:t?t.showFilterIcon:a.showFilterIcon,showSortIcon:t?t.showSortIcon:a.showSortIcon,showEditIcon:t?t.showEditIcon:a.showEditIcon,showRemoveIcon:t?t.showRemoveIcon:a.showRemoveIcon,showValueTypeIcon:t?t.showValueTypeIcon:a.showValueTypeIcon,expandAll:t?t.expandAll:a.expandAll}}return i},e}(),$s=function(){function e(e){this.parent=e}return e.prototype.createErrorDialog=function(e,i){var a=(0,t.createElement)("div",{id:this.parent.parentID+"_ErrorDialog",className:re});this.parent.element.appendChild(a),this.errorPopUp=new Bs.Dialog({animationSettings:{effect:"Fade"},allowDragging:!1,header:e,content:i,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:ie+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}}],cssClass:this.parent.cssClass,closeOnEscape:!0,target:Hs.getAppendToElement(this.parent.control.element,this.parent.control.isAngular),close:this.removeErrorDialog.bind(this)}),this.errorPopUp.isStringTemplate=!0,this.errorPopUp.isAngular=this.parent.control.isModalDialog,this.errorPopUp.appendTo(a)},e.prototype.closeErrorDialog=function(){this.errorPopUp.close()},e.prototype.removeErrorDialog=function(){this.errorPopUp&&!this.errorPopUp.isDestroyed&&(this.errorPopUp.destroy(),this.errorPopUp=null),document.getElementById(this.parent.parentID+"_ErrorDialog")&&(0,t.remove)(document.getElementById(this.parent.parentID+"_ErrorDialog"))},e}(),eo=v(570),to=v(295),io=v(741),ao=function(){function e(e){this.parent=e,this.isAppendMode=!1}return e.prototype.createFilterDialog=function(e,i,a,r){var n=this,s=(0,t.createElement)("div",{id:this.parent.parentID+"_EditorTreeView",className:"e-member-editor-dialog "+("olap"===this.parent.dataType?"e-olap-editor-dialog":"")+(this.parent.isDataOverflow?" "+yi:""),attrs:{"data-fieldName":i,"aria-label":a}}),o=this.parent.engineModule.fieldList[i].caption,d=this.parent.localeObj.getConstant("filter")+' "'+a+'" '+this.parent.localeObj.getConstant("by");this.filterObject=this.getFilterObject(i),this.isAppendMode=!1,this.isSearchEnabled=!1,this.allowExcelLikeFilter=this.isExcelFilter(i),this.parent.element.appendChild(s),this.dialogPopUp=new Bs.Dialog({animationSettings:{effect:this.allowExcelLikeFilter?"None":"Fade"},allowDragging:!1,header:this.allowExcelLikeFilter?d:o,content:"",isModal:!0,visible:!0,showCloseIcon:!!this.allowExcelLikeFilter,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:"320px",position:{X:"center",Y:"center"},buttons:[{isFlat:!1,buttonModel:{cssClass:"e-clear-filter-button"+(this.allowExcelLikeFilter?"":" "+l)+(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:ie+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:this.closeFilterDialog.bind(this),isFlat:!1,buttonModel:{cssClass:ae+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}],closeOnEscape:"Popup"!==this.parent.renderMode,target:r,cssClass:(this.parent.cssClass+" "+(this.parent.isDataOverflow?"e-member-editor-overflow":"")).trim(),close:this.removeFilterDialog.bind(this)}),this.dialogPopUp.isStringTemplate=!0,this.dialogPopUp.isAngular=this.parent.control.isModalDialog,this.dialogPopUp.appendTo(s);var p={cancel:!1,fieldName:i,fieldMembers:this.parent.dataSourceSettings.allowMemberFilter?e:[],filterSetting:this.filterObject};("pivotfieldlist"===this.parent.moduleName&&this.parent.control.isPopupView?this.parent.control.pivotGridModule:this.parent.control).trigger(er,p,function(r){r.cancel?(n.dialogPopUp.close(),n.dialogPopUp=void 0):(e=r.fieldMembers,n.allowExcelLikeFilter?(n.createTabMenu(e,a,i),(0,t.addClass)([n.dialogPopUp.element],"e-excel-filter"),n.updateCheckedState()):(n.dialogPopUp.content=n.createTreeView(e,a,i),n.updateCheckedState()),(0,t.setStyleAttribute)(n.dialogPopUp.element,{visibility:"visible"}),n.allowExcelLikeFilter&&n.dialogPopUp.element.querySelector(".e-dlg-closeicon-btn").focus(),n.memberTreeView.nodeChecked=n.parent.control.pivotButtonModule.nodeStateModified.bind(n.parent.control.pivotButtonModule),n.allMemberSelect.nodeChecked=n.parent.control.pivotButtonModule.nodeStateModified.bind(n.parent.control.pivotButtonModule))})},e.prototype.createTreeView=function(e,i,a){var r=this,n=(0,t.createElement)("div",{id:this.parent.parentID+"EditorDiv",className:Y+(this.allowExcelLikeFilter?" e-excelfilter":"")}),s=(0,t.createElement)("button",{id:this.parent.parentID+"_LevelDiv",className:"e-level-container-class",attrs:{type:"button"}}),o=(0,t.createElement)("div",{id:this.parent.parentID+"_SearchDiv",attrs:{tabindex:"-1"},className:Je}),d=this.parent.engineModule.fieldList[a].caption,p=(0,t.createElement)("input",{attrs:{type:"text",className:"e-editor-search-input"}}),h=this.parent.isDataOverflow?this.parent.currentTreeItems.length-this.parent.control.maxNodeLimitInMemberEditor+this.parent.control.localeObj.getConstant("editorDataLimitMsg"):"",u=(0,t.createElement)("div",{id:this.parent.parentID+"_LabelDiv",attrs:{tabindex:"-1",title:h},className:"e-editor-label-container"});this.parent.editorLabelElement=(0,t.createElement)("label",{className:"e-editor-label"}),this.parent.editorLabelElement.innerText=h,u.style.display=this.parent.isDataOverflow?"block":"none",u.appendChild(this.parent.editorLabelElement),o.appendChild(p),this.createSortOptions(a,o,e);var c=(0,t.createElement)("div",{id:this.parent.parentID+"_AllDiv",attrs:{tabindex:"-1"},className:"e-select-all-container"}),g=(0,t.createElement)("div",{id:this.parent.parentID+"_SelectAllContainer",className:$e}),m=(0,t.createElement)("div",{className:K+"-outer-div"}),f=(0,t.createElement)("div",{className:K}),v=(0,t.createElement)("div",{className:Ct+" "+l});v.innerText=this.parent.localeObj.getConstant("noMatches"),"olap"!==this.parent.dataType||!this.parent.control.loadOnDemandInMemberEditor||this.parent.engineModule.fieldList[a].isHierarchy||this.parent.engineModule.fieldList[a].isNamedSets||(o.appendChild(s),this.createLevelWrapper(s,a)),c.appendChild(g),n.appendChild(o),n.appendChild(c),n.appendChild(v),this.editorSearch=new zs.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("search")+' "'+d+'"',enableRtl:this.parent.enableRtl,cssClass:Ze+(this.parent.cssClass?" "+this.parent.cssClass:""),showClearButton:!0,change:function(e){if("olap"===r.parent.dataType)r.searchOlapTreeView(e,v);else{r.parent.eventBase.searchTreeNodes(e,r.memberTreeView,!1);var i=r.dialogPopUp.element;0===[].slice.call(r.memberTreeView.element.querySelectorAll("li")).length?(r.allMemberSelect.disableNodes([r.allMemberSelect.element.querySelector("li")]),i.querySelector("."+ie).setAttribute("disabled","disabled"),(0,t.removeClass)([v],l)):(r.allMemberSelect.enableNodes([r.allMemberSelect.element.querySelector("li")]),i.querySelector("."+ie).removeAttribute("disabled"),(0,t.addClass)([v],l)),r.updateCheckedState()}r.updateAppendWrapperVisibility(e.value)}}),this.editorSearch.isStringTemplate=!0,this.editorSearch.appendTo(p);var S={"data-fieldName":a,"data-memberId":"all"},y=[{id:"all",name:this.parent.localeObj.getConstant("all"),isSelected:!0,htmlAttributes:S}];if(this.allMemberSelect=new Gs.TreeView({fields:{dataSource:y,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){(0,t.removeClass)([e.node],"e-active"),e.cancel=!0},cssClass:this.parent.cssClass}),this.allMemberSelect.isStringTemplate=!0,this.allMemberSelect.isAngular=this.parent.control.isModalDialog,!(0,t.isNullOrUndefined)(this.parent.currentTreeItems))for(var b=0;b<this.parent.currentTreeItems.length;b++)(this.parent.currentTreeItems[b].id.indexOf("\n")||0===this.parent.currentTreeItems[b].id.indexOf("\n"))&&(this.parent.currentTreeItems[b].id=this.parent.currentTreeItems[b].id.replace("\n"," "));if(this.allMemberSelect.appendTo(g),m.appendChild(f),!this.filterObject||"Include"!==this.filterObject.type&&"Exclude"!==this.filterObject.type)this.appendControlsWrapper&&!this.appendControlsWrapper.classList.contains(l)&&(0,t.addClass)([this.appendControlsWrapper],l);else{this.appendControlsWrapper=(0,t.createElement)("div",{className:"e-append-filter-wrapper",id:this.parent.parentID+"_AppendWrapper"}),(0,t.addClass)([this.appendControlsWrapper],l);var C=(0,t.createElement)("div",{className:"e-append-checkbox-container"}),x=(0,t.createElement)("input",{id:this.parent.parentID+"_append_checkbox",className:"e-append-checkbox-input",attrs:{type:"checkbox"}});C.appendChild(x),this.appendCheckbox=new io.CheckBox({label:this.parent.localeObj.getConstant("addCurrentSelection"),checked:!1,enableRtl:this.parent.enableRtl,locale:this.parent.control.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:"e-append-checkbox",change:function(e){r.isAppendMode=e.checked}}),this.appendCheckbox.isStringTemplate=!0,this.appendCheckbox.appendTo(x),this.appendControlsWrapper.appendChild(C)}return n.appendChild(c),this.appendControlsWrapper&&n.appendChild(this.appendControlsWrapper),n.appendChild(v),n.appendChild(m),this.memberTreeView=new Gs.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){(0,t.removeClass)([e.node],"e-active"),e.cancel=!0},expandOn:"None",cssClass:this.parent.cssClass}),this.memberTreeView.isStringTemplate=!0,this.memberTreeView.isAngular=this.parent.control.isModalDialog,this.memberTreeView.appendTo(f),this.parent.isDataOverflow&&this.parent.control.maxNodeLimitInMemberEditor<this.parent.currentTreeItems.length&&n.appendChild(u),n},e.prototype.createSortOptions=function(e,i,a){if("pivot"===this.parent.dataType&&a&&a.length>0){var r=this.parent.engineModule.fieldList[e].sort,s=(0,t.createElement)("div",{className:ke+" e-btn-group"+(this.parent.enableRtl?" "+n:"")+(this.parent.cssClass?" "+this.parent.cssClass:""),id:this.parent.element.id+"_Member_Sort"});this.parent.element.appendChild(s);var l=(0,t.createElement)("button",{className:("Ascending"===r?He+" ":"")+q,id:this.parent.element.id+"_Sort_Ascend",attrs:{type:"button","aria-label":"button"}}),d=(0,t.createElement)("button",{className:("Descending"===r?He+" ":"")+q,id:this.parent.element.id+"_Sort_Descend",attrs:{type:"button","aria-label":"button"}}),p=new io.Button({iconCss:o+" "+je,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});p.appendTo(l),(p=new io.Button({iconCss:o+" "+qe,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass,enableHtmlSanitizer:this.parent.enableHtmlSanitizer})).appendTo(d),s.appendChild(l),s.appendChild(d),i.appendChild(s),this.unWireEvent(l),this.unWireEvent(d),this.wireEvent(l,e),this.wireEvent(d,e)}},e.prototype.createLevelWrapper=function(e,i){for(var a=this,r=this.parent.engineModule,n=r.fieldList[i].levels,s=r.fieldList[i].levelCount,o=[],l=0,d=n.length;l<d;l++)o.push({id:n[l].id,text:n[l].name});this.dropMenu=new to.DropDownButton({cssClass:"e-level-drop e-caret-hide"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:o,iconCss:"e-icons e-dropdown-icon",disabled:s===n.length,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,beforeOpen:function(e){var r=[].slice.call(e.element.querySelectorAll("li")),n=a.parent.engineModule.fieldList[i].levelCount;(0,t.removeClass)(r,yt);for(var s=0,o=r.length;s<o;s++)s<n&&(0,t.addClass)([r[s]],yt)},select:function(e){for(var t,i=a.dialogPopUp.element.getAttribute("data-fieldname"),r=a.parent.engineModule,n=0,s=o.length;n<s;n++)o[n].id===e.item.id&&(t=n);r.getFilterMembers(a.parent.dataSourceSettings,i,t+1,!1,!0)},close:function(){var e=a.parent.engineModule,t=e.fieldList[i].levels;e.fieldList[i].levelCount===t.length?(a.dropMenu.disabled=!0,a.dropMenu.dataBind()):a.dropMenu.disabled=!1}}),this.dropMenu.appendTo(e)},e.prototype.searchOlapTreeView=function(e,i){var a=this;clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){var r=a.parent.engineModule,n=a.dialogPopUp.element,s=n.getAttribute("data-fieldname"),o=a.parent.control.maxNodeLimitInMemberEditor?a.parent.control.maxNodeLimitInMemberEditor:5e3;if(r.fieldList[s].isHierarchy)a.parent.eventBase.searchTreeNodes(e,a.memberTreeView,!1,!0);else{if(a.dropMenu&&""!==e.value?a.dropMenu.disabled=!0:a.dropMenu.disabled=!1,a.parent.control.loadOnDemandInMemberEditor){var d=r.fieldList[s].levelCount?r.fieldList[s].levelCount:1;r.getSearchMembers(a.parent.dataSourceSettings,s,e.value.toLowerCase(),o,!1,d)}else r.getSearchMembers(a.parent.dataSourceSettings,s,e.value.toLowerCase(),o,!0);a.parent.eventBase.searchTreeNodes(e,a.memberTreeView,!1,!1)}0===[].slice.call(a.memberTreeView.element.querySelectorAll("li")).length?(a.allMemberSelect.disableNodes([a.allMemberSelect.element.querySelector("li")]),n.querySelector("."+ie).setAttribute("disabled","disabled"),(0,t.removeClass)([i],l)):(a.allMemberSelect.enableNodes([a.allMemberSelect.element.querySelector("li")]),n.querySelector("."+ie).removeAttribute("disabled"),(0,t.addClass)([i],l)),a.updateCheckedState(),a.updateAppendWrapperVisibility(e.value)},500)},e.prototype.updateAppendWrapperVisibility=function(e){if(this.appendControlsWrapper){var i=[].slice.call(this.memberTreeView.element.querySelectorAll("li")).length>0;e&&""!==e.trim()&&i?(0,t.removeClass)([this.appendControlsWrapper],l):(0,t.addClass)([this.appendControlsWrapper],l)}},e.prototype.nodeCheck=function(e,i){var a=[i.node];if(i.event.target.classList.contains("e-fullrow")||"Enter"===i.event.key){var r=e?this.allMemberSelect:this.memberTreeView;"true"===r.getNode(i.node).isChecked?r.uncheckAll(a):r.checkAll(a)}else 38!==i.event.keyCode||e||((0,t.removeClass)(this.memberTreeView.element.querySelectorAll("li.e-prev-active-node"),"e-prev-active-node"),(0,t.addClass)(a,"e-prev-active-node"))},e.prototype.applySorting=function(e,i){var a=(0,t.closest)(i.target,"."+q);if(a){var r=[].slice.call((0,t.closest)(a,"."+ke).querySelectorAll("."+q));a.querySelector("."+je)&&!a.classList.contains(He)?(this.updateFilterMembers("Ascending",e),(0,t.addClass)([a],He),(0,t.removeClass)([r[1]],He)):a.querySelector("."+qe)&&!a.classList.contains(He)?(this.updateFilterMembers("Descending",e),(0,t.addClass)([a],He),(0,t.removeClass)([r[0]],He)):(this.updateFilterMembers("None",e),(0,t.removeClass)(r,He))}},e.prototype.updateFilterMembers=function(e,i){var a=this.parent.engineModule.fieldList[i],r="None"===e?Hs.getClonedData(a.dateMember):this.parent.currentTreeItems.slice(),n=!!a.isAlphanumeric||void 0,s=!1,o=a&&a.membersOrder?a.membersOrder.slice():[],l={fieldName:i,sortOrder:e,members:o&&o.length>0?o:Object.keys(r),IsOrderChanged:!1};if(o&&o.length>0)r=Hs.applyCustomSort(l,r,n);else{var d=this.parent.dataSourceSettings.groupSettings.filter(function(e){return e.name===i&&"number"===e.type.toLocaleLowerCase()}),p=!(0,t.isNullOrUndefined)(d)&&d.length>0;r=Hs.applyHeadersSort(r,l.sortOrder,n,p),s=!0}var h="pivotfieldlist"===this.parent.moduleName&&this.parent.control.isPopupView?this.parent.control.pivotGridModule:this.parent.control;if(s){for(var u=[],c=0,g=0;c<r.length;c++)"Grand Total"!==r[c].actualText&&(u[g++]=r[c].actualText);l.members=u}h.trigger(Ba,l),l.IsOrderChanged&&(r=Hs.applyCustomSort(l,r,n,!0)),this.parent.currentTreeItems=[],this.parent.searchTreeItems=[];for(var m=[],f=i.replace(/[^a-zA-Z0-9 ]/g,"_"),v=this.parent.engineModule,S=0,y=r.length;S<y;S++){if("None"===e){var b=r[S].actualText.toString(),C={id:f+"_"+(S+1),htmlAttributes:{"data-fieldName":i,"data-memberId":b},actualText:r[S].actualText,name:this.parent.isDateField?r[S].formattedText:v.getFormattedValue(b,i).formattedText,isSelected:this.parent.currentTreeItemsPos[r[S].actualText].isSelected};this.parent.currentTreeItems.push(C),""!==this.editorSearch.value?C.name.toLowerCase().indexOf(this.editorSearch.value.toLowerCase())>-1&&(this.parent.searchTreeItems.push(C),m.push(C)):(this.parent.searchTreeItems.push(C),m.push(C))}else this.parent.currentTreeItems.push(r[S]),""!==this.editorSearch.value?r[S].name.toLowerCase().indexOf(this.editorSearch.value.toLowerCase())>-1&&(this.parent.searchTreeItems.push(r[S]),m.push(r[S])):(this.parent.searchTreeItems.push(r[S]),m.push(r[S]));this.parent.currentTreeItemsPos[r[S].actualText].index=S}var x=this.memberTreeView.fields.dataSource.length;this.memberTreeView.fields={dataSource:m.slice(0,x),id:"id",text:"name",isChecked:"isSelected",parentID:"pid"},this.memberTreeView.dataBind()},e.prototype.updateChildNodes=function(e){if("olap"===this.parent.dataType){var i=this.parent.engineModule,a=e.node.getAttribute("data-fieldname"),r=i.fieldList[a],n=[];if(r&&r.filterMembers.length>0&&!this.isSearchEnabled&&!r.members[e.nodeData.id].isNodeExpand){for(var s=[],o=0,l=r.filterMembers;o<l.length;o++){var d=l[o];d.pid===e.nodeData.id.toString()&&s.push(d)}0===s.length&&(r.childMembers=[],i.getChildMembers(this.parent.dataSourceSettings,e.nodeData.id.toString(),a),s=r.childMembers,r.childMembers=[]);var p=Hs.getClonedData(s),h=this.memberTreeView.fields.dataSource,u=!1;(0,t.isNullOrUndefined)(this.filterObject)||(u="Include"===this.filterObject.type,n=this.filterObject.items?this.filterObject.items:[]),p=this.updateChildData(u,p,n,a,e.nodeData);for(var c=0,g=p=this.parent.eventBase.sortOlapFilterData(p,i.fieldList[a].sort);c<g.length;c++){var m=g[c];h.push(m)}r.members[e.nodeData.id].isNodeExpand=!0,this.memberTreeView.addNodes(p,e.node)}}},e.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},e.prototype.createTabMenu=function(e,i,a){var r=(0,t.createElement)("div",{id:this.parent.parentID+"_FilterTabContainer",className:"e-filter-tab-container",attrs:{tabindex:"-1"}});this.dialogPopUp.content=r,this.dialogPopUp.dataBind();for(var n=["Label","Value","Include","Exclude"],s="((-|\\+)?[0-9]+(\\.[0-9]+)?)+",o=Object.keys(this.parent.engineModule.fieldList[a].members)[0],l=this.parent.engineModule.fieldList[a].type,d=Hs.getFieldByName(a,this.parent.dataSourceSettings.formatSettings),p=[{header:{text:this.parent.localeObj.getConstant("member"),iconCss:this.filterObject&&n.indexOf(this.filterObject.type)>1?Ee:""},content:this.createTreeView(e,i,a)}],h=0,u=n;h<u.length;h++){var c=u[h];if("Label"===c&&this.parent.dataSourceSettings.allowLabelFilter||"Value"===c&&this.parent.dataSourceSettings.allowValueFilter){var g="Label"===c&&o&&o.match(s)&&o.match(s)[0].length===o.length&&"number"===l?"Number":"Label"===c&&o&&"Invalid Date"!==new Date(o).toString()&&(d&&d.type||this.filterObject&&"Date"===this.filterObject.type)?"Date":c,m={header:{text:"Number"===g?this.parent.localeObj.getConstant("label"):this.parent.localeObj.getConstant(g.toLowerCase()),iconCss:this.filterObject&&this.filterObject.type===g?Ee:""},content:this.createCustomFilter(a,this.filterObject&&this.filterObject.type===g?this.filterObject:void 0,g.toLowerCase())};p.push(m)}}var f=this.filterObject?["Label","Date","Number"].indexOf(this.filterObject.type)>=0?1:"Value"===this.filterObject.type?this.parent.dataSourceSettings.allowLabelFilter&&this.parent.dataSourceSettings.allowValueFilter?2:1:0:0;f=this.parent.dataSourceSettings.allowMemberFilter||0!==f?f:1,this.tabObj=new Gs.Tab({heightAdjustMode:"Auto",items:p,height:"100%",selectedItem:f,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass}),this.tabObj.isStringTemplate=!0,this.tabObj.appendTo(r),this.parent.dataSourceSettings.allowMemberFilter||this.tabObj.hideTab(0),f>0&&(0,t.addClass)([this.dialogPopUp.element.querySelector(".e-filter-div-content."+(1===f&&this.parent.dataSourceSettings.allowLabelFilter?"e-label-filter":"e-value-filter"))],"e-selected-tab")},e.prototype.createCustomFilter=function(e,i,a){for(var r=[],n=[],s=[],d=this.parent.dataSourceSettings.values,p="DoesNotEquals",h=0,u=0,c={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","Top","Bottom"]},g=["Between","NotBetween"],m="label"===a?c.label:"date"===a?c.date:c.value,f=0,v=m;f<v.length;f++){var S=v[f];p=i&&S===i.condition?m.indexOf(i.condition)>=0?i.condition:m[0]:p,("value"!==a||"Server"!==this.parent.dataSourceSettings.mode||"Top"!==S&&"Bottom"!==S)&&r.push({value:S,text:this.parent.localeObj.getConstant(S)})}for(var y=d.length;y--;)n.unshift({value:d[y].name,text:d[y].caption?d[y].caption:d[y].name}),h=i&&"Value"===i.type&&i.measure===d[y].name&&i.condition===p?y:h;if("olap"===this.parent.dataType){var b=this.parent.engineModule,C=b.fieldList[e].levels;if(this.parent.engineModule.fieldList[e].isHierarchy){for(var x=void 0,w=0,T=this.parent.engineModule.fieldListData;w<T.length;w++){var M=T[w];if(M&&M.pid===e){x=M;break}}s.push({value:x?x.id:e,text:x?x.caption:b.fieldList[e].name}),u=0,i&&i.name===e&&i.type.toLowerCase()===a&&(s[s.length-1].iconClass=o+" "+Ie)}else for(var D=0,O=C.length;D<O;D++){u=i&&i.selectedField===C[D].id?D:u,s.push({value:C[D].id,text:C[D].name});for(var N=0,P=this.parent.dataSourceSettings.filterSettings;N<P.length;N++){var E=P[N];if(E.name===e&&E.selectedField===C[D].id&&E.type.toLowerCase()===a){s[s.length-1].iconClass=o+" "+Ie;break}}}}var I=(0,t.createElement)("div",{className:"e-filter-div-content e-"+(["date","number"].indexOf(a)>=0?"label":a)+"-filter"+(this.parent.isDataOverflow?" "+yi:""),id:this.parent.parentID+"_"+a+"_filter_div_content",attrs:{"data-type":a,"data-fieldName":e,"data-operator":p,"data-selectedField":"olap"===this.parent.dataType&&s.length>0?s[u].value.toString():"","data-measure":this.parent.dataSourceSettings.values.length>0?this.parent.dataSourceSettings.values[h].name:"","data-value1":i&&p===i.condition&&i.value1?i.value1.toString():"","data-value2":i&&p===i.condition&&i.value2?i.value2.toString():""}}),F=(0,t.createElement)("div",{className:"e-filter-text-div"});F.innerText=this.parent.localeObj.getConstant(a+"TextContent");var L=(0,t.createElement)("div",{className:Fe+" "+(-1===g.indexOf(p)?l:"")});L.innerText=this.parent.localeObj.getConstant("And");var A=(0,t.createElement)("div",{className:"e-separator-div"}),R=(0,t.createElement)("div",{className:"e-filter-option-container-1"}),k=(0,t.createElement)("div",{className:"e-level-option-container "+("olap"===this.parent.dataType?"":l)}),j=(0,t.createElement)("div",{className:"e-measure-option-container "+(["label","date","number"].indexOf(a)>=0?l:"")}),q=(0,t.createElement)("div",{className:"e-condition-option-container"}),H=(0,t.createElement)("div",{className:"e-filter-option-container-2"}),V=(0,t.createElement)("div",{id:this.parent.parentID+"_"+a+"_level_option_container"}),U=(0,t.createElement)("div",{id:this.parent.parentID+"_"+a+"_measure_option_container"}),B=(0,t.createElement)("div",{id:this.parent.parentID+"_"+a+"_contition_option_container"}),_=(0,t.createElement)("div",{className:"e-filter-input-div-1"}),G=(0,t.createElement)("div",{className:Le+" "+(-1===g.indexOf(p)?l:"")}),z=(0,t.createElement)("input",{id:this.parent.parentID+"_"+a+"_input_option_1",attrs:{type:"text"}}),W=(0,t.createElement)("input",{id:this.parent.parentID+"_"+a+"_input_option_2",attrs:{type:"text"}});return _.appendChild(z),G.appendChild(W),k.appendChild(V),k.appendChild(A.cloneNode(!0)),j.appendChild(U),j.appendChild(A),q.appendChild(B),R.appendChild(k),R.appendChild(j),R.appendChild(q),H.appendChild(_),H.appendChild(L),H.appendChild(G),this.createElements(i,g,["Top","Bottom"],U,B,z,W,n,r,h,p,a,V,s,u),I.appendChild(F),I.appendChild(R),I.appendChild(H),I},e.prototype.createElements=function(e,i,a,r,n,s,o,d,p,h,u,c,g,m,f){var v=this;if("olap"===this.parent.dataType){var S=new Ws.DropDownList({dataSource:m,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text",iconCss:"iconClass"},index:f,cssClass:"e-level-options"+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var i=v.dialogPopUp.element.querySelector(".e-selected-tab"),a=i.getAttribute("data-fieldName"),r=i.getAttribute("data-type");if(!(0,t.isNullOrUndefined)(i)){var n;v.updateInputValues(i,r,s,o),(0,_s.setStyleAndAttributes)(i,{"data-selectedField":e.value});for(var l=0,p=v.parent.dataSourceSettings.filterSettings;l<p.length;l++){var h=p[l];if(h.name===a&&h.selectedField===e.value){n=h;break}}if(n){"value"===r&&n.measure&&""!==n.measure&&(y.value=n.measure?n.measure:d[0].value),n.condition?b.value=n.condition?n.condition:"DoesNotEquals":b.value="DoesNotEquals";var u=void 0,c=void 0;"value"===r?(u=(0,t.getInstance)(s,zs.NumericTextBox),c=(0,t.getInstance)(o,zs.NumericTextBox),u&&(u.value=n.value1?parseInt(n.value1,10):void 0),c&&(c.value=n.value2?parseInt(n.value2,10):void 0)):(u=(0,t.getInstance)(s,zs.MaskedTextBox),c=(0,t.getInstance)(o,zs.MaskedTextBox),u&&(u.value=n.value1?n.value1:""),c&&(c.value=n.value2?n.value2:""))}v.updateInputValues(i,r,s,o)}}});S.isStringTemplate=!0,S.isAngular=this.parent.control.isModalDialog,S.appendTo(g)}var y=new Ws.DropDownList({dataSource:d,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text"},index:h,cssClass:Ae+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(e){var i=v.dialogPopUp.element.querySelector(".e-selected-tab");(0,t.isNullOrUndefined)(i)||(v.updateInputValues(i,c,s,o),(0,_s.setStyleAndAttributes)(i,{"data-measure":e.value}))}});y.isStringTemplate=!0,y.isAngular=this.parent.control.isModalDialog,y.appendTo(r);var b=new Ws.DropDownList({dataSource:p,enableRtl:this.parent.enableRtl,fields:{value:"value",text:"text"},value:u,cssClass:Re+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(r){var n=v.dialogPopUp.element.querySelector(".e-selected-tab");if(!(0,t.isNullOrUndefined)(n)){v.updateInputValues(n,c,s,o);for(var d=0,p=[Fe,Le];d<p.length;d++){var h=p[d];i.indexOf(r.value)>=0&&-1===a.indexOf(r.value)?(0,t.removeClass)([n.querySelector("."+h)],l):(0,t.addClass)([n.querySelector("."+h)],l)}if("value"===c)if(a.indexOf(r.value)>=0){var u=(0,t.getInstance)(s,zs.NumericTextBox);u&&(e&&e.condition===r.value||(0,t.isNullOrUndefined)(u.value)&&(u.value=10,(0,_s.setStyleAndAttributes)(n,{"data-value1":"10","data-value2":"10"})),v.validateTopBottomOKButton(s,r.value,a))}else{var g=v.dialogPopUp.element.querySelector("."+ie);g&&g.removeAttribute("disabled")}(0,_s.setStyleAndAttributes)(n,{"data-operator":r.value})}}});if(b.isStringTemplate=!0,b.isAngular=this.parent.control.isModalDialog,b.appendTo(n),"date"===c){var C=new eo.DateTimePicker({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,format:"dd/MM/yyyy hh:mm:ss a",showClearButton:!0,value:e&&u===e.condition?"string"==typeof e.value1?new Date(e.value1):e.value1:null,change:function(e){var i=v.dialogPopUp.element.querySelector(".e-selected-tab");(0,t.isNullOrUndefined)(i)||(0,_s.setStyleAndAttributes)(i,{"data-value1":e.value,"data-value2":x.value})},width:"100%",cssClass:this.parent.cssClass}),x=new eo.DateTimePicker({placeholder:this.parent.localeObj.getConstant("chooseDate"),enableRtl:this.parent.enableRtl,format:"dd/MM/yyyy hh:mm:ss a",showClearButton:!0,value:e&&u===e.condition?"string"==typeof e.value2?new Date(e.value2):e.value2:null,change:function(e){var i=v.dialogPopUp.element.querySelector(".e-selected-tab");(0,t.isNullOrUndefined)(i)||(0,_s.setStyleAndAttributes)(i,{"data-value1":C.value,"data-value2":e.value})},width:"100%",cssClass:this.parent.cssClass});C.isStringTemplate=!0,C.appendTo(s),x.isStringTemplate=!0,x.appendTo(o)}else if("value"===c){var w=a.indexOf(u)>=0,T=!w||e&&e.condition===u?e&&u===e.condition?parseInt(e.value1,10):void 0:10,M=new zs.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,format:"###.##",step:w?1:void 0,value:T,change:function(e){var i=v.dialogPopUp.element.querySelector(".e-selected-tab"),r=v.dialogPopUp.element,n=i.getAttribute("data-operator"),s=r.querySelector("."+ie);if(!(0,t.isNullOrUndefined)(i)){var o=null!==M.value&&void 0!==M.value?M.value.toString():"0",l=null!==e.value&&void 0!==e.value?e.value:0,d=l.toString();(0,_s.setStyleAndAttributes)(i,{"data-value1":o,"data-value2":d}),a.indexOf(n)>=0&&(l<=0?s.setAttribute("disabled","disabled"):s.removeAttribute("disabled"))}},width:"100%",cssClass:this.parent.cssClass}),D=new zs.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,format:"###.##",value:e&&u===e.condition?parseInt(e.value2,10):void 0,change:function(e){var i=v.dialogPopUp.element.querySelector(".e-selected-tab");(0,t.isNullOrUndefined)(i)||(0,_s.setStyleAndAttributes)(i,{"data-value1":M.value?M.value.toString():"0","data-value2":e.value?e.value.toString():"0"})},width:"100%",cssClass:this.parent.cssClass});M.isStringTemplate=!0,M.appendTo(s),D.isStringTemplate=!0,D.appendTo(o),setTimeout(function(){v.validateTopBottomOKButton(s,u,a)},0)}else{var O=new zs.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,value:e&&u===e.condition?e.value1:"",change:function(e){var i=v.dialogPopUp.element.querySelector(".e-selected-tab");(0,t.isNullOrUndefined)(i)||(0,_s.setStyleAndAttributes)(i,{"data-value1":e.value,"data-value2":N.value})},width:"100%",cssClass:this.parent.cssClass}),N=new zs.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,showClearButton:!0,value:e&&u===e.condition?e.value2:"",change:function(e){var i=v.dialogPopUp.element.querySelector(".e-selected-tab");(0,t.isNullOrUndefined)(i)||(0,_s.setStyleAndAttributes)(i,{"data-value1":O.value,"data-value2":e.value})},width:"100%",cssClass:this.parent.cssClass});O.isStringTemplate=!0,O.appendTo(s),N.isStringTemplate=!0,N.appendTo(o)}},e.prototype.updateInputValues=function(e,i,a,r){var n=(0,t.getInstance)(a,"date"===i?eo.DateTimePicker:"value"===i?zs.NumericTextBox:zs.MaskedTextBox),s=(0,t.getInstance)(r,"date"===i?eo.DateTimePicker:"value"===i?zs.NumericTextBox:zs.MaskedTextBox),o=(0,t.isNullOrUndefined)(n.value)?"":n.value.toString(),l=(0,t.isNullOrUndefined)(s.value)?"":s.value.toString();(0,_s.setStyleAndAttributes)(e,{"data-value1":o,"data-value2":l})},e.prototype.validateTreeNode=function(e){e.node.classList.contains(l)&&(e.cancel=!0)},e.prototype.updateCheckedState=function(){var e=this.dialogPopUp.element,i=[].slice.call(this.memberTreeView.element.querySelectorAll("li")),a=e.getAttribute("data-fieldname"),r=this.getUnCheckedNodes(a),n=this.getCheckedNodes(a),s=this.allMemberSelect.element.querySelector("li").querySelector("span."+$);if(i.length>0)if(n>0){if(r>0)(0,t.removeClass)([s],ee),(0,t.addClass)([s],te),this.allMemberSelect.element.querySelector("li").setAttribute("aria-checked","false");else 0===r&&((0,t.removeClass)([s],te),(0,t.addClass)([s],ee));this.setOKButtonState(!0)}else r>0&&0===n&&((0,t.removeClass)([s],[ee,te]),this.getCheckedNodes(a)===n&&this.setOKButtonState(!1));else this.setOKButtonState(!1)},e.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},e.prototype.getUnCheckedNodes=function(e){var t=[],i=[],a=this.parent.engineModule;if("olap"===this.parent.dataType&&a&&!a.fieldList[e].isHierarchy)return i=this.memberTreeView.getAllCheckedNodes(),this.memberTreeView.fields.dataSource.length-i.length;for(var r=0,n=this.parent.searchTreeItems;r<n.length;r++){var s=n[r];s.isSelected||t.push(s)}return t.length},e.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)},e.prototype.setOKButtonState=function(e){var t=this.dialogPopUp.element.querySelector("."+ie);t&&(e?t.removeAttribute("disabled"):t.setAttribute("disabled","disabled")),this.dialogPopUp.buttons&&this.dialogPopUp.buttons[0]&&(this.dialogPopUp.buttons[0].buttonModel.disabled=!e)},e.prototype.validateTopBottomOKButton=function(e,i,a){if(a.indexOf(i)>=0){var r=(0,t.getInstance)(e,zs.NumericTextBox);if(r){var n=null!==r.value&&void 0!==r.value?r.value:0;this.setOKButtonState(n>0)}}},e.prototype.getFilterObject=function(e){var t=Hs.getFilterItemByName(e,Hs.cloneFilterSettings(this.parent.dataSourceSettings.filterSettings));if(t&&(["Label","Date","Number"].indexOf(t.type)>=0&&this.parent.dataSourceSettings.allowLabelFilter||"Value"===t.type&&this.parent.dataSourceSettings.allowValueFilter||["Include","Exclude"].indexOf(t.type)>=0&&this.parent.eventBase.isValidFilterItemsAvail(e,t)))return t},e.prototype.wireEvent=function(e,i){t.EventHandler.add(e,"click",this.applySorting.bind(this,i),this)},e.prototype.unWireEvent=function(e){t.EventHandler.remove(e,"click",this.applySorting)},e.prototype.closeFilterDialog=function(){this.dialogPopUp.close()},e.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")&&(0,t.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")&&(0,t.remove)(document.getElementById(this.parent.parentID+"_EditorTreeView"))},e.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}}},e}(),ro=function(){function e(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 Js(this),this.dataSourceUpdate=new Zs(this),this.eventBase=new Xs(this),this.filterDialog=new ao(this),this.errorDialog=new $s(this),this.keyboardModule=new Ks(this),this}return e.prototype.destroy=function(){this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null)},e}(),no=function(){function e(e){this.parent=e,this.parent.commonModule=this,this.addEventListener()}return e.prototype.getModuleName=function(){return"common"},e.prototype.initiateCommonModule=function(){if(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.properties:this.parent.dataSourceSettings,this.parent.pivotCommon.moduleName=this.parent.getModuleName(),this.parent.pivotCommon.enableRtl=this.parent.enableRtl,this.parent.pivotCommon.isAdaptive=t.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;else{var e={pivotEngine:"olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,dataSourceSettings:this.parent.dataSourceSettings.properties?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:t.Browser.isDevice,renderMode:"Popup",localeObj:this.parent.localeObj,dataType:this.parent.dataType,cssClass:this.parent.cssClass};this.parent.pivotCommon=new ro(e)}this.parent.pivotCommon.control=this.parent},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(pr,this.initiateCommonModule,this),this.parent.on(hr,this.initiateCommonModule,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(pr,this.initiateCommonModule),this.parent.off(hr,this.initiateCommonModule))},e.prototype.destroy=function(){this.removeEventListener(),this.parent.pivotCommon&&(this.parent.pivotCommon.destroy(),this.parent.pivotCommon=null)},e}(),so=(e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)},function(t,i){function a(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}),oo=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;o>=0;o--)(r=e[o])&&(s=(n<3?r(s):n>3?r(t,i,s):r(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s},lo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return so(i,e),oo([(0,t.Property)()],i.prototype,"name",void 0),oo([(0,t.Property)()],i.prototype,"caption",void 0),oo([(0,t.Property)("Sum")],i.prototype,"type",void 0),oo([(0,t.Property)()],i.prototype,"axis",void 0),oo([(0,t.Property)(!1)],i.prototype,"showNoDataItems",void 0),oo([(0,t.Property)()],i.prototype,"baseField",void 0),oo([(0,t.Property)()],i.prototype,"baseItem",void 0),oo([(0,t.Property)(!0)],i.prototype,"showSubTotals",void 0),oo([(0,t.Property)(!1)],i.prototype,"isNamedSet",void 0),oo([(0,t.Property)(!1)],i.prototype,"isCalculatedField",void 0),oo([(0,t.Property)(!0)],i.prototype,"showFilterIcon",void 0),oo([(0,t.Property)(!0)],i.prototype,"showSortIcon",void 0),oo([(0,t.Property)(!0)],i.prototype,"showRemoveIcon",void 0),oo([(0,t.Property)(!0)],i.prototype,"showValueTypeIcon",void 0),oo([(0,t.Property)(!0)],i.prototype,"showEditIcon",void 0),oo([(0,t.Property)(!0)],i.prototype,"allowDragAndDrop",void 0),oo([(0,t.Property)()],i.prototype,"dataType",void 0),oo([(0,t.Property)(!1)],i.prototype,"expandAll",void 0),oo([(0,t.Property)()],i.prototype,"groupName",void 0),i}(t.ChildProperty),po=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return so(t,e),t}(lo),ho=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return so(i,e),oo([(0,t.Property)()],i.prototype,"backgroundColor",void 0),oo([(0,t.Property)()],i.prototype,"color",void 0),oo([(0,t.Property)()],i.prototype,"fontFamily",void 0),oo([(0,t.Property)()],i.prototype,"fontSize",void 0),i}(t.ChildProperty),uo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return so(i,e),oo([(0,t.Property)()],i.prototype,"name",void 0),oo([(0,t.Property)("Include")],i.prototype,"type",void 0),oo([(0,t.Property)()],i.prototype,"items",void 0),oo([(0,t.Property)("DoesNotEquals")],i.prototype,"condition",void 0),oo([(0,t.Property)()],i.prototype,"value1",void 0),oo([(0,t.Property)()],i.prototype,"value2",void 0),oo([(0,t.Property)()],i.prototype,"measure",void 0),oo([(0,t.Property)(1)],i.prototype,"levelCount",void 0),oo([(0,t.Property)()],i.prototype,"selectedField",void 0),i}(t.ChildProperty),co=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return so(i,e),oo([(0,t.Property)()],i.prototype,"measure",void 0),oo([(0,t.Property)()],i.prototype,"label",void 0),oo([(0,t.Property)()],i.prototype,"conditions",void 0),oo([(0,t.Property)()],i.prototype,"value1",void 0),oo([(0,t.Property)()],i.prototype,"value2",void 0),oo([(0,t.Property)()],i.prototype,"style",void 0),oo([(0,t.Property)(!0)],i.prototype,"applyGrandTotals",void 0),i}(t.ChildProperty),go=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return so(i,e),oo([(0,t.Property)()],i.prototype,"name",void 0),oo([(0,t.Property)("Ascending")],i.prototype,"order",void 0),oo([(0,t.Property)([])],i.prototype,"membersOrder",void 0),i}(t.ChildProperty),mo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return so(i,e),oo([(0,t.Property)()],i.prototype,"name",void 0),oo([(0,t.Property)()],i.prototype,"minimumFractionDigits",void 0),oo([(0,t.Property)()],i.prototype,"maximumFractionDigits",void 0),oo([(0,t.Property)()],i.prototype,"minimumSignificantDigits",void 0),oo([(0,t.Property)()],i.prototype,"maximumSignificantDigits",void 0),oo([(0,t.Property)(!0)],i.prototype,"useGrouping",void 0),oo([(0,t.Property)()],i.prototype,"skeleton",void 0),oo([(0,t.Property)()],i.prototype,"type",void 0),oo([(0,t.Property)()],i.prototype,"currency",void 0),oo([(0,t.Property)()],i.prototype,"minimumIntegerDigits",void 0),oo([(0,t.Property)()],i.prototype,"format",void 0),i}(t.ChildProperty),fo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return so(i,e),oo([(0,t.Property)()],i.prototype,"name",void 0),oo([(0,t.Property)()],i.prototype,"groupInterval",void 0),oo([(0,t.Property)()],i.prototype,"startingAt",void 0),oo([(0,t.Property)()],i.prototype,"endingAt",void 0),oo([(0,t.Property)("Date")],i.prototype,"type",void 0),oo([(0,t.Property)()],i.prototype,"rangeInterval",void 0),oo([(0,t.Property)()],i.prototype,"caption",void 0),oo([(0,t.Property)()],i.prototype,"customGroups",void 0),i}(t.ChildProperty),vo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return so(i,e),oo([(0,t.Property)()],i.prototype,"groupName",void 0),oo([(0,t.Property)([])],i.prototype,"items",void 0),i}(t.ChildProperty),So=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return so(i,e),oo([(0,t.Property)()],i.prototype,"name",void 0),oo([(0,t.Property)()],i.prototype,"formula",void 0),oo([(0,t.Property)()],i.prototype,"hierarchyUniqueName",void 0),oo([(0,t.Property)()],i.prototype,"formatString",void 0),i}(t.ChildProperty),yo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return so(i,e),oo([(0,t.Property)()],i.prototype,"name",void 0),oo([(0,t.Property)()],i.prototype,"items",void 0),oo([(0,t.Property)()],i.prototype,"delimiter",void 0),i}(t.ChildProperty),bo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return so(i,e),oo([(0,t.Property)()],i.prototype,"headerText",void 0),oo([(0,t.Property)(".")],i.prototype,"headerDelimiter",void 0),oo([(0,t.Property)("None")],i.prototype,"sortOrder",void 0),oo([(0,t.Property)()],i.prototype,"rowHeaderText",void 0),oo([(0,t.Property)("Ascending")],i.prototype,"rowSortOrder",void 0),oo([(0,t.Property)()],i.prototype,"columnHeaderText",void 0),oo([(0,t.Property)("Ascending")],i.prototype,"columnSortOrder",void 0),oo([(0,t.Property)()],i.prototype,"measure",void 0),i}(t.ChildProperty),Co=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return so(i,e),oo([(0,t.Property)()],i.prototype,"userName",void 0),oo([(0,t.Property)()],i.prototype,"password",void 0),i}(t.ChildProperty),xo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return so(i,e),oo([(0,t.Property)("Local")],i.prototype,"mode",void 0),oo([(0,t.Property)()],i.prototype,"catalog",void 0),oo([(0,t.Property)()],i.prototype,"cube",void 0),oo([(0,t.Property)()],i.prototype,"roles",void 0),oo([(0,t.Property)("Relational")],i.prototype,"providerType",void 0),oo([(0,t.Property)()],i.prototype,"url",void 0),oo([(0,t.Property)(1033)],i.prototype,"localeIdentifier",void 0),oo([(0,t.Property)()],i.prototype,"dataSource",void 0),oo([(0,t.Collection)([],lo)],i.prototype,"rows",void 0),oo([(0,t.Collection)([],lo)],i.prototype,"columns",void 0),oo([(0,t.Collection)([],lo)],i.prototype,"values",void 0),oo([(0,t.Collection)([],lo)],i.prototype,"filters",void 0),oo([(0,t.Collection)([],lo)],i.prototype,"fieldMapping",void 0),oo([(0,t.Property)([])],i.prototype,"excludeFields",void 0),oo([(0,t.Property)(!1)],i.prototype,"expandAll",void 0),oo([(0,t.Property)("column")],i.prototype,"valueAxis",void 0),oo([(0,t.Property)(-1)],i.prototype,"valueIndex",void 0),oo([(0,t.Collection)([],uo)],i.prototype,"filterSettings",void 0),oo([(0,t.Collection)([],go)],i.prototype,"sortSettings",void 0),oo([(0,t.Property)(!0)],i.prototype,"enableSorting",void 0),oo([(0,t.Property)("JSON")],i.prototype,"type",void 0),oo([(0,t.Property)(!0)],i.prototype,"allowMemberFilter",void 0),oo([(0,t.Property)(!1)],i.prototype,"allowLabelFilter",void 0),oo([(0,t.Property)(!1)],i.prototype,"allowValueFilter",void 0),oo([(0,t.Property)(!0)],i.prototype,"showSubTotals",void 0),oo([(0,t.Property)(!0)],i.prototype,"showRowSubTotals",void 0),oo([(0,t.Property)(!0)],i.prototype,"showColumnSubTotals",void 0),oo([(0,t.Property)("Auto")],i.prototype,"subTotalsPosition",void 0),oo([(0,t.Property)(!0)],i.prototype,"showGrandTotals",void 0),oo([(0,t.Property)("Bottom")],i.prototype,"grandTotalsPosition",void 0),oo([(0,t.Property)(!0)],i.prototype,"showRowGrandTotals",void 0),oo([(0,t.Property)(!0)],i.prototype,"showColumnGrandTotals",void 0),oo([(0,t.Property)(!1)],i.prototype,"alwaysShowValueHeader",void 0),oo([(0,t.Property)(!0)],i.prototype,"showHeaderWhenEmpty",void 0),oo([(0,t.Property)(!0)],i.prototype,"showAggregationOnValueField",void 0),oo([(0,t.Collection)([],mo)],i.prototype,"formatSettings",void 0),oo([(0,t.Collection)([],yo)],i.prototype,"drilledMembers",void 0),oo([(0,t.Complex)({},bo)],i.prototype,"valueSortSettings",void 0),oo([(0,t.Collection)([],So)],i.prototype,"calculatedFieldSettings",void 0),oo([(0,t.Collection)([],co)],i.prototype,"conditionalFormatSettings",void 0),oo([(0,t.Property)()],i.prototype,"emptyCellsTextContent",void 0),oo([(0,t.Collection)([],fo)],i.prototype,"groupSettings",void 0),oo([(0,t.Complex)({},Co)],i.prototype,"authentication",void 0),i}(t.ChildProperty),wo=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function a(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),To=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;o>=0;o--)(r=e[o])&&(s=(n<3?r(s):n>3?r(t,i,s):r(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s},Mo=(function(e){function i(){return null!==e&&e.apply(this,arguments)||this}wo(i,e),To([(0,t.Property)("Row")],i.prototype,"mode",void 0),To([(0,t.Property)("Flow")],i.prototype,"cellSelectionMode",void 0),To([(0,t.Property)("Single")],i.prototype,"type",void 0),To([(0,t.Property)(!1)],i.prototype,"checkboxOnly",void 0),To([(0,t.Property)(!1)],i.prototype,"persistSelection",void 0),To([(0,t.Property)("Default")],i.prototype,"checkboxMode",void 0),To([(0,t.Property)(!1)],i.prototype,"enableSimpleMultiRowSelection",void 0)}(t.ChildProperty),function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return wo(i,e),To([(0,t.Property)("auto")],i.prototype,"height",void 0),To([(0,t.Property)("auto")],i.prototype,"width",void 0),To([(0,t.Property)("Both")],i.prototype,"gridLines",void 0),To([(0,t.Property)(!1)],i.prototype,"allowTextWrap",void 0),To([(0,t.Property)(!1)],i.prototype,"allowReordering",void 0),To([(0,t.Property)(!0)],i.prototype,"allowResizing",void 0),To([(0,t.Property)(!0)],i.prototype,"allowAutoResizing",void 0),To([(0,t.Property)(null)],i.prototype,"rowHeight",void 0),To([(0,t.Property)(110)],i.prototype,"columnWidth",void 0),To([(0,t.Property)("Compact")],i.prototype,"layout",void 0),To([(0,t.Property)("Ellipsis")],i.prototype,"clipMode",void 0),To([(0,t.Property)(!1)],i.prototype,"repeatItemLabels",void 0),To([(0,t.Property)(!1)],i.prototype,"allowSelection",void 0),To([(0,t.Property)(-1)],i.prototype,"selectedRowIndex",void 0),To([(0,t.Property)({mode:"Row",cellSelectionMode:"Flow",type:"Single"})],i.prototype,"selectionSettings",void 0),To([(0,t.Property)({wrapMode:"Both"})],i.prototype,"textWrapSettings",void 0),To([(0,t.Property)("AllPages")],i.prototype,"printMode",void 0),To([(0,t.Property)()],i.prototype,"contextMenuItems",void 0),To([(0,t.Event)()],i.prototype,"beforeCopy",void 0),To([(0,t.Event)()],i.prototype,"printComplete",void 0),To([(0,t.Event)()],i.prototype,"beforePrint",void 0),To([(0,t.Event)()],i.prototype,"beforePdfExport",void 0),To([(0,t.Event)()],i.prototype,"beforeExcelExport",void 0),To([(0,t.Event)()],i.prototype,"contextMenuOpen",void 0),To([(0,t.Event)()],i.prototype,"contextMenuClick",void 0),To([(0,t.Event)()],i.prototype,"queryCellInfo",void 0),To([(0,t.Event)()],i.prototype,"headerCellInfo",void 0),To([(0,t.Event)()],i.prototype,"rowSelecting",void 0),To([(0,t.Event)()],i.prototype,"rowSelected",void 0),To([(0,t.Event)()],i.prototype,"rowDeselecting",void 0),To([(0,t.Event)()],i.prototype,"rowDeselected",void 0),To([(0,t.Event)()],i.prototype,"cellSelecting",void 0),To([(0,t.Event)()],i.prototype,"cellSelected",void 0),To([(0,t.Event)()],i.prototype,"cellDeselecting",void 0),To([(0,t.Event)()],i.prototype,"cellDeselected",void 0),To([(0,t.Event)()],i.prototype,"resizeStart",void 0),To([(0,t.Event)()],i.prototype,"resizing",void 0),To([(0,t.Event)()],i.prototype,"resizeStop",void 0),To([(0,t.Event)()],i.prototype,"pdfHeaderQueryCellInfo",void 0),To([(0,t.Event)()],i.prototype,"pdfQueryCellInfo",void 0),To([(0,t.Event)()],i.prototype,"excelHeaderQueryCellInfo",void 0),To([(0,t.Event)()],i.prototype,"excelQueryCellInfo",void 0),To([(0,t.Event)()],i.prototype,"columnDragStart",void 0),To([(0,t.Event)()],i.prototype,"columnDrag",void 0),To([(0,t.Event)()],i.prototype,"columnDrop",void 0),To([(0,t.Event)()],i.prototype,"columnRender",void 0),i}(t.ChildProperty)),Do=function(){function e(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 t.KeyboardEvents(this.parent.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"})}return e.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)}},e.prototype.getNextButton=function(e){var i=this.allpivotButtons(e);if((0,t.removeClass)(i,"e-btn-focused"),this.parent.grid.element.querySelector("."+A))for(var a=i.length,r=0;r<a;r++)if(i[r].getAttribute("data-uid")===e.getAttribute("data-uid"))return i[r+1]?i[r+1]:e;return e},e.prototype.getPrevButton=function(e){var i=this.allpivotButtons(e);if((0,t.removeClass)(i,"e-btn-focused"),this.parent.grid.element.querySelector("."+A))for(var a=i.length,r=0;r<a;r++)if(i[r].getAttribute("data-uid")===e.getAttribute("data-uid"))return i[r-1]?i[r-1]:e;return e},e.prototype.allpivotButtons=function(e){var i=[];if(e&&this.parent.showGroupingBar){var a=(0,t.closest)(e,"."+hi),r=(0,t.closest)(e,"."+gi),n=(0,t.closest)(e,"."+li),s=e.classList.contains(Ge),o=void 0,l=void 0,d=void 0;if(null!==a?l=a.classList.contains(hi):null!==r?d=r.classList.contains(gi):null!==n&&(o=n.classList.contains(li)),l||d||s){var p=[].slice.call(this.parent.element.querySelector("."+hi).querySelectorAll("."+A)),h=[].slice.call(this.parent.element.querySelector("."+gi).querySelectorAll("."+A));i=p.concat(h)}else o&&(i=[].slice.call(this.parent.element.querySelector("."+li).querySelectorAll("."+A)))}return i},e.prototype.processTab=function(e){var i=e.target;if(i&&((0,t.closest)(i,"."+A)||i.classList.contains("e-group-row"))){if(this.parent.grid){var a=this.parent.grid.serviceLocator.getService("focus");if(i.classList.contains("e-group-row")&&i.querySelector(".e-btn-focused"))i=i.querySelector(".e-btn-focused");else if(i.classList.contains("e-group-row")){a.focus();var r=a.getFocusedElement();return(0,t.addClass)([r],["e-focused","e-focus"]),r.setAttribute("tabindex","0"),void e.preventDefault()}var n=this.getNextButton(i);if(n.getAttribute("data-uid")!==i.getAttribute("data-uid"))this.parent.element.querySelector(".e-focused")?(this.parent.element.querySelector(".e-focused").setAttribute("tabindex","-1"),(0,t.removeClass)(this.parent.element.querySelectorAll(".e-focus"),"e-focus"),(0,t.removeClass)(this.parent.element.querySelectorAll(".e-focused"),"e-focused"),a.setFocusedElement(this.parent.element.querySelector(".e-headercell")),this.parent.element.querySelector(".e-headercell").setAttribute("tabindex","0")):a.currentInfo.skipAction=!0,(0,t.addClass)([n],"e-btn-focused"),n.focus();else{a.focus();r=a.getFocusedElement();(0,t.addClass)([r],["e-focused","e-focus"]),r.setAttribute("tabindex","0")}return void e.preventDefault()}}else if(!this.parent.showGroupingBar&&this.parent.showFieldList&&i&&(0,t.closest)(i,"."+f)){if(this.parent.grid){(a=this.parent.grid.serviceLocator.getService("focus")).focus();r=a.getFocusedElement();return(0,t.addClass)([r],["e-focused","e-focus"]),r.setAttribute("tabindex","0"),void e.preventDefault()}}else if(this.parent.showGroupingBar||this.parent.showFieldList||!i||!(0,t.closest)(i,"."+vt)||(0,t.closest)(i,"."+fi)||(0,t.closest)(i,".e-popup.e-popup-open")){if(i&&(0,t.closest)(i,"."+Zt)&&this.parent.toolbar&&this.parent.toolbarModule)clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){(0,t.removeClass)((0,t.closest)(i,"."+Zt).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),document.activeElement&&document.activeElement.classList.contains("e-menu-item")&&(0,t.addClass)([document.activeElement],"e-focused")});else if(i.classList.contains("e-numerictextbox")&&!(0,t.closest)(i,"."+fi)){(a=this.parent.grid.serviceLocator.getService("focus")).focus();r=a.getFocusedElement();(0,t.removeClass)([r],["e-focused","e-focus"]),r.setAttribute("tabindex","0"),e.preventDefault()}}else if(this.parent.grid){var s=(0,t.closest)(i,"."+vt),a=this.parent.grid.serviceLocator.getService("focus"),o=[].slice.call(s.getElementsByTagName("tr")),l=o[o.length-1].lastChild;if(!(i===l)){a.focus();var r=a.getFocusedElement();return(0,t.addClass)([r],["e-focused","e-focus"]),r.setAttribute("tabindex","0"),void e.preventDefault()}a.currentInfo.skipAction=!0}},e.prototype.processShiftTab=function(e){var i=e.target;if(i&&((0,t.closest)(i,"."+A)||i.classList.contains("e-group-row"))){if(this.parent.grid){var a=this.parent.grid.serviceLocator.getService("focus");if(i.classList.contains("e-group-row")&&i.querySelector(".e-btn-focused"))i=i.querySelector(".e-btn-focused");else if(i.classList.contains("e-group-row")){i=this.parent.element.querySelector(".e-btn-focused")?this.parent.element.querySelector(".e-btn-focused"):this.parent.element.querySelector("."+hi);var r=this.allpivotButtons(i);if(r.length>0&&r[r.length-1])return a.currentInfo.skipAction=!0,r[r.length-1].focus(),(0,t.removeClass)(r,"e-btn-focused"),(0,t.addClass)([r[r.length-1]],"e-btn-focused"),void e.preventDefault()}var n=this.getPrevButton(i);if(n.getAttribute("data-uid")!==i.getAttribute("data-uid"))return a.currentInfo.skipAction=!0,n.focus(),void e.preventDefault()}}else if(i&&this.parent.grid&&(i.classList.contains("e-movablefirst")||i.classList.contains("e-rowsheader")&&(0,t.closest)(i,"tr").getAttribute("data-uid")===this.parent.grid.element.querySelector(".e-frozencontent tr").getAttribute("data-uid"))){a=this.parent.grid.serviceLocator.getService("focus");if(i.classList.contains("e-movablefirst")){i=this.parent.element.querySelector("."+ue+" .e-btn-focused")?this.parent.element.querySelector("."+ue+" .e-btn-focused"):this.parent.element.querySelector("."+ue);var s=a.getFocusedElement();(0,t.removeClass)([s],["e-focused","e-focus"])}var o=this.allpivotButtons(i);if(o.length>0)return a.currentInfo.skipAction=!0,setTimeout(function(){o[o.length-1].focus()}),(0,t.removeClass)(o,"e-btn-focused"),(0,t.addClass)([o[o.length-1]],"e-btn-focused"),void e.preventDefault()}else if(i&&(0,t.closest)(i,"."+Zt)&&this.parent.toolbar&&this.parent.toolbarModule)clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(function(){(0,t.removeClass)((0,t.closest)(i,"."+Zt).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),document.activeElement&&document.activeElement.classList.contains("e-menu-item")&&(0,t.addClass)([document.activeElement],"e-focused")});else if(i.classList.contains("e-numerictextbox")&&!(0,t.closest)(i,"."+fi)){(a=this.parent.grid.serviceLocator.getService("focus")).focus();s=a.getFocusedElement();(0,t.removeClass)([s],["e-focused","e-focus"]),s.setAttribute("tabindex","0"),e.preventDefault()}},e.prototype.processEnter=function(e){var i=e.target;if(i&&(0,t.closest)(i,"."+ft)){var a=this.parent.grid.serviceLocator.getService("focus");if(13!==e.keyCode||e.shiftKey||e.ctrlKey)if(13===e.keyCode&&e.shiftKey&&!e.ctrlKey){if(this.parent.enableValueSorting){this.event=e,i.click(),a.focus();r=a.getFocusedElement();(0,t.addClass)([r],["e-focused","e-focus"]),r.setAttribute("tabindex","0")}}else 13===e.keyCode&&!e.shiftKey&&e.ctrlKey&&this.parent.hyperlinkSettings&&i.querySelector("a")&&i.querySelector("a").click();else if(i.querySelector("."+o)){this.event=e,i.querySelector("."+o).click(),a.focus();var r=a.getFocusedElement();(0,t.addClass)([r],["e-focused","e-focus"]),r.setAttribute("tabindex","0")}else if(i.classList.contains("e-valuescontent"))i.dispatchEvent(new MouseEvent("dblclick",{view:window,bubbles:!0,cancelable:!0})),i.querySelector(".e-numerictextbox")&&i.click();else if(i.classList.contains("e-numerictextbox")){a.focus();var r=a.getFocusedElement();(0,t.removeClass)([r],["e-focused","e-focus"])}e.preventDefault()}else;},e.prototype.clearSelection=function(){var e=this.parent;(0,t.removeClass)(e.element.querySelectorAll("."+jt+",."+qt),[qt,jt,_t]),this.parent&&this.parent.renderModule&&this.parent.renderModule.selected()},e.prototype.processSelection=function(e){var i=e.target;if(this.parent.grid&&this.parent.gridSettings.allowSelection&&"Row"!==this.parent.gridSettings.selectionSettings.mode&&!i.classList.contains("e-numerictextbox")){var a,r=this.parent,n=parseInt(e.target.getAttribute("aria-colindex"),10)-1,s=Number(e.target.getAttribute("index"));if("TH"!==i.nodeName&&"TD"!==i.nodeName||(a="shiftUp"===e.action||"upArrow"===e.action?0===s||0===n||"TH"!==i.nodeName&&r.renderModule.rowStartPos!==s?null:this.getParentElement(r,a,n,s-1):"shiftDown"===e.action||"downArrow"===e.action?r.element.querySelector('th[aria-colindex="'+(n+1)+'"][index="'+(s+1)+'"]'):"shiftLeft"===e.action||"leftArrow"===e.action?e.target.previousSibling:e.target.nextSibling),(0,t.isNullOrUndefined)(a))"upArrow"===e.action?(a=r.element.querySelector('[aria-colindex="'+(n+1)+'"][index="'+(s-1)+'"]'),s--):"downArrow"===e.action&&(a=r.element.querySelector('[aria-colindex="'+(n+1)+'"][index="'+(s+1)+'"]'),s++),(0,t.isNullOrUndefined)(a)||r.clearSelection(a,e);else if("Both"===r.gridSettings.selectionSettings.mode&&a.classList.contains(Bt))r.clearSelection(a,e);else{n=parseInt(a.getAttribute("aria-colindex"),10)-1,s=Number(a.getAttribute("index"));var o=Number(a.getAttribute("aria-colspan"));r.clearSelection(a,e);var l={cancel:!1,isCellClick:!0,currentCell:a,data:r.pivotValues[s][n]};r.trigger($i,l,function(t){t.cancel||r.applyColumnSelection(e,a,n,n+(o>0?o-1:0),s)})}}else if(i&&(37===e.keyCode||38===e.keyCode)&&this.parent&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&!i.classList.contains("e-numerictextbox")){if(this.parent.grid&&this.parent.element.querySelector(".e-frozenheader")&&this.parent.element.querySelector(".e-frozenheader").querySelectorAll(".e-focus").length>0)return(0,t.removeClass)(this.parent.element.querySelector(".e-frozenheader").querySelectorAll(".e-focus"),"e-focus"),(0,t.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(i),(0,t.addClass)([i],["e-focused","e-focus"]),i.setAttribute("tabindex","0"),i.focus(),void e.preventDefault()}else!i.classList.contains("e-numerictextbox")||"rightArrow"!==e.action&&"leftArrow"!==e.action||i.click()},e.prototype.getParentElement=function(e,t,i,a){for(;!t;)t=e.element.querySelector('[aria-colindex="'+(i+1)+'"][index="'+a+'"]'),i--;return t},e.prototype.toggleFieldList=function(e){if(this.parent&&!this.parent.isDestroyed&&this.parent.showFieldList&&this.parent.pivotFieldListModule&&!this.parent.pivotFieldListModule.isDestroyed&&this.parent.element.querySelector("."+f)){if(!this.parent.element.querySelector("."+f).classList.contains(d))return this.parent.element.querySelector("."+f).click(),void e.preventDefault();this.parent.element.querySelector("."+f).classList.contains(d)&&this.parent.pivotFieldListModule.dialogRenderer&&this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog&&!this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.isDestroyed&&this.parent.pivotFieldListModule.dialogRenderer.fieldListDialog.hide()}},e.prototype.destroy=function(){this.timeOutObj&&(clearTimeout(this.timeOutObj),this.timeOutObj=null),this.event=null,this.pivotViewKeyboardModule&&(this.pivotViewKeyboardModule.destroy(),this.pivotViewKeyboardModule=null)},e}(),Oo=function(){function e(e){this.parent=e,this.parent.contextMenuModule=this}return e.prototype.render=function(){this.renderContextMenu()},e.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"}],i={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)},a=(0,t.createElement)("ul",{id:this.parent.element.id+"_PivotContextMenu"});this.parent.element.appendChild(a),this.menuObj=new Gs.ContextMenu(i),this.menuObj.isStringTemplate=!0,this.menuObj.isAngular=this.parent.isModalDialog,this.menuObj.appendTo(a)},e.prototype.onBeforeMenuOpen=function(e){var i=[].slice.call(e.element.querySelectorAll("li")),a="olap"===this.parent.dataType?this.fieldElement.getAttribute("data-type"):this.fieldElement.querySelector("."+k).getAttribute("data-type");if((0,t.removeClass)(i,yt),"CalculatedField"===a||"isMeasureFieldsAvail"===a)for(var r=0,n=i;r<n.length;r++){(u=n[r]).textContent!==this.parent.localeObj.getConstant("addToValue")&&(0,t.addClass)([u],yt)}else if("isMeasureAvail"===a)for(var s=0,o=i;s<o.length;s++){(u=o[s]).textContent!==this.parent.localeObj.getConstant("addToRow")&&u.textContent!==this.parent.localeObj.getConstant("addToColumn")&&(0,t.addClass)([u],yt)}else if("olap"===this.parent.dataType)for(var l=0,d=i;l<d.length;l++){if((u=d[l]).textContent===this.parent.localeObj.getConstant("addToValue")){(0,t.addClass)([u],yt);break}}else if("true"===this.fieldElement.getAttribute("isvalue"))for(var p=0,h=i;p<h.length;p++){var u;(u=h[p]).textContent!==this.parent.localeObj.getConstant("addToValue")&&u.textContent!==this.parent.localeObj.getConstant("addToFilter")||(0,t.addClass)([u],yt)}},e.prototype.onSelectContextMenu=function(e){if(null!==e.element.textContent){var t=this.fieldElement.getAttribute("data-uid"),i=e.item.id.replace(this.parent.element.id+"_","").toLowerCase();this.parent.pivotCommon.dataSourceUpdate.control="pivotview"===this.parent.getModuleName()?this.parent:this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent,this.parent.pivotCommon.dataSourceUpdate.btnElement=this.fieldElement,this.parent.pivotCommon.dataSourceUpdate.updateDataSource(t,i,-1),this.parent.updateDataSource(!0),this.fieldElement=void 0}},e.prototype.destroy=function(){this.parent.isDestroyed&&this.menuObj&&!this.menuObj.isDestroyed&&(this.menuObj.destroy(),(0,t.select)("#"+this.parent.element.id+"_PivotContextMenu",document)&&(0,t.remove)((0,t.select)("#"+this.parent.element.id+"_PivotContextMenu",document)))},e}(),No=function(){function e(e){this.previousValues={top:0,left:0},this.frozenPreviousValues={top:0,left:0},this.eventType="",this.isFireFox=t.Browser.userAgent.toLowerCase().indexOf("firefox")>-1,this.isScrolling=!1,this.boundElements=[],this.scrollingDirection="Up",(0,t.initializeTelemetryFeature)("VirtualScroll","PivotTable"),this.parent=e,this.addInternalEvents()}return e.prototype.getModuleName=function(){return"virtualscroll"},e.prototype.addInternalEvents=function(){this.parent.isDestroyed||this.parent.on(mr,this.wireEvents,this)},e.prototype.wireEvents=function(){if(this.engineModule="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,"Chart"!==this.parent.displayOption.view){this.clearAllEventHandlers();var e=this.parent.element.querySelector("."+At),i=this.parent.element.querySelector("."+Qt),a=this.parent.element.querySelector("."+kt),r=i.querySelector("."+Lt);if(this.boundElements=[e,i,a,r],this.engineModule){var n=this.parent.isAdaptive?e:i.querySelector("."+Lt);if(t.EventHandler.add(n,"scroll touchmove pointermove",this.onHorizondalScroll(a,e,r),this),t.EventHandler.add(e.parentElement,"scroll wheel touchmove pointermove",this.onHorizondalScroll(a,e,r),this),t.EventHandler.add(e.parentElement,"scroll wheel touchmove pointermove keyup keydown",this.onVerticalScroll(e.parentElement,e),this),this.isFireFox)t.EventHandler.add(n,"mouseup touchend scroll",this.common(a,e,e),this),this.parent.isAdaptive||t.EventHandler.add(e.parentElement,"mouseup touchend scroll",this.common(a,e.parentElement,e),this);else{var s=this.parent&&this.parent.dataSourceSettings&&"Server"===this.parent.dataSourceSettings.mode?"mouseup touchend":"mouseup touchend scroll";t.EventHandler.add(n,s,this.common(a,e,e),this),this.parent.isAdaptive||t.EventHandler.add(e.parentElement,s,this.common(a,e.parentElement,e),this)}t.EventHandler.add(r,"scroll",this.onCustomScrollbarScroll(e,a),this),t.EventHandler.add(e,"scroll",this.onCustomScrollbarScroll(r,a),this),t.EventHandler.add(a,"scroll",this.onCustomScrollbarScroll(r,e),this),t.EventHandler.add(a,"touchstart pointerdown",this.setPageXY(),this),t.EventHandler.add(a,"touchmove pointermove",this.onTouchScroll(a,e),this),t.EventHandler.add(e,"touchstart pointerdown",this.setPageXY(),this),t.EventHandler.add(e,"touchmove pointermove",this.onTouchScroll(a,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}},e.prototype.clearAllEventHandlers=function(){this.verticalScrollTimeoutObj&&(clearTimeout(this.verticalScrollTimeoutObj),this.verticalScrollTimeoutObj=null),this.horizontalScrollTimeoutObj&&(clearTimeout(this.horizontalScrollTimeoutObj),this.horizontalScrollTimeoutObj=null),this.boundElements.forEach(function(e){e&&t.EventHandler.clearEvents(e)}),this.boundElements=[],this.parent&&this.parent.grid&&(this.parent.grid.off("check-scroll-reset"),this.parent.grid.off("prevent-frozen-scroll-refresh"))},e.prototype.onWheelScroll=function(e){var t=this,i=e;return function(e){var a=i.scrollTop+(1===e.deltaMode?30*e.deltaY:e.deltaY);t.frozenPreviousValues.top!==a&&(e.preventDefault(),t.frozenPreviousValues.top=a,t.eventType=e.type)}},e.prototype.getPointXY=function(e){var t={x:0,y:0};return e.touches&&e.touches.length?(t.x=e.touches[0].pageX,t.y=e.touches[0].pageY):(t.x=e.pageX,t.y=e.pageY),t},e.prototype.onCustomScrollbarScroll=function(e,t){var i=this,a=e,r=t;return function(e){if(null!==i.parent.element.querySelector("."+R).querySelector("tbody")){var t=e.target,n=t.scrollLeft;i.previousValues.left===n||i.isFireFox&&t.classList.contains(kt)||(a.scrollLeft=n,r.scrollLeft=n,i.parent.isDestroyed)}}},e.prototype.onTouchScroll=function(e,t){var i=this,a=t;return function(r){if("mouse"!==r.pointerType){var n=i.getPointXY(r),s=i.parent.element.querySelector("."+ft+" ."+R).scrollTop+(i.pageXY.y-n.y),o=i.parent.isAdaptive?t:a.parentElement.parentElement.querySelector("."+Lt),l=o.scrollLeft+(i.pageXY.x-n.x);i.frozenPreviousValues.left===l||l<0||(e.scrollLeft=l,o.scrollLeft=l,i.pageXY.x=n.x,i.frozenPreviousValues.left=l,i.frozenPreviousValues.top===s||s<0||(i.pageXY.y=n.y,i.frozenPreviousValues.top=s,i.eventType=r.type))}}},e.prototype.update=function(e,i,a,r,n,s){var o=this,l=this.parent.element.querySelector("."+At);this.parent.isScrolling=!0;var d="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule,p={dataSourceSettings:Hs.getClonedDataSourceSettings(this.parent.dataSourceSettings)},h=this.parent.virtualScrollSettings&&this.parent.virtualScrollSettings.allowSinglePage&&"pivot"===this.parent.dataType,u=this.parent.engineModule?this.parent.engineModule.viewportPageCount:3;if(this.parent.pageSettings&&d.pageSettings){if("vertical"===this.direction){var c=s.parentElement.scrollHeight-(e+s.parentElement.offsetHeight),g="pivot"===this.parent.dataType&&"row"===this.parent.dataSourceSettings.valueAxis?this.parent.dataSourceSettings.values.length:1,m=this.parent.pageSettings.rowPageSize*g*this.parent.gridSettings.rowHeight,f="Up"===this.scrollingDirection?Math.ceil(e/m):Math.ceil(e/m)-1;if(f+=h&&c<=0?1:0,(this.parent.scrollPosObject.vertical===f||d.pageSettings.rowPageSize>=d.rowCount||l&&l.scrollHeight<l.parentElement.clientHeight*u)&&!h)return;this.parent.actionObj.actionName=cr,h&&this.parent.grid&&this.parent.grid.element.querySelector(".e-spinner-inner")&&(0,t.addClass)([this.parent.grid.element.querySelector(".e-spinner-inner")],[xi]),this.parent.actionBeginMethod(),this.parent.scrollPosObject.vertical=f,this.parent.pageSettings.currentRowPage=d.pageSettings.currentRowPage=f>1?f:1;var v=0;this.parent.trigger(Pi,p,function(){"pivot"===o.parent.dataType?"Server"===o.parent.dataSourceSettings.mode?o.parent.getEngine("onScroll",null,null,null,null,null,null):(o.parent.engineModule.generateGridData(o.parent.dataSourceSettings,!0,!1,o.parent.engineModule.headerCollection,!0),v=o.parent.engineModule.rowStartPos):(o.parent.olapEngineModule.scrollPage(),v=o.parent.olapEngineModule.pageRowStartPos),o.enginePopulatedEventMethod(d)});var S=m*Math.ceil(v/(this.parent.pageSettings.rowPageSize*g))-d.rowFirstLvl*g*this.parent.gridSettings.rowHeight;this.parent.scrollPosObject.verticalSection=S}else{var y=r.scrollWidth-(r.scrollLeft+r.offsetWidth),b="pivot"===this.parent.dataType&&"column"===this.parent.dataSourceSettings.valueAxis?this.parent.dataSourceSettings.values.length:1,C=(m=this.parent.pageSettings.columnPageSize*b*this.parent.gridSettings.columnWidth,f=Math.ceil(Math.abs(i)/m),this.parent.virtualScrollSettings&&this.parent.virtualScrollSettings.allowSinglePage&&"pivot"===this.parent.dataType);if(f+=C&&y<=0?1:0,(this.parent.scrollPosObject.horizontal===f||l&&l.scrollWidth<l.parentElement.clientWidth*u)&&!C)return;this.parent.actionObj.actionName=gr,C&&this.parent.grid&&this.parent.grid.element.querySelector(".e-spinner-inner")&&((0,t.addClass)([this.parent.grid.element.querySelector(".e-spinner-inner")],[xi]),n&&(0,t.removeClass)([n,s],["e-virtual-pivot-content"])),this.parent.actionBeginMethod(),C||this.parent.showWaitingPopup();var x=this.parent;x.scrollPosObject.horizontal=f,this.parent.pageSettings.currentColumnPage=d.pageSettings.currentColumnPage=f>1?f:1;var w=0;this.parent.trigger(Pi,p,function(){"pivot"===x.dataType?"Server"===o.parent.dataSourceSettings.mode?o.parent.getEngine("onScroll",null,null,null,null,null,null):(x.engineModule.generateGridData(x.dataSourceSettings,!0,!1,x.engineModule.headerCollection),w=x.engineModule.colStartPos):(x.olapEngineModule.scrollPage(),w=x.olapEngineModule.pageColStartPos),o.enginePopulatedEventMethod(d)});S=m*Math.ceil(w/(x.pageSettings.columnPageSize*b))-d.colFirstLvl*b*x.gridSettings.columnWidth;x.scrollPosObject.horizontalSection=S}this.parent.actionObj.actionName=this.parent.getActionCompleteName(),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()}},e.prototype.enginePopulatedEventMethod=function(e,t){var i=this,a=t||this.parent,r={dataSourceSettings:a.dataSourceSettings,pivotValues:e.pivotValues};a.trigger(Ei,r,function(e){i.parent.pivotValues=e.pivotValues})},e.prototype.setPageXY=function(){var e=this;return function(t){"mouse"!==t.pointerType&&(e.pageXY=e.getPointXY(t))}},e.prototype.common=function(e,i,a){var r=this;return function(n){var s=r.parent.virtualScrollSettings&&r.parent.virtualScrollSettings.allowSinglePage&&"pivot"===r.parent.dataType;if(r.isScrolling||!s){r.isScrolling=!1;var o=r.parent.isAdaptive?i:(0,t.closest)(i,"."+Qt).querySelector("."+Lt);s&&("vertical"===r.direction?r.parent.element.querySelector("."+Ci)&&((0,t.addClass)([a],["e-virtual-pivot-content"]),(0,t.removeClass)([r.parent.element.querySelector("."+Ci)],[xi])):r.parent.element.querySelector("."+Ci)&&((0,t.addClass)([e,i],["e-virtual-pivot-content"]),(0,t.removeClass)([r.parent.element.querySelector("."+Ci)],[xi]))),r.update(r.parent.element.querySelector("."+ft+" ."+R).scrollTop*r.parent.verticalScrollScale,o.scrollLeft*r.parent.horizontalScrollScale,n,o,e,i)}}},e.prototype.onHorizondalScroll=function(e,i,a){var r=this,n=this.parent.isAdaptive?i:(0,t.closest)(i,"."+Qt).querySelector("."+Lt),s=Math.abs(n.scrollLeft),o=s*this.parent.horizontalScrollScale,l=o-this.parent.scrollPosObject.horizontalSection-s;return l=this.parent.enableRtl?l:-l,"none"!==n.style.display&&this.alignFreezedCells(l,!1),function(d){if(s=Math.abs(n.scrollLeft),o=s*r.parent.horizontalScrollScale,"wheel"!==d.type&&"touchmove"!==d.type&&"scroll"!==d.type&&"wheel"!==r.eventType&&"touchmove"!==r.eventType&&"scroll"!==r.eventType||(r.horizontalScrollTimeoutObj&&clearTimeout(r.horizontalScrollTimeoutObj),r.horizontalScrollTimeoutObj=setTimeout(function(){o="touchmove"===d.type?s:o,r.update(i.parentElement.scrollTop*r.parent.verticalScrollScale,o,d,n,e,i)},300)),r.previousValues.left!==o){r.parent.scrollDirection=r.direction="horizondal",r.isScrolling=!0,l=o-r.parent.scrollPosObject.horizontalSection-s,l=r.parent.enableRtl?l:-l;var p=i.querySelector("."+Be).style.transform.split(",").length>1?i.querySelector("."+Be).style.transform.split(",")[1].trim():"0px)";s<r.parent.scrollerBrowserLimit&&((0,t.setStyleAttribute)(i.querySelector("."+Be),{transform:"translate("+l+"px,"+p}),(0,t.setStyleAttribute)(e.querySelector("."+Be),{transform:"translate("+l+"px,0px)"}),r.alignFreezedCells(l,!1));var h=r.parent.scrollPosObject.horizontalSection>o?-(r.parent.scrollPosObject.horizontalSection-o):o+(e.offsetWidth-e.querySelector(".e-headercell.e-leftfreeze").offsetWidth)-(r.parent.scrollPosObject.horizontalSection+(i.querySelector("."+Be).offsetWidth-i.querySelector("."+Be).querySelector(".e-leftfreeze.e-rowsheader").offsetWidth)),u=Math.ceil(r.parent.scrollPosObject.horizontalSection/r.parent.horizontalScrollScale)<r.parent.scrollerBrowserLimit;if(r.parent.scrollPosObject.horizontalSection>o||h>1&&u){r.parent.virtualScrollSettings&&r.parent.virtualScrollSettings.allowSinglePage&&"pivot"===r.parent.dataType&&r.parent.element.querySelector("."+Ci)&&((0,t.addClass)([e,i],["e-virtual-pivot-content"]),(0,t.removeClass)([r.parent.element.querySelector("."+Ci)],[xi])),o>e.clientWidth?(r.parent.scrollPosObject.left<1&&(r.parent.scrollPosObject.left=e.clientWidth),r.parent.scrollPosObject.left=r.parent.scrollPosObject.left-50,h=r.parent.scrollPosObject.horizontalSection>o?h-r.parent.scrollPosObject.left:h+r.parent.scrollPosObject.left):h=-r.parent.scrollPosObject.horizontalSection,l=-(o-(r.parent.scrollPosObject.horizontalSection+h)-(0,t.closest)(i,"."+Qt).querySelector("."+Lt).scrollLeft);var c=r.parent.gridSettings.columnWidth*r.engineModule.columnCount;c>r.parent.scrollerBrowserLimit&&(r.parent.horizontalScrollScale=c/r.parent.scrollerBrowserLimit,c=r.parent.scrollerBrowserLimit),l>c&&l>o&&(l=o,h=0),(0,t.setStyleAttribute)(i.querySelector("."+Be),{transform:"translate("+l+"px,"+p}),(0,t.setStyleAttribute)(e.querySelector("."+Be),{transform:"translate("+l+"px,0px)"}),r.alignFreezedCells(l,!1),r.parent.scrollPosObject.horizontalSection=r.parent.scrollPosObject.horizontalSection+h,r.adjustHorizontalScrollOffset(e,i,a)}var g=n.scrollWidth-(s+(n.offsetWidth-r.parent.element.querySelector("."+ft).querySelector("."+ze+"."+bi).offsetWidth));if(g<=0){var m=i.querySelector("."+Ft);m.style.display="none";var f=i.scrollWidth-(i.scrollLeft+i.offsetWidth);m.style.display="";var v=i.scrollWidth-(i.scrollLeft+i.offsetWidth);r.parent.scrollPosObject.horizontalSection-=f>g?f:-v,l=s>r.parent.scrollerBrowserLimit?Number(i.querySelector("."+Be).style.transform.split(",")[0].split("px")[0].trim()):-(s*r.parent.horizontalScrollScale-r.parent.scrollPosObject.horizontalSection-s),(0,t.setStyleAttribute)(i.querySelector("."+Be),{transform:"translate("+l+"px,"+p}),(0,t.setStyleAttribute)(e.querySelector("."+Be),{transform:"translate("+l+"px,0px)"}),r.alignFreezedCells(l,!1)}r.previousValues.left=o,r.frozenPreviousValues.left=o,r.eventType="",e.scrollLeft=n.scrollLeft,i.scrollLeft=n.scrollLeft}}},e.prototype.alignFreezedCells=function(e,t){for(var i=0,a=this.parent.element.querySelectorAll("."+bi);i<a.length;i++)if(this.parent.isTabular&&this.parent.dataSourceSettings.rows.length>1){var r=a[i];this.setFrozenColumnPosition(e,r,i,a,t)}else t?this.parent.enableRtl?a[i].style.right=-e+"px":a[i].style.left=e+"px":this.parent.enableRtl?a[i].style.right=Number(e)+"px":a[i].style.left=Number(-e)+"px"},e.prototype.onVerticalScroll=function(e,i){var a=this,r=e.querySelector("."+At)?e.querySelector("."+At):e;return function(n){var s=a.parent.engineModule?a.parent.engineModule.viewportPageCount:3;if(a.parent.isAdaptive||r.scrollHeight>r.parentElement.clientHeight*s){var o=e.scrollTop*a.parent.verticalScrollScale;if("wheel"===n.type||"touchmove"===n.type||"scroll"===n.type||"wheel"===a.eventType||"touchmove"===a.eventType||"keyup"===n.type||"keydown"===n.type){var l=a.parent.isAdaptive?e:(0,t.closest)(e,"."+Qt).querySelector("."+Lt);a.verticalScrollTimeoutObj&&clearTimeout(a.verticalScrollTimeoutObj),a.verticalScrollTimeoutObj=setTimeout(function(){var t=0;if(a.parent.isAdaptive){var i=l.querySelector("."+At);t=l.scrollLeft===i.scrollLeft?l.scrollLeft:i.scrollLeft}else t=l.scrollLeft;a.update(e.scrollTop*a.parent.verticalScrollScale,t*a.parent.horizontalScrollScale,n,l,null,e)},300)}if(a.previousValues.top===o)return;a.parent.scrollPosObject.horizontalSection<0&&(a.parent.scrollPosObject.horizontalSection=0),a.parent.scrollDirection=a.direction="vertical",a.isScrolling=!0;var d=-(o-a.parent.scrollPosObject.verticalSection-e.scrollTop),p=e.querySelector("."+Be).style.transform.split(",")[0].trim();d>a.parent.virtualDiv.clientHeight&&(d=a.parent.virtualDiv.clientHeight),e.scrollTop<a.parent.scrollerBrowserLimit&&((0,t.setStyleAttribute)(e.querySelector("."+Be),{transform:"translate(0px,"+d+"px)"}),(0,t.setStyleAttribute)(e.querySelector("."+Be),{transform:p+","+d+"px)"}));var h=a.parent.scrollPosObject.verticalSection>o?-(a.parent.scrollPosObject.verticalSection-o):o+e.clientHeight-(a.parent.scrollPosObject.verticalSection+e.querySelector("."+Be).offsetHeight),u=Math.ceil(a.parent.scrollPosObject.verticalSection/a.parent.verticalScrollScale)<a.parent.scrollerBrowserLimit;if(a.parent.scrollPosObject.verticalSection>o||h>1&&u){a.parent.virtualScrollSettings&&a.parent.virtualScrollSettings.allowSinglePage&&"pivot"===a.parent.dataType&&a.parent.element.querySelector("."+Ci)&&((0,t.addClass)([i],["e-virtual-pivot-content"]),(0,t.removeClass)([a.parent.element.querySelector("."+Ci)],[xi])),o>e.clientHeight?(a.parent.scrollPosObject.top<1&&(a.parent.scrollPosObject.top=e.clientHeight),a.parent.scrollPosObject.top=a.parent.scrollPosObject.top-50,h=a.parent.scrollPosObject.verticalSection>o?h-a.parent.scrollPosObject.top:h+a.parent.scrollPosObject.top):h=-a.parent.scrollPosObject.verticalSection;var c=a.parent.element.querySelector("."+R).querySelector("."+Be);d=-(o-(a.parent.scrollPosObject.verticalSection+h)-e.scrollTop);var g=a.parent.gridSettings.rowHeight*a.engineModule.rowCount+.1-c.clientHeight;g>a.parent.scrollerBrowserLimit&&(a.parent.verticalScrollScale=g/a.parent.scrollerBrowserLimit,g=a.parent.scrollerBrowserLimit),d>g&&d>o&&(d=o,h=0),d>a.parent.virtualDiv.clientHeight&&(d=a.parent.virtualDiv.clientHeight),(0,t.setStyleAttribute)(e.querySelector("."+Be),{transform:"translate(0px,"+d+"px)"}),(0,t.setStyleAttribute)(e.querySelector("."+Be),{transform:p+","+d+"px)"}),a.parent.scrollPosObject.verticalSection=a.parent.scrollPosObject.verticalSection+h}a.scrollingDirection=a.previousValues.top<e.scrollTop?"Up":"Down",a.previousValues.top=o,a.frozenPreviousValues.top=o,a.eventType=""}}},e.prototype.removeInternalEvents=function(){this.parent.isDestroyed||(this.parent.off(mr,this.wireEvents),this.clearAllEventHandlers())},e.prototype.destroy=function(){this.removeInternalEvents(),this.engineModule=null,this.keyboardEvents=null},e.prototype.setFrozenColumnPosition=function(e,t,i,a,r){if(t&&t instanceof HTMLTableCellElement){var n=0,s=t.cellIndex+1;if(s>1)for(var o=0;o<s-1;o++)n+=this.parent.pivotColumns[o].width;r?this.parent.enableRtl?a[i].style.right=-(e-n)+"px":a[i].style.left=e+n+"px":this.parent.enableRtl?a[i].style.right=Number(e+n)+"px":a[i].style.left=Number(-(e-n))+"px"}},e.prototype.adjustHorizontalScrollOffset=function(e,i,a){var r=Math.abs(a.scrollWidth-(Math.abs(a.scrollLeft)+a.offsetWidth))-Math.abs(i.scrollWidth-(Math.abs(i.scrollLeft)+i.offsetWidth));if(r<0){var n=i.querySelector("."+Be).style.transform,s=n.slice(n.indexOf("(")+1,n.indexOf(")")).split(","),o=(parseFloat(s[0])||0)+r,l=parseFloat(s[1])||0;(0,t.setStyleAttribute)(i.querySelector("."+Be),{transform:"translate("+o+"px, "+l+"px)"}),(0,t.setStyleAttribute)(e.querySelector("."+Be),{transform:"translate("+o+"px, 0px)"}),this.alignFreezedCells(o,!1),this.parent.scrollPosObject.horizontalSection=o}},e}(),Po=function(e,t){var i={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(i[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var r=0;for(a=Object.getOwnPropertySymbols(e);r<a.length;r++)t.indexOf(a[r])<0&&(i[a[r]]=e[a[r]])}return i},Eo=function(){function e(e){this.indexString=[],this.isUpdated=!1,this.isEdited=!1,this.parent=e,this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule}return e.prototype.showDrillThroughDialog=function(e,i){for(var a=this,r=e.rawData,n=[],s={},o=0;o<e.rawData.length;o++)n.push(Hs.frameHeaderWithKeys(e.rawData[o]));try{if("Table"===this.parent.currentView&&this.parent.editSettings.allowInlineEditing&&this.parent.editSettings.allowEditing&&1===e.rawData.length){if(this.parent.actionObj.actionName=fn,this.parent.actionBeginMethod())return;this.editCell(e,r)}else{this.removeDrillThroughDialog();var l=(0,t.createElement)("div",{id:this.parent.element.id+"_drillthrough",className:"e-drillthrough-dialog"});this.parent.element.appendChild(l),this.dialogPopUp=new Bs.Dialog({animationSettings:{effect:"Fade"},allowDragging:!1,header:this.parent.localeObj.getConstant("details"),content:this.createDrillThroughGrid(e,r,i),cssClass:this.parent.cssClass,beforeOpen:function(){a.drillThroughGrid.setProperties({dataSource:a.parent.editSettings.allowEditing?a.dataWithPrimarykey(e,r,s):r,height:a.parent.editSettings.allowEditing?220:300},!1)},beforeClose:function(){if(a.parent.editSettings.allowEditing&&a.isUpdated){"CSV"===a.parent.dataSourceSettings.type&&a.updateData(a.drillThroughGrid.dataSource);for(var e=[],i=0,o=Object.keys(s);i<o.length;i++){var l=o[i];e.push(s[l])}for(var d=Object.keys(s).length,p=[],h=[],u=0,c=0,g=a.drillThroughGrid.dataSource;c<g.length;c++){var m=g[c];if(a.isEdited||"0"!==m.__index&&""!==m.__index)d>0&&(delete s[m.__index.toString()],h.push(m),d--);else{for(var f=0,v=a.engine.fields;f<v.length;f++){var S=v[f];(0,t.isNullOrUndefined)(m[S])&&delete m[S]}delete m.__index,p.push(m)}"Server"===a.parent.dataSourceSettings.mode&&(m.__index&&delete m.__index,r[u].__index&&delete r[u].__index),u++}if(d=0,"Server"===a.parent.dataSourceSettings.mode){for(var y=[],b=Object.keys(s),C=0;C<b.length;C++)delete a.parent.drillThroughValue.indexObject[s[b[C]]],y.push({Key:b[C],Value:s[b[C]]});a.parent.getEngine("updateRawData",null,null,null,null,null,null,null,{addedData:p,removedData:y,updatedData:h,indexObject:a.parent.drillThroughValue.indexObject})}else{for(var x=[],w=0,T=a.parent.allowDataCompression?a.parent.engineModule.actualData:a.parent.engineModule.data;w<T.length;w++){delete(m=T[w]).__index,void 0===s[d.toString()]&&x.push(m),d++}x=x.concat(p);var M={currentData:a.drillThroughGrid.dataSource,previousData:n,previousPosition:e,cancel:!1};a.parent.trigger(sa,M),M.cancel||(a.parent.setProperties({dataSourceSettings:{dataSource:x}},!0),a.engine.updateGridData(a.parent.dataSourceSettings),a.parent.pivotValues=a.engine.pivotValues)}a.parent.actionObj.actionName=Cs;var D={editInfo:{type:a.drillThroughGrid.editSettings.mode,action:"Update",currentData:a.drillThroughGrid.dataSource,previousData:n,previousPosition:e}};a.parent.actionObj.actionInfo=D}a.isUpdated=!1,a.isEdited=!1,s={}},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:Hs.getAppendToElement(this.parent.element,this.parent.isAngular),close:this.removeDrillThroughDialog.bind(this)}),this.dialogPopUp.isStringTemplate=!0,this.dialogPopUp.isAngular=this.parent.isModalDialog,this.dialogPopUp.appendTo(l),(0,t.setStyleAttribute)(this.dialogPopUp.element,{visibility:"visible"});this.parent.editSettings.allowEditing&&(this.drillthroughKeyboardModule=new t.KeyboardEvents(this.dialogPopUp.element,{keyAction:this.drillthroughKeyActionHandler.bind(this),keyConfigs:{escape:"escape"},eventName:"keydown"}))}}catch(e){this.parent.actionFailureMethod(e)}},e.prototype.editCell=function(e,i){var a=this,r=this.parent.gridSettings.allowResizing,n=e.currentCell.actualText.toString(),s=Number(Object.keys(e.currentCell.indexObject));e.currentTarget.firstElementChild.style.display="none";var o=Number(e.rawData[0][n]),l=Hs.frameHeaderWithKeys(e.rawData[e.rawData.length-1]),d=e.rawData[e.rawData.length-1],p={editInfo:{type:"Inline editing",action:"update",data:i}};this.parent.actionObj.actionInfo=p;var h=new zs.NumericTextBox({value:o,enableRtl:this.parent.enableRtl,enabled:!0,format:"####.##",locale:this.parent.locale,cssClass:this.parent.cssClass,change:function(){var i=(0,t.isNullOrUndefined)(h.value)?0:h.value,r=e.currentCell.indexObject[s];e.rawData[0][n]=i,a.parent.engineModule.data[r]=e.rawData[0]},blur:function(){var e={currentData:[d],previousData:[l],previousPosition:[d.index],cancel:!1};if(a.parent.trigger(sa,e),!e.cancel)if("Server"===a.parent.dataSourceSettings.mode){var t={};t[s]=s;var i=[d];a.parent.getEngine("updateRawData",null,null,null,null,null,null,null,{addedData:[],removedData:[],updatedData:i,indexObject:t})}else 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=r}}),u=(0,t.createElement)("input",{id:this.parent.element.id+"_inputbox"});e.currentTarget.appendChild(u),h.appendTo(u),e.currentCell.value=h.value,h.focusIn(),this.parent.gridSettings.allowResizing=!1},e.prototype.updateData=function(e){for(var i=0,a=this.parent.allowDataCompression?this.parent.engineModule.actualData:this.parent.engineModule.data;i<e.length;){for(var r=Object.keys(e[i]),n=0,s=[];n<r.length;)(0,t.isNullOrUndefined)(this.parent.engineModule.fieldKeys[r[n]])||(s[this.parent.engineModule.fieldKeys[r[n]]]=e[i][r[n]]),n++;a[Number(e[i].__index)]=s,i++}this.parent.allowDataCompression?this.parent.engineModule.actualData=a:this.parent.engineModule.data=a},e.prototype.removeDrillThroughDialog=function(){this.dialogPopUp&&!this.dialogPopUp.isDestroyed&&(this.parent.actionObj.actionName=xs,this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.dialogPopUp.destroy());var e=document.getElementById(this.parent.element.id+"_drillthrough");e&&(0,t.remove)(e),document.getElementById(this.parent.element.id+"_drillthroughgrid_ccdlg")&&(0,t.remove)(document.getElementById(this.parent.element.id+"_drillthroughgrid_ccdlg"))},e.prototype.createDrillThroughGrid=function(e,a,r){var n=this,s=(0,t.createElement)("div",{id:this.parent.element.id+"_drillthroughbody",className:"e-drillthrough-body"}),o=(0,t.createElement)("div",{id:this.parent.element.id+"_drillthroughbodyheader",className:"e-drillthrough-body-header-container"});if(""!==e.rowHeaders&&(o.innerHTML="<span class="+J+"><span class="+X+">"+this.parent.localeObj.getConstant("row")+"</span> : <span class="+Z+">"+e.rowHeaders+"</span></span>"),""!==e.columnHeaders&&(o.innerHTML=o.innerHTML+"<span class="+J+"><span class="+X+">"+this.parent.localeObj.getConstant("column")+"</span> : <span class="+Z+">"+e.columnHeaders+"</span></span>"),""!==e.value){var l=e.currentCell.formattedText;"0"!==l&&(o.innerHTML=o.innerHTML+"<span class="+J+"><span class="+X+">"+r+"</span> : <span class="+Z+">"+l+"</span></span>")}var d=["ColumnChooser"];this.parent.editSettings.allowEditing&&(d=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"]);var p=(0,t.createElement)("div",{id:this.parent.element.id+"_drillthroughgrid",className:"e-drillthrough-grid"});_s.Grid.Inject(_s.Selection,_s.Reorder,_s.Resize,_s.Toolbar,_s.ColumnChooser),this.drillThroughGrid=new _s.Grid({cssClass:this.parent.cssClass,gridLines:"Default",allowResizing:!0,allowReordering:!0,showColumnChooser:!0,enableHover:!1,toolbar:d,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(a);var h=this;if(this.parent.trigger(na,{cellInfo:e,gridObj:this.drillThroughGrid,type:"editing"}),this.drillThroughGrid.allowExcelExport&&_s.Grid.Inject(_s.ExcelExport),this.drillThroughGrid.allowPdfExport&&_s.Grid.Inject(_s.PdfExport),this.parent.editSettings.allowEditing){_s.Grid.Inject(_s.Edit,_s.Page);try{this.drillThroughGrid.editSettings=this.parent.editSettings,this.drillThroughGrid.actionBegin=function(e){var a="save"===e.requestType?vn:"add"===e.requestType?Sn:"delete"===e.requestType?yn:"";if(n.parent.actionObj.actionName=a,!n.parent.actionObj.actionName||!n.parent.actionBeginMethod()){for(var r,s=0,o=n.drillThroughGrid.columns;s<o.length;s++){var l=o[s];if(l.isPrimaryKey&&"__index"!==l.field){r=l;break}}var d=(0,t.isNullOrUndefined)(r)?void 0:r.field;if(!(0,t.isNullOrUndefined)(n.parent.dataManager)&&!(0,t.isNullOrUndefined)(d)){var p=n.parent.dataManager,h=(0,t.isNullOrUndefined)(n.drillThroughGrid.getQuery())?new i.Query:n.drillThroughGrid.getQuery().clone();if("save"===e.requestType&&"add"===e.action){var u=e.data,c=(u.__index,Po(u,["__index"]));p.insert(c,h.fromTable,h,e.index)}else if("save"===e.requestType&&"edit"===e.action){var g=e.data,m=(g.__index,Po(g,["__index"]));p.update(d,m,h.fromTable,h,e.previousData)}else if("delete"===e.requestType){var f=e.data[0][d];(0,t.isNullOrUndefined)(f)?n.parent.actionFailureMethod(new Error("Primary key value not found in record to delete")):p.remove(d,f)}}}},this.parent.editSettings.allowCommandColumns?(this.drillThroughGrid.editSettings.mode="Normal",this.drillThroughGrid.editSettings.allowEditOnDblClick=!1,_s.Grid.Inject(_s.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||(h.isUpdated=!0),"batchsave"!==e.requestType&&"save"!==e.requestType||"edit"!==e.action||(h.isEdited=!0),n.parent.actionObj.actionName=n.parent.getActionCompleteName();var t={editInfo:{type:n.drillThroughGrid.editSettings.mode,action:e.requestType,data:a}};n.parent.actionObj.actionInfo=t,n.parent.actionObj.actionName&&n.parent.actionCompleteMethod(),("Normal"===h.drillThroughGrid.editSettings.mode&&"save"===e.requestType&&h.drillThroughGrid.element.querySelectorAll(".e-tbar-btn:hover").length>0&&!h.parent.editSettings.allowCommandColumns||"batchsave"===e.requestType)&&h.dialogPopUp.hide()},this.drillThroughGrid.beforeBatchSave=function(){h.isUpdated=!0}}else _s.Grid.Inject(_s.VirtualScroll);return Hs.getAppendToElement(this.parent.element,this.parent.isAngular).appendChild(p),this.drillThroughGrid.isStringTemplate=!0,this.drillThroughGrid.isAngular=this.parent.isModalDialog,this.drillThroughGrid.appendTo(p),s.appendChild(o),s.appendChild(p),s},e.prototype.frameGridColumns=function(e){this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;var i="olap"===this.parent.dataType?e[0]?Object.keys(e[0]):[]:Object.keys(this.engine.fieldList),a=[],r={};if(this.parent.dataSourceSettings.formatSettings.length>0)for(var n=0;n<this.parent.dataSourceSettings.formatSettings.length;n++)r[this.parent.dataSourceSettings.formatSettings[n].name]=this.parent.dataSourceSettings.formatSettings[n].format;if("olap"===this.parent.dataType)for(var s=0,o=i;s<o.length;s++){var l=(m=o[s]).replace(/_x005B_|_x005D_|_x0024_/g,"").replace(/_x0020_/g," ").replace("].[","").split(".").reverse(),d="[Measures].["+l[0]+"]",p=this.engine&&this.engine.fieldList?this.engine.fieldList[d]:null,h=p&&"number"===p.type?"number":"string",u=p?(0,t.isNullOrUndefined)(r[p.id])?"Currency"===p.formatString?"C":"Percent"===p.formatString?"P":p.format?p.format:null:r[p.id]:(0,t.isNullOrUndefined)(r[m])?null:r[m];a.push({field:m.replace(/_x005B_|_x0020_|_x005D_|_x0024_/g,"").replace("].[","").split(".").reverse().join(""),headerText:l.join("."),width:120,visible:!0,validationRules:{required:!0},format:u,type:h})}else for(var c=0,g=i;c<g.length;c++){var m=g[c];if("CalculatedField"!==this.engine.fieldList[m].aggregateType){var f="",v=null,S=!("date"!==this.engine.fieldList[m].type&&"datetime"!==this.engine.fieldList[m].type||!(this.isDateFieldExist(m)||e[0]&&e[0][m]&&-1===e[0][m].toString().indexOf(" ")));"number"===this.engine.fieldList[m].type?(f="numericedit",v="number"):"date"===this.engine.fieldList[m].type&&S?(f="datepickeredit",v="date"):"datetime"===this.engine.fieldList[m].type&&S?(f="datetimepickeredit",v="date"):f="defaultedit",this.parent.engineModule.formatFields[m]&&(v=this.parent.engineModule.formatFields[m].type);var y=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(this.engine.fieldList[m].caption):this.engine.fieldList[m].caption;a.push({field:m,headerText:y,width:120,visible:this.engine.fieldList[m].isSelected,validationRules:{required:!0},editType:f,format:(0,t.isNullOrUndefined)(r[m])?void 0:r[m],type:(0,t.isNullOrUndefined)(r[m])?"string":v})}}return a},e.prototype.isDateFieldExist=function(e){for(var t=0;t<this.parent.dataSourceSettings.formatSettings.length;t++)if(this.parent.dataSourceSettings.formatSettings[t].name===e&&this.parent.dataSourceSettings.formatSettings[t].type.indexOf("date")>-1)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&&this.parent.dataSourceSettings.fieldMapping[t].dataType.indexOf("date")>-1)return!0;return!1},e.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++}},e.prototype.dataWithPrimarykey=function(e,t,i){for(var a=this.indexString.length>0?this.indexString:Object.keys(e.currentCell.indexObject),r=t,n=0,s=0,o=r;s<o.length;s++){o[s].__index=a[n],i[a[n].toString()]=Number(a[n]),n++}return r},e.prototype.drillthroughKeyActionHandler=function(e){if("escape"===e.action)this.processClose(e)},e.prototype.processClose=function(e){var i=e.target;if(i&&(0,t.closest)(i,".e-popup.e-popup-open")){var a=(0,t.getInstance)((0,t.closest)(i,".e-popup.e-popup-open"),Bs.Dialog);if(a&&!a.closeOnEscape){var r=a.element.getAttribute("data-fieldName");if(a.hide(),this.parent.element)for(var n=0,s=[].slice.call(this.parent.element.querySelectorAll(".e-pivot-button"));n<s.length;n++){var o=s[n];if(o.getAttribute("data-uid")===r){o.focus();break}}return void e.preventDefault()}}},e.prototype.destroy=function(){this.parent.isDestroyed||this.drillthroughKeyboardModule&&!this.drillthroughKeyboardModule.isDestroyed&&(this.drillthroughKeyboardModule.destroy(),this.drillthroughKeyboardModule=null)},e}(),Io=function(){function e(e){this.parent=e,this.drillThroughDialog=new Eo(this.parent),this.addInternalEvents()}return e.prototype.getModuleName=function(){return"drillThrough"},e.prototype.addInternalEvents=function(){this.parent&&this.parent.on(mr,this.wireEvents,this)},e.prototype.wireEvents=function(){this.unWireEvents(),this.parent&&this.parent.element&&t.EventHandler.add(this.parent.element,"dblclick",this.mouseClickHandler,this)},e.prototype.unWireEvents=function(){this.parent.isDestroyed||this.parent&&this.parent.element&&!this.parent.isDestroyed&&t.EventHandler.remove(this.parent.element,"dblclick",this.mouseClickHandler)},e.prototype.mouseClickHandler=function(e){if(this.parent){var i=e.target,a=null;if(i.classList.contains("e-stackedheadercelldiv")||i.classList.contains("e-headercelldiv")||i.classList.contains("e-stackedheadertext")||i.classList.contains("e-headertext")?a=(0,t.closest)(i.parentElement,"th"):i.classList.contains("e-cellvalue")?a=i.parentElement:(i.classList.contains("e-headercell")||i.classList.contains("e-rowcell"))&&(a=i),a&&this.parent.pivotValues.length>0&&this.parent.dataSourceSettings.values.length>0&&(this.parent.allowDrillThrough||this.parent.editSettings.allowEditing)&&a.classList.contains("e-valuescontent")){var r=parseInt(a.getAttribute("aria-colindex"),10)-1,n=Number(a.getAttribute("index"));(0,t.isNullOrUndefined)(this.parent.pivotValues[n])||(0,t.isNullOrUndefined)(this.parent.pivotValues[n][r])||this.executeDrillThrough(this.parent.pivotValues[n][r],n,r,a)}}},e.prototype.executeDrillThrough=function(e,i,a,r){this.parent.drillThroughElement=r,this.parent.drillThroughValue=e;var n="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;if(!Hs.invokeActionMethod(this.parent,or,mn)){var s="",o="",l=[];if(!(0,t.isNullOrUndefined)(e.rowHeaders)&&!(0,t.isNullOrUndefined)(e.columnHeaders)){if("olap"===this.parent.dataType){var d=void 0,p=(d="row"===this.parent.dataSourceSettings.valueAxis?n.tupRowInfo[e.rowOrdinal]:n.tupColumnInfo[e.colOrdinal])?n.getUniqueName(d.measureName):e.actualText;if(n.fieldList[p]&&n.fieldList[p].isCalculatedField)return this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("drillError")),this.parent.actionObj.actionName="",void(this.parent.actionObj.actionInfo=void 0);s=n.fieldList[p||e.actualText].caption,o=n.fieldList[p||e.actualText].aggregateType;try{this.parent.olapEngineModule.getDrillThroughData(e,this.parent.maxRowsInDrillThrough),l=JSON.parse(n.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?this.parent.olapEngineModule.errorInfo:n.gridJSON),this.parent.olapEngineModule.errorInfo=void 0,this.parent.actionObj.actionName="",void(this.parent.actionObj.actionInfo=void 0)}}else if(s=n.fieldList[e.actualText.toString()]?n.fieldList[e.actualText.toString()].caption:e.actualText.toString(),o=n.fieldList[e.actualText]?n.fieldList[e.actualText].aggregateType:"","Server"===this.parent.dataSourceSettings.mode)this.parent.getEngine("fetchRawData",null,null,null,null,null,null,{rowIndex:i,columnIndex:a});else if(this.parent.allowDataCompression){var h=Object.keys(e.indexObject);this.drillThroughDialog.indexString=[];for(var u=0,c=h;u<c.length;u++)for(var g=c[u],m=0,f=this.parent.engineModule.groupRawIndex[Number(g)];m<f.length;m++){var v=f[m];l.push(this.parent.engineModule.actualData[v]),this.drillThroughDialog.indexString.push(v.toString())}}else for(var S=0,y=h=Object.keys(e.indexObject);S<y.length;S++){var b=y[S];l.push(this.parent.engineModule.data[Number(b)])}"Server"!==this.parent.dataSourceSettings.mode&&this.triggerDialog(s,o,l,e,r)}}},e.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},e.prototype.triggerDialog=function(e,i,a,r,n){if(this.parent){var s="CalculatedField"===i?e.toString():""!==i?this.parent.localeObj.getConstant(i)+" "+this.parent.localeObj.getConstant("of")+" "+e:e;s=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(s):s;var o="row"===this.parent.dataSourceSettings.valueAxis?this.parent.getRowText(Number(n.getAttribute("index")),0):""===r.rowHeaders?"":r.rowHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - "),l={currentTarget:n,currentCell:r,rawData:a,rowHeaders:o,columnHeaders:""===r.columnHeaders?"":r.columnHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - "),value:s+"("+r.formattedText+")",gridColumns:this.drillThroughDialog.frameGridColumns(a),cancel:!1};"CSV"===this.parent.dataSourceSettings.type&&(l=this.frameData(l));var d=this;this.parent.trigger(Ki,l,function(e){l.cancel||d.drillThroughDialog.showDrillThroughDialog(e,s)})}},e.prototype.destroy=function(){this.unWireEvents(),this.drillThroughDialog&&(this.drillThroughDialog.destroy(),this.drillThroughDialog=null)},e}(),Fo=v(60),Lo=function(){function e(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,(0,t.initializeTelemetryFeature)("PivotChart","PivotTable"),this.parent=e}return e.prototype.getModuleName=function(){return"pivotChart"},e.prototype.loadChart=function(e,a){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=a,!("olap"===e.dataType?""!==e.dataSourceSettings.url&&!e.olapEngineModule.isEmptyData&&e.olapEngineModule.tupColumnInfo.length>0&&e.olapEngineModule.tupRowInfo.length>0&&(!(0,t.isNullOrUndefined)(e.olapEngineModule.colMeasurePos)||!(0,t.isNullOrUndefined)(e.olapEngineModule.rowMeasurePos)):"Server"===this.parent.dataSourceSettings.mode?!(0,t.isNullOrUndefined)(e.dataSourceSettings.url)&&""!==e.dataSourceSettings.url&&e.dataSourceSettings.values.length>0&&!e.engineModule.isEmptyData:e.dataSourceSettings.values.length>0&&e.dataSourceSettings.dataSource&&(e.dataSourceSettings.dataSource.length>0||e.dataSourceSettings.dataSource instanceof i.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=[],this.parent.chart.axes.length>0&&(this.parent.chart.axes[0].title=""),this.parent.chart.primaryXAxis.zoomFactor=(0,t.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(mr,{}));this.parent.chart||!this.parent.element.querySelector(".e-chart")&&!this.parent.element.querySelector(".e-accumulationchart")||(0,t.remove)((0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element)),this.chartSettings.enableMultipleAxis&&this.accumulationType.indexOf(a.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type?this.measureList=this.dataSourceSettings.values.map(function(e){return e.name}):this.measureList=[""===a.value?this.dataSourceSettings.values[0].name:a.value];for(var r=0,n=this.dataSourceSettings.values;r<n.length;r++){var s=(O=n[r]).name.replace(/[^A-Z0-9]+/gi,"_");this.measuresNames[O.name]=s,this.measuresNames[s]=O.name,"Polar"!==this.chartSettings.chartSeries.type&&"Radar"!==this.chartSettings.chartSeries.type||(this.measuresNames[O.caption?O.caption:O.name]=O.name)}this.columnGroupObject={},this.accEmptyPoint=!1;var o=this.engineModule.pivotValues;this.currentMeasure=a.enableMultipleAxis&&this.accumulationType.indexOf(a.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type?this.measureList[0]:(""===a.value||0===this.dataSourceSettings.values.filter(function(e){return e.name===a.value}).length)&&this.dataSourceSettings.values.length>0?this.dataSourceSettings.values[0].name:a.value;var l,d,p,h=this.getColumnTotalIndex(o),u=Object.keys(o),c={},g=0,m=-.5;this.headerColl={},this.maxLevel=0;var f,v={},S="",y="",b="";this.chartSeriesInfo={},this.selectedLegend=0;for(var C=!1,x={},w=!1,T=this.parent.dataSourceSettings.valueSortSettings.headerDelimiter,M=0,D=this.dataSourceSettings.values;M<D.length;M++){var O;x[s=(O=D[M]).name]=O.caption?O.caption:s,x[O.caption?O.caption:s]=s}if("olap"===this.parent.dataType){var N=[];v=this.groupHierarchyWithLevels(o,N),S=N[N.length-1],b=y=this.measurePos===N.length-1&&N.length>1?N[N.length-2]:S}for(var P=0,E=0,I=0,F=[],L=0,A=u.length;L<A;L++){var R=Number(u[L]),k=void 0,j=void 0;if(j=o[R]&&o[R]["Tabular"===this.parent.gridSettings.layout?this.parent.engineModule.rowMaxLevel:0],"Tabular"===this.parent.gridSettings.layout&&"pivot"===this.parent.dataType){var q=j&&o[R-0][j.level-1],H=q&&q.valueSort&&this.engineModule.fieldList[q.valueSort.axis];!H||H.showSubTotals&&this.dataSourceSettings.showSubTotals&&this.dataSourceSettings.showRowSubTotals||-1!==F.indexOf(q.actualText)||(j=o[R-0][0],F.push(q.actualText),L--)}if(j&&(j.level,1),!(0,t.isNullOrUndefined)(o[R-0])){var V="Tabular"===this.parent.gridSettings.layout?this.parent.engineModule.rowMaxLevel:0,U=o[R-0][V],B=U&&U.valueSort&&!(0,t.isNullOrUndefined)(U.valueSort.levelName)?U.valueSort.levelName.toString().split(T):void 0;if(w=!1,B&&"Grand Total"!==B[0]&&((a.enableMultipleAxis&&this.accumulationType.indexOf(a.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type||B.indexOf(x[this.currentMeasure])>-1)&&(w=!0),!w)){for(var _=0,G=B;_<G.length;_++){if(x[ie=G[_]]){w=!0;break}}w=!w}if(U&&"row"===U.axis&&(0===this.dataSourceSettings.rows.length||"grand sum"!==U.type&&w)){if("Tabular"!==this.parent.gridSettings.layout&&j.isSum)continue;var z="olap"===this.parent.dataType?this.engineModule.tupRowInfo[j.ordinal]:void 0,W=-1,Q=j.level;if("olap"===this.parent.dataType)C="[Measures]"===j.hierarchy?C:this.isAttributeDrill(j.hierarchy,z.drillInfo),b=b===y||"[Measures]"===j.hierarchy||j.isNamedSet||this.engineModule.fieldList[j.hierarchy]&&!this.engineModule.fieldList[j.hierarchy].hasAllMember?y:b,W=z.drillInfo.length-1,3===j.memberType||z.measureName&&z.measureName!==this.dataSourceSettings.values[0].name||(c=0===(g=(d=void 0===d?j.levelUniqueName:d)===j.levelUniqueName?0:g)?{}:c,g=p&&d!==j.levelUniqueName?p.hierarchy===j.hierarchy?g+(j.level-p.level):(0,t.isNullOrUndefined)(c[j.levelUniqueName])?v[j.hierarchy].start:c[j.levelUniqueName]:g,c[j.levelUniqueName]=g,Q=g,m+=!p||b!==p.hierarchy||p.isDrilled&&p.hasChild?0:1,b=C?j.hierarchy:y,l=g,p=j);else if("value"!==j.type){if("Tabular"===this.parent.gridSettings.layout){var Y=j.valueSort.levelName.split(T),K=j.formattedText.split(" ");k=Hs.isMemberDrilled(j,Y,this.parent.dataSourceSettings.drilledMembers);for(var X=B.length-2!=this.parent.engineModule.rowMaxLevel-1?B.length-2:this.parent.engineModule.rowMaxLevel-1,J=0;J<=this.parent.engineModule.rowMaxLevel;J++)if(this.headerColl[m]&&this.headerColl[m][J]){if(j.isSum){if(j.level>0){m-=j.level===this.parent.engineModule.rowMaxLevel-1?P-1:E-1,j.formattedText=!this.parent.dataSourceSettings.showSubTotals||!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?j.formattedText:K.length>2?K.slice(0,K.length-1).join(" "):K[0],j.hasChild=!0;break}m-=I-1,j.formattedText=!this.parent.dataSourceSettings.showSubTotals||!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?j.formattedText:K.length>2?K.slice(0,K.length-1).join(" "):K[0],j.hasChild=!0;break}if(this.headerColl[m][J]&&B[X]!==this.headerColl[m][J].name){m++;break}}j.isSum||(P++,E++,I++),this.parent.dataSourceSettings.expandAll?j.isDrilled=!k:j.isDrilled=!!k}else void 0===l||l<Q||m++;l=Q}this.maxLevel=Q>this.maxLevel?Q:this.maxLevel;var Z="olap"===this.parent.dataType?j.formattedText:j.actualText?j.actualText.toString():j.formattedText.toString(),$=this.engineModule.fieldList[this.currentMeasure],ee=0===this.parent.dataSourceSettings.rows.length?this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant($.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+((0,t.isNullOrUndefined)($.caption)?$.name:$.caption):j.formattedText?j.formattedText.toString():Z,te=j.hasChild&&!j.isNamedSet?(j.isDrilled?" - ":" + ")+ee:ee,ie=z?z.uNameCollection:j.valueSort.levelName.toString(),ae={name:Z,text:te,hasChild:j.hasChild,isDrilled:j.isDrilled,levelName:ie,level:Q,fieldName:j.valueSort.axis?j.valueSort.axis.toString():"",rowIndex:R-0,colIndex:0,cell:j};("olap"===this.parent.dataType?3!==j.memberType:"value"!==j.type)&&(this.headerColl[m]||(this.headerColl[m]={}),this.headerColl[m][Q]=ae,"Tabular"===this.parent.gridSettings.layout&&(j.isSum&&(j.level>0?m+=j.level===this.parent.engineModule.rowMaxLevel-1?P-1:E-1:m+=I-1),0===j.level?(E=0,P=0,I=0):j.level===this.parent.engineModule.rowMaxLevel-1?P=0:j.level<this.parent.engineModule.rowMaxLevel-1&&0!==j.level&&(P=0,E=0)));var re="Tabular"===this.parent.gridSettings.layout?o[R-0]:o[R],ne=Object.keys(re),se=void 0;if("olap"===this.parent.dataType)f=3!==j.memberType?j:f;else if(f="value"!==j.type?j:f,"value"!==j.type)f=j;else{var oe=j&&j.valueSort&&j.valueSort.levelName&&j.valueSort.levelName.toString().split(T),le=void 0;if(oe&&oe.length>0&&(oe.splice(oe.length-1,1),le=oe.join(T)),this.parent.dataSourceSettings.valueIndex<=0||this.engineModule.valueAxis&&this.dataSourceSettings.rows.length===this.engineModule.measureIndex||(0,t.isNullOrUndefined)(f.valueSort)||le===f.valueSort.levelName);else for(var de=R;de>-1;)o[de]&&o[de][0]&&o[de][0].valueSort&&o[de][0].valueSort.levelName===le&&(f=o[de][0],de=0),de--}for(var pe="Tabular"===this.parent.gridSettings.layout?this.parent.engineModule.rowMaxLevel:0;pe<ne.length;pe++){var he=ne[pe],ue=Number(he),ce=o[R-0][ue],ge=!(0,t.isNullOrUndefined)(ce.rowHeaders)||0===this.dataSourceSettings.rows.length,me="olap"===this.parent.dataType&&z&&z.measureName?z.measureName:ce.actualText;if(("olap"!==this.parent.dataType||!ce.isGrandSum)&&!h[ce.colIndex]&&"value"===ce.axis&&"header"!==j.type&&""!==me&&(a.enableMultipleAxis&&this.accumulationType.indexOf(a.chartSeries.type)<0&&"Pareto"!==this.chartSettings.chartSeries.type||me===this.currentMeasure)){if((0,t.isNullOrUndefined)(j.members)&&(j.members=[]),"olap"===this.parent.dataType?S!==j.hierarchy&&!C||(3===j.memberType&&se?W!==this.measurePos||se.isDrilled&&se.hasChild:j.isDrilled&&j.hasChild):("value"===j.type&&se?!(0,t.isNullOrUndefined)(se.members)&&se.hasChild&&se.isDrilled:j.hasChild&&j.isDrilled)||!ge)break;if("olap"===this.parent.dataType&&!0===ce.isSum&&"row"===this.parent.dataSourceSettings.valueAxis)continue;var fe="";if("olap"===this.parent.dataType)fe=ce.columnHeaders.toString().split(/~~|::/).join(" - ");else{var ve=ce.columnHeaders.toString().split(T);fe=Hs.formatChartHeaders(ve,this,!0,ce)}var Se="";if("olap"===this.parent.dataType)Se=ce.rowHeaders.toString().split(/~~|::/).join(" - ");else{var ye=ce.rowHeaders.toString().split(T);Se=Hs.formatChartHeaders(ye,this,!1,ce)}var be=fe+" | "+me;this.chartSeriesInfo[fe]={uniqueName:fe,caption:ce.hierarchyName&&ce.hierarchyName.toString().split(T).join(" - "),colorIndex:[]},this.chartSeriesInfo[this.chartSeriesInfo[fe].caption]=this.chartSeriesInfo[fe];var Ce="pivot"===this.parent.dataType&&this.engineModule.aggregatedValueMatrix[R]&&!(0,t.isNullOrUndefined)(this.engineModule.aggregatedValueMatrix[R][ue])?Number(this.engineModule.aggregatedValueMatrix[R][ue]):(0,t.isNullOrUndefined)(ce.value)?ce.value:Number(ce.value);0===(Ce=Ce===1/0?null:Ce)&&(this.accEmptyPoint=!0),this.columnGroupObject[be]?this.columnGroupObject[be].push({x:0===this.dataSourceSettings.rows.length?j.formattedText:Se,y:Ce,rIndex:R-0,cIndex:ue}):this.columnGroupObject[be]=[{x:0===this.dataSourceSettings.rows.length?j.formattedText:Se,y:Ce,rIndex:R-0,cIndex:ue}]}se=f}}}}this.refreshChart()},e.prototype.refreshChart=function(){this.chartSeries=[];var e=0,i={},a=Object.keys(this.columnGroupObject);this.persistSettings=JSON.parse(this.parent.getChartSettings()).chartSettings;for(var r=this.persistSettings.palettes&&this.persistSettings.palettes.length>0?this.persistSettings.palettes:(0,Fo.getSeriesColor)(this.chartSettings.theme),n=this.parent.chartSettings.columnDelimiter?this.parent.chartSettings.columnDelimiter:"-",s=this.parent.chartSettings.columnHeader&&""!==this.parent.chartSettings.columnHeader?this.parent.chartSettings.columnHeader.split(n).join(" - "):"",o=this.chartSettings.chartSeries?this.chartSettings.chartSeries.type:void 0,l={},d=0;d<this.parent.dataSourceSettings.values.length;d++)l[this.parent.dataSourceSettings.values[d].name]=(0,t.isNullOrUndefined)(this.parent.dataSourceSettings.values[d].caption)?void 0:this.parent.dataSourceSettings.values[d].caption;if(this.accumulationType.indexOf(o)>-1&&a.length>0){this.currentColumn=a.indexOf(s+" | "+this.currentMeasure)>-1&&void 0!==s?s+" | "+this.currentMeasure:a[0];var p={};p=this.persistSettings.chartSeries?this.frameChartSeries(this.persistSettings.chartSeries):p,((0,t.isNullOrUndefined)(p.palettes)||0===p.palettes.length)&&!(0,t.isNullOrUndefined)(this.persistSettings.palettes)&&this.persistSettings.palettes.length>0&&(p.palettes=this.persistSettings.palettes),p.dataSource=this.columnGroupObject[this.currentColumn],p.xName="x",p.yName="y",this.persistSettings.chartSeries&&this.persistSettings.chartSeries.dataLabel?(p.dataLabel=this.persistSettings.chartSeries.dataLabel,p.dataLabel.name="x"):(p.dataLabel={visible:!0,position:"Outside",name:"x"},this.parent.setProperties({chartSettings:{chartSeries:{dataLabel:{visible:!0,position:"Outside"}}}},!0)),this.accEmptyPoint&&p.emptyPointSettings?p.emptyPointSettings.mode="Zero":this.accEmptyPoint&&(p.emptyPointSettings={mode:"Zero"}),p.name=this.currentColumn,"Doughnut"===o?(p.type="Pie",p.innerRadius=this.chartSettings.chartSeries.innerRadius?this.chartSettings.chartSeries.innerRadius:"40%"):"Pie"===o&&(p.innerRadius=this.chartSettings.chartSeries.innerRadius?this.chartSettings.chartSeries.innerRadius:"0"),this.chartSeries=this.chartSeries.concat(p)}else for(var h=0,u=a;h<u.length;h++){var c=u[h];p={};p=this.persistSettings.chartSeries?this.frameChartSeries(this.persistSettings.chartSeries):p,!(0,t.isNullOrUndefined)(p.palettes)&&p.palettes.length>0&&((0,t.isNullOrUndefined)(this.persistSettings.palettes)||0===this.persistSettings.palettes.length)&&(this.chartSettings.palettes=p.palettes);for(d=0;d<this.columnGroupObject[c].length;d++){var g=this.engineModule.fieldList[this.currentMeasure];this.columnGroupObject[c][d].x=0!==this.parent.dataSourceSettings.rows.length||this.chartSettings.showMultiLevelLabels?""===this.columnGroupObject[c][d].x?this.parent.localeObj.getConstant("blank"):this.columnGroupObject[c][d].x:this.parent.localeObj.getConstant("total")+" "+this.parent.localeObj.getConstant(g.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" "+((0,t.isNullOrUndefined)(g.caption)?g.name:g.caption)}p.dataSource=this.columnGroupObject[c],p.xName="x",p.yName="y",p.visible=!0;for(var m=void 0,f=void 0,v=void 0,S=(d=0,c.split(" | "));d<S.length;d++)this.measuresNames&&this.measuresNames[S[d]]&&(f=S[d],v=c.split(" | "+f)[0]);if(this.chartSettings.enableMultipleAxis){var y=f;m=v+" | "+(y=(0,t.isNullOrUndefined)(l[y])?y:l[y])}if(p.name=this.chartSettings.enableMultipleAxis?m:v,this.chartSettings.showPointColorByMembers&&this.chartSettings.enableMultipleAxis){p.name=v;var b=this.chartSeriesInfo[p.name].caption;p.name=null!=b?b:p.name,i[p.name]?(p.fill=i[p.name].color,this.chartSeriesInfo[p.name].colorIndex.push(this.selectedLegend++),p.name=void 0):(e=r[e]?e:0,i[p.name]={name:p.name,color:r[e]},p.fill=r[e++],this.chartSeriesInfo[p.name].colorIndex.push(this.selectedLegend++))}if(["Radar","Polar"].indexOf(o)<0){var C=f;p.tooltipMappingName=this.measuresNames[C],p.yAxisName=this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.measureList.join("_"):this.measuresNames[C]?this.measuresNames[C]:C}this.persistSettings.chartSeries&&this.persistSettings.chartSeries.emptyPointSettings&&(p.emptyPointSettings=this.persistSettings.chartSeries.emptyPointSettings),p.emptyPointSettings||(p.emptyPointSettings={mode:"Zero"}),this.chartSeries=this.chartSeries.concat(p)}var x={series:this.chartSeries,cancel:!1},w=this;this.parent.trigger(Va,x,function(e){e.cancel?(w.element&&(0,t.remove)(w.element),w.parent.notify(mr,{})):w.bindChart()})},e.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},e.prototype.frameChartSeries=function(e){for(var t=Object.keys(e),i=0,a={};i<t.length;)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])>-1||this.accumulationType.indexOf(this.parent.chartSettings.chartSeries.type)<0&&["endAngle","explode","explodeAll","explodeIndex","explodeOffset","gapRatio","groupMode","groupTo","neckHeight","neckWidth","pyramidMode","startAngle","dataLabel","innerRadius"].indexOf(t[i])>-1||(a[t[i]]=e[t[i]]),i++;return a},e.prototype.bindChart=function(){this.parent.showWaitingPopup();var e=this.configXAxis(),i=this.configTooltipSettings(),a=this.configLegendSettings(),r=this.configZoomSettings(),n=this.frameAxesWithRows(),s=this.chartSettings.chartSeries.type;"Both"===this.parent.displayOption.view?this.element="Chart"===this.parent.displayOption.primary?this.parent.element.insertBefore(this.element?this.element:(0,t.createElement)("div",{className:ii,id:this.parent.element.id+"_chart"}),this.parent.element.querySelector("."+ft)):this.parent.element.appendChild(this.element?this.element:(0,t.createElement)("div",{className:ii,id:this.parent.element.id+"_chart"})):this.element||(this.element=this.parent.element.appendChild((0,t.createElement)("div",{className:ii,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("."+ii).innerHTML="",this.chartElement=this.parent.element.querySelector("."+ii).appendChild((0,t.createElement)("div",{className:ci,id:this.parent.element.id+"_chartInner"}))),this.parent.element.querySelector("."+ci)&&(this.parent.element.querySelector("."+ci).innerHTML=""),this.parent.showGroupingBar?this.element.style.minWidth=this.parent.minWidth?this.parent.minWidth+"px":"400px !important":this.element.style.minWidth=this.parent.minWidth?this.parent.minWidth+"px":"310px !important";var o=this.parent.width.toString();this.parent.showToolbar&&this.parent.grid&&(o=this.parent.getGridWidthAsNumber().toString());var l=this.getChartHeight();this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&this.accumulationType.indexOf(s)<0&&"Pareto"!==this.chartSettings.chartSeries.type&&(this.parent.element.querySelector("."+ii).style.height=("auto"===l?this.getChartAutoHeight():l)+"px",this.parent.element.querySelector("."+ii).style.width=o+"px","Polar"!==this.parent.chartSettings.chartSeries.type&&"Radar"!==this.parent.chartSettings.chartSeries.type&&(this.parent.element.querySelector("."+ii).style.overflow="auto",this.parent.element.querySelector("."+ii).style.overflowX="hidden")),this.parent.chart&&("accumulationchart"===this.parent.chart.getModuleName()&&this.accumulationType.indexOf(s)<0||"chart"===this.parent.chart.getModuleName()&&this.accumulationType.indexOf(s)>-1&&"Pareto"!==this.chartSettings.chartSeries.type)&&(this.parent.chart.destroy(),(0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element)&&((0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element).innerHTML="",(0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element).appendChild((0,t.createElement)("div",{className:ci,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,(0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element).innerHTML="",(0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element).appendChild((0,t.createElement)("div",{className:ci,id:this.parent.element.id+"_chartInner"})),this.parent.toolbarModule.isMultiAxisChange=!1),Fo.Chart.Inject(Fo.ColumnSeries,Fo.StackingColumnSeries,Fo.RangeColumnSeries,Fo.BarSeries,Fo.StackingBarSeries,Fo.ScatterSeries,Fo.BubbleSeries,Fo.LineSeries,Fo.StepLineSeries,Fo.SplineSeries,Fo.SplineAreaSeries,Fo.MultiColoredLineSeries,Fo.PolarSeries,Fo.RadarSeries,Fo.AreaSeries,Fo.RangeAreaSeries,Fo.StackingAreaSeries,Fo.StepAreaSeries,Fo.StackingLineSeries,Fo.MultiColoredAreaSeries,Fo.ParetoSeries,Fo.Legend,Fo.Tooltip,Fo.Category,Fo.MultiLevelLabel,Fo.ScrollBar,Fo.Zoom,Fo.Export,Fo.Crosshair,Fo.Selection,Fo.StripLine,Fo.DataLabel),Fo.AccumulationChart.Inject(Fo.PieSeries,Fo.FunnelSeries,Fo.PyramidSeries,Fo.AccumulationDataLabel,Fo.AccumulationLegend,Fo.AccumulationTooltip,Fo.Export),this.accumulationType.indexOf(s)>-1?this.parent.chart=new Fo.AccumulationChart({series:this.chartSeries.length>0?this.chartSeries:[{}],legendSettings:a,tooltip:i,width:o,height:l.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.chartSettings.enableExport,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 Fo.Chart({series:this.chartSeries.length>0?this.chartSeries:[{}],legendSettings:a,tooltip:i,zoomSettings:r,axes:"Polar"===s||"Radar"===s?[]:n.axes,rows:"Polar"===s||"Radar"===s?[{}]:"Bar"===s||"StackingBar"===s||"StackingBar100"===s||"Pareto"===s&&this.chartSettings.enableMultipleAxis?[{height:"100%"}]:n.rows,columns:"Polar"===s||"Radar"===s?[{}]:"Bar"===s||"StackingBar"===s||"StackingBar100"===s&&this.chartSettings.enableMultipleAxis?n.columns:[{width:"100%"}],primaryYAxis:"Polar"===s||"Radar"===s?n.axes[0]:{visible:!1},primaryXAxis:e,width:o,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&&this.parent.dataSourceSettings.values.length>0?Number(l)>235*this.parent.dataSourceSettings.values.length+100?isNaN(Number(l))?l.toString():(Number(l)-5).toString():!isNaN(Number(l))||this.parent.dataSourceSettings.values.length>1?(235*this.parent.dataSourceSettings.values.length+100).toString():l.toString():l.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:(0,t.isNullOrUndefined)(this.persistSettings.chartArea)?this.chartSettings.chartArea: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.chartSettings.enableExport,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=a,this.parent.chart.selectionMode=this.parent.chartSettings.selectionMode,this.parent.chart.enableExport=this.chartSettings.enableExport,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,this.parent.chartSettings&&this.parent.chartSettings.tooltip&&this.parent.chartSettings.tooltip.textStyle&&(this.parent.chart.tooltip.textStyle=this.parent.chartSettings.tooltip.textStyle),this.accumulationType.indexOf(s)>-1?(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"===s||"Radar"===s?(this.parent.chart.primaryXAxis=e,this.parent.chart.primaryYAxis.visible=!0,this.parent.chart.primaryYAxis=n.axes[0],this.parent.chart.axes=[],this.parent.chart.rows=[{}]):this.accumulationType.indexOf(s)<0&&"chart"===this.parent.chart.getModuleName()&&(this.parent.chart.primaryYAxis.visible=!1,this.parent.chart.primaryXAxis=e,this.parent.chart.axes=n.axes,"Bar"===s||"StackingBar"===s||"StackingBar100"===s&&this.chartSettings.enableMultipleAxis?(this.parent.chart.rows=[{height:"100%"}],this.parent.chart.columns=n.columns):"Pareto"===s&&this.chartSettings.enableMultipleAxis?(this.parent.chart.rows=[{height:"100%"}],this.parent.chart.columns=[{width:"100%"}]):(this.parent.chart.rows=n.rows,this.parent.chart.columns=[{width:"100%"}])),this.parent.chart.refresh(),this.accumulationType.indexOf(s)>-1&&"accumulationchart"===this.parent.chart.getModuleName()&&(0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length)&&(this.parent.hideWaitingPopup(),this.parent.pivotFieldListModule&&(0,Bs.hideSpinner)(this.parent.pivotFieldListModule.fieldListSpinnerElement))),this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis?this.parent.chart.appendTo((0,t.select)("#"+this.parent.element.id+"_chartInner",this.parent.element)):this.parent.chart.appendTo((0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element))},e.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(va,e)},e.prototype.pointClick=function(e){var t=e.series.dataSource?e.series.dataSource:this.parent.chart.series[e.seriesIndex].dataSource;if((["Pie","Funnel","Doughnut","Pyramid","Radar","Polar"].indexOf(this.parent.chartSettings.chartSeries.type)>-1||!this.parent.chartSettings.showMultiLevelLabels)&&("olap"===this.parent.dataType||this.parent.dataSourceSettings.rows.length>1)){this.pivotIndex={rIndex:t?t[e.pointIndex].rIndex:void 0,cIndex:t?t[e.pointIndex].cIndex:void 0},this.creatMenu();var i=!(!this.parent.chart||!this.parent.chart.element),a=this.parent.element.getBoundingClientRect();i&&(a=this.parent.chart.element.getBoundingClientRect());var r=window.scrollY||document.documentElement.scrollTop,n=window.scrollX||document.documentElement.scrollLeft,s=a.top+r;if(!i){var o=this.parent.element.querySelector(".e-pivot-toolbar"),l=this.parent.element.querySelector(".e-pivot-grouping-bar");s+=(o?o.clientHeight:0)+(l?l.clientHeight:0)}this.accumulationMenu.open(s+e.y,e.x+a.left+n)}else if((this.parent.allowDrillThrough||this.parent.editSettings.allowEditing)&&this.parent.drillThroughModule){var d=t[e.pointIndex].rIndex,p=t[e.pointIndex].cIndex;this.parent.drillThroughModule.executeDrillThrough(this.parent.pivotValues[d][p],d,p)}this.parent.trigger(rr,e)},e.prototype.frameAxesWithRows=function(){var e=[],i=[],a=[],r=[],n=this.persistSettings.chartSeries&&("StackingColumn100"===this.persistSettings.chartSeries.type||"StackingBar100"===this.persistSettings.chartSeries.type||"StackingArea100"===this.persistSettings.chartSeries.type||"StackingLine100"===this.persistSettings.chartSeries.type),s=["PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfDifferenceFrom","PercentageOfParentRowTotal","PercentageOfParentColumnTotal","PercentageOfParentTotal","PercentageOfRunningTotals"];if(this.chartSettings.enableMultipleAxis)for(var o=0,l=100/this.dataSourceSettings.values.length+"%",d=0,p=this.dataSourceSettings.values;d<p.length;d++){var h=p[d],u=this.engineModule.fieldList[h.name],c=("olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(u.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" ")+u.caption;r.push(c);for(var g=void 0,m=0,f=this.dataSourceSettings.formatSettings;m<f.length;m++){var v=f[m];if(v.name===h.name){g=v;break}}var S=-1!==Hs.inArray(u.aggregateType,s)?"P2":g?g.format:"olap"===this.parent.dataType?this.getFormat(u.formatString):"",y="Polar"===this.chartSettings.chartSeries.type||"Radar"===this.chartSettings.chartSeries.type,b={};(b=this.persistSettings.primaryYAxis?this.frameObjectWithKeys(this.persistSettings.primaryYAxis):b).labelFormat=b.labelFormat?b.labelFormat:n||y?"":S,b.title=b.title?b.title:"Combined"===this.chartSettings.multipleAxisMode?r.join(" - "):c,b.zoomFactor=(0,t.isNullOrUndefined)(this.chartSettings.primaryYAxis.zoomFactor)?1:this.chartSettings.primaryYAxis.zoomFactor,b.edgeLabelPlacement=this.chartSettings.primaryYAxis.edgeLabelPlacement?this.chartSettings.primaryYAxis.edgeLabelPlacement:this.persistSettings.primaryYAxis.edgeLabelPlacement,"Bar"===this.chartSettings.chartSeries.type||"StackingBar"===this.chartSettings.chartSeries.type||"StackingBar100"===this.chartSettings.chartSeries.type?b.plotOffsetRight=b.plotOffsetRight?b.plotOffsetRight:30:b.plotOffsetTop=b.plotOffsetTop?b.plotOffsetTop:30,y||(b.name="Combined"===this.chartSettings.multipleAxisMode?this.measureList.join("_"):this.measuresNames[h.name]?this.measuresNames[h.name]:h.name),e=e.concat(b),"Combined"===this.chartSettings.multipleAxisMode&&(e=[e[e.length-1]]),"Stacked"===this.chartSettings.multipleAxisMode?(b.rowIndex=o,b.columnIndex=o,i.push({height:l}),a.push({width:l})):(b.rowIndex=0,b.columnIndex=0,i=[{height:"100%"}],a=[{width:"100%"}]),o++}else{u=this.engineModule.fieldList[this.currentMeasure],c=("olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(u.aggregateType)+" "+this.parent.localeObj.getConstant("of")+" ")+u.caption,g=void 0;for(var C=0,x=this.dataSourceSettings.formatSettings;C<x.length;C++){if((h=x[C]).name===this.currentMeasure){g=h;break}}b={},S=-1!==Hs.inArray(u.aggregateType,s)?"P2":g?g.format:"olap"===this.parent.dataType?this.getFormat(u.formatString):"";(b=this.persistSettings.primaryYAxis?this.frameObjectWithKeys(this.persistSettings.primaryYAxis):b).zoomFactor=(0,t.isNullOrUndefined)(this.chartSettings.primaryYAxis.zoomFactor)?1:this.chartSettings.primaryYAxis.zoomFactor,b.rowIndex=0,b.columnIndex=0,b.edgeLabelPlacement=this.chartSettings.primaryYAxis.edgeLabelPlacement?this.chartSettings.primaryYAxis.edgeLabelPlacement:this.persistSettings.primaryYAxis.edgeLabelPlacement,"Polar"!==this.chartSettings.chartSeries.type&&"Radar"!==this.chartSettings.chartSeries.type&&(b.name=this.measuresNames[this.currentMeasure]?this.measuresNames[this.currentMeasure]:this.currentMeasure),b.labelFormat=b.labelFormat?b.labelFormat:n?"":S,b.title=b.title?b.title:c,e=e.concat(b),i.push({height:"100%"}),a.push({width:"100%"})}return{axes:e,rows:i,columns:a}},e.prototype.getFormat=function(e){return e="Currency"===e?"C":"Percent"===e?"P":""},e.prototype.getColumnTotalIndex=function(e){for(var i={},a=0,r=Object.keys(e);a<r.length;a++){var n=r[a],s=e[Number(n)];if(!(0,t.isNullOrUndefined)(s))for(var o=0,l=Object.keys(s);o<l.length;o++){var d=l[o],p=s[Number(d)];if(!(0,t.isNullOrUndefined)(p)){if("column"!==p.axis)return i;"sum"!==p.type&&(this.dataSourceSettings&&this.dataSourceSettings.columns&&0===this.dataSourceSettings.columns.length||"grand sum"!==p.type)||-1===p.rowSpan||(i[p.colIndex]=p.colIndex)}}}return i},e.prototype.groupHierarchyWithLevels=function(e,i){var a,r,n={},s=0,o={};this.measurePos=this.engineModule.tupRowInfo[0].measurePosition;for(var l=0;l<e.length;l++){var d=e[l][0];d&&"row"===d.axis&&"grand sum"!==d.type&&((0,t.isNullOrUndefined)(n[d.hierarchy])?(3===d.memberType?s===this.measurePos?(i[this.measurePos]=d.hierarchy,n[d.hierarchy]=((a={})[d.levelUniqueName]=d.levelUniqueName,a)):s--:(i[s]=d.hierarchy,n[d.hierarchy]=((r={})[d.levelUniqueName]=d.levelUniqueName,r)),s++):n[d.hierarchy][d.levelUniqueName]=d.levelUniqueName)}for(var p=-1,h=0;h<i.length;h++)this.measurePos!==h&&(o[i[h]]={start:p+1,end:p+Object.keys(n[i[h]]).length},p=o[i[h]].end);return o},e.prototype.frameMultiLevelLabels=function(){for(var e=Object.keys(this.headerColl),i=this.headerColl[-.5],a=0,r=e;a<r.length;a++){for(var n=r[a],s=Number(n),o=this.headerColl[s],l=0,d=!1;l<=this.maxLevel;)d?o[l]||(o[l]={name:o[l-1].name,text:"",hasChild:o[l-1].hasChild,isDrilled:o[l-1].isDrilled,levelName:o[l-1].levelName,level:o[l-1].level,fieldName:o[l-1].fieldName,rowIndex:o[l-1].rowIndex,colIndex:o[l-1].colIndex,span:-1}):o[l]?d=!0:o[l]=i[l],l++;i=this.headerColl[s]}for(var p={},h=0,u=e;h<u.length;h++){n=u[h],s=Number(n),o=this.headerColl[s];for(var c=0,g=Object.keys(o);c<g.length;c++){var m=g[c],f=Number(m);if(p[f]){var v=p[f].length;o[f].levelName===i[f].levelName?p[f][v-1].end=p[f][v-1].end+1:p[f].push({start:s,end:s+1,text:o[f].text,type:(0,t.isNullOrUndefined)(this.persistSettings.primaryXAxis)||(0,t.isNullOrUndefined)(this.persistSettings.primaryXAxis.border)||(0,t.isNullOrUndefined)(this.persistSettings.primaryXAxis.border.type)?-1===o[f].span?"WithoutTopandBottomBorder":"WithoutTopBorder":this.persistSettings.primaryXAxis.border.type,customAttributes:o[f]})}else p[f]=[{start:s,end:s+1,text:o[f].text,type:(0,t.isNullOrUndefined)(this.persistSettings.primaryXAxis)||(0,t.isNullOrUndefined)(this.persistSettings.primaryXAxis.border)||(0,t.isNullOrUndefined)(this.persistSettings.primaryXAxis.border.type)?-1===o[f].span?"WithoutTopandBottomBorder":"WithoutTopBorder":this.persistSettings.primaryXAxis.border.type,customAttributes:o[f]}]}i=o}for(var S=[],y=Object.keys(p).length-1;y>-1;y--)S.push({categories:p[y],border:{width:1},overflow:"Trim"});return S},e.prototype.getZoomFactor=function(){this.calculatedWidth=this.getCalulatedWidth();var e=10*this.chartSeries.length>120?10*this.chartSeries.length:120,t=this.chartSeries.length>0?this.calculatedWidth/(Object.keys(this.chartSeries[0].dataSource).length*e):1;return t=t<1&&t>0?t:1},e.prototype.getCalulatedWidth=function(){return isNaN(Number(this.parent.width))?this.parent.width.indexOf("%")>-1?this.calculatedWidth=this.parent.element.clientWidth*(parseFloat(this.parent.width)/100):this.parent.width.indexOf("px")>-1?this.calculatedWidth=Number(this.parent.width.toString().split("px")[0]):this.calculatedWidth=this.parent.element.clientWidth:this.calculatedWidth=Number(this.parent.width),this.calculatedWidth},e.prototype.configTooltipSettings=function(){var e=this.persistSettings&&this.persistSettings.tooltip?this.persistSettings.tooltip:this.chartSettings.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?e.template:this.parent.tooltipTemplate),e.header=e.header?e.header:"",e.textStyle=e.textStyle?e.textStyle:{},e.enableMarker=void 0===e.enableMarker||e.enableMarker,e},e.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?e.padding:25,e.shapePadding=e.shapePadding?e.shapePadding:10,e},e.prototype.configXAxis=function(){var e={};return(e=this.persistSettings.primaryXAxis?this.frameObjectWithKeys(this.persistSettings.primaryXAxis):e).valueType="Category",e.labelIntersectAction=e.labelIntersectAction?e.labelIntersectAction:"Rotate45",e.title=e.title?e.title:this.dataSourceSettings.rows.map(function(e){return e.caption||e.name}).join(" / "),e.zoomFactor=(0,t.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:(0,t.isNullOrUndefined)(this.persistSettings.primaryXAxis)||(0,t.isNullOrUndefined)(this.persistSettings.primaryXAxis.border)||(0,t.isNullOrUndefined)(this.persistSettings.primaryXAxis.border.type)?"WithoutTopandBottomBorder":this.persistSettings.primaryXAxis.border.type},e.majorTickLines={width:0,height:-10}):(e.multiLevelLabels=[],e.border={width:1,type:(0,t.isNullOrUndefined)(this.persistSettings.primaryXAxis)||(0,t.isNullOrUndefined)(this.persistSettings.primaryXAxis.border)||(0,t.isNullOrUndefined)(this.persistSettings.primaryXAxis.border.type)?"Rectangle":this.persistSettings.primaryXAxis.border.type},e.majorTickLines={width:0,height:5}),e},e.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},e.prototype.tooltipRender=function(e){var i=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.measuresNames[this.currentMeasure]:this.currentMeasure,a=e.series.dataSource?e.series.dataSource:this.parent.chart.series[e.data.seriesIndex].dataSource,r=a?a[e.data.pointIndex].rIndex:void 0,n=a?a[e.data.pointIndex].cIndex:void 0,s=this.engineModule.fieldList[this.measuresNames[i]?this.measuresNames[i]:i],o="olap"===this.parent.dataType?"":this.parent.localeObj.getConstant(s.aggregateType),l=("olap"===this.parent.dataType?"":o+" "+this.parent.localeObj.getConstant("of")+" ")+s.caption,d=this.engineModule.pivotValues[r][n].formattedText,p=this.engineModule.formatFields[s.id],h=this.engineModule.getFormattedValue(e.point.y,s.id,d),u=p&&p.format&&null!==p.format.toLowerCase().match(/n|p|c/)&&this.chartSettings.useGroupingSeparator?"olap"===this.parent.dataType?h.toString():h.formattedText:d,c=this.parent.pivotValues[r][n],g=c.columnHeaders,m="";if((0,t.isNullOrUndefined)(g))m=void 0;else if("olap"===this.parent.dataType)m=this.chartSeriesInfo[g.toString().split(/~~|::/).join(" - ")].uniqueName;else{var f=g.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter);g=Hs.formatChartHeaders(f,this,!0,c),m=this.chartSeriesInfo[g.toString()].uniqueName}var v=e.point.x;if(this.parent.tooltipTemplate&&void 0!==this.parent.getTooltipTemplate()||this.chartSettings.tooltip.template){var S=a?this.parent.getHeaderField(r,n,"row"):"",y=a?this.parent.getHeaderField(r,n,"Column"):"",b={rowHeaders:v,columnHeaders:m,aggregateType:o,value:u,valueField:s.caption,rowFields:S,columnFields:y},C=void 0;C=this.parent.chartSettings&&this.parent.chartSettings.tooltip&&this.parent.chartSettings.tooltip.enable&&this.parent.chartSettings.tooltip.template?this.tooltipTemplateFn()(b,this,"tooltipTemplate",this.element.id+"1tooltipTemplate")[0].outerHTML:this.parent.getTooltipTemplate()(b,this,"tooltipTemplate",this.element.id+"tooltipTemplate")[0].outerHTML,e.template=C}else e.text=l+": "+u+(0===this.dataSourceSettings.columns.length?"":" <br/>"+this.parent.localeObj.getConstant("column")+": "+m)+(0===this.dataSourceSettings.rows.length?"":" <br/>"+this.parent.localeObj.getConstant("row")+": "+v)+(e.data&&"Pareto"===e.data.seriesName?" <br/>"+this.parent.localeObj.getConstant("pareto")+": "+e.data.pointY+"%":""),this.parent.trigger(fa,e)},e.prototype.tooltipTemplateFn=function(){return this.templateFn},e.prototype.loaded=function(e){this.parent.isChartLoaded=!0;var i=this.parent.grid?this.parent.getGridWidthAsNumber().toString():this.parent.getWidthAsNumber().toString();if(this.parent.chart&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.showFieldList&&"Chart"===this.parent.currentView&&this.parent.groupingBarModule.alignIcon(),this.chartSettings.showMultiLevelLabels){var a=Hs.inArray(this.chartSettings.chartSeries.type,["Bar","StackingBar","StackingBar100"])>-1?"_chartYAxisMultiLevelLabel0":"_chartXAxisMultiLevelLabel0";(0,t.isNullOrUndefined)((0,t.select)("#"+this.parent.element.id+a,this.parent.element))||this.parent.element.querySelector("#"+this.parent.element.id+a).setAttribute("cursor","pointer")}var r=this.getChartHeight();this.parent.chart.height=r,this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&(["Pie","Funnel","Pyramid","Doughnut","Radar","Polar","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)>=0?this.parent.element.querySelector("."+ii).style.overflow="visible":(this.parent.element.querySelector("."+ii).style.overflow="auto",this.parent.element.querySelector("."+ii).style.overflowX="hidden"),this.parent.element.querySelector("."+ii).style.width=i+"px",this.parent.element.querySelector("."+ii).style.height=r+"px"),this.updateView(),"Chart"!==this.parent.displayOption.primary&&"Chart"!==this.parent.displayOption.view||this.parent.notify(mr,{}),this.parent.trigger(Sa,e),("Server"===this.parent.dataSourceSettings.mode&&this.parent.isServerWaitingPopup||"Local"===this.parent.dataSourceSettings.mode)&&this.parent.hideWaitingPopup()},e.prototype.updateView=function(){if(this.parent.grid&&this.parent.chart&&this.parent.showToolbar){var 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("."+E)&&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("."+E)&&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=""))}},e.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"],i=[],a=0;a<e.length;a++)i.push({id:this.parent.element.id+"_DrillMenuChart_"+e[a],text:this.parent.localeObj.getConstant(e[a]),items:[]});var r=this.getMenuItems(),n=[],s=[];for(a=0;a<r.length;a++)"expand"===r[a].type?n.push({id:this.element.id+"drillExpand_"+r[a].key,text:r[a].value}):s.push({id:this.element.id+"drillCollapse_"+r[a].key,text:r[a].value});n.length>0&&(i[0].items=n),s.length>0&&(i[1].items=s);var o,l={cssClass:this.parent.element.id+"_accumulationChart"+(this.parent.cssClass?" "+this.parent.cssClass:""),items:i,enableRtl:this.parent.enableRtl,beforeOpen:this.drillMenuOpen.bind(this),select:this.drillMenuSelect.bind(this),locale:this.parent.locale};this.accumulationMenu=new Gs.ContextMenu(l),(0,t.select)("#"+this.parent.element.id+"_accumulationChart",this.parent.element)?(o=(0,t.select)("#"+this.parent.element.id+"_accumulationChart",this.parent.element)).innerHTML="":(o=(0,t.createElement)("ul",{id:this.parent.element.id+"_accumulationChart"}),this.parent.element.appendChild(o)),this.accumulationMenu.isStringTemplate=!0,this.accumulationMenu.isAngular=this.parent.isModalDialog,this.accumulationMenu.appendTo(o)},e.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)},e.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];){if(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);var o=s.indexOf(r.formattedText.toString());s.splice(o,1)}0===r.level&&r.hasChild&&!r.isNamedSet&&(n=void 0,a=[]),e--}return t},e.prototype.drillMenuSelect=function(e){var t="olap"===this.parent.dataType?this.parent.olapEngineModule.pivotValues:this.parent.engineModule.pivotValues,i=e.element.id.split("_DrillMenuChart_")[1];if(0===e.element.id.indexOf(this.element.id+"drill")){var a=e.element.id.split(this.element.id+"drill")[1].indexOf("Expand")>=0?"drillExpand":"drillCollapse",r=Number(e.element.id.split(this.element.id+a+"_")[1]),n=t[r][0],s="olap"===this.parent.dataType?n.formattedText:n.actualText?n.actualText.toString():n.formattedText.toString(),o=n.formattedText?n.formattedText.toString():s,l=n.hasChild&&!n.isNamedSet?(n.isDrilled?" - ":" + ")+o:o,d="olap"===this.parent.dataType?this.engineModule.tupRowInfo[n.ordinal]:void 0,p=d?d.uNameCollection:n.valueSort.levelName.toString(),h={fieldName:n.valueSort.axis,level:n.level,hasChild:n.hasChild,levelName:p,name:s,text:l,rowIndex:r,colIndex:0,isDrilled:n.isDrilled,cell:n};"olap"===this.parent.dataType?this.parent.onDrill(void 0,h):this.onDrill({customAttributes:h})}else"drillThrough"===i?this.parent.drillThroughModule.executeDrillThrough(t[this.pivotIndex.rIndex][this.pivotIndex.cIndex],this.pivotIndex.rIndex,this.pivotIndex.rIndex):"exit"===i&&this.accumulationMenu.close()},e.prototype.getChartHeight=function(){var e,i;if((0,t.isNullOrUndefined)(this.parent.getHeightAsNumber()))e="auto";else{var a=this.parent.showToolbar?6:5;e=(this.parent.getHeightAsNumber()-a).toString(),i=this.parent.getHeightAsNumber()-a}if((0,t.isNullOrUndefined)(this.parent.getHeightAsNumber()))e="auto";else{var r=!1;null!==this.parent.element.querySelector(".e-chart-grouping-bar")&&"none"===this.parent.element.querySelector(".e-chart-grouping-bar").style.display.toLowerCase()&&(r=!0,this.parent.element.querySelector(".e-chart-grouping-bar").style.display="block"),this.parent.showToolbar&&this.parent.showGroupingBar?e=(i-(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").offsetHeight:42)-(this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").offsetHeight:62)).toString():this.parent.showToolbar?e=(i-(this.parent.element.querySelector(".e-pivot-toolbar")?this.parent.element.querySelector(".e-pivot-toolbar").offsetHeight:42)).toString():this.parent.showGroupingBar?e=(i-(this.parent.element.querySelector(".e-chart-grouping-bar")?this.parent.element.querySelector(".e-chart-grouping-bar").offsetHeight:62)).toString():(this.parent.chart&&parseInt(this.parent.chart.height,10)<200||i<200)&&(e="200"),r&&(this.parent.element.querySelector(".e-chart-grouping-bar").style.display="none")}return e},e.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},e.prototype.axisLabelRender=function(e){if(this.chartSettings.showMultiLevelLabels&&"Pareto"!==this.chartSettings.chartSeries.type&&"primaryXAxis"===e.axis.name&&(e.text=""),"primaryXAxis"!==e.axis.name&&"StackingColumn100"!==this.parent.chartSettings.chartSeries.type&&"StackingBar100"!==this.parent.chartSettings.chartSeries.type&&"StackingArea100"!==this.parent.chartSettings.chartSeries.type&&"StackingLine100"!==this.parent.chartSettings.chartSeries.type){var t=this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.currentMeasure:"olap"===this.parent.dataType?this.measuresNames[e.axis.name]:e.axis.name,i=this.engineModule.formatFields[t]||null,a=this.engineModule.getFormattedValue(e.value,this.chartSettings.enableMultipleAxis&&"Combined"===this.chartSettings.multipleAxisMode?this.currentMeasure:e.axis.name,e.text),r=void 0;r=i&&i.format&&this.chartSettings.useGroupingSeparator?"olap"===this.parent.dataType?a.toString():a.formattedText:e.axis.labelFormat?this.parent.globalize.formatNumber(e.value,{format:e.axis.labelFormat}):e.value.toString(),e.text=r}this.parent.trigger(Ha,e)},e.prototype.multiLevelLabelClick=function(e){var i={axis:e.axis,text:e.text,cell:(0,t.isNullOrUndefined)(e.customAttributes)?void 0:e.customAttributes.cell,cancel:!1};this.parent.trigger(oa,i),!i.cancel&&e.customAttributes&&e.customAttributes.hasChild&&!e.customAttributes.cell.isNamedSet&&("olap"===this.parent.dataType?this.parent.onDrill(void 0,e.customAttributes):this.onDrill(e))},e.prototype.onDrill=function(e){var t=this,i=e.customAttributes,a=this.dataSourceSettings.drilledMembers[0]&&this.dataSourceSettings.drilledMembers[0].delimiter?this.dataSourceSettings.drilledMembers[0].delimiter:"**",r=i.fieldName,n=Hs.getFieldInfo(r,this.parent),s=i.isDrilled?Or:Nr;if(this.parent.actionObj.actionName=s,this.parent.actionObj.fieldInfo=n.fieldItem,!this.parent.actionBeginMethod()){var o="Tabular"===this.parent.gridSettings.layout?!this.parent.dataSourceSettings.showSubTotals||!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals||this.engineModule&&!this.engineModule.fieldList[i.fieldName].showSubTotals?i.level:this.parent.engineModule.rowMaxLevel:i.colIndex,l=this.engineModule.pivotValues[i.rowIndex][o],d=l.valueSort.levelName.split(this.engineModule.valueSortSettings.headerDelimiter).join(a),p=Hs.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers),h=!1;if(0===this.dataSourceSettings.drilledMembers.length)this.parent.setProperties({dataSourceSettings:{drilledMembers:[{name:r,items:[d],delimiter:a}]}},!0);else{for(var u=0;u<this.dataSourceSettings.drilledMembers.length;u++){var c=this.dataSourceSettings.drilledMembers[u];if(d=d.split(a).join(c.delimiter?c.delimiter:a),a=c.delimiter=c.delimiter?c.delimiter:a,c.name===r){h=!0;var g=c.items.indexOf(d);g>-1?c.items.splice(g,1):c.items.push(d)}}h||this.dataSourceSettings.drilledMembers.push({name:r,items:[d],delimiter:a})}this.parent.showWaitingPopup();var m=this,f={fieldName:r,memberName:d,delimiter:a,axis:"row",action:i.isDrilled?"up":"down",currentCell:l},v={drillInfo:f,pivotview:m.parent,cancel:!1};try{m.parent.trigger(ea,v,function(e){if(e.cancel)return t.parent.setProperties({dataSourceSettings:{drilledMembers:p}},!0),void t.parent.hideWaitingPopup();var i={dataSourceSettings:Hs.getClonedDataSourceSettings(t.parent.dataSourceSettings)};t.parent.trigger(Pi,i),t.parent.setProperties({dataSourceSettings:i.dataSourceSettings},!0),m.parent.enableVirtualization||m.parent.enablePaging?"Server"===m.parent.dataSourceSettings.mode?m.parent.getEngine("onDrill",f,null,null,null,null,null):(m.engineModule.drilledMembers=m.dataSourceSettings.drilledMembers,m.engineModule.onDrill(f)):"Server"===m.parent.dataSourceSettings.mode?m.parent.getEngine("onDrill",f,null,null,null,null,null):m.engineModule.generateGridData(m.dataSourceSettings,!0),m.parent.allowServerDataBinding=!1,t.parent.setProperties({pivotValues:m.engineModule.pivotValues},!0),m.parent.allowServerDataBinding=!0;var a={dataSourceSettings:Hs.getClonedDataSourceSettings(t.parent.dataSourceSettings),pivotValues:t.parent.pivotValues};t.parent.trigger(Ei,a),m.engineModule.pivotValues=a.pivotValues;var r={drillInfo:f};t.parent.actionObj.actionInfo=r,t.parent.renderPivotGrid()})}catch(e){this.parent.setProperties({dataSourceSettings:{drilledMembers:p}},!0),this.parent.hideWaitingPopup(),this.parent.actionFailureMethod(e)}}},e.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)+(t[o].uName.indexOf("[Measures]")>-1?"[Measures]":t[o].uName));if(s===this.dataSourceSettings.drilledMembers[a].items[r]){i=!0;break}}return i},e.prototype.load=function(e){e.chart.zoomModule&&(e.chart.zoomModule.isZoomed=!0),this.parent.trigger(ja,e)},e.prototype.beforePrint=function(e){this.parent.trigger(ba,e)},e.prototype.animationComplete=function(e){this.parent.trigger(Ca,e)},e.prototype.legendRender=function(e){this.parent.trigger(xa,e)},e.prototype.textRender=function(e){this.parent.trigger(wa,e)},e.prototype.pointRender=function(e){this.parent.trigger(Ta,e)},e.prototype.seriesRender=function(e){this.parent.trigger(Ma,e)},e.prototype.chartMouseMove=function(e){this.parent.trigger(Da,e)},e.prototype.chartMouseClick=function(e){this.parent.trigger(Oa,e)},e.prototype.pointMove=function(e){this.parent.trigger(Na,e)},e.prototype.chartMouseLeave=function(e){this.parent.trigger(Pa,e)},e.prototype.chartMouseDown=function(e){this.parent.trigger(Ea,e)},e.prototype.chartMouseUp=function(e){this.parent.trigger(Ia,e)},e.prototype.dragComplete=function(e){this.parent.trigger(Fa,e)},e.prototype.zoomComplete=function(e){this.parent.trigger(La,e)},e.prototype.scrollStart=function(e){this.parent.trigger(Aa,e)},e.prototype.scrollEnd=function(e){this.parent.trigger(Ra,e)},e.prototype.scrollChanged=function(e){this.parent.trigger(ka,e)},e.prototype.multiLevelLabelRender=function(e){this.parent.trigger(ya,e)},e.prototype.resized=function(e){this.accumulationType.indexOf(this.chartSettings.chartSeries.type)<0&&(e.chart.primaryXAxis.zoomFactor=(0,t.isNullOrUndefined)(this.parent.chartSettings.primaryXAxis.zoomFactor)?this.getZoomFactor():this.parent.chartSettings.primaryXAxis.zoomFactor,this.parent.chartSettings.zoomSettings.enableScrollbar||(e.chart.primaryXAxis.zoomFactor=(0,t.isNullOrUndefined)(this.parent.chartSettings.primaryXAxis.zoomFactor)?1:this.parent.chartSettings.primaryXAxis.zoomFactor)),this.parent.trigger(qa,e)},e.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&&this.parent.dataSourceSettings.values.length>0?Number(this.parent.chart.height)>235*this.parent.dataSourceSettings.values.length+100?isNaN(Number(this.getChartHeight()))?this.getChartHeight().toString():(Number(this.getChartHeight())-5).toString():!isNaN(Number(this.getChartHeight()))||this.parent.dataSourceSettings.values.length>1?(235*this.parent.dataSourceSettings.values.length+100).toString():this.getChartHeight().toString():this.getChartHeight().toString()},e.prototype.destroy=function(){if(!this.parent||!this.parent.isDestroyed){if(this.accumulationMenu&&!this.accumulationMenu.isDestroyed&&(this.accumulationMenu.destroy(),this.accumulationMenu=null),(0,t.select)("#"+this.parent.element.id+"_accumulationChart",this.parent.element)&&(0,t.remove)((0,t.select)("#"+this.parent.element.id+"_accumulationChart",this.parent.element)),this.parent&&this.parent.chart&&!this.parent.chart.isDestroyed)this.parent.chart.destroy(),this.parent.chart=null;else if(this.parent&&!this.parent.chart&&(0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element)){var e=(0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element);(0,t.getInstance)(e,Fo.Chart).destroy(),(0,t.remove)(e)}if(this.chartElement&&(this.chartElement.parentNode&&this.chartElement.parentNode.removeChild(this.chartElement),this.chartElement=null),this.element&&(this.element.parentNode&&this.element.parentNode.removeChild(this.element),this.element=null),this.templateFn&&(this.templateFn=null),this.engineModule&&!this.parent.destroyEngine&&(this.engineModule.fieldList={},this.engineModule=null),this.chartSeries&&(this.chartSeries.length=0,this.chartSeries=null),this.columnGroupObject){for(var i in this.columnGroupObject)Object.prototype.hasOwnProperty.call(this.columnGroupObject,i)&&(this.columnGroupObject[i]=null);this.columnGroupObject=null}if(this.chartSeriesInfo){for(var i in this.chartSeriesInfo)Object.prototype.hasOwnProperty.call(this.chartSeriesInfo,i)&&(this.chartSeriesInfo[i]=null);this.chartSeriesInfo={},this.selectedLegend=null}if(this.headerColl){for(var i in this.headerColl)Object.prototype.hasOwnProperty.call(this.headerColl,i)&&(this.headerColl[i]=null);this.headerColl={}}if(this.measuresNames){for(var i in this.measuresNames)Object.prototype.hasOwnProperty.call(this.measuresNames,i)&&delete this.measuresNames[i];this.measuresNames={}}this.chartSettings=null,this.persistSettings=null,this.dataSourceSettings=null,this.currentColumn=null,this.currentMeasure=null,this.pivotIndex=null,this.measureList=null,this.maxLevel=0,this.measurePos=-1,this.accEmptyPoint=!1,this.isChartInitial=!0,this.calculatedWidth=null}},e}(),Ao={size:"12px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},Ro={size:"14px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},ko={size:"15px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},jo={size:"11px",fontWeight:"500",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},qo={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},Ho={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},Vo={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},Uo={size:"12px",fontWeight:"Regular",color:"#353535",fontStyle:"Normal",fontFamily:"Segoe UI"},Bo={size:"13px",fontWeight:"Normal",color:null,fontStyle:"Normal",fontFamily:"Segoe UI"},_o=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function a(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Go=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;o>=0;o--)(r=e[o])&&(s=(n<3?r(s):n>3?r(t,i,s):r(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s},zo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(!0)],i.prototype,"enable",void 0),Go([(0,t.Property)(1e3)],i.prototype,"duration",void 0),Go([(0,t.Property)(0)],i.prototype,"delay",void 0),i}(t.ChildProperty),Wo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(null)],i.prototype,"value",void 0),Go([(0,t.Property)(null)],i.prototype,"color",void 0),Go([(0,t.Property)("0")],i.prototype,"dashArray",void 0),i}(t.ChildProperty),Qo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)("Normal")],i.prototype,"fontStyle",void 0),Go([(0,t.Property)("16px")],i.prototype,"size",void 0),Go([(0,t.Property)("Normal")],i.prototype,"fontWeight",void 0),Go([(0,t.Property)("")],i.prototype,"color",void 0),Go([(0,t.Property)("Center")],i.prototype,"textAlignment",void 0),Go([(0,t.Property)("Segoe UI")],i.prototype,"fontFamily",void 0),Go([(0,t.Property)(1)],i.prototype,"opacity",void 0),Go([(0,t.Property)("Trim")],i.prototype,"textOverflow",void 0),i}(t.ChildProperty),Yo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(10)],i.prototype,"left",void 0),Go([(0,t.Property)(10)],i.prototype,"right",void 0),Go([(0,t.Property)(10)],i.prototype,"top",void 0),Go([(0,t.Property)(10)],i.prototype,"bottom",void 0),i}(t.ChildProperty),Ko=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)("")],i.prototype,"color",void 0),Go([(0,t.Property)(1)],i.prototype,"width",void 0),i}(t.ChildProperty),Xo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(0)],i.prototype,"x",void 0),Go([(0,t.Property)(0)],i.prototype,"y",void 0),i}(t.ChildProperty),Jo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(0)],i.prototype,"series",void 0),Go([(0,t.Property)(0)],i.prototype,"point",void 0),i}(t.ChildProperty),Zo=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Complex)({},Ko)],i.prototype,"border",void 0),Go([(0,t.Property)("transparent")],i.prototype,"background",void 0),Go([(0,t.Property)(1)],i.prototype,"opacity",void 0),Go([(0,t.Property)(null)],i.prototype,"backgroundImage",void 0),i}(t.ChildProperty),$o=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(!1)],i.prototype,"enable",void 0),Go([(0,t.Property)("")],i.prototype,"dashArray",void 0),Go([(0,t.Complex)({color:null,width:1},Ko)],i.prototype,"line",void 0),Go([(0,t.Property)("Both")],i.prototype,"lineType",void 0),i}(t.ChildProperty),el=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(!1)],i.prototype,"visible",void 0),Go([(0,t.Property)(null)],i.prototype,"name",void 0),Go([(0,t.Property)("transparent")],i.prototype,"fill",void 0),Go([(0,t.Property)(1)],i.prototype,"opacity",void 0),Go([(0,t.Property)(0)],i.prototype,"angle",void 0),Go([(0,t.Property)(!1)],i.prototype,"enableRotation",void 0),Go([(0,t.Property)("Auto")],i.prototype,"position",void 0),Go([(0,t.Property)(5)],i.prototype,"rx",void 0),Go([(0,t.Property)(5)],i.prototype,"ry",void 0),Go([(0,t.Property)("Center")],i.prototype,"alignment",void 0),Go([(0,t.Complex)({width:null,color:null},Ko)],i.prototype,"border",void 0),Go([(0,t.Complex)({left:5,right:5,top:5,bottom:5},Yo)],i.prototype,"margin",void 0),Go([(0,t.Complex)({size:"11px",color:"",fontStyle:"Normal",fontWeight:"Normal",fontFamily:"Segoe UI"},Qo)],i.prototype,"font",void 0),Go([(0,t.Property)(null)],i.prototype,"template",void 0),i}(t.ChildProperty),tl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)("Line")],i.prototype,"type",void 0),Go([(0,t.Property)(null)],i.prototype,"color",void 0),Go([(0,t.Property)(1)],i.prototype,"width",void 0),Go([(0,t.Property)(null)],i.prototype,"length",void 0),Go([(0,t.Property)("")],i.prototype,"dashArray",void 0),i}(t.ChildProperty),il=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(!0)],i.prototype,"visible",void 0),Go([(0,t.Complex)({width:null,color:null},Ko)],i.prototype,"border",void 0),Go([(0,t.Complex)({size:"11px",color:"",fontStyle:"Normal",fontWeight:"Normal",fontFamily:"Segoe UI"},Qo)],i.prototype,"font",void 0),Go([(0,t.Property)("transparent")],i.prototype,"fill",void 0),Go([(0,t.Property)(0)],i.prototype,"angle",void 0),Go([(0,t.Property)(!1)],i.prototype,"enableRotation",void 0),Go([(0,t.Property)("Outside")],i.prototype,"position",void 0),Go([(0,t.Property)(5)],i.prototype,"rx",void 0),Go([(0,t.Property)(5)],i.prototype,"ry",void 0),Go([(0,t.Property)(null)],i.prototype,"template",void 0),Go([(0,t.Complex)({},tl)],i.prototype,"connectorStyle",void 0),i}(t.ChildProperty),al=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(!1)],i.prototype,"visible",void 0),Go([(0,t.Property)("Circle")],i.prototype,"shape",void 0),Go([(0,t.Property)("")],i.prototype,"imageUrl",void 0),Go([(0,t.Property)(5)],i.prototype,"width",void 0),Go([(0,t.Property)(5)],i.prototype,"height",void 0),Go([(0,t.Complex)({width:2,color:null},Ko)],i.prototype,"border",void 0),Go([(0,t.Complex)({x:0,y:0},Xo)],i.prototype,"offset",void 0),Go([(0,t.Property)(null)],i.prototype,"fill",void 0),Go([(0,t.Property)(1)],i.prototype,"opacity",void 0),Go([(0,t.Complex)({},el)],i.prototype,"dataLabel",void 0),i}(t.ChildProperty),rl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(1)],i.prototype,"width",void 0),Go([(0,t.Property)(10)],i.prototype,"length",void 0),Go([(0,t.Property)(null)],i.prototype,"color",void 0),Go([(0,t.Property)(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),nl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(!1)],i.prototype,"visible",void 0),Go([(0,t.Property)("Fixed")],i.prototype,"type",void 0),Go([(0,t.Property)("Both")],i.prototype,"direction",void 0),Go([(0,t.Property)("Vertical")],i.prototype,"mode",void 0),Go([(0,t.Property)(1)],i.prototype,"verticalError",void 0),Go([(0,t.Property)(null)],i.prototype,"color",void 0),Go([(0,t.Property)(1)],i.prototype,"width",void 0),Go([(0,t.Property)(1)],i.prototype,"horizontalError",void 0),Go([(0,t.Property)(3)],i.prototype,"verticalNegativeError",void 0),Go([(0,t.Property)(3)],i.prototype,"verticalPositiveError",void 0),Go([(0,t.Property)(1)],i.prototype,"horizontalNegativeError",void 0),Go([(0,t.Property)(1)],i.prototype,"horizontalPositiveError",void 0),Go([(0,t.Complex)(null,rl)],i.prototype,"errorBarCap",void 0),i}(t.ChildProperty),sl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)("")],i.prototype,"name",void 0),Go([(0,t.Property)("0")],i.prototype,"dashArray",void 0),Go([(0,t.Property)(!0)],i.prototype,"visible",void 0),Go([(0,t.Property)(2)],i.prototype,"period",void 0),Go([(0,t.Property)("Linear")],i.prototype,"type",void 0),Go([(0,t.Property)(0)],i.prototype,"backwardForecast",void 0),Go([(0,t.Property)(0)],i.prototype,"forwardForecast",void 0),Go([(0,t.Property)(2)],i.prototype,"polynomialOrder",void 0),Go([(0,t.Complex)({},al)],i.prototype,"marker",void 0),Go([(0,t.Property)(!0)],i.prototype,"enableTooltip",void 0),Go([(0,t.Complex)({},zo)],i.prototype,"animation",void 0),Go([(0,t.Property)("")],i.prototype,"fill",void 0),Go([(0,t.Property)(1)],i.prototype,"width",void 0),Go([(0,t.Property)(null)],i.prototype,"intercept",void 0),Go([(0,t.Property)("SeriesType")],i.prototype,"legendShape",void 0),i}(t.ChildProperty),ol=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(null)],i.prototype,"fill",void 0),Go([(0,t.Complex)({color:"transparent",width:0},Ko)],i.prototype,"border",void 0),Go([(0,t.Property)("Zero")],i.prototype,"mode",void 0),i}(t.ChildProperty),ll=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(0)],i.prototype,"topLeft",void 0),Go([(0,t.Property)(0)],i.prototype,"topRight",void 0),Go([(0,t.Property)(0)],i.prototype,"bottomLeft",void 0),Go([(0,t.Property)(0)],i.prototype,"bottomRight",void 0),i}(t.ChildProperty),dl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(!1)],i.prototype,"enable",void 0),Go([(0,t.Property)(null)],i.prototype,"fill",void 0),Go([(0,t.Complex)(qo,Qo)],i.prototype,"textStyle",void 0),i}(t.ChildProperty),pl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(!0)],i.prototype,"visible",void 0),Go([(0,t.Property)(!1)],i.prototype,"startFromAxis",void 0),Go([(0,t.Property)(null)],i.prototype,"start",void 0),Go([(0,t.Property)(null)],i.prototype,"end",void 0),Go([(0,t.Property)(null)],i.prototype,"size",void 0),Go([(0,t.Property)("#808080")],i.prototype,"color",void 0),Go([(0,t.Property)(null)],i.prototype,"dashArray",void 0),Go([(0,t.Property)("Auto")],i.prototype,"sizeType",void 0),Go([(0,t.Property)(!1)],i.prototype,"isRepeat",void 0),Go([(0,t.Property)(null)],i.prototype,"repeatEvery",void 0),Go([(0,t.Property)(null)],i.prototype,"repeatUntil",void 0),Go([(0,t.Property)(!1)],i.prototype,"isSegmented",void 0),Go([(0,t.Property)(null)],i.prototype,"segmentStart",void 0),Go([(0,t.Property)(null)],i.prototype,"segmentEnd",void 0),Go([(0,t.Property)(null)],i.prototype,"segmentAxisName",void 0),Go([(0,t.Complex)({color:"transparent",width:1},Ko)],i.prototype,"border",void 0),Go([(0,t.Property)("")],i.prototype,"text",void 0),Go([(0,t.Property)(null)],i.prototype,"rotation",void 0),Go([(0,t.Property)("Middle")],i.prototype,"horizontalAlignment",void 0),Go([(0,t.Property)("Middle")],i.prototype,"verticalAlignment",void 0),Go([(0,t.Complex)(Uo,Qo)],i.prototype,"textStyle",void 0),Go([(0,t.Property)("Behind")],i.prototype,"zIndex",void 0),Go([(0,t.Property)(1)],i.prototype,"opacity",void 0),i}(t.ChildProperty),hl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)("")],i.prototype,"color",void 0),Go([(0,t.Property)(1)],i.prototype,"width",void 0),Go([(0,t.Property)("Rectangle")],i.prototype,"type",void 0),i}(t.ChildProperty),ul=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(1)],i.prototype,"width",void 0),Go([(0,t.Property)("")],i.prototype,"dashArray",void 0),Go([(0,t.Property)(null)],i.prototype,"color",void 0),i}(t.ChildProperty),cl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(.7)],i.prototype,"width",void 0),Go([(0,t.Property)("")],i.prototype,"dashArray",void 0),Go([(0,t.Property)(null)],i.prototype,"color",void 0),i}(t.ChildProperty),gl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(1)],i.prototype,"width",void 0),Go([(0,t.Property)("")],i.prototype,"dashArray",void 0),Go([(0,t.Property)(null)],i.prototype,"color",void 0),i}(t.ChildProperty),ml=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(1)],i.prototype,"width",void 0),Go([(0,t.Property)(5)],i.prototype,"height",void 0),Go([(0,t.Property)(null)],i.prototype,"color",void 0),i}(t.ChildProperty),fl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(.7)],i.prototype,"width",void 0),Go([(0,t.Property)(5)],i.prototype,"height",void 0),Go([(0,t.Property)(null)],i.prototype,"color",void 0),i}(t.ChildProperty),vl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(0)],i.prototype,"x",void 0),Go([(0,t.Property)(0)],i.prototype,"y",void 0),i}(t.ChildProperty),Sl=(function(){function e(){}Go([(0,t.Property)("")],e.prototype,"color",void 0),Go([(0,t.Property)(1)],e.prototype,"width",void 0)}(),function(){function e(){}Go([(0,t.Property)(!0)],e.prototype,"enable",void 0),Go([(0,t.Property)(1e3)],e.prototype,"duration",void 0),Go([(0,t.Property)(0)],e.prototype,"delay",void 0)}(),function(){function e(){}Go([(0,t.Property)(null)],e.prototype,"value",void 0),Go([(0,t.Property)(null)],e.prototype,"color",void 0),Go([(0,t.Property)("0")],e.prototype,"dashArray",void 0)}(),function(){function e(){}Go([(0,t.Property)(!1)],e.prototype,"visible",void 0),Go([(0,t.Property)("Circle")],e.prototype,"shape",void 0),Go([(0,t.Property)("")],e.prototype,"imageUrl",void 0),Go([(0,t.Property)(5)],e.prototype,"height",void 0),Go([(0,t.Property)(5)],e.prototype,"width",void 0),Go([(0,t.Complex)({width:2,color:null},Ko)],e.prototype,"border",void 0),Go([(0,t.Property)(null)],e.prototype,"fill",void 0),Go([(0,t.Property)(1)],e.prototype,"opacity",void 0),Go([(0,t.Complex)({},el)],e.prototype,"dataLabel",void 0)}(),function(){function e(){}Go([(0,t.Property)(!1)],e.prototype,"visible",void 0),Go([(0,t.Property)("Fixed")],e.prototype,"type",void 0),Go([(0,t.Property)("Both")],e.prototype,"direction",void 0),Go([(0,t.Property)("Vertical")],e.prototype,"mode",void 0),Go([(0,t.Property)(null)],e.prototype,"color",void 0),Go([(0,t.Property)(1)],e.prototype,"verticalError",void 0),Go([(0,t.Property)(1)],e.prototype,"width",void 0),Go([(0,t.Property)(1)],e.prototype,"horizontalError",void 0),Go([(0,t.Property)(3)],e.prototype,"verticalPositiveError",void 0),Go([(0,t.Property)(3)],e.prototype,"verticalNegativeError",void 0),Go([(0,t.Property)(1)],e.prototype,"horizontalPositiveError",void 0),Go([(0,t.Property)(1)],e.prototype,"horizontalNegativeError",void 0),Go([(0,t.Complex)(null,rl)],e.prototype,"errorBarCap",void 0)}(),function(){function e(){}Go([(0,t.Property)("")],e.prototype,"name",void 0),Go([(0,t.Property)("Linear")],e.prototype,"type",void 0),Go([(0,t.Property)(2)],e.prototype,"period",void 0),Go([(0,t.Property)(2)],e.prototype,"polynomialOrder",void 0),Go([(0,t.Property)(0)],e.prototype,"backwardForecast",void 0),Go([(0,t.Property)(0)],e.prototype,"forwardForecast",void 0),Go([(0,t.Complex)({},zo)],e.prototype,"animation",void 0),Go([(0,t.Complex)({},al)],e.prototype,"marker",void 0),Go([(0,t.Property)(!0)],e.prototype,"enableTooltip",void 0),Go([(0,t.Property)(null)],e.prototype,"intercept",void 0),Go([(0,t.Property)("")],e.prototype,"fill",void 0),Go([(0,t.Property)(1)],e.prototype,"width",void 0),Go([(0,t.Property)("SeriesType")],e.prototype,"legendShape",void 0)}(),function(){function e(){}Go([(0,t.Property)(null)],e.prototype,"fill",void 0),Go([(0,t.Complex)({color:"transparent",width:0},Ko)],e.prototype,"border",void 0),Go([(0,t.Property)("Zero")],e.prototype,"mode",void 0)}(),function(){function e(){}Go([(0,t.Property)(0)],e.prototype,"topLeft",void 0),Go([(0,t.Property)(0)],e.prototype,"topRight",void 0),Go([(0,t.Property)(0)],e.prototype,"bottomLeft",void 0),Go([(0,t.Property)(0)],e.prototype,"bottomRight",void 0)}(),function(){function e(){}Go([(0,t.Property)("Normal")],e.prototype,"fontStyle",void 0),Go([(0,t.Property)("16px")],e.prototype,"size",void 0),Go([(0,t.Property)("Normal")],e.prototype,"fontWeight",void 0),Go([(0,t.Property)("")],e.prototype,"color",void 0),Go([(0,t.Property)("Center")],e.prototype,"textAlignment",void 0),Go([(0,t.Property)("Segoe UI")],e.prototype,"fontFamily",void 0),Go([(0,t.Property)(1)],e.prototype,"opacity",void 0),Go([(0,t.Property)("Trim")],e.prototype,"textOverflow",void 0)}(),function(){function e(){}Go([(0,t.Property)(!1)],e.prototype,"enable",void 0),Go([(0,t.Property)(null)],e.prototype,"fill",void 0),Go([(0,t.Complex)(qo,Qo)],e.prototype,"textStyle",void 0)}(),function(){function e(){}Go([(0,t.Property)(1)],e.prototype,"width",void 0),Go([(0,t.Property)(5)],e.prototype,"height",void 0),Go([(0,t.Property)(null)],e.prototype,"color",void 0)}(),function(){function e(){}Go([(0,t.Property)(1)],e.prototype,"width",void 0),Go([(0,t.Property)("")],e.prototype,"dashArray",void 0),Go([(0,t.Property)(null)],e.prototype,"color",void 0)}(),function(){function e(){}Go([(0,t.Property)(.7)],e.prototype,"width",void 0),Go([(0,t.Property)(5)],e.prototype,"height",void 0),Go([(0,t.Property)(null)],e.prototype,"color",void 0)}(),function(){function e(){}Go([(0,t.Property)(.7)],e.prototype,"width",void 0),Go([(0,t.Property)("")],e.prototype,"dashArray",void 0),Go([(0,t.Property)(null)],e.prototype,"color",void 0)}(),function(){function e(){}Go([(0,t.Property)(1)],e.prototype,"width",void 0),Go([(0,t.Property)("")],e.prototype,"dashArray",void 0),Go([(0,t.Property)(null)],e.prototype,"color",void 0)}(),function(){function e(){}Go([(0,t.Property)(!0)],e.prototype,"visible",void 0),Go([(0,t.Property)(!1)],e.prototype,"startFromAxis",void 0),Go([(0,t.Property)(null)],e.prototype,"start",void 0),Go([(0,t.Property)(null)],e.prototype,"end",void 0),Go([(0,t.Property)(null)],e.prototype,"size",void 0),Go([(0,t.Property)("#808080")],e.prototype,"color",void 0),Go([(0,t.Property)(null)],e.prototype,"dashArray",void 0),Go([(0,t.Property)("Auto")],e.prototype,"sizeType",void 0),Go([(0,t.Property)(!1)],e.prototype,"isRepeat",void 0),Go([(0,t.Property)(null)],e.prototype,"repeatEvery",void 0),Go([(0,t.Property)(null)],e.prototype,"repeatUntil",void 0),Go([(0,t.Property)(!1)],e.prototype,"isSegmented",void 0),Go([(0,t.Property)(null)],e.prototype,"segmentStart",void 0),Go([(0,t.Property)(null)],e.prototype,"segmentEnd",void 0),Go([(0,t.Property)(null)],e.prototype,"segmentAxisName",void 0),Go([(0,t.Complex)({color:"transparent",width:1},Ko)],e.prototype,"border",void 0),Go([(0,t.Property)("")],e.prototype,"text",void 0),Go([(0,t.Property)(null)],e.prototype,"rotation",void 0),Go([(0,t.Property)("Middle")],e.prototype,"horizontalAlignment",void 0),Go([(0,t.Property)("Middle")],e.prototype,"verticalAlignment",void 0),Go([(0,t.Complex)(Uo,Qo)],e.prototype,"textStyle",void 0),Go([(0,t.Property)("Behind")],e.prototype,"zIndex",void 0),Go([(0,t.Property)(1)],e.prototype,"opacity",void 0)}(),function(){function e(){}Go([(0,t.Property)("")],e.prototype,"color",void 0),Go([(0,t.Property)(1)],e.prototype,"width",void 0),Go([(0,t.Property)("Rectangle")],e.prototype,"type",void 0)}(),function(){function e(){}Go([(0,t.Complex)({},Ko)],e.prototype,"border",void 0),Go([(0,t.Property)("transparent")],e.prototype,"background",void 0),Go([(0,t.Property)(1)],e.prototype,"opacity",void 0)}(),function(){function e(){}Go([(0,t.Property)(!1)],e.prototype,"enable",void 0),Go([(0,t.Property)("")],e.prototype,"dashArray",void 0),Go([(0,t.Complex)({color:null,width:1},Ko)],e.prototype,"line",void 0),Go([(0,t.Property)("Both")],e.prototype,"lineType",void 0)}(),function(){function e(){}Go([(0,t.Property)(!0)],e.prototype,"visible",void 0),Go([(0,t.Property)(null)],e.prototype,"height",void 0),Go([(0,t.Property)(null)],e.prototype,"width",void 0),Go([(0,t.Complex)({x:0,y:0},vl)],e.prototype,"location",void 0),Go([(0,t.Property)("Auto")],e.prototype,"position",void 0),Go([(0,t.Property)(8)],e.prototype,"padding",void 0),Go([(0,t.Property)("Center")],e.prototype,"alignment",void 0),Go([(0,t.Complex)(Vo,Qo)],e.prototype,"textStyle",void 0),Go([(0,t.Property)(10)],e.prototype,"shapeHeight",void 0),Go([(0,t.Property)(10)],e.prototype,"shapeWidth",void 0),Go([(0,t.Complex)({},Ko)],e.prototype,"border",void 0),Go([(0,t.Complex)({left:0,right:0,top:0,bottom:0},Yo)],e.prototype,"margin",void 0),Go([(0,t.Property)(5)],e.prototype,"shapePadding",void 0),Go([(0,t.Property)("transparent")],e.prototype,"background",void 0),Go([(0,t.Property)(1)],e.prototype,"opacity",void 0),Go([(0,t.Property)(!0)],e.prototype,"toggleVisibility",void 0),Go([(0,t.Property)(null)],e.prototype,"description",void 0),Go([(0,t.Property)(3)],e.prototype,"tabIndex",void 0)}(),function(){function e(){}Go([(0,t.Property)(0)],e.prototype,"series",void 0),Go([(0,t.Property)(0)],e.prototype,"point",void 0)}(),function(){function e(){}Go([(0,t.Property)(10)],e.prototype,"left",void 0),Go([(0,t.Property)(10)],e.prototype,"right",void 0),Go([(0,t.Property)(10)],e.prototype,"top",void 0),Go([(0,t.Property)(10)],e.prototype,"bottom",void 0)}(),function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(null)],i.prototype,"fill",void 0),Go([(0,t.Property)(null)],i.prototype,"endAngle",void 0),Go([(0,t.Property)(!1)],i.prototype,"explode",void 0),Go([(0,t.Property)(!1)],i.prototype,"explodeAll",void 0),Go([(0,t.Property)(null)],i.prototype,"explodeIndex",void 0),Go([(0,t.Property)(null)],i.prototype,"innerRadius",void 0),Go([(0,t.Property)("30%")],i.prototype,"explodeOffset",void 0),Go([(0,t.Property)(0)],i.prototype,"gapRatio",void 0),Go([(0,t.Property)("Value")],i.prototype,"groupMode",void 0),Go([(0,t.Property)(null)],i.prototype,"groupTo",void 0),Go([(0,t.Property)("20%")],i.prototype,"neckHeight",void 0),Go([(0,t.Property)("20%")],i.prototype,"neckWidth",void 0),Go([(0,t.Property)("Linear")],i.prototype,"pyramidMode",void 0),Go([(0,t.Property)([])],i.prototype,"palettes",void 0),Go([(0,t.Property)(0)],i.prototype,"startAngle",void 0),Go([(0,t.Complex)(null,zo)],i.prototype,"animation",void 0),Go([(0,t.Complex)(null,il)],i.prototype,"dataLabel",void 0),Go([(0,t.Property)("0")],i.prototype,"dashArray",void 0),Go([(0,t.Property)(1)],i.prototype,"width",void 0),Go([(0,t.Property)("X")],i.prototype,"segmentAxis",void 0),Go([(0,t.Property)("Line")],i.prototype,"drawType",void 0),Go([(0,t.Property)(!0)],i.prototype,"isClosed",void 0),Go([(0,t.Collection)([],Wo)],i.prototype,"segments",void 0),Go([(0,t.Property)("")],i.prototype,"stackingGroup",void 0),Go([(0,t.Complex)({color:"transparent",width:0},Ko)],i.prototype,"border",void 0),Go([(0,t.Property)(!0)],i.prototype,"visible",void 0),Go([(0,t.Property)(1)],i.prototype,"opacity",void 0),Go([(0,t.Property)("Line")],i.prototype,"type",void 0),Go([(0,t.Complex)(null,al)],i.prototype,"marker",void 0),Go([(0,t.Complex)(null,nl)],i.prototype,"errorBar",void 0),Go([(0,t.Property)(!0)],i.prototype,"enableTooltip",void 0),Go([(0,t.Collection)([],sl)],i.prototype,"trendlines",void 0),Go([(0,t.Property)("")],i.prototype,"tooltipMappingName",void 0),Go([(0,t.Property)("SeriesType")],i.prototype,"legendShape",void 0),Go([(0,t.Property)(1)],i.prototype,"minRadius",void 0),Go([(0,t.Property)(null)],i.prototype,"selectionStyle",void 0),Go([(0,t.Property)("Natural")],i.prototype,"splineType",void 0),Go([(0,t.Property)(3)],i.prototype,"maxRadius",void 0),Go([(0,t.Property)(.5)],i.prototype,"cardinalSplineTension",void 0),Go([(0,t.Property)(null)],i.prototype,"columnWidth",void 0),Go([(0,t.Complex)(null,ol)],i.prototype,"emptyPointSettings",void 0),Go([(0,t.Complex)(null,ll)],i.prototype,"cornerRadius",void 0),Go([(0,t.Property)(0)],i.prototype,"columnSpacing",void 0),i}(t.ChildProperty)),yl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)("Rotate45")],i.prototype,"labelIntersectAction",void 0),Go([(0,t.Complex)(Ao,Qo)],i.prototype,"labelStyle",void 0),Go([(0,t.Property)("")],i.prototype,"title",void 0),Go([(0,t.Property)(null)],i.prototype,"zoomFactor",void 0),Go([(0,t.Complex)({},dl)],i.prototype,"crosshairTooltip",void 0),Go([(0,t.Property)("")],i.prototype,"labelFormat",void 0),Go([(0,t.Complex)(Ro,Qo)],i.prototype,"titleStyle",void 0),Go([(0,t.Property)(!1)],i.prototype,"isIndexed",void 0),Go([(0,t.Property)(0)],i.prototype,"plotOffset",void 0),Go([(0,t.Property)("Shift")],i.prototype,"edgeLabelPlacement",void 0),Go([(0,t.Property)("BetweenTicks")],i.prototype,"labelPlacement",void 0),Go([(0,t.Property)("Outside")],i.prototype,"tickPosition",void 0),Go([(0,t.Property)(!1)],i.prototype,"opposedPosition",void 0),Go([(0,t.Property)(!0)],i.prototype,"visible",void 0),Go([(0,t.Property)("Outside")],i.prototype,"labelPosition",void 0),Go([(0,t.Property)(0)],i.prototype,"labelRotation",void 0),Go([(0,t.Property)(0)],i.prototype,"minorTicksPerInterval",void 0),Go([(0,t.Property)(null)],i.prototype,"maximum",void 0),Go([(0,t.Property)(null)],i.prototype,"minimum",void 0),Go([(0,t.Property)(34)],i.prototype,"maximumLabelWidth",void 0),Go([(0,t.Property)(null)],i.prototype,"interval",void 0),Go([(0,t.Complex)({},ml)],i.prototype,"majorTickLines",void 0),Go([(0,t.Property)(!1)],i.prototype,"enableTrim",void 0),Go([(0,t.Complex)({},ul)],i.prototype,"majorGridLines",void 0),Go([(0,t.Complex)({},fl)],i.prototype,"minorTickLines",void 0),Go([(0,t.Complex)({},gl)],i.prototype,"lineStyle",void 0),Go([(0,t.Complex)({},cl)],i.prototype,"minorGridLines",void 0),Go([(0,t.Property)(!1)],i.prototype,"isInversed",void 0),Go([(0,t.Property)(null)],i.prototype,"description",void 0),Go([(0,t.Property)(0)],i.prototype,"startAngle",void 0),Go([(0,t.Property)(100)],i.prototype,"coefficient",void 0),Go([(0,t.Collection)([],pl)],i.prototype,"stripLines",void 0),Go([(0,t.Property)(2)],i.prototype,"tabIndex",void 0),Go([(0,t.Complex)({color:null,width:0,type:"Rectangle"},hl)],i.prototype,"border",void 0),i}(t.ChildProperty),bl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(!1)],i.prototype,"enableMarker",void 0),Go([(0,t.Property)(!0)],i.prototype,"enable",void 0),Go([(0,t.Property)(null)],i.prototype,"fill",void 0),Go([(0,t.Property)(!1)],i.prototype,"shared",void 0),Go([(0,t.Property)(.75)],i.prototype,"opacity",void 0),Go([(0,t.Property)(null)],i.prototype,"header",void 0),Go([(0,t.Property)(null)],i.prototype,"format",void 0),Go([(0,t.Complex)(Ho,Qo)],i.prototype,"textStyle",void 0),Go([(0,t.Property)(null)],i.prototype,"template",void 0),Go([(0,t.Complex)({color:"#cccccc",width:.5},Ko)],i.prototype,"border",void 0),Go([(0,t.Property)(!0)],i.prototype,"enableAnimation",void 0),i}(t.ChildProperty),Cl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)("50%")],i.prototype,"x",void 0),Go([(0,t.Property)("50%")],i.prototype,"y",void 0),i}(t.ChildProperty),xl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Property)(!1)],i.prototype,"enablePinchZooming",void 0),Go([(0,t.Property)(!0)],i.prototype,"enableSelectionZooming",void 0),Go([(0,t.Property)(!1)],i.prototype,"enableDeferredZooming",void 0),Go([(0,t.Property)(!1)],i.prototype,"enableMouseWheelZooming",void 0),Go([(0,t.Property)("XY")],i.prototype,"mode",void 0),Go([(0,t.Property)(["Zoom","ZoomIn","ZoomOut","Pan","Reset"])],i.prototype,"toolbarItems",void 0),Go([(0,t.Property)(!0)],i.prototype,"enableScrollbar",void 0),Go([(0,t.Property)(!1)],i.prototype,"enablePan",void 0),i}(t.ChildProperty),wl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return _o(i,e),Go([(0,t.Complex)({},Sl)],i.prototype,"chartSeries",void 0),Go([(0,t.Complex)({},yl)],i.prototype,"primaryXAxis",void 0),Go([(0,t.Complex)({},yl)],i.prototype,"primaryYAxis",void 0),Go([(0,t.Property)("")],i.prototype,"value",void 0),Go([(0,t.Property)("")],i.prototype,"columnHeader",void 0),Go([(0,t.Property)("-")],i.prototype,"columnDelimiter",void 0),Go([(0,t.Property)(!1)],i.prototype,"enableMultipleAxis",void 0),Go([(0,t.Property)("Stacked")],i.prototype,"multipleAxisMode",void 0),Go([(0,t.Property)(!1)],i.prototype,"enableScrollOnMultiAxis",void 0),Go([(0,t.Property)(!1)],i.prototype,"showMemberSeries",void 0),Go([(0,t.Property)(!1)],i.prototype,"showPointColorByMembers",void 0),Go([(0,t.Complex)({border:{color:null,width:.5},background:"transparent"},Fo.titleSettings)],i.prototype,"titleStyle",void 0),Go([(0,t.Property)("")],i.prototype,"title",void 0),Go([(0,t.Complex)({border:{color:null,width:.5},background:"transparent"},Fo.titleSettings)],i.prototype,"subTitleStyle",void 0),Go([(0,t.Property)("")],i.prototype,"subTitle",void 0),Go([(0,t.Complex)({color:"#DDDDDD",width:0},Ko)],i.prototype,"border",void 0),Go([(0,t.Complex)({},Yo)],i.prototype,"margin",void 0),Go([(0,t.Complex)({border:{color:null,width:.5},background:"transparent"},Zo)],i.prototype,"chartArea",void 0),Go([(0,t.Property)(null)],i.prototype,"background",void 0),Go([(0,t.Property)("Material")],i.prototype,"theme",void 0),Go([(0,t.Property)([])],i.prototype,"palettes",void 0),Go([(0,t.Complex)({},$o)],i.prototype,"crosshair",void 0),Go([(0,t.Complex)({},bl)],i.prototype,"tooltip",void 0),Go([(0,t.Complex)(null,Cl)],i.prototype,"pieCenter",void 0),Go([(0,t.Complex)({},xl)],i.prototype,"zoomSettings",void 0),Go([(0,t.Property)()],i.prototype,"legendSettings",void 0),Go([(0,t.Property)("None")],i.prototype,"selectionMode",void 0),Go([(0,t.Property)("None")],i.prototype,"accumulationSelectionMode",void 0),Go([(0,t.Property)(!0)],i.prototype,"enableSmartLabels",void 0),Go([(0,t.Property)(!0)],i.prototype,"enableBorderOnMouseMove",void 0),Go([(0,t.Property)("None")],i.prototype,"highlightMode",void 0),Go([(0,t.Property)("None")],i.prototype,"highlightPattern",void 0),Go([(0,t.Property)(!0)],i.prototype,"enableExport",void 0),Go([(0,t.Property)(!1)],i.prototype,"isMultiSelect",void 0),Go([(0,t.Collection)([],Jo)],i.prototype,"selectedDataIndexes",void 0),Go([(0,t.Property)(!0)],i.prototype,"enableAnimation",void 0),Go([(0,t.Property)(!1)],i.prototype,"enableCanvas",void 0),Go([(0,t.Property)(!0)],i.prototype,"useGroupingSeparator",void 0),Go([(0,t.Property)(!1)],i.prototype,"isTransposed",void 0),Go([(0,t.Property)(1)],i.prototype,"tabIndex",void 0),Go([(0,t.Property)(null)],i.prototype,"description",void 0),Go([(0,t.Event)()],i.prototype,"resized",void 0),Go([(0,t.Property)(!0)],i.prototype,"enableSideBySidePlacement",void 0),Go([(0,t.Event)()],i.prototype,"loaded",void 0),Go([(0,t.Event)()],i.prototype,"beforePrint",void 0),Go([(0,t.Event)()],i.prototype,"animationComplete",void 0),Go([(0,t.Event)()],i.prototype,"load",void 0),Go([(0,t.Event)()],i.prototype,"textRender",void 0),Go([(0,t.Event)()],i.prototype,"legendRender",void 0),Go([(0,t.Event)()],i.prototype,"seriesRender",void 0),Go([(0,t.Event)()],i.prototype,"multiLevelLabelRender",void 0),Go([(0,t.Event)()],i.prototype,"pointRender",void 0),Go([(0,t.Event)()],i.prototype,"tooltipRender",void 0),Go([(0,t.Event)()],i.prototype,"legendClick",void 0),Go([(0,t.Event)()],i.prototype,"axisLabelRender",void 0),Go([(0,t.Event)()],i.prototype,"multiLevelLabelClick",void 0),Go([(0,t.Event)()],i.prototype,"chartMouseClick",void 0),Go([(0,t.Event)()],i.prototype,"chartMouseMove",void 0),Go([(0,t.Event)()],i.prototype,"pointMove",void 0),Go([(0,t.Event)()],i.prototype,"pointClick",void 0),Go([(0,t.Event)()],i.prototype,"chartMouseDown",void 0),Go([(0,t.Event)()],i.prototype,"chartMouseLeave",void 0),Go([(0,t.Event)()],i.prototype,"dragComplete",void 0),Go([(0,t.Event)()],i.prototype,"chartMouseUp",void 0),Go([(0,t.Event)()],i.prototype,"scrollStart",void 0),Go([(0,t.Event)()],i.prototype,"zoomComplete",void 0),Go([(0,t.Event)()],i.prototype,"scrollChanged",void 0),Go([(0,t.Event)()],i.prototype,"scrollEnd",void 0),Go([(0,t.Property)(!0)],i.prototype,"showMultiLevelLabels",void 0),i}(t.ChildProperty),Tl=function(){function e(){}return e.getCellSets=function(e,i,a,r,n){this.engine=i,this.isMondrian=i.isMondrian,this.isMeasureAvail=i.isMeasureAvail,this.isPaging=i.isPaging,this.pageSettings=i.pageSettings,this.rows=i.rows,this.columns=i.columns,this.values=i.values,this.filters=i.filters,this.allowLabelFilter=i.allowLabelFilter,this.allowValueFilter=i.allowValueFilter,this.drilledMembers=i.updateDrilledItems(e.drilledMembers),this.calculatedFieldSettings=i.calculatedFieldSettings,this.valueAxis="row"===e.valueAxis?"rows":"columns",r&&(r.axis="row"===r.axis?"rows":"columns"),this.filterMembers=(0,t.extend)({},i.filterMembers,null,!0),this.fieldDataObj=i.fieldListObj,this.fieldList=i.fieldList,this.cellSetInfo="\nDIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE";var s=this.getMeasuresQuery(this.values),o=this.getDimensionsQuery(this.rows,s,"rows",r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),l=this.getDimensionsQuery(this.columns,s,"columns",r).replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,""");if(this.isPaging&&a&&void 0!==this.pageSettings)o=(d=this.getPagingQuery(o,l)).rowQuery,l=d.columnQuery;else if(this.isPaging&&!a&&void 0!==this.pageSettings){var d;o=(d=this.getPagingCountQuery(o,l)).rowQuery,l=d.columnQuery}o=o.length>0?o+(this.isPaging&&!a?"":this.cellSetInfo+" ON ROWS"):"",l=l.length>0?l+(this.isPaging&&!a?"":this.cellSetInfo+" ON COLUMNS"):"";var p=this.getSlicersQuery(this.filters,"filters").replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/'/g,"'").replace(/"/g,"""),h=this.getfilterQuery(this.filterMembers,e.cube).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),u=this.getCalculatedFieldQuery(this.calculatedFieldSettings).replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,"""),c=this.frameMDXQuery(o,l,p,h,u,a),g={catalog:e.catalog,cube:e.cube,url:e.url,request:c,LCID:e.localeIdentifier.toString(),roles:e.roles};i.mdxQuery=c.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/%280/g,'"').replace(/'/g,"'"),r&&(r.axis="rows"===r.axis?"row":"column"),n||this.getTableCellData(g,this.isPaging&&!a?this.engine.generatePagingData.bind(this.engine):this.engine.generateEngine.bind(this.engine),r?{action:r.action,drillInfo:r}:{dataSourceSettings:e,action:"loadTableElements"})},e.getTableCellData=function(e,t,i){var a=this.engine.getConnectionInfo(e.url,e.LCID),r='<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,r,t,i),this.engine.errorInfo)throw this.engine.errorInfo},e.frameMDXQuery=function(e,t,i,a,r,n){var s=this.isPaging&&!n?""!==r?"":"\nWITH":"\nSelect ";return t.length>0&&(s+=t),e.length>0&&(s=s+(t.length>0?this.isPaging&&!n?"":", ":"")+e),s=r+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"},e.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;return a=this.engine.rowCount<a+n?this.engine.rowCount>n?this.engine.rowCount-n:0:a,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+")":""}},e.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":""}},e.getDimensionsQuery=function(e,t,i,a){var r="";if(e.length>0){r="\nNON EMPTY ( "+(this.drilledMembers.length>0?"HIERARCHIZE ({":"");for(var 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);r=a&&a.axis===i?"\nNON EMPTY ( "+(this.drilledMembers.length>0?"HIERARCHIZE ({":"")+s.query:r+(""!==s.query?",":"")+s.query;var o=this.getAttributeDrillQuery(e,t,i,a);r=r+(this.isPaging?(""!==o?"-":"")+o:"")+(this.drilledMembers.length>0?"})":"")+(this.isPaging?"":(""!==o?"-":"")+o)+")"}return r},e.getAttributeDrillQuery=function(e,t,i,a){var r="",n=[];n=a&&a.axis===i&&"down"===a.action.toLowerCase()?[{name:a.fieldName,items:[a.memberName],delimiter:"~~"}]:this.drilledMembers;for(var 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?d.delimiter:"~~"),m=this.getDrillLevel(e,g),f=this.getDimensionPos(i,d.name),v=e.length-(s>f?1:0),S=!!this.isPaging&&this.isAttributeMemberExist(d.name,u.split(d.delimiter?d.delimiter:"~~"),d.delimiter,g,i);m.level>0&&m.isDrill&&f+1!==s&&!S;){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&&v>b),e[b].isNamedSet,e[b].isCalculatedField,m.level,!1))}b++}y.length>0&&c.push("("+y.join("*")+")"),m.level--,v--}c.length>0&&(r=r+(""!==r?"-":"")+c.join(this.isPaging?"+":"-"))}}return r},e.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},e.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},e.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-=1,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-=1),r++;return{level:this.isPaging?2:i,isDrill:a}},e.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)"},e.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?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},e.getDrillQuery=function(e,t,i,a){var r="",n=[],s=[],o=!1,l="";a&&a.axis===i&&"down"===a.action.toLowerCase()?(o=!0,s=[{name:a.fieldName,items:[a.memberName],delimiter:"~~"}]):s=this.drilledMembers;for(var d=0,p=s;d<p.length;d++){var h=p[d];if(!(!!this.engine.fieldList[h.name]&&this.engine.fieldList[h.name].isHierarchy))for(var u=0,c=h.items;u<c.length;u++){for(var g=c[u],m=[],f=[],v=0,S=g.split(h.delimiter?h.delimiter:"~~"),y=this.isAttributeMemberExist(h.name,g.split(h.delimiter?h.delimiter:"~~"),h.delimiter?h.delimiter:"~~",S,i);v<e.length&&!y;){if(S[v]&&-1!==S[v].indexOf(e[v].name))-1!==S[S.length-1].indexOf(e[v].name)?o?l=l+(""!==l?" * ":"")+"({"+S[v]+".CHILDREN})":(m.push("("+S[v]+".CHILDREN)"),f.push("("+S[v]+")")):"[measures]"===S[v].toLowerCase()&&""!==t?o?l=l+(""!==l?" * ":"")+"("+t+")":(m.push("("+t+")"),f.push("("+t+")")):-1!==S[v].toLowerCase().indexOf("[measures]")?o?l=l+(""!==l?" * ":"")+"({"+S[v]+"})":(m.push("({"+S[v]+"})"),f.push("({"+S[v]+"})")):o?l=l+(""!==l?" * ":"")+"({"+S[v]+"})":(m.push("("+S[v]+")"),f.push("("+S[v]+")"));else{if(S[v]||!e[v]){m=[];break}if("[measures]"===e[v].name.toLowerCase()&&""!==t)o?l=l+(""!==l?" * ":"")+"("+t+")":(m.push("("+t+")"),f.push("("+t+")"));else{var b=this.getDimensionQuery(e[v],i);o?l=l+(""!==l?" * ":"")+"({"+b+"})":(m.push("("+b+")"),f.push("("+b+")"))}}v++}m.length>0&&m.length<S.length&&(m=[],f=[]),r=r+(""!==r&&m.length>0?",":"")+(m.length>0?"("+m.toString()+")":""),f.length>0&&n.push("("+f.toString()+")")}}return{query:o?l:r,collection:o?[l]:n}},e.getSlicersQuery=function(e,i){var a=this,r="",n=(0,t.extend)([],this.rows,null,!0);if(n=n.concat(this.columns),e.length>0){for(var s=0;s<e.length;){n.filter(function(t){var i=a.getDimensionUniqueName(t.name),r=a.getDimensionUniqueName(e[s].name);return i===r&&!(a.isMondrian&&""===r&&""===i)}).length>0||(void 0===e[s].name||this.filterMembers[e[s].name]?this.filterMembers[e[s].name]&&(r=r+(""!==r?" * ":"")+"{"+this.filterMembers[e[s].name].toString()+"}"):r=r+(""!==r?" * ":"")+"{"+this.getDimensionQuery(e[s],i)+"}"),s++}r=""===r?"":"\nWHERE ("+r.replace(/DrilldownLevel/g,"")+")"}return r},e.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)"},e.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 i.length>0?i[0].pid:""}return e.split(".")[0]},e.getMeasuresQuery=function(e){var t="";if(e.length>0){t="{{";for(var i="",a=0,r=e;a<r.length;a++){var n=r[a],s=n.isCalculatedField?this.fieldList[n.name].tag:n.name;i=i.length>0?i+", "+s:s}t=t+i+"}}"}return t},e.getfilterQuery=function(e,t){for(var i="\nFROM ["+t+"]",a="\nFROM( SELECT (",r=[],n=[],s=[],o=[],l=0,d=this.rows;l<d.length;l++){e[(m=d[l]).name]&&e[m.name].length>0&&("string"==typeof e[m.name][0]?s.push(e[m.name]):(e[m.name][1]=e[m.name][0].type,r.push(e[m.name]),delete e[m.name]))}for(var p=0,h=this.columns;p<h.length;p++){if(e[(m=h[p]).name]&&e[m.name].length>0)if("string"==typeof e[m.name][0])o.push(e[m.name]);else{var u=e[m.name];u[1]=u[0].type,r.push(e[m.name]),delete e[m.name]}}for(var c=0,g=this.filters;c<g.length;c++){for(var m=g[c],f=!1,v=0,S=this.columns;v<S.length;v++){var y=S[v];f||this.getDimensionUniqueName(y.name)!==this.getDimensionUniqueName(m.name)||e[m.name]&&(o.push(e[m.name]),f=!0)}if(!f)for(var b=0,C=this.rows;b<C.length;b++){var x=C[b];f||this.getDimensionUniqueName(x.name)!==this.getDimensionUniqueName(m.name)||e[m.name]&&(s.push(e[m.name]),f=!0)}}if((this.allowLabelFilter||this.allowValueFilter)&&r.length>0)for(var w=0,T=["Value","Label"];w<T.length;w++)for(var M=T[w],D=0,O=r;D<O.length;D++){var N=O[D];N&&2===N.length&&"string"==typeof N[1]&&N[1]===M&&n.push(this.getAdvancedFilterQuery(N[0],a,"COLUMNS"))}for(var P=0,E=o.length;P<E;P++)a=0===P?a+"{"+o[P].toString()+"}":a+",{"+o[P].toString()+"}";o.length>0&&(a=s.length>0?a+" ) ON COLUMNS ,(":a+" ) ON COLUMNS");for(P=0,E=s.length;P<E;P++)a=P>0?a+",{"+s[P].toString()+"}":a+"{"+s[P].toString()+"}";a=o.length>0&&s.length>0?a+=") ON ROWS ":0===o.length&&s.length>0?a+") ON COLUMNS ":a;var I="";return n.length>0&&(I=n.join(" ")+" "+(o.length>0||s.length>0?a:"")+" "+i+Array(n.length+1+(o.length>0||s.length>0?1:0)).join(")")),i=0===o.length&&0===s.length?i:a+i+")",I.length>0?I:i},e.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},e.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":default: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)}return s},e.getCalculatedFieldQuery=function(e){var i="";if(e.length>0){i="\nWITH";for(var a=0,r=e;a<r.length;a++){var n=r[a],s=this.fieldList[n.name],o=this.engine?this.engine.currentCalcFieldInfo:null,l=o&&o.fieldName===n.name&&"Measure"===o.fieldType,d=s&&"Measure"===s.fieldType,p=n&&n.hierarchyUniqueName&&0===n.hierarchyUniqueName.toLowerCase().indexOf("[measures]"),h=n&&n.formula&&-1!==n.formula.toLowerCase().indexOf("[measures]"),u=(l||d||p||h?"[Measures].":n.hierarchyUniqueName?n.hierarchyUniqueName+".":"")+"["+n.name+"]",c=(0,t.isNullOrUndefined)(n.formatString)?null:n.formatString;i+="\nMEMBER "+u+"as ("+n.formula+") "+((0,t.isNullOrUndefined)(c)?"":', FORMAT_STRING ="'+c.trim()+'"')}}return i},e}(),Ml=function(){function e(){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.currentCalcFieldInfo={},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.requestHeaders={},this.pivotValues=[],this.valueContent=[],this.headerContent=[],this.rowStartPos=0,this.pageRowStartPos=0,this.tupColumnInfo=[],this.tupRowInfo=[],this.gridJSON="",this.namedSetsPosition={},this.colDepth=0,this.levelUniqueName={},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}return e.prototype.renderEngine=function(e,i,a,r,n){if(this.isEmptyData=!1,this.getHeaderSortInfo=a,this.getBeforeSeviceInvoke=r,this.getAfterSeviceInvoke=n,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 t.Internationalization,this.locale=this.globalize.culture?this.globalize.culture:"en-US",this.localeObj=i?i.localeObj:void 0,this.enableValueSorting=!!i&&i.enableValueSorting,e.url){this.dataSourceSettings=e,this.measureIndex=(0,t.isNullOrUndefined)(e.valueIndex)?-1:e.valueIndex,this.valueAxis="row"===e.valueAxis?"row":"column",this.getAxisFields(),this.formats=e.formatSettings?e.formatSettings:[],this.enableSort=void 0===e.enableSorting||e.enableSorting,this.valueSortSettings=e.valueSortSettings?e.valueSortSettings:void 0,this.filterSettings=e.filterSettings?e.filterSettings:[],this.sortSettings=e.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?e.calculatedFieldSettings:[],this.emptyCellTextContent=e.emptyCellsTextContent?e.emptyCellsTextContent:"",this.pageSettings=i?i.pageSettings?i.pageSettings:this.pageSettings:void 0,this.isPaging=!(!this.pageSettings||!i.enablePaging&&!i.enableVirtualization),this.frameSortObject(),this.getFormattedFields(this.formats),this.savedFieldList=i?i.savedFieldList:void 0,this.savedFieldListData=i?i.savedFieldListData:void 0,this.fieldListData=[],this.fieldListObj={},this.setNamedSetsPosition(),this.savedFieldList&&Object.keys(this.savedFieldList).length>0&&this.savedFieldListData?this.updateFieldlist(!0):(this.getCubes(e),this.getFieldList(e)),this.loadCalculatedMemberElements(this.calculatedFieldSettings);var s=this.getMeasureInfo();this.olapVirtualization=this.isPaging&&e.showSubTotals&&s.measureIndex===("column"===s.measureAxis?e.columns.length-1:e.rows.length-1)&&!(0,t.isNullOrUndefined)(this.pageSettings)&&e.showGrandTotals,this.isPaging=this.isPaging?!this.olapVirtualization:this.isPaging,this.measureReportItems=[],this.updateFilterItems(this.filterSettings),this.generateGridData(e)}},e.prototype.generateGridData=function(e,t){var i=!(!t||"navPaging"!==t||!this.isPaging||void 0===this.pageSettings);this.rows.length>0||this.columns.length>0||this.values.length>0||this.filters.length>0?Tl.getCellSets(e,this,i):(Tl.getCellSets(e,this,!0,void 0,!0),this.generateEngine(void 0,void 0,{dataSourceSettings:e,action:"loadTableElements"}))},e.prototype.generatePagingData=function(e,t,i){var a=[].slice.call(e.querySelectorAll("Axes, CellData")),r=a[1]?a[1].querySelectorAll("FmtValue"):null;r&&r.length>0&&(this.columnCount=Number(r[0].textContent),this.rowCount=Number(r[1].textContent));var n=i.dataSourceSettings;Tl.getCellSets(n,this,!0)},e.prototype.scrollPage=function(){if(this.olapVirtualization){var e=this.getVirtualScrollingData(this.clonedColumnTuple,this.clonedRowTuple);e.isCalculated&&(this.pivotValues=[],this.clearEngineProperties(),this.performEngine(e.columnTuple,e.rowTuple,e.valueTuple)),this.pivotValues=this.pivotValues.slice()}else Tl.getCellSets(this.dataSourceSettings,this,!0)},e.prototype.getVirtualScrollingData=function(e,i){var a=this.clonedValTuple.slice(),r=!1,n=(this.pageSettings.currentColumnPage-1)*this.pageSettings.columnPageSize,s=(this.pageSettings.currentRowPage-1)*this.pageSettings.rowPageSize,o=3*this.pageSettings.columnPageSize,l=3*this.pageSettings.rowPageSize;if(n=this.columnCount<n+o?this.columnCount>o?this.columnCount-o:0:n,s=this.rowCount<s+l?this.rowCount>l?this.rowCount-l:0:s,n!==this.pageColStartPos||s!==this.pageRowStartPos||!(e.length<=o&&i.length<=l)){r=!0;var d=this.getMeasureInfo(),p=!(0,t.isNullOrUndefined)(e[0])&&0===Number(e[0].querySelectorAll("Member")[0].querySelector("LNum").textContent)&&e[0].querySelectorAll("Member")[0].querySelector("MEMBER_VALUE").textContent.startsWith("All"),h=!(0,t.isNullOrUndefined)(i[0])&&0===Number(i[0].querySelectorAll("Member")[0].querySelector("LNum").textContent)&&i[0].querySelectorAll("Member")[0].querySelector("MEMBER_VALUE").textContent.startsWith("All"),u="Top"===this.dataSourceSettings.grandTotalsPosition,c=p&&(u?0===n:n+o>=e.length-1),g=h&&(u?0===s:s+l>=i.length-1),m=p?this.getAxisdepth(e):"column"===d.measureAxis?d.valueInfo.length:1,f=h?this.getAxisdepth(i):"row"===d.measureAxis?d.valueInfo.length:1,v=(p?m:0)+n,S=(h?f:0)+s,y=e.slice(v,v+o),b=i.slice(S,S+l),C=y[0]?Number(y[0].querySelectorAll("Member")[0].querySelector("LNum").textContent):0,x=b[0]?Number(b[0].querySelectorAll("Member")[0].querySelector("LNum").textContent):0,w=this.getVirtualTotals(e.slice(0,v),C,c,"column",m),T=this.getVirtualTotals(i.slice(0,S),x,g,"row",f);v=y.length+w.totalsCollection.length>o?Math.max(y.length+w.totalsCollection.length-o):0,S=b.length+T.totalsCollection.length>l?Math.max(b.length+T.totalsCollection.length-l):0,y=w.totalsCollection.concat(y.slice(v,y.length)),b=T.totalsCollection.concat(b.slice(S,b.length));var M=this.getVirtualValues(a,n+v,s+S,o,l,w.indexCollection,T.indexCollection,e.length,i.length,m,f,p,h);e=y.slice(),i=b.slice(),a=M.slice()}return this.pageColStartPos=n,this.pageRowStartPos=s,{columnTuple:e,rowTuple:i,valueTuple:a,isCalculated:r}},e.prototype.getAxisdepth=function(e){for(var t=0,i=0;i<e.length;i++){if(0!==Number(e[i].querySelectorAll("Member")[0].querySelector("LNum").textContent))break;t++}return t},e.prototype.getVirtualTotals=function(e,t,i,a,r){var n=[],s=[];if(1!==t)for(var o=e.length-1;o>0;o--){var l=Number(e[o].querySelectorAll("Member")[0].querySelector("LNum").textContent);if(0===l)break;if(t>l)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=r>1?o-(r-1):o}else n[n.length]=e[o],s[s.length]=o;else if(1===l)break}if(i)for(o=r;o>0;o--)n=n.concat([e[o-1]]),s=s.concat([o-1]);return{totalsCollection:n.reverse(),indexCollection:s.reverse()}},e.prototype.getVirtualValues=function(e,t,i,a,r,n,s,o,l,d,p,h,u){var c=[],g=e;if(l>r){var m=((u?p:0)+i)*o;g=e.slice(m,m+r*o);for(var f=[],v=0;v<s.length;v++)f=f.concat(e.slice(s[v]*o,s[v]*o+o));g=f.concat(g)}for(var S=t+(h?d:0),y=(v=0,g.length/o);v<y;v++){for(var b=g.slice(v*o,v*o+o),C=b.slice(S,S+a),x=[],w=0;w<n.length;w++)x[x.length]=b[n[w]];c=c.concat(x.concat(C))}return c},e.prototype.generateEngine=function(e,i,a){"down"!==a.action&&this.clearEngineProperties(),this.xmlDoc=e?e.cloneNode(!0):void 0,this.request=i,this.customArgs=a,this.parentObjCollection={},this.curDrillEndPos=-1,this.onDemandDrillEngine=[],this.getSubTotalsVisibility(),this.xmlaCellSet=e?e.querySelectorAll("Axes, CellData"):void 0;var r=this.xmlaCellSet&&this.xmlaCellSet.length>0?[].slice.call(this.xmlaCellSet[0].querySelectorAll('Axis[name|="Axis0"] Tuple')):[],n=this.xmlaCellSet&&this.xmlaCellSet.length>0?[].slice.call(this.xmlaCellSet[0].querySelectorAll('Axis[name|="Axis1"] Tuple')):[],s=this.xmlaCellSet&&this.xmlaCellSet.length>1?[].slice.call(this.xmlaCellSet[1].querySelectorAll("Cell")):[];if(this.olapVirtualization&&!(0,t.isNullOrUndefined)(this.pageSettings)){if(r.length*n.length!==s.length){for(var o=[],l=0;l<s.length;l++)(0,t.isNullOrUndefined)(s[l])||(o[Number(s[l].getAttribute("CellOrdinal"))]=s[l]);s=o}this.clonedValTuple=s;var d=this.getDrillInfo("columns"),p=this.getActualTuples(r,d);d=this.getDrillInfo("rows");var h=this.getActualTuples(n,d,p.indexColls,r.length);this.clonedColumnTuple=p.tupColls,this.clonedRowTuple=h.tupColls,this.columnCount=this.clonedColumnTuple.length,this.rowCount=this.clonedRowTuple.length,p=h=void 0;var u=this.getVirtualScrollingData(this.clonedColumnTuple,this.clonedRowTuple);this.performEngine(u.columnTuple,u.rowTuple,u.valueTuple)}else this.performEngine(r,n,s)},e.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})),i.length>0)for(var a=0,r=this.drilledMembers.length;a<r;a++){var n=this.drilledMembers[a],s=i.indexOf(n.name);s>-1&&(t[s]||(t[s]=[]),t[s]=t[s].concat(n.items))}return t},e.prototype.getActualTuples=function(e,t,i,a){var r=[],n=[],s=[];if(e.length>0)for(var o=function(o,d){for(var p=e[o],h=!0,u=!1,c=!1,g=p.getElementsByTagName("MEMBER_TYPE"),m=p.getElementsByTagName("UName"),f=0,v=g.length;f<v;f++){var S=Number(g[f].textContent),y=m[f].textContent;if(c&&S<2?h=!1:2===S?u=!0:u&&S<2&&(h=!1),t[f]&&t[f].indexOf(y)>-1&&(c=!0),!h)break}if(h)if(r[r.length]=p,i){var b=l.clonedValTuple.slice(o*a,o*a+a);s=s.concat(i.map(function(e){return b[e]}))}else n[n.length]=o},l=this,d=0,p=e.length;d<p;d++)o(d);else if(i){var h=this.clonedValTuple.slice(0,a);s=s.concat(i.map(function(e){return h[e]}))}return s.length>0&&(this.clonedValTuple=s),{tupColls:r,indexColls:n}},e.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,this.levelUniqueName={}},e.prototype.performEngine=function(e,i,a){this.totalCollection=[];var r=this.getMeasureInfo();if(this.drilledMembers.length>0){var n=void 0,s=e.length&&i.length?e.length*i.length:e.length?e.length:i.length;e=(n=this.frameMeasureOrder(r,"column",e,a,e.length,s)).orderedHeaderTuples,a=n.orderedValueTuples,i=(n=this.frameMeasureOrder(r,"row",i,a,e.length,s)).orderedHeaderTuples,a=n.orderedValueTuples}"down"===this.customArgs.action&&this.updateTupCollection("row"===this.customArgs.drillInfo.axis?i.length:e.length);for(var o,l={},d=0;d<a.length;d++){if(!(0,t.isNullOrUndefined)(a[d]))l[this.olapVirtualization&&this.pageSettings?d:Number(a[d].getAttribute("CellOrdinal"))]=a[d]}if(this.valueSortSettings.columnIndex=void 0,this.enableValueSorting&&this.valueSortSettings&&!this.isPaging&&!this.olapVirtualization&&(o=this.getValueSortInfo(e,i,r)),"down"===this.customArgs.action&&"column"!==this.customArgs.drillInfo.axis||(this.frameColumnHeader(e),this.isPaging||this.olapVirtualization||this.performColumnSorting(l,o)),"down"===this.customArgs.action&&"row"!==this.customArgs.drillInfo.axis||(this.frameRowHeader(i),this.isPaging||this.olapVirtualization||this.performRowSorting(l,o)),this.frameValues(l,e.length),this.performColumnSpanning(),!this.isPaging&&!this.olapVirtualization&&this.enableSort)for(var p=0;p<this.headerContent.length;p++)this.headerContent[p]=this.pivotValues[p];this.isEngineUpdated=!0,this.isEmptyData=0===e.length},e.prototype.getValueSortInfo=function(e,t,i){var a;if(this.valueSortSettings.headerText){var r=this.valueSortSettings.headerText.split(this.valueSortSettings.headerDelimiter),n=r.indexOf("Grand Total");if(n>-1){var s=r.join("").split(r[n]).join("");(r=[])[i.measureIndex]=s}for(var o="",l=i.measureIndex,d=0;d<this.dataSourceSettings.values.length;d++)if(l=r.indexOf(this.dataSourceSettings.values[d].caption),this.dataSourceSettings.values[d].caption===r[l]){r[l]=this.fieldList[this.dataSourceSettings.values[d].name].name,o=r[l];break}if(-1!==l){l<i.measureIndex&&(r=this.reArrangeHeaders(r,i.measureIndex,o));var p="column"===this.olapValueAxis?e:t;if(p.length>0){var h=p[0].getElementsByTagName("Member").length-(n>-1?l:0),u=this.getParentElement(p,r,h,i.measureIndex,o,n>-1)[0];a=p.indexOf(u)}}}return{memberIndex:a,columnLength:e.length,rowLength:t.length,isValueSorting:a>-1}},e.prototype.getParentElement=function(e,i,a,r,n,s){for(var o=[],l=0,d=!1,p=!1,h=e[0].getElementsByTagName("Member").length-a,u=0;u<e.length;u++){if((0,t.isNullOrUndefined)(e[u].getElementsByTagName("Member")[h])){o=[];break}var c=e[u].getElementsByTagName("UName")[h].textContent,g=e[u].getElementsByTagName("Caption")[h].textContent,m=Number(e[u].getElementsByTagName("LNum")[h].textContent),f=c===i[h]||g===i[h]||(0,t.isNullOrUndefined)(i[h])&&0===m;if(f){if(o[o.length]=e[u],d=!0,l=m,s)break}else{if(d&&l<m){for(var v=[],S=u;S<e.length;S++){var y=e[S].getElementsByTagName("UName")[h].textContent,b=e[S].getElementsByTagName("Caption")[h].textContent,C=Number(e[S].getElementsByTagName("LNum")[h].textContent),x=y===i[h+1]||b===i[h+1]||(0,t.isNullOrUndefined)(i[h+1])&&0===C;if(l+1===C&&x)v[v.length]=e[S],p=!0;else if(l+1<C){if(!p)break;v[v.length]=e[S]}else if(l+1>C)break}if(p){var w=i.slice(0,h).concat(i.slice(h+1,i.length));w.indexOf(n)<r&&(w=this.reArrangeHeaders(w,r,n)),o=this.getParentElement(v,w,v[0].getElementsByTagName("Member").length,r,n)}break}if(d&&!f)break}}return s||h<i.length-1&&o.length>0&&!p&&(o=this.getParentElement(o,i,a-1,r,n)),o},e.prototype.reArrangeHeaders=function(e,t,i){var a=e.indexOf(i),r=e.slice(0,a),n=e.slice(a+1,e.length);return r[t]=e[a],r.concat(n)},e.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);e++}while(e<3)},e.prototype.frameRowHeader=function(e){var t=this;this.headerGrouping={},this.lastLevel=[];var i=!0,a=this.pivotValues.length,r=[],n=[];"down"!==this.customArgs.action?(r=this.pivotValues,n=this.valueContent):a=this.customArgs.drillInfo.currentCell.rowIndex+1,this.rowStartPos=this.rowStartPos>0?this.rowStartPos:a;for(var s,o,l,d,p=0,h=[],u={},c=[],g=!1,m=-1,f=-1,v=[],S=[{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"}}],y=[],b=this.customArgs.drillInfo&&"row"===this.customArgs.drillInfo.axis?this.customArgs.drillInfo.currentCell.ordinal+1:0;p<e.length;){var C=e[p].querySelectorAll("Member");y=this.frameTupCollection(C,y,p+b,this.tupRowInfo,this.showRowSubTotals,this.hideRowTotalsObject,"row"),p++}p=0;var x=e.length;if("down"===this.customArgs.action){var w=this.customArgs.drillInfo.currentCell.ordinal+1;p=w,x+=w,o=this.tupRowInfo[w-1].allCount,s=this.tupRowInfo[w-1].allStartPos,d=this.tupRowInfo[w-1]}for(var T=p,M=0,D=!1,O=[];p<x;){C=e["down"===this.customArgs.action?p-(this.customArgs.drillInfo.currentCell.ordinal+1):p].querySelectorAll("Member");var N=0,P=void 0,E=this.tupRowInfo[p].allCount,I=this.tupRowInfo[p].allStartPos,F=this.tupRowInfo[p].measure,L=this.tupRowInfo[p].typeCollection,A=this.tupRowInfo[p].drillStartPos,R=this.tupRowInfo[p].startDrillUniquename;if(0===p||p===T){for(var k="down"===this.customArgs.action?this.tupRowInfo[0].members:C;N<k.length;)"1"===k[N].querySelector("MEMBER_TYPE").textContent&&0===Number(k[N].querySelector("LNum").textContent)?v[N]=0:v[N]=Number(k[N].querySelector("LNum").textContent),"1"===k[N].querySelector("MEMBER_TYPE").textContent?(u[N]=0,m=-1===m?N:m,f=N):(u[N]=1,g="3"!==k[N].querySelector("MEMBER_TYPE").textContent||g),N++;l=L.indexOf("3")}if(N=0,0===p&&(C.length>E+(F?1:0)||1===C.length&&F)&&S.pop(),0===p&&this.isPaging?0===S.length:!g||E===o||I!==s||1===C.length&&F){var j=this.checkAttributeDrill(this.tupRowInfo[p].drillInfo,"rows"),q=!(A>-1)||(!(E>0)||(j||I>A));q=d&&q&&A>-1?d.startDrillUniquename!==R||!(f>d.measurePosition||d.measureName===this.tupRowInfo[p].measureName||I!==A+1&&this.tupRowInfo[p].measurePosition!==A+1):q;var H=!(m>-1&&E>0)||(j||I>f);if((D="Top"===this.dataSourceSettings.grandTotalsPosition&&0===this.olapRowValueIndex&&"row"===this.olapValueAxis&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&("row"!==this.olapValueAxis||this.dataSourceSettings.rows.length>1))&&1===S.length&&(S=this.frameGrandTotalValues(e,S,L,l)),C.length===E+(F?1:0)&&F&&!D){var V="Grand Total"+this.valueSortSettings.headerDelimiter+this.dataFields[this.getUniqueName(C[l].querySelector("UName").textContent)].caption?this.dataFields[this.getUniqueName(C[l].querySelector("UName").textContent)].caption:0,U="3"===L[l]&&this.dataFields[this.getUniqueName(C[l].querySelector("UName").textContent)]&&this.dataFields[this.getUniqueName(C[l].querySelector("UName").textContent)].caption?this.dataFields[this.getUniqueName(C[l].querySelector("UName").textContent)].caption:C[l].querySelector("Caption").textContent;(S=this.frameGrandTotalAxisSet(S,this.getUniqueName(C[l].querySelector("UName").textContent),U,a,p,Number(L[l]),C[l].querySelector("PARENT_UNIQUE_NAME")?C[l].querySelector("PARENT_UNIQUE_NAME").textContent:void 0,C[l].querySelector("LName").textContent,C[l].getAttribute("Hierarchy"),{levelName:V,axis:C[l].getAttribute("Hierarchy")}))[S.length-1].valueSort[V]=1}else if(0!==I&&(0!==l||1!==I)&&q&&H){"Top"===this.dataSourceSettings.grandTotalsPosition&&i&&this.dataSourceSettings.showGrandTotals&&("row"!==this.olapValueAxis||this.dataSourceSettings.rows.length>1)&&(this.insertRowGrandTotal(S,n,r,e,a),a=this.pivotValues.length,i=!1),d=this.tupRowInfo[p];var B=a,_=N;P={};for(var G=!1;N<C.length;){var z=C[N];if(z.querySelector("UName").textContent!==h[N]&&"2"!==L[N]&&(!(Object.keys(P).length>0?P.isDrilled&&!this.fieldList[P.hierarchy].isHierarchy:G)||"3"===L[N]&&u[N-1]&&0!==u[N+1])){var W=Number(z.querySelector("LNum").textContent)-(u[N]&&"3"!==L[N]?1:v[N]),Q=!!this.namedSetsPosition.row[N],Y=this.getUniqueName(z.querySelector("UName").textContent),K=this.getDepth(this.tupRowInfo[p],Y,Number(L[N]));V=this.getCaptionCollectionWithMeasure(this.tupRowInfo[p],N,!0);if(this.showSubTotalsAtBottom&&a>this.rowStartPos&&(B=a=this.insertRowSubTotal(r,n,O,a,W,V)),!(this.isPaging&&r[M][0]&&this.fieldList[r[M][0].hierarchy]&&this.fieldList[r[M][0].hierarchy].isHierarchy&&r[M][0].hasChild&&!r[M][0].isDrilled&&!this.rows[N].isNamedSet&&(0===this.rows[N].name.indexOf("[Measures]")||this.fieldList[z.getAttribute("Hierarchy")]&&(this.fieldList[z.getAttribute("Hierarchy")].isHierarchy||this.fieldList[z.getAttribute("Hierarchy")].hasAllMember))&&r[M][0].depth<K)){r[a]=[{axis:"row",actualText:Y,colIndex:0,formattedText:"3"===L[N]&&this.dataFields[Y]&&this.dataFields[Y].caption?this.dataFields[Y].caption:z.querySelector("Caption").textContent,hasChild:!!(this.fieldList[z.getAttribute("Hierarchy")]&&this.fieldList[z.getAttribute("Hierarchy")].isHierarchy&&N<this.rows.length-1&&!this.rows[N+1].isNamedSet&&this.rows[N+1].name.indexOf("[Measures]")<0&&this.fieldList[this.rows[N+1].name]&&this.fieldList[this.rows[N+1].name].hasAllMember)||Number(z.querySelector("CHILDREN_CARDINALITY").textContent)>0,level:W,depth:K,rowIndex:a,index:[],ordinal:p,type:"header",colSpan:1,rowSpan:1,memberType:Number(L[N]),isDrilled:!(!this.fieldList[z.getAttribute("Hierarchy")]||!this.fieldList[z.getAttribute("Hierarchy")].isHierarchy||this.isAttributeDrill(z.getAttribute("Hierarchy"),this.tupRowInfo[p].drillInfo,"rows"))||this.tupRowInfo[p].drillInfo[N].isDrilled,parentUniqueName:z.querySelector("PARENT_UNIQUE_NAME")?z.querySelector("PARENT_UNIQUE_NAME").textContent:void 0,levelUniqueName:z.querySelector("LName").textContent,hierarchy:z.getAttribute("Hierarchy"),isNamedSet:Q,valueSort:{levelName:"",axis:z.getAttribute("Hierarchy")}}],this.olapVirtualization&&"header"===r[a][0].type&&delete r[a][0].type,(P="3"!==L[N]?r[a][0]:P)||c.push(z.querySelector("Caption").textContent),V=this.getCaptionCollectionWithMeasure(this.tupRowInfo[p],N,!1),r[a][0].valueSort.levelName=V,r[a][0].valueSort[V]=1,n[a-this.rowStartPos]={},n[a-this.rowStartPos][0]=r[a][0],F&&l>N&&(h[l]="");for(var X=N+1;X<C.length;X++)h[X]="";h[N]=z.querySelector("UName").textContent,M=3!==Number(L[N])?a:M,a++,_=N}}else"2"===L[N]?_=N:this.tupRowInfo[p].drillInfo[N].isDrilled&&0===u[N]&&(G=!0);this.tupRowInfo[p].drillInfo[N].isDrilled&&this.tupRowInfo[p].showTotals&&(this.tupRowInfo[p].showTotals=!!this.showRowSubTotals&&void 0===this.hideRowTotalsObject[this.tupRowInfo[p].drillInfo[N].hierarchy]),N++}B<a&&_>=C.length-1&&(r[a-1][0].ordinal=p,"header"===r[a-1][0].type&&delete r[a-1][0].type)}o=E,s=I}p++}this.showSubTotalsAtBottom&&O.length>0&&(O.reverse(),O.forEach(function(e){r[a]=[e],n[a-t.rowStartPos]={},n[a-t.rowStartPos][0]=r[a][0],a++})),("Top"!==this.dataSourceSettings.grandTotalsPosition||"row"===this.olapValueAxis&&1===this.dataSourceSettings.rows.length&&"Top"===this.dataSourceSettings.grandTotalsPosition||0===this.dataSourceSettings.rows.length)&&this.insertRowGrandTotal(S,n,r,e,a)},e.prototype.insertRowSubTotal=function(e,t,i,a,r,n){var s=Hs.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(i.length>0)for(var h=i.length-1,u=i[h].valueSort.levelName.split(".").length,c=n.split(".").length;u>=c&&(e[a]=[i[h]],t[a-this.rowStartPos]={},t[a-this.rowStartPos][0]=e[a][0],a++,i.splice(i.length-1,1),Object.keys(i).length>0);)u=i[--h].valueSort.levelName.split(".").length;return a},e.prototype.insertRowGrandTotal=function(e,t,i,a,r){if(e.length>1&&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++)e[s].rowIndex=r,i[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},e.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},e.prototype.getDepth=function(e,t,i){var a=e.uNameCollection.indexOf(t),r=(e.uNameCollection.substring(0,a)+(3===i?"":t)).split("::[").map(function(e){return"["===e[0]?e:"["+e});3===i&&this.rowMeasurePos===r.length&&r.push(t);for(var n=-1,s=0;s<r.length;s++){n+=r[s].split("~~").length}return n},e.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},e.prototype.frameTupCollection=function(e,i,a,r,n,s,o){for(var l,d,p,h,u,c,g=0,m=0,f=[],v=[],S=[],y="",b="",C=!0,x=-1;g<e.length;){var w=e[g],T=Number(w.querySelector("LNum").textContent),M=w.querySelector("UName").textContent;Number(w.querySelector("MEMBER_TYPE").textContent)>3&&(w.querySelector("MEMBER_TYPE").textContent=0===M.indexOf("[Measures]")?"3":"1");var D=0===M.indexOf("[Measures]")?"3":Number(w.querySelector("MEMBER_TYPE").textContent)>3?"1":w.querySelector("MEMBER_TYPE").textContent,O=w.querySelector("Caption").textContent;this.fieldList[O]&&"CalculatedField"===this.fieldList[O].type&&(O=this.fieldList[O].caption,w.querySelector("Caption").textContent=O);var N=w.getAttribute("Hierarchy"),P=w.querySelector("PARENT_UNIQUE_NAME")?w.querySelector("PARENT_UNIQUE_NAME").textContent:"";if("2"===D?(this.isPaging||m++,p=(0,t.isNullOrUndefined)(p)?g:p):"3"===D?(h=w,u=M,c=g,"column"===o?(this.colMeasures[M]=w,this.colMeasurePos=g):this.rowMeasurePos=g):x=s[N],"2"!==D){if(this.headerGrouping[g]){if(T>this.lastLevel[g])this.lastLevel[g]=T;else if(T<this.lastLevel[g]){for(var E=this.lastLevel[g];E>=T;)delete this.headerGrouping[g].UName[E],delete this.headerGrouping[g].Caption[E],E--;this.lastLevel[g]=T}this.headerGrouping[g].UName[T]=M,this.headerGrouping[g].Caption[T]=O}else this.lastLevel[g]=T,this.headerGrouping[g]={UName:(l={},l[T]=M,l),Caption:(d={},d[T]=O,d)};if(this.isPaging)for(var I=P;this.drilledSets[I];){var F=this.drilledSets[I].querySelector("Caption").textContent,L=Number(this.drilledSets[I].querySelector("LNum").textContent);this.headerGrouping[g].UName[L]=I,this.headerGrouping[g].Caption[L]=F,I=null===this.drilledSets[I].querySelector("PARENT_UNIQUE_NAME")?"":this.drilledSets[I].querySelector("PARENT_UNIQUE_NAME").textContent}for(var A="",R=Object.keys(this.headerGrouping[g].UName),k=0;k<R.length;k++){var j=R[k];A=0===k?this.headerGrouping[g].UName[Number(j)]:A+"~~"+this.headerGrouping[g].UName[Number(j)]}y=""===y?A:y+"::"+A;var q="",H=Object.keys(this.headerGrouping[g].Caption);for(k=0;k<H.length;k++){j=H[k];q=0===k?this.headerGrouping[g].Caption[Number(j)]:q+"~~"+this.headerGrouping[g].Caption[Number(j)]}g!==c&&(b=""===b?q:b+"::"+q)}if(f.push(D),v.push(T),((0,t.isNullOrUndefined)(i[g])||i[g]<T)&&(i[g]=T),S.push({level:T,uName:M,hierarchy:N,isDrilled:!1}),r[a-1]&&"1"===r[a-1].typeCollection[g]&&S[g].level>r[a-1].drillInfo[g].level){var V=y.split(/~~|::\[/).map(function(e){return"["===e[0]?e:"["+e});V.pop();var U=V.join("~~");this.setDrillInfo(P,U,g,a,r)}g++}return x>-1&&(C="2"!==f[x+1]),r[a]={allCount:m,allStartPos:p,measure:h,measureName:u,measurePosition:c,members:e,typeCollection:f,uNameCollection:y,captionCollection:b,levelCollection:v,drillInfo:S,drillStartPos:-1,drillEndPos:-1,showTotals:!(!n&&m>0&&p>(0===c?1:0))&&C},i},e.prototype.getCaptionCollectionWithMeasure=function(e,t,i){var a=e.captionCollection,r=!0;if(!i&&"3"!==e.typeCollection[t])for(var n=0;n<this.measurePosition;n++)if(e.drillInfo[t].hierarchy===this.dataSourceSettings.rows[n].name){r=!1;break}if(e.measure&&r){var s=this.getUniqueName(e.measure.querySelector("UName").textContent),o=this.dataFields[s]&&this.dataFields[s].caption?this.dataFields[s].caption:e.measure.querySelector("Caption").textContent,l=e.uNameCollection.split(/[~~::]+/g).indexOf(e.measureName);(d=e.captionCollection.split(/[~~::]+/g)).splice(l,0,o),a=d.join(this.valueSortSettings.headerDelimiter)}else{var d;a=(d=e.captionCollection.split(/[~~::]+/g)).join(this.valueSortSettings.headerDelimiter)}return a},e.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);this.namedSetsPosition[e?"row":"column"]=t,e++}while(e<2)},e.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},e.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--},e.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,d=this.tupRowInfo[r].measure,p=this.tupRowInfo[r].typeCollection;this.tupRowInfo[r].drillStartPos,this.tupRowInfo[r].startDrillUniquename;if(0===r&&(s.length>o+(d?1:0)||1===s.length&&d)&&t.pop(),0!==r||!this.isPaging||0===t.length){this.checkAttributeDrill(this.tupRowInfo[r].drillInfo,"rows");if(s.length===o+(d?1:0)&&d){var h="Grand Total"+this.valueSortSettings.headerDelimiter+s[a].querySelector("Caption").textContent,u="3"===p[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),u,this.pivotValues.length,r,Number(p[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:h,axis:s[a].getAttribute("Hierarchy")}))[t.length-1].valueSort["Grand Total"+this.valueSortSettings.headerDelimiter+s[a].querySelector("Caption").textContent]=1}0}n=this.dataSourceSettings.values.length+1===t.length,r++}return t},e.prototype.frameColumnHeader=function(e){var t=this;this.headerGrouping={},this.lastLevel=[];for(var i=0,a=[],r=[],n=[],s=-1,o=-1,l=this.customArgs.drillInfo&&"column"===this.customArgs.drillInfo.axis?this.customArgs.drillInfo.currentCell.ordinal+1:0;i<e.length;){var d=e[i].querySelectorAll("Member");a=this.frameTupCollection(d,a,i+l,this.tupColumnInfo,this.showColumnSubTotals,this.hideColumnTotalsObject,"column"),i++}if(e.length>0){d=e[0].querySelectorAll("Member");for(var p=0;p<d.length;)n[p]="1"===d[p].querySelector("MEMBER_TYPE").textContent&&0===Number(d[p].querySelector("LNum").textContent)?0:Number(d[p].querySelector("LNum").textContent),"1"!==d[p].querySelector("MEMBER_TYPE").textContent||!this.isPaging&&0!==Number(d[p].querySelector("LNum").textContent)?r[p]=1:(r[p]=0,s=-1===s?p:s,o=p),p++}i=0;for(var h,u=1,c={},g=!0,m=!1,f=function(){var l=e[i].querySelectorAll("Member"),d=v.tupColumnInfo[i].allCount,p=v.tupColumnInfo[i].allStartPos,f=v.tupColumnInfo[i].measure,S=v.tupColumnInfo[i].typeCollection,y=v.tupColumnInfo[i].drillInfo,b=v.tupColumnInfo[i].drillStartPos,C=v.tupColumnInfo[i].startDrillUniquename,x=v.tupColumnInfo[i].endDrillUniquename,w=v.tupColumnInfo[i].drillEndPos,T=v.tupColumnInfo[i].levelCollection,M="2"!==S[0]&&("3"!==S[0]||"2"!==S[1]),D=0;a.map(function(e,i){D+=0===r[i]?e+(1-(n[i]>1?1:n[i])):0===e?t.isPaging&&"2"===S[i]?0:1:e}),v.colDepth=v.colDepth>D?v.colDepth:D,0===i&&l.length>d+(f?1:0)&&(m=!0,M=d>0&&M?p>s:M);var O=!1;if("Top"===v.dataSourceSettings.grandTotalsPosition&&v.dataSourceSettings.showGrandTotals&&v.dataSourceSettings.showColumnGrandTotals){for(var N=0,P=0;P<l.length;P++)0===l[P].querySelector("Caption").textContent.indexOf("All")&&N++;O=N===("column"===v.olapValueAxis?v.dataSourceSettings.columns.length-1:v.dataSourceSettings.columns.length)}if((M||O)&&(0===d||O)){var E=[-1,-1,-1];v.tupColumnInfo[i-1]&&0===v.tupColumnInfo[i-1].allCount?E=v.levelCompare(T,v.tupColumnInfo[i-1].levelCollection):m&&h&&(E=v.levelCompare(T,h.levelCollection)),v.tupColumnInfo[i].drillStartPos<0||v.showSubTotalsAtTop?(!g&&E[0]>-1&&E[2]>-1&&(u=v.mergeTotCollection(u,d,a,n,r,p,y,E)),v.setParentCollection(l),v.frameCommonColumnLoop(l,i,u,a,r,n),v.tupColumnInfo[i].showTotals||u--,!g&&E[0]>-1&&E[2]>-1&&(u=v.mergeTotCollection(u,d,a,n,r,p,y,E)),g=!1,v.isColDrill?v.isColDrill=!1:u++):c.drillStartPos===b&&c.startDrillUniquename===C&&c.allCount!==d||(!g&&E[0]>-1&&E[2]>-1&&(u=v.mergeTotCollection(u,d,a,n,r,p,y,E),g=!0),v.setParentCollection(l),(!m||o<=b)&&(O||(v.totalCollection[v.totalCollection.length]={allCount:d,ordinal:i,members:l,drillInfo:y}),c.allCount=d,c.allStartPos=p,c.drillStartPos=b,c.startDrillUniquename=C,c.endDrillUniquename=x)),h=v.tupColumnInfo[i]}var I=v.checkAttributeDrill(v.tupColumnInfo[i].drillInfo,"columns");if(d>0&&(!m||M&&(I||o<p))&&(d===c.allCount||p!==c.allStartPos)){var F=w===b||c.endDrillUniquename===x,L=p!==c.allStartPos?c.startDrillUniquename!==C:F;b>-1&&!L||(g||(u=v.mergeTotCollection(u,d,a,n,r,p,y),g=!0),v.setParentCollection(l),m&&b>-1&&!(o<=b)||(O||(v.totalCollection[v.totalCollection.length]={allCount:d,ordinal:i,members:l,allStartPos:p,drillInfo:y}),c.allCount=d,c.allStartPos=p,c.drillStartPos=b,c.startDrillUniquename=C,c.endDrillUniquename=x))}i++},v=this;i<e.length;)f();if(this.totalCollection.length>0)if(Object.keys(this.colMeasures).length>1)this.orderTotals(u,a,r,n);else{this.totalCollection=this.totalCollection.reverse();for(var S=0,y=this.totalCollection;S<y.length;S++){var b=y[S];if(!(0===this.tupColumnInfo[b.ordinal].measurePosition?1===this.tupColumnInfo[b.ordinal].allStartPos:0===this.tupColumnInfo[b.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals){this.frameCommonColumnLoop(b.members,b.ordinal,u,a,n,r);var C=this.checkAttributeDrill(this.tupColumnInfo[b.ordinal].drillInfo,"columns");(this.tupColumnInfo[b.ordinal].showTotals||C)&&u++}}}},e.prototype.orderTotals=function(e,t,i,a){for(var r={},n=1,s=0,o=this.totalCollection;s<o.length;s++){var l=o[s];if(!(0===this.tupColumnInfo[l.ordinal].measurePosition?1===this.tupColumnInfo[l.ordinal].allStartPos:0===this.tupColumnInfo[l.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals){var d=this.tupColumnInfo[l.ordinal].measure.querySelector("UName").textContent;r[d]?(r[d].coll.push(l),r[d].count++,n=n<r[d].count?r[d].count:n):r[d]={coll:[l],count:1}}}for(var p=Object.keys(r),h=n-1;h>-1;){for(var u=0,c=p;u<c.length;u++){(l=r[c[u]].coll[h])&&(this.frameCommonColumnLoop(l.members,l.ordinal,e,t,i,a),this.tupColumnInfo[l.ordinal].showTotals&&e++)}h--}},e.prototype.setParentCollection=function(e){for(var t=0;e.length>t;){var i=e[t],a=Number(i.querySelector("MEMBER_TYPE").textContent)>2?"3":i.querySelector("MEMBER_TYPE").textContent,r=Number(i.querySelector("LNum").textContent),n=i.querySelector("UName").textContent,s=i.querySelector("PARENT_UNIQUE_NAME")?i.querySelector("PARENT_UNIQUE_NAME").textContent:"",o=!0,l=!1;if(this.parentObjCollection[t]){var d=Object.keys(this.parentObjCollection[t]),p=this.parentObjCollection[t][r-1];o=p?s===p.querySelector("UName").textContent:0===d.length,l="1"===this.tupColumnInfo[0].typeCollection[t]}"2"===a?delete this.parentObjCollection[t]:(!this.isPaging&&!l||o||delete this.parentObjCollection[t],this.parentObjCollection[t]?this.parentObjCollection[t][r]&&this.parentObjCollection[t][r].querySelector("UName").textContent===n||(this.parentObjCollection[t][r]=i):(this.parentObjCollection[t]={},this.parentObjCollection[t][r]=i)),t++}},e.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--}},e.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},e.prototype.mergeTotCollection=function(e,i,a,r,n,s,o,l){for(var d=(0,t.isNullOrUndefined)(s)?l[0]:s-(this.colMeasurePos===s-1?2:1),p=o[d]&&o[d].level,h=this.getLevelsAsString(d-1,o),u={},c=1,g=!1,m=0,f=this.totalCollection;m<f.length;m++){var v=f[m];if(g||v.allCount<=i&&(!(p>-1&&v.drillInfo[d])||v.drillInfo[d].level>=p&&this.getLevelsAsString(d-1,v.drillInfo)===h)){var S=this.tupColumnInfo[v.ordinal].measure?this.tupColumnInfo[v.ordinal].measure.querySelector("UName").textContent:"measure";u[S]?(u[S].coll.push(v),u[S].count++,c=c<u[S].count?u[S].count:c):u[S]={coll:[v],count:1},g=!1}}for(var y=Object.keys(u),b=c-1;b>-1;){for(var C=0,x=y;C<x.length;C++){var w=u[x[C]].coll[b];if(w)(!(0===this.tupColumnInfo[w.ordinal].measurePosition?1===this.tupColumnInfo[w.ordinal].allStartPos:0===this.tupColumnInfo[w.ordinal].allStartPos)||this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showColumnGrandTotals)&&(this.frameCommonColumnLoop(w.members,w.ordinal,e,a,n,r),this.tupColumnInfo[w.ordinal].showTotals&&e++),this.totalCollection.pop()}b--}return e},e.prototype.getLevelsAsString=function(e,t){for(var i=[],a=0;a<e;a++)i[a]=t[a].level;return i.length>0?i.toString():""},e.prototype.frameCommonColumnLoop=function(e,t,i,a,r,n){var s,o=-1;if(this.tupColumnInfo[t].showTotals)for(var l=0,d=0;l<e.length;)d+=n[l]>0&&this.getMeasurePosition(this.tupColumnInfo[t].uNameCollection,this.tupColumnInfo[t].measurePosition)!==l?a[l]:a[l]+(1-r[l]),this.tupColumnInfo[t].drillInfo[l].isDrilled&&this.tupColumnInfo[t].showTotals&&(this.tupColumnInfo[t].showTotals=!!this.showColumnSubTotals&&void 0===this.hideColumnTotalsObject[this.tupColumnInfo[t].drillInfo[l].hierarchy],d-=a[l]-this.tupColumnInfo[t].levelCollection[l],o=this.tupColumnInfo[t].showTotals?-1:d-1),l++;var p=this.checkAttributeDrill(this.tupColumnInfo[t].drillInfo,"columns");if(this.tupColumnInfo[t].showTotals||p)for(var h=0,u=0,c={},g="0"===e[0].querySelector("LNum").textContent;h<e.length;){for(var m=e[h],f=Number(m.querySelector("MEMBER_TYPE").textContent)>2?"3":m.querySelector("MEMBER_TYPE").textContent,v=0,S=m.querySelector("LNum").textContent,y="2"!==f?n[h]?1:r[h]:1;y<=("3"===f?1:a[h]);y++){var b=!1;this.pivotValues[u]||(this.pivotValues[u]=[]),Number(e[h].querySelector("LNum").textContent)>y&&"2"!==f?(this.parentObjCollection[h][y]||this.getDrilledParent(e[h],y,this.parentObjCollection[h]),this.parentObjCollection[h][y]&&(m=this.parentObjCollection[h][y]),b=!0):(m=e[h],v++);var C=this.getUniqueName(m.querySelector("UName").textContent);"2"!==f?c[C]="3"===f&&this.dataFields[C]&&this.dataFields[C].caption?this.dataFields[C].caption:m.querySelector("Caption").textContent:"2"===f&&"0"===S&&g&&(c[C]="Grand Total",g=!1);for(var x=Object.keys(c),w=h>=this.measurePosition&&0===Number(m.getElementsByTagName("LNum")[0].textContent)&&1===x.length?"Grand Total"+this.valueSortSettings.headerDelimiter:"",T=0;T<x.length;T++){var M=x[T];0===T?w+=c[M]:w=w+this.valueSortSettings.headerDelimiter+c[M]}var D=!!this.namedSetsPosition.column[h],O=this.getDepth(this.tupColumnInfo[t],C,Number(f));if(this.isPaging&&this.pivotValues[u-1]&&this.pivotValues[u-1][i]&&this.fieldList[this.pivotValues[u-1][i].hierarchy]&&this.fieldList[this.pivotValues[u-1][i].hierarchy].isHierarchy&&this.pivotValues[u-1][i].hasChild&&!this.pivotValues[u-1][i].isDrilled&&!this.columns[h].isNamedSet&&this.fieldList[m.getAttribute("Hierarchy")]&&(this.fieldList[m.getAttribute("Hierarchy")].isHierarchy||this.fieldList[m.getAttribute("Hierarchy")].hasAllMember)&&this.pivotValues[u-1][i].depth<O){this.isColDrill=!0;break}this.pivotValues[u][i]={axis:"column",actualText:C,colIndex:i,formattedText:"3"===f&&this.dataFields[C]&&this.dataFields[C].caption?this.dataFields[C].caption:m.querySelector("Caption").textContent,hasChild:!!(this.fieldList[m.getAttribute("Hierarchy")]&&this.fieldList[m.getAttribute("Hierarchy")].isHierarchy&&h<this.columns.length-1&&!this.columns[h+1].isNamedSet&&this.columns[h+1].name.indexOf("[Measures]")<0&&this.fieldList[this.columns[h+1].name]&&this.fieldList[this.columns[h+1].name].hasAllMember)||Number(m.querySelector("CHILDREN_CARDINALITY").textContent)>0,level:v>1?-1:Number(m.querySelector("LNum").textContent)-(n[h]&&"3"!==f?1:0),rowIndex:u,ordinal:t,memberType:Number(f),depth:O,isDrilled:!(!this.fieldList[m.getAttribute("Hierarchy")]||!this.fieldList[m.getAttribute("Hierarchy")].isHierarchy||this.isAttributeDrill(m.getAttribute("Hierarchy"),this.tupColumnInfo[t].drillInfo,"columns"))||(b||this.tupColumnInfo[t].drillInfo[h].isDrilled),parentUniqueName:m.querySelector("PARENT_UNIQUE_NAME")?m.querySelector("PARENT_UNIQUE_NAME").textContent:void 0,levelUniqueName:m.querySelector("LName").textContent,hierarchy:m.getAttribute("Hierarchy"),isNamedSet:D,valueSort:(s={levelName:w},s[w]=1,s.axis=m.getAttribute("Hierarchy"),s)},this.headerContent[u]||(this.headerContent[u]={}),this.headerContent[u][i]=this.pivotValues[u][i],u++}h++}else if(o>-1)this.pivotValues[o][i-1].ordinal=t;else if(this.tupColumnInfo[t].allCount>0){for(l=0,d=0;l<this.tupColumnInfo[t].allStartPos;)d+=n[l]>0&&this.getMeasurePosition(this.tupColumnInfo[t].uNameCollection,this.tupColumnInfo[t].measurePosition)!==l?a[l]:a[l]+(1-r[l]),l++;this.tupColumnInfo[t].allStartPos===this.tupColumnInfo[t].measurePosition+1?d-=a[this.tupColumnInfo[t].allStartPos-2]-this.tupColumnInfo[t].levelCollection[this.tupColumnInfo[t].allStartPos-2]+1:d-=a[this.tupColumnInfo[t].allStartPos-1]-this.tupColumnInfo[t].levelCollection[this.tupColumnInfo[t].allStartPos-1],this.pivotValues[d-1]&&(this.pivotValues[d-1][i-1].ordinal=t)}},e.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},e.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},e.prototype.getDrilledParent=function(e,t,i){for(var a=Number(e.querySelector("LNum").textContent),r=e,n=a-1;n>=t;n--){var s=this.drilledSets[r.querySelector("PARENT_UNIQUE_NAME").textContent];if(!s)break;i[n]=s,r=s}},e.prototype.performRowSorting=function(e,t){var i;if((this.enableSort||this.enableValueSorting)&&this.tupRowInfo.length>0){for(var a=this.pivotValues.length,r={},n={},s=[],o=!1,l=this.tupRowInfo[0].typeCollection.lastIndexOf("1"),d=void 0,p=this.colDepth;p<a;p++){var h=this.pivotValues[p][0];if(!this.showSubTotalsAtBottom||!h.isSum||3===h.memberType){var u=this.tupRowInfo[h.ordinal],c=u?0===u.measurePosition&&3===h.memberType?u.measureName:u.uNameCollection:"";if(""!==c){l>-1&&(c=this.frameUniqueName(c,h,u));var g=c.split(/~~|::\[/).length;if(3===h.memberType&&this.tupRowInfo[0].measurePosition>0)n[U=this.getParentUname(c,h,!0,!0)]?n[U].push(h):n[U]=[h];else r[g]?r[g][c]=[h]:r[g]=((i={})[c]=[h],i)}o&&s.push(h),"grand sum"===h.type&&(o=!0)}}for(var m=Object.keys(n).length>0&&this.tupRowInfo[0].measurePosition>0,f=Object.keys(r).map(function(e){return Number(e)}).sort(function(e,t){return e>t?1:t>e?-1:0}),v={},S=f.length-1;S>=0;S--){for(var y={},b=r[f[S]],C=Object.keys(b),x=0;x<C.length;x++){y[U=0===S?"parent":this.getParentUname(C[x],b[C[x]][0],m,!1)]?y[U].push(b[C[x]][0]):y[U]=b[C[x]]}for(var w=Object.keys(y),T=0;T<w.length;T++)y[w[T]]=this.sortRowHeaders(y[w[T]],e,t);if(v[f[S+1]])for(T=0;T<w.length;T++){for(var M=[],D=y[w[T]],O=0;O<D.length;O++){var N=this.tupRowInfo[D[O].ordinal],P=0===N.measurePosition&&3===D[O].memberType?N.measureName:N.uNameCollection;M.push(D[O]),l>-1&&(P=this.frameUniqueName(P,D[O],N));var E=!1;if(m)if(n[U=this.getParentUname(P,D[O],m,!0)]){n[U]=this.sortRowHeaders(n[U],e,t);var I=P.lastIndexOf("::[")===P.indexOf("::[Measures]"),F=P.split("::[").length-1===N.measurePosition,L=!N.drillInfo[N.measurePosition-1].isDrilled,A=N.members.length>N.measurePosition+1;if(I&&F&&L&&A){E=!0;for(var R=0;R<n[U].length;R++){M.push(n[U][R]);var k=P.substring(0,P.indexOf("::[Measures]"))+"::"+n[U][R].actualText;v[f[S+1]][k]&&(M=M.concat(v[f[S+1]][k]))}}else d=this.showSubTotalsAtBottom&&M[M.length-1].isDrilled,M=M.concat(n[U])}if(!E&&v[f[S+1]][P])if(this.showSubTotalsAtBottom&&3===M[M.length-1].memberType&&M[M.length-1].level>-1&&d){for(var j=[],q=0,H=M.length-1;H>=0;H--){if(3!==M[H].memberType){j=j.reverse(),q=H+1;break}j[j.length]=M[H]}M=M.slice(0,q).concat(v[f[S+1]][P]).concat(j)}else{h=M[M.length-1];var V=void 0;this.showSubTotalsAtBottom&&h.isDrilled&&((V=Hs.frameHeaderWithKeys(h)).hasChild=!1,V.isDrilled=!1,V.isSum=!0,V.formattedText=V.formattedText+" Total"),M=M.concat(v[f[S+1]][P]),V&&(M[M.length]=V)}}y[w[T]]=M}else if(m)for(T=0;T<w.length;T++){for(D=y[w[T]],M=[],O=0;O<D.length;O++){M.push(D[O]);var U;P=this.tupRowInfo[D[O].ordinal].uNameCollection;l>-1&&(P=this.frameUniqueName(P,D[O],this.tupRowInfo[D[O].ordinal])),n[U=this.getParentUname(P,D[O],!0,!0)]&&(n[U]=this.sortRowHeaders(n[U],e,t),M=M.concat(n[U]))}y[w[T]]=M}v[f[S]]=y}var B=0,_=0,G=0;o=!1,s=this.sortRowHeaders(s,e,t);for(p=this.colDepth;p<a;p++){"Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&("column"===this.olapValueAxis&&this.colDepth+1===p||"row"===this.olapValueAxis&&this.colDepth+this.dataSourceSettings.values.length+1===p)&&(B=0,o=!1);var z=o?s:v[f[0]].parent,W="Top"===this.dataSourceSettings.grandTotalsPosition&&this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals&&this.colDepth===p?z.length:o?B-_:B;z[W]&&(this.pivotValues[p]=[z[W]],this.pivotValues[p][0].rowIndex=p,this.valueContent[G][0]=this.pivotValues[p][0]),B++,G++,"grand sum"===this.pivotValues[p][0].type&&(o=!0,_=B)}}},e.prototype.performColumnSorting=function(e,i){if(this.enableSort||this.enableValueSorting)for(var a=0;a<this.dataSourceSettings.columns.length;a++){for(var r=[],n=0,s=[],o=0;o<this.pivotValues.length;o++){var l=this.pivotValues[o],d=void 0,p={},h=[],u=1;s[n]=[],r[n]=[];for(var c=1,g=l[c].hierarchy,m=l[c].levelUniqueName;c<l.length;c++)if(!l[c].isNamedSet){if(2!==l[c].memberType&&"[Measures]"!==l[c].hierarchy&&-1!==l[c].level){if((0,t.isNullOrUndefined)(p[l[c].formattedText])||(0,t.isNullOrUndefined)(this.pivotValues[o-1]))p[l[c].formattedText]||(p[l[c].formattedText]=[]),l[c+1]&&l[c].formattedText===l[c+1].formattedText||(h[h.length]=l[c]),p[l[c].formattedText][l[c].colIndex]=l[c];else if(p[l[c].formattedText]&&this.pivotValues[o-1]){var f=this.pivotValues[o-1][l[c].colIndex],v=Number(Object.keys(p[l[c].formattedText])[0]),S=p[l[c].formattedText][v].colIndex,y=this.pivotValues[o-1][S];if(f.formattedText!==y.formattedText){d=this.sortColumnHeaders(p,h,this.sortObject[l[c-1].levelUniqueName]||this.sortObject[l[c].hierarchy],e,i,g,m),r[n]=(0,t.isNullOrUndefined)(r[n])?[]:r[n];for(var b=0;b<d.length;b++)for(var C=Object.keys(p[d[b]]).length,x=0;x<C;x++)u=0===r[n].length?1:0,r[n][r[n].length+u]=p[d[b]][Number(Object.keys(p[d[b]])[x])];h=[],(p={})[l[c].formattedText]=[],h[h.length]=l[c],p[l[c].formattedText][l[c].colIndex]=l[c]}else p[l[c].formattedText][l[c].colIndex]=l[c]}}else if(Object.keys(p).length>0){s[n][s[n].length+u]=l[c],d=this.sortColumnHeaders(p,h,this.sortObject[l[c-1].levelUniqueName]||this.sortObject[l[c].hierarchy],e,i,g,m),r[n]=(0,t.isNullOrUndefined)(r[n])?[]:r[n];for(var w=0;w<d.length;w++)for(var T=Object.keys(p[d[w]]).length,M=0;M<T;M++)u=0===r[n].length?1:0,r[n][r[n].length+u]=p[d[w]][Number(Object.keys(p[d[w]])[M])]}else(-1===l[c].level||0===l[c].level)&&Object.keys(p).length>=0&&"[Measures]"!==l[c].hierarchy&&(s[n][s[n].length+u]=l[c]);if(-1!==l[c].level&&1===Object.keys(p).length&&"[Measures]"!==l[c].hierarchy&&!(0,t.isNullOrUndefined)(l[c+1])&&-1===l[c+1].level){var D=Object.keys(p[l[c].formattedText]).length,O=Object.keys(p[l[c].formattedText]);if(D>1)for(var N=0;N<D;N++)u=0===s[n].length?1:0,s[n][s[n].length+u]=p[l[c].formattedText][Number(O[N])];else s[n][s[n].length+u]=l[c]}if(Object.keys(s[n]).length>0){u=0===r[n].length?1:0;var P=s[n].length;if(P>2)for(var E=1;E<P;E++)u=0===r[n].length?1:0,r[n][r[n].length+u]=s[n][E];else r[n][r[n].length+u]=s[n][1]||s[n][0];p={},h=[],s[n]=[]}}if(Object.keys(p).length>0){s[n][s[n].length+u]=l[c];var I=this.sortObject[l[c-1].levelUniqueName]||this.sortObject[l[c-1].hierarchy];d=this.sortColumnHeaders(p,h,I,e,i,g,m),r[n]=(0,t.isNullOrUndefined)(r[n])?[]:r[n];for(var F=0;F<d.length;F++){var L=Object.keys(p[d[F]]).length;for(M=0;M<L;M++)u=0===r[n].length?1:0,r[n][r[n].length+u]=p[d[F]][Number(Object.keys(p[d[F]])[M])]}}for(var A=1;A<r[n].length;A++)this.pivotValues[n][A]=r[n][A];for(var R=o;R<this.pivotValues.length;R++){var k=(0,t.extend)({},this.pivotValues[R+1],null,!0),j=(0,t.extend)({},this.pivotValues[R],null,!0);if(Object.keys(k).length===Object.keys(j).length&&Object.keys(k).length>2){for(var q=1;q<this.pivotValues[o].length;q++)Object.keys(k).length>0&&j[q].colIndex!==k[q].colIndex&&(this.pivotValues[R+1][q]=k[j[q].colIndex]);break}}n++,p={}}for(var H=0;H<this.pivotValues.length;H++)for(l=this.pivotValues[H],o=1;o<l.length;o++)l[o].colIndex=o}},e.prototype.frameUniqueName=function(e,t,i){var a=e.indexOf(t.actualText.toString()+"::[Measures]")>-1,r=(e=e.substring(0,e.indexOf(t.actualText.toString()))+t.actualText.toString()).split("::[").length<=this.getMeasurePosition(e,i.measurePosition);return e+=a||r?"::"+i.measureName:""},e.prototype.getMeasurePosition=function(e,t){for(var i=t,a=e.split("::["),r=0;r<a.length;r++)if(a[r]&&a[r].indexOf("Measures")>-1){i=r;break}return i},e.prototype.sortRowHeaders=function(e,i,a){if(this.enableValueSorting&&"column"===this.olapValueAxis&&a.isValueSorting&&!(0,t.isNullOrUndefined)(this.valueSortSettings)){for(var r=[],n=0;n<e.length;n++){var s=e[n],o=i[s.ordinal*a.columnLength+a.memberIndex],l=o?o.getElementsByTagName("Value"):void 0,d=o&&l.length>0?Number(l[0].textContent):0;r.push({header:s,value:d})}e=Hs.getSortedValue(r,this.valueSortSettings.sortOrder)}else if(this.enableSort&&e.length>0&&3!==e[0].memberType&&!e[0].isNamedSet){var p=[];for(n=0;n<e.length;n++)p[n]=e[n].actualText;var h=!1,u="Grand Total"!==e[0].actualText?e[0].hierarchy:e[1].hierarchy,c=this.fieldList[u]&&this.fieldList[u].membersOrder?this.fieldList[u].membersOrder.slice():[],g={fieldName:u,levelName:e[0].levelUniqueName,sortOrder:this.sortObject[e[0].hierarchy]||this.sortObject[e[0].levelUniqueName],members:c&&c.length>0?c:p,IsOrderChanged:!1};if(this.levelUniqueName[u]=g.levelName,c&&c.length>0?Hs.applyCustomSort(g,e,"string",!1,!0):("Ascending"===g.sortOrder||void 0===g.sortOrder?e.sort(function(e,t){return e.formattedText>t.formattedText?1:t.formattedText>e.formattedText?-1:0}):"Descending"===g.sortOrder&&e.sort(function(e,t){return e.formattedText<t.formattedText?1:t.formattedText<e.formattedText?-1:0}),h=!0),h&&this.getHeaderSortInfo){for(var m=[],f=0,v=0;f<e.length;f++)"Grand Total"!==e[f].actualText&&(m[v++]=e[f].formattedText);g.members=m}this.getHeaderSortInfo&&this.getHeaderSortInfo(g),g.IsOrderChanged&&Hs.applyCustomSort(g,e,"string",!0,!0)}return e},e.prototype.sortColumnHeaders=function(e,i,a,r,n,s,o){var l=Object.keys(e);if(this.enableValueSorting&&"row"===this.olapValueAxis&&n.isValueSorting&&!(0,t.isNullOrUndefined)(this.valueSortSettings)){for(var d=[],p=0;p<l.length;p++){var h=e[l[p]],u=this.showSubTotalsAtTop?h[0]:h[h.length-1],c=r[n.memberIndex*n.columnLength+u.ordinal],g=c?c.getElementsByTagName("Value"):void 0,m=c&&g.length>0?Number(g[0].textContent):0;d.push({header:u,value:m})}l=Hs.getSortedValue(d,this.valueSortSettings.sortOrder).map(function(e){return e.formattedText})}else if(this.enableSort){var f=!1,v=this.fieldList[s]&&this.fieldList[s].membersOrder?this.fieldList[s].membersOrder.slice():[],S={fieldName:s,levelName:o,sortOrder:a,members:v&&v.length>0?v:l,IsOrderChanged:!1};if(this.levelUniqueName[s]=S.levelName,v&&v.length>0?this.applyCustomSort(l,S):("Ascending"===S.sortOrder||void 0===S.sortOrder?l.sort(function(e,t){return e>t?1:t>e?-1:0}):"Descending"===S.sortOrder&&l.sort(function(e,t){return e<t?1:t<e?-1:0}),f=!0),f&&this.getHeaderSortInfo){for(var y=[],b=0,C=0;b<l.length;b++)"Grand Total"!==l[b]&&(y[C++]=l[b]);S.members=y}this.getHeaderSortInfo&&this.getHeaderSortInfo(S),S.IsOrderChanged&&this.applyCustomSort(l,S,!0)}return l},e.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}s>=0&&!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},e.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},e.prototype.getParentUname=function(e,t,i,a){var r="";if(i&&!a){for(var n=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++);if(this.getMeasurePosition(e,n.measurePosition)>=e.split("::[").length-1)r=s[s.length-2]>-1?e.substring(0,s[s.length-2])+o[s[s.length-1]]+n.measureName:"parent";else r=(d=e.lastIndexOf("~~")>e.lastIndexOf("::[")?e.lastIndexOf("~~"):e.lastIndexOf("::["))>-1?e.substring(0,d):"parent"}else{var d;r=(d=e.lastIndexOf("~~")>e.lastIndexOf("::[")?e.lastIndexOf("~~"):e.lastIndexOf("::["))>-1?e.substring(0,d):"parent"}return r},e.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;r>-1;r--)if(3===this.pivotValues[r][1].memberType){a=r;break}for(;t>-1;){e[t]={};for(var n=this.pivotValues[t].length-1,s=function(){e[t][n]=1;var r=o.pivotValues[t][n+1],s=o.pivotValues[t+1]&&o.rowStartPos-t>1?o.pivotValues[t+1][n]:void 0,l=o.pivotValues[t][n],d=!1,p=!1,h=o.tupColumnInfo[l.ordinal],u=h.allStartPos>("3"===h.typeCollection[0]?1:0),c=o.checkAttributeDrill(h.drillInfo,"columns");if(o.showSubTotalsAtTop&&l.isDrilled&&r&&r.actualText!==l.actualText&&l.level>-1&&(l.ordinal=o.getOrdinal(l,o.pivotValues[t+1])),s&&r&&(2===l.memberType||-1===l.level?r.actualText===l.actualText:3===l.memberType&&l.actualText===r.actualText||r.valueSort.levelName===l.valueSort.levelName)){if(2===l.memberType)u&&"sum"!==r.type?l.colSpan=1:l.colSpan=r.colSpan+1>(a>t?i:0)?1:r.colSpan+1;else{var g=o.dataSourceSettings.valueSortSettings.headerDelimiter,m=[l,r].map(function(e){return e.valueSort.levelName.toString().split(g)}),f=m[0],v=m[1];f.slice(0,-1).join(g)===v.slice(0,-1).join(g)?(l.colSpan=r.colSpan+1,l.ordinal=r.ordinal):l.colSpan=1}d=!0}if(2===l.memberType){if(u)c||(l.type="sum"),l.formattedText="Total",l.valueSort[l.valueSort.levelName.toString()]=1;else if(l.type="grand sum",l.formattedText=o.localeObj.getConstant("grandTotal"),t<o.measureIndex){var S="Grand Total";l.valueSort.levelName=S,l.valueSort[S.toString()]=1}l.hasChild=!1}else-1===l.level&&(l.type="sum",l.formattedText="Total",l.hasChild=!1,l.valueSort[l.valueSort.levelName.toString()]=1);s?2===l.memberType&&2===s.memberType||s.actualText===l.actualText?(e[t][n]=e[t+1]?e[t+1][n]+1:1,0===t||1===l.memberType&&l.level>-1&&1===s.memberType&&-1===s.level?(l.rowSpan=!l.isDrilled||o.fieldList[l.hierarchy]&&o.fieldList[l.hierarchy].isHierarchy&&!l.hasChild?e[t+1][n]+1:1,s.rowSpan=!s.isDrilled||o.fieldList[s.hierarchy]&&o.fieldList[s.hierarchy].isHierarchy&&!s.hasChild||-1!==s.level?s.rowSpan:e[t+1][n]):3===l.memberType?l.rowSpan=1:l.rowSpan=-1,p=!0):!l.isDrilled||o.fieldList[l.hierarchy]&&o.fieldList[l.hierarchy].isHierarchy&&!l.hasChild||-1!==l.level||2!==s.memberType?(l.rowSpan=0===t?e[t][n]:-1,s.rowSpan=s.level>-1&&(!s.isDrilled||o.fieldList[s.hierarchy]&&o.fieldList[s.hierarchy].isHierarchy&&!s.hasChild)||2!==l.memberType&&2===s.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=l.level>-1||1===o.rowStartPos?e[t][n]:-1,d||(l.colSpan=1),p||(e[t][n]=1),n--},o=this;n>0;)s();t--}},e.prototype.getOrdinal=function(e,t){for(var i=0,a=e.colIndex;a>0;a--)if(-1===t[a].level){i=t[a].ordinal;break}return i},e.prototype.frameValues=function(e,i){var a=this.pivotValues.length,r=a>0?this.pivotValues.findIndex(function(e){return e&&!(0,t.isNullOrUndefined)(e[0])}):this.colDepth,n=0;if("down"===this.customArgs.action){var s=Object.keys(this.onDemandDrillEngine);r=Number(s[0]),a=Number(s[s.length-1])+1,n=this.onDemandDrillEngine[r][0].ordinal}for(var o=r;o<a;o++)for(var l=this.pivotValues[o],d=l[0].ordinal,p=1;p<this.pivotValues[0].length;p++)if(this.pivotValues[this.colDepth-1][p]){var h=this.pivotValues[this.colDepth-1][p].ordinal,u=this.pivotValues[this.colDepth-1][p],c=3===l[0].memberType?l[0].actualText.toString():this.tupColumnInfo[u.ordinal]&&this.tupColumnInfo[u.ordinal].measure?this.tupColumnInfo[u.ordinal].measure.querySelector("UName").textContent:l[0].actualText;if("header"===l[0].type)l[p]={axis:"value",actualText:this.getUniqueName(c),formattedText:"",value:0,colIndex:p,rowIndex:o};else{var g,m=void 0,f=this.getUniqueName(c),v=!0,S=!this.fieldList[l[0].hierarchy]||!this.fieldList[l[0].hierarchy].isHierarchy||l[0].isDrilled;if(this.tupRowInfo[d])v=this.tupRowInfo[d].showTotals;else{var y=0===this.dataSourceSettings.rows.length||1===this.dataSourceSettings.rows.length&&"[Measures]"===this.dataSourceSettings.rows[0].name;v=this.dataSourceSettings.showGrandTotals&&this.dataSourceSettings.showRowGrandTotals||y}var b=e[(d-n)*i+h];m=this.showSubTotalsAtBottom&&l[0].isDrilled||!v&&S?"":(0,t.isNullOrUndefined)(b)||(0,t.isNullOrUndefined)(b.querySelector("FmtValue"))?this.emptyCellTextContent:b.querySelector("FmtValue").textContent,g=!v&&S?"0":(0,t.isNullOrUndefined)(b)||(0,t.isNullOrUndefined)(b.querySelector("Value"))?null:b.querySelector("Value").textContent,m=this.showSubTotalsAtBottom&&l[0].isDrilled?"":v&&!(0,t.isNullOrUndefined)(g)?this.getFormattedValue(Number(g),f,""!==m?m:g):m;var C=!this.tupColumnInfo[h]||(this.tupColumnInfo[h].allCount>0||this.tupColumnInfo[h].drillStartPos>-1)||!this.tupRowInfo[d]||this.tupRowInfo[d].allCount>0||this.tupRowInfo[d].drillStartPos>-1,x=!!this.tupRowInfo[d]&&(0===this.tupRowInfo[d].measurePosition?1===this.tupRowInfo[d].allStartPos:0===this.tupRowInfo[d].allStartPos)||!!this.tupColumnInfo[h]&&(0===this.tupColumnInfo[h].measurePosition?1===this.tupColumnInfo[h].allStartPos:0===this.tupColumnInfo[h].allStartPos);l[p]={axis:"value",actualText:f,formattedText:m,colOrdinal:h,rowOrdinal:d,columnHeaders:this.tupColumnInfo[h]?this.tupColumnInfo[h].captionCollection:"",rowHeaders:this.tupRowInfo[d]?this.tupRowInfo[d].captionCollection:"",value:(0,t.isNullOrUndefined)(g)?null:Number(g),colIndex:p,rowIndex:o,isSum:C,isGrandSum:x}}this.valueContent[o-this.rowStartPos][p]=l[p]}},e.prototype.getFormattedValue=function(e,i,a){var r=a;if(this.formatFields[i]&&!(0,t.isNullOrUndefined)(e)){var n=this.formatFields[i].properties?this.formatFields[i].properties:this.formatFields[i],s=(0,t.extend)({},n,null,!0);delete s.name,!s.minimumSignificantDigits&&s.minimumSignificantDigits<1&&delete s.minimumSignificantDigits,!s.maximumSignificantDigits&&s.maximumSignificantDigits<1&&delete s.maximumSignificantDigits,s.type?r=this.globalize.formatDate(new Date(e.toString()),s):(delete s.type,r=this.globalize.formatNumber(e,s))}return r},e.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(i.length>0){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:[]}},e.prototype.frameMeasureOrder=function(e,i,a,r,n,s){var o=[],l=[],d=[],p={},h=[],u=e.measureAxis,c=e.measureIndex,g=e.valueInfo;if(u===i&&g.length>0){for(var m={},f=[],v=0,S=a.length;v<S;v++){for(var y=a[v],b=[].slice.call(y.querySelectorAll("Member")),C="",x="",w=0;w<b.length;)C=C+(""!==C?"~~":"")+b[w].querySelector("UName").textContent,(w===c&&0===c||w===c-1)&&(x=C),w++;m[x]?m[x][m[x].length]=C:(m[x]=[C],f[f.length]=x),p[C]={index:v,node:y},h[h.length]=C}if(h.length>0&&f.length>0)if(0===c)for(var T=0,M=g;T<M.length;T++)for(var D=M[T],O=0,N=f;O<N.length;O++){if((L=N[O])===D)for(var P=0,E=m[L];P<E.length;P++){C=E[P];d[d.length]=p[C].index,o[o.length]=p[C].node}}else for(var I=0,F=f;I<F.length;I++)for(var L=F[I],A=0,R=g;A<R.length;A++)for(var k=R[A],j=0,q=m[L];j<q.length;j++){(C=q[j]).split("~~")[c]===k&&(d[d.length]=p[C].index,o[o.length]=p[C].node)}var H=[];if(r.length>0){for(var V=[],U=[],B=0,_=0,G=0,z=(v=0,s);v<z;v++){_>n-1?(_=0,V[++G]||(V[G]=[]),V[G][_]=v,_++):(V[G]||(V[G]=[]),V[G][_]=v,_++);var W=void 0;r[B]?W=this.olapVirtualization?v:Number(r[B].getAttribute("CellOrdinal")):B++,W===v&&(U[v]=W,H[W]=r[B],B++)}if(r=H,"column"===u){if(V.length>0&&V[0].length===d.length)for(w=0,z=d.length;w<z;w++)for(v=0;v<V.length;){var Q=v*n+w;if(!(0,t.isNullOrUndefined)(V[v])&&!(0,t.isNullOrUndefined)(d[w])){var Y=U[Q]?U[Q].toString():Q.toString();(K=r[Number(V[v][d[w]])])&&(K.setAttribute("CellOrdinal",Y.toString()),l[Q]=K)}v++}}else if(V.length===d.length)for(w=0,z=d.length;w<z;w++)for(v=0;v<V[d[w]].length;){var K;Y=U[Q=w*n+v]?U[Q].toString():Q.toString();(K=r[Number(V[d[w]][v])])&&(K.setAttribute("CellOrdinal",Y.toString()),l[l.length]=K),v++}}return{orderedHeaderTuples:o,orderedValueTuples:l}}return{orderedHeaderTuples:a,orderedValueTuples:r}},e.prototype.getDrilledSets=function(e,i,a,r){for(var n=[],s=i.actualText.toString(),o="row"===r?this.tupRowInfo:this.tupColumnInfo,l=o[i.ordinal],d=0===o[0].typeCollection.indexOf("3")?1:0,p=0,h="1"===o[0].typeCollection[a];p<o.length;)((0,t.isNullOrUndefined)(o[p].allStartPos)||o[p].allStartPos>d)&&(n[n.length]=o[p].uNameCollection),p++;for(var u=e.split("::[").map(function(e){return"["===e[0]?e:"["+e}),c=[],g=0;g<=a;g++)if(u[g])if((h||this.isPaging)&&g===a){for(var m=u[g].split("~~"),f=m.indexOf(s),v=[],S=0;S<=f;S++)v.push(m[S]);c[c.length]=v.length>0?v.join("~~"):u[g]}else c[c.length]=u[g];e=c.join("::");for(var y=[],b={},C=0,x=n;C<x.length;C++){var w=x[C];if(0===w.indexOf(e)&&(y.push(w),this.isPaging))for(var T=w.split("::[")[a],M=(N=(T="["===T[0]?T:"["+T).split("~~")).indexOf(s);M<N.length;M++)b[N[M]]=N[M]}if(this.isPaging){var D=l.uNameCollection.split("::[").map(function(e){return"["===e[0]?e:"["+e}),O=[];for(M=0;M<D.length;M++)M!==a&&(O[M]=D[M]);var N=Object.keys(b);for(M=0;M<N.length;M++)O[a]=N[M],y.push(O.join("::"))}for(var P={},E=0,I=y;E<I.length;E++){for(var F=I[E].split("::[").map(function(e){return"["===e[0]?e:"["+e}),L="",A=0;A<=a;A++){var R=F[A];if(R){var k=R.split("~~");L=L+(""!==L?"~~":"")+k[k.length-1]}}P[L]=L}return P},e.prototype.updateDrilledInfo=function(e){this.dataSourceSettings=e,this.drilledMembers=e.drilledMembers?this.updateDrilledItems(e.drilledMembers):[],this.generateGridData(e)},e.prototype.updateCalcFields=function(e,t){this.dataSourceSettings=e,this.calculatedFieldSettings=e.calculatedFieldSettings?e.calculatedFieldSettings:[],this.getAxisFields(),this.updateFieldlist(),this.loadCalculatedMemberElements(this.calculatedFieldSettings),this.dataFields[t.name]?this.generateGridData(e):Tl.getCellSets(e,this,!0,void 0,!0)},e.prototype.onSort=function(e,t){this.dataSourceSettings=e,t||(this.sortSettings=e.sortSettings?e.sortSettings:[],this.getAxisFields(),this.frameSortObject(),this.updateFieldlist()),this.xmlaCellSet.length>0&&this.xmlDoc?this.generateEngine(this.xmlDoc,this.request,this.customArgs):this.generateGridData(e)},e.prototype.updateFieldlist=function(e){for(var t=0;t<this.savedFieldListData.length;){var i=this.savedFieldListData[t].id,a=this.savedFieldListData[t].pid;if(this.savedFieldList[i]){var r=this.enableSort?this.sortObject[i]?this.sortObject[i]:"Ascending":"None";this.savedFieldList[i].isSelected=!1,this.savedFieldList[i].isExcelFilter=!1,this.savedFieldList[i].sort=r,this.savedFieldList[i].allowDragAndDrop=!0,this.savedFieldList[i].showFilterIcon=!0,this.savedFieldList[i].showSortIcon=!0,this.savedFieldList[i].showEditIcon=!0,this.savedFieldList[i].showRemoveIcon=!0,this.savedFieldList[i].showValueTypeIcon=!0,this.savedFieldList[i].showSubTotals=!0,this.savedFieldListData[t].sort=r,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[i].filter=[],this.savedFieldList[i].actualFilter=[])}if(this.dataFields[i]&&this.savedFieldList[i]&&this.selectedItems.indexOf(i)>-1?(this.savedFieldList[i].isSelected=!0,this.savedFieldList[i].allowDragAndDrop=!this.dataFields[i]||this.dataFields[i].allowDragAndDrop,this.savedFieldList[i].showFilterIcon=!this.dataFields[i]||this.dataFields[i].showFilterIcon,this.savedFieldList[i].showSortIcon=!this.dataFields[i]||this.dataFields[i].showSortIcon,this.savedFieldList[i].showEditIcon=!this.dataFields[i]||this.dataFields[i].showEditIcon,this.savedFieldList[i].showRemoveIcon=!this.dataFields[i]||this.dataFields[i].showRemoveIcon,this.savedFieldList[i].showValueTypeIcon=!this.dataFields[i]||this.dataFields[i].showValueTypeIcon,this.savedFieldList[i].showSubTotals=!this.dataFields[i]||this.dataFields[i].showSubTotals,this.savedFieldListData[t].isSelected=!0,this.savedFieldListData[t].allowDragAndDrop=!this.dataFields[i]||this.dataFields[i].allowDragAndDrop,this.savedFieldListData[t].showFilterIcon=!this.dataFields[i]||this.dataFields[i].showFilterIcon,this.savedFieldListData[t].showSortIcon=!this.dataFields[i]||this.dataFields[i].showSortIcon,this.savedFieldListData[t].showEditIcon=!this.dataFields[i]||this.dataFields[i].showEditIcon,this.savedFieldListData[t].showRemoveIcon=!this.dataFields[i]||this.dataFields[i].showRemoveIcon,this.savedFieldListData[t].showValueTypeIcon=!this.dataFields[i]||this.dataFields[i].showValueTypeIcon,this.savedFieldListData[t].showSubTotals=!this.dataFields[i]||this.dataFields[i].showSubTotals):this.dataFields[a]&&this.savedFieldList[a]&&this.selectedItems.indexOf(a)>-1?this.savedFieldListData[t].isSelected=!0:this.savedFieldListData[t].isSelected=!1,this.savedFieldList[i]&&this.savedFieldList[i].isCalculatedField||"[calculated members].[_0]"===i.toLowerCase()){for(var n=!1,s=0,o=this.calculatedFieldSettings;s<o.length;s++){var l=o[s];if(i===l.name){var d=l.formula,p=l.formatString;this.savedFieldListData[t].formula=d,this.savedFieldListData[t].formatString=p,this.savedFieldListData[t].parentHierarchy=d.toLowerCase().indexOf("measure")>-1?void 0:l.hierarchyUniqueName,this.savedFieldList[i].formula=d,this.savedFieldList[i].formatString=p,this.savedFieldList[i].parentHierarchy=this.savedFieldListData[t].parentHierarchy,n=!0}}(!n&&"[calculated members].[_0]"!==i.toLowerCase()||"[calculated members].[_0]"===i.toLowerCase()&&0===this.calculatedFieldSettings.length)&&(this.savedFieldListData.splice(t,1),t--,this.savedFieldList[i]&&delete this.savedFieldList[i])}t++}this.fieldList=this.savedFieldList,this.fieldListData=this.savedFieldListData},e.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}}},e.prototype.getFormattedFields=function(e){this.formatFields={};for(var t=e.length;t--;)this.formatFields[e[t].name]=e[t]},e.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},e.prototype.validateCube=function(e,t,i){for(var a=[].slice.call(e.querySelectorAll("row")),r=!1,n=0,s=a;n<s.length;n++){if(s[n].querySelector("CUBE_NAME").textContent===i.dataSourceSettings.cube){r=!0;break}}!r&&a.length>0&&(this.errorInfo="Invalid cube name "+this.dataSourceSettings.cube)},e.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"})},e.prototype.getTreeData=function(e,t,i){var a=this.getConnectionInfo(e.url,e.LCID),r='<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,r,t,i),this.errorInfo)throw this.errorInfo},e.prototype.getAxisFields=function(){this.rows=this.dataSourceSettings.rows?this.dataSourceSettings.rows:[],this.columns=this.dataSourceSettings.columns?this.dataSourceSettings.columns:[],this.filters=this.dataSourceSettings.filters?this.dataSourceSettings.filters:[],this.values=this.dataSourceSettings.values?this.dataSourceSettings.values:[];for(var e=(0,t.extend)([],this.rows,null,!0),i=(e=e.concat(this.columns,this.values,this.filters)).length;i--;)this.dataFields[e[i].name]=e[i],"[measures]"===e[i].name.toLowerCase()?this.isMeasureAvail=!0:this.selectedItems.push(e[i].name);if(this.mappingFields={},this.dataSourceSettings.fieldMapping)for(var a=0,r=this.dataSourceSettings.fieldMapping;a<r.length;a++){var n=r[a];this.mappingFields[n.name]=n}if(!this.isMeasureAvail&&this.values.length>0){var s={name:"[Measures]",caption:"Measures",showRemoveIcon:!0,allowDragAndDrop:!0};"row"===this.valueAxis?this.rows.push(s):this.columns.push(s),this.isMeasureAvail=!0}},e.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}return i||void 0},e.prototype.getUniqueName=function(e){for(var t=e,i=0,a=this.calculatedFieldSettings;i<a.length;i++){var r=a[i];if(e===(r.formula.toLowerCase().indexOf("measure")>-1?"[Measures].":r.hierarchyUniqueName+".")+"["+r.name+"]"){t=r.name;break}}return t},e.prototype.updateFilterItems=function(e){var i=(0,t.extend)([],this.rows,null,!0);i=i.concat(this.columns);for(var a=0,r=e;a<r.length;a++){var n=r[a];if("Include"===n.type&&this.allowMemberFilter&&this.fieldList[n.name]){var s=this.fieldList[n.name].members,o=s&&Object.keys(s).length>0;this.fieldList[n.name].actualFilter=n.items.slice();var l=(0,t.extend)([],n.items,null,!0);if(o)for(var d=0;d<l.length;){for(var p=[],h=0,u=p=this.getParentNode(l[d],s,p);h<u.length;h++){var c=u[h],g=Hs.inArray(c,n.items);-1!==g&&n.items.splice(g,1)}d++}for(var m=[],f=0,v=n.items;f<v.length;f++){var S=v[f],y=void 0;o||1!==n.items.length||(this.getMembers(this.dataSourceSettings,n.name,void 0,void 0,void 0,n.items[0]),y=this.fieldList[n.name].actualFilter[0]),m.push(S),o?this.fieldList[n.name].filter.push(s[S].caption):this.fieldList[n.name].filter.push(y||S)}this.filterMembers[n.name]=m,this.fieldList[n.name].isExcelFilter=!1}else if((this.allowValueFilter||this.allowLabelFilter)&&-1!==["Date","Label","Number","Value"].indexOf(n.type))for(var b=0,C=i;b<C.length;b++){if(C[b].name===n.name){var x=this.filterMembers[n.name];x&&"object"==typeof x[0]&&x[0].type===n.type?x[x.length]=n:this.filterMembers[n.name]=[n],this.fieldList[n.name].isExcelFilter=!0;break}}}},e.prototype.getParentNode=function(e,t,i){if(t[e].parent&&e!==t[e].parent){var a=t[e].parent;i.push(a),this.getParentNode(a,t,i)}return i},e.prototype.updateDrilledItems=function(e){var i=[],a=(0,t.extend)([],this.rows,null,!0);a=a.concat(this.columns);for(var r=0,n=e;r<n.length;r++)for(var s=n[r],o=0,l=a;o<l.length;o++){var d=l[o];if(s.name===d.name){i.push(s);break}}return i},e.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]+"}";var d="",p="";for(o=0;o<a.length;o++)d=(d.length>0?d+",":"")+(a[o].split("~~").length>1?a[o].split("~~")[a[o].split("~~").length-1]:a[o]);for(o=0;o<r.length;o++)p=(p.length>0?p+",":"")+(r[o].split("~~").length>1?r[o].split("~~")[r[o].split("~~").length-1]:r[o]);var h="DRILLTHROUGH MAXROWS "+t+" Select("+(d.length>0?d:"")+(d.length>0&&p.length>0?",":"")+(p.length>0?p:"")+") on 0 from "+(""===s?"["+this.dataSourceSettings.cube+"]":"(SELECT ("+s+") ON COLUMNS FROM ["+this.dataSourceSettings.cube+"])");h=h.replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,""");var u=this.getSoapMsg(this.dataSourceSettings,h),c=this.getConnectionInfo(this.dataSourceSettings.url,this.dataSourceSettings.localeIdentifier);if(this.doAjaxPost("POST",c.url,u,this.drillThroughSuccess.bind(this),{dataSourceSettings:this.dataSourceSettings,action:"drillThrough"}),this.errorInfo)throw this.errorInfo},e.prototype.drillThroughSuccess=function(e){var t=[].slice.call(e.querySelectorAll("row")),i="";if(t.length>0){for(var a=[],r=0;r<t.length;){for(var n=[].slice.call(t[r].children),s=0;s<n.length;){var o=n[s],l=o.tagName,d=o.textContent,p=o.getAttribute("xsi:type");a.push('"'+l+'":'+("xsd:double"===p?parseFloat(d||"0"):'"'+d+'"')),s++}r++}for(var h=a[0],u=0;u<a.length;)Object.keys(JSON.parse("[{"+a[u]+"}]")[0])[0]!==Object.keys(JSON.parse("[{"+h+"}]")[0])[0]?(i+=","+a[u],u++):(i+=""===i?"[{"+a[u]:"}, {"+a[u],u++);i+="}]"}else{var c=[].slice.call(e.querySelectorAll("faultstring"));for(r=0;r<c.length;)i+=c[r].textContent,r++}this.gridJSON=i},e.prototype.getFilterMembers=function(e,t,i,a,r){var n,s=this.fieldList[t].levels,o=this.fieldList[t].levelCount;return n=r?"Descendants({"+s[o].id+"}, "+s[i-1].id+", "+(i-o===1?"SELF)":"SELF_AND_BEFORE)"):t+", Descendants({"+s[0].id+"}, "+s[i-1].id+", SELF_AND_BEFORE)",this.fieldList[t].levelCount=i,a||this.getMembers(e,t,!1,n,r),n},e.prototype.getMembers=function(e,t,i,a,r,n){var s,o="DIMENSION PROPERTIES PARENT_UNIQUE_NAME, HIERARCHY_UNIQUE_NAME, CHILDREN_CARDINALITY, MEMBER_TYPE, MEMBER_VALUE",l=this.fieldList[t].hasAllMember,d=(l?t:t+".LEVELS(0)").replace(/&/g,"&").replace(/>/g,">").replace(/</g,"<").replace(/'/g,"'").replace(/"/g,""");s=i||n?n?"SELECT {"+(n=n.replace(/&/g,"&"))+"} ON 0 FROM ["+e.cube+"] WHERE {}":"SELECT ({"+d+".ALLMEMBERS})"+o+" ON 0 FROM ["+e.cube+"]":"SELECT ({"+(a||(l?d+", "+d+".CHILDREN":d+".ALLMEMBERS"))+"})"+o+" ON 0 FROM ["+e.cube+"]";var p=this.getSoapMsg(e,s),h=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",h.url,p,n?this.getOlapFilterText.bind(this):this.generateMembers.bind(this),{dataSourceSettings:e,fieldName:t,loadLevelMembers:r,action:"fetchMembers"}),this.errorInfo)throw this.errorInfo},e.prototype.getOlapFilterText=function(e,t,i){var a=[].slice.call(e.querySelectorAll('Axis[name="Axis0"] Tuple'));a.length>0&&this.fieldList[i.fieldName]&&a[a.length-1].getElementsByTagName("Caption")&&a[a.length-1].getElementsByTagName("Caption")[0]&&(this.fieldList[i.fieldName].actualFilter[0]=a[a.length-1].getElementsByTagName("Caption")[0].textContent)},e.prototype.getChildMembers=function(e,t,i){var a="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+"]",r=this.getSoapMsg(e,a),n=this.getConnectionInfo(e.url,e.localeIdentifier);if(this.doAjaxPost("POST",n.url,r,this.generateMembers.bind(this),{dataSourceSettings:e,fieldName:i,action:"fetchChildMembers"}),this.errorInfo)throw this.errorInfo},e.prototype.getCalcChildMembers=function(e,t){this.calcChildMembers=[];var i="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+"]",a=this.getConnectionInfo(e.url,e.localeIdentifier),r=this.getSoapMsg(e,i);if(this.doAjaxPost("POST",a.url,r,this.generateMembers.bind(this),{dataSourceSettings:e,action:"fetchCalcChildMembers"}),this.errorInfo)throw this.errorInfo},e.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,"""),o="WITH SET [SearchMembersSet] AS 'FILTER("+(r?s+".ALLMEMBERS, ":"{"+(n>1?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+"]",l=this.getSoapMsg(e,o),d=this.getConnectionInfo(e.url,e.localeIdentifier);if(this.doAjaxPost("POST",d.url,l,this.generateMembers.bind(this),{dataSourceSettings:e,fieldName:t,action:"fetchSearchMembers"}),this.errorInfo)throw this.errorInfo}},e.prototype.generateMembers=function(e,t,i){for(var a,r=[].slice.call(e.querySelectorAll('Axis[name="Axis0"] Tuple')),n=i.fieldName,s={},o=0,l=r;o<l.length;o++){var d=l[o],p=d.querySelector("Member"),h=p.querySelector("MEMBER_TYPE").textContent,u=p.querySelector("UName").textContent,c=p.querySelector("Caption").textContent,g=p.querySelector("PARENT_UNIQUE_NAME")?p.querySelector("PARENT_UNIQUE_NAME").textContent:"",m={"data-fieldName":n,"data-memberId":u};if(""===g&&"1"===h)s={hasChildren:!!d.querySelector("CHILDREN_CARDINALITY")&&"0"!==d.querySelector("CHILDREN_CARDINALITY").textContent,isSelected:!1,id:u,tag:u,name:c,caption:c,htmlAttributes:m},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[n].members[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1},this.fieldList[n].filterMembers.push(s),this.fieldList[n].childMembers.push(s)):"fetchSearchMembers"===i.action?(this.fieldList[n].currrentMembers[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1},this.fieldList[n].searchMembers.push(s),s.expanded=!0):this.calcChildMembers.push(s);else if(""!==g&&"1"===h)if(g===a&&"1"===h)s={hasChildren:!!d.querySelector("CHILDREN_CARDINALITY")&&"0"!==d.querySelector("CHILDREN_CARDINALITY").textContent,id:u,name:c,isSelected:!1,caption:c,htmlAttributes:m,tag:u},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[n].filterMembers.push(s),this.fieldList[n].childMembers.push(s),this.fieldList[n].members[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1}):"fetchSearchMembers"===i.action?(s.expanded=!0,this.fieldList[n].searchMembers.push(s),this.fieldList[n].currrentMembers[u]={name:u,caption:c,parent:void 0,isNodeExpand:!1,isSelected:!1}):this.calcChildMembers.push(s);else{if("fetchMembers"===i.action&&this.fieldList[n].members[u])continue;var f=!!i.loadLevelMembers&&this.fieldList[n].members[g].isSelected;s={hasChildren:!!d.querySelector("CHILDREN_CARDINALITY")&&"0"!==d.querySelector("CHILDREN_CARDINALITY").textContent,htmlAttributes:m,isSelected:!1,id:u,pid:g,name:c,caption:c,tag:u},"fetchMembers"===i.action||"fetchChildMembers"===i.action?(this.fieldList[n].isHierarchy=!1,this.fieldList[n].filterMembers.push(s),this.fieldList[n].childMembers.push(s),this.fieldList[n].members[u]={name:u,caption:c,parent:g,isNodeExpand:!1,isSelected:f}):"fetchSearchMembers"===i.action?(this.fieldList[n].searchMembers.push(s),s.expanded=!0,this.fieldList[n].currrentMembers[u]={name:u,caption:c,parent:g,isNodeExpand:!1,isSelected:!1}):this.calcChildMembers.push(s)}else"2"===h&&(a=u)}},e.prototype.getFieldListItems=function(e,t,i){for(var a,r=[],n=0,s=[].slice.call(e.querySelectorAll("row"));n<s.length;n++){var o=s[n],l=[].slice.call(o.querySelectorAll("ALL_MEMBER")).length>0,d=o.querySelector("DIMENSION_UNIQUE_NAME").textContent,p=o.querySelector("HIERARCHY_UNIQUE_NAME").textContent,h=d===p&&"[measures]"!==d.toLowerCase()&&"[measures]"!==p.toLowerCase();r.push({pid:this.isMondrian||h?d+"~#^Dim":d,id:p,name:o.querySelector("HIERARCHY_CAPTION").textContent,caption:o.querySelector("HIERARCHY_CAPTION").textContent,tag:p,hasAllMember:l,allMember:l?o.querySelectorAll("ALL_MEMBER")[0].textContent:void 0,type:"string"})}a={hierarchy:r,hierarchySuccess:e,measures:[]},this.fieldListObj=a;var u={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(u,this.loadDimensionElements.bind(this),i)},e.prototype.loadCalculatedMemberElements=function(e){if(e.length>0){var t=this.fieldListData,i={hasChildren:!0,isSelected:!1,id:"[Calculated Members].[_0]",name:"[Calculated Members].[_0]",caption:"Calculated Members",spriteCssClass:"e-calcMemberGroupCDB "+o,tag:"[Calculated Members].[_0]",type:"string"};t.length>0&&"[measures]"===t[0].id.toLowerCase()&&t.splice(0,0,i);for(var a=function(e){if(!r.fieldList[e.name]){var i=e.formula,a=r.currentCalcFieldInfo&&r.currentCalcFieldInfo.fieldName===e.name&&r.currentCalcFieldInfo.fieldType?"Measure"===r.currentCalcFieldInfo.fieldType:i.toLowerCase().indexOf("measure")>-1,n=(a?"[Measures].":e.hierarchyUniqueName+".")+"["+e.name+"]",s=r.dataFields[e.name]&&r.dataFields[e.name].caption?r.dataFields[e.name].caption:r.mappingFields[e.name]&&r.mappingFields[e.name].caption?r.mappingFields[e.name].caption:e.name,l=e.formatString,d={hasChildren:!1,isSelected:!!(r.dataSourceSettings&&r.dataSourceSettings.values&&r.dataSourceSettings.values.length>0)&&r.dataSourceSettings.values.some(function(t){return t.name===e.name}),id:e.name,pid:"[Calculated Members].[_0]",name:e.name,caption:s,spriteCssClass:"e-calc-member "+(a?"e-calc-measure-icon":"e-calc-dimension-icon")+" "+o,tag:n,formula:i,formatString:l,aggregateType:void 0,type:"CalculatedField",filter:[],dateMember:[],sort:"Ascending",actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},isHierarchy:!0,isExcelFilter:!1,isCalculatedField:!0,allowDragAndDrop:r.dataFields[e.name]?r.dataFields[e.name].allowDragAndDrop:!r.mappingFields[e.name]||r.mappingFields[e.name].allowDragAndDrop,showFilterIcon:r.dataFields[e.name]?r.dataFields[e.name].showFilterIcon:!r.mappingFields[e.name]||r.mappingFields[e.name].showFilterIcon,showSortIcon:r.dataFields[e.name]?r.dataFields[e.name].showSortIcon:!r.mappingFields[e.name]||r.mappingFields[e.name].showSortIcon,showEditIcon:r.dataFields[e.name]?r.dataFields[e.name].showEditIcon:!r.mappingFields[e.name]||r.mappingFields[e.name].showEditIcon,showRemoveIcon:r.dataFields[e.name]?r.dataFields[e.name].showRemoveIcon:!r.mappingFields[e.name]||r.mappingFields[e.name].showRemoveIcon,showValueTypeIcon:r.dataFields[e.name]?r.dataFields[e.name].showValueTypeIcon:!r.mappingFields[e.name]||r.mappingFields[e.name].showValueTypeIcon,showSubTotals:r.dataFields[e.name]?r.dataFields[e.name].showSubTotals:!r.mappingFields[e.name]||r.mappingFields[e.name].showSubTotals,fieldType:a?"Measure":"Dimension",parentHierarchy:a?void 0:e.hierarchyUniqueName};t.push(d),r.fieldList[d.id]=d,r.updateMembersOrder(e.name)}},r=this,n=0,s=e;n<s.length;n++){a(s[n])}}},e.prototype.loadDimensionElements=function(e,i,a){for(var r=[],n=[].slice.call(e.querySelectorAll("row")),s={},l=0,d=n;l<d.length;l++){var p=d[l],h=p.querySelector("DIMENSION_UNIQUE_NAME").textContent,u=p.querySelector("DEFAULT_HIERARCHY").textContent,c=p.querySelector("DIMENSION_CAPTION").textContent,g=h===u;h.toLowerCase().indexOf("[measure")>=0?s={hasChildren:!0,isSelected:!1,id:h,name:h,caption:c,spriteCssClass:"[measures]"===h.toLowerCase()?"e-measureGroupCDB-icon "+o:"e-dimensionCDB-icon "+o,tag:h,type:"string"}:(0,t.isNullOrUndefined)(n[0].querySelector("HIERARCHY_CAPTION"))&&r.push({hasChildren:!0,isSelected:!1,id:this.isMondrian||g?h+"~#^Dim":h,name:h,caption:c,spriteCssClass:"e-dimensionCDB-icon "+o,tag:h,defaultHierarchy:p.querySelector("DEFAULT_HIERARCHY").textContent,type:"string"})}r.splice(0,0,s),this.fieldListData=r;var m={catalog:a.dataSourceSettings.catalog,cube:a.dataSourceSettings.cube,url:a.dataSourceSettings.url,LCID:a.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_SETS",roles:a.dataSourceSettings.roles};this.getTreeData(m,this.loadNamedSetElements.bind(this),a)},e.prototype.loadNamedSetElements=function(e,i,a){var r=(0,t.extend)([],this.rows,null,!0);r=r.concat(this.columns,this.filters);for(var n=this.fieldListData,s=[],l=0,d=r;l<d.length;l++){var p=d[l];s.push(p.name)}for(var h=[],u=0,c=[].slice.call(e.querySelectorAll("row"));u<c.length;u++){p=c[u];h.indexOf(p.querySelector("DIMENSIONS").textContent.split(".")[0])>=0||(n.push({hasChildren:!0,isSelected:!1,pid:p.querySelector("DIMENSIONS").textContent.split(".")[0],id:p.querySelector("SET_DISPLAY_FOLDER").textContent+"_"+p.querySelector("DIMENSIONS").textContent.split(".")[0],name:p.querySelector("SET_DISPLAY_FOLDER").textContent,spriteCssClass:"e-folderCDB-icon "+o+" namedSets",caption:p.querySelector("SET_DISPLAY_FOLDER").textContent,type:"string"}),h.push(p.querySelector("DIMENSIONS").textContent.split(".")[0]));var g="["+p.querySelector("SET_NAME").textContent.trim()+"]",m={hasChildren:!0,isNamedSets:!0,isSelected:s.indexOf("["+p.querySelector("SET_NAME").textContent+"]")>=0,pid:p.querySelector("SET_DISPLAY_FOLDER").textContent+"_"+p.querySelector("DIMENSIONS").textContent.split(".")[0],id:g,name:p.querySelector("SET_CAPTION").textContent,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("SET_CAPTION").textContent,spriteCssClass:"e-namedSetCDB-icon "+o,tag:p.querySelector("EXPRESSION").textContent,type:"string",filter:[],dateMember:[],actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},isHierarchy:!0,isExcelFilter:!1,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(m),this.fieldList[g]=m,this.updateMembersOrder(g)}a.hierarchy=this.fieldListData,a.hierarchySuccess=this.fieldListObj.hierarchySuccess,this.loadHierarchyElements(a)},e.prototype.loadHierarchyElements=function(e){for(var i=e.hierarchySuccess,a=e.hierarchy,r=(0,t.extend)([],this.rows,null,!0),n=[],s=0,l=r=r.concat(this.columns,this.filters);s<l.length;s++){var d=l[s];n.push(d.name)}for(var p=0,h=[].slice.call(i.querySelectorAll("row"));p<h.length;p++){var u=(d=h[p]).querySelector("DIMENSION_UNIQUE_NAME").textContent,c=d.querySelector("HIERARCHY_UNIQUE_NAME").textContent,g=[].slice.call(d.querySelectorAll("ALL_MEMBER")).length>0,m=void 0;if(g){var f=d.querySelectorAll("ALL_MEMBER")[0].textContent.replace(/[&[\]']+/g,"").split(".");m=f[f.length-1].trim()}else m=void 0;for(var v=d.querySelector("HIERARCHY_DISPLAY_FOLDER")?d.querySelector("HIERARCHY_DISPLAY_FOLDER").textContent:"",S=[],y=0,b=a;y<b.length;y++){(O=b[y]).tag===u&&S.push(O)}if(S.length>0){var C=u===c&&"[measures]"!==u.toLowerCase()&&"[measures]"!==c.toLowerCase();if("[measures]"!==u.toLowerCase()&&"[measures]"!==c.toLowerCase()){var x=u+(this.isMondrian||C?"~#^Dim":"");if(""!==v){for(var w=u+(this.isMondrian||C?"~#^Dim":"")+"_"+v,T=[],M=0,D=a;M<D.length;M++){var O;(O=D[M]).tag===w&&O.pid===x&&T.push(O)}if(0===T.length){var N={hasChildren:!0,isSelected:!1,pid:u+(this.isMondrian||C?"~#^Dim":""),id:w,name:v,spriteCssClass:"e-folderCDB-icon "+o,tag:w,caption:v,type:"string"};a.push(N)}x=w}var P={hasChildren:!d.querySelector("HIERARCHY_ORIGIN")||"2"!==d.querySelector("HIERARCHY_ORIGIN").textContent&&"6"!==d.querySelector("HIERARCHY_ORIGIN").textContent,isSelected:n.indexOf(c)>=0,pid:x,id:c,name:d.querySelector("HIERARCHY_CAPTION").textContent,spriteCssClass:(d.querySelector("HIERARCHY_ORIGIN")?"2"!==d.querySelector("HIERARCHY_ORIGIN").textContent&&"6"!==d.querySelector("HIERARCHY_ORIGIN").textContent?"e-hierarchyCDB-icon":"e-attributeCDB-icon":"e-hierarchyCDB-icon")+" "+o,hasAllMember:g,allMember:m,tag:c,caption:this.dataFields[c]&&this.dataFields[c].caption?this.dataFields[c].caption:this.mappingFields[c]&&this.mappingFields[c].caption?this.mappingFields[c].caption:d.querySelector("HIERARCHY_CAPTION").textContent,type:"string",filter:[],dateMember:[],sort:this.enableSort?this.sortObject[c]?this.sortObject[c]:"Ascending":"None",actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},levels:[],levelCount:1,isHierarchy:!!d.querySelector("HIERARCHY_ORIGIN")&&("2"===d.querySelector("HIERARCHY_ORIGIN").textContent||"6"===d.querySelector("HIERARCHY_ORIGIN").textContent),isExcelFilter:!1,allowDragAndDrop:this.dataFields[c]?this.dataFields[c].allowDragAndDrop:!this.mappingFields[c]||this.mappingFields[c].allowDragAndDrop,showFilterIcon:this.dataFields[c]?this.dataFields[c].showFilterIcon:!this.mappingFields[c]||this.mappingFields[c].showFilterIcon,showSortIcon:this.dataFields[c]?this.dataFields[c].showSortIcon:!this.mappingFields[c]||this.mappingFields[c].showSortIcon,showEditIcon:this.dataFields[c]?this.dataFields[c].showEditIcon:!this.mappingFields[c]||this.mappingFields[c].showEditIcon,showRemoveIcon:this.dataFields[c]?this.dataFields[c].showRemoveIcon:!this.mappingFields[c]||this.mappingFields[c].showRemoveIcon,showValueTypeIcon:this.dataFields[c]?this.dataFields[c].showValueTypeIcon:!this.mappingFields[c]||this.mappingFields[c].showValueTypeIcon,showSubTotals:this.dataFields[c]?this.dataFields[c].showSubTotals:!this.mappingFields[c]||this.mappingFields[c].showSubTotals};a.push(P),this.fieldList[c]=P,this.updateMembersOrder(c)}}}var E={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(E,this.loadLevelElements.bind(this),e)},e.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}}},e.prototype.loadLevelElements=function(e,t,i){var a=[],r=this.fieldListData;a=[];for(var n=0,s=[].slice.call(e.querySelectorAll("row"));n<s.length;n++){var l=s[n];if(1!==parseInt(l.querySelector("LEVEL_TYPE").textContent,10)&&"[measures]"!==l.querySelector("HIERARCHY_UNIQUE_NAME").textContent.toLowerCase()){var d=l.querySelector("HIERARCHY_UNIQUE_NAME").textContent,p=l.querySelector("LEVEL_UNIQUE_NAME").textContent,h=l.querySelector("LEVEL_CAPTION").textContent,u={hasChildren:!1,isChecked:!1,isSelected:this.fieldList[d].isSelected,pid:d,id:p,name:h,tag:p,spriteCssClass:"e-level-members e-hierarchy-level-"+parseInt(l.querySelector("LEVEL_NUMBER").textContent,10)+"-icon "+o,caption:h,type:"string"};a.push(u),this.fieldList[d]&&this.fieldList[d].spriteCssClass&&-1===this.fieldList[d].spriteCssClass.indexOf("e-attributeCDB-icon")?(this.fieldList[d].levels.push(u),this.fieldList[d].isHierarchy=!1):this.fieldList[d].isHierarchy=!0}}this.fieldListData=r=r.concat(a);var c={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(c,this.loadMeasureElements.bind(this),i)},e.prototype.loadMeasureElements=function(e,i,a){for(var r,n=this.fieldListData,s=[],l=[],d=0,p=(0,t.extend)([],this.values,null,!0);d<p.length;d++){var h=p[d];l.push(h.name)}if("en-US"!==this.locale){var u={catalog:a.dataSourceSettings.catalog,cube:a.dataSourceSettings.cube,url:a.dataSourceSettings.url,LCID:a.dataSourceSettings.localeIdentifier.toString(),request:"MDSCHEMA_MEASUREGROUPS",roles:a.dataSourceSettings.roles};this.getTreeData(u,this.loadMeasureGroups.bind(this),a)}for(var c=0,g=[].slice.call(e.querySelectorAll("row"));c<g.length;c++){h=g[c];var m=(0,t.isNullOrUndefined)(h.querySelector("MEASUREGROUP_NAME"))?"":h.querySelector("MEASUREGROUP_NAME").textContent,f=h.querySelector("MEASURE_UNIQUE_NAME").textContent,v=h.querySelector("DEFAULT_FORMAT_STRING")?h.querySelector("DEFAULT_FORMAT_STRING").textContent:"#,#",S=h.querySelector("MEASURE_AGGREGATOR")?h.querySelector("MEASURE_AGGREGATOR").textContent:"1";if(!(s.indexOf(m)>=0)){if("en-US"!==this.locale){for(var y=[],b=0,C=this.fieldListObj.measuresGroups;b<C.length;b++){var x=C[b];x.querySelector("MEASUREGROUP_NAME").textContent===m&&y.push(x)}r=y.length>0?y[0].querySelector("MEASUREGROUP_CAPTION").textContent:m}else r=m;""!==m&&(n.push({hasChildren:!0,isChecked:!1,isSelected:!1,pid:"[Measures]",id:m,name:r,spriteCssClass:"e-measureCDB e-folderCDB-icon "+o,tag:m,caption:r,aggregateType:this.getAggregateType(m,S),type:"string"}),s.push(m))}var w={hasChildren:!1,isSelected:l.indexOf(f)>=0,pid:""===m?"[Measures]":m,id:f,name:h.querySelector("MEASURE_CAPTION").textContent,spriteCssClass:"e-measure-icon "+o,tag:f,caption:this.dataFields[f]&&this.dataFields[f].caption?this.dataFields[f].caption:this.mappingFields[f]&&this.mappingFields[f].caption?this.mappingFields[f].caption:h.querySelector("MEASURE_CAPTION").textContent,aggregateType:this.getAggregateType(f,S),type:"number",filter:[],actualFilter:[],filterMembers:[],childMembers:[],searchMembers:[],members:{},currrentMembers:{},formatString:v,allowDragAndDrop:this.dataFields[f]?this.dataFields[f].allowDragAndDrop:!this.mappingFields[f]||this.mappingFields[f].allowDragAndDrop,showFilterIcon:this.dataFields[f]?this.dataFields[f].showFilterIcon:!this.mappingFields[f]||this.mappingFields[f].showFilterIcon,showSortIcon:this.dataFields[f]?this.dataFields[f].showSortIcon:!this.mappingFields[f]||this.mappingFields[f].showSortIcon,showEditIcon:this.dataFields[f]?this.dataFields[f].showEditIcon:!this.mappingFields[f]||this.mappingFields[f].showEditIcon,showRemoveIcon:this.dataFields[f]?this.dataFields[f].showRemoveIcon:!this.mappingFields[f]||this.mappingFields[f].showRemoveIcon,showValueTypeIcon:this.dataFields[f]?this.dataFields[f].showValueTypeIcon:!this.mappingFields[f]||this.mappingFields[f].showValueTypeIcon,showSubTotals:this.dataFields[f]?this.dataFields[f].showSubTotals:!this.mappingFields[f]||this.mappingFields[f].showSubTotals};n.push(w),this.fieldList[f]=w,l.indexOf(f)>=0&&l.splice(l.indexOf(f),1)}this.measureReportItems=l},e.prototype.loadMeasureGroups=function(e){(0,t.isNullOrUndefined)(this.fieldListObj)&&(this.fieldListObj={}),this.fieldListObj.measuresGroups=[].slice.call(e.querySelectorAll("row"))},e.prototype.doAjaxPost=function(e,i,a,r,n){var s=this,o={dataSourceSettings:n.dataSourceSettings,action:n.action,customProperties:{},internalProperties:{headers:{"Content-Type":"text/xml"},requestType:"string",data:a}};this.getBeforeSeviceInvoke&&this.getBeforeSeviceInvoke(o),this.requestHeaders=o.internalProperties.headers||{};var l=this.requestHeaders["Content-Type"]?this.requestHeaders["Content-Type"]:"text/xml";new t.Ajax({mode:!1,contentType:l,url:i,data:a,dataType:"xml",type:e,beforeSend:this.beforeSend.bind(this),onSuccess:this.onSuccess.bind(this,r,n),onFailure:function(e){s.errorInfo=e}}).send()},e.prototype.onSuccess=function(e,t,i,a){var r=(new DOMParser).parseFromString(i,"text/xml"),n=r.querySelector("Body");if(n.querySelector("OlapInfo")||n.querySelector("DiscoverResponse")||(n.querySelector("Fault")&&n.querySelector("Fault").querySelector("faultstring")?this.errorInfo=n.querySelector("Fault").querySelector("faultstring").innerHTML:n.querySelector("return")&&n.querySelector("return").querySelector("Error")&&(this.errorInfo=n.querySelector("return").querySelector("Error").getAttribute("Description"))),this.getAfterSeviceInvoke){var s={action:t.action,response:i};this.getAfterSeviceInvoke(s)}e(r,a,t)},e.prototype.beforeSend=function(e){for(var t in this.dataSourceSettings.authentication.userName&&this.dataSourceSettings.authentication.password&&e.httpRequest.setRequestHeader("Authorization","Basic "+btoa(this.dataSourceSettings.authentication.userName+":"+this.dataSourceSettings.authentication.password)),this.requestHeaders)Object.prototype.hasOwnProperty.call(this.requestHeaders,t)&&"Content-Type"!==t&&e.httpRequest.setRequestHeader(t,this.requestHeaders[t])},e.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>"},e.prototype.getConnectionInfo=function(e,i){var a={url:"",LCID:(0,t.isNullOrUndefined)(i)?"1033":i.toString()};if(""!==e)for(var r=0,n=e.split(";");r<n.length;r++){var s=n[r];s.toLowerCase().indexOf("locale")<0&&0===a.url.length?a.url=s:s.toLowerCase().indexOf("locale")>=0&&(a.LCID=s.replace(/ /g,"").split("=")[1])}return a},e.prototype.getMDXQuery=function(e){return Tl.getCellSets(e,this,!0,void 0,!0),this.mdxQuery},e}(),Dl=v(727),Ol=function(){function e(){}return e.prototype.drawHeader=function(e,t){var i=t.pageSettings.size,r=e.header,n=new a.PointF(0,r&&r.fromTop?r.fromTop:0),s=new a.SizeF(i.width-80,r&&r.height?.75*r.height:50),o=new a.RectangleF(n,s);t.template.top=this.drawPageTemplate(new a.PdfPageTemplateElement(o),r)},e.prototype.drawFooter=function(e,t){var i=t.pageSettings.size,r=e.footer,n=new a.PointF(0,i.width-80-(r&&r.fromBottom?.75*r.fromBottom:0)),s=new a.SizeF(i.width-80,r&&r.height?.75*r.height:50),o=new a.RectangleF(n,s);t.template.bottom=this.drawPageTemplate(new a.PdfPageTemplateElement(o),r)},e.prototype.drawPageTemplate=function(e,i){for(var a=0,r=i.contents;a<r.length;a++){var n=r[a];switch(this.processContentValidation(n),n.type){case"Text":if(""===n.value||(0,t.isNullOrUndefined)(n.value)||"string"!=typeof n.value)throw new Error("please enter the valid input value in text content...");this.drawText(e,n);break;case"PageNumber":this.drawPageNumber(e,n);break;case"Image":if((0,t.isNullOrUndefined)(n.src)||""===n.src)throw new Error("please enter the valid base64 string in image content...");this.drawImage(e,n);break;case"Line":this.drawLine(e,n)}}return e},e.prototype.processContentValidation=function(e){if((0,t.isNullOrUndefined)(e.type))throw new Error("please set valid content type...");if("Line"===e.type){if((0,t.isNullOrUndefined)(e.points))throw new Error("please enter valid points in "+e.type+" content...");if((0,t.isNullOrUndefined)(e.points.x1)||"number"!=typeof e.points.x1)throw new Error("please enter valid x1 co-ordinate in "+e.type+" points...");if((0,t.isNullOrUndefined)(e.points.y1)||"number"!=typeof e.points.y1)throw new Error("please enter valid y1 co-ordinate in "+e.type+" points...");if((0,t.isNullOrUndefined)(e.points.x2)||"number"!=typeof e.points.x2)throw new Error("please enter valid x2 co-ordinate in "+e.type+" points...");if((0,t.isNullOrUndefined)(e.points.y2)||"number"!=typeof e.points.y2)throw new Error("please enter valid y2 co-ordinate in "+e.type+" points...")}else{if((0,t.isNullOrUndefined)(e.position))throw new Error("please enter valid position in "+e.type+" content...");if((0,t.isNullOrUndefined)(e.position.x)||"number"!=typeof e.position.x)throw new Error("please enter valid x co-ordinate in "+e.type+" position...");if((0,t.isNullOrUndefined)(e.position.y)||"number"!=typeof e.position.y)throw new Error("please enter valid y co-ordinate in "+e.type+" position...")}},e.prototype.drawText=function(e,i){var r=this.getFontFromContent(i),n=this.getBrushFromContent(i),s=null;if(!(0,t.isNullOrUndefined)(i.style)&&!(0,t.isNullOrUndefined)(i.style.textPenColor)){var o=this.hexDecToRgb(i.style.textPenColor);s=new a.PdfPen(new a.PdfColor(o.r,o.g,o.b))}null==n&&null==s&&(n=new a.PdfSolidBrush(new a.PdfColor(0,0,0)));var l=i.value.toString(),d=.75*i.position.x,p=.75*i.position.y,h=new a.PdfStringFormat;(0,t.isNullOrUndefined)(i.stringFormat)||(h=i.stringFormat);var u=this.setContentFormat(i,h);null===u||(0,t.isNullOrUndefined)(u.format)||(0,t.isNullOrUndefined)(u.size)?e.graphics.drawString(l,r,s,n,d,p,h):e.graphics.drawString(l,r,s,n,d,p,u.size.width,u.size.height,u.format)},e.prototype.drawPageNumber=function(e,i){var r=this.getFontFromContent(i),n=null;if((0,t.isNullOrUndefined)(i.style)||(0,t.isNullOrUndefined)(i.style.textBrushColor))n=new a.PdfSolidBrush(new a.PdfColor(0,0,0));else{var s=this.hexDecToRgb(i.style.textBrushColor);n=new a.PdfSolidBrush(new a.PdfColor(s.r,s.g,s.b))}var o,l,d=new a.PdfPageNumberField(r,n);if(d.numberStyle=this.getPageNumberStyle(i.pageNumberType),(0,t.isNullOrUndefined)(i.format))l="{0}",o=new a.PdfCompositeField(r,n,l,d);else{var p="$total",h="$current";if(-1!==i.format.indexOf(p)&&-1!==i.format.indexOf(h))(u=new a.PdfPageCountField(r)).numberStyle=this.getPageNumberStyle(i.pageNumberType),l=i.format.indexOf(p)>i.format.indexOf(h)?(l=i.format.replace(h,"0")).replace(p,"1"):(l=i.format.replace(h,"1")).replace(p,"0"),o=new a.PdfCompositeField(r,n,l,d,u);else if(-1!==i.format.indexOf(h)&&-1===i.format.indexOf(p))l=i.format.replace(h,"0"),o=new a.PdfCompositeField(r,n,l,d);else{var u=new a.PdfPageCountField(r);l=i.format.replace(p,"0"),o=new a.PdfCompositeField(r,n,l,u)}}var c=.75*i.position.x,g=.75*i.position.y,m=this.setContentFormat(i,o.stringFormat);null===m||(0,t.isNullOrUndefined)(m.format)||(0,t.isNullOrUndefined)(m.size)||(o.stringFormat=m.format,o.bounds=new a.RectangleF(c,g,m.size.width,m.size.height)),o.draw(e.graphics,c,g)},e.prototype.drawImage=function(e,i){var r=.75*i.position.x,n=.75*i.position.y,s=(0,t.isNullOrUndefined)(i.size)||(0,t.isNullOrUndefined)(i.size.width)?void 0:.75*i.size.width,o=(0,t.isNullOrUndefined)(i.size)||(0,t.isNullOrUndefined)(i.size.height)?void 0:.75*i.size.height,l=new a.PdfBitmap(i.src);(0,t.isNullOrUndefined)(s)?e.graphics.drawImage(l,r,n):e.graphics.drawImage(l,r,n,s,o)},e.prototype.drawLine=function(e,i){var a=.75*i.points.x1,r=.75*i.points.y1,n=.75*i.points.x2,s=.75*i.points.y2,o=this.getPenFromContent(i);(0,t.isNullOrUndefined)(i.style)||((0,t.isNullOrUndefined)(i.style.penSize)||"number"!=typeof i.style.penSize||(o.width=.75*i.style.penSize),o.dashStyle=this.getDashStyle(i.style.dashStyle)),e.graphics.drawLine(o,a,r,n,s)},e.prototype.getFontFromContent=function(e){if(e.font instanceof a.PdfTrueTypeFont)return e.font;var i=(0,t.isNullOrUndefined)(e.font)||(0,t.isNullOrUndefined)(e.font.fontSize)?(0,t.isNullOrUndefined)(e.style)||(0,t.isNullOrUndefined)(e.style.fontSize)?9.75:.75*e.style.fontSize:.75*e.font.fontSize,r=(0,t.isNullOrUndefined)(e.font)||(0,t.isNullOrUndefined)(e.font.pdfFontFamily)?a.PdfFontFamily.TimesRoman:e.font.pdfFontFamily,n=a.PdfFontStyle.Regular;return(0,t.isNullOrUndefined)(e.font)||(0,t.isNullOrUndefined)(e.font.bold)||(n|=a.PdfFontStyle.Bold),(0,t.isNullOrUndefined)(e.font)||(0,t.isNullOrUndefined)(e.font.italic)||(n|=a.PdfFontStyle.Italic),(0,t.isNullOrUndefined)(e.font)||(0,t.isNullOrUndefined)(e.font.underline)||(n|=a.PdfFontStyle.Underline),(0,t.isNullOrUndefined)(e.font)||(0,t.isNullOrUndefined)(e.font.strikeout)||(n|=a.PdfFontStyle.Strikeout),new a.PdfStandardFont(r,i,n)},e.prototype.getPenFromContent=function(e){var i=new a.PdfPen(new a.PdfColor(0,0,0));if(!(0,t.isNullOrUndefined)(e.style)&&null!==e.style&&!(0,t.isNullOrUndefined)(e.style.penColor)){var r=this.hexDecToRgb(e.style.penColor);i=new a.PdfPen(new a.PdfColor(r.r,r.g,r.b))}return i},e.prototype.getBrushFromContent=function(e){var i=null;if(!(0,t.isNullOrUndefined)(e.style)&&!(0,t.isNullOrUndefined)(e.style.textBrushColor)){var r=this.hexDecToRgb(e.style.textBrushColor);i=new a.PdfSolidBrush(new a.PdfColor(r.r,r.g,r.b))}return i},e.prototype.setContentFormat=function(e,i){if(!(0,t.isNullOrUndefined)(e.size)){var r=.75*e.size.width,n=.75*e.size.height;if(i=new a.PdfStringFormat(a.PdfTextAlignment.Left,a.PdfVerticalAlignment.Middle),!(0,t.isNullOrUndefined)(e.style)&&!(0,t.isNullOrUndefined)(e.style.hAlign))switch(e.style.hAlign){case"Right":i.alignment=a.PdfTextAlignment.Right;break;case"Center":i.alignment=a.PdfTextAlignment.Center;break;case"Justify":i.alignment=a.PdfTextAlignment.Justify}if(!(0,t.isNullOrUndefined)(e.style)&&!(0,t.isNullOrUndefined)(e.style.vAlign))switch(e.style.vAlign){case"Bottom":i.lineAlignment=a.PdfVerticalAlignment.Bottom;break;case"Top":i.lineAlignment=a.PdfVerticalAlignment.Top}return{format:i,size:new a.SizeF(r,n)}}return null},e.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}},e.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}},e.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);var t=parseInt(e,16);return{r:t>>16&255,g:t>>8&255,b:255&t}},e.prototype.configureCellImage=function(e,t,i){var r=new a.PdfBitmap(t.base64);r.height=t.height||r.height,r.width=t.width||r.width,e.value=r,i&&i.height<r.height&&(i.height=r.height)},e.prototype.setHyperLink=function(e,i,r,n,s){var o=r&&r.isHeaderRow||n&&"row"===n.axis,l=!1,d=!1;if(s&&s.pdfExportModule&&s.pdfExportModule.exportProperties&&s.pdfExportModule.exportProperties.pdfExportProperties&&s.pdfExportModule.exportProperties.pdfExportProperties.theme){var p=s.pdfExportModule.exportProperties.pdfExportProperties.theme;l=!(!p.header||!p.header.fontColor),d=!(!p.record||!p.record.fontColor)}if((0,t.isNullOrUndefined)(i.hyperLink))o&&("row"===n.axis&&!d||"column"===n.axis&&!l)?e.style.textBrush=new a.PdfSolidBrush(new a.PdfColor(102,102,102)):o||d||(0,t.isNullOrUndefined)(n)||!((0,t.isNullOrUndefined)(n.style)||!(0,t.isNullOrUndefined)(n.style)&&(0,t.isNullOrUndefined)(n.style.backgroundColor))||(e.style.textBrush=new a.PdfSolidBrush(new a.PdfColor(0,0,0)));else{var h=new a.PdfTextWebLink;h.url=i.hyperLink.target,h.text=i.hyperLink.displayText||i.hyperLink.target;var u=i&&i.style&&i.style.fontSize?.8*i.style.fontSize:e&&e.style&&e.style.font&&e.style.font.fontSize?e.style.font.fontSize:11,c=i&&i.style&&i.style.fontFamily?this.getFontFamily(i.style.fontFamily):e&&e.style&&e.style.font&&e.style.font.fontFamily?e.style.font.fontFamily:a.PdfFontFamily.Helvetica;h.font=new a.PdfStandardFont(c,u),h.brush=new a.PdfSolidBrush(new a.PdfColor(51,102,187)),e.value=h}},e.prototype.applyHeaderBackground=function(e){var t=this.hexDecToRgb("#f5f5f5"),i=t.r,r=t.g,n=t.b;e.style.backgroundBrush=new a.PdfSolidBrush(new a.PdfColor(i,r,n))},e.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}},e}(),Nl=function(){function e(e){this.parent=e,this.pdfExportHelper=new Ol}return e.prototype.getModuleName=function(){return"chartExport"},e.prototype.pdfChartExport=function(e,i,r,n){var s=this,o=[this.parent.chart],l=this.getChartInfo(o),d=l.width,p=l.height,h=this.parent.chart.svgObject;this.parent.enableRtl&&l.svg&&l.svg.querySelector("#"+this.parent.element.id+"_chart_svg").setAttribute("direction","rtl"),this.parent.chart.enableCanvas||(h=(0,t.createElement)("canvas",{id:"ej2-canvas",attrs:{width:d.toString(),height:p.toString()}}));var u=window.URL.createObjectURL(new Blob([(new XMLSerializer).serializeToString(l.svg)],{type:"image/svg+xml"})),c=new Image,g=h.getContext("2d");return c.src=u,new Promise(function(o){c.onload=function(){var l;l=(0,t.isNullOrUndefined)(i)?new a.PdfDocument:i,g.drawImage(c,0,0),window.URL.revokeObjectURL(u),s.exportPdf(h,l,r,n,d,p,e),o(l)}})},e.prototype.getChartInfo=function(e,i){var a,r=0,n=0,s=this.parent.chart.enableCanvas,o=new Dl.SvgRenderer("").createSvg({id:"Svg_Export_Element",width:200,height:200});return e.map(function(e){var l=e.svgObject.cloneNode(!0),d=e.renderer.createGroup({style:(0,t.isNullOrUndefined)(i)||i?"transform: translateY("+n+"px)":"transform: translateX("+r+"px)"});"transparent"===(a=l.childNodes[0]?l.childNodes[0].getAttribute("fill"):"transparent")&&(a=e.theme.indexOf("Dark")>-1||"HighContrast"===e.theme?"rgba(0, 0, 0, 1)":"rgba(255, 255, 255, 1)"),s||d.appendChild(l),r=e.availableSize.width,n=e.availableSize.height,s||o.appendChild(d)}),s||(o.setAttribute("width",r+""),o.setAttribute("height",n+""),o.style.backgroundColor=a),{width:r,height:n,svg:o}},e.prototype.exportPdf=function(e,i,r,n,s,o,l){var d=i.sections.add(),p=i.pageSettings.width,h=i.pageSettings.height,u=i.pageSettings.margins,c=s+u.left+u.right;i.pageSettings.size=new a.SizeF(c,h),(0,t.isNullOrUndefined)(this.exportProperties)&&(this.exportProperties={});var g=this.exportProperties.fileName?this.exportProperties.fileName:(0,t.isNullOrUndefined)(l)||(0,t.isNullOrUndefined)(l.fileName)?"default":l.fileName;if(this.exportProperties.width||this.exportProperties.height?(i.pageSettings.orientation=this.exportProperties.width>this.exportProperties.height||!this.exportProperties.height&&this.exportProperties.width>h||!this.exportProperties.width&&p>this.exportProperties.height?a.PdfPageOrientation.Landscape:a.PdfPageOrientation.Portrait,i.pageSettings.size=new a.SizeF(this.exportProperties.width?this.exportProperties.width:p,this.exportProperties.height?this.exportProperties.height:h)):(i.pageSettings.orientation=0===this.exportProperties.orientation||this.exportProperties.orientation?this.exportProperties.orientation:(0,t.isNullOrUndefined)(l)||(0,t.isNullOrUndefined)(l.pageOrientation)||"Landscape"===l.pageOrientation?a.PdfPageOrientation.Landscape:a.PdfPageOrientation.Portrait,(0,t.isNullOrUndefined)(l)||(0,t.isNullOrUndefined)(l.pageSize)||(i.pageSettings.size=Hs.getPageSize(l.pageSize))),!(0,t.isNullOrUndefined)(this.exportProperties.pdfMargins)){var m=i.pageSettings.margins;m.top=(0,t.isNullOrUndefined)(this.exportProperties.pdfMargins.top)?m.top:this.exportProperties.pdfMargins.top,m.bottom=(0,t.isNullOrUndefined)(this.exportProperties.pdfMargins.bottom)?m.bottom:this.exportProperties.pdfMargins.bottom,m.left=(0,t.isNullOrUndefined)(this.exportProperties.pdfMargins.left)?m.left:this.exportProperties.pdfMargins.left,m.right=(0,t.isNullOrUndefined)(this.exportProperties.pdfMargins.right)?m.right:this.exportProperties.pdfMargins.right}d.setPageSettings(i.pageSettings),h=i.pageSettings.height;var f=e.toDataURL("image/jpeg").replace("image/jpeg","image/octet-stream");f=f.slice(f.indexOf(",")+1);var v,S=new a.PdfBitmap(f),y=d.pages.add();(0,t.isNullOrUndefined)(l)||(0,t.isNullOrUndefined)(l.header)||(0,t.isNullOrUndefined)(this.pdfExportHelper)||this.pdfExportHelper.drawHeader(l,i),(0,t.isNullOrUndefined)(l)||(0,t.isNullOrUndefined)(l.footer)||(0,t.isNullOrUndefined)(this.pdfExportHelper)||this.pdfExportHelper.drawFooter(l,i),y.graphics.drawImage(S,0,0,h<o||this.exportProperties.width||i.pageSettings.size?y.getClientSize().width:c,h<o?y.getClientSize().height:o),n||r?n&&(v=i.save()):(i.save(g+".pdf"),i.destroy());var b={type:"PDF",promise:n?v:null};return this.parent.trigger(ki,b),new Promise(function(){})},e.prototype.destroy=function(){this.exportProperties&&(this.exportProperties=null),this.pdfExportHelper&&(this.pdfExportHelper=null)},e}(),Pl=v(115),El=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function a(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),Il=function(){return Il=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},Il.apply(this,arguments)},Fl=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;o>=0;o--)(r=e[o])&&(s=(n<3?r(s):n>3?r(t,i,s):r(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s},Ll=function(e,t,i,a){return new(i||(i=Promise))(function(r,n){function s(e){try{l(a.next(e))}catch(e){n(e)}}function o(e){try{l(a.throw(e))}catch(e){n(e)}}function l(e){e.done?r(e.value):new i(function(t){t(e.value)}).then(s,o)}l((a=a.apply(e,t||[])).next())})},Al=function(e,t){var i,a,r,n,s={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return n={next:o(0),throw:o(1),return:o(2)},"function"==typeof Symbol&&(n[Symbol.iterator]=function(){return this}),n;function o(n){return function(o){return function(n){if(i)throw new TypeError("Generator is already executing.");for(;s;)try{if(i=1,a&&(r=2&n[0]?a.return:n[0]?a.throw||((r=a.return)&&r.call(a),0):a.next)&&!(r=r.call(a,n[1])).done)return r;switch(a=0,r&&(n=[2&n[0],r.value]),n[0]){case 0:case 1:r=n;break;case 4:return s.label++,{value:n[1],done:!1};case 5:s.label++,a=n[1],n=[0];continue;case 7:n=s.ops.pop(),s.trys.pop();continue;default:if(!(r=s.trys,(r=r.length>0&&r[r.length-1])||6!==n[0]&&2!==n[0])){s=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){s.label=n[1];break}if(6===n[0]&&s.label<r[1]){s.label=r[1],r=n;break}if(r&&s.label<r[2]){s.label=r[2],s.ops.push(n);break}r[2]&&s.ops.pop(),s.trys.pop();continue}n=t.call(e,s)}catch(e){n=[6,e],a=0}finally{i=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}([n,o])}}},Rl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return El(i,e),Fl([(0,t.Property)(!0)],i.prototype,"showFilterIcon",void 0),Fl([(0,t.Property)(!0)],i.prototype,"showSortIcon",void 0),Fl([(0,t.Property)(!0)],i.prototype,"showRemoveIcon",void 0),Fl([(0,t.Property)(!0)],i.prototype,"showValueTypeIcon",void 0),Fl([(0,t.Property)("Both")],i.prototype,"displayMode",void 0),Fl([(0,t.Property)(!0)],i.prototype,"allowDragAndDrop",void 0),Fl([(0,t.Property)(!1)],i.prototype,"showFieldsPanel",void 0),i}(t.ChildProperty),kl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return El(i,e),Fl([(0,t.Property)(!1)],i.prototype,"allowAdding",void 0),Fl([(0,t.Property)(!1)],i.prototype,"allowEditing",void 0),Fl([(0,t.Property)(!1)],i.prototype,"allowDeleting",void 0),Fl([(0,t.Property)(!1)],i.prototype,"allowCommandColumns",void 0),Fl([(0,t.Property)(!1)],i.prototype,"allowInlineEditing",void 0),Fl([(0,t.Property)("Normal")],i.prototype,"mode",void 0),Fl([(0,t.Property)(!0)],i.prototype,"allowEditOnDblClick",void 0),Fl([(0,t.Property)(!0)],i.prototype,"showConfirmDialog",void 0),Fl([(0,t.Property)(!1)],i.prototype,"showDeleteConfirmDialog",void 0),i}(t.ChildProperty),jl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return El(i,e),Fl([(0,t.Property)()],i.prototype,"measure",void 0),Fl([(0,t.Property)()],i.prototype,"label",void 0),Fl([(0,t.Property)("NotEquals")],i.prototype,"conditions",void 0),Fl([(0,t.Property)()],i.prototype,"value1",void 0),Fl([(0,t.Property)()],i.prototype,"value2",void 0),i}(t.ChildProperty),ql=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return El(i,e),Fl([(0,t.Property)(!1)],i.prototype,"showHyperlink",void 0),Fl([(0,t.Property)(!1)],i.prototype,"showRowHeaderHyperlink",void 0),Fl([(0,t.Property)(!1)],i.prototype,"showColumnHeaderHyperlink",void 0),Fl([(0,t.Property)(!1)],i.prototype,"showValueCellHyperlink",void 0),Fl([(0,t.Property)(!1)],i.prototype,"showSummaryCellHyperlink",void 0),Fl([(0,t.Collection)([],jl)],i.prototype,"conditionalSettings",void 0),Fl([(0,t.Property)()],i.prototype,"headerText",void 0),Fl([(0,t.Property)("")],i.prototype,"cssClass",void 0),i}(t.ChildProperty),Hl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return El(i,e),Fl([(0,t.Property)(5)],i.prototype,"columnPageSize",void 0),Fl([(0,t.Property)(5)],i.prototype,"rowPageSize",void 0),Fl([(0,t.Property)(1)],i.prototype,"currentColumnPage",void 0),Fl([(0,t.Property)(1)],i.prototype,"currentRowPage",void 0),i}(t.ChildProperty),Vl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return El(i,e),Fl([(0,t.Property)("Bottom")],i.prototype,"position",void 0),Fl([(0,t.Property)(!1)],i.prototype,"isInversed",void 0),Fl([(0,t.Property)(!0)],i.prototype,"showRowPager",void 0),Fl([(0,t.Property)(!0)],i.prototype,"showColumnPager",void 0),Fl([(0,t.Property)(!0)],i.prototype,"showRowPageSize",void 0),Fl([(0,t.Property)(!0)],i.prototype,"showColumnPageSize",void 0),Fl([(0,t.Property)([10,50,100,200])],i.prototype,"rowPageSizes",void 0),Fl([(0,t.Property)([5,10,20,50,100])],i.prototype,"columnPageSizes",void 0),Fl([(0,t.Property)(!1)],i.prototype,"enableCompactView",void 0),Fl([(0,t.Property)()],i.prototype,"template",void 0),i}(t.ChildProperty),Ul=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return El(i,e),Fl([(0,t.Property)("Table")],i.prototype,"view",void 0),Fl([(0,t.Property)("Table")],i.prototype,"primary",void 0),i}(t.ChildProperty),Bl=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return El(i,e),Fl([(0,t.Property)(!1)],i.prototype,"allowSinglePage",void 0),i}(t.ChildProperty),_l=function(e){function l(i,a){var r=e.call(this,i,a)||this;return r.verticalScrollScale=1,r.horizontalScrollScale=1,r.scrollerBrowserLimit=8e6,r.lastSortInfo={},r.lastFilterInfo={},r.lastAggregationInfo={},r.lastCalcFieldInfo={},r.focusedCellInfo=null,r.isScrolling=!1,r.allowEngineExport=!1,r.isInitial=!0,r.shiftLockedPos=[],r.savedSelectedCellsPos=[],r.cellSelectionPos=[],r.isPopupClicked=!1,r.isMouseDown=!1,r.isMouseUp=!1,r.fieldsType={},r.remoteData=[],r.defaultItems={},r.isCellBoxMultiSelection=!1,r.isBlobData=!1,r.gridCellCollection={},r.rowRangeSelection={enable:!1,startIndex:0,endIndex:0},r.isStaticRefresh=!1,r.isStaticFieldList=!1,r.resizeInfo={},r.scrollPosObject={vertical:0,horizontal:0,verticalSection:0,horizontalSection:0,top:0,left:0,scrollDirection:{direction:"",position:0}},r.pivotColumns=[],r.totColWidth=0,r.posCount=0,r.isModified=!1,r.isInitialRendering=!1,r.needsID=!0,r.pivotRefresh=t.Component.prototype.refresh,r.request="undefined"!=typeof window?new XMLHttpRequest:null,r.isServerWaitingPopup=!1,r.actionObj={},r.defaultFieldListOrder="None",r.isModalDialog=!1,r.destroyEngine=!1,r.pivotView=r,(0,t.setValue)("mergePersistData",r.mergePersistPivotData,r),r}var d;return El(l,e),d=l,l.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&&(this.toolbar.length>0||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},l.prototype.preRender=function(){this.dataSourceSettings&&"SSAS"===this.dataSourceSettings.providerType?(this.dataType="olap",this.olapEngineModule=new Ml):(this.dataType="pivot",this.engineModule=new Us),this.isAdaptive=t.Browser.isDevice,t.Browser.isIE||"edge"===t.Browser.info.name?this.scrollerBrowserLimit=15e5:"chrome"===t.Browser.info.name&&(this.scrollerBrowserLimit=15e6),this.isTouchMode=!!(0,t.closest)(this.element,".e-bigger"),this.isAngular&&!(0,t.isNullOrUndefined)(this.element.closest("mat-dialog-container"))&&(this.isModalDialog=!0),this.initProperties(),this.renderToolTip(),this.keyboardModule=new Do(this),this.contextMenuModule=new Oo(this),this.globalize=new t.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 no(this)),!this.chartSettings.enableExport||"Both"!==this.displayOption.view&&"Chart"!==this.displayOption.view||(this.chartExportModule=new Nl(this)),this.maxNodeLimitInMemberEditor<=0&&(this.maxNodeLimitInMemberEditor=1),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",Top:"Top",Bottom:"Bottom",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",PercentageOfRunningTotals:"% of 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!!",columnChart:"Column",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",addCurrentSelection:"Add current selection to filter"},this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.renderContextMenu(),this.isDragging=!1,this.pivotDeferLayoutUpdate=(0,t.isNullOrUndefined)(this.pivotDeferLayoutUpdate)?this.allowDeferLayoutUpdate:this.pivotDeferLayoutUpdate,this.addInternalEvents()},l.prototype.onBeforeTooltipOpen=function(e){e.element.classList.add("e-pivottooltipwrap")},l.prototype.renderToolTip=function(){this.showTooltip?(this.tooltipTemplate?this.tooltip=new Bs.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 Bs.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.isAngular=this.isModalDialog,this.tooltip.appendTo(this.element)):this.tooltip&&this.tooltip.destroy()},l.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=l[o];if("string"==typeof d&&-1!==this.getDefaultItems().indexOf(d))if(-1!==d.toString().toLowerCase().indexOf("aggregate")&&"pivot"===this.dataType){s=[{text:this.localeObj.getConstant("Sum")}];var p=this.buildDefaultItems("Aggregate");p.items=s,r.push(p)}else-1!==d.toString().toLowerCase().indexOf("export")?a.push(this.buildDefaultItems(d)):e.push(this.buildDefaultItems(d));else"string"!=typeof d&&i.push(d)}if(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"))),a.length>0){var h=this.buildDefaultItems("export");h.items=a,n.push(h)}var u=[];Array.prototype.push.apply(u,r),Array.prototype.push.apply(u,e),Array.prototype.push.apply(u,t),Array.prototype.push.apply(u,n),Array.prototype.push.apply(u,i),this.setProperties({gridSettings:{contextMenuItems:u}},!0)}},l.prototype.getFieldByID=function(e,t){return new i.DataManager({json:t}).executeLocal((new i.Query).where("id","equal",e))[0]},l.prototype.getAllSummaryType=function(){return["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfRunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"]},l.prototype.getDefaultItems=function(){return["Drillthrough","Expand","Collapse","Pdf Export","Excel Export","Csv Export","Sort Ascending","Sort Descending","Aggregate","CalculatedField"]},l.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 "+o};break;case"export":t={text:this.localeObj.getConstant("export"),target:"td.e-valuescontent",id:this.element.id+"_exporting",iconCss:"e-pivotview-export "+o};break;case"Pdf Export":t={text:this.localeObj.getConstant("pdf"),id:this.element.id+"_pdf",iconCss:Yt+" "+o};break;case"Excel Export":t={text:this.localeObj.getConstant("excel"),id:this.element.id+"_excel",iconCss:Kt+" "+o};break;case"Csv Export":t={text:this.localeObj.getConstant("csv"),id:this.element.id+"_csv",iconCss:Xt+" "+o};break;case"Expand":t={text:this.localeObj.getConstant("expand"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_expand",iconCss:"e-pivotview-expand "+o};break;case"Collapse":t={text:this.localeObj.getConstant("collapse"),target:"td.e-rowsheader,.e-columnsheader",id:this.element.id+"_collapse",iconCss:"e-pivotview-collapse "+o};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 "+o};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 "+o};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 "+o};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 "+o}}return this.defaultItems[e]={text:t.text,id:t.id,target:t.target,iconCss:t.iconCss},this.defaultItems[e]},l.prototype.initProperties=function(){if(this.isTabular="Tabular"===this.gridSettings.layout,this.pivotRefresh=t.Component.prototype.refresh,this.minHeight=(0,t.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:void 0,this.headerCellInfo=this.gridSettings.headerCellInfo?this.gridSettings.headerCellInfo:void 0,this.resizing=this.gridSettings.resizing?this.gridSettings.resizing:void 0,this.resizeStop=this.gridSettings.resizeStop?this.gridSettings.resizeStop:void 0,this.pdfHeaderQueryCellInfo=this.gridSettings.pdfHeaderQueryCellInfo?this.gridSettings.pdfHeaderQueryCellInfo:void 0,this.pdfQueryCellInfo=this.gridSettings.pdfQueryCellInfo?this.gridSettings.pdfQueryCellInfo:void 0,this.excelHeaderQueryCellInfo=this.gridSettings.excelHeaderQueryCellInfo?this.gridSettings.excelHeaderQueryCellInfo:void 0,this.excelQueryCellInfo=this.gridSettings.excelQueryCellInfo?this.gridSettings.excelQueryCellInfo:void 0,this.columnDragStart=this.gridSettings.columnDragStart?this.gridSettings.columnDragStart:void 0,this.columnDrag=this.gridSettings.columnDrag?this.gridSettings.columnDrag:void 0,this.columnDrop=this.gridSettings.columnDrop?this.gridSettings.columnDrop:void 0,this.beforeColumnsRender=this.gridSettings.columnRender?this.gridSettings.columnRender:void 0,this.selected=this.gridSettings.cellSelected?this.gridSettings.cellSelected:void 0,this.selecting=this.gridSettings.cellSelecting?this.gridSettings.cellSelecting:void 0,this.cellDeselected=this.gridSettings.cellDeselected?this.gridSettings.cellDeselected:void 0,this.rowSelected=this.gridSettings.rowSelected?this.gridSettings.rowSelected:void 0,this.rowDeselected=this.gridSettings.rowDeselected?this.gridSettings.rowDeselected:void 0,this.chartTooltipRender=this.chartSettings.tooltipRender?this.chartSettings.tooltipRender:void 0,this.chartLegendClick=this.chartSettings.legendClick?this.chartSettings.legendClick:void 0,this.chartLoaded=this.chartSettings.loaded?this.chartSettings.loaded:void 0,this.chartLoad=this.chartSettings.load?this.chartSettings.load:void 0,this.chartResized=this.chartSettings.resized?this.chartSettings.resized:void 0,this.chartAxisLabelRender=this.chartSettings.axisLabelRender?this.chartSettings.axisLabelRender:void 0,this.multiLevelLabelClick=this.chartSettings.multiLevelLabelClick?this.chartSettings.multiLevelLabelClick:void 0,this.chartPointClick=this.chartSettings.pointClick?this.chartSettings.pointClick:void 0,this.contextMenuClick=this.gridSettings.contextMenuClick?this.gridSettings.contextMenuClick:void 0,this.contextMenuOpen=this.gridSettings.contextMenuOpen?this.gridSettings.contextMenuOpen:void 0,this.beforePdfExport=this.gridSettings.beforePdfExport?this.gridSettings.beforePdfExport:void 0,this.beforeExcelExport=this.gridSettings.beforeExcelExport?this.gridSettings.beforeExcelExport:void 0,this.beforePrint=this.chartSettings.beforePrint?this.chartSettings.beforePrint:void 0,this.animationComplete=this.chartSettings.animationComplete?this.chartSettings.animationComplete:void 0,this.legendRender=this.chartSettings.legendRender?this.chartSettings.legendRender:void 0,this.textRender=this.chartSettings.textRender?this.chartSettings.textRender:void 0,this.pointRender=this.chartSettings.pointRender?this.chartSettings.pointRender:void 0,this.seriesRender=this.chartSettings.seriesRender?this.chartSettings.seriesRender:void 0,this.chartMouseMove=this.chartSettings.chartMouseMove?this.chartSettings.chartMouseMove:void 0,this.chartMouseClick=this.chartSettings.chartMouseClick?this.chartSettings.chartMouseClick:void 0,this.pointMove=this.chartSettings.pointMove?this.chartSettings.pointMove:void 0,this.chartMouseLeave=this.chartSettings.chartMouseLeave?this.chartSettings.chartMouseLeave:void 0,this.chartMouseDown=this.chartSettings.chartMouseDown?this.chartSettings.chartMouseDown:void 0,this.chartMouseUp=this.chartSettings.chartMouseUp?this.chartSettings.chartMouseUp:void 0,this.dragComplete=this.chartSettings.dragComplete?this.chartSettings.dragComplete:void 0,this.zoomComplete=this.chartSettings.zoomComplete?this.chartSettings.zoomComplete:void 0,this.scrollStart=this.chartSettings.scrollStart?this.chartSettings.scrollStart:void 0,this.scrollEnd=this.chartSettings.scrollEnd?this.chartSettings.scrollEnd:void 0,this.scrollChanged=this.chartSettings.scrollChanged?this.chartSettings.scrollChanged:void 0,this.multiLevelLabelRender=this.chartSettings.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 Lo(this)),this.currentView=this.currentView?this.currentView:"Both"===this.displayOption.view?this.displayOption.primary:this.displayOption.view,"pivot"===this.dataType&&"Server"!==this.dataSourceSettings.mode&&!(0,t.isNullOrUndefined)(this.dataSourceSettings.valueSortSettings.headerText)&&""!==this.dataSourceSettings.valueSortSettings.headerText){var e=void 0;"column"===this.dataSourceSettings.valueAxis?e={columnHeaderText:this.dataSourceSettings.valueSortSettings.headerText,columnSortOrder:this.dataSourceSettings.valueSortSettings.sortOrder}:"row"===this.dataSourceSettings.valueAxis&&(e={rowHeaderText:this.dataSourceSettings.valueSortSettings.headerText,rowSortOrder:this.dataSourceSettings.valueSortSettings.sortOrder}),this.setProperties({dataSourceSettings:{valueSortSettings:e}},!0)}},l.prototype.updatePageSettings=function(e){if(this.enableVirtualization){var t=1,i=1;this.dataSourceSettings.values.length>1&&"pivot"===this.dataType&&("row"===this.dataSourceSettings.valueAxis?i=this.dataSourceSettings.values.length:t=this.dataSourceSettings.values.length);var 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)}}},l.prototype.render=function(){(0,t.initializeTelemetry)("PivotTable"),this.loadData()},l.prototype.loadData=function(){if(this.dataSourceSettings.formatSettings.length>0)for(var e=this.dataSourceSettings.formatSettings,i=0;i<e.length;i++)(0,t.isNullOrUndefined)(e[i].maximumFractionDigits)&&(0,t.isNullOrUndefined)(e[i].minimumFractionDigits)||null!==e[i].format.match(/^(P|N|C|P[0-9]|C[0-9]|N[0-9])$/g)||(e[i].maximumFractionDigits=void 0,e[i].minimumIntegerDigits=void 0);"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url?"Server"===this.dataSourceSettings.mode?(this.guid=Hs.generateUUID(),this.initialLoad(),"Chart"!==this.displayOption.view?this.renderEmptyGrid():this.refreshData(),this.showWaitingPopup()):new t.Fetch(this.dataSourceSettings.url,"GET").send().then(function(e){return"string"==typeof e?e:e.text()}).then(this.onReadyStateChange.bind(this)):this.initialLoad()},l.prototype.blobToString=function(e){return Ll(this,void 0,void 0,function(){return Al(this,function(t){switch(t.label){case 0:return[4,e];case 1:return[2,t.sent().text()]}})})},l.prototype.onSuccess=function(e){var i=this;if(this.request.readyState===XMLHttpRequest.DONE)if(this.isServerWaitingPopup=!0,"onExcelExport"===this.currentAction||"onCsvExport"===this.currentAction||"onPivotExcelExport"===this.currentAction||"onPivotCsvExport"===this.currentAction)if(200===this.request.status){var a=this.request.response;e=(0,t.isNullOrUndefined)(e)?{}:e;var r=(0,t.isNullOrUndefined)(e.fileName)?"onExcelExport"===this.currentAction||"onPivotExcelExport"===this.currentAction?"default.xlsx":"default.csv":e.fileName;this.isBlobData||Pl.Save.save(r,a);var n={type:"onExcelExport"===this.currentAction||"onPivotExcelExport"===this.currentAction?"xlsx":"csv",promise:this.isBlobData?a:null};this.isBlobData=!1,this.trigger(ki,n),this.triggerAfterServiceInvoke()}else this.blobToString(this.request.response).then(function(e){i.triggerAfterServiceInvoke(e)});else{try{this.triggerAfterServiceInvoke();var s=JSON.parse(this.request.responseText);if("fetchFieldMembers"===this.currentAction){for(var o=JSON.parse(s.members),l=[],d={},p=Hs.isDateField(s.memberName,this.engineModule),h="number"===this.engineModule.fieldList[s.memberName].type,u=Object.keys(o),c=0,g=u.length;c<g;c++){var m=o[u[c]],f=p?this.engineModule.getFormattedValue(m.Name,s.memberName):{formattedText:m.Caption};d[u[c]]={index:m.Index,ordinal:m.Ordinal,isDrilled:m.IsDrilled,caption:f.formattedText},l.push({formattedText:f.formattedText,actualText:p?f.actualText:h?isNaN(Number(m.Name))?m.Name:Number(m.Name):m.Name})}this.engineModule.fieldList[s.memberName].members=d,this.engineModule.fieldList[s.memberName].dateMember=l,this.showGroupingBar?this.pivotButtonModule.updateFilterEvents():this.pivotFieldListModule.pivotButtonModule.updateFilterEvents()}else if("fetchRawData"===this.currentAction){for(var v=this.engineModule.fieldList[this.drillThroughValue.actualText.toString()]?this.engineModule.fieldList[this.drillThroughValue.actualText.toString()].caption:this.drillThroughValue.actualText.toString(),S=this.engineModule.fieldList[this.drillThroughValue.actualText]?this.engineModule.fieldList[this.drillThroughValue.actualText].aggregateType:"",y=JSON.parse(s.rawData),b=JSON.parse(s.indexObject),C={},x=0;x<b.length;x++)C[b[x].Key]=b[x].Value;this.drillThroughValue.indexObject=C,this.drillThroughModule.triggerDialog(v,S,y,this.drillThroughValue,this.drillThroughElement),this.hideWaitingPopup()}else{var w=JSON.parse(s.fieldList);if(this.engineModule.fieldList)for(u=Object.keys(this.engineModule.fieldList),c=0;c<u.length;c++)this.engineModule.fieldList[u[c]]&&w[u[c]]&&(w[u[c]].dateMember=this.engineModule.fieldList[u[c]].dateMember,w[u[c]].formattedMembers=this.engineModule.fieldList[u[c]].formattedMembers,w[u[c]].members=this.engineModule.fieldList[u[c]].members);this.engineModule.fieldList=w,this.engineModule.fields=JSON.parse(s.fields),this.engineModule.rowCount=JSON.parse(s.pivotCount).RowCount,this.engineModule.columnCount=JSON.parse(s.pivotCount).ColumnCount,this.engineModule.rowStartPos=JSON.parse(s.pivotCount).RowStartPosition,this.engineModule.colStartPos=JSON.parse(s.pivotCount).ColumnStartPosition,this.engineModule.rowFirstLvl=JSON.parse(s.pivotCount).RowFirstLevel,this.engineModule.colFirstLvl=JSON.parse(s.pivotCount).ColumnFirstLevel,this.engineModule.columnPageCount=JSON.parse(s.pivotCount).ColumnPageCount,this.engineModule.rowPageCount=JSON.parse(s.pivotCount).RowPageCount,this.engineModule.rowMaxLevel=JSON.parse(s.pivotCount).RowMaxLevel;for(var T=void 0,M=JSON.parse(s.pivotValue),D=0;D<M.length;D++)if(M[D]&&M[D][0]&&"row"===M[D][0].axis){T=D;break}this.engineModule.headerContent=Hs.frameContent(M,"header",T,this),this.engineModule.pageSettings=this.pageSettings;var O=JSON.parse(s.dataSourceSettings);this.dataSourceSettings.groupSettings.length>0&&(this.setProperties({dataSourceSettings:{rows:O.rows}},!0),this.setProperties({dataSourceSettings:{columns:O.columns}},!0),this.setProperties({dataSourceSettings:{formatSettings:O.formatSettings}},!0));var N=O.valueSortSettings;this.engineModule.valueSortSettings={headerText:N.headerText,headerDelimiter:N.headerDelimiter,sortOrder:N.sortOrder,columnIndex:N.columnIndex},this.engineModule.pivotValues=M,this.engineModule.isEmptyData=s.isEmptyData,this.engineModule.isEngineUpdated=s.isEngineUpdated;for(var P=0,E=this.dataSourceSettings.values;P<E.length;P++){var I=E[P];this.engineModule.valueAxisFields[I.name]=I}this.engineModule.globalize=(0,t.isNullOrUndefined)(this.globalize)?new t.Internationalization:this.globalize,this.engineModule.formatFields=this.engineModule.setFormattedFields(this.dataSourceSettings.formatSettings)}}catch(e){this.engineModule.pivotValues=[]}if("onScroll"===this.currentAction)if("vertical"===this.scrollDirection){var F="row"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1,L=this.pageSettings.rowPageSize*F*this.gridSettings.rowHeight*Math.ceil(this.engineModule.rowStartPos/(this.pageSettings.rowPageSize*F))-this.engineModule.rowFirstLvl*F*this.gridSettings.rowHeight;this.scrollPosObject.verticalSection=L}else if("horizondal"===this.scrollDirection){var A="column"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1;L=this.pageSettings.columnPageSize*A*this.gridSettings.columnWidth*Math.ceil(this.engineModule.colStartPos/(this.pageSettings.columnPageSize*A))-this.engineModule.colFirstLvl*A*this.gridSettings.columnWidth;this.scrollPosObject.horizontalSection=L}"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))}},l.prototype.triggerAfterServiceInvoke=function(e){var t={action:this.currentAction,response:e||("string"==typeof this.request.response?this.request.responseText:this.request.response)};this.trigger(sr,t)},l.prototype.getEngine=function(e,t,i,a,r,n,s,o,l,d,p){var h=this;this.engineModule.isEmptyData=!1,this.element.querySelector(".e-spin-hide")&&"onExcelExport"!==e&&"onCsvExport"!==e&&"onPivotExcelExport"!==e&&"onPivotCsvExport"!==e&&this.showWaitingPopup(),this.currentAction=e,this.isServerWaitingPopup=!1;var u={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(Hs.getLocalizedObject(this)),savedFieldList:"onDrop"===e&&null!==this.engineModule.fieldList?Hs.getClonedFieldList(this.engineModule.fieldList,!0):void 0,enableOptimizedRendering:this.enableVirtualization&&this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage,requestType:"string",headers:{"Content-type":"application/json"},isTabular:this.isTabular,showFieldList:this.showFieldList||this.isStaticFieldList,showPivotChart:"Both"===this.displayOption.view||"Chart"===this.displayOption.view,chartType:this.chartSettings&&this.chartSettings.chartSeries&&this.chartSettings.chartSeries.type,showGroupingBar:this.showGroupingBar,showTooltip:this.showTooltip,chartSettings:p?JSON.parse(this.getPersistData()).chartSettings:null,gridSettings:p?JSON.parse(this.getPersistData()).gridSettings:null,enableAutoFit:this.grid&&this.grid.isAutoFitColumns};this.request.readyState!==XMLHttpRequest.UNSENT&&this.request.readyState!==XMLHttpRequest.OPENED||(this.request.withCredentials=!1);var c={request:this.request,dataSourceSettings:JSON.parse(this.getPersistData()).dataSourceSettings,action:e,customProperties:{},internalProperties:u,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&&this.dataSourceSettings.groupSettings.length>0||!!this.groupingModule&&this.groupingModule.isUpdate};this.updateClonedReport(),this.trigger(nr,c,function(e){h.request=e.request,c.internalProperties=e.internalProperties,c.customProperties=e.customProperties,c.dataSourceSettings=e.dataSourceSettings,c.calculatedItem=e.calculatedItem,c.drillItem=e.drillItem,c.editArgs=e.editArgs,c.fetchRawDataArgs=e.fetchRawDataArgs,c.filterItem=e.filterItem,c.hash=e.hash,c.memberName=e.memberName,c.sortItem=e.sortItem,c.excelExportProperties=e.excelExportProperties,c.exportAllPages=e.exportAllPages}),this.request.open("POST",this.dataSourceSettings.url,!0),this.request.onreadystatechange=this.onSuccess.bind(this,c.excelExportProperties),"onExcelExport"===c.action||"onCsvExport"===c.action||"onPivotExcelExport"===c.action||"onPivotCsvExport"===c.action?this.request.responseType="blob":this.request.responseType="";for(var g=Object.keys(c.internalProperties.headers),m=0;m<g.length;m++){var f=g[m],v=String(c.internalProperties.headers[f]);this.request.setRequestHeader(f,v)}"string"===c.internalProperties.requestType?this.request.send(JSON.stringify(c)):"base64"===c.internalProperties.requestType&&this.request.send(btoa(JSON.stringify(c)))},l.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,f=this.chartSettings.chartMouseDown,v=this.chartSettings.chartMouseUp,S=this.chartSettings.dragComplete,y=this.chartSettings.zoomComplete,b=this.chartSettings.scrollStart,C=this.chartSettings.scrollEnd,x=this.chartSettings.scrollChanged;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;var w=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=f,this.chartSettings.chartMouseUp=v,this.chartSettings.dragComplete=S,this.chartSettings.zoomComplete=y,this.chartSettings.scrollStart=b,this.chartSettings.scrollEnd=C,this.chartSettings.scrollChanged=x,w},l.prototype.getPageSettings=function(){return this.addOnPersist(["pageSettings"])},l.prototype.onReadyStateChange=function(e){var i=[];if("CSV"===this.dataSourceSettings.type)for(var a=e.split(/\r?\n|\r/),r=0;r<a.length;r++)(0,t.isNullOrUndefined)(a[r])||""===a[r]||i.push(a[r].split(","));else try{i=JSON.parse(e)}catch(e){i=[]}i&&i.length>0&&this.setProperties({dataSourceSettings:{dataSource:i}},!0),this.initialLoad()},l.prototype.initialLoad=function(){var e=this;try{this.cellTemplateFn=this.templateParser(this.cellTemplate),this.tooltipTemplateFn=this.templateParser(this.tooltipTemplate),this.spinnerTemplate?(0,Bs.createSpinner)({target:this.element,template:this.spinnerTemplate,cssClass:this.cssClass?this.cssClass:void 0},this.createElement):(0,Bs.createSpinner)({target:this.element,cssClass:this.cssClass?this.cssClass:void 0},this.createElement);var t={dataSourceSettings:this.dataSourceSettings,pivotview:this,fieldsType:{},defaultFieldListOrder:this.defaultFieldListOrder};this.trigger(Ni,t,function(i){e.dataSourceSettings=i.dataSourceSettings,e.fieldsType=i.fieldsType,e.defaultFieldListOrder=t.defaultFieldListOrder,e.updateClass(),e.notify(vr,{}),e.notify(pr,{}),e.isAdaptive&&e.contextMenuModule.render(),e.notify(xr,{}),e.notify(wr,{})})}catch(e){var i=e instanceof Error?e:new Error("Unknown error");this.actionFailureMethod(i)}},l.prototype.addInternalEvents=function(){this.on(pr,this.generateData,this),this.on(fr,this.renderPivotGrid,this),this.on(mr,this.onContentReady,this)},l.prototype.removeInternalEvents=function(){this.off(pr,this.generateData),this.off(fr,this.renderPivotGrid),this.off(mr,this.onContentReady)},l.prototype.getPersistData=function(e){var t=this.gridSettings.columnRender,a=this.gridSettings.excelQueryCellInfo,r=this.gridSettings.excelHeaderQueryCellInfo,n=this.gridSettings.pdfQueryCellInfo,s=this.gridSettings.pdfHeaderQueryCellInfo,o=this.chartSettings.load,l=this.chartSettings.loaded,d=this.chartSettings.textRender,p=this.chartSettings.pointRender,h=this.chartSettings.seriesRender,u=this.chartSettings.legendRender,c=this.chartSettings.pointClick,g=this.chartSettings.tooltipRender,m=this.chartSettings.legendClick,f=this.chartSettings.multiLevelLabelRender,v=this.chartSettings.beforePrint,S=this.chartSettings.animationComplete,y=this.chartSettings.chartMouseMove,b=this.chartSettings.chartMouseClick,C=this.chartSettings.pointMove,x=this.chartSettings.chartMouseLeave,w=this.chartSettings.chartMouseDown,T=this.chartSettings.chartMouseUp,M=this.chartSettings.dragComplete,D=this.chartSettings.zoomComplete,O=this.chartSettings.scrollStart,N=this.chartSettings.scrollEnd,P=this.chartSettings.scrollChanged;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;var E=[];e&&(E=!this.dataSourceSettings.dataSource||this.dataSourceSettings.dataSource instanceof i.DataManager?this.dataSourceSettings.dataSource:this.dataSourceSettings.dataSource.slice(),this.setProperties({dataSourceSettings:{dataSource:[]}},!0));var I=this.addOnPersist(["dataSourceSettings","pivotValues","gridSettings","chartSettings","displayOption","pageSettings"]);return this.gridSettings.columnRender=t,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=f,this.chartSettings.beforePrint=v,this.chartSettings.animationComplete=S,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=N,this.chartSettings.scrollChanged=P,e&&this.setProperties({dataSourceSettings:{dataSource:E}},!0),I},l.prototype.loadPersistData=function(e){var t=JSON.parse(e);this.allowServerDataBinding=!1,this.setProperties({gridSettings:t.gridSettings,pivotValues:t.pivotValues,chartSettings:t.chartSettings,displayOption:t.displayOption},!0),"Chart"===t.displayOption.primary?this.currentView="Chart":this.currentView="Table",this.allowServerDataBinding=!0,this.dataSourceSettings&&this.dataSourceSettings.dataSource&&this.dataSourceSettings.dataSource instanceof i.DataManager&&t.dataSourceSettings&&t.dataSourceSettings.dataSource&&t.dataSourceSettings.dataSource.dataSource&&this.dataSourceSettings.dataSource.dataSource&&t.dataSourceSettings.dataSource.dataSource.url===this.dataSourceSettings.dataSource.dataSource.url&&(t.dataSourceSettings.dataSource=this.dataSourceSettings.dataSource),this.dataSourceSettings=t.dataSourceSettings},l.prototype.mergePersistPivotData=function(){var e=window.localStorage.getItem(this.getModuleName()+this.element.id);if(!(0,t.isNullOrUndefined)(e)&&""!==e){var a=JSON.parse(e);this.dataSourceSettings&&this.dataSourceSettings.dataSource&&this.dataSourceSettings.dataSource instanceof i.DataManager&&a.dataSourceSettings&&a.dataSourceSettings.dataSource&&a.dataSourceSettings.dataSource.dataSource&&this.dataSourceSettings.dataSource.dataSource&&a.dataSourceSettings.dataSource.dataSource.url===this.dataSourceSettings.dataSource.dataSource.url&&(a.dataSourceSettings.dataSource=this.dataSourceSettings.dataSource),this.setProperties(a,!0)}},l.prototype.showConditionalFormattingDialog=function(){this.conditionalFormattingModule&&this.conditionalFormattingModule.showConditionalFormattingDialog()},l.prototype.createCalculatedFieldDialog=function(){this.calculatedFieldModule&&this.calculatedFieldModule.createCalculatedFieldDialog()},l.prototype.getModuleName=function(){return"pivotview"},l.prototype.copy=function(e){this.grid.copy(e)},l.prototype.onPropertyChanged=function(i,a){for(var r=!1,n=0,s=Object.keys(i);n<s.length;n++){var o=s[n];switch(o){case"dataSourceSettings":case"hyperlinkSettings":case"allowDrillThrough":case"editSettings":case"allowDataCompression":if(i.dataSourceSettings&&(!(0,t.isNullOrUndefined)(i.dataSourceSettings.dataSource)&&!(0,t.isNullOrUndefined)(this.clonedDataSet)&&this.clonedDataSet!==i.dataSourceSettings.dataSource&&!(0,t.isNullOrUndefined)(i.dataSourceSettings.groupSettings)&&i.dataSourceSettings.groupSettings.length>0||1===Object.keys(i.dataSourceSettings).length&&"dataSource"===Object.keys(i.dataSourceSettings)[0]&&this.dataSourceSettings.groupSettings.length>0)&&(this.clonedDataSet=i.dataSourceSettings.dataSource,this.engineModule.groupingFields={}),i.dataSourceSettings&&1===Object.keys(i.dataSourceSettings).length&&i.dataSourceSettings.groupSettings&&"pivot"===this.dataType&&this.updateGroupingReport(i.dataSourceSettings.groupSettings,"Date"),((0,t.isNullOrUndefined)(i.dataSourceSettings)?[]:Object.keys(i.dataSourceSettings)).indexOf("dataSource")>-1&&"CSV"!==i.dataSourceSettings.type)!(0,t.isNullOrUndefined)(this.savedDataSourceSettings)&&this.dataSourceSettings.dataSource.length>0&&(Hs.updateDataSourceSettings(this,this.savedDataSourceSettings),this.savedDataSourceSettings=void 0),i.dataSourceSettings.dataSource&&0===i.dataSourceSettings.dataSource.length&&(this.savedDataSourceSettings=Hs.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(pr,{});else if(Hs.isButtonIconRefesh(o,a,i)){if(this.showGroupingBar&&this.groupingBarModule&&this.axisFieldModule.render(),this.showFieldList&&this.pivotFieldListModule){var l=Hs.cloneFieldSettings(this.dataSourceSettings.rows),d=Hs.cloneFieldSettings(this.dataSourceSettings.columns),p=Hs.cloneFieldSettings(this.dataSourceSettings.values),h=Hs.cloneFieldSettings(this.dataSourceSettings.filters);this.pivotFieldListModule.setProperties({dataSourceSettings:{rows:l,columns:d,values:p,filters:h}},!0),this.pivotFieldListModule.axisFieldModule.render(),this.pivotFieldListModule.treeViewModule.fieldTable&&!this.isAdaptive&&this.pivotFieldListModule.notify(Sr,{})}}else this.remoteData=[],"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url&&!(0,t.isNullOrUndefined)(i.dataSourceSettings)&&("type"in i.dataSourceSettings||"url"in i.dataSourceSettings)?(this.engineModule.fieldList=null,this.loadData()):(i.dataSourceSettings&&("pivot"===this.dataType&&"dataSource"in i.dataSourceSettings||"olap"===this.dataType&&"url"in i.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(pr,{}));break;case"height":case"width":this.layoutRefresh();break;case"maxNodeLimitInMemberEditor":this.maxNodeLimitInMemberEditor<=0&&(this.maxNodeLimitInMemberEditor=1);break;case"pivotValues":case"displayOption":if(i.displayOption&&1===Object.keys(i.displayOption).length&&i.displayOption.view)switch(this.currentView="Both"===i.displayOption.view?this.displayOption.primary:i.displayOption.view,(this.showGroupingBar||this.showFieldList)&&(this.showFieldList&&this.pivotFieldListModule&&(this.pivotFieldListModule.destroyEngine=!0,this.pivotFieldListModule.destroy(),null!==(0,t.select)("#"+this.element.id+"_PivotFieldList",this.element)&&(0,t.remove)((0,t.select)("#"+this.element.id+"_PivotFieldList",this.element)),this.pivotFieldListModule.destroyEngine=!1),this.notify(vr,this)),i.displayOption.view){case"Both":this.pivotChartModule||(this.pivotChartModule=new Lo(this)),this.grid||this.renderEmptyGrid();break;case"Chart":if(this.grid)this.grid.destroy(),this.grid=void 0,null!==(m=(0,t.select)("#"+this.element.id+"_grid",this.element))&&(0,t.remove)(m);this.pivotChartModule||(this.pivotChartModule=new Lo(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&&!(0,t.isNullOrUndefined)(i.displayOption)&&i.displayOption.view&&(this.currentView="Both"===i.displayOption.view?this.displayOption.primary:i.displayOption.view);if(this.showToolbar&&!(0,t.isNullOrUndefined)(i.displayOption)&&i.displayOption.view)if("Chart"===i.displayOption.view)this.toolbarModule.createChartMenu(),this.toggleButtonState(ei,"add"),this.toggleButtonState(ti,"remove");else if("Table"===i.displayOption.view){(m=(0,t.select)("#"+this.element.id+"_grid",this.element)).style.display="block",this.toggleButtonState(ti,"add"),this.toggleButtonState(ei,"remove")}else this.toolbarModule.createChartMenu(),this.toggleButtonState(ei,"remove"),this.toggleButtonState(ti,"remove");var u="pivot"===this.dataType?this.engineModule:this.olapEngineModule;(0,t.isNullOrUndefined)(u.fieldList)&&(0,t.isNullOrUndefined)(u.pivotValues)||this.notify(fr,{}),this.isScrolling&&Object.prototype.hasOwnProperty.call(i,"pivotValues")&&i.pivotValues.length>0&&this.showWaitingPopup();break;case"gridSettings":this.isTabular="Tabular"===this.gridSettings.layout,this.lastGridSettings=i.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&&this.grid&&this.renderModule.updateGridSettings(),i.gridSettings.layout&&this.initialLoad(),(Object.prototype.hasOwnProperty.call(i.gridSettings,"allowAutoResizing")||i.gridSettings.columnWidth)&&(this.layoutRefresh(),this.toolbarModule&&this.showToolbar&&this.toolbarModule.refreshToolbar());break;case"chartSettings":this.showGroupingBar&&this.groupingBarModule&&(-1!==Object.keys(i.chartSettings).indexOf("enableMultipleAxis")||i.chartSettings.chartSeries&&-1!==Object.keys(i.chartSettings.chartSeries).indexOf("type"))&&(this.groupingBarModule.renderLayout(),this.pivotChartModule&&this.groupingBarModule.appendToElement()),(0,t.isNullOrUndefined)(this.pivotChartModule)&&"Table"!==this.displayOption.view&&(this.pivotChartModule=new Lo(this));var c="pivot"===this.dataType?this.engineModule:this.olapEngineModule;(0,t.isNullOrUndefined)(this.pivotChartModule)||(0,t.isNullOrUndefined)(c.pivotValues)||this.pivotChartModule.loadChart(this,this.chartSettings),(0,t.isNullOrUndefined)(c.pivotValues)||(0,t.isNullOrUndefined)(c.fieldList)||this.notify(hr,this);break;case"locale":case"currencyCode":case"enableRtl":if(this.tooltip&&this.tooltip.destroy(),this.dataSourceSettings.groupSettings&&this.dataSourceSettings.groupSettings.length>0&&this.clonedDataSet){var g="CSV"===this.dataSourceSettings.type?Hs.getClonedCSVData(this.clonedDataSet):Hs.getClonedData(this.clonedDataSet);this.setProperties({dataSourceSettings:{dataSource:g}},!0)}e.prototype.refresh.call(this),this.updateClass();break;case"enableValueSorting":this.enableValueSorting=i.enableValueSorting,this.updateDataSource();break;case"showGroupingBar":this.element.querySelector(".e-grouping-bar")?this.element.querySelector(".e-grouping-bar").remove():this.groupingBarModule&&(this.groupingBarModule.renderLayout(),this.commonModule||(this.commonModule=new no(this)),this.notify(pr,{})),(0,t.isNullOrUndefined)(i.showFieldList)&&this.renderPivotGrid();break;case"showFieldList":this.initialLoad();break;case"groupingBarSettings":this.showGroupingBar&&this.groupingBarModule&&(i.groupingBarSettings&&Object.keys(i.groupingBarSettings).indexOf("showFieldsPanel")>-1?(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:i.showValuesButton},!0),this.pivotFieldListModule.axisFieldModule.render());break;case"showTooltip":this.renderToolTip();break;case"showToolbar":case"toolbar":var m=this.grid&&this.grid.element,f=this.chart&&this.chart.element;if(this.toolbarModule&&this.showToolbar){if(this.toolbarModule.refreshToolbar(),"Both"===this.displayOption.view){var v="Table"===this.displayOption.primary;m&&(m.style.display=v?"":"none"),f&&(f.style.display=v?"none":"")}}else"Both"===this.displayOption.view&&(m&&(m.style.display=""),f&&(f.style.display=""));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:i.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.isStaticFieldList&&this.isStaticRefresh&&(this.isStaticRefresh=!1),this.initialLoad();break;case"cellTemplate":this.cellTemplateFn=this.templateParser(this.cellTemplate),r=!0;break;case"tooltipTemplate":this.tooltipTemplateFn=this.templateParser(this.tooltipTemplate),r=!0;break;case"allowCalculatedField":this.pivotFieldListModule&&(this.pivotFieldListModule.allowCalculatedField=this.allowCalculatedField),this.showGroupingBar&&this.groupingBarModule&&this.element.querySelector("."+pe)&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.groupingBarModule.alignIcon.bind(this.groupingBarModule)));break;case"allowDeferLayoutUpdate":this.pivotDeferLayoutUpdate=this.allowDeferLayoutUpdate,this.pivotFieldListModule&&(this.pivotFieldListModule.allowDeferLayoutUpdate=this.allowDeferLayoutUpdate);break;case"allowGrouping":case"enableVirtualization":this.refresh()}}r&&this.grid&&this.grid.refreshColumns()},l.prototype.toggleButtonState=function(e,t){var i=this.element.querySelector("."+e);if(i){var a=i.closest(".e-toolbar-item");a&&("add"===t?a.classList.add(yt):"remove"===t&&a.classList.remove(yt))}},l.prototype.templateParser=function(e){if(e)try{return"function"!=typeof e&&document.querySelectorAll(e).length?(0,t.compile)(document.querySelector(e).innerHTML.trim()):(0,t.compile)(e)}catch(i){return(0,t.compile)(e)}},l.prototype.getCellTemplate=function(){return this.cellTemplateFn},l.prototype.appendHtml=function(e,i){var a=document.createElement("div");return a.innerHTML=i,(0,t.isNullOrUndefined)(a.firstChild)||e.appendChild(a.firstChild),e},l.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")&&(0,t.addClass)([this.chart.element],"e-ltr")),this.enableVirtualization&&(this.virtualscrollModule=new No(this)),(this.allowDrillThrough||this.editSettings.allowEditing)&&(this.drillThroughModule=new Io(this)),this.enablePaging&&this.notify(wr,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?this.renderModule:new Ys(this),this.renderModule.render(!0)):this.grid&&(0,t.remove)(this.grid.element),(this.showFieldList||this.allowNumberFormatting||this.allowCalculatedField||this.toolbar||this.allowGrouping||this.gridSettings.contextMenuItems)&&(this.notify(hr,this),this.pivotFieldListModule&&this.allowDeferLayoutUpdate&&(this.pivotFieldListModule.clonedDataSource=Hs.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("."+pe)&&this.groupingBarModule.refreshUI(),this.toolbarModule&&this.toolbarModule.toolbar&&(this.toolbarModule.toolbar.width=this.getGridWidthAsNumber()),this.chartSettings.enableScrollOnMultiAxis&&this.chartSettings.enableMultipleAxis&&(this.element.querySelector("."+ii).style.width=(0,t.formatUnit)(this.getGridWidthAsNumber())),this.chart.width=(0,t.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&&(Hs.toggleFieldListIconVisibility(this),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="")},l.prototype.appendChartElement=function(){if(!(0,t.select)("#"+this.element.id+"_chart",this.element)){"Both"===this.displayOption.view&&"Chart"===this.displayOption.primary?this.element.insertBefore((0,t.createElement)("div",{className:ii,id:this.element.id+"_chart"}),this.element.querySelector("."+ft)):this.element.appendChild((0,t.createElement)("div",{className:ii,id:this.element.id+"_chart"}));var e=this.width.toString();this.showToolbar&&this.grid&&(e=this.getGridWidthAsNumber().toString());var i=this.pivotChartModule.getChartHeight();(this.chartSettings&&this.chartSettings.chartSeries&&this.pivotChartModule.accumulationType.indexOf(this.chartSettings.chartSeries.type)>-1?new Fo.AccumulationChart({width:e,height:i}):new Fo.Chart({width:e,height:i})).appendTo((0,t.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&&((0,t.select)("#"+this.element.id+"_chart",this.element).style.display="none"))}},l.prototype.showWaitingPopup=function(){this.grid&&this.grid.element&&!this.spinnerTemplate&&"Table"===this.currentView?(0,Bs.showSpinner)(this.grid.element):(0,Bs.showSpinner)(this.element)},l.prototype.hideWaitingPopup=function(){this.grid&&this.grid.element&&!this.spinnerTemplate&&"Table"===this.currentView?(0,Bs.hideSpinner)(this.grid.element):(0,Bs.hideSpinner)(this.element)},l.prototype.updateDataSource=function(){var e=this;this.showWaitingPopup();var i=this,a=!(0,t.isNullOrUndefined)(i.lastSortInfo)&&Object.keys(i.lastSortInfo).length>0,r=!(0,t.isNullOrUndefined)(i.lastFilterInfo)&&Object.keys(i.lastFilterInfo).length>0,n=!(0,t.isNullOrUndefined)(i.lastAggregationInfo)&&Object.keys(i.lastAggregationInfo).length>0,s=!(0,t.isNullOrUndefined)(i.lastCalcFieldInfo)&&Object.keys(i.lastCalcFieldInfo).length>0,o={dataSourceSettings:Hs.getClonedDataSourceSettings(i.dataSourceSettings)};i.trigger(Pi,o,function(t){if((i.enableVirtualization||i.enablePaging)&&(a||r||n||s)||Hs.updateDataSourceSettings(i,t.dataSourceSettings),i.updatePageSettings(!1),!a||""===i.dataSourceSettings.valueSortSettings.headerText&&""===i.dataSourceSettings.valueSortSettings.rowHeaderText&&""===i.dataSourceSettings.valueSortSettings.columnHeaderText||i.setProperties({dataSourceSettings:{valueSortSettings:{headerText:"",rowHeaderText:"",columnHeaderText:""}}},!0),"pivot"===i.dataType&&(i.enableVirtualization||i.enablePaging)&&(a||r||n||s))a&&("Server"===e.dataSourceSettings.mode?i.getEngine("onSort",null,i.lastSortInfo,null,null,null,null):i.engineModule.onSort(i.lastSortInfo,i.dataSourceSettings),i.lastSortInfo={}),n&&("Server"===e.dataSourceSettings.mode?i.getEngine("onAggregation",null,null,i.lastAggregationInfo,null,null,null):i.engineModule.onAggregation(i.lastAggregationInfo,i.dataSourceSettings),i.lastAggregationInfo={}),s&&("Server"===e.dataSourceSettings.mode?i.getEngine("onCalcOperation",null,null,null,i.lastCalcFieldInfo,null,null):i.engineModule.onCalcOperation(i.lastCalcFieldInfo,i.dataSourceSettings),i.lastCalcFieldInfo={}),r&&("Server"===e.dataSourceSettings.mode?i.getEngine("onFilter",null,null,null,null,i.lastFilterInfo,null):i.engineModule.onFilter(i.lastFilterInfo,i.dataSourceSettings),i.lastFilterInfo={}),i.allowServerDataBinding=!1,i.setProperties({pivotValues:i.engineModule.pivotValues},!0),i.allowServerDataBinding=!0,"Server"!==i.dataSourceSettings.mode&&i.enginePopulatedEventMethod("updateDataSource");else if("olap"===i.dataType){var o={mode:"",savedFieldList:i.olapEngineModule.fieldList,savedFieldListData:i.olapEngineModule.fieldListData,pageSettings:i.pageSettings,enableValueSorting:i.enableValueSorting,isDrillThrough:i.allowDrillThrough||i.editSettings.allowEditing,localeObj:i.localeObj,enableVirtualization:e.enableVirtualization};s||a?(i.olapEngineModule.savedFieldList=i.olapEngineModule.fieldList,i.olapEngineModule.savedFieldListData=i.olapEngineModule.fieldListData,s?(i.olapEngineModule.updateCalcFields(i.dataSourceSettings,i.lastCalcFieldInfo),i.lastCalcFieldInfo={}):(i.olapEngineModule.onSort(i.dataSourceSettings),i.lastSortInfo={})):Hs.renderOlapEngine(i,o),i.allowServerDataBinding=!1,i.setProperties({pivotValues:i.olapEngineModule.pivotValues},!0),i.allowServerDataBinding=!0,i.enginePopulatedEventMethod("updateDataSource")}else{o={mode:"",savedFieldList:i.engineModule.fieldList,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:e.enablePaging,enableVirtualization:e.enableVirtualization,allowDataCompression:e.allowDataCompression,enableHtmlSanitizer:e.enableHtmlSanitizer,enableOptimizedRendering:e.enableVirtualization&&e.virtualscrollModule&&e.virtualScrollSettings.allowSinglePage,isTabularLayout:e.isTabular};"Server"===i.dataSourceSettings.mode?a?i.getEngine("onSort",null,i.lastSortInfo,null,null,null,null):n?i.getEngine("onAggregation",null,null,i.lastAggregationInfo,null,null,null):s?i.getEngine("onCalcOperation",null,null,null,i.lastCalcFieldInfo,null,null):r?i.getEngine("onFilter",null,null,null,null,i.lastFilterInfo,null):i.getEngine("onDrop",null,null,null,null,null,null):(i.engineModule.renderEngine(i.dataSourceSettings,o,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("updateDataSource")),i.lastSortInfo={},i.lastAggregationInfo={},i.lastCalcFieldInfo={},i.lastFilterInfo={}}})},l.prototype.refreshPageData=function(){var e={dataSourceSettings:Hs.getClonedDataSourceSettings(this.dataSourceSettings)};this.actionObj.actionName&&""!==this.actionObj.actionName&&this.actionBeginMethod(),this.showWaitingPopup(),this.trigger(Pi,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,!0),this.setProperties({pivotValues:this.engineModule.pivotValues},!0),this.enginePopulatedEventMethod("updateDataSource")),this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&""!==this.actionObj.actionName&&this.actionCompleteMethod()},l.prototype.excelExport=function(e,i,a,r){if(this.isBlobData=r,"Server"===this.dataSourceSettings.mode)this.getEngine("onExcelExport",null,null,null,null,null,null,null,null,e);else{if((0,t.isNullOrUndefined)(this.excelExportModule))return null;var n=e?e.pivotTableIds:void 0;if(n&&n.length&&i){var s=n.slice();return this.exportMultipleExcelPivotTable(s,e,i,a,r)}this.excelExportModule.exportToExcel("Excel",e,r),this.actionObj.actionName=this.getActionCompleteName();var o={exportInfo:{type:this.exportType,info:e}};this.actionObj.actionInfo=o,this.actionObj.actionName&&this.actionCompleteMethod()}return null},l.prototype.exportMultipleExcelPivotTable=function(e,i,a,r,n){var s=this;if(0!==e.length){var o=e.shift(),l=(0,t.select)("#"+o,document)?(0,t.getInstance)((0,t.select)("#"+o,document),d):void 0,p=l&&l.excelExportModule?this.excelExportModule.exportToExcel("Excel",i,n,r,a,l):null;if(!(0,t.isNullOrUndefined)(p))return p.then(function(t){return a=1!==e.length,s.exportMultipleExcelPivotTable(e,i,a,t,n)})}return null},l.prototype.exportAsPivot=function(e){"Server"===this.dataSourceSettings.mode&&("CSV"===e?this.getEngine("onPivotCsvExport",null,null,null,null,null,null,null,null,null,!0):this.getEngine("onPivotExcelExport",null,null,null,null,null,null,null,null,null,!0))},l.prototype.csvExport=function(e,i,a,r){if("Server"===this.dataSourceSettings.mode)this.getEngine("onCsvExport",null,null,null,null,null,null,null,null,e);else{if(this.enableVirtualization||this.enablePaging||this.allowEngineExport||this.allowConditionalFormatting&&this.dataSourceSettings.conditionalFormatSettings.length>0){if((0,t.isNullOrUndefined)(this.excelExportModule))return null;this.excelExportModule.exportToExcel("CSV",e,r)}else this.exportType="CSV",this.grid.csvExport(e,i,a,r);this.actionObj.actionName=this.getActionCompleteName();var n={exportInfo:{type:this.exportType,info:e}};this.actionObj.actionInfo=n,this.actionObj.actionName&&this.actionCompleteMethod()}},l.prototype.gridPdfExport=function(e,i,a,r){if((0,t.isNullOrUndefined)(this.pdfExportModule)&&"Server"!==this.dataSourceSettings.mode)return null;var n={pdfExportProperties:e,isMultipleExport:i,isBlob:r,pdfDoc:a,currentExportView:"Table",pdfMargins:{}},s=null;if(this.trigger(Ri,n),this.pdfExportModule&&(this.pdfExportModule.exportProperties=n),"Server"===this.dataSourceSettings.mode)s=this.grid.pdfExport(n.pdfExportProperties,n.isMultipleExport,n.pdfDoc,n.isBlob);else{var o=n&&n.pdfExportProperties?n.pdfExportProperties.pivotTableIds:void 0;if(o&&o.length&&n.isMultipleExport){var l=o.slice();s=this.exportMultiplePdfPivotTable(l,n.pdfExportProperties,n.isMultipleExport,n.pdfDoc,n.isBlob)}else s=this.pdfExportModule.exportToPDF(n.pdfExportProperties,n.isMultipleExport,n.pdfDoc,n.isBlob)}this.actionObj.actionName=this.getActionCompleteName();var d={exportInfo:{type:"PDF",info:e}};return this.actionObj.actionInfo=d,this.actionObj.actionName&&this.actionCompleteMethod(),s},l.prototype.exportMultiplePdfPivotTable=function(e,i,a,r,n){var s=this;if(0!==e.length){var o=e.shift(),l=(0,t.select)("#"+o,document)?(0,t.getInstance)((0,t.select)("#"+o,document),d):void 0;if(l.pdfExportModule)return l.pdfExportModule.exportProperties={pdfExportProperties:i,isMultipleExport:a,isBlob:n,pdfDoc:r,currentExportView:"Table",pdfMargins:{}},(l.pdfExportModule?l.pdfExportModule.exportToPDF(i,a,r,n,l):Promise.resolve({})).then(function(t){return a=1!==e.length,s.exportMultiplePdfPivotTable(e,i,a,t,n)})}return null},l.prototype.chartExport=function(e,i,r,n,s){var o,l={pdfExportProperties:i,isMultipleExport:r,isBlob:s,pdfDoc:n,type:e,currentExportView:"Chart",pdfMargins:{}};this.trigger(Ri,l),this.chartExportModule&&(this.chartExportModule.exportProperties=l);var d=l.fileName?l.fileName:(0,t.isNullOrUndefined)(i)||(0,t.isNullOrUndefined)(i.fileName)?"default":i.fileName;if("PDF"===e)o=this.chartExportModule.pdfChartExport(l.pdfExportProperties,l.pdfDoc,l.isMultipleExport,l.isBlob);else{var p=0===l.orientation||l.orientation?l.orientation:(0,t.isNullOrUndefined)(i)||(0,t.isNullOrUndefined)(i.pageOrientation)||"Landscape"===i.pageOrientation?a.PdfPageOrientation.Landscape:a.PdfPageOrientation.Portrait;o=this.chart.exportModule.export(l.type,d,p,null)}this.actionObj.actionName=this.getActionCompleteName();var h={exportInfo:{type:e,info:d}};return this.actionObj.actionInfo=h,this.actionObj.actionName&&this.actionCompleteMethod(),o},l.prototype.pdfExport=function(e,t,i,a,r){var n=this,s=null;return new Promise(function(o){if(r&&"Both"===n.displayOption.view){if("Chart"===n.displayOption.primary)n.chartExport("PDF",e,!0,i,!1).then(function(i){s=n.gridPdfExport(e,t,i,a),o(s)});else n.gridPdfExport(e,!0,i,!1).then(function(i){s=n.chartExport("PDF",e,t,i,a),o(s)})}else{var l=n.gridPdfExport(e,t,i,a);o(l)}})},l.prototype.printChart=function(){this.chart&&this.chart.print()},l.prototype.onDrill=function(e,i){var a=this,r=this.dataSourceSettings.drilledMembers[0]&&this.dataSourceSettings.drilledMembers[0].delimiter?this.dataSourceSettings.drilledMembers[0].delimiter:"**",n="",s="",o="";i?(n=i.fieldName,s=i.cell.axis,o=i.isDrilled?"up":"down"):(n="row"===(s=e.closest("td.e-rowsheader")?"row":"column")?(0,t.closest)(e,"td").getAttribute("fieldname"):(0,t.closest)(e,"th").getAttribute("fieldname"),o=e.classList.contains(Ve)?"up":"down");if("pivot"===this.dataType){var l=Hs.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers),d="row"===s?parseInt((0,t.closest)(e,"td").getAttribute("aria-colindex"),10)-1:parseInt((0,t.closest)(e,"th").getAttribute("aria-colindex"),10)-1,p=Number("row"===s?(0,t.closest)(e,"td").getAttribute("index"):(0,t.closest)(e,"th").getAttribute("index")),h=i?i.cell:this.engineModule.pivotValues[p][d],u=h.valueSort.levelName.split(this.engineModule.valueSortSettings.headerDelimiter).join(r),c=!1;if(0===this.dataSourceSettings.drilledMembers.length)this.setProperties({dataSourceSettings:{drilledMembers:[{name:n,items:[u],delimiter:r}]}},!0);else{for(var g=Hs.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers),m=0;m<g.length;m++){var f=g[m];if(u=u.split(r).join(f.delimiter?f.delimiter:r),r=f.delimiter=f.delimiter?f.delimiter:r,f.name===n){c=!0;var v=f.items.indexOf(u);v>-1?f.items.splice(v,1):f.items.push(u)}}this.setProperties({dataSourceSettings:{drilledMembers:g}},!0),c||this.dataSourceSettings.drilledMembers.push({name:n,items:[u],delimiter:r})}this.showWaitingPopup();var S=this,y={fieldName:n,memberName:u,delimiter:r,axis:s,action:o,currentCell:h},b={drillInfo:y,pivotview:S,cancel:!1};S.trigger(ea,b,function(t){if(t.cancel)a.hideWaitingPopup(),a.setProperties({dataSourceSettings:{drilledMembers:l}},!0);else{var i={dataSourceSettings:Hs.getClonedDataSourceSettings(a.dataSourceSettings)};if(S.trigger(Pi,i),S.setProperties({dataSourceSettings:i.dataSourceSettings},!0),S.enableVirtualization||S.enablePaging?"Server"===a.dataSourceSettings.mode?a.getEngine("onDrill",y,null,null,null,null,null):(S.engineModule.drilledMembers=S.dataSourceSettings.drilledMembers,S.engineModule.onDrill(y)):"Server"===a.dataSourceSettings.mode?a.getEngine("onDrill",y,null,null,null,null,null):S.engineModule.generateGridData(S.dataSourceSettings,!0),"Server"!==a.dataSourceSettings.mode){S.allowServerDataBinding=!1,S.setProperties({pivotValues:S.engineModule.pivotValues},!0),S.allowServerDataBinding=!0;var r={dataSourceSettings:Hs.getClonedDataSourceSettings(i.dataSourceSettings),pivotValues:a.pivotValues};a.trigger(Ei,r),S.engineModule.pivotValues=r.pivotValues;var n={drillInfo:y};a.actionObj.actionInfo=n,a.captureFocusInfo(e),S.renderPivotGrid(),setTimeout(function(){a.restoreFocusAfterRefresh()},100)}}})}else this.onOlapDrill(n,s,o,r,e,i)},l.prototype.onOlapDrill=function(e,i,a,r,n,s){var o,l=this,d=this,p=Hs.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers);if(s)o=s.cell;else{var h="row"===i?parseInt((0,t.closest)(n,"td").getAttribute("aria-colindex"),10)-1:parseInt((0,t.closest)(n,"th").getAttribute("aria-colindex"),10)-1,u=Number("row"===i?(0,t.closest)(n,"td").getAttribute("index"):(0,t.closest)(n,"th").getAttribute("index"));o=this.olapEngineModule.pivotValues[u][h]}var c="row"===i?this.olapEngineModule.tupRowInfo[o.ordinal]:this.olapEngineModule.tupColumnInfo[o.ordinal],g={axis:i,action:a,fieldName:e,delimiter:"~~",memberName:c.uNameCollection,currentCell:o};this.showWaitingPopup();var m={drillInfo:g,pivotview:d,cancel:!1},f=this.olapEngineModule.fieldList[g.fieldName]&&this.olapEngineModule.fieldList[g.fieldName].isHierarchy,v=c.drillInfo.map(function(e){return e.hierarchy}).indexOf(o.hierarchy.toString()),S=Hs.cloneDrillMemberSettings(this.dataSourceSettings.drilledMembers);if(g&&"down"===g.action){for(var y=c.drillInfo.map(function(e){return e.uName}),b="",C=0;C<=v;C++){b=b+(""!==b?"~~":"")+(q=(j=y[C]).split("~~"))[q.length-1]}for(var x=this.olapEngineModule.getDrilledSets(g.memberName,o,this.olapEngineModule.fieldList[o.hierarchy]&&!this.olapEngineModule.fieldList[o.hierarchy].hasAllMember?o.valueSort.levelName.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length-1:v,i),w=0,T=k=Object.keys(x);w<T.length;w++)for(var M=x[T[w]],D=0,O=S.length;D<O;D++){var N=S[D],P=M;N.delimiter&&(P=P.replace(/~~/g,N.delimiter));for(var E=[],I=0;I<N.items.length;I++)0!==N.items[I].indexOf(P)&&(E[E.length]=N.items[I]);N.items=E}this.olapEngineModule.drilledSets[o.actualText]=c.members[v],g.memberName=b;for(var F=[],L=0,A=S;L<A.length;L++){(j=A[L]).name===g.fieldName&&F.push(j)}if(F.length>0){if(F[0].delimiter&&(b=b.replace(/~~/g,F[0].delimiter)),-1===Hs.inArray(b,F[0].items)&&F[0].items.push(b),f)for(D=0;D<F[0].items.length;)F[0].items[D]===b?F[0].items.splice(D,1):++D}else if(!f){var R={name:g.fieldName,items:[b],delimiter:"~~"};S?S.push(R):S=[R]}m.drillInfo.memberName=b,this.setProperties({dataSourceSettings:{drilledMembers:S}},!0),d.trigger(ea,m,function(e){if(e.cancel)l.hideWaitingPopup(),l.setProperties({dataSourceSettings:{drilledMembers:p}},!0);else{var t={dataSourceSettings:Hs.getClonedDataSourceSettings(l.dataSourceSettings)};l.trigger(Pi,t),l.setProperties({dataSourceSettings:t.dataSourceSettings},!0),l.olapEngineModule.updateDrilledInfo(l.dataSourceSettings),l.allowServerDataBinding=!1,l.setProperties({pivotValues:l.olapEngineModule.pivotValues},!0),l.allowServerDataBinding=!0;var i={dataSourceSettings:Hs.getClonedDataSourceSettings(t.dataSourceSettings),pivotValues:d.olapEngineModule.pivotValues};l.trigger(Ei,i),l.olapEngineModule.pivotValues=i.pivotValues,l.renderPivotGrid()}})}else{delete this.olapEngineModule.drilledSets[o.actualText];x=this.olapEngineModule.getDrilledSets(g.memberName,o,v,i);var k=Object.keys(x);for(y=c.drillInfo.map(function(e){return e.uName}),b="",C=0;C<=v;C++){var j,q;b=b+(""!==b?"~~":"")+(q=(j=y[C]).split("~~"))[q.length-1]}for(var H=0,V=k;H<V.length;H++){M=x[V[H]];var U=[];for(D=0,O=S.length;D<O;D++){var B=M;if((F=S[D]).name===g.fieldName&&U.push(F),F.delimiter&&(B=M.replace(/~~/g,F.delimiter)),!f){for(E=[],I=0;I<F.items.length;I++)0!==F.items[I].indexOf(B)&&(E[E.length]=F.items[I]);F.items=E}}if(f)if(U.length>0){U[0].delimiter&&(b=b.replace(/~~/g,U[0].delimiter)),-1===Hs.inArray(b,U[0].items)&&U[0].items.push(b)}else{R={name:g.fieldName,items:[b],delimiter:"~~"};S?S.push(R):S=[R]}}for(var _=[],G=0,z=S;G<z.length;G++){var W=z[G];W.items.length>0&&_.push(W)}this.setProperties({dataSourceSettings:{drilledMembers:S}},!0),d.trigger(ea,m,function(e){if(e.cancel)l.hideWaitingPopup(),l.setProperties({dataSourceSettings:{drilledMembers:p}},!0);else{var t={dataSourceSettings:Hs.getClonedDataSourceSettings(l.dataSourceSettings)};l.trigger(Pi,t),l.setProperties({dataSourceSettings:t.dataSourceSettings},!0),l.setProperties({dataSourceSettings:{drilledMembers:_}},!0),l.olapEngineModule.updateDrilledInfo(l.dataSourceSettings),l.allowServerDataBinding=!1,l.setProperties({pivotValues:l.olapEngineModule.pivotValues},!0),l.allowServerDataBinding=!0;var i={dataSourceSettings:Hs.getClonedDataSourceSettings(t.dataSourceSettings),pivotValues:d.olapEngineModule.pivotValues};l.trigger(Ei,i),l.olapEngineModule.pivotValues=i.pivotValues,l.renderPivotGrid()}})}},l.prototype.onContentReady=function(){var e,i,a=(0,_s.getScrollBarWidth)();this.isPopupClicked=!1,this.showFieldList&&this.pivotFieldListModule&&"Server"!==this.dataSourceSettings.mode?(this.pivotFieldListModule.element.style.display="block",(0,Bs.hideSpinner)(this.pivotFieldListModule.fieldListSpinnerElement)):this.fieldListSpinnerElement&&(0,Bs.hideSpinner)(this.fieldListSpinnerElement),this.isEmptyGrid?this.pivotValues.length>0&&(this.isEmptyGrid=!1,this.notEmpty=!0):("Server"===this.dataSourceSettings.mode&&this.isServerWaitingPopup||"Local"===this.dataSourceSettings.mode)&&this.hideWaitingPopup();var r,n=this.element.querySelector("."+At)?this.element.querySelector("."+At):this.element.querySelector("."+R),s=this.element.querySelector("."+kt),o=this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage&&"pivot"===this.dataType;if(this.grid){var l=this.element.querySelector("."+Qt),d=n.parentElement.offsetWidth<n.querySelector("."+Be).offsetWidth,p="pivot"===this.dataType?this.engineModule:this.olapEngineModule;if(this.enableVirtualization&&p&&this.virtualscrollModule){if(o&&this.element.querySelector("."+Ci)&&((0,t.removeClass)([s,n],["e-virtual-pivot-content"]),(0,t.addClass)([this.element.querySelector("."+Ci)],[xi]),this.grid&&this.grid.element.querySelector(".e-spinner-inner")&&(0,t.removeClass)([this.grid.element.querySelector(".e-spinner-inner")],[xi])),o){var h=this.element.querySelector("."+Ci);if(h||(h=(0,t.createElement)("div",{className:Ci+" "+xi,innerHTML:this.localeObj.getConstant("loading")}),this.grid.element&&!this.element.querySelector("."+Ci)&&this.grid.element.insertBefore(h,this.grid.element.firstElementChild)),this.element.querySelector("."+Vt)&&this.element.querySelector("."+Qt)){var u=this.element.querySelector("."+Qt).offsetHeight+this.element.querySelector("."+Vt).offsetHeight;(0,t.setStyleAttribute)(h,{height:u+"px",width:this.element.querySelector("."+Vt).offsetWidth+"px",padding:Math.floor(u/2)+"px"})}}if(this.element.querySelector("."+R)&&!this.element.querySelector("."+R).querySelector("."+Ft)&&(this.virtualDiv=(0,t.createElement)("div",{className:Ft}),this.element.querySelector("."+R).appendChild(this.virtualDiv)),this.element.querySelector("."+kt)&&!this.element.querySelector("."+kt).querySelector("."+Ft)?(this.virtualHeaderDiv=(0,t.createElement)("div",{className:Ft}),this.element.querySelector("."+kt).appendChild(this.virtualHeaderDiv)):this.virtualHeaderDiv=this.element.querySelector("."+kt).querySelector("."+Ft),r=l.querySelector("."+Lt),l&&!r){this.virtualTableDiv=(0,t.createElement)("div",{className:Lt}),l.appendChild(this.virtualTableDiv),r=l.querySelector("."+Lt),this.virtualScrollDiv=(0,t.createElement)("div",{className:Rt}),r.appendChild(this.virtualScrollDiv),(0,t.setStyleAttribute)(r,{minHeight:0!==a?a:"15px",maxHeight:0!==a?a:"15px",overflowX:"scroll"}),(0,t.setStyleAttribute)(this.virtualScrollDiv,{height:"0.1px"});var c=(0,t.createElement)("div",{className:At});c.append.apply(c,Array.prototype.slice.call(n.childNodes)),n.appendChild(c),c.scrollLeft=0}var g=this.element.querySelector("."+R).querySelector("."+Be),m=this.gridSettings.rowHeight*p.rowCount+.1-g.clientHeight;m>this.scrollerBrowserLimit&&(this.verticalScrollScale=m/this.scrollerBrowserLimit,m=this.scrollerBrowserLimit),(i=this.gridSettings.columnWidth*p.columnCount)>this.scrollerBrowserLimit&&(this.horizontalScrollScale=i/this.scrollerBrowserLimit,i=this.scrollerBrowserLimit),(0,t.setStyleAttribute)(this.virtualDiv,{height:(m>.1?m:.1)+"px",width:(i>.1?i:.1)+"px"}),(0,t.setStyleAttribute)(this.virtualHeaderDiv,{height:0,width:(i>.1?i:.1)+"px"}),this.isAdaptive&&(n.style.minHeight="1px",n.style.minHeight="1px");var f=this.isAdaptive?n:l.querySelector("."+Lt)?l.querySelector("."+Lt):n;e=n.parentElement.scrollTop>this.scrollerBrowserLimit?n.querySelector("."+Be).style.transform.split(",")[1].trim():(o?n.parentElement.scrollTop:-(n.parentElement.scrollTop*this.verticalScrollScale-this.scrollPosObject.verticalSection-n.parentElement.scrollTop))+"px)",Number(e.split("px")[0])>this.virtualDiv.clientHeight&&(e=this.virtualDiv.clientHeight+"px)");var v=Math.abs(f.scrollLeft),S=v>this.scrollerBrowserLimit?n.querySelector("."+Be).style.transform.split(",")[0].trim()+",":"translate("+(this.enableRtl?1:-1)*(v*this.horizontalScrollScale-this.scrollPosObject.horizontalSection-v)+"px,";(0,t.setStyleAttribute)(n.querySelector("."+Be),{transform:S+e}),(0,t.setStyleAttribute)(s.querySelector("."+Be),{transform:S+0+"px)"}),!d&&l&&r||this.isAdaptive?r.style.display="none":r.style.display="block";var y=Number(-n.querySelector("."+Be).style.transform.split("(")[1].split(",")[0].split("px")[0]);if(this.virtualscrollModule.alignFreezedCells(y,!0),d){var b=0;b=this.pivotColumns.length<25?i+n.querySelector("."+Be).querySelector("."+bi).offsetWidth+(l.offsetWidth-l.clientWidth):i+(l.offsetWidth-l.clientWidth),"auto"!==this.grid.height?this.grid.element.querySelector("."+Rt).style.width=b+a+"px":this.grid.element.querySelector("."+Rt).style.width=b+"px"}this.grid.element.querySelector("."+At)&&n.parentElement.scrollHeight===n.scrollHeight&&(n.style.overflowY="");var C="pivot"===this.dataType&&"column"===this.dataSourceSettings.valueAxis?this.dataSourceSettings.values.length:1,x=this.pageSettings.columnPageSize*C*this.gridSettings.columnWidth,w=f.scrollWidth-(Math.abs(v)+f.offsetWidth);if(this.virtualscrollModule&&x>0&&w<=x&&v>0){var T=n.scrollWidth-(Math.abs(n.scrollLeft)+n.parentElement.offsetWidth),M=void 0;T<1&&"horizondal"===this.scrollDirection&&(n.parentElement.scrollTop>0&&(M=n.parentElement.scrollTop),this.virtualDiv.style.display="none",T=n.scrollWidth-(Math.abs(n.scrollLeft)+n.parentElement.offsetWidth)),this.virtualDiv.style.display="",M&&(n.parentElement.scrollTop=M);var D=n.scrollWidth-(Math.abs(n.scrollLeft)+n.parentElement.offsetWidth);T>1&&(this.scrollPosObject.horizontalSection-=w<=0?T>w?T:-D:D===T?T-w:T<D&&(w===D||w>T)?-(D-T):0,"auto"!==this.grid.height&&(this.scrollPosObject.horizontalSection-=a),this.scrollPosObject.horizontalSection=this.scrollPosObject.horizontalSection>=-this.element.querySelector("."+ft).querySelector("."+ze+"."+bi).offsetWidth?this.scrollPosObject.horizontalSection:-this.element.querySelector("."+ft).querySelector("."+ze+"."+bi).offsetWidth),S=v>this.scrollerBrowserLimit?n.querySelector("."+Be).style.transform.split(",")[0].trim()+",":"translate("+(this.enableRtl?1:-1)*(v*this.horizontalScrollScale-this.scrollPosObject.horizontalSection-v)+"px,",(0,t.setStyleAttribute)(n.querySelector("."+Be),{transform:S+e}),(0,t.setStyleAttribute)(s.querySelector("."+Be),{transform:S+0+"px)"}),y=Number(-n.querySelector("."+Be).style.transform.split("(")[1].split(",")[0].split("px")[0]),this.virtualscrollModule.alignFreezedCells(y,!0)}}if("Chart"!==this.currentView&&this.grid.hideScroll(),this.showGroupingBar){if(this.groupingBarModule&&this.element.querySelector("."+pe)&&(this.groupingBarModule.appendToElement(),this.renderModule.setValuePanelWidth()),this.actionObj.fieldInfo&&this.actionObj.fieldInfo.fieldName){var O=this.pivotButtonModule.parentElement.querySelector('[data-uid="'+this.actionObj.fieldInfo.fieldName+'"]');(0,t.isNullOrUndefined)(O)||O.focus()}this.element.style.minWidth=this.isAdaptive?this.minWidth?this.minWidth+"px":"310px":this.minWidth?this.minWidth+"px":"400px",this.grid.element.style.minWidth=this.isAdaptive?this.minWidth?this.minWidth+"px":"310px":this.minWidth?this.minWidth+"px":"400px"}else this.element.style.minWidth=this.minWidth?this.minWidth+"px":"310px",this.grid.element.style.minWidth=this.minWidth?this.minWidth+"px":"310px";this.showToolbar&&this.toolbarModule&&this.toolbarModule.toolbar&&this.gridSettings&&!this.gridSettings.allowAutoResizing&&(this.toolbarModule.toolbar.width=this.grid?this.getGridWidthAsNumber():this.getWidthAsNumber())}if(this.unwireEvents(),this.wireEvents(),this.isChartLoaded=!1,!this.isEmptyGrid){this.trigger(Bi);var N=document.getElementById(this.element.id+"containerwrapper");if(N&&"Both"===this.displayOption.view&&this.showFieldList&&this.element){var P=this.grid&&this.grid.element&&"none"!==this.grid.element.style.getPropertyValue("display"),E=this.chart&&this.chart.element&&"none"!==this.chart.element.style.getPropertyValue("display");if(P&&E){var I=this.showToolbar&&this.toolbarModule&&this.toolbarModule.toolbar&&this.toolbarModule.toolbar.element?this.toolbarModule.toolbar.element.offsetHeight:0,F=this.enablePaging&&this.pagerModule.pager&&this.pagerModule.pager.element?this.pagerModule.pager.element.offsetHeight:0,L=this.grid&&this.grid.element?this.grid.element.offsetHeight:0,A=0,k=0;this.showGroupingBar&&this.groupingBarModule&&(A=this.groupingBarModule.groupingTable?this.groupingBarModule.groupingTable.offsetHeight:0,k=this.groupingBarModule.groupingChartTable?this.groupingBarModule.groupingChartTable.offsetHeight:0);var j=I+A+L+F+(k+(this.chart&&this.chart.element?this.chart.element.offsetHeight:0));j>0&&(N.style.minHeight=j-2+"px")}else N.style.removeProperty("min-Height")}}if(this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&(this.actionObj.actionName===cs&&this.pivotCommon&&this.pivotCommon.filterDialog&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.pivotCommon.filterDialog.setFocus.bind(this.pivotCommon.filterDialog))),this.actionObj.actionName!==Tn&&this.actionObj.actionName!==Vr&&this.actionObj.actionName!==js&&this.actionCompleteMethod()),this.groupingModule&&(this.groupingModule.isUpdate=!1),this.engineModule&&this.engineModule.clearProperties(),this.virtualscrollModule&&this.grid&&this.virtualscrollModule.onHorizondalScroll(s,n,r),!this.isAdaptive&&this.enableVirtualization&&n&&this.virtualscrollModule&&!o){var q=n.parentElement.parentElement.querySelector(".e-movablescrolldiv");if(i<3*n.parentElement.clientWidth)n.style.overflowX="visible",q.style.display="none",s.scrollLeft=n.parentElement.scrollLeft,(0,t.setStyleAttribute)(n.querySelector("."+Be),{transform:"translate(0px,"+e}),(0,t.setStyleAttribute)(s.querySelector("."+Be),{transform:"translate(0px, 0px)"}),this.virtualscrollModule.alignFreezedCells(0,!0);else{t.EventHandler.remove(this.element.querySelector("."+Qt).querySelector("."+R),"scroll",this.headerScrollUpdate);var H=this.element.querySelector("."+Qt).querySelector("."+R).scrollLeft;n.style.overflowX="auto",q.style.display="block",0!==H&&(q.scrollLeft=H),q.scrollLeft!==n.scrollLeft&&0!==n.scrollLeft&&(q.scrollLeft=n.scrollLeft)}}this.isStaticRefresh=!1},l.prototype.setToolTip=function(e){var i,a,r=this,n=parseInt(e.target.getAttribute("aria-colindex"),10)-1,s=Number(e.target.getAttribute("index")),o=this.dataSourceSettings.values.length>0&&this.pivotValues&&this.pivotValues[s]&&this.pivotValues[s][n]?this.pivotValues[s][n]:void 0;this.tooltip.content="";var l=!1;if(o&&"olap"===this.dataType){var d=o.actualText;if(!(0,t.isNullOrUndefined)(d)&&this.olapEngineModule.fieldList&&!this.olapEngineModule.fieldList[d]){var p=this.olapEngineModule.tupRowInfo;d=o.rowOrdinal>-1&&p.length>0&&p[o.rowOrdinal]&&!(0,t.isNullOrUndefined)(p[o.rowOrdinal].measureName)?p[o.rowOrdinal].measureName:d}if(this.olapEngineModule.fieldList&&this.olapEngineModule.fieldList[d])i=(h=this.olapEngineModule.fieldList[d]).isCalculatedField?h.type:h.aggregateType,a=this.olapEngineModule.dataFields[d]&&this.olapEngineModule.dataFields[d].caption?this.olapEngineModule.dataFields[d].caption:h.caption,l=!0}else{var h;if(o&&this.engineModule.fieldList&&this.engineModule.fieldList[o.actualText])i="DistinctCount"===(i=(h=this.engineModule.fieldList[o.actualText]).aggregateType)||"number"===h.type&&"include"!==h.type&&"exclude"!==h.type?void 0===i?"Sum":h.aggregateType:"Count",a=h.caption,l=!0}if(o&&l){var u=this.isTabular&&this.engineModule.rowMaxLevel>0?this.engineModule.rowMaxLevel:0,c=this.getRowText(s,u),g=this.getColText(0,n,s),m=""===o.formattedText?this.localeObj.getConstant("noValue"):o.formattedText;if(this.tooltipTemplate&&void 0!==this.getTooltipTemplate()){var f={rowHeaders:c,columnHeaders:g,aggregateType:i,valueField:a,value:m,rowFields:this.getHeaderField(s,n,"row"),columnFields:this.getHeaderField(s,n,"column")};if("function"==typeof this.tooltipTemplate&&this.isReact){var v=document.createElement("div");this.getTooltipTemplate()(f,this,"tooltipTemplate",this.element.id+"tooltipTemplate",null,null,v),this.renderReactTemplates(function(){r.enableHtmlSanitizer?r.tooltip.content=t.SanitizeHtmlHelper.sanitize(v.outerHTML):r.tooltip.content=v.outerHTML})}else{var S=this.getTooltipTemplate()(f,this,"tooltipTemplate",this.element.id+"tooltipTemplate")[0].outerHTML;this.enableHtmlSanitizer?this.tooltip.content=t.SanitizeHtmlHelper.sanitize(S):this.tooltip.content=S}}else{var y=this.grid.getColumns()[n];g=y.disableHtmlEncode?this.encodeHtml(g):g,c=y.disableHtmlEncode?this.encodeHtml(c):c;var b="<div class=e-pivottooltip><p class="+Qe+">"+this.localeObj.getConstant("row")+":</p><p class="+Ye+">"+c+"</p></br><p class="+Qe+">"+this.localeObj.getConstant("column")+":</p><p class="+Ye+">"+g+"</p></br>"+(""!==o.actualText?"<p class="+Qe+">"+("olap"===this.dataType?"":this.localeObj.getConstant(i)+" "+this.localeObj.getConstant("of")+" ")+a+":</p><p class="+Ye+">"+m+"</p></div>":"");this.tooltip.content=(0,t.initializeCSPTemplate)(function(){return b})}}else e.cancel=!0},l.prototype.encodeHtml=function(e){var i=(0,t.createElement)("div");return i.innerText=e,i.innerHTML},l.prototype.getTooltipTemplate=function(){return this.tooltipTemplateFn},l.prototype.getHeaderField=function(e,t,i){var a,r="",n="olap"===this.dataType?this.olapEngineModule:this.engineModule,s=n.valueSortSettings.headerDelimiter;if("row"===i){a=this.pivotValues[e][0].valueSort.levelName.toString().split(s).length;for(var o=0;o<a&&this.dataSourceSettings.rows.length>0&&this.dataSourceSettings.rows[o];o++)r+=(o?" - ":"")+(this.dataSourceSettings.rows[o].caption?this.dataSourceSettings.rows[o].caption:this.dataSourceSettings.rows[o].name)}else{if(this.dataSourceSettings.columns.length>0){var l=0===this.dataSourceSettings.values.length?0:Number(Object.keys(n.headerContent)[Object.keys(n.headerContent).length-1]);a=this.pivotValues[l][t].valueSort.levelName.toString().split(s).length,a=this.dataSourceSettings.values.length>1?a-1:a}for(var d=0;d<a&&this.dataSourceSettings.columns.length>0&&this.dataSourceSettings.columns[d];d++)r+=(d?" - ":"")+(this.dataSourceSettings.columns[d].caption?this.dataSourceSettings.columns[d].caption:this.dataSourceSettings.columns[d].name)}return r},l.prototype.getLevel=function(e){var t=e.valueSort?e.valueSort.levelName.toString():"",i=e.actualText?e.actualText.toString().split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,a=t.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).length-(i?i-1:i);return a?a-1:0},l.prototype.getRowText=function(e,i){var a=this.pivotValues[e][i],r="";if(a){var n=this.getLevel(a);if(this.isTabular&&(0===n||this.engineModule&&n!==this.engineModule.rowMaxLevel)&&(i=n,a=this.pivotValues[e][i]),r="grand sum"===a.type?this.localeObj.getConstant("grandTotal"):a.formattedText,"row"===this.dataSourceSettings.valueAxis)r=(r=0===this.dataSourceSettings.rows.length&&this.dataSourceSettings.values.length>1?this.pivotValues[e][0].valueSort.levelName.toString().slice((this.localeObj.getConstant("grandTotal")+this.dataSourceSettings.valueSortSettings.headerDelimiter).length).toString():1===this.dataSourceSettings.values.length?(0,t.isNullOrUndefined)(this.dataSourceSettings.values[0].caption)?this.dataSourceSettings.values[0].name:this.dataSourceSettings.values[this.isTabular?i:0].caption:this.pivotValues[e][this.isTabular?i:0].valueSort.levelName.toString()).split(this.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - ");else if(this.isTabular)for(;n>0;)i--,a=this.pivotValues[e][i],r=r+this.dataSourceSettings.valueSortSettings.headerDelimiter+a.formattedText,n-=1;else for(;n>0||a&&void 0===a.index;)e--,(a=this.pivotValues[e][i])&&n>a.level&&(r=r+this.dataSourceSettings.valueSortSettings.headerDelimiter+a.formattedText,n-=1);r=r.split(this.dataSourceSettings.valueSortSettings.headerDelimiter).reverse().join(" - ")}return r},l.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&&i>e;)e++,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},l.prototype.updateClass=function(){this.enableRtl?(0,t.addClass)([this.element],n):(0,t.removeClass)([this.element],n),this.isAdaptive?(0,t.addClass)([this.element],s):(0,t.removeClass)([this.element],s),this.cssClass&&(0,t.addClass)([this.element],this.cssClass.split(" "))},l.prototype.mouseRclickHandler=function(e){(3===e.which||0===e.which)&&(this.lastCellClicked=e.target),this.lastCellClicked=e.target},l.prototype.mouseDownHandler=function(e){3===e.which&&(this.lastCellClicked=e.target),this.isCellBoxMultiSelection&&(this.isMouseDown=!e.target.closest("."+A),this.isMouseUp=!1,this.lastSelectedElement=void 0)},l.prototype.mouseMoveHandler=function(e){var i=this;if(this.isCellBoxMultiSelection){e.preventDefault();var a=e.target?e.target:void 0;if(this.isMouseDown&&a&&!a.classList.contains("e-expand")&&!a.classList.contains("e-collapse")){var r=a.parentElement.classList.contains(Ge)||a.classList.contains(Ge)?"row":"column";if(a="column"===r?(0,t.closest)(a,"th"):(0,t.closest)(a,"td")){var n=parseInt(a.getAttribute("aria-colindex"),10)-1,s=Number(a.getAttribute("index")),o={cancel:!1,isCellClick:!0,currentCell:a,data:this.pivotValues[s][n]};this.trigger($i,o,function(e){if(!e.cancel){i.grid.clearSelection();var t=i.parentAt(a,"TH");i.lastSelectedElement&&i.lastSelectedElement!==t&&t.classList.contains(qt)?(i.lastSelectedElement.classList.remove(_t),i.lastSelectedElement.classList.remove(qt),i.lastSelectedElement=t):(i.lastSelectedElement=t,t.classList.contains(ze)&&t.classList.contains(bi)||(t.classList.add(_t),t.classList.add(qt))),i.renderModule.selected()}})}}}},l.prototype.mouseUpHandler=function(){this.isCellBoxMultiSelection&&(this.isMouseDown=!1,this.isMouseUp=!0)},l.prototype.parentAt=function(e,t){for(;e.tagName!==t&&e.parentElement;)e=e.parentElement;return e},l.prototype.mouseClickHandler=function(e){(3===e.which||0===e.which)&&(this.lastCellClicked=e.target);var i=e.target;if(!(0,t.closest)(i,"."+A)){var a=null,r=i.closest("td.e-rowsheader"),n=i.closest("td.e-valuescontent"),s=r||n?"row":"column";if(a="column"===s?(0,t.closest)(i,"th"):(0,t.closest)(i,"td"),"column"!==s||a||"Row"===this.gridSettings.selectionSettings.mode||(a=(0,t.closest)(i,"td")),i.classList.contains(Ve)||i.classList.contains(Ue)||!this.enableValueSorting||i.classList.contains("e-resized")||i.classList.contains("e-rhandler")&&i.classList.contains("e-rcursor")||"olap"===this.dataType&&this.enableVirtualization){if(!i.classList.contains(Ve)&&!i.classList.contains(Ue))return void this.cellClicked(i,a,e);var o=i.parentElement.getAttribute("fieldname"),l=(c=Hs.getFieldInfo(o,this),i.classList.contains(Ve)?this.actionObj.actionName=Or:i.classList.contains(Ue)?this.actionObj.actionName=Nr:"");if(this.actionObj.actionName=l,this.actionObj.fieldInfo=c.fieldItem,this.actionBeginMethod())return;try{this.onDrill(i)}catch(e){M=e instanceof Error?e:new Error("Unknown error");this.actionFailureMethod(M)}}else{var d="pivot"===this.dataType?this.engineModule:this.olapEngineModule;this.cellClicked(i,a,e);var p=a&&!(0,t.isNullOrUndefined)(a.closest("."+Vt)),h=a&&(!(0,t.isNullOrUndefined)(a.closest(".e-row"))||a.classList.contains("e-rowsheader"));try{if(a&&(p||h)&&"olap"!==this.dataType&&"Server"!==this.dataSourceSettings.mode||("olap"===this.dataType||"Server"===this.dataSourceSettings.mode)&&(p&&"column"===this.dataSourceSettings.valueAxis&&!a.classList.contains(bi)||h&&"row"===this.dataSourceSettings.valueAxis)){if((!(0,t.isNullOrUndefined)(r)||p)&&(0,t.isNullOrUndefined)(n)){var u=a.getAttribute("fieldname"),c=Hs.getFieldInfo(u,this);if(this.actionObj.actionName=Dr,this.actionObj.fieldInfo=c.fieldItem,this.actionBeginMethod())return}var g=parseInt(a.getAttribute("aria-colindex"),10)-1,m=Number(a.getAttribute("index"));if("row"===this.dataSourceSettings.valueAxis&&(this.dataSourceSettings.values.length>1||this.dataSourceSettings.alwaysShowValueHeader)&&h){var f=this.pivotValues[m][g];if(-1===this.dataSourceSettings.valueIndex&&h&&!this.isTabular&&"Bottom"!==this.dataSourceSettings.subTotalsPosition)m="value"===f.type||3===f.memberType?m:m+1;else m=this.getLevel(f)<=d.measureIndex&&f.members&&f.members.length>0?f.members[0].rowIndex:m}else"column"===this.dataSourceSettings.valueAxis&&(this.dataSourceSettings.values.length>1||this.dataSourceSettings.alwaysShowValueHeader)&&p&&(g=parseInt(a.getAttribute("aria-colindex"),10)-1+Number(a.getAttribute("aria-colspan"))-1,m=d.headerContent.length-1);if("pivot"===this.dataType&&"Server"!==this.dataSourceSettings.mode&&(p||h)){var v=this.pivotValues[m][g],S=h&&this.isTabular&&("row"===this.dataSourceSettings.valueAxis&&"value"===v.type||"column"===this.dataSourceSettings.valueAxis);if(h&&(!this.isTabular||S)||p){var y=p?{columnIndex:Number(a.getAttribute("aria-colindex"))+Number(a.getAttribute("aria-colspan"))-1,columnHeaderText:this.pivotValues[m][g].valueSort.levelName,columnSortOrder:"Descending"===this.dataSourceSettings.valueSortSettings.columnSortOrder?"Ascending":"Descending"}:{rowIndex:Number(a.getAttribute("index"))+Number(a.getAttribute("aria-rowspan"))-1,rowSortOrder:"Descending"===this.dataSourceSettings.valueSortSettings.rowSortOrder?"Ascending":"Descending",rowHeaderText:this.pivotValues[m][g].valueSort.levelName};y.headerDelimiter=this.dataSourceSettings.valueSortSettings.headerDelimiter?this.dataSourceSettings.valueSortSettings.headerDelimiter:".",this.setProperties({dataSourceSettings:{valueSortSettings:y}},!0)}}else"olap"!==this.dataType&&"Server"!==this.dataSourceSettings.mode||this.setProperties({dataSourceSettings:{valueSortSettings:{columnIndex:Number(a.getAttribute("aria-colindex"))+Number(a.getAttribute("aria-colspan"))-1,sortOrder:"Descending"===this.dataSourceSettings.valueSortSettings.sortOrder?"Ascending":"Descending",headerText:this.pivotValues[m][g].valueSort.levelName,headerDelimiter:this.dataSourceSettings.valueSortSettings.headerDelimiter?this.dataSourceSettings.valueSortSettings.headerDelimiter:"."}}},!0);this.showWaitingPopup();var b=this;if(d.enableValueSorting=!0,b.enableVirtualization||b.enablePaging){if(b.dataSourceSettings.enableSorting){for(var C=0,x=Object.keys(b.engineModule.fieldList);C<x.length;C++){var w=x[C];b.engineModule.fieldList[w].sort="Ascending"}b.setProperties({dataSourceSettings:{sortSettings:[]}},!0)}"Server"===b.dataSourceSettings.mode?b.getEngine("onValueSort",null,null,null,null,null,null):(b.engineModule.rMembers=b.engineModule.headerCollection.rowHeaders,b.engineModule.cMembers=b.engineModule.headerCollection.columnHeaders,b.engineModule.applyValueSorting(),b.engineModule.updateEngine())}else"Server"===b.dataSourceSettings.mode?b.getEngine("onValueSort",null,null,null,null,null,null):"olap"===this.dataType?b.olapEngineModule.onSort(b.dataSourceSettings,!0):b.engineModule.generateGridData(b.dataSourceSettings,!0);b.allowServerDataBinding=!1,b.setProperties({pivotValues:d.pivotValues},!0),b.allowServerDataBinding=!0;var T={valueSortInfo:d.valueSortSettings};this.actionObj.actionInfo=T,b.renderPivotGrid()}}catch(e){var M=e instanceof Error?e:new Error("Unknown error");this.actionFailureMethod(M)}}}},l.prototype.captureFocusInfo=function(e){var t=e.closest("td."+Pe+"."+Ne)||e.closest("th."+Pe);if(t){var i=this.grid.focusModule,a=Number(t.getAttribute("index")),r=Number(t.getAttribute("aria-colindex")),n=t.getAttribute("fieldname")||"",s=[],o=i.getContent();o&&o.matrix&&o.matrix.current&&(s=o.matrix.current),this.focusedCellInfo={rowIndex:a,colIndex:r,fieldName:n,matrix:s}}},l.prototype.restoreFocusAfterRefresh=function(){if(this.focusedCellInfo){var e=this.focusedCellInfo,i=this.element.querySelector('[index="'+e.rowIndex+'"][aria-colindex="'+e.colIndex+'"]');if(i){var a=this.element.querySelector("th."+bi+"."+Pe+"."+Ne);a&&(0,t.removeClass)([a],[Ne,Pe]);var r=this.grid.focusModule;if(i.focus(),!i.classList.contains(Ne)){(0,t.addClass)([i],[Ne,Pe]),r.setActive("TD"===i.tagName);var n=r.getContent();n&&n.matrix&&n.matrix.current&&(n.matrix.current=this.focusedCellInfo.matrix)}r.currentInfo=Il({},r.currentInfo,{element:i,elementToFocus:i})}this.focusedCellInfo=null}},l.prototype.updateTotColWidth=function(){this.totColWidth=0;for(var e=0,t=this.pivotColumns;e<t.length;e++){var i=t[e];this.totColWidth=this.totColWidth+i.width}},l.prototype.framePivotColumns=function(e){for(var t=0,i=e;t<i.length;t++){var a=i[t];if(a.columns&&a.columns.length>0)this.framePivotColumns(a.columns);else{var r="0.formattedText"===a.field?"":a.customAttributes&&a.customAttributes.cell&&a.customAttributes.cell.valueSort?a.customAttributes.cell.valueSort.levelName:"",n=this.renderModule.setSavedWidth("0.formattedText"===a.field?a.field:r,Number("auto"===a.width?a.minWidth:a.width));this.pivotColumns.push({allowReordering:a.allowReordering,allowResizing:a.allowResizing,headerText:r,width:n,autoFit:a.autoFit}),this.totColWidth=this.totColWidth+Number(n)}}},l.prototype.setGridColumns=function(e){if(!(0,t.isNullOrUndefined)(this.totColWidth)&&this.totColWidth>0||this.renderModule.isAutoFitEnabled){for(var i=0,a=e;i<a.length;i++){var r=a[i];if(r.columns&&r.columns.length>0)this.setGridColumns(r.columns);else if(this.renderModule.isAutoFitEnabled)r.autoFit=this.pivotColumns[this.posCount].autoFit,this.posCount++;else{var n="0.formattedText"===r.field?"":r.customAttributes?r.customAttributes.cell.valueSort.levelName:"",s=(0,t.isNullOrUndefined)(r.customAttributes)&&""===r.headerText?r.field:n;r.allowReordering=this.pivotColumns[this.posCount].allowReordering,r.allowResizing=this.pivotColumns[this.posCount].allowResizing,r.autoFit=this.pivotColumns[this.posCount].autoFit;var o=this.renderModule.setSavedWidth(s,Number(this.pivotColumns[this.posCount].width));r.autoFit?this.renderModule.isAutoFitEnabled=!0:"auto"!==r.width?r.width=o:r.minWidth=o,this.posCount++,r.allowReordering&&(this.gridSettings.allowReordering=!0),r.allowResizing&&(this.gridSettings.allowResizing=!0)}}this.gridSettings.allowReordering&&_s.Grid.Inject(_s.Reorder),this.gridSettings.allowResizing&&_s.Grid.Inject(_s.Resize)}},l.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&&a.columns.length>0&&this.fillGridColumns(a.columns)}},l.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(Xi,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)},l.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?this.firstColWidth:r.width:"0.formattedText"!==r.field?r.columns?this.setCommonColumnsWidth(r.columns,t):this.setColumnWidth(r,t):r.width=this.firstColWidth?this.firstColWidth:r.width}},l.prototype.getHeightAsNumber=function(){var e,t;return isNaN(this.height)?this.height.toString().indexOf("%")>-1?(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)):this.height.toString().indexOf("px")>-1&&(e=Number(this.height.toString().split("px")[0])):e=Number(this.height),(e<this.minHeight||"auto"===this.height)&&(e=this.minHeight),e},l.prototype.getWidthAsNumber=function(){var e;return isNaN(this.width)?(this.width.toString().indexOf("%")>-1?e=parseFloat(this.width.toString())/100*this.element.offsetWidth:this.width.toString().indexOf("px")>-1&&(e=Number(this.width.toString().split("px")[0])),isNaN(e)&&(e=this.element.offsetWidth)):e=Number(this.width),e<400&&!this.isAdaptive?e=this.minWidth?this.minWidth:400:this.isAdaptive&&e<310&&(e=this.minWidth?this.minWidth:310),e},l.prototype.getGridWidthAsNumber=function(){var e,t=this.element.offsetWidth?this.element.offsetWidth:this.element.getBoundingClientRect().width;return isNaN(this.grid.width)?(this.grid.width.toString().indexOf("%")>-1?e=parseFloat(this.grid.width.toString())/100*t:this.grid.width.toString().indexOf("px")>-1&&(e=Number(this.grid.width.toString().split("px")[0])),isNaN(e)&&(e=t)):e=Number(this.grid.width),e},l.prototype.onWindowResize=function(){this.actionObj.actionName=Tn,this.isWindowResized=!0,this.actionBeginMethod()||(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.layoutRefresh.bind(this),500),this.actionObj.actionName=this.getActionCompleteName(),this.actionObj.actionName&&this.actionCompleteMethod())},l.prototype.refresh=function(){this.pivotRefresh()},l.prototype.layoutRefresh=function(){if(this.element&&this.element.classList.contains("e-pivotview")){if(this.grid){var e="olap"===this.dataType?this.olapEngineModule&&(this.olapEngineModule.pivotValues||[]):this.engineModule&&(this.engineModule.pivotValues||[]),i=(e[0]||[]).length>1?e[0].length:2,a="olap"===this.dataType?this.olapEngineModule&&!(0,t.isNullOrUndefined)(this.olapEngineModule.isEmptyData)&&this.olapEngineModule.isEmptyData:this.engineModule&&!(0,t.isNullOrUndefined)(this.engineModule.isEmptyData)&&this.engineModule.isEmptyData,r=this.renderModule.calculateColWidth(i);(a||0===e.length||"pivot"===this.dataType&&0===this.dataSourceSettings.values.length)&&(r-=3),this.setCommonColumnsWidth(this.grid.columns,r),this.triggerColumnRenderEvent(this.grid.columns),this.grid.width=this.renderModule.calculateGridWidth(),this.renderModule.calculateGridHeight(!0),this.grid.refreshColumns(),this.renderModule.isAutoFitEnabled?this.renderModule.addPivotAutoFitClass():this.renderModule.removePivotAutoFitClass(),this.showGroupingBar&&this.groupingBarModule&&this.element.querySelector("."+pe)&&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.toolbarModule.toolbar.element.style.minWidth=this.toolbarModule.toolbar.width-2+"px"),this.enablePaging&&this.notify(wr,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().toString():this.getWidthAsNumber().toString(),this.chart.height=this.pivotChartModule.getResizedChartHeight(),"Chart"===this.displayOption.view&&this.showGroupingBar&&this.groupingBarModule&&this.element.querySelector("."+li)&&this.groupingBarModule.refreshUI())}},l.prototype.cellClicked=function(e,i,a){var r=this;if(e.classList.contains(zt)&&(e.classList.contains(Gt)?this.isPopupClicked=!1:this.isPopupClicked=!0),i&&!(0,t.isNullOrUndefined)(this.pivotValues)&&this.pivotValues.length>0){var n=parseInt(i.getAttribute("aria-colindex"),10)-1,s=Number(i.getAttribute("index")),o=Number(i.getAttribute("aria-colspan")),l={cancel:!1,isCellClick:!0,currentCell:i,data:this.pivotValues[s][n]};this.trigger($i,l,function(e){!r.gridSettings.allowSelection||r.gridSettings.selectionSettings&&r.gridSettings.selectionSettings.enableSimpleMultiRowSelection||(("Both"===r.gridSettings.selectionSettings.mode?i.classList.contains(Bt):"Row"===r.gridSettings.selectionSettings.mode)?r.clearSelection(i,a):e.cancel||(r.clearSelection(i,a),r.applyColumnSelection(a,i,n,n+(o>0?o-1:0),s)),"Column"===r.gridSettings.selectionSettings.mode||i.classList.contains(_e)||r.rowDeselect(i,a,s,r.gridSettings.selectionSettings.mode,e),"Column"===r.gridSettings.selectionSettings.mode||e.cancel||(("Multiple"===r.gridSettings.selectionSettings.type?a.ctrlKey||a.shiftKey:r.selectedRowIndex===s)?(r.selectedRowIndex=void 0,r.setProperties({gridSettings:{selectedRowIndex:void 0}},!0)):(r.selectedRowIndex=s,r.setProperties({gridSettings:{selectedRowIndex:s-1}},!0),r.grid.selectionModule.selectRow(s-r.renderModule.rowStartPos),i.classList.add(Ne)))),r.cellClick&&e.isCellClick&&r.trigger(Yi,{currentCell:i,data:r.pivotValues[s][n],nativeEvent:a}),r.getSelectedCellsPos()})}else this.clearSelection(null,a)},l.prototype.rowDeselect=function(e,i,a,r,n){if(!i.shiftKey&&!i.ctrlKey&&"Both"!==this.gridSettings.selectionSettings.mode||"Single"===this.gridSettings.selectionSettings.type)if(e.classList.contains(jt)||e.classList.contains(qt)||e.classList.contains(_t)){if((0,t.removeClass)(this.element.querySelectorAll("."+jt),jt),(0,t.removeClass)(this.element.querySelectorAll("."+qt),qt),(0,t.removeClass)(this.element.querySelectorAll("."+_t),_t),n.cancel)this.setSavedSelectedCells();else if("Cell"===r)(0,t.addClass)([e],[jt]);else if("Row"===r||"Single"===this.gridSettings.selectionSettings.type){var s='[index="'+a+'"]';(0,t.addClass)(this.element.querySelectorAll(s),[qt,_t]),"Row"!==r&&e.classList.add(jt)}}else n.cancel?this.setSavedSelectedCells():((0,t.removeClass)(this.element.querySelectorAll("."+jt),jt),(0,t.removeClass)(this.element.querySelectorAll("."+qt),qt),(0,t.removeClass)(this.element.querySelectorAll("."+_t),_t));else(i.shiftKey||i.ctrlKey||"Both"===this.gridSettings.selectionSettings.mode)&&n.cancel&&((0,t.removeClass)(this.element.querySelectorAll("."+jt),jt),(0,t.removeClass)(this.element.querySelectorAll("."+qt),qt),(0,t.removeClass)(this.element.querySelectorAll("."+_t),_t),this.setSavedSelectedCells())},l.prototype.clearSelection=function(e,i){if(!i.shiftKey&&!i.ctrlKey||"Single"===this.gridSettings.selectionSettings.type){if("Cell"===this.gridSettings.selectionSettings.mode)e&&e.classList.contains(_e)?(0,t.removeClass)(this.element.querySelectorAll("."+Bt+"."+jt),jt):(0,t.removeClass)(this.element.querySelectorAll("."+_e+"."+_t),[_t,qt]);else if("Both"===this.gridSettings.selectionSettings.mode)if(e&&e.classList.contains(Bt))for(var a=0,r=[].slice.call(this.element.querySelectorAll("."+qt+", ."+jt));a<r.length;a++){var n=r[a];(0,t.removeClass)([n],[_t,qt,jt])}else(0,t.removeClass)(this.element.querySelectorAll("."+jt),jt)}else if("Both"===this.gridSettings.selectionSettings.mode&&"Multiple"===this.gridSettings.selectionSettings.type&&e.classList.contains(Ge))for(var s=0,o=[].slice.call(this.element.querySelectorAll("."+_e+"."+qt));s<o.length;s++){var l=o[s],d=Number(l.getAttribute("aria-colindex"));if(d&&!isNaN(d))for(var p=0,h=[].slice.call(this.element.querySelectorAll("[aria-colindex='"+d+"']:not(."+_t+")"));p<h.length;p++){var u=h[p];(0,t.addClass)([u],[_t,qt])}}},l.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,this.setProperties({gridSettings:{selectedRowIndex:void 0}},!0);else{this.selectedRowIndex=t,this.setProperties({gridSettings:{selectedRowIndex:t-1}},!0);var r=a.level,n=t;do{n++,a=this.engineModule.pivotValues[n][e]}while(a&&r<a.level);var s=this;this.isAdaptive?this.rowRangeSelection={enable:!0,startIndex:t-s.renderModule.rowStartPos,endIndex:n-(1+s.renderModule.rowStartPos)}:s.grid.selectionModule.selectRowsByRange(t-s.renderModule.rowStartPos,n-(1+s.renderModule.rowStartPos))}},l.prototype.applyColumnSelection=function(e,i,a,r,n){if(!i.classList.contains(Ge)&&("Cell"!==this.gridSettings.selectionSettings.mode||i.classList.contains(_e))){var s=e.ctrlKey;this.isAdaptive&&"Multiple"===this.gridSettings.selectionSettings.type&&(this.grid.selectionModule.showPopup(e),this.isPopupClicked?(this.element.querySelector("."+zt).classList.add(Gt),s=!0):(this.element.querySelector("."+zt).classList.remove(Gt),s=!1));for(var o=[],l=this.gridSettings.selectionSettings.type,d=i.classList.contains(_t),p=[],h={},u=a;u<=r;u++)p.push(u.toString());if(s&&"Single"!==l)d=!1;else{for(var c=0,g=[].slice.call(this.element.querySelectorAll("."+_t+", ."+qt));c<g.length;c++){var m=g[c];(0,t.removeClass)([m],[_t,qt]),-1===p.indexOf((parseInt(m.getAttribute("aria-colindex"),10)-1).toString())&&(d=!1);var f=parseInt(m.getAttribute("aria-colindex"),10)-1;h[f]=f}p=Object.keys(h).length>0?Object.keys(h).sort(function(e,t){return parseInt(e,10)-parseInt(t,10)}):p}"Multiple"===l&&e.shiftKey?(this.shiftLockedPos=0===this.shiftLockedPos.length?p:this.shiftLockedPos,Number(this.shiftLockedPos[0])<=a?a=Number(this.shiftLockedPos[0]):r=r<Number(this.shiftLockedPos[this.shiftLockedPos.length-1])?Number(this.shiftLockedPos[this.shiftLockedPos.length-1]):r):this.shiftLockedPos=[];var v=[];if(e.ctrlKey&&"Both"===this.gridSettings.selectionSettings.mode&&"Multiple"===l&&!i.classList.contains(Ge))for(var S=0,y=[].slice.call(this.element.querySelectorAll("."+Ge+"."+jt+",."+Ge+"."+qt));S<y.length;S++){m=y[S];v.push(m.getAttribute("index"))}for(var b=a;b<=r;)o.push('[aria-colindex="'+(b+1)+'"]'+("Cell"===this.gridSettings.selectionSettings.mode?'[index="'+n+'"]':"")),b++;if(!d){n=i.classList.contains(ze)?n:this.renderModule.rowStartPos-1;for(var C=i.classList.contains(_t),x=0,w=[].slice.call(this.element.querySelectorAll(o.toString()));x<w.length;x++){m=w[x];Number(m.getAttribute("index"))>=n&&(C&&s&&-1===v.indexOf(m.getAttribute("index"))?(0,t.removeClass)([m],[_t,qt]):(0,t.addClass)([m],[_t,qt]))}}this.renderModule.selected()}},l.prototype.getSelectedCellsPos=function(){var e=this;e.savedSelectedCellsPos=[],e.cellSelectionPos=[];for(var t=0,i=[].slice.call(this.element.querySelectorAll("."+qt));t<i.length;t++){var a=i[t];e.savedSelectedCellsPos.push({rowIndex:a.getAttribute("index"),colIndex:(parseInt(a.getAttribute("aria-colindex"),10)-1).toString()})}for(var r=0,n=[].slice.call(this.element.querySelectorAll("."+jt));r<n.length;r++){a=n[r];e.cellSelectionPos.push({rowIndex:a.getAttribute("index"),colIndex:(parseInt(a.getAttribute("aria-colindex"),10)-1).toString()})}},l.prototype.setSavedSelectedCells=function(){for(var e=0,i=[].slice.call(this.savedSelectedCellsPos);e<i.length;e++){var a=i[e],r='[aria-colindex="'+(parseInt(a.colIndex,10)+1)+'"][index="'+a.rowIndex+'"]';(0,t.addClass)([this.element.querySelector(r)],[_t,qt])}for(var n=0,s=[].slice.call(this.cellSelectionPos);n<s.length;n++){a=s[n],r='[aria-colindex="'+(parseInt(a.colIndex,10)+1)+'"][index="'+a.rowIndex+'"]';(0,t.addClass)([this.element.querySelector(r)],[jt])}},l.prototype.renderEmptyGrid=function(){var e=this;if(this.isEmptyGrid=!0,this.notEmpty=!1,this.isInitial=!0,this.renderModule=this.renderModule?this.renderModule:new Ys(this),this.grid&&this.grid.element&&this.element.querySelector("."+ft))this.notEmpty=!0,this.grid.setProperties({columns:this.renderModule.frameEmptyColumns(),dataSource:this.renderModule.frameEmptyData()},!0),this.grid.notify("datasource-modified",{}),this.grid.refreshColumns();else{this.element.querySelector("."+ft)&&(0,t.remove)(this.element.querySelector("."+ft)),this.renderModule.bindGrid(this,!0),this.grid.showSpinner=function(){},this.grid.hideSpinner=function(){};var i=(0,t.createElement)("div",{id:this.element.id+"_grid"});this.element.appendChild(i),this.grid.isStringTemplate=!0,this.grid.appendTo(i),this.grid.off("data-ready",this.grid.dataReady),this.grid.on("data-ready",function(){e.grid.scrollModule.setWidth(),e.grid.scrollModule.setHeight()})}},l.prototype.initEngine=function(){var e=this;if(this.element.querySelector(".e-spin-hide")&&this.showWaitingPopup(),"pivot"===this.dataType){var i=!(0,t.isNullOrUndefined)(this.dataSourceSettings.dataSource)&&this.dataSourceSettings.dataSource.length>0?this.dataSourceSettings.dataSource[0]:(0,t.isNullOrUndefined)(this.engineModule.data)?void 0:this.engineModule.data[0];if(i&&this.pivotCommon){var a="[object Array]"===Object.prototype.toString.call(i);if(a&&"JSON"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidJSON"));if(!a&&"CSV"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidCSV"))}}var r={dataSourceSettings:Hs.getClonedDataSourceSettings(this.dataSourceSettings)};this.trigger(Pi,r,function(t){Hs.updateDataSourceSettings(e,t.dataSourceSettings),e.updatePageSettings(!1);var i={mode:"",savedFieldList:void 0,pageSettings:e.pageSettings,enableValueSorting:e.enableValueSorting,isDrillThrough:e.allowDrillThrough||e.editSettings.allowEditing,localeObj:e.localeObj,fieldsType:e.fieldsType,clonedReport:e.clonedReport,globalize:e.globalize,currenyCode:e.currencyCode,enablePaging:e.enablePaging,enableVirtualization:e.enableVirtualization,allowDataCompression:e.allowDataCompression,enableHtmlSanitizer:e.enableHtmlSanitizer,enableOptimizedRendering:e.enableVirtualization&&e.virtualScrollSettings&&e.virtualScrollSettings.allowSinglePage,isTabularLayout:e.isTabular};"pivot"===e.dataType?("Server"!==e.dataSourceSettings.mode&&(e.updateClonedReport(),e.engineModule.renderEngine(e.dataSourceSettings,i,e.aggregateCellInfo?e.getValueCellInfo.bind(e):void 0,e.onHeadersSort?e.getHeaderSortInfo.bind(e):void 0)),e.allowServerDataBinding=!1,e.setProperties({pivotValues:e.engineModule.pivotValues},!0),e.allowServerDataBinding=!0,e.enginePopulatedEventMethod("initEngine")):"SSAS"===e.dataSourceSettings.providerType&&"olap"===e.dataType&&(i.savedFieldList=e.olapEngineModule.fieldList,i.savedFieldListData=e.olapEngineModule.fieldListData,Hs.renderOlapEngine(e,i),e.allowServerDataBinding=!1,e.setProperties({pivotValues:e.olapEngineModule.pivotValues},!0),e.allowServerDataBinding=!0,e.enginePopulatedEventMethod("initEngine"))})},l.prototype.enginePopulatedEventMethod=function(e,t){if("initEngine"===e){var i=t||this;this.trigger(Ei,{pivotValues:this.pivotValues},function(e){"olap"===i.dataType?(i.olapEngineModule.pivotValues=e.pivotValues,i.setProperties({pivotValues:i.olapEngineModule.pivotValues},!0)):(i.engineModule.pivotValues=e.pivotValues,i.setProperties({pivotValues:i.engineModule.pivotValues},!0)),i.notify(fr,{}),i.notEmpty=!0})}else{var a=t||this,r={dataSourceSettings:a.dataSourceSettings,pivotValues:a.pivotValues};a.trigger(Ei,r,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.allowServerDataBinding=!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()})}},l.prototype.generateData=function(){this.isStaticRefresh||("Chart"!==this.displayOption.view&&(0,t.isNullOrUndefined)(this.grid)?(this.renderEmptyGrid(),this.showWaitingPopup()):(this.showWaitingPopup(),clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.refreshData.bind(this),100)))},l.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 i.DataManager?"pivot"===e.dataType&&e.remoteData.length>0?(this.element.querySelector(".e-spinner-pane")||this.showWaitingPopup(),this.engineModule.data=e.remoteData,this.initEngine()):(0,t.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&&e.dataSourceSettings.dataSource.length>0||this.engineModule.data&&this.engineModule.data.length>0?("pivot"===e.dataType&&(this.hideWaitingPopup(),e.engineModule.data=e.dataSourceSettings.dataSource),e.initEngine()):"Server"===this.dataSourceSettings.mode?this.getEngine("onRefresh"):(this.notify(fr,{}),this.hideWaitingPopup()):(this.notify(fr,{}),this.hideWaitingPopup())},l.prototype.getValueCellInfo=function(e){var t=e;return this.trigger(Ua,t),t},l.prototype.getHeaderSortInfo=function(e){var t=e;return this.trigger(Ba,t),t},l.prototype.getBeforeServiceInvoke=function(e){return this.trigger(nr,e),e},l.prototype.getAfterServiceInvoke=function(e){return this.trigger(sr,e),e},l.prototype.bindTriggerEvents=function(e){this.trigger((0,_s.getObject)("name",e),e)},l.prototype.getData=function(){this.dataSourceSettings.dataSource.defaultQuery?this.dataSourceSettings.dataSource.executeQuery(this.dataSourceSettings.dataSource.defaultQuery).then(this.executeQuery.bind(this)):this.dataSourceSettings.dataSource.executeQuery(new i.Query).then(this.executeQuery.bind(this))},l.prototype.executeQuery=function(e){this.element.querySelector(".e-spinner-pane")||this.showWaitingPopup();var i=this;this.dataManager=this.dataSourceSettings.dataSource,i.engineModule.data=e.result&&e.result.result?e.result.result:e.result,this.isEmptyGrid&&!(0,t.isNullOrUndefined)(i.engineModule.data)&&0===i.engineModule.data.length?this.hideWaitingPopup():!(0,t.isNullOrUndefined)(i.engineModule.data)&&i.engineModule.data.length>0?(this.isEmptyGrid=!1,i.initEngine()):(this.isEmptyGrid=!0,this.hideWaitingPopup(),this.renderEmptyGrid(),this.engineModule.fieldList=null,this.engineModule.isEmptyData=!0,this.pivotValues=[],this.engineModule.data=[],this.notify(fr,{}))},l.prototype.applyFormatting=function(e,i){if(e){for(var a=[],r=e.length,n=0;n<r;n++)(0,t.isNullOrUndefined)(e[n])||void 0!==e[n][0]||a.push(n);var s=(0,t.isNullOrUndefined)(i)?this.dataSourceSettings:i;for(n=0;n<e.length;n++)for(var o=this.isTabular?this.engineModule.rowMaxLevel+1:1;e[n]&&o<e[n].length;o++)if("value"===e[n][o].axis&&""!==e[n][o].formattedText){e[n][o].style=void 0,e[n][o].cssClass=void 0;for(var l=s.conditionalFormatSettings,d=0;d<l.length;d++)!0!==l[d].applyGrandTotals&&!(0,t.isNullOrUndefined)(l[d].applyGrandTotals)&&e[n][o].isGrandSum||this.checkCondition(e[n][o].value,l[d].conditions,l[d].value1,l[d].value2)&&(l[d].measure&&e[n][o].actualText!==l[d].measure||void 0!==l[d].measure&&""===l[d].measure||void 0!==l[d].label&&""===l[d].label||!(!l[d].label||e[n][0].valueSort.levelName.indexOf(l[d].label)>-1||e[n][o].rowHeaders.indexOf(l[d].label)>-1||e[n][o].columnHeaders.indexOf(l[d].label)>-1)||(l[d].style&&l[d].style.backgroundColor&&(l[d].style.backgroundColor="#"===l[d].style.backgroundColor.charAt(0)&&this.conditionalFormattingModule.isHex(l[d].style.backgroundColor.substr(1))?l[d].style.backgroundColor:this.conditionalFormattingModule.colourNameToHex(l[d].style.backgroundColor)),l[d].style&&l[d].style.color&&(l[d].style.color="#"===l[d].style.color.charAt(0)&&this.conditionalFormattingModule.isHex(l[d].style.color.substr(1))?l[d].style.color:this.conditionalFormattingModule.colourNameToHex(l[d].style.color)),e[n][o].style=l[d].style,e[n][o].cssClass="format"+this.element.id+d))}var p=s.conditionalFormatSettings;for(d=0;d<p.length;d++){var h=this.createStyleSheet.bind(this)(),u="color: "+p[d].style.color+"!important;background-color: "+p[d].style.backgroundColor+"!important;font-size: "+p[d].style.fontSize+"!important;font-family: "+p[d].style.fontFamily+" !important;",c=".format"+this.element.id+d;h.insertRule(c+", "+c+" .e-cellvalue{"+u+"}",0)}}},l.prototype.createStyleSheet=function(){var e=document.createElement("style");return e.textContent="",document.head.appendChild(e),e.sheet},l.prototype.applyHyperlinkSettings=function(){if(this.pivotValues){for(var e=this.pivotValues,i=[],a=e.length,r=0;r<a;r++)!(0,t.isNullOrUndefined)(e[r])&&(0,t.isNullOrUndefined)(e[r][0])&&i.push(r);if(this.hyperlinkSettings.conditionalSettings.length>0)for(r=0;r<e.length;r++)for(var n=this.isTabular?this.engineModule.rowMaxLevel+1:1;e[r]&&n<e[r].length;n++)if("value"===e[r][n].axis){e[r][n].enableHyperlink=!1;for(var s=this.hyperlinkSettings.conditionalSettings,o=0;o<s.length;o++)if(this.checkCondition(e[r][n].value,s[o].conditions,s[o].value1,s[o].value2)){var l="row"===this.dataSourceSettings.valueAxis?r:"pivot"===this.dataType?this.engineModule.headerContent.length-1:this.olapEngineModule.headerContent.length-1,d="row"===this.dataSourceSettings.valueAxis?0:n;(!s[o].measure||1===this.dataSourceSettings.values.length||e[l][d].valueSort&&e[l][d].actualText===s[o].measure)&&(!s[o].label||e[i[s[o].label.split(".").length-1]]&&e[i[s[o].label.split(".").length-1]][n]&&e[i[s[o].label.split(".").length-1]][n].valueSort&&e[i[s[o].label.split(".").length-1]][n].valueSort[s[o].label]||e[r][0].valueSort.levelName.indexOf(s[o].label)>-1)&&(e[r][n].enableHyperlink=!0)}}if((0,t.isNullOrUndefined)(this.hyperlinkSettings.headerText)||""===this.hyperlinkSettings.headerText)return;var p=this.dataSourceSettings.valueSortSettings.headerDelimiter?this.dataSourceSettings.valueSortSettings.headerDelimiter:".";for(r=0;r<e.length;r++)for(n=this.isTabular?this.engineModule.rowMaxLevel+1:1;e[r]&&n<e[r].length;n++)if("value"===e[r][n].axis){var h=this.hyperlinkSettings.headerText;if(e[r][0].valueSort.levelName.indexOf(h)>-1)e[r][0].enableHyperlink=!0,e[r][n].enableHyperlink=!0;else{var u=!1;for(o=0;o<i.length;o++)h=p+this.hyperlinkSettings.headerText,(p+e[i[o]][n].valueSort.levelName).indexOf(h)>-1&&(e[i[o]][n].enableHyperlink=!0,u=!0);e[r][n].enableHyperlink=u}}}},l.prototype.checkCondition=function(e,t,i,a){switch(t){case"LessThan":return e<i;case"LessThanOrEqualTo":return e<=i;case"GreaterThan":return e>i;case"GreaterThanOrEqualTo":return e>=i;case"Equals":return e===i;case"NotEquals":return e!==i;case"Between":return i<a&&e>=i&&e<=a||i>a&&e<=i&&e>=a;case"NotBetween":return!(i<a&&e>=i&&e<=a||i>a&&e<=i&&e>=a);default:return!1}},l.prototype.updateGroupingReport=function(e,i){if(!this.clonedDataSet&&!this.clonedReport){var a=this.engineModule.data;this.clonedDataSet="CSV"===this.dataSourceSettings.type?Hs.getClonedCSVData(a):Hs.getClonedData(a);var r=JSON.parse(this.getPersistData()).dataSourceSettings;r.dataSource=[],this.clonedReport=this.clonedReport?this.clonedReport:r}"Server"!==this.dataSourceSettings.mode||(0,t.isNullOrUndefined)(this.groupingModule)||(this.groupingModule.isUpdate=!0);var n=/_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,s="CSV"===this.dataSourceSettings.type?Hs.getClonedCSVData(this.clonedDataSet):Hs.getClonedData(this.clonedDataSet),o=this.dataSourceSettings,l=this.clonedReport.properties?this.clonedReport.properties:this.clonedReport,d=[o.rows,o.columns,o.values,o.filters],p=[o.filterSettings,o.sortSettings,o.formatSettings,o.drilledMembers],h=l.rows;if(h=h.concat(l.columns,l.values,l.filters),0===e.length||e.length>0){this.engineModule.groupingFields={},this.setProperties({dataSourceSettings:{dataSource:s,groupSettings:e.length>0?o.groupSettings:[]}},!0);for(var u,c="Date"===i,g=[],m=0,f=d.length;m<f;m++)for(var v,S,y=function(e,i){var a=d[m][e].name;-1===g.indexOf(a)&&g.push(a);var r=g.indexOf(a);if(!(0,t.isNullOrUndefined)(a.match(n))&&c||-1!==a.indexOf("_custom_group")&&!Hs.getFieldByName(a.replace("_custom_group",""),o.groupSettings)){d[m].splice(e,1),g.splice(r,1),e--,i--,a=a.split("_")[0];for(var s=!1,l=0;l<d.length&&!(s=d[l].filter(function(e){return e&&e.name===a}).length>0);l++);if(!s){u=a.split("_")[0];var p=Hs.getFieldByName(u,h);if(h=h.filter(function(e){return e&&e.name!==u}),g.push(u),p)s?d[m].splice(e,1,p):d[m].splice(++e,0,p);else{var f=!1;d[m].filter(function(e){e&&e.name===u&&(f=!0)}),s||f||d[m].push({name:u})}}}else{(p=Hs.getFieldByName(a,h))?d[m].splice(e,1,p):u===a?d[m].splice(e,1):d[m][e]&&d[m][e].caption&&-1!==d[m][e].caption.indexOf(a)&&(d[m][e].caption=void 0)}v=e,S=i},b=0,C=d[m].length;b<C;b++)y(b,C),b=v,C=S;for(var x=0,w=g;x<w.length;x++){var T=w[x],M=Hs.getFilterItemByName(T,l.filterSettings),D=Hs.getFieldByName(T,l.sortSettings),O=Hs.getFieldByName(T,l.formatSettings),N=Hs.getFieldByName(T,l.drilledMembers),P=[M,D,O,N];for(m=0,f=p.length;m<f;m++){var E=!1;for(b=0,C=p[m].length;b<C;b++){var I=p[m][b].name;if(!(0,t.isNullOrUndefined)(I.match(n))&&c||-1!==I.indexOf("_custom_group")&&!Hs.getFieldByName(I.replace("_custom_group",""),o.groupSettings))p[m].splice(b,1),b--,C--;else if(T===p[m][b].name){E=!0,P[m]?p[m].splice(b,1,P[m]):(p[m].splice(b,1),b--,C--);break}}!E&&0===m&&M&&p[m].push(M),!E&&1===m&&D&&p[m].push(D),!E&&2===m&&O&&p[m].push(O),!E&&3===m&&N&&p[m].push(N)}}}},l.prototype.removeButtonFocus=function(){document.querySelectorAll(".e-btn-focused")&&(0,t.removeClass)(document.querySelectorAll(".e-btn-focused"),"e-btn-focused")},l.prototype.wireEvents=function(){var e=this.virtualScrollSettings&&this.virtualScrollSettings.allowSinglePage&&"pivot"===this.dataType;"Chart"!==this.displayOption.view&&(t.EventHandler.add(this.element,this.isAdaptive?"touchend":"click",this.mouseClickHandler,this),t.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),t.EventHandler.add(this.element.querySelector("."+Wt),"mousemove",this.mouseMoveHandler,this),t.EventHandler.add(this.element,"mouseup",this.mouseUpHandler,this),t.EventHandler.add(this.element,this.isAdaptive?"touchend":"contextmenu",this.mouseRclickHandler,this),this.virtualscrollModule&&this.enableVirtualization&&!e&&t.EventHandler.add(this.element.querySelector("."+Qt).querySelector("."+R),"scroll",this.headerScrollUpdate,this)),t.EventHandler.add(document,this.isAdaptive?"touchend":"click",this.removeButtonFocus,this),this.onWindowResizeHandler||(this.onWindowResizeHandler=this.onWindowResize.bind(this)),window.addEventListener("resize",this.onWindowResizeHandler,!0)},l.prototype.headerScrollUpdate=function(){this.element.querySelector("."+kt).scrollLeft!==this.element.querySelector("."+Qt).querySelector("."+R).scrollLeft&&(this.virtualscrollModule.direction="horizondal"),this.element.querySelector("."+kt).scrollLeft=this.element.querySelector("."+Qt).querySelector("."+R).scrollLeft},l.prototype.unwireEvents=function(){"Chart"!==this.displayOption.view&&(t.EventHandler.remove(this.element,this.isAdaptive?"touchend":"click",this.mouseClickHandler),t.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),this.element.querySelector("."+Wt)&&t.EventHandler.remove(this.element.querySelector("."+Wt),"mousemove",this.mouseMoveHandler),t.EventHandler.remove(this.element,"mouseup",this.mouseUpHandler),t.EventHandler.remove(this.element,this.isAdaptive?"touchend":"contextmenu",this.mouseRclickHandler),this.virtualscrollModule&&this.enableVirtualization&&this.element.querySelector("."+Qt)&&t.EventHandler.remove(this.element.querySelector("."+Qt).querySelector("."+R),"scroll",this.headerScrollUpdate)),t.EventHandler.remove(document,this.isAdaptive?"touchend":"click",this.removeButtonFocus),this.onWindowResizeHandler&&(window.removeEventListener("resize",this.onWindowResizeHandler,!0),this.onWindowResizeHandler=null)},l.prototype.actionBeginMethod=function(){this.actionObj.actionName!==Tn&&(this.renderModule&&(this.renderModule.selectedCells=[]),this.isWindowResized=!1);var e={dataSourceSettings:Hs.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,cancel:!1};return this.trigger(or,e),e.cancel},l.prototype.actionCompleteMethod=function(){var e={dataSourceSettings:Hs.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,actionInfo:this.actionObj.actionInfo};this.trigger(lr,e),this.actionObj.actionName="",this.actionObj.actionInfo=void 0,this.actionObj.fieldInfo=void 0},l.prototype.actionFailureMethod=function(e){var t={actionName:this.actionObj.actionName,errorInfo:e};this.trigger(dr,t)},l.prototype.getActionCompleteName=function(){var e;switch(this.actionObj.actionName){case Rr:case on:e=Zn;break;case kr:case sn:e=$n;break;case Ur:e=es;break;case Br:e=ts;break;case Jr:e=is;break;case Zr:e=as;break;case $r:e=rs;break;case en:e=ns;break;case tn:e=ss;break;case an:e=os;break;case rn:e=ls;break;case nn:e=ds;break;case Pn:e=Ps;break;case En:e=Es;break;case Dr:e=ps;break;case gn:e=Rn;break;case pn:e=hs;break;case hn:e=us;break;case un:e=cs;break;case cn:e=gs;break;case bn:e=ms;break;case fn:e=Ss;break;case ln:e=ys;break;case vn:e=kn;break;case Sn:e=jn;break;case yn:e=qn;break;case Wr:e=Kn;break;case Kr:e=Xn;break;case Xr:e=Jn;break;case zr:e=Yn;break;case Yr:e=Qn;break;case Qr:e=Wn;break;case Tn:e=bs;break;case Er:e=Un;break;case Pr:e=Bn;break;case Ir:e=_n;break;case Fr:e=Gn;break;case gr:e=Ts;break;case cr:e=ws;break;case Mn:e=Ms;break;case Dn:e=Ds;break;default:e=this.actionObj.actionName}return e},l.prototype.getStackedColumns=function(e,t){for(var i=0,a=e;i<a.length;i++){var r=a[i];t.push(r),r.columns&&r.columns.length>0&&this.getStackedColumns(r.columns,t)}return t},l.prototype.destroy=function(){this.timeOutObj&&(clearTimeout(this.timeOutObj),this.timeOutObj=void 0),this.removeInternalEvents(),this.engineModule&&(this.engineModule.fieldList={},this.engineModule.rMembers=null,this.engineModule.cMembers=null,this.engineModule.valueMatrix=[],this.engineModule.data=[],this.engineModule.actualData=[],this.engineModule.pivotValues=[],this.engineModule.aggregatedValueMatrix=[],this.engineModule.headerContent=null,this.engineModule.valueContent=[],this.engineModule.formatFields={},this.engineModule.calculatedFields={},this.engineModule.calculatedFormulas={},this.engineModule.groupingFields={},this.engineModule.saveDataHeaders={},this.engineModule.groupRawIndex={},this.engineModule.fieldKeys={},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&&(0,t.select)("#"+this.element.id+"_chart",this.element)&&(0,t.remove)((0,t.select)("#"+this.element.id+"_chart",this.element))),this.grid&&!this.grid.isDestroyed&&(this.grid.destroy(),this.grid.isDestroyed&&(0,t.select)("#"+this.element.id+"_grid",this.element)&&(0,t.remove)((0,t.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!==(0,t.select)("#"+this.element.id+"_PivotFieldList",this.element)&&(0,t.remove)((0,t.select)("#"+this.element.id+"_PivotFieldList",this.element)),this.pivotFieldListModule.element.remove(),this.pivotFieldListModule.element=null),this.fieldListModule&&(this.fieldListModule.element=null),(this.allowDrillThrough||this.editSettings&&this.editSettings.allowEditing)&&this.drillThroughModule&&this.drillThroughModule.destroy(),this.chartExportModule&&this.chartExportModule.destroy(),this.unwireEvents(),e.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="",(0,t.removeClass)([this.element],r),(0,t.removeClass)([this.element],n),(0,t.removeClass)([this.element],s),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.focusedCellInfo=null,this.lastColumn=null,this.pivotCommon=null,this.virtualDiv=null,this.virtualHeaderDiv=null,this.virtualScrollDiv=null,this.virtualTableDiv=null,this.lastSelectedElement=null,this.isModalDialog=!1},l.prototype.showNumberFormattingDialog=function(){this.allowNumberFormatting&&this.numberFormattingModule.showNumberFormattingDialog()},l.prototype.getValuesHeader=function(e,i){var a=this.dataSourceSettings.values;return"value"===i&&!(0,t.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"===i&&1===a.length&&"row"===this.dataSourceSettings.valueAxis&&e.formattedText===this.localeObj.getConstant("grandTotal")?this.localeObj.getConstant("total")+" "+this.localeObj.getConstant(a[a.length-1].type)+" "+this.localeObj.getConstant("of")+" "+((0,t.isNullOrUndefined)(a[a.length-1].caption)?a[a.length-1].name:a[a.length-1].caption):e.formattedText},l.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)},l.prototype.updateClonedReport=function(){if(this.dataSourceSettings.groupSettings&&this.dataSourceSettings.groupSettings.length>0){"Server"!==this.dataSourceSettings.mode||(0,t.isNullOrUndefined)(this.groupingModule)||(this.groupingModule.isUpdate=!0);var e=this.engineModule.data;this.clonedDataSet=this.clonedDataSet?this.clonedDataSet:"CSV"===this.dataSourceSettings.type?Hs.getClonedCSVData(e):Hs.getClonedData(e);var i=JSON.parse(this.getPersistData()).dataSourceSettings;i.dataSource=[],this.clonedReport=this.clonedReport?this.clonedReport:i}},Fl([(0,t.Property)("USD")],l.prototype,"currencyCode",void 0),Fl([(0,t.Property)(!1)],l.prototype,"showFieldList",void 0),Fl([(0,t.Complex)({},Mo)],l.prototype,"gridSettings",void 0),Fl([(0,t.Complex)({},wl)],l.prototype,"chartSettings",void 0),Fl([(0,t.Complex)({},Rl)],l.prototype,"groupingBarSettings",void 0),Fl([(0,t.Complex)({},ql)],l.prototype,"hyperlinkSettings",void 0),Fl([(0,t.Complex)({},Hl)],l.prototype,"pageSettings",void 0),Fl([(0,t.Complex)({},Vl)],l.prototype,"pagerSettings",void 0),Fl([(0,t.Complex)({},xo)],l.prototype,"dataSourceSettings",void 0),Fl([(0,t.Complex)({},kl)],l.prototype,"editSettings",void 0),Fl([(0,t.Complex)({},Ul)],l.prototype,"displayOption",void 0),Fl([(0,t.Complex)({},Bl)],l.prototype,"virtualScrollSettings",void 0),Fl([(0,t.Property)()],l.prototype,"pivotValues",void 0),Fl([(0,t.Property)(!1)],l.prototype,"showGroupingBar",void 0),Fl([(0,t.Property)(!0)],l.prototype,"showTooltip",void 0),Fl([(0,t.Property)(!1)],l.prototype,"showToolbar",void 0),Fl([(0,t.Property)([])],l.prototype,"toolbar",void 0),Fl([(0,t.Property)(!1)],l.prototype,"showValuesButton",void 0),Fl([(0,t.Property)(!1)],l.prototype,"allowCalculatedField",void 0),Fl([(0,t.Property)(!1)],l.prototype,"enableFieldSearching",void 0),Fl([(0,t.Property)(!1)],l.prototype,"enableValueSorting",void 0),Fl([(0,t.Property)(!1)],l.prototype,"allowConditionalFormatting",void 0),Fl([(0,t.Property)(!1)],l.prototype,"allowNumberFormatting",void 0),Fl([(0,t.Property)("auto")],l.prototype,"height",void 0),Fl([(0,t.Property)("auto")],l.prototype,"width",void 0),Fl([(0,t.Property)(!1)],l.prototype,"allowExcelExport",void 0),Fl([(0,t.Property)(!1)],l.prototype,"enableVirtualization",void 0),Fl([(0,t.Property)(!1)],l.prototype,"enablePaging",void 0),Fl([(0,t.Property)(!1)],l.prototype,"allowDrillThrough",void 0),Fl([(0,t.Property)(!1)],l.prototype,"allowPdfExport",void 0),Fl([(0,t.Property)(!1)],l.prototype,"allowDeferLayoutUpdate",void 0),Fl([(0,t.Property)(!1)],l.prototype,"allowDataCompression",void 0),Fl([(0,t.Property)(1e3)],l.prototype,"maxNodeLimitInMemberEditor",void 0),Fl([(0,t.Property)(1e4)],l.prototype,"maxRowsInDrillThrough",void 0),Fl([(0,t.Property)(!0)],l.prototype,"loadOnDemandInMemberEditor",void 0),Fl([(0,t.Property)(!1)],l.prototype,"enableHtmlSanitizer",void 0),Fl([(0,t.Property)()],l.prototype,"cellTemplate",void 0),Fl([(0,t.Property)()],l.prototype,"toolbarTemplate",void 0),Fl([(0,t.Property)()],l.prototype,"tooltipTemplate",void 0),Fl([(0,t.Property)()],l.prototype,"spinnerTemplate",void 0),Fl([(0,t.Property)(!1)],l.prototype,"allowGrouping",void 0),Fl([(0,t.Property)(!0)],l.prototype,"exportAllPages",void 0),Fl([(0,t.Property)(["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfRunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"])],l.prototype,"aggregateTypes",void 0),Fl([(0,t.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"])],l.prototype,"chartTypes",void 0),Fl([(0,t.Property)("")],l.prototype,"cssClass",void 0),Fl([(0,t.Event)()],l.prototype,"queryCellInfo",void 0),Fl([(0,t.Event)()],l.prototype,"headerCellInfo",void 0),Fl([(0,t.Event)()],l.prototype,"resizing",void 0),Fl([(0,t.Event)()],l.prototype,"resizeStop",void 0),Fl([(0,t.Event)()],l.prototype,"pdfHeaderQueryCellInfo",void 0),Fl([(0,t.Event)()],l.prototype,"pdfQueryCellInfo",void 0),Fl([(0,t.Event)()],l.prototype,"excelHeaderQueryCellInfo",void 0),Fl([(0,t.Event)()],l.prototype,"excelQueryCellInfo",void 0),Fl([(0,t.Event)()],l.prototype,"columnDragStart",void 0),Fl([(0,t.Event)()],l.prototype,"columnDrag",void 0),Fl([(0,t.Event)()],l.prototype,"columnDrop",void 0),Fl([(0,t.Event)()],l.prototype,"beforePdfExport",void 0),Fl([(0,t.Event)()],l.prototype,"beforeExcelExport",void 0),Fl([(0,t.Event)()],l.prototype,"beforeColumnsRender",void 0),Fl([(0,t.Event)()],l.prototype,"selected",void 0),Fl([(0,t.Event)()],l.prototype,"selecting",void 0),Fl([(0,t.Event)()],l.prototype,"cellDeselected",void 0),Fl([(0,t.Event)()],l.prototype,"rowSelected",void 0),Fl([(0,t.Event)()],l.prototype,"rowDeselected",void 0),Fl([(0,t.Event)()],l.prototype,"chartTooltipRender",void 0),Fl([(0,t.Event)()],l.prototype,"chartLegendClick",void 0),Fl([(0,t.Event)()],l.prototype,"beforePrint",void 0),Fl([(0,t.Event)()],l.prototype,"animationComplete",void 0),Fl([(0,t.Event)()],l.prototype,"legendRender",void 0),Fl([(0,t.Event)()],l.prototype,"textRender",void 0),Fl([(0,t.Event)()],l.prototype,"pointRender",void 0),Fl([(0,t.Event)()],l.prototype,"seriesRender",void 0),Fl([(0,t.Event)()],l.prototype,"chartMouseMove",void 0),Fl([(0,t.Event)()],l.prototype,"chartMouseClick",void 0),Fl([(0,t.Event)()],l.prototype,"pointMove",void 0),Fl([(0,t.Event)()],l.prototype,"chartMouseLeave",void 0),Fl([(0,t.Event)()],l.prototype,"chartMouseDown",void 0),Fl([(0,t.Event)()],l.prototype,"chartMouseUp",void 0),Fl([(0,t.Event)()],l.prototype,"dragComplete",void 0),Fl([(0,t.Event)()],l.prototype,"zoomComplete",void 0),Fl([(0,t.Event)()],l.prototype,"scrollStart",void 0),Fl([(0,t.Event)()],l.prototype,"scrollEnd",void 0),Fl([(0,t.Event)()],l.prototype,"scrollChanged",void 0),Fl([(0,t.Event)()],l.prototype,"multiLevelLabelRender",void 0),Fl([(0,t.Event)()],l.prototype,"chartLoaded",void 0),Fl([(0,t.Event)()],l.prototype,"chartLoad",void 0),Fl([(0,t.Event)()],l.prototype,"chartResized",void 0),Fl([(0,t.Event)()],l.prototype,"chartAxisLabelRender",void 0),Fl([(0,t.Event)()],l.prototype,"multiLevelLabelClick",void 0),Fl([(0,t.Event)()],l.prototype,"chartPointClick",void 0),Fl([(0,t.Event)()],l.prototype,"contextMenuClick",void 0),Fl([(0,t.Event)()],l.prototype,"contextMenuOpen",void 0),Fl([(0,t.Event)()],l.prototype,"onPdfCellRender",void 0),Fl([(0,t.Event)()],l.prototype,"saveReport",void 0),Fl([(0,t.Event)()],l.prototype,"fetchReport",void 0),Fl([(0,t.Event)()],l.prototype,"loadReport",void 0),Fl([(0,t.Event)()],l.prototype,"renameReport",void 0),Fl([(0,t.Event)()],l.prototype,"removeReport",void 0),Fl([(0,t.Event)()],l.prototype,"newReport",void 0),Fl([(0,t.Event)()],l.prototype,"toolbarRender",void 0),Fl([(0,t.Event)()],l.prototype,"toolbarClick",void 0),Fl([(0,t.Event)()],l.prototype,"load",void 0),Fl([(0,t.Event)()],l.prototype,"enginePopulating",void 0),Fl([(0,t.Event)()],l.prototype,"enginePopulated",void 0),Fl([(0,t.Event)()],l.prototype,"onFieldDropped",void 0),Fl([(0,t.Event)()],l.prototype,"fieldDrop",void 0),Fl([(0,t.Event)()],l.prototype,"fieldDragStart",void 0),Fl([(0,t.Event)()],l.prototype,"dataBound",void 0),Fl([(0,t.Event)()],l.prototype,"created",void 0),Fl([(0,t.Event)()],l.prototype,"destroyed",void 0),Fl([(0,t.Event)()],l.prototype,"beforeExport",void 0),Fl([(0,t.Event)()],l.prototype,"exportComplete",void 0),Fl([(0,t.Event)()],l.prototype,"conditionalFormatting",void 0),Fl([(0,t.Event)()],l.prototype,"memberFiltering",void 0),Fl([(0,t.Event)()],l.prototype,"cellClick",void 0),Fl([(0,t.Event)()],l.prototype,"drillThrough",void 0),Fl([(0,t.Event)()],l.prototype,"editCompleted",void 0),Fl([(0,t.Event)()],l.prototype,"beginDrillThrough",void 0),Fl([(0,t.Event)()],l.prototype,"hyperlinkCellClick",void 0),Fl([(0,t.Event)()],l.prototype,"cellSelecting",void 0),Fl([(0,t.Event)()],l.prototype,"drill",void 0),Fl([(0,t.Event)()],l.prototype,"cellSelected",void 0),Fl([(0,t.Event)()],l.prototype,"chartSeriesCreated",void 0),Fl([(0,t.Event)()],l.prototype,"aggregateCellInfo",void 0),Fl([(0,t.Event)()],l.prototype,"fieldListRefreshed",void 0),Fl([(0,t.Event)()],l.prototype,"memberEditorOpen",void 0),Fl([(0,t.Event)()],l.prototype,"calculatedFieldCreate",void 0),Fl([(0,t.Event)()],l.prototype,"numberFormatting",void 0),Fl([(0,t.Event)()],l.prototype,"aggregateMenuOpen",void 0),Fl([(0,t.Event)()],l.prototype,"fieldRemove",void 0),Fl([(0,t.Event)()],l.prototype,"beforeServiceInvoke",void 0),Fl([(0,t.Event)()],l.prototype,"afterServiceInvoke",void 0),Fl([(0,t.Event)()],l.prototype,"actionBegin",void 0),Fl([(0,t.Event)()],l.prototype,"actionComplete",void 0),Fl([(0,t.Event)()],l.prototype,"actionFailure",void 0),Fl([(0,t.Event)()],l.prototype,"onHeadersSort",void 0),l=d=Fl([t.NotifyPropertyChanges],l)}(t.Component),Gl=v(437),zl=function(){function e(){}return e.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},e.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},e.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},e}(),Wl=function(){function e(e){this.parent=e}return e.prototype.updateThemeStyle=function(e,i){return(0,t.extend)(i,e)},e.prototype.getCaptionThemeStyle=function(e,t){return this.updateThemeStyle(e.caption,t)},e.prototype.getHeaderThemeStyle=function(e,t){return this.updateThemeStyle(e.header,t)},e.prototype.getRecordThemeStyle=function(e,t){return this.updateThemeStyle(e.record,t)},e.prototype.setImage=function(e,t,i,a){var r={image:e.image.base64,row:i,column:t+1,lastRow:i,lastColumn:t+1,firstRowOffset:e.image.firstRowOffset,firstColumnOffset:e.image.firstColumnOffset};return e.image.width&&e.image.height&&(r.width=e.image.width,r.height=e.image.height),this.parent.excelExportModule.images.push(r),(a>e.image.height?a:e.image.height)||50},e}(),Ql=function(){function e(e){this.actualrCnt=0,this.images=[],this.workSheet=[],this.isHeaderIncluded=!1,this.book={},(0,t.initializeTelemetryFeature)("ExcelExport","PivotTable"),this.parent=e,this.excelExportHelper=new Wl(this.parent),this.rows=[]}return e.prototype.getModuleName=function(){return"excelExport"},e.prototype.addHeaderAndFooter=function(e,i,a,r){this.rows||(this.rows=[]);var n=[];if((0,t.isNullOrUndefined)(e.rows))""!==i&&("footer"===a&&this.actualrCnt++,n.push({index:1,value:i}),this.rows.push({index:this.actualrCnt+1,cells:n}),this.actualrCnt="header"===a?this.actualrCnt+2:this.actualrCnt);else{this.actualrCnt="footer"===a?this.actualrCnt+r-e.rows[0].cells.length:this.actualrCnt;for(var s=e.rows,o=0;o<s.length;o++){var l=0;n=[];for(var d=s[o],p=0;p<d.cells.length;p++){var h={index:l+1,value:d.cells[p].value,colSpan:d.cells[p].colSpan,rowSpan:d.cells[p].rowSpan,style:(0,t.isNullOrUndefined)(this.theme)||(0,t.isNullOrUndefined)(this.theme.caption)?d.cells[p].style:this.excelExportHelper.getCaptionThemeStyle(this.theme,d.cells[p].style)};d.cells[p].hyperlink&&(h.hyperlink={target:d.cells[p].hyperlink.target},h.value=d.cells[p].value?d.cells[p].value:d.cells[p].hyperlink.displayText),n.push(h),l+=n[p].colSpan}this.actualrCnt++,this.rows.push({index:this.actualrCnt,cells:n})}this.actualrCnt="header"===a?r:this.actualrCnt}},e.prototype.exportToExcel=function(e,i,a,r,n,s){var o=this;return new Promise(function(l,d){try{o.actualrCnt=0;var p="AppendToSheet",h=5;(0,t.isNullOrUndefined)(i)||(0,t.isNullOrUndefined)(i.multipleExport)||(p=(0,t.isNullOrUndefined)(i.multipleExport.type)?"AppendToSheet":i.multipleExport.type,(0,t.isNullOrUndefined)(i.multipleExport.blankRows)||(h=i.multipleExport.blankRows)),(0,t.isNullOrUndefined)(r)?(o.workSheet=[],o.rows=[],o.columns=[],o.images=[]):"NewSheet"===p?(o.rows=[],o.columns=[],o.images=[]):(o.workSheet=[],o.rows=r.worksheets[0].rows,o.columns=r.worksheets[0].columns,o.images=r.worksheets[0].images,o.actualrCnt=o.rows[o.rows.length-1].index+(h-1),o.actualrCnt++),o.parent=s||o.parent;var u=!(0,t.isNullOrUndefined)(i)&&!(0,t.isNullOrUndefined)(i.header),c=!(0,t.isNullOrUndefined)(i)&&!(0,t.isNullOrUndefined)(i.footer),g=!(0,t.isNullOrUndefined)(i)&&!(0,t.isNullOrUndefined)(i.fileName);o.engine="olap"===o.parent.dataType?o.parent.olapEngineModule:o.parent.engineModule,o.theme=(0,t.isNullOrUndefined)(i)?void 0:i.theme;var m=void 0,f=zl.getClonedPivotValues(o.engine.pivotValues),v=g?i.fileName:"CSV"===e?"default.csv":"default.xlsx";if(o.parent.exportAllPages&&(o.parent.enableVirtualization||o.parent.enablePaging)){var S=o.engine.pageSettings,y=void 0;o.engine.isPagingOrVirtualizationEnabled=!1,o.engine.enableVirtualization=!1,o.engine.enablePaging=!1,"olap"===o.parent.dataType?(o.updateOlapPageSettings(!0),y=o.parent.olapEngineModule.mdxQuery.slice(0)):o.engine.pageSettings=null;var b=(0,t.isNullOrUndefined)(s)?o.parent.dataSourceSettings:s.dataSourceSettings;o.engine.generateGridData(b,!0,!0),o.parent.applyFormatting(o.engine.pivotValues,b),m=zl.getClonedPivotValues(o.engine.pivotValues),o.engine.pivotValues=f,o.engine.pageSettings=S,o.engine.isPagingOrVirtualizationEnabled=!0,o.engine.enableVirtualization=o.parent.enableVirtualization,o.engine.enablePaging=o.parent.enablePaging,"olap"===o.parent.dataType&&(o.updateOlapPageSettings(!1),o.parent.olapEngineModule.mdxQuery=y)}else m=f;var C,x,w,T,M={fileName:v,header:"",footer:"",dataCollections:[m],excelExportProperties:i};o.parent.trigger(Ri,M,function(e){C=e.fileName,x=e.header,w=e.footer,T=e.dataCollections}),(!o.isHeaderIncluded&&"AppendToSheet"===p||"NewSheet"===p)&&(!u&&(0,t.isNullOrUndefined)(M.excelExportProperties)&&""!==x?o.addHeaderAndFooter({},x,"header",void 0):(0,t.isNullOrUndefined)(M.excelExportProperties)||(0,t.isNullOrUndefined)(M.excelExportProperties.header)||o.addHeaderAndFooter(M.excelExportProperties.header,"","header",M.excelExportProperties.header.headerRows),o.isHeaderIncluded=!0);var D=!M.excelExportProperties||!M.excelExportProperties.includeHiddenColumn||M.excelExportProperties.includeHiddenColumn,O=s?s.grid.getColumns():o.parent.grid.getColumns(),N=[];if(!D)for(var P=0;P<O.length;P++)O[P].visible||N.push(P);for(var E=0,I=0,F=0;F<T.length;F++){var L=T[F],A=0,R=Hs.getPivotEmptyInfo(o.parent,o.engine);R&&(L=Hs.getEmptyPivotValues(o.parent));for(var k=L.length,j=s?s.renderModule.formatList:o.parent.renderModule.formatList,q=0,H=0;H<L[0].length;H++)null!==L[0][H]&&void 0!==L[0][H]&&E++;for(var V=0;V<k;V++)if(L[V]){if(o.actualrCnt++,!D)for(var U=0,B=N;U<B.length;U++){var _=B[U];L[V].splice(_,1)}A=L[V].length;for(var G=[],z=0;z<A;z++)if(L[V][z]){var W=L[V][z],Q="row"===o.parent.dataSourceSettings.valueAxis&&"olap"===o.parent.dataType&&W.rowOrdinal&&o.engine.tupRowInfo[W.rowOrdinal]?o.engine.tupRowInfo[W.rowOrdinal].measureName:W.actualText,Y="row"===W.axis?{hAlign:"Left",bold:!0,wrapText:!0}:{numberFormat:j[Q],bold:!1,wrapText:!0},K={bold:!0,vAlign:"Center",wrapText:!0,indent:0===z?10*W.level:0};if(-1!==W.level||W.rowSpan){var X=o.engine.aggregatedValueMatrix,J="value"===W.axis?X[V]&&X[V][z]?X[V][z]:"#DIV/0!"===W.formattedText||R?W.formattedText:""===W.formattedText?"":W.value:W.formattedText,Z=0===o.parent.dataSourceSettings.rows.length&&"row"===o.parent.dataSourceSettings.valueAxis||0===o.parent.dataSourceSettings.columns.length&&"column"===o.parent.dataSourceSettings.valueAxis;J="grand sum"!==W.type||1===o.parent.dataSourceSettings.values.length&&"row"===o.parent.dataSourceSettings.valueAxis&&"column"===W.axis?"sum"===W.type?J.toString().replace("Total",o.parent.localeObj.getConstant("total")):!(0,t.isNullOrUndefined)(W.valueSort)&&o.parent.localeObj.getConstant("grandTotal")+o.parent.dataSourceSettings.valueSortSettings.headerDelimiter+W.formattedText===W.valueSort.levelName&&Z?o.parent.getValuesHeader(W,"value"):J:Z?o.parent.getValuesHeader(W,"grandTotal"):o.parent.localeObj.getConstant("grandTotal"),W.formattedText=(0,t.isNullOrUndefined)(J)?J:J.toString();var $=!0===W.hasChild&&!1===W.isDrilled,ee="sum"===W.type||"grand sum"===W.type,te=o.parent.gridSettings.repeatItemLabels&&!$&&!ee;if(-1!==W.level||W.rowSpan){var ie=te&&(0===W.rowSpan||W.rowSpan>1||-1===W.rowSpan)?1:W.rowSpan;if(0!==ie){G.push({index:z+1,value:J,colSpan:W.colSpan,rowSpan:ie});var ae=G[G.length-1];if("value"===W.axis)(isNaN(W.value)||""===W.formattedText||void 0===W.formattedText||(0,t.isNullOrUndefined)(W.value))&&(ae.value="Excel"===e?null:""),Y.numberFormat="string"==typeof J?void 0:Y.numberFormat,ae.style=Y;else if(ae.style=K,"row"===W.axis&&(o.parent.isTabular?z<o.parent.engineModule.rowMaxLevel+1:0===z))if(ae.style=Y,"olap"===o.parent.dataType){var re=o.parent.renderModule.indentCollection[V];ae.style.indent=2*re,q=q>re?q:re}else{var ne=W.valueSort?W.valueSort.levelName.toString():"",se=o.parent.dataSourceSettings.valueSortSettings.headerDelimiter,oe=W.actualText?W.actualText.toString().split(se).length:0,le=ne.split(se).length-(oe?oe-1:oe),de=le?le-1:0;ae.style.indent=o.parent.isTabular?0:2*de,q=de>q?de:q}(W.style||ae.style.backColor||ae.style.fontColor||ae.style.fontName||ae.style.fontSize)&&(ae.style.backColor=ae.style.backColor?ae.style.backColor:W.style.backgroundColor,ae.style.fontColor=ae.style.fontColor?ae.style.fontColor:W.style.color,ae.style.fontName=ae.style.fontName?ae.style.fontName:W.style.fontFamily,(0,t.isNullOrUndefined)(ae.style.fontSize)&&(0,t.isNullOrUndefined)(W.style.fontSize)||(ae.style.fontSize=(0,t.isNullOrUndefined)(ae.style.fontSize)?Number(W.style.fontSize.split("px")[0]):Number(ae.style.fontSize))),ae.style.borders={color:"#000000",lineStyle:"thin"};var pe=void 0,he=void 0;"column"===W.axis?(pe={style:(0,t.isNullOrUndefined)(o.theme)||(0,t.isNullOrUndefined)(o.theme.header)?K:o.excelExportHelper.getHeaderThemeStyle(o.theme,K),cell:W},o.parent.trigger(ji,pe)):(he={style:(0,t.isNullOrUndefined)(o.theme)||(0,t.isNullOrUndefined)(o.theme.record)?Y:o.excelExportHelper.getRecordThemeStyle(o.theme,Y),cell:W,column:void 0,data:L,value:J,colSpan:1},o.parent.trigger(Hi,he)),ae.value="column"===W.axis?pe.cell.formattedText:he.value,ae.style="column"===W.axis?pe.style:he.style,(pe&&pe.image||he&&he.image)&&(I=o.excelExportHelper.setImage("column"===W.axis?pe:he,z,o.actualrCnt,I)),(0,t.isNullOrUndefined)(pe)||(0,t.isNullOrUndefined)(pe.hyperLink)?(0,t.isNullOrUndefined)(he)||(0,t.isNullOrUndefined)(he.hyperLink)||(ae.hyperlink={target:he.hyperLink.target},ae.value=he.hyperLink.displayText||ae.value):(ae.hyperlink={target:pe.hyperLink.target},ae.value=pe.hyperLink.displayText||ae.value),"column"===W.axis?(ae.colSpan=pe.cell.colSpan,ae.rowSpan=pe.cell.rowSpan):(ae.colSpan=he.colSpan>1?he.colSpan:he.cell.colSpan,ae.rowSpan=he.cell.rowSpan),te&&(ae.rowSpan=1)}}}z+=W.colSpan?W.colSpan-1:0}else{W={formattedText:"",colSpan:1,rowSpan:1};0!==V||0!==z||R||(D?(W.colSpan=o.parent.isTabular?o.parent.engineModule.rowMaxLevel+1:1,W.rowSpan=Object.keys(o.engine.headerContent).length):(W.colSpan=L[0].length-(E-N.length),W.rowSpan=Object.keys(L).length-o.engine.rowCount));pe=void 0;W&&(pe={style:{borders:{color:"#000000",lineStyle:"thin"}},cell:W},o.parent.trigger(ji,pe));var ue=pe.cell;G.push({index:z+1,colSpan:ue.colSpan,rowSpan:ue.rowSpan,value:W.formattedText,style:pe.style}),pe.image&&(I=o.excelExportHelper.setImage(pe,z,o.actualrCnt,I)),(0,t.isNullOrUndefined)(pe)||(0,t.isNullOrUndefined)(pe.hyperLink)||(ue.hyperlink={target:pe.hyperLink.target},ue.value=pe.hyperLink.displayText||ue.value)}var ce={index:o.actualrCnt,cells:G};I>0&&(ce.height=I,I=0),o.rows.push(ce)}if((!n&&"AppendToSheet"===p||"NewSheet"===p)&&(c?o.addHeaderAndFooter(i.footer,"","footer",i.footer.footerRows):!c&&""!==w&&(0,t.isNullOrUndefined)(M.excelExportProperties)?o.addHeaderAndFooter({},w,"footer",void 0):(0,t.isNullOrUndefined)(M.excelExportProperties)||(0,t.isNullOrUndefined)(M.excelExportProperties.footer)||o.addHeaderAndFooter(M.excelExportProperties.footer,"","footer",M.excelExportProperties.footer.footerRows)),o.parent.enableVirtualization){o.columns=[];for(z=0;z<A;z++)o.columns.push({index:z+1,width:o.parent.gridSettings.columnWidth})}else if(o.columns.length<O.length){o.columns=[];for(z=0;z<A;z++){var ge=(0,t.isNullOrUndefined)(O[z])?o.parent.gridSettings.columnWidth:O[z].width;"string"==typeof ge&&-1!==ge.indexOf("px")&&(ge=parseInt(ge,10)),o.columns.push({index:z+1,width:ge})}}q>0&&(o.columns[0].width=100+20*q);var me={columns:o.columns,rows:o.rows,images:o.images,enableRtl:o.parent.enableRtl};o.workSheet.push(me),o.book.worksheets=o.workSheet}var fe=void 0;if(!n){var ve=new Gl.Workbook(o.book,"Excel"===e?"xlsx":"csv",void 0,o.parent.currencyCode),Se=C.split(".").pop();a?fe=ve.saveAsBlob("xlsx"===Se||"Excel"===e?"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet":"text/csv"):ve.save("xlsx"===Se||"csv"===Se?C:C+("Excel"===e?".xlsx":".csv"));var ye={type:e,promise:a?fe:null};o.parent.trigger(ki,ye),o.isHeaderIncluded=!1}l(o.book)}catch(e){d(e)}})},e.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)},e.prototype.destroy=function(){this.rows=[],this.actualrCnt=0,this.engine&&(this.engine=null),this.rows&&(this.rows=null)},e}(),Yl=function(){function e(e){this.createdDocuments=[],this.drawPosition={xPosition:0,yPosition:0},(0,t.initializeTelemetryFeature)("PDFExport","PivotTable"),this.parent=e,this.pdfExportHelper=new Ol}return e.prototype.getModuleName=function(){return"pdfExport"},e.prototype.addPage=function(e,i){-1===this.createdDocuments.indexOf(e.document)&&this.createdDocuments.push(e.document),i=i||this.exportProperties.pdfExportProperties;var r=e.document.sections.add(),n=e.document.pageSettings.height,s=e.document.pageSettings.width;if(this.exportProperties.width||this.exportProperties.height?(e.document.pageSettings.orientation=this.exportProperties.width>this.exportProperties.height||!this.exportProperties.height&&this.exportProperties.width>n||!this.exportProperties.width&&s>this.exportProperties.height?a.PdfPageOrientation.Landscape:a.PdfPageOrientation.Portrait,e.document.pageSettings.size=new a.SizeF(this.exportProperties.width?this.exportProperties.width:s,this.exportProperties.height?this.exportProperties.height:n)):(e.document.pageSettings.orientation=0===this.exportProperties.orientation||this.exportProperties.orientation?this.exportProperties.orientation:(0,t.isNullOrUndefined)(i)||(0,t.isNullOrUndefined)(i.pageOrientation)||"Landscape"===i.pageOrientation?a.PdfPageOrientation.Landscape:a.PdfPageOrientation.Portrait,(0,t.isNullOrUndefined)(i)||(0,t.isNullOrUndefined)(i.pageSize)||(e.document.pageSettings.size=Hs.getPageSize(i.pageSize))),!(0,t.isNullOrUndefined)(this.exportProperties.pdfMargins)){var o=e.document.pageSettings.margins;o.top=(0,t.isNullOrUndefined)(this.exportProperties.pdfMargins.top)?o.top:this.exportProperties.pdfMargins.top,o.bottom=(0,t.isNullOrUndefined)(this.exportProperties.pdfMargins.bottom)?o.bottom:this.exportProperties.pdfMargins.bottom,o.left=(0,t.isNullOrUndefined)(this.exportProperties.pdfMargins.left)?o.left:this.exportProperties.pdfMargins.left,o.right=(0,t.isNullOrUndefined)(this.exportProperties.pdfMargins.right)?o.right:this.exportProperties.pdfMargins.right}r.setPageSettings(e.document.pageSettings);var l=r.pages.add();return(0,t.isNullOrUndefined)(i)||(0,t.isNullOrUndefined)(i.header)||(0,t.isNullOrUndefined)(this.pdfExportHelper)||this.pdfExportHelper.drawHeader(i,e.document),(0,t.isNullOrUndefined)(i)||(0,t.isNullOrUndefined)(i.footer)||(0,t.isNullOrUndefined)(this.pdfExportHelper)||this.pdfExportHelper.drawFooter(i,e.document),l},e.prototype.getFontStyle=function(e){var i=a.PdfFontStyle.Regular;return!(0,t.isNullOrUndefined)(e)&&e.bold&&(i|=a.PdfFontStyle.Bold),!(0,t.isNullOrUndefined)(e)&&e.italic&&(i|=a.PdfFontStyle.Italic),!(0,t.isNullOrUndefined)(e)&&e.underline&&(i|=a.PdfFontStyle.Underline),!(0,t.isNullOrUndefined)(e)&&e.strikeout&&(i|=a.PdfFontStyle.Strikeout),i},e.prototype.getBorderStyle=function(e){var i=new a.PdfBorders;if((0,t.isNullOrUndefined)(e)){var r=new a.PdfColor(234,234,234);i.all=new a.PdfPen(r)}else{var n=e.width,s=(0,t.isNullOrUndefined)(n)||"number"!=typeof n?void 0:.75*n,o=new a.PdfColor(196,196,196);if(!(0,t.isNullOrUndefined)(e.color)){var l=this.pdfExportHelper.hexDecToRgb(e.color);o=new a.PdfColor(l.r,l.g,l.b)}var d=new a.PdfPen(o,s);(0,t.isNullOrUndefined)(e.dashStyle)||(d.dashStyle=this.pdfExportHelper.getDashStyle(e.dashStyle)),i.all=d}return i},e.prototype.getStyle=function(){var e=(0,t.isNullOrUndefined)(this.gridStyle)||(0,t.isNullOrUndefined)(this.gridStyle.header)?void 0:this.gridStyle.header,i=(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.fontName)||(0,t.isNullOrUndefined)(this.pdfExportHelper)?a.PdfFontFamily.Helvetica:this.pdfExportHelper.getFontFamily(e.fontName),r=(0,t.isNullOrUndefined)(e)?this.getFontStyle(void 0):this.getFontStyle(e),n=(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.fontSize)?11:.8*e.fontSize,s=new a.PdfColor;if(!(0,t.isNullOrUndefined)(e)&&!(0,t.isNullOrUndefined)(e.fontColor)){var o=this.pdfExportHelper.hexDecToRgb(e.fontColor);s=new a.PdfColor(o.r,o.g,o.b)}var l=new a.PdfStandardFont(i,n,r);return(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.font)||(l=e.font),{border:(0,t.isNullOrUndefined)(e)?this.getBorderStyle(void 0):this.getBorderStyle(e.border),font:l,brush:new a.PdfSolidBrush(s)}},e.prototype.setRecordThemeStyle=function(e){var i=(0,t.isNullOrUndefined)(this.gridStyle)||(0,t.isNullOrUndefined)(this.gridStyle.record)?void 0:this.gridStyle.record,r=(0,t.isNullOrUndefined)(i)||(0,t.isNullOrUndefined)(i.fontName)||(0,t.isNullOrUndefined)(this.pdfExportHelper)?a.PdfFontFamily.Helvetica:this.pdfExportHelper.getFontFamily(i.fontName),n=(0,t.isNullOrUndefined)(i)||(0,t.isNullOrUndefined)(i.fontSize)?11:.8*i.fontSize,s=(0,t.isNullOrUndefined)(i)?this.getFontStyle(void 0):this.getFontStyle(i),o=new a.PdfStandardFont(r,n,s);(0,t.isNullOrUndefined)(i)||(0,t.isNullOrUndefined)(i.font)||(o=i.font),e.style.setFont(o);var l=new a.PdfColor;if(!(0,t.isNullOrUndefined)(i)&&!(0,t.isNullOrUndefined)(i.fontColor)){var d=this.pdfExportHelper.hexDecToRgb(i.fontColor);l=new a.PdfColor(d.r,d.g,d.b)}e.style.setTextBrush(new a.PdfSolidBrush(l));var p=(0,t.isNullOrUndefined)(i)||(0,t.isNullOrUndefined)(i.border)?this.getBorderStyle(void 0):this.getBorderStyle(i.border);return e.style.setBorder(p),e},e.prototype.exportToPDF=function(e,i,r,n,s){var o,l=this;this.parent=(0,t.isNullOrUndefined)(s)?this.parent:s,this.engine="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,this.gridStyle=(0,t.isNullOrUndefined)(this.exportProperties)||(0,t.isNullOrUndefined)(this.exportProperties.pdfExportProperties)?void 0:this.exportProperties.pdfExportProperties.theme;var d,p=this.applyEvent(),h=0;(0,t.isNullOrUndefined)(r)||(p.document=r.document);var u=this.getStyle(),c=(0,t.isNullOrUndefined)(this.exportProperties)||(0,t.isNullOrUndefined)(this.exportProperties.fileName)?(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.fileName)?"default":e.fileName:this.exportProperties.fileName,g=100+20*(this.parent.renderModule&&this.parent.renderModule.maxIndent||5),m=0,f=p.args.pivotValues[m],v=Hs.getPivotEmptyInfo(this.parent,this.engine);v&&(f=Hs.getEmptyPivotValues(this.parent));var S=(0,t.isNullOrUndefined)(f)||(0,t.isNullOrUndefined)(f[0])?void 0:f[0],y=!(0,t.isNullOrUndefined)(this.exportProperties)&&this.exportProperties.columnSize>0?this.exportProperties.columnSize:(0,t.isNullOrUndefined)(this.exportProperties)||(0,t.isNullOrUndefined)(this.exportProperties.pdfExportProperties)||!this.exportProperties.pdfExportProperties.allowHorizontalOverflow||(0,t.isNullOrUndefined)(S)?!(0,t.isNullOrUndefined)(S)&&S.length>5?6:(0,t.isNullOrUndefined)(S)?Math.floor((540-g)/90)+1:S.length:S.length;this.exportProperties.allowRepeatHeader=!0===this.exportProperties.allowRepeatHeader||(0,t.isNullOrUndefined)(this.exportProperties.allowRepeatHeader);var b,C=!!this.exportProperties.allowRepeatHeader&&this.exportProperties.allowRepeatHeader&&y>1;this.parent.isTabular&&(y=(b=this.parent.engineModule.rowMaxLevel)+1<y?y:b+2);for(var x=0;C&&x<f.length;x++)for(var w=y;f[x]&&w<f[x].length;w+=y){var T=this.parent.isTabular?f[x].slice(0,b+1):[f[x][0]];(o=f[x]).splice.apply(o,[w,0].concat(T))}var M=f&&f.length>0?f[0].length:0,D=0;do{(0,t.isNullOrUndefined)(e)||(this.exportProperties.header=(0,t.isNullOrUndefined)(e.header)||(0,t.isNullOrUndefined)(e.header.contents)||(0,t.isNullOrUndefined)(e.header.contents[0].value)?this.exportProperties.header:e.header.contents[0].value,this.exportProperties.footer=(0,t.isNullOrUndefined)(e.footer)||(0,t.isNullOrUndefined)(e.footer.contents)||(0,t.isNullOrUndefined)(e.footer.contents[0].value)?this.exportProperties.footer:e.footer.contents[0].value);var O=r&&r.result?r.result:null,N=r&&e&&e.multipleExport&&"AppendToPage"===e.multipleExport.type&&O?O.page:this.addPage(p,e),P=new a.PdfGrid,E=y>0?y:5;if(f&&f.length>0){P.columns.add(f[0].length-D>=E?E:f[0].length-D);for(var I=f.length,F=0,L=0,A=0,R=0;R<I;R++)if(f[R]){var k=!(f[R][0]&&"row"===f[R][0].axis),j=f[R].length>D+E?D+E:f[R].length,q=0;k&&P.headers.add(1);var H=k?P.headers.getHeader(F):P.rows.addRow();(0,t.isNullOrUndefined)(H)||(H.height=this.parent&&this.parent.gridSettings?this.parent.gridSettings.rowHeight:H.height),(0,t.isNullOrUndefined)(P.style)||(P.style.cellPadding=new a.PdfPaddings(5.76,5.76,1.76,1.76)),P.repeatHeader=!0,k?(H.style.setBorder(u.border),u.font&&H.style.setFont(u.font),H.style.setTextBrush(u.brush)):this.setRecordThemeStyle(H);for(var V=0,U=!0,B=D;B<j;B++){var _=!1,G=new a.PdfStringFormat;if(G.lineAlignment=a.PdfVerticalAlignment.Middle,f[R][B]){var z=!0===(Z=f[R][B]).hasChild&&!1===Z.isDrilled,W="sum"===Z.type||"grand sum"===Z.type,Q=this.parent.gridSettings.repeatItemLabels&&!z&&!W;0===Z.rowSpan&&Q&&(Z=Object.assign({},Z,{rowSpan:1}));var Y=Z.formattedText,K=void 0;0!==Z.rowSpan&&(Y=0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length?this.parent.getValuesHeader(Z,"value"):Y,Y="grand sum"===Z.type?0===this.parent.dataSourceSettings.rows.length||0===this.parent.dataSourceSettings.columns.length?this.parent.getValuesHeader(Z,"grandTotal"):this.parent.localeObj.getConstant("grandTotal"):"sum"===Z.type?Y.toString().replace("Total",this.parent.localeObj.getConstant("total")):Y,Z.colSpan>1&&(K=H.cells.getCell(V)),(-1!==Z.level||Z.rowSpan)&&(H.cells.getCell(V).columnSpan=Z.colSpan?E-V<Z.colSpan?E-V:Z.colSpan:1,k&&Z.rowSpan&&Z.rowSpan>1||!k&&Z.rowSpan&&Z.rowSpan>1&&this.parent.isTabular?H.cells.getCell(V).rowSpan=Q?1:Z.rowSpan?Z.rowSpan:1:Q&&1===Z.rowSpan&&(H.cells.getCell(V).rowSpan=1),H.cells.getCell(V).value=Y?Y.toString():"",""!==Y&&(U=!1))),L=Z.level>L?Z.level:L,_="value"===Z.axis,B+=H.cells.getCell(V).columnSpan?H.cells.getCell(V).columnSpan-1:0,V+=H.cells.getCell(V).columnSpan?H.cells.getCell(V).columnSpan-1:0;var X=!(0,t.isNullOrUndefined)(K)&&K.colSpan>1?K:H.cells.getCell(V);(H&&H.isHeaderRow||Z.isGrandSum||"grand sum"===Z.type||"row"===Z.axis)&&!(0,t.isNullOrUndefined)(this.pdfExportHelper)&&this.pdfExportHelper.applyHeaderBackground(X),Z.style&&(H=this.applyStyle(H,Z,V)),G.alignment=_?a.PdfTextAlignment.Right:a.PdfTextAlignment.Left,X.style.stringFormat=G;var J={style:void 0,pivotCell:Z,cell:H.cells.getCell(V),column:P.columns.getColumn(V)};this.parent.trigger(Ui,J),"column"===Z.axis?(J={style:J.style,cell:J.cell,gridCell:J.pivotCell,value:Y},this.parent.trigger(qi,J),X.value=J.value?J.value:Y,(0,t.isNullOrUndefined)(this.pdfExportHelper)||((0,t.isNullOrUndefined)(J.image)||this.pdfExportHelper.configureCellImage(X,J.image,H),this.pdfExportHelper.setHyperLink(X,J,H,Z,this.parent))):(J={style:J.style,cell:J.cell,column:void 0,data:J.pivotCell,value:Y},this.parent.trigger(Vi,J),X.value=J.value?J.value:Y,(0,t.isNullOrUndefined)(this.pdfExportHelper)||((0,t.isNullOrUndefined)(J.image)||this.pdfExportHelper.configureCellImage(X,J.image,H),this.pdfExportHelper.setHyperLink(X,J,H,Z,this.parent))),J.style&&this.processCellStyle(X,J)}else{G.alignment=_?a.PdfTextAlignment.Right:a.PdfTextAlignment.Left,(X=H.cells.getCell(V)).style.stringFormat=G;J={style:void 0,pivotCell:void 0,cell:X,column:P.columns.getColumn(V)};this.parent.trigger(Ui,J),A=J.column.width;var Z={formattedText:"",colIndex:0,rowIndex:R};J={style:J.style,cell:J.cell,gridCell:Z,value:void 0},this.parent.trigger(qi,J),X.value=J.value?J.value:"",(0,t.isNullOrUndefined)(this.pdfExportHelper)||((0,t.isNullOrUndefined)(J.image)||this.pdfExportHelper.configureCellImage(X,J.image,H),H.isHeaderRow&&this.pdfExportHelper.applyHeaderBackground(X),this.pdfExportHelper.setHyperLink(X,J,H,Z,this.parent)),J.style&&this.processCellStyle(X,J),v||(this.parent.isTabular&&0===q?(0===B&&k&&this.parent.dataSourceSettings.columns&&this.parent.dataSourceSettings.columns.length>0?(P.headers.getHeader(0).cells.getCell(0).rowSpan=Object.keys(this.engine.headerContent).length+1,P.headers.getHeader(0).cells.getCell(0).columnSpan=this.parent.engineModule.rowMaxLevel+1):0!==B&&k&&this.parent.dataSourceSettings.columns&&this.parent.dataSourceSettings.columns.length>0&&P.headers.getHeader(0).cells.getCell(0).rowSpan<Object.keys(this.engine.headerContent).length&&(P.headers.getHeader(0).cells.getCell(0).rowSpan=Object.keys(this.engine.headerContent).length,P.headers.getHeader(0).cells.getCell(0).columnSpan=this.parent.engineModule.rowMaxLevel+1),q++):(0===B&&k&&this.parent.dataSourceSettings.columns&&this.parent.dataSourceSettings.columns.length>0||0!==B&&k&&this.parent.dataSourceSettings.columns&&this.parent.dataSourceSettings.columns.length>0&&P.headers.getHeader(0).cells.getCell(0).rowSpan<Object.keys(this.engine.headerContent).length)&&P.headers.getHeader(0).cells.getCell(0).rowSpan++)}if("olap"===this.parent.dataType){var $=0;if(!k&&0===V)if(X=f[R][B])$=(ee=X.valueSort.levelName.toString()).split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-1;G.paragraphIndent=15*$,L=L>$?L:$}else if(G.paragraphIndent=0,!k&&0===V&&f[R][B]&&-1!==f[R][B].level){var ee=(X=f[R][B]).valueSort?X.valueSort.levelName.toString():"",te=X.actualText?X.actualText.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length:0,ie=ee.split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).length-(te?te-1:te),ae=ie?ie-1:0;G.paragraphIndent=10*ae}V++}U&&(H.height=16),F++}P.columns.getColumn(0).width=A>0?A:100+20*L}0===D&&this.parent.dataSourceSettings.columns&&this.parent.dataSourceSettings.columns.length>0&&!v&&P.headers.getHeader(0).cells.getCell(0).rowSpan--;var re=this.drawPosition.xPosition,ne=void 0;if(!((0,t.isNullOrUndefined)(r)||(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.multipleExport)||"AppendToPage"!==e.multipleExport.type||(0,t.isNullOrUndefined)(O)||(0,t.isNullOrUndefined)(O.bounds))){var se=O.bounds.y+O.bounds.height;ne=(0,t.isNullOrUndefined)(e.multipleExport.blankSpace)?se:se+e.multipleExport.blankSpace,(h>0||P.gridHeaders.rows[0].height+P.gridHeaders.count+ne>=N.getClientSize().height)&&(N=this.addPage(p,e),ne=this.drawPosition.yPosition)}else ne=this.drawPosition.yPosition;d=P.draw(N,new a.PointF(re,ne)),h++,(D+=E)>=M&&p.args.pivotValues.length>m+1&&(m++,M=(f=p.args.pivotValues[m])&&f.length>0?f[0].length:0,D=0,h=0)}while(D<M);return new Promise(function(t){var a;h=0,n||i?n&&(a=p.document.save()):(p.document.save(c+".pdf"),p.document.destroy());var r={type:"PDF",promise:n?a:null};l.parent.trigger(ki,r),e&&e.multipleExport&&"AppendToPage"===e.multipleExport.type?t({document:p.document,result:d}):t(p.document)})},e.prototype.applyStyle=function(e,t,i){var r=this.parent.conditionalFormattingModule.hexToRgb(t.style.backgroundColor),n=new a.PdfSolidBrush(new a.PdfColor(r.r,r.g,r.b));e.cells.getCell(i).style.backgroundBrush=n;var s=Number(t.style.fontSize.split("px")[0]),o=new a.PdfStandardFont(a.PdfFontFamily.TimesRoman,s,a.PdfFontStyle.Regular);return e.cells.getCell(i).style.font=o,r=this.parent.conditionalFormattingModule.hexToRgb(t.style.color),n=new a.PdfSolidBrush(new a.PdfColor(r.r,r.g,r.b)),e.cells.getCell(i).style.textBrush=n,e},e.prototype.getFont=function(e){if(e.style.font)return e.style.font;var i=(0,t.isNullOrUndefined)(e.style.fontSize)?e.cell.cellStyle.font&&e.cell.cellStyle.font.fontSize?e.cell.cellStyle.font.fontSize:11:.8*e.style.fontSize,r=(0,t.isNullOrUndefined)(e.style.fontFamily)||(0,t.isNullOrUndefined)(this.pdfExportHelper)?a.PdfFontFamily.TimesRoman:this.pdfExportHelper.getFontFamily(e.style.fontFamily),n=a.PdfFontStyle.Regular;return!(0,t.isNullOrUndefined)(e.style.bold)&&e.style.bold&&(n|=a.PdfFontStyle.Bold),!(0,t.isNullOrUndefined)(e.style.italic)&&e.style.italic&&(n|=a.PdfFontStyle.Italic),!(0,t.isNullOrUndefined)(e.style.underline)&&e.style.underline&&(n|=a.PdfFontStyle.Underline),!(0,t.isNullOrUndefined)(e.style.strikeout)&&e.style.strikeout&&(n|=a.PdfFontStyle.Strikeout),new a.PdfStandardFont(r,i,n)},e.prototype.processCellStyle=function(e,i){if(!(0,t.isNullOrUndefined)(i.style.backgroundColor)){var r=this.pdfExportHelper.hexDecToRgb(i.style.backgroundColor);e.style.backgroundBrush=new a.PdfSolidBrush(new a.PdfColor(r.r,r.g,r.b))}if(!(0,t.isNullOrUndefined)(i.style.textBrushColor)){var n=this.pdfExportHelper.hexDecToRgb(i.style.textBrushColor);e.style.textBrush=new a.PdfSolidBrush(new a.PdfColor(n.r,n.g,n.b))}if(!(0,t.isNullOrUndefined)(i.style.textPenColor)){var s=this.pdfExportHelper.hexDecToRgb(i.style.textPenColor);e.style.textPen=new a.PdfPen(new a.PdfColor(s.r,s.g,s.b))}if((0,t.isNullOrUndefined)(i.style.fontFamily)&&(0,t.isNullOrUndefined)(i.style.fontSize)&&(0,t.isNullOrUndefined)(i.style.bold)&&(0,t.isNullOrUndefined)(i.style.italic)&&(0,t.isNullOrUndefined)(i.style.underline)&&(0,t.isNullOrUndefined)(i.style.strikeout)||(e.style.font=this.getFont(i)),!(0,t.isNullOrUndefined)(i.style.border)){var o=new a.PdfBorders,l=i.style.border.width,d=(0,t.isNullOrUndefined)(l)||"number"!=typeof l?void 0:.75*l,p=new a.PdfColor(196,196,196);if(!(0,t.isNullOrUndefined)(i.style.border.color)){var h=this.pdfExportHelper.hexDecToRgb(i.style.border.color);p=new a.PdfColor(h.r,h.g,h.b)}var u=new a.PdfPen(p,d);(0,t.isNullOrUndefined)(i.style.border.dashStyle)||(u.dashStyle=this.pdfExportHelper.getDashStyle(i.style.border.dashStyle)),o.all=u,e.style.borders=o}(0,t.isNullOrUndefined)(i.style)||(0,t.isNullOrUndefined)(i.style.textAlignment)||(0,t.isNullOrUndefined)(e.style)||(0,t.isNullOrUndefined)(e.style.stringFormat)||(e.style.stringFormat.alignment="Right"===i.style.textAlignment?a.PdfTextAlignment.Right:a.PdfTextAlignment.Left),(0,t.isNullOrUndefined)(i.style)||(0,t.isNullOrUndefined)(i.style.verticalAlignment)||(0,t.isNullOrUndefined)(e.style)||(0,t.isNullOrUndefined)(e.style.stringFormat)||(e.style.stringFormat.lineAlignment="Top"===i.style.verticalAlignment?a.PdfVerticalAlignment.Top:"Bottom"===i.style.verticalAlignment?a.PdfVerticalAlignment.Bottom:a.PdfVerticalAlignment.Middle)},e.prototype.applyEvent=function(){var e,t,i=zl.getClonedPivotValues(this.engine.pivotValues);if(this.parent.exportAllPages&&(this.parent.enableVirtualization||this.parent.enablePaging)&&"Server"!==this.parent.dataSourceSettings.mode){var r=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=zl.getClonedPivotValues(this.engine.pivotValues),this.engine.pivotValues=i,this.engine.pageSettings=r,this.engine.isPagingOrVirtualizationEnabled=!0,"olap"===this.parent.dataType&&(this.updateOlapPageSettings(!1),this.parent.olapEngineModule.mdxQuery=t)}else e=i;var n={pivotValues:[e]};return this.parent.trigger(Ei,n),this.document=new a.PdfDocument,{document:this.document,args:n}},e.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)},e.prototype.cleanupDocument=function(e){if(e){e.destroy();var t=this.createdDocuments.indexOf(e);-1!==t&&this.createdDocuments.splice(t,1)}},e.prototype.destroy=function(){for(var e=0;e<this.createdDocuments.length;e++)this.cleanupDocument(this.createdDocuments[e]);this.createdDocuments=[],this.document&&(this.cleanupDocument(this.document),this.document=null),this.pdfExportHelper&&(this.pdfExportHelper=null),this.engine&&(this.engine=null),this.exportProperties&&(this.exportProperties=null),this.gridStyle&&(this.gridStyle=null)},e}(),Kl=function(){function e(e){this.uiComponents=[],this.parent=e,this.parent.pagerModule=this,this.addEventListener()}return e.prototype.getModuleName=function(){return"pager"},e.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(wr,this.createPager,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||((0,t.isNullOrUndefined)(this.parent.pagerSettings.template)&&this.unWireEvent(),this.parent.off(wr,this.createPager))},e.prototype.trackUIComponent=function(e,t){t&&"object"==typeof t&&this.uiComponents.push({type:e,instance:t})},e.prototype.createPager=function(){var e=(0,t.select)("#"+this.parent.element.id+"pivot-pager",this.parent.element);null!==e&&((0,t.remove)(e),this.destroy(),this.addEventListener());var i=this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber(),a=this.parent.pagerSettings;if(this.parent.enablePaging){var r=(0,t.createElement)("div",{id:this.parent.element.id+"pivot-pager",className:fi+" "+(this.parent.isAdaptive||i<650?s:"")+" "+(this.parent.enableRtl?n:"")+" "+("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&&(0,t.select)("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)&&"Top"===a.position?this.parent.element.insertBefore(r,(0,t.select)("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)):this.parent.showGroupingBar&&(0,t.select)("#"+this.parent.element.id+" ."+hi,this.parent.element)&&"Top"===a.position?this.parent.element.insertBefore(r,(0,t.select)("#"+this.parent.element.id+" ."+hi,this.parent.element)):"Top"===this.parent.pagerSettings.position?this.parent.element.insertBefore(r,(0,t.select)("#"+this.parent.element.id+"_grid",this.parent.element)):this.parent.element.append(r);var o=this;if(this.pager=new _s.Pager({enableRtl:this.parent.enableRtl,locale:this.parent.locale,template:""===a.template||a.template?a.template:(0,t.initializeCSPTemplate)(function(){return o.createPagerContainer()}),cssClass:this.parent.cssClass}),this.pager.isVue=this.parent.isVue,this.pager.appendTo(r),(0,t.isNullOrUndefined)(a.template)){if(a.showRowPager){if(!a.enableCompactView&&i>400){var l=new zs.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,change:this.rowPageChange.bind(this),cssClass:this.parent.cssClass});l.appendTo((0,t.select)("#"+this.parent.element.id+"_row_textbox",this.parent.element));var d=(0,t.select)("#"+this.parent.element.id+"_row_PageInfoContainer",this.parent.element),p=(0,t.select)(".e-numeric",d);this.setPagerWidthClasses(p,i),this.trackUIComponent("NumericTextBox",l)}if(a.showRowPageSize){var h=this.parent.pagerSettings.rowPageSizes.slice(0);-1===this.parent.pagerSettings.rowPageSizes.indexOf(this.parent.pageSettings.rowPageSize)&&(h.push(this.parent.pageSettings.rowPageSize),h.sort(function(e,t){return e-t}));var u=new Ws.DropDownList({dataSource:h,value:this.parent.pageSettings.rowPageSize,enableRtl:this.parent.enableRtl,locale:this.parent.locale,change:this.rowPageSizeChange.bind(this),popupHeight:"300px",popupWidth:"100%",cssClass:this.parent.cssClass});u.isAngular=this.parent.isModalDialog,u.appendTo((0,t.select)("#"+this.parent.element.id+"_row_size_list",this.parent.element)),this.trackUIComponent("DropDownList",u)}}if(a.showColumnPager){if(!a.enableCompactView&&i>400){var c=new zs.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,change:this.columnPageChange.bind(this),cssClass:this.parent.cssClass});c.appendTo((0,t.select)("#"+this.parent.element.id+"_column_textbox",this.parent.element));var g=(0,t.select)("#"+this.parent.element.id+"_column_PageInfoContainer",this.parent.element),m=(0,t.select)(".e-numeric",g);this.setPagerWidthClasses(m,i),this.trackUIComponent("NumericTextBox",c)}if(a.showColumnPageSize){var f=this.parent.pagerSettings.columnPageSizes.slice(0);-1===this.parent.pagerSettings.columnPageSizes.indexOf(this.parent.pageSettings.columnPageSize)&&(f.push(this.parent.pageSettings.columnPageSize),f.sort(function(e,t){return e-t}));var v=new Ws.DropDownList({dataSource:f,value:this.parent.pageSettings.columnPageSize,enableRtl:this.parent.enableRtl,locale:this.parent.locale,change:this.columnPageSizeChange.bind(this),popupHeight:"300px",popupWidth:"100%",cssClass:this.parent.cssClass});v.isAngular=this.parent.isModalDialog,v.appendTo((0,t.select)("#"+this.parent.element.id+"_column_size_list",this.parent.element)),this.trackUIComponent("DropDownList",v)}}this.unWireEvent(),this.wireEvent()}}},e.prototype.setPagerWidthClasses=function(e,t){t>669?(e.classList.add("wide-width"),e.classList.remove("narrow-width")):(e.classList.add("narrow-width"),e.classList.remove("wide-width"))},e.prototype.onPagerIconKeyDown=function(e){"Enter"!==e.key&&" "!==e.key||e.target.classList.contains(l)||(e.preventDefault(),e.target.click())},e.prototype.wireEvent=function(){for(var e=[].slice.call(this.parent.element.querySelectorAll("."+p+", ."+u+", ."+c+", ."+h)),i=0;i<e.length;i++)t.EventHandler.add(e[i],"click",this.updatePageSettings,this),t.EventHandler.add(e[i],"keydown",this.onPagerIconKeyDown,this)},e.prototype.unWireEvent=function(){for(var e=[].slice.call(this.parent.element.querySelectorAll("."+p+", ."+u+", ."+c+", ."+h)),i=0;i<e.length;i++)t.EventHandler.remove(e[i],"click",this.updatePageSettings),t.EventHandler.remove(e[i],"keydown",this.onPagerIconKeyDown)},e.prototype.columnPageChange=function(e){Hs.invokeActionMethod(this.parent,or,Dn)||(this.parent.pageSettings.currentColumnPage=e.value,Hs.invokeActionMethod(this.parent,lr,Ds,{pagingInfo:{currentColumnPage:e.value}}))},e.prototype.rowPageChange=function(e){Hs.invokeActionMethod(this.parent,or,Mn)||(this.parent.pageSettings.currentRowPage=e.value,Hs.invokeActionMethod(this.parent,lr,Ms,{pagingInfo:{currentRowPage:e.value}}))},e.prototype.columnPageSizeChange=function(e){var t=Number(e.value);Hs.invokeActionMethod(this.parent,or,Nn)||(this.parent.pageSettings.columnPageSize=t,Hs.invokeActionMethod(this.parent,lr,Ns,{pagingInfo:{columnPageSize:t}}))},e.prototype.rowPageSizeChange=function(e){var t=Number(e.value);Hs.invokeActionMethod(this.parent,or,On)||(this.parent.pageSettings.rowPageSize=t,Hs.invokeActionMethod(this.parent,lr,Os,{pagingInfo:{rowPageSize:t}}))},e.prototype.updatePageSettings=function(e,i){var a=e.target.id,r="",n=0,s="",o=(0,t.isNullOrUndefined)(i)?this.parent:i;switch(a){case this.parent.element.id+"_row_firstIcon":r=Mn,n=1,s="row";break;case this.parent.element.id+"_row_prevIcon":r=Mn,n=this.parent.pageSettings.currentRowPage>1?this.parent.pageSettings.currentRowPage-1:this.parent.pageSettings.currentRowPage,s="row";break;case this.parent.element.id+"_row_nextIcon":r=Mn,n=this.parent.pageSettings.currentRowPage<this.parent.engineModule.rowPageCount?this.parent.pageSettings.currentRowPage+1:this.parent.pageSettings.currentRowPage,s="row";break;case this.parent.element.id+"_row_lastIcon":r=Mn,n=this.parent.engineModule.rowPageCount,s="row";break;case this.parent.element.id+"_column_firstIcon":r=Dn,n=1,s="column";break;case this.parent.element.id+"_column_prevIcon":r=Dn,n=this.parent.pageSettings.currentColumnPage>1?this.parent.pageSettings.currentColumnPage-1:this.parent.pageSettings.currentColumnPage,s="column";break;case this.parent.element.id+"_column_nextIcon":r=Dn,n=this.parent.pageSettings.currentColumnPage<this.parent.engineModule.columnPageCount?this.parent.pageSettings.currentColumnPage+1:this.parent.pageSettings.currentColumnPage,s="column";break;case this.parent.element.id+"_column_lastIcon":r=Dn,n=this.parent.engineModule.columnPageCount,s="column"}if(r){if(Hs.invokeActionMethod(o,or,r))return;"row"===s?this.parent.pageSettings.currentRowPage=n:"column"===s&&(this.parent.pageSettings.currentColumnPage=n),Hs.invokeActionMethod(o,lr,"row"===s?Ms:Ds,{pagingInfo:"row"===s?{currentRowPage:n}:{currentColumnPage:n}})}},e.prototype.createPagerContainer=function(){var e,i,a=this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber(),r=this.parent.pagerSettings;r.showRowPager&&(e=this.createPagerItems("row",r,a)),r.showColumnPager&&(i=this.createPagerItems("column",r,a));var n=(0,t.createElement)("div",{id:this.parent.element.id+"_mainDiv",className:"e-pivot-pager-maindiv "+(r.showRowPager&&r.showColumnPager?"":"e-pivot-pager-single-maindiv")+" "+(r.isInversed?"e-inverse-view":"")}),s=(0,t.createElement)("div",{id:this.parent.element.id+"_vertical_separator",className:this.parent.isAdaptive||a<650?"e-pivotview-hseparator":"e-pivotview-vseparator"});return r.isInversed&&r.showColumnPager&&r.showRowPager?n.append(i,s,e):r.showColumnPager&&r.showRowPager?n.append(e,s,i):r.showRowPager&&!r.showColumnPager?n.append(e):!r.showRowPager&&r.showColumnPager&&n.append(i),n.outerHTML},e.prototype.createPagerItems=function(e,i,a){var r=!i.showRowPager||!i.showColumnPager,n=(0,t.createElement)("div",{id:this.parent.element.id+"_"+e+"_mainDiv",className:"row"===e?"e-pivot-pager-row-maindiv "+(i.showRowPageSize?"":Si):"e-pivot-pager-column-maindiv "+(i.showColumnPageSize?"":Si),attrs:{role:"region","aria-label":"row"===e?this.parent.localeObj.getConstant("rowPage")+" Page Navigation":this.parent.localeObj.getConstant("columnPage")+" Page Navigation"}}),s=(0,t.createElement)("div",{id:this.parent.element.id+"_"+e+"_pagerSettings",className:"row"===e?"e-pivot-row-pager-settings":"e-pivot-column-pager-settings"});this.parent.pagerSettings.showColumnPager&&this.parent.pagerSettings.showRowPager&&s.classList.add("e-pivot-both-pager-settings");var o="column"===e&&1===this.parent.pageSettings.currentColumnPage||"row"===e&&1===this.parent.pageSettings.currentRowPage,d="column"===e&&this.parent.pageSettings.currentColumnPage===this.parent.engineModule.columnPageCount||"row"===e&&this.parent.pageSettings.currentRowPage===this.parent.engineModule.rowPageCount,p=(0,t.createElement)("div",{id:this.parent.element.id+"_"+e+"_NavContainer",attrs:{class:"e-pivot-pager-nav-container "+vi}}),h=(0,t.createElement)("div",{id:this.parent.element.id+"_"+e+"_PageInfoContainer",attrs:{class:"e-pivot-pager-info-container "+vi}}),u=(0,t.createElement)("div",{id:this.parent.element.id+"_"+e+"_firstIcon",attrs:{class:"e-first e-icons e-icon-first"+(o?" e-firstpagedisabled "+l:" e-firstpage e-pager-default"),title:this.parent.localeObj.getConstant("goToFirstPage"),"aria-label":this.parent.localeObj.getConstant("goToFirstPage"),"aria-disabled":o?"true":"false",tabindex:o?"-1":"0",role:"button"}}),c=(0,t.createElement)("div",{id:this.parent.element.id+"_"+e+"_prevIcon",attrs:{class:"e-prev e-icons e-icon-prev"+(o?" e-prevpagedisabled "+l:" e-prevpage e-pager-default"),title:this.parent.localeObj.getConstant("goToPreviousPage"),"aria-label":this.parent.localeObj.getConstant("goToPreviousPage"),"aria-disabled":o?"true":"false",tabindex:o?"-1":"0",role:"button"}}),g=(0,t.createElement)("span",{id:this.parent.element.id+"_"+e+"_pagerString",className:"row"===e?"e-pivotview-row-pagerString":"e-pivotview-column-pagerString"});g.innerText="row"===e?this.parent.localeObj.getConstant("rowPage"):this.parent.localeObj.getConstant("columnPage");var m=(0,t.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"}}),f=(0,t.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"}),v=(0,t.createElement)("span",{id:this.parent.element.id+"_"+e+"_ofString",className:"row"===e?"e-pivot-row-of-string":"e-pivot-column-of-string"});v.innerText=this.parent.localeObj.getConstant("of")+" ";var S=(0,t.createElement)("span",{id:this.parent.element.id+"_"+e+"_pagerNumber",className:"row"===e?"e-pivotview-row-pagerNumber":"e-pivotview-column-pagerNumber"});S.innerText=("row"===e?this.parent.engineModule.rowPageCount:this.parent.engineModule.columnPageCount).toString();var y=(0,t.createElement)("div",{id:this.parent.element.id+"_"+e+"_nextIcon",attrs:{class:"e-next e-icons e-icon-next"+(d?" e-nextpagedisabled "+l:" e-nextpage e-pager-default"),title:this.parent.localeObj.getConstant("goToNextPage"),"aria-label":this.parent.localeObj.getConstant("goToNextPage"),"aria-disabled":d?"true":"false",tabindex:d?"-1":"0",role:"button"}}),b=(0,t.createElement)("div",{id:this.parent.element.id+"_"+e+"_lastIcon",attrs:{class:"e-last e-icons e-icon-last"+(d?" e-lastpagedisabled "+l:" e-lastpage e-pager-default"),title:this.parent.localeObj.getConstant("goToLastPage"),"aria-label":this.parent.localeObj.getConstant("goToLastPage"),"aria-disabled":d?"true":"false",tabindex:d?"-1":"0",role:"button"}}),C=(0,t.createElement)("span",{id:this.parent.element.id+"_"+e+"_size",className:"row"===e?"e-pivotview-row-size":"e-pivotview-column-size"});C.innerText="row"===e?this.parent.localeObj.getConstant("rowPerPage"):this.parent.localeObj.getConstant("columnPerPage");var x=(0,t.createElement)("div",{id:this.parent.element.id+"_"+e+"_size_list_maindiv",className:"e-pager-dropdown "+vi}),w=(0,t.createElement)("div",{id:this.parent.element.id+"_"+e+"_size_list",className:"row"===e?"e-pivot-row-size-list":"e-pivot-column-size-list"}),T=(0,t.createElement)("div",{id:this.parent.element.id+"_"+e+"_text_div",className:"e-pivotview-text-div"}),M=(0,t.createElement)("div",{id:this.parent.element.id+"_"+e+"_text_div_1",className:"e-pivotview-text-div-1"});return x.append(w),i.enableCompactView||a<400?(p.append(c,y),s.append(p)):(f.append(v,S),p.append(u,c,y,b),h.append(m,f),s.append(p,h)),("row"===e&&i.showRowPager||"column"===e&&i.showColumnPager)&&(("column"===e&&!i.showRowPager||"row"===e&&!i.showColumnPager)&&r&&M.append(C,x),i.showColumnPager&&i.showRowPager||!r?("row"===e&&i.showRowPageSize||"column"===e&&i.showColumnPageSize?!i.enableCompactView&&a>400?(T.append(g,C),M.append(s,x)):(T.append(g,s),M.append(C,x)):("row"===e&&!i.showRowPageSize||"column"===e&&!i.showColumnPageSize)&&(T.append(g),M.append(s)),n.append(T,M)):("row"===e&&(i.showRowPageSize?n.append(s,g,M):n.append(s,g)),"column"===e&&(i.showColumnPageSize?n.append(s,g,M):n.append(s,g)))),n},e.prototype.cleanupUIComponents=function(){if(this.uiComponents&&this.uiComponents.length>0){for(var e=0;e<this.uiComponents.length;e++){var t=this.uiComponents[e].instance;t&&"function"==typeof t.destroy&&t.destroy()}this.uiComponents=[]}},e.prototype.destroy=function(){if(this.removeEventListener(),this.unWireEvent(),this.cleanupUIComponents(),this.parent.pagerModule){for(var e=0,i=["#"+this.parent.element.id+"_column_textbox","#"+this.parent.element.id+"_row_textbox","#"+this.parent.element.id+"_column_size_list","#"+this.parent.element.id+"_row_size_list"];e<i.length;e++){var a=i[e],r=(0,t.select)(a,this.parent.element);if(r){var n=(0,t.getInstance)(r,a.includes("textbox")?zs.NumericTextBox:Ws.DropDownList);n&&"function"==typeof n.destroy&&n.destroy()}}this.pager&&this.pager.destroy(),this.pager=null}},e}(),Xl=function(){function e(e){this.parent=e}return e.prototype.render=function(){var e=(0,t.createElement)("div",{id:this.parent.element.id+"_Container",className:m+" "+("olap"===this.parent.dataType?"e-olapfieldlist-container":""),styles:"width:"+this.parent.element.style.width});this.parent.isAdaptive?(0,t.addClass)([e],s):(0,t.removeClass)([e],s),this.parent.enableRtl?(0,t.addClass)([e],n):(0,t.removeClass)([e],n),this.parent.cssClass&&(0,t.addClass)([e],this.parent.cssClass.split(" ")),this.parent.enableFieldSearching?(0,t.addClass)([e],T):(0,t.removeClass)([e],T),this.parentElement=(0,t.createElement)("div",{className:"e-field-list-container"}),this.parent.element.appendChild(e),this.parent.isAdaptive&&(e.removeAttribute("style"),this.parentElement=(0,t.createElement)("div",{className:"e-adaptive-container"}),this.renderAdaptiveLayout(e)),"Popup"===this.parent.renderMode?(this.renderFieldListDialog(e),this.unWireDialogEvent(this.parent.element.querySelector("."+f)),this.wireDialogEvent(this.parent.element.querySelector("."+f))):this.renderStaticLayout(e)},e.prototype.renderStaticLayout=function(e){if(!this.parent.isAdaptive){var i=(0,t.createElement)("div",{className:"e-field-list-title"}),a=(0,t.createElement)("div",{className:"e-title-content"});a.innerText=this.parent.localeObj.getConstant("staticFieldList"),i.appendChild(a),i.appendChild(this.createCalculatedButton()),(0,t.addClass)([e],y),e.appendChild(i),e.appendChild(this.parentElement),(0,t.addClass)([e],y),this.parent.allowDeferLayoutUpdate&&(e.appendChild(this.createDeferUpdateButtons()),this.renderDeferUpdateButtons(e))}},e.prototype.renderDeferUpdateButtons=function(e){this.parent.allowDeferLayoutUpdate&&(this.deferUpdateCheckBox=new io.CheckBox({label:this.parent.localeObj.getConstant("deferLayoutUpdate"),checked:this.parent.isPopupView&&this.parent.pivotGridModule?!!(0,t.isNullOrUndefined)(this.parent.pivotGridModule.pivotDeferLayoutUpdate)||this.parent.pivotGridModule.pivotDeferLayoutUpdate:!!(0,t.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((0,t.select)("#"+this.parent.element.id+"DeferUpdateCheckBox",e)),this.deferUpdateApplyButton=new io.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?!(0,t.isNullOrUndefined)(this.parent.pivotGridModule.pivotDeferLayoutUpdate)&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate:!(0,t.isNullOrUndefined)(this.parent.isDeferLayoutUpdate)&&!this.parent.isDeferLayoutUpdate}),this.deferUpdateApplyButton.isStringTemplate=!0,this.deferUpdateApplyButton.appendTo((0,t.select)("#"+this.parent.element.id+"_DeferUpdateButton1",e)),this.deferUpdateApplyButton.element.onclick="Fixed"===this.parent.renderMode?this.applyButtonClick.bind(this):this.onDeferUpdateClick.bind(this)),this.deferUpdateCancelButton=new io.Button({cssClass:"e-defer-cancel-button "+ae+(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||(0,t.isNullOrUndefined)(this.parent.pivotGridModule.pivotDeferLayoutUpdate))&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate:!(!this.parent.refreshing||(0,t.isNullOrUndefined)(this.parent.isDeferLayoutUpdate)||!this.parent.allowDeferLayoutUpdate)&&!this.parent.isDeferLayoutUpdate}),this.deferUpdateCancelButton.isStringTemplate=!0,this.deferUpdateCancelButton.appendTo((0,t.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)},e.prototype.createDeferUpdateButtons=function(){var e=(0,t.createElement)("div",{className:"e-layout-footer"});if(this.parent.allowDeferLayoutUpdate){var i=(0,t.createElement)("div",{className:"e-checkbox-layout",attrs:{title:this.parent.localeObj.getConstant("deferLayoutUpdate")}}),a=(0,t.createElement)("input",{id:this.parent.element.id+"DeferUpdateCheckBox"});i.appendChild(a),e.appendChild(i)}var r=(0,t.createElement)("div",{className:"e-button-layout"});if(this.parent.allowDeferLayoutUpdate){var n=(0,t.createElement)("button",{id:this.parent.element.id+"_DeferUpdateButton1",attrs:{type:"button",title:this.parent.localeObj.getConstant("apply")}});r.appendChild(n)}var s=(0,t.createElement)("button",{id:this.parent.element.id+"_DeferUpdateButton2",attrs:{type:"button",title:this.parent.localeObj.getConstant("cancel")}});return r.appendChild(s),e.appendChild(r),e},e.prototype.onCheckChange=function(e){e.checked&&(this.parent.clonedDataSource=Hs.getClonedDataSourceSettings(this.parent.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=Hs.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),this.parent.clonedFieldList=Hs.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)},e.prototype.applyButtonClick=function(){"pivotfieldlist"===this.parent.getModuleName()&&this.parent.allowDeferLayoutUpdate&&(this.parent.pivotChange=!1),this.parent.isDeferUpdateApplied=!0,this.parent.isPopupView||"Server"!==this.parent.dataSourceSettings.mode||(this.parent.isRequiredUpdate=!0),this.parent.updateDataSource(!1);var e=this.parent;e.axisFieldModule.render(),e.clonedDataSource=Hs.getClonedDataSourceSettings(e.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=Hs.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),e.clonedFieldList=Hs.getClonedFieldList(e.pivotFieldList)},e.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=Hs.getClonedFieldList(this.parent.clonedFieldList),this.parent.olapEngineModule.fieldListData=Hs.cloneOlapFieldSettings(this.parent.clonedFieldListData),this.parent.isPopupView)this.parent.isPopupView&&this.parent.clonedFieldListData&&Object.keys(this.parent.clonedFieldListData).length>0&&(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],n=this.parent.clonedFieldList[r];this.parent.olapEngineModule.updateFieldlistData(n.id,n.isSelected)}else this.parent.engineModule.fieldList=Hs.getClonedFieldList(this.parent.clonedFieldList);this.parent.updateDataSource(!1,!0)}if((!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=Hs.getClonedFieldList(this.parent.clonedFieldList);var s=Object.keys(this.parent.engineModule.fieldList);if(this.parent.allowCalculatedField&&this.parent.engineModule&&this.parent.engineModule.fields&&s.length!==this.parent.engineModule.fields.length){var o=[];this.parent.engineModule.fields.forEach(function(e){-1!==s.indexOf(e)&&(o[o.length]=e)}),this.parent.engineModule.fields=o}}"Popup"!==this.parent.renderMode||t?this.parent.actionObj.actionName=this.parent.isDeferLayoutUpdate?In:Fn:(this.parent.dialogRenderer.fieldListDialog.hide(),this.parent.actionObj.actionName=Hn),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()},e.prototype.renderFieldListDialog=function(e){var i=(0,t.createElement)("div",{className:f+" "+o+" e-select-table",attrs:{tabindex:"0",title:this.parent.localeObj.getConstant("fieldList"),"aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("fieldList"),role:"button"}});if(this.parent.element.appendChild(i),this.parent.isAdaptive){var a='<div class=e-title-mobile-header><span class="'+o+" "+Ut+'"></span><div class=e-title-mobile-content>'+this.parent.localeObj.getConstant("fieldList")+"</div></div>",r=[{click:this.showFieldListDialog.bind(this),isFlat:!1,buttonModel:{cssClass:be+" "+xe+" "+we+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:o+" "+Te,isPrimary:!0}},{click:this.showCalculatedField.bind(this),isFlat:!1,buttonModel:{cssClass:Ce+" "+xe+" "+we+" "+l+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:o+" "+Te,enableRtl:this.parent.enableRtl,isPrimary:!0}}];this.fieldListDialog=new Bs.Dialog({animationSettings:{effect:this.parent.enableRtl?"SlideRight":"SlideLeft"},header:a,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:r,target:Hs.getAppendToElement(this.parent.element,this.parent.isAngular),cssClass:this.parent.cssClass,close:this.removeFieldListIcon.bind(this),open:this.dialogOpen.bind(this)}),this.fieldListDialog.isStringTemplate=!0,this.fieldListDialog.isAngular=this.parent.isModalDialog,this.fieldListDialog.appendTo(e),(0,t.setStyleAttribute)((0,t.select)("#"+e.id+"_dialog-content",e),{padding:"0"});var n=e.querySelector(".e-footer-content");(0,t.addClass)([n],O),(0,t.removeClass)([n.querySelector("."+Ce)],Me),(0,t.removeClass)([n.querySelector("."+be)],Me),this.fieldListDialog.element.querySelector("."+Ut).onclick=this.parent.allowDeferLayoutUpdate?this.onDeferUpdateClick.bind(this):this.onCloseFieldList.bind(this)}else{var s=this.createDeferUpdateButtons().outerHTML;a="<div class="+Se+"><div class=e-title-content>"+this.parent.localeObj.getConstant("fieldList")+"</div></div>";this.fieldListDialog=new Bs.Dialog({animationSettings:{effect:"Zoom"},header:a,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:s,closeOnEscape:!1,cssClass:this.parent.cssClass,target:(0,t.isNullOrUndefined)(this.parent.target)?Hs.getAppendToElement(this.parent.element,this.parent.isAngular):"string"==typeof this.parent.target?document.querySelector(this.parent.target):this.parent.target,close:this.removeFieldListIcon.bind(this),beforeOpen:this.beforeOpen.bind(this)}),this.fieldListDialog.isStringTemplate=!0,this.fieldListDialog.isAngular=this.parent.isModalDialog,this.fieldListDialog.appendTo(e),this.renderDeferUpdateButtons(e),(0,t.setStyleAttribute)((0,t.select)("#"+e.id+"_title",e),{width:"100%"}),e.querySelector("."+Se).appendChild(this.createCalculatedButton())}},e.prototype.beforeOpen=function(){!(0,t.isNullOrUndefined)(this.parent.pivotFieldList)&&this.parent.clonedFieldList&&0===Object.keys(this.parent.clonedFieldList).length&&(this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&this.parent.pivotGridModule.pivotDeferLayoutUpdate)&&(this.parent.clonedFieldList=Hs.getClonedFieldList(this.parent.pivotFieldList))},e.prototype.dialogOpen=function(){4===this.lastTabIndex?(this.adaptiveElement.items[this.lastTabIndex].content="",this.adaptiveElement.dataBind(),this.parent.notify(br,{})):this.adaptiveElement.refresh()},e.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:this.parent.pivotGridModule?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)},e.prototype.onDeferUpdateClick=function(){this.parent.isPopupView&&"Server"===this.parent.dataSourceSettings.mode&&(this.parent.isRequiredUpdate=!0),this.parent.updateDataSource(),this.parent.dialogRenderer.fieldListDialog.hide(),Hs.invokeActionMethod(this.parent,lr,js,{})},e.prototype.renderAdaptiveLayout=function(e){var i=(0,t.createElement)("div",{className:O});e.appendChild(this.parentElement);var a=[{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||a.pop(),this.adaptiveElement=new Gs.Tab({heightAdjustMode:"Auto",items:a,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?(i.appendChild(this.createAddButton()),(0,t.addClass)([e],y),this.adaptiveElement.isStringTemplate=!0,this.adaptiveElement.appendTo(this.parentElement),this.parentElement.appendChild(i)):(this.adaptiveElement.isStringTemplate=!0,this.adaptiveElement.appendTo(this.parentElement))},e.prototype.tabSelect=function(e){var i=(0,t.closest)(this.parentElement,"."+m);this.lastTabIndex=e.selectedIndex,i&&i.querySelector("."+be)&&(4!==e.selectedIndex?((0,t.addClass)([i.querySelector("."+Ce)],l),(0,t.removeClass)([i.querySelector("."+be)],l)):((0,t.removeClass)([i.querySelector("."+Ce)],l),(0,t.addClass)([i.querySelector("."+be)],l))),4===e.selectedIndex?(this.adaptiveElement.items[4].content="",this.adaptiveElement.dataBind(),this.parent.notify(br,{})):this.parent.axisFieldModule.render()},e.prototype.createCalculatedButton=function(){var e=(0,t.createElement)("button",{id:this.parent.element.id+"_CalculatedField",attrs:{type:"button",tabindex:"0","aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("CalculatedField")}}),i=new io.Button({cssClass:"e-calculated-field "+l+(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 i.isStringTemplate=!0,i.appendTo(e),this.parent.calculatedFieldModule&&this.parent.allowCalculatedField&&(0,t.removeClass)([e],l),i.element.onclick=this.showCalculatedField.bind(this),e},e.prototype.createAddButton=function(){var e=(0,t.createElement)("div",{className:O+"-content"}),i=(0,t.createElement)("div",{}),a=(0,t.createElement)("div",{}),r=new io.Button({cssClass:Ce+" "+xe+" "+we+" "+l+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:o+" "+Te,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),n=new io.Button({cssClass:be+" "+xe+" "+we+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:o+" "+Te,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});return n.isStringTemplate=!0,n.appendTo(i),r.isStringTemplate=!0,r.appendTo(a),e.appendChild(i),e.appendChild(a),r.element.onclick=this.showCalculatedField.bind(this),n.element.onclick=this.showFieldListDialog.bind(this),e},e.prototype.createAxisTable=function(e){var i=(0,t.createElement)("div",{className:C+"-"+e}),a=(0,t.createElement)("div",{className:I+" e-"+e}),r=(0,t.createElement)("span",{className:F});return r.innerText=this.parent.localeObj.getConstant("addPrompt"),i.appendChild(a),i.appendChild(r),i},e.prototype.showCalculatedField=function(){try{if(!this.parent.isAdaptive){if(this.parent.actionObj.actionName=gn,this.parent.actionBeginMethod())return;this.parent.dialogRenderer.fieldListDialog&&(this.parent.dialogRenderer.fieldListDialog.hide(),(0,t.addClass)([this.parent.element.querySelector("."+f)],d))}this.parent.notify(br,{})}catch(e){this.parent.actionFailureMethod(e)}},e.prototype.showFieldListDialog=function(){var e=this.adaptiveElement.selectedItem;this.parent.treeViewModule.render(e)},e.prototype.onShowFieldList=function(){if(this.parent.actionObj.actionName=Vr,!this.parent.actionBeginMethod()){this.parent.actionObj.actionName="";try{this.parent.allowDeferLayoutUpdate&&(this.parent.isAdaptive&&this.parent.axisFieldModule.render(),this.parent.clonedDataSource=Hs.getClonedDataSourceSettings(this.parent.dataSourceSettings),"olap"===this.parent.dataType&&(this.parent.clonedFieldListData=Hs.cloneOlapFieldSettings(this.parent.olapEngineModule.fieldListData)),(0,t.isNullOrUndefined)(this.parent.pivotFieldList)||(this.parent.clonedFieldList=Hs.getClonedFieldList(this.parent.pivotFieldList))),(0,t.addClass)([this.parent.element.querySelector("."+f)],d),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)}}},e.prototype.removeFieldListIcon=function(){this.parent.isAdaptive&&this.parent.allowCalculatedField&&this.parent.calculatedFieldModule&&this.adaptiveElement&&4===this.adaptiveElement.selectedItem&&((0,t.select)("#"+this.parent.element.id+"droppable",this.adaptiveElement.element)?this.parent.calculatedFieldModule.updateAdaptiveCalculatedField(!1):this.parent.notify(br,{edit:!1})),document.getElementById(this.parent.element.id+"calculateddialog")||(0,t.removeClass)([this.parent.element.querySelector("."+f)],d)},e.prototype.keyPress=function(e){if(13===e.keyCode&&e.target)return e.target.click(),void e.preventDefault()},e.prototype.wireDialogEvent=function(e){t.EventHandler.add(e,"keydown",this.keyPress,this),t.EventHandler.add(e,"click",this.onShowFieldList,this)},e.prototype.unWireDialogEvent=function(e){t.EventHandler.remove(e,"keydown",this.keyPress),t.EventHandler.remove(e,"click",this.onShowFieldList)},e.prototype.destroy=function(){if("Popup"===this.parent.renderMode){var e=this.parent.element.querySelector("."+f);e&&this.unWireDialogEvent(e)}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);var i=document.getElementById(this.parent.element.id+"_CalculatedField");i&&((n=(0,t.getInstance)(i,io.Button))&&!n.isDestroyed&&n.destroy());if("Popup"===this.parent.renderMode){if(this.fieldListDialog&&!this.fieldListDialog.isDestroyed){for(var a=this.fieldListDialog.element.querySelectorAll("button"),r=0;r<a.length;r++){var n;(n=(0,t.getInstance)(a[r],io.Button))&&!n.isDestroyed&&n.destroy()}this.fieldListDialog.destroy(),this.fieldListDialog=null}var s=document.getElementById(this.parent.element.id+"_Container");s&&(0,t.remove)(s)}this.lastTabIndex=null},e}(),Jl=function(){function e(e){this.selectedNodes=[],this.isSearching=!1,this.parentIDs=[],this.isSpaceKey=!1,this.olapFieldListData=[],this.parent=e,this.addEventListener()}return e.prototype.render=function(e){if(this.parentElement=this.parent.dialogRenderer.parentElement,this.fieldListSort=this.parent.pivotGridModule?this.parent.pivotGridModule.defaultFieldListOrder:this.parent.defaultFieldListOrder,this.fieldListSort="Ascending"===this.fieldListSort?"Ascend":"Descending"===this.fieldListSort?"Descend":"None",this.parent.isAdaptive)this.renderTreeDialog(e);else{var i=(0,t.createElement)("div",{className:"e-field-table "+("olap"===this.parent.dataType?"e-olap-field-table":"")}),a=(0,t.createElement)("div",{className:"e-field-header",attrs:{title:this.parent.localeObj.getConstant("allFields")}});a.innerText=this.parent.localeObj.getConstant("allFields");var r=(0,t.createElement)("div",{className:x+" "+ht});this.treeViewElement=(0,t.createElement)("div",{id:this.parent.element.id+"_TreeView",className:C+" "+("olap"===this.parent.dataType?"e-olap-field-list-tree":"")});var n=(0,t.createElement)("div",{className:"e-field-header-container"});if(n.appendChild(a),i.appendChild(n),this.updateSortElements(n),this.parent.enableFieldSearching){var s=(0,t.createElement)("div",{id:this.parent.element.id+"_SearchDiv",attrs:{tabindex:"-1"},className:"e-field-list-search"}),d=(0,t.createElement)("input",{attrs:{type:"text"}});s.appendChild(d),this.fieldSearch=new zs.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(d),this.fieldSearch.addIcon("append","e-field-list-search-icon "+o);var p=(0,t.createElement)("div",{className:Ct+" "+l});p.innerText=this.parent.localeObj.getConstant("noMatches"),i.appendChild(s),i.appendChild(p)}if(r.appendChild(this.treeViewElement),i.appendChild(r),this.parentElement.appendChild(i),"Fixed"===this.parent.renderMode){var h=(0,t.createElement)("div",{className:"e-center-div"}),u=(0,t.createElement)("div",{className:"e-center-title"});u.innerText=this.parent.localeObj.getConstant("centerHeader"),this.parentElement.appendChild(h),this.parentElement.appendChild(u)}this.renderTreeView()}},e.prototype.updateSortElements=function(e){for(var i={None:"sortNone",Ascend:"sortAscending",Descend:"sortDescending"},a=0,r=Object.keys(i);a<r.length;a++){var n=r[a],s=(0,t.createElement)("span",{attrs:{tabindex:"0","aria-disabled":"false","aria-label":"Sort "+n,"data-sort":n,title:this.parent.localeObj.getConstant(i[n]),role:"button"},className:o+" e-sort-"+n.toLowerCase()+" "+(this.fieldListSort===n?"e-selected":"")});e.appendChild(s),this.unWireFieldListEvent(s),this.wireFieldListEvent(s)}},e.prototype.renderTreeView=function(){this.fieldTable=new Gs.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){(0,t.removeClass)([e.node],"e-active"),e.cancel=!0}}),this.treeViewElement.innerHTML="",this.fieldTable.isStringTemplate=!0,this.fieldTable.isAngular=this.parent.isModalDialog,this.fieldTable.appendTo(this.treeViewElement);var e="Fixed"===this.parent.renderMode?this.parent.element:this.parentElement;(0,t.isNullOrUndefined)(e.querySelector("."+C))||((0,t.getInstance)(e.querySelector("."+C),Gs.TreeView).dragObj.enableAutoScroll=!1)},e.prototype.updateNodeIcon=function(e){if("olap"===this.parent.dataType)if(e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-icon")>-1){var i=e.node.querySelector(".e-list-icon");(0,t.removeClass)([i],"e-folderCDB-icon"),(0,t.addClass)([i],"e-folderCDB-open-icon")}else if(e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-open-icon")>-1){i=e.node.querySelector(".e-list-icon");(0,t.removeClass)([i],"e-folderCDB-open-icon"),(0,t.addClass)([i],"e-folderCDB-icon")}},e.prototype.updateTreeNode=function(e){var i=!1;"olap"===this.parent.dataType?i=this.updateOlapTreeNode(e):e.nodeData.hasChildren?(i=!1,e.node.querySelector("."+Ht).style.display="none",(0,t.addClass)([e.node],M)):i=!0,(0,t.isNullOrUndefined)(e.nodeData.pid)||(0,t.addClass)([e.node],D);var a=e.node.querySelector("."+ye);if(e.node.querySelector(".e-list-icon")&&a){var r=e.node.querySelector(".e-list-icon");a.insertBefore(r,e.node.querySelector(".e-list-text"))}if(i&&!this.parent.isAdaptive){var n=Hs.getFieldInfo(e.nodeData.id,this.parent);i=!1;var s=(0,t.createElement)("span",{attrs:{tabindex:"-1",title:n.fieldItem?n.fieldItem.allowDragAndDrop?this.parent.localeObj.getConstant("drag"):"":this.parent.localeObj.getConstant("drag"),"aria-disabled":"false"},className:o+" "+G+" "+(n.fieldItem&&((0,t.isNullOrUndefined)(n.fieldItem.allowDragAndDrop)||n.fieldItem.allowDragAndDrop)?"":z)});e.node.querySelector("."+Ht)&&!e.node.querySelector(".cls.DRAG_CLASS")&&a&&a.insertBefore(s,e.node.querySelector("."+Ht))}if(e.node.querySelector("."+ee)&&(0,t.addClass)([e.node.querySelector("."+De)],Oe),this.parent.enableFieldSearching&&this.isSearching&&"pivot"===this.parent.dataType)for(var d=e.node,p=0;p<this.nonSearchList.length;p++){if(d.textContent===this.nonSearchList[p].textContent){(0,t.addClass)([d],l);break}if(d.innerText===this.nonSearchList[p].textContent){(0,t.addClass)([d],l);break}}},e.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("."+Ht).style.display="none"),e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-list-icon").className.indexOf("e-level-members")>-1&&(this.parent.isAdaptive?e.node.querySelector("."+Ht).style.display="none":e.node.querySelector("."+Ht).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"))&&(e.node.querySelector(".e-measure-icon")?(e.node.querySelector(".e-list-icon").style.display="none",t=!0):t=!0)):t=!0,t},e.prototype.renderTreeDialog=function(e){var i=(0,t.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(i),this.fieldDialog=new Bs.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:ae+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}},{click:this.onFieldAdd.bind(this),isFlat:!1,buttonModel:{cssClass:ie+(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:(0,t.closest)(this.parentElement,"."+m)}),this.fieldDialog.isStringTemplate=!0,this.fieldDialog.isAngular=this.parent.isModalDialog,this.fieldDialog.appendTo(i)},e.prototype.createTreeView=function(e){var i=(0,t.createElement)("div",{id:this.parent.element.id+"EditorDiv",className:Y}),a=(0,t.createElement)("div",{id:this.parent.element.id+"_SearchDiv",attrs:{tabindex:"-1"},className:Je}),r=(0,t.createElement)("input",{attrs:{type:"text"}});a.appendChild(r);var n=(0,t.createElement)("div",{className:x}),s=(0,t.createElement)("div",{className:K+" "+("olap"===this.parent.dataType?"e-olap-field-list-tree":"")});i.appendChild(a),this.editorSearch=new zs.MaskedTextBox({showClearButton:!0,placeholder:this.parent.localeObj.getConstant("search"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:Ze+(this.parent.cssClass?" "+this.parent.cssClass:""),change:this.textChange.bind(this)}),this.editorSearch.isStringTemplate=!0,this.editorSearch.appendTo(r);var o=(0,t.createElement)("div",{className:Ct+" "+l});return o.innerText=this.parent.localeObj.getConstant("noMatches"),i.appendChild(o),n.appendChild(s),i.appendChild(n),this.fieldTable=new Gs.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){(0,t.removeClass)([e.node],"e-active"),e.cancel=!0}}),this.fieldTable.isStringTemplate=!0,this.fieldTable.isAngular=this.parent.isModalDialog,this.fieldTable.appendTo(s),i},e.prototype.textChange=function(e){var t=this;if("olap"===this.parent.dataType)""===e.value?(this.fieldTable.fields.dataSource=this.olapFieldListData,setTimeout(function(){t.fieldTable.collapseAll()}),this.isSearching=!1,this.promptVisibility(!1)):(this.fieldTable.fields.dataSource=this.performeSearching(e.value),setTimeout(function(){t.fieldTable.expandAll()}),this.isSearching=!0,this.promptVisibility(0===this.fieldTable.fields.dataSource.length));else{this.parent.pivotCommon.eventBase.searchTreeNodes(e,this.fieldTable,!0);var i=[].slice.call(this.fieldTable.element.querySelectorAll("li")),a=[].slice.call(this.fieldTable.element.querySelectorAll("li."+l));this.promptVisibility(i.length===a.length),this.isSearching=a.length>0,this.nonSearchList=a}},e.prototype.promptVisibility=function(e){var i,a;this.parent.isAdaptive?i=this.fieldDialog.element.querySelector("."+Ct):(i=this.parentElement.querySelector("."+Ct),a=this.parentElement.querySelector("."+ht)),e?((0,t.removeClass)([i],l),this.parent.isAdaptive||((0,t.addClass)([a],l),(0,t.removeClass)([i],w))):((0,t.addClass)([i],l),this.parent.isAdaptive||((0,t.removeClass)([a],l),(0,t.addClass)([i],w)))},e.prototype.performeSearching=function(e){var t=this,a=new i.DataManager(this.olapFieldListData),r=a.executeLocal((new i.Query).where(new i.Predicate(this.fieldTable.fields.text,"contains",e,!0))),n=[],s=new Set;return r.forEach(function(e){if(e){var r=[],o=[];e.pid&&(r=t.getParentItems(a,"id",e.pid)),e.hasChildren&&(o=a.executeLocal((new i.Query).where("pid","equal",e.id,!1))),r.concat([e]).concat(o).forEach(function(e){var t=e.id;s.has(t)||(s.add(t),n.push(new i.Predicate("id","equal",t,!1)))})}}),n.length>0?a.executeLocal((new i.Query).where(i.Predicate.or.apply(i.Predicate,n))):[]},e.prototype.getParentItems=function(e,t,a){var r=e.executeLocal((new i.Query).where(t,"equal",a,!1));return r&&r[0]&&r[0].pid&&(r=this.getParentItems(e,t,r[0].pid).concat(r)),r},e.prototype.dragStart=function(e){var i=this;if(e.event.target.classList.contains(G)&&!e.event.target.classList.contains(z)){var a=Hs.getFieldInfo(e.draggedNode.getAttribute("data-uid"),this.parent),r={fieldName:a.fieldName,fieldItem:a.fieldItem,axis:a.axis,dataSourceSettings:this.parent.dataSourceSettings,cancel:!1};(this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(ar,r,function(a){if(a.cancel)i.parent.isDragging=!1,e.cancel=!0;else{i.parent.isDragging=!0,(0,t.addClass)([e.draggedNode.querySelector("."+De)],ve);var r=void 0;r="olap"===i.parent.dataType?i.parent.olapEngineModule.fieldList[e.draggedNode.getAttribute("data-uid")]:i.parent.engineModule.fieldList[e.draggedNode.getAttribute("data-uid")];var n=[se,oe,de];if(r&&"CalculatedField"===r.aggregateType)for(var s=0,o=n;s<o.length;s++){var l=o[s];(0,t.addClass)([i.parentElement.querySelector("."+l)],fe)}var d=e.clonedNode;d&&"Popup"===("pivotfieldlist"===i.parent.getModuleName()&&i.parent.renderMode)&&(d.style.zIndex=(i.parent.dialogRenderer.fieldListDialog.zIndex+1).toString())}})}else this.parent.isDragging=!1,e.cancel=!0},e.prototype.dragStop=function(e){e.cancel=!0,this.parent.isDragging=!1;for(var i=0,a=[se,oe,de];i<a.length;i++){var r=a[i];(0,t.removeClass)([this.parentElement.querySelector("."+r)],fe)}(0,t.removeClass)([e.draggedNode.querySelector("."+De)],ve),this.parent.pivotCommon.filterDialog.dialogPopUp&&this.parent.pivotCommon.filterDialog.dialogPopUp.close();var n=e.draggedNodeData.id.toString();if(this.isNodeDropped(e,n)){var s=this.parent.pivotFieldList[n];if(this.parent.pivotCommon.dataSourceUpdate.control="pivotview"===this.parent.getModuleName()?this.parent:this.parent.isPopupView&&this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent,this.parent.pivotCommon.nodeStateModified.onStateModified(e,n))this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&this.parent.pivotGridModule.pivotDeferLayoutUpdate?(s.isSelected=!0,this.updateDataSource()):this.parent.updateDataSource(),this.parent.axisFieldModule.render()}},e.prototype.isNodeDropped=function(e,i){var a=!0;if("true"===e.draggedNodeData.isChecked){var r=this.getButton(i),n=(0,t.closest)(r,"."+ne),s=(0,t.closest)(e.target,"."+ne);if(r&&n===s){for(var o=[].slice.call(n.querySelectorAll("."+A)),l=(0,t.closest)(e.target,"."+L),d=void 0,p=-1,h=0,u=o.length;h<u;h++)if(o[h].id===r.id&&(d=h),l){var c=l.querySelector("."+A);o[h].id===c.id&&(p=h)}if(d===p||d===o.length-1&&-1===p){var g=document.getElementById(this.parent.element.id+"_Container");(0,t.removeClass)([].slice.call(g.querySelectorAll("."+W)),Q),a=!1}}}return a},e.prototype.getButton=function(e){for(var t,i=document.getElementById(this.parent.element.id+"_Container"),a=[].slice.call(i.querySelectorAll("."+A)),r=0,n=a.length;r<n;r++)if(a[r].getAttribute("data-uid")===e){t=a[r];break}return t},e.prototype.nodeChecked=function(e){if(this.isSpaceKey){var i=(0,t.closest)(e.node,"."+ye);if(!(0,t.isNullOrUndefined)(i)){var a=(0,t.closest)(i,"li").getAttribute("data-uid");this.parent.isAdaptive?this.addNode(void 0,a,"check"===e.action,i):this.nodeStateChange(void 0,a,"check"===e.action,i)}}this.isSpaceKey=!1},e.prototype.nodeStateChange=function(e,i,a,r){var n=this;r=(0,t.isNullOrUndefined)(r)?e.node:r,i=(0,t.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(!(0,t.isNullOrUndefined)(e)){if(this.isSpaceKey=e.event.action&&"space"===e.event.action,(0,t.isNullOrUndefined)(s)||r.classList.contains(l)||e.event.target&&(e.event.target.classList.contains(wi)||e.event.target.classList.contains(Ti))||e.event.action&&"enter"!==e.event.action)return;a=!1;var o=this.fieldTable.getNode(r);e.event&&e.event.target&&!e.event.target.closest("."+Ht)?"true"===o.isChecked?(this.fieldTable.uncheckAll([r]),a=!1):(this.fieldTable.checkAll([r]),a=!0):a="true"===o.isChecked}var d=this.parent.isPopupView?this.parent.pivotGridModule:this.parent,p=Hs.getFieldInfo(i,this.parent),h=r.closest("."+M);if(a){var u=!1;("number"===s.type||"olap"===this.parent.dataType&&("Measure"===s.fieldType||s.tag&&s.tag.toLowerCase().indexOf("[measures]")>-1||"CalculatedField"===s.type&&s.formula&&s.formula.toLowerCase().indexOf("measure")>-1))&&(u=!0);var c={fieldName:i,dropField:p.fieldItem,dataSourceSettings:Hs.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:u?"values":"rows",dropPosition:p.position,draggedAxis:"fieldlist",cancel:!1};d.trigger(Fi,c,function(e){if(e.cancel)n.updateCheckState(s,"check");else{(0,t.addClass)([r.querySelector("."+De)],Oe),h&&(0,t.addClass)([h.querySelector("."+De)],Oe),n.updateSelectedNodes(r,"check");var o=n.parent.pivotCommon.dataSourceUpdate.getNewField(i,p.fieldItem);n.updateReportSettings(o,e),n.updateNodeStateChange(i,s,a)}})}else{var g={cancel:!1,fieldName:i,dataSourceSettings:Hs.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:p.fieldItem,axis:p.axis};d.trigger(tr,g,function(e){e.cancel?n.updateCheckState(s,"uncheck"):((0,t.removeClass)([r.querySelector("."+De)],Oe),h&&(0,t.isNullOrUndefined)(h.querySelector("."+D+" ."+ee))&&(0,t.removeClass)([h.querySelector("."+De)],Oe),n.updateSelectedNodes(r,"uncheck"),n.parent.pivotCommon.dataSourceUpdate.removeFieldFromReport(i),"pivot"===n.parent.dataType&&n.parent.showValuesButton&&n.parent.dataSourceSettings.values.length>1&&p&&p.position<n.parent.dataSourceSettings.valueIndex&&("row"===n.parent.dataSourceSettings.valueAxis&&"rows"===p.axis||"column"===n.parent.dataSourceSettings.valueAxis&&"columns"===p.axis)&&d.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))})}},e.prototype.updateReportSettings=function(e,i){var a=i.dropPosition,r=i.dropAxis;if("pivot"===this.parent.dataType&&this.parent.showValuesButton&&this.parent.dataSourceSettings.values.length>1){var n="row"===this.parent.dataSourceSettings.valueAxis&&"rows"===r?this.parent.dataSourceSettings.rows:"column"===this.parent.dataSourceSettings.valueAxis&&"columns"===r?this.parent.dataSourceSettings.columns:void 0;(0,t.isNullOrUndefined)(n)||(-1===a&&-1===this.parent.dataSourceSettings.valueIndex?this.parent.setProperties({dataSourceSettings:{valueIndex:n.length}},!0):a>-1&&a<=this.parent.dataSourceSettings.valueIndex?this.parent.setProperties({dataSourceSettings:{valueIndex:this.parent.dataSourceSettings.valueIndex+1}},!0):this.parent.dataSourceSettings.valueIndex>-1&&a>this.parent.dataSourceSettings.valueIndex&&(a-=1))}switch(r){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":if(-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&&!(this.parent.dataSourceSettings.values.length>1)){var s={name:"[Measures]",caption:"Measures",baseField:void 0,baseItem:void 0};("row"===this.parent.dataSourceSettings.valueAxis?this.parent.dataSourceSettings.rows:this.parent.dataSourceSettings.columns).push(s)}}},e.prototype.updateCheckState=function(e,t){for(var i=this.fieldTable.element.querySelectorAll("."+Ht),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]))},e.prototype.updateNodeStateChange=function(e,i,a){!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate?this.parent.updateDataSource(!0):(i.isSelected=a,"olap"===this.parent.dataType&&this.parent.olapEngineModule.updateFieldlistData(e,a),this.updateDataSource());var r=this.treeViewElement.querySelector('[data-uid="'+e+'"]');r.focus(),(0,t.removeClass)([r],"e-hover");var n=this.parent;setTimeout(function(){n.axisFieldModule.render()})},e.prototype.updateSelectedNodes=function(e,i){if(e&&e.querySelector("ul"))for(var a=0,r=[].slice.call(e.querySelectorAll("li"));a<r.length;a++){var n=r[a];"check"===i?(0,t.addClass)([n.querySelector("."+De)],Oe):(0,t.removeClass)([n.querySelector("."+De)],Oe)}},e.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(hr,this)):this.parent.triggerPopulateEvent()},e.prototype.addNode=function(e,i,a,r){var n=this;r=(0,t.isNullOrUndefined)(r)?e.node:r,i=(0,t.isNullOrUndefined)(i)?r.getAttribute("data-uid"):i;var s=this.parent.pivotFieldList[i];if(!(0,t.isNullOrUndefined)(e)){if(this.isSpaceKey=e.event.key&&" "===e.event.key,(0,t.isNullOrUndefined)(s)||e.node.classList.contains(l)||e.event.target&&(e.event.target.classList.contains(wi)||e.event.target.classList.contains(Ti))||e.event.key&&"Enter"!==e.event.key)return;a=!1;var o=this.fieldTable.getNode(e.node);e.event&&e.event.target&&!e.event.target.classList.contains($)?"true"===o.isChecked?(this.fieldTable.uncheckAll([e.node]),a=!1):(this.fieldTable.checkAll([e.node]),a=!0):a="true"===o.isChecked}var d=Hs.getFieldInfo(s.id.toString(),this.parent),p=this.parent.isPopupView?this.parent.pivotGridModule:this.parent;if(a){var h={fieldName:d.fieldName,dropField:d.fieldItem,dataSourceSettings:Hs.getClonedDataSourceSettings(this.parent.dataSourceSettings),dropAxis:["filters","columns","rows","values"][this.parent.dialogRenderer.adaptiveElement.selectedItem],draggedAxis:"fieldlist",cancel:!1};p.trigger(Fi,h,function(e){e.cancel?n.updateCheckState(s,"check"):n.selectedNodes.push(s.id.toString())})}else{var u={cancel:!1,fieldName:d.fieldName,dataSourceSettings:Hs.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:d.fieldItem,axis:d.axis};p.trigger(tr,u,function(e){if(e.cancel)n.updateCheckState(s,"uncheck");else for(var t=n.selectedNodes.length;t--;)if(n.selectedNodes[t]===s.id.toString()){n.selectedNodes.splice(t,1);break}})}},e.prototype.refreshTreeView=function(){if(this.fieldTable){var e=this.getUpdatedData();this.fieldTable.fields={dataSource:e,id:"id",text:"caption",isChecked:"isSelected",parentID:"pid",iconCss:"spriteCssClass"},this.fieldTable.dataBind()}},e.prototype.getUpdatedData=function(){var e=this.getTreeData(),t=this.fieldTable.expandedNodes;return this.updateExpandedNodes(e,t),this.applySorting(e,this.fieldListSort)},e.prototype.getTreeData=function(e){var i=[];if("olap"===this.parent.dataType)i=this.getOlapTreeData(e),this.isSearching&&this.olapFieldListData.length>0&&(i=this.performeSearching(this.fieldSearch.value));else{for(var a=this.parent.pivotFieldList?Object.keys(this.parent.pivotFieldList):[],r={},n=0,s=a;n<s.length;n++){var o=s[n],l=this.parent.pivotFieldList[o];if(r[o]={id:l.id,pid:l.pid,caption:l.caption,isSelected:l.isSelected},!(0,t.isNullOrUndefined)(l.pid)&&!r[o].hasChildren){var d=l.pid+"_group_name";r[o].pid=d,r[d]={id:d,caption:l.pid,isSelected:r[d]&&r[d].isSelected?r[d].isSelected:l.isSelected,hasChildren:!0}}}if(this.parent.isAdaptive){for(var p=[this.parent.dataSourceSettings.filters,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.values][e],h=a.length;h--;)r[a[h]].isSelected=!1;for(var u=0,c=p;u<c.length;u++){r[c[u].name].isSelected=!0}}for(var g=0,m=Object.keys(r);g<m.length;g++){var f=r[l=m[g]];i.push(f)}}return i},e.prototype.getOlapTreeData=function(e){var i=[],a=this.parent.olapEngineModule.fieldListData?this.parent.olapEngineModule.fieldListData:[];if(this.parent.isAdaptive)for(var r=[this.parent.dataSourceSettings.filters,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.values][e],n=0;n<a.length;){var s=a[n],o=void 0;if(3===e){if("[measures]"!==s.id.toLowerCase()&&(0===s.id.toLowerCase().indexOf("[measures]")||s.spriteCssClass&&-1!==s.spriteCssClass.indexOf("e-measureCDB"))||"[calculated members].[_0]"===s.id.toLowerCase()||s.spriteCssClass&&-1!==s.spriteCssClass.indexOf("e-calc-measure-icon")){(o={id:s.id,caption:s.caption,hasChildren:s.hasChildren,type:s.type,aggregateType:s.aggregateType,isSelected:s.isSelected,pid:s.pid,spriteCssClass:s.spriteCssClass}).isSelected=!1,o.spriteCssClass&&-1!==o.spriteCssClass.indexOf("e-measureCDB")&&(o.spriteCssClass=o.spriteCssClass.replace("e-folderCDB-icon","e-measureGroupCDB-icon"),o.pid=void 0);for(var l=0,d=r;l<d.length;l++){var p=d[l];if(o.id===p.name){o.isSelected=!0;break}}i.push(o)}}else if(!(0===s.id.toLowerCase().indexOf("[measures]")||s.spriteCssClass&&-1!==s.spriteCssClass.indexOf("e-measureCDB")||s.spriteCssClass&&-1!==s.spriteCssClass.indexOf("e-calc-measure-icon"))){(o={id:s.id,caption:s.caption,hasChildren:s.hasChildren,type:s.type,aggregateType:s.aggregateType,isSelected:s.isSelected,pid:s.pid,spriteCssClass:s.spriteCssClass}).isSelected=!1;for(var h=0,u=r;h<u.length;h++){var c=u[h];if(o.id===c.name){o.isSelected=!0;break}}i.push(o)}n++}else i=(0,t.isNullOrUndefined)(this.parent.olapEngineModule.fieldListData)?[]:Hs.getClonedData(this.parent.olapEngineModule.fieldListData);return this.olapFieldListData=i,i},e.prototype.updateExpandedNodes=function(e,t){if(t.length>0)for(var i=0,a=0,r=e;a<r.length;a++){var n=r[a];if(t.indexOf(n.id)>-1&&(i++,n.expanded=!0,n.spriteCssClass=n.spriteCssClass&&n.spriteCssClass.toString().indexOf("e-folderCDB-icon")>-1?n.spriteCssClass.toString().replace("e-folderCDB-icon","e-folderCDB-open-icon"):n.spriteCssClass,i===t.length))break}},e.prototype.updateSorting=function(e){var i=e.target,a=i.getAttribute("data-sort");if(!Hs.invokeActionMethod(this.parent,or,dn)){try{if(-1===i.className.indexOf("e-selected")){switch(a){case"None":this.fieldListSort="None",(0,t.addClass)([i],"e-selected"),(0,t.removeClass)([this.parentElement.querySelector(".e-sort-ascend")],"e-selected"),(0,t.removeClass)([this.parentElement.querySelector(".e-sort-descend")],"e-selected");break;case"Ascend":this.fieldListSort="Ascend",(0,t.addClass)([i],"e-selected"),(0,t.removeClass)([this.parentElement.querySelector(".e-sort-none")],"e-selected"),(0,t.removeClass)([this.parentElement.querySelector(".e-sort-descend")],"e-selected");break;case"Descend":this.fieldListSort="Descend",(0,t.addClass)([i],"e-selected"),(0,t.removeClass)([this.parentElement.querySelector(".e-sort-ascend")],"e-selected"),(0,t.removeClass)([this.parentElement.querySelector(".e-sort-none")],"e-selected")}this.refreshTreeView()}}catch(e){this.parent.actionFailureMethod(e)}Hs.invokeActionMethod(this.parent,lr,this.parent.getActionCompleteName(),{sortInfo:{order:"Ascend"===this.fieldListSort?"Ascending":"Descend"===this.fieldListSort?"Descending":"None"}})}},e.prototype.applySorting=function(e,t){if(e.length>0)if("olap"===this.parent.dataType){var i=void 0,a=void 0;this.parent.dataSourceSettings.calculatedFieldSettings.length>0&&"[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)}else this.fieldTable.sortOrder="Ascend"===t?"Ascending":"Descend"===t?"Descending":"None";return e},e.prototype.onFieldAdd=function(){this.parent.dialogRenderer.updateDataSource(this.selectedNodes),this.closeTreeDialog()},e.prototype.closeTreeDialog=function(){this.selectedNodes=[],this.fieldDialog.hide(),this.fieldDialog.destroy(),document.getElementById(this.parent.element.id+"_FieldListTreeView")&&(0,t.remove)(document.getElementById(this.parent.element.id+"_FieldListTreeView")),this.fieldDialog=null},e.prototype.keyPress=function(e){if(13===e.keyCode&&e.target)return e.target.click(),void e.preventDefault()},e.prototype.wireFieldListEvent=function(e){t.EventHandler.add(e,"keydown",this.keyPress,this),t.EventHandler.add(e,"click",this.updateSorting,this)},e.prototype.unWireFieldListEvent=function(e){t.EventHandler.remove(e,"keydown",this.keyPress),t.EventHandler.remove(e,"click",this.updateSorting)},e.prototype.addEventListener=function(){this.parent.on(Sr,this.refreshTreeView,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Sr,this.refreshTreeView)},e.prototype.destroy=function(){if(this.removeEventListener(),this.parentElement)for(var e=0,i=[this.parentElement.querySelector(".e-sort-none"),this.parentElement.querySelector(".e-sort-ascend"),this.parentElement.querySelector(".e-sort-descend")];e<i.length;e++){var a=i[e];a&&this.unWireFieldListEvent(a)}if(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){if(this.fieldTable.element)for(var r=this.fieldTable.element.querySelectorAll("li"),n=0;n<r.length;n++)t.EventHandler.clearEvents(r[n]);this.fieldTable.destroy(),this.fieldTable=null}this.fieldDialog&&!this.fieldDialog.isDestroyed&&(this.fieldDialog.destroy(),this.fieldDialog=null),this.treeViewElement&&this.treeViewElement.parentNode&&(this.treeViewElement.innerHTML=""),this.selectedNodes=[],this.nonSearchList=null,this.parentIDs=[]},e}(),Zl=function(){function e(e){this.droppableInstances=[],this.parent=e}return e.prototype.render=function(){if(!this.parent.isAdaptive){var e=(0,t.createElement)("div",{className:"e-axis-table "+("olap"===this.parent.dataType?"e-olap-axis-table":"")});this.leftAxisPanel=(0,t.createElement)("div",{className:N}),this.rightAxisPanel=(0,t.createElement)("div",{className:P}),this.parent.dialogRenderer.parentElement.appendChild(e),e.appendChild(this.leftAxisPanel),e.appendChild(this.rightAxisPanel),this.axisTable=e,this.renderAxisTable()}this.parent.axisFieldModule.render()},e.prototype.renderAxisTable=function(){for(var e=["filters","rows","columns","values"],i=0,a=e.length;i<a;i++){var r=(0,t.createElement)("div",{className:C+"-"+e[i]}),n=(0,t.createElement)("div",{className:gt+"-container"}),s=(0,t.createElement)("div",{className:"e-axis-header",attrs:{title:this.parent.localeObj.getConstant(e[i])}});s.innerText=this.parent.localeObj.getConstant(e[i]),n.appendChild(this.getIconupdate(e[i])),n.appendChild(s);var o=(0,t.createElement)("div",{className:I+" e-"+e[i]}),l=void 0;l="rows"===e[i]?this.parent.localeObj.getConstant("dropRowPrompt"):"columns"===e[i]?this.parent.localeObj.getConstant("dropColPrompt"):"values"===e[i]?this.parent.localeObj.getConstant("dropValPrompt"):this.parent.localeObj.getConstant("dropFilterPrompt");var d=(0,t.createElement)("span",{className:F});d.innerText=l;var p=new t.Droppable(o,{});this.droppableInstances.push(p),r.appendChild(n),r.appendChild(o),r.appendChild(d),i<=1?this.leftAxisPanel.appendChild(r):this.rightAxisPanel.appendChild(r),this.unWireEvent(o),this.wireEvent(o)}},e.prototype.getIconupdate=function(e){var i=(0,t.createElement)("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:gt+"-icon-container"}),a=(0,t.createElement)("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:o+" "+gt+"-"+e});return i.appendChild(a),i},e.prototype.wireEvent=function(e){t.EventHandler.add(e,"mouseover",this.updateDropIndicator,this),t.EventHandler.add(e,"mouseleave",this.updateDropIndicator,this)},e.prototype.unWireEvent=function(e){t.EventHandler.remove(e,"mouseover",this.updateDropIndicator),t.EventHandler.remove(e,"mouseleave",this.updateDropIndicator)},e.prototype.updateDropIndicator=function(e){var i=this.parent.dialogRenderer.parentElement;if(this.parent.isDragging&&e.target.classList.contains(I)&&"mouseover"===e.type){(0,t.removeClass)([].slice.call(i.querySelectorAll("."+W)),Q),(0,t.removeClass)([].slice.call(i.querySelectorAll("."+W+"-last")),Q);var a=[].slice.call(e.target.querySelectorAll("."+L));a.length>0&&(0,t.addClass)([a[a.length-1].querySelector("."+W+"-last")],Q)}else this.parent.isDragging&&(e.target.classList.contains(ne)||"mouseleave"!==e.type)||((0,t.removeClass)([].slice.call(i.querySelectorAll("."+W)),Q),(0,t.removeClass)([].slice.call(i.querySelectorAll("."+W+"-last")),Q))},e.prototype.destroy=function(){if(this.axisTable)for(var e=this.axisTable.querySelectorAll("."+I),t=0;t<e.length;t++)this.unWireEvent(e[t]);for(t=0;t<this.droppableInstances.length;t++)this.droppableInstances[t]&&!this.droppableInstances[t].isDestroyed&&this.droppableInstances[t].destroy();this.droppableInstances=[],this.axisTable&&this.axisTable.parentNode&&this.axisTable.parentNode.removeChild(this.axisTable),this.axisTable=null,this.leftAxisPanel=null,this.rightAxisPanel=null},e}(),$l=function(){function e(e){this.parent=e,this.menuOption=new Qs(this.parent),this.parent.pivotButtonModule=this,this.addEventListener(),this.parent instanceof rd&&(this.axisField=new ed(this.parent)),this.isDestroyed=!1}return e.prototype.renderPivotButton=function(e){var i,a,r,n,s=this;this.parentElement="pivotview"===this.parent.getModuleName()?this.parent.element:document.getElementById(this.parent.element.id+"_Container"),!this.parent.isTabular||this.parent.isTabular&&"rows"!==e.axis?a=Array.prototype.slice.call(this.parentElement.querySelectorAll(".e-group-"+e.axis)):this.parent.isTabular&&"rows"===e.axis&&((0,t.isNullOrUndefined)(this.parentElement.querySelectorAll("."+gi)[0])||(a=Array.prototype.slice.call(this.parentElement.querySelectorAll("."+gi))),(0,t.isNullOrUndefined)(this.parentElement.querySelectorAll("."+ai)[0])||(r=Array.prototype.slice.call(this.parentElement.querySelectorAll("."+ai)))),"rows"===e.axis&&this.parent.showGroupingBar&&this.parent.groupingBarModule&&(0,t.isNullOrUndefined)(this.parentElement.querySelector("."+gi))&&!(0,t.isNullOrUndefined)(a)&&(a.push(this.parent.groupingBarModule.rowPanel),n=this.parent.groupingBarModule.rowPanel);var o=(0,t.extend)([],e.field,null,!0),d=e.axis,p=-1,h="pivot"===this.parent.dataType&&("pivotfieldlist"===this.parent.getModuleName()&&this.parent.pivotGridModule?this.parent.pivotGridModule.showValuesButton:this.parent.showValuesButton);if(("row"===this.parent.dataSourceSettings.valueAxis&&"rows"===e.axis||"column"===this.parent.dataSourceSettings.valueAxis&&"columns"===e.axis)&&h&&this.parent.dataSourceSettings.values.length>1&&(0,t.isNullOrUndefined)(Hs.getFieldByName("[Measures]",o))){var u=Hs.getFieldByName("[Measures]",this.parent.dataSourceSettings.fieldMapping),c={name:"[Measures]",caption:this.parent.localeObj.getConstant("values"),axis:e.axis,showRemoveIcon:!u||!("showRemoveIcon"in u)||u.showRemoveIcon,allowDragAndDrop:!u||!("allowDragAndDrop"in u)||u.allowDragAndDrop};-1===this.parent.dataSourceSettings.valueIndex||this.parent.dataSourceSettings.valueIndex>o.length?(p=o.length,o.push(c),this.parent.setProperties({dataSourceSettings:{valueIndex:-1}},!0)):(p=this.parent.dataSourceSettings.valueIndex,o.splice(p,0,c))}if("pivotfieldlist"===this.parent.getModuleName()){if(this.parentElement=document.getElementById(this.parent.element.id+"_Container"),!this.parentElement.querySelector("."+C+"-"+d))return;var g=this.parentElement.querySelector("."+C+"-"+d).querySelector("."+F);0===o.length?(0,t.removeClass)([g],l):(0,t.addClass)([g],l),n=this.parentElement.querySelector("."+C+"-"+d).querySelector("."+I)}else this.parentElement=this.parent.element,(0,t.isNullOrUndefined)(this.parentElement.querySelector(".e-group-"+d))||(n=this.parentElement.querySelector(".e-group-"+d));if(n)if("pivotview"===this.parent.getModuleName()&&0===o.length)for(var m=0;m<a.length;m++){if((y=a[m]).classList.contains(ni)||y.classList.contains(ri))"values"===d&&y.classList.contains(ni)&&this.parent.pivotChartModule&&this.createChartValueDropdown(y,[]);else(g=(0,t.createElement)("span",{className:F})).innerText=this.parent.groupingBarSettings.allowDragAndDrop?"rows"===d?this.parent.localeObj.getConstant("rowAxisPrompt"):"columns"===d?this.parent.localeObj.getConstant("columnAxisPrompt"):"values"===d?this.parent.localeObj.getConstant("valueAxisPrompt"):"filters"===d?this.parent.localeObj.getConstant("filterAxisPrompt"):this.parent.localeObj.getConstant("allFields"):"",y.appendChild(g)}else{if(!this.parent.isTabular||this.parent.isTabular&&"rows"!==e.axis){m=0;for(var f=o.length;m<f;m++)for(var v="pivotfieldlist"===this.parent.getModuleName()?[n]:a,S=0;S<v.length;S++){var y=v[S];this.appendPivotButton(y,o,d,p,m,e)}}else{if(!(0,t.isNullOrUndefined)(a))for(m=0,f=o.length;m<f;m++){v="pivotfieldlist"===this.parent.getModuleName()?[n]:a;var b="row"===this.parent.dataSourceSettings.valueAxis&&this.parent.dataSourceSettings.values.length>1&&v.length>1;y=v[b&&h?m===o.length-1?v.length-1:m%(v.length-1):b&&!h||this.parent.dataSourceSettings.alwaysShowValueHeader&&1===this.parent.dataSourceSettings.values.length?m%(v.length-1):m%v.length];this.appendPivotButton(y,o,d,p,m,e)}if(!(0,t.isNullOrUndefined)(r))for(m=0,f=o.length;m<f;m++)for(v="pivotfieldlist"===this.parent.getModuleName()?[n]:r,S=0;S<v.length;S++){y=v[S];this.appendPivotButton(y,o,d,p,m,e)}}if("values"===d){var x=this.parent,w=o.map(function(e){return{text:e.caption?e.caption:e.name,value:e.name}}),T="."+si;for(m=0;m<a.length;m++){if((y=a[m]).classList.contains(ni)&&x.pivotChartModule){var M=y.querySelector(T);if(M){var D=(0,t.getInstance)(M,Ws.DropDownList);D.dataSource=w,D.value=x.chartSettings.enableMultipleAxis?w[0].value:x.pivotChartModule.currentMeasure}else this.createChartValueDropdown(y,w)}}}else if("columns"===d){var O=void 0,N=(0,t.select)("."+oi,this.parentElement)?(0,t.getInstance)((0,t.select)("."+oi,this.parentElement),Ws.DropDownList):null;for(m=0;m<a.length;m++){if((y=a[m]).classList.contains(ri)&&this.parent.pivotChartModule){for(var P=this.parent.pivotChartModule.currentMeasure,E=this.parent.chartSettings.columnDelimiter?this.parent.chartSettings.columnDelimiter:"-",L=this.parent.chartSettings.columnHeader&&""!==this.parent.chartSettings.columnHeader?this.parent.chartSettings.columnHeader.split(E).join(" - "):"",A="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,R=A.pivotValues,k=this.parent.pivotChartModule.getColumnTotalIndex(R),j=[],q=!1,H=0,V=Object.keys(R);H<V.length;H++){var U=V[H];if(q)break;var B=Number(U);if(R[B]&&R[B][0]&&"row"===R[B][0].axis&&(0===this.parent.dataSourceSettings.rows.length||"grand sum"!==R[B][0].type))for(var _=R[B][0],G="olap"===this.parent.dataType?A.tupRowInfo[_.ordinal]:void 0,z=R[B],W=0,Q=Object.keys(z);W<Q.length;W++){var Y=Q[W],K=Number(Y),X=R[B][K],J="olap"===this.parent.dataType&&G&&G.measureName?G.measureName:X.actualText;if(!k[X.colIndex]&&"value"===X.axis&&"header"!==_.type&&""!==J&&J===P){q=!0;var Z="olap"===this.parent.dataType?X.columnHeaders.toString().split(/~~|::/).join(" - "):X.columnHeaders.toString().split(this.parent.dataSourceSettings.valueSortSettings.headerDelimiter).join(" - ");j.push({value:Z,text:Z,title:(i={},i.title=Z,i)}),Z===L&&(O=j.length)}}}if(N&&y.querySelector("."+oi))N.dataSource=j,N.value=void 0!==O?j[O-1].value:j[0].value;else{var $=(0,t.createElement)("div",{className:oi});y.appendChild($),N=new Ws.DropDownList({dataSource:j,enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:O?j[O-1].value:j[0]?j[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){if(e.e&&null!==e.e){var t=s.parent.chartSettings.columnDelimiter?s.parent.chartSettings.columnDelimiter:"-";s.parent.chartSettings.columnHeader=e.value.split(" - ").join(t)}}}),N.isStringTemplate=!0,N.isAngular=this.parent.isModalDialog,N.appendTo($)}}}}}},e.prototype.appendPivotButton=function(e,i,a,r,n,s){if(!(0,t.isNullOrUndefined)(e)&&(this.parent.olapEngineModule&&(this.parent.olapEngineModule.fieldList[i[n].name]||"[Measures]"===i[n].name)||this.parent.engineModule)){var d="olap"===this.parent.dataType&&("[measures]"===i[n].name.toLowerCase()||"values"===a),p="olap"===this.parent.dataType&&"values"===a;if(!e.classList.contains(ni)&&!e.classList.contains(ri)){var h=(0,t.createElement)("div",{className:L+(0===n&&"all-fields"!==a?" e-first-btn":"")+(this.parent.isTabular?" e-tabular-pvt-btn":""),attrs:{"data-tag":a+":"+i[n].name}});this.parent.isTabular&&(h.style.width="rows"===s.axis&&e.classList.contains(gi)?"100%":"auto");var u=i[n].caption?i[n].caption:i[n].name;u=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(u):u;var c=(0,t.createElement)("div",{id:this.parent.element.id+"_"+i[n].name,className:A+" "+i[n].name.replace(/[^A-Z0-9]/gi,"")+(this.parent.isTabular?" e-tabular-row-btn":""),attrs:{"data-uid":i[n].name,tabindex:"pivotview"===this.parent.getModuleName()&&this.parent.grid&&"rows"===a&&!e.classList.contains(ai)?"-1":"0",isvalue:n===r||d&&!p?"true":"false","aria-disabled":"false","aria-label":u,"data-type":"olap"===this.parent.dataType?p?"isMeasureFieldsAvail":d?"isMeasureAvail":i[n].type:i[n].type,"data-caption":u,"data-basefield":this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i[n].baseField):i[n].baseField,"data-baseitem":this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i[n].baseItem):i[n].baseItem,role:"button"}}),g=(0,t.createElement)("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:W}),m=(0,t.createElement)("span",{attrs:{tabindex:"-1","aria-disabled":"false"},className:W+"-last"}),f=this.createButtonDragIcon(i[n],c),v=this.createButtonText(i,n,a,r);if(c.appendChild(v),"all-fields"!==a){if(d||i[n].isNamedSet||i[n].isCalculatedField||(-1!==["filters","values"].indexOf(a)||r===n||"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(c,i[n].name,i[n]),"values"!==a&&r!==n&&this.createFilterOption(c,i[n].name,a,i[n]),"values"===a&&this.getTypeStatus(i,n,c)),i[n].isCalculatedField||"CalculatedField"===i[n].type){var S=(0,t.createElement)("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("editCalculatedField")},className:o+" "+xt});this.parent.allowCalculatedField&&this.parent.calculatedFieldModule&&(i[n].showEditIcon||void 0===i[n].showEditIcon)?(0,t.removeClass)([S],l):(0,t.addClass)([S],l),c.appendChild(S)}var y=(0,t.createElement)("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("remove")},className:o+" "+_});"pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.showRemoveIcon&&(i[n].showRemoveIcon||void 0===i[n].showRemoveIcon)?(0,t.removeClass)([y],l):(0,t.addClass)([y],l):i[n].showRemoveIcon||void 0===i[n].showRemoveIcon?(0,t.removeClass)([y],l):(0,t.addClass)([y],l),c.appendChild(y),h.appendChild(g),h.appendChild(c),h.appendChild(m)}else h.appendChild(g),h.appendChild(c);e.appendChild(h);var C=new io.Button({enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass});C.isStringTemplate=!0,C.appendTo(c),this.unWireEvent(h,n===r&&"all-fields"!==a?"values":a,d),this.wireEvent(h,n===r&&"all-fields"!==a?"values":a,d),("pivotview"===this.parent.getModuleName()&&!this.parent.isAdaptive||"pivotfieldlist"===this.parent.getModuleName())&&(this.createDraggable(i[n],"pivotview"===this.parent.getModuleName()?v:f),(0,t.getInstance)(c.querySelector("."+b),t.Draggable).enableAutoScroll=!1)}}},e.prototype.createButtonText=function(e,i,a,r){var n,s,o,l;"filters"===a&&(s=this.updateButtontext(e[i].name)),(o="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule).fieldList&&(l=o.fieldList[e[i].name]),(0,t.isNullOrUndefined)(l)||(n="DistinctCount"!==(n=l.aggregateType)&&"number"!==l.type?"string"===l.type&&-1!==this.menuOption.stringAggregateTypes.indexOf(l.aggregateType)?l.aggregateType:"Count":void 0===n?"Sum":l.aggregateType);var d=e[i].caption?e[i].caption:e[i].name;d=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(d):d;var p=(0,t.createElement)("span",{attrs:{title:"filters"===a?"olap"===this.parent.dataType&&"CalculatedField"===o.fieldList[e[i].name].type?d:d+" ("+s+")":"olap"===this.parent.dataType?d:this.parent.dataSourceSettings.showAggregationOnValueField&&"values"===a&&"CalculatedField"!==n?this.parent.localeObj.getConstant(n)+" "+this.parent.localeObj.getConstant("of")+" "+d:d,tabindex:"-1","aria-disabled":"false","data-type":r===i?"":n},className:k+" "+("pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.allowDragAndDrop&&(e[i].allowDragAndDrop||void 0===e[i].allowDragAndDrop)?"":z:"")});return p.innerText="filters"===a?"olap"===this.parent.dataType&&l&&"CalculatedField"===l.type?d:d+" ("+s+")":"olap"===this.parent.dataType?d:this.parent.dataSourceSettings.showAggregationOnValueField&&"values"===a&&"CalculatedField"!==n?this.parent.localeObj.getConstant(n)+" "+this.parent.localeObj.getConstant("of")+" "+d:d,p},e.prototype.getTypeStatus=function(e,t,i){var a;if((a="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule).fieldList){var r=a.fieldList[e[t].name];r&&"CalculatedField"!==r.aggregateType&&this.validateDropdown(r.type)&&this.createSummaryType(i,e[t].name,e[t])}},e.prototype.validateDropdown=function(e){var t=this.parent.aggregateTypes;if("number"!==e)return t.indexOf("Count")>-1||t.indexOf("DistinctCount")>-1;for(var i=0;i<t.length;i++)if(this.parent.getAllSummaryType().indexOf(t[i])>-1)return!0;return!1},e.prototype.createSummaryType=function(e,i,a){var r=(0,t.createElement)("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("format")},className:o+" "+g});return"pivotview"===this.parent.getModuleName()?this.parent.groupingBarSettings.showValueTypeIcon&&a.showValueTypeIcon?(0,t.removeClass)([r],l):(0,t.addClass)([r],l):a.showValueTypeIcon?(0,t.removeClass)([r],l):(0,t.addClass)([r],l),e.appendChild(r),r},e.prototype.createChartValueDropdown=function(e,i){void 0===i&&(i=[]);var a=this.parent,r=(0,t.createElement)("div",{className:si});e.appendChild(r);var n=i.length>0?a.chartSettings.enableMultipleAxis?i[0].value:a.pivotChartModule.currentMeasure:null,s=new Ws.DropDownList({dataSource:i,enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:n,width:this.parent.isAdaptive?150:200,fields:{value:"value",text:"text"},cssClass:"e-group-chart-values-drodown"+(this.parent.cssClass?" "+this.parent.cssClass:""),placeholder:this.parent.localeObj.getConstant("valueAxisPrompt"),change:function(e){e.e&&null!==e.e&&(a.chartSettings.value=e.value)}});return s.isStringTemplate=!0,s.isAngular=this.parent.isModalDialog,s.appendTo(r),s},e.prototype.createMenuOption=function(e){this.menuOption.render(e,this.parentElement),this.parent.pivotButtonModule=this},e.prototype.openCalculatedFieldDialog=function(e){var i=e.target.parentElement.getAttribute("data-uid"),a=Hs.getFieldInfo(i,this.parent);if(this.parent.actionObj.actionName=pn,this.parent.actionObj.fieldInfo=a,!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("."+f).click(),this.parent.pivotFieldListModule.dialogRenderer.adaptiveElement.select(4),this.parent.pivotFieldListModule.calculatedFieldModule.updateAdaptiveCalculatedField(!0,i)):(this.parent.isAdaptive||(this.parent.calculatedFieldModule.buttonCall=!0),this.parent.notify(br,{edit:!0,fieldName:i})):"pivotfieldlist"===this.parent.getModuleName()&&(this.parent.isAdaptive?(this.parent.dialogRenderer.adaptiveElement.select(4),this.parent.calculatedFieldModule.updateAdaptiveCalculatedField(!0,i),this.parent.calculatedFieldModule.buttonCall=!0):(this.parent.dialogRenderer.fieldListDialog&&(this.parent.dialogRenderer.fieldListDialog.hide(),(0,t.addClass)([this.parent.element.querySelector("."+f)],d)),this.parent.notify(br,{edit:!0,fieldName:i}),this.parent.calculatedFieldModule&&(this.parent.calculatedFieldModule.buttonCall=!0)))}catch(e){this.parent.actionFailureMethod(e)}},e.prototype.createDraggable=function(e,i){this.draggable=new t.Draggable(i,{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?"":"."+A:e.allowDragAndDrop?"":"."+A})},e.prototype.createButtonDragIcon=function(e,i){var a=(0,t.createElement)("span",{attrs:{tabindex:"-1","aria-disabled":"false"}}),r=(0,t.createElement)("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("drag")},className:o+" "+G+" "+(e.allowDragAndDrop||void 0===e.allowDragAndDrop?"":z)});return a.appendChild(r),"pivotfieldlist"===this.parent.getModuleName()&&i.appendChild(a),a},e.prototype.createSortOption=function(e,i,a){var r,n,s;if(s="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate)r="Descending"===s.fieldList[i].sort?H:"";else{r="";for(var d=0;d<this.parent.dataSourceSettings.sortSettings.length;d++)this.parent.dataSourceSettings.sortSettings[d].name===i&&(r="Descending"===this.parent.dataSourceSettings.sortSettings[d].order?H:"")}return n=s.fieldList&&"None"===s.fieldList[i].sort?(0,t.createElement)("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("sort")},className:o}):(0,t.createElement)("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("sort")},className:o+" "+j+" "+r}),this.parent.dataSourceSettings.enableSorting?"pivotview"===this.parent.getModuleName()?a.showSortIcon&&this.parent.groupingBarSettings.showSortIcon?(0,t.removeClass)([n],l):(0,t.addClass)([n],l):a.showSortIcon?(0,t.removeClass)([n],l):(0,t.addClass)([n],l):(0,t.addClass)([n],l),e.appendChild(n),n},e.prototype.createFilterOption=function(e,i,a,r){var n,s;s="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule;var d=Hs.getFieldByName(i,this.parent.dataSourceSettings.filterSettings);if(!1===this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!1===this.parent.pivotGridModule.pivotDeferLayoutUpdate)s.fieldList[i].filter=null===s.fieldList[i].filter?[]:s.fieldList[i].filter,n="Server"===this.parent.dataSourceSettings.mode&&!d||"Local"===this.parent.dataSourceSettings.mode&&0===s.fieldList[i].filter.length?s.fieldList[i].isExcelFilter?B:U:B;else{n=U;for(var p=0;p<this.parent.dataSourceSettings.filterSettings.length;p++)this.parent.dataSourceSettings.filterSettings[p].name===i&&(n=B)}var h=(0,t.createElement)("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("filter")},className:V+" "+o+" "+n});return(this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==a||this.parent.dataSourceSettings.allowMemberFilter?(0,t.removeClass)([h],l):(0,t.addClass)([h],l),"pivotview"===this.parent.getModuleName()?((this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==a||this.parent.dataSourceSettings.allowMemberFilter)&&this.parent.groupingBarSettings.showFilterIcon&&r.showFilterIcon?(0,t.removeClass)([h],l):(0,t.addClass)([h],l):r.showFilterIcon&&((this.parent.dataSourceSettings.allowLabelFilter||this.parent.dataSourceSettings.allowValueFilter)&&"filters"!==a||this.parent.dataSourceSettings.allowMemberFilter)?(0,t.removeClass)([h],l):(0,t.addClass)([h],l),e.appendChild(h),h},e.prototype.updateButtontext=function(e){var t,i,a=(t="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule).fieldList[e].filter.length,r=t.fieldList[e].filterType,n=t.fieldList[e].dateMember.length,s=t.fieldList[e].filter[0];if("olap"===this.parent.dataType)i=this.updateOlapButtonText(t,e,s,a);else if("include"===r)1===a?i=s:a>1&&(i=a===n?this.parent.localeObj.getConstant("all"):this.parent.localeObj.getConstant("multipleItems"));else if("exclude"===r){if(1===a)i=2===n?s!==t.fieldList[e].dateMember[0].actualText?s:t.fieldList[e].dateMember[0].actualText:this.parent.localeObj.getConstant("multipleItems");else if(a>1){var o=void 0,l=Object.keys(t.fieldList[e].members),d=t.fieldList[e].filter;if(a===l.length-1)for(o=0;o<l.length;o++){var p=l[o];if(-1===d.indexOf(p)){i=l[o];break}}else i=this.parent.localeObj.getConstant("multipleItems")}}else i=this.parent.localeObj.getConstant("all");return i},e.prototype.updateOlapButtonText=function(e,t,i,a){var r,n=e.fieldList[t].actualFilter;if(n.length>0){var s=e.fieldList[t].members,o=[];if(e.fieldList[t].filterMembers.length>0){for(var l={},d=0,p=n;d<p.length;d++){l[c=p[d]]=c,s[c]&&(l=this.parent.pivotCommon.eventBase.getParentNode(t,c,l))}for(var h=0,u=l?Object.keys(l):[];h<u.length;h++){var c;s[c=u[h]].isSelected&&(s[c].parent&&s[s[c].parent].isSelected||o.push(c))}i=1===o.length?s[o[0]].caption:i}a=0===o.length?a:o.length}return 0===a?r=e.fieldList[t].allMember?e.fieldList[t].allMember:this.parent.localeObj.getConstant("all"):1===a?r=i:a>1&&(r=this.parent.localeObj.getConstant("multipleItems")),r},e.prototype.createDragClone=function(e){var i=(0,t.closest)(e.element,"."+A),a=(0,t.createElement)("div",{id:this.parent.element.id+"_DragClone",className:"e-button-drag-clone"+(this.parent.cssClass?" "+this.parent.cssClass:"")}),r=(0,t.createElement)("span",{className:ye});return r.innerText=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(i.textContent):i.textContent,a.appendChild(r),document.body.appendChild(a),Hs.getAppendToElement(this.parentElement,this.parent.isAngular).appendChild(a),a},e.prototype.onDragStart=function(e){var i=this,a=(0,t.closest)(e.element,"."+A),r=document.getElementById(this.parent.element.id+"_DragClone"),n=Hs.getFieldInfo(a.getAttribute("data-uid"),this.parent),s={fieldName:n.fieldName,fieldItem:n.fieldItem,axis:n.axis,dataSourceSettings:Hs.getClonedDataSourceSettings(this.parent.dataSourceSettings),cancel:!1};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(ar,s,function(n){if(n.cancel)i.parent.isDragging=!1,i.draggable.intDestroy(e.event),(0,t.detach)(r);else{i.parent.isDragging=!0;var s=("olap"===i.parent.dataType?i.parent.olapEngineModule:i.parent.engineModule).fieldList[a.getAttribute("data-uid")],o=[se,oe,de];if((0,t.addClass)([a],ve),r&&"Popup"===("pivotfieldlist"===i.parent.getModuleName()&&i.parent.renderMode)){var l=i.parent;r.style.zIndex=(l.dialogRenderer.fieldListDialog.zIndex+1).toString()}if(s&&"CalculatedField"===s.aggregateType)for(var d=0,p=o;d<p.length;d++){var h=p[d];(0,t.addClass)([i.parentElement.querySelector("."+h)],fe),i.parentElement.querySelector("."+h).querySelectorAll(".e-pivot-button").forEach(function(e){e.style.cursor="no-drop"})}}})},e.prototype.onDragging=function(e){this.draggable.setProperties({cursorAt:{top:!(0,t.isNullOrUndefined)(e.event.targetTouches)||t.Browser.isDevice?60:-20}})},e.prototype.onDragStop=function(e){this.parent.isDragging=!1,e.target&&e.element&&(0,t.closest)(e.element,"."+he)&&!(0,t.closest)(e.target,"."+ne)&&(e.cancel=!0);var i=(0,t.closest)(e.element,"."+A);(0,t.removeClass)([].slice.call(this.parentElement.querySelectorAll("."+A)),ve),(0,t.removeClass)([].slice.call(this.parentElement.querySelectorAll("."+W)),Q);for(var a=0,r=[se,oe,de];a<r.length;a++){var n=r[a];(0,t.removeClass)([this.parentElement.querySelector("."+n)],fe),this.parentElement.querySelector("."+n).querySelectorAll(".e-pivot-button").forEach(function(e){e.style.cursor="default"})}if(this.parent.pivotCommon.filterDialog.dialogPopUp&&this.parent.pivotCommon.filterDialog.dialogPopUp.close(),document.getElementById(this.parent.element.id+"_DragClone")&&(0,t.remove)(document.getElementById(this.parent.element.id+"_DragClone")),document.body.style.cursor="auto",this.isButtonDropped(e.target,i)&&!e.cancel&&(this.parent.pivotCommon.dataSourceUpdate.control="pivotview"===this.parent.getModuleName()?this.parent:this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent,this.parent.pivotCommon.nodeStateModified.onStateModified(e,i.getAttribute("data-uid")))){this.updateDataSource();this.parent.axisFieldModule.render()}},e.prototype.isButtonDropped=function(e,i){var a=(0,t.closest)(i,"."+ne),r=(0,t.closest)(e,"."+ne),n=!0;if(a&&a===r){for(var s=[].slice.call(a.querySelectorAll("."+A)),o=(0,t.closest)(e,"."+L),l=void 0,d=-1,p=0,h=s.length;p<h;p++)if(s[p].id===i.id&&(l=p),o){var u=o.querySelector("."+A);s[p].id===u.id&&(d=p)}(l===d||l===s.length-1&&-1===d)&&((0,t.removeClass)([].slice.call(this.parentElement.querySelectorAll("."+W)),Q),n=!1)}return n},e.prototype.updateSorting=function(e){var i=(0,t.closest)(e.target,"."+A),a=Hs.getFieldInfo(i?i.getAttribute("data-uid"):"",this.parent);if(!e.target.classList.contains(V)&&!e.target.classList.contains(_)&&!e.target.classList.contains(G)&&i&&a.fieldItem&&(a.fieldItem.showSortIcon||(0,t.isNullOrUndefined)(a.fieldItem.showSortIcon))&&!a.fieldItem.isCalculatedField){if(this.parent.actionObj.actionName=hn,this.parent.actionObj.fieldInfo=a,this.parent.actionBeginMethod())return;try{if((this.parent instanceof rd||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))){if(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()){var r={sortInfo:this.parent.lastSortInfo};this.parent.actionObj.actionInfo=r,this.updateDataSource(!0)}this.parent instanceof rd&&(this.axisField.render(),this.parent.isPopupView&&this.parent.pivotGridModule?this.parent.pivotGridModule.notify(hr,this):this.parent.staticPivotGridModule&&this.parent.staticPivotGridModule.notify(hr,this))}}catch(e){this.parent.actionFailureMethod(e)}}},e.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(hr,this),this.parent.pivotGridModule.setProperties({dataSourceSettings:this.parent.dataSourceSettings.properties},!0)):this.parent.triggerPopulateEvent()},e.prototype.updateFiltering=function(e){var t=this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent,i=e.target.parentElement.getAttribute("data-uid"),a=Hs.getFieldInfo(i,this.parent);if(this.parent.actionObj.actionName=un,this.parent.actionObj.fieldInfo=a,!this.parent.actionBeginMethod())try{"pivotfieldlist"===t.getModuleName()?(0,Bs.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&&Object.keys(this.parent.engineModule.fieldList[i].members).length>0?this.updateFilterEvents():this.parent.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)}},e.prototype.updateFilterEvents=function(){var e=this.parent.pivotGridModule?this.parent.pivotGridModule:this.parent;this.parent.pivotCommon.eventBase.updateFiltering(e.mouseEventArgs);var t=e.mouseEventArgs.target;this.fieldName=t.parentElement.getAttribute("data-uid"),this.parent.pivotCommon.filterDialog.dialogPopUp&&this.bindDialogEvents(),"pivotfieldlist"===e.getModuleName()?(0,Bs.hideSpinner)(e.fieldListSpinnerElement):e.hideWaitingPopup()},e.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.tabObj.selected=this.tabSelect.bind(this)):this.parent.dataSourceSettings.allowMemberFilter&&(this.index=0,this.updateDialogButtonEvents())},e.prototype.buttonModel=function(){return[{isFlat:!1,buttonModel:{cssClass:"e-clear-filter-button"+(this.parent.pivotCommon.filterDialog.allowExcelLikeFilter?"":" "+l)+(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:ie+(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:ae+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("cancel")}}]},e.prototype.tabSelect=function(e){this.index=e.selectedIndex,this.updateDialogButtonEvents(),(0,t.removeClass)([].slice.call(this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelectorAll(".e-selected-tab")),"e-selected-tab"),e.selectedIndex>0&&(0,t.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("."+ie).removeAttribute("disabled"))},e.prototype.updateDialogButtonEvents=function(){this.parent.pivotCommon.filterDialog.dialogPopUp.buttons=this.buttonModel(),this.parent.pivotCommon.filterDialog.dialogPopUp.dataBind();var e=this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector(".e-clear-filter-button");if(e){var t=this.parent.pivotCommon.filterDialog.dialogPopUp.buttons[0].buttonModel;t&&t.content&&e.setAttribute("title",t.content.toString())}},e.prototype.updateCustomFilter=function(){var e,i=this,a=this.parent.pivotCommon.filterDialog.dialogPopUp.element.querySelector(".e-selected-tab"),r=a.getAttribute("data-fieldname"),n=a.getAttribute("data-selectedField"),s=a.getAttribute("data-type"),o=a.getAttribute("data-measure"),l=a.getAttribute("data-operator"),d=a.getAttribute("data-value1"),p=a.getAttribute("data-value2"),h="value"===s?"Value":"date"===s?"Date":"number"===s?"Number":"Label",u={name:r,type:h,measure:o,condition:l,value1:"date"===s?new Date(d):d,value2:"date"===s?new Date(p):p};if("olap"===this.parent.dataType){u.selectedField=n,this.removeDataSourceSettings(r,n,h);for(var c=0,g=this.parent.dataSourceSettings.filterSettings;c<g.length;c++){var m=g[c];m.name===r&&m.selectedField===n&&(e=m)}}else e=Hs.getFilterItemByName(r,this.parent.dataSourceSettings.filterSettings);if((0,t.isNullOrUndefined)(d)||""===d||["Between","NotBetween"].indexOf(l)>-1&&((0,t.isNullOrUndefined)(p)||""===p)){var f=h.toLowerCase()+((0,t.isNullOrUndefined)(d)||""===d?"_input_option_1":"_input_option_2"),v=(0,t.select)("#"+this.parent.element.id+"_"+f,a);return(0,t.addClass)([v],Mt),void v.focus()}var S={cancel:!1,filterSettings:u,dataSourceSettings:Hs.getClonedDataSourceSettings(this.parent.dataSourceSettings)};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(Za,S,function(a){if(a.cancel||(u=a.filterSettings,e?((e=e.properties?e.properties:e).type=u.type,e.measure=u.measure,e.condition=u.condition,e.value1=u.value1,e.value2=u.value2,"olap"===i.parent.dataType&&(e.selectedField=u.selectedField)):i.parent.dataSourceSettings.filterSettings.push(u)),"Value"!==h&&(i.parent.lastFilterInfo=Hs.getFilterItemByName(r,i.parent.dataSourceSettings.filterSettings),i.parent.lastFilterInfo=i.parent.lastFilterInfo.properties?i.parent.lastFilterInfo.properties:i.parent.lastFilterInfo),i.parent.pivotCommon.filterDialog.dialogPopUp.close(),!a.cancel){i.refreshPivotButtonState(r,!0);var n={filterInfo:!(0,t.isNullOrUndefined)(i.parent)&&!(0,t.isNullOrUndefined)(i.parent.lastFilterInfo)&&Object.keys(i.parent.lastFilterInfo).length>0?i.parent.lastFilterInfo:u};i.parent.actionObj.actionInfo=n,i.updateDataSource(!0)}})},e.prototype.ClearFilter=function(){var e=this.parent.pivotCommon.filterDialog.dialogPopUp.element,t=e.getAttribute("data-fieldname"),i=e.querySelector(".e-selected-tab");if(this.parent.pivotCommon.filterDialog.dialogPopUp.close(),"olap"===this.parent.dataType&&i){var a=i.getAttribute("data-selectedField");this.removeDataSourceSettings(t,a)}else this.removeDataSourceSettings(t);var r=Hs.getFilterItemByName(t,this.parent.dataSourceSettings.filterSettings);this.refreshPivotButtonState(t,!!r),this.updateDataSource(!0)},e.prototype.removeButton=function(e){var t=this,i=e.target,a=i.parentElement.getAttribute("data-uid"),r=Hs.getFieldInfo(a,this.parent);if(this.parent.actionObj.actionName=cn,this.parent.actionObj.fieldInfo=r,!this.parent.actionBeginMethod()){var n={cancel:!1,fieldName:a,dataSourceSettings:Hs.getClonedDataSourceSettings(this.parent.dataSourceSettings),fieldItem:r.fieldItem,axis:r.axis};try{("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(tr,n,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&&t.parent.dataSourceSettings.values.length>1&&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)}}},e.prototype.nodeStateModified=function(e){var i=(0,t.closest)(e.node,"li"),a=i.getAttribute("data-fieldname");if("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);else{if("olap"===this.parent.dataType&&this.parent.olapEngineModule&&!this.parent.olapEngineModule.fieldList[a].isHierarchy){var r=this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes();this.updateNodeStates(r,a)}var n=this.parent.pivotCommon.currentTreeItemsPos[i.getAttribute("data-memberId")].index;this.parent.pivotCommon.currentTreeItems[n]&&(this.parent.pivotCommon.currentTreeItems[n].isSelected="check"===e.action,this.parent.pivotCommon.currentTreeItemsPos[i.getAttribute("data-memberId")].isSelected="check"===e.action)}this.parent.pivotCommon.filterDialog.updateCheckedState()},e.prototype.checkedStateAll=function(e){for(var t={},i=0,a=this.parent.pivotCommon.searchTreeItems;i<a.length;i++){(s=a[i]).isSelected="check"===e,t[s.htmlAttributes["data-memberId"]]=s.htmlAttributes["data-memberId"]}for(var r=0,n=this.parent.pivotCommon.currentTreeItems;r<n.length;r++){var s;void 0!==t[(s=n[r]).htmlAttributes["data-memberId"]]&&(s.isSelected="check"===e,this.parent.pivotCommon.currentTreeItemsPos[s.htmlAttributes["data-memberId"]].isSelected="check"===e)}},e.prototype.updateNodeStates=function(e,t){var i=this.parent.pivotCommon.engineModule.fieldList[t],a=i.members,r=i.currrentMembers;if(i.searchMembers.length>0){for(var n=0,s=Object.keys(r);n<s.length;n++){if(r[u=s[n]]&&(r[u].isSelected=!1),a[u])if(a[u].isSelected=!1,this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+u+'"]'))(d=this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+u+'"]'))&&!d.querySelector("ul")&&this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,u,!1)}for(var o=0,l=e;o<l.length;o++){var d;if(a[m=l[o]])if(this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+m+'"]'))(d=this.parent.pivotCommon.filterDialog.memberTreeView.element.querySelector('li[data-memberId="'+m+'"]'))&&!d.querySelector("ul")&&(a[m].isSelected=!0,this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,m,!0));r[m]&&(r[m].isSelected=!0)}}else{for(var p=0,h=Object.keys(a);p<h.length;p++){var u;a[u=h[p]].isSelected&&(a[u].isSelected=!1)}for(var c=0,g=e;c<g.length;c++){var m;a[m=g[c]]&&(a[m].isSelected=!0,this.parent.pivotCommon.eventBase.updateChildNodeStates(i.filterMembers,t,m,!0))}}},e.prototype.updateFilterState=function(e){var i=this,a=!1,r={items:[],name:e,type:"Include"},n="olap"===this.parent.dataType?this.parent.olapEngineModule:this.parent.engineModule,s=this.parent.pivotCommon.filterDialog.isAppendMode,o=Hs.getFilterItemByName(e,this.parent.dataSourceSettings.filterSettings);if("olap"===this.parent.dataType&&n&&!n.fieldList[e].isHierarchy){var l=n.fieldList[e].members,d=n.fieldList[e].currrentMembers;if(r.items=this.parent.pivotCommon.filterDialog.memberTreeView.getAllCheckedNodes(),r.levelCount=n.fieldList[e].levelCount,s&&o&&o.items){var p=new Set((o.items||[]).concat(r.items||[]));r.items=Array.from(p),r.type=o.type||"Include"}if(a=r.items.length!==this.parent.pivotCommon.filterDialog.memberTreeView.fields.dataSource.length,n.fieldList[e].searchMembers.length>0&&!a){var h=Object.keys(l).length,u=Object.keys(d).length;a=h!==u||h!==r.items.length}for(var c=0,g=r.items;c<g.length;c++){var m=g[c];n.fieldList[e].searchMembers.length>0&&d[m]?d[m].isSelected=!0:l[m]&&(l[m].isSelected=!0)}}else{for(var f=[],v=0,S=this.parent.pivotCommon.searchTreeItems;v<S.length;v++){var y=S[v];if(y.isSelected){var b=!1,C=!1;this.parent&&(this.parent.engineModule instanceof Us&&(b=e in this.parent.engineModule.groupingFields),(0,t.isNullOrUndefined)(this.parent.pivotCommon)||(C=this.parent.pivotCommon.isDateField)),C&&!b?f.push(y.actualText):b&&C?f.push("Server"===this.parent.dataSourceSettings.mode?y.actualText:y.name):f.push(y.htmlAttributes["data-memberId"])}}s&&o&&o.items?(r.items=Array.from(new Set((o.items||[]).concat(f))),r.type=o.type||"Include"):r.items=f,a=f.length!==this.parent.pivotCommon.currentTreeItems.length}if("olap"===this.parent.dataType&&this.removeDataSourceSettings(e),this.parent.allowDeferLayoutUpdate){n.fieldList[r.name].filterType=r.type.toLowerCase(),n.fieldList[r.name].filter=[];for(var x=0;x<r.items.length;x++)n.fieldList[r.name].filter.push(r.items[x])}var w={filterSettings:r,dataSourceSettings:Hs.getClonedDataSourceSettings(this.parent.dataSourceSettings),cancel:!1};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(Za,w,function(t){if(r=t.filterSettings,!t.cancel){if(Hs.getFilterItemByName(e,i.parent.dataSourceSettings.filterSettings))for(var n=0;n<i.parent.dataSourceSettings.filterSettings.length;n++)if(i.parent.dataSourceSettings.filterSettings[n].name===e){i.parent.dataSourceSettings.filterSettings.splice(n,1);break}i.parent.dataSourceSettings.filterSettings.push(r)}if(i.parent.pivotCommon.filterDialog.dialogPopUp.close(),!t.cancel){i.refreshPivotButtonState(e,a),a||(i.removeDataSourceSettings(e),r={}),i.parent.lastFilterInfo=r;var s={filterInfo:i.parent.lastFilterInfo};i.parent.actionObj.actionInfo=s,i.updateDataSource(!0);var o=i;o.parent instanceof rd&&o.axisField.render()}for(var l=0,d=[].slice.call(i.parentElement.querySelectorAll(".e-pivot-button"));l<d.length;l++){var p=d[l];if(p.getAttribute("data-uid")===e){p.focus();break}}})},e.prototype.refreshPivotButtonState=function(e,i){for(var a,r=0,n=[].slice.call(this.parentElement.querySelectorAll(".e-pivot-button"));r<n.length;r++){var s=n[r];if(s.getAttribute("data-uid")===e){a=s.querySelector("."+V);break}}a&&(i?((0,t.removeClass)([a],U),(0,t.addClass)([a],B)):((0,t.removeClass)([a],B),(0,t.addClass)([a],U)))},e.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--}},e.prototype.updateDropIndicator=function(e){if(this.parent.isDragging&&((0,t.removeClass)([].slice.call(this.parentElement.querySelectorAll("."+W+"-last")),Q),(0,t.removeClass)([].slice.call(this.parentElement.querySelectorAll("."+W)),Q),(0,t.closest)(e.target,"."+ne))){var i=(0,t.closest)(e.target,"."+L);(0,t.addClass)([i.querySelector("."+W)],Q)}},e.prototype.wireEvent=function(e,i,a){t.EventHandler.add(e,"mouseover",this.updateDropIndicator,this),a||(-1===["filters","values"].indexOf(i)&&null!==e.querySelector("."+A)&&t.EventHandler.add(e.querySelector("."+A),"click",this.updateSorting,this),"values"!==i&&null!==e.querySelector("."+V)&&t.EventHandler.add(e.querySelector("."+V),"click",this.updateFiltering,this),"values"===i&&null!==e.querySelector("."+g)&&t.EventHandler.add(e.querySelector("."+g),"click",this.createMenuOption,this)),null!==e.querySelector("."+xt)&&t.EventHandler.add(e.querySelector("."+xt),"click",this.openCalculatedFieldDialog,this),null!==e.querySelector("."+_)&&t.EventHandler.add(e.querySelector("."+_),"click",this.removeButton,this)},e.prototype.unWireEvent=function(e,i,a){t.EventHandler.remove(e,"mouseover",this.updateDropIndicator),a||(-1===["filters","values"].indexOf(i)&&null!==e.querySelector("."+A)&&t.EventHandler.remove(e.querySelector("."+A),"click",this.updateSorting),"values"!==i&&null!==e.querySelector("."+V)&&t.EventHandler.remove(e.querySelector("."+V),"click",this.updateFiltering),"values"===i&&null!==e.querySelector("."+g)&&t.EventHandler.remove(e.querySelector("."+g),"click",this.createMenuOption)),null!==e.querySelector("."+xt)&&t.EventHandler.remove(e.querySelector("."+xt),"click",this.openCalculatedFieldDialog),null!==e.querySelector("."+_)&&t.EventHandler.remove(e.querySelector("."+_),"click",this.removeButton)},e.prototype.addEventListener=function(){this.handlers={load:this.renderPivotButton},this.parent.isDestroyed||this.parent.on(yr,this.handlers.load,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(yr,this.handlers.load)},e.prototype.destroy=function(){this.removeEventListener(),this.cleanupButtonElements(),this.menuOption&&(this.menuOption.destroy(),this.menuOption=null),this.cleanupDropdowns(),this.draggable&&!this.draggable.isDestroyed&&(this.draggable.destroy(),this.draggable=null);var e=document.getElementById(this.parent.element.id+"_DragClone");e&&(0,t.remove)(e),this.axisField&&(this.axisField=null),this.handlers=null,this.isDestroyed=!0},e.prototype.cleanupButtonElements=function(){if(this.parentElement="pivotview"===this.parent.getModuleName()?this.parent.element:document.getElementById(this.parent.element.id+"_Container"),this.parentElement){var e=this.parentElement.querySelectorAll("."+L);if(e&&e.length>0)for(var i=0;i<e.length;i++){var a=e[i];t.EventHandler.remove(a,"mouseover",this.updateDropIndicator);var r=a.querySelector("."+A);if(r){t.EventHandler.remove(r,"click",this.updateSorting);for(var n=r.querySelectorAll("."+b),s=0;s<n.length;s++){var o=(0,t.getInstance)(n[s],t.Draggable);o&&!o.isDestroyed&&(o.destroy(),o=null)}var l=(0,t.getInstance)(r,io.Button);l&&!l.isDestroyed&&(l.destroy(),l=null),r.remove(),r=null}}}},e.prototype.cleanupDropdowns=function(){if(this.parentElement){var e=(0,t.select)("."+si,this.parentElement);if(e){var i=(0,t.getInstance)(e,Ws.DropDownList);i&&!i.isDestroyed&&i.destroy()}var a=(0,t.select)("."+oi,this.parentElement);if(a){var r=(0,t.getInstance)(a,Ws.DropDownList);r&&!r.isDestroyed&&r.destroy()}}},e}(),ed=function(){function e(e){this.parent=e}return e.prototype.render=function(){(!this.parent.pivotButtonModule||this.parent.pivotButtonModule&&this.parent.pivotButtonModule.isDestroyed)&&new $l(this.parent),this.parent.pivotButtonModule.cleanupButtonElements(),this.createPivotButtons()},e.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("."+C+"-filters")&&(t.querySelector("."+C+"-filters").querySelector("."+I).innerHTML=""),t.querySelector("."+C+"-rows")&&(t.querySelector("."+C+"-rows").querySelector("."+I).innerHTML=""),t.querySelector("."+C+"-columns")&&(t.querySelector("."+C+"-columns").querySelector("."+I).innerHTML=""),t.querySelector("."+C+"-values")&&(t.querySelector("."+C+"-values").querySelector("."+I).innerHTML=""),(this.parent.engineModule&&this.parent.engineModule.fieldList&&Object.keys(this.parent.engineModule.fieldList).length>0||"pivot"!==this.parent.dataType)&&("pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&(!(this.parent.dataSourceSettings.dataSource instanceof i.DataManager)&&this.parent.dataSourceSettings.dataSource.length>0||this.parent.dataSourceSettings.dataSource instanceof i.DataManager&&this.parent.engineModule.data&&this.parent.engineModule.data.length>0)||"olap"===this.parent.dataType&&this.parent.dataSourceSettings.url&&""!==this.parent.dataSourceSettings.url||"Server"===this.parent.dataSourceSettings.mode&&""!==this.parent.dataSourceSettings.url))for(var a=["rows","columns","values","filters"],r=0,n=e.length;r<n;r++)if(e[r]){var s={field:e[r],axis:a[r].toString()};this.parent.notify(yr,s)}},e.prototype.destroy=function(){var e=this.parent.dialogRenderer.parentElement;if(e)for(var t=0,i=["."+C+"-filters","."+C+"-rows","."+C+"-columns","."+C+"-values"];t<i.length;t++){var a=i[t],r=e.querySelector(a);r&&r.querySelector("."+I)&&(r.querySelector("."+I).innerHTML="")}},e}(),td=function(){function e(e){this.parent=e,this.parent.dialogRenderer=new Xl(this.parent),this.parent.treeViewModule=new Jl(this.parent),this.parent.axisTableModule=new Zl(this.parent),this.parent.axisFieldModule=new ed(this.parent)}return e.prototype.render=function(){this.parent.dialogRenderer.render(),this.parent.isAdaptive||this.parent.treeViewModule.render(),this.parent.axisTableModule.render()},e}(),id=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function a(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(a.prototype=i.prototype,new a)}}(),ad=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;o>=0;o--)(r=e[o])&&(s=(n<3?r(s):n>3?r(t,i,s):r(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s},rd=function(e){function a(t,i){var a=e.call(this,t,i)||this;return a.pivotChange=!1,a.isRequiredUpdate=!0,a.lastSortInfo={},a.lastFilterInfo={},a.lastAggregationInfo={},a.lastCalcFieldInfo={},a.isPopupView=!1,a.enableValueSorting=!1,a.request="undefined"!=typeof window?new XMLHttpRequest:null,a.remoteData=[],a.actionObj={},a.destroyEngine=!1,a.defaultFieldListOrder="None",a.isDeferUpdateApplied=!1,a.isInitial=!0,a.isModalDialog=!1,a}return id(a,e),a.prototype.requiredModules=function(){var e=[];return this.allowCalculatedField&&e.push({args:[this],member:"calculatedField"}),e},a.prototype.getAllSummaryType=function(){return["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfRunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"]},a.prototype.preRender=function(){this.dataSourceSettings&&"SSAS"===this.dataSourceSettings.providerType?(this.olapEngineModule=new Ml,this.dataType="olap"):(this.engineModule=new Us,this.dataType="pivot"),this.maxNodeLimitInMemberEditor<=0&&(this.maxNodeLimitInMemberEditor=1),this.isAdaptive=t.Browser.isDevice,this.globalize=new t.Internationalization(this.locale),this.renderModule=new td(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",Top:"Top",Bottom:"Bottom",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",PercentageOfRunningTotals:"% of 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",addCurrentSelection:"Add current selection to filter"},this.localeObj=new t.L10n(this.getModuleName(),this.defaultLocale,this.locale),this.isDragging=!1,this.isDeferLayoutUpdate=(0,t.isNullOrUndefined)(this.isDeferLayoutUpdate)&&!this.isPopupView?this.allowDeferLayoutUpdate:this.isDeferLayoutUpdate,this.wireEvent()},a.prototype.frameCustomProperties=function(e,t){this.pivotGridModule&&this.pivotGridModule.updatePageSettings(!1);var i=!!this.pivotGridModule&&this.pivotGridModule.isTabular,a=this.pivotGridModule?this.pivotGridModule.pageSettings:this.pageSettings,r=!!this.pivotGridModule&&this.pivotGridModule.enablePaging,n=!!this.pivotGridModule&&this.pivotGridModule.enableVirtualization,s=this.pivotGridModule?this.pivotGridModule.enableHtmlSanitizer:this.enableHtmlSanitizer,o=this.pivotGridModule?this.pivotGridModule.localeObj:this.staticPivotGridModule?this.staticPivotGridModule.localeObj:this.localeObj,l=!this.pivotGridModule||(this.pivotGridModule.allowDrillThrough||this.pivotGridModule.editSettings.allowEditing),d=this.pivotGridModule?this.pivotGridModule.enableValueSorting:this.staticPivotGridModule?this.staticPivotGridModule.enableValueSorting:this.enableValueSorting,p=!(!this.pivotGridModule||!this.pivotGridModule.allowDataCompression)&&this.pivotGridModule.allowDataCompression,h=this.pivotGridModule&&this.pivotGridModule.enableVirtualization&&this.pivotGridModule.virtualScrollSettings&&this.pivotGridModule.virtualScrollSettings.allowSinglePage;return"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}},a.prototype.render=function(){"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url?"Server"===this.dataSourceSettings.mode?(this.guid=Hs.generateUUID(),this.initialLoad()):new t.Fetch(this.dataSourceSettings.url,"GET").send().then(function(e){return"string"==typeof e?e:e.text()}).then(this.onReadyStateChange.bind(this)):this.initialLoad()},a.prototype.getEngine=function(e,t,i,a,r,n,s,o,l){var d=this;this.currentAction=e,this.pivotGridModule&&this.pivotGridModule.updatePageSettings(!1);var p={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(Hs.getLocalizedObject(this)),savedFieldList:"onDrop"===e&&null!==this.engineModule.fieldList?Hs.getClonedFieldList(this.engineModule.fieldList,!0):void 0,enableOptimizedRendering:this.pivotGridModule&&this.pivotGridModule.enableVirtualization&&this.pivotGridModule.virtualScrollSettings&&this.pivotGridModule.virtualScrollSettings.allowSinglePage,requestType:"string",headers:{"Content-type":"application/json"},enablePaging:this.pivotGridModule&&this.pivotGridModule.enablePaging,enableVirtualization:this.pivotGridModule&&this.pivotGridModule.enableVirtualization,allowDataCompression:this.pivotGridModule&&this.pivotGridModule.allowDataCompression,isTabular:this.pivotGridModule&&this.pivotGridModule.isTabular};this.request.readyState!==XMLHttpRequest.UNSENT&&this.request.readyState!==XMLHttpRequest.OPENED||(this.request.withCredentials=!1);var h={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.pivotGridModule.guid:this.staticPivotGridModule?this.staticPivotGridModule.guid:this.guid,isGroupingUpdated:"onRefresh"===this.currentAction&&this.dataSourceSettings.groupSettings.length>0||!(!this.pivotGridModule||!this.pivotGridModule.groupingModule)&&this.pivotGridModule.groupingModule.isUpdate};(this.isPopupView?this.pivotGridModule:this).trigger(nr,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);for(var u=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)))},a.prototype.onSuccess=function(){if(this.request.readyState===XMLHttpRequest.DONE){try{var e={action:this.currentAction,response:this.request.responseText};(this.isPopupView?this.pivotGridModule:this).trigger(sr,e);var i=JSON.parse(this.request.responseText);if("fetchFieldMembers"===this.currentAction){var a=JSON.parse(i.members),r=[],n={};this.engineModule.globalize=(0,t.isNullOrUndefined)(this.globalize)?new t.Internationalization:this.globalize,this.engineModule.formatFields=this.engineModule.setFormattedFields(this.dataSourceSettings.formatSettings);for(var s=Hs.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.actualText:o?isNaN(Number(h.Name))?h.Name:Number(h.Name):h.Name})}this.engineModule.fieldList[i.memberName].members=n,this.engineModule.fieldList[i.memberName].dateMember=r,this.pivotButtonModule.updateFilterEvents()}else{var c=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]]&&c[l[d]]&&(c[l[d]].dateMember=this.engineModule.fieldList[l[d]].dateMember,c[l[d]].formattedMembers=this.engineModule.fieldList[l[d]].formattedMembers,c[l[d]].members=this.engineModule.fieldList[l[d]].members);this.engineModule.fieldList=c,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.rowMaxLevel=JSON.parse(i.pivotCount).RowMaxLevel,this.pivotGridModule&&this.pivotGridModule.enablePaging&&(this.engineModule.rowPageCount=JSON.parse(i.pivotCount).RowPageCount,this.engineModule.columnPageCount=JSON.parse(i.pivotCount).ColumnPageCount);for(var g=void 0,m=JSON.parse(i.pivotValue),f=0;f<m.length;f++)if(m[f]&&m[f][0]&&"row"===m[f][0].axis){g=f;break}this.engineModule.headerContent=Hs.frameContent(m,"header",g,this),this.engineModule.pageSettings=this.pivotGridModule?this.pivotGridModule.pageSettings:void 0;var v=JSON.parse(i.dataSourceSettings).valueSortSettings;this.engineModule.valueSortSettings={headerText:v.headerText,headerDelimiter:v.headerDelimiter,sortOrder:v.sortOrder,columnIndex:v.columnIndex},this.engineModule.pivotValues=m,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))}},a.prototype.onReadyStateChange=function(e){var i=[];if("CSV"===this.dataSourceSettings.type)for(var a=e.split(/\r?\n|\r/),r=0;r<a.length;r++)(0,t.isNullOrUndefined)(a[r])||""===a[r]||i.push(a[r].split(","));else try{i=JSON.parse(e)}catch(e){i=[]}i&&i.length>0&&this.setProperties({dataSourceSettings:{dataSource:i}},!0),this.initialLoad()},a.prototype.initialLoad=function(){var e=this;this.isAngular&&!(0,t.isNullOrUndefined)(this.element.closest(".cdk-overlay-pane"))&&(this.isModalDialog=!0);var i={dataSourceSettings:this.dataSourceSettings,defaultFieldListOrder:this.defaultFieldListOrder};this.trigger(Ni,i,function(a){e.dataSourceSettings=a.dataSourceSettings,e.defaultFieldListOrder=i.defaultFieldListOrder,(0,t.addClass)([e.element],r),e.enableRtl?(0,t.addClass)([e.element],n):(0,t.removeClass)([e.element],n),e.isAdaptive?(0,t.addClass)([e.element],s):(0,t.removeClass)([e.element],s),e.cssClass&&(0,t.addClass)([e.element],e.cssClass.split(" ")),e.notify(pr,{})})},a.prototype.wireEvent=function(){this.on(pr,this.generateData,this),this.on(fr,this.fieldListRender,this)},a.prototype.unWireEvent=function(){this.pivotGridModule&&this.pivotGridModule.isDestroyed||(this.off(pr,this.generateData),this.off(fr,this.fieldListRender))},a.prototype.getPersistData=function(){return this.addOnPersist(["dataSourceSettings"])},a.prototype.getModuleName=function(){return"pivotfieldlist"},a.prototype.onPropertyChanged=function(i,a){for(var r=!1,s=0,o=Object.keys(i);s<o.length;s++){var l=o[s];switch(l){case"locale":this.isPopupView||e.prototype.refresh.call(this);break;case"dataSourceSettings":if(i.dataSourceSettings&&(!(0,t.isNullOrUndefined)(i.dataSourceSettings.dataSource)&&this.clonedDataSet!==i.dataSourceSettings.dataSource&&i.dataSourceSettings.groupSettings||1===Object.keys(i.dataSourceSettings).length&&"dataSource"===Object.keys(i.dataSourceSettings)[0]&&this.dataSourceSettings.groupSettings.length>0)&&(this.clonedDataSet=i.dataSourceSettings.dataSource,this.engineModule.groupingFields={}),i.dataSourceSettings&&1===Object.keys(i.dataSourceSettings).length&&i.dataSourceSettings.groupSettings&&"pivot"===this.dataType){var d=this.isPopupView?this.pivotGridModule:this.staticPivotGridModule;d&&d.updateGroupingReport(i.dataSourceSettings.groupSettings,"Date")}if((0,t.isNullOrUndefined)(i.dataSourceSettings.dataSource)&&("olap"!==this.dataType||(0,t.isNullOrUndefined)(i.dataSourceSettings.url))||("olap"!==this.dataType&&((0,t.isNullOrUndefined)(this.savedDataSourceSettings)||(Hs.updateDataSourceSettings(this.staticPivotGridModule,this.savedDataSourceSettings),this.savedDataSourceSettings=void 0),i.dataSourceSettings.dataSource&&0===i.dataSourceSettings.dataSource.length&&!(0,t.isNullOrUndefined)(this.staticPivotGridModule)&&(this.savedDataSourceSettings=Hs.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),(0,t.isNullOrUndefined)(this.staticPivotGridModule)||(this.staticPivotGridModule.pivotValues=[]),this.initialLoad()),Hs.isButtonIconRefesh(l,a,i)){if(this.isPopupView&&this.pivotGridModule&&this.pivotGridModule.showGroupingBar&&this.pivotGridModule.groupingBarModule){var p=Hs.cloneFieldSettings(this.dataSourceSettings.filters),h=Hs.cloneFieldSettings(this.dataSourceSettings.values),u=Hs.cloneFieldSettings(this.dataSourceSettings.rows),c=Hs.cloneFieldSettings(this.dataSourceSettings.columns);this.pivotGridModule.setProperties({dataSourceSettings:{rows:u,columns:c,values:h,filters:p}},!0),this.pivotGridModule.axisFieldModule.render()}else if(!this.isPopupView&&this.staticPivotGridModule&&!this.staticPivotGridModule.isDestroyed){var g=this.staticPivotGridModule;if(g.showGroupingBar&&g.groupingBarModule&&g.axisFieldModule.render(),g.showFieldList&&g.pivotFieldListModule){u=Hs.cloneFieldSettings(g.dataSourceSettings.rows),c=Hs.cloneFieldSettings(g.dataSourceSettings.columns),h=Hs.cloneFieldSettings(g.dataSourceSettings.values),p=Hs.cloneFieldSettings(g.dataSourceSettings.filters);g.pivotFieldListModule.setProperties({dataSourceSettings:{rows:u,columns:c,values:h,filters:p}},!0),g.pivotFieldListModule.axisFieldModule.render(),g.pivotFieldListModule.treeViewModule.fieldTable&&!g.isAdaptive&&g.pivotFieldListModule.notify(Sr,{})}}this.axisFieldModule.render(),this.treeViewModule.fieldTable&&!this.isAdaptive&&this.notify(Sr,{})}else this.remoteData=[],"pivot"===this.dataType&&this.dataSourceSettings.url&&""!==this.dataSourceSettings.url&&("type"in i.dataSourceSettings||"url"in i.dataSourceSettings)&&(this.engineModule.fieldList=null,this.render());break;case"aggregateTypes":this.axisFieldModule&&this.axisFieldModule.render(),this.pivotGridModule&&this.pivotGridModule.axisFieldModule&&(this.pivotGridModule.setProperties({aggregateTypes:i.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:i.showValuesButton},!0),this.pivotGridModule.axisFieldModule.render());break;case"enableRtl":this.enableRtl?(0,t.addClass)([this.element],n):(0,t.removeClass)([this.element],n),r=!0;break;case"enableFieldSearching":case"allowCalculatedField":this.fieldListRender();break;case"allowDeferLayoutUpdate":this.isDeferLayoutUpdate=this.allowDeferLayoutUpdate,this.fieldListRender(),this.pivotGridModule&&this.pivotGridModule.showGroupingBar&&this.pivotGridModule.groupingBarModule&&this.pivotGridModule.showFieldList&&this.pivotGridModule.groupingBarModule.alignIcon();break;case"maxNodeLimitInMemberEditor":this.maxNodeLimitInMemberEditor<=0&&(this.maxNodeLimitInMemberEditor=1)}r&&this.fieldListRender()}},a.prototype.initEngine=function(){var e=this;if("pivot"===this.dataType){var i=(0,t.isNullOrUndefined)(this.dataSourceSettings.dataSource)?(0,t.isNullOrUndefined)(this.engineModule.data)?void 0:this.engineModule.data[0]:this.dataSourceSettings.dataSource[0];if(i&&this.pivotCommon){var a="[object Array]"===Object.prototype.toString.call(i);if(a&&"JSON"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidJSON"));if(!a&&"CSV"===this.dataSourceSettings.type)return void this.pivotCommon.errorDialog.createErrorDialog(this.localeObj.getConstant("error"),this.localeObj.getConstant("invalidCSV"))}}var r={dataSourceSettings:Hs.getClonedDataSourceSettings(this.dataSourceSettings)},n=this.isPopupView?this.pivotGridModule:this;n.trigger(Pi,r,function(t){if(Hs.updateDataSourceSettings(e,t.dataSourceSettings),"pivot"===e.dataType){if(e.dataSourceSettings.groupSettings&&e.dataSourceSettings.groupSettings.length>0){var i=e.engineModule.data;e.clonedDataSet=e.clonedDataSet?e.clonedDataSet:"CSV"===e.dataSourceSettings.type?Hs.getClonedCSVData(i):Hs.getClonedData(i);var a=JSON.parse(e.getPersistData()).dataSourceSettings;a.dataSource=[],e.clonedReport=e.clonedReport?e.clonedReport:a}var r=e.frameCustomProperties();r.enableValueSorting=e.staticPivotGridModule?e.staticPivotGridModule.enableValueSorting:e.enableValueSorting,"Server"!==e.dataSourceSettings.mode&&e.engineModule.renderEngine(e.dataSourceSettings,r,e.aggregateCellInfo?e.getValueCellInfo.bind(e):void 0,e.onHeadersSort?e.getHeaderSortInfo.bind(e):void 0),e.pivotFieldList=e.engineModule.fieldList;var s={pivotFieldList:e.pivotFieldList,pivotValues:e.engineModule.pivotValues},o=e;n.trigger(Ei,s,function(e){o.pivotFieldList=e.pivotFieldList,o.engineModule.pivotValues=e.pivotValues,o.notify(fr,{}),o.trigger(Bi)})}else if("olap"===e.dataType){Hs.renderOlapEngine(e),e.pivotFieldList=e.olapEngineModule.fieldList;s={pivotFieldList:e.pivotFieldList,pivotValues:e.olapEngineModule.pivotValues};var l=e;n.trigger(Ei,s,function(e){l.pivotFieldList=e.pivotFieldList,l.olapEngineModule.pivotValues=e.pivotValues,l.notify(fr,{}),l.trigger(Bi)})}}),"None"!==this.defaultFieldListOrder&&this.treeViewModule.fieldTable&&!this.isAdaptive&&this.notify(Sr,{})},a.prototype.generateData=function(){this.pivotFieldList={},this.dataSourceSettings&&(this.dataSourceSettings.dataSource||this.dataSourceSettings.url)?""!==this.dataSourceSettings.url&&"olap"===this.dataType||!(0,t.isNullOrUndefined)(this.dataSourceSettings.dataSource)&&this.dataSourceSettings.dataSource.length>0?("pivot"===this.dataType&&(this.engineModule.data=this.dataSourceSettings.dataSource),this.initEngine()):this.dataSourceSettings.dataSource instanceof i.DataManager?"pivot"===this.dataType&&this.remoteData.length>0?(this.engineModule.data=this.remoteData,this.initEngine()):setTimeout(this.getData.bind(this),100):"Server"===this.dataSourceSettings.mode?this.getEngine("onRefresh"):this.notify(fr,{}):(this.notify(fr,{}),this.trigger(Bi))},a.prototype.getValueCellInfo=function(e){var t=e;return this.trigger(Ua,t),t},a.prototype.getHeaderSortInfo=function(e){var t=e;return this.trigger(Ba,t),t},a.prototype.getBeforeServiceInvoke=function(e){return this.trigger(nr,e),e},a.prototype.getAfterServiceInvoke=function(e){return this.trigger(sr,e),e},a.prototype.getData=function(){this.dataSourceSettings.dataSource.defaultQuery?this.dataSourceSettings.dataSource.executeQuery(this.dataSourceSettings.dataSource.defaultQuery).then(this.executeQuery.bind(this)):this.dataSourceSettings.dataSource.executeQuery(new i.Query).then(this.executeQuery.bind(this))},a.prototype.executeQuery=function(e){this.engineModule.data=e.result,this.initEngine()},a.prototype.fieldListRender=function(){if(this.renderModule){var e;this.element.innerHTML="","Popup"===this.renderMode&&this.dialogRenderer&&this.dialogRenderer.fieldListDialog&&!this.dialogRenderer.fieldListDialog.isDestroyed&&(e=this.dialogRenderer.fieldListDialog.visible,this.dialogRenderer.fieldListDialog.destroy(),(0,t.remove)(document.getElementById(this.element.id+"_Container"))),this.renderModule.render(),"Popup"===this.renderMode&&this.dialogRenderer?(this.fieldListSpinnerElement=this.dialogRenderer.fieldListDialog.element,e&&this.dialogRenderer.fieldListDialog.show()):this.fieldListSpinnerElement=this.element.querySelector(".e-pivotfieldlist-container"),this.spinnerTemplate?(0,Bs.createSpinner)({target:this.fieldListSpinnerElement,template:this.spinnerTemplate,cssClass:this.cssClass?this.cssClass:void 0},this.createElement):(0,Bs.createSpinner)({target:this.fieldListSpinnerElement,cssClass:this.cssClass?this.cssClass:void 0},this.createElement);var i={pivotEngine:"olap"===this.dataType?this.olapEngineModule:this.engineModule,dataSourceSettings:this.dataSourceSettings,id:this.element.id,element:"Popup"===this.renderMode&&this.dialogRenderer?this.dialogRenderer.fieldListDialog.element:(0,t.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 ro(i),this.pivotCommon.control=this,this.allowDeferLayoutUpdate&&(this.clonedDataSource=Hs.getClonedDataSourceSettings(this.dataSourceSettings),"olap"===this.dataType&&(this.clonedFieldListData=Hs.cloneOlapFieldSettings(this.olapEngineModule.fieldListData)),this.clonedFieldList=Hs.getClonedFieldList(this.pivotFieldList));var a=this.isPopupView?this.pivotGridModule:this.staticPivotGridModule;a&&a.toolbarModule&&Hs.toggleFieldListIconVisibility(a)}},a.prototype.getFieldCaption=function(e){var t=this.getFields(e),i="olap"===this.dataType?this.olapEngineModule:this.engineModule;if(t.length>0&&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)}},a.prototype.getFields=function(e){return[e.rows,e.columns,e.values,e.filters]},a.prototype.updateDataSource=function(e,i){var a=this;this.pivotGridModule&&this.pivotGridModule.showWaitingPopup(),(0,Bs.showSpinner)(this.fieldListSpinnerElement);var r=this,n=r.isPopupView?r.pivotGridModule:r,s=!1,o=r.pivotGridModule&&(r.pivotGridModule.enableVirtualization||r.pivotGridModule.enablePaging)?r.pivotGridModule.pageSettings:void 0,l=Object.keys(r.lastCalcFieldInfo).length>0,d=Object.keys(r.lastSortInfo).length>0,p=Object.keys(r.lastAggregationInfo).length>0,h=Object.keys(r.lastFilterInfo).length>0,u={dataSourceSettings:Hs.getClonedDataSourceSettings(r.dataSourceSettings)};n.trigger(Pi,u,function(u){if(o&&(d||h||p||l)||(Hs.updateDataSourceSettings(r,u.dataSourceSettings),Hs.updateDataSourceSettings(r.pivotGridModule,u.dataSourceSettings)),(0,t.isNullOrUndefined)(i)){var c=!d&&(r.pivotGridModule?r.pivotGridModule.enableValueSorting:r.staticPivotGridModule?r.staticPivotGridModule.enableValueSorting:r.enableValueSorting);if(!d||""===r.dataSourceSettings.valueSortSettings.headerText&&""===r.dataSourceSettings.valueSortSettings.rowHeaderText&&""===r.dataSourceSettings.valueSortSettings.columnHeaderText||(r.pivotGridModule&&r.pivotGridModule.setProperties({dataSourceSettings:{valueSortSettings:{headerText:"",rowHeaderText:"",columnHeaderText:""}}},!0),r.setProperties({dataSourceSettings:{valueSortSettings:{headerText:"",rowHeaderText:"",columnHeaderText:""}}},!0)),"pivot"===r.dataType){var g=r.frameCustomProperties();g.enableValueSorting=c,g.savedFieldList=r.pivotFieldList,o&&(d||h||p||l)&&!r.allowDeferLayoutUpdate?(d&&("Server"===n.dataSourceSettings.mode?n.getEngine("onSort",null,r.lastSortInfo,null,null,null,null):r.engineModule.onSort(r.lastSortInfo),r.lastSortInfo={}),h&&("Server"===n.dataSourceSettings.mode?n.getEngine("onFilter",null,null,null,null,r.lastFilterInfo,null):r.engineModule.onFilter(r.lastFilterInfo,r.dataSourceSettings),r.lastFilterInfo={}),p&&("Server"===n.dataSourceSettings.mode?n.getEngine("onAggregation",null,null,r.lastAggregationInfo,null,null,null):r.engineModule.onAggregation(r.lastAggregationInfo),r.lastAggregationInfo={}),l&&("Server"===n.dataSourceSettings.mode?n.getEngine("onCalcOperation",null,null,null,r.lastCalcFieldInfo,null,null):r.engineModule.onCalcOperation(r.lastCalcFieldInfo,r.dataSourceSettings),r.lastCalcFieldInfo={})):("Server"===r.dataSourceSettings.mode?d?r.getEngine("onSort",null,r.lastSortInfo,null,null,null,null):p?r.getEngine("onAggregation",null,null,r.lastAggregationInfo,null,null,null):l?r.getEngine("onCalcOperation",null,null,null,r.lastCalcFieldInfo,null,null):h?r.getEngine("onFilter",null,null,null,null,r.lastFilterInfo,null):r.getEngine("onDrop",null,null,null,null,null,null):r.engineModule.renderEngine(r.dataSourceSettings,g,r.aggregateCellInfo?r.getValueCellInfo.bind(r):void 0,r.onHeadersSort?r.getHeaderSortInfo.bind(r):void 0),r.lastSortInfo={},r.lastAggregationInfo={},r.lastCalcFieldInfo={},r.lastFilterInfo={})}else s=r.updateOlapDataSource(r,d,l,s,c,h);r.getFieldCaption(r.dataSourceSettings)}else r.axisFieldModule.render(),r.pivotGridModule&&r.pivotGridModule.notify(hr,r),r.isRequiredUpdate=!1;"Server"===r.dataSourceSettings.mode&&e?(r.allowDeferLayoutUpdate&&!r.isRequiredUpdate||r.isRequiredUpdate)&&((0,Bs.hideSpinner)(a.fieldListSpinnerElement),a.pivotGridModule&&a.pivotGridModule.hideWaitingPopup()):r.enginePopulatedEventMethod(r,e,s)})},a.prototype.enginePopulatedEventMethod=function(e,i,a){var r=this,n=e.isPopupView?e.pivotGridModule:e,s={dataSourceSettings:e.dataSourceSettings,pivotFieldList:"pivot"===e.dataType?e.engineModule.fieldList:e.olapEngineModule.fieldList,pivotValues:"pivot"===e.dataType?e.engineModule.pivotValues:e.olapEngineModule.pivotValues};n.trigger(Ei,s,function(n){e.dataSourceSettings=n.dataSourceSettings,e.pivotCommon.dataSourceSettings=e.dataSourceSettings,e.pivotFieldList=n.pivotFieldList,"olap"===e.dataType?(e.olapEngineModule.pivotValues=n.pivotValues,e.pivotCommon.engineModule=e.olapEngineModule):(e.engineModule.pivotValues=n.pivotValues,e.pivotCommon.engineModule=e.engineModule),i||!e.treeViewModule.fieldTable||e.isAdaptive||e.notify(Sr,{}),e.isRequiredUpdate?(e.allowDeferLayoutUpdate&&(e.clonedDataSource=Hs.getClonedDataSourceSettings(e.dataSourceSettings),"olap"===r.dataType&&(r.clonedFieldListData=Hs.cloneOlapFieldSettings(r.olapEngineModule.fieldListData)),e.clonedFieldList=Hs.getClonedFieldList(e.pivotFieldList)),e.updateView(e.pivotGridModule)):r.isPopupView&&(r.isDeferLayoutUpdate||e.pivotGridModule&&e.pivotGridModule.pivotDeferLayoutUpdate)&&(e.pivotGridModule.engineModule=e.engineModule,e.pivotGridModule.setProperties({dataSourceSettings:e.dataSourceSettings.properties},!0),e.pivotGridModule.notify(hr,e),(0,Bs.hideSpinner)(e.fieldListSpinnerElement)),(r.isPopupView&&e.pivotGridModule&&e.pivotGridModule.allowDeferLayoutUpdate&&!e.isRequiredUpdate||!(0,t.isNullOrUndefined)(e.pivotGridModule))&&((0,Bs.hideSpinner)(e.fieldListSpinnerElement),e.pivotGridModule.hideWaitingPopup()),e.isRequiredUpdate=!0,!e.pivotGridModule||a?(0,Bs.hideSpinner)(e.fieldListSpinnerElement):e.pivotGridModule.fieldListSpinnerElement=e.fieldListSpinnerElement});var o=this.getActionCompleteName();this.actionObj.actionName=o,this.actionObj.actionName&&this.actionCompleteMethod()},a.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?Hs.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},a.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.fieldList: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,this.treeViewModule.fieldTable&&!this.isAdaptive&&this.notify(Sr,{}),this.axisFieldModule.render(),!this.isPopupView&&this.allowDeferLayoutUpdate&&(this.clonedDataSource=Hs.getClonedDataSourceSettings(this.dataSourceSettings),"olap"===this.dataType&&(this.clonedFieldListData=Hs.cloneOlapFieldSettings(this.olapEngineModule.fieldListData)),this.clonedFieldList=Hs.getClonedFieldList(this.pivotFieldList)))},a.prototype.updateView=function(e){if(e){var t="Calculated field applied"===this.actionObj.actionName&&"olap"===e.dataType;e.element.querySelector(".e-spin-hide")&&!t&&(!this.allowDeferLayoutUpdate||this.isDeferUpdateApplied||e.isInitial&&"Chart"!==e.currentView)&&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.pivotValues:this.engineModule.pivotValues);var i={dataSourceSettings:Hs.getClonedDataSourceSettings(e.dataSourceSettings),pivotValues:e.pivotValues};e.trigger(Ya,i),this.isPopupView||!("olap"===this.dataType?this.olapEngineModule.isEngineUpdated:this.engineModule.isEngineUpdated)&&!this.isInitial||(this.staticPivotGridModule=e,e.isStaticRefresh=!0,e.isStaticFieldList=!0),this.isDeferUpdateApplied=!1,this.staticPivotGridModule&&(this.staticPivotGridModule.isServerWaitingPopup=!0),e.dataBind()}},a.prototype.triggerPopulateEvent=function(){var e=this,t=this.isPopupView?this.pivotGridModule:this,i={dataSourceSettings:this.dataSourceSettings,pivotFieldList:"olap"===this.dataType?this.olapEngineModule.fieldList:this.engineModule.fieldList,pivotValues:"olap"===this.dataType?this.olapEngineModule.pivotValues:this.engineModule.pivotValues};t.trigger(Ei,i,function(t){e.dataSourceSettings=t.dataSourceSettings,e.pivotFieldList=t.pivotFieldList,"olap"===e.dataType?e.olapEngineModule.pivotValues=t.pivotValues:e.engineModule.pivotValues=t.pivotValues})},a.prototype.actionBeginMethod=function(){var e={dataSourceSettings:Hs.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,cancel:!1};return(this.isPopupView?this.pivotGridModule:this).trigger(or,e),e.cancel},a.prototype.actionCompleteMethod=function(){var e={dataSourceSettings:Hs.getClonedDataSourceSettings(this.dataSourceSettings),actionName:this.actionObj.actionName,fieldInfo:this.actionObj.fieldInfo,actionInfo:this.actionObj.actionInfo};(this.isPopupView?this.pivotGridModule:this).trigger(lr,e),this.actionObj.actionName="",this.actionObj.actionInfo=void 0,this.actionObj.fieldInfo=void 0},a.prototype.actionFailureMethod=function(e){var t={actionName:this.actionObj.actionName,errorInfo:e};(this.isPopupView?this.pivotGridModule:this).trigger(dr,t)},a.prototype.getActionCompleteName=function(){return this.actionObj.actionName===gn?Rn:this.actionObj.actionName===pn?hs:this.actionObj.actionName===hn?us:this.actionObj.actionName===un?cs:this.actionObj.actionName===cn?gs:this.actionObj.actionName===bn?ms:this.actionObj.actionName===dn?Vn:this.actionObj.actionName},a.prototype.destroy=function(){this.unWireEvent(),this.fieldListSpinnerElement&&((0,Bs.hideSpinner)(this.fieldListSpinnerElement),this.fieldListSpinnerElement=null),this.request&&(this.request.abort(),this.request=null),this.contextMenuModule&&(this.contextMenuModule.destroy(),this.contextMenuModule=null),this.calculatedFieldModule&&(this.calculatedFieldModule.destroy(),this.calculatedFieldModule=null),this.pivotButtonModule&&(this.pivotButtonModule.destroy(),this.pivotButtonModule=null),this.axisFieldModule&&(this.axisFieldModule.destroy(),this.axisFieldModule=null),this.axisTableModule&&(this.axisTableModule.destroy(),this.axisTableModule=null),this.treeViewModule&&(this.treeViewModule.destroy(),this.treeViewModule=null),this.dialogRenderer&&(this.dialogRenderer.destroy(),this.dialogRenderer=null),this.renderModule&&(this.renderModule=null),this.pivotCommon&&(this.pivotCommon.destroy(),this.pivotCommon=null),this.engineModule&&!this.destroyEngine&&(this.engineModule.fieldList={},this.engineModule.rMembers=null,this.engineModule.cMembers=null,this.engineModule.valueMatrix=[],this.engineModule.pivotValues=[],this.engineModule.data=[],this.engineModule=null),this.olapEngineModule&&!this.destroyEngine&&(this.olapEngineModule.fieldList={},this.olapEngineModule.fieldListData=null,this.olapEngineModule.pivotValues=[],this.olapEngineModule=null),this.pivotFieldList&&(this.pivotFieldList=null),this.clonedDataSet=[],this.clonedDataSource={},this.clonedFieldList={},this.clonedFieldListData=[],this.clonedReport={},this.lastSortInfo={},this.lastFilterInfo={},this.lastAggregationInfo={},this.lastCalcFieldInfo={},this.remoteData=[],this.actionObj={},this.savedDataSourceSettings=null,this.localeObj=null,this.defaultLocale=null,this.globalize=null,this.pivotGridModule=null,this.staticPivotGridModule=null,this.filterTargetID=null,this.element&&(this.element.innerHTML="",(0,t.removeClass)([this.element],r),(0,t.removeClass)([this.element],n),(0,t.removeClass)([this.element],s)),this.isModalDialog=!1},ad([(0,t.Complex)({},xo)],a.prototype,"dataSourceSettings",void 0),ad([(0,t.Property)("Popup")],a.prototype,"renderMode",void 0),ad([(0,t.Property)()],a.prototype,"target",void 0),ad([(0,t.Property)("")],a.prototype,"cssClass",void 0),ad([(0,t.Property)(!1)],a.prototype,"enableHtmlSanitizer",void 0),ad([(0,t.Property)(!1)],a.prototype,"allowCalculatedField",void 0),ad([(0,t.Property)(!1)],a.prototype,"enableFieldSearching",void 0),ad([(0,t.Property)(!1)],a.prototype,"showValuesButton",void 0),ad([(0,t.Property)(!1)],a.prototype,"allowDeferLayoutUpdate",void 0),ad([(0,t.Property)(1e3)],a.prototype,"maxNodeLimitInMemberEditor",void 0),ad([(0,t.Property)(!0)],a.prototype,"loadOnDemandInMemberEditor",void 0),ad([(0,t.Property)()],a.prototype,"spinnerTemplate",void 0),ad([(0,t.Property)(["Sum","Count","DistinctCount","Product","Min","Max","Avg","Median","Index","PopulationVar","SampleVar","PopulationStDev","SampleStDev","RunningTotals","PercentageOfRunningTotals","PercentageOfGrandTotal","PercentageOfColumnTotal","PercentageOfRowTotal","PercentageOfParentColumnTotal","PercentageOfParentRowTotal","DifferenceFrom","PercentageOfDifferenceFrom","PercentageOfParentTotal"])],a.prototype,"aggregateTypes",void 0),ad([(0,t.Property)("USD")],a.prototype,"currencyCode",void 0),ad([(0,t.Event)()],a.prototype,"load",void 0),ad([(0,t.Event)()],a.prototype,"enginePopulating",void 0),ad([(0,t.Event)()],a.prototype,"memberFiltering",void 0),ad([(0,t.Event)()],a.prototype,"enginePopulated",void 0),ad([(0,t.Event)()],a.prototype,"onFieldDropped",void 0),ad([(0,t.Event)()],a.prototype,"fieldDrop",void 0),ad([(0,t.Event)()],a.prototype,"fieldDragStart",void 0),ad([(0,t.Event)()],a.prototype,"aggregateCellInfo",void 0),ad([(0,t.Event)()],a.prototype,"memberEditorOpen",void 0),ad([(0,t.Event)()],a.prototype,"calculatedFieldCreate",void 0),ad([(0,t.Event)()],a.prototype,"aggregateMenuOpen",void 0),ad([(0,t.Event)()],a.prototype,"fieldRemove",void 0),ad([(0,t.Event)()],a.prototype,"dataBound",void 0),ad([(0,t.Event)()],a.prototype,"created",void 0),ad([(0,t.Event)()],a.prototype,"destroyed",void 0),ad([(0,t.Event)()],a.prototype,"beforeServiceInvoke",void 0),ad([(0,t.Event)()],a.prototype,"afterServiceInvoke",void 0),ad([(0,t.Event)()],a.prototype,"actionBegin",void 0),ad([(0,t.Event)()],a.prototype,"actionComplete",void 0),ad([(0,t.Event)()],a.prototype,"actionFailure",void 0),ad([(0,t.Event)()],a.prototype,"onHeadersSort",void 0),a=ad([t.NotifyPropertyChanges],a)}(t.Component),nd="Count",sd="Median",od="Sum",ld="DistinctCount",dd="Product",pd="SampleStDev",hd="PopulationStDev",ud="SampleVar",cd="PopulationVar",gd="CalculatedField",md=function(){function e(e){this.isFormula=!1,this.isRequireUpdate=!1,this.formatTypes=["Standard","Currency","Percent","Custom","None"],(0,t.initializeTelemetryFeature)("CalculatedField","PivotTable"),this.parent=e,this.existingReport=null,this.parent.calculatedFieldModule=this,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}return e.prototype.getModuleName=function(){return"calculatedField"},e.prototype.keyActionHandler=function(e){var i=e.currentTarget.querySelector(".e-node-focus");if(i)switch(e.action){case"moveRight":case"shiftE":"pivot"===this.parent.dataType&&this.displayMenu(i);break;case"delete":"LI"===i.tagName&&!i.querySelector(".e-list-icon.e-format")&&!i.querySelector(".e-list-icon").classList.contains(".e-icons")&&i.querySelector("."+Jt)&&i.querySelector("."+Jt).classList.contains("e-list-icon")&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,i);break;case"enter":var a=i.getAttribute("data-field"),r=(0,t.getInstance)((0,t.select)("#"+this.parentID+"calculateddialog",document),Bs.Dialog),n=i.getAttribute("data-type"),s=(0,t.select)("#"+this.parentID+"droppable",r.element);"pivot"===this.parent.dataType?""===s.value?s.value=n===gd?i.getAttribute("data-uid"):'"'+n+"("+a+')"':""!==s.value&&(s.value=n===gd?s.value+i.getAttribute("data-uid"):s.value+'"'+n+"("+a+')"'):(this.parent.olapEngineModule&&this.parent.olapEngineModule.fieldList[a]&&this.parent.olapEngineModule.fieldList[a].isCalculatedField&&(a=this.parent.olapEngineModule.fieldList[a].tag),""===s.value?s.value=a:""!==s.value&&(s.value=s.value+a))}},e.prototype.fieldClickHandler=function(e){var i=(0,t.closest)(e.event.target,"li");(e.event.target.classList.contains(ot)||e.event.target.classList.contains(xt)||e.event.target.classList.contains(wt)||e.event.target.classList.contains(Jt))&&(this.parent.isAdaptive?"olap"===this.parent.dataType&&this.parent.isAdaptive&&("LI"===i.tagName&&i.querySelector(".e-list-edit-icon").classList.contains(xt)&&e.event.target.classList.contains(xt)?(this.isEdit=!0,this.currentFieldName=i.getAttribute("data-field"),this.fieldText=i.getAttribute("data-caption"),this.formulaText=i.getAttribute("data-formula"),this.formatType=i.getAttribute("data-formatString"),this.formatText="Custom"===this.formatType?i.getAttribute("data-customformatstring"):null,this.fieldType=i.getAttribute("data-membertype"),this.parentHierarchy="Dimension"===this.fieldType?i.getAttribute("data-hierarchy"):null,(0,t.addClass)([i.querySelector(".e-list-edit-icon")],wt),(0,t.removeClass)([i.querySelector(".e-list-edit-icon")],xt),this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)):"LI"===i.tagName&&i.querySelector(".e-list-edit-icon").classList.contains(wt)&&e.event.target.classList.contains(wt)?(this.isEdit=!1,this.fieldText=this.formatText=this.formulaText=this.currentFieldName=null,this.parentHierarchy=this.fieldType=this.formatType=null,(0,t.addClass)([i.querySelector(".e-list-edit-icon")],xt),(0,t.removeClass)([i.querySelector(".e-list-edit-icon")],wt)):"LI"===i.tagName&&i.querySelector("."+Jt).classList.contains("e-icons")&&e.event.target.classList.contains(Jt)&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,e.node)):this.displayMenu(i,e.node,e.event.target))},e.prototype.accordionClickHandler=function(e){if(e.item&&-1!==e.item.iconCss.indexOf("e-list-icon")&&(0,t.closest)(e.originalEvent.target,".e-acrdn-header-icon")){var i=(0,t.closest)(e.originalEvent.target,".e-acrdn-header").querySelector("."+et),a=i.getAttribute("data-field"),r=i.getAttribute("data-caption"),n=Hs.getFieldByName(a,this.parent.dataSourceSettings.formatSettings),s=(0,t.closest)(e.originalEvent.target,".e-acrdn-header-icon");if(n){var o=this.getFormat(n.format),l=o?this.formatTypes.indexOf(o)>-1?n.format:"Custom":"None";this.formatType=l}s.querySelector("."+xt)&&e.originalEvent.target.classList.contains(xt)?(this.isEdit=!0,this.currentFieldName=a,this.fieldText=r||a,this.formulaText=this.parent.engineModule.fieldList[a].formula,this.formatText=n?n.format:"",(0,t.addClass)([s.querySelector(".e-list-icon")],wt),(0,t.removeClass)([s.querySelector(".e-list-icon")],xt),this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)):s.querySelector("."+wt)&&e.originalEvent.target.classList.contains(wt)?(this.isEdit=!1,this.fieldText=this.formatText=this.formulaText=this.currentFieldName=null,(0,t.addClass)([s.querySelector(".e-list-icon")],xt),(0,t.removeClass)([s.querySelector(".e-list-icon")],wt)):s.querySelector("."+Jt)&&e.originalEvent.target.classList.contains(Jt)&&this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),{},!0,i)}},e.prototype.accordionCreated=function(){for(var e=(0,t.getInstance)((0,t.select)("#"+this.parentID+"accordDiv",document),Gs.Accordion).element.querySelectorAll(".e-acrdn-item"),i=0;i<e.length;i++)if(e[i].querySelector("."+xt)||e[i].querySelector("."+wt)){var a=(0,t.createElement)("span",{className:"e-list-icon "+Jt+" e-icons"});(0,t.append)([a],e[i].querySelector(".e-acrdn-header-icon")),(0,t.addClass)([e[i]],"e-select")}},e.prototype.clearFormula=function(){this.treeObj&&this.treeObj.element.querySelector("li")&&((0,t.removeClass)(this.treeObj.element.querySelectorAll("li"),"e-active"),this.displayMenu(this.treeObj.element.querySelector("li")))},e.prototype.displayMenu=function(e,i,a){var r=!a||a.classList.contains(xt),n=!a||a.classList.contains(wt),s=(0,t.getInstance)((0,t.select)("#"+this.parentID+"calculateddialog",document),Bs.Dialog),l=(0,t.getInstance)((0,t.select)("#"+this.parentID+"ddlelement",document),zs.MaskedTextBox);try{if("pivot"!==this.parent.dataType||!e.querySelector(".e-list-icon.e-format")||!e.querySelector(".e-list-icon.e-format").classList.contains(o)||e.querySelector(".e-list-icon").classList.contains(wt)||e.querySelector(".e-list-icon").classList.contains(Jt)||e.querySelector(".e-list-icon").classList.contains(xt)||"LI"!==e.tagName){if("LI"===e.tagName&&(e.querySelector("."+xt)&&e.querySelector("."+xt).classList.contains("e-list-icon")&&r||"olap"===this.parent.dataType&&e.getAttribute("data-type")===gd&&e.classList.contains("e-active")&&(a&&!a.classList.contains(Jt)||!a))){this.isEdit=!0;var d=e.getAttribute("data-field"),p=e.getAttribute("data-caption");this.currentFieldName=d,l.value=p,l.dataBind();var h=e.getAttribute("data-formatString"),u=s.element,c=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Format_Div",u),Ws.DropDownList),g=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Custom_Format_Element",u),zs.MaskedTextBox),m=e.getAttribute("data-customformatstring");if("olap"===this.parent.dataType){var f=e.getAttribute("data-membertype"),v=e.getAttribute("data-hierarchy"),S=e.getAttribute("data-formula"),y=(0,t.select)("#"+this.parentID+"_FieldNameTitle",u),b=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Member_Type_Div",u),Ws.DropDownList),C=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Hierarchy_List_Div",u),Ws.DropDownList);y.innerText=this.parent.localeObj.getConstant("caption"),(0,t.select)("#"+this.parentID+"droppable",document).value=S,b.readonly=!0,b.value=f,b.dataBind(),"Dimension"===f&&(C.value=v)}else(0,t.addClass)(this.treeObj.element.querySelectorAll("."+wt),xt),(0,t.removeClass)(this.treeObj.element.querySelectorAll("."+wt),wt),(0,t.addClass)([e.querySelector(".e-list-icon")],wt),(0,t.removeClass)([e.querySelector(".e-list-icon")],xt),e.querySelector("."+wt).setAttribute("title",this.parent.localeObj.getConstant("clearCalculatedField")),(0,t.select)("#"+this.parentID+"droppable",document).value=e.getAttribute("data-uid");""!==h&&(c.value=h,c.dataBind()),g.value=m,g.dataBind()}else if("LI"===e.tagName&&(e.querySelector("."+wt)&&e.querySelector("."+wt).classList.contains("e-list-icon")&&n||"olap"===this.parent.dataType&&!e.classList.contains("e-active"))){this.isEdit=!1,l.value="",l.dataBind();u=s.element;if((g=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Custom_Format_Element",u),zs.MaskedTextBox)).value="",g.dataBind(),"olap"===this.parent.dataType){C=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Hierarchy_List_Div",u),Ws.DropDownList),c=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Format_Div",u),Ws.DropDownList),b=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Member_Type_Div",u),Ws.DropDownList);(y=(0,t.select)("#"+this.parentID+"_FieldNameTitle",u)).innerText=this.parent.localeObj.getConstant("fieldTitle"),C.index=0,C.dataBind(),c.index=0,c.dataBind(),b.index=0,b.readonly=!1,b.dataBind()}else(0,t.addClass)(this.treeObj.element.querySelectorAll("."+wt),xt),(0,t.removeClass)(this.treeObj.element.querySelectorAll("."+wt),wt),e.querySelector("."+xt).setAttribute("title",this.parent.localeObj.getConstant("edit"));(0,t.select)("#"+this.parentID+"droppable",document).value=""}else if("LI"===e.tagName&&e.querySelector("."+Jt)&&e.querySelector("."+Jt).classList.contains("e-list-icon")&&!r&&!n){if(this.parent.actionObj.actionName=cn,this.parent.actionBeginMethod())return;var x=(0,t.select)("#"+this.parentID+"droppable",document),w={name:this.isEdit?this.currentFieldName:l.value,caption:l.value,formula:x.value};this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("removeCalculatedField"),w,!0,i)}}else{var T=(0,t.select)("#"+this.parentID+"CalcContextmenu",document)?(0,t.getInstance)((0,t.select)("#"+this.parentID+"CalcContextmenu",document),Gs.ContextMenu):null;T&&!T.isDestroyed&&T.destroy(),this.curMenu=e.querySelector("."+De),this.openContextMenu(e)}}catch(e){this.parent.actionFailureMethod(e)}},e.prototype.removeCalcField=function(e){var i,a=this.parent.dataSourceSettings,r=e.getAttribute("data-field"),n=a.calculatedFieldSettings;"pivot"===this.parent.dataType&&(this.parent.isAdaptive?"number"==typeof(p=parseInt(e.getAttribute("id").split(this.parentID+"_")[1],10))&&(0,t.getInstance)((0,t.select)("#"+this.parentID+"accordDiv",document),Gs.Accordion).hideItem(p):this.treeObj.removeNodes([e]));for(var s=0;s<n.length;s++)if(n[s]&&n[s].name===r){n.splice(s,1);break}if("olap"===this.parent.dataType){for(var o=(i=this.parent.olapEngineModule).fieldListData?i.fieldListData:[],l=0,d=Object.keys(o);l<d.length;l++){var p,h=d[l];if(o[parseInt(h,10)].name===r)if("number"==typeof(p=parseInt(h,10))){o.splice(p,1);break}}var u=this.treeObj.getNode(e).parentID;this.treeObj.removeNodes([e]),n.length<=0&&this.treeObj.removeNodes([u])}else i=this.parent.engineModule;if(i.fields)for(s=0;s<i.fields.length;s++)if(i.fields[s]===r){i.fields.splice(s,1);break}i.savedFieldList&&i.savedFieldList[r]&&delete i.savedFieldList[r],i.fieldList&&i.fieldList[r]&&delete i.fieldList[r];var c=a.formatSettings;for(s=0;s<c.length;s++)if(c[s]&&c[s].name===r){c.splice(s,1);break}for(var g=[a.values,a.rows,a.columns,a.filters],m=(s=0,g.length);s<m;s++)for(var f=0,v=g[s].length;f<v;f++)if(g[s][f].name===r){g[s].splice(f,1);break}if(this.isEdit&&this.currentFieldName===r){var S=(0,t.getInstance)((0,t.select)("#"+this.parentID+"ddlelement",document),zs.MaskedTextBox);this.isEdit=!1,S.value="",this.currentFieldName=this.formatText=this.fieldText=this.formatType=null,this.formulaText=this.fieldType=this.parentHierarchy=null}(!(0,t.isNullOrUndefined)(this.parent.isDeferLayoutUpdate)&&!this.parent.isDeferLayoutUpdate||this.parent.pivotGridModule&&!this.parent.pivotGridModule.pivotDeferLayoutUpdate||"pivotfieldlist"!==this.parent.getModuleName())&&this.parent.updateDataSource(),this.closeErrorDialog()},e.prototype.openContextMenu=function(e){var i=this,a=e.getAttribute("data-field"),r="number"!==this.parent.engineModule.fieldList[a].type?"string":"number",n="string"===r?this.getValidSummaryType().slice(0,2):this.getValidSummaryType(),s={cancel:!1,fieldName:a,aggregateTypes:this.getMenuItems(r).slice()};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger(Wa,s,function(a){if(!a.cancel){for(var r=[],s=[],o=0,l=a.aggregateTypes;o<l.length;o++){var d=l[o];n.indexOf(d)>-1&&-1===r.indexOf(d)&&(r.push(d),s.push({id:i.parent.element.id+"Calc_"+d,text:i.parent.localeObj.getConstant(d)}))}i.createMenu(s,e);var p=e.getBoundingClientRect(),h=window.scrollY||document.documentElement.scrollTop,u=(0,t.getInstance)((0,t.select)("#"+i.parentID+"CalcContextmenu",document),Gs.ContextMenu);i.parent.enableRtl?u.open(p.top+h,p.left-100):u.open(p.top+h,p.left+150)}})},e.prototype.selectContextMenu=function(e){if(null!==e.element.textContent){var i=(0,t.closest)(this.curMenu,".e-list-item").getAttribute("data-caption");(0,t.closest)(this.curMenu,".e-list-item").setAttribute("data-type",e.element.id.split("_").pop()),this.curMenu.textContent=i+" ("+e.element.textContent+")",(0,t.addClass)([this.curMenu.parentElement.parentElement],["e-node-focus","e-hover"]),this.curMenu.parentElement.parentElement.setAttribute("tabindex","0"),this.curMenu.parentElement.parentElement.focus()}},e.prototype.createMenu=function(e,i){var a,r=this,n={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(){r.treeObj.element.focus(),(0,t.addClass)([i],["e-hover","e-node-focus"])}};a=(0,t.select)("#"+this.parentID+"CalcContextmenu",document)?(0,t.select)("#"+this.parentID+"CalcContextmenu",document):(0,t.createElement)("ul",{id:this.parentID+"CalcContextmenu"}),(0,t.getInstance)((0,t.select)("#"+this.parentID+"calculateddialog",document),Bs.Dialog).element.appendChild(a);var s=new Gs.ContextMenu(n);s.isStringTemplate=!0,s.isAngular=this.parent.isModalDialog,s.appendTo(a)},e.prototype.applyFormula=function(){var e=this,i=this,a=!1;(0,t.removeClass)([document.getElementById(this.parentID+"ddlelement")],Mt);var r=(0,t.getInstance)((0,t.select)("#"+this.parentID+"ddlelement",document),zs.MaskedTextBox);this.newFields=(0,t.extend)([],this.parent.dataSourceSettings.calculatedFieldSettings,null,!0);var n={fieldName:this.isEdit?this.currentFieldName:r.value,calculatedField:this.getCalculatedFieldInfo(),calculatedFieldSettings:Hs.cloneCalculatedFieldSettings(this.parent.dataSourceSettings.calculatedFieldSettings),cancel:!1};("pivotfieldlist"===this.parent.getModuleName()&&this.parent.isPopupView?this.parent.pivotGridModule:this.parent).trigger($a,n,function(r){if(r.cancel)e.endDialog(),e.parent.lastCalcFieldInfo={},e.isFormula=!1;else{var n=r.calculatedField;if(!e.isEdit)if("olap"===i.parent.dataType){var s=n.name;i.parent.olapEngineModule.fieldList[s]&&"CalculatedField"!==i.parent.olapEngineModule.fieldList[s].type&&(a=!0)}else for(var o=0,l=Object.keys(i.parent.engineModule.fieldList);o<l.length;o++){var d=l[o];n.name&&n.name===d&&"CalculatedField"!==i.parent.engineModule.fieldList[d].aggregateType&&(a=!0)}if(a)return void i.parent.pivotCommon.errorDialog.createErrorDialog(i.parent.localeObj.getConstant("error"),i.parent.localeObj.getConstant("fieldExist"));e.existingReport=(0,t.extend)({},e.parent.dataSourceSettings,null,!0);var p=e.parent.dataSourceSettings;if((0,t.isNullOrUndefined)(n.name)||""===n.name||(0,t.isNullOrUndefined)(n.caption)||""===n.caption||!n.formula||""===n.formula){if((0,t.isNullOrUndefined)(n.name)||""===n.name||(0,t.isNullOrUndefined)(n.caption)||""===n.caption)(0,t.getInstance)((0,t.select)("#"+e.parentID+"ddlelement",document),zs.MaskedTextBox).value="",(0,t.addClass)([document.getElementById(e.parentID+"ddlelement")],Mt),document.getElementById(e.parentID+"ddlelement").focus();else e.triggerActionCompleteEvent()}else{s=void 0;if("olap"===e.parent.dataType){if(s={name:n.name,formula:n.formula,formatString:n.formatString},(0,t.isNullOrUndefined)(n.hierarchyUniqueName)||(s.hierarchyUniqueName=n.hierarchyUniqueName),e.isFieldExist=!1,e.isEdit){for(v=0;v<p.calculatedFieldSettings.length;v++)if(p.calculatedFieldSettings[v].name===s.name&&e.isEdit){p.calculatedFieldSettings[v].hierarchyUniqueName=n.hierarchyUniqueName,e.parent.olapEngineModule.fieldList[s.name].caption=n.caption,p.calculatedFieldSettings[v].formatString=s.formatString,p.calculatedFieldSettings[v].formula=s.formula,s=p.calculatedFieldSettings[v],e.updateFormatSettings(p,s.name,n.formatString),e.parent.olapEngineModule.getFormattedFields(p.formatSettings),e.parent.olapEngineModule.formatFields[s.name]&&(e.parent.olapEngineModule.formatFields[s.name].format?e.parent.olapEngineModule.formatFields[s.name].format=e.getFormat(s.formatString):delete e.parent.olapEngineModule.formatFields[s.name]),e.isFieldExist=!0;break}for(var h=!1,u=0,c=[p.rows,p.columns,p.values,p.filters];u<c.length;u++){for(var g=0,m=c[u];g<m.length;g++){var f=m[g];if(f.isCalculatedField&&null!==s.name&&f.name===s.name&&e.isEdit){f.caption=n.caption,e.isFieldExist=!0,h=!0;break}}if(h)break}}else for(var v=0;v<p.calculatedFieldSettings.length;v++)if(p.calculatedFieldSettings[v].name===s.name)return void e.createConfirmDialog(i.parent.localeObj.getConstant("alert"),i.parent.localeObj.getConstant("confirmText"),n);e.isFieldExist||(p.calculatedFieldSettings.push(s),e.updateFormatSettings(p,s.name,n.formatString),e.parent.olapEngineModule.getFormattedFields(p.formatSettings),e.parent.olapEngineModule.formatFields[s.name]&&(e.parent.olapEngineModule.formatFields[s.name].format?e.parent.olapEngineModule.formatFields[s.name].format=e.getFormat(s.formatString):delete e.parent.olapEngineModule.formatFields[s.name])),e.parent.lastCalcFieldInfo=s}else{s={name:n.name,caption:n.caption,type:"CalculatedField"};var S={name:n.name,formula:n.formula};if((0,t.isNullOrUndefined)(n.formatString)||(S.formatString=n.formatString),e.isFieldExist=!0,e.isEdit){for(v=0;v<p.values.length;v++)if(p.values[v].type===gd&&null!==s.name&&p.values[v].name===s.name&&e.isEdit)for(y=0;y<p.calculatedFieldSettings.length;y++)p.calculatedFieldSettings[y].name===s.name&&(p.values.splice(v,1),p.values.splice(v,0,s),e.currentFormula=p.calculatedFieldSettings[y].formula,p.calculatedFieldSettings.splice(y,1),p.calculatedFieldSettings.splice(y,0,S),e.updateFormatSettings(p,s.name,n.formatString),e.isFieldExist=!1)}else for(var v=0;v<p.values.length;v++)if(p.values[v].type===gd&&p.values[v].name===s.name){for(var y=0;y<p.calculatedFieldSettings.length;y++)if(p.calculatedFieldSettings[y].name===s.name)return void e.createConfirmDialog(i.parent.localeObj.getConstant("alert"),i.parent.localeObj.getConstant("confirmText"),n);e.isFieldExist=!1}e.isFieldExist&&(p.values.push(s),p.calculatedFieldSettings.push(S),e.updateFormatSettings(p,s.name,n.formatString)),e.parent.lastCalcFieldInfo=S}e.addFormula(p,s.name)}}})},e.prototype.getCalculatedFieldInfo=function(){var e=(0,t.select)("#"+this.parentID+"calculateddialog",document),i=e?(0,t.getInstance)(e,Bs.Dialog):void 0,a=(0,t.getInstance)((0,t.select)("#"+this.parentID+"ddlelement",document),zs.MaskedTextBox),r=(0,t.select)("#"+this.parentID+"droppable",document),n=this.parent.isAdaptive?this.parent.dialogRenderer.adaptiveElement.element:i.element,s=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Custom_Format_Element",n),zs.MaskedTextBox),o={name:this.isEdit?this.currentFieldName:a.value,caption:a.value,formula:r.value},l=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Format_Div",n),Ws.DropDownList);if(o.formatString="Custom"===l.value?s.value:"None"===l.value?null:l.value,"olap"===this.parent.dataType){var d=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Member_Type_Div",n),Ws.DropDownList),p=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Hierarchy_List_Div",n),Ws.DropDownList);"Dimension"===d.value&&(o.hierarchyUniqueName=p.value),this.parent.olapEngineModule&&(this.parent.olapEngineModule.currentCalcFieldInfo={fieldType:d.value,fieldName:o.name,hierarchyUniqueName:o.hierarchyUniqueName})}return o},e.prototype.updateFormatSettings=function(e,i,a){for(var r={name:i,format:a,useGrouping:!0},n=!1,s=0;s<e.formatSettings.length;s++)if(e.formatSettings[s].name===i){if("undefined"===a||void 0===a||""===a){e.formatSettings.splice(s,1),n=!0;break}var o=e.formatSettings[s].properties?e.formatSettings[s].properties:e.formatSettings[s];o.format=a,e.formatSettings.splice(s,1,o),n=!0;break}n||""===a||(0,t.isNullOrUndefined)(a)||e.formatSettings.push(r)},e.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};this.parent.actionObj.actionInfo=i;var a=this.parent.actionObj.actionName===pn?hs:Rn;this.parent.actionObj.actionName=a,this.parent.updateDataSource(!1);var r="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()}},e.prototype.endDialog=function(){this.isEdit=!1;var e=(0,t.select)("#"+this.parentID+"calculateddialog",document),i=e?(0,t.getInstance)(e,Bs.Dialog):void 0;if(i)i.close();else{(0,t.getInstance)((0,t.select)("#"+this.parentID+"ddlelement",document),zs.MaskedTextBox).value="",this.currentFieldName=this.formatText=this.fieldText=this.formatType=null,this.formulaText=this.fieldType=this.parentHierarchy=null;var a=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:i.element;if(this.parent.dialogRenderer.parentElement.querySelector("."+tt).value="",(0,t.select)("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement).value="",(0,t.select)("#"+this.parentID+"Custom_Format_Element",this.parent.dialogRenderer.parentElement).value="","olap"===this.parent.dataType){var r=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Member_Type_Div",a),Ws.DropDownList),n=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Hierarchy_List_Div",a),Ws.DropDownList);r.index=0,r.readonly=!1,r.dataBind(),n.index=0,n.enabled=!1,n.dataBind()}var s=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Custom_Format_Element",a),zs.MaskedTextBox),o=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Format_Div",a),Ws.DropDownList);o.index="olap"===this.parent.dataType?0:4,o.dataBind(),s.enabled=!1,s.dataBind()}this.parent&&"olap"===this.parent.dataType&&this.parent.olapEngineModule&&(this.parent.olapEngineModule.currentCalcFieldInfo={})},e.prototype.showError=function(){if(this.parent.engineModule.fieldList[this.field]&&delete this.parent.engineModule.fieldList[this.field],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={},"olap"===this.parent.dataType&&this.parent.olapEngineModule&&(this.parent.olapEngineModule.currentCalcFieldInfo={}),this.triggerActionCompleteEvent(),this.parent.updateDataSource(!1),this.isFormula=!1},e.prototype.getFieldListData=function(e){var i=[];if("olap"===this.parent.dataType)for(var a=0,r=i=Hs.getClonedData(e.olapEngineModule.fieldListData?e.olapEngineModule.fieldListData:[]);a<r.length;a++){var n=r[a];n.spriteCssClass&&(n.spriteCssClass.indexOf("e-attributeCDB-icon")>-1||n.spriteCssClass.indexOf("e-level-members")>-1)?n.hasChildren=!0:n.spriteCssClass&&n.spriteCssClass.indexOf("e-namedSetCDB-icon")>-1?n.hasChildren=!1:n.spriteCssClass&&n.spriteCssClass.indexOf("e-calcMemberGroupCDB")>-1&&(n.expanded=this.isEdit)}else for(var s=0,l=e.engineModule.fieldList?Object.keys(e.engineModule.fieldList):[];s<l.length;s++){var d,p=l[s],h=null,u=e.engineModule.fieldList[p];h="number"===u.type&&"include"!==e.engineModule.fieldList[p].type&&"exclude"!==e.engineModule.fieldList[p].type||"DistinctCount"===u.aggregateType?void 0!==u.aggregateType?u.aggregateType:od:nd,d=this.parent.localeObj.getConstant(h),i.push({index:u.index,name:(this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(u.caption):u.caption)+" ("+d+")",type:h,icon:ot+" "+o,formula:this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(u.formula):u.formula,field:this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(p):p,caption:this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(u.caption?u.caption:p):u.caption?u.caption:p})}return i},e.prototype.fieldDropped=function(e){e.cancel=!0;var i=(0,t.getInstance)((0,t.select)("#"+this.parentID+"calculateddialog",document),Bs.Dialog),a=(0,t.select)("#"+this.parentID+"droppable",i.element);(0,t.removeClass)([a],"e-copy-drop"),(0,t.removeClass)([e.draggedNode.querySelector("."+De)],ve);var r=e.draggedNode.getAttribute("data-field");if("olap"===this.parent.dataType)if(this.parent.olapEngineModule.fieldList[r]&&this.parent.olapEngineModule.fieldList[r].isCalculatedField&&(r=this.parent.olapEngineModule.fieldList[r].tag),e.target.id===this.parentID+"droppable"&&""===a.value)a.value=r,a.focus();else if(e.target.id===this.parentID+"droppable"&&""!==a.value){var n=a.value,s=a.selectionStart,o=n.substring(s,n.length),l=(p=n.substring(0,s))+r;a.value=p+r+o,a.focus(),a.setSelectionRange(l.length,l.length)}else e.cancel=!0;else{var d=e.draggedNode.getAttribute("data-type");if(e.target.id===this.parentID+"droppable"&&""===a.value)a.value=d===gd?e.draggedNodeData.id.toString():'"'+d+"("+r+')"',a.focus();else if(e.target.id===this.parentID+"droppable"&&""!==a.value){l=void 0,s=a.selectionStart;var p=(n=a.value).substring(0,s);o=n.substring(s,n.length);d===gd?(l=p+e.draggedNodeData.id.toString(),a.value=p+e.draggedNodeData.id.toString()+o):(l=p+'"'+d+"("+r+')"',a.value=p+'"'+d+"("+r+')"'+o),a.focus(),a.setSelectionRange(l.length,l.length)}else e.cancel=!0}},e.prototype.createDialog=function(){var e=this;if(null!==(0,t.select)("#"+this.parentID+"calculateddialog",document))for((0,t.remove)((0,t.select)("#"+this.parentID+"calculateddialog",document));!(0,t.isNullOrUndefined)(document.querySelector("."+this.parentID+"calculatedmenu"));)(0,t.remove)(document.querySelector("."+this.parentID+"calculatedmenu"));var i=(0,t.createElement)("div",{id:this.parentID+"calculateddialog",className:"e-pivot-calc-dialog-div "+("olap"===this.parent.dataType?"e-olap-calc-dialog-div":"")});this.parent.element.appendChild(i);var a=[{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}}];if("olap"===this.parent.dataType){var r={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,r)}var n=new Bs.Dialog({allowDragging:!0,position:{X:"center",Y:"center"},buttons:a,close:this.closeDialog.bind(this),beforeOpen:this.beforeOpen.bind(this),open:function(){(0,t.select)("#"+e.parentID+"ddlelement",n.element)&&(0,t.select)("#"+e.parentID+"ddlelement",n.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:Hs.getAppendToElement(this.parent.element,this.parent.isAngular),cssClass:this.parent.cssClass});n.isStringTemplate=!0,n.isAngular=this.parent.isModalDialog,n.appendTo(i)},e.prototype.cancelClick=function(){(0,t.getInstance)((0,t.select)("#"+this.parentID+"calculateddialog",document),Bs.Dialog).close(),this.isEdit=!1},e.prototype.beforeOpen=function(){(0,t.getInstance)((0,t.select)("#"+this.parentID+"calculateddialog",document),Bs.Dialog).element.querySelector(".e-dlg-header").setAttribute("title",this.parent.localeObj.getConstant("createCalculatedField"))},e.prototype.closeDialog=function(){"pivotfieldlist"===this.parent.getModuleName()&&("Abort"!==this.parent.actionObj.actionName&&this.parent.axisFieldModule.render(),"Fixed"!==this.parent.renderMode&&((0,t.addClass)([this.parent.element.querySelector("."+f)],d),this.parent.dialogRenderer.fieldListDialog.show())),this.destroy(),(0,t.isNullOrUndefined)(document.getElementById(this.parentID+"calculateddialog"))||(0,t.remove)(document.getElementById(this.parentID+"calculateddialog")),(0,t.isNullOrUndefined)(document.querySelector("."+this.parentID+"calculatedmenu"))||(0,t.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))},e.prototype.setFocus=function(){var e;if("pivotview"===this.parent.getModuleName()&&this.parent.element?e=this.parent.element: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}}},e.prototype.renderDialogElements=function(){var e=(0,t.createElement)("div",{id:this.parentID+"outerDiv",className:("olap"===this.parent.dataType?"e-olap-calc-outer-div ":"")+"e-pivot-calc-outer-div"}),i=(0,t.createElement)("div",{id:this.parentID+"Olap_Tree_Div",className:"e-olap-field-tree-div"}),a=(0,t.createElement)("div",{id:this.parentID+"Pivot_Calc_Div",className:"e-pivot-calculated-div"});if("pivotfieldlist"===this.parent.getModuleName()&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+lt)&&this.parent.isAdaptive){var r=(0,t.createElement)("div",{id:this.parentID+"accordDiv",className:"e-pivot-accord"});e.appendChild(r);var n=(0,t.createElement)("div",{id:this.parentID+"buttonDiv",className:ct}),s=(0,t.createElement)("button",{id:this.parentID+"addBtn",className:"e-pivot-add-button",attrs:{type:"button"}});s.innerText=this.parent.localeObj.getConstant("add");var l=(0,t.createElement)("button",{id:this.parentID+"cancelBtn",className:"e-pivot-cancel-button",attrs:{type:"button"}});l.innerText=this.parent.localeObj.getConstant("cancel"),n.appendChild(l),n.appendChild(s),e.appendChild(n)}else{if(!this.parent.isAdaptive&&"olap"===this.parent.dataType)(v=(0,t.createElement)("div",{className:"e-pivot-field-name-title",id:this.parentID+"_FieldNameTitle"})).innerText=this.parent.localeObj.getConstant("fieldTitle"),a.appendChild(v);var d=(0,t.createElement)("div",{id:this.parentID+"innerDiv",className:"e-pivot-calc-input-div"}),p=(0,t.createElement)("input",{id:this.parentID+"ddlelement",attrs:{type:"text"},className:tt});d.appendChild(p),"olap"!==this.parent.dataType||this.parent.isAdaptive?e.appendChild(d):a.appendChild(d);var h=(0,t.createElement)("div",{id:this.parentID+"control_container",className:pt});if(!this.parent.isAdaptive){var u=(0,t.createElement)("div",{className:St});if(u.innerText="olap"===this.parent.dataType?this.parent.localeObj.getConstant("allFields"):this.parent.localeObj.getConstant("formulaField"),"olap"===this.parent.dataType){var c=(0,t.createElement)("div",{className:St+"-container"});c.appendChild(u);var g=(0,t.createElement)("span",{attrs:{tabindex:"0","aria-disabled":"false","aria-label":this.parent.localeObj.getConstant("fieldTooltip"),role:"button"},className:o+" "+Tt});c.appendChild(g);var m=new Bs.Tooltip({content:this.parent.localeObj.getConstant("fieldTooltip"),position:this.parent.enableRtl?"RightCenter":"LeftCenter",target:"."+Tt,offsetY:(this.parent.enableRtl,-10),locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,width:220,cssClass:this.parent.cssClass});m.isAngular=this.parent.isModalDialog,m.appendTo(c),h.appendChild(c)}else e.appendChild(u)}var f=(0,t.createElement)("div",{className:dt+"-outer-div"});h.appendChild(f);var v,S=(0,t.createElement)("div",{id:this.parentID+"tree",className:dt});if(f.appendChild(S),"olap"!==this.parent.dataType||this.parent.isAdaptive?e.appendChild(h):i.appendChild(h),!this.parent.isAdaptive)(v=(0,t.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?a.appendChild(v):e.appendChild(v);var y=(0,t.createElement)("textarea",{id:this.parentID+"droppable",className:lt+" 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")}});if("olap"!==this.parent.dataType||this.parent.isAdaptive?e.appendChild(y):a.appendChild(y),this.parent.isAdaptive){n=(0,t.createElement)("div",{id:this.parentID+"buttonDiv",className:ct});(N=(0,t.createElement)("button",{id:this.parentID+"okBtn",className:ut,attrs:{type:"button"}})).innerText=this.parent.localeObj.getConstant("apply"),n.appendChild(N),e.appendChild(n)}if("olap"===this.parent.dataType){if(!this.parent.isAdaptive){var b=(0,t.createElement)("div",{className:"e-olap-member-title"});b.innerText=this.parent.localeObj.getConstant("memberType"),a.appendChild(b)}var C=(0,t.createElement)("div",{id:this.parentID+"Member_Type_Div",className:nt});if(this.parent.isAdaptive)e.appendChild(C);else{a.appendChild(C);var x=(0,t.createElement)("div",{className:"e-olap-hierarchy-title"});x.innerText=this.parent.localeObj.getConstant("selectedHierarchy"),a.appendChild(x)}var w=(0,t.createElement)("div",{id:this.parentID+"Hierarchy_List_Div",className:at});this.parent.isAdaptive?e.appendChild(w):a.appendChild(w)}if(!this.parent.isAdaptive){var T=(0,t.createElement)("div",{className:"e-pivot-format-title"});T.innerText=this.parent.localeObj.getConstant("formatString"),a.appendChild(T)}var M=(0,t.createElement)("div",{id:this.parentID+"Format_Div",className:rt});this.parent.isAdaptive?e.appendChild(M):a.appendChild(M);var D=(0,t.createElement)("div",{id:this.parentID+"custom_Format_Div",className:"e-pivot-calc-custom-format-div"}),O=(0,t.createElement)("input",{id:this.parentID+"Custom_Format_Element",attrs:{type:"text"},className:it});if(D.appendChild(O),a.appendChild(D),this.parent.isAdaptive?e.appendChild(D):a.appendChild(D),"pivotfieldlist"===this.parent.getModuleName()&&null===this.parent.dialogRenderer.parentElement.querySelector("."+lt)&&this.parent.isAdaptive){var N=e.querySelector("."+ut);e.appendChild(N)}else"olap"===this.parent.dataType&&e.appendChild(i),e.appendChild(a)}return e},e.prototype.renderAdaptiveLayout=function(e){var i=this.parent.dialogRenderer.adaptiveElement;if(e){if((0,t.select)("#"+this.parentID+"droppable",i.element)){var a=(0,t.getInstance)((0,t.select)("#"+this.parentID+"ddlelement",document),zs.MaskedTextBox);this.formulaText=(0,t.select)("#"+this.parentID+"droppable",document).value,this.fieldText=a.value}if(i.element.querySelector("."+nt)){var r=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Member_Type_Div",i.element),Ws.DropDownList);this.fieldType=r.value}if(i.element.querySelector("."+at)){var n=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Hierarchy_List_Div",i.element),Ws.DropDownList);this.parentHierarchy="Dimension"===this.fieldType?n.value:null}if(i.element.querySelector("."+rt)){var s=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Format_Div",i.element),Ws.DropDownList);this.formatType=s.value}if(i.element.querySelector("."+it)){var o=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Custom_Format_Element",i.element),zs.MaskedTextBox);this.formatText="Custom"===("olap"===this.parent.dataType?this.formatType:this.getFormat(this.formatType))?o.value:null}}else this.currentFieldName=this.formulaText=this.fieldText=this.formatText=null,this.fieldType=this.formatType=this.parentHierarchy=null;this.renderMobileLayout(i)},e.prototype.updateAdaptiveCalculatedField=function(e,i){var a=this.parent.dialogRenderer.adaptiveElement.element;this.isEdit=e;var r=e?"pivot"===this.parent.dataType?this.parent.engineModule.fieldList[i]:this.parent.olapEngineModule.fieldList[i]:{id:null,caption:null,formula:null,fieldType:"Measure",formatString:"pivot"===this.parent.dataType?null:"Standard",parentHierarchy:null};this.currentFieldName=r.id;var n=(0,t.getInstance)((0,t.select)("#"+this.parentID+"ddlelement",document),zs.MaskedTextBox);if((0,t.select)("#"+this.parentID+"droppable",document)&&(this.formulaText=(0,t.select)("#"+this.parentID+"droppable",document).value=r.formula,this.fieldText=n.value=r.caption,n.dataBind()),a.querySelector("."+nt)){var s=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Member_Type_Div",a),Ws.DropDownList);this.fieldType=s.value=r.fieldType,s.readonly=!!e,s.dataBind()}if(a.querySelector("."+at)){var o=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Hierarchy_List_Div",a),Ws.DropDownList);"Dimension"===this.fieldType?this.parentHierarchy=o.value=r.parentHierarchy:(this.parentHierarchy=null,o.index=0),o.dataBind()}if(a.querySelector("."+rt)){var l=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Format_Div",a),Ws.DropDownList);this.formatType=l.value=this.formatTypes.indexOf(r.formatString)>-1?r.formatString:"Custom"}if(a.querySelector("."+it)){var d=(0,t.getInstance)((0,t.select)("#"+this.parentID+"Custom_Format_Element",a),zs.MaskedTextBox),p=Hs.getFieldByName(i,this.parent.dataSourceSettings.formatSettings);"pivot"===this.parent.dataType?this.formatText=d.value=p?p.format:null:this.formatText=d.value="Custom"===this.formatType?r.formatString:null,d.dataBind()}},e.prototype.createDropElements=function(){for(var e=this,i=(0,t.select)("#"+this.parentID+"calculateddialog",document)?(0,t.getInstance)((0,t.select)("#"+this.parentID+"calculateddialog",document),Bs.Dialog):null,a=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:i.element,r=[],n=[],s=0,o=this.formatTypes;s<o.length;s++){var l=o[s];r.push({value:"pivot"===this.parent.dataType?this.getFormat(l):l,text:this.parent.localeObj.getConstant(l)})}if("olap"===this.parent.dataType){for(var d=[],p=0,h=["Measure","Dimension"];p<h.length;p++){var u=h[p];d.push({value:u,text:this.parent.localeObj.getConstant(u)})}for(var c=0,g=Hs.getClonedData(this.parent.olapEngineModule.fieldListData);c<g.length;c++){var m=g[c];m.spriteCssClass&&(m.spriteCssClass.indexOf("e-attributeCDB-icon")>-1||m.spriteCssClass.indexOf("e-hierarchyCDB-icon")>-1)&&n.push({value:m.id,text:m.caption})}var f=new Ws.DropDownList({dataSource:d,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:null!==this.fieldType?this.fieldType:d[0].value,readonly:this.isEdit,cssClass:st+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(i){v.enabled="Dimension"===i.value,e.fieldType=i.value,e.formulaText=(0,t.select)("#"+e.parentID+"droppable",document).value,v.dataBind()}});f.isStringTemplate=!0,f.isAngular=this.parent.isModalDialog,f.appendTo((0,t.select)("#"+this.parentID+"Member_Type_Div",a));var v=new Ws.DropDownList({dataSource:n,enableRtl:this.parent.enableRtl,locale:this.parent.locale,allowFiltering:!0,enabled:"Dimension"===f.value,filterBarPlaceholder:this.parent.localeObj.getConstant("example")+" "+n[0].text.toString(),fields:{value:"value",text:"text"},value:null!==this.parentHierarchy&&"Dimension"===f.value?this.parentHierarchy:n[0].value,cssClass:st+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(i){e.parentHierarchy=i.value,e.formulaText=(0,t.select)("#"+e.parentID+"droppable",document).value}});v.isStringTemplate=!0,v.isAngular=this.parent.isModalDialog,v.appendTo((0,t.select)("#"+this.parentID+"Hierarchy_List_Div",a))}var S=new Ws.DropDownList({dataSource:r,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?r[0].value:r[4].value,cssClass:st+(this.parent.cssClass?" "+this.parent.cssClass:""),width:"100%",change:function(i){y.enabled="Custom"===i.value,e.formatType=i.value,e.formulaText=(0,t.select)("#"+e.parentID+"droppable",document).value,y.dataBind()}});S.isStringTemplate=!0,S.isAngular=this.parent.isModalDialog,S.appendTo((0,t.select)("#"+this.parentID+"Format_Div",a));var y=new zs.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("customFormat"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,value:null!==this.formatText&&"Custom"===S.value?this.formatText:null,enabled:"Custom"===S.value,change:function(i){e.formatText=i.value,e.formulaText=(0,t.select)("#"+e.parentID+"droppable",document).value},cssClass:this.parent.cssClass});y.isStringTemplate=!0,y.appendTo((0,t.select)("#"+this.parentID+"Custom_Format_Element",a))},e.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},e.prototype.createTreeView=function(){var e=this,i=(0,t.select)("#"+this.parentID+"calculateddialog",document)?(0,t.getInstance)((0,t.select)("#"+this.parentID+"calculateddialog",document),Bs.Dialog):null,a=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:i.element;"olap"===this.parent.dataType?this.treeObj=new Gs.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(lt)?((0,t.removeClass)([e.clonedNode],fe),(0,t.addClass)([e.event.target],"e-copy-drop")):((0,t.addClass)([e.clonedNode],fe),(0,t.removeClass)([e.event.target],"e-copy-drop"),e.dropIndicator="e-no-drop",(0,t.addClass)([e.clonedNode.querySelector("."+o)],"e-icon-expandable"),(0,t.removeClass)([e.clonedNode.querySelector("."+o)],"e-list-icon"))},nodeClicked:this.fieldClickHandler.bind(this),nodeSelected:function(i){i.node.getAttribute("data-type")===gd?e.displayMenu(i.node):((0,t.removeClass)([i.node],"e-active"),i.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 Gs.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.isAngular=this.parent.isModalDialog,this.treeObj.appendTo((0,t.select)("#"+this.parentID+"tree",a))},e.prototype.updateNodeIcon=function(e){if(e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-icon-expandable.e-process")&&e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-icon")>-1){var i=e.node.querySelector(".e-list-icon");(0,t.removeClass)([i],"e-folderCDB-icon"),(0,t.addClass)([i],"e-folderCDB-open-icon")}else if(e.node&&e.node.querySelector(".e-list-icon")&&e.node.querySelector(".e-icon-expandable")&&e.node.querySelector(".e-list-icon").className.indexOf("e-folderCDB-open-icon")>-1){i=e.node.querySelector(".e-list-icon");(0,t.removeClass)([i],"e-folderCDB-open-icon"),(0,t.addClass)([i],"e-folderCDB-icon")}else{for(var a=this.treeObj.fields.dataSource,r=[],n=0,s=a;n<s.length;n++){var o=s[n];o.pid===e.nodeData.id.toString()&&r.push(o)}if(0!==r.length)return;this.parent.olapEngineModule.calcChildMembers=[],this.parent.olapEngineModule.getCalcChildMembers(this.parent.dataSourceSettings,e.nodeData.id.toString()),r=this.parent.olapEngineModule.calcChildMembers,this.parent.olapEngineModule.calcChildMembers=[];for(var l=0,d=r;l<d.length;l++){(i=d[l]).pid=e.nodeData.id.toString(),i.hasChildren=!1,i.spriteCssClass="e-level-members",i.caption=""===i.caption?this.parent.localeObj.getConstant("blank"):i.caption,a.push(i)}this.treeObj.addNodes(r,e.node)}},e.prototype.nodeCollapsing=function(e){e.cancel=!0},e.prototype.dragStart=function(e){var i=!1,a=e.clonedNode;if(a&&("olap"===this.parent.dataType&&(a.querySelector(".e-calc-dimension-icon,.e-calc-measure-icon,.e-measure-icon")||a.querySelector(".e-attributeCDB-icon,.e-hierarchyCDB-icon")||a.querySelector(".e-level-members,.e-namedSetCDB-icon"))||"pivot"===this.parent.dataType&&e.event.target.classList.contains(G))&&(i=!0),i){(0,t.addClass)([e.draggedNode.querySelector("."+De)],ve),(0,t.addClass)([a],"e-pivot-calc");var r=(0,t.getInstance)((0,t.select)("#"+this.parentID+"calculateddialog",document),Bs.Dialog);a.style.zIndex=(r.zIndex+1).toString(),a.style.display="inline"}else e.cancel=!0},e.prototype.drawTreeNode=function(e){if("olap"===this.parent.dataType){e.node.querySelector(".e-measure-icon")&&(e.node.querySelector(".e-list-icon").style.display="none");var i=e.nodeData;e.node.setAttribute("data-field",i.id),e.node.setAttribute("data-caption",i.caption);var a=e.node.querySelector("."+ye);if(e.nodeData&&e.nodeData.type===gd&&a&&e.node.querySelector(".e-list-icon.e-calc-member")){e.node.setAttribute("data-type",i.type),e.node.setAttribute("data-membertype",i.fieldType),e.node.setAttribute("data-hierarchy",i.parentHierarchy?i.parentHierarchy:""),e.node.setAttribute("data-formula",i.formula);var r=i.formatString?this.formatTypes.indexOf(i.formatString)>-1?i.formatString:"Custom":"None";e.node.setAttribute("data-formatString",r),e.node.setAttribute("data-customformatstring","Custom"===r?i.formatString:"");var n=(0,t.createElement)("span",{className:Jt+" e-icons e-list-icon"});if(a.classList.add("e-calcfieldmember"),this.parent.isAdaptive){var s=(0,t.createElement)("span",{className:"e-list-edit-icon"+(this.isEdit&&this.currentFieldName===i.id?" e-edited ":" e-edit ")+o}),l=(0,t.createElement)("div",{className:"e-list-header-icon"});l.appendChild(s),l.appendChild(n),a.appendChild(l)}else a.appendChild(n)}if(this.parent.isAdaptive){var d=e.node.querySelector("."+ye);if(e.node&&e.node.querySelector(".e-list-icon")&&d){var p=e.node.querySelector(".e-list-icon");d.insertBefore(p,e.node.querySelector(".e-list-text"))}e.node&&e.node.querySelector(".e-calcMemberGroupCDB,.e-measureGroupCDB-icon,.e-folderCDB-icon")&&(e.node.querySelector("."+Ht).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"))&&(0,t.addClass)([e.node],b)}else{i=e.nodeData.field;e.node.setAttribute("data-field",i),e.node.setAttribute("data-caption",e.nodeData.caption),e.node.setAttribute("data-type",e.nodeData.type);var h=Hs.getFieldByName(i,this.parent.dataSourceSettings.formatSettings);if(e.node.setAttribute("data-formatString",h?h.format:""),h){var u=this.getFormat(h.format);r=u?this.formatTypes.indexOf(u)>-1?h.format:"Custom":"None";e.node.setAttribute("data-customformatstring","Custom"===r?u:""),e.node.setAttribute("data-formatString",h?r:"")}var c=(0,t.createElement)("span",{attrs:{tabindex:"-1","aria-disabled":"false",title:this.parent.localeObj.getConstant("dragField")},className:o+" e-drag"}),g=(0,t.createElement)("div",{className:" e-iconspace"});(0,t.prepend)([c],e.node.querySelector("."+ye)),(0,t.append)([g,e.node.querySelector("."+ot)],e.node.querySelector("."+ye)),this.getMenuItems(this.parent.engineModule.fieldList[i].type).length<=0?(0,t.removeClass)([e.node.querySelector("."+ot)],o):e.node.querySelector("."+ot).setAttribute("title",this.parent.localeObj.getConstant("format")),this.parent.engineModule.fieldList[i].aggregateType===gd&&(e.node.querySelector("."+ot).setAttribute("title",this.parent.localeObj.getConstant("remove")),(0,t.addClass)([e.node.querySelector("."+ot)],Jt),(0,t.addClass)([e.node.querySelector(".e-iconspace")],[xt,o,"e-list-icon"]),e.node.querySelector("."+xt).setAttribute("title",this.parent.localeObj.getConstant("edit")),e.node.querySelector("."+xt).setAttribute("aria-disabled","false"),e.node.querySelector("."+xt).setAttribute("tabindex","-1"),(0,t.removeClass)([e.node.querySelector("."+ot)],ot),(0,t.removeClass)([e.node.querySelector(".e-iconspace")],"e-iconspace"))}},e.prototype.createTypeContainer=function(e){for(var i=(0,t.createElement)("div",{id:this.parentID+"control_container",className:pt}),a=this.getMenuItems(this.parent.engineModule.fieldList[e].type),r=0;r<a.length;r++){var n=(0,t.createElement)("input",{id:this.parentID+"radio"+e+a[r],attrs:{type:"radio","data-ftxt":e,"data-value":a[r]},className:"e-pivot-calc-radio"});i.appendChild(n)}return i},e.prototype.getMenuItems=function(e,i){for(var a=(0,t.isNullOrUndefined)(i)?this.parent.aggregateTypes:i,r=[],n=this.getValidSummaryType(),s=0;s<a.length;s++)n.indexOf(a[s])>-1&&r.indexOf(a[s])<0&&((a[s]!==nd&&a[s]!==ld||"number"===e)&&"number"!==e||r.push(a[s]));return r},e.prototype.getValidSummaryType=function(){return[nd,ld,od,"Avg",sd,"Min","Max",dd,pd,hd,ud,cd]},e.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="+et+' 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===gd||this.getMenuItems(this.parent.engineModule.fieldList[n].type).length<1?"":this.createTypeContainer(n).outerHTML,iconCss:this.parent.engineModule.fieldList[n].aggregateType===gd?"e-list-icon "+(this.isEdit&&this.currentFieldName===n?"e-edited":"e-edit"):""})}return t},e.prototype.renderMobileLayout=function(e){var i=this;e.items[4].content=this.renderDialogElements().outerHTML,e.dataBind();var a=(0,t.select)("#"+this.parentID+"calculateddialog",document)?(0,t.getInstance)((0,t.select)("#"+this.parentID+"calculateddialog",document),Bs.Dialog):null,r=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:a.element;this.parent.isAdaptive&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+lt)&&this.createDropElements();var n=new io.Button({cssClass:this.parent.cssClass,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});if(n.isStringTemplate=!0,n.appendTo((0,t.select)("#"+this.parentID+"cancelBtn",r)),n.element&&(n.element.onclick=this.cancelBtnClick.bind(this)),null!==this.parent.dialogRenderer.parentElement.querySelector("."+lt)&&this.parent.isAdaptive){var s=new io.Button({cssClass:this.parent.cssClass,isPrimary:!0,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});s.isStringTemplate=!0,s.appendTo((0,t.select)("#"+this.parentID+"okBtn",r));var o=new zs.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("fieldName"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:function(e){i.fieldText=e.value,i.formulaText=(0,t.select)("#"+i.parentID+"droppable",document).value},cssClass:this.parent.cssClass});if(o.isStringTemplate=!0,o.appendTo((0,t.select)("#"+this.parentID+"ddlelement",r)),null!==this.formulaText&&null!==(0,t.select)("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement))(0,t.select)("#"+this.parentID+"droppable",this.parent.dialogRenderer.parentElement).value=this.formulaText;null!==this.fieldText&&null!==this.parent.dialogRenderer.parentElement.querySelector("."+tt)&&(this.parent.dialogRenderer.parentElement.querySelector("."+tt).value=this.fieldText,o.value=this.fieldText),s.element&&(s.element.onclick=this.applyFormula.bind(this))}else if(this.parent.isAdaptive){var l=new io.Button({cssClass:this.parent.cssClass,isPrimary:!0,locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});if(l.isStringTemplate=!0,l.appendTo((0,t.select)("#"+this.parentID+"addBtn",r)),"olap"===this.parent.dataType)this.treeObj=new Gs.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){(0,t.removeClass)([e.node],"e-active"),e.cancel=!0},cssClass:this.parent.cssClass}),this.treeObj.isStringTemplate=!0,this.treeObj.isAngular=this.parent.isModalDialog,this.treeObj.appendTo((0,t.select)("#"+this.parentID+"accordDiv",r));else{var d=new Gs.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)});d.isStringTemplate=!0,d.appendTo((0,t.select)("#"+this.parentID+"accordDiv",r)),this.updateType()}l.element&&(l.element.onclick=this.addBtnClick.bind(this))}},e.prototype.accordionExpand=function(e){if(0===e.element.querySelectorAll(".e-radio-wrapper").length)for(var i=Object.keys(this.parent.engineModule.fieldList),a=0,r=i.length;a<r;a++){var n=i[a],s="number"!==this.parent.engineModule.fieldList[n].type?[nd,ld]:[od,nd,"Avg",sd,"Min","Max",ld,dd,pd,hd,ud,cd],o=void 0;if(n===e.element.querySelector("[data-field").getAttribute("data-field"))for(var l=0;l<s.length;l++)(o=new io.RadioButton({label:this.parent.localeObj.getConstant(s[l]),name:"AggregateType"+n,checked:e.element.querySelector("[data-type").getAttribute("data-type")===s[l],change:this.onChange.bind(this),locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass})).isStringTemplate=!0,o.appendTo((0,t.select)("#"+this.parentID+"radio"+n+s[l],e.element))}},e.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"))},e.prototype.updateType=function(){for(var e=Object.keys(this.parent.engineModule.fieldList),i=(0,t.select)("#"+this.parentID+"calculateddialog",document)?(0,t.getInstance)((0,t.select)("#"+this.parentID+"calculateddialog",document),Bs.Dialog):null,a=this.parent.isAdaptive?this.parent.dialogRenderer.parentElement:i.element,r=0,n=e.length;r<n;r++){var s=e[r],o=null;o="number"===this.parent.engineModule.fieldList[s].type&&"include"!==this.parent.engineModule.fieldList[s].type&&"exclude"!==this.parent.engineModule.fieldList[s].type||"DistinctCount"===this.parent.engineModule.fieldList[s].aggregateType?void 0!==this.parent.engineModule.fieldList[s].aggregateType?this.parent.engineModule.fieldList[s].aggregateType:od:nd;var l=new io.CheckBox({label:this.parent.engineModule.fieldList[s].caption+" ("+this.parent.localeObj.getConstant(o)+")",locale:this.parent.locale,enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass});l.isStringTemplate=!0,l.appendTo((0,t.select)("#"+this.parentID+"_"+r,a)),(0,t.select)("#"+this.parentID+"_"+r,a).setAttribute("data-field",s),(0,t.select)("#"+this.parentID+"_"+r,a).setAttribute("data-type",o)}},e.prototype.cancelBtnClick=function(){this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)},e.prototype.addBtnClick=function(){var e="",t=null,i=null;if("pivot"===this.parent.dataType){for(var a=document.querySelectorAll(".e-accordion .e-check"),r=0;r<a.length;r++)if(t=a[r].parentElement.querySelector("[data-field]").getAttribute("data-field"),-1===(i=a[r].parentElement.querySelector("[data-field]").getAttribute("data-type")).indexOf(gd))e=e+'"'+i+"("+t+')"';else for(var n=0;n<this.parent.dataSourceSettings.calculatedFieldSettings.length;n++)if(this.parent.dataSourceSettings.calculatedFieldSettings[n].name===t){e+=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];e+=o.fieldList[p]&&o.fieldList[p].type===gd?o.fieldList[p].tag:p}this.formulaText=null!==this.formulaText?this.formulaText+e:e,this.renderMobileLayout(this.parent.dialogRenderer.adaptiveElement)},e.prototype.createCalculatedFieldDialog=function(e){if(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;else if(!this.parent.isAdaptive){if(this.isEdit=!(!e||void 0===e.edit)&&e.edit,this.renderDialogLayout(),e&&e.edit){var i=this.treeObj.element.querySelector('li[data-field="'+e.fieldName+'"]');if(i)if((0,t.addClass)([i],["e-active","e-node-focus"]),i.setAttribute("aria-selected","true"),i.id=this.treeObj.element.id+"_active","pivot"===this.parent.dataType){var a={event:{target:i.querySelector(".e-list-icon.e-edit.e-icons")}};this.fieldClickHandler(a)}else this.displayMenu(i)}var r=(0,t.getInstance)((0,t.select)("#"+this.parentID+"calculateddialog",document),Bs.Dialog);r.element.style.top=parseInt(r.element.style.top,10)<0?"0px":r.element.style.top}},e.prototype.renderDialogLayout=function(){this.newFields=(0,t.extend)([],this.parent.dataSourceSettings.calculatedFieldSettings,null,!0),this.createDialog();var e=(0,t.getInstance)((0,t.select)("#"+this.parentID+"calculateddialog",document),Bs.Dialog);e.content=this.renderDialogElements(),e.refresh();var i=new zs.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("fieldName"),locale:this.parent.locale,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass});i.isStringTemplate=!0,i.appendTo((0,t.select)("#"+this.parentID+"ddlelement",e.element)),this.createDropElements(),this.createTreeView(),this.droppable=new t.Droppable((0,t.select)("#"+this.parentID+"droppable",e.element)),this.keyboardEvents=new t.KeyboardEvents(e.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:{moveRight:"rightarrow",enter:"enter",shiftE:"shift+E",delete:"delete"},eventName:"keydown"})},e.prototype.createConfirmDialog=function(e,i,a,r,n){var s=(0,t.createElement)("div",{id:this.parentID+"_CalculatedFieldErrorDialog",className:re});this.parent.element.appendChild(s);var o=new Bs.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:r?this.removeCalcField.bind(this,n):this.replaceFormula.bind(this,a),isFlat:!1,buttonModel:{cssClass:ie+(this.parent.cssClass?" "+this.parent.cssClass:""),content:r?this.parent.localeObj.getConstant("yes"):this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:this.closeErrorDialog.bind(this),isFlat:!1,buttonModel:{cssClass:ae+(this.parent.cssClass?" "+this.parent.cssClass:""),content:r?this.parent.localeObj.getConstant("no"):this.parent.localeObj.getConstant("cancel")}}],header:e,content:i,isModal:!0,visible:!0,closeOnEscape:!0,target:Hs.getAppendToElement(this.parent.element,this.parent.isAngular),cssClass:this.parent.cssClass,close:this.removeErrorDialog.bind(this,n)});o.isStringTemplate=!0,o.isAngular=this.parent.isModalDialog,o.appendTo(s)},e.prototype.replaceFormula=function(e){var i=this.parent.dataSourceSettings;if("olap"===this.parent.dataType){for(var a=0;a<i.calculatedFieldSettings.length;a++)if(i.calculatedFieldSettings[a].name===e.name){(0,t.isNullOrUndefined)(e.hierarchyUniqueName)||(i.calculatedFieldSettings[a].hierarchyUniqueName=e.hierarchyUniqueName),i.calculatedFieldSettings[a].formatString=e.formatString,i.calculatedFieldSettings[a].formula=e.formula,this.parent.lastCalcFieldInfo=i.calculatedFieldSettings[a];break}}else for(var r=0;r<i.values.length;r++)if(i.values[r].type===gd&&i.values[r].name===e.name)for(a=0;a<i.calculatedFieldSettings.length;a++)i.calculatedFieldSettings[a].name===e.name&&(i.calculatedFieldSettings[a].formula=e.formula,this.parent.lastCalcFieldInfo=i.calculatedFieldSettings[a].properties?i.calculatedFieldSettings[a].properties:i.calculatedFieldSettings[a],this.updateFormatSettings(i,e.name,e.formatString));this.addFormula(i,e.name),this.removeErrorDialog()},e.prototype.removeErrorDialog=function(e){var i=(0,t.select)("#"+this.parentID+"_CalculatedFieldErrorDialog",document),a=i?(0,t.getInstance)(i,Bs.Dialog):null;a&&!a.isDestroyed&&a.destroy(),null!==(0,t.select)("#"+this.parentID+"_CalculatedFieldErrorDialog",document)&&(0,t.remove)((0,t.select)("#"+this.parentID+"_CalculatedFieldErrorDialog",document)),e&&(e.setAttribute("tabindex","0"),e.focus())},e.prototype.closeErrorDialog=function(){(0,t.getInstance)((0,t.select)("#"+this.parentID+"_CalculatedFieldErrorDialog",document),Bs.Dialog).close()},e.prototype.triggerActionCompleteEvent=function(){var e={dataSourceSettings:Hs.getClonedDataSourceSettings(this.parent.dataSourceSettings),actionName:ks,fieldInfo:this.parent.actionObj.fieldInfo,actionInfo:this.parent.actionObj.actionInfo},t=this.parent.isPopupView?this.parent.pivotGridModule:this.parent;t.trigger(lr,e),"Abort"!==e.actionName&&this.parent.pivotCommon&&this.parent.pivotCommon.errorDialog?this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("invalidFormula")):(this.parent&&this.parent.actionObj&&(this.parent.actionObj.actionName=e.actionName),this.closeDialog()),this.parent&&this.parent.actionObj&&(this.parent.actionObj.actionName=""),t&&t.actionObj&&(t.actionObj.actionName="")},e.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(br,this.createCalculatedFieldDialog,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(br,this.createCalculatedFieldDialog)},e.prototype.destroy=function(){var e=(0,t.select)("#"+this.parentID+"_CalculatedFieldErrorDialog",document);if(e){var i=(0,t.getInstance)(e,Bs.Dialog);i&&!i.isDestroyed&&i.destroy(),(0,t.remove)(e)}var a=(0,t.select)("#"+this.parentID+"CalcContextmenu",document);if(a){var r=(0,t.getInstance)(a,Gs.ContextMenu);r&&!r.isDestroyed&&r.destroy(),(0,t.remove)(a)}this.treeObj&&!this.treeObj.isDestroyed&&(this.treeObj.destroy(),this.treeObj=null),this.droppable&&(this.droppable=null),this.keyboardEvents&&(this.keyboardEvents.destroy(),this.keyboardEvents=null);var n=(0,t.select)("#"+this.parentID+"ddlelement",document);if(n){var s=(0,t.getInstance)(n,zs.MaskedTextBox);s&&!s.isDestroyed&&s.destroy()}var o=(0,t.select)("#"+this.parentID+"Custom_Format_Element",document);if(o){var l=(0,t.getInstance)(o,zs.MaskedTextBox);l&&!l.isDestroyed&&l.destroy()}this.destroyDropdowns(),this.destroyAdaptiveComponents();var d=(0,t.select)("#"+this.parentID+"calculateddialog",document);if(d){var p=(0,t.getInstance)(d,Bs.Dialog);p&&!p.isDestroyed&&p.destroy(),(0,t.remove)(d)}var h=(0,t.select)("#"+this.parentID+"accordDiv",document);if(h){var u=(0,t.getInstance)(h,Gs.Accordion);u&&!u.isDestroyed&&u.destroy()}this.newFields=null,this.curMenu=null,this.existingReport=null,this.formulaText=null,this.fieldText=null,this.formatText=null,this.formatType=null,this.fieldType=null,this.parentHierarchy=null,this.currentFieldName=null},e.prototype.destroyDropdowns=function(){var e=(0,t.select)("#"+this.parentID+"Format_Div",document);if(e){var i=(0,t.getInstance)(e,Ws.DropDownList);i&&!i.isDestroyed&&i.destroy()}var a=(0,t.select)("#"+this.parentID+"Member_Type_Div",document);if(a){var r=(0,t.getInstance)(a,Ws.DropDownList);r&&!r.isDestroyed&&r.destroy()}var n=(0,t.select)("#"+this.parentID+"Hierarchy_List_Div",document);if(n){var s=(0,t.getInstance)(n,Ws.DropDownList);s&&!s.isDestroyed&&s.destroy()}},e.prototype.destroyAdaptiveComponents=function(){if(this.parent.isAdaptive){["#"+this.parentID+"addBtn","#"+this.parentID+"cancelBtn","#"+this.parentID+"okBtn"].forEach(function(e){var i=(0,t.select)(e,document);if(i){var a=(0,t.getInstance)(i,io.Button);a&&!a.isDestroyed&&a.destroy()}});var e=document.getElementById(this.parent.element.id+"_PivotFieldList_Container");if(e){if("pivot"===this.parent.dataType)e.querySelectorAll(".e-radio-wrapper").forEach(function(e){var i=(0,t.getInstance)(e,io.RadioButton);i&&!i.isDestroyed&&i.destroy()});e.querySelectorAll("."+et).forEach(function(e){var i=(0,t.getInstance)(e,io.CheckBox);i&&!i.isDestroyed&&i.destroy()})}}},e}();rd.Inject(md);var fd=function(){function e(e){(0,t.initializeTelemetryFeature)("FieldList","PivotTable"),this.parent=e,this.parent.fieldListModule=this,this.addEventListener()}return e.prototype.getModuleName=function(){return"fieldList"},e.prototype.initiateModule=function(){if(!(0,t.select)("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)){if(this.element=(0,t.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===(0,t.select)("#"+this.parent.element.id+"containerwrapper",document)){var e=(0,t.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)}else(0,t.select)("#"+this.parent.element.id+"containerwrapper",document).appendChild(this.element);this.parent.pivotFieldListModule=new rd({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),beforeServiceInvoke:this.parent.bindTriggerEvents.bind(this.parent),afterServiceInvoke: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.isAngular=this.parent.isModalDialog,this.parent.pivotFieldListModule.appendTo(this.element)}},e.prototype.updateControl=function(){if(this.parent.allowDeferLayoutUpdate&&!this.parent.actionObj.actionName&&(this.parent.actionObj.actionName=js),this.element){for(var e=void 0,i=0;i<this.parent.toolbar.length;i++)"FieldList"===this.parent.toolbar[i]&&(e=!0);e&&this.parent.showToolbar&&"Server"===this.parent.dataSourceSettings.mode?this.element.style.display="none":this.element.style.display="block",(0,t.prepend)([this.element],this.parent.element),this.parent.showGroupingBar&&this.parent.groupingBarModule?(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.update.bind(this))):(0,t.isNullOrUndefined)(this.element.querySelector("."+f))||((0,t.setStyleAttribute)(this.element.querySelector("."+f),{left:"auto"}),this.parent.enableRtl?(0,t.removeClass)([this.element.querySelector("."+f)],"e-fieldlist-left"):(0,t.addClass)([this.element.querySelector("."+f)],"e-fieldlist-left")),(0,t.setStyleAttribute)(this.element,{width:(0,t.formatUnit)(this.parent.element.offsetWidth)})}this.parent.pivotFieldListModule.update(this.parent)},e.prototype.update=function(){var e;"Table"!==this.parent.currentView&&this.parent.chart?e=this.parent.pivotChartModule.getCalulatedWidth():this.parent.grid&&(e=this.parent.grid.element.offsetWidth);var i=this.element.querySelector("."+f);if(e&&!(0,t.isNullOrUndefined)(i)){if(!i)return;var a=e<400?this.parent.minWidth||400:e;(0,t.setStyleAttribute)(this.element.querySelector("."+f),{left:(0,t.formatUnit)(this.parent.enableRtl?-Math.abs(a-this.element.querySelector("."+f).offsetWidth):a-this.element.querySelector("."+f).offsetWidth)}),this.parent.enableRtl?(0,t.addClass)([this.element.querySelector("."+f)],"e-fieldlist-left"):(0,t.removeClass)([this.element.querySelector("."+f)],"e-fieldlist-left")}},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(vr,this.initiateModule,this),this.parent.on(hr,this.updateControl,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(vr,this.initiateModule),this.parent.off(hr,this.updateControl))},e.prototype.destroy=function(){this.timeOutObj&&(clearTimeout(this.timeOutObj),this.timeOutObj=null),this.removeEventListener(),this.element=null,this.parent.pivotFieldListModule&&!this.parent.pivotFieldListModule.isDestroyed&&(this.parent.pivotFieldListModule.destroy(),this.parent.pivotFieldListModule=null,(0,t.isNullOrUndefined)((0,t.select)("#"+this.parent.element.id+"_PivotFieldList",document))||(0,t.remove)((0,t.select)("#"+this.parent.element.id+"_PivotFieldList",document)))},e}(),vd=function(){function e(e){this.tempElements=[],this.parent=e}return e.prototype.render=function(){(!this.parent.pivotButtonModule||this.parent.pivotButtonModule&&this.parent.pivotButtonModule.isDestroyed)&&new $l(this.parent),this.parent.pivotButtonModule.cleanupButtonElements(),this.createPivotButtons();for(var e=[],i=(e=e.concat([].slice.call(this.parent.groupingBarModule.rowPanel.querySelectorAll("."+L)))).length,a=0;a<i;a++){if(!this.parent.isTabular||this.parent.isTabular&&0===this.parent.engineModule.rowMaxLevel){var r=(0,t.createElement)("span",{className:"e-indent-div",styles:"width:"+24*a+"px"});this.tempElements.push(r),(0,t.prepend)([r],e[a])}}},e.prototype.createPivotButtons=function(){var e=[this.parent.dataSourceSettings.rows,this.parent.dataSourceSettings.columns,this.parent.dataSourceSettings.values,this.parent.dataSourceSettings.filters],a=Array.prototype.slice.call(this.parent.element.querySelectorAll("."+he+",."+ue+",."+ce+",."+ge+",."+me));(0,t.isNullOrUndefined)(this.parent.element.querySelector("."+gi))&&a.push(this.parent.groupingBarModule.rowPanel);for(var r=0;r<a.length;r++){var n=a[r];this.parent.dataSourceSettings.values.length>0&&n.classList.contains(ni)&&this.parent.dataSourceSettings.columns.length>0&&n.classList.contains(ri)||(n.innerHTML="")}if("pivot"===this.parent.dataType&&this.parent.dataSourceSettings.dataSource&&(!(this.parent.dataSourceSettings.dataSource instanceof i.DataManager)&&this.parent.dataSourceSettings.dataSource.length>0||this.parent.dataSourceSettings.dataSource instanceof i.DataManager&&this.parent.engineModule.data&&this.parent.engineModule.data.length>0)||"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 s=["rows","columns","values","filters"];if("pivot"===this.parent.dataType&&this.parent.groupingBarSettings.showFieldsPanel){s.push("all-fields"),e.push([]);for(var o=0,l=this.parent.engineModule&&this.parent.engineModule.fieldList?Object.keys(this.parent.engineModule.fieldList):[];o<l.length;o++){var d=l[o];this.parent.engineModule.fieldList[d]&&!this.parent.engineModule.fieldList[d].isSelected&&e[e.length-1].push(Hs.getFieldInfo(d,this.parent,!0).fieldItem)}}r=0;for(var p=e.length;r<p;r++)if(e[r]){var h={field:e[r],axis:s[r].toString()};this.parent.notify(yr,h)}}},e.prototype.destroy=function(){for(var e=0;e<this.tempElements.length;e++){var t=this.tempElements[e];t&&t.parentNode&&t.parentNode.removeChild(t)}this.tempElements=[]},e}(),Sd=function(){function e(e){this.rowAxisWidth=0,this.isDestroyed=!1,(0,t.initializeTelemetryFeature)("GroupingBar","PivotTable"),this.parent=e,this.parent.groupingBarModule=this,this.resColWidth=this.parent.resizedValue?this.parent.resizedValue:this.parent.isTabular?150:this.parent.isAdaptive?180:249,this.addEventListener(),this.parent.axisFieldModule=new vd(this.parent),this.touchObj=new t.Touch(this.parent.element,{tapHold:this.tapHoldHandler.bind(this)})}return e.prototype.getModuleName=function(){return"groupingBar"},e.prototype.renderLayout=function(){this.groupingTable=(0,t.createElement)("div",{className:pe});var e=(0,t.createElement)("div",{className:N});this.rightAxisPanel=(0,t.createElement)("div",{className:P});var i=(0,t.createElement)("div",{className:"e-axis-row "+gt+"container"}),a=(0,t.createElement)("div",{className:"e-axis-column "+gt+"container"}),r=(0,t.createElement)("div",{className:"e-axis-value "+gt+"container"}),n=(0,t.createElement)("div",{className:mt+" "+gt+"container"});this.rowPanel=(0,t.createElement)("div",{className:ue+" "+se+(this.parent.isTabular?" e-tabular-group-rows":"")});var s=(0,t.createElement)("div",{className:ce+" "+oe}),o=(0,t.createElement)("div",{className:ge+" "+le}),l=(0,t.createElement)("div",{className:me+" "+de});i.appendChild(this.rowPanel),a.appendChild(s),r.appendChild(o),n.appendChild(l),this.rowAxisPanel=i,e.appendChild(r),e.appendChild(i),this.rightAxisPanel.appendChild(n),this.rightAxisPanel.appendChild(a),this.groupingTable.appendChild((0,t.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(hi),this.groupingTable.querySelector("."+ue).classList.add(gi);for(var d=0,p=[this.rowPanel,s,o,l];d<p.length;d++){var h=p[d];this.parent.groupingBarSettings.allowDragAndDrop&&new t.Droppable(h,{}),this.unWireEvent(h),this.wireEvent(h)}"Table"!==this.parent.displayOption.view&&"Table"!==this.parent.groupingBarSettings.displayMode?(this.groupingChartTable=this.groupingTable.cloneNode(!0),(0,t.select)("#"+this.parent.element.id+"_AllFields",this.groupingChartTable)&&((0,t.select)("#"+this.parent.element.id+"_AllFields",this.groupingChartTable).remove(),this.chartPanel=this.createToolbarUI(this.groupingChartTable)),this.groupingChartTable.classList.add(li),this.groupingChartTable.classList.remove(hi),this.groupingChartTable.querySelector("."+ue).classList.add(ai),this.groupingChartTable.querySelector("."+ue).classList.remove(gi),this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.chartSeries&&["Pie","Pyramid","Doughnut","Funnel"].indexOf(this.parent.chartSettings.chartSeries.type)<0?this.groupingChartTable.querySelector("."+ge).classList.add("e-group-chart-multi-values"):this.groupingChartTable.querySelector("."+ge).classList.add(ni),this.parent.chartSettings.chartSeries&&["Pie","Pyramid","Doughnut","Funnel"].indexOf(this.parent.chartSettings.chartSeries.type)>-1?this.groupingChartTable.querySelector("."+ce).classList.add(ri):this.groupingChartTable.querySelector("."+ce).classList.add("e-group-chart-accumulation-column"),this.groupingChartTable.querySelector("."+me).classList.add("e-group-chart-filters")):this.groupingChartTable=void 0,"Chart"!==this.parent.displayOption.view&&"Chart"!==this.parent.groupingBarSettings.displayMode||(this.groupingTable=void 0)},e.prototype.appendToElement=function(){this.resColWidth=this.parent.resizedValue?this.parent.resizedValue:this.resColWidth;var e=this.groupingTable?this.groupingTable:this.groupingChartTable;if(!(0,t.isNullOrUndefined)(e)){var i=e.getElementsByClassName(N)[0],a=e.getElementsByClassName(me+" "+de)[0],r=e.getElementsByClassName(ce+" "+oe)[0],n=e.getElementsByClassName(ge+" "+le)[0];if((this.parent.element.querySelector("."+ft)||this.parent.element.querySelector("."+ii))&&this.parent.showGroupingBar){if(this.parent.element.querySelector("."+pe))for(var s=this.parent.element.querySelectorAll("."+pe),o=0;o<s.length;o++){var l=s[o];(0,t.remove)(l)}if(this.groupingChartTable)if((0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element)){(0,t.setStyleAttribute)(this.groupingChartTable,{width:(0,t.formatUnit)(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())});var d=this.groupingChartTable.getElementsByClassName(N)[0],p=this.groupingChartTable.getElementsByClassName(ge+" "+le)[0];if(this.parent.isAdaptive&&(d.style.minWidth="100px",p.style.minWidth="100px"),this.parent.element.insertBefore(this.groupingChartTable,(0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element)),this.groupingChartTable.querySelector("."+E)&&null!=this.chartPanel&&!this.chartPanel.isDestroyed){var h=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2;this.chartPanel.width=this.parent.isAdaptive?h:h<400?this.parent.minWidth||"398px":h,this.chartPanel.refreshOverflow(),this.parent.showFieldList&&this.parent.pivotFieldListModule&&this.parent.pivotFieldListModule.element&&(clearTimeout(this.timeOutObj),this.timeOutObj=setTimeout(this.alignIcon.bind(this)))}}else this.groupingChartTable=void 0;if("Chart"!==this.parent.displayOption.view&&this.groupingTable){this.parent.isAdaptive&&(i.style.minWidth="100px",n.style.minWidth="100px"),this.parent.firstColWidth&&(i.style.minWidth="auto",n.style.minWidth="auto"),a.removeAttribute("style"),r.removeAttribute("style"),this.rowPanel.removeAttribute("style");var u=void 0;if(u="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,!(0,t.isNullOrUndefined)(u)){var c=this.parent.element.querySelector("."+Vt).querySelector(".e-columnheader");c.removeAttribute("style"),(0,t.addClass)([c.querySelector("."+ze)],"e-group-row"),c.querySelector(".e-group-row").querySelector(".e-headercelldiv").style.display="none",c.querySelector(".e-group-row").querySelector(".e-sortfilterdiv").style.display="none"}if(this.parent.element.insertBefore(this.groupingTable,this.parent.element.querySelector("."+ft)),(0,t.setStyleAttribute)(this.groupingTable,{width:(0,t.formatUnit)(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingTable&&this.groupingTable.querySelector("."+E)&&null!=this.gridPanel&&!this.gridPanel.isDestroyed){var g=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2;this.gridPanel.width=this.parent.isAdaptive?g:g<400?this.parent.minWidth||"398px":g,this.gridPanel.refreshOverflow()}this.groupingTable.style.minWidth=this.parent.minWidth?this.parent.minWidth+"px":"400px",this.rowPanel.style.width=this.resColWidth+"px",this.rowPanel.style.overflow="hidden",this.rowPanel.style.display="block",n.style.width=this.resColWidth+"px",n.style.overflow="hidden",n.style.display="block",this.parent.axisFieldModule.render(),n.querySelectorAll(".e-pvt-btn-div").forEach(function(e){e.style.width=n.offsetWidth<250?"100%":"auto"}),this.setGridRowWidth();var m=this.parent.element.querySelector("."+Vt).querySelector("colgroup").children,f=0,v=this.parent.isTabular&&this.parent.engineModule.rowMaxLevel>0?this.parent.engineModule.rowMaxLevel+1:1;for(o=0;o<v;o++){var S=m[o];(0,t.isNullOrUndefined)(S)||(this.parent&&this.parent.gridSettings&&!this.parent.gridSettings.allowAutoResizing&&!(0,t.isNullOrUndefined)(S.offsetWidth)?f+=S.offsetWidth:(0,t.isNullOrUndefined)(S.style)||(0,t.isNullOrUndefined)(S.style.width)||(f+=parseInt(S.style.width,10)))}var y=f,b=(0,t.formatUnit)(this.groupingTable.offsetWidth-y);(0,t.setStyleAttribute)(n,{width:y+"px"}),(0,t.setStyleAttribute)(this.rightAxisPanel,{width:b}),this.groupingTable.style.display="";var C=n.offsetHeight/2;C>r.offsetHeight&&((0,t.setStyleAttribute)(a,{height:(0,t.formatUnit)(C)}),(0,t.setStyleAttribute)(r,{height:(0,t.formatUnit)(C+2)}));var x=this.parent.element.querySelector("."+Vt).offsetHeight;(0,t.setStyleAttribute)(this.rowPanel,{height:x+"px"}),this.parent.element.querySelector("."+Vt).querySelector(".e-rhandler")&&(this.parent.element.querySelector("."+Vt).querySelector(".e-rhandler").style.height=x+"px");for(var w=[].slice.call(this.parent.element.querySelector("."+Vt).querySelector("thead").querySelectorAll("tr")).filter(function(e){return e.childNodes.length>0}),T=x/w.length,M=0,D=w;M<D.length;M++){var O=D[M];(0,t.setStyleAttribute)(O,{height:T+"px"});for(var P=0,I=[].slice.call(O.querySelectorAll(".e-rhandler"));P<I.length;P++){var F=I[P];(0,t.setStyleAttribute)(F,{height:T+"px"})}}}else this.parent.axisFieldModule.render(),this.updateChartAxisHeight();if(this.parent.showToolbar&&"Both"===this.parent.displayOption.view){var L="Table"===this.parent.currentView?".e-chart-grouping-bar":".e-pivot-grouping-bar",A=this.parent.element.querySelector(L);A&&(A.style.display="none")}}}},e.prototype.updateChartAxisHeight=function(){if(this.groupingChartTable&&(0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element)){var e=this.groupingChartTable.querySelector("."+P),i=this.groupingChartTable.querySelector("."+N),a=this.groupingChartTable.querySelector("."+ue),r=this.groupingChartTable.querySelector("."+ge),n=this.groupingChartTable.querySelector("."+me),s=this.groupingChartTable.querySelector("."+ce);if(a&&s&&(a.style.height="auto",s.style.height="auto",a.offsetHeight>0&&s.offsetHeight>0)){var o=a.offsetHeight>s.offsetHeight?a.offsetHeight:s.offsetHeight;(0,t.setStyleAttribute)(a,{height:(0,t.formatUnit)(o)}),(0,t.setStyleAttribute)(s,{height:(0,t.formatUnit)(o)})}if(r&&n&&(r.style.height="auto",n.style.height="auto",r.offsetHeight>0&&n.offsetHeight>0)){o=r.offsetHeight>n.offsetHeight?r.offsetHeight:n.offsetHeight;(0,t.setStyleAttribute)(r,{height:(0,t.formatUnit)(o)}),(0,t.setStyleAttribute)(n,{height:(0,t.formatUnit)(o)})}if(this.parent&&!(0,t.isNullOrUndefined)(this.parent.minWidth)){var l=(0,t.formatUnit)(this.groupingChartTable.offsetWidth-Math.ceil(i.getBoundingClientRect().width));(0,t.setStyleAttribute)(r,{width:Math.ceil(r.getBoundingClientRect().width)+"px"}),(0,t.setStyleAttribute)(e,{width:l})}}},e.prototype.refreshUI=function(){if(this.groupingChartTable){if((0,t.setStyleAttribute)(this.groupingChartTable,{width:(0,t.formatUnit)(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingChartTable.querySelector("."+E)&&null!=this.chartPanel&&!this.chartPanel.isDestroyed){var e=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2;this.chartPanel.width=this.parent.isAdaptive?e:e<400?this.parent.minWidth||"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)))}if(this.groupingTable){var i=this.groupingTable.getElementsByClassName(ge+" "+le)[0];if((0,t.setStyleAttribute)(this.groupingTable,{width:(0,t.formatUnit)(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber())}),this.groupingTable&&this.groupingTable.querySelector("."+E)&&null!=this.gridPanel&&!this.gridPanel.isDestroyed){var a=this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2;this.gridPanel.width=this.parent.isAdaptive?a:a<400?this.parent.minWidth||"398px":a,this.gridPanel.refreshOverflow()}this.groupingTable.style.minWidth=this.parent.minWidth?this.parent.minWidth+"px":"400px";var r=this.parent.element.querySelector("."+Vt).querySelector("colgroup").children,n=0,s=this.parent.isTabular&&this.parent.engineModule.rowMaxLevel>0?this.parent.engineModule.rowMaxLevel+1:1,o=void 0;if("Table"===this.parent.currentView&&this.groupingTable){var l=this.parent.element.querySelectorAll(".e-group-pivot-rows");o=l.length>0?l[0].querySelectorAll(".e-pvt-btn-div"):null}else if("Chart"===this.parent.currentView&&this.groupingChartTable){var d=this.groupingChartTable.querySelector(".e-group-rows");o=d?d.querySelectorAll(".e-pvt-btn-div"):null}var p=this.parent.isTouchMode?6.5:5.5,h=0;(0,t.isNullOrUndefined)(o)||o.forEach(function(e){h+=e.offsetHeight+p});for(var u=0;u<s;u++){var c=r[u];if((0,t.isNullOrUndefined)(c)||(this.parent&&this.parent.gridSettings&&!this.parent.gridSettings.allowAutoResizing&&!(0,t.isNullOrUndefined)(c.offsetWidth)?n+=c.offsetWidth:(0,t.isNullOrUndefined)(c.style)||(0,t.isNullOrUndefined)(c.style.width)||(n+=parseInt(c.style.width,10))),!(0,t.isNullOrUndefined)(this.parent.element.querySelectorAll(".e-group-pivot-rows")[u])){var g=0,m="pivot"===this.parent.dataType?this.parent.engineModule:this.parent.olapEngineModule;if(!(0,t.isNullOrUndefined)(m)&&!(0,t.isNullOrUndefined)(m.pivotValues))for(var f=0;f<m.pivotValues.length&&(!m.pivotValues[f]||!m.pivotValues[f][0]||"row"!==m.pivotValues[f][0].axis);f++)m.pivotValues[f]&&g++;h<g*this.parent.gridSettings.rowHeight?this.parent.element.querySelectorAll(".e-group-pivot-rows")[u].style.height=g*this.parent.gridSettings.rowHeight+"px":this.parent.element.querySelectorAll(".e-group-pivot-rows")[u].style.height=h+"px"}}var v=n,S=(0,t.formatUnit)(this.groupingTable.offsetWidth-v);if((0,t.setStyleAttribute)(i,{width:v+"px"}),this.parent.isTabular)this.setTabularWidth();else{var y=parseInt(r[0].style.width,10);(0,t.setStyleAttribute)(this.rowPanel,{width:y>100?y+"px":"100px"})}if((0,t.setStyleAttribute)(this.rightAxisPanel,{width:S}),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")){var b=this.parent.element.querySelector("."+Vt).querySelector(".e-columnheader");(0,t.addClass)([b.querySelector("."+ze)],"e-group-row"),(0,t.setStyleAttribute)(this.rowPanel,{height:this.parent.element.querySelector("."+Vt).offsetHeight+"px"}),b.querySelector(".e-group-row").appendChild(this.rowAxisPanel),(0,t.setStyleAttribute)(b.querySelector(".e-group-row").querySelector(".e-headercelldiv"),{display:"none"}),(0,t.setStyleAttribute)(b.querySelector(".e-group-row").querySelector(".e-sortfilterdiv"),{display:"none"});var C=this.parent.element.querySelector("."+Vt).offsetHeight;(0,t.setStyleAttribute)(this.rowPanel,{height:C+"px"}),this.parent.element.querySelector("."+Vt).querySelector(".e-rhandler")&&(this.parent.element.querySelector("."+Vt).querySelector(".e-rhandler").style.height=C+"px");for(var x=[].slice.call(this.parent.element.querySelector("."+Vt).querySelector("thead").querySelectorAll("tr")).filter(function(e){return e.childNodes.length>0}),w=C/x.length,T=0,M=x;T<M.length;T++){c=M[T];(0,t.setStyleAttribute)(c,{height:w+"px"});for(var D=0,O=[].slice.call(c.querySelectorAll(".e-rhandler"));D<O.length;D++){var N=O[D];N.parentElement.parentElement.querySelector("."+bi)||(0,t.setStyleAttribute)(N,{height:w+"px"})}}}}},e.prototype.alignIcon=function(){if(this.parent.pivotFieldListModule){var e=this.parent.pivotFieldListModule.element,i=void 0;if(i="Table"===this.parent.currentView?this.parent.grid?this.parent.grid.element.offsetWidth:i:this.parent.chart?this.parent.pivotChartModule.getCalulatedWidth():i){var a=this.parent.minWidth?this.parent.minWidth:this.parent.isAdaptive?300:400,r=i<a?a:i;(0,t.setStyleAttribute)(e.querySelector("."+f),{left:(0,t.formatUnit)(this.parent.enableRtl?-Math.abs(r-e.querySelector("."+f).offsetWidth):r-e.querySelector("."+f).offsetWidth)})}}},e.prototype.setGridRowWidth=function(){var e=this.parent.element.querySelector("."+Vt).querySelector(".e-columnheader"),i=(this.groupingTable?this.groupingTable:this.groupingChartTable).getElementsByClassName(N)[0];if(!(0,t.isNullOrUndefined)(this.groupingTable)){if(this.parent.isTabular&&this.parent.engineModule.rowMaxLevel>=1){(0,t.isNullOrUndefined)(i.querySelector(".e-axis-row"))||i.querySelector(".e-axis-row").remove();for(var a=e.querySelectorAll("."+ze),r=0;r<this.parent.engineModule.rowMaxLevel+1;r++){if(!(0,t.isNullOrUndefined)(a[r])){(0,t.addClass)([a[r]],"e-group-row");var n=e.querySelectorAll(".e-group-row");if(!n[r].querySelector(".e-row-axis-panel")){var s=this.rowAxisPanel.cloneNode(!0);s.classList.add("e-row-axis-panel"),s.querySelectorAll(".e-pvt-btn-div")&&s.querySelectorAll(".e-pvt-btn-div").forEach(function(e){return e.remove()}),n[r].appendChild(s)}}this.parent.axisFieldModule.render()}}else(0,t.addClass)([e.querySelector("."+ze)],"e-group-row"),e.querySelector(".e-group-row").appendChild(this.rowAxisPanel);var o=this.parent.element.querySelector("."+Vt).querySelector("colgroup").children[0];if(this.parent.isTabular&&this.setTabularWidth(),this.rowPanel.querySelector("."+A))if(this.parent.isAdaptive){if(!this.parent.firstColWidth){if((v=this.parent.grid.columns)&&v.length>0)if(this.parent.isTabular){this.rowAxisWidth=this.parent.dataSourceSettings.rows.length*this.parent.gridSettings.columnWidth;for(r=0;r<this.parent.engineModule.rowMaxLevel;r++)(0,t.isNullOrUndefined)(v[r])||(v[r].width=this.parent.gridSettings.columnWidth)}else v[0].width=this.resColWidth;this.parent.posCount=0}}else{var l=[].slice.call(this.rowPanel.querySelectorAll("."+L)),d=l[l.length-1],p=this.parent.isTabular?0:d.querySelector(".e-indent-div").offsetWidth+20,h=d.querySelector("."+A).offsetWidth+p,u=(0,t.formatUnit)(h<this.resColWidth?this.resColWidth:h),c=this.parent.element.querySelector("."+Vt).querySelector("."+ze),g=this.parent.element.querySelector("."+R).querySelector("colgroup").children[0],m=parseInt(u,10),f=this.parent.pivotColumns.length>0,v=this.parent.grid.columns;this.resColWidth=this.parent.resizeInfo&&this.parent.resizeInfo["0.formattedText"]>100?this.parent.resizeInfo["0.formattedText"]:this.resColWidth,v&&v.length>0&&(v[0].width=v[0].autoFit?v[0].width:m>this.resColWidth?m:this.resColWidth);var S=void 0;S="olap"===this.parent.dataType?this.parent.renderModule.calculateColWidth(this.parent.olapEngineModule.pivotValues.length>0?this.parent.olapEngineModule.pivotValues[0].length:2):this.parent.renderModule.calculateColWidth(this.parent.dataSourceSettings.values.length>0&&this.parent.engineModule.pivotValues.length>0?this.parent.engineModule.pivotValues[0].length:2);for(var y=0;y<v.length;y++)if(0!==y)if(v[y].columns)this.parent.setCommonColumnsWidth(this.parent.renderModule.pivotColumns[y].columns,S);else if("auto"!==v[y].width){var b=v[y].customAttributes?v[y].customAttributes.cell.valueSort.levelName:"",C=this.parent.renderModule.setSavedWidth(b,S);v[y].width=v[y].autoFit||f&&this.parent.pivotColumns[y].autoFit?v[y].width:this.parent.renderModule.lastColumn&&this.parent.renderModule.lastColumn.field===v[y].field?C-3:C}else v[y].minWidth=S;if(this.parent.isTabular){var x=this.parent.pivotValues[0],w=0;if(x&&(0,t.isNullOrUndefined)(x[0]))w=x.lastIndexOf("Server"===this.parent.dataSourceSettings.mode?null:void 0)+1;if(this.rowAxisWidth>(this.parent.resizedValue?this.parent.resizedValue:150)&&w>1){var T=l[0].getBoundingClientRect().width+6;u=this.rowAxisWidth<w*T||w>1?T+"px":this.rowAxisWidth-(w-1)*T+"px"}}this.parent.posCount=0,this.parent.setGridColumns(this.parent.grid.columns),this.parent.firstColWidth||(u=this.parent.isTabular?this.resColWidth.toString():v[0].autoFit?v[0].width.toString():u,o.style.width=u,g.style.width=u,c.style.width=u,(0,t.setStyleAttribute)(c,{width:u}))}else this.parent.grid.columns&&this.parent.grid.columns.length>0&&(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()},e.prototype.wireEvent=function(e){t.EventHandler.add(e,"mouseover",this.dropIndicatorUpdate,this),t.EventHandler.add(e,"mouseleave",this.dropIndicatorUpdate,this)},e.prototype.unWireEvent=function(e){e&&(t.EventHandler.remove(e,"mouseover",this.dropIndicatorUpdate),t.EventHandler.remove(e,"mouseleave",this.dropIndicatorUpdate))},e.prototype.dropIndicatorUpdate=function(e){(this.parent.isDragging&&e.target.classList.contains(ne)&&"mouseover"===e.type||!this.parent.isDragging||!e.target.classList.contains(ne)&&"mouseleave"===e.type)&&((0,t.removeClass)([].slice.call(this.parent.element.querySelectorAll("."+W)),Q),(0,t.removeClass)([].slice.call(this.parent.element.querySelectorAll("."+W+"-last")),Q))},e.prototype.tapHoldHandler=function(e){var i=(0,t.closest)(e.originalEvent.target,"."+A);if(!(0,t.isNullOrUndefined)(i)&&this.parent.isAdaptive){var a=i.getBoundingClientRect();return this.parent.contextMenuModule.fieldElement=i,void this.parent.contextMenuModule.menuObj.open(a.top,a.left)}},e.prototype.RefreshFieldsPanel=function(){if("pivot"===this.parent.dataType&&null!=this.parent.groupingBarSettings){if((0,t.selectAll)("#"+this.parent.element.id+"_AllFields",this.parent.element).length>0)for(var e=0,i=(0,t.selectAll)("#"+this.parent.element.id+"_AllFields",this.parent.element);e<i.length;e++){i[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())}},e.prototype.createToolbarUI=function(e){(0,t.select)("#"+this.parent.element.id+"_AllFields",e)&&(0,t.select)("#"+this.parent.element.id+"_AllFields",e).remove(),e.prepend((0,t.createElement)("div",{id:this.parent.element.id+"_AllFields"}));var i=new Gs.Toolbar({cssClass:E+(this.parent.cssClass?" "+this.parent.cssClass:""),enableRtl:this.parent.enableRtl,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,items:[{template:"<div class="+he+"></div>"}],allowKeyboard:!1,width:this.parent.gridSettings.allowAutoResizing?"auto":this.parent.grid?this.parent.getGridWidthAsNumber()-2:this.parent.getWidthAsNumber()-2});return i.appendTo((0,t.select)("#"+this.parent.element.id+"_AllFields",e)),i},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(vr,this.renderLayout,this),this.parent.on(hr,this.appendToElement,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(hr,this.appendToElement),this.parent.off(vr,this.renderLayout))},e.prototype.destroy=function(){var e=this;if(!this.isDestroyed){this.timeOutObj&&(clearTimeout(this.timeOutObj),this.timeOutObj=null),this.removeEventListener(),[this.rowPanel,this.groupingTable?this.groupingTable.querySelector("."+ce):null,this.groupingTable?this.groupingTable.querySelector("."+ge):null,this.groupingTable?this.groupingTable.querySelector("."+me):null].forEach(function(t){t&&e.unWireEvent(t)}),this.parent.pivotButtonModule&&(this.parent.pivotButtonModule.destroy(),this.parent.pivotButtonModule=null),this.parent.axisFieldModule&&(this.parent.axisFieldModule.destroy(),this.parent.axisFieldModule=null),this.gridPanel&&!this.gridPanel.isDestroyed&&(this.gridPanel.destroy(),this.gridPanel=null),this.chartPanel&&!this.chartPanel.isDestroyed&&(this.chartPanel.destroy(),this.chartPanel=null),this.touchObj&&!this.touchObj.isDestroyed&&(this.touchObj.destroy(),this.touchObj=null);var i=this.parent.element.querySelectorAll("."+pe);if(i.length>0)for(var a=0;a<i.length;a++)(0,t.remove)(i[a]);i=null,this.groupingChartTable&&(this.removeAllEventListeners(this.groupingChartTable),this.groupingChartTable=null),this.groupingTable&&(this.removeAllEventListeners(this.groupingTable),this.groupingTable=null),this.rowPanel=null,this.rowAxisPanel=null,this.rightAxisPanel=null,this.rowAxisWidth=0,this.resColWidth=0,this.isDestroyed=!0}},e.prototype.removeAllEventListeners=function(e){if(e){for(var i=e.querySelectorAll("."+ne),a=0;a<i.length;a++)this.unWireEvent(i[a]);var r=e.querySelectorAll("."+A);for(a=0;a<r.length;a++)t.EventHandler.remove(r[a],"mouseover",this.dropIndicatorUpdate),t.EventHandler.remove(r[a],"mouseleave",this.dropIndicatorUpdate)}},e.prototype.setTabularWidth=function(){for(var e=this.parent.element.querySelector("."+Vt).querySelector("colgroup").children,i=this.parent.isTabular&&this.parent.engineModule.rowMaxLevel>0?this.parent.engineModule.rowMaxLevel+1:1,a=this.parent.element.querySelector("."+Vt).querySelector(".e-columnheader").querySelectorAll(".e-group-rows"),r=0;r<i;r++)(0,t.isNullOrUndefined)(a[r])||(0,t.isNullOrUndefined)(a[r].style)||(0,t.isNullOrUndefined)(e[r])||(0,t.isNullOrUndefined)(e[r].style)||(0,t.isNullOrUndefined)(e[r].style.width)||(a[r].style.width=parseInt(e[r].style.width,10)-6+"px")},e}(),yd=function(){function e(e){this.parent=e,this.parent.conditionalFormattingModule=this,this.parentID=this.parent.element.id,this.fontColor=[],this.backgroundColor=[],this.newFormat=[]}return e.prototype.getModuleName=function(){return"conditionalFormatting"},e.prototype.createDialog=function(){null!==(0,t.select)("#"+this.parentID+"conditionalformatting",document)&&(0,t.remove)((0,t.select)("#"+this.parentID+"conditionalformatting",document));var e=(0,t.createElement)("div",{id:this.parentID+"conditionalformatting",className:"e-pivot-formatting-dialog"});this.parent.element.appendChild(e);var i,a=[{click:this.addButtonClick.bind(this),isFlat:!1,buttonModel:{cssClass:(this.parent.isAdaptive?"e-small e-round "+Dt:Dt)+(this.parent.cssClass?" "+this.parent.cssClass:""),iconCss:o+" "+Te,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")}}];(i=this.parent.isAdaptive?new Bs.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:a,beforeOpen:this.beforeOpen.bind(this),close:this.removeDialog.bind(this),cssClass:this.parent.cssClass,header:this.parent.localeObj.getConstant("conditionalFormatting"),target:Hs.getAppendToElement(this.parent.element,this.parent.isAngular)}):new Bs.Dialog({allowDragging:!0,position:{X:"center",Y:"center"},buttons:a,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})).isStringTemplate=!0,i.isAngular=this.parent.isModalDialog,i.appendTo(e)},e.prototype.beforeOpen=function(){(0,t.select)("#"+this.parentID+"conditionalformatting",document).querySelector("."+It).setAttribute("title",this.parent.localeObj.getConstant("conditionalFormatting"))},e.prototype.addButtonClick=function(){var e=this,t=this;this.parent.trigger(Ka,{conditions:"LessThan",value1:0,applyGrandTotals:!0,style:{backgroundColor:"white",color:"black",fontFamily:"Arial",fontSize:"12px"}},function(i){t.refreshConditionValues(),e.destroyColorPickers(),t.newFormat.push(i),t.addFormat()})},e.prototype.applyButtonClick=function(){if(this.refreshConditionValues()){this.parent.setProperties({dataSourceSettings:{conditionalFormatSettings:this.newFormat}},!0);var e={conditionalFormattingInfo:this.parent.dataSourceSettings.conditionalFormatSettings};this.parent.actionObj.actionInfo=e,this.parent.dataSourceSettings.values.length>0&&this.parent.renderPivotGrid(),(0,t.getInstance)((0,t.select)("#"+this.parentID+"conditionalformatting",document),Bs.Dialog).close()}},e.prototype.cancelButtonClick=function(){(0,t.getInstance)((0,t.select)("#"+this.parentID+"conditionalformatting",document),Bs.Dialog).close(),this.newFormat=[]},e.prototype.refreshConditionValues=function(){for(var e=0;e<this.newFormat.length;e++){if(""===(0,t.select)("#"+this.parentID+"conditionvalue1"+e,document).value||""===(0,t.select)("#"+this.parentID+"conditionvalue2"+e,document).value)return""===(0,t.select)("#"+this.parentID+"conditionvalue1"+e,document).value?(0,t.select)("#"+this.parentID+"conditionvalue1"+e,document).focus():(0,t.select)("#"+this.parentID+"conditionvalue2"+e,document).focus(),!1;this.newFormat[e].value1=Number((0,t.select)("#"+this.parentID+"conditionvalue1"+e,document).value),this.newFormat[e].value2=Number((0,t.select)("#"+this.parentID+"conditionvalue2"+e,document).value)}return!0},e.prototype.addFormat=function(){for(var e=(0,t.createElement)("div",{id:this.parentID+"formatDiv",className:"e-new-format"}),i=0;i<this.newFormat.length;i++)e.appendChild(this.createDialogElements(i));if(0===this.newFormat.length){var a=this.createDialogElements(),r=(0,t.createElement)("p",{id:this.parentID+"emptyFormat",className:"e-pivot-conditional-empty-format"});r.innerText=this.parent.localeObj.getConstant("emptyFormat"),a.appendChild(r),e.appendChild(a)}(0,t.getInstance)((0,t.select)("#"+this.parentID+"conditionalformatting",document),Bs.Dialog).setProperties({content:e},!1);for(i=0;i<this.newFormat.length;i++)this.renderDropDowns(i),this.renderColorPicker(i)},e.prototype.createDialogElements=function(e){var i=(0,t.createElement)("div",{id:this.parentID+"outerDiv"+e,className:"e-format-outer-div"});if(void 0!==e){var a=this.newFormat[e],r=(0,t.createElement)("button",{id:this.parentID+"removeButton"+e,className:"e-format-delete-button",attrs:{type:"button",title:this.parent.localeObj.getConstant("delete")}});i.appendChild(r);var n=(0,t.createElement)("div",{id:this.parentID+"innerDiv"+e,className:"e-format-inner-div"}),s=(0,t.createElement)("table",{id:this.parentID+"_valueTable"+e,className:Ot,attrs:{role:"table"}}),o=(0,t.createElement)("tr"),l=(0,t.createElement)("td"),d=(0,t.createElement)("span",{id:this.parentID+"valuelabel"+e,className:"e-format-value-label"});d.innerText=this.parent.localeObj.getConstant("value"),l.appendChild(d),o.appendChild(l),s.appendChild(o),o=(0,t.createElement)("tr"),l=(0,t.createElement)("td");var p=(0,t.createElement)("div",{id:this.parentID+"measure"+e}),h=(0,t.createElement)("input",{id:this.parentID+"measureinput"+e,attrs:{type:"text",tabindex:"0"}});p.appendChild(h),l.appendChild(p),o.appendChild(l),l=(0,t.createElement)("td");var u=(0,t.createElement)("div",{id:this.parentID+"condition"+e}),c=(0,t.createElement)("input",{id:this.parentID+"conditioninput"+e,attrs:{type:"text",tabindex:"0"}});u.appendChild(c),l.appendChild(u),o.appendChild(l),l=(0,t.createElement)("td",{attrs:{style:"display:table"},className:"e-format-input-value"});var g="Between"!==a.conditions&&"NotBetween"!==a.conditions?Pt:"",m=(0,t.createElement)("div",{attrs:{style:"display: table-row;"}}),f=(0,t.createElement)("div",{id:this.parentID+"ConditionValue1"+e,attrs:{style:"display: table-cell;"}}),v=(0,t.createElement)("input",{id:this.parentID+"conditionvalue1"+e,attrs:{type:"text",tabindex:"0",value:(0,t.isNullOrUndefined)(a.value1)?"0":a.value1.toString(),placeholder:this.parent.localeObj.getConstant("emptyInput")}});f.appendChild(v),m.appendChild(f);var S=(0,t.createElement)("span",{id:this.parentID+"valuespan"+e,className:"e-format-value-span "+g,innerHTML:"&"});m.appendChild(S);var y=(0,t.createElement)("div",{id:this.parentID+"ConditionValue2"+e,attrs:{style:"display: table-cell;"}}),b=(0,t.createElement)("input",{id:this.parentID+"conditionvalue2"+e,attrs:{type:"text",tabindex:"0",value:(0,t.isNullOrUndefined)(a.value2)?"0":a.value2.toString(),placeholder:this.parent.localeObj.getConstant("emptyInput")}});y.appendChild(b),m.appendChild(y),l.appendChild(m),o.appendChild(l),s.appendChild(o),n.appendChild(s);var C=(0,t.createElement)("table",{id:this.parentID+"_grandTotalTable"+e,className:Ot+" e-grandtotal-checkbox-table",attrs:{role:"table"}}),x=(0,t.createElement)("tr"),w=(0,t.createElement)("td");C.appendChild(x);var T=(0,t.createElement)("input",{id:this.parentID+"grandtotalcheckbox"+e,attrs:{type:"checkbox",tabindex:"0"}});w.appendChild(T),x.appendChild(w),C.appendChild(x),n.appendChild(C);var M=(0,t.createElement)("table",{id:this.parentID+"_formatTable"+e,className:Ot,attrs:{role:"table"}}),D=(0,t.createElement)("tr"),O=(0,t.createElement)("td"),N=(0,t.createElement)("span",{id:this.parentID+"formatlabel"+e,className:"e-format-label"});N.innerText=this.parent.localeObj.getConstant("formatLabel"),O.appendChild(N),D.appendChild(O),M.appendChild(D),D=(0,t.createElement)("tr"),O=(0,t.createElement)("td");var P=(0,t.createElement)("div",{id:this.parentID+"fontname"+e}),E=(0,t.createElement)("input",{id:this.parentID+"fontnameinput"+e,attrs:{type:"text",tabindex:"0"}});P.appendChild(E),O.appendChild(P),D.appendChild(O),O=(0,t.createElement)("td");var I=(0,t.createElement)("div",{id:this.parentID+"fontsize"+e}),F=(0,t.createElement)("input",{id:this.parentID+"fontsizeinput"+e,attrs:{type:"text",tabindex:"0"}});I.appendChild(F),O.appendChild(I),D.appendChild(O),this.parent.isAdaptive&&(M.appendChild(D),D=(0,t.createElement)("tr"),M.appendChild(D),D=(0,t.createElement)("tr")),O=(0,t.createElement)("td");var L=(0,t.createElement)("input",{id:this.parentID+"fontcolor"+e,attrs:{type:"color",tabindex:"0"},className:"e-format-font-color"});O.appendChild(L);var A=(0,t.createElement)("input",{id:this.parentID+"backgroundcolor"+e,attrs:{type:"color",tabindex:"0"},className:"e-format-back-color"});O.appendChild(A),D.appendChild(O),O=(0,t.createElement)("td");var R=(0,t.createElement)("input",{id:this.parentID+"valuepreview"+e,className:Nt+" e-format-value-preview",attrs:{tabindex:"-1",readonly:"true",value:"123.45"}});O.appendChild(R),D.appendChild(O),M.appendChild(D),n.appendChild(M),i.appendChild(n)}return i},e.prototype.renderDropDowns=function(e){var i=(0,t.getInstance)((0,t.select)("#"+this.parentID+"conditionalformatting",document),Bs.Dialog).element,a=this.newFormat[e],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?t.SanitizeHtmlHelper.sanitize(s):s,r.push({index:n+1,name:s,field:this.parent.dataSourceSettings.values[n].name})}var o=(0,t.isNullOrUndefined)(a.measure)?this.parent.localeObj.getConstant("AllValues"):a.measure,l=[];l[e]=new Ws.DropDownList({dataSource:r,fields:{text:"name",value:"field"},value:o,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.measureChange.bind(this,e)}),l[e].isStringTemplate=!0,l[e].isAngular=this.parent.isModalDialog,l[e].appendTo((0,t.select)("#"+this.parentID+"measureinput"+e,i));var d=[{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")}];o=(0,t.isNullOrUndefined)(a.conditions)?"LessThan":a.conditions;var p=[];p[e]=new Ws.DropDownList({dataSource:d,fields:{value:"value",text:"name"},value:o,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.conditionChange.bind(this,e)}),p[e].isStringTemplate=!0,p[e].isAngular=this.parent.isModalDialog,p[e].appendTo((0,t.select)("#"+this.parentID+"conditioninput"+e,i));var h="Between"!==this.newFormat[e].conditions&&"NotBetween"!==this.newFormat[e].conditions?Pt:"",u=new zs.TextBox({enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-format-value1 "+this.parent.cssClass,width:"auto"});u.isStringTemplate=!0,u.appendTo((0,t.select)("#"+this.parentID+"conditionvalue1"+e,i));var c=new zs.TextBox({enableRtl:this.parent.enableRtl,locale:this.parent.locale,cssClass:"e-format-value2 "+h+" "+this.parent.cssClass,width:"auto"});c.isStringTemplate=!0,c.appendTo((0,t.select)("#"+this.parentID+"conditionvalue2"+e,i));var g=new io.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});g.isStringTemplate=!0,g.appendTo((0,t.select)("#"+this.parentID+"grandtotalcheckbox"+e,i));o=(0,t.isNullOrUndefined)(a.style.fontFamily)?"Arial":a.style.fontFamily;var m=[];m[e]=new Ws.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:o,width:"100%",cssClass:this.parent.cssClass,popupHeight:"200px",popupWidth:"auto",locale:this.parent.locale,enableRtl:this.parent.enableRtl,change:this.fontNameChange.bind(this,e)}),m[e].isStringTemplate=!0,m[e].isAngular=this.parent.isModalDialog,m[e].appendTo((0,t.select)("#"+this.parentID+"fontnameinput"+e,i));o=(0,t.isNullOrUndefined)(a.style.fontSize)?"12px":a.style.fontSize;var f=[];f[e]=new Ws.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:o,width:"100%",change:this.fontSizeChange.bind(this,e),locale:this.parent.locale,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass}),f[e].isStringTemplate=!0,f[e].isAngular=this.parent.isModalDialog,f[e].appendTo((0,t.select)("#"+this.parentID+"fontsizeinput"+e,i))},e.prototype.conditionChange=function(e,i){this.newFormat[e].conditions=i.value;var a=(0,t.select)("#"+this.parentID+"valuespan"+e,document),r=(0,t.select)("#"+this.parentID+"conditionvalue2"+e,document);"Between"===i.value||"NotBetween"===i.value?(a.classList.remove(Pt),r.parentElement.classList.remove(Pt)):(a.classList.add(Pt),r.parentElement.classList.add(Pt))},e.prototype.onCheckChange=function(e,t){this.newFormat[e].applyGrandTotals=t.checked},e.prototype.fontNameChange=function(e,i){this.newFormat[e].style.fontFamily=i.value.toString(),(0,t.select)("#"+this.parentID+"valuepreview"+e,document).style.fontFamily=i.value},e.prototype.fontSizeChange=function(e,i){this.newFormat[e].style.fontSize=i.value.toString(),(0,t.select)("#"+this.parentID+"valuepreview"+e,document).style.fontSize=i.value},e.prototype.measureChange=function(e,t){this.newFormat[e].measure=t.value.toString()===this.parent.localeObj.getConstant("AllValues")?void 0:t.value.toString()},e.prototype.renderColorPicker=function(e){var i=(0,t.getInstance)((0,t.select)("#"+this.parentID+"conditionalformatting",document),Bs.Dialog).element,a=this.newFormat[e],r=(0,t.isNullOrUndefined)(a.style.color)?"black":a.style.color,n="#"===r.charAt(0)&&this.isHex(r.substr(1))?r:this.colourNameToHex(r);(0,t.select)("#"+this.parentID+"valuepreview"+e,document).style.color=n,this.fontColor[e]=new zs.ColorPicker({cssClass:Et+" e-format-font-color-picker"+(this.parent.cssClass?" "+this.parent.cssClass:""),value:n,mode:"Palette",change:this.fontColorChange.bind(this,e),locale:this.parent.locale,enableRtl:this.parent.enableRtl}),this.fontColor[e].isStringTemplate=!0,this.fontColor[e].isAngular=this.parent.isModalDialog,this.fontColor[e].appendTo((0,t.select)("#"+this.parentID+"fontcolor"+e,i)),(0,t.addClass)([this.fontColor[e].element.nextElementSibling.querySelector(".e-selected-color")],o),n="#"===(r=(0,t.isNullOrUndefined)(a.style.backgroundColor)?"white":a.style.backgroundColor).charAt(0)&&this.isHex(r.substr(1))?r:this.colourNameToHex(r),(0,t.select)("#"+this.parentID+"valuepreview"+e,document).style.backgroundColor=n,(0,t.select)("#"+this.parentID+"valuepreview"+e,document).style.fontFamily=a.style.fontFamily,(0,t.select)("#"+this.parentID+"valuepreview"+e,document).style.fontSize=a.style.fontSize,this.backgroundColor[e]=new zs.ColorPicker({cssClass:Et+(this.parent.cssClass?" "+this.parent.cssClass:""),value:n,mode:"Palette",change:this.backColorChange.bind(this,e),locale:this.parent.locale,enableRtl:this.parent.enableRtl}),this.backgroundColor[e].isStringTemplate=!0,this.backgroundColor[e].isAngular=this.parent.isModalDialog,this.backgroundColor[e].appendTo((0,t.select)("#"+this.parentID+"backgroundcolor"+e,i)),(0,t.addClass)([this.backgroundColor[e].element.nextElementSibling.querySelector(".e-selected-color")],o);var s=new io.Button({iconCss:o+" 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});s.isStringTemplate=!0,s.appendTo((0,t.select)("#"+this.parentID+"removeButton"+e,i)),s.element.onclick=this.toggleButtonClick.bind(this,e)},e.prototype.backColorChange=function(e,i){this.newFormat[e].style.backgroundColor=i.currentValue.hex,(0,t.select)("#"+this.parentID+"valuepreview"+e,document).style.backgroundColor=i.currentValue.hex},e.prototype.fontColorChange=function(e,i){this.newFormat[e].style.color=i.currentValue.hex,(0,t.select)("#"+this.parentID+"valuepreview"+e,document).style.color=i.currentValue.hex},e.prototype.toggleButtonClick=function(e){this.destroyColorPickers(),this.newFormat.splice(e,1),this.addFormat()},e.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},e.prototype.hexToRgb=function(e){var t=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(e);return t?{r:parseInt(t[1],16),g:parseInt(t[2],16),b:parseInt(t[3],16)}:null},e.prototype.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")){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}return"#d5d5d5"},e.prototype.removeDialog=function(){var e=(0,t.select)("#"+this.parentID+"conditionalformatting",document),i=e?(0,t.getInstance)(e,Bs.Dialog):null;i&&!i.isDestroyed&&(this.destroyColorPickers(),this.removeEventListeners(),i.destroy()),e&&(0,t.remove)(e),this.fontColor=[],this.backgroundColor=[],this.newFormat=[]},e.prototype.removeEventListeners=function(){for(var e=0;e<(this.newFormat?this.newFormat.length:0);e++){var i=(0,t.select)("#"+this.parentID+"removeButton"+e,document);i&&(i.onclick=null)}},e.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(),this.destroyDropDowns(e),this.destroyOtherComponents(e)},e.prototype.destroyDropDowns=function(e){var i=(0,t.select)("#"+this.parentID+"conditionalformatting",document);if(i){var a=(0,t.select)("#"+this.parentID+"measureinput"+e,i);if(a){var r=(0,t.getInstance)(a,Ws.DropDownList);r&&!r.isDestroyed&&r.destroy()}var n=(0,t.select)("#"+this.parentID+"conditioninput"+e,i);if(n){var s=(0,t.getInstance)(n,Ws.DropDownList);s&&!s.isDestroyed&&s.destroy()}var o=(0,t.select)("#"+this.parentID+"fontnameinput"+e,i);if(o){var l=(0,t.getInstance)(o,Ws.DropDownList);l&&!l.isDestroyed&&l.destroy()}var d=(0,t.select)("#"+this.parentID+"fontsizeinput"+e,i);if(d){var p=(0,t.getInstance)(d,Ws.DropDownList);p&&!p.isDestroyed&&p.destroy()}}},e.prototype.destroyOtherComponents=function(e){var i=(0,t.select)("#"+this.parentID+"conditionalformatting",document);if(i){var a=(0,t.select)("#"+this.parentID+"conditionvalue1"+e,i);if(a){var r=(0,t.getInstance)(a,zs.TextBox);r&&!r.isDestroyed&&r.destroy()}var n=(0,t.select)("#"+this.parentID+"conditionvalue2"+e,i);if(n){var s=(0,t.getInstance)(n,zs.TextBox);s&&!s.isDestroyed&&s.destroy()}var o=(0,t.select)("#"+this.parentID+"grandtotalcheckbox"+e,i);if(o){var l=(0,t.getInstance)(o,io.CheckBox);l&&!l.isDestroyed&&l.destroy()}var d=(0,t.select)("#"+this.parentID+"removeButton"+e,i);if(d){var p=(0,t.getInstance)(d,io.Button);p&&!p.isDestroyed&&p.destroy()}}},e.prototype.showConditionalFormattingDialog=function(){this.newFormat=[];for(var e=0;e<this.parent.dataSourceSettings.conditionalFormatSettings.length;e++)this.newFormat.push((0,t.extend)({},this.parent.dataSourceSettings.conditionalFormatSettings[e].properties,null,!0));this.createDialog(),(0,t.getInstance)((0,t.select)("#"+this.parentID+"conditionalformatting",document),Bs.Dialog).refresh(),this.addFormat()},e.prototype.destroy=function(){var e=(0,t.select)("#"+this.parentID+"conditionalformatting",document),i=e?(0,t.getInstance)(e,Bs.Dialog):null;i&&!i.isDestroyed&&i.close()},e}(),bd=function(){function e(e){this.isMultiAxisChange=!1,this.isReportChange=!1,this.currentReport="",this.isChartTypeDialogApplied=!1,this.parent=e,this.parent.toolbarModule=this,this.addEventListener()}return e.prototype.getModuleName=function(){return"toolbar"},e.prototype.createToolbar=function(){this.parent.isModified=!1,this.renderDialog(),this.toolbar&&!this.toolbar.isDestroyed&&(this.destroyToolbarComponents(),this.toolbar.destroy(),this.toolbar=null),null!==(0,t.select)("#"+this.parent.element.id+"pivot-toolbar",document)&&(0,t.remove)((0,t.select)("#"+this.parent.element.id+"pivot-toolbar",document));var e=(0,t.createElement)("div",{id:this.parent.element.id+"pivot-toolbar",className:Zt});if(this.parent.showFieldList&&(0,t.select)("#"+this.parent.element.id+"_PivotFieldList",this.parent.element))this.parent.element.insertBefore(e,(0,t.select)("#"+this.parent.element.id+"_PivotFieldList",this.parent.element));else if(this.parent.showGroupingBar&&(0,t.select)("#"+this.parent.element.id+" .e-pivot-grouping-bar",this.parent.element))this.parent.element.insertBefore(e,(0,t.select)("#"+this.parent.element.id+" .e-pivot-grouping-bar",this.parent.element));else{var i=(0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element);!i||"Chart"!==this.parent.displayOption.view&&"Chart"!==this.parent.displayOption.primary?this.parent.element.insertBefore(e,(0,t.select)("#"+this.parent.element.id+"_grid",this.parent.element)):this.parent.element.insertBefore(e,i)}this.toolbar=new Gs.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;var a="viewContainerRef";this.parent[a]&&((0,t.setValue)("registeredTemplate",{},this.toolbar),this.toolbar[a]=this.parent[a]),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("."+Zt)),this.toolbar.element.classList.add(Zt)):this.toolbar.appendTo(e);var r=this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber();this.toolbar.width=r;var n=r-2;this.toolbar.element.style.minWidth=this.parent.isAdaptive?n+"px":n<400?this.parent.minWidth||"398px":n+"px",this.parent.chart&&this.parent.chart.setProperties({width:r.toString()},!0),this.parent.showGroupingBar&&this.parent.groupingBarModule&&this.parent.element.querySelector("."+pe)&&this.parent.groupingBarModule.refreshUI()},e.prototype.fetchReports=function(){var e={reportName:[]};return this.parent.trigger(da,e),e},e.prototype.fetchReportsArgs=function(){var e=new i.Deferred;return this.parent.trigger(da,{reportName:[]},function(t){e.resolve(t)}),e},e.prototype.getItems=function(){for(var e=this.parent.toolbar.filter(function(e,t,i){return i.indexOf(e)===t}),i=[],a=0,r=e;a<r.length;a++){var n=r[a];switch(n){case"New":i.push({prefixIcon:"e-new-report "+o,tooltipText:this.parent.localeObj.getConstant("new"),click:this.actionClick.bind(this),id:this.parent.element.id+"new"});break;case"Save":i.push({prefixIcon:"e-save-report "+o,tooltipText:this.parent.localeObj.getConstant("save"),click:this.actionClick.bind(this),id:this.parent.element.id+"save"});break;case"SaveAs":i.push({prefixIcon:"e-saveas-report "+o,tooltipText:this.parent.localeObj.getConstant("saveAs"),click:this.actionClick.bind(this),id:this.parent.element.id+"saveas"});break;case"Rename":i.push({prefixIcon:"e-rename-report "+o,tooltipText:this.parent.localeObj.getConstant("rename"),click:this.actionClick.bind(this),id:this.parent.element.id+"rename"});break;case"Remove":i.push({prefixIcon:Jt+" "+o,tooltipText:this.parent.localeObj.getConstant("deleteReport"),click:this.actionClick.bind(this),id:this.parent.element.id+"remove"});break;case"Load":i.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 s="Chart"===this.parent.displayOption.view;i.push({prefixIcon:ei+" "+o,tooltipText:this.parent.localeObj.getConstant("grid"),id:this.parent.element.id+"grid",cssClass:(s?yt:"")+(this.parent.cssClass?" "+this.parent.cssClass:""),click:this.menuItemClick.bind(this)});break;case"Chart":var l="Table"===this.parent.displayOption.view;i.push({template:'<ul id="'+this.parent.element.id+'chart_menu"></ul>',id:this.parent.element.id+"chartmenu",cssClass:(l?yt:"")+(this.parent.cssClass?" "+this.parent.cssClass:"")});break;case"MDX":"olap"===this.parent.dataType&&i.push({prefixIcon:"e-mdx "+o,id:this.parent.element.id+"mdxQuery",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("mdxQuery")});break;case"Export":i.push({template:'<ul id="'+this.parent.element.id+'export_menu"></ul>',id:this.parent.element.id+"exportmenu"});break;case"SubTotal":i.push({template:'<ul id="'+this.parent.element.id+'subtotal_menu"></ul>',id:this.parent.element.id+"subtotalmenu"});break;case"GrandTotal":i.push({template:'<ul id="'+this.parent.element.id+'grandtotal_menu"></ul>',id:this.parent.element.id+"grandtotalmenu"});break;case"ConditionalFormatting":i.push({prefixIcon:"e-toolbar-formatting "+o,id:this.parent.element.id+"formatting",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("toolbarFormatting")});break;case"NumberFormatting":i.push({prefixIcon:"e-pivot-format-toolbar "+o,id:this.parent.element.id+"numberFormatting",click:this.actionClick.bind(this),tooltipText:this.parent.localeObj.getConstant("numberFormat")});break;case"Formatting":i.push({template:'<ul id="'+this.parent.element.id+'formatting_menu"></ul>',id:this.parent.element.id+"formattingmenu"});break;case"FieldList":i.push({prefixIcon:"e-toolbar-fieldlist "+o,tooltipText:this.parent.localeObj.getConstant("fieldList"),click:this.actionClick.bind(this),align:"Right",id:this.parent.element.id+"fieldlist"}),this.parent.element.querySelector("."+f)&&(this.parent.element.querySelector("."+f).style.display="none");break;default:"object"==typeof n&&i.push(n)}}this.parent.showFieldList&&-1===e.indexOf("FieldList")&&(0,t.select)("#"+this.parent.element.id+"_PivotFieldList",this.parent.element)&&"none"===(0,t.select)("#"+this.parent.element.id+"_PivotFieldList",this.parent.element).style.display&&((0,t.select)("#"+this.parent.element.id+"_PivotFieldList",this.parent.element).style.display="block");var d={customToolbar:i};return this.parent.trigger(ga,d),i},e.prototype.reportChange=function(e){if(this.parent.actionObj.actionName=ln,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)}},e.prototype.reportLoad=function(e){var t=this;if("Save"!==this.action&&"Rename"!==this.action&&"New"!==this.action){var i={reportName:e.itemData.value},a={reportName:e.itemData.value};this.parent.actionObj.actionInfo=a,this.parent.trigger(pa,i,function(e){t.currentReport=e.reportName,t.parent.isModified=!1})}},e.prototype.saveReport=function(e){if(this.currentReport&&""!==this.currentReport&&e.item.id===this.parent.element.id+"save"){var t={report:this.getCurrentReport(),reportName:this.currentReport};this.parent.actionObj.actionName=this.parent.getActionCompleteName();var i={reportName:this.currentReport};this.parent.actionObj.actionInfo=i,this.parent.trigger(la,t),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.parent.isModified=!1}else{if(""===this.currentReport&&(e.item.id===this.parent.element.id+"save"||e.item.id===this.parent.element.id+"saveas"))return void this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("emptyReport"));this.dialogShow(e,"saveAs")}},e.prototype.mdxQueryDialog=function(){(0,t.select)("#"+this.parent.element.id+"mdx-dialog",document)||this.renderMDXDialog();var e=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"mdx-dialog",document),Bs.Dialog),i=(0,t.createElement)("div",{className:"e-mdx-query"}),a=(0,t.createElement)("textarea",{className:ui,attrs:{readonly:"readonly","aria-label":this.parent.localeObj.getConstant("mdxQuery")}});a.innerText=this.parent.olapEngineModule.getMDXQuery(this.parent.dataSourceSettings).trim(),i.appendChild(a),e.content=i,e.show()},e.prototype.dialogShow=function(e,i){if(e){var a=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"report-dialog",document),Bs.Dialog);a.header=e.item.tooltipText;var r=(0,t.createElement)("div",{className:"e-report-outer"}),n=(0,t.createElement)("div",{className:"e-pivotview-report-label"});n.innerText=this.parent.localeObj.getConstant("reportName");var s=(0,t.createElement)("input",{className:$t+" "+Nt,attrs:{placeholder:this.parent.localeObj.getConstant("emptyReportName"),value:i&&"rename"===i?this.currentReport:""}});s.innerText=i&&"rename"===i?this.currentReport:"",s.setSelectionRange(s.textContent.length,s.textContent.length),r.appendChild(n),r.appendChild(s),a.content=r,a.refresh(),a.show()}},e.prototype.renameReport=function(e){this.parent.trigger(ma,e),this.currentReport&&""!==this.currentReport?this.dialogShow(e,"rename"):this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("error"),this.parent.localeObj.getConstant("emptyReport"))},e.prototype.actionClick=function(e){var t=e.item.id===this.parent.element.id+"new"?Pr:e.item.id===this.parent.element.id+"save"?Er:e.item.id===this.parent.element.id+"saveas"?Ir:e.item.id===this.parent.element.id+"rename"?Fr:e.item.id===this.parent.element.id+"remove"?Lr:e.item.id===this.parent.element.id+"load"?Ar:e.item.id===this.parent.element.id+"formatting"?Rr:e.item.id===this.parent.element.id+"numberFormatting"?kr:e.item.id===this.parent.element.id+"mdxQuery"?Hr:e.item.id===this.parent.element.id+"fieldlist"?Vr:"";if(this.parent.actionObj.actionName=t,""===t||t===Vr||!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)}},e.prototype.renderDialog=function(){null!==(0,t.select)("#"+this.parent.element.id+"report-dialog",document)&&(0,t.remove)((0,t.select)("#"+this.parent.element.id+"report-dialog",document));var e=(0,t.createElement)("div",{id:this.parent.element.id+"report-dialog",className:"e-pivotview-report-dialog"});this.parent.element.appendChild(e);var i=new Bs.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:Hs.getAppendToElement(this.parent.element,this.parent.isAngular),cssClass:this.parent.cssClass});i.isStringTemplate=!0,i.isAngular=this.parent.isModalDialog,i.appendTo(e)},e.prototype.renderMDXDialog=function(){null!==(0,t.select)("#"+this.parent.element.id+"mdx-dialog",document)&&(0,t.remove)((0,t.select)("#"+this.parent.element.id+"mdx-dialog",document));var e=(0,t.createElement)("div",{id:this.parent.element.id+"mdx-dialog",className:"e-pivotview-mdx-dialog"});this.parent.element.appendChild(e);var i=new Bs.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:Hs.getAppendToElement(this.parent.element,this.parent.isAngular),cssClass:this.parent.cssClass});i.isStringTemplate=!0,i.isAngular=this.parent.isModalDialog,i.appendTo(e)},e.prototype.copyMDXQuery=function(){var e=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"mdx-dialog",document),Bs.Dialog).element.querySelector("."+ui);try{e.select(),document.execCommand("copy")}catch(e){window.alert("Oops, unable to copy")}},e.prototype.okBtnClick=function(){var e=this,i=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"report-dialog",document),Bs.Dialog),a=i.element.querySelector("."+$t);if(a&&""===a.value)a.focus();else{if(this.parent.localeObj||(this.parent=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id,document),_l)),i.header!==this.parent.localeObj.getConstant("save")&&i.header!==this.parent.localeObj.getConstant("saveAs")||!a.value||""===a.value){if(i.header===this.parent.localeObj.getConstant("new")&&a.value&&""!==a.value){this.action="New",this.currentReport=a.value;var r=!1,n=this,s={reportName:[]};this.parent.trigger(da,s,function(i){for(var o=0;o<i.reportName.length;o++)if(a.value===s.reportName[o]){r=!0;break}if(r)n.createConfirmDialog(n.parent.localeObj.getConstant("alert"),n.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+a.value+'"'+n.parent.localeObj.getConstant("replaceConfirmAfter"));else{n.parent.trigger(ca);var l={report:n.getCurrentReport(),reportName:a.value},d={reportName:a.value};e.parent.actionObj.actionInfo=d,n.parent.trigger(la,l),n.parent.isModified=!1,n.updateReportList(),(0,t.getInstance)((0,t.select)("#"+e.parent.element.id+"report-dialog",document),Bs.Dialog).hide()}})}else if(i.header===this.parent.localeObj.getConstant("rename")&&a.value&&""!==a.value){if(this.currentReport===a.value)return void i.hide();this.action="Rename";var o=!1;this.renameText=a.value;c=this.fetchReports();for(var l=0;l<c.reportName.length;l++)if(a.value===c.reportName[l]){o=!0;break}if(o)return void this.createConfirmDialog(this.parent.localeObj.getConstant("alert"),this.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+a.value+'"'+this.parent.localeObj.getConstant("replaceConfirmAfter"));var d={reportName:this.currentReport,rename:a.value},p={reportName:{oldName:this.currentReport,newName:a.value}};this.parent.actionObj.actionInfo=p,this.parent.trigger(ha,d),this.currentReport=a.value,this.updateReportList(),i.hide()}}else{this.action="Save",this.currentReport=a.value;var h=!1,u=this,c={reportName:[]};this.parent.trigger(da,c,function(i){for(var r=0;r<i.reportName.length;r++)if(a.value===i.reportName[r]){h=!0;break}if(h)u.createConfirmDialog(u.parent.localeObj.getConstant("alert"),u.parent.localeObj.getConstant("replaceConfirmBefore")+'"'+a.value+'"'+u.parent.localeObj.getConstant("replaceConfirmAfter"));else{var n={report:u.getCurrentReport(),reportName:a.value},s={reportName:a.value};e.parent.actionObj.actionInfo=s,u.parent.trigger(la,n),u.parent.isModified=!1,u.updateReportList(),(0,t.getInstance)((0,t.select)("#"+e.parent.element.id+"report-dialog",document),Bs.Dialog).hide()}})}this.parent.actionObj.actionName=this.parent.getActionCompleteName(),this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()}},e.prototype.createNewReport=function(e){this.dialogShow(e)},e.prototype.cancelBtnClick=function(){(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"report-dialog",document),Bs.Dialog).hide()},e.prototype.createConfirmDialog=function(e,i){document.getElementById(this.parent.element.id+"_ConfirmDialog")&&(0,t.remove)(document.getElementById(this.parent.element.id+"_ConfirmDialog").parentElement);var a=(0,t.createElement)("div",{id:this.parent.element.id+"_ConfirmDialog",className:re});this.parent.element.appendChild(a);var r=new Bs.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,showCloseIcon:!0,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,header:e,content:i,isModal:!0,visible:!0,closeOnEscape:!0,target:Hs.getAppendToElement(this.parent.element,this.parent.isAngular),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:ie+(this.parent.cssClass?" "+this.parent.cssClass:"")},click:this.okButtonClick.bind(this)},{isFlat:!1,buttonModel:{content:this.parent.localeObj.getConstant("no"),cssClass:ae+(this.parent.cssClass?" "+this.parent.cssClass:"")},click:this.cancelButtonClick.bind(this)}]});r.isStringTemplate=!0,r.isAngular=this.parent.isModalDialog,r.appendTo(a),r.element.querySelector(".e-dlg-header").innerText=this.parent.enableHtmlSanitizer?t.SanitizeHtmlHelper.sanitize(e):e},e.prototype.okButtonClick=function(){var e=this,i=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"report-dialog",document),Bs.Dialog);if("Remove"===this.action){var a={reportName:this.currentReport},r={reportName:this.currentReport};this.parent.actionObj.actionInfo=r,this.parent.trigger(ua,a);var n=this.fetchReports();if(n.reportName&&n.reportName.length>0){var s={reportName:n.reportName[n.reportName.length-1]};this.parent.trigger(pa,s,function(t){e.currentReport=t.reportName,e.parent.isModified=!1}),this.currentReport=n.reportName[n.reportName.length-1]}else this.currentReport="",this.parent.isModified=!1,this.action="";this.updateReportList(),this.parent.actionObj.actionName=zn,this.parent.actionObj.actionName&&this.parent.actionCompleteMethod()}else if("New"===this.action||"Save"!==this.action&&"Rename"!==this.action&&"New"!==this.action){if(this.currentReport&&""!==this.currentReport&&this.parent.isModified){var o={report:this.getCurrentReport(),reportName:this.currentReport};r={reportName:this.currentReport};this.parent.actionObj.actionInfo=r,this.parent.actionObj.actionName=Un,this.parent.actionObj.actionName&&this.parent.actionCompleteMethod(),this.parent.trigger(la,o),this.parent.isModified=!1,"New"===this.action?(this.parent.actionObj.actionName=Pr,this.createNewReport(this.newArgs)):(this.parent.actionObj.actionName=ln,this.reportLoad(this.dropArgs))}else if("New"===this.action){this.parent.trigger(ca);o={report:this.getCurrentReport(),reportName:this.currentReport};this.parent.trigger(la,o),this.parent.isModified=!1,this.updateReportList(),i.hide()}}else if("Save"===this.action){o={report:this.getCurrentReport(),reportName:this.currentReport};this.parent.trigger(la,o),this.parent.isModified=!1,this.updateReportList(),i.hide()}else if("Rename"===this.action){var l={reportName:this.currentReport,rename:this.renameText,isReportExists:!0};this.parent.trigger(ha,l),this.currentReport=this.renameText,this.parent.isModified=!1,this.updateReportList(),i.hide()}(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_ConfirmDialog",document),Bs.Dialog).hide()},e.prototype.cancelButtonClick=function(){var e=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"report-dialog",document),Bs.Dialog);if("New"===this.action)this.parent.isModified?this.createNewReport(this.newArgs):e.hide();else if("Save"===this.action){if((0,t.select)("#"+this.parent.element.id+"_reportlist",this.parent.element)){var i=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_reportlist",this.parent.element),Ws.DropDownList);this.currentReport=i.value}e.hide()}else"Rename"===this.action?e.hide():this.dropArgs&&"Remove"!==this.action&&this.reportLoad(this.dropArgs);(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_ConfirmDialog",document),Bs.Dialog).hide()},e.prototype.createChartMenu=function(){var e=this;if((0,t.select)("#"+this.parent.element.id+"chart_menu",this.parent.element)){for(var i=(0,t.select)("#"+this.parent.element.id+"chart_menu",this.parent.element),a=[],r=this.getValidChartType(),n=0;n<r.length&&n<7;n++){var s=r[n];a.push({text:this.parent.localeObj.getConstant("Column"===s?"columnChart":s.toLowerCase()),id:this.parent.element.id+"_"+s})}7===a.length&&(a.splice(6),a.push({text:this.parent.localeObj.getConstant("MoreOption"),id:this.parent.element.id+"_ChartMoreOption"}));var l=a.length<=0||"Table"===this.parent.displayOption.view;a.push({separator:!0}),a.push({text:this.parent.localeObj.getConstant("multipleAxes"),id:this.parent.element.id+"_multipleAxes"}),a.push({text:this.parent.localeObj.getConstant("showLegend"),id:this.parent.element.id+"_showLegend"});var d=[{iconCss:ti+" "+o,items:l?[]:a}],p=i?(0,t.getInstance)(i,Gs.Menu):null;p&&!p.isDestroyed&&(p.destroy(),p=null),(p=new Gs.Menu({items:d,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:mi+(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,p.isAngular=this.parent.isModalDialog,p.appendTo(i)}},e.prototype.create=function(){var e=this;if((0,t.select)("#"+this.parent.element.id+"chart_menu",this.parent.element)&&this.createChartMenu(),(0,t.select)("#"+this.parent.element.id+"export_menu",this.parent.element)){var i=(0,t.select)("#"+this.parent.element.id+"export_menu",this.parent.element),a=[{iconCss:"e-export "+o,items:[{text:this.parent.localeObj.getConstant("pdf"),iconCss:Yt+" "+o,id:this.parent.element.id+"pdf"},{text:this.parent.localeObj.getConstant("excel"),iconCss:Kt+" "+o,id:this.parent.element.id+"excel"},{text:this.parent.localeObj.getConstant("csv"),iconCss:Xt+" "+o,id:this.parent.element.id+"csv"},{text:this.parent.localeObj.getConstant("png"),iconCss:"e-pivotview-png-export "+o,id:this.parent.element.id+"png"},{text:this.parent.localeObj.getConstant("jpeg"),iconCss:"e-pivotview-jpeg-export "+o,id:this.parent.element.id+"jpeg"},{text:this.parent.localeObj.getConstant("svg"),iconCss:"e-pivotview-svg-export "+o,id:this.parent.element.id+"svg"}]}],r=new Gs.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:mi+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateExportMenu.bind(this),onClose:function(){e.focusToolBar()}});r.isStringTemplate=!0,r.isAngular=this.parent.isModalDialog,r.appendTo(i)}if((0,t.select)("#"+this.parent.element.id+"subtotal_menu",this.parent.element)){var n=(0,t.select)("#"+this.parent.element.id+"subtotal_menu",this.parent.element),s=(a=[{iconCss:"e-sub-total "+o,items:[{text:this.parent.localeObj.getConstant("showSubTotals"),id:this.parent.element.id+"subtotal",iconCss:pi+" "+o},{text:this.parent.localeObj.getConstant("doNotShowSubTotals"),id:this.parent.element.id+"notsubtotal",iconCss:pi+" "+o},{text:this.parent.localeObj.getConstant("showSubTotalsRowsOnly"),id:this.parent.element.id+"subtotalrow",iconCss:pi+" "+o},{text:this.parent.localeObj.getConstant("showSubTotalsColumnsOnly"),id:this.parent.element.id+"subtotalcolumn",iconCss:pi+" "+o},{separator:!0},{text:this.parent.localeObj.getConstant("subTotalPosition"),id:this.parent.element.id+"subtotalpositions",iconCss:di+" "+o,items:[{text:this.parent.localeObj.getConstant("auto"),id:this.parent.element.id+"sub-none-position",iconCss:pi+" "+o},{text:this.parent.localeObj.getConstant("top"),id:this.parent.element.id+"sub-top-position",iconCss:pi+" "+o},{text:this.parent.localeObj.getConstant("bottom"),id:this.parent.element.id+"sub-bottom-position",iconCss:pi+" "+o}]}]}],new Gs.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:mi+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateSubtotalSelection.bind(this),onClose:function(){e.focusToolBar()}}));s.isStringTemplate=!0,s.isAngular=this.parent.isModalDialog,s.appendTo(n)}if((0,t.select)("#"+this.parent.element.id+"grandtotal_menu",this.parent.element)){var l=(0,t.select)("#"+this.parent.element.id+"grandtotal_menu",this.parent.element),d=(a=[{iconCss:"e-grand-total "+o,items:[{text:this.parent.localeObj.getConstant("showGrandTotals"),id:this.parent.element.id+"grandtotal",iconCss:pi+" "+o},{text:this.parent.localeObj.getConstant("doNotShowGrandTotals"),id:this.parent.element.id+"notgrandtotal",iconCss:pi+" "+o},{text:this.parent.localeObj.getConstant("showGrandTotalsRowsOnly"),id:this.parent.element.id+"grandtotalrow",iconCss:pi+" "+o},{text:this.parent.localeObj.getConstant("showGrandTotalsColumnsOnly"),id:this.parent.element.id+"grandtotalcolumn",iconCss:pi+" "+o},{separator:!0},{text:this.parent.localeObj.getConstant("grandTotalPosition"),id:this.parent.element.id+"grandtotalpositions",iconCss:di+" "+o,items:[{text:this.parent.localeObj.getConstant("top"),id:this.parent.element.id+"top-position",iconCss:pi+" "+o},{text:this.parent.localeObj.getConstant("bottom"),id:this.parent.element.id+"bottom-position",iconCss:pi+" "+o}]}]}],new Gs.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:mi+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this),beforeOpen:this.updateGrandtotalSelection.bind(this),onClose:function(){e.focusToolBar()}}));d.isStringTemplate=!0,d.isAngular=this.parent.isModalDialog,d.appendTo(l)}if((0,t.select)("#"+this.parent.element.id+"formatting_menu",this.parent.element)){var p=(0,t.select)("#"+this.parent.element.id+"formatting_menu",this.parent.element),h=(a=[{iconCss:"e-pivot-format-menu "+o,items:[{text:this.parent.localeObj.getConstant("numberFormatMenu"),iconCss:"e-pivot-number-format-menu "+o,id:this.parent.element.id+"numberFormattingMenu"},{text:this.parent.localeObj.getConstant("conditionalFormattingMenu"),iconCss:"e-pivot-conditional-format-menu "+o,id:this.parent.element.id+"conditionalFormattingMenu"}]}],new Gs.Menu({items:a,enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:mi+(this.parent.cssClass?" "+this.parent.cssClass:""),select:this.menuItemClick.bind(this)}));h.isStringTemplate=!0,h.isAngular=this.parent.isModalDialog,h.appendTo(p)}var u={report:this.parent.getPersistData(),reportName:this.parent.localeObj.getConstant("defaultReport")};if(this.currentReport=this.parent.localeObj.getConstant("defaultReport"),this.parent.trigger(la,u),(0,t.select)("#"+this.parent.element.id+"_reportlist",this.parent.element)){var c=(0,t.select)("#"+this.parent.element.id+"_reportlist",this.parent.element),g=this.fetchReports(),m=new Ws.DropDownList({dataSource:g.reportName,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});m.isStringTemplate=!0,m.isAngular=this.parent.isModalDialog,m.appendTo(c)}this.updateItemElements()},e.prototype.getCurrentReport=function(){var e=this.parent.getPersistData();if("CSV"===this.parent.dataSourceSettings.type&&"Server"!==this.parent.dataSourceSettings.mode){var t=JSON.parse(e);t.dataSourceSettings.dataSource.splice(0,0,this.parent.engineModule.fields),e=JSON.stringify(t)}return e},e.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"))}},e.prototype.whitespaceRemove=function(e){var t=e.element.querySelector(".e-separator");t&&(t.style.margin="0px")},e.prototype.multipleAxesCheckbox=function(e){var i=this;if(this.parent.element.id+"_multipleAxes"===e.element.id){(n=(0,t.createElement)("input",{id:this.parent.element.id+"_checkBox"})).style.display="none",this.parent.element.appendChild(n);var a=new io.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(i.parent.element.id+"_multipleAxes").click()},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});e.element.innerText="",a.appendTo(n),["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)>-1&&!e.element.classList.contains(yt)?(e.element.classList.add(yt),a.disabled=!0):["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)<0&&e.element.classList.contains(yt)&&(e.element.classList.remove(yt),a.disabled=!1);var r=this.parent.element.querySelector("."+Ht+".e-multipleAxes");e.element.appendChild(r)}else if(this.parent.element.id+"_showLegend"===e.element.id){var n;(n=(0,t.createElement)("input",{id:this.parent.element.id+"_showLegendCheckBox"})).style.display="none",this.parent.element.appendChild(n);a=new io.CheckBox({label:this.parent.localeObj.getConstant("showLegend"),checked:this.getLableState(),cssClass:"e-showLegend"+(this.parent.cssClass?" "+this.parent.cssClass:""),change:function(){document.getElementById(i.parent.element.id+"_showLegend").click()},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer});e.element.innerText="",a.appendTo(n);r=this.parent.element.querySelector("."+Ht+".e-showLegend");e.element.appendChild(r)}},e.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},e.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"]},e.prototype.updateExportMenu=function(e){var i=[].slice.call(e.element.querySelectorAll("li"));"Table"===this.parent.currentView?((0,t.addClass)(i.slice(3),bt),(0,t.removeClass)(i.slice(1,3),bt)):((0,t.addClass)(i.slice(1,3),bt),(0,t.removeClass)(i.slice(3),bt))},e.prototype.updateSubtotalSelection=function(e){e.parentItem.id!==this.parent.element.id+"subtotalpositions"?((0,t.select)("#"+this.parent.element.id+"subtotal ."+pi,e.element).classList.contains(di)||(0,t.select)("#"+this.parent.element.id+"subtotal ."+pi,e.element).classList.add(di),(0,t.select)("#"+this.parent.element.id+"notsubtotal ."+pi,e.element).classList.contains(di)||(0,t.select)("#"+this.parent.element.id+"notsubtotal ."+pi,e.element).classList.add(di),(0,t.select)("#"+this.parent.element.id+"subtotalrow ."+pi,e.element).classList.contains(di)||(0,t.select)("#"+this.parent.element.id+"subtotalrow ."+pi,e.element).classList.add(di),(0,t.select)("#"+this.parent.element.id+"subtotalcolumn ."+pi,e.element).classList.contains(di)||(0,t.select)("#"+this.parent.element.id+"subtotalcolumn ."+pi,e.element).classList.add(di),this.parent.dataSourceSettings.showSubTotals&&this.parent.dataSourceSettings.showRowSubTotals&&!this.parent.dataSourceSettings.showColumnSubTotals?(0,t.select)("#"+this.parent.element.id+"subtotalrow ."+pi,e.element).classList.remove(di):this.parent.dataSourceSettings.showSubTotals&&!this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?(0,t.select)("#"+this.parent.element.id+"subtotalcolumn ."+pi,e.element).classList.remove(di):this.parent.dataSourceSettings.showSubTotals&&this.parent.dataSourceSettings.showRowSubTotals&&this.parent.dataSourceSettings.showColumnSubTotals?(0,t.select)("#"+this.parent.element.id+"subtotal ."+pi,e.element).classList.remove(di):this.parent.dataSourceSettings.showSubTotals&&(this.parent.dataSourceSettings.showRowSubTotals||this.parent.dataSourceSettings.showColumnSubTotals)||(0,t.select)("#"+this.parent.element.id+"notsubtotal ."+pi,e.element).classList.remove(di)):((0,t.select)("#"+this.parent.element.id+"sub-none-position ."+pi,e.element).classList.add(di),"Auto"===this.parent.dataSourceSettings.subTotalsPosition&&(0,t.select)("#"+this.parent.element.id+"sub-none-position ."+pi,e.element).classList.remove(di),(0,t.select)("#"+this.parent.element.id+"sub-top-position ."+pi,e.element).classList.add(di),"Top"===this.parent.dataSourceSettings.subTotalsPosition&&(0,t.select)("#"+this.parent.element.id+"sub-top-position ."+pi,e.element).classList.remove(di),(0,t.select)("#"+this.parent.element.id+"sub-bottom-position ."+pi,e.element).classList.add(di),"Bottom"===this.parent.dataSourceSettings.subTotalsPosition&&(0,t.select)("#"+this.parent.element.id+"sub-bottom-position ."+pi,e.element).classList.remove(di))},e.prototype.updateGrandtotalSelection=function(e){e.parentItem.id!==this.parent.element.id+"grandtotalpositions"?((0,t.select)("#"+this.parent.element.id+"grandtotal ."+pi,e.element).classList.contains(di)||(0,t.select)("#"+this.parent.element.id+"grandtotal ."+pi,e.element).classList.add(di),(0,t.select)("#"+this.parent.element.id+"notgrandtotal ."+pi,e.element).classList.contains(di)||(0,t.select)("#"+this.parent.element.id+"notgrandtotal ."+pi,e.element).classList.add(di),(0,t.select)("#"+this.parent.element.id+"grandtotalrow ."+pi,e.element).classList.contains(di)||(0,t.select)("#"+this.parent.element.id+"grandtotalrow ."+pi,e.element).classList.add(di),(0,t.select)("#"+this.parent.element.id+"grandtotalcolumn ."+pi,e.element).classList.contains(di)||(0,t.select)("#"+this.parent.element.id+"grandtotalcolumn ."+pi,e.element).classList.add(di),this.parent.dataSourceSettings.showGrandTotals&&this.parent.dataSourceSettings.showRowGrandTotals&&!this.parent.dataSourceSettings.showColumnGrandTotals?(0,t.select)("#"+this.parent.element.id+"grandtotalrow ."+pi,e.element).classList.remove(di):this.parent.dataSourceSettings.showGrandTotals&&!this.parent.dataSourceSettings.showRowGrandTotals&&this.parent.dataSourceSettings.showColumnGrandTotals?(0,t.select)("#"+this.parent.element.id+"grandtotalcolumn ."+pi,e.element).classList.remove(di):this.parent.dataSourceSettings.showGrandTotals&&this.parent.dataSourceSettings.showRowGrandTotals&&this.parent.dataSourceSettings.showColumnGrandTotals?(0,t.select)("#"+this.parent.element.id+"grandtotal ."+pi,e.element).classList.remove(di):this.parent.dataSourceSettings.showGrandTotals&&(this.parent.dataSourceSettings.showRowGrandTotals||this.parent.dataSourceSettings.showColumnGrandTotals)||(0,t.select)("#"+this.parent.element.id+"notgrandtotal ."+pi,e.element).classList.remove(di)):((0,t.select)("#"+this.parent.element.id+"top-position ."+pi,e.element).classList.add(di),"Top"===this.parent.dataSourceSettings.grandTotalsPosition&&(0,t.select)("#"+this.parent.element.id+"top-position ."+pi,e.element).classList.remove(di),(0,t.select)("#"+this.parent.element.id+"bottom-position ."+pi,e.element).classList.add(di),"Bottom"===this.parent.dataSourceSettings.grandTotalsPosition&&(0,t.select)("#"+this.parent.element.id+"bottom-position ."+pi,e.element).classList.remove(di))},e.prototype.updateReportList=function(){if((0,t.select)("#"+this.parent.element.id+"_reportlist",this.parent.element)){var e=this.fetchReports(),i=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_reportlist",this.parent.element),Ws.DropDownList);i.dataSource=e.reportName,""===this.currentReport&&i.dataSource.length>0?(i.value=i.dataSource[i.dataSource.length-1],i.text=i.dataSource[i.dataSource.length-1],this.currentReport=i.dataSource[i.dataSource.length-1]):(i.value=this.currentReport,i.text=this.currentReport),i.refresh()}},e.prototype.menuItemClick=function(e){var i,a=this,r={},n=(0,t.isNullOrUndefined)(e.item)||(0,t.isNullOrUndefined)(e.item.id)?"":e.item.id.split(this.parent.element.id+"_")[1],s=e.item.id===this.parent.element.id+"grid"?Ur: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"?Br:e.item.id===this.parent.element.id+"_multipleAxes"?_r:e.item.id===this.parent.element.id+"_showLegend"?Gr:e.item.id===this.parent.element.id+"pdf"?zr:e.item.id===this.parent.element.id+"png"?Wr:e.item.id===this.parent.element.id+"excel"?Qr:e.item.id===this.parent.element.id+"csv"?Yr:e.item.id===this.parent.element.id+"jpeg"?Kr:e.item.id===this.parent.element.id+"svg"?Xr:e.item.id===this.parent.element.id+"notsubtotal"?Jr:e.item.id===this.parent.element.id+"subtotalrow"?Zr:e.item.id===this.parent.element.id+"subtotalcolumn"?$r:e.item.id===this.parent.element.id+"subtotal"?en:e.item.id===this.parent.element.id+"notgrandtotal"?tn:e.item.id===this.parent.element.id+"grandtotalrow"?an:e.item.id===this.parent.element.id+"grandtotalcolumn"?rn:e.item.id===this.parent.element.id+"grandtotal"?nn:e.item.id===this.parent.element.id+"numberFormattingMenu"?sn:e.item.id===this.parent.element.id+"conditionalFormattingMenu"?on:"";if(this.parent.actionObj.actionName=s,!(""!==s&&"multipleAxes"!==n&&"showLegend"!==n&&"ChartMoreOption"!==n&&s!==Jr&&s!==Zr&&s!==$r&&s!==en&&s!==tn&&s!==an&&s!==rn&&s!==nn&&s!==En&&s!==Pn&&s!==Br)||!this.parent.actionBeginMethod()){(this.getAllChartItems().indexOf(n)>-1||"ChartMoreOption"===n||"multipleAxes"===n||"showLegend"===n)&&(i=n);try{switch(e.item.id){case this.parent.element.id+"grid":var o=(0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element),l=(0,t.getInstance)(o,Fo.Chart);if(l=(0,t.isNullOrUndefined)(l)?this.parent.chart:l,this.parent.grid&&l&&"Table"!==this.parent.displayOption.view&&("Both"!==this.parent.displayOption.view||"Table"!==this.parent.displayOption.primary)){this.parent.grid.element&&this.parent.grid.element.style&&(this.parent.grid.element.style.display=""),l.element&&l.element.style&&(l.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"));var d={toolbarInfo:{displayOption:this.parent.displayOption,gridSettings:this.parent.gridSettings}};this.parent.actionObj.actionInfo=d,this.parent.layoutRefresh()}break;case this.parent.element.id+"pdf":if((0,t.isNullOrUndefined)(this.parent.pdfExportModule)&&"Server"!==this.parent.dataSourceSettings.mode)return;"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":if((0,t.isNullOrUndefined)(this.parent.excelExportModule)&&"Server"!==this.parent.dataSourceSettings.mode)return;r={excelExportProperties:{fileName:"Export.xlsx"},isBlob:void 0,isMultipleExport:void 0,workbook:void 0},this.parent.trigger(Ri,r,function(e){a.parent.excelExport(e.excelExportProperties,e.isMultipleExport,e.workbook,e.isBlob)});break;case this.parent.element.id+"csv":if((0,t.isNullOrUndefined)(this.parent.excelExportModule)&&"Server"!==this.parent.dataSourceSettings.mode)return;r={excelExportProperties:{fileName:"Export.csv"},isBlob:!1,isMultipleExport:!1,workbook:void 0},this.parent.trigger(Ri,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":if(Hs.invokeActionMethod(this.parent,or,Jr,{toolbarInfo:{showSubTotals:!1}}))return;this.parent.setProperties({dataSourceSettings:{showSubTotals:!1,showColumnSubTotals:!1,showRowSubTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"subtotalrow":if(Hs.invokeActionMethod(this.parent,or,Zr,{toolbarInfo:{showRowSubTotals:!0}}))return;this.parent.setProperties({dataSourceSettings:{showSubTotals:!0,showColumnSubTotals:!1,showRowSubTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"subtotalcolumn":if(Hs.invokeActionMethod(this.parent,or,$r,{toolbarInfo:{showColumnSubTotals:!0}}))return;this.parent.setProperties({dataSourceSettings:{showSubTotals:!0,showColumnSubTotals:!0,showRowSubTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"subtotal":if(Hs.invokeActionMethod(this.parent,or,en,{toolbarInfo:{showSubTotals:!0}}))return;this.parent.setProperties({dataSourceSettings:{showSubTotals:!0,showColumnSubTotals:!0,showRowSubTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"notgrandtotal":if(Hs.invokeActionMethod(this.parent,or,tn,{toolbarInfo:{showGrandTotals:!1}}))return;this.parent.setProperties({dataSourceSettings:{showGrandTotals:!1,showColumnGrandTotals:!1,showRowGrandTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"grandtotalrow":if(Hs.invokeActionMethod(this.parent,or,an,{toolbarInfo:{showRowGrandTotals:!0}}))return;this.parent.setProperties({dataSourceSettings:{showGrandTotals:!0,showColumnGrandTotals:!1,showRowGrandTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"grandtotalcolumn":if(Hs.invokeActionMethod(this.parent,or,rn,{toolbarInfo:{showColumnGrandTotals:!0}}))return;this.parent.setProperties({dataSourceSettings:{showGrandTotals:!0,showColumnGrandTotals:!0,showRowGrandTotals:!1}},!0),this.parent.refreshData();break;case this.parent.element.id+"grandtotal":if(Hs.invokeActionMethod(this.parent,or,nn,{toolbarInfo:{showGrandTotals:!0}}))return;this.parent.setProperties({dataSourceSettings:{showGrandTotals:!0,showColumnGrandTotals:!0,showRowGrandTotals:!0}},!0),this.parent.refreshData();break;case this.parent.element.id+"top-position":if(Hs.invokeActionMethod(this.parent,or,En,{toolbarInfo:{grandTotalsPosition:"Top"}}))return;this.parent.setProperties({dataSourceSettings:{grandTotalsPosition:"Top"}},!0),this.parent.refreshData();break;case this.parent.element.id+"bottom-position":if(Hs.invokeActionMethod(this.parent,or,En,{toolbarInfo:{grandTotalsPosition:"Bottom"}}))return;this.parent.setProperties({dataSourceSettings:{grandTotalsPosition:"Bottom"}},!0),this.parent.refreshData();break;case this.parent.element.id+"sub-top-position":if(Hs.invokeActionMethod(this.parent,or,Pn,{toolbarInfo:{subTotalsPosition:"Top"}}))return;this.parent.setProperties({dataSourceSettings:{subTotalsPosition:"Top"}},!0),this.parent.refreshData();break;case this.parent.element.id+"sub-bottom-position":if(Hs.invokeActionMethod(this.parent,or,Pn,{toolbarInfo:{subTotalsPosition:"Bottom"}}))return;this.parent.setProperties({dataSourceSettings:{subTotalsPosition:"Bottom"}},!0),this.parent.refreshData();break;case this.parent.element.id+"sub-none-position":if(Hs.invokeActionMethod(this.parent,or,Pn,{toolbarInfo:{subTotalsPosition:"Auto"}}))return;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+"_"+i:if(e.item&&e.item.text)if("ChartMoreOption"===i){if(Hs.invokeActionMethod(this.parent,or,jr,{}))return;this.createChartTypeDialog(),this.parent.actionObj.actionName=""}else if("multipleAxes"===i){if(Hs.invokeActionMethod(this.parent,or,_r))return;this.parent.chartSettings.enableScrollOnMultiAxis&&(this.isMultiAxisChange=!0),this.parent.chartSettings.enableMultipleAxis=!this.parent.chartSettings.enableMultipleAxis,this.updateChartType(this.parent.chartSettings.chartSeries.type,!0),Hs.invokeActionMethod(this.parent,lr,this.parent.chartSettings.enableMultipleAxis?Ls:As,{toolbarInfo:{enableMultipleAxis:this.parent.chartSettings.enableMultipleAxis}})}else if(this.getAllChartItems().indexOf(i)>-1){if(Hs.invokeActionMethod(this.parent,or,Br,{toolbarInfo:{chartType:i}}))return;this.updateChartType(i,!1)}else if("showLegend"===i){if(Hs.invokeActionMethod(this.parent,or,Gr))return;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),Hs.invokeActionMethod(this.parent,lr,this.showLableState?Fs:Is,{toolbarInfo:{legendVisible:!this.showLableState}})}}}catch(e){this.parent.actionFailureMethod(e)}}},e.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(xr,this.createToolbar,this)},e.prototype.getValidChartType=function(){for(var e=[],t=0;t<=this.parent.chartTypes.length;t++){var i=this.parent.chartTypes[t];this.getAllChartItems().indexOf(i)>-1&&e.indexOf(i)<0&&e.push(i)}return e},e.prototype.createChartTypeDialog=function(){var e=this;this.isChartTypeDialogApplied=!1;var i=this.parent.element.appendChild((0,t.createElement)("div",{id:this.parent.element.id+"_ChartTypeDialog",className:"e-pivotchart-type-dialog"})),a=new Bs.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",position:{X:"center",Y:"center"},buttons:[{click:function(){e.chartTypeDialogUpdate()},isFlat:!1,buttonModel:{cssClass:ie+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){e.removeDialog()},isFlat:!1,buttonModel:{cssClass:ae+(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)});a.isStringTemplate=!0,a.isAngular=this.parent.isModalDialog,a.appendTo(i)},e.prototype.setChartTypeActionComplete=function(){Hs.invokeActionMethod(this.parent,lr,qr,{toolbarInfo:{chartType:this.parent.chartSettings.chartSeries.type,enableMultipleAxis:this.parent.chartSettings.enableMultipleAxis,multipleAxisMode:this.parent.chartSettings.multipleAxisMode,legendVisible:this.getLableState()}})},e.prototype.chartTypeDialogUpdate=function(){var e=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_ChartTypeOption"),Ws.DropDownList).value,i=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_DialogMultipleAxis"),io.CheckBox).checked,a=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_DialogShowLabel"),io.CheckBox).checked;this.parent.chart&&this.parent.chart.legendSettings&&(this.parent.chart.legendSettings.visible=a),this.chartLableState&&(this.parent.chart&&this.parent.chart.legendSettings&&(this.parent.chart.legendSettings.visible=a),this.parent.chartSettings.legendSettings?this.parent.chartSettings.legendSettings.visible=a:this.parent.setProperties({chartSettings:{legendSettings:{visible:a}}},!0)),this.updateChartType(e,!1),this.parent.chartSettings.enableMultipleAxis=i,this.parent.chartSettings.multipleAxisMode=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_AxisModeOption"),Ws.DropDownList).value,this.isChartTypeDialogApplied=!0,this.setChartTypeActionComplete(),((0,t.select)("#"+this.parent.element.id+"_ChartTypeDialog",document)?(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_ChartTypeDialog",document),Bs.Dialog):null).close()},e.prototype.updateChartType=function(e,i){if(this.getAllChartItems().indexOf(e)>-1){var a=(0,t.select)("#"+this.parent.element.id+"_chart",this.parent.element),r=(0,t.getInstance)(a,Fo.Chart);(r=(0,t.isNullOrUndefined)(r)?this.parent.chart:r)&&(this.parent&&this.parent.grid&&this.parent.grid.element&&this.parent.grid.element.style&&(this.parent.grid.element.style.display="none"),r.element&&r.element.style&&(r.element.style.display=""),this.parent.currentView="Chart",this.parent.setProperties({displayOption:{primary:"Chart"}},!0),this.parent.chartSettings.enableScrollOnMultiAxis&&this.parent.chartSettings.enableMultipleAxis&&(this.parent.element.querySelector("."+ii).style.width=(0,t.formatUnit)(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()),this.parent.element.querySelector("."+ii).style.height=(0,t.formatUnit)(this.parent.pivotChartModule.getChartHeight())),r.setProperties({width:(0,t.formatUnit)(this.parent.grid?this.parent.getGridWidthAsNumber():this.parent.getWidthAsNumber()),height:(0,t.formatUnit)(this.parent.pivotChartModule.getChartHeight())},!0),this.parent.chartSettings.chartSeries.type=e,i||r.refresh())}},e.prototype.getDialogContent=function(){var e=(0,t.createElement)("div",{className:"e-chart-type-div-content"}),i=(0,t.createElement)("div",{className:"e-chart-type-option-container"}),a=(0,t.createElement)("div",{className:"e-chart-type-checkbox-container"}),r=(0,t.createElement)("div",{className:"e-multiple-axes-mode-container"}),n=(0,t.createElement)("div",{className:"e-chart-type-option-text"});n.innerText=this.parent.localeObj.getConstant("ChartType");var s=(0,t.createElement)("div",{className:"e-multiple-axes-mode-text"});s.innerText=this.parent.localeObj.getConstant("multipleAxisMode");var o=(0,t.createElement)("div",{id:this.parent.element.id+"_ChartTypeOption"}),l=(0,t.createElement)("div",{id:this.parent.element.id+"_AxisModeOption"});i.appendChild(n),i.appendChild(o);for(var d=[],p=[{value:"Stacked",text:this.parent.localeObj.getConstant("stacked")},{value:"Single",text:this.parent.localeObj.getConstant("single")},{value:"Combined",text:this.parent.localeObj.getConstant("combined")}],h=this.getValidChartType(),u=0;u<h.length;u++)d.push({value:h[u],text:this.parent.localeObj.getConstant(h[u].toLowerCase())});var c=new Ws.DropDownList({dataSource:d,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:this.parent.chartSettings.chartSeries.type?this.parent.chartSettings.chartSeries.type:this.getValidChartType()[0],width:"100%",change:this.changeDropDown.bind(this),cssClass:this.parent.cssClass});c.isStringTemplate=!0,c.isAngular=this.parent.isModalDialog,c.appendTo(o),e.appendChild(i);var g=(0,t.createElement)("input",{id:this.parent.element.id+"_DialogMultipleAxis",attrs:{type:"checkbox"}});a.appendChild(g);var m=(0,t.createElement)("input",{id:this.parent.element.id+"_DialogShowLabel",attrs:{type:"checkbox"}});a.appendChild(m),e.appendChild(a),r.appendChild(s),r.appendChild(l),e.appendChild(r);var f=new Ws.DropDownList({dataSource:p,enableRtl:this.parent.enableRtl,locale:this.parent.locale,fields:{value:"value",text:"text"},value:this.parent.chartSettings.multipleAxisMode?this.parent.chartSettings.multipleAxisMode:"Stacked",width:"100%",enabled:this.parent.chartSettings.enableMultipleAxis,cssClass:this.parent.cssClass});return f.isStringTemplate=!0,f.isAngular=this.parent.isModalDialog,f.appendTo(l),e},e.prototype.changeDropDown=function(e){var i=JSON.parse(this.parent.getChartSettings()).chartSettings;if(i&&i.legendSettings&&void 0!==i.legendSettings.visible||((0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_DialogShowLabel"),io.CheckBox).checked=!0),["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(e.value.toString())>-1)(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_DialogMultipleAxis"),io.CheckBox).disabled=!0,(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_AxisModeOption"),Ws.DropDownList).enabled=!1;else{var a=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_DialogMultipleAxis"),io.CheckBox);a.disabled=!1,(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_AxisModeOption"),Ws.DropDownList).enabled=a.checked}},e.prototype.beforeOpen=function(){var e=this,i=new io.CheckBox({label:this.parent.localeObj.getConstant("multipleAxes"),cssClass:"e-dialog-multiple-axis"+(this.parent.cssClass?" "+this.parent.cssClass:""),checked:!!this.parent.chartSettings.enableMultipleAxis&&this.parent.chartSettings.enableMultipleAxis,change:function(i){(0,t.getInstance)((0,t.select)("#"+e.parent.element.id+"_AxisModeOption"),Ws.DropDownList).enabled=i.checked},enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer}),a=new io.CheckBox({label:this.parent.localeObj.getConstant("showLegend"),checked:this.getLableState(),change:function(){e.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}),r=(0,t.select)("#"+this.parent.element.id+"_ChartTypeDialog",document)?(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_ChartTypeDialog",document),Bs.Dialog):null;a.appendTo((0,t.select)("#"+this.parent.element.id+"_DialogShowLabel",r.element)),i.appendTo((0,t.select)("#"+this.parent.element.id+"_DialogMultipleAxis",r.element)),["Pie","Funnel","Pyramid","Doughnut","Pareto"].indexOf(this.parent.chartSettings.chartSeries.type)>-1&&(i.disabled=!0,(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_AxisModeOption"),Ws.DropDownList).enabled=!1);var n=JSON.parse(this.parent.getChartSettings()).chartSettings;n&&n.legendSettings&&void 0!==n.legendSettings.visible?this.chartLableState=!0:this.chartLableState=!1},e.prototype.refreshToolbar=function(){this.destroy(),this.createToolbar()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(xr,this.createToolbar)},e.prototype.destroy=function(){this.removeEventListener();var e=(0,t.select)("#"+this.parent.element.id+"_ConfirmDialog",document),i=e?(0,t.getInstance)(e,Bs.Dialog):null;i&&!i.isDestroyed&&(i.destroy(),i=null);var a=(e=(0,t.select)("#"+this.parent.element.id+"report-dialog",document))?(0,t.getInstance)(e,Bs.Dialog):null;a&&!a.isDestroyed&&(a.destroy(),a=null);var r=(e=(0,t.select)("#"+this.parent.element.id+"mdx-dialog",document))?(0,t.getInstance)(e,Bs.Dialog):null;r&&!r.isDestroyed&&(r.destroy(),r=null);var n=(e=(0,t.select)("#"+this.parent.element.id+"_ChartTypeDialog",document))?(0,t.getInstance)(e,Bs.Dialog):null;n&&!n.isDestroyed&&(n.destroy(),n=null),this.destroyToolbarComponents(),this.toolbar&&!this.toolbar.isDestroyed&&(this.toolbar.destroy(),this.toolbar=null),(e=(0,t.select)("#"+this.parent.element.id+"pivot-toolbar",document))&&(0,t.remove)(e),this.dropArgs=null,this.newArgs=null,this.currentReport=null},e.prototype.destroyToolbarComponents=function(){["#"+this.parent.element.id+"chart_menu","#"+this.parent.element.id+"export_menu","#"+this.parent.element.id+"subtotal_menu","#"+this.parent.element.id+"grandtotal_menu","#"+this.parent.element.id+"formatting_menu"].forEach(function(e){var i=(0,t.select)(e,document);if(i){var a=(0,t.getInstance)(i,Gs.Menu);a&&!a.isDestroyed&&a.destroy()}});var e=(0,t.select)("#"+this.parent.element.id+"_reportlist",document);if(e){var i=(0,t.getInstance)(e,Ws.DropDownList);i&&!i.isDestroyed&&i.destroy()}var a=(0,t.select)("#"+this.parent.element.id+"_ChartTypeOption",document);if(a){var r=(0,t.getInstance)(a,Ws.DropDownList);r&&!r.isDestroyed&&r.destroy()}var n=(0,t.select)("#"+this.parent.element.id+"_AxisModeOption",document);if(n){var s=(0,t.getInstance)(n,Ws.DropDownList);s&&!s.isDestroyed&&s.destroy()}["#"+this.parent.element.id+"_DialogMultipleAxis","#"+this.parent.element.id+"_DialogShowLabel","#"+this.parent.element.id+"_checkBox"].forEach(function(e){var i=(0,t.select)(e,document);if(i){var a=(0,t.getInstance)(i,io.CheckBox);a&&!a.isDestroyed&&a.destroy()}})},e.prototype.removeDialog=function(){this.isChartTypeDialogApplied||this.setChartTypeActionComplete(),this.isChartTypeDialogApplied=!1;var e=(0,t.select)("#"+this.parent.element.id+"_ChartTypeDialog",this.parent.element)?(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_ChartTypeDialog",this.parent.element),Bs.Dialog):null;if(e&&!e.isDestroyed){var i=(0,t.select)("#"+this.parent.element.id+"_ChartTypeOption",e.element)?(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_ChartTypeOption",e.element),Ws.DropDownList):null;i&&!i.isDestroyed&&i.destroy();var a=(0,t.select)("#"+this.parent.element.id+"_AxisModeOption",e.element)?(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_AxisModeOption",e.element),Ws.DropDownList):null;a&&!a.isDestroyed&&a.destroy();var r=(0,t.select)("#"+this.parent.element.id+"_DialogMultipleAxis",e.element)?(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_DialogMultipleAxis",e.element),io.CheckBox):null;r&&!r.isDestroyed&&r.destroy();var n=(0,t.select)("#"+this.parent.element.id+"_DialogShowLabel",e.element)?(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_DialogShowLabel",e.element),io.CheckBox):null;n&&!n.isDestroyed&&n.destroy(),e.destroy()}document.getElementById(this.parent.element.id+"_ChartTypeDialog")&&(0,t.remove)(document.getElementById(this.parent.element.id+"_ChartTypeDialog"))},e.prototype.focusToolBar=function(){(0,t.removeClass)(document.querySelector("."+Zt).querySelectorAll(".e-menu-item.e-focused"),"e-focused"),(0,t.removeClass)(document.querySelector("."+Zt).querySelectorAll(".e-menu-item.e-selected"),"e-selected"),document.querySelector(".e-toolbar-items")&&(0,t.addClass)([document.querySelector(".e-toolbar-items")],"e-focused")},e}(),Cd=function(){function e(e){this.parent=e,this.parent.numberFormattingModule=this,this.removeEventListener(),this.addEventListener(),this.newFormat=[],this.lastFormattedValue=[]}return e.prototype.getModuleName=function(){return"numberFormatting"},e.prototype.showNumberFormattingDialog=function(){var e,i=this,a=(0,t.createElement)("div",{id:this.parent.element.id+"_FormatDialog",className:"e-pivot-format-dialog"});this.parent.element.appendChild(a),this.dialog=new Bs.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:ie+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("apply"),isPrimary:!0}},{click:function(){i.dialog.hide()},isFlat:!1,buttonModel:{cssClass:ae+(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.isAngular=this.parent.isModalDialog,this.dialog.appendTo(a),this.dialog.element.querySelector("."+It).innerText=this.parent.localeObj.getConstant("numberFormat"),this.newFormat=[{name:this.parent.localeObj.getConstant("AllValues"),format:"N0",useGrouping:!0,type:void 0}];for(var r=[],n=0;n<this.parent.dataSourceSettings.formatSettings.length;n++)e={name:this.parent.dataSourceSettings.formatSettings[n].name,format:this.parent.dataSourceSettings.formatSettings[n].format,useGrouping:this.parent.dataSourceSettings.formatSettings[n].useGrouping,type:this.parent.dataSourceSettings.formatSettings[n].type},this.newFormat.push(e);for(n=0;n<this.newFormat.length;n++)r.push(this.newFormat[n].name);for(var s=0;s<this.parent.dataSourceSettings.values.length;s++)-1===r.indexOf(this.parent.dataSourceSettings.values[s].name)&&(e={name:this.parent.dataSourceSettings.values[s].name,format:"N0",useGrouping:!0},this.newFormat.push(e));this.renderControls()},e.prototype.getDialogContent=function(){var e=(0,t.createElement)("div",{id:this.parent.element.id+"_FormatDialogOuter",className:"e-pivot-format-dialog-outer"}),i=(0,t.createElement)("table",{id:this.parent.element.id+"_FormatTable",className:"e-pivot-format-table",attrs:{role:"tableItems"}}),a=(0,t.createElement)("tr"),r=(0,t.createElement)("td"),n=(0,t.createElement)("div",{id:this.parent.element.id+"_FormatValueLable",className:"e-pivot-format-value-lable"});n.innerText=this.parent.localeObj.getConstant("values");var s=(0,t.createElement)("div",{id:this.parent.element.id+"_FormatValueDrop"});r.appendChild(n),r.appendChild(s),a.appendChild(r),i.appendChild(a),a=(0,t.createElement)("tr"),r=(0,t.createElement)("td");var o=(0,t.createElement)("div",{id:this.parent.element.id+"_FormatLable",className:"e-pivot-format-lable"});o.innerText=this.parent.localeObj.getConstant("formatType");var l=(0,t.createElement)("div",{id:this.parent.element.id+"_FormatDrop"});r.appendChild(o),r.appendChild(l),a.appendChild(r),i.appendChild(a),a=(0,t.createElement)("tr"),r=(0,t.createElement)("td");var d=(0,t.createElement)("div",{id:this.parent.element.id+"_GroupingLable",className:"e-pivot-format-grouping-lable"});d.innerText=this.parent.localeObj.getConstant("grouping");var p=(0,t.createElement)("div",{id:this.parent.element.id+"_GroupingDrop"});r.appendChild(d),r.appendChild(p),a.appendChild(r),i.appendChild(a),a=(0,t.createElement)("tr"),r=(0,t.createElement)("td");var h=(0,t.createElement)("div",{id:this.parent.element.id+"_DecimalLable",className:"e-pivot-format-decimal-lable"});h.innerText=this.parent.localeObj.getConstant("decimalPlaces");var u=(0,t.createElement)("div",{id:this.parent.element.id+"_DecimalDrop"});return r.appendChild(h),r.appendChild(u),a.appendChild(r),i.appendChild(a),a=(0,t.createElement)("tr"),r=(0,t.createElement)("td"),this.customLable=(0,t.createElement)("div",{id:this.parent.element.id+"_CustomLable",className:"e-pivot-format-custom-lable"}),this.customLable.innerText=this.parent.localeObj.getConstant("customFormatString"),this.customText=(0,t.createElement)("input",{id:this.parent.element.id+"_CustomText",attrs:{type:"text",tabindex:"0"},className:Nt+" e-pivot-format-custom-text"}),r.appendChild(this.customLable),r.appendChild(this.customText),a.appendChild(r),i.appendChild(a),a=(0,t.createElement)("tr"),i.appendChild(a),e.appendChild(i),e},e.prototype.renderControls=function(){var e,i,a;if((0,t.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?t.SanitizeHtmlHelper.sanitize(s):s,r.push({index:n+1,name:s,field:this.parent.dataSourceSettings.values[n].name})}(e=new Ws.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.isAngular=this.parent.isModalDialog,e.appendTo((0,t.select)("#"+this.parent.element.id+"_FormatValueDrop",this.dialog.element))}if((0,t.select)("#"+this.parent.element.id+"_FormatDrop",this.dialog.element)){var o=[{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")}];(i=new Ws.DropDownList({dataSource:o,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,i.isAngular=this.parent.isModalDialog,i.appendTo((0,t.select)("#"+this.parent.element.id+"_FormatDrop",this.dialog.element))}if((0,t.select)("#"+this.parent.element.id+"_GroupingDrop",this.dialog.element)){o=[{index:0,name:this.parent.localeObj.getConstant("true")},{index:1,name:this.parent.localeObj.getConstant("false")}];(a=new Ws.DropDownList({dataSource:o,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,a.isAngular=this.parent.isModalDialog,a.appendTo((0,t.select)("#"+this.parent.element.id+"_GroupingDrop",this.dialog.element))}if((0,t.select)("#"+this.parent.element.id+"_DecimalDrop",this.dialog.element)){o=[{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}];var l=new Ws.DropDownList({dataSource:o,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)});l.isStringTemplate=!0,l.isAngular=this.parent.isModalDialog,l.appendTo((0,t.select)("#"+this.parent.element.id+"_DecimalDrop",this.dialog.element))}if(i.value!==this.parent.localeObj.getConstant("Custom")&&(this.customText.disabled=!0),0!==this.lastFormattedValue.length){e.value=this.lastFormattedValue[0].name;var d=this.lastFormattedValue[0].format,p=""===d?"":d.split("")[0].toLowerCase(),h=this.lastFormattedValue[0].useGrouping?this.parent.localeObj.getConstant("true"):this.parent.localeObj.getConstant("false");this.updateFormattingDialog(d,p,h)}},e.prototype.valueChange=function(e){for(var i=this.newFormat,a=!1,r=0;r<i.length;r++)if(i[r].name===e.value){var n=i[r].format,s=""===n?"":n.split("")[0].toLowerCase(),o=i[r].useGrouping?this.parent.localeObj.getConstant("true"):this.parent.localeObj.getConstant("false");this.updateFormattingDialog(n,s,o),a=!0;break}a||((0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_FormatDrop",this.parent.element),Ws.DropDownList).value=this.parent.localeObj.getConstant("number"),(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),Ws.DropDownList).value=0,(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),Ws.DropDownList).value=this.parent.localeObj.getConstant("true"))},e.prototype.updateFormattingDialog=function(e,i,a){var r=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_FormatDrop",this.parent.element),Ws.DropDownList);2===e.length&&["n","p","c"].indexOf(i)>-1?(r.value="n"===i?this.parent.localeObj.getConstant("number"):"p"===i?this.parent.localeObj.getConstant("percentage"):"c"===i?this.parent.localeObj.getConstant("currency"):this.parent.localeObj.getConstant("number"),(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),Ws.DropDownList).value=Number(e.split("")[1]),(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),Ws.DropDownList).value=a):(r.value=this.parent.localeObj.getConstant("Custom"),this.customText.value=e)},e.prototype.customUpdate=function(){if((0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_FormatDrop",this.parent.element),Ws.DropDownList).value===this.parent.localeObj.getConstant("Custom")){var e=this.getIndexValue();this.newFormat[e].format=this.customText.value}},e.prototype.dropDownChange=function(e){var i=this.getIndexValue(),a=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),Ws.DropDownList),r=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),Ws.DropDownList);if(e.value===this.parent.localeObj.getConstant("Custom"))this.customText.disabled=!1,a.enabled=!1,r.enabled=!1,this.newFormat[i].format=this.customText.value;else{var n=this.formattedText();this.newFormat[i].format=n,this.customText.disabled=!0,a.enabled=!0,r.enabled=!0,this.customText.value=""}},e.prototype.groupingChange=function(){var e=this.getIndexValue(),i=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),Ws.DropDownList);this.newFormat[e].useGrouping=i.value===this.parent.localeObj.getConstant("true")},e.prototype.getIndexValue=function(){for(var e=[],i=0;i<this.newFormat.length;i++)e.push(this.newFormat[i].name);var a=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_FormatValueDrop",this.parent.element),Ws.DropDownList);return e.indexOf(a.value.toString())},e.prototype.decimalChange=function(){var e=this.getIndexValue(),t=this.formattedText();this.newFormat[e].format=t},e.prototype.formattedText=function(){var e=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_FormatDrop",this.parent.element),Ws.DropDownList),i=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_DecimalDrop",this.parent.element),Ws.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")+i.value:this.customText.value},e.prototype.removeDialog=function(){this.dialog&&!this.dialog.isDestroyed&&this.dialog.destroy(),document.getElementById(this.parent.element.id+"_FormatDialog")&&(0,t.remove)(document.getElementById(this.parent.element.id+"_FormatDialog"))},e.prototype.updateFormatting=function(){var e=this,i=this.formattedText(),a=this.getIndexValue();this.newFormat=this.newFormat.splice(a,1);for(var r=(0,t.extend)([],this.newFormat,!0),n=this.parent.dataSourceSettings.formatSettings,s=0;s<n.length;s++)this.insertFormat(n[s].name,n[s].format,n[s].type,n[s].currency,n[s].useGrouping);var o=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_FormatValueDrop",this.parent.element),Ws.DropDownList);if(o.value===this.parent.localeObj.getConstant("AllValues"))for(s=0;s<this.parent.dataSourceSettings.values.length;s++)this.insertFormat(this.parent.dataSourceSettings.values[s].name,i);else this.insertFormat(o.value.toString(),i);var l={formatSettings:Hs.cloneFormatSettings(this.newFormat),formatName:o.value.toString(),cancel:!1};this.parent.trigger(ir,l,function(t){if(t.cancel)e.dialog.close(),e.parent.setProperties({dataSourceSettings:{formatSettings:r}},!0);else{if("olap"===e.parent.dataType)for(var i=function(i){var a=Hs.getFieldInfo(t.formatSettings[i].name,e.parent);e.parent.dataSourceSettings.calculatedFieldSettings.forEach(function(e){e.name===a.fieldName&&(e.formatString=t.formatSettings[i].format)})},a=0;a<t.formatSettings.length;a++)i(a);e.parent.setProperties({dataSourceSettings:{formatSettings:t.formatSettings}},!0);var n={numberFormattingInfo:e.parent.dataSourceSettings.formatSettings};e.parent.actionObj.actionInfo=n;try{e.parent.updateDataSource(),e.dialog.close()}catch(t){e.parent.setProperties({dataSourceSettings:{formatSettings:r}},!0),e.parent.pivotCommon.errorDialog.createErrorDialog(e.parent.localeObj.getConstant("error"),e.parent.localeObj.getConstant("invalidFormat")),e.parent.hideWaitingPopup()}}})},e.prototype.insertFormat=function(e,i,a,r,n){for(var s=!1,o=(0,t.getInstance)((0,t.select)("#"+this.parent.element.id+"_GroupingDrop",this.parent.element),Ws.DropDownList),l={name:e,format:i,useGrouping:(0,t.isNullOrUndefined)(n)?o.value===this.parent.localeObj.getConstant("true"):n,type:a,currency:r},d=this.newFormat,p=0;p<d.length;p++)d[p].name===e&&(d[p]=l,s=!0);s||d.push(l),this.lastFormattedValue=[],this.lastFormattedValue.push(l)},e.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Tr,this.showNumberFormattingDialog,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(Tr,this.showNumberFormattingDialog)},e.prototype.destroy=function(){this.dialog&&!this.dialog.isDestroyed&&(this.dialog.destroy(),this.dialog=null),this.removeEventListener()},e}(),xd=function(){function e(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,this.addEventListener()}return e.prototype.getModuleName=function(){return"grouping"},e.prototype.render=function(e){var t=e.target,i=e.option,a=e.parentElement;this.groupingActionType=e.groupingActionType;var r=[];this.parentElement=a,this.isUpdate=!1;var n=parseInt(t.getAttribute("aria-colindex"),10)-1,s=Number(t.getAttribute("index")),o=this.parent.engineModule.pivotValues[s][n],l=o.valueSort.axis.toString();(r=this.getSelectedCells(o.axis,l,o.actualText.toString())).push({axis:o.axis,fieldName:l,name:o.actualText.toString(),cellInfo:o}),-1!==i.replace(a.id,"").indexOf("_custom_group")?this.createGroupSettings(l,r):this.updateUnGroupSettings(l,r)},e.prototype.getSelectedOptions=function(e){for(var t=[],i=0,a=e;i<a.length;i++){var r=a[i];-1===Hs.inArray(r.name,t)&&t.push(r.name)}return t},e.prototype.createGroupSettings=function(e,t){var i=this.parent.engineModule.fieldList[e],a=this.getGroupSettings(e);if(t.length>0){var r=void 0,n=!1;if(i.isCustomField)if(a)a&&"Custom"===a.type?1===t.length?n=!0:(n=!1,r="custom"):a&&"Number"===a.type&&(n=!1,r="number");else{var s=this.getGroupSettings(e.replace(this.dateGroup,"")),o=this.getGroupSettings(e.replace(/_custom_group/g,""));s?(n=!1,r="date",e=e.replace(this.dateGroup,"")):o&&(n=1===t.length,r="custom")}else a?"Number"===a.type||"Date"===a.type?(n=!1,r="Date"===a.type?"date":"number"):"Custom"===a.type&&(n=1===t.length,r="custom"):"number"===i.type||-1!==["datetime","date"].indexOf(i.type)||this.isDateType(e)?(n=!1,r=1===t.length?-1!==["datetime","date"].indexOf(i.type)||this.isDateType(e)?"date":"number":"custom"):"string"===i.type&&(n=1===t.length,r="custom");n?(this.parent.pivotCommon.errorDialog.createErrorDialog(this.parent.localeObj.getConstant("warning"),this.parent.localeObj.getConstant("invalidSelection")),this.parent.grid.clearSelection()):r&&""!==r&&this.createGroupDialog(e,r,t)}},e.prototype.updateUnGroupSettings=function(e,t){var i=this.parent.engineModule.fieldList[e],a=Hs.cloneGroupSettings(this.parent.dataSourceSettings.groupSettings),r=this.getGroupSettings(e);if(t.length>0){var n=void 0;if(i.isCustomField)if(r)"Custom"===r.type&&(n="custom");else{var s=this.getGroupSettings(e.replace(this.dateGroup,"")),o=this.getGroupSettings(e.replace(/_custom_group/g,""));s?(n="date",e=e.replace(this.dateGroup,"")):o&&(n="custom")}else r&&("Number"!==r.type&&"Date"!==r.type||(n="Date"===r.type?"date":"number"));if("date"===n||"number"===n)a=this.validateSettings(e,a,n,[]);else if("custom"===n){var l=this.getSelectedOptions(t);a=this.validateSettings(e,a,n,l)}this.updateDateSource(a,n,e)}},e.prototype.updateDateSource=function(e,t,i){if(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();var a=Hs.getFieldInfo(i,this.parent);if("group"===this.groupingActionType){var r=e.find(function(e){return e.name===i});Hs.invokeActionMethod(this.parent,lr,fs,{groupingInfo:r},a)}else Hs.invokeActionMethod(this.parent,lr,vs,{groupingInfo:{}},a);this.groupingActionType=void 0}},e.prototype.removeGroupSettings=function(e,t,i,a){var r=a.indexOf(e);if(-1!==r)for(var n=i[r],s=0,o=n.customGroups.length;s<o;s++)if(n.customGroups[s]){var l=n.customGroups[s];-1!==Hs.inArray(l.groupName,t)&&(i=this.modifyParentGroupItems(e,i,[l.groupName],l.items,a),n.customGroups.splice(s,1),this.isUpdate=!0,s--,o--)}return delete this.parent.engineModule.groupingFieldsInfo[e],i},e.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}},e.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},e.prototype.getSelectedCells=function(e,t,i){for(var a=[],r=this.parent.element.querySelectorAll("."+jt+",."+qt),n=0;n<r.length;n++){var s=r[n],o=parseInt(s.getAttribute("aria-colindex"),10)-1,l=Number(s.getAttribute("index")),d=this.parent.engineModule.pivotValues[l][o];d&&d.axis===e&&"grand sum"!==d.type&&"sum"!==d.type&&d.valueSort.axis===t&&i!==d.actualText.toString()&&a.push({axis:d.axis,fieldName:d.valueSort.axis.toString(),name:d.actualText.toString(),cellInfo:d})}return a},e.prototype.createGroupDialog=function(e,i,a){var r=(0,t.createElement)("div",{id:this.parentElement.id+"_GroupDialog",className:"e-group-field-settings",attrs:{"data-field":e,"data-type":i}});this.parentElement.appendChild(r);var n=new Bs.Dialog({animationSettings:{effect:"Fade"},allowDragging:!0,header:this.parent.localeObj.getConstant("grouping"),content:this.createGroupOptions(e,i),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,a),isFlat:!1,buttonModel:{cssClass:ie+(this.parent.cssClass?" "+this.parent.cssClass:""),content:this.parent.localeObj.getConstant("ok"),isPrimary:!0}},{click:function(){n.hide()},isFlat:!1,buttonModel:{cssClass:ae+(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});n.isStringTemplate=!0,n.isAngular=this.parent.isModalDialog,n.appendTo(r)},e.prototype.createGroupOptions=function(e,i){var a=this,r=this,n=(0,t.createElement)("div",{className:"e-group-field-div-content",id:this.parentElement.id+"_group_field_div_content",attrs:{"data-fieldName":e,"data-type":i}}),s=(0,t.createElement)("div",{className:"e-group-option-container"});n.appendChild(s);var o=this.parent.dataSourceSettings,l=Hs.getFieldByName(e,o.groupSettings);switch(i){case"custom":var d=void 0,p=o.rows;p=p.concat(o.columns,o.values,o.filters);var h=Hs.getFieldByName(e.replace(/_custom_group/g,""),p);if((0,t.isNullOrUndefined)(h)&&!(0,t.isNullOrUndefined)(this.parent.clonedReport)){var u=this.parent.clonedReport,c=u.rows;c=c.concat(u.columns,u.values,u.filters),h=Hs.getFieldByName(e.replace(/_custom_group/g,""),c)}var g=Hs.getFieldByName(e,p),m=Hs.getFieldByName(e+"_custom_group",p);if(g){var f=e+"_custom_group";d=m?m.caption:this.parent.engineModule.fieldList[h.name].caption+(f.match(/_custom_group/g).length+1)}var v=(0,t.createElement)("div",{className:"e-caption-option-text"});v.innerText=this.parent.localeObj.getConstant("groupFieldCaption");var S=(0,t.createElement)("div",{className:"e-group-caption-container"}),y=(0,t.createElement)("input",{id:this.parentElement.id+"group_caption_option",className:"e-group-caption-text",attrs:{type:"text"}});S.appendChild(v),S.appendChild(y),s.appendChild(S);var b=(0,t.createElement)("div",{className:"e-input-option-text"});b.innerText=this.parent.localeObj.getConstant("groupTitle");var C=(0,t.createElement)("div",{className:"e-group-input-container"}),x=(0,t.createElement)("input",{id:this.parentElement.id+"group_input_option",className:"e-group-input-text",attrs:{type:"text"}});C.appendChild(b),C.appendChild(x),s.appendChild(C);var w=new zs.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("captionName"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,value:d,width:"100%",cssClass:this.parent.cssClass});w.isStringTemplate=!0,w.appendTo(y);var T=new zs.MaskedTextBox({placeholder:this.parent.localeObj.getConstant("groupName"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,width:"100%",cssClass:this.parent.cssClass});T.isStringTemplate=!0,T.appendTo(x);break;case"date":case"number":var M=(0,t.createElement)("div",{className:"e-group-start-option-container"}),D=(0,t.createElement)("input",{id:this.parentElement.id+"group_start_option",className:"e-group_start_option",attrs:{type:"checkbox"}}),O=(0,t.createElement)("input",{id:this.parentElement.id+"group_start_input",className:"e-group_start_input",attrs:{type:"text"}});M.appendChild(D),M.appendChild(O),s.appendChild(M);var N=(0,t.createElement)("div",{className:"e-group-end-option-container"}),P=(0,t.createElement)("input",{id:this.parentElement.id+"group_end_option",className:"e-group_end_option",attrs:{type:"checkbox"}}),E=(0,t.createElement)("input",{id:this.parentElement.id+"group_end_input",className:"e-group_end_input",attrs:{type:"text"}});N.appendChild(P),N.appendChild(E),s.appendChild(N);var I=(0,t.createElement)("div",{className:"e-group-interval-option-container"}),F=(0,t.createElement)("div",{className:"e-group-inerval-option-text"});F.innerText=this.parent.localeObj.getConstant("groupBy");var L=(0,t.createElement)("input",{id:this.parentElement.id+"group_interval_input",className:"e-group_interval_input",attrs:{type:"text"}});I.appendChild(F),I.appendChild(L),s.appendChild(I);var A=void 0,R=void 0;if("date"===i){var k=[],j=[{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")}];l&&"Date"===l.type?(k=l.groupInterval,A=l.startingAt?l.startingAt.toString():void 0,R=l.endingAt?l.endingAt.toString():void 0):k=["Months"],(H=new eo.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===A),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,H.appendTo(O),(V=new eo.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===R),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,V.appendTo(E),Ws.MultiSelect.Inject(Ws.CheckBoxSelection);var q=new Ws.MultiSelect({dataSource:j,value:k,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(){(0,t.getInstance)((0,t.select)("#"+r.parentElement.id+"_GroupDialog",document),Bs.Dialog).element.querySelector("."+ie).removeAttribute("disabled")},removed:function(){var e=q.liCollections,i=0;e.forEach(function(e){e.classList.contains("e-active")&&i++}),0===i&&(0,t.getInstance)((0,t.select)("#"+r.parentElement.id+"_GroupDialog",document),Bs.Dialog).element.querySelector("."+ie).setAttribute("disabled","disabled")}});q.isStringTemplate=!0,q.appendTo(L),H.value=void 0===A?null:new Date(A),H.dataBind(),V.value=void 0===R?null:new Date(R),V.dataBind()}else{var H,V,U=void 0;l&&"Number"===l.type?(U=l.rangeInterval,A=l.startingAt?l.startingAt.toString():void 0,R=l.endingAt?l.endingAt.toString():void 0):U=2,(H=new zs.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###.##########",value:void 0===A?void 0:parseFloat(A),enabled:!(void 0===A),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,H.appendTo(O),(V=new zs.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###.##########",value:void 0===R?void 0:parseFloat(R),enabled:!(void 0===R),width:"100%",cssClass:this.parent.cssClass})).isStringTemplate=!0,V.appendTo(E);var B=new zs.NumericTextBox({placeholder:this.parent.localeObj.getConstant("enterValue"),enableRtl:this.parent.enableRtl,locale:this.parent.locale,showClearButton:!0,format:"###.##########",min:0,value:U,width:"100%",cssClass:this.parent.cssClass});B.isStringTemplate=!0,B.appendTo(L)}var _=new io.CheckBox({label:this.parent.localeObj.getConstant("startAt"),checked:!(void 0===A),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,change:function(e){var r="date"===i?(0,t.getInstance)((0,t.select)("#"+a.parentElement.id+"group_start_input"),eo.DateTimePicker):(0,t.getInstance)((0,t.select)("#"+a.parentElement.id+"group_start_input"),zs.NumericTextBox);r.enabled=e.checked,r.dataBind()}});_.isStringTemplate=!0,_.appendTo(D);var G=new io.CheckBox({label:this.parent.localeObj.getConstant("endAt"),checked:!(void 0===R),enableRtl:this.parent.enableRtl,locale:this.parent.locale,enableHtmlSanitizer:this.parent.enableHtmlSanitizer,cssClass:this.parent.cssClass,change:function(e){var r="date"===i?(0,t.getInstance)((0,t.select)("#"+a.parentElement.id+"group_end_input"),eo.DateTimePicker):(0,t.getInstance)((0,t.select)("#"+a.parentElement.id+"group_end_input"),zs.NumericTextBox);r.enabled=e.checked,r.dataBind()}});G.isStringTemplate=!0,G.appendTo(P)}return n},e.prototype.updateGroupSettings=function(e){var i=(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"_GroupDialog",document),Bs.Dialog),a=i.element,r=a.getAttribute("data-type"),n=a.getAttribute("data-field"),s=Hs.cloneGroupSettings(this.parent.dataSourceSettings.groupSettings);if(0===s.length&&!this.parent.clonedDataSet&&!this.parent.clonedReport){var o=this.parent.engineModule.data;this.parent.clonedDataSet="CSV"===this.parent.dataSourceSettings.type?Hs.getClonedCSVData(o):Hs.getClonedData(o),this.parent.setProperties({dataSourceSettings:{dataSource:[]}},!0),this.parent.clonedReport=(0,t.extend)({},this.parent.dataSourceSettings,null,!0),this.parent.setProperties({dataSourceSettings:{dataSource:o}},!0)}if("custom"===r){var l=(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"group_input_option"),zs.MaskedTextBox),d=(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"group_caption_option"),zs.MaskedTextBox);if((0,t.removeClass)([l.element],Mt),null===l.value||""===l.value)return(0,t.addClass)([l.element],Mt),void l.element.focus();for(var p=this.getSelectedOptions(e),h={groupName:l.value,items:p},u=[],c=[],g={name:n,caption:d.value,type:"Custom",customGroups:[]},m=!1,f=0,v=s.length;f<v;f++)if(s[f].name===n){(g=s[f]).caption=d.value;for(var S=0,y=g.customGroups.length;S<y;S++)if(g.customGroups[S]){var b=g.customGroups[S];b.items&&zl.isContainCommonElements(b.items,p)&&(u=this.mergeArray(u,[b.groupName]),c=this.mergeArray(c,b.items),g.customGroups.splice(S,1),S--,y--)}for(var C=0,x=p;C<x.length;C++){var w=x[C],T=c.indexOf(w);-1!==T&&c.splice(T,1)}c=this.mergeArray(c,[h.groupName]),g.customGroups.push(h),this.isUpdate=!0,m=!0;break}m||(g.customGroups.push(h),this.isUpdate=!0,s.push(g)),s=this.validateSettings(n,s,r,0===u.length?h.items:u,c)}else if("date"===r||"number"===r){var M=(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"group_start_option"),io.CheckBox),D=(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"group_end_option"),io.CheckBox),O="date"===r?(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"group_start_input"),eo.DateTimePicker):(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"group_start_input"),zs.NumericTextBox),N="date"===r?(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"group_end_input"),eo.DateTimePicker):(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"group_end_input"),zs.NumericTextBox),P="date"===r?(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"group_interval_input"),Ws.MultiSelect):(0,t.getInstance)((0,t.select)("#"+this.parentElement.id+"group_interval_input"),zs.NumericTextBox);g={name:n,startingAt:M.checked?O.value.toString():void 0,endingAt:D.checked?N.value.toString():void 0};if("date"===r){for(var E=[],I=0,F=P.value;I<F.length;I++){var L=F[I];E.push(L)}g.type="Date",g.groupInterval=E}else g.type="Number",g.rangeInterval=P.value;for(m=!1,f=0,v=s.length;f<v;f++)if(s[f].name===n){s.splice(f,1,g),this.isUpdate=!0,m=!0;break}m||(this.isUpdate=!0,s.push(g)),s=this.validateSettings(n,s,r,[],[])}i.close(),this.updateDateSource(s,r,n)},e.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},e.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},e.prototype.validateSettings=function(e,t,i,a,r){var n=[],s=this.getGroupBasedSettings(t),o=["Date","Number","Custom"];if(s[o[2]]&&"custom"===i){var l=this.getGroupByName(s[o[2]]);if(l[e.replace(/_custom_group/g,"")]){var d=l[e.replace(/_custom_group/g,"")],p=d.map(function(e){return e.name});d=r?this.modifyParentGroupItems(e,d,a,r,p):this.removeGroupSettings(e.replace("_custom_group",""),a,d,p)}for(var h=[],u=0,c=Object.keys(l);u<c.length;u++){var g=c[u];p=l[g].map(function(e){return e.name});h=this.reOrderSettings(l[g],p,h,g,e)}s[o[2]]=h}else if(("date"===i||"number"===i)&&!r){var m="date"===i?s[o[0]]:s[o[1]];if("date"===i){s[o[0]]=m.filter(function(t){return t.name!==e});var f=["_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[o[0]].length){delete this.parent.engineModule.groupingFieldsInfo[e];var v=function(t){f.some(function(i){return t===""+e+i})&&delete S.parent.engineModule.groupingFieldsInfo[t]},S=this;for(var y in this.parent.engineModule.groupingFieldsInfo)v(y);var b=function(t){f.some(function(i){return t===""+e+i})&&delete C.parent.engineModule.fieldList[t]},C=this;for(var y in this.parent.engineModule.fieldList)b(y);var x=this.parent.engineModule.fields.filter(function(t){return!f.some(function(i){return t===""+e+i})});this.parent.engineModule.fields=x}}else s[o[1]]=m.filter(function(t){return t.name!==e});this.isUpdate=!0}for(var w=0,T=o;w<T.length;w++){var M=T[w];s[M]&&(n=n.concat(s[M]))}return n},e.prototype.reOrderSettings=function(e,i,a,r,n){var s=i.indexOf(r);if(s>-1&&e[s].customGroups&&e[s].customGroups.length>0)a.push(e[s]),this.reOrderSettings(e,i,a,r+"_custom_group");else if(s>-1&&e[s].customGroups&&0===e[s].customGroups.length&&!(0,t.isNullOrUndefined)(n)){delete this.parent.engineModule.fieldList[n],delete this.parent.engineModule.groupingFieldsInfo[n];var o=this.parent.engineModule.fields.filter(function(e){return e!==n});this.parent.engineModule.fields=o}return a},e.prototype.modifyParentGroupItems=function(e,t,i,a,r){var n=r.indexOf(e+"_custom_group");if(-1!==n){var s=t[n];if(s.customGroups&&s.customGroups.length>0)for(var o=0,l=s.customGroups.length;o<l;o++)if(s.customGroups[o]){var d=!1,p=s.customGroups[o];if(p.items){for(var h=0,u=i;h<u.length;h++){var c=u[h],g=p.items.indexOf(c);-1!==g&&(p.items.splice(g,1),this.isUpdate=!0,d=!0)}d&&(p.items=this.mergeArray(p.items,a))}}}return t},e.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},e.prototype.removeDialog=function(){if(!(this.parent.grid&&this.parent.grid.isDestroyed||(0,t.isNullOrUndefined)(this.parent.grid))){this.parent.grid.clearSelection();var e=(0,t.select)("#"+this.parent.element.id+"_GroupDialog",document),i=e?(0,t.getInstance)(e,Bs.Dialog):null;i&&!i.isDestroyed&&i.destroy(),this.parent.element&&document.getElementById(this.parent.element.id+"_GroupDialog")&&(0,t.remove)(document.getElementById(this.parent.element.id+"_GroupDialog"))}},e.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(Mr,this.render,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.removeDialog(),this.parent.off(Mr,this.render))},e.prototype.destroy=function(){this.removeEventListener()},e}()})(),S})());