@syncfusion/ej2-grids 35.2.13 → 35.2.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,11 @@
1
+ /*!
2
+ * filename: ej2-grids.umd.min.js
3
+ * version : 35.2.14
4
+ * Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
5
+ * Use of this code is subject to the terms of our license.
6
+ * A copy of the current license can be obtained at any time by e-mailing
7
+ * licensing@syncfusion.com. Any infringement will be prosecuted under
8
+ * applicable laws.
9
+ */
1
10
  !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@syncfusion/ej2-base"),require("@syncfusion/ej2-data"),require("@syncfusion/ej2-popups"),require("@syncfusion/ej2-buttons"),require("@syncfusion/ej2-inputs"),require("@syncfusion/ej2-dropdowns"),require("@syncfusion/ej2-calendars"),require("@syncfusion/ej2-navigations"),require("@syncfusion/ej2-querybuilder"),require("@syncfusion/ej2-excel-export"),require("@syncfusion/ej2-pdf-export")):"function"==typeof define&&define.amd?define(["exports","@syncfusion/ej2-base","@syncfusion/ej2-data","@syncfusion/ej2-popups","@syncfusion/ej2-buttons","@syncfusion/ej2-inputs","@syncfusion/ej2-dropdowns","@syncfusion/ej2-calendars","@syncfusion/ej2-navigations","@syncfusion/ej2-querybuilder","@syncfusion/ej2-excel-export","@syncfusion/ej2-pdf-export"],t):t((e=e||self).ej={},e.ej2Base,e.ej2Data,e.ej2Popups,e.ej2Buttons,e.ej2Inputs,e.ej2Dropdowns,e.ej2Calendars,e.ej2Navigations,e.ej2Querybuilder,e.ej2ExcelExport,e.ej2PdfExport)}(this,function(oe,H,V,F,M,k,P,L,B,z,q,x){"use strict";G.prototype.getFormatFunction=function(e){return H.isNullOrUndefined(e)||"dateTime"!==e.type&&"datetime"!==e.type&&"date"!==e.type&&"time"!==e.type?this.intl.getNumberFormat(e):this.intl.getDateFormat(e)},G.prototype.getParserFunction=function(e){return e.type?this.intl.getDateParser(e):this.intl.getNumberParser(e)},G.prototype.fromView=function(e,t,i){return"date"!==i&&"datetime"!==i&&"number"!==i||H.isNullOrUndefined(t)||H.isNullOrUndefined(e)?e:t(e)},G.prototype.toView=function(e,t){var i=e;return i=H.isNullOrUndefined(t)||H.isNullOrUndefined(e)?i:t(e)},G.prototype.setCulture=function(e){H.isNullOrUndefined(e)||H.setCulture(e)};var U=G;function G(e){this.intl=new H.Internationalization,H.isNullOrUndefined(e)||(this.intl.culture=e)}_=function(e,t){return(_=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var _,K=function(e,t){function i(){this.constructor=e}_(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},W=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(o=(s<3?r(o):3<s?r(t,i,o):r(t,i))||o);return 3<s&&o&&Object.defineProperty(t,i,o),o},Q=(X.prototype.getSortDirection=function(){return this.sortDirection},X.prototype.setSortDirection=function(e){this.sortDirection=e},X.prototype.getFreezeTableName=function(){return this.freezeTable},X.prototype.setProperties=function(n){for(var r=Object.keys(n),e=function(e){if("columns"===r[parseInt(e.toString(),10)])for(var i=n[r[parseInt(e.toString(),10)]],t=0;t<i.length;t++)!function(t){s.columns.find(function(e){return e.field===i[parseInt(t.toString(),10)].field}).setProperties(i[parseInt(t.toString(),10)])}(t);else s[r[parseInt(e.toString(),10)]]=n[r[parseInt(e.toString(),10)]];s.parent&&s.parent.isReact&&("template"===r[parseInt(e.toString(),10)]?(s.templateFn=hp(n[r[parseInt(e.toString(),10)]]),s.parent.refreshReactColumnTemplateByUid(s.uid,!0)):"headerTemplate"===r[parseInt(e.toString(),10)]?(s.headerTemplateFn=hp(n[r[parseInt(e.toString(),10)]]),s.parent.refreshReactHeaderTemplateByUid(s.uid)):"editTemplate"===r[parseInt(e.toString(),10)]?s.editTemplateFn=hp(n[r[parseInt(e.toString(),10)]]):"filterTemplate"===r[parseInt(e.toString(),10)]?s.filterTemplateFn=hp(n[r[parseInt(e.toString(),10)]]):"commandsTemplate"===r[parseInt(e.toString(),10)]&&(s.templateFn=hp(n[r[parseInt(e.toString(),10)]])))},s=this,t=0;t<r.length;t++)e(t)},X.prototype.isForeignColumn=function(){return!(!this.dataSource||!this.foreignKeyValue)},X.prototype.isFormulaColumn=function(){return this.allowFormula},X.prototype.getFormatter=function(){return this.formatFn},X.prototype.setFormatter=function(e){this.formatFn=e},X.prototype.getParser=function(){return this.parserFn},X.prototype.setParser=function(e){this.parserFn=e},X.prototype.getColumnTemplate=function(){return this.templateFn},X.prototype.getHeaderTemplate=function(){return this.headerTemplateFn},X.prototype.getFilterItemTemplate=function(){return this.fltrTemplateFn},X.prototype.getDomSetter=function(){return this.disableHtmlEncode?"textContent":"innerHTML"},X);function X(e,t){var s,o=this,t=(this.disableHtmlEncode=!0,this.enableRowSpan=!0,this.enableColumnSpan=!0,this.allowSorting=!0,this.allowResizing=!0,this.allowFiltering=!0,this.allowGrouping=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.enableGroupByFormat=!1,this.allowEditing=!0,this.filter={},this.showInColumnChooser=!0,this.edit={},this.allowSearching=!0,this.autoFit=!1,this.sortDirection="Descending",this.getEditTemplate=function(){return o.editTemplateFn},this.getFilterTemplate=function(){return o.filterTemplateFn},this.templateOptions={enableAriaLabel:!0},H.merge(this,e),this.parent=t,"none"===this.type?this.type=null:this.type&&(this.type="string"==typeof this.type?this.type.toLowerCase():void 0),this.editType&&(this.editType=this.editType.toLowerCase()),H.isNullOrUndefined(this.uid)&&(this.uid=bp("grid-column")),new U);e.format&&(e.format.skeleton||e.format.format&&"string"==typeof e.format.format)&&(this.setFormatter(t.getFormatFunction(H.extend({},e.format))),this.setParser(t.getParserFunction(e.format))),this.toJSON=function(){for(var e={},t=["filter","dataSource","headerText","template","headerTemplate","edit","editTemplate","filterTemplate","commandsTemplate","parent"],i=Object.keys(o),n=0;n<i.length;n++)if("columns"===i[parseInt(n.toString(),10)]){e[i[parseInt(n.toString(),10)]]=[];for(var r=0;r<o[i[parseInt(n.toString(),10)]].length;r++)e[i[parseInt(n.toString(),10)]].push(o[i[parseInt(n.toString(),10)]][parseInt(r.toString(),10)].toJSON())}else t.indexOf(i[parseInt(n.toString(),10)])<0&&(e[i[parseInt(n.toString(),10)]]=o[i[parseInt(n.toString(),10)]]);return e},this.field||(this.allowFiltering=!1,this.allowGrouping=!1,this.allowSorting=!1,this.enableColumnSpan=!1,this.enableRowSpan=!1,this.columns&&(this.allowResizing=this.columns.some(function(e){return e.allowResizing}))),this.commands&&!this.textAlign&&(this.textAlign="Right"),(this.template||this.commandsTemplate)&&(this.templateFn=hp(this.template||this.commandsTemplate)),this.headerTemplate&&(this.headerTemplateFn=hp(this.headerTemplate)),!H.isNullOrUndefined(this.filter)&&this.filter.itemTemplate&&(this.fltrTemplateFn=hp(this.filter.itemTemplate)),this.editTemplate&&(this.editTemplateFn=hp(this.editTemplate)),this.filterTemplate&&(this.filterTemplateFn=hp(this.filterTemplate)),this.isForeignColumn()&&(H.isNullOrUndefined(this.editType)||"dropdownedit"===this.editType||"defaultedit"===this.editType)&&(this.editType="dropdownedit",this.edit.params&&this.edit.params.dataSource&&(this.edit.params.ddEditedData=!0),this.edit.params=H.extend({dataSource:this.dataSource,query:new V.Query,fields:{value:this.foreignKeyField||this.field,text:this.foreignKeyValue}},this.edit.params)),this.sortComparer&&(s=this.sortComparer,this.sortComparer=function(e,t,i,n){var r;return"string"==typeof s&&(s=N(s,window)),"Descending"===o.sortDirection&&(r=e,e=t,t=r,r=i,i=n,n=r),s(e,t,i,n)}),!this.sortComparer&&this.isForeignColumn()&&(this.sortComparer=function(e,t){return e=N(o.foreignKeyValue,$p(o,{},e)[0]),t=N(o.foreignKeyValue,$p(o,{},t)[0]),"Descending"===o.sortDirection?V.DataUtil.fnDescending(e,t):V.DataUtil.fnAscending(e,t)}),!this.sortComparer&&this.isFormulaColumn()&&(this.sortComparer=function(e,t,i,n){var r,s;return i&&n&&o.parent&&(s=o.parent.getPrimaryKeyFieldNames()[0])&&(r=i[""+s],s=n[""+s],t=H.isNullOrUndefined(r)||H.isNullOrUndefined(s)?(e=i[o.field],n[o.field]):(e="string"==typeof e&&e.trim().startsWith("=")?o.parent.getFormulaValue(r,o.field):e,"string"==typeof t&&t.trim().startsWith("=")?o.parent.getFormulaValue(s,o.field):t)),"Descending"===o.sortDirection?V.DataUtil.fnDescending(e,t):V.DataUtil.fnAscending(e,t)}),!this.filterComparer&&this.isFormulaColumn()&&(this.filterComparer=function(e,t){var i=o.parent.getColumnByField(e);if(!i||!i.allowFormula)return V.DataUtil.getObject(e,t);i=o.parent.getPrimaryKeyFieldNames()[0];if(i){i=t[""+i],t=t[""+e];if("string"!=typeof t||!t.trim().startsWith("="))return t;if(!H.isNullOrUndefined(i))return o.parent.getFormulaValue(i,e)}})}W([H.Property()],$.prototype,"title",void 0),W([H.Property()],$.prototype,"type",void 0),W([H.Property()],$.prototype,"buttonOption",void 0);var Y=$;function $(){}K(J,Z=Q),W([H.Property(null)],J.prototype,"columns",void 0);var Z,W=J;function J(){return null!==Z&&Z.apply(this,arguments)||this}K(te,ee=W);var ee,K=te;function te(){return null!==ee&&ee.apply(this,arguments)||this}(t=oe.CellType||(oe.CellType={}))[t.Data=0]="Data",t[t.Header=1]="Header",t[t.Summary=2]="Summary",t[t.GroupSummary=3]="GroupSummary",t[t.CaptionSummary=4]="CaptionSummary",t[t.Filter=5]="Filter",t[t.Indent=6]="Indent",t[t.GroupCaption=7]="GroupCaption",t[t.GroupCaptionEmpty=8]="GroupCaptionEmpty",t[t.Expand=9]="Expand",t[t.HeaderIndent=10]="HeaderIndent",t[t.StackedHeader=11]="StackedHeader",t[t.DetailHeader=12]="DetailHeader",t[t.DetailExpand=13]="DetailExpand",t[t.CommandColumn=14]="CommandColumn",t[t.DetailFooterIntent=15]="DetailFooterIntent",t[t.RowDragIcon=16]="RowDragIcon",t[t.RowDragHIcon=17]="RowDragHIcon",t[t.PinnedIndent=18]="PinnedIndent",(t=oe.RenderType||(oe.RenderType={}))[t.Header=0]="Header",t[t.Content=1]="Content",t[t.Summary=2]="Summary",(t=oe.ToolbarItem||(oe.ToolbarItem={}))[t.Add=0]="Add",t[t.Edit=1]="Edit",t[t.Update=2]="Update",t[t.Delete=3]="Delete",t[t.Cancel=4]="Cancel",t[t.Print=5]="Print",t[t.Search=6]="Search",t[t.Find=7]="Find",t[t.ColumnChooser=8]="ColumnChooser",t[t.PdfExport=9]="PdfExport",t[t.ExcelExport=10]="ExcelExport",t[t.CsvExport=11]="CsvExport",t[t.WordExport=12]="WordExport",(t=oe.ResponsiveDialogAction||(oe.ResponsiveDialogAction={}))[t.isEdit=0]="isEdit",t[t.isAdd=1]="isAdd",t[t.isSort=2]="isSort",t[t.isFilter=3]="isFilter",t[t.isColMenu=4]="isColMenu",t[t.isColumnChooser=5]="isColumnChooser",(t=oe.ResponsiveToolbarAction||(oe.ResponsiveToolbarAction={}))[t.isInitial=0]="isInitial",t[t.isSearch=1]="isSearch";var ie="load",ne="rowDataBound",re="queryCellInfo",se="headerCellInfo",y="actionBegin",c="actionComplete",ae="actionFailure",le="advancedFilterBegin",he="advancedFilterComplete",de="dataBound",pe="rowSelecting",ce="rowSelected",ue="rowDeselecting",ge="rowDeselected",fe="cellSelecting",me="cellSelected",ye="cellDeselecting",ve="cellDeselected",Se="columnSelecting",Ce="columnSelected",we="columnDeselecting",be="columnDeselected",Ie="columnDragStart",Re="columnDrag",xe="columnDrop",De="rowDragStartHelper",Te="rowDragStart",Ee="rowDrag",Oe="rowDrop",Ae="beforePrint",Fe="printComplete",Me="detailDataBound",ke="detailExpand",Pe="detailCollapse",Le="detailExpanded",Ne="detailCollapsed",Be="toolbarClick",ze="batchAdd",qe="batchCancel",Ue="batchDelete",He="beforeBatchAdd",Ve="beforeBatchDelete",je="beforeBatchSave",Ge="beginEdit",_e="cellEdit",Ke="cellSave",We="cellSaved",Qe="recordDoubleClick",Xe="recordClick",Ye="beforeDataBound",$e="beforeOpenColumnChooser",Ze="beforeOpenAdaptiveDialog",Je="resizeStart",et="resizing",tt="resizeStop",it="checkBoxChange",nt="beforeCopy",rt="beforePaste",st="beforeAutoFill",ot="filterchoicerequest",at="filterAfterOpen",lt="filterBeforeOpen",ht="filterSearchBegin",dt="commandClick",pt="exportGroupCaption",ct="lazyLoadGroupExpand",ut="lazyLoadGroupCollapse",gt="cellFocus",ft="initial-load",mt="initial-end",yt="data-ready",vt="content-ready",St="ui-update",Ct="on-empty",wt="inbound-model-changed",bt="model-changed",It="colgroup-refresh",Rt="header-refreshed",xt="paging-complete",Dt="sorting-complete",Tt="filtering-complete",Et="searching-complete",Ot="findChange",At="findNavigate",Ft="reorder-complete",Mt="rowdraganddrop-complete",kt="grouping-complete",Pt="ungrouping-complete",Lt="group-aggregates",Nt="refresh-footer-rendered",Bt="refresh-aggregate-cell",zt="refresh-aggregates",qt="rowselected",Ut="cellselected",Ht="destroy-autofill-elements",Vt="beforecellfocused",jt="cellfocused",Gt="key-pressed",_t="click",s="destroy",Kt="column-visible-changed",Wt="scroll",Qt="column-width-changed",Xt="column-position-changed",Yt="rows-added",$t="rows-removed",Zt="column-drag-stop",Jt="header-drop",ei="datasource-modified",ti="refresh-complete",ii="refresh-virtual-block",ni="dblclick",ri="toolbar-refresh",si="bulk-save",oi="auto-col",ai="tooltip-destroy",li="update-data",hi="save-complete",di="delete-complete",pi="refresh-aggregate-on-save-complete",ci="prevent-batch",ui="dialog-destroy",gi="crud-Action",fi="add-delete-Action",mi="destroy-form",yi="double-tap",vi="beforeExcelExport",Si="excelExportComplete",Ci="excelQueryCellInfo",wi="excelHeaderQueryCellInfo",bi="exportDetailDataBound",Ii="exportDetailTemplate",Ri="beforePdfExport",xi="pdfExportComplete",Di="pdfQueryCellInfo",Ti="pdfHeaderQueryCellInfo",Ei="contextMenuClick",Oi="freezerender",Ai="contextMenuOpen",Fi="contextMenuClose",Mi="columnMenuClick",ki="columnMenuOpen",Pi="columnMenuClose",Li="filterOpen",Ni="filterDialogCreated",Bi="filter-menu-close",zi="initForeignKeyColumn",qi="getForeignKeyData",Ui="generateQuery",Hi="showEmptyGrid",Vi="foreignKeyData",ji="columnDataStateChange",Gi="dataStateChange",_i="dataSourceChanged",Ki="rtl-updated",Wi="beforeFragAppend",Qi="textWrapRefresh",Xi="recordAdded",Yi="cancel-Begin",$i="editNextValCell",Zi="hierarchyprint",Ji="expandchildgrid",en="printGrid-Init",tn="export-RowDataBound",nn="export-DataBound",rn="row-position-changed",sn="columnChooserOpened",on="batchedit-form",an="edit-form",ln="before-batch-cancel",hn="batcheditform-rendered",dn="partial-refresh",pn="beforeCustomFilterOpen",cn="customFilterOpen",un="select-virtual-Row",gn="columns-prepared",fn="cbox-filter-begin",mn="cbox-filter-complete",yn="filter-Prevent",vn="before-filter-cmenu-open",Sn="validation-custom-placement",Cn="filter-cbox-value",wn="restore-Focus",bn="detail-state-change",In="detail-indentcell-info",Rn="virtaul-cell-focus",xn="dom-virtual-tab-focus",Dn="virtual-scroll-edit-action-begin",Tn="virtual-scroll-edit-success",En="virtual-scroll-edit-cancel",On="virtual-scroll-edit",An="refresh-virtual-cache",Fn="edit-reset",Mn="virtual-scroll-add-action-begin",kn="get-virtual-data",Pn="refresh-infinite-mode-blocks",Ln="reset-infinite-blocks",Nn="infinite-scroll-handler",Bn="infinite-page-query",zn="infinite-show-hide",qn="append-infinite-content",Un="remove-infinite-rows",Hn="set-infinite-cache",Vn="infinite-edit-handler",jn="initial-collapse",Gn="close-filter-dialog",_n="columnChooserCancelBtnClick",Kn="get-filterbar-operator",Wn="reset-columns",Qn="pdfAggregateQueryCellInfo",Xn="excelAggregateQueryCellInfo",Yn="group-cache",$n="lazy-load-scroll-handler",Zn="group-collapse",Jn="beforeCheckboxRenderer",er="refreshResizeHandlers",tr="refresh-frozen-columns",ir="set-reorder-destination-element",nr="refresh-virtual-frozen-height",rr="set-freeze-selection",sr="before-refresh-on-data-change",or="immutable-batch-cancel",ar="refresh-virtual-frozenrows",lr="check-scroll-reset",hr="prevent-frozen-scroll-refresh",dr="next-cell-index",pr="refresh-infinite-current-view-data",cr="infinite-crud-cancel",ur="filter-dialog-close",gr="refresh-cutsom-filter-ok-button",fr="refresh-cutsom-filter-clear-button",mr="render-responsive-cmenu",yr="filter-cmenu-select",vr="custom-filter-close",Sr="set-fullscreen-dialog",Cr="refresh-Expand-and-Collapse",wr="row-mode-change",br="enter-key-handler",Ir="refresh-virtual-max-page",Rr="set-virtual-page-query",xr="select-row-on-context-open",Dr="pager-refresh",Tr="closeinline",Er="close-edit",Or="reset-virtual-focus",Ar="refresh-virtual-editform-cells",Fr="scroll-to-edit",Mr="before-checkbox-renderer-query",kr="create-virtual-validation-form",Pr="validate-virtual-form",Lr="destroy-child-grid",Nr="sticky-scroll-complete",Br="infinite-group-collapse",zr="refresh-infinite-persist-selection",qr="refresh-infinite-editrowindex",Ur="after-filter-column-menu-close",Hr="beforeCheckboxfilterRenderer",Vr="commandColumnDestroy",jr="cancelcnfrmDlg",Gr="refresh-Virtual-LazyLoad-Cache",_r="refresh-Frozen-Position",Kr="refresh-Resize-Position",Wr="refresh-Split-Frozen-Column",Qr="render-Responsive-Change-Action",Xr="render-Responsive-Column-Chooser-Div",Yr="show-Add-New-Row-Focus",$r="infinitescroll-complete",Zr="last-rowcell-border-updated",Jr="destroy-edit-form",es="beforeDetailTemplateDetach",ts="detach-detail-template",is="beforeSetPartialRecords",ns="apply-dom-virtual-row-height",rs="before-dom-virtual-rows-render",ss="registerWebMcpTools",os="getWebMcpTools",as="tool-panel-property-changed",ls="tool-panel-filter-dialog-open",hs=(e.prototype.reorderRows=function(e){this.parent.isRemote()?this.parent.getCurrentViewRecords().splice(e.toIndex,0,this.parent.getCurrentViewRecords().splice(e.fromIndex,1)[0]):this.dataManager.dataSource.json.splice(e.toIndex,0,this.dataManager.dataSource.json.splice(e.fromIndex,1)[0])},e.prototype.getModuleName=function(){return"data"},e.prototype.initDataManager=function(){var e=this.parent;this.dataManager=e.dataSource instanceof V.DataManager?e.dataSource:H.isNullOrUndefined(e.dataSource)?new V.DataManager:new V.DataManager(e.dataSource),!e.isAngular||e.query instanceof V.Query?(this.isQueryInvokedFromData=!0,e.query instanceof V.Query||(e.query=new V.Query)):e.setProperties({query:new V.Query},!0)},e.prototype.generateQuery=function(e,t){var i=this.parent,i=H.isNullOrUndefined(i.getQuery())?new V.Query:i.getQuery().clone();if("ExcludeHidden"===this.parent.columnQueryMode)i.select(this.parent.getColumns().filter(function(e){return!(!0!==e.isPrimaryKey&&!1===e.visible||void 0===e.field)}).map(function(e){return e.field}));else if("Schema"===this.parent.columnQueryMode){for(var n=[],r=this.parent.columns,s=0;s<r.length;s++)n.push(r[parseInt(s.toString(),10)].field);i.select(n)}return this.filterQuery(i),this.searchQuery(i),this.aggregateQuery(i),this.sortQuery(i),tc(this.parent)?this.virtualGroupPageQuery(i):this.pageQuery(i,e),!H.isNullOrUndefined(t)&&t||this.groupQuery(i),i},e.prototype.pinnedDataQuery=function(e){return this.filterQuery(e),this.searchQuery(e),this.sortQuery(e),e},e.prototype.aggregateQuery=function(e){for(var t=this.parent.aggregates,i=0;i<t.length;i++)for(var n=t[parseInt(i.toString(),10)],r=0;r<n.columns.length;r++)for(var s=n.columns[parseInt(r.toString(),10)],o=s.type instanceof Array?s.type:[s.type],a=0;a<o.length;a++)e.aggregate(o[parseInt(a.toString(),10)].toLowerCase(),s.field);return e},e.prototype.virtualGroupPageQuery=function(e){if(e.queries.length)for(var t=0;t<e.queries.length;t++)"onPage"===e.queries[parseInt(t.toString(),10)].fn&&e.queries.splice(t,1);return e},e.prototype.pageQuery=function(e,t){var i=this.parent;if(!t){var n={query:e,skipPage:!1};if(i.notify(Rr,n),!n.skipPage&&(i.allowPaging||i.enableVirtualization||i.enableInfiniteScrolling)&&!0!==t){if(i.pageSettings.currentPage=Math.max(1,i.pageSettings.currentPage),i.pageSettings.pageCount<=0&&(i.pageSettings.pageCount=8),i.pageSettings.pageSize<=0&&(i.pageSettings.pageSize=12),e.queries.length)for(var r=0;r<e.queries.length;r++)"onPage"===e.queries[parseInt(r.toString(),10)].fn&&e.queries.splice(r,1);!H.isNullOrUndefined(i.infiniteScrollModule)&&i.enableInfiniteScrolling?this.parent.notify(Bn,e):e.page(i.pageSettings.currentPage,!(i.allowPaging&&i.pagerModule&&i.pagerModule.pagerObj.isAllPage)||i.isManualRefresh||this.dataManager.dataSource.offline||this.dataManager.adaptor instanceof V.RemoteSaveAdaptor?i.pageSettings.pageSize:null)}}return e},e.prototype.groupQuery=function(e){var t=this.parent;if(t.allowGrouping&&t.groupSettings.columns.length){this.parent.groupSettings.enableLazyLoading&&e.lazyLoad.push({key:"isLazyLoad",value:this.parent.groupSettings.enableLazyLoading});for(var i=t.groupSettings.columns,n=0,r=i.length;n<r;n++){var s=this.getColumnByField(i[parseInt(n.toString(),10)]),o=(s||this.parent.log("initial_action",{moduleName:"group",columnName:i[parseInt(n.toString(),10)]}),s.enableGroupByFormat),s=s.format;o?e.group(i[parseInt(n.toString(),10)],this.formatGroupColumn.bind(this),s):e.group(i[parseInt(n.toString(),10)],null)}}return e},e.prototype.sortQuery=function(e){var t=this.parent;if((t.allowSorting||t.allowGrouping)&&t.sortSettings.columns.length){for(var i=t.sortSettings.columns,n=[],r=i.length-1;-1<r;r--){if(!(o=this.getColumnByField(i[parseInt(r.toString(),10)].field)))return this.parent.log("initial_action",{moduleName:"sort",columnName:i[parseInt(r.toString(),10)].field}),e;o.setSortDirection(i[parseInt(r.toString(),10)].direction);var s=i[parseInt(r.toString(),10)].direction;o.sortComparer&&(s=o.sortComparer.bind(o)),-1===t.groupSettings.columns.indexOf(i[parseInt(r.toString(),10)].field)?o.isForeignColumn()||o.sortComparer?e.sortByForeignKey(o.field,s,void 0,i[parseInt(r.toString(),10)].direction.toLowerCase(),o.foreignKeyValue):e.sortBy(o.field,s):n.push({direction:s,field:o.field})}for(var o,r=0,a=n.length;r<a;r++)"string"==typeof n[parseInt(r.toString(),10)].direction?e.sortBy(n[parseInt(r.toString(),10)].field,n[parseInt(r.toString(),10)].direction):(o=this.getColumnByField(n[parseInt(r.toString(),10)].field),e.sortByForeignKey(n[parseInt(r.toString(),10)].field,n[parseInt(r.toString(),10)].direction,void 0,o.getSortDirection().toLowerCase(),o.foreignKeyValue))}return e},e.prototype.searchQuery=function(e,t,i){var n=this.parent.searchSettings,r=!H.isNullOrUndefined(n.fields)&&n.fields.length?n.fields:this.getSearchColumnFieldNames(),s=[];if(!H.isNullOrUndefined(this.parent.searchSettings.key)&&this.parent.searchSettings.key.length){for(var o=void 0,a=0,l=r;a<l.length;a++){var h=l[a];if((c=this.parent.getColumnByField(h))&&c.allowFormula){o=c.filterComparer.bind(c);break}}var d=this.parent.getForeignKeyColumns().some(function(e){return-1<r.indexOf(e.field)}),p=(i?t.dataSource:this.dataManager).adaptor;if(d||p.getModuleName&&"ODataV4Adaptor"===p.getModuleName()){for(var c,r=i?[t.foreignKeyValue]:r,u=0;u<r.length;u++)(c=i?t:this.getColumnByField(r[parseInt(u.toString(),10)])).isForeignColumn()&&!i?s=this.fGeneratePredicate(c,s):s.push(new V.Predicate(r[parseInt(u.toString(),10)],n.operator,n.key,n.ignoreCase,n.ignoreAccent,!1,o));d=V.Predicate.or(s);d.key=n.key,e.where(d)}else e.search(n.key,r,n.operator,n.ignoreCase,n.ignoreAccent,o)}return e},e.prototype.filterQuery=function(e,t,i){var n,r=this.parent,s=[],o=this.parent.getForeignKeyColumns();if(r.allowFiltering&&r.filterSettings.columns.length){for(var a=t||r.filterSettings.columns,l=0,h=r.getColumns();l<h.length;l++)(I=h[l]).field,I.filter.type||r.filterSettings.type;for(var d=[],p=[],c=0,u=a;c<u.length;c++){var g=(I=u[c]).isForeignKey?r.getColumnByUid(I.uid):r.getColumnByField(I.field);g&&g.allowFormula&&g.filterComparer&&(I.filterComparer=g.filterComparer),H.isNullOrUndefined(I.type)&&g&&("date"===g.type||"datetime"===g.type||"dateonly"===g.type)&&(I.type=(I.isForeignKey?r.getColumnByUid(I.uid):r.getColumnByField(I.field)).type),(I.isForeignKey?d:p).push(I)}if(p.length){for(var f=0,m=p.length;f<m;f++)p[parseInt(f.toString(),10)].uid=p[parseInt(f.toString(),10)].uid||this.parent.grabColumnByFieldFromAllCols(p[parseInt(f.toString(),10)].field,p[parseInt(f.toString(),10)].isForeignKey).uid;for(var y=Su.getPredicate(p),v=0,S=Object.keys(y);v<S.length;v++){var C=S[v];s.push(y[""+C])}}if(d.length)for(var w=0,b=d;w<b.length;w++){(I=b[w]).uid=I.uid||this.parent.grabColumnByFieldFromAllCols(I.field,I.isForeignKey).uid;var I,R=this.parent.grabColumnByUidFromAllCols(I.uid);if(R||this.parent.log("initial_action",{moduleName:"filter",columnName:I.field}),R.isForeignColumn()&&Zp(I.field,o)&&!i)R.columnData.length||(n=!0),s=this.fGeneratePredicate(R,s);else for(var y=Su.getPredicate(a),x=0,D=Object.keys(y);x<D.length;x++){C=D[x];s.push(y[""+C])}}s.length&&!n?e.where(V.Predicate.and(s)):this.parent.notify(Hi,{})}return e},e.prototype.fGeneratePredicate=function(e,t){var i={};return e&&(this.parent.notify(Ui,{predicate:i,column:e}),i.predicate.predicates.length)&&t.push(i.predicate),t},e.prototype.getData=function(e,t){var i=this,n=(void 0===e&&(e={requestType:""}),this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames()));if(this.parent.log("datasource_syntax_mismatch",{dataState:this.parent}),this.parent.dataSource&&"result"in this.parent.dataSource)return this.eventPromise(e,t,n).promise;var r,s=void 0;switch(e.requestType){case"delete":t=t||this.generateQuery(),s=1===Object.keys(e.data).length?this.dataManager.remove(n,e.data[0],t.fromTable,t):((r={addedRecords:[],deletedRecords:[],changedRecords:[]}).deletedRecords=e.data,this.dataManager.saveChanges(r,n,t.fromTable,this.parent.setRequiresCount(t)));break;case"save":t=t||this.generateQuery(),e.index=H.isNullOrUndefined(e.index)?0:e.index,s=this.dataManager.insert(e.data,t.fromTable,t,e.index)}return!(e.promise=s)||Array.isArray(s)||s.hasOwnProperty("deletedRecords")?this.insert(t,e):s.then(function(){return i.insert(t,e)})},e.prototype.insert=function(e,t){return"save"===t.requestType&&(t.query=e,this.parent.notify(Xi,t)),this.executeQuery(e)},e.prototype.executeQuery=function(e){var t,i=this;return this.dataManager.ready?(t=new V.Deferred,this.dataManager.ready.then(function(){i.dataManager.executeQuery(e).then(function(e){t.resolve(e)})}).catch(function(e){t.reject(e)}),t.promise):this.dataManager.executeQuery(e)},e.prototype.formatGroupColumn=function(e,t){var i=this.serviceLocator,t=this.getColumnByField(t),n=e;return t.type||(t.type=n.getDay?0<n.getHours()||0<n.getMinutes()||0<n.getSeconds()||0<n.getMilliseconds()?"datetime":"date":typeof e),H.isNullOrUndefined(t.getFormatter())&&qp(i,t),U.prototype.toView(e,t.getFormatter())},e.prototype.crudActions=function(e){var t=this.generateQuery(),i=null,n="promise",r=this.getKey(e.foreignKeyData&&Object.keys(e.foreignKeyData).length?e.foreignKeyData:this.parent.getPrimaryKeyFieldNames());this.parent.dataSource&&"result"in this.parent.dataSource&&this.eventPromise(e,t,r),"save"===e.requestType&&(i=this.dataManager.update(r,e.data,t.fromTable,t,e.previousData)),e[n]=i||e[n],this.parent.notify(gi,e)},e.prototype.saveChanges=function(e,t,i,n){var r,s;return void 0===n&&(n=this.generateQuery()),n=this.parent.setRequiresCount(n),"result"in this.parent.dataSource?(s={requestType:"batchsave",changes:e,key:t,query:n,endEdit:(r=new V.Deferred).resolve},this.setState({isPending:!0,resolver:r.resolve}),this.parent.trigger(_i,s),r.promise):this.dataManager.saveChanges(e,t,n.fromTable,n,i)},e.prototype.getKey=function(e){if(e&&e.length)return e[0]},e.prototype.isRemote=function(){return!0!==this.dataManager.dataSource.offline&&void 0!==this.dataManager.dataSource.url&&""!==this.dataManager.dataSource.url},e.prototype.clearCache=function(){this.isRemote()&&this.parent.dataSource.clearCache(),this.resetCustomBindingCache()},e.prototype.resetCustomBindingCache=function(){this.customBindingCache={},this.customBindingMeta={},this.customBindingBlocks={},this.pendingCachePage=null,this.customBindingOrder=[],this.pendingCacheKey=null},e.prototype.addRows=function(e){for(var t=e.records.length;0<t;t--)this.parent.dataSource instanceof V.DataManager&&this.dataManager.dataSource.offline?this.dataManager.dataSource.json.splice(e.toIndex,0,e.records[t-1]):this.parent.getDataModule().isRemote()||H.isNullOrUndefined(this.parent.dataSource)||this.parent.dataSource.result||this.parent.dataSource.splice(e.toIndex,0,e.records[t-1])},e.prototype.removeRows=function(t){var e=this.dataManager.dataSource.json;this.parent.dataSource instanceof V.DataManager&&this.dataManager.dataSource.offline?this.dataManager.dataSource.json=e.filter(function(e){return-1===t.records.indexOf(e)}):this.parent.getDataModule().isRemote()||H.isNullOrUndefined(this.parent.dataSource)||this.parent.dataSource.result||(this.parent.dataSource=e.filter(function(e){return-1===t.records.indexOf(e)}))},e.prototype.getColumnByField=function(t){var i;return this.parent.columnModel.some(function(e){return(i=e).field===t})&&i},e.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(Yt,this.addRows),this.parent.off($t,this.removeRows),this.parent.off(ei,this.initDataManager),this.parent.off(s,this.destroy),this.parent.off(li,this.crudActions),this.parent.off(fi,this.getData),this.parent.off(oi,this.refreshFilteredCols),this.parent.off(gn,this.refreshFilteredCols))},e.prototype.getState=function(){return this.dataState},e.prototype.setState=function(e){return this.dataState=e},e.prototype.getForeignKeyDataState=function(){return this.foreignKeyDataState},e.prototype.setForeignKeyDataState=function(e){this.foreignKeyDataState=e},e.prototype.getStateEventArgument=function(e){var t=new V.UrlAdaptor,i=new V.DataManager({url:"",adaptor:new V.UrlAdaptor}),t=t.processQuery(i,e),i=JSON.parse(t.data);return H.extend(i,t.pvtData)},e.prototype.eventPromise=function(e,t,i){var n,r=this,s=e,o=this.getStateEventArgument(t),a=new V.Deferred,l=new V.Deferred,h=this.isCustomBindingCacheEnabled();if(h&&this.seedInitialCustomBindingCache(),h&&this.shouldInvalidateCustomBindingCache(e.requestType)&&this.resetCustomBindingCache(),this.isFilterChoiceRequest(e.requestType))o.action=e,o.dataSource=a.resolve,this.parent.trigger(Gi,o);else if((void 0!==e.requestType||this.parent.groupSettings.disablePageWiseAggregates&&t.queries.some(function(e){return"onGroup"===e.fn}))&&!1!==this.dataState.isDataChanged){if(o.action=e,h){t=this.getCustomBindingCache(o);if(t)return this.setState({}),a.resolve(t),a;this.pendingCachePage=this.getCustomBindingPage(o),this.pendingCacheKey=this.pendingCachePage?null:this.getCustomBindingCacheKey(o)}"save"===e.requestType||"delete"===e.requestType||"batchsave"===e.requestType?((n=e).key=i,n.promise=l.promise,n.state=o,this.setState({isPending:!0,resolver:l.resolve}),s.endEdit=l.resolve,s.cancelEdit=l.reject,this.parent.trigger(_i,n),l.promise.then(function(){r.setState({isPending:!0,resolver:a.resolve,group:o.group,aggregates:o.aggregates}),"save"===n.requestType&&r.parent.notify(Xi,n),r.parent.trigger(Gi,o)}).catch(function(){})):(this.setState({isPending:!0,resolver:a.resolve,group:o.group,aggregates:o.aggregates}),this.parent.trigger(Gi,o))}else this.setState({}),a.resolve(this.parent.dataSource);return a},e.prototype.getSearchColumnFieldNames=function(){for(var e=[],t=0,i=this.parent.getColumns();t<i.length;t++){var n=i[t];n.allowSearching&&!H.isNullOrUndefined(n.field)&&e.push(n.field)}return e},e.prototype.refreshFilteredCols=function(){this.parent.allowFiltering&&this.parent.filterSettings.columns.length&&hc(this.parent,this.parent.filterSettings.columns)},e.prototype.isCustomBindingCacheEnabled=function(){return!!(this.parent.enableCache&&this.parent.dataSource&&"result"in this.parent.dataSource)},e.prototype.getCustomBindingCacheKey=function(e){e={skip:e.skip,take:e.take,sorted:e.sorted,where:e.where,search:e.search,group:e.group,select:e.select,table:e.table,aggregates:e.aggregates,requiresCounts:e.requiresCounts,isLazyLoad:e.isLazyLoad,onDemandGroupInfo:e.onDemandGroupInfo};return JSON.stringify(e)},e.prototype.storeCustomBindingCache=function(e,t){var i;this.isCustomBindingCacheEnabled()&&!H.isNullOrUndefined(t)&&"result"in t&&(i=this.getCustomBindingPage(e),this.saveCustomBindingResponse(i,i?null:this.getCustomBindingCacheKey(e),t))},e.prototype.storePendingCustomBindingCache=function(e){this.isCustomBindingCacheEnabled()&&!H.isNullOrUndefined(e)&&"result"in e&&(this.pendingCachePage||this.pendingCacheKey)&&(this.saveCustomBindingResponse(this.pendingCachePage,this.pendingCacheKey,e),this.pendingCachePage=null,this.pendingCacheKey=null)},e.prototype.saveCustomBindingResponse=function(e,t,i){e?(this.registerCacheEntry("p:"+e),this.customBindingCache[""+e]=i.result,this.customBindingMeta={count:i.count,aggregates:i.aggregates}):t&&(this.registerCacheEntry("b:"+t),this.customBindingBlocks[""+t]={result:i.result,count:i.count,aggregates:i.aggregates})},e.prototype.getCustomBindingCache=function(e){var t=this.getCustomBindingPage(e);return t?(t=this.customBindingCache[""+t])?{result:t,count:this.customBindingMeta.count,aggregates:this.customBindingMeta.aggregates}:null:this.customBindingBlocks[this.getCustomBindingCacheKey(e)]||null},e.prototype.getCustomBindingPage=function(e){return e.isLazyLoad||e.onDemandGroupInfo||!e.take||(e.skip||0)%e.take!=0||e.group&&e.group.length?0:(e.skip||0)/e.take+1},e.prototype.seedInitialCustomBindingCache=function(){var e;!this.isCustomBindingCacheEnabled()||Object.keys(this.customBindingCache).length||Object.keys(this.customBindingBlocks).length||(e=this.generateQuery().requiresCount(),this.storeCustomBindingCache(this.getStateEventArgument(e),this.parent.dataSource))},e.prototype.isFilterChoiceRequest=function(e){return"filterchoicerequest"===e||"filterSearchBegin"===e||"stringfilterrequest"===e||"booleanfilterrequest"===e},e.prototype.shouldInvalidateCustomBindingCache=function(e){return"sorting"===e||"filtering"===e||"searching"===e||"grouping"===e||"ungrouping"===e||"reorder"===e||"save"===e||"delete"===e||"batchsave"===e||"refresh"===e||"cancel"===e},e.prototype.registerCacheEntry=function(e){var t=this.customBindingOrder.indexOf(e);-1<t&&this.customBindingOrder.splice(t,1),this.customBindingOrder.push(e),this.trimCache()},e.prototype.trimCache=function(){for(var e=Math.max(1,this.parent.cacheLimit);this.customBindingOrder.length>e;){var t=this.customBindingOrder.shift();0===t.indexOf("p:")?delete this.customBindingCache[t.substring(2)]:delete this.customBindingBlocks[t.substring(2)]}},e);function e(e,t){this.dataState={isPending:!1,resolver:null,group:[]},this.foreignKeyDataState={isPending:!1,resolver:null},this.customBindingCache={},this.customBindingMeta={},this.customBindingBlocks={},this.customBindingOrder=[],this.parent=e,this.serviceLocator=t,this.initDataManager(),this.parent.isDestroyed||"foreignKey"===this.getModuleName()||(this.parent.on(Yt,this.addRows,this),this.parent.on(rn,this.reorderRows,this),this.parent.on($t,this.removeRows,this),this.parent.on(ei,this.initDataManager,this),this.parent.on(s,this.destroy,this),this.parent.on(li,this.crudActions,this),this.parent.on(fi,this.getData,this),this.parent.on(oi,this.refreshFilteredCols,this),this.parent.on(gn,this.refreshFilteredCols,this))}ps.prototype.clone=function(){var e=new ps({});return H.merge(e,this),e.cells=this.cells.map(function(e){return e.clone()}),e},ps.prototype.setRowValue=function(e){var t;this.parent&&(t=this.data[this.parent.getPrimaryKeyFieldNames()[0]],this.parent.setRowData(t,e))},ps.prototype.setCellValue=function(e,t){var i,n;this.parent&&this.data[""+e].toString()!==t.toString()&&(i=this.parent.getPrimaryKeyFieldNames()[0],n=this.data[""+i],this.parent.setCellValue(n,e,t),this.makechanges(i,this.data))},ps.prototype.makechanges=function(e,t){this.parent&&this.parent.getDataModule().dataManager.update(e,t)};var ds=ps;function ps(e,t){H.merge(this,e),this.parent=t}us.prototype.clone=function(){var e=new us({});return H.merge(e,this),e};var cs=us;function us(e){this.isSpanned=!1,this.isRowSpanned=!1,H.merge(this,e)}fs.prototype.render=function(e,t,i,n){for(var r,s,o,a,l,h=this.serviceLocator.getService("cellRendererFactory").getCellRenderer(t.cells[parseInt(i.toString(),10)].cellType||oe.CellType.Data),d=t.cells[parseInt(i.toString(),10)].cellSpan?t.cells[parseInt(i.toString(),10)].cellSpan:e.colSpan?e.colSpan+i<=t.cells.length?e.colSpan:t.cells.length-i:1,p=e.rowSpan,c=0,u=(t.index>this.parent.pinnedTopRecords.length&&(l=t.index-this.parent.pinnedTopRecords.length,r=this.parent.getRowsObject().filter(function(e){return e.isDataRow}),a=void 0,a=this.parent.enableDomVirtualization?r.filter(function(e){return e.index===t.index-1})[0]:r[parseInt(l.toString(),10)-1])&&(r=(0<this.parent.groupSettings.columns.length&&!a.isDataRow&&r[this.parent.enableDomVirtualization?r.indexOf(a)+1:parseInt(l.toString(),10)]?r[this.parent.enableDomVirtualization?r.indexOf(a)+1:parseInt(l.toString(),10)]:a).cells,s=t.cells[parseInt(i.toString(),10)],o=r.filter(function(e){return e.column.uid===s.column.uid})[0]),o&&1<o.colSpanRange&&1<o.rowSpanRange?o.colSpanRange:d),g=i+1;g<i+u&&g<t.cells.length;g++)!1===t.cells[parseInt(g.toString(),10)].visible?c++:t.cells[parseInt(g.toString(),10)].isSpanned=!0;if(0<c){for(g=i+d;g<i+d+c&&g<t.cells.length;g++)t.cells[parseInt(g.toString(),10)].isSpanned=!0;i+d+c>=t.cells.length&&(d-=i+d+c-t.cells.length)}return t.cells[parseInt(i.toString(),10)].cellSpan&&(t.data[e.column.field]=t.cells[parseInt(i.toString(),10)].spanText,l=t.index-this.parent.pinnedTopRecords.length,n=h.render(t.cells[parseInt(i.toString(),10)],t.data,{index:H.isNullOrUndefined(l)?"":l.toString()})),1<d&&H.attributes(n,{colSpan:d.toString(),"aria-colSpan":d.toString()}),1<p&&(H.attributes(n,{rowspan:p.toString(),"aria-rowspan":p.toString()}),t.cells[parseInt(i.toString(),10)].isRowSpanned=!0,t.cells[parseInt(i.toString(),10)].rowSpanRange=Number(p),1<d)&&(t.cells[parseInt(i.toString(),10)].colSpanRange=Number(d)),t.index>this.parent.pinnedTopRecords.length&&o&&1<o.rowSpanRange&&(t.cells[parseInt(i.toString(),10)].isSpanned=!0,t.cells[parseInt(i.toString(),10)].rowSpanRange=Number(o.rowSpanRange-1),t.cells[parseInt(i.toString(),10)].colSpanRange=0<o.rowSpanRange?o.colSpanRange:1),!this.parent.enableColumnVirtualization||t.cells[parseInt(i.toString(),10)].cellSpan||this.containsKey(e.column.field,e.data[e.column.field])||this.backupMergeCells(e.column.field,e.data[e.column.field],e.colSpan),n},fs.prototype.backupMergeCells=function(e,t,i){this.setMergeCells(this.generteKey(e,t),i)},fs.prototype.generteKey=function(e,t){return e+"__"+t.toString()},fs.prototype.splitKey=function(e){return e.split("__")},fs.prototype.containsKey=function(e,t){return this.getMergeCells().hasOwnProperty(this.generteKey(e,t))},fs.prototype.getMergeCells=function(){return this.parent.mergeCells},fs.prototype.setMergeCells=function(e,t){this.parent.mergeCells[""+e]=t},fs.prototype.updateVirtualCells=function(e){for(var t=this.getMergeCells(),i=0,n=Object.keys(t);i<n.length;i++){var r=n[i],s=t[""+r],o=this.splitKey(r),r=this.getIndexFromAllColumns(o[0]),a=this.parent.getColumnIndexesInView(),l=s-(a[0]-r);if(r<a[0]&&1<l)for(var h=0,d=e;h<d.length;h++){var p=d[h];if(p.data[o[0]].toString()===o[1].toString()){p.cells[0].cellSpan=l,p.cells[0].spanText=o[1];break}}}return e},fs.prototype.getIndexFromAllColumns=function(i){return ap(this.parent.getVisibleColumns(),function(e,t){if(e.field===i)return t})[0]};var gs=fs;function fs(e,t){this.serviceLocator=e,this.parent=t}var b="e-rowcell",ms="e-gridheader",ys="e-rownumbercell",vs="e-gridcontent",Ss="e-gridfooter",Cs="e-headercontent",ws="e-movablecontent",bs="e-movableheader",Is="e-frozencontent",Rs="e-frozenheader",xs="e-content",Ds="e-table",Ts="e-row",Es="e-gridchkbox",Os="e-editedrow",As="e-addedrow",Fs="e-groupcaptionrow",Ms="changedRecords",ks="addedRecords",Ps="deletedRecords",Ls="Left-Right",Ns="frozen-right",Bs="frozen-left",zs="aria-colindex",D="aria-rowindex",j="tbody",qs="colgroup",Us="open",Hs="change",Vs="focus",js="created",Gs="beforeOpen",_s="downArrow",Ks="upArrow",Ws="PageDown",Qs="enter",Xs="shiftEnter",Ys="initialFrozenColumnIndex",$s=(Zs.prototype.render=function(e,t,i,n,r){return this.refreshRow(e,t,i,n,r)},Zs.prototype.refresh=function(e,t,i,n,r){var s=this,o=(i&&(e.data=sc({},e.changes),this.refreshMergeCells(e)),this.parent.element.querySelector("[data-uid="+kp(e.uid)+"]")),e=this.refreshRow(e,t,n,r,null,i),n=(o.classList.contains("e-grid-pin-row")&&e.classList.add("e-grid-pin-row"),i&&Pc(e),[].slice.call(e.cells)),r=[].slice.call(o.querySelectorAll(".e-templatecell"));if((this.parent.isReact||this.parent.isAngular)&&r.length)for(var a=0,l=t;a<l.length;a++)if("break"===function(e){if(e.template)return setTimeout(function(){s.parent.isReact&&s.parent.refreshReactColumnTemplateByUid(e.uid,!0),s.parent.isAngular&&s.parent.refreshRowCellTemplates(o)},0),"break"}(l[a]))break;[].slice.call(e.attributes).map(function(e){o.setAttribute(e.name,e.value)}),o.innerHTML="";for(var h=0,d=n;h<d.length;h++){var p=d[h];o.appendChild(p)}},Zs.prototype.refreshRow=function(T,e,t,i,n,E){for(var O=H.isNullOrUndefined(n)?this.element.cloneNode():n,n={data:T.data},A={data:T.data},r=this.parent.getColumns().filter(function(e){return"checkbox"===e.type&&e.field})[0],s=!1,F=this.parent.isFrozenGrid(),M=!0,r=(r&&(s=N(r.field,n.data)),this.parent.getSelectedRowIndexes()),k=(T.isDataRow&&(h=this.parent.getPrimaryKeyFieldNames()[0],T.isSelected=this.parent.isPersistSelection&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading?!H.isNullOrUndefined(this.parent.selectionModule.selectedRowState[T.data[""+h]]):-1<r.indexOf(T.index)||s),this.parent.currentViewData),P=(T.isDataRow&&this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||this.parent.allowPaging&&this.parent.selectionModule&&this.parent.selectionModule.isPartialSelection)&&(T.isSelected=!0,-1===r.indexOf(T.index))&&r.push(T.index),this.buildAttributeFromRow(O,T),H.attributes(O,H.extend({},t,{})),dp(O,T.attributes),this.serviceLocator.getService("cellRendererFactory")),L=this,o=0,a=T.cells.length;o<a;o++)!function(t){var i=T.cells[parseInt(t.toString(),10)],e=(i.isSelected=T.isSelected,i.isColumnSelected=i.column.isSelected,P.getCellRenderer(T.cells[parseInt(t.toString(),10)].cellType||oe.CellType.Data)),n={"data-index":H.isNullOrUndefined(T.index)?"":T.index.toString()},r=(T.isExpand&&!L.parent.isRowDomVirtualization()&&T.cells[parseInt(t.toString(),10)].cellType===oe.CellType.DetailExpand&&(n.class=L.parent.isPrinting?"e-detailrowcollapse":"e-detailrowexpand"),!L.parent.enableRtl&&M&&("Vertical"===L.parent.gridLines||"Both"===L.parent.gridLines)),s=e.render(T.cells[parseInt(t.toString(),10)],T.data,n,T.isExpand,E);if(T.cells[parseInt(t.toString(),10)].cellType!==oe.CellType.Filter){if(T.cells[parseInt(t.toString(),10)].cellType===oe.CellType.Data||T.cells[parseInt(t.toString(),10)].cellType===oe.CellType.CommandColumn){i.visible&&r&&(L.parent.groupSettings&&L.parent.groupSettings.columns.length?s.classList.add("e-grid-group-first-cell"):L.parent.renderModule&&L.parent.renderModule.isFirstColumnHidden&&!(L.parent.allowRowDragAndDrop||L.parent.childGrid||L.parent.detailTemplate)&&s.classList.add("e-first-visible-cell"),M=!1);var o,n=L.parent.parentDetails&&L.parent.parentDetails.parentInstObj&&L.parent.parentDetails.parentInstObj.isReact,a=L.parent.printGridParent&&L.parent.printGridParent.isReact;if((L.parent.isReact&&L.parent.requireTemplateRef||n&&L.parent.parentDetails.parentInstObj.requireTemplateRef||a&&L.parent.printGridParent.requireTemplateRef)&&i.isTemplate?(o=L).parent.renderTemplates(function(){var e;"string"!=typeof i.column.template&&(e=s.getAttribute("aria-label"),s.setAttribute("aria-label",s.innerText+e)),o.parent.trigger(re,H.extend(A,{cell:s,column:i.column,colSpan:1,rowSpan:1,foreignKeyData:T.cells[parseInt(t.toString(),10)].foreignKeyData}))}):L.parent.trigger(re,H.extend(A,{cell:s,column:i.column,colSpan:1,rowSpan:1,foreignKeyData:T.cells[parseInt(t.toString(),10)].foreignKeyData})),!(L.parent.enableVirtualization||L.parent.enableColumnVirtualization||L.parent.enableInfiniteScrolling||L.parent.allowGrouping&&L.parent.groupSettings.columns.length&&L.parent.groupSettings.enableLazyLoading||T.index<L.parent.pinnedTopRecords.length)){var l="field",h=["date","datetime","dateonly"];if(T.isDataRow&&L.parent.enableColumnSpan&&i.column.enableColumnSpan&&!i.isSpanned&&i.visible&&!i.isTemplate&&""!==T.data[i.column[""+l]]&&!i.isForeignKey){var d=1,p=e.getValue(i.column[""+l],T.data,i.column);-1!==h.indexOf(i.column.type)&&!H.isNullOrUndefined(p)&&p instanceof Date&&(p=p.getTime());for(var c=t;c<T.cells.length-1;c++){var u=T.cells[parseInt(c.toString(),10)+1],g=e.getValue(u.column[""+l],T.data,u.column);if(p!==(g=-1!==h.indexOf(u.column.type)&&!H.isNullOrUndefined(g)&&g instanceof Date?g.getTime():g)||!u.visible||!u.column.enableColumnSpan||u.isForeignKey)break;d++}A.colSpan=d}if(T.isDataRow&&L.parent.enableRowSpan&&i.column.enableRowSpan&&!i.isSpanned&&!i.isTemplate&&i.visible&&""!==T.data[i.column[""+l]]&&!i.isForeignKey){var f=T.index-L.parent.pinnedTopRecords.length,n=L.parent.groupSettings.columns.length?T.groupDataIndex:f,m=(T.isDataRow&&L.parent.groupSettings.columns.length&&!H.isNullOrUndefined(T.parentUid)&&(k=L.parent.getRowObjectFromUID(T.parentUid).data.items),1),p=e.getValue(i.column[""+l],T.data,i.column);-1!==h.indexOf(i.column.type)&&!H.isNullOrUndefined(p)&&p instanceof Date&&(p=p.getTime());for(c=n+1;c<k.length;c++){var y=e.getValue(i.column[""+l],k[parseInt(c.toString(),10)],i.column);if(p!==(y=-1!==h.indexOf(i.column.type)&&!H.isNullOrUndefined(y)&&y instanceof Date?y.getTime():y))break;m++}A.rowSpan=m}}var v,S,C,w,a=!1;if(T.index>L.parent.pinnedTopRecords.length&&(L.isSpan||L.parent.isSpan&&E)&&(f=T.index-L.parent.pinnedTopRecords.length,v=L.parent.getRowsObject().filter(function(e){return e.isDataRow}),n=void 0,n=L.parent.isRowDomVirtualization()?v.filter(function(e){return e.index===T.index-1})[0]:v[parseInt(f.toString(),10)-1])&&(S=(0<L.parent.groupSettings.columns.length&&!n.isDataRow&&v[L.parent.isRowDomVirtualization()?v.indexOf(n)+1:parseInt(f.toString(),10)]?v[L.parent.isRowDomVirtualization()?v.indexOf(n)+1:parseInt(f.toString(),10)]:n).cells,C=S.filter(function(e){return e.column.uid===T.cells[parseInt(t.toString(),10)].column.uid})[0])&&(a=C.isRowSpanned||1<C.rowSpanRange),(1<A.rowSpan||1<A.colSpan)&&T.index>=L.parent.pinnedTopRecords.length){var f=T.index-L.parent.pinnedTopRecords.length;if(L.resetrowSpanvalue(L.parent.frozenRows>f?L.parent.frozenRows:k.length,A,f),!1===A.column.visible)A.colSpan=1;else if(F){var b=L.parent.getColumns(),n=L.parent.getFrozenRightColumnsCount(),I=L.parent.getFrozenLeftCount(),n=b.length-n,R=i.index;if(R<I&&I<R+A.colSpan){var x=R+A.colSpan-I;A.colSpan=A.colSpan-x}else if(n<=R&&b.length<R+A.colSpan){var x=R+A.colSpan-b.length;A.colSpan=A.colSpan-x}else if("Fixed"===A.column.freeze){for(var x=1,D=R,c=D+1;c<D+A.colSpan&&"Fixed"===b[parseInt(c.toString(),10)].freeze;c++)x++;A.colSpan=x}else R<n&&n<R+A.colSpan&&(x=R+A.colSpan-n,A.colSpan=A.colSpan-x)}}(1<A.colSpan||1<T.cells[parseInt(t.toString(),10)].cellSpan||1<A.rowSpan||a)&&T.index>=L.parent.pinnedTopRecords.length&&(L.parent.isSpan=!0,L.isSpan=!0,s=(w=new gs(L.serviceLocator,L.parent)).render(A,T,t,s),F)&&Nc(L.parent,A.column,s,A.colSpan)}i.cellType!==oe.CellType.Header&&i.cellType!==oe.CellType.StackedHeader||!r||!i.visible&&i.cellType!==oe.CellType.StackedHeader||(I=L.parent.getVisibleColumns(),l="field",(i.column.type&&"checkbox"===i.column.type||i.cellType===oe.CellType.Header&&i.column[""+l]&&I.length&&I[0].field===i.column[""+l]||i.cellType===oe.CellType.StackedHeader)&&(L.parent.groupSettings&&L.parent.groupSettings.columns.length?s.classList.add("e-grid-group-first-cell"):L.parent.renderModule&&L.parent.renderModule.isFirstColumnHidden&&!(L.parent.allowRowDragAndDrop||L.parent.childGrid||L.parent.detailTemplate)&&s.classList.add("e-first-visible-cell")),M=!1),i.cellType===oe.CellType.Header&&(1<T.cells[parseInt(t.toString(),10)].colSpan||1<T.cells[parseInt(t.toString(),10)].rowSpan)&&(w=new gs(L.serviceLocator,L.parent),s=w.render(T.cells[parseInt(t.toString(),10)],T,t,s)),L.isSpan&&(v=L.parent.getRowsObject(),R=L.parent.enableRtl,f=T.index-L.parent.pinnedTopRecords.length,n=L.parent.isRowDomVirtualization()?v.filter(function(e){return e.index===T.index-1})[0]:v[parseInt(f.toString(),10)-1])&&n.isDataRow&&(C=(S=n.cells)[t-1],a=S[parseInt(t.toString(),10)],I=S[t+1],w=S[parseInt(t.toString(),10)].column.freeze,C&&(C.isRowSpanned||1<C.rowSpanRange)&&C.visible&&(R||a.isRowSpanned&&!(C.rowSpanRange>a.rowSpanRange)||s.classList.add("e-rowcell-firstchild"),F)&&("Fixed"===C.column.freeze&&"Fixed"===w?s.classList.add(R?"e-removefreezerightborder":"e-removefreezeleftborder"):R||1!==t||"Left"!==w||s.classList.add("e-addfreezefirstchildborder")),I)&&(I.isRowSpanned||1<I.rowSpanRange)&&I.visible&&(R&&(!a.isRowSpanned||I.rowSpanRange>a.rowSpanRange)&&s.classList.add("e-rowcell-lastchild"),F)&&"Fixed"===I.column.freeze&&"Fixed"===w&&A.colSpan<2&&s.classList.add(R?"e-removefreezeleftborder":"e-removefreezerightborder"),1<A.rowSpan&&k.length-(T.index-L.parent.pinnedTopRecords.length)===A.rowSpan&&s.classList.add("e-row-span-lastrowcell"),T.cells[parseInt(t.toString(),10)].isSpanned||O.appendChild(s)}else i.visible&&r&&(L.parent.groupSettings&&L.parent.groupSettings.columns.length?s.classList.add("e-grid-group-first-cell"):L.parent.renderModule&&L.parent.renderModule.isFirstColumnHidden&&!(L.parent.allowRowDragAndDrop||L.parent.childGrid||L.parent.detailTemplate)&&s.classList.add("e-first-visible-cell"),M=!1)}(o);var l=0;if(this.parent.groupSettings.columns.length&&this.parent.getFrozenLeftColumnsCount()){if(O.classList.contains("e-groupcaptionrow")){var h=[].slice.call(O.querySelectorAll(".e-leftfreeze,.e-unfreeze,.e-rightfreeze,.e-fixedfreeze,.e-freezerightborder,.e-freezeleftborder"));if(h.length&&H.removeClass(h,["e-leftfreeze","e-unfreeze","e-rightfreeze","e-fixedfreeze","e-freezerightborder","e-freezeleftborder"]),O.querySelector(".e-summarycell"))gc(O,this.parent);else{for(var d,p,c=0;c<O.childNodes.length;c++)(u=O.childNodes[parseInt(c.toString(),10)]).classList.add("e-leftfreeze"),Lc(u,30*c,this.parent.enableRtl,"Left"),u.classList.contains("e-groupcaption")&&(d=parseInt(u.getAttribute("colspan"),10),p=uc(this.parent,c),u.setAttribute("colspan",p.toString()),l=d-p);l&&(u=this.parent.createElement("TD",{className:"e-groupcaption",attrs:{colspan:l.toString(),id:this.parent.element.id+"captioncell",tabindex:"-1"}}),O.appendChild(u))}}if((O.querySelectorAll(".e-leftfreeze").length||O.classList.contains("e-columnheader"))&&(O.querySelectorAll(".e-indentcell").length||O.querySelectorAll(".e-grouptopleftcell").length))for(var u=O.querySelectorAll(".e-indentcell, .e-grouptopleftcell"),o=0;o<u.length;o++)u[parseInt(o.toString(),10)].classList.add("e-leftfreeze"),Lc(u[parseInt(o.toString(),10)],30*o,this.parent.enableRtl,"Left")}var g,f,m,y,v={row:O,rowHeight:T.rowHeight||this.parent.rowHeight};if(T.isDataRow&&((g=H.extend(n,v)).isSelectable=!0,f=this.parent.getPrimaryKeyFieldNames()[0],s=T.data[""+f],this.parent.renderModule&&Object.keys(this.parent.renderModule.nonselectableDataKey).length&&!1===this.parent.renderModule.nonselectableDataKey[""+s]&&(g.isSelectable=!1),r=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,t=g.row.querySelectorAll(".e-templatecell"),(this.parent.isReact&&this.parent.requireTemplateRef||r&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&t.length?(m=this).parent.renderTemplates(function(){m.parent.trigger(ne,g),g.isSelectable||(T.isSelectable=g.isSelectable,m.disableRowSelection(m,T,v,g))}):this.parent.trigger(ne,g),T.isSelectable=g.isSelectable,h=this.parent.isRowDragable(),this.parent.allowPaging&&this.parent.selectionSettings.persistSelection&&(y=T.data?T.data[""+f]:null,(s=g.isSelectable?this.parent.partialSelectedRecords:this.parent.disableSelectedRecords).some(function(e){return e[""+f]===y})||s.push(T.data)),g.isSelectable||this.disableRowSelection(this,T,v,g),this.parent.childGrid||h||this.parent.detailTemplate)&&(u=O.querySelectorAll(".e-rowcell:not(.e-hide)")[0])&&u.classList.add("e-detailrowvisible"),n.rowHeight?O.style.height=n.rowHeight+"px":this.parent.rowHeight&&(O.querySelector(".e-headercell")||O.querySelector(".e-groupcaption"))?O.style.height=this.parent.rowHeight+"px":O.querySelector(".e-summarycell")&&(this.parent.footerRowHeight?O.style.height=this.parent.footerRowHeight+"px":this.parent.rowHeight&&(O.style.height=this.parent.rowHeight+"px")),T.cssClass&&O.classList.add(T.cssClass),T.lazyLoadCssClass&&O.classList.add(T.lazyLoadCssClass),"Vertical"!==this.parent.rowRenderingMode||!this.parent.allowTextWrap||"Header"!==this.parent.textWrapSettings.wrapMode&&"Both"!==this.parent.textWrapSettings.wrapMode||O.classList.add("e-verticalwrap"),!this.parent.enableColumnVirtualization&&this.parent.aggregates.length&&this.parent.element.scrollHeight>this.parent.height)for(o=0;o<this.parent.aggregates.length;o++){var S,C;this.parent.aggregates[parseInt(o.toString(),10)].properties.columns[0].footerTemplate&&(S=[].slice.call(O.getElementsByClassName("e-summarycell"))).length&&(C=S[S.length-1],H.addClass([C],["e-lastsummarycell"]),C=S[0],H.addClass([C],["e-firstsummarycell"]))}return O},Zs.prototype.resetrowSpanvalue=function(e,t,i){i<e&&e<i+t.rowSpan&&(i=i+t.rowSpan-e,t.rowSpan=t.rowSpan-i)},Zs.prototype.disableRowSelection=function(e,t,i,n){for(var r=this.parent.getSelectedRowIndexes(),s=(this.parent.selectionModule.isPartialSelection=!0,t.isSelected=!1,r.indexOf(t.index)),o=(-1<s&&r.splice(s,1),i.row.querySelectorAll(".e-rowcell.e-gridchkbox")),r=n.row.querySelector(".e-rowdragdrop"),s=e.parent.groupSettings.columns.length+(r||e.parent.isDetail()?1:0),a=0;a<o.length;a++)o[parseInt(a.toString(),10)].firstElementChild.classList.add("e-checkbox-disabled"),o[parseInt(a.toString(),10)].querySelector(".e-frame").classList.remove("e-check");if(t.cells.length)for(a=s;a<t.cells.length;a++){var l=n.row.querySelector('.e-rowcell[aria-colindex="'+(t.cells[parseInt(a.toString(),10)].index+1)+'"]');l&&H.removeClass([l],["e-selectionbackground","e-active"])}r&&H.removeClass([r],["e-selectionbackground","e-active"])},Zs.prototype.refreshMergeCells=function(e){for(var t=0,i=e.cells;t<i.length;t++)i[t].isSpanned=!1;return e},Zs.prototype.buildAttributeFromRow=function(e,t){var i={},n="data-uid",r="aria-selected",s=[];t.isDataRow&&s.push(Ts),t.isAltRow&&s.push("e-altrow"),t.isCaptionRow&&s.push("e-groupcaptionrow"),t.isAggregateRow&&t.parentUid&&s.push("e-groupfooterrow"),H.isNullOrUndefined(t.index)||(i[D]=t.index+1),t.rowSpan&&(i.rowSpan=t.rowSpan),t.uid&&(i[n]=t.uid),t.isSelected&&(i[r]=!0),!1===t.visible&&s.push("e-hide"),i.class=s,dp(e,i)},Zs);function Zs(e,t,i){this.isSpan=!1,this.cellType=t,this.serviceLocator=e,this.parent=i,this.element=this.parent.createElement("tr",{attrs:{role:"row"}})}eo.prototype.generateRows=function(e,t){if(this.parent.isRowDomVirtualization()&&t)return this.generateDomVirtualRows(e,t);var i=[],n=this.parent.enableVirtualization&&t?t.startIndex:0,n=this.parent.enableInfiniteScrolling&&t?this.getInfiniteIndex(t):n;this.parent.enableImmutableMode&&t&&t.startIndex&&(n=t.startIndex),!this.parent.enableVirtualization&&this.parent.pinnedTopRowModels.length&&t&&"infiniteScroll"!==t.requestType&&(n=this.parent.pinnedTopRowModels.length);for(var r=0,s=Object.keys(e).length;r<s;r++,n++)i[parseInt(r.toString(),10)]=this.generateRow(e[parseInt(r.toString(),10)],n);return i},eo.prototype.generateDomVirtualRows=function(e,t){t.requestType&&-1!==this.parent.domVirtualClearActions.indexOf(t.requestType)&&this.parent.clearDomVirtualRowCache();var i=[],n=Object.keys(e).length,r=t.startIndex||0,s=void 0!==t.endIndex?t.endIndex:n;if(this.parent.enableVirtualization){for(var t=this.parent.pageSettings.pageSize,o=(this.parent.pageSettings.currentPage-1)*t,a=o;a<o+n;a++)this.parent.domRowObj.delete(a);for(var t=Math.max(r,o),l=Math.min(s,o+n),h=t;h<l;h++){var d=e[parseInt((h-o).toString(),10)],p=this.generateRow(d,h);this.parent.notify(ns,{row:p}),this.parent.domRowObj.set(h,p),i.push(p)}}else for(h=r;h<Math.min(s,n);h++){var d=e[parseInt(h.toString(),10)],c=this.parent.domRowObj.get(h);c?i.push(c):(p=this.generateRow(d,h),this.parent.notify(ns,{row:p}),this.parent.domRowObj.set(h,p),i.push(p))}return i},eo.prototype.generatePinnedTopRows=function(e){for(var t=[],i=0,n=0,r=Object.keys(e).length;n<r;n++,i++){t[parseInt(n.toString(),10)]=this.generateRow(e[parseInt(n.toString(),10)],i);for(var s=0;s<this.parent.groupSettings.columns.length;s++)this.parent.enableColumnVirtualization||t[parseInt(n.toString(),10)].cells.unshift(this.generateCell({},null,oe.CellType.PinnedIndent))}return t},eo.prototype.ensurePinnedColumns=function(){var e=[];return(this.parent.detailTemplate||this.parent.childGrid)&&e.push(this.generateCell({},null,oe.CellType.PinnedIndent)),this.parent.isRowDragable()&&e.push(this.generateCell({},null,oe.CellType.PinnedIndent)),e},eo.prototype.ensureColumns=function(){var e,t=[];return(this.parent.detailTemplate||this.parent.childGrid)&&(this.parent.notify(In,e={}),t.push(this.generateCell(e,null,oe.CellType.DetailExpand))),this.parent.isRowDragable()&&t.push(this.generateCell({},null,oe.CellType.RowDragIcon)),t},eo.prototype.generateRow=function(e,t,i,n,r,s,o,a){var l={foreignKeyData:{}},n=(l.uid=bp("grid-row"),l.data=e,l.index=t,l.indent=n,l.tIndex=s,l.isDataRow=!0,l.parentGid=r,l.parentUid=o,this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&(l.groupDataIndex=a),this.parent.isPrinting&&("All"===this.parent.hierarchyPrintMode?l.isExpand=!0:"Expanded"===this.parent.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[parseInt(t.toString(),10)]&&(l.isExpand=this.parent.expandedRows[parseInt(t.toString(),10)].isExpand)),l.cssClass=i,l.isAltRow=!!this.parent.enableAltRow&&t%2!=0,l.isAltRow=!!this.parent.enableAltRow&&t%2!=0,this.parent.getPrimaryKeyFieldNames()[0]),s=(l.isSelected=this.parent.isPersistSelection&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading?!H.isNullOrUndefined(this.parent.selectionModule.selectedRowState[e[""+n]]):-1<this.parent.getSelectedRowIndexes().indexOf(t),this.refreshForeignKeyRow(l),this.ensureColumns()),r=(this.parent.pinnedDataCount&&this.parent.pinnedTopRecords.length&&t<this.parent.pinnedDataCount&&(s=this.ensurePinnedColumns()),new ds(l,this.parent));return r.cells="Right"===this.parent.getFrozenMode()?this.generateCells(l).concat(s):s.concat(this.generateCells(l)),r},eo.prototype.refreshForeignKeyRow=function(e){for(var t=this.parent.getForeignKeyColumns(),i=0;i<t.length;i++)H.setValue(t[parseInt(i.toString(),10)].field,$p(t[parseInt(i.toString(),10)],e.data),e.foreignKeyData)},eo.prototype.generateCells=function(e){for(var t=this.parent.getColumns(),i=[],n=0;n<t.length;n++)i.push(this.generateCell(t[parseInt(n.toString(),10)],e.uid,H.isNullOrUndefined(t[parseInt(n.toString(),10)].commands)?void 0:oe.CellType.CommandColumn,null,n,e.foreignKeyData));return i},eo.prototype.generateCell=function(e,t,i,n,r,s){t={visible:e.visible,isDataCell:!H.isNullOrUndefined(e.field||e.template||"rownumber"===e.type),isTemplate:!H.isNullOrUndefined(e.template),rowID:t,column:e,cellType:H.isNullOrUndefined(i)?oe.CellType.Data:i,colSpan:n,commands:e.commands,isForeignKey:e.isForeignColumn&&e.isForeignColumn(),foreignKeyData:e.isForeignColumn&&e.isForeignColumn()&&H.getValue(e.field,s)};return(t.isDataCell||"checkbox"===t.column.type||t.commands)&&(t.index=r),new cs(t)},eo.prototype.refreshRows=function(e){for(var t=0;t<e.length;t++)this.refreshForeignKeyRow(e[parseInt(t.toString(),10)]),e[parseInt(t.toString(),10)].cells=this.generateCells(e[parseInt(t.toString(),10)]);return e},eo.prototype.getInfiniteIndex=function(e){return"infiniteScroll"===e.requestType||"delete"===e.requestType||"add"===e.action?H.isNullOrUndefined(e.startIndex)?e.index:e.startIndex:0};var Js=eo;function eo(e){this.parent=e}to=function(e,t){return(to=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var to,t=function(e,t){function i(){this.constructor=e}to(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},io=(no.prototype.getData=function(){for(var t=this,e=[],i=this.parent.aggregates.slice(),n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)].columns.filter(function(e){return!(e.footerTemplate||e.groupFooterTemplate||e.groupCaptionTemplate)||t.columnSelector(e)});r.length&&e.push({columns:r})}return e},no.prototype.columnSelector=function(e){return void 0!==e.footerTemplate},no.prototype.getColumns=function(e){var t=[];if(!this.parent.detailTemplate&&H.isNullOrUndefined(this.parent.childGrid)||t.push(new Q({})),this.parent.allowGrouping)for(var i=0;i<this.parent.groupSettings.columns.length;i++)t.push(new Q({}));return this.parent.isRowDragable()&&!e&&t.push(new Q({})),t.push.apply(t,this.parent.getColumns()),t},no.prototype.generateRows=function(e,t,i,n,r){if(0===e.length&&(void 0===t||!t.count&&!t.loadSummaryOnEmpty))return[];for(var s=this.buildSummaryData(e,t),o=[],a=this.getData(),l=0;l<a.length;l++)o.push(this.getGeneratedRow(a[parseInt(l.toString(),10)],s[parseInt(l.toString(),10)],t?t.level:void 0,i,n,t?t.parentUid:void 0,r));return o},no.prototype.getGeneratedRow=function(e,t,i,n,r,s,o){for(var a=[],l=this.getIndentByLevel(),h=!H.isNullOrUndefined(this.parent.childGrid),d=this.parent.getIndentCount(),p=(this.parent.groupSettings.columns.length&&this.parent.allowRowDragAndDrop?l.push("e-indentcelltop"):this.parent.isRowDragable()&&!n&&(l=["e-indentcelltop"]),o||this.getColumns(n)),c=0;c<p.length;c++)a.push(this.getGeneratedCell(p[parseInt(c.toString(),10)],e,d<=c?this.getCellType():0===c&&(this.parent.childGrid||this.parent.detailTemplate)?oe.CellType.DetailFooterIntent:oe.CellType.Indent,l[parseInt(c.toString(),10)],h));o=new ds({data:t,attributes:{class:"e-summaryrow"}});return o.cells=a,o.uid=bp("grid-row"),o.parentUid=s,o.isAggregateRow=!0,o.visible=!!this.parent.enableColumnVirtualization||a.some(function(e){return e.isDataCell&&e.visible}),o},no.prototype.getGeneratedCell=function(t,e,i,n,r){var e=e.columns.filter(function(e){return e.columnName===t.field})[0],s={"data-mappinguid":t.uid,"data-index":t.index},o=(t.textAlign&&(o={right:"e-rightalign",left:"e-leftalign",center:"e-centeralign",justify:"e-justifyalign"})[t.textAlign.toLowerCase()]&&(s.class=o[t.textAlign.toLowerCase()]),n&&(s.class=n),H.isNullOrUndefined(n)&&r&&(s.class="e-detailindentcelltop"),{visible:t.visible,isDataCell:!H.isNullOrUndefined(e),isTemplate:e&&!H.isNullOrUndefined(e.footerTemplate||e.groupFooterTemplate||e.groupCaptionTemplate),column:e||{},attributes:s,cellType:i});return o.column.headerText=t.headerText,new cs(o)},no.prototype.buildSummaryData=function(e,t){for(var i=[],n=this.getData(),r={},s=0;s<n.length;s++){for(var r={},o=n[parseInt(s.toString(),10)].columns,a=0;a<o.length;a++)r=this.setTemplate(o[parseInt(a.toString(),10)],t&&t.aggregates?t:e,r);i.push(r)}return i},no.prototype.getIndentByLevel=function(){return this.parent.groupSettings.columns.map(function(){return"e-indentcelltop"})},no.prototype.setTemplate=function(e,t,i){var n=e.type,r={},s=e.getFormatter()||function(e){return e},o=t;n instanceof Array||(n=[e.type]);for(var a=0;a<n.length;a++){var l=e.field+" - "+n[parseInt(a.toString(),10)].toLowerCase(),h=e.columnName,d=!!(this.parent.groupSettings.disablePageWiseAggregates&&this.parent.groupSettings.columns.length&&o.items),d=("Custom"!==n[parseInt(a.toString(),10)]||d)&&o.aggregates&&l in o.aggregates?o.aggregates[l]:xp(n[parseInt(a.toString(),10)],o.aggregates?o:t,e,this.parent);i[""+h]=i[""+h]||{},i[""+h][l]=d,i[""+h][n[parseInt(a.toString(),10)]]=H.isNullOrUndefined(d)?" ":s(d),o.field&&(i[""+h].field=o.field,i[""+h].key=o.key)}return r.format=e.getFormatter(),e.setTemplate(r),i},no.prototype.getCellType=function(){return oe.CellType.Summary},no);function no(e){this.parent=e}t(oo,ro=io),oo.prototype.columnSelector=function(e){return void 0!==e.groupFooterTemplate},oo.prototype.getIndentByLevel=function(i){return void 0===i&&(i=this.parent.groupSettings.columns.length),this.parent.allowRowDragAndDrop&&this.parent.groupSettings.columns.length&&--i,this.parent.groupSettings.columns.map(function(e,t){return t<=i-1?"":"e-indentcelltop"})},oo.prototype.getCellType=function(){return oe.CellType.GroupSummary};var ro,so=oo;function oo(){return null!==ro&&ro.apply(this,arguments)||this}t(ho,ao=io),ho.prototype.columnSelector=function(e){return void 0!==e.groupCaptionTemplate},ho.prototype.getData=function(){return[ao.prototype.getData.call(this).reduce(function(e,t){return e.columns=e.columns.concat(t.columns),e},{columns:[]})]},ho.prototype.isEmpty=function(){return 0===(this.getData()[0].columns||[]).length},ho.prototype.getCellType=function(){return oe.CellType.CaptionSummary};var ao,lo=ho;function ho(){return null!==ao&&ao.apply(this,arguments)||this}po=function(e,t){return(po=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}po(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(go,co=Js),go.prototype.generateRows=function(e,t){if(0===this.parent.groupSettings.columns.length)return co.prototype.generateRows.call(this,e,t);if(this.parent.enableDomVirtualization&&t)return this.generateDomVirtualGroupRows(e,t);this.isInfiniteScroll="infiniteScroll"===t.requestType,this.rows=[],this.index=this.parent.enableVirtualization||this.isInfiniteScroll?t.startIndex:this.parent.pinnedTopRowModels.length;for(var i=0,n=e.length;i<n;i++)this.infiniteChildCount=0,this.renderInfiniteAgg=!0,this.getGroupedRecords(0,e[parseInt(i.toString(),10)],e.level,i,void 0,this.rows.length);return this.index=0,this.parent.isCollapseStateEnabled()&&this.ensureRowVisibility(),this.rows},go.prototype.buildGroupRowObj=function(e,t){var i=this;if(t&&-1!==this.parent.domVirtualClearActions.indexOf(t)&&this.parent.clearDomVirtualRowCache(),0===this.parent.domRowObj.size){this.isInfiniteScroll=!1,this.rows=[],this.index=this.parent.pinnedTopRowModels.length;for(var n=0,r=e.length;n<r;n++)this.infiniteChildCount=0,this.renderInfiniteAgg=!0,this.getGroupedRecords(0,e[parseInt(n.toString(),10)],e.level,n,void 0,this.rows.length);this.index=0,this.parent.isCollapseStateEnabled()&&this.ensureRowVisibility(),this.parent.domRowObj.clear(),this.rows.forEach(function(e,t){i.parent.domRowObj.set(t,e),i.parent.notify(ns,{row:e})})}},go.prototype.generateDomVirtualGroupRows=function(e,t){this.buildGroupRowObj(e,t.requestType);var e=this.getVisibleGroupRows(),i=t.startIndex||0,t=void 0!==t.endIndex?Math.min(t.endIndex,e.length):e.length;return e.slice(i,t)},go.prototype.getVisibleGroupRows=function(){var e=[],t=[];this.parent.domRowObj.forEach(function(e){t.push(e)});for(var i=0;i<t.length;i++)e.push(t[parseInt(i.toString(),10)]),!t[parseInt(i.toString(),10)].isExpand&&t[parseInt(i.toString(),10)].isCaptionRow&&(i+=sp(t[parseInt(i.toString(),10)],this.parent));return e},go.prototype.cleardomGroupRowObj=function(){this.parent.clearDomVirtualRowCache()},go.prototype.getGroupedRecords=function(e,t,i,n,r,s,o){if(H.isNullOrUndefined(t.items))if(H.isNullOrUndefined(t.GroupGuid))this.rows=this.rows.concat(this.generateDataRows(t,e,n,this.rows.length,o));else for(var a=0,l=t.length;a<l;a++)this.getGroupedRecords(e,t[parseInt(a.toString(),10)],t.level,n,e,this.rows.length,o);else{var h=void 0,r=this.generateCaptionRow(t,e,n,r,s,o);if((h=this.isInfiniteScroll?this.getPreCaption(e,r.data.key):h)?r.uid=h.uid:this.rows=this.rows.concat(r),t.items&&t.items.length&&this.getGroupedRecords(e+1,t.items,t.items.level,n,e+1,this.rows.length,r.uid),this.parent.aggregates.length&&this.isRenderAggregate(r)){var d=this.rows.length;(s=this.rows).push.apply(s,this.summaryModelGen.generateRows(t,{level:i,parentUid:r.uid}));for(var p=d-1;0<=p;p--)if(this.rows[parseInt(p.toString(),10)].isCaptionRow)this.rows[parseInt(p.toString(),10)].aggregatesCount=this.rows.length-d;else if(!this.rows[parseInt(p.toString(),10)].isCaptionRow&&!this.rows[parseInt(p.toString(),10)].isDataRow)break}h&&this.setInfiniteRowVisibility(h)}},go.prototype.isRenderAggregate=function(e){return this.parent.enableInfiniteScrolling?!!this.renderInfiniteAgg&&(this.getPreCaption(e.indent,e.data.key),this.renderInfiniteAgg=e.data.count===this.infiniteChildCount,this.renderInfiniteAgg):!this.parent.enableInfiniteScrolling},go.prototype.getPreCaption=function(e,t){for(var i,n,r=this.parent.getRowsObject().concat(this.rows),s=(this.infiniteChildCount=0,r.length);s--&&(r[parseInt(s.toString(),10)].isCaptionRow&&r[parseInt(s.toString(),10)].indent===e&&((n=r[parseInt(s.toString(),10)].data.key)&&t&&n.toString()===t.toString()&&n instanceof Date||n===t)&&(i=r[parseInt(s.toString(),10)]),!(r[parseInt(s.toString(),10)].indent===e||r[parseInt(s.toString(),10)].indent<e));)r[parseInt(s.toString(),10)].indent===e+1&&this.infiniteChildCount++;return i},go.prototype.getCaptionRowCells=function(t,e,i){var n,r,s=[],o=[],a=this.parent.getColumnByField(t),l=this.parent.getColumnIndexesInView(),h=(this.parent.enableColumnVirtualization&&(a=this.parent.columns.filter(function(e){return e.field===t})[0]),this.parent.groupSettings.columns.length),d=this.parent;if(!this.parent.enableColumnVirtualization||-1!==l.indexOf(e)){for(var p=0;p<e;p++)s.push(this.generateIndentCell());s.push(this.generateCell({},null,oe.CellType.Expand))}e=this.parent.enableColumnVirtualization?1:this.parent.getVisibleColumns().length+h+(d.detailTemplate||d.childGrid?1:0)-e+(this.parent.getVisibleColumns().length?-1:0),this.parent.aggregates.length&&!this.captionModelGen.isEmpty()&&(n=this.captionModelGen.generateRows(i)[0],H.extend(i,n.data),r=0,n.cells.some(function(e,t){return r=t,e.visible&&e.isDataCell}),o=n.cells.slice(r).filter(function(e){return e.visible}),n.visible&&o[0].column.field===this.parent.getVisibleColumns()[0].field&&(o=o.slice(1)),e-=(o=1===this.parent.getVisibleColumns().length?[]:o).length);for(var c=this.parent.enableColumnVirtualization?this.parent.getColumns():[a],u=!0,g=0;g<c.length;g++){var f=u&&-1!==l.indexOf(e),f=(f&&(u=!1),!this.parent.enableColumnVirtualization||f?oe.CellType.GroupCaption:oe.CellType.GroupCaptionEmpty);e=this.parent.enableColumnVirtualization&&f===oe.CellType.GroupCaption?e+h:e,d.isRowDragable()&&e++,s.push(this.generateCell(a,null,f,e))}return s.push.apply(s,o),s},go.prototype.generateCaptionRow=function(e,t,i,n,r,s){var o={},a="records",l=this.parent.getColumnByField(e.field),l=(o.data=H.extend({},e),l&&(o.data.field=e.field),o.isDataRow=!1,o.isExpand=!this.parent.groupSettings.enableLazyLoading&&!this.parent.isCollapseStateEnabled(),o.parentGid=i,o.childGid=n,o.tIndex=r,o.isCaptionRow=!0,o.parentUid=s,o.gSummary=(H.isNullOrUndefined(e.items[a])?e.items:e.items[a]).length,o.uid=bp("grid-row"),new ds(o));return l.indent=t,this.getForeignKeyData(l),l.cells=this.getCaptionRowCells(e.field,t,l.data),l},go.prototype.getForeignKeyData=function(e){var t=e.data,i=this.parent.getColumnByField(t.field);i&&i.isForeignColumn&&i.isForeignColumn()&&(t=H.isNullOrUndefined(t.key)?"":i.valueAccessor(i.foreignKeyValue,$p(i,{},t.key)[0],i),H.setValue("foreignKey",t,e.data))},go.prototype.generateDataRows=function(e,t,i,n,r){for(var s=[],o=this.parent.getColumnIndexesInView(),a=0,l=e.length;a<l;a++,n++){s[parseInt(a.toString(),10)]=this.generateRow(e[parseInt(a.toString(),10)],this.index,a?void 0:"e-firstchildrow",t,i,n,r,a);for(var h=0;h<t;h++)this.parent.enableColumnVirtualization&&-1===o.indexOf(t)||s[parseInt(a.toString(),10)].cells.unshift(this.generateIndentCell());this.index++}return s},go.prototype.generateIndentCell=function(){return this.generateCell({},null,oe.CellType.Indent)},go.prototype.refreshRows=function(e){for(var t=this.parent.getColumnIndexesInView(),i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].isDataRow){e[parseInt(i.toString(),10)].cells=this.generateCells(e[parseInt(i.toString(),10)]);for(var n=0;n<e[parseInt(i.toString(),10)].indent;n++)this.parent.enableColumnVirtualization&&-1===t.indexOf(e[parseInt(i.toString(),10)].indent)||e[parseInt(i.toString(),10)].cells.unshift(this.generateIndentCell())}else{var r=this.generateCaptionRow(e[parseInt(i.toString(),10)].data,e[parseInt(i.toString(),10)].indent);e[parseInt(i.toString(),10)].cells=r.cells}return e},go.prototype.setInfiniteRowVisibility=function(e){if(!e.isExpand||!1===e.visible)for(var t=0,i=this.rows;t<i.length;t++){var n=i[t];n.parentUid===e.uid&&(n.visible=!1,n.isCaptionRow)&&this.setInfiniteRowVisibility(n)}},go.prototype.ensureRowVisibility=function(){for(var e=0;e<this.rows.length;e++){var t=this.rows[parseInt(e.toString(),10)];if(t.isCaptionRow)for(var i=e+1;i<this.rows.length;i++){var n=this.rows[parseInt(i.toString(),10)];t.uid===n.parentUid&&(this.rows[parseInt(i.toString(),10)].visible=t.isExpand)}}};var po,co,uo=go;function go(e){var t=co.call(this,e)||this;return t.rows=[],t.index=0,t.infiniteChildCount=0,t.renderInfiniteAgg=!0,t.parent=e,t.summaryModelGen=new so(e),t.captionModelGen=new lo(e),t}i.prototype.beforeCellFocused=function(e){!e.byKey||"upArrow"!==e.keyArgs.action&&"downArrow"!==e.keyArgs.action?this.pressedKey=void 0:this.pressedKey=e.keyArgs.action},i.prototype.renderPanel=function(){var e,t=this.parent,i=this.parent.element.querySelector("."+vs);i?(this.ariaService.setOptions(this.parent.element.querySelector("."+xs),{busy:!1}),this.setPanel(i)):(i=this.parent.createElement("div",{className:vs}),e=this.parent.createElement("div",{className:xs}),this.ariaService.setOptions(e,{busy:!1}),this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&(this.renderHorizontalScrollbar(i),e.classList.add("e-virtual-content")),i.appendChild(e),this.setPanel(i),t.element.appendChild(i))},i.prototype.renderHorizontalScrollbar=function(e){var t=this.parent.createElement("div",{className:"e-movablescrollbar"}),i=this.parent.createElement("div",{className:"e-movablechild"}),n=Op().toString();this.setScrollbarHeight(i,n),this.setScrollbarHeight(t,n),t.appendChild(i),e.appendChild(t)},i.prototype.setScrollbarHeight=function(e,t){e.style.minHeight=t+"px",e.style.maxHeight=t+"px"},i.prototype.renderTable=function(){var e=this.getPanel(),t=e.querySelector(".e-virtualtable"),i=e.querySelector(".e-virtualtrack"),t=(!this.parent.enableVirtualization||H.isNullOrUndefined(t)||H.isNullOrUndefined(i)||(H.remove(t),H.remove(i)),e.querySelector(".e-virtual-vertical-scrollbar")),i=e.querySelector(".e-virtual-horizontal-scrollbar");this.parent.enableVirtualization&&!H.isNullOrUndefined(t)&&H.remove(t),this.parent.enableColumnVirtualization&&!H.isNullOrUndefined(i)&&H.remove(i),e.appendChild(this.createContentTable("_content_table")),this.setTable(e.querySelector("."+Ds)),"Multiple"===this.parent.selectionSettings.type&&this.ariaService.setOptions(this.parent.element,{multiselectable:!0}),this.initializeContentDrop(),this.parent.frozenRows&&this.parent.getHeaderContent().classList.add("e-frozenhdr")},i.prototype.createContentTable=function(e){var t=this.getPanel().firstElementChild,e=(this.getTable()&&H.remove(this.getTable()),t.querySelector("."+Ds)?t.querySelector("."+Ds):this.parent.createElement("table",{className:Ds,attrs:{role:"presentation",id:this.parent.element.id+e}}));return e.style.cssText="border-collapse: separate; border-spacing: .25px;",this.setColGroup(this.parent.getHeaderTable().querySelector(qs).cloneNode(!0)),e.appendChild(this.getColGroup()),e.appendChild(this.parent.createElement(j,{attrs:{role:"rowgroup"}})),t.appendChild(e),t},i.prototype.refreshContentRows=function(h){var t=this,d=(void 0===h&&(h={}),this.parent);if(0!==d.currentViewData.length){d.editSettings&&d.editModule&&"Batch"===d.editSettings.mode&&d.editModule.formObj&&!1===d.editSettings.showConfirmDialog&&d.editModule.destroyForm();var p,c,u,g,f,m=this.currentMovableRows||d.currentViewData,e=d.isReact&&!H.isNullOrUndefined(d.rowTemplate),y=this.parent.printGridParent&&this.parent.printGridParent.isReact,v=e||y?d.createElement(j,{attrs:{role:"rowgroup"}}):document.createDocumentFragment(),S=(this.initialPageRecords||(this.initialPageRecords=H.extend([],m)),e?d.createElement(j,{attrs:{role:"rowgroup"}}):document.createDocumentFragment()),C=((d.isReact||y)&&d.rowTemplate&&(p=v,c=S),d.getColumns()),w=new $s(this.serviceLocator,null,this.parent),b=this.parent.enableInfiniteScrolling&&"infiniteScroll"===h.requestType,i=this.isInfiniteColumnvirtualization()&&"virtualscroll"!==h.requestType,n=!(!d.enableInfiniteScrolling||!d.childGrid&&!d.detailTemplate),r=n&&("add"===h.action&&"save"===h.requestType||"delete"===h.requestType),I=(r&&(h.startIndex=0,d.notify(ts,{})),b&&(d.childGrid||d.detailTemplate)&&!d.infiniteScrollSettings.enableCache||(n&&(this.parent.infiniteScrollModule.infiniteDetailDestroy=!0),d.notify(Lr,b&&(d.childGrid||d.detailTemplate)&&d.infiniteScrollSettings.enableCache?h:{})),this.rowElements=[],this.rows=[],!(this.tempFreezeRows=[])),R=!(!this.parent.frozenRows||!this.parent.groupSettings.columns.length),s=(tc(d)&&["sorting","filtering","searching","grouping","ungrouping","reorder","save","delete","refresh-aggregate-on-save"].some(function(e){return h.requestType===e})&&this.emptyVcRows(),f=this.checkCache(f,h),d.isRowPinned&&(n=new V.Query,k=(k=this.parent.getDataModule()).pinnedData.executeLocal(k.pinnedDataQuery(n)),d.pinnedDataCount=k.length,d.pinnedTopRowModels=this.generator.generatePinnedTopRows(k)),this.isAddRows||this.useGroupCache||(f=this.generator.generateRows(m,h)),this.setGroupCache(f,h),this.parent.notify(Hn,{isInfiniteScroll:b,modelData:f,args:h}),this.parent.registeredTemplate);if(this.parent.isAngular&&("infiniteScroll"!==h.requestType||this.parent.infiniteScrollSettings.enableCache)&&s&&s.detailTemplate&&!h.isFrozen&&this.parent.destroyTemplate(["detailTemplate"]),("infiniteScroll"!==h.requestType||this.parent.infiniteScrollSettings.enableCache)&&s&&s.template&&!h.isFrozen){for(var o=[],a=0;a<s.template.length;a++)for(var l=0;l<s.template[parseInt(a.toString(),10)].rootNodes.length;l++)H.isNullOrUndefined(s.template[parseInt(a.toString(),10)].rootNodes[parseInt(l.toString(),10)].parentNode)&&o.push(s.template[parseInt(a.toString(),10)]);this.parent.destroyTemplate(["template"],o)}this.parent.isAngular&&("infiniteScroll"!==h.requestType||this.parent.infiniteScrollSettings.enableCache)&&s&&this.parent.columnTemplateIDs&&0<this.parent.columnTemplateIDs.length&&!h.isFrozen&&(this.parent.destroyTemplate(this.parent.columnTemplateIDs),this.parent.columnTemplateIDs=[]),!this.parent.isReact&&!this.parent.isVue||"infiniteScroll"===h.requestType&&!this.parent.infiniteScrollSettings.enableCache||h.isFrozen||(n=[this.parent.isVue?"template":"columnTemplate","rowTemplate","detailTemplate","captionTemplate","commandsTemplate","groupFooterTemplate","groupCaptionTemplate"],"infiniteScroll"===h.requestType&&this.parent.infiniteScrollSettings.enableCache&&(n=[this.parent.isVue?"template":"columnTemplate","commandsTemplate"]),Zc(this.parent,n));for(a=0;a<d.pinnedTopRowModels.length;a++){for(var x=w.render(d.pinnedTopRowModels[parseInt(a.toString(),10)],C),D=(Pc(x),x.classList.add("e-grid-pin-row"),[].slice.call(x.querySelectorAll(".e-pindentcell"))),T=0;T<D.length;T++)D[parseInt(T.toString(),10)].classList.add("e-leftfreeze"),Lc(D[parseInt(T.toString(),10)],30*T,d.enableRtl,"Left"),T===D.length-1&&D[parseInt(T.toString(),10)].classList.add("e-lastpindentcell");S.appendChild(x)}this.parent.enableColumnVirtualization&&new gs(this.serviceLocator,this.parent).updateVirtualCells(f),this.tbody=this.getTable().querySelector(j);var E=0,O=!0;if(tc(d)&&d.vcRows.length){var A=H.isNullOrUndefined(h.virtualInfo.offsets)?H.isNullOrUndefined(h.scrollTop)?0:h.scrollTop.top:h.virtualInfo.offsets.top;if(0!==A){for(var N=d.vGroupOffsets,F=d.pageSettings.pageSize/2,B=Object.keys(N).map(function(e){return N[""+e]}),M=0;M<B.length;M++)if(A<B[parseInt(M.toString(),10)]){if(H.isNullOrUndefined(h.virtualInfo)||"up"!==h.virtualInfo.direction){E=M*F,(this.parent.contentModule.isEndBlock(M)||this.parent.contentModule.isEndBlock(M+1))&&(h.virtualInfo.blockIndexes=[M,M+1]);break}E=0<M?(M-1)*F:M*F;break}Math.round(A+this.contentPanel.firstElementChild.offsetHeight)>=this.contentPanel.firstElementChild.scrollHeight&&!h.rowObject&&(O=!1)}}var k=d.frozenRows&&this.parent.enableVirtualization&&"reorder"===h.requestType;if(d.frozenRows&&"virtualscroll"===h.requestType&&"X"===h.virtualInfo.sentinelInfo.axis||k){var n=h.virtualInfo.blockIndexes,P=h.virtualInfo.page,z=(h.virtualInfo.blockIndexes=[1,2],k&&(h.virtualInfo.page=1),k?this.initialPageRecords:m),q=this.vgenerator.generateRows(z,h);q.splice(this.parent.frozenRows);for(a=0;a<this.parent.frozenRows;a++)Pc(u=w.render(q[parseInt(a.toString(),10)],C)),S.appendChild(u);h.virtualInfo.blockIndexes=n,h.virtualInfo.page=P,k&&1===h.virtualInfo.page&&f.splice(0,this.parent.frozenRows)}this.virtualFrozenHdrRefresh(S,f,w,h,m,C),this.parent.groupSettings.enableLazyLoading&&!this.useGroupCache&&this.parent.groupSettings.columns.length&&((this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).refRowsObj[this.parent.pageSettings.currentPage]=[]);for(var z="pin-row"===h.requestType||"unpin-row"===h.requestType,L=((this.parent.enableInfiniteScrolling&&this.parent.groupSettings.enableLazyLoading&&"delete"===h.requestType||r||this.parent.enableInfiniteScrolling&&z)&&(this.visibleRows=[]),"paging"===h.requestType&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&(this.parent.currentViewData=[]),this),a=E,U=f.length;a<U;a++)if("break"===function(t){if(L.rows.push(f[parseInt(t.toString(),10)]),L.parent.groupSettings.enableLazyLoading&&!L.useGroupCache&&L.parent.groupSettings.columns.length&&((L.parent.enableVirtualization?L.parent.lazyLoadRender:L.parent.contentModule).refRowsObj[L.parent.pageSettings.currentPage].push(f[parseInt(t.toString(),10)]),L.setRowsInLazyGroup(f[parseInt(t.toString(),10)],t),H.isNullOrUndefined(f[parseInt(t.toString(),10)].indent)))return"continue";if("paging"===h.requestType&&L.parent.groupSettings.enableLazyLoading&&L.parent.groupSettings.columns.length&&(f[parseInt(t.toString(),10)].isDataRow?L.parent.currentViewData[f[parseInt(t.toString(),10)].index]=f[parseInt(t.toString(),10)].data:f[parseInt(t.toString(),10)].isCaptionRow&&!f.some(function(e){return e.isDataRow})&&L.parent.currentViewData.push(f[parseInt(t.toString(),10)].data)),L.setInfiniteVisibleRows(h,f[parseInt(t.toString(),10)]),tc(d)&&h.virtualInfo&&h.virtualInfo.blockIndexes&&L.rowElements.length>=h.virtualInfo.blockIndexes.length*L.parent.contentModule.getBlockSize()&&O)return L.parent.currentViewData.records=L.rows.map(function(e){return e.data}),"break";if(d.rowTemplate){var e=d.element.id+"rowTemplate",i=void 0,n=L.parent.isRowDomVirtualization()?f[parseInt(t.toString(),10)].data:m[parseInt(t.toString(),10)];if(d.isReact||y){var r,s=d.frozenRows&&t<d.frozenRows,o=H.extend({index:t},n);if(d.getRowTemplate()(o,d,"rowTemplate",e,null,null,s?S:v),d.requireTemplateRef)return(r=L).parent.renderTemplates(function(){d.frozenRows&&t<d.frozenRows?u=c.childNodes[parseInt(t.toString(),10)]:g=p.childNodes[parseInt(t.toString(),10)];var e={data:f[parseInt(t.toString(),10)].data,row:g||u};r.parent.trigger(ne,e),(f[parseInt(t.toString(),10)].isDataRow||r.parent.enableVirtualization&&r.parent.groupSettings.enableLazyLoading)&&r.rowElements.push(e.row),r.ariaService.setOptions(r.parent.element,{colcount:d.getColumns().length.toString()}),t===f.length-1&&(c=p=null)}),"continue"}else i=d.getRowTemplate()(H.extend({index:t},n),d,"rowTemplate",e,void 0,void 0,void 0,L.parent.root);if(d.isReact||"TBODY"!==i[0].tagName)d.frozenRows&&t<d.frozenRows?u=d.isReact?S.lastElementChild:Ip(S,i):(d.isReact||(u=Ip(v,i)),g=(d.isReact?v:u).lastElementChild);else{for(var a=0;a<i.length;a++){var l="tr"===i[parseInt(a.toString(),10)].nodeName.toLowerCase();(l||i[parseInt(a.toString(),10)].querySelectorAll&&i[parseInt(a.toString(),10)].querySelectorAll("tr").length)&&(u=l?i[parseInt(a.toString(),10)]:i[parseInt(a.toString(),10)].querySelector("tr"))}(d.frozenRows&&t<d.frozenRows?S:v).appendChild(u)}o={data:f[parseInt(t.toString(),10)].data,row:g||u};L.parent.trigger(ne,o)}else{var n,s=f[parseInt(t.toString(),10)],e=(s.isCaptionRow&&(I=t<d.frozenRows||R),Pc(u=w.render(s,C)),L.ensureFrozenHeaderRender(h));(d.frozenRows&&(t<d.frozenRows||I)&&!b&&"virtualscroll"!==h.requestType&&"dom-virtualscroll"!==h.requestType&&e&&L.ensureVirtualFrozenHeaderRender(h)?S:(o=d.getPrimaryKeyFieldNames()[0],n=s.data,H.isNullOrUndefined(o)||H.isNullOrUndefined(n)||!d.pinnedTopRowKeys[n[""+o]]||u.classList.add("e-grid-pin-row"),v)).appendChild(u),1+(parseInt(u.getAttribute("aria-rowindex"),10)-1)!==d.frozenRows||s.isCaptionRow||s.isAggregateRow||(R=!1),s.isExpand&&d.notify(Ji,u.cells[d.groupSettings.columns.length])}(f[parseInt(t.toString(),10)].isDataRow||L.parent.enableVirtualization&&L.parent.groupSettings.enableLazyLoading)&&(!H.isNullOrUndefined(d.rowTemplate)&&(d.isAngular||d.isVue3||d.isVue)?L.rowElements.push(g||u):L.rowElements.push(u)),L.ariaService.setOptions(L.parent.element,{colcount:d.getColumns().length.toString()})}(a))break;n=d.parentDetails&&d.parentDetails.parentInstObj&&d.parentDetails.parentInstObj.isReact;!d.isReact&&!n||d.requireTemplateRef||d.renderTemplates(),this.parent.enableInfiniteScrolling&&this.parent.groupSettings.enableLazyLoading&&(this.parent.contentModule.refRowsObj[this.parent.pageSettings.currentPage]=this.parent.contentModule.groupCache[this.parent.pageSettings.currentPage]),this.parent.groupSettings.enableLazyLoading&&!this.useGroupCache&&this.parent.groupSettings.columns.length&&this.parent.notify(Cr,{rows:(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).refRowsObj[this.parent.pageSettings.currentPage]}),d.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}),((d.frozenRows||d.isRowPinned)&&"virtualscroll"!==h.requestType&&"dom-virtualscroll"!==h.requestType&&!b&&this.ensureVirtualFrozenHeaderRender(h)||"virtualscroll"===h.requestType&&h.virtualInfo.sentinelInfo&&"X"===h.virtualInfo.sentinelInfo.axis||("virtualscroll"===h.requestType||b||"delete"===h.requestType)&&d.isRowPinned)&&(P=d.getHeaderTable().querySelector(j),(e?(k=P.parentElement,H.remove(P),k):(P.innerHTML="",P)).appendChild(S),d.isInitialLoad||d.scrollModule.setHeight()),h.rows=this.rows.slice(0),ep(function(){t.parent.notify(Wi,h),t.parent.enableVirtualization&&!t.parent.isRowDomVirtualization()||t.parent.enableColumnVirtualization&&!i||b||(d.isReact||(t.tbody.innerHTML=""),H.isNullOrUndefined(t.tbody.parentElement)?H.remove(d.getContentTable().querySelector(j)):H.remove(t.tbody),t.tbody=t.parent.createElement(j,{attrs:{role:"rowgroup"}})),d.rowTemplate&&H.updateBlazorTemplate(d.element.id+"rowTemplate","RowTemplate",d),!H.isNullOrUndefined(t.parent.infiniteScrollModule)&&(t.parent.enableInfiniteScrolling&&!t.isInfiniteColumnvirtualization()||i)?(t.isAddRows=!1,t.parent.notify(Un,{args:h}),t.parent.notify(qn,{tbody:t.tbody,frag:v,args:h,rows:t.rows,rowElements:t.rowElements,visibleRows:t.visibleRows,tableName:void 0}),t.isInfiniteColumnvirtualization()&&t.parent.isFrozenGrid()&&(e=dc(t.parent.getContent().querySelector(".e-virtualtable")),t.parent.contentModule.resetStickyLeftPos(e.width),t.widthService.refreshFrozenScrollbar())):(t.useGroupCache=!1,t.appendContent(t.tbody,v,h)),t.parent.editSettings.showAddNewRow&&(t.parent.enableVirtualization||t.parent.enableInfiniteScrolling)&&(e=t.parent.element.querySelector(".e-addrow-removed"))&&H.remove(e);var e=!t.parent.element.querySelector("."+As);t.parent.editSettings.showAddNewRow&&"Normal"===t.parent.editSettings.mode&&(e&&((t.parent.enableVirtualization||t.parent.enableInfiniteScrolling)&&(t.parent.isAddNewRow=!0),t.parent.isEdit=!1,t.parent.addRecord()),e||(t.parent.enableVirtualization||t.parent.enableInfiniteScrolling)&&["sorting","filtering","searching","grouping","ungrouping","reorder"].some(function(e){return h.requestType===e}))&&t.parent.notify(Yr,{}),t.parent.getContent()&&(t.parent.frozenRightCount||t.parent.frozenLeftCount)&&0<cc(t.parent)&&t.parent.scrollModule.updateFrozenShadow(),v=null},this.rafCallback(H.extend({},h)))}},i.prototype.isInfiniteColumnvirtualization=function(){return this.parent.enableColumnVirtualization&&this.parent.enableInfiniteScrolling},i.prototype.enableCacheOnInfiniteColumnVirtual=function(){return this.isInfiniteColumnvirtualization()&&this.parent.infiniteScrollSettings.enableCache},i.prototype.emptyVcRows=function(){this.parent.vcRows=[],this.parent.vRows=[]},i.prototype.appendContent=function(e,t,i,n){if(this.parent.isReact&&!H.isNullOrUndefined(this.parent.rowTemplate)?this.getTable().appendChild(t):(e.appendChild(t),this.getTable().appendChild(e)),"Vertical"===this.parent.rowRenderingMode&&this.parent.allowTextWrap&&("Header"===this.parent.textWrapSettings.wrapMode||"Both"===this.parent.textWrapSettings.wrapMode))for(var r=e.querySelectorAll("td"),s=0;s<r.length;s++){var o=parseFloat(document.defaultView.getComputedStyle(r[parseInt(s.toString(),10)],"::before").getPropertyValue("height"));r[parseInt(s.toString(),10)].offsetHeight<o&&(r[parseInt(s.toString(),10)].style.height=o+"px",r[parseInt(s.toString(),10)].style.boxSizing="content-box")}this.parent.getVisibleFrozenLeftCount()&&this.parent.enableColumnVirtualization&&this.widthService.refreshFrozenScrollbar()},i.prototype.setRowsInLazyGroup=function(e,t){this.parent.groupSettings.enableLazyLoading&&!this.useGroupCache&&this.parent.groupSettings.columns.length&&(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).maintainRows(e,t)},i.prototype.setGroupCache=function(e,t){!this.useGroupCache&&this.parent.groupSettings.enableLazyLoading&&this.parent.notify(Yn,{args:t,data:e})},i.prototype.ensureFrozenHeaderRender=function(e){return!(this.parent.enableVirtualization&&("reorder"===e.requestType||"refresh"===e.requestType)||this.parent.infiniteScrollSettings.enableCache&&this.parent.frozenRows&&"delete"===this.parent.infiniteScrollModule.requestType&&1!==this.parent.pageSettings.currentPage)},i.prototype.ensureVirtualFrozenHeaderRender=function(e){return!(this.parent.enableVirtualization&&"delete"===e.requestType)},i.prototype.checkCache=function(e,t){var i;return this.parent.infiniteScrollSettings.enableCache&&"infiniteScroll"===t.requestType?(this.isAddRows=!H.isNullOrUndefined(this.infiniteCache[this.parent.pageSettings.currentPage]),this.isAddRows&&(i=this.infiniteCache[this.parent.pageSettings.currentPage],e=1===this.parent.pageSettings.currentPage?i.slice(this.parent.frozenRows):i),e):this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&("paging"===t.requestType||"columnstate"===t.requestType||"reorder"===t.requestType||"virtualscroll"===t.requestType)&&(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).getGroupCache()[this.parent.pageSettings.currentPage]?(this.parent.enableVirtualization||(this.useGroupCache=!0),this.parent.enableVirtualization?this.parent.getRowsObject():this.parent.contentModule.initialGroupRows("reorder"===t.requestType)):null},i.prototype.setInfiniteVisibleRows=function(e,t){!this.parent.enableInfiniteScrolling||this.parent.infiniteScrollSettings.enableCache||this.isInfiniteColumnvirtualization()&&"virtualscroll"===e.requestType||this.visibleRows.push(t)},i.prototype.getCurrentBlockInfiniteRecords=function(){var e=[];if(this.parent.infiniteScrollSettings.enableCache){if(!Object.keys(this.infiniteCache).length)return[];for(var t=this.parent.getRows(),i=parseInt(t[this.parent.frozenRows].getAttribute(D),10)-1,n=Math.ceil((1+i)/this.parent.pageSettings.pageSize),i=parseInt(t[t.length-1].getAttribute(D),10)-1,r=Math.ceil((i+(t.length?1:0))/this.parent.pageSettings.pageSize),s=n;s<=r;s++)e=e.length?e.concat(this.infiniteCache[parseInt(s.toString(),10)]):this.infiniteCache[parseInt(s.toString(),10)];this.parent.frozenRows&&1<this.parent.pageSettings.currentPage&&(e=this.infiniteCache[1].slice(0,this.parent.frozenRows).concat(e))}return e},i.prototype.getReorderedRows=function(e){return this.parent.contentModule.getReorderedFrozenRows(e)},i.prototype.virtualFrozenHdrRefresh=function(e,t,i,n,r,s){if(this.parent.frozenRows&&this.parent.enableVirtualization&&("reorder"===n.requestType||"refresh"===n.requestType)){for(var o,a=this.getReorderedRows(n),l=0;l<a.length;l++)o=i.render(a[parseInt(l.toString(),10)],s),e.appendChild(o);n.virtualInfo&&1===n.virtualInfo.page&&t.splice(0,this.parent.frozenRows)}},i.prototype.getInfiniteRows=function(){var e=[];if(this.parent.enableInfiniteScrolling)if(this.parent.infiniteScrollSettings.enableCache)for(var t=Object.keys(this.infiniteCache),i=0;i<t.length;i++)e=e.concat(this.infiniteCache[t[parseInt(i.toString(),10)]]);else e=this.visibleRows;return e},i.prototype.getInfiniteMovableRows=function(){var e=this.getCurrentBlockInfiniteRecords();return this.parent.enableInfiniteScrolling?e.length?e:this.visibleRows:[]},i.prototype.getPanel=function(){return this.contentPanel},i.prototype.setPanel=function(e){this.contentPanel=e},i.prototype.getTable=function(){return this.contentTable},i.prototype.setTable=function(e){this.contentTable=e},i.prototype.getRows=function(){var t,e=this.getInfiniteRows();return this.parent.isRowDomVirtualization()?(t=[],this.parent.domRowObj.forEach(function(e){t.push(e)}),t):e.length?e:this.rows},i.prototype.getRowElements=function(){return this.rowElements||[]},i.prototype.setRowElements=function(e){this.rowElements=e},i.prototype.getColGroup=function(){return this.colgroup},i.prototype.setColGroup=function(e){return H.isNullOrUndefined(e)||(e.id="content-"+e.id),this.colgroup=e},i.prototype.setVisible=function(e){for(var t,i=this.parent,n=(this.getRows().some(function(e){return e.isDataRow&&(t=e),e.isDataRow}),!0),r=(!i.groupSettings.columns.length&&t&&(n=!1),i.getDataRows()),s=this.infiniteRowVisibility(),o=s||this.rows.filter(function(e){return!e.isDetailRow}),a=0,l=e.length;a<l;a++){var h=e[parseInt(a.toString(),10)],d=this.parent.getNormalizedColumnIndex(h.uid),p=this.parent.getColumnIndexByUid(h.uid),c=!0===h.visible?"":"none";-1!==d&&t&&d<t.cells.length&&H.setStyleAttribute(this.getColGroup().childNodes[parseInt(d.toString(),10)],{display:c}),n||this.setDisplayNone(r,p,c,o),!this.parent.invokedFromMedia&&h.hideAtMedia&&this.parent.updateMediaColumns(h),this.parent.invokedFromMedia=!1}(n="Both"!==i.gridLines&&"Vertical"!==i.gridLines?n:!0)?this.refreshContentRows({requestType:"refresh"}):(this.parent.notify(dn,{rows:o,args:{}}),this.parent.editSettings.showAddNewRow&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.notify(Yr,{}))},i.prototype.setDisplayNone=function(e,t,i,n){_c(e,t,i,n,this.parent,this.parent.isRowDragable()),this.parent.notify(zn,{visible:i,index:t,isFreeze:this.isInfiniteFreeze})},i.prototype.infiniteRowVisibility=function(e){var t;return this.parent.enableInfiniteScrolling&&(this.isInfiniteFreeze=e,t=this.parent.infiniteScrollSettings.enableCache?this.getCurrentBlockInfiniteRecords():e?this.visibleFrozenRows:this.visibleRows),t},i.prototype.colGroupRefresh=function(){var e;this.getColGroup()&&(e=this.getHeaderColGroup(),this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e))},i.prototype.getHeaderColGroup=function(){return this.parent.element.querySelector("."+ms).querySelector(qs+":not(.e-masked-colgroup)").cloneNode(!0)},i.prototype.initializeContentDrop=function(){var e=this.parent;this.droppable=new H.Droppable(e.element,{accept:".e-dragclone",drop:this.drop})},i.prototype.droppableDestroy=function(){this.droppable&&!this.droppable.isDestroyed&&this.droppable.destroy()},i.prototype.canSkip=function(e,t,i){return H.isNullOrUndefined(t)||H.isNullOrUndefined(e.visible)||t.cells[parseInt(i.toString(),10)].visible===e.visible},i.prototype.getModelGenerator=function(){return this.generator=new(this.parent.allowGrouping?uo:Js)(this.parent)},i.prototype.renderEmpty=function(e){this.getTable().appendChild(e),(this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&(this.parent.getHeaderContent().querySelector(j).innerHTML="")},i.prototype.setSelection=function(t,e,i){this.parent.notify(rr,{uid:t,set:e,clearAll:i});for(var n=this.getRows().filter(function(e){return i||t===e.uid}),r=0;r<n.length;r++){n[parseInt(r.toString(),10)].isSelected=e;for(var s=n[parseInt(r.toString(),10)].cells,o=0;o<s.length;o++)s[parseInt(o.toString(),10)].isSelected=e}},i.prototype.getRowByIndex=function(e){return this.parent.isRowDomVirtualization()&&(e-=this.currentStartIndex),e=this.getInfiniteRowIndex(e),H.isNullOrUndefined(e)?void 0:this.parent.getDataRows()[parseInt(e.toString(),10)]},i.prototype.getInfiniteRowIndex=function(e){var t,i;return this.parent.infiniteScrollSettings.enableCache&&!H.isNullOrUndefined(e)&&(i=e<(t=this.parent.frozenRows)?0:t,i=parseInt(this.parent.getRows()[parseInt(i.toString(),10)].getAttribute(D),10)-1,e=e<t?e:e-i+t),e},i.prototype.getVirtualRowIndex=function(e){return e},i.prototype.enableAfterRender=function(e){"group"===e.module&&e.enable&&(this.generator=this.getModelGenerator())},i.prototype.setRowObjects=function(e){this.rows=e},i.prototype.immutableModeRendering=function(e){var t=this,i=(void 0===e&&(e={}),this.parent),n=(i.loadingIndicator&&"Shimmer"===i.loadingIndicator.indicatorType?i.removeMaskRow():i.hideSpinner(),i.getPrimaryKeyFieldNames()[0]),r={},s=[],o=i.getRowsObject().slice(),a=this.getBatchEditedRecords(n,o),l={},h=0!==Object.keys(a).length;if(i.getContent().querySelector(".e-emptyrow")||"reorder"===e.requestType||this.parent.groupSettings.columns.length)this.refreshContentRows(e);else if(0!==i.currentViewData.length){var d={},p=i.createElement(j,{attrs:{role:"rowgroup"}}),c=i.currentViewData,u=[].slice.call(this.getTable().querySelector(j).children);if(this.prevCurrentView.length){var g=this.prevCurrentView.length,f=c.length;if(g===f)for(var m=0;m<f;m++)"Batch"===this.parent.editSettings.mode&&u[parseInt(m.toString(),10)].classList.contains("e-insertedrow")?(u.splice(m,1),--m):(c[parseInt(m.toString(),10)][""+n],r[this.prevCurrentView[parseInt(m.toString(),10)][""+n]]=m,l[parseInt(m.toString(),10)]=c[parseInt(m.toString(),10)][""+n],d[o[parseInt(m.toString(),10)].uid]=u[parseInt(m.toString(),10)],parseInt(m.toString(),10),this.prevCurrentView[parseInt(m.toString(),10)][""+n]);else{for(m=0;m<f;m++)c[parseInt(m.toString(),10)][""+n],l[parseInt(m.toString(),10)]=c[parseInt(m.toString(),10)][""+n];for(m=0;m<g;m++)"Batch"===this.parent.editSettings.mode&&u[parseInt(m.toString(),10)].classList.contains("e-insertedrow")?(u.splice(m,1),--m):(d[o[parseInt(m.toString(),10)].uid]=u[parseInt(m.toString(),10)],r[this.prevCurrentView[parseInt(m.toString(),10)][""+n]]=m,parseInt(m.toString(),10),this.prevCurrentView[parseInt(m.toString(),10)][""+n])}}for(var y,m=0;m<c.length;m++){var v,S,C=r[c[parseInt(m.toString(),10)][""+n]];H.isNullOrUndefined(C)?(S=new $s(this.serviceLocator,null,i),v={startIndex:m},v=this.generator.generateRows([c[parseInt(m.toString(),10)]],v),s.push(v[0]),S=S.render(v[0],i.getColumns()),p.appendChild(S),this.refreshImmutableContent(m,S,s[parseInt(m.toString(),10)])):(v=!1,this.parent.enableDeepCompare&&(v=this.objectEqualityChecker(this.prevCurrentView[parseInt(C.toString(),10)],c[parseInt(m.toString(),10)])),S=d[o[parseInt(C.toString(),10)].uid],s.push(o[parseInt(C.toString(),10)]),this.rowElements[parseInt(C.toString(),10)]&&this.rowElements[parseInt(C.toString(),10)].getAttribute("data-uid")===s[parseInt(m.toString(),10)].uid&&(h&&H.isNullOrUndefined(a[l[parseInt(m.toString(),10)]])||!h&&(v||this.prevCurrentView[parseInt(C.toString(),10)]===c[parseInt(m.toString(),10)]))?(C!==m&&this.refreshImmutableContent(m,S,s[parseInt(m.toString(),10)]),p.appendChild(S)):((h&&!H.isNullOrUndefined(a[l[parseInt(m.toString(),10)]])||!this.parent.enableDeepCompare&&c[parseInt(m.toString(),10)]!==this.prevCurrentView[parseInt(C.toString(),10)]||this.parent.enableDeepCompare&&!v)&&o[parseInt(C.toString(),10)].setRowValue(c[parseInt(m.toString(),10)]),p.appendChild(S),this.refreshImmutableContent(m,S,s[parseInt(m.toString(),10)])))}this.rows=s,this.rowElements=[].slice.call(p.children),H.remove(this.getTable().querySelector(j)),this.getTable().appendChild(p),this.parent.trigger(de,{},function(){t.parent.allowTextWrap&&t.parent.notify(Oi,{case:"textwrap"})}),e&&(y=(e.requestType||"").toLowerCase()+"-complete",this.parent.notify(y,e))}},i.prototype.objectEqualityChecker=function(e,t){for(var i=Object.keys(e),n=!0,r=0;r<i.length;r++)if(!(e[i[parseInt(r.toString(),10)]]===t[i[parseInt(r.toString(),10)]]||e[i[parseInt(r.toString(),10)]]instanceof Date&&t[i[parseInt(r.toString(),10)]]instanceof Date&&e[i[parseInt(r.toString(),10)]].getTime()===t[i[parseInt(r.toString(),10)]].getTime())){n=!1;break}return n},i.prototype.getBatchEditedRecords=function(e,t){var i={},n=this.parent.getBatchChanges(),r=[],s=[],n=(Object.keys(n).length&&(r=n.changedRecords,s=n.addedRecords),{cancel:!1});this.parent.notify(or,{rows:t,args:n}),s.length&&("Bottom"===this.parent.editSettings.newRowPosition?t.splice(t.length-1,s.length):n.cancel||t.splice(0,s.length));for(var o=0;o<r.length;o++)i[r[parseInt(o.toString(),10)][""+e]]=o;return i},i.prototype.refreshImmutableContent=function(e,t,i){i.isAltRow=!!this.parent.enableAltRow&&e%2!=0,i.isAltRow?t.classList.add("e-altrow"):t.classList.remove("e-altrow"),i.index=e,i.edit=void 0,i.isDirty=!1,t.setAttribute(D,(e+1).toString()),this.updateCellIndex(t,e)},i.prototype.updateCellIndex=function(e,t){for(var i=0;i<e.cells.length;i++)e.cells[parseInt(i.toString(),10)].setAttribute("data-index",t.toString())};var fo=i;function i(e,t){var l=this;this.rows=[],this.freezeRows=[],this.movableRows=[],this.freezeRowElements=[],this.currentInfo={},this.prevCurrentView=[],this.isLoaded=!0,this.drop=function(e){l.parent.notify(xe,{target:e.target,droppedElement:e.droppedElement}),H.remove(e.droppedElement)},this.infiniteCache={},this.visibleRows=[],this.visibleFrozenRows=[],this.rightFreezeRows=[],this.isAddRows=!1,this.isInfiniteFreeze=!1,this.useGroupCache=!1,this.tempFreezeRows=[],this.rafCallback=function(o){var a=o;return function(){if(l.ariaService.setBusy(l.getPanel().querySelector("."+xs),!1),!l.parent.isDestroyed){var e,t=l.rows.slice(0);if(l.parent.enableInfiniteScrolling){if(l.parent.groupSettings.enableLazyLoading)for(var i=0;i<l.visibleRows.length;i++)l.setRowsInLazyGroup(l.visibleRows[parseInt(i.toString(),10)],i);t=l.parent.getRowsObject();var n=a.prevPage;if(l.parent.infiniteScrollSettings.enableCache&&n)for(var r=l.parent.infiniteScrollSettings.maxBlocks,t=[],n=parseInt(l.rowElements[0].getAttribute("aria-rowindex"),10),i=0,s=Math.ceil(n/l.parent.pageSettings.pageSize);i<r;i++,s++)l.infiniteCache[parseInt(s.toString(),10)]&&(t=t.concat(l.infiniteCache[parseInt(s.toString(),10)]))}l.parent.notify(vt,{rows:t,args:a}),l.parent.editSettings.showAddNewRow&&l.parent.addNewRowFocus&&(l.parent.notify(Yr,{}),l.parent.addNewRowFocus=!1),l.parent.autoFit&&l.parent.preventAdjustColumns(),l.parent.isInitialLoad||l.parent.focusModule.setFirstFocusableTabIndex(),l.isLoaded&&(l.parent.isManualRefresh=!1,l.parent.enableInfiniteScrolling&&l.parent.groupSettings.enableLazyLoading&&"sorting"===o.requestType&&(l.parent.infiniteScrollModule.groupCaptionAction=void 0),n=l.parent.parentDetails&&l.parent.parentDetails.parentInstObj&&l.parent.parentDetails.parentInstObj.isReact,(l.parent.isReact||n)&&l.parent.element.querySelectorAll(".e-templatecell").length?(e=l).parent.renderTemplates(function(){e.parent.trigger(de,{},function(){e.parent.allowTextWrap&&e.parent.notify(Oi,{case:"textwrap"})})}):l.parent.trigger(de,{},function(){l.parent.allowTextWrap&&l.parent.notify(Oi,{case:"textwrap"})}),l.parent.allowTextWrap)&&"auto"===l.parent.height&&(l.parent.getContentTable().scrollHeight>l.parent.getContent().clientHeight?l.parent.scrollModule.setPadding():l.parent.scrollModule.removePadding()),a&&(n=(a.requestType||"").toLowerCase()+"-complete",l.parent.notify(n,a),"batchsave"===o.requestType)&&(o.cancel=!1,l.parent.trigger(c,o)),l.isLoaded&&l.parent.hideSpinner()}}},this.parent=e,this.serviceLocator=t,this.widthService=t.getService("widthService"),this.ariaService=this.serviceLocator.getService("ariaService"),this.parent.enableDeepCompare=this.parent.getDataModule().isRemote(),this.generator=this.getModelGenerator(),this.parent.isDestroyed||(this.parent.enableColumnVirtualization||this.parent.enableVirtualization||this.parent.groupSettings.enableLazyLoading||this.parent.on(Kt,this.setVisible,this),this.parent.on(It,this.colGroupRefresh,this),this.parent.on(St,this.enableAfterRender,this),this.parent.on(Pn,this.refreshContentRows,this),this.parent.on(Vt,this.beforeCellFocused,this),this.parent.on(s,this.droppableDestroy,this))}yo.prototype.renderPanel=function(){var e=null!=(t=this.parent.element.querySelector("."+ms)),t=e?t:this.parent.createElement("div",{className:"e-gridheader"}),i=e?t.querySelector("."+Cs):this.parent.createElement("div",{className:Cs});this.toggleStackClass(t),t.appendChild(i),this.setPanel(t),e||this.parent.element.appendChild(t)},yo.prototype.renderTable=function(){var e=this.getPanel();e.appendChild(this.createHeaderTable()),this.setTable(e.querySelector("."+Ds)),this.initializeHeaderDrag(),this.initializeHeaderDrop(),this.parent.notify(Rt,{rows:this.rows})},yo.prototype.getPanel=function(){return this.headerPanel},yo.prototype.setPanel=function(e){this.headerPanel=e},yo.prototype.getTable=function(){return this.headerTable},yo.prototype.setTable=function(e){this.headerTable=e},yo.prototype.getColGroup=function(){return this.colgroup},yo.prototype.setColGroup=function(e){return this.colgroup=e},yo.prototype.getRows=function(){return this.getTable().tHead.rows},yo.prototype.createHeaderTable=function(){var e=this.createTable(),t=this.getPanel().querySelector("."+Cs);return t.appendChild(e),t},yo.prototype.createHeader=function(e,t){for(var i,n=this.parent,r=(this.getTable()&&H.remove(this.getTable()),this.parent.createElement("table",{className:Ds,attrs:{role:"presentation"}})),t=(r.style.cssText="border-collapse: separate; border-spacing: .25px;",this.createHeaderContent(t)),s=t.thead,o=this.parent.createElement(j,{className:this.parent.frozenRows||this.parent.isRowPinned||(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow?"":"e-hide",attrs:{role:"rowgroup"}}),a=(this.caption=this.parent.createElement("caption",{innerHTML:this.parent.element.id+"_header_table",className:"e-hide"}),this.parent.createElement(qs)),l=this.parent.createElement("tr",{attrs:{role:"row"},className:(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow?"e-hide":""}),h=this.rows=t.rows,d=0,p=h.length;d<p;d++)for(var c=0,u=h[parseInt(d.toString(),10)].cells.length;c<u;c++)i=this.parent.createElement("td"),l.appendChild(i);return(n.allowFiltering||n.allowSorting||n.allowGrouping)&&r.classList.add("e-sortfilter"),this.updateColGroup(a),o.appendChild(l),r.appendChild(this.caption),r.appendChild(this.setColGroup(a)),r.appendChild(s),r.appendChild(o),r},yo.prototype.createTable=function(e){return this.createHeader(e=void 0===e?null:e)},yo.prototype.createHeaderContent=function(e){var t=this.parent,i=t.getColumns(),n=this.parent.createElement("thead",{attrs:{role:"rowgroup"}}),r=this.parent.createElement("tr",{className:"e-columnheader",attrs:{role:"row"}}),s=new $s(this.serviceLocator,oe.CellType.Header,t),o=(s.element=r,[]);this.colDepth=ac(t.columns);for(var a=0,l=this.colDepth;a<l;a++)o[parseInt(a.toString(),10)]=this.generateRow(a),o[parseInt(a.toString(),10)].cells=[];if(o=this.ensureColumns(o),o=this.getHeaderCells(o,e),t.isRowDragable()&&"Right"===this.parent.getFrozenMode())for(a=0,l=o.length;a<l;a++)o[parseInt(a.toString(),10)].cells.push(this.generateCell({},oe.CellType.RowDragHIcon));i.filter(function(e){return e.headerTemplate}).length&&(this.parent.isReact||this.parent.isVue)&&Zc(this.parent,["headerTemplate"]),i&&i.length&&!i[0].visible?this.parent&&this.parent.renderModule&&(this.parent.renderModule.isFirstColumnHidden=!0):this.parent&&this.parent.renderModule&&(this.parent.renderModule.isFirstColumnHidden=!1);for(a=0,l=this.colDepth;a<l;a++){var h=s.render(o[parseInt(a.toString(),10)],i),d=null!=this.parent.headerRowHeight?this.parent.headerRowHeight:this.parent.rowHeight;!H.isNullOrUndefined(d)&&0<d&&h.querySelector(".e-headercell")&&(h.style.height=d+"px"),Pc(h),n.appendChild(h)}r=Array.from(n.querySelectorAll(".e-headercell:not(.e-hide)"));return this.parent.allowResizing&&0<r.length&&(n.querySelector(".e-lastcell")&&n.querySelector(".e-lastcell").classList.contains("e-hide")?r[r.length-1].classList.add("e-last-visible-cell"):n.querySelector(".e-laststackcell")&&n.querySelector(".e-laststackcell").classList.contains("e-hide")&&r[r.length-1].classList.add("e-last-visible-stack-cell")),{thead:n,rows:o}},yo.prototype.updateColGroup=function(e){var t,i=this.parent.getColumns(),n=this.parent.getColumnIndexesInView();if(e.id=this.parent.element.id+qs,this.parent.allowGrouping)for(var r=0,s=this.parent.groupSettings.columns.length;r<s;r++)this.parent.enableColumnVirtualization&&-1===n.indexOf(r)||(t=this.parent.createElement("col",{className:"e-group-intent"}),e.appendChild(t));(this.parent.detailTemplate||this.parent.childGrid)&&(t=this.parent.createElement("col",{className:"e-detail-intent"}),e.appendChild(t)),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&(t=this.parent.createElement("col",{className:"e-drag-intent"}),e.appendChild(t));for(r=0,s=i.length;r<s;r++)t=this.parent.createElement("col"),!1===i[parseInt(r.toString(),10)].visible&&H.setStyleAttribute(t,{display:"none"}),e.appendChild(t);return this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&(t=this.parent.createElement("col",{className:"e-drag-intent"}),e.appendChild(t)),e},yo.prototype.ensureColumns=function(e){for(var t=this.parent,i=this.parent.getColumnIndexesInView(),n=0,r=e.length;n<r;n++){var s,o=0===n?this.colDepth:0;if(t.allowGrouping)for(var a,l=0,h=t.groupSettings.columns.length;l<h;l++)this.parent.enableColumnVirtualization&&-1===i.indexOf(l)||(a=this.generateCell({},oe.CellType.HeaderIndent),1<this.colDepth&&(a.rowSpan=o),e[parseInt(n.toString(),10)].cells.push(a));(t.detailTemplate||t.childGrid)&&(this.parent.notify(In,s={}),a=this.generateCell(s,oe.CellType.DetailHeader),1<this.colDepth&&(a.rowSpan=o),e[parseInt(n.toString(),10)].cells.push(a)),t.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&(a=this.generateCell({},oe.CellType.RowDragHIcon),1<this.colDepth&&(a.rowSpan=o),e[parseInt(n.toString(),10)].cells.push(a))}return e},yo.prototype.getHeaderCells=function(e,t){var i=this.parent.getHeaderTable()&&this.parent.getHeaderTable().querySelector("thead"),n=this.parent.enableColumnVirtualization?this.parent.getColumns(this.parent.enablePersistence):this.parent.columns;if(this.frzIdx=0,this.notfrzIdx=0,this.parent.lockcolPositionCount)for(var r=0;r<(H.isNullOrUndefined(n)?0:n.length);r++)this.lockColsRendered=!1,e=this.appendCells(n[parseInt(r.toString(),10)],e,0,0===r,!1,r===n.length-1,i,t,!1);for(var r=0,s=H.isNullOrUndefined(n)?0:n.length;r<s;r++)this.notfrzIdx=0,this.lockColsRendered=!0,e=this.appendCells(n[parseInt(r.toString(),10)],e,0,0===r,!1,r===s-1,i,t,!1);return e},yo.prototype.appendCells=function(e,t,i,n,r,s,o,a,l){var l=s?l?"e-laststackcell":"e-lastcell":"",h=!this.parent.lockcolPositionCount||e.lockColumn&&!this.lockColsRendered||!e.lockColumn&&this.lockColsRendered;if(e.columns){this.isFirstCol=!1;var d,p=this.getCellCnt(e,0);if(p&&(d=this.getStackedLockColsCount(e,0),0===this.parent.lockcolPositionCount||!this.lockColsRendered&&0!==d||this.lockColsRendered&&p-d!=0)&&t[parseInt(i.toString(),10)].cells.push(new cs({cellType:oe.CellType.StackedHeader,column:e,colSpan:this.getColSpan(p,d),className:!n&&r?"e-firstcell":""})),this.parent.lockcolPositionCount&&!this.lockColsRendered)for(var c=0;c<e.columns.length;c++)t=this.appendCells(e.columns[parseInt(c.toString(),10)],t,i+1,n,0===c,c===e.columns.length-1&&s,o,a,!1);if(this.lockColsRendered)for(var c=0,u=e.columns.length;c<u;c++){n=n&&0===c;var g=this.isFirstCol=e.columns[parseInt(c.toString(),10)].visible&&!n,f=c===u-1&&s;t=this.appendCells(e.columns[parseInt(c.toString(),10)],t,i+1,n,g&&!f,f,o,a,!0)}}else h&&t[parseInt(i.toString(),10)].cells.push(this.generateCell(e,oe.CellType.Header,this.colDepth-i,(!n&&r?"e-firstcell":"")+l,i,this.parent.getColumnIndexByUid(e.uid))),!this.parent.lockcolPositionCount||this.frzIdx+this.notfrzIdx<this.parent.frozenColumns&&(e.lockColumn&&!this.lockColsRendered||!e.lockColumn&&this.lockColsRendered)?this.frzIdx++:this.notfrzIdx++;return t},yo.prototype.getStackedLockColsCount=function(e,t){if(e.columns)for(var i=0;i<e.columns.length;i++)t=this.getStackedLockColsCount(e.columns[parseInt(i.toString(),10)],t);else e.lockColumn&&t++;return t},yo.prototype.getColSpan=function(e,t){return e=this.lockColsRendered?e-t:t},yo.prototype.generateRow=function(e){return new ds({})},yo.prototype.generateCell=function(e,t,i,n,r,s){e={visible:e.visible,isDataCell:!1,isTemplate:!H.isNullOrUndefined(e.headerTemplate),rowID:"",column:e,cellType:t,rowSpan:i,className:n,index:r,colIndex:s};return(!e.rowSpan||e.rowSpan<2)&&delete e.rowSpan,new cs(e)},yo.prototype.setVisible=function(e){for(var t=this.parent,i=0,n=e.length;i<n;i++){var r=e[parseInt(i.toString(),10)],s=t.getNormalizedColumnIndex(r.uid),r=r.visible?"":"none";H.setStyleAttribute(this.getColGroup().children[parseInt(s.toString(),10)],{display:r}),t.editSettings.showAddNewRow&&t.element.querySelector(".e-addedrow")&&H.setStyleAttribute(t.element.querySelector(".e-addedrow").querySelector("colgroup").childNodes[parseInt(s.toString(),10)],{display:r})}this.refreshUI(),this.parent.editSettings.showAddNewRow&&(this.parent.isAddNewRow=!0)},yo.prototype.colPosRefresh=function(){this.refreshUI()},yo.prototype.refreshUI=function(){var e=this.getPanel(),t=(this.toggleStackClass(e),this.getTable());if(t){this.droppableDestroy(),this.parent.reorderModule&&(this.parent.reorderModule.element=null,this.parent.reorderModule.destElement=null),H.remove(t),this.parent.editSettings.showAddNewRow&&!this.parent.isAddNewRow&&t.querySelector(".e-addedrow")&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&(t.querySelector(".e-addedrow").classList.add("e-addrow-removed"),this.parent.isAddNewRow=!0),t.removeChild(t.childNodes[1]),t.removeChild(t.childNodes[1]);for(var i=this.parent.createElement(qs),n=this.createHeaderContent(void 0),n=(this.rows=n.rows,t.insertBefore(n.thead,t.childNodes[1]),this.updateColGroup(i),t.insertBefore(this.setColGroup(i),t.childNodes[1]),this.appendContent(t),this.parent.notify(It,{}),this.widthService.setWidthToColumns(),this.parent.updateDefaultCursor(),this.initializeHeaderDrag(),this.initializeHeaderDrop(),[].slice.call(e.querySelectorAll("tr.e-columnheader"))),r=0,s=n;r<s.length;r++){var o=s[r],o=[].slice.call(o.getElementsByClassName("e-grouptopleftcell"));o.length&&o[o.length-1].classList.add("e-lastgrouptopleftcell")}this.parent.notify(Rt,{rows:this.rows}),this.parent.enableColumnVirtualization&&I(t,bs)&&this.parent.notify(Rt,{rows:this.rows,args:{isFrozen:!1,isXaxis:!0}}),this.parent.allowTextWrap&&"Header"===this.parent.textWrapSettings.wrapMode&&zp(n,!0)}i=this.parent.getHeaderContent().querySelector(".e-headercell:not(.e-hide)");H.isNullOrUndefined(i)||(i.tabIndex=0)},yo.prototype.toggleStackClass=function(e){var t=this.parent.columns;!H.isNullOrUndefined(t)&&t.some(function(e){return!H.isNullOrUndefined(e.columns)})?e.classList.add("e-stackedheader"):e.classList.remove("e-stackedheader")},yo.prototype.appendContent=function(e){this.getPanel().querySelector("."+Cs).appendChild(e)},yo.prototype.getCellCnt=function(e,t){if(e.columns)for(var i=0,n=e.columns.length;i<n;i++)t=this.getCellCnt(e.columns[parseInt(i.toString(),10)],t);else e.visible&&t++;return t},yo.prototype.initializeHeaderDrag=function(){var e=this.parent;(this.parent.allowReordering||this.parent.allowGrouping&&this.parent.groupSettings.showDropArea)&&(this.draggable=new H.Draggable(e.getHeaderContent(),{dragTarget:".e-headercell",distance:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop,abort:".e-rhandler",isReplaceDragEle:this.isReplaceDragEle}),this.parent.on(s,this.droppableDestroy,this))},yo.prototype.initializeHeaderDrop=function(){var e=this.parent;this.droppable=new H.Droppable(e.getHeaderContent(),{accept:".e-dragclone",drop:this.drop}),this.parent.on(s,this.droppableDestroy,this)},yo.prototype.droppableDestroy=function(){this.droppable&&!this.droppable.isDestroyed&&this.droppable.destroy(),this.draggable&&!this.draggable.isDestroyed&&this.draggable.destroy()},yo.prototype.renderCustomToolbar=function(){var t=this,e=this.parent;if("Vertical"===e.rowRenderingMode&&!e.toolbar&&(e.allowSorting||e.allowFiltering&&"FilterBar"!==e.filterSettings.type)){for(var i=e.createElement("div",{className:"e-res-toolbar e-toolbar"}),n=e.createElement("div",{className:"e-toolbar-items"}),r=e.createElement("div",{className:"e-toolbar-left"}),s=this.parent.allowFiltering&&this.parent.allowSorting?2:1,o=0;o<s;o++){var a=e.createElement("div",{className:"e-toolbar-item e-gridresponsiveicons e-icons e-tbtn-align"}),l=1==s?this.parent.allowSorting?"sort":"filter":1===o?"sort":"filter",h=e.createElement("button",{className:"e-tbar-btn e-control e-btn e-lib e-icon-btn"}),l=e.createElement("span",{className:"e-btn-icon e-res"+l+"-icon e-icons"});h.appendChild(l),new M.Button({cssClass:this.parent.cssClass||""}).appendTo(h),h.onclick=function(e){e.target.classList.contains("e-ressort-btn")||e.target.classList.contains("e-ressort-icon")||e.target.querySelector(".e-ressort-icon")?t.parent.showResponsiveCustomSort():t.parent.showResponsiveCustomFilter()},a.appendChild(h),r.appendChild(a)}n.appendChild(r),i.appendChild(n),e.element.insertBefore(i,this.parent.element.querySelector("."+ms))}else e.enableAdaptiveUI&&!e.toolbar&&e.getContent().classList.add("e-responsive-header")},yo.prototype.updateCustomResponsiveToolbar=function(e){var t=this.parent.element.querySelector(".e-responsive-toolbar");"toolbar"===e.module&&(t?H.remove(t):this.renderCustomToolbar())};var mo=yo;function yo(e,t){var d=this;this.frzIdx=0,this.notfrzIdx=0,this.isFirstCol=!1,this.isReplaceDragEle=!0,this.helper=function(e){var t=d.parent,i=d.draggable.currentStateTarget,n=I(i,"e-headercell");if(!t.allowReordering&&!t.allowGrouping||!H.isNullOrUndefined(n)&&0<n.getElementsByClassName("e-checkselectall").length)return!1;var r=d.parent.createElement("div",{className:"e-cloneproperties e-dragclone e-headerclone"}),i=i.classList.contains("e-headercell")?i:n;if(!i||!t.allowReordering&&i.classList.contains("e-stackedheadercell"))return!1;var s,o,a,l,n=i.offsetHeight,h=i.querySelector(".e-headercelldiv")||i.querySelector(".e-stackedheadercelldiv");if(h){if((s=t.getColumnByUid(h.getAttribute("data-mappinguid")))||!i.querySelector(".e-stackedheadercelldiv")||h.innerHTML.includes("<")||(s=t.getStackedHeaderColumnByHeaderText(h.innerText.trim(),t.columns)),d.column=s,!d.column||d.column.lockColumn)return!1;r.setAttribute("data-mappinguid",d.column.uid)}return s&&!H.isNullOrUndefined(s.headerTemplate)?(H.isNullOrUndefined(s.headerTemplate)?r.innerHTML=s.headerTemplate:(o=t.getColumnIndexByField(s.field),o=s.getHeaderTemplate()(H.extend({index:o},s),t,"headerTemplate",null,null,null,null,t.root),a=t.isReact&&"string"!=typeof s.headerTemplate,l=t.parentDetails&&t.parentDetails.parentInstObj&&t.parentDetails.parentInstObj.isReact,(a||l)&&t.renderTemplates(),Ip(r,o)),H.isNullOrUndefined(r.firstChild)||1!==r.firstChild.nodeType||(r.firstChild.style.pointerEvents="none")):r.innerHTML=h?s.headerText:i.firstElementChild.innerHTML,r.style.width=i.offsetWidth+"px",r.style.height=i.offsetHeight+"px",r.style.lineHeight=(n-6).toString()+"px",t.element.appendChild(r),r},this.dragStart=function(e){var t=d.parent;t.element.querySelector(".e-gridpopup").style.display="none",t.notify(Ie,{target:d.draggable.currentStateTarget,column:d.column,event:e.event})},this.drag=function(e){var t,i=d.parent,n=e.target;n&&(n=H.closest(n,".e-grid"),t=d.parent.element.querySelector(".e-cloneproperties"),n&&n.getAttribute("id")===i.element.getAttribute("id")||(H.classList(t,["e-notallowedcur"],["e-defaultcur"]),i.allowReordering&&(i.element.querySelector(".e-reorderuparrow").style.display="none",i.element.querySelector(".e-reorderdownarrow").style.display="none"),i.groupSettings.allowReordering))&&i.notify(Re,{target:e.target,column:d.column,event:e.event})},this.dragStop=function(e){var t,i=d.parent;i.element.querySelector(".e-gridpopup").style.display="none",(!I(e.target,"e-headercell")&&!I(e.target,"e-groupdroparea")||!i.allowReordering&&I(e.target,"e-headercell")||!e.helper.getAttribute("data-mappinguid")&&I(e.target,"e-groupdroparea"))&&(H.remove(e.helper),t=!0),i.notify(Zt,{target:e.target,event:e.event,column:d.column,cancel:t})},this.drop=function(e){var t=d.parent,i=e.droppedElement.getAttribute("data-mappinguid"),n=H.closest(e.target,".e-grid");H.remove(e.droppedElement),n&&n.getAttribute("id")!==t.element.getAttribute("id")||!t.allowReordering&&!t.allowGrouping||t.notify(Jt,{target:e.target,uid:i,droppedElement:e.droppedElement})},this.parent=e,this.serviceLocator=t,this.ariaService=this.serviceLocator.getService("ariaService"),this.widthService=this.serviceLocator.getService("widthService"),this.parent.isDestroyed||(this.parent.enableColumnVirtualization||this.parent.on(Kt,this.setVisible,this),this.parent.on(Xt,this.colPosRefresh,this),this.parent.on(mt,this.renderCustomToolbar,this),"Vertical"===this.parent.rowRenderingMode&&this.parent.on(St,this.updateCustomResponsiveToolbar,this))}So.prototype.getGui=function(){return""},So.prototype.format=function(e,t,i){var n;return H.isNullOrUndefined(e.format)||("number"===e.type&&isNaN(parseInt(t,10))&&(t=null),e.allowFormula&&isNaN(parseInt(t,10))&&(t=null),"dateonly"===e.type&&"string"==typeof t&&t&&(n=t.split(/[^0-9.]/),t=new Date(parseInt(n[0],10),parseInt(n[1],10)-1,parseInt(n[2],10))),t=this.formatter.toView(t,e.getFormatter())),H.isNullOrUndefined(t)?"":String(t)},So.prototype.evaluate=function(e,t,i,n,r,s,o){var a,l,h,d,p,c,u;return!t.column.template||(a=this.parent.isReact&&"string"!=typeof t.column.template&&!(t.column.template.prototype&&t.column.template.prototype.CSPTemplate),l=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,h=this.parent.printGridParent&&this.parent.printGridParent.isReact,d=["data-index"],r=sc({},i,((i={})[Vi]=r,i.column=t.column,i)),i=this.parent.element.id+t.column.uid,p="isStringTemplate",c={index:n[d[0]]},0<o&&(c.rowNumber=o),a||l||h?t.column.getColumnTemplate()(H.extend(c,r),this.parent,"columnTemplate",i,this.parent[p],null,e):this.parent.isAngular?(o="template_"+n[d[0]]+"_"+t.column.uid,u=t.column.getColumnTemplate()(H.extend(c,r),this.parent,o,i,this.parent[p],void 0,void 0,this.parent.root),this.parent.columnTemplateIDs.push(o)):u=t.column.getColumnTemplate()(H.extend(c,r),this.parent,"template",i,this.parent[p],void 0,void 0,this.parent.root),a||l||h||Ip(e,u),this.parent.notify("template-result",{template:u}),u=null,t.column.templateOptions.enableAriaLabel&&e.setAttribute("aria-label",e.innerText+this.localizer.getConstant("TemplateCell")+this.localizer.getConstant("ColumnHeader")+t.column.headerText),!1)},So.prototype.invokeFormatter=function(e,t,i){return t=H.isNullOrUndefined(e.formatter)?t:Zd(e.formatter,"getValue")?(new e.formatter).getValue(e,i):"function"==typeof e.formatter?e.formatter(e,i):e.formatter.getValue(e,i)},So.prototype.render=function(e,t,i,n,r){return this.refreshCell(e,t,i,r)},So.prototype.refreshTD=function(e,t,i,n){var r="Batch"===this.parent.editSettings.mode&&e.classList.contains("e-editedbatchcell");if(this.parent.isReact){var s=e.cellIndex,o=e.parentElement,a=(H.remove(e),this.refreshCell(t,i,n,r));this.cloneAttributes(a,e),o.cells.length!==s-1?o.insertBefore(a,o.cells[parseInt(s.toString(),10)]):o.appendChild(a)}else{s=this.refreshCell(t,i,n,r),o=(e.innerHTML="",s.getAttribute("aria-label"));o&&e.setAttribute("aria-label",o);for(var l=0,h=[].slice.call(s.childNodes);l<h.length;l++){var d=h[l];e.appendChild(d)}e.innerHTML&&"string"==typeof e.innerHTML&&e.innerHTML.startsWith("#")?e.classList.add("e-formula-error"):e.classList.contains("e-formula-error")&&e.classList.remove("e-formula-error")}},So.prototype.cloneAttributes=function(e,t){for(var i,n=t.attributes,r=n.length;r--;)i=n[parseInt(r.toString(),10)],e.setAttribute(i.name,i.value)},So.prototype.refreshCell=function(e,t,i,n){var r,s,o,a=this.element.cloneNode(),l=e.column,h=(e.isForeignKey&&(r=e.foreignKeyData&&e.foreignKeyData[0]?e.foreignKeyData[0]:((r={})[l.foreignKeyValue]=l.format?null:"",r)),this.getGui()),d=e.isForeignKey?this.getValue(l.foreignKeyValue,r,l):this.getValue(l.field,t,l),p=0,c=(H.isNullOrUndefined(l)||"rownumber"!==l.type||(p=(s=parseInt(i&&i["data-index"],10))+1,this.parent.allowPaging&&(c=this.parent.pageSettings.pageSize||0,p=s+((this.parent.pageSettings.currentPage||1)-1)*c+1),d=p),this.parent.formulaModule&&l.allowFormula&&!n&&("string"==typeof d&&d.trim().startsWith("=")&&(s=this.parent.getPrimaryKeyFieldNames()[0],d=this.parent.getFormulaValue(t[""+s],l.field)),!H.isNullOrUndefined(this.parent.getHeaderTable().querySelectorAll(".e-header-col-ref")))&&H.isNullOrUndefined(this.parent.getHeaderTable().querySelector(".e-col-hidden"))&&Array.from(this.parent.getHeaderTable().querySelectorAll(".e-header-col-ref")).map(function(e){return e.classList.add("e-col-hidden")}),"date"!==l.type&&"datetime"!==l.type||H.isNullOrUndefined(d)||(d=new Date(d)),"dateonly"!==l.type||H.isNullOrUndefined(d)||"string"!=typeof d||(c=d.split(/[^0-9.]/),d=new Date(parseInt(c[0],10),parseInt(c[1],10)-1,parseInt(c[2],10))),h=(d=d instanceof Error?String(d):this.format(l,d,t)).toString(),"boolean"!==l.type||l.displayAsCheckBox||(h=(s="true"!==d&&"false"!==d?null:"true"===d?"True":"False")?this.localizer.getConstant(s):h),this.invokeFormatter(l,d,t));return h=H.isNullOrUndefined(l.formatter)?h:H.isNullOrUndefined(c)?"":c.toString(),h=this.applyFindHighlight(l,h,parseInt(i&&i["data-index"],10)),this.evaluate(a,e,t,i,r,n,p)&&"checkbox"!==l.type?this.appendHtml(a,h,l.getDomSetter?l.getDomSetter():"innerHTML"):"checkbox"===l.type&&(a.classList.add(Es),d=!!this.parent.selectionSettings.persistSelection&&"true"===d,o=M.createCheckBox(this.parent.createElement,!1,{checked:d,label:" "}),this.parent.cssClass&&H.addClass([o],[this.parent.cssClass]),this.rowChkBox.id="checkbox-"+e.rowID,o.insertBefore(this.rowChkBox.cloneNode(),o.firstChild),a.appendChild(o)),"Check"===this.parent.checkAllRows&&this.parent.enableVirtualization&&(e.isSelected=!0),this.setAttributes(a,e,i),"boolean"===l.type&&l.displayAsCheckBox&&(s=isNaN(parseInt(d.toString(),10))?"true"===d:0<parseInt(d.toString(),10),o=M.createCheckBox(this.parent.createElement,!1,{checked:s,label:" "}),a.innerHTML="",a.classList.add("e-gridchkbox-cell"),o.classList.add("e-checkbox-disabled"),this.parent.cssClass&&H.addClass([o],[this.parent.cssClass]),a.appendChild(o)),a.classList.contains("e-summarycell")&&!t.key&&(c=a.getAttribute("data-mappinguid"),l=this.parent.getColumnByUid(c),a.setAttribute("aria-label",h+this.localizer.getConstant("ColumnHeader")+e.column.headerText)),!this.parent.isFrozenGrid()||t&&t.key||zc(this.parent,l,a),a},So.prototype.applyFindHighlight=function(e,t,i){var n=this.parent.findModule;if(!n||!e||!e.field||!t||-1!==t.indexOf("<")||e.getDomSetter&&"innerHTML"!==e.getDomSetter())return this.parent.sanitize(t);var r=n.getHighlightParts(t,e.field,0,n.getAbsoluteRowIndex(i));if(1===r.length&&!r[0].isMatch)return this.parent.sanitize(t);for(var s="",o=0;o<r.length;o++){var a=r[o],l=this.parent.sanitize(a.text);a.isMatch?s+='<span class="'+(a.isActive?"e-find-match e-find-active-match":"e-find-match")+'">'+l+"</span>":s+=l}return s},So.prototype.appendHtml=function(e,t,i){return e[""+(i=void 0===i?"innerHTML":i)]=t,e},So.prototype.setAttributes=function(e,t,i){var n=t.column;this.buildAttributeFromCell(e,t,"checkbox"===n.type),dp(e,i),dp(e,t.attributes),n.customAttributes&&dp(e,n.customAttributes),"Vertical"===this.parent.rowRenderingMode&&dp(e,{"data-cell":n.headerText}),n.textAlign&&(i={right:"e-rightalign",left:"e-leftalign",center:"e-centeralign",justify:"e-justifyalign"})[n.textAlign.toLowerCase()]&&e.classList.add(i[n.textAlign.toLowerCase()]),"Clip"===n.clipMode||!n.clipMode&&"Clip"===this.parent.clipMode?e.classList.add("e-gridclip"):"EllipsisWithTooltip"!==n.clipMode&&(n.clipMode||"EllipsisWithTooltip"!==this.parent.clipMode||this.parent.allowTextWrap&&("Content"===this.parent.textWrapSettings.wrapMode||"Both"===this.parent.textWrapSettings.wrapMode))||"checkbox"!==n.type&&e.classList.add("e-ellipsistooltip")},So.prototype.buildAttributeFromCell=function(e,t,i){var n={},r=[];t.colSpan&&(n.colSpan=t.colSpan),t.rowSpan&&(n.rowSpan=t.rowSpan),t.isTemplate&&r.push("e-templatecell"),"rownumber"===t.column.type&&r.push(ys),t.isSelected&&(r.push.apply(r,["e-selectionbackground","e-active"]),i)&&e.querySelector(".e-frame").classList.add("e-check"),t.isColumnSelected&&r.push.apply(r,["e-columnselection"]),t.cellType===oe.CellType.Header?n[zs]=t.colIndex+1:H.isNullOrUndefined(t.index)||(n[zs]=t.index+1),t.visible||r.push("e-hide"),n.class=r,dp(e,n)},So.prototype.getValue=function(e,t,i){return i.valueAccessor(e,t,i)};var vo=So;function So(e,t){this.localizer=t.getService("localization"),this.formatter=t.getService("valueFormatter"),this.parent=e,this.element=this.parent.createElement("TD",{className:b,attrs:{role:"gridcell",tabindex:"-1"}}),this.rowChkBox=this.parent.createElement("input",{className:"e-checkselect",attrs:{type:"checkbox","aria-label":this.localizer.getConstant("SelectRow")}})}wo.prototype.setOptions=function(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++)bo(e,Io[i[parseInt(n.toString(),10)]],t[i[parseInt(n.toString(),10)]])},wo.prototype.setExpand=function(e,t){bo(e,Io.expand,t)},wo.prototype.setSort=function(e,t){bo(e,Io.sort,t,"boolean"==typeof t)},wo.prototype.setBusy=function(e,t){bo(e,Io.busy,t),bo(e,Io.invalid,null,!0)},wo.prototype.setGrabbed=function(e,t,i){bo(e,Io.grabbed,t,i)},wo.prototype.setDropTarget=function(e,t){bo(e,Io.dropeffect,"copy",!t)};var Co=wo;function wo(){}function bo(e,t,i,n){n&&e?e.removeAttribute(t):e&&e.setAttribute(t,i)}var Io={expand:"aria-expanded",role:"role",datarole:"data-role",selected:"aria-selected",multiselectable:"aria-multiselectable",sort:"aria-sort",busy:"aria-busy",invalid:"aria-invalid",grabbed:"aria-grabbed",dropeffect:"aria-dropeffect",haspopup:"aria-haspopup",level:"aria-level",colcount:"aria-colcount",rowcount:"aria-rowcount"};Ro=function(e,t){return(Ro=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Ro(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(To,xo=vo),To.prototype.getGui=function(){return this.gui.cloneNode()},To.prototype.render=function(e,t,i){var n=this.element.cloneNode(),r=this.parent.createElement("div",{className:"e-filtermenudiv e-icons e-icon-filter",attrs:{"aria-hidden":"true"}});return this.prepareHeader(e,n,r)},To.prototype.refresh=function(e,t){this.clean(t);var i=this.parent.createElement("div",{className:"e-filtermenudiv e-icons e-icon-filter",attrs:{"aria-hidden":"true"}});return this.prepareHeader(e,t,i)},To.prototype.clean=function(e){e.innerHTML=""},To.prototype.prepareHeader=function(i,n,e){var t=i.column,r={},s="",o=this.getGui(),a=this.parent.createElement("div",{className:"e-headercell-container"});if(H.attributes(o,{"data-mappinguid":t.uid,class:"e-headercelldiv"}),H.isNullOrUndefined(t.headerValueAccessor)||(C=this.getValue(t.headerText,t)),this.parent.rowHeight&&this.parent.allowSorting&&t.allowSorting&&!H.isNullOrUndefined(t.field)&&n.classList.add("e-sort-icon"),"checkbox"!==t.type?(w=t.headerText,H.isNullOrUndefined(C)||(w=C),(C=this.hTxtEle.cloneNode())[t.getDomSetter()]=this.parent.sanitize(w),o.appendChild(C)):(t.editType="booleanedit",w=M.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "}),this.chkAllBox.id="checkbox-"+t.uid,w.insertBefore(this.chkAllBox.cloneNode(),w.firstChild),this.parent.cssClass&&H.addClass([w],[this.parent.cssClass]),o.appendChild(w),o.classList.add("e-headerchkcelldiv"),a.classList.add("e-header-checkbox")),this.buildAttributeFromCell(n,i),a.appendChild(o),a.appendChild(this.sortEle.cloneNode()),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&t.allowFiltering&&!H.isNullOrUndefined(t.field)&&(!this.parent.showColumnMenu||!t.showColumnMenu)){H.attributes(e,{"data-mappinguid":"e-flmenu-"+t.uid}),s=s.length?s+". "+this.localizer.getConstant("FilterDescription"):this.localizer.getConstant("FilterDescription"),n.classList.add("e-fltr-icon");var l=[];if(this.parent.filterSettings.columns.length&&this.parent.filterSettings.columns.length!==l.length)for(var h=this.parent.getForeignKeyColumns(),d=0;d<this.parent.columns.length;d++)for(var p=0;p<this.parent.filterSettings.columns.length;p++)if(this.parent.filterSettings.columns[parseInt(p.toString(),10)].field===t.field||h.length&&t.foreignKeyValue===this.parent.filterSettings.columns[parseInt(p.toString(),10)].field){e.classList.add("e-filtered"),l.push(t.field);break}a.appendChild(e.cloneNode())}this.appendHtml(n,a),i.className&&n.classList.add(i.className),t.customAttributes&&dp(n,t.customAttributes),this.parent.allowSorting&&t.allowSorting&&(r.sort="none",s=s.length?s+". "+this.localizer.getConstant("SortDescription"):this.localizer.getConstant("SortDescription")),(this.parent.allowGrouping&&t.allowGrouping||this.parent.allowReordering&&t.allowReordering)&&(r.grabbed=!1,s=s.length?s+". "+this.localizer.getConstant("GroupDescription"):this.localizer.getConstant("GroupDescription")),this.parent.showColumnMenu&&"checkbox"!==t.type&&!t.template&&(s=s.length?s+". "+this.localizer.getConstant("ColumnMenuDescription"):this.localizer.getConstant("ColumnMenuDescription")),n=this.extendPrepareHeader(t,n);var c,u,g,f,m,y,v,S,C=this.parent,w=C.getColumnIndexByField(t.field),b=(H.isNullOrUndefined(t.headerTemplate)||(b=C.element.id+t.uid+"headerTemplate",c="isStringTemplate",v=t,y=this.parent.isReact&&"string"!=typeof t.headerTemplate&&!(t.headerTemplate.prototype&&t.headerTemplate.prototype.CSPTemplate),u=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,m=this.parent.printGridParent&&this.parent.printGridParent.isReact,g=this.parent.createElement("div",{className:"e-headertext"}),f=n.querySelector(".e-headercelldiv"),y||u||m?(y={index:w},n.querySelector(".e-headertext")&&n.querySelector(".e-headertext").remove(),f.appendChild(g),t.getHeaderTemplate()(H.extend(y,v),C,"headerTemplate",b,this.parent[c],null,f.querySelector(".e-headertext")),this.parent.renderTemplates()):(u=t.getHeaderTemplate()(H.extend({index:w},v),C,"headerTemplate",b,this.parent[c],void 0,void 0,this.parent.root),f.innerHTML="",!H.isNullOrUndefined(u)&&u[0]&&u[0].classList&&u[0].classList.contains("e-headertext")?Ip(f,u):(Ip(g,u),f.appendChild(g)))),this.parent.formulaModule&&(m=mu(this.parent.getColumnIndexByField(t.field)),y=this.parent.createElement("span",{className:"e-header-col-ref e-col-hidden",innerHTML:m}),o.insertBefore(y,o.querySelector(".e-headertext"))),t.type&&"rownumber"===t.type.toLowerCase()&&n.classList.add("e-header-rownumber-cell"),this.ariaService.setOptions(n,r),H.isNullOrUndefined(t.headerTextAlign)&&H.isNullOrUndefined(t.textAlign)||("right"===(w=t.headerTextAlign||t.textAlign).toLowerCase()||"left"===w.toLowerCase()?n.classList.add("right"===w.toLowerCase()?"e-rightalign":"e-leftalign"):"center"===w.toLowerCase()?n.classList.add("e-centeralign"):"justify"===w.toLowerCase()&&n.classList.add("e-justifyalign")),"Clip"===t.clipMode||!t.clipMode&&"Clip"===this.parent.clipMode?n.classList.add("e-gridclip"):"EllipsisWithTooltip"!==t.clipMode&&(t.clipMode||"EllipsisWithTooltip"!==this.parent.clipMode)||C.allowTextWrap&&("Header"===C.textWrapSettings.wrapMode||"Both"===C.textWrapSettings.wrapMode)||"checkbox"!==t.type&&n.classList.add("e-ellipsistooltip"),s&&((v=this.parent.createElement("span",{id:"headerTitle-"+t.uid,innerHTML:s})).style.display="none",a.appendChild(v),n.setAttribute("aria-describedby",v.id)),n.setAttribute("aria-rowspan",(H.isNullOrUndefined(i.rowSpan)?1:i.rowSpan).toString()),n.setAttribute("aria-colspan","1"),this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact);return(this.parent.isReact&&this.parent.requireTemplateRef||b&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&!H.isNullOrUndefined(t.headerTemplate)?(S=this).parent.renderTemplates(function(){var e=n.querySelectorAll(".e-headertext");if(e)for(var t=1;t<e.length;t++)e[parseInt(t.toString(),10)].classList.remove("e-headertext");S.parent.trigger(se,{cell:i,node:n})}):this.parent.trigger(se,{cell:i,node:n}),this.parent.isFrozenGrid()&&zc(this.parent,t,n),n},To.prototype.getValue=function(e,t){return t.headerValueAccessor(e,t)},To.prototype.extendPrepareHeader=function(e,t){if(this.parent.showColumnMenu&&e.showColumnMenu&&!H.isNullOrUndefined(e.field)){var i=this.parent.createElement("div",{className:"e-icons e-columnmenu",attrs:{"aria-hidden":"true"}}),n=[];if(this.parent.filterSettings.columns.length&&this.parent.filterSettings.columns.length!==n.length)for(var r=0;r<this.parent.columns.length;r++)for(var s=0;s<this.parent.filterSettings.columns.length;s++)if(this.parent.filterSettings.columns[parseInt(s.toString(),10)].field===e.field){i.classList.add("e-filtered"),n.push(e.field);break}t.classList.add("e-fltr-icon"),t.querySelector(".e-headercell-container").appendChild(i)}var o;return this.parent.allowResizing&&((o=this.parent.createElement("div")).className=e.allowResizing?"e-rhandler e-rcursor":"e-rsuppress",t.appendChild(o)),t},To.prototype.appendHtml=function(e,t){return e.appendChild(t),e};var Ro,xo,Do=To;function To(){var e=null!==xo&&xo.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-headercell",attrs:{tabindex:"-1",role:"columnheader"}}),e.ariaService=new Co,e.hTxtEle=e.parent.createElement("span",{className:"e-headertext"}),e.sortEle=e.parent.createElement("div",{className:"e-sortfilterdiv e-icons",attrs:{"aria-hidden":"true"}}),e.gui=e.parent.createElement("div"),e.chkAllBox=e.parent.createElement("input",{className:"e-checkselectall",attrs:{type:"checkbox","aria-label":e.localizer.getConstant("SelectAllCheckbox")}}),e}Eo=function(e,t){return(Eo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Eo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Fo,Oo=vo),Fo.prototype.render=function(e,t,i){var n=this.element.cloneNode(),r=this.parent.createElement("div",{className:"e-headercell-container e-stacked-header"}),s=this.parent.createElement("div",{className:"e-stackedheadercelldiv",attrs:{"data-mappinguid":e.column.uid}}),o=e.column;if(r.appendChild(s),n.appendChild(r),H.isNullOrUndefined(o.headerTemplate)?this.appendHtml(s,this.parent.sanitize(o.headerText),o.getDomSetter()):Ip(s,o.getHeaderTemplate()(o,this.parent,"headerTemplate",null,null,null,null,this.parent.root)),e.column.toolTip&&n.setAttribute("title",e.column.toolTip),"Clip"===o.clipMode||!o.clipMode&&"Clip"===this.parent.clipMode?n.classList.add("e-gridclip"):"EllipsisWithTooltip"!==o.clipMode&&(o.clipMode||"EllipsisWithTooltip"!==this.parent.clipMode)||n.classList.add("e-ellipsistooltip"),H.isNullOrUndefined(e.column.textAlign)||(r={right:"e-rightalign",left:"e-leftalign",center:"e-centeralign",justify:"e-justifyalign"})[e.column.textAlign.toLowerCase()]&&n.classList.add(r[e.column.textAlign.toLowerCase()]),e.column.customAttributes&&dp(n,e.column.customAttributes),n.setAttribute("colspan",e.colSpan.toString()),n.setAttribute("aria-colspan",e.colSpan.toString()),n.setAttribute("aria-rowspan","1"),this.parent.allowResizing&&((s=this.parent.createElement("div")).className=e.column.allowResizing?"e-rhandler e-rcursor":"e-rsuppress",n.appendChild(s)),e.className&&n.classList.add(e.className),this.parent.trigger(se,{cell:e,node:n}),"Left"===kc(o))if(n.classList.add("e-leftfreeze"),"Left"===o.border&&n.classList.add("e-freezeleftborder"),0===o.index)Lc(n,30*this.parent.getIndentCount(),this.parent.enableRtl,"Left");else{for(var a=this.parent.getColumns(),l=30*this.parent.getIndentCount(),h=0;h<a.length&&!(o.index<a[parseInt(h.toString(),10)].index);h++)a[parseInt(h.toString(),10)].visible&&(l+=parseFloat(a[parseInt(h.toString(),10)].width.toString()));Lc(n,l,this.parent.enableRtl,"Left")}else if("Right"===kc(o)){n.classList.add("e-rightfreeze");for(a=this.parent.getColumns(),l="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0,h=a.length-1;0<=h&&!(Fc(o,a[parseInt(h.toString(),10)].uid)||o.index>a[parseInt(h.toString(),10)].index);h--)a[parseInt(h.toString(),10)].visible&&(l+=parseFloat(a[parseInt(h.toString(),10)].width.toString()));Lc(n,l,this.parent.enableRtl,"Right"),"Right"===o.border&&n.classList.add("e-freezerightborder")}else if("Fixed"===kc(o)){n.classList.add("e-fixedfreeze");a=this.parent.getColumns(),l=0;this.parent.getVisibleFrozenLeftCount()?l=30*this.parent.getIndentCount():"Right"===this.parent.getFrozenMode()&&(l=30*this.parent.groupSettings.columns.length);for(h=0;h<a.length;h++)o.index>a[parseInt(h.toString(),10)].index&&("Left"===a[parseInt(h.toString(),10)].freeze||a[parseInt(h.toString(),10)].isFrozen||"Fixed"===a[parseInt(h.toString(),10)].freeze)&&a[parseInt(h.toString(),10)].visible&&(l+=parseFloat(a[parseInt(h.toString(),10)].width.toString()));Lc(n,l-1,this.parent.enableRtl,"Left"),l="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0;for(h=a.length-1;0<=h;h--)if(o.index<a[parseInt(h.toString(),10)].index){if(Fc(o,a[parseInt(h.toString(),10)].uid)||o.index>a[parseInt(h.toString(),10)].index)break;"Right"!==a[parseInt(h.toString(),10)].freeze&&"Fixed"!==a[parseInt(h.toString(),10)].freeze||a[parseInt(h.toString(),10)].visible&&(l+=parseFloat(a[parseInt(h.toString(),10)].width.toString()))}Lc(n,l-1,this.parent.enableRtl,"Right")}else n.classList.add("e-unfreeze");return n};var Eo,Oo,Ao=Fo;function Fo(){var e=null!==Oo&&Oo.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-headercell e-stackedheadercell",attrs:{tabindex:"-1",role:"columnheader"}}),e}Mo=function(e,t){return(Mo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Mo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Lo,ko=vo),Lo.prototype.render=function(e,t){var i=this.element.cloneNode();return dp(i,e.attributes),i};var Mo,ko,Po=Lo;function Lo(){var e=null!==ko&&ko.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-indentcell"}),e}No=function(e,t){return(No=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var No,Bo,t=function(e,t){function i(){this.constructor=e}No(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},zo=(t(qo,Bo=vo),qo.prototype.render=function(e,n){this.element.id=this.parent.element.id+"captioncell"+this.cellUid++;for(var t,r,i,s,o=this.element.cloneNode(),a=this.parent,l=e.column,l=l.getDomSetter?l.getDomSetter():"innerHTML",h=(n.headerText=e.column.headerText,e.isForeignKey&&(h=this.format(e.column,e.column.valueAccessor("foreignKey",n,e.column))),e.isForeignKey?h:e.column.enableGroupByFormat?n.key:this.format(e.column,e.column.valueAccessor("key",n,e.column))),d=0;d<a.aggregates.length;d++)for(var p=this,c=0;c<a.aggregates[parseInt(d.toString(),10)].columns.length;c++)if("break"===function(e){var t,i;if(a.getVisibleColumns()[0].field===a.aggregates[parseInt(d.toString(),10)].columns[parseInt(e.toString(),10)].field&&a.aggregates[parseInt(d.toString(),10)].columns[parseInt(e.toString(),10)].groupCaptionTemplate)return"string"==typeof(t=a.aggregates[parseInt(d.toString(),10)].columns[parseInt(e.toString(),10)].groupCaptionTemplate)&&t.includes("$")?r=a.aggregates[parseInt(d.toString(),10)].columns[parseInt(e.toString(),10)].groupCaptionTemplate.split("$")[0]+n[a.getVisibleColumns()[0].field][a.aggregates[parseInt(d.toString(),10)].columns[parseInt(e.toString(),10)].type]+a.aggregates[parseInt(d.toString(),10)].columns[parseInt(e.toString(),10)].groupCaptionTemplate.split("}")[1]:(e=(t=a.aggregates[parseInt(d.toString(),10)].columns[parseInt(e.toString(),10)]).getTemplate(oe.CellType.CaptionSummary),H.isNullOrUndefined(e)||(i=e.fn(n[t.columnName],p.parent,e.property,""),e=p.parent.printGridParent&&p.parent.printGridParent.isReact,(p.parent.isReact||e)&&"string"!=typeof t.groupCaptionTemplate?p.parent.renderTemplates(function(){i&&i.length&&(H.isNullOrUndefined(a.groupSettings.captionTemplate)?o.innerText+=" "+i[0].textContent:o.appendChild(i[0]))}):i&&i.length&&(r=H.isNullOrUndefined(a.groupSettings.captionTemplate)?i[0].textContent:i))),"break"}(c))break;return H.isNullOrUndefined(a.groupSettings.captionTemplate)?a.groupSettings.enableLazyLoading?o[""+l]=this.parent.sanitize(e.column.headerText)+": "+this.parent.sanitize(h)+(r?" "+r:""):o[""+l]=this.parent.sanitize(e.column.headerText)+": "+this.parent.sanitize(h)+" - "+n.count+" "+(n.count<2?this.localizer.getConstant("Item"):this.localizer.getConstant("Items"))+(r?" "+r:""):(l=this.parent.isReact&&"string"!=typeof a.groupSettings.captionTemplate&&!(a.groupSettings.captionTemplate.prototype&&a.groupSettings.captionTemplate.prototype.CSPTemplate),h=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,i=this.parent.printGridParent&&this.parent.printGridParent.isReact,l||h||i?(s=a.element.id+"captionTemplate",n.groupKey=n.key,hp(a.groupSettings.captionTemplate)(n,this.parent,"captionTemplate",s,null,null,o),this.parent.renderTemplates()):t=this.parent.isVue||a.parentDetails&&a.parentDetails.parentInstObj&&a.parentDetails.parentInstObj.isVue?hp(a.groupSettings.captionTemplate)(n,this.parent,"captionTemplate",null,null,null,null,a.root):hp(a.groupSettings.captionTemplate)(n),l||h||i||(Ip(o,t),r&&r.length&&r[0].textContent&&o.appendChild(r[0]))),o.setAttribute("colspan",e.colSpan.toString()),o.setAttribute("aria-label",o.innerHTML+this.localizer.getConstant("GroupCaption")),o.setAttribute("title",o.textContent),o},qo);function qo(){var e=null!==Bo&&Bo.apply(this,arguments)||this;return e.cellUid=0,e.element=e.parent.createElement("TD",{className:"e-groupcaption",attrs:{id:e.parent.element.id+"captioncell",tabindex:"-1"}}),e}t(Vo,Uo=vo),Vo.prototype.render=function(e,t){var i=this.element.cloneNode();return i.innerHTML="&nbsp;",i.setAttribute("colspan",e.colSpan.toString()),i};var Uo,Ho=Vo;function Vo(){var e=null!==Uo&&Uo.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-groupcaption"}),e}jo=function(e,t){return(jo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}jo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ko,Go=Po),Ko.prototype.render=function(e,t,i,n){var r=this.element.cloneNode();return r.setAttribute("data-mappingname",t.field),r.setAttribute("data-mappingvalue",t.key),r.setAttribute("aria-expanded",n?"true":"false"),r.setAttribute("tabindex","-1"),this.parent.infiniteScrollSettings&&this.parent.infiniteScrollSettings.enableCache&&!this.parent.groupSettings.enableLazyLoading?(e.cellType=oe.CellType.Indent,r.className=n?"e-recordplusexpand e-disablepointer":"e-recordpluscollapse e-disablepointer"):(r.className=n?"e-recordplusexpand":"e-recordpluscollapse",r.appendChild(this.parent.createElement("a",{className:n?"e-icons e-gdiagonaldown e-icon-gdownarrow":"e-icons e-gnextforward e-icon-grightarrow",attrs:{href:"#",title:n?this.localizer.getConstant("Expanded"):this.localizer.getConstant("Collapsed")}}))),r};var jo,Go,_o=Ko;function Ko(){return null!==Go&&Go.apply(this,arguments)||this}Wo=function(e,t){return(Wo=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Wo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Yo,Qo=vo),Yo.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-headercelldiv e-emptycell",innerHTML:""})),e&&(e.rowSpan&&i.setAttribute("rowspan",e.rowSpan.toString()),0===e.rowSpan)&&(i.style.display="none"),i};var Wo,Qo,Xo=Yo;function Yo(){var e=null!==Qo&&Qo.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-grouptopleftcell"}),e}$o=function(e,t){return($o=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}$o(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ea,Zo=vo),ea.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-emptycell"})),e&&(e.rowSpan&&i.setAttribute("rowspan",e.rowSpan.toString()),0===e.rowSpan)&&(i.style.display="none"),i};var $o,Zo,Jo=ea;function ea(){var e=null!==Zo&&Zo.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-detailheadercell"}),e}ta=function(e,t){return(ta=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ta(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ra,ia=vo),ra.prototype.render=function(e,t,i){var n=this.element.cloneNode();return i&&!H.isNullOrUndefined(i.class)?(n.className="",n.className=i.class,n.appendChild(this.parent.createElement("a",{className:"e-icons e-dtdiagonaldown e-icon-gdownarrow",attrs:{href:"#",title:this.localizer.getConstant("Expanded")}}))):n.appendChild(this.parent.createElement("a",{className:"e-icons e-dtdiagonalright e-icon-grightarrow",attrs:{href:"#",title:this.localizer.getConstant("Collapsed")}})),e.isSelected&&n.classList.add("e-selectionbackground","e-active"),n};var ta,ia,na=ra;function ra(){var e=null!==ia&&ia.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-detailrowcollapse",attrs:{"aria-expanded":"false",tabindex:"-1"}}),e}sa=function(e,t){return(sa=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}sa(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(la,oa=vo),la.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-icons e-rowcelldrag e-dtdiagonalright e-icon-rowdragicon",attrs:{"aria-hidden":"true"}})),e.isSelected&&(i.classList.add("e-selectionbackground"),i.classList.add("e-active")),(this.parent.getVisibleFrozenRightCount()||this.parent.getVisibleFrozenLeftCount())&&(i.classList.add("e-leftfreeze"),Lc(i,"Right"===this.parent.getFrozenMode()?0:30*this.parent.groupSettings.columns.length,this.parent.enableRtl,"Right"===this.parent.getFrozenMode()?"Right":"Left")),i};var sa,oa,aa=la;function la(){var e=null!==oa&&oa.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-rowdragdrop e-rowdragdropcell",attrs:{tabindex:"-1",role:"gridcell"}}),e}ha=function(e,t){return(ha=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ha(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ca,da=vo),ca.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(H.createElement("div",{className:"e-emptycell"})),e&&(e.rowSpan&&i.setAttribute("rowspan",e.rowSpan.toString()),0===e.rowSpan)&&(i.style.display="none"),(this.parent.getVisibleFrozenRightCount()||this.parent.getVisibleFrozenLeftCount())&&(i.classList.add("e-leftfreeze"),Lc(i,"Right"===this.parent.getFrozenMode()?0:30*this.parent.groupSettings.columns.length,this.parent.enableRtl,"Right"===this.parent.getFrozenMode()?"Right":"Left")),i};var ha,da,pa=ca;function ca(){var e=null!==da&&da.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-rowdragheader"}),e}ua=function(e,t){return(ua=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ua(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ma,ga=vo),ma.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(this.parent.createElement("div",{className:"e-emptycell",innerHTML:""})),e&&(e.rowSpan&&i.setAttribute("rowspan",e.rowSpan.toString()),0===e.rowSpan)&&(i.style.display="none"),i};var ua,ga,fa=ma;function ma(){var e=null!==ga&&ga.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-pindentcell",attrs:{tabindex:"-1",role:"gridcell"}}),e}va.prototype.render=function(){var e=this.parent;this.headerRenderer=this.renderer.getRenderer(oe.RenderType.Header),this.contentRenderer=this.renderer.getRenderer(oe.RenderType.Content),this.headerRenderer.renderPanel(),this.contentRenderer.renderPanel(),e.getColumns().length&&(this.isLayoutRendered=!0,this.headerRenderer.renderTable(),this.contentRenderer.renderTable(),this.emptyRow(!1)),this.parent.scrollModule.setWidth(),this.parent.scrollModule.setHeight(),this.parent.scrollModule.refresh(),"auto"!==this.parent.height&&this.parent.scrollModule.setPadding(),this.refreshDataManager()},va.prototype.refresh=function(n){var r=this,s=(void 0===n&&(n={requestType:"refresh"}),this.parent);s.notify(n.requestType+"-begin",n),s.trigger(y,n,function(e){var t,i;(e=void 0===e?{requestType:"refresh"}:e).cancel?(s.notify(Yi,e),s.filterModule&&s.filterModule.maintainFocusOnFilterDialog&&(s.filterModule.maintainFocusOnFilterDialog=!1),"clearFilter"===e.action&&"Menu"===r.parent.filterSettings.type&&(r.parent.filterSettings.columns[r.parent.filterModule.filterObjIndex]=r.parent.filterModule.prevFilterObject,t=r.parent.showColumnMenu&&r.parent.filterModule.column.showColumnMenu?".e-columnmenu":".e-icon-filter",t=r.parent.element.querySelector('[data-mappinguid="'+r.parent.filterModule.column.uid+'"]').parentElement.querySelector(t),H.isNullOrUndefined(r.parent.filterModule.prevFilterObject)||t.classList.add("e-filtered")),"clear-filter"!==e.action||"CheckBox"!==r.parent.filterSettings.type&&"Excel"!==r.parent.filterSettings.type||(r.parent.filterSettings.columns=r.parent.filterModule.checkboxPrevFilterObject),"grouping"===e.requestType&&-1!==(t=s.groupSettings.columns.indexOf(e.columnName))&&(s.setProperties({groupSettings:{Columns:s.groupSettings.columns.splice(t,1)}},!0),s.setProperties({sortSettings:{Columns:s.sortSettings.columns.splice(t,1)}},!0),t=s.getColumnByField(e.columnName),i=s.getColumnHeaderByField(t.field),t.visible=!H.isNullOrUndefined(i)&&!i.classList.contains("e-hide"))):(n&&n.pageSize&&n.previousPageSize&&n.pageSize!==n.previousPageSize&&r.parent.getDataModule().clearCache(),r.parent.notify(Jr,e),"virtualscroll"===e.requestType&&(r.parent.getDataModule().isRemote()||"result"in r.parent.dataSource)&&e.virtualInfo&&"down"===e.virtualInfo.direction&&(r.parent.contentModule.prevInfo=e.virtualInfo),r.parent.groupModule&&e.preventFocusOnGroup&&(r.parent.groupModule.preventFocusOnGroup=e.preventFocusOnGroup),!s.allowSelection||-1===["filter","clearFilter","clear-filter","add"].indexOf(e.action)&&-1===["searching","sorting","grouping","ungrouping","delete"].indexOf(e.requestType)||(s.selectionModule.rmtHdrChkbxClicked=!1,s.selectionModule.isPartialSelection&&(s.selectionModule.isHdrSelectAllClicked=!1)),s.allowPaging&&s.pageSettings.pageSizes&&s.pagerModule.pagerObj.isAllPage&&"add"===e.action&&"save"===e.requestType&&s.pagerModule.pagerObj.checkAll&&s.setProperties({pageSettings:{pageSize:s.pageSettings.pageSize+1}},!0),"delete"===e.requestType&&s.allowPaging&&(t=e.data.length,i=s.pageSettings.totalRecordsCount-t,!(s.getCurrentViewRecords().length-t)&&i&&(s.pageSettings.currentPage-1)*s.pageSettings.pageSize==i||i&&i<=t)&&(s.prevPageMoving=!0,s.setProperties({pageSettings:{totalRecordsCount:i,currentPage:Math.ceil(i/s.pageSettings.pageSize)}},!0),s.pagerModule.pagerObj.totalRecordsCount=i),"reorder"===e.requestType&&r.parent.dataSource&&"result"in r.parent.dataSource||("paging"===e.requestType||"columnstate"===e.requestType||"reorder"===e.requestType)&&r.parent.groupSettings.enableLazyLoading&&r.parent.groupSettings.columns.length&&(r.parent.enableVirtualization?r.parent.lazyLoadRender:r.parent.contentModule).getGroupCache()[r.parent.pageSettings.currentPage]?r.contentRenderer.refreshContentRows(e):r.refreshDataManager(e))})},va.prototype.resetTemplates=function(){var e,t=this.parent,i=t.getColumns();t.detailTemplate&&(e=t.element.id+"detailTemplate",H.blazorTemplates[e]=[],H.resetBlazorTemplate(e,"DetailTemplate")),t.groupSettings.captionTemplate&&H.resetBlazorTemplate(t.element.id+"captionTemplate","CaptionTemplate"),t.rowTemplate&&H.resetBlazorTemplate(t.element.id+"rowTemplate","RowTemplate"),t.toolbarTemplate&&H.resetBlazorTemplate(t.element.id+"toolbarTemplate","ToolbarTemplate"),t.pageSettings.template&&H.resetBlazorTemplate(t.element.id+"_template","pageSettings");for(var n=0;n<i.length;n++)i[parseInt(n.toString(),10)].template&&(H.blazorTemplates[t.element.id+i[parseInt(n.toString(),10)].uid]=[],H.resetBlazorTemplate(t.element.id+i[parseInt(n.toString(),10)].uid,"Template")),i[parseInt(n.toString(),10)].headerTemplate&&H.resetBlazorTemplate(t.element.id+i[parseInt(n.toString(),10)].uid+"headerTemplate","HeaderTemplate"),i[parseInt(n.toString(),10)].filterTemplate&&H.resetBlazorTemplate(t.element.id+i[parseInt(n.toString(),10)].uid+"filterTemplate","FilterTemplate");for(var r="guid",s=0;s<t.aggregates.length;s++)for(var o,a=0;a<t.aggregates[parseInt(s.toString(),10)].columns.length;a++)t.aggregates[parseInt(s.toString(),10)].columns[parseInt(a.toString(),10)].footerTemplate&&(o=t.element.id+t.aggregates[parseInt(s.toString(),10)].columns[parseInt(a.toString(),10)][r]+"footerTemplate",H.resetBlazorTemplate(o,"FooterTemplate")),t.aggregates[parseInt(s.toString(),10)].columns[parseInt(a.toString(),10)].groupFooterTemplate&&(o=t.element.id+t.aggregates[parseInt(s.toString(),10)].columns[parseInt(a.toString(),10)][r]+"groupFooterTemplate",H.resetBlazorTemplate(o,"GroupFooterTemplate")),t.aggregates[parseInt(s.toString(),10)].columns[parseInt(a.toString(),10)].groupCaptionTemplate&&(o=t.element.id+t.aggregates[parseInt(s.toString(),10)].columns[parseInt(a.toString(),10)][r]+"groupCaptionTemplate",H.resetBlazorTemplate(o,"GroupCaptionTemplate"))},va.prototype.refreshComplete=function(e){this.parent.trigger(c,e)},va.prototype.refreshDataManager=function(n){var t,i,r=this,e=(void 0===n&&(n={}),this.parent),s=this.parent.getColumns(),s=(s&&s.length&&!s[0].visible?this.isFirstColumnHidden=!0:this.isFirstColumnHidden=!1,"Shimmer"===e.loadingIndicator.indicatorType&&"virtualscroll"!==n.requestType&&"infiniteScroll"!==n.requestType||("virtualscroll"===n.requestType||"infiniteScroll"===n.requestType)&&e.enableVirtualMaskRow),s=("virtualscroll"===n.requestType||"dom-virtualscroll"===n.requestType||n.isCaptionCollapse||s||this.parent.showSpinner(),s&&e.showMaskRow("virtualscroll"===n.requestType?n.virtualInfo.sentinelInfo.axis:"infiniteScroll"===n.requestType?n.direction:void 0),this.parent.notify(Ln,n),this.emptyGrid=!1,this.isNeedForeignAction()),o=(this.ariaService.setBusy(this.parent.getContent().querySelector("."+xs),!0),s&&(o=new V.Deferred,t=this.getFData(o,n)),t=t?t.then(function(e){var t,i=r.parent.setRequiresCount(r.data.generateQuery());return r.emptyGrid?((t=new V.Deferred).resolve({result:[],count:0}),t.promise):r.data.getData(n,i)}):(e.allowPaging&&!e.getDataModule().dataManager.dataSource.offline&&e.pageSettings&&e.pageSettings.pageSizes&&e.pagerModule&&e.pagerModule.pagerObj&&e.pagerModule.pagerObj.isAllPage&&(e.pagerModule.pagerObj.isAllPage=void 0),this.data.getData(n,this.parent.setRequiresCount(this.data.generateQuery()))),this.parent.getForeignKeyColumns()),e=o.length;!(e="ExcludeHidden"===this.parent.columnQueryMode?e&&o.filter(function(e){return!1!==e.visible}).length:e)||s&&!this.parent.searchSettings.key.length||(i=new V.Deferred,t=t.then(function(e){return r.parent.notify(qi,{dataManager:t,result:e,promise:i,action:n}),i.promise})),(t=this.parent.groupSettings.disablePageWiseAggregates&&this.parent.groupSettings.columns.length?t.then(function(e){return r.validateGroupRecords(e)}):t).then(function(e){return r.dataManagerSuccess(e,n)}).catch(function(e){return r.dataManagerFailure(e,n)})},va.prototype.getFData=function(e,t){return this.parent.notify(qi,{isComplex:!0,promise:e,action:t}),e.promise},va.prototype.isNeedForeignAction=function(){var e=this.parent;return!!(e.allowFiltering&&e.filterSettings.columns.length||!H.isNullOrUndefined(e.searchSettings.key)&&e.searchSettings.key.length)&&this.foreignKey(this.parent.getForeignKeyColumns())},va.prototype.foreignKey=function(e){var i=this;return e.some(function(t){return!(!i.parent.filterSettings.columns.some(function(e){return t.uid===e.uid})&&!i.parent.searchSettings.key.length)})},va.prototype.sendBulkRequest=function(t){var i=this,e=(t.requestType="batchsave",this.parent),n=(e.allowPaging&&e.pageSettings.pageSizes&&e.pagerModule.pagerObj.isAllPage&&e.pagerModule.pagerObj.checkAll&&(n=t.changes.addedRecords.length)&&e.setProperties({pageSettings:{pageSize:e.pageSettings.pageSize+n}},!0),e.allowPaging&&(t.changes.addedRecords.length||t.changes.deletedRecords.length||t.changes.changedRecords.length)&&e.pageSettings&&e.pageSettings.pageSizes&&e.pagerModule&&e.pagerModule.pagerObj&&!e.getDataModule().dataManager.dataSource.offline&&e.pagerModule.pagerObj.isAllPage&&(e.pagerModule.pagerObj.isAllPage=void 0),this.data.saveChanges(t.changes,this.parent.getPrimaryKeyFieldNames()[0],t.original)),r=this.parent.setRequiresCount(this.data.generateQuery());this.data.dataManager.dataSource.offline?this.refreshDataManager({requestType:"batchsave"}):n.then(function(e){i.data.getData(t,r).then(function(e){return i.dmSuccess(e,t)}).catch(function(e){return i.dmFailure(e,t)})}).catch(function(e){return i.dmFailure(e,t)})},va.prototype.dmSuccess=function(e,t){this.dataManagerSuccess(e,t)},va.prototype.dmFailure=function(e,t){this.dataManagerFailure(e,t)},va.prototype.renderEmptyRow=function(){this.emptyRow(!0)},va.prototype.renderEmptyOverlay=function(){var e=this.parent,t=(this.removeEmptyOverlay(),this.parent.createElement("div",{className:"e-empty-row-sticky-content"})),i=this.parent.createElement("div",{className:"e-empty-row-sticky"}),n=((e.enableVirtualization||e.enableColumnVirtualization)&&(this.contentRenderer.virtualEle.adjustTable(0,0),i.classList.add("e-virtual-emptyrecord")),e.emptyRecordTemplate?(n=e.element.id+"emptyRecordTemplate",n=e.getEmptyRecordTemplate()(e.dataSource,e,"emptyRecordTemplate",n,void 0,void 0,void 0,this.parent.root),n=e.isVue?n[1]:n[0],i.appendChild(n),e.isReact&&this.parent.renderTemplates()):i.innerHTML=this.l10n.getConstant("EmptyRecord"),t.appendChild(i),this.contentRenderer.getTable());n&&n.closest(".e-content")&&(n.closest(".e-content").insertBefore(t,n.closest(".e-content").firstElementChild),n.closest(".e-content").classList.add("e-empty-overlay-mode"))},va.prototype.removeEmptyOverlay=function(){var e=this.parent.element.querySelector(".e-empty-row-sticky-content"),e=(e&&H.remove(e),this.parent.element.querySelector(".e-content"));e&&e.classList.remove("e-empty-overlay-mode")},va.prototype.handleEmptyRowTrigger=function(){!this.parent.isInitialLoad&&this.parent.focusModule&&this.parent.focusModule.setFirstFocusableTabIndex(),this.parent.trigger(de,{}),this.parent.notify(Ct,{rows:[new ds({isDataRow:!0,cells:[new cs({isDataCell:!0,visible:!0})]})]});var e=this.parent;e.editSettings.showAddNewRow&&(e.addRecord(),this.parent.notify(Yr,{}))},va.prototype.emptyRow=function(e){var t,i,n,r,s=this.parent,o=this.contentRenderer.getTable().querySelector(j);"Sticky"===s.emptyRecordMode?(H.isNullOrUndefined(o)||H.remove(o),o=this.parent.createElement(j,{attrs:{role:"rowgroup"}}),t=s.allowRowDragAndDrop&&H.isNullOrUndefined(s.rowDropSettings.targetID)?1:0,(s.detailTemplate||s.childGrid)&&++t,i=s.editSettings.showAddNewRow&&"Bottom"===s.editSettings.newRowPosition?"e-emptyrow e-show-added-row":"e-emptyrow",i=this.parent.createElement("tr",{className:i,attrs:{role:"row"}}),t=this.parent.createElement("td",{innerHTML:"",attrs:{colspan:(s.getVisibleColumns().length+t+(H.isNullOrUndefined(s.groupSettings.columns)?0:s.groupSettings.columns.length)).toString()}}),i.appendChild(t),o.appendChild(i),this.contentRenderer.renderEmpty(o),(this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&(this.parent.getHeaderContent().querySelector(j).innerHTML="",s.element.querySelector(".e-frozenrow-border"))&&this.parent.element.querySelector(".e-frozenrow-border").classList.add("e-frozenrow-empty"),this.removeEmptyOverlay(),this.renderEmptyOverlay(),s.emptyRecordTemplate&&s.isReact&&this.parent.renderTemplates(),e&&this.handleEmptyRowTrigger()):(this.removeEmptyOverlay(),H.isNullOrUndefined(o)||H.remove(o),o=this.parent.createElement(j,{attrs:{role:"rowgroup"}}),t=s.allowRowDragAndDrop&&H.isNullOrUndefined(s.rowDropSettings.targetID)?1:0,(s.detailTemplate||s.childGrid)&&++t,i=s.editSettings.showAddNewRow&&"Bottom"===s.editSettings.newRowPosition?"e-emptyrow e-show-added-row":"e-emptyrow",i=this.parent.createElement("tr",{className:i,attrs:{role:"row"}}),s.emptyRecordTemplate?(r=s.element.id+"emptyRecordTemplate",n=this.parent.createElement("td",{attrs:{colspan:(s.getVisibleColumns().length+t+s.groupSettings.columns.length).toString()}}),s.isVue||s.parentDetails&&s.parentDetails.parentInstObj&&s.parentDetails.parentInstObj.isVue?n.appendChild(s.getEmptyRecordTemplate()(s.dataSource,s,"emptyRecordTemplate",r,void 0,void 0,void 0,this.parent.root)[1]):n.appendChild(s.getEmptyRecordTemplate()(s.dataSource,s,"emptyRecordTemplate",r,void 0,void 0,void 0,this.parent.root)[0]),r=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,(s.isReact||r)&&this.parent.renderTemplates()):n=this.parent.createElement("td",{innerHTML:this.l10n.getConstant("EmptyRecord"),attrs:{colspan:(s.getVisibleColumns().length+t+(H.isNullOrUndefined(s.groupSettings.columns)?0:s.groupSettings.columns.length)).toString()}}),s.isFrozenGrid()&&(n.classList.add("e-leftfreeze"),n.style.left="0px"),(s.frozenRows||s.pinnedTopRowModels.length)&&s.element.querySelector(".e-frozenrow-border")&&this.parent.element.querySelector(".e-frozenrow-border").classList.add("e-frozenrow-empty"),i.appendChild(n),o.appendChild(i),this.contentRenderer.renderEmpty(o),e&&(!this.parent.isInitialLoad&&this.parent.focusModule&&this.parent.focusModule.setFirstFocusableTabIndex(),this.parent.trigger(de,{}),this.parent.notify(Ct,{rows:[new ds({isDataRow:!0,cells:[new cs({isDataCell:!0,visible:!0})]})]}),s.editSettings.showAddNewRow)&&(s.addRecord(),this.parent.notify(Yr,{})))},va.prototype.dynamicColumnChange=function(){this.parent.getCurrentViewRecords().length&&this.updateColumnType(this.parent.getCurrentViewRecords()[0])},va.prototype.updateColumnType=function(e){for(var t=this.parent.enableColumnVirtualization?this.parent.columns:this.parent.getColumns(),i="customFormat",n="equalTo",r=e&&e.items?e.items[0]:e,s=this.locator.getService("valueFormatter"),o=0,a=t.length;o<a;o++){l=N(t[parseInt(o.toString(),10)].field||"",r),H.isNullOrUndefined(t[parseInt(o.toString(),10)][i])||(t[parseInt(o.toString(),10)].format=t[parseInt(o.toString(),10)][i]),H.isNullOrUndefined(t[parseInt(o.toString(),10)].validationRules)||H.isNullOrUndefined(t[parseInt(o.toString(),10)].validationRules[n])||(t[parseInt(o.toString(),10)].validationRules[n][0]=this.parent.element.id+t[parseInt(o.toString(),10)].validationRules[n][0]),t[parseInt(o.toString(),10)].isForeignColumn()&&t[parseInt(o.toString(),10)].columnData&&(l=N(t[parseInt(o.toString(),10)].foreignKeyValue||"",t[parseInt(o.toString(),10)].columnData[0])),H.isNullOrUndefined(l)?t[parseInt(o.toString(),10)].type=t[parseInt(o.toString(),10)].type||null:(this.isColTypeDef=!0,t[parseInt(o.toString(),10)].type||(t[parseInt(o.toString(),10)].type=l.getDay?0<l.getHours()||0<l.getMinutes()||0<l.getSeconds()||0<l.getMilliseconds()?"datetime":"date":typeof l));var l=new U;t[parseInt(o.toString(),10)].format&&(t[parseInt(o.toString(),10)].format.skeleton||t[parseInt(o.toString(),10)].format.format&&"string"==typeof t[parseInt(o.toString(),10)].format.format)&&(!t[parseInt(o.toString(),10)].format.skeleton&&!t[parseInt(o.toString(),10)].format.format||!H.isNullOrUndefined(t[parseInt(o.toString(),10)].format.type)||"date"!==t[parseInt(o.toString(),10)].type&&"datetime"!==t[parseInt(o.toString(),10)].type||(t[parseInt(o.toString(),10)].format.type="date"===t[parseInt(o.toString(),10)].type?"date":"dateTime"),t[parseInt(o.toString(),10)].setFormatter(l.getFormatFunction(H.extend({},t[parseInt(o.toString(),10)].format))),t[parseInt(o.toString(),10)].setParser(l.getParserFunction(t[parseInt(o.toString(),10)].format))),"string"==typeof t[parseInt(o.toString(),10)].format?qp(this.locator,t[parseInt(o.toString(),10)]):t[parseInt(o.toString(),10)].format||"number"!==t[parseInt(o.toString(),10)].type||t[parseInt(o.toString(),10)].setParser(s.getParserFunction({format:"n2"})),"dateonly"!==t[parseInt(o.toString(),10)].type||t[parseInt(o.toString(),10)].format||(t[parseInt(o.toString(),10)].format="yMd",qp(this.locator,t[parseInt(o.toString(),10)]))}},va.prototype.dataManagerSuccess=function(m,y){var v=this,S=this.parent,e=(this.contentRenderer=this.renderer.getRenderer(oe.RenderType.Content),this.headerRenderer=this.renderer.getRenderer(oe.RenderType.Header),m.actionArgs=y,!(!S.childGrid&&!S.detailTemplate)),C=this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&!S.groupSettings.enableLazyLoading&&("delete"===y.requestType&&!e||"save"===y.requestType&&"add"===this.parent.infiniteScrollModule.requestType&&!(S.sortSettings.columns.length||S.filterSettings.columns.length||this.parent.groupSettings.columns.length||S.searchSettings.key||e));S.trigger(Ye,m,function(e){if(!e.cancel){e.result=H.isNullOrUndefined(e.result)?[]:e.result;var t=Object.keys(e.result).length;if(!v.parent.isDestroyed)if(S.getColumns().length||t||S.columns.length&&S.columns[0]instanceof Q){S.isRowSelectable&&(S.notify(is,n={e:e,isResetPartialRecords:!1}),!S.isInitialLoad||v.parent.isRemote()||"add"===y.action&&"save"===y.requestType||"batchsave"===y.requestType||n.isResetPartialRecords)&&(u=S.getDataModule().isRemote()||!H.isNullOrUndefined(S.dataSource)&&S.dataSource.result?e.result:S.getDataModule().dataManager.executeLocal(S.getDataModule().generateQuery(!0)),S.isTreeGrid&&!v.parent.isRemote()?v.resetPartialRecords():v.setPartialRecord(u));var i=S.getColumns().filter(function(e){return e.allowFormula});if(i.length)for(var n=S.getDataModule().dataManager.executeLocal(S.getDataModule().generateQuery(!0)),r=S.getPrimaryKeyFieldNames()[0],s=0,o=n;s<o.length;s++){var a=o[s];if(!H.isNullOrUndefined(a))for(var l=a[""+r],h=0,d=i;h<d.length;h++){var p=d[h],c=a[""+p.field];"string"==typeof c&&c.trim().startsWith("=")&&S.setCellFormula(l,p.field,c)}}if(S.isRowPinned&&(!S.isInitialLoad||S.getDataModule().isRemote()&&y.requestType&&-1!==["virtualscroll","infiniteScroll","grouping","paging","sorting","filtering"].indexOf(y.requestType))){for(var u=S.getDataModule().isRemote()||!H.isNullOrUndefined(S.dataSource)&&S.dataSource.result?e.result:S.dataSource,r=v.parent.getPrimaryKeyFieldNames()[0],g=0;g<u.length;g++){var f=u[parseInt(g.toString(),10)];!S.pinnedTopRowKeys[f[""+r]]&&S.isRowPinned(f)&&(S.pinnedTopRecords.push(f),S.pinnedTopRowKeys[u[parseInt(g.toString(),10)][""+r]]=!0)}S.getDataModule().pinnedData=new V.DataManager(S.pinnedTopRecords)}!v.parent.isReact||H.isNullOrUndefined(y)||"infiniteScroll"===y.requestType&&!v.parent.infiniteScrollSettings.enableCache||y.isFrozen?v.extendDataManagerSuccess(m,y,t,e,C):(n=["columnTemplate","rowTemplate","detailTemplate","captionTemplate","commandsTemplate","groupFooterTemplate","groupCaptionTemplate"],"infiniteScroll"===y.requestType&&v.parent.infiniteScrollSettings.enableCache&&(n=["columnTemplate","commandsTemplate"]),Zc(v.parent,n,function(){v.extendDataManagerSuccess(m,y,t,e,C)}))}else S.hideSpinner()}})},va.prototype.resetPartialRecords=function(){var e;this.parent.isRowSelectable&&(this.parent.isRemote()?(this.selectableDataKey={},this.nonselectableDataKey={},this.parent.partialSelectedIndexes=[],this.parent.partialSelectedRecords=[],this.parent.disableSelectedRecords=[]):(e=pu(this.parent),this.setPartialRecord(e)))},va.prototype.setPartialRecord=function(e){var t=this.parent.getPrimaryKeyFieldNames()[0],i=this.parent.allowGrouping&&!H.isNullOrUndefined(e.records)?e.records:e;if(this.parent.isRemote())for(var n=0;n<i.length;n++){var r=(this.parent.pageSettings.currentPage-1)*this.parent.pageSettings.pageSize,r=this.parent.allowPaging?parseInt(n.toString(),10):r+parseInt(n.toString(),10),s=i[parseInt(n.toString(),10)][""+t];this.parent.isRowSelectable(i[parseInt(n.toString(),10)],this.parent.columns)?Object.prototype.hasOwnProperty.call(this.selectableDataKey,s)||(this.parent.partialSelectedRecords.push(i[parseInt(n.toString(),10)]),this.parent.partialSelectedIndexes.push(r),this.selectableDataKey[i[parseInt(n.toString(),10)][""+t]]=!0):(this.parent.selectionModule.isPartialSelection=!0,Object.prototype.hasOwnProperty.call(this.nonselectableDataKey,s)||(this.parent.disableSelectedRecords.push(i[parseInt(n.toString(),10)]),this.nonselectableDataKey[i[parseInt(n.toString(),10)][""+t]]=!1))}else{var o=[],a=[],l=[];this.selectableDataKey={},this.nonselectableDataKey={};for(n=0;n<i.length;n++)this.parent.isRowSelectable(i[parseInt(n.toString(),10)],this.parent.columns)?(o.push(i[parseInt(n.toString(),10)]),l.push(parseInt(n.toString(),10)),this.selectableDataKey[i[parseInt(n.toString(),10)][""+t]]=!0):(this.parent.selectionModule.isPartialSelection=!0,a.push(i[parseInt(n.toString(),10)]),this.nonselectableDataKey[i[parseInt(n.toString(),10)][""+t]]=!1);this.parent.partialSelectedRecords=o,this.parent.disableSelectedRecords=a,this.parent.partialSelectedIndexes=l}},va.prototype.extendDataManagerSuccess=function(e,t,i,n,r){var s=this.parent;if(!i&&s.enableInfiniteScrolling&&t&&"infiniteScroll"===t.requestType&&(H.isNullOrUndefined(e.count)||e.count<=0)&&s.infiniteScrollSettings&&!0===s.infiniteScrollSettings.enableCountLessMode)this.parent.isLastRecordLoaded=!0,s.removeMaskRow(),s.hideSpinner(),this.parent.trigger(de,{}),this.parent.notify($r,t);else if(this.isInfiniteEnd(t)&&!i)this.parent.notify(Vn,{e:t,result:e.result,count:e.count,agg:e.aggregates});else if(this.parent.isEdit=!1,s.editSettings.showAddNewRow&&"delete"===t.requestType&&(s.editModule.destroyWidgets(),s.editModule.destroyForm()),this.parent.notify(Fn,{}),this.parent.notify(ai,{}),t&&("infiniteScroll"!==t.requestType&&"delete"!==t.requestType&&"add"!==t.action||!s.enableInfiniteScrolling)&&this.parent.notify(Vr,{type:"refreshCommandColumn"}),this.contentRenderer.prevCurrentView=!H.isNullOrUndefined(this.parent.currentViewData)&&this.parent.currentViewData.slice(),s.currentViewData=n.result,s.notify(pr,{args:t,data:n.result}),n.count&&!s.allowPaging&&(s.enableVirtualization||s.enableInfiniteScrolling)&&(s.totalDataRecordsCount=n.count),n.actual&&!H.isNullOrUndefined(n.actual.lazyLoadRecordsCount)&&this.parent.groupSettings.enableLazyLoading&&(s.totalDataRecordsCount=n.actual.lazyLoadRecordsCount),!i&&n.count&&s.allowPaging&&t&&"delete"!==t.requestType)!this.parent.groupSettings.enableLazyLoading||"grouping"!==t.requestType&&"ungrouping"!==t.requestType||this.parent.notify(kt,t),s.prevPageMoving=!0,s.pageSettings.totalRecordsCount=n.count,"paging"!==t.requestType&&(s.pageSettings.currentPage=Math.ceil(n.count/s.pageSettings.pageSize)),s.dataBind();else{(s.getColumns().length||!i)&&this.isLayoutRendered||tc(s)||(s.removeMaskRow(),this.updatesOnInitialRender(n)),!this.isColTypeDef&&s.getCurrentViewRecords()&&(this.data.dataManager.dataSource.offline&&s.dataSource&&s.dataSource.length?this.updateColumnType(s.dataSource[0]):this.updateColumnType(s.getCurrentViewRecords()[0])),this.parent.isInitialLoad||!this.parent.groupSettings.disablePageWiseAggregates||this.parent.groupSettings.columns.length||(n.result=this.parent.dataSource instanceof Array?this.parent.dataSource:this.parent.currentViewData),!this.parent.isReact&&!this.parent.isVue||H.isNullOrUndefined(t)||"infiniteScroll"===t.requestType||t.isFrozen||Zc(this.parent,["footerTemplate"]),this.parent.isAngular&&this.parent.allowGrouping&&this.parent.groupSettings.captionTemplate&&(H.isNullOrUndefined(t)||"infiniteScroll"!==t.requestType)&&this.parent.destroyTemplate(["groupSettings_captionTemplate"]);var o=H.extend({count:n.count,result:n.result,aggregates:n.aggregates,loadSummaryOnEmpty:!1},t);if(s.enableInfiniteScrolling&&s.infiniteScrollSettings&&s.infiniteScrollSettings.enableCountLessMode&&this.setCountLessModeData(o,n),this.parent.notify(yt,o),(s.groupSettings.columns.length||t&&"ungrouping"===t.requestType)&&t&&"filtering"!==t.requestType&&"sorting"!==t.requestType&&this.headerRenderer.refreshUI(),i)this.removeEmptyOverlay(),tc(s)&&(t.scrollTop={top:this.contentRenderer.content.scrollTop}),r?this.parent.notify(Vn,{e:t,result:e.result,count:e.count,agg:e.aggregates}):this.parent.enableImmutableMode?this.contentRenderer.immutableModeRendering(t):this.contentRenderer.refreshContentRows(t);else{if(t&&t.isCaptionCollapse)return;if(!s.getColumns().length)return s.element.innerHTML="",void alert(this.l10n.getConstant("EmptyDataSourceError"));this.contentRenderer.setRowElements([]),this.contentRenderer.setRowObjects([]),this.ariaService.setBusy(this.parent.getContent().querySelector("."+xs),!1),s.removeMaskRow(),this.renderEmptyRow(),s.enableColumnVirtualization&&!i&&this.parent.notify(vt,{rows:s.getRowsObject(),args:{}}),t&&(n=(t.requestType||"").toLowerCase()+"-complete",this.parent.notify(n,t),"batchsave"===t.requestType)&&(t.cancel=!1,t.rows=[],t.isFrozen=!t.isFrozen,this.parent.trigger(c,t)),this.parent.autoFit&&this.parent.preventAdjustColumns(),this.parent.hideSpinner()}this.parent.notify(ri,{}),this.parent.toolbarModule&&this.parent.toolbarModule.isVue3ToolbarTemplate()&&(this.parent.toolbarModule.toolbar.refresh(),this.parent.toolbarModule.renderSearchInput()),this.setRowCount(this.parent.getCurrentViewRecords().length),"query"in e&&(this.parent.getDataModule().isQueryInvokedFromData=!1)}},va.prototype.dataManagerFailure=function(e,t){H.isNullOrUndefined(this.parent.contentModule)||(this.ariaService.setOptions(this.parent.getContent().querySelector("."+xs),{busy:!1,invalid:!0}),this.setRowCount(1)),this.parent.trigger(ae,e&&e.error?e:{error:e}),this.parent.hideSpinner(),this.parent.removeMaskRow(),"save"!==t.requestType&&"delete"!==t.requestType&&"bulk-save"!==t.name&&(this.parent.currentViewData=[],this.renderEmptyRow(),!this.parent.isInitialLoad&&this.parent.focusModule&&this.parent.focusModule.setFirstFocusableTabIndex(),this.parent.log("actionfailure",{error:e}))},va.prototype.setRowCount=function(e){this.ariaService.setOptions(this.parent.element,{rowcount:e?e.toString():"1"})},va.prototype.isInfiniteEnd=function(e){return this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&"delete"===e.requestType},va.prototype.updatesOnInitialRender=function(e){var t=!(this.isLayoutRendered=!0);this.parent.columns.length<1&&(this.buildColumns(e.result[0]),t=!0),up(this.parent.columns,null,this.parent),t&&this.parent.notify(Wr,{}),this.headerRenderer.renderTable(),this.contentRenderer.renderTable(),this.parent.isAutoGen=!0,this.parent.notify(oi,{})},va.prototype.setCountLessModeData=function(e,t){var t=H.isNullOrUndefined(t.actual)?t:t.actual,i=t.pageInfo||{},n=t["@odata.nextLink"]||t.next||t.continuationToken||t.LastEvaluatedKey||t.next_page_token||i.endCursor||null;e.nextToken=n,"boolean"==typeof t.hasMore?e.hasMore=t.hasMore:"boolean"==typeof i.hasNextPage&&(e.hasMore=i.hasNextPage)},va.prototype.iterateComplexColumns=function(e,t,i){for(var n=Object.keys(e),r=0;r<n.length;r++)("object"!=typeof e[n[parseInt(r.toString(),10)]]||!e[n[parseInt(r.toString(),10)]]||e[n[parseInt(r.toString(),10)]]instanceof Date?[]:Object.keys(e[n[parseInt(r.toString(),10)]])).length?this.iterateComplexColumns(e[n[parseInt(r.toString(),10)]],t+(n[parseInt(r.toString(),10)]+"."),i):(i[this.counter]=t+n[parseInt(r.toString(),10)],this.counter++)},va.prototype.buildColumns=function(e){for(var t=[],i={},n=(this.iterateComplexColumns(e,"",i),Object.keys(i).filter(function(e){return"BlazId"!==i[""+e]}).map(function(e){return i[""+e]})),r=0,s=n.length;r<s;r++)t[parseInt(r.toString(),10)]={field:n[parseInt(r.toString(),10)]},this.parent.enableColumnVirtualization&&(t[parseInt(r.toString(),10)].width=H.isNullOrUndefined(t[parseInt(r.toString(),10)].width)?200:t[parseInt(r.toString(),10)].width);this.parent.setProperties({columns:t},!0)},va.prototype.instantiateRenderer=function(){this.renderer.addRenderer(oe.RenderType.Header,new mo(this.parent,this.locator)),this.renderer.addRenderer(oe.RenderType.Content,new fo(this.parent,this.locator));var e=this.locator.getService("cellRendererFactory");e.addCellRenderer(oe.CellType.Header,new Do(this.parent,this.locator)),e.addCellRenderer(oe.CellType.Data,new vo(this.parent,this.locator)),e.addCellRenderer(oe.CellType.StackedHeader,new Ao(this.parent,this.locator)),e.addCellRenderer(oe.CellType.Indent,new Po(this.parent,this.locator)),e.addCellRenderer(oe.CellType.GroupCaption,new zo(this.parent,this.locator)),e.addCellRenderer(oe.CellType.GroupCaptionEmpty,new Ho(this.parent,this.locator)),e.addCellRenderer(oe.CellType.Expand,new _o(this.parent,this.locator)),e.addCellRenderer(oe.CellType.HeaderIndent,new Xo(this.parent,this.locator)),e.addCellRenderer(oe.CellType.StackedHeader,new Ao(this.parent,this.locator)),e.addCellRenderer(oe.CellType.DetailHeader,new Jo(this.parent,this.locator)),e.addCellRenderer(oe.CellType.RowDragHIcon,new pa(this.parent,this.locator)),e.addCellRenderer(oe.CellType.DetailExpand,new na(this.parent,this.locator)),e.addCellRenderer(oe.CellType.DetailFooterIntent,new Po(this.parent,this.locator)),e.addCellRenderer(oe.CellType.RowDragIcon,new aa(this.parent,this.locator)),e.addCellRenderer(oe.CellType.PinnedIndent,new fa(this.parent,this.locator))},va.prototype.addEventListener=function(){var e=this;this.parent.isDestroyed||(this.parent.on(ft,this.instantiateRenderer,this),this.parent.on("refreshdataSource",this.dataManagerSuccess,this),this.parent.on(bt,this.refresh,this),this.parent.on(ti,this.refreshComplete,this),this.parent.on(si,this.sendBulkRequest,this),this.parent.on(Hi,function(){e.emptyGrid=!0},this),this.parent.on(oi,this.dynamicColumnChange,this))},va.prototype.validateGroupRecords=function(t){var n=this,r=t.result.length-1;if(r<0)return Promise.resolve(t);function e(e){for(var t=0===r?[s]:[s,o],i=0;i<t.length;i++)a.push(new V.Predicate("field","==",t[parseInt(i.toString(),10)].field).and(n.getPredicate("key","equal",t[parseInt(i.toString(),10)].key)));e.where(V.Predicate.or(a))}var s=t.result[0],o=t.result[parseInt(r.toString(),10)],a=[],i=new V.Query;e(i);var l=new V.DataManager(t.result).executeLocal(i),i=this.data.generateQuery(!0),h=[];if(this.data.isRemote()){for(var d=0===r?[s]:[s,o],p=0;p<d.length;p++)h.push(this.getPredicate(d[parseInt(p.toString(),10)].field,"equal",d[parseInt(p.toString(),10)].key));i.where(V.Predicate.or(h))}else e(i);var c=new V.Deferred;return this.data.getData({},i).then(function(e){n.updateGroupInfo(l,e.result),c.resolve(t)}).catch(function(e){return c.reject(e)}),c.promise},va.prototype.getPredicate=function(e,t,i){return i instanceof Date?ec({field:e,operator:t,value:i}):new V.Predicate(e,t,i)},va.prototype.updateGroupInfo=function(e,t){for(var i=new V.DataManager(t),n=e,r=0;r<n.length;r++){var s=i.executeLocal((new V.Query).where(new V.Predicate("field","==",n[parseInt(r.toString(),10)].field).and(this.getPredicate("key","equal",n[parseInt(r.toString(),10)].key))))[0];if(!H.isNullOrUndefined(s)){n[parseInt(r.toString(),10)].count=s.count;for(var o=n[parseInt(r.toString(),10)].items,a=s.items,l=(o.GroupGuid&&(n[parseInt(r.toString(),10)].items=this.updateGroupInfo(n[parseInt(r.toString(),10)].items,s.items)),this.parent.aggregates),h=0;h<l.length;h++)for(var d=l[parseInt(h.toString(),10)],p=0;p<d.columns.length;p++)for(var c=d.columns[parseInt(p.toString(),10)],u=c.type instanceof Array?c.type:[c.type],g=0;g<u.length;g++){var f,m,y=c.field+" - "+u[parseInt(g.toString(),10)].toLowerCase(),v=o.level?a.records:s.items,S=this.parent;"Custom"===u[parseInt(g.toString(),10)]?(f=o.level?a:s,"string"==typeof(m=c.customAggregate)&&(m=H.getValue(m,window)),n[parseInt(r.toString(),10)].aggregates[y]=m?m.call(S,f,d.columns[parseInt(p.toString(),10)]):""):n[parseInt(r.toString(),10)].aggregates[y]=V.DataUtil.aggregates[u[parseInt(g.toString(),10)].toLowerCase()](v,d.columns[parseInt(p.toString(),10)].field)}}}return e};var ya=va;function va(e,t){this.emptyGrid=!1,this.counter=0,this.selectableDataKey={},this.nonselectableDataKey={},this.isFirstColumnHidden=!1,this.parent=e,this.locator=t,this.data=new hs(e,t),this.l10n=t.getService("localization"),this.ariaService=this.locator.getService("ariaService"),this.renderer=this.locator.getService("rendererFactory"),this.addEventListener()}Ca.prototype.addCellRenderer=function(e,t){e="string"==typeof e?e:H.getEnumValue(oe.CellType,e),H.isNullOrUndefined(this.cellRenderMap[""+e])&&(this.cellRenderMap[""+e]=t)},Ca.prototype.getCellRenderer=function(e){if(e="string"==typeof e?e:H.getEnumValue(oe.CellType,e),H.isNullOrUndefined(this.cellRenderMap[""+e]))throw"The cellRenderer "+e+" is not found";return this.cellRenderMap[""+e]};var Sa=Ca;function Ca(){this.cellRenderMap={}}ba.prototype.addEventListener=function(){this.evtHandlers=[{event:ur,handler:this.closeCustomDialog},{event:gr,handler:this.refreshCustomFilterOkBtn},{event:mr,handler:this.renderResponsiveContextMenu},{event:yr,handler:this.renderCustomFilterDiv},{event:vr,handler:this.customExFilterClose},{event:fr,handler:this.refreshCustomFilterClearBtn}],Kc(this.parent,this.evtHandlers,!0,this),this.onActionCompleteFn=this.editComplate.bind(this),this.parent.addEventListener(c,this.onActionCompleteFn)},ba.prototype.customExFilterClose=function(){this.isCustomDlgRender=!1},ba.prototype.renderCustomFilterDiv=function(){var e,t;H.isNullOrUndefined(this.customResponsiveDlg)||(e=(t=this.customResponsiveDlg.element.querySelector(".e-dlg-header-content")).querySelector(".e-dlg-custom-header"),t=t.querySelector(".e-dlg-closeicon-btn"),this.isCustomDlgRender=!0,this.parent.filterModule.filterModule.closeDialog(),this.saveBtn.element.style.display="",this.refreshCustomFilterOkBtn({disabled:!1}),this.backBtn.element.style.display="none",t.style.display="",e.innerHTML=this.parent.localeObj.getConstant("CustomFilter"),t=this.customResponsiveDlg.element.querySelector(".e-dlg-content"),this.customExcelFilterParent=this.parent.createElement("div",{className:"e-xl-customfilterdiv e-default-filter"}),t.appendChild(this.customExcelFilterParent))},ba.prototype.renderResponsiveContextMenu=function(e){var t,i,n,r,s;this.action!==oe.ResponsiveDialogAction.isFilter||H.isNullOrUndefined(this.customResponsiveDlg)||(t=this.customResponsiveDlg.element.querySelector(".e-dlg-content"),i=(n=this.customResponsiveDlg.element.querySelector(".e-dlg-header-content")).querySelector(".e-dlg-closeicon-btn"),n=n.querySelector(".e-dlg-custom-header"),e.isOpen?(t.firstChild.style.display="none",t.appendChild(e.target),i.style.display="none",this.saveBtn.element.style.display="none",this.filterClearBtn.element.style.display="none",n.innerHTML=e.header,r=this.parent.createElement("button"),s=this.parent.createElement("span",{className:"e-btn-icon e-resfilterback e-icons"}),r.appendChild(s),this.backBtn=new M.Button({cssClass:this.parent.cssClass?"e-res-back-btn "+this.parent.cssClass:"e-res-back-btn"}),this.backBtn.appendTo(r),n.parentElement.insertBefore(r,n)):this.backBtn&&!this.isCustomDlgRender&&(t.firstChild.style.display="",H.remove(this.backBtn.element),i.style.display="",this.saveBtn.element.style.display="",this.isFiltered&&(this.filterClearBtn.element.style.display=""),n.innerHTML=this.getHeaderTitle({action:oe.ResponsiveDialogAction.isFilter},e.col)))},ba.prototype.refreshCustomFilterClearBtn=function(e){this.filterClearBtn&&(this.isFiltered=e.isFiltered,this.filterClearBtn.element.style.display=e.isFiltered?"":"none")},ba.prototype.refreshCustomFilterOkBtn=function(e){this.saveBtn&&(this.saveBtn.disabled=e.disabled),this.parent.columnChooserModule&&this.parent.columnChooserModule.responsiveDialogRenderer&&this.parent.columnChooserModule.responsiveDialogRenderer.saveBtn&&(this.parent.columnChooserModule.responsiveDialogRenderer.saveBtn.disabled=e.disabled)},ba.prototype.columnMenuResponsiveContent=function(e,t,i){i=this.parent.createElement("div",{className:"e-responsivecoldiv e-responsive"+e.toLowerCase()+"div"+(i?" e-disabled":"")}),e=this.parent.createElement("span",{className:"e-icons e-res"+e.toLowerCase()+"-icon e-btn-icon"}),t=this.parent.createElement("span",{innerHTML:t,className:"e-rescolumn-menu e-res-header-text"});i.appendChild(e),i.appendChild(t),this.customColumnDiv.appendChild(i)},ba.prototype.renderResponsiveContent=function(e,t){var i=this,n=this.parent,r=this.action===oe.ResponsiveDialogAction.isColumnChooser;if(e||r)return this.filterParent=this.parent.createElement("div",{className:(r?"e-maincolumnchooserdiv ":"")+"e-mainfilterdiv e-default-filter",id:(r?"columchooser":e.uid)+"-main-filter"}),this.filterParent;if(this.customColumnDiv=n.createElement("div",{className:"columndiv columnmenudiv"}),this.customColumnDiv.style.width="100%",this.parent.showColumnMenu&&"Horizontal"===this.parent.rowRenderingMode&&this.action===oe.ResponsiveDialogAction.isColMenu){if(this.columnMenuResponsiveContent("AutoFitAll",n.localeObj.getConstant("AutoFitAll")),this.columnMenuResponsiveContent("AutoFit",n.localeObj.getConstant("AutoFit")),t.allowGrouping&&n.allowGrouping&&(this.columnMenuResponsiveContent("Group",n.localeObj.getConstant("Group"),0<=n.groupSettings.columns.indexOf(t.field)),this.columnMenuResponsiveContent("UnGroup",n.localeObj.getConstant("Ungroup"),n.groupSettings.columns.indexOf(t.field)<0)),t.allowSorting&&n.allowSorting){for(var s="None",o=this.parent.sortSettings.columns,a=0;a<o.length;a++)if(o[parseInt(a.toString(),10)].field===t.field){s=o[parseInt(a.toString(),10)].direction;break}this.columnMenuResponsiveContent("ascending",n.localeObj.getConstant("SortAscending"),"Ascending"===s),this.columnMenuResponsiveContent("descending",n.localeObj.getConstant("SortDescending"),"Descending"===s)}n.showColumnChooser&&this.columnMenuResponsiveContent("Column",n.localeObj.getConstant("Columnchooser")),t.allowFiltering&&n.allowFiltering&&this.columnMenuResponsiveContent("Filter",n.localeObj.getConstant("FilterMenu"))}else{var l=n.getColumns(),h=n.createElement("div",{className:"e-ressortbutton-parent"}),d=[],p=this.action===oe.ResponsiveDialogAction.isSort,c=this.action===oe.ResponsiveDialogAction.isFilter;if(c)for(a=0;a<n.filterSettings.columns.length;a++)d.push(n.filterSettings.columns[parseInt(a.toString(),10)].field);for(var u,g,f,m,a=0;a<l.length;a++)!l[parseInt(a.toString(),10)].visible||!l[parseInt(a.toString(),10)].allowSorting&&p||!l[parseInt(a.toString(),10)].allowFiltering&&c||((u=n.createElement("div",{className:"e-responsivecoldiv"})).setAttribute("data-mappingname",l[parseInt(a.toString(),10)].field),u.setAttribute("data-mappinguid",l[parseInt(a.toString(),10)].uid),f=n.createElement("span",{innerHTML:l[parseInt(a.toString(),10)].headerText,className:"e-res-header-text"}),u.appendChild(f),this.customColumnDiv.appendChild(u),p&&(f=this.getSortedFieldsAndDirections("field").indexOf(l[parseInt(a.toString(),10)].field),g=n.createElement("button",{id:n.element.id+l[parseInt(a.toString(),10)].field+"sortbutton"}),(m=h.cloneNode()).appendChild(g),u.appendChild(m),m=void new M.Button({cssClass:this.parent.cssClass?"e-ressortbutton "+this.parent.cssClass:"e-ressortbutton"}).appendTo(g),H.isNullOrUndefined(this.parent.sortSettings.columns[parseInt(f.toString(),10)])||(m="Ascending"===this.parent.sortSettings.columns[parseInt(f.toString(),10)].direction?this.parent.localeObj.getConstant("AscendingText"):this.parent.localeObj.getConstant("DescendingText")),g.innerHTML=-1<f?m:this.parent.localeObj.getConstant("NoneText"),g.onclick=function(e){i.sortButtonClickHandler(e.target)}),c&&-1<d.indexOf(l[parseInt(a.toString(),10)].field)&&(f=n.createElement("div",{className:"e-icons e-res-icon e-filtersetdiv"}),(m=n.createElement("span",{className:"e-icons e-res-icon e-filterset"})).setAttribute("data-coltype",l[parseInt(a.toString(),10)].type),f.appendChild(m),u.appendChild(f)))}return H.EventHandler.add(this.customColumnDiv,H.Browser.isDevice?"touchend":"click",this.customFilterColumnClickHandler,this),this.customColumnDiv},ba.prototype.getSortedFieldsAndDirections=function(e){for(var t=[],i=0;i<this.parent.sortSettings.columns.length;i++)t.push(this.parent.sortSettings.columns[parseInt(i.toString(),10)][""+e]);return t},ba.prototype.sortButtonClickHandler=function(e){var t,i,n;e&&(t=I(e,"e-responsivecoldiv").getAttribute("data-mappingname"),this.parent.allowMultiSorting||(this.sortPredicate=[],this.sortedCols=[],this.isSortApplied=!1,this.resetSortButtons(e)),n=(i=(i=e.textContent)===this.parent.localeObj.getConstant("NoneText")?this.parent.localeObj.getConstant("AscendingText"):i===this.parent.localeObj.getConstant("AscendingText")?this.parent.localeObj.getConstant("DescendingText"):this.parent.localeObj.getConstant("NoneText"))===this.parent.localeObj.getConstant("AscendingText")?"Ascending":i===this.parent.localeObj.getConstant("DescendingText")?"Descending":"None",e.innerHTML=i,this.setSortedCols(t,n))},ba.prototype.resetSortButtons=function(e){for(var t=[].slice.call(this.customColumnDiv.getElementsByClassName("e-ressortbutton")),i=0;i<t.length;i++)t[parseInt(i.toString(),10)]!==e&&(t[parseInt(i.toString(),10)].innerHTML=this.parent.localeObj.getConstant("NoneText"))},ba.prototype.setSortedCols=function(e,t){var i=this.getCurrentSortedFields().indexOf(e);this.parent.allowMultiSorting&&-1<i&&(this.sortedCols.splice(i,1),this.sortPredicate.splice(i,1)),this.isSortApplied=!0,"None"!==t&&(this.sortedCols.push(e),this.sortPredicate.push({field:e,direction:t}))},ba.prototype.getCurrentSortedFields=function(){for(var e=[],t=0;t<this.sortedCols.length;t++)e.push(this.sortedCols[parseInt(t.toString(),10)]);return e},ba.prototype.customFilterColumnClickHandler=function(e){var t,i,n,r=this.parent,s=e.target;I(s,"columnmenudiv")&&this.action===oe.ResponsiveDialogAction.isColMenu&&!I(s,"e-disabled")&&(t=this.menuCol||this.filteredCol,I(s,"e-responsiveautofitalldiv")?(r.autoFitColumns([]),this.closeCustomFilter()):I(s,"e-responsiveautofitdiv")?(r.autoFitColumns(t.field),this.closeCustomFilter()):I(s,"e-responsivegroupdiv")?(r.groupColumn(t.field),this.closeCustomFilter()):I(s,"e-responsiveungroupdiv")?(r.ungroupColumn(t.field),this.closeCustomFilter()):I(s,"e-responsiveascendingdiv")?(r.sortColumn(t.field,"Ascending"),this.closeCustomFilter()):I(s,"e-responsivedescendingdiv")?(r.sortColumn(t.field,"Descending"),this.closeCustomFilter()):I(s,"e-responsivecolumndiv")?(r.notify(Qr,{action:5}),r.showResponsiveCustomColumnChooser()):I(s,"e-responsivefilterdiv")&&(r.notify(Qr,{action:3}),this.isRowResponsive=!0,this.isCustomDialog=!1,r.filterModule)&&r.filterModule.responsiveDialogRenderer.showResponsiveDialog(t),e.preventDefault()),this.action===oe.ResponsiveDialogAction.isFilter&&"FilterBar"!==r.filterSettings.type&&(s.classList.contains("e-responsivecoldiv")||s.parentElement.classList.contains("e-responsivecoldiv")?(i=(i=s.getAttribute("data-mappingname"))||s.parentElement.getAttribute("data-mappingname"))&&(n=r.getColumnByField(i),this.isRowResponsive=!0,this.showResponsiveDialog(n)):(s.classList.contains("e-filterset")||s.parentElement.classList.contains("e-filtersetdiv"))&&(t=I(s,"e-responsivecoldiv"))&&(i=t.getAttribute("data-mappingname"),"Menu"!==(n=r.getColumnByField(i)).filter.type&&(n.filter.type||"Menu"!==r.filterSettings.type)||(this.isDialogClose=!0),H.isNullOrUndefined(this.parent.filterModule.filterModule)?this.parent.filterModule.clearFiltering([i]):this.parent.filterModule.filterModule.clearCustomFilter(n),this.removeCustomDlgFilterEle(s)))},ba.prototype.showResponsiveDialog=function(e,t){if(this.isCustomDialog&&this.action===oe.ResponsiveDialogAction.isFilter&&!this.isRowResponsive||t&&this.action===oe.ResponsiveDialogAction.isColMenu)this.menuCol=t,this.renderCustomFilterDialog(null,t);else{if(this.filteredCol=e,this.renderResponsiveDialog(e),this.parent.enableAdaptiveUI&&e&&(this.parent.filterModule.setFilterModel(e),this.parent.filterModule.filterModule.openDialog(this.parent.filterModule.createOptions(e,void 0))),this.action===oe.ResponsiveDialogAction.isColumnChooser&&this.parent.notify(Xr,{action:"open"}),this.action===oe.ResponsiveDialogAction.isSort){t={cancel:!1,dialogObj:this.customResponsiveDlg,requestType:"beforeOpenAptiveSortDialog"};if(this.parent.trigger(Ze,t),t.cancel)return}this.customResponsiveDlg.show(!0),this.customResponsiveDlg.element.style.maxHeight="100%",this.setTopToChildDialog(this.customResponsiveDlg.element),this.parent.enableAdaptiveUI&&this.parent.filterSettings&&("CheckBox"===this.parent.filterSettings.type||"Excel"===this.parent.filterSettings.type)&&this.parent.filterSettings.enableInfiniteScrolling&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&this.action===oe.ResponsiveDialogAction.isFilter&&(e="CheckBox"===this.parent.filterSettings.type?this.parent.filterModule.filterModule.checkBoxBase:this.parent.filterModule.filterModule.excelFilterBase,H.isNullOrUndefined(e)||e.showMask())}},ba.prototype.setTopToChildDialog=function(e){var t=e.querySelector(".e-dialog");t&&(e=e.querySelector(".e-dlg-header-content").getBoundingClientRect().height,t.style.top=e+"px")},ba.prototype.renderCustomFilterDialog=function(e,t){var i,n=this.parent,r=this.action===oe.ResponsiveDialogAction.isColMenu;this.action===oe.ResponsiveDialogAction.isFilter&&"FilterBar"===n.filterSettings.type||(i=r?"e-customcolumnmenudiv ":"",n=this.parent.createElement("div",{id:n.element.id+(r?"customcolumnmenu":"customfilter"),className:this.parent.cssClass?i+"e-customfilterdiv e-responsive-dialog "+this.parent.cssClass:i+"e-customfilterdiv e-responsive-dialog"}),this.parent.element.appendChild(n),this.customFilterDlg=this.getDialogOptions(e,!0,null,t),r={cancel:!1,dialogObj:this.customFilterDlg,requestType:"beforeOpenAptiveFilterDialog"},this.parent.trigger(Ze,r),r.cancel)||(this.customFilterDlg.appendTo(n),this.customFilterDlg.show(!0),this.customFilterDlg.element.style.maxHeight="100%")},ba.prototype.getDialogOptions=function(e,t,i,n){n=new F.Dialog({isModal:!0,showCloseIcon:!("columnchooser"===i&&this.parent.columnChooserSettings.headerTemplate&&!this.parent.enableColumnVirtualization),closeOnEscape:!1,locale:this.parent.locale,target:this.parent.adaptiveDlgTarget||document.body,visible:!1,enableRtl:this.parent.enableRtl,content:this.renderResponsiveContent(e,n),open:this.dialogOpen.bind(this),created:this.dialogCreated.bind(this),close:this.beforeDialogClose.bind(this),width:"100%",height:"100%",animationSettings:{effect:"None"},cssClass:this.parent.cssClass||""});return n.isStringTemplate=!0,t?(n.header=this.renderResponsiveHeader(e,void 0,!0),t=this.action===oe.ResponsiveDialogAction.isColMenu?"e-customcolumnmenu ":"",n.cssClass=t+"e-customfilter"):(n.header=this.renderResponsiveHeader(e),n.cssClass="Vertical"===this.parent.rowRenderingMode&&this.action===oe.ResponsiveDialogAction.isFilter?"e-res"+i+" e-row-responsive-filter":"e-res"+i),n},ba.prototype.renderResponsiveDialog=function(e){var t,i,n=this.parent;this.action===oe.ResponsiveDialogAction.isFilter&&"FilterBar"===n.filterSettings.type||(t=this.action===oe.ResponsiveDialogAction.isFilter?"filter":"sort",t=this.action===oe.ResponsiveDialogAction.isColumnChooser?"columnchooser":t,i=this.parent.createElement("div",{id:n.element.id+"responsive"+t,className:this.parent.cssClass?"e-res"+t+"div e-responsive-dialog "+this.parent.cssClass:"e-res"+t+"div e-responsive-dialog"}),this.parent.element.appendChild(i),this.customResponsiveDlg=this.getDialogOptions(e,!1,t),Ec(n,this.customResponsiveDlg),this.customResponsiveDlg.appendTo(i))},ba.prototype.dialogCreated=function(){jc(this.parent)},ba.prototype.dialogOpen=function(){if(this.action===oe.ResponsiveDialogAction.isSort&&this.parent.allowMultiSorting)for(var e=0;e<this.parent.sortSettings.columns.length;e++){this.sortedCols.push(this.parent.sortSettings.columns[parseInt(e.toString(),10)].field);var t=this.parent.sortSettings.columns[parseInt(e.toString(),10)].field,i=this.parent.sortSettings.columns[parseInt(e.toString(),10)].direction;this.sortPredicate.push({field:t,direction:i})}},ba.prototype.beforeDialogClose=function(e){var t;this.isDialogClose=e.element&&!e.element.querySelector(".e-xl-customfilterdiv")&&e.element.classList.contains("e-resfilterdiv"),this.action===oe.ResponsiveDialogAction.isFilter?(e.element.classList.contains("e-resfilterdiv")?this.parent.filterModule.filterModule.closeResponsiveDialog(this.isCustomDlgRender):e.element.classList.contains("e-customfilterdiv")&&this.closeCustomFilter(),"Horizontal"===this.parent.rowRenderingMode&&this.parent.showColumnMenu&&(this.parent.notify(Qr,{action:4}),t=document.querySelector(".e-resfilter"))&&H.remove(t)):this.action===oe.ResponsiveDialogAction.isSort?this.closeCustomDialog():this.action===oe.ResponsiveDialogAction.isColMenu?(this.closeCustomFilter(),(t=document.querySelector(".e-rescolummenu"))&&H.remove(t)):this.action===oe.ResponsiveDialogAction.isColumnChooser&&(this.parent.notify(Xr,{action:"clear"}),(t=document.querySelector(".e-rescolumnchooser"))&&H.remove(t),"Horizontal"===this.parent.rowRenderingMode&&this.parent.showColumnMenu&&this.parent.notify(Qr,{action:4}),this.isCustomDialog=!1,this.isDialogClose=!1),this.parent.off(br,this.keyHandler)},ba.prototype.sortColumn=function(){if(this.isSortApplied){this.sortPredicate.length&&this.parent.setProperties({sortSettings:{columns:[]}},!0);for(var e=0;e<this.sortPredicate.length;e++)this.parent.sortColumn(this.sortPredicate[parseInt(e.toString(),10)].field,this.sortPredicate[parseInt(e.toString(),10)].direction,this.parent.allowMultiSorting);this.sortPredicate.length||this.parent.clearSorting()}this.closeCustomDialog()},ba.prototype.getHeaderTitle=function(e,t){var i,n=this.parent;return this.action===oe.ResponsiveDialogAction.isEdit?i=n.localeObj.getConstant("EditFormTitle")+e.primaryKeyValue[0]:this.action===oe.ResponsiveDialogAction.isAdd?i=n.localeObj.getConstant("AddFormTitle"):this.action===oe.ResponsiveDialogAction.isFilter?i=t?t.headerText||t.field:n.localeObj.getConstant("FilterTitle"):this.action===oe.ResponsiveDialogAction.isSort?i=n.localeObj.getConstant("Sort"):this.action===oe.ResponsiveDialogAction.isColMenu?i=n.localeObj.getConstant("ColumnMenu"):this.action===oe.ResponsiveDialogAction.isColumnChooser&&(i=n.localeObj.getConstant("ChooseColumns")),i},ba.prototype.getDialogName=function(e){var t;return e===oe.ResponsiveDialogAction.isAdd||e===oe.ResponsiveDialogAction.isEdit?t="dialogEdit_wrapper_title":e===oe.ResponsiveDialogAction.isFilter?t="responsive_filter_dialog_wrapper":e===oe.ResponsiveDialogAction.isColumnChooser&&(t="responsive_column_chooser_dialog_wrapper"),t},ba.prototype.getButtonText=function(e){var t;return e===oe.ResponsiveDialogAction.isAdd||e===oe.ResponsiveDialogAction.isEdit?t="Save":e!==oe.ResponsiveDialogAction.isFilter&&this.action!==oe.ResponsiveDialogAction.isSort&&e!==oe.ResponsiveDialogAction.isColumnChooser&&this.action!==oe.ResponsiveDialogAction.isColumnChooser||(t="OKButton"),t},ba.prototype.renderResponsiveHeader=function(e,t,i){var n,r,s=this,o=this.parent,a=(o.on(br,this.keyHandler,this),o.element.id+this.getDialogName(this.action));return this.parent.columnChooserSettings.headerTemplate&&!this.parent.enableColumnVirtualization&&this.getHeaderTitle(t,e)===o.localeObj.getConstant("ChooseColumns")?this.parent.columnChooserModule.renderHeader():(n=o.createElement("div",{className:"e-res-custom-element"}),(a=o.createElement("div",{className:"e-dlg-custom-header",id:a})).innerHTML=this.getHeaderTitle(t,e),n.appendChild(a),t=o.createElement("button"),i||(this.saveBtn=new M.Button({cssClass:this.parent.cssClass?"e-primary e-flat e-res-apply-btn "+this.parent.cssClass:"e-primary e-flat e-res-apply-btn"}),t.innerHTML=o.localeObj.getConstant(this.getButtonText(this.action)),this.saveBtn.appendTo(t),t.onclick=function(e){s.dialogHdrBtnClickHandler()}),e=this.action===oe.ResponsiveDialogAction.isSort,((r=this.action===oe.ResponsiveDialogAction.isFilter)||e)&&(a=e?"sort":"filter",e=o.createElement("button"),this.filterClearBtn=new M.Button({cssClass:this.parent.cssClass?"e-primary e-flat e-res-"+a+"-clear-btn "+this.parent.cssClass:"e-primary e-flat e-res-"+a+"-clear-btn"}),r?(a=o.createElement("span",{className:"e-btn-icon e-icon-filter-clear e-icons"}),e.appendChild(a)):e.innerHTML=o.localeObj.getConstant("Clear"),n.appendChild(e),this.filterClearBtn.appendTo(e),e.onclick=function(e){I(e.target,"e-customfilter")?(s.parent.filterModule.clearFiltering(),s.removeCustomDlgFilterEle()):r?s.filterClear():(s.resetSortButtons(),s.sortedCols=[],s.sortPredicate=[],s.isSortApplied=!0)},n.appendChild(e)),i||n.appendChild(t),n)},ba.prototype.filterClear=function(){this.parent.filterModule.filterModule.clearCustomFilter(this.filteredCol),this.parent.filterModule.filterModule.closeResponsiveDialog()},ba.prototype.removeCustomFilterElement=function(){var e=document.getElementById(this.parent.element.id+"customcolumnmenu"),e=(e&&(H.remove(e),e=document.querySelector(".e-customfilter"))&&H.remove(e),document.querySelector(".e-rescolumnchooser"));e&&H.remove(e)},ba.prototype.hideResponsiveColumnChooser=function(){var e=document.querySelector(".e-rescolumnchooser");e&&(H.remove(e),this.isCustomDialog=!1,this.isDialogClose=!1)},ba.prototype.dialogHdrBtnClickHandler=function(){this.action===oe.ResponsiveDialogAction.isEdit||this.action===oe.ResponsiveDialogAction.isAdd?this.parent.endEdit():this.action===oe.ResponsiveDialogAction.isFilter?(this.parent.filterModule.filterModule.applyCustomFilter({col:this.filteredCol,isCustomFilter:this.isCustomDlgRender}),this.removeCustomFilterElement()):this.action===oe.ResponsiveDialogAction.isSort?(this.sortColumn(),this.removeCustomFilterElement()):this.action===oe.ResponsiveDialogAction.isColumnChooser&&(this.parent.notify(Xr,{action:"confirm"}),this.removeCustomFilterElement(),this.isCustomDialog=!1,this.isDialogClose=!1)},ba.prototype.closeCustomDialog=function(){var e;this.isCustomDlgRender?(e=this.customResponsiveDlg.element.querySelector(".e-mainfilterdiv"),H.remove(e)):(this.isRowResponsive=!1,this.isCustomDlgRender=!1,this.destroyCustomFilterDialog())},ba.prototype.destroyCustomFilterDialog=function(){var e;this.customResponsiveDlg&&(e=document.getElementById(this.customResponsiveDlg.element.id),this.customResponsiveDlg&&!this.customResponsiveDlg.isDestroyed&&e&&(this.customResponsiveDlg.destroy(),H.remove(e)),this.closeCustomFilter(),this.action===oe.ResponsiveDialogAction.isSort)&&(this.sortPredicate=[],this.sortedCols=[],this.isSortApplied=!1)},ba.prototype.closeCustomFilter=function(){var e;!this.isDialogClose&&this.customFilterDlg&&(e=document.getElementById(this.customFilterDlg.element.id),this.customFilterDlg)&&!this.customFilterDlg.isDestroyed&&e&&(this.customFilterDlg.destroy(),H.remove(e)),this.isCustomDialog=!1,this.isDialogClose=!1},ba.prototype.removeCustomDlgFilterEle=function(e){if(e)e.parentElement.classList.contains("e-filtersetdiv")?H.remove(e.parentElement):H.remove(e);else for(var t=this.customColumnDiv.children,i=0;i<t.length;i++)(e=t[parseInt(i.toString(),10)].querySelector(".e-filtersetdiv"))&&(H.remove(e),i--)},ba.prototype.keyHandler=function(e){13===e.keyCode&&(this.action===oe.ResponsiveDialogAction.isFilter&&e.target.classList.contains("e-searchinput")||this.action===oe.ResponsiveDialogAction.isEdit||this.action===oe.ResponsiveDialogAction.isAdd)&&this.dialogHdrBtnClickHandler()},ba.prototype.editComplate=function(e){"save"!==e.requestType&&"cancel"!==e.requestType||this.parent.off(br,this.keyHandler)},ba.prototype.removeEventListener=function(){this.customColumnDiv&&H.EventHandler.remove(this.customColumnDiv,H.Browser.isDevice?"touchend":"click",this.customFilterColumnClickHandler),Kc(this.parent,this.evtHandlers,!0,this),this.parent.removeEventListener(c,this.onActionCompleteFn)};var wa=ba;function ba(e,t){this.sortedCols=[],this.sortPredicate=[],this.isCustomDialog=!1,this.parent=e,this.serviceLocator=t,this.addEventListener()}Ra.prototype.register=function(e,t){H.isNullOrUndefined(this.services[""+e])&&(this.services[""+e]=t)},Ra.prototype.getService=function(e){if(H.isNullOrUndefined(this.services[""+e]))throw"The service "+e+" is not registered";return this.services[""+e]},Ra.prototype.registerAdaptiveService=function(e,t,i){t?(e.responsiveDialogRenderer=new wa(e.parent,e.serviceLocator),e.responsiveDialogRenderer.action=i):e.responsiveDialogRenderer&&(e.responsiveDialogRenderer.removeEventListener(),e.responsiveDialogRenderer=void 0)};var Ia=Ra;function Ra(){this.services={}}Da.prototype.addRenderer=function(e,t){e=H.getEnumValue(oe.RenderType,e);H.isNullOrUndefined(this.rendererMap[""+e])&&(this.rendererMap[""+e]=t)},Da.prototype.getRenderer=function(e){e=H.getEnumValue(oe.RenderType,e);if(H.isNullOrUndefined(this.rendererMap[""+e]))throw"The renderer "+e+" is not found";return this.rendererMap[""+e]};var xa=Da;function Da(){this.rendererMap={}}Ea.prototype.setWidthToColumns=function(){var e,t=0,i=this.parent.getColumnIndexesInView(),n=!0;if(this.parent.allowGrouping)for(var r=this.parent.groupSettings.columns.length;t<r;t++)this.parent.enableColumnVirtualization&&-1===i.indexOf(t)?n=!1:this.setColumnWidth(new Q({width:"30px"}),t);(this.parent.detailTemplate||this.parent.childGrid)&&(this.setColumnWidth(new Q({width:"30px"}),t),t++),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&(this.setColumnWidth(new Q({width:"30px"}),t),t++);for(var s,o,a,l=this.parent.getColumns(),h=0;h<l.length;h++)this.setColumnWidth(l[parseInt(h.toString(),10)],n&&this.parent.enableColumnVirtualization?void 0:h+t);this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&this.setColumnWidth(new Q({width:"30px"}),this.parent.groupSettings.columns.length+l.length),"auto"!==(e=this.getTableWidth(this.parent.getColumns()))&&("auto"!==this.parent.width&&-1===this.parent.width.toString().indexOf("%")&&this.setMinwidthBycalculation(e),s=l.filter(function(e){return!H.isNullOrUndefined(e.maxWidth)}),o=this.parent.getHeaderTable(),a=this.parent.getContentTable(),this.parent.allowResizing)&&this.parent.element.getBoundingClientRect().width>e&&s.length===l.length&&o&&a&&H.addClass([o,a],["e-tableborder"])},Ea.prototype.setMinwidthBycalculation=function(e){var t=this,i=0,n=this.parent.getColumns().filter(function(e){return t.parent.allowResizing?(H.isNullOrUndefined(e.width)||"auto"===e.width)&&H.isNullOrUndefined(e.maxWidth):H.isNullOrUndefined(e.width)||"auto"===e.width});if(n.length){for(var i=H.isNullOrUndefined(this.parent.width)||"auto"===this.parent.width||"string"!=typeof this.parent.width||-1!==this.parent.width.indexOf("%")?this.parent.element.getBoundingClientRect().width-e:parseInt(this.parent.width,10)-e,r=0,s=0,o=0,a=n;o<a.length;o++){var l=a[o];H.isNullOrUndefined(l.minWidth)||(s++,r+="string"==typeof l.minWidth?parseInt(l.minWidth,10):l.minWidth)}var h,d=0;0!==e&&r<i&&0<r&&0<s&&(h=Op(),d=Math.floor((i-r-h)/s)-1);for(var p=0;p<n.length;p++){0===e&&this.parent.allowResizing&&this.isWidthUndefined()&&p!==n.length-1&&this.setUndefinedColumnWidth(n);var c=this.parent.getColumnIndexByField(n[parseInt(p.toString(),10)].field)+this.parent.getIndentCount(),u=n[parseInt(p.toString(),10)];0!==e&&i<r?this.setWidth(u.minWidth,c):0!==e&&r<i&&(0<s&&!H.isNullOrUndefined(u.minWidth)?(u="string"==typeof u.minWidth?parseInt(u.minWidth,10):u.minWidth,this.setWidth(u+d,c)):this.setWidth("",c,!0))}}},Ea.prototype.setUndefinedColumnWidth=function(e){for(var t=0;t<e.length;t++)t!==e.length-1&&(e[parseInt(t.toString(),10)].width=200,this.setWidth(200,this.parent.getColumnIndexByField(e[parseInt(t.toString(),10)].field)))},Ea.prototype.setColumnWidth=function(e,t,i){var n,r,s;this.parent.getColumns().length<1||(t=H.isNullOrUndefined(t)?this.parent.getNormalizedColumnIndex(e.uid):t,n=this.getWidth(e),r=this.getTableWidth(this.parent.getColumns()),null!==n&&(this.setWidth(n,t),"auto"!==this.parent.width&&-1===this.parent.width.toString().indexOf("%")&&"auto"!==r&&this.setMinwidthBycalculation(r),this.parent.allowResizing&&("resize"===i||this.parent.getFrozenColumns())&&(s=this.parent.getContentTable(),this.setWidthToTable(this.parent.getFrozenColumns()&&-1===s.style.width.indexOf("px")&&r<s.clientWidth)),this.parent.notify(Qt,{index:t,width:n,column:e,module:i})))},Ea.prototype.setWidth=function(e,t,i){!(this.parent.groupSettings.columns.length>t&&bc(this.parent))||this.parent.resizeModule&&this.parent.resizeModule.resizeProcess||(e=(30/this.parent.element.offsetWidth*100).toFixed(1)+"%");var n=this.parent.getHeaderTable(),r=this.parent.getContentTable(),e=H.formatUnit(e),n=n.querySelector(qs).children[parseInt(t.toString(),10)],n=(n&&!i?n.style.width=e:n&&i&&(n.style.width=""),r.querySelector(qs).children[parseInt(t.toString(),10)]);if(n&&!i?n.style.width=e:n&&i&&(n.style.width=""),!this.parent.enableColumnVirtualization&&this.parent.isEdit){for(var s=this.parent.element.querySelectorAll(".e-table.e-inline-edit"),o=[],a=0;a<s.length;a++)if(I(s[parseInt(a.toString(),10)],"e-grid").id===this.parent.element.id)for(var l=0;l<s[parseInt(a.toString(),10)].querySelector("colgroup").children.length;l++)o.push(s[parseInt(a.toString(),10)].querySelector("colgroup").children[parseInt(l.toString(),10)]);s.length&&o.length&&o[parseInt(t.toString(),10)]&&(o[parseInt(t.toString(),10)].style.width=e)}this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.refreshFrozenScrollbar()},Ea.prototype.refreshFrozenScrollbar=function(){var e,t,i,n={cancel:!1};this.parent.notify(hr,n),n.cancel||(n=Op(),e=this.parent.element.querySelector(".e-movablescrollbar"),t=this.parent.getContent().firstElementChild.getBoundingClientRect().width,this.parent.enableColumnVirtualization&&(i=this.parent.getContent().querySelector(".e-virtualtrack"))&&(t=i.scrollWidth),"auto"!==this.parent.height&&(t+=n),e.firstElementChild.style.width=t+"px")},Ea.prototype.getSiblingsHeight=function(e){return this.getHeightFromDirection(e,"previous")+this.getHeightFromDirection(e,"next")},Ea.prototype.getHeightFromDirection=function(e,t){for(var i=e[t+"ElementSibling"],n=0,r=[ms,Ss,"e-groupdroparea","e-gridpager","e-toolbar","e-temp-toolbar"];i;)r.some(function(e){return i.classList.contains(e)})&&(n+=i.offsetHeight),i=i[t+"ElementSibling"];return n},Ea.prototype.isWidthUndefined=function(){var e=this.parent.getColumns().filter(function(e){return H.isNullOrUndefined(e.width)&&H.isNullOrUndefined(e.minWidth)}).length;return this.parent.getColumns().length===e},Ea.prototype.getWidth=function(e){var t;return this.parent.allowResizing&&H.isNullOrUndefined(e.width)&&(H.isNullOrUndefined(e.minWidth)&&H.isNullOrUndefined(e.maxWidth)&&!this.isWidthUndefined()?e.width=200:e.maxWidth&&(e.width=e.maxWidth)),e.width?(t=parseInt(e.width.toString(),10),!H.isNullOrUndefined(e.minWidth)&&t<parseInt(e.minWidth.toString(),10)?e.minWidth:!H.isNullOrUndefined(e.maxWidth)&&t>parseInt(e.maxWidth.toString(),10)?e.maxWidth:e.width):null},Ea.prototype.getTableWidth=function(e,t){for(var i=0,n=!1,r=0,s=e;r<s.length;r++){var o,a=s[r];!1!==a.visible&&(o=this.getWidth(a),"auto"!==a.width&&a.width||(this.parent.allowResizing&&!t?a.maxWidth||(n=!0):o=0),null!==o)&&(i+=parseInt(o.toString(),10))}return i=n?"auto":i},Ea.prototype.setWidthToTable=function(e){var t=H.formatUnit(this.getTableWidth(this.parent.getColumns())),e=((this.parent.detailTemplate||this.parent.childGrid)&&this.setColumnWidth(new Q({width:"30px"})),t=this.isAutoResize()||"auto"===t||e?"100%":t,this.parent.getHeaderTable().style.width=t,this.parent.getContentTable().style.width=t,this.parent.element.querySelector(".e-table.e-inline-edit"));e&&(e.style.width=t)},Ea.prototype.isAutoResize=function(){return this.parent.allowResizing&&"Auto"===this.parent.resizeSettings.mode};var Ta=Ea;function Ea(e){this.parent=e}Oa=function(e,t){return(Oa=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Oa,t=function(e,t){function i(){this.constructor=e}Oa(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Aa=(n.prototype.focusCheck=function(e){e=e.target;this.focusByClick=!0,this.firstHeaderCellClick=!0,this.skipFocus=e.classList.contains("e-grid")},n.prototype.focusIn=function(e){this.parent.enableHeaderFocus||this.focusByClick||!H.closest(e.target,".e-filterbarcell")&&!H.closest(e.target,".e-checkselectall")||(e=this.parent.element.querySelector(".e-rowcell:not(.e-hide)"))&&e.focus()},n.prototype.onFocus=function(e){var t;this.parent.isDestroyed||H.Browser.isDevice||this.parent.enableVirtualization||this.parent.element.querySelector(".e-masked-table")||!this.parent.isInitialLoad&&e&&e.target===this.parent.element&&this.parent.element.querySelector(".e-spin-show")||(this.setActive(this.parent.enableHeaderFocus&&0===this.parent.frozenRows),this.parent.enableHeaderFocus&&!this.parent.getCurrentViewRecords().length&&("Batch"!==this.parent.editSettings.mode||"Batch"===this.parent.editSettings.mode&&this.parent.editModule&&!this.parent.editModule.getBatchChanges()[ks].length)&&this.getContent().matrix.generate(this.rowModelGen.generateRows({rows:[new ds({isDataRow:!0})]}),this.getContent().selector,!1),t=this.getContent().matrix.get(0,-1,[0,1],null,this.getContent().validator(),this.active),this.getContent().matrix.select(t[0],t[1]),!this.skipFocus)||e&&e.target===this.parent.element||(this.focus(e),this.skipFocus=!1)},n.prototype.passiveFocus=function(e){var t,i,n;this.parent.isDestroyed||(n=this.parent.getHeaderContent().querySelector(".e-headercell:not(.e-hide)"),t=(t=(t=this.parent.getContentTable().querySelector("tr:last-child"))&&Array.from(t.querySelectorAll(".e-rowcell:not(.e-hide)")))&&t[t.length-1],i=H.closest(e.target,".e-templatecell"),e.target!==n||!e.relatedTarget||I(e.relatedTarget,"e-grid")||this.firstHeaderCellClick||(0===this.active.matrix.matrix[(n=[0,0])[0]][n[1]]&&(n=au(this.active.matrix.matrix,n,!0)),this.active.matrix.current=n,this.currentInfo.element=e.target,this.currentInfo.elementToFocus=e.target,this.currentInfo.element.querySelector(".e-checkselectall")?(this.removeFocus(),this.addFocus(this.getContent().getFocusInfo(),e)):H.addClass([this.currentInfo.element],["e-focused","e-focus"])),(e.target===t||i&&i===t)&&e.relatedTarget&&!I(e.relatedTarget,"e-grid")&&!this.firstHeaderCellClick&&(this.setActive(!0),this.setLastContentCellActive(),this.currentInfo.element=t,this.currentInfo.elementToFocus=t,i&&i.focus(),H.addClass([this.currentInfo.element],["e-focused","e-focus"])),this.firstHeaderCellClick=!1,e.target&&e.target.classList.contains("e-detailcell")&&!H.isNullOrUndefined(this.currentInfo.element)&&(this.currentInfo.skipAction=!1,H.addClass([this.currentInfo.element],["e-focused","e-focus"])))},n.prototype.onBlur=function(e){this.parent.allowPaging&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer")&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer").removeAttribute("aria-hidden");var t=this.parent.getContentTable().querySelector("tr:last-child"),t=t&&t.lastElementChild===e.target,t=!(!e||this.parent.isEdit||"tab"!==this.focusKey||!H.closest(e.target,".e-gridpager")&&!t||!H.isNullOrUndefined(e.relatedTarget)||!H.closest(e.target,".e-grid")||H.closest(document.activeElement,".e-grid")),i=(this.focusKey="",!(!I(e.target,"e-gantt")||!e.target.classList.contains("e-rowcell")||H.isNullOrUndefined(e.target.nextElementSibling)||!e.target.nextElementSibling.classList.contains("e-rowcell")));(!this.parent.isEdit&&(!e||e.relatedTarget&&!H.closest(e.relatedTarget,".e-grid")&&!H.closest(e.relatedTarget,".e-grid-popup")||this.parent.element.classList.contains("e-childgrid")&&!this.parent.element.matches(":focus-within"))||!i&&H.isNullOrUndefined(e.relatedTarget)&&parseInt(e.target.getAttribute("aria-colindex"),10)-1==0&&0===parseInt(e.target.getAttribute("data-index"),10)||!i&&H.isNullOrUndefined(e.relatedTarget)&&!H.closest(document.activeElement,".e-grid")&&!H.isNullOrUndefined(e.sourceCapabilities)||t)&&(this.removeFocus(),this.skipFocus=!0,this.currentInfo.skipAction=!1,this.setLastContentCellTabIndex(),this.setFirstFocusableTabIndex(),this.firstHeaderCellClick=!1)},n.prototype.setFirstFocusableTabIndex=function(){var e=this.parent;if(e.element.tabIndex=-1,e.allowGrouping&&e.groupSettings.showDropArea)0<(t=(i=e.groupModule).getFocusableGroupedItems()).length?(i.element.tabIndex=-1,t[0].tabIndex=0):i.element.tabIndex=0;else{if(e.toolbar||e.toolbarTemplate){var t=e.toolbarModule.element,i=this.parent.toolbarModule.getFocusableToolbarItems();if(0<i.length&&i[0].querySelector(".e-toolbar-item-focus,.e-btn,.e-input"))return t.tabIndex=-1,void(i[0].querySelector(".e-toolbar-item-focus,.e-btn,.e-input").tabIndex=0);if(e.toolbarTemplate)return void(t.tabIndex=0)}e.getColumns().length&&(this.parent.enableHeaderFocus?(e.getHeaderContent().querySelector(".e-headercell:not(.e-hide)").tabIndex=0,this.setActive(!1),H.isNullOrUndefined(this.active)||!H.isNullOrUndefined(this.active.target)&&this.active.target.classList.contains("e-columnmenu")||(0===this.active.matrix.matrix[(i=[0,0])[0]][i[1]]&&(i=au(this.active.matrix.matrix,i,!0)),this.active.matrix.current=i)):((t=e.element.querySelector(".e-rowcell:not(.e-hide)"))&&(t.tabIndex=0),0<e.frozenRows||0<e.pinnedTopRowModels.length?(this.setActive(!1),this.active.matrix.current=e.element.querySelector(".e-filterbarcell")?[2,0]:[1,0]):(this.setActive(!0),this.active.matrix.current=[0,0])))}},n.prototype.setLastContentCellTabIndex=function(){var e=this.parent.getContentTable();e.rows[e.rows.length-1]&&(e=e.rows[e.rows.length-1].lastElementChild,H.isNullOrUndefined(e)||(e.tabIndex=0))},n.prototype.onClick=function(e,t,i){var n,r;I(e.target,"e-filterbarcell")&&(I(e.target,"e-multiselect")||e.target.classList.contains("e-input-group-icon"))||(r=!H.isNullOrUndefined(H.closest(e.target,"."+vs)),n=!H.isNullOrUndefined(H.closest(e.target,"."+ms)),!(r=r&&n?!r:r)&&H.isNullOrUndefined(H.closest(e.target,"."+ms)))||e.target.classList.contains(xs)||e.target.classList.contains(Cs)||!H.isNullOrUndefined(H.closest(e.target,".e-unboundcell"))&&!t||(this.setActive(r),n={cancel:!1,byKey:!1,byClick:!H.isNullOrUndefined(e.target),clickArgs:e},this.parent.notify(Vt,n),n.cancel)||H.closest(e.target,".e-inline-edit")&&!this.parent.editSettings.showAddNewRow&&this.parent.editSettings.showAddNewRow&&!this.parent.element.querySelector(".e-editedrow")||(this.setActive(r),this.getContent()&&!1!==this.getContent().onClick(e,t)&&(this.focus(),!this.currentInfo.element.classList.contains("e-rowcell")||!e.type||"click"!==e.type||i||this.parent.isEdit&&this.parent.editModule&&this.parent.editModule.editModule.cellDetails&&this.parent.editModule.editModule.cellDetails.column&&this.parent.editModule.editModule.cellDetails.column.allowFormula||H.addClass([this.currentInfo.element],["e-focused","e-focus"]),i)&&e&&e.target&&H.addClass([e.target],["e-focused","e-focus"]))},n.prototype.handleFilterNavigation=function(e,t,i){e.target===document.querySelector(t)&&"Tab"===e.key&&e.shiftKey?(e.preventDefault(),document.querySelector(i).focus()):e.target!==document.querySelector(i)||"Tab"!==e.key||e.shiftKey||document.activeElement!==document.querySelector(i)||(e.preventDefault(),document.querySelector(t).focus())},n.prototype.onKeyPress=function(e){if(this.focusKey=e.action,this.content&&this.content.target&&(this.content.target=null),this.parent.allowPaging){var t=this.parent.pagerModule.pagerObj.element,t=this.parent.pagerModule.pagerObj.getFocusablePagerElements(t,[]);if(this.parent.childGrid&&!I(e.target,"e-gridpager")&&this.allowToPaging(e)&&t.length&&(t[0].tabIndex=0),this.parent.pagerModule.pagerObj.checkPagerHasFocus()){if("shiftTab"===e.action&&t.length&&t[0]===e.target)return this.setActive(!0),a=[this.active.matrix.matrix.length-1,this.active.matrix.matrix[this.active.matrix.matrix.length-1].length-1],0===this.active.matrix.matrix[a[0]][a[1]]&&(a=au(this.active.matrix.matrix,a,!1)),this.active.matrix.current="Batch"!==this.parent.editSettings.mode||this.isValidBatchEditCell(a)?a:this.findBatchEditCell(a,!1),e.preventDefault(),void this.focus(e);if("tab"!==e.action||!this.parent.element.classList.contains("e-childgrid")||(this.parent.pageSettings.pageSizes||!t.length||t[t.length-1]!==e.target)&&this.parent.pagerModule.pagerObj.getDropDownPage()!==e.target)return void this.parent.pagerModule.pagerObj.changePagerFocus(e);t=I(this.parent.element,"e-detailcell");H.removeClass([this.parent.element],["e-focus"]),H.removeClass([t],["e-focused"]),t.tabIndex=-1}if(0===this.parent.pagerModule.pagerObj.element.tabIndex&&(38===e.keyCode||e.shiftKey&&9===e.keyCode))return e.preventDefault(),void this.focus(e);if(0===this.parent.pagerModule.pagerObj.element.tabIndex&&9===e.keyCode)return e.preventDefault(),void this.parent.pagerModule.pagerObj.setPagerFocus();this.parent.pagerModule.pagerObj.checkFirstPagerFocus()&&(t=this.getContent().matrix.rows,i=this.getContent().matrix.columns,this.getContent().matrix.current=[t,i])}if("Excel"===this.parent.filterSettings.type&&("Immediate"===this.parent.filterSettings.mode?this.handleFilterNavigation(e,".e-excelfilter .e-menu-item:not(.e-disabled)",".e-excelfilter .e-ftrchk:last-child .e-chk-hidden"):this.handleFilterNavigation(e,".e-excelfilter .e-menu-item:not(.e-disabled)",".e-excelfilter .e-footer-content button:nth-child(2)")),"CheckBox"===this.parent.filterSettings.type&&(i=(t=this.parent.getColumnByUid(this.focusedColumnUid))&&t.filter&&t.filter.hideSearchbox?".e-chk-hidden":".e-searchinput.e-input","Immediate"===this.parent.filterSettings.mode?this.handleFilterNavigation(e,i,".e-checkboxfilter .e-footer-content button:nth-child(1)"):this.handleFilterNavigation(e,i,".e-checkboxfilter .e-footer-content button:nth-child(2)")),"Menu"===this.parent.filterSettings.type&&this.handleFilterNavigation(e,".e-flmenu .e-input-group.e-popup-flmenu",".e-flmenu .e-footer-content button:nth-child(2)"),this.parent.showColumnChooser&&("Immediate"===this.parent.columnChooserSettings.mode?this.handleFilterNavigation(e,".e-ccdlg button:nth-child(1)",".e-ccdlg .e-cclist:last-child .e-cc-chbox"):this.handleFilterNavigation(e,".e-ccdlg .e-ccsearch.e-cc.e-input",".e-ccdlg .e-footer-content button:nth-child(2)")),"shiftTab"===e.action&&e.target&&I(e.target,"e-gridcontent")&&e.target.closest(".e-unboundcell")&&(r=(n=[].slice.call(this.parent.getContentTable().rows))[n.length-1].lastElementChild,e.target.closest(".e-unboundcell")===r)&&this.commandColumnFocusElement(e.target.closest(".e-unboundcell"),!0)===e.target&&(this.currentInfo.skipAction=!0,this.setActive(!0),this.setLastContentCellActive()),!this.skipOn(e)){if(e.target&&I(e.target,"e-gridcontent")&&(r=(n=[].slice.call(this.parent.getContentTable().rows))[n.length-1].lastElementChild,e.target===r)&&(this.setActive(!0),this.setLastContentCellActive()),"shiftTab"===e.action&&e.target&&(e.target===this.parent.element||I(e.target,"e-toolbar")||I(e.target,"e-groupdroparea"))){if(e.target===this.parent.element)return void(this.parent.element.classList.contains("e-childgrid")&&this.focusOutFromChildGrid(e));if(I(e.target,"e-groupdroparea"))return void(this.parent.element.classList.contains("e-childgrid")&&(e.preventDefault(),this.parent.element.focus()));if(I(e.target,"e-toolbar"))return void(this.parent.allowGrouping&&this.parent.groupSettings.showDropArea?(s=(o=this.parent.groupModule).getFocusableGroupedItems(),e.preventDefault(),(0<s.length?s[s.length-1]:o.element).focus()):this.parent.element.classList.contains("e-childgrid")&&(e.preventDefault(),this.parent.element.focus()))}t=!1;if("tab"===e.action&&e.target&&(e.target===this.parent.element||I(e.target,"e-toolbar")||I(e.target,"e-groupdroparea"))){if(this.parent.allowGrouping&&this.parent.groupSettings.showDropArea&&(e.target===this.parent.element||e.target.classList.contains("e-groupdroparea"))){if(0<(s=(o=this.parent.groupModule).getFocusableGroupedItems()).length)return e.preventDefault(),void s[0].focus();if(!e.target.classList.contains("e-groupdroparea"))return e.preventDefault(),void o.element.focus()}if((this.parent.toolbar||this.parent.toolbarTemplate)&&(e.target===this.parent.element||I(e.target,"e-groupdroparea")||e.target.classList.contains("e-toolbar"))){var i=this.parent.toolbarModule.element,n=this.parent.toolbarModule.getFocusableToolbarItems();if(0<n.length)return e.preventDefault(),void n[0].querySelector(".e-toolbar-item-focus,.e-btn,.e-input").focus();if(!e.target.classList.contains("e-toolbar")&&this.parent.toolbarTemplate)return e.preventDefault(),void i.focus()}(e.target===this.parent.element||I(e.target,"e-toolbar")||I(e.target,"e-groupdroparea"))&&(t=!0)}t&&(this.parent.allowGrouping&&!H.isNullOrUndefined(this.parent.groupSettings.columns)&&this.parent.groupSettings.columns.length===this.parent.columns.length?this.setActive(!0):this.setActive(!1),this.active.matrix.current=[0,-1]),this.activeKey=e.action;var r={cancel:!1,byKey:!0,byClick:!1,keyArgs:e};if(this.parent.notify(Vt,r),!r.cancel){var s=this.getContent().matrix.current,o=this.active&&this.active.matrix.current?[this.active.matrix.current[0],this.active.matrix.current[1]]:void 0,n=(this.currentInfo.outline=!0,this.getContent().jump(e.action,s)),i=((this.swap=n).swap&&("Batch"!==this.parent.editSettings.mode||H.closest(e.target,".e-headercell")||"tab"!==e.action&&"shiftTab"!==e.action)&&(this.setActive(!n.toHeader),this.getContent().matrix.current=this.getContent().getNextCurrent(s,n,this.active,e.action),this.prevIndexes={}),this.setActiveByKey(e.action,this.getContent()),(!this.content||!this.content.lastIdxCell)&&this.getContent().onKeyPress(e));if(!1!==i||!this.focusNextDomVirtualRow(e)){if(e.target&&!this.parent.enableHeaderFocus)if("tab"===e.action&&(e.target.classList.contains("e-grid")||H.closest(e.target,".e-groupdroparea")||H.closest(e.target,".e-toolbar-item")||H.closest(e.target,".e-headercell")||H.closest(e.target,".e-filterbarcell")))0<this.parent.frozenRows||0<this.parent.pinnedTopRowModels.length?(this.setActive(!1),this.active.matrix.current=this.parent.element.querySelector(".e-filterbarcell")?[2,0]:[1,0]):(this.setActive(!0),this.active.matrix.current=[0,0]);else{if(("leftArrow"===e.action||"rightArrow"===e.action)&&(H.closest(e.target,".e-headercell")||H.closest(e.target,".e-filterbarcell")))return void(this.active.matrix.current=s);if("upArrow"===e.action&&0===parseInt(e.target.getAttribute("data-index"),10))return void(0<this.parent.frozenRows||0<this.parent.pinnedTopRowModels.length?this.active.matrix.current=s:this.setActive(!0))}if(e.target&&I(e.target,"e-gridheader")){if((this.parent.enableHeaderFocus||0<this.parent.frozenRows||0<this.parent.pinnedTopRowModels.length)&&!H.isNullOrUndefined(this.active)&&"tab"===e.action&&s.toString()===this.active.matrix.current.toString()){var r=au(this.active.matrix.matrix,this.active.matrix.current,!0),a=[this.active.matrix.matrix.length-1,this.active.matrix.matrix[this.active.matrix.matrix.length-1].length-1],n=(0===this.active.matrix.matrix[a[0]][a[1]]&&(a=au(this.active.matrix.matrix,a,!1)),H.getValue(r[0]+".cells."+r[1],this.active.matrix.getRowsFromIndex(r[0],this.active)));if(n&&0===n.getBoundingClientRect().width&&this.active.matrix.matrix.length-1===r[0]&&(a=this.active.matrix.nextVisibleCellFocus(r[0],r[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),this.active.matrix.current.toString()===a.toString()&&this.content.matrix.matrix.length){this.setActive(i=!0);var l=[0,0];if(this.parent.allowPaging&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer")&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer").setAttribute("aria-hidden","true"),0===this.active.matrix.matrix[l[0]][l[1]]&&(l=au(this.active.matrix.matrix,[0,0],!0)),(h=H.getValue(l[0]+".cells."+l[1],this.active.matrix.getRowsFromIndex(l[0],this.active)))&&0===h.getBoundingClientRect().width&&(l=this.active.matrix.nextVisibleCellFocus(l[0],l[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),this.active.matrix.current="Batch"!==this.parent.editSettings.mode||this.isValidBatchEditCell(l)?l:this.findBatchEditCell(l,!0),this.parent.enableVirtualization&&!this.parent.enableColumnVirtualization&&1!==this.parent.contentModule.prevInfo.blockIndexes[0])return e.preventDefault(),this.removeFocus(),(n=this.parent.contentModule).firstCellFocus=!0,void(n.content.scrollTop=0)}else this.active.matrix.current.toString()!==r.toString()&&(this.active.matrix.current=r)}if(!H.isNullOrUndefined(this.active)&&"shiftTab"===e.action&&(s.toString()===this.active.matrix.current.toString()||!this.parent.enableHeaderFocus&&(H.closest(e.target,".e-headercell")||H.closest(e.target,".e-filterbarcell")))){var a=au(this.active.matrix.matrix,this.active.matrix.current,!1),n=H.getValue(a[0]+".cells."+a[1],this.active.matrix.getRowsFromIndex(a[0],this.active));if((a=n&&0===n.getBoundingClientRect().width&&0===a[0]?this.active.matrix.nextVisibleCellFocus(a[0],a[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1]):a).toString()===this.active.matrix.current.toString()||!this.parent.enableHeaderFocus&&!n.classList.contains("e-rowcell"))return void this.focusOutFromHeader(e);this.active.matrix.current.toString()===a.toString()||i||(i=!0,(r=H.getValue(a[0]+".cells."+a[1],this.active.matrix.getRowsFromIndex(a[0],this.active)))&&0===r.getBoundingClientRect().width&&0===a[0]&&(a=this.active.matrix.nextVisibleCellFocus(a[0],a[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),this.active.matrix.current=a)}}if(e.target&&I(e.target,"e-gridcontent")&&(this.parent.allowPaging&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer")&&this.parent.pagerModule.pagerObj.element.querySelector(".e-pagercontainer").removeAttribute("aria-hidden"),("enter"===e.action||"shiftEnter"===e.action)&&this.parent.editSettings&&"Cell"===this.parent.editSettings.mode&&this.parent.editSettings.allowEditing&&(this.active.matrix.current=o),"Batch"!==this.parent.editSettings.mode&&("Cell"!==this.parent.editSettings.mode||H.isNullOrUndefined(I(e.target,Os)))||"tab"!==e.action&&"shiftTab"!==e.action||(this.active.matrix.current=this.findBatchEditCell(o,"tab"===e.action),"tab"===e.action&&o.toString()===this.active.matrix.current.toString()&&("Batch"===this.parent.editSettings.mode?this.parent.editModule.editModule.addBatchRow=!0:(this.active.matrix.current=o,i=!0))),"shiftTab"===e.action)&&s.toString()===this.active.matrix.current.toString()){if(!this.parent.enableHeaderFocus&&!this.parent.frozenRows&&!this.parent.pinnedTopRowModels.length||this.parent.allowGrouping&&!H.isNullOrUndefined(this.parent.groupSettings.columns)&&this.parent.groupSettings.columns.length===this.parent.columns.length)return void this.focusOutFromHeader(e);var h,l=[0,0];0===this.active.matrix.matrix[l[0]][l[1]]&&(l=au(this.active.matrix.matrix,[0,0],!0)),(h=H.getValue(l[0]+".cells."+l[1],this.active.matrix.getRowsFromIndex(l[0],this.active)))&&0===h.getBoundingClientRect().width&&(l=this.active.matrix.nextVisibleCellFocus(l[0],l[1],e.action,this.active.keyActions[e.action],this.active,this.active.matrix.current[1])),i||l.toString()!==this.active.matrix.current.toString()&&("Batch"!==this.parent.editSettings.mode&&"Cell"!==this.parent.editSettings.mode||o.toString()!==this.active.matrix.current.toString())||(this.setActive(!(i=!0)),this.setLastContentCellActive())}if(!1===i){if(this.clearIndicator(),"shiftTab"===e.action&&s.toString()===[0,0].toString()&&(this.parent.element.tabIndex=-1),this.parent.allowPaging&&!this.parent.pagerModule.pagerObj.checkPagerHasFocus()&&this.allowToPaging(e)&&s.toString()!==[0,0].toString()){if(e.preventDefault(),40===e.keyCode)return void this.parent.pagerModule.pagerObj.setPagerContainerFocus();if(9===e.keyCode)return void this.parent.pagerModule.pagerObj.setPagerFocus()}this.parent.element.classList.contains("e-childgrid")&&this.focusOutFromChildGrid(e)}else this.header.action=e.action,this.header.currentTarget=null,this.header.focusType="key",e.target&&I(e.target,"e-fltrtemp")&&("tab"===e.action||"shiftTab"===e.action)&&(n=e.target,(r=[].slice.call(H.closest(n,"th").querySelectorAll(".e-fltrtemp-focus"))).length)&&(a=r.indexOf(n),"tab"===e.action&&a<r.length-1||"shiftTab"===e.action&&0<a)&&(this.setActive(!1),this.active.matrix.current=s,this.active.currentTarget=n),t&&I(this.active.getTable(),"e-gridheader")&&e.target&&e.target.id===this.parent.element.id+"_searchbar"&&(this.parent.searchModule.headerFocus=!0),e.preventDefault(),this.focus(e)}}}},n.prototype.isValidBatchEditCell=function(e){var t=this.active.getTable().rows[e[0]].cells[e[1]],i=H.closest(t,"tr"),t=parseInt(t.getAttribute("aria-colindex"),10)-1,t=this.parent.getColumns()[parseInt(t.toString(),10)];return!(!t||1!==this.active.matrix.matrix[e[0]][e[1]]||i.classList.contains("e-row")&&(!i.classList.contains("e-insertedrow")&&t.isPrimaryKey||!t.allowEditing))},n.prototype.findBatchEditCell=function(e,t,i){for(var n=e,r=e,s=!1;!s;){var o=r,r=au(this.active.matrix.matrix,r,t),a=H.getValue(r[0]+".cells."+r[1],this.active.getTable().rows);a&&0===a.getBoundingClientRect().width&&(r=this.active.matrix.nextVisibleCellFocus(r[0],r[1],this.activeKey,this.active.keyActions[this.activeKey],this.active,this.active.matrix.current[1])),o.toString()===r.toString()||i&&o[0]!==r[0]?s=!0:this.isValidBatchEditCell(r)&&(n=r,s=!0)}return n},n.prototype.setLastContentCellActive=function(){var e=[this.active.matrix.matrix.length-1,this.active.matrix.matrix[this.active.matrix.matrix.length-1].length-1],t=(0===this.active.matrix.matrix[e[0]][e[1]]&&(e=au(this.active.matrix.matrix,e,!1)),H.getValue(e[0]+".cells."+e[1],this.active.matrix.getRowsFromIndex(e[0],this.active)));t&&0===t.getBoundingClientRect().width&&(e=this.active.matrix.nextVisibleCellFocus(e[0],e[1],this.activeKey,this.active.keyActions[this.activeKey],this.active,this.active.matrix.current[1])),this.active.matrix.current=e},n.prototype.focusOutFromChildGrid=function(e){var t,i=I(this.parent.element,"e-table"),n=I(i,"e-grid").ej2_instances[0],i=I(this.parent.element,"e-detailcell"),r=I(this.parent.element,"e-detailrow").getAttribute("data-uid"),s=[].slice.call(n.getContentTable().rows),o=s.map(function(e){return e.getAttribute("data-uid")}).indexOf(r);if(!("tab"===e.action&&o>=s.length-1)){if(H.removeClass([this.parent.element],["e-focus"]),H.removeClass([i],["e-focused"]),i.tabIndex=-1,e.preventDefault(),n.focusModule.removeFocus(),"shiftTab"===e.action){for(var a=s[o-1].cells,l=a.length-1;0<=l;l--)if(!(t=a[parseInt(l.toString(),10)]).classList.contains("e-hide")){n.focusModule.active.matrix.current=[o-1,l];break}}else t=s[o+1].cells[0],n.focusModule.active.matrix.current=[o+1,0];n.focusModule.currentInfo.element=t,n.focusModule.currentInfo.elementToFocus=t,H.addClass([t],["e-focused","e-focus"]),t.tabIndex=0,t.focus()}},n.prototype.focusOutFromHeader=function(e){if(this.removeFocus(),this.parent.toolbar||this.parent.toolbarTemplate){var t=this.parent.toolbarModule.element,i=this.parent.toolbarModule.getFocusableToolbarItems();if(0<i.length)return e.preventDefault(),void this.parent.toolbarModule.getBackwardEntryElement(i[i.length-1]).focus();if(this.parent.toolbarTemplate)return e.preventDefault(),void t.focus()}this.parent.allowGrouping&&this.parent.groupSettings.showDropArea?(t=(i=this.parent.groupModule).getFocusableGroupedItems(),e.preventDefault(),(0<t.length?t[t.length-1]:i.element).focus()):this.parent.element.classList.contains("e-childgrid")&&(e.preventDefault(),this.parent.element.focus())},n.prototype.focusDomVirtualCell=function(){var e=this.domVirtualFocusCell;this.domVirtualFocusCell=null,e.parentElement&&(this.setActive(!0),this.getContent().matrix.current=[e.parentElement.rowIndex,e.cellIndex],this.isVirtualScroll=!0,this.focus(),this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||(this.isVirtualScroll=!1))},n.prototype.focusNextDomVirtualRow=function(e){var t;return!(!this.parent.isRowDomVirtualization()||"tab"!==e.action&&"shiftTab"!==e.action||!e.target||!I(e.target,vs))&&(t={action:e.action,isHandled:!1},this.parent.notify(xn,t),t.isHandled&&e.preventDefault(),t.isHandled)},n.prototype.allowToPaging=function(e){return"Batch"!==this.parent.editSettings.mode||!this.parent.editSettings.allowAdding||40===e.keyCode},n.prototype.skipOn=function(e){var t=e.target;if(!t)return!1;if(!this.parent.isEdit&&t&&t.closest(".e-unboundcell")&&this.currentInfo.skipAction&&("shiftTab"===e.action&&this.commandColumnFocusElement(t.closest(".e-unboundcell"),!1)===t||"tab"===e.action&&this.commandColumnFocusElement(t.closest(".e-unboundcell"),!0)===t))return this.currentInfo.skipAction=!1;if(this.currentInfo.skipAction)return this.clearIndicator(),!0;if(-1<["pageUp","pageDown","altDownArrow"].indexOf(e.action))return this.clearIndicator(),!0;if(this.parent.enableDomVirtualization&&-1<["ctrlHome","ctrlEnd"].indexOf(e.action))return e.preventDefault(),!0;if(this.parent.allowGrouping){if(I(e.target,"e-groupdroparea")&&-1<["upArrow","downArrow","leftArrow","rightArrow"].indexOf(e.action))return e.preventDefault(),!0;var i=this.parent.groupModule.getFocusableGroupedItems();if(I(e.target,"e-groupheadercell")&&!(e.target===i[0]&&"shiftTab"===e.action||e.target===i[i.length-1]&&"tab"===e.action))return!0}if(this.parent.toolbar||this.parent.toolbarTemplate){i=this.parent.toolbarModule.element;if(this.parent.toolbarModule.getNextFindControl(e))return!0;i=i.querySelectorAll(".e-toolbar-item:not(.e-overlay):not(.e-hidden)");if(I(e.target,"e-toolbar-item")&&!(0<i.length&&(I(e.target,"e-toolbar-item")===i[0]&&"shiftTab"===e.action||I(e.target,"e-toolbar-item")===i[i.length-1]&&"tab"===e.action)))return!0}var n,i=H.closest(t,"th")&&!H.closest(t,"th").tabIndex,r=(!e.target.classList.contains("e-filterbaroperator")||13!==e.keyCode&&27!==e.keyCode||(n=H.closest(e.target,".e-filterbarcell")).querySelector("input").focus(),this.parent.editSettings.showAddNewRow&&null!==H.closest(document.activeElement,".e-addedrow")),s=((i&&null!==H.closest(document.activeElement,".e-filterbarcell")||r)&&this.removeFocus(),!this.parent.isEdit||"tab"!==e.action&&"shiftTab"!==e.action||"Normal"!==this.parent.editSettings.mode||this.parent.editSettings.showAddNewRow||H.isNullOrUndefined(I(t,"e-addedrow"))||(i=this.parent.editModule.formObj.element.querySelectorAll('input:not([type="hidden"],.e-numeric-hidden,.e-disabled), select:not([aria-hidden="true"]), button:not(.e-hide), textarea:not(.e-hide,.e-disabled,[disabled])'),n=t.classList.contains("e-ddl")?t.querySelector("input"):t,s="tab"===e.action&&n===i[i.length-1],n="shiftTab"===e.action&&n===i[0],(s||n)&&(e.preventDefault(),(n=(n=i[s?0:i.length-1]).parentElement.classList.contains("e-ddl")?n.parentElement:n).focus())),"Batch"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode&&(!H.isNullOrUndefined(I(e.target,Os))||"f2"===e.action));return"delete"===e.action||!s&&(this.parent.isEdit&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&(!H.isNullOrUndefined(this.parent.element.querySelector(".e-editedrow"))||!H.isNullOrUndefined(I(t,"e-addedrow"))&&!H.isNullOrUndefined(H.closest(e.target,"input"))&&!H.isNullOrUndefined(document.querySelector(".e-popup-open"))||!H.isNullOrUndefined(I(t,"e-addedrow"))&&t&&!t.querySelector(".e-cancel-icon")&&!H.isNullOrUndefined(I(t,"e-unboundcell"))))||-1<["insert","f2"].indexOf(e.action))||null!==H.closest(document.activeElement,".e-filterbarcell")&&this.parent.enableHeaderFocus&&"ctrlPlusA"===e.action||(null!==H.closest(document.activeElement,".e-filterbarcell")||r)&&"tab"!==e.action&&"shiftTab"!==e.action||null!==H.closest(document.activeElement,"#"+this.parent.element.id+"_searchbar")&&-1<["enter","leftArrow","rightArrow","shiftLeft","shiftRight","ctrlPlusA"].indexOf(e.action)||null===H.closest(t,"."+vs)&&null===H.closest(t,"."+ms)&&!(e.target===this.parent.element||I(e.target,"e-toolbar")||I(e.target,"e-groupdroparea"))||"space"===e.action&&!t.classList.contains(Es)&&null===H.closest(t,"."+Es)&&null===H.closest(t,".e-headerchkcelldiv")||null!==H.closest(t,".e-filter-popup")},n.prototype.focusVirtualElement=function(e){var t,i,n,r=this;(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&(this.parent.notify(kn,t={virtualData:{},isAdd:!1,isCancel:!1}),i=this.actions.some(function(e){return e===r.activeKey}),n=!!this.parent.contentModule&&-1<this.parent.contentModule.selectedRowIndex,t.isAdd||Object.keys(t.virtualData).length||i||t.isCancel||n?(this.parent.notify(Or,{isCancel:!1}),t.isCancel=!1,(!this.parent.enableVirtualization||this.parent.selectVirtualRowOnAdd||e&&("ctrlHome"===e.action||"ctrlEnd"===e.action))&&this.parent.enableVirtualization||(this.parent.contentModule.selectedRowIndex=-1),this.parent.selectVirtualRowOnAdd=!1,i&&(this.activeKey=this.empty,this.parent.notify("virtaul-key-handler",e)),this.currentInfo.elementToFocus.focus({preventScroll:!0})):this.isVirtualScroll||this.isInfiniteScroll?this.currentInfo.elementToFocus.focus({preventScroll:!0}):this.currentInfo.elementToFocus.focus()),this.isVirtualScroll=this.isInfiniteScroll=!1},n.prototype.getFocusedElement=function(){return this.currentInfo.elementToFocus},n.prototype.getContent=function(){return this.active||this.content},n.prototype.setActive=function(e){this.active=e?this.content:this.header},n.prototype.setFocusedElement=function(e,t){var i=this;this.currentInfo.elementToFocus=e,setTimeout(function(){var e;H.isNullOrUndefined(i.currentInfo.elementToFocus)||(e=H.isNullOrUndefined(i.parent.element.querySelector(".e-flmenu"))?document.querySelector(".e-grid-popup .e-flmenu"):i.parent.element.querySelector(".e-flmenu"),(i.parent.enableVirtualization||i.parent.enableInfiniteScrolling)&&H.isNullOrUndefined(e)?i.focusVirtualElement(t):!H.isNullOrUndefined(e)&&I(document.activeElement,"e-flmenu-valuediv")===e.querySelector(".e-flmenu-valuediv")||i.currentInfo.elementToFocus.focus())},0)},n.prototype.focus=function(e){this.parent.notify(Rn,e),this.removeFocus(),this.addFocus(this.getContent().getFocusInfo(),e)},n.prototype.removeFocus=function(e){var t;this.currentInfo.element&&(!this.parent.isReact||this.parent.isEdit||!this.currentInfo.element.classList.contains("e-rowcell")||this.currentInfo.element.parentElement||this.parent.allowGrouping&&!H.isNullOrUndefined(this.parent.groupSettings.columns)&&this.parent.groupSettings.columns.length||!this.parent.getRowByIndex(this.prevIndexes.rowIndex)||(t=this.parent.getCellFromIndex(this.prevIndexes.rowIndex,this.prevIndexes.cellIndex),this.currentInfo.element=t||this.currentInfo.element),(t=this.currentInfo.elementToFocus)&&t.matches(".e-focus.e-checkbox")&&(t.closest(".e-headerchkcelldiv")||t.closest(".e-gridchkbox"))&&H.removeClass([t],["e-checkbox"]),H.removeClass([this.currentInfo.element,this.currentInfo.elementToFocus],["e-focused","e-focus"]),this.currentInfo.element.tabIndex=-1)},n.prototype.addOutline=function(){var e=this.getContent().getFocusInfo();e.element&&(H.addClass([e.element],["e-focused"]),H.addClass([e.elementToFocus],["e-focus"]))},n.prototype.focusHeader=function(){this.setActive(!1),this.resetFocus()},n.prototype.focusContent=function(){this.setActive(!0),this.resetFocus()},n.prototype.resetFocus=function(){var e=0<this.parent.frozenRows||0<this.parent.pinnedTopRowModels.length?(this.setActive(this.swap.toHeader),this.getContent().matrix.get(1,-1,[0,1],null,this.getContent().validator())):this.getContent().matrix.get(0,-1,[0,1],null,this.getContent().validator());this.getContent().matrix.select(e[0],e[1]),this.focus()},n.prototype.addFocus=function(e,t){var i,n;this.currentInfo=e,this.currentInfo.outline=e.outline&&(!H.isNullOrUndefined(t)||this.isVirtualScroll),this.isInfiniteScroll&&(this.currentInfo.outline=!0),!e.element||(n=e.elementToFocus.classList.contains("e-focus"))||(e.elementToFocus&&e.elementToFocus.classList.contains("e-lastrowcell")&&"Sticky"===this.parent.emptyRecordMode&&(this.currentInfo.outline=!1),this.currentInfo.outline&&H.addClass([e.element],["e-focused"]),H.addClass([e.elementToFocus],["e-focus"]),e.elementToFocus&&e.elementToFocus.classList.contains("e-focus")&&e.elementToFocus.parentElement&&!e.elementToFocus.parentElement.classList.contains("e-checkbox-disabled")&&(e.elementToFocus.classList.contains("e-checkselect")||e.elementToFocus.classList.contains("e-checkselectall"))&&e.elementToFocus.classList.add("e-checkbox"),e.element.tabIndex=0,n||this.setFocusedElement(e.elementToFocus,t),this.parent.notify(jt,{element:e.elementToFocus,parent:e.element,indexes:this.getContent().matrix.current,byKey:!H.isNullOrUndefined(t),byClick:H.isNullOrUndefined(t),keyArgs:t,isJump:this.swap.swap,container:this.getContent().getInfo(t),outline:!H.isNullOrUndefined(t),swapInfo:this.swap}),i=(n=this.getContent().matrix.current)[0],n=n[1],this.prevIndexes={rowIndex:i,cellIndex:n},this.focusedColumnUid=this.parent.getColumnByIndex(n).uid,this.focusByClick=!1,this.triggerCellFocusEvent(e.elementToFocus,t))},n.prototype.triggerCellFocusEvent=function(e,t){var i;this.suppressCellFocusEvent?this.suppressCellFocusEvent=!1:(i=this.getFocusCellType(e),this.shouldTriggerCellFocusEvent(i)&&(e={cell:e,rowIndex:this.prevIndexes.rowIndex,cellIndex:this.prevIndexes.cellIndex,cellType:i,event:t},this.parent.trigger(gt,e)))},n.prototype.getFocusCellType=function(e){return H.closest(e,".e-headercell")?"header":H.closest(e,".e-summarycell")?"aggregate":H.closest(e,".e-groupcaption")?"caption":H.closest(e,".e-rowcell")?"content":null},n.prototype.shouldTriggerCellFocusEvent=function(e){return!!e&&-1!==["header","content","aggregate","caption"].indexOf(e)},n.prototype.refreshMatrix=function(c){var u=this;return function(e){c&&!u.content&&(u.content=new ka(u.parent)),c||u.header||(u.header=new Na(u.parent)),c&&u.parent.pinnedTopRowModels.length&&(e.rows=u.parent.pinnedTopRowModels.concat(e.rows));var t=c?u.content:u.header,i=0;if((n=u.parent.frozenRows||u.parent.pinnedTopRowModels.length)&&"Batch"===u.parent.editSettings.mode&&(i=u.parent.getHeaderContent().querySelectorAll(".e-insertedrow").length+u.parent.getHeaderContent().querySelectorAll(".e-hiddenrow").length),!H.isNullOrUndefined(u.parent.groupSettings.columns)&&u.parent.groupSettings.columns.length&&n&&!u.parent.pinnedTopRecords.length&&c){for(var n=0,r=0;r<e.rows.length&&(n++,e.rows[parseInt(r.toString(),10)].index+1!==u.parent.frozenRows);r++);u.groupedFrozenRow=n}var s,o,a,l=c?e.rows.slice(n+i):e.rows,i=c?e.rows.slice(0,n+i):e.rows,h=(u.parent.isCollapseStateEnabled()&&c&&(l=l.filter(function(e){return!1!==e.visible})),!H.isNullOrUndefined(u.parent.rowTemplate)),d=((n&&("Batch"===u.parent.editSettings.mode&&c&&("batchDelete"===e.name||"batchAdd"===e.name||"batchCancel"===e.name||e.args&&"batchsave"===e.args.requestType)||e.args&&("delete"===e.args.requestType||"save"===e.args.requestType))||e.args&&("pin-row"===e.args.requestType||"unpin-row"===e.args.requestType))&&(d=u.header.matrix.matrix,p=u.parent.headerModule.rows.length,d.splice(p,d.length-p)),t.matrix.generate(i,t.selector,h)),p=(t.matrix.generate(l,t.selector,h),u.parent.enableVirtualization||u.parent.enableInfiniteScrolling);u.parent.editSettings.showAddNewRow&&c&&u.header&&u.header.matrix&&(!p||u.parent.isAddNewRow)&&(l=u.header.matrix.matrix,h=u.parent.allowFiltering&&"FilterBar"===u.parent.filterSettings.type?2:1,t.matrix.rows=u.parent.frozenRows&&"Top"===u.parent.editSettings.newRowPosition?t.matrix.rows:++t.matrix.rows,"Top"===u.parent.editSettings.newRowPosition?(u.parent.frozenRows||p?d:t.matrix.matrix).unshift(u.refreshAddNewRowMatrix(l[l.length-h])):t.matrix.matrix.push(u.refreshAddNewRowMatrix(l[l.length-h])),u.parent.isAddNewRow=!1),(!u.parent.isFrozenGrid()||!e.args||"sorting"!==e.args.requestType&&"batchsave"!==e.args.requestType&&"paging"!==e.args.requestType||n&&"Batch"===u.parent.editSettings.mode&&c&&("batchDelete"===e.name||"batchAdd"===e.name||"batchCancel"===e.name||"batchsave"===e.args.requestType))&&t.generateRows(i,{matrix:d,handlerInstance:u.header}),!H.Browser.isDevice&&e&&e.args&&(u.focusByClick||"paging"!==e.args.requestType||u.parent.pagerModule.pagerObj.checkPagerHasFocus()||(u.skipFocus=!1,u.parent.element.focus()),"grouping"===e.args.requestType)&&(u.skipFocus=!0),e&&e.args&&"virtualscroll"===e.args.requestType&&(u.currentInfo.uid?e.rows.some(function(e,t){return s=t,e.uid===u.currentInfo.uid})&&(u.content.matrix.current[0]=s,u.content.matrix.current[1]=u.parent.getColumnIndexByUid(u.focusedColumnUid)||0,p=u.parent.getVisibleFrozenLeftCount(),l=u.parent.getVisibleFrozenRightCount(),!u.parent.enableColumnVirtualization||p&&l||!u.parent.isFrozenGrid()||"right"!==e.args.virtualInfo.direction||(u.content.matrix.current[1]=u.content.matrix.current[1]-(p+(l?l+1:0))),(h=!(!u.parent.allowGrouping||!u.parent.groupSettings.columns.length))&&(u.content.matrix.current[1]=u.prevIndexes.cellIndex,u.virtualSelectionInfo.isPending)&&(u.content.matrix.current[0]="downArrow"===u.virtualSelectionInfo.direction?u.content.matrix.current[0]+1:u.content.matrix.current[0]-1),a=u.getContent().getFocusInfo().elementToFocus)&&(t=a.getBoundingClientRect(),i=u.parent.element.getBoundingClientRect(),o=d=0,!u.parent.enableColumnVirtualization||p&&l||!u.parent.isFrozenGrid()||"right"!==e.args.virtualInfo.direction||(p?d=u.parent.leftrightColumnWidth("left"):o=u.parent.leftrightColumnWidth("right")),0<=t.top&&0<=t.left&&t.right-d-o<=Math.min(i.right,window.innerWidth||document.documentElement.clientWidth)+o&&t.bottom<=Math.min(i.bottom,window.innerHeight||document.documentElement.clientHeight)||h)&&(u.isVirtualScroll=!0,u.focus(h&&u.virtualSelectionInfo.isPending?u.virtualSelectionInfo.event:void 0)):e.args.focusElement&&e.args.focusElement.classList.contains("e-filtertext")&&(a=u.parent.element.querySelector("#"+kp(e.args.focusElement.id)))&&a.focus(),u.virtualSelectionInfo={}),c&&e&&e.args&&"dom-virtualscroll"===e.args.requestType&&u.domVirtualFocusCell&&u.focusDomVirtualCell(),e&&e.args&&"infiniteScroll"===e.args.requestType&&(u.isInfiniteScroll=!0)}},n.prototype.refreshAddNewRowMatrix=function(e){for(var t=this.parent.getColumns(),i=this.parent.getIndentCount(),n=i;n<e.length-1;n++)t[n-i]&&t[n-i].visible&&t[n-i].allowEditing?e[parseInt(n.toString(),10)]=1:e[parseInt(n.toString(),10)]=0;return e},n.prototype.addEventListener=function(){var t=this;this.parent.isDestroyed||(H.EventHandler.add(this.parent.element,"mousedown",this.focusCheck,this),H.EventHandler.add(this.parent.element,"touchstart",this.focusCheck,this),H.EventHandler.add(this.parent.element,"focus",this.onFocus,this),H.EventHandler.add(this.parent.element,"focusin",this.focusIn,this),this.parent.element.addEventListener("focus",this.passiveHandler=function(e){return t.passiveFocus(e)},!0),H.EventHandler.add(this.parent.element,"focusout",this.onBlur,this),this.evtHandlers=[{event:Gt,handler:this.onKeyPress},{event:_t,handler:this.onClick},{event:vt,handler:this.refMatrix},{event:dn,handler:this.refMatrix},{event:Cr,handler:this.refMatrix},{event:Yr,handler:this.showAddNewRowFocus},{event:Rt,handler:this.refreshMatrix()},{event:Er,handler:this.restoreFocus},{event:wn,handler:this.restoreFocus},{event:"start-edit",handler:this.clearIndicator},{event:"start-add",handler:this.clearIndicator},{event:"sorting-complete",handler:this.restoreFocus},{event:"filtering-complete",handler:this.filterfocus},{event:"custom-filter-close",handler:this.filterfocus},{event:"grouping-complete",handler:this.restoreFocusWithAction},{event:"ungrouping-complete",handler:this.restoreFocusWithAction},{event:ze,handler:this.refMatrix},{event:qe,handler:this.refMatrix},{event:Ue,handler:this.refMatrix},{event:Me,handler:this.refMatrix},{event:Ct,handler:this.refMatrix},{event:jt,handler:this.internalCellFocus}],Kc(this.parent,this.evtHandlers,!0,this))},n.prototype.showAddNewRowFocus=function(){var e,t,i;this.parent.editSettings.showAddNewRow&&(e="Top"===this.parent.editSettings.newRowPosition?0:this.content.matrix.matrix.length-1,t=this.parent.getIndentCount(),"Top"===this.parent.editSettings.newRowPosition&&(this.parent.frozenRows||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?(i=this.header.matrix.matrix.length-(this.groupedFrozenRow||this.parent.frozenRows),t=this.findNextCellFocus(this.header.matrix.matrix[i-1],t),this.header.matrix.current=[i-1,t],this.active=this.header):(t=this.findNextCellFocus(this.content.matrix.matrix[parseInt(e.toString(),10)],t),this.content.matrix.current=[e,t],this.active=this.content),i=this.parent.element.querySelector(".e-addedrow"))&&i.querySelectorAll("tr")&&i.querySelector("tr").cells[parseInt(t.toString(),10)].querySelector("input")&&i.querySelector("tr").cells[parseInt(t.toString(),10)].querySelector("input").select()},n.prototype.findNextCellFocus=function(e,t){for(var i=t;i<e.length;i++)if(1===e[parseInt(i.toString(),10)])return i;return t},n.prototype.filterfocus=function(e){e&&"filtering"===e.requestType&&"filter"===e.action&&this.parent.filterSettings&&"Immediate"===this.parent.filterSettings.mode||this.parent.filterModule&&this.parent.filterModule.maintainFocusOnFilterDialog?this.parent.filterModule.maintainFocusOnFilterDialog=!1:"FilterBar"!==this.parent.filterSettings.type&&(this.removeFocus(),this.restoreFocus())},n.prototype.removeEventListener=function(){this.parent.isDestroyed||(H.EventHandler.remove(this.parent.element,"mousedown",this.focusCheck),H.EventHandler.remove(this.parent.element,"touchstart",this.focusCheck),H.EventHandler.remove(this.parent.element,"focus",this.onFocus),H.EventHandler.remove(this.parent.element,"focusin",this.focusIn),H.EventHandler.remove(this.parent.element,"focusout",this.onBlur),this.parent.element.removeEventListener("focus",this.passiveHandler,!0),Kc(this.parent,this.evtHandlers,!1))},n.prototype.destroy=function(){this.removeEventListener()},n.prototype.restoreFocus=function(e){var t;e&&"sorting"===e.requestType&&H.isNullOrUndefined(e.target)||(t=this.parent.groupModule,this.parent.allowGrouping&&t&&(t.groupSortFocus||t.groupTextFocus)?(t.groupSortFocus=!1,t.groupTextFocus=!1):(this.firstHeaderCellClick=!0,this.addFocus(this.getContent().getFocusInfo()),t=this.getContent().getFocusInfo(),e&&-1<["add","save","delete","cancel","batchsave","batchDelete","batchCancel"].indexOf(e.requestType)&&t&&t.elementToFocus&&(e=t.elementToFocus.matches(".e-rowcell.e-focus")?t.elementToFocus:t.elementToFocus.matches(".e-checkselect.e-focus")?t.elementToFocus.closest(".e-rowcell"):null)&&H.addClass([e],["e-focused","e-focus"])))},n.prototype.restoreFocusWithAction=function(e){if(!(this.parent.enableInfiniteScrolling||this.parent.groupModule&&this.parent.groupModule.preventFocusOnGroup)){var t=this.getContent().matrix,i=t.current;switch(e.requestType){case"grouping":case"ungrouping":i[1]=!i.length||this.parent.groupSettings.showGroupedColumn||H.isNullOrUndefined(t.matrix[i[0]])?"grouping"===e.requestType?i[1]+1:i[1]-1:t.matrix[i[0]].indexOf(1)}this.getContent().matrix.current=i,this.prevIndexes={rowIndex:i[0],cellIndex:i[1]};var n,r=this.parent.groupModule;this.parent.allowGrouping&&r&&r.groupCancelFocus?(((n=r.getFocusableGroupedItems()).length?n[0].parentElement.getAttribute("data-mappingname")===e.columnName?n[3]:n[0]:r.element).focus(),r.groupCancelFocus=!1):this.addFocus(this.getContent().getFocusInfo())}},n.prototype.clearIndicator=function(){this.currentInfo.element&&this.currentInfo.elementToFocus&&H.removeClass([this.currentInfo.element,this.currentInfo.elementToFocus],["e-focus","e-focused"])},n.prototype.getPrevIndexes=function(){var e=this.forget;return this.forget=!1,e||!Object.keys(this.prevIndexes).length?{rowIndex:null,cellIndex:null}:this.prevIndexes},n.prototype.forgetPrevious=function(){this.forget=!0},n.prototype.setActiveByKey=function(e,t){var i,n;0===this.parent.pinnedTopRowModels.length&&0===this.parent.frozenRows||e in(n={home:function(){return{toHeader:!i.isContent,toFrozen:!0}},end:function(){return{toHeader:!i.isContent,toFrozen:!1}},ctrlHome:function(){return{toHeader:!0,toFrozen:!1}},ctrlEnd:function(){return{toHeader:!1,toFrozen:!1}}})&&(i=t.getInfo(),n=n[""+e](),this.setActive(!n.toHeader),this.getContent().matrix.current=t.matrix.current)},n.prototype.internalCellFocus=function(e){var t,i;e&&e.keyArgs&&e.parent&&(i="enter"===e.keyArgs.action&&e.parent.classList.contains("e-detailcell"),t=-1!==["tab","shiftTab"].indexOf(e.keyArgs.action)&&e.parent.classList.contains("e-unboundcell")),e.byKey&&(e.container.isContent||t)&&(i||t)&&(this.clearIndicator(),i=e.parent&&e.parent.closest(".e-unboundcell")&&"shiftTab"===e.keyArgs.action?this.commandColumnFocusElement(e.parent,!0):this.getContent().getFocusable(this.getFocusedElement()),this.setFocusedElement(i),this.currentInfo.skipAction=!0)},n.prototype.commandColumnFocusElement=function(e,t){e=e.querySelectorAll("button:not(.e-hide)");return t?e[e.length-1]:e[0]},n);function n(e){this.currentInfo={},this.oneTime=!0,this.swap={},this.isInfiniteScroll=!1,this.virtualSelectionInfo={},this.domVirtualFocusCell=null,this.forget=!1,this.skipFocus=!0,this.focusByClick=!1,this.firstHeaderCellClick=!1,this.prevIndexes={},this.refMatrix=this.refreshMatrix(!0),this.actions=["downArrow","upArrow"],this.isVirtualScroll=!1,this.groupedFrozenRow=0,this.suppressCellFocusEvent=!1,this.parent=e,this.rowModelGen=new Js(this.parent),this.addEventListener()}Ma.prototype.set=function(e,t,i){e=Math.max(0,Math.min(e,this.rows)),t=Math.max(0,Math.min(t,this.columns)),this.matrix[parseInt(e.toString(),10)]=this.matrix[parseInt(e.toString(),10)]||[],this.matrix[parseInt(e.toString(),10)][parseInt(t.toString(),10)]=i?1:0},Ma.prototype.get=function(e,t,i,n,r,s){var o=t;if(e+i[0]<0)return[e,t];e=Math.max(0,Math.min(e+i[0],this.rows));var a=!0,l=s&&s.parent&&"Batch"===s.parent.editSettings.mode&&s.parent.editModule&&0<s.parent.editModule.getBatchChanges()[Ps].length;if(H.isNullOrUndefined(this.matrix[parseInt(e.toString(),10)]))return null;if(t=Math.max(0,Math.min(t+i[1],this.matrix[parseInt(e.toString(),10)].length-1)),l&&!this.matrix[parseInt(e.toString(),10)].some(function(e){return 1===e}))return[e,t];if(o+i[1]>this.matrix[parseInt(e.toString(),10)].length-1&&r(e,t,n))return[e,-1!==["downArrow","upArrow"].indexOf(n)?this.matrix[parseInt(e.toString(),10)].lastIndexOf(1):o];var h,l=this.first(this.matrix[parseInt(e.toString(),10)],t,i,!0,n),d=H.getValue(e+"."+(t=null===l?o:l),this.matrix);if(e!==this.rows||"downArrow"!==n&&"enter"!==n||(i[0]=-1),s&&(h=this.getRowsFromIndex(e,s),h=H.getValue(e+".cells."+t,h)),h&&0===h.getBoundingClientRect().width&&(e=(h=this.nextVisibleCellFocus(e,t,n,i,s,o))[0],t=h[1]),null===l){for(var p=0;p<this.rows;p++)if(this.matrix[parseInt(p.toString(),10)].some(function(e){return 1===e})){a=!1;break}if(a)return[e=this.current.length?this.current[0]:0,t]}return this.inValid(d)||!r(e,t,n)?this.get(e,o,i,n,r):[e,t]},Ma.prototype.getRowsFromIndex=function(e,t){e=t.getTable().rows[parseInt(e.toString(),10)];return(e.classList.contains("e-addedrow")&&e.querySelector("table")?e.querySelector("table"):t.getTable()).rows},Ma.prototype.nextVisibleCellFocus=function(e,t,i,n,r,s){var o=this.getRowsFromIndex(e,r),a=H.getValue(e+".cells."+t,o),l=r.matrix.matrix,h=l.length-1,d="tab"===i,p="shiftTab"===i,c="enter"===i||"shiftEnter"===i||"downArrow"===i||"upArrow"===i;if(!c)for(;a&&0===a.getBoundingClientRect().width;){if(d&&e===h&&t===l[parseInt(e.toString(),10)].lastIndexOf(1)||p&&0===e&&t===l[parseInt(e.toString(),10)].indexOf(1))return[e,t=s];d?t===l[parseInt(e.toString(),10)].lastIndexOf(1)?(e++,t=l[parseInt(e.toString(),10)].indexOf(1),t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i),o=this.getRowsFromIndex(e,r)):(t++,t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)):p?t===l[parseInt(e.toString(),10)].indexOf(1)?(e--,t=l[parseInt(e.toString(),10)].lastIndexOf(1),t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i),o=this.getRowsFromIndex(e,r)):(t--,t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)):"rightArrow"===i||"shiftRight"===i?t=t===l[parseInt(e.toString(),10)].lastIndexOf(1)?s:(t++,this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)):"leftArrow"===i||"shiftLeft"===i?t=t===l[parseInt(e.toString(),10)].indexOf(1)?s:(t--,this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)):null===i&&(t++,t=this.first(this.matrix[parseInt(e.toString(),10)],t,n,!0,i)),a=H.getValue(e+".cells."+t,o)}return[e,t]},Ma.prototype.first=function(e,t,i,n,r){return(t<0||t===e.length)&&this.inValid(e[parseInt(t.toString(),10)])&&"upArrow"!==r&&"downArrow"!==r||!e.some(function(e){return 1===e})?null:this.inValid(e[parseInt(t.toString(),10)])?this.first(e,-1!==["upArrow","downArrow","shiftUp","shiftDown","enter","shiftEnter"].indexOf(r)?n?0:++t:t+i[1],i,!1,r):t},Ma.prototype.select=function(e,t){e=Math.max(0,Math.min(e,this.rows)),t=Math.max(0,Math.min(t,this.matrix[parseInt(e.toString(),10)].length-1)),this.current=[e,t]},Ma.prototype.generate=function(e,t,i){this.rows=e.length-1,this.matrix=[];for(var n=0;n<e.length;n++){for(var r=e[parseInt(n.toString(),10)].cells.filter(function(e){return!0!==e.isSpanned}),s=(this.columns=Math.max(r.length-1,0|this.columns),0),o=0;o<r.length;o++)r[parseInt(o.toString(),10)].column&&r[parseInt(o.toString(),10)].column.columns?s=this.columnsCount(r[parseInt(o.toString(),10)].column.columns,s):s++,this.set(n,o,!1!==e[parseInt(n.toString(),10)].visible&&t(e[parseInt(n.toString(),10)],r[parseInt(o.toString(),10)],i));this.columns=Math.max(s-1,0|this.columns)}return this.matrix},Ma.prototype.columnsCount=function(e,t){for(var i=e,n=t,r=0;r<i.length;r++)i[parseInt(r.toString(),10)].columns?n=this.columnsCount(i[parseInt(r.toString(),10)].columns,n):n++;return n},Ma.prototype.inValid=function(e){return 0===e||void 0===e};var Fa=Ma;function Ma(){this.matrix=[],this.current=[]}Pa.prototype.getTable=function(){return this.parent.getContentTable()},Pa.prototype.onKeyPress=function(e){if(/(Mac)/i.test(navigator.platform)&&e.metaKey)if("home"===e.action)e.action="ctrlHome";else if("end"===e.action)e.action="ctrlEnd";else if(-1!==["downArrow","upArrow","leftArrow","rightArrow"].indexOf(e.action))return;var t=this.keyActions[e.action],t=this.getCurrentFromAction(e.action,t,e.action in this.keyActions,e);if(t){if((-1<["tab","shiftTab"].indexOf(e.action)&&this.matrix.current||[]).toString()===t.toString()||this.parent.allowPaging&&!this.parent.pagerModule.pagerObj.checkPagerHasFocus()&&this.matrix.current[0]===this.matrix.rows&&("Batch"===this.parent.editSettings.mode&&this.parent.editSettings.allowAdding&&40===e.keyCode||40===e.keyCode)){if(t.toString()===[this.matrix.rows,this.matrix.columns].toString()||t.toString()===[0,0].toString()||this.matrix.current[0]===this.matrix.rows&&this.matrix.current.toString()===t.toString()||this.parent.allowGrouping&&this.parent.infiniteScrollSettings.enableCache&&t.toString()===[0,1].toString())return!1;t=this.editNextRow(t[0],t[1],e.action)}this.matrix.select(t[0],t[1])}},Pa.prototype.editNextRow=function(e,t,i){var n=this.parent,r=n.editSettings.allowNextRowEdit&&(n.isEdit||n.isLastCellPrimaryKey),s=n.getColumnIndexByField(n.getVisibleColumns()[0].field),o=this.getTable().rows[parseInt(e.toString(),10)],o=(n.editSettings.showAddNewRow&&o.classList.contains("e-addedrow")?o.querySelectorAll("td:not(.e-editcell)"):o.cells)[parseInt(t.toString(),10)];return"tab"===i&&r&&(e++,t=s+(this.getTable().rows[parseInt(e.toString(),10)].getElementsByClassName("e-indentcell").length+this.getTable().rows[parseInt(e.toString(),10)].getElementsByClassName("e-detailrowcollapse").length)),"shiftTab"===i&&r&&(e--,t=n.getColumnIndexByField(n.getVisibleColumns()[n.getVisibleColumns().length-1].field)),!o||o.classList.contains(b)||o.classList.contains("e-headercell")||o.classList.contains("e-groupcaption")||o.classList.contains("e-filterbarcell")?[e,t]:this.editNextRow(e,t,i)},Pa.prototype.getCurrentFromAction=function(e,t,i,n){if(void 0===t&&(t=[0,0]),!i&&!this.indexesByKey(e)||0===this.matrix.current.length)return null;if(!this.shouldFocusChange(n))return this.matrix.current;var i=this.indexesByKey(e)||this.matrix.current.concat(t),r=i[0],s=i[1],n=i[2],t=i[3];if(this.parent.allowGrouping&&!H.isNullOrUndefined(this.parent.groupSettings.columns)&&this.parent.groupSettings.columns.length&&this.parent.aggregates.length&&"enter"===e)for(var o=r;o<this.matrix.matrix.length;o++){var a=this.getTable().rows[o+1];if(a&&a.cells[parseInt(s.toString(),10)]&&a.cells[parseInt(s.toString(),10)].classList.contains("e-rowcell"))return[o+1,s];if(o===this.matrix.matrix.length-1)return[r,s]}return"ctrlEnd"!==e&&"end"!==e||(i=[this.matrix.matrix.length-1,this.matrix.matrix[this.matrix.matrix.length-1].length-1],"end"===e&&(i=[r,this.matrix.matrix[parseInt(r.toString(),10)].length-1]),r=(i=0===this.matrix.matrix[i[0]][i[1]]?au(this.matrix.matrix,i,!1):i)[0],s=i[1]+1),H.isNullOrUndefined(e)||(0<this.parent.frozenRows||0<this.parent.pinnedTopRowModels.length)&&"ctrlHome"===e&&r++,this.matrix.get(r,s,[n,t],e,this.validator(),this)},Pa.prototype.checkRowCellFocus=function(e){return!e.classList.contains(b)||e.classList.contains("e-focused")},Pa.prototype.onClick=function(e,t){var i,n,r,s,o,a=e.target,a=(a=(this.target=a).classList.contains(b)?a:H.closest(a,"td"))||H.closest(e.target,"td.e-detailrowcollapse")||H.closest(e.target,"td.e-detailrowexpand");return!(!(a=(a=H.closest(e.target,"td.e-detailcell")&&H.isNullOrUndefined(H.closest(H.closest(e.target,".e-grid"),"td.e-detailcell"))?null:a)&&H.closest(a,"table").classList.contains(Ds)?a:null)||(n=a.parentElement.rowIndex,n=[n=this.parent.editSettings.showAddNewRow&&I(a,"e-addedrow")?I(a,"e-addedrow").rowIndex:n,a.cellIndex],r=(s=this.matrix.current)[0],s=s[1],o=H.getValue((i=n[0])+"."+(n=n[1]),this.matrix.matrix),this.matrix.inValid(o))||!t&&r===i&&s===n&&this.checkRowCellFocus(a)&&!a.querySelector(".e-focus.e-checkbox")||!(I(e.target,b)||I(e.target,"e-groupcaption")||I(e.target,"e-recordpluscollapse")||I(e.target,"e-recordplusexpand")||I(e.target,"e-detailrowcollapse")||I(e.target,"e-detailrowexpand")||I(e.target,"e-templatecell")))&&void this.matrix.select(i,n)},Pa.prototype.getFocusInfo=function(){var e={},t=this.matrix.current,i=t[0],i=void 0===i?0:i,t=t[1],t=void 0===t?0:t,i=(this.matrix.current=[i,t],this.getTable().rows[parseInt(i.toString(),10)]);return e.element=H.isNullOrUndefined(i)?null:(this.parent.editSettings.showAddNewRow&&i.classList.contains("e-addedrow")?i.querySelectorAll("td:not(.e-editcell)"):i.cells)[parseInt(t.toString(),10)],e.element&&(e.elementToFocus=e.element.classList.contains("e-unboundcell")&&!(this.parent.editSettings.showAddNewRow&&e.element.classList.contains("e-unboundcell")&&I(e.element,"e-addedrow"))||e.element.classList.contains("e-detailcell")?e.element:this.getFocusable(e.element),e.elementToFocus=e.element.classList.contains("e-detailcell")&&e.element.querySelector(".e-childgrid")?e.element.querySelector(".e-childgrid"):e.elementToFocus,"Batch"===this.parent.editSettings.mode&&this.parent.isEdit&&"input"===e.elementToFocus.tagName.toLowerCase()&&e.elementToFocus.classList.contains("e-dropdownlist")&&(e.elementToFocus=e.elementToFocus.parentElement),e.outline=!0,e.uid=e.element.parentElement.getAttribute("data-uid")),e},Pa.prototype.getFocusable=function(e){var t='button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])',i=!H.isNullOrUndefined(H.closest(e,".e-templatecell")),t=(this.parent.isEdit&&(t='input:not([type="hidden"]), select:not([aria-hidden="true"]), textarea'+(this.parent.editSettings.showAddNewRow&&I(e,"e-addedrow")?", button:not(.e-hide)":"")),[].slice.call(e.querySelectorAll(t)));if(e.classList.contains("e-fltrtemp")){var n,r=[].slice.call(e.querySelectorAll(".e-fltrtemp-focus"));if("click"===this.focusType&&this.target&&this.target.classList.contains("e-fltrtemp-focus"))return this.target;if("key"===this.focusType&&r.length&&("tab"===this.action||"shiftTab"===this.action))return-1===(n=r.indexOf(this.currentTarget))?r["tab"===this.action?0:r.length-1]:r["tab"===this.action?n+1:n-1]}return t.length?i&&1<t.length&&("Batch"!==this.parent.editSettings.mode&&"Cell"!==this.parent.editSettings.mode||!this.parent.isEdit||!this.target)?this.target||e:t[0]:e},Pa.prototype.selector=function(e,t,i){var n=[oe.CellType.Expand,oe.CellType.GroupCaption,oe.CellType.CaptionSummary,oe.CellType.GroupSummary];return(e.isDataRow&&t.visible&&(t.isDataCell||t.isTemplate)||e.isDataRow&&t.cellType===oe.CellType.DetailExpand&&H.isNullOrUndefined(t.visible)||!e.isDataRow&&-1<n.indexOf(t.cellType)&&!!(t.cellType!==oe.CellType.GroupSummary&&t.cellType!==oe.CellType.CaptionSummary||t.isDataCell&&t.visible)||t.column&&t.visible&&"checkbox"===t.column.type||t.cellType===oe.CellType.CommandColumn||e.isDataRow&&i)&&!("delete"===e.edit&&e.isDirty)},Pa.prototype.nextRowFocusValidate=function(e){for(var t=e,i=e,n=this.matrix.rows;i<=n;i++){if(-1!==this.matrix.matrix[parseInt(e.toString(),10)].indexOf(1))return e;e+=1}return this.lastIdxCell=!0,t},Pa.prototype.previousRowFocusValidate=function(e){for(var t=e,i=e;0<=i;i--){if(-1!==this.matrix.matrix[parseInt(e.toString(),10)].indexOf(1))return e;if((e-=1)<0)return this.lastIdxCell=!0,t}return t},Pa.prototype.jump=function(e,t){this.lastIdxCell=!1;var i=0!==this.parent.frozenRows&&"shiftEnter"===e,n=("upArrow"===e||i)&&0===t[0],r=(this.matrix.matrix[t[0]]&&"tab"===e&&this.matrix.matrix.length&&t[1]===this.matrix.matrix[t[0]].lastIndexOf(1)&&this.matrix.matrix.length-1!==t[0]&&(this.matrix.current[0]=this.nextRowFocusValidate(this.matrix.current[0]+1),this.matrix.current[1]=-1),"shiftTab"===e&&0!==t[0]&&this.matrix.matrix[t[0]].indexOf(1)===t[1]&&(this.matrix.current[0]=this.previousRowFocusValidate(this.matrix.current[0]-1),this.matrix.current[1]=this.matrix.matrix[t[0]].length),!1),s=I(document.activeElement,"e-addedrow")&&this.parent.editSettings.showAddNewRow?I(document.activeElement,"e-addedrow"):document.activeElement.parentElement;return{swap:!(r=(this.parent.enableVirtualization||this.parent.infiniteScrollSettings.enableCache)&&!H.isNullOrUndefined(s)&&s.classList.contains(Ts)?0<parseInt(s.getAttribute(D),10)-1:r)&&("upArrow"===e||i)&&0===t[0],toHeader:n}},Pa.prototype.getNextCurrent=function(e,t,i,n){void 0===e&&(e=[]);var r=[];return"rightArrow"!==n&&"tab"!==n||(r[0]=e[0],r[1]=-1),"downArrow"!==n&&"enter"!==n||(r[0]=-1,r[1]=e[1]),r},Pa.prototype.generateRows=function(e,t){var i=t.matrix,t=t.handlerInstance,n=t.matrix.matrix.length,n=this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type?n+1:n;t.matrix.matrix=t.matrix.matrix.slice(0,n),t.matrix.rows=n,(n=t.matrix.matrix).push.apply(n,i),t.matrix.rows+=i.length},Pa.prototype.getInfo=function(e){var t=this.getFocusInfo(),i=this.matrix.current,n=i[0],i=i[1],r=t.element.classList.contains(b),s=r||e&&"enter"!==e.action&&(t.element.classList.contains("e-detailrowcollapse")||t.element.classList.contains("e-detailrowexpand")),o=[Math.min(parseInt(t.element.parentElement.getAttribute(D),10)-1,n),Math.min(parseInt(t.element.getAttribute(zs),10)-1,i)],a=o[0],o=o[1];return this.parent.allowGrouping&&this.parent.groupSettings.enableLazyLoading&&r&&(a=this.parent.getDataRows().indexOf(t.element.parentElement)),this.parent.enableVirtualization&&this.parent.groupSettings.columns.length&&(a=n,o=i),this.parent.editSettings.showAddNewRow&&"Top"===this.parent.editSettings.newRowPosition&&!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling&&e&&"downArrow"===e.action&&a++,{isContent:!0,isDataCell:r,indexes:[a,o],isSelectable:s}},Pa.prototype.validator=function(){var r=this.getTable();return function(e,t,i){if(!H.isNullOrUndefined(r.rows[parseInt(e.toString(),10)])){var n=void 0,e=(t=r.querySelector(".e-emptyrow")?0:t,0!==(n=(r.rows[parseInt(e.toString(),10)].cells[0].classList.contains("e-editcell")?r.rows[parseInt(e.toString(),10)].cells[0].querySelectorAll("td"):r.rows[parseInt(e.toString(),10)].cells)[parseInt(t.toString(),10)]).getBoundingClientRect().width);if("enter"===i||"shiftEnter"===i)return e&&n.classList.contains(b);if(("shiftUp"===i||"shiftDown"===i)&&n.classList.contains(b))return e;if("shiftUp"!==i&&"shiftDown"!==i)return e}return!1}},Pa.prototype.shouldFocusChange=function(e){var t=this.matrix.current,i=t[0],i=void 0===i?-1:i,t=t[1],t=void 0===t?-1:t;return i<0||t<0||!(i=H.getValue(i+".cells."+t,this.getTable().rows))||"enter"!==e.action&&"shiftEnter"!==e.action||i.classList.contains(b)&&!i.classList.contains("e-unboundcell")||i.classList.contains("e-editedbatchcell")&&!i.classList.contains("e-detailcell")},Pa.prototype.getGridSeletion=function(){return this.parent.allowSelection&&this.parent.selectionSettings.allowColumnSelection};var ka=Pa;function Pa(e){var t=this;this.matrix=new Fa,this.lastIdxCell=!1,this.parent=e,this.keyActions={rightArrow:[0,1],tab:[0,1],leftArrow:[0,-1],shiftTab:[0,-1],upArrow:[-1,0],downArrow:[1,0],shiftUp:[-1,0],shiftDown:[1,0],shiftRight:[0,1],shiftLeft:[0,-1],enter:[1,0],shiftEnter:[-1,0]},this.indexesByKey=function(e){return{home:[t.matrix.current[0],-1,0,1],end:[t.matrix.current[0],t.matrix.columns+1,0,-1],ctrlHome:[0,-1,0,1],ctrlEnd:[t.matrix.rows,t.matrix.columns+1,0,-1]}[""+e]||null}}t(Ba,La=ka),Ba.prototype.getTable=function(){return this.parent.getHeaderTable()},Ba.prototype.onClick=function(e){this.focusType="click";var t=e.target,t=(this.target=t).classList.contains("e-headercell")?t:H.closest(t,"th");if(e.target&&e.target.classList.contains("e-gridheader")&&(e.preventDefault(),t=this.parent.element,this.parent.element.focus()),!t&&(0!==this.parent.frozenRows||0!==this.parent.pinnedTopRecords.length||(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow)&&(t=e.target.classList.contains(b)?e.target:H.closest(e.target,"td")),e.target.classList.contains("e-columnheader")||e.target.querySelector(".e-stackedheadercell"))return!1;if(t){var e=t.parentElement.rowIndex,i=[e=this.parent.editSettings.showAddNewRow&&I(t,"e-addedrow")?I(t,"e-addedrow").rowIndex:e,t.cellIndex],i=H.getValue(i[0]+"."+i[1],this.matrix.matrix);if(this.matrix.inValid(i))return!1;this.matrix.select(e,t.cellIndex)}},Ba.prototype.getFocusInfo=function(){var e={},t=this.matrix.current,i=t[0],i=void 0===i?0:i,t=t[1],t=void 0===t?0:t,i=this.getTable().rows[parseInt(i.toString(),10)];return e.element=H.isNullOrUndefined(i)?null:(this.parent.editSettings.showAddNewRow&&i.classList.contains("e-addedrow")?i.querySelectorAll("td:not(.e-editcell)"):i.cells)[parseInt(t.toString(),10)],H.isNullOrUndefined(e.element)||(e.elementToFocus=e.element.classList.contains("e-unboundcell")?e.element:this.getFocusable(e.element),e.outline=!e.element.classList.contains("e-filterbarcell")),e},Ba.prototype.selector=function(e,t){return t.visible&&(void 0!==t.column.field||t.isTemplate||!H.isNullOrUndefined(t.column.template)||!H.isNullOrUndefined(t.column.commands)||"checkbox"===t.column.type)||t.cellType===oe.CellType.StackedHeader},Ba.prototype.jump=function(e,t){var i,n,r=0!==this.parent.frozenRows&&"enter"===e;return this.parent.enableHeaderFocus&&"tab"===e&&(n=this.matrix.matrix.length-1===t[0],i=t[1]===this.matrix.matrix[t[0]].lastIndexOf(1))&&(this.matrix.current[0]=n?0:this.matrix.current[0]+1,this.matrix.current[1]=-1),{swap:("downArrow"===e||r)&&t[0]===this.matrix.matrix.length-1||"tab"===e&&n&&i}},Ba.prototype.getNextCurrent=function(e,t,i,n){void 0===e&&(e=[]);var r=[];return("rightArrow"===n||"shiftRight"===n&&this.getGridSeletion()||"tab"===n)&&(r[0]=e[0],r[1]=-1),"upArrow"!==n&&"shiftEnter"!==n||(r[0]=this.matrix.matrix.length,r[1]=e[1]),r},Ba.prototype.generateRows=function(e){var t=this.matrix.matrix.length;if(this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type){this.matrix.rows=++this.matrix.rows;for(var i=e[0].cells,n=0,r=0;r<i.length;r++)i[parseInt(r.toString(),10)].column&&i[parseInt(r.toString(),10)].column.columns?n=this.checkFilterColumn(i[parseInt(r.toString(),10)].column.columns,t,n):(this.matrix.set(t,n,i[parseInt(r.toString(),10)].visible&&!1!==i[parseInt(r.toString(),10)].column.allowFiltering),n++)}},Ba.prototype.checkFilterColumn=function(e,t,i){for(var n=e,r=i,s=0;s<n.length;s++)n[parseInt(s.toString(),10)].columns?r=this.checkFilterColumn(n[parseInt(s.toString(),10)].columns,t,r):(this.matrix.set(t,r,n[parseInt(s.toString(),10)].visible&&!1!==n[parseInt(s.toString(),10)].allowFiltering),r++);return r},Ba.prototype.getInfo=function(e){return H.extend(La.prototype.getInfo.call(this,e),{isContent:!1,isHeader:!0})},Ba.prototype.validator=function(){return function(){return!0}},Ba.prototype.shouldFocusChange=function(e){var t=this.matrix.current,i=t[0],t=t[1];return i<0||t<0||!(i=H.getValue(i+".cells."+t,this.getTable().rows))||"enter"!==e.action&&"altDownArrow"!==e.action||!i.classList.contains("e-headercell")},Ba.prototype.getHeaderType=function(){return"HeaderFocus"};var La,Na=Ba;function Ba(e){return La.call(this,e)||this}qa.prototype.searchFocus=function(e){e.target.parentElement.classList.add("e-input-focus"),e.target.classList.contains("e-input")&&e.target.classList.contains("e-search")&&e.target.value&&((e=e.target.parentElement.querySelector(".e-sicon")).classList.add("e-clear-icon"),e.setAttribute("title",this.l10n.getConstant("Clear")),e.style.cursor="pointer")},qa.prototype.searchBlur=function(e){var t=e.relatedTarget||null;t&&t.classList.contains("e-sicon")&&!t.classList.contains("e-clear-icon")||e.target.parentElement.classList.remove("e-input-focus"),e.target.classList.contains("e-search")&&(t&&!t.classList.contains("e-sicon e-clear-icon")&&!t.classList.contains("e-sicon")||H.isNullOrUndefined(t))&&((t=e.target.parentElement.querySelector(".e-sicon")).classList.remove("e-clear-icon"),t.removeAttribute("title"),t.style.cursor="default")},qa.prototype.wireEvent=function(){this.searchBox&&(H.EventHandler.add(this.searchBox,"focus",this.searchFocus,this),H.EventHandler.add(this.searchBox,"blur",this.searchBlur,this))},qa.prototype.unWireEvent=function(){this.searchBox&&(H.EventHandler.remove(this.searchBox,"focus",this.searchFocus),H.EventHandler.remove(this.searchBox,"blur",this.searchBlur))};var za=qa;function qa(e,t){this.searchBox=e,this.serviceLocator=t,this.l10n=this.serviceLocator.getService("localization")}Ua=function(e,t){return(Ua=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Ua,Ha,t=function(e,t){function i(){this.constructor=e}Ua(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Va=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(o=(s<3?r(o):3<s?r(t,i,o):r(t,i))||o);return 3<s&&o&&Object.defineProperty(t,i,o),o},t=(Ha=H.ChildProperty,t(ja,Ha),Va([H.Property(12)],ja.prototype,"pageSize",void 0),Va([H.Property(8)],ja.prototype,"pageCount",void 0),Va([H.Property(1)],ja.prototype,"currentPage",void 0),Va([H.Property()],ja.prototype,"totalRecordsCount",void 0),Va([H.Property(!1)],ja.prototype,"enableQueryString",void 0),Va([H.Property(!1)],ja.prototype,"pageSizes",void 0),Va([H.Property(null)],ja.prototype,"template",void 0),ja);function ja(){return null!==Ha&&Ha.apply(this,arguments)||this}Ga=function(e,t){return(Ga=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Ga,_a,Va=function(e,t){function i(){this.constructor=e}Ga(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ka=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(o=(s<3?r(o):3<s?r(t,i,o):r(t,i))||o);return 3<s&&o&&Object.defineProperty(t,i,o),o},Va=(_a=H.ChildProperty,Va(Wa,_a),Ka([H.Property("startsWith")],Wa.prototype,"operator",void 0),Ka([H.Property(!1)],Wa.prototype,"ignoreAccent",void 0),Ka([H.Property(null)],Wa.prototype,"headerTemplate",void 0),Ka([H.Property(null)],Wa.prototype,"template",void 0),Ka([H.Property(null)],Wa.prototype,"footerTemplate",void 0),Ka([H.Property(!0)],Wa.prototype,"enableSearching",void 0),Ka([H.Property(null)],Wa.prototype,"renderCustomColumnChooser",void 0),Ka([H.Property("Default")],Wa.prototype,"mode",void 0),Ka([H.Property(0)],Wa.prototype,"immediateModeDelay",void 0),Ka([H.Property(!1)],Wa.prototype,"allowReordering",void 0),Wa);function Wa(){return null!==_a&&_a.apply(this,arguments)||this}Qa=function(e,t){return(Qa=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Qa,Xa,Ka=function(e,t){function i(){this.constructor=e}Qa(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ya=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(o=(s<3?r(o):3<s?r(t,i,o):r(t,i))||o);return 3<s&&o&&Object.defineProperty(t,i,o),o},Ka=(Xa=H.ChildProperty,Ka($a,Xa),Ya([H.Property(500)],$a.prototype,"flashDuration",void 0),Ya([H.Property(1e3)],$a.prototype,"fadeDuration",void 0),Ya([H.Property("")],$a.prototype,"color",void 0),$a);function $a(){return null!==Xa&&Xa.apply(this,arguments)||this}Za=function(e,t){return(Za=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Za,Ja,Ya=function(e,t){function i(){this.constructor=e}Za(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},el=((hl=oe.FormulaErrorCode||(oe.FormulaErrorCode={})).PARSE="#PARSE!",hl.REF="#REF!",hl.NAME="#NAME?",hl.CIRCREF="#CIRCREF!",hl.VALUE="#VALUE!",hl.DIVZERO="#DIV/0!",hl.ERROR="#ERROR!",Ja=Error,Ya(tl,Ja),tl.prototype.toString=function(){return this.code},tl);function tl(e,t){t=Ja.call(this,t)||this;return t.code=e,t.name="FormulaError",Object.setPrototypeOf(t,tl.prototype),t}Ya(rl,il=el);var il,nl=rl;function rl(e,t){e=il.call(this,oe.FormulaErrorCode.PARSE,"Parse error: "+e)||this;return e.position=t,e.name="ParseError",e}Ya(al,sl=el);var sl,ol=al;function al(e){e=sl.call(this,oe.FormulaErrorCode.REF,"Reference error: "+e)||this;return e.name="ReferenceError",e}Ya(dl,ll=el);var ll,hl=dl;function dl(e){e=ll.call(this,oe.FormulaErrorCode.CIRCREF,"Circular reference: "+e)||this;return e.name="CycleError",e}Ya(ul,pl=el);var pl,cl=ul;function ul(e){e=pl.call(this,oe.FormulaErrorCode.DIVZERO,e=void 0===e?"Division by zero":e)||this;return e.name="DivideByZeroError",e}Ya(ml,gl=el);var gl,fl=ml;function ml(e){e=gl.call(this,oe.FormulaErrorCode.VALUE,"Type error: "+e)||this;return e.name="TypeMismatchError",e}Ya(Sl,yl=el);var yl,vl=Sl;function Sl(e){e=yl.call(this,oe.FormulaErrorCode.NAME,"Unknown function: "+e)||this;return e.name="UnknownFunctionError",e}function Cl(){}Ya(Il,wl=Cl),Il.prototype.accept=function(e){return e.visitLiteral(this)};var wl,bl=Il;function Il(e){var t=wl.call(this)||this;return t.value=e,t}Ya(Dl,Rl=Cl),Dl.prototype.accept=function(e){return e.visitCellRef(this)};var Rl,xl=Dl;function Dl(e,t){void 0===t&&(t={col:!1,row:!1});var i=Rl.call(this)||this;return i.ref=e,i.isAbsolute=t,i}Ya(Ol,Tl=Cl),Ol.prototype.accept=function(e){return e.visitRangeRef(this)};var Tl,El=Ol;function Ol(e,t){var i=Tl.call(this)||this;return i.start=e,i.end=t,i}Ya(Ml,Al=Cl),Ml.prototype.accept=function(e){return e.visitBinaryOp(this)};var Al,Fl=Ml;function Ml(e,t,i){var n=Al.call(this)||this;return n.operator=e,n.left=t,n.right=i,n}Ya(Ll,kl=Cl),Ll.prototype.accept=function(e){return e.visitUnaryOperator(this)};var kl,Pl=Ll;function Ll(e,t){var i=kl.call(this)||this;return i.operator=e,i.operand=t,i}Ya(zl,Nl=Cl),zl.prototype.accept=function(e){return e.visitFunctionCall(this)};var Nl,Bl=zl;function zl(e,t){var i=Nl.call(this)||this;return i.name=e,i.args=t,i}Ul.prototype.tokenize=function(e){for(this.formula=e,this.position=0,this.tokens=[],"="===this.peek()&&(this.tokens.push({type:"equals",value:"=",position:0}),this.advance());this.position<this.formula.length;){var t=this.peek();if(this.isWhitespace(t))this.advance();else if(this.isOperator(t)||this.isComparisonOperator(t))this.parseOperator();else if(this.isDelimiter(t))this.parseDelimiter();else if(this.isDigit(t))this.parseNumber();else if('"'===t)this.parseStringLiteral();else{if(!this.isReferenceStart(t))throw new nl("Unexpected character: '"+t+"'",this.position);this.parseReferenceOrFunction()}}return this.tokens},Ul.prototype.parseOperator=function(){var e=this.position,t=this.peek(),i=this.peekNext();"="===i?(this.advance(),this.advance(),this.tokens.push({type:"comparison",value:t+i,position:e})):"<"===t&&">"===i?(this.advance(),this.advance(),this.tokens.push({type:"comparison",value:"<>",position:e})):(this.advance(),i=this.isComparisonOperator(t)?"comparison":"operator",this.tokens.push({type:i,value:t,position:e}))},Ul.prototype.parseDelimiter=function(){var e=this.position;this.tokens.push({type:"delimiter",value:this.peek(),position:e}),this.advance()},Ul.prototype.parseNumber=function(){for(var e=this.position,t="";this.position<this.formula.length;){var i=this.peek();if(!this.isDigit(i)&&"."!==i)break;t+=i,this.advance()}if(this.position<this.formula.length&&("e"===(i=this.peek())||"E"===i))for(t+=i,this.advance(),this.position<this.formula.length&&("+"!==(i=this.peek())&&"-"!==i||(t+=i,this.advance()));this.position<this.formula.length&&(i=this.peek(),this.isDigit(i));)t+=i,this.advance();var n=parseFloat(t);if(isNaN(n))throw new nl("Invalid number: "+t,e);this.tokens.push({type:"number",value:n,position:e})},Ul.prototype.parseStringLiteral=function(){var e=this.position,t="";for(this.advance();this.position<this.formula.length;){var i=this.peek();if('"'===i)break;"\\"===i&&'"'===this.peekNext()?(t+='"',this.advance(),this.advance()):(t+=i,this.advance())}if(this.position>=this.formula.length)throw new nl("Unterminated string literal",e);this.advance(),this.tokens.push({type:"string",value:t,position:e})},Ul.prototype.parseReferenceOrFunction=function(){var e=this.position,t="";for("$"===this.peek()&&(t+="$",this.advance());this.position<this.formula.length&&this.isLetter(this.peek());)t+=this.peek(),this.advance();for("$"===this.peek()&&(t+="$",this.advance());this.position<this.formula.length&&this.isDigit(this.peek());)t+=this.peek(),this.advance();var i=t.toUpperCase();if("("===this.peek()||/^[A-Za-z]+$/.test(t))this.tokens.push({type:"function",value:i,position:e});else{if(!/^\$?[A-Za-z]+\$?[0-9]+$/.test(t))throw new nl("Invalid reference: "+t,e);this.tokens.push({type:"reference",value:i,position:e})}},Ul.prototype.isOperator=function(e){return/[+\-*/%^×÷]/.test(e)},Ul.prototype.isComparisonOperator=function(e){return/[<>=]/.test(e)},Ul.prototype.isDelimiter=function(e){return/[(),:]/.test(e)},Ul.prototype.isDigit=function(e){return/[0-9]/.test(e)},Ul.prototype.isLetter=function(e){return/[a-zA-Z]/.test(e)},Ul.prototype.isWhitespace=function(e){return/\s/.test(e)},Ul.prototype.isReferenceStart=function(e){return this.isLetter(e)||"$"===e},Ul.prototype.peek=function(){return this.position<this.formula.length?this.formula[this.position]:"\0"},Ul.prototype.peekNext=function(){return this.position+1<this.formula.length?this.formula[this.position+1]:"\0"},Ul.prototype.advance=function(){this.position++};var ql=Ul;function Ul(){this.formula="",this.position=0,this.tokens=[]}Vl.parseReference=function(e){if(!e.trim())throw new ol("Invalid reference: must be non-empty string");for(var t=e.trim().toUpperCase(),i=0,n="$"===t[parseInt(i.toString(),10)]&&(i++,!0),r="";i<t.length&&/[A-Z]/.test(t[parseInt(i.toString(),10)]);)r+=t[i++];if(!r)throw new ol('Invalid reference "'+e+'": missing column letters');for(var s="$"===t[parseInt(i.toString(),10)]&&(i++,!0),o="";i<t.length&&/[0-9]/.test(t[parseInt(i.toString(),10)]);)o+=t[i++];if(!o||i!==t.length)throw new ol('Invalid reference "'+e+'": invalid format. Use A1, B2, $C$3, etc.');var a=parseInt(o,10);if(a<=0)throw new ol('Invalid reference "'+e+'": row must be positive');for(var l=0,h=0,d=r;h<d.length;h++)l=26*l+(d[h].charCodeAt(0)-64);return{col:l-1,row:a-1,isAbsolute:{col:n,row:s}}},Vl.convertIndexToReference=function(e,t){t=parseInt(t.toString(),10);if(e<0||t<0)throw new ol("Invalid indices: col="+e+", row="+t);for(var i="",n=e+1;0<n;)n--,i=String.fromCharCode(65+n%26)+i,n=Math.floor(n/26);return""+i+(t+1)},Vl.adjustReferences=function(e,a,l){var h=this;return e&&e.replace(/REF\(COLUMN\((['"])([^'")]+)\1\),ROW\((\d+)\)\)/gi,function(e,t,i,n){return"REF(COLUMN("+t+i+t+"),ROW("+(parseInt(n,10)+a)+"))"}).replace(/(\$?[A-Z]+\$?\d+:\$?[A-Z]+\$?\d+)|(\$?[A-Z]+\$?\d+)/gi,function(e){var t,i,n,r,s,o;return e.includes(":")?(r=(t=e.split(":"))[0],t=t[1],r=h.parseReference(r),t=h.parseReference(t),s=r.isAbsolute.col?r.col:r.col+l,o=r.isAbsolute.row?r.row:r.row+a,i=t.isAbsolute.col?t.col:t.col+l,n=t.isAbsolute.row?t.row:t.row+a,h.buildReference(r,s,o)+":"+h.buildReference(t,i,n)):(s=(r=h.parseReference(e)).isAbsolute.col?r.col:r.col+l,o=r.isAbsolute.row?r.row:r.row+a,h.buildReference(r,s,o))})},Vl.buildReference=function(e,t,i){t=this.convertIndexToReference(t,i).match(/^([A-Z]+)(\d+)$/);return(e.isAbsolute.col?"$":"")+t[1]+(e.isAbsolute.row?"$":"")+t[2]};var Hl=Vl;function Vl(){}Gl.prototype.parse=function(e){var t=new ql,t=(this.tokens=t.tokenize(e),this.position=0,this.position<this.tokens.length&&"equals"===this.tokens[this.position].type&&this.advance(),this.parseExpression());if(this.position<this.tokens.length)throw new nl("Unexpected token after expression: "+this.tokens[this.position].value);return t},Gl.prototype.parseExpression=function(){return this.parseRange()},Gl.prototype.parseRange=function(){var e=this.parseComparison();return this.match(":")?new El(e,this.parseComparison()):e},Gl.prototype.parseComparison=function(){for(var e=this.parseAdditive();this.check("comparison");)var t=this.advance().value,e=new Fl(t,e,this.parseAdditive());return e},Gl.prototype.parseAdditive=function(){for(var e=this.parseMultiplicative();this.match("+","-");)var t=this.previous().value,e=new Fl(t,e,this.parseMultiplicative());return e},Gl.prototype.parseMultiplicative=function(){for(var e=this.parseExponentiation();this.match("*","/","%","×","÷");)var t=this.previous().value,e=new Fl(t,e,this.parseExponentiation());return e},Gl.prototype.parseExponentiation=function(){var e=this.parseUnary();return this.match("^")?new Fl("^",e,this.parseExponentiation()):e},Gl.prototype.parseUnary=function(){var e;return this.match("+","-")?(e=this.previous().value,new Pl(e,this.parseUnary())):this.parsePrimary()},Gl.prototype.parsePrimary=function(){if(this.check("number"))return new bl(this.advance().value);if(this.check("string"))return new bl(this.advance().value);if(this.match("(")){var e=this.parseExpression();if(this.match(")"))return e;throw new nl('Expected ")" after expression',this.position)}if(this.check("reference")||this.check("function"))return this.parseReferenceOrFunction();throw new nl("Unexpected token: "+this.peek().value,this.position)},Gl.prototype.parseReferenceOrFunction=function(){var e=this.advance().value;if(!this.match("("))return this.convertReferenceToNode(e);var t=[];if(!this.check(")"))for(;t.push(this.parseExpression()),this.match(","););if(this.match(")"))return new Bl(e,t);throw new nl('Expected ")" after function arguments',this.position)},Gl.prototype.convertReferenceToNode=function(e){var t;if(/[A-Za-z]/.test(e)&&/[0-9]/.test(e))return t=Hl.parseReference(e),new xl(e.toUpperCase(),t.isAbsolute);throw new nl('Invalid cell reference: "'+e+'". Use A1, B2, $C$3, etc.',this.position)},Gl.prototype.match=function(){for(var t=this,e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];return e.some(function(e){return t.check(e)&&(t.advance(),!0)})},Gl.prototype.check=function(e){return!this.isAtEnd()&&(this.peek().type===e||this.peek().value===e)},Gl.prototype.advance=function(){return this.isAtEnd()||this.position++,this.previous()},Gl.prototype.isAtEnd=function(){return this.position>=this.tokens.length},Gl.prototype.peek=function(){return this.tokens[this.position]},Gl.prototype.previous=function(){return this.tokens[this.position-1]};var jl=Gl;function Gl(){this.tokens=[],this.position=0}Kl.prototype.addDependency=function(e,t){var i=this.graph.get(e);i||(i=new Set,this.graph.set(e,i)),i.add(t)},Kl.prototype.removeDependency=function(e,t){var i=this.graph.get(e);i&&(i.delete(t),0===i.size)&&this.graph.delete(e)},Kl.prototype.clear=function(){this.graph.clear()},Kl.prototype.detectCycles=function(){var i=this,n=new Map,r=new Set;return this.graph.forEach(function(e,t){n.has(t)||i.hasCycleFromNode(t,n,r)}),r},Kl.prototype.hasCycleFromNode=function(t,i,n){var r=this,e=(i.set(t,1),this.graph.get(t));if(e){var s=!1;if(e.forEach(function(e){s||(i.has(e)?1===i.get(e)&&(n.add(t),n.add(e),s=!0):r.hasCycleFromNode(e,i,n)&&(n.add(t),s=!0))}),s)return!0}return i.set(t,2),!1};var _l=Kl;function Kl(){this.graph=new Map}Ql.prototype.setFormulaEngine=function(e){this.formulaEngine=e},Ql.prototype.evaluate=function(e,t){this.context=t;var i,n=e.accept(this);return this.isFormulaReferenceValue(n)?(i=n.value,this.isFormulaReferenceValue(i)?this.evaluate(e,t):i):n},Ql.prototype.resolveReferenceNode=function(e){return e instanceof xl||(e=e.accept(this),this.isFormulaReferenceValue(e))?e.ref:this.convertToReference(e)},Ql.prototype.visitLiteral=function(e){return e.value},Ql.prototype.visitCellRef=function(e){return this.context.getCell(e.ref)},Ql.prototype.visitRangeRef=function(e){var t=this.resolveReferenceNode(e.start),e=this.resolveReferenceNode(e.end);return this.context.getRange(t,e)},Ql.prototype.visitBinaryOp=function(e){var t=e.left.accept(this),i=e.right.accept(this);switch(e.operator){case"+":return this.convertToNumber(t)+this.convertToNumber(i);case"-":return this.convertToNumber(t)-this.convertToNumber(i);case"*":case"×":return this.convertToNumber(t)*this.convertToNumber(i);case"/":case"÷":var n=this.convertToNumber(i);if(0===n)throw new cl;return this.convertToNumber(t)/n;case"%":return this.convertToNumber(t)%this.convertToNumber(i);case"^":return Math.pow(this.convertToNumber(t),this.convertToNumber(i));case">":return this.convertToNumber(t)>this.convertToNumber(i)?1:0;case"<":return this.convertToNumber(t)<this.convertToNumber(i)?1:0;case">=":return this.convertToNumber(t)>=this.convertToNumber(i)?1:0;case"<=":return this.convertToNumber(t)<=this.convertToNumber(i)?1:0;case"=":return this.convertToNumber(t)===this.convertToNumber(i)?1:0;case"<>":return this.convertToNumber(t)!==this.convertToNumber(i)?1:0;default:throw new el(oe.FormulaErrorCode.ERROR,"Unknown operator: "+e.operator)}},Ql.prototype.visitUnaryOperator=function(e){var t=e.operand.accept(this);switch(e.operator){case"+":return this.convertToNumber(t);case"-":return-this.convertToNumber(t);default:throw new el(oe.FormulaErrorCode.ERROR,"Unknown unary operator: "+e.operator)}},Ql.prototype.visitFunctionCall=function(e){var t=e.name.toUpperCase(),N=new Set(["SUM","AVERAGE","COUNT","MIN","MAX","IF","ABS","ROUND","PRODUCT","CONCAT","CONCATENATE","COUNTA","COUNTBLANK","COUNTIF","MEDIAN","SUMIF","RAN","RAND","RANDOM","TODAY","NOW","MOD","POWER","SQRT"]);if(this.formulaEngine.parent&&this.formulaEngine.parent.formulaSettings&&!1===this.formulaEngine.parent.formulaSettings.allowBuiltInFunctions&&N.has(t))throw new vl(t);switch(t){case"SUM":for(var i=0,n=0,r=e.args;n<r.length;n++){var s=(l=r[n]).accept(this);i+=this.convertToNumber(s)}return i;case"AVERAGE":for(var i=0,o=0,a=0,B=e.args;a<B.length;a++)for(var l=B[a],h=0,z=this.extractValues(l.accept(this));h<z.length;h++){s=z[h];i+=this.convertToNumber(s),o++}return 0<o?i/o:0;case"COUNT":for(var o=0,d=0,q=e.args;d<q.length;d++)for(var l=q[d],p=0,U=this.extractValues(l.accept(this));p<U.length;p++){s=U[p];void 0!==this.tryParseNumber(s)&&o++}return o;case"MIN":for(var c=1/0,u=0,H=e.args;u<H.length;u++)for(var l=H[u],g=0,V=this.extractValues(l.accept(this));g<V.length;g++)s=V[g],c=Math.min(c,this.convertToNumber(s));return c===1/0?0:c;case"MAX":for(var f=-1/0,m=0,j=e.args;m<j.length;m++)for(var l=j[m],y=0,G=this.extractValues(l.accept(this));y<G.length;y++)s=G[y],f=Math.max(f,this.convertToNumber(s));return f===-1/0?0:f;case"IF":if(e.args.length<3)throw new el(oe.FormulaErrorCode.ERROR,"IF requires 3 arguments: condition, true_value, false_value");return(this.convertToBoolean(e.args[0].accept(this))?e.args[1]:e.args[2]).accept(this);case"REF":if(e.args.length<2)throw new el(oe.FormulaErrorCode.ERROR,"REF requires 2 arguments: column reference and row number");var v=e.args[0].accept(this),S=e.args[1].accept(this);if("string"==typeof v){var C=this.context.getRowData(S);if(C&&v in C&&void 0!==C[v]){C=this.context.getFieldReference(v,S);if(C)return{__isFormulaRefValue:!0,ref:C,value:this.context.getCell(C)}}}throw new ol("Cannot resolve REF("+v+", "+S+")");case"COLUMN":if(e.args.length<1||e.args[0]instanceof bl==!1)throw new el(oe.FormulaErrorCode.ERROR,"COLUMN requires a field name string argument");return e.args[0].accept(this);case"ROW":if(e.args.length<1)throw new el(oe.FormulaErrorCode.ERROR,"ROW requires a row number argument");return e.args[0].accept(this);case"ABS":if(e.args.length<1)throw new el(oe.FormulaErrorCode.ERROR,"ABS requires 1 argument");return Math.abs(this.convertToNumber(e.args[0].accept(this)));case"ROUND":if(e.args.length<1)throw new el(oe.FormulaErrorCode.ERROR,"ROUND requires at least 1 argument: value[, decimals]");var s=this.convertToNumber(e.args[0].accept(this)),C=1<e.args.length?this.convertToNumber(e.args[1].accept(this)):0;return Math.round(s*Math.pow(10,C))/Math.pow(10,C);case"PRODUCT":if(0===e.args.length)return 0;for(var _=1,w=0,K=e.args;w<K.length;w++)for(var l=K[w],b=0,W=this.extractValues(l.accept(this));b<W.length;b++){s=W[b];_*=this.convertToNumber(s)}return _;case"CONCAT":for(var Q=[],I=0,X=e.args;I<X.length;I++){var R=X[I];this.appendConcatenatedValue(R.accept(this),Q)}return Q.join("");case"COUNTA":for(var o=0,x=0,Y=e.args;x<Y.length;x++)for(var R=Y[x],D=0,$=this.extractValues(R.accept(this));D<$.length;D++)null!=(s=$[D])&&o++;return o;case"COUNTBLANK":for(var o=0,T=0,Z=e.args;T<Z.length;T++)for(var R=Z[T],E=0,J=this.extractValues(R.accept(this));E<J.length;E++)null!=(s=J[E])&&""!==s||o++;return o;case"COUNTIF":if(e.args.length<2)throw new el(oe.FormulaErrorCode.ERROR,"COUNTIF requires 2 arguments: range, criteria");for(var v=this.extractValues(e.args[0].accept(this)),ee=e.args[1].accept(this),o=0,O=0,te=v;O<te.length;O++){s=te[O];this.matchesCriteria(s,ee)&&o++}return o;case"MEDIAN":for(var A=[],F=0,ie=e.args;F<ie.length;F++)for(var l=ie[F],M=0,ne=this.extractValues(l.accept(this));M<ne.length;M++){s=ne[M];void 0!==(L=this.tryParseNumber(s))&&A.push(L)}if(0===A.length)return 0;A.sort(function(e,t){return e-t});S=Math.floor(A.length/2);return A.length%2==1?A[parseInt(S.toString(),10)]:(A[parseInt(S.toString(),10)-1]+A[parseInt(S.toString(),10)])/2;case"SUMIF":if(e.args.length<2)throw new el(oe.FormulaErrorCode.ERROR,"SUMIF requires 2 or 3 arguments: range, criteria[, sum_range]");for(var re,k=this.extractValues(e.args[0].accept(this)),ee=e.args[1].accept(this),se=2<e.args.length?this.extractValues(e.args[2].accept(this)):k,i=0,P=0;P<k.length;P++)this.matchesCriteria(k[P],ee)&&(re=P<se.length?se[P]:0,i+=this.convertToNumber(re));return i;case"RAND":return Math.random();case"TODAY":C=new Date;return new Date(C.getFullYear(),C.getMonth(),C.getDate());case"NOW":return new Date;case"MOD":if(e.args.length<2)throw new el(oe.FormulaErrorCode.ERROR,"MOD requires 2 arguments: dividend, divisor");v=e.args[0].accept(this),S=e.args[1].accept(this),C=this.convertToNumber(Array.isArray(v)&&0<v.length?v[0]:v),v=this.convertToNumber(Array.isArray(S)&&0<S.length?S[0]:S);if(0===v)throw new cl;return C-v*Math.floor(C/v);case"POWER":if(e.args.length<2)throw new el(oe.FormulaErrorCode.ERROR,"POWER requires 2 arguments: base, exponent");S=e.args[0].accept(this),C=e.args[1].accept(this),v=this.convertToNumber(Array.isArray(S)&&0<S.length?S[0]:S),S=this.convertToNumber(Array.isArray(C)&&0<C.length?C[0]:C);return Math.pow(v,S);case"SQRT":if(e.args.length<1)throw new el(oe.FormulaErrorCode.ERROR,"SQRT requires 1 argument");var L,s=e.args[0].accept(this);if((L=this.convertToNumber(Array.isArray(s)&&0<s.length?s[0]:s))<0)throw new el(oe.FormulaErrorCode.VALUE,"SQRT requires non-negative argument");return Math.sqrt(L);default:if(this.formulaEngine&&this.formulaEngine.isCustomFunction(t))return this.executeCustomFunction(e,t);throw new vl("Function not yet implemented: "+e.name)}},Ql.prototype.executeCustomFunction=function(e,t){if(!this.formulaEngine)throw new el(oe.FormulaErrorCode.ERROR,"Custom function engine not available for "+t);for(var i=[],n=0,r=e.args;n<r.length;n++){var s=r[n];i.push(s.accept(this))}for(var o=[],a=0,l=i;a<l.length;a++){var h,s=l[a];this.isFormulaReferenceValue(s)?(h=s.value,Array.isArray(h)?o.push.apply(o,h):null!=h&&o.push(h)):Array.isArray(s)?o.push.apply(o,s):null!=s&&o.push(s)}var e={values:o,args:i,context:this.context},d=this.formulaEngine.getCustomFunction(t);if(!d)throw new vl("Custom function not found: "+t);if(this.formulaEngine.parent.trigger("customFunctions",{name:t,params:e,result:void 0,error:void 0,requestType:"customFunctions"},function(e){if(e.cancel)throw new el(oe.FormulaErrorCode.ERROR,"Custom formula "+t+" was cancelled by event handler")}),"function"==typeof d)return d(e);if(d&&"function"==typeof d.func)return d.func(e);throw new el(oe.FormulaErrorCode.ERROR,"Custom function "+t+" is not callable")},Ql.prototype.isFormulaReferenceValue=function(e){return"object"==typeof e&&null!==e&&"__isFormulaRefValue"in e&&!0===e.__isFormulaRefValue},Ql.prototype.convertToNumber=function(e){var i=this;if(this.isFormulaReferenceValue(e))return this.convertToNumber(e.value);if("number"==typeof e)return e;if("boolean"==typeof e)return e?1:0;if(null==e)return 0;if("string"==typeof e){if(""===e)return 0;var t=parseFloat(e);if(isNaN(t))throw new fl('Cannot convert string to number: "'+e+'"');return t}if(Array.isArray(e))return e.reduce(function(e,t){return e+(i.tryParseNumber(t)||0)},0);throw new fl("Cannot convert "+typeof e+" to number")},Ql.prototype.convertToBoolean=function(e){return this.isFormulaReferenceValue(e)?this.convertToBoolean(e.value):"boolean"==typeof e?e:"number"==typeof e?0!==e:"string"==typeof e?0<e.length:null!=e&&(Array.isArray(e)?0<e.length:!!e)},Ql.prototype.extractValues=function(e){var i=this;return this.isFormulaReferenceValue(e)?this.extractValues(e.value):null!=e&&Array.isArray(e)?e.reduce(function(e,t){return e.concat(i.extractValues(t))},[]):[e]},Ql.prototype.appendConcatenatedValue=function(e,t){if(this.isFormulaReferenceValue(e))this.appendConcatenatedValue(e.value,t);else if(Array.isArray(e))for(var i=0,n=e;i<n.length;i++){var r=n[i];this.appendConcatenatedValue(r,t)}else null!=e&&t.push(String(e))},Ql.prototype.matchesCriteria=function(e,t){var i=this.isFormulaReferenceValue(e)?e.value:e,e=this.isFormulaReferenceValue(t)?t.value:t;if(null==e)return null==i||""===i;if("string"!=typeof e)return"number"==typeof e||"boolean"==typeof e?"number"==typeof i||"boolean"==typeof i?i===e:void 0!==(t=this.tryParseNumber(i))&&t===this.convertToNumber(e):String(i)===String(e);t=e.trim(),e=t.match(/^(>=|<=|<>|=|>|<)(.*)$/);if(e){var n=e[1],r=e[2].trim(),s=parseFloat(r),o=this.tryParseNumber(i);switch(n){case"=":return String(i)===r||void 0!==o&&o===s;case"<>":return String(i)!==r&&(void 0===o||o!==s);case">":return void 0!==o&&s<o;case"<":return void 0!==o&&o<s;case">=":return void 0!==o&&s<=o;case"<=":return void 0!==o&&o<=s}}return String(i)===t},Ql.prototype.tryParseNumber=function(e){var t;return this.isFormulaReferenceValue(e)?this.tryParseNumber(e.value):"number"==typeof e?e:"boolean"==typeof e?e?1:0:null!=e&&""!==e?"string"==typeof e?(t=parseFloat(e),isNaN(t)?void 0:t):Array.isArray(e)&&0<e.length?this.tryParseNumber(e[0]):void 0:void 0},Ql.prototype.convertToReference=function(e){if(this.isFormulaReferenceValue(e))return e.ref;if("string"==typeof e){var t=e.trim().toUpperCase();if(/^\$?[A-Z]+\$?\d+$/.test(t))return t}throw new ol("Cannot convert value to cell reference: "+e)};var Wl=Ql;function Ql(){this.context=null,this.formulaEngine=null}Xl.prototype.addEventListener=function(){this.parent.isDestroyed||this.parent.on(s,this.destroy,this)},Xl.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off(s,this.destroy)},Xl.prototype.initializeCustomFunctions=function(){if(this.parent&&this.parent.formulaSettings&&this.parent.formulaSettings.customFunctions)for(var e=this.parent.formulaSettings.customFunctions,t=0,i=Object.keys(e);t<i.length;t++){var n=i[t],r=e[n];this.registerCustomFunction(n.toUpperCase(),r)}},Xl.prototype.registerCustomFunction=function(e,t){("function"==typeof t||t&&"object"==typeof t)&&this.customFunctions.set(e.toUpperCase(),t)},Xl.prototype.getCustomFunction=function(e){return this.customFunctions.get(e.toUpperCase())},Xl.prototype.isCustomFunction=function(e){return this.customFunctions.has(e.toUpperCase())},Xl.prototype.getModuleName=function(){return"formula"},Xl.prototype.setCellFormula=function(t,i,e){var n=this.getCacheKey(t,i);if(void 0===e||""===e.trim())this.formulaCache.delete(n);else{this.primaryKeyValue=t;i=e.trim();try{if(!i.startsWith("=")&&!/[+\-*/%():\w]/.test(i))throw new nl('Formula must start with "=" or contain valid formula syntax');var r=this.parser.parse(i.replace(/\$/g,"")),s=this.extractReferences(r);if(0<s.length){for(var o=0,a=s;o<a.length;o++){var l=a[o];this.dependencyGraph.addDependency(n,l)}if(this.dependencyGraph.detectCycles().has(n))for(var h=0,d=s;h<d.length;h++){l=d[h];this.dependencyGraph.removeDependency(n,l)}}var p=this.createContext();if(!p)throw new el(oe.FormulaErrorCode.ERROR,"Cannot create evaluation context for "+n);this.evaluator.setFormulaEngine(this);var c=this.evaluator.evaluate(r,p);if(c&&this.evaluator.isFormulaReferenceValue(c))c=c.value;else if(Array.isArray(c))throw new el(oe.FormulaErrorCode.ERROR,"Cannot create evaluation context for "+n);var u=c;this.formulaCache.set(n,{ast:r,value:u,error:void 0,formula:i})}catch(e){t=void 0,t=e instanceof el?e:new el(oe.FormulaErrorCode.PARSE,"Failed to process formula: "+(e instanceof Error?e.message:String(e)));this.formulaCache.set(n,{ast:void 0,value:t,error:t,formula:i})}}},Xl.prototype.getCellFormula=function(e,t){e=this.getCacheKey(e,t),t=this.formulaCache.get(e);if(t&&t.formula)return t.formula},Xl.prototype.getFormulaValue=function(e,t){e=this.getCacheKey(e,t),t=this.formulaCache.get(e);return t?t.value:void 0},Xl.prototype.extractReferences=function(e){var l=this,h=[],d=new Set,p={visitLiteral:function(){},visitCellRef:function(e){d.has(e.ref)||(h.push(e.ref),d.add(e.ref))},visitRangeRef:function(e){var t,i;if(t=e.start instanceof xl?e.start.ref:0<(t=l.extractReferences(e.start)).length?t[0]:void 0,i=e.end instanceof xl?e.end.ref:0<(i=l.extractReferences(e.end)).length?i[0]:void 0,t&&i)for(var n=Hl.parseReference(t),r=Hl.parseReference(i),s=n.row;s<=r.row;s++)for(var o=n.col;o<=r.col;o++){var a=Hl.convertIndexToReference(o,s);d.has(a)||(h.push(a),d.add(a))}else e.start.accept(p),e.end.accept(p)},visitBinaryOp:function(e){e.left.accept(p),e.right.accept(p)},visitUnaryOperator:function(e){e.operand.accept(p)},visitFunctionCall:function(e){e.args.forEach(function(e){return e.accept(p)})}};return e.accept(p),h},Xl.prototype.resolveCellValue=function(e){if(e&&"string"==typeof e){var t=Hl.parseReference(e),e=this.parent.getDataModule().dataManager.executeLocal(new V.Query),i=this.parent.getPrimaryKeyFieldNames()[0],n=e.findIndex(function(e){return e[""+i]===t.row}),e=e[parseInt(n.toString(),10)];if(e){n=this.parent.getColumns().filter(function(e){return e&&void 0!==e.field&&null!==e.field});if(!(t.col<0||t.col>=n.length)){var n=n[t.col].field,r=e[n];if("string"==typeof r&&r.trim().startsWith("=")&&this.parent.formulaModule){e=this.getRowId(e,t.row),e=this.getFormulaValue(e,n);if(void 0!==e)return e}return r}}}},Xl.prototype.getRowId=function(e,t){var i=this.parent.getPrimaryKeyFieldNames?this.parent.getPrimaryKeyFieldNames():[];if(0<i.length){i=i[0];if(!H.isNullOrUndefined(e[""+i]))return e[""+i]}return t},Xl.prototype.resolveRangeValues=function(e,t){var i=Hl.parseReference(e),n=Hl.parseReference(t),r=[];(i.row>n.row||i.col>n.col)&&(e=i.col,t=i.row,i.col=Math.min(i.col,n.col),i.row=Math.min(i.row,n.row),n.col=Math.max(e,n.col),n.row=Math.max(t,n.row));for(var s=i.row;s<=n.row;s++)for(var o=i.col;o<=n.col;o++){var a=Hl.convertIndexToReference(o,s),a=this.resolveCellValue(a);r.push(a)}return r},Xl.prototype.createContext=function(){var r=this;return{getCell:function(e){return r.resolveCellValue(e)},getRange:function(e,t){return r.resolveRangeValues(e,t)},getRowData:function(t){var e=r.parent.getDataModule().dataManager.executeLocal(new V.Query),i=r.parent.getPrimaryKeyFieldNames()[0],n=e.findIndex(function(e){return e[""+i]===t});return e[parseInt(n.toString(),10)]},getFieldReference:function(t,e){var i=r.parent.getColumns().filter(function(e){return e&&void 0!==e.field&&null!==e.field}).findIndex(function(e){return e.field===t});return Hl.convertIndexToReference(i,e)}}},Xl.prototype.getCacheKey=function(e,t){return e+":"+t},Xl.prototype.getFormulas=function(){var n=[];return this.formulaCache.forEach(function(e,t){var i;e&&e.formula&&2===(t=t.split(":")).length&&(i=t[0],t=t[1],i=isNaN(Number(i))?i:Number(i),n.push({rowIndex:i,field:t,formula:e.formula,value:e.value instanceof el?void 0:e.value}))}),n},Xl.prototype.hasFormula=function(e,t){e=this.getCacheKey(e,t),t=this.formulaCache.get(e);return void 0!==t&&void 0!==t.formula&&0<t.formula.trim().length},Xl.prototype.addFormula=function(e,t){e=e.toUpperCase();this.registerCustomFunction(e,t)},Xl.prototype.removeFormula=function(e){e=e.toUpperCase();this.customFunctions.delete(e)},Xl.prototype.destroy=function(){this.removeEventListener(),this.formulaCache.clear(),this.customFunctions.clear(),this.dependencyGraph.clear(),this.parser=null,this.evaluator=null};Ya=Xl;function Xl(e){this.parser=new jl,this.evaluator=new Wl,this.dependencyGraph=new _l,this.formulaCache=new Map,this.customFunctions=new Map,this.parent=e,this.initializeCustomFunctions(),this.addEventListener()}r.prototype.initializeSelection=function(){this.parent.log("selection_key_missing"),this.render()},r.prototype.onActionBegin=function(e,t){this.parent.trigger(t,this.fDataUpdate(e))},r.prototype.fDataUpdate=function(e){var t;return this.isMultiSelection||H.isNullOrUndefined(e.cellIndex)&&H.isNullOrUndefined(e.rowIndex)||(t=this.getRowObj(H.isNullOrUndefined(e.rowIndex)?H.isNullOrUndefined(e.cellIndex)?this.currentIndex:e.cellIndex.rowIndex:e.rowIndex),e.foreignKeyData=t.foreignKeyData),e},r.prototype.onActionComplete=function(e,t){this.parent.trigger(t,this.fDataUpdate(e)),this.isMultiSelection=!1},r.prototype.getModuleName=function(){return"selection"},r.prototype.destroy=function(){this.nonDeselectableRows.clear();var e=this.parent.element;e&&(e.querySelector("."+ms)||e.querySelector("."+vs))&&(this.hidePopUp(),this.clearSelection(),this.parent.partialSelectedRecords=[],this.parent.partialSelectedIndexes=[],this.parent.disableSelectedRecords=[],this.parent.renderModule.selectableDataKey={},this.parent.renderModule.nonselectableDataKey={},this.destroyAutoFillElements(),this.removeEventListener(),this.unWireEvents(),H.EventHandler.remove(this.parent.getContent(),"mousedown",this.mouseDownHandler),H.EventHandler.remove(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler))},r.prototype.isEditing=function(){return("Normal"===this.parent.editSettings.mode||"Batch"===this.parent.editSettings.mode&&this.parent.editModule&&this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate())&&this.parent.isEdit&&!this.parent.editSettings.showAddNewRow&&!this.parent.isPersistSelection},r.prototype.getCurrentBatchRecordChanges=function(){var e=this.parent;if("Batch"===e.editSettings.mode&&e.editModule){for(var t=lp(this.parent.getCurrentViewRecords()),t="Bottom"===e.editSettings.newRowPosition?t.concat(this.parent.editModule.getBatchChanges()[ks]):this.parent.editModule.getBatchChanges()[ks].concat(t),i=this.parent.editModule.getBatchChanges()[Ps],n=this.parent.getPrimaryKeyFieldNames()[0],r=0;r<i.length;r++)for(var s=0;s<t.length;s++)if(i[parseInt(r.toString(),10)][""+n]===t[parseInt(s.toString(),10)][""+n]){t.splice(s,1);break}return t}return this.parent.enableVirtualization&&this.parent.groupSettings.columns.length&&!this.parent.isPersistSelection?e.getCurrentViewRecords().filter(function(e){return void 0===e.key}):e.getCurrentViewRecords()},r.prototype.selectRow=function(e,t){if(this.selectedRowIndexes.length&&this.selectionSettings.enableSimpleMultiRowSelection)this.addRowsToSelection([e]);else{var i=this.parent,n=i.getRowByIndex(e),r=n&&i.getRowObjectFromUID(n.getAttribute("data-uid"));if(!(this.isPartialSelection&&r&&r.isDataRow)||r.isSelectable){if(this.parent.pinnedTopRecords.length&&n&&n.classList.contains("e-grid-pin-row"))return this.parent.isCheckBoxSelection?void(-1===this.selectedRowIndexes.indexOf(e)&&this.addRowsToSelection([e])):void(-1===this.selectedRowIndexes.indexOf(e)?this.selectRows([e]):this.clearRowSelection());if((i.enableVirtualization||i.isRowDomVirtualization())&&-1<e){var s={selectedIndex:e,isAvailable:!0};if(this.parent.notify(un,s),!n||!i.getRowObjectFromUID(n.getAttribute("data-uid")))return void(s.isAvailable&&!i.selectionSettings.persistSelection&&0<this.parent.getSelectedRecords().length&&this.clearRowSelection());s=i.getRowObjectFromUID(n.getAttribute("data-uid")).data}else s=this.getRowObj(e).data;if(this.isRowType()&&n&&!this.isEditing()){var o=n.hasAttribute("aria-selected");if(!o||!this.isProtectedData(s)){var a,l,h;this.activeTarget(),t=!(!t||!this.selectedRowIndexes.length||(a="ResetOnRowClick"===this.selectionSettings.checkboxMode,l=!this.parent.isCheckBoxSelection&&"Multiple"===this.selectionSettings.type,(a||l)&&(1!==this.selectedRowIndexes.length||!a&&!l))||this.isKeyAction&&this.parent.isCheckBoxSelection||-1===this.selectedRowIndexes.indexOf(e)),this.isKeyAction=!1;if(t){if("ResetOnRowClick"!==this.selectionSettings.checkboxMode&&this.selectionSettings.persistSelection){if(this.rowDeselect(ue,[r.index],[r.data],[n],[r.foreignKeyData],this.actualTarget),this.isCancelDeSelect)return;this.parent.isCheckBoxSelection||(this.selectedRowIndexes=[],this.selectedRecords=[],this.isRowSelected=!1,this.selectRowIndex(-1)),this.rowDeselect(ge,[r.index],[r.data],[n],[r.foreignKeyData],this.actualTarget,void 0,void 0,void 0)}this.rowSelectingCallBack(h,t,e,s,!1,o,"cancel")(h)}else h={data:s,rowIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,row:n,previousRow:i.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,cancel:!1,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked},this.parent.trigger(pe,this.fDataUpdate(h),this.rowSelectingCallBack(h,t,e,s,!1,o,"cancel"))}}}}},r.prototype.rowSelectingCallBack=function(e,t,i,n,r,s,o){var a=this;return function(e){H.isNullOrUndefined(e)||!0!==e[""+o]?(a.index=i,a.toggle=t,a.data=n,a.removed=r,s&&a.selectionSettings.persistSelection&&"ResetOnRowClick"!==a.selectionSettings.checkboxMode?(a.clearSelectedRow(i),a.selectRowCallBack()):!s&&a.selectionSettings.persistSelection&&a.parent.isCheckBoxSelection&&"ResetOnRowClick"!==a.selectionSettings.checkboxMode&&a.selectRowCallBack(),"ResetOnRowClick"===a.selectionSettings.checkboxMode&&(a.isCheckboxReset=!0,a.clearSelection()),a.selectionSettings.persistSelection&&"ResetOnRowClick"!==a.selectionSettings.checkboxMode&&(a.parent.isCheckBoxSelection||!a.selectionSettings.persistSelection)||(a.selectRowCheck=!0,a.clearRow())):a.disableInteracted()}},r.prototype.selectRowCallBack=function(){var e=this.parent,t=this.index,i=this.toggle,n=this.data,r=this.removed,s=e.getRowByIndex(t);i||r||(this.selectedRowIndexes.indexOf(t)<=-1&&this.updateRowSelection(s,t),this.selectRowIndex(t)),i||(r={data:n,rowIndex:t,row:s,previousRow:e.getRowByIndex(this.prevRowIndex),previousRowIndex:this.prevRowIndex,target:this.actualTarget,isInteracted:this.isInteracted,isHeaderCheckBoxClicked:this.isHeaderCheckboxClicked,rowIndexes:t},this.onActionComplete(r,ce)),this.isInteracted=!1,this.updateRowProps(t)},r.prototype.selectRowsByRange=function(e,t){this.selectRows(this.getCollectionFromIndexes(e,t)),this.selectRowIndex(t)},r.prototype.selectedDataUpdate=function(e,t,i,n,r){for(var s=0,o=n.length;s<o;s++){var a=this.parent.getDataRows()[n[parseInt(s.toString(),10)]],l=((this.parent.enableVirtualization||this.parent.isRowDomVirtualization())&&(a=this.parent.getRowByIndex(n[parseInt(s.toString(),10)])),this.getRowObj(a));l&&l.isDataRow&&l.isSelectable?(e.push(l.data),i.push(a),t.push(l.foreignKeyData)):this.isPartialSelection&&r&&r.splice(r.indexOf(n[parseInt(s.toString(),10)]),1)}},r.prototype.selectRows=function(e){this.selectRowsWithCallback(e)},r.prototype.selectRowsWithCallback=function(e,l,h){var d=this,p=(void 0===h&&(h=!1),this.parent),c=e.slice(),u=this.isSingleSel()?e[e.length-1]:e[0],g=(this.isMultiSelection=!0,[]),f=[],t=[];this.isRowType()&&!this.isEditing()&&(this.parent.pinnedTopRecords.length&&(e=this.selectPinnedRowIndexes(e).concat(e),c=e.slice()),this.selectedDataUpdate(t,f,g,e,c),this.activeTarget(),e={cancel:!1,rowIndexes:c,row:g,rowIndex:u,target:this.actualTarget,prevRow:p.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isInteracted:this.isInteracted,isCtrlPressed:this.actualCtrlKeyPressed,isShiftPressed:this.isMultiShiftRequest,data:t,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,foreignKeyData:f},this.parent.trigger(pe,this.fDataUpdate(e),function(e){if(H.isNullOrUndefined(e)||!0!==e.cancel){d.selectionSettings.persistSelection&&p.allowRowDragAndDrop&&d.isDragged||d.clearRow(h),d.selectRowIndex(c.slice(-1)[0]);var t=function(e,t){d.updateRowSelection(p.getRowByIndex(e),e,t),d.updateRowProps(u)};if(d.isSingleSel())t(u);else for(var i=0,n=c;i<n.length;i++)t(n[i],!(!p.enableVirtualization&&!p.isRowDomVirtualization()));if(d.checkVirtualCheckBox()&&!d.parent.isPersistSelection)if(c.length===d.totalRecordsCount)d.virtualSelectedData=d.virtualCheckBoxData().slice(),d.selectedRowIndexes=Object.keys(d.virtualSelectedData).map(function(e){return parseInt(e,10)}),d.setCheckAllState();else{var r=c.filter(function(e){return-1===d.selectedRowIndexes.indexOf(e)});if(0<r.length){for(var s=d.virtualCheckBoxData().slice(),o=0;o<r.length;o++){var a=s[r[o]];H.isNullOrUndefined(a)||(d.virtualSelectedData.push(a),d.selectedRowIndexes.push(r[o]))}d.setCheckAllState()}}l&&l(),e={rowIndexes:c,row:g,rowIndex:u,target:d.actualTarget,prevRow:p.getRows()[d.prevRowIndex],previousRowIndex:d.prevRowIndex,data:d.getSelectedRecords(),isInteracted:d.isInteracted,isHeaderCheckboxClicked:d.isHeaderCheckboxClicked,foreignKeyData:f},d.isRowSelected&&d.onActionComplete(e,ce),d.isInteracted=!1}else d.disableInteracted()}))},r.prototype.deselectRow=function(e){this.deselectRows([e])},r.prototype.deselectRows=function(e){var l=this,t=this.parent;if(this.isRowType()&&!this.isEditing()&&e&&e.length){for(var i,h=this.target,d=[],p=[],c=[],u=[],n=t.enableVirtualization||t.isRowDomVirtualization(),r=0,s=e;r<s.length;r++){var o,a,g=s[r];-1!==this.selectedRowIndexes.indexOf(g)&&(o=n?t.getRowByIndex(g):("Batch"===t.editSettings.mode?t.getRows():t.getDataRows())[parseInt(g.toString(),10)],(a=this.getRowObj(o))&&a.isDataRow&&(!this.isPartialSelection||a.isSelectable))&&(u.push(g),d.push(a.data),p.push(o),c.push(a.foreignKeyData))}u.length&&(this.isAddRowsToSelection=!0,e=this.isRowDeselect,i=this.isRowClicked,this.isRowDeselect=!1,this.rowDeselect(ue,u,d,p,c,h,null,function(){if(l.isCancelDeSelect){l.isAddRowsToSelection=!1;for(var e=0;e<p.length;e++){var t=p[parseInt(e.toString(),10)],i=t?l.getRowObj(t):{};i.data&&l.isProtectedData(i.data)&&l.syncProtectedCheckbox(t,i)}}else{for(e=0;e<u.length;e++){var n=u[parseInt(e.toString(),10)],r=p[parseInt(e.toString(),10)],s=r?l.getRowObj(r):{},o=!(!s.data||!l.isProtectedData(s.data)),a=l.selectedRowIndexes.indexOf(n),a=(-1<a&&l.selectedRowIndexes.splice(a,1),l.selectedRecords.indexOf(r));-1<a&&l.selectedRecords.splice(a,1),l.checkVirtualCheckBox()&&!l.parent.isPersistSelection?-1<(a=l.virtualSelectedData.indexOf(d[parseInt(e.toString(),10)]))&&l.virtualSelectedData.splice(a,1):!l.parent.isRemote()&&l.parent.isCheckBoxSelection&&l.isPartialSelection&&!l.parent.isPersistSelection&&-1<(a=l.partialSelectedData.indexOf(d[parseInt(e.toString(),10)]))&&l.partialSelectedData.splice(a,1),l.selectionSettings.persistSelection&&"ResetOnRowClick"!==l.selectionSettings.checkboxMode&&(l.isRowClicked=!!l.checkSelectAllClicked),r&&!l.disableUI&&(r.removeAttribute("aria-selected"),l.addRemoveClassesForRow(r,!1,!0,"e-selectionbackground","e-active")),l.updateCheckBoxes(r,!1,n),o&&(l.nonDeselectableRows.delete(l.protectionKey(s.data)),l.updatePersistDelete(l.getPkValue(l.parent.getPrimaryKeyFieldNames()[0],s.data)),l.syncProtectedCheckbox(r,s),r)&&!l.disableUI&&(l.addRemoveClassesForRow(r,!1,!0,"e-selectionbackground","e-active"),r.removeAttribute("aria-selected")),l.selectedRowIndexes.length?l.selectRowIndex(l.selectedRowIndexes[l.selectedRowIndexes.length-1]):l.isRowSelected=!1,o||l.updatePersistCollection(r,!1)}l.rowDeselect(ge,u,d,p,c,h,void 0,void 0,void 0),l.isInteracted=!1,l.isMultiSelection=!1,l.isAddRowsToSelection=!1,l.isHdrSelectAllClicked=!1}}),this.isRowClicked=i,this.isRowDeselect=e)}},r.prototype.addRowsToSelection=function(e){var t=this.parent,i=this.target,n=(this.isMultiSelection=!0,[]),r=[],s=[],o=t.getSelectedRowIndexes().concat(e),a=this.isSingleSel()?t.getRowByIndex(e[e.length-1]):t.getRowByIndex(e[0]),l=!H.isNullOrUndefined(a)&&H.isNullOrUndefined(a.querySelector(".e-checkselect"))&&H.isNullOrUndefined(a.querySelector(".e-edit-checkselect"));if(this.isRowType()&&!this.isEditing()||!l){this.parent.pinnedTopRecords.length&&!H.isNullOrUndefined(a)&&a.classList.contains("e-grid-pin-row")&&(e=this.selectPinnedRowIndexes(e).concat(e));var h,d=this.parent.getColumns().filter(function(e){return"checkbox"===e.type});this.isMultiCtrlRequest&&!d.length&&this.selectedDataUpdate(s,r,n,o);for(var p=0,c=e;p<c.length;p++){var u,g=c[p],f=this.getRowObj(g),m=this.parent.getPrimaryKeyFieldNames()[0],m=this.isLazyLoadPersistSelection()?!H.isNullOrUndefined(this.parent.selectionModule.selectedRowState[f.data[""+m]]):-1<this.selectedRowIndexes.indexOf(g);if(!(this.isPartialSelection&&f&&f.isDataRow)||f.isSelectable)if(this.parent.pinnedTopRecords.length&&!H.isNullOrUndefined(a)&&a.classList.contains("e-grid-pin-row")&&(u=this.parent.getRowByIndex(g),a=H.isNullOrUndefined(u)?a:u),!m||!this.isProtectedData(f.data)){if(this.selectRowIndex(g),m&&(d.length||this.selectionSettings.enableToggle||this.isMultiCtrlRequest)){if(this.isAddRowsToSelection=!0,this.rowDeselect(ue,[g],[f.data],[a],[f.foreignKeyData],i),this.isCancelDeSelect)return;this.checkVirtualCheckBox()&&!this.parent.isPersistSelection?this.virtualSelectedData.splice(this.virtualSelectedData.indexOf(f.data),1):!this.parent.isRemote()&&this.parent.isCheckBoxSelection&&this.isPartialSelection&&!this.parent.isPersistSelection&&this.partialSelectedData.splice(this.partialSelectedData.indexOf(f.data),1),this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(g),1),this.selectedRecords.splice(this.selectedRecords.indexOf(a),1),this.selectRowIndex(this.selectedRowIndexes.length?this.selectedRowIndexes[this.selectedRowIndexes.length-1]:-1),a.removeAttribute("aria-selected"),this.addRemoveClassesForRow(a,!1,null,"e-selectionbackground","e-active"),this.rowDeselect(ge,[g],[f.data],[a],[f.foreignKeyData],i,void 0,void 0,void 0),this.isInteracted=!1,this.isMultiSelection=!1,this.isAddRowsToSelection=!1,this.isHdrSelectAllClicked=!1}else{if(this.activeTarget(),h={cancel:!1,data:s.length?s:f.data,rowIndex:g,row:n.length?n:a,target:this.actualTarget,prevRow:t.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isCtrlPressed:this.actualCtrlKeyPressed,isShiftPressed:this.isMultiShiftRequest,foreignKeyData:r.length?r:f.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:o},this.parent.trigger(pe,this.fDataUpdate(h)),!H.isNullOrUndefined(h)&&!0===h.cancel)return void this.disableInteracted();this.isSingleSel()&&this.clearRow(),this.updateRowSelection(a,g)}if(m||(h={data:s.length?s:f.data,rowIndex:g,row:n.length?n:a,target:this.actualTarget,prevRow:t.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,foreignKeyData:r.length?r:f.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:o},this.onActionComplete(h,ce)),this.isInteracted=!1,this.updateRowProps(g),this.isSingleSel())break}}}},r.prototype.selectPinnedRowIndexes=function(t){var i=[],n=this.parent.pinnedRowIndexes,r=this.parent.contentRowIndexes;return t.map(function(e){n[parseInt(e.toString(),10)]&&null!==n[parseInt(e.toString(),10)].contentIndex&&-1===t.indexOf(n[parseInt(e.toString(),10)].contentIndex)&&i.push(n[parseInt(e.toString(),10)].contentIndex),r[parseInt(e.toString(),10)]&&null!==r[parseInt(e.toString(),10)].pinnedIndex&&-1===t.indexOf(r[parseInt(e.toString(),10)].pinnedIndex)&&i.push(r[parseInt(e.toString(),10)].pinnedIndex)}),i},r.prototype.setPinnedSelectionIndexes=function(){this.parent.pinnedRowIndexes={},this.parent.contentRowIndexes={};for(var e=this.parent.getRowsObject().filter(function(e){return e.isDataRow}),t=this.parent.pinnedTopRowModels,i=this.parent.getPrimaryKeyFieldNames()[0],n=0;n<t.length;n++){var r=t[parseInt(n.toString(),10)].index,s=t[parseInt(n.toString(),10)].data[""+i],o=this.parent.getRowIndexByPrimaryKey(s);this.parent.pinnedRowIndexes[parseInt(r.toString(),10)]={pinnedIndex:r,contentIndex:-1===o?null:o}}for(var a=0;a<e.length;a++){var o=e[parseInt(a.toString(),10)].index,s=e[parseInt(a.toString(),10)].data[""+i],l=this.parent.getPinnedRowObjectByKey(s),r=null===l?null:l.index;this.parent.contentRowIndexes[parseInt(o.toString(),10)]={pinnedIndex:r,contentIndex:o}}},r.prototype.getCollectionFromIndexes=function(e,t){for(var i=[],n=e<=t?{i:e,max:t}:{i:t,max:e},r=n.i,s=n.max;r<=s;r++)i.push(r);return t<e&&i.reverse(),i},r.prototype.clearRow=function(e){void 0===e&&(e=!1),this.clearRowCheck=!0,e&&this.protectionEnabled()&&this.parent.isPersistSelection?this.clearProtectedSelection(!1,!0):this.clearRowSelection()},r.prototype.clearRowCallBack=function(){this.isCancelDeSelect&&"Check"!==this.parent.checkAllRows||(this.hasProtectedRows()?this.restoreProtectedRows():(this.selectedRowIndexes=[],this.selectedRecords=[],this.selectRowIndex(-1),!this.isSingleSel()||this.parent.isPersistSelection||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||(this.selectedRowState={})))},r.prototype.clearSelectedRow=function(e){var t;this.isProtectedData(this.getRowObj(e).data)||this.toggle&&(t=this.parent.getRowByIndex(e),this.disableUI||(t.removeAttribute("aria-selected"),this.addRemoveClassesForRow(t,!1,!0,"e-selectionbackground","e-active")),this.removed=!0,this.updatePersistCollection(t,!1),this.updateCheckBoxes(t),this.selectedRowIndexes.splice(this.selectedRowIndexes.indexOf(e),1),this.selectedRecords.splice(this.selectedRecords.indexOf(this.parent.getRowByIndex(e)),1))},r.prototype.updateRowProps=function(e){this.prevRowIndex=e,this.isRowSelected=this.selectedRowIndexes.length&&!0},r.prototype.getPkValue=function(e,t){return e&&Fp(e)?N(e,t):t[""+e]},r.prototype.protectionEnabled=function(){var e="function"==typeof this.parent.isRowNonDeselectable&&"Multiple"===this.selectionSettings.type&&"Cell"!==this.selectionSettings.mode&&0<this.parent.getPrimaryKeyFieldNames().length;if(!e&&this.nonDeselectableRows.size){this.nonDeselectableRows.clear();for(var t=0,i=this.parent.getDataRows();t<i.length;t++){var n=i[t],r=this.getRowObj(n),s=!!n.querySelector("[data-selection-protected]");this.syncProtectedCheckbox(n,r),s&&!this.parent.isPersistSelection&&(r.isSelected=!1)}}return e},r.prototype.protectionKey=function(e){e=this.getPkValue(this.parent.getPrimaryKeyFieldNames()[0],e);return typeof e+":"+e},r.prototype.registerProtectedRecord=function(e,t){(t=void 0===t?!0:t)&&this.protectionEnabled()&&this.parent.isRowNonDeselectable(e,this.parent.getColumns())&&this.nonDeselectableRows.set(this.protectionKey(e),e)},r.prototype.isProtectedData=function(e){return!!e&&this.protectionEnabled()&&this.nonDeselectableRows.has(this.protectionKey(e))},r.prototype.hasProtectedRows=function(){return this.protectionEnabled()&&0<this.nonDeselectableRows.size},r.prototype.syncProtectedCheckbox=function(e,t){var i=e.querySelector(".e-checkselect, .e-edit-checkselect");i&&(!1===t.isSelectable?(i.removeAttribute("data-selection-protected"),Wp(i,!1),Xp(i.nextElementSibling,!1)):this.isProtectedData(t.data)?(i.setAttribute("data-selection-protected",this.protectionKey(t.data)),i.disabled=!0,i.setAttribute("aria-disabled","true"),i.parentElement.classList.add("e-checkbox-disabled"),Wp(i,!0),Xp(i.nextElementSibling,!0)):i.hasAttribute("data-selection-protected")&&(i.removeAttribute("data-selection-protected"),i.disabled=!1,i.removeAttribute("aria-disabled"),i.parentElement.classList.remove("e-checkbox-disabled"),t.isSelected||(Wp(i,!1),Xp(i.nextElementSibling,!1),e.removeAttribute("aria-selected"),this.addRemoveClassesForRow(e,!1,!0,"e-selectionbackground","e-active"))))},r.prototype.reconcileProtectedRowsAfterRefresh=function(e){var i=this;if(!(!e.args||-1===["sorting","filtering","searching","paging"].indexOf(e.args.requestType)||!this.hasProtectedRows()||this.parent.isRemote()||this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling||this.parent.groupSettings.columns.length||this.parent.groupSettings.enableLazyLoading||this.parent.isFrozenGrid()||this.parent.frozenRows||this.parent.pinnedTopRecords.length)){var e=this.parent.getDataRows().filter(function(e){var t=i.parent.getRowObjectFromUID(e.getAttribute("data-uid"));return!e.classList.contains("e-masked-row")&&!!t&&!!t.data&&t.isDataRow}),t=new Set(e),n=new Set,r=new Set;this.parent.isPersistSelection?Object.keys(this.selectedRowState).forEach(function(e){!0===i.selectedRowState[""+e]&&r.add(e)}):this.selectedRecords.forEach(function(e){t.has(e)&&i.getRowObj(e).isSelected&&"true"===e.getAttribute("aria-selected")&&n.add(i.protectionKey(i.getRowObj(e).data))}),this.selectedRecords=[],this.selectedRowIndexes=[];for(var s=0,o=e;s<o.length;s++){var a=o[s],l=this.getRowObj(a),h=!1!==l.isSelectable&&(this.nonDeselectableRows.has(this.protectionKey(l.data))||(this.parent.isPersistSelection?r.has(String(this.getPkValue(this.primaryKey,l.data))):n.has(this.protectionKey(l.data))));(l.isSelected=h)?(this.selectedRecords.push(a),this.selectedRowIndexes.push(l.index),a.setAttribute("aria-selected","true")):a.removeAttribute("aria-selected"),this.addRemoveClassesForRow(a,h,!1,"e-selectionbackground","e-active"),this.updateCheckBoxes(a,h),this.syncProtectedCheckbox(a,l)}this.isRowSelected=0<this.selectedRowIndexes.length||this.hasProtectedRows(),this.selectRowIndex(this.selectedRowIndexes.length?this.selectedRowIndexes[this.selectedRowIndexes.length-1]:-1),this.setCheckAllState()}},r.prototype.restoreProtectedRows=function(){var t=this;if(this.hasProtectedRows()){this.selectedRecords=this.selectedRecords.filter(function(e){return t.parent.getRowByIndex(parseInt(e.getAttribute(D),10)-1)===e&&t.getRowObj(e).isSelected}),this.selectedRowIndexes=this.selectedRecords.map(function(e){return parseInt(e.getAttribute(D),10)-1});for(var e=0,i=this.parent.getDataRows();e<i.length;e++){var n=i[e],r=this.getRowObj(n);this.syncProtectedCheckbox(n,r),this.isProtectedData(r.data)&&!1!==r.isSelectable&&this.updateRowSelection(n,r.index,!0)}this.isRowSelected=0<this.selectedRowIndexes.length||this.hasProtectedRows(),this.setCheckAllState()}},r.prototype.clearProtectedSelection=function(l,h){function d(){return u.parent.getDataRows().filter(function(e){return!e.classList.contains("e-masked-row")&&!H.isNullOrUndefined(u.getRowObj(e).data)})}function p(){u.clearRowCheck&&(u.clearRowCallBack(),u.clearRowCheck=!1,u.selectRowCheck)&&(u.selectRowCallBack(),u.selectRowCheck=!1)}var c,u=this,e=(void 0===h&&(h=!1),d().filter(function(e){return e.hasAttribute("aria-selected")&&(l||!u.isProtectedData(u.getRowObj(e).data))})),g=this.persistSelectedData.concat(this.virtualSelectedData,this.partialSelectedData,e.map(function(e){return u.getRowObj(e).data})),f=(l&&this.nonDeselectableRows.forEach(function(e){return g.push(e)}),new Map),g=g.filter(function(e){var t=u.protectionKey(e);return!(f.has(t)||!l&&u.isProtectedData(e)||(f.set(t,!0),0))}),m=e.map(function(e){return u.getRowObj(e).index}),y=e.map(function(e){return u.getRowObj(e).foreignKeyData}),v=!!this.actualTarget&&!H.isNullOrUndefined(H.closest(this.actualTarget,"thead"));g.length?(c={cancel:!1,data:1===g.length?g[0]:g,row:1===e.length?e[0]:e,rowIndex:m[0],rowIndexes:m,foreignKeyData:1!==m.length||v?y:y[0],isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked},this.parent.trigger(ue,c,function(e){if((u.isCancelDeSelect=e.cancel,!e.cancel)&&(g=g.filter(function(e){return l||!u.isProtectedData(e)})).length){f.clear(),g.forEach(function(e){return f.set(u.protectionKey(e),!0)});e=d().filter(function(e){return f.has(u.protectionKey(u.getRowObj(e).data))});if(m=e.map(function(e){return u.getRowObj(e).index}),y=e.map(function(e){return u.getRowObj(e).foreignKeyData}),c.data=1===g.length?g[0]:g,c.row=1===e.length?e[0]:e,c.rowIndex=m[0],c.rowIndexes=m,c.foreignKeyData=1!==m.length||v?y:y[0],!h)for(var t=0,i=g;t<i.length;t++){var n=i[t];u.nonDeselectableRows.delete(u.protectionKey(n)),u.updatePersistDelete(u.getPkValue(u.parent.getPrimaryKeyFieldNames()[0],n))}for(var r=0,s=e;r<s.length;r++){var o=s[r],a=u.getRowObj(o);a.isSelected=!1,o.removeAttribute("aria-selected"),u.addRemoveClassesForRow(o,!1,!0,"e-selectionbackground","e-active"),u.updateCheckBoxes(o,!1),u.syncProtectedCheckbox(o,a)}h||(u.virtualSelectedData=u.virtualSelectedData.filter(function(e){return!f.has(u.protectionKey(e))}),u.partialSelectedData=u.partialSelectedData.filter(function(e){return!f.has(u.protectionKey(e))}),u.partialSelectedRecordsCount=u.partialSelectedData.length),u.selectedRecords=d().filter(function(e){return e.hasAttribute("aria-selected")}),u.selectedRowIndexes=u.selectedRecords.map(function(e){return u.getRowObj(e).index}),u.isRowSelected=0<u.selectedRowIndexes.length||u.hasProtectedRows(),u.selectRowIndex(u.selectedRowIndexes.length?u.selectedRowIndexes[u.selectedRowIndexes.length-1]:-1),u.setCheckAllState(),delete c.cancel,u.parent.trigger(ge,c)}p()})):p()},r.prototype.updatePersistCollection=function(e,t){var i,n=this;!t&&e&&this.isProtectedData(this.getRowObj(e).data)||(this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling)||this.parent.isPersistSelection||this.parent.selectionSettings.persistSelection&&0<this.parent.getPrimaryKeyFieldNames().length)&&!H.isNullOrUndefined(e)&&(this.parent.isPersistSelection||this.ensureCheckboxFieldSelection(),e=this.getRowObj(e),null!==(i=e.data?this.getPkValue(this.primaryKey,e.data):null))&&((e.isSelected=t)&&!this.isPartialSelection||this.isPartialSelection&&e.isSelectable&&e.isSelected?(this.isSingleSel()&&this.parent.isPersistSelection&&!this.selectedRowState[""+i]&&(this.selectedRowState={},this.persistSelectedData=[],this.persistSelectedRecordsCount=0),this.selectedRowState[""+i]=t,delete this.unSelectedRowState[""+i],this.persistSelectedData.some(function(e){return n.getPkValue(n.primaryKey,e)===i})||(this.persistSelectedData.push(e.data),this.persistSelectedRecordsCount+=1)):this.parent.isPersistSelection||H.isNullOrUndefined(this.contentRenderer.requestType)?this.updatePersistDelete(i):(this.persistSelectedData=[],this.selectedRowState={}))},r.prototype.updatePersistDelete=function(i,e){var n,r=this;delete this.selectedRowState[""+i],this.rmtHdrChkbxClicked&&(this.unSelectedRowState[""+i]=!0),this.persistSelectedData.some(function(e,t){return n=t,r.getPkValue(r.primaryKey,e)===i})&&(this.persistSelectedData.splice(n,1),--this.persistSelectedRecordsCount,e)&&(this.parent.partialSelectedRecords.splice(n,1),this.parent.partialSelectedIndexes.splice(n,1),this.selectedRowIndexes.splice(n,1))},r.prototype.updateCheckBoxes=function(e,t,i){H.isNullOrUndefined(e)||(e=H.isNullOrUndefined(e.querySelector(".e-checkselect"))?e.querySelector(".e-edit-checkselect"):e.querySelector(".e-checkselect"),!H.isNullOrUndefined(e)&&(Xp(e.nextElementSibling,t),Wp(e,t),H.isNullOrUndefined(this.checkedTarget)||!H.isNullOrUndefined(this.checkedTarget)&&!this.checkedTarget.classList.contains("e-checkselectall"))&&this.setCheckAllState(i))},r.prototype.updateRowSelection=function(e,t,i){e&&(-1===this.selectedRowIndexes.indexOf(t)&&(this.checkVirtualCheckBox()&&!this.parent.isPersistSelection?this.virtualSelectedData.push(this.parent.getRowObjectFromUID(e.getAttribute("data-uid")).data):!this.parent.isRemote()&&this.parent.isCheckBoxSelection&&this.isPartialSelection&&!this.parent.isPersistSelection&&this.partialSelectedData.push(this.parent.getRowObjectFromUID(e.getAttribute("data-uid")).data),this.selectedRowIndexes.push(t),this.selectedRecords.push(e)),t=this.getRowObj(e),this.registerProtectedRecord(t.data,!1!==t.isSelectable),this.protectionEnabled()&&(t.isSelected=!0),e.setAttribute("aria-selected","true"),this.updatePersistCollection(e,!0),this.updateCheckBoxes(e,!0),this.syncProtectedCheckbox(e,t),this.addRemoveClassesForRow(e,!0,null,"e-selectionbackground","e-active"),this.preventFocus&&!this.parent.isFocusFirstCell&&!this.isFocusLastCell||(t=this.focus.getPrevIndexes().cellIndex?e.cells[this.focus.getPrevIndexes().cellIndex]:e.querySelector(".e-selectionbackground:not(.e-hide, .e-detailrowcollapse, .e-detailrowexpand, .e-rowdragdrop)"),this.parent.contextMenuModule&&2===this.mouseButton&&(t=this.parent.contextMenuModule.cell),(this.parent.isFocusFirstCell||this.isFocusLastCell)&&(this.parent.isFocusFirstCell=!1,e=[].slice.call(e.querySelectorAll(".e-selectionbackground.e-rowcell:not(.e-hide, .e-detailrowcollapse, .e-detailrowexpand, .e-rowdragdrop, .e-gridchkbox)")),t=this.isFocusLastCell?e[e.length-1]:e[0],this.isFocusLastCell=!1),!t)||i||this.parent.isCheckBoxSelection&&this.isLazyLoadGroup()&&this.parent.enableInfiniteScrolling||((this.parent.enableVirtualization||this.parent.isRowDomVirtualization())&&(this.focus.suppressCellFocusEvent=!0),this.focus.onClick({target:t},!0,!(this.parent.contextMenuModule&&2===this.mouseButton))))},r.prototype.clearSelection=function(){var e;this.checkSelectAllClicked=!0,this.selectionSettings.persistSelection&&this.persistSelectedData.length&&(this.deSelectedData=this.persistSelectedData.slice()),(!this.parent.isPersistSelection||this.parent.isPersistSelection&&!this.parent.isEdit||!H.isNullOrUndefined(this.checkedTarget)&&this.checkedTarget.classList.contains("e-checkselectall"))&&((e=this.parent.element.querySelector(".e-gridpopup").querySelector("span")).classList.contains("e-rowselect")&&e.classList.remove("e-spanclicked"),this.hasProtectedRows()||!this.parent.isPersistSelection&&!this.parent.isRemote()||(this.persistSelectedData=[],this.selectedRowState={},this.persistSelectedRecordsCount=0),this.clearRowSelection(),this.clearCellSelection(),this.clearColumnSelection(),this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevECIdxs=void 0,this.enableSelectMultiTouch=!1,"ResetOnRowClick"===this.selectionSettings.checkboxMode&&this.target&&I(this.target,"e-rowcell")||(this.isInteracted=!1),this.checkSelectAllClicked=!1,this.isHdrSelectAllClicked=!1,this.rmtHdrChkbxClicked=!1)},r.prototype.clearRowSelection=function(e){var n=this;if(this.hasProtectedRows()||this.protectionEnabled()&&this.parent.isPersistSelection)this.clearProtectedSelection(!0===e);else if(this.isRowSelected){var r=this.parent.getDataRows(),s=[],o=[],a=[],l=[],h=this.target;this.isRowDeselect=!0;for(var t=0,i=this.selectedRowIndexes.length;t<i;t++){var d=void 0,d=this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache?this.parent.getRowByIndex(this.selectedRowIndexes[parseInt(t.toString(),10)]):("Batch"===this.parent.editSettings.mode?this.parent.getRows():this.parent.getDataRows())[this.selectedRowIndexes[parseInt(t.toString(),10)]],p=this.getRowObj(d);p&&(s.push(p.data),o.push(d),a.push(this.selectedRowIndexes[parseInt(t.toString(),10)]),l.push(p.foreignKeyData))}this.selectionSettings.persistSelection&&"ResetOnRowClick"!==this.selectionSettings.checkboxMode&&(this.isRowClicked=!!this.checkSelectAllClicked),this.rowDeselect(ue,a,s,o,l,h,null,function(){if(n.isCancelDeSelect&&(n.isRowClicked||n.checkSelectAllClicked||n.isInteracted&&!n.parent.isPersistSelection)){if(n.parent.isPersistSelection)if("Intermediate"===n.getCheckAllStatus(n.parent.element.querySelector(".e-checkselectall"))||n.parent.isPersistSelection)for(var e=0;e<n.selectedRecords.length;e++)n.updatePersistCollection(n.selectedRecords[parseInt(e.toString(),10)],!0);else n.parent.checkAllRows="Check",n.updatePersistSelectedData(!0)}else{for(var t=[].slice.call(r.filter(function(e){return e.hasAttribute("aria-selected")})),i=0;i<t.length;i++)n.disableUI||(t[parseInt(i.toString(),10)].removeAttribute("aria-selected"),n.addRemoveClassesForRow(t[parseInt(i.toString(),10)],!1,!0,"e-selectionbackground","e-active")),n.isPrevRowSelection||n.updatePersistCollection(t[parseInt(i.toString(),10)],!1),n.updateCheckBoxes(t[parseInt(i.toString(),10)]);!(n.parent.enableVirtualization||n.parent.isRowDomVirtualization()||n.parent.enableInfiniteScrolling&&n.parent.infiniteScrollSettings.enableCache)||!n.selectedRecords.length||t.length||n.parent.selectionSettings.persistSelection||n.disableUI||n.parent.isCheckBoxSelection||n.addRemoveClassesForRow(null,!1,!0),n.virtualSelectedData=[],n.selectedRowIndexes=[],n.partialSelectedData=[],n.selectedRecords=[],n.partialSelectedRecordsCount=0,n.isRowSelected=!1,n.selectRowIndex(-1),n.isPrevRowSelection=!1,n.rowDeselect(ge,a,s,o,l,h,null,void 0,null)}n.clearRowCheck&&(n.clearRowCallBack(),n.clearRowCheck=!1,n.selectRowCheck)&&(n.selectRowCallBack(),n.selectRowCheck=!1)},null),this.isRowDeselect=!1}else this.clearRowCheck&&(this.clearRowCallBack(),this.clearRowCheck=!1,this.selectRowCheck)&&(this.selectRowCallBack(),this.selectRowCheck=!1)},r.prototype.rowDeselect=function(e,t,i,n,r,s,o,a,l){var h,d=this;this.selectionSettings.persistSelection&&(this.isRowClicked||!this.isRowDeselect||this.checkSelectAllClicked||this.focus.activeKey&&this.focus.currentInfo.element.classList.contains("e-gridchkbox")&&"space"===this.focus.activeKey)||!this.selectionSettings.persistSelection?(h=1===t.length&&1===this.deSelectedData.length,h={rowIndex:t[0],data:this.selectionSettings.persistSelection&&"Uncheck"===this.parent.checkAllRows&&!h&&"ResetOnRowClick"!==this.selectionSettings.checkboxMode?this.deSelectedData:i,foreignKeyData:r,cancel:!"cancel",isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked},"rowDeselected"===e&&delete h.cancel,i="rowIndexes",r="foreignKeyData",h.row=n,h.target=this.actualTarget,this.actualTarget&&!H.isNullOrUndefined(H.closest(this.actualTarget,"thead"))||1<t.length?(h.rowIndex=t[0],h[i]=t):1===t.length&&(h.data=h.data[0],h.row=h.row[0],h[r]=h[r][0],this.isAddRowsToSelection)&&(h[i]=t),this.parent.trigger(e,h,function(e){d.isCancelDeSelect=e.cancel,d.isCancelDeSelect&&(d.isRowClicked||d.isInteracted||d.checkSelectAllClicked)||(d.updatePersistCollection(n[0],!1),d.updateCheckBoxes(n[0],void 0,t[0])),void 0!==a&&a()})):this.selectionSettings.persistSelection&&!this.isInteracted&&void 0!==a&&a()},r.prototype.getRowObj=function(e){return void 0===e&&(e=this.currentIndex),!H.isNullOrUndefined(e)&&(e="number"==typeof e?this.parent.getRowByIndex(e):e)&&this.parent.getRowObjectFromUID(e.getAttribute("data-uid"))||{}},r.prototype.selectCell=function(e,t){var i,n,r,s;!this.isCellType()||this.isCellType()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache)||(i=this.parent.getCellFromIndex(e.rowIndex,this.getColIndex(e.rowIndex,e.cellIndex)),this.currentIndex=e.rowIndex,n=this.getCurrentBatchRecordChanges()[this.currentIndex],this.isCellType()&&i&&!this.isEditing()&&(r=i.classList.contains("e-cellselectionbackground"),(t=t&&!H.isUndefined(this.prevCIdxs)&&e.rowIndex===this.prevCIdxs.rowIndex&&e.cellIndex===this.prevCIdxs.cellIndex&&r)?this.successCallBack(s,t,e,i,n)(s):((s={data:n,cellIndex:e,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,cancel:!1}).currentCell=i,s.previousRowCellIndex=this.prevECIdxs,this.parent.trigger(fe,this.fDataUpdate(s),this.successCallBack(s,t,e,i,n)),this.cellselected=!0)))},r.prototype.successCallBack=function(e,i,n,r,s){var o=this;return function(e){var t="currentCell";!H.isNullOrUndefined(e)&&!0===e.cancel||(i||(e[t]=e[t]||r),o.clearCell(),i||o.updateCellSelection(r,n.rowIndex,n.cellIndex),i)||((e={data:s,cellIndex:n,currentCell:r,selectedRowCellIndex:o.selectedRowCellIndexes,previousRowCell:o.prevECIdxs?o.getCellIndex(o.prevECIdxs.rowIndex,o.prevECIdxs.cellIndex):void 0}).previousRowCellIndex=o.prevECIdxs,o.updateCellProps(n,n),o.onActionComplete(e,me))}},r.prototype.getCellIndex=function(e,t){return this.parent.getCellFromIndex(e,t)},r.prototype.selectCellsByRange=function(r,s){var o,a,l,h,d,p,c,u,e,g=this;this.isCellType()&&(o=this.parent,a=this.parent.isSpan?Bc(this.parent,r.rowIndex,r.cellIndex):o.getCellFromIndex(r.rowIndex,r.cellIndex),d=r,p=s=s||r,this.currentIndex=r.rowIndex,u=this.getCurrentBatchRecordChanges()[this.currentIndex],this.isSingleSel()||!this.isCellType()||this.isEditing()||((e={data:u,cellIndex:r,currentCell:a,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0}).previousRowCellIndex=this.prevECIdxs,this.parent.trigger(fe,this.fDataUpdate(e),function(e){if(H.isNullOrUndefined(e)||!0!==e.cancel){g.clearCell(),r.rowIndex>s.rowIndex&&(e=r,r=s,s=e);for(var t=r.rowIndex;t<=s.rowIndex;t++){h=g.selectionSettings.cellSelectionMode.indexOf("Box")<0?(l=t===r.rowIndex?r.cellIndex:0,t===s.rowIndex?s.cellIndex:g.getLastColIndex(t)):(l=r.cellIndex,s.cellIndex),c=[];for(var i=l<h?l:h,n=h<l?l:h;i<=n;i++)(a=g.parent.isSpan?Bc(o,t,i):o.getCellFromIndex(t,i))&&(c.push(i),g.updateCellSelection(a),g.addAttribute(a));g.selectedRowCellIndexes.push({rowIndex:t,cellIndexes:c})}e={data:u,cellIndex:p,currentCell:o.getCellFromIndex(p.rowIndex,p.cellIndex),selectedRowCellIndex:g.selectedRowCellIndexes,previousRowCell:g.prevECIdxs?g.getCellIndex(g.prevECIdxs.rowIndex,g.prevECIdxs.cellIndex):void 0};e.previousRowCellIndex=g.prevECIdxs,g.isDragged||(g.onActionComplete(e,me),g.cellselected=!0),g.updateCellProps(d,p)}})))},r.prototype.selectCells=function(e){if(this.isCellType()){var t=this.parent,i=t.getCellFromIndex(e[0].rowIndex,e[0].cellIndexes[0]),n=(this.currentIndex=e[0].rowIndex,this.getCurrentBatchRecordChanges()[this.currentIndex]);if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){var r={data:n,cellIndex:e[0].cellIndexes[0],currentCell:i,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};r.previousRowCellIndex=this.prevECIdxs,this.onActionBegin(r,fe);for(var s=0,o=e.length;s<o;s++)for(var a=0,l=e[parseInt(s.toString(),10)].cellIndexes.length;a<l;a++)(i=t.getCellFromIndex(e[parseInt(s.toString(),10)].rowIndex,e[parseInt(s.toString(),10)].cellIndexes[parseInt(a.toString(),10)]))&&(this.updateCellSelection(i),this.addAttribute(i),this.addRowCellIndex({rowIndex:e[parseInt(s.toString(),10)].rowIndex,cellIndex:e[parseInt(s.toString(),10)].cellIndexes[parseInt(a.toString(),10)]}));this.updateCellProps({rowIndex:e[0].rowIndex,cellIndex:e[0].cellIndexes[0]},{rowIndex:e[0].rowIndex,cellIndex:e[0].cellIndexes[0]});r={data:n,cellIndex:e[0].cellIndexes[0],currentCell:i,selectedRowCellIndex:this.selectedRowCellIndexes,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0};r.previousRowCellIndex=this.prevECIdxs,this.onActionComplete(r,me)}}},r.prototype.addCellsToSelection=function(e){if(!(!this.isCellType()||this.isCellType()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache))){var t,i=this.parent,n=(this.currentIndex=e[0].rowIndex,this.getCurrentBatchRecordChanges()[this.currentIndex]);if(!this.isSingleSel()&&this.isCellType()&&!this.isEditing()){this.hideAutoFill(),r=i.getRowsObject()[e[0].rowIndex],0<i.groupSettings.columns.length&&(r=i.getRowObjectFromUID(this.target.parentElement.getAttribute("data-uid")));for(var r,s=[],o=0,a=e;o<a.length;o++){for(var l=a[o],h=0,d=this.selectedRowCellIndexes.length;h<d;h++)if(this.selectedRowCellIndexes[parseInt(h.toString(),10)].rowIndex===l.rowIndex){t=h;break}var p=i.getCellFromIndex(l.rowIndex,this.getColIndex(l.rowIndex,l.cellIndex)),c=l.cellIndex,c=(0<i.groupSettings.columns.length?s.push(r.cells[c+i.groupSettings.columns.length].foreignKeyData):s.push(r.cells[parseInt(c.toString(),10)].foreignKeyData),{cancel:!1,data:n,cellIndex:e[0],isShiftPressed:this.isMultiShiftRequest,currentCell:p,isCtrlPressed:this.actualCtrlKeyPressed,previousRowCell:this.prevECIdxs?i.getCellFromIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0}),u="previousRowCellIndex",g=(c[u]=this.prevECIdxs,-1<t);if(g){var f=this.selectedRowCellIndexes[parseInt(t.toString(),10)].cellIndexes;-1<f.indexOf(l.cellIndex)||"Both"===this.selectionSettings.mode&&p.classList.contains("e-gridchkbox")&&!p.getAttribute("aria-selected")?(this.cellDeselect(ye,[{rowIndex:l.rowIndex,cellIndexes:[l.cellIndex]}],n,[p],s),f.splice(f.indexOf(l.cellIndex),1),0===f.length&&this.selectedRowCellIndexes.splice(t,1),p.classList.remove("e-cellselectionbackground"),p.removeAttribute("aria-selected"),this.cellDeselect(ve,[{rowIndex:l.rowIndex,cellIndexes:[l.cellIndex]}],n,[p],s)):(g=!1,this.onActionBegin(c,fe),this.addRowCellIndex({rowIndex:l.rowIndex,cellIndex:l.cellIndex}),this.updateCellSelection(p),this.addAttribute(p))}else{if(this.onActionBegin(c,fe),!H.isNullOrUndefined(c)&&!0===c.cancel)return;this.updateCellSelection(p,l.rowIndex,l.cellIndex)}g||((f={data:n,cellIndex:e[0],currentCell:p,previousRowCell:this.prevECIdxs?this.getCellIndex(this.prevECIdxs.rowIndex,this.prevECIdxs.cellIndex):void 0,selectedRowCellIndex:this.selectedRowCellIndexes})[u]=this.prevECIdxs,this.onActionComplete(f,me),this.cellselected=!0),this.updateCellProps(l,l)}}}},r.prototype.getColIndex=function(e,t){var i=this.parent.getColumnByIndex(t),n=qc(this.parent,0,e);if(n)for(var r=0;r<n.length;r++)if(parseInt(n[parseInt(r.toString(),10)].getAttribute(zs),10)-1===t)return r;return-1},r.prototype.getLastColIndex=function(e){e=this.parent.getDataRows()[parseInt(e.toString(),10)].querySelectorAll("td.e-rowcell");return parseInt(e[e.length-1].getAttribute(zs),10)-1},r.prototype.clearCell=function(){this.clearCellSelection()},r.prototype.cellDeselect=function(e,t,i,n,r){if(n&&0<n.length)for(var s=0,o=n;s<o.length;s++){var a=o[s];a&&a.classList.contains(Es)&&this.updateCheckBoxes(H.closest(a,"tr"))}n={cells:n,data:i,cellIndexes:t,foreignKeyData:r,cancel:!1};this.parent.trigger(e,n),this.isPreventCellSelect=n.cancel},r.prototype.updateCellSelection=function(e,t,i){H.isNullOrUndefined(t)||this.addRowCellIndex({rowIndex:t,cellIndex:i}),e.classList.add("e-cellselectionbackground"),e.classList.contains(Es)&&this.updateCheckBoxes(H.closest(e,"tr"),!0),this.addAttribute(e)},r.prototype.addAttribute=function(e){this.target=e,H.isNullOrUndefined(e)||(e.setAttribute("aria-selected","true"),this.preventFocus)||this.focus.onClick({target:e},!0,!0)},r.prototype.updateCellProps=function(e,t){this.prevCIdxs=e,this.prevECIdxs=t,this.isCellSelected=this.selectedRowCellIndexes.length&&!0},r.prototype.addRowCellIndex=function(e){for(var t,i,n=0,r=this.selectedRowCellIndexes.length;n<r;n++)if(this.selectedRowCellIndexes[parseInt(n.toString(),10)].rowIndex===e.rowIndex){t=!0,i=n;break}t?this.selectedRowCellIndexes[parseInt(i.toString(),10)].cellIndexes.indexOf(e.cellIndex)<0&&this.selectedRowCellIndexes[parseInt(i.toString(),10)].cellIndexes.push(e.cellIndex):this.selectedRowCellIndexes.push({rowIndex:e.rowIndex,cellIndexes:[e.cellIndex]})},r.prototype.restoreCellSelection=function(){if(this.isCellType()&&this.selectedRowCellIndexes.length)for(var e=0,t=this.selectedRowCellIndexes;e<t.length;e++){var i=t[e];if(this.parent.getRowByIndex(i.rowIndex))for(var n=0,r=i.cellIndexes;n<r.length;n++){var s=r[n],s=this.parent.getCellFromIndex(i.rowIndex,this.getColIndex(i.rowIndex,s));s&&(s.classList.add("e-cellselectionbackground"),s.setAttribute("aria-selected","true"))}}},r.prototype.clearCellSelection=function(){if(this.isCellSelected){var e=this.parent,t=this.getSelectedCellsElement(),i=this.selectedRowCellIndexes,n=[],r=[],s=[],o=this.getCurrentBatchRecordChanges();this.hideAutoFill();for(var a=0,l=i.length;a<l;a++){n.push(o[i[parseInt(a.toString(),10)].rowIndex]);for(var h=this.getRowObj(i[parseInt(a.toString(),10)].rowIndex),d=0,p=i[parseInt(a.toString(),10)].cellIndexes.length;d<p;d++)h.cells&&s.push(h.cells[i[parseInt(a.toString(),10)].cellIndexes[parseInt(d.toString(),10)]].foreignKeyData),r.push(e.getCellFromIndex(i[parseInt(a.toString(),10)].rowIndex,i[parseInt(a.toString(),10)].cellIndexes[parseInt(d.toString(),10)]))}if(this.cellDeselect(ye,i,n,r,s),!0!==this.isPreventCellSelect){for(a=0,l=t.length;a<l;a++)t[parseInt(a.toString(),10)].classList.remove("e-cellselectionbackground"),t[parseInt(a.toString(),10)].removeAttribute("aria-selected");this.bdrElement&&this.showHideBorders("none"),this.selectedRowCellIndexes=[],this.isCellSelected=!1,!this.isDragged&&this.cellselected&&this.cellDeselect(ve,i,n,r,s)}}},r.prototype.getSelectedCellsElement=function(){for(var e=this.parent.getDataRows(),t=[],i=0,n=e.length;i<n;i++)t=t.concat([].slice.call(e[parseInt(i.toString(),10)].getElementsByClassName("e-cellselectionbackground")));return t},r.prototype.mouseMoveHandler=function(e){var t,i,n,r,s,o,a;this.parent.isEdit&&this.parent.element.querySelector(".e-formula-edit")&&e.target.classList.contains("e-rowcell")&&this.parent.enableAutoFill&&"Cell"===this.selectionSettings.mode&&"Multiple"===this.selectionSettings.type&&-1<this.selectionSettings.cellSelectionMode.indexOf("Box")||(e.preventDefault(),this.stopTimer(),r=this.parent.element.getBoundingClientRect(),t=this.x,i=this.y,a=(n=Cp(e)).x-r.left,r=n.y-r.top,s=H.closest(e.target,"tr"),this.isDragged=!0,this.isCellDrag||(s=s||H.closest(document.elementFromPoint(this.parent.element.offsetLeft+2,e.clientY),"tr"),a<t&&(o=a,a=t,t=o),r<i&&(o=r,r=i,i=o),this.element.style.left=t+"px",this.element.style.top=i+"px",this.element.style.width=a-t+"px",this.element.style.height=r-i+"px"),!s||e.ctrlKey||e.shiftKey||(o=parseInt(s.getAttribute(D),10)-1,this.isCellDrag?(a=I(e.target,b))&&(this.startAFCell=this.startCell,this.endAFCell=I(e.target,b),-1<o)&&this.selectLikeExcel(e,o,parseInt(a.getAttribute(zs),10)-1):(this.hideAutoFill(),this.selectRowsByRange(this.startDIndex,o),this.isRowDragSelected=!0)),e.ctrlKey)||e.shiftKey||this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling||this.parent.enableColumnVirtualization||this.parent.groupSettings.columns.length||!this.isCellDrag||this.updateScrollPosition(e,n,this.parent.getContent())},r.prototype.updateScrollPosition=function(e,t,i){var n=this,r=i.getBoundingClientRect();r.left>=t.x-20-(this.parent.enableRtl&&"auto"!==this.parent.height?Op():0)?this.timer1=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,n.parent.enableRtl?"right":"left",e)},200):r.left+i.clientWidth-20-(this.parent.enableRtl||"auto"===this.parent.height?0:Op())<t.x&&(this.timer1=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,n.parent.enableRtl?"left":"right",e)},200)),r.top>=t.y-.5*this.parent.getRowHeight()?this.timer2=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,"up",e)},200):r.top+i.clientHeight-.5*this.parent.getRowHeight()-(i.firstElementChild.scrollWidth>i.firstElementChild.offsetWidth?Op():0)<=t.y&&(this.timer2=window.setInterval(function(){n.setScrollPosition(i.firstElementChild,"down",e)},200))},r.prototype.stopTimer=function(){this.timer1&&(window.clearInterval(this.timer1),this.timer1=null),this.timer2&&(window.clearInterval(this.timer2),this.timer2=null),this.preventFocus=!1},r.prototype.setScrollPosition=function(e,t,i){var n,r=-1,s=-1;switch((this.endAFCell||this.prevECIdxs)&&(r=this.endAFCell?parseInt(this.endAFCell.getAttribute("data-index"),10):this.prevECIdxs.rowIndex,s=this.endAFCell?parseInt(this.endAFCell.getAttribute("aria-colindex"),10)-1:this.prevECIdxs.cellIndex),t){case"up":if(i&&H.closest(i.target,".e-headercontent"))return;this.isAutoFillSel&&this.startAFCell&&this.selectedRowCellIndexes.length&&(1===this.selectedRowCellIndexes.length&&this.startAFCell!==this.startCell||1<this.selectedRowCellIndexes.length&&0<this.startAFCell.getBoundingClientRect().top)&&(r=parseInt(this.startAFCell.getAttribute("data-index"),10)),--r,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(r+=(this.parent.frozenRows||this.parent.pinnedTopRecords.length)+1),r<1?e.scrollTop=0:e.scrollTop-=this.parent.getRowByIndex(r).offsetHeight;break;case"down":(r=this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell?parseInt(this.startAFCell.getAttribute("data-index"),10):r)<this.parent.getRows().length-1?(r+=1,this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell&&(this.startAFCell=this.parent.getCellFromIndex(r,this.selectedRowCellIndexes[0].cellIndexes[0])),e.scrollTop+=this.parent.getRowByIndex(r).offsetHeight):e.scrollTop=e.scrollHeight;break;case"left":0<s&&-1<r&&(this.isAutoFillSel&&this.startAFCell&&this.selectedRowCellIndexes.length&&(0<this.selectedRowCellIndexes[0].cellIndexes.length&&this.startAFCell!==this.startCell||1<this.selectedRowCellIndexes[0].cellIndexes.length&&(!this.parent.enableRtl&&0<this.startAFCell.getBoundingClientRect().left||this.parent.enableRtl&&this.startAFCell.getBoundingClientRect().left<this.parent.element.offsetWidth))&&(s=parseInt(this.startAFCell.getAttribute("aria-colindex"),10)-1),s=(o=this.findNextCell(e,t,s,r))?parseInt(o.getAttribute("aria-colindex"),10)-1:-1,this.parent.enableRtl&&o?s<1?e.scrollLeft=e.scrollWidth:e.scrollLeft+=o.offsetWidth:o&&(s<1?e.scrollLeft=0:e.scrollLeft-=o.offsetWidth));break;case"right":this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell&&(s=parseInt(this.startAFCell.getAttribute("aria-colindex"),10)-1);var o=this.parent.getCellFromIndex(r,s),a=this.findNextCell(e,t,s,r);a&&this.isAutoFillSel&&this.startAFCell&&this.startAFCell!==this.startCell&&(this.startAFCell=this.parent.getCellFromIndex(this.selectedRowCellIndexes[0].rowIndex,parseInt(a.getAttribute("aria-colindex"),10)-1)),s=a?parseInt(a.getAttribute("aria-colindex"),10)-1:-1,this.parent.enableRtl&&a?s<this.parent.columns.length-1?e.scrollLeft-=o.offsetWidth:e.scrollLeft=-e.scrollWidth:a&&(s<this.parent.columns.length-1?e.scrollLeft+=o.offsetWidth:e.scrollLeft=e.scrollWidth),this.isAutoFillSel&&(s===this.parent.columns.length-1||-1===s)&&this.startAFCell&&this.endAFCell&&(this.positionAFBorders(),e.scrollLeft=this.parent.enableRtl?-e.scrollWidth:e.scrollWidth)}-1<r&&r<this.parent.getRows().length&&-1<s&&(n={target:this.parent.getCellFromIndex(r,s)},this.isAutoFillSel&&n.target.classList.contains("e-cellselectionbackground")&&("down"===t&&parseInt(n.target.getAttribute("data-index"),10)===this.parent.getRows().length-1||"right"===t&&parseInt(n.target.getAttribute("aria-colindex"),10)-1==this.parent.columns.length-1)||(this.endAFCell=n.target,this.preventFocus=!0,this.selectLikeExcel(n,r,s)))},r.prototype.findNextCell=function(e,t,i,n){var r,n=this.parent.getCellFromIndex(n,"left"===t?i-1:i+1);return n&&n.classList.contains("e-hide")?(i=n.closest("tr").querySelectorAll(".e-rowcell:not(.e-hide)"),0<(r=Array.from(i).indexOf(n.nextElementSibling))&&r<i.length-1?i[r+("left"===t?-1:1)]:(e.scrollLeft=0,null)):n},r.prototype.selectLikeExcel=function(e,t,i){this.isAutoFillSel?(this.showAFBorders(),this.selectLikeAutoFill(e)):(this.clearCellSelection(),this.selectCellsByRange({rowIndex:this.startDIndex,cellIndex:this.startDCellIndex},{rowIndex:t,cellIndex:i}),this.drawBorders())},r.prototype.setFrozenBorders=function(e,t,i){var n=t.style.borderWidth.toString().split(" "),r=[].slice.call(e.querySelectorAll(".e-cellselectionbackground."+["","e-leftfreeze","e-unfreeze","e-leftfreeze","e-unfreeze","e-rightfreeze","e-rightfreeze"][""+i])).filter(function(e){return""===e.style.display}),s=[].slice.call(e.querySelectorAll(".e-cellselectionbackground.e-fixedfreeze")).filter(function(e){return""===e.style.display}),o=this.parent.enableRtl;if(r.length)for(var a=r[0].getAttribute("data-index"),l=r[0].getAttribute("aria-colindex"),h=r[r.length-1].getAttribute("data-index"),d=r[r.length-1].getAttribute("aria-colindex"),p=0;p<r.length;p++)r[parseInt(p.toString(),10)].getAttribute("data-index")===a&&(1===n.length||3===n.length&&2===parseInt(n[0],10)||4===n.length&&2===parseInt(n[0],10))&&r[parseInt(p.toString(),10)].classList.add("e-xlsel-top-border"),r[parseInt(p.toString(),10)].getAttribute("aria-colindex")===l&&(1===n.length||3===n.length&&2===parseInt(n[1],10)||4===n.length&&(!o&&2===parseInt(n[3],10)||o&&2===parseInt(n[1],10)))&&r[parseInt(p.toString(),10)].classList.add(o?"e-xlsel-right-border":"e-xlsel-left-border"),r[parseInt(p.toString(),10)].getAttribute("data-index")===h&&(1===n.length||3===n.length&&2===parseInt(n[2],10)||4===n.length&&2===parseInt(n[2],10))&&r[parseInt(p.toString(),10)].classList.add("e-xlsel-bottom-border"),r[parseInt(p.toString(),10)].getAttribute("aria-colindex")===d&&(1===n.length||3===n.length&&2===parseInt(n[1],10)||4===n.length&&!o&&2===parseInt(n[1],10)||o&&2===parseInt(n[3],10))&&r[parseInt(p.toString(),10)].classList.add(o?"e-xlsel-left-border":"e-xlsel-right-border");if(s.length)for(a=s[0].getAttribute("data-index"),l=(parseInt(s[0].getAttribute("aria-colindex"),10)-1).toString(),h=s[s.length-1].getAttribute("data-index"),d=(parseInt(s[s.length-1].getAttribute("aria-colindex"),10)-1).toString(),p=0;p<s.length;p++){var c=s[parseInt(p.toString(),10)].getAttribute("data-index"),u=(parseInt(s[parseInt(p.toString(),10)].getAttribute("aria-colindex"),10)-1).toString(),c=(c!==a||(this.parent.getHeaderContent().querySelector(".e-cellselectionbackground.e-fixedfreeze")||!I(e,"e-content"))&&I(e,"e-content")||s[parseInt(p.toString(),10)].classList.add("e-xlsel-top-border"),c!==h||(this.parent.getContent().querySelector(".e-cellselectionbackground.e-fixedfreeze")||!I(e,"e-headercontent"))&&I(e,"e-headercontent")||s[parseInt(p.toString(),10)].classList.add("e-xlsel-bottom-border"),s[parseInt(p.toString(),10)].parentElement.children[parseInt(u,10)-1]),c=(u!==l||c&&c.classList.contains("e-cellselectionbackground")||s[parseInt(p.toString(),10)].classList.add(o?"e-xlsel-right-border":"e-xlsel-left-border"),s[parseInt(p.toString(),10)].parentElement.children[parseInt(u,10)+1]);u!==d||c&&c.classList.contains("e-cellselectionbackground")||s[parseInt(p.toString(),10)].classList.add(o?"e-xlsel-left-border":"e-xlsel-right-border")}},r.prototype.refreshFrozenBorders=function(){this.bdrElement&&(this.setFrozenBorders(this.parent.getContentTable(),this.bdrElement,"1"),this.parent.isFrozenGrid()&&this.parent.getFrozenMode()===Ls&&this.setFrozenBorders(this.parent.getContentTable(),this.frcBdrElement,"5"),this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.setFrozenBorders(this.parent.getHeaderTable(),this.fhBdrElement,"3"),this.parent.isFrozenGrid())&&this.parent.getFrozenMode()===Ls&&this.setFrozenBorders(this.parent.getHeaderTable(),this.frhBdrElement,"6")},r.prototype.drawBorders=function(){"BoxWithBorder"===this.selectionSettings.cellSelectionMode&&this.selectedRowCellIndexes.length&&!this.parent.isEdit?(this.parent.element.classList.add("e-enabledboxbdr"),this.bdrElement||this.createBorders(),this.positionBorders(),this.parent.isFrozenGrid()&&(this.showHideBorders("none",!0),this.refreshFrozenBorders())):this.showHideBorders("none")},r.prototype.isLastCell=function(e){var t=[].slice.call(e.parentElement.querySelectorAll(".e-rowcell:not(.e-hide)"));return t[t.length-1]===e},r.prototype.isLastRow=function(e){var t=[].slice.call(H.closest(e,j).querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===t[t.length-1]},r.prototype.isFirstRow=function(e){var t=[].slice.call(H.closest(e,j).querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===t[0]},r.prototype.isFirstCell=function(e){return[].slice.call(e.parentElement.querySelectorAll(".e-rowcell:not(.e-hide)"))[0]===e},r.prototype.setBorders=function(e,t,i){var n,r,s,o,a,l=[].slice.call(e.getElementsByClassName("e-cellselectionbackground")).filter(function(e){return""===e.style.display});l.length&&this.parent.isFrozenGrid()&&(l=[].slice.call(e.querySelectorAll(".e-cellselectionbackground."+["","e-leftfreeze","e-unfreeze","e-leftfreeze","e-unfreeze","e-rightfreeze","e-rightfreeze"][""+i]+":not(.e-hide)")).filter(function(e){return""===e.style.display})),l.length?(e=this.parent.isFrozenGrid(),a=l[0],l=l[l.length-1],n=a.getBoundingClientRect(),r=l.getBoundingClientRect(),H.isNullOrUndefined(a.offsetParent)||(s=a.offsetParent.getBoundingClientRect(),(a.offsetParent.classList.contains("e-content")||a.offsetParent.classList.contains("e-headercontent"))&&(s=a.offsetParent.querySelector("table").getBoundingClientRect()),l=e||!this.isLastRow(l)||"1"!==i&&"2"!==i&&"5"!==i?0:2,o=e&&("2"===i||"4"===i)&&this.isFirstCell(a)?1:0,a=("Right"!==this.parent.getFrozenMode()||"1"!==i&&"3"!==i)&&(this.parent.getFrozenMode()!==Ls||"5"!==i&&"6"!==i)||!this.isFirstCell(a)?0:1,this.parent.enableRtl?(t.style.right=s.right-n.right-o+"px",t.style.width=n.right-r.left+o+1+"px"):(t.style.left=n.left-s.left-o-a+"px",t.style.width=r.right-n.left+o-a+1+"px"),t.style.top=n.top-s.top+"px",t.style.height=0<r.top-n.top?r.top-s.top+r.height+(e?0:1)-(n.top-s.top)-l+"px":r.height+0-l+(e?0:1)+"px",this.selectDirection+=i)):t.style.display="none"},r.prototype.positionBorders=function(){this.updateStartEndCells(),this.startCell&&this.bdrElement&&this.selectedRowCellIndexes.length&&(this.selectDirection="",this.showHideBorders(""),this.setBorders(this.parent.getContentTable(),this.bdrElement,"1"),this.parent.isFrozenGrid()&&(this.setBorders(this.parent.getContentTable(),this.mcBdrElement,"2"),this.parent.getFrozenMode()===Ls)&&this.setBorders(this.parent.getContentTable(),this.frcBdrElement,"5"),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.setBorders(this.parent.getHeaderTable(),this.fhBdrElement,"3"),this.parent.isFrozenGrid())&&(this.setBorders(this.parent.getHeaderTable(),this.mhBdrElement,"4"),this.parent.getFrozenMode()===Ls)&&this.setBorders(this.parent.getHeaderTable(),this.frhBdrElement,"6"),this.applyBorders(this.selectDirection))},r.prototype.applyBothFrozenBorders=function(e){var t=this.parent.enableRtl;switch(e.length){case 6:this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=this.bottom,this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=this.top,this.frcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.frhBdrElement.style.borderWidth=t?this.top_left:this.top_right;break;case 4:e.includes("1")&&e.includes("2")&&e.includes("3")&&e.includes("4")&&(this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=t?this.top_left:this.top_right,this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom),e.includes("2")&&e.includes("4")&&e.includes("5")&&e.includes("6")&&(this.mcBdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.frcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.frhBdrElement.style.borderWidth=t?this.top_left:this.top_right);break;case 3:this.bdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.mcBdrElement.style.borderWidth=this.top_bottom,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.mhBdrElement.style.borderWidth=this.top_bottom,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom);break;case 2:e.includes("1")&&(this.mcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=this.top_right_left),e.includes("2")&&(this.bdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frcBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.mhBdrElement.style.borderWidth=this.top_right_left),e.includes("3")&&(this.mhBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.bdrElement.style.borderWidth=this.right_bottom_left),e.includes("4")&&(this.fhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frhBdrElement.style.borderWidth=t?this.top_bottom_left:this.top_right_bottom,this.mcBdrElement.style.borderWidth=this.right_bottom_left),e.includes("5")&&(this.mcBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.frhBdrElement.style.borderWidth=this.top_right_left),e.includes("6")&&(this.mhBdrElement.style.borderWidth=t?this.top_right_bottom:this.top_bottom_left,this.frcBdrElement.style.borderWidth=this.right_bottom_left);break;default:this.bdrElement.style.borderWidth=this.all_border,this.mcBdrElement.style.borderWidth=this.all_border,this.frcBdrElement.style.borderWidth=this.all_border,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=this.all_border,this.mhBdrElement.style.borderWidth=this.all_border,this.frhBdrElement.style.borderWidth=this.all_border)}},r.prototype.applyBorders=function(e){var t=this.parent.enableRtl;if(this.parent.getFrozenMode()===Ls)this.applyBothFrozenBorders(e);else switch(e.length){case 4:"Right"===this.parent.getFrozenMode()?(this.bdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.mcBdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.fhBdrElement.style.borderWidth=t?this.top_left:this.top_right,this.mhBdrElement.style.borderWidth=t?this.top_right:this.top_left):(this.bdrElement.style.borderWidth=t?this.right_bottom:this.bottom_left,this.mcBdrElement.style.borderWidth=t?this.bottom_left:this.right_bottom,this.fhBdrElement.style.borderWidth=t?this.top_right:this.top_left,this.mhBdrElement.style.borderWidth=t?this.top_left:this.top_right);break;case 2:"Right"===this.parent.getFrozenMode()?(this.bdrElement.style.borderWidth=e.includes("2")?t?this.top_bottom_left:this.top_right_bottom:this.right_bottom_left,this.mcBdrElement.style.borderWidth=e.includes("1")?t?this.top_right_bottom:this.top_bottom_left:this.right_bottom_left,(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=e.includes("1")?this.top_right_left:t?this.top_bottom_left:this.top_right_bottom,this.mhBdrElement.style.borderWidth=e.includes("2")?this.top_right_left:t?this.top_right_bottom:this.top_bottom_left)):(this.bdrElement.style.borderWidth=e.includes("2")?t?this.top_right_bottom:this.top_bottom_left:this.right_bottom_left,this.parent.isFrozenGrid()&&(this.mcBdrElement.style.borderWidth=e.includes("1")?t?this.top_bottom_left:this.top_right_bottom:this.right_bottom_left),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=e.includes("1")?this.top_right_left:t?this.top_right_bottom:this.top_bottom_left,this.parent.isFrozenGrid())&&(this.mhBdrElement.style.borderWidth=e.includes("2")?this.top_right_left:t?this.top_bottom_left:this.top_right_bottom));break;default:this.bdrElement.style.borderWidth=this.all_border,this.parent.isFrozenGrid()&&(this.mcBdrElement.style.borderWidth=this.all_border),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(this.fhBdrElement.style.borderWidth=this.all_border,this.parent.isFrozenGrid())&&(this.mhBdrElement.style.borderWidth=this.all_border)}},r.prototype.createBorders=function(){var e;this.bdrElement||((e=H.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_bdr"})).style.cssText="width: 2px; border-width: 0;",this.bdrElement=this.parent.getContentTable().parentElement.appendChild(e),this.parent.isFrozenGrid()&&((e=H.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_mcbdr"})).style.cssText="height: 2px; border-width: 0;",this.mcBdrElement=this.parent.getContentTable().parentElement.appendChild(e),this.parent.getFrozenMode()===Ls)&&((e=H.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_frcbdr"})).style.cssText="height: 2px; border-width: 0;",this.frcBdrElement=this.parent.getContentTable().parentElement.appendChild(e)),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&((e=H.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_fhbdr"})).style.height="2px",this.fhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(e)),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&this.parent.isFrozenGrid()&&((e=H.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_mhbdr"})).style.height="2px",this.mhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(e),this.parent.getFrozenMode()===Ls)&&((e=H.createElement("div",{className:"e-xlsel",id:this.parent.element.id+"_frhbdr"})).style.height="2px",this.frhBdrElement=this.parent.getHeaderTable().parentElement.appendChild(e)))},r.prototype.showHideBorders=function(e,t){var i;this.bdrElement&&(this.bdrElement.style.display=e,this.parent.isFrozenGrid()&&(i=this.parent.getContentTable(),H.removeClass(i.querySelectorAll(".e-xlsel-top-border"),"e-xlsel-top-border"),H.removeClass(i.querySelectorAll(".e-xlsel-left-border"),"e-xlsel-left-border"),H.removeClass(i.querySelectorAll(".e-xlsel-right-border"),"e-xlsel-right-border"),H.removeClass(i.querySelectorAll(".e-xlsel-bottom-border"),"e-xlsel-bottom-border"),t||(this.mcBdrElement.style.display=e),this.parent.getFrozenMode()===Ls)&&(this.frcBdrElement.style.display=e),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(i=this.parent.getHeaderTable(),H.removeClass(i.querySelectorAll(".e-xlsel-top-border"),"e-xlsel-top-border"),H.removeClass(i.querySelectorAll(".e-xlsel-left-border"),"e-xlsel-left-border"),H.removeClass(i.querySelectorAll(".e-xlsel-right-border"),"e-xlsel-right-border"),H.removeClass(i.querySelectorAll(".e-xlsel-bottom-border"),"e-xlsel-bottom-border"),this.fhBdrElement.style.display=e),this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&this.parent.isFrozenGrid()&&(t||(this.mhBdrElement.style.display=e),this.parent.getFrozenMode()===Ls)&&(this.frhBdrElement.style.display=e)},r.prototype.drawAFBorders=function(){this.bdrAFBottom||this.createAFBorders(),this.positionAFBorders()},r.prototype.positionAFBorders=function(){var e,t,i,n,r,s,o,a,l,h,d,p,c,u;this.startCell&&this.bdrAFLeft&&(e=this.startAFCell.getBoundingClientRect(),i=0<(t=this.endAFCell.getBoundingClientRect()).top-e.top?1:0,n=0<=t.top-e.top&&(I(this.startAFCell,ws)||I(this.startAFCell,"e-frozencontent"))&&this.isFirstRow(this.startAFCell)?1.5:0,r=(I(this.startAFCell,ws)||I(this.startAFCell,bs))&&this.isFirstCell(this.startAFCell)?1:0,s=this.isLastRow(this.endAFCell)&&(I(this.endAFCell,ws)||I(this.endAFCell,"e-frozencontent"))?2:0,o=this.startAFCell.offsetParent.getBoundingClientRect(),a=this.parent.element.getBoundingClientRect(),d=this.startAFCell.offsetParent.parentElement.scrollTop,p=this.startAFCell.offsetParent.parentElement.scrollLeft,d=d-this.startAFCell.offsetTop,p=p-this.startAFCell.offsetLeft,l=this.parent.element.clientHeight-Op(),this.parent.allowPaging&&(l-=this.parent.element.querySelector(".e-pager").offsetHeight),this.parent.aggregates.length&&(l-=this.parent.getFooterContent().offsetHeight),h=this.parent.element.clientWidth-("auto"!==this.parent.height?Op():0),d=0<d?Math.floor(d)-1:0,p=0<p?p:0,u=e.left-a.left,this.parent.enableRtl?(c=I(this.startAFCell,ws)||I(this.startAFCell,bs)?e.right-this.startAFCell.offsetParent.parentElement.getBoundingClientRect().width-a.left:0,this.bdrAFLeft.style.right=a.right-t.right-2+t.width+"px",this.bdrAFLeft.style.width=h<=parseInt(this.bdrAFLeft.style.right,10)?"0px":"2px",c=a.right-e.right-r+c-1,this.bdrAFRight.style.right=0<c?c+"px":"0px",this.bdrAFTop.style.left=t.left-a.left-.5+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFLeft.style.right,10)-parseInt(this.bdrAFRight.style.right,10)-r+1+"px",parseInt(this.bdrAFTop.style.left,10)<0&&(this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)+"px","auto"!==this.parent.height&&Op()?(this.bdrAFTop.style.left=Op()+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)-Op()+"px"):this.bdrAFTop.style.left="0px")):(this.bdrAFLeft.style.left=u-r+p-1+"px",this.bdrAFRight.style.left=t.left-a.left-2+t.width+"px",this.bdrAFRight.style.width=h<=parseInt(this.bdrAFRight.style.left,10)?"0px":"2px",this.bdrAFTop.style.left=u+p-.5+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFRight.style.left,10)-parseInt(this.bdrAFLeft.style.left,10)-r+1+"px",h<=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)&&(c=parseInt(this.bdrAFTop.style.width,10)+parseInt(this.bdrAFTop.style.left,10)-h,this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)-c+"px")),this.bdrAFLeft.style.top=e.top-a.top-n+d+"px",this.bdrAFLeft.style.height=0<t.top-e.top?t.top-o.top+t.height+1-(e.top-o.top)+n-s-d+"px":t.height+n-s-d+"px",this.bdrAFRight.style.top=this.bdrAFLeft.style.top,this.bdrAFRight.style.height=parseInt(this.bdrAFLeft.style.height,10)+"px",this.bdrAFTop.style.top=this.bdrAFRight.style.top,this.bdrAFBottom.style.left=this.bdrAFTop.style.left,this.bdrAFBottom.style.top=parseFloat(this.bdrAFLeft.style.top)+parseFloat(this.bdrAFLeft.style.height)-i-1+"px",this.bdrAFBottom.style.width=l<=parseFloat(this.bdrAFBottom.style.top)?"0px":this.bdrAFTop.style.width,l<=parseInt(this.bdrAFLeft.style.height,10)+parseInt(this.bdrAFLeft.style.top,10))&&(u=parseInt(this.bdrAFLeft.style.height,10)+parseInt(this.bdrAFLeft.style.top,10)-l,this.bdrAFLeft.style.height=parseInt(this.bdrAFLeft.style.height,10)-u+"px",this.bdrAFRight.style.height=parseInt(this.bdrAFLeft.style.height,10)+"px")},r.prototype.createAFBorders=function(){var e;this.bdrAFLeft||((e=H.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafleft"})).style.width="2px",this.bdrAFLeft=this.parent.element.appendChild(e),(e=H.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafright"})).style.width="2px",this.bdrAFRight=this.parent.element.appendChild(e),(e=H.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafbottom"})).style.height="2px",this.bdrAFBottom=this.parent.element.appendChild(e),(e=H.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdraftop"})).style.height="2px",this.bdrAFTop=this.parent.element.appendChild(e))},r.prototype.destroyAutoFillElements=function(){this.bdrAFLeft&&(this.bdrAFLeft.remove(),this.bdrAFRight.remove(),this.bdrAFBottom.remove(),this.bdrAFTop.remove(),this.bdrAFLeft=this.bdrAFRight=this.bdrAFBottom=this.bdrAFTop=null),this.autofill&&(this.autofill.remove(),this.autofill=null)},r.prototype.showAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="",this.bdrAFRight.style.display="",this.bdrAFBottom.style.display="",this.bdrAFTop.style.display="")},r.prototype.hideAFBorders=function(){this.bdrAFLeft&&(this.bdrAFLeft.style.display="none",this.bdrAFRight.style.display="none",this.bdrAFBottom.style.display="none",this.bdrAFTop.style.display="none")},r.prototype.updateValue=function(e,t,i){var n,r=this.createBeforeAutoFill(e,t,i);r.cancel||(t=this.parent.getColumnByIndex(t),this.parent.editModule&&i&&("number"!==t.type||t.allowFormula&&r.value.startsWith("=")?this.parent.editModule.updateCell(e,t.field,r.value):(n=this.serviceLocator.fromView(r.value,t.getParser(),t.type),this.parent.editModule.updateCell(e,t.field,n)),this.parent.editSettings.enableUndoRedo)&&"Batch"===this.parent.editSettings.mode&&this.storeCellsInStack(e,i,t,r))},r.prototype.createBeforeAutoFill=function(e,t,i){var n,r,s,o=this.parent.getColumnByIndex(t),a=i.innerText,t=(this.parent.formulaModule&&o&&o.allowFormula&&this.parent.editSettings&&"Cell"===this.parent.editSettings.mode&&(s=(s=I(i,Ts))?parseInt(s.getAttribute(D),10)-1:void 0,i=i&&i.getAttribute?parseInt(i.getAttribute(zs),10)-1:void 0,H.isNullOrUndefined(s)||isNaN(s)||(n=this.parent.getPrimaryKeyFieldNames()[0],n=this.parent.getCurrentViewRecords()[parseInt(s.toString(),10)][""+n],r=this.parent.getColumnByIndex(i),"string"==typeof(n=this.parent.getCellFormula(n,r.field))&&n.trim().length&&(r=e-s,s=H.isNullOrUndefined(i)||isNaN(i)?0:t-i,a="="===n.charAt(0)?"="+Hl.adjustReferences(n.slice(1),r,s):Hl.adjustReferences(n,e,s)))),{column:o,value:a});return this.parent.trigger(st,t),t},r.prototype.getAutoFillCells=function(e,t){return[].slice.call(this.parent.getDataRows()[parseInt(e.toString(),10)].querySelectorAll(".e-cellselectionbackground"))},r.prototype.storeCellsInStack=function(e,t,i,n){var r=this.parent,s=r.getRows()[parseInt(e.toString(),10)].getAttribute("data-uid"),o=r.getRowObjectFromUID(s);if(o){o=o.data[i.field],t=t.textContent?t.textContent.trim():"";if(o!==t){var t="number"===i.type?this.serviceLocator.fromView(n.value,i.getParser(),i.type):n.value,n={rowIndex:e,field:i.field,rowUid:s,previousValue:o,newValue:t},e=this.parent.editModule.editModule,s=e.undoStack[e.undoStack.length-1],o=!1;if(s&&"auto-fill"===s.type){t=s.cells;if(s.field===i.field){for(var a=t[0].rowIndex,l=0,h=t;l<h.length;l++){var d=h[l];d.rowIndex>a&&(a=d.rowIndex)}o=n.rowIndex===a+1}else{var p=t[0].rowIndex;if(t.every(function(e){return e.rowIndex===p})&&p===n.rowIndex){for(var c=r.getColumnIndexByField(i.field),u=-1,g=0,f=t;g<f.length;g++){var m=f[g],m=r.getColumnIndexByField(m.field);u<m&&(u=m)}c===u+1&&(o=!0)}}}o?s.cells.push(n):(t={type:"auto-fill",field:i.field,cells:[n]},e.undoStack.push(t),e.redoStack=[],this.parent.notify(ri,{}))}}},r.prototype.selectLikeAutoFill=function(e,t){var i=parseInt(I(this.startAFCell,Ts).getAttribute(D),10)-1,n=parseInt(this.startAFCell.getAttribute(zs),10)-1,r=parseInt(I(this.endAFCell,Ts).getAttribute(D),10)-1,s=parseInt(this.endAFCell.getAttribute(zs),10)-1,o=this.selectedRowCellIndexes.length-1,a=this.selectedRowCellIndexes[0].cellIndexes.length-1;switch(!0){case!t&&this.endAFCell.classList.contains("e-cellselectionbackground")&&!!I(e.target,b):this.startAFCell=this.parent.getCellFromIndex(i,n),this.endAFCell=this.parent.getCellFromIndex(i+o,n+a),this.drawAFBorders();break;case this.autoFillRLselection&&n+a<s&&r-i-o<s-n-a+1&&i-r<s-n-a+1:if(this.endAFCell=this.parent.getCellFromIndex(i+o,s),r=parseInt(I(this.endAFCell,Ts).getAttribute(D),10)-1,s=parseInt(this.endAFCell.getAttribute(zs),10)-1,t){for(var l=parseInt(this.endCell.getAttribute(zs),10)-1,h=i;h<=r;h++)for(var d=this.getAutoFillCells(h,n),p=0,c=1+l;c<=s;c++)a<p&&(p=0),this.updateValue(h,c,d[parseInt(p.toString(),10)]),p++;this.selectCellsByRange({rowIndex:i,cellIndex:this.startCellIndex},{rowIndex:r,cellIndex:s})}else this.drawAFBorders();break;case this.autoFillRLselection&&s<n&&r-i-o<n-s+1&&i-r<n-s+1:if(this.startAFCell=this.parent.getCellFromIndex(i,s),this.endAFCell=this.endCell,t){for(h=i;h<=i+o;h++)for(p=((d=this.getAutoFillCells(h,n)).reverse(),0),c=this.startCellIndex-1;s<=c;c--)a<p&&(p=0),this.updateValue(h,c,d[parseInt(p.toString(),10)]),p++;this.selectCellsByRange({rowIndex:i,cellIndex:s},{rowIndex:i+o,cellIndex:this.startCellIndex+a})}else this.drawAFBorders();break;case r<i:if(this.startAFCell=this.parent.getCellFromIndex(r,n),this.endAFCell=this.endCell,t){for(var u=g=parseInt(this.endCell.parentElement.getAttribute(D),10)-1,h=i-1;r<=h;h--){u===this.startIndex-1&&(u=g);d=this.getAutoFillCells(u,n),p=0;u--;for(c=this.startCellIndex;c<=this.startCellIndex+a;c++)this.updateValue(h,c,d[parseInt(p.toString(),10)]),p++}this.selectCellsByRange({rowIndex:r,cellIndex:n+a},{rowIndex:i+o,cellIndex:n})}else this.drawAFBorders();break;default:if(this.endAFCell=this.parent.getCellFromIndex(r,n+a),t){for(var g=parseInt(this.endCell.parentElement.getAttribute(D),10)-1,u=this.startIndex,h=g+1;h<=r;h++){u===g+1&&(u=this.startIndex);for(var d=this.getAutoFillCells(u,n),p=(u++,0),f=this.startCellIndex;f<=this.startCellIndex+a;f++)this.updateValue(h,f,d[parseInt(p.toString(),10)]),p++}this.selectCellsByRange({rowIndex:g-o,cellIndex:n},{rowIndex:r,cellIndex:n+a})}else this.drawAFBorders()}},r.prototype.mouseUpHandler=function(e){this.stopTimer(),document.body.classList.remove("e-disableuserselect"),this.element&&!H.isNullOrUndefined(this.element.parentElement)&&H.remove(this.element),this.isDragged&&1===this.selectedRowCellIndexes.length&&1===this.selectedRowCellIndexes[0].cellIndexes.length?this.mUPTarget=I(e.target,b):this.mUPTarget=null;var t,i=H.closest(e.target,".e-rowcell");this.isDragged&&!this.isAutoFillSel&&"Cell"===this.selectionSettings.mode&&i&&i.classList.contains(b)&&(t=parseInt(i.parentElement.getAttribute(D),10)-1,i=parseInt(i.getAttribute(zs),10)-1,this.isDragged=!1,this.clearCellSelection(),this.selectCellsByRange({rowIndex:this.startDIndex,cellIndex:this.startDCellIndex},{rowIndex:t,cellIndex:i})),this.isDragged=!1,this.updateAutoFillPosition(),this.isAutoFillSel&&(this.preventFocus=!0,t=I(e.target,b),this.endAFCell=t||(this.endCell===this.endAFCell?this.startAFCell:this.endAFCell),this.startAFCell=this.startCell,H.isNullOrUndefined(this.endAFCell)||H.isNullOrUndefined(this.startAFCell)||(this.updateStartCellsIndex(),this.selectLikeAutoFill(e,!0),this.updateAutoFillPosition(),this.hideAFBorders(),this.positionBorders(),this.parent.isFrozenGrid()&&(this.showHideBorders("none",!0),this.refreshFrozenBorders()),0<this.parent.aggregates.length&&this.parent.notify(Nt,{})),this.isAutoFillSel=!1,this.preventFocus=!1),H.EventHandler.remove(this.parent.getContent(),"mousemove",this.mouseMoveHandler),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&H.EventHandler.remove(this.parent.getHeaderContent(),"mousemove",this.mouseMoveHandler),H.EventHandler.remove(document,"mouseup",this.mouseUpHandler)},r.prototype.hideAutoFill=function(){this.autofill&&(this.autofill.style.display="none")},r.prototype.updateAutoFillPosition=function(){var e,t,i,n;this.parent.enableAutoFill&&!this.parent.isEdit&&-1<this.selectionSettings.cellSelectionMode.indexOf("Box")&&!this.isRowType()&&!this.isSingleSel()&&this.selectedRowCellIndexes.length?(n=parseInt(this.target.getAttribute(zs),10)-1,e=parseInt(this.target.getAttribute("data-index"),10),t=this.selectedRowCellIndexes[this.selectedRowCellIndexes.length-1].rowIndex,t=this.getAutoFillCells(t,n).filter(function(e){return""===e.style.display}),(n=this.parent.getColumnByIndex(n)).getFreezeTableName(),e=e<(this.parent.frozenRows||this.parent.pinnedTopRecords.length),n=this.parent.getFrozenMode()===Ls&&n.getFreezeTableName()===Ns,H.isNullOrUndefined(I(this.target,Ds))||H.select("#"+this.parent.element.id+"_autofill",I(this.target,Ds))||(H.select("#"+this.parent.element.id+"_autofill",this.parent.element)&&H.select("#"+this.parent.element.id+"_autofill",this.parent.element).remove(),this.autofill=H.createElement("div",{className:"e-autofill",id:this.parent.element.id+"_autofill"}),this.autofill.style.display="none",(this.target.classList.contains("e-leftfreeze")||this.target.classList.contains("e-rightfreeze")||this.target.classList.contains("e-fixedfreeze"))&&this.autofill.classList.add("e-freeze-autofill"),(e?this.parent.getHeaderTable():this.parent.getContentTable()).parentElement.appendChild(this.autofill),n&&(e?this.parent.getHeaderTable():this.parent.getContentTable()).parentElement.appendChild(this.autofill)),(n=t[t.length-1])&&n.offsetParent&&(e=n.getBoundingClientRect(),t=n.offsetParent.getBoundingClientRect(),(n.offsetParent.classList.contains("e-content")||n.offsetParent.classList.contains("e-headercontent"))&&(t=n.offsetParent.querySelector("table").getBoundingClientRect()),i=this.isLastCell(n)?4:0,n=this.isLastRow(n)?3:0,this.parent.enableRtl?this.autofill.style.right=t.right-e.right+e.width-4-i+"px":this.autofill.style.left=e.left-t.left+e.width-4-i+"px",this.autofill.style.top=e.top-t.top+e.height-5-n+"px"),this.autofill.style.display=""):this.hideAutoFill()},r.prototype.mouseDownHandler=function(e){this.mouseButton=e.button;var t,i=e.target,n=this.parent,r=I(i,"e-grid");if(!(r&&r.id!==n.element.id||I(i,Cs)&&!this.parent.frozenRows||I(i,"e-editedbatchcell")||I(i,Os)||I(i,As))){if((e.shiftKey||e.ctrlKey)&&e.preventDefault(),I(i,b)&&!e.shiftKey&&!e.ctrlKey){if(-1<n.selectionSettings.cellSelectionMode.indexOf("Box")&&!this.isRowType()&&!this.isSingleSel())t=this.isCellDrag=!0;else if(n.allowRowDragAndDrop&&!n.isEdit&&!this.parent.selectionSettings.checkboxOnly){if(this.isRowDragSelected=!1,!this.isRowType()||this.isSingleSel()||H.closest(i,"td").classList.contains("e-selectionbackground"))return void(this.isDragged=!1);t=!0,this.element=this.parent.createElement("div",{className:"e-griddragarea"}),n.getContent().appendChild(this.element)}t&&this.enableDrag(e,!0)}this.updateStartEndCells(),(i.classList.contains("e-autofill")||i.classList.contains("e-xlsel"))&&(this.isCellDrag=!0,this.isAutoFillSel=!0,this.enableDrag(e))}},r.prototype.updateStartEndCells=function(){var e=[].slice.call(this.parent.element.getElementsByClassName("e-cellselectionbackground"));this.startCell=e[0],this.endCell=e[e.length-1],this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute(D),10)-1,this.startCellIndex=parseInt(I(this.startCell,b).getAttribute(zs),10)-1)},r.prototype.updateStartCellsIndex=function(){this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute(D),10)-1,this.startCellIndex=parseInt(I(this.startCell,b).getAttribute(zs),10)-1)},r.prototype.enableDrag=function(e,t){var i=this.parent,t=(t&&(t=H.closest(e.target,"tr"),this.startDIndex=parseInt(t.getAttribute(D),10)-1,this.startDCellIndex=parseInt(I(e.target,b).getAttribute(zs),10)-1),document.body.classList.add("e-disableuserselect"),i.element.getBoundingClientRect()),e=Cp(e);this.x=e.x-t.left,this.y=e.y-t.top,H.EventHandler.add(i.getContent(),"mousemove",this.mouseMoveHandler,this),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&H.EventHandler.add(i.getHeaderContent(),"mousemove",this.mouseMoveHandler,this),H.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)},r.prototype.clearSelAfterRefresh=function(e){var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;if("virtualscroll"===e.requestType||"dom-virtualscroll"===e.requestType||this.parent.isPersistSelection||t||this.clearSelection(),("virtualscroll"===e.requestType||t||"dom-virtualscroll"===e.requestType)&&this.parent.isPersistSelection&&(!this.isPartialSelection||"dom-virtualscroll"===e.requestType)&&this.isHdrSelectAllClicked){var i=this.parent.getRowsObject().filter(function(e){return e.isSelectable}),n=[];this.selectedRowState={},this.persistSelectedData=[];for(var r=0;r<i.length;r++){n.push(i[parseInt(r.toString(),10)].index);var s=this.getPkValue(this.primaryKey,i[parseInt(r.toString(),10)].data);this.selectedRowState[""+s]=!0,this.persistSelectedData.push(i[parseInt(r.toString(),10)].data)}}},r.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:St,handler:this.enableAfterRender},{event:mt,handler:this.initializeSelection},{event:qt,handler:this.onActionComplete},{event:Ut,handler:this.onActionComplete},{event:wt,handler:this.onPropertyChanged},{event:jt,handler:this.onCellFocused},{event:Wi,handler:this.clearSelAfterRefresh},{event:Xt,handler:this.columnPositionChanged},{event:vt,handler:this.initialEnd},{event:vt,handler:this.reconcileProtectedRowsAfterRefresh},{event:$t,handler:this.rowsRemoved},{event:Rt,handler:this.refreshHeader},{event:Ht,handler:this.destroyAutoFillElements},{event:s,handler:this.destroy}],Kc(this.parent,this.evtHandlers,!0,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.addEventListener(y,this.actionBeginFunction),this.parent.addEventListener(c,this.actionCompleteFunction),this.addEventListener_checkbox())},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(H.EventHandler.remove(document,"mouseup",this.mouseUpHandler),H.EventHandler.remove(this.parent.getContent(),"mousedown",this.mouseDownHandler),H.EventHandler.remove(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler),Kc(this.parent,this.evtHandlers,!1),this.parent.removeEventListener(y,this.actionBeginFunction),this.parent.removeEventListener(c,this.actionCompleteFunction),this.removeEventListener_checkbox(),this.parent.off(Ht,this.destroyAutoFillElements))},r.prototype.wireEvents=function(){this.isMacOS=-1!==navigator.userAgent.indexOf("Mac OS"),this.isMacOS?(H.EventHandler.add(this.parent.element,"keydown",this.keyDownHandler,this),H.EventHandler.add(this.parent.element,"keyup",this.keyUpHandler,this)):this.parent.allowKeyboard||H.EventHandler.add(this.parent.element,"keydown",this.keyDownHandler,this)},r.prototype.unWireEvents=function(){this.isMacOS?(H.EventHandler.remove(this.parent.element,"keydown",this.keyDownHandler),H.EventHandler.remove(this.parent.element,"keyup",this.keyUpHandler)):this.parent.allowKeyboard||H.EventHandler.remove(this.parent.element,"keydown",this.keyDownHandler)},r.prototype.columnPositionChanged=function(){this.parent.isPersistSelection||this.clearSelection()},r.prototype.refreshHeader=function(){this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&!this.parent.getDataModule().isRemote()&&(this.gridCurrentRecord=this.getData()),this.setCheckAllState()},r.prototype.rowsRemoved=function(e){for(var t=0;t<e.records.length;t++){var i=this.getPkValue(this.primaryKey,e.records[parseInt(t.toString(),10)]);delete this.selectedRowState[""+i],--this.totalRecordsCount}this.setCheckAllState()},r.prototype.beforeFragAppend=function(e){"virtualscroll"===e.requestType||this.parent.isPersistSelection||this.clearSelection()},r.prototype.getCheckAllBox=function(){return this.parent.getHeaderContent().querySelector(".e-checkselectall")},r.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.render(),this.initPerisistSelection())},r.prototype.render=function(e){H.EventHandler.add(this.parent.getContent(),"mousedown",this.mouseDownHandler,this),H.EventHandler.add(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler,this)},r.prototype.onPropertyChanged=function(e){var t;e.module===this.getModuleName()&&(t=this.parent,H.isNullOrUndefined(e.properties.type)||("Single"===this.selectionSettings.type?(t.element.removeAttribute("aria-multiselectable"),1<this.selectedRowCellIndexes.length&&(this.clearCellSelection(),this.prevCIdxs=void 0),1<this.selectedRowIndexes.length&&(this.clearRowSelection(),this.prevRowIndex=void 0),1<this.selectedColumnsIndexes.length&&(this.clearColumnSelection(),this.prevColIndex=void 0),this.enableSelectMultiTouch=!1,this.hidePopUp()):"Multiple"===this.selectionSettings.type&&t.element.setAttribute("aria-multiselectable","true")),H.isNullOrUndefined(e.properties.mode)&&H.isNullOrUndefined(e.properties.cellSelectionMode)||(this.clearSelection(),this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevColIndex=void 0),this.isPersisted=!0,this.checkBoxSelectionChanged(),this.isPersisted=!1,this.parent.isCheckBoxSelection||this.initPerisistSelection(),this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&(t.isCheckBoxSelection=!("ResetOnRowClick"===this.selectionSettings.checkboxMode)),this.drawBorders())},r.prototype.hidePopUp=function(){this.parent.element.querySelector(".e-gridpopup")&&this.parent.element.querySelector(".e-gridpopup").getElementsByClassName("e-rowselect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none")},r.prototype.initialEnd=function(){this.selectedRowIndexes.length||(this.parent.off(vt,this.initialEnd),this.selectRow(this.parent.selectedRowIndex))},r.prototype.checkBoxSelectionChanged=function(){var e=this.parent;e.off(vt,this.checkBoxSelectionChanged);var t=(e.enableColumnVirtualization?e.columns:e.getColumns()).filter(function(e){return"checkbox"===e.type});0<t.length&&(e.isCheckBoxSelection=!0,this.chkField=t[0].field,this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount,H.isNullOrUndefined(this.totalRecordsCount)&&(this.totalRecordsCount=this.getCurrentBatchRecordChanges().length),this.isSingleSel()?(e.selectionSettings.type="Multiple",e.dataBind()):this.initPerisistSelection()),e.isCheckBoxSelection||this.isPersisted||(this.chkField=null,this.initPerisistSelection())},r.prototype.initPerisistSelection=function(){var e=this.parent;this.parent.selectionSettings.persistSelection&&0<this.parent.getPrimaryKeyFieldNames().length?(e.isPersistSelection=!0,this.ensureCheckboxFieldSelection()):0<this.parent.getPrimaryKeyFieldNames().length?(e.isPersistSelection=!1,this.ensureCheckboxFieldSelection()):(e.isPersistSelection=!1,this.selectedRowState={})},r.prototype.ensureCheckboxFieldSelection=function(){var e=this.parent;this.primaryKey=this.parent.getPrimaryKeyFieldNames()[0],e.enableVirtualization||e.isRowDomVirtualization()||!this.chkField||(!e.isPersistSelection||0!==Object.keys(this.selectedRowState).length)&&e.isPersistSelection||this.dataSuccess(!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result||this.parent.getDataModule().isRemote()?this.parent.getCurrentViewRecords():this.parent.renderModule.data.dataManager.dataSource.json)},r.prototype.dataSuccess=function(e){for(var t=0;t<e.length;t++){var i=this.getPkValue(this.primaryKey,e[parseInt(t.toString(),10)]),n=e[parseInt(t.toString(),10)][this.chkField];H.isNullOrUndefined(this.selectedRowState[""+i])&&n&&"boolean"==typeof n&&(this.selectedRowState[""+i]=n,this.parent.isPersistSelection)&&this.persistSelectedData.push(e[parseInt(t.toString(),10)])}},r.prototype.setRowSelection=function(e){var t=this;if(!e&&this.hasProtectedRows())this.selectedRowState={},this.nonDeselectableRows.forEach(function(e){t.selectedRowState[t.getPkValue(t.parent.getPrimaryKeyFieldNames()[0],e)]=!0});else if(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)if(e){var i=Object.keys(this.selectedRowState),n=Object.keys(this.unSelectedRowState);if(!this.isCheckboxReset)for(var r=0,s=this.parent.groupSettings.columns.length&&!this.parent.groupSettings.enableLazyLoading&&this.parent.isPersistSelection?this.parent.currentViewData.records:this.parent.currentViewData;r<s.length;r++){var o,a=s[r];H.isNullOrUndefined(a)||H.isNullOrUndefined(a[this.primaryKey])||(o=a[this.primaryKey].toString(),-1===i.indexOf(o)&&-1===n.indexOf(o)&&(this.selectedRowState[a[this.primaryKey]]=!0))}}else this.selectedRowState={},this.unSelectedRowState={},this.rmtHdrChkbxClicked=!1;else if(e)if(this.isPartialSelection&&!this.isHdrSelectAllClicked&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))for(var l=0,h=this.parent.getRowsObject().filter(function(e){return e.isSelectable});l<h.length;l++){var d=h[l];this.selectedRowState[this.getPkValue(this.primaryKey,d.data)]=!0}else{e=this.isPartialSelection?this.parent.partialSelectedRecords:this.getData();if(this.parent.groupSettings.columns.length)for(var p=0,c=this.isPartialSelection?e:e.records;p<c.length;p++){var a=c[p];this.selectedRowState[this.getPkValue(this.primaryKey,a)]=!0}else for(var u=0,g=e;u<g.length;u++){a=g[u];this.selectedRowState[this.getPkValue(this.primaryKey,a)]=!0}}else this.selectedRowState={}},r.prototype.getData=function(){return pu(this.parent)},r.prototype.getAvailableSelectedData=function(e){e=new V.DataManager(e).executeLocal(this.parent.getDataModule().generateQuery(!0));return e=this.parent.groupSettings.columns.length&&e&&e.records?e.records.slice():e},r.prototype.refreshPersistSelection=function(){var t=this,e=this.protectionEnabled()&&this.parent.isPersistSelection;try{this.restoreProtectedRows(),this.hasProtectedRows()&&this.parent.isPersistSelection&&this.nonDeselectableRows.forEach(function(e){t.selectedRowState[t.getPkValue(t.parent.getPrimaryKeyFieldNames()[0],e)]=!0});var i=this.parent.pinnedTopRecords.length||this.isLazyLoadGroup()?this.parent.getAllDataRows(!0):this.parent.getRows();if(this.isLazyLoadGroup()&&(i=i.filter(function(e){return!e.classList.contains("e-groupcaptionrow")})),this.totalRecordsCount=this.parent.getCurrentViewRecords().length,this.parent.allowPaging&&(this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount),!H.isNullOrUndefined(i)&&0<i.length&&(this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling)||this.parent.isPersistSelection||this.chkField)){for(var n=[],r=0;r<i.length;r++){var s,o,a=this.getRowObj(i[parseInt(r.toString(),10)]),l=a&&a.data?this.getPkValue(this.primaryKey,a.data):null;if(null===l)return;this.isPartialSelection&&!a.isSelectable&&!Object.prototype.hasOwnProperty.call(this.selectedRowState,l)||(s=void 0,o=i[parseInt(r.toString(),10)].querySelector(".e-checkselect"),this.selectedRowState[""+l]||"Check"===this.parent.checkAllRows&&this.selectedRowState[""+l]&&this.totalRecordsCount===Object.keys(this.selectedRowState).length&&this.chkAllCollec.indexOf(l)<0||"Uncheck"===this.parent.checkAllRows&&0<this.chkAllCollec.indexOf(l)&&!this.parent.selectedRowIndex||"Intermediate"===this.parent.checkAllRows&&!H.isNullOrUndefined(this.chkField)&&a.data[this.chkField]?(n.push(parseInt(i[parseInt(r.toString(),10)].getAttribute(D),10)-1),s=!0):(s=!1,this.checkedTarget!==o&&this.parent.isCheckBoxSelection&&o&&Xp(o.nextElementSibling,s)),e&&!s?a.isSelected=!1:this.updatePersistCollection(i[parseInt(r.toString(),10)],s))}this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableSelectedData(this.persistSelectedData).length,this.isSingleSel()&&0<n.length?this.selectRow(n[0],!1):this.selectRowsWithCallback(n,void 0,e)}else this.parent.isCheckBoxSelection&&this.isLazyLoadPersistSelection()&&(this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableSelectedData(this.persistSelectedData).length,this.selectedRecords=[],this.parent.allowPaging?this.selectedRowIndexes=[]:this.selectedRowIndexes=Object.keys(this.persistSelectedData).map(function(e){return parseInt(e,10)}));(this.parent.isCheckBoxSelection||"ResetOnRowClick"===this.parent.selectionSettings.checkboxMode)&&0<this.getCurrentBatchRecordChanges().length&&this.setCheckAllState()}finally{e&&(this.isPrevRowSelection=!1)}this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCountLessMode&&this.parent.isLastRecordLoaded&&0===this.countLessTotalRecords&&0<this.totalRecordsCount&&(this.countLessTotalRecords=this.totalRecordsCount)},r.prototype.actionBegin=function(e){if("save"===e.requestType&&this.parent.isPersistSelection){var t=this.parent.element.querySelector(".e-edit-checkselect");if(!H.isNullOrUndefined(t)){var i=H.closest(t,"."+Os);if(i){"Dialog"===this.parent.editSettings.mode&&(i=this.parent.element.querySelector(".e-dlgeditrow"));i=this.getRowObj(i);if(!i)return;this.selectedRowState[this.getPkValue(this.primaryKey,i.data)]=i.isSelected=t.checked}else this.isCheckedOnAdd=t.checked,this.isCheckedOnAdd&&"add"===e.action&&(this.selectedRowState[this.getPkValue(this.primaryKey,e.data)]=!0)}}this.parent.isPersistSelection&&this.isPartialSelection&&"paging"===e.requestType&&(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.selectedRowIndexes=[])},r.prototype.actionComplete=function(e){if("save"===e.requestType&&this.parent.isPersistSelection&&("add"===e.action&&(this.isHdrSelectAllClicked=!1),this.isPartialSelection)&&(this.partialSelectableRecordsCount=this.parent.partialSelectedRecords.length&&this.getAvailableDataCount(this.parent.partialSelectedRecords),this.disableSelectableRecordsCount=this.parent.disableSelectedRecords.length&&this.getAvailableDataCount(this.parent.disableSelectedRecords),!H.isNullOrUndefined(this.getCheckAllBox())&&this.getCheckAllBox().nextElementSibling.classList.contains("e-check")||!H.isNullOrUndefined(e.row.querySelector(".e-checkselect"))&&e.row.querySelector(".e-checkselect").parentElement.classList.contains("e-checkbox-disabled"))&&(this.updatePersistCollection(e.row,!0),this.setCheckAllState()),"delete"===e.requestType&&this.nonDeselectableRows.size)for(var t=0,i=e.data;t<i.length;t++){var n=i[t];this.nonDeselectableRows.delete(this.protectionKey(n))}if("delete"===e.requestType&&this.parent.isPersistSelection){for(var r=e.data.slice(),s=0;s<r.length;s++){var o=this.getPkValue(this.primaryKey,r[parseInt(s.toString(),10)]);H.isNullOrUndefined(o)||this.updatePersistDelete(o,this.isPartialSelection)}this.isHdrSelectAllClicked=!1,this.setCheckAllState(),H.isNullOrUndefined(this.parent.pageSettings.totalRecordsCount)||(this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount)}if("paging"===e.requestType){if(this.parent.isPersistSelection&&this.isPartialSelection&&this.isHdrSelectAllClicked){for(var a=this.parent.getRowsObject(),l=[],s=0;s<a.length;s++)a[parseInt(s.toString(),10)].isSelectable&&l.push(a[parseInt(s.toString(),10)].index);l.length&&this.selectRows(l)}this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevECIdxs=void 0}},r.prototype.onDataBound=function(){if(this.protectionEnabled(),this.parent.getColumns().filter(function(e){return"checkbox"===e.type}).length&&!this.parent.getDataModule().isRemote()&&(this.gridCurrentRecord=this.getData()),this.parent.pinnedTopRecords.length&&this.setPinnedSelectionIndexes(),this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||!this.parent.isPersistSelection||this.selectedRecords.length&&(this.isPrevRowSelection=!0),((this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&this.rmtHdrChkbxClicked||this.isPartialSelection&&this.parent.isPersistSelection&&this.isHdrSelectAllClicked)&&("Intermediate"===this.parent.checkAllRows?this.setRowSelection(!0):"Uncheck"!==this.parent.checkAllRows||this.protectionEnabled()&&this.parent.isPersistSelection||this.setRowSelection(!1)),this.partialSelectableRecordsCount=this.parent.partialSelectedRecords.length&&this.getAvailableDataCount(this.parent.partialSelectedRecords),this.disableSelectableRecordsCount=this.parent.disableSelectedRecords.length&&this.getAvailableDataCount(this.parent.disableSelectedRecords),(this.parent.enableVirtualization||this.parent.isRowDomVirtualization())&&this.setCheckAllState(),(this.hasProtectedRows()||this.parent.isPersistSelection||this.contentRenderer&&H.isNullOrUndefined(this.contentRenderer.requestType)&&this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling))&&this.refreshPersistSelection(),this.initialRowSelection=!!(this.isRowType()&&this.parent.element.querySelectorAll(".e-selectionbackground")&&this.parent.getSelectedRows().length),this.parent.isCheckBoxSelection&&!this.initialRowSelection&&!this.isLazyLoadPersistSelection()){for(var e=this.parent.getRowsObject(),t=[],i=0;i<e.length;i++)e[parseInt(i.toString(),10)].isSelected&&t.push(i);t.length&&this.selectRows(t),this.initialRowSelection=!0}},r.prototype.updatePersistSelectedData=function(e){var t=this;if((e||!this.hasProtectedRows())&&(this.parent.isPersistSelection||this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling))){var i,n,r=[],s=("Check"===this.parent.checkAllRows&&(0<this.parent.searchSettings.key.length||0<this.parent.filterSettings.columns.length)&&this.persistSelectedData.length&&!(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&!this.isPartialSelection&&(i=this.getAvailableSelectedData(this.persistSelectedData),n=new Set(i.map(function(e){return e[t.primaryKey]})),r=this.persistSelectedData.filter(function(e){return!n.has(e[t.primaryKey])})),this.isLazyLoadPersistSelection()?this.parent.getDataRows():this.parent.getRows());this.isLazyLoadPersistSelection()&&(s=s.filter(function(e){return!e.classList.contains("e-groupcaptionrow")}));for(var o=0;o<s.length;o++)this.updatePersistCollection(s[parseInt(o.toString(),10)],e);if("Uncheck"===this.parent.checkAllRows)this.setRowSelection(!1),this.persistSelectedData=this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result?this.persistSelectedData:[];else if("Check"===this.parent.checkAllRows&&(this.setRowSelection(!0),this.persistSelectedData=this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result||this.isPartialSelection?this.isPartialSelection&&this.parent.partialSelectedRecords.length?this.parent.partialSelectedRecords.slice():this.persistSelectedData:(this.parent.groupSettings.columns.length?this.getData().records:this.getData()).slice(),0<r.length))for(o=0;o<r.length;o++)this.persistSelectedData.push(r[parseInt(o.toString(),10)]);this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableDataCount(this.persistSelectedData)}},r.prototype.checkSelectAllAction=function(r){var e,s=this,t=this.getRenderer(),i=this.parent.element.querySelector(".e-gridform");this.checkedTarget=this.getCheckAllBox(),this.isLazyLoadPersistSelection()&&!this.parent.isRemote()&&(this.isRowSelected=this.selectedRowIndexes.length&&!0),r&&this.getCurrentBatchRecordChanges().length?(e=t.getVirtualRowIndex(0),t=t.getVirtualRowIndex(this.getCurrentBatchRecordChanges().length-1+this.parent.pinnedTopRowModels.length),this.selectRowsWithCallback(this.getCollectionFromIndexes(e,t),function(){if(s.parent.checkAllRows="Check",s.updatePersistSelectedData(r),s.checkVirtualCheckBox()&&!s.parent.isPersistSelection?(s.virtualSelectedData=s.virtualCheckBoxData().slice(),s.selectedRowIndexes=Object.keys(s.virtualSelectedData).map(function(e){return parseInt(e,10)})):!(s.parent.getDataModule().isRemote()||!H.isNullOrUndefined(s.parent.dataSource)&&s.parent.dataSource.result)&&s.parent.isCheckBoxSelection&&s.isPartialSelection&&!s.isLazyLoadPersistSelection()&&0<s.parent.partialSelectedRecords.length?s.parent.isPersistSelection?(s.persistSelectedData=s.parent.partialSelectedRecords.slice(),s.persistSelectedRecordsCount=s.persistSelectedData.length&&s.getAvailableDataCount(s.persistSelectedData)):(s.partialSelectedData=s.parent.partialSelectedRecords.slice(),s.partialSelectedRecordsCount=s.partialSelectedData.length&&s.getAvailableDataCount(s.partialSelectedData)):s.isLazyLoadPersistSelection()&&!s.parent.isRemote()?(s.persistSelectedData=(s.isPartialSelection?s.parent.partialSelectedRecords:s.getData().records).slice(),s.parent.allowPaging||(s.selectedRowIndexes=s.isPartialSelection?s.parent.partialSelectedIndexes.slice():Object.keys(s.persistSelectedData).map(function(e){return parseInt(e,10)}))):s.parent.isPersistSelection&&s.parent.isRemote()&&s.parent.groupSettings.columns.length&&s.parent.groupSettings.enableLazyLoading&&(s.persistSelectedData=(s.parent.enableVirtualization?s.parent.lazyLoadRender:s.parent.contentModule).getAllPagesData(),s.persistSelectedRecordsCount=s.persistSelectedData.length),s.parent.isPersistSelection&&s.protectionEnabled())for(var e=0,t=s.persistSelectedData;e<t.length;e++){var i=t[e],n="function"!=typeof s.parent.isRowSelectable||s.parent.isRowSelectable(i,s.parent.getColumns());s.registerProtectedRecord(i,n)}},this.parent.isPersistSelection&&this.protectionEnabled()),this.selectRowIndex(t)):(this.parent.checkAllRows="Uncheck",this.updatePersistSelectedData(r),this.clearSelection()),this.chkAllCollec=[],H.isNullOrUndefined(i)||i.closest(".e-addedrow")||(e=i.querySelector(".e-edit-checkselect"),H.isNullOrUndefined(e))||Xp(e.nextElementSibling,r)},r.prototype.checkSelectAll=function(e){var t=this,i=this.getCheckAllStatus(e),n="Check"===i;if(this.isHeaderCheckboxClicked=!0,(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&("Uncheck"===i||this.isCheckboxReset||"Intermediate"===i&&(this.parent.isPersistSelection||this.parent.isRemote()))?this.rmtHdrChkbxClicked=!0:this.rmtHdrChkbxClicked=!1,this.rmtHdrChkbxClicked&&this.isCheckboxReset&&(this.unSelectedRowState={}),this.isCheckboxReset=!1,"Intermediate"===i&&(this.chkField||this.parent.isPersistSelection||(n=this.getCurrentBatchRecordChanges().some(function(e){return t.getPkValue(t.primaryKey,e)in t.selectedRowState})),this.parent.isPersistSelection||this.parent.isRemote()))if(this.parent.allowPaging&&this.isPartialSelection)for(var r=this.parent.getRowsObject(),s=0;s<r.length;s++){if(r[s].isDataRow&&r[s].isSelectable&&!r[s].isSelected){n=!1;break}n=!0}else if(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result){var o=this.parent.renderModule&&this.parent.renderModule.selectableDataKey,a=this.getCurrentBatchRecordChanges();this.isLazyLoadPersistSelection()&&(a=a.filter(function(e){return!e.key})).length&&(a=Object.keys(a).map(function(e){return a[parseInt(e,10)]}));for(s=0;s<a.length;s++){var l=this.getPkValue(this.primaryKey,a[parseInt(s.toString(),10)]);if(!this.isPartialSelection&&!H.isNullOrUndefined(l)||this.isPartialSelection&&o[""+l]){if(!Object.keys(this.selectedRowState).includes(l.toString())){n=!1;break}n=!0}}}this.parent.isPersistSelection&&this.parent.allowPaging&&(this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount),this.checkSelectAllAction(!n),this.partialSelectableRecordsCount=this.parent.partialSelectedRecords.length&&this.getAvailableDataCount(this.parent.partialSelectedRecords),this.disableSelectableRecordsCount=this.parent.disableSelectedRecords.length&&this.getAvailableDataCount(this.parent.disableSelectedRecords),this.target=null,0<this.getCurrentBatchRecordChanges().length&&(this.setCheckAllState(),this.updateSelectedRowIndexes()),this.triggerChkChangeEvent(e,!n)},r.prototype.getCheckAllStatus=function(e){H.isNullOrUndefined(e)?H.isNullOrUndefined(this.getCheckAllBox())||(t=this.getCheckAllBox().nextElementSibling.classList):t=e.nextElementSibling.classList;var t,e="None";return t instanceof DOMTokenList&&(t.contains("e-check")?e="Check":t.contains("e-uncheck")?e="Uncheck":t.contains("e-stop")&&(e="Intermediate")),e},r.prototype.checkSelect=function(e){var t,i=H.closest(this.checkedTarget,"."+b),n=this.parent,r=(this.isMultiCtrlRequest=!0,0);this.isHeaderCheckboxClicked=!1,r=!tc(n)||(t=i.parentElement.getAttribute("data-uid"),this.parent.enableVirtualization&&this.parent.groupSettings.columns.length)?parseInt(i.parentElement.getAttribute(D),10)-1:n.getRows().map(function(e){return e.getAttribute("data-uid")}).indexOf(t),this.parent.isPersistSelection&&0<this.parent.element.getElementsByClassName(As).length&&"Top"===this.parent.editSettings.newRowPosition&&!this.parent.editSettings.showAddNewRow&&++r,this.rowCellSelectionHandler(r,parseInt(i.getAttribute(zs),10)-1),this.partialSelectableRecordsCount=this.parent.partialSelectedRecords.length&&this.getAvailableDataCount(this.parent.partialSelectedRecords),this.disableSelectableRecordsCount=this.parent.disableSelectedRecords.length&&this.getAvailableDataCount(this.parent.disableSelectedRecords),this.parent.isPersistSelection?this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableDataCount(this.persistSelectedData):this.partialSelectedRecordsCount=this.partialSelectedData.length&&this.getAvailableDataCount(this.partialSelectedData),this.moveIntoUncheckCollection(H.closest(i,"."+Ts)),this.setCheckAllState(),this.isMultiCtrlRequest=!1,this.triggerChkChangeEvent(e,e.nextElementSibling.classList.contains("e-check"))},r.prototype.moveIntoUncheckCollection=function(e){"Check"!==this.parent.checkAllRows&&"Uncheck"!==this.parent.checkAllRows||(e=(e=this.getRowObj(e))&&e.data?this.getPkValue(this.primaryKey,e.data):null)&&(this.chkAllCollec.indexOf(e)<0?this.chkAllCollec.push(e):this.chkAllCollec.splice(this.chkAllCollec.indexOf(e),1))},r.prototype.triggerChkChangeEvent=function(e,t){this.parent.trigger(it,{checked:t,selectedRowIndexes:this.parent.getSelectedRowIndexes(),target:e});t=this.parent.getContent(),e=!(!t||!t.querySelector(".e-rowcell .e-unboundcelldiv"));(!this.parent.isEdit||e&&this.parent.isEdit&&this.parent.editSettings.showAddNewRow&&this.selectionSettings.persistSelection)&&(this.checkedTarget=null)},r.prototype.updateSelectedRowIndexes=function(){if(this.parent.isCheckBoxSelection&&(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling)&&this.isPartialSelection&&!(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.selectionSettings.persistSelection&&!this.isHdrSelectAllClicked&&"Uncheck"!==this.parent.checkAllRows)for(var e=0,t=n=this.parent.getRowsObject().filter(function(e){return e.isSelectable});e<t.length;e++){var i=t[e];this.selectedRowIndexes.push(i.index)}var n;if(this.parent.isCheckBoxSelection&&(this.parent.enableVirtualization||this.parent.isRowDomVirtualization())&&!this.isPartialSelection&&(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&!this.parent.isPersistSelection&&"Check"===this.parent.checkAllRows&&(n=this.parent.getRowsObject().filter(function(e){return e.isSelectable})).length!==this.selectedRowIndexes.length)for(var r=0,s=n;r<s.length;r++){i=s[r];this.selectedRowIndexes.indexOf(i.index)<=-1&&this.selectedRowIndexes.push(i.index)}},r.prototype.updateSelectedRowIndex=function(e){var t;if(this.parent.isCheckBoxSelection&&(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling)&&!(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result))if("Check"===this.parent.checkAllRows&&H.isNullOrUndefined(e))if(this.selectedRowIndexes=[],this.isPartialSelection)this.selectedRowIndexes=this.parent.partialSelectedIndexes.slice();else{var i=(this.parent.groupSettings.columns.length?this.getData().records:this.getData()).length;this.parent.pinnedTopRowModels.length&&(i+=this.parent.pinnedTopRowModels.length);for(var n=0;n<i;n++)this.selectedRowIndexes.push(n)}else"Uncheck"===this.parent.checkAllRows?this.selectedRowIndexes=[]:(t=this.parent.getRowByIndex(e),e&&t&&"false"===t.getAttribute("aria-selected")&&(t=this.selectedRowIndexes.indexOf(e),this.selectedRowIndexes.splice(t,1)))},r.prototype.isAllSelected=function(e){if(this.parent.getDataModule().isRemote()&&this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings&&this.parent.infiniteScrollSettings.enableCountLessMode)return!0===this.parent.isLastRecordLoaded&&this.getAvailableSelectedData(this.persistSelectedData).length===this.totalRecordsCount;if(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)return this.getAvailableSelectedData(this.persistSelectedData).length===(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||this.isLazyLoadGroup()?this.parent.totalDataRecordsCount:this.totalRecordsCount);if(this.isPartialSelection){if(this.parent.allowPaging&&!this.selectionSettings.persistSelection&&this.parent.pageSettings.pageSize<this.parent.pageSettings.totalRecordsCount){for(var t=this.parent.partialSelectedRecords,i=0;i<t.length;i++){var n=this.getPkValue(this.primaryKey,t[parseInt(i.toString(),10)]);if(!this.selectedRowState[""+n])return!1}return!0}return this.isSelectAllRowCount(e)}t=this.getData();this.parent.groupSettings.columns.length&&t.records&&(t=t.records);for(i=0;i<t.length;i++){n=this.getPkValue(this.primaryKey,t[parseInt(i.toString(),10)]);if(!this.selectedRowState[""+n])return!1}return!0},r.prototype.someDataSelected=function(){if((this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.parent.searchSettings.key.length||this.parent.filterSettings.columns.length))for(var e=this.getAvailableSelectedData(this.persistSelectedData),t=0;t<e.length;t++){var i=this.getPkValue(this.primaryKey,e[parseInt(t.toString(),10)]);if(this.selectedRowState[""+i])return!1}for(var n=this.isPartialSelection?this.getAvailableSelectedData(this.parent.partialSelectedRecords):this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result?[]:this.isLazyLoadPersistSelection()?this.parent.getCurrentViewRecords():this.getData(),t=0;t<n.length;t++){i=this.getPkValue(this.primaryKey,n[parseInt(t.toString(),10)]);if(this.selectedRowState[""+i])return!1}return!0},r.prototype.setCheckAllState=function(e,t){var i,n,r,s,o,a,l;(this.parent.isCheckBoxSelection||"ResetOnRowClick"===this.parent.selectionSettings.checkboxMode)&&(n=i=l=!1,r=Object.keys(this.selectedRowState).length,this.parent.element.classList.contains("e-treelistgrid")&&this.parent.isPersistSelection&&!this.parent.enableVirtualization&&!this.parent.getDataModule().isRemote()&&Array.isArray(this.parent.dataSource)&&r===this.parent.dataSource.length&&r>this.totalRecordsCount&&(r=this.totalRecordsCount),this.parent.isPersistSelection||this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)||(r=this.selectedRowIndexes.length,this.totalRecordsCount=this.getCurrentBatchRecordChanges().length),!this.parent.isPersistSelection||(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&this.isPartialSelection||!this.parent.searchSettings.key.length&&!this.parent.filterSettings.columns.length||(i=!0,l=this.isAllSelected(r)),this.parent.isPersistSelection&&this.parent.getDataModule().isRemote()&&0<this.parent.sortSettings.columns.length&&(n=!0),s=this.getCheckAllBox())&&(o=s.nextElementSibling,H.removeClass([o],["e-check","e-stop","e-uncheck"]),Wp(s,!1),s.indeterminate=!1,a=this.parent.getDataModule().isRemote()?[]:this.gridCurrentRecord,this.parent.groupSettings.columns.length&&a.records&&(a=a.records),this.totalRecordsCount=this.checkVirtualCheckBox()||this.isLazyLoadPersistSelection()?a.length:this.totalRecordsCount,l&&i&&(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result||a.length)||!i&&(r===this.totalRecordsCount&&this.totalRecordsCount&&!this.isPartialSelection&&(!(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)||this.parent.allowPaging)||this.parent.isRemote()&&this.isLazyLoadPersistSelection()&&r===this.parent.totalDataRecordsCount||!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling&&this.isPartialSelection&&(this.isSelectAllRowCount(r)||this.isHdrSelectAllClicked&&!this.parent.isPersistSelection)||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!this.parent.allowPaging&&(!(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&a.length&&r===a.length||(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&!this.isPartialSelection&&(r===this.parent.totalDataRecordsCount&&(!this.isCountLessMode()||0!==r)||(this.isSelectAllRowCount(r)||r===this.totalRecordsCount)&&!this.parent.isPersistSelection&&!this.parent.isRemote())||this.isPartialSelection&&(0<r&&this.isHdrSelectAllClicked||this.isSelectAllRowCount(r))||this.parent.isPersistSelection&&this.isCountLessMode()&&this.parent.isLastRecordLoaded&&r===this.totalRecordsCount&&0===this.parent.totalDataRecordsCount)||r===this.totalRecordsCount&&this.totalRecordsCount&&!this.isPartialSelection&&!this.parent.allowPaging&&!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling)||this.isCountLessMode()&&(i||n)&&this.parent.isPersistSelection&&this.countLessTotalRecords===r&&0!==r?(H.addClass([o],["e-check"]),Wp(s,!0),t&&this.getRenderer().setSelection(null,!0,!0),this.parent.checkAllRows="Check"):(!this.selectedRowIndexes.length&&(!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||!this.persistSelectedData.length&&!i||i&&this.someDataSelected())||0===r&&0===this.getCurrentBatchRecordChanges().length)&&!this.parent.allowPaging||this.parent.allowPaging&&!this.isLazyLoadPersistSelection()&&(0===r||r&&i&&this.someDataSelected())||this.isLazyLoadPersistSelection()&&0===this.persistSelectedRecordsCount||this.isCountLessMode()&&0===r?(H.addClass([o],["e-uncheck"]),t&&this.getRenderer().setSelection(null,!1,!0),this.parent.checkAllRows="Uncheck"):(H.addClass([o],["e-stop"]),this.parent.checkAllRows="Intermediate",s.indeterminate=!0),"Check"!==this.parent.checkAllRows&&"Uncheck"!==this.parent.checkAllRows||(this.chkAllCollec=[]),this.parent.isEdit&&!(this.parent.editModule&&this.parent.editModule.editModule&&this.parent.editModule.editModule.initialRender)&&!this.parent.isPersistSelection||0===r&&0===this.getCurrentBatchRecordChanges().length||this.parent.isRemote()&&"Uncheck"===this.parent.checkAllRows&&this.isLazyLoadPersistSelection()&&0===(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).getAllPagesData().length?H.addClass([o.parentElement],["e-checkbox-disabled"]):H.removeClass([o.parentElement],["e-checkbox-disabled"]),this.isPartialSelection&&(l=this.parent.getRowsObject().filter(function(e){return e.isSelectable}).length,this.parent.isEdit&&!(this.parent.editModule&&this.parent.editModule.editModule&&this.parent.editModule.editModule.initialRender)&&!this.parent.isPersistSelection||0===l&&this.disableSelectableRecordsCount===this.totalRecordsCount&&o.parentElement.querySelector(".e-frame").classList.contains("e-uncheck")?H.addClass([o.parentElement],["e-checkbox-disabled"]):H.removeClass([o.parentElement],["e-checkbox-disabled"])),!(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling)||this.parent.allowPaging||this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result||this.updateSelectedRowIndex(e))},r.prototype.checkVirtualCheckBox=function(){return(this.parent.enableVirtualization||this.parent.isRowDomVirtualization())&&!(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.isCheckBoxSelection&&!this.isPartialSelection},r.prototype.isLazyLoadGroup=function(){return this.parent.groupSettings&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading},r.prototype.isLazyLoadPersistSelection=function(){return this.parent.isPersistSelection&&this.isLazyLoadGroup()},r.prototype.virtualCheckBoxData=function(){var e=this.getData();return e=this.parent.groupSettings.columns.length&&e.records?e.records:e},r.prototype.isSelectAllRowCount=function(e){var t,i,n=0,r=this.parent.getRowsObject();return!this.isPartialSelection&&(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?(t=this.parent.totalDataRecordsCount,!!(this.parent.infiniteScrollSettings&&this.parent.infiniteScrollSettings.enableCountLessMode&&0===t||t===r.length)&&(n=r.filter(function(e){return e.isSelectable}).length)&&e===n):(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling)&&this.isPartialSelection?(i=this.parent.isPersistSelection||this.parent.isRemote()?this.persistSelectedRecordsCount:this.partialSelectedRecordsCount,(n=this.disableSelectableRecordsCount+this.partialSelectableRecordsCount)===(this.parent.isRemote()?this.parent.infiniteScrollSettings&&this.parent.infiniteScrollSettings.enableCountLessMode&&this.parent.isLastRecordLoaded?this.totalRecordsCount:this.parent.totalDataRecordsCount:this.parent.allowGrouping&&"records"in this.getData()?this.getData().records.length:this.getData()&&this.getData().length)&&0!==i&&i===this.partialSelectableRecordsCount):(this.parent.allowPaging||this.isPartialSelection)&&this.parent.selectionSettings.persistSelection?(i=this.persistSelectedRecordsCount,(n=this.disableSelectableRecordsCount+this.partialSelectableRecordsCount)===this.totalRecordsCount&&0!==i&&i===this.partialSelectableRecordsCount):(n=r.filter(function(e){return e.isSelectable}).length)&&e===n},r.prototype.keyDownHandler=function(e){("opera"===H.Browser.info.name&&17===e.keyCode||"mozilla"===H.Browser.info.name&&224===e.keyCode||!("safari"!==H.Browser.info.name&&"chrome"!==H.Browser.info.name||91!==e.keyCode&&93!==e.keyCode))&&(this.cmdKeyPressed=!0);var t=I(e.target,"e-headercell"),i=I(e.target,b);(t?t.children[0].classList.contains("e-headerchkcelldiv"):!!i&&i.classList.contains("e-gridchkbox"))&&!this.parent.allowKeyboard&&32===e.keyCode&&e.preventDefault()},r.prototype.keyUpHandler=function(e){!("opera"===H.Browser.info.name&&17===e.keyCode||"mozilla"===H.Browser.info.name&&224===e.keyCode)&&("safari"!==H.Browser.info.name&&"chrome"!==H.Browser.info.name||91!==e.keyCode&&93!==e.keyCode)||(this.cmdKeyPressed=!1)},r.prototype.clickHandler=function(e){var t,i,n,r=e.target;this.actualTarget=r,this.parent.isEdit&&this.parent.element.querySelector(".e-formula-edit")&&r.classList.contains("e-rowcell")&&this.parent.enableAutoFill&&"Cell"===this.selectionSettings.mode&&"Multiple"===this.selectionSettings.type&&-1<this.selectionSettings.cellSelectionMode.indexOf("Box")||(this.isAutoFillSel||e.ctrlKey||e.shiftKey||(this.startAFCell=this.endAFCell=null),this.selectionSettings.persistSelection&&(this.deSelectedData=this.persistSelectedData.slice()),(I(r,Ts)||I(r,"e-headerchkcelldiv")||this.selectionSettings.allowColumnSelection&&r.classList.contains("e-headercell"))&&(this.isInteracted=!0),this.cmdKeyPressed=e.metaKey,this.isMultiCtrlRequest=e.ctrlKey||this.enableSelectMultiTouch||this.isMacOS&&this.cmdKeyPressed,this.parent.allowKeyboard?this.isMultiShiftRequest=e.shiftKey:(this.isMultiShiftRequest=!1,this.isMultiCtrlRequest=!1),this.actualCtrlKeyPressed=this.parent.allowKeyboard&&(e.ctrlKey||this.isMacOS&&this.cmdKeyPressed),this.isMultiCtrlRequestCell=this.isMultiCtrlRequest,this.popUpClickHandler(e),this.preventFocus=!(n=!1),i=I(r,"e-checkbox-wrapper"),this.checkSelectAllClicked=!!(i&&i.getElementsByClassName("e-checkselectall")||this.selectionSettings.persistSelection&&I(r,Ts)),this.selectionSettings.persistSelection&&this.isPartialSelection&&I(r,"e-headerchkcelldiv")&&!r.querySelector(".e-checkbox-disabled")&&!(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.isHdrSelectAllClicked=!0),i&&0<i.querySelectorAll(".e-checkselect,.e-checkselectall").length&&(t=i.querySelector('input[type="checkbox"]'),n=!0),this.drawBorders(),this.updateAutoFillPosition(),r=I(r,b),this.parent.isReact&&r&&!r.parentElement&&r.classList.contains("e-rowcell")&&(r=this.parent.getCellFromIndex(parseInt(r.getAttribute("data-index"),10),parseInt(r.getAttribute("aria-colindex"),10)-1)),this.isRowDragSelected&&H.isNullOrUndefined(r)&&this.parent.allowRowDragAndDrop&&this.checkSelectAllClicked&&(this.isRowDragSelected=!1),(r&&r.parentElement.classList.contains(Ts)&&!this.parent.selectionSettings.checkboxOnly||n)&&!this.isRowDragSelected?(this.parent.isCheckBoxSelection&&(this.isMultiCtrlRequest=!0),this.target=r,H.isNullOrUndefined(t)?(i=0,i=parseInt(r.parentElement.getAttribute(D),10)-1,this.parent.isPersistSelection&&!this.parent.editSettings.showAddNewRow&&0<this.parent.element.getElementsByClassName(As).length&&++i,this.mUPTarget&&this.mUPTarget.isEqualNode(r)||this.rowCellSelectionHandler(i,parseInt(r.getAttribute(zs),10)-1),this.parent.isCheckBoxSelection&&(this.moveIntoUncheckCollection(H.closest(r,"."+Ts)),this.setCheckAllState())):(this.checkedTarget=t).classList.contains("e-checkselectall")?this.checkSelectAll(t):this.checkSelect(t),this.parent.isCheckBoxSelection||!H.Browser.isDevice||this.isSingleSel()||this.showPopup(e)):e.target.classList.contains("e-headercell")&&!e.target.classList.contains("e-stackedheadercell")&&(n=e.target.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"),this.headerSelectionHandler(this.parent.getColumnIndexByUid(n))),this.isMultiCtrlRequest=!1,this.isMultiCtrlRequestCell=this.isMultiCtrlRequest,this.isMultiShiftRequest=!1,H.isNullOrUndefined(H.closest(e.target,".e-unboundcell"))&&(this.preventFocus=!1))},r.prototype.popUpClickHandler=function(e){var t=e.target;H.closest(t,".e-headercell")||e.target.classList.contains(b)||H.closest(t,".e-gridpopup")?t.classList.contains("e-rowselect")&&(t.classList.contains("e-spanclicked")?(t.classList.remove("e-spanclicked"),this.enableSelectMultiTouch=!1,this.parent.element.querySelector(".e-gridpopup").style.display="none"):(t.classList.add("e-spanclicked"),this.enableSelectMultiTouch=!0)):this.parent.element.querySelector(".e-gridpopup").style.display="none"},r.prototype.showPopup=function(e){this.selectionSettings.enableSimpleMultiRowSelection||gp(this.parent.element.querySelector(".e-gridpopup"),e,"e-rowselect e-icons e-icon-rowselect"+(!this.isSingleSel()&&(1<this.selectedRecords.length||1<this.selectedRowCellIndexes.length)?" e-spanclicked":""))},r.prototype.rowCellSelectionHandler=function(e,t){var i,n;!this.isMultiCtrlRequest&&!this.isMultiShiftRequest||this.isSingleSel()?(this.isDragged||this.selectRow(e,this.selectionSettings.enableToggle),this.selectCell({rowIndex:e,cellIndex:t},this.selectionSettings.enableToggle),this.selectedRowCellIndexes.length&&this.updateAutoFillPosition(),this.drawBorders()):this.isMultiShiftRequest?(i=H.closest(this.target,"."+b).classList.contains(Es),this.parent.isCheckBoxSelection||!this.parent.isCheckBoxSelection&&!i||this.parent.getColumns().some(function(e){return"checkbox"===e.type})&&"ResetOnRowClick"===this.selectionSettings.checkboxMode&&i?this.selectRowsByRange(H.isUndefined(this.prevRowIndex)?e:this.prevRowIndex,e):this.addRowsToSelection([e]),this.selectCellsByRange(H.isUndefined(this.prevCIdxs)?{rowIndex:e,cellIndex:t}:this.prevCIdxs,{rowIndex:e,cellIndex:t}),this.updateAutoFillPosition(),this.drawBorders()):(this.addRowsToSelection([e]),"Both"===this.selectionSettings.mode?(n=(i=this.parent.getColumns().find(function(e){return"checkbox"===e.type}))&&i.index!==t)&&!this.isMultiCtrlRequestCell?this.selectCell({rowIndex:e,cellIndex:t},this.selectionSettings.enableToggle):i&&!n||this.addCellsToSelection([{rowIndex:e,cellIndex:t}]):this.addCellsToSelection([{rowIndex:e,cellIndex:t}]),this.showHideBorders("none")),this.isDragged=!1},r.prototype.onCellFocused=function(e){(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&e.container.isHeader&&e.byKey&&("upArrow"===e.keyArgs.action?this.parent.allowFiltering?e.isJump="INPUT"===e.element.tagName:e.isJump="TH"===e.element.tagName:"downArrow"===e.keyArgs.action?(t=Number(e.element.parentElement.getAttribute(D))-1,e.isJump=0==t):"ctrlHome"===e.keyArgs.action&&(e.isJump=!0));var t=(e.container.isHeader&&e.isJump||e.container.isContent&&!e.container.isSelectable)&&!(e.byKey&&"space"===e.keyArgs.action)&&!(e.element.classList.contains("e-detailrowexpand")||e.element.classList.contains("e-detailrowcollapse")),i=e.container.isHeader&&"TD"!==e.element.tagName&&!H.closest(e.element,"."+b)&&!(e.byKey&&"space"===e.keyArgs.action);if(!e.byKey||t)t&&!(this.parent.isCheckBoxSelection||this.selectionSettings.persistSelection&&(e.parent.classList.contains("e-recordplusexpand")||e.parent.classList.contains("e-recordpluscollapse")||e.parent.classList.contains("e-groupcaption")))&&this.clearSelection();else{var t=(e.container.isContent?e.container:e).indexes,n=t[0],r=t[1],t=this.focus.getPrevIndexes();if((e.element.parentElement.querySelector(".e-rowcelldrag")||e.element.parentElement.querySelector(".e-dtdiagonalright")||e.element.parentElement.querySelector(".e-dtdiagonaldown"))&&(t.cellIndex=t.cellIndex-1),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(e.container.isHeader&&("TD"===e.element.tagName||H.closest(e.element,"."+b))?(s=this.parent.getHeaderTable().querySelector("thead").childElementCount,this.parent.editSettings.showAddNewRow&&"Top"===this.parent.editSettings.newRowPosition&&"upArrow"===e.keyArgs.action&&s++,n-=s,t.rowIndex=H.isNullOrUndefined(t.rowIndex)?null:t.rowIndex-s):(n+=this.parent.frozenRows||this.parent.pinnedTopRecords.length,t.rowIndex=0!==t.rowIndex&&H.isNullOrUndefined(t.rowIndex)?null:t.rowIndex+(this.parent.frozenRows||this.parent.pinnedTopRecords.length))),this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&(n=parseInt(e.element.parentElement.getAttribute("aria-rowindex"),10)-1),!(i||-1===["ctrlPlusA","escape"].indexOf(e.keyArgs.action)&&"space"!==e.keyArgs.action&&n===t.rowIndex&&r===t.cellIndex)||this.selectionSettings.allowColumnSelection){(this.parent.enableVirtualization||this.parent.isRowDomVirtualization())&&(n=parseInt(e.element.parentElement.getAttribute("aria-rowindex"),10)-1,!this.parent.enableColumnVirtualization)&&!this.parent.groupSettings.columns.length&&1<=this.parent.totalDataRecordsCount&&("ctrlHome"===e.keyArgs.action?this.parent.isFocusFirstCell=!(n=0):"ctrlEnd"===e.keyArgs.action&&(n=this.parent.totalDataRecordsCount-1,this.isFocusLastCell=!0)),!this.parent.editSettings.showAddNewRow||"Top"!==this.parent.editSettings.newRowPosition||this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling||"downArrow"!==e.keyArgs.action||n--,this.preventFocus=!0;var s=this.getKeyColIndex(e);switch(this.needColumnSelection&&(r=s),!this.parent.element.classList.contains("e-gridcell-read")||"tab"!==e.keyArgs.action&&"shiftTab"!==e.keyArgs.action&&"rightArrow"!==e.keyArgs.action&&"leftArrow"!==e.keyArgs.action||(i=this.target.getAttribute("aria-label"),i=this.target.innerHTML+" column header "+this.parent.getColumnByIndex(r).field,this.target.setAttribute("aria-label",i)),e.keyArgs.action){case"downArrow":case"upArrow":case"enter":case"shiftEnter":this.target=e.element,this.isKeyAction=!0,this.applyDownUpKey(n,r);break;case"rightArrow":case"leftArrow":this.applyRightLeftKey(n,r);break;case"shiftDown":case"shiftUp":this.shiftDownKey(n,r);break;case"shiftLeft":case"shiftRight":this.applyShiftLeftRightKey(n,r);break;case"home":case"end":r="end"===e.keyArgs.action?this.getLastColIndex(n):0,this.applyHomeEndKey(n,r);break;case"ctrlHome":case"ctrlEnd":this.applyCtrlHomeEndKey(n,r);break;case"escape":this.clearSelection(),this.parent.clipboardModule&&window.navigator.clipboard.writeText("");break;case"ctrlPlusA":this.ctrlPlusA();break;case"space":this.applySpaceSelection(e.element);break;case"tab":this.parent.editSettings.allowNextRowEdit&&this.selectRow(n)}this.needColumnSelection=!1,this.preventFocus=!1,this.positionBorders(),this.parent.isFrozenGrid()&&(this.showHideBorders("none",!0),this.refreshFrozenBorders()),this.updateAutoFillPosition()}}},r.prototype.getKeyColIndex=function(e){var t=null,i=e.element.querySelector(".e-stackedheadercelldiv");if(this.selectionSettings.allowColumnSelection&&I(e.element,"e-columnheader"))if(this.needColumnSelection=!!e.container.isHeader,i){if("rightArrow"===e.keyArgs.action||"leftArrow"===e.keyArgs.action)return t;var i=i.getAttribute("data-mappinguid"),i=this.getstackedColumns(this.parent.getColumnByUid(i).columns),n=this.parent.getColumnIndexByUid(i[i.length-1].uid),i=this.parent.getColumnIndexByUid(i[0].uid),t=this.prevColIndex>=n?i:n}else H.isNullOrUndefined(e.element.querySelector(".e-headercelldiv"))||(i=e.element.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"),H.isNullOrUndefined(i))||(t=this.parent.getColumnIndexByUid(i));return t},r.prototype.ctrlPlusA=function(){var e;this.isRowType()&&!this.isSingleSel()&&(e=this.parent.getRowsObject(),this.selectRowsByRange(e[0].index,e[e.length-1].index)),this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange({rowIndex:0,cellIndex:0},{rowIndex:this.parent.getRows().length-1,cellIndex:this.parent.getColumns().length-1})},r.prototype.applySpaceSelection=function(e){e.classList.contains("e-checkselectall")?(this.checkedTarget=e,this.checkSelectAll(this.checkedTarget)):e.classList.contains("e-checkselect")&&(this.checkedTarget=e,this.checkSelect(this.checkedTarget))},r.prototype.applyDownUpKey=function(e,t){var i=this.parent;!this.parent.isCheckBoxSelection||"Check"!==this.parent.checkAllRows||this.selectionSettings.persistSelection||this.selectionSettings.checkboxOnly||(this.checkSelectAllAction(!1),this.checkedTarget=null),!this.isRowType()||this.selectionSettings.checkboxOnly||(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling)&&this.parent.pinnedTopRowModels.length||(this.parent.frozenRows||this.parent.pinnedTopRecords.length,this.selectRow(e,!0),this.applyUpDown(i.selectedRowIndex)),this.isCellType()&&this.selectCell({rowIndex:e,cellIndex:t},!0),this.selectionSettings.allowColumnSelection&&this.needColumnSelection&&this.selectColumn(t)},r.prototype.applyUpDown=function(e){var t;e<0||(this.target||(this.target=this.parent.getRows()[0].children[this.parent.groupSettings.columns.length||0]),t=parseInt(this.target.getAttribute(zs),10)-1,(e=this.contentRenderer.getRowByIndex(e))&&(this.target=e.getElementsByClassName(b)[parseInt(t.toString(),10)]),this.addAttribute(this.target),this.parent.element.classList.contains("e-gridcell-read")&&(e=this.target.getAttribute("aria-label"),e=this.target.innerHTML,this.target.setAttribute("aria-label",e)))},r.prototype.applyRightLeftKey=function(e,t){this.selectionSettings.allowColumnSelection&&this.needColumnSelection?this.selectColumn(t):this.isCellType()&&(this.selectCell({rowIndex:e,cellIndex:t},!0),this.addAttribute(this.target))},r.prototype.applyHomeEndKey=function(e,t){this.isCellType()?this.selectCell({rowIndex:e,cellIndex:t},!0):this.addAttribute(this.parent.getCellFromIndex(e,t))},r.prototype.shiftDownKey=function(e,t){this.isMultiShiftRequest=!0,this.isRowType()&&!this.isSingleSel()&&(H.isUndefined(this.prevRowIndex)?this.isPartialSelection?this.selectRow(e,!0):this.selectRow(0,!0):(this.selectRowsByRange(this.prevRowIndex,e),this.applyUpDown(e))),this.isCellType()&&!this.isSingleSel()&&this.selectCellsByRange(this.prevCIdxs||{rowIndex:0,cellIndex:0},{rowIndex:e,cellIndex:t}),this.isMultiShiftRequest=!1},r.prototype.applyShiftLeftRightKey=function(e,t){this.isMultiShiftRequest=!0,this.selectionSettings.allowColumnSelection&&this.needColumnSelection?this.selectColumnsByRange(this.prevColIndex,t):this.selectCellsByRange(this.prevCIdxs,{rowIndex:e,cellIndex:t}),this.isMultiShiftRequest=!1},r.prototype.getstackedColumns=function(e){for(var t=[],i=0,n=e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?this.getstackedColumns(e[parseInt(i.toString(),10)].columns):t.push(e[parseInt(i.toString(),10)]);return t},r.prototype.applyCtrlHomeEndKey=function(e,t){this.isRowType()&&(this.selectRow(e,!0),this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.addAttribute(this.parent.getCellFromIndex(e,t))),this.isCellType()&&this.selectCell({rowIndex:e,cellIndex:t},!0)},r.prototype.addRemoveClassesForRow=function(e,t,i){for(var n=[],r=3;r<arguments.length;r++)n[r-3]=arguments[r];if(e){var s=[].slice.call(e.getElementsByClassName(b)),o=e.querySelector(".e-detailrowcollapse")||e.querySelector(".e-detailrowexpand"),a=e.querySelector(".e-rowdragdrop"),l=[].slice.call(e.querySelectorAll(".e-pindentcell"));o&&s.push(o),a&&s.push(a);for(var h=0;h<l.length;h++)s.push(l[parseInt(h.toString(),10)]);Up.apply(void 0,[s,t].concat(n))}this.getRenderer().setSelection(e?e.getAttribute("data-uid"):null,t,i)},r.prototype.isRowType=function(){return"Row"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode},r.prototype.isCellType=function(){return"Cell"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode},r.prototype.isSingleSel=function(){return"Single"===this.selectionSettings.type},r.prototype.getRenderer=function(){return H.isNullOrUndefined(this.contentRenderer)&&(this.contentRenderer=this.factory.getRenderer(oe.RenderType.Content)),this.contentRenderer},r.prototype.getSelectedRecords=function(){var i,t=this,n=[];return n=!this.selectionSettings.persistSelection&&this.selectedRecords.length?this.parent.getRowsObject().filter(function(e){return e.isSelected}).map(function(e){return e.data}):this.persistSelectedData,this.checkVirtualCheckBox()&&!this.parent.isPersistSelection?n=this.virtualSelectedData:(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling)&&!(this.parent.getDataModule().isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.isCheckBoxSelection&&this.isPartialSelection&&!this.parent.isPersistSelection?n=this.partialSelectedData:(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling)&&this.parent.isRemote()&&this.isPartialSelection&&!this.parent.isPersistSelection&&(n=this.persistSelectedData),this.hasProtectedRows()&&(n=n.slice(),i=new Map,n.forEach(function(e){return i.set(t.protectionKey(e),!0)}),this.nonDeselectableRows.forEach(function(e,t){i.has(t)||n.push(e)})),n},r.prototype.selectColumn=function(e){var t=this.parent;if(!H.isNullOrUndefined(e)&&!H.isNullOrUndefined(t.getColumns()[parseInt(e.toString(),10)])){var i=t.getColumnByIndex(e),n=t.getColumnHeaderByUid(i.uid),r=n.classList.contains("e-columnselection");if(t.selectionSettings.allowColumnSelection){var s=1<this.selectedColumnsIndexes.length&&-1<this.selectedColumnsIndexes.indexOf(e);if(this.clearColDependency(),!this.selectionSettings.enableToggle||s||!r){var o={columnIndex:e,headerCell:n,column:i,cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(o,Se),o.cancel)return void this.disableInteracted();!s&&r&&t.selectionSettings.enableToggle&&e===this.prevColIndex||this.updateColSelection(n,e);o={columnIndex:e,headerCell:n,column:i,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(o,Ce)}this.updateColProps(e)}}},r.prototype.selectColumnsByRange=function(e,t){var i=this.parent;if(!H.isNullOrUndefined(e)&&!H.isNullOrUndefined(i.getColumns()[parseInt(e.toString(),10)])){var n=[];if("Single"===i.selectionSettings.type||H.isNullOrUndefined(t))n[0]=e;else for(var r=e<t,s=e;r?s<=t:t<=s;r?s++:s--)n.push(s);this.selectColumns(n)}},r.prototype.selectColumns=function(e){var t=this.parent,i=this.getselectedCols();if("Single"===t.selectionSettings.type&&(e=[e[0]]),t.selectionSettings.allowColumnSelection){this.clearColDependency();var n={columnIndex:e[0],headerCell:i,columnIndexes:e,column:t.getColumnByIndex(e[0]),cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(n,Se),n.cancel)this.disableInteracted();else{for(var r=0,s=e.length;r<s;r++)this.updateColSelection(t.getColumnHeaderByUid(t.getColumnByIndex(e[parseInt(r.toString(),10)]).uid),e[parseInt(r.toString(),10)]);i=this.getselectedCols(),n={columnIndex:e[0],headerCell:i,columnIndexes:e,column:t.getColumnByIndex(e[0]),target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(n,Ce),this.updateColProps(e[0])}}},r.prototype.selectColumnWithExisting=function(e){var t=this.parent;if(!H.isNullOrUndefined(e)&&!H.isNullOrUndefined(t.getColumns()[parseInt(e.toString(),10)])){var i=t.getColumnHeaderByUid(t.getColumnByIndex(e).uid),n=this.getselectedCols();if("Single"===t.selectionSettings.type&&this.clearColDependency(),t.selectionSettings.allowColumnSelection){if(-1<this.selectedColumnsIndexes.indexOf(e))this.clearColumnSelection(e);else{n={columnIndex:e,headerCell:n,columnIndexes:this.selectedColumnsIndexes,column:t.getColumnByIndex(e),cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest};if(this.onActionBegin(n,Se),n.cancel)return void this.disableInteracted();this.updateColSelection(i,e);n={columnIndex:e,headerCell:this.getselectedCols(),column:t.getColumnByIndex(e),columnIndexes:this.selectedColumnsIndexes,target:this.actualTarget,isInteracted:this.isInteracted,previousColumnIndex:this.prevColIndex};this.onActionComplete(n,Ce)}this.updateColProps(e)}}},r.prototype.clearColumnSelection=function(e){if(this.isColumnSelected){var t=this.parent;if(H.isNullOrUndefined(e)||-1!==this.selectedColumnsIndexes.indexOf(e)){var i=H.isNullOrUndefined(e)?this.selectedColumnsIndexes[this.selectedColumnsIndexes.length-1]:e,n=t.getColumnByIndex(i),r=t.getColumnHeaderByUid(n.uid),i={columnIndex:i,headerCell:r,columnIndexes:this.selectedColumnsIndexes,column:n,cancel:!1,target:this.actualTarget,isInteracted:this.isInteracted};if(this.columnDeselect(i,we))this.disableInteracted();else{for(var s=H.isNullOrUndefined(e)?[].slice.call(t.getHeaderContent().getElementsByClassName("e-columnselection")):[r],o=this.getSelectedColumnCells(e),a=0,l=s.length;a<l;a++)Up([s[parseInt(a.toString(),10)]],!1,"e-columnselection");for(a=0,l=o.length;a<l;a++)Up([o[parseInt(a.toString(),10)]],!1,"e-columnselection");H.isNullOrUndefined(e)?(this.columnDeselect(i,be),this.selectedColumnsIndexes=[],this.isColumnSelected=!1,this.parent.getColumns().filter(function(e){return e.isSelected=!1})):(this.selectedColumnsIndexes.splice(this.selectedColumnsIndexes.indexOf(e),1),this.parent.getColumns()[parseInt(e.toString(),10)].isSelected=!1)}}}},r.prototype.getselectedCols=function(){var e=this.parent;if(1<this.selectedColumnsIndexes.length)for(var t=[],i=0;i<this.selectedColumnsIndexes.length;i++)t.push(e.getColumnHeaderByUid(e.getColumnByIndex(this.selectedColumnsIndexes[parseInt(i.toString(),10)]).uid));else t=e.getColumnHeaderByUid(e.getColumnByIndex(this.selectedColumnsIndexes[0]).uid);return t},r.prototype.getSelectedColumnCells=function(e){for(var t=this.parent,i=!H.isNullOrUndefined(this.parent.rowTemplate)?t.getRows():t.getDataRows(),n=[],r=H.isNullOrUndefined(e)?".e-columnselection":'[aria-colindex="'+(e+1)+'"]',s=0,o=i.length;s<o;s++)n=n.concat([].slice.call(i[parseInt(s.toString(),10)].querySelectorAll(r)));return n},r.prototype.columnDeselect=function(e,t){return"columnDeselected"===t&&delete e.cancel,this.onActionComplete(e,t),e.cancel},r.prototype.updateColProps=function(e){this.prevColIndex=e,this.isColumnSelected=this.selectedColumnsIndexes.length&&!0},r.prototype.clearColDependency=function(){this.clearColumnSelection(),this.selectedColumnsIndexes=[]},r.prototype.updateColSelection=function(e,t){if(!H.isNullOrUndefined(this.parent.getColumns()[parseInt(t.toString(),10)])){var i=!H.isNullOrUndefined(this.parent.rowTemplate)?this.parent.getRows():this.parent.getDataRows();this.selectedColumnsIndexes.push(t),this.parent.getColumns()[parseInt(t.toString(),10)].isSelected=!0,t+=this.parent.getIndentCount(),Up([e],!0,"e-columnselection");for(var n=0,r=i.length;n<r;n++)if(i[parseInt(n.toString(),10)].classList.contains(Ts))if(!i[parseInt(n.toString(),10)].classList.contains(Os)&&!i[parseInt(n.toString(),10)].classList.contains(As)||"Normal"!==this.parent.editSettings.mode||H.isNullOrUndefined(i[parseInt(n.toString(),10)].querySelector("tr").childNodes[parseInt(t.toString(),10)]))if(this.parent.isSpan&&this.parent.isFrozenGrid())for(var s=i[parseInt(n.toString(),10)].querySelectorAll(".e-rowcell"),o=0;o<s.length;o++)s[parseInt(o.toString(),10)].getAttribute("aria-colindex")===e.getAttribute("aria-colindex")&&Up([s[parseInt(o.toString(),10)]],!0,"e-columnselection");else H.isNullOrUndefined(i[parseInt(n.toString(),10)].childNodes[parseInt(t.toString(),10)])||Up([i[parseInt(n.toString(),10)].childNodes[parseInt(t.toString(),10)]],!0,"e-columnselection");else Up([i[parseInt(n.toString(),10)].querySelector("tr").childNodes[parseInt(t.toString(),10)]],!0,"e-columnselection")}},r.prototype.headerSelectionHandler=function(e){!this.isMultiCtrlRequest&&!this.isMultiShiftRequest||this.isSingleSel()?this.selectColumn(e):this.isMultiShiftRequest?this.selectColumnsByRange(H.isUndefined(this.prevColIndex)?e:this.prevColIndex,e):this.selectColumnWithExisting(e)},r.prototype.addEventListener_checkbox=function(){var e=this;this.parent.on(yt,this.dataReady,this),this.onDataBoundFunction=this.onDataBound.bind(this),this.parent.addEventListener(de,this.onDataBoundFunction),this.parent.on(zr,this.onDataBoundFunction),this.parent.on(vt,this.checkBoxSelectionChanged,this),this.parent.on(sr,this.initPerisistSelection,this),this.parent.on(Ct,this.setCheckAllForEmptyGrid,this),this.parent.on(_t,this.clickHandler,this),this.resizeEndFn=function(){e.updateAutoFillPosition(),e.drawBorders()},this.resizeEndFn.bind(this),this.parent.addEventListener(tt,this.resizeEndFn)},r.prototype.removeEventListener_checkbox=function(){this.parent.off(yt,this.dataReady),this.parent.removeEventListener(de,this.onDataBoundFunction),this.parent.off(zr,this.onDataBoundFunction),this.parent.off(Ct,this.setCheckAllForEmptyGrid),this.parent.off(_t,this.clickHandler),this.parent.removeEventListener(tt,this.resizeEndFn),this.parent.off(sr,this.initPerisistSelection)},r.prototype.setCheckAllForEmptyGrid=function(){var e,t=this.getCheckAllBox();t&&(this.parent.isCheckBoxSelection=!0,e=t.nextElementSibling,H.removeClass([e],["e-check","e-stop","e-uncheck"]),H.addClass([e.parentElement],["e-checkbox-disabled"]),t.classList.contains("e-checkbox"))&&t.classList.remove("e-checkbox")},r.prototype.dataReady=function(e){this.isHeaderCheckboxClicked=!1;var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;"virtualscroll"===e.requestType||"dom-virtualscroll"===e.requestType||this.parent.isPersistSelection||t||(this.disableUI=!(this.parent.enableImmutableMode||"save"===e.requestType&&"add"===e.action),this.clearSelection(),this.setCheckAllState(),this.disableUI=!1)},r.prototype.actionCompleteHandler=function(e){"save"===e.requestType&&this.parent.isPersistSelection&&this.refreshPersistSelection()},r.prototype.selectRowIndex=function(e){this.parent.isSelectedRowIndexUpdating=!0,H.isNullOrUndefined(this.parent.selectedRowIndex)||-1===this.parent.selectedRowIndex||!this.parent.enablePersistence?this.parent.selectedRowIndex=e:this.parent.selectedRowIndex=-1},r.prototype.disableInteracted=function(){this.isInteracted=!1},r.prototype.activeTarget=function(){this.actualTarget=this.isInteracted?this.actualTarget:null},r.prototype.getAvailableDataCount=function(e){return(this.parent.isTreeGrid&&!this.parent.isRemote()?e:this.getAvailableSelectedData(e)).length},r.prototype.isCountLessMode=function(){return this.parent.isRemote()&&this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCountLessMode},r.prototype.getSeletedCellDetails=function(){var e=this.parent,t=[],i=[],n=[],r=e.getAllDataRows(!1);if(("Cell"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode)&&0<this.selectedRowCellIndexes.length)for(var s=0;s<this.selectedRowCellIndexes.length;s++){var o,a,l=this.selectedRowCellIndexes[s].rowIndex;0<=l&&l<r.length&&(a=(o=r[l]).getAttribute("data-uid"))&&(a=e.getRowObjectFromUID(a),t.push(o),i.push(a.data),n.push(l))}return{rowElements:t,rowData:i,rowIndexes:n}},r.prototype.getSelectedCellRecords=function(){return("Cell"===this.selectionSettings.mode||"Both"===this.selectionSettings.mode)&&"Batch"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode?this.getSeletedCellDetails().rowData:[]};var Yl=r;function r(e,t,i){this.selectedRowIndexes=[],this.selectedRowCellIndexes=[],this.selectedRecords=[],this.nonDeselectableRows=new Map,this.preventFocus=!1,this.selectedColumnsIndexes=[],this.checkBoxState=!1,this.isMultiShiftRequest=!1,this.isMultiCtrlRequest=!1,this.isMultiCtrlRequestCell=!1,this.enableSelectMultiTouch=!1,this.actualCtrlKeyPressed=!1,this.clearRowCheck=!1,this.selectRowCheck=!1,this.selectedRowState={},this.unSelectedRowState={},this.totalRecordsCount=0,this.chkAllCollec=[],this.isCheckedOnAdd=!1,this.persistSelectedData=[],this.virtualSelectedData=[],this.partialSelectedData=[],this.deSelectedData=[],this.partialSelectableRecordsCount=0,this.disableSelectableRecordsCount=0,this.persistSelectedRecordsCount=0,this.partialSelectedRecordsCount=0,this.isHdrSelectAllClicked=!1,this.needColumnSelection=!1,this.isCancelDeSelect=!1,this.isPreventCellSelect=!1,this.disableUI=!1,this.isPersisted=!1,this.cmdKeyPressed=!1,this.cellselected=!1,this.isMultiSelection=!1,this.isAddRowsToSelection=!1,this.initialRowSelection=!1,this.isPrevRowSelection=!1,this.isKeyAction=!1,this.isRowDragSelected=!1,this.isPartialSelection=!1,this.rmtHdrChkbxClicked=!1,this.isCheckboxReset=!1,this.isRowDeselect=!1,this.autoFillRLselection=!0,this.isFocusLastCell=!1,this.countLessTotalRecords=0,this.bottom="0 0 2px 0",this.top="2px 0 0 0",this.right_bottom="0 2px 2px 0",this.bottom_left="0 0 2px 2px",this.top_right="2px 2px 0 0",this.top_left="2px 0 0 2px",this.top_bottom="2px 0 2px 0",this.top_right_bottom="2px 2px 2px 0",this.top_bottom_left="2px 0 2px 2px",this.top_right_left="2px 2px 0 2px",this.right_bottom_left="0 2px 2px 2px",this.all_border="2px",this.parent=e,this.selectionSettings=t,this.factory=i.getService("rendererFactory"),this.focus=i.getService("focus"),this.serviceLocator=i.getService("valueFormatter"),this.addEventListener(),this.wireEvents()}Zl.prototype.hasNonNumericCharacters=function(e){for(var t=!1,i=0,n=e;i<n.length;i++){var r=n[i];if((r<"0"||"9"<r)&&"."!==r)return!0;if("."===r){if(t)return!0;t=!0}}return!1},Zl.prototype.search=function(e){var t,i=this.parent;e=H.isNullOrUndefined(e)?"":e,Bp(i)?i.notify(ci,{instance:this,handler:this.search,arg1:e}):e!==i.searchSettings.key?(this.headerFocus=!1,""===e||this.hasNonNumericCharacters(e)||(t=e.split("."),"."===e)||-1===e.indexOf(".")||t[0].startsWith("0")&&1<t[0].length?i.searchSettings.key=e.toString():i.searchSettings.key=parseFloat(e).toString(),this.parent.renderModule.resetPartialRecords(),i.dataBind()):this.refreshSearch?i.refresh():this.headerFocus=!1},Zl.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(wt,this.onPropertyChanged,this),this.parent.on(Et,this.onSearchComplete,this),this.parent.on(s,this.destroy,this),this.actionCompleteFunc=this.onActionComplete.bind(this),this.parent.addEventListener(c,this.actionCompleteFunc),this.parent.on(Yi,this.cancelBeginEvent,this))},Zl.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(wt,this.onPropertyChanged),this.parent.off(Et,this.onSearchComplete),this.parent.off(s,this.destroy),this.parent.removeEventListener(c,this.actionCompleteFunc),this.parent.off(Yi,this.cancelBeginEvent))},Zl.prototype.destroy=function(){this.removeEventListener()},Zl.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&(H.isNullOrUndefined(e.properties.key)?this.parent.notify(bt,{requestType:"searching",type:y}):this.parent.notify(bt,{requestType:"searching",type:y,searchString:this.parent.searchSettings.key}))},Zl.prototype.onSearchComplete=function(e){this.parent.trigger(c,H.extend(e,{searchString:this.parent.searchSettings.key,requestType:"searching",type:c}))},Zl.prototype.onActionComplete=function(e){this.refreshSearch&&"refresh"===e.requestType&&this.headerFocus&&(this.headerFocus=!1,this.parent.focusModule.focus(),H.addClass([this.parent.focusModule.currentInfo.element],["e-focused"])),this.refreshSearch="searching"!==e.requestType},Zl.prototype.cancelBeginEvent=function(e){"searching"===e.requestType&&this.parent.setProperties({searchSettings:{key:""}},!0)},Zl.prototype.getModuleName=function(){return"search"};var $l=Zl;function Zl(e){this.headerFocus=!1,this.parent=e,this.addEventListener()}var Jl="e-find-match",eh="e-find-active-match",th=(o.prototype.find=function(e){var e=H.isNullOrUndefined(e)?"":String(e),t=!this.parent.findSettings||this.parent.findSettings.key!==e;t&&this.parent.findSettings&&this.parent.setProperties({findSettings:{key:e}},!0),t&&(this.activateFirstMatchOnLoad=!1),this.pendingPageReveal=!1,this.changeReason=""===e?"clear":"search",this.pendingNavigation=null,this.recomputeMatches()},o.prototype.findNext=function(){this.navigate(1,"next")},o.prototype.findPrevious=function(){this.navigate(-1,"previous")},o.prototype.goToMatch=function(e){isFinite(e)&&Math.floor(e)===e&&1<=e&&e<=this.matches.length&&this.activeIndex!==e-1&&this.activateMatch(e-1,"goTo")},o.prototype.clearActiveMatch=function(){-1!==this.activeIndex&&(this.activeIndex=-1,this.changeReason="navigation",this.pendingNavigation=null,this.renderHighlights(),this.publishState())},o.prototype.clearFind=function(){this.find("")},o.prototype.getTotalMatches=function(){return this.matches.length},o.prototype.getActiveMatch=function(){return this.activeIndex<0?null:this.toPublicMatch(this.matches[this.activeIndex])},o.prototype.getAbsoluteRowIndex=function(e){return e+this.getPageOffset()},o.prototype.getHighlightParts=function(e,t,i,n){void 0===i&&(i=0);var r=this.getQuery();if(!e||!r.text)return[{text:e||"",isMatch:!1,isActive:!1}];for(var s=r.caseSensitive?e:e.toLocaleLowerCase(),o=this.activeIndex<0?null:this.matches[this.activeIndex],a=!H.isNullOrUndefined(o)&&o.field===t&&(H.isNullOrUndefined(n)||o.rowIndex===n),l=[],h=0,d=0,p=s.indexOf(r.needle,h);-1!==p;){h<p&&l.push({text:e.substring(h,p),isMatch:!1,isActive:!1});var c=a&&o.occurrenceIndex===i+d&&o.start===p;l.push({text:e.substring(p,p+r.text.length),isMatch:!0,isActive:c}),d++,h=p+r.text.length,p=s.indexOf(r.needle,h)}return h<e.length&&l.push({text:e.substring(h),isMatch:!1,isActive:!1}),l},o.prototype.refreshHighlights=function(){this.renderHighlights(),this.updateToolbarState()},o.prototype.getQuery=function(){var e=this.parent.findSettings||{},t=e.key||"",e=!!e.caseSensitive;return this.cachedQuery&&this.cachedQuery.text===t&&this.cachedQuery.caseSensitive===e||(this.cachedQuery={text:t,needle:e?t:t.toLocaleLowerCase(),caseSensitive:e}),this.cachedQuery},o.prototype.usesPages=function(){return!!this.parent.allowPaging},o.prototype.isCurrentPageOnly=function(){return!(!this.parent.findSettings||!this.parent.findSettings.currentPageOnly)},o.prototype.getPageOffset=function(){var e=this.parent.pageSettings||{};return this.usesPages()&&!this.isCurrentPageOnly()&&e.pageSize?(e.currentPage-1)*e.pageSize:0},o.prototype.toViewRowIndex=function(e){var t=this.parent.pageSettings?this.parent.pageSettings.pageSize:0;return this.usesPages()&&t?e%t:e},o.prototype.navigate=function(e,t){var i=this.matches.length;i&&(e=this.activeIndex<0?0<e?0:i-1:(this.activeIndex+e+i)%i)!==this.activeIndex&&this.activateMatch(e,t)},o.prototype.activateMatch=function(e,t){this.pendingNavigation=t,this.changeReason="navigation",this.activeIndex=e,this.revealActiveMatch()||this.renderHighlights(),this.publishState()},o.prototype.recomputeMatches=function(e){void 0===e&&(e=!1);var t=this.activeIndex<0?null:this.matches[this.activeIndex],i=this.getQuery();this.matches=[],this.activeIndex=-1,i.text?this.parent.enableVirtualization?this.collectAllDataMatches(this.parent,i,t,e):(this.collectMatches(this.parent,i),this.finalizeMatches(t,e)):(this.clearMatchesAndState(),this.finalizeMatches(t,e))},o.prototype.clearMatchesAndState=function(){this.matches=[],this.cacheValidForQuery="",this.allDataMatches=[]},o.prototype.finalizeMatches=function(e,t){this.restoreActiveMatch(e,t=void 0===t?!1:t),this.renderHighlights(),this.publishState()},o.prototype.collectAllDataMatches=function(e,t,i,n){var r=t.text+"|"+(t.caseSensitive?"1":"0");if(this.allDataCacheDirty||this.cacheValidForQuery!==r){for(var s=this.getAllGridData(e),o=this.getSearchableColumns(e),a=e.pageSettings&&e.pageSettings.pageSize||10,l=e.getPrimaryKeyFieldNames()[0],h=0;h<s.length;h++){var d=s[h];if(d&&!1!==d.isDataRow)for(var p=this.usesPages()?Math.floor(h/a)+1:1,c=this.getRowKey(d,h,l),u=!!l&&!H.isNullOrUndefined(d[l]),g=void 0,f=0;f<o.length;f++)var m=this.getCellSearchText(e,o[f],d),g=this.addCellMatches(m,t,{rowIndex:h,field:o[f].field,rowUid:c,page:p,data:d,dataHash:g},!u)}this.allDataMatches=this.matches.slice(),this.cacheValidForQuery=r,this.allDataCacheDirty=!1}else this.matches=this.allDataMatches.slice();this.finalizeMatches(i,n)},o.prototype.getAllGridData=function(e){var t=e.getDataModule(),i=t.dataManager,n=i.dataSource;if(n&&Array.isArray(n.json)&&n.json.length)try{var r=t.generateQuery(!0,!0);return i.executeLocal(r)}catch(e){return n.json}return e.getCurrentViewRecords()},o.prototype.collectMatches=function(e,t){for(var i=this.getSearchableColumns(e),n=this.getSearchableRecords(e),r=n.records,s=n.pageOffset,o=e.pageSettings&&e.pageSettings.pageSize?e.pageSettings.pageSize:r.length,a=this.usesPages()&&!this.isCurrentPageOnly(),l=e.getPrimaryKeyFieldNames()[0],h=0;h<r.length;h++){var d=r[h];if(d&&!1!==d.isDataRow)for(var p=s+h,c=a?Math.floor(p/o)+1:e.pageSettings.currentPage,u=this.getRowKey(d,p,l),g=!!l&&!H.isNullOrUndefined(d[l]),f=void 0,m=0;m<i.length;m++)var y=this.getCellSearchText(e,i[m],d),f=this.addCellMatches(y,t,{rowIndex:p,field:i[m].field,rowUid:u,page:c,data:d,dataHash:f},!g)}},o.prototype.getSearchableColumns=function(e){return e.getColumns().filter(function(e){return!H.isNullOrUndefined(e.field)&&!1!==e.allowSearching})},o.prototype.getSearchableRecords=function(e){var t,i,n=e.getCurrentViewRecords();return e.parentDetails||this.isCurrentPageOnly()?{records:n,pageOffset:0}:!!((i=(t=e.getDataModule()).dataManager.dataSource)&&Array.isArray(i.json)&&i.json.length)&&!e.groupSettings.enableLazyLoading?{records:t.dataManager.executeLocal(t.generateQuery(!0,!0)),pageOffset:0}:{records:n,pageOffset:this.getPageOffset()}},o.prototype.getCellSearchText=function(t,i,n){var e=N(i.field,n);try{return this.formatCellValue(t,i,e)||null}catch(e){throw t.trigger(ae,{error:e,field:i.field,rowData:n}),e}},o.prototype.formatCellValue=function(e,t,i){if(H.isNullOrUndefined(i))return"";var n=t.valueAccessor;if(n&&n!==Jd){var n="string"==typeof n?N(n,e):n;if("function"==typeof n)return String(n(t.field,((n={})[t.field]=i,n),t))}n=e.valueFormatterService;if(n&&t.getFormatter)try{var r=n.toView(i,t.getFormatter());if(!H.isNullOrUndefined(r))return String(r)}catch(e){}return String(i)},o.prototype.addCellMatches=function(e,t,i,n){if(!e)return i.dataHash;var r=t.caseSensitive?e:e.toLocaleLowerCase(),s=r.indexOf(t.needle);if(-1===s)return i.dataHash;for(var o=n&&H.isNullOrUndefined(i.dataHash)?this.hashRecord(i.data):i.dataHash,a=0;-1!==s;)this.matches.push({matchNumber:this.matches.length+1,totalMatches:0,rowIndex:i.rowIndex,field:i.field,occurrenceIndex:a++,start:s,length:t.text.length,rowUid:i.rowUid,page:i.page,data:i.data,dataHash:o}),s=r.indexOf(t.needle,s+t.text.length);return o},o.prototype.restoreActiveMatch=function(t,e){var i,n;this.matches.length?this.activateFirstMatchOnLoad?(this.activateFirstMatchOnLoad=!1,this.activeIndex=0,this.pendingNavigation=null,this.revealActiveMatch()):"search"!==this.changeReason&&t?(i=function(e){return e.field===t.field&&e.occurrenceIndex===t.occurrenceIndex},-1!==(n=-1!==(n=-1===(n=t.data?this.matches.findIndex(function(e){return e.data===t.data&&i(e)}):-1)&&t.dataHash?this.matches.findIndex(function(e){return e.dataHash===t.dataHash&&i(e)}):n)||e?n:this.matches.findIndex(function(e){return e.rowUid===t.rowUid&&i(e)}))?this.activeIndex=n:e?this.activeIndex=-1:(n=this.matches.findIndex(function(e){return e.rowUid>t.rowUid||e.rowUid===t.rowUid&&e.field>=t.field}),this.activeIndex=-1!==n?n:this.matches.length-1)):this.activeIndex=-1:this.activeIndex=-1},o.prototype.getRowKey=function(e,t,i){e=i?e[i]:null;return H.isNullOrUndefined(e)?"r"+t:String(e)},o.prototype.hashRecord=function(e){if(!e)return"";for(var t=[],i=0,n=Object.keys(e).sort();i<n.length;i++){var r=n[i],s=e[r];t.push(r+":"+(H.isNullOrUndefined(s)?"null":String(s)))}return t.join("|")},o.prototype.revealActiveMatch=function(){var e=this.matches[this.activeIndex];return!!e&&this.usesPages()&&!!this.parent.pagerModule&&!this.isCurrentPageOnly()&&!!e.page&&this.parent.pageSettings.currentPage!==e.page?(this.pendingPageReveal=!0,this.parent.goToPage(e.page),!0):this.scrollActiveIntoView()},o.prototype.getRenderedMatchCell=function(e){for(var t=this.parent.getDataRows?this.parent.getDataRows():[],i=e.rowIndex-this.getPageOffset(),n=this.parent.getColumnIndexByField(e.field),r=0;r<t.length;r++){var s=t[r].querySelector(".e-rowcell[data-index]");if(s&&parseInt(s.getAttribute("data-index"),10)===i)return this.parent.getCellFromIndex(r,n)}return null},o.prototype.scrollActiveIntoView=function(){var e=this.activeIndex<0?null:this.matches[this.activeIndex];if(e){var t=!!this.parent.enableVirtualization,i=t?this.getRenderedMatchCell(e):this.parent.getCellFromIndex(this.toViewRowIndex(e.rowIndex),this.parent.getColumnIndexByField(e.field));if(!i&&t)return this.scrollToRevealMatch(e),!0;this.scrollCellIntoView(i)}return!1},o.prototype.scrollToRevealMatch=function(e){var t=this.parent.getContent().firstElementChild;t&&this.parent.enableVirtualization&&this.scrollToRowIndexVirtual(this.toViewRowIndex(e.rowIndex),t)},o.prototype.scrollToRowIndexVirtual=function(e,t){var i,n;this.parent.getRowHeight&&(i=this.parent.getRowHeight(),n=t.clientHeight,e=Math.max(0,e*i-.3*n),i=Math.max(0,t.scrollHeight-n),n=Math.min(e,i),t.scrollTop=n,"function"==typeof(e=this.parent).refreshLayout)&&e.refreshLayout()},o.prototype.scrollCellIntoView=function(e){e&&"function"==typeof e.scrollIntoView&&e.scrollIntoView({block:"nearest",inline:"nearest"})},o.prototype.clearHighlights=function(){for(var e=this.parent.element.querySelectorAll("."+Jl+", ."+eh),t=0;t<e.length;t++){var i=e[t],n=i.parentNode;n&&(n.replaceChild(document.createTextNode(i.textContent),i),n.normalize())}},o.prototype.renderHighlights=function(){var e=this.parent.element;e&&this.getQuery().text&&this.matches.length?(this.clearHighlights(),this.renderMainGridHighlights(e),this.updateToolbarState()):this.clearHighlights()},o.prototype.renderMainGridHighlights=function(e){for(var t=this.getPageOffset(),i=e.querySelectorAll(".e-rowcell"),n=i.length,r=0;r<n;r++){var s=i[r];s.closest(".e-childgrid")||this.renderCellHighlight(s,this.parent,t)}},o.prototype.renderCellHighlight=function(e,t,i){var t=t.getColumns()[parseInt(e.getAttribute("aria-colindex"),10)-1],n=parseInt(e.getAttribute("data-index"),10),r=e.textContent;!this.isCellHighlightable(t,r,n,e)||(r=this.getHighlightParts(r,t.field,0,n+i)).length<2&&!r[0].isMatch||this.replaceWithHighlights(e,r)},o.prototype.isCellHighlightable=function(e,t,i,n){return!(!e||!t||isNaN(i)||e.template||n.querySelector(".e-templatecell, .e-checkbox-wrapper, input"))},o.prototype.replaceWithHighlights=function(i,e){for(;i.firstChild;)i.removeChild(i.firstChild);e.forEach(function(e){var t;e.isMatch?((t=document.createElement("span")).className=e.isActive?eh:Jl,t.appendChild(document.createTextNode(e.text)),i.appendChild(t)):i.appendChild(document.createTextNode(e.text))})},o.prototype.publishState=function(){var i=this.matches.length,e=(this.matches.forEach(function(e,t){e.matchNumber=t+1,e.totalMatches=i}),this.getActiveMatch()),t=this.getQuery().text,n=t+"|"+i+"|"+(e?e.matchNumber+":"+e.field+":"+e.rowIndex+":"+e.occurrenceIndex:"-");this.updateToolbarState(),n!==this.lastPublishedState&&(this.lastPublishedState=n,this.parent.trigger(Ot,{searchText:t,totalMatches:i,activeMatch:e,reason:this.changeReason}),this.pendingNavigation)&&e&&this.parent.trigger(At,{action:this.pendingNavigation,matchNumber:e.matchNumber,totalMatches:i,activeMatch:e}),this.pendingNavigation=null},o.prototype.toPublicMatch=function(e){return{matchNumber:e.matchNumber,totalMatches:this.matches.length,rowIndex:e.rowIndex,field:e.field,occurrenceIndex:e.occurrenceIndex,start:e.start,length:e.length}},o.prototype.updateToolbarState=function(){var e,t,i,n=this.parent.element,n=n?n.querySelector(".e-find-count"):null;n&&(e=this.matches.length,i=(t=!!this.getQuery().text)&&0<e,n.textContent=(e&&0<=this.activeIndex?this.activeIndex+1:0)+"/"+e,n.style.cursor="default",this.updateControlState(".e-find-clear",t),this.updateControlState(".e-find-prev",i),this.updateControlState(".e-find-next",i))},o.prototype.updateControlState=function(e,t){var i=this.parent.element,i=i?i.querySelector(e):null;i&&(t?i.classList.remove("e-disabled"):i.classList.add("e-disabled"),i.setAttribute("aria-disabled",String(!t)),i.style.cursor=t?"pointer":"default")},o.prototype.onDataBound=function(){this.filteringInProgress||(this.getQuery().text?(this.changeReason="data",this.recomputeMatches(),this.pendingPageReveal&&(this.pendingPageReveal=!1,this.scrollActiveIntoView())):this.renderHighlights())},o.prototype.onRowsRefreshed=function(e){var t=!!e&&"filtering"===e.requestType;this.shouldRecomputeOnRowsRefreshed(e)&&(this.allDataCacheDirty=!0,this.changeReason="data",this.recomputeMatches(t)),t&&(this.filteringInProgress=!1)},o.prototype.handleFilteringBegin=function(e){e&&"filtering"===e.requestType&&(this.filteringInProgress=!0)},o.prototype.handleFilteringCancel=function(e){e&&"filtering"===e.requestType&&(this.filteringInProgress=!1)},o.prototype.shouldRecomputeOnRowsRefreshed=function(e){return!(!e||"filtering"!==e.requestType&&"refresh"!==e.requestType&&"sorting"!==e.requestType&&"save"!==e.requestType&&"delete"!==e.requestType&&"add"!==e.requestType&&"reorder"!==e.requestType||!this.getQuery().text)},o.prototype.onPropertyChanged=function(e){e&&"find"===e.module&&(e=e.properties?e.properties.key:null,H.isNullOrUndefined(e)||e===this.parent.findSettings.key?(this.changeReason="options",this.recomputeMatches()):this.find(e))},o.prototype.addEventListener=function(){this.parent.isDestroyed||(this.dataBoundHandler=this.onDataBound.bind(this),this.actionBeginHandler=this.handleFilteringBegin.bind(this),this.rowsRefreshedHandler=this.onRowsRefreshed.bind(this),this.parent.addEventListener(y,this.actionBeginHandler),this.parent.addEventListener(de,this.dataBoundHandler),this.parent.addEventListener(c,this.rowsRefreshedHandler),this.parent.on(Yi,this.handleFilteringCancel,this),this.parent.on(vt,this.onContentReady.bind(this)),this.parent.on(s,this.destroy,this),this.parent.on(wt,this.onPropertyChanged,this))},o.prototype.onContentReady=function(){this.filteringInProgress||this.renderHighlights()},o.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.removeEventListener(y,this.actionBeginHandler),this.parent.removeEventListener(de,this.dataBoundHandler),this.parent.removeEventListener(c,this.rowsRefreshedHandler),this.parent.off(Yi,this.handleFilteringCancel),this.parent.off(vt,this.onContentReady),this.parent.off(s,this.destroy),this.parent.off(wt,this.onPropertyChanged))},o.prototype.getModuleName=function(){return"find"},o.prototype.destroy=function(){this.parent.element&&this.clearHighlights(),this.matches=[],this.activeIndex=-1,this.removeEventListener()},o);function o(e){this.matches=[],this.activeIndex=-1,this.lastPublishedState="",this.changeReason="search",this.pendingNavigation=null,this.filteringInProgress=!1,this.activateFirstMatchOnLoad=!0,this.pendingPageReveal=!1,this.cacheValidForQuery="",this.allDataMatches=[],this.allDataCacheDirty=!0,this.parent=e,this.addEventListener()}ih=function(e,t){return(ih=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var ih,nh,rh=function(e,t){function i(){this.constructor=e}ih(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},sh=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(o=(s<3?r(o):3<s?r(t,i,o):r(t,i))||o);return 3<s&&o&&Object.defineProperty(t,i,o),o},rh=(nh=H.ChildProperty,rh(oh,nh),sh([H.Property("")],oh.prototype,"key",void 0),sh([H.Property(!1)],oh.prototype,"caseSensitive",void 0),sh([H.Property(!1)],oh.prototype,"currentPageOnly",void 0),oh);function oh(){return null!==nh&&nh.apply(this,arguments)||this}lh.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:qe,handler:this.batchChanges},{event:jr,handler:this.resetColumnState}],Kc(this.parent,this.evtHandlers,!0,this))},lh.prototype.removeEventListener=function(){this.parent.isDestroyed||Kc(this.parent,this.evtHandlers,!1)},lh.prototype.batchChanges=function(){this.isShowHide&&(this.isShowHide=!1,this.setVisible(this.colName,this.changedCol),this.changedCol=this.colName=[])},lh.prototype.show=function(e,t){var e=this.getToggleFields(e),i=this.getColumns(e,t);if(this.parent.notify(ai,{module:"edit"}),this.parent.enableVirtualization&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length){e=i.filter(function(e){return!e.visible});e.forEach(function(e){return e.visible=!0}),0<e.length&&this.setVisible(e)}else{for(var n=0;n<i.length;n++)i[parseInt(n.toString(),10)].visible=!0;this.setVisible(i)}},lh.prototype.hide=function(e,t){var e=this.getToggleFields(e),i=this.getColumns(e,t);if(this.parent.notify(ai,{module:"edit"}),this.parent.enableVirtualization&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length){e=i.filter(function(e){return e.visible});e.forEach(function(e){return e.visible=!1}),0<e.length&&this.setVisible(e)}else{for(var n=0;n<i.length;n++)i[parseInt(n.toString(),10)].visible=!1;this.setVisible(i)}},lh.prototype.getToggleFields=function(e){return"string"==typeof e?[e]:e},lh.prototype.getColumns=function(e,i){var n=this;return ap(e,function(t){return ap(n.parent.columnModel,function(e){if(e[""+i]===t)return e})[0]})},lh.prototype.batchActionPrevent=function(e,t){return void 0===t&&(t=[]),!Bp(this.parent)||(this.colName=e,this.changedCol=t,this.parent.closeEdit(),!1)},lh.prototype.resetColumnState=function(){if(this.isShowHide)for(var e=0;e<this.colName.length;e++)this.colName[parseInt(e.toString(),10)].visible=!this.colName[parseInt(e.toString(),10)].visible},lh.prototype.setVisible=function(i,n){var r,e,s=this;void 0===n&&(n=[]),this.isShowHide=!0,this.batchActionPrevent(i,n)&&(r={requestType:"columnstate",cancel:!1,columns:n=0<n.length?n:i},this.parent.enableInfiniteScrolling&&this.parent.allowGrouping&&0<this.parent.groupModule.groupSettings.columns.length&&(this.parent.contentModule.visibleRows=[]),this.parent.trigger(y,r,function(e){var t=s.parent.getColumns();i=H.isNullOrUndefined(i)?t:i,e.cancel?(s.parent.notify(Wn,{showHideArgs:e}),0<i.length&&(i[0].visible=!0)):(s.parent.notify(Jr,r),tc(s.parent)&&s.parent.contentModule.emptyVcRows(),t=s.parent.element.querySelector(".e-addedrow"),s.parent.editSettings.showAddNewRow&&t&&(H.remove(t),(s.parent.enableVirtualization||s.parent.enableInfiniteScrolling)&&(s.parent.isAddNewRow=!0),s.parent.addNewRowFocus=!0,s.parent.isEdit=!1),s.parent.allowSelection&&s.parent.getSelectedRecords().length&&!s.parent.selectionSettings.persistSelection&&s.parent.clearSelection(),s.parent.enableColumnVirtualization||(s.parent.isFrozenGrid()||s.parent.enableColumnSpan)&&i.length?s.parent.notify(_r,{isModeChg:!0}):s.parent.notify(Kt,i),e={requestType:"columnstate",columns:n},s.parent.trigger(c,e),t=!s.parent.element.querySelector(".e-addedrow"),s.parent.editSettings.showAddNewRow&&t&&(s.parent.isEdit=!1,s.parent.addRecord(),s.parent.enableVirtualization||s.parent.enableInfiniteScrolling||s.parent.notify(Yr,{})),"All"!==s.parent.columnQueryMode&&s.parent.refresh())}),this.parent.groupSettings.columns.length||(this.parent.autoFit?this.parent.preventAdjustColumns():this.parent.allowResizing&&"Normal"===this.parent.resizeSettings.mode&&(e=-1===this.parent.getHeaderTable().style.width.indexOf("px"),this.widthService.setWidthToTable(e))))};var ah=lh;function lh(e){this.colName=[],this.isShowHide=!1,this.parent=e,this.addEventListener(),this.widthService=new Ta(e)}dh.prototype.getModuleName=function(){return"scroll"},dh.prototype.setWidth=function(e){var t,i,n,r;this.parent.element.style.width=H.formatUnit(this.parent.width),e&&this.widthService.setWidthToColumns(),this.parent.toolbarModule&&this.parent.toolbarModule.toolbar&&this.parent.toolbarModule.toolbar.element&&(t=(e=this.parent.toolbarModule.toolbar.element).querySelector(".e-toolbar-left"),i=e.querySelector(".e-toolbar-center"),n=e.querySelector(".e-toolbar-right"),r=e.querySelector(".e-toolbar-items"),t=t?t.clientWidth:0,i=i?i.clientWidth:0,n=n?n.clientWidth:0,r=r?r.clientWidth:0,e=e?e.clientWidth:0,!this.parent.enableAdaptiveUI||e<t||e<i||e<n||e<r)&&this.parent.toolbarModule.toolbar.refreshOverflow()},dh.prototype.setHeight=function(){var e,t=0,i=this.parent.getContent().querySelector("."+xs),n=this.parent.height;this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&("auto"!==this.parent.height&&this.parent.height.toString().indexOf("%")<0&&(n=parseInt(n,10)-dh.getScrollBarWidth()),e=this.parent.getContent().querySelector(".e-movablescrollbar"),0<this.parent.height.toString().indexOf("%"))&&!H.isNullOrUndefined(e)&&(n="calc("+n+" - "+e.scrollHeight+"px)"),this.parent.enableVirtualization||!this.parent.frozenRows||"auto"===this.parent.height||"100%"===this.parent.height||H.isNullOrUndefined(this.parent.height)||-1!==this.parent.height.toString().toLowerCase().indexOf("vh")?this.parent.height&&-1!==this.parent.height.toString().toLowerCase().indexOf("vh")?i.style.height="100%":i.style.height=H.formatUnit(n):(t=(e=this.parent.getHeaderContent().querySelector(j+":not(.e-masked-tbody)"))?e.offsetHeight:0,e&&t?t-=e.getElementsByClassName(As).length*this.parent.getRowHeight():!this.parent.isInitialLoad&&"Shimmer"===this.parent.loadingIndicator.indicatorType&&this.parent.getHeaderContent().querySelector(".e-masked-table")&&(n=parseInt(n,10)-this.parent.frozenRows*this.parent.getRowHeight()),i.style.height=H.formatUnit(parseInt(n,10)-t)),this.ensureOverflow(i),this.parent.isFrozenGrid()&&this.refresh()},dh.prototype.setPadding=function(){var e=this.parent.getHeaderContent(),t=dh.getScrollBarWidth()-this.getThreshold(),i=this.getCssProperties();e.querySelector("."+Cs).style[i.border]=0<t?"1px":"0px",e.style[i.padding]=0<t?t+"px":"0px"},dh.prototype.removePadding=function(e){var e=this.getCssProperties(e),t=this.parent.getHeaderContent().querySelector("."+Cs),t=(t.style[e.border]="",t.parentElement.style[e.padding]="",this.parent.getFooterContent());t&&t.classList.contains("e-footerpadding")&&t.classList.remove("e-footerpadding")},dh.prototype.refresh=function(){var e,t;("100%"===this.parent.height||"string"==typeof this.parent.height&&-1!==this.parent.height.toLowerCase().indexOf("vh"))&&(e=this.parent.getContent(),this.parent.element.style.height=this.parent.height,t=this.widthService.getSiblingsHeight(e),this.parent.frozenRows&&(t+=2),this.parent.groupSettings&&this.parent.groupSettings.columns.length===this.parent.columns.length&&(t+=1),e.style.height="calc(100% - "+t+"px)")},dh.prototype.getThreshold=function(){return"mozilla"===H.Browser.info.name?.5:1-window.devicePixelRatio+1},dh.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Ct,this.wireEvents,this),this.parent.on(vt,this.wireEvents,this),this.parent.on(St,this.onPropertyChanged,this),this.parent.on(Qi,this.wireEvents,this),this.parent.on(Rt,this.setScrollLeft,this))},dh.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ct,this.wireEvents),this.parent.off(vt,this.wireEvents),this.parent.off(St,this.onPropertyChanged),this.parent.off(Qi,this.wireEvents),this.parent.off(Rt,this.setScrollLeft),this.unwireEvents())},dh.prototype.unwireEvents=function(){this.parent.frozenRows&&this.header&&(H.EventHandler.remove(this.header,"touchstart pointerdown",this.setPageXY),H.EventHandler.remove(this.header,"touchmove pointermove",this.onTouchScroll));var e=this.parent.getContent()?this.parent.getContent().querySelector(".e-movablescrollbar"):null;this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&(e&&H.EventHandler.remove(e,"scroll",this.onCustomScrollbarScroll),this.content&&(H.EventHandler.remove(this.content,"scroll",this.onCustomScrollbarScroll),H.EventHandler.remove(this.content,"touchstart pointerdown",this.setPageXY),/macintosh|ipad/.test(H.Browser.userAgent.toLowerCase())&&H.Browser.isDevice||H.EventHandler.remove(this.content,"touchmove pointermove",this.onTouchScroll)),this.header)&&(H.EventHandler.remove(this.header,"scroll",this.onCustomScrollbarScroll),H.EventHandler.remove(this.header,"touchstart pointerdown",this.setPageXY),H.EventHandler.remove(this.header,"touchmove pointermove",this.onTouchScroll)),this.content&&H.EventHandler.remove(this.content,"scroll",this.contentScrollHandler),this.header&&H.EventHandler.remove(this.header,"scroll",this.headerScrollHandler),this.contentScrollHandler=null,this.headerScrollHandler=null,this.parent.aggregates.length&&this.parent.getFooterContent()&&H.EventHandler.remove(this.parent.getFooterContent().firstChild,"scroll",this.onContentScroll)},dh.prototype.setScrollLeft=function(){this.parent.getHeaderContent().querySelector("."+Cs).scrollLeft=this.previousValues.left},dh.prototype.updateFrozenShadow=function(e){var t=this.parent.getContent().firstElementChild;H.isNullOrUndefined(t)&&H.isNullOrUndefined(t)||(e=e||t,t=(this.parent.enableRtl?Math.abs(e.scrollLeft):e.scrollLeft)<=1,this.parent.getVisibleFrozenLeftCount()&&!t?H.addClass([this.parent.element],"e-left-shadow"):H.removeClass([this.parent.element],"e-left-shadow"),t=this.parent.enableRtl?Math.abs(e.scrollLeft):e.scrollLeft,t=Math.round(t+e.clientWidth)>=e.scrollWidth-1,!this.parent.getVisibleFrozenRightCount()||t?H.removeClass([this.parent.element],"e-right-shadow"):H.addClass([this.parent.element],"e-right-shadow"))},dh.prototype.onContentScroll=function(e){var s=this,o=e,a=o.classList.contains(Cs);return function(e){if(null!==s.content.querySelector(j)&&!s.parent.isPreventScrollEvent){var t=e.target;if(s.parent.frozenRows&&(0<s.content.scrollTop&&s.parent.frozenRows?H.addClass([s.parent.element],"e-top-shadow"):H.removeClass([s.parent.element],"e-top-shadow")),s.parent.element.querySelectorAll(".e-leftfreeze,.e-fixedfreeze,.e-rightfreeze").length){var i=s.parent.getContent().querySelectorAll('.e-freezeerror:not([style*="display: none"])'),n=s.parent.getContent().querySelectorAll('.e-fixederror:not([style*="display: none"])'),r=(s.updateFrozenShadow(t),[].slice.call(s.parent.getContent().querySelectorAll(".e-row:not(.e-hiddenrow)")));if((1===r.length&&i.length||s.parent.element.querySelector('.e-freeze-autofill:not([style*="display: none"])')||n.length)&&t.scrollLeft!==s.previousValues.left)return void(t.scrollLeft=s.previousValues.left);if(1!==r.length&&(i.length||n.length)&&t.scrollTop!==s.previousValues.top)return void(t.scrollTop=s.previousValues.top)}r=t.scrollLeft,n=(H.isNullOrUndefined(s.parent.infiniteScrollModule)||!s.parent.enableInfiniteScrolling||s.parent.isEdit&&(!s.parent.editSettings.showAddNewRow||s.parent.element.querySelector(".e-editedrow"))||s.parent.notify(Nn,{target:e.target,isLeft:s.previousValues.left!==r}),s.parent.groupSettings.columns.length&&s.parent.groupSettings.enableLazyLoading&&(i=s.previousValues.top<s.parent.getContent().firstElementChild.scrollTop,s.parent.notify($n,{scrollDown:i})),s.parent.notify(On,{}),t.classList.contains("e-summarycontent"));s.previousValues.left===r?s.previousValues.top=a?t.scrollTop:s.previousValues.top:(s.parent.notify(Gn,e),o.scrollLeft=r,s.parent.aggregates.length&&s.parent.enableColumnVirtualization&&(s.parent.getFooterContent().querySelector(".e-summarycontent").scrollLeft=r),n&&(s.header.scrollLeft=r),s.previousValues.left=r,s.parent.notify(Wt,{left:r}))}}},dh.prototype.onCustomScrollbarScroll=function(e,t){var i=this,n=e,r=t;return function(e){null!==i.content.querySelector(j)&&(e=e.target.scrollLeft,i.previousValues.left!==e)&&(n.scrollLeft=e,r.scrollLeft=e,i.parent.aggregates.length&&i.parent.enableColumnVirtualization&&(i.parent.getFooterContent().querySelector(".e-summarycontent").scrollLeft=e),i.previousValues.left=e,i.parent.notify(Wt,{left:e}),i.parent.isDestroyed)}},dh.prototype.onTouchScroll=function(e){var o=this,a=e;return function(e){var t,i,n,r,s;"mouse"===e.pointerType||(t=o.parent.isFrozenGrid(),i=o.getPointXY(e),n=a.scrollLeft+(o.pageXY.x-i.x),r=o.parent.getHeaderContent().querySelector("."+Cs),s=o.parent.getContent().querySelector("."+xs),o.previousValues.left===n)||n<0||r.scrollWidth-r.clientWidth<n||(e.preventDefault(),r.scrollLeft=n,s.scrollLeft=n,t&&o.parent.enableColumnVirtualization&&(o.parent.getContent().querySelector(".e-movablescrollbar").scrollLeft=n),o.pageXY.x=i.x,o.previousValues.left=n)}},dh.prototype.setPageXY=function(){var t=this;return function(e){"mouse"!==e.pointerType&&(t.pageXY=t.getPointXY(e))}},dh.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},dh.prototype.getScrollbleParent=function(e){var t,i;return null===e?null:(t=H.isNullOrUndefined(e.tagName)?e.scrollingElement:e,i=document.defaultView.getComputedStyle(t,null).overflowY,t.scrollHeight>t.clientHeight&&"hidden"!==i&&"visible"!==i||"HTML"===e.tagName||"BODY"===e.tagName?e:this.getScrollbleParent(e.parentNode))},dh.prototype.addStickyListener=function(e){this.parentElement=this.getScrollbleParent(this.parent.element.parentElement),e&&this.parentElement?(this.eventElement="HTML"===this.parentElement.tagName||"BODY"===this.parentElement.tagName?document:this.parentElement,this.stickyScrollHandler&&H.EventHandler.remove(this.eventElement,"scroll",this.stickyScrollHandler),this.stickyScrollHandler=this.makeStickyHeader(),H.EventHandler.add(this.eventElement,"scroll",this.stickyScrollHandler,this)):this.eventElement&&(H.EventHandler.remove(this.eventElement,"scroll",this.stickyScrollHandler),this.stickyScrollHandler=null,this.eventElement=null)},dh.prototype.resizeFrozenRowBorder=function(){this.parent.element.querySelector(".e-frozenrow-border")?e=this.parent.element.querySelector(".e-frozenrow-border"):(e=this.parent.createElement("div",{className:"e-frozenrow-border"}),this.parent.element.insertBefore(e,this.parent.element.querySelector(".e-gridcontent")));var e,t="auto"!==this.parent.height?dh.getScrollBarWidth():0;e.style.width=this.parent.element.offsetWidth-t-.5+"px"},dh.prototype.wireEvents=function(){var e,t,i,n,r,s=this,o=(this.oneTimeReady&&(e=this.parent.isFrozenGrid(),this.content=this.parent.getContent().querySelector("."+xs),this.header=this.parent.getHeaderContent().querySelector("."+Cs),t=this.parent.getContent().querySelector(".e-movablescrollbar"),(this.parent.frozenRows||this.parent.isRowPinned)&&this.header&&this.content&&(H.EventHandler.add(this.header,"touchstart pointerdown",this.setPageXY(),this),H.EventHandler.add(this.header,"touchmove pointermove",this.onTouchScroll(this.content),this)),e&&t&&this.parent.enableColumnVirtualization&&(H.EventHandler.add(t,"scroll",this.onCustomScrollbarScroll(this.content,this.header),this),H.EventHandler.add(this.content,"scroll",this.onCustomScrollbarScroll(t,this.header),this),H.EventHandler.add(this.header,"scroll",this.onCustomScrollbarScroll(t,this.content),this),H.EventHandler.add(this.header,"touchstart pointerdown",this.setPageXY(),this),H.EventHandler.add(this.header,"touchmove pointermove",this.onTouchScroll(this.content),this),H.EventHandler.add(this.content,"touchstart pointerdown",this.setPageXY(),this),/macintosh|ipad/.test(H.Browser.userAgent.toLowerCase())&&H.Browser.isDevice||H.EventHandler.add(this.content,"touchmove pointermove",this.onTouchScroll(this.header),this)),this.contentScrollHandler=this.onContentScroll(this.header),this.headerScrollHandler=this.onContentScroll(this.content),H.EventHandler.add(this.content,"scroll",this.contentScrollHandler,this),H.EventHandler.add(this.header,"scroll",this.headerScrollHandler,this),this.parent.aggregates.length&&H.EventHandler.add(this.parent.getFooterContent().firstChild,"scroll",this.onContentScroll(this.content),this),this.parent.enableStickyHeader&&this.addStickyListener(!0),this.refresh(),this.oneTimeReady=!1),this.parent.getContentTable());ep(function(){i=s.header.scrollLeft,n=o.scrollHeight,r=s.parent.getContent().clientHeight},function(){var e={cancel:!1};s.parent.notify(lr,e),n<r&&"auto"!==s.parent.height&&(s.setLastRowCell(),s.parent.notify(Zr,e)),(s.parent.frozenRows||s.parent.pinnedTopRowModels.length)&&s.resizeFrozenRowBorder(),s.parent.element.querySelector(".e-frozenrow-border")&&((s.parent.pinnedTopRowModels.length||s.parent.frozenRows)&&s.parent.currentViewData.length?s.parent.element.querySelector(".e-frozenrow-border").classList.remove("e-frozenrow-empty"):s.parent.element.querySelector(".e-frozenrow-border").classList.add("e-frozenrow-empty")),s.parent.enableVirtualization||s.parent.enableInfiniteScrolling||e.cancel||(s.header.scrollLeft=s.previousValues.left,s.content.scrollLeft=s.previousValues.left,s.content.scrollTop=s.previousValues.top),s.parent.enableColumnVirtualization||(s.content.scrollLeft=i,s.parent.isFrozenGrid()&&(s.previousValues.left=i))}),this.parent.isPreventScrollEvent=!1},dh.prototype.setLastRowCell=function(){var e=this.parent.getContentTable();H.removeClass(e.querySelectorAll("td"),"e-lastrowcell"),e.querySelector("tr:nth-last-child(2)")&&this.parent.editSettings.showAddNewRow&&"Bottom"===this.parent.editSettings.newRowPosition&&H.addClass(e.querySelector("tr:nth-last-child(2)").querySelectorAll("td"),"e-lastrowcell"),H.addClass(e.querySelectorAll("tr:last-child td"),"e-lastrowcell"),this.parent.isSpan&&H.addClass(e.querySelectorAll(".e-row-span-lastrowcell"),"e-lastrowcell")},dh.prototype.getCssProperties=function(e){var t={},e=H.isNullOrUndefined(e)?this.parent.enableRtl:e;return t.border=e?"borderLeftWidth":"borderRightWidth",t.padding=e?"paddingLeft":"paddingRight",t},dh.prototype.ensureOverflow=function(e){e.style.overflowY="auto"===this.parent.height?"auto":"scroll"},dh.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&(this.setPadding(),this.oneTimeReady=!0,"auto"===this.parent.height&&this.removePadding(),this.wireEvents(),this.setHeight(),this.setWidth(!H.isNullOrUndefined(e.properties.width)))},dh.prototype.makeStickyHeader=function(){var d=this;return function(){var e,t,i,n,r,s,o,a,l,h;!d.parent.isDestroyed&&d.parent.enableStickyHeader&&d.parent.element&&d.parent.getContent()&&d.parentElement&&(e=d.parent.getContent().getClientRects()[0])&&(h=window.devicePixelRatio,t=d.parent.getHeaderContent(),i=d.parent.element.querySelector(".e-toolbar"),n=d.parent.element.querySelector(".e-groupdroparea"),r=t.offsetHeight+(i?i.offsetHeight:0)+(n?n.offsetHeight:0),s=d.parentElement.getClientRects()[0].top,l=e.top-(s<0?0:s),o=e.left,a=document.body.querySelector("#"+kp(d.parent.element.id+"_columnmenu")),(l=1!==h?Math.ceil(l):l)<r&&0<e.bottom?(t.classList.add("e-sticky"),h=0,n&&d.parent.groupSettings.showDropArea&&(d.setSticky(n,h,e.width,o,!0),h+=n.getClientRects()[0].height),i&&(d.setSticky(i,h,e.width,o,!0),h+=i.getClientRects()[0].height),d.setSticky(t,h,e.width,o,!0),H.isNullOrUndefined(a)||(a.style.position="fixed",a.style.top=r+"px")):t.classList.contains("e-sticky")&&(d.setSticky(t,null,null,null,!1),i&&d.setSticky(i,null,null,null,!1),n&&d.setSticky(n,null,null,null,!1),(l=d.parent.element.querySelector(".e-ccdlg"))&&l.classList.remove("e-sticky"),H.isNullOrUndefined(a)||(a.style.position="absolute",h=e.top-s,a.style.top=h+"px")),d.parent.notify(Nr,{}))}},dh.prototype.setSticky=function(e,t,i,n,r){r?e.classList.add("e-sticky"):e.classList.remove("e-sticky"),e.style.width=null!=i?i+"px":"",e.style.top=null!=t?t+"px":"",e.style.left=null!==n?parseInt(e.style.left,10)!==n?n+"px":e.style.left:""},dh.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+ms)||e.querySelector("."+vs))&&(this.removeEventListener(),e=this.parent.getContent().querySelector("."+xs),H.EventHandler.remove(e,"scroll",this.onContentScroll),this.parent.enableStickyHeader&&this.addStickyListener(!1),this.removePadding(),H.removeClass([this.parent.getHeaderContent().querySelector("."+Cs)],Cs),H.removeClass([e],xs),e.style.height="",this.parent.element.style.width="")},dh.getScrollBarWidth=function(){return Op()};var hh=dh;function dh(e){this.previousValues={top:0,left:0},this.oneTimeReady=!0,this.parent=e,this.widthService=new Ta(e),this.addEventListener()}ph=function(e,t){return(ph=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var ph,ch,sh=function(e,t){function i(){this.constructor=e}ph(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},uh=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(o=(s<3?r(o):3<s?r(t,i,o):r(t,i))||o);return 3<s&&o&&Object.defineProperty(t,i,o),o},gh=(ch=H.ChildProperty,sh(fh,ch),fh.prototype.setFormatter=function(e){this.formatFn=e},fh.prototype.getFormatter=function(){return this.formatFn},fh.prototype.setTemplate=function(e){void 0===e&&(e={}),void 0!==this.footerTemplate&&(this.templateFn[H.getEnumValue(oe.CellType,oe.CellType.Summary)]={fn:H.compile(this.footerTemplate,e),property:"footerTemplate"}),void 0!==this.groupFooterTemplate&&(this.templateFn[H.getEnumValue(oe.CellType,oe.CellType.GroupSummary)]={fn:H.compile(this.groupFooterTemplate,e),property:"groupFooterTemplate"}),void 0!==this.groupCaptionTemplate&&(this.templateFn[H.getEnumValue(oe.CellType,oe.CellType.CaptionSummary)]={fn:H.compile(this.groupCaptionTemplate,e),property:"groupCaptionTemplate"})},fh.prototype.getTemplate=function(e){return this.templateFn[H.getEnumValue(oe.CellType,e)]},fh.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},uh([H.Property()],fh.prototype,"type",void 0),uh([H.Property()],fh.prototype,"field",void 0),uh([H.Property()],fh.prototype,"columnName",void 0),uh([H.Property()],fh.prototype,"format",void 0),uh([H.Property()],fh.prototype,"footerTemplate",void 0),uh([H.Property()],fh.prototype,"groupFooterTemplate",void 0),uh([H.Property()],fh.prototype,"groupCaptionTemplate",void 0),uh([H.Property()],fh.prototype,"customAggregate",void 0),fh);function fh(){var e=null!==ch&&ch.apply(this,arguments)||this;return e.templateFn={},e}mh=H.ChildProperty,sh(yh,mh),uh([H.Collection([],gh)],yh.prototype,"columns",void 0);var mh,sh=yh;function yh(){return null!==mh&&mh.apply(this,arguments)||this}Sh.prototype.initialize=function(){var i=this,e=(this.previousData.clear(),this.grid.getCurrentViewRecords());Array.isArray(e)&&e.forEach(function(e,t){i.previousData.set(i.recordKey(e,t),i.cloneRecord(e))})},Sh.prototype.compareRow=function(e,t){var e=this.recordKey(t,e),i=this.previousData.get(e);if(H.isNullOrUndefined(i))return this.previousData.set(e,this.cloneRecord(t)),null;for(var n=[],r=this.grid.getVisibleColumns(),s=0;s<r.length;s++){var o,a=r[s].field;a&&(o=this.getNestedValue(t,a),a=this.getNestedValue(i,a),this.valuesEqual(o,a)||n.push(s))}return 0<n.length&&this.previousData.set(e,this.cloneRecord(t)),0<n.length?n:null},Sh.prototype.highlightCell=function(e,t,i,n,r,s){var o,a,l,h=this;void 0===r&&(r=0),e&&(o=this.getRowKey(e),a=H.isNullOrUndefined(o)?t+"-"+i:"k:"+o+"-"+i,(l=this.timeoutIds.get(a))&&(clearTimeout(l),this.timeoutIds.delete(a)),this.animatingCells.has(a)&&(e.classList.remove("e-grid-cell-changed"),e.offsetHeight),e.setAttribute("aria-label","Cell updated"),e.setAttribute("role","status"),this.applyHighlightStyle(e,n),0<r&&(l=this.getDuration(n.flashDuration,500),e.style.setProperty("animation-delay",-r+"ms, "+(l-r)+"ms")),e.classList.add("e-grid-cell-changed"),this.animatingCells.add(a),this.activeCells.set(a,{element:e,rowIndex:t,colIndex:i,settings:n,key:o,start:s||Date.now()}),l=Math.max(this.getTotalDuration(n)-r,0),t=setTimeout(function(){e.classList.remove("e-grid-cell-changed"),h.clearHighlightStyle(e),e.removeAttribute("aria-label"),e.removeAttribute("role"),h.animatingCells.delete(a),h.activeCells.delete(a),h.timeoutIds.delete(a)},l),this.timeoutIds.set(a,t))},Sh.prototype.highlightRow=function(e,t,i){if(e)for(var n=e.querySelectorAll(".e-rowcell"),r=0;r<n.length;r++)this.highlightCell(n[r],t,r,i)},Sh.prototype.highlightCells=function(e,i){var n=this;e.forEach(function(e){var t=n.grid.getCellFromIndex(e.rowIndex,e.colIndex);t&&t instanceof HTMLElement&&n.highlightCell(t,e.rowIndex,e.colIndex,i)})},Sh.prototype.highlightRows=function(e,i){var n=this;e.forEach(function(e){var t=n.grid.getRowByIndex(e);t&&t instanceof HTMLElement&&n.highlightRow(t,e,i)})},Sh.prototype.reapplyDetached=function(){var s=this,t=[];this.activeCells.forEach(function(e){return t.push(e)}),t.forEach(function(e){var t,i,n,r;e.element.isConnected&&(H.isNullOrUndefined(e.key)||s.getRowKey(e.element)===e.key)||(e.element.isConnected&&s.clearCellHighlight(e.element),t=H.isNullOrUndefined(e.key)?e.rowIndex+"-"+e.colIndex:"k:"+e.key+"-"+e.colIndex,i=H.isNullOrUndefined(e.key)?null:s.findRenderedCell(e.key,e.colIndex),n=H.isNullOrUndefined(e.key)?s.grid.getCellFromIndex(e.rowIndex,e.colIndex):i&&i.cell,r=Date.now()-e.start,clearTimeout(s.timeoutIds.get(t)),s.timeoutIds.delete(t),s.animatingCells.delete(t),s.activeCells.delete(t),n&&n instanceof HTMLElement&&r<s.getTotalDuration(e.settings)&&s.highlightCell(n,(i||e).rowIndex,e.colIndex,e.settings,r,e.start))})},Sh.prototype.clearHighlights=function(){var t=this;this.activeCells.forEach(function(e){e.element.classList.remove("e-grid-cell-changed"),t.clearHighlightStyle(e.element)}),this.animatingCells.clear(),this.activeCells.clear();this.animatingRows.forEach(function(e){e=t.grid.isDestroyed?null:t.grid.getRowByIndex(e);e&&e instanceof HTMLElement&&e.classList.remove("e-grid-row-changed")}),this.animatingRows.clear()},Sh.prototype.destroy=function(){this.clearHighlights(),this.timeoutIds.forEach(function(e){clearTimeout(e)}),this.timeoutIds.clear(),this.previousData.clear(),this.animatingCells.clear(),this.animatingRows.clear()},Sh.prototype.cloneRecord=function(e){return H.isNullOrUndefined(e)?null:Object.assign({},e)},Sh.prototype.getNestedValue=function(e,t){if(!H.isNullOrUndefined(e)&&t){for(var i=e,n=0,r=t.split(".");n<r.length;n++){var s=r[n];if(H.isNullOrUndefined(i))return;i=i[s]}return i}},Sh.prototype.valuesEqual=function(e,t){if(!H.isNullOrUndefined(e)||!H.isNullOrUndefined(t)){if(H.isNullOrUndefined(e)||H.isNullOrUndefined(t))return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(var i=0;i<e.length;i++)if(!this.valuesEqual(e[i],t[i]))return!1}else{if(e instanceof Date&&t instanceof Date)return e.getTime()===t.getTime();if("object"!=typeof e||"object"!=typeof t)return e===t;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(var s=0,o=n;s<o.length;s++){var a=o[s];if(!(a in t&&this.valuesEqual(e[a],t[a])))return!1}}}return!0},Sh.prototype.applyHighlightStyle=function(e,t){var i=this.getDuration(t.flashDuration,500),n=this.getDuration(t.fadeDuration,1e3);e.style.setProperty("--e-grid-highlight-flash-duration",i+"ms"),e.style.setProperty("--e-grid-highlight-fade-duration",n+"ms"),t.color?e.style.setProperty("--e-grid-change-highlight-color",t.color):e.style.removeProperty("--e-grid-change-highlight-color")},Sh.prototype.clearHighlightStyle=function(t){["--e-grid-highlight-flash-duration","--e-grid-highlight-fade-duration","--e-grid-change-highlight-color","animation-delay"].forEach(function(e){return t.style.removeProperty(e)})},Sh.prototype.getDuration=function(e,t){return"number"==typeof e&&0<=e?e:t},Sh.prototype.findRenderedCell=function(e,t){for(var i=this.grid.getRows(),n=0;n<i.length;n++){var r,s=i[parseInt(n.toString(),10)];if(s&&s.getAttribute&&this.getRowKey(s.firstElementChild)===e)return r=s.querySelectorAll(".e-rowcell")[parseInt(t.toString(),10)],s=parseInt(s.getAttribute("aria-rowindex"),10)-1,r&&0<=s?{cell:r,rowIndex:s}:null}return null},Sh.prototype.clearCellHighlight=function(e){e.classList.remove("e-grid-cell-changed"),this.clearHighlightStyle(e),e.removeAttribute("aria-label"),e.removeAttribute("role")},Sh.prototype.recordKey=function(e,t){var i=this.grid.getPrimaryKeyFieldNames()[0],i=i&&e?H.getValue(i,e):void 0;return H.isNullOrUndefined(i)?t:"k:"+i},Sh.prototype.getRowKey=function(e){var t=this.grid.getPrimaryKeyFieldNames()[0],e=e.parentElement,e=e&&t?this.grid.getRowObjectFromUID(e.getAttribute("data-uid")):null;return e&&e.data?H.getValue(t,e.data):void 0},Sh.prototype.getTotalDuration=function(e){return this.getDuration(e.flashDuration,500)+this.getDuration(e.fadeDuration,1e3)};var vh=Sh;function Sh(e){this.previousData=new Map,this.animatingCells=new Set,this.animatingRows=new Set,this.timeoutIds=new Map,this.activeCells=new Map,this.grid=e}wh.prototype.getModuleName=function(){return"highlight"},wh.prototype.getService=function(){return this.highlightService},wh.prototype.wrapGridMethods=function(){var n=this,r=this.parent.setCellValue.bind(this.parent),s=(this.parent.setCellValue=function(e,t,i){r(e,t,i),n.onProgrammaticCellUpdate(e,t,i)},this.parent.setRowData.bind(this.parent));this.parent.setRowData=function(e,t){var i=n.getPreviousRowData(e);s(e,t),n.onProgrammaticRowUpdate(e,t,i)}},wh.prototype.onProgrammaticCellUpdate=function(t,e,i){var n,r,s,o,a=this.parent.highlightSettings;!H.isNullOrUndefined(a)&&this.shouldHighlightColumn(this.parent.getColumnIndexByField(e))&&(n=this.parent.getPrimaryKeyFieldNames()[0],r=this.parent.contentModule.getRows().find(function(e){return e&&e.data&&e.data[n]===t}))&&(s=this.parent.getColumnIndexByField(e),o=this.parent.getCellFromIndex(r.index,s))&&o instanceof HTMLElement&&this.highlightService.highlightCell(o,r.index,s,a)},wh.prototype.onProgrammaticRowUpdate=function(t,n,r){var s,i,o,e,a=this;this.parent.enableHighlightOnDataChange&&n&&(s=this.parent.highlightSettings,H.isNullOrUndefined(s)||(i=this.parent.getPrimaryKeyFieldNames()[0],(o=this.parent.contentModule.getRows().find(function(e){return e.data&&e.data[i]===t}))&&(e=this.parent.getRowByIndex(o.index))&&e instanceof HTMLElement&&this.parent.getVisibleColumns().forEach(function(e,t){var i;e.field&&(e=e.field,i=n[e],e=r?r[e]:void 0,a.valuesEqual(i,e)||(i=a.parent.getCellFromIndex(o.index,t))&&i instanceof HTMLElement&&a.highlightService.highlightCell(i,o.index,t,s))})))},wh.prototype.getPreviousRowData=function(t){var i=this.parent.getPrimaryKeyFieldNames()[0],e=this.parent.contentModule.getRows().find(function(e){return e.data&&e.data[i]===t});return e&&e.data?Object.assign({},e.data):null},wh.prototype.valuesEqual=function(e,t){return!(!H.isNullOrUndefined(e)||!H.isNullOrUndefined(t))||!H.isNullOrUndefined(e)&&!H.isNullOrUndefined(t)&&(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():e===t)},wh.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:vt,handler:this.onContentReady},{event:s,handler:this.destroy}],Kc(this.parent,this.evtHandlers,!0,this),this.parent.addEventListener(We,this.onCellSaved),this.parent.addEventListener(de,this.onDataBound),this.parent.addEventListener(c,this.onActionComplete),this.wrapGridMethods())},wh.prototype.removeEventListener=function(){this.parent.isDestroyed||(Kc(this.parent,this.evtHandlers,!1),this.parent.removeEventListener(We,this.onCellSaved),this.parent.removeEventListener(de,this.onDataBound),this.parent.removeEventListener(c,this.onActionComplete))},wh.prototype.highlightChangedCells=function(n,e,r){var t,s,o=this,i=this.highlightService.compareRow(n,e);i&&0!==i.length&&(t=this.parent.getPrimaryKeyFieldNames()[0],s=t?H.getValue(t,e):void 0,i.forEach(function(e){var t,i;o.shouldHighlightColumn(e)&&(i=(t=H.isNullOrUndefined(s)?null:o.highlightService.findRenderedCell(s,e))?t.cell:o.parent.getCellFromIndex(n,e))&&i instanceof HTMLElement&&o.highlightService.highlightCell(i,t?t.rowIndex:n,e,r)}))},wh.prototype.flash=function(e){var t,i,n,r,s,o=this;this.highlightService&&e&&(i=Array.isArray(e)?null:e.highlightSettings,t=this.parent.highlightSettings.properties||this.parent.highlightSettings,t=H.extend({},t,i,!0),Array.isArray(e)?this.highlightService.highlightCells(e,t):(i=this.resolveRowIndexes(e.rowNodes),n=!H.isNullOrUndefined(e.rowNodes),(e=e.columns)&&e.length?(r=n?i:this.parent.getRows().map(function(e,t){return t}),s=[],e.forEach(function(e){var t=o.parent.getColumnIndexByField(e);0<=t&&r.forEach(function(e){return s.push({rowIndex:e,colIndex:t})})}),this.highlightService.highlightCells(s,t)):this.highlightService.highlightRows(i,t)))},wh.prototype.resolveRowIndexes=function(e){var i=this,n=[];return(e||[]).forEach(function(e){var t=-1;"number"==typeof e?t=e:e instanceof HTMLElement?t=parseInt(e.getAttribute("aria-rowindex"),10)-1:e&&"number"==typeof e.index?t=e.index:e&&i.parent.getPrimaryKeyFieldNames()[0]&&(t=i.parent.getRowIndexByPrimaryKey(e)),0<=t&&n.push(t)}),n},wh.prototype.highlightCells=function(e){this.highlightService&&this.highlightService.highlightCells(e,this.parent.highlightSettings)},wh.prototype.highlightRows=function(e){this.highlightService&&this.highlightService.highlightRows(e,this.parent.highlightSettings)},wh.prototype.shouldHighlightColumn=function(e){e=this.parent.getColumnByIndex(e);return(e&&null!==e.enableHighlightOnDataChange&&void 0!==e.enableHighlightOnDataChange?e:this.parent).enableHighlightOnDataChange},wh.prototype.destroy=function(){this.removeEventListener(),this.highlightService&&this.highlightService.destroy()};var Ch=wh;function wh(e,t){var r=this;this.evtHandlers=[],this.onContentReady=function(){r.highlightService.initialize(),r.highlightService.reapplyDetached()},this.onDataBound=function(){r.highlightService.initialize()},this.onActionComplete=function(e){var t,i;e&&"save"===e.requestType&&"add"!==e.action&&e.data&&(t=r.parent.highlightSettings,H.isNullOrUndefined(t)||(i=r.parent.getPrimaryKeyFieldNames()[0]?r.parent.getRowIndexByPrimaryKey(e.data):-1,(H.isNullOrUndefined(i)||i<0)&&(i=e.index),H.isNullOrUndefined(i))||i<0||r.highlightChangedCells(i,e.data,t))},this.onCellSaved=function(e){var t,i,n=r.parent.highlightSettings;H.isNullOrUndefined(n)||e.cancel||(e.cell&&e.columnName?(i=e.cell.parentElement,t=r.parent.getColumnIndexByField(e.columnName),i=i?parseInt(i.getAttribute("aria-rowindex"),10)-1:-1,(H.isNullOrUndefined(e.previousValue)||H.isNullOrUndefined(e.value)?e.previousValue!==e.value:e.previousValue.toString()!==e.value.toString())&&0<=t&&0<=i&&e.cell instanceof HTMLElement&&r.shouldHighlightColumn(t)&&r.highlightService.highlightCell(e.cell,i,t,n)):e.data&&r.highlightChangedCells(e.rowIndex,e.data,n))},H.initializeTelemetryFeature("Highlight","DataGrid"),this.parent=e,this.serviceLocator=t,this.highlightService=new vh(this.parent),this.addEventListener()}bh=function(e,t){return(bh=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var bh,Ih,uh=function(e,t){function i(){this.constructor=e}bh(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},gh=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(o=(s<3?r(o):3<s?r(t,i,o):r(t,i))||o);return 3<s&&o&&Object.defineProperty(t,i,o),o},uh=(Ih=H.ChildProperty,uh(Rh,Ih),gh([H.Property("Right")],Rh.prototype,"position",void 0),gh([H.Property("Push")],Rh.prototype,"type",void 0),gh([H.Property("280px")],Rh.prototype,"width",void 0),gh([H.Property(!1)],Rh.prototype,"hiddenByDefault",void 0),gh([H.Property("")],Rh.prototype,"defaultToolPanel",void 0),gh([H.Property(["Columns","Filters","Edit"])],Rh.prototype,"toolPanels",void 0),Rh);function Rh(){return null!==Ih&&Ih.apply(this,arguments)||this}Dh.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(vt,this.initialEnd,this),this.parent.on(Gt,this.keyDownHandler,this),this.parent.on(_t,this.clickHandler,this),this.parent.on(Ct,this.initialEnd,this),H.EventHandler.add(this.parent.element,"keydown",this.macCopyHandler,this),H.EventHandler.add(this.parent.element,"paste",this.pasteHandler,this))},Dh.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Gt,this.keyDownHandler),this.parent.off(vt,this.initialEnd),this.parent.off(_t,this.clickHandler),this.parent.off(Ct,this.initialEnd),H.EventHandler.remove(this.parent.element,"keydown",this.macCopyHandler),H.EventHandler.remove(this.parent.element,"paste",this.pasteHandler))},Dh.prototype.clickHandler=function(e){e=e.target;I(e,"e-rowcell")},Dh.prototype.macCopyHandler=function(e){var t=/(Mac)/i.test(navigator.platform);!this.parent.isEdit&&67===e.keyCode&&t&&e.metaKey&&this.copy()},Dh.prototype.pasteHandler=function(e){var t,i,n=this,r=this.parent,s=r.getSelectedRowCellIndexes(),o=H.closest(document.activeElement,"."+b);this.clipBoardTextArea&&s.length&&!r.isEdit&&o&&r.editSettings.allowEditing&&"Normal"!==r.editSettings.mode&&"Dialog"!==r.editSettings.mode&&"Cell"===r.selectionSettings.mode&&"Flow"!==r.selectionSettings.cellSelectionMode&&e.clipboardData&&(o=e.clipboardData.getData("text/plain"))&&(e.preventDefault(),this.clipBoardTextArea.value=o,r=/(Mac)/i.test(navigator.platform),t=s[0].rowIndex,i=s[0].cellIndexes[0],setTimeout(function(){n.clipBoardTextArea&&n.clipBoardTextArea.value&&n.paste(n.clipBoardTextArea.value,t,i)},r?100:0))},Dh.prototype.paste=function(e,t,i){for(var n,r=this.parent,s=i,o=t,a=e.split("\n"),l=0;l<a.length;l++){if(n=a[parseInt(l.toString(),10)].split("\t"),s=i,l===a.length-1&&""===a[parseInt(l.toString(),10)]||H.isUndefined(r.getRowByIndex(o))){s++;break}for(var h=0;h<n.length;h++){if(!r.getCellFromIndex(o,s)){s++;break}var d,p,c,u=(c=r.getColumnByIndex(s)).getParser()?c.getParser()(n[parseInt(h.toString(),10)]):n[parseInt(h.toString(),10)];c.allowEditing&&!c.isPrimaryKey&&(this.parent.trigger(rt,u={column:c,data:u,rowIndex:o}),o=u.rowIndex,u.cancel||r.editModule&&("number"===c.type?this.parent.editModule.updateCell(o,c.field,parseFloat(u.data)):r.editModule.updateCell(o,c.field,u.data),"Batch"===r.editSettings.mode)&&r.editSettings.enableUndoRedo&&(p=r.getRowObjectFromUID(r.getRows()[parseInt(o.toString(),10)].getAttribute("data-uid")),d=r.editModule.editModule,p={type:"paste",rowUid:p?p.uid:void 0,rowIndex:o,field:c.field,previousValue:p.data[c.field],newValue:u.data},d.pushToStack(d.undoStack,p),d.redoStack=[],r.notify(ri,{}))),s++}o++}r.selectionModule.selectCellsByRange({rowIndex:t,cellIndex:i},{rowIndex:o-1,cellIndex:s-1});e=this.parent.getCellFromIndex(o-1,s-1);e&&H.classList(e,["e-focus","e-focused"],[]),this.clipBoardTextArea.value=""},Dh.prototype.initialEnd=function(){this.l10n=this.serviceLocator.getService("localization"),this.parent.off(vt,this.initialEnd),this.clipBoardTextArea||(this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",attrs:{id:this.parent.element.id+"_clipboard",tabindex:"-1","aria-hidden":"true"}}),this.clipBoardTextArea.style.opacity="0",this.parent.element.appendChild(this.clipBoardTextArea))},Dh.prototype.keyDownHandler=function(e){"ctrlPlusC"===e.action?this.copy():"ctrlShiftPlusH"===e.action&&this.copy(!0)},Dh.prototype.setCopyData=function(e){if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this.copyContent="";var t=this.parent.getDataRows();if(this.parent.selectionSettings&&this.parent.selectionSettings.allowColumnSelection&&this.parent.selectionModule&&this.parent.selectionModule.selectedColumnsIndexes.length){if(e){for(var i=this.parent.selectionModule.selectedColumnsIndexes,n=[],r=0;r<i.length;r++){var s=i[parseInt(r.toString(),10)],s=this.parent.getColumnHeaderByIndex(s);s&&!s.classList.contains("e-hide")&&n.push(s)}this.getCopyData(n,!1,"\t",e),this.copyContent+="\n"}for(var o=0;o<t.length;o++){var a=[];0<o&&(this.copyContent+="\n"),a.push.apply(a,[].slice.call(t[parseInt(o.toString(),10)].querySelectorAll(".e-columnselection:not(.e-hide)"))),this.getCopyData(a,!1,"\t",e)}}else if("Cell"!==this.parent.selectionSettings.mode){var l=this.parent.getSelectedRowIndexes().sort(function(e,t){return e-t});if(e){for(var h=[],r=0;r<this.parent.getVisibleColumns().length;r++)h[parseInt(r.toString(),10)]=this.parent.getVisibleColumns()[parseInt(r.toString(),10)].headerText;this.getCopyData(h,!1,"\t",e),this.copyContent+="\n"}if((this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&l.length>t.length)for(l=[],r=0;r<t.length;r++){var d=t[parseInt(r.toString(),10)];"true"===d.getAttribute("aria-selected")&&(d=d.getAttribute("aria-rowindex"))&&l.push(parseInt(d,10)-1)}for(r=0;r<l.length;r++){0<r&&(this.copyContent+="\n");var p=[],c=l[parseInt(r.toString(),10)],c=(!tc(this.parent)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache||this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading)&&(c=t.map(function(e){e=e.getAttribute("aria-rowindex");return e?(parseInt(e,10)-1).toString():""}).indexOf(l[parseInt(r.toString(),10)].toString())),t[parseInt(c.toString(),10)]);H.isNullOrUndefined(c)||(p.push.apply(p,[].slice.call(c.querySelectorAll(".e-rowcell:not(.e-hide)"))),this.getCopyData(p,!1,"\t",e))}}else if(this.parent.selectionModule&&this.parent.selectionModule.selectedRowCellIndexes.length){var u=this.checkBoxSelection();if(u.status){if(e){for(var g=[],r=0;r<u.colIndexes.length;r++){var f=this.parent.getColumnHeaderByIndex(u.colIndexes[parseInt(r.toString(),10)]);f.classList.contains("e-hide")||g.push(f)}this.getCopyData(g,!1,"\t",e),this.copyContent+="\n"}for(r=0;r<u.rowIndexes.length;r++){0<r&&(this.copyContent+="\n");var m=[].slice.call(t[u.rowIndexes[parseInt(r.toString(),10)]].querySelectorAll(".e-cellselectionbackground:not(.e-hide)"));this.getCopyData(m,!1,"\t",e)}}else this.getCopyData([].slice.call(this.parent.element.getElementsByClassName("e-cellselectionbackground")),!0,"\n",e)}var y={data:this.copyContent,cancel:!1};this.parent.trigger(nt,y),y.cancel||(this.clipBoardTextArea.value=this.copyContent=y.data,H.Browser.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0)}},Dh.prototype.getCopyData=function(e,t,i,n){for(var r,s="string"!=typeof e[0],o=0;o<e.length;o++)n&&t&&(r=parseInt(e[parseInt(o.toString(),10)].getAttribute(zs),10)-1,this.copyContent+=this.parent.getColumns()[parseInt(r.toString(),10)].headerText+"\n"),s?e[parseInt(o.toString(),10)].classList.contains("e-hide")||(this.copyContent+=e[parseInt(o.toString(),10)].innerText):this.copyContent+=e[parseInt(o.toString(),10)],o<e.length-1&&(this.copyContent+=i)},Dh.prototype.copy=function(e){document.queryCommandSupported("copy")&&this.clipBoardTextArea&&(this.setCopyData(e),document.execCommand("copy"),this.clipBoardTextArea.blur()),this.isSelect&&(window.getSelection().removeAllRanges(),this.isSelect=!1)},Dh.prototype.getModuleName=function(){return"clipboard"},Dh.prototype.destroy=function(){this.removeEventListener(),this.clipBoardTextArea&&(H.remove(this.clipBoardTextArea),this.clipBoardTextArea=null)},Dh.prototype.checkBoxSelection=function(){var e=this.parent,t={status:!1};if("Cell"===e.selectionSettings.mode){for(var i=e.getSelectedRowCellIndexes(),n=void 0,r=[],s=void 0,s=0;s<i.length&&(i[parseInt(s.toString(),10)].cellIndexes.length&&r.push(i[parseInt(s.toString(),10)].rowIndex),!i[parseInt(s.toString(),10)].cellIndexes.length||(n=n||JSON.stringify(i[parseInt(s.toString(),10)].cellIndexes.sort()))===JSON.stringify(i[parseInt(s.toString(),10)].cellIndexes.sort()));s++);r.sort(function(e,t){return e-t}),s===i.length&&(t={status:!0,rowIndexes:r,colIndexes:i[0].cellIndexes})}return t};var xh=Dh;function Dh(e,t){this.copyContent="",this.isSelect=!1,this.parent=e,this.serviceLocator=t,this.addEventListener()}Th=function(e,t){return(Th=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Th,Eh,gh=function(e,t){function i(){this.constructor=e}Th(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Oh=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(o=(s<3?r(o):3<s?r(t,i,o):r(t,i))||o);return 3<s&&o&&Object.defineProperty(t,i,o),o},Ah=(Eh=H.ChildProperty,gh(Fh,Eh),Oh([H.Property(null)],Fh.prototype,"label",void 0),Oh([H.Property(null)],Fh.prototype,"valueFormatter",void 0),Oh([H.Property(null)],Fh.prototype,"aggregateFunctions",void 0),Oh([H.Property(null)],Fh.prototype,"template",void 0),Oh([H.Property(null)],Fh.prototype,"data",void 0),Fh);function Fh(){return null!==Eh&&Eh.apply(this,arguments)||this}Mh=H.ChildProperty,gh(Ph,Mh),Oh([H.Property(null)],Ph.prototype,"type",void 0),Oh([H.Property("Right")],Ph.prototype,"position",void 0),Oh([H.Property(null)],Ph.prototype,"key",void 0),Oh([H.Complex({},Ah)],Ph.prototype,"statusPanelParams",void 0);var Mh,kh=Ph;function Ph(){return null!==Mh&&Mh.apply(this,arguments)||this}Lh=H.ChildProperty,gh(Nh,Lh),Oh([H.Collection([],kh)],Nh.prototype,"items",void 0);var Lh,gh=Nh;function Nh(){return null!==Lh&&Lh.apply(this,arguments)||this}var Bh="https://ej2.syncfusion.com/documentation/grid",zh="https://ej2.syncfusion.com/documentation/",qh="[EJ2Grid.Warning]",Uh="[EJ2Grid.Error]",Hh="[EJ2Grid.Info]",Vh=(jh.prototype.getModuleName=function(){return"logger"},jh.prototype.log=function(e,t){for(var i=e=e instanceof Array?e:[e],n=0;n<i.length;n++){var r=Kh[i[parseInt(n.toString(),10)]],s=r.check(t,this.parent);s.success&&console[r.logType](r.generateMessage(t,this.parent,s.options))}},jh.prototype.patchadaptor=function(){var n=this.parent.getDataModule().dataManager.adaptor,r=n.beforeSend;r&&(n.beforeSend=function(e,t,i){r.call(n,e,t,i)})},jh.prototype.destroy=function(){this.parent.isDestroyed||this.parent.off("initial-end",this.patchadaptor)},jh);function jh(e){this.parent=e,this.parent.on("initial-end",this.patchadaptor,this)}var Gh,_h,Kh={module_missing:{type:"module_missing",logType:"warn",check:function(e,t){var i=t.getInjectedModules().map(function(e){return e.prototype.getModuleName()}),t=t.requiredModules().map(function(e){return e.member}).filter(function(e){return-1===i.indexOf(e)});return{success:0<t.filter(function(e){return"resize"!==e}).length,options:t}},generateMessage:function(e,t,i){return i=i.filter(function(e){return"resize"!==e}).reduce(function(e,t){return e+"* "+t+"\n"},""),qh+": MODULES MISSING\nThe following modules are not injected:.\n"+i+"Refer to "+Bh+"/module.html for documentation on importing feature modules."}},promise_enabled:{type:"promise_enabled",logType:"error",check:function(){return{success:"undefined"==typeof Promise}},generateMessage:function(){return Uh+": PROMISE UNDEFINED\nPromise object is not present in the global environment,please use polyfil to support Promise object in your environment.\nRefer to "+zh+"/base/browser.html?#required-polyfills for more information."}},primary_column_missing:{type:"primary_column_missing",logType:"warn",check:function(e,t){return{success:t.enableColumnVirtualization?0===t.getPrimaryKeyFieldNames().length:0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(){return qh+": PRIMARY KEY MISSING\nEditing is enabled but primary key column is not specified.\nRefer to "+Bh+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},selection_key_missing:{type:"selection_key_missing",logType:"warn",check:function(e,t){return{success:t.selectionSettings.persistSelection&&0===t.getColumns().filter(function(e){return e.isPrimaryKey}).length}},generateMessage:function(){return qh+": PRIMARY KEY MISSING\nselectionSettings.persistSelection property is enabled. It requires one primary key column to persist selection.\nRefer to "+Bh+"/api-column.html?#isprimarykey for documentation on providing primary key columns."}},actionfailure:{type:"actionfailure",logType:"error",check:function(){return{success:!0}},generateMessage:function(e,t){var i="",n=Wh(e),r=Qh(e),i=""!==r?r:""!==n?n:e.error;return qh+": "+i}},locale_missing:{type:"locale_missing",logType:"warn",check:function(e,t){var i=V.DataUtil.getObject("locale."+t.locale+".grid",H.L10n);return{success:"en-US"!==t.locale&&H.isNullOrUndefined(i)}},generateMessage:function(e,t){return qh+": LOCALE CONFIG MISSING\nLocale configuration for '"+t.locale+"' is not provided.\nRefer to "+Bh+"/globalization-and-localization.html?#localization \n for documentation on setting locale configuration."}},limitation:{type:"limitation",logType:"warn",check:function(e,t){var i;switch(e){case"freeze":i={success:!H.isUndefined(t.detailTemplate)||!H.isUndefined(t.childGrid),options:{name:"freeze"}};break;case"virtualization":i={success:!H.isUndefined(t.detailTemplate)||!H.isUndefined(t.childGrid),options:{name:"virtualization"}};break;default:i={success:!1}}return i},generateMessage:function(e,t,i){var n,i=i.name;switch(i){case"freeze":n="Frozen rows and columns do not support the following features:\n* Details Template\n* Hierarchy Grid\n";break;case"virtualization":n="Virtualization does not support the following features.\n* Details Template.\n* Hierarchy Grid.\n";break;default:n=""}return qh+": "+i.toUpperCase()+" LIMITATIONS\n"+n}},check_datasource_columns:{type:"check_datasource_columns",logType:"warn",check:function(e,t){return{success:!(t.columns.length||t.dataSource instanceof V.DataManager||!H.isNullOrUndefined(t.dataSource)&&t.dataSource.length)}},generateMessage:function(){return qh+": GRID CONFIG MISSING\ndataSource and columns are not provided in the grid. At least one of either must be provided for grid configuration.\nRefer to "+Bh+"/columns.html for documentation on configuring the grid data and columns."}},virtual_height:{type:"virtual_height",logType:"error",check:function(e,t){return{success:H.isNullOrUndefined(t.height)||"auto"===t.height}},generateMessage:function(){return Uh+": GRID HEIGHT MISSING \nheight property is required to use virtualization.\nRefer to "+Bh+"/virtual.html for documentation on configuring the virtual grid."}},grid_remote_edit:{type:"grid_remote_edit",logType:"error",check:function(e){return{success:Array.isArray(e)||Array.isArray(e.result)}},generateMessage:function(){return Uh+": RETRUN VALUE MISSING \nRemote service returns invalid data. \nRefer to "+Bh+"/edit.html for documentation on configuring editing with remote data."}},grid_sort_comparer:{type:"grid_sort_comparer",logType:"warn",check:function(e,t){return{success:t.getDataModule().isRemote()}},generateMessage:function(){return qh+": SORT COMPARER NOT WORKING \nSort comparer will not work with remote data.Refer to "+Bh+"/sorting/#custom-sort-comparer for documentation on using the sort comparer."}},resize_min_max:{type:"resize_min_max",logType:"info",check:function(e){return{success:e.column.minWidth&&e.column.minWidth>=e.width||e.column.maxWidth&&e.column.maxWidth<=e.width}},generateMessage:function(){return Hh+": RESIZING COLUMN REACHED MIN OR MAX \nThe column resizing width is at its min or max."}},action_disabled_column:{type:"action_disabled_column",logType:"info",check:function(e){var t;switch(e.moduleName){case"reorder":t=H.isNullOrUndefined(e.destColumn)?"reordering action is disabled for the "+e.column.headerText+" column":"reordering action is disabled for the "+(e.column.allowReordering?e.destColumn:e.column).headerText+" column";break;case"group":t="grouping action is disabled for the "+e.columnName+" column.";break;case"filter":t="filtering action is disabled for the "+e.columnName+" column.";break;case"sort":t="sorting action is disabled for the "+e.columnName+" column."}return{success:!0,options:{fn:t}}},generateMessage:function(e,t,i){return Hh+": ACTION DISABLED \n "+i.fn}},column_chooser_reorder:{type:"column_chooser_reorder",logType:"warn",check:function(){return{success:!0}},generateMessage:function(e){return qh+": COLUMN CHOOSER REORDERING IGNORED \n"+e.reason}},toolpanel_columns_zone:{type:"toolpanel_columns_zone",logType:"warn",check:function(){return{success:!0}},generateMessage:function(e){return qh+": COLUMNS TOOL PANEL \n"+e.reason}},exporting_begin:{type:"exporting_begin",logType:"info",check:function(e){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return Hh+": EXPORTING INPROGRESS \n Grid "+i.args+"ing is in progress"}},exporting_complete:{type:"exporting_complete",logType:"info",check:function(e){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return Hh+": EXPORTING COMPLETED \n Grid "+i.args+"ing is complete"}},foreign_key_failure:{type:"foreign_key_failure",logType:"error",check:function(){return{success:!0}},generateMessage:function(){return Uh+": FOREIGNKEY CONFIG \n Grid foreign key column needs a valid data source/service.Refer to "+Bh+"/columns/#foreign-key-column for documentation on configuring foreign key columns."}},initial_action:{type:"initial_action",logType:"error",check:function(e){var t;switch(e.moduleName){case"group":t="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to group the column";break;case"filter":t="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to filter the column.";break;case"sort":t="The "+e.columnName+" column is not available in the grid's column model.Please provide a valid field name to sort the column."}return{success:!0,options:{fn:t}}},generateMessage:function(e,t,i){return Uh+": INITIAL ACTION FAILURE \n "+i.fn}},frozen_rows_columns:{type:"frozen_rows_columns",logType:"error",check:function(e,t){return{success:t.getColumns().length<=t.frozenColumns||t.currentViewData.length&&t.frozenRows>=t.currentViewData.length}},generateMessage:function(e,t){return Uh+": OUT OF RANGE ERROR-\n "+(t.getColumns().length<=t.frozenColumns?"FROZEN COLUMNS,":"")+(t.frozenRows>=t.currentViewData.length?"FROZEN ROWS":"")+" invalid"}},column_type_missing:{type:"column_type_missing",logType:"error",check:function(e){return{success:H.isNullOrUndefined(e.column.type),options:e.column.headerText}},generateMessage:function(e,t,i){return Uh+": COLUMN TYPE MISSING-\n "+i+" column type was invalid or not defined.Please go through below help link: "+zh+"/grid/columns/#column-type"}},sidebar_duplicate_panel:{type:"sidebar_duplicate_panel",logType:"warn",check:function(){return{success:!0}},generateMessage:function(e){return qh+": duplicate tool panel id '"+e.id+"'."}},sidebar_panel_not_found:{type:"sidebar_panel_not_found",logType:"warn",check:function(){return{success:!0}},generateMessage:function(e){return qh+": tool panel id '"+e.id+"' not found."}},sidebar_invalid_position:{type:"sidebar_invalid_position",logType:"warn",check:function(){return{success:!0}},generateMessage:function(e){return qh+": invalid side bar position '"+e.position+"'."}},datasource_syntax_mismatch:{type:"datasource_syntax_mismatch",logType:"warn",check:function(e){return{success:e.dataState.dataSource&&!(e.dataState.dataSource instanceof V.DataManager||"result"in e.dataState.dataSource||e.dataState.dataSource instanceof Array)&&!H.isNullOrUndefined(e.dataState.dataStateChange)}},generateMessage:function(){return qh+": DATASOURCE SYNTAX WARNING\nDataSource should be in the form of {result: Object[], count: number}when dataStateChangeEvent used"}}},Wh=function(e){e=e.error;return e.indexOf&&0!==e.indexOf("Format options")?"":"INVALID FORMAT\nFor more information, refer to the following documentation links:\nNumber format: "+zh+"/common/internationalization#supported-format-string\nDate format: "+zh+"/common/internationalization#manipulating-datetime\nMessage: "+e},Qh=function(e){e=V.DataUtil.getObject("error.error",e);if(H.isNullOrUndefined(e))return"";var t="";try{t=JSON.parse(e.responseText)}catch(e){t=""}return"XMLHTTPREQUEST FAILED\nUrl: "+e.responseURL+"\nStatus: "+e.status+" - "+e.statusText+"\n"+(""!==t?"Message: "+t:"")},Oh=(Gh=function(e,t){return(Gh=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)},function(e,t){function i(){this.constructor=e}Gh(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),Xh=function(){return(Xh=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},a=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(o=(s<3?r(o):3<s?r(t,i,o):r(t,i))||o);return 3<s&&o&&Object.defineProperty(t,i,o),o},Yh=(_h=H.ChildProperty,Oh($h,_h),a([H.Property(null)],$h.prototype,"name",void 0),a([H.Property(null)],$h.prototype,"tools",void 0),a([H.Property(null)],$h.prototype,"exposedTo",void 0),$h);function $h(){return null!==_h&&_h.apply(this,arguments)||this}Zh=H.ChildProperty,Oh(ed,Zh),a([H.Property()],ed.prototype,"field",void 0),a([H.Property()],ed.prototype,"direction",void 0),a([H.Property(!1)],ed.prototype,"isFromGroup",void 0);var Zh,Jh=ed;function ed(){return null!==Zh&&Zh.apply(this,arguments)||this}td=H.ChildProperty,Oh(nd,td),a([H.Collection([],Jh)],nd.prototype,"columns",void 0),a([H.Property(!0)],nd.prototype,"allowUnsort",void 0);var td,id=nd;function nd(){return null!==td&&td.apply(this,arguments)||this}rd=H.ChildProperty,Oh(od,rd),a([H.Property()],od.prototype,"field",void 0),a([H.Property()],od.prototype,"operator",void 0),a([H.Property()],od.prototype,"value",void 0),a([H.Property()],od.prototype,"matchCase",void 0),a([H.Property(!1)],od.prototype,"ignoreAccent",void 0),a([H.Property()],od.prototype,"predicate",void 0),a([H.Property({})],od.prototype,"actualFilterValue",void 0),a([H.Property({})],od.prototype,"actualOperator",void 0),a([H.Property()],od.prototype,"type",void 0),a([H.Property(!1)],od.prototype,"isRange",void 0),a([H.Property()],od.prototype,"ejpredicate",void 0),a([H.Property()],od.prototype,"filterComparer",void 0),a([H.Property()],od.prototype,"uid",void 0),a([H.Property()],od.prototype,"isForeignKey",void 0),a([H.Property()],od.prototype,"condition",void 0);var rd,sd=od;function od(){return null!==rd&&rd.apply(this,arguments)||this}ad=H.ChildProperty,Oh(hd,ad),a([H.Property(!1)],hd.prototype,"enableCache",void 0),a([H.Property(3)],hd.prototype,"maxBlocks",void 0),a([H.Property(3)],hd.prototype,"initialBlocks",void 0),a([H.Property(!1)],hd.prototype,"enableCountLessMode",void 0);var ad,ld=hd;function hd(){return null!==ad&&ad.apply(this,arguments)||this}dd=H.ChildProperty,Oh(cd,dd),a([H.Property("Row")],cd.prototype,"virtualDomType",void 0),a([H.Property(5)],cd.prototype,"rowBuffer",void 0),a([H.Property(0)],cd.prototype,"scrollThrottle",void 0),a([H.Property(500)],cd.prototype,"maxPoolSize",void 0),a([H.Property(!1)],cd.prototype,"autoRowHeight",void 0);var dd,pd=cd;function cd(){return null!==dd&&dd.apply(this,arguments)||this}ud=H.ChildProperty,Oh(fd,ud),a([H.Collection([],sd)],fd.prototype,"columns",void 0),a([H.Property("FilterBar")],fd.prototype,"type",void 0),a([H.Property("OnEnter")],fd.prototype,"mode",void 0),a([H.Property(!0)],fd.prototype,"showFilterBarStatus",void 0),a([H.Property(1500)],fd.prototype,"immediateModeDelay",void 0),a([H.Property()],fd.prototype,"operators",void 0),a([H.Property(!1)],fd.prototype,"ignoreAccent",void 0),a([H.Property(!1)],fd.prototype,"enableInfiniteScrolling",void 0),a([H.Property(50)],fd.prototype,"itemsCount",void 0),a([H.Property("Shimmer")],fd.prototype,"loadingIndicator",void 0),a([H.Property(!1)],fd.prototype,"enableCaseSensitivity",void 0),a([H.Property(!1)],fd.prototype,"showFilterBarOperator",void 0);var ud,gd=fd;function fd(){return null!==ud&&ud.apply(this,arguments)||this}md=H.ChildProperty,Oh(vd,md),a([H.Property(!1)],vd.prototype,"includeHiddenColumns",void 0),a([H.Property({})],vd.prototype,"queryBuilderSettings",void 0);var md,yd=vd;function vd(){return null!==md&&md.apply(this,arguments)||this}Sd=H.ChildProperty,Oh(wd,Sd),a([H.Property("Row")],wd.prototype,"mode",void 0),a([H.Property("Flow")],wd.prototype,"cellSelectionMode",void 0),a([H.Property("Single")],wd.prototype,"type",void 0),a([H.Property(!1)],wd.prototype,"checkboxOnly",void 0),a([H.Property(!1)],wd.prototype,"persistSelection",void 0),a([H.Property("Default")],wd.prototype,"checkboxMode",void 0),a([H.Property(!1)],wd.prototype,"enableSimpleMultiRowSelection",void 0),a([H.Property(!0)],wd.prototype,"enableToggle",void 0),a([H.Property(!1)],wd.prototype,"allowColumnSelection",void 0);var Sd,Cd=wd;function wd(){return null!==Sd&&Sd.apply(this,arguments)||this}bd=H.ChildProperty,Oh(Rd,bd),a([H.Property("Default")],Rd.prototype,"mode",void 0),a([H.Property(1500)],Rd.prototype,"immediateModeDelay",void 0),a([H.Property([])],Rd.prototype,"fields",void 0),a([H.Property("")],Rd.prototype,"key",void 0),a([H.Property("contains")],Rd.prototype,"operator",void 0),a([H.Property(!0)],Rd.prototype,"ignoreCase",void 0),a([H.Property(!1)],Rd.prototype,"ignoreAccent",void 0);var bd,Id=Rd;function Rd(){return null!==bd&&bd.apply(this,arguments)||this}xd=H.ChildProperty,Oh(Td,xd),a([H.Property()],Td.prototype,"targetID",void 0);var xd,Dd=Td;function Td(){return null!==xd&&xd.apply(this,arguments)||this}Ed=H.ChildProperty,Oh(Ad,Ed),a([H.Property("Both")],Ad.prototype,"wrapMode",void 0);var Ed,Od=Ad;function Ad(){return null!==Ed&&Ed.apply(this,arguments)||this}Fd=H.ChildProperty,Oh(kd,Fd),a([H.Property("Normal")],kd.prototype,"mode",void 0),a([H.Property(2)],kd.prototype,"resizeStep",void 0);var Fd,Md=kd;function kd(){return null!==Fd&&Fd.apply(this,arguments)||this}Pd=H.ChildProperty,Oh(Nd,Pd),a([H.Property(!0)],Nd.prototype,"showDropArea",void 0),a([H.Property(!1)],Nd.prototype,"allowReordering",void 0),a([H.Property(!1)],Nd.prototype,"showToggleButton",void 0),a([H.Property(!1)],Nd.prototype,"showGroupedColumn",void 0),a([H.Property(!0)],Nd.prototype,"showUngroupButton",void 0),a([H.Property(!1)],Nd.prototype,"disablePageWiseAggregates",void 0),a([H.Property([])],Nd.prototype,"columns",void 0),a([H.Property()],Nd.prototype,"captionTemplate",void 0),a([H.Property(!1)],Nd.prototype,"enableLazyLoading",void 0);var Pd,Ld=Nd;function Nd(){return null!==Pd&&Pd.apply(this,arguments)||this}Bd=H.ChildProperty,Oh(qd,Bd),a([H.Property(!1)],qd.prototype,"allowAdding",void 0),a([H.Property(!1)],qd.prototype,"allowEditing",void 0),a([H.Property(!1)],qd.prototype,"allowDeleting",void 0),a([H.Property("Normal")],qd.prototype,"mode",void 0),a([H.Property(!0)],qd.prototype,"allowEditOnDblClick",void 0),a([H.Property(!0)],qd.prototype,"showConfirmDialog",void 0),a([H.Property(!1)],qd.prototype,"showDeleteConfirmDialog",void 0),a([H.Property()],qd.prototype,"template",void 0),a([H.Property()],qd.prototype,"headerTemplate",void 0),a([H.Property()],qd.prototype,"footerTemplate",void 0),a([H.Property("Top")],qd.prototype,"newRowPosition",void 0),a([H.Property({})],qd.prototype,"dialog",void 0),a([H.Property(!1)],qd.prototype,"allowNextRowEdit",void 0),a([H.Property(!1)],qd.prototype,"showAddNewRow",void 0),a([H.Property(!1)],qd.prototype,"enableUndoRedo",void 0),a([H.Property(!1)],qd.prototype,"enableBatchUndoRedo",void 0),a([H.Property(20)],qd.prototype,"undoRedoLimit",void 0);var Bd,zd=qd;function qd(){return null!==Bd&&Bd.apply(this,arguments)||this}Ud=H.ChildProperty,Oh(Vd,Ud),a([H.Property(!0)],Vd.prototype,"allowBuiltInFunctions",void 0),a([H.Property({})],Vd.prototype,"customFunctions",void 0),a([H.Property("Automatic")],Vd.prototype,"calculationMode",void 0);var Ud,Hd=Vd;function Vd(){return null!==Ud&&Ud.apply(this,arguments)||this}jd=H.ChildProperty,Oh(_d,jd),a([H.Property("Spinner")],_d.prototype,"indicatorType",void 0);var jd,Gd=_d;function _d(){return null!==jd&&jd.apply(this,arguments)||this}Kd=H.Component,Oh(l,Kd),(Wd=l).prototype.getStatusPanel=function(e){return this.enableStatusBar&&!this.isDestroyed&&this.statusBarModule?this.statusBarModule.getStatusPanel(e):null},l.prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","groupSettings","columns","searchSettings","findSettings","selectedRowIndex","scrollPosition"],t={pageSettings:["template","pageSizes","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent"],groupSettings:["showDropArea","showToggleButton","showGroupedColumn","showUngroupButton","disablePageWiseAggregates","hideCaptionCount"],searchSettings:["fields","operator","ignoreCase"],findSettings:["fields","caseSensitive","currentPageOnly"],sortSettings:[],columns:[],selectedRowIndex:[],scrollPosition:[]},i=0;i<e.length;i++)for(var n=this[e[parseInt(i.toString(),10)]],r=0,s=t[e[parseInt(i.toString(),10)]];r<s.length;r++)delete n[""+s[r]];var o=this.pageSettings.template,a=Object.assign({template:void 0},this.pageSettings),l=(this.enableVirtualization&&this.enablePersistence&&this.contentModule&&this.contentModule.getPageFromTop&&!H.isNullOrUndefined(this.scrollPosition)&&!H.isNullOrUndefined(this.scrollPosition.top)&&(a.properties.currentPage=this.contentModule.getPageFromTop(this.scrollPosition.top,{block:1})),this.setProperties({pageSettings:a},!0),this.groupSettings.captionTemplate),h=l&&this.isAngular,d=(h&&delete this.groupSettings.properties.captionTemplate,this.pageTemplateChange=!H.isNullOrUndefined(this.pagerTemplate),this.addOnPersist(e));if(a.template=o,this.setProperties({pageSettings:a},!0),h&&(this.groupSettings.captionTemplate=l),this.sideBarModule){o=this.sideBarModule.getManagedAggregates();if(o.length)return(a=JSON.parse(d)).toolPanelAggregates=o,JSON.stringify(a)}return d},l.prototype.requiredModules=function(){this.setFrozenCount(),this.enableInfiniteAggrgate();var e=[];return this.isDestroyed||(this.enableStatusBar&&e.push({member:"statusBar",args:[this],name:"StatusBar"}),this.enableWebMcp&&e.push({member:"webMcpGrid",args:[this,this.serviceLocator],name:"WebMcpGrid"}),this.allowFiltering&&e.push({member:"filter",args:[this,this.filterSettings,this.serviceLocator],name:"Filter"}),this.allowAdvancedFiltering&&e.push({member:"advancedFilter",args:[this,this.serviceLocator],name:"AdvancedFilter"}),this.allowExcelExport&&e.push({member:"ExcelExport",args:[this,this.serviceLocator],name:"ExcelExport"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this],name:"PdfExport"}),this.allowSorting&&e.push({member:"sort",args:[this,this.sortSettings,this.sortedColumns,this.serviceLocator],name:"Sort"}),this.allowPaging&&e.push({member:"pager",args:[this,this.pageSettings],name:"Page"}),this.allowSelection&&e.push({member:"selection",args:[this,this.selectionSettings,this.serviceLocator],name:"Selection"}),this.ensureModuleInjected(th)&&e.push({member:"find",args:[this],name:"Find"}),this.resizeCheck()&&e.push({member:"resize",args:[this],name:"Resize"}),this.allowReordering&&e.push({member:"reorder",args:[this],name:"Reorder"}),this.allowRowDragAndDrop&&e.push({member:"rowDragAndDrop",args:[this],name:"RowDD"}),this.allowGrouping&&e.push({member:"group",args:[this,this.groupSettings,this.sortedColumns,this.serviceLocator],name:"Group"}),this.aggregates.length&&e.push({member:"aggregate",args:[this,this.serviceLocator],name:"Aggregate"}),this.isDetail()&&e.push({member:"detailRow",args:[this,this.serviceLocator],name:"DetailRow"}),(this.toolbar||this.toolbarTemplate)&&e.push({member:"toolbar",args:[this,this.serviceLocator],name:"Toolbar"}),(this.enableVirtualization&&!this.isRowDomVirtualization()||this.enableColumnVirtualization)&&e.push({member:"virtualscroll",args:[this,this.serviceLocator],name:"VirtualScroll"}),(this.getFrozenColumns()||this.frozenRows||this.frozenRightCount||this.frozenLeftCount)&&e.push({member:"freeze",args:[this,this.serviceLocator],name:"Freeze"}),!H.isNullOrUndefined(this.columns)&&this.isCommandColumn(this.columns)&&e.push({member:"commandColumn",args:[this,this.serviceLocator],name:"CommandColumn"}),(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&e.push({member:"edit",args:[this,this.serviceLocator],name:"Edit"}),this.extendRequiredModules(e)),e},l.prototype.extendRequiredModules=function(e){this.enableInfiniteScrolling&&e.push({member:"infiniteScroll",args:[this,this.serviceLocator],name:"InfiniteScroll"}),this.enableDomVirtualization&&e.push({member:"domVirtualization",args:[this,this.serviceLocator],name:"DomVirtualization"}),this.groupSettings.enableLazyLoading&&e.push({member:"lazyLoadGroup",args:[this,this.serviceLocator],name:"LazyLoadGroup"}),this.contextMenuItems&&e.push({member:"contextMenu",args:[this,this.serviceLocator],name:"ContextMenu"}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this,this.serviceLocator],name:"ColumnMenu"}),this.showColumnChooser&&e.push({member:"columnChooser",args:[this,this.serviceLocator],name:"ColumnChooser"}),this.enableToolPanel&&e.push({member:"sideBar",args:[this,this.serviceLocator],name:"SideBar"}),!H.isNullOrUndefined(this.columns)&&this.isForeignKeyEnabled(this.columns)&&e.push({member:"foreignKey",args:[this,this.serviceLocator],name:"ForeignKey"}),!H.isNullOrUndefined(this.columns)&&this.isFormulaColumnEnabled(this.columns)&&e.push({member:"formula",args:[this,this.serviceLocator],name:"Formula"}),this.enableLogger&&e.push({member:"logger",args:[this],name:"Logger"}),this.ensureModuleInjected(Ch)&&e.push({member:"highlight",args:[this,this.serviceLocator],name:"Highlight"})},l.prototype.resizeCheck=function(){var e=!!this.getColumns().filter(function(e){return!0===e.autoFit}).length,t=(H.isNullOrUndefined(this.columnModel)||!this.columnModel.length||this.columnModel[0]instanceof Q||(this.columnModel=[]),!(!this.showColumnMenu||this.columnMenuItems&&!this.columnMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length)),i=!(!this.contextMenuItems||!this.contextMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length);return this.allowResizing||this.autoFitColumnsResize||e||t||i},l.prototype.preRender=function(){this.serviceLocator=new Ia,this.initProperties(),this.initializeServices()},l.prototype.initProperties=function(){this.isInitial=!0,this.sortedColumns=[],this.inViewIndexes=[],this.mediaCol=[],this.isInitialLoad=!1,this.allowServerDataBinding=!1,this.ignoreCollectionWatch=!0,this.mergeCells={},this.isEdit=!1,this.checkAllRows="None",this.isCheckBoxSelection=!1,this.isPersistSelection=!1,this.componentRefresh=H.Component.prototype.refresh,this.freezeColumnRefresh=!0,this.filterOperators={contains:"contains",endsWith:"endswith",equal:"equal",greaterThan:"greaterthan",greaterThanOrEqual:"greaterthanorequal",lessThan:"lessthan",lessThanOrEqual:"lessthanorequal",notEqual:"notequal",startsWith:"startswith",wildCard:"wildcard",isNull:"isnull",notNull:"notnull",like:"like"},this.defaultChartLocale={Chart:"Chart",BarChart:"Bar Chart",Bar:"Bar",StackingBar:"Stacked Bar",StackingBar100:"100% Stacked Bar",Pie:"Pie Chart",ColumnChart:"Column Chart",Column:"Column",StackingColumn:"Stacked Column",StackingColumn100:"100% Stacked Column",LineChart:"Line Chart",Line:"Line",StackingLine:"Stacked Line",StackingLine100:"100% Stacked Line",AreaChart:"Area Chart",Area:"Area",StackingArea:"Stacked Area",StackingArea100:"100% Stacked Area",Scatter:"Scatter Chart"},this.defaultLocale=Xh({EmptyRecord:"No records to display",True:"true",False:"false",InvalidFilterMessage:"Invalid Filter Data",GroupDropArea:"Drag a column header here to group its column",UnGroup:"Click here to ungroup",UnGroupButton:"Click here to ungroup",GroupDisable:"Grouping is disabled for this column",FilterbarTitle:"'s filter bar cell",EmptyDataSourceError:"DataSource must not be empty at initial load since columns are generated from dataSource in AutoGenerate Column Grid",Add:"Add",Edit:"Edit",Cancel:"Cancel",Update:"Update",Delete:"Delete",Print:"Print",Pdfexport:"PDF Export",Excelexport:"Excel Export",Wordexport:"Word Export",Csvexport:"CSV Export",Search:"Search",ToolPanelColumns:"Columns",ToolPanelRowGroups:"Row Groups",ToolPanelValues:"Values",ToolPanelGroupDropArea:"Drag here to group its column",ToolPanelAggregateDropArea:"Drag here to aggregate its column",ToolPanelAggSum:"Sum",ToolPanelAggAverage:"Average",ToolPanelAggMin:"Min",ToolPanelAggMax:"Max",ToolPanelAggCount:"Count",ToolPanelAggTrueCount:"True Count",ToolPanelAggFalseCount:"False Count",ToolPanelFilters:"Filters",ToolPanelEdit:"Edit",SideBarLabel:"Grid tool panels",NoRowSelected:"Select rows to edit",EditRecordDetails:"Edit Record Details",MultiRowPlaceholder:"Multiple values - enter to update all",Find:"Find",FindNext:"Next match",FindPrevious:"Previous match",FindClear:"Clear find",Columnchooser:"Columns",Save:"Save",Item:"item",Items:"items",EditOperationAlert:"No records selected for edit operation",DeleteOperationAlert:"No records selected for delete operation",SaveButton:"Save",OKButton:"OK",CancelButton:"Cancel",EditFormTitle:"Details of ",AddFormTitle:"Add New Record",BatchSaveConfirm:"Are you sure you want to save changes?",BatchSaveLostChanges:"Unsaved changes will be lost. Are you sure you want to continue?",ConfirmDelete:"Are you sure you want to Delete Record?",CancelEdit:"Are you sure you want to Cancel the changes?",ChooseColumns:"Choose Column",ColumnChooserMoved:"Column {0} moved to position {1}",ColumnMenu:"Column Menu",SearchColumns:"search columns",Matchs:"No matches found",FilterButton:"Filter",FilterTitle:"Filter",FilterIcon:"Filter",ClearButton:"Clear",StartsWith:"Starts With",NotStartsWith:"Does Not Start With",Like:"Like",EndsWith:"Ends With",NotEndsWith:"Does Not End With",Contains:"Contains",NotContains:"Does Not Contain",IsNull:"Null",NotNull:"Not Null",IsEmpty:"Empty",IsNotEmpty:"Not Empty",Equal:"Equal",NotEqual:"Not Equal",LessThan:"Less Than",LessThanOrEqual:"Less Than Or Equal",GreaterThan:"Greater Than",GreaterThanOrEqual:"Greater Than Or Equal",In:"In",NotIn:"Not In",ChooseDate:"Choose a Date",EnterValue:"Enter the value",Copy:"Copy",Group:"Group by this column",Ungroup:"Ungroup by this column",GroupButton:"Group button",UnGroupAria:"ungroup button",GroupSeperator:"Separator for the grouped columns",UnGroupIcon:"ungroup the grouped column ",GroupedSortIcon:"sort the grouped column ",GroupedDrag:"Drag the grouped column",GroupCaption:" is groupcaption cell",CheckBoxLabel:"checkbox",SelectAllCheckbox:"Select all checkbox",SelectRow:"Select row",autoFitAll:"Autofit all columns",autoFit:"Autofit this column",AutoFitAll:"Autofit all columns",AutoFit:"Autofit this column",Export:"Export",FirstPage:"First Page",LastPage:"Last Page",PreviousPage:"Previous Page",NextPage:"Next Page",SortAscending:"Sort Ascending",SortDescending:"Sort Descending",EditRecord:"Edit Record",DeleteRecord:"Delete Record",FilterMenu:"Filter",SelectAll:"Select All",AddCurrentSelection:"Add current selection to filter",Blanks:"Blanks",FilterTrue:"True",FilterFalse:"False",NoResult:"No matches found",ClearFilter:"Clear Filter",Clear:"Clear",NumberFilter:"Number Filters",TextFilter:"Text Filters",DateFilter:"Date Filters",DateTimeFilter:"DateTime Filters",MatchCase:"Match Case",Between:"Between",BetweenFromAria:"From date",BetweenToAria:"To date",PresetThisWeek:"This Week",PresetThisMonth:"This Month",PresetThisYear:"This Year",PresetLastWeek:"Last Week",PresetLastMonth:"Last Month",PresetLast3Months:"Last 3 Months",PresetLast6Months:"Last 6 Months",PresetLastYear:"Last Year",CustomFilter:"Custom Filter",CustomFilterPlaceHolder:"Enter the value",CustomFilterDatePlaceHolder:"Choose a date",AND:"AND",OR:"OR",ShowRowsWhere:"Show rows where:",ToolbarMenuDialogARIA:"Toolbar menu dialog",FilterMenuDialogARIA:"Filter menu",ExcelFilterDialogARIA:"Excel filter",CheckBoxFilterDialogARIA:"Checkbox filter",DialogEditARIA:"Edit dialog",ColumnMenuDialogARIA:"Column menu dialog",CustomFilterDialogARIA:"Customer filter dialog",SortAtoZ:"Sort A to Z",SortZtoA:"Sort Z to A",SortByOldest:"Sort by Oldest",SortByNewest:"Sort by Newest",SortSmallestToLargest:"Sort Smallest to Largest",SortLargestToSmallest:"Sort Largest to Smallest",Sort:"Sort",SortIcon:"Sort",FilterDescription:"Press Alt Down to open filter Menu",SortDescription:"Press Enter to sort",ColumnMenuDescription:"Press Alt Down to open Column Menu",GroupDescription:"Press Ctrl space to group",ColumnHeader:" column header ",TemplateCell:" is template cell",CommandColumnAria:"is Command column column header ",DialogEdit:"Dialog edit",ClipBoard:"clipboard",AscendingText:"Ascending",DescendingText:"Descending",NoneText:"None",Expanded:"Expanded",Collapsed:"Collapsed",PinRow:"Pin Row",UnpinRow:"Unpin Row",Undo:"Undo",Redo:"Redo",AdvancedFilter:"Advanced Filter",ApplyAdvancedFilter:"Apply",CancelAdvancedFilter:"Cancel"},this.defaultChartLocale),this.keyConfigs={downArrow:"downarrow",upArrow:"uparrow",rightArrow:"rightarrow",leftArrow:"leftarrow",shiftDown:"shift+downarrow",shiftUp:"shift+uparrow",shiftRight:"shift+rightarrow",shiftLeft:"shift+leftarrow",home:"home",end:"end",escape:"escape",ctrlHome:"ctrl+home",ctrlEnd:"ctrl+end",pageUp:"pageup",pageDown:"pagedown",ctrlAltPageUp:"ctrl+alt+pageup",ctrlAltPageDown:"ctrl+alt+pagedown",altPageUp:"alt+pageup",altPageDown:"alt+pagedown",altDownArrow:"alt+downarrow",altUpArrow:"alt+uparrow",ctrlDownArrow:"ctrl+downarrow",ctrlUpArrow:"ctrl+uparrow",ctrlPlusA:"ctrl+A",ctrlPlusP:"ctrl+P",insert:"insert",delete:"delete",f2:"f2",enter:"enter",ctrlEnter:"ctrl+enter",shiftEnter:"shift+enter",tab:"tab",shiftTab:"shift+tab",space:"space",ctrlPlusC:"ctrl+C",ctrlShiftPlusH:"ctrl+shift+H",ctrlSpace:"ctrl+space",ctrlLeftArrow:"ctrl+leftarrow",ctrlRightArrow:"ctrl+rightarrow",altLeftArrow:"alt+leftarrow",altRightArrow:"alt+rightarrow",ctrlPlusZ:"ctrl+Z",ctrlPlusY:"ctrl+Y",cmdPlusZ:"cmd+Z",cmdShiftPlusZ:"cmd+shift+Z"}},l.prototype.render=function(){var e,t,i;if(this.log(["module_missing","promise_enabled","locale_missing","check_datasource_columns"]),this.ariaService.setOptions(this.element,{role:"grid"}),F.createSpinner({target:this.element,cssClass:this.cssClass||null},this.createElement),this.renderModule=new ya(this,this.serviceLocator),this.searchModule=new $l(this),this.scrollModule=new hh(this),this.notify(ft,{}),this.pageSettings.enableQueryString&&(e=new URL(window.location.href).searchParams.get("page"),!H.isNullOrUndefined(e))&&0<window.location.href.indexOf("?page=")&&(e=parseInt(e,10),this.setProperties({pageSettings:{currentPage:e}},!0),this.pageSettings.currentPage=e),!0!==this.getDataModule().dataManager.dataSource.offline&&void 0!==this.getDataModule().dataManager.dataSource.url||!H.isNullOrUndefined(this.dataSource)&&this.dataSource.result||(this.isVirtualAdaptive=!0),this.aggregateModule&&this.aggregates.length)for(var n=0;n<this.aggregates.length;n++)for(var r=0;r<this.aggregates[parseInt(n.toString(),10)].columns.length;r++){var s=this.aggregates[parseInt(n.toString(),10)].columns[parseInt(r.toString(),10)];s.types&&(s.type=s.types)}this.isReact?(t={requireTemplateRef:this.requireTemplateRef},this.enableVirtualization||this.enableColumnVirtualization?(t.enableSeamlessScrolling=this.enableSeamlessScrolling,this.trigger(ie,t),this.enableSeamlessScrolling=t.enableSeamlessScrolling,gu(this.enableSeamlessScrolling)):this.trigger(ie,t),t.requireTemplateRef||(this.requireTemplateRef=t.requireTemplateRef)):this.enableVirtualization||this.enableColumnVirtualization?(t={enableSeamlessScrolling:this.enableSeamlessScrolling},this.trigger(ie,t),this.enableSeamlessScrolling=t.enableSeamlessScrolling,gu(this.enableSeamlessScrolling)):this.trigger(ie),this.advancedFilterModule&&this.advancedFilterSettings&&this.advancedFilterSettings.queryBuilderSettings&&this.advancedFilterSettings.queryBuilderSettings.rule&&(e=this.advancedFilterSettings.queryBuilderSettings.rule,t=this.getPredicateFromRule(e))&&(i=this.query?this.query.clone():new V.Query,this.advancedFilterModule.baseQuery=i.clone(),this.query=i.clone().where(t),this.advancedFilterModule.setRule(e)),"string"==typeof this.isRowSelectable&&(this.isRowSelectable=H.getValue(this.isRowSelectable,window)),"string"==typeof this.isRowNonDeselectable&&(this.isRowNonDeselectable=H.getValue(this.isRowNonDeselectable,window)),this.isRowNonDeselectable&&(this.selectionSettings.persistSelection=!0),"string"==typeof this.isRowPinned&&(this.isRowPinned=H.getValue(this.isRowPinned,window)),"string"==typeof this.setRowHeight&&(this.setRowHeight=H.getValue(this.setRowHeight,window)),this.isRowPinned&&this.allowSelection&&(this.selectionSettings.persistSelection=!0,this.selectionSettings.type="Multiple"),up(this.columns,this.enableColumnVirtualization,this),this.enableColumnVirtualization&&this.isChangeDataSourceCall&&this.columnModel&&(this.columnModel=[],this.updateColumnModel(this.columns)),this.isPreparedFrozenColumns=!0,this.enablePersistence&&this.notify(gn,{}),this.getMediaColumns(),cp(this.columns),this.isFrozenGrid()&&!this.mergedColumns&&this.setInitialFrozenColumnIndex(this.columns),this.checkLockColumns(this.columns),this.getColumns(),this.processModel(),this.gridRender(),this.wireEvents(),this.addListener(),this.updateDefaultCursor(),this.updateStackedFilter(),"Spinner"===this.loadingIndicator.indicatorType&&this.showSpinner(),this.notify(mt,{}),"Shimmer"===this.loadingIndicator.indicatorType&&this.refreshMaskRow(),this.refreshing&&this.trigger("created")},l.prototype.setInitialFrozenColumnIndex=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i[Ys]=i.index,i.columns&&this.setInitialFrozenColumnIndex(i.columns)}},l.prototype.showSpinner=function(){this.isExportGrid||F.showSpinner(this.element)},l.prototype.hideSpinner=function(){this.isExportGrid||F.hideSpinner(this.element)},l.prototype.showMaskRow=function(e,t){if(!H.isNullOrUndefined(this.headerModule)&&!H.isNullOrUndefined(this.contentModule)){var i,n=this.getHeaderContent().firstChild,r=this.getContent().firstChild,s=this.getFooterContent();if(t){var o=t.querySelector(".e-checkboxlist");if(!H.isNullOrUndefined(o)){var a=Math.floor(o.getBoundingClientRect().height/this.getRowHeight()),l='<div class="e-ftrchk e-mask-ftrchk"><div class="e-checkbox-wrapper"><input class="e-chk-hidden">'+this.getShimmerTemplate()+this.getShimmerTemplate()+"</div></div>";o.innerHTML="";for(var h=0;h<a;h++){o.innerHTML+=l,o.querySelector(".e-ftrchk.e-mask-ftrchk").style.width="100%",o.querySelector(".e-checkbox-wrapper").style.width="100%";var d=[].slice.call(o.querySelectorAll(".e-mask:not(.e-mask-checkbox-filter-intent):not(.e-mask-checkbox-filter-span-intent)"));d[0].classList.add("e-mask-checkbox-filter-intent"),d[1].classList.add("e-mask-checkbox-filter-span-intent")}}}else(!this.enableRtl&&!this.getHeaderContent().style.paddingRight||this.enableRtl&&!this.getHeaderContent().style.paddingLeft)&&(r.style.overflowY="hidden"),this.isInitialLoad||this.getColumns().length?(this.maskRowContentScroll=!(!this.enableVirtualization&&!this.enableColumnVirtualization||!e),this.contentMaskTable||(i=r,(this.enableVirtualization||this.enableColumnVirtualization)&&(i=i.querySelector(".e-virtualtable")),H.isNullOrUndefined(i.querySelector("tbody")))||"X"===e&&"Sticky"===this.emptyRecordMode&&0===this.currentViewData.length||(this.contentMaskTable=this.createMaskTable(i,this.getContentMaskColumns(),e)),!this.headerMaskTable&&(this.isFrozenGrid()&&!this.isRowPinned&&!this.pinnedTopRowModels.length||this.enableColumnVirtualization&&"X"===e)&&(i=n,this.enableColumnVirtualization&&"X"===e&&(i=i.querySelector(".e-virtualtable")),this.headerMaskTable=this.createMaskTable(i,this.getContentMaskColumns(),e)),s&&s.querySelector(".e-summaryrow")&&(t=s.firstChild,!this.footerContentMaskTable)&&(this.isFrozenGrid()&&!this.isRowPinned&&!this.pinnedTopRowModels.length||this.enableColumnVirtualization&&"X"===e)&&(i=t,this.enableColumnVirtualization&&"X"===e&&(i=t.querySelector(".e-virtualtable")),this.footerContentMaskTable=this.createMaskTable(i,this.getContentMaskColumns(),e)),this.enableVirtualization&&e&&!this.isRowDomVirtualization()||H.EventHandler.add(r,"scroll",this.translateMaskRow,this)):(t=0===(s=r.getBoundingClientRect().height)?this.allowPaging?this.pageSettings.pageSize*this.getRowHeight():window.innerHeight:s,i=Math.ceil(t/this.getRowHeight()),"Vertical"!==this.rowRenderingMode&&(this.headerMaskTable=this.createEmptyMaskTable(n,1)),this.contentMaskTable=this.createEmptyMaskTable(r,i))}},l.prototype.getContentMaskColumns=function(){return this.getColumns()},l.prototype.createEmptyMaskTable=function(e,t){var i=this.createElement("table",{className:"e-table e-masked-table"}),n=this.createElement("tbody",{className:"e-masked-tbody"}),r=this.createElement("tr",{className:"e-masked-row e-row"}),s=(r.style.height=this.getRowHeight()+"px",this.createElement("td",{className:"e-masked-cell e-rowcell"}));s.innerHTML=this.getShimmerTemplate(),r.appendChild(s);for(var o=0;o<t;o++)n.appendChild(r.cloneNode(!0));return i.appendChild(n),e.appendChild(i),i},l.prototype.createFrozenMaskRow=function(e,t,i){for(var n=0;n<e.length;n++)n<this.frozenLeftCount?(this.frozenLeftCount-1!==n||i||e[parseInt(n.toString(),10)].classList.add("e-freezeleftborder"),e[parseInt(n.toString(),10)].classList.add("e-leftfreeze"),e[parseInt(n.toString(),10)].setAttribute("aria-colindex",(n+1).toString()),e[parseInt(n.toString(),10)].style.left=t[parseInt(n.toString(),10)].valueX-this.translateX+"px"):e.length-this.frozenRightCount<=n&&t[parseInt(n.toString(),10)]&&(e.length-this.frozenRightCount!==n||i||e[parseInt(n.toString(),10)].classList.add("e-freezerightborder"),e[parseInt(n.toString(),10)].classList.add("e-rightfreeze"),e[parseInt(n.toString(),10)].setAttribute("aria-colindex",(n+1).toString()),e[parseInt(n.toString(),10)].style.right=this.translateX+t[parseInt(n.toString(),10)].valueX+"px")},l.prototype.createMaskTable=function(e,t,i){var n=!!H.closest(e,".e-gridheader"),r=!!H.closest(e,".e-gridcontent"),s=!!H.closest(e,".e-gridfooter"),o=this.getContent().firstChild,a=o.scrollHeight,l=e.querySelector("table"),h=l.cloneNode(),d=(h.removeAttribute("role"),h.removeAttribute("id"),H.updateCSSText(h,"position: absolute; z-index: 5; width: "+l.getBoundingClientRect().width+"px;"),!n||this.enableColumnVirtualization&&"X"===i||(h.style.transform="translate(0px,"+l.querySelector("thead").getBoundingClientRect().height+"px)"),h.setAttribute("class","e-table e-masked-table"),l.querySelector("colgroup").cloneNode(!0));if(d.removeAttribute("id"),d.setAttribute("class","e-masked-colgroup"),h.appendChild(d),n&&this.enableColumnVirtualization&&"X"===i){for(var p=this.createMaskRow(d,t),c=(this.isFrozenGrid()&&(x=[].slice.call(p.querySelectorAll(".e-rowcell")),this.createFrozenMaskRow(x,t)),l.querySelector("thead")),u=[].slice.call(c.querySelectorAll("tr")),g=c.cloneNode(),f=(g.removeAttribute("role"),g.setAttribute("class","e-masked-thead"),u.length),m=0;m<f;m++)g.appendChild(p.cloneNode(!0)),g.childNodes[parseInt(m.toString(),10)].style.height=u[parseInt(m.toString(),10)].getBoundingClientRect().height+"px";h.appendChild(g)}var y=l.querySelector("tbody").cloneNode(),c=(y.removeAttribute("role"),y.setAttribute("class","e-masked-tbody"),l.querySelector("tbody"));if(r||n){var v,S=o,C=!this.isTreeGrid,C=this.getRowHeight(!1,C),S=S.getBoundingClientRect().height,w=H.isNullOrUndefined(this.pageSettings)?0:this.pageSettings.pageSize,f=0<C?Math.ceil(S/C):0<w?w:12;if(this.allowPaging&&this.pageSettings.pageSize!==this.currentViewData.length&&this.pagerModule.pagerObj.totalPages!==this.pageSettings.currentPage){(v=(p=this.createMaskRow(d,t)).cloneNode(!0)).classList.add("e-altrow");for(m=0;m<this.pageSettings.pageSize-this.currentViewData.length;m++)y.appendChild((m%2==1?v:p).cloneNode(!0))}if(c.querySelector(".e-emptyrow")||!c.childNodes.length||r&&this.childGrid){(v=(p=this.createMaskRow(d,t)).cloneNode(!0)).classList.add("e-altrow");for(m=0;m<f;m++)y.appendChild(((m+1)%2==0?v:p).cloneNode(!0))}else{var S='tr:not(.e-hide):not([style*="display:none"]):not([style*="display: none"])',u=(this.isTreeGrid&&(S='tr:not(.e-hide):not([style*="display:none"]):not([style*="display: none"]):not(.e-childrow-hidden)'),[].slice.call(c.querySelectorAll(S))),C=c.querySelector(".e-addedrow, .e-editedrow"),w=void 0;if(C){if(w=u.indexOf(C),this.isFrozenGrid()&&this.enableColumnVirtualization)for(var b=[].slice.call(u[w+1].querySelectorAll(".e-rowcell")),m=0;m<b.length;m++)m<this.frozenLeftCount?(b[parseInt(m.toString(),10)].classList.add("e-leftfreeze"),b[parseInt(m.toString(),10)].setAttribute("aria-colindex",(m+1).toString()),b[parseInt(m.toString(),10)].style.left=t[parseInt(m.toString(),10)].valueX-this.translateX+"px"):b.length-this.frozenRightCount<=m&&t[parseInt(m.toString(),10)]&&(b[parseInt(m.toString(),10)].classList.add("e-rightfreeze"),b[parseInt(m.toString(),10)].setAttribute("aria-colindex",(m+1).toString()),b[parseInt(m.toString(),10)].style.right=this.translateX+t[parseInt(m.toString(),10)].valueX+"px");C.classList.contains("e-addedrow")?u.splice(w,2):u.splice(w,1)}f=(!this.enableVirtualization&&!this.enableColumnVirtualization||!i)&&f<=u.length?f:u.length;for(m=0;m<f;m++){var I=this.applyMaskRow(u[parseInt(m.toString(),10)].cloneNode(!0),u[parseInt(m.toString(),10)].getBoundingClientRect().height);this.enableColumnVirtualization&&"X"===i&&this.isFrozenGrid()&&(x=[].slice.call(I.querySelectorAll(".e-masked-cell")),this.createFrozenMaskRow(x,t)),y.appendChild(I)}this.addMaskRows(y,f/2,u[0],r,i),C&&C.classList.contains("e-editedrow")&&w<f&&((S=y.childNodes[parseInt(w.toString(),10)]).style.height=this.getRowHeight()+"px",S.classList.add("e-row"),C.classList.contains("e-altrow"))&&S.classList.add("e-altrow")}}if(h.appendChild(y),s){for(var c=l.querySelector("tfoot"),R=c.cloneNode(),u=(R.setAttribute("class","e-masked-tfoot"),[].slice.call(c.querySelectorAll("tr"))),m=0;m<u.length;m++){var x,D=void 0;this.enableColumnVirtualization&&"X"===i?(D=this.createMaskRow(d,t,s),this.isFrozenGrid()&&(x=[].slice.call(D.querySelectorAll(".e-rowcell")),this.createFrozenMaskRow(x,t,s))):D=this.applyMaskRow(u[parseInt(m.toString(),10)].cloneNode(!0),u[parseInt(m.toString(),10)].getBoundingClientRect().height),R.appendChild(D)}h.appendChild(R)}return n&&this.isFrozenGrid()&&!this.enableColumnVirtualization&&(this.getHeaderContent().querySelector("."+Cs).style.position="relative"),e.insertBefore(h,e.firstChild),!r||this.enableVirtualization&&i||(w=a-h.getBoundingClientRect().height,C=o.scrollTop<=(w=w<0?0:w)?o.scrollTop:w,this.enableVirtualization&&(C-=dc(H.closest(e,".e-virtualtable")).height),h.style.transform="translate(0px,"+C+"px)"),h},l.prototype.addMaskRows=function(e,t,i,n,r){if(this.isTreeGrid&&this.enableVirtualization&&n&&"Y"===r)for(var s=0;s<t;s++){var o=i.cloneNode(!0),a=i.getBoundingClientRect().height,o=this.applyMaskRow(o,a);e.appendChild(o)}},l.prototype.applyMaskRow=function(e,t){e.removeAttribute("role"),e.removeAttribute("aria-rowindex"),e.removeAttribute("data-uid"),e.classList.add("e-masked-row"),e.style.height=t+"px";for(var i=[].slice.call(e.childNodes),n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)],s=r.firstChild&&r.firstChild.classList&&r.firstChild.classList.contains("e-checkbox-wrapper");r.removeAttribute("role"),r.removeAttribute("tabindex"),r.removeAttribute("aria-label"),this.enableColumnVirtualization&&r.classList.contains("e-fixedfreeze")&&(H.removeClass([r],["e-fixedfreeze","e-freezeleftborder","e-freezerightborder"]),H.addClass([r],["e-unfreeze"])),r.removeAttribute("aria-colindex"),r.removeAttribute("data-index"),r.removeAttribute("data-mappingname"),r.removeAttribute("data-mappingvalue"),r.removeAttribute("data-mappinguid"),r.removeAttribute("aria-expanded"),r.classList.add("e-masked-cell"),r.innerHTML=this.getShimmerTemplate(),r.classList.contains("e-recordplusexpand")||r.classList.contains("e-recordpluscollapse")?r.firstChild.classList.add("e-mask-group-intent"):r.classList.contains("e-gridchkbox")||s?r.firstChild.classList.add("e-mask-checkbox-intent"):r.classList.contains("e-rowdragdrop")?r.firstChild.classList.add("e-mask-drag-intent"):r.classList.contains("e-indentcell")&&(r.innerHTML="")}return e},l.prototype.createMaskRow=function(e,t,i){for(var n=e,r=t,s=this.createElement("tr",{className:"e-masked-row e-row"}),o=("Vertical"!==this.rowRenderingMode&&(i&&this.footerRowHeight?s.style.height=this.footerRowHeight+"px":s.style.height=this.getRowHeight()+"px"),this.createElement("td",{className:"e-masked-cell e-rowcell"})),a=0,l=0;a<n.childNodes.length;a++){var h=n.childNodes[parseInt(a.toString(),10)],d=o.cloneNode();d.innerHTML=this.getShimmerTemplate(),h.classList.contains("e-group-intent")||h.classList.contains("e-detail-intent")||h.classList.contains("e-drag-intent")?h.classList.contains("e-group-intent")?d.firstChild.classList.add("e-mask-group-intent"):h.classList.contains("e-detail-intent")?d.firstChild.classList.add("e-mask-detail-intent"):h.classList.contains("e-drag-intent")&&d.firstChild.classList.add("e-mask-drag-intent"):("Vertical"===this.rowRenderingMode&&r[parseInt(l.toString(),10)]&&d.setAttribute("data-cell",r[parseInt(l.toString(),10)].headerText?r[parseInt(l.toString(),10)].headerText:r[parseInt(l.toString(),10)].field),"none"===h.style.display?d.classList.add("e-hide"):(d.style.textAlign=r[parseInt(l.toString(),10)]&&r[parseInt(l.toString(),10)].textAlign?r[parseInt(l.toString(),10)].textAlign.toLowerCase():this.enableRtl?"right":"left",r[parseInt(l.toString(),10)]&&("checkbox"===r[parseInt(l.toString(),10)].type||r[parseInt(l.toString(),10)].displayAsCheckBox)&&d.firstChild.classList.add("e-mask-checkbox-intent")),l++),s.appendChild(d)}return s},l.prototype.getShimmerTemplate=function(){return this.maskRowContentScroll?'<span class="e-mask e-skeleton e-skeleton-text"></span>':'<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave"></span>'},l.prototype.addShimmerEffect=function(){this.maskRowContentScroll=!1;for(var e=[].slice.call(this.element.querySelectorAll(".e-mask:not(.e-shimmer-wave)")),t=0;t<e.length;t++)e[parseInt(t.toString(),10)]&&e[parseInt(t.toString(),10)].classList.add("e-shimmer-wave")},l.prototype.translateMaskRow=function(e){for(var t=e.target,i=t.querySelectorAll(".e-masked-table"),n=0;n<i.length;n++){var r,s=i[parseInt(n.toString(),10)];s&&(r=t.scrollHeight-s.getBoundingClientRect().height,r=t.scrollTop<=(r=r<0?0:r)?t.scrollTop:r,this.enableVirtualization&&(r-=dc(H.closest(s,".e-virtualtable")).height),s.style.transform="translate(0px,"+r+"px)")}},l.prototype.removeMaskRow=function(){H.isNullOrUndefined(this.contentModule)||(e=this.getContent().firstChild,H.EventHandler.remove(e,"scroll",this.translateMaskRow)),this.headerMaskTable&&this.isFrozenGrid()&&!this.enableColumnVirtualization&&(this.getHeaderContent().querySelector("."+Cs).style.position="");for(var e,t=[this.headerMaskTable,this.contentMaskTable,this.footerContentMaskTable],i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];n&&H.remove(n)}this.headerMaskTable=null,this.contentMaskTable=null,this.footerContentMaskTable=null},l.prototype.refreshMaskRow=function(){var e,t=this.getContent().firstChild;(this.isInitialLoad||this.getColumns().length)&&this.contentMaskTable&&t.querySelector(".e-masked-table")&&(e=t,this.enableVirtualization&&(e=t.querySelector(".e-virtualtable")),this.refreshMaskRowColgroupWidth(e))},l.prototype.refreshMaskRowColgroupWidth=function(e){var t=e.querySelector("table:not(.e-masked-table)"),i=t.querySelector(qs).cloneNode(!0),e=e.querySelector(".e-masked-table");i.removeAttribute("id"),i.setAttribute("class","e-masked-colgroup");for(var n=0;n<i.childNodes.length;n++)i.childNodes[parseInt(n.toString(),10)].removeAttribute("class");H.remove(e.querySelector(".e-masked-colgroup")),e.insertBefore(i,e.firstChild),e.style.width=t.getBoundingClientRect().width+"px"},l.prototype.updateStackedFilter=function(){this.allowFiltering&&"FilterBar"===this.filterSettings.type&&this.getHeaderContent().getElementsByClassName("e-stackedheadercell").length?this.getHeaderContent().classList.add("e-stackedfilter"):this.getHeaderContent().classList.remove("e-stackedfilter")},l.prototype.getMediaColumns=function(){if(!this.enableColumnVirtualization){var e=this.getColumns();if(this.getShowHideService=this.serviceLocator.getService("showHideService"),!H.isNullOrUndefined(e))for(var t=0;t<e.length;t++)H.isNullOrUndefined(e[parseInt(t.toString(),10)].hideAtMedia)||!H.isNullOrUndefined(e[parseInt(t.toString(),10)].visible)&&!e[parseInt(t.toString(),10)].visible||this.pushMediaColumn(e[parseInt(t.toString(),10)],t)}this.updateFrozenColumnsWidth()},l.prototype.pushMediaColumn=function(e,t){this.mediaCol.push(e),this.media[e.uid]=window.matchMedia(e.hideAtMedia),this.mediaQueryUpdate(t,this.media[e.uid]),this.mediaBindInstance[parseInt(t.toString(),10)]=this.mediaQueryUpdate.bind(this,t),this.media[e.uid].addListener(this.mediaBindInstance[parseInt(t.toString(),10)])},l.prototype.updateMediaColumns=function(e){if(!this.enableColumnVirtualization){for(var t=this.getColumnIndexByUid(e.uid),i=0;i<this.mediaCol.length;i++)if(e.uid===this.mediaCol[parseInt(i.toString(),10)].uid)return void this.mediaCol.splice(i,1);this.pushMediaColumn(e,t)}},l.prototype.mediaQueryUpdate=function(e,t){var i=this.getColumns()[parseInt(e.toString(),10)];this.mediaCol.some(function(e){return e.uid===i.uid})&&(i.visible=t.matches,this.isInitialLoad)&&(this.invokedFromMedia=!0,i.visible?this.showHider.show(i.headerText,"headerText"):this.showHider.hide(i.headerText,"headerText"))},l.prototype.refreshMediaCol=function(){this.isInitialLoad=!0;var e=this.element.querySelector("."+Ss);this.aggregates.length&&this.element.scrollHeight>parseInt(this.height.toString(),10)&&e&&H.addClass([e],["e-footerpadding"]);e=(this.enableColumnVirtualization?this.columns:this.getColumns()).filter(function(e){return"checkbox"===e.type});(0===e.length||e.length&&"ResetOnRowClick"===this.selectionSettings.checkboxMode)&&(this.isCheckBoxSelection=!1),"Vertical"===this.rowRenderingMode&&this.enableHover&&(this.setProperties({enableAdaptiveUI:!0,enableHover:!1},!0),H.removeClass([this.element],"e-gridhover")),this.enableAdaptiveUI&&this.scrollModule&&this.scrollModule.refresh(),this.isFrozenGrid()&&this.isAutoGenerateColumns&&(this.widthService.setWidthToColumns(),this.isAutoGenerateColumns=!1)},l.prototype.removeMediaListener=function(){for(var e=0;e<this.mediaCol.length;e++)this.media[this.mediaCol[parseInt(e.toString(),10)].uid].removeListener(this.mediaBindInstance[this.mediaCol[parseInt(e.toString(),10)].index])},l.prototype.eventInitializer=function(){},l.prototype.destroy=function(){var e=this.element;if(e){for(var e=!(!e.querySelector("."+ms)||!e.querySelector("."+vs)),t=(e&&this.unwireEvents(),this.removeListener(),this.removeMediaListener(),this.notify(s,{}),this.destroyDependentModules(),this.isReact&&this.destroyTemplate(["template"]),this.isVue&&this.destroyTemplate(),e&&Kd.prototype.destroy.call(this),this.toolTipObj.destroy(),this.isReact&&!H.Browser.isIE&&(this.element.innerHTML=""),["renderModule","headerModule","contentModule","valueFormatterService","serviceLocator","ariaService","keyboardModule","widthService","searchModule","findModule","showHider","scrollModule","printModule","clipboardModule","focusModule","editModule"]),i=0;i<t.length;i++)this[t[parseInt(i.toString(),10)]]&&(this[t[parseInt(i.toString(),10)]]=null);this.element.innerHTML="",H.classList(this.element,[],["e-rtl","e-gridhover","e-responsive","e-default","e-device","e-grid-min-height"])}},l.prototype.destroyDependentModules=function(){var e=this.element;e&&(e.querySelector("."+ms)||e.querySelector("."+vs))&&(this.scrollModule.destroy(),this.keyboardModule.destroy(),this.focusModule.destroy(),this.clipboardModule.destroy(),this.printModule.destroy())},l.prototype.getModuleName=function(){return"grid"},l.prototype.find=function(e){this.findModule&&this.findModule.find(e)},l.prototype.findNext=function(){this.findModule&&this.findModule.findNext()},l.prototype.findPrevious=function(){this.findModule&&this.findModule.findPrevious()},l.prototype.goToMatch=function(e){this.findModule&&this.findModule.goToMatch(e)},l.prototype.clearActiveMatch=function(){this.findModule&&this.findModule.clearActiveMatch()},l.prototype.clearFind=function(){this.findModule&&this.findModule.clearFind()},l.prototype.getTotalMatches=function(){return this.findModule?this.findModule.getTotalMatches():0},l.prototype.getActiveMatch=function(){return this.findModule?this.findModule.getActiveMatch():null},l.prototype.enableBoxSelection=function(){this.enableAutoFill?(this.selectionSettings.cellSelectionMode="BoxWithBorder",this.element.classList.add("e-afenabled")):(this.element.classList.remove("e-afenabled"),this.notify(Ht,{}))},l.prototype.setCSSClass=function(e){this.cssClass&&H.addClass([this.element],this.cssClass.split(" ")),e&&H.removeClass([this.element],e.split(" "))},l.prototype.onPropertyChanged=function(e,t){var i,n=!1,r=!1,s=!1,o=null;if(!this.isDestroyed){this.log("module_missing"),this.isEllipsisTooltip()&&this.toolTipObj.close();var a=Object.keys(e);-1<a.indexOf("columns")&&(this.enableColumnVirtualization&&(this.columnModel=[]),this.updateColumnObject(),r=!0);for(var l=0,h=a;l<h.length;l++){var d=h[l];switch(d){case"enableStatusBar":case"statusBarSettings":this.notify(St,{module:"statusBar",enable:this.enableStatusBar});break;case"allowPaging":this.notify(St,{module:"pager",enable:this.allowPaging}),n=!0,("100%"===this.height||"string"==typeof this.height&&-1!==this.height.toLowerCase().indexOf("vh"))&&this.scrollModule.refresh(),this.getDataModule().clearCache();break;case"pageSettings":if(this.pageTemplateChange)this.pageTemplateChange=!1,this.notify(wt,{module:"pager",properties:e.pageSettings});else{if(this.pagerModule&&this.pagerModule.isCancel)return void(this.pagerModule.isCancel=!1);this.notify(wt,{module:"pager",properties:e.pageSettings}),(H.isNullOrUndefined(e.pageSettings.currentPage)&&H.isNullOrUndefined(e.pageSettings.pageSize)&&H.isNullOrUndefined(e.pageSettings.totalRecordsCount)||!H.isNullOrUndefined(t.pageSettings)&&e.pageSettings.currentPage!==t.pageSettings.currentPage&&!this.enableColumnVirtualization&&!this.enableVirtualization&&this.pageRequireRefresh&&this.pageSettings.totalRecordsCount<=this.pageSettings.pageSize)&&(n=!0),this.pageRequireRefresh||(this.pageRequireRefresh=!0),this.pagerModule&&this.pagerModule.isCancel&&(this.pagerModule.isCancel=!1)}break;case"allowSorting":this.notify(St,{module:"sort",enable:this.allowSorting}),i=n=!0;break;case"allowFiltering":this.updateStackedFilter(),this.notify(St,{module:"filter",enable:this.allowFiltering}),n=!0,"FilterBar"!==this.filterSettings.type||this.editSettings.showAddNewRow&&"FilterBar"===this.filterSettings.type?this.refreshHeader():("100%"===this.height||"string"==typeof this.height&&-1!==this.height.toLowerCase().indexOf("vh"))&&this.scrollModule.refresh();break;case"height":case"width":this.notify(St,{module:"scroll",properties:{width:e.width,height:e.height}}),this.allowPaging&&this.pagerModule.refresh();break;case"allowReordering":this.headerModule.refreshUI(),i=!0;break;case"allowRowDragAndDrop":this.notify(St,{module:"rowDragAndDrop",enable:this.allowRowDragAndDrop}),this.renderModule.refresh(),this.headerModule.refreshUI();break;case"allowSelection":this.notify(St,{module:"selection",enable:this.allowSelection}),this.renderModule.refresh();break;case"allowTextSelection":this.allowTextSelection?this.element.classList.remove("e-disableuserselect"):this.element.classList.add("e-disableuserselect");break;case"cssClass":this.setCSSClass(t.cssClass);break;case"enableAutoFill":this.selectionModule&&(this.enableBoxSelection(),this.selectionModule.updateAutoFillPosition());break;case"rowTemplate":this.rowTemplateFn=hp(this.rowTemplate),n=!0;break;case"emptyRecordTemplate":this.emptyRecordTemplateFn=hp(this.emptyRecordTemplate),n=!0;break;case"detailTemplate":this.detailTemplateFn=hp(this.detailTemplate),n=!0;break;case"detailTemplateHeight":this.isRowDomVirtualization()&&(n=!0);break;case"allowGrouping":this.notify(St,{module:"group",enable:this.allowGrouping}),this.headerModule.refreshUI(),i=n=!0,("100%"===this.height||"string"==typeof this.height&&-1!==this.height.toLowerCase().indexOf("vh"))&&this.scrollModule.refresh();break;case"enableInfiniteScrolling":case"childGrid":if(n=!0,o=(p=this.parentDetails?document.querySelector("#"+kp(this.parentDetails.parentID)):null)?p.ej2_instances[0]:null,this.childGrid&&o&&H.isNullOrUndefined(o.childGrid.childGrid)){var p=Object.assign({},o.childGrid,{childGrid:e.childGrid});for(o.setProperties({childGrid:p},!0);!H.isNullOrUndefined(o.parentDetails);){var c,u=document.querySelector("#"+kp(o.parentDetails.parentID)),u=u?u.ej2_instances[0]:null;u&&((c=Object.assign({},u.childGrid)).childGrid=o.childGrid,u.setProperties({childGrid:c},!0)),o=u}}this.headerModule.refreshUI();break;case"toolbar":this.notify(St,{module:"toolbar"}),("100%"===this.height||"string"==typeof this.height&&-1!==this.height.toLowerCase().indexOf("vh"))&&this.scrollModule.refresh();break;case"groupSettings":this.notify(wt,{module:"group",properties:e.groupSettings,oldProperties:t.groupSettings});break;case"aggregates":!this.aggregates.length&&this.allowGrouping&&this.groupSettings.columns.length&&(n=!0),this.notify(St,{module:"aggregate",properties:e}),("100%"===this.height||"string"==typeof this.height&&-1!==this.height.toLowerCase().indexOf("vh"))&&this.scrollModule.refresh();break;case"domVirtualizationSettings":H.isNullOrUndefined(e.domVirtualizationSettings.virtualDomType)?n=!0:r=s=!0;break;case"frozenColumns":case"frozenRows":case"enableVirtualization":case"enableColumnVirtualization":case"enableDomVirtualization":case"currencyCode":case"locale":"frozenColumns"===d&&null===e.frozenColumns&&this.resetFrozenColumns(),this.isFrozenGrid()&&this.log("frozen_rows_columns"),this.addNewRowFocus=r=s=!0;break;case"query":this.getDataModule().isQueryInvokedFromData||(n=!0),this.getDataModule().isQueryInvokedFromData=!1;break;case"autoFit":this.autoFit?this.preventAdjustColumns():this.restoreAdjustColumns();break;default:this.extendedPropertyChange(d,e,r)}}i&&this.updateDefaultCursor(),r?s||this.getFrozenColumns()||this.frozenRows||this.frozenLeftColumns.length||this.frozenRightColumns.length?this.freezeRefresh():this.refresh():n&&(this.notify(bt,{requestType:"refresh"}),n=!1,this.maintainSelection(e.selectedRowIndex))}},l.prototype.extendedPropertyChange=function(e,t,i){switch(e){case"enableRtl":this.updateRTL(),this.allowPaging&&(this.element.querySelector(".e-gridpager").ej2_instances[0].enableRtl=t.enableRtl,this.element.querySelector(".e-gridpager").ej2_instances[0].dataBind()),"auto"!==this.height&&(this.scrollModule.removePadding(!t.enableRtl),this.scrollModule.setPadding()),this.toolbar&&this.toolbarModule&&(this.toolbarModule.getToolbar().ej2_instances[0].enableRtl=t.enableRtl,this.toolbarModule.getToolbar().ej2_instances[0].dataBind()),this.contextMenuItems&&this.contextMenuModule&&(this.contextMenuModule.getContextMenu().ej2_instances[0].enableRtl=t.enableRtl,this.contextMenuModule.getContextMenu().ej2_instances[0].dataBind()),this.showColumnMenu&&this.columnMenuModule&&!this.enableAdaptiveUI&&(this.columnMenuModule.getColumnMenu().ej2_instances[0].enableRtl=t.enableRtl,this.columnMenuModule.getColumnMenu().ej2_instances[0].dataBind()),"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&this.refreshHeader(),this.notify(Ki,{});break;case"enableAltRow":this.renderModule.refresh();break;case"allowResizing":this.resizeModule&&this.resizeModule.render(),this.headerModule.refreshUI(),this.updateResizeLines();break;case"rowHeight":this.rowHeight?H.addClass([this.element],"e-grid-min-height"):H.removeClass([this.element],"e-grid-min-height"),this.renderModule.refresh(),this.headerModule.refreshUI();break;case"headerRowHeight":this.headerModule.refreshUI();break;case"gridLines":this.updateGridLines();break;case"showColumnMenu":this.headerModule.refreshUI(),this.notify(St,{module:"columnMenu",enable:!0});break;case"columnMenuItems":this.notify(St,{module:"columnMenu",enable:this.columnMenuItems});break;case"contextMenuItems":this.notify(St,{module:"contextMenu",enable:this.contextMenuItems});break;case"showColumnChooser":this.toolbarModule&&this.toolbarModule.refreshToolbarItems(),this.notify(St,{module:"columnChooser",enable:this.showColumnChooser});break;case"enableToolPanel":case"toolPanelSettings":this.notify(as,{module:"sideBar",properties:t});break;case"columnChooserSettings":this.notify(wt,{module:"columnChooser",properties:t.columnChooserSettings});break;case"filterSettings":this.updateStackedFilter(),this.notify(wt,{module:"filter",properties:t.filterSettings});break;case"searchSettings":this.notify(wt,{module:"search",properties:t.searchSettings});break;case"findSettings":this.notify(wt,{module:"find",properties:t.findSettings});break;case"sortSettings":this.notify(wt,{module:"sort"});break;case"isRowNonDeselectable":this.isRowNonDeselectable&&!this.selectionSettings.persistSelection&&(this.setProperties({selectionSettings:{persistSelection:!0}},!0),this.notify(wt,{module:"selection",properties:{persistSelection:!0}}));break;case"selectionSettings":this.isRowNonDeselectable&&(this.setProperties({selectionSettings:{persistSelection:!0}},!0),t.selectionSettings.persistSelection=!0),this.notify(wt,{module:"selection",properties:t.selectionSettings});break;case"editSettings":this.notify(wt,{module:"edit",properties:t.editSettings});break;case"emptyRecordMode":this.currentViewData&&0===this.currentViewData.length&&(this.isEdit&&this.closeEdit(),this.renderModule.renderEmptyRow());break;case"allowTextWrap":case"textWrapSettings":this.allowTextWrap?this.applyTextWrap():this.removeTextWrap(),this.notify(Oi,{case:"textwrap",isModeChg:"textWrapSettings"===e}),this.refreshHeader(),("100%"===this.height||"string"==typeof this.height&&-1!==this.height.toLowerCase().indexOf("vh"))&&this.scrollModule.refresh();break;case"dataSource":var n=this.getDataModule().getState();if(!this.allowPaging||!this.pageSettings.pageSizes||this.getDataModule().isRemote()||n&&n.isPending||this.pagerModule.pagerObj.isAllPage&&(l=this.dataSource instanceof V.DataManager?this.dataSource.dataSource.json.length:"result"in this.dataSource?this.dataSource.count:this.dataSource.length,!!(Array.isArray(this.pageSettings.pageSizes)&&-1<this.pageSettings.pageSizes.indexOf("All"))||this.pageSettings.pageSizes||this.pageSettings.pageSize===l?(this.setProperties({pageSettings:{pageSize:l}},!0),this.pagerModule.pagerObj.setProperties({pageSize:l},!0)):this.pagerModule.pagerObj.isAllPage=!1),!this.allowSelection||!this.isPersistSelection||n&&n.isPending||this.clearSelection(),this.partialSelectedRecords=[],this.partialSelectedIndexes=[],this.disableSelectedRecords=[],this.renderModule.selectableDataKey={},this.renderModule.nonselectableDataKey={},!H.isNullOrUndefined(this.dataSource)&&this.dataSource.result&&(this.isVirtualAdaptive=!1),Object.getPrototypeOf(t).deepWatch)for(var r=this.getPrimaryKeyFieldNames()[0],s=0,o=Object.keys(t.dataSource);s<o.length;s++)this.setRowData(H.getValue(r,this.dataSource[o[parseInt(s.toString(),10)]]),this.dataSource[o[parseInt(s.toString(),10)]]);else if(n.isPending){this.getDataModule().storePendingCustomBindingCache(this.dataSource);var a=H.isNullOrUndefined(this.dataSource)?[]:this.dataSource.result;if((d=n.group||[]).length&&!this.groupSettings.enableLazyLoading&&(!a.length||!a[0].field))for(s=0;s<d.length;s++)a=V.DataUtil.group(a,d[parseInt(s.toString(),10)],n.aggregates||[]);var l=this.dataSource,h=void 0,h=this.enableInfiniteScrolling&&this.infiniteScrollSettings&&this.infiniteScrollSettings.enableCountLessMode?H.extend({},l,{result:a,count:l.count,aggregates:l.aggregates}):{result:a,count:l.count,aggregates:l.aggregates};this.dataSource=h,this.getDataModule().setState({}),n.resolver(this.dataSource)}else{if(!H.isNullOrUndefined(this.dataSource)&&this.dataSource.result&&this.dataSource.count&&this.groupSettings.columns.length){var d,a=this.dataSource.result;if((d=this.groupSettings.columns).length&&(!a.length||!a[0].field))for(s=0;s<d.length;s++)a=V.DataUtil.group(a,d[parseInt(s.toString(),10)]);this.dataSource={result:a,count:this.dataSource.count}}this.getDataModule().setState({isDataChanged:!1}),this.notify(ei,{}),i||(this.isRowSelectable&&!this.isRemote()&&(l=this.getDataModule().dataManager.executeLocal(this.getDataModule().generateQuery(!0)),this.renderModule.setPartialRecord(l)),this.renderModule.refresh(),this.isCheckBoxSelection&&this.notify(sr,{}))}this.scrollRefresh();break;case"enableHover":(t.enableHover?H.addClass:H.removeClass)([this.element],"e-gridhover");break;case"selectedRowIndex":this.isSelectedRowIndexUpdating||this.selectRow(t.selectedRowIndex),this.isSelectedRowIndexUpdating=!1;break;case"resizeSettings":this.widthService.setWidthToTable();break;case"enableAdaptiveUI":this.notify(Sr,{});break;case"rowRenderingMode":this.enableVerticalRendering(),this.notify(wr,{}),this.refresh();break;case"enableStickyHeader":this.scrollModule.addStickyListener(t.enableStickyHeader);break;case"allowPdfExport":case"allowExcelExport":this.toolbarModule&&this.toolbarModule.refreshToolbarItems();break;case"enableRowSpan":case"enableColumnSpan":this.refreshColumns()}},l.prototype.maintainSelection=function(e){var t,i=this;-1!==e&&this.on(vt,t=function(){i.selectRow(e),i.off(vt,t)},this)},l.prototype.setProperties=function(e,t){var i=this.groupSettings.columns,n="frozenColumns",r=(null!==e[n]&&0!==e[n]||!t||this.resetFrozenColumns(),Kd.prototype.setProperties.call(this,e,t),"groupSettings");if(e.filterSettings&&this.filterModule&&t&&this.filterModule.refreshFilter(),e[r]&&e[r].columns&&this.groupModule&&t){if(!this.groupSettings.showGroupedColumn&&H.isNullOrUndefined(e.columns))for(var s=0;s<i.length;s++)this.getColumnByField(i[parseInt(s.toString(),10)]).visible=!0;for(s=0;s<this.sortSettings.columns.length;s++)-1!==i.indexOf(this.sortSettings.columns[parseInt(s.toString(),10)].field)&&this.sortSettings.columns[parseInt(s.toString(),10)].isFromGroup&&(this.sortSettings.columns.splice(s,1),s--);for(s=0;s<e[r].columns.length;s++)this.groupModule.groupAddSortingQuery(e[r].columns[parseInt(s.toString(),10)]),this.getColumnByField(e[r].columns[parseInt(s.toString(),10)]).visible=this.groupSettings.showGroupedColumn}},l.prototype.getTablesCount=function(){return this.tablesCount},l.prototype.isRemote=function(){return this.getDataModule().isRemote()||!H.isNullOrUndefined(this.dataSource)&&!H.isNullOrUndefined(this.dataSource.result)},l.prototype.updateDefaultCursor=function(){for(var e=[].slice.call(this.getHeaderContent().querySelectorAll(".e-headercell:not(.e-stackedheadercell)")),t=[].slice.call(this.getHeaderContent().getElementsByClassName("e-stackedheadercell")),i=this.getColumns(),n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)],s=i[parseInt(n.toString(),10)];this.allowGrouping&&s.allowGrouping||this.allowReordering&&s.allowReordering||this.allowSorting&&s.allowSorting?r.classList.add("e-mousepointer"):r.classList.add("e-defaultcursor")}for(var o=0;o<t.length;o++)this.allowReordering&&t[parseInt(o.toString(),10)].classList.add("e-mousepointer")},l.prototype.updateColumnModel=function(e,t){for(var i=0,n=H.isNullOrUndefined(e)?0:e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?this.updateColumnModel(e[parseInt(i.toString(),10)].columns,!0):this.columnModel.push(e[parseInt(i.toString(),10)]);!H.isNullOrUndefined(t)&&t||this.updateLockableColumns()},l.prototype.getFrozenLeftCount=function(){return this.getFrozenColumns()||this.getFrozenLeftColumnsCount()},l.prototype.isFrozenGrid=function(){return 0!==this.getFrozenColumns()||0!==this.frozenLeftColumns.length||0!==this.frozenRightColumns.length||0!==this.fixedColumns.length},l.prototype.getFrozenMode=function(){return this.frozenName},l.prototype.updateLockableColumns=function(){for(var e=this.columnModel,t=0,i=0,n=this.getFrozenColumns(),r=0;r<e.length;r++)e[parseInt(r.toString(),10)].lockColumn&&(r<n?(e.splice(t,0,e.splice(r,1)[0]),t++):(e.splice(n+i,0,e.splice(r,1)[0]),i++))},l.prototype.checkLockColumns=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].columns?this.checkLockColumns(e[parseInt(t.toString(),10)].columns):e[parseInt(t.toString(),10)].lockColumn&&this.lockcolPositionCount++},l.prototype.leftrightColumnWidth=function(e){var e="left"===e?this.getFrozenLeftColumns():"right"===e?this.getFrozenRightColumns():[],t=0;return e.filter(function(e){e.visible&&(t+=parseInt(e.width.toString(),10))}),t},l.prototype.getColumns=function(e){var t=this,i=this.inViewIndexes.map(function(e){return e-t.groupSettings.columns.length}).filter(function(e){return-1<e}),n=i.length,r=(this.enableColumnVirtualization&&!H.isNullOrUndefined(this.columnModel)&&0!==this.columnModel.length&&!e||(this.columnModel=[],this.updateColumnModel(this.columns)),0===n?this.columnModel:this.getVisibleColumns().slice(i[0],i[n-1]+1)),s=[],o=[],a=[],l=this.enableColumnVirtualization&&this.isPreparedFrozenColumns&&0===n;l&&(this.frozenRightColumns=[],this.frozenLeftColumns=[]);for(var h=0;h<r.length;h++)"Left"===r[parseInt(h.toString(),10)].freeze||r[parseInt(h.toString(),10)].isFrozen?(s.push(r[parseInt(h.toString(),10)]),l&&this.frozenLeftColumns.push(r[parseInt(h.toString(),10)])):"Right"===r[parseInt(h.toString(),10)].freeze?(o.push(r[parseInt(h.toString(),10)]),l&&this.frozenRightColumns.push(r[parseInt(h.toString(),10)])):a.push(r[parseInt(h.toString(),10)]);return this.enableColumnVirtualization&&this.isFrozenGrid()&&(this.frozenLeftColumns.length&&(s=this.frozenLeftColumns),this.frozenRightColumns.length)&&(o=this.frozenRightColumns),s.concat(a).concat(o)},l.prototype.getPersistColumns=function(){var e=JSON.parse(this.addOnPersist(["columns"])).columns;return e?JSON.stringify(e):""},l.prototype.setColumns=function(e){!H.isNullOrUndefined(e)&&e instanceof Array&&e.length&&this.setProperties({columns:e},!1)},l.prototype.getStackedHeaderColumnByHeaderText=function(e,t){for(var i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];if(n.field===e||n.headerText===e){this.stackedColumn=n;break}n.columns&&this.getStackedHeaderColumnByHeaderText(e,n.columns)}return this.stackedColumn},l.prototype.getColumnIndexesInView=function(){return this.inViewIndexes},l.prototype.getQuery=function(){return this.query},l.prototype.getLocaleConstants=function(){return this.defaultLocale},l.prototype.setColumnIndexesInView=function(e){this.inViewIndexes=e},l.prototype.getVisibleColumns=function(){return this.getCurrentVisibleColumns()},l.prototype.getHeaderContent=function(){return this.headerModule?this.headerModule.getPanel():null},l.prototype.setGridHeaderContent=function(e){this.headerModule&&this.headerModule.setPanel(e)},l.prototype.getContentTable=function(){return this.contentModule?this.contentModule.getTable():null},l.prototype.setGridContentTable=function(e){this.contentModule&&this.contentModule.setTable(e)},l.prototype.getContent=function(){return this.contentModule?this.contentModule.getPanel():null},l.prototype.setGridContent=function(e){this.contentModule&&this.contentModule.setPanel(e)},l.prototype.getHeaderTable=function(){return this.headerModule?this.headerModule.getTable():null},l.prototype.setGridHeaderTable=function(e){this.headerModule&&this.headerModule.setTable(e)},l.prototype.getFooterContent=function(){return this.footerElement=this.element.getElementsByClassName(Ss)[0],this.footerElement},l.prototype.getFooterContentTable=function(){return this.footerElement=this.element.getElementsByClassName(Ss)[0],this.footerElement?this.footerElement.firstChild.firstChild:null},l.prototype.getPager=function(){return this.gridPager},l.prototype.setGridPager=function(e){this.gridPager=e},l.prototype.getRowByIndex=function(e){return this.enableVirtualization&&this.groupSettings.enableLazyLoading?this.lazyLoadRender.getRowByIndex(e):this.contentModule?this.contentModule.getRowByIndex(e):null},l.prototype.getMovableRowByIndex=function(e){return this.contentModule?this.contentModule.getRowByIndex(e):null},l.prototype.getFrozenRowByIndex=function(e){return this.contentModule?this.contentModule.getRowByIndex(e):null},l.prototype.getRows=function(){return this.contentModule?this.contentModule.getRowElements():[]},l.prototype.getFrozenRightRowByIndex=function(e){return this.contentModule?this.contentModule.getRowByIndex(e):null},l.prototype.getRowInfo=function(e){var t=e,i={target:e};if(!H.isNullOrUndefined(e)&&H.isNullOrUndefined(I(t,"e-detailrowcollapse")&&H.isNullOrUndefined(I(t,"e-recordplusexpand")))){var n=H.closest(t,"."+b);if(!n)return l=H.closest(t,"."+Ts),H.isNullOrUndefined(l)||l.classList.contains("e-addedrow")||(o=this.getRowObjectFromUID(l.getAttribute("data-uid")),r=parseInt(l.getAttribute(D),10)-1,i={row:l,rowData:o.data,rowIndex:r}),i;var r,s,o,a,l=parseInt(n.getAttribute(zs),10)-1,h=H.closest(n,"."+Ts);H.isNullOrUndefined(n)||isNaN(l)||H.isNullOrUndefined(h)||(r=parseInt(h.getAttribute(D),10)-1,o=this.contentModule.getRows(),s=l+this.getIndentCount(),o=o.filter(function(e){return e.uid===h.getAttribute("data-uid")}),this.pinnedTopRowModels.length&&!H.isNullOrUndefined(e)&&I(t,"e-headercontent")&&(o=this.pinnedTopRowModels.filter(function(e){return e.uid===h.getAttribute("data-uid")})),t={},a=void 0,Object.keys(o).length&&(t=o[0].data,a=o[0].cells[parseInt(s.toString(),10)].column),i={cell:n,cellIndex:l,row:h,rowIndex:r,rowData:t,column:a,target:e})}return i},l.prototype.getMovableRows=function(){return this.contentModule?this.contentModule.getRowElements():[]},l.prototype.getFrozenRightRows=function(){return this.contentModule?this.contentModule.getRowElements():[]},l.prototype.getDataRows=function(){return this.getAllDataRows()},l.prototype.getAllDataRows=function(e){var t,i;return H.isNullOrUndefined(this.getContentTable().querySelector(j))?[]:(i=this.getContentTable().querySelector(j),i=[].slice.call(i.children),this.editSettings.showAddNewRow&&(i[0].classList.contains("e-addedrow")?i.shift():i[i.length-1].classList.contains("e-addedrow")&&i.pop()),(this.frozenRows||this.pinnedTopRowModels.length)&&(t=this.getHeaderTable().querySelector(j),t=[].slice.call(t.children),i=this.addMovableRows(t,i),this.editSettings.showAddNewRow)&&t[0].classList.contains("e-addedrow")&&t.shift(),this.generateDataRows(i,e))},l.prototype.addMovableRows=function(e,t){for(var i=0,n=t.length;i<n;i++)e.push(t[parseInt(i.toString(),10)]);return e},l.prototype.generateDataRows=function(e,t){for(var i=[],n=0,r=e.length;n<r;n++)!e[parseInt(n.toString(),10)].classList.contains(Ts)||e[parseInt(n.toString(),10)].classList.contains("e-hiddenrow")&&!t||(this.isCollapseStateEnabled()?i[parseInt(e[parseInt(n.toString(),10)].getAttribute("aria-rowindex"),10)-1]=e[parseInt(n.toString(),10)]:i.push(e[parseInt(n.toString(),10)]));return i},l.prototype.getMovableDataRows=function(){return this.getAllMovableDataRows()},l.prototype.getAllMovableDataRows=function(e){return this.getAllDataRows(e)},l.prototype.getFrozenDataRows=function(){return this.getAllFrozenDataRows()},l.prototype.getAllFrozenDataRows=function(e){return this.getAllDataRows(e)},l.prototype.getFrozenRightDataRows=function(){return this.getAllFrozenRightDataRows()},l.prototype.getAllFrozenRightDataRows=function(e){return this.getAllDataRows(e)},l.prototype.setCellValue=function(t,e,i){var n,r,s,o,a,l,h,d,p;this.contentModule&&(n="index",r=this.getPrimaryKeyFieldNames()[0],s=new vo(this,this.serviceLocator),o=this.getColumnIndexByField(e),a=this.getColumnByField(e),h=(l=this.contentModule.getRows().filter(function(e){return H.getValue(r,e.data)===t})[0])?this.element.querySelector("[data-uid="+kp(l.uid)+"]"):null,H.isNullOrUndefined(h)||("string"==typeof i&&(i=this.sanitize(i)),H.setValue(e,i,l.data),d=this.enableVirtualization?h.children[parseInt(o.toString(),10)]:this.getCellFromIndex(l[n],o),H.isNullOrUndefined(d))||(this.groupSettings.columns.length&&(o+=this.groupSettings.columns.length),(this.childGrid||this.detailTemplate)&&o++,this.isRowDragable()&&o++,p=l.cells[+o],this.isAngular&&a.template?this.refreshCellTemplateById(d,p,l.data,l[n]):s.refreshTD(d,p,l.data,{index:l[n]}),this.isReact&&(d=this.enableVirtualization?h.children[parseInt(o.toString(),10)]:this.getCellFromIndex(l[n],o)),0<this.aggregates.length&&(this.notify(Nt,{}),0<this.groupSettings.columns.length)&&this.notify(Lt,{}),H.isNullOrUndefined(l)||H.isNullOrUndefined(l.changes)||(l.changes[""+e]=i),this.trigger(re,{cell:d,column:a,data:l.data}),this.isReact&&"0"===d.getAttribute("tabindex")&&d.classList.contains("e-focused")&&d.focus()))},l.prototype.setCellValueAsync=function(i,n,r,s){var o=this;return new Promise(function(e,t){try{o.setCellValue(i,n,r),!H.isNullOrUndefined(s)&&0<s?setTimeout(function(){e()},s):e()}catch(e){t(e)}})},l.prototype.refreshReactColumnTemplateByUid=function(e,i){var n=this;this.isReact&&this.clearTemplate(["columnTemplate"],void 0,function(){var e=!(!n.childGrid||!n.element.querySelectorAll(".e-childgrid").length),t=e?n.getContentTable().querySelectorAll(".e-row"):n.getDataRows();n.refreshReactTemplateTD(t,e),i&&n.renderTemplates()})},l.prototype.refreshReactTemplateTD=function(e,t,i){for(var n=this.getIndentCount(),r=0,s=!1,o=0;o<e.length;o++){var a,l=this.getRowObjectFromUID(e[parseInt(o.toString(),10)].getAttribute("data-uid"));if(t&&!l&&I(e[parseInt(o.toString(),10)],"e-childgrid")&&(l=(a=I(e[parseInt(o.toString(),10)],"e-childgrid").ej2_instances[0]).getRowObjectFromUID(e[parseInt(o.toString(),10)].getAttribute("data-uid")),r=a.getIndentCount(),s=!0),l&&l.isDataRow&&!H.isNullOrUndefined(l.index)&&!e[parseInt(o.toString(),10)].classList.contains("e-editedrow"))for(var h=0;h<l.cells.length;h++){var d,p,c=l.cells[parseInt(h.toString(),10)];c.isTemplate&&(d=new vo(this,this.serviceLocator),p=t?e[parseInt(o.toString(),10)].children[c.index+(s?r:n)]:this.getCellFromIndex(o,i?c.index:h-n),d.refreshTD(p,c,l.data,{index:l.index}))}s=!1}},l.prototype.refreshCellTemplate=function(e,t,i,n){e&&t&&t.isTemplate&&(n={"data-index":H.isNullOrUndefined(n)?"":n.toString()},new vo(this,this.serviceLocator).refreshTD(e,t,i,n))},l.prototype.refreshCellTemplateById=function(e,t,i,n){var r,s;this.isAngular&&e&&t&&t.isTemplate&&(r="template_"+n+"_"+t.column.uid,s=this.columnTemplateIDs.filter(function(e){return e===r}),this.columnTemplateIDs=this.columnTemplateIDs.filter(function(e){return e!==r}),this.clearTemplate(s||["template"]),this.refreshCellTemplate(e,t,i,n))},l.prototype.refreshRowCellTemplates=function(e){if(this.isAngular&&e){var t=this.getIndentCount(),i=parseInt(e.getAttribute("aria-rowindex"),10)-1,n="template_"+i+"_",r=e?this.columnTemplateIDs.filter(function(e){return 0===e.indexOf(n)}):[],s=(this.columnTemplateIDs=e?this.columnTemplateIDs.filter(function(e){return 0!==e.indexOf(n)}):[],this.clearTemplate(r||["template"]),this.getRowObjectFromUID(e.getAttribute("data-uid")));if(s&&s.isDataRow&&!H.isNullOrUndefined(s.index)&&!e.classList.contains("e-editedrow"))for(var o=0;o<s.cells.length;o++){var a=s.cells[parseInt(o.toString(),10)];a.isTemplate&&this.refreshCellTemplate(this.getCellFromIndex(i,o-t),a,s.data,s.index)}}},l.prototype.refreshGroupCaptionFooterTemplate=function(){if(this.getContentTable())for(var e=!(!this.childGrid||!this.element.querySelectorAll(".e-childgrid").length),t=this.getContentTable().querySelectorAll(".e-groupcaptionrow, .e-groupfooterrow"),i=0;i<t.length;i++){var n=this,r=this.getRowObjectFromUID(t[parseInt(i.toString(),10)].getAttribute("data-uid"));(r=e&&!r&&I(t[parseInt(i.toString(),10)],"e-childgrid")?(n=I(t[parseInt(i.toString(),10)],"e-childgrid").ej2_instances[0]).getRowObjectFromUID(t[parseInt(i.toString(),10)].getAttribute("data-uid")):r)&&(r={cells:r.cells.filter(function(e){return e.isDataCell}),data:r.data,dataUid:r.uid},n.notify(Bt,r))}},l.prototype.refreshReactHeaderTemplateByUid=function(r){if(this.isReact)for(var s="cells",o=this.headerModule.rows,a=this.getNormalizedColumnIndex(r),l=this,e=0;e<o.length;e++)!function(e){var t,i,n=o[parseInt(e.toString(),10)][""+s][parseInt(a.toString(),10)];n&&n.column.uid===r&&(e=new Do(l,l.serviceLocator),t=I(l.element.querySelectorAll("[data-mappinguid="+kp(r)+"]")[0],"e-templatecell"),e.refresh(n,t),-1!==(t=(e=l.sortSettings.columns).findIndex(function(e){return e.field===n.column.field})))&&(i=l.getColumnHeaderByField(n.column.field),l.ariaService.setSort(i,e[parseInt(t.toString(),10)].direction.toLowerCase()),1<e.length&&i.querySelector(".e-headercelldiv").insertBefore(l.createElement("span",{className:"e-sortnumber",innerHTML:(t+1).toString()}),i.querySelector(".e-headertext")),i=i.querySelector(".e-sortfilterdiv"),"Ascending"===e[parseInt(t.toString(),10)].direction?H.classList(i,["e-ascending","e-icon-ascending"],[]):H.classList(i,["e-descending","e-icon-descending"],[]))}(e)},l.prototype.setRowData=function(t,e){var i,n,r;this.contentModule&&(n=this.contentModule.getRows(),i=this.getPrimaryKeyFieldNames()[0],r=(n=(n=0<this.groupSettings.columns.length&&0<this.aggregates.length?n.filter(function(e){return e.isDataRow}):n).filter(function(e){return H.getValue(i,e.data)===t})[0])?[].slice.call(this.element.querySelectorAll("[data-uid="+kp(n.uid)+"]")):void 0,!H.isNullOrUndefined(n))&&r.length&&(n.changes=e,this.frozenRows?(r=this.getRowsObject()[n.index],this.setFrozenRowData(r,e)):(r=!(!(r=this.getRowElementByUID(n.uid))||!r.querySelector(".e-lastrowcell")),this.setFrozenRowData(n,e),r&&this.scrollModule.setLastRowCell()),0<this.aggregates.length)&&(this.notify(Nt,{}),0<this.groupSettings.columns.length)&&this.notify(Lt,{})},l.prototype.setRowDataAsync=function(i,n,r){var s=this;return new Promise(function(e,t){try{s.setRowData(i,n),!H.isNullOrUndefined(r)&&0<r?setTimeout(function(){e()},r):e()}catch(e){t(e)}})},l.prototype.saveBulkChanges=function(e,t,i){var n=this.getPrimaryKeyFieldNames()[0],t=t&&t.length?t:this.getSelectedRecords(),r=Object.keys(e);if(n&&r.length&&t.length){for(var s={addedRecords:[],deletedRecords:[],changedRecords:[]},o={addedRecords:[],deletedRecords:[],changedRecords:[]},a=0,l=t;a<l.length;a++){var h=l[a];o.changedRecords.push(H.extend({},{},h,!0));for(var d=0,p=r;d<p.length;d++){var c,u=p[d];u===n||H.isNullOrUndefined(this.getColumnByField(u))||(c=H.getValue(u,e),H.setValue(u,c,h))}s.changedRecords.push(H.extend({},{},h,!0))}var t=this.getDataModule().saveChanges(s,n,o),g=function(e){H.isNullOrUndefined(i)||"function"!=typeof i||i(e)};this.getDataModule().isRemote()?t.then(function(e){g(e)}).catch(function(e){g({error:e})}):g(t)}},l.prototype.saveBulkChangesAsync=function(e,n){var r=this,t=n&&n.length?n:this.getSelectedRecords(),i=Object.keys(e);return this.getPrimaryKeyFieldNames()[0]&&i.length&&t.length?new Promise(function(t,i){r.saveBulkChanges(e,n,function(e){(e&&e.error?i:t)(e)})}):Promise.resolve()},l.prototype.setFrozenRowData=function(e,t){var i=new $s(this.serviceLocator,null,this);e.changes=t,Yp(e,this.getForeignKeyColumns(),e.changes),i.refresh(e,this.getColumns(),!0)},l.prototype.getCellFromIndex=function(e,t){var i=this.getColumnByIndex(t);return Uc(this,0,e,t)},l.prototype.getMovableCellFromIndex=function(e,t){return this.getCellFromIndex(e,t)},l.prototype.flashCells=function(e){this.highlightModule&&this.highlightModule.flash(e)},l.prototype.getFrozenRightCellFromIndex=function(e,t){return this.getCellFromIndex(e,t)},l.prototype.getColumnHeaderByIndex=function(e){return this.getHeaderTable()?this.getHeaderTable().getElementsByClassName("e-headercell")[parseInt(e.toString(),10)]:null},l.prototype.getMovableColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},l.prototype.getFrozenRightColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},l.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},l.prototype.getRowObjectFromUID=function(e){if(!this.contentModule)return null;var t=this.contentModule.getRows(),t=this.rowObject(t,e);if(H.isNullOrUndefined(t)&&this.pinnedTopRowModels.length){var i=this.pinnedTopRowModels,t=this.rowObject(i,e);if(!H.isNullOrUndefined(t))return t}return H.isNullOrUndefined(t)&&this.enableVirtualization&&0<this.groupSettings.columns.length?this.rowObject(this.vRows,e):t},l.prototype.rowObject=function(e,t){if(e)for(var i=0,n=e;i<n.length;i++){var r=n[i];if(r.uid===t)return r}return null},l.prototype.getRowsObject=function(){return this.contentModule?this.contentModule.getRows():[]},l.prototype.getMovableRowsObject=function(){return this.contentModule?this.contentModule.getRows():[]},l.prototype.getFrozenRightRowsObject=function(){return this.contentModule?this.contentModule.getRows():[]},l.prototype.getColumnHeaderByField=function(e){e=this.getColumnByField(e);return e?this.getColumnHeaderByUid(e.uid):void 0},l.prototype.getColumnHeaderByUid=function(e){return this.getHeaderContent()&&(e=this.getHeaderContent().querySelector("[data-mappinguid="+kp(e)+"]"))?H.closest(e,"th"):void 0},l.prototype.getColumnByIndex=function(i){var n;return this.getColumns().some(function(e,t){return n=e,t===i}),n},l.prototype.getColumnByField=function(t){return ap(this.getColumns(),function(e){if(e.field===t)return e})[0]},l.prototype.getColumnIndexByField=function(e){for(var t=this.getColumns(),i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].field===e)return i;return-1},l.prototype.getColumnByUid=function(t,e){return ap((e?this.columns:this.getColumns()).concat(this.getStackedColumns(this.columns)),function(e){if(e.uid===t)return e})[0]},l.prototype.getStackedColumns=function(e,t){void 0===t&&(t=[]);for(var i=0,n=e;i<n.length;i++){var r=n[i];r.columns&&(t.push(r),this.getStackedColumns(r.columns,t))}return t},l.prototype.getColumnIndexByUid=function(i){var e=ap(this.getColumns(),function(e,t){if(e.uid===i)return t})[0];return H.isNullOrUndefined(e)?-1:e},l.prototype.getUidByColumnField=function(t){return ap(this.getColumns(),function(e){if(e.field===t)return e.uid})[0]},l.prototype.getNormalizedColumnIndex=function(e){return this.getColumnIndexByUid(e)+this.getIndentCount()},l.prototype.getIndentCount=function(){var e=0;return this.allowGrouping&&(e+=this.groupSettings.columns.length),this.isDetail()&&e++,this.isRowDragable()&&H.isNullOrUndefined(this.rowDropSettings.targetID)&&e++,e},l.prototype.getColumnFieldNames=function(){for(var e,t=[],i=0,n=this.getColumns().length;i<n;i++)(e=this.getColumns()[parseInt(i.toString(),10)]).visible&&t.push(e.field);return t},l.prototype.getRowTemplate=function(){return this.rowTemplateFn},l.prototype.getEmptyRecordTemplate=function(){return this.emptyRecordTemplateFn},l.prototype.getDetailTemplate=function(){return this.detailTemplateFn},l.prototype.getEditTemplate=function(){return this.editTemplateFn},l.prototype.getEditHeaderTemplate=function(){return this.editHeaderTemplateFn},l.prototype.getEditFooterTemplate=function(){return this.editFooterTemplateFn},l.prototype.getColumnChooserTemplate=function(){return this.columnChooserTemplateFn},l.prototype.getColumnChooserHeaderTemplate=function(){return this.columnChooserHeaderTemplateFn},l.prototype.getColumnChooserFooterTemplate=function(){return this.columnChooserFooterTemplateFn},l.prototype.getPrimaryKeyFieldNames=function(){for(var e=[],t=0;t<this.columnModel.length;t++)this.columnModel[parseInt(t.toString(),10)].isPrimaryKey&&e.push(this.columnModel[parseInt(t.toString(),10)].field);return e},l.prototype.refresh=function(){this.isDestroyed||(this.isManualRefresh=!0,this.allowGrouping&&this.groupModule&&this.groupSettings.showDropArea&&this.groupModule.refreshDropArea(),this.headerModule.refreshUI(),this.updateStackedFilter(),this.renderModule.refresh())},l.prototype.refreshHeader=function(){this.headerModule.refreshUI()},l.prototype.getSelectedRows=function(){return this.selectionModule?this.selectionModule.selectedRecords:[]},l.prototype.getSelectedRowIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowIndexes:[]},l.prototype.getSelectedRowCellIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowCellIndexes:[]},l.prototype.getSelectedRecords=function(){return this.selectionModule?this.selectionModule.getSelectedRecords():[]},l.prototype.getSelectedCellRecords=function(){return this.selectionModule?this.selectionModule.getSelectedCellRecords():[]},l.prototype.getSelectedColumnsUid=function(){var t=this,i=[];return this.selectionModule&&this.selectionModule.selectedColumnsIndexes.filter(function(e){return i.push(t.getColumns()[parseInt(e.toString(),10)].uid)}),i},l.prototype.getDataModule=function(){return this.renderModule&&this.renderModule.data?this.renderModule.data:null},l.prototype.setRequiresCount=function(e){return this.enableInfiniteScrolling&&this.infiniteScrollSettings&&this.infiniteScrollSettings.enableCountLessMode?e:e.requiresCount()},l.prototype.getCellFormula=function(e,t){return this.formulaModule?this.formulaModule.getCellFormula(e,t):null},l.prototype.getFormulaValue=function(e,t){return this.formulaModule?this.formulaModule.getFormulaValue(e,t):null},l.prototype.setCellFormula=function(e,t,i){this.formulaModule&&this.formulaModule.setCellFormula(e,t,i)},l.prototype.refreshFormulas=function(){var s=this,e=this.getColumns().filter(function(e){return e.allowFormula}),o=new vo(this,this.serviceLocator),t=e.map(function(e){return s.getColumnIndexByField(e.field)}),e=this.getRows(),a=this.getPrimaryKeyFieldNames()[0];e.forEach(function(n){var r=s.getRowObjectFromUID(n.getAttribute("data-uid"));r&&t.forEach(function(e){var t=s.getColumnByIndex(e),i=r.data[t.field],t=("string"==typeof i&&i.trim().startsWith("=")&&s.setCellFormula(r.data[""+a],t.field,i),n.cells[parseInt(e.toString(),10)]);o.refreshTD(t,r.cells[parseInt(e.toString(),10)],r.data,{index:e})})})},l.prototype.suspendFormulaRefresh=function(){this.isFormulaRefreshSuspended||(this.isFormulaRefreshSuspended=!0)},l.prototype.resumeFormulaRefresh=function(){this.isFormulaRefreshSuspended&&(this.isFormulaRefreshSuspended=!1,this.refreshFormulas())},l.prototype.refreshFormula=function(e){var r,s,o=this,t=this.getColumns().filter(function(e){return e.allowFormula}),a=new vo(this,this.serviceLocator),t=t.map(function(e){return o.getColumnIndexByField(e.field)}),i=this.getRows(),l=this.getPrimaryKeyFieldNames()[0];0<=e&&e<i.length&&(r=i[parseInt(e.toString(),10)],s=this.getRowObjectFromUID(r.getAttribute("data-uid")))&&t.forEach(function(e){var t=r.cells[parseInt(e.toString(),10)],i=o.getColumnByIndex(e),n=s.data[i.field];"string"==typeof n&&n.trim().startsWith("=")&&o.setCellFormula(s.data[""+l],i.field,n),a.refreshTD(t,s.cells[parseInt(e.toString(),10)],s.data,{index:e})})},l.prototype.getFormulas=function(){return this.formulaModule?this.formulaModule.getFormulas():[]},l.prototype.hasFormula=function(e,t){return!!this.formulaModule&&this.formulaModule.hasFormula(e,t)},l.prototype.addFormula=function(e,t){this.formulaModule&&this.formulaModule.addFormula(e,t)},l.prototype.removeFormula=function(e){this.formulaModule&&this.formulaModule.removeFormula(e)},l.prototype.showColumns=function(e,t){this.showHider.show(e,t=t||"headerText")},l.prototype.hideColumns=function(e,t){this.showHider.hide(e,t=t||"headerText")},l.prototype.getFrozenColumns=function(){return this.frozenColumns+this.getFrozenCount(this.columns,0,0)},l.prototype.getFrozenRightColumnsCount=function(){return this.frozenRightCount||this.rightcount},l.prototype.getFrozenLeftColumnsCount=function(){return this.frozenLeftCount||this.leftcount},l.prototype.getMovableColumnsCount=function(){return this.movableCount||this.movablecount},l.prototype.updateFrozenColumnsWidth=function(){if(this.isFrozenGrid()&&!this.enableColumnVirtualization)for(var n=this.getColumns(),r=!0,s=0,o=0,a=0,l=n.some(function(e){return("Left"===e.freeze||"Right"===e.freeze||"Fixed"===e.freeze||e.isFrozen)&&"auto"===e.width}),h=this,e=0;e<n.length;e++)!function(e){var t,i,e=n[parseInt(e.toString(),10)];H.isNullOrUndefined(e.width)&&("Left"===e.freeze||"Right"===e.freeze||"Fixed"===e.freeze||e.isFrozen)&&(e.width=Math.max(200,e.minWidth?parseFloat(e.minWidth.toString()):0),!H.isNullOrUndefined(e.maxWidth))&&parseFloat(e.maxWidth.toString())<e.width&&(e.width=e.maxWidth),"auto"===e.width&&l&&(t=0,r&&(n.filter(function(e){e.visible&&("auto"===e.width&&s++,"auto"!==e.width)&&(e=H.isNullOrUndefined(e.width)?Math.max(200,e.minWidth?parseFloat(e.minWidth.toString()):0):parseFloat(e.width.toString()),t+=e)}),i=h.isPercentageWidthGrid()||"auto"===h.width?h.element.getBoundingClientRect().width:parseFloat(h.width.toString()),(o="auto"===h.height?i-t:i-t-Op())<0&&(o=0),a=parseFloat((o/s).toString()),n.filter(function(e){e.visible&&e.minWidth&&parseFloat(e.minWidth.toString())>a&&(o-=parseFloat(e.minWidth.toString()),s--)}),r=!1),e.minWidth&&parseFloat(e.minWidth.toString())>a?e.width=parseFloat(e.minWidth.toString()):e.width=o/s)}(e)},l.prototype.refreshSplitFrozenColumn=function(){this.splitFrozenCount(this.columns),this.updateFrozenColumnsWidth(),this.isAutoGenerateColumns=!0},l.prototype.setFrozenCount=function(){this.frozenLeftCount=this.frozenRightCount=this.movableCount=0,this.visibleFrozenLeft=this.visibleFrozenRight=this.visibleMovable=0,this.frozenLeftColumns=[],this.frozenRightColumns=[],this.movableColumns=[],this.fixedColumns=[],this.splitFrozenCount(this.columns),this.leftcount=this.frozenLeftCount,this.rightcount=this.frozenRightCount,this.movablecount=this.movableCount,this.frozenLeftCount&&!this.frozenRightCount?this.frozenName="Left":this.frozenRightCount&&!this.frozenLeftCount?this.frozenName="Right":this.frozenLeftCount&&this.frozenRightCount?this.frozenName="Left-Right":this.frozenColumns||this.frozenRows?this.frozenName="Left":this.frozenName=void 0},l.prototype.getVisibleFrozenLeftCount=function(){return this.visibleFrozenLeft},l.prototype.getVisibleFrozenRightCount=function(){return this.visibleFrozenRight},l.prototype.getVisibleMovableCount=function(){return this.visibleMovable},l.prototype.getFrozenRightColumns=function(){return this.frozenRightColumns},l.prototype.getFrozenLeftColumns=function(){return this.frozenLeftColumns},l.prototype.getMovableColumns=function(){return this.movableColumns},l.prototype.splitStackedColumns=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].columns?this.splitStackedColumns(e[parseInt(t.toString(),10)].columns):"Left"===e[parseInt(t.toString(),10)].freeze||e[parseInt(t.toString(),10)].isFrozen?(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleFrozenLeft++,this.leftcount++):"Right"===e[parseInt(t.toString(),10)].freeze?(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleFrozenRight++,this.rightcount++):"Fixed"===e[parseInt(t.toString(),10)].freeze?(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleFrozenFixed++,this.fixedcount++):(!1!==e[parseInt(t.toString(),10)].visible&&this.visibleMovable++,this.movablecount++)},l.prototype.pushStackedColumns=function(e,t,i,n,r){i[parseInt(t.toString(),10)]={headerText:n.headerText},n.textAlign&&(i[parseInt(t.toString(),10)].textAlign=n.textAlign),n.customAttributes&&(i[parseInt(t.toString(),10)].customAttributes=n.customAttributes);for(var s,o=0;o<e.length;o++)e[parseInt(o.toString(),10)].columns?(t+=1,this.pushStackedColumns(e[parseInt(o.toString(),10)].columns,t,i,e[parseInt(o.toString(),10)],r),t-=1):(s=[],s=i.slice().slice(0,t+1),("Left"===e[parseInt(o.toString(),10)].freeze||e[parseInt(o.toString(),10)].isFrozen?(this.stackedLeft.push(s),this.stackedarrayLeft):"Right"===e[parseInt(o.toString(),10)].freeze?(this.stackedRight.push(s),this.stackedarrayRight):"Fixed"===e[parseInt(o.toString(),10)].freeze?(this.stackedFixed.push(s),this.stackedarrayFixed):(this.stackedMovable.push(s),this.stackedarrayMovable)).push(e[parseInt(o.toString(),10)]))},l.prototype.pushallcol=function(e,t,i,n,r){var s;if(i.headerText===t.headerText)r?i.columns.push(n):(s={headerText:e.headerText,columns:[]},e.textAlign&&(s.textAlign=e.textAlign),e.customAttributes&&(s.customAttributes=e.customAttributes),i.columns.push(s));else if(i.columns&&i.columns.length)for(var o=0;o<i.columns.length;o++)this.pushallcol(e,t,i.columns[parseInt(o.toString(),10)],n,r)},l.prototype.resetStackedColumns=function(e,t,i){for(var n={},r=[],s=1;s<=e.length;s++)for(var o=e[s-1],a=0;a<o.length;a++)if(n.columns||1!==s?-1===r.indexOf(o[parseInt(a.toString(),10)])&&(this.pushallcol(o[parseInt(a.toString(),10)],o[a-1],n),r.push(o[parseInt(a.toString(),10)])):(n={headerText:o[parseInt(a.toString(),10)].headerText,textAlign:o[parseInt(a.toString(),10)].textAlign,customAttributes:o[parseInt(a.toString(),10)].customAttributes,columns:[]},r.push(o[parseInt(a.toString(),10)])),a===o.length-1){this.pushallcol(null,o[parseInt(a.toString(),10)],n,t[s-1],!0);for(var l=0;l!==e.length-1&&s!==e.length;)o.map(function(e){return e.headerText}).join(", ")===e[parseInt(s.toString(),10)].map(function(e){return e.headerText}).join(", ")&&(s++,this.pushallcol(null,o[parseInt(a.toString(),10)],n,t[s-1],!0)),l++}("Left"===i?this.frozenLeftColumns:"Right"===i?this.frozenRightColumns:this.movableColumns).push(n)},l.prototype.resetFrozenColumns=function(){var e=this.columnModel;if(e&&e.length)for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)]&&"Left"===e[parseInt(t.toString(),10)].freeze&&(e[parseInt(t.toString(),10)].freeze=void 0)},l.prototype.splitFrozenCount=function(e){if(this.frozenColumns||this.changedProperties&&0===this.changedProperties.frozenColumns){var t=!this.enableColumnVirtualization||this.enableColumnVirtualization&&this.isPreparedFrozenColumns?this.enableColumnVirtualization&&this.columnModel&&this.columnModel.length?this.columnModel:this.getColumns():this.columns;if(!this.changedProperties||this.changedProperties&&!this.changedProperties.frozenColumns)for(var i=0;i<t.length;i++)this.frozenColumns>i?t[parseInt(i.toString(),10)].freeze="Left":"Right"===t[parseInt(i.toString(),10)].freeze||"Fixed"===t[parseInt(i.toString(),10)].freeze?t[parseInt(i.toString(),10)].freeze=t[parseInt(i.toString(),10)].freeze:t[parseInt(i.toString(),10)].freeze=void 0}for(i=0;i<(H.isNullOrUndefined(e)?0:e.length);i++)e[parseInt(i.toString(),10)].columns?(this.leftcount=0,this.rightcount=0,this.movablecount=0,this.fixedcount=0,this.splitStackedColumns(e[parseInt(i.toString(),10)].columns),!this.leftcount||this.rightcount||this.movablecount||this.fixedcount?!this.rightcount||this.leftcount||this.movablecount||this.fixedcount?!this.movablecount||this.leftcount||this.rightcount||this.fixedcount?!this.fixedcount||this.leftcount||this.rightcount||this.movablecount?(this.frozenLeftCount+=this.leftcount,this.frozenRightCount+=this.rightcount,this.movableCount+=this.movablecount,this.fixedCount+=this.fixedcount,this.leftcount=0,this.rightcount=0,this.movablecount=0,this.fixedcount=0,this.stackedLeft=[],this.stackedRight=[],this.stackedFixed=[],this.stackedMovable=[],this.stackedarrayLeft=[],this.stackedarrayRight=[],this.stackedarrayFixed=[],this.stackedarrayMovable=[],this.pushStackedColumns(e[parseInt(i.toString(),10)].columns,0,[],e[parseInt(i.toString(),10)],{headerText:e[parseInt(i.toString(),10)].headerText,textAlign:e[parseInt(i.toString(),10)].textAlign,customAttributes:e[parseInt(i.toString(),10)].customAttributes,columns:[]}),this.stackedarrayLeft.length&&this.resetStackedColumns(this.stackedLeft,this.stackedarrayLeft,"Left"),this.stackedarrayRight.length&&this.resetStackedColumns(this.stackedRight,this.stackedarrayRight,"Right"),this.stackedarrayFixed.length&&this.resetStackedColumns(this.stackedFixed,this.stackedarrayFixed,"Fixed"),this.stackedarrayMovable.length&&this.resetStackedColumns(this.stackedMovable,this.stackedarrayMovable,"Movable"),this.stackedLeft=[],this.stackedRight=[],this.stackedMovable=[],this.stackedFixed=[],this.stackedarrayLeft=[],this.stackedarrayRight=[],this.stackedarrayMovable=[],this.stackedarrayFixed=[]):(this.fixedCount+=this.fixedcount,this.fixedColumns.push(e[parseInt(i.toString(),10)]),this.movableCount+=this.movablecount,this.movableColumns.push(e[parseInt(i.toString(),10)])):(this.movableCount+=this.movablecount,this.movableColumns.push(e[parseInt(i.toString(),10)])):(this.frozenRightCount+=this.rightcount,this.frozenRightColumns.push(e[parseInt(i.toString(),10)])):(this.frozenLeftCount+=this.leftcount,this.frozenLeftColumns.push(e[parseInt(i.toString(),10)]))):"Right"===e[parseInt(i.toString(),10)].freeze?(!1!==e[parseInt(i.toString(),10)].visible&&this.visibleFrozenRight++,this.frozenRightColumns.push(e[parseInt(i.toString(),10)]),this.frozenRightCount++):"Left"===e[parseInt(i.toString(),10)].freeze||e[parseInt(i.toString(),10)].isFrozen?(!1!==e[parseInt(i.toString(),10)].visible&&this.visibleFrozenLeft++,this.frozenLeftColumns.push(e[parseInt(i.toString(),10)]),this.frozenLeftCount++):("Fixed"===e[parseInt(i.toString(),10)].freeze?(this.fixedColumns.push(e[parseInt(i.toString(),10)]),this.fixedCount++):!1!==e[parseInt(i.toString(),10)].visible&&this.visibleMovable++,this.movableColumns.push(e[parseInt(i.toString(),10)]),this.movableCount++);this.frozenLeftColumns.length&&(t=this.frozenLeftColumns[this.frozenLeftColumns.length-1],this.removeBorder(this.frozenLeftColumns),this.frozenLeftBorderColumns(t instanceof Q?this.lastVisibleLeftCol(this.frozenLeftColumns):t)),this.frozenRightColumns.length&&(t=this.frozenRightColumns[0],this.removeBorder(this.frozenRightColumns),this.frozenRightBorderColumns(t instanceof Q?this.firstVisibleRightCol(this.frozenRightColumns):t)),(this.frozenLeftColumns.length||this.frozenRightColumns.length)&&this.freezeColumnRefresh&&(t=this.frozenLeftColumns.concat(this.movableColumns).concat(this.frozenRightColumns),this.setProperties({columns:t},!0),this.freezeColumnRefresh=!1)},l.prototype.removeBorder=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].columns&&e[parseInt(t.toString(),10)].columns.length?("Right"!==e[parseInt(t.toString(),10)].border&&"Left"!==e[parseInt(t.toString(),10)].border||(e[parseInt(t.toString(),10)].border=void 0),this.removeBorder(e[parseInt(t.toString(),10)].columns)):"Right"!==e[parseInt(t.toString(),10)].border&&"Left"!==e[parseInt(t.toString(),10)].border||(e[parseInt(t.toString(),10)].border=void 0)},l.prototype.isVisibleColumns=function(e,t){if(e.columns&&e.columns.length)for(var i=0;i<e.columns.length;i++)this.isVisibleColumns(e.columns[parseInt(i.toString(),10)],t),e.columns[parseInt(i.toString(),10)].visible&&H.isNullOrUndefined(e.columns[parseInt(i.toString(),10)].columns)&&(!H.isNullOrUndefined(e.columns[parseInt(i.toString(),10)].freeze)||e.columns[parseInt(i.toString(),10)].isFrozen)&&t.push("true");else!e.visible||H.isNullOrUndefined(e.freeze)&&!e.isFrozen||t.push("true")},l.prototype.lastVisibleLeftCol=function(e){for(var t,i=e.length-1;0<=i;i--){var n=[];if(this.isVisibleColumns(e[parseInt(i.toString(),10)],n),e[parseInt(i.toString(),10)].visible&&-1!==n.indexOf("true")){t=e[parseInt(i.toString(),10)];break}}return t},l.prototype.firstVisibleRightCol=function(e){for(var t,i=0;i<e.length;i++){var n=[];if(this.isVisibleColumns(e[parseInt(i.toString(),10)],n),e[parseInt(i.toString(),10)].visible&&-1!==n.indexOf("true")){t=e[parseInt(i.toString(),10)];break}}return t},l.prototype.frozenLeftBorderColumns=function(e){var t;H.isNullOrUndefined(e)||(e.columns&&e.columns.length?(e.border="Left",t=e.columns[e.columns.length-1],this.frozenLeftBorderColumns(t instanceof Q&&t.columns?this.lastVisibleLeftCol(e.columns):t)):e.border="Left")},l.prototype.frozenRightBorderColumns=function(e){var t;H.isNullOrUndefined(e)||(e.columns&&e.columns.length?(e.border="Right",t=e.columns[0],this.frozenRightBorderColumns(t instanceof Q&&t.columns?this.firstVisibleRightCol(e.columns):t)):e.border="Right")},l.prototype.getVisibleFrozenColumns=function(){return this.getVisibleFrozenColumnsCount()+this.getVisibleFrozenCount(this.columns,0)},l.prototype.pinRows=function(e){for(var t=this.getPrimaryKeyFieldNames()[0],i=!1,n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)];this.pinnedTopRowKeys[r[""+t]]||(this.pinnedTopRecords.push(r),i=this.pinnedTopRowKeys[r[""+t]]=!0)}i&&this.notify(bt,{requestType:"pin-row"})},l.prototype.unpinRows=function(n){for(var r=this.getPrimaryKeyFieldNames()[0],s=!1,o=this,e=0;e<n.length;e++)!function(e){var e=n[parseInt(e.toString(),10)],t=e[""+r],i=o.pinnedTopRecords.findIndex(function(e){return e[""+r]===t});o.pinnedTopRowKeys[e[""+r]]&&(o.pinnedTopRecords.splice(i,1),o.pinnedTopRowKeys[e[""+r]]=!1,s=!0)}(e);s&&this.notify(bt,{requestType:"unpin-row"})},l.prototype.getFilterUIInfo=function(){return this.filterModule?this.filterModule.getFilterUIInfo():{}},l.prototype.getVisibleFrozenColumnsCount=function(){for(var e=0,t=this.columnModel,i=0;i<this.frozenColumns;i++)t[parseInt(i.toString(),10)].visible&&e++;if(this.frozenLeftCount||this.leftcount||this.frozenRightCount||this.rightcount)for(i=0;i<t.length;i++)!t[parseInt(i.toString(),10)].visible||"Left"!==t[parseInt(i.toString(),10)].freeze&&"Right"!==t[parseInt(i.toString(),10)].freeze||e++;return e},l.prototype.getVisibleFrozenCount=function(e,t){if(!(this.frozenLeftCount||this.leftcount||this.frozenRightCount&&this.rightcount))for(var i=0,n=e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?t=this.getVisibleFrozenCount(e[parseInt(i.toString(),10)].columns,t):e[parseInt(i.toString(),10)].isFrozen&&e[parseInt(i.toString(),10)].visible&&t++;return t},l.prototype.getFrozenCount=function(e,t,i){for(var n=0,r=H.isNullOrUndefined(e)?0:e.length;n<r;n++)e[parseInt(n.toString(),10)].columns?t=this.getFrozenCount(e[parseInt(n.toString(),10)].columns,t,i):(e[parseInt(n.toString(),10)].isFrozen&&i>this.frozenColumns-1&&t++,i++);return t},l.prototype.goToPage=function(e){this.pagerModule&&this.pagerModule.goToPage(e)},l.prototype.goToPageAsync=function(e){var t=this;return this.pagerModule?this.executeAsyncOperation("paging",function(){return t.pagerModule.goToPage(e)}):Promise.resolve()},l.prototype.updateExternalMessage=function(e){this.pagerModule&&!this.pagerTemplate&&this.pagerModule.updateExternalMessage(e)},l.prototype.sortColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},l.prototype.executeAsyncOperation=function(s,o){var a=this;return new Promise(function(t,e){var i=function(e){e.requestType===s&&(a.removeEventListener(c,i),a.off(ae,r),a.off(Yi,n),t())},n=function(e){e.requestType===s&&(a.removeEventListener(c,i),a.off(ae,r),a.off(Yi,n),t())},r=function(){a.removeEventListener(c,i),a.off(ae,r),a.off(Yi,n),e()};a.on(Yi,n),a.addEventListener(c,i),a.addEventListener(ae,r),o()})},l.prototype.sortColumnAsync=function(e,t,i){var n=this;return this.sortModule?this.executeAsyncOperation("sorting",function(){return n.sortModule.sortColumn(e,t,i)}):Promise.resolve()},l.prototype.changeDataSource=function(e,t,i){if(this.isChangeDataSourceCall=!0,this.setProperties({sortSettings:{columns:[]}},!0),this.setProperties({filterSettings:{columns:[]}},!0),this.setProperties({searchSettings:{key:""}},!0),(this.isRowPinned||this.pinnedTopRecords.length||Object.keys(this.pinnedTopRowKeys).length||this.pinnedDataCount||this.pinnedTopRowModels.length)&&(this.pinnedTopRecords=[],this.pinnedTopRowKeys={},this.pinnedDataCount=0,this.pinnedTopRowModels=[],this.pinnedRowIndexes={},this.contentRowIndexes={},this.getDataModule())&&this.getDataModule().pinnedData&&(this.getDataModule().pinnedData=new V.DataManager([])),this.allowGrouping&&this.setProperties({groupSettings:{columns:[]}},!0),t&&t.length&&this.setProperties({columns:t},!0),e&&(H.isNullOrUndefined(t)&&this.setProperties({columns:[]},!0),this.setProperties({dataSource:e},!0)),i){for(var n=0,r=["dataSource","columns"];n<r.length;n++)delete i[""+r[n]];this.setProperties(i,!0)}this.freezeRefresh(),this.isChangeDataSourceCall=!1},l.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},l.prototype.clearSortingAsync=function(){var e=this;return this.sortModule?this.executeAsyncOperation("sorting",function(){return e.sortModule.clearSorting()}):Promise.resolve()},l.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},l.prototype.clearGridActions=function(){this.setProperties({sortSettings:{columns:[]}},!0),this.setProperties({filterSettings:{columns:[]}},!0),this.setProperties({searchSettings:{key:""}},!0),this.allowGrouping?this.setProperties({groupSettings:{columns:[]}},!1):this.freezeRefresh()},l.prototype.filterByColumn=function(e,t,i,n,r,s,o,a){this.filterModule&&this.filterModule.filterByColumn(e,t,i,n,r,s,o,a)},l.prototype.filterByColumnAsync=function(e,t,i,n,r,s,o,a){var l=this;return this.filterModule?this.executeAsyncOperation("filtering",function(){return l.filterModule.filterByColumn(e,t,i,n,r,s,o,a)}):Promise.resolve()},l.prototype.clearFiltering=function(e){this.filterModule&&this.filterModule.clearFiltering(e)},l.prototype.clearFilteringAsync=function(e){var t=this;return this.filterModule?this.executeAsyncOperation("refresh",function(){return t.filterModule.clearFiltering(e)}):Promise.resolve()},l.prototype.removeFilteredColsByField=function(e,t){this.filterModule&&this.filterModule.removeFilteredColsByField(e,t)},l.prototype.openAdvancedFilterDialog=function(){this.advancedFilterModule&&this.advancedFilterModule.openDialog()},l.prototype.closeAdvancedFilterDialog=function(){this.advancedFilterModule&&this.advancedFilterModule.closeDialog()},l.prototype.applyAdvancedFilter=function(e){this.advancedFilterModule&&this.advancedFilterModule.applyFilter(e)},l.prototype.getPredicateFromRule=function(e){return this.advancedFilterModule&&"function"==typeof this.advancedFilterModule.getPredicateFromRule?this.advancedFilterModule.getPredicateFromRule(e):null},l.prototype.clearAdvancedFilter=function(){this.advancedFilterModule&&this.advancedFilterModule.clearFilter()},l.prototype.getAdvancedFilter=function(){return this.advancedFilterModule?this.advancedFilterModule.getRule():null},l.prototype.setAdvancedFilter=function(e){this.advancedFilterModule&&this.advancedFilterModule.setRule(e)},l.prototype.isAdvancedFilterApplied=function(){return!!this.advancedFilterModule&&!!this.advancedFilterModule.getRule()},l.prototype.refreshAdvancedFilter=function(){this.advancedFilterModule&&"function"==typeof this.advancedFilterModule.refresh&&this.advancedFilterModule.refresh()},l.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},l.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},l.prototype.deselectRow=function(e){this.selectionModule&&this.selectionModule.deselectRow(e)},l.prototype.deselectRows=function(e){this.selectionModule&&this.selectionModule.deselectRows(e)},l.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},l.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},l.prototype.selectCellsByRange=function(e,t){this.selectionModule.selectCellsByRange(e,t)},l.prototype.search=function(e){this.searchModule&&this.searchModule.search(e)},l.prototype.searchAsync=function(e){var t=this;return this.searchModule?this.executeAsyncOperation("searching",function(){return t.searchModule.search(e)}):Promise.resolve()},l.prototype.print=function(){this.printModule&&this.printModule.print()},l.prototype.deleteRecord=function(e,t){this.editModule&&this.editModule.deleteRecord(e,t)},l.prototype.deleteRecordAsync=function(o,a){var l=this;return new Promise(function(t,i){function n(e){"delete"===e.requestType&&(l.removeEventListener(c,r),l.off(ae,n),l.off(Yi,s)),i()}var e,r=function(e){"delete"===e.requestType&&(l.removeEventListener(c,r),l.off(Yi,s),t())},s=function(e){"delete"===e.requestType&&(l.removeEventListener(c,r),l.off(Yi,s),t())};l.editModule?(l.on(Yi,s),l.addEventListener(ae,n),l.addEventListener(c,r),e=l.getSelectedRecords(),l.editModule.deleteRecord(o,a),(H.isNullOrUndefined(o)||H.isNullOrUndefined(a))&&0===e.length&&(l.removeEventListener(c,r),l.off(ae,n),l.off(Yi,s),t())):t()})},l.prototype.startEdit=function(){this.editModule&&this.editModule.startEdit()},l.prototype.endEdit=function(){this.editModule&&this.editModule.endEdit()},l.prototype.endEditAsync=function(){var s=this;return new Promise(function(t,e){var i=function(e){"save"===e.requestType&&(s.removeEventListener(c,i),s.off(Yi,n),s.off(ae,r),t())},n=function(e){"edit"===e.action&&(s.removeEventListener(c,i),s.off(Yi,n),s.off(ae,r),t())},r=function(){s.removeEventListener(c,i),s.off(ae,r),s.off(Yi,n),e()};s.editModule?(s.on(Yi,n),s.addEventListener(ae,r),s.addEventListener(c,i),s.editModule.endEdit()):t()})},l.prototype.closeEdit=function(){this.editModule&&this.editModule.closeEdit()},l.prototype.addRecord=function(e,t){this.editModule&&this.editModule.addRecord(e,t)},l.prototype.addRecordAsync=function(s,o){var a=this;return new Promise(function(t,e){function i(){a.removeEventListener(c,n),a.off(ae,i),a.off(Yi,r),e()}var n=function(e){"add"===e.action&&"save"===e.requestType&&(a.removeEventListener(c,n),a.off(Yi,r),t())},r=function(e){"add"===e.action&&(a.removeEventListener(c,n),a.off(Yi,r),t())};a.editModule?(a.on(Yi,r),a.addEventListener(ae,i),a.addEventListener(c,n),a.editModule.addRecord(s,o),s||(a.removeEventListener(c,n),a.off(ae,i),a.off(Yi,r),t())):t()})},l.prototype.undoEdit=function(){this.editModule&&this.editModule.undoEdit&&this.editModule.undoEdit()},l.prototype.redoEdit=function(){this.editModule&&this.editModule.redoEdit&&this.editModule.redoEdit()},l.prototype.isUndoStackAvailable=function(){return!!(this.editModule&&this.editModule.isUndoStackAvailable&&this.editModule.isUndoStackAvailable())},l.prototype.isRedoStackAvailable=function(){return!!(this.editModule&&this.editModule.isRedoStackAvailable&&this.editModule.isRedoStackAvailable())},l.prototype.deleteRow=function(e){this.editModule&&this.editModule.deleteRow(e)},l.prototype.deleteRowAsync=function(e){var t=this;return this.editModule?this.executeAsyncOperation("delete",function(){return t.editModule.deleteRow(e)}):Promise.resolve()},l.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},l.prototype.saveCell=function(){this.editModule&&this.editModule.saveCell()},l.prototype.updateCell=function(e,t,i){this.editModule&&this.editModule.updateCell(e,t,i)},l.prototype.updateRow=function(e,t){this.editModule&&this.editModule.updateRow(e,t)},l.prototype.updateRowAsync=function(s,o){var a=this;return new Promise(function(t,e){var i=function(e){"save"===e.requestType&&(a.removeEventListener(c,i),a.off(Yi,n),a.off(ae,r),t())},n=function(e){"edit"===e.action&&(a.removeEventListener(c,i),a.off(Yi,n),a.off(ae,r),t())},r=function(){a.removeEventListener(c,i),a.off(ae,r),a.off(Yi,n),e()};a.editModule?(a.on(Yi,n),a.addEventListener(ae,r),a.addEventListener(c,i),a.editModule.updateRow(s,o)):t()})},l.prototype.getBatchChanges=function(){return this.editModule?this.editModule.getBatchChanges():{}},l.prototype.enableToolbarItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},l.prototype.copy=function(e){this.clipboardModule&&this.clipboardModule.copy(e)},l.prototype.recalcIndentWidth=function(){var n=this,e=this.getColumns().find(function(e){return"rownumber"===e.type}),t=this.getHeaderTable(),i=t.querySelector(".e-emptycell"),r=t.querySelector(".e-header-rownumber-cell");if((i||e)&&(this.groupSettings.columns.length||this.isDetail()||this.isRowDragable()||e)&&!t.querySelector(".e-emptycell.e-indentRefreshed")&&this.getContentTable()&&!t.querySelector(".e-header-rownumber-cell.e-indentRefreshed")){var s,o=0,a=(i&&(o=i.parentElement.offsetWidth),[].slice.call(t.querySelector(qs).childNodes)),l=[].slice.call(this.getContentTable().querySelector(qs).childNodes),t=o?o/30:0,h="Right"===this.getFrozenMode()?this.groupSettings.columns.length+this.getColumns().length:0,d=this.element.offsetWidth,p=function(e,t){var i;bc(n)?(i=(t/d*100).toFixed(1)+"%",a[parseInt(e.toString(),10)].style.width=i,l[parseInt(e.toString(),10)].style.width=i):(a[parseInt(e.toString(),10)].style.width=t+"px",l[parseInt(e.toString(),10)].style.width=t+"px"),n.notify(Qt,{index:e,width:t})};for((o=1<=t?30/t:o)<1&&(o=1),(this.enableColumnVirtualization||this.isAutoGen||this.columns.length===this.groupSettings.columns.length)&&(o=30);h<this.groupSettings.columns.length;)p(h,o),h++;this.isDetail()&&(p(h,o),h++),this.isRowDragable()&&p(h,o),e&&(t=r.offsetWidth/parseInt(e.width.toString(),10),s=this.getNormalizedColumnIndex(e.uid),1<=t)&&(p(s,parseInt(e.width.toString(),10)/t),r)&&r.classList.add("e-indentRefreshed"),this.isAutoGen=!1,i&&i.classList.add("e-indentRefreshed")}},l.prototype.resetIndentWidth=function(){var e;this.isDestroyed||(bc(this)&&(this.getHeaderTable().querySelector(".e-emptycell").classList.remove("e-indentRefreshed"),this.widthService.setWidthToColumns(),this.recalcIndentWidth(),this.autoFit)&&this.preventAdjustColumns(),("auto"===this.width||"string"==typeof this.width&&-1!==this.width.indexOf("%"))&&0<this.getColumns().filter(function(e){return(!e.width||"auto"===e.width)&&e.minWidth}).length&&(e=this.widthService.getTableWidth(this.getColumns(),!0),this.widthService.setMinwidthBycalculation(e)),this.isFrozenGrid()&&this.enableColumnVirtualization&&this.widthService&&this.widthService.refreshFrozenScrollbar(),this.allowTextWrap&&"Content"!==this.textWrapSettings.wrapMode&&this.notify(er,{}),(this.frozenRows||this.pinnedTopRowModels.length)&&this.scrollModule&&this.scrollModule.resizeFrozenRowBorder(),this.enableStickyHeader&&this.scrollModule.makeStickyHeader()(),this.enableAutoFill&&"Multiple"===this.selectionSettings.type&&"Cell"===this.selectionSettings.mode&&this.selectionModule.selectedRowCellIndexes.length&&(this.selectionModule.updateAutoFillPosition(),this.selectionModule.drawBorders()))},l.prototype.isRowDragable=function(){return this.allowRowDragAndDrop&&!this.rowDropSettings.targetID},l.prototype.reorderColumns=function(e,t){this.reorderModule&&this.reorderModule.reorderColumns(e,t)},l.prototype.reorderColumnByModel=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByModel(e,t)},l.prototype.reorderColumnByIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByIndex(e,t)},l.prototype.reorderColumnByTargetIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByTargetIndex(e,t)},l.prototype.reorderRows=function(e,t){this.rowDragAndDropModule&&this.rowDragAndDropModule.reorderRows(e,t)},l.prototype.refreshDataSource=function(e){this.notify("refreshdataSource",e)},l.prototype.disableRowDD=function(e){var t=this.getHeaderTable(),i=this.getContentTable(),n=t.querySelectorAll("th.e-rowdragheader, th.e-mastercell"),r=this.getRows(),s=e?"none":"";H.setStyleAttribute(t.querySelector(qs).childNodes[0],{display:s}),H.setStyleAttribute(i.querySelector(qs).childNodes[0],{display:s});for(var o=0;o<this.getRows().length;o++){var a=r[parseInt(o.toString(),10)].firstElementChild;e?H.addClass([a],"e-hide"):H.removeClass([a],["e-hide"])}for(var l=0;l<t.querySelectorAll("th.e-rowdragheader, th.e-mastercell").length;l++){a=n[parseInt(l.toString(),10)];e?H.addClass([a],"e-hide"):H.removeClass([a],["e-hide"])}},l.prototype.autoFitColumns=function(e,t,i){var n=this.getInjectedModules().find(function(e){return"function"!=typeof e||H.isNullOrUndefined(e.prototype)?"Resize"===e.name:"resize"===e.prototype.getModuleName()});!this.resizeModule&&n&&(this.autoFitColumnsResize=!0,this.injectModules()),this.resizeModule&&this.resizeModule.autoFitColumns(e,t,i)},l.prototype.preventAdjustColumns=function(){if(!(this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode||this.allowResizing&&"Auto"===this.resizeSettings.mode)){for(var e=this.getColumns(),t=this.getHeaderTable(),i=0,n=0;n<e.length;n++)if(e[parseInt(n.toString(),10)].visible){if(this.groupSettings.columns.length&&-1<this.groupSettings.columns.indexOf(e[parseInt(n.toString(),10)].field))if("none"===[].slice.call(t.querySelector("colgroup").querySelectorAll(":not(.e-group-intent):not(.e-detail-intent):not(.e-drag-intent)"))[parseInt(n.toString(),10)].style.display)continue;if(!e[parseInt(n.toString(),10)].width){i=0;break}i+=parseFloat(e[parseInt(n.toString(),10)].width.toString())}if(i){var r=this.isPercentageWidthGrid(),s=this.widthUnit(r),o=this.getContentTable();if(this.groupSettings.columns.length||this.isDetail()||this.isRowDragable())for(var a=this.defaultIndentWidth(r),l=a.toString()+s,h=[].slice.call(t.querySelector("colgroup").querySelectorAll(".e-group-intent, .e-detail-intent, .e-drag-intent")),d=[].slice.call(o.querySelector("colgroup").querySelectorAll(".e-group-intent, .e-detail-intent, .e-drag-intent")),n=0;n<h.length;n++)h[parseInt(n.toString(),10)].style.setProperty("width",l),d[parseInt(n.toString(),10)].style.setProperty("width",l),i+=a;(r&&i<100||!r&&i<o.parentElement.clientWidth)&&(H.isNullOrUndefined(o.querySelector(".e-emptyrow"))?H.addClass([t,o],["e-tableborder"]):(H.addClass([t],["e-tableborder"]),H.removeClass([o],["e-tableborder"])));r=i.toString()+s;t.style.setProperty("width",r),o.style.setProperty("width",r)}else this.restoreAdjustColumns()}},l.prototype.restoreAdjustColumns=function(){var e,t,i;this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode||this.allowResizing&&"Auto"===this.resizeSettings.mode||(e=this.getHeaderTable(),t=this.getContentTable(),H.removeClass([e,t],["e-tableborder"]),e.style.removeProperty("width"),t.style.removeProperty("width"),(this.groupSettings.columns.length||this.isDetail()||this.isRowDragable())&&(t=this.isPercentageWidthGrid(),i=this.defaultIndentWidth(t).toString()+this.widthUnit(t),[].slice.call(e.querySelector("colgroup").querySelectorAll(".e-group-intent, .e-detail-intent, .e-drag-intent")).forEach(function(e){e.style.setProperty("width",i)}),e.querySelector(".e-emptycell").classList.remove("e-indentRefreshed"),this.recalcIndentWidth()))},l.prototype.widthUnit=function(e){return e?"%":"px"},l.prototype.defaultIndentWidth=function(e){return e?parseFloat((30/this.element.offsetWidth*100).toFixed(1)):30},l.prototype.isPercentageWidthGrid=function(){var e=this.getColumns().find(function(e){return!H.isNullOrUndefined(e.width)});return!!e&&-1<e.width.toString().indexOf("%")},l.prototype.createColumnchooser=function(e,t,i){this.columnChooserModule&&this.columnChooserModule.renderColumnChooser(e,t,i)},l.prototype.initializeServices=function(){this.serviceLocator.register("widthService",this.widthService=new Ta(this)),this.serviceLocator.register("cellRendererFactory",new Sa),this.serviceLocator.register("rendererFactory",new xa),this.serviceLocator.register("localization",this.localeObj=new H.L10n(this.getModuleName(),this.defaultLocale,this.locale)),this.serviceLocator.register("valueFormatter",this.valueFormatterService=new U(this.locale)),this.serviceLocator.register("showHideService",this.showHider=new ah(this)),this.serviceLocator.register("ariaService",this.ariaService=new Co),this.serviceLocator.register("focus",this.focusModule=new Aa(this))},l.prototype.processModel=function(){var n,r,t=this,e=this.groupSettings.columns.filter(function(e){e=t.getColumnByField(e);return!e||!1!==e.allowGrouping||(t.log("action_disabled_column",{moduleName:"group",columnName:e.headerText}),!1)}),s=(e.length!==this.groupSettings.columns.length&&this.setProperties({groupSettings:{columns:e}},!0),this.groupSettings.columns),o=this.sortSettings.columns;if(this.allowGrouping)for(var a=this,i=0,l=s.length;i<l;i++)!function(t){n=!1,r=0;for(var e,i=o.length;r<i;r++)if(o[parseInt(r.toString(),10)].field===s[parseInt(t.toString(),10)]){n=!0;break}n?a.allowSorting?a.sortedColumns.push(o[parseInt(r.toString(),10)].field):o[parseInt(r.toString(),10)].direction="Ascending":o.push({field:s[parseInt(t.toString(),10)],direction:"Ascending",isFromGroup:!0}),a.groupSettings.showGroupedColumn||((e=a.enableColumnVirtualization?a.columns.filter(function(e){return e.field===s[parseInt(t.toString(),10)]})[0]:a.getColumnByField(s[parseInt(t.toString(),10)]))?e.visible=!1:a.log("initial_action",{moduleName:"group",columnName:s[parseInt(t.toString(),10)]}))}(i);if(!s.length)for(i=0;i<o.length;i++)this.sortedColumns.push(o[parseInt(i.toString(),10)].field);this.rowTemplateFn=hp(this.rowTemplate),this.emptyRecordTemplateFn=hp(this.emptyRecordTemplate),this.detailTemplateFn=hp(this.detailTemplate),this.editTemplateFn=hp(this.editSettings.template),this.editHeaderTemplateFn=hp(this.editSettings.headerTemplate),this.editFooterTemplateFn=hp(this.editSettings.footerTemplate),this.columnChooserTemplateFn=hp(this.columnChooserSettings.template),this.columnChooserHeaderTemplateFn=hp(this.columnChooserSettings.headerTemplate),this.columnChooserFooterTemplateFn=hp(this.columnChooserSettings.footerTemplate),H.isNullOrUndefined(this.parentDetails)||(e=H.isNullOrUndefined(this.parentDetails.parentKeyFieldValue)?"undefined":this.parentDetails.parentKeyFieldValue,this.query.where(this.queryString,"equal",e,!0)),this.initForeignColumn()},l.prototype.initForeignColumn=function(){this.isForeignKeyEnabled(this.getColumns())&&this.notify(zi,this.getForeignKeyColumns())},l.prototype.enableVerticalRendering=function(){"Vertical"===this.rowRenderingMode?this.element.classList.add("e-row-responsive"):this.element.classList.remove("e-row-responsive")},l.prototype.gridRender=function(){this.updateRTL(),"Vertical"===this.rowRenderingMode&&this.element.classList.add("e-row-responsive"),this.enableHover&&this.element.classList.add("e-gridhover"),(/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||H.Browser.isSafari())&&this.element.classList.add("e-mac-safari"),H.Browser.isDevice&&(this.element.classList.add("e-device"),"Desktop"===this.adaptiveUIMode)&&"Vertical"!==this.rowRenderingMode&&(this.enableAdaptiveUI=!1),"Mobile"!==this.adaptiveUIMode||H.Browser.isDevice||"Vertical"===this.rowRenderingMode||(this.enableAdaptiveUI=!1),this.rowHeight&&this.element.classList.add("e-grid-min-height"),this.cssClass&&(-1!==this.cssClass.indexOf(" ")?(e=this.element.classList).add.apply(e,this.cssClass.split(" ")):this.element.classList.add(this.cssClass)),this.allowRowDragAndDrop&&this.rowDropSettings.targetID&&"mozilla"===H.Browser.info.name&&this.element.classList.add("e-disableuserselect"),this.allowTextSelection||this.element.classList.add("e-disableuserselect"),this.editSettings.showAddNewRow&&(this.enableVirtualization||this.enableInfiniteScrolling)&&(this.editSettings.newRowPosition="Top"),H.classList(this.element,["e-responsive","e-default"],[]);var e=this.serviceLocator.getService("rendererFactory");this.headerModule=e.getRenderer(oe.RenderType.Header),this.contentModule=e.getRenderer(oe.RenderType.Content),this.printModule=new Yd(this,this.scrollModule),this.clipboardModule=new xh(this,this.serviceLocator),this.renderModule.render(),this.eventInitializer(),this.createGridPopUpElement(),this.widthService.setWidthToColumns(),this.updateGridLines(),this.applyTextWrap(),this.createTooltip(),this.enableBoxSelection(),this.enableWebMcp&&(e=this.webMcpSettings||{},this.notify(ss,{prefix:e.name,tools:e.tools,exposedTo:e.exposedTo}))},l.prototype.dataReady=function(){this.scrollModule.setWidth(),this.scrollModule.setHeight(),"auto"!==this.height&&this.scrollModule.setPadding()},l.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},l.prototype.createGridPopUpElement=function(){var e=this.createElement("div",{className:"e-gridpopup"}),t=(e.style.display="none",this.createElement("div",{className:xs,attrs:{tabIndex:"-1"}}));H.append([t,this.createElement("div",{className:"e-uptail e-tail"})],e),t.appendChild(this.createElement("span")),H.append([t,this.createElement("div",{className:"e-downtail e-tail"})],e),this.element.appendChild(e)},l.prototype.updateGridLines=function(){switch(H.classList(this.element,[],["e-verticallines","e-horizontallines","e-hidelines","e-bothlines"]),this.gridLines){case"Horizontal":this.element.classList.add("e-horizontallines");break;case"Vertical":this.element.classList.add("e-verticallines");break;case"None":this.element.classList.add("e-hidelines");break;case"Both":this.element.classList.add("e-bothlines")}this.updateResizeLines()},l.prototype.updateResizeLines=function(){this.allowResizing&&"Vertical"!==this.gridLines&&"Both"!==this.gridLines?this.element.classList.add("e-resize-lines"):this.element.classList.remove("e-resize-lines")},l.prototype.applyTextWrap=function(){if(this.allowTextWrap){var e=[].slice.call(this.element.getElementsByClassName("e-columnheader"));switch(this.textWrapSettings.wrapMode){case"Header":zp(this.element,!1),zp(this.getContent(),!1),zp(e,!0);break;case"Content":zp(this.getContent(),!0),zp(this.element,!1),zp(e,!1);break;default:zp(this.element,!0),zp(this.getContent(),!1),zp(e,!1)}"Content"!==this.textWrapSettings.wrapMode&&this.notify(er,{})}},l.prototype.removeTextWrap=function(){zp(this.element,!1),zp([].slice.call(this.element.getElementsByClassName("e-columnheader")),!1),zp(this.getContent(),!1),"Content"!==this.textWrapSettings.wrapMode&&this.notify(er,{})},l.prototype.createTooltip=function(){this.toolTipObj=new F.Tooltip({opensOn:"custom",content:"",cssClass:this.cssClass||null},this.element)},l.prototype.freezeRefresh=function(){(this.enableVirtualization||this.enableInfiniteScrolling)&&(this.pageSettings.currentPage=1),this.componentRefresh()},l.prototype.getTooltipStatus=function(e){var t=this.getHeaderTable(),i=this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode?"e-gridcontent":"e-gridheader",n=this.createTable(t,i,"header"),t=this.createTable(t,i,"content"),i=e.classList.contains("e-headercell")?n:t,r=e.classList.contains("e-headercell")?"th":"tr",s=(i.querySelector(r).className=e.className,i.querySelector(r)),i=(s.innerHTML="",Array.from(e.childNodes).forEach(function(e){s.appendChild(e.cloneNode(!0))}),i.querySelector(r).getBoundingClientRect().width);return document.body.removeChild(n),document.body.removeChild(t),!!(i>e.getBoundingClientRect().width&&!e.classList.contains("e-editedbatchcell")||this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode&&i>.55*e.getBoundingClientRect().width-("auto"!==this.height?16:0))},l.prototype.mouseMoveHandler=function(e){var t,i,n,r;this.isEllipsisTooltip()&&(t=I(e.target,"e-ellipsistooltip"),"mouseout"!==e.type||this.prevElement===t&&t===I(e.relatedTarget,"e-ellipsistooltip")||(this.toolTipObj.close(),this.toolTipObj.clear(),this.prevElement=null),i=e.target.tagName,!t||"mouseout"===e.type||H.Browser.isDevice&&-1!==["A","BUTTON","INPUT"].indexOf(i)||this.getTooltipStatus(t)&&(i=(e=this.getColumns()[parseInt(t.getAttribute(zs),10)-1])&&e.disableHtmlEncode?"innerText":"innerHTML",n=this.createElement("div"),t.getElementsByClassName("e-headertext").length?(r=t.getElementsByClassName("e-headertext")[0],n[i]=this.sanitize(r.innerText)):n[i]=this.sanitize(t.innerText),this.toolTipObj.content=n,this.enableHtmlSanitizer&&(this.toolTipObj.enableHtmlSanitizer=!0),e&&e.disableHtmlEncode&&(this.toolTipObj.enableHtmlParse=!1),t!==this.prevElement&&this.toolTipObj.open(t),this.prevElement=t))},l.prototype.isEllipsisTooltip=function(){var e=this.getColumns();if("EllipsisWithTooltip"===this.clipMode)return!0;for(var t=0;t<e.length;t++)if("EllipsisWithTooltip"===e[parseInt(t.toString(),10)].clipMode)return!0;return!1},l.prototype.scrollHandler=function(){this.isEllipsisTooltip()&&this.toolTipObj.close()},l.prototype.createTable=function(e,t,i){var n=this.createElement("div"),r=(n.className=this.element.className,n.style.cssText="display: inline-block;visibility:hidden;position:absolute",this.createElement("div")),t=(r.className=t,this.createElement("table")),e=(t.className=e.className,t.style.cssText="table-layout: auto;width: auto","header"===i?"th":"td"),i=this.createElement("tr",{attrs:{role:"row"}}),e=this.createElement(e);return i.appendChild(e),t.appendChild(i),r.appendChild(t),n.appendChild(r),document.body.appendChild(n),n},l.prototype.onKeyPressed=function(e){"tab"!==e.action&&"shiftTab"!==e.action||this.toolTipObj.close()},l.prototype.wireEvents=function(){H.EventHandler.add(this.element,"click",this.mouseClickHandler,this),H.EventHandler.add(this.element,"touchend",this.mouseClickHandler,this),H.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),H.EventHandler.add(this.element,"dblclick",this.dblClickHandler,this),H.EventHandler.add(this.element,"keydown",this.keyPressHandler,this),H.EventHandler.add(window,"resize",this.resetIndentWidth,this),this.allowKeyboard&&(this.element.tabIndex=-1===this.element.tabIndex?0:this.element.tabIndex),this.keyboardModule=new H.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),H.EventHandler.add(this.getContent().firstElementChild,"scroll",this.scrollHandler,this),H.EventHandler.add(this.element,"mouseover",this.mouseMoveHandler,this),H.EventHandler.add(this.element,"mouseout",this.mouseMoveHandler,this),H.EventHandler.add(this.getContent(),"touchstart",this.tapEvent,this),H.EventHandler.add(document.body,"keydown",this.keyDownHandler,this)},l.prototype.unwireEvents=function(){H.EventHandler.remove(this.element,"click",this.mouseClickHandler),H.EventHandler.remove(this.element,"touchend",this.mouseClickHandler),H.EventHandler.remove(this.element,"focusout",this.focusOutHandler),H.EventHandler.remove(this.element,"dblclick",this.dblClickHandler),H.EventHandler.remove(this.getContent().firstElementChild,"scroll",this.scrollHandler),H.EventHandler.remove(this.element,"mouseover",this.mouseMoveHandler),H.EventHandler.remove(this.element,"mouseout",this.mouseMoveHandler),H.EventHandler.remove(this.element,"keydown",this.keyPressHandler),H.EventHandler.remove(this.getContent(),"touchstart",this.tapEvent),H.EventHandler.remove(document.body,"keydown",this.keyDownHandler),H.EventHandler.remove(window,"resize",this.resetIndentWidth)},l.prototype.addListener=function(){this.isDestroyed||(this.on(yt,this.dataReady,this),this.on(vt,this.recalcIndentWidth,this),this.on(Rt,this.recalcIndentWidth,this),this.on(_r,this.refreshFrozenPosition,this),this.on(Wr,this.refreshSplitFrozenColumn,this),this.dataBoundFunction=this.refreshMediaCol.bind(this),this.addEventListener(de,this.dataBoundFunction),this.on(Gt,this.onKeyPressed,this))},l.prototype.removeListener=function(){this.isDestroyed||(this.off(yt,this.dataReady),this.off(vt,this.recalcIndentWidth),this.off(Rt,this.recalcIndentWidth),this.on(_r,this.refreshFrozenPosition,this),this.on(Wr,this.refreshSplitFrozenColumn,this),this.removeEventListener(de,this.dataBoundFunction),this.off(Gt,this.onKeyPressed))},l.prototype.getCurrentViewRecords=function(){return tc(this)?H.isNullOrUndefined(this.currentViewData.records)?this.currentViewData:this.currentViewData.records:!this.groupSettings.enableLazyLoading&&this.allowGrouping&&this.groupSettings.columns.length&&this.currentViewData.length&&this.currentViewData.records?this.currentViewData.records:this.currentViewData},l.prototype.getWebMcpTools=function(e){e={toolNames:e};return this.notify(os,e),e.tools||[]},l.prototype.mouseClickHandler=function(e){var t,i,n;this.isChildGrid(e)||I(e.target,"e-gridpopup")&&e.touches||this.element.getElementsByClassName("e-cloneproperties").length||this.checkEdit(e)||(!this.allowRowDragAndDrop&&(I(e.target,vs)||"TD"===e.target.tagName)||I(e.target,"e-headercell")&&I(e.target,"e-headercell").querySelector(".e-checkselectall")||!this.allowGrouping&&!this.allowReordering&&I(e.target,"e-gridheader"))&&e.touches||(I(e.target,"e-gridheader")&&this.allowRowDragAndDrop&&!I(e.target,"e-filterbarcell")&&e.target&&-1===["A","BUTTON","INPUT"].indexOf(e.target.tagName)&&e.preventDefault(),this.allowRowDragAndDrop&&I(e.target,"e-rowcell")&&!I(e.target,"e-rowdragdrop")&&e.touches)||((t=this.getRowInfo(e.target)).event=e,n=t.cancel=!1,(n=(i=H.closest(e.target,"tr"))&&i.getAttribute("data-uid")?!!(i=this.getRowObjectFromUID(i.getAttribute("data-uid")))&&i.isDataRow:n)&&this.trigger(Xe,t),this.notify(_t,e))},l.prototype.checkEdit=function(e){var t=I(e.target,Ts),t=!("Batch"===this.editSettings.mode||"Cell"===this.editSettings.mode&&!H.isNullOrUndefined(I(e.target,Os)))&&this.isEdit&&t&&(t.classList.contains(Os)||t.classList.contains(As)&&!this.editSettings.showAddNewRow);return!I(e.target,"e-unboundcelldiv")&&(t||I(e.target,b)&&(I(e.target,b).classList.contains("e-editedbatchcell")||I(e.target,b).classList.contains("e-editedcell")))},l.prototype.dblClickHandler=function(e){var t,i=I(e.target,"e-grid");H.isNullOrUndefined(i)||i.id!==this.element.id||H.closest(e.target,".e-unboundcelldiv")||H.closest(e.target,".e-toolpanel")||(i=!1,(t=H.closest(e.target,"tr"))&&t.getAttribute("data-uid")&&(i=!!(t=this.getRowObjectFromUID(t.getAttribute("data-uid")))&&t.isDataRow),(t=this.getRowInfo(e.target)).target=e.target,t.event=e,i&&this.trigger(Qe,t),this.notify(ni,e))},l.prototype.focusOutHandler=function(e){var t,i;this.isChildGrid(e)||(I(e.target,"e-grid")||(this.element.querySelector(".e-gridpopup").style.display="None"),(t=this.element.querySelector(".e-cancel:not(.e-hide)"))&&!t.parentElement.classList.contains("e-tbar-btn")&&t.classList.add("e-hide"),i=(t=e.relatedTarget)?t.getAttribute("aria-owns"):null,t&&(I(t,"e-grid")||(!H.isNullOrUndefined(i)&&i)===e.target.getAttribute("aria-owns"))||this.keyPress||!this.isEdit||H.Browser.isDevice||("Batch"!==this.editSettings.mode&&("Cell"!==this.editSettings.mode||H.isNullOrUndefined(I(e.target,Os)))||(I(t,"e-ddl")||I(t,"e-ddt"))&&(I(t,"e-multi-select-list-wrapper")||I(t,"e-input-filter"))&&I(t,"e-input-group")||!I(t,"e-uploader")&&(t&&H.isNullOrUndefined(I(t,"e-input-group"))||I(e.target,"edit-custom-template"))||(this.editModule.saveCell(),this.notify($i,{})),"Normal"!==this.editSettings.mode)||this.isWidgetsDestroyed||this.editModule.editFormValidate(),this.editSettings.showAddNewRow&&(this.editModule.isShowAddedRowValidate=!1),this.keyPress=!1)},l.prototype.isChildGrid=function(e){var t=I(e.target,"e-grid");return!!(t&&t.id!==this.element.id||I(e.target,"e-unboundcelldiv")&&H.isNullOrUndefined(t))},l.prototype.mergePersistGridData=function(e){var t=this.getLocalData();if(!H.isNullOrUndefined(t)&&""!==t||!H.isNullOrUndefined(e)){var i=H.isNullOrUndefined(e)?JSON.parse(t):e,t=Object.keys(i);this.isProtectedOnChange=!0;for(var n=0,r=t;n<r.length;n++){var s=r[n];"object"!=typeof this[""+s]||H.isNullOrUndefined(this[""+s])?this[""+s]=i[""+s]:Array.isArray(this[""+s])&&"columns"===s?(this.setFrozenCount(),cp(this[""+s]),this.mergeColumns(i[""+s],this[""+s]),this.mergedColumns=!0,this[""+s]=i[""+s]):H.extend(this[""+s],i[""+s])}this.isProtectedOnChange=!1}},l.prototype.mergeColumns=function(e,i){for(var n=e,r=this.isFrozenGrid(),s=this,t=0;t<n.length;t++)!function(t){var e=i.filter(function(e){return r?e.index===n[parseInt(t.toString(),10)][Ys]:e.index===n[parseInt(t.toString(),10)].index})[0];H.isNullOrUndefined(e)||(r&&((e=H.extend({},e,{},!0)).freeze=n[parseInt(t.toString(),10)].freeze),e.columns&&e.columns.length&&s.mergeColumns(n[parseInt(t.toString(),10)].columns,e.columns),n[parseInt(t.toString(),10)]=H.extend(e,n[parseInt(t.toString(),10)],{},!0))}(t)},l.prototype.isDetail=function(){return!H.isNullOrUndefined(this.detailTemplate)||!H.isNullOrUndefined(this.childGrid)},l.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},l.prototype.isForeignKeyEnabled=function(e){var t=this;return e.some(function(e){return e.columns?t.isForeignKeyEnabled(e.columns):!(!e.dataSource||!e.foreignKeyValue)})},l.prototype.isFormulaColumnEnabled=function(e){var t=this;return e.some(function(e){return e.columns?t.isFormulaColumnEnabled(e.columns):!!e.allowFormula})},l.prototype.keyPressHandler=function(e){var t=H.extend(e,{cancel:!1});this.trigger("keyPressed",t),(!0===t.cancel||this.isEdit&&e&&I(e.target,"e-gridform")&&I(e.target,"e-ddl")&&"open"===e.action&&!0===e.altKey&&"ArrowDown"===e.code)&&e.stopImmediatePropagation()},l.prototype.keyDownHandler=function(e){if(e.altKey){if(74===e.keyCode&&(this.keyA?(this.notify(Zn,{target:e.target,collapse:!1}),this.keyA=!1):(this.focusModule&&this.focusModule.currentInfo&&this.focusModule.currentInfo.element&&(H.removeClass([this.focusModule.currentInfo.element,this.focusModule.currentInfo.elementToFocus],["e-focused","e-focus"]),this.focusModule.currentInfo.element.tabIndex=-1),this.element.classList.contains("e-childgrid")||this.element.focus())),87===e.keyCode){var t=this.focusModule;if(t){if(!this.currentViewData.length||this.enableVirtualization||this.isRowDomVirtualization())return;0!==this.element.getBoundingClientRect().width&&t.focusContent(),t.addOutline()}}65===e.keyCode&&(this.keyA=!0),72===e.keyCode&&this.keyA&&(this.notify(Zn,{target:e.target,collapse:!0}),this.keyA=!1)}13===e.keyCode&&this.notify(br,e)},l.prototype.keyActionHandler=function(e){if(this.allowTextSelection&&"ctrlPlusC"===e.action&&""!==window.getSelection().toString())return;this.isChildGrid(e)||this.editModule&&(this.editModule.alertDObj&&this.editModule.alertDObj.visible||this.editModule.dialogObj&&this.editModule.dialogObj.visible)||this.isEdit&&(!this.editSettings.showAddNewRow||this.editSettings.showAddNewRow&&this.element.querySelector(Os))&&"escape"!==e.action&&"enter"!==e.action&&"shiftEnter"!==e.action&&"tab"!==e.action&&"shiftTab"!==e.action||(this.keyPress=!0,this.allowKeyboard?("ctrlPlusP"===e.action&&(e.preventDefault(),this.print()),this.notify(Gt,e)):"enter"===e.action&&this.editModule&&"Batch"===this.editSettings.mode&&this.isEdit&&I(e.target,"e-editedbatchcell")&&e.preventDefault())},l.prototype.setInjectedModules=function(e){this.injectedModules=e},l.prototype.updateColumnObject=function(){up(this.columns,this.enableColumnVirtualization,this),cp(this.columns),this.initForeignColumn(),this.notify(oi,{})},l.prototype.refreshFrozenPosition=function(e){e&&e.isModeChg?(this.refreshColumns(),this.notify(Kr,{})):this.refreshColumns()},l.prototype.getForeignKeyColumns=function(){return(this.enableColumnVirtualization?this.columns:this.getColumns()).filter(function(e){return e instanceof Q&&e.isForeignColumn()})},l.prototype.getRowHeight=function(e,t){return this.rowHeight||Ap(this.element,e,t?this:null)},l.prototype.refreshColumns=function(){var e;this.freezeColumnRefresh=!0,this.setFrozenCount(),this.updateFrozenColumnsWidth(),this.isFrozenGrid()&&(this.isPreventScrollEvent=!0),this.updateColumnObject(),this.checkLockColumns(this.getColumns()),this.refresh(),this.isFrozenGrid()&&this.enableColumnVirtualization&&(e=this.getContent().querySelector(".e-movablescrollbar").scrollLeft,this.getHeaderContent().querySelector("."+Cs).scrollLeft=e,this.getContent().querySelector("."+xs).scrollLeft=e)},l.prototype.excelExport=function(e,t,i,n){var r;return this.exportGrids&&this.exportGrids.length?(r=this.exportGrids.slice(),this.exportMultipleExcelGrids(r,e,t,i,n)):this.excelExportModule?this.excelExportModule.Map(this,e,t,i,!1,n):null},l.prototype.csvExport=function(e,t,i,n){return this.excelExportModule?this.excelExportModule.Map(this,e,t,i,!0,n):null},l.prototype.pdfExport=function(e,t,i,n){var r;return this.exportGrids&&this.exportGrids.length?(r=this.exportGrids.slice(),this.exportMultiplePdfGrids(r,e,t,i,n)):this.pdfExportModule?this.pdfExportModule.Map(this,e,t,i,n):null},l.prototype.exportMultiplePdfGrids=function(t,i,n,e,r){var s,o=this;return 0!==t.length?(s=t.shift(),((s=document.getElementById(s).ej2_instances[0]).pdfExportModule?s.pdfExportModule.Map(s,i,n,e,r):Promise.resolve()).then(function(e){return n=1!==t.length,o.exportMultiplePdfGrids(t,i,n,e,r)})):null},l.prototype.exportMultipleExcelGrids=function(t,i,n,e,r){var s,o=this;return 0!==t.length?(s=t.shift(),((s=document.getElementById(s).ej2_instances[0]).excelExportModule?s.excelExportModule.Map(s,i,n,e,!1,r):null).then(function(e){return n=1!==t.length,o.exportMultipleExcelGrids(t,i,n,e,r)})):null},l.prototype.groupColumn=function(e){this.groupModule&&this.groupModule.groupColumn(e)},l.prototype.groupColumnAsync=function(e){var t=this;return this.groupModule?this.executeAsyncOperation("grouping",function(){return t.groupModule.groupColumn(e)}):Promise.resolve()},l.prototype.groupExpandAll=function(){this.groupModule&&this.groupModule.expandAll()},l.prototype.groupCollapseAll=function(){this.groupModule&&this.groupModule.collapseAll()},l.prototype.clearGrouping=function(){this.groupModule&&this.groupModule.clearGrouping()},l.prototype.clearGroupingAsync=function(){var e=this;return this.groupModule?this.executeAsyncOperation("ungrouping",function(){return e.groupModule.clearGrouping()}):Promise.resolve()},l.prototype.ungroupColumn=function(e){this.groupModule&&this.groupModule.ungroupColumn(e)},l.prototype.ungroupColumnAsync=function(e){var t=this;return this.groupModule?this.executeAsyncOperation("ungrouping",function(){return t.groupModule.ungroupColumn(e)}):Promise.resolve()},l.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},l.prototype.openToolPanel=function(e){this.sideBarModule&&this.sideBarModule.openToolPanel(e)},l.prototype.closeToolPanel=function(){this.sideBarModule&&this.sideBarModule.closeToolPanel()},l.prototype.toggleSideBar=function(e){this.sideBarModule&&this.sideBarModule.toggleSideBar(e)},l.prototype.getOpenedToolPanel=function(){return this.sideBarModule?this.sideBarModule.getOpenedToolPanel():null},l.prototype.isToolPanelShowing=function(){return!!this.sideBarModule&&this.sideBarModule.isToolPanelShowing()},l.prototype.refreshToolPanel=function(e){this.sideBarModule&&this.sideBarModule.refreshToolPanel(e)},l.prototype.setSideBarPosition=function(e){this.sideBarModule&&this.sideBarModule.setSideBarPosition(e)},l.prototype.scrollRefresh=function(){function e(){t.scrollModule.refresh(),t.off(vt,e)}var t=this;this.on(vt,e,this)},l.prototype.detailCollapseAll=function(){this.detailRowModule&&this.detailRowModule.collapseAll()},l.prototype.detailExpandAll=function(){this.detailRowModule&&this.detailRowModule.expandAll()},l.prototype.clearCellSelection=function(){this.selectionModule&&this.selectionModule.clearCellSelection()},l.prototype.clearRowSelection=function(e){this.selectionModule&&this.selectionModule.clearRowSelection(e)},l.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},l.prototype.selectRowsByRange=function(e,t){this.selectionModule&&this.selectionModule.selectRowsByRange(e,t)},l.prototype.isContextMenuOpen=function(){return this.contextMenuModule&&this.contextMenuModule.isOpen},l.prototype.ensureModuleInjected=function(e){return 0<=this.getInjectedModules().indexOf(e)},l.prototype.destroyTemplate=function(e,t,i){this.clearTemplate(e,t,i)},l.prototype.log=function(e,t){this.getInjectedModules().find(function(e){return"Logger"===e.name})||(Wd.Inject(Vh),this.enableLogger=!0,this.injectModules()),this.loggerModule&&this.loggerModule.log(e,t)},l.prototype.applyBiggerTheme=function(e){this.element.classList.contains("e-bigger")&&e.classList.add("e-bigger")},l.prototype.getPreviousRowData=function(){return this.getRowsObject()[this.getRows().length-1].data},l.prototype.hideScroll=function(){var e=this.getContent().querySelector("."+xs);e.scrollHeight<=e.clientHeight&&(this.scrollModule.removePadding(),e.style.overflowY="auto")},l.prototype.getRowIndexByPrimaryKey=function(e){for(var t=this.getPrimaryKeyFieldNames()[0],i=(e="object"==typeof e?e[""+t]:e,this.getRowsObject()),n=0;n<i.length;n++)if(!i[parseInt(n.toString(),10)].isDetailRow&&!i[parseInt(n.toString(),10)].isCaptionRow){var r=i[parseInt(n.toString(),10)].data[""+t];if((r=1<t.split(".").length?Gc(t,i[parseInt(n.toString(),10)].data):r)===e)return i[parseInt(n.toString(),10)].index}return-1},l.prototype.getPinnedRowObjectByKey=function(e){for(var t=this.getPrimaryKeyFieldNames()[0],i=(e="object"==typeof e?e[""+t]:e,this.pinnedTopRowModels),n=0;n<i.length;n++)if(!i[parseInt(n.toString(),10)].isDetailRow&&!i[parseInt(n.toString(),10)].isCaptionRow){var r=i[parseInt(n.toString(),10)].data[""+t];if((r=1<t.split(".").length?Gc(t,i[parseInt(n.toString(),10)].data):r)===e)return i[parseInt(n.toString(),10)]}return null},l.prototype.grabColumnByFieldFromAllCols=function(e,t){this.columnModel=[],this.updateColumnModel(this.columns);for(var i,n=this.columnModel,r=0;r<n.length;r++)if(!t&&e===n[parseInt(r.toString(),10)].field||t&&n[parseInt(r.toString(),10)].isForeignColumn()&&e===n[parseInt(r.toString(),10)].foreignKeyValue){i=n[parseInt(r.toString(),10)];break}return i},l.prototype.grabColumnByUidFromAllCols=function(e){this.columnModel=[],this.updateColumnModel(this.columns);for(var t,i=this.columnModel,n=0;n<i.length;n++)e===i[parseInt(n.toString(),10)].uid&&(t=i[parseInt(n.toString(),10)]);return t},l.prototype.getFilteredRecords=function(){var e;return this.allowFiltering&&this.filterSettings.columns.length||this.searchSettings.key.length?(e=this.renderModule.data.generateQuery(!0),this.dataSource&&this.renderModule.data.isRemote()&&this.dataSource instanceof V.DataManager?this.renderModule.data.getData(this.dataSource,e):(this.dataSource instanceof V.DataManager?this.dataSource:new V.DataManager(this.dataSource,e)).executeLocal(e)):[]},l.prototype.getUserAgent=function(){var e=H.Browser.userAgent.toLowerCase();return/iphone|ipod|ipad|macintosh/.test(e)},l.prototype.tapEvent=function(e){this.getUserAgent()&&(oe.Global.timer?(clearTimeout(oe.Global.timer),oe.Global.timer=null,this.dblClickHandler(e),this.notify(yi,e)):oe.Global.timer=setTimeout(function(){oe.Global.timer=null},300))},l.prototype.getRowUid=function(e){return""+e+this.rowUid++},l.prototype.getRowElementByUID=function(e){for(var t,i=[].slice.call(this.getContent().querySelector(j).children),n=0,r=this.frozenRows||this.pinnedTopRowModels.length?[].slice.call(this.getHeaderContent().querySelector(j).children).concat(i):i;n<r.length;n++){var s=r[n];if(s.getAttribute("data-uid")===e){t=s;break}}return t},l.prototype.getHiddenColumns=function(){for(var e=[],t=0,i=this.columnModel;t<i.length;t++){var n=i[t];!1===n.visible&&e.push(n)}return e},l.prototype.calculatePageSizeByParentHeight=function(e){if(this.allowPaging&&(this.allowTextWrap&&"Header"===this.textWrapSettings.wrapMode||!this.allowTextWrap)){var t=0;if("string"==typeof e&&-1!==e.indexOf("%")&&(e=parseInt(e,10)/100*this.element.clientHeight),this.getNoncontentHeight()+this.getRowHeight()<e&&(t=(e-this.getNoncontentHeight())/this.getRowHeight()),0<t)return Math.floor(t)}return 0},l.prototype.getNoncontentHeight=function(){var e=0;if(this.getHeaderContent()&&!H.isNullOrUndefined(this.getHeaderContent().clientHeight)&&(e+=this.getHeaderContent().clientHeight),this.toolbar&&!H.isNullOrUndefined(this.element.querySelector(".e-toolbar").clientHeight)&&(e+=this.element.querySelector(".e-toolbar").clientHeight),this.allowPaging&&!H.isNullOrUndefined(this.element.querySelector(".e-gridpager").clientHeight)&&(e+=this.element.querySelector(".e-gridpager").clientHeight),this.allowGrouping&&this.groupSettings.showDropArea&&!H.isNullOrUndefined(this.element.querySelector(".e-groupdroparea").clientHeight)&&(e+=this.element.querySelector(".e-groupdroparea").clientHeight),0<this.aggregates.length&&!H.isNullOrUndefined(this.element.querySelector(".e-summaryrow").clientHeight))for(var t=0;t<this.element.getElementsByClassName("e-summaryrow").length;t++)e+=this.element.getElementsByClassName("e-summaryrow")[parseInt(t.toString(),10)].clientHeight;return e},l.prototype.getSummaryValues=function(e,t){return V.DataUtil.aggregates[e.type.toLowerCase()](t,e.field)},l.prototype.serverExcelExport=function(e,t){this.isExcel=!0,this.exportGrid(e,t)},l.prototype.serverPdfExport=function(e,t){this.isExcel=!1,this.exportGrid(e,t)},l.prototype.serverCsvExport=function(e,t){this.isExcel=!0,this.exportGrid(e,t)},l.prototype.exportGrid=function(e,t){var n=this,i=this.getDataModule().generateQuery(!0),i=(new V.UrlAdaptor).processQuery(new V.DataManager({url:""}),i),i=JSON.parse(i.data),r=JSON.parse(this.addOnPersist(["allowGrouping","allowPaging","pageSettings","sortSettings","allowPdfExport","allowExcelExport","aggregates","filterSettings","groupSettings","columns","locale","searchSettings"])),s=(r.filterSettings.columns=i.where,r.searchSettings.fields=i.search&&i.search[0].fields||[],r.sortSettings.columns=i.sorted,r.columns=this.setHeaderText(r.columns,["field","headerText","type","format","visible","foreignKeyValue","foreignKeyField","template","index","width","textAlign","headerTextAlign","columns"]),this.createElement("form",{id:"ExportForm"})),i=(s.style.display="none",this.createElement("input",{id:"gridInput",attrs:{name:"gridModel"}}));i.value=JSON.stringify(r),s.method="POST",s.action=e,s.appendChild(i),t&&t.headers&&Array.isArray(t.headers)&&t.headers.forEach(function(i){Object.keys(i).forEach(function(e){var t="string"==typeof i[""+e]?i[""+e]:JSON.stringify(i[""+e]),e=n.createElement("input",{attrs:{name:e,value:t,type:"hidden"}});s.appendChild(e)})}),document.body.appendChild(s),s.submit(),s.remove()},l.prototype.setHeaderText=function(e,t){for(var i=0;i<e.length;i++)for(var n=this.getColumnByUid(e[parseInt(i.toString(),10)].uid),r=(e[parseInt(i.toString(),10)].headerText=n.headerText,H.isNullOrUndefined(n.template)||(e[parseInt(i.toString(),10)].template="true"),e[parseInt(i.toString(),10)].format&&(e[parseInt(i.toString(),10)].format=Vc(this.getFormat(e[parseInt(i.toString(),10)].format),e[parseInt(i.toString(),10)].type,!1,H.defaultCurrencyCode),"datetime"!==n.type&&"date"!==n.type&&"time"!==n.type||(e[parseInt(i.toString(),10)].format=e[parseInt(i.toString(),10)].format.toString().replace("AM/PM","tt"))),e[parseInt(i.toString(),10)].columns&&this.setHeaderText(e[parseInt(i.toString(),10)].columns,t),Object.keys(e[parseInt(i.toString(),10)])),s=0;s<r.length;s++)t.indexOf(r[parseInt(s.toString(),10)])<0&&delete e[parseInt(i.toString(),10)][r[parseInt(s.toString(),10)]];return e},l.prototype.getFormat=function(e){return"object"==typeof e?H.isNullOrUndefined(e.format)?e.skeleton:e.format:e},l.prototype.isCollapseStateEnabled=function(){return!1===this.isExpanded},l.prototype.updateRowValue=function(e,t){t={requestType:"save",data:t};this.showSpinner(),this.notify(li,t),this.refresh()},l.prototype.setForeignKeyData=function(){this.dataBind();var e=this.getDataModule().getForeignKeyDataState();e.isPending?(this.getDataModule().setForeignKeyDataState({}),e.resolver()):(this.getDataModule().setForeignKeyDataState({isDataChanged:!1}),(this.contentModule||this.headerModule)&&this.renderModule.render())},l.prototype.resetFilterDlgPosition=function(e){var t,i,e=this.getColumnHeaderByField(e);e&&(e=e.querySelector(".e-filtermenudiv"),t=this.element.querySelector(".e-filter-popup"),e)&&(i=this.element.getBoundingClientRect(),e=e.getBoundingClientRect(),t)&&(t.offsetWidth+e.right>i.right?t.style.left=(e.right-t.offsetWidth-i.left).toString()+"px":t.style.left=(e.right-i.left).toString()+"px")},l.prototype.renderTemplates=function(e){var t=this.parentDetails&&this.parentDetails.parentInstObj&&this.parentDetails.parentInstObj.isReact,i=this.printGridParent&&this.printGridParent.isReact;(t||i)&&this.portals?((t=i?this.printGridParent:this.parentDetails.parentInstObj).portals=t.portals.concat(this.portals),t.renderTemplates(e),this.portals=void 0):(this.notify("reactTemplateRender",this.portals),this.renderReactTemplates(e))},l.prototype.batchUpdate=function(e){this.processRowChanges(e)},l.prototype.batchAsyncUpdate=function(e){this.processBulkRowChanges(e)},l.prototype.processBulkRowChanges=function(e){var t=this;if(this.dataToBeUpdated)for(var i=[ks,Ms,Ps],n=this.getPrimaryKeyFieldNames()[0],r=0;r<i.length;r++)e[i[parseInt(r.toString(),10)]]&&Dc(this,e,i[parseInt(r.toString(),10)],n);else this.dataToBeUpdated=Object.assign({addedRecords:[],changedRecords:[],deletedRecords:[]},e),setTimeout(function(){t.processRowChanges(t.dataToBeUpdated),t.dataToBeUpdated=null},this.asyncTimeOut)},l.prototype.processRowChanges=function(e){var t=this,i=this.getPrimaryKeyFieldNames()[0],e=(e=Object.assign({addedRecords:[],changedRecords:[],deletedRecords:[]},e),this.getDataModule().saveChanges(e,i,{},this.getDataModule().generateQuery().requiresCount()));this.getDataModule().isRemote()?e.then(function(){t.setNewData()}):this.setNewData()},l.prototype.setNewData=function(){var t=this,i=JSON.parse(JSON.stringify(this.getCurrentViewRecords()));this.getDataModule().getData({},this.getDataModule().generateQuery().requiresCount()).then(function(e){t.bulkRefresh(e.result,i,e.count)})},l.prototype.deleteRowElement=function(e){e=this.getRowElementByUID(e.uid);H.remove(e)},l.prototype.bulkRefresh=function(n,e,t){for(var i,r=this,s=this.getRowsObject(),o=this.getPrimaryKeyFieldNames()[0],a=this,l=0;l<s.length;l++)!function(t){n.filter(function(e){return e[""+o]===s[parseInt(t.toString(),10)].data[""+o]}).length||(a.deleteRowElement(s[parseInt(t.toString(),10)]),s.splice(t,1),t--),i=t}(l),l=i;for(var h=this,l=0;l<n.length;l++)!function(t){var i;e.filter(function(e){e[""+o]===n[parseInt(t.toString(),10)][""+o]&&(e!==n[parseInt(t.toString(),10)]&&r.setRowData(n[parseInt(t.toString(),10)][""+o],n[parseInt(t.toString(),10)]),i=!0)}),i||h.renderRowElement(n[parseInt(t.toString(),10)],t)}(l);this.currentViewData=n;var d=[].slice.call(this.getContentTable().getElementsByClassName(Ts));Ic(this,this.getRowsObject(),d),Tc(this),this.allowPaging&&this.notify(wt,{module:"pager",properties:{totalRecordsCount:t}})},l.prototype.renderRowElement=function(e,t){var i,n=new $s(this.serviceLocator,null,this),e=new Js(this).generateRows([e]),n=n.render(e[0],this.getColumns()),e=(this.addRowObject(e[0],t),this.getContentTable().querySelector(j));e.querySelector(".e-emptyrow")&&((i=e.querySelector(".e-emptyrow")).parentNode.removeChild(i),this.frozenRows)&&this.element.querySelector(".e-frozenrow-empty")&&this.element.querySelector(".e-frozenrow-empty").classList.remove("e-frozenrow-empty"),e=(this.frozenRows&&t<this.frozenRows?this.getHeaderContent():this.getContent()).querySelector(j),(e=this.getContent().querySelector(j)).appendChild(n)},l.prototype.addRowObject=function(e,t){this.getRowsObject().splice(t,1,e)},l.prototype.updateVisibleExpandCollapseRows=function(){for(var e=this.getRowsObject(),t=0,i=e.length;t<i;t++)(e[parseInt(t.toString(),10)].isDataRow||e[parseInt(t.toString(),10)].isAggregateRow)&&this.getRowElementByUID(e[parseInt(t.toString(),10)].uid)&&"none"===this.getRowElementByUID(e[parseInt(t.toString(),10)].uid).style.display?e[parseInt(t.toString(),10)].visible=!1:e[parseInt(t.toString(),10)].visible=!0},l.prototype.sanitize=function(e){return this.enableHtmlSanitizer?H.SanitizeHtmlHelper.sanitize(e):e},l.prototype.getHeight=function(e){return e=Number.isInteger(e)||-1===e.indexOf("%")?Number.isInteger(e)||"auto"===this.height?this.height:parseInt(e,10):parseInt(e,10)/100*this.element.clientHeight},l.prototype.getFrozenRightContent=function(){return this.contentModule.getPanel()},l.prototype.getFrozenRightHeader=function(){return this.headerModule.getPanel()},l.prototype.getMovableHeaderTbody=function(){return this.getHeaderContent().querySelector(j)},l.prototype.getMovableContentTbody=function(){return this.getContent().querySelector(j)},l.prototype.getFrozenHeaderTbody=function(){return this.getHeaderContent().querySelector(j)},l.prototype.getFrozenLeftContentTbody=function(){return this.getContent().querySelector(j)},l.prototype.getFrozenRightHeaderTbody=function(){return this.getHeaderContent().querySelector(j)},l.prototype.getFrozenRightContentTbody=function(){return this.getContent().querySelector(j)},l.prototype.showResponsiveCustomFilter=function(e){this.filterModule&&this.filterModule.showCustomFilter(e||"Vertical"===this.rowRenderingMode)},l.prototype.showResponsiveCustomSort=function(e){this.sortModule&&this.sortModule.showCustomSort(e||"Vertical"===this.rowRenderingMode)},l.prototype.showResponsiveCustomColumnChooser=function(e){this.columnChooserModule&&this.columnChooserModule.showCustomColumnChooser(e||"Vertical"===this.rowRenderingMode)},l.prototype.showAdaptiveFilterDialog=function(){this.enableAdaptiveUI&&this.showResponsiveCustomFilter(!0)},l.prototype.showAdaptiveSortDialog=function(){this.enableAdaptiveUI&&this.showResponsiveCustomSort(!0)},l.prototype.getCurrentVisibleColumns=function(e){for(var t=[],i=0,n=e?this.getColumns():this.columnModel;i<n.length;i++){var r=n[i];r.visible&&t.push(r)}return t},l.prototype.isRowDomVirtualization=function(){var e=this.domVirtualizationSettings.virtualDomType;return this.enableDomVirtualization&&"Row"===e},l.prototype.clearDomVirtualRowCache=function(){this.domRowObj.clear()},l.prototype.enableInfiniteAggrgate=function(){this.enableInfiniteScrolling&&this.groupSettings.columns.length&&!this.groupSettings.disablePageWiseAggregates&&!this.groupSettings.enableLazyLoading&&this.setProperties({groupSettings:{disablePageWiseAggregates:!0}},!0)},a([H.Property([])],l.prototype,"currentViewData",void 0),a([H.Property()],l.prototype,"parentDetails",void 0),a([H.Property()],l.prototype,"showHider",void 0),a([H.Property(!1)],l.prototype,"enableStatusBar",void 0),a([H.Complex({},gh)],l.prototype,"statusBarSettings",void 0),a([H.Property([])],l.prototype,"columns",void 0),a([H.Property(!0)],l.prototype,"enableAltRow",void 0),a([H.Property(!0)],l.prototype,"enableHover",void 0),a([H.Property(!1)],l.prototype,"enableAutoFill",void 0),a([H.Property(!0)],l.prototype,"allowKeyboard",void 0),a([H.Property(!1)],l.prototype,"enableStickyHeader",void 0),a([H.Property(!1)],l.prototype,"enableHtmlSanitizer",void 0),a([H.Property(!1)],l.prototype,"allowTextWrap",void 0),a([H.Complex({},Od)],l.prototype,"textWrapSettings",void 0),a([H.Complex({},Md)],l.prototype,"resizeSettings",void 0),a([H.Property(!1)],l.prototype,"allowPaging",void 0),a([H.Property(!1)],l.prototype,"enableCache",void 0),a([H.Property(5)],l.prototype,"cacheLimit",void 0),a([H.Complex({},t)],l.prototype,"pageSettings",void 0),a([H.Complex({},Gd)],l.prototype,"loadingIndicator",void 0),a([H.Property(!0)],l.prototype,"enableVirtualMaskRow",void 0),a([H.Property(!1)],l.prototype,"enableVirtualization",void 0),a([H.Property(!1)],l.prototype,"enableColumnVirtualization",void 0),a([H.Property(!1)],l.prototype,"enableInfiniteScrolling",void 0),a([H.Complex({},Id)],l.prototype,"searchSettings",void 0),a([H.Complex({},rh)],l.prototype,"findSettings",void 0),a([H.Property(!1)],l.prototype,"allowSorting",void 0),a([H.Property("Ellipsis")],l.prototype,"clipMode",void 0),a([H.Property(!0)],l.prototype,"allowMultiSorting",void 0),a([H.Property(!1)],l.prototype,"allowExcelExport",void 0),a([H.Property(!1)],l.prototype,"allowPdfExport",void 0),a([H.Complex({},id)],l.prototype,"sortSettings",void 0),a([H.Complex({},ld)],l.prototype,"infiniteScrollSettings",void 0),a([H.Property(!1)],l.prototype,"enableDomVirtualization",void 0),a([H.Complex({},pd)],l.prototype,"domVirtualizationSettings",void 0),a([H.Property(500)],l.prototype,"detailTemplateHeight",void 0),a([H.Property(!0)],l.prototype,"allowSelection",void 0),a([H.Property(!0)],l.prototype,"allowTextSelection",void 0),a([H.Property(-1)],l.prototype,"selectedRowIndex",void 0),a([H.Complex({},Cd)],l.prototype,"selectionSettings",void 0),a([H.Property(!1)],l.prototype,"allowFiltering",void 0),a([H.Property(!1)],l.prototype,"allowAdvancedFiltering",void 0),a([H.Complex({},yd)],l.prototype,"advancedFilterSettings",void 0),a([H.Property("Horizontal")],l.prototype,"rowRenderingMode",void 0),a([H.Property(!1)],l.prototype,"enableAdaptiveUI",void 0),a([H.Property("Both")],l.prototype,"adaptiveUIMode",void 0),a([H.Property(!1)],l.prototype,"allowReordering",void 0),a([H.Property(!1)],l.prototype,"enableRowSpan",void 0),a([H.Property(!1)],l.prototype,"enableColumnSpan",void 0),a([H.Property(!1)],l.prototype,"allowResizing",void 0),a([H.Property(!1)],l.prototype,"allowRowDragAndDrop",void 0),a([H.Complex({},Dd)],l.prototype,"rowDropSettings",void 0),a([H.Complex({},gd)],l.prototype,"filterSettings",void 0),a([H.Property(!1)],l.prototype,"allowGrouping",void 0),a([H.Property(!1)],l.prototype,"enableImmutableMode",void 0),a([H.Property(!1)],l.prototype,"showColumnMenu",void 0),a([H.Property(!1)],l.prototype,"autoFit",void 0),a([H.Complex({},Ld)],l.prototype,"groupSettings",void 0),a([H.Complex({},zd)],l.prototype,"editSettings",void 0),a([H.Complex({},Hd)],l.prototype,"formulaSettings",void 0),a([H.Collection([],sh)],l.prototype,"aggregates",void 0),a([H.Property(!1)],l.prototype,"showColumnChooser",void 0),a([H.Complex({},Va)],l.prototype,"columnChooserSettings",void 0),a([H.Property(!1)],l.prototype,"enableToolPanel",void 0),a([H.Complex({},uh)],l.prototype,"toolPanelSettings",void 0),a([H.Property(!0)],l.prototype,"enableHeaderFocus",void 0),a([H.Property("auto")],l.prototype,"height",void 0),a([H.Property("auto")],l.prototype,"width",void 0),a([H.Property("Default")],l.prototype,"gridLines",void 0),a([H.Property()],l.prototype,"rowTemplate",void 0),a([H.Property()],l.prototype,"emptyRecordTemplate",void 0),a([H.Property("Normal")],l.prototype,"emptyRecordMode",void 0),a([H.Property()],l.prototype,"detailTemplate",void 0),a([H.Property()],l.prototype,"childGrid",void 0),a([H.Property()],l.prototype,"queryString",void 0),a([H.Property("AllPages")],l.prototype,"printMode",void 0),a([H.Property("Expanded")],l.prototype,"hierarchyPrintMode",void 0),a([H.Property([])],l.prototype,"dataSource",void 0),a([H.Property(null)],l.prototype,"rowHeight",void 0),a([H.Property(null)],l.prototype,"headerRowHeight",void 0),a([H.Property(null)],l.prototype,"footerRowHeight",void 0),a([H.Property()],l.prototype,"query",void 0),a([H.Property("USD")],l.prototype,"currencyCode",void 0),a([H.Property()],l.prototype,"exportGrids",void 0),a([H.Property()],l.prototype,"toolbar",void 0),a([H.Property()],l.prototype,"contextMenuItems",void 0),a([H.Property()],l.prototype,"columnMenuItems",void 0),a([H.Property()],l.prototype,"toolbarTemplate",void 0),a([H.Property()],l.prototype,"pagerTemplate",void 0),a([H.Property(0)],l.prototype,"frozenRows",void 0),a([H.Property(0)],l.prototype,"frozenColumns",void 0),a([H.Property("")],l.prototype,"cssClass",void 0),a([H.Property("All")],l.prototype,"columnQueryMode",void 0),a([H.Property({})],l.prototype,"currentAction",void 0),a([H.Property("")],l.prototype,"ej2StatePersistenceVersion",void 0),a([H.Property(null)],l.prototype,"isRowSelectable",void 0),a([H.Property(null)],l.prototype,"isRowNonDeselectable",void 0),a([H.Event()],l.prototype,"isRowPinned",void 0),a([H.Event()],l.prototype,"created",void 0),a([H.Event()],l.prototype,"destroyed",void 0),a([H.Event()],l.prototype,"load",void 0),a([H.Event()],l.prototype,"rowDataBound",void 0),a([H.Event()],l.prototype,"setRowHeight",void 0),a([H.Event()],l.prototype,"queryCellInfo",void 0),a([H.Event()],l.prototype,"headerCellInfo",void 0),a([H.Event()],l.prototype,"findChange",void 0),a([H.Event()],l.prototype,"findNavigate",void 0),a([H.Event()],l.prototype,"actionBegin",void 0),a([H.Event()],l.prototype,"actionComplete",void 0),a([H.Event()],l.prototype,"actionFailure",void 0),a([H.Event()],l.prototype,"dataBound",void 0),a([H.Event()],l.prototype,"recordDoubleClick",void 0),a([H.Event()],l.prototype,"recordClick",void 0),a([H.Event()],l.prototype,"rowSelecting",void 0),a([H.Event()],l.prototype,"rowSelected",void 0),a([H.Event()],l.prototype,"rowDeselecting",void 0),a([H.Event()],l.prototype,"rowDeselected",void 0),a([H.Event()],l.prototype,"cellSelecting",void 0),a([H.Event()],l.prototype,"cellSelected",void 0),a([H.Event()],l.prototype,"cellDeselecting",void 0),a([H.Event()],l.prototype,"cellDeselected",void 0),a([H.Event()],l.prototype,"cellFocus",void 0),a([H.Event()],l.prototype,"columnSelecting",void 0),a([H.Event()],l.prototype,"columnSelected",void 0),a([H.Event()],l.prototype,"columnDeselecting",void 0),a([H.Event()],l.prototype,"columnDeselected",void 0),a([H.Event()],l.prototype,"columnDragStart",void 0),a([H.Event()],l.prototype,"columnDrag",void 0),a([H.Event()],l.prototype,"columnDrop",void 0),a([H.Event()],l.prototype,"printComplete",void 0),a([H.Event()],l.prototype,"beforePrint",void 0),a([H.Event()],l.prototype,"pdfQueryCellInfo",void 0),a([H.Event()],l.prototype,"pdfHeaderQueryCellInfo",void 0),a([H.Event()],l.prototype,"pdfAggregateQueryCellInfo",void 0),a([H.Event()],l.prototype,"excelAggregateQueryCellInfo",void 0),a([H.Event()],l.prototype,"exportDetailDataBound",void 0),a([H.Event()],l.prototype,"exportDetailTemplate",void 0),a([H.Event()],l.prototype,"excelQueryCellInfo",void 0),a([H.Event()],l.prototype,"excelHeaderQueryCellInfo",void 0),a([H.Event()],l.prototype,"beforeExcelExport",void 0),a([H.Event()],l.prototype,"excelExportComplete",void 0),a([H.Event()],l.prototype,"beforePdfExport",void 0),a([H.Event()],l.prototype,"pdfExportComplete",void 0),a([H.Event()],l.prototype,"rowDragStartHelper",void 0),a([H.Event()],l.prototype,"detailDataBound",void 0),a([H.Event()],l.prototype,"detailExpand",void 0),a([H.Event()],l.prototype,"detailCollapse",void 0),a([H.Event()],l.prototype,"detailExpanded",void 0),a([H.Event()],l.prototype,"detailCollapsed",void 0),a([H.Event()],l.prototype,"rowDragStart",void 0),a([H.Event()],l.prototype,"rowDrag",void 0),a([H.Event()],l.prototype,"rowDrop",void 0),a([H.Event()],l.prototype,"toolbarClick",void 0),a([H.Event()],l.prototype,"beforeOpenColumnChooser",void 0),a([H.Event()],l.prototype,"toolPanelOpen",void 0),a([H.Event()],l.prototype,"toolPanelOpened",void 0),a([H.Event()],l.prototype,"toolPanelClose",void 0),a([H.Event()],l.prototype,"toolPanelClosed",void 0),a([H.Event()],l.prototype,"toolPanelColumnDrop",void 0),a([H.Event()],l.prototype,"toolPanelColumnDropped",void 0),a([H.Event()],l.prototype,"toolPanelCreated",void 0),a([H.Event()],l.prototype,"beforeOpenAdaptiveDialog",void 0),a([H.Event()],l.prototype,"batchAdd",void 0),a([H.Event()],l.prototype,"batchDelete",void 0),a([H.Event()],l.prototype,"batchCancel",void 0),a([H.Event()],l.prototype,"beforeBatchAdd",void 0),a([H.Event()],l.prototype,"beforeBatchDelete",void 0),a([H.Event()],l.prototype,"beforeBatchSave",void 0),a([H.Event()],l.prototype,"beginEdit",void 0),a([H.Event()],l.prototype,"commandClick",void 0),a([H.Event()],l.prototype,"cellEdit",void 0),a([H.Event()],l.prototype,"cellSave",void 0),a([H.Event()],l.prototype,"cellSaved",void 0),a([H.Event()],l.prototype,"resizeStart",void 0),a([H.Event()],l.prototype,"resizing",void 0),a([H.Event()],l.prototype,"resizeStop",void 0),a([H.Event()],l.prototype,"keyPressed",void 0),a([H.Event()],l.prototype,"beforeDataBound",void 0),a([H.Event()],l.prototype,"contextMenuOpen",void 0),a([H.Event()],l.prototype,"contextMenuClick",void 0),a([H.Event()],l.prototype,"contextMenuClose",void 0),a([H.Event()],l.prototype,"columnMenuOpen",void 0),a([H.Event()],l.prototype,"columnMenuClick",void 0),a([H.Event()],l.prototype,"columnMenuClose",void 0),a([H.Event()],l.prototype,"checkBoxChange",void 0),a([H.Event()],l.prototype,"beforeCopy",void 0),a([H.Event()],l.prototype,"beforePaste",void 0),a([H.Event()],l.prototype,"beforeAutoFill",void 0),a([H.Event()],l.prototype,"beforeWebMcpToolExecute",void 0),a([H.Event()],l.prototype,"columnDataStateChange",void 0),a([H.Event()],l.prototype,"dataStateChange",void 0),a([H.Event()],l.prototype,"dataSourceChanged",void 0),a([H.Event()],l.prototype,"exportGroupCaption",void 0),a([H.Event()],l.prototype,"lazyLoadGroupExpand",void 0),a([H.Event()],l.prototype,"lazyLoadGroupCollapse",void 0),a([H.Event()],l.prototype,"beforeDetailTemplateDetach",void 0),a([H.Event()],l.prototype,"beforeCustomFilterOpen",void 0),a([H.Event()],l.prototype,"advancedFilterOpen",void 0),a([H.Event()],l.prototype,"advancedFilterClose",void 0),a([H.Event()],l.prototype,"advancedFilterBegin",void 0),a([H.Event()],l.prototype,"advancedFilterComplete",void 0),a([H.Property(!1)],l.prototype,"enableWebMcp",void 0),a([H.Complex({},Yh)],l.prototype,"webMcpSettings",void 0),a([H.Property(!1)],l.prototype,"enableHighlightOnDataChange",void 0),a([H.Complex({},Ka)],l.prototype,"highlightSettings",void 0);var Kd,Wd,Qd=Wd=a([H.NotifyPropertyChanges],l);function l(e,t){e=Kd.call(this,e,t)||this;return e.isPreventScrollEvent=!1,e.inViewIndexes=[],e.keyA=!1,e.frozenRightCount=0,e.freezeColumnRefresh=!0,e.rightcount=0,e.frozenLeftCount=0,e.leftcount=0,e.tablesCount=1,e.movableCount=0,e.movablecount=0,e.fixedcount=0,e.fixedCount=0,e.visibleFrozenLeft=0,e.visibleFrozenFixed=0,e.isPreparedFrozenColumns=!1,e.visibleFrozenRight=0,e.visibleMovable=0,e.frozenLeftColumns=[],e.frozenRightColumns=[],e.movableColumns=[],e.fixedColumns=[],e.stackedLeft=[],e.stackedRight=[],e.stackedFixed=[],e.stackedMovable=[],e.stackedarrayLeft=[],e.stackedarrayRight=[],e.stackedarrayFixed=[],e.stackedarrayMovable=[],e.media={},e.autoFitColumnsResize=!1,e.tableIndex=0,e.componentRefresh=H.Component.prototype.refresh,e.isChangeDataSourceCall=!1,e.mergedColumns=!1,e.isVirtualAdaptive=!1,e.isFormulaRefreshSuspended=!1,e.requireTemplateRef=!0,e.vRows=[],e.vcRows=[],e.vGroupOffsets={},e.rowUid=0,e.isLastRecordLoaded=!1,e.translateX=0,e.isManualRefresh=!1,e.isAutoFitColumns=!1,e.enableDeepCompare=!1,e.totalDataRecordsCount=0,e.disableSelectedRecords=[],e.partialSelectedRecords=[],e.partialSelectedIndexes=[],e.pinnedTopRowModels=[],e.domRowObj=new Map,e.domVirtualClearActions=["filtering","searching","grouping","ungrouping","sorting","refresh","reorder","delete","save","batchsave","paging"],e.pinnedTopRecords=[],e.pinnedDataCount=0,e.pinnedTopRowKeys={},e.pinnedRowIndexes={},e.contentRowIndexes={},e.isSpan=!1,e.islazyloadRequest=!1,e.isAddNewRow=!1,e.addNewRowFocus=!0,e.selectVirtualRowOnAdd=!1,e.lockcolPositionCount=0,e.prevPageMoving=!1,e.pageTemplateChange=!1,e.isAutoGen=!1,e.isAutoGenerateColumns=!1,e.pageRequireRefresh=!0,e.mediaBindInstance={},e.commandDelIndex=void 0,e.preventAutoFit=!1,e.enableSeamlessScrolling=!1,e.asyncTimeOut=50,e.isExportGrid=!1,e.isWidgetsDestroyed=!1,e.columnTemplateIDs=[],e.enableLogger=!1,e.needsID=!0,H.initializeTelemetry("DataGrid"),Wd.Inject(Yl),H.setValue("mergePersistData",e.mergePersistGridData,e),e}function Xd(){return["aggregates","allowGrouping","allowFiltering","allowMultiSorting","allowReordering","allowSorting","allowTextWrap","childGrid","columns","currentViewData","dataSource","detailTemplate","enableAltRow","enableColumnVirtualization","filterSettings","gridLines","groupSettings","height","locale","pageSettings","printMode","query","queryString","enableRtl","rowHeight","rowTemplate","sortSettings","textWrapSettings","allowPaging","hierarchyPrintMode","searchSettings","queryCellInfo","beforeDataBound","enableHtmlSanitizer"]}$d.prototype.isContentReady=function(){var e=this;return!this.isPrintGrid()||"None"!==this.parent.hierarchyPrintMode&&this.parent.childGrid?function(){e.defered.promise.then(function(){e.contentReady()}),e.isPrintGrid()&&e.hierarchyPrint()}:this.contentReady},$d.prototype.hierarchyPrint=function(){this.removeColGroup(this.parent);var e=window.printGridObj;e&&!e.element.querySelector("[aria-busy=true")&&e.printModule.defered.resolve()},$d.prototype.print=function(){this.renderPrintGrid()},$d.prototype.onEmpty=function(){this.isPrintGrid()&&this.contentReady()},$d.prototype.actionBegin=function(){this.isPrintGrid()&&(this.isAsyncPrint=!0)},$d.prototype.renderPrintGrid=function(){for(var e=this.parent,t=H.createElement("div",{id:this.parent.element.id+"_print",className:e.element.className+" e-print-grid"}),i=(t.classList.remove("e-gridhover"),document.body.appendChild(t),new Qd(rc(e,e.hierarchyPrintMode))),n=0;n<i.columns.length;n++)i.columns[parseInt(n.toString(),10)]=H.extend({},i.columns[parseInt(n.toString(),10)]),!e.getFrozenColumns()&&e.isFrozenGrid()&&(i.columns[parseInt(n.toString(),10)].freeze=void 0);this.parent.isAngular&&(i.viewContainerRef=this.parent.viewContainerRef),i.load=function(){},i.query=e.getQuery().clone(),(window.printGridObj=i).isPrinting=!0;var r=i.getInjectedModules(),s=e.getInjectedModules();r&&r.length===s.length||i.setInjectedModules(s),e.notify(en,{element:t,printgrid:i}),this.parent.log("exporting_begin",this.getModuleName()),i.registeredTemplate=this.parent.registeredTemplate,i.isVue=this.parent.isVue,this.parent.isVue&&(i.vueInstance=this.parent.vueInstance),i.printGridParent=e,i.appendTo(t),e.isVue3||(i.trigger=e.trigger)},$d.prototype.contentReady=function(){var e,t,i=this;this.isPrintGrid()&&(e=this.parent,this.isAsyncPrint?this.printGrid():(t={requestType:"print",element:e.element,selectedRows:e.getContentTable().querySelectorAll('tr[aria-selected="true"]'),cancel:!1,hierarchyPrintMode:e.hierarchyPrintMode},this.isAsyncPrint||e.trigger(Ae,t),t.cancel?H.detach(e.element):this.isAsyncPrint||(this.parent.printGridParent&&this.parent.printGridParent.isReact?this.parent.printGridParent.renderTemplates(function(){i.printGrid()}):this.printGrid())))},$d.prototype.printGrid=function(){var e,t=this.parent;"auto"!==t.height&&(e=this.scrollModule.getCssProperties(),r=t.element.querySelector("."+xs),l=t.element.querySelector("."+ms),r.style.height="auto",r.style.overflowY="auto",l.style[e.padding]="",l.firstElementChild.style[e.border]=""),t.allowGrouping&&(t.groupSettings.columns.length?this.removeColGroup(t):t.element.querySelector(".e-groupdroparea").style.display="none");for(var i=0,n=[].slice.call(t.element.getElementsByClassName(xs));i<n.length;i++)(a=n[i]).style.overflowX="hidden";for(var r=[].slice.call(t.element.getElementsByClassName("e-spin-show")),s=0,o=[].slice.call(r);s<o.length;s++){var a=o[s];H.classList(a,["e-spin-hide"],["e-spin-show"])}this.printGridElement(t),t.isPrinting=!1,delete window.printGridObj;var l={element:t.element};t.trigger(Fe,l),t.destroy(),this.parent.log("exporting_complete",this.getModuleName())},$d.prototype.printGridElement=function(e){H.classList(e.element,["e-print-grid-layout"],["e-print-grid"]),e.isPrinting&&H.detach(e.element),this.printWind=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),H.isNullOrUndefined(this.printWind)||(this.printWind.moveTo(0,0),this.printWind.resizeTo(screen.availWidth,screen.availHeight),this.printWind=H.print(e.element,this.printWind))},$d.prototype.removeColGroup=function(e){var t=e.groupSettings.columns.length,i=e.element,n="#"+e.element.id;if(t){for(var r=H.selectAll(".e-groupcaption",i),s=e.groupSettings.enableLazyLoading?(parseInt(r[0].getAttribute("colspan"),10)-(e.groupSettings.columns.length-1)).toString():r[t-1].getAttribute("colspan"),o=0;o<r.length;o++)r[parseInt(o.toString(),10)].setAttribute("colspan",s);e=H.selectAll("colgroup"+n+"colgroup",i),n=H.selectAll(".e-content colgroup",i),i=H.selectAll(".e-summarycontent colgroup",i);this.hideColGroup(e,t),this.hideColGroup(n,t),this.hideColGroup(i,t)}},$d.prototype.hideColGroup=function(e,t){for(var i=0;i<e.length;i++)for(var n=0;n<t;n++)e[parseInt(i.toString(),10)].children[parseInt(n.toString(),10)].style.display="none"},$d.prototype.isPrintGrid=function(){return 0<this.parent.element.id.indexOf("_print")&&this.parent.isPrinting},$d.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(vt,this.contentReady.bind(this)),this.parent.removeEventListener(y,this.actionBeginFunction),this.parent.off(Ct,this.onEmpty.bind(this)),this.parent.off(Zi,this.hierarchyPrint))},$d.prototype.getModuleName=function(){return"print"},$d.printGridProp=Xd().concat([Ae,Fe,ie]);var Yd=$d;function $d(e,t){this.isAsyncPrint=!1,this.defered=new V.Deferred,this.parent=e,this.parent.isDestroyed||(this.parent.on(vt,this.isContentReady(),this),this.actionBeginFunction=this.actionBegin.bind(this),this.parent.addEventListener(y,this.actionBeginFunction),this.parent.on(Ct,this.onEmpty.bind(this)),this.parent.on(Zi,this.hierarchyPrint,this),this.scrollModule=t)}function Zd(e,t){return e.prototype&&t in e.prototype}function Jd(e,t,i){return H.isNullOrUndefined(e)||""===e?"":V.DataUtil.getObject(e,t)}function ep(e,t){requestAnimationFrame(function(){try{t(null,e())}catch(e){t(e)}})}function tp(e){return!H.isNullOrUndefined(e)&&!H.isNullOrUndefined(e.columns)&&0<e.columns.length}function ip(e,t){for(var i=e.columns,n=t.columns,r=0;r<i.length;r++)if(n.length-1>=r)if(n[parseInt(r.toString(),10)].columns)for(var s=0;s<n[parseInt(r.toString(),10)].columns.length;s++)i[parseInt(r.toString(),10)].columns[parseInt(s.toString(),10)].type=n[parseInt(r.toString(),10)].columns[parseInt(s.toString(),10)].type;else i[parseInt(r.toString(),10)].type=n[parseInt(r.toString(),10)].type}function np(e){for(var t=[],i=e.vRows,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].isDataRow?t.push(i[parseInt(n.toString(),10)]):i[parseInt(n.toString(),10)].isDataRow||(t.push(i[parseInt(n.toString(),10)]),!i[parseInt(n.toString(),10)].isExpand&&i[parseInt(n.toString(),10)].isCaptionRow&&(n+=sp(i[parseInt(n.toString(),10)],e)));e.vcRows=t}var rp=0;function sp(e,t){rp=0;var i="gSummary",n=t.groupSettings.columns.length,r="records",s="items",o=e[i],a=0,l="aggregatesCount";if(o===e.data.count)t.groupSettings.columns.length&&!H.isNullOrUndefined(e[l])&&e[l]?1!==t.groupSettings.columns.length?rp+=0!==e.indent&&o<2?e[i]*(n-e.indent+(n-e.indent)*e[l]):e[i]*(n-e.indent+(n-e.indent-1)*e[l])+e[l]:1===t.groupSettings.columns.length&&(rp+=e[i]*(n-e.indent)+e[l]):t.groupSettings.columns.length&&(1!==t.groupSettings.columns.length?rp+=e[i]*(t.groupSettings.columns.length-e.indent):rp+=e[i]);else{for(var h=0,d=e.data[s].length;h<d;h++){var p=e.data[s][parseInt(h.toString(),10)];rp+=p[s].length+(n===t.columns.length||H.isNullOrUndefined(p[s][r])?0:p[s][r].length),a+=(H.isNullOrUndefined(p[s][r])||H.isNullOrUndefined(e[l])?p[s]:p[s][r]).length,p[s].GroupGuid&&0!==p[s].childLevels&&op(p)}rp+=e.data[s].length,H.isNullOrUndefined(e[l])||e[l]&&rp&&0!==a&&(rp+=(rp-a)*e[l]+e[l])}return rp}function op(e){for(var t=0,i=e.items.length;t<i;t++){var n=e.items[parseInt(t.toString(),10)];rp+=n.count,0!==n.items.childLevels&&op(n)}}function ap(e,t){for(var i=[],n=0,r=e.length;n<r;n++){var s=t(e[parseInt(n.toString(),10)],n);H.isNullOrUndefined(s)||i.push(s)}return i}function lp(e){for(var t=[],i=0;i<e.length;i++)t.push(H.extend({},fp(e[parseInt(i.toString(),10)]),{},!0));return t}function hp(t){if(t)try{var e="<"!==t[0];return"function"!=typeof t&&e&&document.querySelectorAll(t).length?H.compile(document.querySelector(t).innerHTML.trim()):H.compile(t)}catch(e){return H.compile(t)}}function dp(e,t){var i={},n=["style","class"];H.extend(i,t,{}),"style"in i&&(H.setStyleAttribute(e,i[n[0]]),delete i[n[0]]),"class"in i&&(H.addClass([e],i[n[1]]),delete i[n[1]]),H.attributes(e,i)}function pp(e,t,i,n){for(var r=H.extend(e,t,i),s=Object.keys(r),o=0;o<s.length;o++)n&&-1!==n.indexOf(s[parseInt(o.toString(),10)])&&delete r[s[parseInt(o.toString(),10)]];return r}function cp(e,t){void 0===t&&(t=0);for(var i=0,n=H.isNullOrUndefined(e)?0:e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?(e[parseInt(i.toString(),10)].index=H.isNullOrUndefined(e[parseInt(i.toString(),10)].index)?t:e[parseInt(i.toString(),10)].index,t++,t=cp(e[parseInt(i.toString(),10)].columns,t)):(e[parseInt(i.toString(),10)].index=H.isNullOrUndefined(e[parseInt(i.toString(),10)].index)?t:e[parseInt(i.toString(),10)].index,t++);return t}function up(e,t,i){for(var n=0,r=H.isNullOrUndefined(e)?0:e.length;n<r;n++){var s=void 0;(s="string"==typeof e[parseInt(n.toString(),10)]?new Q({field:e[parseInt(n.toString(),10)]},i):e[parseInt(n.toString(),10)]instanceof Q&&!e[parseInt(n.toString(),10)].columns?e[parseInt(n.toString(),10)]:(e[parseInt(n.toString(),10)].columns&&(e[parseInt(n.toString(),10)].columns=up(e[parseInt(n.toString(),10)].columns,null,i)),new Q(e[parseInt(n.toString(),10)],i))).type&&"checkbox"===s.type.toLowerCase()&&(s.allowReordering=!1),s.allowFormula&&(s.type="number"),s.type&&"rownumber"===s.type&&(H.isNullOrUndefined(s.width)&&(s.width=60),H.isNullOrUndefined(s.textAlign)&&(s.textAlign="Right"),s.allowReordering=!1,s.allowEditing=!1,s.allowResizing=!1,s.showInColumnChooser=!1,s.isIdentity=!0),s.headerText=H.isNullOrUndefined(s.headerText)?s.foreignKeyValue||s.field||"":s.headerText,s.foreignKeyField=s.foreignKeyField||s.field,s.valueAccessor=("string"==typeof s.valueAccessor?H.getValue(s.valueAccessor,window):s.valueAccessor)||Jd,s.headerValueAccessor="string"==typeof s.headerValueAccessor?H.getValue(s.headerValueAccessor,window):s.headerValueAccessor,s.width=t&&H.isNullOrUndefined(s.width)?200:s.width,H.isNullOrUndefined(s.visible)&&(s.visible=!0),e[parseInt(n.toString(),10)]=s}return e}function gp(e,t,i){var n=e.querySelector("span"),r=e.parentElement.getBoundingClientRect(),s=t.target.getBoundingClientRect(),n=(n.className=i,e.style.display="",(H.isNullOrUndefined(t.clientY)?t.changedTouches[0]:t).clientY>e.offsetHeight+10);e.style.top=s.top-r.top+(n?-(e.offsetHeight+10):e.offsetHeight+10)+"px",e.style.left=function(e,t,i,n){e=e.offsetWidth/2,t=Cp(t).x;return t-i.left<e?i.left-n:i.right-t<e?i.right-n-2*e:t-n-e}(e,t,s,r.left)+"px",n?(e.querySelector(".e-downtail").style.display="",e.querySelector(".e-uptail").style.display="none"):(e.querySelector(".e-downtail").style.display="none",e.querySelector(".e-uptail").style.display="")}function fp(e){return e instanceof H.ChildProperty?H.getValue("properties",e):e}function I(e,t,i){for(var n=e;n&&(i?n.id!==t:!n.classList.contains(t));)n=n.parentElement;return n}function mp(e,t){for(var i=-1,n=0,r=t.length;n<r;n++)if(t[parseInt(n.toString(),10)].isEqualNode(e)){i=n;break}return i}function yp(e,t){for(var i=0,n=t.length;i<n;i++)if(t[parseInt(i.toString(),10)]===e)return i;return-1}function vp(e){for(var t=[],i=0,n=e.length;i<n;i++)e[parseInt(i.toString(),10)].hasOwnProperty("properties")?t.push(e[parseInt(i.toString(),10)].properties):t.push(e[parseInt(i.toString(),10)]);return t}function Sp(e,t){for(var i=[].slice.call(e.querySelectorAll(t)),n=0;n<i.length;n++)H.remove(i[parseInt(n.toString(),10)])}function Cp(e){var t={};return t.x=(H.isNullOrUndefined(e.clientX)?e.changedTouches[0]:e).clientX,t.y=(H.isNullOrUndefined(e.clientY)?e.changedTouches[0]:e).clientY,t}var wp=0;function bp(e){return e+wp++}function Ip(e,t){for(var i=0,n=t.length;i<n;i++)n===t.length?e.appendChild(t[parseInt(i.toString(),10)]):e.appendChild(t[0]);return e}function Rp(e,t,i){for(var n=e,r=[];n;)(i?n.id===t:n.classList.contains(t))&&r.push(n),n=n.parentElement;return r}function xp(e,t,i,n){var r;return"Custom"===e?(r="string"==typeof(r=i.customAggregate)?H.getValue(r,window):r)?r.call(n,t,i):"":i.field in t||t instanceof Array?V.DataUtil.aggregates[e.toLowerCase()](t,i.field):null}var Dp,Tp,Ep=null;function Op(e){var t;return null===Ep||e?(e=0,(t=document.createElement("div")).style.cssText="width:100px;height: 100px;overflow: scroll;position: absolute;top: -9999px;",document.body.appendChild(t),e=t.offsetWidth-t.clientWidth|0,document.body.removeChild(t),Ep=e):Ep}function Ap(e,t,i){var n,r;return t&&void 0!==Tp?Tp:i&&!H.isNullOrUndefined(i.rowOffsetHeight)?i.rowOffsetHeight:(H.isNullOrUndefined(Dp)||!H.isNullOrUndefined(i))&&((n=H.createElement("table",{className:Ds,attrs:{role:"grid"}})).style.visibility="hidden",n.innerHTML='<tr><td class="e-rowcell">A<td></tr>',e.appendChild(n),r=n.querySelector("td").getBoundingClientRect(),e.removeChild(n),Tp=r.height,Dp=Math.ceil(r.height),i&&(i.rowOffsetHeight=Dp),t)?Tp:Dp}function Fp(e){return 1<e.split(".").length}function Mp(e){return(e=void 0===e?"":e).replace(/\./g,"___")}function kp(e){return(e=void 0===e?"":e).replace(/[^a-zA-Z0-9_.]/g,"\\$&").replace(/^(\d)/,"\\3$1 ")}function Pp(e){return(e=void 0===e?"":e).replace(/___/g,".")}function Lp(e,t,i){i=I(i,Ts),i=!i||!i.classList.contains("e-insertedrow");return"beginEdit"===t&&i?!(e.isIdentity||e.isPrimaryKey||!e.allowEditing):!("add"===t&&e.isIdentity||i&&!e.allowEditing&&!e.isIdentity&&!e.isPrimaryKey)}function Np(e,t){return!(!t||!t.element||0!==t.element.offsetWidth)||0!==e.getBoundingClientRect().width}function Bp(e){var t=H.select("#"+e.element.id+"EditConfirm",e.element);return"Batch"===e.editSettings.mode&&(H.selectAll(".e-updatedtd",e.element).length||H.selectAll(".e-gridform.e-formvalidator",e.element).length)&&e.editSettings.showConfirmDialog&&(!t||t.classList.contains("e-popup-close"))}function zp(e,t){e=e instanceof Array?e:[e];for(var i=0;i<e.length;i++)t?e[parseInt(i.toString(),10)].classList.add("e-wrap"):e[parseInt(i.toString(),10)].classList.remove("e-wrap")}function qp(e,t){var i,n=e.getService("valueFormatter");switch("date"!==t.type&&"datetime"!==t.type&&"dateonly"!==t.type||(i={type:"dateonly"===t.type?"date":t.type,skeleton:t.format},"string"==typeof t.format&&"yMd"!==t.format&&(i.format=t.format)),t.type){case"date":case"dateonly":case"datetime":t.setFormatter(n.getFormatFunction(i)),t.setParser(n.getParserFunction(i));break;case"number":t.setFormatter(n.getFormatFunction({format:t.format})),t.setParser(n.getParserFunction({format:t.format}))}}function Up(e,t){for(var i=[],n=2;n<arguments.length;n++)i[n-2]=arguments[n];for(var r=0,s=e.length;r<s;r++){var o=e[parseInt(r.toString(),10)];t?(H.classList(o,i.slice(),[]),o.classList.contains("e-detailrowcollapse")||o.classList.contains("e-detailrowexpand")||o.setAttribute("aria-selected","true")):(H.classList(o,[],i.slice()),o.removeAttribute("aria-selected"))}}function Hp(e){for(var t={},i=[],n=0;n<e.length;n++)e[parseInt(n.toString(),10)]in t||(i.push(e[parseInt(n.toString(),10)].toString()),t[e[parseInt(n.toString(),10)]]=1);return i}function Vp(e,t,i){var n=t.element.style.display,r=(t.element.style.display="block",t.width),s=F.calculateRelativeBasedPosition(e,t.element),n=(t.element.style.display=n,t.element.style.top=s.top+e.getBoundingClientRect().height-5+"px",s.left-r+e.clientWidth);i&&i.enableRtl?(s=i.element?i.element.clientWidth:0,e=e.getBoundingClientRect().right+r-s,t.element.style.left=1<e?n-4+"px":r+n-16+"px",parseInt(t.element.style.left,10)<0&&(t.element.style.left="0px")):(t.element.style.left=n<1?r+n-16+"px":n-4+"px",i&&i.element&&(s=i.element.offsetWidth-parseInt(t.element.style.left,10),i.element.offsetWidth>=r)&&s<r&&(t.element.style.left=i.element.offsetWidth-r+"px"))}function jp(e,t){e.popup.element.style.zIndex=((t?t.zIndex:1e3)+1).toString()}function Gp(e,t){return e?e.element:H.closest(t,".e-flmenu")}function _p(e,t,i,n,r,s){H.isNullOrUndefined(i.filterTemplate)&&(i="","string"===n?i="strui-"+t:"number"===n?i="numberui-"+t:"boolean"===n?i="bool-ui-"+t:"date"!==n&&"datetime"!==n&&"dateonly"!==n||(i="dateui-"+t),n="in"===e||"notin"===e,e=I((t=r?r.element:s).querySelector("#multiselect"+i),"e-control-wrapper"),r=I(t.querySelector("#"+i),"e-popup-flmenu"),e&&(e.style.display=n?"inline-flex":"none"),r)&&(r.style.display=n?"none":"inline-flex")}function Kp(e){var e=e.querySelector(".e-frame"),t=e.previousSibling;e.classList.contains("e-check")?(t.checked=!1,H.classList(e,["e-uncheck"],["e-check"])):(t.checked=!0,H.classList(e,["e-check"],["e-uncheck"]))}function Wp(e,t){e.checked=t}function Qp(e,t,i){i=H.createElement("div",{className:i});return i.appendChild(t),i.setAttribute("data-uid",e),i}function Xp(e,t){H.removeClass([e],["e-check","e-stop","e-uncheck"]),t?e.classList.add("e-check"):e.classList.add("e-uncheck")}function Yp(e,t,i){for(var n=0;n<(H.isNullOrUndefined(t)?0:t.length);n++)H.setValue(t[parseInt(n.toString(),10)].field,$p(t[parseInt(n.toString(),10)],i),e.foreignKeyData);for(var r=e.cells,n=0;n<r.length;n++)r[parseInt(n.toString(),10)].isForeignKey&&H.setValue("foreignKeyData",H.getValue(r[parseInt(n.toString(),10)].column.field,e.foreignKeyData),r[parseInt(n.toString(),10)])}function $p(e,t,i,n){var r=e.foreignKeyField,t=H.isNullOrUndefined(i)?Jd(e.field,t):i,t=H.isNullOrUndefined(t)?"":t,i=new V.Query,n=n||(e.dataSource instanceof V.DataManager&&e.dataSource.dataSource.json.length?e.dataSource.dataSource.json:e.columnData);return t.getDay?i.where(ec({field:r,operator:"equal",value:t,matchCase:!1})):i.where(r,"==",t,!1),new V.DataManager(n).executeLocal(i)}function Zp(t,e){var i;return e.some(function(e){return(i=e).foreignKeyValue===t})&&i}function Jp(e){return e<10?"0"+e:String(e)}function ec(e,t){var i,n,r,s,o,a=H.extend({},fp(e)),l=H.extend({},fp(e));return H.isNullOrUndefined(e.value)||""===e.value?new V.Predicate(a.field,a.operator,a.value,!1):(n=new Date(e.value),r="dateonly"===t?("string"==typeof a.value&&(s=a.value.split(/[^0-9.]/),a.value=new Date(parseInt(s[0],10),parseInt(s[1],10)-1,parseInt(s[2],10))),s=a.value.getFullYear()+"-"+Jp(a.value.getMonth()+1)+"-"+Jp(a.value.getDate()),new V.Predicate(a.field,a.operator,s,!1)):(e.operator=e.operator.toLowerCase(),"equal"===e.operator||"notequal"===e.operator?("datetime"===t?(o=new Date(n.setSeconds(n.getSeconds()-1)),i=new Date(n.setSeconds(n.getSeconds()+2)),e.value=new Date(n.setSeconds(i.getSeconds()-1))):(o=new Date(n.setHours(0)-1),i=new Date(n.setHours(24))),a.value=o,l.value=i,"equal"===e.operator?(a.operator="greaterthan",l.operator="lessthan"):"notequal"===e.operator&&(a.operator="lessthanorequal",l.operator="greaterthanorequal"),s=new V.Predicate(a.field,a.operator,a.value,!1),o=new V.Predicate(l.field,l.operator,l.value,!1),"equal"===e.operator?s.and(o):s.or(o)):("date"!==t||"lessthanorequal"!==e.operator&&"greaterthan"!==e.operator||(a.value=new Date(n.setHours(24)-1)),"string"==typeof a.value&&(a.value=new Date(a.value)),new V.Predicate(a.field,a.operator,a.value,!1))),e.setProperties?e.setProperties({ejpredicate:r},!0):e.ejpredicate=r,r)}function tc(e){return e.enableVirtualization&&0<e.groupSettings.columns.length&&e.isVirtualAdaptive&&!e.groupSettings.enableLazyLoading}function N(e,t){if(e=void 0===e?"":e){for(var i,n=t,r=e.split("."),s=0;s<r.length&&!H.isNullOrUndefined(n);s++)n=n[r[parseInt(s.toString(),10)]],H.isUndefined(n)&&(n=t[""+(i=r[parseInt(s.toString(),10)].charAt(0).toUpperCase()+r[parseInt(s.toString(),10)].slice(1))]||t[(""+i).charAt(0).toLowerCase()+(""+i).slice(1)]);return n}}function ic(e,t){var i=new H.Internationalization,t="date"===t?"object"==typeof e?i.getDatePattern({type:e.type||"date",format:e.format},!1):i.getDatePattern({type:"dateTime",skeleton:e},!1):"object"==typeof e?i.getDatePattern({type:e.type||"dateTime",format:e.format},!1):i.getDatePattern({type:"dateTime",skeleton:e},!1);return t}function nc(e,t){for(var i={},n=0,r=e.getRowsObject();n<r.length;n++){var s,o=r[n];o.isExpand&&!o.isDetailRow&&(s=e.allowPaging&&"AllPages"===e.printMode?o.index+e.pageSettings.currentPage*e.pageSettings.pageSize-e.pageSettings.pageSize:o.index,H.isNullOrUndefined(s)||(i[parseInt(s.toString(),10)]={},i[parseInt(s.toString(),10)].isExpand=!0,e.childGrid&&(i[parseInt(s.toString(),10)].gridModel=rc(o.childGrid,t),i[parseInt(s.toString(),10)].gridModel.query=e.childGrid.query)))}return i}function rc(e,t){void 0===t&&(t="Expanded");var i={};if(e){for(var n=0,r=Yd.printGridProp;n<r.length;n++){var s=r[n];i[""+s]="columns"===s?vp(e[""+s]):"allowPaging"===s?"CurrentPage"===e.printMode:fp(e[""+s])}i.enableHover=!1,(e.childGrid||e.detailTemplate)&&"None"!==t&&(i.expandedRows=nc(e,t))}return i}function sc(e,t,i,n){var r=e||{},s=arguments.length;n&&(s-=1);for(var o=1;o<s;o++)if(arguments[parseInt(o.toString(),10)])for(var a=arguments[parseInt(o.toString(),10)],l=Object.keys(Object.getPrototypeOf(a)).length?Object.keys(a).concat(oc(a)):Object.keys(a),h=0;h<l.length;h++){var d=r[l[parseInt(h.toString(),10)]],p=a[l[parseInt(h.toString(),10)]],c=void 0;n&&(H.isObject(p)||Array.isArray(p))?H.isObject(p)?(c=d||{},r[l[parseInt(h.toString(),10)]]=H.extend({},c,p,n)):(c=d||[],r[l[parseInt(h.toString(),10)]]=H.extend([],c,p,n)):r[l[parseInt(h.toString(),10)]]=p}return r}function oc(e){for(var t=[];Object.getPrototypeOf(e)&&Object.keys(Object.getPrototypeOf(e)).length;)t=t.concat(Object.keys(Object.getPrototypeOf(e))),e=Object.getPrototypeOf(e);return t}function ac(e){for(var t=0,i=0;i<(H.isNullOrUndefined(e)?0:e.length);i++){var n=lc(e[parseInt(i.toString(),10)],0);t<n&&(t=n)}return t+1}function lc(e,t){var i=t,n=[];if(e.columns){t++;for(var r=0;r<e.columns.length;r++)n[parseInt(r.toString(),10)]=lc(e.columns[parseInt(r.toString(),10)],t);for(var s=0;s<n.length;s++)i<n[parseInt(s.toString(),10)]&&(i=n[parseInt(s.toString(),10)]);t=i}return t}function hc(e,t){for(var i=0;i<t.length;i++)t[parseInt(i.toString(),10)].uid=(t[parseInt(i.toString(),10)].isForeignKey?Zp(t[parseInt(i.toString(),10)].field,e.getForeignKeyColumns()):e.enableColumnVirtualization?Xc(e,t[parseInt(i.toString(),10)].field):e.getColumnByField(t[parseInt(i.toString(),10)].field)).uid}function dc(e){e=document.defaultView.getComputedStyle(e,null).getPropertyValue("transform").replace(/,/g,"");return{width:parseFloat(e.split(" ")[4]),height:parseFloat(e.split(" ")[5])}}function pc(e,t){e.classList.contains("e-bigger")&&t.classList.add("e-bigger")}function cc(e){e=e.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?Op():0}function uc(e,t){for(var i=0,n=e.getColumns(),r=30*t,s=(e.isRowDragable()&&(i++,r+=30),i+=e.groupSettings.columns.length-t,r+=30*(e.groupSettings.columns.length-t),("auto"===e.width?e.element.offsetWidth:-1!==e.width.toString().indexOf("%")?e.element.getBoundingClientRect().width:parseInt(e.width.toString(),10))-cc(e)),o=0;o<n.length;o++)if(n[parseInt(o.toString(),10)].visible&&(r+=fc(n[parseInt(o.toString(),10)],e),i++),s<r){i--;break}return i}function gc(e,t){for(var i=0,n=0,r=t.getVisibleFrozenLeftCount(),s=0;s<e.childNodes.length;s++){var o,a=e.childNodes[parseInt(s.toString(),10)];if(r===n)break;if((a.classList.contains("e-groupcaption")||a.classList.contains("e-summarycell"))&&(n+=parseInt(a.getAttribute("colspan"),10)),a.classList.add("e-leftfreeze"),a.classList.contains("e-groupcaption")&&1===parseInt(a.getAttribute("colspan"),10)&&a.classList.add("e-freezeleftborder"),Lc(a,i,t.enableRtl,"Left"),(a.classList.contains("e-indentcell")||a.classList.contains("e-recordplusexpand")||a.classList.contains("e-recordpluscollapse"))&&(i+=30),a.classList.contains("e-groupcaption"))for(var l=parseInt(a.getAttribute("colspan"),10),h=(t.isRowDragable()&&(l--,i+=30),l-=t.groupSettings.columns.length-s,i+=30*(t.groupSettings.columns.length-s),t.getColumns()),d=0;d<h.length;d++){if(1<parseInt(a.getAttribute("colspan"),10)&&fc(h[parseInt(d.toString(),10)],t)+i>parseInt(t.width.toString(),10)-cc(t)){var p=uc(t,s);a.setAttribute("colspan",p.toString());break}if(h[parseInt(d.toString(),10)].visible&&(i+=fc(h[parseInt(d.toString(),10)],t),l--),0===l)break}a.classList.contains("e-summarycell")&&(o=a.getAttribute("data-mappinguid"),i+=fc(t.getColumnByUid(o),t))}}function fc(e,t){return H.isNullOrUndefined(e.width)||"auto"===e.width||-1!==e.width.toString().indexOf("%")?(t=t.getColumnHeaderByField(e.field),H.isNullOrUndefined(t)?0:t.getBoundingClientRect().width):parseInt(e.width.toString(),10)}function mc(e,t){var i=t.getContent().firstElementChild;return e&&e.getBoundingClientRect().top-i.getBoundingClientRect().top+t.getRowHeight()>i.offsetHeight}function yc(e,t,i){return i&&i.isRowDomVirtualization()?(i=i.getContent().firstElementChild,e&&e.getBoundingClientRect().top-i.getBoundingClientRect().top<0):e&&e.getBoundingClientRect().top<t}function vc(e,t){var i=t.getRowHeight(),n=t.getContent().firstElementChild.scrollTop/i;return e<n+t.getContent().firstElementChild.offsetHeight/i&&n<e}function Sc(e,i){var n,r=e.getPrimaryKeyFieldNames()[0];return e.getCurrentViewRecords().filter(function(e,t){r.includes(".")?N(r,e)===N(r,i)&&(n=t):e&&i&&e[""+r]===i[""+r]&&(n=t)}),n}function Cc(e,t){var t=wc(t),i=new V.Deferred;return t.dataSource=i.resolve,t.action=e,{state:t,deffered:i}}function wc(e){var t=new V.UrlAdaptor,i=new V.DataManager({url:"",adaptor:new V.UrlAdaptor}),t=t.processQuery(i,e);return JSON.parse(t.data)}function bc(e){for(var t=e.getVisibleColumns(),i=0,n=0,r=0;r<t.length;r++)H.isUndefined(t[parseInt(r.toString(),10)].width)?n++:-1!==t[parseInt(r.toString(),10)].width.toString().indexOf("%")&&i++;return("auto"===e.width||"string"==typeof e.width&&-1!==e.width.indexOf("%"))&&!e.groupSettings.showGroupedColumn&&e.groupSettings.columns.length&&i&&!n}function Ic(e,t,i,n,r){for(var s=n||0,o=e.serviceLocator.getService("cellRendererFactory").getCellRenderer(oe.CellType.Data),a=r||0;a<t.length;a++){var l=t[parseInt(a.toString(),10)],h=i[parseInt(a.toString(),10)];if(l&&l.isDataRow){l.index=s,l.isAltRow=!!e.enableAltRow&&s%2!=0,h.setAttribute(D,(s+1).toString()),l.isAltRow?h.classList.add("e-altrow"):h.classList.remove("e-altrow");for(var d=0;d<h.cells.length;d++)h.cells[parseInt(d.toString(),10)].setAttribute("data-index",s.toString());var p,c=h.querySelector("."+ys);c&&(p=(l=l).cells.filter(function(e){return"rownumber"===e.column.type})).length&&!H.isNullOrUndefined(p[0])&&o.refreshTD(c,p[0],l.data,{"data-index":s}),s++}}t.length||e.renderModule.emptyRow(!0)}function Rc(e){for(var t=e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache?e.getRowsObject():e.vRows,i=e.getRows(),n=e.serviceLocator.getService("cellRendererFactory").getCellRenderer(oe.CellType.Data),r=0,s=0,o=0;r<t.length;r++){var a=t[parseInt(r.toString(),10)];if(a.isDataRow){a.index=s,a.isAltRow=!!e.enableAltRow&&s%2!=0;var l=e.getRowElementByUID(a.uid);if(!H.isNullOrUndefined(l)){(i[parseInt(o.toString(),10)]=l).setAttribute(D,(s+1).toString()),a.isAltRow?l.classList.add("e-altrow"):l.classList.remove("e-altrow");for(var h=0;h<l.cells.length;h++)l.cells[parseInt(h.toString(),10)].setAttribute("data-index",s.toString());var d,p=l.querySelector("."+ys);p&&(d=a.cells.filter(function(e){return"rownumber"===e.column.type})).length&&!H.isNullOrUndefined(d[0])&&n.refreshTD(p,d[0],a.data,{"data-index":s}),o++}s++}}e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache&&e.infiniteScrollModule.resetInfiniteCache(t)}function xc(e,t,i,n){for(var r,s=e.enableVirtualization?e.vRows:e.getRowsObject(),o=[],a=n||e.getRowObjectFromUID(t.target.closest("tr").getAttribute("data-uid")),l=0;l<t.rows.length;l++){var h=e.getRowObjectFromUID(t.rows[parseInt(l.toString(),10)].getAttribute("data-uid"));a===h&&(r=s.indexOf(a)),o.push(s.splice(s.indexOf(h),1)[0])}if(!H.isNullOrUndefined(r)||(r=s.indexOf(a),t.fromIndex>t.dropIndex)?s.splice.apply(s,[r,0].concat(o)):s.splice.apply(s,[r+1,0].concat(o)),!e.enableVirtualization&&!e.infiniteScrollSettings.enableCache){for(var d={},p=e.getCurrentViewRecords(),l=0,c=i.length;l<c;l++){var u=parseInt(i[parseInt(l.toString(),10)].getAttribute(D),10)-1-e.pinnedTopRowModels.length;d[parseInt(l.toString(),10)]=p[parseInt(u.toString(),10)]}for(var g=e.getRows(),l=0,c=i.length;l<c;l++)g[parseInt(l.toString(),10)]=i[parseInt(l.toString(),10)],p[parseInt(l.toString(),10)]=d[parseInt(l.toString(),10)]}e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache&&e.infiniteScrollModule.resetInfiniteCache(s)}function Dc(e,t,i,n){var r=e.dataToBeUpdated[""+i].concat(t[""+i]).reduce(function(e,t){return e[t[""+n]]=void 0===e[t[""+n]]?t:Object.assign(e[t[""+n]],t),e},{});e.dataToBeUpdated[""+i]=Object.keys(r).map(function(e){return r[""+e]})}function Tc(e){e.enableInfiniteScrolling&&(e.childGrid||e.detailTemplate)?e.contentModule.rowElements=[].slice.call(e.getContentTable().rows).filter(function(e){return(e.classList.contains("e-row")||e.classList.contains("e-detailrow"))&&!e.classList.contains("e-addedrow")}):e.contentModule.rowElements=[].slice.call(e.element.querySelectorAll(".e-row:not(.e-addedrow):not(.e-cloneproperties .e-row)"))}function Ec(e,t){Oc(e)&&(t.target=e.element.closest("mat-dialog-container"))}function Oc(e){return e&&e.isAngular&&e.element&&(!H.isNullOrUndefined(e.element.closest("mat-dialog-container"))||!H.isNullOrUndefined(e.element.closest("cdk-dialog-container")))}function Ac(e,t,i){var n=e.createElement("div",{className:"e-grid-popup",id:e.element.id+"_e-popup"}),r=F.calculatePosition(e.element,"left","Top"),s=(document.getElementById(e.element.id+"_e-popup")&&(n=document.getElementById(e.element.id+"_e-popup")),t.dlgContainer);t.isModal&&s&&t.element.classList.contains("e-ccdlg")?(n.appendChild(t.element),s.appendChild(n),document.body.insertBefore(s,document.body.firstChild)):(n.style.top=r.top+"px",n.style.left=r.left+"px",n.style.zIndex=t.zIndex.toString(),n.style.width=H.isNullOrUndefined(i)?t.element.offsetWidth+"px":i+"px",n.appendChild(t.element),(s=e.element.closest(".sb-demo-section,.e-grid-dialog-fixed"))?(r=F.calculateRelativeBasedPosition(e.element,s),n.style.top=r.top+"px",n.style.left=r.left+"px",s.insertBefore(n,s.firstChild)):Oc(e)?(i=e.element.closest("mat-dialog-container"))&&i.insertBefore(n,i.firstChild):document.body.insertBefore(n,document.body.firstChild))}function Fc(e,t){var i=[];return i.push(e.uid),Mc(e,i),-1<i.indexOf(t)}function Mc(e,t){for(var i=0;i<e.columns.length;i++)e.columns[parseInt(i.toString(),10)].uid&&t.push(e.columns[parseInt(i.toString(),10)].uid),e.columns[parseInt(i.toString(),10)].columns&&e.columns[parseInt(i.toString(),10)].columns.length&&Mc(e.columns[parseInt(i.toString(),10)],t)}function kc(e){return e.columns[0].freeze||e.columns[0].isFrozen?"Left"===e.columns[0].freeze||e.columns[0].isFrozen?"Left":"Right"===e.columns[0].freeze?"Right":"Fixed"===e.columns[0].freeze?"Fixed":"None":e.columns[0].columns&&e.columns[0].columns.length?kc(e.columns[0]):"None"}function Pc(e){if(e.querySelector(".e-fixedfreeze"))for(var t=[].slice.call(e.querySelectorAll(".e-filterbarcell:not(.e-hide),.e-summarycell:not(.e-hide),.e-headercell:not(.e-hide),.e-rowcell:not(.e-hide)")),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].classList.contains("e-fixedfreeze")&&(!t[i-1]||t[i-1]&&!t[i-1].classList.contains("e-fixedfreeze"))&&t[parseInt(i.toString(),10)].classList.add("e-freezeleftborder"),t[parseInt(i.toString(),10)].classList.contains("e-fixedfreeze")&&(!t[i+1]||t[i+1]&&!t[i+1].classList.contains("e-fixedfreeze"))&&t[parseInt(i.toString(),10)].classList.add("e-freezerightborder")}function Lc(e,t,i,n){"Left"===n&&(i?e.style.right=t+"px":e.style.left=t+"px"),"Right"===n&&(i?e.style.left=t+"px":e.style.right=t+"px")}function Nc(e,t,i,n){var r=e.getColumns(),s=t.index;if("Left"===t.freeze&&"Left"!==t.border){for(var o=s+(n-1);!1===r[parseInt(o.toString(),10)].visible;)o++;"Left"===r[parseInt(o.toString(),10)].border&&i.classList.add("e-freezeleftborder")}else if("Right"===t.freeze||"Fixed"===t.freeze){for(var a=0,l=s+1;l<s+n&&l!==r.length;l++)r[parseInt(l.toString(),10)].visible?a+=parseInt(r[parseInt(l.toString(),10)].width.toString(),10):n++;e.enableRtl?i.style.left=parseInt(i.style.left,10)-a+"px":i.style.right=parseInt(i.style.right,10)-a+"px"}}function Bc(e,t,i){for(var n=e.getRowByIndex(t),r=0;r<n.cells.length;r++)if(parseInt(n.cells[parseInt(r.toString(),10)].getAttribute("aria-colindex").toString(),10)-1===i)return n.cells[parseInt(r.toString(),10)];return null}function zc(e,t,i){if("Left"===t.freeze||t.isFrozen)if(i.classList.add("e-leftfreeze"),"Left"===t.border&&i.classList.add("e-freezeleftborder"),0===t.index)Lc(i,30*e.getIndentCount(),e.enableRtl,"Left"),e.enableColumnVirtualization&&(t.valueX=30*e.getIndentCount());else{for(var n=e.getColumns(),r=30*e.getIndentCount(),s=0;s<n.length&&t.uid!==n[parseInt(s.toString(),10)].uid;s++)n[parseInt(s.toString(),10)].visible&&(r+=parseFloat(n[parseInt(s.toString(),10)].width.toString()));Lc(i,r,e.enableRtl,"Left"),e.enableColumnVirtualization&&(t.valueX=r)}else if("Right"===t.freeze){i.classList.add("e-rightfreeze");n=e.getColumns();if("Right"===t.border&&i.classList.add("e-freezerightborder"),t.index===n[n.length-1].index)Lc(i,r="Right"===e.getFrozenMode()&&e.isRowDragable()?30:0,e.enableRtl,"Right");else{for(r="Right"===e.getFrozenMode()&&e.isRowDragable()?30:0,s=n.length-1;0<=s&&t.uid!==n[parseInt(s.toString(),10)].uid;s--)n[parseInt(s.toString(),10)].visible&&(r+=parseFloat(n[parseInt(s.toString(),10)].width.toString()));Lc(i,r,e.enableRtl,"Right")}e.enableColumnVirtualization&&(t.valueX=r)}else if("Fixed"===t.freeze){i.classList.add("e-fixedfreeze");n=e.getColumns(),r=0;e.getVisibleFrozenLeftCount()?r=30*e.getIndentCount():"Right"===e.getFrozenMode()&&(r=30*e.groupSettings.columns.length);for(s=0;s<n.length&&t.uid!==n[parseInt(s.toString(),10)].uid;s++)("Left"===n[parseInt(s.toString(),10)].freeze||n[parseInt(s.toString(),10)].isFrozen||"Fixed"===n[parseInt(s.toString(),10)].freeze)&&n[parseInt(s.toString(),10)].visible&&(r+=parseFloat(n[parseInt(s.toString(),10)].width.toString()));Lc(i,r-1,e.enableRtl,"Left"),r="Right"===e.getFrozenMode()&&e.isRowDragable()?30:0;for(s=n.length-1;0<=s&&t.uid!==n[parseInt(s.toString(),10)].uid;s--)"Right"!==n[parseInt(s.toString(),10)].freeze&&"Fixed"!==n[parseInt(s.toString(),10)].freeze||n[parseInt(s.toString(),10)].visible&&(r+=parseFloat(n[parseInt(s.toString(),10)].width.toString()));Lc(i,r-1,e.enableRtl,"Right")}else i.classList.add("e-unfreeze")}function qc(e,t,i){var n={rowIndex:i,elements:null};return e.notify("get-row-cells",n),n.elements||(e.isRowDomVirtualization()?(n=e.getRowByIndex(i))?[].slice.call(n.getElementsByClassName(b)):[]:[].slice.call(e.getDataRows()[parseInt(i.toString(),10)].getElementsByClassName(b)))}function Uc(e,t,i,n){return qc(e,0,i)[parseInt(n.toString(),10)]}function Hc(e,t,i,n,r,s,o){o||e.getFreezeTableName()===Bs||!t&&e.getFreezeTableName()===Ns||1===s?i[Mp(e.field)]=e.validationRules:"movable"!==e.getFreezeTableName()&&e.getFreezeTableName()?e.getFreezeTableName()===Ns&&(r[Mp(e.field)]=e.validationRules):n[Mp(e.field)]=e.validationRules}function Vc(t,i,n,e){var r,s,o=new H.Internationalization;if("number"===i)try{s=o.getNumberPattern({format:t,currency:e,useGrouping:!0},!0)}catch(e){s=t}else if("date"===i||"time"===i||"datetime"===i)try{if(s=o.getDatePattern({skeleton:t,type:i},n),H.isNullOrUndefined(s))throw"error"}catch(e){try{s=o.getDatePattern({format:t,type:i},n)}catch(e){s=t}}else s=t;return"number"!==i&&(r={G:"",H:"h",c:"d","'":'"'," a":" AM/PM",yy:"yy",y:"yyyy",EEEE:"dddd",E:"ddd"},s=s.replace(/G|H|c|'| a|yy|y|EEEE|E/g,function(e){return r[""+e]})),s}function jc(e){if(e.enableAdaptiveUI)for(var t=document.getElementsByClassName("e-responsive-dialog"),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].classList.add("e-bigger")}function Gc(e,t){for(var i,n=e.split(".").length,r=e.split("."),s=t,o=0;o<n;o++)s=i=s[r[parseInt(o.toString(),10)]];return i}function _c(e,t,i,n,r,s){for(var o=Object.keys(e),a=t,l=0;l<o.length;l++){var h=e[o[parseInt(l.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)];if(r&&!r.isFrozenGrid()&&!r.isRowDragable()){if(h=!H.isNullOrUndefined(h)&&(parseInt(h.getAttribute("aria-colindex"),10)-1===t||I(h,"e-addedrow")&&h.parentElement.childNodes[parseInt(t.toString(),10)]===h)?h:e[parseInt(l.toString(),10)].querySelector('td[aria-colindex="'+(t+1)+'"]'),H.isNullOrUndefined(h))continue;t=r.getContentTable().querySelector(".e-detailrowcollapse, .e-detailrowexpand")?h.cellIndex-1:h.cellIndex}e[o[parseInt(l.toString(),10)]].querySelectorAll("td.e-rowcell").length&&h&&(H.setStyleAttribute(e[o[parseInt(l.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)],{display:i}),e[o[parseInt(l.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)].classList.contains("e-hide")&&H.removeClass([e[o[parseInt(l.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)]],["e-hide"]),s&&r.isRowDragable()||r&&r.isDetail()?(h=t+1,n[o[parseInt(l.toString(),10)]].cells[parseInt(h.toString(),10)].visible=""===i):H.isNullOrUndefined(n[o[parseInt(l.toString(),10)]])||(n[o[parseInt(l.toString(),10)]].cells[parseInt(t.toString(),10)].visible=""===i,!1===n[o[parseInt(l.toString(),10)]].cells[parseInt(t.toString(),10)].visible&&e[o[parseInt(l.toString(),10)]].querySelectorAll("td.e-rowcell")[parseInt(t.toString(),10)].classList.add("e-hide")),t=a)}}function Kc(e,t,i,n){for(var r=0,s=t;r<s.length;r++){var o=s[r];i?e.on(o.event,o.handler,n):e.off(o.event,o.handler)}}function Wc(e,t,i,n){var r=Mp(t.field);return n=Object.assign(n,{id:e.element.id+r,name:r,"data-mappinguid":t.uid}),e.createElement("input",{className:i,attrs:n})}function Qc(e,t){for(var i,n=0,r=e.columnModel;n<r.length;n++){var s=r[n];if(s.uid===t){i=s;break}}return i}function Xc(e,t){var i;e.columnModel||e.getColumns();for(var n=0,r=e.columnModel;n<r.length;n++){var s=r[n];if(s.field===t){i=s;break}}return i}function Yc(e,t,i,n){n.eventHandlers[""+e]={};for(var r=0;r<t.length;r++)n.eventHandlers[""+e][t[parseInt(r.toString(),10)]]=i[t[parseInt(r.toString(),10)]]}function $c(e,t,i){for(var n=0;n<t.length&&!e.isDestroyed;n++)e.removeEventListener(t[parseInt(n.toString(),10)],i.eventHandlers[e.element.id][t[parseInt(n.toString(),10)]])}function Zc(e,t,i){e.destroyTemplate(t,void 0,i),e.isReact&&e.renderTemplates()}function Jc(e){for(var t=0;t<e.length;t++)H.remove(e[t])}function eu(e,t){for(var i=0;i<e.length;i++)t.insertBefore(e[i],t.children[i])}function tu(e,t){var i=t?H.createElement("li",{className:"e-cclist"}):H.createElement("div",{className:"e-ftrchk"}),t=(i.style.visibility="hidden",t&&(i.style.listStyle="none"),i.innerHTML=t?'<div class="e-ccheck"><div class="e-checkbox-wrapper"><span class="e-frame e-icons e-check"></span><span class="e-label">A</span></div></div>':'<div class="e-checkbox-wrapper"><span class="e-frame e-icons e-check"></span><span class="e-label e-checkboxfiltertext">A</div></span>',e.appendChild(i),i.getBoundingClientRect());return e.removeChild(i),Math.round(t.height)}function iu(e){return parseInt(e.getAttribute(D),10)-1}function nu(e){return e.parentDetails&&e.parentDetails.parentInstObj?nu(e.parentDetails.parentInstObj):e}function ru(e,t,i){for(var n=[],r=0;r<e.length;r++){var s=i.parent.getColumnByField(e[parseInt(r.toString(),10)]),o="null"===t[parseInt(r.toString(),10)]?null:t[parseInt(r.toString(),10)],s={field:e[parseInt(r.toString(),10)],predicate:"or",uid:s.uid,operator:"equal",type:s.type,matchCase:i.allowCaseSensitive,ignoreAccent:i.parent.filterSettings.ignoreAccent};""===o||H.isNullOrUndefined(o)?n=n.concat(Su.generateNullValuePredicates(s)):n.push(pp({},{value:o},s))}return Su.getPredicate(n)}function su(e){for(var t=[],i=0,n=Object.keys(e);i<n.length;i++){var r=n[i];t.push(e[""+r])}return t}function ou(e,t){for(var i=[],n=[],r=e;0<=r&&(!t[parseInt(r.toString(),10)].isCaptionRow||-1!==i.indexOf(t[parseInt(r.toString(),10)].data.field)||!(t[parseInt(r.toString(),10)].indent<t[parseInt(e.toString(),10)].indent||r===e)||(i.push(t[parseInt(r.toString(),10)].data.field),n.push(t[parseInt(r.toString(),10)].data.key),0!==t[parseInt(r.toString(),10)].indent));r--);return{fields:i,keys:n}}function au(e,t,i){var n=e,r=t,s=!1;if(i)for(var o=r[0];o<n.length;o++)for(var a=n[parseInt(o.toString(),10)],l=0;l<a.length;l++){if(s&&1===n[parseInt(o.toString(),10)][parseInt(l.toString(),10)])return r=[o,l];s||r.toString()!==[o,l].toString()||(s=!0)}else for(o=r[0];0<=o;o--)for(l=(a=n[parseInt(o.toString(),10)]).length-1;0<=l;l--){if(s&&1===n[parseInt(o.toString(),10)][parseInt(l.toString(),10)])return r=[o,l];s||r.toString()!==[o,l].toString()||(s=!0)}return r}function lu(e){return e.charAt(0).toUpperCase()+e.slice(1)}function hu(e){return!(tc(e)||e.groupSettings.enableLazyLoading||!e.enableVirtualization&&e.enableColumnVirtualization)}function du(e){for(var t=[],i=0;i<e.length;i++){var n=Math.ceil(e[parseInt(i.toString(),10)]/2);-1===t.indexOf(n)&&t.push(n)}return t}function pu(e){var t;return e.isTreeGrid?(t=e.getDataModule().dataManager.executeLocal(e.getDataModule().generateQuery(!0)),e.notify("partial-filter-update",{gridFiltered:t}),e.root.filterModule&&0<e.root.filterModule.filteredResult.length?e.root.filterModule.filteredResult:t):e.getDataModule().dataManager.executeLocal(e.getDataModule().generateQuery(!0))}(oe.Global||(oe.Global={})).timer=null;var cu=!1;function uu(){return cu}function gu(e){cu=e}function fu(e){e=e.toString().trim().match(/^([\d.]+)(vh)?$/i);return window.innerHeight*parseFloat(e[1])/100}function mu(e){for(var t="",i=e;0<=i;)t=String.fromCharCode(65+i%26)+t,i=Math.floor(i/26)-1;return t}function yu(e,t){var i,n=[];return t.length&&((i=document.createElement("div")).className="e-footer-content",t.forEach(function(e){var t=document.createElement("button");i.appendChild(t),n.push(new M.Button({content:e.content,cssClass:e.cssClass,isPrimary:e.isPrimary},t)),H.EventHandler.add(t,"click",e.click)}),e.appendChild(i)),n}function vu(t,e,i){e.forEach(function(e){e.isDestroyed||e.destroy()}),(e=t.classList).remove.apply(e,i.concat(["e-excelfilter","e-rtl"])),["id","aria-label","data-uid"].forEach(function(e){return t.removeAttribute(e)}),t.innerHTML=""}v.prototype.destroy=function(){this.closeDialog()},v.prototype.isImmediateMode=function(){return this.parent&&this.parent.filterSettings&&"Immediate"===this.parent.filterSettings.mode},v.prototype.getDialogButtons=function(){return this.isImmediateMode()?"CheckBox"===this.parent.filterSettings.type?[{click:this.btnClick.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",content:this.getLocalizedLabel("ClearButton")}}]:(this.dialogObj&&(this.dialogObj.footerTemplate=null),null):[{click:this.btnClick.bind(this),buttonModel:{content:this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton"),cssClass:this.parent.cssClass?"e-primary "+this.parent.cssClass:"e-primary",isPrimary:!0}},{click:this.btnClick.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",content:this.getLocalizedLabel(this.isExcel?"CancelButton":"ClearButton")}}]},v.prototype.getDialogCssClass=function(){var e=this.parent.cssClass||"";return this.isImmediateMode()?e?"e-dialog-immediate-mode "+e:"e-dialog-immediate-mode":e},v.prototype.wireEvents=function(){H.EventHandler.add(this.dlg,"click",this.clickHandler,this),H.EventHandler.add(this.dlg,"keyup",this.keyupHandler,this),this.searchHandler=H.debounce(this.searchBoxKeyUp,200);var e=this.getDlgElement().querySelector(".e-searchinput");e&&(H.EventHandler.add(e,"keyup",this.searchHandler,this),H.EventHandler.add(e,"input",this.searchHandler,this))},v.prototype.unWireEvents=function(){H.EventHandler.remove(this.dlg,"click",this.clickHandler),H.EventHandler.remove(this.dlg,"keyup",this.keyupHandler);var e=this.getDlgElement().querySelector(".e-searchinput");e&&(H.EventHandler.remove(e,"keyup",this.searchHandler),H.EventHandler.remove(e,"input",this.searchHandler))},v.prototype.foreignKeyFilter=function(n,r,e){var s=this,o={},a=[],t=this.foreignKeyQuery.clone();this.options.column.dataSource.executeQuery(t.where(e)).then(function(e){s.options.column.columnData=e.result,s.parent.notify(Ui,{predicate:o,column:s.options.column}),n.ejpredicate=o.predicate.predicates;for(var t=o.predicate.predicates,i=0;i<t.length;i++)a.push({field:t[parseInt(i.toString(),10)].field,predicate:"or",matchCase:t[parseInt(i.toString(),10)].ignoreCase,ignoreAccent:t[parseInt(i.toString(),10)].ignoreAccent,operator:t[parseInt(i.toString(),10)].operator,value:t[parseInt(i.toString(),10)].value,type:s.options.type});n.filterCollection=a.length?a:r.filter(function(e){return e.field=s.options.field}),s.options.handler(n)})},v.prototype.searchBoxClick=function(e){var t=e.target;t.classList.contains("e-searchclear")&&(this.sInput.value=t.classList.contains("e-chkcancel-icon")?"":this.sInput.value,this.isCheckboxFilterTemplate?this.parent.notify("refreshCheckbox",{event:e}):(this.parent.filterSettings&&this.isImmediateMode()&&(this.searchClear=!0),this.refreshCheckboxes()),this.updateSearchIcon(),this.sInput.focus())},v.prototype.searchBoxKeyUp=function(e){this.isImmediateMode()&&this.sInput&&""===this.sInput.value&&(this.searchClear=!0,this.parent.clearFiltering([this.options.field])),H.isNullOrUndefined(this.sInput)||!H.isNullOrUndefined(e)&&("ArrowUp"===e.key||"ArrowDown"===e.key||"Tab"===e.key||"Tab"===e.key&&e.shiftKey)||(H.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||this.parent.showMaskRow(void 0,this.getDlgElement()),this.isCheckboxFilterTemplate?this.parent.notify("refreshCheckbox",{event:e}):this.refreshCheckboxes(),this.updateSearchIcon())},v.prototype.updateSearchIcon=function(){this.sInput.value.length?(H.classList(this.sIcon,["e-chkcancel-icon"],["e-search-icon"]),H.isNullOrUndefined(document.body.querySelector(".e-chkcancel-icon"))||document.body.querySelector(".e-chkcancel-icon").setAttribute("title",this.localeObj.getConstant("Clear"))):(H.classList(this.sIcon,["e-search-icon"],["e-chkcancel-icon"]),H.isNullOrUndefined(document.body.querySelector(".e-searchclear.e-search-icon"))||document.body.querySelector(".e-searchclear.e-search-icon").setAttribute("title",this.localeObj.getConstant("Search")))},v.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},v.prototype.updateDataSource=function(){var e=this.options.dataSource;if(!(e instanceof V.DataManager))for(var t,i=0;i<e.length;i++)"object"!=typeof e&&((t={})[this.options.field]=e[parseInt(i.toString(),10)],e[parseInt(i.toString(),10)]=t)},v.prototype.updateModel=function(e){this.options=e,this.existingPredicate=e.actualPredicate||{},this.options.dataSource=e.dataSource,this.options.dataManager=e.dataManager||e.dataSource,this.updateDataSource(),this.options.type=e.type,this.options.format=e.format||"",this.options.ignoreAccent=e.ignoreAccent||!1,this.options.filteredColumns=e.filteredColumns||this.parent.filterSettings.columns,this.options.query=e.query||new V.Query,this.options.allowCaseSensitive=e.allowCaseSensitive||!1,this.options.uid=e.column.uid,this.options.disableHtmlEncode=e.column.disableHtmlEncode||!1,this.values={},this.localeObj=e.localeObj,this.isFiltered=e.filteredColumns.length,this.infiniteRenderMod=!(!this.parent.filterSettings||!this.parent.filterSettings.enableInfiniteScrolling),this.infiniteUnloadParentExistPred=this.infiniteRenderMod&&this.existingPredicate[this.options.column.field]?this.existingPredicate[this.options.column.field].slice():[]},v.prototype.getAndSetChkElem=function(e){return this.dlg=this.parent.createElement("div",{id:this.id+this.options.type+"_excelDlg",attrs:{"data-uid":this.options.column.uid},className:"e-checkboxfilter e-filter-popup"}),this.sBox=this.parent.createElement("div",{className:"e-searchcontainer"}),e.hideSearchbox||(this.sInput=this.parent.createElement("input",{id:this.id+"_SearchBox",className:"e-searchinput"}),this.sIcon=this.parent.createElement("span",{className:"e-searchclear e-search-icon e-icons e-input-group-icon",attrs:{type:"text",title:this.getLocalizedLabel("Search")}}),this.searchBox=this.parent.createElement("span",{className:"e-searchbox e-fields"}),this.searchBox.appendChild(this.sInput),this.sBox.appendChild(this.searchBox),this.searchInputArgs={element:this.sInput,floatLabelType:"Never",properties:{placeholder:this.getLocalizedLabel("Search"),cssClass:this.parent.cssClass}},k.Input.createInput(this.searchInputArgs,this.parent.createElement),this.searchBox.querySelector(".e-input-group").appendChild(this.sIcon)),this.spinner=this.parent.createElement("div",{className:"e-spinner"}),this.cBox=this.parent.createElement("div",{id:this.id+this.options.type+"_CheckBoxList",className:"e-checkboxlist e-fields"}),this.spinner.appendChild(this.cBox),this.sBox.appendChild(this.spinner),this.sBox},v.prototype.showDialog=function(e){var t={requestType:lt,columnName:this.options.field,columnType:this.options.type,cancel:!1};if((t.filterModel=this).parent.notify(fn,t),t.cancel)e.cancel=t.cancel;else{if(e.isToolPanel?this.renderToolPanel(e):(this.dialogObj=new F.Dialog({visible:!1,content:this.sBox,close:this.closeDialog.bind(this),enableRtl:this.parent.enableRtl,width:!H.isNullOrUndefined(I(e.target,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:255,target:this.parent.element,animationSettings:{effect:"None"},created:this.dialogCreated.bind(this),open:this.dialogOpen.bind(this),cssClass:this.getDialogCssClass()}),t=this.getDialogButtons(),this.dialogObj.buttons=t,this.dialogObj.isStringTemplate=!0,this.renderResponsiveFilter(e),t=this.parent.filterSettings&&"CheckBox"===this.parent.filterSettings.type?this.getLocalizedLabel("CheckBoxFilterDialogARIA"):this.getLocalizedLabel("ExcelFilterDialogARIA"),this.dlg.setAttribute("aria-label",t),(e.isResponsiveFilter?document.querySelector(".e-responsive-dialog > .e-dlg-content > .e-mainfilterdiv"):this.parent.element).appendChild(this.dlg),this.dialogObj.appendTo(this.dlg),this.dialogObj.element.style.maxHeight=e.isResponsiveFilter?"none":this.options.height+"px",this.dialogObj.show(),this.parent&&this.parent.filterSettings&&("CheckBox"===this.parent.filterSettings.type||this.options.column&&this.options.column.filter&&"CheckBox"===this.options.column.filter.type)&&this.parent.getContent().firstElementChild.offsetHeight<this.dialogObj.element.offsetHeight&&!I(this.parent.element,"e-gantt-dialog")&&Ac(this.parent,this.dialogObj),this.dialogObj.element.querySelector(".e-dlg-content").appendChild(this.sBox)),this.wireEvents(),this.parent.enableAdaptiveUI){if(this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator)return void this.getAllData();this.infiniteRenderMod&&(this.cBox.style.marginTop=tu(this.cBox)+"px")}else H.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||this.infiniteRenderMod||this.parent.showMaskRow(void 0,this.getDlgElement()),this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&this.showMask();this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator||(F.createSpinner({target:this.spinner,cssClass:this.parent.cssClass||null},this.parent.createElement),F.showSpinner(this.spinner)),this.getAllData()}},v.prototype.renderToolPanel=function(e){var e=e.target,t=(this.dlg=e,this.toolPanelClasses=["e-checkboxfilter","e-filter-popup"].concat(this.getDialogCssClass().split(" ")).filter(function(e){return!!e}),e.setAttribute("data-uid",this.options.column.uid),(t=e.classList).add.apply(t,this.toolPanelClasses),e.appendChild(this.sBox),this.getDialogButtons()||[]);this.toolPanelBtns=yu(e,t.map(function(e){return{content:e.buttonModel.content,cssClass:e.buttonModel.cssClass,isPrimary:e.buttonModel.isPrimary,click:e.click}}))},v.prototype.getDlgElement=function(){return this.dialogObj?this.dialogObj.element:this.dlg},v.prototype.getOkButton=function(){return this.options.isResponsiveFilter?null:this.options.isToolPanel?this.toolPanelBtns[0]||null:this.dialogObj.buttons.length?this.dialogObj.btnObj[0]:null},v.prototype.renderResponsiveFilter=function(e){e.isResponsiveFilter&&(this.dialogObj.buttons=[{}],this.dialogObj.position={X:"",Y:""},this.dialogObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv"),this.dialogObj.width="100%")},v.prototype.dialogCreated=function(e){this.options.isResponsiveFilter?this.dialogObj.element.style.left="0px":H.Browser.isDevice?this.dialogObj.position={X:"center",Y:"center"}:Vp(this.options.target,this.dialogObj,this.parent),this.options.column.showColumnMenu&&this.parent.notify(Ni,e)},v.prototype.openDialog=function(e){this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e)},v.prototype.closeDialog=function(){var e,t;this.infiniteRenderMod&&this.infinitePermenantLocalData.length&&!this.options.isRemote&&(this.options.dataSource.dataSource.json=this.infinitePermenantLocalData),(this.options&&this.options.isToolPanel?this.dlg:this.dialogObj&&!this.dialogObj.isDestroyed)&&(this.isBlanks=!1,t=this.options.columns.filter(function(e){return e.getFilterItemTemplate()}),e=this.parent.registeredTemplate,t.length&&!H.isNullOrUndefined(e)&&e.filterItemTemplate&&this.parent.destroyTemplate(["filterItemTemplate"]),(this.parent.isReact||this.parent.isVue)&&void 0!==this.parent.destroyTemplate&&Zc(this.parent,["filterItemTemplate"]),this.parent.notify(Bi,{field:this.options.field,element:this.getDlgElement(),isToolPanel:this.options.isToolPanel}),this.unWireEvents(),this.searchInputArgs&&this.searchInputArgs.element&&this.searchInputArgs.element.parentElement&&(k.Input.destroy(this.searchInputArgs),H.remove(this.searchInputArgs.element)),this.searchInputArgs=null,this.sInput=null,!this.parent.isReact||!this.options.column.filter||"string"==typeof this.options.column.filter.itemTemplate||this.options.isToolPanel||"CheckBox"!==this.options.column.filter.type&&"Excel"!==this.options.column.filter.type||(this.dialogObj.element.querySelector(".e-dlg-content").innerHTML=""),this.options.isToolPanel?(vu(this.dlg,this.toolPanelBtns,this.toolPanelClasses),this.toolPanelBtns=[]):this.dialogObj.destroy(),this.dialogObj&&"escape"===this.dialogObj.dlgClosedBy&&(this.parent.isColumnMenuFilterClosing=!0),this.dlg&&this.dlg.parentElement&&!this.options.isToolPanel&&(H.remove(this.dlg),this.parent&&this.parent.showColumnChooser||(t=document.getElementById(this.parent.element.id+"_e-popup"),H.isNullOrUndefined(t))||(H.remove(t),t=null)),this.dlg=null,this.parent.notify(ur,{}),this.options.isToolPanel)&&this.options.toolPanelClose&&this.options.toolPanelClose()},v.prototype.clearFilter=function(e){var t={instance:this,handler:this.clearFilter,cancel:!1};this.parent.notify(yn,t),t.cancel||this.options.handler({action:"clear-filter",field:(e||this.options).field})},v.prototype.btnClick=function(e){var t;this.filterState?("input"===e.target.tagName.toLowerCase()&&e.target.classList.contains("e-searchinput")||13===e.keyCode||(t=e.target.firstChild.textContent.toLowerCase(),this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton").toLowerCase()===t)?this.isCheckboxFilterTemplate||this.fltrBtnHandler():this.getLocalizedLabel("ClearButton").toLowerCase()===t&&this.clearFilter(),this.closeDialog()):e.target&&e.target.firstChild&&e.target.firstChild.textContent.toLowerCase()===this.getLocalizedLabel("CancelButton").toLowerCase()?this.closeDialog():"input"!==e.target.tagName.toLowerCase()&&(this.clearFilter(),this.closeDialog()),this.options.column.showColumnMenu&&this.parent.notify(Ur,{}),H.isNullOrUndefined(this.parent.focusModule)||this.parent.focusModule.filterfocus()},v.prototype.updateClearMenuState=function(e){var t,i;this.isImmediateMode()&&"Excel"===this.parent.filterSettings.type&&!this.options.isResponsiveFilter&&(t=null,t=(i=this.menu)&&(i=i.querySelector(".e-excl-filter-icon"))?i.closest(".e-menu-item"):t)&&(e?(t.classList.remove("e-disabled"),t.tabIndex=0,t.removeAttribute("aria-disabled")):(t.classList.add("e-disabled"),t.tabIndex=-1,t.setAttribute("aria-disabled","true")))},v.prototype.fltrBtnHandler=function(){var t=this,e=(this.infiniteRenderMod&&(this.cBox.innerHTML="",Ip(this.cBox,this.infiniteLoadedElem.slice())),[].slice.call(this.cBox.querySelectorAll(".e-check:not(.e-selectall):not(.e-add-current)"))),i=e;if(this.isImmediateMode()){var n=e.length,r=this.itemsCnt,s=this.sInput?this.sInput.value:"";if(n===r&&""===s)return this.options.handler&&(this.parent.filterModule&&(this.parent.filterModule.maintainFocusOnFilterDialog=!0),this.options.handler({action:"clear-filter",field:this.options.field})),void this.updateClearMenuState(!1)}var o,s="equal",a=this.getDlgElement().querySelector(".e-dropdownlist"),a=(a&&(this.options.operator=s=a.ej2_instances[0].value),this.isMenuNotEqual="notequal"===this.options.operator,this.options.hideSearchbox||(o=this.searchBox.querySelector(".e-searchinput")),this.options.allowCaseSensitive),a={field:this.options.field,predicate:this.isMenuNotEqual?"and":"or",uid:this.options.uid,operator:s,type:this.options.type,matchCase:a,ignoreAccent:this.options.ignoreAccent},l=this.itemsCnt!==e.length&&this.itemsCnt-e.length<e.length,h=(this.infiniteRenderMod?this.sBox:this.cBox).querySelector(".e-add-current"),d=(this.infiniteRenderMod?this.sBox:this.cBox).querySelector(".e-selectall"),d=o&&""!==o.value&&h&&d&&h.classList.contains("e-check")&&d.classList.contains("e-stop"),p=this.existingPredicate&&this.existingPredicate[this.options.field],c=((l=d?!p||!p.length:l)&&o&&(""===o.value||d)&&(s=this.isMenuNotEqual?"equal":"notequal",e=[].slice.call(this.cBox.querySelectorAll(".e-uncheck:not(.e-selectall)")),a.predicate=this.isMenuNotEqual?"or":"and",a.operator=s),[]);if(e.length!==this.itemsCnt||o&&o.value&&""!==o.value||this.infiniteRenderMod||this.isImmediateMode()){if(this.infiniteRenderMod)this.infiniteRenderMod&&(!this.infiniteSearchPred||this.infiniteSearchPred&&!this.infiniteSearchPred.isComplex)?this.infiniteFltrBtnHandler(c):this.infiniteSearchPred.isComplex&&(c=this.complexQueryPredicate(e,a,l));else{if(c=this.complexQueryPredicate(e,a,l),H.isNullOrUndefined(c))return;c=this.filterPreventColumns||c}if("date"!==this.options.type&&"dateonly"!==this.options.type&&"datetime"!==this.options.type||!i.length||(s=i.length-1,o=this.values[I(i[parseInt(s.toString(),10)],"e-ftrchk").getAttribute("data-uid")],H.isNullOrUndefined(o)&&l&&c.push({field:a.field,matchCase:a.matchCase,operator:"equal",predicate:"or",value:null})),h&&h.classList.contains("e-check"))if(p)for(var u=0;u<p.length;u++)!function(t){c.some(function(e){return e.value===p[parseInt(t.toString(),10)].value})||c.push(p[parseInt(t.toString(),10)])}(u);else if(!d)return;!this.infiniteRenderMod||c.length?this.initiateFilter(c):this.sBox.querySelector(".e-selectall").classList.contains("e-check")&&!c.length&&this.options.filteredColumns.some(function(e){return t.options.field===e.field})&&this.clearFilter()}else this.options.filteredColumns.some(function(e){return t.options.field===e.field})&&this.clearFilter();this.isImmediateMode()&&(n=e.length,r=this.itemsCnt,this.updateClearMenuState(0<n&&n<r),this.searchClear=!1)},v.prototype.complexQueryPredicate=function(e,t,i){for(var n,r,s=[],o=this.options.dataManager.adaptor.getModuleName,a=o?o():null,l=0;l<e.length;l++)n=this.values[I(e[parseInt(l.toString(),10)],"e-ftrchk").getAttribute("data-uid")],r=H.extend({},{value:n},t),n&&!n.toString().length&&(r.operator=i?"notequal":"equal"),""===n||H.isNullOrUndefined(n)?s=s.concat(v.generateNullValuePredicates(t,a)):s.push(r);o=this.filterPreventColumns&&this.filterPreventColumns.length?this.filterPreventColumns[0]:r;return o&&!this.notifyFilterPrevEvent(o)?(this.filterPreventColumns=s,null):s},v.prototype.infiniteFltrBtnHandler=function(e){var t=this.options.dataManager.adaptor.getModuleName,i=t?t():null;if(this.infiniteManualSelectMaintainPred.length)for(var n=0;n<this.infiniteManualSelectMaintainPred.length;n++){var r,s=this.infiniteManualSelectMaintainPred[n];!(r=s.value+"")||H.isNullOrUndefined(r)?(r={predicate:s.predicate,field:s.field,type:s.type,uid:s.uid,operator:s.operator,matchCase:s.matchCase,ignoreAccent:s.ignoreAccent},e.push.apply(e,v.generateNullValuePredicates(r,i))):e.push(this.infiniteManualSelectMaintainPred[n]),this.notifyFilterPrevEvent(this.infiniteManualSelectMaintainPred[n])}if(!this.localInfiniteSelectAllClicked&&""===this.sInput.value&&(this.options.parentCurrentViewDataCount||!e.length))for(n=0;n<this.infiniteUnloadParentExistPred.length;n++)e.unshift(this.infiniteUnloadParentExistPred[n]),this.notifyFilterPrevEvent(this.existingPredicate[this.options.field][n]);!this.infiniteSearchPred||""===this.sInput.value||this.localInfiniteSelectAllClicked&&!this.infiniteLocalSelectAll||(this.infiniteSearchPred.predicate="or",e.unshift(this.infiniteSearchPred),this.notifyFilterPrevEvent(this.infiniteSearchPred))},v.prototype.notifyFilterPrevEvent=function(e){e={instance:this,handler:this.fltrBtnHandler,arg1:e.field,arg2:e.predicate,arg3:e.operator,arg4:e.matchCase,arg5:e.ignoreAccent,arg6:e.value,cancel:!1};return this.parent.notify(yn,e),!e.cancel},v.generateNullValuePredicates=function(e,t){var i=[],t="ODataV4Adaptor"===t;return"string"===e.type&&i.push({field:e.field,ignoreAccent:e.ignoreAccent,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:""}),i.push({field:e.field,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:null}),t&&"string"===e.type||i.push({field:e.field,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:void 0}),i},v.prototype.initiateFilter=function(e){var t=e[0];if(t&&"dateonly"===t.type&&(t.value=t.value instanceof Date?t.value.getFullYear()+"-"+Jp(t.value.getMonth()+1)+"-"+Jp(t.value.getDate()):t.value),!H.isNullOrUndefined(t)){for(var i=t.ejpredicate||new V.Predicate(t.field,t.operator,t.value,!t.matchCase,t.ignoreAccent),n=1;n<e.length;n++)i=void 0!==e[parseInt(n.toString(),10)].ejpredicate?i[e[parseInt(n.toString(),10)].predicate](e[parseInt(n.toString(),10)].ejpredicate):i[e[parseInt(n.toString(),10)].predicate](e[parseInt(n.toString(),10)].field,e[parseInt(n.toString(),10)].operator,e[parseInt(n.toString(),10)].value,!e[parseInt(n.toString(),10)].matchCase,e[parseInt(n.toString(),10)].ignoreAccent);t={action:"filtering",filterCollection:e,field:this.options.field,ejpredicate:V.Predicate.or(i)};this.options.handler(t)}},v.prototype.isForeignColumn=function(e){return!!e.isForeignColumn&&e.isForeignColumn()},v.prototype.refreshCheckboxes=function(){var t,e,r=this,s=this.sInput.value,o=this.options.column,a=(this.isForeignColumn(o)?this.foreignKeyQuery:this.options.query).clone(),l=this.options.query.clone(),h=a.queries.filter(function(e){return e&&"onWhere"===e.fn})[0],d=(a.queries=[],l.queries=[],"string"!==this.options.type&&parseFloat(s)?parseFloat(s):s),p=this.options.isRemote?"string"===this.options.type?"contains":"equal":this.options.type?"contains":"equal",c=this.options.ignoreAccent,u=this.isForeignColumn(o)?o.foreignKeyValue:o.field,g=(d=""===d||void 0===d?void 0:d,[]),f={field:u,predicate:"or",uid:this.options.uid,operator:"equal",type:this.options.type,matchCase:!0,ignoreAccent:c},i=this.options.dataManager.adaptor.getModuleName,m=("boolean"===this.options.type&&(void 0!==d&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(d.toLowerCase())?d="true":void 0!==d&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(d.toLowerCase())&&(d="false"),void 0!==d&&-1!==this.getLocalizedLabel("FilterTrue").toLowerCase().indexOf(d.toLowerCase())&&i?(i(),d=!0):void 0!==d&&-1!==this.getLocalizedLabel("FilterFalse").toLowerCase().indexOf(d.toLowerCase())&&i&&(i(),d=!1),p="equal"),"date"!==this.options.type&&"datetime"!==this.options.type&&"dateonly"!==this.options.type||!this.options.format||(i=new H.Internationalization,e=("string"==typeof this.options.format?this.options:this.options.format).format,d=e&&i.parseDate(s,{format:e})||new Date(s),"dateonly"===this.options.type&&(d=d.getFullYear()+"-"+Jp(d.getMonth()+1)+"-"+Jp(d.getDate()))),this.infiniteSearchValChange=!0,this.infiniteLoadedElem=[],this.infiniteLocalSelectAll=!0,this.localInfiniteSelectAllClicked=!1,this.localInfiniteSelectionInteracted=!1,this.infiniteSkipCnt=0,this.infiniteDataCount=0,this.infiniteManualSelectMaintainPred=[],""===this.sInput.value?this.infiniteUnloadParentExistPred=this.infiniteRenderMod&&this.existingPredicate[this.options.column.field]?this.existingPredicate[this.options.column.field].slice():[]:this.infiniteUnloadParentExistPred=[],this.isForeignColumn(o)||this.addDistinct(a),{requestType:ht,filterModel:this,columnName:u,column:o,operator:p,matchCase:!0,ignoreAccent:c,filterChoiceCount:null,query:a,value:d,cancel:!1});this.infiniteRenderMod&&this.parent.filterSettings.itemsCount&&(m.filterChoiceCount=this.parent.filterSettings.itemsCount),this.parent.trigger(y,m,function(i){var e,n;i.cancel||(i.operator=i.operator,t=new V.Predicate(u,i.operator,m.value,i.matchCase,i.ignoreAccent),"date"!==r.options.type&&"datetime"!==r.options.type&&"dateonly"!==r.options.type||(e={field:u,operator:p="equal",value:d,matchCase:!0,ignoreAccent:c},H.isNullOrUndefined(d))||(t=ec(e,r.options.type)),e=(e=r.options.dataManager.adaptor.getModuleName)?e():null,s&&"string"==typeof s&&r.isBlanks&&0<=r.getLocalizedLabel("Blanks").toLowerCase().indexOf(s.toLowerCase())?(g=g.concat(v.generateNullValuePredicates(f,e)),(e=v.generatePredicate(g)).predicates.push(t),t=e,a.where(e)):s.length?(r.isImmediateMode()&&("Excel"===r.parent.filterSettings.type||"CheckBox"===r.parent.filterSettings.type)||(t=H.isNullOrUndefined(h)?t:t.and(h.e)),a.where(t)):H.isNullOrUndefined(h)||(t=h.e,a.where(h.e)),r.infiniteSearchPred=t,i.filterChoiceCount=H.isNullOrUndefined(i.filterChoiceCount)?1e3:i.filterChoiceCount,r.infiniteRenderMod&&r.parent.filterSettings.itemsCount!==i.filterChoiceCount&&(r.parent.filterSettings.itemsCount=m.filterChoiceCount),n={},F.showSpinner(r.spinner),r.renderEmpty=!1,r.isForeignColumn(o)&&s.length?("result"in o.dataSource?new V.DataManager(o.dataSource.result):o.dataSource).executeQuery(a).then(function(e){var t=r.options.column.columnData;r.options.column.columnData=e.result,r.parent.notify(Ui,{predicate:n,column:o}),n.predicate.predicates.length?l.where(n.predicate):r.renderEmpty=!0,r.options.column.columnData=t,r.infiniteRenderMod?(r.infiniteInitialLoad=!!H.isNullOrUndefined(r.fullData),r.makeInfiniteScrollRequest(l),"grid"===r.parent.getModuleName()?l=r.parent.setRequiresCount(l):l.requiresCount()):l.take(i.filterChoiceCount),r.search(i,l)}):(r.infiniteRenderMod&&r.parent.filterSettings.itemsCount?(r.infiniteInitialLoad=!!H.isNullOrUndefined(r.fullData),r.makeInfiniteScrollRequest(a),"grid"===r.parent.getModuleName()?a=r.parent.setRequiresCount(a):a.requiresCount()):a.take(i.filterChoiceCount),r.search(i,a)))})},v.prototype.search=function(e,t){this.parent.dataSource&&"result"in this.parent.dataSource?this.filterEvent(e,t):this.processSearch(t)},v.prototype.getPredicateFromCols=function(e){for(var t=v.getPredicate(e),i=[],n={},r=void 0!==this.parent.getForeignKeyColumns,s=r?this.parent.getForeignKeyColumns():[],o=0,a=Object.keys(t);o<a.length;o++){var l=a[o],h=void 0;(h=r&&!this.parent.getColumnByField(l)?Zp(l,s):h)?(this.parent.notify(Ui,{predicate:n,column:h}),n.predicate.predicates.length&&i.push(V.Predicate.or(n.predicate.predicates))):i.push(t[""+l])}return i.length&&V.Predicate.and(i)},v.prototype.getQuery=function(){return this.parent.getQuery?this.parent.getQuery().clone():new V.Query},v.prototype.getAllData=function(){var i=this,n=(this.customQuery=!1,this.getQuery()),e=this.options.dataManager.adaptor.getModuleName,e=(!H.isNullOrUndefined(this.parent.getDataModule)&&e&&"ODataV4Adaptor"===e()||("grid"===this.parent.getModuleName()?n=this.parent.setRequiresCount(n):n.requiresCount()),this.addDistinct(n),{requestType:ot,query:n,filterChoiceCount:null});(e.filterModel=this).infiniteRenderMod&&this.parent.filterSettings.itemsCount&&(e.filterChoiceCount=this.parent.filterSettings.itemsCount),this.parent.trigger(y,e,function(e){e.filterChoiceCount=H.isNullOrUndefined(e.filterChoiceCount)?1e3:e.filterChoiceCount,i.infiniteRenderMod&&i.parent.filterSettings.itemsCount!==e.filterChoiceCount&&(i.parent.filterSettings.itemsCount=e.filterChoiceCount),i.infiniteRenderMod||n.take(e.filterChoiceCount);var t=i.options.dataManager.adaptor.getModuleName,t=t&&"ODataV4Adaptor"===t();(!e.query.distincts.length||i.infiniteRenderMod||e.query.distincts.length&&t)&&(i.customQuery=!0,i.queryGenerate(n)),i.infiniteRenderMod&&(i.infiniteInitialLoad=!!H.isNullOrUndefined(i.fullData),i.makeInfiniteScrollRequest(n)),i.parent.dataSource&&"result"in i.parent.dataSource?i.filterEvent(e,n):i.processDataOperation(n,!0)})},v.prototype.addDistinct=function(e){var t,i=this,n=V.DataUtil.distinct(this.options.filteredColumns,"field"),r=(n.indexOf(this.options.column.field)<=-1&&(n=n.concat(this.options.column.field)),this.options.dataManager.adaptor.getModuleName);if(r&&"ODataV4Adaptor"===r()&&this.parent&&this.parent.query instanceof V.Query)for(var s=this.parent.query,o=0;o<s.queries.length;o++){var a=s.queries[parseInt(o.toString(),10)];"onWhere"===a.fn&&(this.getPredicateFields(a.e),this.queryFilteredColumn.map(function(e){-1===n.indexOf(e)&&n.push(e)}),this.queryFilteredColumn=[])}return this.infiniteRenderMod||e.distinct(n),this.infiniteRenderMod&&!this.options.isRemote&&""===this.sInput.value?(this.options.dataSource=this.options.dataSource instanceof V.DataManager?this.options.dataSource:new V.DataManager(this.options.dataSource),this.infinitePermenantLocalData=this.options.dataSource.dataSource.json.slice(),r=(t=this.options&&this.options.dataManager&&this.options.dataManager.adaptor&&this.options.dataManager.adaptor.getModuleName?this.options.dataManager.adaptor.getModuleName:t)&&"RemoteSaveAdaptor"===t()&&this.infinitePermenantLocalData?this.infinitePermenantLocalData:this.options.dataSource.dataSource,t=new V.Query,this.queryGenerate(t),r=new V.DataManager(r).executeLocal(t),this.options.dataSource=new V.DataManager(V.DataUtil.distinct(r,this.options.column.field,!0)),this.isForeignColumn(this.options.column)&&(this.options.column.dataSource=this.options.column.dataSource instanceof V.DataManager?this.options.column.dataSource:new V.DataManager(this.options.column.dataSource),this.options.dataSource.dataSource.json=this.options.dataSource.dataSource.json.map(function(e,t){return Object.assign({},e,i.options.column.dataSource.dataSource.json[t])}))):this.infiniteRenderMod&&this.options.isRemote&&(e.select(this.options.column.field),e.sortBy(this.options.column.field,"ascending"),t=this.options.dataManager.adaptor.getModuleName)&&t()&&("ODataV4Adaptor"===t()||"WebApiAdaptor"===t()||"CustomDataAdaptor"===t()||"GraphQLAdaptor"===t()||"ODataAdaptor"===t())&&e.distinct([this.options.column.field]),e},v.prototype.getPredicateFields=function(e){var t=this;e.isComplex&&e.predicates?e.predicates.forEach(function(e){Array.isArray(e)?e.forEach(function(e){return t.getPredicateFields(e)}):t.getPredicateFields(e)}):e.field&&!e.isComplex&&this.queryFilteredColumn.indexOf(e.field)<=-1&&(this.queryFilteredColumn=this.queryFilteredColumn.concat(V.DataUtil.distinct([e.field],"field")))},v.prototype.filterEvent=function(e,t){var i=this,e=Cc(e,t);this.parent.trigger(Gi,e.state),this.addInfiniteScrollEvent(t),e.deffered.promise.then(function(e){i.infiniteDataCount=i.infiniteRenderMod&&!i.infiniteDataCount?e.count:i.infiniteDataCount;e=i.infiniteRenderMod?e.result:e;i.dataSuccess(e)})},v.prototype.addInfiniteScrollEvent=function(e){this.infiniteRenderMod&&(this.infiniteQuery=e.clone(),this.infiniteInitialLoad?(this.cBox.classList.add("e-checkbox-infinitescroll"),H.EventHandler.add(this.cBox,"scroll",this.infiniteScrollHandler,this),H.EventHandler.add(this.cBox,"mouseup",this.infiniteScrollMouseKeyUpHandler,this),H.EventHandler.add(this.cBox,"mousedown",this.infiniteScrollMouseKeyDownHandler,this)):this.infiniteSearchValChange&&(this.cBox.innerHTML=""))},v.prototype.infiniteScrollMouseKeyDownHandler=function(){H.EventHandler.remove(this.cBox,"scroll",this.infiniteScrollHandler)},v.prototype.infiniteScrollMouseKeyUpHandler=function(e){var t=this,i=(H.EventHandler.add(this.cBox,"scroll",this.infiniteScrollHandler,this),this.cBox);1<i.children.length&&(i.scrollTop>=i.scrollHeight-i.offsetHeight||i.scrollTop<=0)&&this.infiniteScrollHandler(),oe.Global.timer=setTimeout(function(){t.clickHandler(e),oe.Global.timer=null},0)},v.prototype.getShimmerTemplate=function(){return'<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave"></span>'},v.prototype.showMask=function(){var e,t,i,n,r,s=5,o=this.parent.createElement("div",{id:this.id+this.options.type+"_CheckBoxMaskList",className:"e-checkboxlist e-fields e-infinite-list e-masklist"}),a=(o.style.zIndex="10",this.cBox),l=(this.removeMask(),a&&(t=getComputedStyle(a),i=tu(a),n=a.children.length?parseInt(t.height,10):Math.floor(parseInt(t.height.split("px")[0],10))-5,this.parent.enableAdaptiveUI&&this.infiniteRenderMod&&(o.style.height=n-i+"px",this.dlg.querySelector(".e-dlg-content").style.overflow="hidden"),r=!this.isExcel||a.children.length||this.dlg.classList.contains("e-excelfilter")?getComputedStyle(this.dlg.querySelector(".e-dlg-content")||this.dlg).backgroundColor:"",o.style.cssText="width: "+t.width+"; min-height: "+t.minHeight+"; height: "+n+"px; margin: "+t.margin+"; border-style: "+t.borderStyle+"; border-width: "+t.borderWidth+"; border-color: "+t.borderColor+"; position: absolute; background-color: "+r+";",s=Math.floor(n/i),s=a.children.length>s?a.children.length:s,e=i+"px"),'<div class="e-ftrchk e-mask-ftrchk"><div class="e-checkbox-wrapper"><input class="e-chk-hidden">'+this.getShimmerTemplate()+this.getShimmerTemplate()+"</div></div>");o.innerHTML="",a.children.length||(this.spinner.insertAdjacentHTML("beforebegin",l),this.spinner.parentElement.querySelector(".e-ftrchk.e-mask-ftrchk").style.cssText="width: 100%; height: "+e+";",this.spinner.parentElement.querySelector(".e-checkbox-wrapper").style.width="100%",(h=[].slice.call(this.spinner.parentElement.querySelectorAll(".e-mask:not(.e-mask-checkbox-filter-intent):not(.e-mask-checkbox-filter-span-intent)")))[0].classList.add("e-mask-checkbox-filter-intent"),h[1].classList.add("e-mask-checkbox-filter-span-intent")),this.spinner.insertBefore(o,this.cBox);for(var h,d=0;s&&d<s;d++)o.innerHTML+=l,o.lastElementChild.style.cssText="width: 100%; height: "+e+";",o.lastElementChild.querySelector(".e-checkbox-wrapper").style.width="100%",(h=[].slice.call(o.querySelectorAll(".e-mask:not(.e-mask-checkbox-filter-intent):not(.e-mask-checkbox-filter-span-intent)")))[0].classList.add("e-mask-checkbox-filter-intent"),h[1].classList.add("e-mask-checkbox-filter-span-intent");this.cBox&&(o.scrollTop=this.cBox.scrollTop)},v.prototype.removeMask=function(){var e=this.getDlgElement().querySelectorAll(".e-mask-ftrchk");if(e.length)for(var t=0;t<e.length;t++)H.remove(e[t]);this.getDlgElement().querySelector(".e-checkboxlist.e-masklist")&&H.remove(this.getDlgElement().querySelector(".e-checkboxlist.e-masklist"))},v.prototype.infiniteScrollHandler=function(){var e=this.cBox;e.scrollTop>=e.scrollHeight-e.offsetHeight&&!this.infiniteQueryExecutionPending&&this.infiniteLoadedElem.length<=this.infiniteSkipCnt+this.parent.filterSettings.itemsCount&&this.cBox.children.length===3*this.parent.filterSettings.itemsCount&&(!this.infiniteDataCount||this.infiniteDataCount>this.infiniteSkipCnt+this.parent.filterSettings.itemsCount)?(this.makeInfiniteScrollRequest(),this.prevInfiniteScrollDirection="down"):e.scrollTop>=e.scrollHeight-e.offsetHeight&&!this.infiniteQueryExecutionPending&&this.infiniteLoadedElem.length>this.infiniteSkipCnt+this.parent.filterSettings.itemsCount&&this.cBox.children.length===3*this.parent.filterSettings.itemsCount?(Jc([].slice.call(this.cBox.children).splice(0,this.parent.filterSettings.itemsCount)),this.infiniteSkipCnt+="down"===this.prevInfiniteScrollDirection?this.parent.filterSettings.itemsCount:3*this.parent.filterSettings.itemsCount,Ip(this.cBox,this.infiniteLoadedElem.slice(this.infiniteSkipCnt,this.parent.filterSettings.itemsCount+this.infiniteSkipCnt)),this.prevInfiniteScrollDirection="down"):0===e.scrollTop&&!this.infiniteInitialLoad&&!this.infiniteSearchValChange&&this.infiniteSkipCnt&&this.infiniteLoadedElem.length&&this.infiniteLoadedElem.length>3*this.parent.filterSettings.itemsCount&&this.cBox.children.length===3*this.parent.filterSettings.itemsCount?(Jc([].slice.call(this.cBox.children).splice(2*this.parent.filterSettings.itemsCount,this.parent.filterSettings.itemsCount)),this.infiniteSkipCnt-="up"===this.prevInfiniteScrollDirection?this.parent.filterSettings.itemsCount:3*this.parent.filterSettings.itemsCount,eu([].slice.call(this.infiniteLoadedElem.slice(this.infiniteSkipCnt,this.infiniteSkipCnt+this.parent.filterSettings.itemsCount)),this.cBox),this.cBox.scrollTop=this.infiniteScrollAppendDiff,this.prevInfiniteScrollDirection="up"):0===e.scrollTop&&!this.infiniteInitialLoad&&!this.infiniteSearchValChange&&this.infiniteSkipCnt&&this.infiniteLoadedElem.length&&this.cBox.children.length<3*this.parent.filterSettings.itemsCount&&(Jc([].slice.call(this.cBox.children).splice(2*this.parent.filterSettings.itemsCount,this.infiniteDataCount%this.parent.filterSettings.itemsCount)),this.infiniteSkipCnt=(Math.floor(this.infiniteDataCount/this.parent.filterSettings.itemsCount)-3)*this.parent.filterSettings.itemsCount,eu([].slice.call(this.infiniteLoadedElem.slice(this.infiniteSkipCnt,this.infiniteSkipCnt+this.parent.filterSettings.itemsCount)),this.cBox),this.cBox.scrollTop=this.infiniteScrollAppendDiff,this.prevInfiniteScrollDirection="up")},v.prototype.makeInfiniteScrollRequest=function(e){var t=this;!this.infiniteInitialLoad&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator?setTimeout(function(){t.infiniteQueryExecutionPending&&t.showMask()},500):this.infiniteInitialLoad||(F.createSpinner({target:this.spinner,cssClass:this.parent.cssClass||null},this.parent.createElement),F.showSpinner(this.spinner));if(this.infiniteQuery&&this.infiniteQuery.queries&&this.infiniteQuery.queries.length)for(var i=0;i<this.infiniteQuery.queries.length;i++)"onTake"!==this.infiniteQuery.queries[i].fn&&"onSkip"!==this.infiniteQuery.queries[i].fn||(this.infiniteQuery.queries.splice(i,1),i--);var n=!!e;e=e||this.infiniteQuery,this.infiniteInitialLoad||this.infiniteSearchValChange?this.infiniteSkipCnt=0:this.infiniteSkipCnt+=this.parent.filterSettings.itemsCount,e.skip(this.infiniteSkipCnt),this.infiniteInitialLoad||this.infiniteSearchValChange?(e.take(3*this.parent.filterSettings.itemsCount),this.infiniteSkipCnt+=2*this.parent.filterSettings.itemsCount):e.take(this.parent.filterSettings.itemsCount),n||(this.parent.dataSource&&"result"in this.parent.dataSource?(n={requestType:ot,query:e,filterChoiceCount:null,filterModel:this},this.infiniteRenderMod&&this.parent.filterSettings.itemsCount&&(n.filterChoiceCount=this.parent.filterSettings.itemsCount),this.filterEvent(n,e)):(this.processDataOperation(e),this.infiniteQueryExecutionPending=!0))},v.prototype.processDataOperation=function(t,e){var i=this,n=(this.options.dataSource=this.options.dataSource instanceof V.DataManager?this.options.dataSource:new V.DataManager(this.options.dataSource),[]),r=[];this.isForeignColumn(this.options.column)&&e&&(e="result"in this.options.column.dataSource?new V.DataManager(this.options.column.dataSource.result):this.options.column.dataSource,this.foreignKeyQuery.params=t.params,n.push(e.executeQuery(this.foreignKeyQuery)),r.push(function(e){return i.foreignKeyData=e})),this.addInfiniteScrollEvent(t),this.infiniteRenderMod&&this.infiniteInitialLoad&&!this.options.isRemote?(e=this.isForeignColumn(this.options.column)?this.options.foreignKeyValue:this.options.column.field,this.options.dataSource.executeQuery((new V.Query).sortBy(e,V.DataUtil.fnAscending)).then(function(e){i.options.dataSource.dataSource.json=e.result,i.executeQueryOperations(t,n,r)})):this.executeQueryOperations(t,n,r)},v.prototype.executeQueryOperations=function(e,t,i){var n=this,r=this.options.dataManager.adaptor.getModuleName,s=(t.push(this.options.dataSource.executeQuery(e)),i.push(this.dataSuccess.bind(this)),0);Promise.all(t).then(function(e){n.infiniteQueryExecutionPending=!n.infiniteRenderMod&&n.infiniteQueryExecutionPending;for(var t=0;t<e.length;t++)n.infiniteDataCount=n.infiniteRenderMod&&!n.infiniteDataCount?e[t].count:n.infiniteDataCount,r&&"ODataV4Adaptor"===r()&&n.searchInputArgs&&""!==n.searchInputArgs.element.value&&!H.isNullOrUndefined(e[parseInt(t.toString(),10)].actual)?i[s++](e[parseInt(t.toString(),10)].actual):i[s++](e[parseInt(t.toString(),10)].result)}).catch(function(){n.infiniteRenderMod&&n.parent.filterSettings&&"Shimmer"===n.parent.filterSettings.loadingIndicator&&n.parent.showMaskRow(void 0,n.getDlgElement())})},v.prototype.applyImmediateSearchToGrid=function(e){var t=this.parent,i=this.options.field;if(e){for(var n=t.filterSettings&&t.filterSettings.columns?t.filterSettings.columns:[],r=n.length-1;0<=r;r--){var s=n.slice(r,r+1)[0];s&&s.field===i&&n.splice(r,1)}t.filterByColumn(i,"contains",e,"or",!1,this.options.ignoreAccent),this.lastAppliedFilter=[{field:i,operator:"contains",value:e,predicate:"or",matchCase:!1,ignoreAccent:this.options.ignoreAccent,type:this.options.type}]}},v.prototype.dataSuccess=function(e){var t,i;!this.infiniteInitialLoad&&this.infiniteDataCount&&(this.infiniteSkipCnt>=this.infiniteDataCount&&!this.infiniteSearchValChange||0===e.length)||(this.infiniteRenderMod&&this.parent.infiniteScrollSettings&&this.parent.infiniteScrollSettings.enableCountLessMode&&0===e.length?(this.infiniteInitialLoad=!1,this.infiniteSearchValChange=!1,this.infiniteQueryExecutionPending=!1,this.removeMask(),F.hideSpinner(this.spinner)):(this.fullData=e,e={dataSource:this.fullData,executeQuery:!0,field:this.options.field},this.parent.notify(Jn,e),e.executeQuery&&(t=new V.Query,this.customQuery||this.queryGenerate(t),t=new V.DataManager(e.dataSource).executeLocal(t),i=this.options.column,this.filteredData=v.getDistinct(t,this.options.field,i,this.foreignKeyData,this).records||[]),t=e.executeQuery?this.filteredData:e.dataSource,i=this.sInput?this.sInput.value:"",this.isImmediateMode()&&t&&0!==t.length&&i&&""!==i&&this.applyImmediateSearchToGrid(i),this.processDataSource(null,!0,t,e),this.isImmediateMode()&&(i=this.cBox.querySelectorAll(".e-check:not(.e-selectall):not(.e-add-current)").length,t=this.itemsCnt,e=!(!this.existingPredicate||!this.existingPredicate[this.options.field]),e=(this.searchClear||e)&&i!==t,this.updateClearMenuState(e),this.searchClear=!1),(this.infiniteRenderMod&&this.infiniteInitialLoad||!this.infiniteRenderMod)&&(this.sInput?this.sInput.focus():this.dlg.querySelector(".e-chk-hidden")&&this.dlg.querySelector(".e-ftrchk")&&(this.dlg.querySelector(".e-chk-hidden").focus(),this.dlg.querySelector(".e-ftrchk").classList.add("e-chkfocus"))),(this.infiniteInitialLoad||this.infiniteSearchValChange)&&(this.infiniteInitialLoad=!1,this.infiniteSearchValChange=!1),((i={requestType:at,columnName:this.options.field,columnType:this.options.type}).filterModel=this).parent.notify(mn,i),this.isCheckboxFilterTemplate&&F.hideSpinner(this.spinner)))},v.prototype.queryGenerate=function(e){var t;if(this.parent.searchSettings&&this.parent.searchSettings.key.length&&(t=this.options.dataManager.adaptor.getModuleName,!H.isNullOrUndefined(this.parent.getForeignKeyColumns())&&this.parent.getForeignKeyColumns().length||!H.isNullOrUndefined(this.parent.getDataModule)&&t&&"ODataV4Adaptor"===t()?this.parent.getDataModule().searchQuery(e):(s=(t=this.parent.searchSettings).fields.length?t.fields:this.options.columns.map(function(e){return e.field}),e.search(t.key,s,t.operator,t.ignoreCase,t.ignoreAccent))),this.options.filteredColumns.length){for(var i=[],n=0;n<this.options.filteredColumns.length;n++){var r=this.options.filteredColumns[parseInt(n.toString(),10)];this.options.uid?(r.uid=r.uid||this.parent.getColumnByField(r.field).uid,r.uid!==this.options.uid&&i.push(this.options.filteredColumns[parseInt(n.toString(),10)])):r.field!==this.options.field&&i.push(this.options.filteredColumns[parseInt(n.toString(),10)])}var s=this.getPredicateFromCols(i);s&&e.where(s)}},v.prototype.processDataSource=function(e,t,i,n){F.showSpinner(this.spinner),this.updateResult();var r={dataSource:this.fullData,isCheckboxFilterTemplate:!1,column:this.options.column,element:this.cBox,type:this.options.type,format:this.options.type,btnObj:this.getOkButton(),searchBox:this.searchBox};this.parent.notify(Hr,r),this.isCheckboxFilterTemplate=r.isCheckboxFilterTemplate,this.isCheckboxFilterTemplate?this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&this.removeMask():this.createFilterItems(i,t,n)},v.prototype.processSearch=function(e){this.processDataOperation(e)},v.prototype.updateResult=function(){this.result={};var e=this.infiniteRenderMod&&this.existingPredicate[this.options.field]?this.getPredicateFromCols(this.existingPredicate[this.options.field]):this.getPredicateFromCols(this.options.filteredColumns),t=new V.Query;e?t.where(e):this.searchClear&&this.isImmediateMode()&&(e=this.parent).getDataModule&&"function"==typeof e.getDataModule&&(t=e.getDataModule().generateQuery(!0)),this.parent.notify(Mr,{query:t});for(var i=0,n=new V.DataManager(this.fullData).executeLocal(t);i<n.length;i++){var r,s=n[i],o=void 0;o=this.options&&this.options.column&&this.options.column.allowFormula?(r=s[""+this.parent.getPrimaryKeyFieldNames()[0]],this.parent.getFormulaValue(r,this.options.field)):N(this.options.field,s),this.result[""+o]=!0}},v.prototype.clickHandler=function(e){H.isNullOrUndefined(oe.Global.timer)||clearTimeout(oe.Global.timer);var t,i,n,r=e.target;!H.isNullOrUndefined(this.parent.loadingIndicator)&&"Shimmer"===this.parent.loadingIndicator.indicatorType&&I(r,"e-mask-ftrchk")||(t=I(r,"e-checkbox-wrapper"),I(r,"e-searchbox")&&this.searchBoxClick(e),t&&!this.isCheckboxFilterTemplate&&((r=t.querySelector(".e-selectall"))?this.updateAllCBoxes(!r.classList.contains("e-check")):(Kp(t.parentElement),this.infiniteRenderMod&&!t.parentElement.querySelector(".e-add-current")&&(this.localInfiniteSelectionInteracted=!0,e=this.options.allowCaseSensitive,n=(r=t.parentElement.querySelector(".e-frame").previousSibling).checked?"equal":"notequal",i=r.checked?"or":"and",i={field:this.options.field,predicate:i,uid:this.options.uid,operator:n,type:this.options.type,matchCase:e,ignoreAccent:this.options.ignoreAccent},n=this.values[I(r,"e-ftrchk").getAttribute("data-uid")],this.updateInfiniteManualSelectPred(i,n),this.infiniteRenderMod&&!this.options.isRemote&&this.options.parentTotalDataCount&&this.infiniteUnloadParentExistPred.length&&(r=this.getPredicateFromCols((e=this.options.filteredColumns).concat.apply(e,this.infiniteManualSelectMaintainPred)),i=new V.Query,r&&i.where(r),n=new V.DataManager(this.infinitePermenantLocalData).executeLocal(i),this.options.parentTotalDataCount!==n.length&&(this.options.parentTotalDataCount=n.length),!this.options.parentTotalDataCount)&&this.infiniteUnloadParentExistPred.length&&(this.infiniteUnloadParentExistPred=[]),!this.infiniteUnloadParentExistPred.length||this.options.parentTotalDataCount!==this.infiniteDataCount&&this.options.parentTotalDataCount||(this.infiniteUnloadParentExistPred=[]))),this.updateIndeterminatenBtn(),t.querySelector(".e-chk-hidden").focus(),this.isImmediateMode())&&this.applyImmediateCheckboxFilter(),this.setFocus(I(t,"e-ftrchk")))},v.prototype.applyImmediateCheckboxFilter=function(){this.fltrBtnHandler()},v.prototype.updateInfiniteManualSelectPred=function(e,t){for(var i=0;i<this.infiniteManualSelectMaintainPred.length;i++){var n=this.infiniteManualSelectMaintainPred[i];if(n.value+""==t+""&&("equal"===n.operator||"notequal"===n.operator)){this.infiniteManualSelectMaintainPred.splice(i,1);break}}("or"!==e.predicate||this.localInfiniteSelectAllClicked&&this.infiniteLocalSelectAll)&&("and"!==e.predicate||this.localInfiniteSelectAllClicked&&!this.infiniteLocalSelectAll)||(this.infiniteManualSelectMaintainPred.push(H.extend({},{value:t},e)),"or"===e.predicate?this.options.parentTotalDataCount++:this.options.parentTotalDataCount--)},v.prototype.focusNextOrPrev=function(e,t){e="ArrowUp"===e.key?t.indexOf(document.activeElement)-1:t.indexOf(document.activeElement)+1,e=t[(e+t.length)%t.length];e&&(e.focus(),t=e.classList.contains("e-chk-hidden")?I(e,"e-ftrchk"):e,this.setFocus(t))},v.prototype.keyupHandler=function(e){var t;"Tab"!==e.key&&("ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.altKey)||this.setFocus(I(e.target,"e-ftrchk")),"ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.altKey||!this.parent.filterSettings||"CheckBox"!==this.parent.filterSettings.type||(e.preventDefault(),t=Array.from(this.dlg.querySelectorAll('input, button, [tabindex]:not([tabindex="-1"])')),this.focusNextOrPrev(e,t))},v.prototype.setFocus=function(e){var t=this.dlg.querySelector(".e-chkfocus");t&&t.classList.remove("e-chkfocus"),e&&e!==t&&e.classList.add("e-chkfocus")},v.prototype.updateAllCBoxes=function(e){this.infiniteRenderMod&&(this.localInfiniteSelectAllClicked=!0,this.infiniteLocalSelectAll=e,this.infiniteUnloadParentExistPred=[],this.infiniteManualSelectMaintainPred=[]);for(var t=0,i=this.infiniteRenderMod?this.infiniteLoadedElem.map(function(e){return e.querySelector(".e-frame")}):[].slice.call(this.cBox.querySelectorAll(".e-frame:not(.e-add-current)"));t<i.length;t++){var n=i[t];Xp(n,e),Wp(n.previousSibling,e)}},v.prototype.dialogOpen=function(){this.parent.element.classList.contains("e-device")&&(this.dialogObj.element.querySelector(".e-input-group").classList.remove("e-input-focus"),this.options.isResponsiveFilter||this.dialogObj.element.querySelector(".e-btn").focus())},v.prototype.createCheckbox=function(e,t,i){var n=(t?this.cBoxTrue:this.cBoxFalse).cloneNode(!0),t=(Wp(n.querySelector("input"),t),n.querySelector(".e-label")),r=sc({},i,{column:this.options.column,parent:this.parent}),s=this.parent.getModuleName,s=!H.isNullOrUndefined(s)&&"spreadsheet"===s()||this.options.disableHtmlEncode?"textContent":"innerHTML",s=(t[""+s]=!H.isNullOrUndefined(e)&&e.toString().length?this.parent.enableHtmlSanitizer?H.SanitizeHtmlHelper.sanitize(e):e:this.getLocalizedLabel("Blanks"),bp("cbox"));return t.setAttribute("id",s+"cboxLabel"),n.querySelector("input").setAttribute("aria-labelledby",t.id),t.innerHTML===this.getLocalizedLabel("Blanks")&&(this.isBlanks=!0),"boolean"==typeof e&&(t.innerHTML=!0===e?this.getLocalizedLabel("FilterTrue"):this.getLocalizedLabel("FilterFalse")),H.addClass([t],["e-checkboxfiltertext"]),this.options.template&&i[this.options.column.field]!==this.getLocalizedLabel("SelectAll")&&i[this.options.column.field]!==this.getLocalizedLabel("AddCurrentSelection")&&(t.innerHTML="",s=this.parent.isReact&&this.options.column.filter&&"string"!=typeof this.options.column.filter.itemTemplate&&!(this.options.column.filter.itemTemplate.prototype&&this.options.column.filter.itemTemplate.prototype.CSPTemplate),e=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,s||e?(this.options.template(r,this.parent,"filterItemTemplate",null,null,null,t),this.parent.renderTemplates()):Ip(t,this.options.template(r,this.parent,"filterItemTemplate",null,null,null,null,this.parent.root))),n},v.prototype.updateIndeterminatenBtn=function(){var e=this.infiniteRenderMod?this.infiniteLoadedElem.length:this.cBox.children.length-1,t=[],i=!1,n=(this.infiniteRenderMod?this.sBox:this.cBox).querySelector(".e-selectall"),r=(this.infiniteRenderMod?this.infiniteLoadedElem.filter(function(e){return e.querySelector(".e-check")}):this.cBox.querySelectorAll(".e-check:not(.e-selectall):not(.e-add-current)")).length,s=(this.cBox.querySelector(".e-add-current")&&--e,this.getOkButton()),o=(s&&(s.disabled=!1),n.previousSibling);Wp(o,!1),o.indeterminate=!1,!this.infiniteRenderMod||""!==this.sInput.value||this.options.parentCurrentViewDataCount||this.localInfiniteSelectionInteracted||this.localInfiniteSelectAllClicked&&(this.infiniteLocalSelectAll||r)||e===r&&e!==r?this.infiniteRenderMod&&this.infiniteLoadedElem.length<this.infiniteDataCount&&this.infiniteUnloadParentExistPred.length&&(!r||e===r)&&this.infiniteLocalSelectAll&&(r?e+=this.infiniteUnloadParentExistPred.length:r+=this.infiniteUnloadParentExistPred.length):r=0,e===r?(this.infiniteRenderMod&&(this.infiniteLocalSelectAll=!0,this.localInfiniteSelectAllClicked=!0,this.infiniteManualSelectMaintainPred=[]),t=["e-check"],Wp(o,!0)):r?(t=["e-stop"],o.indeterminate=!0):(this.infiniteRenderMod&&(this.infiniteLocalSelectAll=!1,this.localInfiniteSelectAllClicked=!0,this.infiniteManualSelectMaintainPred=[]),t=["e-uncheck"],this.isImmediateMode()||(i=!0,s&&(s.disabled=!0))),s&&(this.filterState=!s.disabled,s.dataBind()),H.removeClass([n],["e-check","e-stop","e-uncheck"]),H.addClass([n],t),this.parent.notify(gr,{disabled:i})},v.prototype.createFilterItems=function(e,t,i){var n=this.options.dataManager.adaptor.getModuleName,r=this.parent.createElement("div"),s=this.getOkButton(),o=!1,a=-1,l="ejValue";i.executeQuery||(l=i.field);for(var h=0;h<e.length;h++){var d=H.getValue(l,e[parseInt(h.toString(),10)]);""!==d&&!H.isNullOrUndefined(d)||(a+=1),n&&"ODataV4Adaptor"===n()&&(d=H.getValue("dataObj.groupCount",e[parseInt(h.toString(),10)]),H.isNullOrUndefined(d)||(this.infiniteOdataCount+=d))}if(this.infiniteRenderMod||(this.itemsCnt=-1!==a?e.length-a:e.length),this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&this.removeMask(),e.length&&!this.renderEmpty){for(var p,i=this.getLocalizedLabel("SelectAll"),c=this.cBox.querySelector(".e-checkfltrnmdiv"),i=(c&&c.classList.remove("e-checkfltrnmdiv"),this.createCheckbox(i,!1,((c={})[this.options.field]=i,c))),c=(this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?H.addClass([i],this.parent.cssClass.split(" ")):H.addClass([i],[this.parent.cssClass])),this.infiniteInitialLoad||!this.infiniteRenderMod?((p=Qp(bp("cbox"),i,"e-ftrchk")).querySelector(".e-frame").classList.add("e-selectall"),this.infiniteRenderMod?(p.classList.add("e-infinitescroll"),this.parent.enableAdaptiveUI&&(this.spinner.style.height=this.spinner.offsetHeight-tu(this.cBox)+"px"),this.sBox.insertBefore(p,this.spinner)):r.appendChild(p)):this.sBox.querySelector(".e-ftrchk .e-selectall")&&(this.sBox.querySelector(".e-ftrchk .e-selectall").previousSibling.disabled=!1,this.sBox.querySelector(".e-ftrchk .e-selectall").parentElement.classList.remove("e-checkbox-disabled")),new V.Predicate("field","equal",this.options.field)),u=(this.options.foreignKeyValue&&(c=c.or("field","equal",this.options.foreignKeyValue)),this.searchClear&&this.isImmediateMode()&&(this.options.filteredColumns=this.parent.filterSettings.columns,this.isFiltered=this.options.filteredColumns.length),new V.DataManager(this.options.filteredColumns).executeLocal((new V.Query).where(c)).length),g=(this.sInput&&this.sInput.value&&!this.isImmediateMode()?(c=this.createCheckbox(this.getLocalizedLabel("AddCurrentSelection"),!1,((i={})[this.options.field]=this.getLocalizedLabel("AddCurrentSelection"),i)),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?H.addClass([c],this.parent.cssClass.split(" ")):H.addClass([c],[this.parent.cssClass])),this.infiniteRenderMod&&!H.isNullOrUndefined(this.sBox.children[2])&&this.sBox.children[2].innerText!==this.getLocalizedLabel("AddCurrentSelection")||!this.infiniteRenderMod?((i=Qp(bp("cbox"),c,"e-ftrchk")).querySelector(".e-frame").classList.add("e-add-current"),this.infiniteRenderMod?(i.classList.add("e-infinitescroll"),this.sBox.insertBefore(i,this.spinner),v=this.spinner.querySelector(".e-checkboxlist"),c=Math.ceil(i.getBoundingClientRect().height),v.style.height=parseInt(getComputedStyle(v).height.split("px")[0],10)-c+"px",v.style.minHeight=v.style.height):r.appendChild(i)):this.sBox.querySelector(".e-ftrchk .e-add-current")&&(this.sBox.querySelector(".e-ftrchk .e-add-current").previousSibling.disabled=!1,this.sBox.querySelector(".e-ftrchk .e-add-current").parentElement.classList.remove("e-checkbox-disabled"))):this.infiniteRenderMod&&!H.isNullOrUndefined(this.sBox.children[2])&&this.sBox.children[2].innerText===this.getLocalizedLabel("AddCurrentSelection")&&(v=this.spinner.querySelector(".e-checkboxlist"),c=Math.ceil(this.sBox.children[2].getBoundingClientRect().height),v.style.height=parseInt(getComputedStyle(v).height.split("px")[0],10)+c+"px",v.style.minHeight=v.style.height,H.remove(this.sBox.children[2])),void 0),h=0;h<e.length;h++){var f=bp("cbox"),m=(this.values[""+f]=H.getValue(l,e[parseInt(h.toString(),10)]),H.getValue(this.options.field,e[parseInt(h.toString(),10)])),y=(this.options.formatFn&&("dateonly"!==this.options.type||H.isNullOrUndefined(m)||(y=m.split(/[^0-9.]/),m=new Date(parseInt(y[0],10),parseInt(y[1],10)-1,parseInt(y[2],10))),m=this.valueFormatter.toView(m,this.options.formatFn)),{value:m,column:this.options.column,data:e[parseInt(h.toString(),10)]});if(this.parent.notify(Cn,y),""===(m=y.value)||H.isNullOrUndefined(m)){if(g)continue;g=!0}this.infiniteRenderMod&&this.updateInfiniteUnLoadedCheckboxExistPred(m,this.infiniteUnloadParentExistPred);m=this.localInfiniteSelectAllClicked?this.createCheckbox(m,this.infiniteLocalSelectAll,H.getValue("dataObj",e[h])):this.createCheckbox(m,this.getCheckedState(u,this.values[""+f]),H.getValue("dataObj",e[h]));r.appendChild(Qp(f,m,"e-ftrchk")),this.infiniteRenderMod&&(r.lastChild.style.height=tu(this.cBox)+"px")}i=this.cBox.scrollTop;!this.infiniteRenderMod||this.infiniteSearchValChange?this.cBox.innerHTML="":this.infiniteRenderMod&&this.cBox.children.length&&Jc([].slice.call(this.cBox.children).splice(0,this.parent.filterSettings.itemsCount)),this.infiniteRenderMod&&((c=this.infiniteLoadedElem).push.apply(c,[].slice.call(r.children)),this.itemsCnt=-1!==a?this.infiniteLoadedElem.length-a:this.infiniteLoadedElem.length),this.infiniteUnloadParentExistPred.length&&(this.infiniteLoadedElem.length>this.infiniteDataCount||!this.options.parentCurrentViewDataCount||this.options.parentTotalDataCount===this.infiniteDataCount&&this.options.parentCurrentViewDataCount)&&(this.infiniteUnloadParentExistPred=[]),Ip(this.cBox,[].slice.call(r.children)),this.infiniteRenderMod&&!this.infiniteScrollAppendDiff&&(this.infiniteScrollAppendDiff=Math.round(i-this.cBox.scrollTop)),this.updateIndeterminatenBtn(),o=this.infiniteRenderMod?!(!s||!s.disabled):(s&&(s.disabled=!1),!1)}else r.appendChild(this.parent.createElement("span",{innerHTML:this.getLocalizedLabel("NoResult")})),this.cBox.innerHTML="",this.infiniteRenderMod&&((p=this.sBox.querySelector(".e-ftrchk .e-selectall"))&&(v=p.parentElement.parentElement,p.classList.contains("e-check")?Kp(v):p.classList.contains("e-stop")&&(Kp(v),p.classList.remove("e-stop"),Kp(v)),p.previousSibling.disabled=!0,p.parentElement.classList.add("e-checkbox-disabled")),c=this.sBox.querySelector(".e-ftrchk .e-add-current"))&&(i=c.parentElement.parentElement,c.classList.contains("e-check")&&Kp(i),c.previousSibling.disabled=!0,c.parentElement.classList.add("e-checkbox-disabled")),this.cBox.appendChild(this.parent.createElement("div",{className:"e-checkfltrnmdiv"})),Ip(this.cBox.children[0],[].slice.call(r.children)),s&&(s.disabled=!0),this.filterState=!(o=!0);s&&e.length&&(this.filterState=!s.disabled,s.dataBind());var v={requestType:ot,dataSource:this.renderEmpty?[]:e};(v.filterModel=this).parent.notify(mn,v),this.parent.notify(gr,{disabled:o}),this.infiniteRenderMod&&this.infiniteInitialLoad&&(this.cBox.style.marginTop="0px"),F.hideSpinner(this.spinner),n&&"ODataV4Adaptor"===n()&&this.infiniteOdataCount===this.options.parentTotalDataCount&&this.infiniteDataCount!==this.options.parentTotalDataCount&&(this.infiniteDataCount=this.infiniteLoadedElem.length)},v.prototype.updateInfiniteUnLoadedCheckboxExistPred=function(e,t){for(var i=0;i<t.length;i++){var n,r=t[i],s=r.value instanceof Date?this.valueFormatter.toView(r.value,this.options.formatFn):r.value,o=this.options.column;o.isForeignColumn()&&(n=$p(o,{},s,this.foreignKeyData)[0],e=H.getValue(o.foreignKeyField,n)),e!==s||"equal"!==r.operator&&"notequal"!==r.operator||(this.infiniteManualSelectMaintainPred.push(t[i]),t.splice(i,1),i--)}},v.prototype.getCheckedState=function(e,t){return!this.isFiltered||!e||(e=!(!this.sInput||!this.sInput.value)||this.result[""+t],!this.infiniteRenderMod&&"notequal"===this.options.operator?!e:e)},v.getDistinct=function(e,t,i,n,r){for(var s=e.length,o=[],a={},l=!(!i||!i.isForeignColumn)&&i.isForeignColumn();s--;){var h,d,p,c="string"!=typeof(d=N(t,d=e[parseInt(s.toString(),10)]))||H.isNullOrUndefined(r)||H.isNullOrUndefined(r.parent)||H.isNullOrUndefined(r.parent.filterSettings)||H.isNullOrUndefined(r.parent.filterSettings.enableCaseSensitivity)?d:d.toLowerCase();c in a||(h={},i&&i.allowFormula&&(p=r.parent.getPrimaryKeyFieldNames()[0],p=e[parseInt(s.toString(),10)][""+p],d=r.parent.getFormulaValue(p,i.field)),h.ejValue=d,a[""+c]=!0,l&&(p=$p(i,{},d,n)[0],H.setValue(Vi,p,e[parseInt(s.toString(),10)]),d=H.getValue(i.foreignKeyValue,p)),H.setValue(t,H.isNullOrUndefined(d)?null:d,h),H.setValue("dataObj",e[parseInt(s.toString(),10)],h),o.push(h))}return V.DataUtil.group(V.DataUtil.sort(o,t,V.DataUtil.fnAscending),"ejValue")},v.getPredicate=function(e){for(var t,i=V.DataUtil.distinct(e,"field",!0)||[],n={},r=0;r<i.length;r++)0!==(t=new V.DataManager(e).executeLocal((new V.Query).where("field","equal",i[parseInt(r.toString(),10)].field))).length&&(n[i[parseInt(r.toString(),10)].field]=v.generatePredicate(t));return n},v.generatePredicate=function(e){var t=e?e.length:0,i=v.updateDateFilter(e[0]);i.ignoreAccent=!H.isNullOrUndefined(i.ignoreAccent)&&i.ignoreAccent;for(var n="date"===i.type||"datetime"===i.type||"dateonly"===i.type?ec(i,i.type):i.ejpredicate||new V.Predicate(i.field,i.operator,i.value,!v.getCaseValue(i),i.ignoreAccent,!1,i.filterComparer),r=1;r<t;r++)e[parseInt(r.toString(),10)]=v.updateDateFilter(e[parseInt(r.toString(),10)]),2<t&&1<r&&("or"===e[r].predicate&&"or"===e[r-1].predicate||"and"===e[r].predicate&&"and"===e[r-1].predicate)?"date"===e[r].type||"datetime"===e[r].type||"dateonly"===e[r].type?n.predicates.push(ec(e[parseInt(r.toString(),10)],e[r].type)):n.predicates.push(new V.Predicate(e[r].field,e[parseInt(r.toString(),10)].operator,e[parseInt(r.toString(),10)].value,!v.getCaseValue(e[parseInt(r.toString(),10)]),e[parseInt(r.toString(),10)].ignoreAccent,!1,e[parseInt(r.toString(),10)].filterComparer)):n="date"===e[r].type||"datetime"===e[r].type||"dateonly"===e[r].type?n[e[parseInt(r.toString(),10)].predicate](ec(e[parseInt(r.toString(),10)],e[parseInt(r.toString(),10)].type),e[parseInt(r.toString(),10)].type,e[parseInt(r.toString(),10)].ignoreAccent,!1,e[parseInt(r.toString(),10)].filterComparer):e[parseInt(r.toString(),10)].ejpredicate?n[e[parseInt(r.toString(),10)].predicate](e[parseInt(r.toString(),10)].ejpredicate):n[e[parseInt(r.toString(),10)].predicate](e[parseInt(r.toString(),10)].field,e[parseInt(r.toString(),10)].operator,e[parseInt(r.toString(),10)].value,!v.getCaseValue(e[parseInt(r.toString(),10)]),e[parseInt(r.toString(),10)].ignoreAccent,e[parseInt(r.toString(),10)].filterComparer);return n||null},v.getCaseValue=function(e){return H.isNullOrUndefined(e.matchCase)?!("string"===e.type||H.isNullOrUndefined(e.type)&&"string"==typeof e.value):e.matchCase},v.updateDateFilter=function(e){return("date"===e.type||"datetime"===e.type||"dateonly"===e.type||e.value instanceof Date)&&(e.type=e.type||"date"),e};var Su=v;function v(e){this.searchInputArgs=null,this.toolPanelBtns=[],this.toolPanelClasses=[],this.queryFilteredColumn=[],this.existingPredicate={},this.foreignKeyQuery=new V.Query,this.filterState=!0,this.values={},this.renderEmpty=!1,this.isCheckboxFilterTemplate=!1,this.infiniteRenderMod=!1,this.infiniteInitialLoad=!1,this.infiniteSearchValChange=!1,this.infinitePermenantLocalData=[],this.infiniteQueryExecutionPending=!1,this.infiniteSkipCnt=0,this.infiniteOdataCount=0,this.infiniteScrollAppendDiff=0,this.prevInfiniteScrollDirection="",this.infiniteLoadedElem=[],this.infiniteDataCount=0,this.infiniteLocalSelectAll=!0,this.localInfiniteSelectAllClicked=!1,this.localInfiniteSelectionInteracted=!1,this.infiniteManualSelectMaintainPred=[],this.searchClear=!1,this.lastAppliedFilter=[],this.parent=e,this.id=this.parent.element.id,this.valueFormatter=new U(this.parent.locale),this.cBoxTrue=M.createCheckBox(this.parent.createElement,!1,{checked:!0,label:" "}),this.cBoxFalse=M.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "}),this.cBoxTrue.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden",attrs:{type:"checkbox"}}),this.cBoxTrue.firstChild),this.cBoxFalse.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden",attrs:{type:"checkbox"}}),this.cBoxFalse.firstChild),this.cBoxFalse.querySelector(".e-frame").classList.add("e-uncheck"),this.parent.enableRtl&&H.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"]),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?H.addClass([this.cBoxTrue,this.cBoxFalse],this.parent.cssClass.split(" ")):H.addClass([this.cBoxTrue,this.cBoxFalse],[this.parent.cssClass]))}Cu=function(e,t){return(Cu=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Cu(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(h,wu=Su),h.prototype.getCMenuDS=function(e,t){var i={number:["Equal","NotEqual","","LessThan","LessThanOrEqual","GreaterThan","GreaterThanOrEqual","Between","","CustomFilter"],string:["Equal","NotEqual","","StartsWith","EndsWith","","Contains","NotContains","","CustomFilter"]},n=(i.date=i.number,i.datetime=i.number,i.dateonly=i.number,[]);if(!H.isNullOrUndefined(e))for(var r=0;r<i[""+e].length;r++)i[""+e][parseInt(r.toString(),10)].length?n.push(t?{text:this.getLocalizedLabel(i[""+e][parseInt(r.toString(),10)])+"...",iconCss:"e-icons e-icon-check "+(t===i[""+e][parseInt(r.toString(),10)].toLowerCase()?"":"e-emptyicon")}:{text:this.getLocalizedLabel(i[""+e][parseInt(r.toString(),10)])+"..."}):n.push({separator:!0});return n},h.prototype.destroy=function(){var e;this.dlg&&(this.unwireExEvents(),wu.prototype.closeDialog.call(this)),this.isDevice||!this.menuObj||(e=this.menuObj.element.querySelector("li.e-focused"))&&I(e,"e-excel-menu")||this.destroyCMenu(),this.dlgObj&&!this.dlgObj.isDestroyed&&this.removeDialog()},h.prototype.createMenu=function(e,t,i,n){this.menu=this.parent.createElement("div",{className:"e-contextmenu-wrapper"}),this.parent.enableRtl?this.menu.classList.add("e-rtl"):this.menu.classList.remove("e-rtl"),this.parent.cssClass&&this.menu.classList.add(this.parent.cssClass);var r,s,o,a=this.parent.createElement("ul"),l=t?"e-excl-filter-icon e-filtered":"e-excl-filter-icon";this.parent.allowSorting&&"grid"===this.parent.getModuleName()&&!this.options.isResponsiveFilter&&(o=this.parent.getColumnHeaderByUid(n.uid).getAttribute("aria-sort"),r=(n=this.parent.getColumnByField(n.field).allowSorting)&&"ascending"!==o?"e-excel-ascending":"e-disabled e-excel-ascending",n=n&&"descending"!==o?"e-excel-descending":"e-disabled e-excel-descending",o="string"===e?this.getLocalizedLabel("SortAtoZ"):"datetime"===e||"date"===e?this.getLocalizedLabel("SortByOldest"):this.getLocalizedLabel("SortSmallestToLargest"),s="string"===e?this.getLocalizedLabel("SortZtoA"):"datetime"===e||"date"===e?this.getLocalizedLabel("SortByNewest"):this.getLocalizedLabel("SortLargestToSmallest"),a.appendChild(this.createMenuElem(o,r,"e-sortascending")),a.appendChild(this.createMenuElem(s,n,"e-sortdescending")),o=this.parent.createElement("li",{className:"e-separator e-menu-item e-excel-separator"}),a.appendChild(o)),this.options.isResponsiveFilter||a.appendChild(this.createMenuElem(this.getLocalizedLabel("ClearFilter"),t?"":"e-disabled",l)),"boolean"!==e&&a.appendChild(this.createMenuElem(this.getLocalizedLabel({string:"TextFilter",date:"DateFilter",dateonly:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"}[""+e]),"e-submenu",!H.isNullOrUndefined(e)&&i&&this.ensureTextFilter()?"e-icon-check":l+" e-emptyicon",!0)),this.menu.appendChild(a),this.parent.notify(vn,{element:this.menu}),this.parent.notify(fr,{isFiltered:t})},h.prototype.createMenuElem=function(e,t,i,n){t=this.parent.createElement("li",{className:t+" e-menu-item"});return t.innerHTML=e,t.tabIndex=t.classList.contains("e-disabled")?-1:0,t.insertBefore(this.parent.createElement("span",{className:"e-menu-icon e-icons "+i,attrs:{"aria-hidden":"true"}}),t.firstChild),n&&t.appendChild(this.parent.createElement("span",{className:"e-icons e-caret"})),t},h.prototype.wireExEvents=function(){H.Browser.isDevice||H.EventHandler.add(this.dlg,"mouseover",this.hoverHandler,this),H.EventHandler.add(this.dlg,"click",this.clickExHandler,this),H.EventHandler.add(this.dlg,"keyup",this.keyUp,this),H.EventHandler.add(this.dlg,"keydown",this.keyDown,this)},h.prototype.unwireExEvents=function(){H.Browser.isDevice||H.EventHandler.remove(this.dlg,"mouseover",this.hoverHandler),H.EventHandler.remove(this.dlg,"click",this.clickExHandler),H.EventHandler.remove(this.dlg,"keyup",this.keyUp),H.EventHandler.remove(this.dlg,"keydown",this.keyDown)},h.prototype.clickExHandler=function(e){var t=I(e.target,"e-menu-item");t&&(this.getLocalizedLabel("ClearFilter")===t.innerText.trim()?(this.clearFilter(),this.closeDialog()):(this.options.isResponsiveFilter||H.Browser.isDevice)&&this.getLocalizedLabel({string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"}[this.options.type])===t.innerText.trim()&&this.hoverHandler(e))},h.prototype.focusNextOrPrevElement=function(e,t,i){e="ArrowUp"===e.key||"Tab"===e.key&&e.shiftKey?t.indexOf(document.activeElement)-1:t.indexOf(document.activeElement)+1,e=t[(e+t.length)%t.length];e&&(e.focus(),t=e.classList.contains("e-chk-hidden")?"e-chkfocus":i,i=e.classList.contains("e-chk-hidden")?I(e,"e-ftrchk"):I(e,"e-menu-item"),this.excelSetFocus(i,t))},h.prototype.keyUp=function(e){var t,i;"Tab"===e.key&&e.shiftKey||"Tab"===e.key?(t=e.target.classList.contains("e-chk-hidden")?"e-chkfocus":"e-menufocus",i=e.target.classList.contains("e-menu-item")?I(e.target,"e-menu-item"):I(e.target,"e-ftrchk"),this.excelSetFocus(i,t)):"ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.altKey?"Enter"!==e.key&&"ArrowRight"!==e.code||!e.target.classList.contains("e-menu-item")||(e.preventDefault(),e.target.click(),e.target.classList.contains("e-submenu")&&(this.hoverHandler(e),this.menuObj.element.querySelector(".e-menu-item").focus(),this.excelSetFocus(I(this.menuObj.element.querySelector(".e-menu-item"),"e-menu-item"),"e-focused"),this.focusedMenuItem=this.menuObj.element.querySelector(".e-menu-item"))):(e.preventDefault(),i=Array.from(this.dlg.querySelectorAll('input, button, [tabindex]:not([tabindex="-1"]), .e-menu-item:not(.e-disabled):not(.e-separator)')),this.focusNextOrPrevElement(e,i,"e-menufocus"))},h.prototype.keyDown=function(e){"ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.preventDefault()},h.prototype.excelSetFocus=function(e,t){var i=this.cmenu.querySelector("."+t),n=this.menu.querySelector("."+t);i&&i.classList.remove(t),n&&n.classList.contains("e-menufocus")&&n.classList.remove(t),e&&e.classList.add(t)},h.prototype.destroyCMenu=function(){this.isCMenuOpen=!1,this.menuObj&&!this.menuObj.isDestroyed&&(this.menuObj.destroy(),H.EventHandler.remove(this.menuObj.element,"keydown",this.contextKeyDownHandler),H.remove(this.cmenu),this.parent.notify(mr,{target:null,header:"",isOpen:!1,col:this.options.column}))},h.prototype.hoverHandler=function(e){var t,i,n,r;this.options.isResponsiveFilter&&"mouseover"===e.type||(r=e.target.querySelector(".e-contextmenu"),i=I(e.target,"e-menu-item"),(n=this.menu.querySelector(".e-focused"))&&n.classList.remove("e-focused"),i&&(i.classList.add("e-focused"),t=i.classList.contains("e-submenu")),r)||(t||(n=this.menu.querySelector(".e-submenu"),H.isNullOrUndefined(n)||n.classList.remove("e-selected"),this.destroyCMenu()),r=this.ensureTextFilter(),!this.isCMenuOpen&&t&&(i.classList.add("e-selected"),this.isCMenuOpen=!0,n={items:this.getCMenuDS(this.options.type,r?r.replace(/\s/g,""):void 0),select:this.selectHandler.bind(this),onClose:this.destroyCMenu.bind(this),enableRtl:this.parent.enableRtl,animationSettings:{effect:H.Browser.isDevice?"ZoomIn":"None"},beforeClose:this.preventClose.bind(this),cssClass:this.options.isResponsiveFilter&&this.parent.cssClass?"e-res-contextmenu-wrapper "+this.parent.cssClass:this.options.isResponsiveFilter?"e-res-contextmenu-wrapper":this.parent.cssClass||""},this.parent.element.appendChild(this.cmenu),this.menuObj=new B.ContextMenu(n),this.menuObj.isAngular=Oc(this.parent),this.menuObj.appendTo(this.cmenu),H.EventHandler.add(this.menuObj.element,"keydown",this.contextKeyDownHandler,this),t=this.menu.querySelector(".e-submenu").getBoundingClientRect(),i={top:0,left:0},this.options.isResponsiveFilter?(r=document.querySelector(".e-responsive-dialog > .e-dlg-header-content").offsetHeight+4,this.menuObj.element.style.height="calc(100% - "+r+"px)",this.menuObj.open(r,0,document.body),n=this.getLocalizedLabel({string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"}[this.options.type]),this.parent.notify(mr,{target:this.menuObj.element.parentElement,header:n,isOpen:!0})):(H.Browser.isDevice?(this.isDevice=!0,r=this.getContextBounds(),i.top=(window.innerHeight-r.height)/2,i.left=(window.innerWidth-r.width)/2,this.closeDialog(),this.isDevice=!1):(i.top=H.Browser.isIE?window.pageYOffset+t.top:window.scrollY+t.top,i.left=this.getCMenuYPosition(this.dlg)),this.menuObj.open(i.top,i.left,e.target)),pc(this.parent.element,this.menuObj.element.parentElement)))},h.prototype.contextKeyDownHandler=function(e){var t;"Tab"===e.key&&e.shiftKey||"Tab"===e.key?(e.preventDefault(),t=Array.from(this.menuObj.element.querySelectorAll('[tabindex]:not([tabindex="-1"]), .e-menu-item:not(.e-disabled):not(.e-separator)')),this.focusNextOrPrevElement(e,t,"e-focused")):"ArrowLeft"!==e.key&&"Escape"!==e.key||(e.preventDefault(),this.menuObj.close(),this.focusedMenuItem=null,document.querySelector(".e-submenu.e-menu-item").classList.remove("e-selected"),document.querySelector(".e-submenu.e-menu-item").focus())},h.prototype.ensureTextFilter=function(){var e,t=this.existingPredicate[this.options.field];return t&&2===t.length?e="greaterthanorequal"===t[0].operator&&"lessthanorequal"===t[1].operator?"between":"customfilter":t&&1===t.length&&(this.optrData=this.customFilterOperators[this.options.type+"Operator"],e=t[0].operator),e},h.prototype.preventClose=function(e){var t;this.options&&this.options.isResponsiveFilter&&e.event?(t=(t=e.event.target).classList&&(t.classList.contains("e-resfilterback")||t.classList.contains("e-res-back-btn")||t.classList.contains("e-menu-item")),e.cancel=!t):e.event instanceof MouseEvent&&e.event.target&&e.event.target.classList&&e.event.target.classList.contains("e-submenu")&&(e.cancel=!0)},h.prototype.getContextBounds=function(){return this.menuObj.element.style.display="block",this.menuObj.element.getBoundingClientRect()},h.prototype.getCMenuYPosition=function(e){var t=this.getContextBounds().width,i=e.getBoundingClientRect(),n=this.parent.element.getBoundingClientRect(),r=i.left-t-n.left,n=i.right+t-n.right,e=(e=e.offsetWidth-e.clientWidth)?1+e:0;return(this.parent.enableRtl?r:n)<1?i.right+1-e:i.left-t-1+e},h.prototype.openDialog=function(e){var t,i=this;this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e),e.cancel||(this.dialogObj&&this.dialogObj.dataBind(),t=this.existingPredicate[e.field]&&this.existingPredicate[e.field].length||this.options.filteredColumns.filter(function(e){return i.options.field===e.field}).length,this.createMenu(e.type,0<t,1===t||2===t,e),this.dlg.insertBefore(this.menu,this.dlg.firstChild),this.dlg.classList.add("e-excelfilter"),!e.isToolPanel&&this.parent&&!H.isNullOrUndefined(this.parent.getContent)&&this.parent.getContent()&&this.parent.getContent().firstElementChild.offsetHeight<this.dlg.offsetHeight&&!I(this.parent.element,"e-gantt-dialog")&&Ac(this.parent,this.dialogObj),this.parent.enableRtl&&this.dlg.classList.add("e-rtl"),this.dlg.classList.remove("e-checkboxfilter"),this.cmenu=this.parent.createElement("ul",{className:"e-excel-menu"}),this.dlg.querySelectorAll(".e-menu-item").forEach(function(e){e.scrollWidth>e.clientWidth&&e.setAttribute("title",e.textContent)}),e.column.showColumnMenu&&!e.isToolPanel&&this.parent.notify(Ni,{}),this.wireExEvents())},h.prototype.closeDialog=function(){this.destroy()},h.prototype.selectHandler=function(e){e.item&&(this.parent.notify(yr,{}),this.menuItem=e.item,this.closeDialog(),this.renderDialogue(e))},h.prototype.renderDialogue=function(e){var l=this,e=e?e.element:void 0,t=this.options.field,i=!H.isNullOrUndefined(t)&&Fp(t),n=!H.isNullOrUndefined(t)&&Mp(t),r=this.parent.createElement("div",{className:"e-xlfl-maindiv",id:i?n+"-xlflmenu":t+"-xlflmenu"});this.dlgDiv=this.parent.createElement("div",{className:"e-xlflmenu",id:i?n+"-xlfldlg":t+"-xlfldlg"}),(this.options.isResponsiveFilter?document.querySelector(".e-resfilter > .e-dlg-content > .e-xl-customfilterdiv"):this.parent.element).appendChild(this.dlgDiv),this.dlgObj=new F.Dialog({header:this.getLocalizedLabel("CustomFilter"),isModal:!0,overlayClick:this.removeDialog.bind(this),showCloseIcon:!0,locale:this.parent.locale,closeOnEscape:!0,target:document.body,visible:!1,enableRtl:this.parent.enableRtl,open:function(){for(var e=[].slice.call(l.dlgObj.element.querySelectorAll("table.e-xlfl-table tr.e-xlfl-fields")),t=0;t<e.length;t++){var i=e[t].children[1].querySelector(".e-control"),n=e[t].querySelector(".e-dropdownlist.e-control").ej2_instances[0];"isempty"===n.value||"isnotempty"===n.value||"isnull"===n.value||"isnotnull"===n.value?i.ej2_instances[0].enabled=!1:i&&!H.isNullOrUndefined(i.getAttribute("disabled"))&&(i.ej2_instances[0].enabled=!0)}var r,s,o,a=l.dlgObj.element.querySelector("table.e-xlfl-table>tr");l.options.column.filterTemplate&&(r=Fp(l.options.column.field)?Mp(l.options.column.field):l.options.column.field,s=l.parent.isReact&&"string"!=typeof l.options.column.filterTemplate&&!(l.options.column.filterTemplate.prototype&&l.options.column.filterTemplate.prototype.CSPTemplate),o=l.parent.parentDetails&&l.parent.parentDetails.parentInstObj&&l.parent.parentDetails.parentInstObj.isReact,s||o?l.parent.renderTemplates(function(){a.querySelector("#"+kp(r+"-xlfl-frstvalue")).focus()}):a.querySelector("#"+kp(r+"-xlfl-frstvalue")).focus())},close:this.removeDialog.bind(this),created:this.createdDialog.bind(this,e,t),buttons:[{click:this.filterBtnClick.bind(this,t),buttonModel:{content:this.getLocalizedLabel("OKButton"),isPrimary:!0,cssClass:this.parent.cssClass?"e-xlfl-okbtn "+this.parent.cssClass:"e-xlfl-okbtn"}},{click:this.removeDialog.bind(this),buttonModel:{content:this.getLocalizedLabel("CancelButton"),cssClass:this.parent.cssClass?"e-xlfl-cancelbtn "+this.parent.cssClass:"e-xlfl-cancelbtn"}}],content:r,width:430,animationSettings:{effect:"None"},cssClass:this.parent.cssClass||""});this.dlgObj.isStringTemplate=!0,this.renderResponsiveDialog(),Ec(this.parent,this.dlgObj),this.dlgDiv.setAttribute("aria-label",this.getLocalizedLabel("CustomFilterDialogARIA")),this.childRefs.unshift(this.dlgObj),this.dlgObj.appendTo(this.dlgDiv)},h.prototype.renderResponsiveDialog=function(){var e;this.options.isResponsiveFilter&&((e=document.querySelector(".e-row-responsive-filter"))&&e.classList.remove("e-row-responsive-filter"),this.dlgObj.buttons=[{}],this.dlgObj.header=void 0,this.dlgObj.position={X:"",Y:""},this.dlgObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-xl-customfilterdiv"),this.dlgObj.width="100%",this.dlgObj.isModal=!1,this.dlgObj.showCloseIcon=!1)},h.prototype.removeDialog=function(){this.parent.notify(vr,{}),(this.parent.isReact||this.parent.isVue)&&void 0!==this.parent.destroyTemplate&&Zc(this.parent,["filterTemplate"]),this.removeObjects(this.childRefs),H.remove(this.dlgDiv),this.parent.notify(ur,{})},h.prototype.createdDialog=function(e,t){this.renderCustomFilter(e,t),this.dlgObj.element.style.left="0px",this.options.isResponsiveFilter?(i=document.querySelector(".e-responsive-dialog > .e-dlg-header-content").offsetHeight+4,this.dlgObj.element.style.top=i+"px"):this.dlgObj.element.style.top="0px",!this.options.isResponsiveFilter&&H.Browser.isDevice&&window.innerWidth<440&&(this.dlgObj.element.style.width="90%"),this.parent.notify(cn,{column:t,dialog:this.dialogObj});var i={column:t,dialogInstance:this.dialogObj,cancel:!1,target:e};this.parent.trigger(pn,i),i.cancel?((this.parent.isReact||this.parent.isVue)&&void 0!==this.parent.destroyTemplate&&Zc(this.parent,["filterTemplate"]),this.removeObjects(this.childRefs),H.remove(this.dlgDiv)):(this.dlgObj.show(),pc(this.parent.element,this.dlgObj.element.parentElement))},h.prototype.renderCustomFilter=function(e,t){var i=this.dlgObj.element.querySelector(".e-xlfl-maindiv"),n=this.parent.createElement("div",{innerHTML:this.getLocalizedLabel("ShowRowsWhere"),className:"e-xlfl-dlgfields"}),n=(i.appendChild(n),this.parent.createElement("div",{innerHTML:this.options.displayName,className:"e-xlfl-fieldset"}));i.appendChild(n),this.renderFilterUI(t,i)},h.prototype.filterBtnClick=function(e){var t,i,n=!H.isNullOrUndefined(e)&&Fp(e),r=!H.isNullOrUndefined(e)&&Mp(e),n=n?r:e,r="string"===this.options.type&&H.isNullOrUndefined(this.options.template)?(t=this.dlgDiv.querySelector("#"+kp(n+"-xlfl-frstvalue")),this.dlgDiv.querySelector("#"+kp(n+"-xlfl-secndvalue"))):(t=this.dlgDiv.querySelector("#"+kp(n+"-xlfl-frstvalue")).ej2_instances[0],this.dlgDiv.querySelector("#"+kp(n+"-xlfl-secndvalue")).ej2_instances[0]),e=this.dlgDiv.querySelector("#"+kp(n+"-xlfl-frstoptr")).ej2_instances[0],s=this.dlgDiv.querySelector("#"+kp(n+"-xlfl-secndoptr")).ej2_instances[0];"string"===this.options.type&&(i=this.dlgDiv.querySelector("#"+kp(n+"-xlflmtcase")).ej2_instances[0].checked);n=this.dlgDiv.querySelector("#"+kp(n+"e-xlfl-frstpredicate")).ej2_instances[0].checked?"and":"or";this.filterByColumn(this.options.field,e.value,t.value,n,i,this.options.ignoreAccent,s.value,r.value),this.removeDialog()},h.prototype.filterByColumn=function(e,t,i,n,r,s,o,a){var l=this.parent.getColumnByField?this.parent.getColumnByField(e):this.options.column,h=this.isForeignColumn(l)?l.foreignKeyValue:e,d=[],e={instance:this,handler:this.filterByColumn,arg1:e,arg2:t,arg3:i,arg4:n,arg5:r,arg6:s,arg7:o,arg8:a,cancel:!1};this.parent.notify(yn,e),e.cancel||(d.push({field:h,predicate:n,matchCase:r,ignoreAccent:s,operator:t,value:e.arg3,type:this.options.type}),i=new V.Predicate(h,t.toLowerCase(),e.arg3,!r,s),H.isNullOrUndefined(o)||(d.push({field:h,predicate:n,matchCase:r,ignoreAccent:s,operator:o,value:e.arg8,type:this.options.type}),i=i[""+n](h,o.toLowerCase(),a,!r,s)),t={action:"filtering",filterCollection:d,field:this.options.field,ejpredicate:i,actualPredicate:d},this.isForeignColumn(l)?this.foreignKeyFilter(t,d,i):this.options.handler(t))},h.prototype.renderOperatorUI=function(e,t,i,n,r){var s=this.parent.createElement("tr",{className:"e-xlfl-fields",attrs:{role:"row"}}),t=(t.appendChild(s),this.parent.createElement("td",{className:"e-xlfl-optr"})),o=(s.appendChild(t),this.parent.createElement("div",{className:"e-xlfl-optrdiv"})),a=!H.isNullOrUndefined(e)&&Fp(e),l=!H.isNullOrUndefined(e)&&Mp(e),a=this.parent.createElement("input",{id:a?l+i:e+i}),l=(o.appendChild(a),t.appendChild(o),this.options.type+"Operator"),e=this.customFilterOperators[l],i=(this.optrData=e,this.dropSelectedVal(this.options.column,n,r)),o=(this.menuItem&&((t=this.menuItem.text.slice(0,-3))!==this.getLocalizedLabel("CustomFilter")&&(i=r?t:void 0),t===this.getLocalizedLabel("Between"))&&(i=this.getLocalizedLabel(r?"GreaterThanOrEqual":"LessThanOrEqual")),this.options.column),l=new P.DropDownList(pp({dataSource:e,fields:{text:"text",value:"value"},text:i,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass||null},o.filter.params)),n=(l.isAngular=Oc(this.parent),this.childRefs.unshift(l),{open:this.dropDownOpen.bind(this),change:this.dropDownValueChange.bind(this)});return Yc(a.id,[Us,Hs],n,this),l.addEventListener(Us,this.eventHandlers[a.id][Us]),l.addEventListener(Hs,this.eventHandlers[a.id][Hs]),l.appendTo(a),{fieldElement:s,operator:this.getSelectedValue(i)}},h.prototype.removeHandlersFromComponent=function(e){e.element.classList.contains("e-dropdownlist")?$c(e,[Us,Hs],this):e.element.classList.contains("e-autocomplete")&&$c(e,[c,Vs],this)},h.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=((this.dialogObj||this.dlgObj).zIndex+1).toString()},h.prototype.dropDownValueChange=function(e){e.element.id.includes("-xlfl-frstoptr")?this.firstOperator=e.value.toString():this.secondOperator=e.value.toString();var t=e.element.closest(".e-xlfl-fields").children[1].querySelector(".e-control"),e=e.element.ej2_instances[0];"isempty"===e.value||"isnotempty"===e.value||"isnull"===e.value||"isnotnull"===e.value?t.ej2_instances[0].enabled=!1:H.isNullOrUndefined(t.getAttribute("disabled"))||(t.ej2_instances[0].enabled=!0)},h.prototype.getFilterUIInfo=function(){return{firstOperator:this.firstOperator,secondOperator:this.secondOperator,field:this.options.field}},h.prototype.getSelectedValue=function(e){e=new V.DataManager(this.optrData).executeLocal((new V.Query).where("text","equal",e));return H.isNullOrUndefined(e[0])?"":e[0].value},h.prototype.dropSelectedVal=function(e,t,i){t=t&&0<t.length?2===t.length?(i?t[0]:t[1]).operator:i?t[0].operator:void 0:i&&"string"===e.type&&!e.filter.operator?"startswith":i?e.filter.operator||"equal":void 0;return this.getSelectedText(t)},h.prototype.getSelectedText=function(e){e=new V.DataManager(this.optrData).executeLocal((new V.Query).where("value","equal",e));return H.isNullOrUndefined(e[0])?"":e[0].text},h.prototype.renderFilterUI=function(e,t){var i=this.existingPredicate[""+e],n=this.parent.createElement("table",{className:"e-xlfl-table",attrs:{role:"grid"}}),t=(t.appendChild(n),this.parent.createElement(qs)),t=(t.innerHTML='<col style="width: 50%"></col><col style="width: 50%"></col>',n.appendChild(t),this.renderOperatorUI(e,n,"-xlfl-frstoptr",i,!0)),r=(this.firstOperator=t.operator,this.renderFlValueUI(e,t,"-xlfl-frstvalue",i,!0),this.parent.createElement("tr",{className:"e-xlfl-predicate",attrs:{role:"row"}}));n.appendChild(r),this.renderRadioButton(e,r,i),t=this.renderOperatorUI(e,n,"-xlfl-secndoptr",i,!1),this.secondOperator=t.operator,this.renderFlValueUI(e,t,"-xlfl-secndvalue",i,!1)},h.prototype.renderRadioButton=function(e,t,i){var n=this.parent.createElement("td",{className:"e-xlfl-radio",attrs:{colSpan:"2"}}),r=(t.appendChild(n),this.parent.createElement("div",{className:"e-xlfl-radiodiv"})),s=(r.style.display="inline-block",!H.isNullOrUndefined(e)&&Fp(e)),o=!H.isNullOrUndefined(e)&&Mp(e),a=this.parent.createElement("input",{id:s?o+"e-xlfl-frstpredicate":e+"e-xlfl-frstpredicate",attrs:{type:"radio"}}),s=this.parent.createElement("input",{id:s?o+"e-xlfl-secndpredicate":e+"e-xlfl-secndpredicate",attrs:{type:"radio"}}),o=(r.appendChild(a),r.appendChild(s),n.appendChild(r),"string"===this.options.type&&this.renderMatchCase(e,t,n,"-xlflmtcase",i),new M.RadioButton({label:this.getLocalizedLabel("AND"),name:"default",checked:!0,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass||""})),r=(this.childRefs.unshift(o),new M.RadioButton({label:this.getLocalizedLabel("OR"),name:"default",enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass||""}));this.childRefs.unshift(r),"and"===(i&&2===i.length?i[1].predicate:"and")?(o.checked=!0,r.checked=!1):(r.checked=!0,o.checked=!1),o.appendTo(a),r.appendTo(s),o.element.nextElementSibling.classList.add("e-xlfl-radio-and"),r.element.nextElementSibling.classList.add("e-xlfl-radio-or")},h.prototype.removeObjects=function(e){for(var t=0,i=e;t<i.length;t++){var n=i[t];n&&!n.isDestroyed&&(this.removeHandlersFromComponent(n),n.destroy())}},h.prototype.renderFlValueUI=function(t,e,i,n,r){var s,o,a=this.parent.createElement("td",{className:"e-xlfl-value"}),l=(e.fieldElement.appendChild(a),!H.isNullOrUndefined(t)&&Fp(t)),h=!H.isNullOrUndefined(t)&&Mp(t),d=this.parent.createElement("div",{className:"e-xlfl-valuediv"}),p=this.options.filteredColumns.some(function(e){return t===e.field}),c=this.options.filteredColumns.filter(function(e){return e.field===t});this.options.column.filterTemplate?(o={},s=this.options.column,p&&i&&(o=this.getExcelFilterData(i,o,s,n,c)),p=this.parent.isReact&&"string"!=typeof this.options.column.filterTemplate&&!(this.options.column.filterTemplate.prototype&&this.options.column.filterTemplate.prototype.CSPTemplate),c=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,s=this.parent.element.id+s.uid+"filterTemplate",p||c?this.options.column.getFilterTemplate()(o,this.parent,"filterTemplate",s,null,null,d):(o=this.options.column.getFilterTemplate()(o,this.parent,"filterTemplate",s,null,null,null,this.parent.root),Ip(d,o)),p||c?this.parent.renderTemplates(function(){d.querySelector("input").id=l?h+i:t+i,a.appendChild(d)}):((this.parent.isAngular?d.children[0]:d.querySelector("input")).id=l?h+i:t+i,a.appendChild(d))):(s=this.parent.createElement("input",{id:l?h+i:t+i}),d.appendChild(s),o=void a.appendChild(d),p=void 0,n&&0<n.length&&(o=(p=2===n.length?r?n[0]:n[1]:r?n[0]:void 0)&&p.operator===e.operator?p.value:void 0,H.isNullOrUndefined(o))&&(o=void 0),{string:this.renderAutoComplete.bind(this),number:this.renderNumericTextBox.bind(this),date:this.renderDate.bind(this),dateonly:this.renderDate.bind(this),datetime:this.renderDateTime.bind(this)}[this.options.type](this.options,t,s,o,this.parent.enableRtl))},h.prototype.getExcelFilterData=function(e,t,i,n,r){var s="-xlfl-frstvalue"===e?0:1;return("-xlfl-frstvalue"===e||1<r.length)&&(t={column:n instanceof Array?n[parseInt(s.toString(),10)]:n},e=this.options.column.columnData&&1<r.length?1===this.options.column.columnData.length?0:1:s,t[this.options.field]=i.foreignKeyValue?this.options.column.columnData[parseInt(e.toString(),10)][i.foreignKeyValue]:r[parseInt(e.toString(),10)].value,this.options.foreignKeyValue)&&(t[this.options.foreignKeyValue]=this.options.column.columnData[parseInt(e.toString(),10)][i.foreignKeyValue]),t},h.prototype.renderMatchCase=function(e,t,i,n,r){var s=this.parent.createElement("div",{className:"e-xlfl-matchcasediv"}),o=(s.style.display="inline-block",!H.isNullOrUndefined(e)&&Fp(e)),a=!H.isNullOrUndefined(e)&&Mp(e),o=this.parent.createElement("input",{id:o?a+n:e+n,attrs:{type:"checkbox"}}),a=(s.appendChild(o),i.appendChild(s),!!(r&&0<r.length)&&(r&&2===r.length?r[1]:r[0]).matchCase),e=new M.CheckBox({label:this.getLocalizedLabel("MatchCase"),enableRtl:this.parent.enableRtl,checked:a,cssClass:this.parent.cssClass||""});this.childRefs.unshift(e),e.appendTo(o)},h.prototype.renderDate=function(e,t,i,n,r){var s=ic(e.format,e.type)||e.format,s=new L.DatePicker(pp({format:s,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:r,value:new Date(n),locale:this.parent.locale},e.column.filter.params));this.childRefs.unshift(s),s.appendTo(i)},h.prototype.renderDateTime=function(e,t,i,n,r){var s=ic(e.format,e.type),s=new L.DateTimePicker(pp({format:s,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:this.getLocalizedLabel("CustomFilterDatePlaceHolder"),width:"100%",enableRtl:r,value:new Date(n),locale:this.parent.locale},e.column.filter.params));this.childRefs.unshift(s),s.appendTo(i)},h.prototype.completeAction=function(e){e.result=Hp(e.result)},h.prototype.renderNumericTextBox=function(e,t,i,n,r){r=new k.NumericTextBox(pp({format:e.format,placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:r,value:n,locale:this.parent.locale,cssClass:this.parent.cssClass||null},e.column.filter.params));this.childRefs.unshift(r),r.appendTo(i)},h.prototype.renderAutoComplete=function(e,t,i,n,r){var s=this.options.column,o=this.isForeignColumn(s),a=(o?s:e).dataSource,o={value:o?s.foreignKeyValue:t},l=new P.AutoComplete(pp({dataSource:a instanceof V.DataManager?a:new V.DataManager(a),fields:o,query:this.getQuery(),sortOrder:"Ascending",locale:this.parent.locale,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",autofill:!0,placeholder:this.getLocalizedLabel("CustomFilterPlaceHolder"),enableRtl:r,text:n},s.filter.params)),r=(a&&"result"in a&&(o=Cc({requestType:"stringfilterrequest"},this.getQuery()),this.parent.trigger(Gi,o.state),o.deffered.promise.then(function(e){l.dataSource=new V.DataManager(e)})),this.childRefs.unshift(l),{actionComplete:this.acActionComplete(l,t),focus:this.acFocus(l,t,e,i)});Yc(i.id,[c,Vs],r,this),l.addEventListener(Vs,this.eventHandlers[i.id][Vs]),l.addEventListener(c,this.eventHandlers[i.id][c]),l.appendTo(i)},h.prototype.acActionComplete=function(r,t){return function(e){var n=!H.isNullOrUndefined(t)&&Fp(t);e.result=e.result.filter(function(e,t,i){return i.map(function(e){return n?Gc(r.fields.value,e):e[r.fields.value]}).indexOf(n?Gc(r.fields.value,e):e[r.fields.value])===t})}},h.prototype.acFocus=function(i,n,r,s){var o=this;return function(){var e=!H.isNullOrUndefined(n)&&Fp(n),t=!H.isNullOrUndefined(n)&&Mp(n),e=e?t:n,t="#"+kp(e+(s.id===e+"-xlfl-frstvalue"?"-xlfl-frstoptr":"-xlfl-secndoptr"));i.filterType=o.dlgDiv.querySelector(t).ej2_instances[0].value,i.ignoreCase="string"!==r.type||!o.dlgDiv.querySelector("#"+kp(e+"-xlflmtcase")).ej2_instances[0].checked,i.filterType=H.isNullOrUndefined(i.filterType)?"equal":i.filterType}};var Cu,wu,bu=h;function h(e,t){e=wu.call(this,e)||this;return e.childRefs=[],e.eventHandlers={},e.isDevice=!1,e.focusedMenuItem=null,e.customFilterOperators=t,e.isExcel=!0,e}Ru.prototype.updateModel=function(){var e={field:this.columnName,direction:this.direction},t=this.parent.groupSettings.columns,i=!1;if(this.isMultiSort)-1<(a=this.getSortedColsIndexByField(this.columnName))&&this.sortSettings.columns.splice(a,1),this.sortSettings.columns.push(e),this.sortSettings.columns=this.sortSettings.columns;else if(t.length){for(var n=[],r=0,s=t.length;r<s;r++){var o,a=this.getSortedColsIndexByField(t[parseInt(r.toString(),10)],n);this.columnName===t[parseInt(r.toString(),10)]?(i=!0,n.push(e)):(o=this.getSortColumnFromField(t[parseInt(r.toString(),10)]),n.push({field:o.field,direction:o.direction,isFromGroup:o.isFromGroup}))}i||n.push(e),this.sortSettings.columns=n}else this.sortSettings.columns=[e];this.parent.dataBind(),this.lastSortedCol=this.columnName},Ru.prototype.onActionComplete=function(e){var t=this.isRemove?{requestType:"sorting",type:c}:{columnName:this.columnName,direction:this.direction,requestType:"sorting",type:c};this.isRemove=!1,this.parent.trigger(c,H.extend(e,t))},Ru.prototype.sortColumn=function(e,t,i){var n=this.parent;!1===this.parent.getColumnByField(e).allowSorting||this.parent.isContextMenuOpen()?this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:e}):(n.allowMultiSorting||(i=n.allowMultiSorting),this.isActionPrevent()?n.notify(ci,{instance:this,handler:this.sortColumn,arg1:e,arg2:t,arg3:i}):(this.backupSettings(),this.columnName=e,this.direction=t,this.isMultiSort=i,this.removeSortIcons(),this.updateSortedCols(e,i),this.updateModel()))},Ru.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,oe.ResponsiveDialogAction.isSort)},Ru.prototype.backupSettings=function(){this.lastSortedCols=lp(this.sortSettings.columns),this.lastCols=this.sortedColumns},Ru.prototype.restoreSettings=function(){this.isModelChanged=!1,this.isMultiSort=!0,this.parent.setProperties({sortSettings:{columns:this.lastSortedCols}},!0),this.sortedColumns=this.lastCols,this.isModelChanged=!0},Ru.prototype.updateSortedCols=function(e,t){if(!t)if(this.parent.allowGrouping)for(var i=0,n=this.sortedColumns.length;i<n;i++)this.parent.groupSettings.columns.indexOf(this.sortedColumns[parseInt(i.toString(),10)])<0&&(this.sortedColumns.splice(i,1),n--,i--);else this.sortedColumns.splice(0,this.sortedColumns.length);this.sortedColumns.indexOf(e)<0&&this.sortedColumns.push(e)},Ru.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&(this.contentRefresh&&(e=this.sortSettings.columns.length?{columnName:this.columnName,direction:this.direction,requestType:"sorting",type:y,target:this.currentTarget,cancel:!1}:{requestType:"sorting",type:y,cancel:!1,target:this.currentTarget},this.parent.notify(bt,e)),this.refreshSortSettings(),this.removeSortIcons(),this.addSortIcons())},Ru.prototype.refreshSortSettings=function(){this.sortedColumns.length=0;for(var e=this.sortSettings.columns,t=0;t<e.length;t++)e[parseInt(t.toString(),10)].isFromGroup||this.sortedColumns.push(e[parseInt(t.toString(),10)].field)},Ru.prototype.clearSorting=function(){var e=vp(this.sortSettings.columns);if(this.isActionPrevent())this.parent.notify(ci,{instance:this,handler:this.clearSorting});else for(var t=0,i=e.length;t<i;t++)this.removeSortColumn(e[parseInt(t.toString(),10)].field)},Ru.prototype.isActionPrevent=function(){return Bp(this.parent)},Ru.prototype.removeSortColumn=function(e){var t=this.parent,i=this.sortSettings.columns;if(!(0===i.length&&this.sortedColumns.indexOf(e)<0))if(this.isActionPrevent())this.parent.notify(ci,{instance:this,handler:this.removeSortColumn,arg1:e});else{this.backupSettings(),this.removeSortIcons();for(var n={requestType:"sorting",type:y,target:this.currentTarget},r=0,s=i.length;r<s;r++)if(i[parseInt(r.toString(),10)].field===e&&!(t.allowGrouping&&-1<t.groupSettings.columns.indexOf(i[parseInt(r.toString(),10)].field))){this.sortedColumns.splice(this.sortedColumns.indexOf(i[parseInt(r.toString(),10)].field),1),i.splice(r,1),this.isRemove=!0,this.isModelChanged&&this.parent.notify(bt,n);break}n.cancel||this.addSortIcons()}},Ru.prototype.getSortedColsIndexByField=function(e,t){for(var i=t||this.sortSettings.columns,n=0,r=i.length;n<r;n++)if(i[parseInt(n.toString(),10)].field===e)return n;return-1},Ru.prototype.getModuleName=function(){return"sort"},Ru.prototype.initialEnd=function(){if(this.parent.off(vt,this.initialEnd),this.parent.getColumns().length&&this.sortSettings.columns.length){var e=this.parent;this.contentRefresh=!1,this.isMultiSort=1<this.sortSettings.columns.length;for(var t=0,i=e.sortSettings.columns.slice();t<i.length;t++){var n=i[t];-1<this.sortedColumns.indexOf(n.field)&&this.sortColumn(n.field,n.direction,!0)}this.isMultiSort=!1,this.contentRefresh=!0}},Ru.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:Sr,handler:this.setFullScreenDialog},{event:Qr,handler:this.renderResponsiveChangeAction},{event:vt,handler:this.initialEnd},{event:Dt,handler:this.onActionComplete},{event:wt,handler:this.onPropertyChanged},{event:_t,handler:this.clickHandler},{event:Rt,handler:this.refreshSortIcons},{event:Gt,handler:this.keyPressed},{event:Yi,handler:this.cancelBeginEvent},{event:s,handler:this.destroy}],Kc(this.parent,this.evtHandlers,!0,this),H.EventHandler.add(document.body,"click",this.excelFilterSortAction,this),H.EventHandler.add(document.body,"touchend",this.excelFilterSortAction,this))},Ru.prototype.removeEventListener=function(){this.parent.isDestroyed||(Kc(this.parent,this.evtHandlers,!1),H.EventHandler.remove(document.body,"click",this.excelFilterSortAction),H.EventHandler.remove(document.body,"touchend",this.excelFilterSortAction))},Ru.prototype.excelFilterSortAction=function(e){var t=I(e.target,"e-grid-popup"),i=this.parent.element.id+"_e-popup";t&&t.id===i&&I(e.target,"e-excelfilter")&&this.excelFilterSortActionHandler(e)},Ru.prototype.destroy=function(){this.isModelChanged=!1;var e=this.parent.element;e&&(e.querySelector("."+ms)||e.querySelector("."+vs))&&(this.parent.element.querySelector(".e-gridpopup").getElementsByClassName("e-sortdirect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none"),this.parent.refreshing||!this.parent.isDestroyed&&this.parent.allowSorting||this.clearSorting(),this.isModelChanged=!0,this.removeEventListener())},Ru.prototype.cancelBeginEvent=function(e){"sorting"===e.requestType&&(this.restoreSettings(),this.refreshSortIcons(),this.isMultiSort=!0)},Ru.prototype.clickHandler=function(e){var t=this.parent,i=(this.currentTarget=null,this.popUpClickHandler(e),H.closest(e.target,".e-headercell"));!i||e.target.closest(".e-hierarchycheckbox")||e.target.classList.contains("e-grptogglebtn")||i.classList.contains("e-resized")||e.target.classList.contains("e-rhandler")||e.target.classList.contains("e-columnmenu")||e.target.classList.contains("e-filtermenudiv")||I(e.target,"e-stackedheadercell")||t.allowSelection&&t.selectionSettings.allowColumnSelection&&e.target.classList.contains("e-headercell")||"checkbox"!==(t=this.parent.getColumnByUid(i.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"))).type&&(this.initiateSort(i,e,t),H.Browser.isDevice)&&this.showPopUp(e),i&&i.classList.remove("e-resized"),this.excelFilterSortActionHandler(e)},Ru.prototype.excelFilterSortActionHandler=function(e){var t;(I(e.target,"e-excel-ascending")||I(e.target,"e-excel-descending"))&&(t=H.closest(e.target,".e-filter-popup").getAttribute("data-uid"),e=H.isNullOrUndefined(I(e.target,"e-excel-descending"))?"Ascending":"Descending",this.sortColumn(this.parent.getColumnByUid(t).field,e,!1))},Ru.prototype.keyPressed=function(e){var t,i=e.target;this.parent.isEdit||"enter"!==e.action&&"ctrlEnter"!==e.action&&"shiftEnter"!==e.action||!H.closest(i,".e-headercell")||(i=this.focus.getFocusedElement(),!H.isNullOrUndefined(i)&&i.classList.contains("e-headercell")&&i.querySelector(".e-headercelldiv")&&(t=this.parent.getColumnByUid(i.querySelector(".e-headercelldiv").getAttribute("data-mappinguid")),this.initiateSort(i,e,t)))},Ru.prototype.initiateSort=function(e,t,i){var n=this.parent,i=i.field,r=(this.currentTarget=t.target,e.getElementsByClassName("e-ascending").length?"Descending":"Ascending");this.isMultiSort=t.ctrlKey||this.enableSortMultiTouch||-1!==navigator.userAgent.indexOf("Mac OS")&&t.metaKey,t.shiftKey||this.sortSettings.allowUnsort&&e.getElementsByClassName("e-descending").length&&!(-1<n.groupSettings.columns.indexOf(i))?this.removeSortColumn(i):this.sortColumn(i,r,this.isMultiSort)},Ru.prototype.showPopUp=function(e){var t=H.closest(e.target,".e-headercell");!this.parent.allowMultiSorting||H.isNullOrUndefined(t)&&!this.parent.isContextMenuOpen()||gp(this.parent.element.querySelector(".e-gridpopup"),e,"e-sortdirect e-icons e-icon-sortdirect"+(1<this.sortedColumns.length?" e-spanclicked":""))},Ru.prototype.popUpClickHandler=function(e){var t=e.target;H.closest(t,".e-headercell")||e.target.classList.contains(b)||H.closest(t,".e-gridpopup")?t.classList.contains("e-sortdirect")&&(t.classList.contains("e-spanclicked")?(t.classList.remove("e-spanclicked"),this.enableSortMultiTouch=!1,this.parent.element.querySelector(".e-gridpopup").style.display="none"):(t.classList.add("e-spanclicked"),this.enableSortMultiTouch=!0)):this.parent.element.querySelector(".e-gridpopup").style.display="none"},Ru.prototype.addSortIcons=function(){for(var e,t=this.parent,i=this.sortSettings.columns,n=this.parent.getColumns().map(function(e){return e.field}),r=0,s=i.length;r<s;r++)e=t.getColumnHeaderByField(i[parseInt(r.toString(),10)].field),-1===n.indexOf(i[parseInt(r.toString(),10)].field)||H.isNullOrUndefined(e)||(this.aria.setSort(e,i[parseInt(r.toString(),10)].direction.toLowerCase()),1<i.length&&e.querySelector(".e-headercelldiv").insertBefore(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(r+1).toString()}),e.querySelector(".e-headertext")),e=e.querySelector(".e-sortfilterdiv"),"Ascending"===i[parseInt(r.toString(),10)].direction?H.classList(e,["e-ascending","e-icon-ascending"],[]):H.classList(e,["e-descending","e-icon-descending"],[]))},Ru.prototype.removeSortIcons=function(e){for(var t,i=this.parent,n=this.parent.getColumns().map(function(e){return e.field}),r=e||0,s=H.isNullOrUndefined(e)?n.length:e+1;r<s;r++)t=i.getColumnHeaderByField(n[parseInt(r.toString(),10)]),H.isNullOrUndefined(t)||i.allowGrouping&&-1<i.groupSettings.columns.indexOf(n[parseInt(r.toString(),10)])&&!t.querySelector(".e-sortfilterdiv")||H.isNullOrUndefined(n[parseInt(r.toString(),10)])||(this.aria.setSort(t,"none"),H.classList(t.querySelector(".e-sortfilterdiv"),[],["e-descending","e-icon-descending","e-ascending","e-icon-ascending"]),t.querySelector(".e-sortnumber")&&t.querySelector(".e-headercelldiv").removeChild(t.querySelector(".e-sortnumber")))},Ru.prototype.getSortColumnFromField=function(e){for(var t=0,i=this.sortSettings.columns.length;t<i;t++)if(this.sortSettings.columns[parseInt(t.toString(),10)].field===e)return this.sortSettings.columns[parseInt(t.toString(),10)];return!1},Ru.prototype.updateAriaAttr=function(){for(var e=this.parent.getColumns().map(function(e){return e.field}),t=0,i=this.sortedColumns;t<i.length;t++){var n,r=i[t];-1!==e.indexOf(r)&&(n=this.parent.getColumnHeaderByField(r),this.aria.setSort(n,this.getSortColumnFromField(r).direction.toLowerCase()))}},Ru.prototype.refreshSortIcons=function(){this.removeSortIcons(),this.isMultiSort=!0,this.removeSortIcons(),this.addSortIcons(),this.isMultiSort=!1,this.updateAriaAttr()},Ru.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},Ru.prototype.showCustomSort=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog()};var Iu=Ru;function Ru(e,t,i,n){this.contentRefresh=!0,this.isModelChanged=!0,this.aria=new Co,this.currentTarget=null,H.initializeTelemetryFeature("Sort","DataGrid"),this.parent=e,this.sortSettings=t,this.sortedColumns=i,this.serviceLocator=n,this.focus=n.getService("focus"),this.addEventListener(),this.setFullScreenDialog()}Du.prototype.render=function(){this.pagerElement=this.pagerModule.element,this.renderNumericContainer(),this.refreshNumericLinks(),this.wireEvents()},Du.prototype.refresh=function(){this.pagerModule.updateTotalPages(),this.links.length&&this.updateLinksHtml(),this.refreshAriaAttrLabel(),this.updateStyles()},Du.prototype.refreshNumericLinks=function(){var e,t=this.pagerModule,i=t.element.querySelector(".e-numericcontainer"),n=document.createDocumentFragment();i.innerHTML="";for(var r=1;r<=t.pageCount;r++)e=H.createElement("a",{className:"e-link e-numericitem e-spacing e-pager-default",attrs:{tabindex:"-1","aria-label":t.getLocalizedLabel("Page")+r+t.getLocalizedLabel("Of")+t.totalPages+t.getLocalizedLabel("Pages"),href:"#"}}),t.currentPage===r&&(H.classList(e,["e-currentitem","e-active"],["e-pager-default"]),e.setAttribute("aria-current","page")),n.appendChild(e);i.appendChild(n),this.links=[].slice.call(i.childNodes)},Du.prototype.wireEvents=function(){H.EventHandler.add(this.pagerElement,"click",this.clickHandler,this),H.EventHandler.add(this.pagerElement,"auxclick",this.auxiliaryClickHandler,this)},Du.prototype.unwireEvents=function(){H.EventHandler.remove(this.pagerModule.element,"click",this.clickHandler),H.EventHandler.remove(this.pagerModule.element,"auxclick",this.auxiliaryClickHandler)},Du.prototype.destroy=function(){this.unwireEvents()},Du.prototype.refreshAriaAttrLabel=function(){for(var e=this.pagerModule,t=e.element.querySelector(".e-numericcontainer").querySelectorAll("a"),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].hasAttribute("aria-label")&&t[parseInt(i.toString(),10)].hasAttribute("data-index")&&t[parseInt(i.toString(),10)].setAttribute("aria-label",e.getLocalizedLabel("Page")+t[parseInt(i.toString(),10)].getAttribute("data-index")+e.getLocalizedLabel("Of")+e.totalPages+e.getLocalizedLabel("Pages"))},Du.prototype.renderNumericContainer=function(){this.element=H.createElement("div",{className:"e-pagercontainer",attrs:{role:"navigation"}}),this.renderFirstNPrev(this.element),this.renderPrevPagerSet(this.element),this.element.appendChild(H.createElement("div",{className:"e-numericcontainer"})),this.renderNextPagerSet(this.element),this.renderNextNLast(this.element),this.pagerModule.element.appendChild(this.element)},Du.prototype.renderFirstNPrev=function(e){this.first=H.createElement("div",{className:"e-first e-icons e-icon-first",attrs:{title:this.pagerModule.getLocalizedLabel("firstPageTooltip"),tabindex:"-1",role:"button"}}),this.prev=H.createElement("div",{className:"e-prev e-icons e-icon-prev",attrs:{title:this.pagerModule.getLocalizedLabel("previousPageTooltip"),tabindex:"-1",role:"button"}}),H.append([this.first,this.prev],e)},Du.prototype.renderPrevPagerSet=function(e){var t=H.createElement("div");this.PP=H.createElement("a",{className:"e-link e-pp e-spacing",innerHTML:"...",attrs:{title:this.pagerModule.getLocalizedLabel("previousPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("previousPagerTooltip"),tabindex:"-1",href:"#"}}),t.appendChild(this.PP),e.appendChild(t)},Du.prototype.renderNextPagerSet=function(e){var t=H.createElement("div");this.NP=H.createElement("a",{className:"e-link e-np e-spacing",innerHTML:"...",attrs:{title:this.pagerModule.getLocalizedLabel("nextPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("nextPagerTooltip"),tabindex:"-1",href:"#"}}),t.appendChild(this.NP),e.appendChild(t)},Du.prototype.renderNextNLast=function(e){this.next=H.createElement("div",{className:"e-next e-icons e-icon-next",attrs:{title:this.pagerModule.getLocalizedLabel("nextPageTooltip"),tabindex:"-1",role:"button"}}),this.last=H.createElement("div",{className:"e-last e-icons e-icon-last",attrs:{title:this.pagerModule.getLocalizedLabel("lastPageTooltip"),tabindex:"-1",role:"button"}}),H.append([this.next,this.last],e)},Du.prototype.clickHandler=function(e){var t=this.pagerModule;return this.target=e.target,this.target.classList.contains("e-numericitem")&&e.preventDefault(),t.previousPageNo=t.currentPage,this.target.classList.contains("e-disable")||H.isNullOrUndefined(this.target.getAttribute("data-index"))||(t.currentPage=parseInt(this.target.getAttribute("data-index"),10),this.pagerModule.isInteracted=!0,t.dataBind()),!1},Du.prototype.auxiliaryClickHandler=function(e){this.target=e.target,this.target.classList.contains("e-numericitem")&&1===e.button&&e.preventDefault()},Du.prototype.updateLinksHtml=function(){var e,t=this.pagerModule,i=this.pagerElement.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)');t.currentPage=1===t.totalPages?1:t.currentPage,t.currentPage>t.totalPages&&t.totalPages&&(t.currentPage=t.totalPages),e=parseInt((t.currentPage/t.pageCount).toString(),10),t.currentPage%t.pageCount==0&&0<e&&(e-=1);for(var n=0;n<t.pageCount;n++){if(t.isPagerResized){var r=this.pagerElement.querySelector(".e-focus"),r=this.target||r||null,s=!1,o=!1,a=!1,l=!1,h=!1,d=!1,p=!1;if(r){var c=r.classList;if(c.contains("e-icons"))switch(!0){case c.contains("e-prev"):s=!0;break;case c.contains("e-next"):o=!0;break;case c.contains("e-first"):a=!0;break;case c.contains("e-last"):l=!0}else if(c.contains("e-numericitem"))switch(!0){case c.contains("e-np"):d=!0;break;case c.contains("e-pp"):p=!0;break;default:h=c.contains("e-numericitem")}}var u=l||"End"===this.pagerModule.keyAction,i=this.pagerElement.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)'),r=Array.from(i).some(function(e){return parseInt(e.getAttribute("data-index"),10)===t.currentPage}),r=a||"Home"===this.pagerModule.keyAction?1+n:l||"End"===this.pagerModule.keyAction?e*t.pageCount+1+n:o||"ArrowRight"===this.pagerModule.keyAction||s||"ArrowLeft"===this.pagerModule.keyAction?r?parseInt(i[0].getAttribute("data-index"),10)+n:s||"ArrowLeft"===this.pagerModule.keyAction?parseInt(this.PP.getAttribute("data-index"),10)+n:t.currentPage+n:d||p?t.currentPage+n:h?parseInt(i[0].getAttribute("data-index"),10)+n:e*t.pageCount+1+n}else r=e*t.pageCount+1+n;r<=t.totalPages?(this.links[parseInt(n.toString(),10)].classList.remove("e-hide"),this.links[parseInt(n.toString(),10)].style.display="",this.links[parseInt(n.toString(),10)].setAttribute("data-index",r.toString()),this.links[parseInt(n.toString(),10)].innerHTML=t.customText?t.customText+r:r.toString(),t.currentPage!==r?this.links[parseInt(n.toString(),10)].classList.add("e-pager-default"):this.links[parseInt(n.toString(),10)].classList.remove("e-pager-default")):(this.links[parseInt(n.toString(),10)].innerHTML=t.customText?t.customText+r:r.toString(),this.links[parseInt(n.toString(),10)].style.display="none"),H.classList(this.links[parseInt(n.toString(),10)],[],["e-currentitem","e-active"]),this.links[parseInt(n.toString(),10)].removeAttribute("aria-current")}H.attributes(this.first,{"data-index":"1",title:this.pagerModule.getLocalizedLabel("firstPageTooltip")}),H.attributes(this.pagerElement.querySelector(".e-mfirst"),{"data-index":"1",title:this.pagerModule.getLocalizedLabel("firstPageTooltip")}),H.attributes(this.last,{"data-index":t.totalPages.toString(),title:this.pagerModule.getLocalizedLabel("lastPageTooltip")}),H.attributes(this.pagerElement.querySelector(".e-mlast"),{"data-index":t.totalPages.toString(),title:this.pagerModule.getLocalizedLabel("lastPageTooltip")}),H.attributes(this.prev,{"data-index":(t.currentPage-1).toString(),title:this.pagerModule.getLocalizedLabel("previousPageTooltip")}),H.attributes(this.pagerElement.querySelector(".e-mprev"),{"data-index":(t.currentPage-1).toString(),title:this.pagerModule.getLocalizedLabel("previousPageTooltip")}),H.attributes(this.next,{"data-index":(t.currentPage+1).toString(),title:this.pagerModule.getLocalizedLabel("nextPageTooltip")}),H.attributes(this.pagerElement.querySelector(".e-mnext"),{"data-index":(t.currentPage+1).toString(),title:this.pagerModule.getLocalizedLabel("nextPageTooltip")});var g=this.pagerModule.isPagerResized&&i.length?u?parseInt(i[0].getAttribute("data-index"),10)-t.avgNumItems:parseInt(i[0].getAttribute("data-index"),10)-i.length:parseInt(this.links[0].getAttribute("data-index"),10)-t.pageCount,g=(H.attributes(this.PP,{"data-index":g<1?"1":g.toString(),title:this.pagerModule.getLocalizedLabel("previousPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("previousPagerTooltip")}),this.pagerModule.isPagerResized&&i.length?parseInt(i[i.length-1].getAttribute("data-index"),10):parseInt(this.links[this.links.length-1].getAttribute("data-index"),10));H.attributes(this.NP,{"data-index":(g+1).toString(),title:this.pagerModule.getLocalizedLabel("nextPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("nextPagerTooltip")}),this.target=void 0},Du.prototype.updateStyles=function(){var e,t=this;this.updateFirstNPrevStyles(),this.updatePrevPagerSetStyles(),this.updateNextPagerSetStyles(),this.updateNextNLastStyles(),this.links.length&&(e=this.links.findIndex(function(e){return e.getAttribute("data-index")===t.pagerModule.currentPage.toString()}),e=this.pagerModule.isPagerResized&&-1!==e?e:(this.pagerModule.currentPage-1)%this.pagerModule.pageCount,this.links[parseInt(e.toString(),10)])&&(H.classList(this.links[parseInt(e.toString(),10)],["e-currentitem","e-active"],[]),this.links[parseInt(e.toString(),10)].setAttribute("aria-current","page"))},Du.prototype.updateFirstNPrevStyles=function(){var e=["e-firstpage","e-pager-default"],t=["e-firstpagedisabled","e-disable"],i=["e-prevpage","e-pager-default"],n=["e-prevpagedisabled","e-disable"];0<this.pagerModule.totalPages&&1<this.pagerModule.currentPage?(H.classList(this.prev,i,n),H.classList(this.first,e,t),H.classList(this.pagerElement.querySelector(".e-mfirst"),e,t),H.classList(this.pagerElement.querySelector(".e-mprev"),i,n)):(H.classList(this.prev,n,i),H.classList(this.first,t,e),H.classList(this.pagerElement.querySelector(".e-mprev"),n,i),H.classList(this.pagerElement.querySelector(".e-mfirst"),t,e))},Du.prototype.updatePrevPagerSetStyles=function(){this.pagerModule.currentPage>this.pagerModule.pageCount||this.pagerModule.isPagerResized&&this.links.findIndex(function(e){return 1===parseInt(e.getAttribute("data-index"),10)})?H.classList(this.PP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"]):H.classList(this.PP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"])},Du.prototype.updateNextPagerSetStyles=function(){var t=this.pagerModule,e=this.links[0].innerHTML.replace(t.customText,""),i=this.pagerElement.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)');!e.length||!this.links.length||parseInt(e,10)+t.pageCount>t.totalPages||t.isPagerResized&&Array.from(i).some(function(e){return parseInt(e.getAttribute("data-index"),10)===t.totalPages})?H.classList(this.NP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]):H.classList(this.NP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"])},Du.prototype.updateNextNLastStyles=function(){var e=["e-lastpage","e-pager-default"],t=["e-lastpagedisabled","e-disable"],i=["e-nextpage","e-pager-default"],n=["e-nextpagedisabled","e-disable"],r=this.pagerModule;r.currentPage===r.totalPages||0===r.totalRecordsCount?(H.classList(this.last,t,e),H.classList(this.next,n,i),H.classList(this.pagerElement.querySelector(".e-mlast"),t,e),H.classList(this.pagerElement.querySelector(".e-mnext"),n,i)):(H.classList(this.last,e,t),H.classList(this.next,i,n),H.classList(this.pagerElement.querySelector(".e-mlast"),e,t),H.classList(this.pagerElement.querySelector(".e-mnext"),i,n))};var xu=Du;function Du(e){this.pagerModule=e}Eu.prototype.render=function(){var e=H.createElement("div",{className:"e-parentmsgbar"});this.pageNoMsgElem=H.createElement("span",{className:"e-pagenomsg"}),this.pageNoMsgElem.style.textAlign="right",this.pageCountMsgElem=H.createElement("span",{className:"e-pagecountmsg"}),this.pageCountMsgElem.style.textAlign="right",H.append([this.pageNoMsgElem,this.pageCountMsgElem],e),this.pagerModule.element.appendChild(e),this.refresh()},Eu.prototype.refresh=function(){var e=this.pagerModule;this.pageNoMsgElem.textContent=this.format(e.getLocalizedLabel("currentPageInfo"),[0===e.totalRecordsCount?0:e.currentPage,e.totalPages||0,e.totalRecordsCount||0])+" ",this.pageCountMsgElem.textContent=this.format(e.getLocalizedLabel(e.totalRecordsCount<=1?"totalItemInfo":"totalItemsInfo"),[e.totalRecordsCount||0,e.totalRecordsCount?e.pageSize*(e.currentPage-1)+1:0,e.pageSize*e.currentPage>e.totalRecordsCount?e.totalRecordsCount:e.pageSize*e.currentPage]),this.pageNoMsgElem.parentElement.classList.remove("e-hide")},Eu.prototype.hideMessage=function(){this.pageNoMsgElem&&(this.pageNoMsgElem.style.display="none"),this.pageCountMsgElem&&(this.pageCountMsgElem.style.display="none")},Eu.prototype.showMessage=function(){this.pageNoMsgElem||this.render(),this.pageNoMsgElem.style.display="",this.pageCountMsgElem.style.display=""},Eu.prototype.destroy=function(){},Eu.prototype.format=function(e,t){for(var i,n=RegExp,r=0;r<t.length;r++)i=new n("\\{"+r+"\\}","gm"),e=this.isValidLocale(this.pagerModule.locale)?e.replace(i,t[parseInt(r.toString(),10)].toLocaleString(this.pagerModule.locale)):e.replace(i,t[parseInt(r.toString(),10)].toString());return e},Eu.prototype.isValidLocale=function(e){try{return new Intl.NumberFormat(e),!0}catch(e){return!1}};var Tu=Eu;function Eu(e){this.pagerModule=e}Ou=function(e,t){return(Ou=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Ou,Au,Oh=function(e,t){function i(){this.constructor=e}Ou(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},t=function(e,t,i,n){var r,s=arguments.length,o=s<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,i,n);else for(var a=e.length-1;0<=a;a--)(r=e[a])&&(o=(s<3?r(o):3<s?r(t,i,o):r(t,i))||o);return 3<s&&o&&Object.defineProperty(t,i,o),o},Fu=(Au=H.Component,Oh(d,Au),d.prototype.requiredModules=function(){var e=[];return this.enableExternalMessage&&e.push({member:"externalMessage",args:[this],name:"ExternalMessage"}),this.checkpagesizes()&&e.push({member:"pagerdropdown",args:[this],name:"PagerDropDown"}),e},d.prototype.preRender=function(){this.defaultConstants={currentPageInfo:"{0} of {1} pages",totalItemsInfo:"({0} items)",totalItemInfo:"({0} item)",firstPageTooltip:"Go to first page",lastPageTooltip:"Go to last page",nextPageTooltip:"Go to next page",previousPageTooltip:"Go to previous page",nextPagerTooltip:"Go to next pager items",previousPagerTooltip:"Go to previous pager items",pagerDropDown:"Items per page",pagerAllDropDown:"Items",CurrentPageInfo:"{0} of {1} pages",TotalItemsInfo:"({0} items)",FirstPageTooltip:"Go to first page",LastPageTooltip:"Go to last page",NextPageTooltip:"Go to next page",PreviousPageTooltip:"Go to previous page",NextPagerTooltip:"Go to next pager items",PreviousPagerTooltip:"Go to previous pager items",PagerDropDown:"Items per page",PagerAllDropDown:"Items",All:"All",Container:"Pager Container",Information:"Pager Information",ExternalMsg:"Pager external message",Page:"Page ",Of:" of ",Pages:" Pages"},this.containerModule=new xu(this),this.pagerMessageModule=new Tu(this)},d.prototype.setCurrentPageValue=function(e){e=parseInt(e,10);this.hasParent&&this.parent.setProperties({pageSettings:{currentPage:e}},!0),this.currentPage=e},d.prototype.render=function(){var e;this.element.setAttribute("data-role","pager"),this.element.setAttribute("tabindex","-1"),this.initLocalization(),/^((?!chrome|android).)*safari/i.test(navigator.userAgent)&&this.element.classList.add("e-mac-safari"),this.cssClass&&(-1!==this.cssClass.indexOf(" ")?H.addClass([this.element],this.cssClass.split(" ")):H.addClass([this.element],[this.cssClass])),this.hasParent||this.element.setAttribute("tabindex","0"),this.enableQueryString&&(e=new URL(window.location.href).searchParams.get("page"),!H.isNullOrUndefined(e))&&0<window.location.href.indexOf("?page=")&&this.setCurrentPageValue(e),this.template?this.isReactTemplate()?(this.on(this.pageRefresh,this.pagerTemplate,this),this.notify(this.pageRefresh,{})):this.pagerTemplate():(this.updateRTL(),this.totalRecordsCount=this.totalRecordsCount||0,this.renderFirstPrevDivForDevice(),this.containerModule.render(),this.enablePagerMessage&&this.pagerMessageModule.render(),this.renderNextLastDivForDevice(),this.checkpagesizes()&&this.pagerdropdownModule&&this.pagerdropdownModule.render(),this.addAriaLabel(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.render(),this.refresh(),this.trigger("created",{currentPage:this.currentPage,totalRecordsCount:this.totalRecordsCount})),this.wireEvents(),this.addListener()},d.prototype.getPersistData=function(){return this.addOnPersist(["currentPage","pageSize"])},d.prototype.destroy=function(){this.isDestroyed||(this.isReactTemplate()&&(this.off(this.pageRefresh,this.pagerTemplate),this.hasParent||this.destroyTemplate(["pagerTemplate"])),this.removeListener(),this.unwireEvents(),Au.prototype.destroy.call(this),this.containerModule.destroy(),this.pagerMessageModule.destroy(),this.isReactTemplate())||(this.element.innerHTML="")},d.prototype.destroyTemplate=function(e,t){this.clearTemplate(e,t)},d.prototype.getModuleName=function(){return"pager"},d.prototype.onPropertyChanged=function(e,t){if(!this.isDestroyed)if(e.pageSize===this.getLocalizedLabel("All")&&t.pageSize===this.totalRecordsCount)this.pageSize=this.totalRecordsCount;else{e.pageCount!==t.pageCount&&(this.containerModule.refreshNumericLinks(),this.containerModule.refresh());for(var i=0,n=Object.keys(e);i<n.length;i++)switch(n[i]){case"currentPage":this.checkGoToPage(e.currentPage,t.currentPage)&&this.currentPageChanged(e,t);break;case"pageSize":case"totalRecordsCount":case"customText":this.checkpagesizes()&&this.pagerdropdownModule&&(t.pageSize!==e.pageSize&&(this.currentPage=1),this.pagerdropdownModule.setDropDownValue("value",this.pageSize)),e.pageSize!==t.pageSize?(this.pageSize=e.pageSize,this.currentPageChanged(e,t),this.isCancel&&this.hasParent&&this.parent.setProperties({pageSettings:{pageSize:t.pageSize}},!0)):this.refresh();break;case"pageSizes":this.checkpagesizes()&&this.pagerdropdownModule&&(this.pagerdropdownModule.destroy(),this.pagerdropdownModule.render()),this.refresh();break;case"template":this.templateFn=this.compile(this.template),this.refresh();break;case"locale":this.initLocalization(),this.refresh();break;case"enableExternalMessage":this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.render();break;case"externalMessage":this.externalMessageModule&&this.externalMessageModule.refresh();break;case"enableRtl":this.updateRTL();break;case"enablePagerMessage":this.enablePagerMessage?this.pagerMessageModule.showMessage():this.pagerMessageModule.hideMessage()}this.resizePager()}},d.prototype.wireEvents=function(){this.hasParent||(H.EventHandler.add(this.element,"keydown",this.keyPressHandler,this),H.EventHandler.add(document.body,"keydown",this.keyDownHandler,this)),H.EventHandler.add(this.element,"focusin",this.onFocusIn,this),H.EventHandler.add(this.element,"focusout",this.onFocusOut,this),H.EventHandler.add(window,"resize",this.resizePager,this),H.EventHandler.add(window,"load",this.resizePager,this)},d.prototype.unwireEvents=function(){this.hasParent||(H.EventHandler.remove(this.element,"keydown",this.keyPressHandler),H.EventHandler.remove(document.body,"keydown",this.keyDownHandler)),H.EventHandler.remove(this.element,"focusin",this.onFocusIn),H.EventHandler.remove(this.element,"focusout",this.onFocusOut),H.EventHandler.remove(window,"resize",this.resizePager),H.EventHandler.remove(window,"load",this.resizePager)},d.prototype.onFocusIn=function(e){var t=this.getFocusedTabindexElement();H.isNullOrUndefined(t)&&(t=e.target,e=this.getDropDownPage(),this.hasParent||(this.element.tabIndex=-1),t!==this.element||this.hasParent?t===this.element?this.element.tabIndex=0:t===e||t.classList.contains("e-disable")||this.addFocus(t,!0):(e=this.getFocusablePagerElements(this.element,[]),this.addFocus(e[0],!0)))},d.prototype.onFocusOut=function(e){var t=this.getFocusedElement(),i=this.getDropDownPage();H.isNullOrUndefined(t)||this.removeFocus(t,!0),this.pageSizes&&i&&i.classList.contains("e-input-focus")&&this.removeFocus(i,!0),this.setTabIndexForFocusLastElement(),this.hasParent||(this.element.tabIndex=0),this.hasParent&&(this.element.tabIndex=-1)},d.prototype.keyDownHandler=function(e){e.altKey&&74===e.keyCode&&0<(e=this.getFocusablePagerElements(this.element,[])).length&&e[0].focus()},d.prototype.keyPressHandler=function(e){var t=H.extend(e,{cancel:!1});this.notify(Gt,t),!0===t.cancel&&e.stopImmediatePropagation()},d.prototype.addListener=function(){this.isDestroyed||this.hasParent||this.on(Gt,this.onKeyPress,this)},d.prototype.removeListener=function(){this.isDestroyed||this.hasParent||this.off(Gt,this.onKeyPress)},d.prototype.onKeyPress=function(e){this.hasParent||(this.checkPagerHasFocus()?this.changePagerFocus(e):(e.preventDefault(),this.setPagerFocus()))},d.prototype.checkPagerHasFocus=function(){return!!this.getFocusedTabindexElement()},d.prototype.setPagerContainerFocus=function(){this.element.focus()},d.prototype.setPagerFocus=function(){var e=this.getFocusablePagerElements(this.element,[]);0<e.length&&e[0].focus()},d.prototype.setPagerFocusForActiveElement=function(){var e=this.getActiveElement();e&&e.focus()},d.prototype.setTabIndexForFocusLastElement=function(){var e=this.getFocusablePagerElements(this.element,[]),t=this.getDropDownPage();this.pageSizes&&t&&!H.isNullOrUndefined(t.offsetParent)?t.tabIndex=0:0<e.length&&(e[e.length-1].tabIndex=0)},d.prototype.changePagerFocus=function(e){this.keyAction=e.key,e.shiftKey&&9===e.keyCode?this.changeFocusByShiftTab(e):9===e.keyCode?this.changeFocusByTab(e):13===e.keyCode||32===e.keyCode?this.navigateToPageByEnterOrSpace(e):37!==e.keyCode&&39!==e.keyCode&&35!==e.keyCode&&36!==e.keyCode||this.navigateToPageByKey(e),this.keyAction=""},d.prototype.getFocusedTabindexElement=function(){for(var e,t=this.element.querySelectorAll('[tabindex]:not([tabindex="-1"])'),i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];if(n&&(n.classList.contains("e-focused")||n.classList.contains("e-input-focus"))){e=n;break}}return e},d.prototype.changeFocusByTab=function(e){var t=this.getFocusedTabindexElement(),i=this.getFocusablePagerElements(this.element,[]),n=this.getDropDownPage();if(0<i.length)if(this.pageSizes&&n&&t===i[i.length-1])n.tabIndex=0;else for(var r=0;r<i.length;r++)if(t===i[parseInt(r.toString(),10)]){var s=r+1;s<i.length&&(e.preventDefault(),i[parseInt(s.toString(),10)].focus());break}},d.prototype.changeFocusByShiftTab=function(e){var t=this.getFocusedTabindexElement(),i=this.getFocusablePagerElements(this.element,[]),n=this.getDropDownPage();if(this.pageSizes&&n&&n.classList.contains("e-input-focus"))n.tabIndex=-1,this.addFocus(i[i.length-1],!0);else if(0<i.length)for(var r=0;r<i.length;r++)if(t===i[parseInt(r.toString(),10)]){var s=r-1;0<=s?(e.preventDefault(),i[parseInt(s.toString(),10)].focus()):this.hasParent&&(s=(s=this.parent.getRows())[s.length-1].lastChild,e.preventDefault(),s.focus(),this.firstPagerFocus=!0);break}},d.prototype.checkFirstPagerFocus=function(){return!!this.firstPagerFocus&&!(this.firstPagerFocus=!1)},d.prototype.navigateToPageByEnterOrSpace=function(e){var t,i,n,r=this.getFocusedElement();r&&(this.goToPage(parseInt(r.getAttribute("data-index"),10)),t=this.getActiveElement(),i=this.getClass(r),n=this.getElementByClass(i),"e-first"!==i&&"e-prev"!==i&&"e-next"!==i&&"e-last"!==i&&"e-pp"!==i&&"e-np"!==i||!n||n.classList.contains("e-disable")?this.checkFocusInAdaptiveMode(r)?this.changeFocusInAdaptiveMode(r):t&&t.focus():n.focus())},d.prototype.navigateToPageByKey=function(e){var e=37===e.keyCode?".e-prev":39===e.keyCode?".e-next":35===e.keyCode?".e-last":36===e.keyCode?".e-first":"",e=this.element.querySelector(e),t=this.getFocusedElement();H.isNullOrUndefined(e)||!e.hasAttribute("data-index")||isNaN(parseInt(e.getAttribute("data-index"),10))||(this.goToPage(parseInt(e.getAttribute("data-index"),10)),e=this.getActiveElement(),this.checkFocusInAdaptiveMode(t)?this.changeFocusInAdaptiveMode(t):e&&e.focus())},d.prototype.checkFocusInAdaptiveMode=function(e){e=this.getClass(e);return"e-mfirst"===e||"e-mprev"===e||"e-mnext"===e||"e-mlast"===e},d.prototype.changeFocusInAdaptiveMode=function(e){var e=this.getClass(e),t=this.getElementByClass(e);t&&t.classList.contains("e-disable")&&("e-mnext"===e||"e-mlast"===e?this.element.querySelector(".e-mprev").focus():this.setPagerFocus())},d.prototype.removeTabindexLastElements=function(){var e=this.element.querySelectorAll('[tabindex]:not([tabindex="-1"])');if(1<e.length)for(var t=1;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i&&(i.tabIndex=-1)}},d.prototype.getActiveElement=function(){return this.element.querySelector(".e-active")},d.prototype.getDropDownPage=function(){var e,t=this.element.querySelector(".e-pagerdropdown");return e=t?t.children[0]:e},d.prototype.getFocusedElement=function(){return this.element.querySelector(".e-focused")},d.prototype.getClass=function(e){for(var t,i=["e-mfirst","e-mprev","e-first","e-prev","e-pp","e-np","e-next","e-last","e-mnext","e-mlast"],n=0;n<i.length;n++)if(e&&e.classList.contains(i[parseInt(n.toString(),10)]))return t=i[parseInt(n.toString(),10)];return t},d.prototype.getElementByClass=function(e){return this.element.querySelector("."+e)},d.prototype.getFocusablePagerElements=function(e,t){for(var i=e.children,n=t,r=0;r<i.length;r++){var s,o=i[parseInt(r.toString(),10)];0<o.children.length&&!o.classList.contains("e-pagesizes")?n=this.getFocusablePagerElements(o,n):!(s=i[parseInt(r.toString(),10)]).hasAttribute("tabindex")||o.classList.contains("e-disable")||"none"===o.style.display||H.isNullOrUndefined(o.offsetParent)||n.push(s)}return n},d.prototype.addFocus=function(e,t){H.isNullOrUndefined(e)||(t&&H.addClass([e],["e-focused","e-focus"]),e.tabIndex=0)},d.prototype.removeFocus=function(e,t){t&&H.removeClass([e],["e-focused","e-focus"]),e.tabIndex=-1},d.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},d.prototype.goToPage=function(e){this.checkGoToPage(e)&&(this.currentPage=e,this.isInteracted=!1,this.dataBind())},d.prototype.setPageSize=function(e){this.pageSize=e,this.dataBind()},d.prototype.checkpagesizes=function(){return!(!0!==this.pageSizes&&!this.pageSizes.length)},d.prototype.checkGoToPage=function(e,t){return e!==this.currentPage&&(this.previousPageNo=this.currentPage),H.isNullOrUndefined(t)||(this.previousPageNo=t),this.previousPageNo!==e&&1<=e&&e<=this.totalPages},d.prototype.currentPageChanged=function(e,t){this.enableQueryString&&this.updateQueryString(this.currentPage),e.currentPage===t.currentPage&&e.pageSize===t.pageSize||(e={currentPage:this.currentPage,newProp:e,oldProp:t,cancel:!1,isInteracted:this.isInteracted},this.trigger("click",e),e.cancel?(this.isCancel=!0,t&&t.pageSize&&(this.setProperties({pageSize:t.pageSize},!0),this.pagerdropdownModule)&&(this.pagerdropdownModule.setDropDownValue("value",t.pageSize),this.pagerdropdownModule.dropDownListObject.text=t.pageSize+"")):(this.isCancel=!1,this.refresh()))},d.prototype.pagerTemplate=function(){var e,t;this.isReactTemplate()&&this.hasParent||(this.element.classList.add("e-pagertemplate"),this.compile(this.template),e={currentPage:this.currentPage,pageSize:this.pageSize,pageCount:this.pageCount,totalRecordsCount:this.totalRecordsCount,totalPages:this.totalPages},t=this.element.parentElement.id+"_template",this.isReactTemplate()&&!this.isVue?(this.getPagerTemplate()(e,this,"pagerTemplate",t,null,null,this.element),this.renderReactTemplates()):(t=this.isVue?this.getPagerTemplate()(e,this,"pagerTemplate",null,null,null,null,this.root):this.getPagerTemplate()(e),Ip(this.element,t)))},d.prototype.updateTotalPages=function(){this.totalPages=this.isAllPage?1:this.totalRecordsCount%this.pageSize==0?this.totalRecordsCount/this.pageSize:parseInt((this.totalRecordsCount/this.pageSize).toString(),10)+1},d.prototype.getPagerTemplate=function(){return this.templateFn},d.prototype.compile=function(t){if(t)try{"function"!=typeof t&&document.querySelectorAll(t).length?this.templateFn=H.compile(document.querySelector(t).innerHTML.trim()):this.templateFn=H.compile(t)}catch(e){this.templateFn=H.compile(t)}},d.prototype.refresh=function(){var e;this.template?this.isReactTemplate()?(this.updateTotalPages(),this.notify(this.pageRefresh,{})):(this.parent&&this.parent.isAngular?this.parent.destroyTemplate(["pagerTemplate"]):this.element.innerHTML="",this.updateTotalPages(),this.pagerTemplate()):(this.updateRTL(),e=this.getFocusedTabindexElement(),this.containerModule.refresh(),this.removeTabindexLastElements(),e&&e.classList.contains("e-disable")&&(this.checkFocusInAdaptiveMode(e)?this.changeFocusInAdaptiveMode(e):this.setPagerFocusForActiveElement()),this.enablePagerMessage&&this.pagerMessageModule.refresh(),this.pagerdropdownModule&&this.pagerdropdownModule.refresh(),this.enableExternalMessage&&this.externalMessageModule&&this.externalMessageModule.refresh(),this.setTabIndexForFocusLastElement(),this.resizePager())},d.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},d.prototype.initLocalization=function(){this.localeObj=new H.L10n(this.getModuleName(),this.defaultConstants,this.locale)},d.prototype.updateQueryString=function(e){e=this.getUpdatedURL(window.location.href,"page",e.toString());window.history.pushState({path:e},"",e),this.isReact&&window.dispatchEvent(new PopStateEvent("popstate"))},d.prototype.getUpdatedURL=function(e,t,i){var n=new RegExp("([?|&])"+t+"=.*?(&|#|$)","i");return e.match(n)?e.replace(n,"$1"+t+"="+i+"$2"):(n="",-1!==e.indexOf("#")&&(n=e.replace(/.*#/,"#"),e=e.replace(/#.*/,"")),e+(-1!==e.indexOf("?")?"&":"?")+t+"="+i+n)},d.prototype.renderFirstPrevDivForDevice=function(){this.element.appendChild(H.createElement("div",{className:"e-mfirst e-icons e-icon-first",attrs:{title:this.getLocalizedLabel("firstPageTooltip"),tabindex:"-1",role:"button"}})),this.element.appendChild(H.createElement("div",{className:"e-mprev e-icons e-icon-prev",attrs:{title:this.getLocalizedLabel("previousPageTooltip"),tabindex:"-1",role:"button"}}))},d.prototype.renderNextLastDivForDevice=function(){this.element.appendChild(H.createElement("div",{className:"e-mnext e-icons e-icon-next",attrs:{title:this.getLocalizedLabel("nextPageTooltip"),tabindex:"-1",role:"button"}})),this.element.appendChild(H.createElement("div",{className:"e-mlast e-icons e-icon-last",attrs:{title:this.getLocalizedLabel("lastPageTooltip"),tabindex:"-1",role:"button"}}))},d.prototype.addAriaLabel=function(){var e=[".e-mfirst",".e-mprev",".e-mnext",".e-mlast"];if(!H.Browser.isDevice)for(var t=0;t<e.length;t++){var i=this.element.querySelector(e[parseInt(t.toString(),10)]);i.setAttribute("aria-label",i.getAttribute("title"))}},d.prototype.isReactTemplate=function(){return(this.isReact||this.isVue)&&this.template&&"string"!=typeof this.template&&!(this.template.prototype&&this.template.prototype.CSPTemplate)},d.prototype.calculateActualWidth=function(){for(var e=this.element.querySelectorAll(".e-mfirst, .e-mprev, .e-icon-first, .e-icon-prev, .e-pp:not(.e-disable), .e-numericitem:not(.e-hide), .e-numericitem.e-active.e-hide, .e-np:not(.e-disable), .e-icon-next, .e-icon-last, .e-parentmsgbar, .e-mnext, .e-mlast, .e-pagerdropdown, .e-pagerconstant"),t=0,i=0;i<e.length;i++)"none"!==getComputedStyle(e[parseInt(i.toString(),10)]).display&&(t+=e[parseInt(i.toString(),10)].offsetWidth+parseFloat(getComputedStyle(e[parseInt(i.toString(),10)]).marginLeft)+parseFloat(getComputedStyle(e[parseInt(i.toString(),10)]).marginRight));var n=this.element.querySelector(".e-pagercontainer");return t+=parseFloat(getComputedStyle(n).marginLeft)+parseFloat(getComputedStyle(n).marginRight)},d.prototype.hideDetailItems=function(e,t,i,n){var r=this.calculateActualWidth();if(e-t<r)for(var s=Math.floor((e-(r-i))/this.averageDetailWidth),s=n.length-s,o=0;o<(s>n.length?n.length:s);o++)n[parseInt(o.toString(),10)].classList.add("e-hide")},d.prototype.setShowItems=function(e,t,i,n,r){for(var s=this,o=(o=Math.floor(e/(t+i)))>r.length?r.length:o-1,e=Array.from(r).filter(function(e){return parseInt(e.getAttribute("data-index"),10)<s.currentPage}).sort(function(e,t){return parseInt(t.getAttribute("data-index"),10)-parseInt(e.getAttribute("data-index"),10)}),t=Array.from(r).filter(function(e){return parseInt(e.getAttribute("data-index"),10)>s.currentPage}),a=e.length&&e||t.length&&t,l=1;l<=o;l++){var h=a&&a[Math.abs(n-l)];h&&(h.classList.remove("e-hide"),h===a[a.length-1])&&(a=null)}},t([H.Property(!(d.prototype.resizePager=function(){var t=this,e=this.element.classList.contains("e-pager")?getComputedStyle(this.element).getPropertyValue("border-style").includes("solid"):null;if(!this.template&&e){for(var i=this.element.querySelector(".e-pagercontainer"),e=this.calculateActualWidth(),n=this.element.clientWidth-parseFloat(getComputedStyle(this.element).paddingLeft)-parseFloat(getComputedStyle(this.element).paddingRight)-parseFloat(getComputedStyle(this.element).marginLeft)-parseFloat(getComputedStyle(this.element).marginRight),r=i.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)'),s=i.querySelectorAll('.e-numericitem.e-hide:not([style*="display: none"])'),o=r.length,a=H.isNullOrUndefined(I(this.element,"e-bigger"))?5:10,l=i.querySelector(".e-np"),h=i.querySelector(".e-pp"),d=this.element.querySelectorAll('.e-parentmsgbar:not(.e-hide):not([style*="display: none"]), .e-pagesizes:not(.e-hide):not([style*="display: none"])'),p=0,c=(d.length&&(d.forEach(function(e){p+=e.offsetWidth}),this.averageDetailWidth=p/d.length),0),u=0;u<r.length;u++)c+=r[parseInt(u.toString(),10)].offsetWidth+parseFloat(getComputedStyle(r[parseInt(u.toString(),10)]).marginLeft)+parseFloat(getComputedStyle(r[parseInt(u.toString(),10)]).marginRight);var g=c/r.length;if(0<n&&n-(g||0)<=e){this.isPagerResized=!0,this.currentPage!==this.totalPages&&H.classList(l,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"]);for(var e=this.calculateActualWidth(),f=Math.abs(e-n),m=0===(m=Math.ceil(f/g))?1:m>r.length?r.length-1:m,u=1;u<=m;u++){var y=o-parseInt(u.toString(),10),r=i.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)');1===this.currentPage||parseInt(r[Math.abs(y)].getAttribute("data-index"),10)!==this.currentPage&&parseInt(r[r.length-1].getAttribute("data-index"),10)!==this.currentPage||(y=0,H.classList(h,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"])),r[Math.abs(y)]&&!r[Math.abs(y)].classList.contains("e-currentitem")&&r[Math.abs(y)].classList.add("e-hide")}(r=i.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)')).length<=1&&d.length&&768<=window.innerWidth&&this.hideDetailItems(n,a,p,d)}else e<n&&s.length&&(f=Math.abs(n-e),(d=this.element.querySelectorAll(".e-parentmsgbar.e-hide, .e-pagesizes.e-hide")).length&&f>this.averageDetailWidth+this.averageDetailWidth/4&&d[d.length-1].classList.remove("e-hide"),2*g<f)&&!d.length&&768<=window.innerWidth&&this.setShowItems(f,g,a,1,s);(r=i.querySelectorAll('.e-numericitem:not(.e-hide):not([style*="display: none"]):not(.e-np):not(.e-pp)')).length&&(parseInt(r[r.length-1].getAttribute("data-index"),10)===this.totalPages&&H.classList(l,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]),1===parseInt(r[0].getAttribute("data-index"),10)&&H.classList(h,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]),n=Array.from(r).some(function(e){return parseInt(e.getAttribute("data-index"),10)===t.totalPages}),e=parseInt(r[0].getAttribute("data-index"),10)-(n&&!H.isNullOrUndefined(this.avgNumItems)?this.avgNumItems:r.length),h.setAttribute("data-index",e<1?"1":e.toString()),l.setAttribute("data-index",(parseInt(r[r.length-1].getAttribute("data-index"),10)+1).toString()),this.avgNumItems=n?this.avgNumItems:r.length),this.element.offsetWidth<769&&"none"!==window.getComputedStyle(this.element.querySelector(".e-mfirst")).getPropertyValue("display")&&this.pageSizes?(this.element.querySelector(".e-pagesizes").classList.remove("e-hide"),this.element.querySelector(".e-parentmsgbar").classList.remove("e-hide"),this.element.classList.add("e-adaptive"),this.element.querySelector(".e-pagenomsg").innerHTML=this.element.offsetWidth<481?this.currentPage+" / "+this.totalPages:this.pagerMessageModule.format(this.getLocalizedLabel("currentPageInfo"),[0===this.totalRecordsCount?0:this.currentPage,this.totalPages||0,this.totalRecordsCount||0])+" "):(this.element.classList.remove("e-adaptive"),this.element.querySelector(".e-pagenomsg").innerHTML=this.pagerMessageModule.format(this.getLocalizedLabel("currentPageInfo"),[0===this.totalRecordsCount?0:this.currentPage,this.totalPages||0,this.totalRecordsCount||0])+" ")}}))],d.prototype,"enableQueryString",void 0),t([H.Property(!1)],d.prototype,"enableExternalMessage",void 0),t([H.Property(!0)],d.prototype,"enablePagerMessage",void 0),t([H.Property(12)],d.prototype,"pageSize",void 0),t([H.Property(10)],d.prototype,"pageCount",void 0),t([H.Property(1)],d.prototype,"currentPage",void 0),t([H.Property()],d.prototype,"totalRecordsCount",void 0),t([H.Property()],d.prototype,"externalMessage",void 0),t([H.Property(!1)],d.prototype,"pageSizes",void 0),t([H.Property()],d.prototype,"template",void 0),t([H.Property("")],d.prototype,"customText",void 0),t([H.Event()],d.prototype,"click",void 0),t([H.Property("")],d.prototype,"cssClass",void 0),t([H.Event()],d.prototype,"dropDownChanged",void 0),t([H.Event()],d.prototype,"created",void 0),t([H.NotifyPropertyChanges],d));function d(e,t,i){e=Au.call(this,e,t)||this;return e.hasParent=!1,e.checkAll=!0,e.pageRefresh="pager-refresh",e.firstPagerFocus=!1,e.isCancel=!1,e.isInteracted=!1,e.parent=i,e}ku.prototype.getModuleName=function(){return"pagerdropdown"},ku.prototype.render=function(){var e=this.pagerModule,t=(this.pagerDropDownDiv=H.createElement("div",{className:"e-pagesizes"}),H.createElement("div",{className:"e-pagerdropdown"})),i=H.createElement("div",{className:"e-pagerconstant"}),n=H.createElement("input",{attrs:{type:"text",tabindex:"-1"}}),t=(this.pagerCons=H.createElement("span",{className:"e-constant",innerHTML:this.pagerModule.getLocalizedLabel("pagerDropDown")}),t.appendChild(n),i.appendChild(this.pagerCons),this.pagerDropDownDiv.appendChild(t),this.pagerDropDownDiv.appendChild(i),this.pagerModule.element.appendChild(this.pagerDropDownDiv),this.pagerModule.pageSizes),i=t.length?this.convertValue(t):[this.pagerModule.getLocalizedLabel("All"),"5","10","12","20"],r=this.pagerModule.pageSize;this.dropDownListObject=new P.DropDownList({dataSource:i,value:r.toString(),change:this.onChange.bind(this),placeholder:this.pagerModule.getLocalizedLabel("pagerDropDown"),cssClass:this.pagerModule.cssClass?"e-alldrop "+this.pagerModule.cssClass:"e-alldrop"}),this.dropDownListObject.isAngular=Oc(e.parent),this.dropDownListObject.appendTo(n),t.length&&(this.dropDownListObject.element.value=this.pagerModule.pageSize.toString()),e.pageSize=r,e.dataBind(),e.trigger("dropDownChanged",{pageSize:r}),this.addEventListener()},ku.prototype.onChange=function(e){this.dropDownListObject.value===this.pagerModule.getLocalizedLabel("All")?(this.pagerModule.pageSize=this.pagerModule.totalRecordsCount,this.pagerModule.isAllPage=!0,this.refresh(),e.value=this.pagerModule.pageSize,document.getElementsByClassName("e-popup-open e-alldrop").length&&(document.getElementsByClassName("e-popup-open e-alldrop")[0].style.display="none")):(this.pagerModule.pageSize=parseInt(this.dropDownListObject.value,10),this.pagerModule.isAllPage=!1,this.pagerCons.innerHTML!==this.pagerModule.getLocalizedLabel("pagerDropDown")&&this.refresh()),this.pagerModule.dataBind(),this.pagerModule.isCancel||this.pagerModule.trigger("dropDownChanged",{pageSize:this.pagerModule.isAllPage||void 0===this.pagerModule.isAllPage&&this.dropDownListObject.value===this.pagerModule.getLocalizedLabel("All")?this.pagerModule.totalRecordsCount:parseInt(this.dropDownListObject.value,10)})},ku.prototype.refresh=function(){this.pagerCons&&(this.isPageSizeAll(this.pagerModule.pageSize)?(this.pagerCons.innerHTML=this.pagerModule.getLocalizedLabel("pagerAllDropDown"),this.pagerCons.parentElement.classList.add("e-page-all")):(this.pagerCons.innerHTML=this.pagerModule.getLocalizedLabel("pagerDropDown"),this.pagerCons.parentElement.classList.remove("e-page-all")),this.pagerDropDownDiv.classList.remove("e-hide"))},ku.prototype.beforeValueChange=function(e){var t;"number"==typeof e.newProp.value&&(t=e.newProp.value.toString(),e.newProp.value=t)},ku.prototype.convertValue=function(e){for(var t=e,i=0;i<t.length;i++)t[parseInt(i.toString(),10)]=parseInt(t[parseInt(i.toString(),10)],10)?t[parseInt(i.toString(),10)].toString():""!==this.pagerModule.getLocalizedLabel(t[parseInt(i.toString(),10)])?this.pagerModule.getLocalizedLabel(t[parseInt(i.toString(),10)]):t[parseInt(i.toString(),10)];return t},ku.prototype.isPageSizeAll=function(e){return("string"==typeof e&&e!==this.pagerModule.getLocalizedLabel("All")?parseInt(e,10):e)===this.pagerModule.totalRecordsCount||e===this.pagerModule.getLocalizedLabel("All")},ku.prototype.setDropDownValue=function(e,t){var i;this.dropDownListObject&&(i=this.pagerModule.isAllPage,this.pagerModule.isAllPage=this.isPageSizeAll(t),this.pagerModule.isAllPage&&"object"==typeof this.pagerModule.pageSizes&&-1===this.pagerModule.pageSizes.indexOf("All")&&(this.pagerModule.isAllPage=!1),this.pagerModule.checkAll=!(!i||!this.pagerModule.isAllPage),this.dropDownListObject[""+e]=this.pagerModule.isAllPage?this.pagerModule.getLocalizedLabel("All"):t)},ku.prototype.addEventListener=function(){this.dropDownListObject.on("beforeValueChange",this.beforeValueChange,this)},ku.prototype.removeEventListener=function(){this.dropDownListObject.off("beforeValueChange",this.beforeValueChange)},ku.prototype.destroy=function(e){this.dropDownListObject&&!this.dropDownListObject.isDestroyed&&(this.removeEventListener(),this.dropDownListObject.destroy(),this.pagerDropDownDiv)&&this.pagerDropDownDiv.parentNode&&H.remove(this.pagerDropDownDiv)};var Mu=ku;function ku(e){this.pagerModule=e}Lu.prototype.getModuleName=function(){return"externalMessage"},Lu.prototype.render=function(){this.element=H.createElement("div",{className:"e-pagerexternalmsg",attrs:{"aria-label":this.pagerModule.getLocalizedLabel("ExternalMsg")}}),this.pagerModule.element.appendChild(this.element),this.refresh()},Lu.prototype.refresh=function(){this.pagerModule.externalMessage&&this.pagerModule.externalMessage.toString().length?(this.showMessage(),this.element.innerHTML=this.pagerModule.externalMessage):this.hideMessage()},Lu.prototype.hideMessage=function(){H.isNullOrUndefined(this.element)||(this.element.style.display="none")},Lu.prototype.showMessage=function(){this.element.style.display=""},Lu.prototype.destroy=function(){this.element&&this.element.parentElement&&H.remove(this.element)};var Pu=Lu;function Lu(e){this.pagerModule=e}Bu.prototype.getModuleName=function(){return"pager"},Bu.prototype.render=function(){var e=this.parent,t=(this.pagerDestroy(),H.isNullOrUndefined(this.parent.pagerTemplate)||(this.pageSettings.template=this.parent.pagerTemplate,this.parent.pageTemplateChange=!0),this.element=this.parent.createElement("div",{className:"e-gridpager"}),pp({},H.extend({},fp(this.pageSettings)),{click:this.clickHandler.bind(this),dropDownChanged:this.onSelect.bind(this),enableRtl:e.enableRtl,locale:e.locale,created:this.addAriaAttr.bind(this)},["parentObj","propName"]));t.cssClass=this.parent.cssClass||"",this.pagerObj=new Fu(t,void 0,this.parent),this.pagerObj.root=e.root||e,this.pagerObj.hasParent=!0,this.pagerObj.on(Dr,this.renderReactPagerTemplate,this),this.pagerObj.allowServerDataBinding=!1},Bu.prototype.onSelect=function(e){this.pageSettings.pageSize=e.pageSize,this.isInitialLoad||(this.pageSettings.currentPage=1)},Bu.prototype.addAriaAttr=function(){if(!this.pageSettings.template){this.parent.getContentTable()&&this.element.setAttribute("aria-controls",this.parent.getContentTable().id);for(var e=this.parent.createElement("div",{className:"e-numericcontainer"}),t=this.element.querySelector(".e-pagercontainer"),i=document.createDocumentFragment(),n=this.element.querySelector(".e-numericcontainer"),r=n.querySelectorAll("a"),s=0;s<r.length;s++){var o=this.parent.createElement("div");o.appendChild(r[parseInt(s.toString(),10)]),i.appendChild(o)}e.appendChild(i),t.replaceChild(e,n)}},Bu.prototype.dataReady=function(e){this.updateModel(e)},Bu.prototype.refresh=function(){this.pagerObj.refresh()},Bu.prototype.goToPage=function(e){this.pagerObj.goToPage(e)},Bu.prototype.setPageSize=function(e){this.pagerObj.setPageSize(e)},Bu.prototype.updateModel=function(e){this.parent.pageSettings.totalRecordsCount=e.count;var t="add"===e.action&&"save"===e.requestType||"batchsave"===e.requestType,i=this.parent.filterModule&&this.parent.filterModule.isFilterCleared,n=""===e.searchString&&"searching"===e.requestType||"filtering"===e.requestType&&("clearFilter"===e.action||"clear-filter"===e.action)||i;i&&(this.parent.filterModule.isFilterCleared=!1),!this.pagerObj.isAllPage||t||n&&!this.pagerObj.checkAll||(this.parent.pageSettings.pageSize=this.parent.pageSettings.totalRecordsCount),t&&this.pagerObj.isAllPage&&e.count===this.pageSettings.pageSize&&this.pagerObj.setProperties({pageSize:e.count},!0),this.parent.dataBind()},Bu.prototype.onActionComplete=function(e){this.parent.trigger(c,H.extend(e,{currentPage:this.parent.pageSettings.currentPage,requestType:"paging",type:c}))},Bu.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName()){for(var t=e.properties,i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];this.pagerObj[""+r]=t[""+r]}this.pagerObj.dataBind()}},Bu.prototype.clickHandler=function(e){var t,i,n=this.parent;this.isForceCancel||Bp(n)&&!n.prevPageMoving&&!this.isCancel?(this.isForceCancel?this.isForceCancel=!1:(H.isNullOrUndefined(e.newProp)||H.isNullOrUndefined(e.newProp.pageSize)?e.currentPage&&(n.notify(ci,{instance:this,handler:this.goToPage,arg1:e.currentPage}),this.pagerObj.currentPage=n.pageSettings.currentPage===this.pagerObj.currentPage?this.pagerObj.previousPageNo:n.pageSettings.currentPage):(n.notify(ci,{instance:this,handler:this.setPageSize,arg1:e.newProp.pageSize}),this.pagerObj.setProperties({pageSize:e.oldProp.pageSize},!0),this.parent.setProperties({pageSettings:{pageSize:e.oldProp.pageSize}},!0),this.pagerObj.setProperties({currentPage:n.pageSettings.currentPage===this.pagerObj.currentPage?this.pagerObj.previousPageNo:n.pageSettings.currentPage},!0)),this.isForceCancel=!0,this.pagerObj.dataBind()),e.cancel=!0):(n.pageSettings.pageSize=this.pagerObj.pageSize,i={cancel:n.prevPageMoving=!1,requestType:"paging",previousPage:t=this.pageSettings.currentPage,currentPage:e.currentPage,pageSize:n.pageSettings.pageSize,type:y},e.oldProp&&e.oldProp.pageSize&&(i.previousPageSize=e.oldProp.pageSize),this.isCancel||(this.pageSettings.currentPage=e.currentPage,this.parent.notify(bt,i),n.pageRequireRefresh=!1),i.cancel?(e.cancel=!0,this.parent.setProperties({pageSettings:{currentPage:t}},!0),this.pagerObj.setProperties({currentPage:t},!0),this.isCancel=!0):this.isCancel=!1)},Bu.prototype.keyPressHandler=function(e){e.action in zu&&(e.preventDefault(),(e=this.element.querySelector(zu[e.action])).classList.contains("e-nextprevitemdisabled")||e.click())},Bu.prototype.updateExternalMessage=function(e){this.pagerObj.enableExternalMessage||(this.pagerObj.enableExternalMessage=!0,this.pagerObj.dataBind()),this.pagerObj.externalMessage=e,this.pagerObj.dataBind()},Bu.prototype.appendToElement=function(){this.isInitialLoad=!0,this.parent.element.appendChild(this.element),this.parent.setGridPager(this.element),this.pagerObj.isReact=this.parent.isReact,this.pagerObj.isVue=this.parent.isVue||this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isVue,this.pagerObj.appendTo(this.element),this.isInitialLoad=!1},Bu.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.render(),this.appendToElement(),this.isReactTemplate())&&(this.pagerObj.updateTotalPages(),this.created())},Bu.prototype.addEventListener=function(){this.handlers={load:this.render,end:this.appendToElement,ready:this.dataReady,complete:this.onActionComplete,updateLayout:this.enableAfterRender,inboundChange:this.onPropertyChanged,keyPress:this.keyPressHandler,created:this.created},this.parent.isDestroyed||((this.parent.isReact||this.parent.isVue)&&this.parent.addEventListener(js,this.handlers.created.bind(this)),this.evtHandlers=[{event:ft,handler:this.handlers.load},{event:mt,handler:this.handlers.end},{event:yt,handler:this.handlers.ready},{event:xt,handler:this.handlers.complete},{event:St,handler:this.handlers.updateLayout},{event:wt,handler:this.handlers.inboundChange},{event:Gt,handler:this.handlers.keyPress},{event:s,handler:this.destroy}],Kc(this.parent,this.evtHandlers,!0,this))},Bu.prototype.created=function(){this.isInitialRender&&this.isReactTemplate()&&(this.isInitialRender=!1,this.renderReactPagerTemplate())},Bu.prototype.isReactTemplate=function(){return(this.parent.isReact||this.parent.isVue)&&this.pagerObj.template&&"string"!=typeof this.pagerObj.template},Bu.prototype.renderReactPagerTemplate=function(){var e,t,i;!this.isInitialRender&&this.isReactTemplate()&&(e=void 0,this.parent.destroyTemplate(["pagerTemplate"]),this.element.classList.add("e-pagertemplate"),this.pagerObj.compile(this.pagerObj.template),t={currentPage:(t=this.parent.pageSettings).currentPage,pageSize:t.pageSize,pageCount:t.pageCount,totalRecordsCount:t.totalRecordsCount,totalPages:this.pagerObj.totalPages},i=this.parent.id+"_pagertemplate",this.parent.isReact?(this.pagerObj.templateFn(t,this.parent,"pagerTemplate",i,null,null,this.pagerObj.element),this.parent.renderTemplates()):(e=this.pagerObj.templateFn(t,this.parent,"pagerTemplate"),Ip(this.pagerObj.element,e)))},Bu.prototype.removeEventListener=function(){this.parent.isDestroyed||((this.parent.isReact||this.parent.isVue)&&this.parent.removeEventListener(js,this.handlers.created),this.parent.off(Dr,this.renderReactPagerTemplate),Kc(this.parent,this.evtHandlers,!1))},Bu.prototype.destroy=function(){this.removeEventListener(),this.isReactTemplate()&&this.parent.destroyTemplate(["pagerTemplate"]),this.pagerObj.destroy()},Bu.prototype.pagerDestroy=function(){this.pagerObj&&!this.pagerObj.isDestroyed&&(this.pagerObj.destroy(),H.remove(this.element))};var Nu=Bu;function Bu(e,t){this.isInitialRender=!0,this.isCancel=!1,H.initializeTelemetryFeature("Page","DataGrid"),Fu.Inject(Pu,Mu),this.parent=e,this.pageSettings=t,this.addEventListener()}var zu={pageUp:".e-prev",pageDown:".e-next",ctrlAltPageDown:".e-last",ctrlAltPageUp:".e-first",altPageUp:".e-pp",altPageDown:".e-np"};qu=function(e,t){return(qu=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}qu(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Vu,Uu=vo),Vu.prototype.getGui=function(){return this.parent.createElement("div")},Vu.prototype.render=function(e,t){var i,n,r,s,o,a=this.parent.element.querySelector(".e-filterbar"),l=this.element.cloneNode(),h=this.getGui(),d=e.column;return a.appendChild(l),l.setAttribute("data-mappinguid",d.uid),d.filterTemplate?(a={},t&&(a[d.field]=t[d.field]),(a.column=d).visible?("FilterBar"===this.parent.filterSettings.type&&l.classList.add("e-fltrtemp"),n=this.parent.isReact&&"string"!=typeof d.filterTemplate&&!(d.filterTemplate.prototype&&d.filterTemplate.prototype.CSPTemplate),r=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,s=this.parent.element.id+d.uid+"filterTemplate",n||r?(d.getFilterTemplate()(a,this.parent,"filterTemplate",s,null,null,l),this.parent.renderTemplates()):Ip(l,d.getFilterTemplate()(a,this.parent,"filterTemplate",s,null,null,null,this.parent.root))):l.classList.add("e-hide")):"checkbox"!==d.type&&"rownumber"!==d.type?(!H.isNullOrUndefined(d.allowFiltering)&&!d.allowFiltering||H.isNullOrUndefined(d.filterBarTemplate)?(H.attributes(h,{class:"e-filterdiv e-fltrinputdiv"}),i=this.parent.createElement("input",{id:d.field+"_filterBarcell",className:"e-filtertext",attrs:{type:"search",title:d.headerText+e.attributes.title,value:t[e.column.field]||""}}),h.appendChild(i),o={element:i,floatLabelType:"Never",properties:{enableRtl:this.parent.enableRtl,showClearButton:!0,cssClass:this.parent.cssClass}},this.parent.filterModule.inputList.push(o),k.Input.createInput(o,this.parent.createElement)):(l.classList.add("e-fltrtemp"),H.attributes(h,{class:"e-fltrtempdiv"}),H.isNullOrUndefined(d.filterBarTemplate.create)?i=this.parent.createElement("input",{id:d.field+"_filterBarcell",className:"e-filterUi_input e-filtertext e-fltrTemp",attrs:{type:"search",title:d.headerText}}):(o={column:d,node:Element},"string"==typeof(i=(n="string"==typeof(n=d.filterBarTemplate.create)?H.getValue(n,window):n)(o))&&((r=this.parent.createElement("div")).innerHTML=i,i=r.firstChild),H.attributes(h,{class:"e-filterUi_input e-filtertext e-fltrTemp",title:d.headerText,id:d.field+"_filterBarcell"})),h.appendChild(i)),!1!==d.allowFiltering&&""!==d.field&&!H.isNullOrUndefined(d.field)||(i.setAttribute("disabled","true"),i.classList.add("e-disable")),(a=h.querySelector(".e-clear-icon"))&&a.setAttribute("title",this.parent.localeObj.getConstant("ClearButton")),d.visible||l.classList.add("e-hide"),this.appendHtml(l,h),this.parent.filterSettings.showFilterBarOperator&&"FilterBar"===this.parent.filterSettings.type&&!this.parent.isPrinting&&H.isNullOrUndefined(d.filterTemplate)&&H.isNullOrUndefined(d.filterBarTemplate)&&this.operatorIconRender(h,d,e),!H.isNullOrUndefined(d.allowFiltering)&&!d.allowFiltering||H.isNullOrUndefined(d.filterBarTemplate)||(o={element:i,column:d},(s="string"==typeof(s=d.filterBarTemplate.write)?H.getValue(s,window):s).call(this,o))):d.visible||l.classList.add("e-hide"),this.parent.isFrozenGrid()&&zc(this.parent,d,l),l},Vu.prototype.appendHtml=function(e,t){return e.appendChild(t),e},Vu.prototype.operatorIconRender=function(e,i,t){var n,r=this.parent,t=this.parent.createElement("input",{className:" e-filterbaroperator e-icons e-icon-filter",id:t.column.uid});if(e.querySelector("span").appendChild(t),i.filter&&i.filter.operator)n=i.filter.operator;else if(r.filterSettings.columns.length)for(var s=0,o=r.filterSettings.columns;s<o.length;s++){var a=o[parseInt(s.toString(),10)];if(a.field===i.field){n=a.operator;break}n="equal"}else n="equal";H.isNullOrUndefined(r.filterModule.operators[i.field])||(n=r.filterModule.operators[i.field]),this.dropOptr=new P.DropDownList({fields:{text:"text",value:"value"},popupHeight:"auto",value:n,width:"0px",enabled:i.allowFiltering,popupWidth:"auto",enableRtl:this.parent.enableRtl,change:this.internalEvent.bind(this),beforeOpen:function(){var e=r.filterModule.customOperators;this.dataSource=e[r.getColumnByUid(this.element.id).type+"Operator"];for(var t=0;t<this.dataSource.length;t++)i.filter&&i.filter.operator&&H.isNullOrUndefined(r.filterModule.operators[i.field])&&this.dataSource[parseInt(t.toString(),10)].value===i.filter.operator&&(this.value=i.filter.operator)},cssClass:this.parent.cssClass?"e-popup-flbar "+this.parent.cssClass:"e-popup-flbar"}),this.dropOptr.isAngular=Oc(this.parent),this.dropOptr.appendTo(t);e=H.closest(this.dropOptr.element,"span");e.classList.add("e-filterbardropdown"),e.removeAttribute("tabindex")},Vu.prototype.internalEvent=function(e){var t,i=this.parent,n=i.getColumnByUid(e.element.getAttribute("id")),r=(e.column=n,i.filterModule.operators[n.field]=e.value,e.value);i.filterModule&&i.filterModule.filterSettings.showFilterBarOperator&&(t=document.getElementById(n.field+"_filterBarcell"),"isempty"===r||"isnotempty"===r||"isnotnull"===r||"isnull"===r?(t.setAttribute("readOnly","true"),i.filterModule.filterByColumn(n.field,r,null,i.filterModule.predicate,i.filterModule.filterSettings.enableCaseSensitivity,i.filterModule.ignoreAccent,n.isForeignColumn())):t&&t.readOnly&&(t.removeAttribute("readOnly"),i.filterModule.removeFilteredColsByField(n.field))),i.notify(Kn,e)};var qu,Uu,Hu=Vu;function Vu(){var e=null!==Uu&&Uu.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-filterbarcell",attrs:{role:"columnheader"}}),e}Gu.prototype.renderOperatorUI=function(e,t,i,n,r){var s=this,o=(this.dialogObj=n,this.dlgElement=Gp(n,e),i.type+"Operator"),r=(this.optrData=this.customOptr=H.isNullOrUndefined(r)?(H.isNullOrUndefined(this.parent.filterSettings.operators)||H.isNullOrUndefined(this.parent.filterSettings.operators[o])?this.customFilterOperators:this.parent.filterSettings.operators)[o]:r,this.customOptr),o=this.dropSelectedVal(i,o),a=this.parent.createElement("div",{className:"e-flm_optrdiv"}),e=(e.appendChild(a),this.parent.createElement("input",{id:i.uid+"-floptr"}));a.appendChild(e),this.dropOptr=new P.DropDownList({dataSource:r,fields:{text:"text",value:"value"},cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",enableRtl:this.parent.enableRtl,text:o,change:function(){var e=s.dlgElement.querySelector(".e-flmenu-valuediv").querySelector("input");"isempty"===s.dropOptr.value||"isnotempty"===s.dropOptr.value||"isnotnull"===s.dropOptr.value||"isnull"===s.dropOptr.value?H.isNullOrUndefined(e.ej2_instances)?e.setAttribute("disabled","true"):e.ej2_instances[0].enabled=!1:H.isNullOrUndefined(e.getAttribute("disabled"))||(H.isNullOrUndefined(e.ej2_instances)?e.removeAttribute("disabled"):e.ej2_instances[0].enabled=!0),_p(s.dropOptr.value,i.uid,i,i.type,n,s.dlgElement)}}),this.dropOptr.isAngular=Oc(this.parent),this.dropOptr.addEventListener(Us,this.ddOpen),this.dropOptr.appendTo(e)},Gu.prototype.renderResponsiveDropDownList=function(e){e.popup.element.style.width="100%"},Gu.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=((this.dialogObj?this.dialogObj.zIndex:1e3)+1).toString(),this.parent.enableAdaptiveUI&&this.renderResponsiveDropDownList(e)},Gu.prototype.dropSelectedVal=function(e,t){for(var i="",n=0,r=this.parent.filterSettings.columns;n<r.length;n++){var s=r[n];(e.field===s.field||e.isForeignColumn()&&e.foreignKeyValue===s.field)&&(s=new V.DataManager(this.optrData).executeLocal((new V.Query).where("value","equal",s.isRange?"between":s.operator)),i=H.isNullOrUndefined(s[0])?"":s[0].text)}if(""===i&&this.optrData)if(e.filter.operator)for(var o=Object.keys(this.optrData).length,a=0;a<o;a++)this.optrData[parseInt(a.toString(),10)].value===e.filter.operator&&(i=this.optrData[parseInt(a.toString(),10)].text);else i=this.optrData[0].text;return i},Gu.prototype.getFlOperator=function(){return this.dropOptr.value},Gu.prototype.destroyDropDownList=function(e){e&&e.element&&this.dlgElement&&e.element!==this.dlgElement||this.dropOptr.isDestroyed||(this.dropOptr.removeEventListener(Us,this.ddOpen),this.dropOptr.destroy(),this.parent.off(Bi,this.destroyDropDownList),this.parent.off(s,this.destroyDropDownList))};var ju=Gu;function Gu(e,t,i,n){this.ddOpen=this.dropDownOpen.bind(this),this.parent=e,this.serviceLocator=i,this.filterSettings=n,this.customFilterOperators=t,this.parent&&(this.parent.on(Bi,this.destroyDropDownList,this),this.parent.on(s,this.destroyDropDownList,this))}Ku.prototype.create=function(e){this.instance=this.parent.createElement("input",{className:"e-flmenu-input",id:"strui-"+e.column.uid}),e.target.appendChild(this.instance),this.multiSelectCheckBoxInstance=this.parent.createElement("input",{className:"multiselect-input",id:"multiselectstrui-"+e.column.uid}),e.target.appendChild(this.multiSelectCheckBoxInstance),this.dialogObj=e.dialogObj,this.dlgElement=Gp(e.dialogObj,e.target),this.processDataOperation(e),this.createMultiSelectDropDown(e),_p(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,this.dlgElement)},Ku.prototype.processDataOperation=function(t){var i=this;t.column.isForeignColumn()?this.parent.getDataModule().dataManager.executeQuery(this.parent.getDataModule().generateQuery(!0)).then(function(e){i.getAutoCompleteOptions(t,e),_p(t.getOptrInstance.dropOptr.value,t.column.uid,t.column,t.column.type,t.dialogObj,i.dlgElement)}):this.getAutoCompleteOptions(t)},Ku.prototype.getAutoCompleteOptions=function(e,t){var i,n=e.column.isForeignColumn();if(n){for(var r=Su.getDistinct(t.result,e.column.field).records||[],s=void 0,o=0;o<r.length;o++)var a="string"==typeof r[parseInt(o.toString(),10)].ejValue?"contains":"equal",s=s?s.or(e.column.foreignKeyField,a,r[parseInt(o.toString(),10)][e.column.field],this.parent.filterSettings.enableCaseSensitivity,this.parent.filterSettings.ignoreAccent):new V.Predicate(e.column.foreignKeyField,a,r[parseInt(o.toString(),10)][e.column.field],this.parent.filterSettings.enableCaseSensitivity,this.parent.filterSettings.ignoreAccent);(i=(new V.Query).where(s)).params=this.parent.query.params}var t=(n?e.column:this.parent).dataSource,l={value:n?e.column.foreignKeyValue:e.column.field},h=new P.AutoComplete(H.extend({dataSource:t instanceof V.DataManager?t:new V.DataManager(t),fields:l,locale:this.parent.locale,enableRtl:this.parent.enableRtl,query:n?i:this.parent.getDataModule().generateQuery(!0,!0),sortOrder:"Ascending",cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",autofill:!0,placeholder:e.localizeText.getConstant("EnterValue"),actionBegin:function(){if(this.query.queries.length&&"onWhere"===this.query.queries[0].fn&&this.query.queries[0].e&&this.query.queries[0].e.predicates){for(var e=0;e<this.query.queries[0].e.predicates.length;e++)this.properties.fields.value===this.query.queries[0].e.predicates[""+e].field&&(this.query.queries[0].e.predicates.splice(e,1),e-=1);this.query.queries[0].e.predicates.length||this.query.queries.splice(0,1)}}},e.column.filter.params));this.acFocus=this.focus(h,e),this.acComplete=this.actionComplete(h),this.acOpen=this.openPopup.bind(this),h.addEventListener(Vs,this.acFocus),h.addEventListener(Us,this.acOpen),h.addEventListener(c,this.acComplete),t&&"result"in t&&(l=Cc({requestType:"stringfilterrequest"},this.parent.getQuery?this.parent.getQuery().clone():new V.Query),this.parent.trigger(Gi,l.state),l.deffered.promise.then(function(e){h.dataSource=new V.DataManager(e)})),this.actObj=h,this.actObj.appendTo(this.instance),n&&(e.afterRenderFilterUI||this.parent.filterModule.filterModule.afterRenderFilterUI.bind(this.parent.filterModule.filterModule))()},Ku.prototype.write=function(e){var t=e.getOptrInstance?e.getOptrInstance.dropOptr:this.parent.filterModule.filterModule.getOperatorDropdown(),i=this.getAutoCompleteInstance(e.column.uid),n=this.getMultiSelectInstance(e.column.uid);"in"===t.value||"notin"===t.value?n.value=Array.isArray(e.filteredValue)?e.filteredValue:[]:""===e.filteredValue||H.isNullOrUndefined(e.filteredValue)||Array.isArray(e.filteredValue)||(i.value=e.filteredValue)},Ku.prototype.read=function(e,t,i,n){var r,s;"in"===i||"notin"===i?s=this.getMultiSelectInstance(t.uid).value:(r=this.getAutoCompleteInstance(t.uid),s=e.value,H.Browser.isDevice&&(r.hidePopup(),r.focusOut()),(H.isNullOrUndefined(s)||""===s)&&(s=null,r)&&r.dataSource&&r.dataSource.adaptor&&r.dataSource.adaptor.getModuleName&&"ODataV4Adaptor"===r.dataSource.adaptor.getModuleName()&&(s="")),n.filterByColumn(t.field,i,s,"and",this.parent.filterSettings.enableCaseSensitivity)},Ku.prototype.getAutoCompleteInstance=function(e){return this.actObj||document.querySelector("#strui-"+e).ej2_instances[0]},Ku.prototype.getMultiSelectInstance=function(e){return this.multiSelectObj||document.querySelector("#multiselectstrui-"+e).ej2_instances[0]},Ku.prototype.createMultiSelectDropDown=function(e){var t=e.column.isForeignColumn(),i=(t?e.column:this.parent).dataSource,t=t?e.column.foreignKeyValue:e.column.field;this.multiSelectObj=new P.MultiSelect(H.extend({dataSource:i instanceof V.DataManager?i:new V.DataManager(i),fields:{text:t,value:t},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:(new V.Query).select(t),cssClass:this.parent.cssClass?"e-multiselect-flmenu "+this.parent.cssClass:"e-multiselect-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)),this.dialogObj=e.dialogObj,this.dropdownOpen=this.openPopup.bind(this),this.dropdownComplete=this.actionCompleteMultiCheckBox(t),this.multiSelectObj.addEventListener(Us,this.dropdownOpen),this.multiSelectObj.addEventListener(c,this.dropdownComplete),this.multiSelectObj.appendTo(this.multiSelectCheckBoxInstance)},Ku.prototype.openPopup=function(e){jp(e,this.dialogObj)},Ku.prototype.focus=function(e,t){return function(){e.filterType=t.getOptrInstance.getFlOperator()}},Ku.prototype.actionComplete=function(n){return function(e){e.result=e.result.filter(function(e,t,i){return i.map(function(e){return H.getValue(n.fields.value,e)}).indexOf(H.getValue(n.fields.value,e))===t})}},Ku.prototype.actionCompleteMultiCheckBox=function(t){return function(e){e.result=V.DataUtil.distinct(e.result,t,!0)}},Ku.prototype.destroy=function(e){e&&e.element&&this.dlgElement&&e.element!==this.dlgElement||(this.parent.off(Bi,this.destroy),this.parent.off(s,this.destroy),this.actObj&&!this.actObj.isDestroyed&&(this.actObj.removeEventListener(Vs,this.acFocus),this.actObj.removeEventListener(Us,this.acOpen),this.actObj.removeEventListener(c,this.acComplete),this.actObj.destroy()),this.multiSelectObj&&!this.multiSelectObj.isDestroyed&&(this.multiSelectObj.removeEventListener(Us,this.dropdownOpen),this.multiSelectObj.removeEventListener(c,this.dropdownComplete),this.multiSelectObj.destroy()))};var _u=Ku;function Ku(e,t,i){P.MultiSelect.Inject(P.CheckBoxSelection),this.parent=e,this.serLocator=t,this.filterSettings=i,this.parent&&(this.parent.on(Bi,this.destroy,this),this.parent.on(s,this.destroy,this))}Qu.prototype.keyEventHandler=function(e){13!==e.keyCode&&9!==e.keyCode||((e=document.createEvent("HTMLEvents")).initEvent("change",!1,!0),this.dispatchEvent(e))},Qu.prototype.create=function(e){this.numericInstance=this.parent.createElement("input",{className:"e-flmenu-input",id:"numberui-"+e.column.uid}),this.multiSelectCheckBoxInstance=this.parent.createElement("input",{className:"multiselect-input",id:"multiselectnumberui-"+e.column.uid}),e.target.appendChild(this.numericInstance),e.target.appendChild(this.multiSelectCheckBoxInstance),this.createNumericTextBox(e),this.createMultiSelectDropDown(e),this.dlgElement=Gp(e.dialogObj,e.target),_p(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,this.dlgElement)},Qu.prototype.write=function(e){var t=e.getOptrInstance?e.getOptrInstance.dropOptr:this.parent.filterModule.filterModule.getOperatorDropdown(),i=this.getNumericInstance(e.column.uid),n=this.getMultiSelectInstance(e.column.uid);"in"===t.value||"notin"===t.value?n.value=Array.isArray(e.filteredValue)?e.filteredValue:[]:(i.element.addEventListener("keydown",this.keyEventHandler),Array.isArray(e.filteredValue)||(i.value=e.filteredValue))},Qu.prototype.read=function(e,t,i,n){var r;r=("in"===i||"notin"===i?this.getMultiSelectInstance(t.uid):this.getNumericInstance(t.uid)).value,n.filterByColumn(t.field,i,r,"and",!0)},Qu.prototype.createNumericTextBox=function(e){this.numericTxtObj=new k.NumericTextBox(H.extend({format:("string"==typeof e.column.format||H.isUndefined(e.column.format)?e.column:e.column.format).format,locale:this.parent.locale,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("EnterValue"),enableRtl:this.parent.enableRtl},e.column.filter.params)),this.numericTxtObj.appendTo(this.numericInstance)},Qu.prototype.createMultiSelectDropDown=function(e){var t=e.column.isForeignColumn(),i=(t?e.column:this.parent).dataSource,t=t?e.column.foreignKeyValue:e.column.field;this.multiSelectObj=new P.MultiSelect(H.extend({dataSource:i instanceof V.DataManager?i:new V.DataManager(i),fields:{text:t,value:t},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:(new V.Query).select(t),cssClass:this.parent.cssClass?"e-multiselect-flmenu "+this.parent.cssClass:"e-multiselect-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)),this.dialogObj=e.dialogObj,this.dropdownOpen=this.openPopup.bind(this),this.dropdownComplete=this.actionComplete(t),this.multiSelectObj.addEventListener(Us,this.dropdownOpen),this.multiSelectObj.addEventListener(c,this.dropdownComplete),this.multiSelectObj.appendTo(this.multiSelectCheckBoxInstance)},Qu.prototype.getNumericInstance=function(e){return this.numericTxtObj||document.querySelector("#numberui-"+e).ej2_instances[0]},Qu.prototype.getMultiSelectInstance=function(e){return this.multiSelectObj||document.querySelector("#multiselectnumberui-"+e).ej2_instances[0]},Qu.prototype.openPopup=function(e){jp(e,this.dialogObj)},Qu.prototype.actionComplete=function(t){return function(e){e.result=V.DataUtil.distinct(e.result,t,!0)}},Qu.prototype.destroy=function(e){e&&e.element&&this.dlgElement&&e.element!==this.dlgElement||(this.parent.off(Bi,this.destroy),this.parent.off(s,this.destroy),this.numericTxtObj&&!this.numericTxtObj.isDestroyed&&this.numericTxtObj.destroy(),this.multiSelectObj&&!this.multiSelectObj.isDestroyed&&(this.multiSelectObj.removeEventListener(Us,this.dropdownOpen),this.multiSelectObj.removeEventListener(c,this.dropdownComplete),this.multiSelectObj.destroy()))};var Wu=Qu;function Qu(e,t,i){P.MultiSelect.Inject(P.CheckBoxSelection),this.filterSettings=i,this.parent=e,this.serviceLocator=t,this.parent&&(this.parent.on(Bi,this.destroy,this),this.parent.on(s,this.destroy,this))}Yu.prototype.create=function(e){this.elem=this.parent.createElement("input",{className:"e-flmenu-input",id:"bool-ui-"+e.column.uid}),e.target.appendChild(this.elem),this.dlgElement=Gp(e.dialogObj,e.target),this.multiSelectElement=this.parent.createElement("input",{className:"multiselect-input",id:"multiselectbool-ui-"+e.column.uid}),e.target.appendChild(this.multiSelectElement),this.createDropDownList(e),this.createMultiSelectDropDown(e),_p(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,this.dlgElement)},Yu.prototype.write=function(e){var t=e.getOptrInstance?e.getOptrInstance.dropOptr:this.parent.filterModule.filterModule.getOperatorDropdown(),i=this.getBooleanInstance(e.column.uid),n=this.getMultiSelectInstance(e.column.uid);"in"===t.value||"notin"===t.value?n.value=Array.isArray(e.filteredValue)?e.filteredValue:[]:H.isNullOrUndefined(e.filteredValue)||Array.isArray(e.filteredValue)||(i.value=e.filteredValue)},Yu.prototype.read=function(e,t,i,n){var r;"in"===i||"notin"===i?(r=this.getMultiSelectInstance(t.uid).value,n.filterByColumn(t.field,i,r,"and",!0)):(r=this.getBooleanInstance(t.uid).value,n.filterByColumn(t.field,i,r,"and",!1))},Yu.prototype.createDropDownList=function(r){var s=this,e=r.column.isForeignColumn(),t=(e?r.column:this.parent).dataSource,e=e?r.column.foreignKeyValue:r.column.field,i=(this.dialogObj=r.dialogObj,this.parent.getDataModule().generateQuery(!0,!0));i.select(e),this.dropInstance=new P.DropDownList(H.extend({dataSource:t instanceof V.DataManager?t:new V.DataManager(t),query:i,fields:{text:e,value:e},placeholder:r.localizeText.getConstant("SelectValue"),cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},r.column.filter.params)),this.dropdownOpen=this.openPopup.bind(this),this.dropdownComplete=this.actionComplete(e),this.dropInstance.addEventListener(Us,this.dropdownOpen),this.dropInstance.addEventListener(c,this.dropdownComplete),t&&"result"in t&&(i=Cc({requestType:"booleanfilterrequest"},this.parent.getQuery?this.parent.getQuery().clone():new V.Query),this.parent.trigger(Gi,i.state),i.deffered.promise.then(function(e){s.dropInstance.dataSource=new V.DataManager(e),s.dropInstance.dataBind();for(var t=0,i=s.parent.filterSettings.columns;t<i.length;t++){var n=i[t];r.column.uid===n.uid&&(s.dropInstance.value=n.value)}})),this.dropInstance.appendTo(this.elem)},Yu.prototype.createMultiSelectDropDown=function(e){var t=e.column.isForeignColumn(),i=(t?e.column:this.parent).dataSource,t=t?e.column.foreignKeyValue:e.column.field,n=this.parent.getDataModule().generateQuery(!0,!0);n.select(t),this.multiSelectCheckBoxInstance=new P.MultiSelect(H.extend({dataSource:i instanceof V.DataManager?i:new V.DataManager(i),fields:{text:t,value:t},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:n,cssClass:this.parent.cssClass?"e-multiselect-flmenu "+this.parent.cssClass:"e-multiselect-flmenu",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)),this.dialogObj=e.dialogObj,this.multiSelectDropdownOpen=this.openPopup.bind(this),this.multiSelectDropdownComplete=this.actionComplete(t),this.multiSelectCheckBoxInstance.addEventListener(Us,this.multiSelectDropdownOpen),this.multiSelectCheckBoxInstance.addEventListener(c,this.multiSelectDropdownComplete),this.multiSelectCheckBoxInstance.appendTo(this.multiSelectElement)},Yu.prototype.getBooleanInstance=function(e){return this.dropInstance||document.querySelector("#bool-ui-"+e).ej2_instances[0]},Yu.prototype.getMultiSelectInstance=function(e){return this.multiSelectCheckBoxInstance||document.querySelector("#multiselectbool-ui-"+e).ej2_instances[0]},Yu.prototype.openPopup=function(e){jp(e,this.dialogObj)},Yu.prototype.actionComplete=function(t){return function(e){e.result=V.DataUtil.distinct(e.result,t,!0)}},Yu.prototype.destroy=function(e){e&&e.element&&this.dlgElement&&e.element!==this.dlgElement||(this.parent.off(Bi,this.destroy),this.parent.off(s,this.destroy),this.dropInstance&&!this.dropInstance.isDestroyed&&(this.dropInstance.removeEventListener(Us,this.dropdownOpen),this.dropInstance.removeEventListener(c,this.dropdownComplete),this.dropInstance.destroy()),this.multiSelectCheckBoxInstance&&!this.multiSelectCheckBoxInstance.isDestroyed&&(this.multiSelectCheckBoxInstance.removeEventListener(Us,this.multiSelectDropdownOpen),this.multiSelectCheckBoxInstance.removeEventListener(c,this.multiSelectDropdownComplete),this.multiSelectCheckBoxInstance.destroy()))};var Xu=Yu;function Yu(e,t,i){P.MultiSelect.Inject(P.CheckBoxSelection),this.parent=e,this.serviceLocator=t,this.filterSettings=i,this.parent&&(this.parent.on(Bi,this.destroy,this),this.parent.on(s,this.destroy,this))}Zu.prototype.injectMaskedDateTime=function(e){"date"===e||"dateonly"===e?L.DatePicker.Inject(L.MaskedDateTime):"datetime"===e&&L.DateTimePicker.Inject(L.MaskedDateTime)},Zu.prototype.create=function(e){var t=ic(e.column.format,e.column.type);this.dialogObj=e.dialogObj,this.dlgElement=Gp(e.dialogObj,e.target),this.inputElem=this.parent.createElement("input",{className:"e-flmenu-input",id:"dateui-"+e.column.uid}),e.target.appendChild(this.inputElem),e.column.filter&&e.column.filter.params&&e.column.filter.params.enableMask&&this.injectMaskedDateTime(e.column.type),"date"===e.column.type||"dateonly"===e.column.type?this.datePickerObj=new L.DatePicker(H.extend({format:t,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params)):"datetime"===e.column.type&&(this.datePickerObj=new L.DateTimePicker(H.extend({format:t,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:e.localizeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl},e.column.filter.params))),this.datePickerObj.addEventListener(Us,this.dpOpen),this.datePickerObj.appendTo(this.inputElem),this.col=e.column,this.localeText=e.localizeText,this.optrObj=e.getOptrInstance,this.optrObj&&this.optrObj.dropOptr&&this.optrObj.dropOptr.addEventListener("change",this.optrChange)},Zu.prototype.onOperatorChange=function(){var e="between"===this.optrObj.dropOptr.value;e&&!this.rangePickerObj?this.showRange(this.datePickerObj.value):!e&&this.rangePickerObj&&(e=this.rangePickerObj.startDate,this.hideRange(),this.datePickerObj.value=e)},Zu.prototype.showRange=function(e,t){var i=this.col,n=ic(i.format,i.type),r=this.datePickerObj.element.parentElement,s=(r.style.display="none",this.rangeWrapper=this.parent.createElement("div",{className:"e-flmenu-range"}),this.parent.createElement("input",{className:"e-flmenu-input e-flmenu-range-input",id:"daterangeui-"+i.uid}));this.rangeWrapper.appendChild(s),r.parentElement.insertBefore(this.rangeWrapper,r.nextSibling),this.rangePickerObj=new L.DateRangePicker(H.extend({format:n,cssClass:this.parent.cssClass?"e-popup-flmenu "+this.parent.cssClass:"e-popup-flmenu",placeholder:this.localeText.getConstant("ChooseDate"),width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl,startDate:e||null,endDate:t||null},i.filter.params,this.getPresetOptions(i))),this.rangePickerObj.addEventListener(Us,this.dpOpen),this.rangePickerObj.appendTo(s),s.setAttribute("aria-label",this.localeText.getConstant("BetweenFromAria")+", "+this.localeText.getConstant("BetweenToAria"))},Zu.prototype.getPresetOptions=function(e){var t,e=e.filter.dateRanges;return e&&e.enablePresets&&(e="Default"!==(t="Custom"===e.presetMode||"Both"===e.presetMode?e.presetMode:"Default")&&Array.isArray(e.customPresetRanges)?this.validatePresets(e.customPresetRanges):[],(t="Custom"===t?e:this.getDefaultPresets().concat("Both"===t?e:[])).length)?{presets:t}:{}},Zu.prototype.validatePresets=function(e){for(var t=[],i=function(e){return e instanceof Date&&!isNaN(e.getTime())},n=0,r=e;n<r.length;n++){var s=r[n];s&&"string"==typeof s.label&&""!==s.label.trim()&&i(s.start)&&i(s.end)&&s.start.getTime()<=s.end.getTime()&&t.push(s)}return t},Zu.prototype.getDefaultPresets=function(){function e(e){return t.localeText.getConstant(e)}var t=this,i=new Date,n=i.getFullYear(),r=i.getMonth(),s=this.col.filter.params,s=s&&"number"==typeof s.firstDayOfWeek?s.firstDayOfWeek:0,i=new Date(n,r,i.getDate()-(i.getDay()-s+7)%7),s=i.getDate();return[{label:e("PresetThisWeek"),start:i,end:new Date(n,i.getMonth(),s+6)},{label:e("PresetThisMonth"),start:new Date(n,r,1),end:new Date(n,r+1,0)},{label:e("PresetThisYear"),start:new Date(n,0,1),end:new Date(n,11,31)},{label:e("PresetLastWeek"),start:new Date(n,i.getMonth(),s-7),end:new Date(n,i.getMonth(),s-1)},{label:e("PresetLastMonth"),start:new Date(n,r-1,1),end:new Date(n,r,0)},{label:e("PresetLast3Months"),start:new Date(n,r-3,1),end:new Date(n,r,0)},{label:e("PresetLast6Months"),start:new Date(n,r-6,1),end:new Date(n,r,0)},{label:e("PresetLastYear"),start:new Date(n-1,0,1),end:new Date(n-1,11,31)}]},Zu.prototype.hideRange=function(){this.rangePickerObj&&!this.rangePickerObj.isDestroyed&&(this.rangePickerObj.removeEventListener(Us,this.dpOpen),this.rangePickerObj.destroy()),this.rangePickerObj=null,this.rangeWrapper&&this.rangeWrapper.parentElement&&this.rangeWrapper.parentElement.removeChild(this.rangeWrapper),this.rangeWrapper=null,this.rangeInvalid=!1,this.datePickerObj.element.parentElement.style.display=""},Zu.prototype.write=function(e){var t=this.datePickerObj||document.querySelector("#dateui-"+e.column.uid).ej2_instances[0],i=e.filteredValue;Array.isArray(i)&&2===i.length?this.rangePickerObj||(this.optrObj.dropOptr.value="between",this.showRange(new Date(i[0]),new Date(i[1]))):t.value=H.isNullOrUndefined(e.filteredValue)?null:new Date(e.filteredValue)},Zu.prototype.read=function(e,t,i,n){var r,s;this.rangePickerObj&&"between"===i?(s=this.rangePickerObj.startDate,r=this.rangePickerObj.endDate,this.rangeInvalid=H.isNullOrUndefined(s)||H.isNullOrUndefined(r),this.rangePickerObj.element.setAttribute("aria-invalid",this.rangeInvalid?"true":"false"),this.rangePickerObj.element.parentElement.classList.toggle("e-error",this.rangeInvalid),this.rangeInvalid||n.filterByColumn(t.field,"between",[new Date(s.getTime()),new Date(r.getTime())],"and",!0)):(s=(this.datePickerObj||document.querySelector("#dateui-"+t.uid).ej2_instances[0]).value,s=H.isNullOrUndefined(s)?null:s,n.filterByColumn(t.field,i,s,"and",!0))},Zu.prototype.openPopup=function(e){e.popup.element.style.zIndex=((this.dialogObj?this.dialogObj.zIndex:1e3)+1).toString(),e.popup.element.classList.contains("e-popup-flmenu")||e.popup.element.classList.add("e-popup-flmenu"),e.popup.element.classList.contains("e-date-overflow")||e.popup.element.classList.add("e-date-overflow")},Zu.prototype.destroy=function(e){if(!(e&&e.element&&this.dlgElement&&e.element!==this.dlgElement)){if(this.parent.off(Bi,this.destroy),this.parent.off(s,this.destroy),this.optrObj&&this.optrObj.dropOptr&&this.optrObj.dropOptr.removeEventListener)try{this.optrObj.dropOptr.removeEventListener("change",this.optrChange)}catch(e){}this.rangePickerObj&&!this.rangePickerObj.isDestroyed&&(this.rangePickerObj.removeEventListener(Us,this.dpOpen),this.rangePickerObj.destroy(),this.rangePickerObj=null),H.isNullOrUndefined(this.datePickerObj)||this.datePickerObj.isDestroyed||(this.datePickerObj.removeEventListener(Us,this.dpOpen),this.datePickerObj.destroy())}};var $u=Zu;function Zu(e,t,i){this.dpOpen=this.openPopup.bind(this),this.optrChange=this.onOperatorChange.bind(this),this.rangeInvalid=!1,this.parent=e,this.locator=t,this.fltrSettings=i,this.parent&&(this.parent.on(Bi,this.destroy,this),this.parent.on(s,this.destroy,this))}eg.prototype.clearCustomFilter=function(e){this.clearBtnClick(e)},eg.prototype.applyCustomFilter=function(e){this.filterBtnClick(e.col)},eg.prototype.openDialog=function(e){this.options=e,this.col=this.parent.getColumnByField(e.field),(H.isNullOrUndefined(this.col.filter)||H.isNullOrUndefined(this.col.filter.type)||"Menu"===this.col.filter.type)&&this.renderDlgContent(e.target,this.col)},eg.prototype.closeDialog=function(e){var t=this,i=!(!this.options||!this.options.isToolPanel);if(this.dlgObj||i){var n=i?this.dlgDiv:document.getElementById(this.dlgObj.element.id);if((i||this.dlgObj&&!this.dlgObj.isDestroyed)&&n){e={cancel:!1,column:this.col,target:e,element:n,isToolPanel:this.options.isToolPanel};if(e.cancel)return void(this.parent.isColumnMenuFilterClosing=!1);this.restoreRangeFocus=!i&&this.flMuiObj&&this.flMuiObj.dropOptr&&!this.flMuiObj.dropOptr.isDestroyed&&"between"===this.flMuiObj.dropOptr.value,this.parent.notify(Bi,e),this.isDialogOpen=!1,this.isMenuCheck&&(this.menuFilterBase.unWireEvents(),this.parent.off(mn,this.actionComplete),this.isMenuCheck=!1);var e=this.col,e=(H.isNullOrUndefined(e.filter)||H.isNullOrUndefined(e.filter.ui)||H.isNullOrUndefined(e.filter.ui.destroy)||(e="string"==typeof(e=e.filter.ui.destroy)?H.getValue(e,window):e)(),function(){i?(vu(t.dlgDiv,t.toolPanelBtns,t.toolPanelClasses),t.toolPanelBtns=[],t.dlgDiv=null):t.dlgObj.destroy()});(this.parent.isReact||this.parent.isVue)&&this.col.filterTemplate&&this.col.filterTemplate instanceof Function?this.parent.clearTemplate(["filterTemplate"],void 0,e):(e(),i||H.remove(n)),this.restoreRangeFocus&&(this.restoreRangeFocus=!1,e=this.parent.getColumnHeaderByUid(this.col.uid)?this.parent.getColumnHeaderByUid(this.col.uid).querySelector(".e-filtermenudiv"):null)&&!this.parent.showColumnMenu&&e.focus(),this.parent.showColumnChooser||i||(n=document.getElementById(this.parent.element.id+"_e-popup"),H.isNullOrUndefined(n))||(H.remove(n),n=null),this.dlgObj&&!H.isNullOrUndefined(this.dlgObj.storeActiveElement)&&this.dlgObj.storeActiveElement.focus(),this.options.isToolPanel&&this.options.toolPanelClose&&this.options.toolPanelClose()}this.parent.notify(ur,{})}},eg.prototype.renderDlgContent=function(e,t){var i={requestType:lt,columnName:t.field,columnType:t.type},i=((i.filterModel=this).parent.trigger(y,i),this.parent.createElement("div",{className:"e-flmenu-maindiv",id:t.uid+"-flmenu"}));this.options.isToolPanel?this.renderToolPanel(e,t,i):(this.dlgDiv=this.parent.createElement("div",{className:"e-flmenu",id:t.uid+"-flmdlg"}),this.dlgDiv.setAttribute("aria-label",this.l10n.getConstant("FilterMenuDialogARIA")),(this.parent.enableAdaptiveUI?document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv"):this.parent.element).appendChild(this.dlgDiv),this.dlgObj=new F.Dialog({showCloseIcon:!1,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,created:this.dialogCreated.bind(this,e,t),position:this.parent.element.classList.contains("e-device")?{X:"center",Y:"center"}:{X:"",Y:""},target:this.parent.element.classList.contains("e-device")?document.body:this.parent.element,buttons:[{click:this.filterBtnClick.bind(this,t),buttonModel:{content:this.l10n.getConstant("FilterButton"),isPrimary:!0,cssClass:this.parent.cssClass?"e-flmenu-okbtn "+this.parent.cssClass:"e-flmenu-okbtn"}},{click:this.clearBtnClick.bind(this,t),buttonModel:{content:this.l10n.getConstant("ClearButton"),cssClass:this.parent.cssClass?"e-flmenu-cancelbtn "+this.parent.cssClass:"e-flmenu-cancelbtn"}}],content:i,width:!H.isNullOrUndefined(I(e,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:250,animationSettings:{effect:"None"},cssClass:this.parent.cssClass?"e-filter-popup "+this.parent.cssClass:"e-filter-popup"}),this.dlgObj.isStringTemplate=!0,this.renderResponsiveDialog(),this.dlgObj.appendTo(this.dlgDiv))},eg.prototype.renderToolPanel=function(e,t,i){var n,r=this.parent.cssClass?" "+this.parent.cssClass:"";this.toolPanelClasses=["e-flmenu","e-filter-popup"].concat(this.parent.cssClass?this.parent.cssClass.split(" "):[]),(this.dlgDiv=e).id=t.uid+"-flmdlg",e.setAttribute("aria-label",this.l10n.getConstant("FilterMenuDialogARIA")),(n=e.classList).add.apply(n,this.toolPanelClasses),e.appendChild(i),this.toolPanelBtns=yu(e,[{content:this.l10n.getConstant("FilterButton"),isPrimary:!0,cssClass:"e-flmenu-okbtn"+r,click:this.filterBtnClick.bind(this,t)},{content:this.l10n.getConstant("ClearButton"),cssClass:"e-flmenu-cancelbtn"+r,click:this.clearBtnClick.bind(this,t)}]),this.dialogCreated(e,t)},eg.prototype.renderResponsiveDialog=function(){this.parent.enableAdaptiveUI&&(this.dlgObj.position={X:"",Y:""},this.dlgObj.target=document.querySelector(".e-resfilter > .e-dlg-content > .e-mainfilterdiv"),this.dlgObj.width="100%",this.dlgObj.isModal=!1,this.dlgObj.buttons=[{}])},eg.prototype.dialogCreated=function(e,t){this.options.isToolPanel||(!H.Browser.isDevice&&e?Vp(e,this.dlgObj,this.parent):this.options.isResponsiveFilter||(this.dlgObj.position={X:"center",Y:"center"})),this.currentDialogCreatedColumn=t,this.renderFilterUI(e,t),t.isForeignColumn()&&(H.isNullOrUndefined(t.filter)||H.isNullOrUndefined(t.filter.ui)||H.isNullOrUndefined(t.filter.ui.create))||H.isNullOrUndefined(t.type)||this.afterRenderFilterUI();var e=this.parent.isReact&&"string"!=typeof t.filterTemplate,i=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;H.isNullOrUndefined(t.filterTemplate)||e||i?H.isNullOrUndefined(this.dlgDiv.querySelector(".e-flmenu-input"))||(this.dlgDiv.querySelector(".e-flmenu-input").focus(),this.dlgDiv.querySelector(".e-flmenu-input").parentElement.classList.add("e-input-focus")):(this.dlgDiv.querySelector(".e-flmenu-valuediv").firstElementChild.focus(),this.dlgDiv.querySelector(".e-flmenu-valuediv").firstElementChild.classList.add("e-input-focus"))},eg.prototype.afterRenderFilterUI=function(){var e=this.currentDialogCreatedColumn,t=(e.showColumnMenu&&!this.options.isToolPanel&&this.parent.notify(Ni,{}),this.options.isToolPanel||(this.parent.enableAdaptiveUI?(this.dlgObj.element.style.left="0px",this.dlgObj.element.style.maxHeight="none"):this.dlgObj.element.style.maxHeight=this.maxHeight,this.dlgObj.show()),!this.options.isToolPanel&&this.parent.getContent().firstElementChild.offsetHeight<this.dlgObj.element.offsetHeight&&!I(this.parent.element,"e-gantt-dialog")&&Ac(this.parent,this.dlgObj),this.flMuiObj.getFlOperator()),i=this.getDlgElement().querySelector(".e-flmenu-valuediv").querySelector("input"),t=("isempty"===t||"isnotempty"===t||"isnull"===t||"isnotnull"===t?H.isNullOrUndefined(i.ej2_instances)?i.setAttribute("disabled","true"):i.ej2_instances[0].enabled=!1:H.isNullOrUndefined(i&&i.getAttribute("disabled"))||(H.isNullOrUndefined(i.ej2_instances)?i.removeAttribute("disabled"):i.ej2_instances[0].enabled=!0),e.filterTemplate||this.writeMethod(e,this.getDlgElement().querySelector("#"+kp(e.uid+"-flmenu"))),{requestType:at,columnName:e.field,columnType:e.type});(t.filterModel=this).isDialogOpen=!0,this.isMenuCheck||this.parent.trigger(c,t)},eg.prototype.renderFilterUI=function(e,t){var i=this.getDlgElement().querySelector(".e-flmenu-maindiv");this.parent.log("column_type_missing",{column:t}),this.renderOperatorUI(i,e,t),this.renderFlValueUI(i,e,t)},eg.prototype.getDlgElement=function(){return this.dlgObj?this.dlgObj.element:this.dlgDiv},eg.prototype.renderOperatorUI=function(e,t,i){this.flMuiObj.renderOperatorUI(e,t,i,this.dlgObj,this.filterObj.menuOperator)},eg.prototype.renderFlValueUI=function(e,t,i){var n,r,s,o=this.parent.createElement("div",{className:"e-flmenu-valuediv"}),a=this.filterObj;e.appendChild(o),H.isNullOrUndefined(i.type)||(e=new this.colTypes[i.type](this.parent,this.serviceLocator,this.parent.filterSettings),this.valueUI=e,i.filterTemplate?((n={})[i.field]=n.value=a.values[i.field],i.foreignKeyValue&&(n[i.foreignKeyValue]=a.values[i.field],n[i.field]=void 0),a=this.parent.isReact&&"string"!=typeof i.filterTemplate&&!(i.filterTemplate.prototype&&i.filterTemplate.prototype.CSPTemplate),r=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,s=this.parent.element.id+(n.column=i).uid+"filterTemplate",a||r?(i.getFilterTemplate()(n,this.parent,"filterTemplate",s,null,null,o),this.parent.renderTemplates()):Ip(o,i.getFilterTemplate()(n,this.parent,"filterTemplate",s,null,null,null,this.parent.root)),this.isMenuCheck&&(this.menuFilterBase.cBox=this.dlgObj.element.querySelector(".e-checkboxlist.e-fields"),this.menuFilterBase.wireEvents(),this.parent.on(mn,this.actionComplete,this),this.menuFilterBase.getAllData())):H.isNullOrUndefined(i.filter)||H.isNullOrUndefined(i.filter.ui)||H.isNullOrUndefined(i.filter.ui.create)?e.create({column:i,target:o,getOptrInstance:this.flMuiObj,localizeText:this.l10n,dialogObj:this.dlgObj,afterRenderFilterUI:this.afterRenderFilterUI.bind(this)}):(a="string"==typeof(a=i.filter.ui.create)?H.getValue(a,window):a)({column:i,target:o,getOptrInstance:this.flMuiObj,dialogObj:this.dlgObj}))},eg.prototype.writeMethod=function(e,t){for(var t=t.querySelector(".e-flmenu-valinput"),i=this.valueUI||new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings),n=0,r=this.filterSettings.columns;n<r.length;n++){var s,o,a=r[n];e.uid===a.uid&&(o=a.isRange?((s=Array.isArray(o)?o:[]).push(a.value),s):a.value)}H.isNullOrUndefined(e.filter)||H.isNullOrUndefined(e.filter.ui)||H.isNullOrUndefined(e.filter.ui.write)?i.write({column:e,target:t,parent:this.parent,filteredValue:o,getOptrInstance:this.flMuiObj}):(i="string"==typeof(i=e.filter.ui.write)?H.getValue(i,window):i)({column:e,target:t,parent:this.parent,filteredValue:o,getOptrInstance:this.flMuiObj})},eg.prototype.filterBtnClick=function(e){var t,i,n,r=this.getDlgElement().querySelector(".e-flmenu-valuediv input"),s=this.flMuiObj.getFlOperator(),o=this.valueUI||new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings);e.filterTemplate?(i=void 0,(t=this.dlgDiv.querySelector(".e-flmenu-valuediv")).children[0].value?i=t.children[0].value:H.isNullOrUndefined(t.children[0].ej2_instances)?(n=t.querySelector(".e-control"),H.isNullOrUndefined(n)||(i="boolean"===e.type?n.checked:(H.isNullOrUndefined(n.ej2_instances)?n:n.ej2_instances[0]).value)):i=(this.parent.isAngular?t.children[0]:t.querySelector("input")).ej2_instances[0].value,this.filterObj.filterByColumn(e.field,s,i)):H.isNullOrUndefined(e.filter)||H.isNullOrUndefined(e.filter.ui)||H.isNullOrUndefined(e.filter.ui.read)?o.read(r,e,s,this.filterObj):(n="string"==typeof(n=e.filter.ui.read)?H.getValue(n,window):n)({element:r,column:e,operator:s,fltrObj:this.filterObj}),o.rangeInvalid||(this.closeDialog(),this.parent.showColumnMenu&&this.parent.notify(Ur,{}))},eg.prototype.closeResponsiveDialog=function(){this.closeDialog()},eg.prototype.clearBtnClick=function(e){this.filterObj.removeFilteredColsByField(e.field),this.closeDialog(),this.parent.showColumnMenu&&this.parent.notify(Ur,{})},eg.prototype.destroy=function(){this.closeDialog()},eg.prototype.getFilterUIInfo=function(){return{field:this.col.field,operator:this.flMuiObj.getFlOperator()}},eg.prototype.getOperatorDropdown=function(){return this.flMuiObj.dropOptr},eg.prototype.renderCheckBoxMenu=function(){return this.isMenuCheck=!0,this.menuFilterBase.updateModel(this.options),this.menuFilterBase.getAndSetChkElem(this.options),this.dlgObj.buttons=[{click:this.menuFilterBase.btnClick.bind(this.menuFilterBase),buttonModel:{content:this.menuFilterBase.getLocalizedLabel("FilterButton"),cssClass:"e-primary",isPrimary:!0}},{click:this.menuFilterBase.btnClick.bind(this.menuFilterBase),buttonModel:{cssClass:"e-flat",content:this.menuFilterBase.getLocalizedLabel("ClearButton")}}],this.menuFilterBase.dialogObj=this.dlgObj,this.menuFilterBase.dlg=this.dlgObj.element,this.menuFilterBase.dlg.classList.add("e-menucheckbox"),this.menuFilterBase.dlg.classList.remove("e-checkboxfilter"),this.maxHeight="800px",this.menuFilterBase.sBox.innerHTML},eg.prototype.actionComplete=function(e){this.isMenuCheck&&this.parent.trigger(c,e)};var Ju=eg;function eg(e,t,i,n,r){this.isDialogOpen=!1,this.maxHeight="350px",this.isMenuCheck=!1,this.toolPanelBtns=[],this.toolPanelClasses=[],this.restoreRangeFocus=!1,this.colTypes={string:_u,number:Wu,date:$u,dateonly:$u,boolean:Xu,datetime:$u},this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.customFilterOperators=n,this.filterObj=r,this.flMuiObj=new ju(this.parent,this.customFilterOperators,this.serviceLocator),this.l10n=this.serviceLocator.getService("localization"),this.menuFilterBase=new Su(e)}ig.prototype.destroy=function(){this.removeEventListener(),this.checkBoxBase.closeDialog()},ig.prototype.openDialog=function(e){this.checkBoxBase.openDialog(e),this.parent.log("column_type_missing",{column:e.column})},ig.prototype.closeDialog=function(){this.destroy(),this.isresetFocus&&this.parent.notify(wn,{})},ig.prototype.closeResponsiveDialog=function(){this.checkBoxBase.closeDialog()},ig.prototype.getModuleName=function(){return"checkboxFilter"},ig.prototype.actionBegin=function(e){this.parent.trigger(y,e)},ig.prototype.actionComplete=function(e){this.parent.trigger(c,e)},ig.prototype.actionPrevent=function(e){Bp(this.parent)&&(this.parent.notify(ci,e),e.cancel=!0)},ig.prototype.clearCustomFilter=function(e){this.checkBoxBase.clearFilter(e)},ig.prototype.applyCustomFilter=function(){this.checkBoxBase.fltrBtnHandler(),this.checkBoxBase.closeDialog()},ig.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(fn,this.actionBegin,this),this.parent.on(mn,this.actionComplete,this),this.parent.on(yn,this.actionPrevent,this))},ig.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(fn,this.actionBegin),this.parent.off(mn,this.actionComplete),this.parent.off(yn,this.actionPrevent))};var tg=ig;function ig(e,t,i){this.parent=e,this.isresetFocus=!0,this.checkBoxBase=new Su(e),this.addEventListener()}ng=function(e,t){return(ng=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}ng(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(og,rg=tg),og.prototype.destroy=function(){this.excelFilterBase.closeDialog()},og.prototype.openDialog=function(e){this.excelFilterBase.openDialog(e)},og.prototype.closeDialog=function(){this.excelFilterBase.closeDialog(),this.isresetFocus&&this.parent.notify(wn,{})},og.prototype.clearCustomFilter=function(e){this.excelFilterBase.clearFilter(e)},og.prototype.closeResponsiveDialog=function(e){e?this.excelFilterBase.removeDialog():this.closeDialog()},og.prototype.applyCustomFilter=function(e){e.isCustomFilter?this.excelFilterBase.filterBtnClick(e.col.field):(this.excelFilterBase.fltrBtnHandler(),this.excelFilterBase.closeDialog())},og.prototype.filterByColumn=function(e,t,i,n,r,s,o,a){this.excelFilterBase.filterByColumn(e,t,i,n,r,s,o,a)},og.prototype.getFilterUIInfo=function(){return this.excelFilterBase.getFilterUIInfo()},og.prototype.getModuleName=function(){return"excelFilter"};var ng,rg,sg=og;function og(e,t,i,n){t=rg.call(this,e,t,i)||this;return t.parent=e,t.isresetFocus=!0,t.excelFilterBase=new bu(e,n),t}var ag=function(){return(ag=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},lg=(p.prototype.render=function(e){if(!V.DataUtil.getObject("args.isFrozen",e)){e=this.parent;if(this.l10n=this.serviceLocator.getService("localization"),this.getLocalizedCustomOperators(),"FilterBar"===this.parent.filterSettings.type&&e.columns.length){var t=this.parent.element.querySelector(".e-filterbar"),t=(t&&H.remove(t),new $s(this.serviceLocator,oe.CellType.Filter,e)),i=(this.serviceLocator.getService("cellRendererFactory").addCellRenderer(oe.CellType.Filter,new Hu(this.parent,this.serviceLocator)),this.valueFormatter=this.serviceLocator.getService("valueFormatter"),t.element=this.parent.createElement("tr",{className:"e-filterbar",attrs:{role:"row"}}),this.generateRow()),n=(i.data=this.values,this.parent.getHeaderContent().querySelector("thead:not(.e-masked-thead)").appendChild(t.element),this.parent.element.querySelector(".e-rowdragheader"));if(this.element=t.render(i,e.getColumns(),null,null,t.element),this.element.querySelectorAll(".e-leftfreeze").length&&(this.element.querySelectorAll(".e-indentcell").length||this.element.querySelectorAll(".e-grouptopleftcell").length))for(var r=this.element.querySelectorAll(".e-indentcell, .e-grouptopleftcell"),s=0;s<r.length;s++)r[parseInt(s.toString(),10)].classList.add("e-leftfreeze"),Lc(r[parseInt(s.toString(),10)],30*s,this.parent.enableRtl,"Left");Pc(this.element);i=this.element.querySelector(".e-detailheadercell"),e=(i&&(i.className="e-filterbarcell e-mastercell"),n&&(n.classList.contains("e-leftfreeze")?n.className="e-dragheadercell e-mastercell e-leftfreeze":n.className="e-filterbarcell e-mastercell"),[].slice.call(this.element.getElementsByClassName("e-grouptopleftcell")));e.length&&e[e.length-1].classList.add("e-lastgrouptopleftcell"),this.wireEvents(),this.parent.notify(Oi,{case:"filter"})}}},p.prototype.showCustomFilter=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog(this.column)},p.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},p.prototype.setFilterModel=function(e){e=e.filter.type||this.parent.filterSettings.type;this.filterModule=new this.type[""+e](this.parent,this.parent.filterSettings,this.serviceLocator,this.customOperators,this)},p.prototype.destroy=function(){var e=this.parent.element;if(e&&(e.querySelector("."+ms)||e.querySelector("."+vs))){if(this.filterModule&&this.filterModule.destroy(),this.parent.refreshing||!this.parent.isDestroyed&&this.parent.allowFiltering||(this.filterSettings.columns=[]),this.updateFilterMsg(),this.removeEventListener(),this.unWireEvents(),"FilterBar"===this.filterSettings.type&&!this.parent.isDestroyed){if(this.filterSettings.showFilterBarOperator)for(var t=[].slice.call(this.element.getElementsByClassName("e-filterbaroperator")),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].ej2_instances[0]&&t[parseInt(i.toString(),10)].ej2_instances[0].destroy();this.parent.getColumns().map(function(e){e.filterBarTemplate&&!H.isNullOrUndefined(e.filterBarTemplate.destroy)&&(e="string"==typeof(e=e.filterBarTemplate.destroy)?H.getValue(e,window):e)()})}if(this.element){if(this.element.parentElement){for(i=0;i<this.inputList.length;i++)k.Input.destroy(this.inputList[parseInt(i.toString(),10)],this.inputList[parseInt(i.toString(),10)].element.nextElementSibling),H.remove(this.inputList[parseInt(i.toString(),10)].element);this.inputList=[],H.remove(this.element),this.element=null}e=this.parent.getHeaderContent().querySelector(".e-filterbar");e&&H.remove(e)}}},p.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,oe.ResponsiveDialogAction.isFilter)},p.prototype.generateRow=function(){var e=new ds({});return e.cells=this.generateCells(),e},p.prototype.generateCells=function(){var e=[];if(this.parent.allowGrouping)for(var t=0,i=this.parent.groupSettings.columns.length;t<i;t++)e.push(this.generateCell({},oe.CellType.HeaderIndent));(this.parent.detailTemplate||this.parent.childGrid)&&e.push(this.generateCell({},oe.CellType.DetailHeader)),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&e.push(this.generateCell({},oe.CellType.RowDragHIcon));for(var n=0,r=this.parent.getColumns();n<r.length;n++){var s=r[n];e.push(this.generateCell(s))}return this.parent.isRowDragable()&&"Right"===this.parent.getFrozenMode()&&e.push(this.generateCell({},oe.CellType.RowDragHIcon)),e},p.prototype.generateCell=function(e,t){e={visible:e.visible,isDataCell:!1,rowId:"",column:e,cellType:t||oe.CellType.Filter,attributes:{title:this.l10n.getConstant("FilterbarTitle")}};return new cs(e)},p.prototype.updateModel=function(){for(var e=this.column.isForeignColumn()||this.parent.enableColumnVirtualization?this.parent.getColumnByUid(this.column.uid,!0):this.parent.getColumnByField(this.fieldName),t=(this.filterObjIndex=this.getFilteredColsIndexByField(e),this.prevFilterObject=this.filterSettings.columns[this.filterObjIndex],Array.isArray(this.value)&&this.value.length?this.value:[this.value]),i=this.parent.dataSource.adaptor&&this.parent.dataSource.adaptor.getModuleName?this.parent.dataSource.adaptor.getModuleName():void 0,n=0,r=t.length;n<r;n++){var s=e.isForeignColumn()?e.foreignKeyValue:this.fieldName,o="notequal"===this.operator,a=("in"===this.operator||"notin"===this.operator?(!this.parent.getDataModule().isRemote()||"date"!==e.type&&"dateonly"!==e.type&&"datetime"!==e.type||(t=V.DataUtil.parse.arrayReplacer(t)),this.currentFilterObject={field:s,uid:e.uid,isForeignKey:e.isForeignColumn(),operator:this.operator,value:t,predicate:this.predicate,matchCase:this.matchCase,ignoreAccent:this.ignoreAccent,actualFilterValue:{},actualOperator:{}},r=0):this.currentFilterObject={field:s,uid:e.uid,isForeignKey:e.isForeignColumn(),operator:this.operator,value:t[parseInt(n.toString(),10)],predicate:this.predicate,matchCase:this.matchCase,ignoreAccent:this.ignoreAccent,actualFilterValue:{},actualOperator:{}},this.getFilteredColsIndexByField(e));-1<a&&(!Array.isArray(this.value)||Array.isArray(this.value)&&("in"===this.operator||"notin"===this.operator))?this.filterSettings.columns[parseInt(a.toString(),10)]=this.currentFilterObject:this.filterSettings.columns.push(this.currentFilterObject),this.column.isForeignColumn()||!this.prevFilterObject||!H.isNullOrUndefined(this.prevFilterObject.value)&&""!==this.prevFilterObject.value||"equal"!==this.prevFilterObject.operator&&"notequal"!==this.prevFilterObject.operator||"ODataAdaptor"===i||"ODataV4Adaptor"===i||this.handleExistingFilterCleanup(s),this.column.isForeignColumn()||!H.isNullOrUndefined(this.value)||"equal"!==this.operator&&"notequal"!==this.operator||"ODataAdaptor"===i||"ODataV4Adaptor"===i||(this.handleExistingFilterCleanup(s),"string"===e.type&&this.filterSettings.columns.push({field:s,ignoreAccent:this.ignoreAccent,matchCase:this.matchCase,operator:this.operator,predicate:o?"and":"or",value:""}),this.filterSettings.columns.push({field:s,ignoreAccent:this.ignoreAccent,matchCase:this.matchCase,operator:this.operator,predicate:o?"and":"or",value:void 0}),this.filterSettings.columns.push({field:s,ignoreAccent:this.ignoreAccent,matchCase:this.matchCase,operator:this.operator,predicate:o?"and":"or",value:null}))}this.filterSettings.columns=this.filterSettings.columns,this.parent.dataBind()},p.prototype.handleExistingFilterCleanup=function(e){for(var t=0;t<this.filterSettings.columns.length;t++)this.filterSettings.columns[""+t].field!==e||"equal"!==this.filterSettings.columns[""+t].operator&&"notequal"!==this.filterSettings.columns[""+t].operator||!H.isNullOrUndefined(this.filterSettings.columns[""+t].value)||(this.filterSettings.columns.splice(t,1),t-=1)},p.prototype.getFilteredColsIndexByField=function(e){for(var t=this.filterSettings.columns,i=0,n=t.length;i<n;i++)if(t[parseInt(i.toString(),10)].uid===e.uid||e.isForeignColumn()&&this.parent.getColumnByUid(e.uid).field===e.foreignKeyValue)return i;return-1},p.prototype.onActionComplete=function(e){var t=this.isRemove?{requestType:"filtering",type:c}:{currentFilterObject:this.currentFilterObject,currentFilteringColumn:H.isNullOrUndefined(this.column)?void 0:this.column.field,columns:this.filterSettings.columns,requestType:"filtering",type:c};this.parent.trigger(c,H.extend(e,t)),this.isRemove=!1},p.prototype.wireEvents=function(){H.EventHandler.add(this.parent.getHeaderContent(),"keyup",this.keyUpHandlerImmediate,this)},p.prototype.unWireEvents=function(){H.EventHandler.remove(this.parent.getHeaderContent(),"keyup",this.keyUpHandlerImmediate)},p.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.parent.getHeaderTable().classList.add("e-sortfilter"),this.render())},p.prototype.refreshFilterValue=function(){H.isNullOrUndefined(this.parent.modelObserver.boundedEvents)||this.parent.removeEventListener(Ye,this.refreshFilterValueFn),"FilterBar"!==this.filterSettings.type&&"Excel"!==this.filterSettings.type||!this.filterSettings.columns.length||this.parent.getCurrentViewRecords().length||this.initialEnd()},p.prototype.initialEnd=function(){if(this.parent.off(vt,this.initialEnd),this.parent.getColumns().length&&this.filterSettings.columns.length){var e=this.parent;this.contentRefresh=!1,this.initialLoad=!0;for(var t=0,i=e.filterSettings.columns;t<i.length;t++){var n=i[t];this.filterByColumn(n.field,n.operator,n.value,n.predicate,n.matchCase,n.ignoreAccent,n.actualFilterValue,n.actualOperator,n.isForeignKey)}this.initialLoad=!1,this.updateFilterMsg(),this.contentRefresh=!0}},p.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Sr,this.setFullScreenDialog,this),this.parent.on(St,this.enableAfterRender,this),this.parent.on(Tt,this.onActionComplete,this),this.parent.on(wt,this.onPropertyChanged,this),this.parent.on(Gt,this.keyUpHandler,this),this.parent.on(Xt,this.columnPositionChanged,this),this.parent.on(Rt,this.render,this),this.parent.on(vt,this.initialEnd,this),this.parent.on(Bi,this.filterMenuClose,this),this.parent.on(Qr,this.renderResponsiveChangeAction,this),this.docClickHandler=this.clickHandler.bind(this),H.EventHandler.add(document,"click",this.docClickHandler,this),H.EventHandler.add(this.parent.element,"mousedown",this.refreshClearIcon,this),this.parent.on(Li,this.columnMenuFilter,this),this.parent.on(_t,this.filterIconClickHandler,this),this.parent.on("persist-data-changed",this.initialEnd,this),this.parent.on(Gn,this.clickHandler,this),this.parent.on(s,this.destroy,this),this.refreshFilterValueFn=this.refreshFilterValue.bind(this),this.parent.addEventListener(Ye,this.refreshFilterValueFn))},p.prototype.removeEventListener=function(){H.EventHandler.remove(document,"click",this.docClickHandler),H.EventHandler.remove(this.parent.element,"mousedown",this.refreshClearIcon),this.parent.isDestroyed||(this.parent.off(Sr,this.setFullScreenDialog),this.parent.off(St,this.enableAfterRender),this.parent.off(Tt,this.onActionComplete),this.parent.off(wt,this.onPropertyChanged),this.parent.off(Gt,this.keyUpHandler),this.parent.off(Xt,this.columnPositionChanged),this.parent.off(Rt,this.render),this.parent.off(Li,this.columnMenuFilter),this.parent.off(Bi,this.filterMenuClose),this.parent.off(Qr,this.renderResponsiveChangeAction),this.parent.off(_t,this.filterIconClickHandler),this.parent.off(Gn,this.clickHandler),this.parent.off(s,this.destroy))},p.prototype.refreshClearIcon=function(e){this.parent.allowFiltering&&"FilterBar"===this.parent.filterSettings.type&&e.target.closest("th")&&e.target.closest("th").classList.contains("e-filterbarcell")&&e.target.classList.contains("e-clear-icon")&&(e=e.target.previousElementSibling,k.Input.setValue(null,e,"Never",!0),this.removeFilteredColsByField(e.id.slice(0,-14)))},p.prototype.filterMenuClose=function(e){e&&e.isToolPanel||(this.fltrDlgDetails.isOpen=!1)},p.prototype.filterByColumn=function(e,t,i,n,r,s,o,a,l){var h,d=this,p=this.parent;if("string"==typeof i&&(i=this.parent.sanitize(i)),this.column=p.grabColumnByFieldFromAllCols(e,l),"like"===(t="FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&H.isNullOrUndefined(this.column.filterBarTemplate)&&H.isNullOrUndefined(this.column.filterTemplate)?this.getOperatorName(e):t)&&i&&-1===i.indexOf("%")&&(i="%"+i+"%"),this.column)if("FilterBar"===this.filterSettings.type&&(h=p.getHeaderContent().querySelector("[id='"+this.column.field+"_filterBarcell']")),H.isNullOrUndefined(this.column.allowFiltering)||this.column.allowFiltering)if(Bp(p))p.notify(ci,{instance:this,handler:this.filterByColumn,arg1:e,arg2:t,arg3:i,arg4:n,arg5:r,arg6:s,arg7:o,arg8:a});else if("between"===t)this.applyBetween(e,i,s);else{if(this.predicate=n||(Array.isArray(i)?"or":"and"),this.value=i,this.matchCase=r||!1,this.ignoreAccent=this.ignoreAccent=H.isNullOrUndefined(s)?this.parent.filterSettings.ignoreAccent:s,this.fieldName=e,this.operator=t,""===(i=H.isNullOrUndefined(i)?i:i.toString())&&(i=null),"number"!==this.column.type&&"date"!==this.column.type||(this.matchCase=!0),h&&"FilterBar"===this.filterSettings.type){if(i&&i.length<1||!this.filterByMethod&&this.checkForSkipInput(this.column,i))return this.filterStatusMsg=i&&i.length<1?"":this.l10n.getConstant("InvalidFilterMessage"),void this.updateFilterMsg();h.value!==i&&(h.value=i)}H.isNullOrUndefined(this.column.format)?this.values[this.column.field]=i:(this.applyColumnFormat(i),this.initialLoad&&"FilterBar"===this.filterSettings.type&&(h.value=this.values[this.column.field]));l={field:this.fieldName,predicate:n,matchCase:r,ignoreAccent:s,operator:this.operator,value:this.value,type:this.column.type};1<this.parent.filterSettings.columns.filter(function(e){return e.field===d.fieldName}).length&&!H.isNullOrUndefined(this.actualPredicate[this.fieldName])?this.actualPredicate[this.fieldName].push(l):this.actualPredicate[this.fieldName]=[l],this.checkAlreadyColFiltered(this.column.field)||this.updateModel()}else this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:this.column.headerText})},p.prototype.applyBetween=function(i,e,t){var n,r=this,s=this.column;"Menu"!==this.filterSettings.type||"date"!==s.type&&"datetime"!==s.type&&"dateonly"!==s.type||2!==(n=Array.isArray(e)&&2===e.length?e.map(function(e){return H.isNullOrUndefined(e)||""===e?null:new Date(e)}):[]).length||n.some(function(e){return H.isNullOrUndefined(e)||isNaN(e.getTime())})||("datetime"!==s.type&&(n[0].setHours(0,0,0,0),n[1].setHours(0,0,0,0)),this.predicate="and",this.value=n,this.matchCase=!0,this.ignoreAccent=H.isNullOrUndefined(t)?this.parent.filterSettings.ignoreAccent:t,this.fieldName=i,this.operator="between",this.values[s.field]=n,this.filterObjIndex=this.getFilteredColsIndexByField(s),this.prevFilterObject=this.filterSettings.columns[this.filterObjIndex],this.prevRangeColumns=this.filterSettings.columns.filter(function(e){return e.uid===s.uid}),e=["greaterthanorequal","lessthanorequal"].map(function(e,t){return{field:i,uid:s.uid,isForeignKey:!1,operator:e,value:n[parseInt(t.toString(),10)],predicate:"and",matchCase:r.matchCase,ignoreAccent:r.ignoreAccent,isRange:!0,type:s.type,actualFilterValue:{},actualOperator:{}}}),this.actualPredicate[""+i]=e,t=this.filterSettings.columns.filter(function(e){return e.uid!==s.uid}),this.currentFilterObject=e[1],this.filterSettings.columns=t.concat(e),this.parent.dataBind())},p.prototype.applyColumnFormat=function(e){var t=this,i="date"===this.column.type||"datetime"===this.column.type||"dateonly"===this.column.type?new Date(e):parseFloat(e);("date"===this.column.type||"datetime"===this.column.type||"dateonly"===this.column.type)&&e&&Array.isArray(this.value)&&1<e.split(",").length?this.values[this.column.field]=e.split(",").map(function(e){return""===e&&(e=null),t.setFormatForFlColumn(new Date(e),t.column)}):this.values[this.column.field]=this.setFormatForFlColumn(i,this.column)},p.prototype.skipUid=function(e){for(var t=!0,i=Object.keys(e),n=0;n<i.length;n++){var r=Object.keys(e[i[parseInt(n.toString(),10)]]);1===r.length&&"uid"===r[0]&&(t=!1)}return t},p.prototype.onPropertyChanged=function(n){if(n.module===this.getModuleName())for(var r=this,e=0,t=Object.keys(n.properties);e<t.length;e++){var i=function(e){switch(e){case"columns":var t,i={currentFilterObject:r.currentFilterObject,currentFilteringColumn:r.column?r.column.field:void 0,action:"filter",columns:r.filterSettings.columns,requestType:"filtering",type:y,cancel:!1};if(r.contentRefresh&&r.skipUid(n.properties.columns)){if(r.parent.notify(bt,i),i.cancel)return"CheckBox"!==r.filterSettings.type&&"Excel"!==r.filterSettings.type||r.column&&r.column.filter&&"Menu"===r.column.filter.type?r.currentFilterObject&&r.currentFilterObject.isRange?(t=r.currentFilterObject.uid,r.filterSettings.columns=r.filterSettings.columns.filter(function(e){return e.uid!==t}).concat(r.prevRangeColumns)):H.isNullOrUndefined(r.prevFilterObject)?r.filterSettings.columns.splice(r.filterSettings.columns.length-1,1):r.filterSettings.columns[r.filterObjIndex]=r.prevFilterObject:(r.filterSettings.columns=r.actualData.length<=1?r.checkboxPrevFilterObject:r.checkboxFilterObject,r.actualPredicate[r.column.field]=r.filterSettings.columns,i=r.parent.getColumnByField(r.column.field),i=r.parent.showColumnMenu&&i.showColumnMenu?".e-columnmenu":".e-icon-filter",i=r.parent.getColumnHeaderByField(r.column.field).querySelector(i),0===r.checkboxPrevFilterObject.length?i.classList.remove("e-filtered"):i.classList.add("e-filtered")),{value:void 0};r.updateFilterIcon(),r.refreshFilterSettings(),r.updateFilterMsg(),r.updateFilter()}break;case"showFilterBarStatus":n.properties[""+e]?r.updateFilterMsg():r.parent.allowPaging&&r.parent.updateExternalMessage("");break;case"showFilterBarOperator":case"type":r.parent.refreshHeader(),r.refreshFilterSettings(),("100%"===r.parent.height||"string"==typeof r.parent.height&&-1!==r.parent.height.toLowerCase().indexOf("vh"))&&r.parent.scrollModule.refresh()}}(t[e]);if("object"==typeof i)return i.value}},p.prototype.refreshFilterSettings=function(){if("FilterBar"===this.filterSettings.type){for(var e=0;e<this.filterSettings.columns.length;e++){this.column=this.parent.grabColumnByUidFromAllCols(this.filterSettings.columns[parseInt(e.toString(),10)].uid)||this.parent.getColumnByField(this.filterSettings.columns[parseInt(e.toString(),10)].field);var t,i=this.filterSettings.columns[parseInt(e.toString(),10)].value,i=!H.isNullOrUndefined(i)&&i.toString();H.isNullOrUndefined(this.column.format)?(t=this.filterSettings.columns[parseInt(e.toString(),10)].field,this.values[""+t]=this.filterSettings.columns[parseInt(e.toString(),10)].value):this.applyColumnFormat(i);(n=this.getFilterBarElement(this.column.field))&&(""===this.cellText[this.filterSettings.columns[parseInt(e.toString(),10)].field]||H.isNullOrUndefined(this.cellText[this.filterSettings.columns[parseInt(e.toString(),10)].field])?n.value=this.filterSettings.columns[parseInt(e.toString(),10)].value:n.value=this.cellText[this.column.field]);n&&this.filterSettings.showFilterBarOperator&&-1<["isnull","isnotnull","isempty","isnotempty"].indexOf(this.filterSettings.columns[parseInt(e.toString(),10)].operator)&&(n.value=this.l10n.getConstant({isnull:"IsNull",isnotnull:"NotNull",isnotempty:"IsNotEmpty",isempty:"IsEmpty"}[this.filterSettings.columns[parseInt(e.toString(),10)].operator]))}if(0===this.filterSettings.columns.length)for(var n,r=this.parent.getColumns(),e=0;e<r.length;e++)(n=this.getFilterBarElement(r[parseInt(e.toString(),10)].field))&&""!==n.value&&(n.value="",delete this.values[r[parseInt(e.toString(),10)].field])}},p.prototype.updateFilterIcon=function(){if(0===this.filterSettings.columns.length&&this.parent.element.querySelector(".e-filtered"))for(var e=[].slice.call(this.parent.element.getElementsByClassName("e-filtered")),t=0,i=e.length;t<i;t++)e[parseInt(t.toString(),10)].classList.remove("e-filtered")},p.prototype.getFilterBarElement=function(e){var t,e="[id='"+e+"_filterBarcell']";return t=e&&!H.isNullOrUndefined(this.element)?this.element.querySelector(e):t},p.prototype.refreshFilter=function(){this.refreshFilterSettings(),this.updateFilterMsg()},p.prototype.clearFiltering=function(e){var t=this,i=vp(this.filterSettings.columns);if(this.isFilterCleared=!0,H.isNullOrUndefined(e))if(Bp(this.parent))this.parent.notify(ci,{instance:this,handler:this.clearFiltering});else{for(var n=0;n<i.length;n++)i[parseInt(n.toString(),10)].uid=i[parseInt(n.toString(),10)].uid||this.parent.getColumnByField(i[parseInt(n.toString(),10)].field).uid;var r=i.map(function(e){return e.uid}),s=r.filter(function(e,t){return r.indexOf(e)===t});this.refresh=!1;for(var n=0,o=s.length;n<o;n++)this.removeFilteredColsByField(this.parent.getColumnByUid(s[parseInt(n.toString(),10)]).field,!1);if(this.refresh=!0,s.length&&this.parent.renderModule.refresh(),0===this.parent.filterSettings.columns.length&&this.parent.element.querySelector(".e-filtered"))for(var a=[].slice.call(this.parent.element.getElementsByClassName("e-filtered")),n=0,o=a.length;n<o;n++)a[0].classList.remove("e-filtered");this.isRemove=!0,this.filterStatusMsg="",this.updateFilterMsg()}else this.refresh=!1,e.forEach(function(e){t.removeFilteredColsByField(e,!1)}),this.parent.setProperties({filterSettings:{columns:this.filterSettings.columns}},!0),this.parent.renderModule.refresh(),this.refresh=!0},p.prototype.checkAlreadyColFiltered=function(e){for(var t=0,i=this.filterSettings.columns;t<i.length;t++){var n=i[t];if(n.field===e&&n.operator===this.operator&&n.predicate===this.predicate&&"Menu"===this.parent.filterSettings.type&&("date"===n.type||"datetime"===n.type))return this.checkDateColumnValue(n.value,this.value);if(n.field===e&&n.value===this.value&&n.operator===this.operator&&n.predicate===this.predicate)return!0}return!1},p.prototype.checkDateColumnValue=function(e,t){return!(!H.isNullOrUndefined(e)||!H.isNullOrUndefined(t))||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():"string"==typeof e&&"string"==typeof t&&e===t)},p.prototype.columnMenuFilter=function(e){this.column=e.col;var t=H.closest(e.target,"#"+e.id);e.isClose&&!t?this.filterModule.closeDialog():t&&this.filterDialogOpen(this.column,e.target)},p.prototype.filterDialogOpen=function(e,t,i,n){this.filterModule&&(this.filterModule.isresetFocus=!1,this.filterModule.closeDialog()),this.setFilterModel(e),this.parent.notify(ls,{field:e.field}),this.filterModule.openDialog(this.createOptions(e,t,i,n))},p.prototype.closeFilterDialogByField=function(e){this.filterModule&&this.column&&this.column.field===e&&this.filterModule.closeDialog()},p.prototype.renderToolPanelFilter=function(e,t,i){var n=e.filter.type||this.parent.filterSettings.type,e=ag({},this.createOptions(e,t),{isToolPanel:!0,toolPanelClose:i}),t="Excel"===n?new bu(this.parent,this.customOperators):"CheckBox"===n?new Su(this.parent):new Ju(this.parent,this.filterSettings,this.serviceLocator,this.customOperators,this);return t.openDialog(e),t},p.prototype.createOptions=function(e,t,i,n){var r=this.parent,s=e.filter.dataSource||r.dataSource&&"result"in r.dataSource?r.dataSource:r.getDataModule().dataManager,o=e.filter.type||this.parent.filterSettings.type;return{type:e.type,field:e.field,displayName:e.headerText,dataSource:s,format:e.format,height:800,columns:r.getColumns(),filteredColumns:r.filterSettings.columns,target:t,dataManager:r.getDataModule().dataManager,formatFn:e.getFormatter(),ignoreAccent:r.filterSettings.ignoreAccent,parserFn:e.getParser(),query:r.query,template:e.getFilterItemTemplate(),hideSearchbox:!H.isNullOrUndefined(e.filter.hideSearchbox)&&e.filter.hideSearchbox,handler:this.filterHandler.bind(this),localizedStrings:r.getLocaleConstants(),position:{X:i,Y:n},column:e,foreignKeyValue:e.foreignKeyValue,actualPredicate:this.actualPredicate,localeObj:r.localeObj,isRemote:r.getDataModule().isRemote(),allowCaseSensitive:this.filterSettings.enableCaseSensitivity,isResponsiveFilter:this.parent.enableAdaptiveUI,operator:this.actualPredicate[e.field]&&"Menu"===o?this.actualPredicate[e.field][0].operator:"equal",parentTotalDataCount:r.getDataModule().isRemote()&&r.allowPaging?r.pagerModule.pagerObj.totalRecordsCount:r.getDataModule().isRemote()?r.totalDataRecordsCount:r.getFilteredRecords().length,parentCurrentViewDataCount:r.currentViewData.length,parentFilteredLocalRecords:r.getDataModule().isRemote()?[]:r.getFilteredRecords()}},p.prototype.removeFilteredColsByField=function(s,o){var a,l=this.filterSettings.columns;if(Bp(this.parent))e={instance:this,handler:this.removeFilteredColsByField,arg1:s,arg2:o},this.parent.notify(ci,e);else{for(var e,i=l.map(function(e){return e.uid}),h=i.filter(function(e,t){return i.indexOf(e)===t}),d=(H.isNullOrUndefined(this.column)||(e=this.column.isForeignColumn()?this.parent.getColumnByUid(this.column.uid):this.parent.getColumnByField(s),this.filterObjIndex=this.getFilteredColsIndexByField(e),this.prevFilterObject=this.filterSettings.columns[this.filterObjIndex]),this),t=0,n=h.length;t<n;t++)if("break"===function(e){l[parseInt(e.toString(),10)].uid=l[parseInt(e.toString(),10)].uid||d.parent.getColumnByField(l[parseInt(e.toString(),10)].field).uid;var t=l.length,i=d.parent.grabColumnByUidFromAllCols(h[parseInt(e.toString(),10)]);if(i.field===s||i.field===i.foreignKeyValue&&i.isForeignColumn()){e=d.filterSettings.columns.filter(function(e){return e.uid===i.uid})[0];for("FilterBar"===d.filterSettings.type&&!o&&(r="[id='"+i.field+"_filterBarcell']",a=d.parent.getHeaderContent().querySelector(r))&&(a.value="",delete d.values[""+s]);t--;)l[parseInt(t.toString(),10)].uid===i.uid&&l.splice(t,1);var n,r=d.parent.getColumnHeaderByField(i.field);return"FilterBar"===d.filterSettings.type&&!d.parent.showColumnMenu||(n=d.parent.showColumnMenu&&i.showColumnMenu?".e-columnmenu":".e-icon-filter",r.querySelector(n).classList.remove("e-filtered")),d.isRemove=!0,d.actualPredicate[""+s]&&delete d.actualPredicate[""+s],d.values[""+s]&&delete d.values[""+s],d.refresh&&d.parent.notify(bt,{requestType:"filtering",type:y,currentFilterObject:e,currentFilterColumn:i,action:"clearFilter"}),"break"}}(t))break;this.updateFilterMsg(),this.parent.renderModule.resetPartialRecords()}},p.prototype.getModuleName=function(){return"filter"},p.prototype.keyUpHandlerImmediate=function(e){13!==e.keyCode&&this.keyUpHandler(e)},p.prototype.keyUpHandler=function(e){var t=this.parent,i=e.target;if(i&&H.matches(i,".e-filterbar input")){var n=H.closest(i,"th.e-filterbarcell");if(this.column=t.getColumnByUid(n.getAttribute("data-mappinguid")),!this.column)return;"altDownArrow"===e.action&&this.parent.filterSettings.showFilterBarOperator&&((n=H.closest(i,"span").querySelector(".e-filterbaroperator")).ej2_instances[0].showPopup(),n.focus()),"Immediate"!==this.filterSettings.mode&&(13!==e.keyCode||e.target.classList.contains("e-filterbaroperator"))||9===e.keyCode||this.column.filterTemplate||(this.value=i.value.trim(),this.processFilter(e))}"altDownArrow"!==e.action||"FilterBar"===this.filterSettings.type||I(e.target,"e-toolbar")||!H.isNullOrUndefined(this.parent.element.querySelector(".e-filter-popup"))||this.parent.enableAdaptiveUI||(n=t.focusModule.currentInfo.element)&&n.classList.contains("e-headercell")&&!n.classList.contains("e-stackedheadercell")&&(i=t.getColumnByUid(n.querySelector(".e-headercelldiv").getAttribute("data-mappinguid")),this.openMenuByField(i.field),this.parent.focusModule.clearIndicator()),"escape"===e.action&&"Menu"===this.filterSettings.type&&this.filterModule&&(this.parent.showColumnMenu&&this.filterModule.isDialogOpen&&(this.parent.isColumnMenuFilterClosing=!0),this.filterModule.closeDialog(),t.notify(wn,{}),this.parent.showColumnMenu||t.notify(wn,{}))},p.prototype.updateCrossIcon=function(e){e.value.length&&e.nextElementSibling.classList.remove("e-hide")},p.prototype.updateFilterMsg=function(){if("FilterBar"===this.filterSettings.type){var e=this.parent,t=void 0,i=this.filterSettings.columns,n=void 0;if(this.filterSettings.showFilterBarStatus){if(0<i.length&&this.filterStatusMsg!==this.l10n.getConstant("InvalidFilterMessage")){this.filterStatusMsg="";for(var r=0;r<i.length;r++){var s,n=e.grabColumnByUidFromAllCols(i[parseInt(r.toString(),10)].uid)||e.grabColumnByFieldFromAllCols(i[parseInt(r.toString(),10)].field,i[parseInt(r.toString(),10)].isForeignKey);r&&(this.filterStatusMsg+=" && "),H.isNullOrUndefined(n.format)?this.filterStatusMsg+=n.headerText+": "+this.values[n.field]:(s="date"===n.type||"datetime"===n.type||"dateonly"===n.type?this.valueFormatter.fromView(this.values[n.field],n.getParser(),"dateonly"===n.type?"date":n.type):this.values[n.field],t="date"!==n.type&&"datetime"!==n.type&&"dateonly"!==n.type?this.serviceLocator.getService("valueFormatter").toView(s,n.getParser()).toString():this.setFormatForFlColumn(s,n),this.filterStatusMsg+=n.headerText+": "+t)}}e.allowPaging&&(e.updateExternalMessage(this.filterStatusMsg),"100%"===this.parent.height||"string"==typeof this.parent.height&&-1!==this.parent.height.toLowerCase().indexOf("vh"))&&this.parent.scrollModule.refresh(),this.filterStatusMsg=""}}},p.prototype.setFormatForFlColumn=function(e,t){e=this.serviceLocator.getService("valueFormatter").toView(e,t.getFormatter());return H.isNullOrUndefined(e)?e:e.toString()},p.prototype.checkForSkipInput=function(e,t){var i;if("number"===e.type)(V.DataUtil.operatorSymbols[""+t]||-1<this.skipNumberInput.indexOf(t))&&(i=!0);else if("string"===e.type)for(var n=0,r=t;n<r.length;n++){var s=r[n];-1<this.skipStringInput.indexOf(s)&&(i=!0)}return i},p.prototype.processFilter=function(e){this.stopTimer(),this.startTimer(e)},p.prototype.startTimer=function(e){var t=this;this.timer=window.setInterval(function(){t.onTimerTick(e)},13===e.keyCode?0:this.filterSettings.immediateModeDelay)},p.prototype.stopTimer=function(){window.clearInterval(this.timer)},p.prototype.onTimerTick=function(e){var t,i="[id='"+this.column.field+"_filterBarcell']",n=(n=this.element.querySelector(i))||this.parent.getHeaderContent().querySelector(i);this.cellText[this.column.field]=n.value,this.stopTimer(),H.isNullOrUndefined(this.column.filterBarTemplate)?t=JSON.parse(JSON.stringify(n.value)):("string"==typeof(i=this.column.filterBarTemplate.read)&&(i=H.getValue(i,window)),H.isNullOrUndefined(i)||(this.value=i.call(this,n))),H.isNullOrUndefined(this.value)||""===this.value?this.removeFilteredColsByField(this.column.field):(e&&e.isComposing&&(this.value=n.value),this.validateFilterValue(this.value),this.filterByMethod=!1,this.filterByColumn(this.column.field,this.operator,this.value,this.predicate,this.filterSettings.enableCaseSensitivity,this.ignoreAccent,this.column.isForeignColumn()),this.filterByMethod=!0,n.value=t,this.updateFilterMsg())},p.prototype.validateFilterValue=function(e){var t;switch(this.matchCase=this.filterSettings.enableCaseSensitivity,this.column.type){case"number":this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.equal;for(var i=[">","<","=","!"],n=0;n<e.length;n++)if(-1<i.indexOf(e[parseInt(n.toString(),10)])){t=n;break}this.getOperator(e.substring(t)),0!==t&&(this.value=e.substring(0,t)),""!==this.value&&1<=e.length&&(this.value=this.valueFormatter.fromView(this.value,this.column.getParser(),this.column.type)),isNaN(this.value)&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage"));break;case"date":case"datetime":this.operator=this.filterOperators.equal,""===this.value||this.value instanceof Date||(this.getOperator(e),this.value=this.valueFormatter.fromView(this.value,this.column.getParser(),this.column.type),H.isNullOrUndefined(this.value)&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage")));break;case"string":this.matchCase=!1,this.column.filter.operator?this.operator=this.column.filter.operator:-1!==e.indexOf("*")||-1!==e.indexOf("?")||-1!==e.indexOf("%3f")?this.operator=this.filterOperators.wildCard:-1!==e.indexOf("%")?this.operator=this.filterOperators.like:this.operator=this.filterOperators.startsWith;break;case"boolean":"true"===e.toLowerCase()||"1"===e?this.value=!0:"false"===e.toLowerCase()||"0"===e?this.value=!1:e.length&&(this.filterStatusMsg=this.l10n.getConstant("InvalidFilterMessage")),this.operator=this.filterOperators.equal;break;default:this.column.filter.operator?this.operator=this.column.filter.operator:this.operator=this.filterOperators.equal}},p.prototype.getOperator=function(e){var t=e.charAt(0),i=e.slice(0,2),n=H.extend({"=":this.filterOperators.equal,"!":this.filterOperators.notEqual},V.DataUtil.operatorSymbols);(n.hasOwnProperty(t)||n.hasOwnProperty(i))&&(this.operator=n[""+t],this.value=e.substring(1),this.operator||(this.operator=n[""+i],this.value=e.substring(2))),this.operator!==this.filterOperators.lessThan&&this.operator!==this.filterOperators.greaterThan||"="===this.value.charAt(0)&&(this.operator=this.operator+"orequal",this.value=this.value.substring(1))},p.prototype.columnPositionChanged=function(){this.parent.filterSettings.type},p.prototype.getLocalizedCustomOperators=function(){var e=[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")}];this.customOperators={stringOperator:[{value:"startswith",text:this.l10n.getConstant("StartsWith")},{value:"endswith",text:this.l10n.getConstant("EndsWith")},{value:"contains",text:this.l10n.getConstant("Contains")},{value:"equal",text:this.l10n.getConstant("Equal")},{value:"isempty",text:this.l10n.getConstant("IsEmpty")},{value:"doesnotstartwith",text:this.l10n.getConstant("NotStartsWith")},{value:"doesnotendwith",text:this.l10n.getConstant("NotEndsWith")},{value:"doesnotcontain",text:this.l10n.getConstant("NotContains")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnotempty",text:this.l10n.getConstant("IsNotEmpty")},{value:"like",text:this.l10n.getConstant("Like")}],numberOperator:e,dateOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")},{value:"between",text:this.l10n.getConstant("Between")}],datetimeOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")},{value:"between",text:this.l10n.getConstant("Between")}],dateonlyOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"greaterthan",text:this.l10n.getConstant("GreaterThan")},{value:"greaterthanorequal",text:this.l10n.getConstant("GreaterThanOrEqual")},{value:"lessthan",text:this.l10n.getConstant("LessThan")},{value:"lessthanorequal",text:this.l10n.getConstant("LessThanOrEqual")},{value:"notequal",text:this.l10n.getConstant("NotEqual")},{value:"isnull",text:this.l10n.getConstant("IsNull")},{value:"isnotnull",text:this.l10n.getConstant("NotNull")},{value:"between",text:this.l10n.getConstant("Between")}],booleanOperator:[{value:"equal",text:this.l10n.getConstant("Equal")},{value:"notequal",text:this.l10n.getConstant("NotEqual")}]},"Menu"===this.filterSettings.type&&(this.customOperators.stringOperator.push({value:"in",text:this.l10n.getConstant("In")},{value:"notin",text:this.l10n.getConstant("NotIn")}),this.customOperators.booleanOperator.push({value:"in",text:this.l10n.getConstant("In")},{value:"notin",text:this.l10n.getConstant("NotIn")}),this.customOperators.numberOperator.push({value:"in",text:this.l10n.getConstant("In")},{value:"notin",text:this.l10n.getConstant("NotIn")}))},p.prototype.openMenuByField=function(e){var t,i,n=this.parent;n.enableAdaptiveUI?this.showCustomFilter(!1):(t=n.getColumnByField(e),(e=n.getColumnHeaderByField(e).querySelector(".e-filtermenudiv"))&&(n=n.element.getBoundingClientRect(),i=e.getBoundingClientRect(),this.filterDialogOpen(t,e,i.right-n.left,i.bottom-n.top)))},p.prototype.filterIconClickHandler=function(e){var e=e.target;!e.classList.contains("e-filtermenudiv")||"Menu"!==this.parent.filterSettings.type&&"CheckBox"!==this.parent.filterSettings.type&&"Excel"!==this.parent.filterSettings.type||(e=this.parent.getColumnByUid(I(e,"e-headercell").querySelector(".e-headercelldiv").getAttribute("data-mappinguid")),this.column=e,this.fltrDlgDetails.field===e.field&&this.fltrDlgDetails.isOpen)||(this.filterModule&&this.filterModule.closeDialog(),this.fltrDlgDetails={field:e.field,isOpen:!0},this.openMenuByField(e.field))},p.prototype.clickHandler=function(e){var t,i,n,r,s;"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&(I(e.target,"e-filterbarcell")&&e.target.classList.contains("e-input-group-icon")&&(H.closest(e.target,"div").querySelector(".e-filterbaroperator")||e.target).focus(),e.target.classList.contains("e-list-item"))&&-1!==(t=document.querySelector(".e-popup-open").getAttribute("id").replace("_popup","")).indexOf("grid-column")&&H.closest(document.getElementById(t),"div").querySelector(".e-filtertext").focus(),"Immediate"!==this.filterSettings.mode&&"Menu"!==this.parent.filterSettings.type&&"CheckBox"!==this.parent.filterSettings.type&&"Excel"!==this.parent.filterSettings.type||I(t=e.target,"e-toolpanel")||(e=t.classList.contains("e-day"),i=I(this.parent.element,"e-dialog"),n=!1,r=I(t,"e-popup"),s=document.getElementById(this.parent.element.id+"_e-popup"),s=(this.parent.element.classList.contains("e-device")?document:s&&s.querySelector(".e-filter-popup")?s:this.parent.element).querySelector(".e-filter-popup"),i&&r&&(n=i.id===r.id),this.filterModule&&s&&(I(t,"e-excel-ascending")||I(t,"e-excel-descending"))&&this.filterModule.closeDialog(t),I(t,"e-filter-popup"))||t.classList.contains("e-filtermenudiv")||!this.filterModule||I(t,"e-date-overflow")||I(t,"e-popup-wrapper")||H.closest(t,".e-filter-item.e-menu-item")||e||I(t,"e-search-wrapper")&&!s||(n&&!I(t,"e-filter-popup")&&!I(t,"e-popup-flmenu")||!r&&s)&&(this.filterModule.isresetFocus=I(t,"e-grid")&&I(t,"e-grid").id===this.parent.element.id&&!(I(t,"e-search-wrapper")&&s),this.filterModule.closeDialog(t))},p.prototype.filterHandler=function(e){this.actualPredicate[e.field]=e.actualPredicate,this.actualData=Object.keys(this.actualPredicate);var t=new V.DataManager(this.filterSettings.columns),i=(new V.Query).where("field",this.filterOperators.equal,e.field);this.checkboxFilterObject=t.dataSource.json,this.checkboxPrevFilterObject=t.executeLocal(i);for(var n=0;n<this.checkboxPrevFilterObject.length;n++){for(var r=-1,s=0;s<this.filterSettings.columns.length;s++)if(this.checkboxPrevFilterObject[parseInt(n.toString(),10)].field===this.filterSettings.columns[parseInt(s.toString(),10)].field){r=s;break}-1!==r&&this.filterSettings.columns.splice(r,1)}this.values[e.field]&&delete this.values[e.field];t=this.parent.getColumnByField(e.field),i=this.parent.showColumnMenu&&t.showColumnMenu?".e-columnmenu":".e-icon-filter",t=this.parent.getColumnHeaderByField(e.field).querySelector(i);"filtering"===e.action?(this.filterSettings.columns=this.filterSettings.columns.concat(e.filterCollection),this.filterSettings.columns.length&&t&&t.classList.add("e-filtered")):(t&&t.classList.remove("e-filtered"),this.parent.renderModule.resetPartialRecords(),e.requestType="filtering",this.parent.renderModule.refresh(e)),this.parent.dataBind()},p.prototype.updateFilter=function(){var e=this.filterSettings.columns;this.actualPredicate={};for(var t=0;t<e.length;t++){this.column=this.parent.getColumnByField(e[parseInt(t.toString(),10)].field)||Zp(e[parseInt(t.toString(),10)].field,this.parent.getForeignKeyColumns());var i=e[parseInt(t.toString(),10)].field;this.parent.getColumnByField(e[parseInt(t.toString(),10)].field)||(i=Zp(e[parseInt(t.toString(),10)].field,this.parent.getForeignKeyColumns()).field),this.refreshFilterIcon(i,e[parseInt(t.toString(),10)].operator,e[parseInt(t.toString(),10)].value,e[parseInt(t.toString(),10)].type,e[parseInt(t.toString(),10)].predicate,e[parseInt(t.toString(),10)].matchCase,e[parseInt(t.toString(),10)].ignoreAccent,e[parseInt(t.toString(),10)].uid)}this.parent.renderModule.resetPartialRecords()},p.prototype.refreshFilterIcon=function(e,t,i,n,r,s,o,a){r={field:e,predicate:r,matchCase:s,ignoreAccent:o,operator:t,value:i,type:n},this.actualPredicate[""+e]?this.actualPredicate[""+e].push(r):this.actualPredicate[""+e]=[r],s=a?this.parent.grabColumnByUidFromAllCols(a).field:e;this.addFilteredClass(s)},p.prototype.addFilteredClass=function(e){var t,i=this.parent.getColumnByField(e);this.parent.showColumnMenu&&i.showColumnMenu?t=this.parent.getColumnHeaderByField(e).querySelector(".e-columnmenu"):i&&(t=this.parent.getColumnHeaderByField(e).querySelector(".e-icon-filter")),t&&t.classList.add("e-filtered")},p.prototype.getFilterUIInfo=function(){return this.filterModule?this.filterModule.getFilterUIInfo():{}},p.prototype.getOperatorName=function(e){return document.getElementById(this.parent.getColumnByField(e).uid).ej2_instances[0].value},p.prototype.renderCheckboxOnFilterMenu=function(){return this.filterModule.renderCheckBoxMenu()},p);function p(e,t,i){this.predicate="and",this.contentRefresh=!0,this.filterByMethod=!0,this.refresh=!0,this.values={},this.operators={},this.cellText={},this.nextFlMenuOpen="",this.type={Menu:Ju,CheckBox:tg,Excel:sg},this.filterOperators={contains:"contains",endsWith:"endswith",equal:"equal",greaterThan:"greaterthan",greaterThanOrEqual:"greaterthanorequal",lessThan:"lessthan",lessThanOrEqual:"lessthanorequal",notEqual:"notequal",startsWith:"startswith",wildCard:"wildcard",isNull:"isnull",notNull:"notnull",like:"like"},this.fltrDlgDetails={field:"",isOpen:!1},this.skipNumberInput=["="," ","!"],this.skipStringInput=[">","<","="],this.prevRangeColumns=[],this.actualPredicate={},this.inputList=[],this.isFilterCleared=!1,this.maintainFocusOnFilterDialog=!1,H.initializeTelemetryFeature("Filter","DataGrid"),this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.addEventListener(),this.setFullScreenDialog()}hg.prototype.getModuleName=function(){return"advancedFilter"},hg.prototype.destroy=function(){this.removeEventListener(),this.queryBuilder&&!this.queryBuilder.isDestroyed&&this.queryBuilder.destroy(),this.dialog&&!this.dialog.isDestroyed&&this.dialog.destroy(),this.dialogContainer&&(H.remove(this.dialogContainer),this.dialogContainer=null),this.queryBuilder=null,this.dialog=null,this.currentRule=null,this.filterRuleToRestore=null,this.baseQuery=null,this.hasEmptyState=!1,this.filterRequestType=null},hg.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ti,this.refreshComplete,this),this.parent.on(Yi,this.cancelBeginEvent,this))},hg.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ti,this.refreshComplete),this.parent.off(Yi,this.cancelBeginEvent))},hg.prototype.getAdvancedFilterSettings=function(){return this.parent.advancedFilterSettings||{}},hg.prototype.openDialog=function(){var e;this.parent.allowAdvancedFiltering&&(this.dialog||this.createDialog(),this.dialog)&&!1===this.dialog.visible&&(e={requestType:"advancedFilterOpen",dialog:this.dialog,queryBuilder:this.queryBuilder},this.parent.trigger("advancedFilterOpen",e),this.dialog.show())},hg.prototype.closeDialog=function(){this.dialog&&this.dialog.visible&&(this.saveCurrentValidRule(),this.dialog.hide())},hg.prototype.saveCurrentValidRule=function(){var e;this.queryBuilder&&(e=this.queryBuilder.getRules(),this.hasValidFilterRule(e)?this.filterRuleToRestore=H.extend({},{},e,!0):this.filterRuleToRestore=null)},hg.prototype.hasValidFilterRule=function(e){var t=this;return!!e&&(e.rules&&0<e.rules.length?e.rules.some(function(e){return t.hasValidFilterRule(e)}):!!(e.field&&e.operator&&(this.isValueLessOperator(e.operator)||void 0!==e.value&&null!==e.value&&""!==e.value)))},hg.prototype.applyFilter=function(e){if(e&&e.rules&&0!==e.rules.length&&!this.isEmptyRule(e)){if(this.dialog&&this.dialog.visible){var t={requestType:"advancedFilterClose",dialog:this.dialog,queryBuilder:this.queryBuilder,cancel:!1};if(this.parent.trigger("advancedFilterClose",t),t.cancel)return;this.closeDialog()}this.hasEmptyState=!1,this.parent.trigger(le,{requestType:"filtering",type:le,cancel:!1,rule:e,dialog:this.dialog,queryBuilder:this.queryBuilder});t=this.getPredicateFromRule(e);t&&(!this.baseQuery&&this.parent.query&&(this.baseQuery=this.parent.query.clone()),this.isAdvancedFilterApplied=!0,this.filterRequestType="filtering",this.currentRule=H.extend({},{},e,!0),this.filterRuleToRestore=H.extend({},{},e,!0),this.baseQuery?this.parent.query=this.baseQuery.clone().where(t):this.parent.query=(new V.Query).where(t),this.setAdvancedFilterEnabled(!0))}else this.clearFilter()},hg.prototype.refreshComplete=function(e){this.isAdvancedFilterApplied&&"refresh"===e.requestType&&(this.isAdvancedFilterApplied=!1,this.parent.trigger(he,{requestType:this.filterRequestType||"filtering",type:he,cancel:!1,rule:this.currentRule}),this.filterRequestType=null)},hg.prototype.cancelBeginEvent=function(e){this.isAdvancedFilterApplied&&"refresh"===e.requestType&&(this.isAdvancedFilterApplied=!1,this.filterRequestType=null)},hg.prototype.isEmptyRule=function(e){var t=this;return!e||!e.rules||0===e.rules.length||e.rules.every(function(e){return e.rules?t.isEmptyRule(e):!t.isValueLessOperator(e.operator)&&(null==(e=e.value)||""===e||Array.isArray(e)&&0===e.length)})},hg.prototype.clearFilter=function(){if(this.dialog&&this.dialog.visible){var e={requestType:"advancedFilterClose",dialog:this.dialog,queryBuilder:this.queryBuilder,cancel:!1};if(this.parent.trigger("advancedFilterClose",e),e.cancel)return;this.closeDialog()}this.isAdvancedFilterApplied=!0,this.filterRequestType="clear-filtering",this.parent.trigger(le,{requestType:"clear-filtering",type:le,cancel:!1,dialog:this.dialog,queryBuilder:this.queryBuilder}),this.parent.query=this.baseQuery||new V.Query,this.currentRule=null,this.filterRuleToRestore=null,this.baseQuery=null,this.hasEmptyState=!0,this.setAdvancedFilterEnabled(!1)},hg.prototype.refresh=function(){var e,t,i;this.queryBuilder&&!this.queryBuilder.isDestroyed&&(e=this.mapColumns(),t={condition:"and",rules:[]},i=(this.hasValidFilterRule(this.filterRuleToRestore)?this.filterRuleToRestore:this.hasValidFilterRule(this.currentRule)?this.currentRule:null)||(this.hasEmptyState?t:{condition:"and",rules:[]}),0<e.length&&(i=this.normalizeRule(i,e)||(this.hasEmptyState?t:{condition:"and",rules:[]}),this.queryBuilder.setRules(i)),this.queryBuilder.refresh())},hg.prototype.getRule=function(){return this.currentRule},hg.prototype.setRule=function(e){e?(this.currentRule=H.extend({},{},e,!0),this.filterRuleToRestore=H.extend({},{},e,!0),this.hasEmptyState=!1,this.updateQueryBuilder(e)):(this.currentRule=null,this.filterRuleToRestore=null,this.hasEmptyState=!0,this.updateQueryBuilder({condition:"and",rules:[]}))},hg.prototype.updateQueryBuilder=function(e){this.queryBuilder&&!this.queryBuilder.isDestroyed&&(this.queryBuilder.setRules(e),this.queryBuilder.refresh())},hg.prototype.setAdvancedFilterEnabled=function(e){var t=this.parent;t.toolbarModule&&t.toolbarModule.enableAdvancedFilterButton(e)},hg.prototype.mapColumns=function(){var s,o,a,l=this;return this.parent.columns&&0!==this.parent.columns.length?(s=[],o=!0===this.getAdvancedFilterSettings().includeHiddenColumns,(a=function(e){for(var t=0,i=e;t<i.length;t++){var n,r=i[t];r.columns&&r.columns.length?a(r.columns):!1!==r.allowFiltering&&(o||!1!==r.visible)&&r.field&&(n=l.mapGridTypeToQBType(r.type),n={field:r.field,label:r.headerText||r.field,type:n,operators:l.getOperatorsForType(n).map(function(e){return{key:l.getOperatorLabel(e),value:e}}),dataSource:r.dataSource,format:"date"===r.type||"dateonly"===r.type||"datetime"===r.type?r.format||"yMd":void 0},s.push(n))}})(this.parent.columns),s):[]},hg.prototype.mapGridTypeToQBType=function(e){return e&&{string:"string",number:"number",date:"date",dateonly:"date",datetime:"date",boolean:"boolean"}[e.toLowerCase()]||"string"},hg.prototype.getOperatorsForType=function(e){var t={number:["equal","notequal","lessthan","lessthanorequal","greaterthan","greaterthanorequal","between","in","notin","isnull","isnotnull"],date:["equal","notequal","lessthan","lessthanorequal","greaterthan","greaterthanorequal","between"],datetime:["equal","notequal","lessthan","lessthanorequal","greaterthan","greaterthanorequal","between"],boolean:["equal","notequal"],string:["startswith","notstartswith","endswith","notendswith","contains","notcontains","equal","notequal","in","notin","isempty","isnotempty","isnull","isnotnull"]};return t[e.toLowerCase()]||t.string},hg.prototype.getOperatorLocaleKey=function(t){var e=[["equal","Equal"],["notequal","NotEqual"],["contains","Contains"],["notcontains","NotContains"],["startswith","StartsWith"],["notstartswith","NotStartsWith"],["endswith","EndsWith"],["notendswith","NotEndsWith"],["in","In"],["notin","NotIn"],["isempty","IsEmpty"],["isnotempty","IsNotEmpty"],["isnull","IsNull"],["isnotnull","NotNull"],["lessthan","LessThan"],["lessthanorequal","LessThanOrEqual"],["greaterthan","GreaterThan"],["greaterthanorequal","GreaterThanOrEqual"],["between","Between"]].find(function(e){return e[0]===t});return e?e[1]:t},hg.prototype.getOperatorLabel=function(e){var t=this.l10n.getConstant(this.getOperatorLocaleKey(e));return this.isValueLessOperator(e)&&0!==t.indexOf("Is ")?"Is "+t:t},hg.prototype.createDialog=function(){this.qbContainer=H.createElement("div",{id:this.parent.element.id+"_qbHost",className:"e-advanced-filter-qb-host e-querybuilder",styles:"width:100%; height:100%; display:block; padding:0; margin:0; border: none; box-shadow: none; overflow: auto; box-sizing:border-box;"}),this.dialogContainer=document.createElement("div"),this.dialogContainer.id=this.parent.element.id+"_advancedFilterDialog",this.dialogContainer.className="e-advanced-filter-dialog",(document.body||this.parent.element).appendChild(this.dialogContainer);var e={header:this.l10n.getConstant("AdvancedFilter")||"Advanced Filter",content:this.qbContainer,isModal:!0,showCloseIcon:!0,closeOnEscape:!0,animationSettings:{effect:"None"},width:820,height:480,buttons:this.getDialogButtons(),visible:!1,target:document.body,beforeOpen:this.onDialogOpen.bind(this),open:this.onDialogOpened.bind(this),enableRtl:this.parent.enableRtl,locale:this.parent.locale};this.dialog=new F.Dialog(e),this.dialog.appendTo(this.dialogContainer),this.applyDialogSizeConstraints(this.dialog)},hg.prototype.applyDialogSizeConstraints=function(e){e=e.element;e&&(e.style.minWidth=this.getDialogMinWidth()+"px",e.style.minHeight=this.getDialogMinHeight()+"px")},hg.prototype.getDialogMinHeight=function(){return 360},hg.prototype.getDialogMinWidth=function(){return 520},hg.prototype.getDialogButtons=function(){return[{click:this.onCancelClick.bind(this),buttonModel:{content:this.l10n.getConstant("CancelAdvancedFilter")||this.l10n.getConstant("Cancel")||"Cancel"}},{click:this.onApplyClick.bind(this),buttonModel:{content:this.l10n.getConstant("ApplyAdvancedFilter")||this.l10n.getConstant("Apply")||"Apply",isPrimary:!0}}]},hg.prototype.getPredicateFromRule=function(e){var t=this.mapColumns();if(0===t.length)return null;var e=this.normalizeRule(e,t)||e,i=H.createElement("div"),t=(document.body.appendChild(i),new z.QueryBuilder({columns:t,rule:e}));t.appendTo(i);try{return t.getPredicate(e)}finally{t.destroy(),H.remove(i)}},hg.prototype.createQueryBuilder=function(){var e,t;!this.queryBuilder&&this.qbContainer&&0!==(t=this.mapColumns()).length&&(Object.assign(this.qbContainer.style,{width:"100%",padding:"0",margin:"0"}),e=(e=this.getAdvancedFilterSettings())&&e.queryBuilderSettings||{},t=H.extend({},{columns:t,displayMode:"Horizontal",width:"100%",locale:this.parent.locale,enableRtl:this.parent.enableRtl,dataSource:this.parent.dataSource,valueModel:{multiSelectModel:{mode:"CheckBox",allowFiltering:!0,showSelectAll:!0}}},e,!0),this.queryBuilder=new z.QueryBuilder(t),this.queryBuilder.appendTo(this.qbContainer))},hg.prototype.getRuleToRestore=function(e){return this.hasEmptyState?{condition:"and",rules:[]}:(e=this.hasValidFilterRule(this.currentRule)&&this.currentRule||this.hasValidFilterRule(this.filterRuleToRestore)&&this.filterRuleToRestore||e)?H.extend({},{},e,!0):null},hg.prototype.normalizeRule=function(e,a){var l,h=this;return e?(e=(l=function(e){var t,i=H.extend({},{},e,!0);if(i.rules&&0<i.rules.length){for(var n=[],r=0,s=i.rules;r<s.length;r++){var o=s[r],o=l(o);o&&n.push(o)}return 0<n.length?{condition:i.condition||"and",rules:n,not:i.not||!1}:null}return i.field&&(e=a.find(function(e){return e.field===i.field}))?(t=0<=(t=(e.operators||[]).map(function(e){return"string"==typeof e?e:e.value||e.key||""}).filter(function(e){return!!e})).indexOf(i.operator)?i.operator:t[0]||"equal",{field:e.field,label:i.label||e.label,type:e.type,operator:t,value:void 0!==i.value&&null!==i.value?i.value:h.isValueLessOperator(t)?void 0:""}):null})(e))&&e.rules&&0<e.rules.length?e:e&&e.field?{condition:"and",rules:[e]}:null:null},hg.prototype.isValueLessOperator=function(e){return"isnull"===e||"isnotnull"===e||"isempty"===e||"isnotempty"===e},hg.prototype.restoreQueryBuilderRule=function(){var e,t,i;this.queryBuilder&&!this.queryBuilder.isDestroyed&&(e={condition:"and",rules:[]},this.hasEmptyState?this.queryBuilder.setRules(e):(i=this.mapColumns(),t=(t=this.getAdvancedFilterSettings())&&t.queryBuilderSettings?t.queryBuilderSettings.rule:void 0,t=this.normalizeRule(t,i),(i=this.getRuleToRestore(t))&&this.hasValidFilterRule(i)?(this.queryBuilder.setRules(i),this.queryBuilder.refresh()):(this.filterRuleToRestore=null,this.currentRule=null,this.queryBuilder.setRules(e))))},hg.prototype.onDialogOpen=function(){this.qbContainer&&(this.queryBuilder&&!this.queryBuilder.isDestroyed&&(this.queryBuilder.destroy(),this.queryBuilder=null),this.qbContainer.innerHTML="",this.createQueryBuilder(),this.restoreQueryBuilderRule())},hg.prototype.onDialogOpened=function(){var e;this.queryBuilder&&!this.queryBuilder.isDestroyed&&this.qbContainer&&(e=this.qbContainer.querySelector('.e-field-select, select[id$="_field"], input.e-qb-field'))&&e.focus()},hg.prototype.onApplyClick=function(){var e;this.queryBuilder&&(e=this.queryBuilder.getRules())&&this.applyFilter(e)},hg.prototype.onCancelClick=function(){this.closeDialog()};sh=hg;function hg(e,t){this.dialog=null,this.queryBuilder=null,this.currentRule=null,this.filterRuleToRestore=null,this.qbContainer=null,this.dialogContainer=null,this.baseQuery=null,this.hasEmptyState=!1,this.isAdvancedFilterApplied=!1,this.filterRequestType=null,this.parent=e,this.serviceLocator=t,this.l10n=this.serviceLocator.getService("localization"),this.addEventListener()}var dg={root:"e-rhandler",suppress:"e-rsuppress",icon:"e-ricon",helper:"e-rhelper",header:"th.e-headercell",cursor:"e-rcursor"},pg=(u.prototype.autoFitColumns=function(e,t,i){var n=this,r=null==e||e.length<=0?this.parent.getColumns().map(function(e){return e.autoFit=!0,e.field}):"string"==typeof e?[e]:e;this.parent.isAutoFitColumns=!0,H.isNullOrUndefined(e)||"object"!=typeof e||0===e.length?"string"==typeof e&&""!==e.trim()&&(this.parent.getColumnByField(e).autoFit=!0):e.forEach(function(e){n.parent.getColumnByField(e)&&(n.parent.getColumnByField(e).autoFit=!0)}),this.parent.enableAdaptiveUI&&this.parent.element.classList.add("e-grid-autofit"),this.findColumn(r,t,i)},u.prototype.autoFit=function(){var e=this.parent.getColumns(),t=0,e=e.filter(function(e){return H.isNullOrUndefined(e.maxWidth)||t++,!0===e.autoFit}).map(function(e){return e.field||e.headerText}),i=(0<e.length&&!this.parent.preventAutoFit&&this.autoFitColumns(e),this.parent.getContentTable());this.parent.allowResizing&&t&&("Auto"===this.parent.resizeSettings.mode||"Normal"===this.parent.resizeSettings.mode&&!this.parent.autoFit&&0===e.length)?this.widthService.setWidthToTable(-1===i.style.width.indexOf("px")):this.parent.autoFit&&"Auto"===this.parent.resizeSettings.mode&&this.widthService.setWidthToTable(),-1!==i.style.width.indexOf("px")&&i.getBoundingClientRect().width<i.parentElement.clientWidth&&H.addClass([this.parent.getHeaderTable(),i],["e-tableborder"])},u.prototype.getCellElementsByColumnIndex=function(e){return this.parent.frozenRows?[].slice.call(this.parent.getHeaderTable().querySelectorAll("td.e-rowcell:nth-child("+(e+1)+"):not(.e-groupcaption):not(.e-detailcell)")).concat([].slice.call(this.parent.getContentTable().querySelectorAll("td.e-rowcell:nth-child("+(e+1)+"):not(.e-groupcaption):not(.e-detailcell)"))):[].slice.call(this.parent.getContentTable().querySelectorAll("td.e-rowcell:nth-child("+(e+1)+"):not(.e-groupcaption):not(.e-detailcell)"))},u.prototype.resizeColumn=function(e,t,i,n,r){var s,o,a=this.parent,l=0,h=a.getHeaderTable(),d=a.getContentTable(),p=0,i=i||this.parent.getUidByColumnField(e),c=this.parent.getNormalizedColumnIndex(i),i=H.closest(h.querySelector('[data-mappinguid="'+i+'"]'),"th").cloneNode(!0),u=this.getCellElementsByColumnIndex(c),e=this.parent.getColumnIndexByField(e),g=((s=H.isNullOrUndefined(a.getFooterContent())?s:a.getFooterContentTable())&&(o=s.querySelectorAll("td:nth-child("+(c+1)+"):not(.e-groupcaption)")),[].slice.call(h.querySelector("tr").getElementsByClassName("e-grouptopleftcell")));if(0<g.length)for(var f=0;f<g.length;f++)p+=g[parseInt(f.toString(),10)].offsetWidth;var c=d.querySelector(".e-detailrowcollapse")||d.querySelector(".e-detailrowexpand"),c=((this.parent.detailTemplate||this.parent.childGrid)&&c&&(p+=c.offsetWidth),[i]),m=[],y=[];if(s)for(f=0;f<o.length;f++)y[parseInt(f.toString(),10)]=o[parseInt(f.toString(),10)].cloneNode(!0);for(f=0;f<u.length;f++)m[parseInt(f.toString(),10)]=u[parseInt(f.toString(),10)].cloneNode(!0);var i=this.createTable(h,c,"e-gridheader"),c=null,v=null,n=(a.getCurrentViewRecords().length&&(v=this.createTable(d,m,"e-gridcontent",n,r)),y.length&&(c=this.createTable(s,y,"e-gridfooter")),a.getColumns()[parseInt(e.toString(),10)]),r=n.width=H.formatUnit(Math.max(i,v,c)),i=n.maxWidth&&parseFloat(n.maxWidth.toString());if(parseInt(r,10)>i&&(n.width=i),this.widthService.setColumnWidth(a.getColumns()[parseInt(e.toString(),10)]),!1===a.getColumns().some(function(e){return(e.visible||a.groupSettings.columns.length)&&(null===e.width||void 0===e.width||e.width.length<=0)}))for(var S=a.getColumns(),f=0;f<S.length;f++)S[parseInt(f.toString(),10)].visible&&(l+=parseFloat(S[parseInt(f.toString(),10)].width));v=l+p;0<l&&((this.parent.detailTemplate||this.parent.childGrid)&&this.widthService.setColumnWidth(new Q({width:"30px"})),"Auto"===this.parent.resizeSettings.mode&&(v="100%"),h.style.width=H.formatUnit(v),d.style.width=H.formatUnit(v),H.isNullOrUndefined(s)||(s.style.width=H.formatUnit(v))),a.isFrozenGrid()&&a.enableColumnVirtualization&&this.widthService.refreshFrozenScrollbar(),h.offsetWidth<d.parentElement.scrollWidth?(H.isNullOrUndefined(d.querySelector(".e-emptyrow"))?H.addClass([h,d],["e-tableborder"]):(H.addClass([h],["e-tableborder"]),H.removeClass([d],["e-tableborder"])),H.removeClass([a.element],["e-left-shadow","e-right-shadow"])):(H.removeClass([h,d],["e-tableborder"]),a.getVisibleFrozenRightCount()&&H.addClass([a.element],"e-right-shadow")),H.isNullOrUndefined(s)||s.classList.add("e-tableborder")},u.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+ms)||e.querySelector("."+vs))&&(this.widthService=null,this.unwireEvents(),this.removeEventListener())},u.prototype.getModuleName=function(){return"resize"},u.prototype.findColumn=function(e,t,i){for(var n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)],s=this.parent.getColumnIndexByField(r),o=this.parent.getColumns()[parseInt(s.toString(),10)];-1<s&&!H.isNullOrUndefined(o)&&!0===o.visible&&this.resizeColumn(r,s,null,t,i)}(this.parent.detailTemplate||this.parent.childGrid)&&"Auto"===this.parent.resizeSettings.mode&&this.parent.isAutoFitColumns&&(this.parent.getHeaderTable().querySelector(".e-emptycell").classList.remove("e-indentRefreshed"),this.parent.recalcIndentWidth()),this.parent.allowTextWrap&&this.parent.notify(Oi,{case:"refreshHeight",isModeChg:!0}),this.parent.isFrozenGrid()&&this.refreshResizefrzCols(!0,!0)},u.prototype.createTable=function(e,t,i,n,r){(r=void 0===r?t.length:r)<(n=void 0===n?1:n)&&(n=(n^=r)^(r^=n));for(var s,o=this.parent.createElement("div"),a=this.parent.enableAdaptiveUI?" e-bigger":"",a=(o.className=this.parent.element.className+a,o.style.cssText="display: inline-block;visibility:hidden;position:absolute",this.parent.createElement("div")),l=(a.className=i,this.parent.createElement("table",{attrs:{role:"grid"}})),h=(l.className=e.className,l.classList.add("e-resizetable"),l.style.cssText="table-layout: auto;width: auto","e-gridheader"===i&&(s=this.parent.createElement("thead"),l.appendChild(s)),this.parent.createElement("tr")),d=n<=0?1:n;d<=(r>t.length?t.length:r);d++){var p=h.cloneNode();H.isNullOrUndefined(e.querySelector("tr"))||(p.className=e.querySelector("tr").className),p.appendChild(t[parseInt((d-1).toString(),10)]),(H.isNullOrUndefined(s)?l:s).appendChild(p)}a.appendChild(l),o.appendChild(a),document.body.appendChild(o);i=l.getBoundingClientRect().width;return document.body.removeChild(o),Math.ceil(i)},u.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Rt,this.refreshHeight,this),this.parent.on(Kr,this.refreshResizePosition,this),this.parent.on(mt,this.wireEvents,this),this.parent.on(vt,this.autoFit,this),this.parent.on(er,this.refreshHeight,this),this.parent.on(s,this.destroy,this),this.parent.on(Gt,this.keyPressHandler,this))},u.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Rt,this.refreshHeight),this.parent.off(Kr,this.refreshResizePosition),this.parent.off(mt,this.wireEvents),this.parent.off(er,this.refreshHeight),this.parent.off(s,this.destroy),this.parent.off(Gt,this.keyPressHandler))},u.prototype.render=function(){this.unwireEvents(),this.wireEvents(),this.setHandlerHeight()},u.prototype.refreshHeight=function(){if(this.parent.getHeaderTable()){for(var e=this.getResizeHandlers(),t=0;t<e.length;t++)0<e[parseInt(t.toString(),10)].parentElement.offsetHeight&&(e[parseInt(t.toString(),10)].style.height="100%");this.setHandlerHeight()}},u.prototype.wireEvents=function(){H.EventHandler.add(this.parent.getHeaderContent(),H.Browser.touchStartEvent,this.touchResizeStart,this),H.EventHandler.add(this.parent.getHeaderContent(),ni,this.callAutoFit,this)},u.prototype.unwireEvents=function(){H.EventHandler.remove(this.parent.getHeaderContent(),H.Browser.touchStartEvent,this.touchResizeStart),H.EventHandler.remove(this.parent.getHeaderContent(),ni,this.callAutoFit)},u.prototype.getResizeHandlers=function(){return[].slice.call(this.parent.getHeaderTable().getElementsByClassName(dg.root))},u.prototype.setHandlerHeight=function(){for(var e=[].slice.call(this.parent.getHeaderTable().getElementsByClassName(dg.suppress)),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].style.height="100%"},u.prototype.callAutoFit=function(e){var t;H.Browser.isDevice&&"function"==typeof e.preventDefault&&this.isDblClk&&e.preventDefault(),!e.target.classList.contains("e-rhandler")||this.isCancelAutoFit||(t=this.getTargetColumn(e)).columns||(this.resizeColumn(t.field,this.parent.getNormalizedColumnIndex(t.uid),t.uid),this.parent.isFrozenGrid()&&this.refreshResizefrzCols(!0,!0),this.isDblClk&&"mousedown"===e.type&&this.parent.trigger(tt,{e:e,column:t}),H.closest(e.target,dg.header).classList.add("e-resized"))},u.prototype.touchResizeStart=function(e){if(!oe.Global.timer)return oe.Global.timer=setTimeout(function(){oe.Global.timer=null},300),this.resizeStart(e);clearTimeout(oe.Global.timer),oe.Global.timer=null,this.callAutoFit(e)},u.prototype.resizeStart=function(e){var t=this,i=this.parent.getContentTable().style.width,n=!1;if(-1!==i.indexOf("%")&&100<parseFloat(i)&&(n=!0),e.target.classList.contains("e-rhandler")){this.isCancelAutoFit=!1;i={e:e,column:this.getTargetColumn(e)};if(this.parent.trigger(Je,i,function(e){(e.cancel||t.parent.isEdit)&&(t.cancelResizeAction(),t.isCancelAutoFit=!0)}),!this.isCancelAutoFit){if(!this.helper){if(0===this.getScrollBarWidth()||n){this.resizeProcess=!0;for(var r=0,s=this.refreshColumnWidth();r<s.length;r++){var o=s[r];this.widthService.setColumnWidth(o)}if(this.parent.allowGrouping)for(var a=0;a<this.parent.groupSettings.columns.length;a++)this.widthService.setColumnWidth(new Q({width:"30px"}),a);this.parent.isRowDragable()&&this.widthService.setColumnWidth(new Q({width:"30px"})),this.widthService.setWidthToTable(),this.resizeProcess=!1}this.refreshStackedColumnWidth(),this.element=e.target,this.parentElementWidth=this.parent.element.getBoundingClientRect().width,this.appendHelper(),this.column=this.getTargetColumn(e),this.pageX=this.getPointX(e),this.column.getFreezeTableName()===Ns?this.parent.enableRtl?this.minMove=(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0)-parseFloat(H.isNullOrUndefined(this.column.width)?"":this.column.width.toString()):this.minMove=parseFloat(H.isNullOrUndefined(this.column.width)?"":this.column.width.toString())-(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0):this.parent.enableRtl?this.minMove=parseFloat(this.column.width.toString())-(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0):this.minMove=(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0)-parseFloat(H.isNullOrUndefined(this.column.width)?"":this.column.width.toString()),this.minMove+=this.pageX}H.EventHandler.add(document,H.Browser.touchEndEvent,this.resizeEnd,this),H.EventHandler.add(this.parent.element,H.Browser.touchMoveEvent,this.resizing,this),H.Browser.isDevice&&!this.helper.classList.contains(dg.icon)?(this.helper.classList.add(dg.icon),H.EventHandler.add(document,H.Browser.touchStartEvent,this.removeHelper,this),H.EventHandler.add(this.helper,H.Browser.touchStartEvent,this.resizeStart,this)):this.updateCursor("add")}}},u.prototype.cancelResizeAction=function(e){e&&(H.EventHandler.remove(this.parent.element,H.Browser.touchMoveEvent,this.resizing),H.EventHandler.remove(document,H.Browser.touchEndEvent,this.resizeEnd),this.updateCursor("remove")),H.Browser.isDevice&&!H.isNullOrUndefined(this.helper)&&(H.EventHandler.remove(document,H.Browser.touchStartEvent,this.removeHelper),H.EventHandler.remove(this.helper,H.Browser.touchStartEvent,this.resizeStart)),H.isNullOrUndefined(this.helper)||H.detach(this.helper),this.refresh()},u.prototype.getWidth=function(e,t,i){return!H.isNullOrUndefined(t)&&e<t?t:!H.isNullOrUndefined(i)&&i<e?i:e},u.prototype.updateResizeEleHeight=function(){for(var e=[].slice.call(this.parent.getHeaderContent().getElementsByClassName("e-rhandler")),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].style.height=this.element.parentElement.offsetHeight+"px"},u.prototype.getColData=function(e,t){return{width:parseFloat(H.isNullOrUndefined(this.widthService.getWidth(e))||"auto"===this.widthService.getWidth(e)?"0":this.widthService.getWidth(e).toString())+t,minWidth:H.isNullOrUndefined(e.minWidth)?null:parseFloat(e.minWidth.toString()),maxWidth:H.isNullOrUndefined(e.maxWidth)?null:parseFloat(e.maxWidth.toString())}},u.prototype.refreshResizeFixedCols=function(e){for(var t=this.parent.getColumns(),i=this.parent.enableColumnVirtualization?this.parent.translateX:0,n=[].slice.call(this.parent.getHeaderContent().querySelector("tbody").querySelectorAll(".e-fixedfreeze")).concat([].slice.call(this.parent.getContent().querySelectorAll(".e-fixedfreeze"))),r=0;r<n.length;r++){var s,o=n[parseInt(r.toString(),10)],a=void 0,l=(a=o.classList.contains("e-summarycell")?(s=o.getAttribute("data-mappinguid"),this.parent.getColumnByUid(s)):(s=parseInt(o.getAttribute("aria-colindex"),10)-1,t[parseInt(s.toString(),10)]),0);if("Left"===e){this.parent.getVisibleFrozenLeftCount()?l=30*this.parent.getIndentCount():"Right"===this.parent.getFrozenMode()&&(l=30*this.parent.groupSettings.columns.length);for(var h=0;h<t.length;h++)if(a.index>t[parseInt(h.toString(),10)].index){if(a.uid===t[parseInt(h.toString(),10)].uid)break;("Left"===t[parseInt(h.toString(),10)].freeze||t[parseInt(h.toString(),10)].isFrozen||"Fixed"===t[parseInt(h.toString(),10)].freeze)&&t[parseInt(h.toString(),10)].visible&&(l+=parseFloat(t[parseInt(h.toString(),10)].width.toString()))}Lc(o,(0===l?l:l-1)-i,this.parent.enableRtl,"Left")}if("Right"===e){for(l="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0,h=t.length-1;0<=h&&a.uid!==t[parseInt(h.toString(),10)].uid;h--)"Right"!==t[parseInt(h.toString(),10)].freeze&&"Fixed"!==t[parseInt(h.toString(),10)].freeze||t[parseInt(h.toString(),10)].visible&&(l+=parseFloat(t[parseInt(h.toString(),10)].width.toString()));var d=0;Lc(o,l-(d=1<o.colSpan?this.calculateColspanWidth(t,o,a.index):d)+i,this.parent.enableRtl,"Right")}}},u.prototype.calculateColspanWidth=function(e,t,i){for(var n=0,r=i+1;r<i+t.colSpan;r++)n+=parseInt(e[parseInt(r.toString(),10)].width.toString(),10);return n},u.prototype.refreshResizePosition=function(){this.refreshResizefrzCols(!0)},u.prototype.refreshResizefrzCols=function(e,t){var n=this,r=this.parent.enableColumnVirtualization?this.parent.translateX:0;if(e||"Left"===this.column.freeze||this.column.isFrozen||this.column.columns&&"Left"===kc(this.column)){var i=30*this.parent.getIndentCount(),s=this.parent.getColumns().filter(function(e){return"Left"===e.freeze||e.isFrozen});e&&!t||this.frzHdrRefresh("Left");for(var o=0;o<s.length;o++)(e||s[parseInt(o.toString(),10)].index>this.column.index)&&((this.parent.frozenRows?[].slice.call(this.parent.getHeaderContent().querySelectorAll('td[aria-colindex="'+(o+1)+'"]')).concat([].slice.call(this.parent.getContent().querySelectorAll('td[aria-colindex="'+(o+1)+'"]'))):[].slice.call(this.parent.getContent().querySelectorAll('td[aria-colindex="'+(o+1)+'"]'))).filter(function(e){Lc(e,i-r,n.parent.enableRtl,"Left")}),this.parent.enableColumnVirtualization)&&(s[parseInt(o.toString(),10)].valueX=i),s[parseInt(o.toString(),10)].visible&&(i+=parseFloat(s[parseInt(o.toString(),10)].width.toString()));this.refreshResizeFixedCols("Left")}if(e||"Right"===this.column.freeze||this.column.columns&&"Right"===kc(this.column)){for(var a="Right"===this.parent.getFrozenMode()&&this.parent.isRowDragable()?30:0,l=this.parent.getColumns(),h=(e&&!t||this.frzHdrRefresh("Right"),l.filter(function(e){return"Right"===e.freeze})),d=this,o=l.length-1;o>=l.length-h.length;o--)!function(i){(d.parent.frozenRows?[].slice.call(d.parent.getHeaderContent().querySelectorAll('td[aria-colindex="'+(i+1)+'"]')).concat([].slice.call(d.parent.getContent().querySelectorAll('td[aria-colindex="'+(i+1)+'"]'))):[].slice.call(d.parent.getContent().querySelectorAll('td[aria-colindex="'+(i+1)+'"]'))).filter(function(e){var t=0;1<e.colSpan&&(t=n.calculateColspanWidth(l,e,l[parseInt(i.toString(),10)].index)),Lc(e,a-t+r,n.parent.enableRtl,"Right")}),d.parent.enableColumnVirtualization&&(l[parseInt(i.toString(),10)].valueX=a),l[parseInt(i.toString(),10)].visible&&(a+=parseFloat(l[parseInt(i.toString(),10)].width.toString()))}(o);this.refreshResizeFixedCols("Right")}this.column&&("Fixed"===this.column.freeze||this.column.columns&&"Fixed"===kc(this.column))&&(this.refreshResizeFixedCols("Left"),this.refreshResizeFixedCols("Right"),this.frzHdrRefresh("Left"),this.frzHdrRefresh("Right")),this.parent.groupSettings.columns.length&&this.parent.aggregates.length&&this.parent.getContent().querySelector(".e-groupcaptionrow")&&this.refreshGroupCaptionRow()},u.prototype.refreshGroupCaptionRow=function(){for(var e=[].slice.call(this.parent.getContent().querySelectorAll(".e-groupcaptionrow")),t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i.querySelector(".e-summarycell")&&gc(i,this.parent)}},u.prototype.frzHdrRefresh=function(e){var a=this,l=this.parent.enableColumnVirtualization?this.parent.translateX:0;if("Left"===e)for(var t=[].slice.call(this.parent.getHeaderContent().querySelector("thead").querySelectorAll("tr")),i=0;i<t.length;i++)for(var h=[].slice.call(t[parseInt(i.toString(),10)].querySelectorAll(".e-leftfreeze,.e-fixedfreeze")),d=this,n=0;n<h.length;n++)!function(e){e=h[parseInt(e.toString(),10)];if(e.classList.contains("e-rowdragheader")||e.classList.contains("e-dragheadercell")||e.classList.contains("e-grouptopleftcell"))return;var t=d.getParticularCol(e),i=d.parent.getColumns(),n=0,r=[];if(d.parent.aggregates.length&&d.parent.getFooterContent()&&(d.parent.getContent().querySelectorAll(".e-summaryrow").length&&[].slice.call(d.parent.getContent().querySelectorAll(".e-summaryrow")).filter(function(e){r.push(e.querySelector('[data-mappinguid="'+t.uid+'"]'))}),r=r.concat([].slice.call(d.parent.getFooterContent().querySelectorAll('[data-mappinguid="'+t.uid+'"]')))),e.classList.contains("e-fixedfreeze")){d.parent.getVisibleFrozenLeftCount()?n=30*d.parent.getIndentCount():"Right"===d.parent.getFrozenMode()&&(n=30*d.parent.groupSettings.columns.length);for(var s=0;s<i.length;s++)if(t.index>i[parseInt(s.toString(),10)].index){if(t.uid===i[parseInt(s.toString(),10)].uid)break;("Left"===i[parseInt(s.toString(),10)].freeze||i[parseInt(s.toString(),10)].isFrozen||"Fixed"===i[parseInt(s.toString(),10)].freeze)&&i[parseInt(s.toString(),10)].visible&&(n+=parseInt(i[parseInt(s.toString(),10)].width.toString(),10))}r&&r.length&&r.filter(function(e){Lc(e,n-l,a.parent.enableRtl,"Left")}),Lc(e,(0===n?n:n-1)-l,d.parent.enableRtl,"Left")}else{if(n=30*d.parent.getIndentCount(),0===t.index)r&&r.length&&r.filter(function(e){Lc(e,n-l,a.parent.enableRtl,"Left")});else{for(var o=0;o<i.length&&!(t.index<i[parseInt(o.toString(),10)].index||t.uid===i[parseInt(o.toString(),10)].uid);o++)i[parseInt(o.toString(),10)].visible&&(n+=parseInt(i[parseInt(o.toString(),10)].width.toString(),10));r&&r.length&&r.filter(function(e){Lc(e,n-l,a.parent.enableRtl,"Left")})}Lc(e,n-l,d.parent.enableRtl,"Left"),d.parent.enableColumnVirtualization&&(t.valueX=n),zc(d.parent,t,e)}}(n);if("Right"===e)for(t=[].slice.call(this.parent.getHeaderContent().querySelector("thead").querySelectorAll("tr")),i=0;i<t.length;i++)for(var h=[].slice.call(t[parseInt(i.toString(),10)].querySelectorAll(".e-rightfreeze, .e-fixedfreeze")),p=this,n=h.length-1;0<=n;n--)!function(e){var e=h[parseInt(e.toString(),10)],t=p.getParticularCol(e),i=p.parent.getColumns(),n=0,r=[];if(p.parent.aggregates.length&&p.parent.getFooterContent()&&(p.parent.getContent().querySelectorAll(".e-summaryrow").length&&[].slice.call(p.parent.getContent().querySelectorAll(".e-summaryrow")).filter(function(e){r.push(e.querySelector('[data-mappinguid="'+t.uid+'"]'))}),r=r.concat([].slice.call(p.parent.getFooterContent().querySelectorAll('[data-mappinguid="'+t.uid+'"]')))),e.classList.contains("e-fixedfreeze")){for(var n="Right"===p.parent.getFrozenMode()&&p.parent.isRowDragable()?30:0,s=i.length-1;0<=s;s--)if(t.index<i[parseInt(s.toString(),10)].index){if(t.columns&&Fc(t,i[parseInt(s.toString(),10)].uid)||t.index>i[parseInt(s.toString(),10)].index)break;"Right"!==i[parseInt(s.toString(),10)].freeze&&"Fixed"!==i[parseInt(s.toString(),10)].freeze||i[parseInt(s.toString(),10)].visible&&(n+=parseFloat(i[parseInt(s.toString(),10)].width.toString()))}r.length&&r.filter(function(e){Lc(e,n+l,a.parent.enableRtl,"Right")}),Lc(e,n+l,p.parent.enableRtl,"Right")}else{n="Right"===p.parent.getFrozenMode()&&p.parent.isRowDragable()?30:0;for(var o=i.length-1;0<=o&&!(t.columns&&Fc(t,i[parseInt(o.toString(),10)].uid)||t.index>i[parseInt(o.toString(),10)].index||t.uid===i[parseInt(o.toString(),10)].uid);o--)i[parseInt(o.toString(),10)].visible&&(n+=parseInt(i[parseInt(o.toString(),10)].width.toString(),10));r.length&&r.filter(function(e){Lc(e,n+l,a.parent.enableRtl,"Right")}),Lc(e,n+l,p.parent.enableRtl,"Right"),p.parent.enableColumnVirtualization&&(t.valueX=n)}}(n)},u.prototype.getParticularCol=function(e){e=(e.classList.contains("e-filterbarcell")?e:e.querySelector("[data-mappinguid]")).getAttribute("data-mappinguid");return this.parent.getColumnByUid(e)},u.prototype.resizing=function(e){var t=this;if(H.Browser.isDevice&&"function"==typeof e.preventDefault&&e.preventDefault(),!H.isNullOrUndefined(this.column)){var i=0,n=(H.isNullOrUndefined(this.column)&&(i=I(this.element,"th").offsetWidth),this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.setHelperHeight()),this.getPointX(e)),r=this.parent.enableRtl?-(n-this.pageX):n-this.pageX,s=parseFloat(this.column.width.toString()),o=this.getColData(this.column,r),o=(o.width||(o.width=H.closest(this.element,"th").offsetWidth),this.getWidth(o.width,o.minWidth,o.maxWidth));if(this.parent.log("resize_min_max",{column:this.column,width:o}),(!this.parent.enableRtl&&this.minMove>=n||this.parent.enableRtl&&this.minMove<=n)&&(o=H.isNullOrUndefined(this.column.minWidth)?10:parseFloat(this.column.minWidth.toString()),this.pageX=n=this.minMove),o!==parseFloat((H.isNullOrUndefined(this.column.width)||"auto"===this.column.width?i:this.column.width).toString())){this.pageX=n,this.column.width=H.formatUnit(o);i={e:e,column:this.column};if(this.parent.trigger(et,i),i.cancel)return void this.cancelResizeAction(!0);this.column;var n=[this.column],a=(this.column.columns&&(o=this.getSubColumns(this.column,[]),o=this.calulateColumnsWidth(o,!1,r),n=this.calulateColumnsWidth(o,!0,r)),0),e=this.parent.getColumns().filter(function(e){return e.visible&&(a+=parseInt(e.width.toString(),10)),e.visible&&(!H.isNullOrUndefined(e.maxWidth)||!H.isNullOrUndefined(e.minWidth))});"Auto"===this.parent.resizeSettings.mode&&e.length&&a<this.parentElementWidth&&(i=this.parent.getColumns().filter(function(e){return e.visible&&e.uid!==t.column.uid}),o=this.distributeColWidth(i,r,0),Math.round(o.usedWidth)!==Math.abs(r)&&(n[0].width=s+o.usedWidth*Math.sign(r)),n=n.concat(o.columns)),this.resizeProcess=!0;for(var l=0,h=n;l<h.length;l++){var d=h[l];this.widthService.setColumnWidth(d,null,"resize")}this.resizeProcess=!1,this.updateHelper()}this.parent.isFrozenGrid()&&this.refreshResizefrzCols(),this.isDblClk=!1}},u.prototype.distributeColWidth=function(e,t,i){for(var n=t/e.length,r=Math.abs(n),s=[],o=[],a=0,l=0,h=e;l<h.length;l++){var d,p=h[l],c=parseFloat(p.width.toString())-n;(!H.isNullOrUndefined(p.minWidth)&&c<parseInt(p.minWidth.toString(),10)?(a+=d=parseFloat((parseInt(p.minWidth.toString(),10)-c).toFixed(3)),i+=r-d,p.width=p.minWidth,s):!H.isNullOrUndefined(p.maxWidth)&&c>parseInt(p.maxWidth.toString(),10)?(a+=d=parseFloat((c-parseInt(p.maxWidth.toString(),10)).toFixed(3)),i+=r-d,p.width=p.maxWidth,s):(i+=r,p.width=c,o)).push(p)}e=a&&o.length?this.distributeColWidth(o,a*Math.sign(t),i):{columns:o,usedWidth:i};return{columns:s.concat(e.columns),usedWidth:e.usedWidth}},u.prototype.calulateColumnsWidth=function(e,t,i){for(var n=[],r=0,s=e;r<s.length;r++){for(var o=s[r],a=0,l=0;l<e.length;l++)a+=parseFloat(e[parseInt(l.toString(),10)].width.toString());var h=this.getColData(o,parseFloat(o.width)*i/a),h=this.getWidth(h.width,h.minWidth,h.maxWidth);h!==parseFloat(o.width.toString())&&(t&&(o.width=H.formatUnit(h<1?1:h)),n.push(o))}return n},u.prototype.getSubColumns=function(e,t){for(var i=0,n=e.columns;i<n.length;i++){var r=n[i];!1!==r.visible&&r.allowResizing&&(r.columns?this.getSubColumns(r,t):t.push(r))}return t},u.prototype.resizeEnd=function(e){var t,i,n,r,s;this.helper&&!this.parent.isDestroyed&&((t=this.parent).isFrozenGrid()&&this.refreshResizePosition(),H.EventHandler.remove(this.parent.element,H.Browser.touchMoveEvent,this.resizing),H.EventHandler.remove(document,H.Browser.touchEndEvent,this.resizeEnd),H.Browser.isDevice&&(H.EventHandler.remove(document,H.Browser.touchStartEvent,this.removeHelper),H.EventHandler.remove(this.helper,H.Browser.touchStartEvent,this.resizeStart)),this.updateCursor("remove"),H.detach(this.helper),n={e:e,column:this.column},(i=this.parent.getContent().querySelector("."+xs)).scrollHeight>i.clientHeight&&(this.parent.scrollModule.setPadding(),i.style.overflowY="scroll"),oe.Global.timer&&this.isDblClk||(this.parent.trigger(tt,n),H.closest(this.element,".e-headercell").classList.add("e-resized")),this.isFrozenColResized=!1,this.parent.allowTextWrap&&(this.updateResizeEleHeight(),this.parent.notify(Qi,{case:"textwrap"})),i=t.getHeaderTable(),n=t.getContentTable(),H.isNullOrUndefined(t.getFooterContent())||(r=t.getFooterContentTable()),i.offsetWidth<(s=t.getContent().scrollWidth)?(H.isNullOrUndefined(n.querySelector(".e-emptyrow"))?s>n.scrollWidth&&H.addClass([i,n],["e-tableborder"]):(H.addClass([i],["e-tableborder"]),H.removeClass([n],["e-tableborder"])),H.removeClass([t.element],["e-left-shadow","e-right-shadow"])):(H.removeClass([i,n],["e-tableborder"]),t.getVisibleFrozenRightCount()&&H.addClass([t.element],"e-right-shadow")),H.isNullOrUndefined(r)||r.classList.add("e-tableborder"),this.refresh(),this.doubleTapEvent(e),this.isDblClk=!0)},u.prototype.getPointX=function(e){return(e.touches&&e.touches.length?e.touches[0]:e).pageX},u.prototype.refreshColumnWidth=function(){for(var e=this.parent.getColumns(),t=0,i=[].slice.apply(this.parent.getHeaderContent().querySelectorAll('th.e-headercell:not(.e-hide):not([style*="display: none"])'));t<i.length;t++)for(var n=i[t],r=0,s=e;r<s.length;r++){var o=s[r];if(n.querySelector("[data-mappinguid]")&&n.querySelector("[data-mappinguid]").getAttribute("data-mappinguid")===o.uid&&o.visible){o.width=n.getBoundingClientRect().width;break}}return e},u.prototype.refreshStackedColumnWidth=function(){for(var e=0,t=this.parent.getStackedColumns(this.parent.columns);e<t.length;e++){var i=t[e];i.width=this.getStackedWidth(i,0)}},u.prototype.getStackedWidth=function(e,t){for(var i=0,n=e.columns;i<n.length;i++){var r=n[i];!1!==r.visible&&(r.columns?t=this.getStackedWidth(r,t):t+=parseFloat(r.width.toString()))}return t},u.prototype.keyPressHandler=function(e){var t,i,n,r;this.parent.allowResizing&&this.parent.allowKeyboard&&!this.parent.isEdit&&(t=e.altKey&&"altRightArrow"===e.action,r=e.altKey&&"altLeftArrow"===e.action,t||r)&&(i=(i=H.closest(e.target,".e-headercell"))&&i.querySelector("."+dg.root))&&(n=this.parent.resizeSettings.resizeStep,r=(this.parent.enableRtl?r:t)?n:-n,e.preventDefault(),this.resizeStart({target:i,pageX:0}),this.helper)&&this.column&&(this.resizing({pageX:this.parent.enableRtl?-r:r}),this.resizeEnd({}))},u.prototype.getTargetColumn=function(e){e=H.closest(e.target,dg.header),e=(e=e.querySelector(".e-headercelldiv")||e.querySelector(".e-stackedheadercelldiv")).getAttribute("data-mappinguid");return this.parent.getColumnByUid(e)},u.prototype.updateCursor=function(e){var t=[].slice.call(this.parent.getHeaderContent().querySelectorAll("th"));t.push(this.parent.element);for(var i=0,n=t;i<n.length;i++)n[i].classList[""+e](dg.cursor)},u.prototype.refresh=function(){this.column=null,this.pageX=null,this.element=null,this.helper=null},u.prototype.appendHelper=function(){this.helper=this.parent.createElement("div",{className:dg.helper}),this.parent.element.appendChild(this.helper),this.setHelperHeight()},u.prototype.resizeHelperHeight=function(e){for(var t=this.parent.getContent().offsetHeight-this.getScrollBarWidth(),i=[].slice.call(this.parent.getHeaderContent().querySelectorAll("tr")),n=i.indexOf(e.parentElement);n<i.length&&-1<n;n++)t+=i[parseInt(n.toString(),10)].offsetHeight;return t},u.prototype.setHelperHeight=function(){var e=H.closest(this.element,dg.header),t=this.resizeHelperHeight(e),i=this.calcPos(e),e=e.getBoundingClientRect();i.left=(i.left<=1?0:i.left)+(this.parent.enableRtl?0:Number(e.width.toFixed(1)))-1,this.helper.style.cssText="height: "+t+"px; top: "+i.top+"px; left:"+Math.floor(i.left)+"px;",this.parent.enableVirtualization&&this.helper.classList.add("e-virtual-rhandler")},u.prototype.getScrollBarWidth=function(e){var t=this.parent.getContent().firstChild;return t.scrollHeight>t.clientHeight&&e||t.scrollWidth>t.clientWidth?Op():0},u.prototype.removeHelper=function(e){e=e.target.classList;e.contains(dg.root)||e.contains(dg.icon)||!this.helper||(H.EventHandler.remove(document,H.Browser.touchStartEvent,this.removeHelper),H.EventHandler.remove(this.helper,H.Browser.touchStartEvent,this.resizeStart),H.detach(this.helper),this.refresh())},u.prototype.updateHelper=function(){var e=H.closest(this.element,dg.header),t=this.calcPos(e),i=e.getBoundingClientRect(),t=Math.floor(Number((t.left<=1?0:t.left).toFixed(1))+(this.parent.enableRtl?0:Number(i.width.toFixed(1)))-1);t>this.parentElementWidth&&(t=this.parentElementWidth-2),this.helper.style.height=this.resizeHelperHeight(e)+"px",this.helper.style.left=t+"px"},u.prototype.calcPos=function(e){for(var t={top:0,left:0},i=e.getBoundingClientRect(),n=e.ownerDocument,r=I(e,"e-grid")||n.documentElement;r&&(r===n.body||r===n.documentElement)&&"static"===r.style.position;)r=r.parentNode;return r&&r!==e&&1===r.nodeType&&(t=r.getBoundingClientRect()),{top:i.top-t.top,left:i.left-t.left}},u.prototype.doubleTapEvent=function(e){var t=this;this.getUserAgent()&&this.isDblClk&&(this.tapped?(clearTimeout(this.tapped),this.callAutoFit(e),this.tapped=null):this.tapped=setTimeout(function(){t.tapped=null},300))},u.prototype.getUserAgent=function(){var e=H.Browser.userAgent.toLowerCase();return/iphone|ipod|ipad/.test(e)},u.prototype.timeoutHandler=function(){this.tapped=null},u);function u(e){this.tapped=!1,this.isDblClk=!0,this.resizeProcess=!1,this.isCancelAutoFit=!1,this.parent=e,this.parent.isDestroyed||(this.widthService=new Ta(e),this.addEventListener())}cg.prototype.chkDropPosition=function(e,t){var i=t.querySelector(".e-headercelldiv")||t.querySelector(".e-stackedheadercelldiv"),i=i||t.firstElementChild,i=this.parent.getColumnByUid(i.getAttribute("data-mappinguid")),n=e.querySelector(".e-headercelldiv, .e-stackedheadercelldiv").getAttribute("data-mappinguid"),n=this.parent.getColumnByUid(n),n=n?this.getColParent(n,this.parent.columns):void 0,r=i?this.getColParent(i,this.parent.columns):void 0,i=!i||!i.lockColumn,n=!!n&&!!r&&n!==r||!!n&&!r||!n&&!!r;return(e.parentElement.isEqualNode(t.parentElement)||this.parent.enableColumnVirtualization||n||this.parent.isFrozenGrid()&&Array.prototype.indexOf.call(H.closest(e,"thead").children,e.parentElement)===Array.prototype.indexOf.call(H.closest(t,"thead").children,t.parentElement))&&-1<this.targetParentContainerIndex(e,t)&&i},cg.prototype.chkDropAllCols=function(e,t){for(var i,n=this.getHeaderCells();!i&&0<n.length;)i=e!==n.pop()&&-1<this.targetParentContainerIndex(e,t);return i},cg.prototype.findColParent=function(e,t,i){for(var n=0,r=t.length;n<r;n++){if(e===t[parseInt(n.toString(),10)])return!0;if(t[parseInt(n.toString(),10)].columns){var s=i.length;if(i.push(t[parseInt(n.toString(),10)]),this.findColParent(e,t[parseInt(n.toString(),10)].columns,i))return!0;i.splice(s,i.length-s)}}return!1},cg.prototype.getColumnsModel=function(e,t){for(var i=[],n=[],r=0,s=e.length;r<s;r++)H.isNullOrUndefined(e[parseInt(r.toString(),10)])||((e[parseInt(r.toString(),10)].visible||t)&&i.push(e[parseInt(r.toString(),10)]),e[parseInt(r.toString(),10)].columns&&(n=n.concat(e[parseInt(r.toString(),10)].columns)));return i=n.length?i.concat(this.getColumnsModel(n)):i},cg.prototype.headerDrop=function(e){var t=this.parent;if(this.element){var i=(this.element.querySelector(".e-headercelldiv")||this.element.querySelector(".e-stackedheadercelldiv")).getAttribute("data-mappinguid"),i=t.getColumnByUid(i);if(H.closest(e.target,"th")&&(H.isNullOrUndefined(i)||i.allowReordering&&!i.lockColumn)){var n,r,s,o,e=H.closest(e.target,".e-headercell"),a=(e.querySelector(".e-headercelldiv")||e.querySelector(".e-stackedheadercelldiv")).getAttribute("data-mappinguid");if(!H.isNullOrUndefined(a)){var t=t.getColumnByUid(a);if(H.isNullOrUndefined(t)||!t.allowReordering||t.lockColumn)return void this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:i,destColumn:t})}e&&this.chkDropPosition(this.element,e)&&this.chkDropAllCols(this.element,e)&&(this.parent.enableColumnVirtualization?(o=this.parent.columns,n=this.element.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"),a=this.parent.columns.filter(function(e){return e.uid===n}),r=null,t=a[0],s=e.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"),o.some(function(e,t){return e.uid===s&&(r=t,e.uid===s)}),H.isNullOrUndefined(r)||this.moveColumns(r,t)):(a=this.targetParentContainerIndex(this.element,e),t=(this.element.querySelector(".e-stackedheadercelldiv")||this.element.querySelector(".e-headercelldiv")).getAttribute("data-mappinguid"),this.destElement=e,this.parent.notify(ir,{ele:e}),t?this.moveColumns(a,this.parent.getColumnByUid(t)):(e=this.getHeaderCells(),t=mp(this.element,e),o=this.getColumnsModel(this.parent.columns),this.moveColumns(a,o[parseInt(t.toString(),10)]))))}else this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:i})}},cg.prototype.isActionPrevent=Bp,cg.prototype.createStackedColumn=function(e,t){e=H.extend({},e);return delete e.uid,e.columns=[t],new Q(e)},cg.prototype.getColumnHierarchy=function(e){for(var t=[],i=e;i;)t.push(i),i=this.getColParent(i,this.parent.columns);return t},cg.prototype.cleanupEmptyParentColumn=function(e){var t,i;e&&e.columns&&0===e.columns.length&&((i=this.getColParent(e,this.parent.columns))?-1<(t=yp(e,i.columns))&&i.columns.splice(t,1):-1<(i=yp(e,this.parent.columns))&&this.parent.columns.splice(i,1))},cg.prototype.reorderStackedHeader=function(e,t,i,n,r,s,o){i&&s&&s.headerText===i.headerText?this.reorderWithinStackedColumn(e,t,i,n,r,s,o):i&&!s?this.reorderStackedColumnToRoot(e,t,i,n,r,s,o):this.reorderBetweenStackedColumns(e,t,i,n,r,s,o)},cg.prototype.reorderWithinStackedColumn=function(e,t,i,n,r,s,o){s=s.columns,r=yp(r,s);r<0&&(r=e),this.isLeftDrop||r++,n.splice(o,1),s===n&&o<r&&r--,s.splice(r,0,t),this.cleanupEmptyParentColumn(i)},cg.prototype.reorderStackedColumnToRoot=function(e,t,i,n,r,s,o){for(var r=yp(r,this.parent.columns),a=(r<0&&(r=e),this.isLeftDrop||r++,n.splice(o,1),this.getColumnHierarchy(i)),l=t,h=0;h<a.length;h++)l=this.createStackedColumn(a[parseInt(h.toString(),10)],l);this.parent.columns.splice(r,0,l),this.cleanupEmptyParentColumn(i)},cg.prototype.reorderBetweenStackedColumns=function(e,t,i,n,r,s,o){var a=this.getColumnHierarchy(i),l=this.getColumnHierarchy(s),h=a.filter(function(e){return-1<l.indexOf(e)})[0];h=h||l.filter(function(t){return a.some(function(e){return e.headerText===t.headerText})})[0];for(var d=parent&&s===i?n:(h||this.parent).columns,p=r,c=s;p&&c!==h;)p=c,c=this.getColParent(p,this.parent.columns);for(var r=p?yp(p,d):-1,u=(r<0&&(r=e),this.isLeftDrop||r++,n.splice(o,1),[]),g=0;g<a.length&&(!h||a[parseInt(g.toString(),10)].headerText!==h.headerText);g++)u.push(a[parseInt(g.toString(),10)]);for(var f=t,g=0;g<u.length;g++)f=this.createStackedColumn(u[parseInt(g.toString(),10)],f);d.splice(r,0,f),this.cleanupEmptyParentColumn(i)},cg.prototype.iterateStackedHeaders=function(e){for(var t=0;t<e.length;){var i=e[parseInt(t.toString(),10)],n=(i&&i.columns&&this.iterateStackedHeaders(i.columns),e[parseInt((t+1).toString(),10)]);i&&n&&i.columns&&n.columns&&i.headerText===n.headerText?(i.columns=i.columns.concat(n.columns),e.splice(t+1,1)):t++}},cg.prototype.moveColumns=function(e,t,i,n){var r=this.parent;if(this.isActionPrevent(r))r.notify(ci,{instance:this,handler:this.moveColumns,arg1:e,arg2:t});else{var s=this.getColParent(t,this.parent.columns),o=(s||this.parent).columns,a=this.destElement&&this.destElement.querySelector(".e-headercelldiv, .e-stackedheadercelldiv")?this.destElement.querySelector(".e-headercelldiv, .e-stackedheadercelldiv").getAttribute("data-mappinguid"):null,a=a?this.parent.getColumnByUid(a):void 0,l=a?this.getColParent(a,this.parent.columns):void 0,h=!!s&&!!l&&s!==l||!!s&&!l||!s&&!!l,d=yp(t,o);if(r.allowReordering&&-1!==d&&-1!==e){if(!s&&!this.parent.lockcolPositionCount||i||this.parent.enableColumnVirtualization)o.splice(e,0,o.splice(d,1)[0]);else if(h)this.reorderStackedHeader(e,t,s,o,a,l,d);else{for(var p=0;p<o.length;p++)if(!H.isNullOrUndefined(t.field)&&o[parseInt(p.toString(),10)].field===t.field){d=p;break}var c=void 0;if(c=this.destElement.querySelector(".e-headercelldiv")?this.parent.getColumnByUid(this.destElement.querySelector(".e-headercelldiv").getAttribute("data-mappinguid")):c){for(p=0;p<o.length;p++)if(o[parseInt(p.toString(),10)].field===c.field){e=p;break}}else a&&(e=yp(a,o));o.splice(e,0,o.splice(d,1)[0])}i={column:t,destIndex:e,columns:o,parent:s,cancel:!1};if(r.notify(tr,i),this.iterateStackedHeaders(this.parent.columns),!i.cancel){if(this.parent.isFrozenGrid())if(this.parent.frozenColumns)for(p=0;p<o.length;p++)"Left"!==(c=o[parseInt(p.toString(),10)]).freeze&&"Right"!==c.freeze||(c.freeze=void 0);else s&&s.columns||(this.parent.getFrozenLeftCount()>e?t.freeze="Left":o.length-this.parent.getFrozenRightColumnsCount()<=e?t.freeze="Right":t.freeze="Fixed"===t.freeze?"Fixed":void 0);if(!1!==n){h={type:y,requestType:"reorder",fromIndex:e,toIndex:d,toColumnUid:t.uid,cancel:!1};if(r.notify(bt,h),h.cancel)return void o.splice(d,0,o.splice(e,1)[0])}r.getColumns(!0),r.preventAutoFit=!0,r.notify(Xt,{fromIndex:e,toIndex:d}),this.parent.isFrozenGrid()&&(l=this.parent.columns,this.idx=0,this.refreshColumnIndex(l),this.parent.notify(_r,{}))}}}},cg.prototype.refreshColumnIndex=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].index=this.idx,this.idx++,e[parseInt(t.toString(),10)].columns&&e[parseInt(t.toString(),10)].columns.length&&this.refreshColumnIndex(e[parseInt(t.toString(),10)].columns)},cg.prototype.isDifferentParent=function(e,t){var i=this.getColParent(e,this.parent.columns),e=this.getColParent(t,this.parent.columns);if(!i||!e)return!1;var n=e;if(i&&!this.getColParent(i,this.parent.columns))for(var r=n;r;){if(r.headerText===i.headerText&&n&&n.headerText!==i.headerText)return!0;r=this.getColParent(r,this.parent.columns)}var t=this.getColParent(i,this.parent.columns),s=this.getColParent(e,this.parent.columns);return!(!t||!s||t.headerText!==s.headerText||i.headerText===e.headerText)},cg.prototype.getTopParentColumn=function(e){for(var t=this.getColParent(e,this.parent.columns),i=t;t;)i=t,t=this.getColParent(t,this.parent.columns);return i},cg.prototype.targetParentContainerIndex=function(e,t){var i=this.parent.columns,n=this.getHeaderCells(),r=this.parent.getStackedColumns(i),s=[],r=(r.length&&(s=this.getAllStackedheaderParentColumns(n)),r.length&&s.length?this.getColumnsModel(s):this.getColumnsModel(i,!0)),s=r[mp(e,n)],e=r[mp(t,n)];return H.isNullOrUndefined(s)||H.isNullOrUndefined(e)||(r=this.getColParent(s,this.parent.columns),t=this.getColParent(e,this.parent.columns),!r&&t)||this.isDifferentParent(s,e)||(n=this.getTopParentColumn(s),s=this.getTopParentColumn(e),n&&s&&n.headerText!==s.headerText)?-1:r&&t&&r===t?yp(e,r.columns):(!r||t)&&t?(n=yp(e,t.columns),H.isNullOrUndefined(this.isLeftDrop)||this.isLeftDrop?n:n+1):yp(e,i)},cg.prototype.getAllStackedheaderParentColumns=function(e){for(var t,i=[],n=0;n<e.length;n++)e[parseInt(n.toString(),10)].classList.contains("e-hide")?(e.splice(n,1),n--):e[parseInt(n.toString(),10)].closest("thead").firstChild===e[parseInt(n.toString(),10)].parentElement&&((t=e[parseInt(n.toString(),10)]).querySelector(".e-stackedheadercelldiv")?i.push(this.parent.getColumnByUid(t.querySelector(".e-stackedheadercelldiv").getAttribute("data-mappinguid"))):i.push(this.parent.getColumnByUid(t.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"))));return i},cg.prototype.getHeaderCells=function(){return[].slice.call(this.parent.element.getElementsByClassName("e-headercell"))},cg.prototype.getColParent=function(e,t){var i=[];return this.findColParent(e,t,i),i[i.length-1]},cg.prototype.reorderSingleColumn=function(t,i){var e,n=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(e){return e.field===t})[0]:this.parent.getColumnByField(t),r=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(e){return e.field===i})[0]:this.parent.getColumnByField(i);(H.isNullOrUndefined(n)||n.allowReordering&&!n.lockColumn)&&(H.isNullOrUndefined(r)||r.allowReordering&&!r.lockColumn)?-1<(e=yp(r,(this.getColParent(r,this.parent.columns)||this.parent).columns))&&this.moveColumns(e,n,!0):this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:n,destColumn:r})},cg.prototype.reorderMultipleColumns=function(e,t){var i=this.parent.getColumnIndexByField(t),t=this.parent.getColumnByField(t);if(!(i<0)&&(H.isNullOrUndefined(t)||t.allowReordering&&!t.lockColumn)){for(var n=0;n<e.length;n++){var r=this.parent.getColumnByField(e[parseInt(n.toString(),10)]);if(!H.isNullOrUndefined(r)&&(!r.allowReordering||r.lockColumn))return}for(n=0;n<e.length;n++){var r=this.parent.getColumnByIndex(i),s=this.getColParent(r,this.parent.columns),s=yp(r,(s||this.parent).columns);-1<s&&this.moveColumns(s,this.parent.getColumnByField(e[parseInt(n.toString(),10)]),!0,!0),this.parent.getColumnIndexByField(e[n+1])>=s&&i++}}},cg.prototype.moveTargetColumn=function(e,t){-1<t&&this.moveColumns(t,e,!0)},cg.prototype.reorderSingleColumnByTarget=function(e,t){this.moveTargetColumn(this.parent.getColumnByField(e),t)},cg.prototype.reorderMultipleColumnByTarget=function(e,t){for(var i=0;i<e.length;i++)this.reorderSingleColumnByTarget(e[parseInt(i.toString(),10)],t)},cg.prototype.reorderColumns=function(e,t){"string"==typeof e?(this.reorderSingleColumn(e,t),this.fromCol=e):(this.reorderMultipleColumns(e,t),this.fromCol=e[0])},cg.prototype.reorderColumnByModel=function(e,t){!H.isNullOrUndefined(e)&&!H.isNullOrUndefined(t)&&e instanceof Q&&t instanceof Q&&(!e.allowReordering||e.lockColumn||!t.allowReordering||t.lockColumn?this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),column:e,destColumn:t}):(t=this.targetParentContainerIndex(this.parent.getColumnHeaderByUid(e.uid),this.parent.getColumnHeaderByUid(t.uid)),this.moveTargetColumn(e,t)))},cg.prototype.reorderColumnByIndex=function(e,t){this.moveTargetColumn(this.parent.getColumnByIndex(e),t)},cg.prototype.reorderColumnByTargetIndex=function(e,t){"string"==typeof e?this.reorderSingleColumnByTarget(e,t):this.reorderMultipleColumnByTarget(e,t)},cg.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.createReorderElement()},cg.prototype.createReorderElement=function(e){e&&e.args&&e.args.isXaxis&&this.setDisplay("none");var e=this.parent.element.querySelector("."+Cs),t=this.parent.createElement("div",{className:"e-icons e-icon-reorderuparrow e-reorderuparrow"}),t=(t.style.display="none",this.upArrow=t,e.appendChild(this.upArrow),this.parent.createElement("div",{className:"e-icons e-icon-reorderdownarrow e-reorderdownarrow"}));t.style.display="none",this.downArrow=t,e.appendChild(this.downArrow)},cg.prototype.onActionComplete=function(e){this.parent.preventAutoFit=!1,this.parent.trigger(c,H.extend(e,{type:c}));e=this.fromCol&&this.parent.getColumnHeaderByField(this.fromCol);e&&this.parent.focusModule.onClick({target:e},!0)},cg.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+ms)||e.querySelector("."+vs))&&(this.upArrow.parentNode&&H.remove(this.upArrow),this.downArrow.parentNode&&H.remove(this.downArrow),this.parent.off(Jt,this.headerDrop),this.parent.off(St,this.enableAfterRender),this.parent.off(Ft,this.onActionComplete),this.parent.off(Re,this.drag),this.parent.off(Ie,this.dragStart),this.parent.off(Zt,this.dragStop),this.parent.off(Rt,this.createReorderElement),this.parent.off(Gt,this.keyPressHandler),this.parent.off(s,this.destroy))},cg.prototype.keyPressHandler=function(e){var t=this.parent;switch(/(Mac)/i.test(navigator.platform)&&e.metaKey&&("leftArrow"===e.action?e.action="ctrlLeftArrow":"rightArrow"===e.action&&(e.action="ctrlRightArrow")),e.action){case"ctrlLeftArrow":case"ctrlRightArrow":var i,n,r=t.focusModule.currentInfo.element;r&&r.classList.contains("e-headercell")&&(r=t.getColumnByUid(r.querySelector(".e-headercelldiv").getAttribute("data-mappinguid")),i=(n=t.getVisibleColumns()).indexOf(r),n="ctrlLeftArrow"===e.action?n[i-1]:n[i+1])&&n.field&&r.field&&this.reorderColumns(r.field,n.field)}},cg.prototype.drag=function(e){var t,i=this.parent,n=e.target,r=H.closest(n,".e-headercell:not(.e-stackedHeaderCell)"),s=i.element.querySelector(".e-cloneproperties"),o=i.getContent().firstElementChild,o=this.x>Cp(e.event).x+o.scrollLeft;this.isLeftDrop=o,H.removeClass([].slice.call(i.getHeaderTable().getElementsByClassName("e-reorderindicate")),["e-reorderindicate"]),this.setDisplay("none"),this.stopTimer(),H.classList(s,["e-defaultcur"],["e-notallowedcur"]),this.updateScrollPostion(e.event),r&&!r.isEqualNode(this.element)?(t=(n=r).querySelector(".e-headercelldiv, .e-stackedheadercelldiv").getAttribute("data-mappinguid"),this.chkDropPosition(this.element,n)&&this.chkDropAllCols(this.element,n)&&i.getColumnByUid(t).allowReordering&&e.column.allowReordering?(this.updateArrowPosition(n,o),H.classList(n,["e-allowDrop","e-reorderindicate"],[])):i.allowGrouping&&I(e.target,"e-groupdroparea")||H.classList(s,["e-notallowedcur"],["e-defaultcur"])):(!r||!r.isEqualNode(this.element)||i.allowGrouping&&e.column.allowGrouping||e.column.allowReordering)&&(r||i.allowGrouping&&I(e.target,"e-groupdroparea"))||H.classList(s,["e-notallowedcur"],["e-defaultcur"]),e.column.allowReordering&&!e.column.lockColumn&&i.trigger(Re,{target:n,draggableType:"headercell",column:e.column})},cg.prototype.updateScrollPostion=function(e){var t=this,e=Cp(e).x,i=this.parent.element.getBoundingClientRect(),n=i.right,i=i.left,r=this.parent.getContent().firstElementChild;i<e&&e<i+35?this.timer=window.setInterval(function(){t.setScrollLeft(r,!0)},50):e<n&&n-35<e&&(this.timer=window.setInterval(function(){t.setScrollLeft(r,!1)},50))},cg.prototype.setScrollLeft=function(e,t){var i=e.scrollLeft;e.scrollLeft=e.scrollLeft+(t?-5:5),i!==e.scrollLeft&&this.setDisplay("none")},cg.prototype.stopTimer=function(){window.clearInterval(this.timer)},cg.prototype.updateArrowPosition=function(e,t){var i,e=e.getBoundingClientRect(),n=this.parent.element.getBoundingClientRect();t&&e.left<n.left||!t&&e.right>n.right||(i=this.parent.getHeaderContent().classList.contains("e-sticky"),this.upArrow.style.top=i?e.top+e.height+"px":e.top+e.height-n.top+"px",this.downArrow.style.top=i?e.top-7+"px":e.top-n.top-7+"px",this.upArrow.style.left=this.downArrow.style.left=i?(t?e.left:e.right)-4+"px":(t?e.left:e.right)-n.left-4+"px",this.setDisplay(""))},cg.prototype.dragStart=function(e){var t,i=this.parent,n=e.target;this.element=n.classList.contains("e-headercell")?n:I(n,"e-headercell"),e.column.allowReordering&&!e.column.lockColumn&&(t=i.getContent().firstElementChild,this.x=Cp(e.event).x+t.scrollLeft,i.trigger(Ie,{target:n,draggableType:"headercell",column:e.column}))},cg.prototype.dragStop=function(e){var t=this.parent;this.setDisplay("none"),this.stopTimer(),e.cancel||t.trigger(xe,{target:e.target,draggableType:"headercell",column:e.column}),H.removeClass([].slice.call(t.getHeaderTable().getElementsByClassName("e-reorderindicate")),["e-reorderindicate"])},cg.prototype.setDisplay=function(e){this.upArrow.style.display=e,this.downArrow.style.display=e},cg.prototype.getModuleName=function(){return"reorder"};Va=cg;function cg(e){this.idx=0,this.parent=e,this.parent.isDestroyed||(this.parent.on(Jt,this.headerDrop,this),this.parent.on(St,this.enableAfterRender,this),this.parent.on(Ft,this.onActionComplete,this),this.parent.on(Re,this.drag,this),this.parent.on(Ie,this.dragStart,this),this.parent.on(Zt,this.dragStop,this),this.parent.on(Rt,this.createReorderElement,this),this.parent.on(Gt,this.keyPressHandler,this),this.parent.on(s,this.destroy,this))}ug.prototype.getParentGrid=function(e){for(var t=e,i=!1;!i;)(t=t.ej2_instances[0].parentDetails?document.getElementById(t.ej2_instances[0].parentDetails.parentID):t).classList.contains("e-childgrid")||(i=!0);return t},ug.prototype.isNewRowAdded=function(){return this.parent.editSettings&&this.parent.editSettings.showAddNewRow&&!(this.parent.enableInfiniteScrolling||this.parent.enableVirtualization)},ug.prototype.groupRowDDIndicator=function(e,t){Up([e[0]],t,"e-dragleft"),Up(e,t,"e-dragtop","e-dragbottom"),Up([e[e.length-1]],t,"e-dragright")},ug.prototype.refreshRow=function(e,t,i){for(var n=this.parent,r=n.getContentTable().querySelector(j),s=n.getHeaderTable().querySelector(j),o=0,a=e.rows.length;o<a;o++){var l,h=e.rows[parseInt(o.toString(),10)],d=((n.enableVirtualization&&n.allowGrouping&&n.groupSettings.columns.length||n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache)&&1===e.rows.length&&(d=n.getRowElementByUID(h.getAttribute("data-uid")),H.isNullOrUndefined(d)||H.remove(d)),h.querySelector(".e-dragstartrow"));d&&d.classList.remove("e-dragstartrow"),t.insertBefore(h,i),n.allowGrouping&&n.groupSettings.columns.length&&(h=h.getAttribute("data-uid"),l=e.target.parentElement.getAttribute("data-uid"),h=n.getRowObjectFromUID(h),l=n.getRowObjectFromUID(l),h.parentUid!==l.parentUid)&&n.groupModule.groupReorderHandler(h,l)}var p=[].slice.call(n.editSettings.showAddNewRow?t.querySelectorAll(".e-row:not(.e-addedrow)"):t.getElementsByClassName(Ts));if(n.allowGrouping&&n.groupSettings.columns.length?n.groupSettings.enableLazyLoading||n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache&&p.length>3*n.pageSettings.pageSize?n.refresh():(xc(this.parent,e,p),n.enableVirtualization||n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache?Rc(n):Ic(this.parent,n.getRowsObject().filter(function(e){return e.isDataRow}),p,n.pinnedTopRowModels.length),this.parent.notify(Cr,{rows:n.enableVirtualization?this.parent.vRows:this.parent.getRowsObject()})):n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache&&!n.groupSettings.columns.length?p.length>3*n.pageSettings.pageSize?n.refresh():(xc(this.parent,e,p),Rc(n)):this.refreshData(p),this.parent.frozenRows)for(o=0,a=p.length;o<a;o++)(o<this.parent.frozenRows?s:r).appendChild(p[parseInt(o.toString(),10)])},ug.prototype.updateFrozenRowreOrder=function(e){for(var t=this.parent,i=t.getContentTable().querySelector(j),n=t.getHeaderTable().querySelector(j),r=[].slice.call(n.getElementsByClassName(Ts)).concat([].slice.call(i.getElementsByClassName(Ts))),s=t.createElement(j,{attrs:{role:"rowgroup"}}),n=(t.selectionSettings.persistSelection||0!==Object.keys(t.selectionModule.selectedRowState).length?this.parent.clearRowSelection():this.parent.clearSelection(),this.refreshRowTarget(e)),o=0,a=r.length;o<a;o++)s.appendChild(r[parseInt(o.toString(),10)]);this.refreshRow(e,s,n)},ug.prototype.refreshRowTarget=function(e){var t=this.parent,i=parseInt(e.target.parentElement.getAttribute(D),10)-1,n=(t.enableVirtualization&&t.allowGrouping&&t.groupSettings.columns.length&&(i=this.parent.getDataRows().indexOf(e.target.parentElement)),!(e.fromIndex<e.dropIndex||e.fromIndex===e.dropIndex)||t.allowGrouping&&t.groupSettings.columns.length||(i+=1),t.getRowByIndex(i));return i===t.getRows().length&&this.isNewRowAdded()&&"Bottom"===this.parent.editSettings.newRowPosition&&(n=this.parent.element.querySelector(".e-row.e-addedrow")),t.allowGrouping&&t.groupSettings.columns.length&&-1!==i&&e.fromIndex<e.dropIndex&&n?n.nextSibling:n},ug.prototype.updateFrozenColumnreOrder=function(e){var t=this.parent,i=t.getContentTable().querySelector(j),t=(t.selectionSettings.persistSelection||0!==Object.keys(t.selectionModule.selectedRowState).length?this.parent.clearRowSelection():this.parent.clearSelection(),this.refreshRowTarget(e));this.refreshRow(e,i,t)},ug.prototype.refreshData=function(e){for(var t={},i={},n=this.parent.getRowsObject(),r=this.parent.getCurrentViewRecords(),s=this.parent.isRemote(),o=0,a=e.length;o<a;o++){var l=parseInt(e[parseInt(o.toString(),10)].getAttribute(D),10)-1-this.parent.pinnedTopRowModels.length;t[parseInt(o.toString(),10)]=n[parseInt(l.toString(),10)],s||(i[parseInt(o.toString(),10)]=r[parseInt(l.toString(),10)])}for(var h=this.parent.getRows(),o=0,a=e.length;o<a;o++)h[parseInt(o.toString(),10)]=e[parseInt(o.toString(),10)],n[parseInt(o.toString(),10)]=t[parseInt(o.toString(),10)],s||(r[parseInt(o.toString(),10)]=i[parseInt(o.toString(),10)]);Ic(this.parent,n,e,this.parent.pinnedTopRowModels.length),this.parent.selectionModule.setPinnedSelectionIndexes()},ug.prototype.rowOrder=function(e){if(e.dropIndex!==e.fromIndex&&!isNaN(e.dropIndex)&&!I(e.target,"e-groupcaption")){if(this.parent.isDetail()){this.parent.detailCollapseAll();var t=[].slice.call(this.parent.getContentTable().querySelector(j).children),i=this.parent.getRowsObject();t.filter(function(e){e.classList.contains("e-detailrow")&&e.remove()});for(var n=0,r=i.length;n<r&&i[parseInt(n.toString(),10)];n++)i[parseInt(n.toString(),10)].isDetailRow&&(this.parent.getRowsObject().splice(n,1),n--)}if((e.target.classList.contains("e-rowcelldrag")||e.target.classList.contains("e-dtdiagonalright")||e.target.classList.contains("e-dtdiagonaldown"))&&(e.target=e.target.parentElement),!e.target.classList.contains("e-rowcell")&&I(e.target,"e-rowcell")&&(e.target=I(e.target,"e-rowcell")),this.parent.frozenRows?this.updateFrozenRowreOrder(e):this.updateFrozenColumnreOrder(e),(!this.parent.allowGrouping||!this.parent.groupSettings.columns.length)&&0<this.selectedRowColls.length){this.parent.selectRows(this.selectedRowColls);var s=[];if(this.parent.filterSettings.columns.length||this.parent.sortSettings.columns.length){for(n=0,r=e.rows.length;n<r;n++)s.push(parseInt(e.rows[parseInt(n.toString(),10)].getAttribute(D),10)-1);this.selectedRowColls=s}}this.selectedRowColls=[]}},ug.prototype.currentViewData=function(){for(var e=this.parent.getSelectedRowIndexes(),t=[],i=parseInt(this.startedRow.getAttribute(D),10)-1,n=0,r=e.length;n<r;n++)t[parseInt(n.toString(),10)]=this.parent.currentViewData[e[parseInt(n.toString(),10)]];return this.parent.rowDropSettings.targetID||0!==e.length||(t[0]=this.parent.currentViewData[parseInt(i.toString(),10)]),t},ug.prototype.reorderRows=function(e,t){for(var i=this.parent.isRemote(),n=this.parent.getSelectedRowIndexes(),r=[],s=[],o=i?this.parent.getCurrentViewRecords():this.parent.renderModule.data.dataManager.dataSource.json,a=this.parent.allowPaging&&!i?this.parent.pageSettings.currentPage*this.parent.pageSettings.pageSize-this.parent.pageSettings.pageSize:0,l=t+a,h=e[0]+a,d=0,p=e.length;d<p;d++)s[parseInt(d.toString(),10)]=o[e[parseInt(d.toString(),10)]+a];for(d=0,p=n.length;d<p;d++)r[parseInt(d.toString(),10)]=o[n[parseInt(d.toString(),10)]+a];for(d=0,p=s.length;d<p;d++){if(0!==d){for(var c=0,u=o.length;c<u;c++)if(JSON.stringify(o[parseInt(c.toString(),10)])===JSON.stringify(s[parseInt(d.toString(),10)])){h=c;break}for(c=0,u=o.length;c<u;c++)if(JSON.stringify(o[parseInt(c.toString(),10)])===JSON.stringify(s[d-1])){c<h&&(l=c+1);break}}this.reorderRow(h-a,l-a)}this.isRefresh&&this.parent.notify(bt,{type:y,requestType:"rowdraganddrop"});for(d=0,p=r.length;d<p;d++)for(c=0,u=o.length;c<u;c++)if(JSON.stringify(o[parseInt(c.toString(),10)])===JSON.stringify(r[parseInt(d.toString(),10)])){n[parseInt(d.toString(),10)]=c-a;break}this.selectedRowColls=n},ug.prototype.stopTimer=function(){window.clearInterval(this.timer)},ug.prototype.onActionComplete=function(e){this.parent.trigger(c,H.extend(e,{type:c,requestType:"rowdraganddrop"}))},ug.prototype.initializeDrag=function(){var e=this.parent;this.draggable=new H.Draggable(e.element,{dragTarget:".e-rowcelldrag, .e-rowdragdrop, .e-rowcell:not(."+ys+")",distance:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop,isReplaceDragEle:this.isReplaceDragEle,isPreventSelect:!1,isPreventScroll:!0})},ug.prototype.updateScrollPostion=function(e){var t,i,n=this,e=Cp(e).y,r=this.isDropGrid.getContent().getBoundingClientRect(),s=this.isDropGrid.getRowHeight()-15,o=this.isDropGrid.getContent().firstElementChild,a=this.parent.enableVirtualization?20:0;r.top>=e?(t=-this.isDropGrid.getRowHeight(),this.isOverflowBorder=!1,this.timer=window.setInterval(function(){n.setScrollDown(o,t)},200)):r.top+this.isDropGrid.getContent().clientHeight-s-33-a<=e&&(i=this.isDropGrid.getRowHeight(),this.isOverflowBorder=!1,this.timer=window.setInterval(function(){n.setScrollDown(o,i)},200))},ug.prototype.setScrollDown=function(e,t){e.scrollTop=e.scrollTop+t},ug.prototype.moveDragRows=function(e,t,i){var n=this.parent.element.querySelector(".e-cloneproperties"),r=(this.parent.element.classList.contains("e-childgrid")&&(n=this.getParentGrid(this.parent.element).querySelector(".e-cloneproperties")),H.closest(e.target,"tr"));I(r,"e-grid")&&(!this.parent.rowDropSettings.targetID&&I(n.parentElement,"e-grid").id===I(r,"e-grid").id||this.istargetGrid)&&this.setBorder(r||t,e.event,t,i)},ug.prototype.setBorder=function(e,t,i,n){var r,s=this.parent.element,o=(this.istargetGrid&&(s=this.isDropGrid.element),this.parent.element.querySelector(".e-cloneproperties"));this.parent.allowGrouping&&this.parent.groupSettings.columns.length?this.removeBorder(e):(this.removeFirstRowBorder(e),this.removeLastRowBorder(e)),I(e,"e-grid")&&e.classList.contains(Ts)&&(!this.parent.rowDropSettings.targetID&&I(o.parentElement,"e-grid").id===I(e,"e-grid").id||this.istargetGrid)&&(this.parent.allowGrouping&&this.parent.groupSettings.columns&&this.parent.groupSettings.columns.length?H.removeClass(s.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"),["e-dragtop","e-dragright","e-dragbottom","e-dragleft"]):H.removeClass(s.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"),["e-dragborder"]),o=[],r=parseInt(n.getAttribute(D),10)-1,!n||0!==r||this.isNewRowAdded()&&"Top"===this.parent.editSettings.newRowPosition?o=this.parent.rowDropSettings.targetID&&n?(e=this.isDropGrid.getRowByIndex(r-1),[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))):n&&parseInt(i.getAttribute(D),10)-1>r?(this.parent.enableVirtualization&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&(r=this.parent.getDataRows().indexOf(n)),this.parent.allowGrouping&&this.parent.groupSettings.columns.length?[].slice.call((e=n).querySelectorAll(".e-groupcaption,.e-summarycell,.e-rowcell:not(.e-hide),.e-rowdragdrop:not(.e-hide),\n .e-detailrowcollapse:not(.e-hide)")):(e=0===r&&this.isNewRowAdded()&&"Top"===this.parent.editSettings.newRowPosition?this.parent.element.querySelector(".e-row.e-addedrow tr"):this.parent.getRowByIndex(r-1),[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse,.e-dragindentcell")))):[].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")):this.parent.allowGrouping&&this.parent.groupSettings.columns.length?o=[].slice.call((e=n).querySelectorAll(".e-groupcaption,.e-summarycell,.e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")):(i=this.parent.createElement("div",{className:"e-firstrow-dragborder"}),(r=this.isDropGrid.getHeaderContent()).classList.add("e-grid-relative"),i.style.width=s.offsetWidth-this.getScrollWidth()+"px",r.getElementsByClassName("e-firstrow-dragborder").length||(this.parent.frozenRows?(this.parent.isFrozenGrid()&&(i.style.width=this.parent.getContent().firstElementChild.scrollWidth+"px"),r.querySelector("thead").appendChild(i),i.style.position="relative"):r.appendChild(i))),0<o.length)&&(this.parent.allowGrouping&&this.parent.groupSettings.columns&&this.parent.groupSettings.columns.length?this.groupRowDDIndicator(o,!0):Up(o,!0,"e-dragborder"))},ug.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?hh.getScrollBarWidth():0},ug.prototype.removeFirstRowBorder=function(e){0<this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder").length&&e&&(0!==e.rowIndex||e.classList.contains("e-columnheader"))?H.remove(this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder")[0]):(e=this.parent.element.querySelector(".e-row.e-addedrow tr"))&&e.querySelector(".e-dragborder")&&Up([].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse,.e-dragindentcell")),!1,"e-dragborder")},ug.prototype.removeLastRowBorder=function(e){var t;t=this.parent.enableVirtualization?e&&parseInt(e.getAttribute(D),10)-1!=this.parent.renderModule.data.dataManager.dataSource.json.length-1:(t=this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&!this.parent.groupSettings.enableLazyLoading?this.parent.pageSettings.currentPage*this.parent.pageSettings.pageSize-1:this.parent.getCurrentViewRecords().length-1,t=this.parent.getRowByIndex(t),e&&t&&t.getAttribute("data-uid")!==e.getAttribute("data-uid")),0<this.parent.element.getElementsByClassName("e-lastrow-dragborder").length&&e&&t&&H.remove(this.parent.element.getElementsByClassName("e-lastrow-dragborder")[0])},ug.prototype.removeBorder=function(e){var t,i,n=this;this.removeFirstRowBorder(e),this.parent.rowDropSettings.targetID||this.removeLastRowBorder(e),this.parent.allowGrouping&&this.parent.groupSettings.columns.length?(i=[].slice.call(this.isDropGrid.getContentTable().querySelectorAll("tr")).filter(function(e){return e.querySelector("td.e-dragtop.e-dragbottom")}),0<this.parent.frozenRows&&(t=[].slice.call(this.isDropGrid.getHeaderTable().querySelectorAll("tr")).filter(function(e){return e.querySelector("td.e-dragtop.e-dragbottom")}),i=i.concat(t)),i.forEach(function(e){e=[].slice.call(e.querySelectorAll(".e-dragtop.e-dragbottom"));0<e.length&&n.groupRowDDIndicator(e,!1)})):(e=this.isDropGrid.getRows().filter(function(e){return e.querySelector("td.e-dragborder")})[0])&&Up([].slice.call(e.getElementsByClassName("e-dragborder")),!1,"e-dragborder")},ug.prototype.getElementFromPosition=function(e,t){t=Cp(t),e.style.display="none",t=document.elementFromPoint(t.x,t.y);return e.style.display="",t},ug.prototype.onDataBound=function(){0<this.selectedRowColls.length&&(this.parent.enableVirtualization||this.parent.allowRowDragAndDrop)&&(this.parent.selectRows(this.selectedRowColls),this.selectedRowColls=[])},ug.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute(D),10)-1:0},ug.prototype.singleRowDrop=function(e){var t=H.closest(e.target,"tr"),e=e.droppedElement.parentElement.ej2_instances[0],t=t?t.rowIndex:e.currentViewData.length-1;this.reorderRow(this.startedRowIndex,t)},ug.prototype.columnDrop=function(e){var t=this.parent;if("grouping"!==e.droppedElement.getAttribute("action")&&(I(e.target,Ts)||I(e.target,"e-emptyrow")||I(e.target,vs))){var i=H.closest(e.target,"tr"),n=void 0,r=document.querySelector(".e-drag-ref");if(!("true"!==e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&(e.droppedElement.parentElement.id===t.element.id||r&&r.parentElement.id===t.element.id)||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow")&&e.droppedElement.parentElement.id!==t.element.id)){if(e.droppedElement.parentElement.id!==t.element.id)r?(n=r.parentElement.ej2_instances[0],H.remove(r)):n=e.droppedElement.parentElement.ej2_instances[0];else if(this.isSingleRowDragDrop||"true"===e.droppedElement.querySelector("tr").getAttribute("single-dragrow"))return void this.singleRowDrop(e);if(n.element.id===t.element.id||n.rowDropSettings.targetID===t.element.id){var r=n.getSelectedRecords(),i=this.getTargetIdx(i),s=(e.target&&e.target.classList.contains("e-content")&&t.getCurrentViewRecords().length&&(e=t.getContentTable().querySelector("tr:last-child"))&&(i=parseInt(e.getAttribute(D),10)),isNaN(i)&&(i=0),t.allowPaging&&(i=i+t.pageSettings.currentPage*t.pageSettings.pageSize-t.pageSettings.pageSize),t.notify(Yt,{toIndex:i,records:r}),t.notify(bt,{type:y,requestType:"rowdraganddrop"}),n.getSelectedRowIndexes()),o=n.allowPaging?n.pageSettings.currentPage*n.pageSettings.pageSize-n.pageSettings.pageSize:0;this.selectedRows=[];for(var a=0,l=r.length;a<l;a++)this.selectedRows.push(o+s[parseInt(a.toString(),10)]);n.notify($t,{indexes:this.selectedRows,records:r}),n.dataSource instanceof V.DataManager&&n.dataSource.dataSource.offline&&n.notify(bt,{type:y,requestType:"rowdraganddrop"})}}}},ug.prototype.reorderRow=function(e,t){var i,n=this.parent;n.groupSettings.columns.length||(t+=i=n.allowPaging&&!this.parent.isRemote()?n.pageSettings.currentPage*n.pageSettings.pageSize-n.pageSettings.pageSize:0,this.selectedRows=n.getSelectedRowIndexes(),n.notify(rn,{fromIndex:e+i,toIndex:t}))},ug.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.initializeDrag()},ug.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+ms)||e.querySelector("."+vs))&&(this.draggable.destroy(),this.parent.off(mt,this.initializeDrag),this.parent.off(xe,this.columnDrop),this.parent.off(Mt,this.onActionComplete),this.parent.removeEventListener(de,this.onDataBoundFn),this.parent.off(St,this.enableAfterRender),this.parent.off(s,this.destroy))},ug.prototype.getModuleName=function(){return"rowDragAndDrop"},ug.prototype.processArgs=function(e){var t=this.parent,i=parseInt(this.startedRow.getAttribute(D),10)-1;0<t.getSelectedRecords().length&&!1===this.startedRow.cells[0].classList.contains("e-selectionbackground")||0===t.getSelectedRecords().length?(t.enableVirtualization||t.enableInfiniteScrolling&&t.infiniteScrollSettings.enableCache?this.rows=[this.startedRow]:this.rows=[t.getRowByIndex(i)],this.rowData=[t.getRowInfo(this.startedRow.querySelector("."+b)).rowData],(t.enableVirtualization||t.enableInfiniteScrolling&&t.infiniteScrollSettings.enableCache)&&t.allowGrouping&&t.groupSettings.columns.length&&t.getSelectedRows().length&&(this.rows=t.getSelectedRows(),this.rowData=Array.from(this.rows,function(e){return t.getRowObjectFromUID(e.getAttribute("data-uid")).data}))):(this.rows=t.getSelectedRows(),this.rowData=Array.from(this.rows,function(e){return t.getRowObjectFromUID(e.getAttribute("data-uid")).data}))};uh=ug;function ug(e){var d=this;this.selectedRows=[],this.isOverflowBorder=!0,this.selectedRowColls=[],this.isRefresh=!0,this.isReplaceDragEle=!0,this.istargetGrid=!1,this.helper=function(e){var t=d.parent,i=d.draggable.currentStateTarget,n=(H.isNullOrUndefined(i)||!t.rowDropSettings.targetID||H.isNullOrUndefined(i.classList)||i.classList.contains("e-rowcell")||(i=I(i,"e-rowcell")),d.parent.createElement("div",{className:"e-cloneproperties e-draganddrop e-grid e-dragclone"})),r=(n.style.height="auto",d.parent.createElement("table",{attrs:{role:"grid"}})),s=d.parent.createElement(j,{attrs:{role:"rowgroup"}});if(document.getElementsByClassName("e-griddragarea").length||t.rowDropSettings.targetID&&(!H.isNullOrUndefined(i)&&!i.classList.contains("e-selectionbackground")&&"Single"!==t.selectionSettings.type||!I(i,"e-rowcell"))||!t.rowDropSettings.targetID&&!I(i,"e-rowdragdrop"))return!1;if(t.rowDropSettings.targetID&&"Row"===t.selectionSettings.mode&&"Single"===t.selectionSettings.type&&t.selectRow(parseInt(d.draggable.currentStateTarget.parentElement.getAttribute(D),10)-1),d.startedRow=H.closest(i,"tr").cloneNode(!0),d.parent.isFrozenGrid())for(var o=[].slice.call(d.startedRow.querySelectorAll(".e-rowcell")),a=0;a<o.length;a++)H.removeClass([o[parseInt(a.toString(),10)]],["e-leftfreeze","e-freezeleftborder","e-fixedfreeze","e-freezerightborder","e-rightfreeze","e-unfreeze"]),o[parseInt(a.toString(),10)].removeAttribute("style");d.processArgs(i);var l={selectedRow:d.rows,dragelement:i,cloneElement:n,cancel:!1,data:d.rowData},h=t.getSelectedRows();t.trigger(De,l);if(l.cancel)return!1;Sp(d.startedRow,".e-indentcell"),Sp(d.startedRow,".e-detailrowcollapse"),Sp(d.startedRow,".e-detailrowexpand"),Sp(d.startedRow,"."+ys),t.enableInfiniteScrolling&&t.infiniteScrollSettings.enableCache||d.removeCell(d.startedRow,Es);d.startedRow.querySelectorAll(".e-active").forEach(function(e){return e.classList.remove("e-active")}),s.appendChild(d.startedRow),1<t.getSelectedRowIndexes().length&&d.startedRow.hasAttribute("aria-selected")&&(l=d.parent.createElement("span",{className:"e-dropitemscount",innerHTML:""+h.length}),n.appendChild(l));h=H.closest(i,"tr").querySelector(".e-icon-rowdragicon");return h&&h.classList.add("e-dragstartrow"),r.appendChild(s),n.appendChild(r),t.element.appendChild(n),n},this.dragStart=function(e){var t,i,n=d.parent;if((n.enableVirtualization||n.infiniteScrollSettings.enableCache)&&n.allowGrouping&&n.groupSettings.columns.length&&!H.isNullOrUndefined(e.target.closest("tr")))for(var r=e.dragElement.querySelectorAll("tr"),s=e.target.closest("tr").querySelectorAll(".e-indentcell"),o=0;o<r.length;o++)for(var a=0;a<s.length;a++){var l=s[parseInt(a.toString(),10)].cloneNode(!0);r[parseInt(o.toString(),10)].insertBefore(l,r[parseInt(o.toString(),10)].firstElementChild)}n.element.classList.contains("e-childgrid")&&(d.getParentGrid(n.element).appendChild(e.dragElement),n.element.appendChild(n.createElement("div",{className:"e-drag-ref"}))),document.body.classList.add("e-prevent-select"),document.getElementsByClassName("e-griddragarea").length||(t=e.target,i=d.parent.element.querySelector(".e-dropitemscount"),1<d.parent.getSelectedRecords().length&&i&&(i.style.left=d.parent.element.querySelector(".e-cloneproperties table").offsetWidth-5+"px"),d.processArgs(t),n.trigger(Te,{rows:d.rows,target:e.target,draggableType:"rows",fromIndex:parseInt(d.rows[0].getAttribute(D),10)-1,data:d.rowData[0]&&0<Object.keys(d.rowData[0]).length?d.rowData:d.currentViewData()}),d.dragStartData=d.rowData,i=document.getElementById(n.rowDropSettings.targetID),n.rowDropSettings.targetID&&i&&i.ej2_instances&&"grid"===i.ej2_instances[0].getModuleName()&&i.ej2_instances[0].getContent().classList.add("e-allowRowDrop"))},this.drag=function(e){var t,i,n=d.parent,r=(d.isDropGrid=d.parent,d.istargetGrid=!1,d.parent.rowDropSettings.targetID&&(r=document.getElementById(n.rowDropSettings.targetID),d.isDropGrid=r.ej2_instances[0],I(e.target,"e-grid"))&&(d.istargetGrid=d.parent.rowDropSettings.targetID===I(e.target,"e-grid").id),d.parent.element.querySelector(".e-cloneproperties")),s=(n.element.classList.contains("e-childgrid")&&(r=d.getParentGrid(n.element).querySelector(".e-cloneproperties")),d.getElementFromPosition(r,e.event)),o=(H.classList(r,["e-defaultcur"],["e-notallowedcur","e-movecur","e-grabcur"]),d.isOverflowBorder=!0,d.hoverState=n.enableHover,I(s,"e-grid")?H.closest(e.target,"tr"):null);e.target&&(d.processArgs(s),n.enableVirtualization&&H.isNullOrUndefined(d.rows[0])&&H.classList(r,["e-notallowedcur"],["e-movecur"]),i={rows:d.rows,target:s,draggableType:"rows",data:d.rowData,originalEvent:e,cancel:!1},n.trigger(Ee,i),d.stopTimer(),i.cancel||(n.element.classList.add("e-rowdrag"),o&&(I(s,"e-grid").id===r.parentElement.id||I(s,"e-grid").id)?d.isDropGrid.element.querySelector(".e-emptyrow")?d.dragTarget=0:d.dragTarget=parseInt(o.getAttribute("aria-rowindex"),10)-1:d.dragTarget=parseInt(d.startedRow.getAttribute("aria-rowindex"),10)-1,n.rowDropSettings.targetID?(i=document.querySelector(".e-drag-ref"),!I(s,"e-grid")||i&&I(i.parentElement,"e-grid").id===I(s,"e-grid").id||I(r.parentElement,"e-grid").id===I(s,"e-grid").id?H.classList(r,["e-notallowedcur"],["e-defaultcur"]):H.classList(r,["e-grabcur"],["e-notallowedcur"])):(i=I(s,"e-grid"))&&i.id===r.parentElement.id&&I(s,"e-row")&&!I(s,"e-addedrow")?H.classList(r,["e-movecur"],["e-defaultcur"]):H.classList(r,["e-notallowedcur"],["e-movecur"]),I(d.isDropGrid.element,"e-grid")&&(d.isDropGrid.groupSettings.columns.length&&!d.isDropGrid.groupSettings.columns.length||d.isDropGrid.element.querySelector(".e-emptyrow")||(I(s,"e-grid")&&I(s,"e-grid").id===d.isDropGrid.element.id&&d.updateScrollPostion(e.event),(d.isOverflowBorder||d.parent.frozenRows>d.dragTarget)&&(parseInt(d.startedRow.getAttribute(D),10)-1!==d.dragTarget||d.istargetGrid)||d.istargetGrid&&o&&d.isDropGrid.getRowByIndex(d.isDropGrid.getCurrentViewRecords().length-1).getAttribute("data-uid")===o.getAttribute("data-uid")?d.moveDragRows(e,d.startedRow,o):(i=void 0,d.parent.enableVirtualization||d.parent.enableDomVirtualization?i=o&&parseInt(o.getAttribute(D),10)-1==d.parent.renderModule.data.dataManager.dataSource.json.length-1:(t=d.parent.enableInfiniteScrolling&&d.parent.infiniteScrollSettings.enableCache&&!d.parent.groupSettings.enableLazyLoading?d.parent.pageSettings.currentPage*d.parent.pageSettings.pageSize-1:d.parent.getCurrentViewRecords().length-1,r=d.parent.getRowByIndex(t),i=o&&r&&r.getAttribute("data-uid")===o.getAttribute("data-uid")&&r.getAttribute("data-uid")!==d.startedRow.getAttribute("data-uid"),d.isNewRowAdded()&&"Bottom"===d.parent.editSettings.newRowPosition&&(i=!1)),i&&!d.parent.rowDropSettings.targetID&&(e=d.parent.createElement("div",{className:"e-lastrow-dragborder"}),r=d.parent.getContent(),e.style.width=d.parent.element.offsetWidth-d.getScrollWidth()+"px",(d.parent.enableVirtualization||d.parent.enableDomVirtualization)&&(e.style.zIndex="1"),r.getElementsByClassName("e-lastrow-dragborder").length||n.allowGrouping&&n.groupSettings.columns.length&&!H.isNullOrUndefined(o.nextSibling)||(r.classList.add("e-grid-relative"),r.appendChild(e),e.style.bottom=d.getScrollWidth()+"px")),d.removeBorder(o))),s)&&s.classList.contains(xs)&&!d.isDropGrid.element.querySelector(".e-emptyrow")&&d.istargetGrid&&(d.removeBorder(o),t=d.isDropGrid.getCurrentViewRecords().length-1,i=[],0<(i=d.parent.allowGrouping&&d.parent.groupSettings.columns&&d.parent.groupSettings.columns.length?[].slice.call(d.isDropGrid.getRowByIndex(t).querySelectorAll(".e-rowcell:not(.e-hide),.e-rowdragdrop:not(.e-hide),.e-detailrowcollapse:not(.e-hide)")):[].slice.call(d.isDropGrid.getRowByIndex(t).querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"))).length)&&(d.parent.allowGrouping&&d.parent.groupSettings.columns&&d.parent.groupSettings.columns.length?d.groupRowDDIndicator(i,!0):Up(i,!0,"e-dragborder"))))},this.dragStop=function(e){d.parent.isCheckBoxSelection&&d.parent.enableInfiniteScrolling&&window.getSelection().removeAllRanges(),document.body.classList.remove("e-prevent-select"),Bp(d.parent)?d.parent.notify(ci,{instance:d,handler:d.processDragStop,arg1:e}):d.processDragStop(e)},this.processDragStop=function(t){var i,e,n,r,s=d.parent;d.parent.isDestroyed||(n=d.getElementFromPosition(t.helper,t.event),i=n&&!n.classList.contains("e-dlg-overlay")?n:t.target,s.element.classList.remove("e-rowdrag"),e=document.getElementById(s.rowDropSettings.targetID),s.rowDropSettings.targetID&&e&&e.ej2_instances&&"grid"===e.ej2_instances[0].getModuleName()&&e.ej2_instances[0].getContent().classList.remove("e-allowRowDrop"),I(d.isDropGrid.element,"e-grid")&&(d.stopTimer(),d.isDropGrid.enableHover=d.hoverState,d.isDropGrid.getContent().classList.remove("e-grid-relative"),d.removeBorder(n),e=d.isDropGrid.element.querySelector(".e-dragstartrow"))&&e.classList.remove("e-dragstartrow"),d.processArgs(i),s.enableVirtualization&&H.isNullOrUndefined(d.rows[0]))||(n=d.rows[0]||d.startedRow,r={target:i,draggableType:"rows",cancel:!1,fromIndex:parseInt(n.getAttribute(D),10)-1,dropIndex:d.dragTarget,rows:d.rows[0]?d.rows:[d.startedRow],data:0<Object.keys(d.dragStartData[0]).length?d.dragStartData:d.currentViewData()},s.trigger(Oe,r,function(){var e;!(I(i,Ts)||I(i,"e-emptyrow")||I(i,vs))||r.cancel||d.parent.pinnedTopRowModels.length&&I(i,Cs)||s.isRowNonDeselectable&&"Check"===s.checkAllRows?(d.dragTarget=null,H.remove(t.helper)):(d.isRefresh=!1,e=d.parent.getSelectedRowIndexes(),s.isRowDragable()&&(!d.parent.rowDropSettings.targetID&&d.startedRow.querySelector("td.e-selectionbackground")&&1<e.length&&e.length!==d.parent.getCurrentViewRecords().length?d.reorderRows(e,r.dropIndex):d.reorderRows([parseInt(d.startedRow.getAttribute(D),10)-1],d.dragTarget),d.dragTarget=null,s.rowDropSettings.targetID||(t.helper.classList.contains("e-cloneproperties")&&document.querySelector("."+t.helper.classList[0])&&H.remove(t.helper),!s.enableVirtualization||s.sortSettings.columns.length||s.filterSettings.columns.length||d.parent.allowGrouping&&s.groupSettings.columns.length?s.enableDomVirtualization?s.refresh():d.rowOrder(r):(s.refresh(),s.contentModule.vgenerator.startIndex=null)),d.parent.getContentTable().scrollHeight<d.parent.getContent().clientHeight)&&d.parent.scrollModule.setLastRowCell(),d.isRefresh=!0)}))},this.removeCell=function(t,i){return[].slice.call(t.querySelectorAll("td")).filter(function(e){e.classList.contains(i)&&t.deleteCell(e.cellIndex)})},H.initializeTelemetryFeature("RowDD","DataGrid"),this.parent=e,this.parent.isDestroyed||(this.parent.on(mt,this.initializeDrag,this),this.parent.on(xe,this.columnDrop,this),this.parent.on(Mt,this.onActionComplete,this),this.onDataBoundFn=this.onDataBound.bind(this),this.parent.addEventListener(de,this.onDataBoundFn),this.parent.on(St,this.enableAfterRender,this),this.parent.on(s,this.destroy,this))}g.prototype.addLabel=function(){var e;this.element.getElementsByClassName("e-group-animator").length||(e=this.l10n.getConstant("GroupDropArea"),this.element.innerHTML=e,this.element.classList.remove("e-grouped"))},g.prototype.rearrangeGroup=function(){this.sortRequired=!1,this.updateModel()},g.prototype.columnDrag=function(e){this.groupSettings.allowReordering&&e.column.allowGrouping&&this.animateDropper(e);var t=this.parent.element.querySelector(".e-cloneproperties");this.parent.allowReordering||H.classList(t,["e-defaultcur"],["e-notallowedcur"]),e.column.allowGrouping&&(I(e.target,"e-groupdroparea")||I(e.target,"e-headercell")&&I(e.target,"e-headercell").isEqualNode(this.parent.getColumnHeaderByField(e.column.field)))||this.parent.allowReordering&&I(e.target,"e-headercell")||H.classList(t,["e-notallowedcur"],["e-defaultcur"]),e.target.classList.contains("e-groupdroparea")?this.element.classList.add("e-hover"):this.element.classList.remove("e-hover")},g.prototype.columnDragStart=function(e){var t;e.target.classList.contains("e-stackedheadercell")||(t=this.parent.element.querySelector(".e-groupdroparea"),this.aria.setDropTarget(t,e.column.allowGrouping),t=e.target.classList.contains("e-headercell")?e.target:I(e.target,"e-headercell"),this.aria.setGrabbed(t,!0,!e.column.allowGrouping))},g.prototype.columnDrop=function(e){var t=this.parent;"grouping"===e.droppedElement.getAttribute("action")&&(e=t.getColumnByUid(e.droppedElement.getAttribute("data-mappinguid")),H.isNullOrUndefined(e)||!1===e.allowGrouping||I(t.getColumnHeaderByUid(e.uid),"e-grid").getAttribute("id")!==t.element.getAttribute("id")||this.ungroupColumn(e.field))},g.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(St,this.enableAfterRender,this),this.parent.on(kt,this.onActionComplete,this),this.parent.on(Pt,this.onActionComplete,this),this.parent.on(wt,this.onPropertyChanged,this),this.parent.on(_t,this.clickHandler,this),this.parent.on(Re,this.columnDrag,this),this.parent.on(Ie,this.columnDragStart,this),this.parent.on(Jt,this.columnDrop,this),this.parent.on(xe,this.columnDrop,this),this.parent.on(Rt,this.refreshSortIcons,this),this.parent.on(Dt,this.refreshSortIcons,this),this.parent.on(Gt,this.keyPressHandler,this),this.parent.on(vt,this.initialEnd,this),this.parent.on(Ct,this.initialEnd,this),this.parent.on(mt,this.render,this),this.parent.on(Lt,this.onGroupAggregates,this),this.parent.on(s,this.destroy,this),this.parent.on("group-expand-collapse",this.updateExpand,this),this.parent.on("persist-data-changed",this.initialEnd,this))},g.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(mt,this.render),this.parent.off(St,this.enableAfterRender),this.parent.off(kt,this.onActionComplete),this.parent.off(Pt,this.onActionComplete),this.parent.off(wt,this.onPropertyChanged),this.parent.off(_t,this.clickHandler),this.parent.off(Re,this.columnDrag),this.parent.off(Ie,this.columnDragStart),this.parent.off(xe,this.columnDrop),this.parent.off(Jt,this.columnDrop),this.parent.off(Rt,this.refreshSortIcons),this.parent.off(Dt,this.refreshSortIcons),this.parent.off(Gt,this.keyPressHandler),this.parent.off(Lt,this.onGroupAggregates),this.parent.off(s,this.destroy),this.parent.off("group-expand-collapse",this.updateExpand))},g.prototype.initialEnd=function(){var e=this.parent;if(this.parent.off(vt,this.initialEnd),this.parent.off(Ct,this.initialEnd),this.parent.getColumns().length&&this.groupSettings.columns.length){this.contentRefresh=!1;for(var t=0,i=e.groupSettings.columns;t<i.length;t++){var n=i[t];this.preventFocusOnGroup=!0,this.groupColumn(n),this.preventFocusOnGroup=!1}this.contentRefresh=!0}},g.prototype.keyPressHandler=function(e){var t=this.parent;if(e.target&&I(e.target,"e-groupheadercell")&&("tab"===e.action||"shiftTab"===e.action)){var i=this.getFocusableGroupedItems();if("tab"===e.action&&e.target===i[i.length-1]||"shiftTab"===e.action&&e.target===i[0])return;for(var n,r=0;r<i.length;r++)if(e.target===i[parseInt(r.toString(),10)])return e.preventDefault(),n="tab"===e.action?r+1:r-1,void i[parseInt(n.toString(),10)].focus()}var s=/(Mac)/i.test(navigator.platform);if(s&&e.metaKey&&("downArrow"===e.action?e.action="ctrlDownArrow":"upArrow"===e.action&&(e.action="ctrlUpArrow")),("ctrlSpace"===e.action||"ctrlEnter"===e.action||this.groupSettings.columns.length&&-1!==["altDownArrow","altUpArrow","ctrlDownArrow","ctrlUpArrow","enter"].indexOf(e.action))&&(!this.parent.groupSettings.enableLazyLoading||!this.groupSettings.columns.length||"ctrlUpArrow"!==e.action&&"ctrlDownArrow"!==e.action))switch(e.action){case"altDownArrow":case"altUpArrow":var o=t.allowSelection?t.getSelectedRowIndexes():[];if(o.length){e.preventDefault();for(var a=t.getContentTable().querySelector(j).children,l=void 0,r=t.getDataRows()[o[o.length-1]].rowIndex;0<=r;r--)if(!a[parseInt(r.toString(),10)].classList.contains(Ts)&&!a[parseInt(r.toString(),10)].classList.contains("e-detailrow")){l=a[parseInt(r.toString(),10)];break}this.expandCollapseRows(l.querySelector("altUpArrow"===e.action?".e-recordplusexpand":".e-recordpluscollapse"))}break;case"ctrlDownArrow":e.preventDefault(),this.expandAll();break;case"ctrlUpArrow":e.preventDefault(),this.collapseAll();break;case"ctrlEnter":e.target.classList.contains("e-groupsort")&&(this.groupSortFocus=!0,e.preventDefault(),h=e.ctrlKey||-1!==navigator.userAgent.indexOf("Mac OS")&&e.metaKey,this.applySortFromTarget(e.target,h));break;case"enter":e.target.classList.contains("e-groupsort")?(this.groupSortFocus=!0,e.preventDefault(),h=e.ctrlKey||-1!==navigator.userAgent.indexOf("Mac OS")&&e.metaKey,this.applySortFromTarget(e.target,h)):e.target.classList.contains("e-ungroupbutton")?(this.groupCancelFocus=!0,e.preventDefault(),this.unGroupFromTarget(e.target)):this.parent.isEdit||null!==H.closest(e.target,"#"+this.parent.element.id+"_searchbar")||I(e.target,"e-pager")||I(e.target,"e-toolbar")||(h=(o=(o=this.focus.getFocusedElement())&&(o.classList.contains("e-icon-grightarrow")||o.classList.contains("e-icon-gdownarrow"))?o.parentElement:o)&&o.parentElement?o.parentElement.querySelector('[class^="e-record"]'):null)&&o.children.length&&(o.children[0].classList.contains("e-icon-grightarrow")||o.children[0].classList.contains("e-icon-gdownarrow"))&&(e.preventDefault(),this.expandCollapseRows(h));break;case"ctrlSpace":var h,o=t.focusModule.currentInfo.element;o&&o.classList.contains("e-headercell")&&(e.preventDefault(),(h=t.getColumnByUid(o.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"))).field&&t.groupSettings.columns.indexOf(h.field)<0?this.groupColumn(h.field):this.ungroupColumn(h.field))}},g.prototype.getFocusableGroupedItems=function(){var e=[];if(this.groupSettings.columns.length)for(var t=this.element.querySelectorAll(".e-groupheadercell"),i=0;i<t.length;i++)e.push(t[parseInt(i.toString(),10)].querySelector(".e-grouptext")),e.push(t[parseInt(i.toString(),10)].querySelector(".e-groupsort")),e.push(t[parseInt(i.toString(),10)].querySelector(".e-ungroupbutton"));return e},g.prototype.wireEvent=function(){H.EventHandler.add(this.element,"focusin",this.onFocusIn,this),H.EventHandler.add(this.element,"focusout",this.onFocusOut,this),H.EventHandler.add(this.parent.element,"auxclick",this.auxilaryclickHandler,this)},g.prototype.unWireEvent=function(){H.EventHandler.remove(this.element,"focusin",this.onFocusIn),H.EventHandler.remove(this.element,"focusout",this.onFocusOut),H.EventHandler.remove(this.parent.element,"auxclick",this.auxilaryclickHandler)},g.prototype.onFocusIn=function(e){this.parent.focusModule.currentInfo&&this.parent.focusModule.currentInfo.element&&(H.removeClass([this.parent.focusModule.currentInfo.element,this.parent.focusModule.currentInfo.elementToFocus],["e-focused","e-focus"]),this.parent.focusModule.currentInfo.element.tabIndex=-1),this.addOrRemoveFocus(e)},g.prototype.onFocusOut=function(e){this.addOrRemoveFocus(e)},g.prototype.addOrRemoveFocus=function(e){var t;(e.target.classList.contains("e-groupdroparea")||e.target.classList.contains("e-grouptext")||e.target.classList.contains("e-groupsort")||e.target.classList.contains("e-ungroupbutton"))&&(t=e.target.classList.contains("e-grouptext")?e.target.parentElement.parentElement:e.target,"focusin"===e.type?(this.parent.focusModule.currentInfo.element=e.target,this.parent.focusModule.currentInfo.elementToFocus=e.target,H.addClass([t],["e-focused","e-focus"]),e.target.tabIndex=0):(H.removeClass([t],["e-focused","e-focus"]),e.target.tabIndex=-1))},g.prototype.clickHandler=function(e){e.target.classList.contains("e-grouptext")&&(this.groupTextFocus=!0),e.target.classList.contains("e-groupsort")&&(this.groupSortFocus=!0),e.target.classList.contains("e-ungroupbutton")&&(this.groupCancelFocus=!0),(e.target.classList.contains("e-icon-grightarrow")||e.target.classList.contains("e-icon-gdownarrow"))&&e.preventDefault();var t=I(e.target,"e-recordplusexpand")||I(e.target,"e-recordpluscollapse"),t=(t&&(t.children[0].classList.contains("e-icon-gdownarrow")||t.children[0].classList.contains("e-icon-grightarrow"))&&this.expandCollapseRows(e.target),e.ctrlKey||-1!==navigator.userAgent.indexOf("Mac OS")&&e.metaKey);this.applySortFromTarget(e.target,t),this.unGroupFromTarget(e.target),this.toogleGroupFromHeader(e.target)},g.prototype.auxilaryclickHandler=function(e){(e.target.classList.contains("e-icon-grightarrow")||e.target.classList.contains("e-icon-gdownarrow")&&1===e.button)&&e.preventDefault()},g.prototype.unGroupFromTarget=function(e){e.classList.contains("e-ungroupbutton")&&this.ungroupColumn(e.parentElement.getAttribute("data-mappingname"))},g.prototype.toogleGroupFromHeader=function(e){this.groupSettings.showToggleButton&&(e.classList.contains("e-grptogglebtn")?e.classList.contains("e-toggleungroup")?this.ungroupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("data-mappinguid")).field):this.groupColumn(this.parent.getColumnByUid(e.parentElement.getAttribute("data-mappinguid")).field):e.classList.contains("e-toggleungroup")&&this.ungroupColumn(e.parentElement.getAttribute("data-mappingname")))},g.prototype.applySortFromTarget=function(e,t){var i=this.parent,n=H.closest(e,".e-groupheadercell");i.allowSorting&&n&&!e.classList.contains("e-ungroupbutton")&&!e.classList.contains("e-toggleungroup")&&(e=n.firstElementChild.getAttribute("data-mappingname"),i.getColumnHeaderByField(e).getElementsByClassName("e-ascending").length?i.sortColumn(e,"Descending",!!H.isNullOrUndefined(t)||t):i.sortColumn(e,"Ascending",!!H.isNullOrUndefined(t)||t))},g.prototype.expandCollapseRows=function(e){var t=I(e,"e-recordplusexpand")||I(e,"e-recordpluscollapse");if(t){var i=[].slice.call(this.parent.getContentTable().querySelector(j).children),n=(this.parent.editSettings.showAddNewRow&&(i[0].classList.contains("e-addedrow")?i.shift():i[i.length-1].classList.contains("e-addedrow")&&i.pop()),void 0),r=this.parent,s=t.parentElement.getElementsByClassName("e-indentcell").length,o=t.parentElement.getAttribute("data-uid"),a=r.getRowObjectFromUID(o),l=!1;if(t.classList.contains("e-recordpluscollapse")?(H.addClass([t],"e-recordplusexpand"),H.removeClass([t],"e-recordpluscollapse"),t.firstElementChild.className="e-icons e-gdiagonaldown e-icon-gdownarrow",t.firstElementChild.setAttribute("title",this.l10n.getConstant("Expanded")),a.isExpand=l=!0,tc(r)&&this.updateVirtualRows(r,e,l,void 0,void 0),this.parent.groupSettings.enableLazyLoading&&((this.parent.filterSettings.columns.length||this.parent.sortSettings.columns.length||this.parent.searchSettings.key.length)&&0===this.parent.getContent().firstElementChild.scrollTop&&(this.parent.contentModule.isTop=!0),(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).captionExpand(t.parentElement))):(a.isExpand=!(n=!0),H.removeClass([t],"e-recordplusexpand"),H.addClass([t],"e-recordpluscollapse"),t.firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",t.firstElementChild.setAttribute("title",this.l10n.getConstant("Collapsed")),tc(r)&&this.updateVirtualRows(r,e,!n,void 0,void 0),this.parent.groupSettings.enableLazyLoading&&(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).captionCollapse(t.parentElement)),this.aria.setExpand(t,l),!tc(r)&&!this.parent.groupSettings.enableLazyLoading&&!this.parent.enableDomVirtualization){for(var h=r.getRowsObject(),d=h.indexOf(a),p={},c=r.enableInfiniteScrolling&&r.infiniteScrollSettings&&r.infiniteScrollSettings.enableCache&&h.length!==i.length?Array.from(i).indexOf(t.parentElement):void 0,u=d;u<h.length&&!(d<u&&h[parseInt(u.toString(),10)].indent===s);u++){if(h[parseInt(u.toString(),10)].isDetailRow){var g=h[u-1].isExpand&&h[u-1].visible;c&&0<c&&c<i.length?i[parseInt(c.toString(),10)].style.display=g?"":"none":H.isNullOrUndefined(c)&&(i[parseInt(u.toString(),10)].style.display=g?"":"none")}else if(!1===p[h[parseInt(u.toString(),10)].parentUid])h[parseInt(u.toString(),10)].visible=!1,c&&0<c&&c<i.length?i[parseInt(c.toString(),10)].style.display="none":H.isNullOrUndefined(c)&&(i[parseInt(u.toString(),10)].style.display="none");else{if(!(h[parseInt(u.toString(),10)].isDataRow||h[parseInt(u.toString(),10)].isCaptionRow||h[parseInt(u.toString(),10)].isDetailRow||h[parseInt(u.toString(),10)].isAggregateRow))if((g=h[parseInt(u.toString(),10)].cells.some(function(e){return e.isDataCell&&e.visible}))===h[parseInt(u.toString(),10)].visible)continue;h[parseInt(u.toString(),10)].visible=!0,c&&0<c&&c<i.length?(i[parseInt(c.toString(),10)].style.display="",i[parseInt(c.toString(),10)].classList.remove("e-hide")):H.isNullOrUndefined(c)&&(i[parseInt(u.toString(),10)].style.display="",i[parseInt(u.toString(),10)].classList.remove("e-hide"))}h[parseInt(u.toString(),10)].isCaptionRow&&(p[h[parseInt(u.toString(),10)].uid]=h[parseInt(u.toString(),10)].isExpand&&h[parseInt(u.toString(),10)].visible),H.isNullOrUndefined(c)||c++}this.lastCaptionRowBorder(),this.parent.notify(Cr,{rows:this.parent.getRowsObject()})}this.parent.enableDomVirtualization&&this.parent.notify(Cr,{rows:this.parent.getRowsObject()}),this.parent.enableInfiniteScrolling&&this.parent.groupSettings.enableLazyLoading||this.parent.notify(Br,{isCollapse:n,parentUid:o})}},g.prototype.lastCaptionRowBorder=function(){var e=this.parent.getContentTable(),t=this.parent.getContent().clientHeight;if((!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||this.parent.groupSettings.enableLazyLoading)&&(e.scrollHeight<t||this.isAppliedCaptionRowBorder)){if(this.isAppliedCaptionRowBorder||e.querySelector(".e-lastrowcell")){for(var i=e.querySelectorAll(".e-lastrowcell"),n=0,r=i.length;n<r;n++)H.removeClass([i[parseInt(n.toString(),10)]],"e-lastrowcell");this.isAppliedCaptionRowBorder=!1}var s=this.parent.getContentTable().querySelector(j).children,o=s[s.length-1];if("none"===o.style.display||o.classList.contains("e-groupcaptionrow")){for(n=s.length-1,r=0;r<n;n--)if("none"!==s[parseInt(n.toString(),10)].style.display&&s[parseInt(n.toString(),10)].classList.contains("e-groupcaptionrow")&&s[parseInt(n.toString(),10)].querySelector(".e-recordpluscollapse")){H.addClass(s[parseInt(n.toString(),10)].childNodes,"e-lastrowcell"),this.isAppliedCaptionRowBorder=!0;break}}else e.scrollHeight<t&&(H.addClass(e.querySelectorAll("tr:last-child td"),"e-lastrowcell"),this.isAppliedCaptionRowBorder=!0)}},g.prototype.updateVirtualRows=function(t,e,i,n,r){var e=t.getRowObjectFromUID(e.closest("tr").getAttribute("data-uid")),s=(e.isExpand=i,np(t),this.parent.notify(Ir,{}),n=t.getDataModule().generateQuery(!1),{requestType:"virtualscroll",rowObject:e});t.contentModule&&(s.virtualInfo=t.contentModule.prevInfo),t.getDataModule().getData(s,t.setRequiresCount(n)).then(function(e){return t.renderModule.dataManagerSuccess(e,s)})},g.prototype.expandCollapse=function(e){var t=this.parent.getRowsObject();if(this.parent.groupSettings.columns.length&&t.length){e||this.parent.notify(jn,e);for(var i,n=this.parent.getContentTable().querySelector(j).children,r=0,s=n.length;r<s;r++)n[parseInt(r.toString(),10)].querySelectorAll(".e-recordplusexpand, .e-recordpluscollapse").length&&((i=n[parseInt(r.toString(),10)].querySelector(e?".e-recordpluscollapse":".e-recordplusexpand"))&&(e?(i.className="e-recordplusexpand",i.firstElementChild.className="e-icons e-gdiagonaldown e-icon-gdownarrow",i.setAttribute("aria-expanded","true"),i.firstElementChild.setAttribute("title",this.l10n.getConstant("Expanded"))):(i.className="e-recordpluscollapse",i.firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",i.setAttribute("aria-expanded","false"),i.firstElementChild.setAttribute("title",this.l10n.getConstant("Collapsed")))),n[parseInt(r.toString(),10)].firstElementChild.classList.contains("e-recordplusexpand")||n[parseInt(r.toString(),10)].firstElementChild.classList.contains("e-recordpluscollapse"))||(n[parseInt(r.toString(),10)].style.display=e?"":"none"),t[parseInt(r.toString(),10)].isCaptionRow&&(t[parseInt(r.toString(),10)].isExpand=!!e);this.parent.updateVisibleExpandCollapseRows(),this.lastCaptionRowBorder(),this.parent.notify(Cr,{rows:this.parent.getRowsObject()})}},g.prototype.expandAll=function(){this.expandCollapse(!0)},g.prototype.collapseAll=function(){this.expandCollapse(!1)},g.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.renderGroupDropArea(),this.initDragAndDrop(),this.refreshToggleBtn(),this.wireEvent()},g.prototype.refreshDropArea=function(){var e=this.parent.element.querySelector(".e-groupdroparea");if(!H.isNullOrUndefined(e)){this.updateGroupDropArea(!0);for(var t=0;t<this.groupSettings.columns.length;t++)this.addColToGroupDrop(this.groupSettings.columns[parseInt(t.toString(),10)])}},g.prototype.renderGroupDropArea=function(){var e=this.parent.element.querySelector(".e-groupdroparea");e&&H.remove(e),this.element=this.parent.createElement("div",{className:"e-groupdroparea",attrs:{tabindex:"-1"}}),this.groupSettings.allowReordering&&this.element.classList.add("e-group-animate"),this.updateGroupDropArea(),this.parent.element.insertBefore(this.element,this.parent.element.firstChild),this.groupSettings.showDropArea&&"Vertical"!==this.parent.rowRenderingMode||(this.element.style.display="none")},g.prototype.updateGroupDropArea=function(e){var t;this.groupSettings.showDropArea&&!this.groupSettings.columns.length?(t=this.l10n.getConstant("GroupDropArea"),this.element.innerHTML=t,this.element.classList.remove("e-grouped")):((this.element.innerHTML!==this.l10n.getConstant("GroupDropArea")||1!==this.groupSettings.columns.length&&(this.isAppliedGroup||this.isAppliedUnGroup))&&!e||(this.element.innerHTML=""),this.element.classList.add("e-grouped"))},g.prototype.initDragAndDrop=function(){this.initializeGHeaderDrop(),this.initializeGHeaderDrag()},g.prototype.initializeGHeaderDrag=function(){new H.Draggable(this.element,{dragTarget:this.groupSettings.allowReordering?".e-drag":".e-groupheadercell",distance:this.groupSettings.allowReordering?-10:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop})},g.prototype.initializeGHeaderDrop=function(){new H.Droppable(this.element,{accept:".e-dragclone",drop:this.drop})},g.prototype.groupColumn=function(e){var t=this.parent,i=t.getColumnByField(e);H.isNullOrUndefined(i)||!1===i.allowGrouping||this.contentRefresh&&-1<this.groupSettings.columns.indexOf(e)?this.parent.log("action_disabled_column",{moduleName:this.getModuleName(),columnName:i.headerText}):Bp(t)?t.notify(ci,{instance:this,handler:this.groupColumn,arg1:e}):(i.visible=t.groupSettings.showGroupedColumn,this.colName=e,this.isAppliedGroup=!0,this.contentRefresh?this.updateModel():this.addColToGroupDrop(e),this.updateGroupDropArea(),this.isAppliedGroup=!1)},g.prototype.ungroupColumn=function(t){var e=this.parent,i=this.parent.enableColumnVirtualization?this.parent.columns.filter(function(e){return e.field===t})[0]:e.getColumnByField(t);if(!(H.isNullOrUndefined(i)||!1===i.allowGrouping||this.groupSettings.columns.indexOf(t)<0))if(Bp(e))e.notify(ci,{instance:this,handler:this.ungroupColumn,arg1:t});else{i.visible=!0,this.colName=i.field;i=JSON.parse(JSON.stringify(this.groupSettings.columns));if(i.splice(i.indexOf(this.colName),1),this.sortedColumns.indexOf(t)<0)for(var n=0,r=e.sortSettings.columns.length;n<r;n++)if(t===e.sortSettings.columns[parseInt(n.toString(),10)].field){e.sortSettings.columns.splice(n,1);break}this.groupSettings.allowReordering&&(this.reorderingColumns=i),this.groupSettings.columns=i,e.allowGrouping&&(this.isAppliedUnGroup=!0,this.parent.dataBind())}},g.prototype.updateModel=function(){var e=JSON.parse(JSON.stringify(this.groupSettings.columns)),e=this.reorderingColumns.length?JSON.parse(JSON.stringify(this.reorderingColumns)):e;this.sortRequired&&(-1===e.indexOf(this.colName)&&e.push(this.colName),this.groupAddSortingQuery(this.colName)),this.sortRequired=!0,this.parent.groupSettings.columns=e,this.parent.dataBind()},g.prototype.onActionComplete=function(e){"grouping"===e.requestType?this.addColToGroupDrop(this.colName):this.removeColFromGroupDrop(this.colName),this.groupSettings.showDropArea&&("100%"===this.parent.height||"string"==typeof this.parent.height&&-1!==this.parent.height.toLowerCase().indexOf("vh"))&&this.parent.scrollModule.refresh();var t=-1<this.groupSettings.columns.indexOf(this.colName)?{columnName:this.colName,requestType:"grouping",type:c}:{requestType:"ungrouping",type:c};this.parent.trigger(c,H.extend(e,t)),this.colName=null},g.prototype.groupAddSortingQuery=function(e){for(var t=0;t<this.parent.sortSettings.columns.length&&this.parent.sortSettings.columns[parseInt(t.toString(),10)].field!==e;)t++;this.parent.sortSettings.columns.length===t?this.parent.sortSettings.columns.push({field:e,direction:"Ascending",isFromGroup:!0}):this.parent.allowSorting||(this.parent.sortSettings.columns[parseInt(t.toString(),10)].direction="Ascending")},g.prototype.createElement=function(e){var t=this.parent,i="Ascending",n=this.parent.createElement("div",{className:"e-grid-icon e-group-animator"}),r=this.parent.createElement("div",{className:"e-grid-icon e-groupheadercell"}),s=this.parent.createElement("div",{attrs:{"data-mappingname":e}}),e=(Fp(e)&&s.setAttribute("ej-complexname",Mp(e)),this.parent.getColumnByField(e)),t=t.getColumnHeaderByUid(e.uid),t=(this.groupSettings.allowReordering&&s.appendChild(this.parent.createElement("span",{className:"e-drag e-icons e-icon-drag",innerHTML:"&nbsp;",attrs:{title:this.l10n.getConstant("GroupedDrag"),tabindex:"-1","aria-label":this.l10n.getConstant("GroupedDrag"),role:"button"}})),s.appendChild(this.parent.createElement("span",{className:"e-grouptext",innerHTML:e.headerText,attrs:{tabindex:"-1"}})),this.groupSettings.showToggleButton&&s.appendChild(this.parent.createElement("span",{className:"e-togglegroupbutton e-icons e-icon-ungroup e-toggleungroup",innerHTML:"&nbsp;",attrs:{tabindex:"-1","aria-label":this.l10n.getConstant("UnGroupAria")}})),t.querySelectorAll(".e-ascending,.e-descending").length&&(i=t.querySelector(".e-ascending")?"Ascending":"Descending"),s.appendChild(this.parent.createElement("span",{className:"e-groupsort e-icons e-"+i.toLowerCase()+" e-icon-"+i.toLowerCase(),innerHTML:"&nbsp;",attrs:{tabindex:"-1","aria-label":this.l10n.getConstant("GroupedSortIcon")+e.headerText,role:"button"}})),this.parent.createElement("span",{className:"e-ungroupbutton e-icons e-icon-hide",innerHTML:"&nbsp;",attrs:{title:this.l10n.getConstant("UnGroup"),tabindex:"-1","aria-label":this.l10n.getConstant("UnGroupIcon")+e.headerText,role:"button"}}));return H.updateCSSText(t,this.groupSettings.showUngroupButton?"":"display: none;"),s.appendChild(t),r.appendChild(s),this.groupSettings.allowReordering&&(n.appendChild(r),n.appendChild(this.createSeparator()),r=n),r},g.prototype.addColToGroupDrop=function(e){var t=Fp(e)?this.parent.element.querySelector(".e-groupdroparea div[ej-complexname="+kp(Mp(e))+"]"):this.parent.element.querySelector(".e-groupdroparea div[data-mappingname="+kp(e)+"]");if(!t||!this.groupSettings.allowReordering&&t.getAttribute("data-mappingname")!==e){t=this.parent.getColumnByField(e);if(!H.isNullOrUndefined(t)){t=this.createElement(e),e=(this.groupSettings.allowReordering&&(e=this.element.getElementsByClassName("e-group-animator").length,t.setAttribute("data-index",e.toString())),this.element.appendChild(t),this.parent.focusModule),t=[0,0];if(0<this.parent.frozenRows){e.setActive(!1);var i=this.parent.element.querySelector(".e-gridheader tbody");if(H.isNullOrUndefined(i)||H.isNullOrUndefined(i.firstChild))return;t=[i.firstChild.rowIndex,0]}else e.setActive(!0);H.isNullOrUndefined(e.active)||H.isNullOrUndefined(e.active.matrix)||(0===e.active.matrix.matrix[t[0]][t[1]]&&(t=au(e.active.matrix.matrix,t,!0)),e.active.matrix.current=t,this.parent.editSettings.showAddNewRow?this.parent.notify(Yr,{}):this.parent.isInitialLoad&&!this.preventFocusOnGroup&&e.focus())}}},g.prototype.createSeparator=function(){var e=this.parent.createElement("span",{className:"e-nextgroup e-icons e-icon-next",innerHTML:"&nbsp;",attrs:{tabindex:"-1","aria-label":this.l10n.getConstant("GroupSeperator"),role:"button"}});return H.updateCSSText(e,this.groupSettings.showUngroupButton?"":"display: none;"),e},g.prototype.refreshToggleBtn=function(e){if(this.groupSettings.showToggleButton)for(var t,i=[].slice.call(this.parent.getHeaderTable().getElementsByClassName("e-headercelldiv")),n=0,r=i.length;n<r;n++)i[parseInt(n.toString(),10)].classList.contains("e-emptycell")||i[parseInt(n.toString(),10)].classList.contains("e-headerchkcelldiv")||(t=this.parent.getColumnByUid(i[parseInt(n.toString(),10)].getAttribute("data-mappinguid")),this.parent.showColumnMenu&&(!this.parent.showColumnMenu||t.showColumnMenu))||(i[parseInt(n.toString(),10)].getElementsByClassName("e-grptogglebtn").length&&H.remove(i[parseInt(n.toString(),10)].querySelectorAll(".e-grptogglebtn")[0]),e)||i[parseInt(n.toString(),10)].appendChild(this.parent.createElement("span",{className:"e-grptogglebtn e-icons "+(-1<this.groupSettings.columns.indexOf(t.field)?"e-toggleungroup e-icon-ungroup":"e-togglegroup e-icon-group"),attrs:{tabindex:"-1","aria-label":(H.isNullOrUndefined(this.l10n)?this.parent.localeObj:this.l10n).getConstant("GroupButton")}}))},g.prototype.removeColFromGroupDrop=function(e){var t;H.isNullOrUndefined(this.getGHeaderCell(e))||(e=this.getGHeaderCell(e),this.groupSettings.allowReordering?(t=I(e,"e-group-animator"),H.remove(t)):H.remove(e),this.updateGroupDropArea(),this.parent.editSettings.showAddNewRow&&this.parent.notify(Yr,{})),this.isAppliedUnGroup=!1},g.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var t=0,i=Object.keys(e.properties);t<i.length;t++){var n=i[t];switch(n){case"columns":var r=void 0;if(this.contentRefresh){if(this.isAppliedUnGroup)r={columnName:this.colName,requestType:"ungrouping",type:y};else{if(!this.isAppliedGroup){this.updateGroupDropArea(!0);for(var s=0;s<this.parent.sortSettings.columns.length;s++)this.parent.sortSettings.columns[parseInt(s.toString(),10)].isFromGroup&&(this.parent.sortSettings.columns.splice(s,1),s--);for(var o=0;o<this.groupSettings.columns.length;o++)this.colName=this.groupSettings.columns[parseInt(o.toString(),10)],this.parent.getColumnByField(this.colName).visible=this.parent.groupSettings.showGroupedColumn,this.groupAddSortingQuery(this.colName),o<this.groupSettings.columns.length-1&&this.addColToGroupDrop(this.groupSettings.columns[parseInt(o.toString(),10)])}r={columnName:this.colName,requestType:e.properties[""+n].length?"grouping":"ungrouping",type:y,preventFocusOnGroup:!1}}if(!this.groupSettings.showGroupedColumn)for(var a=e.oldProperties[""+n],o=0;o<a.length;o++)-1===e.properties[""+n].indexOf(a[parseInt(o.toString(),10)])&&(this.parent.getColumnByField(a[parseInt(o.toString(),10)]).visible=!0);this.parent.notify(bt,r)}break;case"showDropArea":this.updateGroupDropArea(),this.groupSettings.showDropArea?(this.element.style.display="",this.parent.headerModule.refreshUI()):this.element.style.display="none",("100%"===this.parent.height||"string"==typeof this.parent.height&&-1!==this.parent.height.toLowerCase().indexOf("vh"))&&this.parent.scrollModule.refresh();break;case"showGroupedColumn":this.updateGroupedColumn(this.groupSettings.showGroupedColumn),this.parent.notify(bt,{requestType:"refresh"});break;case"showUngroupButton":this.updateButtonVisibility(this.groupSettings.showUngroupButton,"e-ungroupbutton");break;case"showToggleButton":this.updateButtonVisibility(this.groupSettings.showToggleButton,"e-togglegroupbutton "),this.parent.refreshHeader();break;case"enableLazyLoading":this.parent.freezeRefresh()}}},g.prototype.updateGroupedColumn=function(e){for(var t=0;t<this.groupSettings.columns.length;t++)this.parent.getColumnByField(this.groupSettings.columns[parseInt(t.toString(),10)]).visible=e},g.prototype.updateButtonVisibility=function(e,t){for(var i=[].slice.call(this.element.getElementsByClassName(t)),n=0;n<i.length;n++)i[parseInt(n.toString(),10)].style.display=e?"":"none"},g.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},g.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+ms)||e.querySelector("."+vs))&&(!this.parent.isDestroyed&&this.parent.allowGrouping||this.parent.refreshing||this.clearGrouping(),this.unWireEvent(),this.removeEventListener(),this.refreshToggleBtn(!0),this.element.parentNode)&&H.remove(this.element)},g.prototype.clearGrouping=function(){var e=JSON.parse(JSON.stringify(this.groupSettings.columns));this.contentRefresh=!1;for(var t=0,i=e.length;t<i;t++)t===i-1&&(this.contentRefresh=!0),this.ungroupColumn(e[parseInt(t.toString(),10)]);this.contentRefresh=!0},g.prototype.getModuleName=function(){return"group"},g.prototype.refreshSortIcons=function(){var e,t=this.parent,i=t.sortSettings.columns,n=this.parent.getColumns().map(function(e){return e.field});this.refreshToggleBtn();for(var r=0,s=i.length;r<s;r++)-1!==n.indexOf(i[parseInt(r.toString(),10)].field)&&(e=t.getColumnHeaderByField(i[parseInt(r.toString(),10)].field),!t.allowSorting&&(-1<this.sortedColumns.indexOf(i[parseInt(r.toString(),10)].field)||-1<this.groupSettings.columns.indexOf(i[parseInt(r.toString(),10)].field))?(H.classList(e.querySelector(".e-sortfilterdiv"),["e-ascending","e-icon-ascending"],[]),1<i.length&&e.querySelector(".e-headercelldiv").appendChild(this.parent.createElement("span",{className:"e-sortnumber",innerHTML:(r+1).toString()}))):this.getGHeaderCell(i[parseInt(r.toString(),10)].field)&&this.getGHeaderCell(i[parseInt(r.toString(),10)].field).getElementsByClassName("e-groupsort").length&&("Ascending"===i[parseInt(r.toString(),10)].direction?H.classList(this.getGHeaderCell(i[parseInt(r.toString(),10)].field).querySelector(".e-groupsort"),["e-ascending","e-icon-ascending"],["e-descending","e-icon-descending"]):H.classList(this.getGHeaderCell(i[parseInt(r.toString(),10)].field).querySelector(".e-groupsort"),["e-descending","e-icon-descending"],["e-ascending","e-icon-ascending"])))},g.prototype.getGHeaderCell=function(e){return this.element&&this.element.querySelector('[data-mappingname="'+e+'"]')?this.element.querySelector('[data-mappingname="'+e+'"]').parentElement:null},g.prototype.onGroupAggregates=function(e){if(this.parent.groupSettings.enableLazyLoading)"Batch"!==this.parent.editSettings.mode&&this.updateLazyLoadGroupAggregates(e);else{var e=this.iterateGroupAggregates(e),e=this.groupGenerator.generateRows(e,{}),t=this.parent.getRowsObject().filter(function(e){return!e.isDataRow}),i=e.filter(function(e){return!e.isDataRow});(this.parent.isReact||this.parent.isVue)&&this.parent.destroyTemplate(["groupFooterTemplate","groupCaptionTemplate","footerTemplate"]);for(var n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)],r={cells:r.cells.filter(function(e){return e.isDataCell}),data:r.data,dataUid:t[parseInt(n.toString(),10)]?t[parseInt(n.toString(),10)].uid:""};this.parent.notify(Bt,r)}}},g.prototype.updateLazyLoadGroupAggregates=function(l,e){var h=this,d=this.getGroupAggregateTemplates(!0),p=this.getGroupAggregateTemplates(!1);if(d.length||p.length)for(var c=this.parent,u=c.getDataModule().isRemote(),g=l[0],f=l.row,m=c.groupSettings.columns,y=c.enableVirtualization?c.lazyLoadRender:c.contentModule,v=y.getGroupCache()[c.pageSettings.currentPage],S=e||[],C=this,t=0;t<m.length;t++)if("break"===function(t){var i,e=m[parseInt(t.toString(),10)],n=g[""+e],r=C.getGroupCaptionRowObject(f,m.length-t);if(u&&S.length)0!==t&&(e=m[t-1],i=g[""+e],S=S.find(function(e){return e.key===i}).items),C.updateLazyLoadGroupAggregatesRow(S,n,r,v,d,p);else{var s,o,a,e=c.renderModule.data.generateQuery();if(0!==t&&(s=v.filter(function(e){return e.isCaptionRow&&e.parentUid===r.parentUid}).indexOf(r),o=(a=c.groupSettings.columns.slice(0,t).reverse()).map(function(e){return g[""+e]}),a=su(ru(a,o,y)),e.lazyLoad.push({key:"onDemandGroupInfo",value:{level:t,skip:s,take:1,where:a}})),c.renderModule.data.getData({},e).then(function(e){u?h.updateLazyLoadGroupAggregates(l,e.result):h.updateLazyLoadGroupAggregatesRow(e.result,n,r,v,d,p),t!==m.length-1&&!u||h.destroyRefreshGroupCaptionFooterTemplate()}).catch(function(e){return c.renderModule.dataManagerFailure(e,{requestType:"grouping"})}),u)return"break"}}(t))break},g.prototype.destroyRefreshGroupCaptionFooterTemplate=function(){var e=this.parent;(e.isAngular||e.isReact||e.isVue)&&e.destroyTemplate(["groupCaptionTemplate","groupFooterTemplate"]),e.refreshGroupCaptionFooterTemplate(),e.removeMaskRow(),e.hideSpinner()},g.prototype.updateLazyLoadGroupAggregatesRow=function(e,t,i,n,r,s){e=e.find(function(e){return e.key===t});r.length&&this.updateLazyLoadGroupAggregatesCell(e,i,r),s.length&&(r=n.find(function(e){return e.isAggregateRow&&e.parentUid===i.uid}),this.updateLazyLoadGroupAggregatesCell(e,r,s))},g.prototype.updateLazyLoadGroupAggregatesCell=function(e,t,i){var n=t.data,r=e.aggregates;t.isCaptionRow&&(n.aggregates=r);for(var s=0;s<i.length;s++){var o=i[parseInt(s.toString(),10)],a=o.field+" - "+o.type,l=n[o.field];l[a]=r[a],l[lu(o.type)]=r[a],l[o.type]&&(l[o.type]=r[a])}},g.prototype.getGroupCaptionRowObject=function(e,t){for(var i=this.parent,e=e.getAttribute("data-uid"),n=i.getRowObjectFromUID(e),r=0;r<t;r++)n=i.getRowObjectFromUID(n.parentUid);return n},g.prototype.getGroupAggregateTemplates=function(e){for(var t=[],i=this.parent.aggregates,n=0;n<i.length;n++)for(var r,s=i[parseInt(n.toString(),10)],o=0;o<s.columns.length;o++)(e&&s.columns[parseInt(o.toString(),10)].groupCaptionTemplate||!e&&s.columns[parseInt(o.toString(),10)].groupFooterTemplate)&&(r={},r={type:s.columns[parseInt(o.toString(),10)].type.toString().toLowerCase(),field:s.columns[parseInt(o.toString(),10)].field},t.push(r));return t},g.prototype.groupedRowReorder=function(e,t){var i=this.parent.getRowElementByUID(e.uid),n=this.parent.getRowElementByUID(t.uid),r={rows:[i],target:n,fromIndex:e.index,dropIndex:t.index};H.isNullOrUndefined(e)||H.isNullOrUndefined(t)||e.parentUid===t.parentUid||(n?("none"===n.style.display&&(i.style.display="none"),r.dropIndex<r.fromIndex?this.parent.getContentTable().querySelector(j).insertBefore(i,n):this.parent.getContentTable().querySelector(j).insertBefore(i,n.nextSibling)):H.remove(i),this.groupReorderHandler(e,t),n=[].slice.call(this.parent.getContentTable().getElementsByClassName(Ts)),xc(this.parent,r,n,t),this.parent.enableVirtualization?Rc(this.parent):Ic(this.parent,this.parent.getRowsObject().filter(function(e){return e.isDataRow}),n),this.parent.notify(Cr,{rows:this.parent.getRowsObject()}))},g.prototype.groupReorderHandler=function(e,t){for(var i=this.parent,n=e.data,r=t.data,s=i.groupModule.getGroupAggregateTemplates(!1),o=i.getRowObjectFromUID(t.parentUid),a=i.getRowObjectFromUID(e.parentUid),l=[o],h=[a],d=i.groupSettings.columns,p=0;p<d.length;p++)n[d[parseInt(p.toString(),10)]]=r[d[parseInt(p.toString(),10)]],0<p&&(l.push(i.getRowObjectFromUID(l[p-1].parentUid)),h.push(i.getRowObjectFromUID(h[p-1].parentUid)));e.parentUid=t.parentUid,e.visible=t.visible,e.parentGid=t.parentGid,e.changes!==n&&(e.changes=n);var c=(o=this.iterateGroupAggregates([{dragRowObjects:h,dropRowObjects:l}])).filter(function(e){return e.key===h[h.length-1].data.key||e.key instanceof Date&&e.key.toString()===h[h.length-1].data.key.toString()}),u=o.filter(function(e){return e.key===l[l.length-1].data.key||e.key instanceof Date&&e.key.toString()===l[l.length-1].data.key.toString()}),o=[];H.isNullOrUndefined(c[0])||o.push(c[0]),H.isNullOrUndefined(u[0])||o.push(u[0]);for(var g=i.currentViewData,f=0;f<g.length;f++)H.isNullOrUndefined(c[0])&&g[parseInt(f.toString(),10)].key===h[h.length-1].data.key||H.isNullOrUndefined(u[0])&&g[parseInt(f.toString(),10)].key===l[l.length-1].data.key?(g.splice(f,1),f--):H.isNullOrUndefined(c[0])||g[parseInt(f.toString(),10)].key!==c[0].key?H.isNullOrUndefined(u[0])||g[parseInt(f.toString(),10)].key!==u[0].key||(g[parseInt(f.toString(),10)]=u[0]):g[parseInt(f.toString(),10)]=c[0];for(var a=this.groupGenerator.generateRows(o,{}),m=[],y=[],f=0;f<h.length;f++)m.push.apply(m,this.getGroupParentFooterAggregateRowObject(h[parseInt(f.toString(),10)].uid));for(f=0;f<l.length;f++)y.push.apply(y,this.getGroupParentFooterAggregateRowObject(l[parseInt(f.toString(),10)].uid));h.push.apply(h,m),l.push.apply(l,y),this.updatedRowObjChange(h,a,s,!0),this.updatedRowObjChange(l,a,s),this.groupReorderRefreshHandler(h),this.groupReorderRefreshHandler(l)},g.prototype.updatedRowObjChange=function(e,t,i,n){var r=this.parent,s=r.getRowsObject(),o={},a=[];r.enableVirtualization&&(o=r.contentModule.vgenerator.cache,a=r.vcRows);for(var l=0;l<e.length;l++){for(var h=!1,d=e[parseInt(l.toString(),10)],p=0;p<t.length;p++){var c=t[parseInt(p.toString(),10)];if(H.isNullOrUndefined(c)||H.isNullOrUndefined(d.data.key)||H.isNullOrUndefined(c.data.key)||!(d.data.key===c.data.key||d.data.key instanceof Date&&d.data.key.toString()===c.data.key.toString())){if(d.isAggregateRow&&c.isAggregateRow){for(var u=0;u<i.length;u++)if(this.evaluateGroupAggregateValueChange(d,c,i[parseInt(u.toString(),10)])){-1!==(m=s.indexOf(d))&&(s[parseInt(m.toString(),10)].data=c.data,s[parseInt(m.toString(),10)].gSummary=c.gSummary),r.enableVirtualization&&-1!==(y=a.indexOf(d))&&(a[parseInt(y.toString(),10)].data=c.data,a[parseInt(y.toString(),10)].gSummary=c.gSummary),d.data=c.data,d.gSummary=c.gSummary,h=!0;break}if(h)break}}else{var g,f,m,y,v=!0,S=e[parseInt((l+1).toString(),10)];if((v=n&&S&&!S.isAggregateRow&&(g=S.data.key.toString(),S=S.data.field,f=c.data.items.records||c.data.items)&&f.length&&f[0][""+S]&&f[0][""+S].toString()!==g?!1:v)||!n){-1!==(m=s.indexOf(d))&&(s[parseInt(m.toString(),10)].data=c.data,s[parseInt(m.toString(),10)].gSummary=c.gSummary),r.enableVirtualization&&-1!==(y=a.indexOf(d))&&(a[parseInt(y.toString(),10)].data=c.data,a[parseInt(y.toString(),10)].gSummary=c.gSummary),d.data=c.data,d.gSummary=["gSummary"],t.splice(p,1),p--,h=!0;break}}}if(!h){var C=r.getRowElementByUID(d.uid);if(H.isNullOrUndefined(C)||H.remove(C),s.splice(s.indexOf(d),1),r.enableVirtualization){a.splice(a.indexOf(d),1);for(var w=1;w<=Object.keys(o).length;w++){var b=o[parseInt(w.toString(),10)].indexOf(d);-1!==b&&o[parseInt(w.toString(),10)].splice([parseInt(b.toString(),10)],1)}}r.enableInfiniteScrolling&&r.infiniteScrollSettings.enableCache&&r.infiniteScrollModule.resetInfiniteCache(s)}}},g.prototype.groupReorderRefreshHandler=function(e){for(var t=this.parent,i=new $s(t.serviceLocator,null,t),n=t.getColumns(),r=0;r<e.length;r++){var s=e[parseInt(r.toString(),10)];H.isNullOrUndefined(s.uid)||H.isNullOrUndefined(t.getRowElementByUID(s.uid))||i.refresh(s,n,!1)}},g.prototype.getGroupParentFooterAggregateRowObject=function(e){for(var t=this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&this.parent.groupSettings.columns.length?this.parent.contentModule.rows:this.parent.getRowsObject(),i=[],n=0;n<t.length;n++){var r=t[parseInt(n.toString(),10)];r.parentUid===e&&r.isAggregateRow&&i.push(r)}return i},g.prototype.evaluateGroupAggregateValueChange=function(e,t,i){var n=!1;return n=e.data[i.field].field===t.data[i.field].field&&e.data[i.field].key===t.data[i.field].key&&e.data[i.field].hasOwnProperty(i.field+" - "+i.type)&&t.data[i.field].hasOwnProperty(i.field+" - "+i.type)?!0:n},g.prototype.gettingVirtualData=function(n,r,s){for(var o=[],e=function(e){if(-1===r.indexOf(n[parseInt(e.toString(),10)].data)&&o.push(n[parseInt(e.toString(),10)].data),n[parseInt(e.toString(),10)].data.field===a.parent.groupSettings.columns[0])for(var i=n[parseInt(e.toString(),10)].data.items,t=(H.isNullOrUndefined(i.records)||(i=i.records),0);t<i.length;t++)!function(t){s&&-1===r.findIndex(function(e){return e[s.toString()]===i[parseInt(t.toString(),10)][s.toString()]})&&o.push(i[parseInt(t.toString(),10)])}(t)},a=this,t=0;t<n.length;t++)e(t);return o},g.prototype.iterateGroupAggregates=function(e){var i=this,t=e instanceof Array?e:[],n=this.parent.getRowsObject(),r=this.parent.getCurrentViewRecords().slice(),s=this.parent.getPrimaryKeyFieldNames()[0],o=e&&e.length?e[0]&&e[0].dragRowObjects:null,a=e&&e.length?e[0]&&e[0].dropRowObjects:null,l=null,h=null,d=(!(this.parent.enableVirtualization&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length)||H.isNullOrUndefined(o)&&H.isNullOrUndefined(a)||(o&&r.push.apply(r,this.gettingVirtualData(o,r,s)),a&&r.push.apply(r,this.gettingVirtualData(a,r,s))),this.parent.enableInfiniteScrolling&&this.parent.allowGrouping&&e.length&&this.parent.groupSettings.columns.length&&!H.isNullOrUndefined(o)&&!H.isNullOrUndefined(a)),p=(d&&(r=[],l=a[a.length-1].data.key,h=o[o.length-1].data.key,this.parent.getRowsObject().map(function(e){var t=e.data[i.parent.groupSettings.columns[0]];e.isDataRow&&(t===l||t===h||t instanceof Date&&(t.toString()===l.toString()||t.toString()===h.toString()))&&r.push(e.data)})),[]),c=n.map(function(e){return"delete"===e.edit&&p.push(e.data),e.changes instanceof Object?e.changes:e.data}),c=0===t.length?c:t,u=r.map(function(e){var t,i=V.DataUtil.getObject(s,e);return c.some(function(e){return t=e,i===V.DataUtil.getObject(s,e)})?t:e});if((!e.type||"cancel"!==e.type)&&0<p.length)for(var g=0;g<p.length;g++){var f=u.indexOf(p[parseInt(g.toString(),10)]);u.splice(f,1)}for(var m,y=[],v=this.parent.aggregates,S=0;S<v.length;S++)for(var C=v[parseInt(S.toString(),10)],w=0;w<C.columns.length;w++)for(var b=0,I=C.columns[parseInt(w.toString(),10)].type.toString().split(",").map(function(e){return e.trim()});b<I.length;b++){var R={type:I[b].toLowerCase(),field:C.columns[parseInt(w.toString(),10)].field};y.push(R)}for(var x=this.parent.groupSettings.columns,D=0;D<x.length;D++)m=V.DataUtil.group(m||u,x[parseInt(D.toString(),10)],y,null,null);if(d){a=this.parent.currentViewData[this.parent.currentViewData.length-1].key;if(a instanceof Date&&(a.toString()===l.toString()||a.toString()===h.toString())||a===l||a===h){for(var T=[],g=0;g<m.length;g++)T.push(m[parseInt(g.toString(),10)]);for(var E=[],o=this.parent.getDataModule().generateQuery(!0),n=o,O=0;O<T.length;O++)E.push(new V.Predicate("field","==",T[parseInt(O.toString(),10)].field).and(i.parent.renderModule.getPredicate("key","equal",T[parseInt(O.toString(),10)].key)));n.where(V.Predicate.or(E));t=this.parent.getDataModule().dataManager.executeLocal(o);this.parent.renderModule.updateGroupInfo(m,t)}}return m},g.prototype.updateExpand=function(e){for(var i=e.uid,t=e.isExpand,n=this.parent.getRowsObject(),r=0;r<n.length;r++){var s=n[parseInt(r.toString(),10)];if(s.uid===i||H.isNullOrUndefined(i)){s.isExpand=t;for(var o=r+1;o<n.length;o++)if("break"===function(e){var t=n[parseInt(e.toString(),10)],e=void 0;if(t.parentUid!==s.uid&&(e=n.filter(function(e){return e.uid===t.parentUid})[0]),t.parentUid===s.uid?t.visible=s.isExpand:H.isNullOrUndefined(e)||t.parentUid!==e.uid||(e.isExpand&&!0===e.visible?t.visible=!0:e.isExpand&&!1===e.visible&&(t.visible=!1)),H.isNullOrUndefined(i))return"break"}(o))break}}this.parent.notify(vt,{rows:n,args:{isFrozen:!1,rows:n}})};var gg=g;function g(e,t,i,n){var o=this;this.sortRequired=!0,this.groupSortFocus=!1,this.groupTextFocus=!1,this.groupCancelFocus=!1,this.preventFocusOnGroup=!1,this.isAppliedGroup=!1,this.isAppliedUnGroup=!1,this.isAppliedCaptionRowBorder=!1,this.reorderingColumns=[],this.visualElement=H.createElement("div",{className:"e-cloneproperties e-dragclone e-gdclone",attrs:{action:"grouping"}}),this.helper=function(e){var t=o.parent,e=e.sender.target,i=e.classList.contains("e-groupheadercell")?e:I(e,"e-groupheadercell");return!(!i||!e.classList.contains("e-drag")&&o.groupSettings.allowReordering)&&(o.column=t.getColumnByField(i.firstElementChild.getAttribute("data-mappingname")),o.visualElement.textContent=i.textContent,H.updateCSSText(o.visualElement,"width: "+(i.offsetWidth+2)+"px;\n height: "+(i.offsetHeight+2)+"px; line-height: 23px;"),o.visualElement.setAttribute("data-mappinguid",o.column.uid),t.element.appendChild(o.visualElement),o.visualElement)},this.dragStart=function(e){o.parent.element.classList.add("e-ungroupdrag")},this.drag=function(e){o.groupSettings.allowReordering&&o.animateDropper(e);var e=e.target,t=o.parent.element.querySelector(".e-cloneproperties");o.parent.trigger(Re,{target:e,draggableType:"headercell",column:o.column}),o.groupSettings.allowReordering||(H.classList(t,["e-defaultcur"],["e-notallowedcur"]),I(e,vs))||I(e,"e-headercell")||H.classList(t,["e-notallowedcur"],["e-defaultcur"])},this.dragStop=function(e){o.parent.element.classList.remove("e-ungroupdrag");var t,i=!(I(e.target,vs)||I(e.target,"e-gridheader"));o.groupSettings.allowReordering&&i?(H.remove(e.helper),I(e.target,"e-groupdroparea")?o.rearrangeGroup():I(e.target,"e-grid")||(t=o.parent.getColumnByUid(e.helper.getAttribute("data-mappinguid")).field,-1!==o.groupSettings.columns.indexOf(t)&&o.ungroupColumn(t))):i&&H.remove(e.helper)},this.animateDropper=function(e){var t=o.parent.element.querySelector(".e-cloneproperties").getAttribute("data-mappinguid"),t=o.parent.getColumnByUid(t).field,i=I(e.target,"e-groupdroparea"),e=I(e.target,"e-group-animator"),n=[].slice.call(o.element.getElementsByClassName("e-groupheadercell")).map(function(e){return e.querySelector("div").getAttribute("data-mappingname")}),r=JSON.parse(JSON.stringify(n));if(e||i){e?(n=e.querySelector("div[data-mappingname]").getAttribute("data-mappingname"),e=+e.getAttribute("data-index"),n!==t&&(-1!==(n=r.indexOf(t))&&r.splice(n,1),r.splice(e+(-1!=e&&n===e?1:0),0,t))):i&&-1===r.indexOf(t)&&r.push(t),o.element.innerHTML="",r.length&&!o.element.classList.contains("e-grouped")&&o.element.classList.add("e-grouped"),o.reorderingColumns=r;for(var s=0;s<r.length;s++)o.addColToGroupDrop(r[parseInt(s.toString(),10)])}else o.addLabel(),o.removeColFromGroupDrop(t)},this.drop=function(e){var t=o.parent,i=t.getColumnByUid(e.droppedElement.getAttribute("data-mappinguid"));o.element.classList.remove("e-hover"),H.remove(e.droppedElement),o.aria.setDropTarget(o.parent.element.querySelector(".e-groupdroparea"),!1),o.aria.setGrabbed(o.parent.getHeaderTable().querySelector("[aria-grabbed=true]"),!1),H.isNullOrUndefined(i)||!1===i.allowGrouping||I(t.getColumnHeaderByUid(i.uid),"e-grid").getAttribute("id")!==t.element.getAttribute("id")?o.parent.log("action_disabled_column",{moduleName:o.getModuleName(),columnName:i?i.headerText:void 0}):o.groupColumn(i.field)},this.contentRefresh=!0,this.aria=new Co,H.initializeTelemetryFeature("Group","DataGrid"),this.parent=e,this.groupSettings=t,this.serviceLocator=n,this.sortedColumns=i,this.focus=n.getService("focus"),this.addEventListener(),this.groupGenerator=new uo(this.parent)}fg.prototype.addEventListener=function(){this.parent.isDestroyed||(H.EventHandler.add(this.parent.element,"auxclick",this.auxilaryclickHandler,this),this.parent.on(_t,this.clickHandler,this),this.parent.on(s,this.destroy,this),this.parent.on(Gt,this.keyPressHandler,this),this.parent.on(Ji,this.expand,this),this.parent.on(Kt,this.refreshColSpan,this),this.parent.on(s,this.destroyChildGrids,this),this.parent.on(Lr,this.destroyChildGrids,this),this.parent.on(s,this.detachDetailTemplate,this),this.parent.on(ts,this.detachDetailTemplate,this))},fg.prototype.clickHandler=function(e){!e.target.classList.contains("e-icon-grightarrow")&&!e.target.classList.contains("e-icon-gdownarrow")||this.parent.allowGrouping||e.preventDefault(),this.toogleExpandcollapse(H.closest(e.target,"td"),e)},fg.prototype.auxilaryclickHandler=function(e){!e.target.classList.contains("e-icon-grightarrow")&&!e.target.classList.contains("e-icon-gdownarrow")||this.parent.allowGrouping||1!==e.button||e.preventDefault()},fg.prototype.toogleExpandcollapse=function(e,t){this.l10n=this.serviceLocator.getService("localization");var i,n=this.parent,r=this.parent.getContentTable(),s=this.parent.getCurrentViewRecords().length-1,o=e&&e.classList.contains("e-detailrowcollapse");if(!(!e||!e.classList.contains("e-detailrowcollapse")&&!e.classList.contains("e-detailrowexpand")||e&&e.classList.contains("e-masked-cell"))){var a=e.parentElement,l=a.getAttribute("data-uid"),h=n.getRowObjectFromUID(l);if(!H.isNullOrUndefined(h)){var l=!1,d=this.parent.getContentTable().querySelector(j).children[a.rowIndex+1];if(e.classList.contains("e-detailrowcollapse")){var p=h.data,c={rowData:p,parentRow:e.closest("tr"),cancel:!1,detailRow:this.isDetailRow(d)?d:null};if(H.isNullOrUndefined(t)||(c.event=t),H.isNullOrUndefined(n.childGrid)||(c.childGrid=n.childGrid,this.isDetailRow(d)&&(x=d.querySelector(".e-grid"),c.childGridInstance=x?x.ej2_instances[0]:null)),n.trigger(ke,c),c.cancel)return;if(this.isDetailRow(d))d.style.display="",this.parent.isRowDomVirtualization()&&n.detailTemplate&&(S=this.parseDetailRowHeight(n.detailTemplateHeight),d.style.height=S+"px"),n.notify(bn,{data:p,childGrid:n.childGrid,detailElement:e,isExpanded:o}),l=!0;else if(n.getDetailTemplate()||n.childGrid){var c=bp("grid-row"),u=this.parent.createElement("tr",{className:"e-detailrow",attrs:{"data-uid":c,role:"row"}}),g=this.parent.createElement("th",{className:"e-detailcell",attrs:{scope:"col",role:"columnheader"}}),f=this.parent.getVisibleColumns().length,m=(this.parent.allowRowDragAndDrop&&f++,g.setAttribute("colspan",f.toString()),new ds({isDataRow:!0,isExpand:!0,uid:c,isDetailRow:!0,cells:[new cs({cellType:oe.CellType.Indent}),new cs({isDataCell:!0,visible:!0})]}));m.parentUid=h.uid;for(var y=0,v=n.groupSettings.columns.length;y<v;y++)u.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),m.cells.unshift(new cs({cellType:oe.CellType.Indent}));u.appendChild(this.parent.createElement("th",{className:"e-detailindentcell",attrs:{scope:"col"}})),u.appendChild(g),a.parentNode.insertBefore(u,a.nextSibling);var S,f=void 0,c=void 0,C=(n.detailTemplate?(f=this.parent.isReact&&"string"!=typeof n.detailTemplate&&!(n.detailTemplate.prototype&&n.detailTemplate.prototype.CSPTemplate),c=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,w=this.parent.printGridParent&&this.parent.printGridParent.isReact,C=n.element.id+"detailTemplate",f||c||w?(n.getDetailTemplate()(p,n,"detailTemplate",C,null,null,g),this.parent.renderTemplates(function(){n.trigger(Me,{detailElement:g,data:p,childGrid:i})})):Ip(g,n.getDetailTemplate()(p,n,"detailTemplate",C,void 0,void 0,void 0,this.parent.root))):((i=new Qd(this.getGridModel(n,h,n.printMode))).height=n.enableInfiniteScrolling&&"auto"===i.height?300:i.height,i.root=n.root||n,this.childRefs.push(i),i.query&&(i.query=i.query.clone()),i.parentDetails={parentID:n.element.id,parentPrimaryKeys:n.getPrimaryKeyFieldNames(),parentKeyField:n.childGrid.queryString,parentKeyFieldValue:n.childGrid.queryString&&Fp(n.childGrid.queryString)?N(n.childGrid.queryString,p):p[n.childGrid.queryString],parentRowData:p},n.isReact||n.isVue?i.parentDetails.parentInstObj=n:n.parentDetails&&n.parentDetails.parentInstObj&&(n.parentDetails.parentInstObj.isReact||n.parentDetails.parentInstObj.isVue)&&(i.parentDetails.parentInstObj=n.parentDetails.parentInstObj),n.printGridParent&&n.printGridParent.isReact&&(i.printGridParent=n.printGridParent),i.isLegacyTemplate=n.isReact||n.isLegacyTemplate,n.isPrinting&&(i.isPrinting=!0,i.on(vt,this.promiseResolve(i),this),i.on(Ct,this.promiseResolve(i),this)),w=(h.childGrid=i).getInjectedModules(),C=n.getInjectedModules(),w&&w.length===C.length||i.setInjectedModules(C),w=this.parent.createElement("div",{id:"child"+Rp(a,"e-grid").length+"_grid"+a.rowIndex+bp(""),className:"e-childgrid"}),g.appendChild(w),i.appendTo(w)),u.appendChild(g),a.nextSibling?a.parentNode.insertBefore(u,a.nextSibling):a.parentNode.appendChild(u),n.getRows()),w=n.getRowsObject();if(C.splice(C.indexOf(a)+1,0,u),n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache)for(var b=n.contentModule.infiniteCache,I=Object.keys(b),y=0;y<I.length;y++){var R=b[parseInt(I[parseInt(y.toString(),10)],10)].indexOf(h);if(-1!==R){b[parseInt(I[parseInt(y.toString(),10)],10)].splice(R+1,0,m);break}}else w.splice(w.indexOf(h)+1,0,m);f&&c||n.trigger(Me,{detailElement:g,data:p,childGrid:i}),n.notify(Me,{rows:w}),this.parent.isRowDomVirtualization()&&n.detailTemplate&&(S=this.parseDetailRowHeight(n.detailTemplateHeight),u.style.height=S+"px")}H.classList(e,["e-detailrowexpand"],["e-detailrowcollapse"]),H.classList(e.firstElementChild,["e-dtdiagonaldown","e-icon-gdownarrow"],["e-dtdiagonalright","e-icon-grightarrow"]),h.isExpand=!0,this.handleDetailEvent(Le,p,e,d,t),e.classList.contains("e-lastrowcell")&&this.parent.getContent().clientHeight>r.scrollHeight&&(H.removeClass(e.parentElement.querySelectorAll("td"),"e-lastrowcell"),C=r.querySelector(j).getElementsByClassName("e-detailrow").length-1,H.addClass(r.querySelector(j).getElementsByClassName("e-detailrow")[parseInt(C.toString(),10)].childNodes,["e-lastrowcell"]),this.lastrowcell=!0),this.aria.setExpand(e,!0),e.firstElementChild.setAttribute("title",this.l10n.getConstant("Expanded")),this.parent.isRowDomVirtualization()&&(S=n.detailTemplate?this.parseDetailRowHeight(this.parent.detailTemplateHeight):this.parseDetailRowHeight(n.childGrid?n.childGrid.height:void 0),this.parent.contentModule.updateDetailRowHeight(h.index,!0,S))}else{if(this.isDetailRow(d)){var x,f={rowData:h.data,parentRow:e.closest("tr"),cancel:!1,detailRow:this.isDetailRow(d)?d:null};if(H.isNullOrUndefined(t)||(f.event=t),H.isNullOrUndefined(n.childGrid)||(f.childGrid=n.childGrid,this.isDetailRow(d)&&(x=d.querySelector(".e-grid"),f.childGridInstance=x?x.ej2_instances[0]:null)),n.trigger(Pe,f),f.cancel)return;d.style.display="none",n.notify(bn,{data:h.data,childGrid:n.childGrid,detailElement:e,isExpanded:o})}H.classList(e,["e-detailrowcollapse"],["e-detailrowexpand"]),H.classList(e.firstElementChild,["e-dtdiagonalright","e-icon-grightarrow"],["e-dtdiagonaldown","e-icon-gdownarrow"]),parseInt(a.getAttribute(D),10)-1==s&&this.lastrowcell&&(H.addClass(e.parentElement.querySelectorAll("td"),"e-lastrowcell"),this.lastrowcell=!1),h.isExpand=!1,this.handleDetailEvent(Ne,h.data,e,d,t),this.aria.setExpand(e,!(l=!0)),e.firstElementChild.setAttribute("title",this.l10n.getConstant("Collapsed")),this.parent.isRowDomVirtualization()&&this.parent.contentModule.updateDetailRowHeight(h.index,!1)}(!H.isNullOrUndefined(n.detailTemplate)||n.childGrid&&l)&&(n.updateVisibleExpandCollapseRows(),n.notify(Cr,{rows:n.getRowsObject()})),this.parent.allowTextWrap&&"auto"===this.parent.height&&(this.parent.getContentTable().scrollHeight>this.parent.getContent().clientHeight?this.parent.scrollModule.setPadding():this.parent.scrollModule.removePadding())}}},fg.prototype.parseDetailRowHeight=function(e){if("number"==typeof e)return e;if("string"==typeof e){e=parseFloat(e);if(!isNaN(e)&&0<e)return e}return 500},fg.prototype.getGridModel=function(e,t,i){t=e.isPrinting&&t.isExpand&&e.expandedRows&&e.expandedRows[t.index]&&e.expandedRows[t.index].gridModel?(e.expandedRows[t.index].gridModel.hierarchyPrintMode=e.childGrid.hierarchyPrintMode,H.extend({},e.expandedRows[t.index].gridModel,e.childGrid,!0)):H.extend({},{},e.childGrid,!0);return e.isPrinting&&e.childGrid.allowPaging&&(t.allowPaging="CurrentPage"===i),t},fg.prototype.promiseResolve=function(e){var t=this;return function(){e.off(vt,t.promiseResolve),e.off(Ct,t.promiseResolve),e.notify(Zi,{})}},fg.prototype.isDetailRow=function(e){return e&&e.classList.contains("e-detailrow")},fg.prototype.handleDetailEvent=function(e,t,i,n,r){var s=this.parent,t={rowData:t,parentRow:i.closest("tr"),detailRow:this.isDetailRow(n)?n:null};H.isNullOrUndefined(r)||(t.event=r),H.isNullOrUndefined(s.childGrid)||(t.childGrid=s.childGrid,this.isDetailRow(n)&&(i=n.querySelector(".e-grid"),t.childGridInstance=i?i.ej2_instances[0]:null)),s.trigger(e,t)},fg.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+ms)||e.querySelector("."+vs))&&(H.EventHandler.remove(this.parent.element,"auxclick",this.auxilaryclickHandler),this.parent.off(_t,this.clickHandler),this.parent.off(s,this.destroy),this.parent.off(Gt,this.keyPressHandler),this.parent.off(Ji,this.expand),this.parent.off(Kt,this.refreshColSpan),this.parent.off(s,this.destroyChildGrids),this.parent.off(Lr,this.destroyChildGrids),this.parent.off(s,this.detachDetailTemplate),this.parent.off(ts,this.detachDetailTemplate))},fg.prototype.getTDfromIndex=function(e,t){e=H.isNullOrUndefined(e)?void 0:this.parent.getDataRows()[parseInt(e.toString(),10)];return e&&e.querySelector(t)?e.querySelector(t):null},fg.prototype.expand=function(e){(e=isNaN(e)?e:this.getTDfromIndex(e,".e-detailrowcollapse"))&&e.classList.contains("e-detailrowcollapse")&&this.toogleExpandcollapse(e)},fg.prototype.collapse=function(e){(e=isNaN(e)?e:this.getTDfromIndex(e,".e-detailrowexpand"))&&e.classList.contains("e-detailrowexpand")&&this.toogleExpandcollapse(e)},fg.prototype.expandAll=function(){this.expandCollapse(!0),this.parent.trigger(c,{requestType:"expandAllComplete",type:c,moduleObj:this})},fg.prototype.collapseAll=function(){this.expandCollapse(!1),this.parent.trigger(c,{requestType:"collapseAllComplete",type:c,moduleObj:this})},fg.prototype.expandCollapse=function(e){for(var t,i=this.parent.getDataRows(),n=0,r=i.length;n<r;n++)t=i[parseInt(n.toString(),10)].querySelector(".e-detailrowcollapse, .e-detailrowexpand"),e?this.expand(t):this.collapse(t)},fg.prototype.keyPressHandler=function(e){var t=this.parent;switch(/(Mac)/i.test(navigator.platform)&&e.metaKey&&("downArrow"===e.action?e.action="ctrlDownArrow":"upArrow"===e.action&&(e.action="ctrlUpArrow")),e.action){case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"altUpArrow":case"altDownArrow":var i=t.allowSelection?t.getSelectedRowIndexes():[];i.length&&(i=t.getDataRows()[i[i.length-1]].querySelector(".e-detailrowcollapse, .e-detailrowexpand"),"altDownArrow"===e.action?this.expand(i):this.collapse(i));break;case"enter":!this.parent.isEdit&&(!(i=(i=this.focus.getFocusedElement())&&(i.classList.contains("e-icon-grightarrow")||i.classList.contains("e-icon-gdownarrow"))?i.parentElement:i)||i.classList.contains("e-detailrowcollapse")||i.classList.contains("e-detailrowexpand"))&&this.toogleExpandcollapse(i,e)}},fg.prototype.refreshColSpan=function(){for(var e=this.parent.contentModule.getTable().querySelectorAll("tr.e-detailrow"),t=this.parent.getVisibleColumns().length,i=0;i<e.length;i++)e[parseInt(i.toString(),10)].querySelector(".e-detailcell").setAttribute("colspan",t+"")},fg.prototype.destroyChildGrids=function(e){var r=this.parent;if(r.enableInfiniteScrolling&&(r.childGrid||r.detailTemplate)&&"infiniteScroll"===e.requestType&&r.infiniteScrollSettings.enableCache){var e="down"===e.direction?e.currentPage-r.infiniteScrollSettings.initialBlocks:e.currentPage+r.infiniteScrollSettings.initialBlocks,s=r.contentModule.infiniteCache[parseInt(e.toString(),10)],o=s.filter(function(e){return e.isDetailRow&&e.parentUid});if(r.childGrid)for(var a=this,t=0;t<o.length;t++)!function(e){var t=r.getContentTable().querySelector('[data-uid="'+o[parseInt(e.toString(),10)].uid+'"]'),i=t.querySelector(".e-childgrid"),n=a.childRefs.findIndex(function(e){return e.element.id===i.id}),n=(a.childRefs[parseInt(n.toString(),10)].isDestroyed||(a.childRefs[parseInt(n.toString(),10)].destroy(),a.childRefs.splice(n,1)),s.indexOf(o[parseInt(e.toString(),10)]));s.splice(n,1),s[n-1].childGrid=null,s[n-1].isExpand=!1,t.remove()}(t);if(r.detailTemplate&&o.length){for(var i=[],t=0;t<o.length;t++)!function(t){i.push({detailRow:r.getContentTable().querySelector('[data-uid="'+o[parseInt(t.toString(),10)].uid+'"]'),detailRowObject:o[parseInt(t.toString(),10)],parentRowObject:s.find(function(e){return o[parseInt(t.toString(),10)].parentUid===e.uid})})}(t);this.parent.trigger(es,i,function(){for(var e=0;e<o.length;e++){var t=r.getContentTable().querySelector('[data-uid="'+o[parseInt(e.toString(),10)].uid+'"]'),i=s.indexOf(o[parseInt(e.toString(),10)]);s.splice(i,1),s[i-1].isExpand=!1,t.remove()}})}}else{for(var n=this.parent.getRowsObject(),t=0;t<n.length;t++)n[parseInt(t.toString(),10)].childGrid=null;for(t=0;t<this.childRefs.length;t++)this.childRefs[parseInt(t.toString(),10)].isDestroyed||this.childRefs[parseInt(t.toString(),10)].destroy();this.childRefs=[]}},fg.prototype.detachDetailTemplate=function(){var e,t,i,n=this.parent;n.detailTemplate&&(e=n.getRowsObject(),(t=e.filter(function(e){return e.isDetailRow&&e.parentUid})).length)&&(i=[],t.map(function(t){i.push({detailRow:n.getContentTable().querySelector('[data-uid="'+t.uid+'"]'),detailRowObject:t,parentRowObject:e.find(function(e){return t.parentUid===e.uid})})}),n.trigger(es,i,function(){t.map(function(e){n.getContentTable().querySelector('[data-uid="'+e.uid+'"]').remove()})}))},fg.prototype.getModuleName=function(){return"detailRow"};a=fg;function fg(e,t){this.aria=new Co,this.childRefs=[],H.initializeTelemetryFeature("DetailRow","DataGrid"),this.parent=e,this.serviceLocator=t,this.focus=t.getService("focus"),this.addEventListener()}f.prototype.render=function(){this.element&&this.unWireEvent(),this.l10n=this.serviceLocator.getService("localization");for(var e=this.parent.enableAdaptiveUI,t=["Edit","Delete","Update","Cancel"],i=0,n=["Add","Edit","Update","Delete","Cancel","Print","PdfExport","ExcelExport","WordExport","CsvExport","Undo","Redo"];i<n.length;i++){var r=n[i],s=r.toLowerCase(),o=s[0].toUpperCase()+s.slice(1);this.predefinedItems[""+r]={id:this.gridID+"_"+s,prefixIcon:"e-"+s,text:this.l10n.getConstant(o),tooltipText:this.l10n.getConstant(o)},e&&(this.predefinedItems[""+r].text="",this.predefinedItems[""+r].visible=-1===t.indexOf(r))}this.predefinedItems.Search={id:this.gridID+"_search",tooltipText:this.l10n.getConstant("Search"),align:"Right",cssClass:"e-search-wrapper",type:"Input"},this.predefinedItems.Find={id:this.gridID+"_find",tooltipText:this.l10n.getConstant("Find"),align:"Right",cssClass:"e-find-wrapper",type:"Input"},this.predefinedItems.AdvancedFilter={id:this.gridID+"_advancedfilter",prefixIcon:"e-icon-advanced-filter e-icon-filter",text:this.l10n.getConstant("FilterIcon")||"Filter",tooltipText:this.l10n.getConstant("FilterIcon")||"Filter",align:"Right"},this.isRightToolbarMenu=!1,this.parent.enableAdaptiveUI&&this.isResponsiveToolbarMenuItems(!0)&&("Horizontal"===this.parent.rowRenderingMode||"Vertical"===this.parent.rowRenderingMode&&!this.parent.allowFiltering&&!this.parent.allowSorting)&&(this.isRightToolbarMenu=!0),e&&this.isResponsiveToolbarMenuItems(!1)?this.predefinedItems.responsiveToolbarItems={id:this.gridID+"_responsivetoolbaritems",cssClass:"e-responsive-toolbar-items e-menu-toolbar",suffixIcon:"e-responsivetoolbaritems-btn",align:this.isRightToolbarMenu?"Left":"Right"}:this.predefinedItems.ColumnChooser={id:this.gridID+"_columnchooser",cssClass:"e-cc e-ccdiv e-cc-toolbar",suffixIcon:"e-columnchooser-btn",text:e?"":this.l10n.getConstant("Columnchooser"),tooltipText:this.l10n.getConstant("Columnchooser"),align:"Right"},"Vertical"===this.parent.rowRenderingMode&&(this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&(this.predefinedItems.responsiveFilter={id:this.gridID+"_responsivefilter",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-resfilter-icon",tooltipText:this.l10n.getConstant("FilterIcon")}),this.parent.allowSorting)&&(this.predefinedItems.responsiveSort={id:this.gridID+"_responsivesort",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-ressort-icon",tooltipText:this.l10n.getConstant("SortIcon")}),this.parent.enableAdaptiveUI&&this.parent.toolbar&&this.parent.toolbar.some(function(e){return"object"==typeof e&&"Search"===e.text||"Search"===e})&&(this.predefinedItems.responsiveBack={id:this.gridID+"_responsiveback",cssClass:"e-gridresponsiveicons e-icons",suffixIcon:"e-resback-icon",visible:!1}),this.createToolbar(),this.parent.advancedFilterSettings&&this.parent.advancedFilterSettings.queryBuilderSettings&&this.parent.advancedFilterSettings.queryBuilderSettings.rule&&this.enableAdvancedFilterButton(!0),this.parent.enableAdaptiveUI&&(H.isNullOrUndefined(this.responsiveToolbarMenu)&&this.renderResponsiveToolbarpopup(),this.toolbar.element)&&this.toolbar.refreshOverflow()},f.prototype.isResponsiveToolbarMenuItems=function(e){for(var t=e?["Add","Edit","Delete","Search"]:["Print","ColumnChooser","PdfExport","ExcelExport","CsvExport"],i=this.parent.toolbar||[],n=0;n<t.length;n++)if(0<=i.indexOf(t[parseInt(n.toString(),10)]))return!e;return!!e},f.prototype.getToolbar=function(){return this.toolbar.element},f.prototype.destroy=function(){this.findElement&&this.findKeyHandler&&(H.EventHandler.remove(this.findElement,"keydown",this.findKeyHandler),H.EventHandler.remove(this.findElement,"input",this.findInputHandler),this.findElement=null),this.toolbar&&!this.toolbar.isDestroyed&&(this.responsiveToolbarMenu&&this.responsiveToolbarMenu.destroy(),this.toolbar.off("render-react-toolbar-template",this.addReactToolbarPortals),this.unWireEvent(),this.removeEventListener(),this.toolbar.created=null,this.toolbar.clicked=null,this.toolbar.element?this.toolbar.destroy():(this.parent.destroyTemplate(["toolbarTemplate"]),this.parent.isReact&&this.parent.renderTemplates()),this.parent.isAngular&&(this.toolbar.viewContainerRef=null,this.toolbar.registeredTemplate=null),this.element.parentNode)&&(H.remove(this.element),this.toolbar=null)},f.prototype.bindSearchEvents=function(){this.searchElement=H.select("#"+this.gridID+"_searchbar",this.element),this.wireEvent(),this.refreshToolbarItems(),this.parent.searchSettings&&this.updateSearchBox()},f.prototype.isVue3ToolbarTemplate=function(){if(this.parent.isVue3&&this.toolbar&&this.toolbar.items&&this.toolbar.items.length)for(var e=this.parent.vueInstance,t=e?e.$slots:null,i=0,n=this.toolbar.items;i<n.length;i++){var r=n[i].template;if("string"==typeof r&&t&&"function"==typeof t[""+r])return!0}return!1},f.prototype.toolbarCreated=function(e){this.renderSearchInput(e),this.renderFindInput()},f.prototype.renderSearchInput=function(e){this.element.querySelector(".e-search-wrapper")&&(!this.parent.enableAdaptiveUI||e?(e=this.parent.cssClass?"e-input-group e-search "+this.parent.cssClass:"e-input-group e-search",this.element.querySelector(".e-search-wrapper").innerHTML='<div class="'+e+'" role="search"> <input id="'+this.gridID+'_searchbar" class="e-input e-search" name="input" type="search" placeholder= "'+this.l10n.getConstant("Search")+'"/> <span id="'+this.gridID+'_clearbutton" class="e-input-group-icon e-icons e-sicon" tabindex="-1" aria-label= "clear" role= "button" ></span> <span id="'+this.gridID+'_searchbutton" class="e-input-group-icon e-search-icon e-icons" tabindex="-1" title="'+this.l10n.getConstant("Search")+'" role= "search"></span> </div>'):this.element.querySelector(".e-search-wrapper").innerHTML='<span id="'+this.gridID+'_clearbutton" class="e-input-group-icon e-icons e-sicon" tabindex="-1" role= "button" aria-label= "clear" ></span> <span id="'+this.gridID+'_searchbutton" class="e-input-group-icon e-search-icon e-icons" tabindex="-1" role= "button" title="'+this.l10n.getConstant("Search")+'"></span> </div>',this.element.querySelector("#"+kp(this.gridID+"_clearbutton")).style.cursor="default"),this.element.querySelector(".e-responsive-toolbar-items")&&(this.element.querySelector(".e-responsive-toolbar-items").innerHTML='<button id="'+this.gridID+'_responsivetoolbaritems" class="e-tbar-btn e-control e-btn e-lib e-icon-btn" type="button" data-ripple="true" tabindex="-1" data-tabindex="-1" aria-label="responsivetoolbaritems" aria-disabled="false" ><span class="e-btn-icon e-responsivetoolbaritems-btn e-icons"></span>',this.element.querySelector("#"+kp(this.gridID+"_responsivetoolbaritems")).style.width="auto"),this.bindSearchEvents()},f.prototype.renderFindInput=function(){var e,t,i=this.element.querySelector(".e-find-wrapper");i&&(e=this.l10n.getConstant("Find"),t=this.parent.cssClass?"e-input-group e-find "+this.parent.cssClass:"e-input-group e-find",i.innerHTML='<div class="'+t+'" role="search"> <input id="'+this.gridID+'_findbar" class="e-input e-find" name="input" type="text" aria-label="'+e+'" placeholder="'+e+'"/> <span id="'+this.gridID+'_findclearbutton" class="e-input-group-icon e-icons e-btn-icon e-close e-find-clear e-disabled" tabindex="-1" aria-label="'+this.l10n.getConstant("FindClear")+'" aria-disabled="true" role="button"></span> <span id="'+this.gridID+'_findcount" class="e-find-count e-input-group-icon" aria-live="polite">0/0</span> <span id="'+this.gridID+'_findprev" class="e-input-group-icon e-icons e-btn-icon e-chevron-left e-find-prev e-disabled" tabindex="-1" title="'+this.l10n.getConstant("FindPrevious")+'" aria-label="'+this.l10n.getConstant("FindPrevious")+'" aria-disabled="true" role="button"></span> <span id="'+this.gridID+'_findnext" class="e-input-group-icon e-icons e-btn-icon e-chevron-right e-find-next e-disabled" tabindex="-1" title="'+this.l10n.getConstant("FindNext")+'" aria-label="'+this.l10n.getConstant("FindNext")+'" aria-disabled="true" role="button"></span> </div>',this.findElement=H.select("#"+this.gridID+"_findbar",this.element),this.parent.findSettings&&this.parent.findSettings.key&&this.findElement&&(this.findElement.value=this.parent.findSettings.key),this.findKeyHandler=this.onFindKeyDown.bind(this),this.findInputHandler=this.onFindInput.bind(this),this.findElement&&(H.EventHandler.add(this.findElement,"keydown",this.findKeyHandler,this),H.EventHandler.add(this.findElement,"input",this.findInputHandler,this)),this.parent.findModule)&&this.parent.findModule.refreshHighlights()},f.prototype.isFindControlEnabled=function(e){return"true"!==e.getAttribute("aria-disabled")},f.prototype.onFindKeyDown=function(e){this.findElement&&this.parent.findModule&&("Enter"===e.key?(e.preventDefault(),e.shiftKey?this.parent.findPrevious():this.parent.findNext()):"Escape"===e.key&&(e.preventDefault(),this.findElement.value="",this.parent.clearFind()))},f.prototype.onFindInput=function(){this.findElement&&this.parent.findModule&&this.parent.find(this.findElement.value)},f.prototype.createToolbar=function(){var e=this.getItems(),e=(this.toolbar=new B.Toolbar({items:e,clicked:this.toolbarClickHandler.bind(this),enablePersistence:this.parent.enablePersistence,enableRtl:this.parent.enableRtl,created:this.toolbarCreated.bind(this),cssClass:this.parent.cssClass||""}),this.toolbar.isReact=this.parent.isReact,this.isVue3ToolbarTemplate()&&(this.toolbar.root=this.parent.root||this.parent),this.toolbar.on("render-react-toolbar-template",this.addReactToolbarPortals,this),this.toolbar.isStringTemplate=!0,"viewContainerRef"),e=(this.parent[e]&&(this.toolbar.registeredTemplate={},this.toolbar[e]=this.parent[e]),this.element=this.parent.createElement("div",{id:this.gridID+"_toolbarItems"}),this.parent.enableAdaptiveUI&&this.element.classList.add("e-res-toolbar"),this.parent.toolbarTemplate?(e=this.parent.isVue||this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isVue,"string"!=typeof this.parent.toolbarTemplate||e&&!document.querySelectorAll(this.parent.toolbarTemplate).length||!document.querySelector(this.parent.toolbarTemplate)||"script"===document.querySelector(this.parent.toolbarTemplate).tagName.toLowerCase()?(e=this.parent.isReact&&"string"!=typeof this.parent.toolbarTemplate&&!(this.parent.toolbarTemplate.prototype&&this.parent.toolbarTemplate.prototype.CSPTemplate),t=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,i=this.parent.element.id+"toolbarTemplate",e||t?(hp(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",i,null,null,this.element),this.parent.renderTemplates()):Ip(this.element,hp(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",null,null,null,null,this.parent.root))):(this.toolbar.appendTo(this.parent.toolbarTemplate),this.element=this.toolbar.element),this.element.classList.add("e-temp-toolbar")):this.toolbar.appendTo(this.element),this.parent.element.insertBefore(this.element,this.parent.getHeaderContent()),this.element.querySelector(".e-toolbar-left")),t=this.element.querySelector(".e-toolbar-center"),i=this.element.querySelector(".e-toolbar-right"),n=this.element.querySelector(".e-toolbar-items"),r=this.element,e=e?e.clientWidth:0,t=t?t.clientWidth:0,i=i?i.clientWidth:0,n=n?n.clientWidth:0,r=r?r.clientWidth:0;(r<e||r<t||r<i||r<n)&&this.toolbar.refreshOverflow()},f.prototype.addReactToolbarPortals=function(e){this.parent.isReact&&e&&(this.parent.portals=this.parent.portals.concat(e),this.parent.renderTemplates())},f.prototype.renderResponsiveSearch=function(e){var t;e?(this.toolbarCreated(!0),this.refreshResponsiveToolbarItems(oe.ResponsiveToolbarAction.isSearch),this.searchElement=H.select("#"+this.gridID+"_searchbar",this.element),(t=I(this.searchElement,"e-toolbar-right"))&&t.classList.add("e-responsive-right"),this.parent.searchSettings&&this.updateSearchBox()):this.refreshResponsiveToolbarItems(oe.ResponsiveToolbarAction.isInitial),this.toolbar.element&&this.toolbar.element.querySelector(".e-hscroll")&&this.toolbar.refreshOverflow(),e&&(this.searchBoxObj.searchFocus({target:this.searchElement}),this.searchElement.focus())},f.prototype.refreshResponsiveToolbarItems=function(e){if(e===oe.ResponsiveToolbarAction.isInitial){for(var t=this.parent.element.id,i=[t+"_edit",t+"_delete"],n=this.parent.getSelectedRowIndexes(),r=[t+"_responsiveback",t+"_update",t+"_cancel"],s=0,o=this.toolbar.items;s<o.length;s++)(h=(d=o[s]).template&&d.template.length?I(this.toolbar.element.querySelector("#"+kp(d.id)),"e-template").children[0]:this.toolbar.element.querySelector("#"+kp(d.id)))&&(-1<i.indexOf(d.id)?n.length?h.parentElement.classList.remove("e-hidden"):h.parentElement.classList.add("e-hidden"):-1===r.indexOf(d.id)||0<r.indexOf(d.id)&&this.parent.isEdit?h.parentElement.classList.remove("e-hidden"):h.parentElement.classList.add("e-hidden"));this.searchElement&&((t=I(this.searchElement,"e-toolbar-right"))&&t.classList.remove("e-responsive-right"),this.unWireEvent(),this.toolbarCreated(!1),this.searchElement=void 0)}if(e===oe.ResponsiveToolbarAction.isSearch)for(var i=[this.parent.element.id+"_responsiveback",this.parent.element.id+"_search"],a=0,l=this.toolbar.items;a<l.length;a++){var h,d=l[a];(h=this.toolbar.element.querySelector("#"+kp(d.id)))&&(-1<i.indexOf(d.id)?h.parentElement.classList.remove("e-hidden"):h.parentElement.classList.add("e-hidden"))}},f.prototype.refreshToolbarItems=function(){function e(e){return!H.isNullOrUndefined(o[""+e])&&0<o[""+e].length}var t=this.parent,i=[],n=[],r=t.editSettings,s="Batch"===r.mode,o=s&&!H.isNullOrUndefined(t.editModule)?t.editModule.getBatchChanges():{},a=t.editModule&&t.editModule.editModule&&t.editModule.editModule.isUndoAction&&t.editModule.editModule.undoStack.length<=0,l=e(ks),h=l||e(Ms)||e(Ps),l=!(!t.currentViewData||!t.currentViewData.length)||s&&l,d=r.showAddNewRow&&!t.element.querySelector(".e-editedrow");(r.allowAdding?i:n).push(this.gridID+"_add"),(r.allowEditing&&l?i:n).push(this.gridID+"_edit"),(r.allowDeleting&&l?i:n).push(this.gridID+"_delete"),(t.allowPdfExport&&l?i:n).push(this.gridID+"_pdfexport"),(t.allowExcelExport&&l?(i.push(this.gridID+"_excelexport"),i):(n.push(this.gridID+"_excelexport"),n)).push(this.gridID+"_csvexport"),(t.showColumnChooser?i:n).push(this.gridID+"_columnchooser"),s?(!h||!(r.allowAdding||r.allowEditing||r.allowDeleting)||a?n:i).push(this.gridID+"_update",this.gridID+"_cancel"):(t.isEdit||r.showAddNewRow)&&(r.allowAdding||r.allowEditing)?(i=d?[this.gridID+"_update",this.gridID+"_cancel",this.gridID+"_edit",this.gridID+"_delete"]:[this.gridID+"_update",this.gridID+"_cancel"],n=d?[this.gridID+"_add"]:[this.gridID+"_add",this.gridID+"_edit",this.gridID+"_delete"]):(n.push(this.gridID+"_update"),n.push(this.gridID+"_cancel")),(r.enableUndoRedo?((t.isUndoStackAvailable()?i:n).push(this.gridID+"_undo"),t.isRedoStackAvailable()?i:n):(n.push(this.gridID+"_undo"),n)).push(this.gridID+"_redo"),this.enableItems(i,!0),this.enableItems(n,!1)},f.prototype.getItems=function(){var e=[],t=this.parent.toolbar||[];if("string"==typeof this.parent.toolbar)return[];"Vertical"===this.parent.rowRenderingMode&&(this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&e.push(this.getItemObject("responsiveFilter")),this.parent.allowSorting)&&e.push(this.getItemObject("responsiveSort"));for(var i=0,n=t;i<n.length;i++){var r=n[i];if(!this.parent.enableAdaptiveUI||-1===["Print","ColumnChooser","PdfExport","ExcelExport","CsvExport"].indexOf(r))switch(this.parent.enableAdaptiveUI&&("object"==typeof r&&"Search"===r.text||"Search"===r)&&e.push(this.getItemObject("responsiveBack")),typeof r){case"number":e.push(this.getItemObject(this.items[r]));break;case"string":e.push(this.getItemObject(r));break;default:e.push(this.getItem(r))}}return this.parent.enableAdaptiveUI&&this.isResponsiveToolbarMenuItems(!1)&&e.push(this.getItemObject("responsiveToolbarItems")),e},f.prototype.getItem=function(e){var t=this.predefinedItems[e.text];return t?H.extend(t,t,e):e},f.prototype.getItemObject=function(e){return this.predefinedItems[""+e]||{text:e,id:this.gridID+"_"+e}},f.prototype.enableItems=function(e,t){for(var i=0,n=e;i<n.length;i++){var r=n[i],r=H.select("#"+r,this.element);r&&this.toolbar.enableItems(r.closest(".e-toolbar-item"),t)}},f.prototype.toolbarClickHandler=function(e){var s=this,o=this.parent,a=this.gridID,l=e.originalEvent;this.parent.enableAdaptiveUI&&e.item.id===a+"_responsivetoolbaritems"?this.openResponsiveToolbarMenuPopup(l,e.item.id):(H.extend(e,{cancel:!1}),o.trigger(Be,e,function(e){if(e.originalEvent=e.originalEvent||l,!e.cancel)switch(!H.isNullOrUndefined(e.item)&&e.item.id){case a+"_print":o.print();break;case a+"_edit":o.startEdit();break;case a+"_update":o.endEdit();break;case a+"_cancel":o.closeEdit();break;case a+"_add":o.addRecord();break;case a+"_delete":o.deleteRecord();break;case a+"_undo":o.undoEdit();break;case a+"_redo":o.redoEdit();break;case a+"_find":if(e.originalEvent&&e.originalEvent.target){var t=e.originalEvent.target;if(!s.isFindControlEnabled(t))break;t.id===a+"_findprev"?o.findPrevious():t.id===a+"_findnext"?o.findNext():t.id===a+"_findclearbutton"&&s.findElement&&(s.findElement.value="",o.clearFind())}break;case a+"_search":e.originalEvent.target.id===a+"_searchbutton"&&s.searchElement?s.search():!o.enableAdaptiveUI||s.searchElement||!e.originalEvent.target.classList.contains("e-search-wrapper")&&e.originalEvent.target.id!==a+"_searchbutton"?e.originalEvent.target.classList.contains("e-clear-icon")&&e.originalEvent.target.id===a+"_clearbutton"&&s.searchElement&&(s.clearSearchTimer(),s.searchElement.value="",s.searchElement&&(s.sIcon=s.searchElement.parentElement.querySelector(".e-sicon"),s.sIcon.classList.remove("e-clear-icon"),s.sIcon.removeAttribute("title"),s.sIcon.style.cursor="default"),s.isSearched||s.parent.searchSettings.key.length)&&(s.parent.search(s.searchElement.value),s.isSearched=!1):s.renderResponsiveSearch(!0);break;case a+"_advancedfilter":o.advancedFilterModule&&o.advancedFilterModule.openDialog();break;case a+"_columnchooser":var i,n,r;s.parent.enableAdaptiveUI?o.showResponsiveCustomColumnChooser():(r=(t=s.parent.element.querySelector(".e-ccdiv")).getBoundingClientRect().top,i=t.getBoundingClientRect().left,n=e.originalEvent.target,r=t.getBoundingClientRect().top+t.offsetTop,o.createColumnchooser(i,r,n));break;case a+"_responsivefilter":o.notify(Qr,{action:3}),o.showResponsiveCustomFilter();break;case a+"_responsivesort":o.notify(Qr,{action:2}),o.showResponsiveCustomSort();break;case a+"_responsiveback":s.renderResponsiveSearch(!1),s.toolbar.refreshOverflow()}}))},f.prototype.openResponsiveToolbarMenuPopup=function(e,t){var i={top:0,left:0},n=(this.toolbarMenuElement.style.cssText="display:block;visibility:hidden",this.toolbarMenuElement.getBoundingClientRect()),r=this.parent.element.getBoundingClientRect();this.toolbarMenuElement.style.cssText="display:none;visibility:visible",t=H.isNullOrUndefined(e)?this.parent.element.querySelector("#"+kp(t)):e.target,this.parent.enableRtl?(i=F.calculatePosition(t,"left","bottom"),this.isRightToolbarMenu&&(i.left-=n.width)):(i=F.calculatePosition(t,"right","bottom"),this.isRightToolbarMenu||(i.left-=n.width),i.left+n.width+1>=r.right&&(i.left-=35)),this.responsiveToolbarMenu.open(i.top,i.left),e&&e.preventDefault&&e.preventDefault(),pc(this.parent.element,this.responsiveToolbarMenu.element.parentElement)},f.prototype.getMenuItems=function(){for(var e=[],t=0,i=this.parent.toolbar||[];t<i.length;t++){var n=i[t];"string"!=typeof n||"ColumnChooser"!==n&&"PdfExport"!==n&&"ExcelExport"!==n&&"CsvExport"!==n&&"Print"!==n||e.push({text:this.getLocaleText(n),id:this.gridID+"_"+n.toLowerCase(),iconCss:"e-btn-icon e-"+n.toLowerCase()+" e-icons"})}return e},f.prototype.getLocaleText=function(e){var t;return"ColumnChooser"===e?t=this.l10n.getConstant("Columnchooser"):"PdfExport"===e?t=this.l10n.getConstant("Pdfexport"):"ExcelExport"===e?t=this.l10n.getConstant("Excelexport"):"CsvExport"===e?t=this.l10n.getConstant("Csvexport"):"Print"===e&&(t=this.l10n.getConstant("Print")),t},f.prototype.renderResponsiveToolbarpopup=function(){this.l10n=this.serviceLocator.getService("localization"),this.toolbarMenuElement=this.parent.createElement("ul",{id:this.gridID+"__toolbaritemsmenu",className:"e-responsivetoolbar-menu"}),this.element.setAttribute("aria-label",this.l10n.getConstant("ToolbarMenuDialogARIA")),this.parent.element.appendChild(this.toolbarMenuElement),this.responsiveToolbarMenu=new B.ContextMenu({cssClass:this.parent.cssClass?"e-grid-toolbarmenu e-bigger "+this.parent.cssClass:"e-grid-toolbarmenu e-bigger",enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,beforeOpen:this.beforeOpenResponsiveToolbarMenuItem.bind(this),items:this.getMenuItems(),select:this.ResponsiveToolbarMenuItemClick.bind(this)}),this.responsiveToolbarMenu.isAngular=Oc(this.parent),this.responsiveToolbarMenu.appendTo(this.toolbarMenuElement)},f.prototype.ResponsiveToolbarMenuItemClick=function(e){var t=this,i=this.parent,n=e.element,n=(e.item.id=n.id,{cancel:!1,name:"clicked",item:e.item,originalEvent:e.event});i.trigger(Be,n,function(e){if(!e.cancel)switch(!H.isNullOrUndefined(e.item)&&e.item.id){case t.gridID+"_columnchooser":i.notify(Qr,{action:5}),i.showResponsiveCustomColumnChooser();break;case t.gridID+"_print":i.print()}})},f.prototype.beforeOpenResponsiveToolbarMenuItem=function(){var i=this,n=this.parent.toolbar||[],e=[{key:"PdfExport",enabled:this.parent.allowPdfExport},{key:"ExcelExport",enabled:this.parent.allowExcelExport},{key:"CsvExport",enabled:this.parent.allowExcelExport},{key:"ColumnChooser",enabled:this.parent.showColumnChooser}],r=[],s=[];e.forEach(function(e){var t;-1!==n.indexOf(e.key)&&(t=i.getLocaleText(e.key),(e.enabled?r:s).push(t))}),this.responsiveToolbarMenu.enableItems(r,!0),this.responsiveToolbarMenu.enableItems(s,!1)},f.prototype.modelChanged=function(e){"edit"===e.module&&this.refreshToolbarItems()},f.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&this.parent.toolbar&&(this.element&&H.remove(this.element),this.render())},f.prototype.keyUpHandler=function(e){13===e.keyCode&&(this.parent.searchModule.refreshSearch=!1,this.search()),this.searchElement&&(this.sIcon=this.searchElement.parentElement.querySelector(".e-sicon"),this.searchElement.value.length&&!H.isNullOrUndefined(this.sIcon)?(this.sIcon.classList.add("e-clear-icon"),this.sIcon.setAttribute("title",this.l10n.getConstant("Clear")),this.sIcon.style.cursor="pointer"):(this.sIcon.classList.remove("e-clear-icon"),this.sIcon.removeAttribute("title"),this.sIcon.style.cursor="default"))},f.prototype.searchInputHandler=function(){this.clearSearchTimer(),"Immediate"===this.parent.searchSettings.mode&&this.startSearchTimer()},f.prototype.clearSearchTimer=function(){window.clearTimeout(this.searchTimer)},f.prototype.startSearchTimer=function(){var e=this;this.searchTimer=window.setTimeout(function(){"Immediate"===e.parent.searchSettings.mode&&(e.parent.searchModule.refreshSearch=!1,e.search())},this.parent.searchSettings.immediateModeDelay)},f.prototype.search=function(){this.clearSearchTimer(),this.isSearched=!0,this.parent.search(this.searchElement.value)},f.prototype.updateSearchBox=function(){this.searchElement&&(this.searchElement.value=this.parent.searchSettings.key)},f.prototype.wireEvent=function(){this.searchElement&&(this.searchBoxObj=new za(this.searchElement,this.serviceLocator),H.EventHandler.add(this.searchElement,"keyup",this.keyUpHandler,this),H.EventHandler.add(this.searchElement,"input",this.searchInputHandler,this),this.searchBoxObj.wireEvent()),H.EventHandler.add(this.element,"mousedown",this.mouseDownHandler,this),H.EventHandler.add(this.element,"focusin",this.onFocusIn,this),H.EventHandler.add(this.element,"focusout",this.onFocusOut,this)},f.prototype.unWireEvent=function(){this.clearSearchTimer(),this.searchElement&&(H.EventHandler.remove(this.searchElement,"input",this.searchInputHandler),H.EventHandler.remove(this.searchElement,"keyup",this.keyUpHandler),this.searchBoxObj.unWireEvent()),H.EventHandler.remove(this.element,"mousedown",this.mouseDownHandler),H.EventHandler.remove(this.element,"focusin",this.onFocusIn),H.EventHandler.remove(this.element,"focusout",this.onFocusOut)},f.prototype.onFocusIn=function(e){var t=this.parent.focusModule.currentInfo;t&&t.element&&(H.removeClass([t.element,t.elementToFocus],["e-focused","e-focus"]),t.element.tabIndex=-1),e.target.tabIndex=0,this.setFindFocus(e.target,!0)},f.prototype.setFindFocus=function(e,t){!e.matches(".e-find-wrapper .e-input-group-icon")||t&&!this.isKeyboardNavigation||e.classList.toggle("e-focused",t)},f.prototype.onFocusOut=function(e){e.target.tabIndex=-1,this.setFindFocus(e.target,!1),e.target&&e.target.id===this.parent.element.id+"_searchbar"&&(!e.relatedTarget||e.relatedTarget.id!==this.parent.element.id+"_clearbutton"&&e.relatedTarget.id!==this.parent.element.id+"_searchbutton")&&(this.parent.searchModule.refreshSearch=!1,this.search())},f.prototype.setFocusToolbarItem=function(e){var t=e.querySelector(".e-btn,.e-input,.e-toolbar-item-focus");(t=!t&&this.parent.enableAdaptiveUI&&!this.searchElement&&e.classList.contains("e-search-wrapper")?e.querySelector("#"+kp(this.gridID+"_searchbutton")):t).focus()},f.prototype.getFocusableToolbarItems=function(){for(var e=[].slice.call(this.element.querySelectorAll(".e-toolbar-item:not(.e-overlay):not(.e-hidden)")),t=[],i=0;i<e.length;i++)H.isNullOrUndefined(e[parseInt(i.toString(),10)].querySelector(".e-btn,.e-input,.e-toolbar-item-focus"))||t.push(e[parseInt(i.toString(),10)]);return t},f.prototype.enableAdvancedFilterButton=function(e){var t;this.toolbar&&this.toolbar.element&&(t="#"+this.gridID+'_advancedfilter, [data-item="AdvancedFilter"], [data-item="advancedfilter"], [title*="Advanced Filter"]',t=this.toolbar.element.querySelector(t))&&(t=t.querySelector(".e-btn-icon.e-icon-advanced-filter.e-icon-filter"))&&t.classList.toggle("e-filtered",e)},f.prototype.getFindControls=function(){return[].slice.call(this.element.querySelectorAll('.e-find-wrapper input.e-find, .e-find-wrapper [role="button"]:not([aria-disabled="true"])'))},f.prototype.getNextFindControl=function(e){if("tab"===e.action||"shiftTab"===e.action){var t=this.getFindControls(),i=e.target,n=t.indexOf(i);if(0<=n)return t[n+("tab"===e.action?1:-1)]||null;if("shiftTab"===e.action){t=I(i,"e-toolbar-item");if(t){n=t.previousElementSibling;if(n&&n.classList.contains("e-find-wrapper"))return this.getFindControls().pop()||null}}}return null},f.prototype.getBackwardEntryElement=function(e){return(e.classList.contains("e-find-wrapper")?this.getFindControls().pop():null)||e.querySelector(".e-toolbar-item-focus,.e-btn,.e-input")},f.prototype.mouseDownHandler=function(){this.isKeyboardNavigation=!1},f.prototype.keyPressedHandler=function(e){if("tab"!==e.action&&"shiftTab"!==e.action||(this.isKeyboardNavigation=!0),e.target&&I(e.target,"e-toolbar-item")){var t=this.getNextFindControl(e);if(t)e.preventDefault(),t.focus();else{var i=I(e.target,"e-toolbar-item"),n=this.getFocusableToolbarItems();if("tab"===e.action||"shiftTab"===e.action){if("tab"===e.action&&i===n[n.length-1]||"shiftTab"===e.action&&i===n[0])return;for(var r,s=0;s<n.length;s++)if(i===n[parseInt(s.toString(),10)])return e.preventDefault(),r="tab"===e.action?s+1:s-1,void this.setFocusToolbarItem(n[parseInt(r.toString(),10)])}"enter"===e.action&&this.parent.enableAdaptiveUI&&!this.searchElement&&e.target.id===this.gridID+"_searchbutton"&&this.renderResponsiveSearch(!0)}}},f.prototype.reRenderToolbar=function(){this.element&&H.remove(this.element),this.render()},f.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:Sr,handler:this.reRenderToolbar},{event:mt,handler:this.render},{event:St,handler:this.onPropertyChanged},{event:wt,handler:this.updateSearchBox.bind(this)},{event:bt,handler:this.refreshToolbarItems},{event:ri,handler:this.refreshToolbarItems},{event:wt,handler:this.modelChanged},{event:de,handler:this.refreshToolbarItems},{event:_t,handler:this.removeResponsiveSearch},{event:wr,handler:this.reRenderToolbar},{event:s,handler:this.destroy},{event:Gt,handler:this.keyPressedHandler}],Kc(this.parent,this.evtHandlers,!0,this),this.rowSelectedFunction=this.rowSelected.bind(this),this.rowDeSelectedFunction=this.rowSelected.bind(this),this.parent.addEventListener(ce,this.rowSelectedFunction),this.parent.addEventListener(ge,this.rowDeSelectedFunction))},f.prototype.removeEventListener=function(){this.parent.isDestroyed||(Kc(this.parent,this.evtHandlers,!1),this.parent.removeEventListener(ce,this.rowSelectedFunction),this.parent.removeEventListener(ge,this.rowDeSelectedFunction))},f.prototype.removeResponsiveSearch=function(e){var t=e.target,t=t.classList.contains("e-search-icon")||t.classList.contains("e-search-wrapper");this.parent.enableAdaptiveUI&&!t&&this.searchElement&&!I(e.target,"e-res-toolbar")&&this.renderResponsiveSearch(!1)},f.prototype.rowSelected=function(){this.parent.enableAdaptiveUI&&this.toolbar.element&&(this.refreshResponsiveToolbarItems(oe.ResponsiveToolbarAction.isInitial),this.toolbar.refreshOverflow())},f.prototype.getModuleName=function(){return"toolbar"};Oh=f;function f(e,t){this.predefinedItems={},this.isSearched=!1,this.items=["Add","Edit","Update","Delete","Cancel","Print","Search","Find","ColumnChooser","PdfExport","ExcelExport","CsvExport","WordExport","Undo","Redo","AdvancedFilter"],this.isRightToolbarMenu=!1,this.isKeyboardNavigation=!1,this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}mg=function(e,t){return(mg=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}mg(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Sg,yg=fo),Sg.prototype.renderPanel=function(){var e=this.parent.createElement("div",{className:Ss}),t=this.parent.createElement("div",{className:"e-summarycontent"});e.appendChild(t),this.setPanel(e),this.parent.allowPaging&&null!=this.parent.getPager()?this.parent.element.insertBefore(e,this.parent.getPager()):this.parent.element.appendChild(e)},Sg.prototype.renderTable=function(){var e=this.createContentTable("_footer_table").querySelector("."+Ds),t=this.parent.createElement("tfoot");e.appendChild(t),this.setTable(e)},Sg.prototype.renderSummaryContent=function(e,t,i,n){var r=this.parent.dataSource instanceof Array?!this.parent.getDataModule().isRemote()&&this.parent.parentDetails?this.getData():this.parent.dataSource:this.parent.currentViewData,s=this.modelGenerator.getData(),o=H.isNullOrUndefined(i)?this.modelGenerator.getColumns():this.modelGenerator.getColumns(i),a=H.isNullOrUndefined(i)?this.modelGenerator.generateRows(r,e||this.aggregates):this.modelGenerator.generateRows(r,e||this.aggregates,i,n),l=document.createDocumentFragment(),h=new $s(this.locator,null,this.parent);h.element=this.parent.createElement("TR",{className:"e-summaryrow",attrs:{role:"row"}});for(var d=0,p=s.length;d<p;d++){var c=a[parseInt(d.toString(),10)];if(c){c=h.render(c,o);if(c.querySelectorAll(".e-leftfreeze").length&&c.querySelectorAll(".e-indentcell").length)for(var u=c.querySelectorAll(".e-indentcell"),g=0;g<u.length;g++)u[parseInt(g.toString(),10)].classList.add("e-leftfreeze"),Lc(u[parseInt(g.toString(),10)],30*g,this.parent.enableRtl,"Left");this.parent.isFrozenGrid()&&c.querySelectorAll(".e-summarycell").length&&H.removeClass([].slice.call(c.querySelectorAll(".e-summarycell")),["e-freezeleftborder","e-freezerightborder"]),l.appendChild(c)}}r=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;(this.parent.isReact||r)&&s.length&&this.parent.isInitialLoad&&!this.parent.enableColumnVirtualization?this.parent.renderTemplates(function(){t.tFoot.innerHTML="",t.tFoot.appendChild(l)}):t.tFoot.appendChild(l),this.aggregates=H.isNullOrUndefined(e)?this.aggregates:e},Sg.prototype.refresh=function(e){var t=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact;(this.parent.isReact||t)&&this.parent.isInitialLoad&&!this.parent.enableColumnVirtualization||(this.getTable().tFoot.innerHTML=""),this.renderSummaryContent(e,this.getTable(),void 0,void 0),H.isNullOrUndefined(e)&&this.parent.isAutoFitColumns&&this.parent.autoFitColumns(),this.onScroll()},Sg.prototype.refreshCol=function(){var e=this.parent.enableColumnVirtualization?this.parent.headerModule.getColGroup():this.parent.element.querySelector("."+ms).querySelector(qs).cloneNode(!0);this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e)},Sg.prototype.onWidthChange=function(e){H.isNullOrUndefined(this.getColFromIndex(e.index))||(this.getColFromIndex(e.index).style.width=H.formatUnit(e.width)),this.parent.allowResizing&&"resize"===e.module&&this.updateFooterTableWidth(this.getTable())},Sg.prototype.onScroll=function(e){void 0===e&&(e={left:this.parent.getContent().firstChild.scrollLeft}),this.getTable().parentElement.scrollLeft=e.left},Sg.prototype.getColFromIndex=function(e){return this.getColGroup().children[parseInt(e.toString(),10)]},Sg.prototype.columnVisibilityChanged=function(){this.refresh()},Sg.prototype.addEventListener=function(){this.evtHandlers=[{event:It,handler:this.refreshCol},{event:Qt,handler:this.onWidthChange},{event:Wt,handler:this.onScroll},{event:Kt,handler:this.columnVisibilityChanged},{event:Nt,handler:this.refreshFooterRenderer}],Kc(this.parent,this.evtHandlers,!0,this)},Sg.prototype.removeEventListener=function(){Kc(this.parent,this.evtHandlers,!1)},Sg.prototype.updateFooterTableWidth=function(e){var t=this.parent.getHeaderTable();t&&e&&(e.style.width=t.style.width)},Sg.prototype.refreshFooterRenderer=function(e){e=this.onAggregates(e);this.refresh(e)},Sg.prototype.getIndexByKey=function(e,t){for(var i=this.parent.getPrimaryKeyFieldNames()[0],n=0;n<t.length;n++)if(t[parseInt(n.toString(),10)][""+i]===e[""+i])return n;return-1},Sg.prototype.getData=function(){return this.parent.getDataModule().dataManager.executeLocal(this.parent.getDataModule().generateQuery(!0))},Sg.prototype.onAggregates=function(n){n=n instanceof Array?n:[];var e,r=this.parent.getPrimaryKeyFieldNames()[0],t=[],i=!1,s={},o="dataSource",a=!1;if(this.parent.renderModule.data.isRemote()||!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result||!(this.parent.allowFiltering&&this.parent.filterSettings.columns.length||this.parent.searchSettings.key.length)||(a=!0),e=!H.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result?this.parent.getCurrentViewRecords():this.parent.dataSource instanceof Array?a?this.parent.getFilteredRecords():this.parent.dataSource:this.parent.dataSource[o].json.length?a?this.parent.getFilteredRecords():this.parent.dataSource[o].json:this.parent.getCurrentViewRecords(),this.parent.parentDetails&&!this.parent.getDataModule().isRemote()&&(e=this.getData()),this.parent.editModule&&(s=this.parent.editModule.getBatchChanges()),Object.keys(s).length){for(var l=0;l<e.length;l++)i=!1,s[Ms].length&&-1<this.getIndexByKey(e[parseInt(l.toString(),10)],s[Ms])&&(i=!0,t.push(s[Ms][this.getIndexByKey(e[parseInt(l.toString(),10)],s[Ms])])),s[Ps].length&&-1<this.getIndexByKey(e[parseInt(l.toString(),10)],s[Ps])?i=!0:i||t.push(e[parseInt(l.toString(),10)]);if(s[ks].length)for(l=0;l<s[ks].length;l++)t.push(s[ks][parseInt(l.toString(),10)])}else t=n.length?(c=lp(e)).map(function(e){var t,i=V.DataUtil.getObject(r,e);return n.some(function(e){return t=e,i===V.DataUtil.getObject(r,e)})?t:e}):e;for(var a=n,h=(a.type&&"cancel"===a.type&&(t=e),{}),d=this.parent.aggregates,l=0;l<d.length;l++)for(var p=0;p<d[parseInt(l.toString(),10)].columns.length;p++){var c=[];c=t;for(var u=0,g=d[parseInt(l.toString(),10)].columns[parseInt(p.toString(),10)].type.toString().split(",").map(function(e){return e.trim()});u<g.length;u++){var f=g[u],m=xp(f,c,d[parseInt(l.toString(),10)].columns[parseInt(p.toString(),10)],this.parent);h[d[parseInt(l.toString(),10)].columns[parseInt(p.toString(),10)].field+" - "+f.toLowerCase()]=m}}return{result:t,count:t.length,aggregates:h}};var mg,yg,vg=Sg;function Sg(e,t){var i=yg.call(this,e,t)||this;return i.aggregates={},i.parent=e,i.locator=t,i.modelGenerator=new io(i.parent),i.addEventListener(),i}Cg=function(e,t){return(Cg=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Cg(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ig,wg=vo),Ig.prototype.getValue=function(e,t,i){var n=H.isNullOrUndefined(i.type)?i.columnName:i.field+" - "+("string"==typeof i.type?i.type.toLowerCase():"");return t[i.columnName]?t[i.columnName][""+n]:""},Ig.prototype.evaluate=function(e,t,i,n){var r=t.column;if(this.parent.on(Bt,this.refreshWithAggregate(e,t),this),!(r.footerTemplate||r.groupFooterTemplate||r.groupCaptionTemplate))return"Vertical"===this.parent.rowRenderingMode&&(e.style.display="none"),!0;"Vertical"===this.parent.rowRenderingMode&&e.classList.add("e-lastsummarycell");var t=r.getTemplate(t.cellType),s=this.parent.getColumnByField(i[r.columnName].field),o=(H.isNullOrUndefined(s)||(i[r.columnName].headerText=s.headerText,s.isForeignColumn()&&(o=s.columnData.filter(function(e){return e[s.foreignKeyField]===i[r.columnName].key})[0])&&(i[r.columnName].foreignKey=o[s.foreignKeyValue])),r.footerTemplate?"string"!=typeof r.footerTemplate&&!(r.footerTemplate.prototype&&r.footerTemplate.prototype.CSPTemplate):r.groupFooterTemplate?"string"!=typeof r.groupFooterTemplate&&!(r.groupFooterTemplate.prototype&&r.groupFooterTemplate.prototype.CSPTemplate):!(!r.groupCaptionTemplate||"string"==typeof r.groupCaptionTemplate||r.groupCaptionTemplate.prototype&&r.groupCaptionTemplate.prototype.CSPTemplate)),a=this.parent.isReact&&o,o=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact&&o,l=this.parent.printGridParent&&this.parent.printGridParent.isReact;return a||o||l?(a=i[r.columnName],"groupCaptionTemplate"!==t.property&&"groupFooterTemplate"!==t.property||(a.groupKey=a.key),t.fn(a,this.parent,t.property,"",null,null,e),this.parent.isInitialLoad||this.parent.renderTemplates()):Ip(e,t.fn(i[r.columnName],this.parent,t.property,"",null,null,null,this.parent.root)),!1},Ig.prototype.refreshWithAggregate=function(n,e){var r=this,s=e;return function(e){var t=s,i=t.column.columnName||null,t=H.isNullOrUndefined(i)?null:e.cells.filter(function(e){return e.column.columnName===i})[0];n.parentElement&&n.parentElement.getAttribute("data-uid")===e.dataUid&&i&&t&&i===t.column.columnName&&r.refreshTD(n,t,e.data)}};var Cg,wg,bg=Ig;function Ig(){var e=null!==wg&&wg.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-summarycell",attrs:{tabindex:"-1",role:"gridcell"}}),e}xg.prototype.observe=function(e,t){var i=this;this.containerRect=this.options.container.getBoundingClientRect(),H.EventHandler.add(this.options.container,"wheel",function(){return i.fromWheel=!0},this),H.isNullOrUndefined(this.options.horizontalScrollbar)||(H.EventHandler.add(this.options.horizontalScrollbar,"wheel",function(){return i.fromWheel=!0},this),H.EventHandler.add(this.options.horizontalScrollbar,"scroll",this.onVirtualContentScroll(),this)),H.isNullOrUndefined(this.options.verticalScrollbar)||(H.EventHandler.add(this.options.verticalScrollbar,"wheel",function(){return i.fromWheel=!0},this),H.EventHandler.add(this.options.verticalScrollbar,"scroll",this.onVirtualContentScroll(),this)),H.EventHandler.add(this.options.container,"scroll",this.virtualScrollHandler(e,t),this)},xg.prototype.check=function(e){e=this.sentinelInfo[""+e];return e.check(this.element.getBoundingClientRect(),e)},xg.prototype.onVirtualContentScroll=function(){var i=this;return function(e){var e=e.target,t=i.options.container;e.classList.contains("e-virtual-vertical-scrollbar")&&t.scrollTop!==e.scrollTop&&(t.scrollTop=e.scrollTop),e.classList.contains("e-virtual-horizontal-scrollbar")&&t.scrollLeft!==e.scrollLeft&&(t.scrollLeft=e.scrollLeft)}},xg.prototype.virtualScrollHandler=function(e,s){var o=this,t="chrome"===H.Browser.info.name?200:100,t=H.isNullOrUndefined(this.options.scrollThrottle)?t:this.options.scrollThrottle,a=0<t?H.debounce(e,t):e,l=H.debounce(e,50);return this.options.prevTop=this.options.prevLeft=0,function(e){var t,i=e.target.scrollTop,e=e.target.scrollLeft,n=o.options.prevTop<i?"down":"up",n=o.options.prevLeft===e?n:o.options.prevLeft<e?"right":"left",r=(o.options.prevTop=i,o.options.prevLeft=e,requestAnimationFrame(function(){var e=o.options.container.scrollTop,t=o.options.container.scrollLeft;H.isNullOrUndefined(o.options.verticalScrollbar)||o.options.verticalScrollbar.scrollTop===e||(o.options.verticalScrollbar.scrollTop=e),H.isNullOrUndefined(o.options.horizontalScrollbar)||o.options.horizontalScrollbar.scrollLeft===t||(o.options.horizontalScrollbar.scrollLeft=t)}),o.sentinelInfo[n]);-1!==o.options.axes.indexOf(r.axis)&&(o.containerRect=o.options.container.getBoundingClientRect(),t=o.check(n),r.entered&&s(o.element,r,n,{top:i,left:e},o.fromWheel,t),t&&("X"===r.axis?l:a)({direction:n,sentinel:r,offset:{top:i,left:e},focusElement:document.activeElement}),o.fromWheel=!1)}},xg.prototype.setPageHeight=function(e){this.options.pageHeight=e};var Rg=xg;function xg(e,t,i){var r=this;this.fromWheel=!1,this.touchMove=!1,this.options={},this.sentinelInfo={up:{check:function(e,t){var i=e.top-r.containerRect.top,n=r.containerRect.bottom>e.bottom?r.containerRect.bottom-e.bottom:0;return t.entered=0<=i,0<=i+r.options.pageHeight/2||0<n&&0<e.bottom},axis:"Y"},down:{check:function(e,t){var i=e.bottom;return t.entered=e.bottom<=r.containerRect.bottom,i-r.containerRect.top-r.options.pageHeight/2<=r.options.pageHeight/2},axis:"Y"},right:{check:function(e,t){e=e.right;return t.entered=e<r.containerRect.right,e-r.containerRect.width<=r.containerRect.right},axis:"X"},left:{check:function(e,t){e=e.left;return t.entered=0<e,e+r.containerRect.width>=r.containerRect.left},axis:"X"}},this.element=e,this.options=t,this.movableEle=i}Tg.prototype.columnInfiniteRows=function(e,t){var i,n=[];return"virtualscroll"===t.requestType?(i=this.parent.getRowsObject(),n.push.apply(n,this.rowModelGenerator.refreshRows(i)),this.parent.infiniteScrollSettings.enableCache&&(i=this.parent.frozenRows&&1===this.parent.pageSettings.currentPage?0:iu(this.parent.getContentTable().querySelector(".e-row:not(.e-addedrow)")),i=n.slice(i,i+3*this.parent.pageSettings.pageSize),n=i=this.parent.frozenRows&&1!==this.parent.pageSettings.currentPage?n.slice(0,this.parent.frozenRows).concat(i):i)):n.push.apply(n,this.rowModelGenerator.generateRows(e,t)),n},Tg.prototype.generateRows=function(p,c){var i=this;if(this.parent.enableColumnVirtualization&&this.parent.enableInfiniteScrolling)return this.columnInfiniteRows(p,c);var u=!1,g=c.virtualInfo=c.virtualInfo||("sorting"===c.requestType||"delete"===c.requestType)&&hu(this.parent)&&this.prevInfo||this.getData(),f=(this.prevInfo=g).sentinelInfo&&"X"===g.sentinelInfo.axis,e=(f||!g.loadNext||g.loadSelf?g:g.nextInfo).page,m=[],y=this.getBlockIndexes(e),v=[];if(this.currentInfo.blockIndexes&&(y=g.blockIndexes=c.virtualInfo.blockIndexes=this.includePrevPage?this.currentInfo.blockIndexes.slice(1):this.currentInfo.blockIndexes.slice(0,this.currentInfo.blockIndexes.length-1),u=!0),this.checkAndResetCache(c.requestType),"pin-row"!==c.requestType&&"unpin-row"!==c.requestType&&"refresh"!==c.requestType||(this.startIndex=null),tc(this.parent)&&this.parent.vcRows.length){e=this.parent.vcRows.filter(function(e){return e.isDataRow});if(this.parent.isManualRefresh&&e.length===p.records.length||!this.parent.isManualRefresh)return m=this.parent.vcRows}if(this.parent.enableColumnVirtualization)for(var t=0;t<g.blockIndexes.length;t++)this.isBlockAvailable(g.blockIndexes[parseInt(t.toString(),10)])&&(this.cache[g.blockIndexes[parseInt(t.toString(),10)]]=this.rowModelGenerator.refreshRows(this.cache[g.blockIndexes[parseInt(t.toString(),10)]]));for(var S=g.blockIndexes,C=this,t=0;t<S.length;t++)!function(e){if(!C.isBlockAvailable(S[parseInt(e.toString(),10)])){var t=H.isNullOrUndefined(C.startIndex)||isNaN(C.startIndex)?C.getStartIndex(S[parseInt(e.toString(),10)],p):C.startIndex,t=!tc(C.parent)||C.parent.vcRows.length||"sorting"!==c.requestType&&"delete"!==c.requestType&&"refresh-aggregate-on-save"!==c.requestType?t:0,i=C.rowModelGenerator.generateRows(p,{virtualInfo:g,startIndex:t});tc(C.parent)&&!C.parent.vcRows.length&&(C.recordsCount=p.records.length,C.parent.vRows=i,C.parent.vcRows=i,C.parent.notify(Ir,{}));if(tc(C.parent))C.getGroupVirtualRecordsByIndex(i);else if(u)C.setBlockForManualRefresh(C.cache,y,i);else if(("sorting"===c.requestType||"delete"===c.requestType||C.parent.isTreeGrid&&C.parent.getDataModule().isRemote()&&"refresh"===c.requestType)&&hu(C.parent))for(var n=du(g.blockIndexes),r=0,s=0;s<n.length;s++){var o=C.getBlockIndexes(n[parseInt(s.toString(),10)]),a=C.model.pageSize*s,l=a+C.model.pageSize,h=(C.parent.allowGrouping&&C.parent.groupSettings.columns.length&&(h=i.filter(function(e){return e.isDataRow}).slice(a,l),a=r,l=i.indexOf(h[h.length-1])+1),i.slice(a,l)),a=~~Math.max(h.length,C.model.pageSize)/2;C.isBlockAvailable(o[0])||(C.cache[o[0]]=h.slice(0,a)),C.isBlockAvailable(o[1])||(C.cache[o[1]]=h.slice(a)),r=l}else t=~~Math.max(i.length,C.model.pageSize)/2,C.isBlockAvailable(y[0])||(C.cache[y[0]]=i.slice(0,t)),C.isBlockAvailable(y[1])||(C.cache[y[1]]=i.slice(t))}var d;C.parent.groupSettings.columns.length&&!f&&C.cache[S[parseInt(e.toString(),10)]]&&!C.parent.groupSettings.enableLazyLoading&&(C.cache[S[parseInt(e.toString(),10)]]=C.updateGroupRow(C.cache[S[parseInt(e.toString(),10)]],S[parseInt(e.toString(),10)])),c.renderMovableContent||c.renderFrozenRightContent||!C.cache[S[parseInt(e.toString(),10)]]||(m.push.apply(m,C.cache[S[parseInt(e.toString(),10)]]),d=[],C.parent.enableVirtualization&&C.parent.groupSettings.columns.length&&m.forEach(function(e){d.includes(e)||d.push(e)}),m=d.length?d:m),C.isBlockAvailable(S[parseInt(e.toString(),10)])&&v.push(S[parseInt(e.toString(),10)])}(t);if(tc(this.parent)&&this.parent.vcRows.length&&"sorting"===c.requestType&&0!==c.scrollTop.top)return m=this.parent.vcRows;g.blockIndexes=v;var n="records";return this.parent.allowGrouping&&this.parent.groupSettings.columns.length?this.parent.groupSettings.enableLazyLoading?m.filter(function(e){e.isDataRow&&(i.parent.currentViewData[e.index]=e.data)}):this.parent.currentViewData[n]=m.map(function(e){return e.data}):this.parent.currentViewData=m.map(function(e){return e.data}),"grouping"===c.requestType&&(this.parent.currentViewData[n]=this.parent.currentViewData[n].filter(function(e,t){return i.parent.currentViewData[n].indexOf(e)===t})),tc(this.parent)&&this.parent.vcRows.length&&["save","delete","refresh-aggregate-on-save"].some(function(e){return c.requestType===e})?m=this.parent.vcRows:m},Tg.prototype.generatePinnedTopRows=function(e){return this.rowModelGenerator.generatePinnedTopRows(e)},Tg.prototype.setBlockForManualRefresh=function(e,t,i){var n=this.model.pageSize/2;this.includePrevPage?(e[t[0]-1]=i.slice(0,n),e[t[0]]=i.slice(n,2*n),e[t[1]]=i.slice(2*n,3*n),e[t[2]]=i.slice(3*n,4*n)):(e[t[0]]=i.slice(0,n),e[t[1]]=i.slice(n,2*n),e[t[2]]=i.slice(2*n,3*n),e[t[2]+1]=i.slice(3*n,4*n))},Tg.prototype.getBlockIndexes=function(e){return[e+(e-1),2*e]},Tg.prototype.getPage=function(e){return e%2==0?e/2:(e+1)/2},Tg.prototype.isBlockAvailable=function(e){return e in this.cache},Tg.prototype.getData=function(){return{page:this.model.currentPage,blockIndexes:this.getBlockIndexes(this.model.currentPage),direction:"down",columnIndexes:this.parent.getColumnIndexesInView()}},Tg.prototype.getStartIndex=function(e,t,i){void 0===i&&(i=!0);var n=(this.getPage(e)-1)*this.model.pageSize+this.parent.pinnedTopRowModels.length;return i||!(e%2==0)?n:n+~~(this.model.pageSize/2)},Tg.prototype.getColumnIndexes=function(e){var i=this,n=(void 0===e&&(e=this.parent.getHeaderContent().querySelector("."+Cs)),[]),t=0|e.scrollLeft,r=Object.keys(this.cOffsets),e=e.getBoundingClientRect().width,t=Math.min(this.cOffsets[r.length-1]-e,t),s=H.Browser.isDevice?2*e:e/2,o=t+e+(0===t?s:0),a=0,l=t-s;if(this.parent.isFrozenGrid()){if(a=this.parent.leftrightColumnWidth("left"),0<l)for(var h=this.parent.getVisibleFrozenLeftCount()-1;0<=h;h--)if(l<=this.cOffsets[parseInt(h.toString(),10)]){a-=this.cOffsets[parseInt(h.toString(),10)];break}this.parent.getFrozenMode()===Ls&&(e=this.parent.getVisibleFrozenRightCount(),r.splice(r.length-1-e,e))}var d=this.parent.getVisibleFrozenLeftCount();return r.some(function(e){var t=Number(e),e=i.cOffsets[""+e];return(l<0&&t<d||l+a<=e&&e<=o+s)&&n.push(t),o+s<e}),n},Tg.prototype.checkAndResetCache=function(t){var e=["paging","refresh","sorting","filtering","searching","grouping","ungrouping","reorder","save","delete","refresh-aggregate-on-save","pin-row","unpin-row"].some(function(e){return t===e});return e&&(this.cache={},this.data={},this.groups={}),e},Tg.prototype.refreshColOffsets=function(){for(var e=this,t=0,i=(this.cOffsets={},this.parent.groupSettings.columns.length),n=this.parent.getVisibleColumns(),r=n.length,s=this.parent.groupSettings.columns,o=0;o<s.length;o++)this.cOffsets[parseInt(o.toString(),10)]=30+(0|this.cOffsets[o-1]);for(var a,l=Array.apply(null,Array(r)).map(function(){return t++}),h=0;h<l.length;h++)l[parseInt(h.toString(),10)]=l[parseInt(h.toString(),10)]+i,this.cOffsets[l[parseInt(h.toString(),10)]]=(0|this.cOffsets[l[parseInt(h.toString(),10)]-1])+((a=n[parseInt(h.toString(),10)]).visible&&(e.parent.groupSettings.showGroupedColumn?a.visible:e.parent.groupSettings.columns.indexOf(a.field)<0)?parseInt(n[parseInt(h.toString(),10)].width,10):0)},Tg.prototype.updateGroupRow=function(e,t){for(var i=e[0],n=[],r=Object.keys(this.cache),s=0;s<r.length;s++)Number(r[parseInt(s.toString(),10)])<t&&(n=n.concat(this.cache[r[parseInt(s.toString(),10)]]));return i&&i.isDataRow||t%2==0?e:this.iterateGroup(e,n)},Tg.prototype.iterateGroup=function(e,t){var i=e[0],n=0;return i&&i.isDataRow||e.some(function(i){return t.some(function(e,t){e=e&&void 0!==e.data.field&&e.data.field===i.data.field&&e.data.key===i.data.key;return e&&(n=t),e})})&&(e.shift(),e=this.iterateGroup(e,t.slice(n))),e},Tg.prototype.getRows=function(){for(var e=[],t=Object.keys(this.cache),i=0;i<t.length;i++)e=e.concat(this.cache[t[parseInt(i.toString(),10)]]);return e},Tg.prototype.generateCells=function(e){for(var t=[],i=this.parent.columnModel,n=0;n<i.length;n++)t.push(this.rowModelGenerator.generateCell(i[parseInt(n.toString(),10)],null,null,null,null,e));return t},Tg.prototype.getGroupVirtualRecordsByIndex=function(e){var t=this.parent.contentModule.getGroupedTotalBlocks(),i=this.parent.contentModule.getBlockSize();if(0===Object.keys(this.cache).length)for(var n=0,r=1;r<=t;r++){var s=0;this.cache[parseInt(r.toString(),10)]=[];for(var o=(r-1)*i+n;o<e.length&&s!==i;o++)this.cache[parseInt(r.toString(),10)].push(e[parseInt(o.toString(),10)]),e[parseInt(o.toString(),10)].isDataRow&&s++,n++;n-=s}};var Dg=Tg;function Tg(e){this.cOffsets={},this.cache={},this.rowCache={},this.data={},this.groups={},this.currentInfo={},this.prevInfo={},this.parent=e,this.model=this.parent.pageSettings,this.rowModelGenerator=new(this.parent.allowGrouping?uo:Js)(this.parent)}Eg=function(e,t){return(Eg=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Eg,Og,t=function(e,t){function i(){this.constructor=e}Eg(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ag=(t(m,Og=fo),m.prototype.renderTable=function(){this.header=this.locator.getService("rendererFactory").getRenderer(oe.RenderType.Header),Og.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.gridContent=this.parent.element.querySelector("."+vs),this.virtualEle.content=this.content=this.getPanel().querySelector("."+xs),this.virtualEle.renderWrapper(this.parent.height),this.virtualEle.renderPlaceHolder(),this.parent.enableSeamlessScrolling&&(this.parent.enableVirtualization&&this.virtualEle.renderVerticalScrollbar(),this.parent.enableColumnVirtualization)&&Number(this.widthServices.getTableWidth(this.parent.getColumns()))>this.content.clientWidth&&this.virtualEle.renderHorizontalScrollbar(),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||(this.virtualEle.wrapper.style.position="absolute");var e=this.parent.dataSource instanceof V.DataManager&&!this.parent.dataSource.dataSource.offline,e={container:this.content,pageHeight:2*this.getBlockHeight(),debounceEvent:e,axes:this.parent.enableColumnVirtualization?["X","Y"]:["Y"],verticalScrollbar:this.virtualEle.verticalScrollbar,horizontalScrollbar:this.virtualEle.horizontalScrollbar};this.observer=new Rg(this.virtualEle.wrapper,e)},m.prototype.renderEmpty=function(e){this.getTable().appendChild(e),(this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&(this.parent.getHeaderContent().querySelector(j).innerHTML=""),this.virtualEle.adjustTable(0,0)},m.prototype.getReorderedFrozenRows=function(e){var t,i,n,r;return H.isNullOrUndefined(e.virtualInfo)?[]:(t=e.virtualInfo.blockIndexes,i=e.virtualInfo.columnIndexes,n=e.virtualInfo.page,e.virtualInfo.blockIndexes=[1,2],e.virtualInfo.page=1,e.virtualInfo.columnIndexes=[],r=this.parent.getCurrentViewRecords().length,r=this.parent.renderModule.data.dataManager.dataSource.json.slice(0,r),r=this.vgenerator.generateRows(r,e),e.virtualInfo.blockIndexes=t,e.virtualInfo.columnIndexes=i,e.virtualInfo.page=n,r.splice(0,this.parent.frozenRows))},m.prototype.scrollListener=function(e){if((this.parent.enableVirtualization||!this.parent.enableColumnVirtualization||"up"!==e.direction&&"down"!==e.direction)&&!this.isBottomNotify)if(this.scrollAfterEdit(),this.parent.enablePersistence&&(this.parent.scrollPosition=e.offset),this.preventEvent||this.parent.isDestroyed)this.preventEvent=!1;else if(H.isNullOrUndefined(document.activeElement)?this.isFocused=!1:this.isFocused=this.content===H.closest(document.activeElement,"."+xs)||this.content===document.activeElement,this.parent.islazyloadRequest&&"down"===e.direction)this.parent.removeMaskRow(),this.parent.islazyloadRequest=!1;else{var t=e.sentinel,i=this.currentInfo=this.getInfoFromView(e.direction,t,e.offset);if(tc(this.parent))return i.blockIndexes&&this.prevInfo.blockIndexes.toString()===i.blockIndexes.toString()?void this.parent.removeMaskRow():(i.event="refresh-virtual-block",H.isNullOrUndefined(i.offsets)||(i.offsets.top=this.content.scrollTop),this.parent.pageSettings.currentPage=i.page,this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(t.axis),this.parent.addShimmerEffect()),this.parent.editSettings.showAddNewRow&&this.parent.closeEdit(),void this.parent.notify(i.event,{requestType:"virtualscroll",virtualInfo:i,focusElement:e.focusElement}));if(this.prevInfo&&("Y"===t.axis&&this.prevInfo.blockIndexes.toString()===i.blockIndexes.toString()||"X"===t.axis&&this.prevInfo.columnIndexes.toString()===i.columnIndexes.toString()||this.parent.isFrozenGrid()&&"X"===t.axis&&this.parent.getVisibleFrozenLeftCount()>=i.columnIndexes[0]&&this.prevInfo.columnIndexes.toString().includes(i.columnIndexes.toString())))this.parent.removeMaskRow(),H.Browser.isIE&&this.parent.hideSpinner(),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,"Y"===t.axis&&this.restoreEdit(),this.parent.groupSettings.enableLazyLoading&&1===this.prevInfo.blockIndexes[0]&&1===i.blockIndexes[0]&&"up"===e.direction&&this.virtualEle.adjustTable(0,i.offsets.top<this.offsets[1]?0:this.getBlockHeight());else{if(this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?i.columnIndexes:[]),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||(this.parent.pageSettings.currentPage=(i.loadNext&&!i.loadSelf?i.nextInfo:i).page),this.requestType="virtualscroll",this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(t.axis),this.parent.addShimmerEffect()),this.parent.islazyloadRequest=!1,this.parent.editSettings.showAddNewRow&&this.parent.closeEdit(),this.parent.notify(Xr,{action:"clear"}),this.parent.isInitialLoad||!this.parent.enablePersistence){if(this.prevPage===this.parent.pageSettings.currentPage&&i.event===bt)return void(this.currentInfo=this.prevCurrentInfo);i.event===bt&&(this.prevPage=this.parent.pageSettings.currentPage,this.prevCurrentInfo=this.currentInfo),this.isBottomNotify=this.isBottom&&i.event===bt,this.parent.notify(i.event,{requestType:"virtualscroll",virtualInfo:i,focusElement:e.focusElement})}this.parent.enableColumnVirtualization&&!this.parent.getContentTable().querySelector("tr.e-row")&&(this.parent.removeMaskRow(),this.appendContent(void 0,void 0,{requestType:"virtualscroll",virtualInfo:i,focusElement:e.focusElement}),this.prevInfo=i)}}},m.prototype.block=function(e){return this.vgenerator.isBlockAvailable(e)},m.prototype.getInfoFromView=function(e,t,i){var n=!1,r=[],s={direction:e,sentinelInfo:t,offsets:i,startIndex:this.preStartIndex,endIndex:this.preEndIndex},i=(s.page=this.getPageFromTop(i.top,s),s.blockIndexes=r=this.vgenerator.getBlockIndexes(s.page),s.loadSelf=!this.vgenerator.isBlockAvailable(r[s.block]),this.ensureBlocks(s));if("upArrow"===this.activeKey&&s.blockIndexes.toString()!==i.toString()&&(o=i[i.length-1],-1===s.blockIndexes.indexOf(o))&&(n=!0),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||(s.blockIndexes=i),s.loadNext=!i.filter(function(e){return-1===r.indexOf(e)}).every(this.block.bind(this)),s.event=s.loadNext||s.loadSelf?bt:ii,s.nextInfo=s.loadNext?{page:Math.max(1,s.page+("down"===e?1:-1))}:{},n&&(s.blockIndexes=[s.blockIndexes[0]-1,s.blockIndexes[0],s.blockIndexes[0]+1]),"downArrow"===this.activeKey&&!isNaN(this.rowIndex)){var o=Math.ceil(this.rowIndex/this.getBlockSize());if(1!==o&&(s.blockIndexes[1]!==o||s.blockIndexes.length<3)&&(s.blockIndexes=[o-1,o,o+1],s.loadNext)){for(var a=this.vgenerator.getBlockIndexes(s.nextInfo.page),l=!1,h=0;h<s.blockIndexes.length;h++){for(var d=0;d<a.length;d++)if(s.blockIndexes[parseInt(h.toString(),10)]===a[parseInt(d.toString(),10)]){l=!0;break}if(l)break}l||(s.loadNext=!1,s.nextInfo={},s.event=ii)}}return s.columnIndexes="X"===t.axis?this.vgenerator.getColumnIndexes():this.parent.getColumnIndexesInView(),this.parent.enableColumnVirtualization&&"X"===t.axis&&(s.event=ii),s},m.prototype.ensureBlocks=function(e){var i,n=this,t=e.blockIndexes[e.block],r=t,s=Math.max,o="down"===e.direction?[s(t,1),++t,++t]:[s(t-1,1),t,t+1],a=(this.prevInfo=this.prevInfo||this.vgenerator.getData(),o=o.filter(function(e,t){return o.indexOf(e)===t}),!1);return o=(!this.parent.allowGrouping||!this.parent.groupSettings.columns.length)&&0<this.parent.totalDataRecordsCount&&this.parent.totalDataRecordsCount<=this.parent.pageSettings.pageSize?this.parent.totalDataRecordsCount<=this.getBlockSize()?[1]:[1,2]:(hu(this.parent)&&"up"===e.direction&&((e.page+1===this.prevInfo.page||e.page===this.prevInfo.page)&&(1===e.block||0===e.block&&1===e.page)||e.page===this.prevInfo.page&&2===o.length)&&this.vgenerator.isBlockAvailable(e.blockIndexes[1]+1)&&(a=e.page+1===this.prevInfo.page&&1===e.block,o=[s((t+=1)-1,1),t,t+1]),this.prevInfo.blockIndexes.toString()!==o.toString()&&((o=e.loadSelf&&!a||"down"===e.direction&&this.isEndBlock(r)?this.vgenerator.getBlockIndexes(e.page):o).some(function(e,t){e=e===(tc(n.parent)?n.getGroupedTotalBlocks():n.getTotalBlocks());return e&&(i=t),e}),void 0!==i)&&(o=o.slice(0,i+1),0===e.block)&&1===o.length&&this.vgenerator.isBlockAvailable(o[0]-1)?[o[0]-1,o[0]]:o)},m.prototype.appendContent=function(e,t,i){var n,r=this,s=i.virtualInfo.sentinelInfo&&"Y"===i.virtualInfo.sentinelInfo.axis&&this.currentInfo.page&&this.currentInfo.page!==i.virtualInfo.page?this.currentInfo:i.virtualInfo,o=(this.prevInfo=this.prevInfo||i.virtualInfo,s.columnIndexes[0]-1),a=this.getColumnOffset(o),l=s.blockIndexes,h=(this.parent.groupSettings.columns.length&&this.refreshOffsets(),("100%"===this.parent.height||"string"==typeof this.parent.height&&-1!==this.parent.height.toLowerCase().indexOf("vh"))&&(this.parent.element.style.height=this.parent.height),(this.parent.height.toString().indexOf("%")<0?this.content:this.parent.element).getBoundingClientRect().height),d=("string"==typeof this.parent.height&&-1!==this.parent.height.toLowerCase().indexOf("vh")&&(h=fu(this.parent.height)),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization&&(h=0),0);if(this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&(n=0,this.parent.getColumns().filter(function(e){e.visible&&(d+=parseInt(e.width.toString(),10),"Left"===e.freeze)&&(n+=parseInt(e.width.toString(),10))}),u=s.columnIndexes,c=this.getColumnOffset(u[u.length-1])-this.getColumnOffset(u[0]-1)+"",o>this.parent.getVisibleFrozenLeftCount()&&(a-=n),this.resetStickyLeftPos(a,t)),this.requestTypes.some(function(e){return e===r.requestType})||(o=this.getTranslateY(this.content.scrollTop,h,s),this.parent.groupSettings.enableLazyLoading&&s&&this.prevInfo&&1===this.prevInfo.blockIndexes[0]&&1===s.blockIndexes[0]&&"up"===s.direction?this.virtualEle.adjustTable(0,this.content.scrollTop<this.offsets[1]?0:this.getBlockHeight()):this.virtualEle.adjustTable(a,o)),this.parent.enableColumnVirtualization&&(this.header.virtualEle.adjustTable(a,0),this.parent.aggregates.length)&&this.updateVirtualFooterPosition(a),this.parent.enableColumnVirtualization&&(u=s.columnIndexes,c=this.getColumnOffset(u[u.length-1])-this.getColumnOffset(u[0]-1)+"",this.parent.isFrozenGrid()&&(c=d.toString(),this.parent.allowResizing)&&(this.parent.getHeaderTable().style.width=d+"px",this.parent.getContentTable().style.width=d+"Px"),this.header.virtualEle.setWrapperWidth(c),this.parent.aggregateModule)&&this.parent.aggregates&&this.parent.aggregates.length&&(h=this.parent.aggregateModule.footerRenderer)&&h.virtualElement&&h.virtualElement.setWrapperWidth(c),this.virtualEle.setWrapperWidth(c,H.Browser.isIE||"edge"===H.Browser.info.name),!(this.parent.enableColumnVirtualization&&H.isNullOrUndefined(e)&&H.isNullOrUndefined(t))){H.isNullOrUndefined(e)||H.isNullOrUndefined(e.parentNode)||H.remove(e);o=this.parent.element.querySelector("."+xs).querySelector(j);if(o&&(H.remove(o),e=null),this.parent.isReact&&!H.isNullOrUndefined(this.parent.rowTemplate)?e=t:(e=this.parent.createElement(j,{attrs:{role:"rowgroup"}})).appendChild(t),this.parent.frozenRows&&"virtualscroll"===i.requestType&&(1===this.parent.pageSettings.currentPage||this.isInfiniteColumnvirtualization()))for(var p=0;p<this.parent.frozenRows;p++)e.children[0].remove();this.getTable().appendChild(e),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,this.parent.enableVirtualization||!this.parent.enableColumnVirtualization||"right"!==s.direction&&"left"!==s.direction||(this.content.scrollTop=this.currentInfo.offsets.top,this.content.scrollLeft=this.currentInfo.offsets.left),this.parent.groupSettings.columns.length&&(tc(this.parent)||"up"!==s.direction||(a=this.offsets[this.getTotalBlocks()]-this.prevHeight,u=this.content.scrollTop,this.content.scrollTop=u+a),this.setVirtualHeight(),this.parent.groupSettings.enableLazyLoading||this.observer.setPageHeight(this.getOffset(l[l.length-1])-this.getOffset(l[0]-1))),this.parent.groupSettings.enableLazyLoading||0!==this.parent.groupSettings.columns.length||"ungrouping"!==i.requestType||this.observer.setPageHeight(2*this.getBlockHeight()),this.prevInfo=s,this.isFocused&&"downArrow"!==this.activeKey&&"upArrow"!==this.activeKey&&this.content.focus();var c,u,h=Math.ceil(this.getTotalBlocks()/2);this.isBottom&&(this.isBottom=!1,this.isBottomNotify=!1,this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-1]),0<this.lastPageDeleteScrollTop&&this.parent.pageSettings.currentPage===h&&(this.parent.getContent().firstElementChild.scrollTop=this.lastPageDeleteScrollTop,this.lastPageDeleteScrollTop=-1),1<this.parent.pageSettings.currentPage&&(this.parent.pageSettings.currentPage+1===h||this.parent.pageSettings.currentPage===h)&&2===l.length&&"delete"===i.requestType&&(this.parent.pageSettings.currentPage+1===h&&(this.lastPageDeleteScrollTop=this.parent.getContent().firstElementChild.scrollTop),this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-1]),1!==h&&this.parent.pageSettings.currentPage===h&&1===l.length&&(this.isBottom=!0,setTimeout(function(){var e=r.parent.getContent().firstElementChild,e=(e.scrollTop=r.offsets[r.offsetKeys.length-2],{direction:"up",sentinel:r.observer.sentinelInfo.up,offset:{top:e.scrollTop,left:e.scrollLeft},focusElement:r.parent.element});r.scrollListener(e)},0)),this.isTop&&(this.parent.getContent().firstElementChild.scrollTop=0,this.isTop=!1),"virtualscroll"===i.requestType&&"X"===i.virtualInfo.sentinelInfo.axis&&this.parent.notify(oi,{}),this.focusCell(i),this.firstCellFocus&&(this.firstCellFocus=!1,o=(c=this.parent.focusModule).active.matrix.current,t=this.parent.getContentTable().rows[o[0]].cells[o[1]],c.currentInfo.element=t,(c.currentInfo.elementToFocus=t).classList.add("e-focus"),t.classList.add("e-focused"),t.tabIndex=0,t.focus()),this.restoreEdit(i),this.restoreAdd(),this.ensureSelectedRowPosition(),this.validationScrollLeft(),this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.widthServices.refreshFrozenScrollbar(),this.initialRowTop||(u=this.parent.element.getBoundingClientRect().top,this.parent.getRowByIndex(0)&&(this.initialRowTop=this.parent.getRowByIndex(0).getBoundingClientRect().top-u))}},m.prototype.validationScrollLeft=function(){var e;this.validationCheck&&(this.validationCol?(e=this.vgenerator.cOffsets[this.validationCol.index-this.parent.getVisibleFrozenColumns()-1],this.validationCol=null,this.content.scrollLeft=e):(this.validationCheck=!1,this.parent.editModule.editFormValidate()))},m.prototype.ensureSelectedRowPosition=function(){var e;this.isSelection||!this.isSelectionScroll||H.isNullOrUndefined(this.selectRowIndex)||(this.isSelectionScroll=!1,(e=this.parent.getRowByIndex(this.selectRowIndex))&&!this.isRowInView(e)&&this.rowSelected({rowIndex:this.selectRowIndex,row:e},!0))},m.prototype.focusCell=function(e){var t;"upArrow"!==this.activeKey&&"downArrow"!==this.activeKey||((t=this.parent.getRowByIndex(this.rowIndex)).cells[this.cellIndex].focus({preventScroll:!0}),this.parent.selectionSettings.checkboxOnly||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.pinnedTopRowModels.length||this.parent.selectRow(parseInt(t.getAttribute(D),10)-1),this.activeKey=this.empty)},m.prototype.restoreEdit=function(e){var t,i,n,r;this.isNormaledit&&(this.parent.editSettings.allowEditing&&this.parent.editModule&&!H.isNullOrUndefined(this.editedRowIndex)&&(t=this.getRowByIndex(this.editedRowIndex),r=this.content,i=Object.keys(this.virtualData),n=e&&e.virtualInfo&&"X"===e.virtualInfo.sentinelInfo.axis,i.length&&t&&!r.querySelector("."+Os)&&-1===["sorting","filtering","grouping","refresh","searching","ungrouping","reorder"].indexOf(e.requestType)&&(r=t.getBoundingClientRect().top-this.parent.element.getBoundingClientRect().top,n||r<this.content.offsetHeight&&r>this.parent.getRowHeight())&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(t)),t)&&this.content.querySelector("."+Os)&&!i.length&&(e=!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?this.enableCacheOnInfiniteColumnVirtual()?this.virtualInfiniteData:H.extend({},this.parent.getCurrentViewRecords()[this.editedRowIndex]):H.extend({},this.getRowObjectByIndex(this.editedRowIndex)),this.virtualData=this.getVirtualEditedData(e)),this.restoreAdd())},m.prototype.getVirtualEditedData=function(e){var t=[].slice.call(this.parent.element.getElementsByClassName("e-gridform"));if(!(this.parent.editModule&&this.parent.editModule.formObj&&this.parent.editModule.formObj.isDestroyed))for(var i=0;i<t.length;i++)e=this.parent.editModule.getCurrentEditedData(t[parseInt(i.toString(),10)],e);return e},m.prototype.restoreAdd=function(){var e,t=!this.parent.element.querySelector("."+As);this.isNormaledit&&this.isAdd&&t&&(t="Top"===this.parent.editSettings.newRowPosition&&this.content.scrollTop<this.parent.getRowHeight(),e="Bottom"===this.parent.editSettings.newRowPosition&&this.parent.pageSettings.currentPage===this.maxPage,t||e)&&(this.parent.isEdit=!1,this.parent.addRecord())},m.prototype.onDataReady=function(t){H.isNullOrUndefined(t.count)||(this.count=t.count,this.maxPage=Math.ceil((this.parent.groupSettings.columns.length&&this.parent.vcRows.length?this.parent.vcRows.length:t.count)/this.parent.pageSettings.pageSize)),this.vgenerator.checkAndResetCache(t.requestType),["refresh","filtering","searching","grouping","ungrouping","reorder",void 0].some(function(e){return t.requestType===e})&&this.refreshOffsets(),this.setVirtualHeight(),this.resetScrollPosition(t.requestType)},m.prototype.updateScrollbarOnResize=function(){!this.parent.enableVirtualization||H.isNullOrUndefined(this.virtualEle.verticalScrollbar)||H.isNullOrUndefined(this.content)||(this.virtualEle.verticalScrollbar.style.width=Op(!0)+1+"px"),!this.parent.enableColumnVirtualization||H.isNullOrUndefined(this.virtualEle.horizontalScrollbar)||H.isNullOrUndefined(this.content)||(this.virtualEle.horizontalScrollbar.style.height=Op(!0)+1+"px")},m.prototype.updateVirtualScrollbar=function(e,t){this.virtualEle.gridContent.style.position="relative",!this.parent.enableVirtualization||H.isNullOrUndefined(this.virtualEle.verticalScrollbar)||H.isNullOrUndefined(this.virtualEle.verticalScrollerContainer)||H.isNullOrUndefined(this.content)||(this.virtualEle.verticalScrollbar.style.overflowX=this.parent.enableVirtualization&&this.content.scrollWidth>this.content.clientWidth?"scroll":"hidden",this.virtualEle.verticalScrollerContainer.style.height=H.isNullOrUndefined(e)?"0px":e+"px",this.virtualEle.verticalScrollbar.style.width=Op()+1+"px"),!this.parent.enableColumnVirtualization||H.isNullOrUndefined(this.virtualEle.horizontalScrollbar)||H.isNullOrUndefined(this.virtualEle.horizontalScrollerContainer)||H.isNullOrUndefined(this.content)||(this.virtualEle.horizontalScrollbar.style.overflowY=this.parent.enableColumnVirtualization&&e>this.virtualEle.wrapper.clientHeight?"scroll":"hidden",!t||-1!==t.indexOf("%")||this.content.getBoundingClientRect().width<parseInt(t,10)||(t="100%"),this.virtualEle.horizontalScrollerContainer.style.width=t,this.virtualEle.horizontalScrollbar.style.height=Op()+1+"px")},m.prototype.setVirtualHeight=function(e){var t=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.getVisibleColumns().length+this.parent.groupSettings.columns.length-1)+"px":"100%",i=this.offsets[tc(this.parent)&&0!==this.count?this.getGroupedTotalBlocks():this.getTotalBlocks()],n=(!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization&&(i=0),tc(this.parent)&&0!==this.count?this.getGroupedTotalBlocks():this.getTotalBlocks()),n=Math.ceil(n/2),r=Math.round(this.virtualEle.placeholder.getBoundingClientRect().bottom),s=Math.round(this.virtualEle.wrapper.getBoundingClientRect().bottom);(this.currentInfo.page===n||this.currentInfo.page+1===n)&&"down"===this.currentInfo.direction&&s<r&&!this.diff&&(this.diff=r-s),this.diff&&this.currentInfo.page===n&&s<r&&(!this.isAdd||"Bottom"!==this.parent.editSettings.newRowPosition)?(i-=this.diff,this.heightChange=!0):"virtualscroll"===this.requestType&&this.diff&&this.heightChange&&(i-=this.diff,this.heightChange=!1),this.virtualEle.setVirtualHeight(i,t),this.virtualEle&&this.virtualEle.wrapper&&(!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?this.virtualEle.wrapper.style.minHeight="":this.virtualEle.wrapper.style.minHeight=H.isNullOrUndefined(i)?"0px":H.formatUnit(this.parent.height)),this.parent.enableColumnVirtualization&&this.header.virtualEle&&(this.header.virtualEle.setVirtualHeight(1,t),this.parent.aggregateModule)&&this.parent.aggregates&&this.parent.aggregates.length&&(n=this.parent.aggregateModule.footerRenderer)&&n.virtualElement&&n.virtualElement.setVirtualHeight(1,t),this.parent.enableSeamlessScrolling&&this.updateVirtualScrollbar(i,t)},m.prototype.getPageFromTop=function(i,n){var r=this,s=tc(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks(),o=0;return this.offsetKeys.some(function(e){var t=Number(e),e=i<=r.offsets[""+e]||t===s&&i>r.offsets[""+e];return e&&(r.offsetKeys.length%2!=0&&t.toString()===r.offsetKeys[r.offsetKeys.length-2]&&i<=r.offsets[r.offsetKeys.length-1]&&(t+=1),n.block=t%2==0?1:0,o=Math.max(1,Math.min(r.vgenerator.getPage(t),r.maxPage))),e}),o},m.prototype.getTranslateY=function(e,t,i,n){void 0===i&&((i={page:this.getPageFromTop(e,{})}).blockIndexes=this.vgenerator.getBlockIndexes(i.page));var r=(i.blockIndexes[0]||1)-1,s=this.getOffset(r),o=this.getOffset(i.blockIndexes[i.blockIndexes.length-1]),n=(n&&(i=this.prevInfo),e<s?this.getOffset(r-1):o<e+t?this.getOffset(1+r):s),o=this.offsets[i.blockIndexes[i.blockIndexes.length-1]]-this.tmpOffsets[i.blockIndexes[0]],e=tc(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();return n+o>this.offsets[parseInt(e.toString(),10)]&&(n-=n+o-this.offsets[parseInt(e.toString(),10)]),1===i.page&&0===i.block&&"up"===i.direction&&(n=0),n=!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?0:n},m.prototype.getOffset=function(e){return Math.min(0|this.offsets[parseInt(e.toString(),10)],0|this.offsets[this.maxBlock])},m.prototype.onEntered=function(){var d=this;return function(e,t,i,n,r,s){var o,a,l,h;("down"!==i&&"up"!==i||d.parent.enableVirtualization||!d.parent.enableColumnVirtualization)&&(!H.Browser.isIE||r||!s||d.preventEvent||d.parent.enableVirtualMaskRow||d.parent.showSpinner(),d.prevInfo=d.prevInfo||d.vgenerator.getData(),r=d.getInfoFromView(i,t,n),d.parent.isFrozenGrid()&&"X"===t.axis&&d.parent.getVisibleFrozenLeftCount()>=r.columnIndexes[0]&&d.prevInfo&&d.prevInfo.columnIndexes.toString().includes(r.columnIndexes.toString())||(d.parent.enableVirtualMaskRow&&!d.preventEvent&&(s=parseInt(d.offsetKeys[0],10),a=parseInt(d.offsetKeys[d.offsetKeys.length-1],10),l=d.currentInfo.blockIndexes,r=d.prevInfo&&"X"===t.axis&&d.prevInfo.columnIndexes.toString()===r.columnIndexes.toString()||"down"===i&&d.parent.allowGrouping&&d.parent.groupSettings.columns.length&&(d.parent.allowFiltering&&d.parent.filterSettings.columns.length||d.parent.searchSettings.key.length)&&d.offsetKeys.length<=2,l&&l[0]===s&&"up"===i||l&&l[l.length-1]===a&&"down"===i||r||setTimeout(function(){d.parent.showMaskRow(t.axis)},0)),s="X"===t.axis,l=d.prevInfo.offsets?d.prevInfo.offsets.top:null,a=d.content.getBoundingClientRect().height,r=d.getColumnOffset(s?d.vgenerator.getColumnIndexes()[0]-1:d.prevInfo.columnIndexes[0]-1),d.parent.isFrozenGrid()&&d.parent.enableColumnVirtualization&&d.currentInfo&&d.currentInfo.columnIndexes&&(h=d.currentInfo.columnIndexes[0]-1,o=0,d.parent.getColumns().filter(function(e){e.visible&&"Left"===e.freeze&&(o+=parseInt(e.width.toString(),10))}),h>d.parent.getVisibleFrozenLeftCount())&&(r-=o),s&&(h=Object.keys(d.vgenerator.cOffsets).length-d.prevInfo.columnIndexes.length,r=(h=d.vgenerator.cOffsets[h-1])<r?h:r),!d.parent.enableVirtualization&&d.parent.enableColumnVirtualization?d.virtualEle.adjustTable(r,0):(h=d.prevInfo&&1===d.prevInfo.page&&(i!==d.prevInfo.direction||i!==d.prevInfo.direction),a=d.getTranslateY(n.top,a,s&&l===n.top?d.prevInfo:void 0,!h),d.virtualEle.adjustTable(r,Math.min(a,d.offsets[d.maxBlock])),s=d.virtualEle.wrapper.getBoundingClientRect().bottom,l=d.virtualEle.content.getBoundingClientRect().bottom,"up"===i&&d.prevInfo.page===Math.ceil(d.getTotalBlocks()/2)&&Math.round(s)<Math.round(l)&&(n=Math.round(l)-Math.round(s),(h=Math.min(a+n,d.offsets[d.maxBlock]))!==a)&&d.virtualEle.adjustTable(r,h)),d.parent.enableColumnVirtualization&&(d.header.virtualEle.adjustTable(r,0),d.parent.aggregates.length&&d.updateVirtualFooterPosition(r),d.parent.isFrozenGrid())&&d.resetStickyLeftPos(r)))}},m.prototype.dataBound=function(){this.parent.notify(nr,{}),this.isSelection&&"upArrow"!==this.activeKey&&"downArrow"!==this.activeKey?this.parent.selectRow(this.selectedRowIndex):(this.activeKey=this.empty,this.requestType=this.empty)},m.prototype.resetStickyLeftPos=function(e,t){var i=[].slice.call(this.parent.getHeaderContent().querySelectorAll(".e-leftfreeze,.e-rightfreeze,.e-fixedfreeze")).concat([].slice.call((t||this.parent.getContent()).querySelectorAll(".e-leftfreeze,.e-rightfreeze,.e-fixedfreeze"))),n=(this.parent.getFooterContent()&&(i=i.concat([].slice.call(this.parent.getFooterContent().querySelectorAll(".e-leftfreeze,.e-rightfreeze,.e-fixedfreeze")))),0),r=0;if(this.parent.getHeaderContent().querySelectorAll(".e-fixedfreeze").length&&(n=this.parent.leftrightColumnWidth("left"),r=this.parent.leftrightColumnWidth("right")),i.length)for(var s=0;s<i.length;s++){var o,a,l=i[parseInt(s.toString(),10)],h=void 0;l.classList.contains("e-rowcell")?h=H.isNullOrUndefined(l.getAttribute("aria-colindex"))&&l.querySelector("[data-mappinguid]")?(a=l.querySelector("[data-mappinguid]").getAttribute("data-mappinguid"),this.parent.getColumnByUid(a)):(o=parseInt(l.getAttribute("aria-colindex"),10)-1,this.parent.getColumnByIndex(parseInt(o.toString(),10))):(l.classList.contains("e-headercell")||l.classList.contains("e-filterbarcell")||l.classList.contains("e-summarycell"))&&(a=(l.classList.contains("e-filterbarcell")||l.classList.contains("e-summarycell")?l:l.querySelector("[data-mappinguid]")).getAttribute("data-mappinguid"),h=this.parent.getColumnByUid(a)),H.isNullOrUndefined(h)||("Left"===h.freeze?l.style.left=h.valueX-e+"px":"Right"===h.freeze?l.style.right=h.valueX+e+"px":"Fixed"===h.freeze&&(l.style.left=n-e+"px",l.style.right=r+e+"px"))}this.parent.translateX=e},m.prototype.rowSelected=function(e,t){var i,n,r,s,o;!this.isSelection&&!t||this.isLastBlockRow(e.rowIndex)||(t=dc(this.content.firstElementChild),i=this.parent.element.getBoundingClientRect().top,s=e.row.getBoundingClientRect().top-i,s=(r=(n=this.content.getBoundingClientRect().height)<s)?s-n:this.initialRowTop-s,r=r?t.height-s:t.height+s,this.virtualEle.adjustTable(t.width,r),s=this.virtualEle.wrapper.getBoundingClientRect(),o=this.content.getBoundingClientRect(),s.top>o.top&&this.virtualEle.adjustTable(t.width,r-(s.top-o.top)),this.content.querySelector("tbody").lastElementChild.getBoundingClientRect().top-i<n?(r+=n-(e.row.getBoundingClientRect().top-i),this.virtualEle.adjustTable(t.width,r-this.parent.getRowHeight()/2)):o.bottom>s.bottom&&this.virtualEle.adjustTable(t.width,r+(o.bottom-s.bottom)),this.parent.isFrozenGrid()&&this.parent.enableColumnVirtualization&&this.resetStickyLeftPos(t.width)),this.isSelection=!1},m.prototype.isLastBlockRow=function(e){var t=this.parent.getContent().firstElementChild,t=Math.floor(t.offsetHeight/this.parent.getRowHeight())-1;return this.maxPage*this.parent.pageSettings.pageSize-t<=e},m.prototype.refreshMaxPage=function(){this.parent.groupSettings.columns.length&&this.parent.vcRows.length&&(this.maxPage=Math.ceil(this.parent.vcRows.length/this.parent.pageSettings.pageSize))},m.prototype.setVirtualPageQuery=function(e){var t,i=[];this.prevInfo&&this.prevInfo.blockIndexes&&(i=du(this.prevInfo.blockIndexes)),("sorting"===this.requestType||"delete"===this.requestType)&&i.length&&hu(this.parent)?(e.query.skip(this.parent.pageSettings.pageSize*(i[0]-1)),e.query.take(this.parent.pageSettings.pageSize*i.length),e.skipPage=!0):(t=this.parent.getContent().querySelector(".e-row"),"virtualscroll"===this.requestType&&this.vgenerator.currentInfo.blockIndexes&&(this.vgenerator.currentInfo={}),t&&(this.parent.isManualRefresh||"pin-row"===this.requestType||"unpin-row"===this.requestType)&&this.currentInfo.blockIndexes&&(3===this.currentInfo.blockIndexes.length||1<i.length)&&(this.vgenerator.startIndex=parseInt(t.getAttribute("aria-rowindex"),10)-1,this.vgenerator.currentInfo=H.extend({},this.currentInfo),this.vgenerator.currentInfo.blockIndexes=this.currentInfo.blockIndexes.slice(),(this.vgenerator.includePrevPage=this.currentInfo.blockIndexes[0]%2==0)?(this.vgenerator.startIndex=this.vgenerator.startIndex-this.getBlockSize(),this.vgenerator.currentInfo.blockIndexes.unshift(this.currentInfo.blockIndexes[0]-1)):this.vgenerator.currentInfo.blockIndexes.push(this.currentInfo.blockIndexes[this.currentInfo.blockIndexes.length-1]+1),i=(this.vgenerator.currentInfo.blockIndexes[0]-1)*this.getBlockSize(),t=this.vgenerator.currentInfo.blockIndexes.length*this.getBlockSize(),e.query.skip(i),e.query.take(t),e.skipPage=!0))},m.prototype.eventListener=function(e){var i=this;if(!this.parent.isDestroyed){this.parent[""+e](yt,this.onDataReady,this),this.parent.addEventListener(de,this.dataBound.bind(this)),this.parent.addEventListener(y,this.actionBegin.bind(this)),this.parent.addEventListener(c,this.actionComplete.bind(this)),this.parent.addEventListener(ce,this.rowSelected.bind(this)),this.parent[""+e](ii,this.refreshContentRows,this),this.parent[""+e](Gr,this.refreshVirtualLazyLoadCache,this),this.parent[""+e](un,this.selectVirtualRow,this),this.parent[""+e](Rn,this.virtualCellFocus,this),this.parent[""+e](Dn,this.editActionBegin,this),this.parent[""+e](Mn,this.addActionBegin,this),this.parent[""+e](On,this.restoreEdit,this),this.parent[""+e](Tn,this.editSuccess,this),this.parent[""+e](An,this.refreshCache,this),this.parent[""+e](Fn,this.resetIsedit,this),this.parent[""+e](kn,this.getVirtualData,this),this.parent[""+e](En,this.editCancel,this),this.parent[""+e](Ir,this.refreshMaxPage,this),this.parent[""+e](Rr,this.setVirtualPageQuery,this),this.parent[""+e](xr,this.selectRowOnContextOpen,this),this.parent[""+e](Or,this.resetVirtualFocus,this),this.parent[""+e](Ar,this.refreshCells,this),this.parent[""+e](Fr,this.scrollToEdit,this),this.parent.on(s,this.destroy,this);for(var t=this.actions,n=0;n<t.length;n++)this.parent[""+e](t[parseInt(n.toString(),10)]+"-begin",this.onActionBegin,this);var r=function(){window.addEventListener("resize",i.updateScrollbarOnResize.bind(i)),i.observer.observe(function(e){return i.scrollListener(e)},i.onEntered());var e,t=i.parent;t.enablePersistence&&t.scrollPosition&&(0<t.scrollPosition.top&&(i.content.scrollTop=t.scrollPosition.top,e={direction:"down",sentinel:i.observer.sentinelInfo.down,offset:t.scrollPosition,focusElement:t.element},i.scrollListener(e)),t.enableColumnVirtualization)&&(i.content.scrollLeft=t.scrollPosition.left),i.parent.off(vt,r)};this.parent.on(vt,r,this)}},m.prototype.updateVirtualFooterPosition=function(e){var t=this.parent.aggregateModule.footerRenderer;t&&t.virtualElement&&t.virtualElement.adjustTable(e,0)},m.prototype.destroy=function(){this.removeEventListener()},m.prototype.removeEventListener=function(){this.parent.isDestroyed||(window.removeEventListener("resize",this.updateScrollbarOnResize),this.parent.off(s,this.destroy))},m.prototype.refreshVirtualLazyLoadCache=function(e){var t,i,n,r=this.currentInfo.blockIndexes;H.isNullOrUndefined(this.currentInfo.blockIndexes)&&(r=[1,2]);for(var s=0;s<r.length;s++)for(var o=this.vgenerator.cache[r[parseInt(s.toString(),10)]],a=0;a<o.length;a++)if(o[parseInt(a.toString(),10)].uid===e.uid){t=r[parseInt(s.toString(),10)],i=a,n=o;break}e.count?this.vgenerator.cache[parseInt(t.toString(),10)].splice(i+1,e.count):e.rows&&e.rows.length&&(this.vgenerator.cache[parseInt(t.toString(),10)]=[].slice.call(n.slice(0,i+1)).concat([].slice.call(e.rows)).concat([].slice.call(n.slice(i+1,n.length)))),this.refreshOffsets()},m.prototype.scrollToEdit=function(e){var t=!0,i=(this.validationCheck=!0,this.isAdd&&0<this.content.scrollTop&&(t=!1,i=Object.keys(this.offsets),this.content.scrollTop="Top"===this.parent.editSettings.newRowPosition?0:this.offsets[i.length-1]),this.parent.getRowByIndex(this.editedRowIndex));i||H.isNullOrUndefined(this.editedRowIndex)||i&&this.isRowInView(i)||(i=this.parent.getRowHeight(),i=this.editedRowIndex*i,H.isNullOrUndefined(i))||(t=!1,this.content.scrollTop=i),e&&t&&(i=this.vgenerator.cOffsets[e.index-this.parent.getVisibleFrozenColumns()-1],this.parent.enableColumnVirtualization||(i=this.parent.getHeaderContent().querySelector('.e-headercelldiv[data-mappinguid="'+e.uid+'"]').parentElement.offsetLeft),this.parent.enableColumnVirtualization&&this.parent.getVisibleFrozenLeftCount()&&(i-=this.parent.leftrightColumnWidth("left")),this.content.scrollLeft=this.parent.enableRtl?-Math.abs(i):i),e&&!t&&(this.validationCol=e)},m.prototype.refreshCells=function(e){e.cells=this.vgenerator.generateCells(e.foreignKeyData)},m.prototype.resetVirtualFocus=function(e){this.isCancel=e.isCancel},m.prototype.getVirtualData=function(e){var t,i;this.isNormaledit&&(t=this.parent.element.querySelector('.e-griderror:not([style*="display: none"])'),i=Object.keys(this.virtualData),e.isScroll=0!==i.length&&this.currentInfo.sentinelInfo&&"X"===this.currentInfo.sentinelInfo.axis,t||(this.virtualData=(i.length?this:e).virtualData,this.getVirtualEditedData(this.virtualData),e.virtualData=this.virtualData,e.isAdd=this.isAdd||this.parent.editSettings.showAddNewRow,e.isCancel=this.isCancel))},m.prototype.selectRowOnContextOpen=function(e){this.isContextMenuOpen=e.isOpen},m.prototype.editCancel=function(e){var t=Sc(this.parent,e.data);H.isNullOrUndefined(t)||(e.data=this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)])},m.prototype.editSuccess=function(e){this.isNormaledit&&(!this.isAdd&&e.data&&this.updateCurrentViewData(e.data),this.isAdd=!1)},m.prototype.updateCurrentViewData=function(e){var t=Sc(this.parent,e);H.isNullOrUndefined(t)||(this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)]=e)},m.prototype.actionBegin=function(e){"virtualscroll"!==e.requestType&&(this.requestType=e.requestType),e.cancel?"beginEdit"===e.requestType&&(this.virtualData={}):this.parent.notify(ar,e)},m.prototype.virtualCellFocus=function(e){var t,i,n,r,s,o;e&&("enter"===e.action||"shiftEnter"===e.action)&&this.parent.editSettings&&"Cell"===this.parent.editSettings.mode||((o=document.activeElement).classList.contains(b)||!(o instanceof HTMLInputElement)&&H.isNullOrUndefined(o.closest(".e-templatecell"))||(o=o.closest(".e-rowcell")),this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&o&&(o.classList.contains(b)||!H.isNullOrUndefined(I(o,Fs)))&&e&&("shiftEnter"===e.action||"upArrow"===e.action||"downArrow"===e.action)?(t=(i=this.parent.getContent().firstElementChild).getBoundingClientRect(),n=H.closest(o,"tr"),s="downArrow"===e.action?n.nextElementSibling:n.previousElementSibling,r=H.isNullOrUndefined(s)?void 0:s.getBoundingClientRect(),H.isNullOrUndefined(s)||"downArrow"===e.action&&r.bottom>t.bottom||("upArrow"===e.action||"shiftEnter"===e.action)&&r.top<t.top?(this.activeKey=e.action,this.parent.focusModule.virtualSelectionInfo={isPending:H.isNullOrUndefined(s),direction:e.action,event:e},s=H.isNullOrUndefined(s)?this.parent.getRowHeight():"downArrow"===e.action?r.bottom-t.bottom:t.top-r.top,i.scrollTop="downArrow"===e.action?i.scrollTop+s:i.scrollTop-s):this.activeKey=this.empty):o&&o.classList.contains(b)&&e&&("upArrow"===e.action||"downArrow"===e.action||"shiftEnter"===e.action)&&(t=parseInt(o.parentElement.getAttribute(D),10)-1,!e||"upArrow"!==e.action&&"shiftEnter"!==e.action&&"downArrow"!==e.action||(i=this.parent.getContent().firstElementChild,"downArrow"===e.action?t+=1:--t,this.rowIndex=t,this.cellIndex=parseInt(o.getAttribute(zs),10)-1,n=this.parent.getRowByIndex(t),r=this.parent.pageSettings.currentPage,s=Math.floor(i.offsetHeight/this.parent.getRowHeight())-1,o=!1,(o=H.isNullOrUndefined(n)&&(o=!0,"downArrow"===e.action&&r===this.maxPage-1||("upArrow"===e.action||"shiftEnter"===e.action)&&1===r)?!1:o)||mc(n,this.parent)&&"downArrow"===e.action||yc(n,2*this.parent.getRowHeight())&&("upArrow"===e.action||"shiftEnter"===e.action)?(this.activeKey=e.action,i.scrollTop="downArrow"===e.action?(t-s)*this.parent.getRowHeight():t*this.parent.getRowHeight()):this.activeKey=this.empty,this.parent.selectionSettings.checkboxOnly)||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.pinnedTopRowModels.length||this.parent.selectRow(t)))},m.prototype.editActionBegin=function(e){this.editedRowIndex=e.index;var t=!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?H.extend({},this.parent.getCurrentViewRecords()[e.index]):H.extend({},this.getRowObjectByIndex(e.index)),i=Object.keys(this.virtualData);e.data=i.length&&!this.parent.editSettings.showAddNewRow?this.virtualData:this.isInfiniteColumnvirtualization()?e.data:t,this.enableCacheOnInfiniteColumnVirtual()&&(this.virtualInfiniteData=e.data),e.isScroll=0!==i.length&&this.currentInfo.sentinelInfo&&"X"===this.currentInfo.sentinelInfo.axis},m.prototype.getEditedRowObject=function(){for(var e,t=this.parent.vcRows,i=0;i<t.length;i++)t[parseInt(i.toString(),10)].index===this.editedRowIndex&&(e=t[parseInt(i.toString(),10)]);return e},m.prototype.refreshCache=function(e){var t,i,n;this.isInfiniteColumnvirtualization()||(t=Math.ceil((this.editedRowIndex+1)/this.getBlockSize()),this.parent.allowPaging&&this.parent.enableColumnVirtualization&&(t=Math.ceil((this.editedRowIndex+1+(this.parent.pageSettings.currentPage-1)*this.parent.pageSettings.pageSize)/this.getBlockSize())),i=this.parent.allowPaging&&this.parent.enableColumnVirtualization?this.editedRowIndex%this.getBlockSize():this.editedRowIndex-(t-1)*this.getBlockSize(),this.parent.pinnedTopRowModels.length&&this.parent.pinnedTopRowModels.length>i)||(this.parent.groupSettings.columns.length?(n=this.getEditedRowObject())&&(n.data=e.data):this.vgenerator.cache[parseInt(t.toString(),10)][parseInt(i.toString(),10)].data=e.data)},m.prototype.actionComplete=function(t){var e;(this.parent.enableVirtualization||this.parent.enableColumnVirtualization)&&("delete"!==t.requestType&&"refresh"!==t.requestType&&"searching"!==t.requestType&&"filtering"!==t.requestType||(this.prevPage=-1),(e=["delete","save","cancel"]).some(function(e){return e===t.requestType})&&(this.refreshOffsets(),this.refreshVirtualElement()),this.isNormaledit&&(["sorting","filtering","grouping","refresh","searching","ungrouping","reorder"].some(function(e){return e===t.requestType})||e.some(function(e){return e===t.requestType}))&&(this.isCancel=!0,this.isAdd&&this.parent.editSettings&&"Bottom"===this.parent.editSettings.newRowPosition&&(this.virtualEle.placeholder.style.height=parseInt(this.virtualEle.placeholder.style.height.toString(),10)-this.diff+"px"),this.isAdd=this.parent.editSettings.showAddNewRow,this.editedRowIndex=this.empty,this.virtualData={},this.virtualInfiniteData={},this.parent.editModule)&&(this.parent.editModule.editModule.previousData=void 0),this.parent.enableColumnVirtualization)&&"filterAfterOpen"===t.requestType&&this.currentInfo.columnIndexes&&0<this.currentInfo.columnIndexes[0]&&this.parent.resetFilterDlgPosition(t.columnName)},m.prototype.resetIsedit=function(){this.parent.enableVirtualization&&this.isNormaledit&&(this.parent.editSettings.allowEditing&&Object.keys(this.virtualData).length||this.parent.editSettings.allowAdding&&this.isAdd)&&(this.parent.isEdit=!0)},m.prototype.scrollAfterEdit=function(){var e,t;this.parent.editModule&&this.parent.editSettings.allowEditing&&this.isNormaledit&&this.parent.element.querySelector(".e-gridform")&&(t=this.parent.element.querySelector("."+Os),e=this.parent.element.querySelector("."+As),t||e)&&(e=t?H.extend({},this.getRowObjectByIndex(this.editedRowIndex)):H.extend({},this.emptyRowData),t=Object.keys(this.virtualData),this.virtualData=t.length?this.getVirtualEditedData(this.virtualData):this.getVirtualEditedData(e))},m.prototype.createEmptyRowdata=function(){var t=this;this.parent.columnModel.filter(function(e){t.emptyRowData[e.field]=t.empty})},m.prototype.addActionBegin=function(e){var t;this.isNormaledit&&(Object.keys(this.emptyRowData).length||this.createEmptyRowdata(),this.isAdd=!0,t=this.parent.pageSettings.currentPage,!this.parent.frozenRows&&0<this.content.scrollTop&&"Top"===this.parent.editSettings.newRowPosition&&(this.isAdd=!0,this.onActionBegin(),e.startEdit=!1,this.content.scrollTop=0),t<this.maxPage-1)&&"Bottom"===this.parent.editSettings.newRowPosition&&(this.isAdd=!0,this.parent.setProperties({pageSettings:{currentPage:this.maxPage-1}},!0),e.startEdit=!1,this.content.scrollTop=this.offsets[this.offsetKeys.length])},m.prototype.getRowObjectByIndex=function(e){return this.getRowCollection(e,!0)},m.prototype.getBlockSize=function(){return this.parent.pageSettings.pageSize>>1},m.prototype.getBlockHeight=function(){return this.getBlockSize()*this.parent.getRowHeight()},m.prototype.isEndBlock=function(e){var t=tc(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks();return t<=e||e===t-1},m.prototype.isOddPageSize=function(){return this.parent.pageSettings.pageSize%2!=0},m.prototype.getOddBlockSize=function(){return this.isOddPageSize()?this.parent.pageSettings.pageSize/2:this.getBlockSize()},m.prototype.getGroupedTotalBlocks=function(){var e=this.parent.vcRows;return Math.floor(e.length/this.getOddBlockSize()<1?1:e.length/this.getOddBlockSize())},m.prototype.getTotalBlocks=function(){return Math.ceil(this.count/this.getOddBlockSize())},m.prototype.getColumnOffset=function(e){return 0|this.vgenerator.cOffsets[parseInt(e.toString(),10)]},m.prototype.getModelGenerator=function(){return new Dg(this.parent)},m.prototype.resetScrollPosition=function(t){var e;this.actions.some(function(e){return e===t})&&(this.preventEvent=0!==this.content.scrollTop,this.content.scrollTop=0,Object.keys(this.currentInfo).length)&&(e=this.currentInfo.offsets&&!H.isNullOrUndefined(this.currentInfo.offsets.left)?this.currentInfo.offsets.left:0,this.currentInfo=this.getInfoFromView(this.currentInfo.direction,this.currentInfo.sentinelInfo,{top:0,left:e})),"virtualscroll"!==t&&(this.isAdd=!1)},m.prototype.onActionBegin=function(e){this.parent.setProperties({pageSettings:{currentPage:1}},!0)},m.prototype.getRows=function(){return this.isInfiniteColumnvirtualization()?this.getInfiniteRows():this.vgenerator.getRows()},m.prototype.getRowByIndex=function(t){var e;if(tc(this.parent))if(!H.isNullOrUndefined(t)&&this.parent.enableVirtualization&&this.parent.groupSettings.columns.length)for(var i=0;i<this.parent.getDataRows().length;i++)parseInt(this.parent.getDataRows()[parseInt(i.toString(),10)].getAttribute(D),10)-1===t&&(e=this.parent.getDataRows()[parseInt(i.toString(),10)]);else e=H.isNullOrUndefined(t)?void 0:this.parent.getDataRows()[parseInt(t.toString(),10)];else!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?e=H.isNullOrUndefined(t)?void 0:this.enableCacheOnInfiniteColumnVirtual()?this.parent.getDataRows().find(function(e){return parseInt(e.getAttribute(D),10)-1===t}):this.parent.getDataRows()[parseInt(t.toString(),10)]:this.prevInfo&&(e=this.getRowCollection(t,!1));return e},m.prototype.getMovableVirtualRowByIndex=function(e){return this.getRowCollection(e,!1)},m.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1)},m.prototype.getRowCollection=function(e,t){var i=(this.prevInfo.blockIndexes[0]-1)*this.getBlockSize(),n=(this.parent.pageSettings.pageSize%2!=0&&(i+=Math.floor(i/this.getBlockSize()/2)),this.parent.getDataRows()),r=this.parent.pinnedTopRowModels,s=t?this.parent.getCurrentViewRecords():n,o=(t&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!this.parent.groupSettings.enableLazyLoading&&(i=parseInt(this.parent.getRows()[0].getAttribute(D),10)-1,s=s.filter(function(e){return H.isNullOrUndefined(e.items)})),s[e-(i=!t&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&n.length?parseInt(n[0].getAttribute(D),10)-1:i)]);return r.length?e<r.length?o=t?r[parseInt(e.toString(),10)].data:n[parseInt(e.toString(),10)]:(o=t?s[e-i-r.length]:o,this.parent.groupSettings.columns.length&&(o=t?s[e-i]:o)):(t&&!this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&this.parent.aggregates&&(r=n[e-i],s=this.parent.getRowObjectFromUID(r.getAttribute("data-uid")))&&(o=s.data),this.parent.frozenRows&&1<this.parent.pageSettings.currentPage&&(o=t?e<=this.parent.frozenRows?this.parent.getRowsObject()[parseInt(e.toString(),10)].data:o:e<=this.parent.frozenRows?n[parseInt(e.toString(),10)]:n[e-i+this.parent.frozenRows])),o},m.prototype.getVirtualRowIndex=function(e){if(H.isNullOrUndefined(this.prevInfo))return e;var t=this.prevInfo.blockIndexes,i=(t[0]-1)*this.getBlockSize();if(this.parent.enableVirtualization&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length)for(var n=this.vgenerator.cache[t[0]],r=0;r<n.length;r++)if(n[""+r].isDataRow){i=n[""+r].index;break}return i+e},m.prototype.refreshOffsets=function(){for(var e=this.parent,t=0,i=this.getBlockSize(),n=this.getOddBlockSize(),r=tc(this.parent)?this.getGroupedTotalBlocks():this.getTotalBlocks(),s=(this.prevHeight=this.offsets[parseInt(r.toString(),10)],this.maxBlock=r%2==0?r-2:r-1,this.offsets={},Array.apply(null,Array(r)).map(function(){return++t})),o=0;o<s.length;o++){var a=(this.vgenerator.cache[s[parseInt(o.toString(),10)]]||[]).length,l=tc(this.parent)?this.isOddPageSize()?Math.ceil(e.vcRows.length%n):e.vcRows.length%i:this.isOddPageSize()?Math.ceil(this.count%n):this.count%i,a=!tc(this.parent)&&s[parseInt(o.toString(),10)]in this.vgenerator.cache?a*this.parent.getRowHeight():l&&s[parseInt(o.toString(),10)]===r?l*this.parent.getRowHeight():this.getBlockHeight();!this.isOddPageSize()||s[parseInt(o.toString(),10)]in this.vgenerator.cache||l&&s[parseInt(o.toString(),10)]===r||(a=(s[parseInt(o.toString(),10)]%2!=0?Math.floor(n):Math.ceil(n))*this.parent.getRowHeight()),this.offsets[s[parseInt(o.toString(),10)]]=(0|this.offsets[s[parseInt(o.toString(),10)]-1])+a,this.tmpOffsets[s[parseInt(o.toString(),10)]]=0|this.offsets[s[parseInt(o.toString(),10)]-1]}this.offsetKeys=Object.keys(this.offsets),tc(this.parent)&&(this.parent.vGroupOffsets=this.offsets),this.parent.enableColumnVirtualization&&this.vgenerator.refreshColOffsets()},m.prototype.refreshVirtualElement=function(){this.vgenerator.refreshColOffsets(),this.setVirtualHeight()},m.prototype.setVisible=function(e){var t,i=this.parent,n=[];(n=this.getRows()).some(function(e){return e.isDataRow&&(t=e),e.isDataRow});for(var r=!0,s=(!i.groupSettings.columns.length&&t&&(r=!1),i.getDataRows()),o=0,a=e.length;o<a;o++){var l=e[parseInt(o.toString(),10)],h=i.getNormalizedColumnIndex(l.uid),d=!0===l.visible?"":"none",p=this.getColGroup().children;-1!==h&&t&&h<t.cells.length&&H.setStyleAttribute(p[parseInt(h.toString(),10)],{display:d}),r||(p=void 0,(p=l.width?l.visible?this.virtualEle.wrapper.offsetWidth+parseInt(l.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(l.width.toString(),10):p)>i.width?(this.setDisplayNone(s,h,d,n),this.parent.enableColumnVirtualization&&this.virtualEle.setWrapperWidth(p+""),this.refreshVirtualElement()):r=!0),!this.parent.invokedFromMedia&&l.hideAtMedia&&this.parent.updateMediaColumns(l),this.parent.invokedFromMedia=!1}!r||this.parent.enableVirtualization&&this.parent.groupSettings&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading?this.parent.notify(dn,{rows:n,args:{isFrozen:!1,rows:n}}):this.refreshContentRows({requestType:"refresh"})},m.prototype.selectVirtualRow=function(t){var e,i,n=this,r=tc(this.parent)?this.vgenerator.recordsCount:this.count;t.isAvailable=t.selectedIndex<r,!t.isAvailable||this.isContextMenuOpen||"upArrow"===this.activeKey||"downArrow"===this.activeKey||this.isSelection||this.requestTypes.some(function(e){return e===n.requestType})||this.parent.selectionModule.isInteracted||(r=this.parent.getRowByIndex(t.selectedIndex),i=this.parent.getRowHeight(),r&&this.isRowInView(r))||(this.isSelection=!0,this.selectedRowIndex=t.selectedIndex,r=t.selectedIndex*i,tc(this.parent)?(r=-1!==(e=this.parent.vcRows.findIndex(function(e){return e.index===t.selectedIndex}))?e*i:void 0,this.isSelection=-1!==e&&this.isSelection):this.parent.groupSettings.columns.length&&this.parent.getDataModule().isRemote()&&(i=Math.ceil((t.selectedIndex+1)/this.parent.pageSettings.pageSize),e=this.vgenerator.getBlockIndexes(i),r=this.offsets[e[0]]),H.isNullOrUndefined(r))||(i=this.content.scrollTop<r?"down":"up",this.selectRowIndex=t.selectedIndex,this.content.scrollTop=r+1,this.isSelectionScroll=this.observer.check(i)),this.requestType=this.empty},m.prototype.isRowInView=function(e){var t=e.getBoundingClientRect().top,e=e.getBoundingClientRect().bottom;return t>=this.content.getBoundingClientRect().top&&e<=this.content.getBoundingClientRect().bottom},m);function m(e,t){e=Og.call(this,e,t)||this;return e.prevHeight=0,e.startIndex=0,e.preStartIndex=0,e.preventEvent=!1,e.actions=["filtering","searching","grouping","ungrouping"],e.offsets={},e.tmpOffsets={},e.virtualEle=new Pg,e.offsetKeys=[],e.isFocused=!1,e.isSelection=!1,e.isBottom=!1,e.isBottomNotify=!1,e.diff=0,e.heightChange=!1,e.isTop=!1,e.empty=void 0,e.isCancel=!1,e.requestTypes=["beginEdit","cancel","delete","add","save","sorting","columnstate"],e.isNormaledit="Normal"===e.parent.editSettings.mode||"Cell"===e.parent.editSettings.mode,e.virtualData={},e.virtualInfiniteData={},e.emptyRowData={},e.isContextMenuOpen=!1,e.isSelectionScroll=!1,e.validationCheck=!1,e.firstCellFocus=!1,e.prevPage=0,e.prevCurrentInfo={},e.lastPageDeleteScrollTop=-1,e.locator=t,e.eventListener("on"),e.widthServices=t.getService("widthService"),e.parent.on(Kt,e.setVisible,e),e.vgenerator=e.generator,e}t(kg,Fg=mo),kg.prototype.renderTable=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector("."+Cs))),Fg.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.content=this.getPanel().querySelector("."+Cs),this.virtualEle.content.style.position="relative",this.virtualEle.renderWrapper(),this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||!this.parent.enableColumnVirtualization?this.virtualEle.renderPlaceHolder("absolute"):this.virtualEle.renderPlaceHolder()},kg.prototype.appendContent=function(e){this.virtualEle.wrapper.appendChild(e)},kg.prototype.refreshUI=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector("."+Cs))),Fg.prototype.refreshUI.call(this)},kg.prototype.setVisible=function(e){for(var t,i=this.parent,n=0,r=e.length;n<r;n++){var s=e[parseInt(n.toString(),10)],o=i.getNormalizedColumnIndex(s.uid),a=s.visible?"":"none",l=this.getColGroup().children;i.getColumnByField(s.field)&&H.setStyleAttribute(l[parseInt(o.toString(),10)],{display:a}),i.enableColumnVirtualization&&!i.groupSettings.columns.length&&(l=void 0,(l=s.visible?this.virtualEle.wrapper.offsetWidth+parseInt(s.width.toString(),10):this.virtualEle.wrapper.offsetWidth-parseInt(s.width.toString(),10))>i.width)?(this.setDisplayNone(s,a),this.virtualEle.setWrapperWidth(l+""),this.gen.refreshColOffsets()):t=!0,t&&this.refreshUI()}},kg.prototype.setDisplayNone=function(e,t){for(var i=this.getTable(),n=0,r=[].slice.apply(i.querySelectorAll("th.e-headercell"));n<r.length;n++){var s=r[n];if(s.querySelector("[data-mappinguid]")&&s.querySelector("[data-mappinguid]").getAttribute("data-mappinguid")===e.uid){H.setStyleAttribute(s,{display:t}),""===t&&H.removeClass([s],"e-hide");break}}};var Fg,Mg=kg;function kg(e,t){var i=Fg.call(this,e,t)||this;return i.virtualEle=new Pg,i.isMovable=!1,i.gen=new Dg(i.parent),i.parent.on(Kt,i.setVisible,i),i.parent.on(ii,function(e){return"X"===e.virtualInfo.sentinelInfo.axis?i.refreshUI():null},i),i}Lg.prototype.renderWrapper=function(e){this.wrapper=H.createElement("div",{className:"e-virtualtable"}),this.wrapper.style.minHeight=H.formatUnit(e),this.wrapper.appendChild(this.table),this.content.appendChild(this.wrapper)},Lg.prototype.renderPlaceHolder=function(e){void 0===e&&(e="relative"),this.placeholder=H.createElement("div",{className:"e-virtualtrack"}),this.placeholder.style.position=e,this.content.appendChild(this.placeholder)},Lg.prototype.renderVerticalScrollbar=function(){this.verticalScrollbar=H.createElement("div",{className:"e-virtual-vertical-scrollbar"}),this.gridContent.style.position="relative",this.gridContent.appendChild(this.verticalScrollbar),this.verticalScrollerContainer=H.createElement("div",{className:"e-virtual-vertical-track"}),this.verticalScrollbar.appendChild(this.verticalScrollerContainer)},Lg.prototype.renderHorizontalScrollbar=function(){this.horizontalScrollbar=H.createElement("div",{className:"e-virtual-horizontal-scrollbar"}),this.gridContent.appendChild(this.horizontalScrollbar),this.horizontalScrollerContainer=H.createElement("div",{className:"e-virtual-horizontal-track"}),this.horizontalScrollbar.appendChild(this.horizontalScrollerContainer)},Lg.prototype.renderFrozenWrapper=function(e){this.wrapper=H.createElement("div",{className:"e-virtualtable"}),this.wrapper.style.cssText="min-height:"+H.formatUnit(e)+"; display: flex;",this.content.appendChild(this.wrapper)},Lg.prototype.renderFrozenPlaceHolder=function(){this.placeholder=H.createElement("div",{className:"e-virtualtrack"}),this.content.appendChild(this.placeholder)},Lg.prototype.adjustTable=function(e,t){this.wrapper.style.transform=cu?"translate3d("+e+"px, "+t+"px, 0px) translateZ(0)":"translate("+e+"px, "+t+"px)"},Lg.prototype.setWrapperWidth=function(e,t){!e||-1!==e.indexOf("%")||this.content.getBoundingClientRect().width<parseInt(e,10)||(t=!(e=void 0)),this.wrapper.style.width=e?e+"px":t?"100%":""},Lg.prototype.setVirtualHeight=function(e,t){this.placeholder.style.height=H.isNullOrUndefined(e)?"0px":e+"px",!t||-1!==t.indexOf("%")||this.content.getBoundingClientRect().width<parseInt(t,10)||(t="100%"),this.placeholder.style.width=t},Lg.prototype.setFreezeWrapperWidth=function(e,t,i){e.style.width=t?t+"px":i?"100%":""};var Pg=Lg;function Lg(){}Ng=function(e,t){return(Ng=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Ng(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(qg,Bg=vg),qg.prototype.renderPanel=function(){Bg.prototype.renderPanel.call(this)},qg.prototype.renderTable=function(){this.rowModelGenerator.refreshColOffsets();var e,t=this.getPanel().querySelector(".e-summarycontent");t&&(this.parent.setColumnIndexesInView(this.rowModelGenerator.getColumnIndexes(t)),Bg.prototype.renderTable.call(this),e=this.getTable(),this.virtualElement.table=e,this.virtualElement.content=t,this.virtualElement.content.style.position="relative",this.virtualElement.renderWrapper(),this.virtualElement.renderPlaceHolder("absolute"))},qg.prototype.refresh=function(e){this.rowModelGenerator.refreshColOffsets();var t=this.getPanel().querySelector(".e-summarycontent");t&&(this.parent.setColumnIndexesInView(this.rowModelGenerator.getColumnIndexes(t)),Bg.prototype.refresh.call(this,e))},qg.prototype.updateColGroup=function(){var e;this.getColGroup()&&(e=this.getHeaderColGroup(),this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e))},qg.prototype.addEventListener=function(){this.evtHandlers=[{event:Qt,handler:Bg.prototype.onWidthChange},{event:Kt,handler:Bg.prototype.columnVisibilityChanged},{event:Nt,handler:Bg.prototype.refreshFooterRenderer},{event:It,handler:this.updateColGroup}],Kc(this.parent,this.evtHandlers,!0,this)},qg.prototype.removeEventListener=function(){Kc(this.parent,this.evtHandlers,!1)};var Ng,Bg,zg=qg;function qg(e,t){var i=Bg.call(this,e,t)||this;return i.virtualElement=new Pg,i.rowModelGenerator=new Dg(i.parent),i.parent.on(ii,function(e){return"X"===e.virtualInfo.sentinelInfo.axis?i.refresh():null},i),i}Ug.prototype.getModuleName=function(){return"aggregate"},Ug.prototype.initiateRender=function(){for(var e=this,t=this.locator.getService("cellRendererFactory"),i=new bg(this.parent,this.locator),n=[oe.CellType.Summary,oe.CellType.CaptionSummary,oe.CellType.GroupSummary],r=0;r<n.length;r++)t.addCellRenderer(n[parseInt(r.toString(),10)],i);var s=this.locator.getService("rendererFactory"),s=(this.parent.enableColumnVirtualization?this.footerRenderer=new zg(this.parent,this.locator):this.footerRenderer=new vg(this.parent,this.locator),s.addRenderer(oe.RenderType.Summary,this.footerRenderer),this.footerRenderer.renderPanel(),this.footerRenderer.renderTable(),this.footerRenderer.getPanel()),o=(this.parent.element.scrollHeight>=this.parent.getHeight(this.parent.height)&&s&&H.addClass([s],["e-footerpadding"]),this.locator.register("footerRenderer",this.footerRenderer),function(){e.prepareSummaryInfo(),e.parent.off(yt,o)});this.parent.on(yt,o,this),this.parent.on(yt,this.footerRenderer.refresh,this.footerRenderer)},Ug.prototype.prepareSummaryInfo=function(){var i=this;Hg(this.parent.aggregates,function(e){var t=H.getValue("customFormat",e);H.isNullOrUndefined(t)||e.setPropertiesSilent({format:t}),"object"==typeof e.format?(t=new U,e.setFormatter(t.getFormatFunction(H.extend({},e.format)))):"string"==typeof e.format&&(t=i.locator.getService("valueFormatter"),e.setFormatter(t.getFormatFunction({format:e.format}))),e.setPropertiesSilent({columnName:e.columnName||e.field})})},Ug.prototype.onPropertyChanged=function(e){e.module!==this.getModuleName()||(H.isNullOrUndefined(this.footerRenderer)&&this.initiateRender(),this.prepareSummaryInfo(),this.footerRenderer.refresh(),e=new lo(this.parent),0===new so(this.parent).getData().length&&e.isEmpty())||this.parent.notify(bt,{})},Ug.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(mt,this.initiateRender,this),this.parent.on(St,this.onPropertyChanged,this),this.parent.on(zt,this.refresh,this),this.parent.on(s,this.destroy,this))},Ug.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.footerRenderer.removeEventListener(),this.parent.off(mt,this.initiateRender),this.parent.off(yt,this.footerRenderer.refresh),this.parent.off(St,this.onPropertyChanged),this.parent.off(zt,this.refresh),this.parent.off(s,this.destroy),this.parent.element.querySelector("."+Ss)&&H.remove(this.parent.element.querySelector("."+Ss)))},Ug.prototype.destroy=function(){this.removeEventListener()},Ug.prototype.refresh=function(e,t){e=e instanceof Array?e:[e];this.parent.notify(Nt,e),t&&(e.row=t),0<this.parent.groupSettings.columns.length&&this.parent.notify(Lt,e)};t=Ug;function Ug(e,t){H.initializeTelemetryFeature("Aggregate","DataGrid"),this.parent=e,this.locator=t,this.addEventListener()}function Hg(e,t){for(var i=0;i<e.length;i++)for(var n=0;n<e[parseInt(i.toString(),10)].columns.length;n++)t(e[parseInt(i.toString(),10)].columns[parseInt(n.toString(),10)],e[parseInt(i.toString(),10)])}jg.prototype.getModuleName=function(){return"virtualscroll"},jg.prototype.instantiateRenderer=function(){this.parent.log(["limitation","virtual_height"],"virtualization");var e=this.locator.getService("rendererFactory");this.parent.enableColumnVirtualization&&e.addRenderer(oe.RenderType.Header,new Mg(this.parent,this.locator)),this.parent.enableDomVirtualization||e.addRenderer(oe.RenderType.Content,new Ag(this.parent,this.locator)),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||this.ensurePageSize()},jg.prototype.ensurePageSize=function(){var e=this.parent.getRowHeight(),t=(this.parent.height.toString().indexOf("%")<0?this.parent:this.parent.element.getBoundingClientRect()).height,t=("string"==typeof this.parent.height&&-1!==this.parent.height.toLowerCase().indexOf("vh")&&(t=fu(this.parent.height)),this.blockSize=~~(parseFloat(t.toString())/e),2*this.blockSize),e=this.parent.pageSettings.pageSize;this.parent.setProperties({pageSettings:{pageSize:e<t?t:e}},!0)},jg.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ft,this.instantiateRenderer,this),this.parent.on(Qt,this.refreshVirtualElement,this),this.parent.on(kr,this.createVirtualValidationForm,this),this.parent.on(Pr,this.virtualEditFormValidation,this),this.parent.on(s,this.destroy,this))},jg.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ft,this.instantiateRenderer),this.parent.off(Qt,this.refreshVirtualElement),this.parent.off(kr,this.createVirtualValidationForm),this.parent.off(Pr,this.virtualEditFormValidation),this.parent.off(s,this.destroy))},jg.prototype.getCurrentEditedData=function(e,t){e={virtualData:H.extend({},{},e,!0),isAdd:!1,isScroll:!1,endEdit:!0};return this.parent.notify(kn,e),t?e:e.virtualData},jg.prototype.createVirtualValidationForm=function(e){var t=this.parent;if(t.enableVirtualization&&"Normal"===t.editSettings.mode){for(var i=t.columns,n=new $s(this.locator,null,this.parent),r=H.extend({},{},t.getRowObjectFromUID(e.uid),!0),s=(t.notify(Ar,r),e.argsCreator(this.getCurrentEditedData(e.prevData),{},!1)),o=(s.isCustomFormValidation=!0,s.row=n.render(r,i),e.renderer.update(s),{}),a=0;a<i.length;a++)i[parseInt(a.toString(),10)].visible&&i[parseInt(a.toString(),10)].validationRules&&Hc(i[parseInt(a.toString(),10)],0,o,{},{},i.length,!0);s.form.classList.add("e-virtual-validation"),t.editModule.virtualFormObj=t.editModule.createFormObj(s.form,o)}},jg.prototype.virtualEditFormValidation=function(e){var t=this.parent,i=t.element.querySelector('.e-griderror:not([style*="display: none"])');if(t.editModule.virtualFormObj)if(i&&"none"!==i.style.display){var n=i.getBoundingClientRect(),r=t.element.querySelectorAll(".e-gridform"),s=r[0],o=t.getContent().getBoundingClientRect().left;1<r.length&&(s=r[1]),(n.left<o||n.right>t.element.offsetWidth)&&(h=s.querySelector('.e-tooltip-wrap:not([style*="display: none"])'),this.scrollToEdit(h,{editIdx:e.editIdx,addIdx:e.addIdx},!0))}else if(t.editModule.virtualFormObj&&(!i||"none"===i.style.display)){for(var a=t.editModule.virtualFormObj.element.querySelectorAll('.e-tooltip-wrap:not([style*="display: none"])'),l=0;l<a.length;l++)H.remove(a[parseInt(l.toString(),10)]);var h,r=this.getCurrentEditedData(e.prevData,!0);this.setEditedDataToValidationForm(t.editModule.virtualFormObj.element,r.virtualData),e.isValid=t.editModule.virtualFormObj.validate(),e.isValid&&(this.parent.editModule.editModule.virtualEditValidationArgs=r),e.isValid||(h=t.editModule.virtualFormObj.element.querySelector('.e-tooltip-wrap:not([style*="display: none"])'),this.scrollToEdit(h,{editIdx:e.editIdx,addIdx:e.addIdx}))}},jg.prototype.scrollToEdit=function(e,t,i){var n=this.parent;if(e){var r=n.columnModel,s=Pp(e.id).split("_")[0],o=n.getColumnByField(s),e=this.parent.getContent().firstElementChild.scrollTop,n=n.getRowByIndex(t.editIdx);if(!H.isNullOrUndefined(t.addIdx)&&0<e||!H.isNullOrUndefined(t.editIdx)&&!n||i||!o){for(var a=void 0,l=0;l<r.length&&!o;l++)if(r[parseInt(l.toString(),10)].field===s){a=r[parseInt(l.toString(),10)];break}this.parent.notify(Fr,a=i?o:a)}}},jg.prototype.setEditedDataToTemplate=function(e,t){if(this.parent.isAngular&&"Normal"===this.parent.editSettings.mode)for(var i=this.parent.columnModel.filter(function(e){return e.editTemplate}),n=0,r=i.length;n<r;n++){var s,o=Mp(i[parseInt(n.toString(),10)].field);H.isNullOrUndefined(o)||(o=e[o],s=H.getValue(i[parseInt(n.toString(),10)].field,t),s=H.isNullOrUndefined(s)?"":s,o&&"combobox"===o.getAttribute("aria-label")&&o.closest(".e-combobox")&&((o=o.closest(".e-combobox").ej2_instances[0]).value=s,o.dataBind()))}},jg.prototype.setEditedDataToValidationForm=function(e,t){for(var i=[].slice.call(e.getElementsByClassName("e-field")),n=0,r=i.length;n<r;n++){var s=Qc(this.parent,i[parseInt(n.toString(),10)].getAttribute("data-mappinguid"));s.field&&(s=H.getValue(s.field,t),s=H.isNullOrUndefined(s)?"":s,i[parseInt(n.toString(),10)].value=s)}this.setEditedDataToTemplate(e,t)},jg.prototype.refreshVirtualElement=function(e){this.parent.enableColumnVirtualization&&"resize"===e.module&&this.locator.getService("rendererFactory").getRenderer(oe.RenderType.Content).refreshVirtualElement()},jg.prototype.destroy=function(){this.removeEventListener()};var Vg=jg;function jg(e,t){H.initializeTelemetryFeature("VirtualScroll","DataGrid"),this.parent=e,this.locator=t,this.addEventListener()}_g.prototype.addNew=function(e,t){var i,n;this.isEdit=!1,i=((this.parent.frozenRows||(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow)&&"Top"===this.parent.editSettings.newRowPosition?this.parent.getHeaderTable():this.parent.getContentTable()).querySelector(j),t.row=this.parent.createElement("tr",{className:"e-row e-addedrow"}),this.parent.getContentTable().querySelector(".e-emptyrow")&&!this.parent.editSettings.showAddNewRow&&((n=this.parent.getContentTable().querySelector(".e-emptyrow")).parentNode.removeChild(n),this.parent.renderModule&&this.parent.renderModule.removeEmptyOverlay&&this.parent.renderModule.removeEmptyOverlay(),this.parent.frozenRows)&&this.parent.element.querySelector(".e-frozenrow-empty")&&this.parent.element.querySelector(".e-frozenrow-empty").classList.remove("e-frozenrow-empty"),"Top"===this.parent.editSettings.newRowPosition?i.insertBefore(t.row,i.firstChild):i.appendChild(t.row),t.row.appendChild(this.getEditElement(e,!1,void 0,t,!0)),this.parent.editModule.checkLastRow(t.row,t)},_g.prototype.update=function(e,t){this.isEdit=!0;var i=[].slice.call(t.row.querySelectorAll("td.e-rowcell"));t.row.innerHTML="",t.row.appendChild(this.getEditElement(e,!0,i,t,!0)),t.row.classList.add(Os),this.parent.editModule.checkLastRow(t.row,t)},_g.prototype.getEditElement=function(e,t,i,n,r){var s=this.parent,o=0,a=H.isNullOrUndefined(s.detailTemplate)&&H.isNullOrUndefined(s.childGrid)?0:1,l=(s.allowGrouping&&(o=s.groupSettings.columns.length),this.parent.createElement("td",{className:"e-editcell e-normaledit",attrs:{colspan:(s.getCurrentVisibleColumns(this.parent.enableColumnVirtualization).length+this.parent.getIndentCount()).toString()}})),h=n.form=this.parent.createElement("form",{id:s.element.id+"EditForm",className:"e-gridform"});if(this.parent.editSettings.template)this.appendChildren(h,n.rowData,r);else{var r,d=((r=this.parent.createElement("table",{className:"e-table e-inline-edit",attrs:{cellspacing:"0.25",role:"grid"}})).appendChild(s.getContentTable().querySelector(qs).cloneNode(!0)),this.parent.createElement(j,{attrs:{role:"rowgroup"}})),p=this.parent.createElement("tr"),c=(this.parent.rowHeight&&(p.style.height=this.parent.rowHeight+"px"),0);for(a&&p.insertBefore(this.parent.createElement("td",{className:"e-detailrowcollapse"}),p.firstChild),s.isRowDragable()&&p.appendChild(this.parent.createElement("td",{className:"e-dragindentcell"}));c<o;)p.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),c++;for(var u=0,c=0,g=!0,f=n.isCustomFormValidation?this.parent.columnModel:s.getColumns();t&&u<i.length&&c<f.length||c<f.length;){var m,y,v,S=t&&i[parseInt(u.toString(),10)]?i[parseInt(u.toString(),10)].getAttribute("colspan"):null,C=f[parseInt(c.toString(),10)];t&&"rownumber"===C.type&&i[parseInt(u.toString(),10)]?(p.appendChild(i[parseInt(u.toString(),10)]),c=S?c+parseInt(S,10):c+1,u++):(m=e[C.uid].value,m=H.isNullOrUndefined(m)?"":m,(y=this.parent.createElement("td",{className:b,attrs:{colspan:S||""}})).style.cssText=C.textAlign?"text-align: "+C.textAlign+";":"",C.visible?(y.appendChild(e[C.uid]),"Vertical"===this.parent.rowRenderingMode&&(dp(y,{"data-cell":C.headerText}),0===c)&&y.classList.add("e-responsive-editcell"),"booleanedit"===C.editType?y.classList.add("e-boolcell"):(C.commands||C.commandsTemplate)&&H.addClass([y],"e-unboundcell"),this.parent.enableRtl||"Vertical"!==s.gridLines&&"Both"!==s.gridLines||!g||(o?y.classList.add("e-grid-group-first-cell"):this.parent.renderModule&&this.parent.renderModule.isFirstColumnHidden&&!(this.parent.allowRowDragAndDrop||this.parent.childGrid||this.parent.detailTemplate)&&y.classList.add("e-first-visible-cell"),g=!1)):y.classList.add("e-hide"),this.parent.isFrozenGrid()&&(zc(this.parent,C,y),this.parent.isSpan&&(v=y.getAttribute("colspan")?parseInt(y.getAttribute("colspan"),10):1,Nc(this.parent,C,y,v)),this.parent.enableColumnVirtualization)&&("Left"!==C.freeze||H.isNullOrUndefined(C.valueX)?"Right"!==C.freeze||H.isNullOrUndefined(C.valueX)?"Fixed"===C.freeze&&(y.style.left=this.parent.leftrightColumnWidth("left")-this.parent.translateX+"px",y.style.right=this.parent.leftrightColumnWidth("right")+this.parent.translateX+"px"):y.style.right=C.valueX+this.parent.translateX+"px":y.style.left=C.valueX-this.parent.translateX+"px"),y.setAttribute("aria-label",m+this.parent.localeObj.getConstant("ColumnHeader")+C.headerText),p.appendChild(y),c=S?c+parseInt(S,10):c+1,u++)}Pc(p),d.appendChild(p),r.appendChild(d),h.appendChild(r)}return l.appendChild(h),l},_g.prototype.removeEventListener=function(){},_g.prototype.appendChildren=function(e,t,i){t=H.extend({},t,{isAdd:!this.isEdit,isFrozen:i},!0),i=this.parent.element.id+"editSettingsTemplate";!this.parent.isReact||"string"==typeof this.parent.editSettings.template||this.parent.editSettings.template.prototype&&this.parent.editSettings.template.prototype.CSPTemplate?Ip(e,this.parent.getEditTemplate()(t,this.parent,"editSettingsTemplate",i,null,null,null,this.parent.root)):(this.parent.getEditTemplate()(t,this.parent,"editSettingsTemplate",i,null,null,e),this.parent.renderTemplates())};var Gg=_g;function _g(e){this.parent=e}Wg.prototype.update=function(e,t){var i,n;this.parent.isReact&&t.columnObject&&t.columnObject.template&&(i=t.cell.parentElement,n=t.cell.cloneNode(!0),i.insertBefore(n,t.cell),n.focus(),t.cell.remove(),t.cell=n),t.cell.setAttribute("aria-label",t.cell.innerHTML+this.parent.localeObj.getConstant("ColumnHeader")+t.columnObject.field),t.cell.innerHTML="",t.cell.appendChild(this.getEditElement(e,t)),t.cell.classList.add("e-editedbatchcell"),H.classList(t.row,[Os,"e-batchrow"],[])},Wg.prototype.getEditElement=function(e,t){var i=this.parent,i=this.parent.createElement("form",{id:i.element.id+"EditForm",className:"e-gridform"});return i.appendChild(e[t.columnObject.uid]),"booleanedit"===t.columnObject.editType&&t.cell.classList.add("e-boolcell"),t.columnObject.editType||t.cell.classList.add("e-inputbox"),i};var Kg=Wg;function Wg(e){this.parent=e}function Qg(e,t,i){for(var n,r,s=e.createElement("table",{className:Ds,attrs:{cellspacing:"6px",role:"grid"}}),o=e.createElement(j,{attrs:{role:"rowgroup"}}),a=0;a<i.length;a++)e.editModule.checkColumnIsGrouped(i[parseInt(a.toString(),10)])||i[parseInt(a.toString(),10)].commands||i[parseInt(a.toString(),10)].commandsTemplate||"checkbox"===i[parseInt(a.toString(),10)].type||"rownumber"===i[parseInt(a.toString(),10)].type||!t[i[parseInt(a.toString(),10)].uid]||(n=e.createElement("tr",{attrs:{role:"row"}}),(r=e.createElement("td",{className:b})).style.cssText="text-align: "+(e.enableRtl?"right":"left")+"; width: 190px;",t[i[parseInt(a.toString(),10)].uid].classList.remove("e-input"),r.appendChild(t[i[parseInt(a.toString(),10)].uid]),n.appendChild(r),o.appendChild(n));return s.appendChild(o),s}Yg.prototype.setLocaleObj=function(){this.l10n=this.serviceLocator.getService("localization")},Yg.prototype.addNew=function(e,t){this.isEdit=!1,this.createDialog(e,t)},Yg.prototype.update=function(e,t){this.isEdit=!0,this.createDialog(e,t)},Yg.prototype.createDialogHeader=function(e){var t,i=this,n=this.parent;return this.parent.enableAdaptiveUI?((t=new wa(this.parent,this.serviceLocator)).action=this.isEdit?oe.ResponsiveDialogAction.isEdit:oe.ResponsiveDialogAction.isAdd,t.renderResponsiveHeader(void 0,e)):n.editSettings.headerTemplate?H.initializeCSPTemplate(function(){return i.getDialogEditTemplateElement("HeaderTemplate",e).outerHTML}):this.isEdit?this.l10n.getConstant("EditFormTitle")+e.primaryKeyValue[0]:this.l10n.getConstant("AddFormTitle")},Yg.prototype.createDialog=function(e,t){var i=this,n=this.parent;this.dialog=this.parent.createElement("div",{id:n.element.id+"_dialogEdit_wrapper"}),this.dialog.style.width="auto",n.enableAdaptiveUI&&this.dialog.classList.add("e-responsive-dialog"),n.element.appendChild(this.dialog),this.setLocaleObj(),this.dialog.setAttribute("aria-label",this.l10n.getConstant("DialogEdit")),this.dialogObj=new F.Dialog(H.extend({header:this.createDialogHeader(t),isModal:!0,visible:!0,cssClass:this.parent.cssClass?"e-edit-dialog "+this.parent.cssClass:"e-edit-dialog",content:this.getEditElement(e,t),showCloseIcon:!0,allowDragging:!0,close:this.dialogClose.bind(this),created:this.dialogCreated.bind(this),closeOnEscape:!0,width:n.editSettings.template?"auto":"330px",target:t.target||document.body,animationSettings:{effect:"None"},footerTemplate:n.editSettings.footerTemplate?H.initializeCSPTemplate(function(){return i.getDialogEditTemplateElement("FooterTemplate",t).outerHTML}):null,buttons:[{click:this.btnClick.bind(this),buttonModel:{content:this.l10n.getConstant("SaveButton"),cssClass:this.parent.cssClass?"e-primary "+this.parent.cssClass:"e-primary",isPrimary:!0}},{click:this.btnClick.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",content:this.l10n.getConstant("CancelButton")}}]},n.editSettings.dialog&&n.editSettings.dialog.params||{})),t.dialog=this.dialogObj;this.dialogObj.isStringTemplate=!0,this.renderResponsiveDialog(),Ec(this.parent,this.dialogObj),this.dialogObj.appendTo(this.dialog),pc(this.parent.element,this.dialogObj.element.parentElement),n.enableAdaptiveUI&&this.dialogObj.show(!0)},Yg.prototype.dialogCreated=function(){jc(this.parent)},Yg.prototype.renderResponsiveDialog=function(){var e=this;this.parent.enableAdaptiveUI&&(this.parent.adaptiveDlgTarget&&(this.dialogObj.target=this.parent.adaptiveDlgTarget),this.dialogObj.buttons=[{}],this.dialogObj.showCloseIcon=!0,this.dialogObj.visible=!1,this.dialogObj.width="100%",this.dialogObj.open=function(){e.dialogObj.element.style.maxHeight="100%"})},Yg.prototype.btnClick=function(e){this.l10n.getConstant("CancelButton").toLowerCase()===e.target.innerText.trim().toLowerCase()?this.dialogClose():this.parent.endEdit()},Yg.prototype.dialogClose=function(){this.parent.closeEdit()},Yg.prototype.destroy=function(e){for(var t,i,n=["template","headerTemplate","footerTemplate"],r=0;r<n.length;r++)this.parent.editSettings[n[parseInt(r.toString(),10)]]&&(t=n[parseInt(r.toString(),10)].charAt(0).toUpperCase()+n[parseInt(r.toString(),10)].slice(1),i=this.parent.element.id+"editSettings"+t,H.updateBlazorTemplate(i,t,this.parent.editSettings));this.parent.notify(mi,{}),this.parent.isEdit=!1,this.parent.notify(ri,{}),this.dialog&&!this.dialogObj.isDestroyed&&(this.dialogObj.destroy(),H.remove(this.dialog))},Yg.prototype.getDialogEditTemplateElement=function(e,t){var i=this.parent.createElement("div",{className:"e-dialog"+e}),t=H.extend({},t.rowData,{isAdd:!this.isEdit},!0),n=this.parent.element.id+"editSettings"+e;return Ip(i,("HeaderTemplate"===e?this.parent.getEditHeaderTemplate():this.parent.getEditFooterTemplate())(t,this.parent,"editSettings"+e,n)),H.updateBlazorTemplate(n,e,this.parent.editSettings),i},Yg.prototype.getEditElement=function(e,t){var i,n,r,s=this,o=this.parent,a=this.parent.createElement("div",{className:this.isEdit?Os:"e-insertedrow"}),l=t.form=this.parent.createElement("form",{id:o.element.id+"EditForm",className:"e-gridform"});return this.parent.editSettings.template?(i=this.parent.element.id+"editSettingsTemplate",t=H.extend({},t.rowData,{isAdd:!this.isEdit},!0),n=this.parent.isReact&&"string"!=typeof this.parent.editSettings.template&&!(this.parent.editSettings.template.prototype&&this.parent.editSettings.template.prototype.CSPTemplate),r=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,n||r?(this.parent.getEditTemplate()(t,this.parent,"editSettingsTemplate",i,null,null,l),this.parent.renderTemplates()):Ip(l,this.parent.getEditTemplate()(t,this.parent,"editSettingsTemplate",i,null,null,null,o.root)),H.updateBlazorTemplate(i,"Template",this.parent.editSettings,!0,function(){for(var e=s.parent.getColumns(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].validationRules&&(s.parent.editModule.formObj.rules[e[parseInt(t.toString(),10)].field]=e[parseInt(t.toString(),10)].validationRules)}),a.appendChild(l)):(l.appendChild(Qg(this.parent,e,o.getColumns())),a.appendChild(l)),a},Yg.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ui,this.destroy),this.parent.off(s,this.destroy))};var Xg=Yg;function Yg(e,t){this.parent=e,this.serviceLocator=t,this.parent.isDestroyed||(this.parent.on(ui,this.destroy,this),this.parent.on(s,this.destroy,this))}Zg.prototype.update=function(e,t){var i,n;this.parent.isReact&&t.columnObject&&t.columnObject.template&&(i=t.cell.parentElement,n=t.cell.cloneNode(!0),i.insertBefore(n,t.cell),n.focus(),t.cell.remove(),t.cell=n),t.cell.setAttribute("aria-label",t.cell.innerHTML+this.parent.localeObj.getConstant("ColumnHeader")+t.columnObject.field),t.cell.innerHTML="",t.cell.appendChild(this.getEditElement(e,t)),t.cell.classList.add("e-editedcell"),H.classList(t.row,[Os],[])},Zg.prototype.getEditElement=function(e,t){var i=this.parent,i=this.parent.createElement("form",{id:i.element.id+"EditForm",className:"e-gridform"});return i.appendChild(e[t.columnObject.uid]),"booleanedit"===t.columnObject.editType&&t.cell.classList.add("e-boolcell"),t.columnObject.editType||t.cell.classList.add("e-inputbox"),i},Zg.prototype.addNew=function(e,t){this.renderer.addNew(e,t)};var $g=Zg;function Zg(e){this.parent=e,this.renderer=new Gg(e)}ef.prototype.addNew=function(e){this.renderer.addNew(this.getEditElements(e),e),this.convertWidget(e)},ef.prototype.update=function(e){this.renderer.update(this.getEditElements(e),e),e.isCustomFormValidation||(this.parent.notify(an,e),this.convertWidget(e))},ef.prototype.convertWidget=function(e){for(var t,i=this.parent,n="Dialog"===i.editSettings.mode?H.select("#"+i.element.id+"_dialogEdit_wrapper .e-gridform",document):(i.editSettings.showAddNewRow&&i.element.querySelector(".e-editedrow")?i.element.querySelector(".e-editedrow"):i.element).getElementsByClassName("e-gridform")[0],r=0,s="Batch"===i.editSettings.mode||"Cell"===i.editSettings.mode&&"beginEdit"===e.requestType?[i.getColumnByField(e.columnName)]:i.getColumns();r<s.length;r++){var o,a,l=s[r];this.parent.editSettings.template&&!H.isNullOrUndefined(l.field)?((o=H.extend({},e)).element=n.querySelector("[name="+Mp(l.field)+"]"),"string"==typeof l.edit.write?N(l.edit.write,window)(o):l.edit.write(o)):this.parent.editModule.checkColumnIsGrouped(l)||l.commands||(l.valueAccessor(l.field,e.rowData,l),o=n.querySelector("[data-mappinguid="+kp(l.uid)+"]"),a=l.edit.write,H.isNullOrUndefined(o))||("string"==typeof a?(a=N(a,window))({rowData:e.rowData,element:o,column:l,requestType:e.requestType,row:e.row,foreignKeyData:l.isForeignColumn()&&N(l.field,e.foreignKeyData)}):l.edit.write({rowData:e.rowData,element:o,column:l,requestType:e.requestType,row:e.row,foreignKeyData:l.isForeignColumn()&&N(l.field,e.foreignKeyData)}),t)||!H.isNullOrUndefined(o.getAttribute("disabled"))||I(o,"e-checkbox-disabled")||(a=!H.isNullOrUndefined(l.edit)&&!H.isNullOrUndefined(l.edit.params)&&l.edit.params.multiline,"hidden"===o.getAttribute("type")&&a&&o.parentElement&&o.parentElement.classList.contains("e-multi-line-input")?(l=o.parentElement.querySelector("textarea"))&&this.focusElement(l,e.type):this.focusElement(o,e.type),t=!0)}},ef.prototype.focusElement=function(e,t){var i,n=this.parent.element.querySelector(".e-edit-checkselect");!H.isNullOrUndefined(n)&&n.nextElementSibling&&n.nextElementSibling.classList.add("e-focus"),"Batch"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode&&!H.isNullOrUndefined(I(e,Os))?this.focus.onClick({target:H.closest(e,"td")},!0):(n="Cell"===this.parent.editSettings.mode&&!H.isNullOrUndefined(I(e,As)),n=!(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableColumnVirtualization)||"Normal"!==this.parent.editSettings.mode&&!n,i=e.classList.contains("e-dropdownlist")?e.parentElement:e,(n||(this.parent.enableVirtualization||this.parent.enableColumnVirtualization)&&"Bottom"===this.parent.editSettings.newRowPosition&&I(e,As))&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&!I(e,As)||this.parent.addNewRowFocus)?(i.focus(),this.parent.enableVirtualization&&"Normal"===this.parent.editSettings.mode&&this.parent.contentModule&&this.parent.contentModule.content&&(this.parent.contentModule.content.scrollTop+=this.parent.getRowHeight())):i.focus({preventScroll:!0})),e.classList.contains("e-defaultcell")&&e.setSelectionRange(e.value.length,e.value.length)},ef.prototype.getEditElements=function(e){var t=this.parent,i={},n="Batch"===t.editSettings.mode||"Cell"===t.editSettings.mode&&"beginEdit"===e.requestType?[t.getColumnByField(e.columnName)]:t.getColumns();if(e.columns&&(n=e.columns),e.isCustomFormValidation&&(n=this.parent.columnModel),this.parent.editSettings.template)return{};for(var r=0,s=n.length;r<s;r++){var o,a,l,h,d,p,c,u,g,f=n[parseInt(r.toString(),10)];f.commands||f.commandsTemplate?(o=this.serviceLocator.getService("cellRendererFactory"),c=new Js(this.parent),o=o.getCellRenderer(oe.CellType.CommandColumn),c=c.generateRows(e.rowData)[0].cells.filter(function(e){return e.rowID}),(c=(o=o.render(c[parseInt(r.toString(),10)],e.rowData,{"data-index":e.row?(parseInt(e.row.getAttribute(D),10)-1).toString():0},this.parent.enableVirtualization)).firstElementChild).setAttribute("textAlign",o.getAttribute("textAlign")),i[f.uid]=c):(a=("dateonly"===f.type&&e.rowData[f.field]instanceof Date&&(o=e.rowData[f.field],e.rowData[f.field]=o.getFullYear()+"-"+Jp(o.getMonth()+1)+"-"+Jp(o.getDate())),f.valueAccessor(f.field,e.rowData,f)),a={column:f,value:a,type:e.requestType,data:e.rowData},l=f.edit.create,h=void 0,f.editTemplate?(h=this.parent.createElement("span",{attrs:{"data-mappinguid":f.uid}}),d=this.parent.element.id+f.uid+"editTemplate",p=sc({},e.rowData,{column:f}),u=this.parent.isReact&&"string"!=typeof f.editTemplate&&!(f.editTemplate.prototype&&f.editTemplate.prototype.CSPTemplate),g=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,u||g?(f.getEditTemplate()(H.extend({index:e.rowIndex},p),this.parent,"editTemplate",d,null,null,h),this.parent.renderTemplates()):Ip(h,f.getEditTemplate()(H.extend({index:e.rowIndex},p),this.parent,"editTemplate",d,null,null,null,t.root))):("string"==typeof(h="string"==typeof l?(l=N(l,window))(a):f.edit.create(a))&&((c=this.parent.createElement("div")).innerHTML=h,h=c.firstChild),u="input"!==h.tagName&&h.querySelectorAll("input").length,g=Mp(f.field),H.attributes(u?h.querySelector("input"):h,{name:g,"data-mappinguid":f.uid,id:t.element.id+g}),H.classList(h,["e-input","e-field"],[]),"Right"===f.textAlign&&h.classList.add("e-ralign"),((f.isPrimaryKey||f.isIdentity)&&"beginEdit"===e.requestType||f.isIdentity&&"add"===e.requestType)&&h.setAttribute("disabled","")),i[f.uid]=h)}return i},ef.prototype.destroy=function(){this.renderer.removeEventListener()},ef.prototype.renderToolPanelForm=function(e,t,i,n,r){var s=this.parent.editSettings.mode;this.parent.setProperties({editSettings:{mode:"Dialog"}},!0);try{return this.createToolPanelForm(e,t,i,n,r)}finally{this.parent.setProperties({editSettings:{mode:s}},!0)}},ef.prototype.createToolPanelForm=function(e,t,i,n,r){var s=this.getEditElements({rowData:t,requestType:"beginEdit",columns:e}),o=this.parent.createElement("div",{className:Os}),a=this.parent.createElement("form",{id:i,className:"e-gridform"});a.appendChild(Qg(this.parent,s,e)),o.appendChild(a),n.appendChild(o);for(var l=0,h=e;l<h.length;l++){var d=h[l],p=a.querySelector("[data-mappinguid="+kp(d.uid)+"]");p&&(p.id=i+"_"+Mp(d.field),p={rowData:t,element:p,column:d,requestType:"beginEdit",foreignKeyData:d.isForeignColumn()&&N(d.field,r)},"string"==typeof d.edit.write?N(d.edit.write,window)(p):d.edit.write(p))}return o};var Jg=ef;function ef(e,t){this.editType={Inline:Gg,Normal:Gg,Batch:Kg,Dialog:Xg,Cell:$g},this.parent=e,this.serviceLocator=t,this.renderer=new this.editType[this.parent.editSettings.mode](e,t),this.focus=t.getService("focus")}nf.prototype.create=function(e){return Wc(this.parent,e.column,"e-field",{type:"text"})},nf.prototype.read=function(e){return e.ej2_instances[0].value},nf.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.removeEventHandler&&this.removeEventHandler(),this.obj.destroy(),this.obj.element.remove())};var tf=nf;function nf(e){this.parent=e}rf=function(e,t){return(rf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}rf(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(af,sf=tf),af.prototype.create=function(e){var t="e-field e-boolcell";return"checkbox"===e.column.type&&(t="e-field e-boolcell e-edit-checkselect"),this.removeEventHandler=this.removeEventListener,Wc(this.parent,e.column,t,{type:"checkbox",value:e.value})},af.prototype.read=function(e){return e.checked},af.prototype.write=function(e){var t,i;H.isNullOrUndefined(e.row)||(t=e.row.querySelector(".e-edit-checkselect")),N(e.column.field,e.rowData)&&(i=JSON.parse(N(e.column.field,e.rowData).toString().toLowerCase())),H.isNullOrUndefined(t)||"checkbox"!==e.column.type||(this.editType=this.parent.editSettings.mode,this.editRow=e.row,"add"!==e.requestType&&(i=!!(t=this.parent.getRowObjectFromUID(e.row.getAttribute("data-uid")))&&t.isSelected),Up.apply(void 0,[[].slice.call(e.row.getElementsByClassName(b)),i].concat(this.activeClasses))),this.obj=new M.CheckBox(H.extend({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:i,disabled:!Lp(e.column,e.requestType,e.element),enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass||""},e.column.edit.params)),this.addEventListener(),this.obj.appendTo(e.element)},af.prototype.addEventListener=function(){this.cbChange=this.checkBoxChange.bind(this),this.obj.addEventListener(Hs,this.cbChange)},af.prototype.removeEventListener=function(){this.obj.isDestroyed||this.obj.removeEventListener(Hs,this.cbChange)},af.prototype.checkBoxChange=function(){var e;this.editRow&&"Dialog"!==this.editType&&this.editRow.getAttribute("aria-rowindex")&&(e=parseInt(this.editRow.getAttribute("aria-rowindex"),10)-1,this.parent.selectionModule.addRowsToSelection([e]))};var rf,sf,of=af;function af(){var e=null!==sf&&sf.apply(this,arguments)||this;return e.activeClasses=["e-selectionbackground","e-active"],e}lf=function(e,t){return(lf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}lf(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(pf,hf=tf),pf.prototype.write=function(e){var t="Dialog"!==this.parent.editSettings.mode,i=(this.column=e.column,new V.Predicate(e.column.field,"notequal",null,!0,!1)),n={};if(e.column.edit.params)for(var r=Object.keys(e.column.edit.params),s=0;s<r.length;s++)n[r[parseInt(s.toString(),10)]]="query"===r[parseInt(s.toString(),10)]?e.column.edit.params[r[parseInt(s.toString(),10)]].clone():e.column.edit.params[r[parseInt(s.toString(),10)]];this.obj=new P.DropDownList(H.extend({dataSource:this.parent.dataSource instanceof V.DataManager?this.parent.dataSource:new V.DataManager(this.parent.dataSource),query:(new V.Query).where(i).select(e.column.field),enabled:Lp(e.column,e.requestType,e.element)&&Np(I(e.element,"e-rowcell"),this.parent),fields:{value:e.column.field},value:N(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,placeholder:t?"":e.column.headerText,popupHeight:"200px",floatLabelType:t?"Never":"Always",sortOrder:"Ascending",cssClass:this.parent.cssClass||null,close:this.dropDownClose.bind(this)},n)),this.obj.isAngular=Oc(this.parent),this.parent.enableVirtualization&&(this.obj.dataSource=n.dataSource||(e.column.isForeignColumn()?[e.foreignKeyData[0]]:[e.rowData])),this.addEventListener(),this.obj.query.params=this.parent.query.params,this.obj.appendTo(e.element),e.element.setAttribute("name",Mp(e.column.field))},pf.prototype.dropDownClose=function(e){e.event&&("escape"===e.event.action?this.parent.editModule.editCellDialogClose=!0:!this.parent.isEdit||"Batch"!==this.parent.editSettings.mode&&"Cell"!==this.parent.editSettings.mode||"enter"!==e.event.action||(e.event.stopPropagation(),e.event.preventDefault()))},pf.prototype.addEventListener=function(){this.ddCreated=this.dropdownCreated.bind(this),this.ddOpen=this.dropDownOpen.bind(this),this.ddBeforeOpen=this.dropdownBeforeOpen.bind(this),this.ddComplete=this.ddActionComplete.bind(this),this.obj.addEventListener(js,this.ddCreated),this.obj.addEventListener(Us,this.ddOpen),this.obj.addEventListener(Gs,this.ddBeforeOpen),this.obj.addEventListener(c,this.ddComplete)},pf.prototype.removeEventListener=function(){this.obj.isDestroyed||(this.obj.removeEventListener(js,this.ddCreated),this.obj.removeEventListener(Us,this.ddOpen),this.obj.removeEventListener(Gs,this.ddBeforeOpen),this.obj.removeEventListener(c,this.ddComplete))},pf.prototype.dropdownCreated=function(e){this.flag=!0},pf.prototype.dropdownBeforeOpen=function(){this.parent.enableVirtualization&&(this.column.edit.params&&this.column.edit.params.dataSource?this.obj.dataSource=this.column.edit.params.dataSource:this.obj.dataSource=this.column.isForeignColumn()?this.column.dataSource instanceof V.DataManager?this.column.dataSource:new V.DataManager(this.column.dataSource):this.parent.dataSource instanceof V.DataManager?this.parent.dataSource:new V.DataManager(this.parent.dataSource))},pf.prototype.ddActionComplete=function(e){e.result=V.DataUtil.distinct(e.result,this.obj.fields.value,!0),!this.flag||!this.column.dataSource||this.column.edit.params&&this.column.edit.params.ddEditedData||("result"in this.column.dataSource?this.column.dataSource.result=e.result:this.column.dataSource instanceof V.DataManager&&(this.column.dataSource.dataSource.json=e.result)),this.flag=!1},pf.prototype.dropDownOpen=function(e){var t=I(this.obj.element,"e-dialog");"Dialog"!==this.parent.editSettings.mode||H.isNullOrUndefined(t)||(t=H.select("#"+t.id,document).ej2_instances[0],e.popup.element.style.zIndex=(t.zIndex+1).toString())};var lf,hf,df=pf;function pf(e){var t=hf.call(this)||this;return t.parent=e,t.flag=!1,t.removeEventHandler=t.removeEventListener,t}uf.prototype.keyEventHandler=function(e){13!==e.keyCode&&9!==e.keyCode||((e=document.createEvent("HTMLEvents")).initEvent("change",!1,!0),this.dispatchEvent(e))},uf.prototype.create=function(e){return this.instances=new H.Internationalization(this.parent.locale),Wc(this.parent,e.column,"e-field",{})},uf.prototype.read=function(e){return this.obj.value},uf.prototype.write=function(e){var t=e.column,i="Dialog"!==this.parent.editSettings.mode;this.obj=new k.NumericTextBox(H.extend({value:parseFloat(N(e.column.field,e.rowData)),enableRtl:this.parent.enableRtl,placeholder:i?"":e.column.headerText,enabled:Lp(e.column,e.requestType,e.element)&&Np(I(e.element,"e-rowcell"),this.parent),floatLabelType:"Dialog"!==this.parent.editSettings.mode?"Never":"Always",locale:this.parent.locale,cssClass:this.parent.cssClass||null},t.edit.params)),e.element.setAttribute("name",Mp(e.column.field)),this.obj.appendTo(e.element),this.obj.element.addEventListener("keydown",this.keyEventHandler)},uf.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.obj.element.removeEventListener("keydown",this.keyEventHandler),this.obj.destroy(),this.obj.element.remove())};var cf=uf;function uf(e){this.parent=e}gf=function(e,t){return(gf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}gf(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(yf,ff=tf),yf.prototype.create=function(e){var t={type:"text",value:H.isNullOrUndefined(e.value)?"":e.value},t=Wc(this.parent,e.column,"e-field e-input e-defaultcell",t);return e.column.textAlign&&(t.style.textAlign=e.column.textAlign),t},yf.prototype.read=function(e){return("hidden"!==e.type||H.isNullOrUndefined(e.ej2_instances[0])||H.isNullOrUndefined(e.ej2_instances[0].textarea)?e:e.ej2_instances[0]).value},yf.prototype.write=function(e){var t,i=e.column,n="Dialog"!==this.parent.editSettings.mode,n={element:e.element,floatLabelType:"Dialog"!==this.parent.editSettings.mode?"Never":"Always",enableRtl:this.parent.enableRtl,enabled:Lp(e.column,e.requestType,e.element)&&Np(I(e.element,"e-rowcell"),this.parent),placeholder:n?"":e.column.headerText,cssClass:this.parent.cssClass||""};H.isNullOrUndefined(i.edit)||H.isNullOrUndefined(i.edit.params)||!i.edit.params.multiline||(t=i.valueAccessor(i.field,e.rowData,i),n.value=t,t=n.element.getAttribute("data-mappinguid"),n.element.removeAttribute("data-mappinguid"),n.element.setAttribute("e-mappinguid",t)),this.obj=new k.TextBox(H.extend(n,i.edit.params)),this.obj.appendTo(e.element),H.isNullOrUndefined(t)||(this.obj.element.removeAttribute("e-mappinguid"),this.obj.element.setAttribute("data-mappinguid",t)),"Batch"===this.parent.editSettings.mode&&this.obj.element.addEventListener("keydown",this.keyEventHandler)},yf.prototype.keyEventHandler=function(e){"Enter"!==e.key&&"Tab"!==e.key||(e=new Event("change",{bubbles:!1,cancelable:!0}),this.dispatchEvent(e))},yf.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.obj.element.removeEventListener("keydown",this.keyEventHandler),this.obj.destroy(),this.obj.element.remove())};var gf,ff,mf=yf;function yf(){return null!==ff&&ff.apply(this,arguments)||this}Sf.prototype.clickHandler=function(e){var e=e.target,t=this.parent;t.editSettings.showAddNewRow&&H.isNullOrUndefined(t.element.querySelector("."+Os))||(I(e,vs)&&I(I(e,vs),"e-grid").id===t.element.id||(t.frozenRows||t.pinnedTopRecords.length)&&I(e,Cs)&&!I(e,"e-columnheader"))&&!I(e,"e-unboundcelldiv")&&(this.rowIndex=I(e,b)?parseInt(I(e,b).parentElement.getAttribute(D),10)-1:-1,t.isEdit)&&t.editModule.endEdit()},Sf.prototype.dblClickHandler=function(e){!I(e.target,b)||!this.parent.editSettings.allowEditOnDblClick||this.parent.editSettings.showAddNewRow&&(!this.parent.editSettings.showAddNewRow||I(e.target,"e-addedrow"))||e.target&&(e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-treegridexpand"))||this.parent.editModule.startEdit(I(e.target,Ts))},Sf.prototype.editComplete=function(e){this.parent.isEdit=!!this.parent.editSettings.showAddNewRow;var t="action";switch(e.requestType){case"save":(this.parent.isCheckBoxSelection||"Multiple"===this.parent.selectionSettings.type)&&this.parent.isPersistSelection||"edit"===e[t]||this.parent.editSettings.showAddNewRow&&(!this.parent.editSettings.showAddNewRow||"add"===e[t])||(this.parent.allowPaging&&0<e.index&&(e.index=this.parent.pageSettings.currentPage===Math.floor(e.index/this.parent.pageSettings.pageSize)+1?e.index%this.parent.pageSettings.pageSize:-1),this.parent.enableVirtualization&&0<e.index&&(this.parent.selectVirtualRowOnAdd=!0),this.parent.isTreeGrid&&this.parent.enableVirtualization&&(this.parent.sortSettings&&this.parent.sortSettings.columns.length||this.parent.filterSettings&&this.parent.filterSettings.columns.length||this.parent.searchSettings&&this.parent.searchSettings.key.length))||this.parent.selectRow(e.index),this.parent.trigger(c,H.extend(e,{requestType:"save",type:c})),this.parent.notify(Er,{requestType:"save",action:e[t]});break;case"delete":this.parent.trigger(c,H.extend(e,{requestType:"delete",type:c})),this.parent.isCheckBoxSelection||this.parent.enableInfiniteScrolling&&(this.parent.childGrid||this.parent.detailTemplate)||this.parent.selectRow(this.editRowIndex),this.parent.notify(Er,{requestType:"delete",action:e[t]});break;case"refresh-aggregate-on-save":this.parent.trigger(c,H.extend(e,{requestType:"refresh-aggregate-on-save",type:c})),this.parent.selectRow(this.rowIndex),this.parent.notify(Er,{requestType:"refresh-aggregate-on-save",action:e[t]})}},Sf.prototype.getEditArgs=function(e,t,i){for(var n=this.parent.getPrimaryKeyFieldNames(),r=[],s=0;s<n.length;s++)r.push(N(n[parseInt(s.toString(),10)],e));return{primaryKey:n,primaryKeyValue:r,requestType:"beginEdit",rowData:e,rowIndex:this.rowIndex,type:"edit",cancel:!1,foreignKeyData:t&&t.foreignKeyData,target:void 0,isScroll:i}},Sf.prototype.startEdit=function(t){var i=this,n=this.parent;if(this.rowIndex=this.editRowIndex=parseInt(t.getAttribute(D),10)-1,n.enableVirtualization||n.enableColumnVirtualization||n.enableInfiniteScrolling){var e='.e-row[aria-rowindex="'+(this.rowIndex+1)+'"]';if(!this.parent.element.querySelector(e))return}var e={data:void 0,index:this.rowIndex,isScroll:!1},r=(this.parent.notify(Dn,e),tc(n)?(r=n.getRowObjectFromUID(t.getAttribute("data-uid")),this.previousData=r.data):this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.parent.enableInfiniteScrolling&&(!this.previousData||this.parent.infiniteScrollSettings.enableCache)?this.previousData=e.data:this.parent.enableVirtualization||(this.previousData=H.extend({},{},this.parent.getForeignKeyColumns().length||this.parent.allowGrouping&&this.parent.groupSettings.columns.length||this.parent.pinnedTopRowModels.length?this.parent.getRowObjectFromUID(t.getAttribute("data-uid")).data:n.getCurrentViewRecords()[this.rowIndex],!0)),H.extend({},{},e.data||this.previousData,!0)),s=(this.uid=t.getAttribute("data-uid"),n.getRowObjectFromUID(this.uid)),r=this.getEditArgs(r,s,e.isScroll);r.row=t,r.isScroll?this.inlineEditHandler(r,t):(this.parent.notify(kr,{uid:this.uid,prevData:this.previousData,argsCreator:this.getEditArgs.bind(this),renderer:this.renderer}),n.trigger(Ge,r,function(e){e.type="actionBegin",n.trigger(y,e,function(e){e.cancel||i.inlineEditHandler(e,t)})}))},Sf.prototype.disabledShowAddRow=function(e,t){var i=this.parent.element.querySelector(".e-addedrow"),n=[].slice.call(i?i.querySelectorAll(".e-input"):[]);if(i&&i.querySelector(".e-unboundcell"))for(var r=[].slice.call(i.querySelector(".e-unboundcell").querySelectorAll(".e-btn")),s=0;s<r.length;s++)e?(r[parseInt(s.toString(),10)].classList.remove("e-disabled"),r[parseInt(s.toString(),10)].removeAttribute("disabled")):(r[parseInt(s.toString(),10)].classList.add("e-disabled"),r[parseInt(s.toString(),10)].setAttribute("disabled","disabled"));if(n.length)for(s=0;s<n.length;s++){var o=n[parseInt(s.toString(),10)],a=o.getAttribute("data-mappinguid"),a=this.parent.getColumnByUid(a),l=I(o,"e-rowcell").querySelector(".e-error");l&&l.classList.remove("e-error"),o.ej2_instances?(t&&H.isNullOrUndefined(a.defaultValue)&&("checkbox"===o.type?(o.ej2_instances[0].checked=!1,o.checked=!1):(o.ej2_instances[0].value=null,o.value=null)),"checkbox"!==o.type||H.isNullOrUndefined(e)?H.isNullOrUndefined(e)||(o.ej2_instances[0].enabled=!(!e||!a.allowEditing)):o.ej2_instances[0].disabled=!e||!a.allowEditing):(t&&o.value&&o.value.length&&H.isNullOrUndefined(a.defaultValue)&&(o.value=null),H.isNullOrUndefined(e)||(e?a.allowEditing&&(o.classList.remove("e-disabled"),o.removeAttribute("disabled")):(o.classList.add("e-disabled"),o.setAttribute("disabled","disabled"))))}},Sf.prototype.inlineEditHandler=function(e,t){var i=this.parent;i.isEdit=!0,e.row=e.row||t,"Dialog"!==i.editSettings.mode&&i.clearSelection(),"Dialog"===i.editSettings.mode&&i.selectionModule&&(i.selectionModule.preventFocus=!0,e.row.classList.add("e-dlgeditrow")),this.renderer.update(e),this.uid=t.getAttribute("data-uid"),i.editModule.applyFormValidation(),i.editSettings.showAddNewRow&&!t.classList.contains("e-addedrow")&&this.disabledShowAddRow(!1,!0),e.type="actionComplete",i.trigger(c,e),i.editSettings.template&&i.editModule.applyFormValidation(void 0,e.form.ej2_instances[0].rules),this.args=e,this.parent.allowTextWrap&&this.parent.notify(Oi,{case:"textwrap"})},Sf.prototype.updateRow=function(e,t){var i=this,n=this.parent,r=(this.editRowIndex=e,n.getRowByIndex(e));r&&(t={requestType:"save",action:"edit",type:y,data:t,cancel:!1,previousData:n.getCurrentViewRecords()[parseInt(e.toString(),10)],row:r},this.registerPendingRecord("edit",t.previousData,e),n.showSpinner(),n.enableInfiniteScrolling&&(this.uid=t.row.getAttribute("data-uid"),r=parseInt(t.row.getAttribute("aria-rowindex"),10)-1,this.parent.notify(qr,{index:r})),n.notify(li,t),t.promise?t.promise.then(function(){return n.refresh()}).catch(function(e){return i.edFail(e)}):n.enableInfiniteScrolling||(n.refresh(),n.enableVirtualization&&(n.contentModule.vgenerator.startIndex=null)))},Sf.prototype.editFormValidate=function(){var e=this.parent,t=e.editModule.editFormValidate(),i={prevData:this.previousData,isValid:!0,editIdx:this.editRowIndex,addIdx:this.addedRowIndex};return e.notify(Pr,i),t&&i.isValid},Sf.prototype.endEdit=function(){var e,t,i,n,r,s,o=this,a=this.parent;this.parent.isEdit&&this.editFormValidate()&&(e=H.extend({},{},this.previousData,!0),t=H.extend(this.args,{requestType:"save",type:y,data:e,cancel:!1,previousData:this.previousData,selectedRow:a.selectedRowIndex,foreignKeyData:{}}),i="Dialog"===a.editSettings.mode,n=H.select("#"+a.element.id+"_dialogEdit_wrapper",document),s=i?n.querySelector(".e-gridform"):(a.editSettings.showAddNewRow&&a.element.querySelector("."+Os)?a.element.querySelector("."+Os):a.element).getElementsByClassName("e-gridform")[0],r={virtualData:H.extend({},{},this.previousData,!0),isAdd:!1,isScroll:!1,endEdit:!0},this.parent.enableVirtualization&&!this.parent.isRowDomVirtualization()&&this.parent.editSettings&&"Normal"===this.parent.editSettings.mode?(r.virtualData=this.virtualEditValidationArgs.virtualData,r.isAdd=this.virtualEditValidationArgs.isAdd,r.isCancel=this.virtualEditValidationArgs.isCancel):this.parent.notify(kn,r),(this.parent.enableVirtualization||this.parent.isRowDomVirtualization()||this.parent.enableColumnVirtualization||this.parent.enableInfiniteScrolling)&&"Normal"===this.parent.editSettings.mode&&Object.keys(r.virtualData).length?this.parent.isEdit&&(this.currentVirtualData=e=t.data=r.virtualData):e=a.editModule.getCurrentEditedData(s,e),s=[].slice.call(a.element.getElementsByClassName(Os)).length,!r.isAdd&&Object.keys(this.currentVirtualData).length&&(s=s||1),(i?n.getElementsByClassName(Os).length:s)?(t.action="edit",this.registerPendingRecord("edit",this.previousData,this.editRowIndex),a.trigger(y,t,function(e){e.cancel||("Spinner"===o.parent.loadingIndicator.indicatorType&&a.showSpinner(),"Shimmer"===o.parent.loadingIndicator.indicatorType&&o.parent.showMaskRow(),a.editSettings.showAddNewRow&&o.disabledShowAddRow(!0),a.notify(li,e))})):(t.action="add",t.selectedRow=0,t.index=this.addedRowIndex,this.registerPendingRecord("add",t.data,this.addedRowIndex),a.notify(Tn,{}),a.notify(bt,t),this.addedRowIndex=null,t.cancel||this.parent.editSettings.showAddNewRow&&(this.parent.notify(Yr,{}),(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.disabledShowAddRow(!0,!0),"Dialog"!==a.editSettings.mode)&&H.isNullOrUndefined(a.editSettings.template)&&(a.editModule.destroyWidgets(),a.editModule.destroyForm())))},Sf.prototype.destroyElements=function(){var e=this.parent;(!e.editSettings.showAddNewRow||e.editSettings.showAddNewRow&&e.element.querySelector(".e-editedrow"))&&(e.editModule.destroyWidgets(),e.editModule.destroyForm(),"Dialog"!==e.editSettings.mode)&&H.isNullOrUndefined(e.editSettings.template)&&(e.editModule.formObj=null),this.parent.notify(ui,{})},Sf.prototype.editHandler=function(t){var i=this;t.promise?t.promise.then(function(e){return i.edSucc(e,t)}).catch(function(e){return i.edFail(e)}):this.editSuccess(t.data,t),this.parent.editSettings.showAddNewRow&&this.parent.editModule.applyFormValidation()},Sf.prototype.registerPendingRecord=function(e,t,i){var n=this.parent.editModule&&this.parent.editModule.undoRedoModule;n&&n.setPendingRecord&&n.setPendingRecord(t,e,i)},Sf.prototype.edSucc=function(e,t){this.editSuccess(e,t)},Sf.prototype.edFail=function(e){this.editFailure(e)},Sf.prototype.updateCurrentViewData=function(e){this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||(this.parent.getCurrentViewRecords()[this.editRowIndex]=e)},Sf.prototype.requestSuccess=function(e){this.parent.editModule.formObj&&!this.parent.editModule.formObj.isDestroyed&&(this.destroyElements(),this.stopEditStatus(),"Dialog"===this.parent.editSettings.mode)&&"add"!==e.action&&this.parent.selectionModule&&this.parent.element.querySelector(".e-dlgeditrow").classList.remove("e-dlgeditrow")},Sf.prototype.editSuccess=function(e,l){if(H.isNullOrUndefined(e)||e instanceof Array||(l.data=H.extend({},H.extend({},l.rowData,l.data),e)),this.requestSuccess(l),this.parent.trigger(Ye,l),l.type=c,this.parent.isEdit=!!this.parent.editSettings.showAddNewRow,this.parent.renderModule.resetPartialRecords(),this.refreshRow(l.data),this.parent.notify(Tn,l),this.parent.editModule.checkLastRow(l.row),this.parent.editModule.isLastRow=!1,this.updateCurrentViewData(l.data),this.blazorTemplate(),this.editRowIndex=null,this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.showGroupedColumn){for(var e=l.row,t=this.parent.getRowsObject(),e=e.getAttribute("data-uid"),h=this.parent.getRowObjectFromUID(e),i=this,n=0;n<this.parent.groupSettings.columns.length;n++)!function(o){var a=i;t=t.filter(function(e){var t=e.isDataRow&&e!==h&&!H.isNullOrUndefined(e.data);if(t){for(var i=a.parent.groupSettings.columns[parseInt(o.toString(),10)].split("."),n=e.data[i[0]],r=l.data[i[0]],s=1;s<i.length;s++)n=n[i[s]],r=r[i[s]];return t&&n===r}return t})}(n);e=t[0];H.isNullOrUndefined(h)||H.isNullOrUndefined(e)||h.parentUid===e.parentUid?!this.parent.groupSettings.enableLazyLoading&&this.parent.aggregates.length&&(this.parent.enableInfiniteScrolling||this.parent.enableVirtualization||this.parent.allowPaging&&this.parent.groupSettings.disablePageWiseAggregates)?this.parent.notify(bt,{requestType:"refresh-aggregate-on-save",action:"update"}):this.parent.aggregates.length&&this.parent.aggregateModule.refresh(l.data,this.parent.groupSettings.enableLazyLoading?l.row:void 0):this.parent.groupModule.groupedRowReorder(h,e)}else!this.parent.groupSettings.enableLazyLoading&&this.parent.aggregates.length&&(this.parent.enableInfiniteScrolling||this.parent.enableVirtualization||this.parent.allowPaging&&this.parent.groupSettings.disablePageWiseAggregates)?this.parent.notify(bt,{requestType:"refresh-aggregate-on-save",action:"update"}):this.parent.aggregates.length&&this.parent.aggregateModule.refresh(l.data,this.parent.groupSettings.enableLazyLoading?l.row:void 0);this.parent.trigger(c,l),(this.parent.isCheckBoxSelection||"Multiple"===this.parent.selectionSettings.type)&&(this.parent.isPersistSelection||this.parent.selectionSettings.checkboxOnly)||"Dialog"===this.parent.editSettings.mode||this.parent.selectRow(-1<this.rowIndex?this.rowIndex:this.editRowIndex),this.parent.notify(Er,{requestType:l.requestType,action:l.action}),this.parent.aggregates.length&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&(this.parent.groupModule.getGroupAggregateTemplates(!0).length||this.parent.groupModule.getGroupAggregateTemplates(!1).length)||(this.parent.removeMaskRow(),this.parent.hideSpinner())},Sf.prototype.closeForm=function(){!this.cloneRow&&this.parent.isEdit&&this.stopEditStatus(),this.cloneRow&&(this.cloneRow.remove(),this.cloneRow=null,this.originalRow.classList.remove("e-hiddenrow"))},Sf.prototype.blazorTemplate=function(){var e=this.parent.getColumns();this.parent.editSettings.template&&"Normal"===this.parent.editSettings.mode&&H.updateBlazorTemplate(this.parent.element.id+"editSettingsTemplate","Template",this.parent.editSettings);for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i.template&&H.updateBlazorTemplate(this.parent.element.id+i.uid,"Template",i,!1),i.editTemplate&&H.updateBlazorTemplate(this.parent.element.id+i.uid+"editTemplate","EditTemplate",i)}},Sf.prototype.editFailure=function(e){e.cancel||(this.parent.removeMaskRow(),this.parent.trigger(ae,{error:e}),this.parent.hideSpinner(),this.parent.log("actionfailure",{error:e}))},Sf.prototype.needRefresh=function(){var e=!0,t=this.parent.element.querySelector(".e-normaledit");return e=(this.parent.enableVirtualization||this.parent.enableDomVirtualization||this.parent.infiniteScrollSettings.enableCache)&&"Normal"===this.parent.editSettings.mode&&!t?!1:e},Sf.prototype.refreshRow=function(e){var t=new $s(this.serviceLocator,null,this.parent),i=this.parent.getRowObjectFromUID(this.uid);if(i){i.changes=e,this.parent.notify(An,{data:e}),Yp(i,this.parent.getForeignKeyColumns(),i.changes),this.needRefresh()&&(n=this.parent.getPrimaryKeyFieldNames()[0],r=void 0,i.index<this.parent.pinnedTopRowModels.length?(s=this.parent.getRowIndexByPrimaryKey(e),(s=this.parent.getRowByIndex(s))&&(r=this.parent.getRowObjectFromUID(s.getAttribute("data-uid")))):r=this.parent.getPinnedRowObjectByKey(e[""+n]),r&&(r.changes=e,Yp(r,this.parent.getForeignKeyColumns(),r.changes),t.refresh(r,this.parent.getColumns(),!0)),t.refresh(i,this.parent.getColumns(),!0));for(var n,r,s,o=[].slice.call(this.parent.element.querySelectorAll('[aria-rowindex="'+(i.index+1)+'"]')),a=0;a<o.length;a++)if(Pc(o[parseInt(a.toString(),10)]),this.parent.enableColumnVirtualization&&o[parseInt(a.toString(),10)].querySelectorAll(".e-leftfreeze,.e-rightfreeze,.e-fixedfreeze").length)for(var l,h=this.parent.getColumns(),d=[].slice.call(o[parseInt(a.toString(),10)].querySelectorAll(".e-leftfreeze,.e-rightfreeze.e-fixedfreeze")),p=0;p<d.length;p++)d[parseInt(p.toString(),10)].classList.contains("e-leftfreeze")?d[parseInt(p.toString(),10)].style.left=h[parseInt(p.toString(),10)].valueX-this.parent.translateX+"px":d[parseInt(p.toString(),10)].classList.contains("e-rightfreeze")?(l=parseInt(d[parseInt(p.toString(),10)].getAttribute("aria-colindex"),10)-1,d[parseInt(p.toString(),10)].style.right=h[parseInt(l.toString(),10)].valueX+this.parent.translateX+"px"):(d[parseInt(p.toString(),10)].style.left=this.parent.leftrightColumnWidth("left")-this.parent.translateX+"px",d[parseInt(p.toString(),10)].style.right=this.parent.leftrightColumnWidth("right")+this.parent.translateX+"px")}},Sf.prototype.closeEdit=function(){var i,n,r=this;!this.parent.isEdit||this.parent.editSettings.showAddNewRow&&this.parent.element.querySelector(".e-addedrow")&&H.isNullOrUndefined(this.parent.element.querySelector("."+Os))?this.parent.editSettings.showAddNewRow&&(this.disabledShowAddRow(!0,!0),this.parent.notify(Yr,{})):(i=this.parent,n=H.extend(this.args,{requestType:"cancel",type:y,cancel:!1,data:this.previousData,selectedRow:i.selectedRowIndex}),i.notify(En,n),this.blazorTemplate(),i.trigger(y,n,function(e){var t;e.cancel||(r.parent.notify(Jr,n),"Dialog"===r.parent.editSettings.mode&&r.parent.notify(ui,{}),e.type=c,r.parent.editSettings.showAddNewRow||(i.isEdit=!1),"Dialog"!==i.editSettings.mode&&r.refreshRow(e.data),r.stopEditStatus(),i.isEdit=!1,i.editSettings.showAddNewRow&&(r.disabledShowAddRow(!0),i.editModule.applyFormValidation(),i.isEdit=!0),t=i.groupSettings.enableLazyLoading&&i.groupSettings.columns.length&&!i.getContentTable().querySelector("tr.e-emptyrow"),i.getContentTable().querySelector("tr.e-emptyrow")||i.getContentTable().querySelector("tr.e-row")||t||i.renderModule.emptyRow(),"Dialog"!==i.editSettings.mode&&i.selectRow(r.rowIndex),i.trigger(c,e))}))},Sf.prototype.addRecord=function(e,t){var i=this,n=this.parent;if(this.addedRowIndex=t=H.isNullOrUndefined(t)?0:t,e)this.registerPendingRecord("add",e,t),n.notify(bt,{requestType:"save",type:y,data:e,selectedRow:0,action:"add",index:t});else if(!n.isEdit){this.previousData={},this.uid="";var r=n.getColumns(),s={virtualData:{},isScroll:!1};n.editSettings.showAddNewRow||this.parent.notify(kn,s);for(var o=0;o<r.length;o++)s.isScroll||r[parseInt(o.toString(),10)].field&&("string"===r[parseInt(o.toString(),10)].type&&(r[parseInt(o.toString(),10)].defaultValue=this.parent.sanitize(r[parseInt(o.toString(),10)].defaultValue)),V.DataUtil.setValue(r[parseInt(o.toString(),10)].field,r[parseInt(o.toString(),10)].defaultValue,this.previousData));e={cancel:!1,foreignKeyData:{},requestType:"add",data:this.previousData,type:y,index:t,rowData:this.previousData,target:void 0,isScroll:s.isScroll};(this.parent.enableVirtualization||this.parent.enableColumnVirtualization||this.parent.infiniteScrollSettings.enableCache)&&Object.keys(s.virtualData).length&&(e.data=e.rowData=s.virtualData),e.isScroll||(this.parent.notify(kr,{uid:this.uid,prevData:this.previousData,argsCreator:this.getEditArgs.bind(this),renderer:this.renderer}),n.editSettings.showAddNewRow)?this.inlineAddHandler(e):n.trigger(y,e,function(e){e.cancel||i.inlineAddHandler(e)})}},Sf.prototype.inlineAddHandler=function(e){var t,i=this.parent;i.isEdit=!0,"Dialog"!==i.editSettings.mode&&i.clearSelection(),this.renderer.addNew(e),this.parent.isEdit&&!this.parent.isPersistSelection&&"Dialog"!==this.parent.editSettings.mode&&(t=this.parent.getHeaderContent().querySelector(".e-checkselectall"))&&t.parentElement.classList.add("e-checkbox-disabled"),i.editModule.applyFormValidation(),e.type=c,e.row=i.element.querySelector("."+As),i.editSettings.showAddNewRow||i.trigger(c,e),i.editSettings.template&&i.editModule.applyFormValidation(void 0,e.form.ej2_instances[0].rules),this.args=e},Sf.prototype.deleteRecord=function(n,r){this.editRowIndex=this.parent.selectedRowIndex;var s=this.parent;if(r){r=r instanceof Array?r:[r];for(var e=Object.keys(r).length,t=(n=n||this.parent.getPrimaryKeyFieldNames()[0],0);t<e;t++)!function(t){var i,e=s.currentViewData.some(function(e){return i=e,r[parseInt(t.toString(),10)]===N(n,e)||r[parseInt(t.toString(),10)]===e});r[parseInt(t.toString(),10)]=e?i:H.isNullOrUndefined(r[parseInt(t.toString(),10)][""+n])?((e={})[n]=r[parseInt(t.toString(),10)],e):r[parseInt(t.toString(),10)]}(t)}for(var i=this.parent.getSelectedRecords(),i=("Cell"===this.parent.selectionSettings.mode&&"Cell"===this.parent.editSettings.mode&&(i=this.parent.getSelectedCellRecords()),{requestType:"delete",type:y,foreignKeyData:{},data:r||i,tr:this.parent.getSelectedRows(),cancel:!1}),o=(H.isNullOrUndefined(this.parent.commandDelIndex)||(i.data[0]=this.parent.getRowObjectFromUID(this.parent.getRowByIndex(this.parent.commandDelIndex).getAttribute("data-uid")).data),i.data),a=this.parent.getPrimaryKeyFieldNames()[0],t=0;t<o.length;t++){var l=o[parseInt(t.toString(),10)],h=s.currentViewData.indexOf(l);this.registerPendingRecord("delete",l,h)}if(this.parent.pinnedTopRecords.length&&o.length)for(var d=this,p=0,c=o;p<c.length;p++)!function(t){var e=d.parent.pinnedTopRecords.findIndex(function(e){return e[""+a]===t[""+a]});-1!==e&&d.parent.pinnedTopRowKeys[t[""+a]]&&(d.parent.pinnedTopRecords.splice(e,1),d.parent.pinnedTopRowKeys[t[""+a]]=!1)}(c[p]);this.parent.notify(bt,i)},Sf.prototype.stopEditStatus=function(){for(var e=this.parent,t=[].slice.call(e.editSettings.showAddNewRow?[]:e.element.getElementsByClassName(As)),i=[].slice.call(e.element.getElementsByClassName(Os)),n=0;n<t.length;n++)H.remove(t[parseInt(n.toString(),10)]);for(n=0;n<i.length;n++)i[parseInt(n.toString(),10)].classList.remove(Os)},Sf.prototype.addEventListener=function(){this.parent.isDestroyed||"Cell"!==this.parent.editSettings.mode&&(this.evtHandlers=[{event:gi,handler:this.editHandler},{event:yi,handler:this.dblClickHandler},{event:_t,handler:this.clickHandler},{event:Xi,handler:this.requestSuccess},{event:ni,handler:this.dblClickHandler},{event:di,handler:this.editComplete},{event:hi,handler:this.editComplete},{event:wr,handler:this.closeEdit},{event:Tr,handler:this.closeForm},{event:pi,handler:this.editComplete}],Kc(this.parent,this.evtHandlers,!0,this))},Sf.prototype.removeEventListener=function(){this.parent.isDestroyed||Kc(this.parent,this.evtHandlers,!1)},Sf.prototype.destroy=function(){this.removeEventListener(),this.renderer.destroy()};var vf=Sf;function Sf(e,t,i){this.args={},this.currentVirtualData={},this.parent=e,this.renderer=i,this.serviceLocator=t,this.addEventListener()}Cf=function(e,t){return(Cf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Cf(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(If,wf=vf),If.prototype.closeEdit=function(){wf.prototype.closeEdit.call(this)},If.prototype.addRecord=function(e,t){wf.prototype.addRecord.call(this,e,t)},If.prototype.endEdit=function(){wf.prototype.endEdit.call(this)},If.prototype.updateRow=function(e,t){wf.prototype.updateRow.call(this,e,t)},If.prototype.deleteRecord=function(e,t){wf.prototype.deleteRecord.call(this,e,t)},If.prototype.startEdit=function(e){wf.prototype.startEdit.call(this,e)};var Cf,wf,bf=If;function If(e,t,i){var n=wf.call(this,e,t)||this;return n.parent=e,n.serviceLocator=t,n.renderer=i,n}S.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:_t,handler:this.clickHandler},{event:ni,handler:this.dblClickHandler},{event:Vt,handler:this.onBeforeCellFocused},{event:jt,handler:this.onCellFocused},{event:yi,handler:this.dblClickHandler},{event:Gt,handler:this.keyDownHandler},{event:$i,handler:this.editNextValCell},{event:s,handler:this.destroy}],Kc(this.parent,this.evtHandlers,!0,this),H.EventHandler.add(this.parent.element,"mousedown",this.mouseDownHandler,this),this.dataBoundFunction=this.dataBound.bind(this),this.batchCancelFunction=this.batchCancel.bind(this),this.parent.addEventListener(de,this.dataBoundFunction),this.parent.addEventListener(qe,this.batchCancelFunction))},S.prototype.removeEventListener=function(){this.parent.isDestroyed||(Kc(this.parent,this.evtHandlers,!1),H.EventHandler.remove(this.parent.element,"mousedown",this.mouseDownHandler),this.parent.removeEventListener(de,this.dataBoundFunction),this.parent.removeEventListener(qe,this.batchCancelFunction))},S.prototype.batchCancel=function(){this.clearStacks(),this.parent.focusModule.restoreFocus({requestType:"batchCancel"})},S.prototype.dataBound=function(){this.parent.notify(ri,{})},S.prototype.destroy=function(){this.removeEventListener()},S.prototype.pushToStack=function(e,t){e.push(t),e.length>this.parent.editSettings.undoRedoLimit&&e.shift()},S.prototype.clearStacks=function(){this.undoStack=[],this.redoStack=[],this.storedRowUids.clear()},S.prototype.restoreCellSelection=function(e){var t=this.parent,i=(t.clearSelection(),t.getColumnIndexByField(e.field));t.selectionModule.selectCell({rowIndex:e.rowIndex,cellIndex:i})},S.prototype.storeDeleteAction=function(e){if(this.parent.editSettings.enableUndoRedo&&e){var t,i=this.parent,n=[],r=e.row.length;if(Array.isArray(e.row)&&r)for(var s=0;s<r;s++){var o,a=e.row[parseInt(s.toString(),10)],l=a.getAttribute("data-uid");!a.classList.contains("e-insertedrow")&&(o=a.rowIndex,a=i.getRowObjectFromUID(l))&&n.push({rowUid:l,rowIndex:o,rowData:a.data})}else e.row&&(t=e.row.getAttribute("data-uid"),t=i.getRowObjectFromUID(t))&&(o=e.row.rowIndex,n.push({rowUid:t.uid,rowIndex:o,rowData:t.data}));0<n.length&&(this.pushToStack(this.undoStack,{type:"row-delete",deletedRows:n}),this.redoStack=[])}},S.prototype.storeCellsInUndoStack=function(e){if(this.parent.editSettings.enableUndoRedo&&!e.action){var t=this.parent,i=e.cell.parentElement.getAttribute("data-uid"),t=t.getRowObjectFromUID(i),i=t.index;if(t){if("add"===t.edit){var n,r=t.changes;if(this.storedRowUids.has(t.uid))return void((n=this.undoStack[this.undoStack.length-1])&&"row-add"===n.type&&n.rowUid===t.uid&&(n.rowData=r));this.storedRowUids.add(t.uid),n={type:"row-add",rowUid:t.uid,rowIndex:i,rowData:r}}else(H.isNullOrUndefined(e.previousValue)||H.isNullOrUndefined(e.value)?e.previousValue!==e.value:e.previousValue.toString()!==e.value.toString())&&(n={type:"cell-edit",rowUid:t.uid,rowIndex:i,field:e.columnName,previousValue:e.previousValue,newValue:e.value});n&&(this.pushToStack(this.undoStack,n),this.redoStack=[])}}},S.prototype.undoBatchEdit=function(){var e;this.parent.editSettings.enableUndoRedo&&0!==this.undoStack.length&&(e=this.undoStack.pop())&&(this.isUndoAction=!0,this.parent.clearSelection(),this.parent.focusModule.clearIndicator(),this.undoAction(e),0<this.parent.aggregates.length&&(this.parent.isReact||this.parent.isVue||this.parent.notify(Nt,{}),0<this.parent.groupSettings.columns.length&&this.parent.notify(Lt,{}),this.parent.isReact||this.parent.isVue)&&this.parent.notify(Nt,{}),this.parent.trigger(We,{cancel:!1,action:"undo"}),this.pushToStack(this.redoStack,e),this.parent.notify(ri,{}),this.isUndoAction=!1)},S.prototype.redoBatchEdit=function(){var e;this.parent.editSettings.enableUndoRedo&&0!==this.redoStack.length&&(e=this.redoStack.pop())&&(this.isRedoAction=!0,this.redoAction(e),0<this.parent.aggregates.length&&(this.parent.isReact||this.parent.isVue||this.parent.notify(Nt,{}),0<this.parent.groupSettings.columns.length&&this.parent.notify(Lt,{}),this.parent.isReact||this.parent.isVue)&&this.parent.notify(Nt,{}),this.parent.trigger(We,{cancel:!1,action:"redo"}),this.pushToStack(this.undoStack,e),this.parent.notify(ri,{}),this.isRedoAction=!1)},S.prototype.restoreCellState=function(e,t,i){var n=this.parent,e=n.getRowObjectFromUID(e),r=N(t,e.changes),i=i instanceof Date&&r instanceof Date?new Date(i).toString()===new Date(r).toString():i===r;e&&e.changes&&r&&i&&(r=n.getColumnByField(t),t=n.getColumnIndexByField(t),r)&&0<=t&&(r=n.isSpan?Bc(n,e.index,t):Uc(this.parent,0,e.index,t))&&i&&r.classList.remove("e-updatedtd")},S.prototype.autoFill=function(e){if(e&&e.cells)for(var t=0,i=e.cells;t<i.length;t++){var n=i[t],r=this.isUndoAction?n.previousValue:n.newValue;this.updateCell(n.rowIndex,n.field,r),this.restoreCellState(n.rowUid,n.field,n.previousValue),this.restoreCellSelection(n)}},S.prototype.undoAction=function(e){var t,i=this.parent;switch(e.type){case"auto-fill":e.cells&&this.autoFill(e);break;case"cell-edit":case"paste":e.field&&(this.updateCell(e.rowIndex,e.field,e.previousValue),this.restoreCellState(e.rowUid,e.field,e.previousValue),this.restoreCellSelection(e));break;case"row-add":e.rowUid&&(this.storedRowUids.delete(e.rowUid),t=i.getRowByIndex(e.rowIndex))&&i.deleteRow(t);break;case"row-delete":e.deletedRows&&this.restoreDeletedRows(e.deletedRows)}},S.prototype.redoAction=function(e){var t=this.parent;switch(e.type){case"auto-fill":e.cells&&this.autoFill(e);break;case"cell-edit":case"paste":e.field&&(this.updateCell(e.rowIndex,e.field,e.newValue),this.restoreCellSelection(e));break;case"row-add":e.rowData&&t.addRecord(e.rowData);break;case"row-delete":if(e.deletedRows)for(var i=e.deletedRows,n=i.length-1;0<=n;n--)t.deleteRecord(void 0,i[parseInt(n.toString(),10)].rowData)}},S.prototype.isUndoStackAvailable=function(){return this.parent.editSettings.enableUndoRedo&&0<this.undoStack.length},S.prototype.isRedoStackAvailable=function(){return this.parent.editSettings.enableUndoRedo&&0<this.redoStack.length},S.prototype.mouseDownHandler=function(e){H.isNullOrUndefined(this.parent.element.querySelector(".e-gridform"))?this.mouseDownElement=void 0:this.mouseDownElement=e.target},S.prototype.clickHandler=function(e){I(e.target,this.parent.element.id+"_add",!0)||((this.parent.isEdit&&H.closest(this.form,"td")!==H.closest(e.target,"td")&&H.isNullOrUndefined(this.mouseDownElement)||this.mouseDownElement===e.target)&&(this.saveCell(),this.editNextValCell()),I(e.target,b)&&!this.parent.isEdit&&this.setCellIdx(e.target))},S.prototype.dblClickHandler=function(e){var t=I(e.target,b),e=I(e.target,Ts),e=e&&parseInt(e.getAttribute(D),10)-1,i=t&&parseInt(t.getAttribute(zs),10)-1;H.isNullOrUndefined(t)||H.isNullOrUndefined(e)||isNaN(i)||t.parentElement.classList.contains(Os)||!this.parent.getColumns()[parseInt(i.toString(),10)].allowEditing||this.editCell(e,this.parent.getColumns()[parseInt(i.toString(),10)].field,this.isAddRow(e))},S.prototype.onBeforeCellFocused=function(e){this.parent.isEdit&&this.validateFormObj()&&(e.byClick||-1<["tab","shiftTab","enter","shiftEnter"].indexOf(e.keyArgs.action))&&(e.cancel=!0,(e.byClick?e.clickArgs:e.keyArgs).preventDefault())},S.prototype.onCellFocused=function(e){var t=!(e.container.isContent&&e.container.isDataCell||(this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&e.container.isHeader);if(this.parent.focusModule.active&&(this.prevEditedBatchCell=this.parent.focusModule.active.matrix.current.toString()===this.prevEditedBatchCellMatrix().toString(),this.crtRowIndex=[].slice.call(this.parent.focusModule.active.getTable().rows).indexOf(H.closest(e.element,"tr"))),!e.byKey||t)this.parent.isEdit&&t&&this.saveCell();else{var t=e.container.indexes,i=t[0],n=t[1],t=e.element.getAttribute("aria-colindex")?parseInt(e.element.getAttribute("aria-colindex"),10)-1:n,r=(t!==n&&(n=t),this.parent.frozenRows&&e.container.isContent&&(i+=(this.parent.getContent().querySelector(".e-hiddenrow")?0:this.parent.frozenRows)+this.parent.getHeaderContent().querySelectorAll(".e-insertedrow").length),this.parent.isEdit);if(!this.parent.element.getElementsByClassName("e-popup-open").length){r=r&&!this.validateFormObj();switch("Cell"===this.parent.editSettings.mode&&this.parent.enableVirtualization&&(i=(t=e.element.parentElement)&&parseInt(t.getAttribute(D),10)-1),e.keyArgs.action){case"tab":case"shiftTab":var s=this.parent.getColumns()[parseInt(n.toString(),10)];s&&"Batch"===this.parent.editSettings.mode&&!this.parent.isEdit&&this.editCell(i,s.field),(r||this.parent.isLastCellPrimaryKey)&&this.editCellFromIndex(i,n);break;case"enter":case"shiftEnter":"Cell"===this.parent.editSettings.mode?r?(this.saveCell(),this.focus.focus(e)):this.editCellFromIndex(i,n):(e.keyArgs.preventDefault(),s={cancel:!1,keyArgs:e.keyArgs},this.parent.notify("beforeFocusCellEdit",s),!s.cancel&&r&&this.editCell(i,this.cellDetails.column.field));break;case"f2":this.editCellFromIndex(i,n),this.focus.focus()}}}},S.prototype.isAddRow=function(e){return this.parent.getDataRows()[parseInt(e.toString(),10)].classList.contains("e-insertedrow")},S.prototype.editCellFromIndex=function(e,t){this.cellDetails.rowIndex=e,this.cellDetails.cellIndex=t,"Cell"===this.parent.editSettings.mode?this.editCell(e,this.parent.getColumns()[parseInt(t.toString(),10)].field):this.editCell(e,this.parent.getColumns()[parseInt(t.toString(),10)].field,this.isAddRow(e))},S.prototype.closeEdit=function(){var e=this.parent,t=this.parent.getRowsObject(),i=(this.parent.pinnedTopRowModels.length&&(t=t.concat(this.parent.pinnedTopRowModels)),{cancel:!1,batchChanges:this.getBatchChanges()});if(e.notify(ln,i),!i.cancel){e.isEdit&&this.saveCell(!0),this.isAdded=!1;for(var i=[],n=(e.selectionModule&&(i=e.selectionModule.selectedRowIndexes),e.clearSelection(),!1),r=0;r<t.length;r++){var s=t[parseInt(r.toString(),10)].isDirty,o=t[parseInt(r.toString(),10)].edit;s&&"delete"===o&&(n=!0),(o=this.removeBatchElementChanges(t[parseInt(r.toString(),10)],s))&&t.splice(r,1),o&&r--}e.frozenRows&&n&&this.restoreFrozenRow(),e.getContentTable().querySelector("tr.e-row")||e.renderModule.renderEmptyRow();this.parent.getRowsObject();e.notify(qe,{rows:this.parent.getRowsObject().length?this.parent.getRowsObject():[new ds({isDataRow:!0,cells:[new cs({isDataCell:!0,visible:!0})]})]}),e.isCheckBoxSelection&&(e.selectionSettings.checkboxOnly||e.selectionSettings.persistSelection)?e.selectRows(i):e.selectRow(this.cellDetails.rowIndex),this.parent.editSettings.enableUndoRedo&&(e.isRedoStackAvailable()||e.isUndoStackAvailable())&&this.clearStacks(),this.refreshRowIdx(),e.notify(ri,{}),this.parent.notify(ai,{}),i={requestType:"batchCancel",rows:this.parent.getRowsObject()},e.trigger(qe,i)}},S.prototype.removeBatchElementChanges=function(e,t){var i=this.parent,n=new $s(this.serviceLocator,null,this.parent),r=!1;return t&&(e.isDirty=t,t=i.getRowElementByUID(e.uid))&&(t.classList.contains("e-insertedrow")?(H.remove(t),r=!0):(Yp(e,this.parent.getForeignKeyColumns(),e.data),delete e.changes,delete e.edit,e.isDirty=!1,H.classList(t,[],["e-hiddenrow","e-updatedtd"]),this.refreshRowIdx(),n.refresh(e,i.getColumns(),!1)),0<this.parent.aggregates.length)&&((t=[]).type="cancel",this.parent.notify(Nt,t),0<this.parent.groupSettings.columns.length)&&this.parent.notify(Lt,t),r},S.prototype.restoreFrozenRow=function(){var e=this.parent;if(e.frozenRows){var t=e.getHeaderTable().querySelector(j),i=e.getContentTable().querySelector(j),t=[].slice.call(t.querySelectorAll("tr.e-row:not(.e-hiddenrow)"));if(t.length>e.frozenRows)for(var n=0,r=t.slice(e.frozenRows);n<r.length;n++){var s=r[n];i.insertBefore(s,i.firstChild)}}},S.prototype.deleteRecord=function(e,t){this.saveCell(),this.validateFormObj()&&this.saveCell(!0),this.isAdded=!1,this.bulkDelete(e,t),0<this.parent.aggregates.length&&(this.parent.isReact||this.parent.isVue||this.parent.notify(Nt,{}),0<this.parent.groupSettings.columns.length&&this.parent.notify(Lt,{}),this.parent.isReact||this.parent.isVue)&&this.parent.notify(Nt,{})},S.prototype.addRecord=function(e){this.bulkAddRow(e)},S.prototype.restoreDeletedRows=function(e){if(e){for(var t=this.parent,i=e,n=i.length-1;0<=n;n--){var r=t.getRowElementByUID(i[parseInt(n.toString(),10)].rowUid),s=r.getAttribute("data-uid"),s=t.getRowObjectFromUID(s);s&&"delete"===s.edit&&(H.classList(r,[],["e-hiddenrow","e-updatedtd"]),delete s.edit,s.isDirty=!1)}this.refreshRowIdx(),t.focusModule.restoreFocus({requestType:"batchDelete"}),t.notify(Ue,{rows:this.parent.getRowsObject()}),t.notify(ri,{}),this.parent.notify(ai,{})}},S.prototype.endEdit=function(){this.parent.isEdit&&this.validateFormObj()||this.batchSave()},S.prototype.validateFormObj=function(){return this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate()},S.prototype.batchSave=function(){var e,t,i,n=this,r=this.parent,s="deletedRecords";r.isCheckBoxSelection&&(e=r.element.querySelector(".e-checkselectall").parentElement).classList.contains("e-checkbox-disabled")&&r.pageSettings.totalRecordsCount>r.currentViewData.length&&H.removeClass([e],["e-checkbox-disabled"]),this.saveCell(),r.isEdit||this.editNextValCell()||r.isEdit||(t=this.getBatchChanges(),"Multiple"===this.parent.selectionSettings.type&&t[s].length&&this.parent.selectionSettings.persistSelection&&(t[s]=this.removeSelectedData,this.removeSelectedData=[]),i={changedRecords:this.parent.getRowsObject().filter(function(e){return e.isDirty&&-1===["add","delete"].indexOf(e.edit)}).map(function(e){return e.data})},r.trigger(je,{batchChanges:t,cancel:!1},function(e){e.cancel||(n.registerPendingBatchTransaction(),n.clearStacks(),r.showSpinner(),r.notify(si,{changes:t,original:i}))}))},S.prototype.registerPendingBatchTransaction=function(){var e=this.parent.editModule&&this.parent.editModule.undoRedoModule;if(this.parent.editSettings.enableUndoRedo&&this.parent.editSettings.enableBatchUndoRedo&&e&&e.setPendingBatchTransaction){var t=this.parent,i=t.getPrimaryKeyFieldNames()[0];if(i){for(var n=[],r=[],s=[],o=[],a=t.getRowsObject(),l=0;l<a.length;l++){var h,d,p=a[parseInt(l.toString(),10)];p.isDirty&&(d=N(i,h="add"===p.edit&&p.changes||p.data),H.isNullOrUndefined(d)||(h="add"===p.edit?h:"delete"===p.edit?void 0:H.extend({},p.data,p.changes),d={primaryKey:i,keyValue:d,previousRecord:"add"===p.edit?void 0:this.cloneCommittedRecord(p.data),newRecord:this.cloneCommittedRecord(h),rowIndex:p.index,changeType:"add"===p.edit?"added":"delete"===p.edit?"deleted":"changed"},o.push(d),("add"===p.edit?r:"delete"===p.edit?(d.newRecord=void 0,s):n).push(d)))}(n.length||r.length||s.length)&&e.setPendingBatchTransaction({type:"batch-transaction",primaryKey:i,keyValue:void 0,rowIndex:-1,previousRecord:void 0,newRecord:void 0,changedRecords:n,addedRecords:r,deletedRecords:s,records:o,sequence:0})}}},S.prototype.cloneCommittedRecord=function(e){var t;return H.isNullOrUndefined(e)?e:(t=this.parent.editModule&&this.parent.editModule.undoRedoModule)&&t.cloneRecord?t.cloneRecord(e):H.extend({},{},e,!0)},S.prototype.getBatchChanges=function(){for(var e={addedRecords:[],deletedRecords:[],changedRecords:[]},t=this.parent.getRowsObject(),i=0,n=t=this.parent.pinnedTopRowModels.length?t.concat(this.parent.pinnedTopRowModels):t;i<n.length;i++){var r=n[i];if(r.isDirty)switch(r.edit){case"add":e.addedRecords.push(r.changes);break;case"delete":e.deletedRecords.push(r.data);break;default:e.changedRecords.push(r.changes)}}return e},S.prototype.removeRowObjectFromUID=function(e){for(var t=this.parent.getRowsObject(),i=0,n=t.length;i<n&&t[parseInt(i.toString(),10)].uid!==e;i++);t.splice(i,1)},S.prototype.addRowObject=function(e){var t=this.parent,i="Top"===t.editSettings.newRowPosition,e=e.clone();i?t.getRowsObject().unshift(e):t.getRowsObject().push(e)},S.prototype.bulkDelete=function(e,l){var h=this,d=(this.removeSelectedData=[],this.parent),p=d.selectedRowIndex,c=d.getSelectedRows(),t=d.selectionModule.getSeletedCellDetails(),u=d.getSelectedCellRecords(),i={primaryKey:this.parent.getPrimaryKeyFieldNames(),rowIndex:p,rowData:l||d.getSelectedRecords(),cancel:!1};l?i.row=d.editModule.deleteRowUid?d.getRowElementByUID(d.editModule.deleteRowUid):d.getRows()[d.getCurrentViewRecords().indexOf(l)]:"Cell"===d.selectionSettings.mode||"Both"===d.selectionSettings.mode?(c=i.row=t.rowElements,i.rowData=u,i.rowIndex=p=t.rowIndexes[t.rowIndexes.length-1]):i.row=c,i.row&&d.trigger(Ve,i,function(e){if(!e.cancel){if(h.removeSelectedData=("Cell"===d.selectionSettings.mode||"Both"===d.selectionSettings.mode)&&0<u.length?u:d.getSelectedRecords(),d.clearSelection(),e.row=e.row||(l?d.getRows()[parseInt(p.toString(),10)]:c),1===c.length||l){Array.isArray(e.row)&&(e.row=e.row[0]);var t=e.row.getAttribute("data-uid"),t=l&&h.parent.editModule.deleteRowUid?h.parent.editModule.deleteRowUid:t;e.row.classList.contains("e-insertedrow")?(h.removeRowObjectFromUID(t),H.remove(e.row)):((t=d.getRowObjectFromUID(t)).isDirty=!0,t.edit="delete",H.classList(e.row,["e-hiddenrow","e-updatedtd"],[]),d.frozenRows&&p<d.frozenRows&&d.getDataRows().length>=d.frozenRows&&d.getHeaderTable().querySelector(j).appendChild(d.getRowByIndex(d.frozenRows-1))),!d.editSettings.enableUndoRedo||h.isRedoAction||h.isUndoAction||h.storeDeleteAction(e)}else{l&&(p=parseInt(e.row.getAttribute(D),10)-1);for(var i=0;i<c.length;i++){var n=c[parseInt(i.toString(),10)].getAttribute("data-uid");c[parseInt(i.toString(),10)].classList.contains("e-insertedrow")?(h.removeRowObjectFromUID(n),H.remove(c[parseInt(i.toString(),10)])):(H.classList(c[parseInt(i.toString(),10)],["e-hiddenrow","e-updatedtd"],[]),(n=d.getRowObjectFromUID(n)).isDirty=!0,n.edit="delete")}if(!d.editSettings.enableUndoRedo||h.isRedoAction||h.isUndoAction||h.storeDeleteAction(e),d.frozenRows)for(var r=d.getHeaderTable().querySelector(j),s=r?[].slice.call(r.querySelectorAll("tr.e-row:not(.e-hiddenrow)")):[],o=d.getDataRows();s.length<d.frozenRows&&o.length>s.length;){var a=0<s.length?d.getRowByIndex(d.frozenRows-1):d.getRowByIndex(0);if(!a)break;r.appendChild(a),s.push(a)}}delete e.row,h.refreshRowIdx(),l&&(d.editModule.deleteRowUid=void 0),d.isCheckBoxSelection||d.selectRow(p),d.trigger(Ue,e),d.notify(Ue,{rows:h.parent.getRowsObject()}),d.focusModule.restoreFocus({requestType:"batchDelete"}),d.notify(ri,{}),d.getContentTable().querySelector("tr.e-row")||d.renderModule.renderEmptyRow()}})},S.prototype.refreshRowIdx=function(){for(var e=this.parent,t=e.getAllDataRows(!0),i=e.getRowsObject().filter(function(e){return!e.isDetailRow}),n=0,r=0,s=t.length;n<s;n++)t[parseInt(n.toString(),10)].classList.contains(Ts)&&!t[parseInt(n.toString(),10)].classList.contains("e-hiddenrow")?(t[parseInt(n.toString(),10)].setAttribute(D,(r+1).toString()),i[parseInt(n.toString(),10)].index=r,r++):(t[parseInt(n.toString(),10)].removeAttribute(D),i[parseInt(n.toString(),10)].index=-1)},S.prototype.bulkAddRow=function(l){var h=this,d=this.parent;if(d.editSettings.allowAdding){if(d.isEdit&&(this.saveCell(),this.parent.notify($i,{})),!this.validateFormObj()){if(this.initialRender){for(var e,t=d.getVisibleColumns(),i=0;i<t.length;i++)t[parseInt(i.toString(),10)].validationRules&&t[parseInt(i.toString(),10)].validationRules.required&&(e={field:t[parseInt(i.toString(),10)].field.slice(),cellIdx:i},this.validationColObj.push(e));this.initialRender=!1}this.parent.element.classList.add("e-editing");var n={defaultData:l||this.getDefaultData(),primaryKey:d.getPrimaryKeyFieldNames(),cancel:!1};d.trigger(He,n,function(e){if(!e.cancel){h.isAdded=!0,d.clearSelection();var t,i,n=new $s(h.serviceLocator,null,h.parent),r=new Js(h.parent).generateRows([e.defaultData]),s=n.render(r[0],d.getColumns());Pc(s);for(var o=0;o<h.parent.groupSettings.columns.length;o++)s.insertBefore(h.parent.createElement("td",{className:"e-indentcell"}),s.firstChild),r[0].cells.unshift(new cs({cellType:oe.CellType.Indent}));var n=d.getContentTable().querySelector(j),a=(s.classList.add("e-insertedrow"),n.querySelector(".e-emptyrow")&&((a=n.querySelector(".e-emptyrow")).parentNode.removeChild(a),d.frozenRows)&&d.element.querySelector(".e-frozenrow-empty")&&d.element.querySelector(".e-frozenrow-empty").classList.remove("e-frozenrow-empty"),d.element.querySelector(".e-empty-row-sticky-content")),a=(a&&(a.parentElement.removeChild(a),a=d.element.querySelector(".e-content"))&&a.classList.remove("e-empty-overlay-mode"),n=(d.frozenRows&&"Top"===d.editSettings.newRowPosition?d.getHeaderTable():d.getContentTable()).querySelector(j),"Top"===h.parent.editSettings.newRowPosition?n.insertBefore(s,n.firstChild):n.appendChild(s),H.addClass([].slice.call(s.getElementsByClassName(b)),["e-updatedtd"]),r[0].isDirty=!0,r[0].changes=H.extend({},{},r[0].data,!0),r[0].edit="add",h.addRowObject(r[0]),h.refreshRowIdx(),h.focus.forgetPrevious(),d.notify(ze,{rows:h.parent.getRowsObject()}),h.getBatchChanges()),n=h.getBottomIndex(),n=("Top"===h.parent.editSettings.newRowPosition?d.selectRow(0):d.selectRow(n),l||(i=h.findNextEditableCell(0,!0),t=d.getColumns()[parseInt(i.toString(),10)],"Top"===h.parent.editSettings.newRowPosition?h.editCell(0,t.field,!0):h.editCell(n,t.field,!0)),0<h.parent.aggregates.length&&(l||a[ks].length)&&h.parent.notify(Nt,{}),{defaultData:e.defaultData,row:s,columnObject:t,columnIndex:i,primaryKey:e.primaryKey,cell:H.isNullOrUndefined(i)?void 0:s.cells[parseInt(i.toString(),10)]});d.trigger(ze,n)}})}}else d.isEdit&&this.saveCell()},S.prototype.findNextEditableCell=function(e,t,i){for(var n,r=this.parent.getColumns(),s=r.length,o=e;o<s;o++)if(n=!!i&&H.isNullOrUndefined(r[parseInt(o.toString(),10)].validationRules),t&&(!r[parseInt(o.toString(),10)].template||r[parseInt(o.toString(),10)].field)&&r[parseInt(o.toString(),10)].allowEditing&&r[parseInt(o.toString(),10)].visible&&(!r[parseInt(o.toString(),10)].isIdentity||!r[parseInt(o.toString(),10)].isPrimaryKey)&&!n)return o;return-1},S.prototype.getDefaultData=function(){for(var e={},t={number:0,string:null,boolean:!1,date:null,datetime:null,dateonly:null},i=0,n=this.parent.columnModel;i<n.length;i++){var r=n[i];r.field&&H.setValue(r.field,0<=Object.keys(r).indexOf("defaultValue")?r.defaultValue:t[r.type],e)}return e},S.prototype.setCellIdx=function(e){var t=0;this.parent.allowGrouping&&(t=this.parent.groupSettings.columns.length),this.cellDetails.cellIndex=e.cellIndex-t,this.cellDetails.rowIndex=parseInt(e.getAttribute("data-index"),10)},S.prototype.editCell=function(e,t,i){var n=this.parent,r=n.getColumnByField(t);this.index=e,this.field=t,this.isAdd=i;var s=(s=n.getDataRows()).filter(function(e){return"none"!==e.style.display&&!e.classList.contains("e-childrow-hidden")}),s=parseInt(s[s.length-1].getAttribute("aria-rowindex"),10)-1,s=n.isEdit&&!(this.cellDetails&&this.cellDetails.column&&this.cellDetails.column.field===t&&this.cellDetails.rowIndex===e&&s!==e&&this.prevEditedBatchCell);n.editSettings.allowEditing&&(!s&&(r.allowEditing||!r.allowEditing&&n.focusModule.active&&n.focusModule.active.getTable().rows[this.crtRowIndex]&&n.focusModule.active.getTable().rows[this.crtRowIndex].classList.contains("e-insertedrow"))?this.editCellExtend(e,t,i):s&&(this.editNext=!0,this.saveCell()))},S.prototype.editCellExtend=function(i,e,t){var n,r,s,o,a=this,l=this.parent,h=l.getColumnByField(e),e=l.getPrimaryKeyFieldNames();l.isEdit||(o=H.extend({},{},this.getDataByIndex(i),!0),n=l.getDataRows()[parseInt(i.toString(),10)],o=H.extend({},{},this.getDataByIndex(i),!0),e[0]===h.field&&!n.classList.contains("e-insertedrow")||h.columns||h.isPrimaryKey&&h.isIdentity||h.commands?this.parent.isLastCellPrimaryKey=!0:(this.parent.isLastCellPrimaryKey=!1,this.parent.element.classList.add("e-editing"),r=l.getRowObjectFromUID(n.getAttribute("data-uid")),s=[].slice.apply(n.cells),(e={columnName:h.field,isForeignKey:!H.isNullOrUndefined(h.foreignKeyValue),primaryKey:e,rowData:o,validationRules:H.extend({},h.validationRules||{}),value:N(h.field,o),type:t?"add":"edit",cancel:!1,foreignKeyData:r&&r.foreignKeyData}).cell=s[this.getColIndex(s,this.getCellIdx(h.uid))],e.row=n,e.columnObject=h,e.cell&&l.trigger(_e,e,function(e){var t;e.cancel||(e.cell=e.cell||s[a.getColIndex(s,a.getCellIdx(h.uid))],e.row=e.row||n,e.columnObject=e.columnObject||h,a.cellDetails={rowData:o,column:h,value:e.value,isForeignKey:e.isForeignKey,rowIndex:i,cellIndex:parseInt(e.cell.getAttribute(zs),10)-1,foreignKeyData:e.foreignKeyData},e.cell.classList.contains("e-updatedtd")&&(a.isColored=!0,e.cell.classList.remove("e-updatedtd")),l.isEdit=!0,t=!H.isNullOrUndefined(e.row.querySelector(".e-selectionbackground")),l.clearSelection(),l.isCheckBoxSelection&&l.isPersistSelection||!t&&l.selectionSettings.checkboxOnly||l.selectRow(a.cellDetails.rowIndex,!0),a.renderer.update(e),a.parent.notify(hn,e),a.form=H.select("#"+l.element.id+"EditForm",l.element),a.args=e,l.editModule.applyFormValidation([h]),a.parent.element.querySelector(".e-gridpopup").style.display="none")})))},S.prototype.updateCell=function(e,t,i){var n,r,s,o,a=this.parent,l=a.getColumnByField(t),h=a.getColumnIndexByField(t),d=a.getRowByIndex(e).classList.contains("e-insertedrow")&&a.getRowByIndex(e).classList.contains("e-batchrow");l&&(!l.isPrimaryKey||d)&&l.allowEditing&&(n=this.parent.isSpan?Bc(a,e,h):Uc(this.parent,0,e,h),!this.parent.isSpan||n)&&(r=a.getRowObjectFromUID(n.parentElement.getAttribute("data-uid")),a.isEdit||!r.changes&&(!(i instanceof Date)&&r.data[""+t]!==i||i instanceof Date&&new Date(r.data[""+t]).toString()!==new Date(i).toString())||r.changes&&(!(i instanceof Date)&&r.changes[""+t]!==i||i instanceof Date&&new Date(r.changes[""+t]).toString()!==new Date(i).toString()))&&(this.refreshTD(n,l,r,i),d=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,(this.parent.isReact&&this.parent.requireTemplateRef||d&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&l.template?(o=(s=this).newReactTd,s.parent.renderTemplates(function(){s.parent.trigger(re,{cell:o||n,column:l,data:r.changes})})):((this.parent.isReact||d)&&l.template&&this.parent.renderTemplates(),this.parent.trigger(re,{cell:this.newReactTd||n,column:l,data:r.changes})))},S.prototype.setChanges=function(e,t,i){var n;e.changes||(e.changes=H.extend({},{},e.data,!0)),H.isNullOrUndefined(t)||("string"==typeof i&&(i=this.parent.sanitize(i)),V.DataUtil.setValue(t,i,e.changes)),e.data[""+t]!==i&&("date"!==(n=this.parent.getColumnByField(t).type)&&"datetime"!==n||new Date(e.data[""+t]).toString()!==new Date(i).toString())&&(e.isDirty=!0)},S.prototype.updateRow=function(e,t){for(var i=0,n=Object.keys(t);i<n.length;i++){var r=n[i];this.updateCell(e,r,t[""+r])}},S.prototype.getCellIdx=function(e){e=this.parent.getColumnIndexByUid(e)+this.parent.groupSettings.columns.length;return H.isNullOrUndefined(this.parent.detailTemplate)&&H.isNullOrUndefined(this.parent.childGrid)||e++,this.parent.isRowDragable()&&e++,e},S.prototype.refreshTD=function(e,t,i,n){var r,s,o=new vo(this.parent,this.serviceLocator),n=(n="number"!==t.type||H.isNullOrUndefined(n)||"Cell"===this.parent.editSettings.mode&&t.allowFormula?n:parseFloat(n),i&&(this.setChanges(i,t.field,n),Yp(i,this.parent.getForeignKeyColumns(),i.changes)),i?i.cells:void 0);this.parent.isReact&&(r=e.parentElement,s=e.cellIndex);i&&o.refreshTD(e,n[+this.getCellIdx(t.uid)],i.changes,{index:this.getCellIdx(t.uid)}),"Batch"===this.parent.editSettings.mode&&((this.parent.isReact?(this.newReactTd=r.cells[parseInt(s.toString(),10)],r.cells[parseInt(s.toString(),10)]):e).classList.add("e-updatedtd"),e.classList.add("e-updatedtd")),this.parent.notify(ri,{})},S.prototype.getColIndex=function(e,t){var i=0;this.parent.allowGrouping&&this.parent.groupSettings.columns&&(i=this.parent.groupSettings.columns.length),H.isNullOrUndefined(this.parent.detailTemplate)&&H.isNullOrUndefined(this.parent.childGrid)||i++,this.parent.isRowDragable()&&i++;for(var n=0;n<e.length;n++)if(parseInt(e[parseInt(n.toString(),10)].getAttribute(zs),10)-1==t-i)return n;return-1},S.prototype.editNextValCell=function(){var e=this.parent,t=e.element.querySelectorAll(".e-insertedrow"),i=1===t.length;if(i&&this.isAdded&&!e.isEdit){for(var n=this.getBottomIndex(),r=this.cellDetails.cellIndex;r<e.getColumns().length;r++){if(e.isEdit)return;var s,o=this.findNextEditableCell(this.cellDetails.cellIndex+1,!0,!0),o=e.getColumns()[parseInt(o.toString(),10)];o&&("Bottom"===this.parent.editSettings.newRowPosition?this.editCell(n,o.field,!0):(this.parent.notify(dr,s={index:0,column:o}),this.editCell(s.index,o.field,!0)),this.saveCell())}e.isEdit||(this.isAdded=!1)}else if(!i&&this.isAdded&&!e.isEdit){for(r=0;r<t.length&&!e.isEdit;r++)for(var a=0;a<this.validationColObj.length&&!e.isEdit;a++){var l=t[parseInt(r.toString(),10)],l=e.getRowObjectFromUID(l.getAttribute("data-uid")),h=this.validationColObj[parseInt(a.toString(),10)].field,h=l&&l.changes?N(h,l.changes):null;(H.isNullOrUndefined(h)||""===h)&&(this.editCell(parseInt(t[parseInt(r.toString(),10)].getAttribute("aria-rowindex"),10)-1,this.validationColObj[parseInt(a.toString(),10)].field),this.validateFormObj())&&this.saveCell()}e.isEdit||(this.isAdded=!1)}},S.prototype.escapeCellEdit=function(){var e=this.generateCellArgs();e.value=e.previousValue,!e.value&&this.cellDetails.column.validationRules||this.successCallBack(e,e.cell.parentElement,e.column,!0)(e)},S.prototype.generateCellArgs=function(){var e=this.parent,t=(this.parent.element.classList.remove("e-editing"),this.cellDetails.column),i={},e=(i[t.field]=N(t.field,this.cellDetails.rowData),e.editModule.getCurrentEditedData(this.form,i)),i=H.extend({},e),e=H.extend({},e,this.cellDetails.rowData),i=N(t.field,i),i=(H.isNullOrUndefined(t.field)||H.isUndefined(i)||H.setValue(t.field,i,e),{columnName:t.field,value:N(t.field,e),rowData:this.cellDetails.rowData,column:t,previousValue:this.cellDetails.value,isForeignKey:this.cellDetails.isForeignKey,cancel:!1});return i.cell=this.form.parentElement,i.columnObject=t,i},S.prototype.saveCell=function(e){var t,i,n,r;!this.preventSaveCell&&this.form&&(t=this.parent,e||t.isEdit&&!this.validateFormObj())&&(this.preventSaveCell=!0,(i=this.generateCellArgs()).cell?(n=i.cell.parentElement,r=i.column,i.cell.removeAttribute("aria-label"),e?this.successCallBack(i,n,r)(i):(t.trigger(Ke,i,this.successCallBack(i,n,r)),t.notify(on,{formObj:this.form}))):this.preventSaveCell=!1)},S.prototype.successCallBack=function(e,r,s,o){var a=this;return function(e){var t=a.parent;if(e.cell=e.cell||a.form.parentElement,e.columnObject=e.columnObject||s,e.cancel){if(a.preventSaveCell=!1,a.editNext){if(a.editNext=!1,a.cellDetails.rowIndex===a.index&&a.cellDetails.column.field===a.field)return;a.editCellExtend(a.index,a.field,a.isAdd)}}else{t.editModule.destroyWidgets([s]),t.isEdit=!1,t.editModule.destroyForm(),a.parent.notify(ai,{});var i,n=t.getRowObjectFromUID(r.getAttribute("data-uid"));if(a.refreshTD(e.cell,s,n,e.value),a.parent.isReact&&(e.cell=a.newReactTd),H.removeClass([r],[Os,"e-batchrow"]),H.removeClass([e.cell],["e-editedbatchcell","e-boolcell"]),(!H.isNullOrUndefined(e.value)&&e.value.toString()===(H.isNullOrUndefined(a.cellDetails.value)?"":a.cellDetails.value).toString()&&!a.isColored||H.isNullOrUndefined(e.value)&&H.isNullOrUndefined(n.data[s.field])&&H.isNullOrUndefined(a.cellDetails.value)&&!e.cell.parentElement.classList.contains("e-insertedrow"))&&e.cell.classList.remove("e-updatedtd"),H.isNullOrUndefined(o)&&(n=t.isReact&&s.template&&"string"!=typeof s.template,i=t.parentDetails&&t.parentDetails.parentInstObj&&t.parentDetails.parentInstObj.isReact,n||i?t.requireTemplateRef?t.renderTemplates(function(){t.trigger(We,e),a.storeCellsInUndoStack(e)}):(t.renderTemplates(),t.trigger(We,e),a.storeCellsInUndoStack(e)):(t.trigger(We,e),a.storeCellsInUndoStack(e))),t.notify(ri,{}),a.isColored=!1,0<a.parent.aggregates.length&&(a.parent.isReact||a.parent.isVue||a.parent.notify(Nt,{}),0<a.parent.groupSettings.columns.length&&!a.isAddRow(a.cellDetails.rowIndex)&&a.parent.notify(Lt,{}),a.parent.isReact||a.parent.isVue)&&a.parent.notify(Nt,{}),a.preventSaveCell=!1,a.editNext){if(a.editNext=!1,a.cellDetails.rowIndex===a.index&&a.cellDetails.column.field===a.field&&a.prevEditedBatchCell)return;n=t.getColumnByField(a.field);n&&(n.allowEditing||!n.allowEditing&&t.focusModule.active&&t.focusModule.active.getTable().rows[a.crtRowIndex]&&t.focusModule.active.getTable().rows[a.crtRowIndex].classList.contains("e-insertedrow"))&&a.editCellExtend(a.index,a.field,a.isAdd)}o&&t.notify(wn,{})}}},S.prototype.prevEditedBatchCellMatrix=function(){var e,t=[],i=this.parent,i="Cell"===i.editSettings.mode?i.focusModule.active.getTable().querySelector(".e-editedcell"):i.focusModule.active.getTable().querySelector(".e-editedbatchcell");return i&&(e=i.parentElement,t=[[].slice.call(this.parent.focusModule.active.getTable().rows).indexOf(e),[].slice.call(e.cells).indexOf(i)]),t},S.prototype.getDataByIndex=function(e){e=(this.parent.enableVirtualization||this.parent.isRowDomVirtualization())&&"Cell"===this.parent.editSettings.mode?this.parent.getRowByIndex(e):this.parent.getDataRows()[parseInt(e.toString(),10)],e=this.parent.getRowObjectFromUID(e.getAttribute("data-uid"));return e?e.changes||e.data:null},S.prototype.keyDownHandler=function(e){if(this.parent.editSettings.enableUndoRedo&&e&&!this.parent.isEdit){var t=e.ctrlKey||e.metaKey;if(t&&"z"===e.key&&!e.shiftKey||"ctrlPlusZ"===e.action)return e.preventDefault(),void this.parent.undoEdit();if(t&&"y"===e.key&&!e.shiftKey||t&&"z"===e.key&&e.shiftKey||"ctrlPlusY"===e.action)return e.preventDefault(),void this.parent.redoEdit()}var i,n,r,s;(this.addBatchRow||("tab"===e.action||"shiftTab"===e.action)&&this.parent.isEdit)&&(t=this.parent,i=this.getBottomIndex(),r=I(e.target,b),this.addBatchRow||r&&!this.parent.isReact)&&(n=void 0,r&&(n=r.querySelector(".e-field")),this.addBatchRow||n)&&(r=this.parent.getVisibleColumns(),s="tab"===e.action?r.length-1:0,!this.addBatchRow&&r[parseInt(s.toString(),10)].field!==n.getAttribute("id").slice(this.parent.element.id.length)||(this.cellDetails.rowIndex===i&&"tab"===e.action?("Top"===t.editSettings.newRowPosition?(t.editSettings.newRowPosition="Bottom",this.addRecord(),t.editSettings.newRowPosition="Top"):this.addRecord(),this.addBatchRow=!1):this.saveCell()))},S.prototype.addCancelWhilePaging=function(){this.validateFormObj()&&(this.parent.notify(mi,{}),this.parent.isEdit=!1,this.editNext=!1,this.mouseDownElement=void 0,this.isColored=!1)},S.prototype.getBottomIndex=function(){var e=this.getBatchChanges();return this.parent.getCurrentViewRecords().length+e[ks].length-e[Ps].length-1};var Rf=S;function S(e,t,i){this.cellDetails={},this.args={},this.originalCell={},this.cloneCell={},this.editNext=!1,this.preventSaveCell=!1,this.initialRender=!0,this.validationColObj=[],this.addBatchRow=!1,this.prevEditedBatchCell=!1,this.undoStack=[],this.redoStack=[],this.storedRowUids=new Set,this.isUndoAction=!1,this.isRedoAction=!1,this.parent=e,this.serviceLocator=t,this.renderer=i,this.focus=t.getService("focus"),this.addEventListener()}xf=function(e,t){return(xf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}xf(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ef,Df=vf),Ef.prototype.closeEdit=function(){Df.prototype.closeEdit.call(this)},Ef.prototype.addRecord=function(e,t){Df.prototype.addRecord.call(this,e,t)},Ef.prototype.endEdit=function(){Df.prototype.endEdit.call(this)},Ef.prototype.updateRow=function(e,t){Df.prototype.updateRow.call(this,e,t)},Ef.prototype.deleteRecord=function(e,t){Df.prototype.deleteRecord.call(this,e,t)},Ef.prototype.startEdit=function(e){Df.prototype.startEdit.call(this,e)};var xf,Df,Tf=Ef;function Ef(e,t,i){var n=Df.call(this,e,t)||this;return n.parent=e,n.serviceLocator=t,n.renderer=i,n}Of=function(e,t){return(Of=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Of(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Mf,Af=tf),Mf.prototype.write=function(e){this.edit=this.parent.editModule,"datepickeredit"===e.column.editType&&(this.obj=new L.DatePicker(H.extend(kf(e,this.parent.editSettings.mode,this.parent.enableRtl,this.parent.cssClass,this),e.column.edit.params)),this.isMaskModuleInjected)&&(L.DatePicker.Inject(L.MaskedDateTime),this.isMaskModuleInjected=!1),"datetimepickeredit"===e.column.editType&&(this.obj=new L.DateTimePicker(H.extend(kf(e,this.parent.editSettings.mode,this.parent.enableRtl,this.parent.cssClass,this),e.column.edit.params))),this.obj.isAngular=Oc(this.parent),this.obj.appendTo(e.element)};var Of,Af,Ff=Mf;function Mf(e){e=Af.call(this,e)||this;return e.isMaskModuleInjected=!0,e}function kf(e,t,i,n,r){var t="Dialog"!==t,s=ic(e.column.format,e.column.type),o=N(e.column.field,e.rowData);return{floatLabelType:t?"Never":"Always",value:o?new Date(o):null,format:s,placeholder:t?"":e.column.headerText,enableRtl:i,enabled:Lp(e.column,e.requestType,e.element)&&Np(I(e.element,"e-rowcell"),r&&r.parent?r.parent:null),cssClass:n||null,close:function(e){e.event&&"escape"===e.event.action&&(this.edit.editCellDialogClose=!0)}.bind(r)}}Lf.prototype.read=function(e,t){return t},Lf.prototype.write=function(){},Lf.prototype.destroy=function(){};var Pf=Lf;function Lf(e){this.parent=e}Nf=function(e,t){return(Nf=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Nf(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(qf,Bf=Rf),qf.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:_t,handler:this.clickHandler},{event:ni,handler:this.dblClickHandler},{event:jt,handler:Bf.prototype.onCellFocused},{event:s,handler:this.destroy},{event:di,handler:this.editComplete},{event:hi,handler:this.editComplete},{event:Xi,handler:this.requestSuccess}],Kc(this.parent,this.evtHandlers,!0,this))},qf.prototype.removeEventListener=function(){this.parent.isDestroyed||Kc(this.parent,this.evtHandlers,!1)},qf.prototype.clickHandler=function(e){var t,i,e=e.target;I(e,this.parent.element.id+"_add",!0)||(I(e,vs)&&I(I(e,vs),"e-grid").id===this.parent.element.id||(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&I(e,Cs)&&!I(e,"e-columnheader"))&&!I(e,"e-unboundcelldiv")&&this.parent.isEdit&&(e=I(e,b),i=(t=this.parent.selectionSettings).cellSelectionMode,i=!!(this.cellDetails&&this.cellDetails.column&&this.cellDetails.column.allowFormula&&this.parent.enableAutoFill&&-1<i.indexOf("Box")&&"Cell"===t.mode&&"Multiple"===t.type),e&&i||this.endEdit())},qf.prototype.dblClickHandler=function(e){var t=I(e.target,b),e=I(e.target,Ts),e=e&&parseInt(e.getAttribute(D),10)-1,i=t&&parseInt(t.getAttribute(zs),10)-1;!this.parent.editSettings||!this.parent.editSettings.allowEditOnDblClick||H.isNullOrUndefined(t)||H.isNullOrUndefined(e)||isNaN(i)||t.parentElement.classList.contains(Os)||!this.parent.getColumns()[parseInt(i.toString(),10)].allowEditing||this.parent.isEdit&&this.cellDetails&&this.cellDetails.column&&this.cellDetails.column.allowFormula||this.editCell(e,this.parent.getColumns()[parseInt(i.toString(),10)].field)},qf.prototype.editCell=function(e,t){Bf.prototype.editCell.call(this,e,t)},qf.prototype.editCellExtend=function(i,e){var n,r,t,s,o,a=this,l=this.parent,h=l.getColumnByField(e),e=l.getPrimaryKeyFieldNames();l.isEdit||(n=H.extend({},{},this.getDataByIndex(i),!0),r=l.getRowByIndex(i),e[0]===h.field||h.columns||h.isPrimaryKey&&h.isIdentity||h.commands?this.parent.isLastCellPrimaryKey=!0:(this.parent.isLastCellPrimaryKey=!1,this.parent.element.classList.add("e-editing"),t=l.getRowObjectFromUID(r.getAttribute("data-uid")),s=[].slice.apply(r.cells),o=N(h.field,n),(e={columnName:h.field,isForeignKey:!H.isNullOrUndefined(h.foreignKeyValue),primaryKey:e,rowData:n,validationRules:H.extend({},h.validationRules||{}),value:o,requestType:"beginEdit",type:"edit",cancel:!1,foreignKeyData:t&&t.foreignKeyData}).cell=s[this.getColIndex(s,this.getCellIdx(h.uid))],e.row=r,e.columnObject=h,o=l.isTreeGrid?_e:y,l.trigger(o,e,function(e){var t;e.cancel||(e.cell=e.cell||s[a.getColIndex(s,a.getCellIdx(h.uid))],e.row=e.row||r,e.columnObject=e.columnObject||h,a.cellDetails={rowData:n,column:h,value:e.value,isForeignKey:e.isForeignKey,rowIndex:i,cellIndex:parseInt(e.cell.getAttribute(zs),10)-1,foreignKeyData:e.foreignKeyData},h.allowFormula&&Array.from(a.parent.getHeaderTable().querySelectorAll(".e-header-col-ref")).map(function(e){return e.classList.toggle("e-col-hidden",!h.allowFormula)}),l.isEdit=!0,t=!H.isNullOrUndefined(e.row.querySelector(".e-selectionbackground")),l.clearSelection(),l.isCheckBoxSelection&&l.isPersistSelection||!t&&l.selectionSettings.checkboxOnly||l.selectRow(a.cellDetails.rowIndex,!0),a.renderer.update(e),a.parent.notify(hn,e),a.form=H.select("#"+l.element.id+"EditForm",l.element),a.args=e,l.editModule.applyFormValidation([h]),a.parent.element.querySelector(".e-gridpopup").style.display="none",a.parent.notify(ri,{}),l.trigger(c,e))})))},qf.prototype.updateCell=function(t,i,n){var r=this,s=this.parent.getRowByIndex(t),e=H.extend({},{},this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)],!0),o={requestType:"save",action:"edit",type:y,cancel:!1,data:e,rowData:this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)],row:s};this.registerPendingRecord("edit",o.rowData,t),H.setValue(i,n,e),this.parent.trigger(y,o,function(e){e.cancel||(Bf.prototype.updateCell.call(r,t,i,n),(e=r.parent.getRowObjectFromUID(s.getAttribute("data-uid")))&&"changes"in e&&delete e.changes,r.parent.notify(li,o),r.parent.formulaModule&&r.parent.formulaSettings&&"Automatic"===r.parent.formulaSettings.calculationMode&&!r.parent.isFormulaRefreshSuspended&&r.parent.refreshFormulas(),o.type=c,r.parent.trigger(Ye,o),r.parent.trigger(c,o))})},qf.prototype.saveCell=function(){var a,e,l,h,t,d=this,p=this.parent;this.parent.isEdit&&this.validateFormObj()||(a=Bf.prototype.generateCellArgs.call(this),e=this.cellDetails.rowIndex,t=a.columnName,l=H.extend({},{},a.rowData,!0),h=H.extend({},{requestType:"save",type:y,data:l,rowData:a.rowData,cancel:!1,previousData:a.rowData,selectedRow:p.selectedRowIndex,action:"edit",cell:a.cell,columnName:t,foreignKeyData:{},rowIndex:e,index:e}),H.setValue(t,a.value,l),this.registerPendingRecord("edit",a.rowData,e),p.trigger(y,h,function(e){var t,i,n,r,s,o;e.cancel||(p.isEdit=!1,p.element.classList.remove("e-editing"),a.cell.removeAttribute("aria-label"),t=a.cell.parentElement,i=d.cellDetails.column,t&&(r=a.cell,H.isNullOrUndefined(r)||(r.innerHTML="",i.allowFormula?(n=d.parent.getPrimaryKeyFieldNames()[0],n=d.parent.getFormulaValue(l[""+n],i.field),r.innerHTML=String(n||"")):r.innerHTML=String(a.value||""),H.removeClass([t],[Os]),H.removeClass([r],["e-editedcell","e-boolcell"]))),p.root&&p.root.element.classList.contains("e-gantt")||p.notify(li,e),p.editModule.destroyWidgets([i]),p.editModule.destroyForm(),n=p.getRowObjectFromUID(t.getAttribute("data-uid")),d.refreshTD(a.cell,i,n,a.value),d.parent.formulaSettings&&d.parent.formulaModule&&"Automatic"===d.parent.formulaSettings.calculationMode&&!d.parent.isFormulaRefreshSuspended&&d.parent.refreshFormulas(),r=d.parent.parentDetails&&d.parent.parentDetails.parentInstObj&&d.parent.parentDetails.parentInstObj.isReact,d.parent.isReact&&(e=parseInt(a.cell.getAttribute(zs).toString(),10)-1,d.newReactTd=t.cells[e]),(d.parent.isReact&&d.parent.requireTemplateRef||r&&d.parent.parentDetails.parentInstObj.requireTemplateRef)&&i.template?(o=(s=d).newReactTd,s.parent.renderTemplates(function(){s.parent.trigger(re,{cell:o||a.cell,column:i,data:a.rowData})})):(d.parent.isReact||r)&&i.template?(d.parent.renderTemplates(),d.parent.trigger(re,{cell:d.newReactTd||a.cell,column:i,data:a.rowData})):p.isTreeGrid&&d.parent.trigger(re,{cell:d.newReactTd||a.cell,column:i,data:a.rowData}),!d.parent.groupSettings.enableLazyLoading&&d.parent.aggregates.length&&(d.parent.enableInfiniteScrolling||d.parent.enableVirtualization||d.parent.allowPaging&&d.parent.groupSettings.disablePageWiseAggregates)?d.parent.notify(bt,{requestType:"refresh-aggregate-on-save",action:"update"}):d.parent.aggregates.length&&d.parent.aggregateModule.refresh(a.rowData,d.parent.groupSettings.enableLazyLoading?t:void 0),h.type=c,d.parent.trigger(Ye,h),p.trigger(c,h))}),this.preventSaveCell=!1,this.editNext&&(this.editNext=!1,this.cellDetails.rowIndex===this.index&&this.cellDetails.column.field===this.field&&this.prevEditedBatchCell||(t=p.getColumnByField(this.field))&&t.allowEditing&&this.editCellExtend(this.index,this.field)))},qf.prototype.endEdit=function(){this.parent.isEdit&&this.validateFormObj()||([].slice.call(this.parent.element.getElementsByClassName(As)).length?this.cellEditModule.endEdit():this.saveCell())},qf.prototype.startEdit=function(e){var t=parseInt(e.getAttribute(zs),10)-1,e=parseInt(e.getAttribute("data-index"),10),t=this.parent.getColumnByIndex(t);this.editCell(e,t.field)},qf.prototype.closeEdit=function(){[].slice.call(this.parent.element.getElementsByClassName(As)).length?this.cellEditModule.closeEdit():this.closeCellEdit()},qf.prototype.closeCellEdit=function(){var i=this,n=this.parent,e=H.extend(this.args,{requestType:"cancel",type:y,cancel:!1,data:this.cellDetails.rowData,selectedRow:n.selectedRowIndex});n.notify(En,e),n.trigger(y,e,function(e){var t;e.cancel||(e.type=c,t=i.parent.getRowObjectFromUID(i.args.row.getAttribute("data-uid")),i.removeBatchElementChanges(t,!0),i.refreshRowIdx(),n.getContentTable().querySelectorAll(".e-rowcell").forEach(function(e){var t=Array.from(e.classList).filter(function(e){return e.startsWith("e-formula-cell-")||e.startsWith("e-formula-range")||e.startsWith("e-formula-border-range-")});(e=e.classList).remove.apply(e,t)}),n.isEdit=!1,n.trigger(c,e))})},qf.prototype.addRecord=function(e,t){this.cellEditModule.addRecord(e,t)},qf.prototype.deleteRecord=function(e,t){this.cellEditModule.deleteRecord(e,t)},qf.prototype.editComplete=function(e){this.cellEditModule.editComplete(e)},qf.prototype.registerPendingRecord=function(e,t,i){var n=this.parent.editModule&&this.parent.editModule.undoRedoModule;n&&n.setPendingRecord&&n.setPendingRecord(t,e,i)},qf.prototype.requestSuccess=function(e){"add"===e.action&&"save"===e.requestType&&this.cellEditModule.requestSuccess(e)},qf.prototype.destroy=function(){this.removeEventListener()};var Nf,Bf,zf=qf;function qf(e,t,i){var n=Bf.call(this,e,t,i)||this;return n.renderer=i,n.cellEditModule=new vf(e,t,i),n.addEventListener(),n}Hf.prototype.addEventListener=function(){this.parent.isDestroyed||(this.actionCompleteFunction=this.onActionComplete.bind(this),this.actionFailureFunction=this.onActionFailure.bind(this),this.destroyFunction=this.destroy.bind(this),this.cancelBeginFunction=this.onReplayCancelBegin.bind(this),this.parent.on(Yi,this.cancelBeginFunction,this),this.parent.addEventListener(c,this.actionCompleteFunction),this.parent.addEventListener(ae,this.actionFailureFunction),H.EventHandler.add(document.body,"keydown",this.onKeyPressed,this),this.parent.addEventListener(s,this.destroyFunction))},Hf.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Yi,this.cancelBeginFunction),this.parent.removeEventListener(c,this.actionCompleteFunction),this.parent.removeEventListener(ae,this.actionFailureFunction),H.EventHandler.remove(document.body,"keydown",this.onKeyPressed),this.parent.removeEventListener(s,this.destroyFunction))},Hf.prototype.destroy=function(){this.removeEventListener(),this.clearStacks()},Hf.prototype.clearStacks=function(){this.undoStack=[],this.redoStack=[],this.pendingBatchTransaction=null,this.pendingRecords={},this.pendingRecordTypes={},this.pendingRecordIndexes={}},Hf.prototype.pushToStack=function(e,t){e.push(t);for(var i=this.parent.editSettings.undoRedoLimit;e.length>i;)e.shift();this.parent.notify(ri,{})},Hf.prototype.isUndoStackAvailable=function(){return this.parent.editSettings.enableUndoRedo&&0<this.undoStack.length},Hf.prototype.isRedoStackAvailable=function(){return this.parent.editSettings.enableUndoRedo&&0<this.redoStack.length},Hf.prototype.undo=function(){var t,i=this;!this.parent.editSettings.enableUndoRedo||this.isReplaying||0===this.undoStack.length||this.isEditorOpen()||(t=this.undoStack[this.undoStack.length-1])&&("batch-transaction"===t.type?this.replayTransaction(t,!0,function(e){e&&(i.undoStack.pop(),i.pushToStack(i.redoStack,t))}):this.replay(t,!0,function(e){e&&i.undoStack[i.undoStack.length-1]===t&&(i.undoStack.pop(),i.pushToStack(i.redoStack,t))}))},Hf.prototype.redo=function(){var t,i=this;!this.parent.editSettings.enableUndoRedo||this.isReplaying||0===this.redoStack.length||this.isEditorOpen()||(t=this.redoStack[this.redoStack.length-1])&&("batch-transaction"===t.type?this.replayTransaction(t,!1,function(e){e&&(i.redoStack.pop(),i.pushToStack(i.undoStack,t))}):this.replay(t,!1,function(e){e&&i.redoStack[i.redoStack.length-1]===t&&(i.redoStack.pop(),i.pushToStack(i.undoStack,t))}))},Hf.prototype.setPendingBatchTransaction=function(e){this.pendingBatchTransaction=e},Hf.prototype.setPendingRecord=function(e,t,i){var n=this.parent.getPrimaryKeyFieldNames()[0],r=this.getKeyValue(e,n),i=0<=i?i:this.findRecordIndex(r,n),e=this.cloneRecord(e);this.pendingRecords[n+"|"+r]=e,this.pendingRecordTypes[n+"|"+r]=t,this.pendingRecordIndexes[n+"|"+r]=i},Hf.prototype.isEditorOpen=function(){var e;return!!this.parent.isEdit||!!((e=this.parent.element).querySelector(".e-editedrow")||e.querySelector(".e-addedrow")||e.querySelector(".e-dlgeditrow"))},Hf.prototype.onActionComplete=function(e){var t;e&&!this.isReplaying&&this.parent.editSettings.enableUndoRedo&&("save"===(t=e.requestType)?this.captureSave(e):"delete"===t?this.captureDelete(e):"batchsave"===t&&this.commitPendingBatchTransaction())},Hf.prototype.onActionFailure=function(e){if(!this.isReplaying||e&&e.requestType!==this.replayRequestType||(this.replayFailed=!0),e)if("batchsave"===e.requestType)this.pendingBatchTransaction=null;else if("save"===e.requestType||"delete"===e.requestType){var t=this.parent.getPrimaryKeyFieldNames()[0],e=e.data,i=Array.isArray(e)?e:[e];if(t)for(var n=0;n<i.length;n++){var r=this.getKeyValue(i[parseInt(n.toString(),10)],t);H.isNullOrUndefined(r)||this.clearPendingRecord(t,r)}}},Hf.prototype.onReplayCancelBegin=function(e){var t;this.isReplaying&&e&&(t="delete"===this.replayExpectedAction&&"delete"===e.requestType,e="delete"!==this.replayExpectedAction&&e.action===this.replayExpectedAction,t||e)&&(this.replayCancelled=!0)},Hf.prototype.clearPendingRecord=function(e,t){e=e+"|"+t;delete this.pendingRecords[e],delete this.pendingRecordTypes[e],delete this.pendingRecordIndexes[e]},Hf.prototype.onKeyPressed=function(e){var t,i,n,r;e&&"Batch"!==this.parent.editSettings.mode&&this.parent.editSettings.enableUndoRedo&&!this.isEditorOpen()&&!this.isComposing(e)&&(t=/(Mac)/i.test(navigator.platform),i=(e.key||"").toLowerCase(),n=(r=t?e.metaKey:e.ctrlKey)&&"z"===i&&!e.shiftKey||!t&&"ctrlPlusZ"===e.action||t&&"cmdPlusZ"===e.action,r=!t&&r&&"y"===i&&!e.shiftKey||r&&"z"===i&&e.shiftKey||!t&&"ctrlPlusY"===e.action||t&&"cmdShiftPlusZ"===e.action,n?(e.preventDefault(),this.parent.undoEdit()):r&&(e.preventDefault(),this.parent.redoEdit()))},Hf.prototype.isComposing=function(e){e=N("originalEvent",e)||e;return!0===N("isComposing",e)},Hf.prototype.getKeyValue=function(e,t){return e&&t&&("number"==typeof(t=N(t,e))||"string"==typeof t)?t:void 0},Hf.prototype.findRecordIndex=function(e,t){for(var i=this.parent.getCurrentViewRecords(),n=0;n<i.length;n++)if(this.getKeyValue(i[parseInt(n.toString(),10)],t)===e)return n;return-1},Hf.prototype.captureSave=function(e){var t=this.parent.getPrimaryKeyFieldNames()[0],i=e.data,n=this.getKeyValue(i,t),r=t+"|"+n,s=this.pendingRecords[r],o=this.pendingRecordTypes[r],r=this.pendingRecordIndexes[r];this.clearPendingRecord(t,n),!o||"edit"===o&&this.isSameRecord(s,i)||(o={type:"add"===o?"row-add":"cell-edit",primaryKey:t,keyValue:n,rowIndex:H.isNullOrUndefined(r)?this.findRecordIndex(n,t):r,field:e.columnName,previousRecord:s?this.cloneRecord(s):void 0,newRecord:this.cloneRecord(i),sequence:++this.sequence},this.pushToStack(this.undoStack,o),this.redoStack=[],this.parent.notify(ri,{}))},Hf.prototype.captureDelete=function(e){for(var t=this.parent.getPrimaryKeyFieldNames()[0],i=e.data||[],n=0;n<i.length;n++){var r,s=i[parseInt(n.toString(),10)],o=this.getKeyValue(s,t);H.isNullOrUndefined(o)||(r=this.pendingRecordIndexes[t+"|"+o],r=H.isNullOrUndefined(r)?this.findRecordIndex(o,t):r,this.clearPendingRecord(t,o),o={type:"row-delete",primaryKey:t,keyValue:o,rowIndex:r,previousRecord:this.cloneRecord(s),newRecord:void 0,sequence:++this.sequence},this.pushToStack(this.undoStack,o))}i.length&&(this.redoStack=[],this.parent.notify(ri,{}))},Hf.prototype.commitPendingBatchTransaction=function(){var e=this.pendingBatchTransaction;this.pendingBatchTransaction=null,e&&this.parent.editSettings.enableUndoRedo&&(e.sequence=++this.sequence,this.pushToStack(this.undoStack,e),this.redoStack=[],this.parent.notify(ri,{}))},Hf.prototype.isSameRecord=function(e,t){var i=e,n=t;if(!i||!n)return!1;for(var r=Object.keys(n),s=0;s<r.length;s++){var o=r[parseInt(s.toString(),10)],a=N(o,i),o=N(o,n);if(a instanceof Date&&o instanceof Date){if(a.getTime()!==o.getTime())return!1}else if(a!==o)return!1}return!0},Hf.prototype.replay=function(e,t,i){var n=this;this.isReplaying=!0,this.replayExpectedAction="row-add"===e.type?t?"delete":"add":"row-delete"===e.type?t?"add":"delete":"edit",this.replayRequestType="delete"===this.replayExpectedAction?"delete":"save",this.replayFailed=!1,this.replayCancelled=!1,this.replayRecord(e,t).then(function(){n.replayCancelled&&n.parent.trigger(ae,{error:new Error("The undo/redo operation was cancelled."),requestType:n.replayRequestType}),n.finishReplay(!n.replayFailed&&!n.replayCancelled,i)},function(e){n.replayFailed||n.parent.trigger(ae,{error:e,requestType:n.replayRequestType}),n.finishReplay(!1,i)})},Hf.prototype.finishReplay=function(e,t){this.isReplaying=!1,this.replayExpectedAction=null,this.replayRequestType=null,t(e),this.parent.notify(ri,{})},Hf.prototype.replayTransaction=function(e,i,n){for(var r=this,t=e.changedRecords,s=e.addedRecords,o=e.deletedRecords,a=e.records||t.concat(s,o),l={changedRecords:[],addedRecords:[],deletedRecords:[]},h=0;h<a.length;h++){var d=a[parseInt(h.toString(),10)];"changed"===d.changeType?l.changedRecords.push(i?d.previousRecord:d.newRecord):("added"===d.changeType!==i?l.addedRecords:l.deletedRecords).push(d.newRecord||d.previousRecord)}e={batchChanges:l,cancel:!1};this.isReplaying=!0,this.parent.trigger(je,e,function(e){var t;e.cancel?(r.isReplaying=!1,r.parent.trigger(ae,{error:new Error("The Batch undo/redo operation was cancelled."),requestType:"batchsave"}),n(!1)):(t=function(e){e>=a.length?(r.isReplaying=!1,r.parent.refresh(),r.parent.notify(ri,{}),n(!0)):Promise.resolve().then(function(){return r.replayCommittedRecord(a[parseInt(e.toString(),10)],i)}).then(function(){t(e+1)},function(e){r.isReplaying=!1,r.parent.refresh(),r.parent.trigger(ae,{error:e,requestType:"batchsave"}),n(!1)})})(0)})},Hf.prototype.replayCommittedRecord=function(e,t){var i=e.primaryKey,n=e.keyValue,r=this.parent.getDataModule(),s=r.generateQuery(),r=r.dataManager;return("added"===e.changeType?t?Promise.resolve(r.remove(i,n,s.fromTable,s)):Promise.resolve(r.insert(e.newRecord,s.fromTable,s,e.rowIndex)):"deleted"===e.changeType?t?Promise.resolve(r.insert(e.previousRecord,s.fromTable,s,e.rowIndex)):Promise.resolve(r.remove(i,n,s.fromTable,s)):(n=t?e.previousRecord:e.newRecord,t=t?e.newRecord:e.previousRecord,Promise.resolve(r.update(i,n,s.fromTable,s,t)))).then(function(){})},Hf.prototype.replayRecord=function(e,t){var i;return"row-add"===e.type?t?this.deleteRecordAsync(e.primaryKey,e.newRecord):this.addRecordAsync(e.newRecord,e.rowIndex):"row-delete"===e.type?t?this.addRecordAsync(e.previousRecord,e.rowIndex):this.deleteRecordAsync(e.primaryKey,e.previousRecord):(i=this.findRecordIndex(e.keyValue,e.primaryKey),this.updateRowAsync(i,t?e.previousRecord:e.newRecord))},Hf.prototype.addRecordAsync=function(e,t){return this.parent.addRecordAsync(this.cloneRecord(e),-1<t?t:0)},Hf.prototype.deleteRecordAsync=function(e,t){return this.parent.deleteRecordAsync(e,this.cloneRecord(t))},Hf.prototype.updateRowAsync=function(n,r){var s=this,e=this.parent.getCurrentViewRecords(),o={requestType:"save",action:"edit",data:this.cloneRecord(r),previousData:e[parseInt(n.toString(),10)],cancel:!1};return new Promise(function(t,i){s.parent.trigger(y,o,function(e){e.cancel?(s.replayCancelled=!0,t()):s.parent.updateRowAsync(n,s.cloneRecord(e.data||r)).then(t,i)})})},Hf.prototype.cloneRecord=function(e){if(H.isNullOrUndefined(e))return e;var t="undefined"!=typeof window?N("structuredClone",window):void 0;if("function"==typeof t)try{return t.call(window,e)}catch(e){if("DataCloneError"!==N("name",e))throw e}return this.manualClone(e)},Hf.prototype.manualClone=function(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());if(Array.isArray(e)){for(var t=[],i=0;i<e.length;i++)t.push(this.manualClone(e[parseInt(i.toString(),10)]));return t}var n=Object.getPrototypeOf(e);if(n!==Object.prototype&&null!==n)return e;for(var r={},s=Object.keys(e),i=0;i<s.length;i++){var o=s[parseInt(i.toString(),10)];Object.defineProperty(r,o,{value:this.manualClone(N(o,e)),enumerable:!0,configurable:!0,writable:!0})}return r};var Uf=Hf;function Hf(e){this.undoStack=[],this.redoStack=[],this.isReplaying=!1,this.sequence=0,this.pendingBatchTransaction=null,this.pendingRecords={},this.pendingRecordTypes={},this.pendingRecordIndexes={},this.replayFailed=!1,this.replayCancelled=!1,this.parent=e,this.addEventListener()}jf.prototype.addEventListener=function(){this.parent.isDestroyed||(this.editableDiv&&(H.EventHandler.add(this.editableDiv,"click",this.onEditableDivClick,this),H.EventHandler.add(this.editableDiv,"focusin",this.onEditableDivFocusIn,this),H.EventHandler.add(this.editableDiv,"focusout",this.onEditableDivFocusOut,this),H.EventHandler.add(this.editableDiv,"input",this.onInputChange,this)),H.EventHandler.add(this.parent.element,"click",this.onGridCellClick,this),this.parent.on(s,this.destroy,this))},jf.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.editableDiv&&(H.EventHandler.remove(this.editableDiv,"click",this.onEditableDivClick),H.EventHandler.remove(this.editableDiv,"focusin",this.onEditableDivFocusIn),H.EventHandler.remove(this.editableDiv,"focusout",this.onEditableDivFocusOut),H.EventHandler.remove(this.editableDiv,"input",this.onInputChange)),H.EventHandler.remove(this.parent.element,"click",this.onGridCellClick),this.parent.off(s,this.destroy))},jf.prototype.create=function(e){return this.editableDiv=document.createElement("span"),this.editableDiv.contentEditable="true",this.editableDiv.className="e-field e-control e-formula-edit e-lib e-input-group e-control-wrapper e-valid-input",e.column.textAlign&&(this.editableDiv.style.textAlign=e.column.textAlign),this.addEventListener(),this.editableDiv},jf.prototype.read=function(e){e=e&&e.textContent?e.textContent.trim():"";return e&&e.startsWith("=")?this.convertCellReferencesToREF(e,this.currentEditingRowNum):e||""},jf.prototype.write=function(e){var t,i,n=this;this.editableDiv&&e&&(t=(i=e.rowData)[e.column.field],this.currentValue=null!=t?t.toString():"",t=this.parent.getPrimaryKeyFieldNames()[0],i=this.parent.getRowIndexByPrimaryKey(i[""+t]),this.parent.allowPaging&&this.parent.pageSettings&&(i=(this.parent.pageSettings.currentPage-1)*this.parent.pageSettings.pageSize+i),this.currentEditingRowNum=i+1,this.currentValue.startsWith("=")?this.displayValue=this.convertFormulaToCellReference(this.currentValue,i):this.displayValue=this.currentValue,this.renderColorizedFormula(this.displayValue),this.updateReferenceHighlight(),"beginEdit"===e.requestType)&&requestAnimationFrame(function(){requestAnimationFrame(function(){n.editableDiv&&(n.editableDiv.focus(),n.editableDiv.classList.add("e-input-focus"),n.setCursorPosition(n.displayValue.length))})})},jf.prototype.renderColorizedFormula=function(n,e){var r,t,s=this;this.editableDiv&&(this.editableDiv.innerHTML="",0===(t=this.extractFormulaReferencesWithPositions(n)).length?this.editableDiv.textContent=n:(r=0,this.referenceToColorMap.clear(),t.forEach(function(e){var t,i;r<e.startPos&&(i=document.createTextNode(n.substring(r,e.startPos)),s.editableDiv.appendChild(i)),(i=s.isAutoFillFormula()?(i=e.text.toUpperCase(),s.referenceToColorMap.has(i)||(t=s.referenceToColorMap.size%7,s.referenceToColorMap.set(i,1+t)),t=s.referenceToColorMap.get(i),s.parent.createElement("span",{className:"e-formula-token e-formula-token-"+t})):s.parent.createElement("span",{className:"e-formula-token"})).textContent=e.text,s.editableDiv.appendChild(i),r=e.endPos}),r<n.length&&(t=document.createTextNode(n.substring(r)),this.editableDiv.appendChild(t))),e)&&this.setCursorPosition(e)},jf.prototype.extractFormulaReferencesWithPositions=function(e){for(var t=[],i=/\$?[A-Z]{1,3}\$?\d+(?::\$?[A-Z]{1,3}\$?\d+)?(?!\()/gi,n=i.exec(e);null!==n;)t.push({text:n[0],startPos:n.index,endPos:n.index+n[0].length}),n=i.exec(e);return t},jf.prototype.convertCellReferencesToREF=function(e,l){for(var h=this,t=this.parent.getColumns(),d={},i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];n.field&&(d[mu(i)]=n.field)}return(e=e.toUpperCase()).replace(/(\$?)([A-Z]+)(\$?)(\d+)/gi,function(e,t,i,n,r){var s,o,a,i=d[i];return i?(s=parseInt(r,10),a=h.parent.getDataModule().dataManager.executeLocal(h.parent.getDataModule().generateQuery(!0)),o=h.parent.getPrimaryKeyFieldNames()[0],a=a[(a=parseInt(r.toString(),10))-1][""+o],'REF(COLUMN("'+("$"===t?"$":"")+i+'"),ROW('+(a="$"!==n&&(H.isNullOrUndefined(l)||s===l)?a:"$"+a)+"))"):e})},jf.prototype.convertFormulaToCellReference=function(e,h){for(var d=this,t=this.parent.getColumns(),p={},i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)];n.field&&(p[n.field]=mu(i))}return e.replace(/REF\(COLUMN\(["']([^"']+)["']\),ROW\((\$*?)(\d+)\)\)/gi,function(e,t,i,n){var r="$"===t.charAt(0),t=r?t.substring(1):t,t=p[t],s=void 0!==h?h+1:1,o=d.parent.getDataModule().dataManager.executeLocal(d.parent.getDataModule().generateQuery(!0)),a=d.parent.getPrimaryKeyFieldNames()[0],l=parseInt(n.toString(),10),n=o.findIndex(function(e){return e[""+a]===l});return-1!==n&&(o=n+1,t)?"$"===i?r?"$"+t+"$"+o:""+t+o:""+t+s:e})},jf.prototype.onEditableDivClick=function(){var e;this.editableDiv&&(this.editableDiv.focus(),this.editableDiv.classList.add("e-input-focus"),e=this.getCursorPositionInFormula(),this.setCursorPosition(e))},jf.prototype.onEditableDivFocusIn=function(e){this.editableDiv&&!H.isNullOrUndefined(I(e.target,As))&&this.editableDiv.classList.add("e-input-focus")},jf.prototype.onEditableDivFocusOut=function(e){this.editableDiv&&!H.isNullOrUndefined(I(e.target,As))&&this.editableDiv.classList.remove("e-input-focus")},jf.prototype.onInputChange=function(){var e=this,t=this.editableDiv?this.editableDiv.textContent:"",i=(this.displayValue=t,this.getCursorPositionInFormula());requestAnimationFrame(function(){requestAnimationFrame(function(){e.renderColorizedFormula(t,i),e.updateReferenceHighlight()})})},jf.prototype.extractRefsFromDisplay=function(e){for(var t=e.replace(/"(?:\\.|[^"\\])*"/g,""),i=/\$?[A-Z]+\$?\d+(?::\$?[A-Z]+\$?\d+)?/gi,n=[],r=i.exec(t);null!==r;)n.push({text:r[0],start:r.index,end:r.index+r[0].length}),r=i.exec(t);return n},jf.prototype.onGridCellClick=function(e){var t=this,e=e.target;if(this.isAutoFillFormula()&&e.classList.contains("e-rowcell")&&this.parent.isEdit&&this.editableDiv){var e=I(e,b),i=I(e,Ts),i=parseInt(i.getAttribute(D),10)-1,e=parseInt(e.getAttribute(zs),10)-1,i=this.parent.allowPaging&&this.parent.pageSettings?(this.parent.pageSettings.currentPage-1)*this.parent.pageSettings.pageSize+i:i,n=mu(e)+(1+i),e=this.editableDiv.textContent,r=this.getCursorPositionInFormula(),s=this.extractRefsFromDisplay(e);if(s.length){for(var o=-1,a=0;a<s.length;a++)if(r>=s[parseInt(a.toString(),10)].start&&r<=s[parseInt(a.toString(),10)].end){o=a;break}if(-1===o)return i=e.charAt(Math.max(0,r-1)),l=e.charAt(r),d=r===e.length,p=/[+\-*/×÷(,]/.test(i),i=/[A-Za-z0-9_$"]/.test(i)||/[A-Za-z0-9_$"]/.test(l),d||p||!i?(l=e.slice(0,r)+n+e.slice(r),this.currentValue=l,this.displayValue=l,this.renderColorizedFormula(l),this.updateReferenceHighlight(),void requestAnimationFrame(function(){t.setCursorPosition(r+n.length)})):void this.parent.endEdit();var l,h,d=s[o],p=void 0;p=-1!==d.text.indexOf(":")?(l=(i=d.text.split(":"))[0],i=i[1],h=d.start+l.length,r<=h?e.slice(0,d.start)+n+":"+i+e.slice(d.end):e.slice(0,d.start)+l+":"+n+e.slice(d.end)):e.slice(0,d.start)+n+e.slice(d.end),this.currentValue=p,this.displayValue=p,this.renderColorizedFormula(p),this.updateReferenceHighlight(),this.lastFormulaCaretPosition=r,requestAnimationFrame(function(){requestAnimationFrame(function(){t.setCursorPosition(r)})})}else this.parent.endEdit()}},jf.prototype.getCursorPositionInFormula=function(){var e=window.getSelection(),t=e.getRangeAt(0);return this.editableDiv&&e&&0!==e.rangeCount&&this.editableDiv.contains(t.startContainer)&&((e=t.cloneRange()).selectNodeContents(this.editableDiv),e.setEnd(t.startContainer,t.startOffset),this.lastFormulaCaretPosition=e.toString().length),this.lastFormulaCaretPosition},jf.prototype.setCursorPosition=function(e){if(this.editableDiv){0===this.editableDiv.childNodes.length&&this.editableDiv.appendChild(document.createTextNode(""));for(var t=window.getSelection(),i=document.createRange(),n=0,r=[this.editableDiv],s=!1,o=r.pop();!s&&o;){if(o.nodeType===Node.TEXT_NODE){var a=o,l=n+a.length;e<=l&&(i.setStart(a,e-n),s=!0),n=l}else for(var h=o.childNodes.length-1;0<=h;h--)r.push(o.childNodes[parseInt(h.toString(),10)]);o=r.pop()}i.collapse(!0),t.removeAllRanges(),t.addRange(i)}},jf.prototype.updateReferenceHighlight=function(){var e,n=this;this.isAutoFillFormula()&&this.editableDiv&&(this.clearReferenceHighlight(),this.referenceToColorMap.clear(),e=this.editableDiv?this.editableDiv.textContent:"",this.extractFormulaReferences(e).forEach(function(e){var t=e.toUpperCase(),i=(n.referenceToColorMap.has(t)||(i=n.referenceToColorMap.size%7,n.referenceToColorMap.set(t,1+i)),n.referenceToColorMap.get(t));n.highlightReference(e,"e-formula-cell-"+i)}))},jf.prototype.extractFormulaReferences=function(e){var t,e=e.match(/\$?[A-Z]+\$?\d+(?::\$?[A-Z]+\$?\d+)?/gi);return e?(t=[],e.forEach(function(e){e=e.toUpperCase();-1===t.indexOf(e)&&t.push(e)}),t):[]},jf.prototype.clearReferenceHighlight=function(){this.highlightedCells.forEach(function(e){var t=Array.from(e.classList).filter(function(e){return e.startsWith("e-formula-cell-")||e.startsWith("e-formula-range")||e.startsWith("e-formula-border-range-")});(e=e.classList).remove.apply(e,t)}),this.highlightedCells=[]},jf.prototype.getPageRowIndex=function(e){return this.parent.allowPaging&&this.parent.pageSettings?e-(this.parent.pageSettings.currentPage-1)*this.parent.pageSettings.pageSize:e},jf.prototype.highlightReference=function(e,t){var i,n,r,s,o;0<=e.indexOf(":")?(s=(o=e.split(":"))[0],o=o[1],s=Hl.parseReference(s),o=Hl.parseReference(o),n=this.getPageRowIndex(s.row),r=this.getPageRowIndex(o.row),i=Math.min(n,r),n=Math.max(n,r),r=Math.min(s.col,o.col),s=Math.max(s.col,o.col),this.highlightRangeBorder(i,n,r,s,t)):(o=Hl.parseReference(e),this.highlightCell(o.col,this.getPageRowIndex(o.row),t))},jf.prototype.highlightCell=function(e,t,i){var n=this.parent.getColumns();e<0||e>=n.length||this.parent.getRowByIndex(t)&&(n=Uc(this.parent,n[parseInt(e.toString(),10)],t,e))&&(n.classList.add(i),this.highlightedCells.push(n))},jf.prototype.highlightRangeBorder=function(e,t,i,n,r){var s=this.parent.getColumns();if(!(i<0||n>=s.length||e<0||t>=this.parent.currentViewData.length))for(var o=e;o<=t;o++)for(var a=i;a<=n;a++){var l,h=Uc(this.parent,s[parseInt(a.toString(),10)],o,a);h&&(l=r.replace("e-formula-cell-","e-formula-border-range-"),h.classList.add("e-formula-range",l),o===e&&h.classList.add("e-formula-range-top"),o===t&&h.classList.add("e-formula-range-bottom"),a===i&&h.classList.add("e-formula-range-left"),a===n&&h.classList.add("e-formula-range-right"),this.highlightedCells.push(h))}},jf.prototype.isAutoFillFormula=function(){var e=this.parent.selectionSettings,t=e.cellSelectionMode;return!0===this.parent.enableAutoFill&&-1<t.indexOf("Box")&&"Cell"===e.mode&&"Multiple"===e.type},jf.prototype.destroy=function(){this.removeEventListener(),this.clearReferenceHighlight(),this.editableDiv=null,this.displayValue="",this.currentValue="",this.referenceToColorMap.clear(),this.highlightedCells=[]};var Vf=jf;function jf(e){this.editableDiv=null,this.currentValue="",this.displayValue="",this.lastFormulaCaretPosition=0,this.highlightedCells=[],this.referenceToColorMap=new Map,this.currentEditingRowNum=1,this.parent=e}C.prototype.updateColTypeObj=function(){for(var e=this.parent.columnModel,t=0;t<e.length;t++)this.parent.editSettings.template||e[parseInt(t.toString(),10)].editTemplate?e[parseInt(t.toString(),10)].edit=H.extend(new C.editCellType.templateedit(this.parent),e[parseInt(t.toString(),10)].edit||{}):e[parseInt(t.toString(),10)].allowFormula&&this.parent.formulaModule?e[parseInt(t.toString(),10)].edit=H.extend(new C.editCellType.formulaedit(this.parent,this.serviceLocator),e[parseInt(t.toString(),10)].edit||{}):e[parseInt(t.toString(),10)].edit=H.extend(new C.editCellType[e[parseInt(t.toString(),10)].editType&&C.editCellType[e[parseInt(t.toString(),10)].editType]?e[parseInt(t.toString(),10)].editType:"defaultedit"](this.parent,this.serviceLocator),e[parseInt(t.toString(),10)].edit||{});this.parent.log("primary_column_missing")},C.prototype.getModuleName=function(){return"edit"},C.prototype.onPropertyChanged=function(e){if(e.module===this.getModuleName())for(var t=this.parent,i=0,n=Object.keys(e.properties);i<n.length;i++)switch(n[i]){case"allowAdding":case"allowDeleting":case"allowEditing":(t.editSettings.allowAdding||t.editSettings.allowEditing||t.editSettings.allowDeleting)&&this.initialEnd();break;case"enableUndoRedo":case"enableBatchUndoRedo":case"undoRedoLimit":t.notify(ri,{});break;case"mode":this.updateEditObj(),t.isEdit=!!t.editSettings.showAddNewRow,t.refresh()}},C.prototype.updateEditObj=function(){this.editModule&&this.editModule.destroy(),this.renderer=new Jg(this.parent,this.serviceLocator),this.editModule=new this.editType[this.parent.editSettings.mode](this.parent,this.serviceLocator,this.renderer)},C.prototype.initialEnd=function(){this.updateColTypeObj()},C.prototype.startEdit=function(e){var t=this.parent;if(!(!t.editSettings.allowEditing||t.isEdit&&(!t.editSettings.showAddNewRow||t.editSettings.showAddNewRow&&!H.isNullOrUndefined(t.element.querySelector("."+Os)))||"Batch"===t.editSettings.mode||"Cell"===t.editSettings.mode&&"Row"===t.selectionSettings.mode)){if(this.parent.element.classList.add("e-editing"),t.getSelectedRows().length&&!H.isNullOrUndefined(this.parent.getRowByIndex(parseInt(this.parent.getSelectedRows()[0].getAttribute("aria-rowindex"),10)-1))||t.getSelectedRowCellIndexes().length)e=e||(this.parent.isTreeGrid&&this.parent.allowPaging&&t.selectionModule.selectedRowIndexes.length?(i=t.selectionModule.selectedRowIndexes[0],t.getRowByIndex(i)):t.getSelectedRowCellIndexes().length?(n=(i=t.getSelectedRowCellIndexes())[0].rowIndex,i=i[0].cellIndexes[0],t.getCellFromIndex(n,i)):t.getSelectedRows()[0]);else if(!e)return void this.showDialog("EditOperationAlert",this.alertDObj);this.parent.enableVirtualization&&"Normal"===this.parent.editSettings.mode&&(n=parseInt(e.getAttribute("aria-rowindex"),10)-1,e=this.parent.getRowByIndex(n));var i=t.getContent().querySelector("tr:last-child"),n=t.getHeaderContent().querySelector("tbody");t.frozenRows&&H.isNullOrUndefined(i)&&n&&n.querySelector("tr:last-child")?this.isLastRow=e.rowIndex===parseInt(t.getHeaderContent().querySelector("tbody").querySelector("tr:last-child").getAttribute("aria-rowindex"),10)-1:i&&(this.isLastRow=e.rowIndex===i.rowIndex),"none"!==e.style.display&&(this.editModule.startEdit(e),this.parent.isEdit&&!this.parent.isPersistSelection&&"Dialog"!==this.parent.editSettings.mode&&(n=this.parent.getHeaderContent().querySelector(".e-checkselectall"))&&n.parentElement.classList.add("e-checkbox-disabled"),this.refreshToolbar(),t.element.querySelector(".e-gridpopup").style.display="none",this.parent.notify("start-edit",{}),t.editSettings.showAddNewRow)&&this.destroyToolTip()}},C.prototype.checkLastRow=function(e,t){var i=this.isLastRow;"auto"!==this.parent.height&&t&&"add"===t.requestType&&("Bottom"===this.parent.editSettings.newRowPosition&&this.parent.getContent().firstElementChild.offsetHeight>this.parent.getContentTable().scrollHeight||0===this.parent.currentViewData.length)?H.addClass([].slice.call(e.getElementsByClassName(b)),"e-lastrowadded"):i&&e&&e.classList&&H.addClass([].slice.call(e.getElementsByClassName(b)),"e-lastrowcell")},C.prototype.closeEdit=function(){"Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&this.parent.element.getElementsByClassName("e-updatedtd").length?this.showDialog("CancelEdit",this.dialogObj):(this.parent.element.classList.remove("e-editing"),this.editModule.closeEdit(),this.refreshToolbar(),this.parent.notify(Er,{requestType:"cancel"}),this.parent.editSettings.showAddNewRow&&this.destroyToolTip())},C.prototype.refreshToolbar=function(){this.parent.notify(ri,{})},C.prototype.addRecord=function(e,t){var i;this.parent.editSettings.allowAdding&&(i={startEdit:!0},e||this.parent.notify(Mn,i),i.startEdit)&&(this.parent.element.classList.add("e-editing"),this.editModule.addRecord(e,t),this.refreshToolbar(),this.parent.notify("start-add",{}))},C.prototype.deleteRecord=function(e,t){var i=this.parent;i.editSettings.allowDeleting&&(t||i.getSelectedRecords().length||i.getSelectedCellRecords().length||!H.isNullOrUndefined(i.commandDelIndex)?!i.editSettings.showDeleteConfirmDialog||!H.isNullOrUndefined(this.parent.root)&&this.parent.root.element.classList.contains("e-gantt")?this.editModule.deleteRecord(e,t):(this.fieldname=e,this.data=t,this.showDialog("ConfirmDelete",this.dialogObj)):this.showDialog("DeleteOperationAlert",this.alertDObj))},C.prototype.deleteRow=function(e){this.deleteRowUid=e.getAttribute("data-uid");e=this.parent.getRowObjectFromUID(this.deleteRowUid);H.isNullOrUndefined(e)||this.deleteRecord(null,e.data)},C.prototype.endEdit=function(){var e;"Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&(H.isNullOrUndefined(this.formObj)||this.formObj.validate())&&(this.parent.editModule.saveCell(),this.parent.notify($i,{}),H.isNullOrUndefined(this.formObj)||this.formObj.validate())?this.showDialog("BatchSaveConfirm",this.dialogObj):(this.endEditing(),this.parent.isEdit||this.parent.isPersistSelection||(e=this.parent.getHeaderContent().querySelector(".e-checkselectall"))&&e.parentElement.classList.remove("e-checkbox-disabled"))},C.prototype.updateCell=function(e,t,i){this.editModule.updateCell(e,t,i)},C.prototype.updateRow=function(e,t){this.editModule.updateRow(e,t)},C.prototype.batchCancel=function(){this.closeEdit()},C.prototype.batchSave=function(){this.endEdit()},C.prototype.editCell=function(e,t){this.editModule.editCell(e,t)},C.prototype.editFormValidate=function(){return!this.formObj||this.formObj.validate()},C.prototype.renderToolPanelForm=function(e,t,i,n,r){return this.renderer.renderToolPanelForm(e,t,i,n,r)},C.prototype.getBatchChanges=function(){return this.editModule.getBatchChanges?this.editModule.getBatchChanges():{}},C.prototype.getCurrentEditCellData=function(){var e=this.getCurrentEditedData(this.formObj.element,{});return e[Object.keys(e)[0]]},C.prototype.saveCell=function(){this.editModule.saveCell()},C.prototype.endEditing=function(){this.parent.editSettings.showAddNewRow||this.parent.element.classList.remove("e-editing"),this.editModule.endEdit(),this.isShowAddedRowValidate=!1,this.refreshToolbar()},C.prototype.showDialog=function(e,t){t.content="<div>"+this.l10n.getConstant(e)+"</div>",t.dataBind(),t.show(),this.parent.enableRtl&&t.refresh()},C.prototype.getValueFromType=function(e,t){var i=t;switch(e.type){case"number":i=e.allowFormula?t:isNaN(parseFloat(t))?null:parseFloat(t);break;case"boolean":"booleanedit"!==e.editType&&(i=t===this.l10n.getConstant("True")||!0===t);break;case"date":case"datetime":"datepickeredit"!==e.editType&&"datetimepickeredit"!==e.editType&&t&&t.length?i=new Date(t):""===t&&(i=null);break;case"dateonly":i=(t=t&&new Date(t))?t.getFullYear()+"-"+Jp(t.getMonth()+1)+"-"+Jp(t.getDate()):null}return i},C.prototype.destroyToolTip=function(){for(var e=0,t=[].slice.call(this.parent.element.getElementsByClassName("e-griderror"));e<t.length;e++){var i=t[e];H.remove(i)}this.parent.getContent().firstElementChild.style.position="relative",this.parent.isFrozenGrid()&&(this.parent.element.querySelector(".e-gridheader")&&(this.parent.element.querySelector(".e-gridheader").style.position=""),this.parent.element.querySelector(".e-gridcontent").style.position="")},C.prototype.createConfirmDlg=function(){this.dialogObj=this.dlgWidget([{click:this.dlgOk.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),cssClass:this.parent.cssClass?"e-primary "+this.parent.cssClass:"e-primary",isPrimary:!0}},{click:this.dlgCancel.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",content:this.l10n.getConstant("CancelButton")}}],"EditConfirm")},C.prototype.createAlertDlg=function(){this.alertDObj=this.dlgWidget([{click:this.alertClick.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),cssClass:this.parent.cssClass?"e-flat "+this.parent.cssClass:"e-flat",isPrimary:!0}}],"EditAlert")},C.prototype.alertClick=function(){this.alertDObj.hide()},C.prototype.dlgWidget=function(e,t){var t=this.parent.createElement("div",{id:this.parent.element.id+t}),i=(this.parent.element.appendChild(t),{showCloseIcon:!1,isModal:!0,visible:!1,closeOnEscape:!0,target:this.parent.element,width:"320px",animationSettings:{effect:"None"},cssClass:this.parent.cssClass||""}),e=(i.buttons=e,new F.Dialog(i));return e.isStringTemplate=!0,e.appendTo(t),e},C.prototype.dlgCancel=function(){this.parent.pagerModule&&(this.parent.pagerModule.isForceCancel=!1),this.parent.focusModule.clearIndicator(),this.dialogObj.hide(),this.parent.focusModule.restoreFocus({requestType:"cancel"}),this.parent.notify("cancelcnfrmDlg",{})},C.prototype.dlgOk=function(){switch(this.dialogObj.element.querySelector(".e-dlg-content").firstElementChild.innerText){case this.l10n.getConstant("ConfirmDelete"):this.editModule.deleteRecord(this.fieldname,this.data),this.parent.editSettings.showDeleteConfirmDialog&&!this.parent.allowSelection&&(this.parent.commandDelIndex=void 0);break;case this.l10n.getConstant("CancelEdit"):this.editModule.closeEdit();break;case this.l10n.getConstant("BatchSaveConfirm"):this.endEditing();break;case this.l10n.getConstant("BatchSaveLostChanges"):"Batch"===this.parent.editSettings.mode&&this.editModule.addCancelWhilePaging(),this.parent.pagerModule&&(this.parent.pagerModule.isForceCancel=!1),"Batch"===this.parent.editSettings.mode&&this.parent.editSettings.enableUndoRedo&&this.editModule.clearStacks(),this.executeAction()}this.dlgCancel()},C.prototype.destroyEditComponents=function(){var e;this.parent.isEdit&&(this.editModule&&!H.isNullOrUndefined(this.editModule.editRowIndex)&&H.isNullOrUndefined(this.parent.editSettings.template)&&(e=this.parent.columnModel.filter(function(e){return!e.edit.obj}),!H.isNullOrUndefined(e)&&0!==e.length||this.closeEdit()),this.destroyWidgets(),this.destroyForm()),this.formObj=null,this.destroy()},C.prototype.addEventListener=function(){this.parent.isDestroyed||(this.eventDetails=[{event:wt,handler:this.onPropertyChanged},{event:mt,handler:this.initialEnd},{event:Gt,handler:this.keyPressHandler},{event:oi,handler:this.updateColTypeObj},{event:ai,handler:this.destroyToolTip},{event:ci,handler:this.preventBatch},{event:mi,handler:this.destroyForm},{event:s,handler:this.destroyEditComponents}],Kc(this.parent,this.eventDetails,!0,this),this.actionBeginFunction=this.onActionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.on(Jr,this.actionBeginFunction),this.parent.addEventListener(c,this.actionCompleteFunction))},C.prototype.removeEventListener=function(){this.parent.isDestroyed||(Kc(this.parent,this.eventDetails,!1),this.parent.removeEventListener(c,this.actionCompleteFunction),this.parent.off(Jr,this.actionBeginFunction))},C.prototype.actionComplete=function(e){["add","beginEdit","save","delete","cancel","filterAfterOpen","filterchoicerequest"].indexOf(e.requestType)<0&&(this.parent.isEdit=!!this.parent.editSettings.showAddNewRow),"batchsave"===e.requestType&&this.parent.focusModule.restoreFocus({requestType:"save"}),this.refreshToolbar()},C.prototype.getCurrentEditedData=function(e,t){var i=this.parent;if(i.editSettings.template)for(var n,r=[].slice.call(e.elements),s=0;s<r.length;s++)!(r[parseInt(s.toString(),10)].hasAttribute("name")&&"e-multi-hidden"!==r[parseInt(s.toString(),10)].className||r[parseInt(s.toString(),10)].classList.contains("e-multiselect"))||"hidden"===r[parseInt(s.toString(),10)].type&&(I(r[parseInt(s.toString(),10)],"e-switch-wrapper")||I(r[parseInt(s.toString(),10)],"e-checkbox-wrapper"))||(n=r[parseInt(s.toString(),10)].hasAttribute("name")?Pp(r[parseInt(s.toString(),10)].getAttribute("name")):Pp(r[parseInt(s.toString(),10)].getAttribute("id")),p=void 0,"checkbox"===(n=i.getColumnByField(n)||{field:n,type:r[parseInt(s.toString(),10)].getAttribute("type")}).type||"boolean"===n.type?p=r[parseInt(s.toString(),10)].checked:r[parseInt(s.toString(),10)].value?(p=r[parseInt(s.toString(),10)].value,r[parseInt(s.toString(),10)].ej2_instances&&r[parseInt(s.toString(),10)].ej2_instances.length&&!H.isNullOrUndefined(r[parseInt(s.toString(),10)].ej2_instances[0].value)&&(r[parseInt(s.toString(),10)].blur(),p=r[parseInt(s.toString(),10)].ej2_instances[0].value)):r[parseInt(s.toString(),10)].ej2_instances&&(p=r[parseInt(s.toString(),10)].ej2_instances[0].value),n.edit&&"string"==typeof n.edit.read?p=H.getValue(n.edit.read,window)(r[parseInt(s.toString(),10)],p):n.edit&&n.edit.read&&(p=n.edit.read(r[parseInt(s.toString(),10)],p)),p=i.editModule.getValueFromType(n,p),"radio"===r[parseInt(s.toString(),10)].type?r[parseInt(s.toString(),10)].checked&&V.DataUtil.setValue(n.field,p,t):("string"==typeof p&&this.parent.sanitize(p),V.DataUtil.setValue(n.field,p,t)));else{for(var o=i.columnModel.filter(function(e){return e.editTemplate}),a=0;a<o.length;a++)if(e[Mp(o[parseInt(a.toString(),10)].field)]){var l,h=[].slice.call(e[Mp(o[parseInt(a.toString(),10)].field)]).filter(function(e){return"input"===e.tagName.toLowerCase()}),d=(0===h.length&&(l=[e[Mp(o[parseInt(a.toString(),10)].field)]],h=l=this.parent.isAngular&&o[parseInt(a.toString(),10)].editTemplate&&l&&l.length&&"datepicker"===l[0].getAttribute("aria-label")&&l[0].closest(".e-datepicker")?[l[0].closest(".e-datepicker")]:l),h.filter(function(e){return!H.isNullOrUndefined(e.ej2_instances)}));0===d.length&&(d=h.filter(function(e){return e.hasAttribute("name")}));for(s=0;s<d.length;s++){var p=this.getValue(o[parseInt(a.toString(),10)],d[parseInt(s.toString(),10)],t);"string"===o[parseInt(a.toString(),10)].type&&(p=this.parent.sanitize(p)),V.DataUtil.setValue(o[parseInt(a.toString(),10)].field,p,t)}}for(var c=[].slice.call(e.getElementsByClassName("e-field")),u=0,g=c.length;u<g;u++){var f=i.getColumnByUid(c[parseInt(u.toString(),10)].getAttribute("data-mappinguid"));f&&f.field&&(p=this.getValue(f,c[parseInt(u.toString(),10)],t),"string"!==f.type||f.isForeignColumn()&&"string"!=typeof p||(p=this.parent.sanitize(p)),V.DataUtil.setValue(f.field,p,t))}}return t},C.prototype.getValue=function(e,t,i){var n=(t.ej2_instances?t.ej2_instances[0]:t).value,r=this.parent,s=e.edit.read;return"checkbox"!==e.type&&"boolean"!==e.type||(n=t.checked),n="string"==typeof s?(s=H.getValue(s,window),r.editModule.getValueFromType(e,s(t,n))):r.editModule.getValueFromType(e,e.edit.read(t,n)),n=H.isNullOrUndefined(i[e.field])&&""===n?i[e.field]:n},C.prototype.onActionBegin=function(e){var t,i,n,r;("columnstate"===e.requestType||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&"sorting"===e.requestType)&&this.parent.isEdit&&"Batch"!==this.parent.editSettings.mode?this.closeEdit():(r=this.parent.element.querySelector("."+Os),t=this.parent.element.querySelector("."+As),r&&this.parent.frozenRows&&"virtualscroll"===e.requestType&&parseInt(I(r,Ts).getAttribute(D),10)-1<this.parent.frozenRows||(i=-1===["filterAfterOpen","filterBeforeOpen","filterchoicerequest","filterSearchBegin","save","infiniteScroll","virtualscroll"].indexOf(e.requestType),n=!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&!H.isNullOrUndefined(this.parent.element.querySelector(".e-editedrow")),r=(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.formObj&&n&&!this.formObj.isDestroyed&&(r||t||"cancel"===e.requestType)&&i,(!this.parent.enableVirtualization&&n&&"Batch"!==this.parent.editSettings.mode&&this.formObj&&!this.formObj.isDestroyed&&i&&!e.cancel||r)&&(this.destroyWidgets(),this.destroyForm())))},C.prototype.destroyWidgets=function(e){var t=this.parent;if(t.isWidgetsDestroyed=!0,t.editSettings.template&&((t=(t=nu(this.parent)).isReact?t:this.parent).destroyTemplate(["editSettingsTemplate"]),this.parent.isReact)&&this.parent.renderTemplates(),"Dialog"===this.parent.editSettings.mode&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length){e=[];for(var i=this.parent.getColumns(),n=0;n<i.length;n++){var r=i[parseInt(n.toString(),10)];(r.visible||-1<this.parent.groupSettings.columns.indexOf(r.field))&&e.push(r)}}else e=e||this.parent.getCurrentVisibleColumns(this.parent.enableColumnVirtualization);e.some(function(e){return!H.isNullOrUndefined(e.editTemplate)})&&(this.parent.destroyTemplate(["editTemplate"]),this.parent.isReact)&&this.parent.renderTemplates();for(var s=0,o=e;s<o.length;s++){var a=o[s],l=a.edit.destroy;a.edit.destroy&&("string"==typeof l?(l=H.getValue(l,window))():a.edit.destroy())}if(this.formObj&&this.formObj.element)for(var h=[].slice.call(this.formObj.element.elements),n=0;n<h.length;n++){var d=h[parseInt(n.toString(),10)];(d.hasAttribute("name")||d.classList.contains("e-field"))&&(d=H.isNullOrUndefined(d.parentElement)?null:d.parentElement.classList.contains("e-ddl")?d.parentElement.querySelector("input"):d)&&d.ej2_instances&&d.ej2_instances.length&&!d.ej2_instances[0].isDestroyed&&(d.ej2_instances[0].destroy(),d.remove())}},C.prototype.destroyForm=function(){this.destroyToolTip();for(var e=[this.formObj,this.virtualFormObj],t=this.parent.columnModel.filter(function(e){return e.editTemplate}),i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)];n&&n.element&&!n.isDestroyed&&(n.element.removeEventListener("submit",this.preventFormSubmit),n.destroy(),!nu(this.parent).isReact||"Dialog"!==this.parent.editSettings.mode||H.isNullOrUndefined(this.parent.editSettings.template)&&!t.length||n.element.remove(),n)&&n.element&&H.isNullOrUndefined(this.parent.editSettings.template)&&(n.element.innerHTML="",this.parent.editSettings.showAddNewRow)&&n.element.closest(".e-addedrow")&&(n.element.closest(".e-addedrow").innerHTML="")}this.destroyToolTip()},C.prototype.destroy=function(){var e,t=this.parent.element;t&&((t=!(!t.querySelector("."+ms)||!t.querySelector("."+vs)))&&this.destroyForm(),this.removeEventListener(),this.undoRedoModule&&(this.undoRedoModule.destroy(),this.undoRedoModule=null),0<(e=this.dialogObj.element).childElementCount&&(this.dialogObj.destroy(),H.remove(e)),0<(e=this.alertDObj.element).childElementCount&&(this.alertDObj.destroy(),H.remove(e)),t)&&this.editModule&&this.editModule.destroy()},C.prototype.undoBatchEdit=function(){this.editModule&&this.editModule.undoBatchEdit&&this.editModule.undoBatchEdit()},C.prototype.redoBatchEdit=function(){this.editModule&&this.editModule.redoBatchEdit&&this.editModule.redoBatchEdit()},C.prototype.isUndoStackAvailable=function(){return!!this.parent.editSettings.enableUndoRedo&&(!!("Batch"===this.parent.editSettings.mode&&this.editModule&&this.editModule.isUndoStackAvailable&&this.editModule.isUndoStackAvailable())||!!this.undoRedoModule&&this.undoRedoModule.isUndoStackAvailable())},C.prototype.isRedoStackAvailable=function(){return!!this.parent.editSettings.enableUndoRedo&&(!!("Batch"===this.parent.editSettings.mode&&this.editModule&&this.editModule.isRedoStackAvailable&&this.editModule.isRedoStackAvailable())||!!this.undoRedoModule&&this.undoRedoModule.isRedoStackAvailable())},C.prototype.undoEdit=function(){!this.parent.editSettings.enableUndoRedo||this.undoRedoModule&&this.undoRedoModule.isEditorOpen()||("Batch"===this.parent.editSettings.mode&&this.editModule&&this.editModule.isUndoStackAvailable&&this.editModule.isUndoStackAvailable()?this.editModule.undoBatchEdit():this.undoRedoModule&&(this.parent.focusModule.clearIndicator(),this.undoRedoModule.undo()))},C.prototype.redoEdit=function(){!this.parent.editSettings.enableUndoRedo||this.undoRedoModule&&this.undoRedoModule.isEditorOpen()||("Batch"===this.parent.editSettings.mode&&this.editModule&&this.editModule.isRedoStackAvailable&&this.editModule.isRedoStackAvailable()?this.editModule.redoBatchEdit():this.undoRedoModule&&this.undoRedoModule.redo())},C.prototype.keyPressHandler=function(e){/(Mac)/i.test(navigator.platform)&&e.metaKey&&"ctrlEnter"===e.action&&(e.action="insert");var t="Batch"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode&&H.isNullOrUndefined(I(e.target,As));switch(e.action){case"insert":this.addRecord();break;case"delete":"INPUT"===e.target.tagName&&!e.target.classList.contains("e-checkselect")&&!e.target.classList.contains("e-checkselectall")||document.querySelector(".e-popup-open.e-edit-dialog")||this.deleteRecord();break;case"f2":this.startEdit();break;case"enter":I(e.target,"e-unboundcelldiv")||t||!(I(e.target,vs)||(this.parent.frozenRows||this.parent.pinnedTopRowModels.length||this.parent.editSettings.showAddNewRow&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))&&I(e.target,Cs))||document.getElementsByClassName("e-popup-open").length&&(!document.querySelectorAll(".e-popup-open .e-editcell").length||document.querySelectorAll(".e-popup-open:not(.e-dialog)").length)||(e.preventDefault(),this.parent.isEdit&&(this.parent.isFocusFirstCell=!0),this.endEdit());break;case"escape":this.parent.isEdit&&!this.editCellDialogClose&&(t?this.editModule.escapeCellEdit():this.curretRowFocus(e)),this.editCellDialogClose&&(this.editCellDialogClose=!1);break;case"tab":case"shiftTab":this.curretRowFocus(e)}},C.prototype.curretRowFocus=function(e){var t="Batch"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode&&H.isNullOrUndefined(I(e.target,As));if(this.parent.isEdit&&!t){this.parent.isWidgetsDestroyed=!1;t=I(e.target,"e-editedrow")||I(e.target,"e-addedrow");if(t){var i=[].slice.call(t.querySelectorAll(".e-input:not(.e-disabled)")),n=[].slice.call(t.querySelectorAll(".e-unboundcell"));if(n&&n.length)for(var r=0;r<n.length;r++)i=i.concat([].slice.call(n[parseInt(r.toString(),10)].querySelectorAll(".e-btn:not(.e-hide)")));var s=(s=I(e.target,"e-rowcell"))&&s.classList.contains("e-unboundcell")?e.target:s,o=I(i[i.length-1],"e-rowcell");if(s===(o=o&&o.classList.contains("e-unboundcell")?i[i.length-1]:o)&&"tab"===e.action||"escape"===e.action||s===I(i[0],"e-rowcell")&&"shiftTab"===e.action&&!this.parent.editSettings.showAddNewRow){o=t.getAttribute("data-uid"),s=(this.parent.allowGrouping?H.isNullOrUndefined(this.parent.getContent())?[]:[].slice.call(this.parent.getContent().querySelectorAll("tr")):this.parent.getRows()).map(function(e){return e.getAttribute("data-uid")}).indexOf(o);if((this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&(I(t,"e-gridheader")?s=t.rowIndex:I(t,"e-gridcontent")&&(s-=this.parent.frozenRows)),t.classList.contains("e-addedrow")&&(s=0),"escape"===e.action?(this.parent.isFocusFirstCell=!0,this.closeEdit()):(this.isShowAddedRowValidate=!0,this.parent.selectionModule&&(this.parent.selectionModule.preventFocus=!1),this.parent.isFocusFirstCell=!0,this.endEdit(),this.isShowAddedRowValidate=!1),this.parent.focusModule.active&&(!this.parent.editSettings.showAddNewRow||t.classList.contains("e-editedrow")||this.parent.editSettings.showAddNewRow&&t.classList.contains("e-addedrow")&&H.isNullOrUndefined(this.parent.element.querySelector('.e-griderror:not([style*="display: none"])')))){var a=0,o=this.parent.focusModule.active.matrix;if(o&&o.matrix.length&&o.matrix[parseInt(s.toString(),10)])for(var l=o.matrix[parseInt(s.toString(),10)],r=0;r<l.length;r++)if(0<l[parseInt(r.toString(),10)]){a=r;break}t=H.getValue(s+".cells."+a,this.parent.focusModule.active.matrix.getRowsFromIndex(s,this.parent.focusModule.active));t&&0===t.getBoundingClientRect().width&&(a=this.parent.focusModule.active.matrix.nextVisibleCellFocus(s,a,e.action,this.parent.focusModule.active.keyActions[e.action],this.parent.focusModule.active,this.parent.focusModule.active.matrix.current[1])[1]),this.parent.focusModule.active.matrix.current=[s,a]}}this.parent.editSettings.showAddNewRow&&"tab"===e.action&&I(e.target,"e-addedrow")&&(this.isShowAddedRowValidate=!0)}}},C.prototype.preventBatch=function(e){this.preventObj=e,this.showDialog("BatchSaveLostChanges",this.dialogObj)},C.prototype.executeAction=function(){this.preventObj.handler.call(this.preventObj.instance,this.preventObj.arg1,this.preventObj.arg2,this.preventObj.arg3,this.preventObj.arg4,this.preventObj.arg5,this.preventObj.arg6,this.preventObj.arg7,this.preventObj.arg8)},C.prototype.applyFormValidation=function(e,t){var i=this.parent,n="Dialog"!==this.parent.editSettings.mode?(i.editSettings.showAddNewRow&&i.element.querySelector("."+Os)?i.element.querySelector("."+Os):i.element).getElementsByClassName("e-gridform")[parseInt(0..toString(),10)]:H.select("#"+i.element.id+"_dialogEdit_wrapper .e-gridform",document),r={},s={},o={};e=e||i.getColumns();for(var a=0;a<e.length;a++)(e[parseInt(a.toString(),10)].visible||"Dialog"===i.editSettings.mode&&(-1!==i.groupSettings.columns.indexOf(e[parseInt(a.toString(),10)].field)||"Dialog"!==i.editSettings.mode))&&e[parseInt(a.toString(),10)].validationRules&&H.isNullOrUndefined(t)&&Hc(e[parseInt(a.toString(),10)],1,r,s,o,e.length);r=H.extend(r,s,o),this.parent.editModule.formObj=this.createFormObj(n,t||r)},C.prototype.createFormObj=function(e,t){var n=this;return e.addEventListener("submit",this.preventFormSubmit),new k.FormValidator(e,{rules:t,locale:this.parent.locale,validationComplete:function(e){n.validationComplete(e)},customPlacement:function(e,t){var i=e.getAttribute("data-mappinguid"),i={column:n.parent.getColumnByUid(i),error:t,inputElement:e,value:e.value};(!(event&&event.relatedTarget&&event.relatedTarget.classList.contains("e-cancelbutton"))&&!n.parent.editSettings.showAddNewRow||n.parent.editSettings.showAddNewRow&&event&&event.target&&(I(event.target,n.parent.element.id+"_update",!0)||I(event.target,"e-grid-menu")&&(event.target.classList.contains("e-save")||event.target.querySelector(".e-save"))||n.isShowAddedRowValidate||I(event.target,"e-unboundcell")&&I(event.target,"e-update")||"enter"===event.action&&(I(event.target,"e-content")||I(event.target,"e-addedrow")))||n.parent.editSettings.showAddNewRow&&!H.isNullOrUndefined(n.parent.element.querySelector("."+Os)))&&n.valErrorPlacement(e,t),n.isShowAddedRowValidate=!1,n.parent.notify(Sn,i)}})},C.prototype.preventFormSubmit=function(e){e.preventDefault()},C.prototype.valErrorPlacement=function(e,t){var i,n;this.parent.isEdit&&(i=t.getAttribute("for"),(n=this.getElemTable(e).querySelector("#"+kp(i)+"_Error"))?n.querySelector(".e-tip-content").innerHTML=t.outerHTML:this.createTooltip(e,t,i,""))},C.prototype.getElemTable=function(e){var t=this.parent,e="Dialog"!==t.editSettings.mode?(e=t.frozenRows&&H.closest(e,"."+Ts)&&t.frozenRows>(parseInt(H.closest(e,"."+Ts).getAttribute(D),10)-1||0),this.parent.isFrozenGrid()?t.element:e||t.editSettings.showAddNewRow&&(t.enableVirtualization||t.enableInfiniteScrolling)?t.getHeaderTable():t.getContentTable()):H.select("#"+t.element.id+"_dialogEdit_wrapper",document);return e},C.prototype.resetElemPosition=function(e,t){var i,t=I(t.element,b);t&&(t=t.getBoundingClientRect().right)<(i=e.getBoundingClientRect().right)&&(e.style.left=e.offsetLeft-(i-t)+"px")},C.prototype.validationComplete=function(e){var t,i;this.parent.isEdit&&(t=this.getElemTable(e.element).querySelector("#"+kp(e.inputName)+"_Error"),this.parent.editSettings.showAddNewRow&&!t&&e.element&&(i=I(e.element,"e-rowcell").querySelector(".e-error"))&&i.classList.remove("e-error"),t)&&("failure"===e.status?(t.style.display="",this.resetElemPosition(t,e)):t.style.display="none")},C.prototype.setScrollTop=function(e,t,i){var n=this.parent.getContent().querySelector(".e-content");0===this.parent.currentViewData.length&&0===n.scrollTop?n.scrollTop=e.offsetHeight+t.scrollHeight:i.scrollTop=i.scrollTop+e.offsetHeight+t.scrollHeight},C.prototype.setBottomStyles=function(e,t,i){var n=t.scrollWidth>t.offsetWidth?Op():0,r=-1===this.parent.height.toString().indexOf("%")?parseInt(this.parent.height,10):t.offsetHeight;e.style.bottom=r-t.querySelector("table").offsetHeight-n+i.height+9+"px",this.parent.pinnedTopRowModels.length&&(e.style.bottom=i.height+9+"px")},C.prototype.setPositionStyles=function(e,t,i){e=(this.parent.frozenRows?(e?this.parent.frozenRows+1:this.parent.frozenRows)+(t.length-1):t.length-1)*this.parent.getRowHeight(),t=this.parent.getContent().clientHeight-e;i.style.bottom=9+t+"px"},C.prototype.createTooltip=function(e,t,i,n){var r,s,o,a=this.formObj.element,l=I(e,"e-virtual-validation"),h=(l&&(a=this.virtualFormObj.element),this.parent.getContent().firstElementChild),d=h.scrollHeight>h.clientHeight||h.scrollWidth>h.clientWidth,p="Dialog"!==this.parent.editSettings.mode,c=H.closest(e,"."+b),u=H.closest(e,"."+Ts),g=!1,f=!1,m=this.parent.editSettings.showAddNewRow&&!H.isNullOrUndefined(I(e,As))&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling),y=Math.round(this.parent.getContent().clientHeight/this.parent.getRowHeight())-1,v=[].slice.call(this.parent.getContent().getElementsByClassName(Ts)),g=("Batch"===this.parent.editSettings.mode&&(v=[].slice.call(this.parent.getContent().querySelectorAll(".e-row:not(.e-hiddenrow)")),1<y)&&v.length>y&&parseInt(v[v.length-1].getAttribute(D),10)-1==parseInt(u.getAttribute(D),10)-1&&(f=!0),p&&(((g=(this.parent.frozenRows||this.parent.pinnedTopRowModels.length||m)&&(S=this.parent.editSettings.showAddNewRow?".e-row:not(.e-hiddenrow.e-addedrow)":".e-row:not(.e-hiddenrow)",g=(w=(S=[].slice.call(this.parent.getHeaderTable().querySelector(j).querySelectorAll(S))).length>(parseInt(u.getAttribute(D),10)-1||0))&&parseInt(u.getAttribute(D),10)-1==S.length-1,1===(S=[].slice.call(this.parent.getHeaderTable().querySelector(j).querySelectorAll(".e-row:not(.e-hiddenrow)"))).length)&&(S[0].classList.contains("e-addedrow")||S[0].classList.contains("e-insertedrow"))?!0:g)||1<y&&v.length>y&&("Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType||c.classList.contains("e-lastrowcell")&&!u.classList.contains(As))||f)&&(r=!0),S={isBeginEdit:"beginEdit"===this.editModule.args.requestType,isAddedRow:!!u&&u.classList.contains(As),isLastRow:v&&0<v.length&&u&&u===v[v.length-1],validationPositionResult:!1},this.parent.notify("last-row-validation",S),S.validationPositionResult)&&(r=S.validationPositionResult),p?w?this.parent.getHeaderTable():this.parent.getContentTable():H.select("#"+this.parent.element.id+"_dialogEdit_wrapper .e-dlg-content",document)),f=g.getBoundingClientRect(),u=(p?this.parent.element.getBoundingClientRect():f).left,S=H.closest(e,"td"),C=(S||e.parentElement).getBoundingClientRect(),i=this.parent.createElement("div",{className:"e-tooltip-wrap e-lib e-control e-popup e-griderror",id:i+"_Error"}),n="display:"+n+";top:"+((w?C.top+C.height:C.bottom-f.top)+g.scrollTop+9)+"px;left:"+(C.left-u+g.scrollLeft+C.width/2)+"px;max-width:"+C.width+"px;text-align:center;",w=(H.updateCSSText(i,n),this.parent.cssClass&&i.classList.add(this.parent.cssClass),p&&f.left<u&&(i.style.left=parseInt(i.style.left,10)-f.left+u+"px"),this.parent.createElement("div",{className:"e-tip-content"})),g=(w.appendChild(t),r?((s=this.parent.createElement("div",{className:"e-arrow-tip e-tip-bottom"})).appendChild(this.parent.createElement("div",{className:"e-arrow-tip-outer e-tip-bottom"})),s.appendChild(this.parent.createElement("div",{className:"e-arrow-tip-inner e-tip-bottom"}))):((s=this.parent.createElement("div",{className:"e-arrow-tip e-tip-top"})).appendChild(this.parent.createElement("div",{className:"e-arrow-tip-outer e-tip-top"})),s.appendChild(this.parent.createElement("div",{className:"e-arrow-tip-inner e-tip-top"}))),i.appendChild(w),i.appendChild(s),!l&&(this.parent.frozenRows||this.parent.pinnedTopRowModels.length||m)&&"Dialog"!==this.parent.editSettings.mode?(("Normal"===this.parent.editSettings.mode?H.closest(e,".e-editcell"):H.closest(e,"."+Ds)).style.position="relative",i.style.position="absolute",("Batch"===this.parent.editSettings.mode||H.closest(e,"."+Is)||H.closest(e,"."+Rs)||this.parent.frozenRows||this.parent.pinnedTopRowModels.length||m)&&(this.parent.isFrozenGrid()?c.classList.contains("e-unfreeze")?(H.addClass([i],"e-unfreeze"),a.appendChild(i)):((o=H.closest(c,".e-gridheader")?this.parent.element.querySelector(".e-gridheader"):1===v.length?this.parent.element.querySelector(".e-gridcontent").querySelector(".e-content"):this.parent.element.querySelector(".e-gridcontent")).appendChild(i),o.style.position="relative"):a.appendChild(i))):l?this.virtualFormObj.element.appendChild(i):"Dialog"!==this.parent.editSettings.mode&&this.parent.isFrozenGrid()?c.classList.contains("e-unfreeze")?(H.addClass([i],"e-unfreeze"),this.formObj.element.appendChild(i)):((o=H.closest(c,".e-gridheader")?this.parent.element.querySelector(".e-gridheader"):1===v.length?this.parent.element.querySelector(".e-gridcontent").querySelector(".e-content"):this.parent.element.querySelector(".e-gridcontent")).appendChild(i),o.style.position="relative"):this.formObj.element.appendChild(i),H.isNullOrUndefined(c)||(c.classList.contains("e-fixedfreeze")?i.classList.add("e-fixederror"):(c.classList.contains("e-leftfreeze")||c.classList.contains("e-rightfreeze"))&&i.classList.add("e-freezeerror")),!r&&p&&h.getBoundingClientRect().bottom<C.bottom+C.height&&this.setScrollTop(i,s,h),parseInt(document.defaultView.getComputedStyle(i,null).getPropertyValue("font-size"),10));(this.parent.frozenRows||this.parent.pinnedTopRowModels.length||m)&&"Dialog"!==this.parent.editSettings.mode?i.style.left=S.offsetLeft+(S.offsetWidth/2-i.offsetWidth/2)+"px":i.style.left=parseInt(i.style.left,10)-i.offsetWidth/2+"px",i.getBoundingClientRect().width<C.width&&2<=i.querySelector("label").getBoundingClientRect().height/(1.2*g)&&(i.style.width=i.style.maxWidth),(p&&!d&&!this.parent.allowPaging||this.parent.frozenRows||this.parent.pinnedTopRowModels.length||m)&&(n=F.calculateRelativeBasedPosition(S,i),i.style.top=n.top+C.height+9+"px"),r&&(!d||"auto"===this.parent.height||this.parent.frozenRows&&this.parent.pinnedTopRowModels.length&&m||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||i.classList.contains("e-freezeerror")&&i.classList.contains("e-fixederror")?i.style.bottom=C.height+9+"px":this.setBottomStyles(i,h,C),v.length<y&&"Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType&&this.setPositionStyles(m,v,i),i.style.top=null)},C.prototype.checkColumnIsGrouped=function(e){return!(e.visible||-1<this.parent.groupSettings.columns.indexOf(e.field))},C.AddEditors=function(e){C.editCellType=H.extend(C.editCellType,e)},C.editCellType={dropdownedit:df,numericedit:cf,datepickeredit:Ff,datetimepickeredit:Ff,booleanedit:of,defaultedit:mf,templateedit:Pf,formulaedit:Vf};Pf=C;function C(e,t){this.isShowAddedRowValidate=!1,this.editType={Inline:bf,Normal:bf,Batch:Rf,Dialog:Tf,Cell:zf},this.fieldname="",this.data={},this.editCellDialogClose=!1,H.initializeTelemetryFeature("Edit","DataGrid"),this.parent=e,this.serviceLocator=t,this.l10n=this.serviceLocator.getService("localization"),this.addEventListener(),this.undoRedoModule=new Uf(this.parent),this.updateEditObj(),this.createAlertDlg(),this.createConfirmDlg()}var Gf=function(){return(Gf=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},_f=(w.prototype.destroy=function(){var e=this,t=this.parent.element;(t.querySelector("."+vs)||t.querySelector("."+ms))&&t&&(null!==this.flushToggleTimer&&(clearTimeout(this.flushToggleTimer),this.flushToggleTimer=null),this.toggleQueue&&(this.toggleQueue.clear(),this.toggleQueue=null),this.removeEventListener(),this.unWireEvents(),this.destroyReorder(),this.infiniteLoadedElement=null,this.infiniteDiv=null,H.isNullOrUndefined(this.dlgObj)||!this.dlgObj.element||this.dlgObj.isDestroyed||(this.parent.isReact&&this.parent.columnChooserSettings.template?oe.Global.timer?(clearTimeout(oe.Global.timer),oe.Global.timer=null):oe.Global.timer=setTimeout(function(){H.isNullOrUndefined(e.dlgObj)||!e.dlgObj.element||e.dlgObj.isDestroyed||e.dlgObj.destroy()},0):this.dlgObj.destroy(),t=document.getElementById(this.parent.element.id+"_e-popup"),H.isNullOrUndefined(t))||H.remove(t))},w.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,oe.ResponsiveDialogAction.isColumnChooser),this.parent.enableAdaptiveUI&&(this.parent.on(Xr,this.renderResponsiveColumnChooserDiv,this),this.parent.on(Qr,this.renderResponsiveChangeAction,this))},w.prototype.rtlUpdate=function(){H.isNullOrUndefined(this.innerDiv)||(this.parent.enableRtl?H.addClass([].slice.call(this.innerDiv.getElementsByClassName("e-checkbox-wrapper")),["e-rtl"]):H.removeClass([].slice.call(this.innerDiv.getElementsByClassName("e-checkbox-wrapper")),["e-rtl"]))},w.prototype.addEventListener=function(){!this.parent.isDestroyed&&(H.EventHandler.add(document,"click",this.clickHandler,this),this.parent.on(St,this.enableAfterRenderEle,this),this.parent.on(mt,this.render,this),this.parent.addEventListener(de,this.hideDialogFunction),this.parent.on(s,this.destroy,this),this.parent.on(Ki,this.rtlUpdate,this),this.parent.on(Wn,this.onResetColumns,this),this.parent.on(Sr,this.setFullScreenDialog,this),this.parent.on(wt,this.onPropertyChanged,this),this.parent.enableAdaptiveUI&&this.parent.on(Qr,this.renderResponsiveChangeAction,this),this.infiniteRenderMode||this.parent.enableAdaptiveUI)&&this.parent.on(Xr,this.renderResponsiveColumnChooserDiv,this)},w.prototype.removeEventListener=function(){!this.parent.isDestroyed&&(H.EventHandler.remove(document,"click",this.clickHandler),this.parent.off(mt,this.render),this.parent.off(s,this.destroy),this.parent.off(St,this.enableAfterRenderEle),this.parent.off(Ki,this.rtlUpdate),this.parent.off(Wn,this.onResetColumns),this.parent.removeEventListener(de,this.hideDialogFunction),this.parent.off(Sr,this.setFullScreenDialog),this.infiniteDiv&&(H.EventHandler.remove(this.infiniteDiv,"scroll",this.infiniteScrollHandler),H.EventHandler.remove(this.infiniteDiv,"mouseup",this.infiniteScrollMouseKeyUpHandler),H.EventHandler.remove(this.infiniteDiv,"mousedown",this.infiniteScrollMouseKeyDownHandler)),this.parent.enableAdaptiveUI&&(this.parent.off(Sr,this.setFullScreenDialog),this.parent.off(Qr,this.renderResponsiveChangeAction)),this.infiniteRenderMode||this.parent.enableAdaptiveUI)&&this.parent.off(Xr,this.renderResponsiveColumnChooserDiv)},w.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.parent.enableAdaptiveUI||this.renderDlgContent(),this.getShowHideService=this.serviceLocator.getService("showHideService")},w.prototype.clickHandler=function(e){var t=e.target;if(!this.isCustomizeOpenCC){if(H.isNullOrUndefined(H.closest(t,".e-cc-toolbar"))&&H.isNullOrUndefined(H.closest(t,".e-cc")))H.isNullOrUndefined(this.dlgObj)||!this.dlgObj.visible||t.classList.contains("e-toolbar-items")||(this.dlgObj.hide(),this.clearActions(),this.refreshCheckboxState(),this.isDlgOpen=!1);else if(t.classList.contains("e-columnchooser-btn")||t.classList.contains("e-cc-toolbar")){if(this.initialOpenDlg&&this.dlgObj.visible||!this.isDlgOpen)return void(this.isDlgOpen=!0)}else t.classList.contains("e-cc-cancel")&&(t.parentElement.querySelector(".e-ccsearch").value="",this.columnChooserSearch("",!1),this.removeCancelIcon(),this.refreshCheckboxButton());(this.parent.detailTemplate||this.parent.childGrid)&&(this.targetdlg=e.target)}this.isCustomizeOpenCC&&e.target.classList.contains("e-cc-cancel")&&this.refreshCheckboxState(),this.parent.enableAdaptiveUI?this.parent.enableRtl&&H.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"]):this.rtlUpdate()},w.prototype.hideDialog=function(){!H.isNullOrUndefined(this.dlgObj)&&this.dlgObj.visible&&(this.parent.enableAdaptiveUI?this.responsiveDialogRenderer.hideResponsiveColumnChooser():"Immediate"!==this.parent.columnChooserSettings.mode?(this.dlgObj.hide(),this.isDlgOpen=!1):"Immediate"===this.parent.columnChooserSettings.mode&&this.isEscapePressed&&(this.dlgObj.hide(),this.isDlgOpen=!1,this.isEscapePressed=!1))},w.prototype.renderColumnChooser=function(e,t,i){if(this.dlgObj.visible||this.closeToolPanelChooser()){if(this.dlgObj.visible||!this.parent.detailTemplate&&!this.parent.childGrid||this.hideOpenedDialog(),this.dlgObj.visible)this.hideDialog(),this.addcancelIcon(),this.clearActions(),this.refreshCheckboxState();else{var n=this.beforeOpenColumnChooserEvent();if(n.cancel)return;this.infiniteRenderMode||!this.selectedColumns.length||"None"!==this.sortDirection||this.parent.columnChooserSettings.template||this.setOrderedColumns(),n.columns=null,i&&(this.targetdlg=i),this.infiniteRenderMode&&this.dlgObj.show(),this.refreshCheckboxState(),this.dlgObj.dataBind(),this.dlgObj.element.style.maxHeight="430px";var n=this.dlgObj.element.style.display,r=(this.parent.columnChooserSettings.enableSearching||(this.dlgObj.element.querySelector(".e-dlg-content").style.margin="0px"),this.dlgObj.element.style.display="block",this.parent.getHeaderContent().classList.contains("e-sticky")),s=H.closest(i,".e-toolbar-item"),o=void 0,r=(document.getElementById(this.parent.element.id+"_e-popup")&&document.getElementById(this.parent.element.id+"_e-popup").querySelector(".e-ccdlg")&&this.parent.element.appendChild(this.dlgObj.element),r?(o=s.getBoundingClientRect(),this.dlgObj.element.classList.add("e-sticky")):(this.dlgObj.element.classList.remove("e-sticky"),o=F.calculateRelativeBasedPosition(s,this.dlgObj.element)),this.dlgObj.element.style.display=n,this.dlgObj.element.style.top=o.top+H.closest(i,".e-cc-toolbar").getBoundingClientRect().height+"px",H.isNullOrUndefined(H.closest(i,".e-bigger"))||(this.dlgObj.width=258),H.Browser.isDevice?(this.dlgObj.position={X:"center",Y:"center"},this.dlgObj.refreshPosition(),this.dlgObj.open=this.mOpenDlg.bind(this)):this.parent.enableRtl?this.dlgObj.element.style.left=i.offsetLeft+"px":this.dlgObj.element.style.left=o.left-250+H.closest(i,".e-cc-toolbar").clientWidth+2+"px",this.removeCancelIcon(),this.infiniteRenderMode||this.dlgObj.show(),this.dlgObj.element.getBoundingClientRect());window.innerHeight<r.bottom&&(this.dlgObj.element.style.top=window.innerHeight-r.bottom+parseInt(this.dlgObj.element.style.top,10)-5+"px"),this.parent.getContent().firstElementChild.offsetHeight<this.dlgObj.element.offsetHeight&&!this.parent.element.classList.contains("e-drillthrough-grid")&&(H.isNullOrUndefined(H.closest(i,".e-bigger"))?Ac(this.parent,this.dlgObj):Ac(this.parent,this.dlgObj,258),this.dlgObj.element.querySelector(".e-ccsearch"))&&this.dlgObj.element.querySelector(".e-ccsearch").select(),this.parent.notify(sn,{dialog:this.dlgObj})}this.rtlUpdate()}},w.prototype.openColumnChooser=function(e,t){if(this.isCustomizeOpenCC=!0,this.parent.enableAdaptiveUI){if(!this.isColumnChooserOpen)return void this.parent.showResponsiveCustomColumnChooser();this.isColumnChooserOpen=!1,this.renderDlgContent()}var i;this.dlgObj.visible?this.hideDialog():this.closeToolPanelChooser()&&!(i=this.beforeOpenColumnChooserEvent()).cancel&&(this.infiniteRenderMode||!this.selectedColumns.length||"None"!==this.sortDirection||this.parent.columnChooserSettings.template||this.setOrderedColumns(),i.columns=null,this.infiniteRenderMode&&this.dlgObj.show(),this.isInitialOpen?this.refreshCheckboxState():(this.dlgObj.content=this.renderChooserList(),this.parent.columnChooserSettings.template||this.updateIntermediateBtn()),this.dlgObj.dataBind(),this.infiniteRenderMode&&this.refreshCheckboxState(),this.dlgObj.position={X:"center",Y:"center"},H.isNullOrUndefined(e)?(this.parent.enableAdaptiveUI&&(this.dlgObj.position={X:"",Y:""}),this.dlgObj.refreshPosition()):(this.dlgObj.element.style.top="",this.dlgObj.element.style.left="",this.dlgObj.element.style.top=t+"px",this.dlgObj.element.style.left=e+"px"),this.parent.columnChooserSettings.enableSearching||(this.dlgObj.element.querySelector(".e-dlg-content").style.margin="0px"),this.dlgObj.beforeOpen=this.customDialogOpen.bind(this),this.infiniteRenderMode||this.dlgObj.show(),this.parent.getContent().firstElementChild.offsetHeight<this.dlgObj.element.offsetHeight&&!this.parent.element.classList.contains("e-drillthrough-grid")&&Ac(this.parent,this.dlgObj),this.isInitialOpen=!0,this.dlgObj.beforeClose=this.customDialogClose.bind(this))},w.prototype.enableAfterRenderEle=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},w.prototype.keyUpHandler=function(e){"Escape"===e.key&&(this.isEscapePressed=!0,this.resetColumnState()),e&&e.target&&!H.isNullOrUndefined(H.closest(e.target,".e-grid-popup"))&&this.parent.trigger("keyPressed",e),this.setFocus(I(e.target,"e-cclist"))},w.prototype.getRoot=function(){return this.toolPanelHostElement||this.dlgDiv},w.prototype.getOkButton=function(){var e;return this.toolPanelHostElement?this.toolPanelFooterButtons[0]:(e=(e=this.dlgDiv&&this.dlgDiv.querySelector(".e-footer-content"))&&e.querySelector(".e-btn"))?e.ej2_instances[0]:void 0},w.prototype.setFocus=function(e){var t=this.getRoot().querySelector(".e-colfocus");t&&t.classList.remove("e-colfocus"),e&&e.classList.add("e-colfocus")},w.prototype.customDialogOpen=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");H.EventHandler.add(e,"keyup",this.columnChooserManualSearch,this)},w.prototype.customDialogClose=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");H.EventHandler.remove(e,"keyup",this.columnChooserManualSearch)},w.prototype.getColumns=function(){return(this.infiniteRenderMode?this.infiniteColumns:this.parent.getColumns()).filter(function(e){return"checkbox"!==e.type&&!0===e.showInColumnChooser||"checkbox"===e.type&&void 0!==e.field})},w.prototype.setOrderedColumns=function(){for(var i=this,n=(this.selectedColumnModels=[],this),e=0;e<this.selectedColumns.length;e++)!function(t){var e=n.parent.getColumnByField(n.selectedColumns[parseInt(t.toString(),10)])||n.parent.columnModel.find(function(e){return e.headerText===i.selectedColumns[parseInt(t.toString(),10)]&&"checkbox"!==e.type});e&&e.showInColumnChooser&&n.selectedColumnModels.push(e)}(e)},w.prototype.renderDlgContent=function(){var e=this.parent.enableAdaptiveUI,t="Immediate"===this.parent.columnChooserSettings.mode;this.dlgDiv=this.parent.createElement("div",{className:"e-ccdlg e-cc",id:this.parent.element.id+"_ccdlg"}),e||this.parent.element.appendChild(this.dlgDiv),this.dlgObj=new F.Dialog({header:this.parent.enableAdaptiveUI?null:this.renderHeader(),showCloseIcon:t&&!e,closeOnEscape:!1,locale:this.parent.locale,visible:!1,enableRtl:this.parent.enableRtl,target:document.getElementById(this.parent.element.id),content:this.renderChooserList(),width:250,cssClass:this.parent.cssClass?"e-cc "+this.parent.cssClass:"e-cc",animationSettings:{effect:"None"},footerTemplate:t||this.parent.enableAdaptiveUI?null:this.renderFooter()}),this.renderDialogButtons(t);this.dlgObj.isStringTemplate=!0,this.dlgObj.appendTo(this.dlgDiv),e&&((t=document.querySelector(".e-responsive-dialog > .e-dlg-content > .e-mainfilterdiv"))&&t.appendChild(this.dlgDiv),this.dlgObj.open=this.mOpenDlg.bind(this),this.dlgObj.target=document.querySelector(".e-rescolumnchooser > .e-dlg-content > .e-mainfilterdiv")),this.wireEvents()},w.prototype.renderDialogButtons=function(e){this.parent.enableAdaptiveUI||!this.infiniteRenderMode&&this.parent.columnChooserSettings.footerTemplate||(e?(this.dlgObj.buttons=null,this.dlgObj.footerTemplate=null):this.dlgObj.buttons=[{click:this.confirmDlgBtnClick.bind(this),buttonModel:{content:this.l10n.getConstant("OKButton"),isPrimary:!0,cssClass:this.parent.cssClass?"e-cc e-cc_okbtn "+this.parent.cssClass:"e-cc e-cc_okbtn"}},{click:this.clearBtnClick.bind(this),buttonModel:{cssClass:this.parent.cssClass?"e-flat e-cc e-cc-cnbtn "+this.parent.cssClass:"e-flat e-cc e-cc-cnbtn",content:this.l10n.getConstant("CancelButton")}}])},w.prototype.renderHeader=function(){var e,t;return this.parent.columnChooserSettings.headerTemplate&&!this.infiniteRenderMode?(e=this.parent.createElement("div",{className:"e-columnChooserHeaderTemplate"}),t=this.parent.element.id+"columnChooserHeaderTemplate",this.parent.isReact?(this.parent.getColumnChooserHeaderTemplate()(null,this.parent,"columnChooserHeaderTemplate",t,null,null,e),this.parent.renderTemplates()):Ip(e,this.parent.getColumnChooserHeaderTemplate()(null,this.parent,"columnChooserHeaderTemplate",t)),e):this.l10n.getConstant("ChooseColumns")},w.prototype.renderFooter=function(){var e,t;return this.parent.columnChooserSettings.footerTemplate&&!this.infiniteRenderMode?(e=this.parent.createElement("div",{className:"e-columnChooserFooterTemplate"}),t=this.parent.element.id+"columnChooserFooterTemplate",this.parent.isReact?(this.parent.getColumnChooserFooterTemplate()(null,this.parent,"columnChooserFooterTemplate",t,null,null,e),this.parent.renderTemplates()):Ip(e,this.parent.getColumnChooserFooterTemplate()(null,this.parent,"columnChooserFooterTemplate",t)),e):null},w.prototype.renderChooserList=function(){this.mainDiv=this.parent.createElement("div",{className:"e-main-div e-cc"});var e,t=this.parent.createElement("div",{className:"e-cc-searchdiv e-cc e-input-group"}),i=this.parent.createElement("input",{className:"e-ccsearch e-cc e-input",attrs:{placeholder:this.l10n.getConstant("Search"),cssClass:this.parent.cssClass}}),n=this.parent.createElement("span",{className:"e-ccsearch-icon e-icons e-cc e-input-group-icon",attrs:{title:this.l10n.getConstant("Search")}}),r=this.parent.createElement("div",{className:"e-cc-contentdiv"}),s=(this.innerDiv=this.parent.createElement("div",{className:"e-innerdiv e-cc"}),t.appendChild(i),t.appendChild(n),this.searchBoxObj=new za(i,this.serviceLocator),this.getColumns()),o=[],a=[];if(s.forEach(function(e){(e.visible?o:a).push(e.headerText)}),this.infiniteRenderMode&&!this.isInitialOpen)for(var s=this.parent.columns,l=0;l<s.length;l++)s[parseInt(l.toString(),10)].showInColumnChooser&&this.infiniteColumns.push(s[parseInt(l.toString(),10)]);return this.parent.columnChooserSettings.template&&!this.infiniteRenderMode?((n=this.parent.createElement("div",{className:"e-columnChooserTemplate"})).style.cssText=this.parent.enableAdaptiveUI?"height: 90%; min-height: 160px; overflow-y: auto;":"height: 196px; overflow-y: auto;",i=this.parent.element.id+"columnChooserTemplate",e={columns:s,hideColumns:a,showColumns:o},this.parent.isReact?(this.parent.getColumnChooserTemplate()(e,this.parent,"columnChooserTemplate",i,null,null,n),this.parent.renderTemplates()):Ip(n,this.parent.getColumnChooserTemplate()(e,this.parent,"columnChooserTemplate",i,null,null,null,this.parent.root)),this.parent.columnChooserSettings.renderCustomColumnChooser&&("function"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser?this.parent.columnChooserSettings.renderCustomColumnChooser(n,s):"string"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser&&(this.parent.columnChooserSettings.renderCustomColumnChooser=N(this.parent.columnChooserSettings.renderCustomColumnChooser,window),this.parent.columnChooserSettings.renderCustomColumnChooser(n,s))),this.mainDiv.appendChild(t),this.mainDiv.appendChild(n)):(e=this.refreshCheckboxList(s),this.innerDiv.appendChild(e),r.appendChild(this.innerDiv),this.parent.enableAdaptiveUI?((i=this.parent.createElement("div",{className:"e-cc-searchBox"})).appendChild(t),this.mainDiv.appendChild(i)):this.mainDiv.appendChild(t),this.mainDiv.appendChild(r)),this.parent.columnChooserSettings.enableSearching||(t.style.display="none"),this.initReorder(r),this.mainDiv},w.prototype.confirmDlgBtnClick=function(e){var t,i,n={requestType:"columnVisibilityUpdate",columns:this.getColumns(),cancel:!1};this.parent.trigger(y,n),n.cancel||(n=this.stagedMoves,this.stagedMoves=[],this.stateChangeColumns=[],this.changedStateColumns=[],t=this.infiniteRenderMode?this.infiniteColumns:this.parent.getColumns(),this.changedColumns=0<this.changedColumns.length?this.changedColumns:this.unchangedColumns,this.changedColumnState(this.changedColumns),i=this.infiniteRenderMode?this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-uncheck")}).length:this.ulElement&&this.ulElement.querySelector(".e-uncheck")&&this.ulElement.querySelectorAll(".e-uncheck:not(.e-selectall)").length,H.isNullOrUndefined(e)||(i<t.length&&(this.changeColumnVisibility({visibleColumns:this.showColumn,hiddenColumns:this.hideColumn},"uid"),0===this.parent.getCurrentViewRecords().length)&&this.parent.element.querySelector(".e-emptyrow").querySelector("td").setAttribute("colSpan",this.parent.getVisibleColumns().length.toString()),this.parent.enableAdaptiveUI&&this.parent.scrollModule&&this.parent.scrollModule.refresh(),this.parent.editSettings.showAddNewRow&&this.parent.notify(Yr,{})),this.applyStagedMoves(n),e={requestType:"columnVisibilityUpdate",columns:this.getColumns(),cancel:!1},this.parent.trigger(c,e))},w.prototype.changeColumnVisibility=function(t,i){var e;"uid"!==(i=i||"headerText")&&(t.visibleColumns||t.hiddenColumns)&&(this.stateChangeColumns=[],this.changedStateColumns=[],e=this.getColumns(),t.hiddenColumns=e.filter(function(e){return-1!==t.hiddenColumns.indexOf(e[i])}).map(function(e){return e.uid}),t.visibleColumns=e.filter(function(e){return-1!==t.visibleColumns.indexOf(e[i])}).map(function(e){return e.uid})),t.hiddenColumns.length&&this.columnStateChange(t.hiddenColumns,!1),t.visibleColumns.length&&this.columnStateChange(t.visibleColumns,!0),this.getShowHideService.setVisible(this.stateChangeColumns,this.changedStateColumns),this.clearActions(),this.parent.notify(ai,{module:"edit"})},w.prototype.onResetColumns=function(e){"columnstate"===e.requestType&&this.resetColumnState()},w.prototype.renderResponsiveColumnChooserDiv=function(e){"open"===e.action?(this.isColumnChooserOpen=!0,this.openColumnChooser()):"clear"===e.action?this.clearBtnClick():"confirm"===e.action&&this.confirmDlgBtnClick(!0)},w.prototype.resetColumnState=function(){var e;this.showColumn=[],this.hideColumn=[],this.changedColumns=[],this.filterColumns=[],this.searchValue="",this.selectedColumnModels=[],this.selectedColumns=[],this.sortDirection="",this.infiniteRenderMode&&this.dlgDiv&&(e=this.dlgDiv.querySelector(".e-cclist.e-cc-selectall.e-colfocus"))&&e.classList.remove("e-colfocus"),this.hideDialog()},w.prototype.changedColumnState=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)],i=this.parent.getColumnByUid(i,this.infiniteRenderMode);this.changedStateColumns.push(i)}},w.prototype.columnStateChange=function(e,t){for(var i=0;i<e.length;i++){var n=e[parseInt(i.toString(),10)],n=this.parent.getColumnByUid(n,this.infiniteRenderMode);n&&("checkbox"!==n.type&&(n.visible=t),this.stateChangeColumns.push(n))}},w.prototype.clearActions=function(){this.discardStagedMoves(),this.resetColumnState(),this.addcancelIcon()},w.prototype.clearBtnClick=function(){var e={requestType:"columnChooserClose",cancel:!1};this.parent.trigger(y,e),e.cancel||(this.clearActions(),this.parent.notify(_n,{dialog:this.dlgObj}),this.parent.trigger(c,{requestType:"columnChooserClose",cancel:!1}))},w.prototype.checkstatecolumn=function(e,t,i){void 0===i&&(i=!1);var n=this.parent.getColumnByUid(t,this.infiniteRenderMode);e?(-1!==this.hideColumn.indexOf(t)&&this.hideColumn.splice(this.hideColumn.indexOf(t),1),-1!==this.showColumn.indexOf(t)||n&&n.visible||this.showColumn.push(t)):(-1!==this.showColumn.indexOf(t)&&this.showColumn.splice(this.showColumn.indexOf(t),1),-1===this.hideColumn.indexOf(t)&&n&&n.visible&&this.hideColumn.push(t)),i?(e?this.unchangedColumns:this.changedColumns).push(t):-1!==this.changedColumns.indexOf(t)?this.changedColumns.splice(this.changedColumns.indexOf(t),1):this.changedColumns.push(t)},w.prototype.columnChooserSearch=function(e,t){if(t){var i={requestType:"columnChooserSearch",columns:this.getColumns(),cancel:!1};if(this.parent.trigger(y,i),i.cancel)return}var n,r,s,o,a,l,i=!1,h=this.ulElement&&this.ulElement.querySelector(".e-check")&&this.ulElement.querySelectorAll(".e-check:not(.e-selectall)").length,d=(this.infiniteRenderMode&&(h=this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-check")}).length),this.isInitialOpen=!0,this.getOkButton());""===e?(this.removeCancelIcon(),this.filterColumns=this.selectedColumnModels.length?this.selectedColumnModels:this.getColumns(),i=!0):(n=this.selectedColumnModels.length?this.selectedColumnModels:this.getColumns(),this.filterColumns=new V.DataManager(n).executeLocal((new V.Query).where("headerText",this.searchOperator,e,!0,this.parent.columnChooserSettings.ignoreAccent))),0!==this.selectedColumnModels.length||"None"===this.sortDirection||this.parent.columnChooserSettings.template||(this.filterColumns=this.sortColumnChooser(this.filterColumns,this.sortDirection)),this.infiniteRenderMode&&this.updateIfiniteSelectAll(),this.parent.columnChooserSettings.template&&!this.infiniteRenderMode?(n=void 0,(l=this.parent.isReact)?(Zc(this.parent,["columnChooserTemplate"]),n=this.mainDiv.querySelector(".e-columnChooserTemplate")):(this.mainDiv.querySelector(".e-columnChooserTemplate").remove(),(n=this.parent.createElement("div",{className:"e-columnChooserTemplate"})).style.cssText=this.parent.enableAdaptiveUI?"height: 90%; min-height: 160px; overflow-y: auto;":"height: 196px; overflow-y: auto;"),r=this.parent.element.id+"columnChooserTemplate",a=this.filterColumns,e=e,s=[],o=[],a.forEach(function(e){(e.visible?s:o).push(e.headerText)}),a={columns:a,hideColumns:o,showColumns:s,searchValue:e},l?(this.parent.getColumnChooserTemplate()(a,this.parent,"columnChooserTemplate",r,null,null,n),this.parent.renderTemplates()):Ip(n,this.parent.getColumnChooserTemplate()(a,this.parent,"columnChooserTemplate",r,null,null,null,this.parent.root)),this.parent.columnChooserSettings.renderCustomColumnChooser&&("function"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser?this.parent.columnChooserSettings.renderCustomColumnChooser(n,this.filterColumns):"string"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser&&(this.parent.columnChooserSettings.renderCustomColumnChooser=N(this.parent.columnChooserSettings.renderCustomColumnChooser,window),this.parent.columnChooserSettings.renderCustomColumnChooser(n,this.filterColumns))),this.mainDiv.appendChild(n)):this.filterColumns.length?(this.innerDiv.innerHTML=" ",this.innerDiv.classList.remove("e-ccnmdiv"),this.infiniteInitialLoad=!0,this.infiniteLoadedElement=[],this.innerDiv.appendChild(this.refreshCheckboxList(this.filterColumns)),this.infiniteRenderMode&&(this.mainDiv.querySelector(".e-ccheck .e-selectall").parentElement.classList.remove("e-checkbox-disabled"),this.updateIntermediateBtn()),i||"Immediate"===this.parent.columnChooserSettings.mode?(d&&h&&(d.disabled=!1),h&&this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(gr,{disabled:!1})):(this.addcancelIcon(),this.refreshCheckboxButton())):((e=this.parent.createElement("span",{className:"e-cc e-nmatch"})).innerHTML=this.l10n.getConstant("Matchs"),this.innerDiv.innerHTML=" ",this.infiniteRenderMode&&(H.removeClass([this.mainDiv.querySelector(".e-frame.e-selectall")],["e-check","e-stop","e-uncheck"]),this.mainDiv.querySelector(".e-ccheck .e-selectall").parentElement.classList.add("e-checkbox-disabled")),this.innerDiv.appendChild(e),this.innerDiv.classList.add("e-ccnmdiv"),d&&(d.disabled=!0),this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(gr,{disabled:!0})),this.flag=!0,this.stopTimer(),t&&(l={requestType:"columnChooserSearch",columns:this.getColumns(),cancel:!1},this.parent.trigger(c,l))},w.prototype.sortColumnChooser=function(e,t){return"Ascending"===t?e.slice().sort(function(e,t){return e.field.toLowerCase()<t.field.toLowerCase()?-1:1}):"Descending"===t?e.slice().sort(function(e,t){return e.field.toLowerCase()>t.field.toLowerCase()?-1:1}):e},w.prototype.updateIfiniteSelectAll=function(){this.changedColumns=[],this.hideColumn=[],this.showColumn=[];for(var e=this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-uncheck")}),t=0;t<e.length;t++)this.checkState(e[parseInt(t.toString(),10)].querySelector(".e-frame"),!0)},w.prototype.isToolPanelChooserEnabled=function(){return!this.parent.enableAdaptiveUI&&!!this.dlgObj},w.prototype.closeDialogIfOpen=function(){this.dlgObj&&!this.dlgObj.isDestroyed&&this.dlgObj.visible&&(this.dlgObj.hide(),this.clearActions(),this.refreshCheckboxState(),this.isDlgOpen=!1)},w.prototype.closeToolPanelChooser=function(){var e=this.parent.sideBarModule;return!e||!e.getOpenedToolPanel||"columns"!==e.getOpenedToolPanel()||(e.closeToolPanel(),"columns"!==e.getOpenedToolPanel())},w.prototype.renderToolPanelColumnChooser=function(e,t){var i=this;this.releaseToolPanelChooser(),this.closeDialogIfOpen(),this.resetColumnState(),this.toolPanelHostElement=e,this.onToolPanelClose=t,H.addClass([e],["e-ccdlg","e-cc","e-toolpanel-cc-host"]),this.parent.cssClass&&H.addClass([e],this.parent.cssClass.split(" ").filter(function(e){return!!e})),e.setAttribute("id",this.parent.element.id+"_toolpanel_ccdlg"),e.appendChild(this.renderChooserList()),"Immediate"!==this.parent.columnChooserSettings.mode&&(this.toolPanelFooterButtons=yu(e,[{content:this.l10n.getConstant("OKButton"),isPrimary:!0,cssClass:"e-cc e-cc_okbtn",click:function(){i.confirmDlgBtnClick({}),i.refreshToolPanelChooser()}},{content:this.l10n.getConstant("CancelButton"),cssClass:"e-flat e-cc e-cc-cnbtn",click:function(){i.clearBtnClick(),i.refreshCheckboxState()}}])),this.parent.columnChooserSettings.template||this.updateIntermediateBtn(),H.EventHandler.add(e,"click",this.checkBoxClickHandler,this),H.EventHandler.add(e,"keyup",this.keyUpHandler,this),this.isReorderEnabled()&&H.EventHandler.add(e,"keydown",this.reorderKeyDownHandler,this),H.EventHandler.add(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch,this),this.searchBoxObj.wireEvent(),this.isInitialOpen=!0},w.prototype.refreshToolPanelChooser=function(){var e,t;this.toolPanelHostElement&&(e=this.toolPanelHostElement,t=this.onToolPanelClose,this.renderToolPanelColumnChooser(e,t))},w.prototype.releaseToolPanelChooser=function(){var e;this.toolPanelHostElement&&(e=this.toolPanelHostElement,H.EventHandler.remove(e,"click",this.checkBoxClickHandler),H.EventHandler.remove(e,"keyup",this.keyUpHandler),H.EventHandler.remove(e,"keydown",this.reorderKeyDownHandler),this.searchBoxObj&&(H.EventHandler.remove(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch),this.searchBoxObj.unWireEvent()),this.discardStagedMoves(),this.destroyReorder(),vu(e,this.toolPanelFooterButtons,["e-ccdlg","e-cc","e-toolpanel-cc-host"]),this.toolPanelFooterButtons=[],this.toolPanelHostElement=null,this.onToolPanelClose=null,this.showColumn=[],this.hideColumn=[],this.changedColumns=[],this.unchangedColumns=[],this.filterColumns=[],this.selectedColumnModels=[],this.searchValue="",this.dlgObj)&&!this.dlgObj.isDestroyed&&this.dlgObj.element&&(this.dlgObj.content=this.renderChooserList(),this.dlgObj.dataBind(),H.EventHandler.add(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch,this),this.searchBoxObj.wireEvent(),this.isInitialOpen=!1)},w.prototype.isReorderEnabled=function(){var e=this.parent,t=e.columnChooserSettings;return!!t.allowReordering&&!(!e.allowReordering||!e.reorderModule||t.template||this.infiniteRenderMode)},w.prototype.warnReorderIgnored=function(){var e=this.parent,t=e.columnChooserSettings;t.allowReordering&&!this.isReorderEnabled()&&(t=t.template?"columnChooserSettings.template is used.":"The grid allowReordering property must be enabled and the Reorder module must be injected.",e.log("column_chooser_reorder",{reason:t}))},w.prototype.initReorder=function(e){this.destroyReorder(),this.warnReorderIgnored(),!!!this.parent.columnChooserSettings.allowReordering||this.parent.columnChooserSettings.template||this.infiniteRenderMode||(this.reorderDraggable=new H.Draggable(e,{dragTarget:".e-cc-drag",distance:5,enableTailMode:!0,helper:this.reorderHelper.bind(this),dragStart:this.reorderDragStart.bind(this),drag:this.reorderDrag.bind(this),dragStop:this.reorderDragStop.bind(this)}))},w.prototype.destroyReorder=function(){this.reorderDraggable&&!this.reorderDraggable.isDestroyed&&this.reorderDraggable.destroy(),this.reorderDraggable=null},w.prototype.getColumnFromListItem=function(e){return e&&e.id?this.parent.getColumnByUid(e.id.replace("e-ccli_","")):void 0},w.prototype.reorderHelper=function(){var e=this.reorderDraggable.currentStateTarget,t=I(e,"e-cclist");if(!t||"true"===e.getAttribute("aria-disabled")||!this.getColumnFromListItem(t))return!1;this.draggedListItem=t;e=this.parent.createElement("div",{className:"e-cloneproperties e-dragclone e-cc-dragclone e-defaultcur "+(this.parent.cssClass||"")});return e.textContent=t.querySelector(".e-label").textContent,(this.toolPanelHostElement?this.parent:this.dlgObj).element.appendChild(e),e},w.prototype.reorderDragStart=function(){var e=this.getColumnFromListItem(this.draggedListItem);this.parent.trigger(Ie,{target:this.draggedListItem,draggableType:"columnchooser",column:e})},w.prototype.clearDropIndicator=function(){this.dropTargetListItem&&H.removeClass([this.dropTargetListItem],["e-cc-drop-above","e-cc-drop-below"]),this.dropTargetListItem=null},w.prototype.canMove=function(e,t,i){var n=this.parent.columns,n=!!e&&!!t&&e!==t&&e.allowReordering&&!e.lockColumn&&t.allowReordering&&!t.lockColumn&&-1<n.indexOf(e)&&-1<n.indexOf(t)&&!!e.isFrozen==!!t.isFrozen;return!n&&i&&e&&t&&e!==t&&this.parent.log("action_disabled_column",{moduleName:"reorder",column:e,destColumn:t}),n},w.prototype.reorderDrag=function(e){this.clearDropIndicator(),this.isDropAllowed=!1;var t,i=e.element||this.parent.element.querySelector(".e-cc-dragclone"),n=I(e.target,"e-cclist"),r=this.getColumnFromListItem(n),s=this.getColumnFromListItem(this.draggedListItem),o=this.toolPanelHostElement?I(e.target,"e-toolpanel-zone"):null;this.dropContainer&&this.dropContainer!==o&&H.removeClass([this.dropContainer],["e-toolpanel-zone-over"]),this.dropContainer=null,o&&s&&this.parent.sideBarModule.canDropOnZone(o.getAttribute("data-zone"),s)?(this.dropContainer=o,this.isDropAllowed=!0,H.addClass([o],["e-toolpanel-zone-over"])):n&&this.mainDiv.contains(n)&&r&&(o=n.getBoundingClientRect(),t=(t=e.event.changedTouches)?t[0]:e.event,this.dropAfterTarget=t.clientY>o.top+o.height/2,this.isDropAllowed=this.isReorderEnabled()&&this.canMove(s,r,!1),this.isDropAllowed)&&(this.dropTargetListItem=n,H.addClass([n],[this.dropAfterTarget?"e-cc-drop-below":"e-cc-drop-above"])),i&&H.classList(i,this.isDropAllowed?["e-defaultcur"]:["e-notallowedcur"],this.isDropAllowed?["e-notallowedcur"]:["e-defaultcur"]),this.parent.trigger(Re,{target:e.target,draggableType:"columnchooser",column:s})},w.prototype.reorderDragStop=function(e){var t=this.getColumnFromListItem(this.draggedListItem),i=this.dropTargetListItem,n=this.dropAfterTarget,r=this.getColumnFromListItem(i),s=this.isDropAllowed,o=this.dropContainer;o?(H.removeClass([o],["e-toolpanel-zone-over"]),this.dropContainer=null,this.isDropAllowed=!1,H.remove(e.helper),s&&t&&this.parent.sideBarModule.dropOnZone(o.getAttribute("data-zone"),t)):(this.clearDropIndicator(),this.isDropAllowed=!1,H.remove(e.helper),s&&t&&r&&this.isReorderEnabled()&&(this.moveItem(this.draggedListItem,i,n),this.parent.trigger(xe,{target:i,draggableType:"columnchooser",column:t}))),this.draggedListItem=null},w.prototype.moveItem=function(e,t,i){var n=this,r=e.id.replace("e-ccli_",""),s=t.id.replace("e-ccli_","");t.parentElement.insertBefore(e,i?t.nextSibling:t),this.announceMove(e),"Immediate"===this.parent.columnChooserSettings.mode?window.setTimeout(function(){n.parent.isDestroyed||n.applyMove({uid:r,targetUid:s,after:i})},this.parent.columnChooserSettings.immediateModeDelay):this.stagedMoves.push({uid:r,targetUid:s,after:i})},w.prototype.applyMove=function(e){var t,i;this.isReorderEnabled()&&(t=this.parent.getColumnByUid(e.uid),i=this.parent.getColumnByUid(e.targetUid),this.canMove(t,i,!1))&&(i=this.parent.columns.filter(function(e){return e!==t}).indexOf(i)+(e.after?1:0),this.parent.reorderModule.reorderColumnByTargetIndex(t.field,i))},w.prototype.applyStagedMoves=function(e){var t=this;e.forEach(function(e){return t.applyMove(e)})},w.prototype.discardStagedMoves=function(){var t=this;this.stagedMoves.length&&(this.stagedMoves=[],this.ulElement)&&this.getColumns().forEach(function(e){e=t.ulElement.querySelector('[id="e-ccli_'+e.uid+'"]');e&&t.ulElement.appendChild(e)})},w.prototype.announceMove=function(e){var t=this.mainDiv.querySelector(".e-cc-live"),i=(t||(t=this.parent.createElement("div",{className:"e-cc-live",attrs:{role:"status","aria-live":"polite"}}),this.mainDiv.appendChild(t)),[].slice.call(this.ulElement.querySelectorAll('li[id^="e-ccli_"]')).indexOf(e)+1);t.textContent=this.l10n.getConstant("ColumnChooserMoved").replace("{0}",e.querySelector(".e-label").textContent).replace("{1}",i.toString())},w.prototype.reorderKeyDownHandler=function(e){var t,i,n,r;this.isReorderEnabled()&&e.altKey&&("ArrowUp"===e.key||"ArrowDown"===e.key)&&(i=(t=I(e.target,"e-cclist"))&&t.querySelector(".e-cc-drag"))&&"true"!==i.getAttribute("aria-disabled")&&(n=(i="ArrowUp"===e.key)?t.previousElementSibling:t.nextElementSibling)&&n.id&&(e.preventDefault(),this.canMove(this.getColumnFromListItem(t),this.getColumnFromListItem(n),!0))&&(this.moveItem(t,n,!i),r=t.querySelector("input"))&&r.focus()},w.prototype.wireEvents=function(){H.EventHandler.add(this.dlgObj.element,"click",this.checkBoxClickHandler,this),H.EventHandler.add(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch,this),H.EventHandler.add(this.dlgObj.element,"keyup",this.keyUpHandler,this),this.isReorderEnabled()&&H.EventHandler.add(this.dlgObj.element,"keydown",this.reorderKeyDownHandler,this),this.searchBoxObj.wireEvent()},w.prototype.unWireEvents=function(){this.parent.isDestroyed||(this.dlgObj&&this.dlgObj.element&&(H.EventHandler.remove(this.dlgObj.element,"click",this.checkBoxClickHandler),H.EventHandler.remove(this.dlgObj.element,"keyup",this.keyUpHandler),H.EventHandler.remove(this.dlgObj.element,"keydown",this.reorderKeyDownHandler)),this.searchBoxObj&&(H.EventHandler.remove(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch),this.searchBoxObj.unWireEvent()))},w.prototype.checkBoxClickHandler=function(e){var t;if(!this.parent.columnChooserSettings.template||this.infiniteRenderMode)if(e.target.classList.contains("e-cc-drag"))e.preventDefault();else{var i=I(e.target,"e-checkbox-wrapper"),n=this.infiniteRenderMode?this.infiniteColumns:this.parent.getColumns();if(i){i.querySelector(".e-selectall")?this.updateSelectAll(!i.querySelector(".e-check")):Kp(i.parentElement),i.querySelector(".e-chk-hidden").focus(),i.querySelector(".e-check")?t=!0:i.querySelector(".e-uncheck")&&(t=!1),this.infiniteRenderMode||this.updateIntermediateBtn();var r=I(i,"e-ccheck").getAttribute("data-uid"),s=this.searchValue&&this.searchValue.length||this.selectedColumnModels.length?this.filterColumns:n;if(r===this.parent.element.id+"-selectAll"){this.changedColumns=[],this.unchangedColumns=[];for(var o=0;o<s.length;o++)s[parseInt(o.toString(),10)].showInColumnChooser&&(this.checkstatecolumn(t,s[parseInt(o.toString(),10)].uid,!0),"Immediate"===this.parent.columnChooserSettings.mode)&&this.applyImmediateColumnToggle(s[parseInt(o.toString(),10)].uid,t)}else this.checkstatecolumn(t,r),"Immediate"===this.parent.columnChooserSettings.mode&&this.applyImmediateColumnToggle(r,t);n=!!(this.infiniteRenderMode&&i.querySelector(".e-selectall")&&i.querySelector(".e-uncheck"));this.parent.columnChooserSettings.footerTemplate||"Immediate"===this.parent.columnChooserSettings.mode||this.refreshCheckboxButton(n),this.setFocus(I(e.target,"e-cclist")),this.infiniteRenderMode&&this.updateIntermediateBtn()}}},w.prototype.applyImmediateColumnToggle=function(e,t){var i=this;this.toggleQueue||(this.toggleQueue=new Map),this.toggleQueue.set(e,t),null!==this.flushToggleTimer&&clearTimeout(this.flushToggleTimer),this.flushToggleTimer=window.setTimeout(function(){i.flushImmediateToggles()},this.parent.columnChooserSettings.immediateModeDelay)},w.prototype.flushImmediateToggles=function(){var e,n=this;this.toggleQueue&&0!==this.toggleQueue.size&&(e={requestType:"columnVisibilityUpdate",columns:this.getColumns(),cancel:!1},this.parent.trigger(y,e),e.cancel||(this.stateChangeColumns=[],this.changedStateColumns=[],this.toggleQueue.forEach(function(e,t){var i=(n.infiniteRenderMode?n.infiniteColumns:n.parent.getColumns()).find(function(e){return e.uid===t});i&&"checkbox"!==i.type&&(n.columnStateChange([t],e),n.parent.trigger(Kt,{columnField:i.field,visible:e,source:"column-chooser",timestamp:Date.now()}))}),this.getShowHideService.setVisible(this.stateChangeColumns,this.changedStateColumns),e={requestType:"columnVisibilityUpdate",columns:this.getColumns(),cancel:!1},this.parent.trigger(c,e)),this.toggleQueue.clear(),this.flushToggleTimer=null)},w.prototype.updateIntermediateBtn=function(){var e,t=this.infiniteRenderMode?this.infiniteLoadedElement.length:this.ulElement.children.length-1,i=[],n=0,r=0,s=((this.searchValue&&this.searchValue.length||"None"!==this.sortDirection?this.filterColumns:this.infiniteColumns).filter(function(e){!1===e.visible?n++:r++}),(this.infiniteRenderMode&&this.mainDiv.querySelector(".e-cc-selectall")?this.mainDiv.querySelector(".e-cc-selectall"):this.ulElement.children[0]).querySelector(".e-frame")),o=(this.infiniteRenderMode?this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-check")}):this.ulElement.querySelectorAll(".e-check:not(.e-selectall)")).length,a=(this.toolPanelHostElement&&this.toolPanelFooterButtons.length?this.toolPanelFooterButtons[0].disabled=!1:!this.parent.enableAdaptiveUI&&!this.parent.columnChooserSettings.footerTemplate&&"Immediate"!==this.parent.columnChooserSettings.mode&&this.dlgObj&&this.dlgObj.btnObj&&this.dlgObj.btnObj.length?(e=this.dlgObj.btnObj[0]).disabled=!1:this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(gr,{disabled:!1}),s.parentElement.querySelector("input"));t===o&&(!this.infiniteRenderMode||this.infiniteRenderMode&&n===this.showColumn.length)?(i=["e-check"],Wp(a,!0)):o||this.infiniteRenderMode&&!o&&r!==this.hideColumn.length?(i=["e-stop"],a.indeterminate=!0):(Wp(a,!(i=["e-uncheck"])),e&&!this.parent.enableAdaptiveUI?e.disabled=!0:this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(gr,{disabled:!0})),e&&!this.parent.enableAdaptiveUI&&e.dataBind(),H.removeClass([s],["e-check","e-stop","e-uncheck"]),H.addClass([s],i)},w.prototype.updateSelectAll=function(e){var t=[].slice.call(this.ulElement.getElementsByClassName("e-frame"));this.infiniteRenderMode&&(t=[],this.infiniteLoadedElement.map(function(e){return t.push(e.querySelector(".e-frame"))}),t.unshift(this.mainDiv.querySelector(".e-cc-selectall").querySelector(".e-frame")));for(var i=0,n=t;i<n.length;i++){var r=n[i],s=(Xp(r,e),r.parentElement.querySelector("input"));r.classList.contains("e-check")?Wp(s,!0):r.classList.contains("e-uncheck")&&Wp(s,!1)}},w.prototype.refreshCheckboxButton=function(e){for(var t=this.parent.getVisibleColumns(),i=0;i<t.length;i++){var n=t[parseInt(i.toString(),10)].uid;-1===this.prevShowedCols.indexOf(n)&&"checkbox"!==t[parseInt(i.toString(),10)].type&&this.prevShowedCols.push(n)}for(i=0;i<this.hideColumn.length;i++){var r=this.prevShowedCols.indexOf(this.hideColumn[parseInt(i.toString(),10)]);-1!==r&&this.prevShowedCols.splice(r,1)}for(var s,o=0!==this.showColumn.length?1:this.prevShowedCols.length,a=(this.infiniteRenderMode&&(o=this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-uncheck")}).length),this.parent.enableAdaptiveUI||"Immediate"===this.parent.columnChooserSettings.mode?this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(gr,{disabled:!1}):(s=this.getOkButton())&&(s.disabled=!1),[]),l=[].slice.call(document.getElementsByClassName("e-cc-chbox")),i=0,h=l.length;i<h;i++){var d=l[parseInt(i.toString(),10)];this.infiniteRenderMode&&d.classList.contains("e-selectall")||(n=I(d,"e-ccheck").getAttribute("data-uid"),a.push(n))}var p=this.showColumn.filter(function(e){return-1!==a.indexOf(e)});(this.infiniteRenderMode&&(e||a.length===o)||!this.infiniteRenderMode&&0===o&&0===p.length)&&(!this.parent.enableAdaptiveUI&&s&&"Immediate"!==this.parent.columnChooserSettings.mode?s.disabled=!0:this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(gr,{disabled:!0})),!this.parent.enableAdaptiveUI&&s&&"Immediate"!==this.parent.columnChooserSettings.mode&&s.dataBind()},w.prototype.refreshCheckboxList=function(e){this.ulElement=this.parent.createElement("ul",{className:"e-ccul-ele e-cc"});var t=this.l10n.getConstant("SelectAll"),i=this.parent.createElement("li",{className:"e-cclist e-cc e-cc-selectall"}),t=(H.updateCSSText(i,this.infiniteRenderMode?"list-style: None;":""),this.createCheckBox(t,!1,this.parent.element.id+"-selectAll"));return e.length&&(t.querySelector(".e-checkbox-wrapper").firstElementChild.classList.add("e-selectall"),t.querySelector(".e-frame").classList.add("e-selectall"),this.checkState(t.querySelector(".e-icons"),!0),i.appendChild(t),this.infiniteRenderMode?this.mainDiv.querySelector(".e-cc-contentdiv")&&!this.mainDiv.querySelector(".e-cc-selectall")&&(this.infiniteDiv=this.mainDiv.querySelector(".e-cc-contentdiv"),this.mainDiv.insertBefore(i,this.infiniteDiv),this.infiniteDiv.classList.add("e-checkbox-infinitescroll"),H.EventHandler.add(this.infiniteDiv,"scroll",this.infiniteScrollHandler,this),H.EventHandler.add(this.infiniteDiv,"mouseup",this.infiniteScrollMouseKeyUpHandler,this),H.EventHandler.add(this.infiniteDiv,"mousedown",this.infiniteScrollMouseKeyDownHandler,this)):this.ulElement.appendChild(i)),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?H.addClass([t],this.parent.cssClass.split(" ")):H.addClass([t],[this.parent.cssClass])),this.infiniteRenderMode&&e.length>3*this.itemsCount&&(this.infiniteSkipCount=2*this.itemsCount),this.renderCheckbox(e.slice(0,this.infiniteRenderMode?3*this.itemsCount:e.length)),this.ulElement},w.prototype.infiniteScrollMouseKeyDownHandler=function(){H.EventHandler.remove(this.infiniteDiv,"scroll",this.infiniteScrollHandler)},w.prototype.infiniteScrollMouseKeyUpHandler=function(e){var t=this,i=(H.EventHandler.add(this.infiniteDiv,"scroll",this.infiniteScrollHandler,this),this.infiniteDiv);1<this.ulElement.children.length&&(i.scrollTop>=i.scrollHeight-i.offsetHeight||i.scrollTop<=0)&&this.infiniteScrollHandler(),oe.Global.timer=setTimeout(function(){t.clickHandler(e),oe.Global.timer=null},0)},w.prototype.infiniteScrollHandler=function(){var e,t,i=this.infiniteDiv,n=this.searchValue&&this.searchValue.length||"None"!==this.sortDirection?this.filterColumns:this.infiniteColumns;i.scrollTop>=i.scrollHeight-i.offsetHeight&&this.infiniteLoadedElement.length<=this.infiniteSkipCount+this.itemsCount&&this.ulElement.children.length===3*this.itemsCount&&(!n.length||n.length>this.infiniteSkipCount+this.itemsCount)?(t=0,(e=n.length-(this.infiniteSkipCount+this.itemsCount))<this.itemsCount&&(t=e),Jc([].slice.call(this.ulElement.children).splice(0,this.itemsCount)),this.infiniteInitialLoad=!0,this.infiniteSkipCount+=this.itemsCount,this.renderCheckbox(n.slice(this.infiniteSkipCount,this.infiniteSkipCount+(t+this.itemsCount))),this.prevInfiniteScrollDirection="down"):i.scrollTop>=i.scrollHeight-i.offsetHeight&&this.infiniteLoadedElement.length>this.infiniteSkipCount+this.itemsCount&&this.ulElement.children.length===3*this.itemsCount?(Jc([].slice.call(this.ulElement.children).splice(0,this.itemsCount)),this.infiniteSkipCount+="down"===this.prevInfiniteScrollDirection?this.itemsCount:3*this.itemsCount,Ip(this.ulElement,this.infiniteLoadedElement.slice(this.infiniteSkipCount,this.itemsCount+this.infiniteSkipCount)),this.prevInfiniteScrollDirection="down"):0===i.scrollTop&&!this.infiniteInitialLoad&&this.infiniteSkipCount&&this.infiniteLoadedElement.length&&this.infiniteLoadedElement.length>3*this.itemsCount&&this.ulElement.children.length===3*this.itemsCount?(Jc([].slice.call(this.ulElement.children).splice(2*this.itemsCount,this.itemsCount)),this.infiniteSkipCount-="up"===this.prevInfiniteScrollDirection?this.itemsCount:3*this.itemsCount,eu([].slice.call(this.infiniteLoadedElement.slice(this.infiniteSkipCount,this.infiniteSkipCount+this.itemsCount)),this.ulElement),this.prevInfiniteScrollDirection="up",this.infiniteDiv.scrollTop=this.infiniteScrollAppendDiff):0===i.scrollTop&&!this.infiniteInitialLoad&&this.infiniteSkipCount&&this.infiniteSkipCount>2*this.itemsCount&&this.infiniteLoadedElement.length&&this.ulElement.children.length<3*this.itemsCount&&this.extendInfiniteRemoveElements(n)},w.prototype.extendInfiniteRemoveElements=function(e){Jc([].slice.call(this.ulElement.children).splice(2*this.itemsCount,e.length%this.itemsCount)),this.infiniteSkipCount=(Math.floor(e.length/this.itemsCount)-3)*this.itemsCount,eu([].slice.call(this.infiniteLoadedElement.slice(this.infiniteSkipCount,this.infiniteSkipCount+this.itemsCount)),this.ulElement),this.infiniteDiv.scrollTop=this.infiniteScrollAppendDiff,this.prevInfiniteScrollDirection="up"},w.prototype.refreshCheckboxState=function(){if(this.parent.columnChooserSettings.enableSearching||this.selectedColumnModels.length||"None"!==this.sortDirection)for(var e=(this.toolPanelHostElement||this.dlgObj.element).querySelector(".e-cc.e-input"),t=(e&&(e.value=""),this.columnChooserSearch("",!1),this.parent),i=(this.toolPanelHostElement||this.dlgObj.element).querySelectorAll(".e-cc-chbox:not(.e-selectall)"),n=0,r=i.length;n<r;n++){var s=i[parseInt(n.toString(),10)],o=void 0,o=(this.parent.childGrid||this.parent.detailTemplate?I((this.toolPanelHostElement||this.dlgObj.element).querySelectorAll(".e-cc-chbox:not(.e-selectall)")[parseInt(n.toString(),10)],"e-ccheck"):I(s,"e-ccheck")).getAttribute("data-uid"),o=t.getColumnByUid(o,this.infiniteRenderMode),a=[].slice.call(s.parentElement.getElementsByClassName("e-uncheck"));o.visible&&!a.length?(s.checked=!0,this.checkState(s.parentElement.querySelector(".e-icons"),!0)):(s.checked=!1,this.checkState(s.parentElement.querySelector(".e-icons"),!1))}},w.prototype.checkState=function(e,t){t?H.classList(e,["e-check"],["e-uncheck"]):H.classList(e,["e-uncheck"],["e-check"])},w.prototype.createCheckBox=function(e,t,i){var n=(t?this.cBoxTrue:this.cBoxFalse).cloneNode(!0),r=(this.parent.enableAdaptiveUI||!this.parent.enableRtl||n.classList.contains("e-rtl")||n.classList.add("e-rtl"),n.querySelector(".e-label")),s=n.querySelector("input");return Wp(s,t),r.setAttribute("id",i+"label"),r.innerHTML=e,s.setAttribute("aria-labelledby",r.id),Qp(i,n,"e-ccheck")},w.prototype.renderCheckbox=function(e){for(var t,i=this.parent.createElement("div"),n=this.ulElement.offsetHeight,r=0;r<e.length;r++){var s,o,a,l=e[parseInt(r.toString(),10)];l.showInColumnChooser&&((s=this.parent.createElement("li",{className:"e-cclist e-cc",id:"e-ccli_"+l.uid})).style.listStyle="none",o=-1!==this.hideColumn.indexOf(l.uid),a=-1!==this.showColumn.indexOf(l.uid),o=this.createCheckBox(l.headerText,l.visible&&!o||a,l.uid),s.appendChild(o),!this.parent.columnChooserSettings.allowReordering||this.parent.columnChooserSettings.template||this.infiniteRenderMode||(a=this.parent.createElement("span",{className:"e-icons e-icon-rowdragicon e-cc-drag",attrs:{"aria-disabled":this.searchValue||this.sortDirection&&"None"!==this.sortDirection?"true":"false"}}),(l=o.querySelector(".e-checkbox-wrapper")).insertBefore(a,l.querySelector(".e-label"))),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?H.addClass([o],this.parent.cssClass.split(" ")):H.addClass([o],[this.parent.cssClass])),this.infiniteRenderMode&&this.infiniteDiv&&(s.style.height=tu(this.infiniteDiv,!0)+"px"),i.appendChild(s))}this.infiniteRenderMode&&this.infiniteInitialLoad&&((t=this.infiniteLoadedElement).push.apply(t,[].slice.call(i.children)),this.infiniteInitialLoad=!1),Ip(this.ulElement,[].slice.call(i.children)),this.infiniteRenderMode&&!this.infiniteScrollAppendDiff&&(this.infiniteScrollAppendDiff=this.ulElement.offsetHeight-n),this.isInitialOpen&&this.updateIntermediateBtn()},w.prototype.columnChooserManualSearch=function(e){this.addcancelIcon(),this.searchValue=e.target.value,this.stopTimer(),this.startTimer(e)},w.prototype.startTimer=function(e){var t=this,e=t.flag||13===e.keyCode?0:500;this.timer=window.setInterval(function(){t.columnChooserSearch(t.searchValue,!0)},e)},w.prototype.stopTimer=function(){window.clearInterval(this.timer)},w.prototype.addcancelIcon=function(){this.getRoot()&&this.getRoot().querySelector(".e-cc.e-ccsearch-icon")&&(this.getRoot().querySelector(".e-cc.e-ccsearch-icon").classList.add("e-cc-cancel"),this.getRoot().querySelector(".e-cc-cancel").setAttribute("title",this.l10n.getConstant("Clear")))},w.prototype.removeCancelIcon=function(){this.getRoot()&&this.getRoot().querySelector(".e-cc.e-ccsearch-icon")&&(this.getRoot().querySelector(".e-cc.e-ccsearch-icon").classList.remove("e-cc-cancel"),this.getRoot().querySelector(".e-cc.e-ccsearch-icon").setAttribute("title",this.l10n.getConstant("Search")))},w.prototype.mOpenDlg=function(){H.Browser.isDevice&&(this.dlgObj.element.querySelector(".e-cc-searchdiv")&&this.dlgObj.element.querySelector(".e-cc-searchdiv").classList.remove("e-input-focus"),this.dlgObj.element.querySelectorAll(".e-cc-chbox")[0])&&this.dlgObj.element.querySelectorAll(".e-cc-chbox")[0].focus(),this.parent.enableAdaptiveUI&&this.dlgObj.element.querySelector(".e-cc-searchdiv")&&this.dlgObj.element.querySelector(".e-cc-searchdiv").classList.add("e-input-focus")},w.prototype.getModuleName=function(){return"columnChooser"},w.prototype.hideOpenedDialog=function(){for(var e=[].slice.call(document.getElementsByClassName("e-ccdlg")).filter(function(e){return e.classList.contains("e-popup-open")}),t=0,i=e.length;t<i;t++)this.parent.element.id+"_ccdlg"===e[parseInt(t.toString(),10)].id&&!e[parseInt(t.toString(),10)].classList.contains("e-dialog")||e[parseInt(t.toString(),10)].ej2_instances[0].hide()},w.prototype.beforeOpenColumnChooserEvent=function(){var e=Gf({requestType:"beforeOpenColumnChooser",element:this.parent.element,columns:this.getColumns(),cancel:!1,searchOperator:this.parent.columnChooserSettings.operator,sortDirection:"None"},this.parent.enableColumnVirtualization?{}:{selectedColumns:[]});return this.parent.trigger($e,e),this.searchOperator=e.searchOperator,this.sortDirection=e.sortDirection,this.parent.enableColumnVirtualization||(this.selectedColumns=e.selectedColumns),e},w.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},w.prototype.showCustomColumnChooser=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog()},w.prototype.onPropertyChanged=function(e){var t,i,n;e&&e.module!==this.getModuleName()||(t=this.parent.columnChooserSettings.enableSearching,this.dlgObj&&this.dlgObj.element&&(i=this.dlgObj.element.querySelector(".e-cc-searchdiv"),n=this.dlgObj.element.querySelector(".e-dlg-content"),i.style.display=t?"":"none",n.style.margin=t?"":"0px"),this.dlgObj&&!this.dlgObj.isDestroyed&&e&&e.properties&&e.properties.mode&&(i="Immediate"===e.properties.mode,n=this.parent.enableAdaptiveUI,this.dlgObj.hide(),this.dlgObj.showCloseIcon=i&&!n,this.renderDialogButtons(i),this.dlgObj.dataBind()))},w);function w(e,t){this.filterColumns=[],this.showColumn=[],this.hideColumn=[],this.changedColumns=[],this.unchangedColumns=[],this.infiniteLoadedElement=[],this.isDlgOpen=!1,this.isColumnChooserOpen=!1,this.initialOpenDlg=!0,this.stateChangeColumns=[],this.changedStateColumns=[],this.isInitialOpen=!1,this.isCustomizeOpenCC=!1,this.searchOperator="startswith",this.sortDirection="None",this.selectedColumnModels=[],this.selectedColumns=[],this.itemsCount=50,this.infiniteSkipCount=0,this.infiniteColumns=[],this.infiniteInitialLoad=!1,this.prevInfiniteScrollDirection="",this.prevShowedCols=[],this.hideDialogFunction=this.hideDialog.bind(this),this.infiniteRenderMode=!1,this.toggleQueue=null,this.flushToggleTimer=null,this.isEscapePressed=!1,this.toolPanelFooterButtons=[],this.dropAfterTarget=!1,this.isDropAllowed=!1,this.stagedMoves=[],this.parent=e,this.serviceLocator=t,this.infiniteRenderMode=!!this.parent.enableColumnVirtualization,this.addEventListener(),this.cBoxTrue=M.createCheckBox(this.parent.createElement,!1,{checked:!0,label:" "}),this.cBoxFalse=M.createCheckBox(this.parent.createElement,!1,{checked:!1,label:" "}),this.cBoxTrue.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden e-cc e-cc-chbox",attrs:{type:"checkbox"}}),this.cBoxTrue.firstChild),this.cBoxFalse.insertBefore(this.parent.createElement("input",{className:"e-chk-hidden e-cc e-cc-chbox",attrs:{type:"checkbox"}}),this.cBoxFalse.firstChild),this.cBoxFalse.querySelector(".e-frame").classList.add("e-uncheck"),this.parent.enableRtl&&H.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"]),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?H.addClass([this.cBoxTrue,this.cBoxFalse],this.parent.cssClass.split(" ")):H.addClass([this.cBoxTrue,this.cBoxFalse],[this.parent.cssClass])),this.parent.enableAdaptiveUI&&this.setFullScreenDialog()}var Kf=function(){return(Kf=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Wf=["Sum","Average","Min","Max","Count","TrueCount","FalseCount"],Qf={Columns:{id:"columns",type:"Columns",text:"ToolPanelColumns",icon:"e-columnchooser-btn"},Filters:{id:"filters",type:"Filters",text:"ToolPanelFilters",icon:"e-icon-filter"},Edit:{id:"edit",type:"Edit",text:"ToolPanelEdit",icon:"e-edit"}},Xf=(R.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(mt,this.render,this),this.parent.on(s,this.destroy,this),this.parent.on(as,this.onPropertyChanged,this),this.parent.on(Kt,this.refreshColumns,this),this.parent.on(Ki,this.updateLayout,this),this.parent.on(ls,this.onFilterDialogOpen,this),this.parent.addEventListener(ce,this.selectionHandler),this.parent.addEventListener(ge,this.selectionHandler),this.parent.on(vt,this.onContentReady,this))},R.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(mt,this.render),this.parent.off(s,this.destroy),this.parent.off(as,this.onPropertyChanged),this.parent.off(Kt,this.refreshColumns),this.parent.off(Ki,this.updateLayout),this.parent.off(ls,this.onFilterDialogOpen),this.parent.removeEventListener(ce,this.selectionHandler),this.parent.removeEventListener(ge,this.selectionHandler),this.parent.off(vt,this.onContentReady))},R.prototype.getModuleName=function(){return"sideBar"},R.prototype.text=function(e,t){return(this.l10n?this.l10n.getConstant(e):"")||t},R.prototype.resolvePanels=function(){for(var e=[],t=[],i=0,n=this.parent.toolPanelSettings.toolPanels||[];i<n.length;i++){var r=n[i],s=void 0;if("string"==typeof r){if(!(o=Qf[""+r]))continue;s={id:o.id,type:o.type,headerText:this.text(o.text,o.text.replace("ToolPanel","")),iconCss:o.icon}}else{var o,s=Kf({},r);(o=Qf[s.type])?(s.headerText=s.headerText||this.text(o.text,o.text.replace("ToolPanel","")),s.iconCss=s.iconCss||o.icon,s.id=s.id||o.id):s.type="Custom"}-1!==t.indexOf(s.id)?this.parent.log("sidebar_duplicate_panel",{id:s.id}):!1===s.visible||"Edit"===s.type&&!this.isEditAllowed()||(t.push(s.id),e.push(s))}return e},R.prototype.render=function(){var e,t=this;this.parent.enableToolPanel&&!this.root&&(this.l10n=this.serviceLocator.getService("localization"),this.panels=this.resolvePanels(),this.root=this.parent.createElement("div",{className:"e-toolpanel"}),this.strip=this.parent.createElement("div",{className:"e-toolpanel-strip",attrs:{role:"tablist","aria-orientation":"vertical","aria-label":this.text("SideBarLabel","Grid tool panels")}}),this.panelWrap=this.parent.createElement("div",{className:"e-toolpanel-wrap"}),this.panelHost=this.parent.createElement("aside",{id:this.parent.element.id+"_toolpanel_sidebar",className:"e-toolpanel-content"}),this.panelContent=this.parent.createElement("div",{className:"e-toolpanel-tabpanel",attrs:{role:"tabpanel"}}),this.panelHost.appendChild(this.panelContent),this.panelWrap.appendChild(this.panelHost),this.root.appendChild(this.panelWrap),this.root.appendChild(this.strip),this.parent.element.appendChild(this.root),this.parent.element.classList.add("e-toolpanel-enabled"),this.restoreManagedAggregates(),e=this.parent.toolPanelSettings,this.sidebarObj=new B.Sidebar({target:this.panelWrap,type:"Over",position:this.isDockedLeft()?"Left":"Right",width:e.width,isOpen:!1,animate:!1,enableGestures:!1,closeOnDocumentClick:!1,showBackdrop:!1}),this.sidebarObj.appendTo(document.getElementById(this.panelHost.id)?"#"+this.panelHost.id:this.panelHost),this.panelHost.setAttribute("aria-hidden","true"),this.panels.forEach(function(e){return t.strip.appendChild(t.createButton(e))}),H.EventHandler.add(this.strip,"click",this.stripClick,this),H.EventHandler.add(this.root,"keydown",this.keyDown,this),this.isSidebarVisible=!this.parent.toolPanelSettings.hiddenByDefault,this.applyVisibility(),e=this.parent.toolPanelSettings.defaultToolPanel)&&this.isSidebarVisible&&this.openToolPanel(e)},R.prototype.createButton=function(e){var t=this.parent.createElement("button",{className:"e-toolpanel-btn",attrs:{type:"button",role:"tab","data-panel":e.id,"aria-selected":"false","aria-controls":this.parent.element.id+"_toolpanel_"+e.id,title:e.tooltip||e.headerText}}),i=(e.iconCss&&t.appendChild(this.parent.createElement("span",{className:"e-toolpanel-icon e-icons "+e.iconCss})),this.parent.createElement("span",{className:"e-toolpanel-text"}));return i.textContent=e.headerText,t.appendChild(i),t},R.prototype.getPanel=function(t){return this.panels.filter(function(e){return e.id===t})[0]},R.prototype.stripClick=function(e){var t,e=e.target.closest(".e-toolpanel-btn");e&&(t=e.getAttribute("data-panel"),this.lastFocus=e,this.openedId===t?this.closeToolPanel():this.openToolPanel(t))},R.prototype.keyDown=function(e){"Escape"===e.key&&this.openedId&&(e.preventDefault(),this.closeToolPanel())},R.prototype.args=function(e,t){return{id:e.id,type:e.type,element:this.panelHost,cancel:!1,previousId:t||void 0}},R.prototype.openToolPanel=function(e){var t,i,n;this.root&&!this.parent.isDestroyed&&this.isSidebarVisible&&((t=this.getPanel(e))?this.openedId===e||(i=this.openedId,n=this.args(t,i),this.parent.trigger("toolPanelOpen",n),n.cancel)||("columns"===(this.openedId=e)&&this.parent.columnChooserModule&&this.parent.columnChooserModule.closeDialogIfOpen(),this.sidebarObj.show(),this.panelHost.setAttribute("aria-hidden","false"),this.showBody(t),this.updateButtons(),this.updateLayout(),(n=this.panelHost.querySelector("input, button, [tabindex]"))&&n.focus(),this.parent.trigger("toolPanelOpened",this.args(t,i))):this.parent.log("sidebar_panel_not_found",{id:e}))},R.prototype.closeToolPanel=function(){var e,t;this.root&&this.openedId&&(e=this.getPanel(this.openedId),t=this.args(e),this.parent.trigger("toolPanelClose",t),t.cancel||(this.openedId=null,"columns"===e.id&&this.rendered.columns&&this.rendered.columns.classList.contains("e-toolpanel-chooser")&&(this.parent.columnChooserModule.releaseToolPanelChooser(),this.releaseZones(),delete this.rendered.columns),this.sidebarObj.hide(),this.panelHost.setAttribute("aria-hidden","true"),this.updateButtons(),this.updateLayout(),this.lastFocus&&this.lastFocus.focus(),this.parent.trigger("toolPanelClosed",this.args(e))))},R.prototype.toggleSideBar=function(e){this.root&&(this.isSidebarVisible=H.isNullOrUndefined(e)?!this.isSidebarVisible:e,!this.isSidebarVisible&&this.openedId&&this.closeToolPanel(),this.applyVisibility())},R.prototype.getOpenedToolPanel=function(){return this.openedId},R.prototype.isToolPanelShowing=function(){return!!this.openedId},R.prototype.refreshToolPanel=function(e){e=e||this.openedId;this.root&&e&&(delete this.rendered[""+e],this.destroyAccordions(),e===this.openedId)&&this.showBody(this.getPanel(e))},R.prototype.setSideBarPosition=function(e){"Left"!==e&&"Right"!==e?this.parent.log("sidebar_invalid_position",{position:e}):(this.parent.toolPanelSettings.position=e,this.onPropertyChanged())},R.prototype.showBody=function(e){for(this.panelContent.setAttribute("id",this.parent.element.id+"_toolpanel_"+e.id),this.panelContent.setAttribute("aria-label",e.headerText);this.panelContent.firstChild;)this.panelContent.removeChild(this.panelContent.firstChild);var t=this.rendered[e.id],i=!t;i&&(t=this.parent.createElement("div",{className:"e-toolpanel-body e-toolpanel-"+e.type.toLowerCase()}),this.rendered[e.id]=t),this.panelContent.appendChild(t),i?(this.renderBody(e,t),this.parent.trigger("toolPanelCreated",{id:e.id,element:t})):"Edit"===e.type&&this.refreshEdit()},R.prototype.renderBody=function(e,t){var i;"Columns"===e.type?this.renderColumns(t):"Filters"===e.type?this.renderFilters(t):"Edit"===e.type?this.renderEdit(t):"Custom"===e.type&&e.template&&("function"==typeof e.template?"string"==typeof(i=e.template({grid:this.parent,panel:e}))?t.innerHTML=i:i&&t.appendChild(i):t.innerHTML=e.template)},R.prototype.isChooserPanel=function(){var e=this.parent.columnChooserModule;return!!e&&!!e.isToolPanelChooserEnabled&&e.isToolPanelChooserEnabled()},R.prototype.renderChooserPanel=function(e){e.classList.add("e-toolpanel-chooser");var t,i=this.parent.createElement("div",{className:"e-toolpanel-cc-region"}),n=(e.appendChild(i),this.parent.columnChooserModule.renderToolPanelColumnChooser(i),this.isZoneAvailable("Group")),r=this.isZoneAvailable("Aggregate");n||r?(t=this.parent.createElement("div",{className:"e-toolpanel-zones"}),e.appendChild(t),n&&this.renderZone(t,"Group"),r&&this.renderZone(t,"Aggregate"),this.parent.addEventListener(c,this.zoneActionHandler),this.parent.addEventListener(de,this.zoneDataBoundHandler)):i.classList.add("e-toolpanel-cc-full")},R.prototype.columnsPanel=function(){return this.getPanel("columns")||this.panels.filter(function(e){return"Columns"===e.type})[0]||{id:"columns"}},R.prototype.getAggregateTypes=function(){var e=this.columnsPanel().aggregateTypes;return e?e.filter(function(e){return"Custom"!==e}):Wf},R.prototype.isZoneAvailable=function(e){var t=this.columnsPanel();return"Group"===e?(e=!!this.parent.groupModule,!1!==t.showGroupDropArea&&!!this.parent.allowGrouping&&e):(e=this.parent.getInjectedModules().some(function(e){return"aggregate"===e.prototype.getModuleName()}),!(!1===t.showAggregateDropArea||!e))},R.prototype.getValidAggregateTypes=function(e){var e={number:["Sum","Average","Min","Max","Count"],boolean:["TrueCount","FalseCount","Count"],date:["Min","Max","Count"],datetime:["Min","Max","Count"]}[e.type]||["Count"],t=this.getAggregateTypes();return e.filter(function(e){return-1<t.indexOf(e)})},R.prototype.renderZone=function(e,t){var i=this.parent.createElement("div",{className:"e-toolpanel-zone e-toolpanel-zone-"+t.toLowerCase(),attrs:{"data-zone":t}}),n=this.parent.createElement("div",{className:"e-toolpanel-zone-title"}),n=(n.appendChild(this.parent.createElement("span",{className:"e-icons e-toolpanel-zone-icon "+("Group"===t?"e-icon-group":"e-icon-aggregate"),attrs:{"aria-hidden":"true"}})),n.appendChild(this.parent.createElement("span",{className:"e-toolpanel-zone-text",innerHTML:""})),n.lastChild.textContent="Group"===t?this.text("ToolPanelRowGroups","Row Groups"):this.text("ToolPanelValues","Values"),i.appendChild(n),this.parent.createElement("div",{className:"e-toolpanel-zone-box"}));n.appendChild(this.parent.createElement("span",{className:"e-toolpanel-zone-placeholder"})),n.firstChild.textContent="Group"===t?this.text("ToolPanelGroupDropArea","Drag here to group its column"):this.text("ToolPanelAggregateDropArea","Drag here to aggregate its column"),i.appendChild(n),e.appendChild(i),this.zoneElements[""+t]=i,this.renderChips(t)},R.prototype.renderChips=function(t){var e,i,n,r=this,s=this.zoneElements[""+t];s&&((e=this.zoneChipLists[""+t])&&!e.isDestroyed&&e.destroy(),e=s.querySelector(".e-toolpanel-zone-box"),[].slice.call(e.querySelectorAll(".e-toolpanel-chips")).forEach(function(e){return H.remove(e)}),i=[],n=[],"Group"===t?this.parent.groupSettings.columns.forEach(function(e){var t=r.parent.getColumnByField(e);i.push({text:t?t.headerText||t.field:e,value:e})}):(this.syncManagedFromGrid(),Object.keys(this.managedAggregateTypes).forEach(function(e){var t=r.parent.getColumnByField(e);t&&(t=t.headerText||t.field,i.push({text:t,value:e,htmlAttributes:{title:r.managedAggregateTypes[""+e],"aria-label":t+": "+r.managedAggregateTypes[""+e]}}))}),this.parent.aggregates.forEach(function(e,t){t!==r.managedAggregateRowIndex&&(e.columns||[]).forEach(function(e){var t=r.parent.getColumnByField(e.field),i=[].concat(e.type).join(", ");n.push({text:t?t.headerText||t.field:e.field,value:e.field,htmlAttributes:{"aria-disabled":"true",title:i}})})})),e.classList.toggle("e-toolpanel-zone-filled",!(!i.length&&!n.length)),i.length&&(s=this.parent.createElement("div",{className:"e-toolpanel-chips"}),e.appendChild(s),s=new M.ChipList({chips:i,enableDelete:!0,enableRtl:this.parent.enableRtl,click:function(e){"Aggregate"===t&&r.openAggregateTypeMenu(e)},delete:function(e){e.cancel=!0,r.removeFromZone(t,e.data.value)}},s),this.zoneChipLists[""+t]=s),n.length)&&(s=this.parent.createElement("div",{className:"e-toolpanel-chips e-toolpanel-chips-readonly"}),e.appendChild(s),new M.ChipList({chips:n,enableRtl:this.parent.enableRtl,cssClass:"e-toolpanel-chip-readonly"},s))},R.prototype.getManagedAggregates=function(){var t=this;return this.syncManagedFromGrid(),Object.keys(this.managedAggregateTypes).map(function(e){return{field:e,type:t.managedAggregateTypes[""+e]}})},R.prototype.restoreManagedAggregates=function(){var i=this,e=this.parent.toolPanelAggregates;this.parent.toolPanelAggregates=void 0,this.parent.enablePersistence&&Array.isArray(e)&&e.length&&this.isZoneAvailable("Aggregate")&&(e.forEach(function(e){var t=e&&i.parent.getColumnByField(e.field);t&&-1<i.getValidAggregateTypes(t).indexOf(e.type)&&(i.managedAggregateTypes[e.field]=e.type)}),Object.keys(this.managedAggregateTypes).length)&&this.applyAggregates()},R.prototype.syncManagedFromGrid=function(){var t,e=this.parent.aggregates;-1<this.managedAggregateRowIndex&&e[this.managedAggregateRowIndex]&&(t={},(e[this.managedAggregateRowIndex].columns||[]).forEach(function(e){t[e.field]=[].concat(e.type)[0]}),this.managedAggregateTypes=t)},R.prototype.applyAggregates=function(){var r=this,e=this.parent.aggregates.filter(function(e,t){return t!==r.managedAggregateRowIndex}),t=Object.keys(this.managedAggregateTypes);t.length?(e.push({columns:t.map(function(e){var t=r.parent.getColumnByField(e),i=r.managedAggregateTypes[""+e],n=r.text("ToolPanelAgg"+i,i)+": ${"+i+"}";return{field:e,type:i,format:t?t.format:void 0,footerTemplate:n,groupFooterTemplate:n,groupCaptionTemplate:n}})}),this.managedAggregateRowIndex=e.length-1):this.managedAggregateRowIndex=-1,this.parent.aggregates=e},R.prototype.fireDrop=function(e,t){return this.parent.trigger(e,t),t},R.prototype.blockedByEdit=function(){return!!this.parent.isEdit&&(this.parent.log("toolpanel_columns_zone",{reason:"the drop was ignored because a row is being edited."}),!0)},R.prototype.canDropOnZone=function(e,t){return!(!t||!t.field)&&("Group"===e?!1!==t.allowGrouping&&!!this.zoneElements.Group:!!this.zoneElements.Aggregate&&0<this.getValidAggregateTypes(t).length)},R.prototype.dropOnZone=function(e,t){if(this.canDropOnZone(e,t)&&!this.blockedByEdit()){var i,n;if("Group"===e)return-1<this.parent.groupSettings.columns.indexOf(t.field)||this.fireDrop("toolPanelColumnDrop",{zone:"Group",action:"Group",column:t,cancel:!1}).cancel?void 0:(this.parent.groupColumn(t.field),void this.fireDrop("toolPanelColumnDropped",{zone:"Group",action:"Group",column:t}));this.managedAggregateTypes[t.field]?this.focusChip("Aggregate",t.field):(e="number"===t.type?"Sum":"Count",e=-1<(n=this.getValidAggregateTypes(t)).indexOf(e)?e:n[0],(i=this.fireDrop("toolPanelColumnDrop",{zone:"Aggregate",action:"AddAggregate",column:t,aggregateType:e,cancel:!1})).cancel||(n=-1<n.indexOf(i.aggregateType)?i.aggregateType:e,this.managedAggregateTypes[t.field]=n,this.applyAggregates(),this.renderChips("Aggregate"),this.fireDrop("toolPanelColumnDropped",{zone:"Aggregate",action:"AddAggregate",column:t,aggregateType:this.managedAggregateTypes[t.field]})))}},R.prototype.removeFromZone=function(e,t){var i,n=this.parent.getColumnByField(t);!n||this.blockedByEdit()||this.fireDrop("toolPanelColumnDrop",{zone:e,action:i="Group"===e?"Ungroup":"RemoveAggregate",column:n,cancel:!1}).cancel||("Group"===e?this.parent.ungroupColumn(t):(delete this.managedAggregateTypes[""+t],this.applyAggregates(),this.renderChips("Aggregate")),this.fireDrop("toolPanelColumnDropped",{zone:e,action:i,column:n}))},R.prototype.focusChip=function(e,t){e=this.zoneElements[""+e],e=e?[].slice.call(e.querySelectorAll(".e-chip")):[],e=e.filter(function(e){return e.getAttribute("data-value")===t})[0]||e[0];e&&e.focus()},R.prototype.openAggregateTypeMenu=function(e){var t,i=this,n=e.data.value,r=this.parent.getColumnByField(n);r&&this.managedAggregateTypes[""+n]&&(this.closeAggregateTypeMenu(),t=document.createElement("ul"),document.body.appendChild(t),e=e.element.getBoundingClientRect(),this.aggregateTypeMenu=new B.ContextMenu({cssClass:"e-toolpanel-aggmenu",enableRtl:this.parent.enableRtl,items:this.getValidAggregateTypes(r).map(function(e){return{text:i.text("ToolPanelAgg"+e,e),id:e,iconCss:e===i.managedAggregateTypes[""+n]?"e-icons e-icon-check":""}}),select:function(e){return i.changeAggregate(r,e.item.id)},onClose:function(){i.closeAggregateTypeMenu()}},t),this.aggregateTypeMenu.open(e.bottom,this.parent.enableRtl?e.right:e.left))},R.prototype.closeAggregateTypeMenu=function(){var e;this.aggregateTypeMenu&&(e=this.aggregateTypeMenu.element,this.aggregateTypeMenu.isDestroyed||this.aggregateTypeMenu.destroy(),this.aggregateTypeMenu=null,e)&&e.parentElement&&H.remove(e)},R.prototype.changeAggregate=function(e,t){this.managedAggregateTypes[e.field]===t||this.blockedByEdit()||this.fireDrop("toolPanelColumnDrop",{zone:"Aggregate",action:"ChangeAggregate",column:e,aggregateType:t,cancel:!1}).cancel||(this.managedAggregateTypes[e.field]=t,this.applyAggregates(),this.renderChips("Aggregate"),this.fireDrop("toolPanelColumnDropped",{zone:"Aggregate",action:"ChangeAggregate",column:e,aggregateType:t}))},R.prototype.onGroupOrAggregateChanged=function(e){!e||"grouping"!==e.requestType&&"ungrouping"!==e.requestType||this.parent.isDestroyed||!this.zoneElements.Group&&!this.zoneElements.Aggregate||(this.renderChips("Group"),this.renderChips("Aggregate"))},R.prototype.releaseZones=function(){var t=this;this.closeAggregateTypeMenu(),Object.keys(this.zoneChipLists).forEach(function(e){t.zoneChipLists[""+e]&&!t.zoneChipLists[""+e].isDestroyed&&t.zoneChipLists[""+e].destroy()}),this.zoneChipLists={},this.zoneElements={},this.parent.isDestroyed||(this.parent.removeEventListener(c,this.zoneActionHandler),this.parent.removeEventListener(de,this.zoneDataBoundHandler))},R.prototype.renderColumns=function(e){var t,s,i,o=this;this.isChooserPanel()?this.renderChooserPanel(e):(t=this.parent.createElement("input",{className:"e-toolpanel-search e-input",attrs:{type:"text",placeholder:this.text("Search","Search"),"aria-label":this.text("Search","Search")}}),s=this.parent.createElement("ul",{className:"e-toolpanel-columns",attrs:{role:"group"}}),!1!==this.parent.columnChooserSettings.enableSearching&&e.appendChild(t),e.appendChild(s),(i=function(){for(var r=t.value.toLowerCase();s.firstChild;)s.removeChild(s.firstChild);o.parent.getColumns().forEach(function(e){var t,i,n;e.showInColumnChooser&&"checkbox"!==e.type&&(t=e.headerText||e.field||"",r&&-1===t.toLowerCase().indexOf(r)||(i=o.parent.createElement("li",{className:"e-toolpanel-column"}),(n=o.parent.createElement("input",{attrs:{type:"checkbox"}})).setAttribute("data-uid",e.uid),i.appendChild(n),s.appendChild(i),new M.CheckBox({label:t,checked:e.visible,enableRtl:o.parent.enableRtl}).appendTo(n)))})})(),e.fill=i,H.EventHandler.add(t,"input",i,this),H.EventHandler.add(s,"change",function(e){var t,e=e.target,i=o.parent.getColumnByUid(e.getAttribute("data-uid"));i&&(t=o.parent.showHider,e.checked?t.show(i.uid,"uid"):t.hide(i.uid,"uid"))},this))},R.prototype.refreshColumns=function(e){var t=this.rendered.columns;t&&t.fill&&t.fill(),t&&t.classList.contains("e-toolpanel-chooser")&&this.parent.columnChooserModule&&(!e||"column-chooser"!==e.source)&&this.parent.columnChooserModule.refreshToolPanelChooser()},R.prototype.updateButtons=function(){var i=this;[].slice.call(this.strip.querySelectorAll(".e-toolpanel-btn")).forEach(function(e){var t=e.getAttribute("data-panel")===i.openedId;e.classList.toggle("e-active",t),e.setAttribute("aria-selected",t?"true":"false")})},R.prototype.applyVisibility=function(){this.root.classList.toggle("e-toolpanel-hidden",!this.isSidebarVisible),this.updateLayout()},R.prototype.isDockedLeft=function(){return"Left"===this.parent.toolPanelSettings.position!==this.parent.enableRtl},R.prototype.updateLayout=function(){var e,t,i,n,r;this.root&&(e=this.parent.toolPanelSettings,t=this.isDockedLeft(),this.root.classList.toggle("e-toolpanel-left",t),this.root.classList.toggle("e-toolpanel-right",!t),this.root.classList.toggle("e-toolpanel-over","Over"===e.type),this.root.classList.toggle("e-toolpanel-opened",!!this.openedId),i=this.isSidebarVisible?this.strip.offsetWidth:0,n=this.openedId?this.panelWidth():0,(r=this.parent.element).classList.toggle("e-toolpanel-dock-left",t),r.classList.toggle("e-toolpanel-dock-right",!t),r.style.setProperty("--e-toolpanel-size",("Over"===e.type?i:i+n)+"px"),this.root.style.setProperty("--e-toolpanel-panel",n+"px"))},R.prototype.panelWidth=function(){var e,t=this.parent.toolPanelSettings.width;return"number"==typeof t?t:(e=parseFloat(t),isNaN(e)?this.sidebarObj.element.offsetWidth:/%/.test(t)?this.parent.element.offsetWidth*e/100:e)},R.prototype.onPropertyChanged=function(){this.teardown(),this.openedId=null,this.rendered={},this.render()},R.prototype.teardown=function(){this.root&&(this.destroyAccordions(),this.rendered.columns&&this.rendered.columns.classList.contains("e-toolpanel-chooser")&&this.parent.columnChooserModule&&(this.parent.columnChooserModule.releaseToolPanelChooser(),this.releaseZones()),this.sidebarObj&&!this.sidebarObj.isDestroyed&&this.sidebarObj.destroy(),this.sidebarObj=null,H.EventHandler.remove(this.strip,"click",this.stripClick),H.EventHandler.remove(this.root,"keydown",this.keyDown),H.remove(this.root),this.root=null,this.parent.element.classList.remove("e-toolpanel-enabled"),this.parent.element.classList.remove("e-toolpanel-dock-left","e-toolpanel-dock-right"),this.parent.element.style.removeProperty("--e-toolpanel-size"))},R.prototype.destroy=function(){this.removeEventListener(),this.teardown(),this.rendered={}},R.prototype.destroyAccordions=function(){var t=this;this.destroyEditContent(),Object.keys(this.filterItems).forEach(function(e){return t.closeFilterItem(parseInt(e,10))}),this.accordions.forEach(function(e){e&&!e.isDestroyed&&e.destroy()}),this.accordions=[],this.filterAccordion=null,this.editBody=null},R.prototype.onContentReady=function(){"filters"===this.openedId&&this.updateFilterIndicators()},R.prototype.renderFilters=function(e){var i=this,t=this.parent.getColumns().filter(function(e){return e.allowFiltering&&e.field&&"checkbox"!==e.type}),n=(this.filterFields=t.map(function(e){return e.field}),this.filterCols=t,this.parent.createElement("div"));e.appendChild(n),this.filterAccordion=new B.Accordion({expandMode:"Multiple",animation:{expand:{effect:"None"},collapse:{effect:"None"}},enableRtl:this.parent.enableRtl,items:t.map(function(e){return{header:e.headerText||e.field,content:'<div class="e-toolpanel-filteritem-host"></div>'}}),expanding:function(e){var t=e.index;e.isExpanded?(i.parent.filterModule.closeFilterDialogByField(i.filterFields[parseInt(t.toString(),10)]),i.openFilterItem(t,e.element.querySelector(".e-toolpanel-filteritem-host"))):i.closeFilterItem(t)}}),this.filterAccordion.appendTo(n),this.accordions.push(this.filterAccordion),this.updateFilterIndicators()},R.prototype.openFilterItem=function(e,t){var i,n=this;this.filterItems[parseInt(e.toString(),10)]||(i={instance:null,closing:!1},(this.filterItems[parseInt(e.toString(),10)]=i).instance=this.parent.filterModule.renderToolPanelFilter(this.filterCols[parseInt(e.toString(),10)],t,function(){i.closing||(delete n.filterItems[parseInt(e.toString(),10)],setTimeout(function(){return n.reopenFilterItem(e,t)},0))}))},R.prototype.reopenFilterItem=function(e,t){var i;this.updateFilterIndicators(),!this.parent.isDestroyed&&this.filterAccordion&&!this.filterAccordion.isDestroyed&&document.body.contains(t)&&(i=this.filterAccordion.element.querySelectorAll(":scope > .e-acrdn-item")[parseInt(e.toString(),10)])&&i.classList.contains("e-expand-state")&&this.openFilterItem(e,t)},R.prototype.closeFilterItem=function(e){var t=this.filterItems[parseInt(e.toString(),10)];t&&(t.closing=!0,delete this.filterItems[parseInt(e.toString(),10)],t.instance)&&t.instance.closeDialog()},R.prototype.isColumnFiltered=function(t){return this.parent.filterSettings.columns.some(function(e){return e.field===t})},R.prototype.updateFilterIndicators=function(){var n=this;this.filterAccordion&&!this.filterAccordion.isDestroyed&&[].slice.call(this.filterAccordion.element.querySelectorAll(":scope > .e-acrdn-item")).forEach(function(e,t){var i,t=n.isColumnFiltered(n.filterFields[parseInt(t.toString(),10)]),e=(e.classList.toggle("e-toolpanel-filtered",t),e.querySelector(":scope > .e-acrdn-header .e-acrdn-header-content"));e&&(i=e.querySelector(".e-toolpanel-filter-mark"),t&&!i?(i=n.parent.createElement("span",{className:"e-toolpanel-filter-mark e-icons e-icon-filter e-filtered",attrs:{"aria-label":"filtered"}}),e.appendChild(i)):t?i.classList.add("e-filtered"):i&&H.remove(i))})},R.prototype.onFilterDialogOpen=function(e){var t;this.filterAccordion&&!this.filterAccordion.isDestroyed&&-1!==(e=this.filterFields.indexOf(e.field))&&(t=this.filterAccordion.element.querySelectorAll(":scope > .e-acrdn-item")[parseInt(e.toString(),10)])&&t.classList.contains("e-expand-state")&&this.filterAccordion.expandItem(!1,e)},R.prototype.isEditAllowed=function(){return!!this.parent.editSettings.allowEditing&&!!this.parent.editModule},R.prototype.renderEdit=function(e){this.editBody=e,this.buildEdit()},R.prototype.onSelectionChanged=function(){var e=this;this.editBody&&this.rendered.edit&&!this.editApplying&&(window.clearTimeout(this.editTimer),this.editTimer=window.setTimeout(function(){return e.refreshEdit()},0))},R.prototype.refreshEdit=function(){this.editBody&&this.rendered.edit&&!this.parent.isDestroyed&&("edit"!==this.openedId?this.editKey=null:this.getSelectionKey()!==this.editKey&&this.buildEdit())},R.prototype.getSelectionKey=function(){var i=this.parent.getPrimaryKeyFieldNames()[0],n=this.parent.getSelectedRecords();return this.parent.getSelectedRowIndexes().map(function(e,t){return e+":"+(i&&n[parseInt(t.toString(),10)]?n[parseInt(t.toString(),10)][""+i]:"")}).join(",")},R.prototype.destroyEditContent=function(){var t=this,e=(window.clearTimeout(this.editTimer),window.clearTimeout(this.editRestoreTimer),this.editRestore&&(this.parent.removeEventListener(de,this.editRestore),this.editRestore=null,this.editApplying=!1),this.editValidators.forEach(function(e){e.isDestroyed||e.destroy()}),this.editValidators=[],this.editForms);this.editForms=[],e.forEach(function(e){[].slice.call(e.querySelectorAll(".e-control")).forEach(function(e){(e.ej2_instances||[]).forEach(function(e){e.isDestroyed||e.destroy()})})}),this.accordions=this.accordions.filter(function(e){return e===t.filterAccordion||(e.isDestroyed||e.destroy(),!1)})},R.prototype.buildEdit=function(){var e=this.editBody;for(this.destroyEditContent();e.firstChild;)e.removeChild(e.firstChild);this.editKey=this.getSelectionKey();var t,i,n=this.parent.getSelectedRowIndexes(),r=this.parent.createElement("div",{className:"e-toolpanel-editstatus",attrs:{role:"status"}});e.appendChild(r),n.length?this.parent.editSettings.template||(i=(t=1<n.length)?{}:this.parent.getCurrentViewRecords()[n[0]],t&&(r.textContent=this.text("MultiRowPlaceholder","Multiple values - enter to update all")),this.buildEditFields(e,i,t?void 0:this.getForeignKeyData(n[0]))):(r.classList.add("e-toolpanel-editempty"),r.appendChild(this.parent.createElement("span",{className:"e-toolpanel-editempty-icon e-icons e-edit"})),(i=this.parent.createElement("span",{className:"e-toolpanel-editempty-text"})).textContent=this.text("NoRowSelected","Select rows to edit"),r.appendChild(i))},R.prototype.getForeignKeyData=function(e){e=this.parent.getRowByIndex(e),e=e?this.parent.getRowObjectFromUID(e.getAttribute("data-uid")):null;return e?e.foreignKeyData:void 0},R.prototype.getEditGroups=function(){var i,n=this,r=[],s=function(e){return!(!e.field||!1===e.visible||e.commands||e.commandsTemplate||"checkbox"===e.type||"rownumber"===e.type||n.parent.editModule.checkColumnIsGrouped(e))},o=function(e){return e.columns&&e.columns.length?e.columns.reduce(function(e,t){return e.concat(o(t))},[]):s(e)?[e]:[]},a=this.parent.columns.some(function(e){return!!e.columns&&!!e.columns.length});return this.parent.columns.forEach(function(e){var t;e.columns&&e.columns.length?((t=o(e)).length&&r.push({header:e.headerText,cols:t}),i=null):s(e)&&(i||(i={header:a?e.headerText||e.field:n.text("EditRecordDetails","Edit Record Details"),cols:[]},r.push(i)),i.cols.push(e))}),r},R.prototype.buildEditFields=function(e,n,r){var t,s,o=this,i=this.getEditGroups();i.length&&(t=this.parent.createElement("div"),e.appendChild(t),(e=new B.Accordion({expandMode:"Multiple",enableRtl:this.parent.enableRtl,animation:{expand:{effect:"None"},collapse:{effect:"None"}},items:i.map(function(e){return{header:e.header,content:'<div class="e-toolpanel-edititem-host"></div>',expanded:!0}})})).appendTo(t),this.accordions.push(e),s=[].slice.call(e.element.querySelectorAll(".e-toolpanel-edititem-host")),i.forEach(function(e,t){var i=o.parent.element.id+"_toolpanel_editform"+t,i=o.parent.editModule.renderToolPanelForm(e.cols,H.extend({},n,{},!0),i,s[parseInt(t.toString(),10)],r).querySelector("form");o.editForms.push(i),o.bindEditForm(i,e.cols)}))},R.prototype.bindEditForm=function(r,e){var s=this,o={};e.forEach(function(e){e.validationRules&&(o[Mp(e.field)]=e.validationRules);var t,i,n=r.querySelector("[data-mappinguid="+kp(e.uid)+"]");n&&(i=function(){return s.applyFieldChange(r,e)},(t=n.ej2_instances)&&t[0]&&t[0].addEventListener?t[0].addEventListener("change",i):H.EventHandler.add(n,"change",i,s),H.EventHandler.add(n,"input",function(){return s.onFieldInput(r,e,n,t)},s))}),Object.keys(o).length&&this.editValidators.push(new k.FormValidator(r,{rules:o,locale:this.parent.locale}))},R.prototype.onFieldInput=function(e,t,i,n){var r=t.editType,s="numericedit"===r||!r&&"number"===t.type,r=!(r&&"stringedit"!==r||t.type&&"string"!==t.type);n&&n[0]?s&&(/^-?\d+$/.test(i.value)||/^-?\d+\.\d+$/.test(i.value))?this.applyFieldChange(e,t,Number(i.value)):r&&this.applyFieldChange(e,t,i.value):this.applyFieldChange(e,t)},R.prototype.applyFieldChange=function(t,i,e){var n,r,s,o,a=this;-1!==this.editForms.indexOf(t)&&(!(r=i.validationRules?this.editValidators.filter(function(e){return e.element===t})[0]:null)||r.validate(Mp(i.field)))&&(n=void 0!==e?e:V.DataUtil.getObject(i.field,this.parent.editModule.getCurrentEditedData(t,{})),r=this.parent.getSelectedRowIndexes().slice(),e="Batch"===this.parent.editSettings.mode,s=e||"Cell"===this.parent.editSettings.mode,(o=r.filter(function(e){e=a.parent.getCurrentViewRecords()[parseInt(e.toString(),10)];return!!e&&!a.isSameValue(V.DataUtil.getObject(i.field,e),n)})).length)&&(this.holdSelection(r),o.forEach(function(e){var t;s?a.parent.updateCell(e,i.field,n):(t=H.extend({},a.parent.getCurrentViewRecords()[parseInt(e.toString(),10)],{},!0),V.DataUtil.setValue(i.field,n,t),a.parent.updateRow(e,t))}),e)&&this.parent.editModule.batchSave()},R.prototype.holdSelection=function(e){var t,i,n,r=this;this.editApplying||(this.editApplying=!0,t=document.activeElement,i=this.editBody&&t&&this.editBody.contains(t)?t:null,n=function(){window.clearTimeout(r.editRestoreTimer),r.parent.removeEventListener(de,n),r.editRestore=null,r.editApplying=!1,r.parent.isDestroyed||(1===e.length?r.parent.selectRow(e[0]):r.parent.selectRows(e),i&&r.keepFocus(i))},this.editRestore=n,this.parent.addEventListener(de,n),this.editRestoreTimer=window.setTimeout(n,3e3))},R.prototype.keepFocus=function(t){function i(){window.clearTimeout(e.timer),document.removeEventListener("focusin",r,!0)}var n=this,e={},r=function(e){!n.parent.isDestroyed&&n.parent.getContent().contains(e.target)&&(i(),document.body.contains(t))&&t.focus()};document.addEventListener("focusin",r,!0),e.timer=window.setTimeout(i,300)},R.prototype.isSameValue=function(e,t){return e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():e===t||H.isNullOrUndefined(e)&&H.isNullOrUndefined(t)},R);function R(e,t){this.panels=[],this.rendered={},this.openedId=null,this.isSidebarVisible=!0,this.lastFocus=null,this.accordions=[],this.filterFields=[],this.filterCols=[],this.filterItems={},this.editForms=[],this.editValidators=[],this.editApplying=!1,this.selectionHandler=this.onSelectionChanged.bind(this),this.zoneChipLists={},this.zoneElements={},this.managedAggregateTypes={},this.managedAggregateRowIndex=-1,this.zoneDataBoundHandler=this.onGroupOrAggregateChanged.bind(this,{requestType:"grouping"}),this.zoneActionHandler=this.onGroupOrAggregateChanged.bind(this),this.parent=e,this.serviceLocator=t,this.addEventListener()}$f.getQuery=function(e,t){var i=e.setRequiresCount(t.generateQuery(!0));return t.isRemote()&&(e.groupSettings.enableLazyLoading&&e.groupSettings.columns.length?i.lazyLoad=[]:i.take(e.pageSettings.totalRecordsCount)),i},$f.prototype.getFData=function(e,t){return $p(t,{},e,this.foreignKeyData[t.field])[0]},$f.prototype.getGridRowModel=function(e,t,i,n){void 0===n&&(n=0);var r=[],s=t.length;if(s){for(var o=0;o<s;o++,n++){var a={isExpand:!1},a=(a.data=t[parseInt(o.toString(),10)],a.index=n,(i.childGrid||i.detailTemplate)&&("All"===i.hierarchyPrintMode?a.isExpand=!0:"Expanded"===i.hierarchyPrintMode&&this.parent.expandedRows&&this.parent.expandedRows[parseInt(n.toString(),10)]&&(a.isExpand=i.expandedRows[parseInt(n.toString(),10)].isExpand)),new ds(a));a.cells=this.generateCells(e,i),r.push(a)}this.processColumns(r)}return r},$f.prototype.generateCells=function(e,t){var i=[];if(t.childGridLevel)for(var n=t.childGridLevel,r=0;r<n;r++)i.push(this.generateCell({},oe.CellType.Indent));for(var s=0,o=e;s<o.length;s++){var a=o[s];i.push(this.generateCell(a,oe.CellType.Data))}return i},$f.prototype.getColumnData=function(e){var t,i=this,n=[],r=e.getForeignKeyColumns();if(r.length){for(var s=0;s<r.length;s++){var o="result"in r[parseInt(s.toString(),10)].dataSource?new V.DataManager(r[parseInt(s.toString(),10)].dataSource.result):r[parseInt(s.toString(),10)].dataSource;n.push(o.executeQuery(new V.Query))}t=Promise.all(n).then(function(e){for(var t=0;t<r.length;t++)i.foreignKeyData[r[parseInt(t.toString(),10)].field]=e[parseInt(t.toString(),10)].result})}return t},$f.prototype.getHeaders=function(e,t){this.hideColumnInclude=!!t,this.colDepth=ac(e);for(var i=[],n=0;n<this.colDepth;n++)i[parseInt(n.toString(),10)]=new ds({}),i[parseInt(n.toString(),10)].cells=[];return i=this.processColumns(i),{rows:i=this.processHeaderCells(i,e),columns:this.generateActualColumns(e)}},$f.prototype.getConvertedWidth=function(e){var t=parseFloat(e);return-1!==e.indexOf("%")?this.parent.element.getBoundingClientRect().width*t/100:t},$f.prototype.generateActualColumns=function(e,t){void 0===t&&(t=[]);for(var i=0,n=e;i<n.length;i++){var r=n[i];r.commands||(r.columns?(r.visible||this.hideColumnInclude)&&0!==this.getCellCount(r,0)&&this.generateActualColumns(r.columns,t):(r.visible||this.hideColumnInclude)&&t.push(r))}return t},$f.prototype.processHeaderCells=function(e,t){for(var i=t,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].commands||(e=this.appendGridCells(i[parseInt(n.toString(),10)],e,0));return e},$f.prototype.appendGridCells=function(e,t,i){if(e.columns||!1===e.visible&&!this.hideColumnInclude||e.commands){if(e.columns)for(var n=this.getCellCount(e,0),r=(n&&t[parseInt(i.toString(),10)].cells.push(new cs({cellType:oe.CellType.StackedHeader,column:e,colSpan:n})),void 0),s=0,o=e.columns.length;s<o;s++)e.columns[parseInt(s.toString(),10)].visible&&!r&&(r=!0),t=this.appendGridCells(e.columns[parseInt(s.toString(),10)],t,i+1)}else t[parseInt(i.toString(),10)].cells.push(this.generateCell(e,oe.CellType.Header,this.colDepth-i,i));return t},$f.prototype.generateCell=function(e,t,i,n){e={visible:e.visible,isDataCell:t===oe.CellType.Data,column:e,cellType:t,rowSpan:i,index:n};return(!e.rowSpan||e.rowSpan<2)&&delete e.rowSpan,new cs(e)},$f.prototype.processColumns=function(e){var t=this.parent,i=[];t.enableColumnVirtualization&&(i=t.getColumnIndexesInView());for(var n=0,r=e.length;n<r;n++)if(t.allowGrouping)for(var s=0,o=t.groupSettings.columns.length-1;s<o;s++)t.enableColumnVirtualization&&-1===i.indexOf(s)||e[parseInt(n.toString(),10)].cells.splice(0,0,this.generateCell({},oe.CellType.HeaderIndent));return e},$f.prototype.getCellCount=function(e,t){if(e.columns)for(var i=0;i<e.columns.length;i++)t=this.getCellCount(e.columns[parseInt(i.toString(),10)],t);else(e.visible||this.hideColumnInclude)&&t++;return t},$f.prototype.checkAndExport=function(t,e){Object.keys(t).some(function(e){return!t[""+e]})||e()},$f.prototype.failureHandler=function(e,t,i){var n=this;return function(){e[t.id]=!0,n.checkAndExport(e,i)}},$f.prototype.createChildGrid=function(e,t,i,n){i=new Qd(this.parent.detailRowModule.getGridModel(e,t,i)),e.isPrinting=!1,i.parentDetails={parentID:e.element.id,parentPrimaryKeys:e.getPrimaryKeyFieldNames(),parentKeyField:e.childGrid.queryString,parentKeyFieldValue:H.getValue(i.queryString,t.data),parentRowData:t.data},e=bp("child-grid"),t=H.createElement("div",{id:e});return t.style.display="none",document.body.appendChild(t),n[""+(i.id=e)]=!1,i.isExportGrid=!0,{childGrid:i,element:t}},$f.prototype.getGridExportColumns=function(e){for(var t=[],i=0,n=e;i<n.length;i++)"checkbox"!==n[parseInt(i.toString(),10)].type&&t.push(n[parseInt(i.toString(),10)]);return t},$f.prototype.getForeignKeyData=function(){return this.foreignKeyData};var Yf=$f;function $f(e,t){this.hideColumnInclude=!1,this.foreignKeyData={},!(this.parent=e).parentDetails&&t&&(this.foreignKeyData=t)}Jf.prototype.returnFormattedValue=function(e,t){return!H.isNullOrUndefined(e.value)&&e.value?this.valueFormatter.getFormatFunction(t)(e.value):""},Jf.prototype.formatCellValue=function(e){var t,i;return e.isForeignKey&&(e.value=H.getValue(e.column.foreignKeyValue,$p(e.column,{},e.value)[0])),"number"===e.column.type&&void 0!==e.column.format&&""!==e.column.format?("string"==typeof e.column.format&&(e.column.format={format:e.column.format}),e.value||0===e.value?this.internationalization.getNumberFormat(e.column.format)(e.value):""):"boolean"===e.column.type&&""!==e.value?e.value?"true":"false":"date"!==e.column.type&&"dateonly"!==e.column.type&&"datetime"!==e.column.type&&"time"!==e.column.type||void 0===e.column.format?(H.isNullOrUndefined(e.column.type)||H.isNullOrUndefined(e.value))&&H.isNullOrUndefined(e.value)?"":e.value.toString():("string"==typeof e.value&&(e.value=new Date(e.value)),"string"==typeof e.column.format?(t=void 0,i=e.column.format,t="date"===e.column.type||"dateonly"===e.column.type?{type:"date",skeleton:i}:"time"===e.column.type?{type:"time",skeleton:i}:{type:"dateTime",skeleton:i},this.returnFormattedValue(e,t)):e.column.format instanceof Object&&void 0===e.column.format.type?e.value.toString():(i=void 0,i="date"===e.column.type||"dateonly"===e.column.type?{type:e.column.format.type,format:e.column.format.format,skeleton:e.column.format.skeleton}:"time"===e.column.type?{type:"time",format:e.column.format.format,skeleton:e.column.format.skeleton}:{type:"dateTime",format:e.column.format.format,skeleton:e.column.format.skeleton},this.returnFormattedValue(e,i)))};var Zf=Jf;function Jf(e){this.valueFormatter=new U(e),this.internationalization=new H.Internationalization(e)}tm.prototype.getModuleName=function(){return"ExcelExport"},tm.prototype.init=function(e){null!==e.element&&""===e.element.id&&(e.element.id=(new Date).toISOString(),this.isElementIdChanged=!0),this.parent=e,this.parent.isDestroyed||(this.isExporting=void 0,this.book={},this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.rowLength=1,this.footer=void 0,this.expType="AppendToSheet",this.includeHiddenColumn=!1,this.exportValueFormatter=new Zf(e.locale),e.id=bp("main-grid"),this.gridPool[e.id]=!1)},tm.prototype.Map=function(e,t,i,n,r,s){var o=e,e=(this.gridPool={},!e.childGrid&&!e.detailTemplate||!H.isNullOrUndefined(t)&&"None"===t.hierarchyExportMode||(e.expandedRows=rc(e).expandedRows),{requestType:"beforeExcelExport",gridObject:o,cancel:!1,isMultipleExport:i,workbook:n,isCsv:r,isBlob:s,isChild:this.isChild,grpFooterTemplates:this.grpFooterTemplates});return o.trigger(vi,e),e.cancel?new Promise(function(e){return e()}):(this.parent.log("exporting_begin",this.getModuleName()),this.data=new hs(o),this.isExporting=!0,this.isBlob=e.isBlob,this.isChild=e.isChild,this.grpFooterTemplates=e.grpFooterTemplates,this.isCsvExport=e.isCsv||!1,tp(t)&&ip(t,o),this.processRecords(o,t,e.isMultipleExport,e.workbook))},tm.prototype.exportingSuccess=function(e){this.isExporting=!1,this.parent.trigger(Si,this.isBlob?{promise:this.blobPromise}:{gridInstance:this.parent}),this.parent.log("exporting_complete",this.getModuleName()),e(this.book)},tm.prototype.processRecords=function(n,r,s,o){var e,t,i,a=this;return H.isNullOrUndefined(r)||H.isNullOrUndefined(r.dataSource)?H.isNullOrUndefined(r)||"CurrentPage"!==r.exportType||this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()?(e=[],t=Yf.getQuery(n,this.data),this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()&&((r=H.isNullOrUndefined(r)?{hierarchyExportMode:"All"}:r).hierarchyExportMode="None"===r.hierarchyExportMode?"None":"All","All"===r.hierarchyExportMode)&&(t.lazyLoad=[]),e.push(this.data.getData({},t)),e.push(this.helper.getColumnData(n)),new Promise(function(t,i){Promise.all(e).then(function(e){a.init(n),a.processInnerRecords(n,r,s,o,e[0]).then(function(){a.exportingSuccess(t)})}).catch(function(e){i(a.book),a.parent.trigger(ae,e)})})):new Promise(function(e){a.init(n),a.processInnerRecords(n,r,s,o,a.parent.getCurrentViewRecords()),a.exportingSuccess(e)}):(r.dataSource=r.dataSource instanceof V.DataManager?r.dataSource:new V.DataManager(r.dataSource),i=r.query||new V.Query,(H.isNullOrUndefined(i.isCountRequired)||n.aggregates)&&(i.isCountRequired=!0),new Promise(function(t){r.dataSource.executeQuery(i).then(function(e){a.init(n),a.processInnerRecords(n,r,s,o,e).then(function(){a.exportingSuccess(t)})})}))},tm.prototype.processInnerRecords=function(i,n,r,s,o){var a,l=this,e=(this.groupedColLength=i.groupSettings.columns.length,5),h=[],d=ac(i.columns),p=!H.isNullOrUndefined(n);return p&&!H.isNullOrUndefined(n.multipleExport)&&(this.expType=H.isNullOrUndefined(n.multipleExport.type)?"AppendToSheet":n.multipleExport.type,H.isNullOrUndefined(n.multipleExport.blankRows)||(e=n.multipleExport.blankRows)),H.isNullOrUndefined(s)?(this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.sheet.images=[]):"NewSheet"===this.expType?(this.workSheet=s.worksheets,this.rows=[],this.columns=[],this.sheet.images=[],this.styles=s.styles):(this.workSheet=[],this.rows=s.worksheets[0].rows,this.columns=s.worksheets[0].columns,this.styles=s.styles,this.sheet.images=s.worksheets[0].images,this.rowLength=this.rows[this.rows.length-1].index+e,this.rowLength++),p&&(H.isNullOrUndefined(r)?(H.isNullOrUndefined(n.header)||this.processExcelHeader(JSON.parse(JSON.stringify(n.header))),H.isNullOrUndefined(n.footer)||(this.footer=JSON.parse(JSON.stringify(n.footer)))):(H.isNullOrUndefined(n.header)||!r&&"NewSheet"!==this.expType||this.processExcelHeader(JSON.parse(JSON.stringify(n.header))),H.isNullOrUndefined(n.footer)||"AppendToSheet"===this.expType&&r||(this.footer=JSON.parse(JSON.stringify(n.footer))))),this.includeHiddenColumn=p&&n.includeHiddenColumn,new Promise(function(e,t){i.childGridLevel=0,h=l.processGridExport(i,n,o),l.globalResolve=e,l.gridPool[i.id]=!0,l.helper.checkAndExport(l.gridPool,l.globalResolve)}).then(function(){var e,t=[];return l.organiseRows(h,h[0].index,t),l.rows=l.rows.concat(t),H.isNullOrUndefined(l.footer)||("AppendToSheet"!==l.expType||r)&&"NewSheet"!==l.expType||l.processExcelFooter(l.footer),0<l.columns.length&&(l.sheet.columns=l.columns),l.sheet.rows=l.rows,l.sheet.enableRtl=l.parent.enableRtl,l.parent.allowFiltering&&i.getVisibleColumns().length&&p&&n.enableFilter&&(t=n.header?n.header.headerRows||n.header.rows.length:0,t={row:d+t,column:l.groupedColLength?l.groupedColLength+1:l.sheet.columns[0].index,lastRow:l.sheet.rows.length,lastColumn:l.sheet.columns.length},l.sheet.autoFilters=t),l.workSheet.push(l.sheet),l.book.worksheets=l.workSheet,l.book.styles=l.styles,i.notify("finalPageSetup",l.book),r||(l.isCsvExport?(p&&!H.isNullOrUndefined(n.separator)&&","!==n.separator&&(a=n.separator),e=new q.Workbook(l.book,"csv",i.locale,H.defaultCurrencyCode,a),l.isBlob?l.blobPromise=e.saveAsBlob("text/csv"):p&&n.fileName?e.save(n.fileName):e.save("Export.csv")):(e=new q.Workbook(l.book,"xlsx",i.locale,H.defaultCurrencyCode),l.isBlob?l.blobPromise=e.saveAsBlob("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"):p&&n.fileName?e.save(n.fileName):e.save("Export.xlsx")),l.isElementIdChanged&&(i.element.id=""),delete i.expandedRows),s})},tm.prototype.organiseRows=function(e,t,i){if(e.length)for(var n=0;n<e.length;n++){var r=e[parseInt(n.toString(),10)],s=r.childRows;s?(r.index=t++,delete r.childRows,i.push(r),t=this.organiseRows(s,t,i)):(r.index=t++,i.push(r))}return t},tm.prototype.processGridExport=function(e,t,i){var n=[],r=(H.isNullOrUndefined(t)||H.isNullOrUndefined(t.theme)||(this.theme=t.theme),!e.childGrid&&!e.detailTemplate||H.isNullOrUndefined(t)||(e.hierarchyPrintMode=t.hierarchyExportMode||"Expanded"),new Yf(e,this.helper.getForeignKeyData())),s=tp(t)?up(t.columns,e.enableColumnVirtualization):r.getGridExportColumns(e.columns),s=r.getHeaders(s,this.includeHiddenColumn),o=e.groupSettings.columns.length?e.groupSettings.columns.length-1:0,n=this.processHeaderContent(e,s,o,n);return n=H.isNullOrUndefined(t)||!Object.keys(t).length||!H.isNullOrUndefined(t.dataSource)||"CurrentPage"!==t.exportType||e.groupSettings.enableLazyLoading&&!e.getDataModule().isRemote()?this.processRecordContent(e,i,s,t,void 0,n,r):this.processRecordContent(e,i,s,t,e.currentViewData,n,r),e.notify(nn,{excelRows:n,type:"excel"}),this.capTemplate=void 0,this.footerTemplates=[],this.grpFooterTemplates=[],this.aggIndex=0,this.totalAggregates=0,n},tm.prototype.processRecordContent=function(e,t,i,n,r,s,o){var a=!H.isNullOrUndefined(r)&&r.length?r:t.result;return H.isNullOrUndefined(a.level)?this.processRecordRows(e,a,i,0,0,n,s,o):this.processGroupedRows(e,a,i,a.level,0,n,s,o),H.isNullOrUndefined(t.aggregates)||(H.isNullOrUndefined(r)||this.parent.groupSettings.enableLazyLoading?(i=t.result.GroupGuid?t.result.records:t.result,this.processAggregates(e,i,s)):this.processAggregates(e,t.result,s,r)),s},tm.prototype.processGroupedRows=function(e,t,i,n,r,s,o,a){for(var l=0,h=t;l<h.length;l++){var d=h[l],p=[],c={},u=(c.index=1+n-1,e.getColumnByField(d.field)),g={value:d.key,column:u,style:void 0,isForeignKey:u.isForeignColumn()},u=e.getColumnByField(d.field).headerText+": "+(u.enableGroupByFormat?d.key:this.exportValueFormatter.formatCellValue(g))+" - ",g=(1<d.count?u+=d.count+" items":u+=d.count+" item",{captionText:u,type:this.isCsvExport?"CSV":"Excel",data:d});this.parent.trigger(pt,g),c.value=g.captionText,c.style=this.getCaptionThemeStyle(this.theme),H.isNullOrUndefined(g.style)||(c.style=this.mergeOptions(c.style,g.style));u=new lo(e).generateRows(d);if(this.fillAggregates(e,u,t.level+t.childLevels-1,o,this.rowLength),p.push(c),0<o[o.length-1].cells.length){for(var f=t.level+t.childLevels+u[0].cells.length,m=0,y=0,v=o[o.length-1].cells;y<v.length;y++){var S=v[y];S.index<f&&(f=S.index),S.index>m&&(m=S.index),p[p.length-1].index!==S.index&&p.push(S)}1<f-c.index&&(c.colSpan=f-c.index);for(var g=Object.keys(u[0].data),C=g?g.length:0;m<i.columns.length-C+n+t.childLevels;){var w={},b=(w.index=m+1,w.style=this.getCaptionThemeStyle(this.theme),{type:this.isCsvExport?"CSV":"Excel",data:d});this.parent.trigger(pt,b),H.isNullOrUndefined(b.style)||(w.style=this.mergeOptions(w.style,b.style)),p.push(w),m++}}else{for(var I=0,R=0,x=i.columns;R<x.length;R++)x[R].visible&&I++;c.colSpan=t.childLevels+I}o[o.length-1].cells=p,this.rowLength++,this.groupedColLength<8&&1<n&&(o[o.length-1].grouping={outlineLevel:n-1,isCollapsed:!0}),!H.isNullOrUndefined(t.childLevels)&&0<t.childLevels?(this.processGroupedRows(e,d.items,i,d.items.level,r,s,o,a),this.processAggregates(e,d,o,void 0,n-1+t.childLevels,!0)):(r=this.processRecordRows(e,d.items,i,n-1,r,s,o,a),this.processAggregates(e,d,o,void 0,n-1,!0))}},tm.prototype.processRecordRows=function(e,t,i,n,r,s,o,a){for(var l=1,h=[],i=i.columns,d=0,p=a.getGridRowModel(i,t,e,r);d<p.length;d++){var c=p[d],h=[];r++;for(var l=1,u=void 0,g=0,f=c.cells.length;g<f;g++){var m,y,v,S,C=c.cells[parseInt(g.toString(),10)];C.cellType===oe.CellType.Data&&(C=C.column,S="",S=H.isNullOrUndefined(C)||"rownumber"!==C.type?(m=C.field,m=H.isNullOrUndefined(m)?"":C.valueAccessor(m,c.data,C),H.isNullOrUndefined(m)?"":m):c.index+1,v=void("dateonly"===C.type&&"string"==typeof S&&S&&(m=S.split(/[^0-9.]/),S=new Date(parseInt(m[0],10),parseInt(m[1],10)-1,parseInt(m[2],10)))),C.isForeignColumn&&C.isForeignColumn()&&(v=a.getFData(S,C),S=H.getValue(C.foreignKeyValue,v)),H.isNullOrUndefined(S)||(y=l+n+e.childGridLevel,v={data:c.data,column:C,foreignKeyData:v,value:S,style:void 0,colSpan:1,cell:C={}},e.trigger(Ci,v),H.isNullOrUndefined(v.image)||H.isNullOrUndefined(v.image.base64)||(u=this.setImage(v,y),v.image.height&&""!==v.value&&(u+=30)),H.isNullOrUndefined(v.hyperLink)||(v.cell.hyperlink={target:v.hyperLink.target},v.value=v.hyperLink.displayText||v.value),(C=v.cell).index=y,C.value=v.value,""===v.data&&e.childGridLevel&&1===l&&(v={style:{hAlign:"left"}},C.colSpan=e.getVisibleColumns().length,C.value=this.l10n.getConstant("EmptyRecord")),1<v.colSpan&&(C.colSpan=v.colSpan),H.isNullOrUndefined(v.style)?C.style={name:e.element.id+"column"+(l+n)}:(S=this.getColumnStyle(e,l+n),C.style=this.mergeOptions(this.styles[parseInt(S.toString(),10)],v.style)),h.push(C)),l++)}var w,b,I,R,x={index:this.rowLength++,cells:h};H.isNullOrUndefined(u)||(x.height=u),this.groupedColLength&&this.groupedColLength<8&&0<n+1&&(x.grouping={outlineLevel:n+1,isCollapsed:!0}),o.push(x),!c.isExpand&&!this.isChild||H.isNullOrUndefined(e.childGrid)&&H.isNullOrUndefined(e.detailTemplate)||(H.isNullOrUndefined(e.childGrid)?(this.parent.trigger(Ii,R={parentRow:c,row:x,value:{},action:"excelexport",gridInstance:e}),x.childRows=this.processDetailTemplate(R)):(e.isPrinting=!0,b=!H.isNullOrUndefined(s)&&s.exportType?s.exportType:"AllPages",w=(b=this.helper.createChildGrid(e,c,b,this.gridPool)).childGrid,b=b.element,w.actionFailure=a.failureHandler(this.gridPool,w,this.globalResolve),w.childGridLevel=e.childGridLevel+1,I=H.extend(s,{columns:null,dataSource:null,query:null}),this.parent.trigger(bi,R={childGrid:w,row:c,exportProperties:I}),w.beforeDataBound=this.childGridCell(x,w,I,c),w.appendTo(b))),e.notify(tn,{rowObj:c,type:"excel",excelRows:o})}return r},tm.prototype.processDetailTemplate=function(e){var o,a,t,l=this,h=[],n=2;if(e.value.columnHeader||e.value.rows){var d=function(e,t){var i={};return H.isNullOrUndefined(e.index)&&(e.index=o,o++),i.index=e.index+n,H.isNullOrUndefined(e.value)||(i.value=e.value),H.isNullOrUndefined(e.colSpan)||(i.colSpan=e.colSpan),H.isNullOrUndefined(e.rowSpan)||(i.rowSpan=e.rowSpan),i.style=t?l.getHeaderThemeStyle(l.theme):l.getRecordThemeStyle(l.theme),H.isNullOrUndefined(e.style)||(t={fontColor:e.style.fontColor,fontName:e.style.fontName,fontSize:e.style.fontSize,hAlign:e.style.excelHAlign,vAlign:e.style.excelVAlign,rotation:e.style.excelRotation,bold:e.style.bold,indent:e.style.indent,italic:e.style.italic,underline:e.style.underline,backColor:e.style.backColor,wrapText:e.style.wrapText,borders:e.style.excelBorders,numberFormat:e.style.excelNumberFormat,type:e.style.excelType,strikeThrough:e.style.strikeThrough},i.style=l.mergeOptions(t,i.style)),H.isNullOrUndefined(e.image)||H.isNullOrUndefined(e.image.base64)||(1<e.rowSpan?l.setImage(e,i.index):(a=l.setImage(e,i.index),e.image.height&&""!==e.value&&(a+=30))),H.isNullOrUndefined(e.hyperLink)||(i.hyperlink={target:e.hyperLink.target},i.value=e.hyperLink.displayText),i},i=function(e,t){for(var i=[],n=o=0;n<e.cells.length;n++){var r=e.cells[parseInt(n.toString(),10)],r=d(r,t);i.push(r)}var s={index:l.rowLength++,cells:i};H.isNullOrUndefined(a)||(s.height=a,a=null),h.push(s)};if(e.value.columnHeader)for(var r=0;r<e.value.columnHeader.length;r++)i(e.value.columnHeader[parseInt(r.toString(),10)],!0);if(e.value.rows)for(r=0;r<e.value.rows.length;r++)i(e.value.rows[parseInt(r.toString(),10)])}else e.value.image?(a=this.setImage(e.value,n),t={index:this.rowLength++,cells:[{index:n,style:this.getRecordThemeStyle(this.theme)}]},H.isNullOrUndefined(a)||(t.height=a,a=null),h.push(t)):e.value.text?(t={index:this.rowLength++,cells:[{index:n,value:e.value.text,style:this.getRecordThemeStyle(this.theme)}]},h.push(t)):e.value.hyperLink&&(t={index:this.rowLength++,cells:[{index:2,hyperlink:{target:e.value.hyperLink.target},value:e.value.hyperLink.displayText,style:this.getRecordThemeStyle(this.theme)}]},h.push(t));for(r=0;r<h.length;r++)h[parseInt(r.toString(),10)].grouping={outlineLevel:1,isCollapsed:!e.parentRow.isExpand,isHidden:!e.parentRow.isExpand};return h},tm.prototype.setImage=function(e,t){H.isNullOrUndefined(this.sheet.images)&&(this.sheet.images=[]);var i={image:e.image.base64,row:this.rowLength,column:t,lastRow:this.rowLength,lastColumn:t};return e.image.width&&e.image.height&&(i.width=e.image.width,i.height=e.image.height),this.sheet.images.push(i),this.columns[t-1].width=e.image.width||this.columns[t-1].width,e.image.height||50},tm.prototype.childGridCell=function(r,s,o,a){var l=this;return function(e){s.beforeDataBound=null,e.cancel=!0,0===e.result.length&&(e.result=[""]),r.childRows=l.processGridExport(s,o,e);for(var t=l.parent.groupSettings.columns.length,i=r.childRows,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].grouping={outlineLevel:t+s.childGridLevel,isCollapsed:!a.isExpand,isHidden:!a.isExpand};return s.destroy(),H.detach(s.element),l.gridPool[s.id]=!0,l.helper.checkAndExport(l.gridPool,l.globalResolve),r}},tm.prototype.processAggregates=function(e,t,i,n,r,s){var o=new io(e),a=(a=o.getColumns()).filter(function(e){return H.isNullOrUndefined(e.commands)&&"checkbox"!==e.type}),l=(e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo(),void 0),l=H.isNullOrUndefined(n)?t:n;return void 0===r&&(r=0),0<e.groupSettings.columns.length&&s?0<(n=new so(e).generateRows(l,{level:l.level})).length&&(i=this.fillAggregates(e,n,r,i)):(r=0<e.groupSettings.columns.length&&!s?e.groupSettings.columns.length:r,0<(n=o.generateRows(l,t.aggregates,null,null,a)).length&&!s&&(r=e.groupSettings.columns.length?r-1:r,i=this.fillAggregates(e,n,r,i))),i},tm.prototype.fillAggregates=function(e,t,i,n,r){for(var s=0,o=t;s<o.length;s++){for(var a,l,h=o[s],d=[],p=!0,c=0,u=0,g=h.cells;u<g.length;u++){var f=g[u],m={},y={};if(H.isNullOrUndefined(f.attributes["data-index"])||(y=this.parent.getColumnByIndex(f.attributes["data-index"])),f.cellType!==oe.CellType.DetailFooterIntent&&"checkbox"!==y.type&&!y.commands&&(f.visible||this.includeHiddenColumn))if(c++,f.isDataCell){var p=!1,y=!H.isNullOrUndefined(f.column.footerTemplate),v=!H.isNullOrUndefined(f.column.groupFooterTemplate),S=!H.isNullOrUndefined(f.column.groupCaptionTemplate);if(m.index=c+i+e.childGridLevel,y)m.value=this.getAggreateValue(e,oe.CellType.Summary,f.column.footerTemplate,f,h);else if(v)m.value=this.getAggreateValue(e,oe.CellType.GroupSummary,f.column.groupFooterTemplate,f,h);else if(S)m.value=this.getAggreateValue(e,oe.CellType.CaptionSummary,f.column.groupCaptionTemplate,f,h);else for(var C=0,w=Object.keys(h.data[f.column.field]);C<w.length;C++)w[C]===f.column.type&&(H.isNullOrUndefined(h.data[f.column.field].Sum)?H.isNullOrUndefined(h.data[f.column.field].Average)?H.isNullOrUndefined(h.data[f.column.field].Max)?H.isNullOrUndefined(h.data[f.column.field].Min)?H.isNullOrUndefined(h.data[f.column.field].Count)?H.isNullOrUndefined(h.data[f.column.field].TrueCount)?H.isNullOrUndefined(h.data[f.column.field].FalseCount)?H.isNullOrUndefined(h.data[f.column.field].Custom)||(m.value=h.data[f.column.field].Custom):m.value=h.data[f.column.field][f.column.field+" - falsecount"]:m.value=h.data[f.column.field][f.column.field+" - truecount"]:m.value=h.data[f.column.field][f.column.field+" - count"]:m.value=h.data[f.column.field][f.column.field+" - min"]:m.value=h.data[f.column.field][f.column.field+" - max"]:m.value=h.data[f.column.field][f.column.field+" - average"]:m.value=h.data[f.column.field][f.column.field+" - sum"]);m.style=this.getCaptionThemeStyle(this.theme),this.aggregateStyle(f.column,m.style,f.column.field);S=null!=f.attributes.class?f.attributes.class.toString():"",S=(S&&(m.style.hAlign=-1<S.indexOf("e-rightalign")?"right":-1<S.indexOf("e-centeralign")?"center":"left"),{row:h,type:y?"Footer":v?"GroupFooter":"GroupCaption",style:m,cell:f});this.parent.trigger(Xn,S),d.push(m)}else void 0===r&&(m.index=c+i+e.childGridLevel,m.style=this.getCaptionThemeStyle(this.theme),S={row:h,type:H.isNullOrUndefined(f.column.footerTemplate)?H.isNullOrUndefined(f.column.groupFooterTemplate)?"GroupCaption":"GroupFooter":"Footer",style:m,cell:f},this.parent.trigger(Xn,S),d.push(m))}H.isNullOrUndefined(r)?(l={},l=!(this.groupedColLength<8&&0<this.groupedColLength)||e.groupSettings.enableLazyLoading&&H.isNullOrUndefined(n[n.length-1].grouping)?{index:this.rowLength++,cells:d}:(a={outlineLevel:n[n.length-1].grouping.outlineLevel,isCollapsed:!0},{index:this.rowLength++,cells:d,grouping:a}),p||n.push(l)):n.push({index:r,cells:d})}return n},tm.prototype.aggregateStyle=function(e,t,i){var n,i=this.parent.getColumnByField(i);"object"==typeof e.format?(n=e.format,t.numberFormat=H.isNullOrUndefined(n.format)?n.skeleton:n.format,H.isNullOrUndefined(n.type)||(t.type=n.type.toLowerCase())):t.numberFormat=e.format,!H.isNullOrUndefined(i)&&H.isNullOrUndefined(t.type)&&(t.type=i.type.toLowerCase())},tm.prototype.getAggreateValue=function(e,t,i,n,r){var s,o={},i=(o[H.getEnumValue(oe.CellType,n.cellType)]=H.compile(i),r.data[n.column.field||n.column.columnName]);return(this.parent.isReact||this.parent.isVue||this.parent.isVue3||this.parent.isAngular)&&"string"!=typeof n.column.footerTemplate&&"string"!=typeof n.column.groupFooterTemplate&&"string"!=typeof n.column.groupCaptionTemplate?(s=i[n.column.type],H.isNullOrUndefined(s)?"":s):(s=o[H.getEnumValue(oe.CellType,n.cellType)](i,this.parent),this.parent.isVue3&&!H.isNullOrUndefined(s[1])?s[1].textContent:H.isNullOrUndefined(s[0])?"":s[0].textContent)},tm.prototype.mergeOptions=function(e,t){for(var i={},n=Object.keys(e),r=0;r<n.length;r++)"name"!==n[parseInt(r.toString(),10)]&&(i[n[parseInt(r.toString(),10)]]=e[n[parseInt(r.toString(),10)]]);for(n=Object.keys(t),r=0;r<n.length;r++)"name"!==n[parseInt(r.toString(),10)]&&(i[n[parseInt(r.toString(),10)]]=t[n[parseInt(r.toString(),10)]]);return i},tm.prototype.getColumnStyle=function(e,t){for(var i=0,n=0,r=this.styles;n<r.length;n++){if(r[n].name===e.element.id+"column"+t)return i;i++}},tm.prototype.headerRotation=function(e){var t=e.style.rotation;t<=90&&0<=t?e.style.hAlign="Left":(90<t&&t<=180||(t=180),e.style.hAlign="Right"),e.style.rotation=t},tm.prototype.processHeaderContent=function(e,t,i,n){var r=t.rows,s=t.columns,o=[];if(0<i)for(var a=0;a!==i;)this.columns.push({index:a+1,width:30}),a++;for(var l,h=0;h<s.length;h++)this.parseStyles(e,s[parseInt(h.toString(),10)],this.getRecordThemeStyle(this.theme),i+h+1);for(var d=0;d<r.length;d++){for(var p=1+i,c=[],u=0;u<r[parseInt(d.toString(),10)].cells.length;u++){var g={},f={},m=r[parseInt(d.toString(),10)].cells[parseInt(u.toString(),10)];if(!m.isSpanned&&m.cellType!==oe.CellType.HeaderIndent&&m.cellType!==oe.CellType.DetailHeader){for(var y={contains:!0,index:1};y.contains;)if(p=(y=this.getIndex(o,1,p)).index,!y.contains){f.index=y.index+e.childGridLevel;break}if(!H.isNullOrUndefined(m.rowSpan)&&1!==m.rowSpan){f.rowSpan=m.rowSpan;for(var v=1;v<m.rowSpan+1;v++){var S={rowIndex:0,columnIndex:0,colSpan:0};S.rowIndex=v,S.columnIndex=p,S.colSpan=m.colSpan||1,o.push(S)}}H.isNullOrUndefined(m.colSpan)||1===m.colSpan||(f.colSpan=m.colSpan,p=p+f.colSpan-1),f.value=m.column.headerText,g=this.getHeaderThemeStyle(this.theme),H.isNullOrUndefined(m.column.textAlign)||(g.hAlign=m.column.textAlign.toLowerCase()),H.isNullOrUndefined(m.column.headerTextAlign)||(g.hAlign=m.column.headerTextAlign.toLowerCase());g={cell:f,gridCell:m,style:g};if(e.trigger(wi,g),m.cellType===oe.CellType.Header&&1<f.colSpan){for(var p=p+f.colSpan-1,C=1;C<f.colSpan;C++){var w=u+C;w<r[parseInt(d.toString(),10)].cells.length&&(r[parseInt(d.toString(),10)].cells[parseInt(w.toString(),10)].isSpanned=!0)}for(v=0;v<o.length;v++)o[parseInt(v.toString(),10)].columnIndex===f.index&&(o[parseInt(v.toString(),10)].colSpan=f.colSpan)}g.style.rotation&&this.headerRotation(g),H.isNullOrUndefined(g.image)||H.isNullOrUndefined(g.image.base64)||(l=this.setImage(g,p)),H.isNullOrUndefined(g.hyperLink)||(g.cell.hyperlink={target:g.hyperLink.target},f.value=g.hyperLink.displayText||f.value),f.style=g.style,c.push(f),p++}}var b={index:this.rowLength++,cells:c};H.isNullOrUndefined(l)||(b.height=l),n.push(b)}return n},tm.prototype.getHeaderThemeStyle=function(e){var t={fontSize:12,borders:{color:"#E0E0E0"},bold:!0};return t=H.isNullOrUndefined(e)||H.isNullOrUndefined(e.header)?t:this.updateThemeStyle(e.header,t)},tm.prototype.updateThemeStyle=function(e,t){return H.extend(t,e)},tm.prototype.getCaptionThemeStyle=function(e){var t={fontSize:13,backColor:"#F6F6F6"};return t=H.isNullOrUndefined(e)||H.isNullOrUndefined(e.caption)?t:this.updateThemeStyle(e.caption,t)},tm.prototype.getRecordThemeStyle=function(e){var t={fontSize:13,borders:{color:"#E0E0E0"}};return t=H.isNullOrUndefined(e)||H.isNullOrUndefined(e.record)?t:this.updateThemeStyle(e.record,t)},tm.prototype.processExcelHeader=function(e){if(!H.isNullOrUndefined(e.rows)&&("NewSheet"===this.expType||1===this.rowLength)){var t=void 0;void 0===e.headerRows?this.rowLength=e.rows.length:this.rowLength=e.headerRows,t=this.rowLength<e.rows.length?this.rowLength:e.rows.length,this.rowLength++;for(var i=0;i<t;i++){var n=e.rows[parseInt(i.toString(),10)];null!==n.index&&!H.isNullOrUndefined(n.index)||(n.index=i+1),this.updatedCellIndex(n)}}},tm.prototype.updatedCellIndex=function(e){for(var t=e.cells.length,i=0;i<t;i++){var n=e.cells[parseInt(i.toString(),10)];null!==n.index&&!H.isNullOrUndefined(n.index)||(n.index=i+1)}this.rows.push(e)},tm.prototype.processExcelFooter=function(e){if(!H.isNullOrUndefined(e.rows)){var t=void 0;void 0===e.footerRows?this.rowLength+=e.rows.length:t=e.footerRows>e.rows.length?(this.rowLength+=e.footerRows-e.rows.length,e.rows.length):e.footerRows;for(var i=0;i<t;i++){var n=e.rows[parseInt(i.toString(),10)];null===n.index||void 0===n.index?n.index=this.rowLength++:n.index+=this.rowLength,this.updatedCellIndex(n)}}},tm.prototype.getIndex=function(e,t,i){for(var n=0,r=e;n<r.length;n++){var s=r[n];if(s.rowIndex===t&&s.columnIndex===i)return{contains:!0,index:i+=s.colSpan||1}}return{contains:!1,index:i}},tm.prototype.parseStyles=function(e,t,i,n){var r;H.isNullOrUndefined(t.format)||("object"==typeof t.format?(r=t.format,i.numberFormat=H.isNullOrUndefined(r.format)?r.skeleton:r.format,H.isNullOrUndefined(r.type)||(i.type="dateonly"===r.type?"date":r.type.toLowerCase())):(i.numberFormat=t.format,i.type="dateonly"===t.type?"date":t.type)),H.isNullOrUndefined(t.textAlign)||(i.hAlign=t.textAlign.toLowerCase()),0<Object.keys(i).length&&(i.name=e.element.id+"column"+n,this.styles.push(i)),e.childGridLevel||(H.isNullOrUndefined(t.width)||"auto"===t.width?this.columns.push({index:n+e.childGridLevel,width:null}):this.columns.push({index:n+e.childGridLevel,width:"number"==typeof t.width?t.width:this.helper.getConvertedWidth(t.width)}))},tm.prototype.destroy=function(){};var em=tm;function tm(e,t){this.book={},this.workSheet=[],this.rows=[],this.columns=[],this.styles=[],this.rowLength=1,this.expType="AppendToSheet",this.includeHiddenColumn=!1,this.isCsvExport=!1,this.isChild=!1,this.isElementIdChanged=!1,this.gridPool={},this.sheet={},this.grpFooterTemplates=[],this.footerTemplates=[],this.aggIndex=0,this.totalAggregates=0,H.initializeTelemetryFeature("ExcelExport","DataGrid"),this.parent=e,this.helper=new Yf(e),this.locator=t,this.l10n=this.locator.getService("localization")}nm.prototype.getModuleName=function(){return"PdfExport"},nm.prototype.init=function(e){this.exportValueFormatter=new Zf(e.locale),this.pdfDocument=void 0,this.hideColumnInclude=!1,this.currentViewData=!1,this.parent=e,this.isGrouping=!1,this.isExporting=!0,e.id=bp("main-grid"),this.gridPool[e.id]=!1,this.pdfPageSettings=new x.PdfPageSettings},nm.prototype.exportWithData=function(e,t,i,n,r,s,o){var a=this;this.init(e),H.isNullOrUndefined(t)?this.pdfDocument=new x.PdfDocument:this.pdfDocument=t,this.processExport(e,n,r,s).then(function(){a.isExporting=!1,e.trigger(xi,a.isBlob?{promise:a.blobPromise}:{gridInstance:a.parent}),a.parent.log("exporting_complete",a.getModuleName()),i(a.pdfDocument)}).catch(function(e){o(a.pdfDocument),a.parent.trigger(ae,e)})},nm.prototype.Map=function(n,r,s,o,e){var a,l=this,h=(this.data=new hs(this.parent),this.isBlob=e,this.gridPool={},r&&r.query?r.query:new V.Query),e=(!n.childGrid&&!n.detailTemplate||!H.isNullOrUndefined(r)&&"None"===r.hierarchyExportMode||(n.expandedRows=rc(n).expandedRows),{requestType:"beforePdfExport",cancel:!1,headerPageNumbers:[],gridDrawPosition:{xPosition:0,yPosition:0},generateQuery:!1});return(e.gridObject=n).trigger(Ri,e),!0===e.cancel?new Promise(function(e,t){return e()}):(tp(r)&&ip(r,n),e.generateQuery&&(h=Yf.getQuery(n,this.data)),this.headerOnPages=e.headerPageNumbers,this.drawPosition=e.gridDrawPosition,this.parent.log("exporting_begin",this.getModuleName()),H.isNullOrUndefined(r)||H.isNullOrUndefined(r.dataSource)?H.isNullOrUndefined(r)||"CurrentPage"!==r.exportType||this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()?(a=[],e=Yf.getQuery(n,this.data),this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()&&((r=H.isNullOrUndefined(r)?{hierarchyExportMode:"All"}:r).hierarchyExportMode="None"===r.hierarchyExportMode?"None":"All","All"===r.hierarchyExportMode)&&(e.lazyLoad=[]),a.push(this.data.getData({},e)),a.push(this.helper.getColumnData(n)),new Promise(function(t,i){Promise.all(a).then(function(e){l.init(n),H.isNullOrUndefined(o)?l.pdfDocument=new x.PdfDocument:l.pdfDocument=o.document,l.processExport(n,e[0],r,s,o).then(function(e){l.isExporting=!1,n.trigger(xi,l.isBlob?{promise:l.blobPromise}:{gridInstance:l.parent}),l.parent.log("exporting_complete",l.getModuleName()),r&&r.multipleExport&&"AppendToPage"===r.multipleExport.type?t(e):t(l.pdfDocument)}).catch(function(e){i(l.pdfDocument),l.parent.trigger(ae,e)})})})):new Promise(function(e,t){l.exportWithData(n,o,e,l.parent.getCurrentViewRecords(),r,s,t)}):(r.dataSource=r.dataSource instanceof V.DataManager?r.dataSource:new V.DataManager(r.dataSource),(H.isNullOrUndefined(h.isCountRequired)||n.aggregates)&&(h.isCountRequired=!0),new Promise(function(t,i){r.dataSource.executeQuery(h).then(function(e){l.exportWithData(n,o,t,e,r,s,i)})})))},nm.prototype.processExport=function(n,i,r,s,o){var a,l=this,e=o&&r&&r.multipleExport&&"AppendToPage"===r.multipleExport.type?null:this.pdfDocument.sections.add(),h=(this.processSectionExportProperties(e,r),o&&r&&r.multipleExport&&"AppendToPage"===r.multipleExport.type?o.result.page:e.pages.add());return new Promise(function(e,t){a=l.processGridExport(n,i,r),l.globalResolve=e,l.gridPool[n.id]=!0,l.helper.checkAndExport(l.gridPool,l.globalResolve)}).then(function(){var e,t,i=l.drawPosition.xPosition;return o&&r&&r.multipleExport&&"AppendToPage"===r.multipleExport.type?(e=o.result.bounds.y+o.result.bounds.height,r.multipleExport.blankSpace&&(e=o.result.bounds.y+o.result.bounds.height+r.multipleExport.blankSpace)):e=l.drawPosition.yPosition,t=s?((t=new x.PdfGridLayoutFormat).layout=x.PdfLayoutType.Paginate,t.break=x.PdfLayoutBreakType.FitPage,t.paginateBounds=new x.RectangleF(0,0,h.getClientSize().width,h.getClientSize().height),a.draw(h,i,e,t)):a.draw(h,i,e),l.drawHeader(r),s||(l.isBlob?l.blobPromise=l.pdfDocument.save():!H.isNullOrUndefined(r)&&r.fileName?l.pdfDocument.save(r.fileName):l.pdfDocument.save("Export.pdf"),l.pdfDocument.destroy(),delete n.expandedRows),r&&r.multipleExport&&"AppendToPage"===r.multipleExport.type?{document:l.pdfDocument,result:t}:l.pdfDocument})},nm.prototype.processSectionExportProperties=function(e,t){return H.isNullOrUndefined(e)||H.isNullOrUndefined(t)||H.isNullOrUndefined(t.pageOrientation)&&H.isNullOrUndefined(t.pageSize)||(this.pdfPageSettings.orientation="Landscape"===t.pageOrientation?x.PdfPageOrientation.Landscape:x.PdfPageOrientation.Portrait,this.pdfPageSettings.size=this.getPageSize(t.pageSize),e.setPageSettings(this.pdfPageSettings)),e},nm.prototype.processGridExport=function(e,t,i){var n=!0,r=null,s=(H.isNullOrUndefined(i)||(this.gridTheme=i.theme,n=!!H.isNullOrUndefined(i.allowHorizontalOverflow)||i.allowHorizontalOverflow,r=i.horizontalOverflowType),new Yf(e,this.helper.getForeignKeyData())),o=this.processExportProperties(i,t.result),a=(a=tp(i)?up(i.columns,e.enableColumnVirtualization):s.getGridExportColumns(e.columns)).filter(function(e){return H.isNullOrUndefined(e.commands)}),l=!1,h=(e.groupSettings.columns.length&&(l=!0),!e.childGrid&&!e.detailTemplate||H.isNullOrUndefined(i)||(e.hierarchyPrintMode=i.hierarchyExportMode||"Expanded"),new x.PdfGrid),d=this.getHeaderThemeStyle(),p=d.border,c=d.font,d=d.brush,u=s.getHeaders(a,this.hideColumnInclude),g=u.columns,h=this.processGridHeaders(e.groupSettings.columns.length,h,u.rows,g,p,c,d,e,n,a,r),u=(this.setColumnProperties(g,h,s,e,n),this.getSummaryCaptionThemeStyle());return!H.isNullOrUndefined(o)&&o.length?(l?(H.isNullOrUndefined(u.border)||(p=u.border),this.processGroupedRecords(h,o,g,e,p,0,u.font,u.brush,u.backgroundBrush,t,i,s,0)):this.processRecord(p,g,e,o,h,0,i,s,0),H.isNullOrUndefined(t.aggregates)||(c=void 0,a=(a=(d=new io(e)).getColumns()).filter(function(e){return H.isNullOrUndefined(e.commands)&&"checkbox"!==e.type}),e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo(),c=this.customDataSource?d.generateRows(o,t.aggregates,null,null,a):this.currentViewData?d.generateRows(this.parent.getCurrentViewRecords(),t.aggregates):l?d.generateRows(o.records,t.aggregates):d.generateRows(t.result,t.aggregates,null,null,a),this.processAggregates(c,h,p,u.font,u.brush,u.backgroundBrush,!1,null,null,null,!l))):h.rows.addRow().style.setBorder(p),h},nm.prototype.getSummaryCaptionThemeStyle=function(){var e,t,i,n,r;return H.isNullOrUndefined(this.gridTheme)||H.isNullOrUndefined(this.gridTheme.caption)?{font:new x.PdfStandardFont(x.PdfFontFamily.Helvetica,9.75),brush:new x.PdfSolidBrush(new x.PdfColor(0,0,0)),backgroundBrush:new x.PdfSolidBrush(new x.PdfColor(246,246,246))}:(e=H.isNullOrUndefined(this.gridTheme.caption.fontSize)?9.75:this.gridTheme.caption.fontSize,r=H.isNullOrUndefined(this.gridTheme.caption.fontName)?x.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.caption.fontName),t=this.getFontStyle(this.gridTheme.caption),i=new x.PdfColor(0,0,0),H.isNullOrUndefined(this.gridTheme.caption.fontColor)||(n=this.hexToRgb(this.gridTheme.caption.fontColor),i=new x.PdfColor(n.r,n.g,n.b)),n=this.gridTheme.caption.border?this.getBorderStyle(this.gridTheme.caption.border):null,r=new x.PdfStandardFont(r,e,t),{font:r=H.isNullOrUndefined(this.gridTheme.caption.font)?r:this.gridTheme.caption.font,brush:new x.PdfSolidBrush(i),backgroundBrush:new x.PdfSolidBrush(new x.PdfColor(246,246,246)),border:n})},nm.prototype.getGridPdfFont=function(e){var t,i,n,r="fontFamily",s="fontSize",o="fontStyle",a="isTrueType",l=0;e.header&&e.header.font&&(t=e.header.font[r],i=e.header.font[s],n=e.header.font[o],l=H.isNullOrUndefined(x.PdfFontStyle[""+n])?0:x.PdfFontStyle[""+n],e.header.font[a]?e.header.font=new x.PdfTrueTypeFont(t,i,l):(n=H.isNullOrUndefined(t)?x.PdfFontFamily.Helvetica:this.getFontFamily(t),e.header.font=new x.PdfStandardFont(n,i,l))),e.caption&&e.caption.font&&(t=e.caption.font[r],n=e.caption.font[s],i=e.caption.font[o],l=H.isNullOrUndefined(x.PdfFontStyle[""+i])?0:x.PdfFontStyle[""+i],e.caption.font[a]?e.caption.font=new x.PdfTrueTypeFont(t,n,l):(i=H.isNullOrUndefined(t)?x.PdfFontFamily.Helvetica:this.getFontFamily(t),e.caption.font=new x.PdfStandardFont(i,n,l))),e.record&&e.record.font&&(t=e.record.font[r],i=e.record.font[s],n=e.record.font[o],l=H.isNullOrUndefined(x.PdfFontStyle[""+n])?0:x.PdfFontStyle[""+n],e.record.font[a]?e.record.font=new x.PdfTrueTypeFont(t,i,l):(r=H.isNullOrUndefined(t)?x.PdfFontFamily.Helvetica:this.getFontFamily(t),e.record.font=new x.PdfStandardFont(r,i,l)))},nm.prototype.getHeaderThemeStyle=function(){var e,t,i,n,r=new x.PdfBorders;return H.isNullOrUndefined(this.gridTheme)||H.isNullOrUndefined(this.gridTheme.header)?(r.all=new x.PdfPen(new x.PdfColor(234,234,234)),{border:r,font:new x.PdfStandardFont(x.PdfFontFamily.Helvetica,10.5),brush:new x.PdfSolidBrush(new x.PdfColor(102,102,102))}):(r=H.isNullOrUndefined(this.gridTheme.header.fontName)?x.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.header.fontName),e=this.getFontStyle(this.gridTheme.header),t=H.isNullOrUndefined(this.gridTheme.header.fontSize)?10.5:this.gridTheme.header.fontSize,i=new x.PdfColor,H.isNullOrUndefined(this.gridTheme.header.fontColor)||(n=this.hexToRgb(this.gridTheme.header.fontColor),i=new x.PdfColor(n.r,n.g,n.b)),n=new x.PdfStandardFont(r,t,e),H.isNullOrUndefined(this.gridTheme.header.font)||(n=this.gridTheme.header.font),{border:this.getBorderStyle(this.gridTheme.header.border),font:n,brush:new x.PdfSolidBrush(i)})},nm.prototype.processGroupedRecords=function(r,s,o,a,l,e,h,d,p,c,u,g,f){for(var m=this,y=e,v=this,t=0,i=s;t<i.length;t++)!function(t){var i=r.rows.addRow(),e=a.getColumnByField(t.field),n={value:t.key,column:e,style:void 0,isForeignKey:e.isForeignColumn()},e=a.getColumnByField(t.field).headerText+": "+(e.enableGroupByFormat?t.key:v.exportValueFormatter.formatCellValue(n))+" - "+t.count+(1<s.count?" items":" item");v.parent.trigger(pt,{captionText:e,type:"PDF",data:t,style:void 0},function(e){i.cells.getCell(y).value=e.captionText,i.cells.getCell(y).style.stringFormat=new x.PdfStringFormat(x.PdfTextAlignment.Left),i.style.setBorder(l),i.style.setFont(h),i.style.setTextBrush(d),i.style.setBackgroundBrush(p),H.isNullOrUndefined(e.style)||m.processCellStyle(i.cells.getCell(y),e);var e=new lo(a);e=H.isNullOrUndefined(t.items.records)?e.generateRows(t.items,t):e.generateRows(t.items.records,t),H.isNullOrUndefined(e)||0!==e.length||(i.cells.getCell(y+1).columnSpan=r.columns.count-(y+1)),!H.isNullOrUndefined(s.childLevels)&&0<s.childLevels?(m.processAggregates(e,r,l,h,d,p,!0,i,y,null,null,a),m.processGroupedRecords(r,t.items,o,a,l,y+1,h,d,p,c,u,g,f),f=m.rowIndex,e=new so(a).generateRows(t.items.records,t),m.processAggregates(e,r,l,h,d,p,!1)):(m.processAggregates(e,r,l,h,d,p,!0,i,y,null,null,a),f=m.processRecord(l,o,a,t.items,r,y+1,u,g,f),e=new so(a).generateRows(t.items,t),m.processAggregates(e,r,l,h,d,p,!1,null,null,!0,null,a))})}(i[t])},nm.prototype.processGridHeaders=function(e,a,l,t,h,d,p,c,i,n,r){for(var u=this,t=t.length+e,e=ac(n),g=0,f=[],s=0;s<l.length;s++)f[parseInt(s.toString(),10)]=0;c.groupSettings.columns.length&&(g=c.groupSettings.columns.length-1,t-=1),a.columns.add(t),a.style.cellPadding=new x.PdfPaddings(5.76,5.76,.5,.5),a.headers.add(l.length);var m=function(e,t,i,n,r){var s=a.headers.getHeader(e),o=s.cells.getCell(t),t=l[parseInt(e.toString(),10)].cells[c.groupSettings.columns.length?t:f[parseInt(e.toString(),10)]],e=(f[parseInt(e.toString(),10)]=f[parseInt(e.toString(),10)]+1,H.isNullOrUndefined(i.headerTextAlign)||(o.style.stringFormat=u.getHorizontalAlignment(i.headerTextAlign)),0<n&&(o.rowSpan=n,o.style.stringFormat=u.getVerticalAlignment("Bottom",o.style.stringFormat,i.textAlign)),0<r&&(o.columnSpan=r),s.style.setBorder(h),s.style.setFont(d),s.style.setTextBrush(p),o.value=i.headerText,H.isNullOrUndefined(t)||t.cellType!==oe.CellType.HeaderIndent&&t.cellType!==oe.CellType.DetailHeader||(o.value="",o.width=20),{cell:o,gridCell:t,style:o.style}),n=(u.parent.trigger(Ti,e),e),r=e.style.borders,i=e.style.font,t=e.style.textBrush;H.isNullOrUndefined(r)||s.style.setBorder(r),H.isNullOrUndefined(i)||s.style.setFont(i),H.isNullOrUndefined(t)||s.style.setTextBrush(t),H.isNullOrUndefined(n.style.verticalAlignment)||(o.style.stringFormat=u.getVerticalAlignment(n.style.verticalAlignment,o.style.stringFormat)),H.isNullOrUndefined(n.image)||(o.value=new x.PdfBitmap(n.image.base64)),H.isNullOrUndefined(n.hyperLink)||(o.value=u.setHyperLink(n))},y=function(e,t,i,n,r,s){for(var o,a=0,l=0;l<e.length;l++)s&&(n=a=a+i+(0===l?0:-1),i=0),s||e[parseInt(l.toString(),10)].visible||(n-=1),e[parseInt(l.toString(),10)].columns&&e[parseInt(l.toString(),10)].columns.length?(0<(o=y(e[parseInt(l.toString(),10)].columns,t-1,0,l+n,r+1,!1))&&m(r,l+n+g,e[parseInt(l.toString(),10)],0,o),i+=o,n=n+o-1):(e[parseInt(l.toString(),10)].visible||u.hideColumnInclude)&&(i++,m(r,l+n+g,e[parseInt(l.toString(),10)],t,0));return i};return y(n,e,0,0,0,!0),6<=a.columns.count&&i&&(a.style.allowHorizontalOverflow=!0,H.isNullOrUndefined(r)||(a.style.horizontalOverflowType=r)),a},nm.prototype.processExportProperties=function(e,t){var i,n,r;return H.isNullOrUndefined(e)?(this.currentViewData=!1,this.customDataSource=!1):(H.isNullOrUndefined(e.theme)||(this.gridTheme=e.theme),n=this.pdfPageSettings.size,this.drawHeader(e),H.isNullOrUndefined(e.footer)||(i=e.footer,r=new x.PointF(0,n.width-80-.75*i.fromBottom),n=new x.SizeF(n.width-80,.75*i.height),r=new x.RectangleF(r,n),this.pdfDocument.template.bottom=this.drawPageTemplate(new x.PdfPageTemplateElement(r),i)),H.isNullOrUndefined(e.includeHiddenColumn)||this.isGrouping||(this.hideColumnInclude=e.includeHiddenColumn),H.isNullOrUndefined(e.dataSource)?(!H.isNullOrUndefined(e.exportType)&&"CurrentPage"===e.exportType?(t=this.parent.groupSettings&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()?t:this.parent.currentViewData,this.currentViewData=!0):this.currentViewData=!1,this.customDataSource=!1):(this.customDataSource=!0,this.currentViewData=!1)),t},nm.prototype.drawHeader=function(e){var t,i,n=this,r=this.pdfPageSettings.size;H.isNullOrUndefined(e)||H.isNullOrUndefined(e.header)||(e=e.header,t=new x.PointF(0,e.fromTop),r=new x.SizeF(r.width-80,.75*e.height),t=new x.RectangleF(t,r),this.headerOnPages.length?(i=this.drawPageTemplate(new x.PdfPageTemplateElement(t),e),this.headerOnPages.filter(function(e){0<=e-1&&e-1<=n.pdfDocument.pages.count-1&&n.pdfDocument.pages.getPageByIndex(e-1).graphics.drawPdfTemplate(i.template,new x.PointF(0,0))})):this.pdfDocument.template.top=this.drawPageTemplate(new x.PdfPageTemplateElement(t),e))},nm.prototype.drawPageTemplate=function(e,t){for(var i=0,n=t.contents;i<n.length;i++){var r=n[i];switch(this.processContentValidation(r),r.type){case"Text":if(""===r.value||void 0===r.value||null===r.value||"string"!=typeof r.value)throw new Error("please enter the valid input value in text content...");this.drawText(e,r);break;case"PageNumber":this.drawPageNumber(e,r);break;case"Image":if(void 0===r.src||null===r.src||""===r.src)throw new Error("please enter the valid base64 string in image content...");this.drawImage(e,r);break;case"Line":this.drawLine(e,r);break;default:throw new Error("Please set valid content type...")}}return e},nm.prototype.processContentValidation=function(e){if(void 0===e.type||null===e.type)throw new Error("please set valid content type...");if("Line"===e.type){if(void 0===e.points||null===e.points)throw new Error("please enter valid points in "+e.type+" content...");if(void 0===e.points.x1||null===e.points.x1||"number"!=typeof e.points.x1)throw new Error("please enter valid x1 co-ordinate in "+e.type+" points...");if(void 0===e.points.y1||null===e.points.y1||"number"!=typeof e.points.y1)throw new Error("please enter valid y1 co-ordinate in "+e.type+" points...");if(void 0===e.points.x2||null===e.points.x2||"number"!=typeof e.points.x2)throw new Error("please enter valid x2 co-ordinate in "+e.type+" points...");if(void 0===e.points.y2||null===e.points.y2||"number"!=typeof e.points.y2)throw new Error("please enter valid y2 co-ordinate in "+e.type+" points...")}else{if(void 0===e.position||null===e.position)throw new Error("please enter valid position in "+e.type+" content...");if(void 0===e.position.x||null===e.position.x||"number"!=typeof e.position.x)throw new Error("please enter valid x co-ordinate in "+e.type+" position...");if(void 0===e.position.y||null===e.position.y||"number"!=typeof e.position.y)throw new Error("please enter valid y co-ordinate in "+e.type+" position...")}},nm.prototype.drawText=function(e,t){var i=this.getFont(t),n=this.getBrushFromContent(t),r=null,s=(H.isNullOrUndefined(t.style.textPenColor)||(s=this.hexToRgb(t.style.textPenColor),r=new x.PdfPen(new x.PdfColor(s.r,s.g,s.b))),null==n&&null==r&&(n=new x.PdfSolidBrush(new x.PdfColor(0,0,0))),t.value.toString()),o=.75*t.position.x,a=.75*t.position.y,l=new x.PdfStringFormat,t=(H.isNullOrUndefined(t.style.stringFormat)||(l.alignment=t.style.stringFormat.alignment),this.setContentFormat(t,l));null===t||H.isNullOrUndefined(t.format)||H.isNullOrUndefined(t.size)?e.graphics.drawString(s,i,r,n,o,a,l):e.graphics.drawString(s,i,r,n,o,a,t.size.width,t.size.height,t.format)},nm.prototype.drawPageNumber=function(e,t){var i,n,r,s=this.getFont(t),o=null,a=(o=H.isNullOrUndefined(t.style.textBrushColor)?new x.PdfSolidBrush(new x.PdfColor(0,0,0)):(a=this.hexToRgb(t.style.textBrushColor),new x.PdfSolidBrush(new x.PdfColor(a.r,a.g,a.b))),new x.PdfPageNumberField(s,o)),a=(a.numberStyle=this.getPageNumberStyle(t.pageNumberType),r=H.isNullOrUndefined(t.format)?new x.PdfCompositeField(s,o,n="{0}",a):(r="$current",-1!==t.format.indexOf(l="$total")&&-1!==t.format.indexOf(r)?((i=new x.PdfPageCountField(s)).numberStyle=this.getPageNumberStyle(t.pageNumberType),n=t.format.indexOf(l)>t.format.indexOf(r)?(n=t.format.replace(r,"0")).replace(l,"1"):(n=t.format.replace(r,"1")).replace(l,"0"),new x.PdfCompositeField(s,o,n,a,i)):-1!==t.format.indexOf(r)&&-1===t.format.indexOf(l)?(n=t.format.replace(r,"0"),new x.PdfCompositeField(s,o,n,a)):(i=new x.PdfPageCountField(s),n=t.format.replace(l,"0"),new x.PdfCompositeField(s,o,n,i))),.75*t.position.x),l=.75*t.position.y,s=this.setContentFormat(t,r.stringFormat);null===s||H.isNullOrUndefined(s.format)||H.isNullOrUndefined(s.size)||(r.stringFormat=s.format,r.bounds=new x.RectangleF(a,l,s.size.width,s.size.height)),r.draw(e.graphics,a,l)},nm.prototype.drawImage=function(e,t){var i=.75*t.position.x,n=.75*t.position.y,r=H.isNullOrUndefined(t.size)?void 0:.75*t.size.width,s=H.isNullOrUndefined(t.size)?void 0:.75*t.size.height,t=new x.PdfBitmap(t.src);H.isNullOrUndefined(r)?e.graphics.drawImage(t,i,n):e.graphics.drawImage(t,i,n,r,s)},nm.prototype.drawLine=function(e,t){var i=.75*t.points.x1,n=.75*t.points.y1,r=.75*t.points.x2,s=.75*t.points.y2,o=this.getPenFromContent(t);H.isNullOrUndefined(t.style)||null===t.style||(H.isNullOrUndefined(t.style.penSize)||null===t.style.penSize||"number"!=typeof t.style.penSize||(o.width=.75*t.style.penSize),o.dashStyle=this.getDashStyle(t.style.dashStyle)),e.graphics.drawLine(o,i,n,r,s)},nm.prototype.processAggregates=function(e,t,i,n,r,s,o,a,l,h,d,p){for(var c=0,u=e;c<u.length;c++){for(var g=u[c],f=-1,m=0,y=!0,v=[],S=d?0:1,C=void 0,w=(H.isNullOrUndefined(a)&&((C=t.rows.addRow()).style.setBorder(i),C.style.setFont(n),C.style.setTextBrush(r),C.style.setBackgroundBrush(s)),this.parent.allowRowDragAndDrop&&H.isNullOrUndefined(this.parent.rowDropSettings.targetID)),b=0;b<t.columns.count+S;b++){var I,R,x,D,T,E,O=g.cells[parseInt(m.toString(),10)];if(O.cellType===oe.CellType.DetailFooterIntent)b--,m++;else if(w&&O.cellType===oe.CellType.Indent)w=!1,b--,m++;else{if(!this.hideColumnInclude){for(;void 0===O.visible;)O.cellType!==oe.CellType.DetailFooterIntent&&(H.isNullOrUndefined(a)||H.isNullOrUndefined(a.cells.getCell(b).value)?v.push(""):(v.push(a.cells.getCell(b).value),y=!1,o||(b+=1)),b+=1,m+=1,O=g.cells[parseInt(m.toString(),10)]);for(;!H.isNullOrUndefined(O.visible)&&!O.visible;)m+=1,O=g.cells[parseInt(m.toString(),10)]}O.isDataCell?(T={},I=!H.isNullOrUndefined(O.column.footerTemplate),R=!H.isNullOrUndefined(O.column.groupFooterTemplate),D=!H.isNullOrUndefined(O.column.groupCaptionTemplate),I||D||R?(T=(E=this.getTemplateFunction(T,b,f,O)).templateFunction,f=E.leastCaptionSummaryIndex,D=void 0,x=g.data[O.column.field||O.column.columnName],D=(this.parent.isReact||this.parent.isVue||this.parent.isVue3||this.parent.isAngular)&&"string"!=typeof O.column.footerTemplate&&"string"!=typeof O.column.groupFooterTemplate&&"string"!=typeof O.column.groupCaptionTemplate?(D=x[O.column.type],H.isNullOrUndefined(D)?"":D):(D=T[H.getEnumValue(oe.CellType,O.cellType)](x,this.parent),this.parent.isVue3&&!H.isNullOrUndefined(D[1])?D[1].textContent:H.isNullOrUndefined(D[0])?"":D[0].textContent),y=!1,T={row:g,type:I?"Footer":R?"GroupFooter":"GroupCaption",style:(H.isNullOrUndefined(a)?C:a).cells,cell:O,value:D},this.parent.trigger(Qn,T),v.push(T.value)):(E=this.getSummaryWithoutTemplate(g.data[O.column.field]),H.isNullOrUndefined(E)||v.push(E))):v.push(""),y&&""!==v[parseInt(b.toString(),10)]&&!H.isNullOrUndefined(v[parseInt(b.toString(),10)])&&null!==v[parseInt(b.toString(),10)]&&(y=!1),m+=1}}if(!d)if(o)for(b=p.groupSettings.columns.length;b<v.length-1;b++)v[parseInt(b.toString(),10)]=v[b+1],v[b+1]=v[b+2]||"";else v.splice(0,1);if(!y)if(o)for(b=0;b<t.columns.count;b++)a.cells.getCell(b).value=v[parseInt(b.toString(),10)].toString(),b===l&&-1!==f&&1!==f?a.cells.getCell(b).columnSpan=f-1-l:b===l&&-1===f&&(a.cells.getCell(b).columnSpan=t.columns.count-l);else for(var b=0;b<t.columns.count;b++)C.cells.getCell(b).value=v[parseInt(b.toString(),10)].toString()}},nm.prototype.getTemplateFunction=function(e,t,i,n){return H.isNullOrUndefined(n.column.footerTemplate)||n.cellType!==oe.CellType.Summary?H.isNullOrUndefined(n.column.groupCaptionTemplate)?e[H.getEnumValue(oe.CellType,oe.CellType.GroupSummary)]=H.compile(n.column.groupFooterTemplate):(-1===i&&(i=t),e[H.getEnumValue(oe.CellType,oe.CellType.CaptionSummary)]=H.compile(n.column.groupCaptionTemplate)):e[H.getEnumValue(oe.CellType,oe.CellType.Summary)]=H.compile(n.column.footerTemplate),{templateFunction:e,leastCaptionSummaryIndex:i}},nm.prototype.getSummaryWithoutTemplate=function(e){if(H.isNullOrUndefined(e.Sum)){if(H.isNullOrUndefined(e.Average)){if(H.isNullOrUndefined(e.Max)){if(H.isNullOrUndefined(e.Min)){if(H.isNullOrUndefined(e.Count)){if(H.isNullOrUndefined(e.TrueCount)){if(H.isNullOrUndefined(e.FalseCount))return H.isNullOrUndefined(e.Custom)?void 0:e.Custom;return e.FalseCount}return e.TrueCount}return e.Count}return e.Min}return e.Max}return e.Average}return e.Sum},nm.prototype.setColumnProperties=function(e,t,i,n,r){for(var s=n.groupSettings.columns.length?n.groupSettings.columns.length-1:0,o=0;o<s;o++)t.columns.getColumn(o).width=20;for(o=0;o<e.length;o++)H.isNullOrUndefined(e[parseInt(o.toString(),10)].textAlign)||(t.columns.getColumn(o+s).format=this.getHorizontalAlignment(e[parseInt(o.toString(),10)].textAlign)),t.style.allowHorizontalOverflow&&!H.isNullOrUndefined(e[parseInt(o.toString(),10)].width)&&r&&(t.columns.getColumn(o+s).width="number"==typeof e[parseInt(o.toString(),10)].width?.75*e[parseInt(o.toString(),10)].width:.75*i.getConvertedWidth(e[parseInt(o.toString(),10)].width))},nm.prototype.setRecordThemeStyle=function(e,t){H.isNullOrUndefined(this.gridTheme)||H.isNullOrUndefined(this.gridTheme.record)?e.style.setTextBrush(new x.PdfSolidBrush(new x.PdfColor(0,0,0))):(r=H.isNullOrUndefined(this.gridTheme.record.fontName)?x.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.record.fontName),n=H.isNullOrUndefined(this.gridTheme.record.fontSize)?9.75:this.gridTheme.record.fontSize,i=this.getFontStyle(this.gridTheme.record),r=new x.PdfStandardFont(r,n,i),H.isNullOrUndefined(this.gridTheme.record.font)||(r=this.gridTheme.record.font),e.style.setFont(r),n=new x.PdfColor,H.isNullOrUndefined(this.gridTheme.record.fontColor)||(i=this.hexToRgb(this.gridTheme.record.fontColor),n=new x.PdfColor(i.r,i.g,i.b)),e.style.setTextBrush(new x.PdfSolidBrush(n)));var i,n,r=this.gridTheme&&this.gridTheme.record&&this.gridTheme.record.border?this.getBorderStyle(this.gridTheme.record.border):t;return e.style.setBorder(r),e},nm.prototype.processRecord=function(e,t,i,n,r,s,o,a,l){for(var h=0,d=a.getGridRowModel(t,n,i,l);h<d.length;h++){for(var p,c,u,g,f=d[h],m=(l++,this.rowIndex=l,this.setRecordThemeStyle(r.rows.addRow(),e)),y=f.cells.length,v=0;v<y;v++){var S=f.cells[parseInt(v.toString(),10)];if(S.cellType===oe.CellType.Data){var C,w,b,S=S.column,I="";I=H.isNullOrUndefined(S)||"rownumber"!==S.type?(C=S.field,C=H.isNullOrUndefined(C)?"":S.valueAccessor(C,f.data,S),H.isNullOrUndefined(C)?"":C):(f.index+1).toString();if(S.isForeignColumn&&S.isForeignColumn()&&(C=a.getFData(I,S),I=H.getValue(S.foreignKeyValue,C)),(b={data:f.data,value:I,column:S,style:void 0,colSpan:1,cell:w=m.cells.getCell(v)}).value="boolean"===b.column.type&&"string"==typeof b.value?b.value:this.exportValueFormatter.formatCellValue(b),this.parent.trigger(Di,b),H.isNullOrUndefined(b.image)||(b.value=new x.PdfBitmap(b.image.base64),b.value.height=b.image.height||b.value.height,b.value.width=b.image.width||b.value.width),w.value=b.value,H.isNullOrUndefined(b.hyperLink)||(w.value=this.setHyperLink(b)),H.isNullOrUndefined(b.style)||this.processCellStyle(w,b),1<b.colSpan){v+1+b.colSpan>m.cells.count&&(b.colSpan=m.cells.count-(v+1)),w.columnSpan=b.colSpan;for(var R=1;R<w.columnSpan;R++)m.cells.getCell(v+R).value="";v+=b.colSpan-1}}}f.isExpand&&(p=this.setRecordThemeStyle(r.rows.addRow(),e),u=this.parent.childGrid||this.parent.detailTemplate?0:s,(w=p.cells.getCell(u)).columnSpan=p.cells.count-u,w.style.cellPadding=new x.PdfPaddings(10,10,10,10),this.parent.childGrid?(i.isPrinting=!0,u=!H.isNullOrUndefined(o)&&o.exportType?o.exportType:"AllPages",c=(u=this.helper.createChildGrid(i,f,u,this.gridPool)).childGrid,u=u.element,c.actionFailure=a.failureHandler(this.gridPool,c,this.globalResolve),g=H.extend(o,{columns:null,dataSource:null,query:null}),this.parent.trigger(bi,b={childGrid:c,row:f,cell:w,exportProperties:g}),c.beforeDataBound=this.childGridCell(w,c,g),c.appendTo(u)):this.parent.detailTemplate&&(this.parent.trigger(Ii,b={parentRow:f,row:p,value:{},action:"pdfexport",gridInstance:i}),w.value=this.processDetailTemplate(b))),this.parent.notify(tn,{type:"pdf",rowObj:f})}return l},nm.prototype.processDetailTemplate=function(e){var o=this;if(e.value.columnHeader||e.value.rows){var t=new x.PdfGrid,i=this.getHeaderThemeStyle(),a=i.border,l=i.font,h=i.brush,n=function(e,t,i){i&&(t.style.setBorder(a),t.style.setFont(l),t.style.setTextBrush(h));for(var n=0;n<e.cells.length;n++){var r=e.cells[parseInt(n.toString(),10)],s=t.cells.getCell(r.index||n);0<r.rowSpan&&(s.rowSpan=r.rowSpan),0<r.colSpan&&(s.columnSpan=r.colSpan),s.value=r.value,H.isNullOrUndefined(r.image)||(s.value=new x.PdfBitmap(r.image.base64),s.value.height=r.image.height,s.value.width=r.image.width),H.isNullOrUndefined(r.hyperLink)||(s.value=o.setHyperLink(r)),H.isNullOrUndefined(r.style)||(r={style:{backgroundColor:r.style.backColor,textAlignment:r.style.pdfTextAlignment,verticalAlignment:r.style.pdfVerticalAlignment,textBrushColor:r.style.fontColor,textPenColor:r.style.pdfTextPenColor,fontFamily:r.style.pdfFontFamily,fontSize:r.style.fontSize,bold:r.style.bold,italic:r.style.italic,underline:r.style.underline,strikeout:r.style.strikeThrough,border:r.style.pdfBorder,paragraphIndent:r.style.pdfParagraphIndent,cellPadding:r.style.pdfCellPadding}},o.processCellStyle(s,r))}};if(e.value.columnCount?t.columns.add(e.value.columnCount):e.value.columnHeader&&e.value.columnHeader.length?t.columns.add(e.value.columnHeader[0].cells.length):e.value.rows&&e.value.rows.length&&t.columns.add(e.value.rows[0].cells.length),e.value.columnHeader){t.headers.add(e.value.columnHeader.length);for(var r=0;r<e.value.columnHeader.length;r++){var s=t.headers.getHeader(parseInt(r.toString(),10));n(e.value.columnHeader[parseInt(r.toString(),10)],s,!0)}}if(e.value.rows)for(var d=0,p=e.value.rows;d<p.length;d++)n(p[d],this.setRecordThemeStyle(t.rows.addRow(),a),!1);return t}return e.value.image?new x.PdfBitmap(e.value.image.base64):e.value.text||(e.value.hyperLink?this.setHyperLink(e.value):"")},nm.prototype.setHyperLink=function(e){var t=new x.PdfTextWebLink;return t.url=e.hyperLink.target,t.text=e.hyperLink.displayText||e.hyperLink.target,t.font=new x.PdfStandardFont(x.PdfFontFamily.Helvetica,9.75),t.brush=new x.PdfSolidBrush(new x.PdfColor(51,102,187)),t},nm.prototype.childGridCell=function(t,i,n){var r=this;return function(e){return i.beforeDataBound=null,e.cancel=!0,t.value=r.processGridExport(i,e,n),i.destroy(),H.detach(i.element),r.gridPool[i.id]=!0,r.helper.checkAndExport(r.gridPool,r.globalResolve),t}},nm.prototype.processCellStyle=function(e,t){var i,n,r,s;H.isNullOrUndefined(t.style.backgroundColor)||(i=this.hexToRgb(t.style.backgroundColor),e.style.backgroundBrush=new x.PdfSolidBrush(new x.PdfColor(i.r,i.g,i.b))),H.isNullOrUndefined(t.style.textAlignment)||(e.style.stringFormat=this.getHorizontalAlignment(t.style.textAlignment)),H.isNullOrUndefined(t.style.cellPadding)||(e.style.cellPadding=t.style.cellPadding),H.isNullOrUndefined(t.style.verticalAlignment)||(e.style.stringFormat=this.getVerticalAlignment(t.style.verticalAlignment,e.style.stringFormat)),H.isNullOrUndefined(t.style.textBrushColor)||(i=this.hexToRgb(t.style.textBrushColor),e.style.textBrush=new x.PdfSolidBrush(new x.PdfColor(i.r,i.g,i.b))),H.isNullOrUndefined(t.style.textPenColor)||(i=this.hexToRgb(t.style.textPenColor),e.style.textPen=new x.PdfPen(new x.PdfColor(i.r,i.g,i.b))),H.isNullOrUndefined(t.style.fontFamily)&&H.isNullOrUndefined(t.style.fontSize)&&H.isNullOrUndefined(t.style.bold)&&H.isNullOrUndefined(t.style.italic)&&H.isNullOrUndefined(t.style.underline)&&H.isNullOrUndefined(t.style.strikeout)||(e.style.font=this.getFont(t)),H.isNullOrUndefined(t.style.border)||(i=new x.PdfBorders,n=t.style.border.width,n=H.isNullOrUndefined(n)||"number"!=typeof n?void 0:.75*n,r=new x.PdfColor(196,196,196),H.isNullOrUndefined(t.style.border.color)||(s=this.hexToRgb(t.style.border.color),r=new x.PdfColor(s.r,s.g,s.b)),s=new x.PdfPen(r,n),H.isNullOrUndefined(t.style.border.dashStyle)||(s.dashStyle=this.getDashStyle(t.style.border.dashStyle)),i.all=s,e.style.borders=i),H.isNullOrUndefined(t.style.paragraphIndent)||(e.style.stringFormat=new x.PdfStringFormat,e.style.stringFormat.paragraphIndent=t.style.paragraphIndent)},nm.prototype.getHorizontalAlignment=function(e,t){switch(void 0===t&&(t=new x.PdfStringFormat),e){case"Right":t.alignment=x.PdfTextAlignment.Right;break;case"Center":t.alignment=x.PdfTextAlignment.Center;break;case"Justify":t.alignment=x.PdfTextAlignment.Justify;break;case"Left":t.alignment=x.PdfTextAlignment.Left}return t},nm.prototype.getVerticalAlignment=function(e,t,i){switch(void 0===t&&(t=new x.PdfStringFormat,t=this.getHorizontalAlignment(i,t)),e){case"Bottom":t.lineAlignment=x.PdfVerticalAlignment.Bottom;break;case"Middle":t.lineAlignment=x.PdfVerticalAlignment.Middle;break;case"Top":t.lineAlignment=x.PdfVerticalAlignment.Top}return t},nm.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}},nm.prototype.getFont=function(e){var t,i,n;return e.font||(t=H.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize,i=H.isNullOrUndefined(e.style.fontFamily)?x.PdfFontFamily.TimesRoman:this.getFontFamily(e.style.fontFamily),n=x.PdfFontStyle.Regular,!H.isNullOrUndefined(e.style.bold)&&e.style.bold&&(n|=x.PdfFontStyle.Bold),!H.isNullOrUndefined(e.style.italic)&&e.style.italic&&(n|=x.PdfFontStyle.Italic),!H.isNullOrUndefined(e.style.underline)&&e.style.underline&&(n|=x.PdfFontStyle.Underline),!H.isNullOrUndefined(e.style.strikeout)&&e.style.strikeout&&(n|=x.PdfFontStyle.Strikeout),new x.PdfStandardFont(i,t,n))},nm.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}},nm.prototype.setContentFormat=function(e,t){if(H.isNullOrUndefined(e.size))return null;var i=.75*e.size.width,n=.75*e.size.height;if(t=new x.PdfStringFormat(x.PdfTextAlignment.Left,x.PdfVerticalAlignment.Middle),!H.isNullOrUndefined(e.style.hAlign))switch(e.style.hAlign){case"Right":t.alignment=x.PdfTextAlignment.Right;break;case"Center":t.alignment=x.PdfTextAlignment.Center;break;case"Justify":t.alignment=x.PdfTextAlignment.Justify;break;default:t.alignment=x.PdfTextAlignment.Left}return{format:t=H.isNullOrUndefined(e.style.vAlign)?t:this.getVerticalAlignment(e.style.vAlign,t),size:new x.SizeF(i,n)}},nm.prototype.getPageSize=function(e){switch(e){case"Letter":return new x.SizeF(612,792);case"Note":return new x.SizeF(540,720);case"Legal":return new x.SizeF(612,1008);case"A0":return new x.SizeF(2380,3368);case"A1":return new x.SizeF(1684,2380);case"A2":return new x.SizeF(1190,1684);case"A3":return new x.SizeF(842,1190);case"A5":return new x.SizeF(421,595);case"A6":return new x.SizeF(297,421);case"A7":return new x.SizeF(210,297);case"A8":return new x.SizeF(148,210);case"A9":return new x.SizeF(105,148);case"B0":return new x.SizeF(2836,4008);case"B1":return new x.SizeF(2004,2836);case"B2":return new x.SizeF(1418,2004);case"B3":return new x.SizeF(1002,1418);case"B4":return new x.SizeF(709,1002);case"B5":return new x.SizeF(501,709);case"Archa":return new x.SizeF(648,864);case"Archb":return new x.SizeF(864,1296);case"Archc":return new x.SizeF(1296,1728);case"Archd":return new x.SizeF(1728,2592);case"Arche":return new x.SizeF(2592,3456);case"Flsa":return new x.SizeF(612,936);case"HalfLetter":return new x.SizeF(396,612);case"Letter11x17":return new x.SizeF(792,1224);case"Ledger":return new x.SizeF(1224,792);default:return new x.SizeF(595,842)}},nm.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}},nm.prototype.getPenFromContent=function(e){var t=new x.PdfPen(new x.PdfColor(0,0,0));return H.isNullOrUndefined(e.style)||null===e.style||H.isNullOrUndefined(e.style.penColor)||(e=this.hexToRgb(e.style.penColor),t=new x.PdfPen(new x.PdfColor(e.r,e.g,e.b))),t},nm.prototype.getBrushFromContent=function(e){var t=null;return H.isNullOrUndefined(e.style.textBrushColor)||(e=this.hexToRgb(e.style.textBrushColor),t=new x.PdfSolidBrush(new x.PdfColor(e.r,e.g,e.b))),t},nm.prototype.hexToRgb=function(e){if(null===e||""===e||7!==e.length)throw new Error("please set valid hex value for color...");e=e.substring(1);e=parseInt(e,16);return{r:e>>16&255,g:e>>8&255,b:255&e}},nm.prototype.getFontStyle=function(e){var t=x.PdfFontStyle.Regular;return!H.isNullOrUndefined(e)&&e.bold&&(t|=x.PdfFontStyle.Bold),!H.isNullOrUndefined(e)&&e.italic&&(t|=x.PdfFontStyle.Italic),!H.isNullOrUndefined(e)&&e.underline&&(t|=x.PdfFontStyle.Underline),!H.isNullOrUndefined(e)&&e.strikeout&&(t|=x.PdfFontStyle.Strikeout),t},nm.prototype.getBorderStyle=function(e){var t,i,n,r=new x.PdfBorders;return H.isNullOrUndefined(e)?r.all=new x.PdfPen(new x.PdfColor(234,234,234)):(t=e.width,t=H.isNullOrUndefined(t)||"number"!=typeof t?void 0:.75*t,i=new x.PdfColor(196,196,196),H.isNullOrUndefined(e.color)||(n=this.hexToRgb(e.color),i=new x.PdfColor(n.r,n.g,n.b)),n=new x.PdfPen(i,t),H.isNullOrUndefined(e.dashStyle)||(n.dashStyle=this.getDashStyle(e.dashStyle)),r.all=n),r},nm.prototype.destroy=function(){};var im=nm;function nm(e){this.hideColumnInclude=!1,this.currentViewData=!1,this.customDataSource=!1,this.isGrouping=!1,this.headerOnPages=[],this.drawPosition={xPosition:0,yPosition:0},H.initializeTelemetryFeature("PdfExport","DataGrid"),this.parent=e,this.helper=new Yf(e),this.gridPool={}}rm=function(e,t){return(rm=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}rm(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(am,sm=vo),am.prototype.destroyButtons=function(e){for(var t=0;t<this.childRefs.length;t++)!this.childRefs[parseInt(t.toString(),10)]||this.childRefs[parseInt(t.toString(),10)].isDestroyed||this.parent.editSettings.showAddNewRow&&this.parent.enableVirtualization&&I(this.childRefs[parseInt(t.toString(),10)].element,"e-addedrow")||(this.childRefs[parseInt(t.toString(),10)].destroy(),this.childRefs[parseInt(t.toString(),10)].element&&(this.childRefs[parseInt(t.toString(),10)].element.innerHTML=""));if(this.childRefs=[],"refreshCommandColumn"===e.type){var i=this.parent.element.querySelectorAll(".e-gridcontent .e-unboundcell");if(i.length)for(t=0;t<i.length;t++)!i[parseInt(t.toString(),10)]||this.parent.editSettings.showAddNewRow&&this.parent.enableVirtualization&&I(i[parseInt(t.toString(),10)],"e-addedrow")||(i[parseInt(t.toString(),10)].querySelector(".e-unboundcelldiv")&&(i[parseInt(t.toString(),10)].querySelector(".e-unboundcelldiv").innerHTML=""),i[parseInt(t.toString(),10)].innerHTML="")}else this.parent.off(s,this.destroyButtons),this.parent.off(Vr,this.destroyButtons)},am.prototype.render=function(e,t,i,n){var r,s=this.element.cloneNode();if(s.appendChild(this.unbounDiv.cloneNode()),s.setAttribute("aria-label",this.localizer.getConstant("CommandColumnAria")+e.column.headerText),e.column.commandsTemplate)!this.parent.isReact||"string"==typeof e.column.commandsTemplate||e.column.commandsTemplate.prototype&&e.column.commandsTemplate.prototype.CSPTemplate?Ip(s.firstElementChild,e.column.getColumnTemplate()(t,this.parent,"commandsTemplate",null,null,null,null,this.parent.root)):(r=this.parent+"commandsTemplate",e.column.getColumnTemplate()(t,this.parent,"commandsTemplate",r,null,null,s.firstElementChild),this.parent.renderTemplates());else for(var o=0,a=e.commands;o<a.length;o++)var l=a[o],s=this.renderButton(s,l,i["data-index"],l.uid);return this.setAttributes(s,e,i),!this.parent.enableVirtualization&&this.parent.isEdit&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&!this.parent.element.querySelector(".e-editedrow"))||n&&this.parent.enableVirtualization?(H.addClass([].slice.call(s.getElementsByClassName("e-edit-delete")),"e-hide"),H.removeClass([].slice.call(s.getElementsByClassName("e-save-cancel")),"e-hide")):(H.addClass([].slice.call(s.getElementsByClassName("e-save-cancel")),"e-hide"),H.removeClass([].slice.call(s.getElementsByClassName("e-edit-delete")),"e-hide")),this.parent.isFrozenGrid()&&zc(this.parent,e.column,s),s},am.prototype.renderButton=function(e,t,i,n){var r=this.buttonElement.cloneNode(),i=(H.attributes(r,{id:this.parent.element.id+(t.type||"")+"_"+i+"_"+n,type:"button",title:H.isNullOrUndefined(t.title)?t.buttonOption.content||this.localizer.getConstant(t.type)||t.type:t.title,"data-uid":n}),r.onclick=t.buttonOption.click,t.buttonOption.cssClass=this.parent.cssClass?t.buttonOption.cssClass+" "+this.parent.cssClass:t.buttonOption.cssClass,new M.Button(t.buttonOption,r));switch(this.childRefs.push(i),i.commandType=t.type,e.firstElementChild.appendChild(i.element),t.type){case"Edit":case"Delete":H.addClass([r],["e-edit-delete","e-"+t.type.toLowerCase()+"button"]);break;case"Cancel":case"Save":H.addClass([r],["e-save-cancel","e-"+t.type.toLowerCase()+"button"])}return e};var rm,sm,om=am;function am(e,t){e=sm.call(this,e,t)||this;return e.buttonElement=e.parent.createElement("button",{}),e.unbounDiv=e.parent.createElement("div",{className:"e-unboundcelldiv"}),e.childRefs=[],e.element=e.parent.createElement("TD",{className:"e-rowcell e-unboundcell",attrs:{tabindex:"-1",role:"gridcell"}}),e.parent.on(s,e.destroyButtons,e),e.parent.on(Vr,e.destroyButtons,e),e}hm.prototype.initiateRender=function(){this.locator.getService("cellRendererFactory").addCellRenderer(oe.CellType.CommandColumn,new om(this.parent,this.locator))},hm.prototype.commandClickHandler=function(e){var t=this.parent,i=H.closest(e.target,"button");if(i&&H.closest(e.target,".e-unboundcell")){for(var n,r=i.ej2_instances[0],s=r.commandType,o=i.getAttribute("data-uid"),e=t.getRowObjectFromUID(H.closest(i,"."+Ts).getAttribute("data-uid")),a=this.parent.columnModel,l=0;l<a.length;l++)if(a[parseInt(l.toString(),10)].commands)for(var h=a[parseInt(l.toString(),10)].commands,d=0;d<h.length;d++){var p;h[parseInt(d.toString(),10)].uid===o&&h[parseInt(d.toString(),10)].type===s?n=h[parseInt(d.toString(),10)]:(p=[].slice.call(H.closest(i,".e-unboundcell").querySelectorAll("button")).findIndex(function(e){return e===i}))<h.length&&h[parseInt(p.toString(),10)].type===s&&String(h[parseInt(d.toString(),10)].uid)===o&&(n=h[parseInt(p.toString(),10)])}e={cancel:!1,target:i,commandColumn:n,rowData:H.isNullOrUndefined(e)?void 0:e.data};this.parent.trigger(dt,e,function(e){if(!r.disabled&&t.editModule&&!e.cancel)switch(s){case"Edit":"Batch"!==t.editSettings.mode&&t.editModule.endEdit(),t.editModule.startEdit(H.closest(i,"tr"));break;case"Cancel":t.isFocusFirstCell=!0,t.editModule.closeEdit();break;case"Save":t.isFocusFirstCell=!0,t.editModule.endEdit();break;case"Delete":"Batch"!==t.editSettings.mode&&t.editModule.endEdit(),t.commandDelIndex=parseInt(H.closest(i,"tr").getAttribute(D),10)-1,t.clearSelection(),t.selectRow(t.commandDelIndex,!1),t.isFocusFirstCell=!0,t.editModule.deleteRecord(),t.editSettings.showDeleteConfirmDialog&&!t.allowSelection||(t.commandDelIndex=void 0)}})}},hm.prototype.getModuleName=function(){return"commandColumn"},hm.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},hm.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(_t,this.commandClickHandler),this.parent.off(Gt,this.keyPressHandler),this.parent.off(mt,this.load),this.parent.off(s,this.destroy))},hm.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(_t,this.commandClickHandler,this),this.parent.on(Gt,this.keyPressHandler,this),this.parent.on(mt,this.load,this),this.parent.on(s,this.destroy,this))},hm.prototype.keyPressHandler=function(e){"enter"!==e.action&&"space"!==e.action||!H.closest(e.target,".e-unboundcelldiv")||(this.commandClickHandler(e),e.preventDefault())},hm.prototype.load=function(){for(var e=this.parent.columnModel,t=0;t<e.length;t++)if(e[parseInt(t.toString(),10)].commands)for(var i=e[parseInt(t.toString(),10)].commands,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].uid=bp("gridcommand")};var lm=hm;function hm(e,t){this.parent=e,this.locator=t,this.initiateRender(),this.addEventListener()}var T={header:"."+ms,content:"."+vs,edit:".e-inline-edit",batchEdit:".e-editedbatchcell",cellEdit:".e-editedcell",editIcon:"e-edit",pager:".e-gridpager",delete:"e-delete",save:"e-save",cancel:"e-cancel",copy:"e-copy",pdf:"e-pdfexport",group:"e-icon-group",ungroup:"e-icon-ungroup",csv:"e-csvexport",excel:"e-excelexport",fPage:"e-icon-first",nPage:"e-icon-next",lPage:"e-icon-last",pPage:"e-icon-prev",ascending:"e-icon-ascending",descending:"e-icon-descending",groupHeader:"e-groupdroparea",touchPop:"e-gridpopup",autofit:"e-icon-autofit",autofitall:"e-icon-autofitall",chart:"e-grid-chart-icon",barChart:"e-grid-bar-chart-icon",bar:"e-grid-bar-icon",stackingBar:"e-grid-stacking-bar-icon",stackingBar100:"e-grid-stacking-bar-100-icon",pie:"e-grid-pie-icon",columnChart:"e-grid-column-chart-icon",column:"e-grid-column-icon",stackingColumn:"e-grid-stacking-column-icon",stackingColumn100:"e-grid-stacking-column-100-icon",lineChart:"e-grid-line-chart-icon",line:"e-grid-line-icon",stackingLine:"e-grid-stacking-line-icon",stackingLine100:"e-grid-stacking-line-100-icon",areaChart:"e-grid-area-chart-icon",area:"e-grid-area-icon",stackingArea:"e-grid-stacking-area-icon",stackingArea100:"e-grid-stacking-area-100-icon",scatter:"e-grid-scatter-icon",pin:"e-grid-icon-pin",unpin:"e-grid-icon-unpin"},dm=(pm.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(St,this.enableAfterRenderMenu,this),this.parent.on(ft,this.render,this),this.parent.on(s,this.destroy,this))},pm.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ft,this.render),this.parent.off(St,this.enableAfterRenderMenu),this.parent.off(s,this.destroy),H.EventHandler.remove(this.element,"keydown",this.keyDownHandler.bind(this)))},pm.prototype.keyDownHandler=function(e){"Tab"!==e.code&&9!==e.which||this.contextMenu.close(),"Escape"===e.code&&(this.contextMenu.close(),this.parent.notify(wn,{}))},pm.prototype.render=function(){this.parent.element.classList.add("e-noselect"),this.l10n=this.serviceLocator.getService("localization"),this.element=this.parent.createElement("ul",{id:this.gridID+"_cmenu"}),H.EventHandler.add(this.element,"keydown",this.keyDownHandler.bind(this)),this.parent.element.appendChild(this.element);var e="#"+this.gridID;this.contextMenu=new B.ContextMenu({items:this.getMenuItems(),enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,target:e,select:this.contextMenuItemClick.bind(this),beforeOpen:this.contextMenuBeforeOpen.bind(this),onOpen:this.contextMenuOpen.bind(this),onClose:this.contextMenuOnClose.bind(this),beforeClose:this.contextMenuBeforeClose.bind(this),cssClass:this.parent.cssClass?"e-grid-menu "+this.parent.cssClass:"e-grid-menu"}),this.contextMenu.isAngular=Oc(this.parent),this.contextMenu.appendTo(this.element)},pm.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.contextMenu&&(this.contextMenu.destroy(),H.remove(this.element),this.parent.element.classList.remove("e-noselect")),this.render())},pm.prototype.getMenuItems=function(){for(var e,t,i,n=[],r=[],s=[],o=[],a=[],l=[],h=[],d=0,p=this.parent.contextMenuItems;d<p.length;d++){var c=p[d];"string"==typeof c&&-1!==this.getDefaultItems().indexOf(c)?-1!==this.barChartList.indexOf(c)?o.push(this.buildDefaultItems(c)):-1!==this.pieChartList.indexOf(c)?e=this.buildDefaultItems(c):-1!==this.columnChartList.indexOf(c)?a.push(this.buildDefaultItems(c)):-1!==this.lineChartList.indexOf(c)?l.push(this.buildDefaultItems(c)):-1!==this.areaChartList.indexOf(c)?h.push(this.buildDefaultItems(c)):-1!==this.scatterChartList.indexOf(c)?t=this.buildDefaultItems(c):(-1!==c.toLocaleLowerCase().indexOf("export")?r:n).push(this.buildDefaultItems(c)):"string"!=typeof c&&n.push(c)}return 0<l.length&&((i=this.buildDefaultItems("LineChart")).items=l,s.push(i)),0<h.length&&((i=this.buildDefaultItems("AreaChart")).items=h,s.push(i)),0<a.length&&((i=this.buildDefaultItems("ColumnChart")).items=a,s.push(i)),0<o.length&&((i=this.buildDefaultItems("BarChart")).items=o,s.push(i)),t&&s.push(t),e&&s.push(e),0<s.length&&((i=this.buildDefaultItems("Chart")).items=s,n.push(i)),0<r.length&&((s=this.buildDefaultItems("export")).items=r,n.push(s)),n},pm.prototype.getLastPage=function(){var e=Math.floor(this.parent.pageSettings.totalRecordsCount/this.parent.pageSettings.pageSize);return this.parent.pageSettings.totalRecordsCount%this.parent.pageSettings.pageSize&&(e+=1),e},pm.prototype.contextMenuOpen=function(){this.isOpen=!0},pm.prototype.contextMenuItemClick=function(e){var t=this.getKeyFromId(e.item.id);switch(t){case"AutoFitAll":this.parent.autoFitColumns([]);break;case"AutoFit":this.parent.autoFitColumns(this.targetColumn.field);break;case"Group":this.parent.groupColumn(this.targetColumn.field);break;case"Ungroup":this.parent.ungroupColumn(this.targetColumn.field);break;case"Edit":this.parent.editModule&&("Batch"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode?this.row&&this.cell&&!isNaN(parseInt(this.cell.getAttribute(zs),10)-1)&&this.parent.editModule.editCell(parseInt(this.row.getAttribute(D),10)-1,this.parent.getColumns()[parseInt(this.cell.getAttribute(zs),10)-1].field):(this.parent.editModule.endEdit(),this.parent.editModule.startEdit(this.row)));break;case"Delete":this.parent.editModule&&("Batch"!==this.parent.editSettings.mode&&"Cell"!==this.parent.editSettings.mode&&this.parent.editModule.endEdit(),1===this.parent.getSelectedRecords().length?(this.parent.isCheckBoxSelection||(this.parent.isFocusFirstCell=!0),this.parent.editModule.deleteRow(this.row)):this.parent.deleteRecord());break;case"Save":this.parent.editModule&&(this.parent.isEdit&&"Batch"!==this.parent.editSettings.mode&&(this.parent.isFocusFirstCell=!0),this.parent.editModule.endEdit());break;case"Cancel":this.parent.editModule&&(this.parent.isEdit&&(this.parent.isFocusFirstCell=!0),this.parent.editModule.closeEdit());break;case"Copy":this.parent.copy();break;case"PdfExport":this.parent.pdfExport();break;case"ExcelExport":this.parent.excelExport();break;case"CsvExport":this.parent.csvExport();break;case"SortAscending":this.isOpen=!1,this.parent.sortColumn(this.targetColumn.field,"Ascending");break;case"SortDescending":this.isOpen=!1,this.parent.sortColumn(this.targetColumn.field,"Descending");break;case"FirstPage":this.parent.goToPage(1);break;case"PrevPage":this.parent.goToPage(this.parent.pageSettings.currentPage-1);break;case"LastPage":this.parent.goToPage(this.getLastPage());break;case"NextPage":this.parent.goToPage(this.parent.pageSettings.currentPage+1);break;case"Bar":case"StackingBar":case"StackingBar100":case"Pie":case"Column":case"StackingColumn":case"StackingColumn100":case"Line":case"StackingLine":case"StackingLine100":case"Area":case"StackingArea":case"StackingArea100":case"Scatter":e.records=this.parent.getSelectedRecords(),e.gridInstance=this.parent,e.chartType=t;break;case"PinRow":this.parent.pinRows([this.targetRowdata.rowData]);break;case"UnpinRow":this.parent.unpinRows([this.targetRowdata.rowData])}e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger(Ei,e)},pm.prototype.contextMenuOnClose=function(e){0<e.items.length&&e.items[0].parentObj instanceof B.ContextMenu&&this.updateItemStatus(),this.parent.notify(xr,{isOpen:!1})},pm.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[""+e])},pm.prototype.updateItemStatus=function(){this.contextMenu.showItems(this.hiddenItems),this.contextMenu.enableItems(this.disableItems),this.hiddenItems=[],this.disableItems=[],this.isOpen=!1},pm.prototype.contextMenuBeforeOpen=function(e){var t=H.closest(e.event.target,".e-grid");if(e.event&&t&&t!==this.parent.element)e.cancel=!0;else if(e.event&&(H.closest(e.event.target,"."+T.groupHeader)||H.closest(e.event.target,"."+T.touchPop)||H.closest(e.event.target,".e-summarycell")||H.closest(e.event.target,".e-groupcaption")||H.closest(e.event.target,".e-filterbarcell"))||this.parent.editSettings.showAddNewRow&&H.closest(e.event.target,".e-addedrow")&&this.parent.element.querySelector(".e-editedrow"))e.cancel=!0;else{this.targetColumn=this.getColumn(e.event),I(e.event.target,"e-grid")&&(this.targetRowdata=this.parent.getRowInfo(e.event.target)),H.isNullOrUndefined(e.parentItem)&&this.targetColumn&&this.targetRowdata.cell&&(this.parent.notify(xr,{isOpen:!0}),this.selectRow(e.event,!this.targetRowdata.cell.classList.contains("e-selectionbackground")||"Multiple"!==this.parent.selectionSettings.type));for(var i=[],n=[],r=0,s=e.items;r<s.length;r++){var o=s[r],a=this.getKeyFromId(o.id),l=this.defaultItems[""+a];if(-1!==this.getDefaultItems().indexOf(a))if(this.ensureDisabledStatus(a)&&this.disableItems.push(o.text),e.event&&(this.ensureTarget(e.event.target,T.edit)||this.ensureTarget(e.event.target,T.batchEdit)||this.ensureTarget(e.event.target,T.cellEdit)))"Save"!==a&&"Cancel"!==a&&this.hiddenItems.push(o.text);else{if(this.parent.editModule&&"Batch"===this.parent.editSettings.mode&&(H.closest(e.event.target,".e-gridform")||this.parent.editModule.getBatchChanges()[Ms].length||this.parent.editModule.getBatchChanges()[ks].length||this.parent.editModule.getBatchChanges()[Ps].length)&&("Save"===a||"Cancel"===a))continue;H.isNullOrUndefined(e.parentItem)&&e.event&&!H.isNullOrUndefined(l)&&!this.ensureTarget(e.event.target,l.target)&&this.hiddenItems.push(o.text)}else o.target&&e.event&&!this.ensureTarget(e.event.target,o.target)?o.separator?i.push(o.id):this.hiddenItems.push(o.text):this.ensureTarget(e.event.target,o.target)&&o.separator&&n.push(o.id);("PinRow"!==a||H.isNullOrUndefined(this.targetRowdata.row)||!this.targetRowdata.row.classList.contains("e-grid-pin-row"))&&("UnpinRow"!==a||H.isNullOrUndefined(this.targetRowdata.row)||this.targetRowdata.row.classList.contains("e-grid-pin-row"))||this.hiddenItems.push(o.text)}0<n.length&&this.contextMenu.showItems(n,!0),this.contextMenu.enableItems(this.disableItems,!1),this.contextMenu.hideItems(this.hiddenItems),0<i.length&&this.contextMenu.hideItems(i,!0),this.eventArgs=e.event,e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger(Ai,e),(e.cancel||this.hiddenItems.length===e.items.length&&!e.parentItem)&&(this.updateItemStatus(),e.cancel=!0)}pc(this.parent.element,this.contextMenu.element.parentElement)},pm.prototype.contextMenuBeforeClose=function(e){e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger(Fi,e)},pm.prototype.ensureTarget=function(e,t){var i=e;return(i=!this.ensureFrozenHeader(e)||t!==T.header&&t!==T.content?t===T.content||t===T.header?I(H.closest(e,"."+Ds),t.substr(1,t.length)):H.closest(e,t):H.closest(e,t===T.header?"thead":j))&&I(i,"e-grid")===this.parent.element},pm.prototype.ensureFrozenHeader=function(e){return!(!this.parent.frozenRows&&!this.parent.pinnedTopRecords.length||!H.closest(e,T.header))},pm.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"AutoFitAll":case"AutoFit":t=!(this.parent.ensureModuleInjected(pg)&&!this.parent.isEdit)||this.targetColumn&&!this.targetColumn.field&&"AutoFit"===e;break;case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(gg)&&this.targetColumn&&0<=this.parent.groupSettings.columns.indexOf(this.targetColumn.field)||this.targetColumn&&!this.targetColumn.field)&&(t=!0);break;case"Ungroup":this.parent.allowGrouping&&this.parent.ensureModuleInjected(gg)&&!(this.parent.ensureModuleInjected(gg)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)<0)||(t=!0);break;case"Edit":case"Delete":case"Save":case"Cancel":this.parent.editModule&&0!==this.parent.getDataRows().length||(t=!0);break;case"Copy":(0===this.parent.getSelectedRowIndexes().length&&0===this.parent.getSelectedRowCellIndexes().length||0===this.parent.getCurrentViewRecords().length)&&(t=!0);break;case"export":this.parent.allowExcelExport&&this.parent.ensureModuleInjected(em)||this.parent.allowPdfExport&&this.parent.ensureModuleInjected(im)||(t=!0);break;case"PdfExport":this.parent.allowPdfExport&&this.parent.ensureModuleInjected(im)||(t=!0);break;case"ExcelExport":case"CsvExport":this.parent.allowExcelExport&&this.parent.ensureModuleInjected(em)||(t=!0);break;case"SortAscending":case"SortDescending":if(!this.parent.allowSorting||!this.parent.ensureModuleInjected(Iu)||this.targetColumn&&!this.targetColumn.field)t=!0;else if(this.parent.ensureModuleInjected(Iu)&&0<this.parent.sortSettings.columns.length&&this.targetColumn)for(var i=this.parent.sortSettings.columns,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].field===this.targetColumn.field&&i[parseInt(n.toString(),10)].direction.toLowerCase()===e.toLowerCase().replace("sort","").toLocaleLowerCase()&&(t=!0);break;case"FirstPage":case"PrevPage":this.parent.allowPaging&&this.parent.ensureModuleInjected(Nu)&&0!==this.parent.getCurrentViewRecords().length&&(!this.parent.ensureModuleInjected(Nu)||1!==this.parent.pageSettings.currentPage)||(t=!0);break;case"LastPage":case"NextPage":this.parent.allowPaging&&this.parent.ensureModuleInjected(Nu)&&0!==this.parent.getCurrentViewRecords().length&&(!this.parent.ensureModuleInjected(Nu)||this.parent.pageSettings.currentPage!==this.getLastPage())||(t=!0);break;case"Chart":t=!this.parent.getSelectedRecords().length}return t},pm.prototype.getContextMenu=function(){return this.element},pm.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+ms)||e.querySelector("."+vs))&&(this.contextMenu&&(this.contextMenu.select=null,this.contextMenu.beforeOpen=null,this.contextMenu.onOpen=null,this.contextMenu.onClose=null),this.removeEventListener(),this.contextMenu.destroy(),this.element.parentNode&&H.remove(this.element),this.parent.element.classList.remove("e-noselect"))},pm.prototype.getModuleName=function(){return"contextMenu"},pm.prototype.generateID=function(e){return this.gridID+"_cmenu_"+e},pm.prototype.getKeyFromId=function(e){return e.replace(this.gridID+"_cmenu_","")},pm.prototype.buildDefaultItems=function(e){var t;switch(e){case"AutoFitAll":t={target:T.header,iconCss:T.autofitall};break;case"AutoFit":t={target:T.header,iconCss:T.autofit};break;case"Group":t={target:T.header,iconCss:T.group};break;case"Ungroup":t={target:T.header,iconCss:T.ungroup};break;case"Edit":t={target:T.content,iconCss:T.editIcon};break;case"Delete":t={target:T.content,iconCss:T.delete};break;case"Save":t={target:T.edit,iconCss:T.save};break;case"Cancel":t={target:T.edit,iconCss:T.cancel};break;case"Copy":t={target:T.content,iconCss:T.copy};break;case"export":t={target:T.content};break;case"PdfExport":t={target:T.content,iconCss:T.pdf};break;case"ExcelExport":t={target:T.content,iconCss:T.excel};break;case"CsvExport":t={target:T.content,iconCss:T.csv};break;case"SortAscending":t={target:T.header,iconCss:T.ascending};break;case"SortDescending":t={target:T.header,iconCss:T.descending};break;case"FirstPage":t={target:T.pager,iconCss:T.fPage};break;case"PrevPage":t={target:T.pager,iconCss:T.pPage};break;case"LastPage":t={target:T.pager,iconCss:T.lPage};break;case"NextPage":t={target:T.pager,iconCss:T.nPage};break;case"Chart":t={target:T.content,iconCss:T.chart};break;case"BarChart":t={target:T.content,iconCss:T.barChart};break;case"Bar":t={target:T.content,iconCss:T.bar};break;case"StackingBar":t={target:T.content,iconCss:T.stackingBar};break;case"StackingBar100":t={target:T.content,iconCss:T.stackingBar100};break;case"Pie":t={target:T.content,iconCss:T.pie};break;case"ColumnChart":t={target:T.content,iconCss:T.columnChart};break;case"Column":t={target:T.content,iconCss:T.column};break;case"StackingColumn":t={target:T.content,iconCss:T.stackingColumn};break;case"StackingColumn100":t={target:T.content,iconCss:T.stackingColumn100};break;case"LineChart":t={target:T.content,iconCss:T.lineChart};break;case"Line":t={target:T.content,iconCss:T.line};break;case"StackingLine":t={target:T.content,iconCss:T.stackingLine};break;case"StackingLine100":t={target:T.content,iconCss:T.stackingLine100};break;case"AreaChart":t={target:T.content,iconCss:T.areaChart};break;case"Area":t={target:T.content,iconCss:T.area};break;case"StackingArea":t={target:T.content,iconCss:T.stackingArea};break;case"StackingArea100":t={target:T.content,iconCss:T.stackingArea100};break;case"Scatter":t={target:T.content,iconCss:T.scatter};break;case"PinRow":t={target:".e-rowcell",iconCss:T.pin};break;case"UnpinRow":t={target:".e-rowcell",iconCss:T.unpin}}return this.defaultItems[""+e]={text:this.getLocaleText(e),id:this.generateID(e),target:t.target,iconCss:t.iconCss?"e-icons "+t.iconCss:""},this.defaultItems[""+e]},pm.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","Group","Ungroup","Edit","Delete","Save","Cancel","Copy","export","PdfExport","ExcelExport","CsvExport","SortAscending","SortDescending","FirstPage","PrevPage","LastPage","NextPage","Chart","BarChart","ColumnChart","LineChart","AreaChart","PinRow","UnpinRow"].concat(this.chartList)},pm.prototype.setLocaleKey=function(){return{AutoFitAll:"autoFitAll",AutoFit:"autoFit",Copy:"Copy",Group:"Group",Ungroup:"Ungroup",Edit:"EditRecord",Delete:"DeleteRecord",Save:"Save",Cancel:"CancelButton",PdfExport:"Pdfexport",ExcelExport:"Excelexport",CsvExport:"Csvexport",export:"Export",SortAscending:"SortAscending",SortDescending:"SortDescending",FirstPage:"FirstPage",LastPage:"LastPage",PrevPage:"PreviousPage",NextPage:"NextPage",Chart:"Chart",BarChart:"BarChart",Bar:"Bar",StackingBar:"StackingBar",StackingBar100:"StackingBar100",Pie:"Pie",ColumnChart:"ColumnChart",Column:"Column",StackingColumn:"StackingColumn",StackingColumn100:"StackingColumn100",LineChart:"LineChart",Line:"Line",StackingLine:"StackingLine",StackingLine100:"StackingLine100",AreaChart:"AreaChart",Area:"Area",StackingArea:"StackingArea",StackingArea100:"StackingArea100",Scatter:"Scatter",PinRow:"PinRow",UnpinRow:"UnpinRow"}},pm.prototype.getColumn=function(e){var t=H.closest(e.target,"th.e-headercell");return t?(t=t.querySelector(".e-headercelldiv, .e-stackedheadercelldiv").getAttribute("data-mappinguid"),this.parent.getColumnByUid(t)):this.parent.getRowInfo(e.target).column||null},pm.prototype.selectRow=function(e,t){this.cell=e.target,this.row=H.closest(e.target,"tr.e-row")||this.row,this.row&&t&&!I(e.target,"e-gridpager")&&this.parent.selectRow(parseInt(this.row.getAttribute(D),10)-1)},pm);function pm(e,t){this.defaultItems={},this.disableItems=[],this.hiddenItems=[],this.barChartList=["Bar","StackingBar","StackingBar100"],this.pieChartList=["Pie"],this.columnChartList=["Column","StackingColumn","StackingColumn100"],this.lineChartList=["Line","StackingLine","StackingLine100"],this.areaChartList=["Area","StackingArea","StackingArea100"],this.scatterChartList=["Scatter"],this.chartList=this.barChartList.concat(this.pieChartList,this.columnChartList,this.lineChartList,this.areaChartList,this.scatterChartList),this.localeText=this.setLocaleKey(),this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}um.prototype.getModuleName=function(){return"freeze"},um.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ft,this.instantiateRenderer,this),this.parent.on(s,this.destroy,this))},um.prototype.instantiateRenderer=function(){this.parent.log("limitation",this.getModuleName())},um.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ft,this.instantiateRenderer),this.parent.off(s,this.destroy))},um.prototype.destroy=function(){this.removeEventListener()};var cm=um;function um(e,t){this.parent=e,this.locator=t,this.addEventListener()}fm.prototype.wireEvents=function(){if(!this.parent.enableAdaptiveUI)for(var e=this.getColumnMenuHandlers(),t=0;t<e.length;t++)H.EventHandler.add(e[parseInt(t.toString(),10)],"mousedown",this.columnMenuHandlerDown,this)},fm.prototype.unwireEvents=function(){if(!this.parent.enableAdaptiveUI)for(var e=this.getColumnMenuHandlers(),t=0;t<e.length;t++)H.EventHandler.remove(e[parseInt(t.toString(),10)],"mousedown",this.columnMenuHandlerDown)},fm.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,oe.ResponsiveDialogAction.isColMenu)},fm.prototype.destroy=function(){var e=this.parent.element;(e.querySelector("."+vs)||e.querySelector("."+ms))&&e&&(this.columnMenu&&this.columnMenu.destroy(),this.removeEventListener(),this.unwireFilterEvents(),this.unwireEvents(),!this.parent.enableAdaptiveUI)&&this.element.parentNode&&H.remove(this.element)},fm.prototype.columnMenuHandlerClick=function(e){var t;e.target.classList.contains("e-columnmenu")&&(this.parent.enableAdaptiveUI?(this.headerCell=this.getHeaderCell(e),t=this.getColumn(),this.responsiveDialogRenderer.isCustomDialog=!0,this.parent.notify(Qr,{action:4}),this.parent.notify(Li,{col:t,target:e.target,isClose:null,id:null}),this.responsiveDialogRenderer.showResponsiveDialog(null,t)):(this.columnMenu.items=this.getItems(),this.columnMenu.dataBind(),this.isOpen&&this.headerCell!==this.getHeaderCell(e)||document.querySelector(".e-grid-menu .e-menu-parent.e-ul")?(this.columnMenu.close(),this.openColumnMenu(e)):this.isOpen?this.columnMenu.close():this.openColumnMenu(e)))},fm.prototype.openColumnMenuByField=function(e){this.openColumnMenu({target:this.parent.getColumnHeaderByField(e).querySelector(".e-columnmenu")})},fm.prototype.afterFilterColumnMenuClose=function(){this.columnMenu&&(this.columnMenu.items=this.getItems(),this.columnMenu.dataBind(),this.columnMenu.close())},fm.prototype.openColumnMenu=function(e){var t=this.parent.getContent().getClientRects()[0],i=this.parent.getHeaderContent(),n=i.getBoundingClientRect(),r={top:0,left:0},s=(this.element.style.cssText="display:block;visibility:hidden",this.element.getBoundingClientRect()),o=this.parent.element.getBoundingClientRect(),a=(this.element.style.cssText="display:none;visibility:visible",this.headerCell=this.getHeaderCell(e),i.querySelector("thead").getBoundingClientRect()),l=0<this.parent.frozenRows||0<this.parent.pinnedDataCount;this.parent.enableRtl?r=this.parent.enableStickyHeader?F.calculatePosition(this.headerCell,"left","bottom",!0):F.calculatePosition(this.headerCell,"left","bottom"):((r=this.parent.enableStickyHeader?F.calculatePosition(this.headerCell,"right","bottom",!0):F.calculatePosition(this.headerCell,"right","bottom")).left-=s.width,i.classList.contains("e-sticky")?(r.top=this.parent.element.offsetTop+n.top+(l?a:n).height,n.top+n.height>t.top&&(r.top+=n.top+n.height-t.top)):this.parent.enableStickyHeader&&(r.top=this.parent.element.offsetTop+i.offsetTop+(l?a:n).height),r.left+s.width+1>=o.right&&(r.left-=35)),this.columnMenu.open(r.top,r.left),e.preventDefault&&e.preventDefault(),pc(this.parent.element,this.columnMenu.element.parentElement)},fm.prototype.columnMenuHandlerDown=function(){this.isOpen=!("none"===this.element.style.display||""===this.element.style.display)},fm.prototype.getColumnMenuHandlers=function(){return[].slice.call(this.parent.getHeaderTable().getElementsByClassName(this.ROOT))},fm.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Rt,this.wireEvents,this),this.parent.on(St,this.enableAfterRenderMenu,this),this.parent.on(mt,this.render,this),this.isFilterItemAdded()&&this.parent.on(Ni,this.filterPosition,this),this.parent.on(Sr,this.setFullScreenDialog,this),this.parent.on(Qr,this.renderResponsiveChangeAction,this),this.parent.on(_t,this.columnMenuHandlerClick,this),this.parent.on(Ur,this.afterFilterColumnMenuClose,this),this.parent.on(Gt,this.keyPressHandler,this),this.parent.on(s,this.destroy,this))},fm.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Rt,this.unwireEvents),this.parent.off(St,this.enableAfterRenderMenu),this.parent.off(mt,this.render),this.isFilterItemAdded()&&this.parent.off(Ni,this.filterPosition),this.parent.off(Sr,this.setFullScreenDialog),this.parent.off(Qr,this.renderResponsiveChangeAction),this.parent.off(_t,this.columnMenuHandlerClick),this.parent.on(Ur,this.afterFilterColumnMenuClose),this.parent.off(Gt,this.keyPressHandler),this.parent.off(s,this.destroy))},fm.prototype.keyPressHandler=function(e){var t=this.parent;"altDownArrow"!==e.action||this.parent.enableAdaptiveUI||(e=t.focusModule.currentInfo.element)&&e.classList.contains("e-headercell")&&(t=t.getColumnByUid(e.querySelector(".e-headercelldiv").getAttribute("data-mappinguid")),this.openColumnMenuByField(t.field))},fm.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.columnMenu&&(this.columnMenu.destroy(),H.remove(this.element)),this.parent.enableAdaptiveUI||this.render())},fm.prototype.render=function(){this.parent.enableAdaptiveUI||(this.l10n=this.serviceLocator.getService("localization"),this.element=this.parent.createElement("ul",{id:this.gridID+"_columnmenu",className:"e-colmenu"}),this.element.setAttribute("aria-label",this.l10n.getConstant("ColumnMenuDialogARIA")),this.parent.element.appendChild(this.element),this.columnMenu=new B.ContextMenu({cssClass:this.parent.cssClass?"e-grid-menu e-grid-column-menu "+this.parent.cssClass:"e-grid-menu e-grid-column-menu",enableRtl:this.parent.enableRtl,enablePersistence:this.parent.enablePersistence,locale:this.parent.locale,items:this.getItems(),select:this.columnMenuItemClick.bind(this),beforeOpen:this.columnMenuBeforeOpen.bind(this),onOpen:this.columnMenuOnOpen.bind(this),onClose:this.columnMenuOnClose.bind(this),beforeItemRender:this.beforeMenuItemRender.bind(this),beforeClose:this.columnMenuBeforeClose.bind(this)}),this.columnMenu.isAngular=Oc(this.parent),this.element&&I(this.element,"e-popup")&&this.element.classList.add(this.COL_POP),this.columnMenu.appendTo(this.element),this.wireFilterEvents())},fm.prototype.wireFilterEvents=function(){!H.Browser.isDevice&&this.isFilterItemAdded()&&H.EventHandler.add(this.element,"mouseover",this.appendFilter,this)},fm.prototype.unwireFilterEvents=function(){H.Browser.isDevice||!this.isFilterItemAdded()||this.parent.enableAdaptiveUI||H.EventHandler.remove(this.element,"mouseover",this.appendFilter)},fm.prototype.beforeMenuItemRender=function(e){var t,i,n;this.isChooserItem(e.item)?(i=this.getKeyFromId(e.item.id,this.CHOOSER),n=this.parent.columnModel.filter(function(e){return e.field===i}),n=M.createCheckBox(this.parent.createElement,!1,{label:e.item.text,checked:n[0].visible}),this.parent.enableRtl&&n.classList.add("e-rtl"),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?(t=n.classList).add.apply(t,this.parent.cssClass.split(" ")):n.classList.add(this.parent.cssClass)),e.element.innerHTML="",e.element.appendChild(n)):e.item.id&&"Filter"===this.getKeyFromId(e.item.id)&&(e.element.appendChild(this.parent.createElement("span",{className:"e-icons e-caret"})),e.element.className+="e-filter-item e-menu-caret-icon")},fm.prototype.columnMenuBeforeClose=function(e){var t;e.column=this.targetColumn,this.parent.trigger(Pi,e),e.event&&e.event.target instanceof Document&&"scroll"===e.event.type?this.parent.enableStickyHeader||(e.cancel=!0):(t=e.event?H.closest(e.event.target,".e-menu-item"):null,!H.isNullOrUndefined(e.parentItem)&&"ColumnChooser"===this.getKeyFromId(e.parentItem.id)&&t&&this.isChooserItem(t)?e.cancel=!e.event||"Escape"!==e.event.code:e.event&&(H.closest(e.event.target,"."+this.POP)||e.event.currentTarget&&e.event.currentTarget.activeElement&&I(e.event.currentTarget.activeElement,"e-filter-popup")||I(e.event.target,"e-popup")&&I(e.event.target,"e-colmenu-popup")||I(e.event.target,"e-multiselect-flmenu")||I(e.event.target,"e-popup-wrapper"))&&!H.Browser.isDevice||e.event&&e.event.target&&e.event.target.classList.contains("e-filter-item")&&"Enter"===e.event.key?e.cancel=!0:this.parent.isColumnMenuFilterClosing&&(this.parent.isColumnMenuFilterClosing=!1,e.cancel=!0))},fm.prototype.isChooserItem=function(e){return e.id&&0<=e.id.indexOf("_colmenu_")&&-1===this.getKeyFromId(e.id,this.CHOOSER).indexOf("_colmenu_")},fm.prototype.columnMenuBeforeOpen=function(e){e.column=this.targetColumn=this.getColumn(),this.parent.trigger(ki,e);for(var t=0,i=e.items;t<i.length;t++){var n=i[t],r=this.getKeyFromId(n.id),s=this.defaultItems[""+r];-1!==this.getDefaultItems().indexOf(r)&&this.ensureDisabledStatus(r)&&!s.hide&&this.disableItems.push(n.text),n.hide&&this.hiddenItems.push(n.text)}this.columnMenu.enableItems(this.disableItems,!1),this.columnMenu.hideItems(this.hiddenItems)},fm.prototype.columnMenuOnOpen=function(e){"e-menu-parent e-ul "===e.element.className&&(e.element.offsetHeight>window.innerHeight||this.parent.element.offsetHeight>window.innerHeight)&&(e.element.style.maxHeight=.8*window.innerHeight+"px",e.element.style.overflowY="auto",this.parent.enableStickyHeader)&&(e.element.style.position="fixed")},fm.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(gg)&&this.targetColumn&&0<=this.parent.groupSettings.columns.indexOf(this.targetColumn.field)||this.targetColumn&&!this.targetColumn.allowGrouping)&&(t=!0);break;case"AutoFitAll":case"AutoFit":t=!this.parent.ensureModuleInjected(pg);break;case"Ungroup":(!this.parent.ensureModuleInjected(gg)||this.parent.ensureModuleInjected(gg)&&this.targetColumn&&this.parent.groupSettings.columns.indexOf(this.targetColumn.field)<0)&&(t=!0);break;case"SortDescending":case"SortAscending":if(this.parent.allowSorting&&this.parent.ensureModuleInjected(Iu)&&0<this.parent.sortSettings.columns.length&&this.targetColumn&&this.targetColumn.allowSorting)for(var i=this.parent.sortSettings.columns,n=0;n<i.length;n++)i[parseInt(n.toString(),10)].field===this.targetColumn.field&&i[parseInt(n.toString(),10)].direction.toLocaleLowerCase()===e.toLocaleLowerCase().replace("sort","")&&(t=!0);else this.parent.allowSorting&&this.parent.ensureModuleInjected(Iu)&&(!this.parent.allowSorting||!this.targetColumn||this.targetColumn.allowSorting)||(t=!0);break;case"Filter":this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(lg)&&this.targetColumn&&this.targetColumn.allowFiltering?t=!1:!this.parent.ensureModuleInjected(lg)||!this.targetColumn||this.targetColumn.allowFiltering&&this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type||(t=!0)}return t},fm.prototype.columnMenuItemClick=function(e){switch(this.isChooserItem(e.item)?"ColumnChooser":this.getKeyFromId(e.item.id)){case"AutoFit":this.parent.autoFitColumns(this.targetColumn.field);break;case"AutoFitAll":this.parent.autoFitColumns([]);break;case"Ungroup":this.parent.ungroupColumn(this.targetColumn.field);break;case"Group":this.parent.groupColumn(this.targetColumn.field);break;case"SortAscending":this.parent.sortColumn(this.targetColumn.field,"Ascending");break;case"SortDescending":this.parent.sortColumn(this.targetColumn.field,"Descending");break;case"ColumnChooser":var t=this.getKeyFromId(e.item.id,this.CHOOSER),i=e.element.querySelector(".e-checkbox-wrapper .e-frame");i&&i.classList.contains("e-check")?(i.classList.remove("e-check"),this.parent.hideColumns(t,"field")):i&&(this.parent.showColumns(t,"field"),i.classList.add("e-check"));break;case"Filter":this.getFilter(e.element,e.item.id)}e.column=this.targetColumn,this.parent.trigger(Mi,e)},fm.prototype.columnMenuOnClose=function(e){0<e.items.length&&e.items[0].parentObj instanceof B.ContextMenu&&(this.columnMenu.enableItems(this.disableItems,!1),this.disableItems=[],this.columnMenu.showItems(this.hiddenItems),this.hiddenItems=[],this.isFilterPopupOpen())&&this.getFilter(e.element,e.element.id,!0),H.isNullOrUndefined(e.parentItem)||"ColumnChooser"!==this.getKeyFromId(e.parentItem.id)?this.parent.notify(wn,{}):this.columnMenu.element.querySelector(".e-selected")&&this.columnMenu.element.querySelector(".e-selected").focus()},fm.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","SortAscending","SortDescending","Group","Ungroup","ColumnChooser","Filter"]},fm.prototype.getItems=function(){for(var e=[],t=0,i=this.parent.columnMenuItems||this.getDefault();t<i.length;t++){var n,r=i[t];"string"==typeof r?"ColumnChooser"===r?((n=this.getDefaultItem(r)).items=this.createChooserItems(),e.push(n)):e.push(this.getDefaultItem(r)):e.push(r)}return e},fm.prototype.getDefaultItem=function(e){var t={};switch(e){case"SortAscending":t={iconCss:this.ASCENDING};break;case"SortDescending":t={iconCss:this.DESCENDING};break;case"Group":t={iconCss:this.GROUP};break;case"Ungroup":t={iconCss:this.UNGROUP};break;case"Filter":t={iconCss:this.FILTER};break;case"ColumnChooser":t={iconCss:this.COLUMNCHOOSER};break;case"AutoFit":t={iconCss:this.AUTOFIT};break;case"AutoFitAll":t={iconCss:this.AUTOFITALL}}return this.defaultItems[""+e]={text:this.getLocaleText(e),id:this.generateID(e),iconCss:t.iconCss?"e-icons "+t.iconCss:null},this.defaultItems[""+e]},fm.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[""+e])},fm.prototype.generateID=function(e,t){return this.gridID+"_colmenu_"+(t?t+e:e)},fm.prototype.getKeyFromId=function(e,t){return 0<e.indexOf("_colmenu_")&&e.replace(this.gridID+"_colmenu_"+(t||""),"")},fm.prototype.getColumnMenu=function(){return this.element},fm.prototype.getModuleName=function(){return"columnMenu"},fm.prototype.setLocaleKey=function(){return{AutoFitAll:"autoFitAll",AutoFit:"autoFit",Group:"Group",Ungroup:"Ungroup",SortAscending:"SortAscending",SortDescending:"SortDescending",ColumnChooser:"Columnchooser",Filter:"FilterMenu"}},fm.prototype.getHeaderCell=function(e){return H.closest(e.target,"th.e-headercell")},fm.prototype.getColumn=function(){var e;return this.headerCell?(e=this.headerCell.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"),this.parent.getColumnByUid(e)):null},fm.prototype.createChooserItems=function(){for(var e=[],t=0,i=this.parent.columnModel;t<i.length;t++){var n=i[t];n.showInColumnChooser&&n.field&&e.push({id:this.generateID(n.field,this.CHOOSER),text:n.headerText||n.field})}return e},fm.prototype.appendFilter=function(e){var t;this.defaultItems.Filter&&(t=this.defaultItems.Filter.id,H.closest(e.target,"#"+t)&&!this.isFilterPopupOpen()?this.getFilter(e.target,t):!H.closest(e.target,"#"+t)&&this.isFilterPopupOpen()&&this.getFilter(e.target,t,!0))},fm.prototype.getFilter=function(e,t,i){var n,r=this.getFilterPop();r?(r.style.display=!H.Browser.isDevice&&i?"none":"block","none"!==r.style.display&&("Menu"===this.parent.filterSettings.type?r.querySelector(".e-flmenu-input")?r.querySelector(".e-flmenu-input").focus():r.querySelector(".e-flmenu-valuediv")&&(n=r.querySelector(".e-flmenu-valuediv").firstElementChild,H.isNullOrUndefined(n)||n.focus()):"CheckBox"!==this.parent.filterSettings.type&&"Excel"!==this.parent.filterSettings.type||r.querySelector(".e-searchinput")&&r.querySelector(".e-searchinput").focus())):this.parent.notify(Li,{col:this.targetColumn,target:e,isClose:i,id:t})},fm.prototype.setPosition=function(e,t){var i=this.parent.element.getBoundingClientRect(),e=e.getBoundingClientRect(),n=e.left-i.left,r=e.top-i.top;i.height<r?r=r-t.offsetHeight+e.height:i.height<r+t.offsetHeight&&(r=i.height-t.offsetHeight),(r=window.innerHeight<t.offsetHeight+r+i.top?window.innerHeight-t.offsetHeight-i.top:r)+i.top<0&&(r=0),this.parent.enableStickyHeader&&i.top<=0&&(r=e.top-i.top),n+=this.parent.enableRtl?-t.offsetWidth:e.width,i.width<=n+t.offsetWidth?(n-=e.width+t.offsetWidth,e.left<t.offsetWidth&&(n=e.left+t.offsetWidth/2)):n<0&&(n+=t.offsetWidth+e.width),t.style.top=r+"px",t.style.left=n+"px"},fm.prototype.filterPosition=function(){var e,t,i=this.getFilterPop();this.parent.enableAdaptiveUI||(i.classList.add(this.WRAP),!H.Browser.isDevice&&(e=i.style.display,i.style.cssText+="display:block;visibility:hidden",t=this.element.querySelector("."+this.FILTER))&&(this.setPosition(t.parentElement,i),i.style.cssText+="display:"+e+";visibility:visible"))},fm.prototype.getDefault=function(){var e=[];return this.parent.ensureModuleInjected(pg)&&(e.push("AutoFitAll"),e.push("AutoFit")),this.parent.allowGrouping&&this.parent.ensureModuleInjected(gg)&&(e.push("Group"),e.push("Ungroup")),this.parent.allowSorting&&this.parent.ensureModuleInjected(Iu)&&(e.push("SortAscending"),e.push("SortDescending")),e.push("ColumnChooser"),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(lg)&&e.push("Filter"),e},fm.prototype.isFilterPopupOpen=function(){var e=this.getFilterPop();return e&&"none"!==e.style.display},fm.prototype.getFilterPop=function(){var e,t;return!H.isNullOrUndefined(this.targetColumn)&&"Menu"===this.parent.filterSettings.type&&H.Browser.isDevice?document.getElementById(this.targetColumn.uid+"-flmdlg"):!(e=(e=this.parent.element.querySelector("."+this.POP))?e:(t=document.getElementById(this.parent.element.id+"_e-popup"))?t.querySelector("."+this.POP):null)&&this.parent.element.classList.contains("e-treelistgrid")?(t=H.closest(this.parent.element,".e-gantt"))?t.querySelector("."+this.POP):null:e},fm.prototype.isFilterItemAdded=function(){return this.parent.columnMenuItems&&0<=this.parent.columnMenuItems.indexOf("Filter")||!this.parent.columnMenuItems},fm.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action};var gm=fm;function fm(e,t){this.defaultItems={},this.localeText=this.setLocaleKey(),this.disableItems=[],this.hiddenItems=[],this.isOpen=!1,this.GROUP="e-icon-group",this.UNGROUP="e-icon-ungroup",this.ASCENDING="e-icon-ascending",this.DESCENDING="e-icon-descending",this.ROOT="e-columnmenu",this.FILTER="e-icon-filter",this.POP="e-filter-popup",this.WRAP="e-col-menu",this.COL_POP="e-colmenu-popup",this.CHOOSER="_chooser_",this.AUTOFIT="e-icon-autofit",this.AUTOFITALL="e-icon-autofitall",this.COLUMNCHOOSER="e-icon-columnchooser",this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener(),this.parent.enableAdaptiveUI&&this.setFullScreenDialog()}mm=function(e,t){return(mm=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}mm(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Sm,ym=hs),Sm.prototype.initEvent=function(){this.parent.isDestroyed||(this.parent.on(zi,this.initForeignKeyColumns,this),this.parent.on(qi,this.getForeignKeyData,this),this.parent.on(Ui,this.generateQueryFormData,this))},Sm.prototype.initForeignKeyColumns=function(e){for(var t=0;t<e.length;t++)e[parseInt(t.toString(),10)].dataSource=e[parseInt(t.toString(),10)].dataSource instanceof V.DataManager?e[parseInt(t.toString(),10)].dataSource:H.isNullOrUndefined(e[parseInt(t.toString(),10)].dataSource)?new V.DataManager:"result"in e[parseInt(t.toString(),10)].dataSource?e[parseInt(t.toString(),10)].dataSource:new V.DataManager(e[parseInt(t.toString(),10)].dataSource)},Sm.prototype.eventfPromise=function(e,t,i,n){var t=this.getStateEventArgument(t),r=new V.Deferred,s=new V.Deferred,o=(t.action=e.action,this.parent.getDataModule());return!H.isNullOrUndefined(e.action)&&e.action.requestType&&!1!==o.foreignKeyDataState.isDataChanged?(o.setForeignKeyDataState({isPending:!0,resolver:s.resolve}),s.promise.then(function(){r.resolve(n.dataSource)}),t.setColumnData=this.parent.setForeignKeyData.bind(this.parent),this.parent.trigger(ji,t)):(o.setForeignKeyDataState({}),r.resolve(i)),r},Sm.prototype.getForeignKeyData=function(r){for(var i=this,s=r.column?[r.column]:this.parent.getForeignKeyColumns(),o=("ExcludeHidden"===this.parent.columnQueryMode&&(s=s.filter(function(e){return!1!==e.visible})),[]),a=this,e=0;e<s.length;e++)!function(e){var t=void 0,i=r.isComplex?a.genarateColumnQuery(s[parseInt(e.toString(),10)]):a.genarateQuery(s[parseInt(e.toString(),10)],r.result.result,!1,!0),n=(i.params=a.parent.query.params,s[parseInt(e.toString(),10)].dataSource);t=n&&"result"in n?a.eventfPromise(r,i,n,s[parseInt(e.toString(),10)]).promise:!n.ready||n.dataSource.offline?n.executeQuery(i):n.ready.then(function(){return n.executeQuery(i)}),o.push(t)}(e);Promise.all(o).then(function(e){for(var t=0;t<e.length;t++)s[parseInt(t.toString(),10)].columnData=e[parseInt(t.toString(),10)].result,"dropdownedit"===s[parseInt(t.toString(),10)].editType&&"result"in s[parseInt(t.toString(),10)].dataSource&&(s[parseInt(t.toString(),10)].edit.params=H.extend(s[parseInt(t.toString(),10)].edit.params,{dataSource:e[parseInt(t.toString(),10)].result,query:new V.Query,fields:{value:s[parseInt(t.toString(),10)].foreignKeyField||s[parseInt(t.toString(),10)].field,text:s[parseInt(t.toString(),10)].foreignKeyValue}}));r.promise.resolve(r.result)}).catch(function(e){var t=e;return t.error||(t={error:t}),i.parent.log(["actionfailure","foreign_key_failure"],t),r.promise&&r.promise.reject&&r.promise.reject(e),e})},Sm.prototype.generateQueryFormData=function(e){e.predicate.predicate=this.genarateQuery(e.column,e.column.columnData,!0)},Sm.prototype.genarateQuery=function(e,t,i,n){var r,s=this.parent,o=[],a=new V.Query,l=i?e.foreignKeyField:e.field;if(this.parent.searchSettings&&this.parent.searchSettings.key.length&&(r=(new V.Query).where(e.foreignKeyValue,"contains",this.parent.searchSettings.key,!0),t=new V.DataManager(t).executeLocal(r)),s.allowPaging||s.enableVirtualization||i){t=new V.DataManager(s.allowGrouping&&s.groupSettings.columns.length&&!i?t.records:t).executeLocal((new V.Query).select(l));for(var h=V.DataUtil.distinct(t,l,!1),l=i?e.field:e.foreignKeyField,d=0;d<h.length;d++)h[parseInt(d.toString(),10)]&&h[parseInt(d.toString(),10)].getDay?o.push(ec({field:l,operator:"equal",value:h[parseInt(d.toString(),10)],matchCase:!1})):o.push(new V.Predicate(l,"equal",h[parseInt(d.toString(),10)],!1))}return n?o.length?a.where(V.Predicate.or(o)):a:o.length?V.Predicate.or(o):{predicates:[]}},Sm.prototype.genarateColumnQuery=function(e){var t=this.parent,i=new V.Query,n=this.isFiltered(e);return n.isTrue&&(i=this.filterQuery(i,n.column,!0)),t.searchSettings.key.length&&(n=t.searchSettings,e.dataSource instanceof V.DataManager&&e.dataSource.adaptor.getModuleName&&"ODataV4Adaptor"===e.dataSource.adaptor.getModuleName()?i=this.searchQuery(i,e,!0):i.search(n.key,e.foreignKeyValue,n.operator,n.ignoreCase)),i},Sm.prototype.isFiltered=function(t){var e=this.parent.filterSettings.columns.filter(function(e){return e.field===t.foreignKeyValue&&e.uid===t.uid});return{column:e,isTrue:!!e.length}},Sm.prototype.getModuleName=function(){return"foreignKey"},Sm.prototype.destroy=function(){this.destroyEvent()},Sm.prototype.destroyEvent=function(){this.parent.isDestroyed||(this.parent.off(zi,this.initForeignKeyColumns),this.parent.off(qi,this.getForeignKeyData),this.parent.off(Ui,this.generateQueryFormData))};var mm,ym,vm=Sm;function Sm(e,t){var i=ym.call(this,e,t)||this;return i.parent=e,i.serviceLocator=t,i.initEvent(),i}E.prototype.getModuleName=function(){return"infiniteScroll"},E.prototype.instantiateRenderer=function(){this.calculateAutoPageSize()},E.prototype.addEventListener=function(){this.parent.on(ft,this.instantiateRenderer,this),this.parent.on(yt,this.onDataReady,this),this.parent.on(ei,this.dataSourceModified,this),this.parent.on(Bn,this.infinitePageQuery,this),this.parent.on(Nn,this.infiniteScrollHandler,this),this.parent.on(Vt,this.infiniteCellFocus,this),this.parent.on(qn,this.appendInfiniteRows,this),this.parent.on(Un,this.removeInfiniteCacheRows,this),this.parent.on(Ln,this.resetInfiniteBlocks,this),this.parent.on(Hn,this.setCache,this),this.parent.on(jn,this.ensureIntialCollapse,this),this.parent.on(Gt,this.infiniteCellFocus,this),this.parent.on(zn,this.setDisplayNone,this),this.parent.on(Dn,this.editActionBegin,this),this.parent.on(kn,this.getVirtualInfiniteData,this),this.parent.on(Fn,this.resetInfiniteEdit,this),this.parent.on(Tn,this.infiniteEditSuccess,this),this.parent.on(An,this.refreshInfiniteCache,this),this.parent.on(qr,this.refreshInfiniteEditrowindex,this),this.parent.on(Vn,this.infiniteEditHandler,this),this.parent.on(Mn,this.infiniteAddActionBegin,this),this.parent.on(bt,this.modelChanged,this),this.parent.on(pr,this.refreshInfiniteCurrentViewData,this),this.parent.on(s,this.destroy,this),this.parent.on(vt,this.selectNewRow,this),this.parent.on(Br,this.captionActionComplete,this),this.parent.on(Rr,this.setGroupCollapsePageQuery,this),this.parent.on($r,this.onActionComplete,this),this.actionBeginFunction=this.actionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.dataBoundFunction=this.dataBound.bind(this),this.parent.addEventListener(y,this.actionBeginFunction),this.parent.addEventListener(c,this.actionCompleteFunction),this.parent.addEventListener(de,this.dataBoundFunction)},E.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ft,this.instantiateRenderer),this.parent.off(yt,this.onDataReady),this.parent.off(ei,this.dataSourceModified),this.parent.off(Bn,this.infinitePageQuery),this.parent.off(Nn,this.infiniteScrollHandler),this.parent.off(Vt,this.infiniteCellFocus),this.parent.off(qn,this.appendInfiniteRows),this.parent.off(Un,this.removeInfiniteCacheRows),this.parent.off(Ln,this.resetInfiniteBlocks),this.parent.off(Hn,this.setCache),this.parent.off(jn,this.ensureIntialCollapse),this.parent.off(Gt,this.infiniteCellFocus),this.parent.off(zn,this.setDisplayNone),this.parent.off(Dn,this.editActionBegin),this.parent.off(kn,this.getVirtualInfiniteData),this.parent.off(Fn,this.resetInfiniteEdit),this.parent.off(Tn,this.infiniteEditSuccess),this.parent.off(An,this.refreshInfiniteCache),this.parent.on(qr,this.refreshInfiniteEditrowindex),this.parent.off(Vn,this.infiniteEditHandler),this.parent.off(Mn,this.infiniteAddActionBegin),this.parent.off(bt,this.modelChanged),this.parent.off(pr,this.refreshInfiniteCurrentViewData),this.parent.off(s,this.destroy),this.parent.off(vt,this.selectNewRow),this.parent.off(Br,this.captionActionComplete),this.parent.off(Rr,this.setGroupCollapsePageQuery),this.parent.off($r,this.onActionComplete),this.parent.removeEventListener(y,this.actionBeginFunction),this.parent.removeEventListener(c,this.actionCompleteFunction),this.parent.removeEventListener(de,this.dataBoundFunction))},E.prototype.dataBound=function(){"collapse"===this.groupCaptionAction?(this.groupCaptionAction="refresh",this.makeGroupCollapseRequest()):"refresh"===this.groupCaptionAction&&(this.parent.hideSpinner(),this.groupCaptionAction=this.empty)},E.prototype.setGroupCollapsePageQuery=function(e){var t=this.parent;if(!t.infiniteScrollSettings.enableCache&&this.isGroupCollapse)if(e.skipPage=!0,this.isGroupCollapse=!1,"collapse"===this.groupCaptionAction){for(var i=t.getRowObjectFromUID(this.parentCapUid),n=t.getRowsObject(),r=0,s=n.length-1;0<=s&&n[parseInt(s.toString(),10)].indent!==i.indent;s--)n[parseInt(s.toString(),10)].isDataRow&&r++;for(var o=ou(n.indexOf(i),n),a=su(l=ru(o.fields,o.keys,this)),l=a[a.length-1],s=a.length-2;0<=s;s--)l=l.and(a[parseInt(s.toString(),10)]);e.query.where(l),e.query.skip(r),this.parentCapUid=this.empty}else{var o=t.getRows(),h=t.pageSettings.pageSize,o=iu(o[o.length-1])+1,h=o%h==0?0:o-o%h+h-o;e.query.skip(o),e.query.take(t.infiniteScrollSettings.initialBlocks*t.pageSettings.pageSize+h)}},E.prototype.captionActionComplete=function(e){var t,i,n=this.parent;!n.infiniteScrollSettings.enableCache&&e.isCollapse&&(t=n.getContent().firstElementChild.getBoundingClientRect(),i=n.contentModule.getTable().getBoundingClientRect(),Math.round(i.bottom-n.getRowHeight())<=Math.round(t.bottom))&&(this.parentCapUid=e.parentUid,this.groupCaptionAction="collapse",n.showSpinner(),i=n.getRowObjectFromUID(e.parentUid),this.getCaptionChildCount(i)?this.makeGroupCollapseRequest(e.parentUid):(this.groupCaptionAction="refresh",this.makeGroupCollapseRequest()))},E.prototype.makeGroupCollapseRequest=function(e){var t=this.parent,i=[].slice.call(t.getContentTable().querySelectorAll("tr")),i=t.groupSettings.enableLazyLoading?i:t.getRows(),i=t.groupSettings.enableLazyLoading?t.contentModule.visibleRows.length-1:iu(i[i.length-1]),n=this.parent.pageSettings.currentPage,r=Math.ceil(i/this.parent.pageSettings.pageSize)+1;n>=this.maxPage||r>this.maxPage?t.hideSpinner():(this.parent.pageSettings.currentPage=r,t={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:n,startIndex:i+1,direction:"down",isCaptionCollapse:!0,parentUid:e},this.isGroupCollapse=!0,this.parent.notify("model-changed",t))},E.prototype.getCaptionChildCount=function(e){for(var t=this.parent.getRowsObject(),i=!1,n=t.indexOf(e);n<t.length&&(!(t[parseInt(n.toString(),10)].indent===e.indent||t[parseInt(n.toString(),10)].indent<e.indent)||t[parseInt(n.toString(),10)].data.key===e.data.key);n++)if(t[parseInt(n.toString(),10)].isCaptionRow&&!this.childCheck(t,t[parseInt(n.toString(),10)],n)){i=!0;break}return i},E.prototype.childCheck=function(e,t,i){for(var n=0,r=i+1;r<e.length&&e[parseInt(r.toString(),10)].indent!==t.indent;r++)e[parseInt(r.toString(),10)].indent===t.indent+1&&e[parseInt(r.toString(),10)].parentUid===t.uid&&n++;return t.data.count===n},E.prototype.updateCurrentViewData=function(){var e=this.parent;if(!e.groupSettings.columns.length)for(var t=Object.keys(this.infiniteCurrentViewData),i=(e.currentViewData=[],e.pageSettings.currentPage),n=e.infiniteScrollSettings.enableCache,r=e.infiniteScrollSettings.maxBlocks,s=n&&(r<i||this.isUpScroll&&1<i),i=s?this.isUpScroll?i:i-r+1:1,o=s?i+r-1:n?r:t.length,a=i;a<=o;a++)this.infiniteCurrentViewData[parseInt(a.toString(),10)]&&(e.currentViewData=e.currentViewData.concat(this.infiniteCurrentViewData[parseInt(a.toString(),10)]))},E.prototype.refreshInfiniteCurrentViewData=function(e){var t=this.parent,t=t.enableInfiniteScrolling&&(t.childGrid||t.detailTemplate)&&("add"===e.args.action&&"save"===e.args.requestType||"delete"===e.args.requestType),i=("add"!==e.args.action||"save"!==e.args.requestType||t||(this.parent.pageSettings.currentPage=Math.ceil(e.args.index/this.parent.pageSettings.pageSize)?Math.ceil(e.args.index/this.parent.pageSettings.pageSize):1),this.parent.pageSettings.currentPage),n=this.parent.pageSettings.pageSize,r=this.parent.infiniteScrollSettings.initialBlocks,s=Object.keys(this.infiniteCurrentViewData),o=this.parent.infiniteScrollSettings.enableCache;if(!this.parent.groupSettings.columns.length){var a="save"===e.args.requestType&&!(this.parent.sortSettings.columns.length||this.parent.filterSettings.columns.length||this.parent.groupSettings.columns.length||this.parent.searchSettings.key),l="delete"===e.args.requestType;if(o||!a&&!l||t)1<r&&e.data.length===r*n?(t&&(this.infiniteCurrentViewData={},this.firstBlock=1),this.setInitialCache(e.data.slice(),{},o&&"delete"===e.args.requestType,!0)):this.infiniteCurrentViewData[parseInt(i.toString(),10)]=e.data.slice();else if(a){for(var h=0,d=1;d<=s.length;d++)if(h+=this.infiniteCurrentViewData[parseInt(d.toString(),10)].length-1,e.args.index<=h){this.resetCurrentViewData(d),this.infiniteCurrentViewData[parseInt(d.toString(),10)].splice(e.args.index,0,e.args.data);break}}else this.infiniteCurrentViewData[s[s.length-1]].push(e.data[0])}},E.prototype.resetCurrentViewData=function(e){for(var t=Object.keys(this.infiniteCurrentViewData),i=e;i<=t.length;i++){var n=this.infiniteCurrentViewData[parseInt(i.toString(),10)][this.infiniteCurrentViewData[parseInt(i.toString(),10)].length-1];this.infiniteCurrentViewData[i+1]&&this.infiniteCurrentViewData[i+1].splice(0,0,n),this.infiniteCurrentViewData[parseInt(i.toString(),10)].pop()}},E.prototype.modelChanged=function(e){var t=this.parent.getRows();"save"===e.requestType&&e.index&&e.data&&(this.addRowIndex=e.index),t&&t.length&&"infiniteScroll"!==e.requestType&&("delete"===e.requestType||"add"===this.requestType)&&(this.firstIndex=iu(t[0]),this.firstBlock=Math.ceil((this.firstIndex+1)/this.parent.pageSettings.pageSize),this.lastIndex=iu(t[t.length-1]),"delete"===e.requestType?(t=this.parent.getRowsObject(),e.startIndex=this.parent.infiniteScrollSettings.enableCache?(this.firstBlock-1)*this.parent.pageSettings.pageSize:t[t.length-1].index):e.startIndex=this.firstIndex,this.parent.infiniteScrollSettings.enableCache||this.parent.pageSettings.currentPage!==this.maxPage||"delete"!==e.requestType||(this.isLastPage=!0,this.lastIndex=this.lastIndex-1))},E.prototype.infiniteAddActionBegin=function(e){this.isNormaledit&&(this.isAdd=!0,this.parent.infiniteScrollSettings.enableCache)&&(Object.keys(this.emptyRowData).length||this.createEmptyRowdata(),1<this.parent.pageSettings.currentPage)&&(e.startEdit=!1,this.resetInfiniteBlocks({},!0),this.makeRequest({currentPage:1}))},E.prototype.infiniteEditHandler=function(e){var t,i;this.parent.infiniteScrollSettings.enableCache||"delete"!==e.e.requestType&&("save"!==e.e.requestType||"add"!==this.requestType)||(t=this.parent.getRows(),i=this.parent.getRowsObject(),this.ensureRowAvailability(i,e.result[0])&&(!t.length||this.addRowIndex&&this.addRowIndex>=t.length||this.resetRowIndex(i,e.e,t,"add"===this.requestType,!0),this.isLastPage?(this.isLastPage=!1,this.parent.pageSettings.currentPage=this.maxPage,this.parent.selectionModule.index<this.parent.frozenRows&&(H.remove(t[this.parent.frozenRows-1]),this.createRow([i[this.parent.frozenRows-1]],e,!1,!0),Tc(this.parent))):this.createRow(i,e)),this.parent.hideSpinner(),this.parent.notify(zr,{}),"delete"===this.requestType?this.parent.notify(di,e.e):this.parent.notify(hi,e.e)),this.parent.notify(Oi,{case:"refreshHeight"})},E.prototype.createRow=function(e,t,i,n,r){var s=n?e:this.generateRows(t.result,t.e),o=new $s(this.serviceLocator,null,this.parent);if(this.parent.removeMaskRow(),!("save"===t.e.requestType&&t.e.index&&t.e.data&&(s[0].index=this.addRowIndex,this.addRowIndex=null,s[0].index>=e.length))){var a=this.parent.getContent().querySelector(j),l=(this.parent.frozenRows&&(a=n&&"add"!==this.requestType||!n&&"add"===this.requestType?this.parent.getHeaderContent().querySelector(j):a),{rows:e,cancel:!1,args:t,isMovable:i,isFrozenRows:n,isFrozenRight:n,row:s});if(this.parent.notify(cr,l),!l.cancel)for(var h=s.length-1;0<=h;h--)"delete"===this.requestType?a.appendChild(o.render(s[parseInt(h.toString(),10)],this.parent.getColumns())):a.insertBefore(o.render(s[parseInt(h.toString(),10)],this.parent.getColumns()),a.rows[t.e.index]);!n&&this.parent.frozenRows&&(this.parent.selectionModule.index<this.parent.frozenRows||"add"===this.requestType)&&(l=this.parent.getRows(),i=(i||r)&&"add"===this.requestType?this.parent.frozenRows:this.parent.frozenRows-1,H.remove(l[parseInt(i.toString(),10)]),this.createRow([e[this.parent.frozenRows-1]],t,!1,!0,!1)),this.parent.infiniteScrollSettings.enableCache||n||(Tc(this.parent),this.parent.contentModule.visibleRows="add"===this.requestType?s.concat(e):e.concat(s))}},E.prototype.ensureRowAvailability=function(e,t){var i=!0;if(this.parent.frozenRows&&!this.parent.infiniteScrollSettings.enableCache&&this.parent.sortSettings.columns&&"add"===this.requestType)for(var n=this.parent.getPrimaryKeyFieldNames()[0],r=0;r<e.length;r++)if(e[parseInt(r.toString(),10)].data[""+n]===t[""+n]){i=!1;break}return i},E.prototype.generateRows=function(e,t){return this.rowModelGenerator.generateRows(e,t)},E.prototype.resetRowIndex=function(n,r,s,e,o){var a=this,l=this.parent.getPrimaryKeyFieldNames()[0],t=!(s.length%this.parent.pageSettings.pageSize),t=(e?t&&(o&&!this.parent.groupSettings.columns.length&&this.swapCurrentViewData(1,!0),H.remove(s[n.length-1]),s.splice(n.length-1,1),n.splice(n.length-1,1)):n.filter(function(e,t){var i;e.data[""+l]===r.data[0][""+l]&&(o&&!a.parent.groupSettings.columns.length&&(i=Math.ceil((t+1)/a.parent.pageSettings.pageSize),a.resetInfiniteCurrentViewData(i,t)),n.splice(t,1),i=a.parent.getRowElementByUID(e.uid))&&(t=s.indexOf(i),H.remove(i),s.splice(t,1))}),e?this.addRowIndex?this.addRowIndex+1:1:0);Ic(this.parent,n,s,t,this.addRowIndex||0)},E.prototype.resetInfiniteCurrentViewData=function(e,t){t-=(e-1)*this.parent.pageSettings.pageSize,this.infiniteCurrentViewData[parseInt(e.toString(),10)].splice(t,1),this.swapCurrentViewData(e,!1)},E.prototype.swapCurrentViewData=function(e,t){for(var i,n,r=Object.keys(this.infiniteCurrentViewData),s=t?r.length+1:r.length,o=e;o<s;o++)this.infiniteCurrentViewData[o+1]&&(n=t?o:o+1,i=t?this.infiniteCurrentViewData[parseInt(o.toString(),10)].length-1:0,n=this.infiniteCurrentViewData[parseInt(n.toString(),10)].splice(i,1),t?(this.infiniteCurrentViewData[o+1]=n.concat(this.infiniteCurrentViewData[o+1]),o+1===s-1&&this.infiniteCurrentViewData[o+1].splice(this.infiniteCurrentViewData[o+1].length-1,1)):this.infiniteCurrentViewData[parseInt(o.toString(),10)].push(n[0]));this.updateCurrentViewData()},E.prototype.setDisplayNone=function(t){if(this.parent.infiniteScrollSettings.enableCache){for(var e=Object.keys(this.infiniteCache),i=1;i<=e.length;i++)this.infiniteCache[parseInt(i.toString(),10)].filter(function(e){e.cells[t.index].visible=""===t.visible});this.resetContentModuleCache(this.infiniteCache)}},E.prototype.refreshInfiniteCache=function(e){this.getEditedRowObject().data=e.data},E.prototype.refreshInfiniteCacheRowVisibleLength=function(e,t){var i=e[parseInt(t.toString(),10)];if(this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache){for(var e=0,n=0,r=0,s=0;s<i.length;s++)i[parseInt(s.toString(),10)].visible||H.isNullOrUndefined(i[parseInt(s.toString(),10)].visible)?n++:r++;return n<r?n<(e=r-n)&&(e=n):r<(e=n-r)&&(e=r),e=0===e?1:e}return i.length},E.prototype.refreshInfiniteEditrowindex=function(e){this.editRowIndex=e.index},E.prototype.getEditedRowObject=function(){var e,t=this.parent.getRowsObject();if(this.parent.pinnedTopRowModels.length&&this.editRowIndex<this.parent.pinnedTopRowModels.length)for(var t=this.parent.pinnedTopRowModels,i=0;i<t.length;i++)if(t[parseInt(i.toString(),10)].index===this.editRowIndex)return e=t[parseInt(i.toString(),10)];for(i=0;i<t.length;i++)t[parseInt(i.toString(),10)].index===this.editRowIndex&&(e=t[parseInt(i.toString(),10)]);return e},E.prototype.infiniteEditSuccess=function(e){this.isNormaledit&&(!this.isAdd&&e.data&&this.updateCurrentViewRecords(e.data),this.isAdd=this.parent.editSettings.showAddNewRow)},E.prototype.updateCurrentViewRecords=function(e){var t=Sc(this.parent,e);H.isNullOrUndefined(t)||(this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)]=e)},E.prototype.actionBegin=function(e){"add"===e.requestType||"delete"===e.requestType?this.requestType=e.requestType:"add"===e.action&&"save"===e.requestType&&(this.requestType=e.action),(this.parent.isFrozenGrid()&&!e.cancel&&"searching"===e.requestType||"sorting"===e.requestType||"filtering"===e.requestType)&&(this.isInitialRender=!0)},E.prototype.actionComplete=function(e){"Normal"!==this.parent.editSettings.mode||"delete"!==e.requestType&&"save"!==e.requestType&&"cancel"!==e.requestType||(this.requestType=this.empty,this.isCancel="cancel"===e.requestType||"save"===e.requestType,this.isAdd=this.isEdit=this.parent.editSettings.showAddNewRow,this.isNormaledit&&(this.editRowIndex=this.empty,this.virtualInfiniteData={},this.parent.editModule.previousVirtualData={}))},E.prototype.onActionComplete=function(e){this.parent.trigger(c,H.extend(e,{type:c}))},E.prototype.resetInfiniteEdit=function(){this.parent.enableInfiniteScrolling&&this.isNormaledit&&(this.parent.editSettings.allowEditing&&this.isEdit||this.parent.editSettings.allowAdding&&this.isAdd)&&(this.parent.isEdit=!0)},E.prototype.getVirtualInfiniteData=function(e){this.getVirtualInfiniteEditedData(),e.virtualData=this.parent.enableColumnVirtualization&&!this.parent.infiniteScrollSettings.enableCache?e.virtualData:this.virtualInfiniteData,e.isAdd=this.isAdd,e.isCancel=this.isCancel},E.prototype.editActionBegin=function(e){this.isEdit=!0,this.editRowIndex=e.index;var t=H.extend({},this.getEditedRowObject().data);e.data=Object.keys(this.virtualInfiniteData).length?this.virtualInfiniteData:t},E.prototype.dataSourceModified=function(){this.isNormaledit&&this.isEdit&&(this.isEdit=!1,this.editRowIndex=this.empty,this.virtualInfiniteData={},this.parent.editModule&&(this.parent.editModule.previousVirtualData={}),this.parent.isEdit=!1),this.resetInfiniteBlocks({requestType:this.empty},!0)},E.prototype.isCountLessMode=function(){return!0===this.parent.infiniteScrollSettings.enableCountLessMode},E.prototype.requestCount=function(e){var t=this.parent.pageSettings.pageSize;return!e||"infiniteScroll"!==e.requestType?t*this.parent.infiniteScrollSettings.initialBlocks:t},E.prototype.resultLength=function(e){e=e&&e.result;return e&&e.length?e.length:0},E.prototype.applyCountLessEndDetection=function(e){var t,i;(this.isCountLessMode()||e)&&(t=this.resultLength(e),i=this.requestCount(e),"boolean"==typeof e.hasMore?this.hasMoreData=e.hasMore:this.hasMoreData=t===i||!H.isNullOrUndefined(e.nextToken),this.parent.isLastRecordLoaded=!this.hasMoreData,this.isRequestPending=!1)},E.prototype.onDataReady=function(e){H.isNullOrUndefined(e.count)||"infiniteScroll"===e.requestType||(this.maxPage=Math.ceil(e.count/this.parent.pageSettings.pageSize)),this.isCountLessMode()&&(H.isNullOrUndefined(e.count)||e.count<=0)&&this.applyCountLessEndDetection(e)},E.prototype.calculateAutoPageSize=function(){var e,t;this.parent.height&&"string"==typeof this.parent.height&&-1!==this.parent.height.toLowerCase().indexOf("calc")||(t=this.parent.getRowHeight(),e=(this.parent.height.toString().indexOf("%")<0?this.parent:this.parent.element.getBoundingClientRect()).height,"string"==typeof this.parent.height&&-1!==this.parent.height.toLowerCase().indexOf("vh")&&(e=fu(this.parent.height)),e=2*~~(parseFloat(e.toString())/t),t=this.parent.pageSettings.pageSize,this.parent.setProperties({pageSettings:{pageSize:t<e?e:t}},!0))},E.prototype.ensureIntialCollapse=function(e){this.isInitialCollapse=!e},E.prototype.infiniteScrollHandler=function(e){var t,i,n,r,s,o,a,l,h,d;this.infiniteDetailDestroy||(this.restoreInfiniteEdit(),this.restoreInfiniteAdd(),n=(t=e.target).classList.contains(xs),i=!(!this.parent.childGrid&&!this.parent.detailTemplate),n&&this.parent.enableInfiniteScrolling&&!e.isLeft&&(n=this.parent.getContent().firstElementChild,e=[].slice.call(this.parent.getContentTable().querySelectorAll("tr")),this.prevScrollTop=n.scrollTop,(e=i?this.parent.getRows().filter(function(e){return!e.classList.contains("e-detailrow")}):this.parent.groupSettings.enableLazyLoading?e:this.parent.getRows()).length)&&(e=iu(e[e.length-1])+1,r=this.parent.pageSettings.currentPage,s=void 0,d=t.scrollHeight-t.scrollTop,o=Math.round(t.scrollHeight-t.scrollTop),d=d<t.clientHeight?Math.ceil(d):Math.floor(d),(a=t.clientHeight)<d?d-=1:d<a&&(a-=1),d=d===a||o===a,H.isNullOrUndefined(this.groupCaptionAction))&&(o=this.isCountLessMode()&&this.hasMoreData&&!this.isRequestPending,this.isScroll&&d&&(this.parent.pageSettings.currentPage<=this.maxPage-1||o)&&(this.parent.infiniteScrollSettings.enableCache&&(this.isUpScroll=!1,this.isDownScroll=!0),l=(a=i?this.getGridRows().filter(function(e){return e.classList.contains("e-row")&&!e.classList.contains("e-addedrow")}):[].slice.call(n.querySelectorAll(".e-row:not(.e-addedrow)")))[a.length-1],h=this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length?this.parent.contentModule.visibleRows.length-1:iu(l),this.parent.pageSettings.currentPage=Math.ceil(h/this.parent.pageSettings.pageSize)+1,s={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:r,startIndex:e,direction:"down"},this.isCountLessMode()&&(this.isRequestPending=!0),this.makeRequest(s)),this.isScroll&&this.parent.infiniteScrollSettings.enableCache&&0===t.scrollTop&&1!==this.parent.pageSettings.currentPage&&(this.parent.infiniteScrollSettings.enableCache&&(this.isDownScroll=!1,this.isUpScroll=!0),h=iu((l=i?this.getGridRows().filter(function(e){return e.classList.contains(Ts)}):[].slice.call(n.getElementsByClassName(Ts)))[this.parent.pageSettings.pageSize-1]),d=iu(l[0])-this.parent.pageSettings.pageSize,this.parent.pageSettings.currentPage=Math.ceil(h/this.parent.pageSettings.pageSize)-1,this.parent.pageSettings.currentPage)&&(s={requestType:"infiniteScroll",currentPage:this.parent.pageSettings.currentPage,prevPage:r,startIndex:d,direction:"up"},this.makeRequest(s)),this.parent.infiniteScrollSettings.enableCache)&&!this.isScroll&&H.isNullOrUndefined(s)&&(this.isDownScroll||this.isUpScroll)&&(n.scrollTop=this.top))},E.prototype.makeRequest=function(e){var t,i=this;this.parent.pageSettings.currentPage!==e.prevPage&&((t=this.parent.infiniteScrollSettings.initialBlocks)<this.maxPage&&this.parent.pageSettings.currentPage<=this.maxPage||this.isCountLessMode()&&this.hasMoreData?(this.isInfiniteScroll=!0,H.isNullOrUndefined(this.infiniteCache[e.currentPage])?setTimeout(function(){i.getVirtualInfiniteEditedData(),i.parent.notify("model-changed",e)},100):setTimeout(function(){i.getVirtualInfiniteEditedData(),i.parent.notify(Pn,e)},100)):this.parent.pageSettings.currentPage=this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&t>=this.maxPage?1:this.maxPage)},E.prototype.infinitePageQuery=function(e){this.initialRender||("add"===this.requestType||"delete"===this.requestType)&&(this.parent.childGrid||this.parent.detailTemplate)?(this.initialRender=!1,this.intialPageQuery(e)):"delete"===this.requestType||"add"===this.requestType?this.isInfiniteScroll||this.parent.groupSettings.enableLazyLoading?this.parent.groupSettings.enableLazyLoading&&!this.parent.infiniteScrollSettings.enableCache?this.parent.infiniteScrollSettings.initialBlocks<this.parent.pageSettings.currentPage?e.page(1,this.parent.pageSettings.pageSize*this.parent.pageSettings.currentPage):e.page(1,this.parent.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks):e.page(this.parent.pageSettings.currentPage,this.parent.pageSettings.pageSize):this.editPageQuery(e):e.page(this.parent.pageSettings.currentPage,this.parent.pageSettings.pageSize)},E.prototype.editPageQuery=function(e){var t,i=this.parent.infiniteScrollSettings.initialBlocks;this.parent.infiniteScrollSettings.enableCache?(this.infiniteCache={},this.infiniteCurrentViewData={},e.skip(this.firstIndex),e.take(i*this.parent.pageSettings.pageSize)):("Dialog"===this.parent.editSettings.mode&&this.parent.clearSelection(),t="delete"===this.requestType?this.lastIndex:this.addRowIndex||this.firstIndex,e.skip(t),H.isNullOrUndefined(this.parent.getDataModule().dataManager.dataSource.url)||""===this.parent.getDataModule().dataManager.dataSource.url||"delete"!==this.requestType&&"add"!==this.requestType?e.take(1):e.take(i*this.parent.pageSettings.pageSize))},E.prototype.intialPageQuery=function(e){this.parent.infiniteScrollSettings.enableCache&&this.parent.infiniteScrollSettings.initialBlocks>this.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks);var t=this.parent.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks;e.page(1,t)},E.prototype.scrollToLastFocusedCell=function(e){var t=this.parent,i=this.lastFocusInfo.rowIdx+(e.keyArgs.action===Ks?-1:1),n=this.lastFocusInfo.cellIdx;if(!t.getRowByIndex(i)){for(var r=new $s(this.serviceLocator,null,this.parent),s=Math.floor(i/this.parent.pageSettings.pageSize)+1,o=(t.pageSettings.currentPage=s,t.getColumns()),a=(H.remove(t.getContent().querySelector("tbody")),t.getContent().querySelector("table").appendChild(t.createElement("tbody",{attrs:{role:"rowgroup"}})),[]),l=1===s||this.maxPage===s?0:-1,h=0;h<t.infiniteScrollSettings.maxBlocks;this.maxPage===s?l--:l++,h++){var d=this.infiniteCache[s+l];if(d)for(var a=a.concat(d),p=0;p<d.length;p++)t.getContent().querySelector("tbody").appendChild(r.render(d[parseInt(p.toString(),10)],o))}t.notify(vt,{rows:a,args:{}}),Tc(t)}n=t.getRowByIndex(i).cells[parseInt(n.toString(),10)];t.focusModule.isInfiniteScroll=!0,t.focusModule.onClick({target:n},!0),t.selectRow(i),n.focus(),this.isFocusScroll=!1,e.cancel=!0},E.prototype.setLastCellFocusInfo=function(e){var t,e=e.byClick&&e.clickArgs.target||e.byKey&&e.keyArgs.target||(!this.isFocusScroll&&e).target;e&&e.classList.contains("e-rowcell")&&(t=parseInt(e.getAttribute("aria-colindex"),10)-1,e=parseInt(e.parentElement.getAttribute("aria-rowindex"),10)-1,this.lastFocusInfo={rowIdx:e,cellIdx:t})},E.prototype.infiniteCellFocus=function(e){var t=this.parent,i=t.infiniteScrollSettings.enableCache;if(e.byKey){if(i&&this.isFocusScroll)return void this.scrollToLastFocusedCell(e);var n,r,s=document.activeElement,o=iu(s.parentElement),a=(this.cellIndex=parseInt(s.getAttribute(zs),10)-1,t.getContent().firstElementChild),l=this.maxPage*t.pageSettings.pageSize-1,h=Math.floor(a.offsetHeight/this.parent.getRowHeight()),d=a.getBoundingClientRect();isNaN(o)||(e.keyArgs.action===_s||e.keyArgs.action===Qs?(this.rowIndex=o+=1,r=(n=t.getRowByIndex(o))&&n.getBoundingClientRect(),i&&(o=s.parentElement.rowIndex+1),this.isFocusScroll||!n&&o<l||r&&r.bottom>=d.bottom?(this.isFocusScroll||(this.pressedKey=e.keyArgs.action),this.isFocusScroll=!1,a.scrollTop=(o-h+1)*this.parent.getRowHeight()):!i&&n&&r&&(r.bottom>=d.bottom||r.top<d.top)&&n.cells[this.cellIndex].scrollIntoView()):(e.keyArgs.action===Ks||e.keyArgs.action===Xs)&&(this.rowIndex=--o,r=(n=t.getRowByIndex(o))&&n.getBoundingClientRect(),i&&(o=s.parentElement.rowIndex-1),!n||r.top<=d.top)&&(this.pressedKey=e.keyArgs.action,a.scrollTop=o*this.parent.getRowHeight()))}else"PageDown"!==e.key&&"PageUp"!==e.key||(this.pressedKey=e.key);this.setLastCellFocusInfo(e)},E.prototype.createEmptyRowdata=function(){var t=this;this.parent.getColumns().filter(function(e){t.emptyRowData[e.field]=t.empty})},E.prototype.getVirtualInfiniteEditedData=function(){var e=this.parent.element.querySelector("."+Os),t=this.parent.element.querySelector("."+As),i=this.parent.element.querySelector(".e-gridform");if(this.parent.infiniteScrollSettings.enableCache&&(e||t))for(var t=e?H.extend({},this.getEditedRowObject().data):H.extend({},this.emptyRowData),n=(this.virtualInfiniteData=this.parent.editModule.getCurrentEditedData(i,t),this.parent.getHiddenColumns()),r=0;r<n.length;r++)n[parseInt(r.toString(),10)].defaultValue&&(this.virtualInfiniteData[n[parseInt(r.toString(),10)].field]=n[parseInt(r.toString(),10)].defaultValue)},E.prototype.restoreInfiniteEdit=function(){var e,t=this.parent.getContent().firstElementChild,i=!this.parent.frozenRows||this.editRowIndex>=this.parent.frozenRows;this.isNormaledit&&this.parent.infiniteScrollSettings.enableCache&&i&&this.parent.editSettings.allowEditing&&!H.isNullOrUndefined(this.editRowIndex)&&(i=this.parent.getRowByIndex(this.editRowIndex),Object.keys(this.virtualInfiniteData).length)&&i&&!this.parent.getContent().querySelector("."+Os)&&(e=i.getBoundingClientRect().top)<t.offsetHeight&&e>this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(i))},E.prototype.restoreInfiniteAdd=function(){var e=this.parent.getContent().firstElementChild;this.parent.getCurrentViewRecords().length&&this.parent.getRowByIndex(0)&&this.isNormaledit&&this.parent.infiniteScrollSettings.enableCache&&this.isAdd&&!e.querySelector("."+As)&&e.scrollTop<this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.addRecord())},E.prototype.appendInfiniteRows=function(e){var t,i=this.parent,n=this.parent.getContent().firstElementChild,r=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType;i.enableInfiniteScrolling&&(i.childGrid||i.detailTemplate)&&("add"===e.args.action&&"save"===e.args.requestType||"delete"===e.args.requestType)&&(n.scrollTop=0,i.pageSettings.currentPage=1),(this.parent.isAngular||this.parent.isReact||this.parent.isVue||this.parent.isVue3)&&r&&!e.args.isFrozen&&this.parent.infiniteScrollSettings.enableCache&&(i=!(!this.parent.childGrid||!this.parent.element.querySelectorAll(".e-childgrid").length),t=this.parent.getDataRows(),this.parent.refreshReactTemplateTD(t,i)),(!r||e.args.isFrozen)&&r||(r&&"up"===e.args.direction?e.tbody.insertBefore(e.frag,e.tbody.firstElementChild):e.tbody.appendChild(e.frag)),this.parent.contentModule.getTable().appendChild(e.tbody),this.updateCurrentViewData(),this.isInitialRender&&!e.args.isFrozen&&(this.isInitialRender=!1,this.parent.scrollModule.setHeight()),e.args.isFrozen||(this.rowTop=this.rowTop||this.parent.getRows()[0].getBoundingClientRect().top,r&&(this.parent.infiniteScrollSettings.enableCache&&this.isRemove&&(n.scrollTop=this.top),Tc(this.parent)),this.restoreInfiniteAdd(),this.isScroll=!0),this.isInfiniteScroll=!1,this.infiniteDetailDestroy=!1},E.prototype.selectNewRow=function(e){var t,i,n,r=this,s=this.parent,o=s.getRowByIndex(this.rowIndex),a=s.infiniteScrollSettings.enableCache;o&&this.keys.some(function(e){return e===r.pressedKey})?(t=s.getContent().firstElementChild,i=s.getRowHeight(),n=o.cells[this.cellIndex],this.pressedKey!==_s&&this.pressedKey!==Qs&&(!a||this.pressedKey!==Ks&&this.pressedKey!==Xs)||(a||this.pressedKey===Ks||this.pressedKey===Xs||(t.scrollTop=t.scrollTop+i),s.focusModule.isInfiniteScroll=!0,s.focusModule.onClick({target:n},!0),s.selectRow(this.rowIndex))):!this.lastFocusInfo||this.pressedKey!==Ws&&"PageUp"!==this.pressedKey||(o=a?0:this.lastFocusInfo.rowIdx,s.getRowByIndex(o)&&(n=s.getCellFromIndex(o,this.lastFocusInfo.cellIdx))&&(this.isFocusScroll=!0,a?n.focus({preventScroll:!0}):(s.focusModule.isInfiniteScroll=!0,s.focusModule.onClick({target:n},!0)))),this.pressedKey=void 0},E.prototype.removeInfiniteCacheRows=function(e){var t,i,n,r=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType;!e.args.isFrozen&&r&&this.parent.infiniteScrollSettings.enableCache&&this.isRemove&&(t=(r=!(!this.parent.childGrid&&!this.parent.detailTemplate))?this.getGridRows().filter(function(e){return e.classList.contains(Ts)}):[].slice.call(this.parent.getContentTable().getElementsByClassName(Ts)),"down"===e.args.direction&&(this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&(n=r?this.getGridRows().filter(function(e){return!e.classList.contains("e-detailrow")}):[].slice.call(this.parent.getContentTable().querySelectorAll("tr")),this.removeCaptionRows(n,e.args)),i=this.parent.element.querySelector("."+As)?0:1,this.removeTopRows(t,this.parent.pageSettings.pageSize-i)),"up"===e.args.direction&&(this.parent.allowGrouping&&this.parent.groupSettings.columns.length?(n=r?this.getGridRows().filter(function(e){return!e.classList.contains("e-detailrow")}):[].slice.call(this.parent.getContentTable().querySelectorAll("tr")),this.removeCaptionRows(n,e.args)):this.removeBottomRows(t,t.length-1,e.args)),this.isScroll=!1,this.top=this.calculateScrollTop(e.args))},E.prototype.calculateScrollTop=function(e){var t=0,i=this.parent.getContent().firstElementChild;if("down"===e.direction){this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!this.isInitialCollapse&&(t=this.captionRowHeight());for(var n=[].slice.call(this.parent.getContent().firstElementChild.querySelectorAll("tr:not(.e-row)")),r=0,n=(r=this.isInitialCollapse&&!H.isNullOrUndefined(n)?Math.round((n.length-1)/this.parent.groupSettings.columns.length):r)||this.parent.pageSettings.pageSize*(this.parent.infiniteScrollSettings.maxBlocks-1),s=0,o=0;s<i.clientHeight;)s=++o*this.parent.getRowHeight();t+=(n-(o-=1))*this.parent.getRowHeight()}if("up"===e.direction)if(this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!this.isInitialCollapse)t=this.refreshInfiniteCacheRowVisibleLength(this.infiniteCache,this.parent.pageSettings.currentPage)*this.parent.getRowHeight();else if(this.isInitialCollapse){for(var a=this.infiniteCache[this.parent.pageSettings.currentPage],l=0,o=0;o<a.length;o++)a[parseInt(o.toString(),10)].isCaptionRow&&l++;t+=Math.round(l/this.parent.groupSettings.columns.length)*this.parent.getRowHeight()}else t+=this.parent.pageSettings.pageSize*this.parent.getRowHeight()+Op();return t},E.prototype.captionRowHeight=function(){return[].slice.call(this.parent.getContent().querySelectorAll("tr:not(.e-row)")).length*this.parent.getRowHeight()},E.prototype.removeTopRows=function(e,t){for(var i=0;i<=t;i++)this.parent.frozenRows&&this.parent.pageSettings.currentPage===this.parent.infiniteScrollSettings.maxBlocks+1&&i>t-this.parent.frozenRows||H.remove(e[parseInt(i.toString(),10)])},E.prototype.removeBottomRows=function(e,t,i){var n=0,r=this.parent.pageSettings.pageSize;this.infiniteCache[i.prevPage].length<r&&(n=this.parent.pageSettings.pageSize-this.infiniteCache[i.prevPage].length);for(var s=t;n<r;s--)n++,H.remove(e[parseInt(s.toString(),10)])},E.prototype.removeCaptionRows=function(e,t){var i=!(!this.parent.childGrid&&!this.parent.detailTemplate),n=i?this.getGridRows().filter(function(e){return e.classList.contains(Ts)}):[].slice.call(this.parent.getContent().getElementsByClassName(Ts));if("down"===t.direction)for(var r=iu(n[this.parent.pageSettings.pageSize-1])-1,s=0,o=0;s<r;o++)e[parseInt(o.toString(),10)].classList.contains(Ts)?s=iu(e[parseInt(o.toString(),10)]):H.remove(e[parseInt(o.toString(),10)]);if("up"===t.direction){for(var t=iu(n[n.length-1]),a=Math.ceil(t/this.parent.pageSettings.pageSize),l=0,o=this.parent.pageSettings.currentPage+1;o<a;o++)l+=(i?this.infiniteCache[parseInt(o.toString(),10)].filter(function(e){return!e.isDetailRow}):this.infiniteCache[parseInt(o.toString(),10)]).length;for(o=l;o<e.length;o++)H.remove(e[parseInt(o.toString(),10)])}},E.prototype.getGridRows=function(){return[].slice.call(this.parent.getContentTable().rows)},E.prototype.resetInfiniteBlocks=function(t,e){var i=this.parent.enableInfiniteScrolling&&"infiniteScroll"!==t.requestType;this.initialRender||H.isNullOrUndefined(this.parent.infiniteScrollModule)||!i||(this.actions.some(function(e){return e===t.requestType})||e||"save"===t.requestType&&(this.parent.sortSettings.columns.length||this.parent.filterSettings.columns.length||this.parent.groupSettings.columns.length||this.parent.searchSettings.key))&&(i=this.parent.getContent().firstElementChild,this.parent.notify(ts,{}),this.initialRender=!0,i.scrollTop=0,this.parent.pageSettings.currentPage=1,this.infiniteCache={},this.infiniteCurrentViewData={},this.resetContentModuleCache({}),this.isRemove=!1,this.top=0,this.isInitialCollapse=!1,this.parent.isLastRecordLoaded=!1,this.hasMoreData=!0,this.isRequestPending=!1,this.parent.contentModule.isRemove=this.isRemove,this.parent.contentModule.isAddRows=this.isRemove,this.parent.contentModule.visibleRows=[],this.parent.contentModule.visibleFrozenRows=[])},E.prototype.setCache=function(e){var t,i,n;this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache&&(t=((t=this.parent).childGrid||t.detailTemplate)&&("add"===e.args.action&&"save"===e.args.requestType||"delete"===e.args.requestType),i="infiniteScroll"!==e.args.requestType&&("delete"===this.requestType||"add"===this.requestType),n=this.parent.pageSettings.currentPage,Object.keys(this.infiniteCache).length&&!i||(t&&(this.infiniteCache={}),this.setInitialCache(e.modelData,e.args,i)),H.isNullOrUndefined(this.infiniteCache[this.parent.pageSettings.currentPage])&&!t&&(this.infiniteCache[this.parent.pageSettings.currentPage]=e.modelData,this.resetContentModuleCache(this.infiniteCache)),e.isInfiniteScroll)&&!this.isRemove&&(this.isRemove=(n-1)%this.parent.infiniteScrollSettings.maxBlocks==0,this.parent.contentModule.isRemove=this.isRemove)},E.prototype.setInitialCache=function(e,t,i,n){for(var r=!i||H.isNullOrUndefined(this.firstBlock)?1:this.firstBlock,s=1;s<=this.parent.infiniteScrollSettings.initialBlocks;s++){var o=(s-1)*this.parent.pageSettings.pageSize,a=s*this.parent.pageSettings.pageSize;this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&!n?this.setInitialGroupCache(e,r,o,a):n?this.infiniteCurrentViewData[parseInt(r.toString(),10)]=e.slice(o,a):(this.infiniteCache[parseInt(r.toString(),10)]=e.slice(o,a),this.resetContentModuleCache(this.infiniteCache)),r++}},E.prototype.setInitialGroupCache=function(e,t,i,n){for(var r=[],s=0,o=1;o<=Object.keys(this.infiniteCache).length;o++)s+=this.infiniteCache[parseInt(o.toString(),10)].length;for(var a=i,o=s;o<e.length&&a<n&&((e[parseInt(o.toString(),10)].index<n||e[parseInt(o.toString(),10)].isCaptionRow)&&(a=e[parseInt(o.toString(),10)].isCaptionRow?a:e[parseInt(o.toString(),10)].index,r.push(e[parseInt(o.toString(),10)])),!(e[parseInt(o.toString(),10)].index>=n||e[parseInt(o.toString(),10)].index===n-1));o++);this.infiniteCache[parseInt(t.toString(),10)]=r,this.resetContentModuleCache(this.infiniteCache)},E.prototype.resetContentModuleCache=function(e){this.parent.contentModule.infiniteCache=e},E.prototype.resetInfiniteCache=function(e){var t=Object.keys(this.infiniteCache).length;this.infiniteCache={};for(var i=1;i<=t;i++){var n=(i-1)*this.parent.pageSettings.pageSize,r=i*this.parent.pageSettings.pageSize;this.parent.allowGrouping&&this.parent.groupSettings.columns.length?this.setInitialGroupCache(e,i,n,r):(this.infiniteCache[parseInt(i.toString(),10)]=e.slice(n,r),this.resetContentModuleCache(this.infiniteCache))}},E.prototype.destroy=function(){this.removeEventListener()};var Cm=E;function E(e,t){this.infiniteCache={},this.infiniteCurrentViewData={},this.isDownScroll=!1,this.isUpScroll=!1,this.isScroll=!0,this.enableContinuousScroll=!1,this.initialRender=!0,this.isRemove=!1,this.isInitialCollapse=!1,this.prevScrollTop=0,this.actions=["filtering","searching","grouping","ungrouping","reorder","sorting","refresh"],this.keys=[_s,Ks,Qs,Xs],this.rowTop=0,this.virtualInfiniteData={},this.isCancel=!1,this.emptyRowData={},this.isNormaledit=!1,this.isInfiniteScroll=!1,this.isLastPage=!1,this.isInitialRender=!0,this.isFocusScroll=!1,this.isGroupCollapse=!1,this.infiniteDetailDestroy=!1,this.hasMoreData=!0,this.isRequestPending=!1,H.initializeTelemetryFeature("InfiniteScroll","DataGrid"),this.parent=e,this.serviceLocator=t,this.isNormaledit="Normal"===this.parent.editSettings.mode,this.addEventListener(),this.widthService=t.getService("widthService"),this.rowModelGenerator=new Js(this.parent)}wm=function(e,t){return(wm=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}wm(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(O,bm=fo),O.prototype.eventListener=function(){this.parent.addEventListener(y,this.actionBegin.bind(this)),this.parent.addEventListener(c,this.actionComplete.bind(this)),this.parent.on(mt,this.setLazyLoadPageSize,this),this.parent.on(Yn,this.setCache,this),this.parent.on($n,this.scrollHandler,this),this.parent.on(Kt,this.setVisible,this),this.parent.on(Zn,this.collapseShortcut,this)},O.prototype.captionExpand=function(t){for(var i=this,n=this.parent.pageSettings.currentPage,e=this.groupCache[parseInt(n.toString(),10)],r=t.getAttribute("data-uid"),s=(this.refreshCaches(),this.scrollTopCache&&!(this.parent.scrollModule.content.scrollTop>this.scrollTopCache)||this.parent.enableVirtualization||(this.scrollTopCache=this.parent.scrollModule.content.scrollTop),this.getRowObjectIndexByUid(r)),o=!!e[s+1]&&e[parseInt(s.toString(),10)].indent<e[s+1].indent,a=(this.parent.enableVirtualization&&(o=!!this.cacheRowsObj[""+r]),e[parseInt(s.toString(),10)]),l=ou(s,e),h=0;h<l.fields.length;h++){var d=this.parent.getColumnByField(l.fields[parseInt(h.toString(),10)]);d.enableGroupByFormat&&(l.keys[parseInt(h.toString(),10)]=this.locator.getService("valueFormatter").fromView(l.keys[parseInt(h.toString(),10)],d.getParser(),"dateonly"===d.type?"date":d.type))}this.parent.trigger(ct,{captionRowElement:t,groupInfo:a,enableCaching:!0,cancel:!1},function(e){e.cancel||(e.keys=l.keys,e.fields=l.fields,e.rowIndex=t.rowIndex,e.makeRequest=!e.enableCaching||!o,!e.enableCaching&&o&&i.clearCache([r]),e.skip=0,e.take=i.pageSize,a.isExpand=!0,i.rowsByUid[parseInt(n.toString(),10)][a.uid]&&(i.rowsByUid[parseInt(n.toString(),10)][a.uid].isExpand=!0),i.captionRowExpand(e))})},O.prototype.captionCollapse=function(e){var r=this,t=this.groupCache[this.parent.pageSettings.currentPage],s=e.rowIndex,o=e.getAttribute("data-uid"),a=(this.refreshCaches(),this.getRowObjectIndexByUid(o)),e={captionRowElement:e,groupInfo:t[parseInt(a.toString(),10)],cancel:!1};this.parent.trigger(ut,e,function(e){if(!e.cancel){e.isExpand=!1;for(var t,i=0;i<r.lazyLoadQuery.length;i++){var n=r.lazyLoadQuery[parseInt(i.toString(),10)][0];e.groupInfo.data.key===n.value&&r.lazyLoadQuery.splice(i,1)}r.removeRows(a,s,o),r.parent.isRemote()&&(t=r.parent.getHeaderContent().querySelector(".e-checkselectall"))&&(0===r.getAllPagesData().length&&r.parent.selectionModule&&!r.parent.selectionModule.selectedRowIndexes.length?t.parentElement.classList.add("e-checkbox-disabled"):t.parentElement.classList.remove("e-checkbox-disabled")),(r.parent.enableInfiniteScrolling||r.parent.enableVirtualization)&&(r.groupCache[r.parent.pageSettings.currentPage]=H.extend([],r.refRowsObj[r.parent.pageSettings.currentPage]),r.refreshRowObjects([],a))}})},O.prototype.setLazyLoadPageSize=function(){var e=this.parent.getContent().firstElementChild,e=Math.floor(e.offsetHeight/this.parent.getRowHeight())-1;this.pageSize=this.pageSize||3*e,this.blockSize=Math.ceil(this.pageSize/2)},O.prototype.clearLazyGroupCache=function(){this.clearCache()},O.prototype.clearCache=function(e){e=e||this.getInitialCaptionIndexes();var t=this.groupCache[this.parent.pageSettings.currentPage];if(e.length)for(var i=0;i<e.length;i++){var n=this.getRowObjectIndexByUid(e[parseInt(i.toString(),10)]),r=t[parseInt(n.toString(),10)];if(r){if(this.captionCounts[this.parent.pageSettings.currentPage][r.uid])for(var s=n+1;s<t.length;s++){if(t[parseInt(s.toString(),10)].indent===r.indent||t[parseInt(s.toString(),10)].indent<r.indent){delete this.captionCounts[this.parent.pageSettings.currentPage][r.uid];break}t[parseInt(s.toString(),10)].isCaptionRow&&delete this.captionCounts[this.parent.pageSettings.currentPage][t[parseInt(s.toString(),10)].uid]}if(r.isExpand){var o=this.parent.getRowElementByUID(r.uid);if(!o)return;this.parent.groupModule.expandCollapseRows(o.querySelector(".e-recordplusexpand"))}var a,o=this.getNextChilds(n);o.length&&(n=[],o[o.length-1].isCaptionRow&&(n=this.getChildRowsByParentIndex(t.indexOf(o[o.length-1]),!1,!1,null,!0,!0)),a=t.indexOf(o[0]),n=n.length?t.indexOf(n[n.length-1]):t.indexOf(o[o.length-1]),t.splice(a,n-(a-1)),this.refreshCaches())}}},O.prototype.refreshCaches=function(){var e=this.parent.pageSettings.currentPage,t=this.groupCache[parseInt(e.toString(),10)];this.parent.enableInfiniteScrolling?(this.rowsByUid[parseInt(e.toString(),10)]=[],this.objIdxByUid[parseInt(e.toString(),10)]=[]):(this.rowsByUid={},this.objIdxByUid={});for(var i=0;i<t.length;i++)this.maintainRows(t[parseInt(i.toString(),10)],i)},O.prototype.getInitialCaptionIndexes=function(){for(var e=this.parent.pageSettings.currentPage,t=[],i=0;i<this.initialGroupCaptions[parseInt(e.toString(),10)].length;i++)t.push(this.initialGroupCaptions[parseInt(e.toString(),10)][parseInt(i.toString(),10)].uid);return t},O.prototype.getRowObjectIndexByUid=function(e){return this.objIdxByUid[this.parent.pageSettings.currentPage][""+e]},O.prototype.collapseShortcut=function(e){var t,i,n;this.parent.groupSettings.columns.length&&e.target&&I(e.target,xs)&&"TR"===e.target.parentElement.tagName&&(!e.collapse&&I(e.target,Ts)||(t=e.target.parentElement.getAttribute("data-uid"),e.collapse?(e=this.getRowByUid(t),(i=this.getRowByUid(e.parentUid)).isCaptionRow&&i.isExpand&&(n=this.getRowElementByUid(e.parentUid),this.parent.groupModule.expandCollapseRows(n.cells[e.indent-1]))):(i=this.getRowByUid(t)).isCaptionRow&&!i.isExpand&&(n=this.getRowElementByUid(t),this.parent.groupModule.expandCollapseRows(n.cells[i.indent]))))},O.prototype.getRowByUid=function(e){return this.rowsByUid[this.parent.pageSettings.currentPage][""+e]},O.prototype.actionBegin=function(t){if(!t.cancel){if(this.requestType.some(function(e){return e===t.requestType})||(this.groupCache={},this.resetRowMaintenance(),this.parent.enableVirtualization&&(this.parent.contentModule.currentInfo={})),"reorder"===t.requestType&&this.parent.groupSettings.columns.length)for(var e=Object.keys(this.groupCache),i=0;i<e.length;i++)for(var n,r,s=this.groupCache[e[parseInt(i.toString(),10)]],o=0;o<s.length;o++)s[parseInt(o.toString(),10)].isCaptionRow&&!this.captionModelGen.isEmpty()&&this.changeCaptionRow(s[parseInt(o.toString(),10)],null,e[parseInt(i.toString(),10)]),s[parseInt(o.toString(),10)].isDataRow&&(n=t.fromIndex+s[parseInt(o.toString(),10)].indent,r=t.toIndex+s[parseInt(o.toString(),10)].indent,this.moveCells(s[parseInt(o.toString(),10)].cells,n,r));("delete"===t.requestType||"add"===t.action&&"save"===t.requestType)&&(this.groupCache={},this.resetRowMaintenance(),this.parent.enableVirtualization)&&(this.parent.contentModule.currentInfo={})}},O.prototype.actionComplete=function(e){!e.cancel&&-1===["columnstate","reorder","save","beginEdit","delete","infiniteScroll","columnVisibilityUpdate","columnChooserClose","filterchoicerequest","filterAfterOpen"].indexOf(e.requestType)&&this.parent.groupSettings.columns.length&&this.scrollReset()},O.prototype.resetRowMaintenance=function(){this.startIndexes={},this.captionCounts={},this.rowsByUid={},this.objIdxByUid={},this.initialGroupCaptions={}},O.prototype.moveCells=function(e,t,i){if(t>=e.length)for(var n=t-e.length;1+n--;)e.push(void 0);e.splice(t,0,e.splice(i,1)[0])},O.prototype.removeRows=function(e,t,i){var n,r,s,o=this.parent.pageSettings.currentPage,a=this.groupCache[parseInt(o.toString(),10)],l=[].slice.call(this.parent.getContent().querySelectorAll("tr")),h=0,d=(this.parent.aggregates.length&&(r=(n=this.getAggregateByCaptionIndex(e)).length?n[n.length-1].uid:void 0),a[parseInt(e.toString(),10)].indent);this.addClass(this.getNextChilds(parseInt(e.toString(),10))),a[parseInt(e.toString(),10)].isExpand=!1,this.rowsByUid[parseInt(o.toString(),10)][a[parseInt(e.toString(),10)].uid]&&(this.rowsByUid[parseInt(o.toString(),10)][a[parseInt(e.toString(),10)].uid].isExpand=!1);for(var p=e+1;p<a.length;p++){if(a[parseInt(p.toString(),10)].indent===d||a[parseInt(p.toString(),10)].indent<d){s=a[parseInt(p.toString(),10)].uid;break}a[parseInt(p.toString(),10)].isCaptionRow&&a[parseInt(p.toString(),10)].isExpand&&this.addClass(this.getNextChilds(p))}for(p=t+1;p<l.length&&l[parseInt(p.toString(),10)].getAttribute("data-uid")!==s;p++){if(l[parseInt(p.toString(),10)].getAttribute("data-uid")===r){H.remove(l[parseInt(p.toString(),10)]);break}H.remove(l[parseInt(p.toString(),10)]),this.refRowsObj[parseInt(o.toString(),10)].splice(t+1,1),h+=1}this.cacheRowsObj[""+i]=this.groupCache[parseInt(o.toString(),10)].slice(e+1,e+1+h),this.groupCache[parseInt(o.toString(),10)].splice(e+1,h),this.parent.enableVirtualization&&(this.parent.notify(Gr,{rows:[],uid:a[parseInt(e.toString(),10)].uid,count:h}),this.parent.contentModule.setVirtualHeight(),this.parent.islazyloadRequest=!1),this.parent.scrollModule.content.scrollTop>this.scrollTopCache&&!this.parent.enableVirtualization&&(this.parent.scrollModule.content.scrollTop=this.scrollTopCache),this.parent.getContentTable().scrollHeight<this.parent.getContent().clientHeight&&"auto"!==this.parent.height&&this.parent.scrollModule.setLastRowCell(),this.parent.notify(Cr,{rows:this.refRowsObj[parseInt(o.toString(),10)]})},O.prototype.addClass=function(e){e=e[this.blockSize];e&&(e.lazyLoadCssClass="e-lazyload-middle-down")},O.prototype.getNextChilds=function(e,t){for(var i=this.groupCache[this.parent.pageSettings.currentPage],n=t||i,r=i[parseInt(e.toString(),10)].indent+1,s=[],o=t?0:e+1;o<n.length&&!(n[parseInt(o.toString(),10)].indent<r);o++)n[parseInt(o.toString(),10)].indent===r&&s.push(n[parseInt(o.toString(),10)]);return s},O.prototype.lazyLoadHandler=function(e){this.setStartIndexes();var t=this.parent.getContent().querySelectorAll("tr")[e.index],i=t.getAttribute("data-uid"),n=this.getRowObjectIndexByUid(i),r=this.groupCache[this.parent.pageSettings.currentPage][parseInt(n.toString(),10)],s=e.isRowExist?e.isScroll?this.scrollData:this.parent.enableVirtualization?this.cacheRowsObj[""+i]:this.getChildRowsByParentIndex(n,!0,!0,null,!0):[];if(this.scrollData=[],!e.isRowExist)if(this.setRowIndexes(n,r),this.refreshCaptionRowCount(this.groupCache[this.parent.pageSettings.currentPage][parseInt(n.toString(),10)],e.count),-1!==Object.keys(e.data).indexOf("GroupGuid"))for(var o=0;o<e.data.length;o++){var a=this.groupGenerator.generateCaptionRow(e.data[parseInt(o.toString(),10)],e.level,r.parentGid,void 0,0,r.uid);s.push(a),this.parent.aggregates.length&&(s=s.concat(this.summaryModelGen.generateRows(e.data[parseInt(o.toString(),10)],{level:e.level+1,parentUid:a.uid})))}else this.groupGenerator.index=this.parent.allowPaging?this.getStartIndex(n,e.isScroll):(e.isScroll?this:r.data).startIndex,s=this.groupGenerator.generateDataRows(e.data,e.level,r.parentGid,0,r.uid);var l=e.isScroll?this.rowIndex:e.index,h=this.getNextChilds(n,s),d=!!e.up||this.hasLastChildRow(e.isScroll,e.count,h.length),h=(e.isRowExist||d||(h[this.blockSize].lazyLoadCssClass="e-lazyload-middle-down"),d||(h[h.length-1].lazyLoadCssClass="e-not-lazyload-end"),e.isScroll||e.isRowExist?[]:this.getAggregateByCaptionIndex(n));e.up||(!e.isRowExist||this.parent.enableVirtualization&&e.isRowExist&&this.cacheRowsObj[""+i])&&this.refreshRowObjects(s,e.isScroll?this.rowObjectIndex:n),this.parent.enableVirtualization&&(i=(e.isScroll?this.groupCache[this.parent.pageSettings.currentPage][this.rowIndex]:r).uid,this.parent.notify(Gr,{rows:s,uid:i}),this.parent.contentModule.setVirtualHeight(),this.parent.contentModule.isTop=!1),this.render(l,s,d,h),this.isFirstChildRow&&!e.up&&(this.parent.getContent().firstElementChild.scrollTop=s.length*this.parent.getRowHeight()),this.isFirstChildRow=!1,this.rowIndex=void 0,this.rowObjectIndex=void 0;for(o=this.childCount=0;o<s.length;o++){this.refRowsObj[this.parent.pageSettings.currentPage].splice(n+o+1,0,s[parseInt(o.toString(),10)]);var p=s[parseInt(o.toString(),10)];p.isSelected&&(this.parent.selectionModule.selectedRecords.push(this.getRowByIndex(p.index)),this.parent.allowPaging)&&this.parent.selectionModule.selectedRowIndexes.push(p.index)}d&&t.querySelector(".e-lastrowcell")&&this.parent.groupModule.lastCaptionRowBorder(),this.parent.notify(Cr,{rows:this.refRowsObj[this.parent.pageSettings.currentPage]}),this.parent.enableVirtualMaskRow&&this.parent.removeMaskRow()},O.prototype.setRowIndexes=function(e,t){this.captionCounts[this.parent.pageSettings.currentPage]||(this.captionCounts[this.parent.pageSettings.currentPage]={}),t.isCaptionRow&&(this.captionCounts[this.parent.pageSettings.currentPage][t.uid]=t.data.count)},O.prototype.getStartIndex=function(e,t){var i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)];if(t)return n[this.rowObjectIndex].index+1;var r=0,t=0,s=this.getRowByUid(n[parseInt(e.toString(),10)].parentUid);if(s&&(t=this.prevCaptionCount(s)),0<n[parseInt(e.toString(),10)].indent)for(var o=e-1;0<=o&&!(n[parseInt(o.toString(),10)].indent<n[parseInt(e.toString(),10)].indent);o--)n[parseInt(o.toString(),10)].isCaptionRow&&n[parseInt(o.toString(),10)].indent===n[parseInt(e.toString(),10)].indent&&(r+=n[parseInt(o.toString(),10)].data.count);return r+t+this.startIndexes[parseInt(i.toString(),10)][n[parseInt(e.toString(),10)].parentGid]},O.prototype.prevCaptionCount=function(e){for(var t=this.parent.pageSettings.currentPage,i=this.groupCache[parseInt(t.toString(),10)],n=0,r=i.indexOf(e)-1;0<=r&&0!==i[parseInt(r.toString(),10)].indent&&!(i[parseInt(r.toString(),10)].indent<e.indent);r--)i[parseInt(r.toString(),10)].isCaptionRow&&i[parseInt(r.toString(),10)].indent===e.indent&&(n+=this.captionCounts[parseInt(t.toString(),10)][i[parseInt(r.toString(),10)].uid]||i[parseInt(r.toString(),10)].data.count);var s=this.getRowByUid(e.parentUid);return s&&(n+=this.prevCaptionCount(s)),n},O.prototype.setStartIndexes=function(){var e=this.groupCache[this.parent.pageSettings.currentPage];if(!this.startIndexes[this.parent.pageSettings.currentPage]){for(var t=[],i=void 0,n=0;n<e.length;n++)e[parseInt(n.toString(),10)].isCaptionRow&&(t.push(t.length?e[parseInt(i.toString(),10)].data.count+t[t.length-1]:0),i=n);this.startIndexes[this.parent.pageSettings.currentPage]=t}},O.prototype.hasLastChildRow=function(e,t,i){return e?t===this.childCount+i:t===i},O.prototype.refreshCaptionRowCount=function(e,t){e.data.count=t},O.prototype.render=function(e,t,i,n){var r=this.parent.getContent().querySelectorAll("tr")[parseInt(e.toString(),10)],s=this.parent.getContent().firstElementChild,o=this.parent.getRowHeight();if(r&&n.length)for(var a=n.length-1;0<=a;a--)r.insertAdjacentElement("afterend",this.rowRenderer.render(n[parseInt(a.toString(),10)],this.parent.getColumns()));if(r&&t.length){for(e=this.parent.getHeaderContent().querySelector(".e-checkselectall"),a=t.length-1;0<=a;a--)this.confirmRowRendering(t[parseInt(a.toString(),10)])&&(r.insertAdjacentElement("afterend",this.rowRenderer.render(t[parseInt(a.toString(),10)],this.parent.getColumns())),this.isScrollDown&&(s.scrollTop=s.scrollTop-o),this.isScrollUp)&&(s.scrollTop=s.scrollTop+o);this.parent.isRemote()&&this.parent.isCheckBoxSelection&&e&&e.nextElementSibling&&(e.nextElementSibling.classList.contains("e-check")||e.nextElementSibling.classList.contains("e-stop"))&&this.parent.selectionModule.onDataBound()}this.isScrollDown=!1,this.isScrollUp=!1},O.prototype.maintainRows=function(e,t){var i=this.parent.pageSettings.currentPage;this.rowsByUid[parseInt(i.toString(),10)]||(this.rowsByUid[parseInt(i.toString(),10)]={},this.objIdxByUid[parseInt(i.toString(),10)]={}),e.uid&&(this.rowsByUid[parseInt(i.toString(),10)][e.uid]=e),this.objIdxByUid[parseInt(i.toString(),10)][e.uid]=t},O.prototype.confirmRowRendering=function(e){var t=!0;return!H.isNullOrUndefined(e.indent)||e.isDataRow||e.isCaptionRow||(e=this.getRowByUid(e.parentUid)).isCaptionRow&&!e.isExpand&&(t=!1),t},O.prototype.refreshRowObjects=function(e,t){for(var i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)],r=(this.rowsByUid[parseInt(i.toString(),10)]={},this.objIdxByUid[parseInt(i.toString(),10)]={},[]),s=0,o=0;o<n.length;o++)if(o===t){this.maintainRows(n[parseInt(o.toString(),10)],s),r.push(n[parseInt(o.toString(),10)]),s++;for(var a=0;a<e.length;a++)this.maintainRows(e[parseInt(a.toString(),10)],s),r.push(e[parseInt(a.toString(),10)]),s++}else this.maintainRows(n[parseInt(o.toString(),10)],s),r.push(n[parseInt(o.toString(),10)]),s++;this.groupCache[this.parent.pageSettings.currentPage]=H.extend([],r),this.updateCurrentViewData()},O.prototype.getAggregateByCaptionIndex=function(e){for(var t=this.groupCache[this.parent.pageSettings.currentPage],i=t[parseInt(e.toString(),10)],n=i.indent,r=i.uid,s=[],o=e+1;o<t.length&&t[parseInt(o.toString(),10)].indent!==n;o++)H.isNullOrUndefined(t[parseInt(o.toString(),10)].indent)&&t[parseInt(o.toString(),10)].parentUid===r&&s.push(t[parseInt(o.toString(),10)]);return s},O.prototype.getChildRowsByParentIndex=function(e,t,i,n,r,s){var o=n||this.groupCache[this.parent.pageSettings.currentPage],a=o[parseInt(e.toString(),10)],l=[];if(!a.isCaptionRow||a.isCaptionRow&&!a.isExpand&&!s)return[];r&&this.parent.aggregates.length&&(l=this.getAggregateByCaptionIndex(e));for(var h=a.indent,d=a.uid,p=[],c=0,u=e+1;u<o.length;u++){if(o[parseInt(u.toString(),10)].parentUid===d){if(H.isNullOrUndefined(o[parseInt(u.toString(),10)].indent))continue;if(c++,p.push(o[parseInt(u.toString(),10)]),t&&o[parseInt(u.toString(),10)].isCaptionRow&&(p=p.concat(this.getChildRowsByParentIndex(u,t,i,n,r))),i&&c===this.pageSize)break}if(o[parseInt(u.toString(),10)].indent===h)break}return p.concat(l)},O.prototype.initialGroupRows=function(e){var t=[],i=this.groupCache[this.parent.pageSettings.currentPage];if(e)return this.getRenderedRowsObject();for(var n=0;n<i.length;n++)0===i[parseInt(n.toString(),10)].indent&&(t.push(i[parseInt(n.toString(),10)]),t=t.concat(this.getChildRowsByParentIndex(n,!0,!0,i,!0)));return t},O.prototype.getRenderedRowsObject=function(){for(var e=[],t=[].slice.call(this.parent.getContent().querySelectorAll("tr")),i=0;i<t.length;i++)e.push(this.getRowByUid(t[parseInt(i.toString(),10)].getAttribute("data-uid")));return e},O.prototype.getCacheRowsOnDownScroll=function(e){for(var t=[],i=this.groupCache[this.parent.pageSettings.currentPage],n=e,r=0;r<this.pageSize&&i[parseInt(n.toString(),10)]&&!(i[parseInt(n.toString(),10)].indent<i[parseInt(e.toString(),10)].indent);r++)i[parseInt(n.toString(),10)].indent===i[parseInt(e.toString(),10)].indent&&(t.push(i[parseInt(n.toString(),10)]),i[parseInt(n.toString(),10)].isCaptionRow)&&i[parseInt(n.toString(),10)].isExpand&&(t=t.concat(this.getChildRowsByParentIndex(n,!0,!0,null,!0))),(i[parseInt(n.toString(),10)].indent>i[parseInt(e.toString(),10)].indent||H.isNullOrUndefined(i[parseInt(n.toString(),10)].indent))&&r--,n++;return t},O.prototype.getCacheRowsOnUpScroll=function(e,t,i){for(var n=[],r=this.groupCache[this.parent.pageSettings.currentPage],s=!1,o=0;o<r.length&&(!s||r[parseInt(o.toString(),10)]&&!(r[parseInt(o.toString(),10)].indent<r[parseInt(i.toString(),10)].indent)&&r[parseInt(o.toString(),10)].uid!==t);o++)(s=s||r[parseInt(o.toString(),10)].uid!==e?s:!0)&&r[parseInt(o.toString(),10)].indent===r[parseInt(i.toString(),10)].indent&&(n.push(r[parseInt(o.toString(),10)]),r[parseInt(o.toString(),10)].isCaptionRow)&&r[parseInt(o.toString(),10)].isExpand&&(n=n.concat(this.getChildRowsByParentIndex(o,!0,!0,null,!0)));return n},O.prototype.scrollHandler=function(e){if(!this.parent.isDestroyed&&!this.childCount){var t,i,n=[].slice.call(this.parent.getContent().getElementsByClassName("e-lazyload-middle-down")),r=[].slice.call(this.parent.getContent().getElementsByClassName("e-lazyload-middle-up")),s=[].slice.call(this.parent.getContent().getElementsByClassName("e-not-lazyload-end")),o=!1,a=!1,l=!1;if(e.scrollDown&&n.length&&(t=(i=this.findRowElements(n)).tr,o=i.entered),!e.scrollDown&&s)for(var h=0;h<s.length;h++){var d=s[parseInt(h.toString(),10)].getBoundingClientRect().top,p=this.parent.getContent().scrollHeight;if(0<d&&d<p){t=s[parseInt(h.toString(),10)],l=!0,this.rowIndex=t.rowIndex;break}}e.scrollDown||!r.length||l||(t=(i=this.findRowElements(r)).tr,a=i.entered),t&&!t.classList.contains("e-masked-row")&&(o&&e.scrollDown&&o&&t&&this.scrollDownHandler(t),!e.scrollDown&&l&&t&&this.scrollUpEndRowHandler(t),this.cacheMode)&&!e.scrollDown&&!l&&a&&t&&this.scrollUpHandler(t)}},O.prototype.scrollUpEndRowHandler=function(e){var t=this.parent.pageSettings.currentPage,t=this.groupCache[parseInt(t.toString(),10)],i=e.getAttribute("data-uid"),n=this.rowObjectIndex=this.getRowObjectIndexByUid(i),r=n,s=t[parseInt(n.toString(),10)],o=this.getRowByUid(s.parentUid),a=this.getRowObjectIndexByUid(o.uid),l=this.parent.getContent().querySelector("tr[data-uid="+kp(o.uid)+"]").rowIndex,h=this.getChildRowsByParentIndex(a).indexOf(s),h=Math.ceil(h/this.pageSize);1!==h&&(this.childCount=h*this.pageSize,n=this.getCurrentBlockEndIndex(s,n),this.childCount<o.data.count?(e.classList.remove("e-not-lazyload-end"),s.lazyLoadCssClass="",h=!!t[n+1]&&s.indent===t[n+1].indent,this.scrollData=h?this.getCacheRowsOnDownScroll(n+1):[],s={rowIndex:l,makeRequest:!h,groupInfo:o,fields:(e=ou(a,t)).fields,keys:e.keys,skip:this.childCount,take:this.pageSize,isScroll:!0},this.cacheMode&&this.childCount>=this.pageSize*this.cacheBlockSize&&(n=this.getChildRowsByParentIndex(a),l=Math.ceil(n.indexOf(t[parseInt(r.toString(),10)])/this.pageSize)-(this.cacheBlockSize-1),this.removeBlock(i,h,l,n),s.cachedRowIndex=l*this.pageSize),this.captionRowExpand(s)):this.childCount=0)},O.prototype.scrollDownHandler=function(e){var t,i,n=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(n.toString(),10)],r=e.getAttribute("data-uid"),s=this.getRowObjectIndexByUid(r),o=s,a=n[parseInt(s.toString(),10)],l=this.getRowByUid(a.parentUid),h=this.getRowObjectIndexByUid(l.uid),d=this.getRowElementByUid(l.uid).rowIndex,p=this.getChildRowsByParentIndex(h);0===p.length||(t=p.indexOf(a),t=Math.ceil(t/this.pageSize),this.childCount=t*this.pageSize,H.isNullOrUndefined(p[this.childCount-1]))||(this.parent.enableVirtualization&&(this.parent.islazyloadRequest=!0),s=this.rowObjectIndex=this.getRowObjectIndexByUid(p[this.childCount-1].uid),p=n[parseInt(s.toString(),10)],i=this.getRowElementByUid(p.uid),this.rowIndex=i.rowIndex,s=this.getCurrentBlockEndIndex(p,s),this.childCount===l.data.count&&(this.parent.islazyloadRequest=!1),this.childCount<l.data.count?(a=!!n[s+1]&&a.indent===n[s+1].indent)&&!H.isNullOrUndefined(this.getRowElementByUid(n[s+1].uid))?(this.parent.islazyloadRequest=!1,this.childCount=0):((1<t||!this.cacheMode)&&(e.classList.remove("e-lazyload-middle-down"),i.classList.remove("e-not-lazyload-end"),p.lazyLoadCssClass=""),this.scrollData=a?this.getCacheRowsOnDownScroll(this.rowObjectIndex+1):[],t={rowIndex:d,makeRequest:!a,groupInfo:l,fields:(s=ou(h,n)).fields,keys:s.keys,skip:this.childCount,take:this.pageSize,isScroll:!0},this.cacheMode&&this.childCount-this.pageSize>=this.pageSize*this.cacheBlockSize&&(this.isScrollDown=!0,e=this.getChildRowsByParentIndex(h),i=Math.ceil(e.indexOf(n[parseInt(o.toString(),10)])/this.pageSize)-1-(this.cacheBlockSize-1)+1,this.removeBlock(r,a,i,e,p),t.cachedRowIndex=i*this.pageSize),this.captionRowExpand(t)):(this.childCount=0,this.parent.islazyloadRequest=!1))},O.prototype.getCurrentBlockEndIndex=function(e,t){var i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)];if(e.isCaptionRow){e.isExpand&&(i=this.getChildRowsByParentIndex(t,!0).length,this.rowIndex=this.rowIndex+i);for(var e=this.getAggregateByCaptionIndex(t),r=(this.rowObjectIndex=this.rowObjectIndex+e.length,t),s=r+1;s<n.length;s++){if(n[parseInt(s.toString(),10)].indent===n[parseInt(t.toString(),10)].indent||n[parseInt(s.toString(),10)].indent<n[parseInt(t.toString(),10)].indent){t=r;break}r++}}return t},O.prototype.removeBlock=function(e,t,i,n,r){var s=this.parent.pageSettings.currentPage,s=this.groupCache[parseInt(s.toString(),10)],o=n[(i+1)*this.pageSize-1-this.blockSize].uid,a=n[i*this.pageSize-this.pageSize].uid,n=n[i*this.pageSize].uid,i=this.getRowObjectIndexByUid(o);s[parseInt(i.toString(),10)].lazyLoadCssClass="e-lazyload-middle-up",this.getRowElementByUid(o).classList.add("e-lazyload-middle-up"),r&&(this.getRowElementByUid(n).classList.add("e-not-lazyload-first"),this.getRowByUid(n).lazyLoadCssClass="e-not-lazyload-first",this.getRowByUid(a).lazyLoadCssClass=""),t?this.removeTopRows(r?r.uid:e,a,n):(this.uid1=a,this.uid2=n,this.uid3=r?r.uid:e)},O.prototype.scrollUpHandler=function(e){var t,i=this.parent.pageSettings.currentPage,n=this.groupCache[parseInt(i.toString(),10)],r=e.getAttribute("data-uid"),s=this.getRowByUid(r),r=this.rowObjectIndex=this.getRowObjectIndexByUid(r),s=this.getRowByUid(s.parentUid),o=this.rowIndex=this.getRowObjectIndexByUid(s.uid),a=this.parent.getRowElementByUID(s.uid).rowIndex,o=this.getChildRowsByParentIndex(o),l=o.indexOf(n[parseInt(r.toString(),10)]),h=Math.floor(l/this.pageSize),d=this.blockSize,p=(2*this.blockSize>this.pageSize&&(d=2*this.blockSize-this.pageSize,d=this.blockSize-d),o[l-(d-1)-this.pageSize].uid),l=o[l-(d-1)].uid,r=(this.scrollData=this.getCacheRowsOnUpScroll(p,l,r-(d-1)),this.isFirstChildRow=1<h,this.isFirstChildRow&&(this.scrollData[0].lazyLoadCssClass="e-not-lazyload-first"),this.getRowByUid(l).lazyLoadCssClass="",this.getRowElementByUid(l).classList.remove("e-not-lazyload-first"),h+this.cacheBlockSize);o.length!==s.data.count&&r*this.pageSize>o.length?(this.isFirstChildRow=!1,this.scrollData[0].lazyLoadCssClass="",this.getRowElementByUid(l).classList.add("e-not-lazyload-first")):(h=r*this.pageSize>s.data.count?s.data.count:r*this.pageSize,l=r*this.pageSize>s.data.count?this.pageSize-(this.pageSize*r-s.data.count):this.pageSize,r=((r=this.getChildRowsByParentIndex(n.indexOf(o[h-1]),!0,!1,null,!0)).length?r[r.length-1]:o[h-1]).uid,t=o[h-l].uid,o=o[h-l-1].uid,h=this.objIdxByUid[parseInt(i.toString(),10)][""+t]-d,"e-lazyload-middle-down"===n[parseInt(h.toString(),10)].lazyLoadCssClass&&(l=this.getRowElementByUid(n[parseInt(h.toString(),10)].uid))&&l.classList.add("e-lazyload-middle-down"),this.getRowByUid(r).lazyLoadCssClass="",this.getRowByUid(o).lazyLoadCssClass="e-not-lazyload-end",this.getRowElementByUid(o).classList.add("e-not-lazyload-end"),this.removeBottomRows(r,t,o),this.rowIndex=e.rowIndex-d,1<e.classList.length?e.classList.remove("e-lazyload-middle-up"):e.removeAttribute("class"),H.isNullOrUndefined(this.getRowElementByUid(p))?(h={rowIndex:a,makeRequest:!1,groupInfo:s,fields:(i=ou(this.getRowObjectIndexByUid(s.uid),n)).fields,keys:i.keys,skip:this.childCount,take:this.pageSize,isScroll:!0,scrollUp:!0},this.isScrollUp=!0,this.captionRowExpand(h)):(this.childCount=0,this.scrollData=[]))},O.prototype.findRowElements=function(e){for(var t,i=!1,n=0;n<e.length;n++){var r,s=e[parseInt(n.toString(),10)].rowIndex;if(this.parent.enableVirtualization&&(r=this.parent.contentModule.currentInfo)&&r.blockIndexes&&1<r.blockIndexes[0]&&(s+=this.parent.contentModule.offsets[r.blockIndexes[0]-1]/this.parent.getRowHeight()),vc(s,this.parent)){i=!0,this.rowIndex=s,t=e[parseInt(n.toString(),10)];break}}return{entered:i,tr:t}},O.prototype.getRowElementByUid=function(e){return this.parent.getContent().querySelector("tr[data-uid="+e+"]")},O.prototype.removeTopRows=function(e,t,i){for(var n=[].slice.call(this.parent.getContent().querySelectorAll("tr")),r=!1,s=0;s<n.length;s++){if(n[parseInt(s.toString(),10)].getAttribute("data-uid")===i){var o=this.parent.getContent().querySelector("tr[data-uid="+e+"]");o&&(this.rowIndex=o.rowIndex);break}(r=n[parseInt(s.toString(),10)].getAttribute("data-uid")===t?!0:r)&&H.remove(n[parseInt(s.toString(),10)])}},O.prototype.removeBottomRows=function(e,t,i){for(var n=[].slice.call(this.parent.getContent().querySelectorAll("tr")),r=!1,s=0;s<n.length&&(!(r=n[parseInt(s.toString(),10)].getAttribute("data-uid")===t||r)||(H.remove(n[parseInt(s.toString(),10)]),n[parseInt(s.toString(),10)].getAttribute("data-uid")!==e));s++);},O.prototype.setCache=function(e){var t=this.parent.pageSettings.currentPage;if(this.parent.enableVirtualization&&(this.parent.lazyLoadRender=this),this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.args.requestType&&e.args.prevPage!==e.args.currentPage){this.groupCache[parseInt(t.toString(),10)]=this.initialGroupCaptions[parseInt(t.toString(),10)]=this.groupCache[e.args.prevPage].concat(H.extend([],e.data));for(var i=Object.keys(this.groupCache),n=0;n<i.length;n++)e.args.currentPage!==parseInt(i[parseInt(n.toString(),10)],10)&&(delete this.groupCache[""+i[parseInt(n.toString(),10)]],delete this.initialGroupCaptions[""+i[parseInt(n.toString(),10)]])}else this.groupCache[parseInt(t.toString(),10)]=this.initialGroupCaptions[parseInt(t.toString(),10)]=H.extend([],e.data)},O.prototype.captionRowExpand=function(n){var e,r=this,t=n.groupInfo,s=this.parent.groupSettings.columns.indexOf(t.data.field)+1,t=su(ru(n.fields,n.keys,this)),t={level:s,skip:n.skip,take:n.take,where:t};n.lazyLoadQuery=t,n.requestType="onDemandGroupInfo",n.makeRequest?((e=this.parent.renderModule.data.generateQuery(!0)).isCountRequired||(e.isCountRequired=!0),e.lazyLoad.push({key:"onDemandGroupInfo",value:t}),this.lazyLoadQuery.push(t.where),n.isScroll&&this.parent.enableVirtualMaskRow?this.parent.showMaskRow():this.parent.showSpinner(),this.parent.renderModule.data.getData(n,e).then(function(e){if(r.parent.enableVirtualization&&(r.parent.islazyloadRequest=!0),r.parent.hideSpinner(),r.parent.removeMaskRow(),0!==e.result.length){var t=0===n.skip?n.groupInfo&&n.groupInfo.data&&n.groupInfo.data.startIndex:r.parent.groupSettings.columns.length===n.keys.length?n.skip+n.groupInfo.data.startIndex:r.startIndex;if(r.parent.groupSettings&&r.parent.groupSettings.columns.length!==n.keys.length)for(var i=0;i<e.result.length;i++)e.result[parseInt(i.toString(),10)].startIndex=t,t+=e.result[parseInt(i.toString(),10)].count;r.startIndex=t,r.cacheMode&&r.uid1&&r.uid2&&(r.removeTopRows(r.uid3,r.uid1,r.uid2),r.uid1=r.uid2=r.uid3=void 0),r.lazyLoadHandler({data:e.result,count:e.count,level:s,index:n.rowIndex,isRowExist:!1,isScroll:n.isScroll,up:!1,rowIndex:n.cachedRowIndex})}}).catch(function(e){return r.parent.renderModule.dataManagerFailure(e,{requestType:"grouping"})})):this.lazyLoadHandler({data:null,count:n.groupInfo.data.count,level:s,index:n.rowIndex,isRowExist:!0,isScroll:n.isScroll,up:n.scrollUp,rowIndex:n.cachedRowIndex})},O.prototype.scrollReset=function(e){this.parent.getContent().firstElementChild.scrollTop=e?this.parent.getContent().firstElementChild.scrollTop+e:0},O.prototype.updateCurrentViewData=function(){var e,t=[];this.getRows().filter(function(e){e.isDataRow&&(t[e.index]=e.data)}),this.parent.isRemote()&&(e=this.parent.getHeaderContent().querySelector(".e-checkselectall"))&&(t.length||this.getAllPagesData().length?e.parentElement.classList.remove("e-checkbox-disabled"):this.parent.selectionModule&&!this.parent.selectionModule.selectedRowIndexes.length&&e.parentElement.classList.add("e-checkbox-disabled")),this.parent.currentViewData=t.length?t:this.parent.currentViewData},O.prototype.getGroupCache=function(){return this.groupCache},O.prototype.getRows=function(){return this.groupCache[this.parent.pageSettings.currentPage]||[]},O.prototype.getRowElements=function(){return[].slice.call(this.parent.getContent().getElementsByClassName(Ts))},O.prototype.getRowByIndex=function(e){for(var t,i=[].slice.call(this.parent.getContent().getElementsByClassName(Ts)),n=0;!H.isNullOrUndefined(e)&&n<i.length;n++){var r=parseInt(i[parseInt(n.toString(),10)].getAttribute(D),10);if(r&&r-1===e){t=i[parseInt(n.toString(),10)];break}}return t},O.prototype.setVisible=function(e){for(var t,i=this.parent,n=(this.getRows().some(function(e){return e.isDataRow&&(t=e),e.isDataRow}),this.getRows().filter(function(e){return!e.isDetailRow})),r=0;r<e.length;r++){var s=e[parseInt(r.toString(),10)],o=this.parent.getNormalizedColumnIndex(s.uid),a=this.parent.getColumnIndexByUid(s.uid),l=!0===s.visible?"":"none",h=this.getColGroup();-1!==o&&t&&o<t.cells.length&&!H.isNullOrUndefined(h)&&H.setStyleAttribute(h.childNodes[parseInt(o.toString(),10)],{display:l}),this.setDisplayNone(i.getDataRows(),a,l,n,o),!this.parent.invokedFromMedia&&s.hideAtMedia&&this.parent.updateMediaColumns(s),this.parent.invokedFromMedia=!1}},O.prototype.setDisplayNone=function(e,t,i,n,r){if(this.parent.groupSettings.columns.length){var s=!1;if(this.parent.enableVirtualization&&this.parent.groupSettings.enableLazyLoading&&this.parent.contentModule.vgenerator){for(var o=this.parent.contentModule.vgenerator.cache,a=Object.keys(o),l=this.parent.getVisibleColumns().length,h=0;h<a.length;h++)for(var d=o[a[parseInt(h.toString(),10)]],p=0;p<d.length;p++){var c=d[parseInt(p.toString(),10)];c.isCaptionRow&&(c.cells[c.indent+1].colSpan=this.parent.enableColumnVirtualization?1:l+this.parent.groupSettings.columns.length+(this.parent.detailTemplate||this.parent.childGrid?1:0)-c.indent+(l?-1:0)),c.isDataRow&&(c.cells[parseInt(r.toString(),10)].visible=""===i)}s=!0}for(var u=Object.keys(this.groupCache),g=0;g<u.length;g++){var f=this.rowsByUid[u[parseInt(g.toString(),10)]];if(!H.isNullOrUndefined(f))for(var m=Object.keys(f),h=0;h<m.length;h++){var y=this.parent.getContent().querySelector("tr[data-uid="+kp(m[parseInt(h.toString(),10)])+"]"),v=f[m[parseInt(h.toString(),10)]];v.isCaptionRow&&(this.captionModelGen.isEmpty()?(s||(v.cells[v.indent+1].colSpan=""===i?v.cells[v.indent+1].colSpan+1:v.cells[v.indent+1].colSpan-1),y&&(y.cells[v.indent+1].colSpan=v.cells[v.indent+1].colSpan)):this.changeCaptionRow(v,y,u[parseInt(g.toString(),10)])),v.isDataRow&&(this.showAndHideCells(y,t,i,!1),v.cells[parseInt(r.toString(),10)].visible=""===i),v.isCaptionRow||v.isDataRow||!H.isNullOrUndefined(v.indent)||(v.cells[parseInt(r.toString(),10)].visible=""===i,v.visible=v.cells.some(function(e){return e.isDataCell&&e.visible}),this.showAndHideCells(y,t,i,!0,v))}}}else _c(e,t,i,n)},O.prototype.changeCaptionRow=function(e,t,i){var n=e.data,n=this.groupGenerator.generateCaptionRow(n,e.indent,e.parentGid,void 0,e.tIndex,e.parentUid);n.uid=e.uid,n.isExpand=e.isExpand,n.lazyLoadCssClass=e.lazyLoadCssClass,this.rowsByUid[parseInt(i.toString(),10)][e.uid]=n,this.groupCache[parseInt(i.toString(),10)][this.objIdxByUid[parseInt(i.toString(),10)][e.uid]]=n,t&&this.parent.getContentTable().querySelector(j).replaceChild(this.rowRenderer.render(n,this.parent.getColumns()),t)},O.prototype.showAndHideCells=function(e,t,i,n,r){var s;e&&(H.setStyleAttribute(e.querySelectorAll(s=n?"td.e-summarycell":"td.e-rowcell")[parseInt(t.toString(),10)],{display:i}),e.querySelectorAll(s)[parseInt(t.toString(),10)].classList.contains("e-hide")&&H.removeClass([e.querySelectorAll(s)[parseInt(t.toString(),10)]],["e-hide"]),n)&&(r.visible&&e.classList.contains("e-hide")?H.removeClass([e],["e-hide"]):r.visible||H.addClass([e],["e-hide"]))},O.prototype.getAllPagesData=function(){for(var e=[],t=Object.keys(this.groupCache),i=0;i<t.length;i++){var n=parseInt(t[parseInt(i.toString(),10)],10),n=this.groupCache[parseInt(n.toString(),10)];n&&n.length&&e.push.apply(e,n.filter(function(e){return e.isDataRow}).map(function(e){return e.data}))}return e};var wm,bm,Im=O;function O(e,t){e=bm.call(this,e,t)||this;return e.childCount=0,e.scrollData=[],e.isFirstChildRow=!1,e.isScrollDown=!1,e.isScrollUp=!1,e.groupCache={},e.cacheRowsObj={},e.startIndexes={},e.captionCounts={},e.rowsByUid={},e.objIdxByUid={},e.initialGroupCaptions={},e.requestType=["paging","columnstate","reorder","cancel","save","beginEdit","add","delete","filterBeforeOpen","filterchoicerequest","infiniteScroll","virtualscroll","columnVisibilityUpdate"],e.scrollTopCache=void 0,e.refRowsObj={},e.cacheMode=!1,e.cacheBlockSize=5,e.ignoreAccent=!!e.parent.allowFiltering&&e.parent.filterSettings.ignoreAccent,e.allowCaseSensitive=!0,e.lazyLoadQuery=[],e.startIndex=0,e.locator=t,e.groupGenerator=new uo(e.parent),e.summaryModelGen=new so(e.parent),e.captionModelGen=new lo(e.parent),e.rowRenderer=new $s(e.locator,null,e.parent),e.eventListener(),e}xm.prototype.getModuleName=function(){return"lazyLoadGroup"},xm.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ft,this.instantiateRenderer,this),this.parent.on(s,this.destroy,this))},xm.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ft,this.instantiateRenderer),this.parent.off(s,this.destroy))},xm.prototype.instantiateRenderer=function(){"auto"===this.parent.height&&(this.parent.height=this.parent.pageSettings.pageSize*this.parent.getRowHeight());var e=this.serviceLocator.getService("rendererFactory"),t=null;this.parent.groupSettings.enableLazyLoading&&(t=new Im(this.parent,this.serviceLocator),e.addRenderer(oe.RenderType.Content,t)),this.parent.enableVirtualization&&(this.parent.lazyLoadRender=t)},xm.prototype.destroy=function(){this.removeEventListener()};var Rm=xm;function xm(e,t){this.parent=e,this.serviceLocator=t,this.addEventListener()}Dm=function(e,t){return(Dm=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};var Dm,Tm=function(e,t){function i(){this.constructor=e}Dm(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Em=(Om.prototype.renderWrapper=function(e){this.wrapper=H.createElement("div",{className:"e-virtualtable e-dom-virtualtable"}),H.updateCSSText(this.wrapper,"min-height: "+H.formatUnit(e)+"; position: absolute;"),this.wrapper.appendChild(this.table),this.content.appendChild(this.wrapper)},Om.prototype.renderPlaceHolder=function(){this.placeholder=H.createElement("div",{className:"e-virtualtrack e-dom-virtualtrack"}),H.updateCSSText(this.placeholder,"position: relative;"),this.content.appendChild(this.placeholder)},Om.prototype.renderVerticalScrollbar=function(){this.verticalScrollbar=H.createElement("div",{className:"e-virtual-vertical-scrollbar e-dom-virtual-vertical-scrollbar"}),this.gridContent.style.position="relative",this.gridContent.appendChild(this.verticalScrollbar),this.verticalScrollerContainer=H.createElement("div",{className:"e-virtual-vertical-track e-dom-virtual-vertical-track"}),this.verticalScrollbar.appendChild(this.verticalScrollerContainer)},Om.prototype.adjustTable=function(e){H.updateCSSText(this.wrapper,"transform: translateY("+e+"px);")},Om.prototype.setVirtualHeight=function(e){H.updateCSSText(this.placeholder,"height: "+(H.isNullOrUndefined(e)?"0px":e+"px")+";")},Om);function Om(){}Tm(A,Am=fo),A.prototype.renderTable=function(){Am.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.gridContent=this.parent.element.querySelector("."+vs),this.virtualEle.content=this.content=this.getPanel().querySelector("."+xs),H.updateCSSText(this.virtualEle.gridContent,"position: relative;"),H.updateCSSText(this.virtualEle.content,"position: relative;"),this.virtualEle.renderWrapper(this.parent.height),this.virtualEle.renderPlaceHolder(),this.parent.isRowDomVirtualization()&&(this.virtualEle.renderVerticalScrollbar(),H.updateCSSText(this.virtualEle.verticalScrollbar,"width: "+(Op()+1)+"px; overflow-x: scroll;")),this.bindScrollEvents()},A.prototype.refreshContentRows=function(e){void 0===e&&(e={});var t=this.parent,i=-1,n=-1;if(t.isRowDomVirtualization()){if(!t.currentViewData||0===t.currentViewData.length)return;e.requestType&&"dom-virtualscroll"!==e.requestType&&(this.expandedDetailRows.clear(),this.rowHeightCache.clear(),this.dynamicHeightSum=0,this.dynamicRowCount=0,this.storedVirtualHeight=0),this.virtualEle.gridContent&&"relative"!==this.virtualEle.gridContent.style.position&&H.updateCSSText(this.virtualEle.gridContent,"position: relative;"),this.virtualEle.content&&"relative"!==this.virtualEle.content.style.position&&H.updateCSSText(this.virtualEle.content,"position: relative;");!!(t.groupSettings&&t.groupSettings.columns&&t.groupSettings.columns.length)?((r=this.generator).buildGroupRowObj(t.currentViewData,e.requestType),this.totalRecords=r.getVisibleGroupRows().length):(this.totalRecords=t.currentViewData.length,this.parent.enableVirtualization&&(this.totalRecords=t.totalDataRecordsCount)),this.parent.frozenRows&&(this.totalRecords-=this.parent.frozenRows),this.initializeRowHeight(),this.setVirtualDimensions();var r=this.getStartIndex(this.currentScrollTop),s=this.getEndIndex(r),o=(this.parent.enableVirtualization?(o=this.getPageFromIndex(r),this.parent.setProperties({pageSettings:{currentPage:o}},!0),o=this.parent.pageSettings.pageSize,o=(this.parent.pageSettings.currentPage-1)*o,this.currentStartIndex=Math.max(r,o)):this.currentStartIndex=r,this.parent.frozenRows),a="dom-virtualscroll"===e.requestType;e.startIndex=r+(a?o:0),e.endIndex=s+(a?o:0),i=this.prevStartIndex=r,n=s}if(this.parent.enableVirtualization&&!t.isInitialLoad&&"dom-virtualscroll"!==e.requestType){r=this.getStartIndex(this.currentScrollTop),s=this.getEndIndex(r),a=this.parent.getCurrentViewRecords().length;if(0<a&&a<s)return void this.checkAndFetchCrossPageData(r)}-1<i&&this.parent.notify(rs,{startIndex:i,endIndex:n}),Am.prototype.refreshContentRows.call(this,e)},A.prototype.appendContent=function(e,t,i,n){Am.prototype.appendContent.call(this,e,t,i,n),this.parent.isRowDomVirtualization()&&(this.isAutoRowHeight()&&this.measureRowHeights(e),this.parent.enableVirtualization&&(this.refreshOffsets(),"dom-virtualscroll"===i.requestType)&&this.parent.removeMaskRow(),this.setVirtualDimensions(),this.virtualEle.adjustTable(this.getRowTopOffset(this.currentStartIndex)),0<=this.pendingSelectIndex&&this.parent.getRowByIndex(this.pendingSelectIndex)&&(t=this.pendingSelectIndex,this.pendingSelectIndex=-1,this.parent.selectRow(t)),this.parent.selectionModule&&this.parent.selectionModule.restoreCellSelection(),this.focusCell(),this.restoreEdit(i))},A.prototype.renderEmpty=function(e){this.getTable().appendChild(e),(this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&(this.parent.getHeaderContent().querySelector(j).innerHTML=""),this.virtualEle.adjustTable(0),this.virtualEle.setVirtualHeight(0),this.virtualEle.verticalScrollerContainer&&H.updateCSSText(this.virtualEle.verticalScrollerContainer,"height: 0px;")},A.prototype.bindScrollEvents=function(){var t=this,e=this.parent.domVirtualizationSettings.scrollThrottle,i="chrome"===H.Browser.info.name?200:100,e=!this.parent.enableVirtualization||!this.parent.isRowDomVirtualization()||i<e?e:i,i={container:this.content,pageHeight:2*this.content.clientHeight,debounceEvent:!1,axes:["Y"],verticalScrollbar:this.virtualEle.verticalScrollbar,scrollThrottle:e},n=(this.observer=new Rg(this.virtualEle.wrapper,i),function(){var e=0<t.storedVirtualHeight?t.storedVirtualHeight:2*t.content.clientHeight;t.observer.setPageHeight(e),window.addEventListener("resize",t.updateScrollbarOnResize.bind(t)),t.observer.observe(function(e){return t.domScrollListener(e)},t.onEntered()),t.parent.off(vt,n)});this.parent.on(vt,n,this)},A.prototype.domScrollListener=function(e){this.preventScroll||this.parent.isRowDomVirtualization()&&0!==this.totalRecords&&(this.currentScrollTop=e.offset.top,this.prevScrollTop=this.currentScrollTop,this.scrollAfterEdit(),(e=this.getStartIndex(this.currentScrollTop))!==this.prevStartIndex)&&(this.parent.enableVirtualization?this.checkAndFetchCrossPageData(e):this.refreshContentRows({requestType:"dom-virtualscroll"}))},A.prototype.checkAndFetchCrossPageData=function(e){var t=this.parent.pageSettings.pageSize,i=this.getEndIndex(e),e=this.getPageFromIndex(e),i=this.getPageFromIndex(Math.max(0,i-1)),n=e<i,r=n?(e-1)*t:-1,n=n?(i-e+1)*t:-1,i=e!==this.parent.pageSettings.currentPage,t=r!==this.pageSkip;(i||t)&&(this.pageSkip=r,this.pageTake=n,this.parent.setProperties({pageSettings:{currentPage:e}},!0),this.previousPage===e&&!t||(this.previousPage=e,this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(),this.parent.addShimmerEffect()),this.parent.notify(bt,{requestType:"dom-virtualscroll"})))},A.prototype.onEntered=function(){var o=this;return function(e,t,i,n){var r,s;o.parent.enableVirtualization&&o.parent.isRowDomVirtualization()&&("down"===i||"up"===i)&&(i=o.parent.pageSettings.pageSize,o.currentScrollTop=n.top,n=o.getStartIndex(o.currentScrollTop),s=o.getEndIndex(n),n=o.getPageFromIndex(n),s=o.getPageFromIndex(Math.max(0,s-1)),r=n!==o.parent.pageSettings.currentPage,s=(n<s?(n-1)*i:-1)!==o.pageSkip,(r||s)&&o.parent.enableVirtualMaskRow?o.parent.showMaskRow():(o.refreshContentRows({requestType:"dom-virtualscroll"}),o.virtualEle.adjustTable(o.getRowTopOffset(o.currentStartIndex))))}},A.prototype.onDataReady=function(e){e&&!H.isNullOrUndefined(e.count)&&(this.count=e.count,this.maxPage=Math.ceil(e.count/this.parent.pageSettings.pageSize));var t=e?e.requestType:void 0;(["refresh","filtering","searching","grouping","ungrouping","reorder"].some(function(e){return e===t})||H.isNullOrUndefined(t))&&(this.previousPage=0,this.pageSkip=-1,this.pageTake=-1,this.refreshOffsets()),this.resetScrollPosition(e.requestType)},A.prototype.setDomVirtualPageQuery=function(e){this.parent.enableVirtualization&&this.parent.isRowDomVirtualization()&&0<=this.pageSkip&&(e.query.skip(this.pageSkip),e.query.take(this.pageTake),e.skipPage=!0)},A.prototype.refreshOffsets=function(){if(this.parent.enableVirtualization&&this.parent.isRowDomVirtualization()){var e=this.parent.pageSettings.pageSize,t=e>>1;if(!(t<=0||this.count<=0)){for(var i=Math.ceil(this.count/t),n=(this.maxPage=Math.ceil(this.count/e),this.offsets={},0<this.rowHeight?this.rowHeight:this.parent.getRowHeight()),r=1;r<=i;r++){var s=(r-1)*t,s=Math.min(r*t,this.count)-s;this.offsets[parseInt(r.toString(),10)]=(this.offsets[parseInt((r-1).toString(),10)]||0)+s*n}this.offsetKeys=Object.keys(this.offsets)}}},A.prototype.getPageFromIndex=function(e){var t;return this.maxPage<=0?1:(t=this.parent.pageSettings.pageSize,Math.max(1,Math.min(Math.floor(e/t)+1,this.maxPage)))},A.prototype.isAutoRowHeight=function(){return!1!==this.parent.domVirtualizationSettings.autoRowHeight},A.prototype.hasRowHeightCallback=function(){return!this.isAutoRowHeight()&&"function"==typeof this.parent.setRowHeight},A.prototype.isDynamicHeight=function(){return this.isAutoRowHeight()||this.hasRowHeightCallback()},A.prototype.measureRowHeights=function(e){for(var t=this.getRows(),i=e.querySelectorAll("tr"),n=0;n<i.length;n++){var r,s,o=i[parseInt(n.toString(),10)].offsetHeight;0<o&&t[parseInt(n.toString(),10)]&&(t[parseInt(n.toString(),10)].rowHeight=o,r=this.currentStartIndex+n,void 0===(s=this.rowHeightCache.get(r))?this.dynamicRowCount++:this.dynamicHeightSum-=s,this.dynamicHeightSum+=o,this.rowHeightCache.set(r,o))}},A.prototype.getAvgRowHeight=function(){return this.isDynamicHeight()&&0<this.dynamicRowCount?Math.ceil(this.dynamicHeightSum/this.dynamicRowCount):this.rowHeight},A.prototype.getDataRowIndexByScrollTop=function(e){if(!this.isDynamicHeight()&&0===this.expandedDetailRows.size)return this.rowHeight<=0?0:Math.min(Math.floor(e/this.rowHeight),Math.max(0,this.totalRecords-1));var t=this.getAvgRowHeight();if(t<=0)return 0;for(var i=0,n=0;n<this.totalRecords;n++){var r=this.rowHeightCache.get(n),r=void 0!==r?r:t;if(e<i+r)return n;i+=r;r=this.expandedDetailRows.get(n);if(void 0!==r){if(e<i+r)return n;i+=r}}return Math.max(0,this.totalRecords-1)},A.prototype.getStartIndex=function(e){var e=this.getDataRowIndexByScrollTop(e),t=this.getBufferRowCount();return Math.max(0,e-t)},A.prototype.getEndIndex=function(e){var t=this.getDataRowIndexByScrollTop(this.currentScrollTop),i=this.getVisibleRowCount(),n=this.getBufferRowCount(),t=Math.min(t+i+n,this.totalRecords),i=this.parent.domVirtualizationSettings.maxPoolSize;return t=i<t-e?e+i:t},A.prototype.getVisibleRowCount=function(){var e,t=this.getAvgRowHeight();return t<=0?20:(e=this.content.clientHeight,Math.ceil(e/t))},A.prototype.getBufferRowCount=function(){return this.parent.domVirtualizationSettings.rowBuffer},A.prototype.initializeRowHeight=function(){this.rowHeight=this.parent.getRowHeight()},A.prototype.setVirtualDimensions=function(){var e,t=0,i=(this.expandedDetailRows.forEach(function(e){t+=e}),e=this.isDynamicHeight()&&0<this.dynamicRowCount?(i=Math.ceil(this.dynamicHeightSum/this.dynamicRowCount),e=Math.max(0,this.totalRecords-this.dynamicRowCount),this.dynamicHeightSum+e*i+t):this.totalRecords*this.rowHeight+t,this.observer&&this.observer.setPageHeight(e),this.storedVirtualHeight);0<i&&e!==i&&0<this.currentScrollTop?(i=this.currentScrollTop/i*e,this.storedVirtualHeight=e,this.virtualEle.setVirtualHeight(e),this.virtualEle.verticalScrollerContainer&&H.updateCSSText(this.virtualEle.verticalScrollerContainer,"height: "+e+"px;"),this.preventScroll=!0,this.content.scrollTop=i,this.virtualEle.verticalScrollbar.scrollTop=i,this.preventScroll=!1,this.currentScrollTop=i,this.prevScrollTop=i):(this.storedVirtualHeight=e,this.virtualEle.setVirtualHeight(e),this.virtualEle.verticalScrollerContainer&&H.updateCSSText(this.virtualEle.verticalScrollerContainer,"height: "+e+"px;")),this.adjustVerticalScrollbarOverflow()},A.prototype.adjustVerticalScrollbarOverflow=function(){var e;this.virtualEle.verticalScrollbar&&this.content&&(e=this.content.scrollWidth>this.content.clientWidth,H.updateCSSText(this.virtualEle.verticalScrollbar,"overflow-x: "+(e?"scroll":"hidden")+";"))},A.prototype.updateScrollbarOnResize=function(){!this.parent.isRowDomVirtualization()||H.isNullOrUndefined(this.virtualEle.verticalScrollbar)||H.isNullOrUndefined(this.content)||(H.updateCSSText(this.virtualEle.verticalScrollbar,"width: "+(Op(!0)+1)+"px;"),this.adjustVerticalScrollbarOverflow())},A.prototype.getRowTopOffset=function(e){if(e<=0)return 0;if(!this.isDynamicHeight()&&0===this.expandedDetailRows.size)return e*this.rowHeight;for(var t=this.getAvgRowHeight(),i=0,n=0;n<e;n++){var r=this.rowHeightCache.get(n),r=(i+=void 0!==r?r:t,this.expandedDetailRows.get(n));void 0!==r&&(i+=r)}return i},A.prototype.updateDetailRowHeight=function(e,t,i){t?this.expandedDetailRows.set(e,void 0!==i?i:500):this.expandedDetailRows.delete(e),this.initializeRowHeight(),this.parent.isRowDomVirtualization()&&this.setVirtualDimensions()},A.prototype.clearExpandedDetailRows=function(){this.expandedDetailRows.clear(),this.rowHeightCache.clear(),this.dynamicHeightSum=0,this.dynamicRowCount=0,this.storedVirtualHeight=0},A.prototype.removeEventListeners=function(){window.removeEventListener("resize",this.updateScrollbarOnResize.bind(this)),this.observer=null},A.prototype.destroy=function(){this.removeEventListeners()},A.prototype.domVirtualCellFocus=function(e){var t,i,n,r,s,o;e&&e.action&&(("enter"===e.action||"shiftEnter"===e.action)&&this.parent.editSettings&&"Cell"===this.parent.editSettings.mode||((s=document.activeElement)&&!s.classList.contains(b)&&(s instanceof HTMLInputElement||!H.isNullOrUndefined(s.closest(".e-templatecell")))&&(s=s.closest(".e-rowcell")),this.parent.allowGrouping&&this.parent.groupSettings&&this.parent.groupSettings.columns.length&&s&&(s.classList.contains(b)||!H.isNullOrUndefined(I(s,Fs)))&&e&&("shiftEnter"===e.action||"upArrow"===e.action||"downArrow"===e.action)?(t=(o=this.parent.getContent().firstElementChild).getBoundingClientRect(),n=H.closest(s,"tr"),i=(r="downArrow"===e.action?n.nextElementSibling:n.previousElementSibling)?r.getBoundingClientRect():void 0,H.isNullOrUndefined(r)||"downArrow"===e.action&&i&&i.bottom>t.bottom||("upArrow"===e.action||"shiftEnter"===e.action)&&i&&i.top<t.top?(this.activeKey=e.action,this.parent.focusModule&&(this.parent.focusModule.virtualSelectionInfo={isPending:H.isNullOrUndefined(r),direction:e.action,event:e}),r=H.isNullOrUndefined(r)||!i?this.parent.getRowHeight?this.parent.getRowHeight():0:"downArrow"===e.action?i.bottom-t.bottom:t.top-i.top,o.scrollTop="downArrow"===e.action?o.scrollTop+r:o.scrollTop-r):this.activeKey=""):s&&s.classList.contains(b)&&("tab"===e.action||"shiftTab"===e.action)?this.scrollForTabFocus(s,e.action):s&&s.classList.contains(b)&&e&&("upArrow"===e.action||"downArrow"===e.action||"shiftEnter"===e.action||"enter"===e.action)&&(t=parseInt(s.parentElement.getAttribute(D),10)-1,i=this.parent.getContent().firstElementChild,"downArrow"===e.action||"enter"===e.action?t+=1:--t,t<0||t>=this.totalRecords||(this.rowIndex=t,this.cellIndex=parseInt(s.getAttribute(zs),10)-1,n=this.parent.getRowByIndex(t),this.parent.isTreeGrid&&(o=this.parent.focusModule.getContent().matrix.current,r=this.parent.getContentTable(),s="downArrow"===e.action||"enter"===e.action?o[0]+1:o[0]-1,n=r.rows.item(s)),o=Math.floor(i.offsetHeight/this.parent.getRowHeight())-1,H.isNullOrUndefined(n)||mc(n,this.parent)&&("downArrow"===e.action||"enter"===e.action)||yc(n,2*this.parent.getRowHeight(),this.parent)&&("upArrow"===e.action||"shiftEnter"===e.action)?(this.activeKey=e.action,i.scrollTop="downArrow"===e.action||"enter"===e.action?Math.max(0,this.getRowTopOffset(t-o)):this.getRowTopOffset(t),this.virtualEle.verticalScrollbar&&(this.virtualEle.verticalScrollbar.scrollTop=i.scrollTop)):this.activeKey=""))))},A.prototype.domVirtualTabFocus=function(e){e.isHandled=this.scrollForTabFocus(document.activeElement,e.action)},A.prototype.scrollForTabFocus=function(e,t){var i=this.parent.groupSettings&&0<this.parent.groupSettings.columns.length;if(this.parent.isEdit||i||!e||!e.classList.contains(b))return!1;var i=e.parentElement,n="tab"===t,r=[].slice.call(i.getElementsByClassName(b)),s=r.filter(function(e){return!e.classList.contains("e-hide")});if(!s.length||e!==s[n?s.length-1:0])return!1;e=parseInt(i.getAttribute(D),10)-1+(n?1:-1);if(isNaN(e)||e<0||e>=this.totalRecords)return!1;i=this.parent.getRowByIndex(e);if(i&&!(n?mc(i,this.parent):yc(i,2*this.parent.getRowHeight(),this.parent)))return!1;this.rowIndex=e,this.cellIndex=r.indexOf(s[n?0:s.length-1]),this.activeKey=t;i=this.parent.getContent().firstElementChild,r=Math.floor(i.offsetHeight/this.parent.getRowHeight())-1;return i.scrollTop=n?Math.max(0,this.getRowTopOffset(e-r)):this.getRowTopOffset(e),this.virtualEle.verticalScrollbar&&(this.virtualEle.verticalScrollbar.scrollTop=i.scrollTop),!0},A.prototype.focusCell=function(){var e,t,i,n;this.activeKey&&(e=this.parent.getRowByIndex(this.rowIndex))&&(t=e.getElementsByClassName(b)[parseInt(this.cellIndex.toString(),10)],i="tab"===this.activeKey||"shiftTab"===this.activeKey,t&&(i?this.parent.focusModule.domVirtualFocusCell=t:t.focus({preventScroll:!0})),!this.parent.selectionSettings||this.parent.selectionSettings.checkboxOnly||i||this.parent.selectRow(parseInt(e.getAttribute(D),10)-1),n=this.parent.selectionSettings?this.parent.selectionSettings.mode:"",!t||i||"Cell"!==n&&"Both"!==n||!this.parent.selectionModule||t.classList.contains("e-cellselectionbackground")||this.parent.selectionModule.selectCell({rowIndex:parseInt(e.getAttribute(D),10)-1,cellIndex:parseInt(t.getAttribute(zs),10)-1},!0),this.activeKey="")},A.prototype.resetVirtualFocus=function(e){this.isCancel=e.isCancel},A.prototype.onGroupExpandCollapse=function(){this.parent&&this.parent.groupSettings&&this.parent.groupSettings.columns.length&&(this.parent.isRowDomVirtualization()&&this.setVirtualDimensions(),this.refreshContentRows({requestType:"dom-virtualscroll"}))},A.prototype.onApplyDomVirtualRowHeight=function(e){var t,i;this.hasRowHeightCallback()&&0<(t=(0,this.parent.setRowHeight)(e.row))&&(e.row.rowHeight=t,e=e.row.index,void 0===(i=this.rowHeightCache.get(e))?this.dynamicRowCount++:this.dynamicHeightSum-=i,this.dynamicHeightSum+=t,this.rowHeightCache.set(e,t))},A.prototype.selectVirtualRow=function(e){var t;e.isAvailable=0<=e.selectedIndex&&e.selectedIndex<this.totalRecords,e.isAvailable&&!this.parent.getRowByIndex(e.selectedIndex)&&this.parent.isRowDomVirtualization()&&this.virtualEle.verticalScrollbar&&(t=this.getRowTopOffset(e.selectedIndex),this.pendingSelectIndex=e.selectedIndex,this.virtualEle.verticalScrollbar.scrollTop=t)},A.prototype.scrollAfterEdit=function(){var e,t;this.parent.editModule&&this.parent.editSettings.allowEditing&&this.isNormaledit&&this.parent.element.querySelector(".e-gridform")&&(t=this.parent.element.querySelector("."+Os),e=this.parent.element.querySelector("."+As),t||e)&&(e=t?H.extend({},this.parent.getCurrentViewRecords()[this.editedRowIndex]):H.extend({},this.emptyRowData),t=Object.keys(this.virtualData),this.virtualData=t.length?this.getVirtualEditedData(this.virtualData):this.getVirtualEditedData(e))},A.prototype.restoreEdit=function(e){var t,i,n;this.isNormaledit&&(this.parent.editSettings.allowEditing&&this.parent.editModule&&!H.isNullOrUndefined(this.editedRowIndex)&&(t=this.parent.getRowByIndex(this.editedRowIndex),n=this.content,(i=Object.keys(this.virtualData)).length&&t&&!n.querySelector("."+Os)&&-1===["sorting","filtering","grouping","refresh","searching","ungrouping","reorder"].indexOf(e?e.requestType:null)&&(n=t.getBoundingClientRect().top-this.parent.element.getBoundingClientRect().top)<this.content.offsetHeight&&n>this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(t)),t)&&this.content.querySelector("."+Os)&&!i.length&&(e=H.extend({},this.parent.getCurrentViewRecords()[this.editedRowIndex]),this.virtualData=this.getVirtualEditedData(e)),this.restoreAdd())},A.prototype.restoreAdd=function(){var e,t=!this.parent.element.querySelector("."+As);this.isNormaledit&&this.isAdd&&t&&(t="Top"===this.parent.editSettings.newRowPosition&&this.content.scrollTop<this.parent.getRowHeight(),e="Bottom"===this.parent.editSettings.newRowPosition&&(this.parent.enableVirtualization?this.parent.pageSettings.currentPage===this.maxPage:this.content.scrollTop>=this.getRowTopOffset(Math.max(0,this.totalRecords-1))),t||e)&&(this.parent.isEdit=!1,this.parent.addRecord())},A.prototype.editActionBegin=function(e){this.editedRowIndex=e.index;var t=e.index,i=(this.parent.enableVirtualization&&(n=Number(this.parent.pageSettings.pageSize),i=Number(this.parent.pageSettings.currentPage),t=e.index-(i-1)*n),H.extend({},this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)])),n=Object.keys(this.virtualData);e.data=n.length&&!this.parent.editSettings.showAddNewRow?this.virtualData:i,e.isScroll=!1},A.prototype.addActionBegin=function(e){var t;this.isNormaledit&&(Object.keys(this.emptyRowData).length||this.createEmptyRowdata(),this.isAdd=!0,!this.parent.frozenRows&&0<this.content.scrollTop&&"Top"===this.parent.editSettings.newRowPosition&&(this.isAdd=!0,e.startEdit=!1,this.content.scrollTop=0),"Bottom"===this.parent.editSettings.newRowPosition)&&0<this.totalRecords&&(t=this.getRowTopOffset(this.totalRecords),this.content.scrollTop<t-this.content.clientHeight)&&(this.isAdd=!0,e.startEdit=!1,this.content.scrollTop=t)},A.prototype.getVirtualEditedData=function(e){var t=[].slice.call(this.parent.element.getElementsByClassName("e-gridform"));if(!(this.parent.editModule&&this.parent.editModule.formObj&&this.parent.editModule.formObj.isDestroyed))for(var i=0;i<t.length;i++)e=this.parent.editModule.getCurrentEditedData(t[parseInt(i.toString(),10)],e);return e},A.prototype.getVirtualData=function(e){var t,i;this.isNormaledit&&(t=this.parent.element.querySelector('.e-griderror:not([style*="display: none"])'),i=Object.keys(this.virtualData),e.isScroll=!1,t||(this.virtualData=(i.length?this:e).virtualData,this.getVirtualEditedData(this.virtualData),e.virtualData=this.virtualData,e.isAdd=this.isAdd||this.parent.editSettings.showAddNewRow,e.isCancel=this.isCancel))},A.prototype.getVirtualRowIndex=function(e){return this.getStartIndex(this.currentScrollTop)+e},A.prototype.editCancel=function(e){var t=Sc(this.parent,e.data);H.isNullOrUndefined(t)||(e.data=this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)])},A.prototype.editSuccess=function(e){this.isNormaledit&&(!this.isAdd&&e&&e.data&&this.updateCurrentViewData(e.data),this.isAdd=!1)},A.prototype.updateCurrentViewData=function(e){var t=Sc(this.parent,e);H.isNullOrUndefined(t)||(this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)]=e)},A.prototype.createEmptyRowdata=function(){var t=this;(this.parent.columnModel||[]).forEach(function(e){t.emptyRowData[e.field]=void 0})},A.prototype.resetIsedit=function(){this.parent.isRowDomVirtualization()&&this.isNormaledit&&(this.parent.editSettings.allowEditing&&Object.keys(this.virtualData).length||this.parent.editSettings.allowAdding&&this.isAdd)&&(this.parent.isEdit=!0)},A.prototype.resetScrollPosition=function(t){this.actions.some(function(e){return e===t})&&(this.content.scrollTop=0)},A.prototype.actionComplete=function(t){this.parent.isRowDomVirtualization()&&this.isNormaledit&&(["sorting","filtering","grouping","refresh","searching","ungrouping","reorder"].some(function(e){return e===t.requestType})||["delete","save","cancel"].some(function(e){return e===t.requestType}))&&(this.isCancel=!0,this.isAdd=this.parent.editSettings.showAddNewRow,this.editedRowIndex=void 0,this.virtualData={},this.parent.editModule)&&(this.parent.editModule.editModule.previousData=void 0)},A.prototype.actionBegin=function(e){e.cancel&&"beginEdit"===e.requestType&&(this.virtualData={})};var Am,Fm=A;function A(e,t){e=Am.call(this,e,t)||this;return e.virtualEle=new Em,e.totalRecords=0,e.rowHeight=e.parent.getRowHeight(),e.currentScrollTop=0,e.prevScrollTop=-1,e.prevStartIndex=-1,e.currentStartIndex=0,e.preventScroll=!1,e.expandedDetailRows=new Map,e.pendingSelectIndex=-1,e.storedVirtualHeight=0,e.rowHeightCache=new Map,e.dynamicHeightSum=0,e.dynamicRowCount=0,e.activeKey="",e.rowIndex=0,e.cellIndex=0,e.isCancel=!1,e.offsets={},e.offsetKeys=[],e.actions=["filtering","searching","grouping","ungrouping"],e.count=0,e.maxPage=0,e.previousPage=0,e.pageSkip=-1,e.pageTake=-1,e.isNormaledit="Normal"===e.parent.editSettings.mode,e.editedRowIndex=void 0,e.isAdd=!1,e.virtualData={},e.emptyRowData={},e.locator=t,e.widthServices=t.getService("widthService"),e.parent.isRowDomVirtualization()&&(e.parent.on(un,e.selectVirtualRow,e),e.parent.on(Rn,e.domVirtualCellFocus,e),e.parent.on(xn,e.domVirtualTabFocus,e),e.parent.on(Or,e.resetVirtualFocus,e)),e.parent.on(ns,e.onApplyDomVirtualRowHeight,e),e.parent.on(Cr,e.onGroupExpandCollapse,e),e.parent.on(yt,e.onDataReady,e),e.parent.on(Rr,e.setDomVirtualPageQuery,e),e.parent.on(Dn,e.editActionBegin,e),e.parent.on(Mn,e.addActionBegin,e),e.parent.on(On,e.restoreEdit,e),e.parent.on(Tn,e.editSuccess,e),e.parent.on(Fn,e.resetIsedit,e),e.parent.on(kn,e.getVirtualData,e),e.parent.on(En,e.editCancel,e),e.boundActionComplete=e.actionComplete.bind(e),e.boundActionBegin=e.actionBegin.bind(e),e.parent.addEventListener(c,e.boundActionComplete),e.parent.addEventListener(y,e.boundActionBegin),e}Mm.prototype.getModuleName=function(){return"domVirtualization"},Mm.prototype.instantiateRenderer=function(){this.locator.getService("rendererFactory").addRenderer(oe.RenderType.Content,new Fm(this.parent,this.locator))},Mm.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ft,this.instantiateRenderer,this),this.parent.on(s,this.destroy,this))},Mm.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ft,this.instantiateRenderer),this.parent.off(s,this.destroy))},Mm.prototype.destroy=function(){this.removeEventListener(),this.parent.contentModule&&this.parent.contentModule.destroy&&this.parent.contentModule.destroy()};Tm=Mm;function Mm(e,t){this.parent=e,this.locator=t,this.addEventListener()}var km=function(){return(km=Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++)for(var r in t=arguments[i])Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e}).apply(this,arguments)},Pm=function(s,o,a,l){return new(a=a||Promise)(function(e,t){function i(e){try{r(l.next(e))}catch(e){t(e)}}function n(e){try{r(l.throw(e))}catch(e){t(e)}}function r(t){t.done?e(t.value):new a(function(e){e(t.value)}).then(i,n)}r((l=l.apply(s,o||[])).next())})},Lm=function(n,r){var s,o,a,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]},e={next:t(0),throw:t(1),return:t(2)};return"function"==typeof Symbol&&(e[Symbol.iterator]=function(){return this}),e;function t(i){return function(e){var t=[i,e];if(s)throw new TypeError("Generator is already executing.");for(;l;)try{if(s=1,o&&(a=2&t[0]?o.return:t[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,t[1])).done)return a;switch(o=0,(t=a?[2&t[0],a.value]:t)[0]){case 0:case 1:a=t;break;case 4:return l.label++,{value:t[1],done:!1};case 5:l.label++,o=t[1],t=[0];continue;case 7:t=l.ops.pop(),l.trys.pop();continue;default:if(!(a=0<(a=l.trys).length&&a[a.length-1])&&(6===t[0]||2===t[0])){l=0;continue}if(3===t[0]&&(!a||t[1]>a[0]&&t[1]<a[3]))l.label=t[1];else if(6===t[0]&&l.label<a[1])l.label=a[1],a=t;else{if(!(a&&l.label<a[2])){a[2]&&l.ops.pop(),l.trys.pop();continue}l.label=a[2],l.ops.push(t)}}t=r.call(n,l)}catch(e){t=[6,e],o=0}finally{s=a=0}if(5&t[0])throw t[1];return{value:t[0]?t[1]:void 0,done:!0}}}},Nm="getWebMcpTools",Bm="registerWebMcpTools",zm="beforeWebMcpToolExecute",qm=[{name:"getSelectedRecords",description:"Returns the selected Grid records.",annotations:{readOnlyHint:!0},inputSchema:{type:"object",properties:{},required:[]},outputSchema:{type:"object",properties:{selectedRecords:{type:"array"}},required:["selectedRecords"]}},{name:"getSelectedRowIndexes",description:"Returns the selected row indexes from the Grid.",annotations:{readOnlyHint:!0},inputSchema:{type:"object",properties:{},required:[]},outputSchema:{type:"object",properties:{selectedRowIndexes:{type:"array"}},required:["selectedRowIndexes"]}},{name:"navigateToPage",description:"Navigates the Grid to a specific page.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{pageNo:{type:"number"},waitForCompletion:{type:"boolean"}},required:["pageNo"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"sortByColumn",description:"Sorts the Grid by a column.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{columnName:{type:"string"},direction:{type:"string"},isMultiSort:{type:"boolean"},waitForCompletion:{type:"boolean"}},required:["columnName","direction"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"clearSorting",description:"Clears sorting from the Grid.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{},required:[]},outputSchema:{type:"object",properties:{},required:[]}},{name:"filterByColumn",description:"Applies a filter to a Grid column.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{fieldName:{type:"string"},filterOperator:{type:"string"},filterValue:{},predicate:{type:"string"},matchCase:{type:"boolean"},ignoreAccent:{type:"boolean"},waitForCompletion:{type:"boolean"}},required:["fieldName","filterOperator","filterValue"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"clearFiltering",description:"Clears filtering from the Grid.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{},required:[]},outputSchema:{type:"object",properties:{},required:[]}},{name:"setRowData",description:"Sets row data by key.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{key:{},rowData:{type:"object"},waitForCompletion:{type:"boolean"},delay:{type:"number"}},required:["key"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"setCellValue",description:"Updates a single Grid cell value.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{key:{},field:{type:"string"},value:{}},required:["key","field","value"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"saveBulkChanges",description:"Persists a set of edited Grid rows.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{changedData:{type:"object"},rowData:{type:"array"},waitForCompletion:{type:"boolean"}},required:["changedData"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"changeDataSource",description:"Replaces or updates the Grid data source.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{dataSource:{},columns:{},properties:{type:"object"}},required:[]},outputSchema:{type:"object",properties:{},required:[]}},{name:"getCurrentViewRecords",description:"Returns the current visible Grid records.",annotations:{readOnlyHint:!0},inputSchema:{type:"object",properties:{},required:[]},outputSchema:{type:"object",properties:{currentViewRecords:{type:"array"}},required:["currentViewRecords"]}},{name:"getFilteredRecords",description:"Returns records that match current Grid filters.",annotations:{readOnlyHint:!0},inputSchema:{type:"object",properties:{waitForPromise:{type:"boolean"}},required:[]},outputSchema:{type:"object",properties:{filteredRecords:{type:"array"}},required:["filteredRecords"]}},{name:"selection",description:"Performs common Grid selection operations.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{mode:{type:"string",enum:["selectRows","selectRow","selectCells"]},indexes:{type:"array",items:{type:"number"},description:"Row indexes for selectRows."},index:{type:"number",description:"Row index for selectRow."},cellIndexes:{type:"array",description:"Cell indexes for selectCells."}},required:["mode"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"selectRowByRange",description:"Selects row(s) within a range.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{startIndex:{type:"number"},endIndex:{type:"number"},waitForCompletion:{type:"boolean"}},required:["startIndex"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"clearSelection",description:"Clears all Grid selection.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{},required:[]},outputSchema:{type:"object",properties:{},required:[]}},{name:"exports",description:"Exports Grid data to a file format.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{exportType:{type:"string",enum:["excel","csv","pdf"]},exportOptions:{type:"object",description:"Export properties (ExcelExportProperties, CsvExportProperties, or PdfExportProperties)."},waitForCompletion:{type:"boolean"}},required:["exportType"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"crudLifecycle",description:"Performs common CRUD or edit lifecycle operations.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{mode:{type:"string",enum:["startEdit","endEdit","closeEdit","addRecord","deleteRecord"]},data:{type:"object",description:"Record for addRecord/deleteRecord."},index:{type:"number",description:"Row index for addRecord."},fieldname:{type:"string",description:"Field name for deleteRecord."}},required:["mode"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"layoutContent",description:"Controls Grid layout and content utilities.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{mode:{type:"string",enum:["refresh","refreshColumns","showSpinner","hideSpinner"]},elementId:{type:"string"},dialogOptions:{type:"object"}},required:["mode"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"columnVisibility",description:"Shows or hides Grid columns and opens the chooser.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{mode:{type:"string",enum:["showColumns","hideColumns","openColumnChooser"]},keys:{type:"array",items:{type:"string"},description:"Column keys (field names or header text)."},showBy:{type:"string",description:"Field key or header text key identifier."},hideBy:{type:"string",description:"Field key or header text key identifier."}},required:["mode"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"selectionRangeHelpers",description:"Provides selection range helpers and selection clearing.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{mode:{type:"string",enum:["clearCellSelection","clearRowSelection"]},startIndex:{},endIndex:{},waitForCompletion:{type:"boolean"}},required:["mode"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"refreshAndSizing",description:"Refreshes Grid content and applies sizing operations.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{fieldNames:{type:"array",items:{type:"string"},description:"Column fields to auto-fit."},startRowIndex:{type:"number"},endRowIndex:{type:"number"},mode:{type:"string",enum:["autoFitColumns","refresh","refreshHeader"]}},required:["mode"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"reorderData",description:"Reorders Grid columns or rows.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{mode:{type:"string",enum:["reorderColumns","reorderColumnByIndex","reorderRows"]},fromIndex:{type:"number"},toIndex:{type:"number"},fromFName:{type:"string",description:"Origin field name."},toFName:{type:"string",description:"Destination field name."},fromIndexes:{type:"array",items:{type:"number"},description:"Origin row indexes for reorderRows."}},required:["mode"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"groupingAndPinning",description:"Groups or ungroups data, handles detail rows, and pins rows.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{mode:{type:"string",enum:["groupColumn","ungroupColumn","clearGrouping","groupExpandAll","groupCollapseAll","pinRows","unpinRows"]},columnName:{type:"string"},data:{type:"array",description:"Records to pin or unpin."}},required:["mode"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"batchChanges",description:"Reads or applies Grid batch changes.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{mode:{type:"string",enum:["getBatchChanges","batchSave","saveBatchChanges"]},changes:{type:"object",description:"Field-value pairs to save in bulk."},waitForCompletion:{type:"boolean"}},required:["mode"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"configurationHelpers",description:"Exposes configuration and helper getters for the Grid.",annotations:{readOnlyHint:!0},inputSchema:{type:"object",properties:{mode:{type:"string",enum:["getColumns","getColumnByField","getColumnByUid","getPrimaryKeyFieldNames","getColumnFieldNames","getVisibleColumns"]},field:{type:"string"},uid:{type:"string"}},required:["mode"]},outputSchema:{type:"object",properties:{},required:[]}},{name:"toolbarClipboardUtilities",description:"Enables toolbar items and supports copy or print utilities.",annotations:{readOnlyHint:!1},inputSchema:{type:"object",properties:{mode:{type:"string",enum:["enableToolbarItems","copy","print"]},items:{type:"array",items:{type:"string"}},isEnable:{type:"boolean"},withHeader:{type:"boolean"}},required:["mode"]},outputSchema:{type:"object",properties:{},required:[]}}],Um=(Hm.prototype.addEventListener=function(){this.parent.on(Nm,this.getTools,this),this.parent.on(Bm,this.registerTools,this),this.parent.on(zm,this.executeHandler,this)},Hm.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Nm,this.getTools),this.parent.off(Bm,this.registerTools),this.parent.off(zm,this.executeHandler))},Hm.prototype.getTools=function(e){var t=e.toolNames||[];return 0!==t.length?e.tools=qm.filter(function(e){return-1!==t.indexOf(e.name)}).map(function(e){return km({},e)}):e.tools=qm.map(function(e){return km({},e)}),e.tools},Hm.prototype.registerTools=function(i){var n,r=this,s=document.modelContext;s&&"function"==typeof s.registerTool&&(this.webMcpAbortController=new AbortController,n=H.isNullOrUndefined(i.prefix)?this.parent.element.id:i.prefix,(i.tools&&i.tools.length&&"object"==typeof i.tools[0]?i.tools:this.getTools({toolNames:i.tools})).forEach(function(t){t.name=n+"_"+t.name,t.execute=t.execute||function(e){return r.executeHandler(t.name,e||{})};var e={signal:r.webMcpAbortController.signal};Array.isArray(i.exposedTo)&&0<i.exposedTo.length&&(e.exposedTo=i.exposedTo),s.registerTool(t,e)}))},Hm.prototype.executeHandler=function(E,O){return Pm(this,void 0,void 0,function(){var t,i,n,r,s,o,a,l,h,d,p,c,u,g,f,m,y,v,S,C,w,b,I,R,x,D,T;return Lm(this,function(e){switch(e.label){case 0:return(e.trys.push([0,63,,64]),t=E.includes("_")?E.substring(E.indexOf("_")+1):E,p=qm.find(function(e){return e.name===t}),i={toolName:E,toolArgs:O},this.parent.trigger(zm,i),i.cancel)?[2,this.message({action:t,cancelled:!0,message:i.cancellationResponse||'[USER_CANCELLED] Tool "'+t+'" was cancelled. This is final. Do NOT retry.'})]:!(!p||!p.annotations.readOnlyHint)||!i.showConfirmationDialog?[3,2]:(n=this.buildConfirmationMessage(t,O),[4,this.requestConfirmation(t,O,n)]);case 1:if(!e.sent())return[2,this.message({action:t,cancelled:!0,message:i.cancellationResponse||'[USER_CANCELLED] User denied: "'+n+'". This is final. Do NOT retry.'})];e.label=2;case 2:switch(t){case"getSelectedRecords":return[3,3];case"getSelectedRowIndexes":return[3,4];case"navigateToPage":return[3,5];case"sortByColumn":return[3,9];case"clearSorting":return[3,13];case"filterByColumn":return[3,17];case"clearFiltering":return[3,25];case"setRowData":return[3,29];case"setCellValue":return[3,33];case"saveBulkChanges":return[3,34];case"changeDataSource":return[3,35];case"getCurrentViewRecords":return[3,36];case"getFilteredRecords":return[3,37];case"selection":return[3,41];case"selectRowByRange":return[3,42];case"clearSelection":return[3,43];case"exports":return[3,44];case"crudLifecycle":return[3,51];case"layoutContent":return[3,52];case"columnVisibility":return[3,53];case"selectionRangeHelpers":return[3,54];case"refreshAndSizing":return[3,55];case"reorderData":return[3,56];case"groupingAndPinning":return[3,57];case"batchChanges":return[3,58];case"configurationHelpers":return[3,59];case"toolbarClipboardUtilities":return[3,60]}return[3,61];case 3:return[2,this.message({selectedRecords:this.parent.getSelectedRecords?this.parent.getSelectedRecords():[]})];case 4:return[2,this.message({selectedRowIndexes:this.parent.getSelectedRowIndexes?this.parent.getSelectedRowIndexes():[]})];case 5:return O.waitForCompletion?[4,this.parent.goToPageAsync(O.pageNo||1)]:[3,7];case 6:return e.sent(),[3,8];case 7:this.parent.goToPage(O.pageNo||1),e.label=8;case 8:return[2,this.message({pageNo:O.pageNo||1})];case 9:return(r=O.direction||"Ascending",s=!!O.isMultiSort,O.waitForCompletion)?[4,this.parent.sortColumnAsync(O.columnName,r,s)]:[3,11];case 10:return e.sent(),[3,12];case 11:this.parent.sortColumn(O.columnName,r,s),e.label=12;case 12:return[2,this.message({sortedBy:O.columnName,direction:r})];case 13:return O.waitForCompletion?[4,this.parent.clearSortingAsync()]:[3,15];case 14:return e.sent(),[3,16];case 15:this.parent.clearSorting(),e.label=16;case 16:return[2,this.message({sortingCleared:!0})];case 17:return(o=!!O.matchCase,a=!!O.ignoreAccent,l=O.predicate||"and",Array.isArray(O.filterValue))?(h=O.filterValue,O.waitForCompletion?[4,this.parent.filterByColumnAsync(O.fieldName,O.filterOperator,h,l,o,a)]:[3,19]):[3,21];case 18:return e.sent(),[3,20];case 19:this.parent.filterByColumn(O.fieldName,O.filterOperator,h,l,o,a),e.label=20;case 20:return[3,24];case 21:return O.waitForCompletion?[4,this.parent.filterByColumnAsync(O.fieldName,O.filterOperator,O.filterValue,l,o,a)]:[3,23];case 22:return e.sent(),[3,24];case 23:this.parent.filterByColumn(O.fieldName,O.filterOperator,O.filterValue,l,o,a),e.label=24;case 24:return[2,this.message({filteredBy:O.fieldName})];case 25:return O.waitForCompletion?[4,this.parent.clearFilteringAsync(O.fields)]:[3,27];case 26:return e.sent(),[3,28];case 27:this.parent.clearFiltering(O.fields),e.label=28;case 28:return[2,this.message({filteringCleared:!0})];case 29:return O.waitForCompletion?[4,this.parent.setRowDataAsync(O.key,O.rowData,O.delay)]:[3,31];case 30:return e.sent(),[3,32];case 31:this.parent.setRowData(O.key,O.rowData),e.label=32;case 32:return[2,this.message({rowDataUpdated:!0,key:O.key})];case 33:return this.parent.setCellValue(O.key,O.field,O.value),[2,this.message({cellValueUpdated:!0,key:O.key,field:O.field})];case 34:return this.parent.saveBulkChanges(O.changedData,O.rowData),[2,this.message({bulkChangesSaved:!0})];case 35:return this.parent.changeDataSource(O.dataSource,O.columns,O.properties),[2,this.message({dataSourceChanged:!0})];case 36:return[2,this.message({currentViewRecords:this.parent.getCurrentViewRecords()})];case 37:return(d=this.parent.getFilteredRecords())instanceof Promise&&O.waitForPromise?[4,d]:[3,39];case 38:return c=e.sent(),[3,40];case 39:c=d,e.label=40;case 40:return p=c,[2,this.message({filteredRecords:p})];case 41:switch((u=O).mode){case"selectRows":this.parent.selectRows(u.indexes);break;case"selectRow":this.parent.selectRow(u.index);break;case"selectCells":this.parent.selectCells(u.cellIndexes);break;default:return[2,this.error('Unknown selection mode: "'+u.mode+'"')]}return[2,this.message({})];case 42:return this.parent.selectRowsByRange(O.startIndex,O.endIndex),[2,this.message({selectedRange:O.startIndex+"-"+O.endIndex})];case 43:return this.parent.clearSelection(),[2,this.message({selectionCleared:!0})];case 44:return g=O.exportType.toLowerCase(),f=O.exportOptions,"excel"!==g?[3,46]:[4,this.parent.excelExport(f)];case 45:return m=e.sent(),[2,this.message({exportResult:m})];case 46:return"csv"!==g?[3,48]:[4,this.parent.csvExport(f)];case 47:return m=e.sent(),[2,this.message({exportResult:m})];case 48:return"pdf"!==g?[3,50]:[4,this.parent.pdfExport(f)];case 49:return m=e.sent(),[2,this.message({exportResult:m})];case 50:return[2,this.error('Unknown export type: "'+g+'"')];case 51:switch((y=O).mode){case"startEdit":this.parent.startEdit();break;case"endEdit":this.parent.endEdit();break;case"closeEdit":this.parent.closeEdit();break;case"addRecord":this.parent.addRecord(y.data,y.index);break;case"deleteRecord":this.parent.deleteRecord(y.fieldname,y.data);break;default:return[2,this.error('Unknown CRUD lifecycle mode: "'+y.mode+'"')]}return[2,this.message({})];case 52:switch((v=O).mode){case"refresh":this.parent.refresh();break;case"refreshColumns":this.parent.refreshColumns();break;case"showSpinner":this.parent.showSpinner();break;case"hideSpinner":this.parent.hideSpinner();break;default:return[2,this.error('Unknown layout mode: "'+v.mode+'"')]}return[2,this.message({})];case 53:switch((S=O).mode){case"showColumns":this.parent.showColumns(S.keys,S.showBy);break;case"hideColumns":this.parent.hideColumns(S.keys,S.hideBy);break;case"openColumnChooser":this.parent.openColumnChooser(0,0);break;default:return[2,this.error('Unknown column visibility mode: "'+S.mode+'"')]}return[2,this.message({})];case 54:switch((C=O).mode){case"clearCellSelection":this.parent.clearCellSelection();break;case"clearRowSelection":this.parent.clearRowSelection();break;default:return[2,this.error('Unknown selection range mode: "'+C.mode+'"')]}return[2,this.message({})];case 55:switch((w=O).mode){case"autoFitColumns":this.parent.autoFitColumns(w.fieldNames,w.startRowIndex,w.endRowIndex);break;case"refresh":this.parent.refresh();break;case"refreshHeader":this.parent.refreshHeader();break;default:return[2,this.error('Unknown refresh/sizing mode: "'+w.mode+'"')]}return[2,this.message({})];case 56:switch((b=O).mode){case"reorderColumns":this.parent.reorderColumns(b.fromFName,b.toFName);break;case"reorderColumnByIndex":this.parent.reorderColumnByIndex(b.fromIndex,b.toIndex);break;case"reorderRows":this.parent.reorderRows(b.fromIndexes,b.toIndex);break;default:return[2,this.error('Unknown reorder mode: "'+b.mode+'"')]}return[2,this.message({})];case 57:switch((I=O).mode){case"groupColumn":this.parent.groupColumn(I.columnName);break;case"ungroupColumn":this.parent.ungroupColumn(I.columnName);break;case"clearGrouping":this.parent.clearGrouping();break;case"groupExpandAll":this.parent.groupExpandAll();break;case"groupCollapseAll":this.parent.groupCollapseAll();break;case"pinRows":this.parent.pinRows(I.data);break;case"unpinRows":this.parent.unpinRows(I.data);break;default:return[2,this.error('Unknown grouping/pinning mode: "'+I.mode+'"')]}return[2,this.message({})];case 58:return"getBatchChanges"===(D=O).mode?[2,this.message({batchChanges:this.parent.getBatchChanges()})]:"batchSave"===D.mode||"saveBatchChanges"===D.mode?(this.parent.saveBulkChanges(D.changes),[2,this.message({batchChangesSaved:!0})]):[2,this.error('Unknown batch mode: "'+D.mode+'"')];case 59:switch((R=O).mode){case"getColumns":return[2,this.message({columns:this.parent.getColumns()})];case"getColumnByField":return[2,this.message({column:this.parent.getColumnByField(R.field)})];case"getColumnByUid":return[2,this.message({column:this.parent.getColumnByUid(R.uid)})];case"getPrimaryKeyFieldNames":return[2,this.message({primaryKeyFieldNames:this.parent.getPrimaryKeyFieldNames()})];case"getColumnFieldNames":return[2,this.message({columnFieldNames:this.parent.getColumnFieldNames()})];case"getVisibleColumns":return[2,this.message({visibleColumns:this.parent.getVisibleColumns()})];default:return[2,this.error('Unknown configuration helper mode: "'+R.mode+'"')]}case 60:switch((x=O).mode){case"enableToolbarItems":this.parent.enableToolbarItems(x.items,!!x.isEnable);break;case"copy":this.parent.copy(!!x.withHeader);break;case"print":this.parent.print();break;default:return[2,this.error('Unknown toolbar/clipboard utility mode: "'+x.mode+'"')]}return[2,this.message({})];case 61:return[2,this.error('Tool "'+t+'" not found.')];case 62:return[3,64];case 63:return D=e.sent(),T=D instanceof Error?D.message:"Tool execution failed",[2,this.error(T)];case 64:return[2]}})})},Hm.prototype.buildConfirmationMessage=function(e,t){return"Confirm: "+e+" with args: "+JSON.stringify(t||{})},Hm.prototype.requestConfirmation=function(e,t,i){return Pm(this,void 0,void 0,function(){return Lm(this,function(e){return[2,!0]})})},Hm.prototype.message=function(e){return{content:[{type:"text",text:JSON.stringify(e)}]}},Hm.prototype.error=function(e){return{content:[{type:"text",text:e}],isError:!0}},Hm.prototype.destroy=function(){this.removeEventListener(),this.webMcpAbortController&&(this.webMcpAbortController.abort(),this.webMcpAbortController=null)},Hm.prototype.getModuleName=function(){return"webMcpGrid"},Hm);function Hm(e){this.webMcpAbortController=null,this.parent=e,this.addEventListener()}jm.prototype.onActionComplete=function(e){e&&e.requestType&&("save"===e.requestType||"batchSave"===e.requestType)&&this.scheduleSelectionRefresh()},jm.prototype.getModuleName=function(){return"statusBar"},jm.prototype.getStatusPanel=function(e){return this.panels[e]||null},jm.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()?this.render():"aggregate"===e.module&&this.schedulePositionUpdate()},jm.prototype.render=function(){if(this.removePanel(),this.parent.enableStatusBar&&!this.parent.isDestroyed){this.element=this.parent.createElement("div",{className:"e-statusbar",attrs:{role:"status","aria-label":"Status Bar","aria-live":"polite"}});for(var e=["Left","Center","Right"],t=[],i=0,n=e;i<n.length;i++){var r=n[i],s=this.parent.createElement("div",{className:"e-statusbar-"+r.toLowerCase()});t.push(s),this.element.appendChild(s)}for(var o=0,a=this.parent.statusBarSettings.items;o<a.length;o++){var l,h=a[o];"string"==typeof h.key&&h.key.length&&!this.panels[h.key]&&(l="SelectedCellAggregates"===h.type?"e-statusbar-agg-panel":"e-statusbar-panel",l=this.parent.createElement("div",{className:l}),this.panels[h.key]=l,t[(r=e.indexOf(h.position))<0?e.length-1:r].appendChild(l))}this.parent.element.appendChild(this.element),this.positionElement(),this.schedulePositionUpdate(),this.scheduleCountRefresh(),this.updateBuiltInPanels()}},jm.prototype.onContentReady=function(){this.schedulePositionUpdate(),this.scheduleCountRefresh()},jm.prototype.schedulePositionUpdate=function(){var e=this;Promise.resolve().then(function(){!e.parent.isDestroyed&&e.parent.enableStatusBar&&e.positionElement()})},jm.prototype.positionElement=function(){if(this.element&&this.element.parentElement===this.parent.element){for(var e,t=null,i=null,n=0;n<this.parent.element.children.length;n++){var r=this.parent.element.children[parseInt(n.toString(),10)];!t&&r.classList.contains("e-gridfooter")?t=r:!i&&r.classList.contains("e-gridpager")&&(i=r)}t?(e=t.nextElementSibling)!==this.element&&this.parent.element.insertBefore(this.element,e):i?i.previousElementSibling!==this.element&&this.parent.element.insertBefore(this.element,i):this.parent.element.lastChild!==this.element&&this.parent.element.appendChild(this.element)}},jm.prototype.scheduleCountRefresh=function(){this.pendingCountRefresh=!0,this.scheduleUpdate()},jm.prototype.scheduleSelectionRefresh=function(){this.pendingSelectionRefresh=!0,this.scheduleUpdate()},jm.prototype.scheduleUpdate=function(){var e=this;this.refreshScheduled||(this.refreshScheduled=!0,Promise.resolve().then(function(){e.refreshScheduled=!1,!e.parent.isDestroyed&&e.parent.enableStatusBar&&(e.pendingCountRefresh&&(e.pendingCountRefresh=!1,e.updateCountState()),e.pendingSelectionRefresh&&(e.pendingSelectionRefresh=!1,e.updateAggregateState()),e.updateBuiltInPanels())}))},jm.prototype.updateCountState=function(){var e,t;this.isLocalDataSource()&&(e=[],this.parent.dataSource instanceof Array?e=this.parent.dataSource:this.parent.dataSource&&"object"==typeof this.parent.dataSource&&"dataSource"in this.parent.dataSource&&(t=this.parent.dataSource).dataSource instanceof Array&&(e=t.dataSource),this.countState.total=e.length,this.countState.filtered=this.getFilteredRowCount())},jm.prototype.isLocalDataSource=function(){if(this.parent.dataSource){if(this.parent.dataSource instanceof Array)return!0;if(this.parent.dataSource&&"object"==typeof this.parent.dataSource&&"dataSource"in this.parent.dataSource)if(this.parent.dataSource.dataSource instanceof Array)return!0}return!1},jm.prototype.getFilteredRowCount=function(){try{var e=this.parent.getFilteredRecords()&&this.parent.getFilteredRecords()?this.parent.getFilteredRecords().length:0;return e||0}catch(e){return this.countState.total}},jm.prototype.updateAggregateState=function(){var e=this.parent.getSelectedRowCellIndexes();if(this.aggregateState={sum:0,count:0,min:1/0,max:-1/0},e&&0!==e.length){for(var t=[],i=0,n=e;i<n.length;i++){var r=n[i],s=void 0;try{var o=this.parent.getRowByIndex(r.rowIndex);if(!o)continue;s=this.parent.getRowObjectFromUID(o.getAttribute("data-uid"))}catch(e){continue}if(s&&s.data&&r.cellIndexes)for(var a=0,l=r.cellIndexes;a<l.length;a++){var h=l[a];try{var d,p=this.parent.getColumnByIndex(h);p&&p.field&&(d=void 0,"number"==typeof(d=(s.changes&&p.field in s.changes?s.changes:s.data)[p.field]))&&isFinite(d)&&t.push(d)}catch(e){}}}0!==t.length&&(this.aggregateState.count=t.length,this.aggregateState.sum=t.reduce(function(e,t){return e+t},0),this.aggregateState.min=Math.min.apply(Math,t),this.aggregateState.max=Math.max.apply(Math,t))}},jm.prototype.updateBuiltInPanels=function(){var e=this.parent.statusBarSettings.items;if(e)for(var t=0,i=e;t<i.length;t++){var n=i[t],r=this.panels[n.key];if(r)if("SelectedCellAggregates"===n.type)this.renderAggregatePanel(n,r);else{var s="",o="";if("TotalRowCount"===n.type)s="Total Rows: ",o=this.formatPanelValue(n,n.type,this.countState.total);else if("FilteredRowCount"===n.type)this.parent.filterSettings&&this.parent.filterSettings.columns&&0<this.parent.filterSettings.columns.length&&(s="Filtered Rows: ",o=this.formatPanelValue(n,n.type,this.countState.filtered));else if("TotalAndFilteredRowCount"===n.type)s="Filtered/Total Rows: ",o=this.formatPanelValue(n,n.type,this.countState.filtered)+" of "+this.formatPanelValue(n,n.type,this.countState.total);else if("SelectedRowCount"===n.type){var a=this.parent.getSelectedRowIndexes();a&&0<a.length&&(s="Selected Rows: ",o=this.formatPanelValue(n,n.type,a.length))}else if("Custom"===n.type){this.renderCustomTemplate(n,r);continue}r.textContent="",o?(this.setPanelVisibility(r,!0),s&&((a=this.parent.createElement("span",{className:"e-statusbar-label"})).textContent=s,r.appendChild(a)),o&&((n=this.parent.createElement("span",{className:"e-statusbar-value"})).textContent=o,r.appendChild(n))):this.setPanelVisibility(r,!1)}}},jm.prototype.formatPanelValue=function(e,t,i,n){e=e.statusPanelParams&&e.statusPanelParams.valueFormatter;return"function"==typeof e?e({value:i,panelType:t,locale:this.parent.locale,grid:this.parent}):void 0!==n?n:i.toString()},jm.prototype.renderAggregatePanel=function(e,t){t.textContent="";var i=this.parent.getSelectedRowCellIndexes(),n=e.statusPanelParams&&null!==e.statusPanelParams.aggregateFunctions&&void 0!==e.statusPanelParams.aggregateFunctions?e.statusPanelParams.aggregateFunctions:["Sum","Avg","Count","Min","Max"];if(i&&0!==i.length&&n.length&&this.aggregateState.count){for(var r=this.aggregateState.sum/this.aggregateState.count,s=0,o=n;s<o.length;s++){var a=o[s],l=0,h="";switch(a){case"Sum":h=(l=this.aggregateState.sum).toString();break;case"Avg":h=(l=r).toFixed(2);break;case"Count":h=(l=this.aggregateState.count).toString();break;case"Min":h=(l=this.aggregateState.min).toString();break;case"Max":h=(l=this.aggregateState.max).toString();break;default:continue}var d=this.formatPanelValue(e,"SelectedCellAggregates",l,h),p=this.parent.createElement("div",{className:"e-statusbar-"+a.toLowerCase()+"-agg-panel"}),c=this.parent.createElement("span",{className:"e-statusbar-label"}),a=(c.textContent=a+": ",this.parent.createElement("span",{className:"e-statusbar-value"}));a.textContent=d,p.appendChild(c),p.appendChild(a),t.appendChild(p)}this.setPanelVisibility(t,0<t.childElementCount)}else this.setPanelVisibility(t,!1)},jm.prototype.setPanelVisibility=function(e,t){e.style.display=t?"":"none"},jm.prototype.renderCustomTemplate=function(t,i){var n=this,e=(i.textContent="",this.pendingAsyncTemplates.delete(t.key),t.statusPanelParams),r=e&&e.template;if(r){e&&e.label&&((s=this.parent.createElement("span",{className:"e-statusbar-label"})).textContent=e.label,i.appendChild(s));var s,o=this.parent.createElement("span",{className:"e-statusbar-value"});if(i.appendChild(o),"string"==typeof r)this.setCustomTemplateContent(i,o,r);else{e={grid:this.parent,totalCount:this.countState.total,filteredCount:this.countState.filtered,selectedCount:this.parent.getSelectedRowIndexes().length,selectedCellData:this.parent.getSelectedCellRecords()};try{var a=r(e);"string"==typeof a||a instanceof HTMLElement?this.setCustomTemplateContent(i,o,a):a&&"function"==typeof a.then?(o.textContent="Loading...",this.setPanelVisibility(i,!0),this.pendingAsyncTemplates.set(t.key,a),a.then(function(e){n.pendingAsyncTemplates.get(t.key)!==a||n.parent.isDestroyed||n.setCustomTemplateContent(i,o,e)}).catch(function(){n.pendingAsyncTemplates.get(t.key)!==a||n.parent.isDestroyed||(o.textContent="Error loading template",n.setPanelVisibility(i,!0))})):(i.removeChild(o),this.setPanelVisibility(i,!1))}catch(e){o.textContent="Error loading template",this.setPanelVisibility(i,!0)}}}else this.setPanelVisibility(i,!1)},jm.prototype.setCustomTemplateContent=function(e,t,i){t.textContent="","string"==typeof i&&0<i.trim().length?(t.textContent=i,this.setPanelVisibility(e,!0)):i instanceof HTMLElement?(t.appendChild(i),this.setPanelVisibility(e,!0)):(e.removeChild(t),this.setPanelVisibility(e,!1))},jm.prototype.removePanel=function(){this.element&&(H.remove(this.element),this.element=null),this.panels=Object.create(null)},jm.prototype.destroy=function(){this.parent.off(mt,this.render),this.parent.off(St,this.onPropertyChanged),this.parent.off(s,this.destroy),this.parent.off(vt,this.onContentReady),this.parent.off("recordsAdded",this.scheduleCountRefresh),this.parent.off("recordsDeleted",this.scheduleCountRefresh),this.parent.off("recordUpadated",this.scheduleCountRefresh),this.parent.off("filterAfterOpen",this.scheduleCountRefresh),this.parent.off("searchComplete",this.scheduleCountRefresh),this.parent.off("dataReady",this.scheduleCountRefresh),this.parent.removeEventListener(ce,this.selectionRefreshHandler),this.parent.removeEventListener(ge,this.selectionRefreshHandler),this.parent.removeEventListener(me,this.selectionRefreshHandler),this.parent.removeEventListener(ve,this.selectionRefreshHandler),this.parent.off("recordDoubleClick",this.scheduleSelectionRefresh),this.parent.off(_e,this.scheduleSelectionRefresh),this.parent.off(ze,this.scheduleSelectionRefresh),this.parent.off(qe,this.scheduleSelectionRefresh),this.parent.off(c,this.onActionComplete),this.removePanel()};var Vm=jm;function jm(e){this.panels=Object.create(null),this.countState={total:0,filtered:0},this.aggregateState={sum:0,count:0,min:0,max:0},this.pendingCountRefresh=!1,this.pendingSelectionRefresh=!1,this.refreshScheduled=!1,this.pendingAsyncTemplates=new Map,this.parent=e,this.selectionRefreshHandler=this.scheduleSelectionRefresh.bind(this),this.parent.on(mt,this.render,this),this.parent.on(St,this.onPropertyChanged,this),this.parent.on(s,this.destroy,this),this.parent.on(vt,this.onContentReady,this),this.parent.on("recordsAdded",this.scheduleCountRefresh,this),this.parent.on("recordsDeleted",this.scheduleCountRefresh,this),this.parent.on("recordUpadated",this.scheduleCountRefresh,this),this.parent.on("filterAfterOpen",this.scheduleCountRefresh,this),this.parent.on("searchComplete",this.scheduleCountRefresh,this),this.parent.on("dataReady",this.scheduleCountRefresh,this),this.parent.addEventListener(ce,this.selectionRefreshHandler),this.parent.addEventListener(ge,this.selectionRefreshHandler),this.parent.addEventListener(me,this.selectionRefreshHandler),this.parent.addEventListener(ve,this.selectionRefreshHandler),this.parent.on("recordDoubleClick",this.scheduleSelectionRefresh,this),this.parent.on(_e,this.scheduleSelectionRefresh,this),this.parent.on(ze,this.scheduleSelectionRefresh,this),this.parent.on(qe,this.scheduleSelectionRefresh,this),this.parent.on(c,this.onActionComplete,this)}Gm=function(e,t){return(Gm=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Gm(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Wm,_m=tf),Wm.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.object=new P.AutoComplete(H.extend({dataSource:this.parent.dataSource instanceof V.DataManager?this.parent.dataSource:new V.DataManager(this.parent.dataSource),query:(new V.Query).select(e.column.field),enabled:Lp(e.column,e.requestType,e.element),fields:{value:e.column.field},value:N(e.column.field,e.rowData),actionComplete:this.selectedValues.bind(this),placeholder:t?"":e.column.headerText,floatLabelType:t?"Never":"Always"},e.column.edit.params)),this.object.appendTo(e.element),e.element.setAttribute("name",Mp(e.column.field))},Wm.prototype.selectedValues=function(e){e.result=V.DataUtil.distinct(e.result,this.object.fields.value,!0),this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result)};var Gm,_m,Km=Wm;function Wm(){return null!==_m&&_m.apply(this,arguments)||this}Qm=function(e,t){return(Qm=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Qm(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})($m,Xm=tf),$m.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.obj=new P.ComboBox(H.extend({dataSource:this.parent.dataSource instanceof V.DataManager?this.parent.dataSource:new V.DataManager(this.parent.dataSource),query:(new V.Query).select(e.column.field),fields:{value:e.column.field},value:N(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,actionComplete:this.finalValue.bind(this),placeholder:t?"":e.column.headerText,floatLabelType:t?"Never":"Always",enabled:Lp(e.column,e.requestType,e.element),cssClass:this.parent.cssClass||null},e.column.edit.params)),this.obj.appendTo(e.element)},$m.prototype.finalValue=function(e){e.result=V.DataUtil.distinct(e.result,this.obj.fields.value,!0),this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result)};var Qm,Xm,Ym=$m;function $m(){return null!==Xm&&Xm.apply(this,arguments)||this}Zm=function(e,t){return(Zm=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}Zm(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ty,Jm=tf),ty.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.obj=new P.MultiSelect(H.extend({fields:{text:e.column.field,value:e.column.field},value:H.getValue(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,placeholder:t?"":e.column.headerText,popupHeight:"200px",floatLabelType:t?"Never":"Always",cssClass:this.parent.cssClass||null},e.column.edit.params)),this.obj.appendTo(e.element),e.element.setAttribute("name",Mp(e.column.field))};var Zm,Jm,ey=ty;function ty(){return null!==Jm&&Jm.apply(this,arguments)||this}iy=function(e,t){return(iy=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}iy(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(sy,ny=tf),sy.prototype.write=function(e){var t="Dialog"!==this.parent.editSettings.mode,i=(i=N(e.column.field,e.rowData))?new Date(i):null;this.obj=new L.TimePicker(H.extend({floatLabelType:t?"Never":"Always",value:i,placeholder:t?"":e.column.headerText,enableRtl:this.parent.enableRtl,enabled:Lp(e.column,e.requestType,e.element)&&Np(I(e.element,"e-rowcell"),this.parent),cssClass:this.parent.cssClass||null},e.column.edit.params)),this.obj.appendTo(e.element)};var iy,ny,ry=sy;function sy(){return null!==ny&&ny.apply(this,arguments)||this}oy=function(e,t){return(oy=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}oy(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(hy,ay=tf),hy.prototype.create=function(e){var t="e-field e-boolcell";return"checkbox"===e.column.type&&(t="e-field e-boolcell e-edit-checkselect"),Wc(this.parent,e.column,t,{type:"checkbox",value:e.value})},hy.prototype.read=function(e){return e.checked},hy.prototype.write=function(e){var t=!H.isNullOrUndefined(e.row)&&e.row.querySelector(".e-edit-checkselect"),i=N(e.column.field,e.rowData),i=i&&JSON.parse(i.toString().toLowerCase());H.isNullOrUndefined(t)||(this.editType=this.parent.editSettings.mode,this.editRow=e.row,"add"!==e.requestType&&(i=!!(t=this.parent.getRowObjectFromUID(e.row.getAttribute("data-uid")))&&t.isSelected),Up.apply(void 0,[[].slice.call(e.row.getElementsByClassName(b)),i].concat(this.activeClasses))),this.obj=new M.Switch(H.extend({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:i,disabled:!Lp(e.column,e.requestType,e.element),enableRtl:this.parent.enableRtl,change:this.switchModeChange.bind(this),cssClass:this.parent.cssClass||""},e.column.edit.params)),this.obj.appendTo(e.element)},hy.prototype.switchModeChange=function(e){var t;this.editRow&&"Dialog"!==this.editType&&(t=!1,e.checked?this.editRow.setAttribute("aria-selected",(t=!0).toString()):this.editRow.removeAttribute("aria-selected"),Up.apply(void 0,[[].slice.call(this.editRow.getElementsByClassName(b)),t].concat(this.activeClasses)))};var oy,ay,ly=hy;function hy(){var e=null!==ay&&ay.apply(this,arguments)||this;return e.activeClasses=["e-selectionbackground","e-active"],e}dy=function(e,t){return(dy=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(e,t){e.__proto__=t}:function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}))(e,t)};(function(e,t){function i(){this.constructor=e}dy(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(uy,py=tf),uy.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.obj=new k.MaskedTextBox(H.extend({fields:{value:e.column.field},value:N(e.column.field,e.rowData),floatLabelType:t?"Never":"Always",mask:"000-000-0000",enabled:Lp(e.column,e.requestType,e.element)&&Np(I(e.element,"e-rowcell"),this.parent),cssClass:this.parent.cssClass||null},e.column.edit.params)),this.obj.appendTo(e.element)};var dy,py,cy=uy;function uy(){return null!==py&&py.apply(this,arguments)||this}oe.ASTNode=Cl,oe.AdvancedFilter=sh,oe.AdvancedFilterSettings=yd,oe.Aggregate=t,oe.AutoCompleteEditCell=Km,oe.BatchEdit=Rf,oe.BatchEditRender=Kg,oe.BinaryOpNode=Fl,oe.BooleanEditCell=of,oe.BooleanFilterUI=Xu,oe.Cell=cs,oe.CellEdit=zf,oe.CellEditRenderer=$g,oe.CellRefNode=xl,oe.CellRenderer=vo,oe.CellRendererFactory=Sa,oe.CheckBoxFilter=tg,oe.CheckBoxFilterBase=Su,oe.Clipboard=xh,oe.Column=Q,oe.ColumnChooser=_f,oe.ColumnMenu=gm,oe.ComboboxEditCell=Ym,oe.CommandColumn=lm,oe.CommandColumnModel=Y,oe.CommandColumnRenderer=om,oe.ContentRender=fo,oe.ContextMenu=dm,oe.CycleError=hl,oe.Data=hs,oe.DateFilterUI=$u,oe.DatePickerEditCell=Ff,oe.DefaultEditCell=mf,oe.DetailRow=a,oe.DialogEdit=Tf,oe.DialogEditRender=Xg,oe.DivideByZeroError=cl,oe.DomVirtualContentRenderer=Fm,oe.DomVirtualElementHandler=Em,oe.DomVirtualization=Tm,oe.DomVirtualizationSettings=pd,oe.DropDownEditCell=df,oe.Edit=Pf,oe.EditCellBase=tf,oe.EditRender=Jg,oe.EditSettings=zd,oe.ExcelExport=em,oe.ExcelFilter=sg,oe.ExcelFilterBase=bu,oe.ExportHelper=Yf,oe.ExportValueFormatter=Zf,oe.ExternalMessage=Pu,oe.Filter=lg,oe.FilterCellRenderer=Hu,oe.FilterSettings=gd,oe.Find=th,oe.FindSettings=rh,oe.FlMenuOptrUI=ju,oe.ForeignKey=vm,oe.Formula=Ya,oe.FormulaCellEditor=Vf,oe.FormulaError=el,oe.FormulaSettings=Hd,oe.Freeze=cm,oe.FunctionCallNode=Bl,oe.Grid=Qd,oe.GridColumn=W,oe.GridWebMcpSettings=Yh,oe.Group=gg,oe.GroupCaptionCellRenderer=zo,oe.GroupCaptionEmptyCellRenderer=Ho,oe.GroupLazyLoadRenderer=Im,oe.GroupModelGenerator=uo,oe.GroupSettings=Ld,oe.HeaderCellRenderer=Do,oe.HeaderRender=mo,oe.Highlight=Ch,oe.HighlightService=vh,oe.HighlightSettings=Ka,oe.IndentCellRenderer=Po,oe.InfiniteScroll=Cm,oe.InfiniteScrollSettings=ld,oe.InlineEdit=bf,oe.InlineEditRender=Gg,oe.InterSectionObserver=Rg,oe.LazyLoadGroup=Rm,oe.LiteralNode=bl,oe.LoadingIndicator=Gd,oe.Logger=Vh,oe.MaskedTextBoxCellEdit=cy,oe.MultiSelectEditCell=ey,oe.NormalEdit=vf,oe.NumberFilterUI=Wu,oe.NumericContainer=xu,oe.NumericEditCell=cf,oe.Page=Nu,oe.Pager=Fu,oe.PagerDropDown=Mu,oe.PagerMessage=Tu,oe.ParseError=nl,oe.PdfExport=im,oe.Predicate=sd,oe.Print=Yd,oe.RangeRefNode=El,oe.ReferenceConverter=Hl,oe.ReferenceError=ol,oe.Render=ya,oe.Reorder=Va,oe.Resize=pg,oe.ResizeSettings=Md,oe.ResponsiveDialogRenderer=wa,oe.Row=ds,oe.RowDD=uh,oe.RowDropSettings=Dd,oe.RowModelGenerator=Js,oe.RowRenderer=$s,oe.Scroll=hh,oe.Search=$l,oe.SearchSettings=Id,oe.Selection=Yl,oe.SelectionSettings=Cd,oe.ServiceLocator=Ia,oe.SideBar=Xf,oe.Sort=Iu,oe.SortDescriptor=Jh,oe.SortSettings=id,oe.StackedColumn=K,oe.StackedHeaderCellRenderer=Ao,oe.StatusBar=Vm,oe.StatusBarItemConfig=kh,oe.StatusBarPanelParams=Ah,oe.StatusBarSettings=gh,oe.StringFilterUI=_u,oe.TextWrapSettings=Od,oe.TimePickerEditCell=ry,oe.ToggleEditCell=ly,oe.Toolbar=Oh,oe.TypeMismatchError=fl,oe.UnaryOpNode=Pl,oe.UndoRedo=Uf,oe.UnknownFunctionError=vl,oe.ValueFormatter=U,oe.VirtualContentRenderer=Ag,oe.VirtualElementHandler=Pg,oe.VirtualHeaderRenderer=Mg,oe.VirtualRowModelGenerator=Dg,oe.VirtualScroll=Vg,oe.WebMcpGrid=Um,oe.accessPredicate="access-predicate",oe.actionBegin=y,oe.actionComplete=c,oe.actionFailure=ae,oe.addBegin="add-begin",oe.addBiggerDialog=jc,oe.addComplete="add-complete",oe.addDeleteAction=fi,oe.addFixedColumnBorder=Pc,oe.addRemoveActiveClasses=Up,oe.addRemoveEventListener=Kc,oe.addStickyColumnPosition=zc,oe.addedRecords=ks,oe.addedRow=As,oe.advancedFilterBegin=le,oe.advancedFilterComplete=he,oe.afterContentRender="after-content-renderer",oe.afterFilterColumnMenuClose=Ur,oe.appendChildren=Ip,oe.appendInfiniteContent=qn,oe.applyBiggerTheme=pc,oe.applyDomVirtualRowHeight=ns,oe.applyStickyLeftRightPosition=Lc,oe.ariaColIndex=zs,oe.ariaRowIndex=D,oe.autoCol=oi,oe.batchAdd=ze,oe.batchCancel=qe,oe.batchCnfrmDlgCancel=jr,oe.batchDelete=Ue,oe.batchEditFormRendered=hn,oe.batchForm=on,oe.beforeAutoFill=st,oe.beforeBatchAdd=He,oe.beforeBatchCancel=ln,oe.beforeBatchDelete=Ve,oe.beforeBatchSave=je,oe.beforeCellFocused=Vt,oe.beforeCheckboxRenderer=Jn,oe.beforeCheckboxRendererQuery=Mr,oe.beforeCheckboxfilterRenderer=Hr,oe.beforeCopy=nt,oe.beforeCustomFilterOpen=pn,oe.beforeDataBound=Ye,oe.beforeDetailTemplateDetach=es,oe.beforeDomVirtualRenderRows=rs,oe.beforeExcelExport=vi,oe.beforeFltrcMenuOpen=vn,oe.beforeFragAppend=Wi,oe.beforeOpen=Gs,oe.beforeOpenAdaptiveDialog=Ze,oe.beforeOpenColumnChooser=$e,oe.beforePaste=rt,oe.beforePdfExport=Ri,oe.beforePrint=Ae,oe.beforeRefreshOnDataChange=sr,oe.beforeSetPartialRecords=is,oe.beforeStartEdit=an,oe.beginEdit=Ge,oe.bulkSave=si,oe.cBoxFltrBegin=fn,oe.cBoxFltrComplete=mn,oe.calculateAggregate=xp,oe.cancelBegin=Yi,oe.capitalizeFirstLetter=lu,oe.captionActionComplete=Br,oe.cellDeselected=ve,oe.cellDeselecting=ye,oe.cellEdit=_e,oe.cellFocus=gt,oe.cellFocused=jt,oe.cellSave=Ke,oe.cellSaved=We,oe.cellSelected=me,oe.cellSelecting=fe,oe.cellSelectionBegin="cellselecting",oe.cellSelectionComplete=Ut,oe.change=Hs,oe.changedRecords=Ms,oe.checkBoxChange=it,oe.checkDepth=lc,oe.checkIsVirtual=hu,oe.checkScrollReset=lr,oe.clearReactVueTemplates=Zc,oe.click=_t,oe.closeBatch="closebatch",oe.closeEdit=Er,oe.closeFilterDialog=Gn,oe.closeInline=Tr,oe.colGroup=qs,oe.colGroupRefresh=It,oe.columnChooserCancelBtnClick=_n,oe.columnChooserClose="columnChooserClose",oe.columnChooserOpened=sn,oe.columnChooserSearch="columnChooserSearch",oe.columnChooserUpdate="columnChooserUpdate",oe.columnDataStateChange=ji,oe.columnDeselected=be,oe.columnDeselecting=we,oe.columnDrag=Re,oe.columnDragStart=Ie,oe.columnDragStop=Zt,oe.columnDrop=xe,oe.columnMenuClick=Mi,oe.columnMenuClose=Pi,oe.columnMenuOpen=ki,oe.columnPositionChanged=Xt,oe.columnSelected=Ce,oe.columnSelecting=Se,oe.columnSelectionBegin="columnselecting",oe.columnSelectionComplete="columnselected",oe.columnVisibilityChanged=Kt,oe.columnWidthChanged=Qt,oe.columnsPrepared=gn,oe.commandClick=dt,oe.commandColumnDestroy=Vr,oe.compareChanges=Dc,oe.componentRendered="component-rendered",oe.content=xs,oe.contentReady=vt,oe.contextMenuClick=Ei,oe.contextMenuClose=Fi,oe.contextMenuOpen=Ai,oe.create=js,oe.createCboxWithWrap=Qp,oe.createEditElement=Wc,oe.createEditTable=Qg,oe.createVirtualValidationForm=kr,oe.created="create",oe.crudAction=gi,oe.customFilterClose=vr,oe.customFilterOpen=cn,oe.dataBound=de,oe.dataReady=yt,oe.dataSourceChanged=_i,oe.dataSourceModified=ei,oe.dataStateChange=Gi,oe.dblclick=ni,oe.deleteBegin="delete-begin",oe.deleteComplete=di,oe.deletedRecords=Ps,oe.destroy=s,oe.destroyAutoFillElements=Ht,oe.destroyChildGrid=Lr,oe.destroyEditForm=Jr,oe.destroyForm=mi,oe.destroyed="destroy",oe.detachDetailTemplate=ts,oe.detailCollapse=Pe,oe.detailCollapsed=Ne,oe.detailDataBound=Me,oe.detailExpand=ke,oe.detailExpanded=Le,oe.detailIndentCellInfo=In,oe.detailLists=Kh,oe.detailStateChange=bn,oe.dialogDestroy=ui,oe.distinctStringValues=Hp,oe.doesImplementInterface=Zd,oe.domVirtualTabFocus=xn,oe.doubleTap=yi,oe.downArrow=_s,oe.editBegin="edit-begin",oe.editComplete="edit-complete",oe.editNextValCell=$i,oe.editReset=Fn,oe.editedRow=Os,oe.endAdd="endAdd",oe.endDelete="endDelete",oe.endEdit="endEdit",oe.ensureFirstRow=yc,oe.ensureLastRow=mc,oe.enter=Qs,oe.enterKeyHandler=br,oe.eventPromise=Cc,oe.excelAggregateQueryCellInfo=Xn,oe.excelExportComplete=Si,oe.excelHeaderQueryCellInfo=wi,oe.excelQueryCellInfo=Ci,oe.expandChildGrid=Ji,oe.exportDataBound=nn,oe.exportDetailDataBound=bi,oe.exportDetailTemplate=Ii,oe.exportGroupCaption=pt,oe.exportRowDataBound=tn,oe.extend=pp,oe.extendObjWithFn=sc,oe.filterAfterOpen=at,oe.filterBeforeOpen=lt,oe.filterBegin="filtering-begin",oe.filterCboxValue=Cn,oe.filterChoiceRequest=ot,oe.filterCmenuSelect=yr,oe.filterComplete=Tt,oe.filterDialogClose=ur,oe.filterDialogCreated=Ni,oe.filterMenuClose=Bi,oe.filterOpen=Li,oe.filterSearchBegin=ht,oe.findCellIndex=au,oe.findChange=Ot,oe.findNavigate=At,oe.fltrPrevent=yn,oe.focus=Vs,oe.foreignKeyData=Vi,oe.freezeRefresh="freezerefresh",oe.freezeRender=Oi,oe.frozenContent=Is,oe.frozenDirection=kc,oe.frozenHeader=Rs,oe.frozenHeight="frozenHeight",oe.frozenLeft=Bs,oe.frozenRight=Ns,oe.generateExpandPredicates=ru,oe.generateQuery=Ui,oe.getActualPropFromColl=vp,oe.getActualProperties=fp,oe.getActualRowHeight=function(e){var t=H.createElement("table",{className:Ds,attrs:{role:"grid"}}),i=(t.style.visibility="hidden",t.innerHTML='<tr><td class="e-rowcell">A<td></tr>',e.appendChild(t),t.querySelector("tr").getBoundingClientRect());return e.removeChild(t),i.height},oe.getAggregateQuery="get-aggregate-query",oe.getCellByColAndRowIndex=Uc,oe.getCellFromRow=Bc,oe.getCellsByTableName=qc,oe.getCloneProperties=Xd,oe.getCollapsedRowsCount=sp,oe.getColumnByForeignKeyValue=Zp,oe.getColumnLetter=mu,oe.getColumnModelByFieldName=Xc,oe.getColumnModelByUid=Qc,oe.getColumnWidth=fc,oe.getComplexFieldID=Mp,oe.getCustomDateFormat=ic,oe.getDatePredicate=ec,oe.getEditedDataIndex=Sc,oe.getElementIndex=mp,oe.getExpandedState=nc,oe.getFilterBarOperator=Kn,oe.getFilterDlgElement=Gp,oe.getFilterMenuPostion=Vp,oe.getForeignData=$p,oe.getForeignKeyData=qi,oe.getGroupKeysAndFields=ou,oe.getListHeight=tu,oe.getNumberFormat=Vc,oe.getObject=N,oe.getParentIns=nu,oe.getParsedFieldID=kp,oe.getPosition=Cp,oe.getPredicates=su,oe.getPrintGridModel=rc,oe.getPrototypesOfObj=oc,oe.getRowHeight=Ap,oe.getRowIndexFromElement=iu,oe.getScrollBarWidth=Op,oe.getScrollWidth=cc,oe.getSerachFilteredData=pu,oe.getStateEventArgument=wc,oe.getTransformValues=dc,oe.getUid=bp,oe.getUpdateUsingRaf=ep,oe.getVirtualData=kn,oe.getVisiblePage=du,oe.getWebMcpTools=os,oe.getZIndexCalcualtion=jp,oe.gridChkBox=Es,oe.gridContent=vs,oe.gridFooter=Ss,oe.gridHeader=ms,oe.groupAggregates=Lt,oe.groupBegin="grouping-begin",oe.groupCaptionRow=Fs,oe.groupCaptionRowLeftRightPos=gc,oe.groupCollapse=Zn,oe.groupComplete=kt,oe.groupReorderRowObject=xc,oe.headerCellInfo=se,oe.headerContent=Cs,oe.headerDrop=Jt,oe.headerRefreshed=Rt,oe.headerValueAccessor=function(e,t){return H.isNullOrUndefined(e)||""===e?"":V.DataUtil.getObject(e,t)},oe.hierarchyPrint=Zi,oe.immutableBatchCancel=or,oe.inArray=yp,oe.inBoundModelChanged=wt,oe.infiniteAppendElements=eu,oe.infiniteCrudCancel=cr,oe.infiniteEditHandler=Vn,oe.infinitePageQuery=Bn,oe.infiniteRemoveElements=Jc,oe.infiniteScrollComplete=$r,oe.infiniteScrollHandler=Nn,oe.infiniteShowHide=zn,oe.initForeignKeyColumn=zi,oe.initialCollapse=jn,oe.initialEnd=mt,oe.initialFrozenColumnIndex=Ys,oe.initialLoad=ft,oe.isActionPrevent=Bp,oe.isAngularMatContainer=Oc,oe.isCellHaveWidth=Np,oe.isChildColumn=Fc,oe.isComplexField=Fp,oe.isEditable=Lp,oe.isEnableSeamlessScrolling=uu,oe.isExportColumns=tp,oe.isGroupAdaptive=tc,oe.isMatDialogContainer=Ec,oe.isRowEnteredInGrid=vc,oe.isRowPinned="isRowPinned",oe.ispercentageWidth=bc,oe.iterateArrayOrObject=ap,oe.iterateExtend=lp,oe.keyPressed=Gt,oe.lastRowCellBorderUpdated=Zr,oe.lazyLoadGroupCollapse=ut,oe.lazyLoadGroupExpand=ct,oe.lazyLoadScrollHandler=$n,oe.leftRight=Ls,oe.load=ie,oe.measureColumnDepth=ac,oe.menuClass=T,oe.modelChanged=bt,oe.movableContent=ws,oe.movableHeader=bs,oe.nextCellIndex=dr,oe.onEmpty=Ct,oe.onResize=et,oe.open=Us,oe.padZero=Jp,oe.pageBegin="paging-begin",oe.pageComplete=xt,oe.pageDown=Ws,oe.pageUp="PageUp",oe.pagerRefresh=Dr,oe.parents=Rp,oe.parentsUntil=I,oe.parseViewportHeight=fu,oe.partialRefresh=dn,oe.pdfAggregateQueryCellInfo=Qn,oe.pdfExportComplete=xi,oe.pdfHeaderQueryCellInfo=Ti,oe.pdfQueryCellInfo=Di,oe.performComplexDataOperation=Gc,oe.prepareColumns=up,oe.preventBatch=ci,oe.preventFrozenScrollRefresh=hr,oe.printComplete=Fe,oe.printGridInit=en,oe.pushuid=Mc,oe.queryCellInfo=re,oe.recordAdded=Xi,oe.recordClick=Xe,oe.recordDoubleClick=Qe,oe.recursive=op,oe.refreshAggregateCell=Bt,oe.refreshAggregateComplete=pi,oe.refreshAggregates=zt,oe.refreshComplete=ti,oe.refreshCustomFilterClearBtn=fr,oe.refreshCustomFilterOkBtn=gr,oe.refreshExpandandCollapse=Cr,oe.refreshFilteredColsUid=hc,oe.refreshFooterRenderer=Nt,oe.refreshForeignData=Yp,oe.refreshFrozenColumns=tr,oe.refreshFrozenHeight="refresh-frozen-height",oe.refreshFrozenPosition=_r,oe.refreshHandlers=er,oe.refreshInfiniteCurrentViewData=pr,oe.refreshInfiniteEditrowindex=qr,oe.refreshInfiniteModeBlocks=Pn,oe.refreshInfinitePersistSelection=zr,oe.refreshResizePosition=Kr,oe.refreshSplitFrozenColumn=Wr,oe.refreshVirtualBlock=ii,oe.refreshVirtualCache=An,oe.refreshVirtualEditFormCells=Ar,oe.refreshVirtualFrozenHeight=nr,oe.refreshVirtualFrozenRows=ar,oe.refreshVirtualLazyLoadCache=Gr,oe.refreshVirtualMaxPage=Ir,oe.registerEventHandlers=Yc,oe.registerWebMcpTools=ss,oe.removeAddCboxClasses=Xp,oe.removeElement=Sp,oe.removeEventHandlers=$c,oe.removeInfiniteRows=Un,oe.renderResponsiveChangeAction=Qr,oe.renderResponsiveCmenu=mr,oe.renderResponsiveColumnChooserDiv=Xr,oe.reorderBegin="reorder-begin",oe.reorderComplete=Ft,oe.resetCachedRowIndex=Rc,oe.resetColandRowSpanStickyPosition=Nc,oe.resetColspanGroupCaption=uc,oe.resetColumns=Wn,oe.resetDialogAppend=Ac,oe.resetInfiniteBlocks=Ln,oe.resetRowIndex=Ic,oe.resetVirtualFocus=Or,oe.resizeClassList=dg,oe.resizeStart=Je,oe.resizeStop=tt,oe.restoreFocus=wn,oe.row=Ts,oe.rowCell=b,oe.rowDataBound=ne,oe.rowDeselected=ge,oe.rowDeselecting=ue,oe.rowDrag=Ee,oe.rowDragAndDrop="row-drag-and-drop",oe.rowDragAndDropBegin="rowdraganddrop-begin",oe.rowDragAndDropComplete=Mt,oe.rowDragStart=Te,oe.rowDragStartHelper=De,oe.rowDrop=Oe,oe.rowModeChange=wr,oe.rowNumberCell=ys,oe.rowPositionChanged=rn,oe.rowSelected=ce,oe.rowSelecting=pe,oe.rowSelectionBegin="rowselecting",oe.rowSelectionComplete=qt,oe.rowsAdded=Yt,oe.rowsRemoved=$t,oe.rtlUpdated=Ki,oe.saveComplete=hi,oe.scroll=Wt,oe.scrollToEdit=Fr,oe.searchBegin="searching-begin",oe.searchComplete=Et,oe.selectRowOnContextOpen=xr,oe.selectVirtualRow=un,oe.setChecked=Wp,oe.setColumnIndex=cp,oe.setComplexFieldID=Pp,oe.setCssInGridPopUp=gp,oe.setDisplayValue=_c,oe.setEnableSeamlessScrolling=gu,oe.setFormatter=qp,oe.setFreezeSelection=rr,oe.setFullScreenDialog=Sr,oe.setGroupCache=Yn,oe.setHeightToFrozenElement="set-height-to-frozen-element",oe.setInfiniteCache=Hn,oe.setInfiniteColFrozenHeight="set-infinite-col-frozen-height",oe.setInfiniteFrozenHeight="set-infinite-frozen-height",oe.setReorderDestinationElement=ir,oe.setRowElements=Tc,oe.setStyleAndAttributes=dp,oe.setValidationRuels=Hc,oe.setVirtualPageQuery=Rr,oe.shiftEnter=Xs,oe.shiftTab="shiftTab",oe.showAddNewRowFocus=Yr,oe.showEmptyGrid=Hi,oe.sliceElements=function(e,t,i){for(var n=e.children.length,r=0,s=0;s<n;s++,r++)t<=s&&s<i||(e.removeChild(e.children[parseInt(r.toString(),10)]),r--)},oe.sortBegin="sorting-begin",oe.sortComplete=Dt,oe.stickyScrollComplete=Nr,oe.summaryIterator=Hg,oe.tab="tab",oe.table=Ds,oe.tbody=j,oe.templateCompiler=hp,oe.textWrapRefresh=Qi,oe.toggleFilterUI=_p,oe.toogleCheckbox=Kp,oe.toolPanelFilterDialog="tool-panel-filter-dialog",oe.toolPanelFilterDialogOpen=ls,oe.toolPanelPropertyChanged=as,oe.toolbarClick=Be,oe.toolbarRefresh=ri,oe.tooltipDestroy=ai,oe.uiUpdate=St,oe.ungroupBegin="ungrouping-begin",oe.ungroupComplete=Pt,oe.upArrow=Ks,oe.updateColumnTypeForExportColumns=ip,oe.updateData=li,oe.updatecloneRow=np,oe.valCustomPlacement=Sn,oe.validateVirtualForm=Pr,oe.valueAccessor=Jd,oe.virtaulCellFocus=Rn,oe.virtaulKeyHandler="virtaul-key-handler",oe.virtualScrollAddActionBegin=Mn,oe.virtualScrollEdit=On,oe.virtualScrollEditActionBegin=Dn,oe.virtualScrollEditCancel=En,oe.virtualScrollEditSuccess=Tn,oe.wrap=zp,Object.defineProperty(oe,"__esModule",{value:!0})});
2
11
  //# sourceMappingURL=ej2-grids.umd.min.js.map