@syncfusion/ej2-grids 33.2.8 → 33.2.10

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 : 33.2.10
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-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-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.ej2ExcelExport,e.ej2PdfExport)}(this,function(N,q,U,F,M,L,P,B,z,j,R){"use strict";G.prototype.getFormatFunction=function(e){return q.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||q.isNullOrUndefined(t)||q.isNullOrUndefined(e)?e:t(e)},G.prototype.toView=function(e,t){var i=e;return i=q.isNullOrUndefined(t)||q.isNullOrUndefined(e)?i:t(e)},G.prototype.setCulture=function(e){q.isNullOrUndefined(e)||q.setCulture(e)};var V=G;function G(e){this.intl=new q.Internationalization,q.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=th(n[r[parseInt(e.toString(),10)]]),s.parent.refreshReactColumnTemplateByUid(s.uid,!0)):"headerTemplate"===r[parseInt(e.toString(),10)]?(s.headerTemplateFn=th(n[r[parseInt(e.toString(),10)]]),s.parent.refreshReactHeaderTemplateByUid(s.uid)):"editTemplate"===r[parseInt(e.toString(),10)]?s.editTemplateFn=th(n[r[parseInt(e.toString(),10)]]):"filterTemplate"===r[parseInt(e.toString(),10)]?s.filterTemplateFn=th(n[r[parseInt(e.toString(),10)]]):"commandsTemplate"===r[parseInt(e.toString(),10)]&&(s.templateFn=th(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.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},q.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()),q.isNullOrUndefined(this.uid)&&(this.uid=gh("grid-column")),new V);e.format&&(e.format.skeleton||e.format.format&&"string"==typeof e.format.format)&&(this.setFormatter(t.getFormatFunction(q.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=th(this.template||this.commandsTemplate)),this.headerTemplate&&(this.headerTemplateFn=th(this.headerTemplate)),!q.isNullOrUndefined(this.filter)&&this.filter.itemTemplate&&(this.fltrTemplateFn=th(this.filter.itemTemplate)),this.editTemplate&&(this.editTemplateFn=th(this.editTemplate)),this.filterTemplate&&(this.filterTemplateFn=th(this.filterTemplate)),this.isForeignColumn()&&(q.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=q.extend({dataSource:this.dataSource,query:new U.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=Wh(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=Wh(o.foreignKeyValue,jh(o,{},e)[0]),t=Wh(o.foreignKeyValue,jh(o,{},t)[0]),"Descending"===o.sortDirection?U.DataUtil.fnDescending(e,t):U.DataUtil.fnAscending(e,t)})}W([q.Property()],J.prototype,"title",void 0),W([q.Property()],J.prototype,"type",void 0),W([q.Property()],J.prototype,"buttonOption",void 0);var Y=J;function J(){}K($,Z=Q),W([q.Property(null)],$.prototype,"columns",void 0);var Z,W=$;function $(){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}var ie="load",ne="rowDataBound",re="queryCellInfo",se="headerCellInfo",y="actionBegin",p="actionComplete",oe="actionFailure",ae="dataBound",le="rowSelecting",he="rowSelected",de="rowDeselecting",pe="rowDeselected",ce="cellSelecting",ue="cellSelected",ge="cellDeselecting",fe="cellDeselected",me="columnSelecting",ye="columnSelected",Se="columnDeselecting",ve="columnDeselected",Ce="columnDragStart",we="columnDrag",be="columnDrop",Ie="rowDragStartHelper",xe="rowDragStart",Re="rowDrag",Te="rowDrop",De="beforePrint",Ee="printComplete",Oe="detailDataBound",ke="detailExpand",Ae="detailCollapse",Fe="toolbarClick",Me="batchAdd",Le="batchCancel",Pe="batchDelete",Ne="beforeBatchAdd",Be="beforeBatchDelete",ze="beforeBatchSave",qe="beginEdit",Ue="cellEdit",He="cellSave",je="cellSaved",Ve="recordDoubleClick",Ge="recordClick",_e="beforeDataBound",Ke="beforeOpenColumnChooser",We="beforeOpenAdaptiveDialog",Qe="resizeStart",Xe="resizing",Ye="resizeStop",Je="checkBoxChange",Ze="beforeCopy",$e="beforePaste",et="beforeAutoFill",tt="filterchoicerequest",it="filterAfterOpen",nt="filterBeforeOpen",rt="filterSearchBegin",st="commandClick",ot="exportGroupCaption",at="lazyLoadGroupExpand",lt="lazyLoadGroupCollapse",ht="initial-load",dt="initial-end",pt="data-ready",ct="content-ready",g="ui-update",ut="on-empty",gt="inbound-model-changed",ft="model-changed",mt="colgroup-refresh",yt="header-refreshed",St="paging-complete",vt="sorting-complete",Ct="filtering-complete",wt="searching-complete",bt="reorder-complete",It="rowdraganddrop-complete",xt="grouping-complete",Rt="ungrouping-complete",Tt="group-aggregates",Dt="refresh-footer-rendered",Et="refresh-aggregate-cell",Ot="refresh-aggregates",kt="rowselected",At="cellselected",Ft="destroy-autofill-elements",Mt="beforecellfocused",Lt="cellfocused",Pt="key-pressed",Nt="click",s="destroy",Bt="column-visible-changed",zt="scroll",qt="column-width-changed",Ut="column-position-changed",Ht="rows-added",jt="rows-removed",Vt="column-drag-stop",Gt="header-drop",_t="datasource-modified",Kt="refresh-complete",Wt="refresh-virtual-block",Qt="dblclick",Xt="toolbar-refresh",Yt="bulk-save",Jt="auto-col",Zt="tooltip-destroy",$t="update-data",ei="save-complete",ti="delete-complete",ii="refresh-aggregate-on-save-complete",ni="prevent-batch",ri="dialog-destroy",si="crud-Action",oi="add-delete-Action",ai="destroy-form",li="double-tap",hi="beforeExcelExport",di="excelExportComplete",pi="excelQueryCellInfo",ci="excelHeaderQueryCellInfo",ui="exportDetailDataBound",gi="exportDetailTemplate",fi="beforePdfExport",mi="pdfExportComplete",yi="pdfQueryCellInfo",Si="pdfHeaderQueryCellInfo",vi="contextMenuClick",Ci="freezerender",wi="contextMenuOpen",bi="contextMenuClose",Ii="columnMenuClick",xi="columnMenuOpen",Ri="columnMenuClose",Ti="filterOpen",Di="filterDialogCreated",Ei="filter-menu-close",Oi="initForeignKeyColumn",ki="getForeignKeyData",Ai="generateQuery",Fi="showEmptyGrid",Mi="foreignKeyData",Li="columnDataStateChange",Pi="dataStateChange",Ni="dataSourceChanged",Bi="rtl-updated",zi="beforeFragAppend",qi="textWrapRefresh",Ui="recordAdded",Hi="cancel-Begin",ji="editNextValCell",Vi="hierarchyprint",Gi="expandchildgrid",_i="printGrid-Init",Ki="export-RowDataBound",Wi="export-DataBound",Qi="row-position-changed",Xi="columnChooserOpened",Yi="batchedit-form",Ji="edit-form",Zi="before-batch-cancel",$i="batcheditform-rendered",en="partial-refresh",tn="beforeCustomFilterOpen",nn="customFilterOpen",rn="select-virtual-Row",sn="columns-prepared",on="cbox-filter-begin",an="cbox-filter-complete",ln="filter-Prevent",hn="before-filter-cmenu-open",dn="validation-custom-placement",pn="filter-cbox-value",cn="restore-Focus",un="detail-state-change",gn="detail-indentcell-info",fn="virtaul-cell-focus",mn="virtual-scroll-edit-action-begin",yn="virtual-scroll-edit-success",Sn="virtual-scroll-edit-cancel",vn="virtual-scroll-edit",Cn="refresh-virtual-cache",wn="edit-reset",bn="virtual-scroll-add-action-begin",In="get-virtual-data",xn="refresh-infinite-mode-blocks",Rn="reset-infinite-blocks",Tn="infinite-scroll-handler",Dn="infinite-page-query",En="infinite-show-hide",On="append-infinite-content",kn="remove-infinite-rows",An="set-infinite-cache",Fn="infinite-edit-handler",Mn="initial-collapse",Ln="close-filter-dialog",Pn="columnChooserCancelBtnClick",Nn="get-filterbar-operator",Bn="reset-columns",zn="pdfAggregateQueryCellInfo",qn="excelAggregateQueryCellInfo",Un="group-cache",Hn="lazy-load-scroll-handler",jn="group-collapse",Vn="beforeCheckboxRenderer",Gn="refreshResizeHandlers",_n="refresh-frozen-columns",Kn="set-reorder-destination-element",Wn="refresh-virtual-frozen-height",Qn="set-freeze-selection",Xn="before-refresh-on-data-change",Yn="immutable-batch-cancel",Jn="refresh-virtual-frozenrows",Zn="check-scroll-reset",$n="prevent-frozen-scroll-refresh",er="next-cell-index",tr="refresh-infinite-current-view-data",ir="infinite-crud-cancel",nr="filter-dialog-close",rr="refresh-cutsom-filter-ok-button",sr="refresh-cutsom-filter-clear-button",or="render-responsive-cmenu",ar="filter-cmenu-select",lr="custom-filter-close",hr="set-fullscreen-dialog",dr="refresh-Expand-and-Collapse",pr="row-mode-change",cr="enter-key-handler",ur="refresh-virtual-max-page",gr="set-virtual-page-query",fr="select-row-on-context-open",mr="pager-refresh",yr="closeinline",Sr="close-edit",vr="reset-virtual-focus",Cr="refresh-virtual-editform-cells",wr="scroll-to-edit",br="before-checkbox-renderer-query",Ir="create-virtual-validation-form",xr="validate-virtual-form",Rr="destroy-child-grid",Tr="sticky-scroll-complete",Dr="infinite-group-collapse",Er="refresh-infinite-persist-selection",Or="refresh-infinite-editrowindex",kr="after-filter-column-menu-close",Ar="beforeCheckboxfilterRenderer",Fr="commandColumnDestroy",Mr="cancelcnfrmDlg",Lr="refresh-Virtual-LazyLoad-Cache",Pr="refresh-Frozen-Position",Nr="refresh-Resize-Position",Br="refresh-Split-Frozen-Column",zr="render-Responsive-Change-Action",qr="render-Responsive-Column-Chooser-Div",Ur="show-Add-New-Row-Focus",Hr="infinitescroll-complete",jr="last-rowcell-border-updated",Vr="destroy-edit-form",Gr="beforeDetailTemplateDetach",_r="detach-detail-template",Kr="beforeSetPartialRecords",Wr=((e=N.CellType||(N.CellType={}))[e.Data=0]="Data",e[e.Header=1]="Header",e[e.Summary=2]="Summary",e[e.GroupSummary=3]="GroupSummary",e[e.CaptionSummary=4]="CaptionSummary",e[e.Filter=5]="Filter",e[e.Indent=6]="Indent",e[e.GroupCaption=7]="GroupCaption",e[e.GroupCaptionEmpty=8]="GroupCaptionEmpty",e[e.Expand=9]="Expand",e[e.HeaderIndent=10]="HeaderIndent",e[e.StackedHeader=11]="StackedHeader",e[e.DetailHeader=12]="DetailHeader",e[e.DetailExpand=13]="DetailExpand",e[e.CommandColumn=14]="CommandColumn",e[e.DetailFooterIntent=15]="DetailFooterIntent",e[e.RowDragIcon=16]="RowDragIcon",e[e.RowDragHIcon=17]="RowDragHIcon",(e=N.RenderType||(N.RenderType={}))[e.Header=0]="Header",e[e.Content=1]="Content",e[e.Summary=2]="Summary",(e=N.ToolbarItem||(N.ToolbarItem={}))[e.Add=0]="Add",e[e.Edit=1]="Edit",e[e.Update=2]="Update",e[e.Delete=3]="Delete",e[e.Cancel=4]="Cancel",e[e.Print=5]="Print",e[e.Search=6]="Search",e[e.ColumnChooser=7]="ColumnChooser",e[e.PdfExport=8]="PdfExport",e[e.ExcelExport=9]="ExcelExport",e[e.CsvExport=10]="CsvExport",e[e.WordExport=11]="WordExport",(e=N.ResponsiveDialogAction||(N.ResponsiveDialogAction={}))[e.isEdit=0]="isEdit",e[e.isAdd=1]="isAdd",e[e.isSort=2]="isSort",e[e.isFilter=3]="isFilter",e[e.isColMenu=4]="isColMenu",e[e.isColumnChooser=5]="isColumnChooser",(e=N.ResponsiveToolbarAction||(N.ResponsiveToolbarAction={}))[e.isInitial=0]="isInitial",e[e.isSearch=1]="isSearch",Qr.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])},Qr.prototype.getModuleName=function(){return"data"},Qr.prototype.initDataManager=function(){var e=this.parent;this.dataManager=e.dataSource instanceof U.DataManager?e.dataSource:q.isNullOrUndefined(e.dataSource)?new U.DataManager:new U.DataManager(e.dataSource),!e.isAngular||e.query instanceof U.Query?(this.isQueryInvokedFromData=!0,e.query instanceof U.Query||(e.query=new U.Query)):e.setProperties({query:new U.Query},!0)},Qr.prototype.generateQuery=function(e,t){var i=this.parent,i=q.isNullOrUndefined(i.getQuery())?new U.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),Kh(this.parent)?this.virtualGroupPageQuery(i):this.pageQuery(i,e),!q.isNullOrUndefined(t)&&t||this.groupQuery(i),i},Qr.prototype.pinnedDataQuery=function(e){return this.filterQuery(e),this.searchQuery(e),this.sortQuery(e),e},Qr.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},Qr.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},Qr.prototype.pageQuery=function(e,t){var i=this.parent;if(!t){var n={query:e,skipPage:!1};if(i.notify(gr,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);!q.isNullOrUndefined(i.infiniteScrollModule)&&i.enableInfiniteScrolling?this.parent.notify(Dn,e):e.page(i.pageSettings.currentPage,!(i.allowPaging&&i.pagerModule&&i.pagerModule.pagerObj.isAllPage)||i.isManualRefresh||this.dataManager.dataSource.offline||this.dataManager.adaptor instanceof U.RemoteSaveAdaptor?i.pageSettings.pageSize:null)}}return e},Qr.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},Qr.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},Qr.prototype.searchQuery=function(e,t,i){var n=this.parent.searchSettings,r=!q.isNullOrUndefined(n.fields)&&n.fields.length?n.fields:this.getSearchColumnFieldNames(),s=[];if(!q.isNullOrUndefined(this.parent.searchSettings.key)&&this.parent.searchSettings.key.length){var o=this.parent.getForeignKeyColumns().some(function(e){return-1<r.indexOf(e.field)}),a=(i?t.dataSource:this.dataManager).adaptor;if(o||a.getModuleName&&"ODataV4Adaptor"===a.getModuleName()){for(var r=i?[t.foreignKeyValue]:r,l=0;l<r.length;l++){var h=i?t:this.getColumnByField(r[parseInt(l.toString(),10)]);h.isForeignColumn()&&!i?s=this.fGeneratePredicate(h,s):s.push(new U.Predicate(r[parseInt(l.toString(),10)],n.operator,n.key,n.ignoreCase,n.ignoreAccent))}o=U.Predicate.or(s);o.key=n.key,e.where(o)}else e.search(n.key,r,n.operator,n.ignoreCase,n.ignoreAccent)}return e},Qr.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);q.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=ap.getPredicate(p),S=0,v=Object.keys(y);S<v.length;S++){var C=v[S];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,x=this.parent.grabColumnByUidFromAllCols(I.uid);if(x||this.parent.log("initial_action",{moduleName:"filter",columnName:I.field}),x.isForeignColumn()&&Vh(I.field,o)&&!i)x.columnData.length||(n=!0),s=this.fGeneratePredicate(x,s);else for(var y=ap.getPredicate(a),R=0,T=Object.keys(y);R<T.length;R++){C=T[R];s.push(y[""+C])}}s.length&&!n?e.where(U.Predicate.and(s)):this.parent.notify(Fi,{})}return e},Qr.prototype.fGeneratePredicate=function(e,t){var i={};return e&&(this.parent.notify(Ai,{predicate:i,column:e}),i.predicate.predicates.length)&&t.push(i.predicate),t},Qr.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=void 0;switch(e.requestType){case"delete":t=t||this.generateQuery();var s,r=1===Object.keys(e.data).length?this.dataManager.remove(n,e.data[0],t.fromTable,t):((s={addedRecords:[],deletedRecords:[],changedRecords:[]}).deletedRecords=e.data,this.dataManager.saveChanges(s,n,t.fromTable,t.requiresCount()));break;case"save":t=t||this.generateQuery(),e.index=q.isNullOrUndefined(e.index)?0:e.index,r=this.dataManager.insert(e.data,t.fromTable,t,e.index)}return!(e.promise=r)||Array.isArray(r)||r.hasOwnProperty("deletedRecords")?this.insert(t,e):r.then(function(){return i.insert(t,e)})},Qr.prototype.insert=function(e,t){return"save"===t.requestType&&(t.query=e,this.parent.notify(Ui,t)),this.executeQuery(e)},Qr.prototype.executeQuery=function(e){var t,i=this;return this.dataManager.ready?(t=new U.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)},Qr.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),q.isNullOrUndefined(t.getFormatter())&&Ah(i,t),V.prototype.toView(e,t.getFormatter())},Qr.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(si,e)},Qr.prototype.saveChanges=function(e,t,i,n){var r,s;return(n=void 0===n?this.generateQuery():n).requiresCount(),"result"in this.parent.dataSource?(s={requestType:"batchsave",changes:e,key:t,query:n,endEdit:(r=new U.Deferred).resolve},this.setState({isPending:!0,resolver:r.resolve}),this.parent.trigger(Ni,s),r.promise):this.dataManager.saveChanges(e,t,n.fromTable,n,i)},Qr.prototype.getKey=function(e){if(e&&e.length)return e[0]},Qr.prototype.isRemote=function(){return!0!==this.dataManager.dataSource.offline&&void 0!==this.dataManager.dataSource.url&&""!==this.dataManager.dataSource.url},Qr.prototype.clearCache=function(){this.isRemote()&&this.parent.dataSource.clearCache()},Qr.prototype.addRows=function(e){for(var t=e.records.length;0<t;t--)this.parent.dataSource instanceof U.DataManager&&this.dataManager.dataSource.offline?this.dataManager.dataSource.json.splice(e.toIndex,0,e.records[t-1]):this.parent.getDataModule().isRemote()||q.isNullOrUndefined(this.parent.dataSource)||this.parent.dataSource.result||this.parent.dataSource.splice(e.toIndex,0,e.records[t-1])},Qr.prototype.removeRows=function(t){var e=this.dataManager.dataSource.json;this.parent.dataSource instanceof U.DataManager&&this.dataManager.dataSource.offline?this.dataManager.dataSource.json=e.filter(function(e){return-1===t.records.indexOf(e)}):this.parent.getDataModule().isRemote()||q.isNullOrUndefined(this.parent.dataSource)||this.parent.dataSource.result||(this.parent.dataSource=e.filter(function(e){return-1===t.records.indexOf(e)}))},Qr.prototype.getColumnByField=function(t){var i;return this.parent.columnModel.some(function(e){return(i=e).field===t})&&i},Qr.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(Ht,this.addRows),this.parent.off(jt,this.removeRows),this.parent.off(_t,this.initDataManager),this.parent.off(s,this.destroy),this.parent.off($t,this.crudActions),this.parent.off(oi,this.getData),this.parent.off(Jt,this.refreshFilteredCols),this.parent.off(sn,this.refreshFilteredCols))},Qr.prototype.getState=function(){return this.dataState},Qr.prototype.setState=function(e){return this.dataState=e},Qr.prototype.getForeignKeyDataState=function(){return this.foreignKeyDataState},Qr.prototype.setForeignKeyDataState=function(e){this.foreignKeyDataState=e},Qr.prototype.getStateEventArgument=function(e){var t=new U.UrlAdaptor,i=new U.DataManager({url:"",adaptor:new U.UrlAdaptor}),t=t.processQuery(i,e),i=JSON.parse(t.data);return q.extend(i,t.pvtData)},Qr.prototype.eventPromise=function(e,t,i){var n,r=this,s=e,o=this.getStateEventArgument(t),a=new U.Deferred,l=new U.Deferred;return(void 0!==e.requestType||this.parent.groupSettings.disablePageWiseAggregates&&t.queries.some(function(e){return"onGroup"===e.fn}))&&!1!==this.dataState.isDataChanged?"save"===(o.action=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(Ni,n),l.promise.then(function(){r.setState({isPending:!0,resolver:a.resolve,group:o.group,aggregates:o.aggregates}),"save"===n.requestType&&r.parent.notify(Ui,n),r.parent.trigger(Pi,o)}).catch(function(){})):(this.setState({isPending:!0,resolver:a.resolve,group:o.group,aggregates:o.aggregates}),this.parent.trigger(Pi,o)):(this.setState({}),a.resolve(this.parent.dataSource)),a},Qr.prototype.getSearchColumnFieldNames=function(){for(var e=[],t=0,i=this.parent.getColumns();t<i.length;t++){var n=i[t];n.allowSearching&&!q.isNullOrUndefined(n.field)&&e.push(n.field)}return e},Qr.prototype.refreshFilteredCols=function(){this.parent.allowFiltering&&this.parent.filterSettings.columns.length&&td(this.parent,this.parent.filterSettings.columns)},Qr);function Qr(e,t){this.dataState={isPending:!1,resolver:null,group:[]},this.foreignKeyDataState={isPending:!1,resolver:null},this.parent=e,this.serviceLocator=t,this.initDataManager(),this.parent.isDestroyed||"foreignKey"===this.getModuleName()||(this.parent.on(Ht,this.addRows,this),this.parent.on(Qi,this.reorderRows,this),this.parent.on(jt,this.removeRows,this),this.parent.on(_t,this.initDataManager,this),this.parent.on(s,this.destroy,this),this.parent.on($t,this.crudActions,this),this.parent.on(oi,this.getData,this),this.parent.on(Jt,this.refreshFilteredCols,this),this.parent.on(sn,this.refreshFilteredCols,this))}Yr.prototype.clone=function(){var e=new Yr({});return q.merge(e,this),e.cells=this.cells.map(function(e){return e.clone()}),e},Yr.prototype.setRowValue=function(e){var t;this.parent&&(t=this.data[this.parent.getPrimaryKeyFieldNames()[0]],this.parent.setRowData(t,e))},Yr.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))},Yr.prototype.makechanges=function(e,t){this.parent&&this.parent.getDataModule().dataManager.update(e,t)};var Xr=Yr;function Yr(e,t){q.merge(this,e),this.parent=t}Zr.prototype.clone=function(){var e=new Zr({});return q.merge(e,this),e};var Jr=Zr;function Zr(e){this.isSpanned=!1,this.isRowSpanned=!1,q.merge(this,e)}es.prototype.render=function(e,t,i,n){for(var r,s,o,a=this.serviceLocator.getService("cellRendererFactory").getCellRenderer(t.cells[parseInt(i.toString(),10)].cellType||N.CellType.Data),l=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,h=e.rowSpan,d=0,p=(t.index>this.parent.pinnedTopRecords.length&&(o=t.index-this.parent.pinnedTopRecords.length,s=this.parent.getRowsObject().filter(function(e){return e.isDataRow}),s=(0<this.parent.groupSettings.columns.length&&!s[parseInt(o.toString(),10)-1].isDataRow?s[parseInt(o.toString(),10)]:s[parseInt(o.toString(),10)-1]).cells,r=t.cells[parseInt(i.toString(),10)],s=s.filter(function(e){return e.column.uid===r.column.uid})[0]),s&&1<s.colSpanRange&&1<s.rowSpanRange?s.colSpanRange:l),c=i+1;c<i+p&&c<t.cells.length;c++)!1===t.cells[parseInt(c.toString(),10)].visible?d++:t.cells[parseInt(c.toString(),10)].isSpanned=!0;if(0<d){for(c=i+l;c<i+l+d&&c<t.cells.length;c++)t.cells[parseInt(c.toString(),10)].isSpanned=!0;i+l+d>=t.cells.length&&(l-=i+l+d-t.cells.length)}return t.cells[parseInt(i.toString(),10)].cellSpan&&(t.data[e.column.field]=t.cells[parseInt(i.toString(),10)].spanText,o=t.index-this.parent.pinnedTopRecords.length,n=a.render(t.cells[parseInt(i.toString(),10)],t.data,{index:q.isNullOrUndefined(o)?"":o.toString()})),1<l&&q.attributes(n,{colSpan:l.toString(),"aria-colSpan":l.toString()}),1<h&&(q.attributes(n,{rowspan:h.toString(),"aria-rowspan":h.toString()}),t.cells[parseInt(i.toString(),10)].isRowSpanned=!0,t.cells[parseInt(i.toString(),10)].rowSpanRange=Number(h),1<l)&&(t.cells[parseInt(i.toString(),10)].colSpanRange=Number(l)),t.index>this.parent.pinnedTopRecords.length&&1<s.rowSpanRange&&(t.cells[parseInt(i.toString(),10)].isSpanned=!0,t.cells[parseInt(i.toString(),10)].rowSpanRange=Number(s.rowSpanRange-1),t.cells[parseInt(i.toString(),10)].colSpanRange=0<s.rowSpanRange?s.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},es.prototype.backupMergeCells=function(e,t,i){this.setMergeCells(this.generteKey(e,t),i)},es.prototype.generteKey=function(e,t){return e+"__"+t.toString()},es.prototype.splitKey=function(e){return e.split("__")},es.prototype.containsKey=function(e,t){return this.getMergeCells().hasOwnProperty(this.generteKey(e,t))},es.prototype.getMergeCells=function(){return this.parent.mergeCells},es.prototype.setMergeCells=function(e,t){this.parent.mergeCells[""+e]=t},es.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},es.prototype.getIndexFromAllColumns=function(i){return $l(this.parent.getVisibleColumns(),function(e,t){if(e.field===i)return t})[0]};var $r=es;function es(e,t){this.serviceLocator=e,this.parent=t}var b="e-rowcell",ts="e-gridheader",is="e-gridcontent",ns="e-gridfooter",rs="e-headercontent",ss="e-movablecontent",os="e-movableheader",as="e-frozencontent",ls="e-frozenheader",hs="e-content",ds="e-table",I="e-row",ps="e-gridchkbox",cs="e-editedrow",us="e-addedrow",gs="e-groupcaptionrow",fs="changedRecords",ms="addedRecords",ys="deletedRecords",Ss="Left-Right",vs="frozen-right",Cs="frozen-left",ws="aria-colindex",T="aria-rowindex",H="tbody",bs="colgroup",Is="open",xs="change",Rs="focus",Ts="created",Ds="beforeOpen",Es="downArrow",Os="upArrow",ks="PageDown",As="enter",Fs="shiftEnter",Ms="initialFrozenColumnIndex",Ls=(Ps.prototype.render=function(e,t,i,n,r){return this.refreshRow(e,t,i,n,r)},Ps.prototype.refresh=function(e,t,i,n,r){var s=this,o=(i&&(e.data=Jh({},e.changes),this.refreshMergeCells(e)),this.parent.element.querySelector("[data-uid="+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&&Td(e),[].slice.call(e.cells)),r=[].slice.call(o.querySelectorAll(".e-templatecell"));if(this.parent.isReact&&r.length)for(var a=0,l=t;a<l.length;a++)if("break"===function(e){if(e.template)return setTimeout(function(){s.parent.refreshReactColumnTemplateByUid(e.uid,!0)},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)}},Ps.prototype.refreshRow=function(D,e,t,i,n,E){for(var O=q.isNullOrUndefined(n)?this.element.cloneNode():n,n={data:D.data},k={data:D.data},r=this.parent.getColumns().filter(function(e){return"checkbox"===e.type&&e.field})[0],s=!1,A=this.parent.isFrozenGrid(),F=!0,r=(r&&(s=Wh(r.field,n.data)),this.parent.getSelectedRowIndexes()),M=(D.isDataRow&&(h=this.parent.getPrimaryKeyFieldNames()[0],D.isSelected=this.parent.isPersistSelection&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading?!q.isNullOrUndefined(this.parent.selectionModule.selectedRowState[D.data[""+h]]):-1<r.indexOf(D.index)||s),this.parent.currentViewData),L=(D.isDataRow&&this.parent.isCheckBoxSelection&&"Check"===this.parent.checkAllRows&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||this.parent.allowPaging&&this.parent.selectionModule&&this.parent.selectionModule.isPartialSelection)&&(D.isSelected=!0,-1===r.indexOf(D.index))&&r.push(D.index),this.buildAttributeFromRow(O,D),q.attributes(O,q.extend({},t,{})),ih(O,D.attributes),this.serviceLocator.getService("cellRendererFactory")),P=this,o=0,a=D.cells.length;o<a;o++)!function(t){var i=D.cells[parseInt(t.toString(),10)],e=(i.isSelected=D.isSelected,i.isColumnSelected=i.column.isSelected,L.getCellRenderer(D.cells[parseInt(t.toString(),10)].cellType||N.CellType.Data)),n={"data-index":q.isNullOrUndefined(D.index)?"":D.index.toString()},r=(D.isExpand&&D.cells[parseInt(t.toString(),10)].cellType===N.CellType.DetailExpand&&(n.class=P.parent.isPrinting?"e-detailrowcollapse":"e-detailrowexpand"),!P.parent.enableRtl&&F&&("Vertical"===P.parent.gridLines||"Both"===P.parent.gridLines)),s=e.render(D.cells[parseInt(t.toString(),10)],D.data,n,D.isExpand,E);if(D.cells[parseInt(t.toString(),10)].cellType!==N.CellType.Filter){if(D.cells[parseInt(t.toString(),10)].cellType===N.CellType.Data||D.cells[parseInt(t.toString(),10)].cellType===N.CellType.CommandColumn){i.visible&&r&&(P.parent.groupSettings&&P.parent.groupSettings.columns.length?s.classList.add("e-grid-group-first-cell"):P.parent.renderModule&&P.parent.renderModule.isFirstColumnHidden&&!(P.parent.allowRowDragAndDrop||P.parent.childGrid||P.parent.detailTemplate)&&s.classList.add("e-first-visible-cell"),F=!1);var o,n=P.parent.parentDetails&&P.parent.parentDetails.parentInstObj&&P.parent.parentDetails.parentInstObj.isReact,a=P.parent.printGridParent&&P.parent.printGridParent.isReact;if((P.parent.isReact&&P.parent.requireTemplateRef||n&&P.parent.parentDetails.parentInstObj.requireTemplateRef||a&&P.parent.printGridParent.requireTemplateRef)&&i.isTemplate?(o=P).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,q.extend(k,{cell:s,column:i.column,colSpan:1,rowSpan:1,foreignKeyData:D.cells[parseInt(t.toString(),10)].foreignKeyData,requestType:o.parent.requestTypeAction}))}):P.parent.trigger(re,q.extend(k,{cell:s,column:i.column,colSpan:1,rowSpan:1,foreignKeyData:D.cells[parseInt(t.toString(),10)].foreignKeyData,requestType:P.parent.requestTypeAction})),!(P.parent.enableVirtualization||P.parent.enableColumnVirtualization||P.parent.enableInfiniteScrolling||P.parent.allowGrouping&&P.parent.groupSettings.columns.length&&P.parent.groupSettings.enableLazyLoading||D.index<P.parent.pinnedTopRecords.length)){var l="field",h=["date","datetime","dateonly"];if(D.isDataRow&&P.parent.enableColumnSpan&&i.column.enableColumnSpan&&!i.isSpanned&&i.visible&&!i.isTemplate&&""!==D.data[i.column[""+l]]&&!i.isForeignKey){var d=1,p=e.getValue(i.column[""+l],D.data,i.column);-1!==h.indexOf(i.column.type)&&!q.isNullOrUndefined(p)&&p instanceof Date&&(p=p.getTime());for(var c=t;c<D.cells.length-1;c++){var u=D.cells[parseInt(c.toString(),10)+1],g=e.getValue(u.column[""+l],D.data,u.column);if(p!==(g=-1!==h.indexOf(u.column.type)&&!q.isNullOrUndefined(g)&&g instanceof Date?g.getTime():g)||!u.visible||!u.column.enableColumnSpan||u.isForeignKey)break;d++}k.colSpan=d}if(D.isDataRow&&P.parent.enableRowSpan&&i.column.enableRowSpan&&!i.isSpanned&&!i.isTemplate&&i.visible&&""!==D.data[i.column[""+l]]&&!i.isForeignKey){var f=D.index-P.parent.pinnedTopRecords.length,n=P.parent.groupSettings.columns.length?D.groupDataIndex:f,m=(D.isDataRow&&P.parent.groupSettings.columns.length&&!q.isNullOrUndefined(D.parentUid)&&(M=P.parent.getRowObjectFromUID(D.parentUid).data.items),1),p=e.getValue(i.column[""+l],D.data,i.column);-1!==h.indexOf(i.column.type)&&!q.isNullOrUndefined(p)&&p instanceof Date&&(p=p.getTime());for(c=n+1;c<M.length;c++){var y=e.getValue(i.column[""+l],M[parseInt(c.toString(),10)],i.column);if(p!==(y=-1!==h.indexOf(i.column.type)&&!q.isNullOrUndefined(y)&&y instanceof Date?y.getTime():y))break;m++}k.rowSpan=m}}var S,v,C,w,a=!1;if(D.index>P.parent.pinnedTopRecords.length&&(P.isSpan||P.parent.isSpan&&E)&&(f=D.index-P.parent.pinnedTopRecords.length,S=P.parent.getRowsObject().filter(function(e){return e.isDataRow}),v=(0<P.parent.groupSettings.columns.length&&!S[f-1].isDataRow?S[parseInt(f.toString(),10)]:S[parseInt(f.toString(),10)-1]).cells,a=(C=v.filter(function(e){return e.column.uid===D.cells[parseInt(t.toString(),10)].column.uid})[0]).isRowSpanned||1<C.rowSpanRange),(1<k.rowSpan||1<k.colSpan)&&D.index>=P.parent.pinnedTopRecords.length){var f=D.index-P.parent.pinnedTopRecords.length;if(P.resetrowSpanvalue(P.parent.frozenRows>f?P.parent.frozenRows:M.length,k,f),!1===k.column.visible)k.colSpan=1;else if(A){var b=P.parent.getColumns(),n=P.parent.getFrozenRightColumnsCount(),I=P.parent.getFrozenLeftCount(),n=b.length-n,x=k.column.index;if(x<I&&I<x+k.colSpan){var R=x+k.colSpan-I;k.colSpan=k.colSpan-R}else if(n<=x&&b.length<x+k.colSpan){var R=x+k.colSpan-b.length;k.colSpan=k.colSpan-R}else if("Fixed"===k.column.freeze){for(var R=1,T=x,c=T+1;c<T+k.colSpan&&"Fixed"===b[parseInt(c.toString(),10)].freeze;c++)R++;k.colSpan=R}else x<n&&n<x+k.colSpan&&(R=x+k.colSpan-n,k.colSpan=k.colSpan-R)}}(1<k.colSpan||1<D.cells[parseInt(t.toString(),10)].cellSpan||1<k.rowSpan||a)&&D.index>=P.parent.pinnedTopRecords.length&&(P.parent.isSpan=!0,P.isSpan=!0,s=(w=new $r(P.serviceLocator,P.parent)).render(k,D,t,s),A)&&Ed(P.parent,k.column,s,k.colSpan)}i.cellType!==N.CellType.Header&&i.cellType!==N.CellType.StackedHeader||!r||!i.visible&&i.cellType!==N.CellType.StackedHeader||(I=P.parent.getVisibleColumns(),l="field",(i.column.type&&"checkbox"===i.column.type||i.cellType===N.CellType.Header&&i.column[""+l]&&I.length&&I[0].field===i.column[""+l]||i.cellType===N.CellType.StackedHeader)&&(P.parent.groupSettings&&P.parent.groupSettings.columns.length?s.classList.add("e-grid-group-first-cell"):P.parent.renderModule&&P.parent.renderModule.isFirstColumnHidden&&!(P.parent.allowRowDragAndDrop||P.parent.childGrid||P.parent.detailTemplate)&&s.classList.add("e-first-visible-cell")),F=!1),i.cellType===N.CellType.Header&&(1<D.cells[parseInt(t.toString(),10)].colSpan||1<D.cells[parseInt(t.toString(),10)].rowSpan)&&(w=new $r(P.serviceLocator,P.parent),s=w.render(D.cells[parseInt(t.toString(),10)],D,t,s)),P.isSpan&&(S=P.parent.getRowsObject(),x=P.parent.enableRtl,f=D.index-P.parent.pinnedTopRecords.length,S[D.index-1])&&S[f-1].isDataRow&&(C=(v=S[f-1].cells)[t-1],n=v[parseInt(t.toString(),10)],a=v[t+1],I=v[parseInt(t.toString(),10)].column.freeze,C&&(C.isRowSpanned||1<C.rowSpanRange)&&C.visible&&(x||n.isRowSpanned&&!(C.rowSpanRange>n.rowSpanRange)||s.classList.add("e-rowcell-firstchild"),A)&&("Fixed"===C.column.freeze&&"Fixed"===I?s.classList.add(x?"e-removefreezerightborder":"e-removefreezeleftborder"):x||1!==t||"Left"!==I||s.classList.add("e-addfreezefirstchildborder")),a)&&(a.isRowSpanned||1<a.rowSpanRange)&&a.visible&&(x&&(!n.isRowSpanned||a.rowSpanRange>n.rowSpanRange)&&s.classList.add("e-rowcell-lastchild"),A)&&"Fixed"===a.column.freeze&&"Fixed"===I&&k.colSpan<2&&s.classList.add(x?"e-removefreezeleftborder":"e-removefreezerightborder"),1<k.rowSpan&&M.length-(D.index-P.parent.pinnedTopRecords.length)===k.rowSpan&&s.classList.add("e-row-span-lastrowcell"),D.cells[parseInt(t.toString(),10)].isSpanned||O.appendChild(s)}else i.visible&&r&&(P.parent.groupSettings&&P.parent.groupSettings.columns.length?s.classList.add("e-grid-group-first-cell"):P.parent.renderModule&&P.parent.renderModule.isFirstColumnHidden&&!(P.parent.allowRowDragAndDrop||P.parent.childGrid||P.parent.detailTemplate)&&s.classList.add("e-first-visible-cell"),F=!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&&q.removeClass(h,["e-leftfreeze","e-unfreeze","e-rightfreeze","e-fixedfreeze","e-freezerightborder","e-freezeleftborder"]),O.querySelector(".e-summarycell"))od(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"),Dd(u,30*c,this.parent.enableRtl,"Left"),u.classList.contains("e-groupcaption")&&(d=parseInt(u.getAttribute("colspan"),10),p=sd(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"),Dd(u[parseInt(o.toString(),10)],30*o,this.parent.enableRtl,"Left")}var g,f,m,y,S={row:O,rowHeight:this.parent.rowHeight};if(D.isDataRow&&((g=q.extend(n,S)).isSelectable=!0,f=this.parent.getPrimaryKeyFieldNames()[0],s=D.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||(D.isSelectable=g.isSelectable,m.disableRowSelection(m,D,S,g))}):this.parent.trigger(ne,g),D.isSelectable=g.isSelectable,h=this.parent.isRowDragable(),this.parent.allowPaging&&this.parent.selectionSettings.persistSelection&&(y=D.data?D.data[""+f]:null,(s=g.isSelectable?this.parent.partialSelectedRecords:this.parent.disableSelectedRecords).some(function(e){return e[""+f]===y})||s.push(D.data)),g.isSelectable||this.disableRowSelection(this,D,S,g),this.parent.childGrid||h||this.parent.detailTemplate)&&(u=O.querySelectorAll(".e-rowcell:not(.e-hide)")[0])&&u.classList.add("e-detailrowvisible"),!this.parent.enableVirtualization||D.isAggregateRow&&!D.parentUid||(n.rowHeight=this.parent.rowHeight),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"),D.cssClass&&O.classList.add(D.cssClass),D.lazyLoadCssClass&&O.classList.add(D.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 v,C;this.parent.aggregates[parseInt(o.toString(),10)].properties.columns[0].footerTemplate&&(v=[].slice.call(O.getElementsByClassName("e-summarycell"))).length&&(C=v[v.length-1],q.addClass([C],["e-lastsummarycell"]),C=v[0],q.addClass([C],["e-firstsummarycell"]))}return O},Ps.prototype.resetrowSpanvalue=function(e,t,i){i<e&&e<i+t.rowSpan&&(i=i+t.rowSpan-e,t.rowSpan=t.rowSpan-i)},Ps.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&&q.removeClass([l],["e-selectionbackground","e-active"])}r&&q.removeClass([r],["e-selectionbackground","e-active"])},Ps.prototype.refreshMergeCells=function(e){for(var t=0,i=e.cells;t<i.length;t++)i[t].isSpanned=!1;return e},Ps.prototype.buildAttributeFromRow=function(e,t){var i={},n="data-uid",r="aria-selected",s=[];t.isDataRow&&s.push(I),t.isAltRow&&s.push("e-altrow"),t.isCaptionRow&&s.push("e-groupcaptionrow"),t.isAggregateRow&&t.parentUid&&s.push("e-groupfooterrow"),q.isNullOrUndefined(t.index)||(i[T]=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,ih(e,i)},Ps);function Ps(e,t,i){this.isSpan=!1,this.cellType=t,this.serviceLocator=e,this.parent=i,this.element=this.parent.createElement("tr",{attrs:{role:"row"}})}Bs.prototype.generateRows=function(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},Bs.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,N.CellType.HeaderIndent))}return t},Bs.prototype.ensurePinnedColumns=function(){var e=[];return(this.parent.detailTemplate||this.parent.childGrid)&&e.push(this.generateCell({},null,N.CellType.HeaderIndent)),this.parent.isRowDragable()&&e.push(this.generateCell({},null,N.CellType.HeaderIndent)),e},Bs.prototype.ensureColumns=function(){var e,t=[];return(this.parent.detailTemplate||this.parent.childGrid)&&(this.parent.notify(gn,e={}),t.push(this.generateCell(e,null,N.CellType.DetailExpand))),this.parent.isRowDragable()&&t.push(this.generateCell({},null,N.CellType.RowDragIcon)),t},Bs.prototype.generateRow=function(e,t,i,n,r,s,o,a){var l={foreignKeyData:{}},n=(l.uid=gh("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?!q.isNullOrUndefined(this.parent.selectionModule.selectedRowState[e[""+n]]):-1<this.parent.getSelectedRowIndexes().indexOf(t),this.refreshForeignKeyRow(l),this.ensureColumns()),r=(this.parent.pinnedTopRecords.length&&t<this.parent.pinnedTopRecords.length&&(s=this.ensurePinnedColumns()),new Xr(l,this.parent));return r.cells="Right"===this.parent.getFrozenMode()?this.generateCells(l).concat(s):s.concat(this.generateCells(l)),r},Bs.prototype.refreshForeignKeyRow=function(e){for(var t=this.parent.getForeignKeyColumns(),i=0;i<t.length;i++)q.setValue(t[parseInt(i.toString(),10)].field,jh(t[parseInt(i.toString(),10)],e.data),e.foreignKeyData)},Bs.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,q.isNullOrUndefined(t[parseInt(n.toString(),10)].commands)?void 0:N.CellType.CommandColumn,null,n,e.foreignKeyData));return i},Bs.prototype.generateCell=function(e,t,i,n,r,s){t={visible:e.visible,isDataCell:!q.isNullOrUndefined(e.field||e.template),isTemplate:!q.isNullOrUndefined(e.template),rowID:t,column:e,cellType:q.isNullOrUndefined(i)?N.CellType.Data:i,colSpan:n,commands:e.commands,isForeignKey:e.isForeignColumn&&e.isForeignColumn(),foreignKeyData:e.isForeignColumn&&e.isForeignColumn()&&q.getValue(e.field,s)};return(t.isDataCell||"checkbox"===t.column.type||t.commands)&&(t.index=r),new Jr(t)},Bs.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},Bs.prototype.getInfiniteIndex=function(e){return"infiniteScroll"===e.requestType||"delete"===e.requestType||"add"===e.action?q.isNullOrUndefined(e.startIndex)?e.index:e.startIndex:0};var Ns=Bs;function Bs(e){this.parent=e}zs=function(e,t){return(zs=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 zs,e=function(e,t){function i(){this.constructor=e}zs(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},qs=(Us.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},Us.prototype.columnSelector=function(e){return void 0!==e.footerTemplate},Us.prototype.getColumns=function(e){var t=[];if(!this.parent.detailTemplate&&q.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},Us.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},Us.prototype.getGeneratedRow=function(e,t,i,n,r,s,o){for(var a=[],l=this.getIndentByLevel(),h=!q.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)?N.CellType.DetailFooterIntent:N.CellType.Indent,l[parseInt(c.toString(),10)],h));o=new Xr({data:t,attributes:{class:"e-summaryrow"}});return o.cells=a,o.uid=gh("grid-row"),o.parentUid=s,o.isAggregateRow=!0,o.visible=a.some(function(e){return e.isDataCell&&e.visible}),o},Us.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),q.isNullOrUndefined(n)&&r&&(s.class="e-detailindentcelltop"),{visible:t.visible,isDataCell:!q.isNullOrUndefined(e),isTemplate:e&&!q.isNullOrUndefined(e.footerTemplate||e.groupFooterTemplate||e.groupCaptionTemplate),column:e||{},attributes:s,cellType:i});return o.column.headerText=t.headerText,new Jr(o)},Us.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},Us.prototype.getIndentByLevel=function(){return this.parent.groupSettings.columns.map(function(){return"e-indentcelltop"})},Us.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]:yh(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)]]=q.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},Us.prototype.getCellType=function(){return N.CellType.Summary},Us);function Us(e){this.parent=e}e(Vs,Hs=qs),Vs.prototype.columnSelector=function(e){return void 0!==e.groupFooterTemplate},Vs.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"})},Vs.prototype.getCellType=function(){return N.CellType.GroupSummary};var Hs,js=Vs;function Vs(){return null!==Hs&&Hs.apply(this,arguments)||this}e(Ks,Gs=qs),Ks.prototype.columnSelector=function(e){return void 0!==e.groupCaptionTemplate},Ks.prototype.getData=function(){return[Gs.prototype.getData.call(this).reduce(function(e,t){return e.columns=e.columns.concat(t.columns),e},{columns:[]})]},Ks.prototype.isEmpty=function(){return 0===(this.getData()[0].columns||[]).length},Ks.prototype.getCellType=function(){return N.CellType.CaptionSummary};var Gs,_s=Ks;function Ks(){return null!==Gs&&Gs.apply(this,arguments)||this}Ws=function(e,t){return(Ws=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}Ws(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ys,Qs=Ns),Ys.prototype.generateRows=function(e,t){if(0===this.parent.groupSettings.columns.length)return Qs.prototype.generateRows.call(this,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},Ys.prototype.getGroupedRecords=function(e,t,i,n,r,s,o){if(q.isNullOrUndefined(t.items))if(q.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)}},Ys.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},Ys.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},Ys.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,N.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],q.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?N.CellType.GroupCaption:N.CellType.GroupCaptionEmpty);e=this.parent.enableColumnVirtualization&&f===N.CellType.GroupCaption?e+h:e,d.isRowDragable()&&e++,s.push(this.generateCell(a,null,f,e))}return s.push.apply(s,o),s},Ys.prototype.generateCaptionRow=function(e,t,i,n,r,s){var o={},a="records",l=this.parent.getColumnByField(e.field),l=(o.data=q.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=(q.isNullOrUndefined(e.items[a])?e.items:e.items[a]).length,o.uid=gh("grid-row"),new Xr(o));return l.indent=t,this.getForeignKeyData(l),l.cells=this.getCaptionRowCells(e.field,t,l.data),l},Ys.prototype.getForeignKeyData=function(e){var t=e.data,i=this.parent.getColumnByField(t.field);i&&i.isForeignColumn&&i.isForeignColumn()&&(t=q.isNullOrUndefined(t.key)?"":i.valueAccessor(i.foreignKeyValue,jh(i,{},t.key)[0],i),q.setValue("foreignKey",t,e.data))},Ys.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},Ys.prototype.generateIndentCell=function(){return this.generateCell({},null,N.CellType.Indent)},Ys.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},Ys.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)}},Ys.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 Ws,Qs,Xs=Ys;function Ys(e){var t=Qs.call(this,e)||this;return t.rows=[],t.index=0,t.infiniteChildCount=0,t.renderInfiniteAgg=!0,t.parent=e,t.summaryModelGen=new js(e),t.captionModelGen=new _s(e),t}t.prototype.beforeCellFocused=function(e){!e.byKey||"upArrow"!==e.keyArgs.action&&"downArrow"!==e.keyArgs.action?this.pressedKey=void 0:this.pressedKey=e.keyArgs.action},t.prototype.renderPanel=function(){var e,t=this.parent,i=this.parent.element.querySelector("."+is);i?(this.ariaService.setOptions(this.parent.element.querySelector("."+hs),{busy:!1}),this.setPanel(i)):(i=this.parent.createElement("div",{className:is}),e=this.parent.createElement("div",{className:hs}),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))},t.prototype.renderHorizontalScrollbar=function(e){var t=this.parent.createElement("div",{className:"e-movablescrollbar"}),i=this.parent.createElement("div",{className:"e-movablechild"}),n=wh().toString();this.setScrollbarHeight(i,n),this.setScrollbarHeight(t,n),t.appendChild(i),e.appendChild(t)},t.prototype.setScrollbarHeight=function(e,t){e.style.minHeight=t+"px",e.style.maxHeight=t+"px"},t.prototype.renderTable=function(){var e=this.getPanel(),t=e.querySelector(".e-virtualtable"),i=e.querySelector(".e-virtualtrack"),t=(!this.parent.enableVirtualization||q.isNullOrUndefined(t)||q.isNullOrUndefined(i)||(q.remove(t),q.remove(i)),e.querySelector(".e-virtual-vertical-scrollbar")),i=e.querySelector(".e-virtual-horizontal-scrollbar");this.parent.enableVirtualization&&!q.isNullOrUndefined(t)&&q.remove(t),this.parent.enableColumnVirtualization&&!q.isNullOrUndefined(i)&&q.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")},t.prototype.createContentTable=function(e){var t=this.getPanel().firstElementChild,e=(this.getTable()&&q.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(bs).cloneNode(!0)),e.appendChild(this.getColGroup()),e.appendChild(this.parent.createElement(H,{attrs:{role:"rowgroup"}})),t.appendChild(e),t},t.prototype.refreshContentRows=function(l){var t=this,h=(void 0===l&&(l={}),this.parent);if(0!==h.currentViewData.length){h.editSettings&&h.editModule&&"Batch"===h.editSettings.mode&&h.editModule.formObj&&!1===h.editSettings.showConfirmDialog&&h.editModule.destroyForm();var d,p,c,u,g,f=this.currentMovableRows||h.currentViewData,e=h.isReact&&!q.isNullOrUndefined(h.rowTemplate),m=this.parent.printGridParent&&this.parent.printGridParent.isReact,y=e||m?h.createElement(H,{attrs:{role:"rowgroup"}}):document.createDocumentFragment(),S=(this.initialPageRecords||(this.initialPageRecords=q.extend([],f)),e?h.createElement(H,{attrs:{role:"rowgroup"}}):document.createDocumentFragment()),v=((h.isReact||m)&&h.rowTemplate&&(d=y,p=S),h.getColumns()),C=new Ls(this.serviceLocator,null,this.parent),w=this.parent.enableInfiniteScrolling&&"infiniteScroll"===l.requestType,i=this.isInfiniteColumnvirtualization()&&"virtualscroll"!==l.requestType,n=!(!h.enableInfiniteScrolling||!h.childGrid&&!h.detailTemplate),r=n&&("add"===l.action&&"save"===l.requestType||"delete"===l.requestType),b=(r&&(l.startIndex=0,h.notify(_r,{})),w&&(h.childGrid||h.detailTemplate)&&!h.infiniteScrollSettings.enableCache||(n&&(this.parent.infiniteScrollModule.infiniteDetailDestroy=!0),h.notify(Rr,w&&(h.childGrid||h.detailTemplate)&&h.infiniteScrollSettings.enableCache?l:{})),this.rowElements=[],this.rows=[],this.tempFreezeRows=[],!(!this.parent.frozenRows||!this.parent.groupSettings.columns.length)),s=(Kh(h)&&["sorting","filtering","searching","grouping","ungrouping","reorder","save","delete","refresh-aggregate-on-save"].some(function(e){return l.requestType===e})&&this.emptyVcRows(),g=this.checkCache(g,l),h.isRowPinned&&(n=new U.Query,F=(F=this.parent.getDataModule()).pinnedData.executeLocal(F.pinnedDataQuery(n)),h.pinnedTopRowModels=this.generator.generatePinnedTopRows(F)),this.isAddRows||this.useGroupCache||(g=this.generator.generateRows(f,l)),this.setGroupCache(g,l),this.parent.notify(An,{isInfiniteScroll:w,modelData:g,args:l}),this.parent.registeredTemplate);if(this.parent.isAngular&&("infiniteScroll"!==l.requestType||this.parent.infiniteScrollSettings.enableCache)&&s&&s.detailTemplate&&!l.isFrozen&&this.parent.destroyTemplate(["detailTemplate"]),("infiniteScroll"!==l.requestType||this.parent.infiniteScrollSettings.enableCache)&&s&&s.template&&!l.isFrozen){for(var o=[],a=0;a<s.template.length;a++)for(var I=0;I<s.template[parseInt(a.toString(),10)].rootNodes.length;I++)q.isNullOrUndefined(s.template[parseInt(a.toString(),10)].rootNodes[parseInt(I.toString(),10)].parentNode)&&o.push(s.template[parseInt(a.toString(),10)]);this.parent.destroyTemplate(["template"],o)}!this.parent.isReact&&!this.parent.isVue||"infiniteScroll"===l.requestType&&!this.parent.infiniteScrollSettings.enableCache||l.isFrozen||(n=[this.parent.isVue?"template":"columnTemplate","rowTemplate","detailTemplate","captionTemplate","commandsTemplate","groupFooterTemplate","groupCaptionTemplate"],"infiniteScroll"===l.requestType&&this.parent.infiniteScrollSettings.enableCache&&(n=[this.parent.isVue?"template":"columnTemplate","commandsTemplate"]),Gd(this.parent,n));for(a=0;a<h.pinnedTopRowModels.length;a++){var x=C.render(h.pinnedTopRowModels[parseInt(a.toString(),10)],v),R=(Td(x),x.classList.add("e-grid-pin-row"),[].slice.call(x.getElementsByClassName("e-grouptopleftcell")));R.length&&R[R.length-1].classList.add("e-lastgrouptopleftcell"),S.appendChild(x)}this.parent.enableColumnVirtualization&&new $r(this.serviceLocator,this.parent).updateVirtualCells(g),this.tbody=this.getTable().querySelector(H);var T=0,D=!0;if(Kh(h)&&h.vcRows.length){var E=q.isNullOrUndefined(l.virtualInfo.offsets)?q.isNullOrUndefined(l.scrollTop)?0:l.scrollTop.top:l.virtualInfo.offsets.top;if(0!==E){for(var O=h.vGroupOffsets,k=h.pageSettings.pageSize/2,N=Object.keys(O).map(function(e){return O[""+e]}),A=0;A<N.length;A++)if(E<N[parseInt(A.toString(),10)]){if(q.isNullOrUndefined(l.virtualInfo)||"up"!==l.virtualInfo.direction){T=A*k,(this.parent.contentModule.isEndBlock(A)||this.parent.contentModule.isEndBlock(A+1))&&(l.virtualInfo.blockIndexes=[A,A+1]);break}T=0<A?(A-1)*k:A*k;break}Math.round(E+this.contentPanel.firstElementChild.offsetHeight)>=this.contentPanel.firstElementChild.scrollHeight&&!l.rowObject&&(D=!1)}}var F=h.frozenRows&&this.parent.enableVirtualization&&"reorder"===l.requestType;if(h.frozenRows&&"virtualscroll"===l.requestType&&"X"===l.virtualInfo.sentinelInfo.axis||F){var n=l.virtualInfo.blockIndexes,M=l.virtualInfo.page,L=(l.virtualInfo.blockIndexes=[1,2],F&&(l.virtualInfo.page=1),F?this.initialPageRecords:f),B=this.vgenerator.generateRows(L,l);B.splice(this.parent.frozenRows);for(a=0;a<this.parent.frozenRows;a++)Td(c=C.render(B[parseInt(a.toString(),10)],v)),S.appendChild(c);l.virtualInfo.blockIndexes=n,l.virtualInfo.page=M,F&&1===l.virtualInfo.page&&g.splice(0,this.parent.frozenRows)}this.virtualFrozenHdrRefresh(S,g,C,l,f,v),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]=[]),(this.parent.enableInfiniteScrolling&&this.parent.groupSettings.enableLazyLoading&&"delete"===l.requestType||r)&&(this.visibleRows=[]),"paging"===l.requestType&&this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&(this.parent.currentViewData=[]);for(var P=this,a=T,z=g.length;a<z;a++)if("break"===function(t){if(P.rows.push(g[parseInt(t.toString(),10)]),P.parent.groupSettings.enableLazyLoading&&!P.useGroupCache&&P.parent.groupSettings.columns.length&&((P.parent.enableVirtualization?P.parent.lazyLoadRender:P.parent.contentModule).refRowsObj[P.parent.pageSettings.currentPage].push(g[parseInt(t.toString(),10)]),P.setRowsInLazyGroup(g[parseInt(t.toString(),10)],t),q.isNullOrUndefined(g[parseInt(t.toString(),10)].indent)))return"continue";if("paging"===l.requestType&&P.parent.groupSettings.enableLazyLoading&&P.parent.groupSettings.columns.length&&(g[parseInt(t.toString(),10)].isDataRow?P.parent.currentViewData[g[parseInt(t.toString(),10)].index]=g[parseInt(t.toString(),10)].data:g[parseInt(t.toString(),10)].isCaptionRow&&!g.some(function(e){return e.isDataRow})&&P.parent.currentViewData.push(g[parseInt(t.toString(),10)].data)),P.setInfiniteVisibleRows(l,g[parseInt(t.toString(),10)]),Kh(h)&&l.virtualInfo&&l.virtualInfo.blockIndexes&&P.rowElements.length>=l.virtualInfo.blockIndexes.length*P.parent.contentModule.getBlockSize()&&D)return P.parent.currentViewData.records=P.rows.map(function(e){return e.data}),"break";if(h.rowTemplate){var e=h.element.id+"rowTemplate",i=void 0;if(h.isReact||m){var n,r=h.frozenRows&&t<h.frozenRows,s=q.extend({index:t},f[parseInt(t.toString(),10)]);if(h.getRowTemplate()(s,h,"rowTemplate",e,null,null,r?S:y),h.requireTemplateRef)return(n=P).parent.renderTemplates(function(){h.frozenRows&&t<h.frozenRows?c=p.childNodes[parseInt(t.toString(),10)]:u=d.childNodes[parseInt(t.toString(),10)];var e={data:g[parseInt(t.toString(),10)].data,row:u||c};n.parent.trigger(ne,e),(g[parseInt(t.toString(),10)].isDataRow||n.parent.enableVirtualization&&n.parent.groupSettings.enableLazyLoading)&&n.rowElements.push(e.row),n.ariaService.setOptions(n.parent.element,{colcount:h.getColumns().length.toString()}),t===g.length-1&&(p=d=null)}),"continue"}else i=h.getRowTemplate()(q.extend({index:t},f[parseInt(t.toString(),10)]),h,"rowTemplate",e,void 0,void 0,void 0,P.parent.root);if(h.isReact||"TBODY"!==i[0].tagName)h.frozenRows&&t<h.frozenRows?c=h.isReact?S.lastElementChild:fh(S,i):(h.isReact||(c=fh(y,i)),u=(h.isReact?y:c).lastElementChild);else{for(var o=0;o<i.length;o++){var a="tr"===i[parseInt(o.toString(),10)].nodeName.toLowerCase();(a||i[parseInt(o.toString(),10)].querySelectorAll&&i[parseInt(o.toString(),10)].querySelectorAll("tr").length)&&(c=a?i[parseInt(o.toString(),10)]:i[parseInt(o.toString(),10)].querySelector("tr"))}(h.frozenRows&&t<h.frozenRows?S:y).appendChild(c)}s={data:g[parseInt(t.toString(),10)].data,row:u||c};P.parent.trigger(ne,s)}else{Td(c=C.render(g[parseInt(t.toString(),10)],v));r=P.ensureFrozenHeaderRender(l);(h.frozenRows&&(t<h.frozenRows||b)&&!w&&"virtualscroll"!==l.requestType&&r&&P.ensureVirtualFrozenHeaderRender(l)?S:(e=h.getPrimaryKeyFieldNames()[0],s=g[parseInt(t.toString(),10)].data,q.isNullOrUndefined(e)||q.isNullOrUndefined(s)||!h.pinnedTopRowKeys[s[""+e]]||c.classList.add("e-grid-pin-row"),y)).appendChild(c),1+(parseInt(c.getAttribute("aria-rowindex"),10)-1)===h.frozenRows&&(b=!1),g[parseInt(t.toString(),10)].isExpand&&h.notify(Gi,c.cells[h.groupSettings.columns.length])}(g[parseInt(t.toString(),10)].isDataRow||P.parent.enableVirtualization&&P.parent.groupSettings.enableLazyLoading)&&(!q.isNullOrUndefined(h.rowTemplate)&&(h.isAngular||h.isVue3||h.isVue)?P.rowElements.push(u||c):P.rowElements.push(c)),P.ariaService.setOptions(P.parent.element,{colcount:h.getColumns().length.toString()})}(a))break;L=h.parentDetails&&h.parentDetails.parentInstObj&&h.parentDetails.parentInstObj.isReact;!h.isReact&&!L||h.requireTemplateRef||h.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(dr,{rows:(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).refRowsObj[this.parent.pageSettings.currentPage]}),h.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}),((h.frozenRows||h.isRowPinned)&&"virtualscroll"!==l.requestType&&!w&&this.ensureVirtualFrozenHeaderRender(l)||"virtualscroll"===l.requestType&&l.virtualInfo.sentinelInfo&&"X"===l.virtualInfo.sentinelInfo.axis||("virtualscroll"===l.requestType||w||"delete"===l.requestType)&&h.isRowPinned)&&(n=h.getHeaderTable().querySelector(H),(e?(M=n.parentElement,q.remove(n),M):(n.innerHTML="",n)).appendChild(S),h.isInitialLoad||h.scrollModule.setHeight()),l.rows=this.rows.slice(0),Kl(function(){t.parent.notify(zi,l),t.parent.enableVirtualization||t.parent.enableColumnVirtualization&&!i||w||(h.isReact||(t.tbody.innerHTML=""),q.isNullOrUndefined(t.tbody.parentElement)?q.remove(h.getContentTable().querySelector(H)):q.remove(t.tbody),t.tbody=t.parent.createElement(H,{attrs:{role:"rowgroup"}})),h.rowTemplate&&q.updateBlazorTemplate(h.element.id+"rowTemplate","RowTemplate",h),!q.isNullOrUndefined(t.parent.infiniteScrollModule)&&(t.parent.enableInfiniteScrolling&&!t.isInfiniteColumnvirtualization()||i)?(t.isAddRows=!1,t.parent.notify(kn,{args:l}),t.parent.notify(On,{tbody:t.tbody,frag:y,args:l,rows:t.rows,rowElements:t.rowElements,visibleRows:t.visibleRows,tableName:void 0}),t.isInfiniteColumnvirtualization()&&t.parent.isFrozenGrid()&&(e=id(t.parent.getContent().querySelector(".e-virtualtable")),t.parent.contentModule.resetStickyLeftPos(e.width),t.widthService.refreshFrozenScrollbar())):(t.useGroupCache=!1,t.appendContent(t.tbody,y,l)),t.parent.editSettings.showAddNewRow&&(t.parent.enableVirtualization||t.parent.enableInfiniteScrolling)&&(e=t.parent.element.querySelector(".e-addrow-removed"))&&q.remove(e);var e=!t.parent.element.querySelector("."+us);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 l.requestType===e}))&&t.parent.notify(Ur,{}),t.parent.getContent()&&(t.parent.frozenRightCount||t.parent.frozenLeftCount)&&0<rd(t.parent)&&t.parent.scrollModule.updateFrozenShadow(),y=null},this.rafCallback(q.extend({},l)))}},t.prototype.isInfiniteColumnvirtualization=function(){return this.parent.enableColumnVirtualization&&this.parent.enableInfiniteScrolling},t.prototype.enableCacheOnInfiniteColumnVirtual=function(){return this.isInfiniteColumnvirtualization()&&this.parent.infiniteScrollSettings.enableCache},t.prototype.emptyVcRows=function(){this.parent.vcRows=[],this.parent.vRows=[]},t.prototype.appendContent=function(e,t,i,n){if(this.parent.isReact&&!q.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()},t.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)},t.prototype.setGroupCache=function(e,t){!this.useGroupCache&&this.parent.groupSettings.enableLazyLoading&&this.parent.notify(Un,{args:t,data:e})},t.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)},t.prototype.ensureVirtualFrozenHeaderRender=function(e){return!(this.parent.enableVirtualization&&"delete"===e.requestType)},t.prototype.checkCache=function(e,t){var i;return this.parent.infiniteScrollSettings.enableCache&&"infiniteScroll"===t.requestType?(this.isAddRows=!q.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},t.prototype.setInfiniteVisibleRows=function(e,t){!this.parent.enableInfiniteScrolling||this.parent.infiniteScrollSettings.enableCache||this.isInfiniteColumnvirtualization()&&"virtualscroll"===e.requestType||this.visibleRows.push(t)},t.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(T),10)-1,n=Math.ceil((1+i)/this.parent.pageSettings.pageSize),i=parseInt(t[t.length-1].getAttribute(T),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},t.prototype.getReorderedRows=function(e){return this.parent.contentModule.getReorderedFrozenRows(e)},t.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);1===n.virtualInfo.page&&t.splice(0,this.parent.frozenRows)}},t.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},t.prototype.getInfiniteMovableRows=function(){var e=this.getCurrentBlockInfiniteRecords();return this.parent.enableInfiniteScrolling?e.length?e:this.visibleRows:[]},t.prototype.getPanel=function(){return this.contentPanel},t.prototype.setPanel=function(e){this.contentPanel=e},t.prototype.getTable=function(){return this.contentTable},t.prototype.setTable=function(e){this.contentTable=e},t.prototype.getRows=function(){var e=this.getInfiniteRows();return e.length?e:this.rows},t.prototype.getRowElements=function(){return this.rowElements},t.prototype.setRowElements=function(e){this.rowElements=e},t.prototype.getColGroup=function(){return this.colgroup},t.prototype.setColGroup=function(e){return q.isNullOrUndefined(e)||(e.id="content-"+e.id),this.colgroup=e},t.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&&q.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(en,{rows:o,args:{}}),this.parent.editSettings.showAddNewRow&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.notify(Ur,{}))},t.prototype.setDisplayNone=function(e,t,i,n){Bd(e,t,i,n,this.parent,this.parent.isRowDragable()),this.parent.notify(En,{visible:i,index:t,isFreeze:this.isInfiniteFreeze})},t.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},t.prototype.colGroupRefresh=function(){var e;this.getColGroup()&&(e=this.getHeaderColGroup(),this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e))},t.prototype.getHeaderColGroup=function(){return this.parent.element.querySelector("."+ts).querySelector(bs+":not(.e-masked-colgroup)").cloneNode(!0)},t.prototype.initializeContentDrop=function(){var e=this.parent;this.droppable=new q.Droppable(e.element,{accept:".e-dragclone",drop:this.drop})},t.prototype.droppableDestroy=function(){this.droppable&&!this.droppable.isDestroyed&&this.droppable.destroy()},t.prototype.canSkip=function(e,t,i){return q.isNullOrUndefined(t)||q.isNullOrUndefined(e.visible)||t.cells[parseInt(i.toString(),10)].visible===e.visible},t.prototype.getModelGenerator=function(){return this.generator=new(this.parent.allowGrouping?Xs:Ns)(this.parent)},t.prototype.renderEmpty=function(e){this.getTable().appendChild(e),(this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&(this.parent.getHeaderContent().querySelector(H).innerHTML="")},t.prototype.setSelection=function(t,e,i){this.parent.notify(Qn,{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}},t.prototype.getRowByIndex=function(e){return e=this.getInfiniteRowIndex(e),q.isNullOrUndefined(e)?void 0:this.parent.getDataRows()[parseInt(e.toString(),10)]},t.prototype.getInfiniteRowIndex=function(e){var t,i;return this.parent.infiniteScrollSettings.enableCache&&!q.isNullOrUndefined(e)&&(i=e<(t=this.parent.frozenRows)?0:t,i=parseInt(this.parent.getRows()[parseInt(i.toString(),10)].getAttribute(T),10)-1,e=e<t?e:e-i+t),e},t.prototype.getVirtualRowIndex=function(e){return e},t.prototype.enableAfterRender=function(e){"group"===e.module&&e.enable&&(this.generator=this.getModelGenerator())},t.prototype.setRowObjects=function(e){this.rows=e},t.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(H,{attrs:{role:"rowgroup"}}),c=i.currentViewData,u=[].slice.call(this.getTable().querySelector(H).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 S,v,C=r[c[parseInt(m.toString(),10)][""+n]];q.isNullOrUndefined(C)?(v=new Ls(this.serviceLocator,null,i),S={startIndex:m},S=this.generator.generateRows([c[parseInt(m.toString(),10)]],S),s.push(S[0]),v=v.render(S[0],i.getColumns()),p.appendChild(v),this.refreshImmutableContent(m,v,s[parseInt(m.toString(),10)])):(S=!1,this.parent.enableDeepCompare&&(S=this.objectEqualityChecker(this.prevCurrentView[parseInt(C.toString(),10)],c[parseInt(m.toString(),10)])),v=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&&q.isNullOrUndefined(a[l[parseInt(m.toString(),10)]])||!h&&(S||this.prevCurrentView[parseInt(C.toString(),10)]===c[parseInt(m.toString(),10)]))?(C!==m&&this.refreshImmutableContent(m,v,s[parseInt(m.toString(),10)]),p.appendChild(v)):((h&&!q.isNullOrUndefined(a[l[parseInt(m.toString(),10)]])||!this.parent.enableDeepCompare&&c[parseInt(m.toString(),10)]!==this.prevCurrentView[parseInt(C.toString(),10)]||this.parent.enableDeepCompare&&!S)&&o[parseInt(C.toString(),10)].setRowValue(c[parseInt(m.toString(),10)]),p.appendChild(v),this.refreshImmutableContent(m,v,s[parseInt(m.toString(),10)])))}this.rows=s,this.rowElements=[].slice.call(p.children),q.remove(this.getTable().querySelector(H)),this.getTable().appendChild(p),this.parent.trigger(ae,{},function(){t.parent.allowTextWrap&&t.parent.notify(Ci,{case:"textwrap"})}),e&&(y=(e.requestType||"").toLowerCase()+"-complete",this.parent.notify(y,e))}},t.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},t.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(Yn,{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},t.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(T,(e+1).toString()),this.updateCellIndex(t,e)},t.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 Js=t;function t(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(be,{target:e.target,droppedElement:e.droppedElement}),q.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("."+hs),!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(ct,{rows:t,args:a}),l.parent.editSettings.showAddNewRow&&l.parent.addNewRowFocus&&(l.parent.notify(Ur,{}),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(ae,{},function(){e.parent.allowTextWrap&&e.parent.notify(Ci,{case:"textwrap"})})}):l.parent.trigger(ae,{},function(){l.parent.allowTextWrap&&l.parent.notify(Ci,{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(p,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(Bt,this.setVisible,this),this.parent.on(mt,this.colGroupRefresh,this),this.parent.on(g,this.enableAfterRender,this),this.parent.on(xn,this.refreshContentRows,this),this.parent.on(Mt,this.beforeCellFocused,this),this.parent.on(s,this.droppableDestroy,this))}$s.prototype.renderPanel=function(){var e=null!=(t=this.parent.element.querySelector("."+ts)),t=e?t:this.parent.createElement("div",{className:"e-gridheader"}),i=e?t.querySelector("."+rs):this.parent.createElement("div",{className:rs});this.toggleStackClass(t),t.appendChild(i),this.setPanel(t),e||this.parent.element.appendChild(t)},$s.prototype.renderTable=function(){var e=this.getPanel();e.appendChild(this.createHeaderTable()),this.setTable(e.querySelector("."+ds)),this.initializeHeaderDrag(),this.initializeHeaderDrop(),this.parent.notify(yt,{rows:this.rows})},$s.prototype.getPanel=function(){return this.headerPanel},$s.prototype.setPanel=function(e){this.headerPanel=e},$s.prototype.getTable=function(){return this.headerTable},$s.prototype.setTable=function(e){this.headerTable=e},$s.prototype.getColGroup=function(){return this.colgroup},$s.prototype.setColGroup=function(e){return this.colgroup=e},$s.prototype.getRows=function(){return this.getTable().tHead.rows},$s.prototype.createHeaderTable=function(){var e=this.createTable(),t=this.getPanel().querySelector("."+rs);return t.appendChild(e),t},$s.prototype.createHeader=function(e,t){for(var i,n=this.parent,r=(this.getTable()&&q.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(H,{className:this.parent.frozenRows||this.parent.isRowPinned||(this.parent.enableVirtualization||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(bs)),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},$s.prototype.createTable=function(e){return this.createHeader(e=void 0===e?null:e)},$s.prototype.createHeaderContent=function(e){var t,i=this.parent,n=i.getColumns(),r=this.parent.createElement("thead",{attrs:{role:"rowgroup"}}),s=this.parent.createElement("tr",{className:"e-columnheader",attrs:{role:"row"}}),o=new Ls(this.serviceLocator,N.CellType.Header,i),a=(o.element=s,[]);this.colDepth=$h(i.columns);for(var l=0,h=this.colDepth;l<h;l++)a[parseInt(l.toString(),10)]=this.generateRow(l),a[parseInt(l.toString(),10)].cells=[];if(a=this.ensureColumns(a),a=this.getHeaderCells(a,e),i.isRowDragable()&&"Right"===this.parent.getFrozenMode())for(l=0,h=a.length;l<h;l++)a[parseInt(l.toString(),10)].cells.push(this.generateCell({},N.CellType.RowDragHIcon));n.filter(function(e){return e.headerTemplate}).length&&(this.parent.isReact||this.parent.isVue)&&Gd(this.parent,["headerTemplate"]),n&&n.length&&!n[0].visible?this.parent&&this.parent.renderModule&&(this.parent.renderModule.isFirstColumnHidden=!0):this.parent&&this.parent.renderModule&&(this.parent.renderModule.isFirstColumnHidden=!1);for(l=0,h=this.colDepth;l<h;l++)t=o.render(a[parseInt(l.toString(),10)],n),this.parent.rowHeight&&t.querySelector(".e-headercell")&&(t.style.height=this.parent.rowHeight+"px"),Td(t),r.appendChild(t);s=Array.from(r.querySelectorAll(".e-headercell:not(.e-hide)"));return this.parent.allowResizing&&0<s.length&&(r.querySelector(".e-lastcell")&&r.querySelector(".e-lastcell").classList.contains("e-hide")?s[s.length-1].classList.add("e-last-visible-cell"):r.querySelector(".e-laststackcell")&&r.querySelector(".e-laststackcell").classList.contains("e-hide")&&s[s.length-1].classList.add("e-last-visible-stack-cell")),{thead:r,rows:a}},$s.prototype.updateColGroup=function(e){var t,i=this.parent.getColumns(),n=this.parent.getColumnIndexesInView();if(e.id=this.parent.element.id+bs,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&&q.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},$s.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({},N.CellType.HeaderIndent),1<this.colDepth&&(a.rowSpan=o),e[parseInt(n.toString(),10)].cells.push(a));(t.detailTemplate||t.childGrid)&&(this.parent.notify(gn,s={}),a=this.generateCell(s,N.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({},N.CellType.RowDragHIcon),1<this.colDepth&&(a.rowSpan=o),e[parseInt(n.toString(),10)].cells.push(a))}return e},$s.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<(q.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=q.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},$s.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 Jr({cellType:N.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,N.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},$s.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},$s.prototype.getColSpan=function(e,t){return e=this.lockColsRendered?e-t:t},$s.prototype.generateRow=function(e){return new Xr({})},$s.prototype.generateCell=function(e,t,i,n,r,s){e={visible:e.visible,isDataCell:!1,isTemplate:!q.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 Jr(e)},$s.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";q.setStyleAttribute(this.getColGroup().children[parseInt(s.toString(),10)],{display:r}),t.editSettings.showAddNewRow&&t.element.querySelector(".e-addedrow")&&q.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)},$s.prototype.colPosRefresh=function(){this.refreshUI()},$s.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),q.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(bs),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(mt,{}),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(yt,{rows:this.rows}),this.parent.enableColumnVirtualization&&x(t,os)&&this.parent.notify(yt,{rows:this.rows,args:{isFrozen:!1,isXaxis:!0}}),this.parent.allowTextWrap&&"Header"===this.parent.textWrapSettings.wrapMode&&kh(n,!0)}i=this.parent.getHeaderContent().querySelector(".e-headercell:not(.e-hide)");q.isNullOrUndefined(i)||(i.tabIndex=0)},$s.prototype.toggleStackClass=function(e){var t=this.parent.columns;!q.isNullOrUndefined(t)&&t.some(function(e){return!q.isNullOrUndefined(e.columns)})?e.classList.add("e-stackedheader"):e.classList.remove("e-stackedheader")},$s.prototype.appendContent=function(e){this.getPanel().querySelector("."+rs).appendChild(e)},$s.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},$s.prototype.initializeHeaderDrag=function(){var e=this.parent;(this.parent.allowReordering||this.parent.allowGrouping&&this.parent.groupSettings.showDropArea)&&(this.draggable=new q.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))},$s.prototype.initializeHeaderDrop=function(){var e=this.parent;this.droppable=new q.Droppable(e.getHeaderContent(),{accept:".e-dragclone",drop:this.drop}),this.parent.on(s,this.droppableDestroy,this)},$s.prototype.droppableDestroy=function(){this.droppable&&!this.droppable.isDestroyed&&this.droppable.destroy(),this.draggable&&!this.draggable.isDestroyed&&this.draggable.destroy()},$s.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("."+ts))}else e.enableAdaptiveUI&&!e.toolbar&&e.getContent().classList.add("e-responsive-header")},$s.prototype.updateCustomResponsiveToolbar=function(e){var t=this.parent.element.querySelector(".e-responsive-toolbar");"toolbar"===e.module&&(t?q.remove(t):this.renderCustomToolbar())};var Zs=$s;function $s(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=x(i,"e-headercell");if(!t.allowReordering&&!t.allowGrouping||!q.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&&!q.isNullOrUndefined(s.headerTemplate)?(q.isNullOrUndefined(s.headerTemplate)?r.innerHTML=s.headerTemplate:(o=t.getColumnIndexByField(s.field),o=s.getHeaderTemplate()(q.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(),fh(r,o)),q.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(Ce,{target:d.draggable.currentStateTarget,column:d.column,event:e.event})},this.drag=function(e){var t,i=d.parent,n=e.target;n&&(n=q.closest(n,".e-grid"),t=d.parent.element.querySelector(".e-cloneproperties"),n&&n.getAttribute("id")===i.element.getAttribute("id")||(q.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(we,{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",(!x(e.target,"e-headercell")&&!x(e.target,"e-groupdroparea")||!i.allowReordering&&x(e.target,"e-headercell")||!e.helper.getAttribute("data-mappinguid")&&x(e.target,"e-groupdroparea"))&&(q.remove(e.helper),t=!0),i.notify(Vt,{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=q.closest(e.target,".e-grid");q.remove(e.droppedElement),n&&n.getAttribute("id")!==t.element.getAttribute("id")||!t.allowReordering&&!t.allowGrouping||t.notify(Gt,{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(Bt,this.setVisible,this),this.parent.on(Ut,this.colPosRefresh,this),this.parent.on(dt,this.renderCustomToolbar,this),"Vertical"===this.parent.rowRenderingMode&&this.parent.on(g,this.updateCustomResponsiveToolbar,this))}to.prototype.getGui=function(){return""},to.prototype.format=function(e,t,i){var n;return q.isNullOrUndefined(e.format)||("number"===e.type&&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())),q.isNullOrUndefined(t)?"":t.toString()},to.prototype.evaluate=function(e,t,i,n,r,s){var o,a,l,h,d,p,c;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=Jh({},i,((i={})[Mi]=r,i.column=t.column,i)),i=this.parent.element.id+t.column.uid,p="isStringTemplate",a||l||h?(c={index:n[d[0]]},t.column.getColumnTemplate()(q.extend(c,r),this.parent,"columnTemplate",i,this.parent[p],null,e)):o=t.column.getColumnTemplate()(q.extend({index:n[d[0]]},r),this.parent,"template",i,this.parent[p],void 0,void 0,this.parent.root),a||l||h||fh(e,o),this.parent.notify("template-result",{template:o}),o=null,t.column.templateOptions.enableAriaLabel&&e.setAttribute("aria-label",e.innerText+this.localizer.getConstant("TemplateCell")+this.localizer.getConstant("ColumnHeader")+t.column.headerText),!1)},to.prototype.invokeFormatter=function(e,t,i){return t=q.isNullOrUndefined(e.formatter)?t:Gl(e.formatter,"getValue")?(new e.formatter).getValue(e,i):"function"==typeof e.formatter?e.formatter(e,i):e.formatter.getValue(e,i)},to.prototype.render=function(e,t,i,n,r){return this.refreshCell(e,t,i,r)},to.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=(q.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)}}},to.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)},to.prototype.refreshCell=function(e,t,i,n){var r,s,o=this.element.cloneNode(),a=e.column,l=(e.isForeignKey&&(s=e.foreignKeyData&&e.foreignKeyData[0]?e.foreignKeyData[0]:((s={})[a.foreignKeyValue]=a.format?null:"",s)),this.getGui()),h=e.isForeignKey?this.getValue(a.foreignKeyValue,s,a):this.getValue(a.field,t,a),d=("date"!==a.type&&"datetime"!==a.type||q.isNullOrUndefined(h)||(h=new Date(h)),"dateonly"!==a.type||q.isNullOrUndefined(h)||"string"!=typeof h||(d=h.split(/[^0-9.]/),h=new Date(parseInt(d[0],10),parseInt(d[1],10)-1,parseInt(d[2],10))),l=(h=this.format(a,h,t)).toString(),"boolean"!==a.type||a.displayAsCheckBox||(l=(d="true"!==h&&"false"!==h?null:"true"===h?"True":"False")?this.localizer.getConstant(d):l),this.invokeFormatter(a,h,t));return l=q.isNullOrUndefined(a.formatter)?l:q.isNullOrUndefined(d)?"":d.toString(),this.evaluate(o,e,t,i,s,n)&&"checkbox"!==a.type?this.appendHtml(o,this.parent.sanitize(l),a.getDomSetter?a.getDomSetter():"innerHTML"):"checkbox"===a.type&&(o.classList.add(ps),h=!!this.parent.selectionSettings.persistSelection&&"true"===h,r=M.createCheckBox(this.parent.createElement,!1,{checked:h,label:" "}),this.parent.cssClass&&q.addClass([r],[this.parent.cssClass]),this.rowChkBox.id="checkbox-"+e.rowID,r.insertBefore(this.rowChkBox.cloneNode(),r.firstChild),o.appendChild(r)),"Check"===this.parent.checkAllRows&&this.parent.enableVirtualization&&(e.isSelected=!0),this.setAttributes(o,e,i),"boolean"===a.type&&a.displayAsCheckBox&&(d=isNaN(parseInt(h.toString(),10))?"true"===h:0<parseInt(h.toString(),10),r=M.createCheckBox(this.parent.createElement,!1,{checked:d,label:" "}),o.innerHTML="",o.classList.add("e-gridchkbox-cell"),r.classList.add("e-checkbox-disabled"),this.parent.cssClass&&q.addClass([r],[this.parent.cssClass]),o.appendChild(r)),o.classList.contains("e-summarycell")&&!t.key&&(s=o.getAttribute("data-mappinguid"),a=this.parent.getColumnByUid(s),o.setAttribute("aria-label",l+this.localizer.getConstant("ColumnHeader")+e.column.headerText)),!this.parent.isFrozenGrid()||t&&t.key||kd(this.parent,a,o),o},to.prototype.appendHtml=function(e,t,i){return e[""+(i=void 0===i?"innerHTML":i)]=t,e},to.prototype.setAttributes=function(e,t,i){var n=t.column;this.buildAttributeFromCell(e,t,"checkbox"===n.type),ih(e,i),ih(e,t.attributes),n.customAttributes&&ih(e,n.customAttributes),"Vertical"===this.parent.rowRenderingMode&&ih(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")},to.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"),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===N.CellType.Header?n[ws]=t.colIndex+1:q.isNullOrUndefined(t.index)||(n[ws]=t.index+1),t.visible||r.push("e-hide"),n.class=r,ih(e,n)},to.prototype.getValue=function(e,t,i){return i.valueAccessor(e,t,i)};var eo=to;function to(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")}})}no.prototype.setOptions=function(e,t){for(var i=Object.keys(t),n=0;n<i.length;n++)ro(e,so[i[parseInt(n.toString(),10)]],t[i[parseInt(n.toString(),10)]])},no.prototype.setExpand=function(e,t){ro(e,so.expand,t)},no.prototype.setSort=function(e,t){ro(e,so.sort,t,"boolean"==typeof t)},no.prototype.setBusy=function(e,t){ro(e,so.busy,t),ro(e,so.invalid,null,!0)},no.prototype.setGrabbed=function(e,t,i){ro(e,so.grabbed,t,i)},no.prototype.setDropTarget=function(e,t){ro(e,so.dropeffect,"copy",!t)};var io=no;function no(){}function ro(e,t,i,n){n&&e?e.removeAttribute(t):e&&e.setAttribute(t,i)}var so={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"};oo=function(e,t){return(oo=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}oo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ho,ao=eo),ho.prototype.getGui=function(){return this.gui.cloneNode()},ho.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)},ho.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)},ho.prototype.clean=function(e){e.innerHTML=""},ho.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(q.attributes(o,{"data-mappinguid":t.uid,class:"e-headercelldiv"}),q.isNullOrUndefined(t.headerValueAccessor)||(C=this.getValue(t.headerText,t)),this.parent.rowHeight&&this.parent.allowSorting&&t.allowSorting&&!q.isNullOrUndefined(t.field)&&n.classList.add("e-sort-icon"),"checkbox"!==t.type?(w=t.headerText,q.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&&q.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&&!q.isNullOrUndefined(t.field)&&(!this.parent.showColumnMenu||!t.showColumnMenu)){q.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&&ih(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,S,v,C=this.parent,w=C.getColumnIndexByField(t.field),w=(q.isNullOrUndefined(t.headerTemplate)||(o=C.element.id+t.uid+"headerTemplate",c="isStringTemplate",u=t,S=this.parent.isReact&&"string"!=typeof t.headerTemplate&&!(t.headerTemplate.prototype&&t.headerTemplate.prototype.CSPTemplate),g=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,y=this.parent.printGridParent&&this.parent.printGridParent.isReact,f=this.parent.createElement("div",{className:"e-headertext"}),m=n.querySelector(".e-headercelldiv"),S||g||y?(S={index:w},n.querySelector(".e-headertext")&&n.querySelector(".e-headertext").remove(),m.appendChild(f),t.getHeaderTemplate()(q.extend(S,u),C,"headerTemplate",o,this.parent[c],null,m.querySelector(".e-headertext")),this.parent.renderTemplates()):(g=t.getHeaderTemplate()(q.extend({index:w},u),C,"headerTemplate",o,this.parent[c],void 0,void 0,this.parent.root),m.innerHTML="",!q.isNullOrUndefined(g)&&g[0]&&g[0].classList&&g[0].classList.contains("e-headertext")?fh(m,g):(fh(f,g),m.appendChild(f)))),this.ariaService.setOptions(n,r),q.isNullOrUndefined(t.headerTextAlign)&&q.isNullOrUndefined(t.textAlign)||("right"===(y=t.headerTextAlign||t.textAlign).toLowerCase()||"left"===y.toLowerCase()?n.classList.add("right"===y.toLowerCase()?"e-rightalign":"e-leftalign"):"center"===y.toLowerCase()?n.classList.add("e-centeralign"):"justify"===y.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&&((S=this.parent.createElement("span",{id:"headerTitle-"+t.uid,innerHTML:s})).style.display="none",a.appendChild(S),n.setAttribute("aria-describedby",S.id)),n.setAttribute("aria-rowspan",(q.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||w&&this.parent.parentDetails.parentInstObj.requireTemplateRef)&&!q.isNullOrUndefined(t.headerTemplate)?(v=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");v.parent.trigger(se,{cell:i,node:n})}):this.parent.trigger(se,{cell:i,node:n}),this.parent.isFrozenGrid()&&kd(this.parent,t,n),n},ho.prototype.getValue=function(e,t){return t.headerValueAccessor(e,t)},ho.prototype.extendPrepareHeader=function(e,t){if(this.parent.showColumnMenu&&e.showColumnMenu&&!q.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},ho.prototype.appendHtml=function(e,t){return e.appendChild(t),e};var oo,ao,lo=ho;function ho(){var e=null!==ao&&ao.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-headercell",attrs:{tabindex:"-1",role:"columnheader"}}),e.ariaService=new io,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}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=eo),go.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),q.isNullOrUndefined(o.headerTemplate)?this.appendHtml(s,this.parent.sanitize(o.headerText),o.getDomSetter()):fh(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"),q.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&&ih(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"===Rd(o))if(n.classList.add("e-leftfreeze"),"Left"===o.border&&n.classList.add("e-freezeleftborder"),0===o.index)Dd(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()));Dd(n,l,this.parent.enableRtl,"Left")}else if("Right"===Rd(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&&!(Id(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()));Dd(n,l,this.parent.enableRtl,"Right"),"Right"===o.border&&n.classList.add("e-freezerightborder")}else if("Fixed"===Rd(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()));Dd(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(Id(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()))}Dd(n,l-1,this.parent.enableRtl,"Right")}else n.classList.add("e-unfreeze");return n};var po,co,uo=go;function go(){var e=null!==co&&co.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-headercell e-stackedheadercell",attrs:{tabindex:"-1",role:"columnheader"}}),e}fo=function(e,t){return(fo=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}fo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(So,mo=eo),So.prototype.render=function(e,t){var i=this.element.cloneNode();return ih(i,e.attributes),i};var fo,mo,yo=So;function So(){var e=null!==mo&&mo.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-indentcell"}),e}vo=function(e,t){return(vo=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 vo,Co,e=function(e,t){function i(){this.constructor=e}vo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},wo=(e(bo,Co=eo),bo.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(N.CellType.CaptionSummary),q.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&&(q.isNullOrUndefined(a.groupSettings.captionTemplate)?o.innerText+=" "+i[0].textContent:o.appendChild(i[0]))}):i&&i.length&&(r=q.isNullOrUndefined(a.groupSettings.captionTemplate)?i[0].textContent:i))),"break"}(c))break;return q.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,th(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?th(a.groupSettings.captionTemplate)(n,this.parent,"captionTemplate",null,null,null,null,a.root):th(a.groupSettings.captionTemplate)(n),l||h||i||(fh(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},bo);function bo(){var e=null!==Co&&Co.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}e(Ro,Io=eo),Ro.prototype.render=function(e,t){var i=this.element.cloneNode();return i.innerHTML="&nbsp;",i.setAttribute("colspan",e.colSpan.toString()),i};var Io,xo=Ro;function Ro(){var e=null!==Io&&Io.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-groupcaption"}),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)};(function(e,t){function i(){this.constructor=e}To(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Oo,Do=yo),Oo.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=N.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 To,Do,Eo=Oo;function Oo(){return null!==Do&&Do.apply(this,arguments)||this}ko=function(e,t){return(ko=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}ko(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Mo,Ao=eo),Mo.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 ko,Ao,Fo=Mo;function Mo(){var e=null!==Ao&&Ao.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-grouptopleftcell"}),e}Lo=function(e,t){return(Lo=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}Lo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Bo,Po=eo),Bo.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 Lo,Po,No=Bo;function Bo(){var e=null!==Po&&Po.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-detailheadercell"}),e}zo=function(e,t){return(zo=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}zo(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Ho,qo=eo),Ho.prototype.render=function(e,t,i){var n=this.element.cloneNode();return i&&!q.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 zo,qo,Uo=Ho;function Ho(){var e=null!==qo&&qo.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-detailrowcollapse",attrs:{"aria-expanded":"false",tabindex:"-1"}}),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)})(_o,Vo=eo),_o.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"),Dd(i,"Right"===this.parent.getFrozenMode()?0:30*this.parent.groupSettings.columns.length,this.parent.enableRtl,"Right"===this.parent.getFrozenMode()?"Right":"Left")),i};var jo,Vo,Go=_o;function _o(){var e=null!==Vo&&Vo.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-rowdragdrop e-rowdragdropcell",attrs:{tabindex:"-1",role:"gridcell"}}),e}Ko=function(e,t){return(Ko=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}Ko(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Xo,Wo=eo),Xo.prototype.render=function(e,t){var i=this.element.cloneNode();return i.appendChild(q.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"),Dd(i,"Right"===this.parent.getFrozenMode()?0:30*this.parent.groupSettings.columns.length,this.parent.enableRtl,"Right"===this.parent.getFrozenMode()?"Right":"Left")),i};var Ko,Wo,Qo=Xo;function Xo(){var e=null!==Wo&&Wo.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-rowdragheader"}),e}Jo.prototype.render=function(){var e=this.parent;this.headerRenderer=this.renderer.getRenderer(N.RenderType.Header),this.contentRenderer=this.renderer.getRenderer(N.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(),"auto"!==this.parent.height&&this.parent.scrollModule.setPadding(),this.refreshDataManager()},Jo.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(Hi,e),"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),q.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=!q.isNullOrUndefined(i)&&!i.classList.contains("e-hide"))):(n&&n.pageSize&&n.previousPageSize&&n.pageSize!==n.previousPageSize&&r.parent.getDataModule().clearCache(),r.parent.notify(Vr,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))})},Jo.prototype.resetTemplates=function(){var e,t=this.parent,i=t.getColumns();t.detailTemplate&&(e=t.element.id+"detailTemplate",q.blazorTemplates[e]=[],q.resetBlazorTemplate(e,"DetailTemplate")),t.groupSettings.captionTemplate&&q.resetBlazorTemplate(t.element.id+"captionTemplate","CaptionTemplate"),t.rowTemplate&&q.resetBlazorTemplate(t.element.id+"rowTemplate","RowTemplate"),t.toolbarTemplate&&q.resetBlazorTemplate(t.element.id+"toolbarTemplate","ToolbarTemplate"),t.pageSettings.template&&q.resetBlazorTemplate(t.element.id+"_template","pageSettings");for(var n=0;n<i.length;n++)i[parseInt(n.toString(),10)].template&&(q.blazorTemplates[t.element.id+i[parseInt(n.toString(),10)].uid]=[],q.resetBlazorTemplate(t.element.id+i[parseInt(n.toString(),10)].uid,"Template")),i[parseInt(n.toString(),10)].headerTemplate&&q.resetBlazorTemplate(t.element.id+i[parseInt(n.toString(),10)].uid+"headerTemplate","HeaderTemplate"),i[parseInt(n.toString(),10)].filterTemplate&&q.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",q.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",q.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",q.resetBlazorTemplate(o,"GroupCaptionTemplate"))},Jo.prototype.refreshComplete=function(e){this.parent.trigger(p,e)},Jo.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||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(Rn,n),this.emptyGrid=!1,this.isNeedForeignAction()),o=(this.ariaService.setBusy(this.parent.getContent().querySelector("."+hs),!0),s&&(o=new U.Deferred,t=this.getFData(o,n)),t=t?t.then(function(e){var t,i=r.data.generateQuery().requiresCount();return r.emptyGrid?((t=new U.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.data.generateQuery().requiresCount())),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 U.Deferred,t=t.then(function(e){return r.parent.notify(ki,{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)})},Jo.prototype.getFData=function(e,t){return this.parent.notify(ki,{isComplex:!0,promise:e,action:t}),e.promise},Jo.prototype.isNeedForeignAction=function(){var e=this.parent;return!!(e.allowFiltering&&e.filterSettings.columns.length||!q.isNullOrUndefined(e.searchSettings.key)&&e.searchSettings.key.length)&&this.foreignKey(this.parent.getForeignKeyColumns())},Jo.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)})},Jo.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.data.generateQuery().requiresCount();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)})},Jo.prototype.dmSuccess=function(e,t){this.dataManagerSuccess(e,t)},Jo.prototype.dmFailure=function(e,t){this.dataManagerFailure(e,t)},Jo.prototype.renderEmptyRow=function(){this.emptyRow(!0)},Jo.prototype.emptyRow=function(e){var t,i,n=this.parent,r=this.contentRenderer.getTable().querySelector(H),s=(q.isNullOrUndefined(r)||q.remove(r),r=this.parent.createElement(H,{attrs:{role:"rowgroup"}}),n.allowRowDragAndDrop&&q.isNullOrUndefined(n.rowDropSettings.targetID)?1:0),o=((n.detailTemplate||n.childGrid)&&++s,n.editSettings.showAddNewRow&&"Bottom"===n.editSettings.newRowPosition?"e-emptyrow e-show-added-row":"e-emptyrow"),o=this.parent.createElement("tr",{className:o,attrs:{role:"row"}});n.emptyRecordTemplate?(t=n.element.id+"emptyRecordTemplate",i=this.parent.createElement("td",{attrs:{colspan:(n.getVisibleColumns().length+s+n.groupSettings.columns.length).toString()}}),n.isVue||n.parentDetails&&n.parentDetails.parentInstObj&&n.parentDetails.parentInstObj.isVue?i.appendChild(n.getEmptyRecordTemplate()(n.dataSource,n,"emptyRecordTemplate",t,void 0,void 0,void 0,this.parent.root)[1]):i.appendChild(n.getEmptyRecordTemplate()(n.dataSource,n,"emptyRecordTemplate",t,void 0,void 0,void 0,this.parent.root)[0]),n.isReact&&this.parent.renderTemplates()):i=this.parent.createElement("td",{innerHTML:this.l10n.getConstant("EmptyRecord"),attrs:{colspan:(n.getVisibleColumns().length+s+(q.isNullOrUndefined(n.groupSettings.columns)?0:n.groupSettings.columns.length)).toString()}}),n.isFrozenGrid()&&(i.classList.add("e-leftfreeze"),i.style.left="0px"),(n.frozenRows||n.pinnedTopRowModels.length)&&n.element.querySelector(".e-frozenrow-border")&&this.parent.element.querySelector(".e-frozenrow-border").classList.add("e-frozenrow-empty"),o.appendChild(i),r.appendChild(o),this.contentRenderer.renderEmpty(r),e&&(!this.parent.isInitialLoad&&this.parent.focusModule&&this.parent.focusModule.setFirstFocusableTabIndex(),this.parent.trigger(ae,{}),this.parent.notify(ut,{rows:[new Xr({isDataRow:!0,cells:[new Jr({isDataCell:!0,visible:!0})]})]}),n.editSettings.showAddNewRow)&&(n.addRecord(),this.parent.notify(Ur,{}))},Jo.prototype.dynamicColumnChange=function(){this.parent.getCurrentViewRecords().length&&this.updateColumnType(this.parent.getCurrentViewRecords()[0])},Jo.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=Wh(t[parseInt(o.toString(),10)].field||"",r),q.isNullOrUndefined(t[parseInt(o.toString(),10)][i])||(t[parseInt(o.toString(),10)].format=t[parseInt(o.toString(),10)][i]),q.isNullOrUndefined(t[parseInt(o.toString(),10)].validationRules)||q.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=Wh(t[parseInt(o.toString(),10)].foreignKeyValue||"",t[parseInt(o.toString(),10)].columnData[0])),q.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 V;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||!q.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(q.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?Ah(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",Ah(this.locator,t[parseInt(o.toString(),10)]))}},Jo.prototype.dataManagerSuccess=function(a,l){var h=this,d=this.parent,e=(this.contentRenderer=this.renderer.getRenderer(N.RenderType.Content),this.headerRenderer=this.renderer.getRenderer(N.RenderType.Header),a.actionArgs=l,!(!d.childGrid&&!d.detailTemplate)),p=this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&!d.groupSettings.enableLazyLoading&&("delete"===l.requestType&&!e||"save"===l.requestType&&"add"===this.parent.infiniteScrollModule.requestType&&!(d.sortSettings.columns.length||d.filterSettings.columns.length||this.parent.groupSettings.columns.length||d.searchSettings.key||e));d.trigger(_e,a,function(e){if(!e.cancel){e.result=q.isNullOrUndefined(e.result)?[]:e.result;var t=Object.keys(e.result).length;if(!h.parent.isDestroyed)if(d.getColumns().length||t||d.columns.length&&d.columns[0]instanceof Q){var i;d.isRowSelectable&&(d.notify(Kr,i={e:e,isResetPartialRecords:!1}),!d.isInitialLoad||h.parent.isRemote()||"add"===l.action&&"save"===l.requestType||"batchsave"===l.requestType||i.isResetPartialRecords)&&(n=d.getDataModule().isRemote()||!q.isNullOrUndefined(d.dataSource)&&d.dataSource.result?e.result:d.getDataModule().dataManager.executeLocal(d.getDataModule().generateQuery(!0)),d.isTreeGrid&&!h.parent.isRemote()?h.resetPartialRecords():h.setPartialRecord(n));if(d.isRowPinned&&(!d.isInitialLoad||d.getDataModule().isRemote()&&l.requestType&&-1!==["virtualscroll","infiniteScroll","grouping","paging","sorting","filtering"].indexOf(l.requestType))){for(var n=d.getDataModule().isRemote()||!q.isNullOrUndefined(d.dataSource)&&d.dataSource.result?e.result:d.dataSource,r=h.parent.getPrimaryKeyFieldNames()[0],s=0;s<n.length;s++){var o=n[parseInt(s.toString(),10)];!d.pinnedTopRowKeys[o[""+r]]&&d.isRowPinned(o)&&(d.pinnedTopRecords.push(o),d.pinnedTopRowKeys[n[parseInt(s.toString(),10)][""+r]]=!0)}d.getDataModule().pinnedData=new U.DataManager(d.pinnedTopRecords)}!h.parent.isReact||q.isNullOrUndefined(l)||"infiniteScroll"===l.requestType&&!h.parent.infiniteScrollSettings.enableCache||l.isFrozen?h.extendDataManagerSuccess(a,l,t,e,p):(i=["columnTemplate","rowTemplate","detailTemplate","captionTemplate","commandsTemplate","groupFooterTemplate","groupCaptionTemplate"],"infiniteScroll"===l.requestType&&h.parent.infiniteScrollSettings.enableCache&&(i=["columnTemplate","commandsTemplate"]),Gd(h.parent,i,function(){h.extendDataManagerSuccess(a,l,t,e,p)}))}else d.hideSpinner()}})},Jo.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=np(this.parent),this.setPartialRecord(e)))},Jo.prototype.setPartialRecord=function(e){var t=this.parent.getPrimaryKeyFieldNames()[0],i=this.parent.allowGrouping&&!q.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)?this.selectableDataKey.hasOwnProperty(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,this.nonselectableDataKey.hasOwnProperty(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}},Jo.prototype.extendDataManagerSuccess=function(e,t,i,n,r){var s=this.parent;if(this.isInfiniteEnd(t)&&!i)this.parent.notify(Fn,{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(wn,{}),this.parent.notify(Zt,{}),t&&("infiniteScroll"!==t.requestType&&"delete"!==t.requestType&&"add"!==t.action||!s.enableInfiniteScrolling)&&this.parent.notify(Fr,{type:"refreshCommandColumn"}),this.contentRenderer.prevCurrentView=!q.isNullOrUndefined(this.parent.currentViewData)&&this.parent.currentViewData.slice(),s.currentViewData=n.result,s.notify(tr,{args:t,data:n.result}),n.count&&!s.allowPaging&&(s.enableVirtualization||s.enableInfiniteScrolling)&&(s.totalDataRecordsCount=n.count),n.actual&&!q.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(xt,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{if((s.getColumns().length||!i)&&this.isLayoutRendered||Kh(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||q.isNullOrUndefined(t)||"infiniteScroll"===t.requestType||t.isFrozen||Gd(this.parent,["footerTemplate"]),this.parent.isAngular&&this.parent.allowGrouping&&this.parent.groupSettings.captionTemplate&&(q.isNullOrUndefined(t)||"infiniteScroll"!==t.requestType)&&this.parent.destroyTemplate(["groupSettings_captionTemplate"]),this.parent.notify(pt,q.extend({count:n.count,result:n.result,aggregates:n.aggregates,loadSummaryOnEmpty:!1},t)),(s.groupSettings.columns.length||t&&"ungrouping"===t.requestType)&&t&&"filtering"!==t.requestType&&this.headerRenderer.refreshUI(),i)Kh(s)&&(t.scrollTop={top:this.contentRenderer.content.scrollTop}),r?this.parent.notify(Fn,{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("."+hs),!1),s.removeMaskRow(),this.renderEmptyRow(),s.enableColumnVirtualization&&!i&&this.parent.notify(ct,{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(p,t)),this.parent.autoFit&&this.parent.preventAdjustColumns(),this.parent.hideSpinner()}this.parent.notify(Xt,{}),this.setRowCount(this.parent.getCurrentViewRecords().length),"query"in e&&(this.parent.getDataModule().isQueryInvokedFromData=!1)}},Jo.prototype.dataManagerFailure=function(e,t){q.isNullOrUndefined(this.parent.contentModule)||(this.ariaService.setOptions(this.parent.getContent().querySelector("."+hs),{busy:!1,invalid:!0}),this.setRowCount(1)),this.parent.trigger(oe,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}))},Jo.prototype.setRowCount=function(e){this.ariaService.setOptions(this.parent.element,{rowcount:e?e.toString():"1"})},Jo.prototype.isInfiniteEnd=function(e){return this.parent.enableInfiniteScrolling&&!this.parent.infiniteScrollSettings.enableCache&&"delete"===e.requestType},Jo.prototype.updatesOnInitialRender=function(e){var t=!(this.isLayoutRendered=!0);this.parent.columns.length<1&&(this.buildColumns(e.result[0]),t=!0),sh(this.parent.columns,null,this.parent),t&&this.parent.notify(Br,{}),this.headerRenderer.renderTable(),this.contentRenderer.renderTable(),this.parent.isAutoGen=!0,this.parent.notify(Jt,{})},Jo.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++)},Jo.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=q.isNullOrUndefined(t[parseInt(r.toString(),10)].width)?200:t[parseInt(r.toString(),10)].width);this.parent.setProperties({columns:t},!0)},Jo.prototype.instantiateRenderer=function(){this.renderer.addRenderer(N.RenderType.Header,new Zs(this.parent,this.locator)),this.renderer.addRenderer(N.RenderType.Content,new Js(this.parent,this.locator));var e=this.locator.getService("cellRendererFactory");e.addCellRenderer(N.CellType.Header,new lo(this.parent,this.locator)),e.addCellRenderer(N.CellType.Data,new eo(this.parent,this.locator)),e.addCellRenderer(N.CellType.StackedHeader,new uo(this.parent,this.locator)),e.addCellRenderer(N.CellType.Indent,new yo(this.parent,this.locator)),e.addCellRenderer(N.CellType.GroupCaption,new wo(this.parent,this.locator)),e.addCellRenderer(N.CellType.GroupCaptionEmpty,new xo(this.parent,this.locator)),e.addCellRenderer(N.CellType.Expand,new Eo(this.parent,this.locator)),e.addCellRenderer(N.CellType.HeaderIndent,new Fo(this.parent,this.locator)),e.addCellRenderer(N.CellType.StackedHeader,new uo(this.parent,this.locator)),e.addCellRenderer(N.CellType.DetailHeader,new No(this.parent,this.locator)),e.addCellRenderer(N.CellType.RowDragHIcon,new Qo(this.parent,this.locator)),e.addCellRenderer(N.CellType.DetailExpand,new Uo(this.parent,this.locator)),e.addCellRenderer(N.CellType.DetailFooterIntent,new yo(this.parent,this.locator)),e.addCellRenderer(N.CellType.RowDragIcon,new Go(this.parent,this.locator))},Jo.prototype.addEventListener=function(){var e=this;this.parent.isDestroyed||(this.parent.on(ht,this.instantiateRenderer,this),this.parent.on("refreshdataSource",this.dataManagerSuccess,this),this.parent.on(ft,this.refresh,this),this.parent.on(Kt,this.refreshComplete,this),this.parent.on(Yt,this.sendBulkRequest,this),this.parent.on(Fi,function(){e.emptyGrid=!0},this),this.parent.on(Jt,this.dynamicColumnChange,this))},Jo.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 U.Predicate("field","==",t[parseInt(i.toString(),10)].field).and(n.getPredicate("key","equal",t[parseInt(i.toString(),10)].key)));e.where(U.Predicate.or(a))}var s=t.result[0],o=t.result[parseInt(r.toString(),10)],a=[],i=new U.Query;e(i);var l=new U.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(U.Predicate.or(h))}else e(i);var c=new U.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},Jo.prototype.getPredicate=function(e,t,i){return i instanceof Date?_h({field:e,operator:t,value:i}):new U.Predicate(e,t,i)},Jo.prototype.updateGroupInfo=function(e,t){for(var i=new U.DataManager(t),n=e,r=0;r<n.length;r++){var s=i.executeLocal((new U.Query).where(new U.Predicate("field","==",n[parseInt(r.toString(),10)].field).and(this.getPredicate("key","equal",n[parseInt(r.toString(),10)].key))))[0];if(!q.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(),S=o.level?a.records:s.items,v=this.parent;"Custom"===u[parseInt(g.toString(),10)]?(f=o.level?a:s,"string"==typeof(m=c.customAggregate)&&(m=q.getValue(m,window)),n[parseInt(r.toString(),10)].aggregates[y]=m?m.call(v,f,d.columns[parseInt(p.toString(),10)]):""):n[parseInt(r.toString(),10)].aggregates[y]=U.DataUtil.aggregates[u[parseInt(g.toString(),10)].toLowerCase()](S,d.columns[parseInt(p.toString(),10)].field)}}}return e};var Yo=Jo;function Jo(e,t){this.emptyGrid=!1,this.counter=0,this.selectableDataKey={},this.nonselectableDataKey={},this.isFirstColumnHidden=!1,this.parent=e,this.locator=t,this.data=new Wr(e,t),this.l10n=t.getService("localization"),this.ariaService=this.locator.getService("ariaService"),this.renderer=this.locator.getService("rendererFactory"),this.addEventListener()}$o.prototype.addCellRenderer=function(e,t){e="string"==typeof e?e:q.getEnumValue(N.CellType,e),q.isNullOrUndefined(this.cellRenderMap[""+e])&&(this.cellRenderMap[""+e]=t)},$o.prototype.getCellRenderer=function(e){if(e="string"==typeof e?e:q.getEnumValue(N.CellType,e),q.isNullOrUndefined(this.cellRenderMap[""+e]))throw"The cellRenderer "+e+" is not found";return this.cellRenderMap[""+e]};var Zo=$o;function $o(){this.cellRenderMap={}}i.prototype.addEventListener=function(){this.evtHandlers=[{event:nr,handler:this.closeCustomDialog},{event:rr,handler:this.refreshCustomFilterOkBtn},{event:or,handler:this.renderResponsiveContextMenu},{event:ar,handler:this.renderCustomFilterDiv},{event:lr,handler:this.customExFilterClose},{event:sr,handler:this.refreshCustomFilterClearBtn}],zd(this.parent,this.evtHandlers,!0,this),this.onActionCompleteFn=this.editComplate.bind(this),this.parent.addEventListener(p,this.onActionCompleteFn)},i.prototype.customExFilterClose=function(){this.isCustomDlgRender=!1},i.prototype.renderCustomFilterDiv=function(){var e,t;q.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))},i.prototype.renderResponsiveContextMenu=function(e){var t,i,n,r,s;this.action!==N.ResponsiveDialogAction.isFilter||q.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="",q.remove(this.backBtn.element),i.style.display="",this.saveBtn.element.style.display="",this.isFiltered&&(this.filterClearBtn.element.style.display=""),n.innerHTML=this.getHeaderTitle({action:N.ResponsiveDialogAction.isFilter},e.col)))},i.prototype.refreshCustomFilterClearBtn=function(e){this.filterClearBtn&&(this.isFiltered=e.isFiltered,this.filterClearBtn.element.style.display=e.isFiltered?"":"none")},i.prototype.refreshCustomFilterOkBtn=function(e){this.saveBtn&&(this.saveBtn.disabled=e.disabled),this.parent.columnChooserModule&&this.parent.columnChooserModule.responsiveDialogRenderer&&this.parent.columnChooserModule.responsiveDialogRenderer.saveBtn&&(this.parent.columnChooserModule.responsiveDialogRenderer.saveBtn.disabled=e.disabled)},i.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)},i.prototype.renderResponsiveContent=function(e,t){var i=this,n=this.parent,r=this.action===N.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===N.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===N.ResponsiveDialogAction.isSort,c=this.action===N.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),q.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 q.EventHandler.add(this.customColumnDiv,q.Browser.isDevice?"touchend":"click",this.customFilterColumnClickHandler,this),this.customColumnDiv},i.prototype.getSortedFieldsAndDirections=function(e){for(var t=[],i=0;i<this.parent.sortSettings.columns.length;i++)t.push(this.parent.sortSettings.columns[parseInt(i.toString(),10)][""+e]);return t},i.prototype.sortButtonClickHandler=function(e){var t,i,n;e&&(t=x(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))},i.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"))},i.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}))},i.prototype.getCurrentSortedFields=function(){for(var e=[],t=0;t<this.sortedCols.length;t++)e.push(this.sortedCols[parseInt(t.toString(),10)]);return e},i.prototype.customFilterColumnClickHandler=function(e){var t,i,n,r=this.parent,s=e.target;x(s,"columnmenudiv")&&this.action===N.ResponsiveDialogAction.isColMenu&&!x(s,"e-disabled")&&(t=this.menuCol||this.filteredCol,x(s,"e-responsiveautofitalldiv")?(r.autoFitColumns([]),this.closeCustomFilter()):x(s,"e-responsiveautofitdiv")?(r.autoFitColumns(t.field),this.closeCustomFilter()):x(s,"e-responsivegroupdiv")?(r.groupColumn(t.field),this.closeCustomFilter()):x(s,"e-responsiveungroupdiv")?(r.ungroupColumn(t.field),this.closeCustomFilter()):x(s,"e-responsiveascendingdiv")?(r.sortColumn(t.field,"Ascending"),this.closeCustomFilter()):x(s,"e-responsivedescendingdiv")?(r.sortColumn(t.field,"Descending"),this.closeCustomFilter()):x(s,"e-responsivecolumndiv")?(r.notify(zr,{action:5}),r.showResponsiveCustomColumnChooser()):x(s,"e-responsivefilterdiv")&&(r.notify(zr,{action:3}),this.isRowResponsive=!0,this.isCustomDialog=!1,r.filterModule)&&r.filterModule.responsiveDialogRenderer.showResponsiveDialog(t),e.preventDefault()),this.action===N.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=x(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),q.isNullOrUndefined(this.parent.filterModule.filterModule)?this.parent.filterModule.clearFiltering([i]):this.parent.filterModule.filterModule.clearCustomFilter(n),this.removeCustomDlgFilterEle(s)))},i.prototype.showResponsiveDialog=function(e,t){if(this.isCustomDialog&&this.action===N.ResponsiveDialogAction.isFilter&&!this.isRowResponsive||t&&this.action===N.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===N.ResponsiveDialogAction.isColumnChooser&&this.parent.notify(qr,{action:"open"}),this.action===N.ResponsiveDialogAction.isSort){t={cancel:!1,dialogObj:this.customResponsiveDlg,requestType:"beforeOpenAptiveSortDialog"};if(this.parent.trigger(We,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&&("CheckBox"===this.parent.filterSettings.type?this.parent.filterModule.filterModule.checkBoxBase:this.parent.filterModule.filterModule.excelFilterBase).showMask()}},i.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")},i.prototype.renderCustomFilterDialog=function(e,t){var i,n=this.parent,r=this.action===N.ResponsiveDialogAction.isColMenu;this.action===N.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(We,r),r.cancel)||(this.customFilterDlg.appendTo(n),this.customFilterDlg.show(!0),this.customFilterDlg.element.style.maxHeight="100%")},i.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===N.ResponsiveDialogAction.isColMenu?"e-customcolumnmenu ":"",n.cssClass=t+"e-customfilter"):(n.header=this.renderResponsiveHeader(e),n.cssClass="Vertical"===this.parent.rowRenderingMode&&this.action===N.ResponsiveDialogAction.isFilter?"e-res"+i+" e-row-responsive-filter":"e-res"+i),n},i.prototype.renderResponsiveDialog=function(e){var t,i,n=this.parent;this.action===N.ResponsiveDialogAction.isFilter&&"FilterBar"===n.filterSettings.type||(t=this.action===N.ResponsiveDialogAction.isFilter?"filter":"sort",t=this.action===N.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),Cd(n,this.customResponsiveDlg),this.customResponsiveDlg.appendTo(i))},i.prototype.dialogCreated=function(){Pd(this.parent)},i.prototype.dialogOpen=function(){if(this.action===N.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})}},i.prototype.beforeDialogClose=function(e){var t;this.isDialogClose=e.element&&!e.element.querySelector(".e-xl-customfilterdiv")&&e.element.classList.contains("e-resfilterdiv"),this.action===N.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(zr,{action:4}),t=document.querySelector(".e-resfilter"))&&q.remove(t)):this.action===N.ResponsiveDialogAction.isSort?this.closeCustomDialog():this.action===N.ResponsiveDialogAction.isColMenu?(this.closeCustomFilter(),(t=document.querySelector(".e-rescolummenu"))&&q.remove(t)):this.action===N.ResponsiveDialogAction.isColumnChooser&&(this.parent.notify(qr,{action:"clear"}),(t=document.querySelector(".e-rescolumnchooser"))&&q.remove(t),"Horizontal"===this.parent.rowRenderingMode&&this.parent.showColumnMenu&&this.parent.notify(zr,{action:4}),this.isCustomDialog=!1,this.isDialogClose=!1),this.parent.off(cr,this.keyHandler)},i.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()},i.prototype.getHeaderTitle=function(e,t){var i,n=this.parent;return this.action===N.ResponsiveDialogAction.isEdit?i=n.localeObj.getConstant("EditFormTitle")+e.primaryKeyValue[0]:this.action===N.ResponsiveDialogAction.isAdd?i=n.localeObj.getConstant("AddFormTitle"):this.action===N.ResponsiveDialogAction.isFilter?i=t?t.headerText||t.field:n.localeObj.getConstant("FilterTitle"):this.action===N.ResponsiveDialogAction.isSort?i=n.localeObj.getConstant("Sort"):this.action===N.ResponsiveDialogAction.isColMenu?i=n.localeObj.getConstant("ColumnMenu"):this.action===N.ResponsiveDialogAction.isColumnChooser&&(i=n.localeObj.getConstant("ChooseColumns")),i},i.prototype.getDialogName=function(e){var t;return e===N.ResponsiveDialogAction.isAdd||e===N.ResponsiveDialogAction.isEdit?t="dialogEdit_wrapper_title":e===N.ResponsiveDialogAction.isFilter?t="responsive_filter_dialog_wrapper":e===N.ResponsiveDialogAction.isColumnChooser&&(t="responsive_column_chooser_dialog_wrapper"),t},i.prototype.getButtonText=function(e){var t;return e===N.ResponsiveDialogAction.isAdd||e===N.ResponsiveDialogAction.isEdit?t="Save":e!==N.ResponsiveDialogAction.isFilter&&this.action!==N.ResponsiveDialogAction.isSort&&e!==N.ResponsiveDialogAction.isColumnChooser&&this.action!==N.ResponsiveDialogAction.isColumnChooser||(t="OKButton"),t},i.prototype.renderResponsiveHeader=function(e,t,i){var n,r,s=this,o=this.parent,a=(o.on(cr,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===N.ResponsiveDialogAction.isSort,((r=this.action===N.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){x(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)},i.prototype.filterClear=function(){this.parent.filterModule.filterModule.clearCustomFilter(this.filteredCol),this.parent.filterModule.filterModule.closeResponsiveDialog()},i.prototype.removeCustomFilterElement=function(){var e=document.getElementById(this.parent.element.id+"customcolumnmenu"),e=(e&&(q.remove(e),e=document.querySelector(".e-customfilter"))&&q.remove(e),document.querySelector(".e-rescolumnchooser"));e&&q.remove(e)},i.prototype.hideResponsiveColumnChooser=function(){var e=document.querySelector(".e-rescolumnchooser");e&&(q.remove(e),this.isCustomDialog=!1,this.isDialogClose=!1)},i.prototype.dialogHdrBtnClickHandler=function(){this.action===N.ResponsiveDialogAction.isEdit||this.action===N.ResponsiveDialogAction.isAdd?this.parent.endEdit():this.action===N.ResponsiveDialogAction.isFilter?(this.parent.filterModule.filterModule.applyCustomFilter({col:this.filteredCol,isCustomFilter:this.isCustomDlgRender}),this.removeCustomFilterElement()):this.action===N.ResponsiveDialogAction.isSort?(this.sortColumn(),this.removeCustomFilterElement()):this.action===N.ResponsiveDialogAction.isColumnChooser&&(this.parent.notify(qr,{action:"confirm"}),this.removeCustomFilterElement(),this.isCustomDialog=!1,this.isDialogClose=!1)},i.prototype.closeCustomDialog=function(){var e;this.isCustomDlgRender?(e=this.customResponsiveDlg.element.querySelector(".e-mainfilterdiv"),q.remove(e)):(this.isRowResponsive=!1,this.isCustomDlgRender=!1,this.destroyCustomFilterDialog())},i.prototype.destroyCustomFilterDialog=function(){var e;this.customResponsiveDlg&&(e=document.getElementById(this.customResponsiveDlg.element.id),this.customResponsiveDlg&&!this.customResponsiveDlg.isDestroyed&&e&&(this.customResponsiveDlg.destroy(),q.remove(e)),this.closeCustomFilter(),this.action===N.ResponsiveDialogAction.isSort)&&(this.sortPredicate=[],this.sortedCols=[],this.isSortApplied=!1)},i.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(),q.remove(e)),this.isCustomDialog=!1,this.isDialogClose=!1},i.prototype.removeCustomDlgFilterEle=function(e){if(e)e.parentElement.classList.contains("e-filtersetdiv")?q.remove(e.parentElement):q.remove(e);else for(var t=this.customColumnDiv.children,i=0;i<t.length;i++)(e=t[parseInt(i.toString(),10)].querySelector(".e-filtersetdiv"))&&(q.remove(e),i--)},i.prototype.keyHandler=function(e){13===e.keyCode&&(this.action===N.ResponsiveDialogAction.isFilter&&e.target.classList.contains("e-searchinput")||this.action===N.ResponsiveDialogAction.isEdit||this.action===N.ResponsiveDialogAction.isAdd)&&this.dialogHdrBtnClickHandler()},i.prototype.editComplate=function(e){"save"!==e.requestType&&"cancel"!==e.requestType||this.parent.off(cr,this.keyHandler)},i.prototype.removeEventListener=function(){this.customColumnDiv&&q.EventHandler.remove(this.customColumnDiv,q.Browser.isDevice?"touchend":"click",this.customFilterColumnClickHandler),zd(this.parent,this.evtHandlers,!0,this),this.parent.removeEventListener(p,this.onActionCompleteFn)};var ea=i;function i(e,t){this.sortedCols=[],this.sortPredicate=[],this.isCustomDialog=!1,this.parent=e,this.serviceLocator=t,this.addEventListener()}ia.prototype.register=function(e,t){q.isNullOrUndefined(this.services[""+e])&&(this.services[""+e]=t)},ia.prototype.getService=function(e){if(q.isNullOrUndefined(this.services[""+e]))throw"The service "+e+" is not registered";return this.services[""+e]},ia.prototype.registerAdaptiveService=function(e,t,i){t?(e.responsiveDialogRenderer=new ea(e.parent,e.serviceLocator),e.responsiveDialogRenderer.action=i):e.responsiveDialogRenderer&&(e.responsiveDialogRenderer.removeEventListener(),e.responsiveDialogRenderer=void 0)};var ta=ia;function ia(){this.services={}}ra.prototype.addRenderer=function(e,t){e=q.getEnumValue(N.RenderType,e);q.isNullOrUndefined(this.rendererMap[""+e])&&(this.rendererMap[""+e]=t)},ra.prototype.getRenderer=function(e){e=q.getEnumValue(N.RenderType,e);if(q.isNullOrUndefined(this.rendererMap[""+e]))throw"The renderer "+e+" is not found";return this.rendererMap[""+e]};var na=ra;function ra(){this.rendererMap={}}oa.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!q.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&&q.addClass([o,a],["e-tableborder"])},oa.prototype.setMinwidthBycalculation=function(e){var t=this,i=0,n=this.parent.getColumns().filter(function(e){return t.parent.allowResizing?(q.isNullOrUndefined(e.width)||"auto"===e.width)&&q.isNullOrUndefined(e.maxWidth):q.isNullOrUndefined(e.width)||"auto"===e.width});if(n.length){for(var i=q.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=n;s<o.length;s++){var a=o[s];r+=q.isNullOrUndefined(a.minWidth)?0:"string"==typeof a.minWidth?parseInt(a.minWidth,10):a.minWidth}for(var l=0;l<n.length;l++){0===e&&this.parent.allowResizing&&this.isWidthUndefined()&&l!==n.length-1&&this.setUndefinedColumnWidth(n);var h=this.parent.getColumnIndexByField(n[parseInt(l.toString(),10)].field)+this.parent.getIndentCount();0!==e&&i<r?this.setWidth(n[parseInt(l.toString(),10)].minWidth,h):0!==e&&r<i&&this.setWidth("",h,!0)}}},oa.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)))},oa.prototype.setColumnWidth=function(e,t,i){var n,r,s;this.parent.getColumns().length<1||(t=q.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})))},oa.prototype.setWidth=function(e,t,i){!(this.parent.groupSettings.columns.length>t&&gd(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=q.formatUnit(e),n=n.querySelector(bs).children[parseInt(t.toString(),10)],n=(n&&!i?n.style.width=e:n&&i&&(n.style.width=""),r.querySelector(bs).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(x(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()},oa.prototype.refreshFrozenScrollbar=function(){var e,t,i,n={cancel:!1};this.parent.notify($n,n),n.cancel||(n=wh(),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")},oa.prototype.getSiblingsHeight=function(e){return this.getHeightFromDirection(e,"previous")+this.getHeightFromDirection(e,"next")},oa.prototype.getHeightFromDirection=function(e,t){for(var i=e[t+"ElementSibling"],n=0,r=[ts,ns,"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},oa.prototype.isWidthUndefined=function(){var e=this.parent.getColumns().filter(function(e){return q.isNullOrUndefined(e.width)&&q.isNullOrUndefined(e.minWidth)}).length;return this.parent.getColumns().length===e},oa.prototype.getWidth=function(e){var t;return this.parent.allowResizing&&q.isNullOrUndefined(e.width)&&(q.isNullOrUndefined(e.minWidth)&&q.isNullOrUndefined(e.maxWidth)&&!this.isWidthUndefined()?e.width=200:e.maxWidth&&(e.width=e.maxWidth)),e.width?(t=parseInt(e.width.toString(),10),e.minWidth&&t<parseInt(e.minWidth.toString(),10)?e.minWidth:e.maxWidth&&t>parseInt(e.maxWidth.toString(),10)?e.maxWidth:e.width):null},oa.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},oa.prototype.setWidthToTable=function(e){var t=q.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)},oa.prototype.isAutoResize=function(){return this.parent.allowResizing&&"Auto"===this.parent.resizeSettings.mode};var sa=oa;function oa(e){this.parent=e}aa=function(e,t){return(aa=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 aa,e=function(e,t){function i(){this.constructor=e}aa(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},la=(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||!q.closest(e.target,".e-filterbarcell")&&!q.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||q.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()[ms].length)&&this.getContent().matrix.generate(this.rowModelGen.generateRows({rows:[new Xr({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=q.closest(e.target,".e-templatecell"),e.target!==n||!e.relatedTarget||x(e.relatedTarget,"e-grid")||this.firstHeaderCellClick||(0===this.active.matrix.matrix[(n=[0,0])[0]][n[1]]&&(n=$d(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)):q.addClass([this.currentInfo.element],["e-focused","e-focus"])),(e.target===t||i&&i===t)&&e.relatedTarget&&!x(e.relatedTarget,"e-grid")&&!this.firstHeaderCellClick&&(this.setActive(!0),this.setLastContentCellActive(),this.currentInfo.element=t,this.currentInfo.elementToFocus=t,i&&i.focus(),q.addClass([this.currentInfo.element],["e-focused","e-focus"])),this.firstHeaderCellClick=!1,e.target&&e.target.classList.contains("e-detailcell")&&!q.isNullOrUndefined(this.currentInfo.element)&&(this.currentInfo.skipAction=!1,q.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||!q.closest(e.target,".e-gridpager")&&!t||!q.isNullOrUndefined(e.relatedTarget)||!q.closest(e.target,".e-grid")||q.closest(document.activeElement,".e-grid")),i=(this.focusKey="",!(!x(e.target,"e-gantt")||!e.target.classList.contains("e-rowcell")||q.isNullOrUndefined(e.target.nextElementSibling)||!e.target.nextElementSibling.classList.contains("e-rowcell")));(!this.parent.isEdit&&(!e||e.relatedTarget&&!q.closest(e.relatedTarget,".e-grid")&&!q.closest(e.relatedTarget,".e-grid-popup")||this.parent.element.classList.contains("e-childgrid")&&!this.parent.element.matches(":focus-within"))||!i&&q.isNullOrUndefined(e.relatedTarget)&&parseInt(e.target.getAttribute("aria-colindex"),10)-1==0&&0===parseInt(e.target.getAttribute("data-index"),10)||!i&&q.isNullOrUndefined(e.relatedTarget)&&!q.closest(document.activeElement,".e-grid")&&!q.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),q.isNullOrUndefined(this.active)||!q.isNullOrUndefined(this.active.target)&&this.active.target.classList.contains("e-columnmenu")||(0===this.active.matrix.matrix[(i=[0,0])[0]][i[1]]&&(i=$d(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,q.isNullOrUndefined(e)||(e.tabIndex=0))},n.prototype.onClick=function(e,t,i){var n,r;x(e.target,"e-filterbarcell")&&(x(e.target,"e-multiselect")||e.target.classList.contains("e-input-group-icon"))||(r=!q.isNullOrUndefined(q.closest(e.target,"."+is)),n=!q.isNullOrUndefined(q.closest(e.target,"."+ts)),!(r=r&&n?!r:r)&&q.isNullOrUndefined(q.closest(e.target,"."+ts)))||e.target.classList.contains(hs)||e.target.classList.contains(rs)||!q.isNullOrUndefined(q.closest(e.target,".e-unboundcell"))&&!t||(this.setActive(r),n={cancel:!1,byKey:!1,byClick:!q.isNullOrUndefined(e.target),clickArgs:e},this.parent.notify(Mt,n),n.cancel)||q.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&&q.addClass([this.currentInfo.element],["e-focused","e-focus"]),i)&&e&&e.target&&q.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&&!x(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=$d(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=x(this.parent.element,"e-detailcell");q.removeClass([this.parent.element],["e-focus"]),q.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&&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",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&&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&&x(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&&x(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||x(e.target,"e-toolbar")||x(e.target,"e-groupdroparea"))){if(e.target===this.parent.element)return void(this.parent.element.classList.contains("e-childgrid")&&this.focusOutFromChildGrid(e));if(x(e.target,"e-groupdroparea"))return void(this.parent.element.classList.contains("e-childgrid")&&(e.preventDefault(),this.parent.element.focus()));if(x(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||x(e.target,"e-toolbar")||x(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||x(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||x(e.target,"e-toolbar")||x(e.target,"e-groupdroparea"))&&(t=!0)}t&&(this.parent.allowGrouping&&!q.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(Mt,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||q.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(e.target&&!this.parent.enableHeaderFocus)if("tab"===e.action&&(e.target.classList.contains("e-grid")||q.closest(e.target,".e-groupdroparea")||q.closest(e.target,".e-toolbar-item")||q.closest(e.target,".e-headercell")||q.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)&&(q.closest(e.target,".e-headercell")||q.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&&x(e.target,"e-gridheader")){if((this.parent.enableHeaderFocus||0<this.parent.frozenRows||0<this.parent.pinnedTopRowModels.length)&&!q.isNullOrUndefined(this.active)&&"tab"===e.action&&s.toString()===this.active.matrix.current.toString()){var r=$d(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=$d(this.active.matrix.matrix,a,!1)),q.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=$d(this.active.matrix.matrix,[0,0],!0)),(h=q.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(!q.isNullOrUndefined(this.active)&&"shiftTab"===e.action&&(s.toString()===this.active.matrix.current.toString()||!this.parent.enableHeaderFocus&&(q.closest(e.target,".e-headercell")||q.closest(e.target,".e-filterbarcell")))){var a=$d(this.active.matrix.matrix,this.active.matrix.current,!1),n=q.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=q.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&&x(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"),"Batch"!==this.parent.editSettings.mode||"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()&&(this.parent.editModule.editModule.addBatchRow=!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&&!q.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=$d(this.active.matrix.matrix,[0,0],!0)),(h=q.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||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&&x(e.target,"e-fltrtemp")&&("tab"===e.action||"shiftTab"===e.action)&&(n=e.target,(r=[].slice.call(q.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&&x(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=q.closest(t,"tr"),t=parseInt(t.getAttribute("aria-colindex"),10)-1,t=this.parent.getColumns()[parseInt(t.toString(),10)];return!(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=$d(this.active.matrix.matrix,r,t),a=q.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=$d(this.active.matrix.matrix,e,!1)),q.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=x(this.parent.element,"e-table"),n=x(i,"e-grid").ej2_instances[0],i=x(this.parent.element,"e-detailcell"),r=x(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(q.removeClass([this.parent.element],["e-focus"]),q.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,q.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 i[i.length-1].querySelector(".e-toolbar-item-focus,.e-btn,.e-input").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.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.allowGrouping){var i=this.parent.groupModule.getFocusableGroupedItems();if(x(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.querySelectorAll(".e-toolbar-item:not(.e-overlay):not(.e-hidden)");if(x(e.target,"e-toolbar-item")&&!(0<i.length&&(x(e.target,"e-toolbar-item")===i[0]&&"shiftTab"===e.action||x(e.target,"e-toolbar-item")===i[i.length-1]&&"tab"===e.action)))return!0}var n,r,i=q.closest(t,"th")&&!q.closest(t,"th").tabIndex,s=(!e.target.classList.contains("e-filterbaroperator")||13!==e.keyCode&&27!==e.keyCode||(r=q.closest(e.target,".e-filterbarcell")).querySelector("input").focus(),this.parent.editSettings.showAddNewRow&&null!==q.closest(document.activeElement,".e-addedrow"));return(i&&null!==q.closest(document.activeElement,".e-filterbarcell")||s)&&this.removeFocus(),!this.parent.isEdit||"tab"!==e.action&&"shiftTab"!==e.action||"Normal"!==this.parent.editSettings.mode||this.parent.editSettings.showAddNewRow||q.isNullOrUndefined(x(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])'),r=t.classList.contains("e-ddl")?t.querySelector("input"):t,n="tab"===e.action&&r===i[i.length-1],r="shiftTab"===e.action&&r===i[0],(n||r)&&(e.preventDefault(),(r=(r=i[n?0:i.length-1]).parentElement.classList.contains("e-ddl")?r.parentElement:r).focus())),"delete"===e.action||"Batch"!==this.parent.editSettings.mode&&(this.parent.isEdit&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&(!q.isNullOrUndefined(this.parent.element.querySelector(".e-editedrow"))||!q.isNullOrUndefined(x(t,"e-addedrow"))&&!q.isNullOrUndefined(q.closest(e.target,"input"))&&!q.isNullOrUndefined(document.querySelector(".e-popup-open"))||!q.isNullOrUndefined(x(t,"e-addedrow"))&&t&&!t.querySelector(".e-cancel-icon")&&!q.isNullOrUndefined(x(t,"e-unboundcell"))))||-1<["insert","f2"].indexOf(e.action))||null!==q.closest(document.activeElement,".e-filterbarcell")&&this.parent.enableHeaderFocus&&"ctrlPlusA"===e.action||(null!==q.closest(document.activeElement,".e-filterbarcell")||s)&&"tab"!==e.action&&"shiftTab"!==e.action||null!==q.closest(document.activeElement,"#"+this.parent.element.id+"_searchbar")&&-1<["enter","leftArrow","rightArrow","shiftLeft","shiftRight","ctrlPlusA"].indexOf(e.action)||null===q.closest(t,"."+is)&&null===q.closest(t,"."+ts)&&!(e.target===this.parent.element||x(e.target,"e-toolbar")||x(e.target,"e-groupdroparea"))||"space"===e.action&&!t.classList.contains(ps)&&null===q.closest(t,"."+ps)&&null===q.closest(t,".e-headerchkcelldiv")||null!==q.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(In,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(vr,{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;q.isNullOrUndefined(i.currentInfo.elementToFocus)||(e=q.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)&&q.isNullOrUndefined(e)?i.focusVirtualElement(t):!q.isNullOrUndefined(e)&&x(document.activeElement,"e-flmenu-valuediv")===e.querySelector(".e-flmenu-valuediv")||i.currentInfo.elementToFocus.focus())},0)},n.prototype.focus=function(e){this.parent.notify(fn,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&&!q.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"))&&q.removeClass([t],["e-checkbox"]),q.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&&(q.addClass([e.element],["e-focused"]),q.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=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;this.currentInfo=e,this.currentInfo.outline=e.outline&&(!q.isNullOrUndefined(t)||this.isVirtualScroll),this.isInfiniteScroll&&(this.currentInfo.outline=!0),!e.element||(i=e.elementToFocus.classList.contains("e-focus"))||(this.currentInfo.outline&&q.addClass([e.element],["e-focused"]),q.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,i||this.setFocusedElement(e.elementToFocus,t),this.parent.notify(Lt,{element:e.elementToFocus,parent:e.element,indexes:this.getContent().matrix.current,byKey:!q.isNullOrUndefined(t),byClick:q.isNullOrUndefined(t),keyArgs:t,isJump:this.swap.swap,container:this.getContent().getInfo(t),outline:!q.isNullOrUndefined(t),swapInfo:this.swap}),e=(i=this.getContent().matrix.current)[0],t=i[1],this.prevIndexes={rowIndex:e,cellIndex:t},this.focusedColumnUid=this.parent.getColumnByIndex(t).uid,this.focusByClick=!1)},n.prototype.refreshMatrix=function(c){var u=this;return function(e){c&&!u.content&&(u.content=new pa(u.parent)),c||u.header||(u.header=new ga(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),!q.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})),!q.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}),!q.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("#"+e.args.focusElement.id))&&a.focus(),u.virtualSelectionInfo={}),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||(q.EventHandler.add(this.parent.element,"mousedown",this.focusCheck,this),q.EventHandler.add(this.parent.element,"touchstart",this.focusCheck,this),q.EventHandler.add(this.parent.element,"focus",this.onFocus,this),q.EventHandler.add(this.parent.element,"focusin",this.focusIn,this),this.parent.element.addEventListener("focus",this.passiveHandler=function(e){return t.passiveFocus(e)},!0),q.EventHandler.add(this.parent.element,"focusout",this.onBlur,this),this.evtHandlers=[{event:Pt,handler:this.onKeyPress},{event:Nt,handler:this.onClick},{event:ct,handler:this.refMatrix},{event:en,handler:this.refMatrix},{event:dr,handler:this.refMatrix},{event:Ur,handler:this.showAddNewRowFocus},{event:yt,handler:this.refreshMatrix()},{event:Sr,handler:this.restoreFocus},{event:cn,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:Me,handler:this.refMatrix},{event:Le,handler:this.refMatrix},{event:Pe,handler:this.refMatrix},{event:Oe,handler:this.refMatrix},{event:ut,handler:this.refMatrix},{event:Lt,handler:this.internalCellFocus}],zd(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(){"FilterBar"!==this.parent.filterSettings.type&&(this.removeFocus(),this.restoreFocus())},n.prototype.removeEventListener=function(){this.parent.isDestroyed||(q.EventHandler.remove(this.parent.element,"mousedown",this.focusCheck),q.EventHandler.remove(this.parent.element,"touchstart",this.focusCheck),q.EventHandler.remove(this.parent.element,"focus",this.onFocus),q.EventHandler.remove(this.parent.element,"focusin",this.focusIn),q.EventHandler.remove(this.parent.element,"focusout",this.onBlur),this.parent.element.removeEventListener("focus",this.passiveHandler,!0),zd(this.parent,this.evtHandlers,!1))},n.prototype.destroy=function(){this.removeEventListener()},n.prototype.restoreFocus=function(e){var t;e&&"sorting"===e.requestType&&q.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)&&q.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||q.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&&q.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.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){e.byKey&&e.container.isContent&&("enter"===e.keyArgs.action&&e.parent.classList.contains("e-detailcell")||("tab"===e.keyArgs.action||"shiftTab"===e.keyArgs.action)&&e.parent.classList.contains("e-unboundcell"))&&(this.clearIndicator(),e=e.parent&&e.parent.closest(".e-unboundcell")&&"shiftTab"===e.keyArgs.action?this.commandColumnFocusElement(e.parent,!0):this.getContent().getFocusable(this.getFocusedElement()),this.setFocusedElement(e),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.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.parent=e,this.rowModelGen=new Ns(this.parent),this.addEventListener()}da.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},da.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;if(q.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)),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 l,h=this.first(this.matrix[parseInt(e.toString(),10)],t,i,!0,n),d=q.getValue(e+"."+(t=null===h?o:h),this.matrix);if(e!==this.rows||"downArrow"!==n&&"enter"!==n||(i[0]=-1),s&&(l=this.getRowsFromIndex(e,s),l=q.getValue(e+".cells."+t,l)),l&&0===l.getBoundingClientRect().width&&(e=(l=this.nextVisibleCellFocus(e,t,n,i,s,o))[0],t=l[1]),null===h){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]},da.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},da.prototype.nextVisibleCellFocus=function(e,t,i,n,r,s){var o=this.getRowsFromIndex(e,r),a=q.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=q.getValue(e+".cells."+t,o)}return[e,t]},da.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},da.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]},da.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},da.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},da.prototype.inValid=function(e){return 0===e||void 0===e};var ha=da;function da(){this.matrix=[],this.current=[]}ca.prototype.getTable=function(){return this.parent.getContentTable()},ca.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])}},ca.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)},ca.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&&!q.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]]?$d(this.matrix.matrix,i,!1):i)[0],s=i[1]+1),this.matrix.get(r,s,[n,t],e,this.validator(),this)},ca.prototype.checkRowCellFocus=function(e){return!e.classList.contains(b)||e.classList.contains("e-focused")},ca.prototype.onClick=function(e,t){var i,n,r,s,o,a=e.target,a=(a=(this.target=a).classList.contains(b)?a:q.closest(a,"td"))||q.closest(e.target,"td.e-detailrowcollapse")||q.closest(e.target,"td.e-detailrowexpand");return!(!(a=(a=q.closest(e.target,"td.e-detailcell")&&q.isNullOrUndefined(q.closest(q.closest(e.target,".e-grid"),"td.e-detailcell"))?null:a)&&q.closest(a,"table").classList.contains(ds)?a:null)||(n=a.parentElement.rowIndex,n=[n=this.parent.editSettings.showAddNewRow&&x(a,"e-addedrow")?x(a,"e-addedrow").rowIndex:n,a.cellIndex],r=(s=this.matrix.current)[0],s=s[1],o=q.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")||!(x(e.target,b)||x(e.target,"e-groupcaption")||x(e.target,"e-recordpluscollapse")||x(e.target,"e-recordplusexpand")||x(e.target,"e-detailrowcollapse")||x(e.target,"e-detailrowexpand")||x(e.target,"e-templatecell")))&&void this.matrix.select(i,n)},ca.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=q.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")&&x(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},ca.prototype.getFocusable=function(e){var t='button, [href], input:not([type="hidden"]), select, textarea, [tabindex]:not([tabindex="-1"])',i=!q.isNullOrUndefined(q.closest(e,".e-templatecell")),t=(this.parent.isEdit&&(t='input:not([type="hidden"]), select:not([aria-hidden="true"]), textarea'+(this.parent.editSettings.showAddNewRow&&x(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&&this.parent.isEdit&&this.target?t[0]:this.target||e:e},ca.prototype.selector=function(e,t,i){var n=[N.CellType.Expand,N.CellType.GroupCaption,N.CellType.CaptionSummary,N.CellType.GroupSummary];return(e.isDataRow&&t.visible&&(t.isDataCell||t.isTemplate)||e.isDataRow&&t.cellType===N.CellType.DetailExpand&&q.isNullOrUndefined(t.visible)||!e.isDataRow&&-1<n.indexOf(t.cellType)&&!!(t.cellType!==N.CellType.GroupSummary&&t.cellType!==N.CellType.CaptionSummary||t.isDataCell&&t.visible)||t.column&&t.visible&&"checkbox"===t.column.type||t.cellType===N.CellType.CommandColumn||e.isDataRow&&i)&&!("delete"===e.edit&&e.isDirty)},ca.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},ca.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},ca.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=x(document.activeElement,"e-addedrow")&&this.parent.editSettings.showAddNewRow?x(document.activeElement,"e-addedrow"):document.activeElement.parentElement;return{swap:!(r=(this.parent.enableVirtualization||this.parent.infiniteScrollSettings.enableCache)&&!q.isNullOrUndefined(s)&&s.classList.contains(I)?0<parseInt(s.getAttribute(T),10)-1:r)&&("upArrow"===e||i)&&0===t[0],toHeader:n}},ca.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},ca.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},ca.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(T),10)-1,n),Math.min(parseInt(t.element.getAttribute(ws),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}},ca.prototype.validator=function(){var r=this.getTable();return function(e,t,i){if(!q.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}},ca.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=q.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")},ca.prototype.getGridSeletion=function(){return this.parent.allowSelection&&this.parent.selectionSettings.allowColumnSelection};var pa=ca;function ca(e){var t=this;this.matrix=new ha,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}}e(fa,ua=pa),fa.prototype.getTable=function(){return this.parent.getHeaderTable()},fa.prototype.onClick=function(e){this.focusType="click";var t=e.target;if(!(t=(this.target=t).classList.contains("e-headercell")?t:q.closest(t,"th"))&&(0!==this.parent.frozenRows||0!==this.parent.pinnedTopRecords.length||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow)&&(t=e.target.classList.contains(b)?e.target:q.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&&x(t,"e-addedrow")?x(t,"e-addedrow").rowIndex:e,t.cellIndex],i=q.getValue(i[0]+"."+i[1],this.matrix.matrix);if(this.matrix.inValid(i))return!1;this.matrix.select(e,t.cellIndex)}},fa.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=q.isNullOrUndefined(i)?null:(this.parent.editSettings.showAddNewRow&&i.classList.contains("e-addedrow")?i.querySelectorAll("td:not(.e-editcell)"):i.cells)[parseInt(t.toString(),10)],q.isNullOrUndefined(e.element)||(e.elementToFocus=this.getFocusable(e.element),e.outline=!e.element.classList.contains("e-filterbarcell")),e},fa.prototype.selector=function(e,t){return t.visible&&(void 0!==t.column.field||t.isTemplate||!q.isNullOrUndefined(t.column.template)||!q.isNullOrUndefined(t.column.commands)||"checkbox"===t.column.type)||t.cellType===N.CellType.StackedHeader},fa.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}},fa.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},fa.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++)}},fa.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},fa.prototype.getInfo=function(e){return q.extend(ua.prototype.getInfo.call(this,e),{isContent:!1,isHeader:!0})},fa.prototype.validator=function(){return function(){return!0}},fa.prototype.shouldFocusChange=function(e){var t=this.matrix.current,i=t[0],t=t[1];return i<0||t<0||!(i=q.getValue(i+".cells."+t,this.getTable().rows))||"enter"!==e.action&&"altDownArrow"!==e.action||!i.classList.contains("e-headercell")},fa.prototype.getHeaderType=function(){return"HeaderFocus"};var ua,ga=fa;function fa(e){return ua.call(this,e)||this}ya.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")},ya.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")||q.isNullOrUndefined(t))&&((t=e.target.parentElement.querySelector(".e-sicon")).classList.remove("e-clear-icon"),t.removeAttribute("title"),t.style.cursor="default")},ya.prototype.wireEvent=function(){this.searchBox&&(q.EventHandler.add(this.searchBox,"focus",this.searchFocus,this),q.EventHandler.add(this.searchBox,"blur",this.searchBlur,this))},ya.prototype.unWireEvent=function(){this.searchBox&&(q.EventHandler.remove(this.searchBox,"focus",this.searchFocus),q.EventHandler.remove(this.searchBox,"blur",this.searchBlur))};var ma=ya;function ya(e,t){this.searchBox=e,this.serviceLocator=t,this.l10n=this.serviceLocator.getService("localization")}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)};var Sa,va,e=function(e,t){function i(){this.constructor=e}Sa(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Ca=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},e=(va=q.ChildProperty,e(wa,va),Ca([q.Property(12)],wa.prototype,"pageSize",void 0),Ca([q.Property(8)],wa.prototype,"pageCount",void 0),Ca([q.Property(1)],wa.prototype,"currentPage",void 0),Ca([q.Property()],wa.prototype,"totalRecordsCount",void 0),Ca([q.Property(!1)],wa.prototype,"enableQueryString",void 0),Ca([q.Property(!1)],wa.prototype,"pageSizes",void 0),Ca([q.Property(null)],wa.prototype,"template",void 0),wa);function wa(){return null!==va&&va.apply(this,arguments)||this}ba=function(e,t){return(ba=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 ba,Ia,Ca=function(e,t){function i(){this.constructor=e}ba(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},xa=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},Ca=(Ia=q.ChildProperty,Ca(Ra,Ia),xa([q.Property("startsWith")],Ra.prototype,"operator",void 0),xa([q.Property(!1)],Ra.prototype,"ignoreAccent",void 0),xa([q.Property(null)],Ra.prototype,"headerTemplate",void 0),xa([q.Property(null)],Ra.prototype,"template",void 0),xa([q.Property(null)],Ra.prototype,"footerTemplate",void 0),xa([q.Property(!0)],Ra.prototype,"enableSearching",void 0),xa([q.Property(null)],Ra.prototype,"renderCustomColumnChooser",void 0),Ra);function Ra(){return null!==Ia&&Ia.apply(this,arguments)||this}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||q.isNullOrUndefined(e.cellIndex)&&q.isNullOrUndefined(e.rowIndex)||(t=this.getRowObj(q.isNullOrUndefined(e.rowIndex)?q.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(){var e=this.parent.element;e&&(e.querySelector("."+ts)||e.querySelector("."+is))&&(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(),q.EventHandler.remove(this.parent.getContent(),"mousedown",this.mouseDownHandler),q.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=eh(this.parent.getCurrentViewRecords()),t="Bottom"===e.editSettings.newRowPosition?t.concat(this.parent.editModule.getBatchChanges()[ms]):this.parent.editModule.getBatchChanges()[ms].concat(t),i=this.parent.editModule.getBatchChanges()[ys],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&&-1<e){var s={selectedIndex:e,isAvailable:!0};if(this.parent.notify(rn,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,a,l,h=n.hasAttribute("aria-selected");this.activeTarget(),t=!(!t||!this.selectedRowIndexes.length||(o="ResetOnRowClick"===this.selectionSettings.checkboxMode,a=!this.parent.isCheckBoxSelection&&"Multiple"===this.selectionSettings.type,(o||a)&&(1!==this.selectedRowIndexes.length||!o&&!a))||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(de,[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(pe,[r.index],[r.data],[n],[r.foreignKeyData],this.actualTarget,void 0,void 0,void 0)}this.rowSelectingCallBack(l,t,e,s,!1,h,"cancel")(l)}else l={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(le,this.fDataUpdate(l),this.rowSelectingCallBack(l,t,e,s,!1,h,"cancel"))}}}},r.prototype.rowSelectingCallBack=function(e,t,i,n,r,s,o){var a=this;return function(e){q.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,he)),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&&(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){var l=this,h=this.parent,d=e.slice(),p=this.isSingleSel()?e[e.length-1]:e[0],c=(this.isMultiSelection=!0,[]),u=[],t=[];this.isRowType()&&!this.isEditing()&&(this.parent.pinnedTopRecords.length&&(e=this.selectPinnedRowIndexes(e).concat(e),d=e.slice()),this.selectedDataUpdate(t,u,c,e,d),this.activeTarget(),e={cancel:!1,rowIndexes:d,row:c,rowIndex:p,target:this.actualTarget,prevRow:h.getRows()[this.prevRowIndex],previousRowIndex:this.prevRowIndex,isInteracted:this.isInteracted,isCtrlPressed:this.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,data:t,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,foreignKeyData:u},this.parent.trigger(le,this.fDataUpdate(e),function(e){if(q.isNullOrUndefined(e)||!0!==e.cancel){l.selectionSettings.persistSelection&&h.allowRowDragAndDrop&&l.isDragged||l.clearRow(),l.selectRowIndex(d.slice(-1)[0]);var t=function(e,t){l.updateRowSelection(h.getRowByIndex(e),e,t),l.updateRowProps(p)};if(l.isSingleSel())t(p);else for(var i=0,n=d;i<n.length;i++)t(n[i],!!h.enableVirtualization);if(l.checkVirtualCheckBox()&&!l.parent.isPersistSelection)if(d.length===l.totalRecordsCount)l.virtualSelectedData=l.virtualCheckBoxData().slice(),l.selectedRowIndexes=Object.keys(l.virtualSelectedData).map(function(e){return parseInt(e,10)}),l.setCheckAllState();else{var r=d.filter(function(e){return-1===l.selectedRowIndexes.indexOf(e)});if(0<r.length){for(var s=l.virtualCheckBoxData().slice(),o=0;o<r.length;o++){var a=s[r[o]];q.isNullOrUndefined(a)||(l.virtualSelectedData.push(a),l.selectedRowIndexes.push(r[o]))}l.setCheckAllState()}}e={rowIndexes:d,row:c,rowIndex:p,target:l.actualTarget,prevRow:h.getRows()[l.prevRowIndex],previousRowIndex:l.prevRowIndex,data:l.getSelectedRecords(),isInteracted:l.isInteracted,isHeaderCheckboxClicked:l.isHeaderCheckboxClicked,foreignKeyData:u},l.isRowSelected&&l.onActionComplete(e,he),l.isInteracted=!1}else l.disableInteracted()}))},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=q.isNullOrUndefined(a.querySelector(".e-checkselect"))&&q.isNullOrUndefined(a.querySelector(".e-edit-checkselect"));if(this.isRowType()&&!this.isEditing()||!l){this.parent.pinnedTopRecords.length&&!q.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()?!q.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&&!q.isNullOrUndefined(a)&&a.classList.contains("e-grid-pin-row")&&(u=this.parent.getRowByIndex(g),a=q.isNullOrUndefined(u)?a:u),this.selectRowIndex(g),m&&(d.length||this.selectionSettings.enableToggle||this.isMultiCtrlRequest)){if(this.isAddRowsToSelection=!0,this.rowDeselect(de,[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(pe,[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.isMultiCtrlRequest,isShiftPressed:this.isMultiShiftRequest,foreignKeyData:r.length?r:f.foreignKeyData,isInteracted:this.isInteracted,isHeaderCheckboxClicked:this.isHeaderCheckboxClicked,rowIndexes:o},this.parent.trigger(le,this.fDataUpdate(h)),!q.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,he)),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(){this.clearRowCheck=!0,this.clearRowSelection()},r.prototype.clearRowCallBack=function(){this.isCancelDeSelect&&"Check"!==this.parent.checkAllRows||(this.selectedRowIndexes=[],this.selectedRecords=[],this.selectRowIndex(-1),this.isSingleSel()&&this.parent.isPersistSelection&&(this.selectedRowState={}))},r.prototype.clearSelectedRow=function(e){var t;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&&Ih(e)?Wh(e,t):t[""+e]},r.prototype.updatePersistCollection=function(e,t){var i,n=this;(this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)||this.parent.isPersistSelection||this.parent.selectionSettings.persistSelection&&0<this.parent.getPrimaryKeyFieldNames().length)&&!q.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.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||q.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){q.isNullOrUndefined(e)||(e=q.isNullOrUndefined(e.querySelector(".e-checkselect"))?e.querySelector(".e-edit-checkselect"):e.querySelector(".e-checkselect"),!q.isNullOrUndefined(e)&&(Uh(e.nextElementSibling,t),zh(e,t),q.isNullOrUndefined(this.checkedTarget)||!q.isNullOrUndefined(this.checkedTarget)&&!this.checkedTarget.classList.contains("e-checkselectall"))&&this.setCheckAllState(i))},r.prototype.updateRowSelection=function(e,t,i){var n;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)),e.setAttribute("aria-selected","true"),this.updatePersistCollection(e,!0),this.updateCheckBoxes(e,!0),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,n=this.isFocusLastCell?"last-child":"first-child",t=e.querySelector(".e-selectionbackground.e-rowcell:not(.e-hide, .e-detailrowcollapse, .e-detailrowexpand, .e-rowdragdrop, .e-gridchkbox):"+n),this.isFocusLastCell=!1),!t)||i||this.parent.isCheckBoxSelection&&this.isLazyLoadGroup()&&this.parent.enableInfiniteScrolling||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||!q.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.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&&x(this.target,"e-rowcell")||(this.isInteracted=!1),this.checkSelectAllClicked=!1,this.isHdrSelectAllClicked=!1,this.rmtHdrChkbxClicked=!1)},r.prototype.clearRowSelection=function(){var n=this;if(this.isRowSelected){var r=this.parent.getDataRows(),s=[],o=[],a=[],l=[],h=this.target;this.isRowDeselect=!0;for(var e=0,t=this.selectedRowIndexes.length;e<t;e++){var i=void 0,i=this.parent.enableVirtualization||this.parent.enableInfiniteScrolling&&this.parent.infiniteScrollSettings.enableCache?this.parent.getRowByIndex(this.selectedRowIndexes[parseInt(e.toString(),10)]):("Batch"===this.parent.editSettings.mode?this.parent.getRows():this.parent.getDataRows())[this.selectedRowIndexes[parseInt(e.toString(),10)]],d=this.getRowObj(i);d&&(s.push(d.data),o.push(i),a.push(this.selectedRowIndexes[parseInt(e.toString(),10)]),l.push(d.foreignKeyData))}this.selectionSettings.persistSelection&&"ResetOnRowClick"!==this.selectionSettings.checkboxMode&&(this.isRowClicked=!!this.checkSelectAllClicked),this.rowDeselect(de,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.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(pe,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&&!q.isNullOrUndefined(q.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),!q.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&&!q.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(ce,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";!q.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,ue))}},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?Od(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(ce,this.fDataUpdate(e),function(e){if(q.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?Od(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,ue),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,ce);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,ue)}}},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.isMultiCtrlRequest,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(ge,[{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(fe,[{rowIndex:l.rowIndex,cellIndexes:[l.cellIndex]}],n,[p],s)):(g=!1,this.onActionBegin(c,ce),this.addRowCellIndex({rowIndex:l.rowIndex,cellIndex:l.cellIndex}),this.updateCellSelection(p),this.addAttribute(p))}else{if(this.onActionBegin(c,ce),!q.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,ue),this.cellselected=!0),this.updateCellProps(l,l)}}}},r.prototype.getColIndex=function(e,t){var i=this.parent.getColumnByIndex(t),n=Ad(this.parent,0,e);if(n)for(var r=0;r<n.length;r++)if(parseInt(n[parseInt(r.toString(),10)].getAttribute(ws),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(ws),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(ps)&&this.updateCheckBoxes(q.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){q.isNullOrUndefined(t)||this.addRowCellIndex({rowIndex:t,cellIndex:i}),e.classList.add("e-cellselectionbackground"),e.classList.contains(ps)&&this.updateCheckBoxes(q.closest(e,"tr"),!0),this.addAttribute(e)},r.prototype.addAttribute=function(e){this.target=e,q.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.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(ge,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(fe,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){e.preventDefault(),this.stopTimer();var t,i=this.parent.element.getBoundingClientRect(),n=this.x,r=this.y,s=ch(e),o=s.x-i.left,i=s.y-i.top,a=q.closest(e.target,"tr");this.isDragged=!0,this.isCellDrag||(a=a||q.closest(document.elementFromPoint(this.parent.element.offsetLeft+2,e.clientY),"tr"),o<n&&(t=o,o=n,n=t),i<r&&(t=i,i=r,r=t),this.element.style.left=n+"px",this.element.style.top=r+"px",this.element.style.width=o-n+"px",this.element.style.height=i-r+"px"),!a||e.ctrlKey||e.shiftKey||(t=parseInt(a.getAttribute(T),10)-1,this.isCellDrag?(o=x(e.target,b))&&(this.startAFCell=this.startCell,this.endAFCell=x(e.target,b),-1<t)&&this.selectLikeExcel(e,t,parseInt(o.getAttribute(ws),10)-1):(this.hideAutoFill(),this.selectRowsByRange(this.startDIndex,t),this.isRowDragSelected=!0)),e.ctrlKey||e.shiftKey||this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||this.parent.enableColumnVirtualization||this.parent.groupSettings.columns.length||!this.isCellDrag||this.updateScrollPosition(e,s,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?wh():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:wh())<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?wh():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&&q.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")||!x(e,"e-content"))&&x(e,"e-content")||s[parseInt(p.toString(),10)].classList.add("e-xlsel-top-border"),c!==h||(this.parent.getContent().querySelector(".e-cellselectionbackground.e-fixedfreeze")||!x(e,"e-headercontent"))&&x(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()===Ss&&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()===Ss&&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(q.closest(e,H).querySelectorAll(".e-row:not(.e-hiddenrow)"));return e.parentElement===t[t.length-1]},r.prototype.isFirstRow=function(e){var t=[].slice.call(q.closest(e,H).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(),q.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()!==Ss||"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()===Ss)&&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()===Ss)&&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()===Ss)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=q.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=q.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()===Ss)&&((e=q.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=q.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=q.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()===Ss)&&((e=q.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(),q.removeClass(i.querySelectorAll(".e-xlsel-top-border"),"e-xlsel-top-border"),q.removeClass(i.querySelectorAll(".e-xlsel-left-border"),"e-xlsel-left-border"),q.removeClass(i.querySelectorAll(".e-xlsel-right-border"),"e-xlsel-right-border"),q.removeClass(i.querySelectorAll(".e-xlsel-bottom-border"),"e-xlsel-bottom-border"),t||(this.mcBdrElement.style.display=e),this.parent.getFrozenMode()===Ss)&&(this.frcBdrElement.style.display=e),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&(i=this.parent.getHeaderTable(),q.removeClass(i.querySelectorAll(".e-xlsel-top-border"),"e-xlsel-top-border"),q.removeClass(i.querySelectorAll(".e-xlsel-left-border"),"e-xlsel-left-border"),q.removeClass(i.querySelectorAll(".e-xlsel-right-border"),"e-xlsel-right-border"),q.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()===Ss)&&(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&&(x(this.startAFCell,ss)||x(this.startAFCell,"e-frozencontent"))&&this.isFirstRow(this.startAFCell)?1.5:0,r=(x(this.startAFCell,ss)||x(this.startAFCell,os))&&this.isFirstCell(this.startAFCell)?1:0,s=this.isLastRow(this.endAFCell)&&(x(this.endAFCell,ss)||x(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-wh(),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?wh():0),d=0<d?Math.floor(d)-1:0,p=0<p?p:0,u=e.left-a.left,this.parent.enableRtl?(c=x(this.startAFCell,ss)||x(this.startAFCell,os)?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&&wh()?(this.bdrAFTop.style.left=wh()+"px",this.bdrAFTop.style.width=parseInt(this.bdrAFTop.style.width,10)-wh()+"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=q.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafleft"})).style.width="2px",this.bdrAFLeft=this.parent.element.appendChild(e),(e=q.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafright"})).style.width="2px",this.bdrAFRight=this.parent.element.appendChild(e),(e=q.createElement("div",{className:"e-xlselaf",id:this.parent.element.id+"_bdrafbottom"})).style.height="2px",this.bdrAFBottom=this.parent.element.appendChild(e),(e=q.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=this.createBeforeAutoFill(e,t,i);n.cancel||(t=this.parent.getColumnByIndex(t),this.parent.editModule&&i&&("number"===t.type?this.parent.editModule.updateCell(e,t.field,parseFloat(n.value)):this.parent.editModule.updateCell(e,t.field,n.value)))},r.prototype.createBeforeAutoFill=function(e,t,i){t={column:this.parent.getColumnByIndex(t),value:i.innerText};return this.parent.trigger(et,t),t},r.prototype.getAutoFillCells=function(e,t){return[].slice.call(this.parent.getDataRows()[parseInt(e.toString(),10)].querySelectorAll(".e-cellselectionbackground"))},r.prototype.selectLikeAutoFill=function(e,t){var i=parseInt(x(this.startAFCell,I).getAttribute(T),10)-1,n=parseInt(this.startAFCell.getAttribute(ws),10)-1,r=parseInt(x(this.endAFCell,I).getAttribute(T),10)-1,s=parseInt(this.endAFCell.getAttribute(ws),10)-1,o=this.selectedRowCellIndexes.length-1,a=this.selectedRowCellIndexes[0].cellIndexes.length-1;switch(!0){case!t&&this.endAFCell.classList.contains("e-cellselectionbackground")&&!!x(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(x(this.endAFCell,I).getAttribute(T),10)-1,s=parseInt(this.endAFCell.getAttribute(ws),10)-1,t){for(var l=parseInt(this.endCell.getAttribute(ws),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(T),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(T),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&&!q.isNullOrUndefined(this.element.parentElement)&&q.remove(this.element),this.isDragged&&1===this.selectedRowCellIndexes.length&&1===this.selectedRowCellIndexes[0].cellIndexes.length?this.mUPTarget=x(e.target,b):this.mUPTarget=null;var t,i=q.closest(e.target,".e-rowcell");this.isDragged&&!this.isAutoFillSel&&"Cell"===this.selectionSettings.mode&&i&&i.classList.contains(b)&&(t=parseInt(i.parentElement.getAttribute(T),10)-1,i=parseInt(i.getAttribute(ws),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=x(e.target,b),this.endAFCell=t||(this.endCell===this.endAFCell?this.startAFCell:this.endAFCell),this.startAFCell=this.startCell,q.isNullOrUndefined(this.endAFCell)||q.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(Dt,{})),this.isAutoFillSel=!1,this.preventFocus=!1),q.EventHandler.remove(this.parent.getContent(),"mousemove",this.mouseMoveHandler),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&q.EventHandler.remove(this.parent.getHeaderContent(),"mousemove",this.mouseMoveHandler),q.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(ws),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()===Ss&&n.getFreezeTableName()===vs,q.select("#"+this.parent.element.id+"_autofill",x(this.target,ds))||(q.select("#"+this.parent.element.id+"_autofill",this.parent.element)&&q.select("#"+this.parent.element.id+"_autofill",this.parent.element).remove(),this.autofill=q.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=x(i,"e-grid");if(!(r&&r.id!==n.element.id||x(i,rs)&&!this.parent.frozenRows||x(i,"e-editedbatchcell")||x(i,cs))){if((e.shiftKey||e.ctrlKey)&&e.preventDefault(),x(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()||q.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(T),10)-1,this.startCellIndex=parseInt(x(this.startCell,b).getAttribute(ws),10)-1)},r.prototype.updateStartCellsIndex=function(){this.startCell&&(this.startIndex=parseInt(this.startCell.parentElement.getAttribute(T),10)-1,this.startCellIndex=parseInt(x(this.startCell,b).getAttribute(ws),10)-1)},r.prototype.enableDrag=function(e,t){var i=this.parent,t=(t&&(t=q.closest(e.target,"tr"),this.startDIndex=parseInt(t.getAttribute(T),10)-1,this.startDCellIndex=parseInt(x(e.target,b).getAttribute(ws),10)-1),document.body.classList.add("e-disableuserselect"),i.element.getBoundingClientRect()),e=ch(e);this.x=e.x-t.left,this.y=e.y-t.top,q.EventHandler.add(i.getContent(),"mousemove",this.mouseMoveHandler,this),(this.parent.frozenRows||this.parent.pinnedTopRecords.length)&&q.EventHandler.add(i.getHeaderContent(),"mousemove",this.mouseMoveHandler,this),q.EventHandler.add(document,"mouseup",this.mouseUpHandler,this)},r.prototype.clearSelAfterRefresh=function(e){var t=this.parent.enableInfiniteScrolling&&"infiniteScroll"===e.requestType;if("virtualscroll"===e.requestType||this.parent.isPersistSelection||t||this.clearSelection(),("virtualscroll"===e.requestType||t)&&this.parent.isPersistSelection&&!this.isPartialSelection&&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:g,handler:this.enableAfterRender},{event:dt,handler:this.initializeSelection},{event:kt,handler:this.onActionComplete},{event:At,handler:this.onActionComplete},{event:gt,handler:this.onPropertyChanged},{event:Lt,handler:this.onCellFocused},{event:zi,handler:this.clearSelAfterRefresh},{event:Ut,handler:this.columnPositionChanged},{event:ct,handler:this.initialEnd},{event:jt,handler:this.rowsRemoved},{event:yt,handler:this.refreshHeader},{event:Ft,handler:this.destroyAutoFillElements},{event:s,handler:this.destroy}],zd(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(p,this.actionCompleteFunction),this.addEventListener_checkbox())},r.prototype.removeEventListener=function(){this.parent.isDestroyed||(q.EventHandler.remove(document,"mouseup",this.mouseUpHandler),q.EventHandler.remove(this.parent.getContent(),"mousedown",this.mouseDownHandler),q.EventHandler.remove(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler),zd(this.parent,this.evtHandlers,!1),this.parent.removeEventListener(y,this.actionBeginFunction),this.parent.removeEventListener(p,this.actionCompleteFunction),this.removeEventListener_checkbox(),this.parent.off(Ft,this.destroyAutoFillElements))},r.prototype.wireEvents=function(){this.isMacOS=-1!==navigator.userAgent.indexOf("Mac OS"),this.isMacOS?(q.EventHandler.add(this.parent.element,"keydown",this.keyDownHandler,this),q.EventHandler.add(this.parent.element,"keyup",this.keyUpHandler,this)):this.parent.allowKeyboard||q.EventHandler.add(this.parent.element,"keydown",this.keyDownHandler,this)},r.prototype.unWireEvents=function(){this.isMacOS?(q.EventHandler.remove(this.parent.element,"keydown",this.keyDownHandler),q.EventHandler.remove(this.parent.element,"keyup",this.keyUpHandler)):this.parent.allowKeyboard||q.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){q.EventHandler.add(this.parent.getContent(),"mousedown",this.mouseDownHandler,this),q.EventHandler.add(this.parent.getHeaderContent(),"mousedown",this.mouseDownHandler,this)},r.prototype.onPropertyChanged=function(e){var t;e.module===this.getModuleName()&&(t=this.parent,q.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")),q.isNullOrUndefined(e.properties.mode)&&q.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").getElementsByClassName("e-rowselect").length&&(this.parent.element.querySelector(".e-gridpopup").style.display="none")},r.prototype.initialEnd=function(){this.selectedRowIndexes.length||(this.parent.off(ct,this.initialEnd),this.selectRow(this.parent.selectedRowIndex))},r.prototype.checkBoxSelectionChanged=function(){var e=this.parent;e.off(ct,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,q.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&&this.chkField&&(e.isPersistSelection&&0===Object.keys(this.selectedRowState).length||!e.isPersistSelection)&&this.dataSuccess(!q.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];q.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){if(this.parent.getDataModule().isRemote()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)if(e){var t=Object.keys(this.selectedRowState),i=Object.keys(this.unSelectedRowState);if(!this.isCheckboxReset)for(var n=0,r=this.parent.groupSettings.columns.length&&!this.parent.groupSettings.enableLazyLoading&&this.parent.isPersistSelection?this.parent.currentViewData.records:this.parent.currentViewData;n<r.length;n++){var s,o=r[n];q.isNullOrUndefined(o)||q.isNullOrUndefined(o[this.primaryKey])||(s=o[this.primaryKey].toString(),-1===t.indexOf(s)&&-1===i.indexOf(s)&&(this.selectedRowState[o[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 a=0,l=this.parent.getRowsObject().filter(function(e){return e.isSelectable});a<l.length;a++){var h=l[a];this.selectedRowState[this.getPkValue(this.primaryKey,h.data)]=!0}else{e=this.isPartialSelection?this.parent.partialSelectedRecords:this.getData();if(this.parent.groupSettings.columns.length)for(var d=0,p=this.isPartialSelection?e:e.records;d<p.length;d++){var o=p[d];this.selectedRowState[this.getPkValue(this.primaryKey,o)]=!0}else for(var c=0,u=e;c<u.length;c++){o=u[c];this.selectedRowState[this.getPkValue(this.primaryKey,o)]=!0}}else this.selectedRowState={}},r.prototype.getData=function(){return np(this.parent)},r.prototype.getAvailableSelectedData=function(e){e=new U.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 e=this.parent.pinnedTopRecords.length||this.isLazyLoadGroup()?this.parent.getAllDataRows(!0):this.parent.getRows();if(this.isLazyLoadGroup()&&(e=e.filter(function(e){return!e.classList.contains("e-groupcaptionrow")})),this.totalRecordsCount=this.parent.getCurrentViewRecords().length,this.parent.allowPaging&&(this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount),!q.isNullOrUndefined(e)&&0<e.length&&(this.parent.isRemote()&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)||this.parent.isPersistSelection||this.chkField)){for(var t=[],i=0;i<e.length;i++){var n,r,s=this.getRowObj(e[parseInt(i.toString(),10)]),o=s&&s.data?this.getPkValue(this.primaryKey,s.data):null;if(null===o)return;this.isPartialSelection&&!s.isSelectable&&!this.selectedRowState.hasOwnProperty(o)||(n=void 0,r=e[parseInt(i.toString(),10)].querySelector(".e-checkselect"),this.selectedRowState[""+o]||"Check"===this.parent.checkAllRows&&this.selectedRowState[""+o]&&this.totalRecordsCount===Object.keys(this.selectedRowState).length&&this.chkAllCollec.indexOf(o)<0||"Uncheck"===this.parent.checkAllRows&&0<this.chkAllCollec.indexOf(o)&&!this.parent.selectedRowIndex||"Intermediate"===this.parent.checkAllRows&&!q.isNullOrUndefined(this.chkField)&&s.data[this.chkField]?(t.push(parseInt(e[parseInt(i.toString(),10)].getAttribute(T),10)-1),n=!0):(n=!1,this.checkedTarget!==r&&this.parent.isCheckBoxSelection&&r&&Uh(r.nextElementSibling,n)),this.updatePersistCollection(e[parseInt(i.toString(),10)],n))}this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableSelectedData(this.persistSelectedData).length,this.isSingleSel()&&0<t.length?this.selectRow(t[0],!0):this.selectRows(t)}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()},r.prototype.actionBegin=function(e){if("save"===e.requestType&&this.parent.isPersistSelection){var t=this.parent.element.querySelector(".e-edit-checkselect");if(!q.isNullOrUndefined(t)){var i=q.closest(t,"."+cs);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()||!q.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),!q.isNullOrUndefined(this.getCheckAllBox())&&this.getCheckAllBox().nextElementSibling.classList.contains("e-check")||!q.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.parent.isPersistSelection){for(var t=e.data.slice(),i=0;i<t.length;i++){var n=this.getPkValue(this.primaryKey,t[parseInt(i.toString(),10)]);q.isNullOrUndefined(n)||this.updatePersistDelete(n,this.isPartialSelection)}this.isHdrSelectAllClicked=!1,this.setCheckAllState(),this.totalRecordsCount=this.parent.pageSettings.totalRecordsCount}if("paging"===e.requestType){if(this.parent.isPersistSelection&&this.isPartialSelection&&this.isHdrSelectAllClicked){for(var r=this.parent.getRowsObject(),s=[],i=0;i<r.length;i++)r[parseInt(i.toString(),10)].isSelectable&&s.push(r[parseInt(i.toString(),10)].index);s.length&&this.selectRows(s)}this.prevRowIndex=void 0,this.prevCIdxs=void 0,this.prevECIdxs=void 0}},r.prototype.onDataBound=function(){if(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.isPersistSelection&&this.selectedRecords.length&&(this.isPrevRowSelection=!0),((this.parent.getDataModule().isRemote()||!q.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.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.setCheckAllState(),(this.parent.isPersistSelection||this.contentRenderer&&q.isNullOrUndefined(this.contentRenderer.requestType)&&this.parent.isRemote()&&(this.parent.enableVirtualization||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(this.parent.isPersistSelection||this.parent.isRemote()&&(this.parent.enableVirtualization||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()||!q.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()||!q.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()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result||this.isPartialSelection?this.isPartialSelection?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(e){var 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),e&&this.getCurrentBatchRecordChanges().length?(this.parent.checkAllRows="Check",this.updatePersistSelectedData(e),this.selectRowsByRange(t.getVirtualRowIndex(0),t.getVirtualRowIndex(this.getCurrentBatchRecordChanges().length-1+this.parent.pinnedTopRowModels.length)),this.checkVirtualCheckBox()&&!this.parent.isPersistSelection?(this.virtualSelectedData=this.virtualCheckBoxData().slice(),this.selectedRowIndexes=Object.keys(this.virtualSelectedData).map(function(e){return parseInt(e,10)})):!(this.parent.getDataModule().isRemote()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.isCheckBoxSelection&&this.isPartialSelection&&!this.isLazyLoadPersistSelection()&&0<this.parent.partialSelectedRecords.length?this.parent.isPersistSelection?(this.persistSelectedData=this.parent.partialSelectedRecords.slice(),this.persistSelectedRecordsCount=this.persistSelectedData.length&&this.getAvailableDataCount(this.persistSelectedData)):(this.partialSelectedData=this.parent.partialSelectedRecords.slice(),this.partialSelectedRecordsCount=this.partialSelectedData.length&&this.getAvailableDataCount(this.partialSelectedData)):this.isLazyLoadPersistSelection()&&!this.parent.isRemote()?(this.persistSelectedData=(this.isPartialSelection?this.parent.partialSelectedRecords:this.getData().records).slice(),this.parent.allowPaging||(this.selectedRowIndexes=this.isPartialSelection?this.parent.partialSelectedIndexes.slice():Object.keys(this.persistSelectedData).map(function(e){return parseInt(e,10)}))):this.parent.isPersistSelection&&this.parent.isRemote()&&this.parent.groupSettings.columns.length&&this.parent.groupSettings.enableLazyLoading&&(this.persistSelectedData=(this.parent.enableVirtualization?this.parent.lazyLoadRender:this.parent.contentModule).getAllPagesData(),this.persistSelectedRecordsCount=this.persistSelectedData.length)):(this.parent.checkAllRows="Uncheck",this.updatePersistSelectedData(e),this.clearSelection()),this.chkAllCollec=[],q.isNullOrUndefined(i)||(t=i.querySelector(".e-edit-checkselect"),q.isNullOrUndefined(t))||Uh(t.nextElementSibling,e)},r.prototype.checkSelectAll=function(e){var t=this,i=this.getCheckAllStatus(e),n="Check"===i;if(this.isHeaderCheckboxClicked=!0,(this.parent.getDataModule().isRemote()||!q.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()||!q.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&&!q.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){q.isNullOrUndefined(e)?q.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=q.closest(this.checkedTarget,"."+b),n=this.parent,r=(this.isMultiCtrlRequest=!0,0);this.isHeaderCheckboxClicked=!1,r=!Kh(n)||(t=i.parentElement.getAttribute("data-uid"),this.parent.enableVirtualization&&this.parent.groupSettings.columns.length)?parseInt(i.parentElement.getAttribute(T),10)-1:n.getRows().map(function(e){return e.getAttribute("data-uid")}).indexOf(t),this.parent.isPersistSelection&&0<this.parent.element.getElementsByClassName(us).length&&"Top"===this.parent.editSettings.newRowPosition&&!this.parent.editSettings.showAddNewRow&&++r,this.rowCellSelectionHandler(r,parseInt(i.getAttribute(ws),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(q.closest(i,"."+I)),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(Je,{checked:t,selectedRowIndexes:this.parent.getSelectedRowIndexes(),target:e}),this.parent.isEdit||(this.checkedTarget=null)},r.prototype.updateSelectedRowIndexes=function(){if(this.parent.isCheckBoxSelection&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.isPartialSelection&&!(this.parent.getDataModule().isRemote()||!q.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.isPartialSelection&&(this.parent.getDataModule().isRemote()||!q.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.enableInfiniteScrolling)&&!(this.parent.getDataModule().isRemote()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result))if("Check"===this.parent.checkAllRows&&q.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()||!q.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()||!q.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()||!q.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;(this.parent.isCheckBoxSelection||"ResetOnRowClick"===this.parent.selectionSettings.checkboxMode)&&(i=a=!1,n=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)&&n===this.parent.dataSource.length&&n>this.totalRecordsCount&&(n=this.totalRecordsCount),this.parent.isPersistSelection||this.parent.isRemote()&&!this.parent.allowPaging||(n=this.selectedRowIndexes.length,this.totalRecordsCount=this.getCurrentBatchRecordChanges().length),!this.parent.isPersistSelection||(this.parent.getDataModule().isRemote()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&this.isPartialSelection||!this.parent.searchSettings.key.length&&!this.parent.filterSettings.columns.length||(i=!0,a=this.isAllSelected(n)),r=this.getCheckAllBox())&&(s=r.nextElementSibling,q.removeClass([s],["e-check","e-stop","e-uncheck"]),zh(r,!1),r.indeterminate=!1,o=this.parent.getDataModule().isRemote()?[]:this.gridCurrentRecord,this.parent.groupSettings.columns.length&&o.records&&(o=o.records),this.totalRecordsCount=this.checkVirtualCheckBox()||this.isLazyLoadPersistSelection()?o.length:this.totalRecordsCount,a&&i&&(this.parent.getDataModule().isRemote()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result||o.length)||!i&&(n===this.totalRecordsCount&&this.totalRecordsCount&&!this.isPartialSelection&&(!(this.parent.getDataModule().isRemote()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)||this.parent.allowPaging)||this.parent.isRemote()&&this.isLazyLoadPersistSelection()&&n===this.parent.totalDataRecordsCount||!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling&&this.isPartialSelection&&(this.isSelectAllRowCount(n)||this.isHdrSelectAllClicked&&!this.parent.isPersistSelection)||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!this.parent.allowPaging&&(!(this.parent.getDataModule().isRemote()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&o.length&&n===o.length||(this.parent.getDataModule().isRemote()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&!this.isPartialSelection&&(n===this.parent.totalDataRecordsCount||(this.isSelectAllRowCount(n)||n===this.totalRecordsCount)&&!this.parent.isPersistSelection&&!this.parent.isRemote())||this.isPartialSelection&&(0<n&&this.isHdrSelectAllClicked||this.isSelectAllRowCount(n)))||n===this.totalRecordsCount&&this.totalRecordsCount&&!this.isPartialSelection&&!this.parent.allowPaging&&!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling)?(q.addClass([s],["e-check"]),zh(r,!0),t&&this.getRenderer().setSelection(null,!0,!0),this.parent.checkAllRows="Check"):(!this.selectedRowIndexes.length&&(!this.parent.enableVirtualization||!this.persistSelectedData.length&&!i||i&&this.someDataSelected())||0===n&&0===this.getCurrentBatchRecordChanges().length)&&!this.parent.allowPaging||this.parent.allowPaging&&!this.isLazyLoadPersistSelection()&&(0===n||n&&i&&this.someDataSelected())||this.isLazyLoadPersistSelection()&&0===this.persistSelectedRecordsCount?(q.addClass([s],["e-uncheck"]),t&&this.getRenderer().setSelection(null,!1,!0),this.parent.checkAllRows="Uncheck"):(q.addClass([s],["e-stop"]),this.parent.checkAllRows="Intermediate",r.indeterminate=!0),this.parent.isEdit&&!(this.parent.editModule&&this.parent.editModule.editModule&&this.parent.editModule.editModule.initialRender)&&!this.parent.isPersistSelection||0===n&&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?q.addClass([s.parentElement],["e-checkbox-disabled"]):q.removeClass([s.parentElement],["e-checkbox-disabled"]),this.isPartialSelection&&(a=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===a&&this.disableSelectableRecordsCount===this.totalRecordsCount&&s.parentElement.querySelector(".e-frame").classList.contains("e-uncheck")?q.addClass([s.parentElement],["e-checkbox-disabled"]):q.removeClass([s.parentElement],["e-checkbox-disabled"])),!this.parent.enableVirtualization&&!this.parent.enableInfiniteScrolling||this.parent.allowPaging||this.parent.getDataModule().isRemote()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result||this.updateSelectedRowIndex(e))},r.prototype.checkVirtualCheckBox=function(){return this.parent.enableVirtualization&&!(this.parent.getDataModule().isRemote()||!q.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=0,n=this.parent.getRowsObject();return!this.isPartialSelection&&(this.parent.getDataModule().isRemote()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?(this.parent.getDataModule().isRemote()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result?this.parent.totalDataRecordsCount:this.getData()&&this.getData().length)===n.length&&(i=n.filter(function(e){return e.isSelectable}).length)&&e===i:(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.isPartialSelection?(t=this.parent.isPersistSelection||this.parent.isRemote()?this.persistSelectedRecordsCount:this.partialSelectedRecordsCount,(i=this.disableSelectableRecordsCount+this.partialSelectableRecordsCount)===(this.parent.isRemote()?this.parent.totalDataRecordsCount:this.parent.allowGrouping&&"records"in this.getData()?this.getData().records.length:this.getData()&&this.getData().length)&&0!==t&&t===this.partialSelectableRecordsCount):(this.parent.allowPaging||this.isPartialSelection)&&this.parent.selectionSettings.persistSelection?(t=this.persistSelectedRecordsCount,(i=this.disableSelectableRecordsCount+this.partialSelectableRecordsCount)===this.totalRecordsCount&&0!==t&&t===this.partialSelectableRecordsCount):(i=n.filter(function(e){return e.isSelectable}).length)&&e===i},r.prototype.keyDownHandler=function(e){("opera"===q.Browser.info.name&&17===e.keyCode||"mozilla"===q.Browser.info.name&&224===e.keyCode||!("safari"!==q.Browser.info.name&&"chrome"!==q.Browser.info.name||91!==e.keyCode&&93!==e.keyCode))&&(this.cmdKeyPressed=!0);var t=x(e.target,"e-headercell"),i=x(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"===q.Browser.info.name&&17===e.keyCode||"mozilla"===q.Browser.info.name&&224===e.keyCode)&&("safari"!==q.Browser.info.name&&"chrome"!==q.Browser.info.name||91!==e.keyCode&&93!==e.keyCode)||(this.cmdKeyPressed=!1)},r.prototype.clickHandler=function(e){var t,i=e.target,n=(this.actualTarget=i,this.isAutoFillSel||e.ctrlKey||e.shiftKey||(this.startAFCell=this.endAFCell=null),this.selectionSettings.persistSelection&&(this.deSelectedData=this.persistSelectedData.slice()),(x(i,I)||x(i,"e-headerchkcelldiv")||this.selectionSettings.allowColumnSelection&&i.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.isMultiCtrlRequestCell=this.isMultiCtrlRequest,this.popUpClickHandler(e),!1),r=(this.preventFocus=!0,x(i,"e-checkbox-wrapper"));this.checkSelectAllClicked=!!(r&&r.getElementsByClassName("e-checkselectall")||this.selectionSettings.persistSelection&&x(i,I)),this.selectionSettings.persistSelection&&this.isPartialSelection&&x(i,"e-headerchkcelldiv")&&!i.querySelector(".e-checkbox-disabled")&&!(this.parent.getDataModule().isRemote()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&(this.isHdrSelectAllClicked=!0),r&&0<r.querySelectorAll(".e-checkselect,.e-checkselectall").length&&(t=r.querySelector('input[type="checkbox"]'),n=!0),this.drawBorders(),this.updateAutoFillPosition(),i=x(i,b),this.parent.isReact&&i&&!i.parentElement&&i.classList.contains("e-rowcell")&&(i=this.parent.getCellFromIndex(parseInt(i.getAttribute("data-index"),10),parseInt(i.getAttribute("aria-colindex"),10)-1)),this.isRowDragSelected&&q.isNullOrUndefined(i)&&this.parent.allowRowDragAndDrop&&this.checkSelectAllClicked&&(this.isRowDragSelected=!1),(i&&i.parentElement.classList.contains(I)&&!this.parent.selectionSettings.checkboxOnly||n)&&!this.isRowDragSelected?(this.parent.isCheckBoxSelection&&(this.isMultiCtrlRequest=!0),this.target=i,q.isNullOrUndefined(t)?(r=0,r=parseInt(i.parentElement.getAttribute(T),10)-1,this.parent.isPersistSelection&&!this.parent.editSettings.showAddNewRow&&0<this.parent.element.getElementsByClassName(us).length&&++r,this.mUPTarget&&this.mUPTarget.isEqualNode(i)||this.rowCellSelectionHandler(r,parseInt(i.getAttribute(ws),10)-1),this.parent.isCheckBoxSelection&&(this.moveIntoUncheckCollection(q.closest(i,"."+I)),this.setCheckAllState())):(this.checkedTarget=t).classList.contains("e-checkselectall")?this.checkSelectAll(t):this.checkSelect(t),this.parent.isCheckBoxSelection||!q.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,q.isNullOrUndefined(q.closest(e.target,".e-unboundcell"))&&(this.preventFocus=!1)},r.prototype.popUpClickHandler=function(e){var t=e.target;q.closest(t,".e-headercell")||e.target.classList.contains(b)||q.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||oh(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=q.closest(this.target,"."+b).classList.contains(ps),this.parent.isCheckBoxSelection||!this.parent.isCheckBoxSelection&&!i||this.parent.getColumns().some(function(e){return"checkbox"===e.type})&&"ResetOnRowClick"===this.selectionSettings.checkboxMode&&i?this.selectRowsByRange(q.isUndefined(this.prevRowIndex)?e:this.prevRowIndex,e):this.addRowsToSelection([e]),this.selectCellsByRange(q.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(T))-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&&!q.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||q.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=q.isNullOrUndefined(t.rowIndex)?null:t.rowIndex-s):(n+=this.parent.frozenRows||this.parent.pinnedTopRecords.length,t.rowIndex=0!==t.rowIndex&&q.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&&(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.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&&x(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 q.isNullOrUndefined(e.element.querySelector(".e-headercelldiv"))||(t=this.parent.getColumnIndexByUid(e.element.querySelector(".e-headercelldiv").getAttribute("data-mappinguid")));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.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(ws),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()&&(q.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,s,o=[],a=3;a<arguments.length;a++)o[a-3]=arguments[a];e&&(n=[].slice.call(e.getElementsByClassName(b)),r=e.querySelector(".e-detailrowcollapse")||e.querySelector(".e-detailrowexpand"),s=e.querySelector(".e-rowdragdrop"),r&&n.push(r),s&&n.push(s),Fh.apply(void 0,[n,t].concat(o))),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 q.isNullOrUndefined(this.contentRenderer)&&(this.contentRenderer=this.factory.getRenderer(N.RenderType.Content)),this.contentRenderer},r.prototype.getSelectedRecords=function(){var e=[],e=!this.selectionSettings.persistSelection&&this.selectedRecords.length?this.parent.getRowsObject().filter(function(e){return e.isSelected}).map(function(e){return e.data}):this.persistSelectedData;return this.checkVirtualCheckBox()&&!this.parent.isPersistSelection?e=this.virtualSelectedData:(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&!(this.parent.getDataModule().isRemote()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result)&&this.parent.isCheckBoxSelection&&this.isPartialSelection&&!this.parent.isPersistSelection?e=this.partialSelectedData:(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.isRemote()&&this.isPartialSelection&&!this.parent.isPersistSelection&&(e=this.persistSelectedData),e},r.prototype.selectColumn=function(e){var t=this.parent;if(!q.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,me),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,ye)}this.updateColProps(e)}}},r.prototype.selectColumnsByRange=function(e,t){var i=this.parent;if(!q.isNullOrUndefined(i.getColumns()[parseInt(e.toString(),10)])){var n=[];if("Single"===i.selectionSettings.type||q.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,me),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,ye),this.updateColProps(e[0])}}},r.prototype.selectColumnWithExisting=function(e){var t=this.parent;if(!q.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,me),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,ye)}this.updateColProps(e)}}},r.prototype.clearColumnSelection=function(e){if(this.isColumnSelected){var t=this.parent;if(q.isNullOrUndefined(e)||-1!==this.selectedColumnsIndexes.indexOf(e)){var i=q.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,Se))this.disableInteracted();else{for(var s=q.isNullOrUndefined(e)?[].slice.call(t.getHeaderContent().getElementsByClassName("e-columnselection")):[r],o=this.getSelectedColumnCells(e),a=0,l=s.length;a<l;a++)Fh([s[parseInt(a.toString(),10)]],!1,"e-columnselection");for(a=0,l=o.length;a<l;a++)Fh([o[parseInt(a.toString(),10)]],!1,"e-columnselection");q.isNullOrUndefined(e)?(this.columnDeselect(i,ve),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=!q.isNullOrUndefined(this.parent.rowTemplate)?t.getRows():t.getDataRows(),n=[],r=q.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(!q.isNullOrUndefined(this.parent.getColumns()[parseInt(t.toString(),10)])){var i=!q.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(),Fh([e],!0,"e-columnselection");for(var n=0,r=i.length;n<r;n++)if(i[parseInt(n.toString(),10)].classList.contains(I))if(!i[parseInt(n.toString(),10)].classList.contains(cs)&&!i[parseInt(n.toString(),10)].classList.contains(us)||"Normal"!==this.parent.editSettings.mode||q.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")&&Fh([s[parseInt(o.toString(),10)]],!0,"e-columnselection");else q.isNullOrUndefined(i[parseInt(n.toString(),10)].childNodes[parseInt(t.toString(),10)])||Fh([i[parseInt(n.toString(),10)].childNodes[parseInt(t.toString(),10)]],!0,"e-columnselection");else Fh([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(q.isUndefined(this.prevColIndex)?e:this.prevColIndex,e):this.selectColumnWithExisting(e)},r.prototype.addEventListener_checkbox=function(){var e=this;this.parent.on(pt,this.dataReady,this),this.onDataBoundFunction=this.onDataBound.bind(this),this.parent.addEventListener(ae,this.onDataBoundFunction),this.parent.on(Er,this.onDataBoundFunction),this.parent.on(ct,this.checkBoxSelectionChanged,this),this.parent.on(Xn,this.initPerisistSelection,this),this.parent.on(ut,this.setCheckAllForEmptyGrid,this),this.parent.on(Nt,this.clickHandler,this),this.resizeEndFn=function(){e.updateAutoFillPosition(),e.drawBorders()},this.resizeEndFn.bind(this),this.parent.addEventListener(Ye,this.resizeEndFn)},r.prototype.removeEventListener_checkbox=function(){this.parent.off(pt,this.dataReady),this.parent.removeEventListener(ae,this.onDataBoundFunction),this.parent.off(Er,this.onDataBoundFunction),this.parent.off(ut,this.setCheckAllForEmptyGrid),this.parent.off(Nt,this.clickHandler),this.parent.removeEventListener(Ye,this.resizeEndFn),this.parent.off(Xn,this.initPerisistSelection)},r.prototype.setCheckAllForEmptyGrid=function(){var e,t=this.getCheckAllBox();t&&(this.parent.isCheckBoxSelection=!0,e=t.nextElementSibling,q.removeClass([e],["e-check","e-stop","e-uncheck"]),q.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||this.parent.isPersistSelection&&(!this.parent.isPersistSelection||"Single"!==this.selectionSettings.type)||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,q.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};var Ta=r;function r(e,t,i){this.selectedRowIndexes=[],this.selectedRowCellIndexes=[],this.selectedRecords=[],this.preventFocus=!1,this.selectedColumnsIndexes=[],this.checkBoxState=!1,this.isMultiShiftRequest=!1,this.isMultiCtrlRequest=!1,this.isMultiCtrlRequestCell=!1,this.enableSelectMultiTouch=!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.bottom="0 0 2px 0",this.top="2px 0 0 0",this.right_bottom="0 2px 2px 0",this.bottom_left="0 0 2px 2px",this.top_right="2px 2px 0 0",this.top_left="2px 0 0 2px",this.top_bottom="2px 0 2px 0",this.top_right_bottom="2px 2px 2px 0",this.top_bottom_left="2px 0 2px 2px",this.top_right_left="2px 2px 0 2px",this.right_bottom_left="0 2px 2px 2px",this.all_border="2px",this.parent=e,this.selectionSettings=t,this.factory=i.getService("rendererFactory"),this.focus=i.getService("focus"),this.addEventListener(),this.wireEvents()}Ea.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},Ea.prototype.search=function(e){var t,i=this.parent;e=q.isNullOrUndefined(e)?"":e,Oh(i)?i.notify(ni,{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},Ea.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(gt,this.onPropertyChanged,this),this.parent.on(wt,this.onSearchComplete,this),this.parent.on(s,this.destroy,this),this.actionCompleteFunc=this.onActionComplete.bind(this),this.parent.addEventListener(p,this.actionCompleteFunc),this.parent.on(Hi,this.cancelBeginEvent,this))},Ea.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(gt,this.onPropertyChanged),this.parent.off(wt,this.onSearchComplete),this.parent.off(s,this.destroy),this.parent.removeEventListener(p,this.actionCompleteFunc),this.parent.off(Hi,this.cancelBeginEvent))},Ea.prototype.destroy=function(){this.removeEventListener()},Ea.prototype.onPropertyChanged=function(e){e.module===this.getModuleName()&&(q.isNullOrUndefined(e.properties.key)?this.parent.notify(ft,{requestType:"searching",type:y}):this.parent.notify(ft,{requestType:"searching",type:y,searchString:this.parent.searchSettings.key}))},Ea.prototype.onSearchComplete=function(e){this.parent.trigger(p,q.extend(e,{searchString:this.parent.searchSettings.key,requestType:"searching",type:p}))},Ea.prototype.onActionComplete=function(e){this.refreshSearch&&"refresh"===e.requestType&&this.headerFocus&&(this.headerFocus=!1,this.parent.focusModule.focus(),q.addClass([this.parent.focusModule.currentInfo.element],["e-focused"])),this.refreshSearch="searching"!==e.requestType},Ea.prototype.cancelBeginEvent=function(e){"searching"===e.requestType&&this.parent.setProperties({searchSettings:{key:""}},!0)},Ea.prototype.getModuleName=function(){return"search"};var Da=Ea;function Ea(e){this.headerFocus=!1,this.parent=e,this.addEventListener()}ka.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:Le,handler:this.batchChanges},{event:Mr,handler:this.resetColumnState}],zd(this.parent,this.evtHandlers,!0,this))},ka.prototype.removeEventListener=function(){this.parent.isDestroyed||zd(this.parent,this.evtHandlers,!1)},ka.prototype.batchChanges=function(){this.isShowHide&&(this.isShowHide=!1,this.setVisible(this.colName,this.changedCol),this.changedCol=this.colName=[])},ka.prototype.show=function(e,t){var e=this.getToggleFields(e),i=this.getColumns(e,t);if(this.parent.notify(Zt,{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)}},ka.prototype.hide=function(e,t){var e=this.getToggleFields(e),i=this.getColumns(e,t);if(this.parent.notify(Zt,{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)}},ka.prototype.getToggleFields=function(e){return"string"==typeof e?[e]:e},ka.prototype.getColumns=function(e,i){var n=this;return $l(e,function(t){return $l(n.parent.columnModel,function(e){if(e[""+i]===t)return e})[0]})},ka.prototype.batchActionPrevent=function(e,t){return void 0===t&&(t=[]),!Oh(this.parent)||(this.colName=e,this.changedCol=t,this.parent.closeEdit(),!1)},ka.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},ka.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=q.isNullOrUndefined(i)?t:i,e.cancel?(s.parent.notify(Bn,{showHideArgs:e}),0<i.length&&(i[0].visible=!0)):(s.parent.notify(Vr,r),Kh(s.parent)&&s.parent.contentModule.emptyVcRows(),t=s.parent.element.querySelector(".e-addedrow"),s.parent.editSettings.showAddNewRow&&t&&(q.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(Pr,{isModeChg:!0}):s.parent.notify(Bt,i),e={requestType:"columnstate",columns:n},s.parent.trigger(p,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(Ur,{})),"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 Oa=ka;function ka(e){this.colName=[],this.isShowHide=!1,this.parent=e,this.addEventListener(),this.widthService=new sa(e)}Fa.prototype.getModuleName=function(){return"scroll"},Fa.prototype.setWidth=function(e){var t,i,n,r;this.parent.element.style.width=q.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()},Fa.prototype.setHeight=function(){var e,t=0,i=this.parent.getContent().querySelector("."+hs),n=this.parent.height;this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()&&("auto"!==this.parent.height&&this.parent.height.toString().indexOf("%")<0&&(n=parseInt(n,10)-Fa.getScrollBarWidth()),e=this.parent.getContent().querySelector(".e-movablescrollbar"),0<this.parent.height.toString().indexOf("%"))&&!q.isNullOrUndefined(e)&&(n="calc("+n+" - "+e.scrollHeight+"px)"),!this.parent.enableVirtualization&&this.parent.frozenRows&&"auto"!==this.parent.height&&"100%"!==this.parent.height?(t=(e=this.parent.getHeaderContent().querySelector(H+":not(.e-masked-tbody)"))?e.offsetHeight:0,e&&t?t-=e.getElementsByClassName(us).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=q.formatUnit(parseInt(n,10)-t)):i.style.height=q.formatUnit(n),this.ensureOverflow(i),this.parent.isFrozenGrid()&&this.refresh()},Fa.prototype.setPadding=function(){var e=this.parent.getHeaderContent(),t=Fa.getScrollBarWidth()-this.getThreshold(),i=this.getCssProperties();e.querySelector("."+rs).style[i.border]=0<t?"1px":"0px",e.style[i.padding]=0<t?t+"px":"0px"},Fa.prototype.removePadding=function(e){var e=this.getCssProperties(e),t=this.parent.getHeaderContent().querySelector("."+rs),t=(t.style[e.border]="",t.parentElement.style[e.padding]="",this.parent.getFooterContent());t&&t.classList.contains("e-footerpadding")&&t.classList.remove("e-footerpadding")},Fa.prototype.refresh=function(){var e,t;"100%"===this.parent.height&&(e=this.parent.getContent(),this.parent.element.style.height="100%",t=this.widthService.getSiblingsHeight(e),e.style.height="calc(100% - "+t+"px)")},Fa.prototype.getThreshold=function(){return"mozilla"===q.Browser.info.name?.5:1-window.devicePixelRatio+1},Fa.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ut,this.wireEvents,this),this.parent.on(ct,this.wireEvents,this),this.parent.on(g,this.onPropertyChanged,this),this.parent.on(qi,this.wireEvents,this),this.parent.on(yt,this.setScrollLeft,this))},Fa.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ut,this.wireEvents),this.parent.off(ct,this.wireEvents),this.parent.off(g,this.onPropertyChanged),this.parent.off(qi,this.wireEvents),this.parent.off(yt,this.setScrollLeft),this.unwireEvents())},Fa.prototype.unwireEvents=function(){this.parent.frozenRows&&this.header&&(q.EventHandler.remove(this.header,"touchstart pointerdown",this.setPageXY),q.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&&q.EventHandler.remove(e,"scroll",this.onCustomScrollbarScroll),this.content&&(q.EventHandler.remove(this.content,"scroll",this.onCustomScrollbarScroll),q.EventHandler.remove(this.content,"touchstart pointerdown",this.setPageXY),/macintosh|ipad/.test(q.Browser.userAgent.toLowerCase())&&q.Browser.isDevice||q.EventHandler.remove(this.content,"touchmove pointermove",this.onTouchScroll)),this.header)&&(q.EventHandler.remove(this.header,"scroll",this.onCustomScrollbarScroll),q.EventHandler.remove(this.header,"touchstart pointerdown",this.setPageXY),q.EventHandler.remove(this.header,"touchmove pointermove",this.onTouchScroll)),this.content&&q.EventHandler.remove(this.content,"scroll",this.contentScrollHandler),this.header&&q.EventHandler.remove(this.header,"scroll",this.headerScrollHandler),this.contentScrollHandler=null,this.headerScrollHandler=null,this.parent.aggregates.length&&this.parent.getFooterContent()&&q.EventHandler.remove(this.parent.getFooterContent().firstChild,"scroll",this.onContentScroll)},Fa.prototype.setScrollLeft=function(){this.parent.getHeaderContent().querySelector("."+rs).scrollLeft=this.previousValues.left},Fa.prototype.updateFrozenShadow=function(e){var t=this.parent.getContent().firstElementChild;q.isNullOrUndefined(t)&&q.isNullOrUndefined(t)||(e=e||t,t=(this.parent.enableRtl?Math.abs(e.scrollLeft):e.scrollLeft)<=1,this.parent.getVisibleFrozenLeftCount()&&!t?q.addClass([this.parent.element],"e-left-shadow"):q.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?q.removeClass([this.parent.element],"e-right-shadow"):q.addClass([this.parent.element],"e-right-shadow"))},Fa.prototype.onContentScroll=function(e){var s=this,o=e,a=o.classList.contains(rs);return function(e){if(null!==s.content.querySelector(H)&&!s.parent.isPreventScrollEvent){var t=e.target;if(s.parent.frozenRows&&(0<s.content.scrollTop&&s.parent.frozenRows?q.addClass([s.parent.element],"e-top-shadow"):q.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=(q.isNullOrUndefined(s.parent.infiniteScrollModule)||!s.parent.enableInfiniteScrolling||s.parent.isEdit&&(!s.parent.editSettings.showAddNewRow||s.parent.element.querySelector(".e-editedrow"))||s.parent.notify(Tn,{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(Hn,{scrollDown:i})),s.parent.notify(vn,{}),t.classList.contains("e-summarycontent"));s.previousValues.left===r?s.previousValues.top=a?t.scrollTop:s.previousValues.top:(s.parent.notify(Ln,e),o.scrollLeft=r,n&&(s.header.scrollLeft=r),s.previousValues.left=r,s.parent.notify(zt,{left:r}))}}},Fa.prototype.onCustomScrollbarScroll=function(e,t){var i=this,n=e,r=t;return function(e){null!==i.content.querySelector(H)&&(e=e.target.scrollLeft,i.previousValues.left!==e)&&(n.scrollLeft=e,r.scrollLeft=e,i.previousValues.left=e,i.parent.notify(zt,{left:e}),i.parent.isDestroyed)}},Fa.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("."+rs),s=o.parent.getContent().querySelector("."+hs),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)}},Fa.prototype.setPageXY=function(){var t=this;return function(e){"mouse"!==e.pointerType&&(t.pageXY=t.getPointXY(e))}},Fa.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},Fa.prototype.getScrollbleParent=function(e){var t,i;return null===e?null:(t=q.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))},Fa.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=this.makeStickyHeader(),q.EventHandler.add(this.eventElement,"scroll",this.stickyScrollHandler,this)):this.eventElement&&(q.EventHandler.remove(this.eventElement,"scroll",this.stickyScrollHandler),this.stickyScrollHandler=null,this.eventElement=null)},Fa.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?Fa.getScrollBarWidth():0;e.style.width=this.parent.element.offsetWidth-t-.5+"px"},Fa.prototype.wireEvents=function(){var e,t,i,n,r,s=this,o=(this.oneTimeReady&&(e=this.parent.isFrozenGrid(),this.content=this.parent.getContent().querySelector("."+hs),this.header=this.parent.getHeaderContent().querySelector("."+rs),t=this.parent.getContent().querySelector(".e-movablescrollbar"),(this.parent.frozenRows||this.parent.isRowPinned)&&this.header&&this.content&&(q.EventHandler.add(this.header,"touchstart pointerdown",this.setPageXY(),this),q.EventHandler.add(this.header,"touchmove pointermove",this.onTouchScroll(this.content),this)),e&&t&&this.parent.enableColumnVirtualization&&(q.EventHandler.add(t,"scroll",this.onCustomScrollbarScroll(this.content,this.header),this),q.EventHandler.add(this.content,"scroll",this.onCustomScrollbarScroll(t,this.header),this),q.EventHandler.add(this.header,"scroll",this.onCustomScrollbarScroll(t,this.content),this),q.EventHandler.add(this.header,"touchstart pointerdown",this.setPageXY(),this),q.EventHandler.add(this.header,"touchmove pointermove",this.onTouchScroll(this.content),this),q.EventHandler.add(this.content,"touchstart pointerdown",this.setPageXY(),this),/macintosh|ipad/.test(q.Browser.userAgent.toLowerCase())&&q.Browser.isDevice||q.EventHandler.add(this.content,"touchmove pointermove",this.onTouchScroll(this.header),this)),this.contentScrollHandler=this.onContentScroll(this.header),this.headerScrollHandler=this.onContentScroll(this.content),q.EventHandler.add(this.content,"scroll",this.contentScrollHandler,this),q.EventHandler.add(this.header,"scroll",this.headerScrollHandler,this),this.parent.aggregates.length&&q.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());Kl(function(){i=s.header.scrollLeft,n=o.scrollHeight,r=s.parent.getContent().clientHeight},function(){var e={cancel:!1};s.parent.notify(Zn,e),n<r&&"auto"!==s.parent.height&&(s.setLastRowCell(),s.parent.notify(jr,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},Fa.prototype.setLastRowCell=function(){var e=this.parent.getContentTable();q.removeClass(e.querySelectorAll("td"),"e-lastrowcell"),e.querySelector("tr:nth-last-child(2)")&&this.parent.editSettings.showAddNewRow&&"Bottom"===this.parent.editSettings.newRowPosition&&q.addClass(e.querySelector("tr:nth-last-child(2)").querySelectorAll("td"),"e-lastrowcell"),q.addClass(e.querySelectorAll("tr:last-child td"),"e-lastrowcell"),this.parent.isSpan&&q.addClass(e.querySelectorAll(".e-row-span-lastrowcell"),"e-lastrowcell")},Fa.prototype.getCssProperties=function(e){var t={},e=q.isNullOrUndefined(e)?this.parent.enableRtl:e;return t.border=e?"borderLeftWidth":"borderRightWidth",t.padding=e?"paddingLeft":"paddingRight",t},Fa.prototype.ensureOverflow=function(e){e.style.overflowY="auto"===this.parent.height?"auto":"scroll"},Fa.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(!q.isNullOrUndefined(e.properties.width)))},Fa.prototype.makeStickyHeader=function(){var d=this;return function(){var e,t,i,n,r,s,o,a,l,h;d.parent.enableStickyHeader&&d.parent.element&&d.parent.getContent()&&(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("#"+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),q.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"),q.isNullOrUndefined(a)||(a.style.position="absolute",h=e.top-s,a.style.top=h+"px")),d.parent.notify(Tr,{}))}},Fa.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:""},Fa.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+ts)||e.querySelector("."+is))&&(this.removeEventListener(),e=this.parent.getContent().querySelector("."+hs),q.EventHandler.remove(e,"scroll",this.onContentScroll),this.parent.enableStickyHeader&&this.addStickyListener(!1),this.removePadding(),q.removeClass([this.parent.getHeaderContent().querySelector("."+rs)],rs),q.removeClass([e],hs),e.style.height="",this.parent.element.style.width="")},Fa.getScrollBarWidth=function(){return wh()};var Aa=Fa;function Fa(e){this.previousValues={top:0,left:0},this.oneTimeReady=!0,this.parent=e,this.widthService=new sa(e),this.addEventListener()}Ma=function(e,t){return(Ma=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 Ma,La,xa=function(e,t){function i(){this.constructor=e}Ma(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},Pa=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},o=(La=q.ChildProperty,xa(Na,La),Na.prototype.setFormatter=function(e){this.formatFn=e},Na.prototype.getFormatter=function(){return this.formatFn},Na.prototype.setTemplate=function(e){void 0===e&&(e={}),void 0!==this.footerTemplate&&(this.templateFn[q.getEnumValue(N.CellType,N.CellType.Summary)]={fn:q.compile(this.footerTemplate,e),property:"footerTemplate"}),void 0!==this.groupFooterTemplate&&(this.templateFn[q.getEnumValue(N.CellType,N.CellType.GroupSummary)]={fn:q.compile(this.groupFooterTemplate,e),property:"groupFooterTemplate"}),void 0!==this.groupCaptionTemplate&&(this.templateFn[q.getEnumValue(N.CellType,N.CellType.CaptionSummary)]={fn:q.compile(this.groupCaptionTemplate,e),property:"groupCaptionTemplate"})},Na.prototype.getTemplate=function(e){return this.templateFn[q.getEnumValue(N.CellType,e)]},Na.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},Pa([q.Property()],Na.prototype,"type",void 0),Pa([q.Property()],Na.prototype,"field",void 0),Pa([q.Property()],Na.prototype,"columnName",void 0),Pa([q.Property()],Na.prototype,"format",void 0),Pa([q.Property()],Na.prototype,"footerTemplate",void 0),Pa([q.Property()],Na.prototype,"groupFooterTemplate",void 0),Pa([q.Property()],Na.prototype,"groupCaptionTemplate",void 0),Pa([q.Property()],Na.prototype,"customAggregate",void 0),Na);function Na(){var e=null!==La&&La.apply(this,arguments)||this;return e.templateFn={},e}Ba=q.ChildProperty,xa(za,Ba),Pa([q.Collection([],o)],za.prototype,"columns",void 0);var Ba,xa=za;function za(){return null!==Ba&&Ba.apply(this,arguments)||this}Ua.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ct,this.initialEnd,this),this.parent.on(Pt,this.keyDownHandler,this),this.parent.on(Nt,this.clickHandler,this),this.parent.on(ut,this.initialEnd,this),q.EventHandler.add(this.parent.element,"keydown",this.pasteHandler,this))},Ua.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Pt,this.keyDownHandler),this.parent.off(ct,this.initialEnd),this.parent.off(Nt,this.clickHandler),this.parent.off(ut,this.initialEnd),q.EventHandler.remove(this.parent.element,"keydown",this.pasteHandler))},Ua.prototype.clickHandler=function(e){e=e.target;x(e,"e-rowcell")},Ua.prototype.pasteHandler=function(e){var t,i,n=this,r=this.parent,s=/(Mac)/i.test(navigator.platform),o=this.parent.getSelectedRowCellIndexes();!r.isEdit&&67===e.keyCode&&s&&e.metaKey&&this.copy(),o.length&&86===e.keyCode&&(!s&&e.ctrlKey||s&&e.metaKey)&&!r.isEdit&&(e=q.closest(document.activeElement,"."+b),this.clipBoardTextArea)&&e&&r.editSettings.allowEditing&&"Batch"===r.editSettings.mode&&"Cell"===r.selectionSettings.mode&&"Flow"!==r.selectionSettings.cellSelectionMode&&(this.activeElement=document.activeElement,t=window.scrollX,i=window.scrollY,this.clipBoardTextArea.focus(),setTimeout(function(){n.activeElement.focus(),window.scrollTo(t,i),n.paste(n.clipBoardTextArea.value,o[0].rowIndex,o[0].cellIndexes[0])},s?100:10))},Ua.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)]||q.isUndefined(r.getRowByIndex(o))){s++;break}for(var h=0;h<n.length;h++){if(!r.getCellFromIndex(o,s)){s++;break}var d,p=(d=r.getColumnByIndex(s)).getParser()?d.getParser()(n[parseInt(h.toString(),10)]):n[parseInt(h.toString(),10)];d.allowEditing&&!d.isPrimaryKey&&(this.parent.trigger($e,p={column:d,data:p,rowIndex:o}),o=p.rowIndex,p.cancel||r.editModule&&("number"===d.type?this.parent.editModule.updateCell(o,d.field,parseFloat(p.data)):r.editModule.updateCell(o,d.field,p.data))),s++}o++}r.selectionModule.selectCellsByRange({rowIndex:t,cellIndex:i},{rowIndex:o-1,cellIndex:s-1});e=this.parent.getCellFromIndex(o-1,s-1);e&&q.classList(e,["e-focus","e-focused"],[]),this.clipBoardTextArea.value=""},Ua.prototype.initialEnd=function(){this.l10n=this.serviceLocator.getService("localization"),this.parent.off(ct,this.initialEnd),this.clipBoardTextArea=this.parent.createElement("textarea",{className:"e-clipboard",attrs:{id:this.parent.element.id+"_clipboard",tabindex:"-1","aria-label":this.l10n.getConstant("ClipBoard")}}),this.clipBoardTextArea.style.opacity="0",this.parent.element.appendChild(this.clipBoardTextArea)},Ua.prototype.keyDownHandler=function(e){"ctrlPlusC"===e.action?this.copy():"ctrlShiftPlusH"===e.action&&this.copy(!0)},Ua.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")&&l.push(parseInt(d.getAttribute("data-rowindex"),10))}for(r=0;r<l.length;r++){0<r&&(this.copyContent+="\n");var p=[],c=l[parseInt(r.toString(),10)],c=(!Kh(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){return e.getAttribute("data-rowindex")}).indexOf(l[parseInt(r.toString(),10)].toString())),t[parseInt(c.toString(),10)]);q.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(Ze,y),y.cancel||(this.clipBoardTextArea.value=this.copyContent=y.data,q.Browser.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0)}},Ua.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(ws),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)},Ua.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)},Ua.prototype.getModuleName=function(){return"clipboard"},Ua.prototype.destroy=function(){this.removeEventListener(),this.clipBoardTextArea&&(q.remove(this.clipBoardTextArea),this.clipBoardTextArea=null)},Ua.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 qa=Ua;function Ua(e,t){this.copyContent="",this.isSelect=!1,this.parent=e,this.serviceLocator=t,this.addEventListener()}var Ha="https://ej2.syncfusion.com/documentation/grid",ja="https://ej2.syncfusion.com/documentation/",Va="[EJ2Grid.Warning]",Ga="[EJ2Grid.Error]",_a="[EJ2Grid.Info]",Ka=(Wa.prototype.getModuleName=function(){return"logger"},Wa.prototype.log=function(e,t){for(var i=e=e instanceof Array?e:[e],n=0;n<i.length;n++){var r=Ya[i[parseInt(n.toString(),10)]],s=r.check(t,this.parent);s.success&&console[r.logType](r.generateMessage(t,this.parent,s.options))}},Wa.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)})},Wa.prototype.destroy=function(){this.parent.isDestroyed||this.parent.off("initial-end",this.patchadaptor)},Wa);function Wa(e){this.parent=e,this.parent.on("initial-end",this.patchadaptor,this)}var Qa,Xa,Ya={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"},""),Va+": MODULES MISSING\nThe following modules are not injected:.\n"+i+"Refer to "+Ha+"/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 Ga+": PROMISE UNDEFINED\nPromise object is not present in the global environment,please use polyfil to support Promise object in your environment.\nRefer to "+ja+"/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 Va+": PRIMARY KEY MISSING\nEditing is enabled but primary key column is not specified.\nRefer to "+Ha+"/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 Va+": PRIMARY KEY MISSING\nselectionSettings.persistSelection property is enabled. It requires one primary key column to persist selection.\nRefer to "+Ha+"/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=Ja(e),r=Za(e),i=""!==r?r:""!==n?n:e.error;return Va+": "+i}},locale_missing:{type:"locale_missing",logType:"warn",check:function(e,t){var i=U.DataUtil.getObject("locale."+t.locale+".grid",q.L10n);return{success:"en-US"!==t.locale&&q.isNullOrUndefined(i)}},generateMessage:function(e,t){return Va+": LOCALE CONFIG MISSING\nLocale configuration for '"+t.locale+"' is not provided.\nRefer to "+Ha+"/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:!q.isUndefined(t.detailTemplate)||!q.isUndefined(t.childGrid),options:{name:"freeze"}};break;case"virtualization":i={success:!q.isUndefined(t.detailTemplate)||!q.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 Va+": "+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 U.DataManager||!q.isNullOrUndefined(t.dataSource)&&t.dataSource.length)}},generateMessage:function(){return Va+": 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 "+Ha+"/columns.html for documentation on configuring the grid data and columns."}},virtual_height:{type:"virtual_height",logType:"error",check:function(e,t){return{success:q.isNullOrUndefined(t.height)||"auto"===t.height}},generateMessage:function(){return Ga+": GRID HEIGHT MISSING \nheight property is required to use virtualization.\nRefer to "+Ha+"/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 Ga+": RETRUN VALUE MISSING \nRemote service returns invalid data. \nRefer to "+Ha+"/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 Va+": SORT COMPARER NOT WORKING \nSort comparer will not work with remote data.Refer to "+Ha+"/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 _a+": 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=q.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 _a+": ACTION DISABLED \n "+i.fn}},exporting_begin:{type:"exporting_begin",logType:"info",check:function(e){return{success:!0,options:{args:e}}},generateMessage:function(e,t,i){return _a+": 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 _a+": 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 Ga+": FOREIGNKEY CONFIG \n Grid foreign key column needs a valid data source/service.Refer to "+Ha+"/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 Ga+": 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 Ga+": 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:q.isNullOrUndefined(e.column.type),options:e.column.headerText}},generateMessage:function(e,t,i){return Ga+": COLUMN TYPE MISSING-\n "+i+" column type was invalid or not defined.Please go through below help link: "+ja+"/grid/columns/#column-type"}},datasource_syntax_mismatch:{type:"datasource_syntax_mismatch",logType:"warn",check:function(e){return{success:e.dataState.dataSource&&!(e.dataState.dataSource instanceof U.DataManager||"result"in e.dataState.dataSource||e.dataState.dataSource instanceof Array)&&!q.isNullOrUndefined(e.dataState.dataStateChange)}},generateMessage:function(){return Va+": DATASOURCE SYNTAX WARNING\nDataSource should be in the form of {result: Object[], count: number}when dataStateChangeEvent used"}}},Ja=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: "+ja+"/common/internationalization#supported-format-string\nDate format: "+ja+"/common/internationalization#manipulating-datetime\nMessage: "+e},Za=function(e){e=U.DataUtil.getObject("error.error",e);if(q.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:"")},Pa=(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)},function(e,t){function i(){this.constructor=e}Qa(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)}),$a=function(){return($a=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)},o=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},el=(Xa=q.ChildProperty,Pa(tl,Xa),o([q.Property()],tl.prototype,"field",void 0),o([q.Property()],tl.prototype,"direction",void 0),o([q.Property(!1)],tl.prototype,"isFromGroup",void 0),tl);function tl(){return null!==Xa&&Xa.apply(this,arguments)||this}il=q.ChildProperty,Pa(rl,il),o([q.Collection([],el)],rl.prototype,"columns",void 0),o([q.Property(!0)],rl.prototype,"allowUnsort",void 0);var il,nl=rl;function rl(){return null!==il&&il.apply(this,arguments)||this}sl=q.ChildProperty,Pa(al,sl),o([q.Property()],al.prototype,"field",void 0),o([q.Property()],al.prototype,"operator",void 0),o([q.Property()],al.prototype,"value",void 0),o([q.Property()],al.prototype,"matchCase",void 0),o([q.Property(!1)],al.prototype,"ignoreAccent",void 0),o([q.Property()],al.prototype,"predicate",void 0),o([q.Property({})],al.prototype,"actualFilterValue",void 0),o([q.Property({})],al.prototype,"actualOperator",void 0),o([q.Property()],al.prototype,"type",void 0),o([q.Property()],al.prototype,"ejpredicate",void 0),o([q.Property()],al.prototype,"uid",void 0),o([q.Property()],al.prototype,"isForeignKey",void 0),o([q.Property()],al.prototype,"condition",void 0);var sl,ol=al;function al(){return null!==sl&&sl.apply(this,arguments)||this}ll=q.ChildProperty,Pa(dl,ll),o([q.Property(!1)],dl.prototype,"enableCache",void 0),o([q.Property(3)],dl.prototype,"maxBlocks",void 0),o([q.Property(3)],dl.prototype,"initialBlocks",void 0);var ll,hl=dl;function dl(){return null!==ll&&ll.apply(this,arguments)||this}pl=q.ChildProperty,Pa(ul,pl),o([q.Collection([],ol)],ul.prototype,"columns",void 0),o([q.Property("FilterBar")],ul.prototype,"type",void 0),o([q.Property("OnEnter")],ul.prototype,"mode",void 0),o([q.Property(!0)],ul.prototype,"showFilterBarStatus",void 0),o([q.Property(1500)],ul.prototype,"immediateModeDelay",void 0),o([q.Property()],ul.prototype,"operators",void 0),o([q.Property(!1)],ul.prototype,"ignoreAccent",void 0),o([q.Property(!1)],ul.prototype,"enableInfiniteScrolling",void 0),o([q.Property(50)],ul.prototype,"itemsCount",void 0),o([q.Property("Shimmer")],ul.prototype,"loadingIndicator",void 0),o([q.Property(!1)],ul.prototype,"enableCaseSensitivity",void 0),o([q.Property(!1)],ul.prototype,"showFilterBarOperator",void 0);var pl,cl=ul;function ul(){return null!==pl&&pl.apply(this,arguments)||this}gl=q.ChildProperty,Pa(ml,gl),o([q.Property("Row")],ml.prototype,"mode",void 0),o([q.Property("Flow")],ml.prototype,"cellSelectionMode",void 0),o([q.Property("Single")],ml.prototype,"type",void 0),o([q.Property(!1)],ml.prototype,"checkboxOnly",void 0),o([q.Property(!1)],ml.prototype,"persistSelection",void 0),o([q.Property("Default")],ml.prototype,"checkboxMode",void 0),o([q.Property(!1)],ml.prototype,"enableSimpleMultiRowSelection",void 0),o([q.Property(!0)],ml.prototype,"enableToggle",void 0),o([q.Property(!1)],ml.prototype,"allowColumnSelection",void 0);var gl,fl=ml;function ml(){return null!==gl&&gl.apply(this,arguments)||this}yl=q.ChildProperty,Pa(vl,yl),o([q.Property([])],vl.prototype,"fields",void 0),o([q.Property("")],vl.prototype,"key",void 0),o([q.Property("contains")],vl.prototype,"operator",void 0),o([q.Property(!0)],vl.prototype,"ignoreCase",void 0),o([q.Property(!1)],vl.prototype,"ignoreAccent",void 0);var yl,Sl=vl;function vl(){return null!==yl&&yl.apply(this,arguments)||this}Cl=q.ChildProperty,Pa(bl,Cl),o([q.Property()],bl.prototype,"targetID",void 0);var Cl,wl=bl;function bl(){return null!==Cl&&Cl.apply(this,arguments)||this}Il=q.ChildProperty,Pa(Rl,Il),o([q.Property("Both")],Rl.prototype,"wrapMode",void 0);var Il,xl=Rl;function Rl(){return null!==Il&&Il.apply(this,arguments)||this}Tl=q.ChildProperty,Pa(El,Tl),o([q.Property("Normal")],El.prototype,"mode",void 0);var Tl,Dl=El;function El(){return null!==Tl&&Tl.apply(this,arguments)||this}Ol=q.ChildProperty,Pa(Al,Ol),o([q.Property(!0)],Al.prototype,"showDropArea",void 0),o([q.Property(!1)],Al.prototype,"allowReordering",void 0),o([q.Property(!1)],Al.prototype,"showToggleButton",void 0),o([q.Property(!1)],Al.prototype,"showGroupedColumn",void 0),o([q.Property(!0)],Al.prototype,"showUngroupButton",void 0),o([q.Property(!1)],Al.prototype,"disablePageWiseAggregates",void 0),o([q.Property([])],Al.prototype,"columns",void 0),o([q.Property()],Al.prototype,"captionTemplate",void 0),o([q.Property(!1)],Al.prototype,"enableLazyLoading",void 0);var Ol,kl=Al;function Al(){return null!==Ol&&Ol.apply(this,arguments)||this}Fl=q.ChildProperty,Pa(Ll,Fl),o([q.Property(!1)],Ll.prototype,"allowAdding",void 0),o([q.Property(!1)],Ll.prototype,"allowEditing",void 0),o([q.Property(!1)],Ll.prototype,"allowDeleting",void 0),o([q.Property("Normal")],Ll.prototype,"mode",void 0),o([q.Property(!0)],Ll.prototype,"allowEditOnDblClick",void 0),o([q.Property(!0)],Ll.prototype,"showConfirmDialog",void 0),o([q.Property(!1)],Ll.prototype,"showDeleteConfirmDialog",void 0),o([q.Property()],Ll.prototype,"template",void 0),o([q.Property()],Ll.prototype,"headerTemplate",void 0),o([q.Property()],Ll.prototype,"footerTemplate",void 0),o([q.Property("Top")],Ll.prototype,"newRowPosition",void 0),o([q.Property({})],Ll.prototype,"dialog",void 0),o([q.Property(!1)],Ll.prototype,"allowNextRowEdit",void 0),o([q.Property(!1)],Ll.prototype,"showAddNewRow",void 0);var Fl,Ml=Ll;function Ll(){return null!==Fl&&Fl.apply(this,arguments)||this}Pl=q.ChildProperty,Pa(Bl,Pl),o([q.Property("Spinner")],Bl.prototype,"indicatorType",void 0);var Pl,Nl=Bl;function Bl(){return null!==Pl&&Pl.apply(this,arguments)||this}zl=q.Component,Pa(a,zl),(ql=a).prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","groupSettings","columns","searchSettings","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"],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&&!q.isNullOrUndefined(this.scrollPosition)&&!q.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=!q.isNullOrUndefined(this.pagerTemplate),this.addOnPersist(e));return a.template=o,this.setProperties({pageSettings:a},!0),h&&(this.groupSettings.captionTemplate=l),d},a.prototype.requiredModules=function(){this.setFrozenCount(),this.enableInfiniteAggrgate();var e=[];return this.isDestroyed||(this.allowFiltering&&e.push({member:"filter",args:[this,this.filterSettings,this.serviceLocator],name:"Filter"}),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.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.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"}),!q.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},a.prototype.extendRequiredModules=function(e){this.enableInfiniteScrolling&&e.push({member:"infiniteScroll",args:[this,this.serviceLocator],name:"InfiniteScroll"}),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"}),!q.isNullOrUndefined(this.columns)&&this.isForeignKeyEnabled(this.columns)&&e.push({member:"foreignKey",args:[this,this.serviceLocator],name:"ForeignKey"}),this.enableLogger&&e.push({member:"logger",args:[this],name:"Logger"})},a.prototype.resizeCheck=function(){var e=!!this.getColumns().filter(function(e){return!0===e.autoFit}).length,t=(q.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},a.prototype.preRender=function(){this.serviceLocator=new ta,this.initProperties(),this.initializeServices()},a.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=q.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=$a({EmptyRecord:"No records to display",True:"true",False:"false",InvalidFilterMessage:"Invalid Filter Data",GroupDropArea:"Drag a column header here to group its column",UnGroup:"Click here to ungroup",UnGroupButton:"Click here to ungroup",GroupDisable:"Grouping is disabled for this column",FilterbarTitle:"'s filter bar cell",EmptyDataSourceError:"DataSource must not be empty at initial load since columns are generated from dataSource in AutoGenerate Column Grid",Add:"Add",Edit:"Edit",Cancel:"Cancel",Update:"Update",Delete:"Delete",Print:"Print",Pdfexport:"PDF Export",Excelexport:"Excel Export",Wordexport:"Word Export",Csvexport:"CSV Export",Search:"Search",Columnchooser:"Columns",Save:"Save",Item:"item",Items:"items",EditOperationAlert:"No records selected for edit operation",DeleteOperationAlert:"No records selected for delete operation",SaveButton:"Save",OKButton:"OK",CancelButton:"Cancel",EditFormTitle:"Details of ",AddFormTitle:"Add New Record",BatchSaveConfirm:"Are you sure you want to save changes?",BatchSaveLostChanges:"Unsaved changes will be lost. Are you sure you want to continue?",ConfirmDelete:"Are you sure you want to Delete Record?",CancelEdit:"Are you sure you want to Cancel the changes?",ChooseColumns:"Choose Column",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",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"},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"}},a.prototype.render=function(){var e,t;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 Yo(this,this.serviceLocator),this.searchModule=new Da(this),this.scrollModule=new Aa(this),this.notify(ht,{}),this.pageSettings.enableQueryString&&(e=new URL(window.location.href).searchParams.get("page"),!q.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||!q.isNullOrUndefined(this.dataSource)&&this.dataSource.result||(this.isVirtualAdaptive=!0),this.aggregateModule&&this.aggregates.length)for(var i=0;i<this.aggregates.length;i++)for(var n=0;n<this.aggregates[parseInt(i.toString(),10)].columns.length;n++){var r=this.aggregates[parseInt(i.toString(),10)].columns[parseInt(n.toString(),10)];r.types&&(r.type=r.types)}this.isReact?(t={requireTemplateRef:this.requireTemplateRef},this.enableVirtualization||this.enableColumnVirtualization?(t.enableSeamlessScrolling=this.enableSeamlessScrolling,this.trigger(ie,t),this.enableSeamlessScrolling=t.enableSeamlessScrolling,op(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,op(this.enableSeamlessScrolling)):this.trigger(ie),"string"==typeof this.isRowSelectable&&(this.isRowSelectable=q.getValue(this.isRowSelectable,window)),"string"==typeof this.isRowPinned&&(this.isRowPinned=q.getValue(this.isRowPinned,window)),this.isRowPinned&&this.allowSelection&&(this.selectionSettings.persistSelection=!0,this.selectionSettings.type="Multiple"),sh(this.columns,this.enableColumnVirtualization,this),this.enableColumnVirtualization&&this.isChangeDataSourceCall&&this.columnModel&&(this.columnModel=[],this.updateColumnModel(this.columns)),this.isPreparedFrozenColumns=!0,this.enablePersistence&&this.notify(sn,{}),this.getMediaColumns(),rh(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(dt,{}),"Shimmer"===this.loadingIndicator.indicatorType&&this.refreshMaskRow(),this.refreshing&&this.trigger("created")},a.prototype.setInitialFrozenColumnIndex=function(e){for(var t=0;t<e.length;t++){var i=e[parseInt(t.toString(),10)];i[Ms]=i.index,i.columns&&this.setInitialFrozenColumnIndex(i.columns)}},a.prototype.showSpinner=function(){this.isExportGrid||F.showSpinner(this.element)},a.prototype.hideSpinner=function(){this.isExportGrid||F.hideSpinner(this.element)},a.prototype.showMaskRow=function(e,t){if(!q.isNullOrUndefined(this.headerModule)&&!q.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(!q.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")),q.isNullOrUndefined(i.querySelector("tbody")))||(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.footerContentMaskTable=this.createMaskTable(t))),this.enableVirtualization&&e||q.EventHandler.add(r,"scroll",this.translateMaskRow,this)):(s=0===(i=r.getBoundingClientRect().height)?this.allowPaging?this.pageSettings.pageSize*this.getRowHeight():window.innerHeight:i,t=Math.ceil(s/this.getRowHeight()),"Vertical"!==this.rowRenderingMode&&(this.headerMaskTable=this.createEmptyMaskTable(n,1)),this.contentMaskTable=this.createEmptyMaskTable(r,t))}},a.prototype.getContentMaskColumns=function(){return this.getColumns()},a.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},a.prototype.createFrozenMaskRow=function(e,t){for(var i=0;i<e.length;i++)i<this.frozenLeftCount?(this.frozenLeftCount-1===i&&e[parseInt(i.toString(),10)].classList.add("e-freezeleftborder"),e[parseInt(i.toString(),10)].classList.add("e-leftfreeze"),e[parseInt(i.toString(),10)].setAttribute("aria-colindex",(i+1).toString()),e[parseInt(i.toString(),10)].style.left=t[parseInt(i.toString(),10)].valueX-this.translateX+"px"):e.length-this.frozenRightCount<=i&&t[parseInt(i.toString(),10)]&&(e.length-this.frozenRightCount===i&&e[parseInt(i.toString(),10)].classList.add("e-freezerightborder"),e[parseInt(i.toString(),10)].classList.add("e-rightfreeze"),e[parseInt(i.toString(),10)].setAttribute("aria-colindex",(i+1).toString()),e[parseInt(i.toString(),10)].style.right=this.translateX+t[parseInt(i.toString(),10)].valueX+"px")},a.prototype.createMaskTable=function(e,t,i){var n=!!q.closest(e,".e-gridheader"),r=!!q.closest(e,".e-gridcontent"),s=!!q.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"),q.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()&&(w=[].slice.call(p.querySelectorAll(".e-rowcell")),this.createFrozenMaskRow(w,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 S,v=o,f=Math.ceil(v.getBoundingClientRect().height/this.getRowHeight());if(this.allowPaging&&this.pageSettings.pageSize!==this.currentViewData.length&&this.pagerModule.pagerObj.totalPages!==this.pageSettings.currentPage){(S=(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?S:p).cloneNode(!0))}if(c.querySelector(".e-emptyrow")||!c.childNodes.length||r&&this.childGrid){(S=(p=this.createMaskRow(d,t)).cloneNode(!0)).classList.add("e-altrow");for(m=0;m<f;m++)y.appendChild(((m+1)%2==0?S:p).cloneNode(!0))}else{var v='tr:not(.e-hide):not([style*="display:none"]):not([style*="display: none"])',u=(this.isTreeGrid&&(v='tr:not(.e-hide):not([style*="display:none"]):not([style*="display: none"]):not(.e-childrow-hidden)'),[].slice.call(c.querySelectorAll(v))),d=c.querySelector(".e-addedrow, .e-editedrow"),v=void 0;if(d){if(v=u.indexOf(d),this.isFrozenGrid()&&this.enableColumnVirtualization)for(var C=[].slice.call(u[v+1].querySelectorAll(".e-rowcell")),m=0;m<C.length;m++)m<this.frozenLeftCount?(C[parseInt(m.toString(),10)].classList.add("e-leftfreeze"),C[parseInt(m.toString(),10)].setAttribute("aria-colindex",(m+1).toString()),C[parseInt(m.toString(),10)].style.left=t[parseInt(m.toString(),10)].valueX-this.translateX+"px"):C.length-this.frozenRightCount<=m&&t[parseInt(m.toString(),10)]&&(C[parseInt(m.toString(),10)].classList.add("e-rightfreeze"),C[parseInt(m.toString(),10)].setAttribute("aria-colindex",(m+1).toString()),C[parseInt(m.toString(),10)].style.right=this.translateX+t[parseInt(m.toString(),10)].valueX+"px");d.classList.contains("e-addedrow")?u.splice(v,2):u.splice(v,1)}f=(!this.enableVirtualization&&!this.enableColumnVirtualization||!i)&&f<=u.length?f:u.length;for(m=0;m<f;m++){var w,b=this.applyMaskRow(u[parseInt(m.toString(),10)].cloneNode(!0),u[parseInt(m.toString(),10)].getBoundingClientRect().height);this.enableColumnVirtualization&&"X"===i&&this.isFrozenGrid()&&(w=[].slice.call(b.querySelectorAll(".e-masked-cell")),this.createFrozenMaskRow(w,t)),y.appendChild(b)}this.addMaskRows(y,f/2,u[0],r,i),d&&d.classList.contains("e-editedrow")&&v<f&&((c=y.childNodes[parseInt(v.toString(),10)]).style.height=this.getRowHeight()+"px",c.classList.add("e-row"),d.classList.contains("e-altrow"))&&c.classList.add("e-altrow")}}if(h.appendChild(y),s){for(var v=l.querySelector("tfoot"),I=v.cloneNode(),u=(I.setAttribute("class","e-masked-tfoot"),[].slice.call(v.querySelectorAll("tr"))),m=0;m<u.length;m++)I.appendChild(this.applyMaskRow(u[parseInt(m.toString(),10)].cloneNode(!0),u[parseInt(m.toString(),10)].getBoundingClientRect().height));h.appendChild(I)}return n&&this.isFrozenGrid()&&!this.enableColumnVirtualization&&(this.getHeaderContent().querySelector("."+rs).style.position="relative"),e.insertBefore(h,e.firstChild),!r||this.enableVirtualization&&i||(d=a-h.getBoundingClientRect().height,c=o.scrollTop<=(d=d<0?0:d)?o.scrollTop:d,this.enableVirtualization&&(c-=id(q.closest(e,".e-virtualtable")).height),h.style.transform="translate(0px,"+c+"px)"),h},a.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)}},a.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")&&(q.removeClass([r],["e-fixedfreeze","e-freezeleftborder","e-freezerightborder"]),q.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},a.prototype.createMaskRow=function(e,t){for(var i=e,n=t,r=this.createElement("tr",{className:"e-masked-row e-row"}),s=("Vertical"!==this.rowRenderingMode&&(r.style.height=this.getRowHeight()+"px"),this.createElement("td",{className:"e-masked-cell e-rowcell"})),o=0,a=0;o<i.childNodes.length;o++){var l=i.childNodes[parseInt(o.toString(),10)],h=s.cloneNode();h.innerHTML=this.getShimmerTemplate(),l.classList.contains("e-group-intent")||l.classList.contains("e-detail-intent")||l.classList.contains("e-drag-intent")?l.classList.contains("e-group-intent")?h.firstChild.classList.add("e-mask-group-intent"):l.classList.contains("e-detail-intent")?h.firstChild.classList.add("e-mask-detail-intent"):l.classList.contains("e-drag-intent")&&h.firstChild.classList.add("e-mask-drag-intent"):("Vertical"===this.rowRenderingMode&&n[parseInt(a.toString(),10)]&&h.setAttribute("data-cell",n[parseInt(a.toString(),10)].headerText?n[parseInt(a.toString(),10)].headerText:n[parseInt(a.toString(),10)].field),"none"===l.style.display?h.classList.add("e-hide"):(h.style.textAlign=n[parseInt(a.toString(),10)]&&n[parseInt(a.toString(),10)].textAlign?n[parseInt(a.toString(),10)].textAlign.toLowerCase():this.enableRtl?"right":"left",n[parseInt(a.toString(),10)]&&("checkbox"===n[parseInt(a.toString(),10)].type||n[parseInt(a.toString(),10)].displayAsCheckBox)&&h.firstChild.classList.add("e-mask-checkbox-intent")),a++),r.appendChild(h)}return r},a.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>'},a.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")},a.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-=id(q.closest(s,".e-virtualtable")).height),s.style.transform="translate(0px,"+r+"px)")}},a.prototype.removeMaskRow=function(){q.isNullOrUndefined(this.contentModule)||(e=this.getContent().firstChild,q.EventHandler.remove(e,"scroll",this.translateMaskRow)),this.headerMaskTable&&this.isFrozenGrid()&&!this.enableColumnVirtualization&&(this.getHeaderContent().querySelector("."+rs).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&&q.remove(n)}this.headerMaskTable=null,this.contentMaskTable=null,this.footerContentMaskTable=null},a.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))},a.prototype.refreshMaskRowColgroupWidth=function(e){var t=e.querySelector("table:not(.e-masked-table)"),i=t.querySelector(bs).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");q.remove(e.querySelector(".e-masked-colgroup")),e.insertBefore(i,e.firstChild),e.style.width=t.getBoundingClientRect().width+"px"},a.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")},a.prototype.getMediaColumns=function(){if(!this.enableColumnVirtualization){var e=this.getColumns();if(this.getShowHideService=this.serviceLocator.getService("showHideService"),!q.isNullOrUndefined(e))for(var t=0;t<e.length;t++)q.isNullOrUndefined(e[parseInt(t.toString(),10)].hideAtMedia)||!q.isNullOrUndefined(e[parseInt(t.toString(),10)].visible)&&!e[parseInt(t.toString(),10)].visible||this.pushMediaColumn(e[parseInt(t.toString(),10)],t)}this.updateFrozenColumnsWidth()},a.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)])},a.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)}},a.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"))},a.prototype.refreshMediaCol=function(){this.isInitialLoad=!0;var e=this.element.querySelector("."+ns);this.aggregates.length&&this.element.scrollHeight>parseInt(this.height.toString(),10)&&e&&q.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),q.removeClass([this.element],"e-gridhover")),this.enableAdaptiveUI&&this.scrollModule&&this.scrollModule.refresh(),this.isFrozenGrid()&&this.isAutoGenerateColumns&&(this.widthService.setWidthToColumns(),this.isAutoGenerateColumns=!1)},a.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])},a.prototype.eventInitializer=function(){},a.prototype.destroy=function(){var e=this.element;if(e){for(var e=!(!e.querySelector("."+ts)||!e.querySelector("."+is)),t=(e&&this.unwireEvents(),this.removeListener(),this.removeMediaListener(),this.notify(s,{}),this.destroyDependentModules(),this.isReact&&this.destroyTemplate(["template"]),this.isVue&&this.destroyTemplate(),e&&zl.prototype.destroy.call(this),this.toolTipObj.destroy(),this.isReact&&!q.Browser.isIE&&(this.element.innerHTML=""),["renderModule","headerModule","contentModule","valueFormatterService","serviceLocator","ariaService","keyboardModule","widthService","searchModule","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="",q.classList(this.element,[],["e-rtl","e-gridhover","e-responsive","e-default","e-device","e-grid-min-height"])}},a.prototype.destroyDependentModules=function(){var e=this.element;e&&(e.querySelector("."+ts)||e.querySelector("."+is))&&(this.scrollModule.destroy(),this.keyboardModule.destroy(),this.focusModule.destroy(),this.clipboardModule.destroy(),this.printModule.destroy())},a.prototype.getModuleName=function(){return"grid"},a.prototype.enableBoxSelection=function(){this.enableAutoFill?(this.selectionSettings.cellSelectionMode="BoxWithBorder",this.element.classList.add("e-afenabled")):(this.element.classList.remove("e-afenabled"),this.notify(Ft,{}))},a.prototype.setCSSClass=function(e){this.cssClass&&q.addClass([this.element],this.cssClass.split(" ")),e&&q.removeClass([this.element],e.split(" "))},a.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"allowPaging":this.notify(g,{module:"pager",enable:this.allowPaging}),n=!0,"100%"===this.height&&this.scrollModule.refresh(),this.getDataModule().clearCache();break;case"pageSettings":if(this.pageTemplateChange)this.pageTemplateChange=!1,this.notify(gt,{module:"pager",properties:e.pageSettings});else{if(this.pagerModule&&this.pagerModule.isCancel)return void(this.pagerModule.isCancel=!1);this.notify(gt,{module:"pager",properties:e.pageSettings}),(q.isNullOrUndefined(e.pageSettings.currentPage)&&q.isNullOrUndefined(e.pageSettings.pageSize)&&q.isNullOrUndefined(e.pageSettings.totalRecordsCount)||!q.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(g,{module:"sort",enable:this.allowSorting}),i=n=!0;break;case"allowFiltering":this.updateStackedFilter(),this.notify(g,{module:"filter",enable:this.allowFiltering}),n=!0,"FilterBar"!==this.filterSettings.type||this.editSettings.showAddNewRow&&"FilterBar"===this.filterSettings.type?this.refreshHeader():"100%"===this.height&&this.scrollModule.refresh();break;case"height":case"width":this.notify(g,{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(g,{module:"rowDragAndDrop",enable:this.allowRowDragAndDrop}),this.renderModule.refresh(),this.headerModule.refreshUI();break;case"allowSelection":this.notify(g,{module:"selection",enable:this.allowSelection}),this.renderModule.refresh();break;case"cssClass":this.setCSSClass(t.cssClass);break;case"enableAutoFill":this.selectionModule&&(this.enableBoxSelection(),this.selectionModule.updateAutoFillPosition());break;case"rowTemplate":this.rowTemplateFn=th(this.rowTemplate),n=!0;break;case"emptyRecordTemplate":this.emptyRecordTemplateFn=th(this.emptyRecordTemplate),n=!0;break;case"detailTemplate":this.detailTemplateFn=th(this.detailTemplate),n=!0;break;case"allowGrouping":this.notify(g,{module:"group",enable:this.allowGrouping}),this.headerModule.refreshUI(),i=n=!0,"100%"===this.height&&this.scrollModule.refresh();break;case"enableInfiniteScrolling":case"childGrid":if(n=!0,o=(p=this.parentDetails?document.querySelector("#"+this.parentDetails.parentID):null)?p.ej2_instances[0]:null,this.childGrid&&o&&q.isNullOrUndefined(o.childGrid.childGrid)){var p=Object.assign({},o.childGrid,{childGrid:e.childGrid});for(o.setProperties({childGrid:p},!0);!q.isNullOrUndefined(o.parentDetails);){var c,u=document.querySelector("#"+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(g,{module:"toolbar"}),"100%"===this.height&&this.scrollModule.refresh();break;case"groupSettings":this.notify(gt,{module:"group",properties:e.groupSettings,oldProperties:t.groupSettings});break;case"aggregates":!this.aggregates.length&&this.allowGrouping&&this.groupSettings.columns.length&&(n=!0),this.notify(g,{module:"aggregate",properties:e}),"100%"===this.height&&this.scrollModule.refresh();break;case"frozenColumns":case"frozenRows":case"enableVirtualization":case"enableColumnVirtualization":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(ft,{requestType:"refresh"}),n=!1,this.maintainSelection(e.selectedRowIndex))}},a.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(Bi,{});break;case"enableAltRow":this.renderModule.refresh();break;case"allowResizing":this.resizeModule&&this.resizeModule.render(),this.headerModule.refreshUI(),this.updateResizeLines();break;case"rowHeight":this.rowHeight?q.addClass([this.element],"e-grid-min-height"):q.removeClass([this.element],"e-grid-min-height"),this.renderModule.refresh(),this.headerModule.refreshUI();break;case"gridLines":this.updateGridLines();break;case"showColumnMenu":this.headerModule.refreshUI(),this.notify(g,{module:"columnMenu",enable:!0});break;case"columnMenuItems":this.notify(g,{module:"columnMenu",enable:this.columnMenuItems});break;case"contextMenuItems":this.notify(g,{module:"contextMenu",enable:this.contextMenuItems});break;case"showColumnChooser":this.toolbarModule&&this.toolbarModule.refreshToolbarItems(),this.notify(g,{module:"columnChooser",enable:this.showColumnChooser});break;case"columnChooserSettings":this.notify(gt,{module:"columnChooser"});break;case"filterSettings":this.updateStackedFilter(),this.notify(gt,{module:"filter",properties:t.filterSettings});break;case"searchSettings":this.notify(gt,{module:"search",properties:t.searchSettings});break;case"sortSettings":this.notify(gt,{module:"sort"});break;case"selectionSettings":this.notify(gt,{module:"selection",properties:t.selectionSettings});break;case"editSettings":this.notify(gt,{module:"edit",properties:t.editSettings});break;case"allowTextWrap":case"textWrapSettings":this.allowTextWrap?this.applyTextWrap():this.removeTextWrap(),this.notify(Ci,{case:"textwrap",isModeChg:"textWrapSettings"===e}),this.refreshHeader(),"100%"===this.height&&this.scrollModule.refresh();break;case"dataSource":var n,r=this.getDataModule().getState();if(!this.allowPaging||!this.pageSettings.pageSizes||this.getDataModule().isRemote()||r&&r.isPending||this.pagerModule.pagerObj.isAllPage&&(n=this.dataSource instanceof U.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===n?(this.setProperties({pageSettings:{pageSize:n}},!0),this.pagerModule.pagerObj.setProperties({pageSize:n},!0)):this.pagerModule.pagerObj.isAllPage=!1),!this.allowSelection||!this.isPersistSelection||r&&r.isPending||this.clearSelection(),this.partialSelectedRecords=[],this.partialSelectedIndexes=[],this.disableSelectedRecords=[],this.renderModule.selectableDataKey={},this.renderModule.nonselectableDataKey={},!q.isNullOrUndefined(this.dataSource)&&this.dataSource.result&&(this.isVirtualAdaptive=!1),Object.getPrototypeOf(t).deepWatch)for(var s=this.getPrimaryKeyFieldNames()[0],o=0,a=Object.keys(t.dataSource);o<a.length;o++)this.setRowData(q.getValue(s,this.dataSource[a[parseInt(o.toString(),10)]]),this.dataSource[a[parseInt(o.toString(),10)]]);else if(r.isPending){var l=q.isNullOrUndefined(this.dataSource)?[]:this.dataSource.result;if((h=r.group||[]).length&&!this.groupSettings.enableLazyLoading&&(!l.length||!l[0].field))for(o=0;o<h.length;o++)l=U.DataUtil.group(l,h[parseInt(o.toString(),10)],r.aggregates||[]);this.dataSource={result:l,count:this.dataSource.count,aggregates:this.dataSource.aggregates},this.getDataModule().setState({}),r.resolver(this.dataSource)}else{if(!q.isNullOrUndefined(this.dataSource)&&this.dataSource.result&&this.dataSource.count&&this.groupSettings.columns.length){var h,l=this.dataSource.result;if((h=this.groupSettings.columns).length&&(!l.length||!l[0].field))for(o=0;o<h.length;o++)l=U.DataUtil.group(l,h[parseInt(o.toString(),10)]);this.dataSource={result:l,count:this.dataSource.count}}this.getDataModule().setState({isDataChanged:!1}),this.notify(_t,{}),i||(this.isRowSelectable&&!this.isRemote()&&(n=this.getDataModule().dataManager.executeLocal(this.getDataModule().generateQuery(!0)),this.renderModule.setPartialRecord(n)),this.renderModule.refresh(),this.isCheckBoxSelection&&this.notify(Xn,{}))}this.scrollRefresh();break;case"enableHover":(t.enableHover?q.addClass:q.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(hr,{});break;case"rowRenderingMode":this.enableVerticalRendering(),this.notify(pr,{}),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()}},a.prototype.maintainSelection=function(e){var t,i=this;-1!==e&&this.on(ct,t=function(){i.selectRow(e),i.off(ct,t)},this)},a.prototype.setProperties=function(e,t){var i=this.groupSettings.columns,n="frozenColumns",r=(null!==e[n]&&0!==e[n]||!t||this.resetFrozenColumns(),zl.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&&q.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}},a.prototype.getTablesCount=function(){return this.tablesCount},a.prototype.isRemote=function(){return this.getDataModule().isRemote()||!q.isNullOrUndefined(this.dataSource)&&!q.isNullOrUndefined(this.dataSource.result)},a.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")},a.prototype.updateColumnModel=function(e,t){for(var i=0,n=q.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)]);!q.isNullOrUndefined(t)&&t||this.updateLockableColumns()},a.prototype.getFrozenLeftCount=function(){return this.getFrozenColumns()||this.getFrozenLeftColumnsCount()},a.prototype.isFrozenGrid=function(){return 0!==this.getFrozenColumns()||0!==this.frozenLeftColumns.length||0!==this.frozenRightColumns.length||0!==this.fixedColumns.length},a.prototype.getFrozenMode=function(){return this.frozenName},a.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++))},a.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++},a.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},a.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&&!q.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)},a.prototype.getPersistColumns=function(){var e=JSON.parse(this.addOnPersist(["columns"])).columns;return e?JSON.stringify(e):""},a.prototype.setColumns=function(e){!q.isNullOrUndefined(e)&&e instanceof Array&&e.length&&this.setProperties({columns:e},!1)},a.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},a.prototype.getColumnIndexesInView=function(){return this.inViewIndexes},a.prototype.getQuery=function(){return this.query},a.prototype.getLocaleConstants=function(){return this.defaultLocale},a.prototype.setColumnIndexesInView=function(e){this.inViewIndexes=e},a.prototype.getVisibleColumns=function(){return this.getCurrentVisibleColumns()},a.prototype.getHeaderContent=function(){return this.headerModule.getPanel()},a.prototype.setGridHeaderContent=function(e){this.headerModule.setPanel(e)},a.prototype.getContentTable=function(){return this.contentModule.getTable()},a.prototype.setGridContentTable=function(e){this.contentModule.setTable(e)},a.prototype.getContent=function(){return this.contentModule.getPanel()},a.prototype.setGridContent=function(e){this.contentModule.setPanel(e)},a.prototype.getHeaderTable=function(){return this.headerModule.getTable()},a.prototype.setGridHeaderTable=function(e){this.headerModule.setTable(e)},a.prototype.getFooterContent=function(){return this.footerElement=this.element.getElementsByClassName(ns)[0],this.footerElement},a.prototype.getFooterContentTable=function(){return this.footerElement=this.element.getElementsByClassName(ns)[0],this.footerElement.firstChild.firstChild},a.prototype.getPager=function(){return this.gridPager},a.prototype.setGridPager=function(e){this.gridPager=e},a.prototype.getRowByIndex=function(e){return(this.enableVirtualization&&this.groupSettings.enableLazyLoading?this.lazyLoadRender:this.contentModule).getRowByIndex(e)},a.prototype.getMovableRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},a.prototype.getFrozenRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},a.prototype.getRows=function(){return this.contentModule.getRowElements()},a.prototype.getFrozenRightRowByIndex=function(e){return this.contentModule.getRowByIndex(e)},a.prototype.getRowInfo=function(e){var t=e,i={target:e};if(!q.isNullOrUndefined(e)&&q.isNullOrUndefined(x(t,"e-detailrowcollapse")&&q.isNullOrUndefined(x(t,"e-recordplusexpand")))){var n=q.closest(t,"."+b);if(!n)return l=q.closest(t,"."+I),q.isNullOrUndefined(l)||l.classList.contains("e-addedrow")||(o=this.getRowObjectFromUID(l.getAttribute("data-uid")),r=parseInt(l.getAttribute(T),10)-1,i={row:l,rowData:o.data,rowIndex:r}),i;var r,s,o,a,l=parseInt(n.getAttribute(ws),10)-1,h=q.closest(n,"."+I);q.isNullOrUndefined(n)||isNaN(l)||q.isNullOrUndefined(h)||(r=parseInt(h.getAttribute(T),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&&!q.isNullOrUndefined(e)&&x(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},a.prototype.getMovableRows=function(){return this.contentModule.getRowElements()},a.prototype.getFrozenRightRows=function(){return this.contentModule.getRowElements()},a.prototype.getDataRows=function(){return this.getAllDataRows()},a.prototype.getAllDataRows=function(e){var t,i;return q.isNullOrUndefined(this.getContentTable().querySelector(H))?[]:(i=this.getContentTable().querySelector(H),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(H),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))},a.prototype.addMovableRows=function(e,t){for(var i=0,n=t.length;i<n;i++)e.push(t[parseInt(i.toString(),10)]);return e},a.prototype.generateDataRows=function(e,t){for(var i=[],n=0,r=e.length;n<r;n++)!e[parseInt(n.toString(),10)].classList.contains(I)||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},a.prototype.getMovableDataRows=function(){return this.getAllMovableDataRows()},a.prototype.getAllMovableDataRows=function(e){return this.getAllDataRows(e)},a.prototype.getFrozenDataRows=function(){return this.getAllFrozenDataRows()},a.prototype.getAllFrozenDataRows=function(e){return this.getAllDataRows(e)},a.prototype.getFrozenRightDataRows=function(){return this.getAllFrozenRightDataRows()},a.prototype.getAllFrozenRightDataRows=function(e){return this.getAllDataRows(e)},a.prototype.setCellValue=function(t,e,i){var n,r,s=this.getPrimaryKeyFieldNames()[0],o=new eo(this,this.serviceLocator),a=this.getColumnIndexByField(e),l=this.getColumnByField(e),h=this.contentModule.getRows().filter(function(e){return q.getValue(s,e.data)===t})[0],d=h?this.element.querySelector("[data-uid="+h.uid+"]"):null;q.isNullOrUndefined(d)||("string"==typeof i&&(i=this.sanitize(i)),q.setValue(e,i,h.data),n=this.enableVirtualization?d.children[parseInt(a.toString(),10)]:this.getCellFromIndex(h.index,a),q.isNullOrUndefined(n))||(this.groupSettings.columns.length&&(a+=this.groupSettings.columns.length),(this.childGrid||this.detailTemplate)&&a++,this.isRowDragable()&&a++,r=h.cells[+a],o.refreshTD(n,r,h.data,{index:h.index}),this.isReact&&(n=this.enableVirtualization?d.children[parseInt(a.toString(),10)]:this.getCellFromIndex(h.index,a)),0<this.aggregates.length&&(this.notify(Dt,{}),0<this.groupSettings.columns.length)&&this.notify(Tt,{}),q.isNullOrUndefined(h)||q.isNullOrUndefined(h.changes)||(h.changes[""+e]=i),this.trigger(re,{cell:n,column:l,data:h.data}),this.isReact&&"0"===n.getAttribute("tabindex")&&n.classList.contains("e-focused")&&n.focus())},a.prototype.setCellValueAsync=function(i,n,r,s){var o=this;return new Promise(function(e,t){try{o.setCellValue(i,n,r),!q.isNullOrUndefined(s)&&0<s?setTimeout(function(){e()},s):e()}catch(e){t(e)}})},a.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()})},a.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&&x(e[parseInt(o.toString(),10)],"e-childgrid")&&(l=(a=x(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&&!q.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 eo(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}},a.prototype.refreshGroupCaptionFooterTemplate=function(){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&&x(t[parseInt(i.toString(),10)],"e-childgrid")?(n=x(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(Et,r))}},a.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 lo(l,l.serviceLocator),t=x(l.element.querySelectorAll("[data-mappinguid="+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?q.classList(i,["e-ascending","e-icon-ascending"],[]):q.classList(i,["e-descending","e-icon-descending"],[]))}(e)},a.prototype.setRowData=function(t,e){var i=this.contentModule.getRows(),n=this.getPrimaryKeyFieldNames()[0],i=(i=0<this.groupSettings.columns.length&&0<this.aggregates.length?i.filter(function(e){return e.isDataRow}):i).filter(function(e){return q.getValue(n,e.data)===t})[0],r=i?[].slice.call(this.element.querySelectorAll("[data-uid="+i.uid+"]")):void 0;!q.isNullOrUndefined(i)&&r.length&&(i.changes=e,this.frozenRows?(r=this.getRowsObject()[i.index],this.setFrozenRowData(r,e)):(r=!(!(r=this.getRowElementByUID(i.uid))||!r.querySelector(".e-lastrowcell")),this.setFrozenRowData(i,e),r&&this.scrollModule.setLastRowCell()),0<this.aggregates.length)&&(this.notify(Dt,{}),0<this.groupSettings.columns.length)&&this.notify(Tt,{})},a.prototype.setRowDataAsync=function(i,n,r){var s=this;return new Promise(function(e,t){try{s.setRowData(i,n),!q.isNullOrUndefined(r)&&0<r?setTimeout(function(){e()},r):e()}catch(e){t(e)}})},a.prototype.setFrozenRowData=function(e,t){var i=new Ls(this.serviceLocator,null,this);e.changes=t,Hh(e,this.getForeignKeyColumns(),e.changes),i.refresh(e,this.getColumns(),!0)},a.prototype.getCellFromIndex=function(e,t){var i=this.getColumnByIndex(t);return Fd(this,0,e,t)},a.prototype.getMovableCellFromIndex=function(e,t){return this.getCellFromIndex(e,t)},a.prototype.getFrozenRightCellFromIndex=function(e,t){return this.getCellFromIndex(e,t)},a.prototype.getColumnHeaderByIndex=function(e){return this.getHeaderTable().getElementsByClassName("e-headercell")[parseInt(e.toString(),10)]},a.prototype.getMovableColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},a.prototype.getFrozenRightColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},a.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.getColumnHeaderByIndex(e)},a.prototype.getRowObjectFromUID=function(e){var t=this.contentModule.getRows(),t=this.rowObject(t,e);if(q.isNullOrUndefined(t)&&this.pinnedTopRowModels.length){var i=this.pinnedTopRowModels,t=this.rowObject(i,e);if(!q.isNullOrUndefined(t))return t}return q.isNullOrUndefined(t)&&this.enableVirtualization&&0<this.groupSettings.columns.length?this.rowObject(this.vRows,e):t},a.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},a.prototype.getRowsObject=function(){return this.contentModule.getRows()},a.prototype.getMovableRowsObject=function(){return this.contentModule.getRows()},a.prototype.getFrozenRightRowsObject=function(){return this.contentModule.getRows()},a.prototype.getColumnHeaderByField=function(e){e=this.getColumnByField(e);return e?this.getColumnHeaderByUid(e.uid):void 0},a.prototype.getColumnHeaderByUid=function(e){e=this.getHeaderContent().querySelector("[data-mappinguid="+e+"]");return e?q.closest(e,"th"):void 0},a.prototype.getColumnByIndex=function(i){var n;return this.getColumns().some(function(e,t){return n=e,t===i}),n},a.prototype.getColumnByField=function(t){return $l(this.getColumns(),function(e){if(e.field===t)return e})[0]},a.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},a.prototype.getColumnByUid=function(t,e){return $l((e?this.columns:this.getColumns()).concat(this.getStackedColumns(this.columns)),function(e){if(e.uid===t)return e})[0]},a.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},a.prototype.getColumnIndexByUid=function(i){var e=$l(this.getColumns(),function(e,t){if(e.uid===i)return t})[0];return q.isNullOrUndefined(e)?-1:e},a.prototype.getUidByColumnField=function(t){return $l(this.getColumns(),function(e){if(e.field===t)return e.uid})[0]},a.prototype.getNormalizedColumnIndex=function(e){return this.getColumnIndexByUid(e)+this.getIndentCount()},a.prototype.getIndentCount=function(){var e=0;return this.allowGrouping&&(e+=this.groupSettings.columns.length),this.isDetail()&&e++,this.isRowDragable()&&q.isNullOrUndefined(this.rowDropSettings.targetID)&&e++,e},a.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},a.prototype.getRowTemplate=function(){return this.rowTemplateFn},a.prototype.getEmptyRecordTemplate=function(){return this.emptyRecordTemplateFn},a.prototype.getDetailTemplate=function(){return this.detailTemplateFn},a.prototype.getEditTemplate=function(){return this.editTemplateFn},a.prototype.getEditHeaderTemplate=function(){return this.editHeaderTemplateFn},a.prototype.getEditFooterTemplate=function(){return this.editFooterTemplateFn},a.prototype.getColumnChooserTemplate=function(){return this.columnChooserTemplateFn},a.prototype.getColumnChooserHeaderTemplate=function(){return this.columnChooserHeaderTemplateFn},a.prototype.getColumnChooserFooterTemplate=function(){return this.columnChooserFooterTemplateFn},a.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},a.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())},a.prototype.refreshHeader=function(){this.headerModule.refreshUI()},a.prototype.getSelectedRows=function(){return this.selectionModule?this.selectionModule.selectedRecords:[]},a.prototype.getSelectedRowIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowIndexes:[]},a.prototype.getSelectedRowCellIndexes=function(){return this.selectionModule?this.selectionModule.selectedRowCellIndexes:[]},a.prototype.getSelectedRecords=function(){return this.selectionModule?this.selectionModule.getSelectedRecords():[]},a.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},a.prototype.getDataModule=function(){return this.renderModule.data},a.prototype.showColumns=function(e,t){this.showHider.show(e,t=t||"headerText")},a.prototype.hideColumns=function(e,t){this.showHider.hide(e,t=t||"headerText")},a.prototype.getFrozenColumns=function(){return this.frozenColumns+this.getFrozenCount(this.columns,0,0)},a.prototype.getFrozenRightColumnsCount=function(){return this.frozenRightCount||this.rightcount},a.prototype.getFrozenLeftColumnsCount=function(){return this.frozenLeftCount||this.leftcount},a.prototype.getMovableColumnsCount=function(){return this.movableCount||this.movablecount},a.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)];q.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),!q.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=q.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-wh())<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)},a.prototype.refreshSplitFrozenColumn=function(){this.splitFrozenCount(this.columns),this.updateFrozenColumnsWidth(),this.isAutoGenerateColumns=!0},a.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},a.prototype.getVisibleFrozenLeftCount=function(){return this.visibleFrozenLeft},a.prototype.getVisibleFrozenRightCount=function(){return this.visibleFrozenRight},a.prototype.getVisibleMovableCount=function(){return this.visibleMovable},a.prototype.getFrozenRightColumns=function(){return this.frozenRightColumns},a.prototype.getFrozenLeftColumns=function(){return this.frozenLeftColumns},a.prototype.getMovableColumns=function(){return this.movableColumns},a.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++)},a.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)]))},a.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)},a.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)},a.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)},a.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<(q.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)},a.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)},a.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&&q.isNullOrUndefined(e.columns[parseInt(i.toString(),10)].columns)&&(!q.isNullOrUndefined(e.columns[parseInt(i.toString(),10)].freeze)||e.columns[parseInt(i.toString(),10)].isFrozen)&&t.push("true");else!e.visible||q.isNullOrUndefined(e.freeze)&&!e.isFrozen||t.push("true")},a.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},a.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},a.prototype.frozenLeftBorderColumns=function(e){var t;q.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")},a.prototype.frozenRightBorderColumns=function(e){var t;q.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")},a.prototype.getVisibleFrozenColumns=function(){return this.getVisibleFrozenColumnsCount()+this.getVisibleFrozenCount(this.columns,0)},a.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(ft,{requestType:"pin-row"})},a.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(ft,{requestType:"unpin-row"})},a.prototype.getFilterUIInfo=function(){return this.filterModule?this.filterModule.getFilterUIInfo():{}},a.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},a.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},a.prototype.getFrozenCount=function(e,t,i){for(var n=0,r=q.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},a.prototype.goToPage=function(e){this.pagerModule&&this.pagerModule.goToPage(e)},a.prototype.goToPageAsync=function(e){var t=this;return this.pagerModule?this.executeAsyncOperation("paging",function(){return t.pagerModule.goToPage(e)}):Promise.resolve()},a.prototype.updateExternalMessage=function(e){this.pagerModule&&!this.pagerTemplate&&this.pagerModule.updateExternalMessage(e)},a.prototype.sortColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},a.prototype.executeAsyncOperation=function(s,o){var a=this;return new Promise(function(t,e){var i=function(e){e.requestType===s&&(a.removeEventListener(p,i),a.off(oe,r),a.off(Hi,n),t())},n=function(e){e.requestType===s&&(a.removeEventListener(p,i),a.off(oe,r),a.off(Hi,n),t())},r=function(){a.removeEventListener(p,i),a.off(oe,r),a.off(Hi,n),e()};a.on(Hi,n),a.addEventListener(p,i),a.addEventListener(oe,r),o()})},a.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()},a.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.allowGrouping&&this.setProperties({groupSettings:{columns:[]}},!0),t&&t.length&&this.setProperties({columns:t},!0),e&&(q.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},a.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},a.prototype.clearSortingAsync=function(){var e=this;return this.sortModule?this.executeAsyncOperation("sorting",function(){return e.sortModule.clearSorting()}):Promise.resolve()},a.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},a.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()},a.prototype.filterByColumn=function(e,t,i,n,r,s,o,a){this.filterModule&&this.filterModule.filterByColumn(e,t,i,n,r,s,o,a)},a.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()},a.prototype.clearFiltering=function(e){this.filterModule&&this.filterModule.clearFiltering(e)},a.prototype.clearFilteringAsync=function(e){var t=this;return this.filterModule?this.executeAsyncOperation("refresh",function(){return t.filterModule.clearFiltering(e)}):Promise.resolve()},a.prototype.removeFilteredColsByField=function(e,t){this.filterModule&&this.filterModule.removeFilteredColsByField(e,t)},a.prototype.selectRow=function(e,t){this.selectionModule&&this.selectionModule.selectRow(e,t)},a.prototype.selectRows=function(e){this.selectionModule&&this.selectionModule.selectRows(e)},a.prototype.clearSelection=function(){this.selectionModule&&this.selectionModule.clearSelection()},a.prototype.selectCell=function(e,t){this.selectionModule&&this.selectionModule.selectCell(e,t)},a.prototype.selectCellsByRange=function(e,t){this.selectionModule.selectCellsByRange(e,t)},a.prototype.search=function(e){this.searchModule&&this.searchModule.search(e)},a.prototype.searchAsync=function(e){var t=this;return this.searchModule?this.executeAsyncOperation("searching",function(){return t.searchModule.search(e)}):Promise.resolve()},a.prototype.print=function(){this.printModule&&this.printModule.print()},a.prototype.deleteRecord=function(e,t){this.editModule&&this.editModule.deleteRecord(e,t)},a.prototype.deleteRecordAsync=function(o,a){var l=this;return new Promise(function(t,i){function n(e){"delete"===e.requestType&&(l.removeEventListener(p,r),l.off(oe,n),l.off(Hi,s)),i()}var e,r=function(e){"delete"===e.requestType&&(l.removeEventListener(p,r),l.off(Hi,s),t())},s=function(e){"delete"===e.requestType&&(l.removeEventListener(p,r),l.off(Hi,s),t())};l.editModule?(l.on(Hi,s),l.addEventListener(oe,n),l.addEventListener(p,r),e=l.getSelectedRecords(),l.editModule.deleteRecord(o,a),(q.isNullOrUndefined(o)||q.isNullOrUndefined(a))&&0===e.length&&(l.removeEventListener(p,r),l.off(oe,n),l.off(Hi,s),t())):t()})},a.prototype.startEdit=function(){this.editModule&&this.editModule.startEdit()},a.prototype.endEdit=function(){this.editModule&&this.editModule.endEdit()},a.prototype.endEditAsync=function(){var s=this;return new Promise(function(t,e){var i=function(e){"save"===e.requestType&&(s.removeEventListener(p,i),s.off(Hi,n),s.off(oe,r),t())},n=function(e){"edit"===e.action&&(s.removeEventListener(p,i),s.off(Hi,n),s.off(oe,r),t())},r=function(){s.removeEventListener(p,i),s.off(oe,r),s.off(Hi,n),e()};s.editModule?(s.on(Hi,n),s.addEventListener(oe,r),s.addEventListener(p,i),s.editModule.endEdit()):t()})},a.prototype.closeEdit=function(){this.editModule&&this.editModule.closeEdit()},a.prototype.addRecord=function(e,t){this.editModule&&this.editModule.addRecord(e,t)},a.prototype.addRecordAsync=function(s,o){var a=this;return new Promise(function(t,e){function i(){a.removeEventListener(p,n),a.off(oe,i),a.off(Hi,r),e()}var n=function(e){"add"===e.action&&"save"===e.requestType&&(a.removeEventListener(p,n),a.off(Hi,r),t())},r=function(e){"add"===e.action&&(a.removeEventListener(p,n),a.off(Hi,r),t())};a.editModule?(a.on(Hi,r),a.addEventListener(oe,i),a.addEventListener(p,n),a.editModule.addRecord(s,o),s||(a.removeEventListener(p,n),a.off(oe,i),a.off(Hi,r),t())):t()})},a.prototype.deleteRow=function(e){this.editModule&&this.editModule.deleteRow(e)},a.prototype.deleteRowAsync=function(e){var t=this;return this.editModule?this.executeAsyncOperation("delete",function(){return t.editModule.deleteRow(e)}):Promise.resolve()},a.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},a.prototype.saveCell=function(){this.editModule&&this.editModule.saveCell()},a.prototype.updateCell=function(e,t,i){this.editModule&&this.editModule.updateCell(e,t,i)},a.prototype.updateRow=function(e,t){this.editModule&&this.editModule.updateRow(e,t)},a.prototype.updateRowAsync=function(s,o){var a=this;return new Promise(function(t,e){var i=function(e){"save"===e.requestType&&(a.removeEventListener(p,i),a.off(Hi,n),a.off(oe,r),t())},n=function(e){"edit"===e.action&&(a.removeEventListener(p,i),a.off(Hi,n),a.off(oe,r),t())},r=function(){a.removeEventListener(p,i),a.off(oe,r),a.off(Hi,n),e()};a.editModule?(a.on(Hi,n),a.addEventListener(oe,r),a.addEventListener(p,i),a.editModule.updateRow(s,o)):t()})},a.prototype.getBatchChanges=function(){return this.editModule?this.editModule.getBatchChanges():{}},a.prototype.enableToolbarItems=function(e,t){this.toolbarModule&&this.toolbarModule.enableItems(e,t)},a.prototype.copy=function(e){this.clipboardModule&&this.clipboardModule.copy(e)},a.prototype.recalcIndentWidth=function(){var n=this;if(this.getHeaderTable().querySelector(".e-emptycell")&&(this.groupSettings.columns.length||this.isDetail()||this.isRowDragable())&&!this.getHeaderTable().querySelector(".e-emptycell.e-indentRefreshed")&&this.getContentTable()){var e=this.getHeaderTable().querySelector(".e-emptycell").parentElement.offsetWidth,r=[].slice.call(this.getHeaderTable().querySelector(bs).childNodes),s=[].slice.call(this.getContentTable().querySelector(bs).childNodes),t=e/30,i="Right"===this.getFrozenMode()?this.groupSettings.columns.length+this.getColumns().length:0,o=this.element.offsetWidth,a=function(e,t){var i;gd(n)?(i=(t/o*100).toFixed(1)+"%",r[parseInt(e.toString(),10)].style.width=i,s[parseInt(e.toString(),10)].style.width=i):(r[parseInt(e.toString(),10)].style.width=t+"px",s[parseInt(e.toString(),10)].style.width=t+"px"),n.notify(qt,{index:e,width:t})};for((e=1<=t?30/t:e)<1&&(e=1),(this.enableColumnVirtualization||this.isAutoGen||this.columns.length===this.groupSettings.columns.length)&&(e=30);i<this.groupSettings.columns.length;)a(i,e),i++;this.isDetail()&&(a(i,e),i++),this.isRowDragable()&&a(i,e),this.isAutoGen=!1,this.getHeaderTable().querySelector(".e-emptycell").classList.add("e-indentRefreshed")}},a.prototype.resetIndentWidth=function(){var e;this.isDestroyed||(gd(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(Gn,{}),(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()))},a.prototype.isRowDragable=function(){return this.allowRowDragAndDrop&&!this.rowDropSettings.targetID},a.prototype.reorderColumns=function(e,t){this.reorderModule&&this.reorderModule.reorderColumns(e,t)},a.prototype.reorderColumnByModel=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByModel(e,t)},a.prototype.reorderColumnByIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByIndex(e,t)},a.prototype.reorderColumnByTargetIndex=function(e,t){this.reorderModule&&this.reorderModule.reorderColumnByTargetIndex(e,t)},a.prototype.reorderRows=function(e,t){this.rowDragAndDropModule&&this.rowDragAndDropModule.reorderRows(e,t)},a.prototype.refreshDataSource=function(e){this.notify("refreshdataSource",e)},a.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":"";q.setStyleAttribute(t.querySelector(bs).childNodes[0],{display:s}),q.setStyleAttribute(i.querySelector(bs).childNodes[0],{display:s});for(var o=0;o<this.getRows().length;o++){var a=r[parseInt(o.toString(),10)].firstElementChild;e?q.addClass([a],"e-hide"):q.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?q.addClass([a],"e-hide"):q.removeClass([a],["e-hide"])}},a.prototype.autoFitColumns=function(e,t,i){var n=this.getInjectedModules().find(function(e){return"function"!=typeof e||q.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)},a.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)&&(q.isNullOrUndefined(o.querySelector(".e-emptyrow"))?q.addClass([t,o],["e-tableborder"]):(q.addClass([t],["e-tableborder"]),q.removeClass([o],["e-tableborder"])));r=i.toString()+s;t.style.setProperty("width",r),o.style.setProperty("width",r)}else this.restoreAdjustColumns()}},a.prototype.restoreAdjustColumns=function(){var e,t,i;this.enableAdaptiveUI&&"Vertical"===this.rowRenderingMode||this.allowResizing&&"Auto"===this.resizeSettings.mode||(e=this.getHeaderTable(),t=this.getContentTable(),q.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()))},a.prototype.widthUnit=function(e){return e?"%":"px"},a.prototype.defaultIndentWidth=function(e){return e?parseFloat((30/this.element.offsetWidth*100).toFixed(1)):30},a.prototype.isPercentageWidthGrid=function(){var e=this.getColumns().find(function(e){return!q.isNullOrUndefined(e.width)});return!!e&&-1<e.width.toString().indexOf("%")},a.prototype.createColumnchooser=function(e,t,i){this.columnChooserModule&&this.columnChooserModule.renderColumnChooser(e,t,i)},a.prototype.initializeServices=function(){this.serviceLocator.register("widthService",this.widthService=new sa(this)),this.serviceLocator.register("cellRendererFactory",new Zo),this.serviceLocator.register("rendererFactory",new na),this.serviceLocator.register("localization",this.localeObj=new q.L10n(this.getModuleName(),this.defaultLocale,this.locale)),this.serviceLocator.register("valueFormatter",this.valueFormatterService=new V(this.locale)),this.serviceLocator.register("showHideService",this.showHider=new Oa(this)),this.serviceLocator.register("ariaService",this.ariaService=new io),this.serviceLocator.register("focus",this.focusModule=new la(this))},a.prototype.processModel=function(){var n,r,e,s=this.groupSettings.columns,o=this.sortSettings.columns;if(this.allowGrouping)for(var a=this,t=0,i=s.length;t<i;t++)!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)]}))}(t);if(!s.length)for(t=0;t<o.length;t++)this.sortedColumns.push(o[parseInt(t.toString(),10)].field);this.rowTemplateFn=th(this.rowTemplate),this.emptyRecordTemplateFn=th(this.emptyRecordTemplate),this.detailTemplateFn=th(this.detailTemplate),this.editTemplateFn=th(this.editSettings.template),this.editHeaderTemplateFn=th(this.editSettings.headerTemplate),this.editFooterTemplateFn=th(this.editSettings.footerTemplate),this.columnChooserTemplateFn=th(this.columnChooserSettings.template),this.columnChooserHeaderTemplateFn=th(this.columnChooserSettings.headerTemplate),this.columnChooserFooterTemplateFn=th(this.columnChooserSettings.footerTemplate),q.isNullOrUndefined(this.parentDetails)||(e=q.isNullOrUndefined(this.parentDetails.parentKeyFieldValue)?"undefined":this.parentDetails.parentKeyFieldValue,this.query.where(this.queryString,"equal",e,!0)),this.initForeignColumn()},a.prototype.initForeignColumn=function(){this.isForeignKeyEnabled(this.getColumns())&&this.notify(Oi,this.getForeignKeyColumns())},a.prototype.enableVerticalRendering=function(){"Vertical"===this.rowRenderingMode?this.element.classList.add("e-row-responsive"):this.element.classList.remove("e-row-responsive")},a.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)||q.Browser.isSafari())&&this.element.classList.add("e-mac-safari"),q.Browser.isDevice&&(this.element.classList.add("e-device"),"Desktop"===this.adaptiveUIMode)&&"Vertical"!==this.rowRenderingMode&&(this.enableAdaptiveUI=!1),"Mobile"!==this.adaptiveUIMode||q.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"===q.Browser.info.name&&this.element.classList.add("e-disableuserselect"),this.editSettings.showAddNewRow&&(this.enableVirtualization||this.enableInfiniteScrolling)&&(this.editSettings.newRowPosition="Top"),q.classList(this.element,["e-responsive","e-default"],[]);var e=this.serviceLocator.getService("rendererFactory");this.headerModule=e.getRenderer(N.RenderType.Header),this.contentModule=e.getRenderer(N.RenderType.Content),this.printModule=new jl(this,this.scrollModule),this.clipboardModule=new qa(this,this.serviceLocator),this.renderModule.render(),this.eventInitializer(),this.createGridPopUpElement(),this.widthService.setWidthToColumns(),this.updateGridLines(),this.applyTextWrap(),this.createTooltip(),this.enableBoxSelection()},a.prototype.dataReady=function(){this.scrollModule.setWidth(),this.scrollModule.setHeight(),"auto"!==this.height&&this.scrollModule.setPadding()},a.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},a.prototype.createGridPopUpElement=function(){var e=this.createElement("div",{className:"e-gridpopup"}),t=(e.style.display="none",this.createElement("div",{className:hs,attrs:{tabIndex:"-1"}}));q.append([t,this.createElement("div",{className:"e-uptail e-tail"})],e),t.appendChild(this.createElement("span")),q.append([t,this.createElement("div",{className:"e-downtail e-tail"})],e),this.element.appendChild(e)},a.prototype.updateGridLines=function(){switch(q.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()},a.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")},a.prototype.applyTextWrap=function(){if(this.allowTextWrap){var e=[].slice.call(this.element.getElementsByClassName("e-columnheader"));switch(this.textWrapSettings.wrapMode){case"Header":kh(this.element,!1),kh(this.getContent(),!1),kh(e,!0);break;case"Content":kh(this.getContent(),!0),kh(this.element,!1),kh(e,!1);break;default:kh(this.element,!0),kh(this.getContent(),!1),kh(e,!1)}"Content"!==this.textWrapSettings.wrapMode&&this.notify(Gn,{})}},a.prototype.removeTextWrap=function(){kh(this.element,!1),kh([].slice.call(this.element.getElementsByClassName("e-columnheader")),!1),kh(this.getContent(),!1),"Content"!==this.textWrapSettings.wrapMode&&this.notify(Gn,{})},a.prototype.createTooltip=function(){this.toolTipObj=new F.Tooltip({opensOn:"custom",content:"",cssClass:this.cssClass||null},this.element)},a.prototype.freezeRefresh=function(){(this.enableVirtualization||this.enableInfiniteScrolling)&&(this.pageSettings.currentPage=1),this.componentRefresh()},a.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))},a.prototype.mouseMoveHandler=function(e){var t,i,n,r;this.isEllipsisTooltip()&&(t=x(e.target,"e-ellipsistooltip"),"mouseout"!==e.type||this.prevElement===t&&t===x(e.relatedTarget,"e-ellipsistooltip")||(this.toolTipObj.close(),this.toolTipObj.clear(),this.prevElement=null),i=e.target.tagName,!t||"mouseout"===e.type||q.Browser.isDevice&&-1!==["A","BUTTON","INPUT"].indexOf(i)||this.getTooltipStatus(t)&&(i=(e=this.getColumns()[parseInt(t.getAttribute(ws),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))},a.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},a.prototype.scrollHandler=function(){this.isEllipsisTooltip()&&this.toolTipObj.close()},a.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},a.prototype.onKeyPressed=function(e){"tab"!==e.action&&"shiftTab"!==e.action||this.toolTipObj.close()},a.prototype.wireEvents=function(){q.EventHandler.add(this.element,"click",this.mouseClickHandler,this),q.EventHandler.add(this.element,"touchend",this.mouseClickHandler,this),q.EventHandler.add(this.element,"focusout",this.focusOutHandler,this),q.EventHandler.add(this.element,"dblclick",this.dblClickHandler,this),q.EventHandler.add(this.element,"keydown",this.keyPressHandler,this),q.EventHandler.add(window,"resize",this.resetIndentWidth,this),this.allowKeyboard&&(this.element.tabIndex=-1===this.element.tabIndex?0:this.element.tabIndex),this.keyboardModule=new q.KeyboardEvents(this.element,{keyAction:this.keyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),q.EventHandler.add(this.getContent().firstElementChild,"scroll",this.scrollHandler,this),q.EventHandler.add(this.element,"mouseover",this.mouseMoveHandler,this),q.EventHandler.add(this.element,"mouseout",this.mouseMoveHandler,this),q.EventHandler.add(this.getContent(),"touchstart",this.tapEvent,this),q.EventHandler.add(document.body,"keydown",this.keyDownHandler,this)},a.prototype.unwireEvents=function(){q.EventHandler.remove(this.element,"click",this.mouseClickHandler),q.EventHandler.remove(this.element,"touchend",this.mouseClickHandler),q.EventHandler.remove(this.element,"focusout",this.focusOutHandler),q.EventHandler.remove(this.element,"dblclick",this.dblClickHandler),q.EventHandler.remove(this.getContent().firstElementChild,"scroll",this.scrollHandler),q.EventHandler.remove(this.element,"mouseover",this.mouseMoveHandler),q.EventHandler.remove(this.element,"mouseout",this.mouseMoveHandler),q.EventHandler.remove(this.element,"keydown",this.keyPressHandler),q.EventHandler.remove(this.getContent(),"touchstart",this.tapEvent),q.EventHandler.remove(document.body,"keydown",this.keyDownHandler),q.EventHandler.remove(window,"resize",this.resetIndentWidth)},a.prototype.addListener=function(){this.isDestroyed||(this.on(pt,this.dataReady,this),this.on(ct,this.recalcIndentWidth,this),this.on(yt,this.recalcIndentWidth,this),this.on(Pr,this.refreshFrozenPosition,this),this.on(Br,this.refreshSplitFrozenColumn,this),this.dataBoundFunction=this.refreshMediaCol.bind(this),this.addEventListener(ae,this.dataBoundFunction),this.on(Pt,this.onKeyPressed,this))},a.prototype.removeListener=function(){this.isDestroyed||(this.off(pt,this.dataReady),this.off(ct,this.recalcIndentWidth),this.off(yt,this.recalcIndentWidth),this.on(Pr,this.refreshFrozenPosition,this),this.on(Br,this.refreshSplitFrozenColumn,this),this.removeEventListener(ae,this.dataBoundFunction),this.off(Pt,this.onKeyPressed))},a.prototype.getCurrentViewRecords=function(){return Kh(this)?q.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},a.prototype.mouseClickHandler=function(e){var t,i,n;this.isChildGrid(e)||x(e.target,"e-gridpopup")&&e.touches||this.element.getElementsByClassName("e-cloneproperties").length||this.checkEdit(e)||(!this.allowRowDragAndDrop&&(x(e.target,is)||"TD"===e.target.tagName)||x(e.target,"e-headercell")&&x(e.target,"e-headercell").querySelector(".e-checkselectall")||!this.allowGrouping&&!this.allowReordering&&x(e.target,"e-gridheader"))&&e.touches||(x(e.target,"e-gridheader")&&this.allowRowDragAndDrop&&!x(e.target,"e-filterbarcell")&&e.target&&-1===["A","BUTTON","INPUT"].indexOf(e.target.tagName)&&e.preventDefault(),this.allowRowDragAndDrop&&x(e.target,"e-rowcell")&&!x(e.target,"e-rowdragdrop")&&e.touches)||((t=this.getRowInfo(e.target)).event=e,n=t.cancel=!1,(n=(i=q.closest(e.target,"tr"))&&i.getAttribute("data-uid")?!!(i=this.getRowObjectFromUID(i.getAttribute("data-uid")))&&i.isDataRow:n)&&this.trigger(Ge,t),this.notify(Nt,e))},a.prototype.checkEdit=function(e){var t=x(e.target,I),t="Batch"!==this.editSettings.mode&&this.isEdit&&t&&(t.classList.contains(cs)||t.classList.contains(us)&&!this.editSettings.showAddNewRow);return!x(e.target,"e-unboundcelldiv")&&(t||x(e.target,b)&&x(e.target,b).classList.contains("e-editedbatchcell"))},a.prototype.dblClickHandler=function(e){var t,i=x(e.target,"e-grid");q.isNullOrUndefined(i)||i.id!==this.element.id||q.closest(e.target,".e-unboundcelldiv")||(i=!1,(t=q.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(Ve,t),this.notify(Qt,e))},a.prototype.focusOutHandler=function(e){var t,i;this.isChildGrid(e)||(x(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&&(x(t,"e-grid")||(!q.isNullOrUndefined(i)&&i)===e.target.getAttribute("aria-owns"))||this.keyPress||!this.isEdit||q.Browser.isDevice||("Batch"!==this.editSettings.mode||(x(t,"e-ddl")||x(t,"e-ddt"))&&(x(t,"e-multi-select-list-wrapper")||x(t,"e-input-filter"))&&x(t,"e-input-group")||!x(t,"e-uploader")&&(t&&q.isNullOrUndefined(x(t,"e-input-group"))||x(e.target,"edit-custom-template"))||(this.editModule.saveCell(),this.notify(ji,{})),"Normal"!==this.editSettings.mode)||this.isWidgetsDestroyed||this.editModule.editFormValidate(),this.editSettings.showAddNewRow&&(this.editModule.isShowAddedRowValidate=!1),this.keyPress=!1)},a.prototype.isChildGrid=function(e){var t=x(e.target,"e-grid");return!!(t&&t.id!==this.element.id||x(e.target,"e-unboundcelldiv")&&q.isNullOrUndefined(t))},a.prototype.mergePersistGridData=function(e){var t=this.getLocalData();if(!q.isNullOrUndefined(t)&&""!==t||!q.isNullOrUndefined(e)){var i=q.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]||q.isNullOrUndefined(this[""+s])?this[""+s]=i[""+s]:Array.isArray(this[""+s])&&"columns"===s?(this.setFrozenCount(),rh(this[""+s]),this.mergeColumns(i[""+s],this[""+s]),this.mergedColumns=!0,this[""+s]=i[""+s]):q.extend(this[""+s],i[""+s])}this.isProtectedOnChange=!1}},a.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)][Ms]:e.index===n[parseInt(t.toString(),10)].index})[0];q.isNullOrUndefined(e)||(r&&((e=q.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)]=q.extend(e,n[parseInt(t.toString(),10)],{},!0))}(t)},a.prototype.isDetail=function(){return!q.isNullOrUndefined(this.detailTemplate)||!q.isNullOrUndefined(this.childGrid)},a.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},a.prototype.isForeignKeyEnabled=function(e){var t=this;return e.some(function(e){return e.columns?t.isForeignKeyEnabled(e.columns):!(!e.dataSource||!e.foreignKeyValue)})},a.prototype.keyPressHandler=function(e){var t=q.extend(e,{cancel:!1});this.trigger("keyPressed",t),(!0===t.cancel||this.isEdit&&e&&x(e.target,"e-gridform")&&x(e.target,"e-ddl")&&"open"===e.action&&!0===e.altKey&&"ArrowDown"===e.code)&&e.stopImmediatePropagation()},a.prototype.keyDownHandler=function(e){if(e.altKey){if(74===e.keyCode&&(this.keyA?(this.notify(jn,{target:e.target,collapse:!1}),this.keyA=!1):(this.focusModule&&this.focusModule.currentInfo&&this.focusModule.currentInfo.element&&(q.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)return;0!==this.element.getBoundingClientRect().width&&t.focusContent(),t.addOutline()}}65===e.keyCode&&(this.keyA=!0),72===e.keyCode&&this.keyA&&(this.notify(jn,{target:e.target,collapse:!0}),this.keyA=!1)}13===e.keyCode&&this.notify(cr,e)},a.prototype.keyActionHandler=function(e){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(cs))&&"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(Pt,e)):"enter"===e.action&&this.editModule&&"Batch"===this.editSettings.mode&&this.isEdit&&x(e.target,"e-editedbatchcell")&&e.preventDefault())},a.prototype.setInjectedModules=function(e){this.injectedModules=e},a.prototype.updateColumnObject=function(){sh(this.columns,this.enableColumnVirtualization,this),rh(this.columns),this.initForeignColumn(),this.notify(Jt,{})},a.prototype.refreshFrozenPosition=function(e){e&&e.isModeChg?(this.refreshColumns(),this.notify(Nr,{})):this.refreshColumns()},a.prototype.getForeignKeyColumns=function(){return(this.enableColumnVirtualization?this.columns:this.getColumns()).filter(function(e){return e instanceof Q&&e.isForeignColumn()})},a.prototype.getRowHeight=function(e){return this.rowHeight||bh(this.element,e)},a.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("."+rs).scrollLeft=e,this.getContent().querySelector("."+hs).scrollLeft=e)},a.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},a.prototype.csvExport=function(e,t,i,n){return this.excelExportModule?this.excelExportModule.Map(this,e,t,i,!0,n):null},a.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},a.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},a.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},a.prototype.groupColumn=function(e){this.groupModule&&this.groupModule.groupColumn(e)},a.prototype.groupColumnAsync=function(e){var t=this;return this.groupModule?this.executeAsyncOperation("grouping",function(){return t.groupModule.groupColumn(e)}):Promise.resolve()},a.prototype.groupExpandAll=function(){this.groupModule&&this.groupModule.expandAll()},a.prototype.groupCollapseAll=function(){this.groupModule&&this.groupModule.collapseAll()},a.prototype.clearGrouping=function(){this.groupModule&&this.groupModule.clearGrouping()},a.prototype.clearGroupingAsync=function(){var e=this;return this.groupModule?this.executeAsyncOperation("ungrouping",function(){return e.groupModule.clearGrouping()}):Promise.resolve()},a.prototype.ungroupColumn=function(e){this.groupModule&&this.groupModule.ungroupColumn(e)},a.prototype.ungroupColumnAsync=function(e){var t=this;return this.groupModule?this.executeAsyncOperation("ungrouping",function(){return t.groupModule.ungroupColumn(e)}):Promise.resolve()},a.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},a.prototype.scrollRefresh=function(){function e(){t.scrollModule.refresh(),t.off(ct,e)}var t=this;this.on(ct,e,this)},a.prototype.detailCollapseAll=function(){this.detailRowModule&&this.detailRowModule.collapseAll()},a.prototype.detailExpandAll=function(){this.detailRowModule&&this.detailRowModule.expandAll()},a.prototype.clearCellSelection=function(){this.selectionModule&&this.selectionModule.clearCellSelection()},a.prototype.clearRowSelection=function(){this.selectionModule&&this.selectionModule.clearRowSelection()},a.prototype.selectCells=function(e){this.selectionModule&&this.selectionModule.selectCells(e)},a.prototype.selectRowsByRange=function(e,t){this.selectionModule&&this.selectionModule.selectRowsByRange(e,t)},a.prototype.isContextMenuOpen=function(){return this.contextMenuModule&&this.contextMenuModule.isOpen},a.prototype.ensureModuleInjected=function(e){return 0<=this.getInjectedModules().indexOf(e)},a.prototype.destroyTemplate=function(e,t,i){this.clearTemplate(e,t,i)},a.prototype.log=function(e,t){this.getInjectedModules().find(function(e){return"Logger"===e.name})||(ql.Inject(Ka),this.enableLogger=!0,this.injectModules()),this.loggerModule&&this.loggerModule.log(e,t)},a.prototype.applyBiggerTheme=function(e){this.element.classList.contains("e-bigger")&&e.classList.add("e-bigger")},a.prototype.getPreviousRowData=function(){return this.getRowsObject()[this.getRows().length-1].data},a.prototype.hideScroll=function(){var e=this.getContent().querySelector("."+hs);e.scrollHeight<=e.clientHeight&&(this.scrollModule.removePadding(),e.style.overflowY="auto")},a.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?Nd(t,i[parseInt(n.toString(),10)].data):r)===e)return i[parseInt(n.toString(),10)].index}return-1},a.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?Nd(t,i[parseInt(n.toString(),10)].data):r)===e)return i[parseInt(n.toString(),10)]}return null},a.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},a.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},a.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 U.DataManager?this.renderModule.data.getData(this.dataSource,e):(this.dataSource instanceof U.DataManager?this.dataSource:new U.DataManager(this.dataSource,e)).executeLocal(e)):[]},a.prototype.getUserAgent=function(){var e=q.Browser.userAgent.toLowerCase();return/iphone|ipod|ipad|macintosh/.test(e)},a.prototype.tapEvent=function(e){this.getUserAgent()&&(N.Global.timer?(clearTimeout(N.Global.timer),N.Global.timer=null,this.dblClickHandler(e),this.notify(li,e)):N.Global.timer=setTimeout(function(){N.Global.timer=null},300))},a.prototype.getRowUid=function(e){return""+e+this.rowUid++},a.prototype.getRowElementByUID=function(e){for(var t,i=[].slice.call(this.getContent().querySelector(H).children),n=0,r=this.frozenRows||this.pinnedTopRowModels.length?[].slice.call(this.getHeaderContent().querySelector(H).children).concat(i):i;n<r.length;n++){var s=r[n];if(s.getAttribute("data-uid")===e){t=s;break}}return t},a.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},a.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},a.prototype.getNoncontentHeight=function(){var e=0;if(this.getHeaderContent()&&!q.isNullOrUndefined(this.getHeaderContent().clientHeight)&&(e+=this.getHeaderContent().clientHeight),this.toolbar&&!q.isNullOrUndefined(this.element.querySelector(".e-toolbar").clientHeight)&&(e+=this.element.querySelector(".e-toolbar").clientHeight),this.allowPaging&&!q.isNullOrUndefined(this.element.querySelector(".e-gridpager").clientHeight)&&(e+=this.element.querySelector(".e-gridpager").clientHeight),this.allowGrouping&&this.groupSettings.showDropArea&&!q.isNullOrUndefined(this.element.querySelector(".e-groupdroparea").clientHeight)&&(e+=this.element.querySelector(".e-groupdroparea").clientHeight),0<this.aggregates.length&&!q.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},a.prototype.getSummaryValues=function(e,t){return U.DataUtil.aggregates[e.type.toLowerCase()](t,e.field)},a.prototype.serverExcelExport=function(e,t){this.isExcel=!0,this.exportGrid(e,t)},a.prototype.serverPdfExport=function(e,t){this.isExcel=!1,this.exportGrid(e,t)},a.prototype.serverCsvExport=function(e,t){this.isExcel=!0,this.exportGrid(e,t)},a.prototype.exportGrid=function(e,t){var n=this,i=this.getDataModule().generateQuery(!0),i=(new U.UrlAdaptor).processQuery(new U.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()},a.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,q.isNullOrUndefined(n.template)||(e[parseInt(i.toString(),10)].template="true"),e[parseInt(i.toString(),10)].format&&(e[parseInt(i.toString(),10)].format=Ld(this.getFormat(e[parseInt(i.toString(),10)].format),e[parseInt(i.toString(),10)].type,!1,q.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},a.prototype.getFormat=function(e){return"object"==typeof e?q.isNullOrUndefined(e.format)?e.skeleton:e.format:e},a.prototype.isCollapseStateEnabled=function(){return!1===this.isExpanded},a.prototype.updateRowValue=function(e,t){t={requestType:"save",data:t};this.showSpinner(),this.notify($t,t),this.refresh()},a.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())},a.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")},a.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))},a.prototype.batchUpdate=function(e){this.processRowChanges(e)},a.prototype.batchAsyncUpdate=function(e){this.processBulkRowChanges(e)},a.prototype.processBulkRowChanges=function(e){var t=this;if(this.dataToBeUpdated)for(var i=[ms,fs,ys],n=this.getPrimaryKeyFieldNames()[0],r=0;r<i.length;r++)e[i[parseInt(r.toString(),10)]]&&Sd(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)},a.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()},a.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)})},a.prototype.deleteRowElement=function(e){e=this.getRowElementByUID(e.uid);q.remove(e)},a.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(I));fd(this,this.getRowsObject(),d),vd(this),this.allowPaging&&this.notify(gt,{module:"pager",properties:{totalRecordsCount:t}})},a.prototype.renderRowElement=function(e,t){var i,n=new Ls(this.serviceLocator,null,this),e=new Ns(this).generateRows([e]),n=n.render(e[0],this.getColumns()),e=(this.addRowObject(e[0],t),this.getContentTable().querySelector(H));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(H),(e=this.getContent().querySelector(H)).appendChild(n)},a.prototype.addRowObject=function(e,t){this.getRowsObject().splice(t,1,e)},a.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},a.prototype.sanitize=function(e){return this.enableHtmlSanitizer?q.SanitizeHtmlHelper.sanitize(e):e},a.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},a.prototype.getFrozenRightContent=function(){return this.contentModule.getPanel()},a.prototype.getFrozenRightHeader=function(){return this.headerModule.getPanel()},a.prototype.getMovableHeaderTbody=function(){return this.getHeaderContent().querySelector(H)},a.prototype.getMovableContentTbody=function(){return this.getContent().querySelector(H)},a.prototype.getFrozenHeaderTbody=function(){return this.getHeaderContent().querySelector(H)},a.prototype.getFrozenLeftContentTbody=function(){return this.getContent().querySelector(H)},a.prototype.getFrozenRightHeaderTbody=function(){return this.getHeaderContent().querySelector(H)},a.prototype.getFrozenRightContentTbody=function(){return this.getContent().querySelector(H)},a.prototype.showResponsiveCustomFilter=function(e){this.filterModule&&this.filterModule.showCustomFilter(e||"Vertical"===this.rowRenderingMode)},a.prototype.showResponsiveCustomSort=function(e){this.sortModule&&this.sortModule.showCustomSort(e||"Vertical"===this.rowRenderingMode)},a.prototype.showResponsiveCustomColumnChooser=function(e){this.columnChooserModule&&this.columnChooserModule.showCustomColumnChooser(e||"Vertical"===this.rowRenderingMode)},a.prototype.showAdaptiveFilterDialog=function(){this.enableAdaptiveUI&&this.showResponsiveCustomFilter(!0)},a.prototype.showAdaptiveSortDialog=function(){this.enableAdaptiveUI&&this.showResponsiveCustomSort(!0)},a.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},a.prototype.enableInfiniteAggrgate=function(){this.enableInfiniteScrolling&&this.groupSettings.columns.length&&!this.groupSettings.disablePageWiseAggregates&&!this.groupSettings.enableLazyLoading&&this.setProperties({groupSettings:{disablePageWiseAggregates:!0}},!0)},o([q.Property([])],a.prototype,"currentViewData",void 0),o([q.Property()],a.prototype,"parentDetails",void 0),o([q.Property()],a.prototype,"showHider",void 0),o([q.Property([])],a.prototype,"columns",void 0),o([q.Property(!0)],a.prototype,"enableAltRow",void 0),o([q.Property(!0)],a.prototype,"enableHover",void 0),o([q.Property(!1)],a.prototype,"enableAutoFill",void 0),o([q.Property(!0)],a.prototype,"allowKeyboard",void 0),o([q.Property(!1)],a.prototype,"enableStickyHeader",void 0),o([q.Property(!1)],a.prototype,"enableHtmlSanitizer",void 0),o([q.Property(!1)],a.prototype,"allowTextWrap",void 0),o([q.Complex({},xl)],a.prototype,"textWrapSettings",void 0),o([q.Complex({},Dl)],a.prototype,"resizeSettings",void 0),o([q.Property(!1)],a.prototype,"allowPaging",void 0),o([q.Complex({},e)],a.prototype,"pageSettings",void 0),o([q.Complex({},Nl)],a.prototype,"loadingIndicator",void 0),o([q.Property(!0)],a.prototype,"enableVirtualMaskRow",void 0),o([q.Property(!1)],a.prototype,"enableVirtualization",void 0),o([q.Property(!1)],a.prototype,"enableColumnVirtualization",void 0),o([q.Property(!1)],a.prototype,"enableInfiniteScrolling",void 0),o([q.Complex({},Sl)],a.prototype,"searchSettings",void 0),o([q.Property(!1)],a.prototype,"allowSorting",void 0),o([q.Property("Ellipsis")],a.prototype,"clipMode",void 0),o([q.Property(!0)],a.prototype,"allowMultiSorting",void 0),o([q.Property(!1)],a.prototype,"allowExcelExport",void 0),o([q.Property(!1)],a.prototype,"allowPdfExport",void 0),o([q.Complex({},nl)],a.prototype,"sortSettings",void 0),o([q.Complex({},hl)],a.prototype,"infiniteScrollSettings",void 0),o([q.Property(!0)],a.prototype,"allowSelection",void 0),o([q.Property(-1)],a.prototype,"selectedRowIndex",void 0),o([q.Complex({},fl)],a.prototype,"selectionSettings",void 0),o([q.Property(!1)],a.prototype,"allowFiltering",void 0),o([q.Property("Horizontal")],a.prototype,"rowRenderingMode",void 0),o([q.Property(!1)],a.prototype,"enableAdaptiveUI",void 0),o([q.Property("Both")],a.prototype,"adaptiveUIMode",void 0),o([q.Property(!1)],a.prototype,"allowReordering",void 0),o([q.Property(!1)],a.prototype,"enableRowSpan",void 0),o([q.Property(!1)],a.prototype,"enableColumnSpan",void 0),o([q.Property(!1)],a.prototype,"allowResizing",void 0),o([q.Property(!1)],a.prototype,"allowRowDragAndDrop",void 0),o([q.Complex({},wl)],a.prototype,"rowDropSettings",void 0),o([q.Complex({},cl)],a.prototype,"filterSettings",void 0),o([q.Property(!1)],a.prototype,"allowGrouping",void 0),o([q.Property(!1)],a.prototype,"enableImmutableMode",void 0),o([q.Property(!1)],a.prototype,"showColumnMenu",void 0),o([q.Property(!1)],a.prototype,"autoFit",void 0),o([q.Complex({},kl)],a.prototype,"groupSettings",void 0),o([q.Complex({},Ml)],a.prototype,"editSettings",void 0),o([q.Collection([],xa)],a.prototype,"aggregates",void 0),o([q.Property(!1)],a.prototype,"showColumnChooser",void 0),o([q.Complex({},Ca)],a.prototype,"columnChooserSettings",void 0),o([q.Property(!0)],a.prototype,"enableHeaderFocus",void 0),o([q.Property("auto")],a.prototype,"height",void 0),o([q.Property("auto")],a.prototype,"width",void 0),o([q.Property("Default")],a.prototype,"gridLines",void 0),o([q.Property()],a.prototype,"rowTemplate",void 0),o([q.Property()],a.prototype,"emptyRecordTemplate",void 0),o([q.Property()],a.prototype,"detailTemplate",void 0),o([q.Property()],a.prototype,"childGrid",void 0),o([q.Property()],a.prototype,"queryString",void 0),o([q.Property("AllPages")],a.prototype,"printMode",void 0),o([q.Property("Expanded")],a.prototype,"hierarchyPrintMode",void 0),o([q.Property([])],a.prototype,"dataSource",void 0),o([q.Property(null)],a.prototype,"rowHeight",void 0),o([q.Property()],a.prototype,"query",void 0),o([q.Property("USD")],a.prototype,"currencyCode",void 0),o([q.Property()],a.prototype,"exportGrids",void 0),o([q.Property()],a.prototype,"toolbar",void 0),o([q.Property()],a.prototype,"contextMenuItems",void 0),o([q.Property()],a.prototype,"columnMenuItems",void 0),o([q.Property()],a.prototype,"toolbarTemplate",void 0),o([q.Property()],a.prototype,"pagerTemplate",void 0),o([q.Property(0)],a.prototype,"frozenRows",void 0),o([q.Property(0)],a.prototype,"frozenColumns",void 0),o([q.Property("")],a.prototype,"cssClass",void 0),o([q.Property("All")],a.prototype,"columnQueryMode",void 0),o([q.Property({})],a.prototype,"currentAction",void 0),o([q.Property("")],a.prototype,"ej2StatePersistenceVersion",void 0),o([q.Property(null)],a.prototype,"isRowSelectable",void 0),o([q.Event()],a.prototype,"isRowPinned",void 0),o([q.Event()],a.prototype,"created",void 0),o([q.Event()],a.prototype,"destroyed",void 0),o([q.Event()],a.prototype,"load",void 0),o([q.Event()],a.prototype,"rowDataBound",void 0),o([q.Event()],a.prototype,"queryCellInfo",void 0),o([q.Event()],a.prototype,"headerCellInfo",void 0),o([q.Event()],a.prototype,"actionBegin",void 0),o([q.Event()],a.prototype,"actionComplete",void 0),o([q.Event()],a.prototype,"actionFailure",void 0),o([q.Event()],a.prototype,"dataBound",void 0),o([q.Event()],a.prototype,"recordDoubleClick",void 0),o([q.Event()],a.prototype,"recordClick",void 0),o([q.Event()],a.prototype,"rowSelecting",void 0),o([q.Event()],a.prototype,"rowSelected",void 0),o([q.Event()],a.prototype,"rowDeselecting",void 0),o([q.Event()],a.prototype,"rowDeselected",void 0),o([q.Event()],a.prototype,"cellSelecting",void 0),o([q.Event()],a.prototype,"cellSelected",void 0),o([q.Event()],a.prototype,"cellDeselecting",void 0),o([q.Event()],a.prototype,"cellDeselected",void 0),o([q.Event()],a.prototype,"columnSelecting",void 0),o([q.Event()],a.prototype,"columnSelected",void 0),o([q.Event()],a.prototype,"columnDeselecting",void 0),o([q.Event()],a.prototype,"columnDeselected",void 0),o([q.Event()],a.prototype,"columnDragStart",void 0),o([q.Event()],a.prototype,"columnDrag",void 0),o([q.Event()],a.prototype,"columnDrop",void 0),o([q.Event()],a.prototype,"printComplete",void 0),o([q.Event()],a.prototype,"beforePrint",void 0),o([q.Event()],a.prototype,"pdfQueryCellInfo",void 0),o([q.Event()],a.prototype,"pdfHeaderQueryCellInfo",void 0),o([q.Event()],a.prototype,"pdfAggregateQueryCellInfo",void 0),o([q.Event()],a.prototype,"excelAggregateQueryCellInfo",void 0),o([q.Event()],a.prototype,"exportDetailDataBound",void 0),o([q.Event()],a.prototype,"exportDetailTemplate",void 0),o([q.Event()],a.prototype,"excelQueryCellInfo",void 0),o([q.Event()],a.prototype,"excelHeaderQueryCellInfo",void 0),o([q.Event()],a.prototype,"beforeExcelExport",void 0),o([q.Event()],a.prototype,"excelExportComplete",void 0),o([q.Event()],a.prototype,"beforePdfExport",void 0),o([q.Event()],a.prototype,"pdfExportComplete",void 0),o([q.Event()],a.prototype,"rowDragStartHelper",void 0),o([q.Event()],a.prototype,"detailDataBound",void 0),o([q.Event()],a.prototype,"detailExpand",void 0),o([q.Event()],a.prototype,"detailCollapse",void 0),o([q.Event()],a.prototype,"rowDragStart",void 0),o([q.Event()],a.prototype,"rowDrag",void 0),o([q.Event()],a.prototype,"rowDrop",void 0),o([q.Event()],a.prototype,"toolbarClick",void 0),o([q.Event()],a.prototype,"beforeOpenColumnChooser",void 0),o([q.Event()],a.prototype,"beforeOpenAdaptiveDialog",void 0),o([q.Event()],a.prototype,"batchAdd",void 0),o([q.Event()],a.prototype,"batchDelete",void 0),o([q.Event()],a.prototype,"batchCancel",void 0),o([q.Event()],a.prototype,"beforeBatchAdd",void 0),o([q.Event()],a.prototype,"beforeBatchDelete",void 0),o([q.Event()],a.prototype,"beforeBatchSave",void 0),o([q.Event()],a.prototype,"beginEdit",void 0),o([q.Event()],a.prototype,"commandClick",void 0),o([q.Event()],a.prototype,"cellEdit",void 0),o([q.Event()],a.prototype,"cellSave",void 0),o([q.Event()],a.prototype,"cellSaved",void 0),o([q.Event()],a.prototype,"resizeStart",void 0),o([q.Event()],a.prototype,"resizing",void 0),o([q.Event()],a.prototype,"resizeStop",void 0),o([q.Event()],a.prototype,"keyPressed",void 0),o([q.Event()],a.prototype,"beforeDataBound",void 0),o([q.Event()],a.prototype,"contextMenuOpen",void 0),o([q.Event()],a.prototype,"contextMenuClick",void 0),o([q.Event()],a.prototype,"contextMenuClose",void 0),o([q.Event()],a.prototype,"columnMenuOpen",void 0),o([q.Event()],a.prototype,"columnMenuClick",void 0),o([q.Event()],a.prototype,"columnMenuClose",void 0),o([q.Event()],a.prototype,"checkBoxChange",void 0),o([q.Event()],a.prototype,"beforeCopy",void 0),o([q.Event()],a.prototype,"beforePaste",void 0),o([q.Event()],a.prototype,"beforeAutoFill",void 0),o([q.Event()],a.prototype,"columnDataStateChange",void 0),o([q.Event()],a.prototype,"dataStateChange",void 0),o([q.Event()],a.prototype,"dataSourceChanged",void 0),o([q.Event()],a.prototype,"exportGroupCaption",void 0),o([q.Event()],a.prototype,"lazyLoadGroupExpand",void 0),o([q.Event()],a.prototype,"lazyLoadGroupCollapse",void 0),o([q.Event()],a.prototype,"beforeDetailTemplateDetach",void 0),o([q.Event()],a.prototype,"beforeCustomFilterOpen",void 0);var zl,ql,Ul=ql=o([q.NotifyPropertyChanges],a);function a(e,t){e=zl.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=q.Component.prototype.refresh,e.isChangeDataSourceCall=!1,e.mergedColumns=!1,e.isVirtualAdaptive=!1,e.requireTemplateRef=!0,e.vRows=[],e.vcRows=[],e.vGroupOffsets={},e.rowUid=0,e.translateX=0,e.isManualRefresh=!1,e.isAutoFitColumns=!1,e.enableDeepCompare=!1,e.totalDataRecordsCount=0,e.disableSelectedRecords=[],e.partialSelectedRecords=[],e.partialSelectedIndexes=[],e.pinnedTopRowModels=[],e.pinnedTopRecords=[],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.enableLogger=!1,e.needsID=!0,ql.Inject(Ta),q.setValue("mergePersistData",e.mergePersistGridData,e),e}function Hl(){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"]}Vl.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},Vl.prototype.hierarchyPrint=function(){this.removeColGroup(this.parent);var e=window.printGridObj;e&&!e.element.querySelector("[aria-busy=true")&&e.printModule.defered.resolve()},Vl.prototype.print=function(){this.renderPrintGrid()},Vl.prototype.onEmpty=function(){this.isPrintGrid()&&this.contentReady()},Vl.prototype.actionBegin=function(){this.isPrintGrid()&&(this.isAsyncPrint=!0)},Vl.prototype.renderPrintGrid=function(){for(var e=this.parent,t=q.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 Ul(Yh(e,e.hierarchyPrintMode))),n=0;n<i.columns.length;n++)i.columns[parseInt(n.toString(),10)]=q.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(_i,{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)},Vl.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(De,t),t.cancel?q.detach(e.element):this.isAsyncPrint||(this.parent.printGridParent&&this.parent.printGridParent.isReact?this.parent.printGridParent.renderTemplates(function(){i.printGrid()}):this.printGrid())))},Vl.prototype.printGrid=function(){var e,t=this.parent;"auto"!==t.height&&(e=this.scrollModule.getCssProperties(),r=t.element.querySelector("."+hs),l=t.element.querySelector("."+ts),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(hs));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];q.classList(a,["e-spin-hide"],["e-spin-show"])}this.printGridElement(t),t.isPrinting=!1,delete window.printGridObj;var l={element:t.element};t.trigger(Ee,l),t.destroy(),this.parent.log("exporting_complete",this.getModuleName())},Vl.prototype.printGridElement=function(e){q.classList(e.element,["e-print-grid-layout"],["e-print-grid"]),e.isPrinting&&q.detach(e.element),this.printWind=window.open("","print","height="+window.outerHeight+",width="+window.outerWidth+",tabbar=no"),q.isNullOrUndefined(this.printWind)||(this.printWind.moveTo(0,0),this.printWind.resizeTo(screen.availWidth,screen.availHeight),this.printWind=q.print(e.element,this.printWind))},Vl.prototype.removeColGroup=function(e){var t=e.groupSettings.columns.length,i=e.element,n="#"+e.element.id;if(t){for(var r=q.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=q.selectAll("colgroup"+n+"colgroup",i),n=q.selectAll(".e-content colgroup",i),i=q.selectAll(".e-summarycontent colgroup",i);this.hideColGroup(e,t),this.hideColGroup(n,t),this.hideColGroup(i,t)}},Vl.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"},Vl.prototype.isPrintGrid=function(){return 0<this.parent.element.id.indexOf("_print")&&this.parent.isPrinting},Vl.prototype.destroy=function(){this.parent.isDestroyed||(this.parent.off(ct,this.contentReady.bind(this)),this.parent.removeEventListener(y,this.actionBeginFunction),this.parent.off(ut,this.onEmpty.bind(this)),this.parent.off(Vi,this.hierarchyPrint))},Vl.prototype.getModuleName=function(){return"print"},Vl.printGridProp=Hl().concat([De,Ee,ie]);var jl=Vl;function Vl(e,t){this.isAsyncPrint=!1,this.defered=new U.Deferred,this.parent=e,this.parent.isDestroyed||(this.parent.on(ct,this.isContentReady(),this),this.actionBeginFunction=this.actionBegin.bind(this),this.parent.addEventListener(y,this.actionBeginFunction),this.parent.on(ut,this.onEmpty.bind(this)),this.parent.on(Vi,this.hierarchyPrint,this),this.scrollModule=t)}function Gl(e,t){return e.prototype&&t in e.prototype}function _l(e,t,i){return q.isNullOrUndefined(e)||""===e?"":U.DataUtil.getObject(e,t)}function Kl(e,t){requestAnimationFrame(function(){try{t(null,e())}catch(e){t(e)}})}function Wl(e){return!q.isNullOrUndefined(e)&&!q.isNullOrUndefined(e.columns)&&0<e.columns.length}function Ql(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 Xl(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+=Jl(i[parseInt(n.toString(),10)],e)));e.vcRows=t}var Yl=0;function Jl(e,t){Yl=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&&!q.isNullOrUndefined(e[l])&&e[l]?1!==t.groupSettings.columns.length?Yl+=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&&(Yl+=e[i]*(n-e.indent)+e[l]):t.groupSettings.columns.length&&(1!==t.groupSettings.columns.length?Yl+=e[i]*(t.groupSettings.columns.length-e.indent):Yl+=e[i]);else{for(var h=0,d=e.data[s].length;h<d;h++){var p=e.data[s][parseInt(h.toString(),10)];Yl+=p[s].length+(n===t.columns.length||q.isNullOrUndefined(p[s][r])?0:p[s][r].length),a+=(q.isNullOrUndefined(p[s][r])||q.isNullOrUndefined(e[l])?p[s]:p[s][r]).length,p[s].GroupGuid&&0!==p[s].childLevels&&Zl(p)}Yl+=e.data[s].length,q.isNullOrUndefined(e[l])||e[l]&&Yl&&0!==a&&(Yl+=(Yl-a)*e[l]+e[l])}return Yl}function Zl(e){for(var t=0,i=e.items.length;t<i;t++){var n=e.items[parseInt(t.toString(),10)];Yl+=n.count,0!==n.items.childLevels&&Zl(n)}}function $l(e,t){for(var i=[],n=0,r=e.length;n<r;n++){var s=t(e[parseInt(n.toString(),10)],n);q.isNullOrUndefined(s)||i.push(s)}return i}function eh(e){for(var t=[],i=0;i<e.length;i++)t.push(q.extend({},ah(e[parseInt(i.toString(),10)]),{},!0));return t}function th(t){if(t)try{var e="<"!==t[0];return"function"!=typeof t&&e&&document.querySelectorAll(t).length?q.compile(document.querySelector(t).innerHTML.trim()):q.compile(t)}catch(e){return q.compile(t)}}function ih(e,t){var i={},n=["style","class"];q.extend(i,t,{}),"style"in i&&(q.setStyleAttribute(e,i[n[0]]),delete i[n[0]]),"class"in i&&(q.addClass([e],i[n[1]]),delete i[n[1]]),q.attributes(e,i)}function nh(e,t,i,n){for(var r=q.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 rh(e,t){void 0===t&&(t=0);for(var i=0,n=q.isNullOrUndefined(e)?0:e.length;i<n;i++)e[parseInt(i.toString(),10)].columns?(e[parseInt(i.toString(),10)].index=q.isNullOrUndefined(e[parseInt(i.toString(),10)].index)?t:e[parseInt(i.toString(),10)].index,t++,t=rh(e[parseInt(i.toString(),10)].columns,t)):(e[parseInt(i.toString(),10)].index=q.isNullOrUndefined(e[parseInt(i.toString(),10)].index)?t:e[parseInt(i.toString(),10)].index,t++);return t}function sh(e,t,i){for(var n=0,r=q.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=sh(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.headerText=q.isNullOrUndefined(s.headerText)?s.foreignKeyValue||s.field||"":s.headerText,s.foreignKeyField=s.foreignKeyField||s.field,s.valueAccessor=("string"==typeof s.valueAccessor?q.getValue(s.valueAccessor,window):s.valueAccessor)||_l,s.headerValueAccessor="string"==typeof s.headerValueAccessor?q.getValue(s.headerValueAccessor,window):s.headerValueAccessor,s.width=t&&q.isNullOrUndefined(s.width)?200:s.width,q.isNullOrUndefined(s.visible)&&(s.visible=!0),e[parseInt(n.toString(),10)]=s}return e}function oh(e,t,i){var n=e.querySelector("span"),r=e.parentElement.getBoundingClientRect(),s=t.target.getBoundingClientRect(),n=(n.className=i,e.style.display="",(q.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=ch(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 ah(e){return e instanceof q.ChildProperty?q.getValue("properties",e):e}function x(e,t,i){for(var n=e;n&&(i?n.id!==t:!n.classList.contains(t));)n=n.parentElement;return n}function lh(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 hh(e,t){for(var i=0,n=t.length;i<n;i++)if(t[parseInt(i.toString(),10)]===e)return i;return-1}function dh(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 ph(e,t){for(var i=[].slice.call(e.querySelectorAll(t)),n=0;n<i.length;n++)q.remove(i[parseInt(n.toString(),10)])}function ch(e){var t={};return t.x=(q.isNullOrUndefined(e.clientX)?e.changedTouches[0]:e).clientX,t.y=(q.isNullOrUndefined(e.clientY)?e.changedTouches[0]:e).clientY,t}var uh=0;function gh(e){return e+uh++}function fh(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 mh(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 yh(e,t,i,n){var r;return"Custom"===e?(r="string"==typeof(r=i.customAggregate)?q.getValue(r,window):r)?r.call(n,t,i):"":i.field in t||t instanceof Array?U.DataUtil.aggregates[e.toLowerCase()](t,i.field):null}var Sh,vh,Ch=null;function wh(e){var t;return null===Ch||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),Ch=e):Ch}function bh(e,t){var i,n;return t&&void 0!==vh||void 0===Sh&&((i=q.createElement("table",{className:ds,attrs:{role:"grid"}})).style.visibility="hidden",i.innerHTML='<tr><td class="e-rowcell">A<td></tr>',e.appendChild(i),n=i.querySelector("td").getBoundingClientRect(),e.removeChild(i),vh=n.height,Sh=Math.ceil(n.height),t)?vh:Sh}function Ih(e){return 1<e.split(".").length}function xh(e){return(e=void 0===e?"":e).replace(/\./g,"___")}function Rh(e){return(e=void 0===e?"":e).replace(/[^a-zA-Z0-9_.]/g,"\\$&")}function Th(e){return(e=void 0===e?"":e).replace(/___/g,".")}function Dh(e,t,i){i=x(i,I),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 Eh(e,t){return!(!t||!t.element||0!==t.element.offsetWidth)||0!==e.getBoundingClientRect().width}function Oh(e){var t=q.select("#"+e.element.id+"EditConfirm",e.element);return"Batch"===e.editSettings.mode&&(q.selectAll(".e-updatedtd",e.element).length||q.selectAll(".e-gridform.e-formvalidator",e.element).length)&&e.editSettings.showConfirmDialog&&(!t||t.classList.contains("e-popup-close"))}function kh(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 Ah(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 Fh(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?(q.classList(o,i.slice(),[]),o.classList.contains("e-detailrowcollapse")||o.classList.contains("e-detailrowexpand")||o.setAttribute("aria-selected","true")):(q.classList(o,[],i.slice()),o.removeAttribute("aria-selected"))}}function Mh(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 Lh(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 Ph(e,t){e.popup.element.style.zIndex=(t.zIndex+1).toString()}function Nh(e,t,i,n,r,s){q.isNullOrUndefined(i.filterTemplate)&&(i="","string"===n?i="strui-"+t:"number"===n?i="numberui-"+t:"boolean"===n?i="bool-ui-"+t:"date"!==n&&"datetime"!==n||(i="dateui-"+t),n="in"===e||"notin"===e,t=x(r.element.querySelector("#multiselect"+i),"e-control-wrapper"),e=x(r.element.querySelector("#"+i),"e-popup-flmenu"),t&&(t.style.display=n?"inline-flex":"none"),e)&&(e.style.display=n?"none":"inline-flex")}function Bh(e){var e=e.querySelector(".e-frame"),t=e.previousSibling;e.classList.contains("e-check")?(t.checked=!1,q.classList(e,["e-uncheck"],["e-check"])):(t.checked=!0,q.classList(e,["e-check"],["e-uncheck"]))}function zh(e,t){e.checked=t}function qh(e,t,i){i=q.createElement("div",{className:i});return i.appendChild(t),i.setAttribute("data-uid",e),i}function Uh(e,t){q.removeClass([e],["e-check","e-stop","e-uncheck"]),t?e.classList.add("e-check"):e.classList.add("e-uncheck")}function Hh(e,t,i){for(var n=0;n<(q.isNullOrUndefined(t)?0:t.length);n++)q.setValue(t[parseInt(n.toString(),10)].field,jh(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&&q.setValue("foreignKeyData",q.getValue(r[parseInt(n.toString(),10)].column.field,e.foreignKeyData),r[parseInt(n.toString(),10)])}function jh(e,t,i,n){var r=e.foreignKeyField,t=q.isNullOrUndefined(i)?_l(e.field,t):i,t=q.isNullOrUndefined(t)?"":t,i=new U.Query,n=n||(e.dataSource instanceof U.DataManager&&e.dataSource.dataSource.json.length?e.dataSource.dataSource.json:e.columnData);return t.getDay?i.where(_h({field:r,operator:"equal",value:t,matchCase:!1})):i.where(r,"==",t,!1),new U.DataManager(n).executeLocal(i)}function Vh(t,e){var i;return e.some(function(e){return(i=e).foreignKeyValue===t})&&i}function Gh(e){return e<10?"0"+e:String(e)}function _h(e,t){var i,n,r,s,o,a=q.extend({},ah(e)),l=q.extend({},ah(e));return q.isNullOrUndefined(e.value)||""===e.value?new U.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()+"-"+Gh(a.value.getMonth()+1)+"-"+Gh(a.value.getDate()),new U.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 U.Predicate(a.field,a.operator,a.value,!1),o=new U.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 U.Predicate(a.field,a.operator,a.value,!1))),e.setProperties?e.setProperties({ejpredicate:r},!0):e.ejpredicate=r,r)}function Kh(e){return e.enableVirtualization&&0<e.groupSettings.columns.length&&e.isVirtualAdaptive&&!e.groupSettings.enableLazyLoading}function Wh(e,t){if(e=void 0===e?"":e){for(var i,n=t,r=e.split("."),s=0;s<r.length&&!q.isNullOrUndefined(n);s++)n=n[r[parseInt(s.toString(),10)]],q.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 Qh(e,t){var i=new q.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 Xh(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,q.isNullOrUndefined(s)||(i[parseInt(s.toString(),10)]={},i[parseInt(s.toString(),10)].isExpand=!0,e.childGrid&&(i[parseInt(s.toString(),10)].gridModel=Yh(o.childGrid,t),i[parseInt(s.toString(),10)].gridModel.query=e.childGrid.query)))}return i}function Yh(e,t){void 0===t&&(t="Expanded");var i={};if(e){for(var n=0,r=jl.printGridProp;n<r.length;n++){var s=r[n];i[""+s]="columns"===s?dh(e[""+s]):"allowPaging"===s?"CurrentPage"===e.printMode:ah(e[""+s])}i.enableHover=!1,(e.childGrid||e.detailTemplate)&&"None"!==t&&(i.expandedRows=Xh(e,t))}return i}function Jh(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(Zh(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&&(q.isObject(p)||Array.isArray(p))?q.isObject(p)?(c=d||{},r[l[parseInt(h.toString(),10)]]=q.extend({},c,p,n)):(c=d||[],r[l[parseInt(h.toString(),10)]]=q.extend([],c,p,n)):r[l[parseInt(h.toString(),10)]]=p}return r}function Zh(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 $h(e){for(var t=0,i=0;i<(q.isNullOrUndefined(e)?0:e.length);i++){var n=ed(e[parseInt(i.toString(),10)],0);t<n&&(t=n)}return t+1}function ed(e,t){var i=t,n=[];if(e.columns){t++;for(var r=0;r<e.columns.length;r++)n[parseInt(r.toString(),10)]=ed(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 td(e,t){for(var i=0;i<t.length;i++)t[parseInt(i.toString(),10)].uid=(t[parseInt(i.toString(),10)].isForeignKey?Vh(t[parseInt(i.toString(),10)].field,e.getForeignKeyColumns()):e.enableColumnVirtualization?Hd(e,t[parseInt(i.toString(),10)].field):e.getColumnByField(t[parseInt(i.toString(),10)].field)).uid}function id(e){e=document.defaultView.getComputedStyle(e,null).getPropertyValue("transform").replace(/,/g,"");return{width:parseFloat(e.split(" ")[4]),height:parseFloat(e.split(" ")[5])}}function nd(e,t){e.classList.contains("e-bigger")&&t.classList.add("e-bigger")}function rd(e){e=e.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?wh():0}function sd(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))-rd(e)),o=0;o<n.length;o++)if(n[parseInt(o.toString(),10)].visible&&(r+=ad(n[parseInt(o.toString(),10)],e),i++),s<r){i--;break}return i}function od(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"),Dd(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)&&ad(h[parseInt(d.toString(),10)],t)+i>parseInt(t.width.toString(),10)-rd(t)){var p=sd(t,s);a.setAttribute("colspan",p.toString());break}if(h[parseInt(d.toString(),10)].visible&&(i+=ad(h[parseInt(d.toString(),10)],t),l--),0===l)break}a.classList.contains("e-summarycell")&&(o=a.getAttribute("data-mappinguid"),i+=ad(t.getColumnByUid(o),t))}}function ad(e,t){return q.isNullOrUndefined(e.width)||"auto"===e.width||-1!==e.width.toString().indexOf("%")?(t=t.getColumnHeaderByField(e.field),q.isNullOrUndefined(t)?0:t.getBoundingClientRect().width):parseInt(e.width.toString(),10)}function ld(e,t){var i=t.getContent().firstElementChild;return e&&e.getBoundingClientRect().top-i.getBoundingClientRect().top+t.getRowHeight()>i.offsetHeight}function hd(e,t){return e&&e.getBoundingClientRect().top<t}function dd(e,t){var i=t.getRowHeight(),n=t.getContent().firstElementChild.scrollTop/i;return e<n+t.getContent().firstElementChild.offsetHeight/i&&n<e}function pd(e,i){var n,r=e.getPrimaryKeyFieldNames()[0];return e.getCurrentViewRecords().filter(function(e,t){r.includes(".")?Wh(r,e)===Wh(r,i)&&(n=t):e[""+r]===i[""+r]&&(n=t)}),n}function cd(e,t){var t=ud(t),i=new U.Deferred;return t.dataSource=i.resolve,t.action=e,{state:t,deffered:i}}function ud(e){var t=new U.UrlAdaptor,i=new U.DataManager({url:"",adaptor:new U.UrlAdaptor}),t=t.processQuery(i,e);return JSON.parse(t.data)}function gd(e){for(var t=e.getVisibleColumns(),i=0,n=0,r=0;r<t.length;r++)q.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 fd(e,t,i,n,r){for(var s=n||0,o=r||0;o<t.length;o++)if(t[parseInt(o.toString(),10)]&&t[parseInt(o.toString(),10)].isDataRow){t[parseInt(o.toString(),10)].index=s,t[parseInt(o.toString(),10)].isAltRow=!!e.enableAltRow&&s%2!=0,i[parseInt(o.toString(),10)].setAttribute(T,(s+1).toString()),t[parseInt(o.toString(),10)].isAltRow?i[parseInt(o.toString(),10)].classList.add("e-altrow"):i[parseInt(o.toString(),10)].classList.remove("e-altrow");for(var a=0;a<i[parseInt(o.toString(),10)].cells.length;a++)i[parseInt(o.toString(),10)].cells[parseInt(a.toString(),10)].setAttribute("data-index",s.toString());s++}t.length||e.renderModule.emptyRow(!0)}function md(e){for(var t=e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache?e.getRowsObject():e.vRows,i=e.getRows(),n=0,r=0,s=0;n<t.length;n++){var o=t[parseInt(n.toString(),10)];if(o.isDataRow){o.index=r,o.isAltRow=!!e.enableAltRow&&r%2!=0;var a=e.getRowElementByUID(o.uid);if(!q.isNullOrUndefined(a)){(i[parseInt(s.toString(),10)]=a).setAttribute(T,(r+1).toString()),o.isAltRow?a.classList.add("e-altrow"):a.classList.remove("e-altrow");for(var l=0;l<a.cells.length;l++)a.cells[parseInt(l.toString(),10)].setAttribute("data-index",r.toString());s++}r++}}e.enableInfiniteScrolling&&e.infiniteScrollSettings.enableCache&&e.infiniteScrollModule.resetInfiniteCache(t)}function yd(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(!q.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(T),10)-1;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 Sd(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 vd(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 Cd(e,t){wd(e)&&(t.target=e.element.closest("mat-dialog-container"))}function wd(e){return e&&e.isAngular&&e.element&&!q.isNullOrUndefined(e.element.closest("mat-dialog-container"))}function bd(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"),r=((n=document.getElementById(e.element.id+"_e-popup")?document.getElementById(e.element.id+"_e-popup"):n).style.top=r.top+"px",n.style.left=r.left+"px",n.style.zIndex=t.zIndex.toString(),n.style.width=q.isNullOrUndefined(i)?t.element.offsetWidth+"px":i+"px",n.appendChild(t.element),document.querySelector(".sb-demo-section,.e-grid-dialog-fixed"));r?(i=F.calculateRelativeBasedPosition(e.element,r),n.style.top=i.top+"px",n.style.left=i.left+"px",r.insertBefore(n,r.firstChild)):wd(e)?(t=e.element.closest("mat-dialog-container"))&&t.insertBefore(n,t.firstChild):document.body.insertBefore(n,document.body.firstChild)}function Id(e,t){var i=[];return i.push(e.uid),xd(e,i),-1<i.indexOf(t)}function xd(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&&xd(e.columns[parseInt(i.toString(),10)],t)}function Rd(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?Rd(e.columns[0]):"None"}function Td(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 Dd(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 Ed(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 Od(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 kd(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)Dd(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()));Dd(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)Dd(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()));Dd(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()));Dd(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()));Dd(i,r-1,e.enableRtl,"Right")}else i.classList.add("e-unfreeze")}function Ad(e,t,i){var n={rowIndex:i,elements:null};return e.notify("get-row-cells",n),n.elements||[].slice.call(e.getDataRows()[parseInt(i.toString(),10)].getElementsByClassName(b))}function Fd(e,t,i,n){return Ad(e,0,i)[parseInt(n.toString(),10)]}function Md(e,t,i,n,r,s,o){o||e.getFreezeTableName()===Cs||!t&&e.getFreezeTableName()===vs||1===s?i[xh(e.field)]=e.validationRules:"movable"!==e.getFreezeTableName()&&e.getFreezeTableName()?e.getFreezeTableName()===vs&&(r[xh(e.field)]=e.validationRules):n[xh(e.field)]=e.validationRules}function Ld(t,i,n,e){var r,s,o=new q.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),q.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 Pd(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 Nd(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 Bd(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=!q.isNullOrUndefined(h)&&(parseInt(h.getAttribute("aria-colindex"),10)-1===t||x(h,"e-addedrow")&&h.parentElement.childNodes[parseInt(t.toString(),10)]===h)?h:e[parseInt(l.toString(),10)].querySelector('td[aria-colindex="'+(t+1)+'"]'),q.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&&(q.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")&&q.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):q.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 zd(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 qd(e,t,i,n){var r=xh(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 Ud(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 Hd(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 jd(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 Vd(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 Gd(e,t,i){e.destroyTemplate(t,void 0,i),e.isReact&&e.renderTemplates()}function _d(e){for(var t=0;t<e.length;t++)q.remove(e[t])}function Kd(e,t){for(var i=0;i<e.length;i++)t.insertBefore(e[i],t.children[i])}function Wd(e,t){var i=t?q.createElement("li",{className:"e-cclist"}):q.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 Qd(e){return parseInt(e.getAttribute(T),10)-1}function Xd(e){return e.parentDetails&&e.parentDetails.parentInstObj?Xd(e.parentDetails.parentInstObj):e}function Yd(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||q.isNullOrUndefined(o)?n=n.concat(ap.generateNullValuePredicates(s)):n.push(nh({},{value:o},s))}return ap.getPredicate(n)}function Jd(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 Zd(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 $d(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 ep(e){return e.charAt(0).toUpperCase()+e.slice(1)}function tp(e){return!(Kh(e)||e.groupSettings.enableLazyLoading||!e.enableVirtualization&&e.enableColumnVirtualization)}function ip(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 np(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))}(N.Global||(N.Global={})).timer=null;var rp=!1;function sp(){return rp}function op(e){rp=e}S.prototype.destroy=function(){this.closeDialog()},S.prototype.wireEvents=function(){q.EventHandler.add(this.dlg,"click",this.clickHandler,this),q.EventHandler.add(this.dlg,"keyup",this.keyupHandler,this),this.searchHandler=q.debounce(this.searchBoxKeyUp,200);var e=this.dialogObj.element.querySelector(".e-searchinput");e&&(q.EventHandler.add(e,"keyup",this.searchHandler,this),q.EventHandler.add(e,"input",this.searchHandler,this))},S.prototype.unWireEvents=function(){q.EventHandler.remove(this.dlg,"click",this.clickHandler),q.EventHandler.remove(this.dlg,"keyup",this.keyupHandler);var e=this.dialogObj.element.querySelector(".e-searchinput");e&&(q.EventHandler.remove(e,"keyup",this.searchHandler),q.EventHandler.remove(e,"input",this.searchHandler))},S.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(Ai,{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)})},S.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.refreshCheckboxes(),this.updateSearchIcon(),this.sInput.focus())},S.prototype.searchBoxKeyUp=function(e){q.isNullOrUndefined(this.sInput)||!q.isNullOrUndefined(e)&&("ArrowUp"===e.key||"ArrowDown"===e.key||"Tab"===e.key||"Tab"===e.key&&e.shiftKey)||(q.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||this.parent.showMaskRow(void 0,this.dialogObj.element),this.isCheckboxFilterTemplate?this.parent.notify("refreshCheckbox",{event:e}):this.refreshCheckboxes(),this.updateSearchIcon())},S.prototype.updateSearchIcon=function(){this.sInput.value.length?(q.classList(this.sIcon,["e-chkcancel-icon"],["e-search-icon"]),q.isNullOrUndefined(document.body.querySelector(".e-chkcancel-icon"))||document.body.querySelector(".e-chkcancel-icon").setAttribute("title",this.localeObj.getConstant("Clear"))):(q.classList(this.sIcon,["e-search-icon"],["e-chkcancel-icon"]),q.isNullOrUndefined(document.body.querySelector(".e-searchclear.e-search-icon"))||document.body.querySelector(".e-searchclear.e-search-icon").setAttribute("title",this.localeObj.getConstant("Search")))},S.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},S.prototype.updateDataSource=function(){var e=this.options.dataSource;if(!(e instanceof U.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)},S.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 U.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():[]},S.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}},L.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},S.prototype.showDialog=function(e){var t={requestType:nt,columnName:this.options.field,columnType:this.options.type,cancel:!1};if((t.filterModel=this).parent.notify(on,t),t.cancel)e.cancel=t.cancel;else{this.dialogObj=new F.Dialog({visible:!1,content:this.sBox,close:this.closeDialog.bind(this),enableRtl:this.parent.enableRtl,width:!q.isNullOrUndefined(x(e.target,"e-bigger"))||this.parent.element.classList.contains("e-device")?260:255,target:this.parent.element,animationSettings:{effect:"None"},buttons:[{click:this.btnClick.bind(this),buttonModel:{content:this.getLocalizedLabel(this.isExcel?"OKButton":"FilterButton"),cssClass: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")}}],created:this.dialogCreated.bind(this),open:this.dialogOpen.bind(this),cssClass:this.parent.cssClass||""});this.dialogObj.isStringTemplate=!0,this.renderResponsiveFilter(e);t=this.parent.filterSettings&&"CheckBox"===this.parent.filterSettings.type?this.getLocalizedLabel("CheckBoxFilterDialogARIA"):this.getLocalizedLabel("ExcelFilterDialogARIA");if(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&&!x(this.parent.element,"e-gantt-dialog")&&bd(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=Wd(this.cBox)+"px")}else q.isNullOrUndefined(this.parent.loadingIndicator)||"Shimmer"!==this.parent.loadingIndicator.indicatorType||this.infiniteRenderMod||this.parent.showMaskRow(void 0,this.dialogObj.element),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()}},S.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%")},S.prototype.dialogCreated=function(e){this.options.isResponsiveFilter?this.dialogObj.element.style.left="0px":q.Browser.isDevice?this.dialogObj.position={X:"center",Y:"center"}:Lh(this.options.target,this.dialogObj,this.parent),this.options.column.showColumnMenu&&this.parent.notify(Di,e)},S.prototype.openDialog=function(e){this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e)},S.prototype.closeDialog=function(){var e,t;this.infiniteRenderMod&&this.infinitePermenantLocalData.length&&!this.options.isRemote&&(this.options.dataSource.dataSource.json=this.infinitePermenantLocalData),this.dialogObj&&!this.dialogObj.isDestroyed&&(this.isBlanks=!1,t=this.options.columns.filter(function(e){return e.getFilterItemTemplate()}),e=this.parent.registeredTemplate,t.length&&!q.isNullOrUndefined(e)&&e.filterItemTemplate&&this.parent.destroyTemplate(["filterItemTemplate"]),(this.parent.isReact||this.parent.isVue)&&void 0!==this.parent.destroyTemplate&&Gd(this.parent,["filterItemTemplate"]),this.parent.notify(Ei,{field:this.options.field}),this.unWireEvents(),this.searchInputArgs&&this.searchInputArgs.element&&this.searchInputArgs.element.parentElement&&(L.Input.destroy(this.searchInputArgs),q.remove(this.searchInputArgs.element)),this.searchInputArgs=null,this.sInput=null,this.parent.isReact&&this.options.column.filter&&"string"!=typeof this.options.column.filter.itemTemplate&&("CheckBox"===this.options.column.filter.type||"Excel"===this.options.column.filter.type)&&(this.dialogObj.element.querySelector(".e-dlg-content").innerHTML=""),this.dialogObj.destroy(),"escape"===this.dialogObj.dlgClosedBy&&(this.parent.isColumnMenuFilterClosing=!0),this.dlg&&this.dlg.parentElement&&(q.remove(this.dlg),this.parent&&this.parent.showColumnChooser||(t=document.getElementById(this.parent.element.id+"_e-popup"),q.isNullOrUndefined(t))||(q.remove(t),t=null)),this.dlg=null,this.parent.notify(nr,{}))},S.prototype.clearFilter=function(e){var t={instance:this,handler:this.clearFilter,cancel:!1};this.parent.notify(ln,t),t.cancel||this.options.handler({action:"clear-filter",field:(e||this.options).field})},S.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(kr,{}),q.isNullOrUndefined(this.parent.focusModule)||this.parent.focusModule.filterfocus()},S.prototype.fltrBtnHandler=function(){var e,t=this,i=(this.infiniteRenderMod&&(this.cBox.innerHTML="",fh(this.cBox,this.infiniteLoadedElem.slice())),[].slice.call(this.cBox.querySelectorAll(".e-check:not(.e-selectall):not(.e-add-current)"))),n=i,r="equal",s=this.dialogObj.element.querySelector(".e-dropdownlist"),s=(s&&(this.options.operator=r=s.ej2_instances[0].value),this.isMenuNotEqual="notequal"===this.options.operator,this.options.hideSearchbox||(e=this.searchBox.querySelector(".e-searchinput")),this.options.allowCaseSensitive),s={field:this.options.field,predicate:this.isMenuNotEqual?"and":"or",uid:this.options.uid,operator:r,type:this.options.type,matchCase:s,ignoreAccent:this.options.ignoreAccent},o=this.itemsCnt!==i.length&&this.itemsCnt-i.length<i.length,a=(this.infiniteRenderMod?this.sBox:this.cBox).querySelector(".e-add-current"),l=(this.infiniteRenderMod?this.sBox:this.cBox).querySelector(".e-selectall"),l=e&&""!==e.value&&a&&l&&a.classList.contains("e-check")&&l.classList.contains("e-stop"),h=this.existingPredicate&&this.existingPredicate[this.options.field],d=((o=l?!h||!h.length:o)&&e&&(""===e.value||l)&&(r=this.isMenuNotEqual?"equal":"notequal",i=[].slice.call(this.cBox.querySelectorAll(".e-uncheck:not(.e-selectall)")),s.predicate=this.isMenuNotEqual?"or":"and",s.operator=r),[]);if(i.length!==this.itemsCnt||e&&e.value&&""!==e.value||this.infiniteRenderMod){if(this.infiniteRenderMod)this.infiniteRenderMod&&(!this.infiniteSearchPred||this.infiniteSearchPred&&!this.infiniteSearchPred.isComplex)?this.infiniteFltrBtnHandler(d):this.infiniteSearchPred.isComplex&&(d=this.complexQueryPredicate(i,s,o));else{if(d=this.complexQueryPredicate(i,s,o),q.isNullOrUndefined(d))return;d=this.filterPreventColumns||d}if("date"!==this.options.type&&"dateonly"!==this.options.type&&"datetime"!==this.options.type||!n.length||(r=n.length-1,e=this.values[x(n[parseInt(r.toString(),10)],"e-ftrchk").getAttribute("data-uid")],q.isNullOrUndefined(e)&&o&&d.push({field:s.field,matchCase:s.matchCase,operator:"equal",predicate:"or",value:null})),a&&a.classList.contains("e-check"))if(h)for(var p=0;p<h.length;p++)!function(t){d.some(function(e){return e.value===h[parseInt(t.toString(),10)].value})||d.push(h[parseInt(t.toString(),10)])}(p);else if(!l)return;!this.infiniteRenderMod||d.length?this.initiateFilter(d):this.sBox.querySelector(".e-selectall").classList.contains("e-check")&&!d.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()},S.prototype.complexQueryPredicate=function(e,t,i){for(var n,r,s=[],o=0;o<e.length;o++)n=this.values[x(e[parseInt(o.toString(),10)],"e-ftrchk").getAttribute("data-uid")],r=q.extend({},{value:n},t),n&&!n.toString().length&&(r.operator=i?"notequal":"equal"),""===n||q.isNullOrUndefined(n)?s=s.concat(S.generateNullValuePredicates(t)):s.push(r);var a=this.filterPreventColumns&&this.filterPreventColumns.length?this.filterPreventColumns[0]:r;return a&&!this.notifyFilterPrevEvent(a)?(this.filterPreventColumns=s,null):s},S.prototype.infiniteFltrBtnHandler=function(e){if(this.infiniteManualSelectMaintainPred.length)for(var t=0;t<this.infiniteManualSelectMaintainPred.length;t++){var i,n=this.infiniteManualSelectMaintainPred[t];!(i=n.value+"")||q.isNullOrUndefined(i)?(i={predicate:n.predicate,field:n.field,type:n.type,uid:n.uid,operator:n.operator,matchCase:n.matchCase,ignoreAccent:n.ignoreAccent},e.push.apply(e,S.generateNullValuePredicates(i))):e.push(this.infiniteManualSelectMaintainPred[t]),this.notifyFilterPrevEvent(this.infiniteManualSelectMaintainPred[t])}if(!this.localInfiniteSelectAllClicked&&""===this.sInput.value&&(this.options.parentCurrentViewDataCount||!e.length))for(t=0;t<this.infiniteUnloadParentExistPred.length;t++)e.unshift(this.infiniteUnloadParentExistPred[t]),this.notifyFilterPrevEvent(this.existingPredicate[this.options.field][t]);!this.infiniteSearchPred||""===this.sInput.value||this.localInfiniteSelectAllClicked&&!this.infiniteLocalSelectAll||(this.infiniteSearchPred.predicate="or",e.unshift(this.infiniteSearchPred),this.notifyFilterPrevEvent(this.infiniteSearchPred))},S.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(ln,e),!e.cancel},S.generateNullValuePredicates=function(e){var t=[];return"string"===e.type&&t.push({field:e.field,ignoreAccent:e.ignoreAccent,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:""}),t.push({field:e.field,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:null}),t.push({field:e.field,matchCase:e.matchCase,operator:e.operator,predicate:e.predicate,value:void 0}),t},S.prototype.initiateFilter=function(e){var t=e[0];if(t&&"dateonly"===t.type&&(t.value=t.value instanceof Date?t.value.getFullYear()+"-"+Gh(t.value.getMonth()+1)+"-"+Gh(t.value.getDate()):t.value),!q.isNullOrUndefined(t)){for(var i=t.ejpredicate||new U.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:U.Predicate.or(i)};this.options.handler(t)}},S.prototype.isForeignColumn=function(e){return!!e.isForeignColumn&&e.isForeignColumn()},S.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 q.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()+"-"+Gh(d.getMonth()+1)+"-"+Gh(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:rt,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 U.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},q.isNullOrUndefined(d))||(t=_h(e,r.options.type)),s&&"string"==typeof s&&r.isBlanks&&0<=r.getLocalizedLabel("Blanks").toLowerCase().indexOf(s.toLowerCase())?(g=g.concat(S.generateNullValuePredicates(f)),(e=S.generatePredicate(g)).predicates.push(t),t=e,a.where(e)):s.length?(t=q.isNullOrUndefined(h)?t:t.and(h.e),a.where(t)):q.isNullOrUndefined(h)||(t=h.e,a.where(h.e)),r.infiniteSearchPred=t,i.filterChoiceCount=q.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 U.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(Ai,{predicate:n,column:o}),n.predicate.predicates.length?l.where(n.predicate):r.renderEmpty=!0,r.options.column.columnData=t,r.infiniteRenderMod?(r.infiniteInitialLoad=!!q.isNullOrUndefined(r.fullData),r.makeInfiniteScrollRequest(l),l.requiresCount()):l.take(i.filterChoiceCount),r.search(i,l)}):(r.infiniteRenderMod&&r.parent.filterSettings.itemsCount?(r.infiniteInitialLoad=!!q.isNullOrUndefined(r.fullData),r.makeInfiniteScrollRequest(a),a.requiresCount()):a.take(i.filterChoiceCount),r.search(i,a)))})},S.prototype.search=function(e,t){this.parent.dataSource&&"result"in this.parent.dataSource?this.filterEvent(e,t):this.processSearch(t)},S.prototype.getPredicateFromCols=function(e){for(var t=S.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)?Vh(l,s):h)?(this.parent.notify(Ai,{predicate:n,column:h}),n.predicate.predicates.length&&i.push(U.Predicate.or(n.predicate.predicates))):i.push(t[""+l])}return i.length&&U.Predicate.and(i)},S.prototype.getQuery=function(){return this.parent.getQuery?this.parent.getQuery().clone():new U.Query},S.prototype.getAllData=function(){var t=this,i=(this.customQuery=!1,this.getQuery()),e=this.options.dataManager.adaptor.getModuleName,e=(!q.isNullOrUndefined(this.parent.getDataModule)&&e&&"ODataV4Adaptor"===e()||i.requiresCount(),this.addDistinct(i),{requestType:tt,query:i,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=q.isNullOrUndefined(e.filterChoiceCount)?1e3:e.filterChoiceCount,t.infiniteRenderMod&&t.parent.filterSettings.itemsCount!==e.filterChoiceCount&&(t.parent.filterSettings.itemsCount=e.filterChoiceCount),t.infiniteRenderMod||i.take(e.filterChoiceCount),e.query.distincts.length&&!t.infiniteRenderMod||(t.customQuery=!0,t.queryGenerate(i)),t.infiniteRenderMod&&(t.infiniteInitialLoad=!!q.isNullOrUndefined(t.fullData),t.makeInfiniteScrollRequest(i)),t.parent.dataSource&&"result"in t.parent.dataSource?t.filterEvent(e,i):t.processDataOperation(i,!0)})},S.prototype.addDistinct=function(e){var t,i=this,n=U.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 U.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 U.DataManager?this.options.dataSource:new U.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 U.Query,this.queryGenerate(t),r=new U.DataManager(r).executeLocal(t),this.options.dataSource=new U.DataManager(U.DataUtil.distinct(r,this.options.column.field,!0)),this.isForeignColumn(this.options.column)&&(this.options.column.dataSource=this.options.column.dataSource instanceof U.DataManager?this.options.column.dataSource:new U.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},S.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(U.DataUtil.distinct([e.field],"field")))},S.prototype.filterEvent=function(e,t){var i=this,e=cd(e,t);this.parent.trigger(Pi,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)})},S.prototype.addInfiniteScrollEvent=function(e){this.infiniteRenderMod&&(this.infiniteQuery=e.clone(),this.infiniteInitialLoad?(this.cBox.classList.add("e-checkbox-infinitescroll"),q.EventHandler.add(this.cBox,"scroll",this.infiniteScrollHandler,this),q.EventHandler.add(this.cBox,"mouseup",this.infiniteScrollMouseKeyUpHandler,this),q.EventHandler.add(this.cBox,"mousedown",this.infiniteScrollMouseKeyDownHandler,this)):this.infiniteSearchValChange&&(this.cBox.innerHTML=""))},S.prototype.infiniteScrollMouseKeyDownHandler=function(){q.EventHandler.remove(this.cBox,"scroll",this.infiniteScrollHandler)},S.prototype.infiniteScrollMouseKeyUpHandler=function(e){var t=this,i=(q.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(),N.Global.timer=setTimeout(function(){t.clickHandler(e),N.Global.timer=null},0)},S.prototype.getShimmerTemplate=function(){return'<span class="e-mask e-skeleton e-skeleton-text e-shimmer-wave"></span>'},S.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=Wd(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")).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)},S.prototype.removeMask=function(){var e=this.dialogObj.element.querySelectorAll(".e-mask-ftrchk");if(e.length)for(var t=0;t<e.length;t++)q.remove(e[t]);this.dialogObj.element.querySelector(".e-checkboxlist.e-masklist")&&q.remove(this.dialogObj.element.querySelector(".e-checkboxlist.e-masklist"))},S.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?(_d([].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,fh(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?(_d([].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,Kd([].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&&(_d([].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,Kd([].slice.call(this.infiniteLoadedElem.slice(this.infiniteSkipCnt,this.infiniteSkipCnt+this.parent.filterSettings.itemsCount)),this.cBox),this.cBox.scrollTop=this.infiniteScrollAppendDiff,this.prevInfiniteScrollDirection="up")},S.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:tt,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))},S.prototype.processDataOperation=function(t,e){var i=this,n=(this.options.dataSource=this.options.dataSource instanceof U.DataManager?this.options.dataSource:new U.DataManager(this.options.dataSource),[]),r=[];this.isForeignColumn(this.options.column)&&e&&(e="result"in this.options.column.dataSource?new U.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 U.Query).sortBy(e,U.DataUtil.fnAscending)).then(function(e){i.options.dataSource.dataSource.json=e.result,i.executeQueryOperations(t,n,r)})):this.executeQueryOperations(t,n,r)},S.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&&!q.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.dialogObj.element)})},S.prototype.dataSuccess=function(e){var t,i;!this.infiniteInitialLoad&&this.infiniteDataCount&&(this.infiniteSkipCnt>=this.infiniteDataCount&&!this.infiniteSearchValChange||0===e.length)||(this.fullData=e,e={dataSource:this.fullData,executeQuery:!0,field:this.options.field},this.parent.notify(Vn,e),e.executeQuery&&(t=new U.Query,this.customQuery||this.queryGenerate(t),t=new U.DataManager(e.dataSource).executeLocal(t),i=this.options.column,this.filteredData=S.getDistinct(t,this.options.field,i,this.foreignKeyData,this).records||[]),t=e.executeQuery?this.filteredData:e.dataSource,this.processDataSource(null,!0,t,e),(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:it,columnName:this.options.field,columnType:this.options.type}).filterModel=this).parent.notify(an,i),this.isCheckboxFilterTemplate&&F.hideSpinner(this.spinner))},S.prototype.queryGenerate=function(e){var t;if(this.parent.searchSettings&&this.parent.searchSettings.key.length&&(t=this.options.dataManager.adaptor.getModuleName,!q.isNullOrUndefined(this.parent.getForeignKeyColumns())&&this.parent.getForeignKeyColumns().length||!q.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)}},S.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.options.isResponsiveFilter?null:this.dialogObj.btnObj[0],searchBox:this.searchBox};this.parent.notify(Ar,r),this.isCheckboxFilterTemplate=r.isCheckboxFilterTemplate,this.isCheckboxFilterTemplate?this.infiniteRenderMod&&this.parent.filterSettings&&"Shimmer"===this.parent.filterSettings.loadingIndicator&&this.removeMask():this.createFilterItems(i,t,n)},S.prototype.processSearch=function(e){this.processDataOperation(e)},S.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 U.Query;e&&t.where(e),this.parent.notify(br,{query:t});for(var i=0,n=new U.DataManager(this.fullData).executeLocal(t);i<n.length;i++){var r=n[i];this.result[Wh(this.options.field,r)]=!0}},S.prototype.clickHandler=function(e){q.isNullOrUndefined(N.Global.timer)||clearTimeout(N.Global.timer);var t,i,n,r=e.target;!q.isNullOrUndefined(this.parent.loadingIndicator)&&"Shimmer"===this.parent.loadingIndicator.indicatorType&&x(r,"e-mask-ftrchk")||(t=x(r,"e-checkbox-wrapper"),x(r,"e-searchbox")&&this.searchBoxClick(e),t&&!this.isCheckboxFilterTemplate&&((r=t.querySelector(".e-selectall"))?this.updateAllCBoxes(!r.classList.contains("e-check")):(Bh(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[x(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 U.Query,r&&i.where(r),n=new U.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.setFocus(x(t,"e-ftrchk")))},S.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(q.extend({},{value:t},e)),"or"===e.predicate?this.options.parentTotalDataCount++:this.options.parentTotalDataCount--)},S.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")?x(e,"e-ftrchk"):e,this.setFocus(t))},S.prototype.keyupHandler=function(e){var t;"Tab"!==e.key&&("ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.altKey)||this.setFocus(x(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))},S.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")},S.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];Uh(n,e),zh(n.previousSibling,e)}},S.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())},S.prototype.createCheckbox=function(e,t,i){var n=(t?this.cBoxTrue:this.cBoxFalse).cloneNode(!0),t=(zh(n.querySelector("input"),t),n.querySelector(".e-label")),r=Jh({},i,{column:this.options.column,parent:this.parent}),s=this.parent.getModuleName,s=!q.isNullOrUndefined(s)&&"spreadsheet"===s()||this.options.disableHtmlEncode?"textContent":"innerHTML",s=(t[""+s]=!q.isNullOrUndefined(e)&&e.toString().length?this.parent.enableHtmlSanitizer?q.SanitizeHtmlHelper.sanitize(e):e:this.getLocalizedLabel("Blanks"),gh("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")),q.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()):fh(t,this.options.template(r,this.parent,"filterItemTemplate",null,null,null,null,this.parent.root))),n},S.prototype.updateIndeterminatenBtn=function(){var e,t=this.infiniteRenderMod?this.infiniteLoadedElem.length:this.cBox.children.length-1,i=[],n=!1,r=(this.infiniteRenderMod?this.sBox:this.cBox).querySelector(".e-selectall"),s=(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,o=(this.cBox.querySelector(".e-add-current")&&--t,this.options.isResponsiveFilter||((e=this.dialogObj.btnObj[0]).disabled=!1),r.previousSibling);zh(o,!1),o.indeterminate=!1,!this.infiniteRenderMod||""!==this.sInput.value||this.options.parentCurrentViewDataCount||this.localInfiniteSelectionInteracted||this.localInfiniteSelectAllClicked&&(this.infiniteLocalSelectAll||s)||t===s&&t!==s?this.infiniteRenderMod&&this.infiniteLoadedElem.length<this.infiniteDataCount&&this.infiniteUnloadParentExistPred.length&&(!s||t===s)&&this.infiniteLocalSelectAll&&(s?t+=this.infiniteUnloadParentExistPred.length:s+=this.infiniteUnloadParentExistPred.length):s=0,t===s?(this.infiniteRenderMod&&(this.infiniteLocalSelectAll=!0,this.localInfiniteSelectAllClicked=!0,this.infiniteManualSelectMaintainPred=[]),i=["e-check"],zh(o,!0)):s?(i=["e-stop"],o.indeterminate=!0):(this.infiniteRenderMod&&(this.infiniteLocalSelectAll=!1,this.localInfiniteSelectAllClicked=!0,this.infiniteManualSelectMaintainPred=[]),i=["e-uncheck"],n=!0,e&&(e.disabled=!0)),e&&(this.filterState=!e.disabled,e.dataBind()),q.removeClass([r],["e-check","e-stop","e-uncheck"]),q.addClass([r],i),this.parent.notify(rr,{disabled:n})},S.prototype.createFilterItems=function(e,t,i){var n,r=this.options.dataManager.adaptor.getModuleName,s=this.parent.createElement("div"),o=!1,a=(this.options.isResponsiveFilter||(n=this.dialogObj.btnObj[0]),-1),l="ejValue";i.executeQuery||(l=i.field);for(var h=0;h<e.length;h++){var d=q.getValue(l,e[parseInt(h.toString(),10)]);""!==d&&!q.isNullOrUndefined(d)||(a+=1),r&&"ODataV4Adaptor"===r()&&(d=q.getValue("dataObj.groupCount",e[parseInt(h.toString(),10)]),q.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(" ")?q.addClass([i],this.parent.cssClass.split(" ")):q.addClass([i],[this.parent.cssClass])),this.infiniteInitialLoad||!this.infiniteRenderMod?((p=qh(gh("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-Wd(this.cBox)+"px"),this.sBox.insertBefore(p,this.spinner)):s.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 U.Predicate("field","equal",this.options.field)),u=(this.options.foreignKeyValue&&(c=c.or("field","equal",this.options.foreignKeyValue)),new U.DataManager(this.options.filteredColumns).executeLocal((new U.Query).where(c)).length),g=(this.sInput&&this.sInput.value?(c=this.createCheckbox(this.getLocalizedLabel("AddCurrentSelection"),!1,((i={})[this.options.field]=this.getLocalizedLabel("AddCurrentSelection"),i)),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?q.addClass([c],this.parent.cssClass.split(" ")):q.addClass([c],[this.parent.cssClass])),this.infiniteRenderMod&&!q.isNullOrUndefined(this.sBox.children[2])&&this.sBox.children[2].innerText!==this.getLocalizedLabel("AddCurrentSelection")||!this.infiniteRenderMod?((i=qh(gh("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),S=this.spinner.querySelector(".e-checkboxlist"),c=Math.ceil(i.getBoundingClientRect().height),S.style.height=parseInt(getComputedStyle(S).height.split("px")[0],10)-c+"px",S.style.minHeight=S.style.height):s.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&&!q.isNullOrUndefined(this.sBox.children[2])&&this.sBox.children[2].innerText===this.getLocalizedLabel("AddCurrentSelection")&&(S=this.spinner.querySelector(".e-checkboxlist"),c=Math.ceil(this.sBox.children[2].getBoundingClientRect().height),S.style.height=parseInt(getComputedStyle(S).height.split("px")[0],10)+c+"px",S.style.minHeight=S.style.height,q.remove(this.sBox.children[2])),void 0),h=0;h<e.length;h++){var f=gh("cbox"),m=(this.values[""+f]=q.getValue(l,e[parseInt(h.toString(),10)]),q.getValue(this.options.field,e[parseInt(h.toString(),10)])),y=(this.options.formatFn&&("dateonly"!==this.options.type||q.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(pn,y),""===(m=y.value)||q.isNullOrUndefined(m)){if(g)continue;g=!0}this.infiniteRenderMod&&this.updateInfiniteUnLoadedCheckboxExistPred(m,this.infiniteUnloadParentExistPred);m=this.localInfiniteSelectAllClicked?this.createCheckbox(m,this.infiniteLocalSelectAll,q.getValue("dataObj",e[h])):this.createCheckbox(m,this.getCheckedState(u,this.values[""+f]),q.getValue("dataObj",e[h]));s.appendChild(qh(f,m,"e-ftrchk")),this.infiniteRenderMod&&(s.lastChild.style.height=Wd(this.cBox)+"px")}i=this.cBox.scrollTop;!this.infiniteRenderMod||this.infiniteSearchValChange?this.cBox.innerHTML="":this.infiniteRenderMod&&this.cBox.children.length&&_d([].slice.call(this.cBox.children).splice(0,this.parent.filterSettings.itemsCount)),this.infiniteRenderMod&&((c=this.infiniteLoadedElem).push.apply(c,[].slice.call(s.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=[]),fh(this.cBox,[].slice.call(s.children)),this.infiniteRenderMod&&!this.infiniteScrollAppendDiff&&(this.infiniteScrollAppendDiff=Math.round(i-this.cBox.scrollTop)),this.updateIndeterminatenBtn(),o=this.infiniteRenderMod?!(!n||!n.disabled):(n&&(n.disabled=!1),!1)}else s.appendChild(this.parent.createElement("span",{innerHTML:this.getLocalizedLabel("NoResult")})),this.cBox.innerHTML="",this.infiniteRenderMod&&((p=this.sBox.querySelector(".e-ftrchk .e-selectall"))&&(S=p.parentElement.parentElement,p.classList.contains("e-check")?Bh(S):p.classList.contains("e-stop")&&(Bh(S),p.classList.remove("e-stop"),Bh(S)),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")&&Bh(i),c.previousSibling.disabled=!0,c.parentElement.classList.add("e-checkbox-disabled")),this.cBox.appendChild(this.parent.createElement("div",{className:"e-checkfltrnmdiv"})),fh(this.cBox.children[0],[].slice.call(s.children)),n&&(n.disabled=!0),this.filterState=!(o=!0);n&&e.length&&(this.filterState=!n.disabled,n.dataBind());var S={requestType:tt,dataSource:this.renderEmpty?[]:e};(S.filterModel=this).parent.notify(an,S),this.parent.notify(rr,{disabled:o}),this.infiniteRenderMod&&this.infiniteInitialLoad&&(this.cBox.style.marginTop="0px"),F.hideSpinner(this.spinner),r&&"ODataV4Adaptor"===r()&&this.infiniteOdataCount===this.options.parentTotalDataCount&&this.infiniteDataCount!==this.options.parentTotalDataCount&&(this.infiniteDataCount=this.infiniteLoadedElem.length)},S.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=jh(o,{},s,this.foreignKeyData)[0],e=q.getValue(o.foreignKeyField,n)),e!==s||"equal"!==r.operator&&"notequal"!==r.operator||(this.infiniteManualSelectMaintainPred.push(t[i]),t.splice(i,1),i--)}},S.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)},S.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="string"!=typeof(h=Wh(t,h=e[parseInt(s.toString(),10)]))||q.isNullOrUndefined(r)||q.isNullOrUndefined(r.parent)||q.isNullOrUndefined(r.parent.filterSettings)||q.isNullOrUndefined(r.parent.filterSettings.enableCaseSensitivity)?h:h.toLowerCase();p in a||((d={}).ejValue=h,a[""+p]=!0,l&&(p=jh(i,{},h,n)[0],q.setValue(Mi,p,e[parseInt(s.toString(),10)]),h=q.getValue(i.foreignKeyValue,p)),q.setValue(t,q.isNullOrUndefined(h)?null:h,d),q.setValue("dataObj",e[parseInt(s.toString(),10)],d),o.push(d))}return U.DataUtil.group(U.DataUtil.sort(o,t,U.DataUtil.fnAscending),"ejValue")},S.getPredicate=function(e){for(var t,i=U.DataUtil.distinct(e,"field",!0)||[],n={},r=0;r<i.length;r++)0!==(t=new U.DataManager(e).executeLocal((new U.Query).where("field","equal",i[parseInt(r.toString(),10)].field))).length&&(n[i[parseInt(r.toString(),10)].field]=S.generatePredicate(t));return n},S.generatePredicate=function(e){var t=e?e.length:0,i=S.updateDateFilter(e[0]);i.ignoreAccent=!q.isNullOrUndefined(i.ignoreAccent)&&i.ignoreAccent;for(var n="date"===i.type||"datetime"===i.type||"dateonly"===i.type?_h(i,i.type):i.ejpredicate||new U.Predicate(i.field,i.operator,i.value,!S.getCaseValue(i),i.ignoreAccent),r=1;r<t;r++)e[parseInt(r.toString(),10)]=S.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(_h(e[parseInt(r.toString(),10)],e[r].type)):n.predicates.push(new U.Predicate(e[r].field,e[parseInt(r.toString(),10)].operator,e[parseInt(r.toString(),10)].value,!S.getCaseValue(e[parseInt(r.toString(),10)]),e[parseInt(r.toString(),10)].ignoreAccent)):n="date"===e[r].type||"datetime"===e[r].type||"dateonly"===e[r].type?n[e[parseInt(r.toString(),10)].predicate](_h(e[parseInt(r.toString(),10)],e[parseInt(r.toString(),10)].type),e[parseInt(r.toString(),10)].type,e[parseInt(r.toString(),10)].ignoreAccent):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,!S.getCaseValue(e[parseInt(r.toString(),10)]),e[parseInt(r.toString(),10)].ignoreAccent);return n||null},S.getCaseValue=function(e){return q.isNullOrUndefined(e.matchCase)?!("string"===e.type||q.isNullOrUndefined(e.type)&&"string"==typeof e.value):e.matchCase},S.updateDateFilter=function(e){return("date"===e.type||"datetime"===e.type||"dateonly"===e.type||e.value instanceof Date)&&(e.type=e.type||"date"),e};var ap=S;function S(e){this.searchInputArgs=null,this.queryFilteredColumn=[],this.existingPredicate={},this.foreignKeyQuery=new U.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.parent=e,this.id=this.parent.element.id,this.valueFormatter=new V(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&&q.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"]),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?q.addClass([this.cBoxTrue,this.cBoxFalse],this.parent.cssClass.split(" ")):q.addClass([this.cBoxTrue,this.cBoxFalse],[this.parent.cssClass]))}lp=function(e,t){return(lp=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}lp(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(l,hp=ap),l.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(!q.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},l.prototype.destroy=function(){var e;this.dlg&&(this.unwireExEvents(),hp.prototype.closeDialog.call(this)),this.isDevice||!this.menuObj||(e=this.menuObj.element.querySelector("li.e-focused"))&&x(e,"e-excel-menu")||this.destroyCMenu(),this.dlgObj&&!this.dlgObj.isDestroyed&&this.removeDialog()},l.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",!q.isNullOrUndefined(e)&&i&&this.ensureTextFilter()?"e-icon-check":l+" e-emptyicon",!0)),this.menu.appendChild(a),this.parent.notify(hn,{element:this.menu}),this.parent.notify(sr,{isFiltered:t})},l.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},l.prototype.wireExEvents=function(){q.Browser.isDevice||q.EventHandler.add(this.dlg,"mouseover",this.hoverHandler,this),q.EventHandler.add(this.dlg,"click",this.clickExHandler,this),q.EventHandler.add(this.dlg,"keyup",this.keyUp,this),q.EventHandler.add(this.dlg,"keydown",this.keyDown,this)},l.prototype.unwireExEvents=function(){q.Browser.isDevice||q.EventHandler.remove(this.dlg,"mouseover",this.hoverHandler),q.EventHandler.remove(this.dlg,"click",this.clickExHandler),q.EventHandler.remove(this.dlg,"keyup",this.keyUp),q.EventHandler.remove(this.dlg,"keydown",this.keyDown)},l.prototype.clickExHandler=function(e){var t=x(e.target,"e-menu-item");t&&(this.getLocalizedLabel("ClearFilter")===t.innerText.trim()?(this.clearFilter(),this.closeDialog()):(this.options.isResponsiveFilter||q.Browser.isDevice)&&this.getLocalizedLabel({string:"TextFilter",date:"DateFilter",datetime:"DateTimeFilter",number:"NumberFilter"}[this.options.type])===t.innerText.trim()&&this.hoverHandler(e))},l.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")?x(e,"e-ftrchk"):x(e,"e-menu-item"),this.excelSetFocus(i,t))},l.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")?x(e.target,"e-menu-item"):x(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(x(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"))},l.prototype.keyDown=function(e){"ArrowUp"!==e.key&&"ArrowDown"!==e.key||e.preventDefault()},l.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)},l.prototype.destroyCMenu=function(){this.isCMenuOpen=!1,this.menuObj&&!this.menuObj.isDestroyed&&(this.menuObj.destroy(),q.EventHandler.remove(this.menuObj.element,"keydown",this.contextKeyDownHandler),q.remove(this.cmenu),this.parent.notify(or,{target:null,header:"",isOpen:!1,col:this.options.column}))},l.prototype.hoverHandler=function(e){var t,i,n,r;this.options.isResponsiveFilter&&"mouseover"===e.type||(r=e.target.querySelector(".e-contextmenu"),i=x(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"),q.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:q.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 z.ContextMenu(n),this.menuObj.isAngular=wd(this.parent),this.menuObj.appendTo(this.cmenu),q.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(or,{target:this.menuObj.element.parentElement,header:n,isOpen:!0})):(q.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=q.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)),nd(this.parent.element,this.menuObj.element.parentElement)))},l.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())},l.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},l.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)},l.prototype.getContextBounds=function(){return this.menuObj.element.style.display="block",this.menuObj.element.getBoundingClientRect()},l.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},l.prototype.openDialog=function(e){var t,i=this;this.updateModel(e),this.getAndSetChkElem(e),this.showDialog(e),e.cancel||(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"),this.parent&&!q.isNullOrUndefined(this.parent.getContent)&&this.parent.getContent()&&this.parent.getContent().firstElementChild.offsetHeight<this.dlg.offsetHeight&&!x(this.parent.element,"e-gantt-dialog")&&bd(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&&this.parent.notify(Di,{}),this.wireExEvents())},l.prototype.closeDialog=function(){this.destroy()},l.prototype.selectHandler=function(e){e.item&&(this.parent.notify(ar,{}),this.menuItem=e.item,this.closeDialog(),this.renderDialogue(e))},l.prototype.renderDialogue=function(e){var l=this,e=e?e.element:void 0,t=this.options.field,i=!q.isNullOrUndefined(t)&&Ih(t),n=!q.isNullOrUndefined(t)&&xh(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&&!q.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=Ih(l.options.column.field)?xh(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("#"+r+"-xlfl-frstvalue").focus()}):a.querySelector("#"+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(),Cd(this.parent,this.dlgObj),this.dlgDiv.setAttribute("aria-label",this.getLocalizedLabel("CustomFilterDialogARIA")),this.childRefs.unshift(this.dlgObj),this.dlgObj.appendTo(this.dlgDiv)},l.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)},l.prototype.removeDialog=function(){this.parent.notify(lr,{}),(this.parent.isReact||this.parent.isVue)&&void 0!==this.parent.destroyTemplate&&Gd(this.parent,["filterTemplate"]),this.removeObjects(this.childRefs),q.remove(this.dlgDiv),this.parent.notify(nr,{})},l.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&&q.Browser.isDevice&&window.innerWidth<440&&(this.dlgObj.element.style.width="90%"),this.parent.notify(nn,{column:t,dialog:this.dialogObj});var i={column:t,dialogInstance:this.dialogObj,cancel:!1,target:e};this.parent.trigger(tn,i),i.cancel?((this.parent.isReact||this.parent.isVue)&&void 0!==this.parent.destroyTemplate&&Gd(this.parent,["filterTemplate"]),this.removeObjects(this.childRefs),q.remove(this.dlgDiv)):(this.dlgObj.show(),nd(this.parent.element,this.dlgObj.element.parentElement))},l.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)},l.prototype.filterBtnClick=function(e){var t,i,n=!q.isNullOrUndefined(e)&&Ih(e),r=!q.isNullOrUndefined(e)&&xh(e),n=n?r:e,r="string"===this.options.type&&q.isNullOrUndefined(this.options.template)?(t=this.dlgDiv.querySelector("#"+n+"-xlfl-frstvalue"),this.dlgDiv.querySelector("#"+n+"-xlfl-secndvalue")):(t=this.dlgDiv.querySelector("#"+n+"-xlfl-frstvalue").ej2_instances[0],this.dlgDiv.querySelector("#"+n+"-xlfl-secndvalue").ej2_instances[0]),e=this.dlgDiv.querySelector("#"+n+"-xlfl-frstoptr").ej2_instances[0],s=this.dlgDiv.querySelector("#"+n+"-xlfl-secndoptr").ej2_instances[0];"string"===this.options.type&&(i=this.dlgDiv.querySelector("#"+n+"-xlflmtcase").ej2_instances[0].checked);n=this.dlgDiv.querySelector("#"+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()},l.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(ln,e),e.cancel||(d.push({field:h,predicate:n,matchCase:r,ignoreAccent:s,operator:t,value:e.arg3,type:this.options.type}),i=new U.Predicate(h,t.toLowerCase(),e.arg3,!r,s),q.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))},l.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=!q.isNullOrUndefined(e)&&Ih(e),l=!q.isNullOrUndefined(e)&&xh(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(nh({dataSource:e,fields:{text:"text",value:"value"},text:i,enableRtl:this.parent.enableRtl,cssClass:this.parent.cssClass||null},o.filter.params)),n=(l.isAngular=wd(this.parent),this.childRefs.unshift(l),{open:this.dropDownOpen.bind(this),change:this.dropDownValueChange.bind(this)});return jd(a.id,[Is,xs],n,this),l.addEventListener(Is,this.eventHandlers[a.id][Is]),l.addEventListener(xs,this.eventHandlers[a.id][xs]),l.appendTo(a),{fieldElement:s,operator:this.getSelectedValue(i)}},l.prototype.removeHandlersFromComponent=function(e){e.element.classList.contains("e-dropdownlist")?Vd(e,[Is,xs],this):e.element.classList.contains("e-autocomplete")&&Vd(e,[p,Rs],this)},l.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},l.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:q.isNullOrUndefined(t.getAttribute("disabled"))||(t.ej2_instances[0].enabled=!0)},l.prototype.getFilterUIInfo=function(){return{firstOperator:this.firstOperator,secondOperator:this.secondOperator,field:this.options.field}},l.prototype.getSelectedValue=function(e){e=new U.DataManager(this.optrData).executeLocal((new U.Query).where("text","equal",e));return q.isNullOrUndefined(e[0])?"":e[0].value},l.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)},l.prototype.getSelectedText=function(e){e=new U.DataManager(this.optrData).executeLocal((new U.Query).where("value","equal",e));return q.isNullOrUndefined(e[0])?"":e[0].text},l.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(bs)),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)},l.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",!q.isNullOrUndefined(e)&&Ih(e)),o=!q.isNullOrUndefined(e)&&xh(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")},l.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())}},l.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),!q.isNullOrUndefined(t)&&Ih(t)),h=!q.isNullOrUndefined(t)&&xh(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),fh(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,q.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))},l.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},l.prototype.renderMatchCase=function(e,t,i,n,r){var s=this.parent.createElement("div",{className:"e-xlfl-matchcasediv"}),o=(s.style.display="inline-block",!q.isNullOrUndefined(e)&&Ih(e)),a=!q.isNullOrUndefined(e)&&xh(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)},l.prototype.renderDate=function(e,t,i,n,r){var s=Qh(e.format,e.type)||e.format,s=new B.DatePicker(nh({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)},l.prototype.renderDateTime=function(e,t,i,n,r){var s=Qh(e.format,e.type),s=new B.DateTimePicker(nh({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)},l.prototype.completeAction=function(e){e.result=Mh(e.result)},l.prototype.renderNumericTextBox=function(e,t,i,n,r){r=new L.NumericTextBox(nh({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)},l.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(nh({dataSource:a instanceof U.DataManager?a:new U.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=cd({requestType:"stringfilterrequest"},this.getQuery()),this.parent.trigger(Pi,o.state),o.deffered.promise.then(function(e){l.dataSource=new U.DataManager(e)})),this.childRefs.unshift(l),{actionComplete:this.acActionComplete(l,t),focus:this.acFocus(l,t,e,i)});jd(i.id,[p,Rs],r,this),l.addEventListener(Rs,this.eventHandlers[i.id][Rs]),l.addEventListener(p,this.eventHandlers[i.id][p]),l.appendTo(i)},l.prototype.acActionComplete=function(r,t){return function(e){var n=!q.isNullOrUndefined(t)&&Ih(t);e.result=e.result.filter(function(e,t,i){return i.map(function(e){return n?Nd(r.fields.value,e):e[r.fields.value]}).indexOf(n?Nd(r.fields.value,e):e[r.fields.value])===t})}},l.prototype.acFocus=function(i,n,r,s){var o=this;return function(){var e=!q.isNullOrUndefined(n)&&Ih(n),t=!q.isNullOrUndefined(n)&&xh(n),e=e?t:n;i.filterType=o.dlgDiv.querySelector("#"+e+(s.id===e+"-xlfl-frstvalue"?"-xlfl-frstoptr":"-xlfl-secndoptr")).ej2_instances[0].value,i.ignoreCase="string"!==r.type||!o.dlgDiv.querySelector("#"+e+"-xlflmtcase").ej2_instances[0].checked,i.filterType=q.isNullOrUndefined(i.filterType)?"equal":i.filterType}};var lp,hp,dp=l;function l(e,t){e=hp.call(this,e)||this;return e.childRefs=[],e.eventHandlers={},e.isDevice=!1,e.focusedMenuItem=null,e.customFilterOperators=t,e.isExcel=!0,e}cp.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},cp.prototype.onActionComplete=function(e){var t=this.isRemove?{requestType:"sorting",type:p}:{columnName:this.columnName,direction:this.direction,requestType:"sorting",type:p};this.isRemove=!1,this.parent.trigger(p,q.extend(e,t))},cp.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(ni,{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()))},cp.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,N.ResponsiveDialogAction.isSort)},cp.prototype.backupSettings=function(){this.lastSortedCols=eh(this.sortSettings.columns),this.lastCols=this.sortedColumns},cp.prototype.restoreSettings=function(){this.isModelChanged=!1,this.isMultiSort=!0,this.parent.setProperties({sortSettings:{columns:this.lastSortedCols}},!0),this.sortedColumns=this.lastCols,this.isModelChanged=!0},cp.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)},cp.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(ft,e)),this.refreshSortSettings(),this.removeSortIcons(),this.addSortIcons())},cp.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)},cp.prototype.clearSorting=function(){var e=dh(this.sortSettings.columns);if(this.isActionPrevent())this.parent.notify(ni,{instance:this,handler:this.clearSorting});else for(var t=0,i=e.length;t<i;t++)this.removeSortColumn(e[parseInt(t.toString(),10)].field)},cp.prototype.isActionPrevent=function(){return Oh(this.parent)},cp.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(ni,{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(ft,n);break}n.cancel||this.addSortIcons()}},cp.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},cp.prototype.getModuleName=function(){return"sort"},cp.prototype.initialEnd=function(){if(this.parent.off(ct,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}},cp.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:hr,handler:this.setFullScreenDialog},{event:zr,handler:this.renderResponsiveChangeAction},{event:ct,handler:this.initialEnd},{event:vt,handler:this.onActionComplete},{event:gt,handler:this.onPropertyChanged},{event:Nt,handler:this.clickHandler},{event:yt,handler:this.refreshSortIcons},{event:Pt,handler:this.keyPressed},{event:Hi,handler:this.cancelBeginEvent},{event:s,handler:this.destroy}],zd(this.parent,this.evtHandlers,!0,this),q.EventHandler.add(document.body,"click",this.excelFilterSortAction,this),q.EventHandler.add(document.body,"touchend",this.excelFilterSortAction,this))},cp.prototype.removeEventListener=function(){this.parent.isDestroyed||(zd(this.parent,this.evtHandlers,!1),q.EventHandler.remove(document.body,"click",this.excelFilterSortAction),q.EventHandler.remove(document.body,"touchend",this.excelFilterSortAction))},cp.prototype.excelFilterSortAction=function(e){var t=x(e.target,"e-grid-popup"),i=this.parent.element.id+"_e-popup";t&&t.id===i&&x(e.target,"e-excelfilter")&&this.excelFilterSortActionHandler(e)},cp.prototype.destroy=function(){this.isModelChanged=!1;var e=this.parent.element;e&&(e.querySelector("."+ts)||e.querySelector("."+is))&&(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())},cp.prototype.cancelBeginEvent=function(e){"sorting"===e.requestType&&(this.restoreSettings(),this.refreshSortIcons(),this.isMultiSort=!0)},cp.prototype.clickHandler=function(e){var t=this.parent,i=(this.currentTarget=null,this.popUpClickHandler(e),q.closest(e.target,".e-headercell"));!i||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")||x(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),q.Browser.isDevice)&&this.showPopUp(e),i&&i.classList.remove("e-resized"),this.excelFilterSortActionHandler(e)},cp.prototype.excelFilterSortActionHandler=function(e){var t;(x(e.target,"e-excel-ascending")||x(e.target,"e-excel-descending"))&&(t=q.closest(e.target,".e-filter-popup").getAttribute("data-uid"),e=q.isNullOrUndefined(x(e.target,"e-excel-descending"))?"Ascending":"Descending",this.sortColumn(this.parent.getColumnByUid(t).field,e,!1))},cp.prototype.keyPressed=function(e){var t,i=e.target;this.parent.isEdit||"enter"!==e.action&&"ctrlEnter"!==e.action&&"shiftEnter"!==e.action||!q.closest(i,".e-headercell")||(i=this.focus.getFocusedElement(),!q.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)))},cp.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)},cp.prototype.showPopUp=function(e){var t=q.closest(e.target,".e-headercell");!this.parent.allowMultiSorting||q.isNullOrUndefined(t)&&!this.parent.isContextMenuOpen()||oh(this.parent.element.querySelector(".e-gridpopup"),e,"e-sortdirect e-icons e-icon-sortdirect"+(1<this.sortedColumns.length?" e-spanclicked":""))},cp.prototype.popUpClickHandler=function(e){var t=e.target;q.closest(t,".e-headercell")||e.target.classList.contains(b)||q.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"},cp.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)||q.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?q.classList(e,["e-ascending","e-icon-ascending"],[]):q.classList(e,["e-descending","e-icon-descending"],[]))},cp.prototype.removeSortIcons=function(e){for(var t,i=this.parent,n=this.parent.getColumns().map(function(e){return e.field}),r=e||0,s=q.isNullOrUndefined(e)?n.length:e+1;r<s;r++)t=i.getColumnHeaderByField(n[parseInt(r.toString(),10)]),q.isNullOrUndefined(t)||i.allowGrouping&&-1<i.groupSettings.columns.indexOf(n[parseInt(r.toString(),10)])&&!t.querySelector(".e-sortfilterdiv")||q.isNullOrUndefined(n[parseInt(r.toString(),10)])||(this.aria.setSort(t,"none"),q.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")))},cp.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},cp.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))}},cp.prototype.refreshSortIcons=function(){this.removeSortIcons(),this.isMultiSort=!0,this.removeSortIcons(),this.addSortIcons(),this.isMultiSort=!1,this.updateAriaAttr()},cp.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},cp.prototype.showCustomSort=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog()};var pp=cp;function cp(e,t,i,n){this.contentRefresh=!0,this.isModelChanged=!0,this.aria=new io,this.currentTarget=null,this.parent=e,this.sortSettings=t,this.sortedColumns=i,this.serviceLocator=n,this.focus=n.getService("focus"),this.addEventListener(),this.setFullScreenDialog()}gp.prototype.render=function(){this.pagerElement=this.pagerModule.element,this.renderNumericContainer(),this.refreshNumericLinks(),this.wireEvents()},gp.prototype.refresh=function(){this.pagerModule.updateTotalPages(),this.links.length&&this.updateLinksHtml(),this.refreshAriaAttrLabel(),this.updateStyles()},gp.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=q.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&&(q.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)},gp.prototype.wireEvents=function(){q.EventHandler.add(this.pagerElement,"click",this.clickHandler,this),q.EventHandler.add(this.pagerElement,"auxclick",this.auxiliaryClickHandler,this)},gp.prototype.unwireEvents=function(){q.EventHandler.remove(this.pagerModule.element,"click",this.clickHandler),q.EventHandler.remove(this.pagerModule.element,"auxclick",this.auxiliaryClickHandler)},gp.prototype.destroy=function(){this.unwireEvents()},gp.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"))},gp.prototype.renderNumericContainer=function(){this.element=q.createElement("div",{className:"e-pagercontainer",attrs:{role:"navigation"}}),this.renderFirstNPrev(this.element),this.renderPrevPagerSet(this.element),this.element.appendChild(q.createElement("div",{className:"e-numericcontainer"})),this.renderNextPagerSet(this.element),this.renderNextNLast(this.element),this.pagerModule.element.appendChild(this.element)},gp.prototype.renderFirstNPrev=function(e){this.first=q.createElement("div",{className:"e-first e-icons e-icon-first",attrs:{title:this.pagerModule.getLocalizedLabel("firstPageTooltip"),tabindex:"-1",role:"button"}}),this.prev=q.createElement("div",{className:"e-prev e-icons e-icon-prev",attrs:{title:this.pagerModule.getLocalizedLabel("previousPageTooltip"),tabindex:"-1",role:"button"}}),q.append([this.first,this.prev],e)},gp.prototype.renderPrevPagerSet=function(e){var t=q.createElement("div");this.PP=q.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)},gp.prototype.renderNextPagerSet=function(e){var t=q.createElement("div");this.NP=q.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)},gp.prototype.renderNextNLast=function(e){this.next=q.createElement("div",{className:"e-next e-icons e-icon-next",attrs:{title:this.pagerModule.getLocalizedLabel("nextPageTooltip"),tabindex:"-1",role:"button"}}),this.last=q.createElement("div",{className:"e-last e-icons e-icon-last",attrs:{title:this.pagerModule.getLocalizedLabel("lastPageTooltip"),tabindex:"-1",role:"button"}}),q.append([this.next,this.last],e)},gp.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")||q.isNullOrUndefined(this.target.getAttribute("data-index"))||(t.currentPage=parseInt(this.target.getAttribute("data-index"),10),this.pagerModule.isInteracted=!0,t.dataBind()),!1},gp.prototype.auxiliaryClickHandler=function(e){this.target=e.target,this.target.classList.contains("e-numericitem")&&1===e.button&&e.preventDefault()},gp.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"),q.classList(this.links[parseInt(n.toString(),10)],[],["e-currentitem","e-active"]),this.links[parseInt(n.toString(),10)].removeAttribute("aria-current")}q.attributes(this.first,{"data-index":"1",title:this.pagerModule.getLocalizedLabel("firstPageTooltip")}),q.attributes(this.pagerElement.querySelector(".e-mfirst"),{"data-index":"1",title:this.pagerModule.getLocalizedLabel("firstPageTooltip")}),q.attributes(this.last,{"data-index":t.totalPages.toString(),title:this.pagerModule.getLocalizedLabel("lastPageTooltip")}),q.attributes(this.pagerElement.querySelector(".e-mlast"),{"data-index":t.totalPages.toString(),title:this.pagerModule.getLocalizedLabel("lastPageTooltip")}),q.attributes(this.prev,{"data-index":(t.currentPage-1).toString(),title:this.pagerModule.getLocalizedLabel("previousPageTooltip")}),q.attributes(this.pagerElement.querySelector(".e-mprev"),{"data-index":(t.currentPage-1).toString(),title:this.pagerModule.getLocalizedLabel("previousPageTooltip")}),q.attributes(this.next,{"data-index":(t.currentPage+1).toString(),title:this.pagerModule.getLocalizedLabel("nextPageTooltip")}),q.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=(q.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));q.attributes(this.NP,{"data-index":(g+1).toString(),title:this.pagerModule.getLocalizedLabel("nextPagerTooltip"),"aria-label":this.pagerModule.getLocalizedLabel("nextPagerTooltip")}),this.target=void 0},gp.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)])&&(q.classList(this.links[parseInt(e.toString(),10)],["e-currentitem","e-active"],[]),this.links[parseInt(e.toString(),10)].setAttribute("aria-current","page"))},gp.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?(q.classList(this.prev,i,n),q.classList(this.first,e,t),q.classList(this.pagerElement.querySelector(".e-mfirst"),e,t),q.classList(this.pagerElement.querySelector(".e-mprev"),i,n)):(q.classList(this.prev,n,i),q.classList(this.first,t,e),q.classList(this.pagerElement.querySelector(".e-mprev"),n,i),q.classList(this.pagerElement.querySelector(".e-mfirst"),t,e))},gp.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)})?q.classList(this.PP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"]):q.classList(this.PP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"])},gp.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})?q.classList(this.NP,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]):q.classList(this.NP,["e-numericitem","e-pager-default"],["e-nextprevitemdisabled","e-disable"])},gp.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?(q.classList(this.last,t,e),q.classList(this.next,n,i),q.classList(this.pagerElement.querySelector(".e-mlast"),t,e),q.classList(this.pagerElement.querySelector(".e-mnext"),n,i)):(q.classList(this.last,e,t),q.classList(this.next,i,n),q.classList(this.pagerElement.querySelector(".e-mlast"),e,t),q.classList(this.pagerElement.querySelector(".e-mnext"),i,n))};var up=gp;function gp(e){this.pagerModule=e}mp.prototype.render=function(){var e=q.createElement("div",{className:"e-parentmsgbar"});this.pageNoMsgElem=q.createElement("span",{className:"e-pagenomsg"}),this.pageNoMsgElem.style.textAlign="right",this.pageCountMsgElem=q.createElement("span",{className:"e-pagecountmsg"}),this.pageCountMsgElem.style.textAlign="right",q.append([this.pageNoMsgElem,this.pageCountMsgElem],e),this.pagerModule.element.appendChild(e),this.refresh()},mp.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")},mp.prototype.hideMessage=function(){this.pageNoMsgElem&&(this.pageNoMsgElem.style.display="none"),this.pageCountMsgElem&&(this.pageCountMsgElem.style.display="none")},mp.prototype.showMessage=function(){this.pageNoMsgElem||this.render(),this.pageNoMsgElem.style.display="",this.pageCountMsgElem.style.display=""},mp.prototype.destroy=function(){},mp.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},mp.prototype.isValidLocale=function(e){try{return new Intl.NumberFormat(e),!0}catch(e){return!1}};var fp=mp;function mp(e){this.pagerModule=e}yp=function(e,t){return(yp=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 yp,Sp,Pa=function(e,t){function i(){this.constructor=e}yp(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},e=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},vp=(Sp=q.Component,Pa(h,Sp),h.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},h.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 up(this),this.pagerMessageModule=new fp(this)},h.prototype.setCurrentPageValue=function(e){e=parseInt(e,10);this.hasParent&&this.parent.setProperties({pageSettings:{currentPage:e}},!0),this.currentPage=e},h.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(" ")?q.addClass([this.element],this.cssClass.split(" ")):q.addClass([this.element],[this.cssClass])),this.hasParent||this.element.setAttribute("tabindex","0"),this.enableQueryString&&(e=new URL(window.location.href).searchParams.get("page"),!q.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()},h.prototype.getPersistData=function(){return this.addOnPersist(["currentPage","pageSize"])},h.prototype.destroy=function(){this.isDestroyed||(this.isReactTemplate()&&(this.off(this.pageRefresh,this.pagerTemplate),this.hasParent||this.destroyTemplate(["pagerTemplate"])),this.removeListener(),this.unwireEvents(),Sp.prototype.destroy.call(this),this.containerModule.destroy(),this.pagerMessageModule.destroy(),this.isReactTemplate())||(this.element.innerHTML="")},h.prototype.destroyTemplate=function(e,t){this.clearTemplate(e,t)},h.prototype.getModuleName=function(){return"pager"},h.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()}},h.prototype.wireEvents=function(){this.hasParent||(q.EventHandler.add(this.element,"keydown",this.keyPressHandler,this),q.EventHandler.add(document.body,"keydown",this.keyDownHandler,this)),q.EventHandler.add(this.element,"focusin",this.onFocusIn,this),q.EventHandler.add(this.element,"focusout",this.onFocusOut,this),q.EventHandler.add(window,"resize",this.resizePager,this),q.EventHandler.add(window,"load",this.resizePager,this)},h.prototype.unwireEvents=function(){this.hasParent||(q.EventHandler.remove(this.element,"keydown",this.keyPressHandler),q.EventHandler.remove(document.body,"keydown",this.keyDownHandler)),q.EventHandler.remove(this.element,"focusin",this.onFocusIn),q.EventHandler.remove(this.element,"focusout",this.onFocusOut),q.EventHandler.remove(window,"resize",this.resizePager),q.EventHandler.remove(window,"load",this.resizePager)},h.prototype.onFocusIn=function(e){var t=this.getFocusedTabindexElement();q.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)))},h.prototype.onFocusOut=function(e){var t=this.getFocusedElement(),i=this.getDropDownPage();q.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)},h.prototype.keyDownHandler=function(e){e.altKey&&74===e.keyCode&&0<(e=this.getFocusablePagerElements(this.element,[])).length&&e[0].focus()},h.prototype.keyPressHandler=function(e){var t=q.extend(e,{cancel:!1});this.notify(Pt,t),!0===t.cancel&&e.stopImmediatePropagation()},h.prototype.addListener=function(){this.isDestroyed||this.hasParent||this.on(Pt,this.onKeyPress,this)},h.prototype.removeListener=function(){this.isDestroyed||this.hasParent||this.off(Pt,this.onKeyPress)},h.prototype.onKeyPress=function(e){this.hasParent||(this.checkPagerHasFocus()?this.changePagerFocus(e):(e.preventDefault(),this.setPagerFocus()))},h.prototype.checkPagerHasFocus=function(){return!!this.getFocusedTabindexElement()},h.prototype.setPagerContainerFocus=function(){this.element.focus()},h.prototype.setPagerFocus=function(){var e=this.getFocusablePagerElements(this.element,[]);0<e.length&&e[0].focus()},h.prototype.setPagerFocusForActiveElement=function(){var e=this.getActiveElement();e&&e.focus()},h.prototype.setTabIndexForFocusLastElement=function(){var e=this.getFocusablePagerElements(this.element,[]),t=this.getDropDownPage();this.pageSizes&&t&&!q.isNullOrUndefined(t.offsetParent)?t.tabIndex=0:0<e.length&&(e[e.length-1].tabIndex=0)},h.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=""},h.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},h.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}},h.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}},h.prototype.checkFirstPagerFocus=function(){return!!this.firstPagerFocus&&!(this.firstPagerFocus=!1)},h.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())},h.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();q.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())},h.prototype.checkFocusInAdaptiveMode=function(e){e=this.getClass(e);return"e-mfirst"===e||"e-mprev"===e||"e-mnext"===e||"e-mlast"===e},h.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())},h.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)}},h.prototype.getActiveElement=function(){return this.element.querySelector(".e-active")},h.prototype.getDropDownPage=function(){var e,t=this.element.querySelector(".e-pagerdropdown");return e=t?t.children[0]:e},h.prototype.getFocusedElement=function(){return this.element.querySelector(".e-focused")},h.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},h.prototype.getElementByClass=function(e){return this.element.querySelector("."+e)},h.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||q.isNullOrUndefined(o.offsetParent)||n.push(s)}return n},h.prototype.addFocus=function(e,t){q.isNullOrUndefined(e)||(t&&q.addClass([e],["e-focused","e-focus"]),e.tabIndex=0)},h.prototype.removeFocus=function(e,t){t&&q.removeClass([e],["e-focused","e-focus"]),e.tabIndex=-1},h.prototype.getLocalizedLabel=function(e){return this.localeObj.getConstant(e)},h.prototype.goToPage=function(e){this.checkGoToPage(e)&&(this.currentPage=e,this.isInteracted=!1,this.dataBind())},h.prototype.setPageSize=function(e){this.pageSize=e,this.dataBind()},h.prototype.checkpagesizes=function(){return!(!0!==this.pageSizes&&!this.pageSizes.length)},h.prototype.checkGoToPage=function(e,t){return e!==this.currentPage&&(this.previousPageNo=this.currentPage),q.isNullOrUndefined(t)||(this.previousPageNo=t),this.previousPageNo!==e&&1<=e&&e<=this.totalPages},h.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()))},h.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),fh(this.element,t)))},h.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},h.prototype.getPagerTemplate=function(){return this.templateFn},h.prototype.compile=function(t){if(t)try{"function"!=typeof t&&document.querySelectorAll(t).length?this.templateFn=q.compile(document.querySelector(t).innerHTML.trim()):this.templateFn=q.compile(t)}catch(e){this.templateFn=q.compile(t)}},h.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())},h.prototype.updateRTL=function(){this.enableRtl?this.element.classList.add("e-rtl"):this.element.classList.remove("e-rtl")},h.prototype.initLocalization=function(){this.localeObj=new q.L10n(this.getModuleName(),this.defaultConstants,this.locale)},h.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"))},h.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)},h.prototype.renderFirstPrevDivForDevice=function(){this.element.appendChild(q.createElement("div",{className:"e-mfirst e-icons e-icon-first",attrs:{title:this.getLocalizedLabel("firstPageTooltip"),tabindex:"-1",role:"button"}})),this.element.appendChild(q.createElement("div",{className:"e-mprev e-icons e-icon-prev",attrs:{title:this.getLocalizedLabel("previousPageTooltip"),tabindex:"-1",role:"button"}}))},h.prototype.renderNextLastDivForDevice=function(){this.element.appendChild(q.createElement("div",{className:"e-mnext e-icons e-icon-next",attrs:{title:this.getLocalizedLabel("nextPageTooltip"),tabindex:"-1",role:"button"}})),this.element.appendChild(q.createElement("div",{className:"e-mlast e-icons e-icon-last",attrs:{title:this.getLocalizedLabel("lastPageTooltip"),tabindex:"-1",role:"button"}}))},h.prototype.addAriaLabel=function(){var e=[".e-mfirst",".e-mprev",".e-mnext",".e-mlast"];if(!q.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"))}},h.prototype.isReactTemplate=function(){return(this.isReact||this.isVue)&&this.template&&"string"!=typeof this.template&&!(this.template.prototype&&this.template.prototype.CSPTemplate)},h.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)},h.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")},h.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)}},e([q.Property(!(h.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=q.isNullOrUndefined(x(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&&q.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,q.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&&q.classList(l,["e-nextprevitemdisabled","e-disable"],["e-numericitem","e-pager-default"]),1===parseInt(r[0].getAttribute("data-index"),10)&&q.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&&!q.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])+" ")}}))],h.prototype,"enableQueryString",void 0),e([q.Property(!1)],h.prototype,"enableExternalMessage",void 0),e([q.Property(!0)],h.prototype,"enablePagerMessage",void 0),e([q.Property(12)],h.prototype,"pageSize",void 0),e([q.Property(10)],h.prototype,"pageCount",void 0),e([q.Property(1)],h.prototype,"currentPage",void 0),e([q.Property()],h.prototype,"totalRecordsCount",void 0),e([q.Property()],h.prototype,"externalMessage",void 0),e([q.Property(!1)],h.prototype,"pageSizes",void 0),e([q.Property()],h.prototype,"template",void 0),e([q.Property("")],h.prototype,"customText",void 0),e([q.Event()],h.prototype,"click",void 0),e([q.Property("")],h.prototype,"cssClass",void 0),e([q.Event()],h.prototype,"dropDownChanged",void 0),e([q.Event()],h.prototype,"created",void 0),e([q.NotifyPropertyChanges],h));function h(e,t,i){e=Sp.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}wp.prototype.getModuleName=function(){return"pagerdropdown"},wp.prototype.render=function(){var e=this.pagerModule,t=(this.pagerDropDownDiv=q.createElement("div",{className:"e-pagesizes"}),q.createElement("div",{className:"e-pagerdropdown"})),i=q.createElement("div",{className:"e-pagerconstant"}),n=q.createElement("input",{attrs:{type:"text",tabindex:"-1"}}),t=(this.pagerCons=q.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=wd(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()},wp.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)})},wp.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"))},wp.prototype.beforeValueChange=function(e){var t;"number"==typeof e.newProp.value&&(t=e.newProp.value.toString(),e.newProp.value=t)},wp.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},wp.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")},wp.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)},wp.prototype.addEventListener=function(){this.dropDownListObject.on("beforeValueChange",this.beforeValueChange,this)},wp.prototype.removeEventListener=function(){this.dropDownListObject.off("beforeValueChange",this.beforeValueChange)},wp.prototype.destroy=function(e){this.dropDownListObject&&!this.dropDownListObject.isDestroyed&&(this.removeEventListener(),this.dropDownListObject.destroy(),this.pagerDropDownDiv)&&this.pagerDropDownDiv.parentNode&&q.remove(this.pagerDropDownDiv)};var Cp=wp;function wp(e){this.pagerModule=e}Ip.prototype.getModuleName=function(){return"externalMessage"},Ip.prototype.render=function(){this.element=q.createElement("div",{className:"e-pagerexternalmsg",attrs:{"aria-label":this.pagerModule.getLocalizedLabel("ExternalMsg")}}),this.pagerModule.element.appendChild(this.element),this.refresh()},Ip.prototype.refresh=function(){this.pagerModule.externalMessage&&this.pagerModule.externalMessage.toString().length?(this.showMessage(),this.element.innerHTML=this.pagerModule.externalMessage):this.hideMessage()},Ip.prototype.hideMessage=function(){q.isNullOrUndefined(this.element)||(this.element.style.display="none")},Ip.prototype.showMessage=function(){this.element.style.display=""},Ip.prototype.destroy=function(){this.element&&this.element.parentElement&&q.remove(this.element)};var bp=Ip;function Ip(e){this.pagerModule=e}Rp.prototype.getModuleName=function(){return"pager"},Rp.prototype.render=function(){var e=this.parent,t=(this.pagerDestroy(),q.isNullOrUndefined(this.parent.pagerTemplate)||(this.pageSettings.template=this.parent.pagerTemplate,this.parent.pageTemplateChange=!0),this.element=this.parent.createElement("div",{className:"e-gridpager"}),nh({},q.extend({},ah(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 vp(t,void 0,this.parent),this.pagerObj.root=e.root||e,this.pagerObj.hasParent=!0,this.pagerObj.on(mr,this.renderReactPagerTemplate,this),this.pagerObj.allowServerDataBinding=!1},Rp.prototype.onSelect=function(e){this.pageSettings.pageSize=e.pageSize,this.isInitialLoad||(this.pageSettings.currentPage=1)},Rp.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)}},Rp.prototype.dataReady=function(e){this.updateModel(e)},Rp.prototype.refresh=function(){this.pagerObj.refresh()},Rp.prototype.goToPage=function(e){this.pagerObj.goToPage(e)},Rp.prototype.setPageSize=function(e){this.pagerObj.setPageSize(e)},Rp.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()},Rp.prototype.onActionComplete=function(e){this.parent.trigger(p,q.extend(e,{currentPage:this.parent.pageSettings.currentPage,requestType:"paging",type:p}))},Rp.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()}},Rp.prototype.clickHandler=function(e){var t,i,n=this.parent;this.isForceCancel||Oh(n)&&!n.prevPageMoving&&!this.isCancel?(this.isForceCancel?this.isForceCancel=!1:(q.isNullOrUndefined(e.newProp)||q.isNullOrUndefined(e.newProp.pageSize)?e.currentPage&&(n.notify(ni,{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(ni,{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(ft,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,this.parent.requestTypeAction="paging"))},Rp.prototype.keyPressHandler=function(e){e.action in Tp&&(e.preventDefault(),(e=this.element.querySelector(Tp[e.action])).classList.contains("e-nextprevitemdisabled")||e.click())},Rp.prototype.updateExternalMessage=function(e){this.pagerObj.enableExternalMessage||(this.pagerObj.enableExternalMessage=!0,this.pagerObj.dataBind()),this.pagerObj.externalMessage=e,this.pagerObj.dataBind()},Rp.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},Rp.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.render(),this.appendToElement(),this.isReactTemplate())&&(this.pagerObj.updateTotalPages(),this.created())},Rp.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(Ts,this.handlers.created.bind(this)),this.evtHandlers=[{event:ht,handler:this.handlers.load},{event:dt,handler:this.handlers.end},{event:pt,handler:this.handlers.ready},{event:St,handler:this.handlers.complete},{event:g,handler:this.handlers.updateLayout},{event:gt,handler:this.handlers.inboundChange},{event:Pt,handler:this.handlers.keyPress},{event:s,handler:this.destroy}],zd(this.parent,this.evtHandlers,!0,this))},Rp.prototype.created=function(){this.isInitialRender&&this.isReactTemplate()&&(this.isInitialRender=!1,this.renderReactPagerTemplate())},Rp.prototype.isReactTemplate=function(){return(this.parent.isReact||this.parent.isVue)&&this.pagerObj.template&&"string"!=typeof this.pagerObj.template},Rp.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"),fh(this.pagerObj.element,e)))},Rp.prototype.removeEventListener=function(){this.parent.isDestroyed||((this.parent.isReact||this.parent.isVue)&&this.parent.removeEventListener(Ts,this.handlers.created),this.parent.off(mr,this.renderReactPagerTemplate),zd(this.parent,this.evtHandlers,!1))},Rp.prototype.destroy=function(){this.removeEventListener(),this.isReactTemplate()&&this.parent.destroyTemplate(["pagerTemplate"]),this.pagerObj.destroy()},Rp.prototype.pagerDestroy=function(){this.pagerObj&&!this.pagerObj.isDestroyed&&(this.pagerObj.destroy(),q.remove(this.element))};var xp=Rp;function Rp(e,t){this.isInitialRender=!0,this.isCancel=!1,vp.Inject(bp,Cp),this.parent=e,this.pageSettings=t,this.addEventListener()}var Tp={pageUp:".e-prev",pageDown:".e-next",ctrlAltPageDown:".e-last",ctrlAltPageUp:".e-first",altPageUp:".e-pp",altPageDown:".e-np"};Dp=function(e,t){return(Dp=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}Dp(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(kp,Ep=eo),kp.prototype.getGui=function(){return this.parent.createElement("div")},kp.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()):fh(l,d.getFilterTemplate()(a,this.parent,"filterTemplate",s,null,null,null,this.parent.root))):l.classList.add("e-hide")):"checkbox"!==d.type?(!q.isNullOrUndefined(d.allowFiltering)&&!d.allowFiltering||q.isNullOrUndefined(d.filterBarTemplate)?(q.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),L.Input.createInput(o,this.parent.createElement)):(l.classList.add("e-fltrtemp"),q.attributes(h,{class:"e-fltrtempdiv"}),q.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)?q.getValue(n,window):n)(o))&&((r=this.parent.createElement("div")).innerHTML=i,i=r.firstChild),q.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&&!q.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&&q.isNullOrUndefined(d.filterTemplate)&&q.isNullOrUndefined(d.filterBarTemplate)&&this.operatorIconRender(h,d,e),!q.isNullOrUndefined(d.allowFiltering)&&!d.allowFiltering||q.isNullOrUndefined(d.filterBarTemplate)||(o={element:i,column:d},(s="string"==typeof(s=d.filterBarTemplate.write)?q.getValue(s,window):s).call(this,o))):d.visible||l.classList.add("e-hide"),this.parent.isFrozenGrid()&&kd(this.parent,d,l),l},kp.prototype.appendHtml=function(e,t){return e.appendChild(t),e},kp.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";q.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&&q.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=wd(this.parent),this.dropOptr.appendTo(t);e=q.closest(this.dropOptr.element,"span");e.classList.add("e-filterbardropdown"),e.removeAttribute("tabindex")},kp.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(Nn,e)};var Dp,Ep,Op=kp;function kp(){var e=null!==Ep&&Ep.apply(this,arguments)||this;return e.element=e.parent.createElement("TH",{className:"e-filterbarcell",attrs:{role:"columnheader"}}),e}Fp.prototype.renderOperatorUI=function(e,t,i,n,r){var s=this,o=(this.dialogObj=n,i.type+"Operator"),r=(this.optrData=this.customOptr=q.isNullOrUndefined(r)?(q.isNullOrUndefined(this.parent.filterSettings.operators)||q.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=document.querySelector(".e-flmenu-valuediv").querySelector("input");"isempty"===s.dropOptr.value||"isnotempty"===s.dropOptr.value||"isnotnull"===s.dropOptr.value||"isnull"===s.dropOptr.value?q.isNullOrUndefined(e.ej2_instances)?e.setAttribute("disabled","true"):e.ej2_instances[0].enabled=!1:q.isNullOrUndefined(e.getAttribute("disabled"))||(q.isNullOrUndefined(e.ej2_instances)?e.removeAttribute("disabled"):e.ej2_instances[0].enabled=!0),Nh(s.dropOptr.value,i.uid,i,i.type,n,s.dropOptr.previousValue)}}),this.dropOptr.isAngular=wd(this.parent),this.dropOptr.addEventListener(Is,this.ddOpen),this.dropOptr.appendTo("#"+i.uid+"-floptr")},Fp.prototype.renderResponsiveDropDownList=function(e){e.popup.element.style.width="100%"},Fp.prototype.dropDownOpen=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString(),this.parent.enableAdaptiveUI&&this.renderResponsiveDropDownList(e)},Fp.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 U.DataManager(this.optrData).executeLocal((new U.Query).where("value","equal",s.operator)),i=q.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},Fp.prototype.getFlOperator=function(){return this.dropOptr.value},Fp.prototype.destroyDropDownList=function(){this.dropOptr.isDestroyed||(this.dropOptr.removeEventListener(Is,this.ddOpen),this.dropOptr.destroy(),this.parent.off(Ei,this.destroyDropDownList),this.parent.off(s,this.destroyDropDownList))};var Ap=Fp;function Fp(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(Ei,this.destroyDropDownList,this),this.parent.on(s,this.destroyDropDownList,this))}Lp.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.processDataOperation(e),this.createMultiSelectDropDown(e),Nh(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,e.getOptrInstance.dropOptr.previousValue)},Lp.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),Nh(t.getOptrInstance.dropOptr.value,t.column.uid,t.column,t.column.type,t.dialogObj,t.getOptrInstance.dropOptr.previousValue)}):this.getAutoCompleteOptions(t)},Lp.prototype.getAutoCompleteOptions=function(e,t){var i,n=e.column.isForeignColumn();if(n){for(var r=ap.getDistinct(t.result,e.column.field).records||[],s=void 0,o=0;o<r.length;o++)s=s?s.or(e.column.field,"contains",r[parseInt(o.toString(),10)][e.column.field],this.parent.filterSettings.enableCaseSensitivity,this.parent.filterSettings.ignoreAccent):new U.Predicate(e.column.field,"contains",r[parseInt(o.toString(),10)][e.column.field],this.parent.filterSettings.enableCaseSensitivity,this.parent.filterSettings.ignoreAccent);(i=(new U.Query).where(s)).params=this.parent.query.params}var t=(n?e.column:this.parent).dataSource,a={value:n?e.column.foreignKeyValue:e.column.field},l=new P.AutoComplete(q.extend({dataSource:t instanceof U.DataManager?t:new U.DataManager(t),fields:a,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(l,e),this.acComplete=this.actionComplete(l),this.acOpen=this.openPopup.bind(this),l.addEventListener(Rs,this.acFocus),l.addEventListener(Is,this.acOpen),l.addEventListener(p,this.acComplete),t&&"result"in t&&(a=cd({requestType:"stringfilterrequest"},this.parent.getQuery?this.parent.getQuery().clone():new U.Query),this.parent.trigger(Pi,a.state),a.deffered.promise.then(function(e){l.dataSource=new U.DataManager(e)})),this.actObj=l,this.actObj.appendTo(this.instance),n&&this.parent.filterModule.filterModule.afterRenderFilterUI()},Lp.prototype.write=function(e){var t=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||q.isNullOrUndefined(e.filteredValue)||Array.isArray(e.filteredValue)||(i.value=e.filteredValue)},Lp.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,q.Browser.isDevice&&(r.hidePopup(),r.focusOut()),!q.isNullOrUndefined(s)&&""!==s||(s=null)),n.filterByColumn(t.field,i,s,"and",this.parent.filterSettings.enableCaseSensitivity)},Lp.prototype.getAutoCompleteInstance=function(e){return document.querySelector("#strui-"+e).ej2_instances[0]},Lp.prototype.getMultiSelectInstance=function(e){return document.querySelector("#multiselectstrui-"+e).ej2_instances[0]},Lp.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(q.extend({dataSource:i instanceof U.DataManager?i:new U.DataManager(i),fields:{text:t,value:t},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:(new U.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(Is,this.dropdownOpen),this.multiSelectObj.addEventListener(p,this.dropdownComplete),this.multiSelectObj.appendTo(this.multiSelectCheckBoxInstance)},Lp.prototype.openPopup=function(e){Ph(e,this.dialogObj)},Lp.prototype.focus=function(e,t){return function(){e.filterType=t.getOptrInstance.getFlOperator()}},Lp.prototype.actionComplete=function(n){return function(e){e.result=e.result.filter(function(e,t,i){return i.map(function(e){return q.getValue(n.fields.value,e)}).indexOf(q.getValue(n.fields.value,e))===t})}},Lp.prototype.actionCompleteMultiCheckBox=function(t){return function(e){e.result=U.DataUtil.distinct(e.result,t,!0)}},Lp.prototype.destroy=function(){this.parent.off(Ei,this.destroy),this.parent.off(s,this.destroy),this.actObj&&!this.actObj.isDestroyed&&(this.actObj.removeEventListener(Rs,this.acFocus),this.actObj.removeEventListener(Is,this.acOpen),this.actObj.removeEventListener(p,this.acComplete),this.actObj.destroy()),this.multiSelectObj&&!this.multiSelectObj.isDestroyed&&(this.multiSelectObj.removeEventListener(Is,this.dropdownOpen),this.multiSelectObj.removeEventListener(p,this.dropdownComplete),this.multiSelectObj.destroy())};var Mp=Lp;function Lp(e,t,i){P.MultiSelect.Inject(P.CheckBoxSelection),this.parent=e,this.serLocator=t,this.filterSettings=i,this.parent&&(this.parent.on(Ei,this.destroy,this),this.parent.on(s,this.destroy,this))}Np.prototype.keyEventHandler=function(e){13!==e.keyCode&&9!==e.keyCode||((e=document.createEvent("HTMLEvents")).initEvent("change",!1,!0),this.dispatchEvent(e))},Np.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),Nh(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,e.getOptrInstance.dropOptr.previousValue)},Np.prototype.write=function(e){var t=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))},Np.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)},Np.prototype.createNumericTextBox=function(e){this.numericTxtObj=new L.NumericTextBox(q.extend({format:("string"==typeof e.column.format||q.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)},Np.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(q.extend({dataSource:i instanceof U.DataManager?i:new U.DataManager(i),fields:{text:t,value:t},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:(new U.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(Is,this.dropdownOpen),this.multiSelectObj.addEventListener(p,this.dropdownComplete),this.multiSelectObj.appendTo(this.multiSelectCheckBoxInstance)},Np.prototype.getNumericInstance=function(e){return document.querySelector("#numberui-"+e).ej2_instances[0]},Np.prototype.getMultiSelectInstance=function(e){return document.querySelector("#multiselectnumberui-"+e).ej2_instances[0]},Np.prototype.openPopup=function(e){Ph(e,this.dialogObj)},Np.prototype.actionComplete=function(t){return function(e){e.result=U.DataUtil.distinct(e.result,t,!0)}},Np.prototype.destroy=function(){this.parent.off(Ei,this.destroy),this.parent.off(s,this.destroy),this.numericTxtObj&&!this.numericTxtObj.isDestroyed&&this.numericTxtObj.destroy(),this.multiSelectObj&&!this.multiSelectObj.isDestroyed&&(this.multiSelectObj.removeEventListener(Is,this.dropdownOpen),this.multiSelectObj.removeEventListener(p,this.dropdownComplete),this.multiSelectObj.destroy())};var Pp=Np;function Np(e,t,i){P.MultiSelect.Inject(P.CheckBoxSelection),this.filterSettings=i,this.parent=e,this.serviceLocator=t,this.parent&&(this.parent.on(Ei,this.destroy,this),this.parent.on(s,this.destroy,this))}zp.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.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),Nh(e.getOptrInstance.dropOptr.value,e.column.uid,e.column,e.column.type,e.dialogObj,e.getOptrInstance.dropOptr.previousValue)},zp.prototype.write=function(e){var t=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:[]:q.isNullOrUndefined(e.filteredValue)||Array.isArray(e.filteredValue)||(i.value=e.filteredValue)},zp.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))},zp.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;this.dialogObj=r.dialogObj,this.dropInstance=new P.DropDownList(q.extend({dataSource:t instanceof U.DataManager?t:new U.DataManager(t),query:(new U.Query).select(e),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(Is,this.dropdownOpen),this.dropInstance.addEventListener(p,this.dropdownComplete),t&&"result"in t&&(e=cd({requestType:"booleanfilterrequest"},this.parent.getQuery?this.parent.getQuery().clone():new U.Query),this.parent.trigger(Pi,e.state),e.deffered.promise.then(function(e){s.dropInstance.dataSource=new U.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)},zp.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.multiSelectCheckBoxInstance=new P.MultiSelect(q.extend({dataSource:i instanceof U.DataManager?i:new U.DataManager(i),fields:{text:t,value:t},mode:"CheckBox",showDropDownIcon:!0,popupHeight:"300px",showSelectAll:!0,query:(new U.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.multiSelectDropdownOpen=this.openPopup.bind(this),this.multiSelectDropdownComplete=this.actionComplete(t),this.multiSelectCheckBoxInstance.addEventListener(Is,this.multiSelectDropdownOpen),this.multiSelectCheckBoxInstance.addEventListener(p,this.multiSelectDropdownComplete),this.multiSelectCheckBoxInstance.appendTo(this.multiSelectElement)},zp.prototype.getBooleanInstance=function(e){return document.querySelector("#bool-ui-"+e).ej2_instances[0]},zp.prototype.getMultiSelectInstance=function(e){return document.querySelector("#multiselectbool-ui-"+e).ej2_instances[0]},zp.prototype.openPopup=function(e){Ph(e,this.dialogObj)},zp.prototype.actionComplete=function(t){return function(e){e.result=U.DataUtil.distinct(e.result,t,!0)}},zp.prototype.destroy=function(){this.parent.off(Ei,this.destroy),this.parent.off(s,this.destroy),this.dropInstance&&!this.dropInstance.isDestroyed&&(this.dropInstance.removeEventListener(Is,this.dropdownOpen),this.dropInstance.removeEventListener(p,this.dropdownComplete),this.dropInstance.destroy()),this.multiSelectCheckBoxInstance&&!this.multiSelectCheckBoxInstance.isDestroyed&&(this.multiSelectCheckBoxInstance.removeEventListener(Is,this.multiSelectDropdownOpen),this.multiSelectCheckBoxInstance.removeEventListener(p,this.multiSelectDropdownComplete),this.multiSelectCheckBoxInstance.destroy())};var Bp=zp;function zp(e,t,i){P.MultiSelect.Inject(P.CheckBoxSelection),this.parent=e,this.serviceLocator=t,this.filterSettings=i,this.parent&&(this.parent.on(Ei,this.destroy,this),this.parent.on(s,this.destroy,this))}Up.prototype.create=function(e){var t=Qh(e.column.format,e.column.type);this.dialogObj=e.dialogObj,this.inputElem=this.parent.createElement("input",{className:"e-flmenu-input",id:"dateui-"+e.column.uid}),e.target.appendChild(this.inputElem),"date"===e.column.type||"dateonly"===e.column.type?this.datePickerObj=new B.DatePicker(q.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 B.DateTimePicker(q.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(Is,this.dpOpen),this.datePickerObj.appendTo(this.inputElem)},Up.prototype.write=function(e){document.querySelector("#dateui-"+e.column.uid).ej2_instances[0].value=q.isNullOrUndefined(e.filteredValue)?null:new Date(e.filteredValue)},Up.prototype.read=function(e,t,i,n){var r=document.querySelector("#dateui-"+t.uid).ej2_instances[0].value,r=q.isNullOrUndefined(r)?null:r;n.filterByColumn(t.field,i,r,"and",!0)},Up.prototype.openPopup=function(e){e.popup.element.style.zIndex=(this.dialogObj.zIndex+1).toString()},Up.prototype.destroy=function(){this.parent.off(Ei,this.destroy),this.parent.off(s,this.destroy),q.isNullOrUndefined(this.datePickerObj)||this.datePickerObj.isDestroyed||(this.datePickerObj.removeEventListener(Is,this.dpOpen),this.datePickerObj.destroy())};var qp=Up;function Up(e,t,i){this.dpOpen=this.openPopup.bind(this),this.parent=e,this.locator=t,this.fltrSettings=i,this.parent&&(this.parent.on(Ei,this.destroy,this),this.parent.on(s,this.destroy,this))}jp.prototype.clearCustomFilter=function(e){this.clearBtnClick(e)},jp.prototype.applyCustomFilter=function(e){this.filterBtnClick(e.col)},jp.prototype.openDialog=function(e){this.options=e,this.col=this.parent.getColumnByField(e.field),(q.isNullOrUndefined(this.col.filter)||q.isNullOrUndefined(this.col.filter.type)||"Menu"===this.col.filter.type)&&this.renderDlgContent(e.target,this.col)},jp.prototype.closeDialog=function(e){var t=this;if(this.dlgObj){var i=document.getElementById(this.dlgObj.element.id);if(this.dlgObj&&!this.dlgObj.isDestroyed&&i){e={cancel:!1,column:this.col,target:e,element:i};if(e.cancel)return void(this.parent.isColumnMenuFilterClosing=!1);this.parent.notify(Ei,e),this.isDialogOpen=!1,this.isMenuCheck&&(this.menuFilterBase.unWireEvents(),this.parent.off(an,this.actionComplete),this.isMenuCheck=!1);var e=this.col;q.isNullOrUndefined(e.filter)||q.isNullOrUndefined(e.filter.ui)||q.isNullOrUndefined(e.filter.ui.destroy)||(e="string"==typeof(e=e.filter.ui.destroy)?q.getValue(e,window):e)(),(this.parent.isReact||this.parent.isVue)&&this.col.filterTemplate&&this.col.filterTemplate instanceof Function?this.parent.clearTemplate(["filterTemplate"],void 0,function(){t.dlgObj.destroy()}):(this.dlgObj.destroy(),q.remove(i)),this.parent.showColumnChooser||(e=document.getElementById(this.parent.element.id+"_e-popup"),q.isNullOrUndefined(e))||(q.remove(e),e=null),q.isNullOrUndefined(this.dlgObj.storeActiveElement)||this.dlgObj.storeActiveElement.focus()}this.parent.notify(nr,{})}},jp.prototype.renderDlgContent=function(e,t){var i={requestType:nt,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.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:!q.isNullOrUndefined(x(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)},jp.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=[{}])},jp.prototype.dialogCreated=function(e,t){!q.Browser.isDevice&&e?Lh(e,this.dlgObj,this.parent):this.options.isResponsiveFilter||(this.dlgObj.position={X:"center",Y:"center"}),this.currentDialogCreatedColumn=t,this.renderFilterUI(e,t),t.isForeignColumn()&&(q.isNullOrUndefined(t.filter)||q.isNullOrUndefined(t.filter.ui)||q.isNullOrUndefined(t.filter.ui.create))||q.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;q.isNullOrUndefined(t.filterTemplate)||e||i?q.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"))},jp.prototype.afterRenderFilterUI=function(){var e=this.currentDialogCreatedColumn,t=(e.showColumnMenu&&this.parent.notify(Di,{}),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.parent.getContent().firstElementChild.offsetHeight<this.dlgObj.element.offsetHeight&&!x(this.parent.element,"e-gantt-dialog")&&bd(this.parent,this.dlgObj),this.flMuiObj.getFlOperator()),i=this.dlgObj.element.querySelector(".e-flmenu-valuediv").querySelector("input"),t=("isempty"===t||"isnotempty"===t||"isnull"===t||"isnotnull"===t?q.isNullOrUndefined(i.ej2_instances)?i.setAttribute("disabled","true"):i.ej2_instances[0].enabled=!1:q.isNullOrUndefined(i&&i.getAttribute("disabled"))||(q.isNullOrUndefined(i.ej2_instances)?i.removeAttribute("disabled"):i.ej2_instances[0].enabled=!0),e.filterTemplate||this.writeMethod(e,this.dlgObj.element.querySelector("#"+e.uid+"-flmenu")),{requestType:it,columnName:e.field,columnType:e.type});(t.filterModel=this).isDialogOpen=!0,this.isMenuCheck||this.parent.trigger(p,t)},jp.prototype.renderFilterUI=function(e,t){var i=this.dlgObj.element.querySelector(".e-flmenu-maindiv");this.parent.log("column_type_missing",{column:t}),this.renderOperatorUI(i,e,t),this.renderFlValueUI(i,e,t)},jp.prototype.renderOperatorUI=function(e,t,i){this.flMuiObj.renderOperatorUI(e,t,i,this.dlgObj,this.filterObj.menuOperator)},jp.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),q.isNullOrUndefined(i.type)||(e=new this.colTypes[i.type](this.parent,this.serviceLocator,this.parent.filterSettings),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()):fh(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(an,this.actionComplete,this),this.menuFilterBase.getAllData())):q.isNullOrUndefined(i.filter)||q.isNullOrUndefined(i.filter.ui)||q.isNullOrUndefined(i.filter.ui.create)?e.create({column:i,target:o,getOptrInstance:this.flMuiObj,localizeText:this.l10n,dialogObj:this.dlgObj}):(a="string"==typeof(a=i.filter.ui.create)?q.getValue(a,window):a)({column:i,target:o,getOptrInstance:this.flMuiObj,dialogObj:this.dlgObj}))},jp.prototype.writeMethod=function(e,t){for(var i,t=t.querySelector(".e-flmenu-valinput"),n=new this.colTypes[e.type](this.parent,this.serviceLocator,this.parent.filterSettings),r=0,s=this.filterSettings.columns;r<s.length;r++){var o=s[r];e.uid===o.uid&&(i=o.value)}q.isNullOrUndefined(e.filter)||q.isNullOrUndefined(e.filter.ui)||q.isNullOrUndefined(e.filter.ui.write)?n.write({column:e,target:t,parent:this.parent,filteredValue:i}):(n="string"==typeof(n=e.filter.ui.write)?q.getValue(n,window):n)({column:e,target:t,parent:this.parent,filteredValue:i})},jp.prototype.filterBtnClick=function(e){var t,i,n,r=this.dlgObj.element.querySelector(".e-flmenu-valuediv input"),s=this.flMuiObj.getFlOperator(),o=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:q.isNullOrUndefined(t.children[0].ej2_instances)?(n=t.querySelector(".e-control"),q.isNullOrUndefined(n)||(i="boolean"===e.type?n.checked:(q.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)):q.isNullOrUndefined(e.filter)||q.isNullOrUndefined(e.filter.ui)||q.isNullOrUndefined(e.filter.ui.read)?o.read(r,e,s,this.filterObj):(n="string"==typeof(n=e.filter.ui.read)?q.getValue(n,window):n)({element:r,column:e,operator:s,fltrObj:this.filterObj}),this.closeDialog(),this.parent.showColumnMenu&&this.parent.notify(kr,{})},jp.prototype.closeResponsiveDialog=function(){this.closeDialog()},jp.prototype.clearBtnClick=function(e){this.filterObj.removeFilteredColsByField(e.field),this.closeDialog(),this.parent.showColumnMenu&&this.parent.notify(kr,{})},jp.prototype.destroy=function(){this.closeDialog()},jp.prototype.getFilterUIInfo=function(){return{field:this.col.field,operator:this.flMuiObj.getFlOperator()}},jp.prototype.getOperatorDropdown=function(){return this.flMuiObj.dropOptr},jp.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},jp.prototype.actionComplete=function(e){this.isMenuCheck&&this.parent.trigger(p,e)};var Hp=jp;function jp(e,t,i,n,r){this.isDialogOpen=!1,this.maxHeight="350px",this.isMenuCheck=!1,this.colTypes={string:Mp,number:Pp,date:qp,dateonly:qp,boolean:Bp,datetime:qp},this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.customFilterOperators=n,this.filterObj=r,this.flMuiObj=new Ap(this.parent,this.customFilterOperators,this.serviceLocator),this.l10n=this.serviceLocator.getService("localization"),this.menuFilterBase=new ap(e)}Gp.prototype.destroy=function(){this.removeEventListener(),this.checkBoxBase.closeDialog()},Gp.prototype.openDialog=function(e){this.checkBoxBase.openDialog(e),this.parent.log("column_type_missing",{column:e.column})},Gp.prototype.closeDialog=function(){this.destroy(),this.isresetFocus&&this.parent.notify(cn,{})},Gp.prototype.closeResponsiveDialog=function(){this.checkBoxBase.closeDialog()},Gp.prototype.getModuleName=function(){return"checkboxFilter"},Gp.prototype.actionBegin=function(e){this.parent.trigger(y,e)},Gp.prototype.actionComplete=function(e){this.parent.trigger(p,e)},Gp.prototype.actionPrevent=function(e){Oh(this.parent)&&(this.parent.notify(ni,e),e.cancel=!0)},Gp.prototype.clearCustomFilter=function(e){this.checkBoxBase.clearFilter(e)},Gp.prototype.applyCustomFilter=function(){this.checkBoxBase.fltrBtnHandler(),this.checkBoxBase.closeDialog()},Gp.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(on,this.actionBegin,this),this.parent.on(an,this.actionComplete,this),this.parent.on(ln,this.actionPrevent,this))},Gp.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(on,this.actionBegin),this.parent.off(an,this.actionComplete),this.parent.off(ln,this.actionPrevent))};var Vp=Gp;function Gp(e,t,i){this.parent=e,this.isresetFocus=!0,this.checkBoxBase=new ap(e),this.addEventListener()}_p=function(e,t){return(_p=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}_p(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Qp,Kp=Vp),Qp.prototype.destroy=function(){this.excelFilterBase.closeDialog()},Qp.prototype.openDialog=function(e){this.excelFilterBase.openDialog(e)},Qp.prototype.closeDialog=function(){this.excelFilterBase.closeDialog(),this.isresetFocus&&this.parent.notify(cn,{})},Qp.prototype.clearCustomFilter=function(e){this.excelFilterBase.clearFilter(e)},Qp.prototype.closeResponsiveDialog=function(e){e?this.excelFilterBase.removeDialog():this.closeDialog()},Qp.prototype.applyCustomFilter=function(e){e.isCustomFilter?this.excelFilterBase.filterBtnClick(e.col.field):(this.excelFilterBase.fltrBtnHandler(),this.excelFilterBase.closeDialog())},Qp.prototype.filterByColumn=function(e,t,i,n,r,s,o,a){this.excelFilterBase.filterByColumn(e,t,i,n,r,s,o,a)},Qp.prototype.getFilterUIInfo=function(){return this.excelFilterBase.getFilterUIInfo()},Qp.prototype.getModuleName=function(){return"excelFilter"};var _p,Kp,Wp=Qp;function Qp(e,t,i,n){t=Kp.call(this,e,t,i)||this;return t.parent=e,t.isresetFocus=!0,t.excelFilterBase=new dp(e,n),t}d.prototype.render=function(e){if(!U.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&&q.remove(t),new Ls(this.serviceLocator,N.CellType.Filter,e)),i=(this.serviceLocator.getService("cellRendererFactory").addCellRenderer(N.CellType.Filter,new Op(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"),Dd(r[parseInt(s.toString(),10)],30*s,this.parent.enableRtl,"Left");Td(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(Ci,{case:"filter"})}}},d.prototype.showCustomFilter=function(e){this.responsiveDialogRenderer.isCustomDialog=e,this.responsiveDialogRenderer.showResponsiveDialog(this.column)},d.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action},d.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)},d.prototype.destroy=function(){var e=this.parent.element;if(e&&(e.querySelector("."+ts)||e.querySelector("."+is))){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&&!q.isNullOrUndefined(e.filterBarTemplate.destroy)&&(e="string"==typeof(e=e.filterBarTemplate.destroy)?q.getValue(e,window):e)()})}if(this.element){if(this.element.parentElement){for(i=0;i<this.inputList.length;i++)L.Input.destroy(this.inputList[parseInt(i.toString(),10)],this.inputList[parseInt(i.toString(),10)].element.nextElementSibling),q.remove(this.inputList[parseInt(i.toString(),10)].element);this.inputList=[],q.remove(this.element),this.element=null}e=this.parent.getHeaderContent().querySelector(".e-filterbar");e&&q.remove(e)}}},d.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,N.ResponsiveDialogAction.isFilter)},d.prototype.generateRow=function(){var e=new Xr({});return e.cells=this.generateCells(),e},d.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({},N.CellType.HeaderIndent));(this.parent.detailTemplate||this.parent.childGrid)&&e.push(this.generateCell({},N.CellType.DetailHeader)),this.parent.isRowDragable()&&"Right"!==this.parent.getFrozenMode()&&e.push(this.generateCell({},N.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({},N.CellType.RowDragHIcon)),e},d.prototype.generateCell=function(e,t){e={visible:e.visible,isDataCell:!1,rowId:"",column:e,cellType:t||N.CellType.Filter,attributes:{title:this.l10n.getConstant("FilterbarTitle")}};return new Jr(e)},d.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=U.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||!q.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()||!q.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()},d.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||!q.isNullOrUndefined(this.filterSettings.columns[""+t].value)||(this.filterSettings.columns.splice(t,1),t-=1)},d.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},d.prototype.onActionComplete=function(e){var t=this.isRemove?{requestType:"filtering",type:p}:{currentFilterObject:this.currentFilterObject,currentFilteringColumn:q.isNullOrUndefined(this.column)?void 0:this.column.field,columns:this.filterSettings.columns,requestType:"filtering",type:p};this.parent.trigger(p,q.extend(e,t)),this.isRemove=!1},d.prototype.wireEvents=function(){q.EventHandler.add(this.parent.getHeaderContent(),"keyup",this.keyUpHandlerImmediate,this)},d.prototype.unWireEvents=function(){q.EventHandler.remove(this.parent.getHeaderContent(),"keyup",this.keyUpHandlerImmediate)},d.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&(this.parent.getHeaderTable().classList.add("e-sortfilter"),this.render())},d.prototype.refreshFilterValue=function(){q.isNullOrUndefined(this.parent.modelObserver.boundedEvents)||this.parent.removeEventListener(_e,this.refreshFilterValueFn),"FilterBar"!==this.filterSettings.type&&"Excel"!==this.filterSettings.type||!this.filterSettings.columns.length||this.parent.getCurrentViewRecords().length||this.initialEnd()},d.prototype.initialEnd=function(){if(this.parent.off(ct,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}},d.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(hr,this.setFullScreenDialog,this),this.parent.on(g,this.enableAfterRender,this),this.parent.on(Ct,this.onActionComplete,this),this.parent.on(gt,this.onPropertyChanged,this),this.parent.on(Pt,this.keyUpHandler,this),this.parent.on(Ut,this.columnPositionChanged,this),this.parent.on(yt,this.render,this),this.parent.on(ct,this.initialEnd,this),this.parent.on(Ei,this.filterMenuClose,this),this.parent.on(zr,this.renderResponsiveChangeAction,this),this.docClickHandler=this.clickHandler.bind(this),q.EventHandler.add(document,"click",this.docClickHandler,this),q.EventHandler.add(this.parent.element,"mousedown",this.refreshClearIcon,this),this.parent.on(Ti,this.columnMenuFilter,this),this.parent.on(Nt,this.filterIconClickHandler,this),this.parent.on("persist-data-changed",this.initialEnd,this),this.parent.on(Ln,this.clickHandler,this),this.parent.on(s,this.destroy,this),this.refreshFilterValueFn=this.refreshFilterValue.bind(this),this.parent.addEventListener(_e,this.refreshFilterValueFn))},d.prototype.removeEventListener=function(){q.EventHandler.remove(document,"click",this.docClickHandler),q.EventHandler.remove(this.parent.element,"mousedown",this.refreshClearIcon),this.parent.isDestroyed||(this.parent.off(hr,this.setFullScreenDialog),this.parent.off(g,this.enableAfterRender),this.parent.off(Ct,this.onActionComplete),this.parent.off(gt,this.onPropertyChanged),this.parent.off(Pt,this.keyUpHandler),this.parent.off(Ut,this.columnPositionChanged),this.parent.off(yt,this.render),this.parent.off(Ti,this.columnMenuFilter),this.parent.off(Ei,this.filterMenuClose),this.parent.off(zr,this.renderResponsiveChangeAction),this.parent.off(Nt,this.filterIconClickHandler),this.parent.off(Ln,this.clickHandler),this.parent.off(s,this.destroy))},d.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,L.Input.setValue(null,e,"Never",!0),"Immediate"===this.filterSettings.mode)&&this.removeFilteredColsByField(e.id.slice(0,-14))},d.prototype.filterMenuClose=function(){this.fltrDlgDetails.isOpen=!1},d.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&&q.isNullOrUndefined(this.column.filterBarTemplate)&&q.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']")),q.isNullOrUndefined(this.column.allowFiltering)||this.column.allowFiltering)if(Oh(p))p.notify(ni,{instance:this,handler:this.filterByColumn,arg1:e,arg2:t,arg3:i,arg4:n,arg5:r,arg6:s,arg7:o,arg8:a});else{if(this.predicate=n||(Array.isArray(i)?"or":"and"),this.value=i,this.matchCase=r||!1,this.ignoreAccent=this.ignoreAccent=q.isNullOrUndefined(s)?this.parent.filterSettings.ignoreAccent:s,this.fieldName=e,this.operator=t,""===(i=q.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)}q.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&&!q.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})},d.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)},d.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},d.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={currentFilterObject:this.currentFilterObject,currentFilteringColumn:this.column?this.column.field:void 0,action:"filter",columns:this.filterSettings.columns,requestType:"filtering",type:y,cancel:!1};if(this.contentRefresh&&this.skipUid(e.properties.columns)){if(this.parent.notify(ft,r),r.cancel)return void("CheckBox"!==this.filterSettings.type&&"Excel"!==this.filterSettings.type||this.column&&this.column.filter&&"Menu"===this.column.filter.type?q.isNullOrUndefined(this.prevFilterObject)?this.filterSettings.columns.splice(this.filterSettings.columns.length-1,1):this.filterSettings.columns[this.filterObjIndex]=this.prevFilterObject:(this.filterSettings.columns=this.actualData.length<=1?this.checkboxPrevFilterObject:this.checkboxFilterObject,this.actualPredicate[this.column.field]=this.filterSettings.columns,r=this.parent.getColumnByField(this.column.field),r=this.parent.showColumnMenu&&r.showColumnMenu?".e-columnmenu":".e-icon-filter",r=this.parent.getColumnHeaderByField(this.column.field).querySelector(r),0===this.checkboxPrevFilterObject.length?r.classList.remove("e-filtered"):r.classList.add("e-filtered")));this.updateFilterIcon(),this.refreshFilterSettings(),this.updateFilterMsg(),this.updateFilter()}break;case"showFilterBarStatus":e.properties[""+n]?this.updateFilterMsg():this.parent.allowPaging&&this.parent.updateExternalMessage("");break;case"showFilterBarOperator":case"type":this.parent.refreshHeader(),this.refreshFilterSettings(),"100%"===this.parent.height&&this.parent.scrollModule.refresh()}}},d.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=!q.isNullOrUndefined(i)&&i.toString();q.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]||q.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])}},d.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")},d.prototype.getFilterBarElement=function(e){var t,e="[id='"+e+"_filterBarcell']";return t=e&&!q.isNullOrUndefined(this.element)?this.element.querySelector(e):t},d.prototype.refreshFilter=function(){this.refreshFilterSettings(),this.updateFilterMsg()},d.prototype.clearFiltering=function(e){var t=this,i=dh(this.filterSettings.columns);if(this.isFilterCleared=!0,q.isNullOrUndefined(e))if(Oh(this.parent))this.parent.notify(ni,{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},d.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},d.prototype.checkDateColumnValue=function(e,t){return!(!q.isNullOrUndefined(e)||!q.isNullOrUndefined(t))||(e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():"string"==typeof e&&"string"==typeof t&&e===t)},d.prototype.columnMenuFilter=function(e){this.column=e.col;var t=q.closest(e.target,"#"+e.id);e.isClose&&!t?this.filterModule.closeDialog():t&&this.filterDialogOpen(this.column,e.target)},d.prototype.filterDialogOpen=function(e,t,i,n){this.filterModule&&(this.filterModule.isresetFocus=!1,this.filterModule.closeDialog()),this.setFilterModel(e),this.filterModule.openDialog(this.createOptions(e,t,i,n))},d.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:!q.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()}},d.prototype.removeFilteredColsByField=function(s,o){var a,l=this.filterSettings.columns;if(Oh(this.parent))e={instance:this,handler:this.removeFilteredColsByField,arg1:s,arg2:o},this.parent.notify(ni,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=(q.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(ft,{requestType:"filtering",type:y,currentFilterObject:e,currentFilterColumn:i,action:"clearFilter"}),"break"}}(t))break;this.updateFilterMsg(),this.parent.renderModule.resetPartialRecords()}},d.prototype.getModuleName=function(){return"filter"},d.prototype.keyUpHandlerImmediate=function(e){13!==e.keyCode&&this.keyUpHandler(e)},d.prototype.keyUpHandler=function(e){var t=this.parent,i=e.target;if(i&&q.matches(i,".e-filterbar input")){var n=q.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=q.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||x(e.target,"e-toolbar")||!q.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(cn,{}),this.parent.showColumnMenu||t.notify(cn,{}))},d.prototype.updateCrossIcon=function(e){e.value.length&&e.nextElementSibling.classList.remove("e-hide")},d.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+=" && "),q.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)&&this.parent.scrollModule.refresh(),this.filterStatusMsg=""}}},d.prototype.setFormatForFlColumn=function(e,t){e=this.serviceLocator.getService("valueFormatter").toView(e,t.getFormatter());return q.isNullOrUndefined(e)?e:e.toString()},d.prototype.checkForSkipInput=function(e,t){var i;if("number"===e.type)(U.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},d.prototype.processFilter=function(e){this.stopTimer(),this.startTimer(e)},d.prototype.startTimer=function(e){var t=this;this.timer=window.setInterval(function(){t.onTimerTick()},13===e.keyCode?0:this.filterSettings.immediateModeDelay)},d.prototype.stopTimer=function(){window.clearInterval(this.timer)},d.prototype.onTimerTick=function(){var e,t="[id='"+this.column.field+"_filterBarcell']",i=(i=this.element.querySelector(t))||this.parent.getHeaderContent().querySelector(t);this.cellText[this.column.field]=i.value,this.stopTimer(),q.isNullOrUndefined(this.column.filterBarTemplate)?e=JSON.parse(JSON.stringify(i.value)):("string"==typeof(t=this.column.filterBarTemplate.read)&&(t=q.getValue(t,window)),q.isNullOrUndefined(t)||(this.value=t.call(this,i))),q.isNullOrUndefined(this.value)||""===this.value?this.removeFilteredColsByField(this.column.field):(this.validateFilterValue(this.value),this.filterByMethod=!1,this.filterByColumn(this.column.field,this.operator,this.value,this.predicate,this.filterSettings.enableCaseSensitivity,this.ignoreAccent,this.column.isForeignColumn()),this.filterByMethod=!0,i.value=e,this.updateFilterMsg())},d.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),q.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}},d.prototype.getOperator=function(e){var t=e.charAt(0),i=e.slice(0,2),n=q.extend({"=":this.filterOperators.equal,"!":this.filterOperators.notEqual},U.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))},d.prototype.columnPositionChanged=function(){this.parent.filterSettings.type},d.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")}],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")}],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")}],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")}))},d.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)))},d.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(x(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))},d.prototype.clickHandler=function(e){var t,i,n,r,s;"FilterBar"===this.filterSettings.type&&this.filterSettings.showFilterBarOperator&&(x(e.target,"e-filterbarcell")&&e.target.classList.contains("e-input-group-icon")&&(q.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")&&q.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||(e=(t=e.target).classList.contains("e-day"),i=x(this.parent.element,"e-dialog"),n=!1,r=x(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&&(x(t,"e-excel-ascending")||x(t,"e-excel-descending"))&&this.filterModule.closeDialog(t),x(t,"e-filter-popup"))||t.classList.contains("e-filtermenudiv")||!this.filterModule||x(t,"e-date-overflow")||x(t,"e-popup-wrapper")||q.closest(t,".e-filter-item.e-menu-item")||e||x(t,"e-search-wrapper")&&!s||(n&&!x(t,"e-filter-popup")&&!x(t,"e-popup-flmenu")||!r&&s)&&(this.filterModule.isresetFocus=x(t,"e-grid")&&x(t,"e-grid").id===this.parent.element.id&&!(x(t,"e-search-wrapper")&&s),this.filterModule.closeDialog(t))},d.prototype.filterHandler=function(e){this.actualPredicate[e.field]=e.actualPredicate,this.actualData=Object.keys(this.actualPredicate);var t=new U.DataManager(this.filterSettings.columns),i=(new U.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()},d.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)||Vh(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=Vh(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()},d.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)},d.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")},d.prototype.getFilterUIInfo=function(){return this.filterModule?this.filterModule.getFilterUIInfo():{}},d.prototype.getOperatorName=function(e){return document.getElementById(this.parent.getColumnByField(e).uid).ej2_instances[0].value},d.prototype.renderCheckboxOnFilterMenu=function(){return this.filterModule.renderCheckBoxMenu()};var Xp=d;function d(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:Hp,CheckBox:Vp,Excel:Wp},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.actualPredicate={},this.inputList=[],this.isFilterCleared=!1,this.parent=e,this.filterSettings=t,this.serviceLocator=i,this.addEventListener(),this.setFullScreenDialog()}var Yp={root:"e-rhandler",suppress:"e-rsuppress",icon:"e-ricon",helper:"e-rhelper",header:"th.e-headercell",cursor:"e-rcursor"},Jp=(c.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,q.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)},c.prototype.autoFit=function(){var e=this.parent.getColumns(),t=0,e=e.filter(function(e){return q.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&&q.addClass([this.parent.getHeaderTable(),i],["e-tableborder"])},c.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)"))},c.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=q.closest(h.querySelector('[data-mappinguid="'+i+'"]'),"th").cloneNode(!0),u=this.getCellElementsByColumnIndex(c),e=this.parent.getColumnIndexByField(e),g=((s=q.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,S=null,n=(a.getCurrentViewRecords().length&&(S=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=q.formatUnit(Math.max(i,S,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 v=a.getColumns(),f=0;f<v.length;f++)v[parseInt(f.toString(),10)].visible&&(l+=parseFloat(v[parseInt(f.toString(),10)].width));S=l+p;0<l&&((this.parent.detailTemplate||this.parent.childGrid)&&this.widthService.setColumnWidth(new Q({width:"30px"})),"Auto"===this.parent.resizeSettings.mode&&(S="100%"),h.style.width=q.formatUnit(S),d.style.width=q.formatUnit(S),q.isNullOrUndefined(s)||(s.style.width=q.formatUnit(S))),a.isFrozenGrid()&&a.enableColumnVirtualization&&this.widthService.refreshFrozenScrollbar(),h.offsetWidth<d.parentElement.scrollWidth?(q.isNullOrUndefined(d.querySelector(".e-emptyrow"))?q.addClass([h,d],["e-tableborder"]):(q.addClass([h],["e-tableborder"]),q.removeClass([d],["e-tableborder"])),q.removeClass([a.element],["e-left-shadow","e-right-shadow"])):(q.removeClass([h,d],["e-tableborder"]),a.getVisibleFrozenRightCount()&&q.addClass([a.element],"e-right-shadow")),q.isNullOrUndefined(s)||s.classList.add("e-tableborder")},c.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+ts)||e.querySelector("."+is))&&(this.widthService=null,this.unwireEvents(),this.removeEventListener())},c.prototype.getModuleName=function(){return"resize"},c.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&&!q.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(Ci,{case:"refreshHeight",isModeChg:!0}),this.parent.isFrozenGrid()&&this.refreshResizefrzCols(!0,!0)},c.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();p.className=e.querySelector("tr").className,p.appendChild(t[parseInt((d-1).toString(),10)]),(q.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)},c.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(yt,this.refreshHeight,this),this.parent.on(Nr,this.refreshResizePosition,this),this.parent.on(dt,this.wireEvents,this),this.parent.on(ct,this.autoFit,this),this.parent.on(Gn,this.refreshHeight,this),this.parent.on(s,this.destroy,this))},c.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(yt,this.refreshHeight),this.parent.off(Nr,this.refreshResizePosition),this.parent.off(dt,this.wireEvents),this.parent.off(Gn,this.refreshHeight),this.parent.off(s,this.destroy))},c.prototype.render=function(){this.unwireEvents(),this.wireEvents(),this.setHandlerHeight()},c.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()}},c.prototype.wireEvents=function(){q.EventHandler.add(this.parent.getHeaderContent(),q.Browser.touchStartEvent,this.touchResizeStart,this),q.EventHandler.add(this.parent.getHeaderContent(),Qt,this.callAutoFit,this)},c.prototype.unwireEvents=function(){q.EventHandler.remove(this.parent.getHeaderContent(),q.Browser.touchStartEvent,this.touchResizeStart),q.EventHandler.remove(this.parent.getHeaderContent(),Qt,this.callAutoFit)},c.prototype.getResizeHandlers=function(){return[].slice.call(this.parent.getHeaderTable().getElementsByClassName(Yp.root))},c.prototype.setHandlerHeight=function(){for(var e=[].slice.call(this.parent.getHeaderTable().getElementsByClassName(Yp.suppress)),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].style.height="100%"},c.prototype.callAutoFit=function(e){var t;q.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(Ye,{e:e,column:t}),q.closest(e.target,Yp.header).classList.add("e-resized"))},c.prototype.touchResizeStart=function(e){if(!N.Global.timer)return N.Global.timer=setTimeout(function(){N.Global.timer=null},300),this.resizeStart(e);clearTimeout(N.Global.timer),N.Global.timer=null,this.callAutoFit(e)},c.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(Qe,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()===vs?this.parent.enableRtl?this.minMove=(this.column.minWidth?parseFloat(this.column.minWidth.toString()):0)-parseFloat(q.isNullOrUndefined(this.column.width)?"":this.column.width.toString()):this.minMove=parseFloat(q.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(q.isNullOrUndefined(this.column.width)?"":this.column.width.toString()),this.minMove+=this.pageX}q.EventHandler.add(document,q.Browser.touchEndEvent,this.resizeEnd,this),q.EventHandler.add(this.parent.element,q.Browser.touchMoveEvent,this.resizing,this),q.Browser.isDevice&&!this.helper.classList.contains(Yp.icon)?(this.helper.classList.add(Yp.icon),q.EventHandler.add(document,q.Browser.touchStartEvent,this.removeHelper,this),q.EventHandler.add(this.helper,q.Browser.touchStartEvent,this.resizeStart,this)):this.updateCursor("add")}}},c.prototype.cancelResizeAction=function(e){e&&(q.EventHandler.remove(this.parent.element,q.Browser.touchMoveEvent,this.resizing),q.EventHandler.remove(document,q.Browser.touchEndEvent,this.resizeEnd),this.updateCursor("remove")),q.Browser.isDevice&&!q.isNullOrUndefined(this.helper)&&(q.EventHandler.remove(document,q.Browser.touchStartEvent,this.removeHelper),q.EventHandler.remove(this.helper,q.Browser.touchStartEvent,this.resizeStart)),q.isNullOrUndefined(this.helper)||q.detach(this.helper),this.refresh()},c.prototype.getWidth=function(e,t,i){return t&&e<t?t:i&&i<e?i:e},c.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"},c.prototype.getColData=function(e,t){return{width:parseFloat(q.isNullOrUndefined(this.widthService.getWidth(e))||"auto"===this.widthService.getWidth(e)?"0":this.widthService.getWidth(e).toString())+t,minWidth:e.minWidth?parseFloat(e.minWidth.toString()):null,maxWidth:e.maxWidth?parseFloat(e.maxWidth.toString()):null}},c.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()))}Dd(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;Dd(o,l-(d=1<o.colSpan?this.calculateColspanWidth(t,o,a.index):d)+i,this.parent.enableRtl,"Right")}}},c.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},c.prototype.refreshResizePosition=function(){this.refreshResizefrzCols(!0)},c.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"===Rd(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){Dd(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"===Rd(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)),Dd(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"===Rd(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()},c.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")&&od(i,this.parent)}},c.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){Dd(e,n-l,a.parent.enableRtl,"Left")}),Dd(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){Dd(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){Dd(e,n-l,a.parent.enableRtl,"Left")})}Dd(e,n-l,d.parent.enableRtl,"Left"),d.parent.enableColumnVirtualization&&(t.valueX=n),kd(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&&Id(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){Dd(e,n+l,a.parent.enableRtl,"Right")}),Dd(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&&Id(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){Dd(e,n+l,a.parent.enableRtl,"Right")}),Dd(e,n+l,p.parent.enableRtl,"Right"),p.parent.enableColumnVirtualization&&(t.valueX=n)}}(n)},c.prototype.getParticularCol=function(e){e=(e.classList.contains("e-filterbarcell")?e:e.querySelector("[data-mappinguid]")).getAttribute("data-mappinguid");return this.parent.getColumnByUid(e)},c.prototype.resizing=function(e){var t=this;if(q.Browser.isDevice&&"function"==typeof e.preventDefault&&e.preventDefault(),!q.isNullOrUndefined(this.column)){var i=0,n=(q.isNullOrUndefined(this.column)&&(i=x(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=q.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=this.column.minWidth?parseFloat(this.column.minWidth.toString()):10,this.pageX=n=this.minMove),o!==parseFloat((q.isNullOrUndefined(this.column.width)||"auto"===this.column.width?i:this.column.width).toString())){this.pageX=n,this.column.width=q.formatUnit(o);i={e:e,column:this.column};if(this.parent.trigger(Xe,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&&(e.maxWidth||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}},c.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;(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):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}},c.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=q.formatUnit(h<1?1:h)),n.push(o))}return n},c.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},c.prototype.resizeEnd=function(e){var t,i,n,r,s;this.helper&&!this.parent.isDestroyed&&((t=this.parent).isFrozenGrid()&&this.refreshResizePosition(),q.EventHandler.remove(this.parent.element,q.Browser.touchMoveEvent,this.resizing),q.EventHandler.remove(document,q.Browser.touchEndEvent,this.resizeEnd),q.Browser.isDevice&&(q.EventHandler.remove(document,q.Browser.touchStartEvent,this.removeHelper),q.EventHandler.remove(this.helper,q.Browser.touchStartEvent,this.resizeStart)),this.updateCursor("remove"),q.detach(this.helper),n={e:e,column:this.column},(i=this.parent.getContent().querySelector("."+hs)).scrollHeight>i.clientHeight&&(this.parent.scrollModule.setPadding(),i.style.overflowY="scroll"),N.Global.timer&&this.isDblClk||(this.parent.trigger(Ye,n),q.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(),q.isNullOrUndefined(t.getFooterContent())||(r=t.getFooterContentTable()),i.offsetWidth<(s=t.getContent().scrollWidth)?(q.isNullOrUndefined(n.querySelector(".e-emptyrow"))?s>n.scrollWidth&&q.addClass([i,n],["e-tableborder"]):(q.addClass([i],["e-tableborder"]),q.removeClass([n],["e-tableborder"])),q.removeClass([t.element],["e-left-shadow","e-right-shadow"])):(q.removeClass([i,n],["e-tableborder"]),t.getVisibleFrozenRightCount()&&q.addClass([t.element],"e-right-shadow")),q.isNullOrUndefined(r)||r.classList.add("e-tableborder"),this.refresh(),this.doubleTapEvent(e),this.isDblClk=!0)},c.prototype.getPointX=function(e){return(e.touches&&e.touches.length?e.touches[0]:e).pageX},c.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},c.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)}},c.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},c.prototype.getTargetColumn=function(e){e=q.closest(e.target,Yp.header),e=(e=e.querySelector(".e-headercelldiv")||e.querySelector(".e-stackedheadercelldiv")).getAttribute("data-mappinguid");return this.parent.getColumnByUid(e)},c.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](Yp.cursor)},c.prototype.refresh=function(){this.column=null,this.pageX=null,this.element=null,this.helper=null},c.prototype.appendHelper=function(){this.helper=this.parent.createElement("div",{className:Yp.helper}),this.parent.element.appendChild(this.helper),this.setHelperHeight()},c.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},c.prototype.setHelperHeight=function(){var e=q.closest(this.element,Yp.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")},c.prototype.getScrollBarWidth=function(e){var t=this.parent.getContent().firstChild;return t.scrollHeight>t.clientHeight&&e||t.scrollWidth>t.clientWidth?wh():0},c.prototype.removeHelper=function(e){e=e.target.classList;e.contains(Yp.root)||e.contains(Yp.icon)||!this.helper||(q.EventHandler.remove(document,q.Browser.touchStartEvent,this.removeHelper),q.EventHandler.remove(this.helper,q.Browser.touchStartEvent,this.resizeStart),q.detach(this.helper),this.refresh())},c.prototype.updateHelper=function(){var e=q.closest(this.element,Yp.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"},c.prototype.calcPos=function(e){for(var t={top:0,left:0},i=e.getBoundingClientRect(),n=e.ownerDocument,r=x(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}},c.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))},c.prototype.getUserAgent=function(){var e=q.Browser.userAgent.toLowerCase();return/iphone|ipod|ipad/.test(e)},c.prototype.timeoutHandler=function(){this.tapped=null},c);function c(e){this.tapped=!1,this.isDblClk=!0,this.resizeProcess=!1,this.isCancelAutoFit=!1,this.parent=e,this.parent.isDestroyed||(this.widthService=new sa(e),this.addEventListener())}Zp.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")),i=!i||!i.lockColumn;return(e.parentElement.isEqualNode(t.parentElement)||this.parent.enableColumnVirtualization||this.parent.isFrozenGrid()&&Array.prototype.indexOf.call(q.closest(e,"thead").children,e.parentElement)===Array.prototype.indexOf.call(q.closest(t,"thead").children,t.parentElement))&&-1<this.targetParentContainerIndex(e,t)&&i},Zp.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},Zp.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},Zp.prototype.getColumnsModel=function(e,t){for(var i=[],n=[],r=0,s=e.length;r<s;r++)q.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},Zp.prototype.headerDrop=function(e){var t=this.parent,i=(this.element.querySelector(".e-headercelldiv")||this.element.querySelector(".e-stackedheadercelldiv")).getAttribute("data-mappinguid"),i=t.getColumnByUid(i);if(q.closest(e.target,"th")&&(q.isNullOrUndefined(i)||i.allowReordering&&!i.lockColumn)){var n,r,s,o,e=q.closest(e.target,".e-headercell"),a=(e.querySelector(".e-headercelldiv")||e.querySelector(".e-stackedheadercelldiv")).getAttribute("data-mappinguid");if(!q.isNullOrUndefined(a)){var t=t.getColumnByUid(a);if(q.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)}),q.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(Kn,{ele:e}),t?this.moveColumns(a,this.parent.getColumnByUid(t)):(e=this.getHeaderCells(),t=lh(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})},Zp.prototype.isActionPrevent=Oh,Zp.prototype.moveColumns=function(e,t,i,n){var r=this.parent;if(this.isActionPrevent(r))r.notify(ni,{instance:this,handler:this.moveColumns,arg1:e,arg2:t});else{var s=this.getColParent(t,this.parent.columns),o=(s||this.parent).columns,a=hh(t,o);if((s||this.parent.lockcolPositionCount)&&!i&&!this.parent.enableColumnVirtualization){for(var l=0;l<o.length;l++)if(o[parseInt(l.toString(),10)].field===t.field){a=l;break}var h=this.parent.getColumnByUid(this.destElement.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"));if(h){for(l=0;l<o.length;l++)if(o[parseInt(l.toString(),10)].field===h.field){e=l;break}}else for(l=0;l<o.length;l++)o[parseInt(l.toString(),10)].headerText===this.destElement.innerText.trim()&&(e=l)}if(r.allowReordering&&a!==e&&-1!==a&&-1!==e){o.splice(e,0,o.splice(a,1)[0]);i={column:t,destIndex:e,columns:o,parent:s,cancel:!1};if(r.notify(_n,i),!i.cancel){if(this.parent.isFrozenGrid())if(this.parent.frozenColumns)for(l=0;l<o.length;l++)"Left"===o[parseInt(l.toString(),10)].freeze&&(o[parseInt(l.toString(),10)].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){i={type:y,requestType:"reorder",fromIndex:e,toIndex:a,toColumnUid:t.uid,cancel:!1};if(r.notify(ft,i),i.cancel)return void o.splice(a,0,o.splice(e,1)[0])}r.getColumns(!0),r.preventAutoFit=!0,r.notify(Ut,{fromIndex:e,toIndex:a}),this.parent.isFrozenGrid()&&(s=this.parent.columns,this.idx=0,this.refreshColumnIndex(s),this.parent.notify(Pr,{}))}}}},Zp.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)},Zp.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=this.getColParent(r[lh(e,n)],i),i=s?s.columns:i;return hh(r[lh(t,n)],i)},Zp.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},Zp.prototype.getHeaderCells=function(){return[].slice.call(this.parent.element.getElementsByClassName("e-headercell"))},Zp.prototype.getColParent=function(e,t){var i=[];return this.findColParent(e,t,i),i[i.length-1]},Zp.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);(q.isNullOrUndefined(n)||n.allowReordering&&!n.lockColumn)&&(q.isNullOrUndefined(r)||r.allowReordering&&!r.lockColumn)?-1<(e=hh(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})},Zp.prototype.reorderMultipleColumns=function(e,t){var i=this.parent.getColumnIndexByField(t),t=this.parent.getColumnByField(t);if(!(i<0)&&(q.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(!q.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=hh(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++}}},Zp.prototype.moveTargetColumn=function(e,t){-1<t&&this.moveColumns(t,e,!0)},Zp.prototype.reorderSingleColumnByTarget=function(e,t){this.moveTargetColumn(this.parent.getColumnByField(e),t)},Zp.prototype.reorderMultipleColumnByTarget=function(e,t){for(var i=0;i<e.length;i++)this.reorderSingleColumnByTarget(e[parseInt(i.toString(),10)],t)},Zp.prototype.reorderColumns=function(e,t){"string"==typeof e?(this.reorderSingleColumn(e,t),this.fromCol=e):(this.reorderMultipleColumns(e,t),this.fromCol=e[0])},Zp.prototype.reorderColumnByModel=function(e,t){!q.isNullOrUndefined(e)&&!q.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)))},Zp.prototype.reorderColumnByIndex=function(e,t){this.moveTargetColumn(this.parent.getColumnByIndex(e),t)},Zp.prototype.reorderColumnByTargetIndex=function(e,t){"string"==typeof e?this.reorderSingleColumnByTarget(e,t):this.reorderMultipleColumnByTarget(e,t)},Zp.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.createReorderElement()},Zp.prototype.createReorderElement=function(e){e&&e.args&&e.args.isXaxis&&this.setDisplay("none");var e=this.parent.element.querySelector("."+rs),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)},Zp.prototype.onActionComplete=function(e){this.parent.preventAutoFit=!1,this.parent.trigger(p,q.extend(e,{type:p}));e=this.fromCol&&this.parent.getColumnHeaderByField(this.fromCol);e&&this.parent.focusModule.onClick({target:e},!0)},Zp.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+ts)||e.querySelector("."+is))&&(this.upArrow.parentNode&&q.remove(this.upArrow),this.downArrow.parentNode&&q.remove(this.downArrow),this.parent.off(Gt,this.headerDrop),this.parent.off(g,this.enableAfterRender),this.parent.off(bt,this.onActionComplete),this.parent.off(we,this.drag),this.parent.off(Ce,this.dragStart),this.parent.off(Vt,this.dragStop),this.parent.off(yt,this.createReorderElement),this.parent.off(Pt,this.keyPressHandler),this.parent.off(s,this.destroy))},Zp.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)}},Zp.prototype.drag=function(e){var t,i=this.parent,n=e.target,r=q.closest(n,".e-headercell:not(.e-stackedHeaderCell)"),s=i.element.querySelector(".e-cloneproperties"),o=i.getContent().firstElementChild,o=this.x>ch(e.event).x+o.scrollLeft;q.removeClass([].slice.call(i.getHeaderTable().getElementsByClassName("e-reorderindicate")),["e-reorderindicate"]),this.setDisplay("none"),this.stopTimer(),q.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),q.classList(n,["e-allowDrop","e-reorderindicate"],[])):i.allowGrouping&&x(e.target,"e-groupdroparea")||q.classList(s,["e-notallowedcur"],["e-defaultcur"])):(!r||!r.isEqualNode(this.element)||i.allowGrouping&&e.column.allowGrouping||e.column.allowReordering)&&(r||i.allowGrouping&&x(e.target,"e-groupdroparea"))||q.classList(s,["e-notallowedcur"],["e-defaultcur"]),e.column.allowReordering&&!e.column.lockColumn&&i.trigger(we,{target:n,draggableType:"headercell",column:e.column})},Zp.prototype.updateScrollPostion=function(e){var t=this,e=ch(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))},Zp.prototype.setScrollLeft=function(e,t){var i=e.scrollLeft;e.scrollLeft=e.scrollLeft+(t?-5:5),i!==e.scrollLeft&&this.setDisplay("none")},Zp.prototype.stopTimer=function(){window.clearInterval(this.timer)},Zp.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(""))},Zp.prototype.dragStart=function(e){var t,i=this.parent,n=e.target;this.element=n.classList.contains("e-headercell")?n:x(n,"e-headercell"),e.column.allowReordering&&!e.column.lockColumn&&(t=i.getContent().firstElementChild,this.x=ch(e.event).x+t.scrollLeft,i.trigger(Ce,{target:n,draggableType:"headercell",column:e.column}))},Zp.prototype.dragStop=function(e){var t=this.parent;this.setDisplay("none"),this.stopTimer(),e.cancel||t.trigger(be,{target:e.target,draggableType:"headercell",column:e.column}),q.removeClass([].slice.call(t.getHeaderTable().getElementsByClassName("e-reorderindicate")),["e-reorderindicate"])},Zp.prototype.setDisplay=function(e){this.upArrow.style.display=e,this.downArrow.style.display=e},Zp.prototype.getModuleName=function(){return"reorder"};xa=Zp;function Zp(e){this.idx=0,this.parent=e,this.parent.isDestroyed||(this.parent.on(Gt,this.headerDrop,this),this.parent.on(g,this.enableAfterRender,this),this.parent.on(bt,this.onActionComplete,this),this.parent.on(we,this.drag,this),this.parent.on(Ce,this.dragStart,this),this.parent.on(Vt,this.dragStop,this),this.parent.on(Gt,this.headerDrop,this),this.parent.on(yt,this.createReorderElement,this),this.parent.on(Pt,this.keyPressHandler,this),this.parent.on(s,this.destroy,this))}$p.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},$p.prototype.isNewRowAdded=function(){return this.parent.editSettings&&this.parent.editSettings.showAddNewRow&&!(this.parent.enableInfiniteScrolling||this.parent.enableVirtualization)},$p.prototype.groupRowDDIndicator=function(e,t){Fh([e[0]],t,"e-dragleft"),Fh(e,t,"e-dragtop","e-dragbottom"),Fh([e[e.length-1]],t,"e-dragright")},$p.prototype.refreshRow=function(e,t,i){for(var n=this.parent,r=n.getContentTable().querySelector(H),s=n.getHeaderTable().querySelector(H),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")),q.isNullOrUndefined(d)||q.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(I));if(n.allowGrouping&&n.groupSettings.columns.length?n.groupSettings.enableLazyLoading||n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache&&p.length>3*n.pageSettings.pageSize?n.refresh():(yd(this.parent,e,p),n.enableVirtualization||n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache?md(n):fd(this.parent,n.getRowsObject().filter(function(e){return e.isDataRow}),p),this.parent.notify(dr,{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():(yd(this.parent,e,p),md(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)])},$p.prototype.updateFrozenRowreOrder=function(e){for(var t=this.parent,i=t.getContentTable().querySelector(H),n=t.getHeaderTable().querySelector(H),r=[].slice.call(n.getElementsByClassName(I)).concat([].slice.call(i.getElementsByClassName(I))),s=t.createElement(H,{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)},$p.prototype.refreshRowTarget=function(e){var t=this.parent,i=parseInt(e.target.parentElement.getAttribute(T),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},$p.prototype.updateFrozenColumnreOrder=function(e){var t=this.parent,i=t.getContentTable().querySelector(H),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)},$p.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(T),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)]);fd(this.parent,n,e,this.parent.pinnedTopRowModels.length),this.parent.selectionModule.setPinnedSelectionIndexes()},$p.prototype.rowOrder=function(e){if(e.dropIndex!==e.fromIndex&&!isNaN(e.dropIndex)&&!x(e.target,"e-groupcaption")){if(this.parent.isDetail()){this.parent.detailCollapseAll();var t=[].slice.call(this.parent.getContentTable().querySelector(H).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")&&x(e.target,"e-rowcell")&&(e.target=x(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(T),10)-1);this.selectedRowColls=s}}this.selectedRowColls=[]}},$p.prototype.currentViewData=function(){for(var e=this.parent.getSelectedRowIndexes(),t=[],i=parseInt(this.startedRow.getAttribute(T),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},$p.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(ft,{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},$p.prototype.stopTimer=function(){window.clearInterval(this.timer)},$p.prototype.onActionComplete=function(e){this.parent.trigger(p,q.extend(e,{type:p,requestType:"rowdraganddrop"}))},$p.prototype.initializeDrag=function(){var e=this.parent;this.draggable=new q.Draggable(e.element,{dragTarget:".e-rowcelldrag, .e-rowdragdrop, .e-rowcell",distance:5,helper:this.helper,dragStart:this.dragStart,drag:this.drag,dragStop:this.dragStop,isReplaceDragEle:this.isReplaceDragEle,isPreventSelect:!1,isPreventScroll:!0})},$p.prototype.updateScrollPostion=function(e){var t,i,n=this,e=ch(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))},$p.prototype.setScrollDown=function(e,t){e.scrollTop=e.scrollTop+t},$p.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")),q.closest(e.target,"tr"));x(r,"e-grid")&&(!this.parent.rowDropSettings.targetID&&x(n.parentElement,"e-grid").id===x(r,"e-grid").id||this.istargetGrid)&&this.setBorder(r||t,e.event,t,i)},$p.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)),x(e,"e-grid")&&e.classList.contains(I)&&(!this.parent.rowDropSettings.targetID&&x(o.parentElement,"e-grid").id===x(e,"e-grid").id||this.istargetGrid)&&(this.parent.allowGrouping&&this.parent.groupSettings.columns&&this.parent.groupSettings.columns.length?q.removeClass(s.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"),["e-dragtop","e-dragright","e-dragbottom","e-dragleft"]):q.removeClass(s.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse"),["e-dragborder"]),o=[],r=parseInt(n.getAttribute(T),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(T),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):Fh(o,!0,"e-dragborder"))},$p.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?Aa.getScrollBarWidth():0},$p.prototype.removeFirstRowBorder=function(e){0<this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder").length&&e&&(0!==e.rowIndex||e.classList.contains("e-columnheader"))?q.remove(this.isDropGrid.element.getElementsByClassName("e-firstrow-dragborder")[0]):(e=this.parent.element.querySelector(".e-row.e-addedrow tr"))&&e.querySelector(".e-dragborder")&&Fh([].slice.call(e.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse,.e-dragindentcell")),!1,"e-dragborder")},$p.prototype.removeLastRowBorder=function(e){var t;t=this.parent.enableVirtualization?e&&parseInt(e.getAttribute(T),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&&q.remove(this.parent.element.getElementsByClassName("e-lastrow-dragborder")[0])},$p.prototype.removeBorder=function(e){this.removeFirstRowBorder(e),this.parent.rowDropSettings.targetID||this.removeLastRowBorder(e),(e=(this.parent.allowGrouping&&this.parent.groupSettings.columns.length?[].slice.call(this.isDropGrid.getContentTable().querySelectorAll("tr")).filter(function(e){return e.querySelector("td.e-dragtop.e-dragbottom")}):this.isDropGrid.getRows().filter(function(e){return e.querySelector("td.e-dragborder")}))[0])&&(e=this.parent.allowGrouping&&this.parent.groupSettings.columns.length?[].slice.call(e.querySelectorAll(".e-dragtop.e-dragbottom")):[].slice.call(e.getElementsByClassName("e-dragborder")),this.parent.allowGrouping&&this.parent.groupSettings.columns&&this.parent.groupSettings.columns.length?this.groupRowDDIndicator(e,!1):Fh(e,!1,"e-dragborder"))},$p.prototype.getElementFromPosition=function(e,t){t=ch(t),e.style.display="none",t=document.elementFromPoint(t.x,t.y);return e.style.display="",t},$p.prototype.onDataBound=function(){0<this.selectedRowColls.length&&(this.parent.enableVirtualization||this.parent.allowRowDragAndDrop)&&(this.parent.selectRows(this.selectedRowColls),this.selectedRowColls=[])},$p.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute(T),10)-1:0},$p.prototype.singleRowDrop=function(e){var t=q.closest(e.target,"tr"),e=e.droppedElement.parentElement.ej2_instances[0],t=t?t.rowIndex:e.currentViewData.length-1;this.reorderRow(this.startedRowIndex,t)},$p.prototype.columnDrop=function(e){var t=this.parent;if("grouping"!==e.droppedElement.getAttribute("action")&&(x(e.target,I)||x(e.target,"e-emptyrow")||x(e.target,is))){var i=q.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],q.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(T),10)),isNaN(i)&&(i=0),t.allowPaging&&(i=i+t.pageSettings.currentPage*t.pageSettings.pageSize-t.pageSettings.pageSize),t.notify(Ht,{toIndex:i,records:r}),t.notify(ft,{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(jt,{indexes:this.selectedRows,records:r}),n.dataSource instanceof U.DataManager&&n.dataSource.dataSource.offline&&n.notify(ft,{type:y,requestType:"rowdraganddrop"})}}}},$p.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(Qi,{fromIndex:e+i,toIndex:t}))},$p.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.initializeDrag()},$p.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+ts)||e.querySelector("."+is))&&(this.draggable.destroy(),this.parent.off(dt,this.initializeDrag),this.parent.off(be,this.columnDrop),this.parent.off(It,this.onActionComplete),this.parent.removeEventListener(ae,this.onDataBoundFn),this.parent.off(g,this.enableAfterRender),this.parent.off(s,this.destroy))},$p.prototype.getModuleName=function(){return"rowDragAndDrop"},$p.prototype.processArgs=function(e){var t=this.parent,i=parseInt(this.startedRow.getAttribute(T),10)-1;0<t.getSelectedRecords().length&&!1===this.startedRow.cells[0].classList.contains("e-selectionbackground")||0===t.getSelectedRecords().length?(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}))};Ca=$p;function $p(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=(q.isNullOrUndefined(i)||!t.rowDropSettings.targetID||q.isNullOrUndefined(i.classList)||i.classList.contains("e-rowcell")||(i=x(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(H,{attrs:{role:"rowgroup"}});if(document.getElementsByClassName("e-griddragarea").length||t.rowDropSettings.targetID&&(!q.isNullOrUndefined(i)&&!i.classList.contains("e-selectionbackground")&&"Single"!==t.selectionSettings.type||!x(i,"e-rowcell"))||!t.rowDropSettings.targetID&&!x(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(T),10)-1),d.startedRow=q.closest(i,"tr").cloneNode(!0),d.parent.isFrozenGrid())for(var o=[].slice.call(d.startedRow.querySelectorAll(".e-rowcell")),a=0;a<o.length;a++)q.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(Ie,l);if(l.cancel)return!1;ph(d.startedRow,".e-indentcell"),ph(d.startedRow,".e-detailrowcollapse"),ph(d.startedRow,".e-detailrowexpand"),t.enableInfiniteScrolling&&t.infiniteScrollSettings.enableCache||d.removeCell(d.startedRow,ps);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=q.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&&!q.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(xe,{rows:d.rows,target:e.target,draggableType:"rows",fromIndex:parseInt(d.rows[0].getAttribute(T),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],x(e.target,"e-grid"))&&(d.istargetGrid=d.parent.rowDropSettings.targetID===x(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=(q.classList(r,["e-defaultcur"],["e-notallowedcur","e-movecur","e-grabcur"]),d.isOverflowBorder=!0,d.hoverState=n.enableHover,x(s,"e-grid")?q.closest(e.target,"tr"):null);e.target&&(d.processArgs(s),n.enableVirtualization&&q.isNullOrUndefined(d.rows[0])&&q.classList(r,["e-notallowedcur"],["e-movecur"]),i={rows:d.rows,target:s,draggableType:"rows",data:d.rowData,originalEvent:e,cancel:!1},n.trigger(Re,i),d.stopTimer(),i.cancel||(n.element.classList.add("e-rowdrag"),o&&(x(s,"e-grid").id===r.parentElement.id||x(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"),!x(s,"e-grid")||i&&x(i.parentElement,"e-grid").id===x(s,"e-grid").id||x(r.parentElement,"e-grid").id===x(s,"e-grid").id?q.classList(r,["e-notallowedcur"],["e-defaultcur"]):q.classList(r,["e-grabcur"],["e-notallowedcur"])):(i=x(s,"e-grid"))&&i.id===r.parentElement.id&&x(s,"e-row")&&!x(s,"e-addedrow")?q.classList(r,["e-movecur"],["e-defaultcur"]):q.classList(r,["e-notallowedcur"],["e-movecur"]),x(d.isDropGrid.element,"e-grid")&&(d.isDropGrid.groupSettings.columns.length&&!d.isDropGrid.groupSettings.columns.length||d.isDropGrid.element.querySelector(".e-emptyrow")||(x(s,"e-grid")&&x(s,"e-grid").id===d.isDropGrid.element.id&&d.updateScrollPostion(e.event),(d.isOverflowBorder||d.parent.frozenRows>d.dragTarget)&&(parseInt(d.startedRow.getAttribute(T),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?i=o&&parseInt(o.getAttribute(T),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&&(e.style.zIndex="1"),r.getElementsByClassName("e-lastrow-dragborder").length||n.allowGrouping&&n.groupSettings.columns.length&&!q.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(hs)&&!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):Fh(i,!0,"e-dragborder"))))},this.dragStop=function(e){d.parent.isCheckBoxSelection&&d.parent.enableInfiniteScrolling&&window.getSelection().removeAllRanges(),document.body.classList.remove("e-prevent-select"),Oh(d.parent)?d.parent.notify(ni,{instance:d,handler:d.processDragStop,arg1:e}):d.processDragStop(e)},this.processDragStop=function(t){var e,i,n,r,s=d.parent;d.parent.isDestroyed||(e=d.getElementFromPosition(t.helper,t.event),i=e&&!e.classList.contains("e-dlg-overlay")?e:t.target,s.element.classList.remove("e-rowdrag"),n=document.getElementById(s.rowDropSettings.targetID),s.rowDropSettings.targetID&&n&&n.ej2_instances&&"grid"===n.ej2_instances[0].getModuleName()&&n.ej2_instances[0].getContent().classList.remove("e-allowRowDrop"),x(d.isDropGrid.element,"e-grid")&&(d.stopTimer(),d.isDropGrid.enableHover=d.hoverState,d.isDropGrid.getContent().classList.remove("e-grid-relative"),d.removeBorder(e),n=d.isDropGrid.element.querySelector(".e-dragstartrow"))&&n.classList.remove("e-dragstartrow"),d.processArgs(i),s.enableVirtualization&&q.isNullOrUndefined(d.rows[0]))||(r={target:i,draggableType:"rows",cancel:!1,fromIndex:parseInt(d.rows[0].getAttribute(T),10)-1,dropIndex:d.dragTarget,rows:d.rows,data:0<Object.keys(d.dragStartData[0]).length?d.dragStartData:d.currentViewData()},s.trigger(Te,r,function(){var e;!(x(i,I)||x(i,"e-emptyrow")||x(i,is))||r.cancel||d.parent.pinnedTopRowModels.length&&x(i,rs)?(d.dragTarget=null,q.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(T),10)-1],d.dragTarget),d.dragTarget=null,s.rowDropSettings.targetID||(t.helper.classList.contains("e-cloneproperties")&&document.querySelector("."+t.helper.classList[0])&&q.remove(t.helper),!s.enableVirtualization||s.sortSettings.columns.length||s.filterSettings.columns.length||d.parent.allowGrouping&&s.groupSettings.columns.length?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)})},this.parent=e,this.parent.isDestroyed||(this.parent.on(dt,this.initializeDrag,this),this.parent.on(be,this.columnDrop,this),this.parent.on(It,this.onActionComplete,this),this.onDataBoundFn=this.onDataBound.bind(this),this.parent.addEventListener(ae,this.onDataBoundFn),this.parent.on(g,this.enableAfterRender,this),this.parent.on(s,this.destroy,this))}u.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"))},u.prototype.rearrangeGroup=function(){this.sortRequired=!1,this.updateModel()},u.prototype.columnDrag=function(e){this.groupSettings.allowReordering&&e.column.allowGrouping&&this.animateDropper(e);var t=this.parent.element.querySelector(".e-cloneproperties");this.parent.allowReordering||q.classList(t,["e-defaultcur"],["e-notallowedcur"]),e.column.allowGrouping&&(x(e.target,"e-groupdroparea")||x(e.target,"e-headercell")&&x(e.target,"e-headercell").isEqualNode(this.parent.getColumnHeaderByField(e.column.field)))||this.parent.allowReordering&&x(e.target,"e-headercell")||q.classList(t,["e-notallowedcur"],["e-defaultcur"]),e.target.classList.contains("e-groupdroparea")?this.element.classList.add("e-hover"):this.element.classList.remove("e-hover")},u.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:x(e.target,"e-headercell"),this.aria.setGrabbed(t,!0,!e.column.allowGrouping))},u.prototype.columnDrop=function(e){var t=this.parent;"grouping"===e.droppedElement.getAttribute("action")&&(e=t.getColumnByUid(e.droppedElement.getAttribute("data-mappinguid")),q.isNullOrUndefined(e)||!1===e.allowGrouping||x(t.getColumnHeaderByUid(e.uid),"e-grid").getAttribute("id")!==t.element.getAttribute("id")||this.ungroupColumn(e.field))},u.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(g,this.enableAfterRender,this),this.parent.on(xt,this.onActionComplete,this),this.parent.on(Rt,this.onActionComplete,this),this.parent.on(gt,this.onPropertyChanged,this),this.parent.on(Nt,this.clickHandler,this),this.parent.on(we,this.columnDrag,this),this.parent.on(Ce,this.columnDragStart,this),this.parent.on(Gt,this.columnDrop,this),this.parent.on(be,this.columnDrop,this),this.parent.on(yt,this.refreshSortIcons,this),this.parent.on(vt,this.refreshSortIcons,this),this.parent.on(Pt,this.keyPressHandler,this),this.parent.on(ct,this.initialEnd,this),this.parent.on(ut,this.initialEnd,this),this.parent.on(dt,this.render,this),this.parent.on(Tt,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))},u.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(dt,this.render),this.parent.off(g,this.enableAfterRender),this.parent.off(xt,this.onActionComplete),this.parent.off(Rt,this.onActionComplete),this.parent.off(gt,this.onPropertyChanged),this.parent.off(Nt,this.clickHandler),this.parent.off(we,this.columnDrag),this.parent.off(Ce,this.columnDragStart),this.parent.off(be,this.columnDrop),this.parent.off(Gt,this.columnDrop),this.parent.off(yt,this.refreshSortIcons),this.parent.off(vt,this.refreshSortIcons),this.parent.off(Pt,this.keyPressHandler),this.parent.off(Tt,this.onGroupAggregates),this.parent.off(s,this.destroy),this.parent.off("group-expand-collapse",this.updateExpand))},u.prototype.initialEnd=function(){var e=this.parent;if(this.parent.off(ct,this.initialEnd),this.parent.off(ut,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}},u.prototype.keyPressHandler=function(e){var t=this.parent;if(e.target&&x(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||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(H).children,l=void 0,r=t.getDataRows()[o[o.length-1]].rowIndex;0<=r;r--)if(!a[parseInt(r.toString(),10)].classList.contains(I)&&!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"enter":e.target.classList.contains("e-groupsort")?(this.groupSortFocus=!0,e.preventDefault(),this.applySortFromTarget(e.target)):e.target.classList.contains("e-ungroupbutton")?(this.groupCancelFocus=!0,e.preventDefault(),this.unGroupFromTarget(e.target)):this.parent.isEdit||null!==q.closest(e.target,"#"+this.parent.element.id+"_searchbar")||x(e.target,"e-pager")||x(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))}},u.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},u.prototype.wireEvent=function(){q.EventHandler.add(this.element,"focusin",this.onFocusIn,this),q.EventHandler.add(this.element,"focusout",this.onFocusOut,this),q.EventHandler.add(this.parent.element,"auxclick",this.auxilaryclickHandler,this)},u.prototype.unWireEvent=function(){q.EventHandler.remove(this.element,"focusin",this.onFocusIn),q.EventHandler.remove(this.element,"focusout",this.onFocusOut),q.EventHandler.remove(this.parent.element,"auxclick",this.auxilaryclickHandler)},u.prototype.onFocusIn=function(e){this.parent.focusModule.currentInfo&&this.parent.focusModule.currentInfo.element&&(q.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)},u.prototype.onFocusOut=function(e){this.addOrRemoveFocus(e)},u.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,q.addClass([t],["e-focused","e-focus"]),e.target.tabIndex=0):(q.removeClass([t],["e-focused","e-focus"]),e.target.tabIndex=-1))},u.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=x(e.target,"e-recordplusexpand")||x(e.target,"e-recordpluscollapse");t&&(t.children[0].classList.contains("e-icon-gdownarrow")||t.children[0].classList.contains("e-icon-grightarrow"))&&this.expandCollapseRows(e.target),this.applySortFromTarget(e.target),this.unGroupFromTarget(e.target),this.toogleGroupFromHeader(e.target)},u.prototype.auxilaryclickHandler=function(e){(e.target.classList.contains("e-icon-grightarrow")||e.target.classList.contains("e-icon-gdownarrow")&&1===e.button)&&e.preventDefault()},u.prototype.unGroupFromTarget=function(e){e.classList.contains("e-ungroupbutton")&&this.ungroupColumn(e.parentElement.getAttribute("data-mappingname"))},u.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")))},u.prototype.applySortFromTarget=function(e){var t=this.parent,i=q.closest(e,".e-groupheadercell");t.allowSorting&&i&&!e.classList.contains("e-ungroupbutton")&&!e.classList.contains("e-toggleungroup")&&(e=i.firstElementChild.getAttribute("data-mappingname"),t.getColumnHeaderByField(e).getElementsByClassName("e-ascending").length?t.sortColumn(e,"Descending",!0):t.sortColumn(e,"Ascending",!0))},u.prototype.expandCollapseRows=function(e){var t=x(e,"e-recordplusexpand")||x(e,"e-recordpluscollapse");if(t){var i=[].slice.call(this.parent.getContentTable().querySelector(H).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")?(q.addClass([t],"e-recordplusexpand"),q.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,Kh(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),q.removeClass([t],"e-recordplusexpand"),q.addClass([t],"e-recordpluscollapse"),t.firstElementChild.className="e-icons e-gnextforward e-icon-grightarrow",t.firstElementChild.setAttribute("title",this.l10n.getConstant("Collapsed")),Kh(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),!Kh(r)&&!this.parent.groupSettings.enableLazyLoading){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":q.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":q.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")):q.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),q.isNullOrUndefined(c)||c++}this.lastCaptionRowBorder(),this.parent.notify(dr,{rows:this.parent.getRowsObject()})}this.parent.enableInfiniteScrolling&&this.parent.groupSettings.enableLazyLoading||this.parent.notify(Dr,{isCollapse:n,parentUid:o})}},u.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++)q.removeClass([i[parseInt(n.toString(),10)]],"e-lastrowcell");this.isAppliedCaptionRowBorder=!1}var s=this.parent.getContentTable().querySelector(H).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")){q.addClass(s[parseInt(n.toString(),10)].childNodes,"e-lastrowcell"),this.isAppliedCaptionRowBorder=!0;break}}else e.scrollHeight<t&&(q.addClass(e.querySelectorAll("tr:last-child td"),"e-lastrowcell"),this.isAppliedCaptionRowBorder=!0)}},u.prototype.updateVirtualRows=function(t,e,i,n,r){var e=t.getRowObjectFromUID(e.closest("tr").getAttribute("data-uid")),s=(e.isExpand=i,Xl(t),this.parent.notify(ur,{}),n=t.getDataModule().generateQuery(!1),{requestType:"virtualscroll",rowObject:e});t.contentModule&&(s.virtualInfo=t.contentModule.prevInfo),t.getDataModule().getData(s,n.requiresCount()).then(function(e){return t.renderModule.dataManagerSuccess(e,s)})},u.prototype.expandCollapse=function(e){var t=this.parent.getRowsObject();if(this.parent.groupSettings.columns.length&&t.length){e||this.parent.notify(Mn,e);for(var i,n=this.parent.getContentTable().querySelector(H).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(dr,{rows:this.parent.getRowsObject()})}},u.prototype.expandAll=function(){this.expandCollapse(!0)},u.prototype.collapseAll=function(){this.expandCollapse(!1)},u.prototype.render=function(){this.l10n=this.serviceLocator.getService("localization"),this.renderGroupDropArea(),this.initDragAndDrop(),this.refreshToggleBtn(),this.wireEvent()},u.prototype.refreshDropArea=function(){var e=this.parent.element.querySelector(".e-groupdroparea");if(!q.isNullOrUndefined(e)){this.updateGroupDropArea(!0);for(var t=0;t<this.groupSettings.columns.length;t++)this.addColToGroupDrop(this.groupSettings.columns[parseInt(t.toString(),10)])}},u.prototype.renderGroupDropArea=function(){var e=this.parent.element.querySelector(".e-groupdroparea");e&&q.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")},u.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"))},u.prototype.initDragAndDrop=function(){this.initializeGHeaderDrop(),this.initializeGHeaderDrag()},u.prototype.initializeGHeaderDrag=function(){new q.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})},u.prototype.initializeGHeaderDrop=function(){new q.Droppable(this.element,{accept:".e-dragclone",drop:this.drop})},u.prototype.groupColumn=function(e){var t=this.parent,i=t.getColumnByField(e);q.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}):Oh(t)?t.notify(ni,{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)},u.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(!(q.isNullOrUndefined(i)||!1===i.allowGrouping||this.groupSettings.columns.indexOf(t)<0))if(Oh(e))e.notify(ni,{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())}},u.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()},u.prototype.onActionComplete=function(e){"grouping"===e.requestType?this.addColToGroupDrop(this.colName):this.removeColFromGroupDrop(this.colName),this.groupSettings.showDropArea&&"100%"===this.parent.height&&this.parent.scrollModule.refresh();var t=-1<this.groupSettings.columns.indexOf(this.colName)?{columnName:this.colName,requestType:"grouping",type:p}:{requestType:"ungrouping",type:p};this.parent.trigger(p,q.extend(e,t)),this.colName=null},u.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")},u.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=(Ih(e)&&s.setAttribute("ej-complexname",xh(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:"Drag",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 q.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},u.prototype.addColToGroupDrop=function(e){var t=Ih(e)?this.parent.element.querySelector(".e-groupdroparea div[ej-complexname="+Rh(xh(e))+"]"):this.parent.element.querySelector(".e-groupdroparea div[data-mappingname="+Rh(e)+"]");t&&(this.groupSettings.allowReordering||t.getAttribute("data-mappingname")===e)||(t=this.parent.getColumnByField(e),q.isNullOrUndefined(t))||(t=this.createElement(e),this.groupSettings.allowReordering&&(e=this.element.getElementsByClassName("e-group-animator").length,t.setAttribute("data-index",e.toString())),this.element.appendChild(t),(e=this.parent.focusModule).setActive(!0),0===e.active.matrix.matrix[(t=[0,0])[0]][t[1]]&&(t=$d(e.active.matrix.matrix,t,!0)),e.active.matrix.current=t,this.parent.editSettings.showAddNewRow?this.parent.notify(Ur,{}):this.parent.isInitialLoad&&!this.preventFocusOnGroup&&e.focus())},u.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 q.updateCSSText(e,this.groupSettings.showUngroupButton?"":"display: none;"),e},u.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&&q.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":(q.isNullOrUndefined(this.l10n)?this.parent.localeObj:this.l10n).getConstant("GroupButton")}}))},u.prototype.removeColFromGroupDrop=function(e){var t;q.isNullOrUndefined(this.getGHeaderCell(e))||(e=this.getGHeaderCell(e),this.groupSettings.allowReordering?(t=x(e,"e-group-animator"),q.remove(t)):q.remove(e),this.updateGroupDropArea(),this.parent.editSettings.showAddNewRow&&this.parent.notify(Ur,{})),this.isAppliedUnGroup=!1},u.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(ft,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&&this.parent.scrollModule.refresh();break;case"showGroupedColumn":this.updateGroupedColumn(this.groupSettings.showGroupedColumn),this.parent.notify(ft,{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()}}},u.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},u.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"},u.prototype.enableAfterRender=function(e){e.module===this.getModuleName()&&e.enable&&this.render()},u.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+ts)||e.querySelector("."+is))&&(!this.parent.isDestroyed&&this.parent.allowGrouping||this.parent.refreshing||this.clearGrouping(),this.unWireEvent(),this.removeEventListener(),this.refreshToggleBtn(!0),this.element.parentNode)&&q.remove(this.element)},u.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},u.prototype.getModuleName=function(){return"group"},u.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))?(q.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?q.classList(this.getGHeaderCell(i[parseInt(r.toString(),10)].field).querySelector(".e-groupsort"),["e-ascending","e-icon-ascending"],["e-descending","e-icon-descending"]):q.classList(this.getGHeaderCell(i[parseInt(r.toString(),10)].field).querySelector(".e-groupsort"),["e-descending","e-icon-descending"],["e-ascending","e-icon-ascending"])))},u.prototype.getGHeaderCell=function(e){return this.element&&this.element.querySelector('[data-mappingname="'+e+'"]')?this.element.querySelector('[data-mappingname="'+e+'"]').parentElement:null},u.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(Et,r)}}},u.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.contentModule,S=y.getGroupCache()[c.pageSettings.currentPage],v=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&&v.length)0!==t&&(e=m[t-1],i=g[""+e],v=v.find(function(e){return e.key===i}).items),C.updateLazyLoadGroupAggregatesRow(v,n,r,S,d,p);else{var s,o,a,e=c.renderModule.data.generateQuery();if(0!==t&&(s=S.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=Jd(Yd(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,S,d,p),t!==m.length-1&&!u||h.destroyRefreshGroupCaptionFooterTemplate()}).catch(function(e){return c.renderModule.dataManagerFailure(e,{requestType:"grouping"})}),u)return"break"}}(t))break},u.prototype.destroyRefreshGroupCaptionFooterTemplate=function(){var e=this.parent;(e.isAngular||e.isReact||e.isVue)&&e.destroyTemplate(["groupCaptionTemplate","groupFooterTemplate"]),e.refreshGroupCaptionFooterTemplate(),e.removeMaskRow(),e.hideSpinner()},u.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))},u.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[ep(o.type)]=r[a],l[o.type]&&(l[o.type]=r[a])}},u.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},u.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},u.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};q.isNullOrUndefined(e)||q.isNullOrUndefined(t)||e.parentUid===t.parentUid||(n?("none"===n.style.display&&(i.style.display="none"),r.dropIndex<r.fromIndex?this.parent.getContentTable().querySelector(H).insertBefore(i,n):this.parent.getContentTable().querySelector(H).insertBefore(i,n.nextSibling)):q.remove(i),this.groupReorderHandler(e,t),n=[].slice.call(this.parent.getContentTable().getElementsByClassName(I)),yd(this.parent,r,n,t),this.parent.enableVirtualization?md(this.parent):fd(this.parent,this.parent.getRowsObject().filter(function(e){return e.isDataRow}),n),this.parent.notify(dr,{rows:this.parent.getRowsObject()}))},u.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=[];q.isNullOrUndefined(c[0])||o.push(c[0]),q.isNullOrUndefined(u[0])||o.push(u[0]);for(var g=i.currentViewData,f=0;f<g.length;f++)q.isNullOrUndefined(c[0])&&g[parseInt(f.toString(),10)].key===h[h.length-1].data.key||q.isNullOrUndefined(u[0])&&g[parseInt(f.toString(),10)].key===l[l.length-1].data.key?(g.splice(f,1),f--):q.isNullOrUndefined(c[0])||g[parseInt(f.toString(),10)].key!==c[0].key?q.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)},u.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(q.isNullOrUndefined(c)||q.isNullOrUndefined(d.data.key)||q.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,S=!0,v=e[parseInt((l+1).toString(),10)];if((S=n&&v&&!v.isAggregateRow&&(g=v.data.key.toString(),v=v.data.field,f=c.data.items.records||c.data.items)&&f.length&&f[0][""+v]&&f[0][""+v].toString()!==g?!1:S)||!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(q.isNullOrUndefined(C)||q.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)}}},u.prototype.groupReorderRefreshHandler=function(e){for(var t=this.parent,i=new Ls(t.serviceLocator,null,t),n=t.getColumns(),r=0;r<e.length;r++){var s=e[parseInt(r.toString(),10)];q.isNullOrUndefined(s.uid)||q.isNullOrUndefined(t.getRowElementByUID(s.uid))||i.refresh(s,n,!1)}},u.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},u.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},u.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=(q.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},u.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)||q.isNullOrUndefined(o)&&q.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&&!q.isNullOrUndefined(o)&&!q.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=U.DataUtil.getObject(s,e);return c.some(function(e){return t=e,i===U.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=[],S=this.parent.aggregates,v=0;v<S.length;v++)for(var C=S[parseInt(v.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 x={type:I[b].toLowerCase(),field:C.columns[parseInt(w.toString(),10)].field};y.push(x)}for(var R=this.parent.groupSettings.columns,T=0;T<R.length;T++)m=U.DataUtil.group(m||u,R[parseInt(T.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 D=[],g=0;g<m.length;g++)D.push(m[parseInt(g.toString(),10)]);for(var E=[],o=this.parent.getDataModule().generateQuery(!0),n=o,O=0;O<D.length;O++)E.push(new U.Predicate("field","==",D[parseInt(O.toString(),10)].field).and(i.parent.renderModule.getPredicate("key","equal",D[parseInt(O.toString(),10)].key)));n.where(U.Predicate.or(E));t=this.parent.getDataModule().dataManager.executeLocal(o);this.parent.renderModule.updateGroupInfo(m,t)}}return m},u.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||q.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:q.isNullOrUndefined(e)||t.parentUid!==e.uid||(e.isExpand&&!0===e.visible?t.visible=!0:e.isExpand&&!1===e.visible&&(t.visible=!1)),q.isNullOrUndefined(i))return"break"}(o))break}}this.parent.notify(ct,{rows:n,args:{isFrozen:!1,rows:n}})};var ec=u;function u(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=q.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:x(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,q.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(we,{target:e,draggableType:"headercell",column:o.column}),o.groupSettings.allowReordering||(q.classList(t,["e-defaultcur"],["e-notallowedcur"]),x(e,is))||x(e,"e-headercell")||q.classList(t,["e-notallowedcur"],["e-defaultcur"])},this.dragStop=function(e){o.parent.element.classList.remove("e-ungroupdrag");var t,i=!(x(e.target,is)||x(e.target,"e-gridheader"));o.groupSettings.allowReordering&&i?(q.remove(e.helper),x(e.target,"e-groupdroparea")?o.rearrangeGroup():x(e.target,"e-grid")||(t=o.parent.getColumnByUid(e.helper.getAttribute("data-mappinguid")).field,-1!==o.groupSettings.columns.indexOf(t)&&o.ungroupColumn(t))):i&&q.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=x(e.target,"e-groupdroparea"),e=x(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"),q.remove(e.droppedElement),o.aria.setDropTarget(o.parent.element.querySelector(".e-groupdroparea"),!1),o.aria.setGrabbed(o.parent.getHeaderTable().querySelector("[aria-grabbed=true]"),!1),q.isNullOrUndefined(i)||!1===i.allowGrouping||x(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 io,this.parent=e,this.groupSettings=t,this.serviceLocator=n,this.sortedColumns=i,this.focus=n.getService("focus"),this.addEventListener(),this.groupGenerator=new Xs(this.parent)}tc.prototype.addEventListener=function(){this.parent.isDestroyed||(q.EventHandler.add(this.parent.element,"auxclick",this.auxilaryclickHandler,this),this.parent.on(Nt,this.clickHandler,this),this.parent.on(s,this.destroy,this),this.parent.on(Pt,this.keyPressHandler,this),this.parent.on(Gi,this.expand,this),this.parent.on(Bt,this.refreshColSpan,this),this.parent.on(s,this.destroyChildGrids,this),this.parent.on(Rr,this.destroyChildGrids,this),this.parent.on(s,this.detachDetailTemplate,this),this.parent.on(_r,this.detachDetailTemplate,this))},tc.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(q.closest(e.target,"td"),e)},tc.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()},tc.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(!q.isNullOrUndefined(h)){var l=!1,d=this.parent.getContentTable().querySelector(H).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(q.isNullOrUndefined(t)||(c.event=t),q.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="",n.notify(un,{data:p,childGrid:n.childGrid,detailElement:e,isExpanded:o}),l=!0;else if(n.getDetailTemplate()||n.childGrid){var c=gh("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 Xr({isDataRow:!0,isExpand:!0,uid:c,isDetailRow:!0,cells:[new Jr({cellType:N.CellType.Indent}),new Jr({isDataCell:!0,visible:!0})]}));m.parentUid=h.uid;for(var y=0,S=n.groupSettings.columns.length;y<S;y++)u.appendChild(this.parent.createElement("td",{className:"e-indentcell"})),m.cells.unshift(new Jr({cellType:N.CellType.Indent}));u.appendChild(this.parent.createElement("th",{className:"e-detailindentcell",attrs:{scope:"col"}})),u.appendChild(g),a.parentNode.insertBefore(u,a.nextSibling);var f=void 0,c=void 0,v=(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,C=this.parent.printGridParent&&this.parent.printGridParent.isReact,v=n.element.id+"detailTemplate",f||c||C?(n.getDetailTemplate()(p,n,"detailTemplate",v,null,null,g),this.parent.renderTemplates(function(){n.trigger(Oe,{detailElement:g,data:p,childGrid:i})})):fh(g,n.getDetailTemplate()(p,n,"detailTemplate",v,void 0,void 0,void 0,this.parent.root))):((i=new Ul(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&&Ih(n.childGrid.queryString)?Wh(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(ct,this.promiseResolve(i),this),i.on(ut,this.promiseResolve(i),this)),C=(h.childGrid=i).getInjectedModules(),v=n.getInjectedModules(),C&&C.length===v.length||i.setInjectedModules(v),C=this.parent.createElement("div",{id:"child"+mh(a,"e-grid").length+"_grid"+a.rowIndex+gh(""),className:"e-childgrid"}),g.appendChild(C),i.appendTo(C)),u.appendChild(g),a.nextSibling?a.parentNode.insertBefore(u,a.nextSibling):a.parentNode.appendChild(u),n.getRows()),C=n.getRowsObject();if(v.splice(v.indexOf(a)+1,0,u),n.enableInfiniteScrolling&&n.infiniteScrollSettings.enableCache)for(var w=n.contentModule.infiniteCache,b=Object.keys(w),y=0;y<b.length;y++){var I=w[parseInt(b[parseInt(y.toString(),10)],10)].indexOf(h);if(-1!==I){w[parseInt(b[parseInt(y.toString(),10)],10)].splice(I+1,0,m);break}}else C.splice(C.indexOf(h)+1,0,m);f&&c||n.trigger(Oe,{detailElement:g,data:p,childGrid:i}),n.notify(Oe,{rows:C})}q.classList(e,["e-detailrowexpand"],["e-detailrowcollapse"]),q.classList(e.firstElementChild,["e-dtdiagonaldown","e-icon-gdownarrow"],["e-dtdiagonalright","e-icon-grightarrow"]),h.isExpand=!0,e.classList.contains("e-lastrowcell")&&this.parent.getContent().clientHeight>r.scrollHeight&&(q.removeClass(e.parentElement.querySelectorAll("td"),"e-lastrowcell"),v=r.querySelector(H).getElementsByClassName("e-detailrow").length-1,q.addClass(r.querySelector(H).getElementsByClassName("e-detailrow")[parseInt(v.toString(),10)].childNodes,["e-lastrowcell"]),this.lastrowcell=!0),this.aria.setExpand(e,!0),e.firstElementChild.setAttribute("title",this.l10n.getConstant("Expanded"))}else{if(this.isDetailRow(d)){var x,f={rowData:h.data,parentRow:e.closest("tr"),cancel:!1,detailRow:this.isDetailRow(d)?d:null};if(q.isNullOrUndefined(t)||(f.event=t),q.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(Ae,f),f.cancel)return;d.style.display="none",n.notify(un,{data:h.data,childGrid:n.childGrid,detailElement:e,isExpanded:o})}q.classList(e,["e-detailrowcollapse"],["e-detailrowexpand"]),q.classList(e.firstElementChild,["e-dtdiagonalright","e-icon-grightarrow"],["e-dtdiagonaldown","e-icon-gdownarrow"]),parseInt(a.getAttribute(T),10)-1==s&&this.lastrowcell&&(q.addClass(e.parentElement.querySelectorAll("td"),"e-lastrowcell"),this.lastrowcell=!1),h.isExpand=!1,this.aria.setExpand(e,!(l=!0)),e.firstElementChild.setAttribute("title",this.l10n.getConstant("Collapsed"))}(!q.isNullOrUndefined(n.detailTemplate)||n.childGrid&&l)&&(n.updateVisibleExpandCollapseRows(),n.notify(dr,{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())}}},tc.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,q.extend({},e.expandedRows[t.index].gridModel,e.childGrid,!0)):q.extend({},{},e.childGrid,!0);return e.isPrinting&&e.childGrid.allowPaging&&(t.allowPaging="CurrentPage"===i),t},tc.prototype.promiseResolve=function(e){var t=this;return function(){e.off(ct,t.promiseResolve),e.off(ut,t.promiseResolve),e.notify(Vi,{})}},tc.prototype.isDetailRow=function(e){return e&&e.classList.contains("e-detailrow")},tc.prototype.destroy=function(){var e=this.parent.element;!this.parent.isDestroyed&&e&&(e.querySelector("."+ts)||e.querySelector("."+is))&&(q.EventHandler.remove(this.parent.element,"auxclick",this.auxilaryclickHandler),this.parent.off(Nt,this.clickHandler),this.parent.off(s,this.destroy),this.parent.off(Pt,this.keyPressHandler),this.parent.off(Gi,this.expand),this.parent.off(Bt,this.refreshColSpan),this.parent.off(s,this.destroyChildGrids),this.parent.off(Rr,this.destroyChildGrids),this.parent.off(s,this.detachDetailTemplate),this.parent.off(_r,this.detachDetailTemplate))},tc.prototype.getTDfromIndex=function(e,t){e=q.isNullOrUndefined(e)?void 0:this.parent.getDataRows()[parseInt(e.toString(),10)];return e&&e.querySelector(t)?e.querySelector(t):null},tc.prototype.expand=function(e){(e=isNaN(e)?e:this.getTDfromIndex(e,".e-detailrowcollapse"))&&e.classList.contains("e-detailrowcollapse")&&this.toogleExpandcollapse(e)},tc.prototype.collapse=function(e){(e=isNaN(e)?e:this.getTDfromIndex(e,".e-detailrowexpand"))&&e.classList.contains("e-detailrowexpand")&&this.toogleExpandcollapse(e)},tc.prototype.expandAll=function(){this.expandCollapse(!0),this.parent.trigger(p,{requestType:"expandAllComplete",type:p,moduleObj:this})},tc.prototype.collapseAll=function(){this.expandCollapse(!1),this.parent.trigger(p,{requestType:"collapseAllComplete",type:p,moduleObj:this})},tc.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)},tc.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)}},tc.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+"")},tc.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(Gr,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=[]}},tc.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(Gr,i,function(){t.map(function(e){n.getContentTable().querySelector('[data-uid="'+e.uid+'"]').remove()})}))},tc.prototype.getModuleName=function(){return"detailRow"};o=tc;function tc(e,t){this.aria=new io,this.childRefs=[],this.parent=e,this.serviceLocator=t,this.focus=t.getService("focus"),this.addEventListener()}f.prototype.render=function(){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"];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.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.enableAdaptiveUI&&(q.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.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)&&(q.remove(this.element),this.toolbar=null)},f.prototype.bindSearchEvents=function(){this.searchElement=q.select("#"+this.gridID+"_searchbar",this.element),this.wireEvent(),this.refreshToolbarItems(),this.parent.searchSettings&&this.updateSearchBox()},f.prototype.toolbarCreated=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("#"+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("#"+this.gridID+"_responsivetoolbaritems").style.width="auto"),this.bindSearchEvents()},f.prototype.createToolbar=function(){var e=this.getItems(),e=(this.toolbar=new z.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.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?(th(this.parent.toolbarTemplate)({},this.parent,"toolbarTemplate",i,null,null,this.element),this.parent.renderTemplates()):fh(this.element,th(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(N.ResponsiveToolbarAction.isSearch),this.searchElement=q.select("#"+this.gridID+"_searchbar",this.element),(t=x(this.searchElement,"e-toolbar-right"))&&t.classList.add("e-responsive-right"),this.parent.searchSettings&&this.updateSearchBox()):this.refreshResponsiveToolbarItems(N.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===N.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?x(this.toolbar.element.querySelector("#"+d.id),"e-template").children[0]:this.toolbar.element.querySelector("#"+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=x(this.searchElement,"e-toolbar-right"))&&t.classList.remove("e-responsive-right"),this.toolbarCreated(!1),this.unWireEvent(),this.searchElement=void 0)}if(e===N.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("#"+d.id))&&(-1<i.indexOf(d.id)?h.parentElement.classList.remove("e-hidden"):h.parentElement.classList.add("e-hidden"))}},f.prototype.refreshToolbarItems=function(e){var t=this.parent,i=[],n=[],r=t.editSettings,s=t.currentViewData&&t.currentViewData.length||"Batch"===t.editSettings.mode&&!q.isNullOrUndefined(t.editModule)&&t.editModule.getBatchChanges()[ms].length,o=r.showAddNewRow&&!t.element.querySelector(".e-editedrow");(r.allowAdding?i:n).push(this.gridID+"_add"),(r.allowEditing&&s?i:n).push(this.gridID+"_edit"),(r.allowDeleting&&s?i:n).push(this.gridID+"_delete"),(t.allowPdfExport&&s?i:n).push(this.gridID+"_pdfexport"),(t.allowExcelExport&&s?(i.push(this.gridID+"_excelexport"),i):(n.push(this.gridID+"_excelexport"),n)).push(this.gridID+"_csvexport"),(t.showColumnChooser?i:n).push(this.gridID+"_columnchooser"),"Batch"===t.editSettings.mode?(t.element.getElementsByClassName("e-updatedtd").length&&(r.allowAdding||r.allowEditing)?(i.push(this.gridID+"_update"),i):(n.push(this.gridID+"_update"),n)).push(this.gridID+"_cancel"):(t.isEdit||r.showAddNewRow)&&(r.allowAdding||r.allowEditing)?(i=o?[this.gridID+"_update",this.gridID+"_cancel",this.gridID+"_edit",this.gridID+"_delete"]:[this.gridID+"_update",this.gridID+"_cancel"],n=o?[this.gridID+"_add"]:[this.gridID+"_add",this.gridID+"_edit",this.gridID+"_delete"]):(n.push(this.gridID+"_update"),n.push(this.gridID+"_cancel")),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?q.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=q.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):(q.extend(e,{cancel:!1}),o.trigger(Fe,e,function(e){if(e.originalEvent=e.originalEvent||l,!e.cancel)switch(!q.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+"_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.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+"_columnchooser":var t,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(zr,{action:3}),o.showResponsiveCustomFilter();break;case a+"_responsivesort":o.notify(zr,{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=q.isNullOrUndefined(e)?this.parent.element.querySelector("#"+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(),nd(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 z.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=wd(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(Fe,n,function(e){if(!e.cancel)switch(!q.isNullOrUndefined(e.item)&&e.item.id){case t.gridID+"_columnchooser":i.notify(zr,{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&&q.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&&!q.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.search=function(){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 ma(this.searchElement,this.serviceLocator),q.EventHandler.add(this.searchElement,"keyup",this.keyUpHandler,this),this.searchBoxObj.wireEvent()),q.EventHandler.add(this.element,"focusin",this.onFocusIn,this),q.EventHandler.add(this.element,"focusout",this.onFocusOut,this)},f.prototype.unWireEvent=function(){this.searchElement&&(q.EventHandler.remove(this.searchElement,"keyup",this.keyUpHandler),this.searchBoxObj.unWireEvent()),q.EventHandler.remove(this.element,"focusin",this.onFocusIn),q.EventHandler.remove(this.element,"focusout",this.onFocusOut)},f.prototype.onFocusIn=function(e){var t=this.parent.focusModule.currentInfo;t&&t.element&&(q.removeClass([t.element,t.elementToFocus],["e-focused","e-focus"]),t.element.tabIndex=-1),e.target.tabIndex=0},f.prototype.onFocusOut=function(e){e.target.tabIndex=-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("#"+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++)q.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.keyPressedHandler=function(e){if(e.target&&x(e.target,"e-toolbar-item")){var t=x(e.target,"e-toolbar-item"),i=this.getFocusableToolbarItems();if("tab"===e.action||"shiftTab"===e.action){if("tab"===e.action&&t===i[i.length-1]||"shiftTab"===e.action&&t===i[0])return;for(var n,r=0;r<i.length;r++)if(t===i[parseInt(r.toString(),10)])return e.preventDefault(),n="tab"===e.action?r+1:r-1,void this.setFocusToolbarItem(i[parseInt(n.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&&q.remove(this.element),this.render()},f.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:hr,handler:this.reRenderToolbar},{event:dt,handler:this.render},{event:g,handler:this.onPropertyChanged},{event:gt,handler:this.updateSearchBox.bind(this)},{event:ft,handler:this.refreshToolbarItems},{event:Xt,handler:this.refreshToolbarItems},{event:gt,handler:this.modelChanged},{event:ae,handler:this.refreshToolbarItems},{event:Nt,handler:this.removeResponsiveSearch},{event:pr,handler:this.reRenderToolbar},{event:s,handler:this.destroy},{event:Pt,handler:this.keyPressedHandler}],zd(this.parent,this.evtHandlers,!0,this),this.rowSelectedFunction=this.rowSelected.bind(this),this.rowDeSelectedFunction=this.rowSelected.bind(this),this.parent.addEventListener(he,this.rowSelectedFunction),this.parent.addEventListener(pe,this.rowDeSelectedFunction))},f.prototype.removeEventListener=function(){this.parent.isDestroyed||(zd(this.parent,this.evtHandlers,!1),this.parent.removeEventListener(he,this.rowSelectedFunction),this.parent.removeEventListener(pe,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&&!x(e.target,"e-res-toolbar")&&this.renderResponsiveSearch(!1)},f.prototype.rowSelected=function(){this.parent.enableAdaptiveUI&&this.toolbar.element&&(this.refreshResponsiveToolbarItems(N.ResponsiveToolbarAction.isInitial),this.toolbar.refreshOverflow())},f.prototype.getModuleName=function(){return"toolbar"};Pa=f;function f(e,t){this.predefinedItems={},this.isSearched=!1,this.items=["Add","Edit","Update","Delete","Cancel","Print","Search","ColumnChooser","PdfExport","ExcelExport","CsvExport","WordExport"],this.isRightToolbarMenu=!1,this.parent=e,this.gridID=e.element.id,this.serviceLocator=t,this.addEventListener()}ic=function(e,t){return(ic=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}ic(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(sc,nc=Js),sc.prototype.renderPanel=function(){var e=this.parent.createElement("div",{className:ns}),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)},sc.prototype.renderTable=function(){var e=this.createContentTable("_footer_table").querySelector("."+ds),t=this.parent.createElement("tfoot");e.appendChild(t),this.setTable(e)},sc.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=q.isNullOrUndefined(i)?this.modelGenerator.getColumns():this.modelGenerator.getColumns(i),a=q.isNullOrUndefined(i)?this.modelGenerator.generateRows(r,e||this.aggregates):this.modelGenerator.generateRows(r,e||this.aggregates,i,n),l=document.createDocumentFragment(),h=new Ls(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"),Dd(u[parseInt(g.toString(),10)],30*g,this.parent.enableRtl,"Left");this.parent.isFrozenGrid()&&c.querySelectorAll(".e-summarycell").length&&q.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.renderTemplates(function(){t.tFoot.innerHTML="",t.tFoot.appendChild(l)}):t.tFoot.appendChild(l),this.aggregates=q.isNullOrUndefined(e)?this.aggregates:e},sc.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.getTable().tFoot.innerHTML=""),this.renderSummaryContent(e,this.getTable(),void 0,void 0),q.isNullOrUndefined(e)&&this.parent.isAutoFitColumns&&this.parent.autoFitColumns(),this.onScroll()},sc.prototype.refreshCol=function(){var e=this.parent.enableColumnVirtualization?this.parent.headerModule.getColGroup():this.parent.element.querySelector("."+ts).querySelector(bs).cloneNode(!0);this.getTable().replaceChild(e,this.getColGroup()),this.setColGroup(e)},sc.prototype.onWidthChange=function(e){this.getColFromIndex(e.index).style.width=q.formatUnit(e.width),this.parent.allowResizing&&"resize"===e.module&&this.updateFooterTableWidth(this.getTable())},sc.prototype.onScroll=function(e){void 0===e&&(e={left:this.parent.getContent().firstChild.scrollLeft}),this.getTable().parentElement.scrollLeft=e.left},sc.prototype.getColFromIndex=function(e){return this.getColGroup().children[parseInt(e.toString(),10)]},sc.prototype.columnVisibilityChanged=function(){this.refresh()},sc.prototype.addEventListener=function(){this.evtHandlers=[{event:mt,handler:this.refreshCol},{event:qt,handler:this.onWidthChange},{event:zt,handler:this.onScroll},{event:Bt,handler:this.columnVisibilityChanged},{event:Dt,handler:this.refreshFooterRenderer}],zd(this.parent,this.evtHandlers,!0,this)},sc.prototype.removeEventListener=function(){zd(this.parent,this.evtHandlers,!1)},sc.prototype.updateFooterTableWidth=function(e){var t=this.parent.getHeaderTable();t&&e&&(e.style.width=t.style.width)},sc.prototype.refreshFooterRenderer=function(e){e=this.onAggregates(e);this.refresh(e)},sc.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},sc.prototype.getData=function(){return this.parent.getDataModule().dataManager.executeLocal(this.parent.getDataModule().generateQuery(!0))},sc.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()||!q.isNullOrUndefined(this.parent.dataSource)&&this.parent.dataSource.result||!(this.parent.allowFiltering&&this.parent.filterSettings.columns.length||this.parent.searchSettings.key.length)||(a=!0),e=!q.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[fs].length&&-1<this.getIndexByKey(e[parseInt(l.toString(),10)],s[fs])&&(i=!0,t.push(s[fs][this.getIndexByKey(e[parseInt(l.toString(),10)],s[fs])])),s[ys].length&&-1<this.getIndexByKey(e[parseInt(l.toString(),10)],s[ys])?i=!0:i||t.push(e[parseInt(l.toString(),10)]);if(s[ms].length)for(l=0;l<s[ms].length;l++)t.push(s[ms][parseInt(l.toString(),10)])}else t=n.length?(c=eh(e)).map(function(e){var t,i=U.DataUtil.getObject(r,e);return n.some(function(e){return t=e,i===U.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=yh(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 ic,nc,rc=sc;function sc(e,t){var i=nc.call(this,e,t)||this;return i.aggregates={},i.parent=e,i.locator=t,i.modelGenerator=new qs(i.parent),i.addEventListener(),i}oc=function(e,t){return(oc=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}oc(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(hc,ac=eo),hc.prototype.getValue=function(e,t,i){var n=q.isNullOrUndefined(i.type)?i.columnName:i.field+" - "+("string"==typeof i.type?i.type.toLowerCase():"");return t[i.columnName]?t[i.columnName][""+n]:""},hc.prototype.evaluate=function(e,t,i,n){var r=t.column;if(this.parent.on(Et,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=(q.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()):fh(e,t.fn(i[r.columnName],this.parent,t.property,"",null,null,null,this.parent.root)),!1},hc.prototype.refreshWithAggregate=function(n,e){var r=this,s=e;return function(e){var t=s,i=t.column.columnName||null,t=q.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 oc,ac,lc=hc;function hc(){var e=null!==ac&&ac.apply(this,arguments)||this;return e.element=e.parent.createElement("TD",{className:"e-summarycell",attrs:{tabindex:"-1",role:"gridcell"}}),e}dc.prototype.getModuleName=function(){return"aggregate"},dc.prototype.initiateRender=function(){for(var e=this,t=this.locator.getService("cellRendererFactory"),i=new lc(this.parent,this.locator),n=[N.CellType.Summary,N.CellType.CaptionSummary,N.CellType.GroupSummary],r=0;r<n.length;r++)t.addCellRenderer(n[parseInt(r.toString(),10)],i);this.footerRenderer=new rc(this.parent,this.locator),this.footerRenderer.renderPanel(),this.footerRenderer.renderTable();var s=this.footerRenderer.getPanel(),o=(this.parent.element.scrollHeight>=this.parent.getHeight(this.parent.height)&&s&&q.addClass([s],["e-footerpadding"]),this.locator.register("footerRenderer",this.footerRenderer),function(){e.prepareSummaryInfo(),e.parent.off(pt,o)});this.parent.on(pt,o,this),this.parent.on(pt,this.footerRenderer.refresh,this.footerRenderer)},dc.prototype.prepareSummaryInfo=function(){var i=this;pc(this.parent.aggregates,function(e){var t=q.getValue("customFormat",e);q.isNullOrUndefined(t)||e.setPropertiesSilent({format:t}),"object"==typeof e.format?(t=new V,e.setFormatter(t.getFormatFunction(q.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})})},dc.prototype.onPropertyChanged=function(e){e.module!==this.getModuleName()||(q.isNullOrUndefined(this.footerRenderer)&&this.initiateRender(),this.prepareSummaryInfo(),this.footerRenderer.refresh(),e=new _s(this.parent),0===new js(this.parent).getData().length&&e.isEmpty())||this.parent.notify(ft,{})},dc.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(dt,this.initiateRender,this),this.parent.on(g,this.onPropertyChanged,this),this.parent.on(Ot,this.refresh,this),this.parent.on(s,this.destroy,this))},dc.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.footerRenderer.removeEventListener(),this.parent.off(dt,this.initiateRender),this.parent.off(pt,this.footerRenderer.refresh),this.parent.off(g,this.onPropertyChanged),this.parent.off(Ot,this.refresh),this.parent.off(s,this.destroy),this.parent.element.querySelector("."+ns)&&q.remove(this.parent.element.querySelector("."+ns)))},dc.prototype.destroy=function(){this.removeEventListener()},dc.prototype.refresh=function(e,t){e=e instanceof Array?e:[e];this.parent.notify(Dt,e),t&&(e.row=t),0<this.parent.groupSettings.columns.length&&this.parent.notify(Tt,e)};e=dc;function dc(e,t){this.parent=e,this.locator=t,this.addEventListener()}function pc(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)])}uc.prototype.observe=function(e,t){var i=this;this.containerRect=this.options.container.getBoundingClientRect(),q.EventHandler.add(this.options.container,"wheel",function(){return i.fromWheel=!0},this),q.isNullOrUndefined(this.options.horizontalScrollbar)||(q.EventHandler.add(this.options.horizontalScrollbar,"wheel",function(){return i.fromWheel=!0},this),q.EventHandler.add(this.options.horizontalScrollbar,"scroll",this.onVirtualContentScroll(),this)),q.isNullOrUndefined(this.options.verticalScrollbar)||(q.EventHandler.add(this.options.verticalScrollbar,"wheel",function(){return i.fromWheel=!0},this),q.EventHandler.add(this.options.verticalScrollbar,"scroll",this.onVirtualContentScroll(),this)),q.EventHandler.add(this.options.container,"scroll",this.virtualScrollHandler(e,t),this)},uc.prototype.check=function(e){e=this.sentinelInfo[""+e];return e.check(this.element.getBoundingClientRect(),e)},uc.prototype.onVirtualContentScroll=function(){var t=this;return function(e){e.target.classList.contains("e-virtual-vertical-scrollbar")&&(t.options.container.scrollTop=e.target.scrollTop),e.target.classList.contains("e-virtual-horizontal-scrollbar")&&(t.options.container.scrollLeft=e.target.scrollLeft)}},uc.prototype.virtualScrollHandler=function(e,s){var o=this,t="chrome"===q.Browser.info.name?200:100,a=q.debounce(e,t),l=q.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,q.isNullOrUndefined(o.options.verticalScrollbar)||(o.options.verticalScrollbar.scrollTop=o.options.container.scrollTop),q.isNullOrUndefined(o.options.horizontalScrollbar)||(o.options.horizontalScrollbar.scrollLeft=o.options.container.scrollLeft),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)}},uc.prototype.setPageHeight=function(e){this.options.pageHeight=e};var cc=uc;function uc(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}fc.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:Qd(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},fc.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)&&tp(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),S=[];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||(this.startIndex=null),Kh(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 v=g.blockIndexes,C=this,t=0;t<v.length;t++)!function(e){if(!C.isBlockAvailable(v[parseInt(e.toString(),10)])){var t=q.isNullOrUndefined(C.startIndex)||isNaN(C.startIndex)?C.getStartIndex(v[parseInt(e.toString(),10)],p):C.startIndex,t=!Kh(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});Kh(C.parent)&&!C.parent.vcRows.length&&(C.recordsCount=p.records.length,C.parent.vRows=i,C.parent.vcRows=i,C.parent.notify(ur,{}));if(Kh(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)&&tp(C.parent))for(var n=ip(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[v[parseInt(e.toString(),10)]]&&!C.parent.groupSettings.enableLazyLoading&&(C.cache[v[parseInt(e.toString(),10)]]=C.updateGroupRow(C.cache[v[parseInt(e.toString(),10)]],v[parseInt(e.toString(),10)])),c.renderMovableContent||c.renderFrozenRightContent||!C.cache[v[parseInt(e.toString(),10)]]||(m.push.apply(m,C.cache[v[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(v[parseInt(e.toString(),10)])&&S.push(v[parseInt(e.toString(),10)])}(t);if(Kh(this.parent)&&this.parent.vcRows.length&&"sorting"===c.requestType&&0!==c.scrollTop.top)return m=this.parent.vcRows;g.blockIndexes=S;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})),Kh(this.parent)&&this.parent.vcRows.length&&["save","delete","refresh-aggregate-on-save"].some(function(e){return c.requestType===e})?m=this.parent.vcRows:m},fc.prototype.generatePinnedTopRows=function(e){return this.rowModelGenerator.generatePinnedTopRows(e)},fc.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))},fc.prototype.getBlockIndexes=function(e){return[e+(e-1),2*e]},fc.prototype.getPage=function(e){return e%2==0?e/2:(e+1)/2},fc.prototype.isBlockAvailable=function(e){return e in this.cache},fc.prototype.getData=function(){return{page:this.model.currentPage,blockIndexes:this.getBlockIndexes(this.model.currentPage),direction:"down",columnIndexes:this.parent.getColumnIndexesInView()}},fc.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)},fc.prototype.getColumnIndexes=function(e){var i=this,n=(void 0===e&&(e=this.parent.getHeaderContent().querySelector("."+rs)),[]),t=0|e.scrollLeft,r=Object.keys(this.cOffsets),e=e.getBoundingClientRect().width,t=Math.min(this.cOffsets[r.length-1]-e,t),s=q.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()===Ss&&(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},fc.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},fc.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)},fc.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)},fc.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},fc.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},fc.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},fc.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 gc=fc;function fc(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?Xs:Ns)(this.parent)}mc=function(e,t){return(mc=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 mc,yc,Sc=function(e,t){function i(){this.constructor=e}mc(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)},vc=(Sc(m,yc=Js),m.prototype.renderTable=function(){this.header=this.locator.getService("rendererFactory").getRenderer(N.RenderType.Header),yc.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.gridContent=this.parent.element.querySelector("."+is),this.virtualEle.content=this.content=this.getPanel().querySelector("."+hs),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 U.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 cc(this.virtualEle.wrapper,e)},m.prototype.renderEmpty=function(e){this.getTable().appendChild(e),(this.parent.frozenRows||this.parent.pinnedTopRowModels.length)&&(this.parent.getHeaderContent().querySelector(H).innerHTML=""),this.virtualEle.adjustTable(0,0)},m.prototype.getReorderedFrozenRows=function(e){var t=e.virtualInfo.blockIndexes,i=e.virtualInfo.columnIndexes,n=e.virtualInfo.page,r=(e.virtualInfo.blockIndexes=[1,2],e.virtualInfo.page=1,e.virtualInfo.columnIndexes=[],this.parent.getCurrentViewRecords().length),r=this.parent.renderModule.data.dataManager.dataSource.json.slice(0,r),r=this.vgenerator.generateRows(r,e);return 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(q.isNullOrUndefined(document.activeElement)?this.isFocused=!1:this.isFocused=this.content===q.closest(document.activeElement,"."+hs)||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(Kh(this.parent))return i.blockIndexes&&this.prevInfo.blockIndexes.toString()===i.blockIndexes.toString()?void this.parent.removeMaskRow():(i.event="refresh-virtual-block",q.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(),q.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(qr,{action:"clear"}),this.parent.isInitialLoad||!this.parent.enablePersistence){if(this.prevPage===this.parent.pageSettings.currentPage&&i.event===ft)return void(this.currentInfo=this.prevCurrentInfo);i.event===ft&&(this.prevPage=this.parent.pageSettings.currentPage,this.prevCurrentInfo=this.currentInfo),this.isBottomNotify=this.isBottom&&i.event===ft,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?ft:Wt,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=Wt)}}return s.columnIndexes="X"===t.axis?this.vgenerator.getColumnIndexes():this.parent.getColumnIndexesInView(),this.parent.enableColumnVirtualization&&"X"===t.axis&&(s.event=Wt),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 tp(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]),o=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===(Kh(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&&(this.parent.element.style.height="100%"),(this.parent.height.toString().indexOf("%")<0?this.content:this.parent.element).getBoundingClientRect().height),d=(!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.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.virtualEle.setWrapperWidth(c,q.Browser.isIE||"edge"===q.Browser.info.name),!(this.parent.enableColumnVirtualization&&q.isNullOrUndefined(e)&&q.isNullOrUndefined(t))){q.isNullOrUndefined(e)||q.isNullOrUndefined(e.parentNode)||q.remove(e);h=this.parent.element.querySelector("."+hs).querySelector(H);if(h&&(q.remove(h),e=null),this.parent.isReact&&!q.isNullOrUndefined(this.parent.rowTemplate)?e=t:(e=this.parent.createElement(H,{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&&(Kh(this.parent)||"up"!==s.direction||(o=this.offsets[this.getTotalBlocks()]-this.prevHeight,a=this.content.scrollTop,this.content.scrollTop=a+o),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=Math.ceil(this.getTotalBlocks()/2);this.isBottom&&(this.isBottom=!1,this.isBottomNotify=!1,this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-1]),this.parent.pageSettings.currentPage+1!==u&&this.parent.pageSettings.currentPage!==u||2!==l.length||"delete"!==i.requestType||(this.parent.getContent().firstElementChild.scrollTop=this.offsets[this.offsetKeys.length-1]),1!==u&&this.parent.pageSettings.currentPage===u&&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(Jt,{}),this.focusCell(i),this.firstCellFocus&&(this.firstCellFocus=!1,h=(c=this.parent.focusModule).active.matrix.current,t=this.parent.getContentTable().rows[h[0]].cells[h[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||(a=this.parent.element.getBoundingClientRect().top,this.parent.getRowByIndex(0)&&(this.initialRowTop=this.parent.getRowByIndex(0).getBoundingClientRect().top-a))}},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||q.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(T),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&&!q.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("."+cs)&&-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("."+cs)&&!i.length&&(e=!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?this.enableCacheOnInfiniteColumnVirtual()?this.virtualInfiniteData:q.extend({},this.parent.getCurrentViewRecords()[this.editedRowIndex]):q.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("."+us);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){q.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||q.isNullOrUndefined(this.virtualEle.verticalScrollbar)||q.isNullOrUndefined(this.content)||(this.virtualEle.verticalScrollbar.style.width=wh(!0)+1+"px"),!this.parent.enableColumnVirtualization||q.isNullOrUndefined(this.virtualEle.horizontalScrollbar)||q.isNullOrUndefined(this.content)||(this.virtualEle.horizontalScrollbar.style.height=wh(!0)+1+"px")},m.prototype.updateVirtualScrollbar=function(e,t){!this.parent.enableVirtualization||q.isNullOrUndefined(this.virtualEle.verticalScrollbar)||q.isNullOrUndefined(this.virtualEle.verticalScrollerContainer)||q.isNullOrUndefined(this.content)||(this.virtualEle.verticalScrollbar.style.overflowX=this.parent.enableVirtualization&&parseInt(t,10)>this.virtualEle.wrapper.clientWidth?"scroll":"hidden",this.virtualEle.gridContent.style.position="relative",this.virtualEle.verticalScrollerContainer.style.height=q.isNullOrUndefined(e)?"0px":e+"px",this.virtualEle.verticalScrollbar.style.width=wh()+1+"px"),!this.parent.enableColumnVirtualization||q.isNullOrUndefined(this.virtualEle.horizontalScrollbar)||q.isNullOrUndefined(this.virtualEle.horizontalScrollerContainer)||q.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=wh()+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[Kh(this.parent)&&0!==this.count?this.getGroupedTotalBlocks():this.getTotalBlocks()],n=(!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization&&(i=0),Kh(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=q.isNullOrUndefined(i)?"0px":q.formatUnit(this.parent.height)),this.parent.enableColumnVirtualization&&this.header.virtualEle&&this.header.virtualEle.setVirtualHeight(1,t),this.parent.enableSeamlessScrolling&&this.updateVirtualScrollbar(i,t)},m.prototype.getPageFromTop=function(i,n){var r=this,s=Kh(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=Kh(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)&&(!q.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.isFrozenGrid())&&d.resetStickyLeftPos(r)))}},m.prototype.dataBound=function(){this.parent.notify(Wn,{}),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=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=q.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"))&&(a=(l.classList.contains("e-filterbarcell")?l:l.querySelector("[data-mappinguid]")).getAttribute("data-mappinguid"),h=this.parent.getColumnByUid(a)),q.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=id(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=ip(this.prevInfo.blockIndexes)),("sorting"===this.requestType||"delete"===this.requestType)&&i.length&&tp(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=q.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](pt,this.onDataReady,this),this.parent.addEventListener(ae,this.dataBound.bind(this)),this.parent.addEventListener(y,this.actionBegin.bind(this)),this.parent.addEventListener(p,this.actionComplete.bind(this)),this.parent.addEventListener(he,this.rowSelected.bind(this)),this.parent[""+e](Wt,this.refreshContentRows,this),this.parent[""+e](Lr,this.refreshVirtualLazyLoadCache,this),this.parent[""+e](rn,this.selectVirtualRow,this),this.parent[""+e](fn,this.virtualCellFocus,this),this.parent[""+e](mn,this.editActionBegin,this),this.parent[""+e](bn,this.addActionBegin,this),this.parent[""+e](vn,this.restoreEdit,this),this.parent[""+e](yn,this.editSuccess,this),this.parent[""+e](Cn,this.refreshCache,this),this.parent[""+e](wn,this.resetIsedit,this),this.parent[""+e](In,this.getVirtualData,this),this.parent[""+e](Sn,this.editCancel,this),this.parent[""+e](ur,this.refreshMaxPage,this),this.parent[""+e](gr,this.setVirtualPageQuery,this),this.parent[""+e](fr,this.selectRowOnContextOpen,this),this.parent[""+e](vr,this.resetVirtualFocus,this),this.parent[""+e](Cr,this.refreshCells,this),this.parent[""+e](wr,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(ct,r)};this.parent.on(ct,r,this)}},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;q.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||q.isNullOrUndefined(this.editedRowIndex)||i&&this.isRowInView(i)||(i=this.parent.getRowHeight(),i=this.editedRowIndex*i,q.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=pd(this.parent,e.data);q.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=pd(this.parent,e);q.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(Jn,e)},m.prototype.virtualCellFocus=function(e){var t,i,n,r,s,o=document.activeElement;o.classList.contains(b)||!(o instanceof HTMLInputElement)&&q.isNullOrUndefined(o.closest(".e-templatecell"))||(o=o.closest(".e-rowcell")),this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&o&&(o.classList.contains(b)||!q.isNullOrUndefined(x(o,gs)))&&e&&("shiftEnter"===e.action||"upArrow"===e.action||"downArrow"===e.action)?(t=(i=this.parent.getContent().firstElementChild).getBoundingClientRect(),n=q.closest(o,"tr"),s="downArrow"===e.action?n.nextElementSibling:n.previousElementSibling,r=q.isNullOrUndefined(s)?void 0:s.getBoundingClientRect(),q.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:q.isNullOrUndefined(s),direction:e.action,event:e},s=q.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(T),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(ws),10)-1,n=this.parent.getRowByIndex(t),r=this.parent.pageSettings.currentPage,s=Math.floor(i.offsetHeight/this.parent.getRowHeight())-1,o=!1,(o=q.isNullOrUndefined(n)&&(o=!0,"downArrow"===e.action&&r===this.maxPage-1||("upArrow"===e.action||"shiftEnter"===e.action)&&1===r)?!1:o)||ld(n,this.parent)&&"downArrow"===e.action||hd(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?q.extend({},this.parent.getCurrentViewRecords()[e.index]):q.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)&&((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("."+cs),e=this.parent.element.querySelector("."+us),t||e)&&(e=t?q.extend({},this.getRowObjectByIndex(this.editedRowIndex)):q.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=Kh(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 gc(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&&!q.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(Kh(this.parent))if(!q.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(T),10)-1===t&&(e=this.parent.getDataRows()[parseInt(i.toString(),10)]);else e=q.isNullOrUndefined(t)?void 0:this.parent.getDataRows()[parseInt(t.toString(),10)];else!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization?e=q.isNullOrUndefined(t)?void 0:this.enableCacheOnInfiniteColumnVirtual()?this.parent.getDataRows().find(function(e){return parseInt(e.getAttribute(T),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&&(i=parseInt(this.parent.getRows()[0].getAttribute(T),10)-1,s=s.filter(function(e){return q.isNullOrUndefined(e.items)})),s[e-(i=!t&&this.parent.allowGrouping&&this.parent.groupSettings.columns.length&&n.length?parseInt(n[0].getAttribute(T),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(q.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=Kh(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=Kh(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=!Kh(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),Kh(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&&q.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(en,{rows:n,args:{isFrozen:!1,rows:n}}):this.refreshContentRows({requestType:"refresh"})},m.prototype.selectVirtualRow=function(t){var e,i,n=this,r=Kh(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,Kh(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]]),q.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=yc.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 Ic,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,e.virtualData={},e.virtualInfiniteData={},e.emptyRowData={},e.isContextMenuOpen=!1,e.isSelectionScroll=!1,e.validationCheck=!1,e.firstCellFocus=!1,e.prevPage=0,e.prevCurrentInfo={},e.locator=t,e.eventListener("on"),e.widthServices=t.getService("widthService"),e.parent.on(Bt,e.setVisible,e),e.vgenerator=e.generator,e}Sc(bc,Cc=Zs),bc.prototype.renderTable=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector("."+rs))),Cc.prototype.renderTable.call(this),this.virtualEle.table=this.getTable(),this.virtualEle.content=this.getPanel().querySelector("."+rs),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()},bc.prototype.appendContent=function(e){this.virtualEle.wrapper.appendChild(e)},bc.prototype.refreshUI=function(){this.gen.refreshColOffsets(),this.parent.setColumnIndexesInView(this.gen.getColumnIndexes(this.getPanel().querySelector("."+rs))),Cc.prototype.refreshUI.call(this)},bc.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)&&q.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()}},bc.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){q.setStyleAttribute(s,{display:t}),""===t&&q.removeClass([s],"e-hide");break}}};var Cc,wc=bc;function bc(e,t){var i=Cc.call(this,e,t)||this;return i.virtualEle=new Ic,i.isMovable=!1,i.gen=new gc(i.parent),i.parent.on(Bt,i.setVisible,i),i.parent.on(Wt,function(e){return"X"===e.virtualInfo.sentinelInfo.axis?i.refreshUI():null},i),i}xc.prototype.renderWrapper=function(e){this.wrapper=q.createElement("div",{className:"e-virtualtable"}),this.wrapper.style.minHeight=q.formatUnit(e),this.wrapper.appendChild(this.table),this.content.appendChild(this.wrapper)},xc.prototype.renderPlaceHolder=function(e){void 0===e&&(e="relative"),this.placeholder=q.createElement("div",{className:"e-virtualtrack"}),this.placeholder.style.position=e,this.content.appendChild(this.placeholder)},xc.prototype.renderVerticalScrollbar=function(){this.verticalScrollbar=q.createElement("div",{className:"e-virtual-vertical-scrollbar"}),this.gridContent.appendChild(this.verticalScrollbar),this.verticalScrollerContainer=q.createElement("div",{className:"e-virtual-vertical-track"}),this.verticalScrollbar.appendChild(this.verticalScrollerContainer)},xc.prototype.renderHorizontalScrollbar=function(){this.horizontalScrollbar=q.createElement("div",{className:"e-virtual-horizontal-scrollbar"}),this.gridContent.appendChild(this.horizontalScrollbar),this.horizontalScrollerContainer=q.createElement("div",{className:"e-virtual-horizontal-track"}),this.horizontalScrollbar.appendChild(this.horizontalScrollerContainer)},xc.prototype.renderFrozenWrapper=function(e){this.wrapper=q.createElement("div",{className:"e-virtualtable"}),this.wrapper.style.cssText="min-height:"+q.formatUnit(e)+"; display: flex;",this.content.appendChild(this.wrapper)},xc.prototype.renderFrozenPlaceHolder=function(){this.placeholder=q.createElement("div",{className:"e-virtualtrack"}),this.content.appendChild(this.placeholder)},xc.prototype.adjustTable=function(e,t){this.wrapper.style.transform=rp?"translate3d("+e+"px, "+t+"px, 0px) translateZ(0)":"translate("+e+"px, "+t+"px)"},xc.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%":""},xc.prototype.setVirtualHeight=function(e,t){this.placeholder.style.height=q.isNullOrUndefined(e)?"0px":e+"px",!t||-1!==t.indexOf("%")||this.content.getBoundingClientRect().width<parseInt(t,10)||(t="100%"),this.placeholder.style.width=t},xc.prototype.setFreezeWrapperWidth=function(e,t,i){e.style.width=t?t+"px":i?"100%":""};var Ic=xc;function xc(){}Rc.prototype.getModuleName=function(){return"virtualscroll"},Rc.prototype.instantiateRenderer=function(){this.parent.log(["limitation","virtual_height"],"virtualization");var e=this.locator.getService("rendererFactory");this.parent.enableColumnVirtualization&&e.addRenderer(N.RenderType.Header,new wc(this.parent,this.locator)),e.addRenderer(N.RenderType.Content,new vc(this.parent,this.locator)),!this.parent.enableVirtualization&&this.parent.enableColumnVirtualization||this.ensurePageSize()},Rc.prototype.ensurePageSize=function(){var e=this.parent.getRowHeight(),t=(this.parent.height.toString().indexOf("%")<0?this.parent:this.parent.element.getBoundingClientRect()).height,t=(this.blockSize=~~(parseFloat(t.toString())/e),2*this.blockSize),e=this.parent.pageSettings.pageSize;this.parent.setProperties({pageSettings:{pageSize:e<t?t:e}},!0)},Rc.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ht,this.instantiateRenderer,this),this.parent.on(qt,this.refreshVirtualElement,this),this.parent.on(Ir,this.createVirtualValidationForm,this),this.parent.on(xr,this.virtualEditFormValidation,this),this.parent.on(s,this.destroy,this))},Rc.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ht,this.instantiateRenderer),this.parent.off(qt,this.refreshVirtualElement),this.parent.off(Ir,this.createVirtualValidationForm),this.parent.off(xr,this.virtualEditFormValidation),this.parent.off(s,this.destroy))},Rc.prototype.getCurrentEditedData=function(e,t){e={virtualData:q.extend({},{},e,!0),isAdd:!1,isScroll:!1,endEdit:!0};return this.parent.notify(In,e),t?e:e.virtualData},Rc.prototype.createVirtualValidationForm=function(e){var t=this.parent;if(t.enableVirtualization&&"Normal"===t.editSettings.mode){for(var i=t.columns,n=new Ls(this.locator,null,this.parent),r=q.extend({},{},t.getRowObjectFromUID(e.uid),!0),s=(t.notify(Cr,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&&Md(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)}},Rc.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++)q.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}))}},Rc.prototype.scrollToEdit=function(e,t,i){var n=this.parent;if(e){var r=n.columnModel,s=Th(e.id).split("_")[0],o=n.getColumnByField(s),e=this.parent.getContent().firstElementChild.scrollTop,n=n.getRowByIndex(t.editIdx);if(!q.isNullOrUndefined(t.addIdx)&&0<e||!q.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(wr,a=i?o:a)}}},Rc.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=xh(i[parseInt(n.toString(),10)].field);q.isNullOrUndefined(o)||(o=e[o],s=q.getValue(i[parseInt(n.toString(),10)].field,t),s=q.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()))}},Rc.prototype.setEditedDataToValidationForm=function(e,t){for(var i=[].slice.call(e.getElementsByClassName("e-field")),n=0,r=i.length;n<r;n++){var s=Ud(this.parent,i[parseInt(n.toString(),10)].getAttribute("data-mappinguid"));s.field&&(s=q.getValue(s.field,t),s=q.isNullOrUndefined(s)?"":s,i[parseInt(n.toString(),10)].value=s)}this.setEditedDataToTemplate(e,t)},Rc.prototype.refreshVirtualElement=function(e){this.parent.enableColumnVirtualization&&"resize"===e.module&&this.locator.getService("rendererFactory").getRenderer(N.RenderType.Content).refreshVirtualElement()},Rc.prototype.destroy=function(){this.removeEventListener()};Sc=Rc;function Rc(e,t){this.parent=e,this.locator=t,this.addEventListener()}Dc.prototype.addNew=function(e,t){var i,n;this.isEdit=!1,i=((this.parent.frozenRows||(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.parent.editSettings.showAddNewRow)&&"Top"===this.parent.editSettings.newRowPosition?this.parent.getHeaderTable():this.parent.getContentTable()).querySelector(H),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.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)},Dc.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(cs),this.parent.editModule.checkLastRow(t.row,t)},Dc.prototype.getEditElement=function(e,t,i,n,r){var s=this.parent,o=0,a=q.isNullOrUndefined(s.detailTemplate)&&q.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(bs).cloneNode(!0)),this.parent.createElement(H,{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=t&&i[parseInt(u.toString(),10)]?i[parseInt(u.toString(),10)].getAttribute("colspan"):null,S=f[parseInt(c.toString(),10)],v=e[S.uid].value,C=(v=q.isNullOrUndefined(v)?"":v,this.parent.createElement("td",{className:b,attrs:{colspan:y||""}}));C.style.cssText=S.textAlign?"text-align: "+S.textAlign+";":"",S.visible?(C.appendChild(e[S.uid]),"Vertical"===this.parent.rowRenderingMode&&(ih(C,{"data-cell":S.headerText}),0===c)&&C.classList.add("e-responsive-editcell"),"booleanedit"===S.editType?C.classList.add("e-boolcell"):(S.commands||S.commandsTemplate)&&q.addClass([C],"e-unboundcell"),this.parent.enableRtl||"Vertical"!==s.gridLines&&"Both"!==s.gridLines||!g||(o?C.classList.add("e-grid-group-first-cell"):this.parent.renderModule&&this.parent.renderModule.isFirstColumnHidden&&!(this.parent.allowRowDragAndDrop||this.parent.childGrid||this.parent.detailTemplate)&&C.classList.add("e-first-visible-cell"),g=!1)):C.classList.add("e-hide"),this.parent.isFrozenGrid()&&(kd(this.parent,S,C),this.parent.isSpan&&(m=C.getAttribute("colspan")?parseInt(C.getAttribute("colspan"),10):1,Ed(this.parent,S,C,m)),this.parent.enableColumnVirtualization)&&("Left"!==S.freeze||q.isNullOrUndefined(S.valueX)?"Right"!==S.freeze||q.isNullOrUndefined(S.valueX)?"Fixed"===S.freeze&&(C.style.left=this.parent.leftrightColumnWidth("left")-this.parent.translateX+"px",C.style.right=this.parent.leftrightColumnWidth("right")+this.parent.translateX+"px"):C.style.right=S.valueX+this.parent.translateX+"px":C.style.left=S.valueX-this.parent.translateX+"px"),C.setAttribute("aria-label",v+this.parent.localeObj.getConstant("ColumnHeader")+S.headerText),p.appendChild(C),c=y?c+parseInt(y,10):c+1,u++}Td(p),d.appendChild(p),r.appendChild(d),h.appendChild(r)}return l.appendChild(h),l},Dc.prototype.removeEventListener=function(){},Dc.prototype.appendChildren=function(e,t,i){t=q.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?fh(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 Tc=Dc;function Dc(e){this.parent=e}Oc.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"),q.classList(t.row,[cs,"e-batchrow"],[])},Oc.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 Ec=Oc;function Oc(e){this.parent=e}Ac.prototype.setLocaleObj=function(){this.l10n=this.serviceLocator.getService("localization")},Ac.prototype.addNew=function(e,t){this.isEdit=!1,this.createDialog(e,t)},Ac.prototype.update=function(e,t){this.isEdit=!0,this.createDialog(e,t)},Ac.prototype.createDialogHeader=function(e){var t,i=this,n=this.parent;return this.parent.enableAdaptiveUI?((t=new ea(this.parent,this.serviceLocator)).action=this.isEdit?N.ResponsiveDialogAction.isEdit:N.ResponsiveDialogAction.isAdd,t.renderResponsiveHeader(void 0,e)):n.editSettings.headerTemplate?q.initializeCSPTemplate(function(){return i.getDialogEditTemplateElement("HeaderTemplate",e).outerHTML}):this.isEdit?this.l10n.getConstant("EditFormTitle")+e.primaryKeyValue[0]:this.l10n.getConstant("AddFormTitle")},Ac.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(q.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?q.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(),Cd(this.parent,this.dialogObj),this.dialogObj.appendTo(this.dialog),nd(this.parent.element,this.dialogObj.element.parentElement),n.enableAdaptiveUI&&this.dialogObj.show(!0)},Ac.prototype.dialogCreated=function(){Pd(this.parent)},Ac.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%"})},Ac.prototype.btnClick=function(e){this.l10n.getConstant("CancelButton").toLowerCase()===e.target.innerText.trim().toLowerCase()?this.dialogClose():this.parent.endEdit()},Ac.prototype.dialogClose=function(){this.parent.closeEdit()},Ac.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,q.updateBlazorTemplate(i,t,this.parent.editSettings));this.parent.notify(ai,{}),this.parent.isEdit=!1,this.parent.notify(Xt,{}),this.dialog&&!this.dialogObj.isDestroyed&&(this.dialogObj.destroy(),q.remove(this.dialog))},Ac.prototype.getDialogEditTemplateElement=function(e,t){var i=this.parent.createElement("div",{className:"e-dialog"+e}),t=q.extend({},t.rowData,{isAdd:!this.isEdit},!0),n=this.parent.element.id+"editSettings"+e;return fh(i,("HeaderTemplate"===e?this.parent.getEditHeaderTemplate():this.parent.getEditFooterTemplate())(t,this.parent,"editSettings"+e,n)),q.updateBlazorTemplate(n,e,this.parent.editSettings),i},Ac.prototype.getEditElement=function(e,t){var i,n,r=this,s=this.parent,o=this.parent.createElement("div",{className:this.isEdit?cs:"e-insertedrow"}),a=t.form=this.parent.createElement("form",{id:s.element.id+"EditForm",className:"e-gridform"});if(this.parent.editSettings.template)i=this.parent.element.id+"editSettingsTemplate",t=q.extend({},t.rowData,{isAdd:!this.isEdit},!0),d=this.parent.isReact&&"string"!=typeof this.parent.editSettings.template&&!(this.parent.editSettings.template.prototype&&this.parent.editSettings.template.prototype.CSPTemplate),n=this.parent.parentDetails&&this.parent.parentDetails.parentInstObj&&this.parent.parentDetails.parentInstObj.isReact,d||n?(this.parent.getEditTemplate()(t,this.parent,"editSettingsTemplate",i,null,null,a),this.parent.renderTemplates()):fh(a,this.parent.getEditTemplate()(t,this.parent,"editSettingsTemplate",i,null,null,null,s.root)),q.updateBlazorTemplate(i,"Template",this.parent.editSettings,!0,function(){for(var e=r.parent.getColumns(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].validationRules&&(r.parent.editModule.formObj.rules[e[parseInt(t.toString(),10)].field]=e[parseInt(t.toString(),10)].validationRules)});else{for(var l,h,d=this.parent.createElement("table",{className:ds,attrs:{cellspacing:"6px",role:"grid"}}),p=this.parent.createElement(H,{attrs:{role:"rowgroup"}}),c=s.getColumns(),u=0;u<c.length;u++)this.parent.editModule.checkColumnIsGrouped(c[parseInt(u.toString(),10)])||c[parseInt(u.toString(),10)].commands||c[parseInt(u.toString(),10)].commandsTemplate||"checkbox"===c[parseInt(u.toString(),10)].type||(l=this.parent.createElement("tr",{attrs:{role:"row"}}),(h=this.parent.createElement("td",{className:b})).style.cssText="text-align: "+(this.parent.enableRtl?"right":"left")+"; width: 190px;",e[c[parseInt(u.toString(),10)].uid].classList.remove("e-input"),h.appendChild(e[c[parseInt(u.toString(),10)].uid]),l.appendChild(h),p.appendChild(l));d.appendChild(p),a.appendChild(d)}return o.appendChild(a),o},Ac.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ri,this.destroy),this.parent.off(s,this.destroy))};var kc=Ac;function Ac(e,t){this.parent=e,this.serviceLocator=t,this.parent.isDestroyed||(this.parent.on(ri,this.destroy,this),this.parent.on(s,this.destroy,this))}Mc.prototype.addNew=function(e){this.renderer.addNew(this.getEditElements(e),e),this.convertWidget(e)},Mc.prototype.update=function(e){this.renderer.update(this.getEditElements(e),e),e.isCustomFormValidation||(this.parent.notify(Ji,e),this.convertWidget(e))},Mc.prototype.convertWidget=function(e){for(var t,i=this.parent,n="Dialog"===i.editSettings.mode?q.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?i.getColumns():[i.getColumnByField(e.columnName)];r<s.length;r++){var o,a,l=s[r];this.parent.editSettings.template&&!q.isNullOrUndefined(l.field)?((o=q.extend({},e)).element=n.querySelector("[name="+xh(l.field)+"]"),"string"==typeof l.edit.write?Wh(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="+l.uid+"]"),a=l.edit.write,q.isNullOrUndefined(o))||("string"==typeof a?(a=Wh(a,window))({rowData:e.rowData,element:o,column:l,requestType:e.requestType,row:e.row,foreignKeyData:l.isForeignColumn()&&Wh(l.field,e.foreignKeyData)}):l.edit.write({rowData:e.rowData,element:o,column:l,requestType:e.requestType,row:e.row,foreignKeyData:l.isForeignColumn()&&Wh(l.field,e.foreignKeyData)}),t)||!q.isNullOrUndefined(o.getAttribute("disabled"))||x(o,"e-checkbox-disabled")||(a=!q.isNullOrUndefined(l.edit)&&!q.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)}},Mc.prototype.focusElement=function(e,t){var i,n=this.parent.element.querySelector(".e-edit-checkselect");!q.isNullOrUndefined(n)&&n.nextElementSibling&&n.nextElementSibling.classList.add("e-focus"),"Batch"===this.parent.editSettings.mode?this.focus.onClick({target:q.closest(e,"td")},!0):(n=!this.parent.enableVirtualization&&!this.parent.enableColumnVirtualization||"Normal"!==this.parent.editSettings.mode,i=e.classList.contains("e-dropdownlist")?e.parentElement:e,(n||(this.parent.enableVirtualization||this.parent.enableColumnVirtualization)&&"Bottom"===this.parent.editSettings.newRowPosition&&x(e,us))&&(!this.parent.editSettings.showAddNewRow||this.parent.editSettings.showAddNewRow&&!x(e,us)||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)},Mc.prototype.getEditElements=function(e){var t=this.parent,i={},n="Batch"!==t.editSettings.mode?t.getColumns():[t.getColumnByField(e.columnName)];if(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 Ns(this.parent),o=o.getCellRenderer(N.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(T),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()+"-"+Gh(o.getMonth()+1)+"-"+Gh(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=Jh({},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()(q.extend({index:e.rowIndex},p),this.parent,"editTemplate",d,null,null,h),this.parent.renderTemplates()):fh(h,f.getEditTemplate()(q.extend({index:e.rowIndex},p),this.parent,"editTemplate",d,null,null,null,t.root))):("string"==typeof(h="string"==typeof l?(l=Wh(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=xh(f.field),q.attributes(u?h.querySelector("input"):h,{name:g,"data-mappinguid":f.uid,id:t.element.id+g}),q.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},Mc.prototype.destroy=function(){this.renderer.removeEventListener()};var Fc=Mc;function Mc(e,t){this.editType={Inline:Tc,Normal:Tc,Batch:Ec,Dialog:kc},this.parent=e,this.serviceLocator=t,this.renderer=new this.editType[this.parent.editSettings.mode](e,t),this.focus=t.getService("focus")}Pc.prototype.create=function(e){return qd(this.parent,e.column,"e-field",{type:"text"})},Pc.prototype.read=function(e){return e.ej2_instances[0].value},Pc.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.removeEventHandler&&this.removeEventHandler(),this.obj.destroy(),this.obj.element.remove())};var Lc=Pc;function Pc(e){this.parent=e}Nc=function(e,t){return(Nc=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}Nc(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(qc,Bc=Lc),qc.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,qd(this.parent,e.column,t,{type:"checkbox",value:e.value})},qc.prototype.read=function(e){return e.checked},qc.prototype.write=function(e){var t,i;q.isNullOrUndefined(e.row)||(t=e.row.querySelector(".e-edit-checkselect")),Wh(e.column.field,e.rowData)&&(i=JSON.parse(Wh(e.column.field,e.rowData).toString().toLowerCase())),q.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),Fh.apply(void 0,[[].slice.call(e.row.getElementsByClassName(b)),i].concat(this.activeClasses))),this.obj=new M.CheckBox(q.extend({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:i,disabled:!Dh(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)},qc.prototype.addEventListener=function(){this.cbChange=this.checkBoxChange.bind(this),this.obj.addEventListener(xs,this.cbChange)},qc.prototype.removeEventListener=function(){this.obj.isDestroyed||this.obj.removeEventListener(xs,this.cbChange)},qc.prototype.checkBoxChange=function(e){var t;this.editRow&&"Dialog"!==this.editType&&this.editRow.getAttribute("aria-rowindex")&&(t=parseInt(this.editRow.getAttribute("aria-rowindex"),10)-1,this.parent.selectionModule.addRowsToSelection([t]))};var Nc,Bc,zc=qc;function qc(){var e=null!==Bc&&Bc.apply(this,arguments)||this;return e.activeClasses=["e-selectionbackground","e-active"],e}Uc=function(e,t){return(Uc=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}Uc(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Vc,Hc=Lc),Vc.prototype.write=function(e){var t="Dialog"!==this.parent.editSettings.mode,i=(this.column=e.column,new U.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(q.extend({dataSource:this.parent.dataSource instanceof U.DataManager?this.parent.dataSource:new U.DataManager(this.parent.dataSource),query:(new U.Query).where(i).select(e.column.field),enabled:Dh(e.column,e.requestType,e.element)&&Eh(x(e.element,"e-rowcell"),this.parent),fields:{value:e.column.field},value:Wh(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=wd(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",xh(e.column.field))},Vc.prototype.dropDownClose=function(e){e.event&&("escape"===e.event.action?this.parent.editModule.editCellDialogClose=!0:this.parent.isEdit&&"Batch"===this.parent.editSettings.mode&&"enter"===e.event.action&&e.event.stopPropagation())},Vc.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(Ts,this.ddCreated),this.obj.addEventListener(Is,this.ddOpen),this.obj.addEventListener(Ds,this.ddBeforeOpen),this.obj.addEventListener(p,this.ddComplete)},Vc.prototype.removeEventListener=function(){this.obj.isDestroyed||(this.obj.removeEventListener(Ts,this.ddCreated),this.obj.removeEventListener(Is,this.ddOpen),this.obj.removeEventListener(Ds,this.ddBeforeOpen),this.obj.removeEventListener(p,this.ddComplete))},Vc.prototype.dropdownCreated=function(e){this.flag=!0},Vc.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 U.DataManager?this.column.dataSource:new U.DataManager(this.column.dataSource):this.parent.dataSource instanceof U.DataManager?this.parent.dataSource:new U.DataManager(this.parent.dataSource))},Vc.prototype.ddActionComplete=function(e){e.result=U.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 U.DataManager&&(this.column.dataSource.dataSource.json=e.result)),this.flag=!1},Vc.prototype.dropDownOpen=function(e){var t=x(this.obj.element,"e-dialog");"Dialog"!==this.parent.editSettings.mode||q.isNullOrUndefined(t)||(t=q.select("#"+t.id,document).ej2_instances[0],e.popup.element.style.zIndex=(t.zIndex+1).toString())};var Uc,Hc,jc=Vc;function Vc(e){var t=Hc.call(this)||this;return t.parent=e,t.flag=!1,t.removeEventHandler=t.removeEventListener,t}_c.prototype.keyEventHandler=function(e){13!==e.keyCode&&9!==e.keyCode||((e=document.createEvent("HTMLEvents")).initEvent("change",!1,!0),this.dispatchEvent(e))},_c.prototype.create=function(e){return this.instances=new q.Internationalization(this.parent.locale),qd(this.parent,e.column,"e-field",{})},_c.prototype.read=function(e){return this.obj.value},_c.prototype.write=function(e){var t=e.column,i="Dialog"!==this.parent.editSettings.mode;this.obj=new L.NumericTextBox(q.extend({value:parseFloat(Wh(e.column.field,e.rowData)),enableRtl:this.parent.enableRtl,placeholder:i?"":e.column.headerText,enabled:Dh(e.column,e.requestType,e.element)&&Eh(x(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",xh(e.column.field)),this.obj.appendTo(e.element),this.obj.element.addEventListener("keydown",this.keyEventHandler)},_c.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.obj.element.removeEventListener("keydown",this.keyEventHandler),this.obj.destroy(),this.obj.element.remove())};var Gc=_c;function _c(e){this.parent=e}Kc=function(e,t){return(Kc=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}Kc(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Xc,Wc=Lc),Xc.prototype.create=function(e){var t={type:"text",value:q.isNullOrUndefined(e.value)?"":e.value},t=qd(this.parent,e.column,"e-field e-input e-defaultcell",t);return e.column.textAlign&&(t.style.textAlign=e.column.textAlign),t},Xc.prototype.read=function(e){return("hidden"!==e.type||q.isNullOrUndefined(e.ej2_instances[0])||q.isNullOrUndefined(e.ej2_instances[0].textarea)?e:e.ej2_instances[0]).value},Xc.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:Dh(e.column,e.requestType,e.element)&&Eh(x(e.element,"e-rowcell"),this.parent),placeholder:n?"":e.column.headerText,cssClass:this.parent.cssClass||""};q.isNullOrUndefined(i.edit)||q.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 L.TextBox(q.extend(n,i.edit.params)),this.obj.appendTo(e.element),q.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)},Xc.prototype.keyEventHandler=function(e){"Enter"!==e.key&&"Tab"!==e.key||(e=new Event("change",{bubbles:!1,cancelable:!0}),this.dispatchEvent(e))},Xc.prototype.destroy=function(){this.obj&&!this.obj.isDestroyed&&(this.obj.element.removeEventListener("keydown",this.keyEventHandler),this.obj.destroy(),this.obj.element.remove())};var Kc,Wc,Qc=Xc;function Xc(){return null!==Wc&&Wc.apply(this,arguments)||this}Jc.prototype.clickHandler=function(e){var e=e.target,t=this.parent;t.editSettings.showAddNewRow&&q.isNullOrUndefined(t.element.querySelector("."+cs))||(x(e,is)&&x(x(e,is),"e-grid").id===t.element.id||(t.frozenRows||t.pinnedTopRecords.length)&&x(e,rs)&&!x(e,"e-columnheader"))&&!x(e,"e-unboundcelldiv")&&(this.rowIndex=x(e,b)?parseInt(x(e,b).parentElement.getAttribute(T),10)-1:-1,t.isEdit)&&t.editModule.endEdit()},Jc.prototype.dblClickHandler=function(e){!x(e.target,b)||!this.parent.editSettings.allowEditOnDblClick||this.parent.editSettings.showAddNewRow&&(!this.parent.editSettings.showAddNewRow||x(e.target,"e-addedrow"))||e.target&&(e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-treegridexpand"))||this.parent.editModule.startEdit(x(e.target,I))},Jc.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(p,q.extend(e,{requestType:"save",type:p})),this.parent.notify(Sr,{requestType:"save",action:e[t]});break;case"delete":this.parent.trigger(p,q.extend(e,{requestType:"delete",type:p})),this.parent.isCheckBoxSelection||this.parent.enableInfiniteScrolling&&(this.parent.childGrid||this.parent.detailTemplate)||this.parent.selectRow(this.editRowIndex),this.parent.notify(Sr,{requestType:"delete",action:e[t]});break;case"refresh-aggregate-on-save":this.parent.trigger(p,q.extend(e,{requestType:"refresh-aggregate-on-save",type:p})),this.parent.selectRow(this.rowIndex),this.parent.notify(Sr,{requestType:"refresh-aggregate-on-save",action:e[t]})}},Jc.prototype.getEditArgs=function(e,t,i){for(var n=this.parent.getPrimaryKeyFieldNames(),r=[],s=0;s<n.length;s++)r.push(Wh(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}},Jc.prototype.startEdit=function(t){var i=this,n=this.parent;if(this.rowIndex=this.editRowIndex=parseInt(t.getAttribute(T),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(mn,e),Kh(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=q.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)),q.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(Ir,{uid:this.uid,prevData:this.previousData,argsCreator:this.getEditArgs.bind(this),renderer:this.renderer}),n.trigger(qe,r,function(e){e.type="actionBegin",n.trigger(y,e,function(e){e.cancel||i.inlineEditHandler(e,t)})}))},Jc.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=x(o,"e-rowcell").querySelector(".e-error");l&&l.classList.remove("e-error"),o.ej2_instances?(t&&q.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||q.isNullOrUndefined(e)?q.isNullOrUndefined(e)||(o.ej2_instances[0].enabled=!(!e||!a.allowEditing)):o.ej2_instances[0].disabled=!e||!a.allowEditing):(t&&o.value&&o.value.length&&q.isNullOrUndefined(a.defaultValue)&&(o.value=null),q.isNullOrUndefined(e)||(e?a.allowEditing&&(o.classList.remove("e-disabled"),o.removeAttribute("disabled")):(o.classList.add("e-disabled"),o.setAttribute("disabled","disabled"))))}},Jc.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(p,e),i.editSettings.template&&i.editModule.applyFormValidation(void 0,e.form.ej2_instances[0].rules),this.args=e,this.parent.allowTextWrap&&this.parent.notify(Ci,{case:"textwrap"})},Jc.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},n.showSpinner(),n.enableInfiniteScrolling&&(this.uid=t.row.getAttribute("data-uid"),e=parseInt(t.row.getAttribute("aria-rowindex"),10)-1,this.parent.notify(Or,{index:e})),n.notify($t,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)))},Jc.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(xr,i),t&&i.isValid},Jc.prototype.endEdit=function(){var e,t,i,n,r,s,o=this,a=this.parent;this.parent.isEdit&&this.editFormValidate()&&(e=q.extend({},{},this.previousData,!0),t=q.extend(this.args,{requestType:"save",type:y,data:e,cancel:!1,previousData:this.previousData,selectedRow:a.selectedRowIndex,foreignKeyData:{}}),i="Dialog"===a.editSettings.mode,n=q.select("#"+a.element.id+"_dialogEdit_wrapper",document),s=i?n.querySelector(".e-gridform"):(a.editSettings.showAddNewRow&&a.element.querySelector("."+cs)?a.element.querySelector("."+cs):a.element).getElementsByClassName("e-gridform")[0],r={virtualData:q.extend({},{},this.previousData,!0),isAdd:!1,isScroll:!1,endEdit:!0},this.parent.enableVirtualization&&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(In,r),(this.parent.enableVirtualization||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(cs)).length,!r.isAdd&&Object.keys(this.currentVirtualData).length&&(s=s||1),(i?n.getElementsByClassName(cs).length:s)?(t.action="edit",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($t,e))})):(t.action="add",t.selectedRow=0,t.index=this.addedRowIndex,a.notify(yn,{}),a.notify(ft,t),this.addedRowIndex=null,t.cancel||this.parent.editSettings.showAddNewRow&&(this.parent.notify(Ur,{}),(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&this.disabledShowAddRow(!0,!0),"Dialog"!==a.editSettings.mode)&&q.isNullOrUndefined(a.editSettings.template)&&(a.editModule.destroyWidgets(),a.editModule.destroyForm())))},Jc.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)&&q.isNullOrUndefined(e.editSettings.template)&&(e.editModule.formObj=null),this.parent.notify(ri,{})},Jc.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()},Jc.prototype.edSucc=function(e,t){this.editSuccess(e,t)},Jc.prototype.edFail=function(e){this.editFailure(e)},Jc.prototype.updateCurrentViewData=function(e){this.parent.enableVirtualization||this.parent.enableInfiniteScrolling||(this.parent.getCurrentViewRecords()[this.editRowIndex]=e)},Jc.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")},Jc.prototype.editSuccess=function(e,l){if(q.isNullOrUndefined(e)||e instanceof Array||(l.data=q.extend({},q.extend({},l.rowData,l.data),e)),this.requestSuccess(l),this.parent.trigger(_e,l),l.type=p,this.parent.isEdit=!!this.parent.editSettings.showAddNewRow,this.parent.renderModule.resetPartialRecords(),this.refreshRow(l.data),this.parent.notify(yn,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&&!q.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];q.isNullOrUndefined(h)||q.isNullOrUndefined(e)||h.parentUid===e.parentUid?!this.parent.groupSettings.enableLazyLoading&&this.parent.aggregates.length&&(this.parent.enableVirtualization||this.parent.allowPaging&&this.parent.groupSettings.disablePageWiseAggregates)?this.parent.notify(ft,{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.enableVirtualization||this.parent.allowPaging&&this.parent.groupSettings.disablePageWiseAggregates)?this.parent.notify(ft,{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(p,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(Sr,{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())},Jc.prototype.closeForm=function(){!this.cloneRow&&this.parent.isEdit&&this.stopEditStatus(),this.cloneRow&&(this.cloneRow.remove(),this.cloneRow=null,this.originalRow.classList.remove("e-hiddenrow"))},Jc.prototype.blazorTemplate=function(){var e=this.parent.getColumns();this.parent.editSettings.template&&"Normal"===this.parent.editSettings.mode&&q.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&&q.updateBlazorTemplate(this.parent.element.id+i.uid,"Template",i,!1),i.editTemplate&&q.updateBlazorTemplate(this.parent.element.id+i.uid+"editTemplate","EditTemplate",i)}},Jc.prototype.editFailure=function(e){e.cancel||(this.parent.removeMaskRow(),this.parent.trigger(oe,{error:e}),this.parent.hideSpinner(),this.parent.log("actionfailure",{error:e}))},Jc.prototype.needRefresh=function(){var e=!0,t=this.parent.element.querySelector(".e-normaledit");return e=!this.parent.enableVirtualization&&!this.parent.infiniteScrollSettings.enableCache||"Normal"!==this.parent.editSettings.mode||t?e:!1},Jc.prototype.refreshRow=function(e){var t=new Ls(this.serviceLocator,null,this.parent),i=this.parent.getRowObjectFromUID(this.uid);if(i){i.changes=e,this.parent.notify(Cn,{data:e}),Hh(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,Hh(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(Td(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")}},Jc.prototype.closeEdit=function(){var i,n,r=this;!this.parent.isEdit||this.parent.editSettings.showAddNewRow&&this.parent.element.querySelector(".e-addedrow")&&q.isNullOrUndefined(this.parent.element.querySelector("."+cs))?this.parent.editSettings.showAddNewRow&&(this.disabledShowAddRow(!0,!0),this.parent.notify(Ur,{})):(i=this.parent,n=q.extend(this.args,{requestType:"cancel",type:y,cancel:!1,data:this.previousData,selectedRow:i.selectedRowIndex}),i.notify(Sn,n),this.blazorTemplate(),i.trigger(y,n,function(e){var t;e.cancel||(r.parent.notify(Vr,n),"Dialog"===r.parent.editSettings.mode&&r.parent.notify(ri,{}),e.type=p,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(p,e))}))},Jc.prototype.addRecord=function(e,t){var i=this,n=this.parent;if(this.addedRowIndex=t=q.isNullOrUndefined(t)?0:t,e)n.notify(ft,{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(In,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)),U.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(Ir,{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)})}},Jc.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&&(t=this.parent.getHeaderContent().querySelector(".e-checkselectall"))&&t.parentElement.classList.add("e-checkbox-disabled"),i.editModule.applyFormValidation(),e.type=p,e.row=i.element.querySelector("."+us),i.editSettings.showAddNewRow||i.trigger(p,e),i.editSettings.template&&i.editModule.applyFormValidation(void 0,e.form.ej2_instances[0].rules),this.args=e},Jc.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)]===Wh(n,e)||r[parseInt(t.toString(),10)]===e});r[parseInt(t.toString(),10)]=e?i:r[parseInt(t.toString(),10)][""+n]?r[parseInt(t.toString(),10)]:((e={})[n]=r[parseInt(t.toString(),10)],e)}(t)}var i={requestType:"delete",type:y,foreignKeyData:{},data:r||this.parent.getSelectedRecords(),tr:this.parent.getSelectedRows(),cancel:!1},o=(q.isNullOrUndefined(this.parent.commandDelIndex)||(i.data[0]=this.parent.getRowObjectFromUID(this.parent.getRowByIndex(this.parent.commandDelIndex).getAttribute("data-uid")).data),i.data);if(this.parent.pinnedTopRecords.length&&o.length)for(var a=this.parent.getPrimaryKeyFieldNames()[0],l=this,h=0,d=o;h<d.length;h++)!function(t){var e=l.parent.pinnedTopRecords.findIndex(function(e){return e[""+a]===t[""+a]});-1!==e&&l.parent.pinnedTopRowKeys[t[""+a]]&&(l.parent.pinnedTopRecords.splice(e,1),l.parent.pinnedTopRowKeys[t[""+a]]=!1)}(d[h]);this.parent.notify(ft,i)},Jc.prototype.stopEditStatus=function(){for(var e=this.parent,t=[].slice.call(e.editSettings.showAddNewRow?[]:e.element.getElementsByClassName(us)),i=[].slice.call(e.element.getElementsByClassName(cs)),n=0;n<t.length;n++)q.remove(t[parseInt(n.toString(),10)]);for(n=0;n<i.length;n++)i[parseInt(n.toString(),10)].classList.remove(cs)},Jc.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:si,handler:this.editHandler},{event:li,handler:this.dblClickHandler},{event:Nt,handler:this.clickHandler},{event:Ui,handler:this.requestSuccess},{event:Qt,handler:this.dblClickHandler},{event:ti,handler:this.editComplete},{event:ei,handler:this.editComplete},{event:pr,handler:this.closeEdit},{event:yr,handler:this.closeForm},{event:ii,handler:this.editComplete}],zd(this.parent,this.evtHandlers,!0,this))},Jc.prototype.removeEventListener=function(){this.parent.isDestroyed||zd(this.parent,this.evtHandlers,!1)},Jc.prototype.destroy=function(){this.removeEventListener(),this.renderer.destroy()};var Yc=Jc;function Jc(e,t,i){this.args={},this.currentVirtualData={},this.parent=e,this.renderer=i,this.serviceLocator=t,this.addEventListener()}Zc=function(e,t){return(Zc=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}Zc(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(tu,$c=Yc),tu.prototype.closeEdit=function(){$c.prototype.closeEdit.call(this)},tu.prototype.addRecord=function(e,t){$c.prototype.addRecord.call(this,e,t)},tu.prototype.endEdit=function(){$c.prototype.endEdit.call(this)},tu.prototype.updateRow=function(e,t){$c.prototype.updateRow.call(this,e,t)},tu.prototype.deleteRecord=function(e,t){$c.prototype.deleteRecord.call(this,e,t)},tu.prototype.startEdit=function(e){$c.prototype.startEdit.call(this,e)};var Zc,$c,eu=tu;function tu(e,t,i){var n=$c.call(this,e,t)||this;return n.parent=e,n.serviceLocator=t,n.renderer=i,n}v.prototype.addEventListener=function(){this.parent.isDestroyed||(this.evtHandlers=[{event:Nt,handler:this.clickHandler},{event:Qt,handler:this.dblClickHandler},{event:Mt,handler:this.onBeforeCellFocused},{event:Lt,handler:this.onCellFocused},{event:li,handler:this.dblClickHandler},{event:Pt,handler:this.keyDownHandler},{event:ji,handler:this.editNextValCell},{event:s,handler:this.destroy}],zd(this.parent,this.evtHandlers,!0,this),q.EventHandler.add(this.parent.element,"mousedown",this.mouseDownHandler,this),this.dataBoundFunction=this.dataBound.bind(this),this.batchCancelFunction=this.batchCancel.bind(this),this.parent.addEventListener(ae,this.dataBoundFunction),this.parent.addEventListener(Le,this.batchCancelFunction))},v.prototype.removeEventListener=function(){this.parent.isDestroyed||(zd(this.parent,this.evtHandlers,!1),q.EventHandler.remove(this.parent.element,"mousedown",this.mouseDownHandler),this.parent.removeEventListener(ae,this.dataBoundFunction),this.parent.removeEventListener(Le,this.batchCancelFunction))},v.prototype.batchCancel=function(){this.parent.focusModule.restoreFocus({requestType:"batchCancel"})},v.prototype.dataBound=function(){this.parent.notify(Xt,{})},v.prototype.destroy=function(){this.removeEventListener()},v.prototype.mouseDownHandler=function(e){q.isNullOrUndefined(this.parent.element.querySelector(".e-gridform"))?this.mouseDownElement=void 0:this.mouseDownElement=e.target},v.prototype.clickHandler=function(e){x(e.target,this.parent.element.id+"_add",!0)||((this.parent.isEdit&&q.closest(this.form,"td")!==q.closest(e.target,"td")&&q.isNullOrUndefined(this.mouseDownElement)||this.mouseDownElement===e.target)&&(this.saveCell(),this.editNextValCell()),x(e.target,b)&&!this.parent.isEdit&&this.setCellIdx(e.target))},v.prototype.dblClickHandler=function(e){var t=x(e.target,b),e=x(e.target,I),e=e&&parseInt(e.getAttribute(T),10)-1,i=t&&parseInt(t.getAttribute(ws),10)-1;q.isNullOrUndefined(t)||q.isNullOrUndefined(e)||isNaN(i)||t.parentElement.classList.contains(cs)||!this.parent.getColumns()[parseInt(i.toString(),10)].allowEditing||this.editCell(e,this.parent.getColumns()[parseInt(i.toString(),10)].field,this.isAddRow(e))},v.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())},v.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(q.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)switch(r=r&&!this.validateFormObj(),e.keyArgs.action){case"tab":case"shiftTab":var s=this.parent.isRowDragable()&&this.parent.isDetail()?2:this.parent.isRowDragable()||this.parent.isDetail()?1:0,s=this.parent.getColumns()[n-s];s&&!this.parent.isEdit&&this.editCell(i,s.field),(r||this.parent.isLastCellPrimaryKey)&&this.editCellFromIndex(i,n);break;case"enter":case"shiftEnter":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()}}},v.prototype.isAddRow=function(e){return this.parent.getDataRows()[parseInt(e.toString(),10)].classList.contains("e-insertedrow")},v.prototype.editCellFromIndex=function(e,t){this.cellDetails.rowIndex=e,this.cellDetails.cellIndex=t,this.editCell(e,this.parent.getColumns()[parseInt(t.toString(),10)].field,this.isAddRow(e))},v.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(Zi,i),!i.cancel){e.isEdit&&this.saveCell(!0),this.isAdded=!1;i=[];e.selectionModule&&(i=e.selectionModule.selectedRowIndexes),e.clearSelection();for(var n=0;n<t.length;n++){var r=t[parseInt(n.toString(),10)].isDirty;(r=this.removeBatchElementChanges(t[parseInt(n.toString(),10)],r))&&t.splice(n,1),r&&n--}e.getContentTable().querySelector("tr.e-row")||e.renderModule.renderEmptyRow();this.parent.getRowsObject();e.notify(Le,{rows:this.parent.getRowsObject().length?this.parent.getRowsObject():[new Xr({isDataRow:!0,cells:[new Jr({isDataCell:!0,visible:!0})]})]}),e.isCheckBoxSelection&&(e.selectionSettings.checkboxOnly||e.selectionSettings.persistSelection)?e.selectRows(i):e.selectRow(this.cellDetails.rowIndex),this.refreshRowIdx(),e.notify(Xt,{}),this.parent.notify(Zt,{}),i={requestType:"batchCancel",rows:this.parent.getRowsObject()},e.trigger(Le,i)}},v.prototype.removeBatchElementChanges=function(e,t){var i=this.parent,n=new Ls(this.serviceLocator,null,this.parent),r=!1;return t&&(e.isDirty=t,t=i.getRowElementByUID(e.uid))&&(t.classList.contains("e-insertedrow")?(q.remove(t),r=!0):(Hh(e,this.parent.getForeignKeyColumns(),e.data),delete e.changes,delete e.edit,e.isDirty=!1,q.classList(t,[],["e-hiddenrow","e-updatedtd"]),n.refresh(e,i.getColumns(),!1)),0<this.parent.aggregates.length)&&((t=[]).type="cancel",this.parent.notify(Dt,t),0<this.parent.groupSettings.columns.length)&&this.parent.notify(Tt,t),r},v.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(Dt,{}),0<this.parent.groupSettings.columns.length&&this.parent.notify(Tt,{}),this.parent.isReact||this.parent.isVue)&&this.parent.notify(Dt,{})},v.prototype.addRecord=function(e){this.bulkAddRow(e)},v.prototype.endEdit=function(){this.parent.isEdit&&this.validateFormObj()||this.batchSave()},v.prototype.validateFormObj=function(){return this.parent.editModule.formObj&&!this.parent.editModule.formObj.validate()},v.prototype.batchSave=function(){var e,t,i,n=this.parent,r="deletedRecords";n.isCheckBoxSelection&&(e=n.element.querySelector(".e-checkselectall").parentElement).classList.contains("e-checkbox-disabled")&&n.pageSettings.totalRecordsCount>n.currentViewData.length&&q.removeClass([e],["e-checkbox-disabled"]),this.saveCell(),n.isEdit||this.editNextValCell()||n.isEdit||(t=this.getBatchChanges(),"Multiple"===this.parent.selectionSettings.type&&t[r].length&&this.parent.selectionSettings.persistSelection&&(t[r]=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})},n.trigger(ze,{batchChanges:t,cancel:!1},function(e){e.cancel||(n.showSpinner(),n.notify(Yt,{changes:t,original:i}))}))},v.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},v.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)},v.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)},v.prototype.bulkDelete=function(e,r){var s=this,o=(this.removeSelectedData=[],this.parent),a=o.selectedRowIndex,l=o.getSelectedRows(),t={primaryKey:this.parent.getPrimaryKeyFieldNames(),rowIndex:a,rowData:r||o.getSelectedRecords(),cancel:!1};t.row=r?o.editModule.deleteRowUid?o.getRowElementByUID(o.editModule.deleteRowUid):o.getRows()[o.getCurrentViewRecords().indexOf(r)]:l,t.row&&o.trigger(Be,t,function(e){if(!e.cancel){if(s.removeSelectedData=o.getSelectedRecords(),o.clearSelection(),e.row=e.row||(r?o.getRows()[parseInt(a.toString(),10)]:l),1===l.length||r){Array.isArray(e.row)&&(e.row=e.row[0]);var t=e.row.getAttribute("data-uid"),t=r&&s.parent.editModule.deleteRowUid?s.parent.editModule.deleteRowUid:t;e.row.classList.contains("e-insertedrow")?(s.removeRowObjectFromUID(t),q.remove(e.row)):((t=o.getRowObjectFromUID(t)).isDirty=!0,t.edit="delete",q.classList(e.row,["e-hiddenrow","e-updatedtd"],[]),o.frozenRows&&a<o.frozenRows&&o.getDataRows().length>=o.frozenRows&&o.getHeaderTable().querySelector(H).appendChild(o.getRowByIndex(o.frozenRows-1)))}else{r&&(a=parseInt(e.row.getAttribute(T),10)-1);for(var i=0;i<l.length;i++){var n=l[parseInt(i.toString(),10)].getAttribute("data-uid");l[parseInt(i.toString(),10)].classList.contains("e-insertedrow")?(s.removeRowObjectFromUID(n),q.remove(l[parseInt(i.toString(),10)])):(q.classList(l[parseInt(i.toString(),10)],["e-hiddenrow","e-updatedtd"],[]),(n=o.getRowObjectFromUID(n)).isDirty=!0,n.edit="delete",o.frozenRows&&a<o.frozenRows&&o.getDataRows().length>=o.frozenRows&&o.getHeaderTable().querySelector(H).appendChild(o.getRowByIndex(o.frozenRows-1)))}}delete e.row,s.refreshRowIdx(),r&&(o.editModule.deleteRowUid=void 0),o.isCheckBoxSelection||o.selectRow(a),o.trigger(Pe,e),o.notify(Pe,{rows:s.parent.getRowsObject()}),o.focusModule.restoreFocus({requestType:"batchDelete"}),o.notify(Xt,{}),o.getContentTable().querySelector("tr.e-row")||o.renderModule.renderEmptyRow()}})},v.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(I)&&!t[parseInt(n.toString(),10)].classList.contains("e-hiddenrow")?(t[parseInt(n.toString(),10)].setAttribute(T,(r+1).toString()),i[parseInt(n.toString(),10)].index=r,r++):(t[parseInt(n.toString(),10)].removeAttribute(T),i[parseInt(n.toString(),10)].index=-1)},v.prototype.bulkAddRow=function(l){var h=this,d=this.parent;if(d.editSettings.allowAdding){if(d.isEdit&&(this.saveCell(),this.parent.notify(ji,{})),!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(Ne,n,function(e){if(!e.cancel){h.isAdded=!0,d.clearSelection();var t,i,n=new Ls(h.serviceLocator,null,h.parent),r=new Ns(h.parent).generateRows([e.defaultData]),s=n.render(r[0],d.getColumns());Td(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 Jr({cellType:N.CellType.Indent}));var n=d.getContentTable().querySelector(H),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"),n=(d.frozenRows&&"Top"===d.editSettings.newRowPosition?d.getHeaderTable():d.getContentTable()).querySelector(H),"Top"===h.parent.editSettings.newRowPosition?n.insertBefore(s,n.firstChild):n.appendChild(s),q.addClass([].slice.call(s.getElementsByClassName(b)),["e-updatedtd"]),r[0].isDirty=!0,r[0].changes=q.extend({},{},r[0].data,!0),r[0].edit="add",h.addRowObject(r[0]),h.refreshRowIdx(),h.focus.forgetPrevious(),d.notify(Me,{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[ms].length)&&h.parent.notify(Dt,{}),{defaultData:e.defaultData,row:s,columnObject:t,columnIndex:i,primaryKey:e.primaryKey,cell:q.isNullOrUndefined(i)?void 0:s.cells[parseInt(i.toString(),10)]});d.trigger(Me,n)}})}}else d.isEdit&&this.saveCell()},v.prototype.findNextEditableCell=function(e,t,i){for(var n,r=this.parent.getColumns(),s=r.length,o=e;o<s;o++)if(n=!!i&&q.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},v.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&&q.setValue(r.field,0<=Object.keys(r).indexOf("defaultValue")?r.defaultValue:t[r.type],e)}return e},v.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)},v.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.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()))},v.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=q.extend({},{},this.getDataByIndex(i),!0),n=l.getDataRows()[parseInt(i.toString(),10)],o=q.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:!q.isNullOrUndefined(h.foreignKeyValue),primaryKey:e,rowData:o,validationRules:q.extend({},h.validationRules||{}),value:Wh(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(Ue,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(ws),10)-1,foreignKeyData:e.foreignKeyData},e.cell.classList.contains("e-updatedtd")&&(a.isColored=!0,e.cell.classList.remove("e-updatedtd")),l.isEdit=!0,t=!q.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($i,e),a.form=q.select("#"+l.element.id+"EditForm",l.element),l.editModule.applyFormValidation([h]),a.parent.element.querySelector(".e-gridpopup").style.display="none")})))},v.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?Od(a,e,h):Fd(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})))},v.prototype.setChanges=function(e,t,i){var n;e.changes||(e.changes=q.extend({},{},e.data,!0)),q.isNullOrUndefined(t)||("string"==typeof i&&(i=this.parent.sanitize(i)),U.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)},v.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])}},v.prototype.getCellIdx=function(e){e=this.parent.getColumnIndexByUid(e)+this.parent.groupSettings.columns.length;return q.isNullOrUndefined(this.parent.detailTemplate)&&q.isNullOrUndefined(this.parent.childGrid)||e++,this.parent.isRowDragable()&&e++,e},v.prototype.refreshTD=function(e,t,i,n){var r,s,o=new eo(this.parent,this.serviceLocator),n=(n="number"!==t.type||q.isNullOrUndefined(n)?n:parseFloat(n),i&&(this.setChanges(i,t.field,n),Hh(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)}),(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(Xt,{})},v.prototype.getColIndex=function(e,t){var i=0;this.parent.allowGrouping&&this.parent.groupSettings.columns&&(i=this.parent.groupSettings.columns.length),q.isNullOrUndefined(this.parent.detailTemplate)&&q.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(ws),10)-1==t-i)return n;return-1},v.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(er,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++)""===t[parseInt(r.toString(),10)].querySelectorAll("td:not(.e-hide, .e-rowdragdrop, .e-detailrowcollapse, .e-detailrowexpand, .e-indentcell)")[this.validationColObj[parseInt(a.toString(),10)].cellIdx].innerHTML&&(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)}},v.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)},v.prototype.generateCellArgs=function(){var e=this.parent,t=(this.parent.element.classList.remove("e-editing"),this.cellDetails.column),i={},e=(i[t.field]=Wh(t.field,this.cellDetails.rowData),e.editModule.getCurrentEditedData(this.form,i)),i=q.extend({},e),e=q.extend({},e,this.cellDetails.rowData),i=Wh(t.field,i),i=(q.isNullOrUndefined(t.field)||q.isUndefined(i)||q.setValue(t.field,i,e),{columnName:t.field,value:Wh(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},v.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(He,i,this.successCallBack(i,n,r)),t.notify(Yi,{formObj:this.form}))):this.preventSaveCell=!1)},v.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(Zt,{});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),q.removeClass([r],[cs,"e-batchrow"]),q.removeClass([e.cell],["e-editedbatchcell","e-boolcell"]),(!q.isNullOrUndefined(e.value)&&e.value.toString()===(q.isNullOrUndefined(a.cellDetails.value)?"":a.cellDetails.value).toString()&&!a.isColored||q.isNullOrUndefined(e.value)&&q.isNullOrUndefined(n.data[s.field])&&q.isNullOrUndefined(a.cellDetails.value)&&!e.cell.parentElement.classList.contains("e-insertedrow"))&&e.cell.classList.remove("e-updatedtd"),q.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(je,e)}):(t.renderTemplates(),t.trigger(je,e)):t.trigger(je,e)),t.notify(Xt,{}),a.isColored=!1,0<a.parent.aggregates.length&&(a.parent.isReact||a.parent.isVue||a.parent.notify(Dt,{}),0<a.parent.groupSettings.columns.length&&!a.isAddRow(a.cellDetails.rowIndex)&&a.parent.notify(Tt,{}),a.parent.isReact||a.parent.isVue)&&a.parent.notify(Dt,{}),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(cn,{})}}},v.prototype.prevEditedBatchCellMatrix=function(){var e,t=[],i=this.parent.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},v.prototype.getDataByIndex=function(e){e=this.parent.getRowObjectFromUID(this.parent.getDataRows()[parseInt(e.toString(),10)].getAttribute("data-uid"));return e.changes||e.data},v.prototype.keyDownHandler=function(e){var t,i,n,r,s;(this.addBatchRow||("tab"===e.action||"shiftTab"===e.action)&&this.parent.isEdit)&&(t=this.parent,i=this.getBottomIndex(),r=x(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()))},v.prototype.addCancelWhilePaging=function(){this.validateFormObj()&&(this.parent.notify(ai,{}),this.parent.isEdit=!1,this.editNext=!1,this.mouseDownElement=void 0,this.isColored=!1)},v.prototype.getBottomIndex=function(){var e=this.getBatchChanges();return this.parent.getCurrentViewRecords().length+e[ms].length-e[ys].length-1};var iu=v;function v(e,t,i){this.cellDetails={},this.originalCell={},this.cloneCell={},this.editNext=!1,this.preventSaveCell=!1,this.initialRender=!0,this.validationColObj=[],this.addBatchRow=!1,this.prevEditedBatchCell=!1,this.parent=e,this.serviceLocator=t,this.renderer=i,this.focus=t.getService("focus"),this.addEventListener()}nu=function(e,t){return(nu=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}nu(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ou,ru=Yc),ou.prototype.closeEdit=function(){ru.prototype.closeEdit.call(this)},ou.prototype.addRecord=function(e,t){ru.prototype.addRecord.call(this,e,t)},ou.prototype.endEdit=function(){ru.prototype.endEdit.call(this)},ou.prototype.updateRow=function(e,t){ru.prototype.updateRow.call(this,e,t)},ou.prototype.deleteRecord=function(e,t){ru.prototype.deleteRecord.call(this,e,t)},ou.prototype.startEdit=function(e){ru.prototype.startEdit.call(this,e)};var nu,ru,su=ou;function ou(e,t,i){var n=ru.call(this,e,t)||this;return n.parent=e,n.serviceLocator=t,n.renderer=i,n}au=function(e,t){return(au=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}au(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(du,lu=Lc),du.prototype.write=function(e){this.edit=this.parent.editModule,"datepickeredit"===e.column.editType&&(this.obj=new B.DatePicker(q.extend(pu(e,this.parent.editSettings.mode,this.parent.enableRtl,this.parent.cssClass,this),e.column.edit.params)),this.isMaskModuleInjected)&&(B.DatePicker.Inject(B.MaskedDateTime),this.isMaskModuleInjected=!1),"datetimepickeredit"===e.column.editType&&(this.obj=new B.DateTimePicker(q.extend(pu(e,this.parent.editSettings.mode,this.parent.enableRtl,this.parent.cssClass,this),e.column.edit.params))),this.obj.isAngular=wd(this.parent),this.obj.appendTo(e.element)};var au,lu,hu=du;function du(e){e=lu.call(this,e)||this;return e.isMaskModuleInjected=!0,e}function pu(e,t,i,n,r){var t="Dialog"!==t,s=Qh(e.column.format,e.column.type),o=Wh(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:Dh(e.column,e.requestType,e.element)&&Eh(x(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)}}uu.prototype.read=function(e,t){return t},uu.prototype.write=function(){},uu.prototype.destroy=function(){};var cu=uu;function uu(e){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=q.extend(new C.editCellType.templateedit(this.parent),e[parseInt(t.toString(),10)].edit||{}):e[parseInt(t.toString(),10)].edit=q.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"mode":this.updateEditObj(),t.isEdit=!!t.editSettings.showAddNewRow,t.refresh()}},C.prototype.updateEditObj=function(){this.editModule&&this.editModule.destroy(),this.renderer=new Fc(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||q.isNullOrUndefined(t.element.querySelector("."+cs))))&&"Batch"!==t.editSettings.mode){if(this.parent.element.classList.add("e-editing"),!t.getSelectedRows().length||q.isNullOrUndefined(this.parent.getRowByIndex(parseInt(this.parent.getSelectedRows()[0].getAttribute("aria-rowindex"),10)-1))){if(!e)return void this.showDialog("EditOperationAlert",this.alertDObj)}else e=e||(this.parent.isTreeGrid&&this.parent.allowPaging&&t.selectionModule.selectedRowIndexes.length?(i=t.selectionModule.selectedRowIndexes[0],t.getRowByIndex(i)):t.getSelectedRows()[0]);this.parent.enableVirtualization&&"Normal"===this.parent.editSettings.mode&&(i=parseInt(e.getAttribute("aria-rowindex"),10)-1,e=this.parent.getRowByIndex(i));var i=t.getContent().querySelector("tr:last-child"),n=t.getHeaderContent().querySelector("tbody");t.frozenRows&&q.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&&(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&&"Bottom"===this.parent.editSettings.newRowPosition&&t&&"add"===t.requestType&&this.parent.getContent().firstElementChild.offsetHeight>this.parent.getContentTable().scrollHeight?q.addClass([].slice.call(e.getElementsByClassName(b)),"e-lastrowadded"):i&&e&&e.classList&&q.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(Sr,{requestType:"cancel"}),this.parent.editSettings.showAddNewRow&&this.destroyToolTip())},C.prototype.refreshToolbar=function(){this.parent.notify(Xt,{})},C.prototype.addRecord=function(e,t){var i;this.parent.editSettings.allowAdding&&(i={startEdit:!0},e||this.parent.notify(bn,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||!q.isNullOrUndefined(i.commandDelIndex)?i.editSettings.showDeleteConfirmDialog?(this.fieldname=e,this.data=t,this.showDialog("ConfirmDelete",this.dialogObj)):this.editModule.deleteRecord(e,t):this.showDialog("DeleteOperationAlert",this.alertDObj))},C.prototype.deleteRow=function(e){this.deleteRowUid=e.getAttribute("data-uid");e=this.parent.getRowObjectFromUID(this.deleteRowUid);q.isNullOrUndefined(e)||this.deleteRecord(null,e.data)},C.prototype.endEdit=function(){var e;"Batch"===this.parent.editSettings.mode&&this.parent.editSettings.showConfirmDialog&&(q.isNullOrUndefined(this.formObj)||this.formObj.validate())&&(this.parent.editModule.saveCell(),this.parent.notify(ji,{}),q.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.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=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()+"-"+Gh(t.getMonth()+1)+"-"+Gh(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];q.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),this.executeAction()}this.dlgCancel()},C.prototype.destroyEditComponents=function(){var e;this.parent.isEdit&&(this.editModule&&!q.isNullOrUndefined(this.editModule.editRowIndex)&&q.isNullOrUndefined(this.parent.editSettings.template)&&(e=this.parent.columnModel.filter(function(e){return!e.edit.obj}),!q.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:gt,handler:this.onPropertyChanged},{event:dt,handler:this.initialEnd},{event:Pt,handler:this.keyPressHandler},{event:Jt,handler:this.updateColTypeObj},{event:Zt,handler:this.destroyToolTip},{event:ni,handler:this.preventBatch},{event:ai,handler:this.destroyForm},{event:s,handler:this.destroyEditComponents}],zd(this.parent,this.eventDetails,!0,this),this.actionBeginFunction=this.onActionBegin.bind(this),this.actionCompleteFunction=this.actionComplete.bind(this),this.parent.on(Vr,this.actionBeginFunction),this.parent.addEventListener(p,this.actionCompleteFunction))},C.prototype.removeEventListener=function(){this.parent.isDestroyed||(zd(this.parent,this.eventDetails,!1),this.parent.removeEventListener(p,this.actionCompleteFunction),this.parent.off(Vr,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&&(x(r[parseInt(s.toString(),10)],"e-switch-wrapper")||x(r[parseInt(s.toString(),10)],"e-checkbox-wrapper"))||(n=r[parseInt(s.toString(),10)].hasAttribute("name")?Th(r[parseInt(s.toString(),10)].getAttribute("name")):Th(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&&!q.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=q.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&&U.DataUtil.setValue(n.field,p,t):("string"==typeof p&&this.parent.sanitize(p),U.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[xh(o[parseInt(a.toString(),10)].field)]){var l,h=[].slice.call(e[xh(o[parseInt(a.toString(),10)].field)]).filter(function(e){return"input"===e.tagName.toLowerCase()}),d=(0===h.length&&(l=[e[xh(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!q.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)),U.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)),U.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=q.getValue(s,window),r.editModule.getValueFromType(e,s(t,n))):r.editModule.getValueFromType(e,e.edit.read(t,n)),n=q.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("."+cs),t=this.parent.element.querySelector("."+us),r&&this.parent.frozenRows&&"virtualscroll"===e.requestType&&parseInt(x(r,I).getAttribute(T),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&&!q.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=Xd(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!q.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=q.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=q.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.destroy(),!Xd(this.parent).isReact||"Dialog"!==this.parent.editSettings.mode||q.isNullOrUndefined(this.parent.editSettings.template)&&!t.length||n.element.remove(),n)&&n.element&&q.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("."+ts)||!t.querySelector("."+is)))&&this.destroyForm(),this.removeEventListener(),0<(e=this.dialogObj.element).childElementCount&&(this.dialogObj.destroy(),q.remove(e)),0<(e=this.alertDObj.element).childElementCount&&(this.alertDObj.destroy(),q.remove(e)),t)&&this.editModule&&this.editModule.destroy()},C.prototype.keyPressHandler=function(e){switch(/(Mac)/i.test(navigator.platform)&&e.metaKey&&"ctrlEnter"===e.action&&(e.action="insert"),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":x(e.target,"e-unboundcelldiv")||"Batch"===this.parent.editSettings.mode||!(x(e.target,is)||(this.parent.frozenRows||this.parent.pinnedTopRowModels.length||this.parent.editSettings.showAddNewRow&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling))&&x(e.target,rs))||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&&("Batch"===this.parent.editSettings.mode?this.editModule.escapeCellEdit():this.curretRowFocus(e)),this.editCellDialogClose&&(this.editCellDialogClose=!1);break;case"tab":case"shiftTab":this.curretRowFocus(e)}},C.prototype.curretRowFocus=function(e){if(this.parent.isEdit&&"Batch"!==this.parent.editSettings.mode){this.parent.isWidgetsDestroyed=!1;var t=x(e.target,"e-editedrow")||x(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=x(e.target,"e-rowcell"))&&s.classList.contains("e-unboundcell")?e.target:s,o=x(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===x(i[0],"e-rowcell")&&"shiftTab"===e.action&&!this.parent.editSettings.showAddNewRow){o=t.getAttribute("data-uid"),s=(this.parent.allowGrouping?q.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)&&(x(t,"e-gridheader")?s=t.rowIndex:x(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.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")&&q.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=q.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&&x(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("."+cs)?i.element.querySelector("."+cs):i.element).getElementsByClassName("e-gridform")[parseInt(0..toString(),10)]:q.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&&q.isNullOrUndefined(t)&&Md(e[parseInt(a.toString(),10)],1,r,s,o,e.length);r=q.extend(r,s,o),this.parent.editModule.formObj=this.createFormObj(n,t||r)},C.prototype.createFormObj=function(e,t){var n=this;return new L.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&&(x(event.target,n.parent.element.id+"_update",!0)||x(event.target,"e-grid-menu")&&(event.target.classList.contains("e-save")||event.target.querySelector(".e-save"))||n.isShowAddedRowValidate||x(event.target,"e-unboundcell")&&x(event.target,"e-update")||"enter"===event.action&&(x(event.target,"e-content")||x(event.target,"e-addedrow")))||n.parent.editSettings.showAddNewRow&&!q.isNullOrUndefined(n.parent.element.querySelector("."+cs)))&&n.valErrorPlacement(e,t),n.isShowAddedRowValidate=!1,n.parent.notify(dn,i)}})},C.prototype.valErrorPlacement=function(e,t){var i,n;this.parent.isEdit&&(i=t.getAttribute("for"),(n=this.getElemTable(e).querySelector("#"+Rh(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&&q.closest(e,"."+I)&&t.frozenRows>(parseInt(q.closest(e,"."+I).getAttribute(T),10)-1||0),this.parent.isFrozenGrid()?t.element:e||t.editSettings.showAddNewRow&&(t.enableVirtualization||t.enableInfiniteScrolling)?t.getHeaderTable():t.getContentTable()):q.select("#"+t.element.id+"_dialogEdit_wrapper",document);return e},C.prototype.resetElemPosition=function(e,t){var i,t=x(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("#"+Rh(e.inputName)+"_Error"),this.parent.editSettings.showAddNewRow&&!t&&e.element&&(i=x(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?wh():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=x(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=q.closest(e,"."+b),u=q.closest(e,"."+I),g=!1,f=!1,m=this.parent.editSettings.showAddNewRow&&!q.isNullOrUndefined(x(e,us))&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling),y=Math.round(this.parent.getContent().clientHeight/this.parent.getRowHeight())-1,S=[].slice.call(this.parent.getContent().getElementsByClassName(I)),v=("Batch"===this.parent.editSettings.mode&&(S=[].slice.call(this.parent.getContent().querySelectorAll(".e-row:not(.e-hiddenrow)")),1<y)&&S.length>y&&parseInt(S[S.length-1].getAttribute(T),10)-1==parseInt(u.getAttribute(T),10)-1&&(f=!0),p&&((g=(this.parent.frozenRows||this.parent.pinnedTopRowModels.length||m)&&(v=this.parent.editSettings.showAddNewRow?".e-row:not(.e-hiddenrow.e-addedrow)":".e-row:not(.e-hiddenrow)",g=(w=(v=[].slice.call(this.parent.getHeaderTable().querySelector(H).querySelectorAll(v))).length>(parseInt(u.getAttribute(T),10)-1||0))&&parseInt(u.getAttribute(T),10)-1==v.length-1,1===(v=[].slice.call(this.parent.getHeaderTable().querySelector(H).querySelectorAll(".e-row:not(.e-hiddenrow)"))).length)&&(v[0].classList.contains("e-addedrow")||v[0].classList.contains("e-insertedrow"))?!0:g)||1<y&&S.length>y&&("Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType||c.classList.contains("e-lastrowcell")&&!u.classList.contains(us))||f)&&(r=!0),p?w?this.parent.getHeaderTable():this.parent.getContentTable():q.select("#"+this.parent.element.id+"_dialogEdit_wrapper .e-dlg-content",document)),g=v.getBoundingClientRect(),u=(p?this.parent.element.getBoundingClientRect():g).left,f=q.closest(e,"td"),C=(f||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-g.top)+v.scrollTop+9)+"px;left:"+(C.left-u+v.scrollLeft+C.width/2)+"px;max-width:"+C.width+"px;text-align:center;",w=(q.updateCSSText(i,n),this.parent.cssClass&&i.classList.add(this.parent.cssClass),p&&g.left<u&&(i.style.left=parseInt(i.style.left,10)-g.left+u+"px"),this.parent.createElement("div",{className:"e-tip-content"})),v=(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?q.closest(e,".e-editcell"):q.closest(e,"."+ds)).style.position="relative",i.style.position="absolute",("Batch"===this.parent.editSettings.mode||q.closest(e,"."+as)||q.closest(e,"."+ls)||this.parent.frozenRows||this.parent.pinnedTopRowModels.length||m)&&(this.parent.isFrozenGrid()?c.classList.contains("e-unfreeze")?(q.addClass([i],"e-unfreeze"),a.appendChild(i)):((o=q.closest(c,".e-gridheader")?this.parent.element.querySelector(".e-gridheader"):1===S.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")?(q.addClass([i],"e-unfreeze"),this.formObj.element.appendChild(i)):((o=q.closest(c,".e-gridheader")?this.parent.element.querySelector(".e-gridheader"):1===S.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),q.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=f.offsetLeft+(f.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*v)&&(i.style.width=i.style.maxWidth),(p&&!d&&!this.parent.allowPaging||this.parent.frozenRows||this.parent.pinnedTopRowModels.length||m)&&(n=F.calculateRelativeBasedPosition(f,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),S.length<y&&"Bottom"===this.parent.editSettings.newRowPosition&&this.editModule.args&&"add"===this.editModule.args.requestType&&this.setPositionStyles(m,S,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=q.extend(C.editCellType,e)},C.editCellType={dropdownedit:jc,numericedit:Gc,datepickeredit:hu,datetimepickeredit:hu,booleanedit:zc,defaultedit:Qc,templateedit:cu};cu=C;function C(e,t){this.isShowAddedRowValidate=!1,this.editType={Inline:eu,Normal:eu,Batch:iu,Dialog:su},this.fieldname="",this.data={},this.editCellDialogClose=!1,this.parent=e,this.serviceLocator=t,this.l10n=this.serviceLocator.getService("localization"),this.addEventListener(),this.updateEditObj(),this.createAlertDlg(),this.createConfirmDlg()}var gu=function(){return(gu=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)},fu=(w.prototype.destroy=function(){var e=this,t=this.parent.element;(t.querySelector("."+is)||t.querySelector("."+ts))&&t&&(this.removeEventListener(),this.unWireEvents(),this.infiniteLoadedElement=null,this.infiniteDiv=null,q.isNullOrUndefined(this.dlgObj)||!this.dlgObj.element||this.dlgObj.isDestroyed||(this.parent.isReact&&this.parent.columnChooserSettings.template?N.Global.timer?(clearTimeout(N.Global.timer),N.Global.timer=null):N.Global.timer=setTimeout(function(){q.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"),q.isNullOrUndefined(t))||q.remove(t))},w.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,N.ResponsiveDialogAction.isColumnChooser),this.parent.enableAdaptiveUI&&(this.parent.on(qr,this.renderResponsiveColumnChooserDiv,this),this.parent.on(zr,this.renderResponsiveChangeAction,this))},w.prototype.rtlUpdate=function(){q.isNullOrUndefined(this.innerDiv)||(this.parent.enableRtl?q.addClass([].slice.call(this.innerDiv.getElementsByClassName("e-checkbox-wrapper")),["e-rtl"]):q.removeClass([].slice.call(this.innerDiv.getElementsByClassName("e-checkbox-wrapper")),["e-rtl"]))},w.prototype.addEventListener=function(){!this.parent.isDestroyed&&(q.EventHandler.add(document,"click",this.clickHandler,this),this.parent.on(g,this.enableAfterRenderEle,this),this.parent.on(dt,this.render,this),this.parent.addEventListener(ae,this.hideDialogFunction),this.parent.on(s,this.destroy,this),this.parent.on(Bi,this.rtlUpdate,this),this.parent.on(Bn,this.onResetColumns,this),this.parent.on(hr,this.setFullScreenDialog,this),this.parent.on(gt,this.onPropertyChanged,this),this.parent.enableAdaptiveUI&&this.parent.on(zr,this.renderResponsiveChangeAction,this),this.infiniteRenderMode||this.parent.enableAdaptiveUI)&&this.parent.on(qr,this.renderResponsiveColumnChooserDiv,this)},w.prototype.removeEventListener=function(){!this.parent.isDestroyed&&(q.EventHandler.remove(document,"click",this.clickHandler),this.parent.off(dt,this.render),this.parent.off(s,this.destroy),this.parent.off(g,this.enableAfterRenderEle),this.parent.off(Bi,this.rtlUpdate),this.parent.off(Bn,this.onResetColumns),this.parent.removeEventListener(ae,this.hideDialogFunction),this.parent.off(hr,this.setFullScreenDialog),this.infiniteDiv&&(q.EventHandler.remove(this.infiniteDiv,"scroll",this.infiniteScrollHandler),q.EventHandler.remove(this.infiniteDiv,"mouseup",this.infiniteScrollMouseKeyUpHandler),q.EventHandler.remove(this.infiniteDiv,"mousedown",this.infiniteScrollMouseKeyDownHandler)),this.parent.enableAdaptiveUI&&(this.parent.off(hr,this.setFullScreenDialog),this.parent.off(zr,this.renderResponsiveChangeAction)),this.infiniteRenderMode||this.parent.enableAdaptiveUI)&&this.parent.off(qr,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(q.isNullOrUndefined(q.closest(t,".e-cc-toolbar"))&&q.isNullOrUndefined(q.closest(t,".e-cc")))q.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&&q.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"]):this.rtlUpdate()},w.prototype.hideDialog=function(){!q.isNullOrUndefined(this.dlgObj)&&this.dlgObj.visible&&(this.parent.enableAdaptiveUI?this.responsiveDialogRenderer.hideResponsiveColumnChooser():(this.dlgObj.hide(),this.isDlgOpen=!1))},w.prototype.renderColumnChooser=function(e,t,i){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=q.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+q.closest(i,".e-cc-toolbar").getBoundingClientRect().height+"px",q.isNullOrUndefined(q.closest(i,".e-bigger"))||(this.dlgObj.width=258),q.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+q.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")&&(q.isNullOrUndefined(q.closest(i,".e-bigger"))?bd(this.parent,this.dlgObj):bd(this.parent,this.dlgObj,258),this.dlgObj.element.querySelector(".e-ccsearch"))&&this.dlgObj.element.querySelector(".e-ccsearch").select(),this.parent.notify(Xi,{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():(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"},q.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")&&bd(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.resetColumnState(),e&&e.target&&!q.isNullOrUndefined(q.closest(e.target,".e-grid-popup"))&&this.parent.trigger("keyPressed",e),this.setFocus(x(e.target,"e-cclist"))},w.prototype.setFocus=function(e){var t=this.dlgDiv.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");q.EventHandler.add(e,"keyup",this.columnChooserManualSearch,this)},w.prototype.customDialogClose=function(){var e=this.dlgObj.content.querySelector("input.e-ccsearch");q.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;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:!1,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:this.parent.enableAdaptiveUI?null:this.renderFooter()}),e||!this.infiniteRenderMode&&this.parent.columnChooserSettings.footerTemplate||(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")}}]);this.dlgObj.isStringTemplate=!0,this.dlgObj.appendTo(this.dlgDiv),e&&((e=document.querySelector(".e-responsive-dialog > .e-dlg-content > .e-mainfilterdiv"))&&e.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.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()):fh(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()):fh(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 ma(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()):fh(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=Wh(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.mainDiv},w.prototype.confirmDlgBtnClick=function(e){var t,i={requestType:"columnVisibilityUpdate",columns:this.getColumns(),cancel:!1};this.parent.trigger(y,i),i.cancel||(this.stateChangeColumns=[],this.changedStateColumns=[],i=this.infiniteRenderMode?this.infiniteColumns:this.parent.getColumns(),this.changedColumns=0<this.changedColumns.length?this.changedColumns:this.unchangedColumns,this.changedColumnState(this.changedColumns),t=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,q.isNullOrUndefined(e)||(t<i.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(Ur,{})),e={requestType:"columnVisibilityUpdate",columns:this.getColumns(),cancel:!1},this.parent.trigger(p,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(Zt,{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.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(Pn,{dialog:this.dlgObj}),this.parent.trigger(p,{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.dlgDiv.querySelector(".e-footer-content"),d=this.ulElement&&this.ulElement.querySelector(".e-check")&&this.ulElement.querySelectorAll(".e-check:not(.e-selectall)").length;this.infiniteRenderMode&&(d=this.infiniteLoadedElement.filter(function(e){return e.querySelector(".e-check")}).length),this.isInitialOpen=!0,h&&h.querySelector(".e-btn")&&(n=h.querySelector(".e-btn").ej2_instances[0]),""===e?(this.removeCancelIcon(),this.filterColumns=this.selectedColumnModels.length?this.selectedColumnModels:this.getColumns(),i=!0):(h=this.selectedColumnModels.length?this.selectedColumnModels:this.getColumns(),this.filterColumns=new U.DataManager(h).executeLocal((new U.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?(h=void 0,(l=this.parent.isReact)?(Gd(this.parent,["columnChooserTemplate"]),h=this.mainDiv.querySelector(".e-columnChooserTemplate")):(this.mainDiv.querySelector(".e-columnChooserTemplate").remove(),(h=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,h),this.parent.renderTemplates()):fh(h,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(h,this.filterColumns):"string"==typeof this.parent.columnChooserSettings.renderCustomColumnChooser&&(this.parent.columnChooserSettings.renderCustomColumnChooser=Wh(this.parent.columnChooserSettings.renderCustomColumnChooser,window),this.parent.columnChooserSettings.renderCustomColumnChooser(h,this.filterColumns))),this.mainDiv.appendChild(h)):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?(n&&d&&(n.disabled=!1),d&&this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(rr,{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&&(q.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"),n&&(n.disabled=!0),this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(rr,{disabled:!0})),this.flag=!0,this.stopTimer(),t&&(l={requestType:"columnChooserSearch",columns:this.getColumns(),cancel:!1},this.parent.trigger(p,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.wireEvents=function(){q.EventHandler.add(this.dlgObj.element,"click",this.checkBoxClickHandler,this),q.EventHandler.add(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch,this),q.EventHandler.add(this.dlgObj.element,"keyup",this.keyUpHandler,this),this.searchBoxObj.wireEvent()},w.prototype.unWireEvents=function(){this.parent.isDestroyed||(this.dlgObj&&this.dlgObj.element&&(q.EventHandler.remove(this.dlgObj.element,"click",this.checkBoxClickHandler),q.EventHandler.remove(this.dlgObj.element,"keyup",this.keyUpHandler)),this.searchBoxObj&&(q.EventHandler.remove(this.searchBoxObj.searchBox,"keyup",this.columnChooserManualSearch),this.searchBoxObj.unWireEvent()))},w.prototype.checkBoxClickHandler=function(e){if(!this.parent.columnChooserSettings.template||this.infiniteRenderMode){var t,i=x(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")):Bh(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=x(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)}else this.checkstatecolumn(t,r);n=!!(this.infiniteRenderMode&&i.querySelector(".e-selectall")&&i.querySelector(".e-uncheck"));this.parent.columnChooserSettings.footerTemplate||this.refreshCheckboxButton(n),this.setFocus(x(e.target,"e-cclist")),this.infiniteRenderMode&&this.updateIntermediateBtn()}}},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.parent.enableAdaptiveUI||this.parent.columnChooserSettings.footerTemplate?this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(rr,{disabled:!1}):(e=this.dlgObj.btnObj[0]).disabled=!1,s.parentElement.querySelector("input"));t===o&&(!this.infiniteRenderMode||this.infiniteRenderMode&&n===this.showColumn.length)?(i=["e-check"],zh(a,!0)):o||this.infiniteRenderMode&&!o&&r!==this.hideColumn.length?(i=["e-stop"],a.indeterminate=!0):(zh(a,!(i=["e-uncheck"])),e&&!this.parent.enableAdaptiveUI?e.disabled=!0:this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(rr,{disabled:!0})),e&&!this.parent.enableAdaptiveUI&&e.dataBind(),q.removeClass([s],["e-check","e-stop","e-uncheck"]),q.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=(Uh(r,e),r.parentElement.querySelector("input"));r.classList.contains("e-check")?zh(s,!0):r.classList.contains("e-uncheck")&&zh(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?this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(rr,{disabled:!1}):(s=this.dlgDiv.querySelector(".e-footer-content").querySelector(".e-btn").ej2_instances[0]).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=x(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?this.parent.enableAdaptiveUI&&this.responsiveDialogRenderer&&this.parent.notify(rr,{disabled:!0}):s.disabled=!0),this.parent.enableAdaptiveUI||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=(q.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"),q.EventHandler.add(this.infiniteDiv,"scroll",this.infiniteScrollHandler,this),q.EventHandler.add(this.infiniteDiv,"mouseup",this.infiniteScrollMouseKeyUpHandler,this),q.EventHandler.add(this.infiniteDiv,"mousedown",this.infiniteScrollMouseKeyDownHandler,this)):this.ulElement.appendChild(i)),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?q.addClass([t],this.parent.cssClass.split(" ")):q.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(){q.EventHandler.remove(this.infiniteDiv,"scroll",this.infiniteScrollHandler)},w.prototype.infiniteScrollMouseKeyUpHandler=function(e){var t=this,i=(q.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(),N.Global.timer=setTimeout(function(){t.clickHandler(e),N.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),_d([].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?(_d([].slice.call(this.ulElement.children).splice(0,this.itemsCount)),this.infiniteSkipCount+="down"===this.prevInfiniteScrollDirection?this.itemsCount:3*this.itemsCount,fh(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?(_d([].slice.call(this.ulElement.children).splice(2*this.itemsCount,this.itemsCount)),this.infiniteSkipCount-="up"===this.prevInfiniteScrollDirection?this.itemsCount:3*this.itemsCount,Kd([].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&&(_d([].slice.call(this.ulElement.children).splice(2*this.itemsCount,n.length%this.itemsCount)),this.infiniteSkipCount=(Math.floor(n.length/this.itemsCount)-3)*this.itemsCount,Kd([].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){this.dlgObj.element.querySelector(".e-cc.e-input").value="",this.columnChooserSearch("",!1);for(var e=this.parent,t=this.dlgObj.element.querySelectorAll(".e-cc-chbox:not(.e-selectall)"),i=0,n=t.length;i<n;i++){var r=t[parseInt(i.toString(),10)],s=void 0,s=(this.parent.childGrid||this.parent.detailTemplate?x(this.dlgObj.element.querySelectorAll(".e-cc-chbox:not(.e-selectall)")[parseInt(i.toString(),10)],"e-ccheck"):x(r,"e-ccheck")).getAttribute("data-uid"),s=e.getColumnByUid(s,this.infiniteRenderMode),o=[].slice.call(r.parentElement.getElementsByClassName("e-uncheck"));s.visible&&!o.length?(r.checked=!0,this.checkState(r.parentElement.querySelector(".e-icons"),!0)):(r.checked=!1,this.checkState(r.parentElement.querySelector(".e-icons"),!1))}}},w.prototype.checkState=function(e,t){t?q.classList(e,["e-check"],["e-uncheck"]):q.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 zh(s,t),r.setAttribute("id",i+"label"),r.innerHTML=e,s.setAttribute("aria-labelledby",r.id),qh(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",a=-1!==this.hideColumn.indexOf(l.uid),o=-1!==this.showColumn.indexOf(l.uid),a=this.createCheckBox(l.headerText,l.visible&&!a||o,l.uid),s.appendChild(a),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?q.addClass([a],this.parent.cssClass.split(" ")):q.addClass([a],[this.parent.cssClass])),this.infiniteRenderMode&&this.infiniteDiv&&(s.style.height=Wd(this.infiniteDiv,!0)+"px"),i.appendChild(s))}this.infiniteRenderMode&&this.infiniteInitialLoad&&((t=this.infiniteLoadedElement).push.apply(t,[].slice.call(i.children)),this.infiniteInitialLoad=!1),fh(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.dlgDiv&&this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon")&&(this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").classList.add("e-cc-cancel"),this.dlgDiv.querySelector(".e-cc-cancel").setAttribute("title",this.l10n.getConstant("Clear")))},w.prototype.removeCancelIcon=function(){this.dlgDiv&&this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon")&&(this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").classList.remove("e-cc-cancel"),this.dlgDiv.querySelector(".e-cc.e-ccsearch-icon").setAttribute("title",this.l10n.getConstant("Search")))},w.prototype.mOpenDlg=function(){q.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=gu({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(Ke,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;e&&e.module!==this.getModuleName()||(e=this.parent.columnChooserSettings.enableSearching,this.dlgObj&&this.dlgObj.element&&(t=this.dlgObj.element.querySelector(".e-cc-searchdiv"),i=this.dlgObj.element.querySelector(".e-dlg-content"),t.style.display=e?"":"none",i.style.margin=e?"":"0px"))},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.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&&q.addClass([this.cBoxTrue,this.cBoxFalse],["e-rtl"]),this.parent.cssClass&&(-1!==this.parent.cssClass.indexOf(" ")?q.addClass([this.cBoxTrue,this.cBoxFalse],this.parent.cssClass.split(" ")):q.addClass([this.cBoxTrue,this.cBoxFalse],[this.parent.cssClass])),this.parent.enableAdaptiveUI&&this.setFullScreenDialog()}yu.getQuery=function(e,t){var i=t.generateQuery(!0).requiresCount();return t.isRemote()&&(e.groupSettings.enableLazyLoading&&e.groupSettings.columns.length?i.lazyLoad=[]:i.take(e.pageSettings.totalRecordsCount)),i},yu.prototype.getFData=function(e,t){return jh(t,{},e,this.foreignKeyData[t.field])[0]},yu.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 Xr(a));a.cells=this.generateCells(e,i),r.push(a)}this.processColumns(r)}return r},yu.prototype.generateCells=function(e,t){var i=[];if(t.childGridLevel)for(var n=t.childGridLevel,r=0;r<n;r++)i.push(this.generateCell({},N.CellType.Indent));for(var s=0,o=e;s<o.length;s++){var a=o[s];i.push(this.generateCell(a,N.CellType.Data))}return i},yu.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 U.DataManager(r[parseInt(s.toString(),10)].dataSource.result):r[parseInt(s.toString(),10)].dataSource;n.push(o.executeQuery(new U.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},yu.prototype.getHeaders=function(e,t){this.hideColumnInclude=!!t,this.colDepth=$h(e);for(var i=[],n=0;n<this.colDepth;n++)i[parseInt(n.toString(),10)]=new Xr({}),i[parseInt(n.toString(),10)].cells=[];return i=this.processColumns(i),{rows:i=this.processHeaderCells(i,e),columns:this.generateActualColumns(e)}},yu.prototype.getConvertedWidth=function(e){var t=parseFloat(e);return-1!==e.indexOf("%")?this.parent.element.getBoundingClientRect().width*t/100:t},yu.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},yu.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},yu.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 Jr({cellType:N.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,N.CellType.Header,this.colDepth-i,i));return t},yu.prototype.generateCell=function(e,t,i,n){e={visible:e.visible,isDataCell:t===N.CellType.Data,column:e,cellType:t,rowSpan:i,index:n};return(!e.rowSpan||e.rowSpan<2)&&delete e.rowSpan,new Jr(e)},yu.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({},N.CellType.HeaderIndent));return e},yu.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},yu.prototype.checkAndExport=function(t,e){Object.keys(t).some(function(e){return!t[""+e]})||e()},yu.prototype.failureHandler=function(e,t,i){var n=this;return function(){e[t.id]=!0,n.checkAndExport(e,i)}},yu.prototype.createChildGrid=function(e,t,i,n){i=new Ul(this.parent.detailRowModule.getGridModel(e,t,i)),e.isPrinting=!1,i.parentDetails={parentID:e.element.id,parentPrimaryKeys:e.getPrimaryKeyFieldNames(),parentKeyField:e.childGrid.queryString,parentKeyFieldValue:q.getValue(i.queryString,t.data),parentRowData:t.data},e=gh("child-grid"),t=q.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}},yu.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},yu.prototype.getForeignKeyData=function(){return this.foreignKeyData};var mu=yu;function yu(e,t){this.hideColumnInclude=!1,this.foreignKeyData={},!(this.parent=e).parentDetails&&t&&(this.foreignKeyData=t)}vu.prototype.returnFormattedValue=function(e,t){return!q.isNullOrUndefined(e.value)&&e.value?this.valueFormatter.getFormatFunction(t)(e.value):""},vu.prototype.formatCellValue=function(e){var t,i;return e.isForeignKey&&(e.value=q.getValue(e.column.foreignKeyValue,jh(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?(q.isNullOrUndefined(e.column.type)||q.isNullOrUndefined(e.value))&&q.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 Su=vu;function vu(e){this.valueFormatter=new V(e),this.internationalization=new q.Internationalization(e)}wu.prototype.getModuleName=function(){return"ExcelExport"},wu.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 Su(e.locale),e.id=gh("main-grid"),this.gridPool[e.id]=!1)},wu.prototype.Map=function(e,t,i,n,r,s){var o=e,e=(this.gridPool={},!e.childGrid&&!e.detailTemplate||!q.isNullOrUndefined(t)&&"None"===t.hierarchyExportMode||(e.expandedRows=Yh(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(hi,e),e.cancel?new Promise(function(e){return e()}):(this.parent.log("exporting_begin",this.getModuleName()),this.data=new Wr(o),this.isExporting=!0,this.isBlob=e.isBlob,this.isChild=e.isChild,this.grpFooterTemplates=e.grpFooterTemplates,this.isCsvExport=e.isCsv||!1,Wl(t)&&Ql(t,o),this.processRecords(o,t,e.isMultipleExport,e.workbook))},wu.prototype.exportingSuccess=function(e){this.isExporting=!1,this.parent.trigger(di,this.isBlob?{promise:this.blobPromise}:{gridInstance:this.parent}),this.parent.log("exporting_complete",this.getModuleName()),e(this.book)},wu.prototype.processRecords=function(n,r,s,o){var e,t,i,a=this;return q.isNullOrUndefined(r)||q.isNullOrUndefined(r.dataSource)?q.isNullOrUndefined(r)||"CurrentPage"!==r.exportType||this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()?(e=[],t=mu.getQuery(n,this.data),this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()&&((r=q.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(oe,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 U.DataManager?r.dataSource:new U.DataManager(r.dataSource),i=r.query||new U.Query,(q.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)})})}))},wu.prototype.processInnerRecords=function(i,n,r,s,o){var a,l=this,e=(this.groupedColLength=i.groupSettings.columns.length,5),h=[],d=$h(i.columns),p=!q.isNullOrUndefined(n);return p&&!q.isNullOrUndefined(n.multipleExport)&&(this.expType=q.isNullOrUndefined(n.multipleExport.type)?"AppendToSheet":n.multipleExport.type,q.isNullOrUndefined(n.multipleExport.blankRows)||(e=n.multipleExport.blankRows)),q.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&&(q.isNullOrUndefined(r)?(q.isNullOrUndefined(n.header)||this.processExcelHeader(JSON.parse(JSON.stringify(n.header))),q.isNullOrUndefined(n.footer)||(this.footer=JSON.parse(JSON.stringify(n.footer)))):(q.isNullOrUndefined(n.header)||!r&&"NewSheet"!==this.expType||this.processExcelHeader(JSON.parse(JSON.stringify(n.header))),q.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),q.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&&!q.isNullOrUndefined(n.separator)&&","!==n.separator&&(a=n.separator),e=new j.Workbook(l.book,"csv",i.locale,q.defaultCurrencyCode,a),l.isBlob?l.blobPromise=e.saveAsBlob("text/csv"):p&&n.fileName?e.save(n.fileName):e.save("Export.csv")):(e=new j.Workbook(l.book,"xlsx",i.locale,q.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})},wu.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},wu.prototype.processGridExport=function(e,t,i){var n=[],r=(q.isNullOrUndefined(t)||q.isNullOrUndefined(t.theme)||(this.theme=t.theme),!e.childGrid&&!e.detailTemplate||q.isNullOrUndefined(t)||(e.hierarchyPrintMode=t.hierarchyExportMode||"Expanded"),new mu(e,this.helper.getForeignKeyData())),s=Wl(t)?sh(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=q.isNullOrUndefined(t)||!Object.keys(t).length||!q.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(Wi,{excelRows:n,type:"excel"}),this.capTemplate=void 0,this.footerTemplates=[],this.grpFooterTemplates=[],this.aggIndex=0,this.totalAggregates=0,n},wu.prototype.processRecordContent=function(e,t,i,n,r,s,o){var a=!q.isNullOrUndefined(r)&&r.length?r:t.result;return q.isNullOrUndefined(a.level)?this.processRecordRows(e,a,i,0,0,n,s,o):this.processGroupedRows(e,a,i,a.level,0,n,s,o),q.isNullOrUndefined(t.aggregates)||(q.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},wu.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(ot,g),c.value=g.captionText,c.style=this.getCaptionThemeStyle(this.theme),q.isNullOrUndefined(g.style)||(c.style=this.mergeOptions(c.style,g.style));u=new _s(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,S=o[o.length-1].cells;y<S.length;y++){var v=S[y];v.index<f&&(f=v.index),v.index>m&&(m=v.index),p[p.length-1].index!==v.index&&p.push(v)}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(ot,b),q.isNullOrUndefined(b.style)||(w.style=this.mergeOptions(w.style,b.style)),p.push(w),m++}}else{for(var I=0,x=0,R=i.columns;x<R.length;x++)R[x].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}),!q.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))}},wu.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,S,v=c.cells[parseInt(g.toString(),10)];v.cellType===N.CellType.Data&&(y=(v=v.column).field,y=q.isNullOrUndefined(y)?"":v.valueAccessor(y,c.data,v),y=q.isNullOrUndefined(y)?"":y,m=void("dateonly"===v.type&&"string"==typeof y&&y&&(m=y.split(/[^0-9.]/),y=new Date(parseInt(m[0],10),parseInt(m[1],10)-1,parseInt(m[2],10)))),v.isForeignColumn&&v.isForeignColumn()&&(m=a.getFData(y,v),y=q.getValue(v.foreignKeyValue,m)),q.isNullOrUndefined(y)||(S=l+n+e.childGridLevel,y={data:c.data,column:v,foreignKeyData:m,value:y,style:void 0,colSpan:1,cell:v={}},e.trigger(pi,y),q.isNullOrUndefined(y.image)||q.isNullOrUndefined(y.image.base64)||(u=this.setImage(y,S),y.image.height&&""!==y.value&&(u+=30)),q.isNullOrUndefined(y.hyperLink)||(y.cell.hyperlink={target:y.hyperLink.target},y.value=y.hyperLink.displayText||y.value),(v=y.cell).index=S,v.value=y.value,""===y.data&&e.childGridLevel&&1===l&&(y={style:{hAlign:"left"}},v.colSpan=e.getVisibleColumns().length,v.value=this.l10n.getConstant("EmptyRecord")),1<y.colSpan&&(v.colSpan=y.colSpan),q.isNullOrUndefined(y.style)?v.style={name:e.element.id+"column"+(l+n)}:(S=this.getColumnStyle(e,l+n),v.style=this.mergeOptions(this.styles[parseInt(S.toString(),10)],y.style)),h.push(v)),l++)}var C,w,b,I,x={index:this.rowLength++,cells:h};q.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||q.isNullOrUndefined(e.childGrid)&&q.isNullOrUndefined(e.detailTemplate)||(q.isNullOrUndefined(e.childGrid)?(this.parent.trigger(gi,I={parentRow:c,row:x,value:{},action:"excelexport",gridInstance:e}),x.childRows=this.processDetailTemplate(I)):(e.isPrinting=!0,w=!q.isNullOrUndefined(s)&&s.exportType?s.exportType:"AllPages",C=(w=this.helper.createChildGrid(e,c,w,this.gridPool)).childGrid,w=w.element,C.actionFailure=a.failureHandler(this.gridPool,C,this.globalResolve),C.childGridLevel=e.childGridLevel+1,b=q.extend(s,{columns:null,dataSource:null,query:null}),this.parent.trigger(ui,I={childGrid:C,row:c,exportProperties:b}),C.beforeDataBound=this.childGridCell(x,C,b,c),C.appendTo(w))),e.notify(Ki,{rowObj:c,type:"excel",excelRows:o})}return r},wu.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 q.isNullOrUndefined(e.index)&&(e.index=o,o++),i.index=e.index+n,q.isNullOrUndefined(e.value)||(i.value=e.value),q.isNullOrUndefined(e.colSpan)||(i.colSpan=e.colSpan),q.isNullOrUndefined(e.rowSpan)||(i.rowSpan=e.rowSpan),i.style=t?l.getHeaderThemeStyle(l.theme):l.getRecordThemeStyle(l.theme),q.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)),q.isNullOrUndefined(e.image)||q.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))),q.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};q.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)}]},q.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},wu.prototype.setImage=function(e,t){q.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},wu.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(),q.detach(s.element),l.gridPool[s.id]=!0,l.helper.checkAndExport(l.gridPool,l.globalResolve),r}},wu.prototype.processAggregates=function(e,t,i,n,r,s){var o=new qs(e),a=(a=o.getColumns()).filter(function(e){return q.isNullOrUndefined(e.commands)&&"checkbox"!==e.type}),l=(e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo(),void 0),l=q.isNullOrUndefined(n)?t:n;return void 0===r&&(r=0),0<e.groupSettings.columns.length&&s?0<(n=new js(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},wu.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(q.isNullOrUndefined(f.attributes["data-index"])||(y=this.parent.getColumnByIndex(f.attributes["data-index"])),f.cellType!==N.CellType.DetailFooterIntent&&"checkbox"!==y.type&&!y.commands&&(f.visible||this.includeHiddenColumn))if(c++,f.isDataCell){var p=!1,y=!q.isNullOrUndefined(f.column.footerTemplate),S=!q.isNullOrUndefined(f.column.groupFooterTemplate),v=!q.isNullOrUndefined(f.column.groupCaptionTemplate);if(m.index=c+i+e.childGridLevel,y)m.value=this.getAggreateValue(e,N.CellType.Summary,f.column.footerTemplate,f,h);else if(S)m.value=this.getAggreateValue(e,N.CellType.GroupSummary,f.column.groupFooterTemplate,f,h);else if(v)m.value=this.getAggreateValue(e,N.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&&(q.isNullOrUndefined(h.data[f.column.field].Sum)?q.isNullOrUndefined(h.data[f.column.field].Average)?q.isNullOrUndefined(h.data[f.column.field].Max)?q.isNullOrUndefined(h.data[f.column.field].Min)?q.isNullOrUndefined(h.data[f.column.field].Count)?q.isNullOrUndefined(h.data[f.column.field].TrueCount)?q.isNullOrUndefined(h.data[f.column.field].FalseCount)?q.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);v=null!=f.attributes.class?f.attributes.class.toString():"",v=(v&&(m.style.hAlign=-1<v.indexOf("e-rightalign")?"right":-1<v.indexOf("e-centeralign")?"center":"left"),{row:h,type:y?"Footer":S?"GroupFooter":"GroupCaption",style:m,cell:f});this.parent.trigger(qn,v),d.push(m)}else void 0===r&&(m.index=c+i+e.childGridLevel,m.style=this.getCaptionThemeStyle(this.theme),v={row:h,type:q.isNullOrUndefined(f.column.footerTemplate)?q.isNullOrUndefined(f.column.groupFooterTemplate)?"GroupCaption":"GroupFooter":"Footer",style:m,cell:f},this.parent.trigger(qn,v),d.push(m))}q.isNullOrUndefined(r)?(l={},l=!(this.groupedColLength<8&&0<this.groupedColLength)||e.groupSettings.enableLazyLoading&&q.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},wu.prototype.aggregateStyle=function(e,t,i){var n,i=this.parent.getColumnByField(i);"object"==typeof e.format?(n=e.format,t.numberFormat=q.isNullOrUndefined(n.format)?n.skeleton:n.format,q.isNullOrUndefined(n.type)||(t.type=n.type.toLowerCase())):t.numberFormat=e.format,!q.isNullOrUndefined(i)&&q.isNullOrUndefined(t.type)&&(t.type=i.type.toLowerCase())},wu.prototype.getAggreateValue=function(e,t,i,n,r){var s,o={},i=(o[q.getEnumValue(N.CellType,n.cellType)]=q.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],q.isNullOrUndefined(s)?"":s):(s=o[q.getEnumValue(N.CellType,n.cellType)](i,this.parent),this.parent.isVue3&&!q.isNullOrUndefined(s[1])?s[1].textContent:q.isNullOrUndefined(s[0])?"":s[0].textContent)},wu.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},wu.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++}},wu.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},wu.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!==N.CellType.HeaderIndent&&m.cellType!==N.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(!q.isNullOrUndefined(m.rowSpan)&&1!==m.rowSpan){f.rowSpan=m.rowSpan;for(var S=1;S<m.rowSpan+1;S++){var v={rowIndex:0,columnIndex:0,colSpan:0};v.rowIndex=S,v.columnIndex=p,v.colSpan=m.colSpan||1,o.push(v)}}q.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),q.isNullOrUndefined(m.column.textAlign)||(g.hAlign=m.column.textAlign.toLowerCase()),q.isNullOrUndefined(m.column.headerTextAlign)||(g.hAlign=m.column.headerTextAlign.toLowerCase());g={cell:f,gridCell:m,style:g};if(e.trigger(ci,g),m.cellType===N.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(S=0;S<o.length;S++)o[parseInt(S.toString(),10)].columnIndex===f.index&&(o[parseInt(S.toString(),10)].colSpan=f.colSpan)}g.style.rotation&&this.headerRotation(g),q.isNullOrUndefined(g.image)||q.isNullOrUndefined(g.image.base64)||(l=this.setImage(g,p)),q.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};q.isNullOrUndefined(l)||(b.height=l),n.push(b)}return n},wu.prototype.getHeaderThemeStyle=function(e){var t={fontSize:12,borders:{color:"#E0E0E0"},bold:!0};return t=q.isNullOrUndefined(e)||q.isNullOrUndefined(e.header)?t:this.updateThemeStyle(e.header,t)},wu.prototype.updateThemeStyle=function(e,t){return q.extend(t,e)},wu.prototype.getCaptionThemeStyle=function(e){var t={fontSize:13,backColor:"#F6F6F6"};return t=q.isNullOrUndefined(e)||q.isNullOrUndefined(e.caption)?t:this.updateThemeStyle(e.caption,t)},wu.prototype.getRecordThemeStyle=function(e){var t={fontSize:13,borders:{color:"#E0E0E0"}};return t=q.isNullOrUndefined(e)||q.isNullOrUndefined(e.record)?t:this.updateThemeStyle(e.record,t)},wu.prototype.processExcelHeader=function(e){if(!q.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&&!q.isNullOrUndefined(n.index)||(n.index=i+1),this.updatedCellIndex(n)}}},wu.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&&!q.isNullOrUndefined(n.index)||(n.index=i+1)}this.rows.push(e)},wu.prototype.processExcelFooter=function(e){if(!q.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)}}},wu.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}},wu.prototype.parseStyles=function(e,t,i,n){var r;q.isNullOrUndefined(t.format)||("object"==typeof t.format?(r=t.format,i.numberFormat=q.isNullOrUndefined(r.format)?r.skeleton:r.format,q.isNullOrUndefined(r.type)||(i.type="dateonly"===r.type?"date":r.type.toLowerCase())):(i.numberFormat=t.format,i.type="dateonly"===t.type?"date":t.type)),q.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||(q.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)}))},wu.prototype.destroy=function(){};var Cu=wu;function wu(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,this.parent=e,this.helper=new mu(e),this.locator=t,this.l10n=this.locator.getService("localization")}D.prototype.getModuleName=function(){return"PdfExport"},D.prototype.init=function(e){this.exportValueFormatter=new Su(e.locale),this.pdfDocument=void 0,this.hideColumnInclude=!1,this.currentViewData=!1,this.parent=e,this.isGrouping=!1,this.isExporting=!0,e.id=gh("main-grid"),this.gridPool[e.id]=!1,this.pdfPageSettings=new R.PdfPageSettings},D.prototype.exportWithData=function(e,t,i,n,r,s,o){var a=this;this.init(e),q.isNullOrUndefined(t)?this.pdfDocument=new R.PdfDocument:this.pdfDocument=t,this.processExport(e,n,r,s).then(function(){a.isExporting=!1,e.trigger(mi,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(oe,e)})},D.prototype.Map=function(n,r,s,o,e){var a,l=this,h=(this.data=new Wr(this.parent),this.isBlob=e,this.gridPool={},r&&r.query?r.query:new U.Query),e=(!n.childGrid&&!n.detailTemplate||!q.isNullOrUndefined(r)&&"None"===r.hierarchyExportMode||(n.expandedRows=Yh(n).expandedRows),{requestType:"beforePdfExport",cancel:!1,headerPageNumbers:[],gridDrawPosition:{xPosition:0,yPosition:0},generateQuery:!1});return(e.gridObject=n).trigger(fi,e),!0===e.cancel?new Promise(function(e,t){return e()}):(Wl(r)&&Ql(r,n),e.generateQuery&&(h=mu.getQuery(n,this.data)),this.headerOnPages=e.headerPageNumbers,this.drawPosition=e.gridDrawPosition,this.parent.log("exporting_begin",this.getModuleName()),q.isNullOrUndefined(r)||q.isNullOrUndefined(r.dataSource)?q.isNullOrUndefined(r)||"CurrentPage"!==r.exportType||this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()?(a=[],e=mu.getQuery(n,this.data),this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&!this.parent.getDataModule().isRemote()&&((r=q.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),q.isNullOrUndefined(o)?l.pdfDocument=new R.PdfDocument:l.pdfDocument=o.document,l.processExport(n,e[0],r,s,o).then(function(e){l.isExporting=!1,n.trigger(mi,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(oe,e)})})})):new Promise(function(e,t){l.exportWithData(n,o,e,l.parent.getCurrentViewRecords(),r,s,t)}):(r.dataSource=r.dataSource instanceof U.DataManager?r.dataSource:new U.DataManager(r.dataSource),(q.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)})})))},D.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 R.PdfGridLayoutFormat).layout=R.PdfLayoutType.Paginate,t.break=R.PdfLayoutBreakType.FitPage,t.paginateBounds=new R.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():!q.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})},D.prototype.processSectionExportProperties=function(e,t){return q.isNullOrUndefined(e)||q.isNullOrUndefined(t)||q.isNullOrUndefined(t.pageOrientation)&&q.isNullOrUndefined(t.pageSize)||(this.pdfPageSettings.orientation="Landscape"===t.pageOrientation?R.PdfPageOrientation.Landscape:R.PdfPageOrientation.Portrait,this.pdfPageSettings.size=this.getPageSize(t.pageSize),e.setPageSettings(this.pdfPageSettings)),e},D.prototype.processGridExport=function(e,t,i){var n=!0,r=(q.isNullOrUndefined(i)||(this.gridTheme=i.theme,n=!!q.isNullOrUndefined(i.allowHorizontalOverflow)||i.allowHorizontalOverflow),new mu(e,this.helper.getForeignKeyData())),s=this.processExportProperties(i,t.result),o=(o=Wl(i)?sh(i.columns,e.enableColumnVirtualization):r.getGridExportColumns(e.columns)).filter(function(e){return q.isNullOrUndefined(e.commands)}),a=!1,l=(e.groupSettings.columns.length&&(a=!0),!e.childGrid&&!e.detailTemplate||q.isNullOrUndefined(i)||(e.hierarchyPrintMode=i.hierarchyExportMode||"Expanded"),new R.PdfGrid),h=this.getHeaderThemeStyle(),d=h.border,p=h.font,h=h.brush,c=r.getHeaders(o,this.hideColumnInclude),u=c.columns,l=this.processGridHeaders(e.groupSettings.columns.length,l,c.rows,u,d,p,h,e,n,o),c=(this.setColumnProperties(u,l,r,e,n),this.getSummaryCaptionThemeStyle());return!q.isNullOrUndefined(s)&&s.length?(a?(q.isNullOrUndefined(c.border)||(d=c.border),this.processGroupedRecords(l,s,u,e,d,0,c.font,c.brush,c.backgroundBrush,t,i,r,0)):this.processRecord(d,u,e,s,l,0,i,r,0),q.isNullOrUndefined(t.aggregates)||(p=void 0,o=(o=(h=new qs(e)).getColumns()).filter(function(e){return q.isNullOrUndefined(e.commands)&&"checkbox"!==e.type}),e.aggregates.length&&this.parent!==e&&e.aggregateModule.prepareSummaryInfo(),p=this.customDataSource?h.generateRows(s,t.aggregates,null,null,o):this.currentViewData?h.generateRows(this.parent.getCurrentViewRecords(),t.aggregates):a?h.generateRows(s.records,t.aggregates):h.generateRows(t.result,t.aggregates,null,null,o),this.processAggregates(p,l,d,c.font,c.brush,c.backgroundBrush,!1,null,null,null,!a))):l.rows.addRow().style.setBorder(d),l},D.prototype.getSummaryCaptionThemeStyle=function(){var e,t,i,n,r;return q.isNullOrUndefined(this.gridTheme)||q.isNullOrUndefined(this.gridTheme.caption)?{font:new R.PdfStandardFont(R.PdfFontFamily.Helvetica,9.75),brush:new R.PdfSolidBrush(new R.PdfColor(0,0,0)),backgroundBrush:new R.PdfSolidBrush(new R.PdfColor(246,246,246))}:(e=q.isNullOrUndefined(this.gridTheme.caption.fontSize)?9.75:this.gridTheme.caption.fontSize,r=q.isNullOrUndefined(this.gridTheme.caption.fontName)?R.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.caption.fontName),t=this.getFontStyle(this.gridTheme.caption),i=new R.PdfColor(0,0,0),q.isNullOrUndefined(this.gridTheme.caption.fontColor)||(n=this.hexToRgb(this.gridTheme.caption.fontColor),i=new R.PdfColor(n.r,n.g,n.b)),n=this.gridTheme.caption.border?this.getBorderStyle(this.gridTheme.caption.border):null,r=new R.PdfStandardFont(r,e,t),{font:r=q.isNullOrUndefined(this.gridTheme.caption.font)?r:this.gridTheme.caption.font,brush:new R.PdfSolidBrush(i),backgroundBrush:new R.PdfSolidBrush(new R.PdfColor(246,246,246)),border:n})},D.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=q.isNullOrUndefined(R.PdfFontStyle[""+n])?0:R.PdfFontStyle[""+n],e.header.font[a]?e.header.font=new R.PdfTrueTypeFont(t,i,l):(n=q.isNullOrUndefined(t)?R.PdfFontFamily.Helvetica:this.getFontFamily(t),e.header.font=new R.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=q.isNullOrUndefined(R.PdfFontStyle[""+i])?0:R.PdfFontStyle[""+i],e.caption.font[a]?e.caption.font=new R.PdfTrueTypeFont(t,n,l):(i=q.isNullOrUndefined(t)?R.PdfFontFamily.Helvetica:this.getFontFamily(t),e.caption.font=new R.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=q.isNullOrUndefined(R.PdfFontStyle[""+n])?0:R.PdfFontStyle[""+n],e.record.font[a]?e.record.font=new R.PdfTrueTypeFont(t,i,l):(r=q.isNullOrUndefined(t)?R.PdfFontFamily.Helvetica:this.getFontFamily(t),e.record.font=new R.PdfStandardFont(r,i,l)))},D.prototype.getHeaderThemeStyle=function(){var e,t,i,n,r=new R.PdfBorders;return q.isNullOrUndefined(this.gridTheme)||q.isNullOrUndefined(this.gridTheme.header)?(r.all=new R.PdfPen(new R.PdfColor(234,234,234)),{border:r,font:new R.PdfStandardFont(R.PdfFontFamily.Helvetica,10.5),brush:new R.PdfSolidBrush(new R.PdfColor(102,102,102))}):(r=q.isNullOrUndefined(this.gridTheme.header.fontName)?R.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.header.fontName),e=this.getFontStyle(this.gridTheme.header),t=q.isNullOrUndefined(this.gridTheme.header.fontSize)?10.5:this.gridTheme.header.fontSize,i=new R.PdfColor,q.isNullOrUndefined(this.gridTheme.header.fontColor)||(n=this.hexToRgb(this.gridTheme.header.fontColor),i=new R.PdfColor(n.r,n.g,n.b)),n=new R.PdfStandardFont(r,t,e),q.isNullOrUndefined(this.gridTheme.header.font)||(n=this.gridTheme.header.font),{border:this.getBorderStyle(this.gridTheme.header.border),font:n,brush:new R.PdfSolidBrush(i)})},D.prototype.processGroupedRecords=function(r,s,o,a,l,e,h,d,p,c,u,g,f){for(var m=this,y=e,S=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:S.exportValueFormatter.formatCellValue(n))+" - "+t.count+(1<s.count?" items":" item");S.parent.trigger(ot,{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 R.PdfStringFormat(R.PdfTextAlignment.Left),i.style.setBorder(l),i.style.setFont(h),i.style.setTextBrush(d),i.style.setBackgroundBrush(p),q.isNullOrUndefined(e.style)||m.processCellStyle(i.cells.getCell(y),e);var e=new _s(a);e=q.isNullOrUndefined(t.items.records)?e.generateRows(t.items,t):e.generateRows(t.items.records,t),q.isNullOrUndefined(e)||0!==e.length||(i.cells.getCell(y+1).columnSpan=r.columns.count-(y+1)),!q.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 js(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 js(a).generateRows(t.items,t),m.processAggregates(e,r,l,h,d,p,!1,null,null,!0,null,a))})}(i[t])},D.prototype.processGridHeaders=function(e,a,l,t,h,d,p,c,i,n){for(var u=this,t=t.length+e,e=$h(n),g=0,f=[],r=0;r<l.length;r++)f[parseInt(r.toString(),10)]=0;c.groupSettings.columns.length&&(g=c.groupSettings.columns.length-1,t-=1),a.columns.add(t),a.style.cellPadding=new R.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,q.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,q.isNullOrUndefined(t)||t.cellType!==N.CellType.HeaderIndent&&t.cellType!==N.CellType.DetailHeader||(o.value="",o.width=20),{cell:o,gridCell:t,style:o.style}),n=(u.parent.trigger(Si,e),e),r=e.style.borders,i=e.style.font,t=e.style.textBrush;q.isNullOrUndefined(r)||s.style.setBorder(r),q.isNullOrUndefined(i)||s.style.setFont(i),q.isNullOrUndefined(t)||s.style.setTextBrush(t),q.isNullOrUndefined(n.style.verticalAlignment)||(o.style.stringFormat=u.getVerticalAlignment(n.style.verticalAlignment,o.style.stringFormat)),q.isNullOrUndefined(n.image)||(o.value=new R.PdfBitmap(n.image.base64)),q.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),a},D.prototype.processExportProperties=function(e,t){var i,n,r;return q.isNullOrUndefined(e)?(this.currentViewData=!1,this.customDataSource=!1):(q.isNullOrUndefined(e.theme)||(this.gridTheme=e.theme),n=this.pdfPageSettings.size,this.drawHeader(e),q.isNullOrUndefined(e.footer)||(i=e.footer,r=new R.PointF(0,n.width-80-.75*i.fromBottom),n=new R.SizeF(n.width-80,.75*i.height),r=new R.RectangleF(r,n),this.pdfDocument.template.bottom=this.drawPageTemplate(new R.PdfPageTemplateElement(r),i)),q.isNullOrUndefined(e.includeHiddenColumn)||this.isGrouping||(this.hideColumnInclude=e.includeHiddenColumn),q.isNullOrUndefined(e.dataSource)?(!q.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},D.prototype.drawHeader=function(e){var t,i,n=this,r=this.pdfPageSettings.size;q.isNullOrUndefined(e)||q.isNullOrUndefined(e.header)||(e=e.header,t=new R.PointF(0,e.fromTop),r=new R.SizeF(r.width-80,.75*e.height),t=new R.RectangleF(t,r),this.headerOnPages.length?(i=this.drawPageTemplate(new R.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 R.PointF(0,0))})):this.pdfDocument.template.top=this.drawPageTemplate(new R.PdfPageTemplateElement(t),e))},D.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},D.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...")}},D.prototype.drawText=function(e,t){var i=this.getFont(t),n=this.getBrushFromContent(t),r=null,s=(q.isNullOrUndefined(t.style.textPenColor)||(s=this.hexToRgb(t.style.textPenColor),r=new R.PdfPen(new R.PdfColor(s.r,s.g,s.b))),null==n&&null==r&&(n=new R.PdfSolidBrush(new R.PdfColor(0,0,0))),t.value.toString()),o=.75*t.position.x,a=.75*t.position.y,l=new R.PdfStringFormat,t=(q.isNullOrUndefined(t.style.stringFormat)||(l.alignment=t.style.stringFormat.alignment),this.setContentFormat(t,l));null===t||q.isNullOrUndefined(t.format)||q.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)},D.prototype.drawPageNumber=function(e,t){var i,n,r,s=this.getFont(t),o=null,a=(o=q.isNullOrUndefined(t.style.textBrushColor)?new R.PdfSolidBrush(new R.PdfColor(0,0,0)):(a=this.hexToRgb(t.style.textBrushColor),new R.PdfSolidBrush(new R.PdfColor(a.r,a.g,a.b))),new R.PdfPageNumberField(s,o)),a=(a.numberStyle=this.getPageNumberStyle(t.pageNumberType),r=q.isNullOrUndefined(t.format)?new R.PdfCompositeField(s,o,n="{0}",a):(r="$current",-1!==t.format.indexOf(l="$total")&&-1!==t.format.indexOf(r)?((i=new R.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 R.PdfCompositeField(s,o,n,a,i)):-1!==t.format.indexOf(r)&&-1===t.format.indexOf(l)?(n=t.format.replace(r,"0"),new R.PdfCompositeField(s,o,n,a)):(i=new R.PdfPageCountField(s),n=t.format.replace(l,"0"),new R.PdfCompositeField(s,o,n,i))),.75*t.position.x),l=.75*t.position.y,s=this.setContentFormat(t,r.stringFormat);null===s||q.isNullOrUndefined(s.format)||q.isNullOrUndefined(s.size)||(r.stringFormat=s.format,r.bounds=new R.RectangleF(a,l,s.size.width,s.size.height)),r.draw(e.graphics,a,l)},D.prototype.drawImage=function(e,t){var i=.75*t.position.x,n=.75*t.position.y,r=q.isNullOrUndefined(t.size)?void 0:.75*t.size.width,s=q.isNullOrUndefined(t.size)?void 0:.75*t.size.height,t=new R.PdfBitmap(t.src);q.isNullOrUndefined(r)?e.graphics.drawImage(t,i,n):e.graphics.drawImage(t,i,n,r,s)},D.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);q.isNullOrUndefined(t.style)||null===t.style||(q.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)},D.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,S=[],v=d?0:1,C=void 0,w=(q.isNullOrUndefined(a)&&((C=t.rows.addRow()).style.setBorder(i),C.style.setFont(n),C.style.setTextBrush(r),C.style.setBackgroundBrush(s)),this.parent.allowRowDragAndDrop&&q.isNullOrUndefined(this.parent.rowDropSettings.targetID)),b=0;b<t.columns.count+v;b++){var I,x,R,T,D,E,O=g.cells[parseInt(m.toString(),10)];if(O.cellType===N.CellType.DetailFooterIntent)b--,m++;else if(w&&O.cellType===N.CellType.Indent)w=!1,b--,m++;else{if(!this.hideColumnInclude){for(;void 0===O.visible;)O.cellType!==N.CellType.DetailFooterIntent&&(q.isNullOrUndefined(a)||q.isNullOrUndefined(a.cells.getCell(b).value)?S.push(""):(S.push(a.cells.getCell(b).value),y=!1,o||(b+=1)),b+=1,m+=1,O=g.cells[parseInt(m.toString(),10)]);for(;!q.isNullOrUndefined(O.visible)&&!O.visible;)m+=1,O=g.cells[parseInt(m.toString(),10)]}O.isDataCell?(D={},I=!q.isNullOrUndefined(O.column.footerTemplate),x=!q.isNullOrUndefined(O.column.groupFooterTemplate),T=!q.isNullOrUndefined(O.column.groupCaptionTemplate),I||T||x?(D=(E=this.getTemplateFunction(D,b,f,O)).templateFunction,f=E.leastCaptionSummaryIndex,T=void 0,R=g.data[O.column.field||O.column.columnName],T=(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?(T=R[O.column.type],q.isNullOrUndefined(T)?"":T):(T=D[q.getEnumValue(N.CellType,O.cellType)](R,this.parent),this.parent.isVue3&&!q.isNullOrUndefined(T[1])?T[1].textContent:q.isNullOrUndefined(T[0])?"":T[0].textContent),y=!1,D={row:g,type:I?"Footer":x?"GroupFooter":"GroupCaption",style:(q.isNullOrUndefined(a)?C:a).cells,cell:O,value:T},this.parent.trigger(zn,D),S.push(D.value)):(E=this.getSummaryWithoutTemplate(g.data[O.column.field]),q.isNullOrUndefined(E)||S.push(E))):S.push(""),y&&""!==S[parseInt(b.toString(),10)]&&!q.isNullOrUndefined(S[parseInt(b.toString(),10)])&&null!==S[parseInt(b.toString(),10)]&&(y=!1),m+=1}}if(!d)if(o)for(b=p.groupSettings.columns.length;b<S.length-1;b++)S[parseInt(b.toString(),10)]=S[b+1],S[b+1]=S[b+2]||"";else S.splice(0,1);if(!y)if(o)for(b=0;b<t.columns.count;b++)a.cells.getCell(b).value=S[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=S[parseInt(b.toString(),10)].toString()}},D.prototype.getTemplateFunction=function(e,t,i,n){return q.isNullOrUndefined(n.column.footerTemplate)||n.cellType!==N.CellType.Summary?q.isNullOrUndefined(n.column.groupCaptionTemplate)?e[q.getEnumValue(N.CellType,N.CellType.GroupSummary)]=q.compile(n.column.groupFooterTemplate):(-1===i&&(i=t),e[q.getEnumValue(N.CellType,N.CellType.CaptionSummary)]=q.compile(n.column.groupCaptionTemplate)):e[q.getEnumValue(N.CellType,N.CellType.Summary)]=q.compile(n.column.footerTemplate),{templateFunction:e,leastCaptionSummaryIndex:i}},D.prototype.getSummaryWithoutTemplate=function(e){if(q.isNullOrUndefined(e.Sum)){if(q.isNullOrUndefined(e.Average)){if(q.isNullOrUndefined(e.Max)){if(q.isNullOrUndefined(e.Min)){if(q.isNullOrUndefined(e.Count)){if(q.isNullOrUndefined(e.TrueCount)){if(q.isNullOrUndefined(e.FalseCount))return q.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},D.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++)q.isNullOrUndefined(e[parseInt(o.toString(),10)].textAlign)||(t.columns.getColumn(o+s).format=this.getHorizontalAlignment(e[parseInt(o.toString(),10)].textAlign)),t.style.allowHorizontalOverflow&&!q.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))},D.prototype.setRecordThemeStyle=function(e,t){q.isNullOrUndefined(this.gridTheme)||q.isNullOrUndefined(this.gridTheme.record)?e.style.setTextBrush(new R.PdfSolidBrush(new R.PdfColor(0,0,0))):(r=q.isNullOrUndefined(this.gridTheme.record.fontName)?R.PdfFontFamily.Helvetica:this.getFontFamily(this.gridTheme.record.fontName),n=q.isNullOrUndefined(this.gridTheme.record.fontSize)?9.75:this.gridTheme.record.fontSize,i=this.getFontStyle(this.gridTheme.record),r=new R.PdfStandardFont(r,n,i),q.isNullOrUndefined(this.gridTheme.record.font)||(r=this.gridTheme.record.font),e.style.setFont(r),n=new R.PdfColor,q.isNullOrUndefined(this.gridTheme.record.fontColor)||(i=this.hexToRgb(this.gridTheme.record.fontColor),n=new R.PdfColor(i.r,i.g,i.b)),e.style.setTextBrush(new R.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},D.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,S=0;S<y;S++){var v=f.cells[parseInt(S.toString(),10)];if(v.cellType===N.CellType.Data){var C,w,b,v=v.column,I=v.field,I=q.isNullOrUndefined(I)?"":v.valueAccessor(I,f.data,v),I=q.isNullOrUndefined(I)?"":I;if(v.isForeignColumn&&v.isForeignColumn()&&(C=a.getFData(I,v),I=q.getValue(v.foreignKeyValue,C)),(b={data:f.data,value:I,column:v,style:void 0,colSpan:1,cell:w=m.cells.getCell(S)}).value="boolean"===b.column.type&&"string"==typeof b.value?b.value:this.exportValueFormatter.formatCellValue(b),this.parent.trigger(yi,b),q.isNullOrUndefined(b.image)||(b.value=new R.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,q.isNullOrUndefined(b.hyperLink)||(w.value=this.setHyperLink(b)),q.isNullOrUndefined(b.style)||this.processCellStyle(w,b),1<b.colSpan){S+1+b.colSpan>m.cells.count&&(b.colSpan=m.cells.count-(S+1)),w.columnSpan=b.colSpan;for(var x=1;x<w.columnSpan;x++)m.cells.getCell(S+x).value="";S+=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 R.PdfPaddings(10,10,10,10),this.parent.childGrid?(i.isPrinting=!0,u=!q.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=q.extend(o,{columns:null,dataSource:null,query:null}),this.parent.trigger(ui,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(gi,b={parentRow:f,row:p,value:{},action:"pdfexport",gridInstance:i}),w.value=this.processDetailTemplate(b))),this.parent.notify(Ki,{type:"pdf",rowObj:f})}return l},D.prototype.processDetailTemplate=function(e){var o=this;if(e.value.columnHeader||e.value.rows){var t=new R.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,q.isNullOrUndefined(r.image)||(s.value=new R.PdfBitmap(r.image.base64),s.value.height=r.image.height,s.value.width=r.image.width),q.isNullOrUndefined(r.hyperLink)||(s.value=o.setHyperLink(r)),q.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 R.PdfBitmap(e.value.image.base64):e.value.text||(e.value.hyperLink?this.setHyperLink(e.value):"")},D.prototype.setHyperLink=function(e){var t=new R.PdfTextWebLink;return t.url=e.hyperLink.target,t.text=e.hyperLink.displayText||e.hyperLink.target,t.font=new R.PdfStandardFont(R.PdfFontFamily.Helvetica,9.75),t.brush=new R.PdfSolidBrush(new R.PdfColor(51,102,187)),t},D.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(),q.detach(i.element),r.gridPool[i.id]=!0,r.helper.checkAndExport(r.gridPool,r.globalResolve),t}},D.prototype.processCellStyle=function(e,t){var i,n,r,s;q.isNullOrUndefined(t.style.backgroundColor)||(i=this.hexToRgb(t.style.backgroundColor),e.style.backgroundBrush=new R.PdfSolidBrush(new R.PdfColor(i.r,i.g,i.b))),q.isNullOrUndefined(t.style.textAlignment)||(e.style.stringFormat=this.getHorizontalAlignment(t.style.textAlignment)),q.isNullOrUndefined(t.style.cellPadding)||(e.style.cellPadding=t.style.cellPadding),q.isNullOrUndefined(t.style.verticalAlignment)||(e.style.stringFormat=this.getVerticalAlignment(t.style.verticalAlignment,e.style.stringFormat)),q.isNullOrUndefined(t.style.textBrushColor)||(i=this.hexToRgb(t.style.textBrushColor),e.style.textBrush=new R.PdfSolidBrush(new R.PdfColor(i.r,i.g,i.b))),q.isNullOrUndefined(t.style.textPenColor)||(i=this.hexToRgb(t.style.textPenColor),e.style.textPen=new R.PdfPen(new R.PdfColor(i.r,i.g,i.b))),q.isNullOrUndefined(t.style.fontFamily)&&q.isNullOrUndefined(t.style.fontSize)&&q.isNullOrUndefined(t.style.bold)&&q.isNullOrUndefined(t.style.italic)&&q.isNullOrUndefined(t.style.underline)&&q.isNullOrUndefined(t.style.strikeout)||(e.style.font=this.getFont(t)),q.isNullOrUndefined(t.style.border)||(i=new R.PdfBorders,n=t.style.border.width,n=q.isNullOrUndefined(n)||"number"!=typeof n?void 0:.75*n,r=new R.PdfColor(196,196,196),q.isNullOrUndefined(t.style.border.color)||(s=this.hexToRgb(t.style.border.color),r=new R.PdfColor(s.r,s.g,s.b)),s=new R.PdfPen(r,n),q.isNullOrUndefined(t.style.border.dashStyle)||(s.dashStyle=this.getDashStyle(t.style.border.dashStyle)),i.all=s,e.style.borders=i),q.isNullOrUndefined(t.style.paragraphIndent)||(e.style.stringFormat=new R.PdfStringFormat,e.style.stringFormat.paragraphIndent=t.style.paragraphIndent)},D.prototype.getHorizontalAlignment=function(e,t){switch(void 0===t&&(t=new R.PdfStringFormat),e){case"Right":t.alignment=R.PdfTextAlignment.Right;break;case"Center":t.alignment=R.PdfTextAlignment.Center;break;case"Justify":t.alignment=R.PdfTextAlignment.Justify;break;case"Left":t.alignment=R.PdfTextAlignment.Left}return t},D.prototype.getVerticalAlignment=function(e,t,i){switch(void 0===t&&(t=new R.PdfStringFormat,t=this.getHorizontalAlignment(i,t)),e){case"Bottom":t.lineAlignment=R.PdfVerticalAlignment.Bottom;break;case"Middle":t.lineAlignment=R.PdfVerticalAlignment.Middle;break;case"Top":t.lineAlignment=R.PdfVerticalAlignment.Top}return t},D.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}},D.prototype.getFont=function(e){var t,i,n;return e.font||(t=q.isNullOrUndefined(e.style.fontSize)?9.75:.75*e.style.fontSize,i=q.isNullOrUndefined(e.style.fontFamily)?R.PdfFontFamily.TimesRoman:this.getFontFamily(e.style.fontFamily),n=R.PdfFontStyle.Regular,!q.isNullOrUndefined(e.style.bold)&&e.style.bold&&(n|=R.PdfFontStyle.Bold),!q.isNullOrUndefined(e.style.italic)&&e.style.italic&&(n|=R.PdfFontStyle.Italic),!q.isNullOrUndefined(e.style.underline)&&e.style.underline&&(n|=R.PdfFontStyle.Underline),!q.isNullOrUndefined(e.style.strikeout)&&e.style.strikeout&&(n|=R.PdfFontStyle.Strikeout),new R.PdfStandardFont(i,t,n))},D.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}},D.prototype.setContentFormat=function(e,t){if(q.isNullOrUndefined(e.size))return null;var i=.75*e.size.width,n=.75*e.size.height;if(t=new R.PdfStringFormat(R.PdfTextAlignment.Left,R.PdfVerticalAlignment.Middle),!q.isNullOrUndefined(e.style.hAlign))switch(e.style.hAlign){case"Right":t.alignment=R.PdfTextAlignment.Right;break;case"Center":t.alignment=R.PdfTextAlignment.Center;break;case"Justify":t.alignment=R.PdfTextAlignment.Justify;break;default:t.alignment=R.PdfTextAlignment.Left}return{format:t=q.isNullOrUndefined(e.style.vAlign)?t:this.getVerticalAlignment(e.style.vAlign,t),size:new R.SizeF(i,n)}},D.prototype.getPageSize=function(e){switch(e){case"Letter":return new R.SizeF(612,792);case"Note":return new R.SizeF(540,720);case"Legal":return new R.SizeF(612,1008);case"A0":return new R.SizeF(2380,3368);case"A1":return new R.SizeF(1684,2380);case"A2":return new R.SizeF(1190,1684);case"A3":return new R.SizeF(842,1190);case"A5":return new R.SizeF(421,595);case"A6":return new R.SizeF(297,421);case"A7":return new R.SizeF(210,297);case"A8":return new R.SizeF(148,210);case"A9":return new R.SizeF(105,148);case"B0":return new R.SizeF(2836,4008);case"B1":return new R.SizeF(2004,2836);case"B2":return new R.SizeF(1418,2004);case"B3":return new R.SizeF(1002,1418);case"B4":return new R.SizeF(709,1002);case"B5":return new R.SizeF(501,709);case"Archa":return new R.SizeF(648,864);case"Archb":return new R.SizeF(864,1296);case"Archc":return new R.SizeF(1296,1728);case"Archd":return new R.SizeF(1728,2592);case"Arche":return new R.SizeF(2592,3456);case"Flsa":return new R.SizeF(612,936);case"HalfLetter":return new R.SizeF(396,612);case"Letter11x17":return new R.SizeF(792,1224);case"Ledger":return new R.SizeF(1224,792);default:return new R.SizeF(595,842)}},D.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}},D.prototype.getPenFromContent=function(e){var t=new R.PdfPen(new R.PdfColor(0,0,0));return q.isNullOrUndefined(e.style)||null===e.style||q.isNullOrUndefined(e.style.penColor)||(e=this.hexToRgb(e.style.penColor),t=new R.PdfPen(new R.PdfColor(e.r,e.g,e.b))),t},D.prototype.getBrushFromContent=function(e){var t=null;return q.isNullOrUndefined(e.style.textBrushColor)||(e=this.hexToRgb(e.style.textBrushColor),t=new R.PdfSolidBrush(new R.PdfColor(e.r,e.g,e.b))),t},D.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}},D.prototype.getFontStyle=function(e){var t=R.PdfFontStyle.Regular;return!q.isNullOrUndefined(e)&&e.bold&&(t|=R.PdfFontStyle.Bold),!q.isNullOrUndefined(e)&&e.italic&&(t|=R.PdfFontStyle.Italic),!q.isNullOrUndefined(e)&&e.underline&&(t|=R.PdfFontStyle.Underline),!q.isNullOrUndefined(e)&&e.strikeout&&(t|=R.PdfFontStyle.Strikeout),t},D.prototype.getBorderStyle=function(e){var t,i,n,r=new R.PdfBorders;return q.isNullOrUndefined(e)?r.all=new R.PdfPen(new R.PdfColor(234,234,234)):(t=e.width,t=q.isNullOrUndefined(t)||"number"!=typeof t?void 0:.75*t,i=new R.PdfColor(196,196,196),q.isNullOrUndefined(e.color)||(n=this.hexToRgb(e.color),i=new R.PdfColor(n.r,n.g,n.b)),n=new R.PdfPen(i,t),q.isNullOrUndefined(e.dashStyle)||(n.dashStyle=this.getDashStyle(e.dashStyle)),r.all=n),r},D.prototype.destroy=function(){};var bu=D;function D(e){this.hideColumnInclude=!1,this.currentViewData=!1,this.customDataSource=!1,this.isGrouping=!1,this.headerOnPages=[],this.drawPosition={xPosition:0,yPosition:0},this.parent=e,this.helper=new mu(e),this.gridPool={}}Iu=function(e,t){return(Iu=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}Iu(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Tu,xu=eo),Tu.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&&x(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&&x(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(Fr,this.destroyButtons)},Tu.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?fh(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?(q.addClass([].slice.call(s.getElementsByClassName("e-edit-delete")),"e-hide"),q.removeClass([].slice.call(s.getElementsByClassName("e-save-cancel")),"e-hide")):(q.addClass([].slice.call(s.getElementsByClassName("e-save-cancel")),"e-hide"),q.removeClass([].slice.call(s.getElementsByClassName("e-edit-delete")),"e-hide")),this.parent.isFrozenGrid()&&kd(this.parent,e.column,s),s},Tu.prototype.renderButton=function(e,t,i,n){var r=this.buttonElement.cloneNode(),i=(q.attributes(r,{id:this.parent.element.id+(t.type||"")+"_"+i+"_"+n,type:"button",title:q.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":q.addClass([r],["e-edit-delete","e-"+t.type.toLowerCase()+"button"]);break;case"Cancel":case"Save":q.addClass([r],["e-save-cancel","e-"+t.type.toLowerCase()+"button"])}return e};var Iu,xu,Ru=Tu;function Tu(e,t){e=xu.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(Fr,e.destroyButtons,e),e}Eu.prototype.initiateRender=function(){this.locator.getService("cellRendererFactory").addCellRenderer(N.CellType.CommandColumn,new Ru(this.parent,this.locator))},Eu.prototype.commandClickHandler=function(e){var t=this.parent,i=q.closest(e.target,"button");if(i&&q.closest(e.target,".e-unboundcell")){for(var n,r=i.ej2_instances[0],s=r.commandType,o=i.getAttribute("data-uid"),e=t.getRowObjectFromUID(q.closest(i,"."+I).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(q.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:q.isNullOrUndefined(e)?void 0:e.data};this.parent.trigger(st,e,function(e){if(!r.disabled&&t.editModule&&!e.cancel)switch(s){case"Edit":t.editModule.endEdit(),t.editModule.startEdit(q.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(q.closest(i,"tr").getAttribute(T),10)-1,t.clearSelection(),t.selectRow(t.commandDelIndex,!1),t.isFocusFirstCell=!0,t.editModule.deleteRecord(),t.editSettings.showDeleteConfirmDialog&&!t.allowSelection||(t.commandDelIndex=void 0)}})}},Eu.prototype.getModuleName=function(){return"commandColumn"},Eu.prototype.destroy=function(){this.parent.isDestroyed||this.removeEventListener()},Eu.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Nt,this.commandClickHandler),this.parent.off(Pt,this.keyPressHandler),this.parent.off(dt,this.load),this.parent.off(s,this.destroy))},Eu.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(Nt,this.commandClickHandler,this),this.parent.on(Pt,this.keyPressHandler,this),this.parent.on(dt,this.load,this),this.parent.on(s,this.destroy,this))},Eu.prototype.keyPressHandler=function(e){"enter"!==e.action&&"space"!==e.action||!q.closest(e.target,".e-unboundcelldiv")||(this.commandClickHandler(e),e.preventDefault())},Eu.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=gh("gridcommand")};var Du=Eu;function Eu(e,t){this.parent=e,this.locator=t,this.initiateRender(),this.addEventListener()}var E={header:"."+ts,content:"."+is,edit:".e-inline-edit",batchEdit:".e-editedbatchcell",editIcon:"e-edit",pager:".e-gridpager",delete:"e-delete",save:"e-save",cancel:"e-cancel",copy:"e-copy",pdf:"e-pdfexport",group:"e-icon-group",ungroup:"e-icon-ungroup",csv:"e-csvexport",excel:"e-excelexport",fPage:"e-icon-first",nPage:"e-icon-next",lPage:"e-icon-last",pPage:"e-icon-prev",ascending:"e-icon-ascending",descending:"e-icon-descending",groupHeader:"e-groupdroparea",touchPop:"e-gridpopup",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"},Ou=(ku.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(g,this.enableAfterRenderMenu,this),this.parent.on(ht,this.render,this),this.parent.on(s,this.destroy,this))},ku.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ht,this.render),this.parent.off(g,this.enableAfterRenderMenu),this.parent.off(s,this.destroy),q.EventHandler.remove(this.element,"keydown",this.keyDownHandler.bind(this)))},ku.prototype.keyDownHandler=function(e){"Tab"!==e.code&&9!==e.which||this.contextMenu.close(),"Escape"===e.code&&(this.contextMenu.close(),this.parent.notify(cn,{}))},ku.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"}),q.EventHandler.add(this.element,"keydown",this.keyDownHandler.bind(this)),this.parent.element.appendChild(this.element);var e="#"+this.gridID;this.contextMenu=new z.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=wd(this.parent),this.contextMenu.appendTo(this.element)},ku.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.contextMenu&&(this.contextMenu.destroy(),q.remove(this.element),this.parent.element.classList.remove("e-noselect")),this.render())},ku.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},ku.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},ku.prototype.contextMenuOpen=function(){this.isOpen=!0},ku.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?this.row&&this.cell&&!isNaN(parseInt(this.cell.getAttribute(ws),10)-1)&&this.parent.editModule.editCell(parseInt(this.row.getAttribute(T),10)-1,this.parent.getColumns()[parseInt(this.cell.getAttribute(ws),10)-1].field):(this.parent.editModule.endEdit(),this.parent.editModule.startEdit(this.row)));break;case"Delete":this.parent.editModule&&("Batch"!==this.parent.editSettings.mode&&this.parent.editModule.endEdit(),1===this.parent.getSelectedRecords().length?(this.parent.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(vi,e)},ku.prototype.contextMenuOnClose=function(e){0<e.items.length&&e.items[0].parentObj instanceof z.ContextMenu&&this.updateItemStatus(),this.parent.notify(fr,{isOpen:!1})},ku.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[""+e])},ku.prototype.updateItemStatus=function(){this.contextMenu.showItems(this.hiddenItems),this.contextMenu.enableItems(this.disableItems),this.hiddenItems=[],this.disableItems=[],this.isOpen=!1},ku.prototype.contextMenuBeforeOpen=function(e){var t=q.closest(e.event.target,".e-grid");if(e.event&&t&&t!==this.parent.element)e.cancel=!0;else if(e.event&&(q.closest(e.event.target,"."+E.groupHeader)||q.closest(e.event.target,"."+E.touchPop)||q.closest(e.event.target,".e-summarycell")||q.closest(e.event.target,".e-groupcaption")||q.closest(e.event.target,".e-filterbarcell"))||this.parent.editSettings.showAddNewRow&&q.closest(e.event.target,".e-addedrow")&&this.parent.element.querySelector(".e-editedrow"))e.cancel=!0;else{this.targetColumn=this.getColumn(e.event),x(e.event.target,"e-grid")&&(this.targetRowdata=this.parent.getRowInfo(e.event.target)),q.isNullOrUndefined(e.parentItem)&&this.targetColumn&&this.targetRowdata.cell&&(this.parent.notify(fr,{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,E.edit)||this.ensureTarget(e.event.target,E.batchEdit)))"Save"!==a&&"Cancel"!==a&&this.hiddenItems.push(o.text);else{if(this.parent.editModule&&"Batch"===this.parent.editSettings.mode&&(q.closest(e.event.target,".e-gridform")||this.parent.editModule.getBatchChanges()[fs].length||this.parent.editModule.getBatchChanges()[ms].length||this.parent.editModule.getBatchChanges()[ys].length)&&("Save"===a||"Cancel"===a))continue;q.isNullOrUndefined(e.parentItem)&&e.event&&!q.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||q.isNullOrUndefined(this.targetRowdata.row)||!this.targetRowdata.row.classList.contains("e-grid-pin-row"))&&("UnpinRow"!==a||q.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(wi,e),(e.cancel||this.hiddenItems.length===e.items.length&&!e.parentItem)&&(this.updateItemStatus(),e.cancel=!0)}nd(this.parent.element,this.contextMenu.element.parentElement)},ku.prototype.contextMenuBeforeClose=function(e){e.column=this.targetColumn,e.rowInfo=this.targetRowdata,this.parent.trigger(bi,e)},ku.prototype.ensureTarget=function(e,t){var i=e;return(i=!this.ensureFrozenHeader(e)||t!==E.header&&t!==E.content?t===E.content||t===E.header?x(q.closest(e,"."+ds),t.substr(1,t.length)):q.closest(e,t):q.closest(e,t===E.header?"thead":H))&&x(i,"e-grid")===this.parent.element},ku.prototype.ensureFrozenHeader=function(e){return!(!this.parent.frozenRows&&!this.parent.pinnedTopRecords.length||!q.closest(e,E.header))},ku.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"AutoFitAll":case"AutoFit":t=!(this.parent.ensureModuleInjected(Jp)&&!this.parent.isEdit)||this.targetColumn&&!this.targetColumn.field&&"AutoFit"===e;break;case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(ec)&&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(ec)&&!(this.parent.ensureModuleInjected(ec)&&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(Cu)||this.parent.allowPdfExport&&this.parent.ensureModuleInjected(bu)||(t=!0);break;case"PdfExport":this.parent.allowPdfExport&&this.parent.ensureModuleInjected(bu)||(t=!0);break;case"ExcelExport":case"CsvExport":this.parent.allowExcelExport&&this.parent.ensureModuleInjected(Cu)||(t=!0);break;case"SortAscending":case"SortDescending":if(!this.parent.allowSorting||!this.parent.ensureModuleInjected(pp)||this.targetColumn&&!this.targetColumn.field)t=!0;else if(this.parent.ensureModuleInjected(pp)&&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(xp)&&0!==this.parent.getCurrentViewRecords().length&&(!this.parent.ensureModuleInjected(xp)||1!==this.parent.pageSettings.currentPage)||(t=!0);break;case"LastPage":case"NextPage":this.parent.allowPaging&&this.parent.ensureModuleInjected(xp)&&0!==this.parent.getCurrentViewRecords().length&&(!this.parent.ensureModuleInjected(xp)||this.parent.pageSettings.currentPage!==this.getLastPage())||(t=!0);break;case"Chart":t=!this.parent.getSelectedRecords().length}return t},ku.prototype.getContextMenu=function(){return this.element},ku.prototype.destroy=function(){var e=this.parent.element;e&&(e.querySelector("."+ts)||e.querySelector("."+is))&&(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&&q.remove(this.element),this.parent.element.classList.remove("e-noselect"))},ku.prototype.getModuleName=function(){return"contextMenu"},ku.prototype.generateID=function(e){return this.gridID+"_cmenu_"+e},ku.prototype.getKeyFromId=function(e){return e.replace(this.gridID+"_cmenu_","")},ku.prototype.buildDefaultItems=function(e){var t;switch(e){case"AutoFitAll":t={target:E.header,iconCss:E.autofitall};break;case"AutoFit":t={target:E.header,iconCss:E.autofit};break;case"Group":t={target:E.header,iconCss:E.group};break;case"Ungroup":t={target:E.header,iconCss:E.ungroup};break;case"Edit":t={target:E.content,iconCss:E.editIcon};break;case"Delete":t={target:E.content,iconCss:E.delete};break;case"Save":t={target:E.edit,iconCss:E.save};break;case"Cancel":t={target:E.edit,iconCss:E.cancel};break;case"Copy":t={target:E.content,iconCss:E.copy};break;case"export":t={target:E.content};break;case"PdfExport":t={target:E.content,iconCss:E.pdf};break;case"ExcelExport":t={target:E.content,iconCss:E.excel};break;case"CsvExport":t={target:E.content,iconCss:E.csv};break;case"SortAscending":t={target:E.header,iconCss:E.ascending};break;case"SortDescending":t={target:E.header,iconCss:E.descending};break;case"FirstPage":t={target:E.pager,iconCss:E.fPage};break;case"PrevPage":t={target:E.pager,iconCss:E.pPage};break;case"LastPage":t={target:E.pager,iconCss:E.lPage};break;case"NextPage":t={target:E.pager,iconCss:E.nPage};break;case"Chart":t={target:E.content,iconCss:E.chart};break;case"BarChart":t={target:E.content,iconCss:E.barChart};break;case"Bar":t={target:E.content,iconCss:E.bar};break;case"StackingBar":t={target:E.content,iconCss:E.stackingBar};break;case"StackingBar100":t={target:E.content,iconCss:E.stackingBar100};break;case"Pie":t={target:E.content,iconCss:E.pie};break;case"ColumnChart":t={target:E.content,iconCss:E.columnChart};break;case"Column":t={target:E.content,iconCss:E.column};break;case"StackingColumn":t={target:E.content,iconCss:E.stackingColumn};break;case"StackingColumn100":t={target:E.content,iconCss:E.stackingColumn100};break;case"LineChart":t={target:E.content,iconCss:E.lineChart};break;case"Line":t={target:E.content,iconCss:E.line};break;case"StackingLine":t={target:E.content,iconCss:E.stackingLine};break;case"StackingLine100":t={target:E.content,iconCss:E.stackingLine100};break;case"AreaChart":t={target:E.content,iconCss:E.areaChart};break;case"Area":t={target:E.content,iconCss:E.area};break;case"StackingArea":t={target:E.content,iconCss:E.stackingArea};break;case"StackingArea100":t={target:E.content,iconCss:E.stackingArea100};break;case"Scatter":t={target:E.content,iconCss:E.scatter};break;case"PinRow":t={target:".e-rowcell",iconCss:E.pin};break;case"UnpinRow":t={target:".e-rowcell",iconCss:E.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]},ku.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)},ku.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"}},ku.prototype.getColumn=function(e){var t=q.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},ku.prototype.selectRow=function(e,t){this.cell=e.target,this.row=q.closest(e.target,"tr.e-row")||this.row,this.row&&t&&!x(e.target,"e-gridpager")&&this.parent.selectRow(parseInt(this.row.getAttribute(T),10)-1)},ku);function ku(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()}Fu.prototype.getModuleName=function(){return"freeze"},Fu.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ht,this.instantiateRenderer,this),this.parent.on(s,this.destroy,this))},Fu.prototype.instantiateRenderer=function(){this.parent.log("limitation",this.getModuleName())},Fu.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ht,this.instantiateRenderer),this.parent.off(s,this.destroy))},Fu.prototype.destroy=function(){this.removeEventListener()};var Au=Fu;function Fu(e,t){this.parent=e,this.locator=t,this.addEventListener()}O.prototype.wireEvents=function(){if(!this.parent.enableAdaptiveUI)for(var e=this.getColumnMenuHandlers(),t=0;t<e.length;t++)q.EventHandler.add(e[parseInt(t.toString(),10)],"mousedown",this.columnMenuHandlerDown,this)},O.prototype.unwireEvents=function(){if(!this.parent.enableAdaptiveUI)for(var e=this.getColumnMenuHandlers(),t=0;t<e.length;t++)q.EventHandler.remove(e[parseInt(t.toString(),10)],"mousedown",this.columnMenuHandlerDown)},O.prototype.setFullScreenDialog=function(){this.serviceLocator&&this.serviceLocator.registerAdaptiveService(this,this.parent.enableAdaptiveUI,N.ResponsiveDialogAction.isColMenu)},O.prototype.destroy=function(){var e=this.parent.element;(e.querySelector("."+is)||e.querySelector("."+ts))&&e&&(this.columnMenu&&this.columnMenu.destroy(),this.removeEventListener(),this.unwireFilterEvents(),this.unwireEvents(),!this.parent.enableAdaptiveUI)&&this.element.parentNode&&q.remove(this.element)},O.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(zr,{action:4}),this.parent.notify(Ti,{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)))},O.prototype.openColumnMenuByField=function(e){this.openColumnMenu({target:this.parent.getColumnHeaderByField(e).querySelector(".e-columnmenu")})},O.prototype.afterFilterColumnMenuClose=function(){this.columnMenu&&(this.columnMenu.items=this.getItems(),this.columnMenu.dataBind(),this.columnMenu.close())},O.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();this.element.style.cssText="display:none;visibility:visible",this.headerCell=this.getHeaderCell(e),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+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+n.height),r.left+s.width+1>=o.right&&(r.left-=35)),this.columnMenu.open(r.top,r.left),e.preventDefault&&e.preventDefault(),nd(this.parent.element,this.columnMenu.element.parentElement)},O.prototype.columnMenuHandlerDown=function(){this.isOpen=!("none"===this.element.style.display||""===this.element.style.display)},O.prototype.getColumnMenuHandlers=function(){return[].slice.call(this.parent.getHeaderTable().getElementsByClassName(this.ROOT))},O.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(yt,this.wireEvents,this),this.parent.on(g,this.enableAfterRenderMenu,this),this.parent.on(dt,this.render,this),this.isFilterItemAdded()&&this.parent.on(Di,this.filterPosition,this),this.parent.on(hr,this.setFullScreenDialog,this),this.parent.on(zr,this.renderResponsiveChangeAction,this),this.parent.on(Nt,this.columnMenuHandlerClick,this),this.parent.on(kr,this.afterFilterColumnMenuClose,this),this.parent.on(Pt,this.keyPressHandler,this),this.parent.on(s,this.destroy,this))},O.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(yt,this.unwireEvents),this.parent.off(g,this.enableAfterRenderMenu),this.parent.off(dt,this.render),this.isFilterItemAdded()&&this.parent.off(Di,this.filterPosition),this.parent.off(hr,this.setFullScreenDialog),this.parent.off(zr,this.renderResponsiveChangeAction),this.parent.off(Nt,this.columnMenuHandlerClick),this.parent.on(kr,this.afterFilterColumnMenuClose),this.parent.off(Pt,this.keyPressHandler),this.parent.off(s,this.destroy))},O.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))},O.prototype.enableAfterRenderMenu=function(e){e.module===this.getModuleName()&&e.enable&&(this.columnMenu&&(this.columnMenu.destroy(),q.remove(this.element)),this.parent.enableAdaptiveUI||this.render())},O.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 z.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=wd(this.parent),this.element&&x(this.element,"e-popup")&&this.element.classList.add(this.COL_POP),this.columnMenu.appendTo(this.element),this.wireFilterEvents())},O.prototype.wireFilterEvents=function(){!q.Browser.isDevice&&this.isFilterItemAdded()&&q.EventHandler.add(this.element,"mouseover",this.appendFilter,this)},O.prototype.unwireFilterEvents=function(){q.Browser.isDevice||!this.isFilterItemAdded()||this.parent.enableAdaptiveUI||q.EventHandler.remove(this.element,"mouseover",this.appendFilter)},O.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")},O.prototype.columnMenuBeforeClose=function(e){var t;e.column=this.targetColumn,this.parent.trigger(Ri,e),e.event&&e.event.target instanceof Document&&"scroll"===e.event.type?this.parent.enableStickyHeader||(e.cancel=!0):(t=e.event?q.closest(e.event.target,".e-menu-item"):null,!q.isNullOrUndefined(e.parentItem)&&"ColumnChooser"===this.getKeyFromId(e.parentItem.id)&&t&&this.isChooserItem(t)?e.cancel=!e.event||"Escape"!==e.event.code:e.event&&(q.closest(e.event.target,"."+this.POP)||e.event.currentTarget&&e.event.currentTarget.activeElement&&x(e.event.currentTarget.activeElement,"e-filter-popup")||x(e.event.target,"e-popup")&&x(e.event.target,"e-colmenu-popup")||x(e.event.target,"e-multiselect-flmenu")||x(e.event.target,"e-popup-wrapper"))&&!q.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))},O.prototype.isChooserItem=function(e){return e.id&&0<=e.id.indexOf("_colmenu_")&&-1===this.getKeyFromId(e.id,this.CHOOSER).indexOf("_colmenu_")},O.prototype.columnMenuBeforeOpen=function(e){e.column=this.targetColumn=this.getColumn(),this.parent.trigger(xi,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)},O.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")},O.prototype.ensureDisabledStatus=function(e){var t=!1;switch(e){case"Group":(!this.parent.allowGrouping||this.parent.ensureModuleInjected(ec)&&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(Jp);break;case"Ungroup":(!this.parent.ensureModuleInjected(ec)||this.parent.ensureModuleInjected(ec)&&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(pp)&&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(pp)&&(!this.parent.allowSorting||!this.targetColumn||this.targetColumn.allowSorting)||(t=!0);break;case"Filter":this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(Xp)&&this.targetColumn&&this.targetColumn.allowFiltering?t=!1:!this.parent.ensureModuleInjected(Xp)||!this.targetColumn||this.targetColumn.allowFiltering&&this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type||(t=!0)}return t},O.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(Ii,e)},O.prototype.columnMenuOnClose=function(e){0<e.items.length&&e.items[0].parentObj instanceof z.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),q.isNullOrUndefined(e.parentItem)||"ColumnChooser"!==this.getKeyFromId(e.parentItem.id)?this.parent.notify(cn,{}):this.columnMenu.element.querySelector(".e-selected")&&this.columnMenu.element.querySelector(".e-selected").focus()},O.prototype.getDefaultItems=function(){return["AutoFitAll","AutoFit","SortAscending","SortDescending","Group","Ungroup","ColumnChooser","Filter"]},O.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},O.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]},O.prototype.getLocaleText=function(e){return this.l10n.getConstant(this.localeText[""+e])},O.prototype.generateID=function(e,t){return this.gridID+"_colmenu_"+(t?t+e:e)},O.prototype.getKeyFromId=function(e,t){return 0<e.indexOf("_colmenu_")&&e.replace(this.gridID+"_colmenu_"+(t||""),"")},O.prototype.getColumnMenu=function(){return this.element},O.prototype.getModuleName=function(){return"columnMenu"},O.prototype.setLocaleKey=function(){return{AutoFitAll:"autoFitAll",AutoFit:"autoFit",Group:"Group",Ungroup:"Ungroup",SortAscending:"SortAscending",SortDescending:"SortDescending",ColumnChooser:"Columnchooser",Filter:"FilterMenu"}},O.prototype.getHeaderCell=function(e){return q.closest(e.target,"th.e-headercell")},O.prototype.getColumn=function(){var e;return this.headerCell?(e=this.headerCell.querySelector(".e-headercelldiv").getAttribute("data-mappinguid"),this.parent.getColumnByUid(e)):null},O.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},O.prototype.appendFilter=function(e){var t;this.defaultItems.Filter&&(t=this.defaultItems.Filter.id,q.closest(e.target,"#"+t)&&!this.isFilterPopupOpen()?this.getFilter(e.target,t):!q.closest(e.target,"#"+t)&&this.isFilterPopupOpen()&&this.getFilter(e.target,t,!0))},O.prototype.getFilter=function(e,t,i){var n,r=this.getFilterPop();r?(r.style.display=!q.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,q.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(Ti,{col:this.targetColumn,target:e,isClose:i,id:t})},O.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"},O.prototype.filterPosition=function(){var e,t,i=this.getFilterPop();this.parent.enableAdaptiveUI||(i.classList.add(this.WRAP),!q.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"))},O.prototype.getDefault=function(){var e=[];return this.parent.ensureModuleInjected(Jp)&&(e.push("AutoFitAll"),e.push("AutoFit")),this.parent.allowGrouping&&this.parent.ensureModuleInjected(ec)&&(e.push("Group"),e.push("Ungroup")),this.parent.allowSorting&&this.parent.ensureModuleInjected(pp)&&(e.push("SortAscending"),e.push("SortDescending")),e.push("ColumnChooser"),this.parent.allowFiltering&&"FilterBar"!==this.parent.filterSettings.type&&this.parent.ensureModuleInjected(Xp)&&e.push("Filter"),e},O.prototype.isFilterPopupOpen=function(){var e=this.getFilterPop();return e&&"none"!==e.style.display},O.prototype.getFilterPop=function(){var e,t;return!q.isNullOrUndefined(this.targetColumn)&&"Menu"===this.parent.filterSettings.type&&q.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=q.closest(this.parent.element,".e-gantt"))?t.querySelector("."+this.POP):null:e},O.prototype.isFilterItemAdded=function(){return this.parent.columnMenuItems&&0<=this.parent.columnMenuItems.indexOf("Filter")||!this.parent.columnMenuItems},O.prototype.renderResponsiveChangeAction=function(e){this.responsiveDialogRenderer.action=e.action};var Mu=O;function O(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()}Lu=function(e,t){return(Lu=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}Lu(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Bu,Pu=Wr),Bu.prototype.initEvent=function(){this.parent.isDestroyed||(this.parent.on(Oi,this.initForeignKeyColumns,this),this.parent.on(ki,this.getForeignKeyData,this),this.parent.on(Ai,this.generateQueryFormData,this))},Bu.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 U.DataManager?e[parseInt(t.toString(),10)].dataSource:q.isNullOrUndefined(e[parseInt(t.toString(),10)].dataSource)?new U.DataManager:"result"in e[parseInt(t.toString(),10)].dataSource?e[parseInt(t.toString(),10)].dataSource:new U.DataManager(e[parseInt(t.toString(),10)].dataSource)},Bu.prototype.eventfPromise=function(e,t,i,n){var t=this.getStateEventArgument(t),r=new U.Deferred,s=new U.Deferred,o=(t.action=e.action,this.parent.getDataModule());return!q.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(Li,t)):(o.setForeignKeyDataState({}),r.resolve(i)),r},Bu.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=q.extend(s[parseInt(t.toString(),10)].edit.params,{dataSource:e[parseInt(t.toString(),10)].result,query:new U.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})},Bu.prototype.generateQueryFormData=function(e){e.predicate.predicate=this.genarateQuery(e.column,e.column.columnData,!0)},Bu.prototype.genarateQuery=function(e,t,i,n){var r,s=this.parent,o=[],a=new U.Query,l=i?e.foreignKeyField:e.field;if(this.parent.searchSettings&&this.parent.searchSettings.key.length&&(r=(new U.Query).where(e.foreignKeyValue,"contains",this.parent.searchSettings.key,!0),t=new U.DataManager(t).executeLocal(r)),s.allowPaging||s.enableVirtualization||i){t=new U.DataManager(s.allowGrouping&&s.groupSettings.columns.length&&!i?t.records:t).executeLocal((new U.Query).select(l));for(var h=U.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(_h({field:l,operator:"equal",value:h[parseInt(d.toString(),10)],matchCase:!1})):o.push(new U.Predicate(l,"equal",h[parseInt(d.toString(),10)],!1))}return n?o.length?a.where(U.Predicate.or(o)):a:o.length?U.Predicate.or(o):{predicates:[]}},Bu.prototype.genarateColumnQuery=function(e){var t=this.parent,i=new U.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 U.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},Bu.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}},Bu.prototype.getModuleName=function(){return"foreignKey"},Bu.prototype.destroy=function(){this.destroyEvent()},Bu.prototype.destroyEvent=function(){this.parent.isDestroyed||(this.parent.off(Oi,this.initForeignKeyColumns),this.parent.off(ki,this.getForeignKeyData),this.parent.off(Ai,this.generateQueryFormData))};var Lu,Pu,Nu=Bu;function Bu(e,t){var i=Pu.call(this,e,t)||this;return i.parent=e,i.serviceLocator=t,i.initEvent(),i}k.prototype.getModuleName=function(){return"infiniteScroll"},k.prototype.addEventListener=function(){this.parent.on(pt,this.onDataReady,this),this.parent.on(_t,this.dataSourceModified,this),this.parent.on(Dn,this.infinitePageQuery,this),this.parent.on(Tn,this.infiniteScrollHandler,this),this.parent.on(Mt,this.infiniteCellFocus,this),this.parent.on(On,this.appendInfiniteRows,this),this.parent.on(kn,this.removeInfiniteCacheRows,this),this.parent.on(Rn,this.resetInfiniteBlocks,this),this.parent.on(An,this.setCache,this),this.parent.on(Mn,this.ensureIntialCollapse,this),this.parent.on(Pt,this.infiniteCellFocus,this),this.parent.on(En,this.setDisplayNone,this),this.parent.on(mn,this.editActionBegin,this),this.parent.on(In,this.getVirtualInfiniteData,this),this.parent.on(wn,this.resetInfiniteEdit,this),this.parent.on(yn,this.infiniteEditSuccess,this),this.parent.on(Cn,this.refreshInfiniteCache,this),this.parent.on(Or,this.refreshInfiniteEditrowindex,this),this.parent.on(Fn,this.infiniteEditHandler,this),this.parent.on(bn,this.infiniteAddActionBegin,this),this.parent.on(ft,this.modelChanged,this),this.parent.on(tr,this.refreshInfiniteCurrentViewData,this),this.parent.on(s,this.destroy,this),this.parent.on(ct,this.selectNewRow,this),this.parent.on(Dr,this.captionActionComplete,this),this.parent.on(gr,this.setGroupCollapsePageQuery,this),this.parent.on(Hr,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(p,this.actionCompleteFunction),this.parent.addEventListener(ae,this.dataBoundFunction)},k.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(pt,this.onDataReady),this.parent.off(_t,this.dataSourceModified),this.parent.off(Dn,this.infinitePageQuery),this.parent.off(Tn,this.infiniteScrollHandler),this.parent.off(Mt,this.infiniteCellFocus),this.parent.off(On,this.appendInfiniteRows),this.parent.off(kn,this.removeInfiniteCacheRows),this.parent.off(Rn,this.resetInfiniteBlocks),this.parent.off(An,this.setCache),this.parent.off(Mn,this.ensureIntialCollapse),this.parent.off(Pt,this.infiniteCellFocus),this.parent.off(En,this.setDisplayNone),this.parent.off(mn,this.editActionBegin),this.parent.off(In,this.getVirtualInfiniteData),this.parent.off(wn,this.resetInfiniteEdit),this.parent.off(yn,this.infiniteEditSuccess),this.parent.off(Cn,this.refreshInfiniteCache),this.parent.on(Or,this.refreshInfiniteEditrowindex),this.parent.off(Fn,this.infiniteEditHandler),this.parent.off(bn,this.infiniteAddActionBegin),this.parent.off(ft,this.modelChanged),this.parent.off(tr,this.refreshInfiniteCurrentViewData),this.parent.off(s,this.destroy),this.parent.off(ct,this.selectNewRow),this.parent.off(Dr,this.captionActionComplete),this.parent.off(gr,this.setGroupCollapsePageQuery),this.parent.off(Hr,this.onActionComplete),this.parent.removeEventListener(y,this.actionBeginFunction),this.parent.removeEventListener(p,this.actionCompleteFunction),this.parent.removeEventListener(ae,this.dataBoundFunction))},k.prototype.dataBound=function(){"collapse"===this.groupCaptionAction?(this.groupCaptionAction="refresh",this.makeGroupCollapseRequest()):"refresh"===this.groupCaptionAction&&(this.parent.hideSpinner(),this.groupCaptionAction=this.empty)},k.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=Zd(n.indexOf(i),n),a=Jd(l=Yd(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=Qd(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)}},k.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()))},k.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:Qd(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))},k.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},k.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},k.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)]))},k.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])}},k.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()}},k.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=Qd(t[0]),this.firstBlock=Math.ceil((this.firstIndex+1)/this.parent.pageSettings.pageSize),this.lastIndex=Qd(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))},k.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}))},k.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&&(q.remove(t[this.parent.frozenRows-1]),this.createRow([i[this.parent.frozenRows-1]],e,!1,!0),vd(this.parent))):this.createRow(i,e)),this.parent.hideSpinner(),this.parent.notify(Er,{}),"delete"===this.requestType?this.parent.notify(ti,e.e):this.parent.notify(ei,e.e)),this.parent.notify(Ci,{case:"refreshHeight"})},k.prototype.createRow=function(e,t,i,n,r){var s=n?e:this.generateRows(t.result,t.e),o=new Ls(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(H),l=(this.parent.frozenRows&&(a=n&&"add"!==this.requestType||!n&&"add"===this.requestType?this.parent.getHeaderContent().querySelector(H):a),{rows:e,cancel:!1,args:t,isMovable:i,isFrozenRows:n,isFrozenRight:n,row:s});if(this.parent.notify(ir,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,q.remove(l[parseInt(i.toString(),10)]),this.createRow([e[this.parent.frozenRows-1]],t,!1,!0,!1)),this.parent.infiniteScrollSettings.enableCache||n||(vd(this.parent),this.parent.contentModule.visibleRows="add"===this.requestType?s.concat(e):e.concat(s))}},k.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},k.prototype.generateRows=function(e,t){return this.rowModelGenerator.generateRows(e,t)},k.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),q.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),q.remove(i),s.splice(t,1))}),e?this.addRowIndex?this.addRowIndex+1:1:0);fd(this.parent,n,s,t,this.addRowIndex||0)},k.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)},k.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()},k.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)}},k.prototype.refreshInfiniteCache=function(e){this.getEditedRowObject().data=e.data},k.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||q.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},k.prototype.refreshInfiniteEditrowindex=function(e){this.editRowIndex=e.index},k.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},k.prototype.infiniteEditSuccess=function(e){this.isNormaledit&&(!this.isAdd&&e.data&&this.updateCurrentViewRecords(e.data),this.isAdd=this.parent.editSettings.showAddNewRow)},k.prototype.updateCurrentViewRecords=function(e){var t=pd(this.parent,e);q.isNullOrUndefined(t)||(this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)]=e)},k.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)},k.prototype.actionComplete=function(e){"delete"!==e.requestType&&"save"!==e.requestType&&"cancel"!==e.requestType||(this.requestType=this.empty,this.isCancel="cancel"===e.requestType||"save"===e.requestType,this.isAdd=this.isEdit=this.parent.editSettings.showAddNewRow,this.isNormaledit&&(this.editRowIndex=this.empty,this.virtualInfiniteData={},this.parent.editModule.previousVirtualData={}))},k.prototype.onActionComplete=function(e){this.parent.trigger(p,q.extend(e,{type:p}))},k.prototype.resetInfiniteEdit=function(){this.parent.enableInfiniteScrolling&&this.isNormaledit&&(this.parent.editSettings.allowEditing&&this.isEdit||this.parent.editSettings.allowAdding&&this.isAdd)&&(this.parent.isEdit=!0)},k.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},k.prototype.editActionBegin=function(e){this.isEdit=!0,this.editRowIndex=e.index;var t=q.extend({},this.getEditedRowObject().data);e.data=Object.keys(this.virtualInfiniteData).length?this.virtualInfiniteData:t},k.prototype.dataSourceModified=function(){this.resetInfiniteBlocks({requestType:this.empty},!0)},k.prototype.onDataReady=function(e){q.isNullOrUndefined(e.count)||"infiniteScroll"===e.requestType||(this.maxPage=Math.ceil(e.count/this.parent.pageSettings.pageSize))},k.prototype.ensureIntialCollapse=function(e){this.isInitialCollapse=!e},k.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(hs),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=Qd(e[e.length-1])+1,r=this.parent.pageSettings.currentPage,s=void 0,o=t.scrollHeight-t.scrollTop,a=Math.round(t.scrollHeight-t.scrollTop),o=o<t.clientHeight?Math.ceil(o):Math.floor(o),(d=t.clientHeight)<o?o-=1:o<d&&(d-=1),o=o===d||a===d,q.isNullOrUndefined(this.groupCaptionAction))&&(this.isScroll&&o&&(this.parent.pageSettings.currentPage<=this.maxPage-1||this.enableContinuousScroll)&&(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:Qd(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.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=Qd((l=i?this.getGridRows().filter(function(e){return e.classList.contains(I)}):[].slice.call(n.getElementsByClassName(I)))[this.parent.pageSettings.pageSize-1]),d=Qd(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&&q.isNullOrUndefined(s)&&(this.isDownScroll||this.isUpScroll)&&(n.scrollTop=this.top))},k.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.isInfiniteScroll=!0,q.isNullOrUndefined(this.infiniteCache[e.currentPage])?setTimeout(function(){i.getVirtualInfiniteEditedData(),i.parent.notify("model-changed",e)},100):setTimeout(function(){i.getVirtualInfiniteEditedData(),i.parent.notify(xn,e)},100)):this.parent.pageSettings.currentPage=this.parent.groupSettings.enableLazyLoading&&this.parent.groupSettings.columns.length&&t>=this.maxPage?1:this.maxPage)},k.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)},k.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),q.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))},k.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)},k.prototype.scrollToLastFocusedCell=function(e){var t=this.parent,i=this.lastFocusInfo.rowIdx+(e.keyArgs.action===Os?-1:1),n=this.lastFocusInfo.cellIdx;if(!t.getRowByIndex(i)){for(var r=new Ls(this.serviceLocator,null,this.parent),s=Math.floor(i/this.parent.pageSettings.pageSize)+1,o=(t.pageSettings.currentPage=s,t.getColumns()),a=(q.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(ct,{rows:a,args:{}}),vd(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},k.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})},k.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=Qd(s.parentElement),a=(this.cellIndex=parseInt(s.getAttribute(ws),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===Es||e.keyArgs.action===As?(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===Os||e.keyArgs.action===Fs)&&(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)},k.prototype.createEmptyRowdata=function(){var t=this;this.parent.getColumns().filter(function(e){t.emptyRowData[e.field]=t.empty})},k.prototype.getVirtualInfiniteEditedData=function(){var e=this.parent.element.querySelector("."+cs),t=this.parent.element.querySelector("."+us),i=this.parent.element.querySelector(".e-gridform");if(this.parent.infiniteScrollSettings.enableCache&&(e||t))for(var t=e?q.extend({},this.getEditedRowObject().data):q.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)},k.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&&!q.isNullOrUndefined(this.editRowIndex)&&(i=this.parent.getRowByIndex(this.editRowIndex),Object.keys(this.virtualInfiniteData).length)&&i&&!this.parent.getContent().querySelector("."+cs)&&(e=i.getBoundingClientRect().top)<t.offsetHeight&&e>this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.editModule.startEdit(i))},k.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("."+us)&&e.scrollTop<this.parent.getRowHeight()&&(this.parent.isEdit=!1,this.parent.addRecord())},k.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),vd(this.parent)),this.restoreInfiniteAdd(),this.isScroll=!0),this.isInfiniteScroll=!1,this.infiniteDetailDestroy=!1},k.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!==Es&&this.pressedKey!==As&&(!a||this.pressedKey!==Os&&this.pressedKey!==Fs)||(a||this.pressedKey===Os||this.pressedKey===Fs||(t.scrollTop=t.scrollTop+i),s.focusModule.isInfiniteScroll=!0,s.focusModule.onClick({target:n},!0),s.selectRow(this.rowIndex))):!this.lastFocusInfo||this.pressedKey!==ks&&"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},k.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(I)}):[].slice.call(this.parent.getContentTable().getElementsByClassName(I)),"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("."+us)?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))},k.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&&!q.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()+wh();return t},k.prototype.captionRowHeight=function(){return[].slice.call(this.parent.getContent().querySelectorAll("tr:not(.e-row)")).length*this.parent.getRowHeight()},k.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||q.remove(e[parseInt(i.toString(),10)])},k.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++,q.remove(e[parseInt(s.toString(),10)])},k.prototype.removeCaptionRows=function(e,t){var i=!(!this.parent.childGrid&&!this.parent.detailTemplate),n=i?this.getGridRows().filter(function(e){return e.classList.contains(I)}):[].slice.call(this.parent.getContent().getElementsByClassName(I));if("down"===t.direction)for(var r=Qd(n[this.parent.pageSettings.pageSize-1])-1,s=0,o=0;s<r;o++)e[parseInt(o.toString(),10)].classList.contains(I)?s=Qd(e[parseInt(o.toString(),10)]):q.remove(e[parseInt(o.toString(),10)]);if("up"===t.direction){for(var t=Qd(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++)q.remove(e[parseInt(o.toString(),10)])}},k.prototype.getGridRows=function(){return[].slice.call(this.parent.getContentTable().rows)},k.prototype.resetInfiniteBlocks=function(t,e){var i=this.parent.enableInfiniteScrolling&&"infiniteScroll"!==t.requestType;this.initialRender||q.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(_r,{}),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.contentModule.isRemove=this.isRemove,this.parent.contentModule.isAddRows=this.isRemove,this.parent.contentModule.visibleRows=[],this.parent.contentModule.visibleFrozenRows=[])},k.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)),q.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)},k.prototype.setInitialCache=function(e,t,i,n){for(var r=!i||q.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++}},k.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)},k.prototype.resetContentModuleCache=function(e){this.parent.contentModule.infiniteCache=e},k.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))}},k.prototype.destroy=function(){this.removeEventListener()};var zu=k;function k(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=[Es,Os,As,Fs],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.parent=e,this.serviceLocator=t,this.isNormaledit="Normal"===this.parent.editSettings.mode,this.addEventListener(),this.widthService=t.getService("widthService"),this.rowModelGenerator=new Ns(this.parent)}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)})(A,Uu=Js),A.prototype.eventListener=function(){this.parent.addEventListener(y,this.actionBegin.bind(this)),this.parent.addEventListener(p,this.actionComplete.bind(this)),this.parent.on(dt,this.setLazyLoadPageSize,this),this.parent.on(Un,this.setCache,this),this.parent.on(Hn,this.scrollHandler,this),this.parent.on(Bt,this.setVisible,this),this.parent.on(jn,this.collapseShortcut,this)},A.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=Zd(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(at,{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))})},A.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(lt,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]=q.extend([],r.refRowsObj[r.parent.pageSettings.currentPage]),r.refreshRowObjects([],a))}})},A.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)},A.prototype.clearLazyGroupCache=function(){this.clearCache()},A.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())}}},A.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)},A.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},A.prototype.getRowObjectIndexByUid=function(e){return this.objIdxByUid[this.parent.pageSettings.currentPage][""+e]},A.prototype.collapseShortcut=function(e){var t,i,n;this.parent.groupSettings.columns.length&&e.target&&x(e.target,hs)&&"TR"===e.target.parentElement.tagName&&(!e.collapse&&x(e.target,I)||(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]))))},A.prototype.getRowByUid=function(e){return this.rowsByUid[this.parent.pageSettings.currentPage][""+e]},A.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={})}},A.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()},A.prototype.resetRowMaintenance=function(){this.startIndexes={},this.captionCounts={},this.rowsByUid={},this.objIdxByUid={},this.initialGroupCaptions={}},A.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])},A.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){q.remove(l[parseInt(p.toString(),10)]);break}q.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(Lr,{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(dr,{rows:this.refRowsObj[parseInt(o.toString(),10)]})},A.prototype.addClass=function(e){e=e[this.blockSize];e&&(e.lazyLoadCssClass="e-lazyload-middle-down")},A.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},A.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(Lr,{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(dr,{rows:this.refRowsObj[this.parent.pageSettings.currentPage]}),this.parent.enableVirtualMaskRow&&this.parent.removeMaskRow()},A.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)},A.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]},A.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},A.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}},A.prototype.hasLastChildRow=function(e,t,i){return e?t===this.childCount+i:t===i},A.prototype.refreshCaptionRowCount=function(e,t){e.data.count=t},A.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},A.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},A.prototype.confirmRowRendering=function(e){var t=!0;return!q.isNullOrUndefined(e.indent)||e.isDataRow||e.isCaptionRow||(e=this.getRowByUid(e.parentUid)).isCaptionRow&&!e.isExpand&&(t=!1),t},A.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]=q.extend([],r),this.updateCurrentViewData()},A.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++)q.isNullOrUndefined(t[parseInt(o.toString(),10)].indent)&&t[parseInt(o.toString(),10)].parentUid===r&&s.push(t[parseInt(o.toString(),10)]);return s},A.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(q.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)},A.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},A.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},A.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||q.isNullOrUndefined(i[parseInt(n.toString(),10)].indent))&&r--,n++;return t},A.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},A.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)}},A.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="+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=Zd(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)},A.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,q.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)&&!q.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=Zd(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))},A.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},A.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)},A.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"),q.isNullOrUndefined(this.getRowElementByUid(p))?(h={rowIndex:a,makeRequest:!1,groupInfo:s,fields:(i=Zd(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=[]))},A.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()),dd(s,this.parent)){i=!0,this.rowIndex=s,t=e[parseInt(n.toString(),10)];break}}return{entered:i,tr:t}},A.prototype.getRowElementByUid=function(e){return this.parent.getContent().querySelector("tr[data-uid="+e+"]")},A.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)&&q.remove(n[parseInt(s.toString(),10)])}},A.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)||(q.remove(n[parseInt(s.toString(),10)]),n[parseInt(s.toString(),10)].getAttribute("data-uid")!==e));s++);},A.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(q.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)]=q.extend([],e.data)},A.prototype.captionRowExpand=function(n){var e,r=this,t=n.groupInfo,s=this.parent.groupSettings.columns.indexOf(t.data.field)+1,t=Jd(Yd(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})},A.prototype.scrollReset=function(e){this.parent.getContent().firstElementChild.scrollTop=e?this.parent.getContent().firstElementChild.scrollTop+e:0},A.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},A.prototype.getGroupCache=function(){return this.groupCache},A.prototype.getRows=function(){return this.groupCache[this.parent.pageSettings.currentPage]||[]},A.prototype.getRowElements=function(){return[].slice.call(this.parent.getContent().getElementsByClassName(I))},A.prototype.getRowByIndex=function(e){for(var t,i=[].slice.call(this.parent.getContent().getElementsByClassName(I)),n=0;!q.isNullOrUndefined(e)&&n<i.length;n++){var r=parseInt(i[parseInt(n.toString(),10)].getAttribute(T),10);if(r&&r-1===e){t=i[parseInt(n.toString(),10)];break}}return t},A.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&&!q.isNullOrUndefined(h)&&q.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}},A.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(!q.isNullOrUndefined(f))for(var m=Object.keys(f),h=0;h<m.length;h++){var y=this.parent.getContent().querySelector("tr[data-uid="+m[parseInt(h.toString(),10)]+"]"),S=f[m[parseInt(h.toString(),10)]];S.isCaptionRow&&(this.captionModelGen.isEmpty()?(s||(S.cells[S.indent+1].colSpan=""===i?S.cells[S.indent+1].colSpan+1:S.cells[S.indent+1].colSpan-1),y&&(y.cells[S.indent+1].colSpan=S.cells[S.indent+1].colSpan)):this.changeCaptionRow(S,y,u[parseInt(g.toString(),10)])),S.isDataRow&&(this.showAndHideCells(y,t,i,!1),S.cells[parseInt(r.toString(),10)].visible=""===i),S.isCaptionRow||S.isDataRow||!q.isNullOrUndefined(S.indent)||(S.cells[parseInt(r.toString(),10)].visible=""===i,S.visible=S.cells.some(function(e){return e.isDataCell&&e.visible}),this.showAndHideCells(y,t,i,!0,S))}}}else Bd(e,t,i,n)},A.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(H).replaceChild(this.rowRenderer.render(n,this.parent.getColumns()),t)},A.prototype.showAndHideCells=function(e,t,i,n,r){var s;e&&(q.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")&&q.removeClass([e.querySelectorAll(s)[parseInt(t.toString(),10)]],["e-hide"]),n)&&(r.visible&&e.classList.contains("e-hide")?q.removeClass([e],["e-hide"]):r.visible||q.addClass([e],["e-hide"]))},A.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 qu,Uu,Hu=A;function A(e,t){e=Uu.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 Xs(e.parent),e.summaryModelGen=new js(e.parent),e.captionModelGen=new _s(e.parent),e.rowRenderer=new Ls(e.locator,null,e.parent),e.eventListener(),e}Vu.prototype.getModuleName=function(){return"lazyLoadGroup"},Vu.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(ht,this.instantiateRenderer,this),this.parent.on(s,this.destroy,this))},Vu.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ht,this.instantiateRenderer),this.parent.off(s,this.destroy))},Vu.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 Hu(this.parent,this.serviceLocator),e.addRenderer(N.RenderType.Content,t)),this.parent.enableVirtualization&&(this.parent.lazyLoadRender=t)},Vu.prototype.destroy=function(){this.removeEventListener()};var ju=Vu;function Vu(e,t){this.parent=e,this.serviceLocator=t,this.addEventListener()}Gu=function(e,t){return(Gu=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}Gu(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(Wu,_u=Lc),Wu.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.object=new P.AutoComplete(q.extend({dataSource:this.parent.dataSource instanceof U.DataManager?this.parent.dataSource:new U.DataManager(this.parent.dataSource),query:(new U.Query).select(e.column.field),enabled:Dh(e.column,e.requestType,e.element),fields:{value:e.column.field},value:Wh(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",xh(e.column.field))},Wu.prototype.selectedValues=function(e){e.result=U.DataUtil.distinct(e.result,this.object.fields.value,!0),this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result)};var Gu,_u,Ku=Wu;function Wu(){return null!==_u&&_u.apply(this,arguments)||this}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)})(Ju,Xu=Lc),Ju.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.obj=new P.ComboBox(q.extend({dataSource:this.parent.dataSource instanceof U.DataManager?this.parent.dataSource:new U.DataManager(this.parent.dataSource),query:(new U.Query).select(e.column.field),fields:{value:e.column.field},value:Wh(e.column.field,e.rowData),enableRtl:this.parent.enableRtl,actionComplete:this.finalValue.bind(this),placeholder:t?"":e.column.headerText,floatLabelType:t?"Never":"Always",enabled:Dh(e.column,e.requestType,e.element),cssClass:this.parent.cssClass||null},e.column.edit.params)),this.obj.appendTo(e.element)},Ju.prototype.finalValue=function(e){e.result=U.DataUtil.distinct(e.result,this.obj.fields.value,!0),this.column.dataSource&&(this.column.dataSource.dataSource.json=e.result)};var Qu,Xu,Yu=Ju;function Ju(){return null!==Xu&&Xu.apply(this,arguments)||this}Zu=function(e,t){return(Zu=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}Zu(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(tg,$u=Lc),tg.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.obj=new P.MultiSelect(q.extend({fields:{text:e.column.field,value:e.column.field},value:q.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",xh(e.column.field))};var Zu,$u,eg=tg;function tg(){return null!==$u&&$u.apply(this,arguments)||this}ig=function(e,t){return(ig=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}ig(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(sg,ng=Lc),sg.prototype.write=function(e){var t="Dialog"!==this.parent.editSettings.mode,i=(i=Wh(e.column.field,e.rowData))?new Date(i):null;this.obj=new B.TimePicker(q.extend({floatLabelType:t?"Never":"Always",value:i,placeholder:t?"":e.column.headerText,enableRtl:this.parent.enableRtl,enabled:Dh(e.column,e.requestType,e.element)&&Eh(x(e.element,"e-rowcell"),this.parent),cssClass:this.parent.cssClass||null},e.column.edit.params)),this.obj.appendTo(e.element)};var ig,ng,rg=sg;function sg(){return null!==ng&&ng.apply(this,arguments)||this}og=function(e,t){return(og=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}og(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(hg,ag=Lc),hg.prototype.create=function(e){var t="e-field e-boolcell";return"checkbox"===e.column.type&&(t="e-field e-boolcell e-edit-checkselect"),qd(this.parent,e.column,t,{type:"checkbox",value:e.value})},hg.prototype.read=function(e){return e.checked},hg.prototype.write=function(e){var t=!q.isNullOrUndefined(e.row)&&e.row.querySelector(".e-edit-checkselect"),i=Wh(e.column.field,e.rowData),i=i&&JSON.parse(i.toString().toLowerCase());q.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),Fh.apply(void 0,[[].slice.call(e.row.getElementsByClassName(b)),i].concat(this.activeClasses))),this.obj=new M.Switch(q.extend({label:"Dialog"!==this.parent.editSettings.mode?" ":e.column.headerText,checked:i,disabled:!Dh(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)},hg.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"),Fh.apply(void 0,[[].slice.call(this.editRow.getElementsByClassName(b)),t].concat(this.activeClasses)))};var og,ag,lg=hg;function hg(){var e=null!==ag&&ag.apply(this,arguments)||this;return e.activeClasses=["e-selectionbackground","e-active"],e}dg=function(e,t){return(dg=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}dg(e,t),e.prototype=null===t?Object.create(t):(i.prototype=t.prototype,new i)})(ug,pg=Lc),ug.prototype.write=function(e){this.column=e.column;var t="Dialog"!==this.parent.editSettings.mode;this.obj=new L.MaskedTextBox(q.extend({fields:{value:e.column.field},value:Wh(e.column.field,e.rowData),floatLabelType:t?"Never":"Always",mask:"000-000-0000",enabled:Dh(e.column,e.requestType,e.element)&&Eh(x(e.element,"e-rowcell"),this.parent),cssClass:this.parent.cssClass||null},e.column.edit.params)),this.obj.appendTo(e.element)};var dg,pg,cg=ug;function ug(){return null!==pg&&pg.apply(this,arguments)||this}N.Aggregate=e,N.AutoCompleteEditCell=Ku,N.BatchEdit=iu,N.BatchEditRender=Ec,N.BooleanEditCell=zc,N.BooleanFilterUI=Bp,N.Cell=Jr,N.CellRenderer=eo,N.CellRendererFactory=Zo,N.CheckBoxFilter=Vp,N.CheckBoxFilterBase=ap,N.Clipboard=qa,N.Column=Q,N.ColumnChooser=fu,N.ColumnMenu=Mu,N.ComboboxEditCell=Yu,N.CommandColumn=Du,N.CommandColumnModel=Y,N.CommandColumnRenderer=Ru,N.ContentRender=Js,N.ContextMenu=Ou,N.Data=Wr,N.DateFilterUI=qp,N.DatePickerEditCell=hu,N.DefaultEditCell=Qc,N.DetailRow=o,N.DialogEdit=su,N.DialogEditRender=kc,N.DropDownEditCell=jc,N.Edit=cu,N.EditCellBase=Lc,N.EditRender=Fc,N.EditSettings=Ml,N.ExcelExport=Cu,N.ExcelFilter=Wp,N.ExcelFilterBase=dp,N.ExportHelper=mu,N.ExportValueFormatter=Su,N.ExternalMessage=bp,N.Filter=Xp,N.FilterCellRenderer=Op,N.FilterSettings=cl,N.FlMenuOptrUI=Ap,N.ForeignKey=Nu,N.Freeze=Au,N.Grid=Ul,N.GridColumn=W,N.Group=ec,N.GroupCaptionCellRenderer=wo,N.GroupCaptionEmptyCellRenderer=xo,N.GroupLazyLoadRenderer=Hu,N.GroupModelGenerator=Xs,N.GroupSettings=kl,N.HeaderCellRenderer=lo,N.HeaderRender=Zs,N.IndentCellRenderer=yo,N.InfiniteScroll=zu,N.InfiniteScrollSettings=hl,N.InlineEdit=eu,N.InlineEditRender=Tc,N.InterSectionObserver=cc,N.LazyLoadGroup=ju,N.LoadingIndicator=Nl,N.Logger=Ka,N.MaskedTextBoxCellEdit=cg,N.MultiSelectEditCell=eg,N.NormalEdit=Yc,N.NumberFilterUI=Pp,N.NumericContainer=up,N.NumericEditCell=Gc,N.Page=xp,N.Pager=vp,N.PagerDropDown=Cp,N.PagerMessage=fp,N.PdfExport=bu,N.Predicate=ol,N.Print=jl,N.Render=Yo,N.Reorder=xa,N.Resize=Jp,N.ResizeSettings=Dl,N.ResponsiveDialogRenderer=ea,N.Row=Xr,N.RowDD=Ca,N.RowDropSettings=wl,N.RowModelGenerator=Ns,N.RowRenderer=Ls,N.Scroll=Aa,N.Search=Da,N.SearchSettings=Sl,N.Selection=Ta,N.SelectionSettings=fl,N.ServiceLocator=ta,N.Sort=pp,N.SortDescriptor=el,N.SortSettings=nl,N.StackedColumn=K,N.StackedHeaderCellRenderer=uo,N.StringFilterUI=Mp,N.TextWrapSettings=xl,N.TimePickerEditCell=rg,N.ToggleEditCell=lg,N.Toolbar=Pa,N.ValueFormatter=V,N.VirtualContentRenderer=vc,N.VirtualElementHandler=Ic,N.VirtualHeaderRenderer=wc,N.VirtualRowModelGenerator=gc,N.VirtualScroll=Sc,N.accessPredicate="access-predicate",N.actionBegin=y,N.actionComplete=p,N.actionFailure=oe,N.addBegin="add-begin",N.addBiggerDialog=Pd,N.addComplete="add-complete",N.addDeleteAction=oi,N.addFixedColumnBorder=Td,N.addRemoveActiveClasses=Fh,N.addRemoveEventListener=zd,N.addStickyColumnPosition=kd,N.addedRecords=ms,N.addedRow=us,N.afterContentRender="after-content-renderer",N.afterFilterColumnMenuClose=kr,N.appendChildren=fh,N.appendInfiniteContent=On,N.applyBiggerTheme=nd,N.applyStickyLeftRightPosition=Dd,N.ariaColIndex=ws,N.ariaRowIndex=T,N.autoCol=Jt,N.batchAdd=Me,N.batchCancel=Le,N.batchCnfrmDlgCancel=Mr,N.batchDelete=Pe,N.batchEditFormRendered=$i,N.batchForm=Yi,N.beforeAutoFill=et,N.beforeBatchAdd=Ne,N.beforeBatchCancel=Zi,N.beforeBatchDelete=Be,N.beforeBatchSave=ze,N.beforeCellFocused=Mt,N.beforeCheckboxRenderer=Vn,N.beforeCheckboxRendererQuery=br,N.beforeCheckboxfilterRenderer=Ar,N.beforeCopy=Ze,N.beforeCustomFilterOpen=tn,N.beforeDataBound=_e,N.beforeDetailTemplateDetach=Gr,N.beforeExcelExport=hi,N.beforeFltrcMenuOpen=hn,N.beforeFragAppend=zi,N.beforeOpen=Ds,N.beforeOpenAdaptiveDialog=We,N.beforeOpenColumnChooser=Ke,N.beforePaste=$e,N.beforePdfExport=fi,N.beforePrint=De,N.beforeRefreshOnDataChange=Xn,N.beforeSetPartialRecords=Kr,N.beforeStartEdit=Ji,N.beginEdit=qe,N.bulkSave=Yt,N.cBoxFltrBegin=on,N.cBoxFltrComplete=an,N.calculateAggregate=yh,N.cancelBegin=Hi,N.capitalizeFirstLetter=ep,N.captionActionComplete=Dr,N.cellDeselected=fe,N.cellDeselecting=ge,N.cellEdit=Ue,N.cellFocused=Lt,N.cellSave=He,N.cellSaved=je,N.cellSelected=ue,N.cellSelecting=ce,N.cellSelectionBegin="cellselecting",N.cellSelectionComplete=At,N.change=xs,N.changedRecords=fs,N.checkBoxChange=Je,N.checkDepth=ed,N.checkIsVirtual=tp,N.checkScrollReset=Zn,N.clearReactVueTemplates=Gd,N.click=Nt,N.closeBatch="closebatch",N.closeEdit=Sr,N.closeFilterDialog=Ln,N.closeInline=yr,N.colGroup=bs,N.colGroupRefresh=mt,N.columnChooserCancelBtnClick=Pn,N.columnChooserClose="columnChooserClose",N.columnChooserOpened=Xi,N.columnChooserSearch="columnChooserSearch",N.columnChooserUpdate="columnChooserUpdate",N.columnDataStateChange=Li,N.columnDeselected=ve,N.columnDeselecting=Se,N.columnDrag=we,N.columnDragStart=Ce,N.columnDragStop=Vt,N.columnDrop=be,N.columnMenuClick=Ii,N.columnMenuClose=Ri,N.columnMenuOpen=xi,N.columnPositionChanged=Ut,N.columnSelected=ye,N.columnSelecting=me,N.columnSelectionBegin="columnselecting",N.columnSelectionComplete="columnselected",N.columnVisibilityChanged=Bt,N.columnWidthChanged=qt,N.columnsPrepared=sn,N.commandClick=st,N.commandColumnDestroy=Fr,N.compareChanges=Sd,N.componentRendered="component-rendered",N.content=hs,N.contentReady=ct,N.contextMenuClick=vi,N.contextMenuClose=bi,N.contextMenuOpen=wi,N.create=Ts,N.createCboxWithWrap=qh,N.createEditElement=qd,N.createVirtualValidationForm=Ir,N.created="create",N.crudAction=si,N.customFilterClose=lr,N.customFilterOpen=nn,N.dataBound=ae,N.dataReady=pt,N.dataSourceChanged=Ni,N.dataSourceModified=_t,N.dataStateChange=Pi,N.dblclick=Qt,N.deleteBegin="delete-begin",N.deleteComplete=ti,N.deletedRecords=ys,N.destroy=s,N.destroyAutoFillElements=Ft,N.destroyChildGrid=Rr,N.destroyEditForm=Vr,N.destroyForm=ai,N.destroyed="destroy",N.detachDetailTemplate=_r,N.detailCollapse=Ae,N.detailDataBound=Oe,N.detailExpand=ke,N.detailIndentCellInfo=gn,N.detailLists=Ya,N.detailStateChange=un,N.dialogDestroy=ri,N.distinctStringValues=Mh,N.doesImplementInterface=Gl,N.doubleTap=li,N.downArrow=Es,N.editBegin="edit-begin",N.editComplete="edit-complete",N.editNextValCell=ji,N.editReset=wn,N.editedRow=cs,N.endAdd="endAdd",N.endDelete="endDelete",N.endEdit="endEdit",N.ensureFirstRow=hd,N.ensureLastRow=ld,N.enter=As,N.enterKeyHandler=cr,N.eventPromise=cd,N.excelAggregateQueryCellInfo=qn,N.excelExportComplete=di,N.excelHeaderQueryCellInfo=ci,N.excelQueryCellInfo=pi,N.expandChildGrid=Gi,N.exportDataBound=Wi,N.exportDetailDataBound=ui,N.exportDetailTemplate=gi,N.exportGroupCaption=ot,N.exportRowDataBound=Ki,N.extend=nh,N.extendObjWithFn=Jh,N.filterAfterOpen=it,N.filterBeforeOpen=nt,N.filterBegin="filtering-begin",N.filterCboxValue=pn,N.filterChoiceRequest=tt,N.filterCmenuSelect=ar,N.filterComplete=Ct,N.filterDialogClose=nr,N.filterDialogCreated=Di,N.filterMenuClose=Ei,N.filterOpen=Ti,N.filterSearchBegin=rt,N.findCellIndex=$d,N.fltrPrevent=ln,N.focus=Rs,N.foreignKeyData=Mi,N.freezeRefresh="freezerefresh",N.freezeRender=Ci,N.frozenContent=as,N.frozenDirection=Rd,N.frozenHeader=ls,N.frozenHeight="frozenHeight",N.frozenLeft=Cs,N.frozenRight=vs,N.generateExpandPredicates=Yd,N.generateQuery=Ai,N.getActualPropFromColl=dh,N.getActualProperties=ah,N.getActualRowHeight=function(e){var t=q.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},N.getAggregateQuery="get-aggregate-query",N.getCellByColAndRowIndex=Fd,N.getCellFromRow=Od,N.getCellsByTableName=Ad,N.getCloneProperties=Hl,N.getCollapsedRowsCount=Jl,N.getColumnByForeignKeyValue=Vh,N.getColumnModelByFieldName=Hd,N.getColumnModelByUid=Ud,N.getColumnWidth=ad,N.getComplexFieldID=xh,N.getCustomDateFormat=Qh,N.getDatePredicate=_h,N.getEditedDataIndex=pd,N.getElementIndex=lh,N.getExpandedState=Xh,N.getFilterBarOperator=Nn,N.getFilterMenuPostion=Lh,N.getForeignData=jh,N.getForeignKeyData=ki,N.getGroupKeysAndFields=Zd,N.getListHeight=Wd,N.getNumberFormat=Ld,N.getObject=Wh,N.getParentIns=Xd,N.getParsedFieldID=Rh,N.getPosition=ch,N.getPredicates=Jd,N.getPrintGridModel=Yh,N.getPrototypesOfObj=Zh,N.getRowHeight=bh,N.getRowIndexFromElement=Qd,N.getScrollBarWidth=wh,N.getScrollWidth=rd,N.getSerachFilteredData=np,N.getStateEventArgument=ud,N.getTransformValues=id,N.getUid=gh,N.getUpdateUsingRaf=Kl,N.getVirtualData=In,N.getVisiblePage=ip,N.getZIndexCalcualtion=Ph,N.gridChkBox=ps,N.gridContent=is,N.gridFooter=ns,N.gridHeader=ts,N.groupAggregates=Tt,N.groupBegin="grouping-begin",N.groupCaptionRow=gs,N.groupCaptionRowLeftRightPos=od,N.groupCollapse=jn,N.groupComplete=xt,N.groupReorderRowObject=yd,N.headerCellInfo=se,N.headerContent=rs,N.headerDrop=Gt,N.headerRefreshed=yt,N.headerValueAccessor=function(e,t){return q.isNullOrUndefined(e)||""===e?"":U.DataUtil.getObject(e,t)},N.hierarchyPrint=Vi,N.immutableBatchCancel=Yn,N.inArray=hh,N.inBoundModelChanged=gt,N.infiniteAppendElements=Kd,N.infiniteCrudCancel=ir,N.infiniteEditHandler=Fn,N.infinitePageQuery=Dn,N.infiniteRemoveElements=_d,N.infiniteScrollComplete=Hr,N.infiniteScrollHandler=Tn,N.infiniteShowHide=En,N.initForeignKeyColumn=Oi,N.initialCollapse=Mn,N.initialEnd=dt,N.initialFrozenColumnIndex=Ms,N.initialLoad=ht,N.isActionPrevent=Oh,N.isAngularMatContainer=wd,N.isCellHaveWidth=Eh,N.isChildColumn=Id,N.isComplexField=Ih,N.isEditable=Dh,N.isEnableSeamlessScrolling=sp,N.isExportColumns=Wl,N.isGroupAdaptive=Kh,N.isMatDialogContainer=Cd,N.isRowEnteredInGrid=dd,N.isRowPinned="isRowPinned",N.ispercentageWidth=gd,N.iterateArrayOrObject=$l,N.iterateExtend=eh,N.keyPressed=Pt,N.lastRowCellBorderUpdated=jr,N.lazyLoadGroupCollapse=lt,N.lazyLoadGroupExpand=at,N.lazyLoadScrollHandler=Hn,N.leftRight=Ss,N.load=ie,N.measureColumnDepth=$h,N.menuClass=E,N.modelChanged=ft,N.movableContent=ss,N.movableHeader=os,N.nextCellIndex=er,N.onEmpty=ut,N.onResize=Xe,N.open=Is,N.padZero=Gh,N.pageBegin="paging-begin",N.pageComplete=St,N.pageDown=ks,N.pageUp="PageUp",N.pagerRefresh=mr,N.parents=mh,N.parentsUntil=x,N.partialRefresh=en,N.pdfAggregateQueryCellInfo=zn,N.pdfExportComplete=mi,N.pdfHeaderQueryCellInfo=Si,N.pdfQueryCellInfo=yi,N.performComplexDataOperation=Nd,N.prepareColumns=sh,N.preventBatch=ni,N.preventFrozenScrollRefresh=$n,N.printComplete=Ee,N.printGridInit=_i,N.pushuid=xd,N.queryCellInfo=re,N.recordAdded=Ui,N.recordClick=Ge,N.recordDoubleClick=Ve,N.recursive=Zl,N.refreshAggregateCell=Et,N.refreshAggregateComplete=ii,N.refreshAggregates=Ot,N.refreshComplete=Kt,N.refreshCustomFilterClearBtn=sr,N.refreshCustomFilterOkBtn=rr,N.refreshExpandandCollapse=dr,N.refreshFilteredColsUid=td,N.refreshFooterRenderer=Dt,N.refreshForeignData=Hh,N.refreshFrozenColumns=_n,N.refreshFrozenHeight="refresh-frozen-height",N.refreshFrozenPosition=Pr,N.refreshHandlers=Gn,N.refreshInfiniteCurrentViewData=tr,N.refreshInfiniteEditrowindex=Or,N.refreshInfiniteModeBlocks=xn,N.refreshInfinitePersistSelection=Er,N.refreshResizePosition=Nr,N.refreshSplitFrozenColumn=Br,N.refreshVirtualBlock=Wt,N.refreshVirtualCache=Cn,N.refreshVirtualEditFormCells=Cr,N.refreshVirtualFrozenHeight=Wn,N.refreshVirtualFrozenRows=Jn,N.refreshVirtualLazyLoadCache=Lr,N.refreshVirtualMaxPage=ur,N.registerEventHandlers=jd,N.removeAddCboxClasses=Uh,N.removeElement=ph,N.removeEventHandlers=Vd,N.removeInfiniteRows=kn,N.renderResponsiveChangeAction=zr,N.renderResponsiveCmenu=or,N.renderResponsiveColumnChooserDiv=qr,N.reorderBegin="reorder-begin",N.reorderComplete=bt,N.resetCachedRowIndex=md,N.resetColandRowSpanStickyPosition=Ed,N.resetColspanGroupCaption=sd,N.resetColumns=Bn,N.resetDialogAppend=bd,N.resetInfiniteBlocks=Rn,N.resetRowIndex=fd,N.resetVirtualFocus=vr,N.resizeClassList=Yp,N.resizeStart=Qe,N.resizeStop=Ye,N.restoreFocus=cn,N.row=I,N.rowCell=b,N.rowDataBound=ne,N.rowDeselected=pe,N.rowDeselecting=de,N.rowDrag=Re,N.rowDragAndDrop="row-drag-and-drop",N.rowDragAndDropBegin="rowdraganddrop-begin",N.rowDragAndDropComplete=It,N.rowDragStart=xe,N.rowDragStartHelper=Ie,N.rowDrop=Te,N.rowModeChange=pr,N.rowPositionChanged=Qi,N.rowSelected=he,N.rowSelecting=le,N.rowSelectionBegin="rowselecting",N.rowSelectionComplete=kt,N.rowsAdded=Ht,N.rowsRemoved=jt,N.rtlUpdated=Bi,N.saveComplete=ei,N.scroll=zt,N.scrollToEdit=wr,N.searchBegin="searching-begin",N.searchComplete=wt,N.selectRowOnContextOpen=fr,N.selectVirtualRow=rn,N.setChecked=zh,N.setColumnIndex=rh,N.setComplexFieldID=Th,N.setCssInGridPopUp=oh,N.setDisplayValue=Bd,N.setEnableSeamlessScrolling=op,N.setFormatter=Ah,N.setFreezeSelection=Qn,N.setFullScreenDialog=hr,N.setGroupCache=Un,N.setHeightToFrozenElement="set-height-to-frozen-element",N.setInfiniteCache=An,N.setInfiniteColFrozenHeight="set-infinite-col-frozen-height",N.setInfiniteFrozenHeight="set-infinite-frozen-height",N.setReorderDestinationElement=Kn,N.setRowElements=vd,N.setStyleAndAttributes=ih,N.setValidationRuels=Md,N.setVirtualPageQuery=gr,N.shiftEnter=Fs,N.shiftTab="shiftTab",N.showAddNewRowFocus=Ur,N.showEmptyGrid=Fi,N.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--)},N.sortBegin="sorting-begin",N.sortComplete=vt,N.stickyScrollComplete=Tr,N.summaryIterator=pc,N.tab="tab",N.table=ds,N.tbody=H,N.templateCompiler=th,N.textWrapRefresh=qi,N.toggleFilterUI=Nh,N.toogleCheckbox=Bh,N.toolbarClick=Fe,N.toolbarRefresh=Xt,N.tooltipDestroy=Zt,N.uiUpdate=g,N.ungroupBegin="ungrouping-begin",N.ungroupComplete=Rt,N.upArrow=Os,N.updateColumnTypeForExportColumns=Ql,N.updateData=$t,N.updatecloneRow=Xl,N.valCustomPlacement=dn,N.validateVirtualForm=xr,N.valueAccessor=_l,N.virtaulCellFocus=fn,N.virtaulKeyHandler="virtaul-key-handler",N.virtualScrollAddActionBegin=bn,N.virtualScrollEdit=vn,N.virtualScrollEditActionBegin=mn,N.virtualScrollEditCancel=Sn,N.virtualScrollEditSuccess=yn,N.wrap=kh,Object.defineProperty(N,"__esModule",{value:!0})});
2
11
  //# sourceMappingURL=ej2-grids.umd.min.js.map