@syncfusion/ej2-treegrid 31.2.10 → 31.2.15
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.
- package/dist/ej2-treegrid.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js +2 -2
- package/dist/ej2-treegrid.umd.min.js.map +1 -1
- package/dist/es6/ej2-treegrid.es2015.js +17 -6
- package/dist/es6/ej2-treegrid.es2015.js.map +1 -1
- package/dist/es6/ej2-treegrid.es5.js +17 -6
- package/dist/es6/ej2-treegrid.es5.js.map +1 -1
- package/dist/global/ej2-treegrid.min.js +2 -2
- package/dist/global/ej2-treegrid.min.js.map +1 -1
- package/dist/global/index.d.ts +1 -1
- package/package.json +5 -5
- package/src/treegrid/actions/batch-edit.js +1 -1
- package/src/treegrid/actions/crud-actions.js +12 -5
- package/src/treegrid/actions/edit.js +3 -0
- package/src/treegrid/base/treegrid.js +1 -0
package/dist/ej2-treegrid.min.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/*!
|
|
2
2
|
* filename: ej2-treegrid.min.js
|
|
3
|
-
* version : 31.2.
|
|
3
|
+
* version : 31.2.15
|
|
4
4
|
* Copyright Syncfusion Inc. 2001 - 2025. All rights reserved.
|
|
5
5
|
* Use of this code is subject to the terms of our license.
|
|
6
6
|
* A copy of the current license can be obtained at any time by e-mailing
|
|
7
7
|
* licensing@syncfusion.com. Any infringement will be prosecuted under
|
|
8
8
|
* applicable laws.
|
|
9
9
|
*/
|
|
10
|
-
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionGrids"),require("SyncfusionButtons"),require("SyncfusionData"),require("SyncfusionPopups")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionGrids","SyncfusionButtons","SyncfusionData","SyncfusionPopups"],t):"object"==typeof exports?exports.SyncfusionTreegrid=t(require("SyncfusionBase"),require("SyncfusionGrids"),require("SyncfusionButtons"),require("SyncfusionData"),require("SyncfusionPopups")):e.SyncfusionTreegrid=t(e.SyncfusionBase,e.SyncfusionGrids,e.SyncfusionButtons,e.SyncfusionData,e.SyncfusionPopups)}(self,(e,t,i,r,n)=>(()=>{"use strict";var o={766:t=>{t.exports=e},741:e=>{e.exports=i},74:e=>{e.exports=r},707:e=>{e.exports=t},197:e=>{e.exports=n}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={exports:{}};return o[e](i,i.exports,s),i.exports}s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};return(()=>{s.r(d),s.d(d,{Aggregate:()=>pi,AggregateColumn:()=>At,AggregateRow:()=>Et,Column:()=>n,ColumnChooser:()=>bi,ColumnMenu:()=>ci,CommandColumn:()=>yi,ContextMenu:()=>ui,ContextMenuItems:()=>ut,DataManipulation:()=>Ct,DetailRow:()=>mi,Edit:()=>fi,EditSettings:()=>qt,ExcelExport:()=>ai,Filter:()=>oi,FilterSettings:()=>y,Freeze:()=>Ci,InfiniteScroll:()=>Di,InfiniteScrollSettings:()=>Ht,LoadingIndicator:()=>c,Logger:()=>C,Page:()=>di,PageSettings:()=>Mt,PdfExport:()=>si,Predicate:()=>f,Render:()=>xt,Reorder:()=>Xt,Resize:()=>$t,RowDD:()=>Zt,RowDropSettings:()=>ii,SearchSettings:()=>St,Selection:()=>gt,SelectionSettings:()=>It,Sort:()=>hi,SortDescriptor:()=>Vt,SortSettings:()=>Bt,StackedColumn:()=>a,Toolbar:()=>li,ToolbarItem:()=>ct,TreeClipboard:()=>Xe,TreeGrid:()=>Jt,TreeGridColumn:()=>o,TreeVirtual:()=>xi,TreeVirtualRowModelGenerator:()=>ni,VirtualScroll:()=>Ri,actionBegin:()=>E,actionComplete:()=>U,actionFailure:()=>Ye,ariaColIndex:()=>Ke,ariaRowIndex:()=>We,autoCol:()=>ke,batchAdd:()=>pe,batchCancel:()=>le,batchDelete:()=>de,batchEditFormRendered:()=>be,batchSave:()=>ge,beforeBatchAdd:()=>ce,beforeBatchCancel:()=>Ce,beforeBatchDelete:()=>he,beforeBatchSave:()=>ue,beforeCopy:()=>$,beforeDataBound:()=>A,beforeExcelExport:()=>z,beforePaste:()=>Z,beforePdfExport:()=>L,beforeStartEdit:()=>xe,beginAdd:()=>re,beginEdit:()=>ie,cellEdit:()=>se,cellSave:()=>oe,cellSaved:()=>ae,checkboxChange:()=>T,collapsed:()=>H,collapsing:()=>G,content:()=>je,contextMenuClick:()=>X,contextMenuOpen:()=>J,crudAction:()=>te,dataBound:()=>O,dataListener:()=>Ie,dataStateChange:()=>N,destroy:()=>we,detailDataBound:()=>De,doubleTap:()=>me,expanded:()=>j,expanding:()=>_,extendArray:()=>dt,findChildrenRecords:()=>at,findParentRecords:()=>nt,frozenContent:()=>Le,frozenHeader:()=>Fe,frozenLeft:()=>Qe,frozenRight:()=>Ge,getExpandStatus:()=>ot,getParentData:()=>pt,getPlainData:()=>lt,headerContent:()=>Ve,indexModifier:()=>Re,isCheckboxcolumn:()=>it,isCountRequired:()=>tt,isFilterChildHierarchy:()=>rt,isHidden:()=>ht,isOffline:()=>st,isRemoteData:()=>et,keyPressed:()=>fe,leftRight:()=>He,load:()=>D,localPagedExpandCollapse:()=>K,movableContent:()=>Be,movableHeader:()=>ze,pagingActions:()=>W,printGridInit:()=>Y,queryCellInfo:()=>P,recordDoubleClick:()=>ne,remoteExpand:()=>Q,resizeStop:()=>F,rowDataBound:()=>M,rowDeselected:()=>V,rowDeselecting:()=>Te,rowDrag:()=>Me,rowDragStart:()=>Ae,rowDragStartHelper:()=>Oe,rowDrop:()=>Pe,rowDropped:()=>qe,rowSelected:()=>k,rowSelecting:()=>q,rowdraging:()=>Ue,rowsAdd:()=>Ee,rowsRemove:()=>Ne,savePreviousRowPosition:()=>ee,table:()=>_e,toolbarClick:()=>B,treeGridDetails:()=>b,updateData:()=>ye,virtualActionArgs:()=>ve,virtualColumnIndex:()=>Se});var e,t=s(766),i=(e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)},function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}),r=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},n=function(){function e(e){this.allowEditing=!0,this.edit={},this.disableHtmlEncode=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.allowFiltering=!0,this.allowSorting=!0,this.allowResizing=!0,this.filter={},(0,t.merge)(this,e)}return e.prototype.setProperties=function(e){for(var t=Object.keys(e),i=0;i<t.length;i++)if(this[t[parseInt(i.toString(),10)]]=e[t[parseInt(i.toString(),10)]],this.parent&&this.parent.isReact&&"template"===t[parseInt(i.toString(),10)]){this.parent.clipboardModule.treeGridParent.renderModule.refreshReactColumnTemplateByUid(this.uid)}},e}(),o=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i(n,e),r([(0,t.Property)(null)],n.prototype,"columns",void 0),n}(n),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(o),l=s(707),p=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),h=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},c=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return p(i,e),h([(0,t.Property)("Spinner")],i.prototype,"indicatorType",void 0),i}(t.ChildProperty),u=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),g=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},f=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return u(i,e),g([(0,t.Property)()],i.prototype,"field",void 0),g([(0,t.Property)()],i.prototype,"operator",void 0),g([(0,t.Property)()],i.prototype,"value",void 0),g([(0,t.Property)()],i.prototype,"matchCase",void 0),g([(0,t.Property)()],i.prototype,"ignoreAccent",void 0),g([(0,t.Property)()],i.prototype,"predicate",void 0),g([(0,t.Property)({})],i.prototype,"actualFilterValue",void 0),g([(0,t.Property)({})],i.prototype,"actualOperator",void 0),g([(0,t.Property)()],i.prototype,"type",void 0),g([(0,t.Property)()],i.prototype,"ejpredicate",void 0),g([(0,t.Property)()],i.prototype,"uid",void 0),g([(0,t.Property)()],i.prototype,"isForeignKey",void 0),i}(t.ChildProperty),y=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return u(i,e),g([(0,t.Collection)([],f)],i.prototype,"columns",void 0),g([(0,t.Property)("FilterBar")],i.prototype,"type",void 0),g([(0,t.Property)()],i.prototype,"mode",void 0),g([(0,t.Property)(!0)],i.prototype,"showFilterBarStatus",void 0),g([(0,t.Property)(1500)],i.prototype,"immediateModeDelay",void 0),g([(0,t.Property)()],i.prototype,"operators",void 0),g([(0,t.Property)(!1)],i.prototype,"ignoreAccent",void 0),g([(0,t.Property)("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),m=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),S=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},v=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return m(i,e),S([(0,t.Property)("Both")],i.prototype,"wrapMode",void 0),i}(t.ChildProperty),w=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),I="https://ej2.syncfusion.com/documentation/treegrid",R="https://ej2.syncfusion.com/documentation",x=!1,C=function(e){function i(t){return l.Grid.Inject(l.Logger),e.call(this,t)||this}return w(i,e),i.prototype.getModuleName=function(){return"logger"},i.prototype.log=function(e,i){e instanceof Array||(e=[e]);for(var r=e,n=0;n<r.length;n++){var o=l.detailLists[r[parseInt(n.toString(),10)]],a=o.check(i,this.parent);if(a.success){var s=o.generateMessage(i,this.parent,a.options);s=s.replace("EJ2Grid","EJ2TreeGrid").replace("* Hierarchy Grid","").replace("* Grouping",""),x&&"primary_column_missing"===r[parseInt(n.toString(),10)]&&(s=s.replace("Editing","Row DragAndDrop"),x=!1);var d=s.indexOf("https"),p=s.substring(d);"module_missing"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/modules"):"primary_column_missing"===r[parseInt(n.toString(),10)]||"selection_key_missing"===r[parseInt(n.toString(),10)]?s=s.replace(p,R+"/api/treegrid/column/#isprimarykey"):"grid_remote_edit"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/edit"):"virtual_height"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/virtual"):"check_datasource_columns"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/columns"):"locale_missing"===r[parseInt(n.toString(),10)]&&(s=s.replace(p,I+"/global-local/#localization")),"datasource_syntax_mismatch"===r[parseInt(n.toString(),10)]&&((0,t.isNullOrUndefined)(this.treeGridObj)||(0,t.isNullOrUndefined)(this.treeGridObj.dataStateChange))||console[o.logType](s)}}},i.prototype.treeLog=function(e,t,i){this.treeGridObj=i,e instanceof Array||(e=[e]);var r=e;i.allowRowDragAndDrop&&!i.columns.filter(function(e){return e.isPrimaryKey}).length&&(x=!0,this.log("primary_column_missing",t));for(var n=0;n<r.length;n++){var o=b[r[parseInt(n.toString(),10)]],a=o.check(t,i);if(a.success){var s=o.generateMessage(t,i,a.options);console[o.logType](s)}}},i}(l.Logger),b={mapping_fields_missing:{type:"mapping_fields_missing",logType:"error",check:function(e,i){var r={success:!1};return((0,t.isNullOrUndefined)(i.idMapping)&&(0,t.isNullOrUndefined)(i.childMapping)&&(0,t.isNullOrUndefined)(i.parentIdMapping)||!(0,t.isNullOrUndefined)(i.idMapping)&&(0,t.isNullOrUndefined)(i.parentIdMapping)||(0,t.isNullOrUndefined)(i.idMapping)&&!(0,t.isNullOrUndefined)(i.parentIdMapping))&&(r={success:!0}),r},generateMessage:function(){return"[EJ2TreeGrid.Error]: MAPPING FIELDS MISSING \nOne of the following fields is missing. It is required for the hierarchical relationship of records in TreeGrid:\n* childMapping\n* idMapping\n* parentIdMapping\nRefer to the following documentation links for more details.\n"+R+"/api/treegrid#childmapping\n"+R+"/api/treegrid#idmapping\n"+R+"/api/treegrid#$parentidmapping"}}},D="load",M="rowDataBound",O="dataBound",P="queryCellInfo",A="beforeDataBound",E="actionBegin",N="dataStateChange",U="actionComplete",q="rowSelecting",k="rowSelected",T="checkboxChange",V="rowDeselected",B="toolbarClick",z="beforeExcelExport",L="beforePdfExport",F="resizeStop",j="expanded",_="expanding",H="collapsed",G="collapsing",Q="remoteExpand",K="localPagedExpandCollapse",W="pagingActions",Y="printGrid-Init",J="contextMenuOpen",X="contextMenuClick",$="beforeCopy",Z="beforePaste",ee="savePreviousRowPosition",te="crudAction",ie="beginEdit",re="beginAdd",ne="recordDoubleClick",oe="cellSave",ae="cellSaved",se="cellEdit",de="batchDelete",le="batchCancel",pe="batchAdd",he="beforeBatchDelete",ce="beforeBatchAdd",ue="beforeBatchSave",ge="batchSave",fe="key-pressed",ye="update-data",me="double-tap",Se="virtualColumnIndex",ve="virtual-action-args",we="destroy",Ie="data-listener",Re="index-modifier",xe="edit-form",Ce="before-batch-cancel",be="batcheditform-rendered",De="detailDataBound",Me="rowDrag",Oe="rowDragStartHelper",Pe="rowDrop",Ae="rowDragStart",Ee="rows-add",Ne="rows-remove",Ue="row-draging",qe="row-dropped",ke="auto-col",Te="rowDeselecting",Ve="e-headercontent",Be="e-movablecontent",ze="e-movableheader",Le="e-frozencontent",Fe="e-frozenheader",je="e-content",_e="e-table",He="Left-Right",Ge="frozen-right",Qe="frozen-left",Ke="aria-colindex",We="aria-rowindex",Ye="actionFailure",Je=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xe=function(e){function i(t,i){var r=e.call(this,t.grid,i)||this;return r.treeCopyContent="",r.copiedUniqueIdCollection=[],r.treeGridParent=t,r.serviceLocator=i,r}return Je(i,e),i.prototype.setCopyData=function(i){var r="copyContent",n="getCopyData",o=this.treeGridParent.getCurrentViewRecords();if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this[""+r]="";var a=this.treeGridParent.grid.getRows();if("Cell"!==this.treeGridParent.selectionSettings.mode){for(var s=this.treeGridParent.getSelectedRowIndexes().sort(function(e,t){return e-t}),d=0;d<s.length;d++){d>0&&(this.treeCopyContent+="\n");var l=s[parseInt(d.toString(),10)];if(!a[l].classList.contains("e-summaryrow")){var p=[].slice.call(a[l].querySelectorAll(".e-rowcell")),h=this.treeGridParent.getSelectedRecords()[parseInt(d.toString(),10)].uniqueID;-1===this.copiedUniqueIdCollection.indexOf(h)&&("Parent"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.parentContentData(o,l,a,i,d),this[""+n](p,!1,"\t",i),this.treeCopyContent+=this[""+r],this.copiedUniqueIdCollection.push(h),this[""+r]="","Child"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.childContentData(o,s[parseInt(d.toString(),10)],a,i))}}if(i){var c=this.treeGridParent.getVisibleColumns().map(function(e){return e.headerText});this[""+n](c,!1,"\t",i),this.treeCopyContent=this[""+r]+"\n"+this.treeCopyContent}var u={data:this.treeCopyContent,cancel:!1};if(this.treeGridParent.trigger($,u),u.cancel)return;this.clipBoardTextArea.value=this[""+r]=u.data,t.Browser.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0,this.copiedUniqueIdCollection=[],this.treeCopyContent=""}else e.prototype.setCopyData.call(this,i)}},i.prototype.parentContentData=function(e,i,r,n,o){var a="copyContent",s="parentItem",d="uniqueID";if(!(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)][""+s]))for(var l=e[parseInt(i.toString(),10)][""+s].level,p=0;p<l+1;p++)for(var h=0;h<e.length;h++)if(!(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)][""+s])&&e[parseInt(h.toString(),10)][""+d]===e[parseInt(i.toString(),10)][""+s][""+d]){i=h;var c=[].slice.call(r[parseInt(i.toString(),10)].querySelectorAll(".e-rowcell")),u=e[parseInt(h.toString(),10)][""+d];if(-1===this.copiedUniqueIdCollection.indexOf(u)){this.getCopyData(c,!1,"\t",n),this.treeCopyContent=o>0?this.treeCopyContent+this[""+a]+"\n":this[""+a]+"\n"+this.treeCopyContent,this.copiedUniqueIdCollection.push(u),this[""+a]="";break}}},i.prototype.copy=function(t){e.prototype.copy.call(this,t)},i.prototype.paste=function(t,i,r){e.prototype.paste.call(this,t,i,r)},i.prototype.getModuleName=function(){return"clipboard"},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i.prototype.childContentData=function(e,i,r,n){var o="copyContent",a="uniqueID";if(e[parseInt(i.toString(),10)].hasChildRecords)for(var s=e[parseInt(i.toString(),10)].childRecords,d=0;d<s.length;d++)for(var l=0;l<e.length;l++)if(!(0,t.isNullOrUndefined)(s[parseInt(d.toString(),10)][""+a])&&e[parseInt(l.toString(),10)][""+a]===s[parseInt(d.toString(),10)][""+a]){if(!(0,t.isNullOrUndefined)(r[parseInt(l.toString(),10)])&&!r[parseInt(l.toString(),10)].classList.contains("e-summaryrow")){var p=[].slice.call(r[parseInt(l.toString(),10)].querySelectorAll(".e-rowcell")),h=e[parseInt(l.toString(),10)][""+a];-1===this.copiedUniqueIdCollection.indexOf(h)&&(this.getCopyData(p,!1,"\t",n),this.treeCopyContent+="\n"+this[""+o],this[""+o]="",this.copiedUniqueIdCollection.push(h),this.childContentData(e,l,r,n))}break}},i}(l.Clipboard),$e=s(741),Ze=s(74);function et(e){var t;return e.treeGrid&&e.treeGrid.isGantt?!!e.taskFields.hasChildMapping&&(e.dataSource instanceof Ze.DataManager&&((t=e.dataSource.adaptor)instanceof Ze.ODataAdaptor||t instanceof Ze.WebApiAdaptor||t instanceof Ze.WebMethodAdaptor||t instanceof Ze.CacheAdaptor||t instanceof Ze.UrlAdaptor)):e.dataSource instanceof Ze.DataManager&&((t=e.dataSource.adaptor)instanceof Ze.ODataAdaptor||t instanceof Ze.WebApiAdaptor||t instanceof Ze.WebMethodAdaptor||t instanceof Ze.CacheAdaptor||t instanceof Ze.UrlAdaptor)}function tt(e){return!(!e.dataSource||!("result"in e.dataSource))}function it(e){for(var t=0;t<e.columns.length;t++)if(e.columns[parseInt(t.toString(),10)].showCheckbox)return!0;return!1}function rt(e){return!(((0,t.isNullOrUndefined)(e.grid.searchSettings.key)||""===e.grid.searchSettings.key||"Child"!==e.searchSettings.hierarchyMode&&"None"!==e.searchSettings.hierarchyMode)&&(!e.allowFiltering||!e.grid.filterSettings.columns.length||"Child"!==e.filterSettings.hierarchyMode&&"None"!==e.filterSettings.hierarchyMode))}function nt(e){for(var t=[],i=0,r=Object.keys(e).length;i<r;i++){(0,l.getObject)("hasChildRecords",e[parseInt(i.toString(),10)])&&t.push(e[parseInt(i.toString(),10)])}return t}function ot(e,i,r){var n,o=(0,t.isNullOrUndefined)(i.parentItem)?null:pt(e,i.parentItem.uniqueID);return null==o||(!e.initialRender||(0,t.isNullOrUndefined)(o[e.expandStateMapping])||o[e.expandStateMapping]?!1!==o.expanded&&(!o.parentItem||((n=pt(e,o.parentItem.uniqueID))&&e.initialRender&&!(0,t.isNullOrUndefined)(n[e.expandStateMapping])&&!n[e.expandStateMapping]?(n.expanded=!1,!1):(!n||!1!==n.expanded)&&(!n||ot(e,n,r)))):(o.expanded=!1,!1))}function at(e){var i=[];if((0,t.isNullOrUndefined)(e)||!e.hasChildRecords&&!(0,t.isNullOrUndefined)(e.childRecords)&&!e.childRecords.length)return[];if(!(0,t.isNullOrUndefined)(e.childRecords))for(var r=e.childRecords.filter(function(e){return!e.isSummaryRow}),n=0,o=Object.keys(r).length;n<o;n++)i.push(r[parseInt(n.toString(),10)]),(r[parseInt(n.toString(),10)].hasChildRecords||!(0,t.isNullOrUndefined)(r[parseInt(n.toString(),10)].childRecords)&&r[parseInt(n.toString(),10)].childRecords.length)&&(i=i.concat(at(r[parseInt(n.toString(),10)])));return i}function st(e){if(et(e)){var i=e.dataSource;return!(0,t.isNullOrUndefined)(i.ready)}return!0}function dt(e){for(var t,i,r=[],n=0;e&&n<e.length;n++){i=Object.keys(e[parseInt(n.toString(),10)]),t={};for(var o=0;o<i.length;o++)t[i[parseInt(o.toString(),10)]]=e[parseInt(n.toString(),10)][i[parseInt(o.toString(),10)]];r.push(t)}return r}function lt(e){return delete e.hasChildRecords,delete e.childRecords,delete e.index,delete e.parentItem,delete e.level,delete e.taskData,delete e.uniqueID,e}function pt(e,t,i){if(i){return e.uniqueIDFilterCollection[""+t]}return e.uniqueIDCollection[""+t]}function ht(e){var t=window.getComputedStyle(e);return"none"===t.display||"hidden"===t.visibility}var ct,ut,gt=function(){function e(e){this.parent=e,this.selectedItems=[],this.selectedIndexes=[],this.filteredList=[],this.searchingRecords=[],this.addEventListener()}return e.prototype.getModuleName=function(){return"selection"},e.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.headerCheckbox,this),this.parent.on("columnCheckbox",this.columnCheckbox,this),this.parent.on("updateGridActions",this.updateGridActions,this),this.parent.grid.on("colgroup-refresh",this.headerCheckbox,this),this.parent.on("checkboxSelection",this.checkboxSelection,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.headerCheckbox),this.parent.off("columnCheckbox",this.columnCheckbox),this.parent.grid.off("colgroup-refresh",this.headerCheckbox),this.parent.off("checkboxSelection",this.checkboxSelection),this.parent.off("updateGridActions",this.updateGridActions))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.checkboxSelection=function(e){var i,r,n=(0,l.getObject)("target",e),o=(0,l.parentsUntil)(n,"e-checkbox-wrapper");if(o&&o.querySelectorAll(".e-treecheckselect").length>0){r=o.querySelector('input[type="checkbox"]');var a=[];a.push(n.closest("tr").rowIndex),this.selectCheckboxes(a),this.triggerChkChangeEvent(r,r.nextElementSibling.classList.contains("e-check"),n.closest("tr"))}else if(o&&o.querySelectorAll(".e-treeselectall").length>0&&this.parent.autoCheckHierarchy){var s=!o.querySelector(".e-frame").classList.contains("e-check")&&!o.querySelector(".e-frame").classList.contains("e-stop");this.headerSelection(s),r=o.querySelector('input[type="checkbox"]'),this.triggerChkChangeEvent(r,s,n.closest("tr"))}!(0,t.isNullOrUndefined)(this.parent.parentQuery)&&this.parent.selectionSettings.persistSelection&&this.parent.columnModel.filter(function(e){return"checkbox"===e.type}).length>0&&et(this.parent)&&this.parent.parentQuery.length>0&&((i=this.parent.query.queries).push.apply(i,this.parent.parentQuery),this.parent.parentQuery=[])},e.prototype.triggerChkChangeEvent=function(e,t,i){var r=this.parent.getCurrentViewRecords()[i.rowIndex],n={checked:t,target:e,rowElement:i,rowData:e.classList.contains("e-treeselectall")?this.parent.getCheckedRecords():r};this.parent.trigger(T,n)},e.prototype.getCheckboxcolumnIndex=function(){for(var e,t,i=this.parent.stackedHeader?this.parent.columnModel:this.parent.columns,r=0;r<i.length;r++)i[parseInt(r.toString(),10)].showCheckbox&&(e=i[parseInt(r.toString(),10)].uid);for(var n=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv").length,o=0;o<n;o++){this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[parseInt(o.toString(),10)].getAttribute("data-mappinguid")===e&&(t=o)}return t},e.prototype.headerCheckbox=function(){if(this.columnIndex=this.getCheckboxcolumnIndex(),this.columnIndex>-1&&0===this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length){var e=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[this.columnIndex],i=this.parent.createElement("input",{className:"e-treeselectall",attrs:{type:"checkbox"}});(r=(0,$e.createCheckBox)(this.parent.createElement,!1,{checked:!1,label:" "})).classList.add("e-hierarchycheckbox"),r.insertBefore(i.cloneNode(),r.firstChild),(0,t.isNullOrUndefined)(e)||e.insertBefore(r,e.firstChild),this.parent.autoCheckHierarchy&&this.headerSelection()}else if(this.columnIndex>-1&&this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length>0){var r,n=(r=this.parent.getHeaderContent().querySelectorAll(".e-checkbox-wrapper")[0]).querySelector(".e-frame").classList.contains("e-check");this.parent.autoCheckHierarchy&&n&&this.headerSelection(n)}},e.prototype.renderColumnCheckbox=function(e){var i=this.parent.createElement("input",{className:"e-treecheckselect",attrs:{type:"checkbox","aria-label":"checkbox"}}),r=e.data;e.cell.classList.add("e-treegridcheckbox"),e.cell.setAttribute("aria-label","checkbox");var n=!(0,t.isNullOrUndefined)(r.checkboxState)&&"uncheck"!==r.checkboxState,o=(0,$e.createCheckBox)(this.parent.createElement,!1,{checked:n,label:" "});if(o.classList.add("e-hierarchycheckbox"),this.parent.allowTextWrap&&(o.querySelector(".e-frame").style.width="18px"),"indeterminate"===r.checkboxState){var a=o.querySelectorAll(".e-frame")[0];(0,t.removeClass)([a],["e-check","e-stop","e-uncheck"]),o.querySelector(".e-frame").classList.add("e-stop")}return o.insertBefore(i.cloneNode(),o.firstChild),o},e.prototype.columnCheckbox=function(e){var i=this.renderColumnCheckbox(e),r=e.cell.querySelector(".e-treecolumn-container");if((0,t.isNullOrUndefined)(r)){var n=this.parent.createElement("span",{className:"e-treecheckbox"}),o=e.cell.innerHTML;e.cell.innerHTML="",n.innerHTML=o;var a=this.parent.createElement("div",{className:"e-treecheckbox-container"});a.appendChild(i),a.appendChild(n),e.cell.appendChild(a)}else e.cell.querySelector(".e-hierarchycheckbox")||r.insertBefore(i,r.querySelectorAll(".e-treecell")[0])},e.prototype.selectCheckboxes=function(e){if((0,t.isNullOrUndefined)(e)){this.parent.trigger(Ye,{error:"The provided value for the rowIndexes is undefined. Please ensure the rowIndexes contains number."})}for(var i=0;i<e.length;i++){var r=this.parent.getCurrentViewRecords()[e[parseInt(i.toString(),10)]],n=pt(this.parent,r.uniqueID),o="uncheck"===(r=n).checkboxState?"check":"uncheck";r.checkboxState=o;for(var a=Object.keys(r),s=0;s<a.length;s++)Object.prototype.hasOwnProperty.call(n,a[parseInt(s.toString(),10)])&&(n[a[parseInt(s.toString(),10)]]=r[a[parseInt(s.toString(),10)]]);this.traverSelection(r,o,!1),this.parent.autoCheckHierarchy&&this.headerSelection()}},e.prototype.traverSelection=function(e,i,r){var n=0;if(this.updateSelectedItems(e,i),!r&&e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem),e.childRecords&&this.parent.autoCheckHierarchy){var o=e.childRecords;!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.parent.autoCheckHierarchy&&(o=this.getFilteredChildRecords(o)),n=o.length;for(var a=0;a<n;a++)o[parseInt(a.toString(),10)].isSummaryRow||(o[parseInt(a.toString(),10)].hasChildRecords?this.traverSelection(o[parseInt(a.toString(),10)],i,!0):this.updateSelectedItems(o[parseInt(a.toString(),10)],i))}},e.prototype.getFilteredChildRecords=function(e){var t=this;return e.filter(function(e){return t.parent.filterModule.filteredResult.indexOf(e)>-1})},e.prototype.updateParentSelection=function(e){var i,r=[],n=pt(this.parent,e.uniqueID);n&&n.childRecords&&(r=n.childRecords),!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.parent.autoCheckHierarchy&&(r=this.getFilteredChildRecords(r)),i=r&&r.length;var o=0,a=0;if(!(0,t.isNullOrUndefined)(n)){for(var s=0;s<r.length;s++){var d=pt(this.parent,r[parseInt(s.toString(),10)].uniqueID);(0,t.isNullOrUndefined)(d)||("indeterminate"===d.checkboxState?o++:"check"===d.checkboxState&&a++)}o>0||a>0&&a!==i?n.checkboxState="indeterminate":(0!==a||n.hasFilteredChildRecords&&!(0,t.isNullOrUndefined)(n.hasFilteredChildRecords)||(0,t.isNullOrUndefined)(this.parent.dataResults.actionArgs)||"searching"!==this.parent.dataResults.actionArgs.requestType&&"filtering"!==this.parent.dataResults.actionArgs.requestType||"check"!==n.checkboxState)&&(0===a&&0===o||0===a&&n.hasFilteredChildRecords&&!(0,t.isNullOrUndefined)(this.parent.dataResults.actionArgs)&&("searching"===this.parent.dataResults.actionArgs.requestType||"filtering"===this.parent.dataResults.actionArgs.requestType)&&"check"===n.checkboxState)?n.checkboxState="uncheck":n.checkboxState="check",this.updateSelectedItems(n,n.checkboxState),n.parentItem&&this.updateParentSelection(n.parentItem)}},e.prototype.headerSelection=function(e){var i,r,n=this,o=!1;if(!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0){var a=this.parent.filterModule.filteredResult;0===this.filteredList.length&&(this.filteredList=a),this.parent.grid.searchSettings.key.length?this.searchingRecords=a:this.filteredList!==a?(this.filteredList=a,o=!0):o=!1}if(this.filteredList.length>0&&(this.parent.filterSettings.columns.length||!this.filteredList.length||this.parent.grid.searchSettings.key.length||(this.filteredList=[]),this.searchingRecords.length&&!(0,t.isNullOrUndefined)(e)&&(this.filteredList=this.searchingRecords)),r=!(0,t.isNullOrUndefined)(this.parent.filterModule)&&0===this.parent.filterModule.filteredResult.length&&0===this.parent.getCurrentViewRecords().length&&this.parent.filterSettings.columns.length>0||!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.filteredList.length>0?this.filteredList:this.parent.flatData,r=et(this.parent)?this.parent.getCurrentViewRecords():r,!(0,t.isNullOrUndefined)(e))for(var s=0;s<r.length;s++)if(e){if("check"===r[parseInt(s.toString(),10)].checkboxState)continue;if(o)continue;r[parseInt(s.toString(),10)].checkboxState="check",this.updateSelectedItems(r[parseInt(s.toString(),10)],r[parseInt(s.toString(),10)].checkboxState)}else this.selectedItems.indexOf(r[parseInt(s.toString(),10)])>-1&&(r[parseInt(s.toString(),10)].checkboxState="uncheck",this.updateSelectedItems(r[parseInt(s.toString(),10)],r[parseInt(s.toString(),10)].checkboxState),this.parent.autoCheckHierarchy&&this.updateParentSelection(r[parseInt(s.toString(),10)]));!1===e&&this.parent.enableVirtualization&&(this.selectedItems=[],this.selectedIndexes=[],r.filter(function(e){e.checkboxState="uncheck",n.updateSelectedItems(e,e.checkboxState)})),i=this.selectedItems.length;var d=this.parent.getHeaderContent().querySelectorAll(".e-frame")[0];i>0&&r.length>0?i===r.length||e?((0,t.removeClass)([d],["e-stop"]),d.classList.add("e-check")):((0,t.removeClass)([d],["e-check"]),d.classList.add("e-stop")):(0,t.removeClass)([d],["e-check","e-stop"])},e.prototype.updateSelectedItems=function(e,i){var r,n,o=this.parent.grid.currentViewData.filter(function(t){return t.uniqueID===e.uniqueID}),a=this.parent.grid.currentViewData.indexOf(o[0]),s=pt(this.parent,e.uniqueID),d=this.parent.getRows()[parseInt(a.toString(),10)];if(a>-1){var l=void 0;(this.parent.frozenRows||this.parent.getFrozenColumns())&&(l=this.parent.getDataRows()[parseInt(a.toString(),10)]),n=d.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]?d.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]:l.querySelectorAll(".e-hierarchycheckbox .e-frame")[0],(0,t.isNullOrUndefined)(n)||(0,t.removeClass)([n],["e-check","e-stop","e-uncheck"])}if(r=s,(0,t.isNullOrUndefined)(r)&&(r=e),r.checkboxState=i,"check"===i&&(0,t.isNullOrUndefined)(e.isSummaryRow))-1!==a&&-1===this.selectedIndexes.indexOf(a)&&this.selectedIndexes.push(a),-1===this.selectedItems.indexOf(r)&&-1!==a&&!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.selectedItems.push(r),-1===this.selectedItems.indexOf(r)&&(this.parent.enableVirtualization||this.parent.allowPaging)&&!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.selectedItems.push(r),-1!==this.selectedItems.indexOf(r)||(0,t.isNullOrUndefined)(this.parent.filterModule)||0!==this.parent.filterModule.filteredResult.length||this.selectedItems.push(r),-1===this.selectedItems.indexOf(r)&&(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.selectedItems.push(r);else if(("uncheck"===i||"indeterminate"===i)&&(0,t.isNullOrUndefined)(e.isSummaryRow)){var p=this.selectedItems.indexOf(r);if(-1!==p&&this.selectedItems.splice(p,1),-1!==this.selectedIndexes.indexOf(a)){var h=this.selectedIndexes.indexOf(a);this.selectedIndexes.splice(h,1)}}var c="indeterminate"===i?"e-stop":"e-"+i;a>-1&&((0,t.isNullOrUndefined)(n)||(n.classList.add(c),d.querySelector(".e-treecheckselect").setAttribute("aria-checked","check"===i?"true":"uncheck"===i?"false":"mixed")))},e.prototype.updateGridActions=function(e){var i,r,n=this,o=e.requestType;if(it(this.parent))if(this.parent.autoCheckHierarchy)if("sorting"===o||"paging"===o){var a=this.parent.grid.getRows();r=(i=this.parent.getCurrentViewRecords()).length,this.selectedIndexes=[];for(var s=0;s<r;s++)a[parseInt(s.toString(),10)].classList.contains("e-summaryrow")||this.updateSelectedItems(i[parseInt(s.toString(),10)],i[parseInt(s.toString(),10)].checkboxState)}else if("delete"===o||"add"===e.action){var d=[];"delete"===o?d=e.data:d.push(e.data);for(s=0;s<d.length;s++){if("delete"===o){var l=this.parent.flatData.indexOf(d[parseInt(s.toString(),10)]),p=this.selectedIndexes.indexOf(l);this.selectedIndexes.splice(p,1),this.updateSelectedItems(d[parseInt(s.toString(),10)],"uncheck")}(0,t.isNullOrUndefined)(d[parseInt(s.toString(),10)].parentItem)||this.updateParentSelection(d[parseInt(s.toString(),10)].parentItem)}}else"add"===e.requestType&&this.parent.autoCheckHierarchy?e.data.checkboxState="uncheck":("filtering"===o||"searching"===o||"refresh"===o&&!et(this.parent))&&(this.selectedItems=[],this.selectedIndexes=[],(i=!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0?this.parent.filterModule.filteredResult:this.parent.flatData).forEach(function(e){if(n.parent.enableVirtualization){e.hasChildRecords&&e.childRecords.length>0?n.updateParentSelection(e):n.updateSelectedItems(e,e.checkboxState);var i=at(e);i=n.getFilteredChildRecords(i);for(var r=0;r<i.length;r++)i[parseInt(r.toString(),10)].hasChildRecords?n.updateParentSelection(i[parseInt(r.toString(),10)]):i[parseInt(r.toString(),10)].hasChildRecords||(0,t.isNullOrUndefined)(i[parseInt(r.toString(),10)])||n.updateSelectedItems(i[parseInt(r.toString(),10)],i[parseInt(r.toString(),10)].checkboxState)}else e.hasChildRecords?n.updateParentSelection(e):n.updateSelectedItems(e,e.checkboxState)}),this.headerSelection());else"filtering"!==o&&"searching"!==o&&"refresh"!==o||et(this.parent)||(this.selectedItems=[],this.selectedIndexes=[])},e.prototype.getCheckedrecords=function(){return this.selectedItems},e.prototype.getCheckedRowIndexes=function(){return this.selectedIndexes},e}(),ft=function(){function e(e){this.parent=e,l.Grid.Inject(l.Print),this.addEventListener()}return e.prototype.getModuleName=function(){return"print"},e.prototype.addEventListener=function(){this.parent.grid.on(Y,this.printTreeGrid,this)},e.prototype.removeEventListener=function(){this.parent.grid.off(Y,this.printTreeGrid)},e.prototype.printTreeGrid=function(e){var i=(0,l.getObject)("printgrid",e),r=(0,l.getObject)("element",e);i.addEventListener(P,this.parent.grid.queryCellInfo),i.addEventListener(M,this.parent.grid.rowDataBound),i.addEventListener(A,this.parent.grid.beforeDataBound),(0,t.addClass)([r],"e-treegrid")},e.prototype.print=function(){this.parent.grid.print()},e.prototype.destroy=function(){this.removeEventListener()},e}(),yt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},St=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return yt(i,e),mt([(0,t.Property)()],i.prototype,"fields",void 0),mt([(0,t.Property)(!1)],i.prototype,"ignoreCase",void 0),mt([(0,t.Property)("contains")],i.prototype,"operator",void 0),mt([(0,t.Property)()],i.prototype,"key",void 0),mt([(0,t.Property)()],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),vt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),wt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},It=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return vt(i,e),wt([(0,t.Property)("Row")],i.prototype,"mode",void 0),wt([(0,t.Property)("Flow")],i.prototype,"cellSelectionMode",void 0),wt([(0,t.Property)("Single")],i.prototype,"type",void 0),wt([(0,t.Property)(!1)],i.prototype,"persistSelection",void 0),wt([(0,t.Property)("Default")],i.prototype,"checkboxMode",void 0),wt([(0,t.Property)(!1)],i.prototype,"checkboxOnly",void 0),wt([(0,t.Property)(!0)],i.prototype,"enableToggle",void 0),i}(t.ChildProperty),Rt=s(197),xt=function(){function e(e){this.parent=e,this.templateResult=null,this.parent.grid.on("template-result",this.columnTemplateResult,this),this.parent.grid.on("reactTemplateRender",this.reactTemplateRender,this)}return e.prototype.RowModifier=function(e){if(e.data){var i=e.data,r=i.parentItem;if(!(0,t.isNullOrUndefined)(i.parentItem)&&!rt(this.parent)&&(!this.parent.allowPaging||"Root"===this.parent.pageSettings.pageSizeMode||et(this.parent)&&!st(this.parent)))if((this.parent.initialRender&&(!((0,t.isNullOrUndefined)(r[this.parent.expandStateMapping])||r[this.parent.expandStateMapping])||this.parent.enableCollapseAll)||!ot(this.parent,e.data,this.parent.grid.getCurrentViewRecords()))&&!(0,t.isNullOrUndefined)(e.row)){this.parent.toggleRowVisibility(e.row,"e-childrow-hidden");var n=this.parent.grid.getRowsObject();this.parent.grid.isFrozenGrid()||(0,t.isNullOrUndefined)(e.row.getAttribute("data-uid"))||(n.filter(function(t){return t.uid===e.row.getAttribute("data-uid")})[0].visible=!1)}if(et(this.parent)&&!st(this.parent)){var o=this.parent,a=this.parent.getCurrentViewRecords().filter(function(e){return(0,t.getValue)(o.idMapping,e)===(0,t.getValue)(o.parentIdMapping,i)});if(a.length>0&&!a[0].isSummaryRow&&!(0,t.isNullOrUndefined)(e.row)){var s=a[0].expanded?"e-childrow-visible":"e-childrow-hidden";this.parent.toggleRowVisibility(e.row,s)}}(0,l.getObject)("isSummaryRow",e.data)&&(0,t.addClass)([e.row],"e-summaryrow"),(0,t.isNullOrUndefined)(e.row)||(e.row.querySelector(".e-treegridexpand")?e.row.setAttribute("aria-expanded","true"):e.row.querySelector(".e-treegridcollapse")&&e.row.setAttribute("aria-expanded","false"),this.parent.enableCollapseAll&&this.parent.initialRender&&((0,t.isNullOrUndefined)(i.parentItem)||this.parent.toggleRowVisibility(e.row,"e-childrow-hidden")));if(this.parent.rowDragAndDropModule&&this.parent.grid.rowDragAndDropModule&&(this.parent.grid.rowDragAndDropModule.dragStartData||this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.getContentTable().scrollHeight<=this.parent.getContent().clientHeight){this.parent.getVisibleRecords()[this.parent.getVisibleRecords().length-1].uniqueID!==e.data.uniqueID||(0,t.isNullOrUndefined)(e.row)||e.row.cells[0].classList.contains("e-lastrowcell")||this.parent.lastRowBorder(e.row,!0)}if(this.parent.isReact){var d=this;d.parent.renderReactTemplates(function(){d.parent.trigger(M,e)})}else this.parent.trigger(M,e)}},e.prototype.cellRender=function(e){if(e.data){var i,r,n=this.parent.grid,o=e.data,a=(0,t.isNullOrUndefined)(o.filterLevel)?o.level:o.filterLevel,s=0,d=this.parent.getColumnByUid(e.column.uid),p=o.isSummaryRow,h=this.parent.getFrozenColumns();i=(0,t.isNullOrUndefined)(o.parentItem)?o.index:o.parentItem.index;if((this.parent.enableColumnVirtualization&&!this.parent.initialRender?this.parent.getVirtualColIndexByUid(e.column.uid):n.getColumnIndexByUid(e.column.uid))!==this.parent.treeColumnIndex||"add"!==e.requestType&&"rowDragAndDrop"!==e.requestType&&"delete"!==e.requestType&&!(0,t.isNullOrUndefined)(e.cell.querySelector(".e-treecell")))this.templateResult&&(this.templateResult=null);else{var c=(0,t.createElement)("div",{className:"e-treecolumn-container"}),u=(0,t.createElement)("span",{className:"e-icons e-none"});u.style.width="10px",u.style.display="inline-block";for(var g=0;g<a;g++)s+=10,c.appendChild(u.cloneNode());var f=(0,t.isNullOrUndefined)(o.hasFilteredChildRecords)?o.hasChildRecords:o.hasFilteredChildRecords;if(f&&!(0,t.isNullOrUndefined)(o.childRecords)&&(f=this.parent.isFromGantt&&this.parent.loadChildOnDemand?o.hasChildRecords:!(0===o.childRecords.length)),f){(0,t.addClass)([e.cell],"e-treerowcell"),e.cell.setAttribute("aria-expanded",o.expanded?"true":"false");var y=(0,t.createElement)("span",{className:"e-icons"}),m=void 0;if(this.parent.initialRender)m=o.expanded&&((0,t.isNullOrUndefined)(o[this.parent.expandStateMapping])||o[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll;else if(m=!(!o.expanded||!ot(this.parent,o,this.parent.grid.getCurrentViewRecords())),"Cell"===this.parent.editSettings.mode&&!et(this.parent)){var S=this.parent.flatData.find(function(e){return e.uniqueID===o.uniqueID});(0,t.isNullOrUndefined)(S)||(m=o.expanded!==S.expanded?S.expanded:o.expanded)}(0,t.addClass)([y],m?"e-treegridexpand":"e-treegridcollapse"),s+=18,c.appendChild(y),u.style.width="4px",s+=7,c.appendChild(u.cloneNode())}else(a||!a&&!o.level)&&(s+=20,c.appendChild(u.cloneNode()),c.appendChild(u.cloneNode()));r=(0,t.createElement)("span",{className:"e-treecell"}),this.parent.allowTextWrap&&(r.style.width="Calc(100% - "+s+"px)"),(0,t.addClass)([e.cell],"e-gridrowindex"+i+"level"+o.level),this.updateTreeCell(e,r),c.appendChild(r),e.cell.appendChild(c)}if(n.getFrozenLeftColumnsCount()>0||n.getFrozenRightColumnsCount()>0){var v=n.getFrozenRightColumns(),w=n.getFrozenLeftColumns(),I=n.getMovableColumns();(v.length>0&&v[0].field===e.column.field||w.length>0&&w[0].field===e.column.field||I.length>0&&I[0].field===e.column.field)&&(0,t.addClass)([e.cell],"e-gridrowindex"+i+"level"+o.level)}else(h>this.parent.treeColumnIndex&&h>0&&n.getColumnIndexByUid(e.column.uid)===h||h<this.parent.treeColumnIndex&&h>0&&(n.getColumnIndexByUid(e.column.uid)===h||n.getColumnIndexByUid(e.column.uid)===h-1)||h===this.parent.treeColumnIndex&&h>0&&n.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex-1)&&(0,t.addClass)([e.cell],"e-gridrowindex"+i+"level"+o.level);if(!(0,t.isNullOrUndefined)(d)&&d.showCheckbox&&(this.parent.notify("columnCheckbox",e),this.parent.allowTextWrap)){var R=e.cell.querySelectorAll(".e-frame")[0];s+=parseInt(R.style.width,16),s+=10,(r=n.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex?e.cell.querySelector(".e-treecell"):e.cell.querySelector(".e-treecheckbox")).style.width="Calc(100% - "+s+"px)"}if(p){(0,t.addClass)([e.cell],"e-summarycell");var x=(0,l.getObject)(e.column.field,e.data);x=(0,t.isNullOrUndefined)(x)?null:x,null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML=x:e.column.template?e.cell.innerHTML=null:e.cell.innerHTML=x}this.parent.args=e;var C=(0,t.getValue)("columnModel",this.parent)[this.parent.treeColumnIndex];if((0,t.isNullOrUndefined)(this.parent.rowTemplate)&&!this.parent.isReact||this.parent.isReact&&!e.column.template)this.parent.trigger(P,e);else if(this.parent.isReact&&C.field!==e.column.field){var b=this;b.parent.renderReactTemplates(function(){b.parent.trigger(P,e)})}}},e.prototype.updateTreeCell=function(e,i){var r=(0,t.getValue)("columnModel",this.parent)[this.parent.treeColumnIndex],n="templateFn",o=e.column.index;(0,t.isNullOrUndefined)(r.field)&&e.cell.setAttribute("aria-colindex",o+1+""),r.field!==e.column.field||(0,t.isNullOrUndefined)(r.template)||(e.column.template=r.template,e.column[""+n]=(0,l.templateCompiler)(e.column.template),e.cell.classList.add("e-templatecell"));var a=null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML:e.cell.innerHTML;if("object"==typeof e.column.template&&this.templateResult)(0,l.appendChildren)(i,this.templateResult),this.templateResult=null,e.cell.innerHTML="";else if(e.cell.classList.contains("e-templatecell")){var s=e.cell.children.length,d=this.parent.element.id+e.column.uid;if(r.field!==e.column.field||(0,t.isNullOrUndefined)(r.template))for(;0<s;s=e.cell.children.length)i.appendChild(e.cell.children[parseInt((0).toString(),10)]);else{var p="portals";if(this.parent.isReact&&"string"!=typeof e.column.template){e.column[""+n](e.data,this.parent,"columnTemplate",d,null,null,i),(0,t.isNullOrUndefined)(this.parent.grid[""+p])&&(this.parent.grid[""+p]=this.parent[""+p]),this.parent.notify("renderReactTemplate",this.parent[""+p]);var h=this;h.parent.renderReactTemplates(function(){h.parent.trigger(P,e)})}else{var c=e.column[""+n]((0,l.extend)({index:""},e.data),this.parent,"template",d,this.parent.isStringTemplate);(0,l.appendChildren)(i,c)}delete e.column.template,delete e.column[""+n],e.cell.innerHTML=""}}else i.innerHTML=a,e.cell.innerHTML=""},e.prototype.refreshReactColumnTemplateByUid=function(e){var i=this;this.parent.isReact&&this.parent.clearTemplate(["columnTemplate"],void 0,function(){var r=i.parent.grid.getRowsObject(),n=i.parent.getDataRows(),o=i.parent.grid.getIndentCount(),a=i.parent.grid.getNormalizedColumnIndex(e);if(0!==n.length)for(var s=0;s<r.length;s++)if(r[parseInt(s.toString(),10)].isDataRow&&!(0,t.isNullOrUndefined)(r[parseInt(s.toString(),10)].index)){var d=r[parseInt(s.toString(),10)].cells[parseInt(a.toString(),10)],p=new l.CellRenderer(i.parent.grid,i.parent.grid.serviceLocator),h=n.length>=r.length?i.parent.getCellFromIndex(r[parseInt(s.toString(),10)].index,a-o):n[r[parseInt(s.toString(),10)].index].querySelector(".e-templatecell");p.refreshTD(h,d,r[parseInt(s.toString(),10)].data,{index:r[parseInt(s.toString(),10)].index});var c=i.parent.getRows()[parseInt(s.toString(),10)].cells[parseInt(a.toString(),10)];i.cellRender({data:r[parseInt(s.toString(),10)].data,cell:c,column:d.column})}})},e.prototype.columnTemplateResult=function(e){this.templateResult=e.template},e.prototype.reactTemplateRender=function(e,t){var i="portals";this.parent[""+i]=e,this.parent.notify("renderReactTemplate",this.parent[""+i]),this.parent.renderReactTemplates(t)},e.prototype.destroy=function(){this.parent.grid.off("template-result",this.columnTemplateResult),this.parent.grid.off("reactTemplateRender",this.reactTemplateRender)},e}(),Ct=function(){function e(e){this.addedRecords="addedRecords",this.parent=e,this.parentItems=[],this.taskIds=[],this.hierarchyData=[],this.storedIndex=-1,this.sortedData=[],this.isSortAction=!1,this.addEventListener(),this.dataResults={},this.isSelfReference=!(0,t.isNullOrUndefined)(this.parent.parentIdMapping)}return e.prototype.addEventListener=function(){this.parent.on("updateRemoteLevel",this.updateParentRemoteData,this),this.parent.grid.on("sorting-begin",this.beginSorting,this),this.parent.on("updateAction",this.updateData,this),this.parent.on(Q,this.collectExpandingRecs,this),this.parent.on("dataProcessor",this.dataProcessor,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Q,this.collectExpandingRecs),this.parent.off("updateRemoteLevel",this.updateParentRemoteData),this.parent.off("updateAction",this.updateData),this.parent.off("dataProcessor",this.dataProcessor),this.parent.grid.off("sorting-begin",this.beginSorting))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.isRemote=function(){return this.parent.dataSource instanceof Ze.DataManager},e.prototype.convertToFlatData=function(e){var i=this;if(this.parent.flatData=(0,t.isNullOrUndefined)(e)||0!==Object.keys(e).length||this.parent.dataSource instanceof Ze.DataManager?[]:this.parent.dataSource,this.parent.parentData=[],et(this.parent)&&!st(this.parent)&&e instanceof Ze.DataManager&&!(e instanceof Array)){var r=this.parent.dataSource;if(this.parent.parentIdMapping){if(this.parent.query=(0,t.isNullOrUndefined)(this.parent.query)?new Ze.Query:this.parent.query,this.parent.parentIdMapping){var n=this.parent.query.params.filter(function(e){return"IdMapping"===e.key});this.parent.initialRender&&!n.length&&(this.parent.query.where(this.parent.parentIdMapping,"equal",null),this.parent.query.addParams("IdMapping",this.parent.idMapping))}if(!this.parent.hasChildMapping){var o=this.parent.query.clone();o.queries=[],(o=o.select([this.parent.parentIdMapping])).isCountRequired=!0,r.executeQuery(o).then(function(e){i.parentItems=Ze.DataUtil.distinct(e.result,i.parent.parentIdMapping,!1),0===(e.result?0:1)&&((0,t.setValue)("grid.contentModule.isLoaded",!0,i.parent),(0,t.isNullOrUndefined)(i.zerothLevelData)||((0,t.setValue)("cancel",!1,i.zerothLevelData),(0,t.getValue)("grid.renderModule",i.parent).dataManagerSuccess(i.zerothLevelData),i.zerothLevelData=null),i.parent.grid.hideSpinner())})}}}else e instanceof Array&&this.convertJSONData(e)},e.prototype.convertJSONData=function(e){if(this.hierarchyData=[],this.taskIds=[],this.parent.idMapping)for(var i=Object.keys(e),r=0;r<i.length;r++){var n=e[parseInt(r.toString(),10)];this.hierarchyData.push((0,t.extend)({},n)),(0,t.isNullOrUndefined)(n[this.parent.idMapping])||this.taskIds.push(n[this.parent.idMapping])}else this.hierarchyData=e;if(this.isSelfReference){var o=[],a=new Ze.DataManager(this.hierarchyData).executeLocal((new Ze.Query).group(this.parent.parentIdMapping));for(r=0;r<a.length;r++){var s=a[parseInt(r.toString(),10)],d=this.taskIds.indexOf(s.key);if(!(0,t.isNullOrUndefined)(s.key)&&d>-1){var l=s.items;this.hierarchyData[parseInt(d.toString(),10)][this.parent.childMapping]=l}else o.push.apply(o,s.items)}this.hierarchyData=this.selfReferenceUpdate(o)}if(Object.keys(this.hierarchyData).length)this.createRecords(this.hierarchyData);else{var p=!(this.parent.dataSource instanceof Ze.DataManager)&&this.parent.isGantt;this.parent.flatData=p?this.parent.dataSource:[]}this.storedIndex=-1},e.prototype.selfReferenceUpdate=function(e){for(var t=[];this.hierarchyData.length>0&&e.length>0;){var i=e.indexOf(this.hierarchyData[0]);-1===i?this.hierarchyData.shift():(t.push(this.hierarchyData.shift()),e.splice(i,1))}return t},e.prototype.updateParentRemoteData=function(e){var i=this,r="actionArgs";et(this.parent)&&this.parent.enableVirtualization&&"virtualscroll"===e[""+r].requestType&&this.parent.hideSpinner();var n=e.result;if(et(this.parent)&&this.parent.enableVirtualization&&("virtualscroll"===e[""+r].requestType||"clearFilter"===e[""+r].action||""===e[""+r].searchString)&&(this.parent.query.expands=[]),this.parent.hasChildMapping||this.parentItems.length||!this.parent.loadChildOnDemand)if(this.parent.loadChildOnDemand)for(var o=function(r){if(tt(a.parent)&&n[parseInt(r.toString(),10)].hasChildRecords&&a.parent.initialRender&&(n[parseInt(r.toString(),10)].expanded=!1),et(a.parent)&&a.parent.enableVirtualization){var o=[],s=a.parent;n.filter(function(e){e[""+s.parentIdMapping]===n[parseInt(r.toString(),10)][""+s.idMapping]&&o.push(e)}),o.length?n[parseInt(r.toString(),10)].expanded=!0:n[parseInt(r.toString(),10)].hasChildRecords&&(n[parseInt(r.toString(),10)].expanded=!1)}if((0,t.isNullOrUndefined)(n[parseInt(r.toString(),10)].index)){if(n[parseInt(r.toString(),10)].taskData=(0,t.extend)({},n[parseInt(r.toString(),10)]),n[parseInt(r.toString(),10)].uniqueID=(0,l.getUid)(a.parent.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+n[parseInt(r.toString(),10)].uniqueID,n[parseInt(r.toString(),10)],a.parent),et(a.parent)&&a.parent.enableVirtualization&&n[parseInt(r.toString(),10)][""+a.parent.parentIdMapping]&&((0,t.isNullOrUndefined)(n[parseInt(r.toString(),10)].level)||0===n[parseInt(r.toString(),10)].level)){var d=n[parseInt(r.toString(),10)][""+a.parent.parentIdMapping],p=n.find(function(e){return e[""+i.parent.idMapping]===d});if(p)n[parseInt(r.toString(),10)].level=p.level+1;else{var h=e.actual.flatData.find(function(e){return e[""+i.parent.idMapping]===d});(0,t.isNullOrUndefined)(h[""+a.parent.parentIdMapping])?n[parseInt(r.toString(),10)].level=1:n[parseInt(r.toString(),10)].level=h.level+1}}else n[parseInt(r.toString(),10)].level=0;n[parseInt(r.toString(),10)].index=Math.ceil(1e3*Math.random()),(n[parseInt(r.toString(),10)][a.parent.hasChildMapping]||-1!==a.parentItems.indexOf(n[parseInt(r.toString(),10)][a.parent.idMapping]))&&(n[parseInt(r.toString(),10)].hasChildRecords=!0),n[parseInt(r.toString(),10)].checkboxState="uncheck"}},a=this,s=0;s<n.length;s++)o(s);else{(0,t.isNullOrUndefined)(n)||!this.parent.loadChildOnDemand&&tt(this.parent)&&!(0,t.isNullOrUndefined)(this.parent.dataResults.expandRecord)||et(this.parent)&&!this.parent.loadChildOnDemand&&e[""+r].isExpandCollapse&&this.parent.enableVirtualization||this.convertToFlatData(n)}else this.zerothLevelData=e,(0,t.setValue)("cancel",!0,e);if(et(this.parent)&&!this.parent.loadChildOnDemand&&e[""+r].isExpandCollapse&&this.parent.enableVirtualization||et(this.parent)&&this.parent.enableVirtualization&&this.parent.loadChildOnDemand?e.result=n:e.result=this.parent.loadChildOnDemand?n:this.parent.flatData,et(this.parent)&&this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length){var d=e.query.queries.filter(function(e){return"onAggregates"===e.fn});e.result=this.parent.summaryModule.calculateSummaryValue(d,this.parent.flatData,!0)}this.parent.notify("updateResults",e)},e.prototype.collectExpandingRecs=function(e,i){var r,n=this.parent.getRows();if(this.parent.rowTemplate){var o=this.parent.getContentTable().rows;n=[].slice.call(o)}if(e.rows.length>0){i||(e.record.expanded=!0);for(var a=0;a<e.rows.length;a++){if(this.parent.toggleRowVisibility(e.rows[parseInt(a.toString(),10)],"e-childrow-visible"),!this.parent.loadChildOnDemand){var s=e.rows[parseInt(a.toString(),10)].getElementsByClassName("e-treegridcollapse")[0];r=this.parent.rowTemplate?this.parent.grid.getCurrentViewRecords()[e.rows[parseInt(a.toString(),10)].rowIndex]:this.parent.grid.getRowObjectFromUID(e.rows[parseInt(a.toString(),10)].getAttribute("data-uid")).data,!(0,t.isNullOrUndefined)(s)&&r.expanded&&((0,t.addClass)([s],"e-treegridexpand"),(0,t.removeClass)([s],"e-treegridcollapse"));var d;(d=n.filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))})).length&&r.expanded&&this.collectExpandingRecs({record:r,rows:d,parentRow:e.parentRow},!0)}var l=e.rows[parseInt(a.toString(),10)].querySelector(".e-detailrowcollapse");(0,t.isNullOrUndefined)(l)||this.parent.grid.detailRowModule.expand(l)}this.parent.grid.pageSettings.totalRecordsCount+=e.rows.length}else this.fetchRemoteChildData({action:e.name,record:e.record,rows:e.rows,parentRow:e.parentRow})},e.prototype.fetchRemoteChildData=function(e){var i=this,r={row:e.parentRow,data:e.record},n=this.parent.dataSource,o=this.parent.grid.getDataModule().generateQuery(),a=o.queries.filter(function(e){return"onPage"!==e.fn&&"onWhere"!==e.fn});o.queries=a,o.isCountRequired=!0;var s=parseInt(e.record[this.parent.idMapping],10);if(isNaN(s)&&(s=e.record[this.parent.idMapping].toString()),this.parent.enableVirtualization&&"remoteExpand"===e.action)o.take(this.parent.grid.pageSettings.pageSize),(d=[]).push("ExpandingAction",s.toString()),o.expand(d);else if(this.parent.enableVirtualization&&"collapse"===e.action){var d;o.take(this.parent.grid.pageSettings.pageSize),(d=[]).push("CollapsingAction",s.toString()),o.expand(d)}if(o.where(this.parent.parentIdMapping,"equal",e.record[this.parent.idMapping]),"remoteExpand"===e.action&&this.parent.grid.filterSettings&&this.parent.grid.filterSettings.columns.length){var p=this.parent.grid.getDataModule().generateQuery().queries.filter(function(e){return"onPage"!==e.fn&&void 0!==e.e.predicates});o.queries.push(p[0])}(0,Rt.showSpinner)(this.parent.element),n.executeQuery(o).then(function(n){var o,a="remoteExpandedData",s="remoteCollapsedData",d=i.parent.grid.currentViewData.slice(),p=i.parent.idMapping;if(i.parent.isGantt&&i.parent.loadChildOnDemand&&i.parent.hasChildMapping){for(var h=0;h<i.parent.grid.currentViewData.length;h++)if(e.record[p]===i.parent.grid.currentViewData[h][p]){o=h;break}}else o=d.indexOf(e.record);if(i.parent.enableVirtualization&&("collapse"===e.action||"remoteExpand"===e.action)){d=[];for(h=0;h<o;h++)d.push(i.parent.grid.currentViewData[parseInt(h.toString(),10)])}-1===o&&i.parent.grid.getRowsObject().forEach(function(t){t.data.uniqueID===e.record.uniqueID&&(o=t.index)});var c=(0,l.getObject)("actual.nextLevel",n),u=n.result,g=[];if("remoteExpand"===e.action&&i.parent.grid.filterModule&&i.parent.grid.filterModule.value){for(h=0;h<d.length;h++)Object.prototype.hasOwnProperty.call(d[parseInt(h.toString(),10)],i.parent.parentIdMapping)&&null!==d[parseInt(h.toString(),10)][""+i.parent.parentIdMapping]&&0===d[parseInt(h.toString(),10)].level&&(d.splice(h,1),h--);for(h=0;h<u.length;h++)e.record[""+i.parent.idMapping]!==u[parseInt(h.toString(),10)][""+i.parent.idMapping]&&e.record[""+i.parent.idMapping]===u[parseInt(h.toString(),10)][""+i.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(u,h)&&g.push(u[parseInt(h.toString(),10)]);u=g}if(i.parent.enableVirtualization&&"remoteExpand"===e.action){e.record.childRecords=[];for(h=0;h<u.length;h++)e.record[""+i.parent.idMapping]!==u[parseInt(h.toString(),10)][""+i.parent.idMapping]&&e.record[""+i.parent.idMapping]===u[parseInt(h.toString(),10)][""+i.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(u,h)&&e.record.childRecords.push(u[parseInt(h.toString(),10)])}else e.record.childRecords=u;for(var f=function(r){var n=u[parseInt(r.toString(),10)];if(i.parent.enableVirtualization&&n[""+i.parent.idMapping]===e.record[""+i.parent.idMapping]&&"remoteExpand"===e.action)i.parent[""+a].push(e.record);else if(i.parent.enableVirtualization&&n[""+i.parent.idMapping]===e.record[""+i.parent.idMapping]&&"collapse"===e.action)for(var p=0;p<i.parent[""+a].length;p++)e.record[""+i.parent.idMapping]===i.parent[""+a][parseInt(p.toString(),10)][""+i.parent.idMapping]&&i.parent[""+a].splice(p,1);if(n.taskData=(0,t.extend)({},n),n[""+i.parent.parentIdMapping]&&i.parent.enableVirtualization&&i.parent[""+a].length)for(p=0;p<i.parent[""+a].length;p++){if(n[""+i.parent.parentIdMapping]===i.parent[""+a][parseInt(p.toString(),10)][""+i.parent.idMapping])n.level=i.parent[""+a][parseInt(p.toString(),10)].level+1,delete(h=i.parent[""+a][parseInt(p.toString(),10)]).childRecords,n.parentItem=h,n.parentUniqueID=h.uniqueID}else if(i.parent.enableVirtualization){if(!n[""+i.parent.hasChildMapping]&&-1===i.parentItems.indexOf(n[""+i.parent.idMapping])||c&&!c[parseInt(r.toString(),10)])delete(h=(0,t.extend)({},e.record)).childRecords,n.parentItem=h,n.parentUniqueID=e.record.uniqueID;else(0,t.isNullOrUndefined)(n[""+i.parent.parentIdMapping])?(n.level=0,"remoteExpand"===e.action&&(n.childRecords=[],n.childRecords=e.record.childRecords)):n.level=e.record.level}else{var h;n.level=e.record.level+1,delete(h=(0,t.extend)({},e.record)).childRecords,n.parentItem=h,n.parentUniqueID=e.record.uniqueID}if(n.index=Math.ceil(1e3*Math.random()),n.uniqueID=(0,l.getUid)(i.parent.element.id+"_data_"),e.record[""+i.parent.idMapping]===n[""+i.parent.idMapping]&&(e.record.uniqueID=n.uniqueID),n.checkboxState="uncheck",i.parent.enableVirtualization&&(0,t.isNullOrUndefined)(n.level))for(var g=0;g<i.parent.grid.currentViewData.length;g++)i.parent.grid.currentViewData[parseInt(g.toString(),10)][""+i.parent.idMapping]===n[""+i.parent.parentIdMapping]&&(n.level=i.parent.grid.currentViewData[parseInt(g.toString(),10)].level+1);if((0,t.setValue)("uniqueIDCollection."+n.uniqueID,n,i.parent),(n[""+i.parent.hasChildMapping]||-1!==i.parentItems.indexOf(n[""+i.parent.idMapping]))&&(!c||c[parseInt(r.toString(),10)]))if(n.hasChildRecords=!0,i.parent.enableVirtualization&&!i.parent.loadChildOnDemand){for(p=0;p<i.parent[""+s].length;p++)n[""+i.parent.idMapping]===i.parent[""+s][parseInt(p.toString(),10)][""+i.parent.idMapping]&&(n.expanded=i.parent[""+s][parseInt(p.toString(),10)].expanded);if("collapse"===e.action&&n[""+i.parent.idMapping]!==e.record[""+i.parent.idMapping]&&!1!==n.expanded)n.expanded=!0;else if("collapse"===e.action&&n[""+i.parent.idMapping]===e.record[""+i.parent.idMapping])n.expanded=!1,i.parent[""+s].push(e.record);else if("remoteExpand"===e.action){for(p=0;p<i.parent.grid.currentViewData.length;p++)i.parent.grid.currentViewData[parseInt(p.toString(),10)][""+i.parent.idMapping]===n[""+i.parent.idMapping]&&u.splice(r,1,i.parent.grid.currentViewData[parseInt(p.toString(),10)]);if(n[i.parent.idMapping]===e.record[""+i.parent.idMapping])for(p=0;p<i.parent[""+s].length;p++)e.record[""+i.parent.idMapping]===i.parent[""+s][parseInt(p.toString(),10)][""+i.parent.idMapping]&&i.parent[""+s].splice(p,1);!1!==n.expanded&&(n.expanded=!0)}}else i.parent.enableVirtualization&&n[""+i.parent.idMapping]===e.record[""+i.parent.idMapping]&&"collapse"!==e.action?n.expanded=!0:i.parent.enableVirtualization&&!i.parent.loadChildOnDemand||(n.expanded=!1);d.some(function(e){return e[""+i.parent.idMapping]===n[i.parent.idMapping]})||d.splice(o+r+1,0,n)},y=0;y<u.length;y++)f(y);var m=i.parent.idMapping;if(i.parent.enableVirtualization&&i.parent.loadChildOnDemand&&d.sort(function(e,t){return e[""+m]-t[""+m]}),(0,t.setValue)("result",d,n),(0,t.setValue)("action","beforecontentrender",n),i.parent.trigger(U,n),(0,Rt.hideSpinner)(i.parent.element),i.parent.grid.aggregates.length>0&&!i.parent.enableVirtualization){var S=(0,l.getObject)("query",n),v="result";if((0,t.isNullOrUndefined)(S)&&(S=(0,t.getValue)("grid.renderModule.data",i.parent).aggregateQuery(new Ze.Query)),!(0,t.isNullOrUndefined)(S)){var w=S.queries.filter(function(e){return"onAggregates"===e.fn});n[""+v]=i.parent.summaryModule.calculateSummaryValue(w,n[""+v],!0)}}"remoteExpand"===e.action&&i.parent.allowPaging&&"All"===i.parent.pageSettings.pageSizeMode&&(i.parent.grid.pageSettings.totalRecordsCount=i.parent.grid.pageSettings.totalRecordsCount+u.length),i.parent.enableVirtualization&&(i.parent.grid.pageSettings.totalRecordsCount=n.count),n.count=i.parent.grid.pageSettings.totalRecordsCount;var I={};i.parent.enableVirtualization&&i.remoteVirtualAction(I);var R={index:o,childData:u};i.parent.enableInfiniteScrolling?i.parent.notify("infinite-remote-expand",R):(0,t.getValue)("grid.renderModule",i.parent).dataManagerSuccess(n,I),i.parent.trigger(j,r)})},e.prototype.remoteVirtualAction=function(e){e.requestType="refresh",(0,t.setValue)("isExpandCollapse",!0,e);var i=(0,t.getValue)("grid.contentModule",this.parent),r=(0,t.getValue)("currentInfo",i),n=(0,t.getValue)("prevInfo",i);r.loadNext&&this.parent.grid.pageSettings.currentPage===r.nextInfo.page&&!this.parent.loadChildOnDemand&&(this.parent.grid.pageSettings.currentPage=n.page)},e.prototype.beginSorting=function(){if(this.isSortAction=!0,et(this.parent)&&this.parent.enableVirtualization){var e=this.parent.query.queries.indexOf(this.parent.query.queries.filter(function(e){return"onSortBy"===e.fn})[0]);-1!==e&&this.parent.query.queries.splice(e,1),0===this.parent.grid.sortSettings.columns.length&&this.parent.query.sortBy(null,null)}},e.prototype.createRecords=function(e,i){for(var r=[],n=0,o=Object.keys(e).length;n<o;n++){var a=(0,t.extend)({},e[parseInt(n.toString(),10)]);a.taskData=e[parseInt(n.toString(),10)];var s=0;this.storedIndex++,Object.prototype.hasOwnProperty.call(a,"index")||(a.index=this.storedIndex);var d=a[this.parent.childMapping],p=!(0,t.isNullOrUndefined)(d)&&d.length>0,h=tt(this.parent),c=a[this.parent.hasChildMapping];if(a.hasChildRecords=!!(p&&!h||c&&h),(!(0,t.isNullOrUndefined)(d)&&!h||c&&h)&&(this.parent.enableCollapseAll||!(0,t.isNullOrUndefined)(this.parent.dataStateChange)&&(0,t.isNullOrUndefined)(d)?a.expanded=!1:a.expanded=!!(0,t.isNullOrUndefined)(a[this.parent.expandStateMapping])||a[this.parent.expandStateMapping]),Object.prototype.hasOwnProperty.call(a,"index")||(a.index=(a.hasChildRecords,this.storedIndex)),this.isSelfReference&&(0,t.isNullOrUndefined)(a[this.parent.parentIdMapping])&&this.parent.parentData.push(a),a.uniqueID=(0,l.getUid)(this.parent.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+a.uniqueID,a,this.parent),!(0,t.isNullOrUndefined)(i)){var u=(0,t.extend)({},i);delete u.childRecords,delete u[this.parent.childMapping],this.isSelfReference&&delete u.taskData[this.parent.childMapping],a.parentItem=u,a.parentUniqueID=u.uniqueID,s=i.level+1}Object.prototype.hasOwnProperty.call(a,"level")||(a.level=s),a.checkboxState="uncheck";var g="remoteCollapsedData";if(this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&et(this.parent)&&!this.parent.initialRender){if(!a.hasChildRecords&&(0,t.isNullOrUndefined)(a[""+this.parent.parentIdMapping])){a.hasChildRecords=!0;for(var f=0;f<this.parent[""+g].length;f++)this.parent[""+g][parseInt(f.toString(),10)][""+this.parent.idMapping]===a[""+this.parent.idMapping]&&(a.expanded=!1)}else 0===a.level&&(0,t.isNullOrUndefined)(i)&&!a.hasChildRecords&&(a.level=a.level+1);a[""+this.parent.hasChildMapping]&&!(0,t.isNullOrUndefined)(a[""+this.parent.expandStateMapping])&&(a.expanded=a[""+this.parent.expandStateMapping],a.hasChildRecords=!0),this.parent.flatData.push(a)}else((0,t.isNullOrUndefined)(a[""+this.parent.parentIdMapping])||a.parentItem)&&((0,t.isNullOrUndefined)(this.parent.rowDropSettings.targetID)?this.parent.flatData.push(a):this.parent.rowDragAndDropModule.isDuplicateData(a)||this.parent.flatData.push(a),this.parent.infiniteScrollData.push(a));if(this.isSelfReference||0!==a.level||this.parent.parentData.push(a),!(0,t.isNullOrUndefined)(a[this.parent.childMapping]&&a[this.parent.childMapping].length)){var y=this.createRecords(a[this.parent.childMapping],a);a.childRecords=y}r.push(a)}return r},e.prototype.dataProcessor=function(e){var i,r=(0,l.getObject)("isExport",e),n=(0,l.getObject)("expresults",e),o=(0,l.getObject)("exportType",e),a=(0,l.getObject)("isPrinting",e),s=(0,l.getObject)("actionArgs",e),d=(0,l.getObject)("requestType",e),p=(0,l.getObject)("data",e),h=(0,l.getObject)("action",e),c=s,u=this.parent.getPrimaryKeyFieldNames()[0],g=(0,l.getObject)("data",c);(0,t.isNullOrUndefined)(c)||(0,t.isNullOrUndefined)(c.action)||"add"!==c.action||(0,t.isNullOrUndefined)(c.data)||!(0,t.isNullOrUndefined)(c.data[""+u])||(c.data[""+u]=e.result[c.index][""+u],g.taskData[""+u]=e.result[c.index][""+u]),(!(0,t.isNullOrUndefined)(s)&&Object.keys(s).length||"save"===d)&&(d=d||s.requestType,p=p||(0,l.getObject)("data",s),h=h||(0,l.getObject)("action",s),"Batch"===this.parent.editSettings.mode&&(this.batchChanges=this.parent.grid.editModule.getBatchChanges()),this.parent.isLocalData&&this.updateAction(p,h,d));var f,y,m=(i=r&&!(0,t.isNullOrUndefined)(n)?n:tt(this.parent)?(0,t.getValue)("result",this.parent.grid.dataSource):this.parent.grid.dataSource)instanceof Ze.DataManager?i.dataSource.json:i,S=tt(this.parent)?(0,t.getValue)("count",this.parent.dataSource):m.length,v=new Ze.Query,w=(0,l.getObject)("query",e);if((0,t.isNullOrUndefined)(w)||(f=w.queries.filter(function(e){return"onWhere"===e.fn}),y=w.queries.filter(function(e){return"onSearch"===e.fn})),this.parent.grid.allowFiltering&&this.parent.grid.filterSettings.columns.length||this.parent.grid.searchSettings.key.length>0||!(0,t.isNullOrUndefined)(w)&&(f.length||y.length)&&this.parent.isLocalData){(0,t.isNullOrUndefined)(w)&&(w=new Ze.Query,w=(0,t.getValue)("grid.renderModule.data",this.parent).filterQuery(w),w=(0,t.getValue)("grid.renderModule.data",this.parent).searchQuery(w));var I=w.queries.filter(function(e){return"onWhere"===e.fn}),R=w.queries.filter(function(e){return"onSearch"===e.fn});v.queries=I.concat(R);var x=new Ze.DataManager(m).executeLocal(v);if(this.parent.notify("updateFilterRecs",{data:x}),m=this.dataResults.result,this.dataResults.result=null,this.parent.grid.aggregates.length>0){var C=(0,l.getObject)("query",e);if((0,t.isNullOrUndefined)(w)&&(w=(0,t.getValue)("grid.renderModule.data",this.parent).aggregateQuery(new Ze.Query)),!(0,t.isNullOrUndefined)(C)){var b=C.queries.filter(function(e){return"onAggregates"===e.fn});m=this.parent.summaryModule.calculateSummaryValue(b,m,!0)}}}if(this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length){var D=(0,l.getObject)("query",e);(0,t.isNullOrUndefined)(D)&&(D=(0,t.getValue)("grid.renderModule.data",this.parent).aggregateQuery(new Ze.Query));b=D.queries.filter(function(e){return"onAggregates"===e.fn});m=this.parent.summaryModule.calculateSummaryValue(b,this.parent.flatData,!0)}if(this.parent.grid.sortSettings.columns.length>0||this.isSortAction){this.isSortAction=!1;for(var M=this.parent.parentData,O=(C=(0,l.getObject)("query",e),new Ze.Query),P=this.parent.grid.sortSettings.columns.length-1;P>=0;P--){var A=this.parent.grid.renderModule.data.getColumnByField(this.parent.grid.sortSettings.columns[parseInt(P.toString(),10)].field),E=A.sortComparer&&st(this.parent)?A.sortComparer.bind(A):this.parent.grid.sortSettings.columns[parseInt(P.toString(),10)].direction;O.sortBy(this.parent.grid.sortSettings.columns[parseInt(P.toString(),10)].field,E)}var N=new Ze.DataManager(M).executeLocal(O);if(this.parent.allowRowDragAndDrop&&!(0,t.isNullOrUndefined)(this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition){var U=N.indexOf(this.parent.rowDragAndDropModule.draggedRecord);N.splice(U,1);var q=N.indexOf(this.parent.rowDragAndDropModule.droppedRecord);this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"topSegment"===this.parent.rowDragAndDropModule.dropPosition?N.splice(q,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&N.splice(q+1,0,this.parent.rowDragAndDropModule.draggedRecord)}var k={modifiedData:N,filteredData:m,srtQry:O};if(this.parent.notify("createSort",k),m=k.modifiedData,this.dataResults.result=null,this.sortedData=m,this.parent.notify("updateModel",{}),this.parent.grid.aggregates.length>0&&!(0,t.isNullOrUndefined)(C)){b=(0,l.getObject)("query",e).queries.filter(function(e){return"onAggregates"===e.fn});m=this.parent.summaryModule.calculateSummaryValue(b,this.sortedData,!1)}}S=tt(this.parent)?(0,t.getValue)("count",this.parent.dataSource):m.length;var T=this.paging(m,S,r,a,o,e);m=T.result,S=T.count,e.result=m,e.count=S,this.parent.notify("updateResults",e)},e.prototype.paging=function(e,i,r,n,o,a){if(!this.parent.allowPaging||r&&"CurrentPage"!==o||n&&"CurrentPage"!==this.parent.printMode){if((this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&(!r||"CurrentPage"===o)&&"save"!==(0,t.getValue)("requestType",a)){var s=this.parent.enableInfiniteScrolling?a:(0,t.getValue)("actionArgs",a);this.parent.notify(W,{result:e,count:i,actionArgs:s}),e=this.dataResults.result,i=this.dataResults.count}}else this.parent.notify(W,{result:e,count:i,actionArgs:a}),e=this.dataResults.result,i=tt(this.parent)?(0,t.getValue)("count",this.parent.dataSource):this.dataResults.count;var d="isCollapsedStatePersist";if((!0===n||a.isPdfExport&&((0,t.isNullOrUndefined)(a[""+d])||a[""+d]))&&"AllPages"===this.parent.printMode){for(var l=[],p=0;p<e.length;p++){ot(this.parent,e[parseInt(p.toString(),10)],this.parent.parentData)&&l.push(e[parseInt(p.toString(),10)])}i=(e=l).length}return{result:e,count:i}},e.prototype.updateData=function(e){this.dataResults=e},e.prototype.updateAction=function(e,t,i){"delete"!==i&&"save"!==i||this.parent.notify(te,{value:e,action:t||i}),"batchsave"===i&&"Batch"===this.parent.editSettings.mode&&this.parent.notify(ge,{})},e}();!function(e){e[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.Search=5]="Search",e[e.ExpandAll=6]="ExpandAll",e[e.CollapseAll=7]="CollapseAll",e[e.ExcelExport=8]="ExcelExport",e[e.PdfExport=9]="PdfExport",e[e.CsvExport=10]="CsvExport",e[e.Print=11]="Print",e[e.RowIndent=12]="RowIndent",e[e.RowOutdent=13]="RowOutdent"}(ct||(ct={})),function(e){e[e.AutoFit=0]="AutoFit",e[e.AutoFitAll=1]="AutoFitAll",e[e.SortAscending=2]="SortAscending",e[e.SortDescending=3]="SortDescending",e[e.Edit=4]="Edit",e[e.Delete=5]="Delete",e[e.Save=6]="Save",e[e.Cancel=7]="Cancel",e[e.PdfExport=8]="PdfExport",e[e.ExcelExport=9]="ExcelExport",e[e.CsvExport=10]="CsvExport",e[e.FirstPage=11]="FirstPage",e[e.PrevPage=12]="PrevPage",e[e.LastPage=13]="LastPage",e[e.NextPage=14]="NextPage",e[e.AddRow=15]="AddRow",e[e.RowIndent=16]="RowIndent",e[e.RowOutdent=17]="RowOutdent"}(ut||(ut={}));var bt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Dt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},Mt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bt(i,e),Dt([(0,t.Property)(12)],i.prototype,"pageSize",void 0),Dt([(0,t.Property)(8)],i.prototype,"pageCount",void 0),Dt([(0,t.Property)(1)],i.prototype,"currentPage",void 0),Dt([(0,t.Property)()],i.prototype,"totalRecordsCount",void 0),Dt([(0,t.Property)(!1)],i.prototype,"enableQueryString",void 0),Dt([(0,t.Property)(!1)],i.prototype,"pageSizes",void 0),Dt([(0,t.Property)(null)],i.prototype,"template",void 0),Dt([(0,t.Property)("All")],i.prototype,"pageSizeMode",void 0),i}(t.ChildProperty),Ot=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Pt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},At=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.intl=new t.Internationalization,i.templateFn={},i}return Ot(i,e),i.prototype.setFormatter=function(e){this.format&&(this.format.skeleton||this.format.format)&&(this.formatFn=this.getFormatFunction(this.format))},i.prototype.getFormatFunction=function(e){return e.type?this.intl.getDateFormat(e):this.intl.getNumberFormat(e)},i.prototype.getFormatter=function(){return this.formatFn},i.prototype.setTemplate=function(e){void 0===e&&(e={}),void 0!==this.footerTemplate&&(this.templateFn[(0,t.getEnumValue)(l.CellType,l.CellType.Summary)]={fn:(0,t.compile)(this.footerTemplate,e),property:"footerTemplate"})},i.prototype.getTemplate=function(e){return this.templateFn[(0,t.getEnumValue)(l.CellType,e)]},i.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},Pt([(0,t.Property)()],i.prototype,"type",void 0),Pt([(0,t.Property)()],i.prototype,"footerTemplate",void 0),Pt([(0,t.Property)()],i.prototype,"field",void 0),Pt([(0,t.Property)()],i.prototype,"format",void 0),Pt([(0,t.Property)()],i.prototype,"columnName",void 0),Pt([(0,t.Property)()],i.prototype,"customAggregate",void 0),i}(t.ChildProperty),Et=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ot(i,e),Pt([(0,t.Collection)([],At)],i.prototype,"columns",void 0),Pt([(0,t.Property)(!0)],i.prototype,"showChildSummary",void 0),i}(t.ChildProperty),Nt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ut=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},qt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Nt(i,e),Ut([(0,t.Property)(!1)],i.prototype,"allowAdding",void 0),Ut([(0,t.Property)(!1)],i.prototype,"allowEditing",void 0),Ut([(0,t.Property)(!1)],i.prototype,"allowDeleting",void 0),Ut([(0,t.Property)("Cell")],i.prototype,"mode",void 0),Ut([(0,t.Property)("Top")],i.prototype,"newRowPosition",void 0),Ut([(0,t.Property)(!0)],i.prototype,"allowEditOnDblClick",void 0),Ut([(0,t.Property)(!0)],i.prototype,"showConfirmDialog",void 0),Ut([(0,t.Property)(!1)],i.prototype,"showDeleteConfirmDialog",void 0),Ut([(0,t.Property)("")],i.prototype,"template",void 0),Ut([(0,t.Property)({})],i.prototype,"dialog",void 0),Ut([(0,t.Property)(!1)],i.prototype,"allowNextRowEdit",void 0),i}(t.ChildProperty),kt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},Vt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return kt(i,e),Tt([(0,t.Property)()],i.prototype,"field",void 0),Tt([(0,t.Property)()],i.prototype,"direction",void 0),i}(t.ChildProperty),Bt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return kt(i,e),Tt([(0,t.Collection)([],Vt)],i.prototype,"columns",void 0),Tt([(0,t.Property)(!0)],i.prototype,"allowUnsort",void 0),i}(t.ChildProperty);function zt(e,i,r,n,o,a,s){var d,l,p,h=e.value,c=e.action,u=i.grid.getPrimaryKeyFieldNames()[0],g=i.dataSource instanceof Ze.DataManager?i.dataSource.dataSource.json:i.dataSource,f=[],y=h,m=!1;if("Batch"===i.editSettings.mode&&(p=i.grid.editModule.getBatchChanges()),"add"===c||"batchsave"===c&&"Batch"===i.editSettings.mode&&p.addedRecords.length){var S=function(e,i,r,n,o,a,s){var d,l=!1,p=r.grid.getCurrentViewRecords();switch(d=lt(d=(0,t.extend)({},e.value)),r.editSettings.newRowPosition){case"Top":i.unshift(d),l=!0;break;case"Bottom":i.push(d),l=!0;break;case"Above":d=(0,t.isNullOrUndefined)(s)?lt(d=(0,t.extend)({},p[o+1])):lt(d=(0,t.extend)({},s));break;case"Below":case"Child":if((0,t.isNullOrUndefined)(s)){var h=r.grid.getPrimaryKeyFieldNames()[0],c=p[parseInt(o.toString(),10)];d=lt(d=!(0,t.isNullOrUndefined)(c)&&c[""+h]===e.value[""+h]||-1!==a?(0,t.extend)({},c):(0,t.extend)({},e.value));var u="internalProperties";r.editModule[""+u].taskData=d}else d=lt(d=(0,t.extend)({},s));-1===a&&(i.unshift(d),l=!0)}return{value:d,isSkip:l}}(e,g,i,0,n,o,s);h=S.value,m=S.isSkip}if(h instanceof Array?f=dt(h):f.push((0,t.extend)({},h)),!m&&("add"!==c||"Top"!==i.editSettings.newRowPosition&&"Bottom"!==i.editSettings.newRowPosition))for(var v=0;v<f.length;v++){"object"==typeof f[parseInt(v.toString(),10)][""+u]&&(f[parseInt(v.toString(),10)]=f[parseInt(v.toString(),10)][""+u]);var w=f[parseInt(v.toString(),10)].taskData?Object.keys(f[parseInt(v.toString(),10)].taskData):Object.keys(f[parseInt(v.toString(),10)]);d=g.length;for(var I=function(){if(g[parseInt(d.toString(),10)][""+u]===f[parseInt(v.toString(),10)][""+u]){if("delete"!==c){if("edit"===c){for(l=0;l<w.length;l++)if(Object.prototype.hasOwnProperty.call(g[parseInt(d.toString(),10)],w[parseInt(l.toString(),10)])&&("Cell"!==i.editSettings.mode||!(0,t.isNullOrUndefined)(p)&&0===p.changedRecords.length||w[parseInt(l.toString(),10)]===a)){var e=pt(i,f[parseInt(v.toString(),10)].uniqueID);g[parseInt(d.toString(),10)][w[parseInt(l.toString(),10)]]=f[parseInt(v.toString(),10)][w[parseInt(l.toString(),10)]],e&&e.taskData&&(e.taskData[w[parseInt(l.toString(),10)]]=e[w[parseInt(l.toString(),10)]]=g[parseInt(d.toString(),10)][w[parseInt(l.toString(),10)]])}}else if("add"===c||"batchsave"===c){var o=void 0;"Child"===i.editSettings.newRowPosition?r?(y.taskData[""+i.parentIdMapping]=g[parseInt(d.toString(),10)][""+i.idMapping],g.splice(d+1,0,y.taskData)):(Object.prototype.hasOwnProperty.call(g[parseInt(d.toString(),10)],i.childMapping)||(g[parseInt(d.toString(),10)][""+i.childMapping]=[]),g[parseInt(d.toString(),10)][""+i.childMapping].push(y.taskData),Ft(u,g[parseInt(d.toString(),10)],c,i,r,y)):"Below"===i.editSettings.newRowPosition?(g.splice(d+1,0,y.taskData),(0,t.isNullOrUndefined)(y.parentItem)||Ft(u,g[d+1],c,i,r,y)):n?"Above"===i.editSettings.newRowPosition&&(g.splice(d,0,y.taskData),(0,t.isNullOrUndefined)(y.parentItem)||Ft(u,g[parseInt(d.toString(),10)],c,i,r,y)):(o=0,g.splice(o,0,y.taskData))}return"break"}var s=g[parseInt(d.toString(),10)];if(g.splice(d,1),r){if(!(0,t.isNullOrUndefined)(s[""+i.parentIdMapping]))for(var h=i.flatData.filter(function(e){return e[""+i.idMapping]===s[""+i.parentIdMapping]})[0],m=h?h[""+i.childMapping]:[],S=m.length-1;S>=0;S--)if(m[parseInt(S.toString(),10)][""+i.idMapping]===s[""+i.idMapping]){i.enableImmutableMode||h.childRecords.length!==h.Children.length||h.childRecords.splice(S,1),m.splice(S,1),m.length||(h.hasChildRecords=!1,Ft(u,h,c,i,r));break}return"break"}}else(0,t.isNullOrUndefined)(g[parseInt(d.toString(),10)][""+i.childMapping])||Lt(g[parseInt(d.toString(),10)][""+i.childMapping],f[parseInt(v.toString(),10)],c,u,i,r,y,a)&&Ft(u,g[parseInt(d.toString(),10)],c,i,r)};d--&&d>=0;){if("break"===I())break}}}function Lt(e,i,r,n,o,a,s,d){for(var l=!1,p=e.length;p--&&p>=0;)if(e[parseInt(p.toString(),10)][""+n]===i[""+n]||a&&e[parseInt(p.toString(),10)][o.parentIdMapping]===i[o.idMapping]){if("edit"===r){for(var h=Object.keys(i),c=pt(o,i.uniqueID),u=0;u<h.length;u++)if(Object.prototype.hasOwnProperty.call(e[parseInt(p.toString(),10)],h[parseInt(u.toString(),10)])&&("Cell"!==o.editSettings.mode||h[parseInt(u.toString(),10)]===d)&&(c[h[parseInt(u.toString(),10)]]=c.taskData[h[parseInt(u.toString(),10)]]=e[parseInt(p.toString(),10)][h[parseInt(u.toString(),10)]]=i[h[parseInt(u.toString(),10)]],"Normal"===o.grid.editSettings.mode&&"Cell"===o.editSettings.mode&&!(0,t.isNullOrUndefined)(o.grid.editModule))){var g="editModule";o.grid.editModule[""+g].editRowIndex=i.index,o.grid.editModule[""+g].updateCurrentViewData(i)}break}"add"===r||"batchsave"===r?"Child"===o.editSettings.newRowPosition?a?(s[""+o.parentIdMapping]=e[parseInt(p.toString(),10)][o.idMapping],e.splice(p+1,0,s),Ft(n,e[parseInt(p.toString(),10)],r,o,a,s)):(Object.prototype.hasOwnProperty.call(e[parseInt(p.toString(),10)],o.childMapping)||(e[parseInt(p.toString(),10)][o.childMapping]=[]),e[parseInt(p.toString(),10)][o.childMapping].push(s.taskData),Ft(n,e[parseInt(p.toString(),10)],r,o,a,s)):"Above"===o.editSettings.newRowPosition?(e.splice(p,0,s.taskData),(0,t.isNullOrUndefined)(s.parentItem)||Ft(n,e[parseInt(p.toString(),10)],r,o,a,s)):"Below"===o.editSettings.newRowPosition&&(e.splice(p+1,0,s.taskData),(0,t.isNullOrUndefined)(s.parentItem)||Ft(n,e[parseInt(p.toString(),10)],r,o,a,s)):(e.splice(p,1),e.length||(l=!0))}else(0,t.isNullOrUndefined)(e[parseInt(p.toString(),10)][o.childMapping])||Lt(e[parseInt(p.toString(),10)][o.childMapping],i,r,n,o,a,s,d)&&Ft(n,e[parseInt(p.toString(),10)],r,o,a);return l}function Ft(e,i,r,n,o,a){if("Above"!==n.editSettings.newRowPosition&&"Below"!==n.editSettings.newRowPosition||"add"!==r&&"batchsave"!==r||(0,t.isNullOrUndefined)(a.parentItem)){var s,d=n.grid.getCurrentViewRecords();if(d.map(function(t,r){t[""+e]!==i[""+e]||(s=r)}),n.enableVirtualization&&(0,t.isNullOrUndefined)(s)){var l=(0,t.getValue)("uniqueIDCollection."+a.parentUniqueID,n);i=l}if((0,t.isNullOrUndefined)(s)||(i=d[parseInt(s.toString(),10)]),n.enableVirtualization&&(0,t.isNullOrUndefined)(i)&&!(0,t.isNullOrUndefined)(a)&&(i=(0,t.getValue)("uniqueIDCollection."+a.parentUniqueID,n)),o||(0,t.isNullOrUndefined)(i.childRecords)||!i.childRecords.length?i.hasChildRecords=!1:i.hasChildRecords=!0,"add"===r||"batchsave"===r){i.expanded=!0,i.hasChildRecords=!0,n.sortSettings.columns.length&&(0,t.isNullOrUndefined)(a)&&(a=d.filter(function(e){return e.parentUniqueID===i.uniqueID?e:null}));var p=a?a instanceof Array?a[0]:a:d[s+1];"Below"!==n.editSettings.newRowPosition&&(Object.prototype.hasOwnProperty.call(i,"childRecords")?(0,t.isNullOrUndefined)(a)||i[""+e]===a[""+e]||i.childRecords.some(function(e){return e.uniqueID===a.uniqueID})||i.childRecords.push(a):i.childRecords=[],-1===i.childRecords.indexOf(p)&&i[""+e]!==a[""+e]&&i.childRecords.unshift(p),o&&(Object.prototype.hasOwnProperty.call(i,n.childMapping)||(i[n.childMapping]=[]),-1===i[""+n.childMapping].indexOf(p)&&i[""+e]!==a[""+e]&&i[n.childMapping].unshift(p)))}for(var h=n.grid.getPrimaryKeyFieldNames()[0],c=n.grid.dataSource instanceof Ze.DataManager?n.grid.dataSource.dataSource.json:n.grid.dataSource,u=0;u<c.length;u++)if(c[parseInt(u.toString(),10)][""+h]===i[""+h]){c[parseInt(u.toString(),10)]=i;break}n.grid.setRowData(e,i);var g=n.getRowByIndex(s);"Batch"===n.editSettings.mode&&(g="add"===r?n.getRows()[n.grid.getCurrentViewRecords().indexOf(i)]:n.getRows()[n.grid.getRowIndexByPrimaryKey(i[""+e])]);var f=void 0;if((n.frozenRows||n.getFrozenColumns())&&(f=n.getRowByIndex(s)),!n.enableVirtualization&&!(0,t.isNullOrUndefined)(g)||!(0,t.isNullOrUndefined)(f)){var y=n.treeColumnIndex;n.allowRowDragAndDrop&&n.enableImmutableMode&&(y+=1),n.renderModule.cellRender({data:i,cell:g.cells[parseInt(y.toString(),10)]?g.cells[parseInt(y.toString(),10)]:f.cells[y-n.getFrozenColumns()],column:n.grid.getColumns()[n.treeColumnIndex],requestType:r}),(n.enableImmutableMode&&"indenting"===n.action||"outdenting"===n.action)&&n.renderModule.RowModifier({data:i,row:g})}}else{pt(n,a.parentItem.uniqueID).childRecords.push(a)}}var jt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_t=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},Ht=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return jt(i,e),_t([(0,t.Property)(!1)],i.prototype,"enableCache",void 0),_t([(0,t.Property)(3)],i.prototype,"maxBlocks",void 0),_t([(0,t.Property)(3)],i.prototype,"initialBlocks",void 0),i}(t.ChildProperty),Gt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},Kt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Gt(i,e),Qt([(0,t.Property)("startsWith")],i.prototype,"operator",void 0),Qt([(0,t.Property)(!1)],i.prototype,"ignoreAccent",void 0),Qt([(0,t.Property)(null)],i.prototype,"headerTemplate",void 0),Qt([(0,t.Property)(null)],i.prototype,"template",void 0),Qt([(0,t.Property)(null)],i.prototype,"footerTemplate",void 0),Qt([(0,t.Property)(!0)],i.prototype,"enableSearching",void 0),Qt([(0,t.Property)(null)],i.prototype,"renderCustomColumnChooser",void 0),i}(t.ChildProperty),Wt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},Jt=function(e){function i(i,n){var o=e.call(this,i,n)||this;o.dataResults={},o.uniqueIDCollection={},o.uniqueIDFilterCollection={},o.changedRecords="changedRecords",o.deletedRecords="deletedRecords",o.addedRecords="addedRecords",o.indentOutdentAction="indentOutdentAction",o.isFromChartSide=!1,o.modifiedRecords=[],o.stackedHeader=!1,o.freezeColumnRefresh=!0,o.objectEqualityChecker=function(e,t){if(e){for(var i=Object.keys(e),r=!0,n=["Children","childRecords","taskData","uniqueID","parentItem","parentUniqueID","index"],o=0;o<i.length;o++){if(e[i[parseInt(o.toString(),10)]]!==t[i[parseInt(o.toString(),10)]]&&-1===n.indexOf(i[parseInt(o.toString(),10)]))if(!(e[i[parseInt(o.toString(),10)]]instanceof Date&&t[i[parseInt(o.toString(),10)]]instanceof Date)||e[i[parseInt(o.toString(),10)]].getTime()!==t[i[parseInt(o.toString(),10)]].getTime()){r=!1;break}}return r}return!1},r.Inject(gt,C),(0,t.setValue)("mergePersistData",o.mergePersistTreeGridData,o);(0,t.isNullOrUndefined)(o.injectedModules.Logger)||l.Grid.Inject(l.Logger);o.injectedModules.filter(function(e){"freeze"===e.prototype.getModuleName()&&l.Grid.Inject(l.Freeze)});return o.grid=new l.Grid,o}var r;return Wt(i,e),r=i,i.prototype.excelExport=function(e,t,i,r){return this.excelExportModule.Map(e,t,i,r,!1)},i.prototype.csvExport=function(e,t,i,r){return this.excelExportModule.Map(e,t,i,r,!0)},i.prototype.pdfExport=function(e,t,i,r){return this.pdfExportModule.Map(e,t,i,r)},i.prototype.serverExcelExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},i.prototype.serverPdfExport=function(e){this.isExcel=!1,this.exportTreeGrid(e)},i.prototype.serverCsvExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},i.prototype.exportTreeGrid=function(e){var t=this.grid.getDataModule().generateQuery(!0),i=(new Ze.UrlAdaptor).processQuery(new Ze.DataManager({url:""}),t),r=JSON.parse(i.data),n=JSON.parse(this.addOnPersist(["allowPaging","pageSettings","sortSettings","allowPdfExport","allowExcelExport","aggregates","filterSettings","columns","locale","searchSettings","idMapping","parentIdMapping","childMapping","treeColumnIndex"]));n.filterSettings.columns=r.where,n.searchSettings.fields=r.search&&r.search[0].fields||[],n.sortSettings.columns=r.sorted,n.columns=this.setHeaderText(n.columns,["field","headerText","type","format","visible","template","index","width","textAlign","headerTextAlign","columns"]);var o=this.createElement("form",{id:"ExportForm"});o.style.display="none";var a=this.createElement("input",{id:"treeGridInput",attrs:{name:"treeGridModel"}});a.value=JSON.stringify(n),o.method="POST",o.action=e,o.appendChild(a),document.body.appendChild(o),o.submit(),o.remove()},i.prototype.setHeaderText=function(e,i){for(var r=0;r<e.length;r++){var n=this.getColumnByUid(e[parseInt(r.toString(),10)].uid);this.stackedHeader&&(0,t.isNullOrUndefined)(n)&&(n=(0,t.isNullOrUndefined)(e[parseInt(r.toString(),10)].field)?e[parseInt(r.toString(),10)]:this.getColumnByField(e[parseInt(r.toString(),10)].field)),e[parseInt(r.toString(),10)].headerText=n.headerText,(0,t.isNullOrUndefined)(n.template)||(e[parseInt(r.toString(),10)].template="true"),e[parseInt(r.toString(),10)].format&&(e[parseInt(r.toString(),10)].format=(0,l.getNumberFormat)(this.getFormat(n.format),n.type,!1,this.currencyCode),this.isExcel||"datetime"!==n.type&&"date"!==n.type||(e[parseInt(r.toString(),10)].format=e[parseInt(r.toString(),10)].format.toString().replace("AM/PM","tt")),e[parseInt(r.toString(),10)].type=n.type),e[parseInt(r.toString(),10)].columns&&this.setHeaderText(e[parseInt(r.toString(),10)].columns,i);for(var o=Object.keys(e[parseInt(r.toString(),10)]),a=0;a<o.length;a++)i.indexOf(o[parseInt(a.toString(),10)])<0&&delete e[parseInt(r.toString(),10)][o[parseInt(a.toString(),10)]]}return e},i.prototype.getFormat=function(e){return"object"==typeof e?(0,t.isNullOrUndefined)(e.format)?e.skeleton:e.format:e},i.prototype.getModuleName=function(){return"treegrid"},i.prototype.preRender=function(){this.TreeGridLocale(),this.initProperties(),this.defaultLocale={Above:"Above",Below:"Below",Child:"Child",AddRow:"Add Row",ExpandAll:"Expand All",CollapseAll:"Collapse All",RowIndent:"Indent",RowOutdent:"Outdent"},this.l10n=new t.L10n("treegrid",this.defaultLocale,this.locale),this.isSelfReference&&(0,t.isNullOrUndefined)(this.childMapping)&&(this.childMapping="Children")},i.prototype.sortByColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},i.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},i.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},i.prototype.search=function(e){this.grid.search(e)},i.prototype.autoFitColumns=function(e){this.resizeModule.autoFitColumns(e),this.updateColumnModel()},i.prototype.reorderColumns=function(e,t){this.grid.reorderColumns(e,t)},i.prototype.TreeGridLocale=function(){if(!(0,t.isNullOrUndefined)(this.locale)){var e=t.L10n.locale,i={};(0,t.setValue)(this.locale,{},i);var r;({}),r=(0,l.getObject)(this.locale,e);var n;({}),n=(0,l.getObject)(this.getModuleName(),r),(0,t.setValue)("grid",n,(0,l.getObject)(this.locale,i)),t.L10n.load(i)}},i.prototype.print=function(){this.printModule.print()},i.prototype.treeGridkeyActionHandler=function(e){if(this.allowKeyboard){var i=void 0,r=void 0,n=void 0,o=void 0,a=void 0;switch(e.action){case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"ctrlShiftUpArrow":n=(i=e.target).closest(".e-rowcell"),(0,t.isNullOrUndefined)(n)||(o=n.closest("tr"),(0,t.isNullOrUndefined)(o)||(0,t.isNullOrUndefined)(o.getElementsByClassName("e-treegridexpand")[0])||this.expandCollapseRequest(o.querySelector(".e-treegridexpand")));break;case"ctrlShiftDownArrow":n=(i=e.target).closest(".e-rowcell"),(0,t.isNullOrUndefined)(n)||(o=n.closest("tr"),(0,t.isNullOrUndefined)(o)||(0,t.isNullOrUndefined)(o.getElementsByClassName("e-treegridcollapse")[0])||this.expandCollapseRequest(o.querySelector(".e-treegridcollapse")));break;case"downArrow":if(!this.enableVirtualization&&(0,t.isNullOrUndefined)(this.rowTemplate))if(i=e.target,(0,t.isNullOrUndefined)(i.querySelectorAll(".e-rowcell"))||(i=(0,l.parentsUntil)(i,"e-rowcell")),!(0,t.isNullOrUndefined)(i))if(r=i.parentElement,!(0,t.isNullOrUndefined)(r))if((p=r.cellIndex)&&"dropdownedit"===this.grid.getColumnByIndex(p).editType&&(0,t.isNullOrUndefined)(this.grid.getColumnByIndex(p).edit.obj)&&(r=i),null!==(a=this.findnextRowElement(r))){var s=i.cellIndex,d=a.children[parseInt(s.toString(),10)];if(!(0,t.isNullOrUndefined)(d)&&!this.grid.isEdit)this.grid.getContent().querySelectorAll(".e-rowcell.e-focused, .e-rowcell.e-focus").forEach(function(e){(0,t.removeClass)([e],["e-focused","e-focus"])}),(0,t.addClass)([d],["e-focused","e-focus"])}else this.clearSelection();break;case"upArrow":var p;if(!this.enableVirtualization&&(0,t.isNullOrUndefined)(this.rowTemplate))if(i=e.target,(0,t.isNullOrUndefined)(i.querySelectorAll(".e-rowcell"))||(i=(0,l.parentsUntil)(i,"e-rowcell")),!(0,t.isNullOrUndefined)(i))if(r=i.parentElement,!(0,t.isNullOrUndefined)(r))if((p=r.cellIndex)&&"dropdownedit"===this.grid.getColumnByIndex(p).editType&&(0,t.isNullOrUndefined)(this.grid.getColumnByIndex(p).edit.obj)&&(r=i),null!==(a=this.findPreviousRowElement(r))){var h=i.cellIndex;if(!(0,t.isNullOrUndefined)(h)){var c=a.children[parseInt(h.toString(),10)];if(!(0,t.isNullOrUndefined)(c)&&!this.grid.isEdit)this.grid.getContent().querySelectorAll(".e-rowcell.e-focused, .e-rowcell.e-focus").forEach(function(e){(0,t.removeClass)([e],["e-focused","e-focus"])}),(0,t.addClass)([c],["e-focused","e-focus"])}}else this.clearSelection()}}},i.prototype.findnextRowElement=function(e){var t=e.nextElementSibling;return null===t||-1===t.className.indexOf("e-summaryrow")&&!t.classList.contains("e-childrow-hidden")||(t=this.findnextRowElement(t)),t},i.prototype.findPreviousRowElement=function(e){var t=e.previousElementSibling;return null===t||-1===t.className.indexOf("e-summaryrow")&&!t.classList.contains("e-childrow-hidden")||(t=this.findPreviousRowElement(t)),t},i.prototype.initProperties=function(){this.defaultLocale={},this.flatData=[],this.infiniteScrollData=[],this.remoteCollapsedData=[],this.remoteExpandedData=[],this.parentData=[],this.columnModel=[],this.isExpandAll=!1,this.isCollapseAll=!1,this.freezeColumnRefresh=!0,this.keyConfigs={ctrlDownArrow:"ctrl+downarrow",ctrlUpArrow:"ctrl+uparrow",ctrlShiftUpArrow:"ctrl+shift+uparrow",ctrlShiftDownArrow:"ctrl+shift+downarrow",downArrow:"downArrow",upArrow:"upArrow"},this.isLocalData=!(this.dataSource instanceof Ze.DataManager)||this.dataSource.dataSource.offline||!(0,t.isNullOrUndefined)(this.dataSource.ready)||this.dataSource.adaptor instanceof Ze.RemoteSaveAdaptor,this.isSelfReference=!(0,t.isNullOrUndefined)(this.parentIdMapping)},i.prototype.wireEvents=function(){t.EventHandler.add(this.grid.element,"click",this.mouseClickHandler,this),t.EventHandler.add(this.element,"touchend",this.mouseClickHandler,this),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.treeGridkeyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.allowKeyboard&&(this.element.tabIndex=-1===this.element.tabIndex?0:this.element.tabIndex)},i.prototype.requiredModules=function(){var e=[],i="mergedColumns";if(this[""+i]&&(this.grid[""+i]=this[""+i]),(0,t.isNullOrUndefined)(this.changedProperties.columns)&&this.grid.splitFrozenCount(this.getColumns()),this.isDestroyed)return e;e.push({member:"filter",args:[this,this.filterSettings],name:"Filter"}),(0,t.isNullOrUndefined)(this.toolbar)||e.push({member:"toolbar",args:[this],name:"Toolbar"}),this.contextMenuItems&&e.push({member:"contextMenu",args:[this],name:"ContextMenu"}),this.allowPaging&&e.push({member:"pager",args:[this,this.pageSettings],name:"Page"}),this.allowReordering&&e.push({member:"reorder",args:[this],name:"Reorder"}),this.allowSorting&&e.push({member:"sort",args:[this],name:"Sort"}),this.aggregates.length>0&&e.push({member:"summary",args:[this],name:"Aggregate"}),this.resizeCheck()&&e.push({member:"resize",args:[this],name:"Resize"}),this.allowExcelExport&&e.push({member:"ExcelExport",args:[this],name:"ExcelExport"});var r=this.injectedModules.filter(function(e){return"freeze"===e.prototype.getModuleName()}),n=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze});return(this.frozenColumns||this.frozenRows||this.getFrozenColumns()||n)&&r.length>0&&e.push({member:"freeze",args:[this],name:"Freeze"}),this.detailTemplate&&e.push({member:"detailRow",args:[this],name:"DetailRow"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this],name:"PdfExport"}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this],name:"ColumnMenu"}),this.showColumnChooser&&e.push({member:"ColumnChooser",args:[this],name:"ColumnChooser"}),this.extendRequiredModules(e),e},i.prototype.resizeCheck=function(){var e=!(!this.showColumnMenu||this.columnMenuItems&&!this.columnMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length),t=!(!this.contextMenuItems||!this.contextMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length);return this.allowResizing||e||t},i.prototype.extendRequiredModules=function(e){var i=this.injectedModules.filter(function(e){return"rowDragAndDrop"===e.prototype.getModuleName()});(this.allowRowDragAndDrop||i.length)&&((0,t.isNullOrUndefined)(this.toolbar)||!this.toolbar.includes("Indent")&&!this.toolbar.includes("Outdent")||(this.isIndentEnabled=!0),e.push({member:"rowDragAndDrop",args:[this],name:"RowDD"})),(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&e.push({member:"edit",args:[this],name:"Edit"}),!(0,t.isNullOrUndefined)(this.columns)&&this.isCommandColumn(this.columns)&&e.push({member:"commandColumn",args:[this],name:"CommandColumn"}),this.allowSelection&&e.push({member:"selection",args:[this],name:"Selection"}),this.enableVirtualization&&e.push({member:"virtualScroll",args:[this],name:"VirtualScroll"}),this.enableInfiniteScrolling&&e.push({member:"infiniteScroll",args:[this],name:"InfiniteScroll"}),e.push({member:"logger",args:[this.grid]})},i.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},i.prototype.unwireEvents=function(){this.grid&&this.grid.element&&t.EventHandler.remove(this.grid.element,"click",this.mouseClickHandler),this.element&&(t.EventHandler.remove(this.element,"touchend",this.mouseClickHandler),this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null),this.allowKeyboard&&this.element.removeAttribute("tabIndex"))},i.prototype.log=function(e,t){this.loggerModule&&this.loggerModule.treeLog(e,t,this)},i.prototype.render=function(){var e=this;this.isReact&&(this.grid.isReact=!0,this.grid.portals=[]),this.isVue&&(this.grid.isVue=!0,this.grid.vueInstance=this.vueInstance),(0,Rt.createSpinner)({target:this.element},this.createElement),this.log(["mapping_fields_missing"]),this.renderModule=new xt(this),this.dataModule=new Ct(this),this.printModule=new ft(this),this.trigger(D),this.autoGenerateColumns(),this.initialRender=!0,(0,t.isNullOrUndefined)(this.dataSource)||this.convertTreeData(this.dataSource),this.loadGrid(),this.element.classList.contains("e-treegrid")&&this.rowDropSettings.targetID&&(this.grid.rowDropSettings.targetID+="_gridcontrol"),this.addListener();var i=(0,t.createElement)("div",{id:this.element.id+"_gridcontrol",className:"e-treelistgrid"});(0,t.addClass)([this.element],"e-treegrid"),(0,t.isNullOrUndefined)(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),(0,t.isNullOrUndefined)(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.element.appendChild(i);var r=this.grid.requiredModules;this.grid.requiredModules=function(){var e=[];e=r.apply(this);for(var t=0;t<e.length;t++)"virtualscroll"===e[parseInt(t.toString(),10)].member&&(e[parseInt(t.toString(),10)].member="treeVirtualScroll");return e};var n="root";this.grid[""+n]=this[""+n]?this[""+n]:this,this.grid.appendTo(i),this.actionFailureHandler(),this.element.getElementsByClassName("e-gridcontent")[0].childNodes[0].setAttribute("tabindex","0");var o=this.element.getElementsByClassName("e-content")[0].querySelector(".e-table");(0,t.isNullOrUndefined)(o)||o.setAttribute("role","treegrid"),this.isIndentEnabled&&this.refreshToolbarItems(),this.wireEvents(),this.renderComplete();var a="destroyTemplate",s=this.grid[""+a];this.grid[""+a]=function(i,r,n){s.apply(e.grid);e.isReact&&(0,t.isNullOrUndefined)(e.portals)?(0,t.isNullOrUndefined)(n)||n():e.clearTemplate(i,r,n)}},i.prototype.actionFailureHandler=function(){var e=this,i=[],r=this.getPrimaryKeyFieldNames(),n=this.flatData.length;(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&0===r.length&&0!==n&&i.push("For the CRUD actions, it is necessary to enable Primary Key field for the unique data column."),this.allowRowDragAndDrop&&0===r.length&&0!==n&&i.push("For the Row Drag and Drop actions, it is necessary to enable Primary Key field for the unique data column."),this.allowPaging&&this.enableVirtualization&&i.push("Paging is not allowed in virtualization case."),0===n&&0===this.columns.length&&i.push("Either of the Data source or columns should be given."),this.frozenColumns>0&&this.columnModel.filter(function(e){return e.isFrozen})&&i.push("Use only one attribute for Frozen either IsFrozen or FrozenColumns."),this.enableVirtualization&&!(0,t.isNullOrUndefined)(this.detailTemplate)&&i.push("Virtual scrolling is not compatible with the detail template"),!(this.frozenColumns>0||this.frozenRows>0||this.columnModel.filter(function(e){return e.isFrozen}))||(0,t.isNullOrUndefined)(this.detailTemplate)&&(0,t.isNullOrUndefined)(this.rowTemplate)||i.push("Frozen rows and columns are not supported with the Detail template and row template."),(this.frozenColumns>0||this.columnModel.filter(function(e){return e.isFrozen}).length>0||this.frozenRows>0)&&"Cell"===this.editSettings.mode&&i.push("Frozen rows and columns are not supported with cell editing."),this.allowSelection&&!(0,t.isNullOrUndefined)(this.rowTemplate)&&i.push("Selection is not supported in RowTemplate"),this.treeColumnIndex>=this.columns.length&&i.push("TreeColumnIndex value should not exceed the total column count."),this.enableVirtualization&&(this.columnModel.some(function(e){return/%$/.test(e.width)})||/%$/.test(this.height.toString()))&&i.push("column width and height should be in pixels"),"Children"===this.childMapping||(0,t.isNullOrUndefined)(this.idMapping)||i.push("Both IdMapping and ChildMapping should not be used together for tree grid rendering."),(!(0,t.isNullOrUndefined)(this.idMapping)&&(0,t.isNullOrUndefined)(this.parentIdMapping)||(0,t.isNullOrUndefined)(this.idMapping)&&!(0,t.isNullOrUndefined)(this.parentIdMapping))&&i.push("IdMapping and ParentIdMapping properties should be defined and vice versa.");var o=this.columnModel.filter(function(e){return e.showCheckbox}),a=this.columns[this.treeColumnIndex];if(0!==o.length&&(o!==a&&i.push("ShowCheckbox column should not be defined other than the tree column."),o.length>1&&i.push("Only one column can have the ShowCheckbox option enabled.")),null!==this.treeColumnIndex&&-1!==this.treeColumnIndex&&this.treeColumnIndex<this.columns.length&&0!==this.columnModel.filter(function(t){return"Right"===t.textAlign&&t.field===e.columnModel[e.treeColumnIndex].field}).length&&i.push("TextAlign right for the tree column is not applicable."),i.length>0){var s={error:{}};i.forEach(function(e,t){s.error[parseInt(t.toString(),10)]=e}),this.trigger(Ye,s)}},i.prototype.refreshToolbarItems=function(){var e=this.toolbarModule.getToolbar(),t=this.element.id+"_gridcontrol_indent",i=this.element.id+"_gridcontrol_outdent",r=e.querySelector("#"+t).parentElement,n=e.querySelector("#"+i).parentElement;r.classList.add("e-hidden"),n.classList.add("e-hidden")},i.prototype.afterGridRender=function(){(0,t.isNullOrUndefined)(this.grid.clipboardModule)||this.grid.clipboardModule.destroy(),this.clipboardModule=this.grid.clipboardModule=new Xe(this,this.grid.serviceLocator)},i.prototype.convertTreeData=function(e){if(tt(this)&&(e=(0,t.getValue)("result",e)),e instanceof Array&&e.length>0&&Object.prototype.hasOwnProperty.call(e[0],"level")){this.flatData=e;for(var i=function(e,i){var n=r.flatData[parseInt(e.toString(),10)];(0,t.setValue)("uniqueIDCollection."+n.uniqueID,n,r),0!==n.level||r.parentData.some(function(e){return e.uniqueID===n.uniqueID})||r.parentData.push(n)},r=this,n=0,o=this.flatData.length;n<o;n++)i(n)}else if(tt(this)){var a=(0,t.getValue)("result",this.dataSource);this.dataModule.convertToFlatData(a)}else this.dataModule.convertToFlatData(e)},i.prototype.bindGridProperties=function(){this.bindedDataSource(),this.grid.enableRtl=this.enableRtl,this.grid.allowKeyboard=this.allowKeyboard,this.grid.columns=this.getGridColumns(this.columns),this.grid.allowExcelExport=this.allowExcelExport,this.grid.allowPdfExport=this.allowPdfExport,this.grid.query=this.query,this.grid.columnQueryMode=this.columnQueryMode,this.grid.allowPaging=this.allowPaging,this.grid.pageSettings=(0,l.getActualProperties)(this.pageSettings),this.grid.pagerTemplate=this.pagerTemplate,this.grid.showColumnMenu=this.showColumnMenu,this.grid.allowSorting=this.allowSorting,this.grid.allowMultiSorting=this.allowMultiSorting,this.grid.allowFiltering=this.allowFiltering,this.grid.enableVirtualization=this.enableVirtualization,this.grid.enableColumnVirtualization=this.enableColumnVirtualization,this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling,this.grid.infiniteScrollSettings=this.infiniteScrollSettings,this.grid.enableVirtualMaskRow=this.enableVirtualMaskRow,this.grid.loadingIndicator=this.loadingIndicator,this.grid.width=this.width,this.grid.height=this.height,this.grid.enableAltRow=this.enableAltRow,this.grid.allowReordering=this.allowReordering,this.grid.allowTextWrap=this.allowTextWrap,this.grid.allowResizing=this.allowResizing,this.grid.enableHover=this.enableHover,this.grid.enableAutoFill=this.enableAutoFill,this.grid.enableAdaptiveUI=this.enableAdaptiveUI,this.grid.enableImmutableMode=this.enableImmutableMode,this.grid.allowRowDragAndDrop=this.allowRowDragAndDrop,this.grid.rowDropSettings=(0,l.getActualProperties)(this.rowDropSettings),this.grid.rowHeight=this.rowHeight,this.grid.gridLines=this.gridLines,this.grid.allowSelection=this.allowSelection,this.grid.toolbar=(0,l.getActualProperties)(this.getGridToolbar()),this.grid.toolbarTemplate=this.toolbarTemplate,this.grid.showColumnChooser=this.showColumnChooser,this.grid.columnChooserSettings=this.columnChooserSettings,this.grid.filterSettings=(0,l.getActualProperties)(this.filterSettings),this.grid.selectionSettings=(0,l.getActualProperties)(this.selectionSettings),this.grid.sortSettings=(0,l.getActualProperties)(this.sortSettings),this.grid.searchSettings=(0,l.getActualProperties)(this.searchSettings),this.grid.aggregates=(0,l.getActualProperties)(this.aggregates),this.grid.textWrapSettings=(0,l.getActualProperties)(this.textWrapSettings),this.grid.printMode=(0,l.getActualProperties)(this.printMode),this.grid.locale=(0,l.getActualProperties)(this.locale),this.grid.selectedRowIndex=this.selectedRowIndex,this.grid.contextMenuItems=(0,l.getActualProperties)(this.getContextMenu()),this.grid.columnMenuItems=(0,l.getActualProperties)(this.columnMenuItems),this.grid.editSettings=this.getGridEditSettings(),this.grid.rowTemplate=(0,l.getActualProperties)(this.rowTemplate),this.grid.detailTemplate=(0,l.getActualProperties)(this.detailTemplate),this.grid.frozenRows=this.frozenRows,this.grid.frozenColumns=this.frozenColumns,this.grid.clipMode=(0,l.getActualProperties)(this.clipMode);var e="templateDotnetInstance";this.grid[""+e]=this[""+e];this.grid.isJsComponent=!0;this.grid.enableHtmlSanitizer=this.enableHtmlSanitizer,this.grid.enableStickyHeader=this.enableStickyHeader,this.grid.emptyRecordTemplate=this.emptyRecordTemplate,this.grid.isRowSelectable=this.isRowSelectable;this.grid.isTreeGrid=!0},i.prototype.triggerEvents=function(e){this.trigger((0,l.getObject)("name",e),e)},i.prototype.IsExpandCollapseClicked=function(e){this.isFromChartSide||(0,t.isNullOrUndefined)(e.target)||!(e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-summarycell"))||this.selectionSettings.checkboxOnly||!(!(0,t.isNullOrUndefined)(e.data)&&e.data.hasChildRecords||-1!==e.rowIndex&&(0,t.isNullOrUndefined)(e.data))||(e.cancel=!0)},i.prototype.bindGridEvents=function(){var e=this;this.grid.rowSelecting=function(i){e.IsExpandCollapseClicked(i),!(0,t.isNullOrUndefined)(i.data)&&e.selectionSettings.persistSelection&&e.columnModel.filter(function(e){return"checkbox"===e.type}).length>0&&et(e)&&((0,t.isNullOrUndefined)(i.data.parentItem)&&!i.isHeaderCheckboxClicked||(e.parentQuery=e.query.queries.filter(function(t){return t.e.field===e.parentIdMapping}),e.query.queries=e.query.queries.slice(0,0))),"Root"===e.pageSettings.pageSizeMode&&(e.grid.selectionModule.totalRecordsCount=e.grid.currentViewData.length),i.cancel||e.trigger(q,i)},this.grid.rowDeselecting=function(i){e.IsExpandCollapseClicked(i),!(0,t.isNullOrUndefined)(i.data)&&e.selectionSettings.persistSelection&&e.columnModel.filter(function(e){return"checkbox"===e.type}).length>0&&et(e)&&(e.parentQuery=e.query.queries.filter(function(t){return t.e.field===e.parentIdMapping}),e.query.queries=e.query.queries.slice(0,0)),e.trigger(Te,i)},this.grid.rowSelected=function(t){e.enableVirtualization&&e.virtualScrollModule.updateSelection(t),e.selectedRowIndex=e.grid.selectedRowIndex,e.notify(k,t),e.trigger(k,t)},this.grid.rowDeselected=function(i){e.selectedRowIndex=e.grid.selectedRowIndex,(0,t.isNullOrUndefined)(i.data)||e.notify(V,i),e.trigger(V,i)},this.grid.resizeStop=function(t){e.updateColumnModel(),e.trigger(F,t)},this.grid.excelQueryCellInfo=function(t){e.notify("excelCellInfo",t),t=e.dataResults},this.grid.excelAggregateQueryCellInfo=function(t){e.notify("excelAggregateCellInfo",t),t=e.dataResults},this.grid.pdfAggregateQueryCellInfo=function(t){e.notify("pdfAggregateCellInfo",t),t=e.dataResults},this.grid.pdfQueryCellInfo=function(t){e.notify("pdfCellInfo",t),t=e.dataResults},this.grid.checkBoxChange=function(t){e.trigger(T,t)},this.grid.pdfExportComplete=this.triggerEvents.bind(this),this.grid.excelExportComplete=this.triggerEvents.bind(this),this.grid.excelHeaderQueryCellInfo=this.triggerEvents.bind(this),this.grid.pdfHeaderQueryCellInfo=this.triggerEvents.bind(this),this.grid.dataSourceChanged=this.triggerEvents.bind(this),this.grid.recordDoubleClick=this.triggerEvents.bind(this),this.grid.cellDeselected=this.triggerEvents.bind(this),this.grid.cellDeselecting=this.triggerEvents.bind(this),this.grid.columnMenuOpen=this.triggerEvents.bind(this),this.grid.columnMenuClick=this.triggerEvents.bind(this),this.grid.cellSelected=this.triggerEvents.bind(this),this.grid.headerCellInfo=this.triggerEvents.bind(this),this.grid.resizeStart=this.triggerEvents.bind(this),this.grid.resizing=this.triggerEvents.bind(this),this.grid.columnDrag=this.triggerEvents.bind(this),this.grid.columnDragStart=this.triggerEvents.bind(this),this.grid.columnDrop=this.triggerEvents.bind(this),this.grid.beforePrint=this.triggerEvents.bind(this),this.grid.beforeCopy=this.triggerEvents.bind(this),this.grid.beforePaste=function(t){for(var i=e.getRows(),r="rowIndex";i[t[""+r]].classList.contains("e-summaryrow");)t[""+r]++;e.trigger(Z,t)},this.grid.load=function(){if(e.grid.on("initial-end",e.afterGridRender,e),!(0,t.isNullOrUndefined)(e.loggerModule)){e.loggerModule=e.grid.loggerModule=new C(e.grid)}},this.grid.printComplete=this.triggerEvents.bind(this),this.grid.actionFailure=function(t){e.trigger(Ye,t)},this.extendedGridDataBoundEvent(),this.extendedGridEvents(),this.extendedGridActionEvents(),this.extendedGridEditEvents(),this.bindGridDragEvents(),this.bindCallBackEvents()},i.prototype.lastRowBorder=function(e,i){for(var r=0;r<e.cells.length;r++)i?(0,t.addClass)([e.cells[parseInt(r.toString(),10)]],"e-lastrowcell"):(0,t.removeClass)([e.cells[parseInt(r.toString(),10)]],"e-lastrowcell")},i.prototype.isPixelHeight=function(){return"auto"!==this.height&&-1===this.height.toString().indexOf("%")},i.prototype.extendedGridDataBoundEvent=function(){var e=this;this.grid.dataBound=function(i){if(e.lastRowBorderEventListener(),e.updateRowTemplate(),e.updateColumnModel(),e.updateAltRow(e.getRows()),e.notify("dataBoundArg",i),et(e)&&!st(e)&&!e.hasChildMapping){var r=void 0;r=e.dataResults.result?0:1,(0,t.setValue)("grid.contentModule.isLoaded",!(r>0),e)}if(e.isPixelHeight()&&e.initialRender)for(var n=e.getContentTable().rows,o=[].slice.call(n),a=o.length-1;a>0;a--)if(!ht(o[parseInt(a.toString(),10)])){o[parseInt(a.toString(),10)].nextElementSibling&&e.lastRowBorder(o[parseInt(a.toString(),10)],!0);break}var s="action";if(e.enableVirtualization&&e.selectionSettings.persistSelection&&("expand"===e.dataResults[""+s]||"collapse"===e.dataResults[""+s])){if(e.grid.selectionModule.refreshPersistSelection(),"Single"===e.grid.selectionSettings.type){var d="updateRowSelection",l=e.getCurrentViewRecords().indexOf(e.grid.selectionModule.data);e.grid.selectionModule[""+d](e.getRows()[parseInt(l.toString(),10)],l)}}if(e.enableVirtualization&&e.selectionSettings.persistSelection&&!(0,t.isNullOrUndefined)(e.virtualScrollModule.prevSelectedRecord))for(a=0;a<e.virtualScrollModule.prevSelectedRecord.length;a++){d="updateRowSelection",l=e.getCurrentViewRecords().indexOf(e.virtualScrollModule.prevSelectedRecord[parseInt(a.toString(),10)]);e.grid.selectionModule[""+d](e.getRows()[parseInt(l.toString(),10)],l)}e.trigger(O,i),e.initialRender=!1};var i=this;this.grid.beforeDataBound=function(e){var r=(0,l.getObject)("action",e);if((et(i)&&!st(i)||tt(this))&&"edit"!==r)i.notify("updateRemoteLevel",e),e=i.dataResults;else if(0===i.flatData.length&&st(i)&&i.dataSource instanceof Ze.DataManager){var n=i.dataSource;i.dataModule.convertToFlatData(n.dataSource.json),e.result=i.grid.dataSource.dataSource.json=i.flatData}if(et(i)||tt(this)||(0,t.isNullOrUndefined)(i.dataSource)||(this.isPrinting&&(0,t.setValue)("isPrinting",!0,e),i.notify("dataProcessor",e)),(0,t.extend)(e,i.dataResults),i.enableImmutableMode&&(e.result=e.result.slice()),i.initialRender&&(this.contentModule.objectEqualityChecker=i.objectEqualityChecker),!this.isPrinting){var o=new Ze.Deferred;return i.trigger(A,e,function(e){o.resolve(e)}),o}},this.grid.log=function(t,i){e.loggerModule&&e.loggerModule.log(t,i)}},i.prototype.lastRowBorderEventListener=function(){this.grid.on("last-rowcell-border-updated",this.lastRowCellBorderUpdated,this)},i.prototype.bindCallBackEvents=function(){var e=this;this.grid.toolbarClick=function(t){if(!(t.item.id===e.grid.element.id+"_excelexport"&&!1===e.allowExcelExport||t.item.id===e.grid.element.id+"_pdfexport"&&!1===e.allowPdfExport||t.item.id===e.grid.element.id+"_csvexport"&&!1===e.allowExcelExport)){var i=new Ze.Deferred;return e.trigger(B,t,function(r){r.cancel||e.notify(B,t),i.resolve(r)}),i}},this.grid.cellSelecting=function(i){var r=e.grid.selectionModule.actualTarget;(0,t.isNullOrUndefined)(r)||!r.classList.contains("e-treegridexpand")&&!r.classList.contains("e-treegridcollapse")||(i.cancel=!0);var n=new Ze.Deferred;return e.trigger((0,l.getObject)("name",i),i,function(e){n.resolve(e)}),n},this.grid.beginEdit=function(i){if((0,t.isNullOrUndefined)(i.row)||!i.row.classList.contains("e-summaryrow")){var r=new Ze.Deferred;return e.trigger(ie,i,function(e){r.resolve(e)}),r}i.cancel=!0}},i.prototype.extendedGridEditEvents=function(){var e=this;this.grid.dataStateChange=function(i){e.isExpandRefresh?(e.isExpandRefresh=!1,e.grid.dataSource={result:e.flatData,count:(0,t.getValue)("count",e.grid.dataSource)}):("infiniteScroll"!==i.action.requestType&&(e.infiniteScrollData=[]),e.trigger(N,i))},this.grid.cellSave=function(i){if(e.grid.isContextMenuOpen()){var r=e.grid.contextMenuModule.contextMenu.element.getElementsByClassName("e-selected")[0];((0,t.isNullOrUndefined)(r)||r.id!==e.element.id+"_gridcontrol_cmenu_Save")&&(i.cancel=!0)}var n=new Ze.Deferred;return e.trigger(oe,i,function(t){t.cancel||e.notify(oe,t),n.resolve(t)}),n},this.grid.cellSaved=function(t){e.trigger(ae,t),e.notify(ae,t)},this.grid.cellEdit=function(t){var i=new Ze.Deferred;return t.promise=i,e.notify(se,t),i},this.grid.batchAdd=function(t){e.trigger(pe,t),e.notify(pe,t)},this.grid.beforeBatchSave=function(t){e.trigger(ue,t),e.notify(ue,t)},this.grid.beforeBatchAdd=function(t){e.trigger(ce,t),e.notify(ce,t)},this.grid.batchDelete=function(t){e.trigger(de,t),e.notify(de,t)},this.grid.beforeBatchDelete=function(t){e.trigger(he,t),e.notify(he,t)},this.grid.batchCancel=function(t){"Cell"!==e.editSettings.mode&&e.trigger(le,t),e.notify(le,t)}},i.prototype.updateRowTemplate=function(){var e=this;this.rowTemplate&&(this.isReact&&0===this.getContentTable().rows.length?setTimeout(function(){if(e.treeColumnRowTemplate(),e.enableCollapseAll)for(var t=e.getCurrentViewRecords(),i=e.getContentTable().rows,r=0;r<i.length;r++){var n={data:t[parseInt(r.toString(),10)],row:i[parseInt(r.toString(),10)]};e.renderModule.RowModifier(n)}},0):this.treeColumnRowTemplate())},i.prototype.bindedDataSource=function(){var e="dataSource",i="ready";if(this.dataSource&&tt(this)){var r=this.flatData,n=(0,t.getValue)("count",this.dataSource);this.grid.dataSource={result:r,count:n}}else this.grid.dataSource=this.dataSource instanceof Ze.DataManager?new Ze.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor,this.hasPreAndPostMiddleware(this.dataSource)?this.dataSource:void 0):this.flatData;if(this.dataSource instanceof Ze.DataManager&&(this.dataSource.dataSource.offline||this.dataSource.ready)){this.grid.dataSource[""+e].json=dt(this.dataSource[""+e].json),this.grid.dataSource[""+i]=this.dataSource.ready;var o=this;(0,t.isNullOrUndefined)(this.grid.dataSource[""+i])||this.grid.dataSource[""+i].then(function(t){var i=o.grid.dataSource;i[""+e].offline=!0,i.isDataAvailable=!0,i[""+e].json=t.result,i.adaptor=new Ze.JsonAdaptor})}},i.prototype.extendedGridActionEvents=function(){var e=this;this.grid.actionBegin=function(i){if("sorting"===i.requestType&&i.target&&i.target.parentElement&&i.target.parentElement.classList.contains("e-hierarchycheckbox"))i.cancel=!0;else if("reorder"===(0,l.getObject)("requestType",i)&&e.notify("getColumnIndex",{}),et(e)&&e.enableVirtualization&&("virtualscroll"===i.requestType?(e.query.expand("VirtualScrollingAction"),e.showSpinner()):"searching"===i.requestType&&""===i.searchString?e.query.expand("ClearSearchingAction"):"clearFilter"===i.action&&e.query.expand("ClearFilteringAction")),e.notify("actionBegin",{editAction:i}),et(e)||(0,t.isNullOrUndefined)(e.filterModule)||tt(e)||0!==e.grid.filterSettings.columns.length||0!==e.grid.searchSettings.key.length||(e.notify("clearFilters",{flatData:e.grid.dataSource}),e.grid.setProperties({dataSource:e.dataResults.result},!0),(0,t.isNullOrUndefined)(e.grid.changedProperties.dataSource)&&(e.grid.renderModule.data.dataManager=e.grid.dataSource instanceof Ze.DataManager?e.grid.dataSource:(0,t.isNullOrUndefined)(e.grid.dataSource)?new Ze.DataManager:new Ze.DataManager(e.grid.dataSource),e.grid.renderModule.data.isQueryInvokedFromData=!0,e.grid.query=e.grid.query instanceof Ze.Query?e.grid.query:new Ze.Query)),"indenting"!==e.action&&"outdenting"!==e.action){var r=new Ze.Deferred;return e.trigger(E,i,function(t){t.cancel||e.notify(ie,t),r.resolve(t)}),r}},this.grid.actionComplete=function(t){if(e.notify("actioncomplete",t),e.updateColumnModel(),e.updateTreeGridModel(),"reorder"===t.requestType&&e.notify("setColumnIndex",{}),e.notify("actionComplete",{editAction:t}),"add"===t.requestType&&"Top"!==e.editSettings.newRowPosition&&"Bottom"!==e.editSettings.newRowPosition&&e.notify(re,t),"batchsave"===t.requestType&&e.notify(ge,t),e.notify("updateGridActions",t),"save"===t.requestType&&e.aggregates.map(function(e){return!0===e.showChildSummary}).length&&e.grid.refresh(),"filter"===t.action&&(t.isCollapseMaintain||""===e.filterModule.currentFilterObject||!e.enableVirtualization||e.initialRender||et(e)&&e.enableVirtualization||e.expandAll()),"searching"===t.requestType&&(t.isCollapseMaintain||""===e.searchSettings.key||!e.enableVirtualization||e.initialRender||et(e)&&e.enableVirtualization||e.expandAll()),"clearFilter"===t.action&&e.enableCollapseAll&&e.collapseAll(),"indenting"===e.action||"outdenting"===e.action){e.action="indenting"===e.action?"indented":"outdented";var i=[e.selectedRecords],r={data:i,dropIndex:e.dropIndex,dropPosition:e.dropPosition,modifiedRecords:e.modifiedRecords,requestType:e.action,row:e.selectedRows};e.trigger(U,r),e.getCurrentViewRecords().filter(function(e){return e.uniqueID===i[0].uniqueID}).length||e.refreshToolbarItems(),e.action="",e.selectedRecords=e.selectedRows=e.modifiedRecords=[]}else{if(e.grid.isFrozenGrid()&&e.enableVirtualization&&"movable"===t.tableName){var n=e.grid.element.querySelector("."+Be),o=e.grid.element.querySelector("."+Le);n.style.height=o.style.height="auto"}e.trigger(U,t)}}},i.prototype.extendedGridEvents=function(){var e=this,i=this;this.grid.recordDoubleClick=function(t){e.trigger(ne,t),e.notify(ne,t)},this.grid.detailDataBound=function(t){e.notify("detaildataBound",t),e.trigger(De,t)},this.grid.rowDataBound=function(e){(0,t.isNullOrUndefined)(this.isPrinting)?(0,t.setValue)("isPrinting",!1,e):(0,t.setValue)("isPrinting",this.isPrinting,e),i.renderModule.RowModifier(e)},this.grid.queryCellInfo=function(e){(0,t.isNullOrUndefined)(this.isPrinting)?(0,t.setValue)("isPrinting",!1,e):(0,t.setValue)("isPrinting",this.isPrinting,e),i.renderModule.cellRender(e)},this.grid.contextMenuClick=function(t){e.notify(X,t),e.trigger(X,t)},this.grid.contextMenuOpen=function(t){e.notify(J,t),e.trigger(J,t)},this.grid.queryCellInfo=function(t){e.renderModule.cellRender(t)}},i.prototype.bindGridDragEvents=function(){var e=this;this.grid.rowDragStartHelper=function(t){e.trigger(Oe,t)},this.grid.rowDragStart=function(t){e.trigger(Ae,t)},this.grid.rowDrag=function(t){e.grid.isEdit?t.cancel=!0:(e.notify(Ue,t),e.trigger(Me,t))},this.grid.rowDrop=function(t){e.grid.isEdit||e.notify(qe,t),t.cancel=!0}},i.prototype.loadGrid=function(){this.bindGridProperties(),this.bindGridEvents(),(0,t.setValue)("registeredTemplate",this.registeredTemplate,this.grid);(0,t.setValue)("viewContainerRef",this.viewContainerRef,this.grid)},i.prototype.autoGenerateColumns=function(){var e=this;if(!this.columns.length&&!this.dataModule.isRemote()&&Object.keys(this.dataSource).length){this.columns=[];var t=this.dataSource[0],i=Object.keys(t);this.columns=i.filter(function(t){return-1===[e.childMapping,e.parentIdMapping].indexOf(t)})}},i.prototype.getGridEditSettings=function(){var e={},t="guid";switch(e.allowAdding=this.editSettings.allowAdding,e.allowEditing=this.editSettings.allowEditing,e.allowDeleting=this.editSettings.allowDeleting,e.newRowPosition="Bottom"===this.editSettings.newRowPosition?"Bottom":"Top",e.allowEditOnDblClick=this.editSettings.allowEditOnDblClick,e.showConfirmDialog=this.editSettings.showConfirmDialog,e.template=this.editSettings.template,e.showDeleteConfirmDialog=this.editSettings.showDeleteConfirmDialog,e.allowNextRowEdit=this.editSettings.allowNextRowEdit,e[""+t]=this.editSettings[""+t],e.dialog=this.editSettings.dialog,this.editSettings.mode){case"Dialog":case"Batch":e.mode=this.editSettings.mode;break;case"Row":e.mode="Normal";break;case"Cell":e.mode="Normal",e.showConfirmDialog=!1}return e},i.prototype.getContextMenu=function(){if(this.contextMenuItems){for(var e=[],t=0;t<this.contextMenuItems.length;t++)switch(this.contextMenuItems[parseInt(t.toString(),10)]){case"AddRow":case ut.AddRow:e.push({text:this.l10n.getConstant("AddRow"),target:".e-content",id:this.element.id+"_gridcontrol_cmenu_AddRow",items:[{text:this.l10n.getConstant("Above"),id:"Above"},{text:this.l10n.getConstant("Below"),id:"Below"},{text:this.l10n.getConstant("Child"),id:"Child"}]});break;case"Indent":case ut.RowIndent:e.push({text:this.l10n.getConstant("RowIndent"),target:".e-content",iconCss:"e-indent e-icons",id:this.element.id+"_gridcontrol_cmenu_Indent"});break;case"Outdent":case ut.RowOutdent:e.push({text:this.l10n.getConstant("RowOutdent"),target:".e-content",iconCss:"e-outdent e-icons",id:this.element.id+"_gridcontrol_cmenu_Outdent"});break;default:e.push(this.contextMenuItems[parseInt(t.toString(),10)])}return e}return null},i.prototype.getGridToolbar=function(){if(this.toolbar){this.l10n=new t.L10n("treegrid",this.defaultLocale,this.locale);for(var e=[],i=void 0,r=0;r<this.toolbar.length;r++)switch(this.toolbar[parseInt(r.toString(),10)]){case"Search":case ct.Search:e.push("Search");break;case"Print":case ct.Print:e.push("Print");break;case"ExpandAll":case ct.ExpandAll:i=this.l10n.getConstant("ExpandAll"),e.push({text:i,tooltipText:i,prefixIcon:"e-expand",id:this.element.id+"_gridcontrol_expandall"});break;case"CollapseAll":case ct.CollapseAll:i=this.l10n.getConstant("CollapseAll"),e.push({text:i,tooltipText:i,prefixIcon:"e-collapse",id:this.element.id+"_gridcontrol_collapseall"});break;case"Indent":case ct.RowIndent:i=this.l10n.getConstant("RowIndent"),e.push({text:i,tooltipText:i,prefixIcon:"e-indent",id:this.element.id+"_gridcontrol_indent"});break;case"Outdent":case ct.RowOutdent:i=this.l10n.getConstant("RowOutdent"),e.push({text:i,tooltipText:i,prefixIcon:"e-outdent",id:this.element.id+"_gridcontrol_outdent"});break;default:e.push(this.toolbar[parseInt(r.toString(),10)])}return e}return null},i.prototype.getGridColumns=function(e,i,r){void 0===i&&(i=!0),void 0===r&&(r=0);var o,a,s=e;i&&(this.columnModel=[]),0===this.columnModel.length&&(r=0===r?-1:r);for(var d=[],l=0;l<s.length;l++){r+=1;var p=this.grid.getColumnByUid(s[parseInt(l.toString(),10)].uid);if(a=p||{},o={},"string"==typeof this.columns[parseInt(l.toString(),10)])a.field=o.field=this.columns[parseInt(l.toString(),10)];else for(var h=Object.keys(s[parseInt(l.toString(),10)]),c=0;c<h.length;c++){var u=h[parseInt(c.toString(),10)];r===this.treeColumnIndex&&"template"===u?o[""+u]=s[parseInt(l.toString(),10)][""+u]:"columns"!==u||(0,t.isNullOrUndefined)(s[parseInt(l.toString(),10)][""+u])?this.initialRender&&!(0,t.isNullOrUndefined)(p)&&this.enablePersistence&&"edit"===u?a[""+u]=o[""+u]=p[""+u]:p&&"sortComparer"===u||(a[""+u]=o[""+u]=s[parseInt(l.toString(),10)][""+u]):(a[""+u]=this.getGridColumns(s[parseInt(l.toString(),10)][""+u],!1,this.columnModel.length-1),o[""+u]=s[parseInt(l.toString(),10)][""+u])}o.columns||this.columnModel.push(new n(o)),d.push(a),!(0,t.isNullOrUndefined)(this.columnModel[this.treeColumnIndex])&&this.enableRtl&&a.field===this.columnModel[this.treeColumnIndex].field&&((0,t.isNullOrUndefined)(this.treeColumnTextAlign)&&(this.treeColumnTextAlign=this.columnModel[this.treeColumnIndex].textAlign,this.treeColumnField=this.columnModel[this.treeColumnIndex].field),a.textAlign="Right")}return d},i.prototype.lastRowCellBorderUpdated=function(){var e=this.getContentTable().querySelectorAll("tr.e-row"),t=Array.from(e).filter(function(e){return!e.classList.contains("e-childrow-hidden")});if(t.length>0){var i=t[t.length-1];this.lastRowBorder(i,!0)}},i.prototype.onPropertyChanged=function(e){var i=Object.keys(e),r=!1;i.indexOf("columns")>-1&&!(0,t.isNullOrUndefined)(e.columns)&&this.refreshColumns();for(var n=0,o=i;n<o.length;n++){var a=o[n];switch(a){case"treeColumnIndex":this.grid.refreshColumns();break;case"allowPaging":this.grid.allowPaging=this.allowPaging;break;case"pageSettings":this.grid.pageSettings=(0,l.getActualProperties)(this.pageSettings),r=!0;break;case"enableVirtualization":this.grid.enableVirtualization=this.enableVirtualization;break;case"enableColumnVirtualization":this.grid.enableColumnVirtualization=this.enableColumnVirtualization;break;case"toolbar":this.grid.toolbar=this.getGridToolbar();break;case"allowSelection":this.grid.allowSelection=this.allowSelection;break;case"selectionSettings":this.grid.selectionSettings=(0,l.getActualProperties)(this.selectionSettings);break;case"allowSorting":this.grid.allowSorting=this.allowSorting;break;case"allowMultiSorting":this.grid.allowMultiSorting=this.allowMultiSorting;break;case"sortSettings":this.grid.sortSettings=(0,l.getActualProperties)(this.sortSettings);break;case"searchSettings":this.grid.searchSettings=(0,l.getActualProperties)(this.searchSettings);break;case"allowFiltering":this.grid.allowFiltering=this.allowFiltering;break;case"filterSettings":this.initialRender||(this.grid.filterSettings=(0,l.getActualProperties)(this.filterSettings));break;case"showColumnMenu":this.grid.showColumnMenu=this.showColumnMenu;break;case"allowRowDragAndDrop":this.grid.allowRowDragAndDrop=this.allowRowDragAndDrop;break;case"aggregates":this.grid.aggregates=(0,l.getActualProperties)(this.aggregates);break;case"enableInfiniteScrolling":this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling;break;case"dataSource":if(this.isLocalData=!(this.dataSource instanceof Ze.DataManager)||!(0,t.isNullOrUndefined)(this.dataSource.ready)||this.dataSource.adaptor instanceof Ze.RemoteSaveAdaptor,this.convertTreeData(this.dataSource),this.isLocalData){if(tt(this)){var s=(0,t.getValue)("count",this.dataSource);this.grid.dataSource={result:this.flatData,count:s}}else{var d=this.dataSource;this.grid.dataSource=d instanceof Ze.DataManager?new Ze.DataManager(d.dataSource,d.defaultQuery,d.adaptor):this.flatData}this.enableVirtualization&&(this.grid.contentModule.isDataSourceChanged=!0)}else this.bindedDataSource(),this.enableVirtualization&&(this.grid.contentModule.removeEventListener(),this.grid.contentModule.eventListener("on"),this.grid.contentModule.renderTable());break;case"query":this.grid.query=this.query;break;case"enableCollapseAll":e[""+a]?this.collapseAll():this.expandAll();break;case"expandStateMapping":this.grid.refresh();break;case"gridLines":this.grid.gridLines=this.gridLines;break;case"rowTemplate":this.grid.rowTemplate=(0,l.getActualProperties)(this.rowTemplate);break;case"frozenRows":this.grid.frozenRows=this.frozenRows;break;case"frozenColumns":this.grid.frozenColumns=this.frozenColumns;break;case"rowHeight":this.grid.rowHeight=this.rowHeight,this.refresh();break;case"height":(0,t.isNullOrUndefined)(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),this.grid.height=this.height;break;case"width":(0,t.isNullOrUndefined)(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.grid.width=this.width;break;case"locale":this.grid.locale=this.locale,this.TreeGridLocale(),this.grid.toolbar=this.getGridToolbar(),this.grid.contextMenuItems=this.getContextMenu();break;case"selectedRowIndex":this.grid.selectedRowIndex=this.selectedRowIndex;break;case"enableAltRow":this.grid.enableAltRow=this.enableAltRow;break;case"enableHover":this.grid.enableHover=this.enableHover;break;case"enableAutoFill":this.grid.enableAutoFill=this.enableAutoFill;break;case"columnChooserSettings":this.grid.columnChooserSettings=(0,l.getActualProperties)(this.columnChooserSettings);break;case"enableAdaptiveUI":this.grid.enableAdaptiveUI=this.enableAdaptiveUI;break;case"enableImmutableMode":this.grid.enableImmutableMode=this.enableImmutableMode;break;case"allowExcelExport":this.grid.allowExcelExport=this.allowExcelExport;break;case"allowPdfExport":this.grid.allowPdfExport=this.allowPdfExport;break;case"enableRtl":(0,t.isNullOrUndefined)(this.treeColumnField)||this.updateTreeColumnTextAlign(),this.grid.enableRtl=this.enableRtl;break;case"allowReordering":this.grid.allowReordering=this.allowReordering;break;case"allowResizing":this.grid.allowResizing=this.allowResizing;break;case"textWrapSettings":this.grid.textWrapSettings=(0,l.getActualProperties)(this.textWrapSettings);break;case"allowTextWrap":this.grid.allowTextWrap=(0,l.getActualProperties)(this.allowTextWrap),this.grid.refresh();break;case"contextMenuItems":this.grid.contextMenuItems=this.getContextMenu();break;case"showColumnChooser":this.grid.showColumnChooser=this.showColumnChooser;break;case"detailTemplate":this.grid.detailTemplate=(0,l.getActualProperties)(this.detailTemplate);break;case"columnMenuItems":this.grid.columnMenuItems=(0,l.getActualProperties)(this.columnMenuItems);break;case"enableStickyHeader":this.grid.enableStickyHeader=this.enableStickyHeader;break;case"emptyRecordTemplate":this.grid.emptyRecordTemplate=this.emptyRecordTemplate;break;case"isRowSelectable":this.grid.isRowSelectable=this.isRowSelectable;break;case"editSettings":this.grid.isEdit&&"Normal"===this.grid.editSettings.mode&&e[""+a].mode&&("Cell"===e[""+a].mode||"Row"===e[""+a].mode)&&this.grid.closeEdit(),this.grid.editSettings=this.getGridEditSettings()}r&&this.grid.refresh()}},i.prototype.updateTreeColumnTextAlign=function(){this.grid.getColumnByField(this.treeColumnField).textAlign=this.enableRtl?"Right":this.treeColumnTextAlign,this.grid.refreshColumns()},i.prototype.destroy=function(){var t=this.element;if(t){var i=!(!t.querySelector(".e-gridheader")||!t.querySelector(".e-gridcontent"));i&&this.unwireEvents(),this.removeListener(),i&&e.prototype.destroy.call(this),this.grid&&this.grid.destroy(),this.dataModule&&this.dataModule.destroy();for(var r=["dataModule","sortModule","renderModule","filterModule","printModule","clipboardModule","excelExportModule","pdfExportModule","toolbarModule","summaryModule","reorderModule","resizeModule","pagerModule","keyboardModule","columnMenuModule","contextMenuModule","editModule","virtualScrollModule","selectionModule","detailRow","rowDragAndDropModule","freezeModule"],n=0;n<r.length;n++)this[r[parseInt(n.toString(),10)]]&&(this[r[parseInt(n.toString(),10)]]=null);this.element.innerHTML="",this.grid=null}},i.prototype.dataBind=function(){(0,t.isNullOrUndefined)(this.grid)||(!(0,t.isNullOrUndefined)(this.rowDropSettings.targetID)&&(0,t.isNullOrUndefined)(document.getElementById(this.grid.rowDropSettings.targetID))&&(document.getElementById(this.rowDropSettings.targetID).id=this.grid.rowDropSettings.targetID,this.rowDropSettings.targetID=this.grid.rowDropSettings.targetID),e.prototype.dataBind.call(this),this.grid.dataBind())},i.prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex","scrollPosition"],i={pageSettings:["template","pageSizes","pageSizeMode","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[],scrollPosition:[]},r=0;r<e.length;r++)for(var n=this[e[parseInt(r.toString(),10)]],o=0,a=i[e[parseInt(r.toString(),10)]];!(0,t.isNullOrUndefined)(a)&&o<a.length;o++){delete n[""+a[parseInt(o.toString(),10)]]}return this.ignoreInArrays(["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],this.columns),this.addOnPersist(e)},i.prototype.ignoreInArrays=function(e,t){for(var i=0;i<t.length;i++)t[parseInt(i.toString(),10)].columns?(this.ignoreInColumn(e,t[parseInt(i.toString(),10)]),this.ignoreInArrays(e,t[parseInt(i.toString(),10)].columns)):this.ignoreInColumn(e,t[parseInt(i.toString(),10)])},i.prototype.ignoreInColumn=function(e,i){if((0,t.isNullOrUndefined)(i.template))for(var r=0;r<e.length;r++)delete i[e[parseInt(r.toString(),10)]],i.filter={}},i.prototype.mouseClickHandler=function(e){var i=this;if((0,t.isNullOrUndefined)(e.touches)){var r=e.target;!r.classList.contains("e-treegridexpand")&&!r.classList.contains("e-treegridcollapse")||this.isEditCollapse||this.grid.isEdit||this.expandCollapseRequest(r);if((r.classList.contains("e-treegridexpand")||r.classList.contains("e-treegridcollapse"))&&this.grid.isEllipsisTooltip()&&this.grid.toolTipObj.close(),this.isEditCollapse=!1,this.notify("checkboxSelection",{target:r}),this.grid.isCheckBoxSelection&&!this.grid.isPersistSelection&&this.aggregates.map(function(e){return!0===e.showChildSummary}).length){var n=this.grid.getHeaderContent().querySelector(".e-checkselectall"),o=this.grid.getSelectedRowIndexes().length,a=this.getCurrentViewRecords().length;if(a>0&&o===a){var s=n.nextElementSibling;(0,t.removeClass)([s],["e-stop","e-uncheck"]),(0,t.addClass)([s],["e-check"])}}if((r.classList.contains("e-flmenu-cancelbtn")||r.classList.contains("e-flmenu-okbtn")||r.classList.contains("e-content")||r.classList.contains("e-rowcell"))&&!(0,t.isNullOrUndefined)(this.grid.filterModule)&&this.isReact&&!(0,t.isNullOrUndefined)(this.grid.filterModule.column)&&this.grid.filterModule.column.filterTemplate){var d=document.getElementById(this.grid.filterModule.filterModule.dlgObj.element.id);this.grid.filterModule.fltrDlgDetails.isOpen=!1,this.grid.filterModule.filterModule.dlgObj&&!this.grid.filterModule.filterModule.dlgObj.isDestroyed&&d&&this.clearTemplate(["filterTemplate"],void 0,function(){i.grid.filterModule.filterModule.dlgObj.destroy()})}}},i.prototype.getRows=function(){return this.grid.getRows()},i.prototype.getPager=function(){return this.grid.getPager()},i.prototype.addRecord=function(e,t,i){if(this.editModule){this.editModule.isAddedRowByMethod=!0,this.editModule.addRecord(e,t,i)}},i.prototype.closeEdit=function(){this.grid.editModule&&this.editModule.closeEdit()},i.prototype.saveCell=function(){this.grid.editModule&&this.grid.editModule.saveCell()},i.prototype.updateCell=function(e,t,i){this.grid.editModule&&this.grid.editModule.updateCell(e,t,i)},i.prototype.updateRow=function(e,i){if(this.grid.editModule)if((0,t.isNullOrUndefined)(e))this.grid.editModule.updateRow(e,i);else{var r=this.grid.getCurrentViewRecords()[parseInt(e.toString(),10)];(0,t.extend)(r,i),this.grid.editModule.updateRow(e,r)}},i.prototype.deleteRecord=function(e,i){if((0,t.isNullOrUndefined)(e)&&(0,t.isNullOrUndefined)(i)||this.getSelectedRecords().length<=0){this.trigger(Ye,{error:"The provided value for the fieldName and data is undefined. Please ensure the fieldName and data contains number."})}this.grid.editModule&&this.grid.editModule.deleteRecord(e,i)},i.prototype.startEdit=function(e){this.grid.editModule&&this.grid.editModule.startEdit(e)},i.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},i.prototype.enableToolbarItems=function(e,t){this.grid.toolbarModule&&this.grid.toolbarModule.enableItems(e,t)},i.prototype.endEdit=function(){this.grid.editModule&&this.grid.editModule.endEdit()},i.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},i.prototype.deleteRow=function(e){this.grid.editModule&&this.grid.editModule.deleteRow(e)},i.prototype.getPrimaryKeyFieldNames=function(){return this.grid.getPrimaryKeyFieldNames()},i.prototype.setCellValue=function(e,t,i){this.grid.setCellValue(e,t,i);var r=this.grid.getRowIndexByPrimaryKey(e),n=this.getCurrentViewRecords()[parseInt(r.toString(),10)];zt({value:n,action:"edit"},this,this.isSelfReference,n.index,this.grid.selectedRowIndex,t)},i.prototype.setRowData=function(e,t){var i,r=this.getCurrentViewRecords(),n=this.grid.getPrimaryKeyFieldNames()[0],o={};r.some(function(t){return t[""+n]===e&&(o=t,!0)}),i=o.level,t.level=i,t.index=o.index,t.childRecords=o.childRecords,t.taskData=o.taskData,t.uniqueID=o.uniqueID,t.parentItem=o.parentItem,t.checkboxState=o.checkboxState,t.hasChildRecords=o.hasChildRecords,t.parentUniqueID=o.parentUniqueID,t.expanded=o.expanded,this.grid.setRowData(e,t);var a=this.getVisibleRecords();if(a.length>0&&e===a[a.length-1][""+n]){var s=this.getContentTable().scrollHeight,d=this.getContent().clientHeight;this.lastRowBorder(this.getRows()[r.indexOf(o)],s<=d)}},i.prototype.goToPage=function(e){this.grid.pagerModule&&this.grid.pagerModule.goToPage(e)},i.prototype.updateExternalMessage=function(e){this.pagerModule&&this.grid.pagerModule.updateExternalMessage(e)},i.prototype.getCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},i.prototype.getColumnByField=function(e){return(0,l.iterateArrayOrObject)(this.columnModel,function(t){if(t.field===e)return t})[0]},i.prototype.getColumnByUid=function(e){var t=this.initialRender?this.grid.columns:this.columns;return this.grid.columns.length!==this.columnModel.length&&(t=this.grid.columnModel),(0,l.iterateArrayOrObject)(t,function(t){if(t.uid===e)return t})[0]},i.prototype.getColumnFieldNames=function(){return this.grid.getColumnFieldNames()},i.prototype.getFooterContent=function(){return this.grid.getFooterContent()},i.prototype.getFooterContentTable=function(){return this.grid.getFooterContentTable()},i.prototype.showColumns=function(e,t){this.grid.showColumns(e,t),this.updateColumnModel()},i.prototype.hideColumns=function(e,t){this.grid.hideColumns(e,t),this.updateColumnModel()},i.prototype.getColumnHeaderByField=function(e){return this.grid.getColumnHeaderByField(e)},i.prototype.getColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},i.prototype.getColumnHeaderByUid=function(e){return this.grid.getColumnHeaderByUid(e)},i.prototype.getColumnIndexByField=function(e){return this.grid.getColumnIndexByField(e)},i.prototype.getVirtualColIndexByUid=function(e){var i=(0,l.iterateArrayOrObject)(this.grid.columnModel,function(t,i){if(t.uid===e)return i})[0];return(0,t.isNullOrUndefined)(i)?-1:i},i.prototype.getColumnIndexByUid=function(e){return this.grid.getColumnIndexByUid(e)},i.prototype.getColumns=function(e){return this.updateColumnModel(this.grid.getColumns(e)),this.columnModel},i.prototype.updateColumnModel=function(e){var i,r,o,a=(0,t.isNullOrUndefined)(e)?this.grid.getColumns():e;if(-1!==this.treeColumnIndex&&this.columnModel[this.treeColumnIndex]&&!(0,t.isNullOrUndefined)(this.columnModel[this.treeColumnIndex].template)&&(i=this.columnModel[this.treeColumnIndex].template,r=this.columnModel[this.treeColumnIndex].field),!this.enableColumnVirtualization||this.enableColumnVirtualization&&this.columnModel.length===a.length){this.columnModel=[];for(var s=0;s<a.length;s++){o={};for(var d=0,l=Object.keys(a[parseInt(s.toString(),10)]);d<l.length;d++){var p=l[d];o[""+p]=a[parseInt(s.toString(),10)][""+p]}this.columnModel.push(new n(o)),r!==this.columnModel[parseInt(s.toString(),10)].field||"checkbox"===this.columnModel[parseInt(s.toString(),10)].type||(0,t.isNullOrUndefined)(i)||""===i||(this.columnModel[parseInt(s.toString(),10)].template=i)}}var h="deepMerge";if(this[""+h]=["columns"],this.grid.columns.length!==this.columnModel.length&&(this.stackedHeader=!0),this.stackedHeader&&!(0,t.isNullOrUndefined)(this.detailTemplate)){this.trigger(Ye,{error:"Stacked header is not compatible with the detail template"})}return this.stackedHeader&&this.allowResizing&&!(0,t.isNullOrUndefined)(this.columns)&&this.updateColumnsWidth(this.columns),this.stackedHeader||(0,t.isNullOrUndefined)(this.columns)||(0,t.merge)(this.columns,this.columnModel),this[""+h]=void 0,this.columnModel},i.prototype.updateColumnsWidth=function(e){var i=this;e.forEach(function(e){if(!(0,t.isNullOrUndefined)(e)&&e.columns)i.updateColumnsWidth(e.columns);else if(!(0,t.isNullOrUndefined)(e)&&e.field){var r=i.grid.getColumnByField(e.field);(0,t.isNullOrUndefined)(r)||(e.width=r.width)}})},i.prototype.getContent=function(){return this.grid.getContent()},i.prototype.mergePersistTreeGridData=function(){this.grid.mergePersistGridData.apply(this)},i.prototype.mergeColumns=function(e,t){this.grid.mergeColumns.apply(this,[e,t])},i.prototype.setFrozenCount=function(){this.grid.setFrozenCount.apply(this)},i.prototype.splitFrozenCount=function(e){var t=this.frozenColumns>0?this.grid:this;this.grid.splitFrozenCount.apply(t,[e])},i.prototype.removeBorder=function(e){this.grid.removeBorder.apply(this.grid,[e])},i.prototype.frozenLeftBorderColumns=function(e){this.grid.frozenLeftBorderColumns.apply(this.grid,[e])},i.prototype.frozenRightBorderColumns=function(e){this.grid.frozenRightBorderColumns.apply(this.grid,[e])},i.prototype.isFrozenGrid=function(){var e=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze});return this.frozenColumns>0||this.frozenRows>0||this.getFrozenColumns()>0||e},i.prototype.updateTreeGridModel=function(){this.setProperties({filterSettings:(0,l.getObject)("properties",this.grid.filterSettings)},!0),this.setProperties({pageSettings:(0,l.getObject)("properties",this.grid.pageSettings)},!0),this.setProperties({searchSettings:(0,l.getObject)("properties",this.grid.searchSettings)},!0),this.setProperties({sortSettings:(0,l.getObject)("properties",this.grid.sortSettings)},!0)},i.prototype.hasPreAndPostMiddleware=function(e){return e&&"function"==typeof e.applyPreRequestMiddlewares&&"function"==typeof e.applyPostRequestMiddlewares},i.prototype.getContentTable=function(){return this.grid.getContentTable()},i.prototype.getDataRows=function(){for(var e=[],t=this.grid.getDataRows(),i=0,r=t.length;i<r;i++)t[parseInt(i.toString(),10)].classList.contains("e-summaryrow")||e.push(t[parseInt(i.toString(),10)]);return e},i.prototype.getCurrentViewRecords=function(){return this.grid.currentViewData.filter(function(e){return(0,t.isNullOrUndefined)(e.isSummaryRow)})},i.prototype.getBatchChanges=function(){return this.grid.editModule.getBatchChanges()},i.prototype.getHeaderContent=function(){return this.grid.getHeaderContent()},i.prototype.getHeaderTable=function(){return this.grid.getHeaderTable()},i.prototype.getRowByIndex=function(e){return this.grid.getRowByIndex(e)},i.prototype.getRowInfo=function(e){return this.grid.getRowInfo(e)},i.prototype.getUidByColumnField=function(e){return this.grid.getUidByColumnField(e)},i.prototype.getVisibleColumns=function(){return this.columnModel.filter(function(e){return e.visible})},i.prototype.showSpinner=function(){(0,Rt.showSpinner)(this.element)},i.prototype.hideSpinner=function(){(0,Rt.hideSpinner)(this.element)},i.prototype.refresh=function(){this.uniqueIDCollection={},this.convertTreeData(this.dataSource),tt(this)||(this.dataSource instanceof Ze.DataManager?this.grid.setProperties({dataSource:new Ze.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor,this.hasPreAndPostMiddleware(this.dataSource)?this.dataSource:void 0)},!0):this.grid.dataSource=this.flatData),this.grid.refresh()},i.prototype.getCheckedRecords=function(){return this.selectionModule.getCheckedrecords()},i.prototype.getVisibleRecords=function(){var e=[],t=this.getCurrentViewRecords();if(this.allowPaging)e=t;else for(var i=0;i<t.length;i++)e.push(t[parseInt(i.toString(),10)]),t[parseInt(i.toString(),10)].expanded||(i+=at(t[parseInt(i.toString(),10)]).length);return e},i.prototype.getCheckedRowIndexes=function(){return this.selectionModule.getCheckedRowIndexes()},i.prototype.selectCheckboxes=function(e){this.selectionModule.selectCheckboxes(e)},i.prototype.refreshColumns=function(e){(0,t.isNullOrUndefined)(e)||e?(this.grid.columns=this.getGridColumns(this.columns),this.getTreeColumn(),this.grid.refreshColumns()):this.grid.setProperties({columns:this.getGridColumns(this.columns)},!0)},i.prototype.getTreeColumn=function(){var e=this.columnModel[this.treeColumnIndex],i=this.getColumns(),r=(0,l.getObject)("field",e),n=i.findIndex(function(e){return(0,l.getObject)("field",e)===r});(0,t.isNullOrUndefined)(n)||this.setProperties({treeColumnIndex:n},!0)},i.prototype.refreshHeader=function(){this.grid.refreshHeader()},i.prototype.expandCollapseRequest=function(e){if("Batch"===this.editSettings.mode){if((this.getBatchChanges()[this.changedRecords].length||this.getBatchChanges()[this.deletedRecords].length||this.getBatchChanges()[this.addedRecords].length)&&this.editSettings.showConfirmDialog){var t=this.grid.editModule.dialogObj;return this.grid.editModule.showDialog("CancelEdit",t),void(this.targetElement=e)}}if(this.rowTemplate){var i=e.closest(".e-treerowcell").parentElement,r=this.getCurrentViewRecords()[i.rowIndex];e.classList.contains("e-treegridexpand")?this.collapseRow(i,r):this.expandRow(i,r)}else{var n=this.grid.getRowInfo(e);r=n.rowData;if(this.grid.isFrozenGrid()&&this.enableVirtualization&&!Object.keys(r).length){r=this.grid.contentModule.freezeRows.filter(function(e){return e.uid===n.row.getAttribute("data-uid")})[0].data}this.enableImmutableMode&&(r=this.getCurrentViewRecords()[n.rowIndex]),e.classList.contains("e-treegridexpand")?this.collapseRow(n.row,r):this.expandRow(n.row,r)}},i.prototype.expandRow=function(e,i,r,n){var o=this;this.isCollapseAll=!1;var a=this.parentData;if(this.enableVirtualization||(a=this.flatData.filter(function(e){return e.hasChildRecords})),i=this.getCollapseExpandRecords(e,i),!(0,t.isNullOrUndefined)(e)||!(0,t.isNullOrUndefined)(i))if(!(0,t.isNullOrUndefined)(e)&&e.cells&&e.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(e,!1),this.isExpandAll&&!et(this)){var s={data:a,row:e,cancel:!1},d=!1;this.grid.pagerModule&&!(0,t.isNullOrUndefined)(this.grid.pagerModule.pagerObj.pagerdropdownModule)&&(d=!!this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value),this.isExpandingEventTriggered?(!this.allowPaging||d&&"All"===this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value)&&!this.expandAllPrevent&&this.isExpandingEventTriggered&&this.expandRows(e,i,a):this.trigger(_,s,function(s){o.expandAllPrevent=s.cancel,s.cancel||(0,t.isNullOrUndefined)(i)||(s.expandAll&&o.expandCollapseAllChildren(i,"expand",r,n),o.expandRows(e,i,a))}),this.isExpandingEventTriggered=!0}else if(!this.isExpandAll||this.isExpandAll&&et(this)){s={data:i,row:e,cancel:!1};this.trigger(_,s,function(t){t.cancel||(t.expandAll&&o.expandCollapseAllChildren(i,"expand",r,n),o.expandRows(e,i,a))})}},i.prototype.expandRows=function(e,i,r){this.expandCollapse("expand",e,i);if((!et(this)||st(this))&&(!tt(this)||!(0,t.isNullOrUndefined)(i.Children))){var n={data:i,row:e};(0,t.isNullOrUndefined)(this.expandStateMapping)||this.updateExpandStateMapping(n.data,!0),this.isExpandAll&&!this.isExpandedEventTriggered?(this.isExpandedEventTriggered=!0,n={data:r,row:e},this.trigger(j,n)):!this.isExpandAll&&this.enableVirtualization&&this.selectionSettings.persistSelection&&!(0,t.isNullOrUndefined)(this.virtualScrollModule.prevSelectedRecord)?this.virtualScrollModule.prevSelectedRecord=[]:this.isExpandAll||this.trigger(j,n)}},i.prototype.expandCollapseAllChildren=function(e,i,r,n){if(((0,t.isNullOrUndefined)(r)||e[this.getPrimaryKeyFieldNames()[0]]===r)&&((0,t.isNullOrUndefined)(n)||n===e.level)){var o=at(e).filter(function(e){return e.hasChildRecords});o.unshift(e);for(var a=0;a<o.length;a++)this.expandCollapse(i,null,o[parseInt(a.toString(),10)])}},i.prototype.getCollapseExpandRecords=function(e,i){return this.allowPaging&&"All"===this.pageSettings.pageSizeMode&&this.isExpandAll&&(0,t.isNullOrUndefined)(i)&&!et(this)?i=this.flatData.filter(function(e){return e.hasChildRecords}):(0,t.isNullOrUndefined)(i)&&!(0,t.isNullOrUndefined)(e)&&(i=this.detailTemplate?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]:this.enableVirtualization&&(this.isCollapseAll||this.isExpandAll)?-1===e.rowIndex?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]:this.grid.getCurrentViewRecords()[e.rowIndex]:this.rowTemplate?this.grid.getCurrentViewRecords()[e.rowIndex]:this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]),i},i.prototype.collapseRow=function(e,i,r){var n=this;this.isExpandAll=!1;var o=this.parentData;if(this.enableVirtualization||(o=this.flatData.filter(function(e){return e.hasChildRecords})),i=this.getCollapseExpandRecords(e,i),!(0,t.isNullOrUndefined)(e)||!(0,t.isNullOrUndefined)(i))if(this.isCollapseAll&&!et(this)){var a={data:o,row:e,cancel:!1};this.isCollapsingEventTriggered?this.allowPaging||this.collapseAllPrevent||!this.isCollapsingEventTriggered||this.collapseRows(e,i,o):this.trigger(G,a,function(t){n.collapseAllPrevent=t.cancel,t.cancel||(t.collapseAll&&n.expandCollapseAllChildren(i,"collapse",r),n.collapseRows(e,i,o))}),this.isCollapsingEventTriggered=!0}else if(!this.isCollapseAll||this.isCollapseAll&&et(this)){a={data:i,row:e,cancel:!1};this.trigger(G,a,function(t){t.cancel||n.collapseRows(e,i,o)})}},i.prototype.collapseRows=function(e,i,r){this.expandCollapse("collapse",e,i);var n={data:i,row:e};et(this)||((0,t.isNullOrUndefined)(this.expandStateMapping)||this.updateExpandStateMapping(n.data,!1),this.isCollapseAll&&!this.isCollapsedEventTriggered?(this.isCollapsedEventTriggered=!0,n={data:r,row:e},this.trigger(H,n)):this.isCollapseAll||this.trigger(H,n),this.enableInfiniteScrolling&&this.grid.getContent().firstElementChild.scrollHeight-this.grid.getContent().firstElementChild.scrollTop<this.grid.getRowHeight()+ +this.height&&this.grid.getContent().firstElementChild.scrollBy(0,this.grid.getRowHeight()))},i.prototype.updateExpandStateMapping=function(e,t){var i=e;if(i.length)for(var r=0;r<i.length;r++)i[parseInt(r.toString(),10)][this.expandStateMapping]=t,zt({value:i[parseInt(r.toString(),10)],action:"edit"},this,this.isSelfReference,i[parseInt(r.toString(),10)].index,this.grid.selectedRowIndex,this.expandStateMapping);else e[""+this.expandStateMapping]=t,zt({value:e,action:"edit"},this,this.isSelfReference,e.index,this.grid.selectedRowIndex,this.expandStateMapping)},i.prototype.expandAtLevel=function(e){if((this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!et(this)){var t=this.grid.dataSource.filter(function(t){return t.hasChildRecords&&t.level===e&&(t.expanded=!0),t.hasChildRecords&&t.level===e});this.expandAction(t,null,e,!0)}else{t=this.getRecordDetails(e);var i=(0,l.getObject)("records",t);this.expandAction(i,null,e)}},i.prototype.expandByKey=function(e){this.expandCollapseActionByKey(e,"Expand")},i.prototype.expandAction=function(e,i,r,n){void 0===n&&(n=!1);for(var o=function(o){if(!(0,t.isNullOrUndefined)(e[parseInt(o.toString(),10)].parentItem)){var s=e[parseInt(o.toString(),10)].parentItem.uniqueID,d=a.flatData.filter(function(e){return e.uniqueID===s});et(a)&&(d=a.getCurrentViewRecords().filter(function(e){return e.uniqueID===s})),!1===d[0].expanded?(e.push(d[0]),d[0].expanded=!0):ot(a,d[0],a.parentData)||d[0].expanded&&void 0!==d[0].parentItem&&e.push(d[0])}n||a.expandRow(null,e[parseInt(o.toString(),10)],i,r)},a=this,s=0;s<e.length;s++)o(s);n&&this.expandRow(null,e,i,r)},i.prototype.getRecordDetails=function(e){var t=this.getRows().filter(function(t){return-1!==t.className.indexOf("level"+e)&&(t.querySelector(".e-treegridcollapse")||t.querySelector(".e-treegridexpand"))});return{records:this.getCurrentViewRecords().filter(function(t){return t.level===e&&t.hasChildRecords}),rows:t}},i.prototype.collapseAtLevel=function(e){if((this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!et(this)){var t=this.grid.dataSource.filter(function(t){return t.hasChildRecords&&t.level===e&&(t.expanded=!1),t.hasChildRecords&&t.level===e});this.collapseAction(t,null,!0)}else{var i=this.getRecordDetails(e),r=(0,l.getObject)("records",i);this.collapseAction(r)}},i.prototype.collapseByKey=function(e){this.expandCollapseActionByKey(e,"Collapse")},i.prototype.expandCollapseActionByKey=function(e,i){var r=this.getPrimaryKeyFieldNames()[0],n=et(this)?this.getCurrentViewRecords():this.grid.dataSource;if(!(0,t.isNullOrUndefined)(r)){var o=n.filter(function(t){return t[""+r].toString()===e.toString()});"Expand"===i?this.expandAction(o,e,null):this.collapseAction(o,e)}},i.prototype.collapseAction=function(e,t,i){if(void 0===i&&(i=!1),i)this.collapseRow(null,e);else for(var r=0;r<e.length;r++)this.collapseRow(null,e[parseInt(r.toString(),10)],t);if(!this.grid.contentModule.isDataSourceChanged&&this.enableVirtualization&&this.getRows()&&this.parentData.length===this.getRows().length){this.grid.contentModule.startIndex=-1,this.grid.contentModule.endIndex=-1}},i.prototype.expandAll=function(){if(0===this.getCurrentViewRecords().length){this.trigger(Ye,{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."})}if(this.isExpandedEventTriggered=!1,this.isExpandingEventTriggered=!1,"Batch"===this.editSettings.mode){var e=this.getBatchChanges?this.getBatchChanges():{},t=Array.isArray(e.changedRecords)?e.changedRecords:[],i=Array.isArray(e.deletedRecords)?e.deletedRecords:[],r=Array.isArray(e.addedRecords)?e.addedRecords:[];if((t.length>0||i.length>0||r.length>0)&&this.editSettings.showConfirmDialog){var n=this.grid.editModule.dialogObj;return void this.grid.editModule.showDialog("CancelEdit",n)}}this.expandCollapseAll("expand")},i.prototype.collapseAll=function(){if(0===this.getCurrentViewRecords().length){this.trigger(Ye,{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."})}if(this.isCollapsedEventTriggered=!1,this.isCollapsingEventTriggered=!1,"Batch"===this.editSettings.mode){var e=this.getBatchChanges?this.getBatchChanges():{},t=Array.isArray(e.changedRecords)?e.changedRecords:[],i=Array.isArray(e.deletedRecords)?e.deletedRecords:[],r=Array.isArray(e.addedRecords)?e.addedRecords:[];if((t.length>0||i.length>0||r.length>0)&&this.editSettings.showConfirmDialog){var n=this.grid.editModule.dialogObj;return void this.grid.editModule.showDialog("CancelEdit",n)}}this.expandCollapseAll("collapse")},i.prototype.expandCollapseAll=function(e){var i;if(!(i=this.rowTemplate?[].slice.call(this.grid.getContentTable().querySelectorAll("tr")).filter(function(t){return t.querySelector(".e-treegrid"+("expand"===e?"collapse":"expand"))}):this.getRows().filter(function(t){return t.querySelector(".e-treegrid"+("expand"===e?"collapse":"expand"))})).length&&this.getRows().length&&i.push(this.getRows()[0]),this.isExpandAll=!0,this.isCollapseAll=!0,(this.allowPaging&&("All"===this.pageSettings.pageSizeMode||"Root"===this.pageSettings.pageSizeMode)||this.enableVirtualization||this.enableInfiniteScrolling)&&!et(this)){if(this.flatData.filter(function(t){t.hasChildRecords&&(t.expanded="collapse"!==e)}),i.length)for(var r=0;r<i.length;r++)"collapse"===e?(0,t.isNullOrUndefined)(this.getCurrentViewRecords()[i[parseInt(r.toString(),10)].rowIndex])||this.collapseRow(i[parseInt(r.toString(),10)]):this.enableVirtualization?"true"!==i[0].getAttribute("aria-expanded")&&this.expandRow(i[0]):this.expandRow(i[parseInt(r.toString(),10)]);else if(this.allowPaging){var n=this.enableCollapseAll;this.setProperties({enableCollapseAll:!0},!0),this.grid.pagerModule.goToPage(1),this.setProperties({enableCollapseAll:n},!0)}}else for(r=0;r<i.length;r++)"collapse"===e?this.collapseRow(i[parseInt(r.toString(),10)]):this.expandRow(i[parseInt(r.toString(),10)]);this.isExpandAll=!1,this.isCollapseAll=!1},i.prototype.expandCollapse=function(e,i,r,n){var o,a=this,s={row:i,data:r,childData:[],requestType:e},d=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===r.uniqueID});(!et(this)&&"expand"===e&&this.isSelfReference&&tt(this)&&!d.length||"collapse"===e||this.isExpandAll&&!this.loadChildOnDemand&&!et(this)&&this.isSelfReference&&tt(this))&&this.updateChildOnDemand(s);var l,p=this.getRows();if(this.rowTemplate){var h=this.getContentTable().rows;p=[].slice.call(h)}if((0,t.isNullOrUndefined)(i)?(l=this.grid.currentViewData.indexOf(r),i=p[parseInt(l.toString(),10)]):l=+i.getAttribute("aria-rowindex")-1,(0,t.isNullOrUndefined)(i)||i.setAttribute("aria-expanded","expand"===e?"true":"false"),(!this.allowPaging||"All"!==this.pageSettings.pageSizeMode&&"Root"!==this.pageSettings.pageSizeMode)&&!this.enableVirtualization||et(this)||tt(this)){var c=void 0;if("expand"===e){if(c="e-childrow-visible",n||(r.expanded=!0,this.flatData.forEach(function(e){e.expanded=e.uniqueID===r.uniqueID&&e.expanded!==r.expanded?r.expanded:e.expanded}),this.uniqueIDCollection[r.uniqueID].expanded=r.expanded),(0,t.isNullOrUndefined)(i)||(o=i.getElementsByClassName("e-treegridcollapse")[0]),n&&!(0,t.isNullOrUndefined)(r[this.expandStateMapping])&&r[this.expandStateMapping]&&(0,t.isNullOrUndefined)(o)&&(o=i.getElementsByClassName("e-treegridexpand")[0]),(0,t.isNullOrUndefined)(o))return;o.classList.contains("e-treegridexpand")||(0,t.addClass)([o],"e-treegridexpand"),(0,t.removeClass)([o],"e-treegridcollapse")}else{if(c="e-childrow-hidden",n&&!tt(this)||(r.expanded=!1,this.flatData.forEach(function(e){e.expanded=e.uniqueID===r.uniqueID&&e.expanded!==r.expanded?r.expanded:e.expanded}),this.uniqueIDCollection[r.uniqueID].expanded=r.expanded),(0,t.isNullOrUndefined)(i)||(o=i.getElementsByClassName("e-treegridexpand")[0]),n&&!(0,t.isNullOrUndefined)(r[this.expandStateMapping])&&!r[this.expandStateMapping]&&(0,t.isNullOrUndefined)(o)&&(o=i.getElementsByClassName("e-treegridcollapse")[0]),(0,t.isNullOrUndefined)(o))return;o.classList.contains("e-treegridcollapse")||(0,t.addClass)([o],"e-treegridcollapse"),(0,t.removeClass)([o],"e-treegridexpand")}i.querySelectorAll(".e-treerowcell")[0].setAttribute("aria-expanded","expand"===e?"true":"false");var u=p.filter(function(e){return e.classList.contains("e-griddetailrowindex"+r.index+"level"+(r.level+1))});if(et(this)&&!st(this))this.remoteExpand(e,i,r);else{tt(this)&&!d.length&&"collapse"!==e||this.localExpand(e,i,r);var g=this.getVisibleRecords()[this.getVisibleRecords().length-1].index,f=this.getRowByIndex(g);this.grid.getContentTable().clientHeight<=this.grid.getContent().clientHeight&&!(0,t.isNullOrUndefined)(f)&&!f.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(f,!0)}if(tt(this)&&"expand"===e){var y=this.getCurrentViewRecords().filter(function(e){return ot(a,e,a.parentData)});this.dataResults.result=y}if(!(0,t.isNullOrUndefined)(o)&&o.closest(".e-treerowcell").classList.contains("e-cellselectionbackground")&&(o.closest(".e-treerowcell").classList.remove("e-cellselectionbackground"),o.closest(".e-treerowcell").removeAttribute("aria-selected")),this.isPixelHeight()&&!i.cells[0].classList.contains("e-lastrowcell"))for(var m=this.getRows(),S=(h=this.getContentTable().rows,(m=[].slice.call(h)).length-1);S>=0;S--)if(!ht(m[parseInt(S.toString(),10)])){var v=this.getContentTable().scrollHeight,w=this.getContent().clientHeight;this.lastRowBorder(m[parseInt(S.toString(),10)],v<=w);break}this.notify("rowExpandCollapse",{detailrows:u,action:c,record:r,row:i}),this.updateAltRow(p)}else this.notify(K,{action:e,row:i,record:r})},i.prototype.updateChildOnDemand=function(e){var i=this;if("collapse"===e.requestType&&tt(this)){for(var r=this.flatData.slice(),n=0;n<r.length;n++)r[parseInt(n.toString(),10)].parentUniqueID===e.data.uniqueID&&(r.splice(n,1),n-=1);this.dataResults.result=r}else{var o,a=new Ze.Deferred;this.query?(o=this.grid.getDataModule().getStateEventArgument(this.query)).action=e:o=e,e.childDataBind=a.resolve;var s=e.data;this.trigger(N,o),a.promise.then(function(){if(e.childData.length){tt(i)&&(i.flatData=i.dataResults.result),i.enableInfiniteScrolling&&tt(i)&&(i.flatData=i.infiniteScrollData);for(var r=i.flatData,n=0,o=0;o<r.length;o++)if(r[parseInt(o.toString(),10)].taskData===s.taskData){n=o;break}var a=(0,t.getValue)("result",i.dataSource),d=dt(e.childData),p=s[i.childMapping]&&s[i.childMapping].length>d.length?s[i.childMapping].length:d.length;for(o=0;o<p;o++)s[i.childMapping]&&a.filter(function(e,t){e[i.parentIdMapping]===s[i.idMapping]&&a.splice(t,1)}),d[parseInt(o.toString(),10)]?(d[parseInt(o.toString(),10)].level=s.level+1,d[parseInt(o.toString(),10)].index=Math.ceil(1e3*Math.random()),d[parseInt(o.toString(),10)].parentItem=(0,t.extend)({},s),d[parseInt(o.toString(),10)].taskData=(0,t.extend)({},d[parseInt(o.toString(),10)]),delete d[parseInt(o.toString(),10)].parentItem.childRecords,delete d[parseInt(o.toString(),10)].taskData.parentItem,d[parseInt(o.toString(),10)].parentUniqueID=s.uniqueID,d[parseInt(o.toString(),10)].uniqueID=(0,l.getUid)(i.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+d[parseInt(o.toString(),10)].uniqueID,d[parseInt(o.toString(),10)],i),(!(0,t.isNullOrUndefined)(d[parseInt(o.toString(),10)][i.childMapping])||d[parseInt(o.toString(),10)][i.hasChildMapping]&&tt(i))&&(d[parseInt(o.toString(),10)].hasChildRecords=!0),tt(i)&&s[i.childMapping]&&s[i.childMapping][parseInt(o.toString(),10)]?r.splice(n+1+o,0,d[parseInt(o.toString(),10)]):r.splice(n+1+o,s[i.childMapping]&&s[i.childMapping][parseInt(o.toString(),10)]?1:0,d[parseInt(o.toString(),10)])):r.splice(n+1+o,1);r[parseInt(n.toString(),10)][""+i.childMapping]=d,r[parseInt(n.toString(),10)].childRecords=d,r[parseInt(n.toString(),10)].expanded=!0,(0,t.setValue)("uniqueIDCollection."+r[parseInt(n.toString(),10)].uniqueID,r[parseInt(n.toString(),10)],i);for(var h=0;h<e.childData.length;h++)a.push(e.childData[parseInt(h.toString(),10)])}tt(i)&&!i.loadChildOnDemand&&"expand"===e.requestType&&(i.dataResults.expandRecord={},i.dataResults.expandRecord=e.data),i.isExpandRefresh=!0;var c=i.getContentTable().parentElement.scrollTop;i.grid.refresh(),i.enableInfiniteScrolling&&(i.getContentTable().parentElement.scrollTop=c),i.trigger(j,e)})}},i.prototype.remoteExpand=function(e,i,r){var n=this.getRows(),o=(0,t.getValue)("isCollapseAll",this)?"collapseAll":"refresh";if(this.grid.contentModule.requestType=o,this.rowTemplate){var a=this.getContentTable().rows;n=[].slice.call(a)}var s,d={data:r,row:i};if(s=n.filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))||e.querySelector(".e-gridrowindex"+r.index+"level0.e-summarycell")}),"expand"===e){this.notify(Q,{record:r,rows:s,parentRow:i});var l={row:i,data:r};s.length>0&&this.trigger(j,l)}else"collapse"===e&&this.enableVirtualization?this.dataModule.fetchRemoteChildData({action:e,record:d.data,rows:null,parentRow:d.row}):(this.collapseRemoteChild({record:r,rows:s}),this.trigger(H,d))},i.prototype.localExpand=function(e,i,r){var n,o,a,s=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===r.uniqueID});this.isPixelHeight()&&i.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(i,!1);var d=this.getRows();if(this.rowTemplate){var l=this.getContentTable().rows;d=[].slice.call(l)}var p="expand"===e?"e-childrow-visible":"e-childrow-hidden",h=this.getPrimaryKeyFieldNames()[0];if(this.enableImmutableMode&&!this.allowPaging){n=[];for(var c=0;c<s.length;c++){var u=this.grid.getRowIndexByPrimaryKey(s[parseInt(c.toString(),10)][""+h]);n.push(this.getRows()[parseInt(u.toString(),10)])}}else n=d.filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))});var g=this.grid.getFrozenLeftColumnsCount()>0||this.grid.getFrozenRightColumnsCount()>0;(this.frozenRows||this.frozenColumns||this.getFrozenColumns()||g)&&(o=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))})),g&&(a=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))}));var f=this.grid.getRowsObject(),y=this.grid.currentViewData,m=y.filter(function(e){return e.uniqueID===r.uniqueID}),S=y.indexOf(m[0]);(0,t.isNullOrUndefined)(f[parseInt(S.toString(),10)].visible)||!1===f[parseInt(S.toString(),10)].visible||(f[parseInt(S.toString(),10)].visible=!0),this.detailTemplate&&d.forEach(function(e){e.classList.contains("e-detailrow")&&"none"===e.style.display&&(e.style.display="")});var v=d.filter(function(e){return e.classList.contains("e-griddetailrowindex"+r.index+"level"+(r.level+1))});for(c=0;c<n.length;c++){if((0,t.isNullOrUndefined)(n[parseInt(c.toString(),10)])||this.toggleRowVisibility(n[parseInt(c.toString(),10)],p),!(0,t.isNullOrUndefined)(n[parseInt(c.toString(),10)])&&!this.allowPaging&&!(this.enableVirtualization||this.enableInfiniteScrolling||et(this)||tt(this))){(0,t.isNullOrUndefined)(f[n[parseInt(c.toString(),10)].rowIndex])||(f[n[parseInt(c.toString(),10)].rowIndex].visible="e-childrow-hidden"!==p);var w=y.filter(function(e){return e.uniqueID===m[0].parentUniqueID});!(0,t.isNullOrUndefined)(w[0])&&d[y.indexOf(w[0])].getElementsByClassName("e-treegridcollapse").length&&(f[parseInt(S.toString(),10)].visible=!1)}(0,t.isNullOrUndefined)(o)||this.toggleRowVisibility(o[parseInt(c.toString(),10)],p),(0,t.isNullOrUndefined)(a)||this.toggleRowVisibility(a[parseInt(c.toString(),10)],p),this.notify("childRowExpand",{row:n[parseInt(c.toString(),10)]}),!(0,t.isNullOrUndefined)(s)&&!(0,t.isNullOrUndefined)(s[parseInt(c.toString(),10)].childRecords)&&s[parseInt(c.toString(),10)].childRecords.length>0&&("expand"!==e||(0,t.isNullOrUndefined)(s[parseInt(c.toString(),10)].expanded)||s[parseInt(c.toString(),10)].expanded)&&(this.expandCollapse(e,n[parseInt(c.toString(),10)],s[parseInt(c.toString(),10)],!0),this.frozenColumns<=this.treeColumnIndex&&!(0,t.isNullOrUndefined)(o)&&this.expandCollapse(e,o[parseInt(c.toString(),10)],s[parseInt(c.toString(),10)],!0))}for(c=0;c<v.length;c++)(0,t.isNullOrUndefined)(v[parseInt(c.toString(),10)])||this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||et(this)||tt(this)||(f[v[parseInt(c.toString(),10)].rowIndex].visible="e-childrow-hidden"!==p,this.toggleRowVisibility(v[parseInt(c.toString(),10)],p));this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||et(this)||tt(this)||this.grid.notify("refresh-Expand-and-Collapse",{rows:this.grid.getRowsObject()})},i.prototype.toggleRowVisibility=function(e,t){e&&(e.classList.remove("e-childrow-hidden","e-childrow-visible","e-hide"),e.classList.add(t))},i.prototype.updateAltRow=function(e){if(this.enableAltRow&&!this.rowTemplate)for(var i=0,r=0;e&&r<e.length;r++){var n=e[parseInt(r.toString(),10)];n.classList.contains("e-childrow-hidden")||(n.classList.contains("e-altrow")&&(0,t.removeClass)([n],"e-altrow"),i%2==0||n.classList.contains("e-summaryrow")||n.classList.contains("e-detailrow")||(0,t.addClass)([n],"e-altrow"),n.classList.contains("e-summaryrow")||n.classList.contains("e-detailrow")||i++)}},i.prototype.treeColumnRowTemplate=function(){var e=this.getContentTable().rows;e=[].slice.call(e);for(var t=this.grid.getRowsObject(),i=0;i<e.length;i++){var r=this.grid.getContentTable().rows[parseInt(i.toString(),10)].cells[this.treeColumnIndex],n=e[parseInt(i.toString(),10)],o={data:0!==t.length?t[parseInt(i.toString(),10)].data:new Object,row:n,cell:r,column:this.getColumns()[this.treeColumnIndex]};this.renderModule.cellRender(o)}},i.prototype.collapseRemoteChild=function(e,i){(0,t.isNullOrUndefined)(i)||i||!this.loadChildOnDemand||(e.record.expanded=!1);var r,n,o=e.rows,a=[],s=[],d=this.getFrozenLeftColumnsCount()>0||this.getFrozenRightColumnsCount()>0;d&&(a=this.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))}),s=this.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))}));for(var l=0;l<o.length;l++){this.toggleRowVisibility(o[parseInt(l.toString(),10)],"e-childrow-hidden"),r=o[parseInt(l.toString(),10)];var p=o[parseInt(l.toString(),10)].querySelector(".e-detailrowexpand");if((0,t.isNullOrUndefined)(p)||this.grid.detailRowModule.collapse(p),d&&(this.toggleRowVisibility(a[parseInt(l.toString(),10)],"e-childrow-hidden"),this.toggleRowVisibility(s[parseInt(l.toString(),10)],"e-childrow-hidden"),o[parseInt(l.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")||(a[parseInt(l.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")?r=a[parseInt(l.toString(),10)]:s[parseInt(l.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")&&(r=s[parseInt(l.toString(),10)]))),r.querySelector(".e-treecolumn-container .e-treegridexpand")){var h=r.querySelector(".e-treecolumn-container .e-treegridexpand");n=this.rowTemplate?this.grid.getCurrentViewRecords()[o[parseInt(l.toString(),10)].rowIndex]:this.grid.getRowObjectFromUID(o[parseInt(l.toString(),10)].getAttribute("data-Uid")).data,!(0,t.isNullOrUndefined)(h)&&n.expanded&&((0,t.removeClass)([h],"e-treegridexpand"),(0,t.addClass)([h],"e-treegridcollapse"));for(var c=[],u=this.getRows(),g=0;g<u.length;g++)u[parseInt(g.toString(),10)].querySelector(".e-gridrowindex"+n.index+"level"+(n.level+1))&&c.push(u[parseInt(g.toString(),10)]);c.length&&n.expanded&&this.collapseRemoteChild({record:n,rows:c},!1)}}this.grid.pageSettings.totalRecordsCount-=o.length},i.prototype.sanitize=function(e){return this.enableHtmlSanitizer&&"string"==typeof e?t.SanitizeHtmlHelper.sanitize(e):e},i.prototype.addListener=function(){this.on("updateResults",this.updateResultModel,this),this.grid.on("initial-end",this.afterGridRender,this),this.grid.on("partial-filter-update",this.partialFilterUpdate,this)},i.prototype.updateResultModel=function(e){this.dataResults=e},i.prototype.removeListener=function(){this.isDestroyed||(this.off("updateResults",this.updateResultModel),this.grid.off("initial-end",this.afterGridRender),this.grid.off("last-rowcell-border-updated",this.lastRowCellBorderUpdated),this.grid.off("partial-filter-update",this.partialFilterUpdate))},i.prototype.partialFilterUpdate=function(e){var t=e.gridFiltered;this.notify("updateFilterRecs",{data:t})},i.prototype.filterByColumn=function(e,t,i,r,n,o,a,s){this.grid.filterByColumn(e,t,i,r,n,o,a,s)},i.prototype.clearFiltering=function(){this.grid.clearFiltering()},i.prototype.removeFilteredColsByField=function(e,t){this.grid.removeFilteredColsByField(e,t)},i.prototype.selectRow=function(e,t){this.grid.selectRow(e,t)},i.prototype.selectRows=function(e){this.grid.selectRows(e)},i.prototype.clearSelection=function(){(0,t.isNullOrUndefined)(this.grid.selectionModule)||(this.grid.selectionModule.actualTarget=null),this.grid.clearSelection()},i.prototype.copy=function(e){this.clipboardModule.copy(e)},i.prototype.paste=function(e,t,i){this.clipboardModule.paste(e,t,i)},i.prototype.selectCell=function(e,t){this.grid.selectCell(e,t)},i.prototype.getSelectedRows=function(){return this.grid.getSelectedRows()},i.prototype.getMovableCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},i.prototype.getMovableDataRows=function(){return this.grid.getDataRows()},i.prototype.getMovableRowByIndex=function(e){return this.grid.getRowByIndex(e)},i.prototype.getMovableRows=function(){return this.grid.getRows()},i.prototype.getFrozenRightRowByIndex=function(e){return this.grid.getRowByIndex(e)},i.prototype.getFrozenRightRows=function(){return this.grid.getRows()},i.prototype.getFrozenRightDataRows=function(){return this.grid.getDataRows()},i.prototype.getFrozenRightCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},i.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},i.prototype.getFrozenRightColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},i.prototype.getMovableColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},i.prototype.getMovableColumnsCount=function(){return this.grid.getMovableColumnsCount()},i.prototype.getFrozenLeftColumnsCount=function(){return this.grid.getFrozenLeftColumnsCount()},i.prototype.getFrozenRightColumnsCount=function(){return this.grid.getFrozenRightColumnsCount()},i.prototype.getFrozenLeftColumns=function(){return this.updateColumnModel(this.grid.getFrozenLeftColumns()),this.columnModel},i.prototype.getFrozenRightColumns=function(){return this.updateColumnModel(this.grid.getFrozenRightColumns()),this.columnModel},i.prototype.getVisibleMovableCount=function(){return this.grid.getVisibleMovableCount()},i.prototype.getVisibleFrozenRightCount=function(){return this.grid.getVisibleFrozenRightCount()},i.prototype.getVisibleFrozenLeftCount=function(){return this.grid.getVisibleFrozenLeftCount()},i.prototype.getMovableColumns=function(){return this.updateColumnModel(this.grid.getMovableColumns()),this.columnModel},i.prototype.getFrozenColumns=function(){return this.getFrozenCount(!(0,t.isNullOrUndefined)(this.columns)&&this.columns,0)+this.frozenColumns},i.prototype.getFrozenCount=function(e,t){for(var i=0,r=e.length;i<r;i++)e[parseInt(i.toString(),10)].columns?t=this.getFrozenCount(e[parseInt(i.toString(),10)].columns,t):e[parseInt(i.toString(),10)].isFrozen&&t++;return t},i.prototype.getSelectedRowIndexes=function(){return this.grid.getSelectedRowIndexes()},i.prototype.getSelectedRowCellIndexes=function(){return this.grid.getSelectedRowCellIndexes()},i.prototype.getSelectedRecords=function(){return this.grid.getSelectedRecords()},i.prototype.getDataModule=function(){return{baseModule:this.grid.getDataModule(),treeModule:this.dataModule}},i.prototype.reorderRows=function(e,i,r){(0,t.isNullOrUndefined)(this.rowDragAndDropModule)||this.rowDragAndDropModule.reorderRows(e,i,r)},i.prototype.indent=function(e){(0,t.isNullOrUndefined)(this.rowDragAndDropModule)||this.rowDragAndDropModule[this.indentOutdentAction](e,"indent")},i.prototype.outdent=function(e){(0,t.isNullOrUndefined)(this.rowDragAndDropModule)||this.rowDragAndDropModule[this.indentOutdentAction](e,"outdent")},Yt([(0,t.Property)(0)],i.prototype,"frozenRows",void 0),Yt([(0,t.Property)(0)],i.prototype,"frozenColumns",void 0),Yt([(0,t.Property)("Ellipsis")],i.prototype,"clipMode",void 0),Yt([(0,t.Property)([])],i.prototype,"columns",void 0),Yt([(0,t.Property)(null)],i.prototype,"childMapping",void 0),Yt([(0,t.Property)(null)],i.prototype,"hasChildMapping",void 0),Yt([(0,t.Property)(0)],i.prototype,"treeColumnIndex",void 0),Yt([(0,t.Property)(null)],i.prototype,"idMapping",void 0),Yt([(0,t.Property)(null)],i.prototype,"parentIdMapping",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableCollapseAll",void 0),Yt([(0,t.Property)(null)],i.prototype,"expandStateMapping",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowRowDragAndDrop",void 0),Yt([(0,t.Property)([])],i.prototype,"dataSource",void 0),Yt([(0,t.Property)()],i.prototype,"query",void 0),Yt([(0,t.Property)()],i.prototype,"cloneQuery",void 0),Yt([(0,t.Property)("AllPages")],i.prototype,"printMode",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowPaging",void 0),Yt([(0,t.Property)(!0)],i.prototype,"loadChildOnDemand",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowTextWrap",void 0),Yt([(0,t.Complex)({},v)],i.prototype,"textWrapSettings",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowReordering",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowResizing",void 0),Yt([(0,t.Property)(!1)],i.prototype,"autoCheckHierarchy",void 0),Yt([(0,t.Complex)({},Mt)],i.prototype,"pageSettings",void 0),Yt([(0,t.Complex)({},l.RowDropSettings)],i.prototype,"rowDropSettings",void 0),Yt([(0,t.Property)("USD")],i.prototype,"currencyCode",void 0),Yt([(0,t.Property)()],i.prototype,"pagerTemplate",void 0),Yt([(0,t.Property)(!1)],i.prototype,"showColumnMenu",void 0),Yt([(0,t.Property)(!1)],i.prototype,"showColumnChooser",void 0),Yt([(0,t.Complex)({},Kt)],i.prototype,"columnChooserSettings",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowSorting",void 0),Yt([(0,t.Property)(!0)],i.prototype,"allowMultiSorting",void 0),Yt([(0,t.Complex)({},Bt)],i.prototype,"sortSettings",void 0),Yt([(0,t.Collection)([],Et)],i.prototype,"aggregates",void 0),Yt([(0,t.Complex)({},qt)],i.prototype,"editSettings",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowFiltering",void 0),Yt([(0,t.Property)()],i.prototype,"detailTemplate",void 0),Yt([(0,t.Complex)({},y)],i.prototype,"filterSettings",void 0),Yt([(0,t.Complex)({},St)],i.prototype,"searchSettings",void 0),Yt([(0,t.Property)()],i.prototype,"toolbar",void 0),Yt([(0,t.Property)()],i.prototype,"toolbarTemplate",void 0),Yt([(0,t.Property)("Default")],i.prototype,"gridLines",void 0),Yt([(0,t.Property)()],i.prototype,"contextMenuItems",void 0),Yt([(0,t.Property)()],i.prototype,"columnMenuItems",void 0),Yt([(0,t.Property)()],i.prototype,"rowTemplate",void 0),Yt([(0,t.Property)("Parent")],i.prototype,"copyHierarchyMode",void 0),Yt([(0,t.Property)(null)],i.prototype,"rowHeight",void 0),Yt([(0,t.Property)(!0)],i.prototype,"enableAltRow",void 0),Yt([(0,t.Property)(!0)],i.prototype,"allowKeyboard",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableHover",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableAutoFill",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableAdaptiveUI",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableImmutableMode",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableStickyHeader",void 0),Yt([(0,t.Property)()],i.prototype,"emptyRecordTemplate",void 0),Yt([(0,t.Property)("auto")],i.prototype,"height",void 0),Yt([(0,t.Property)("auto")],i.prototype,"width",void 0),Yt([(0,t.Complex)({},c)],i.prototype,"loadingIndicator",void 0),Yt([(0,t.Property)(!0)],i.prototype,"enableVirtualMaskRow",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableVirtualization",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableColumnVirtualization",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableHtmlSanitizer",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableInfiniteScrolling",void 0),Yt([(0,t.Complex)({},Ht)],i.prototype,"infiniteScrollSettings",void 0),Yt([(0,t.Property)("All")],i.prototype,"columnQueryMode",void 0),Yt([(0,t.Property)(!0)],i.prototype,"allowSelection",void 0),Yt([(0,t.Property)(-1)],i.prototype,"selectedRowIndex",void 0),Yt([(0,t.Property)(null)],i.prototype,"isRowSelectable",void 0),Yt([(0,t.Complex)({},It)],i.prototype,"selectionSettings",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowExcelExport",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowPdfExport",void 0),Yt([(0,t.Event)()],i.prototype,"created",void 0),Yt([(0,t.Event)()],i.prototype,"load",void 0),Yt([(0,t.Event)()],i.prototype,"expanding",void 0),Yt([(0,t.Event)()],i.prototype,"expanded",void 0),Yt([(0,t.Event)()],i.prototype,"collapsing",void 0),Yt([(0,t.Event)()],i.prototype,"collapsed",void 0),Yt([(0,t.Event)()],i.prototype,"cellSave",void 0),Yt([(0,t.Event)()],i.prototype,"cellSaved",void 0),Yt([(0,t.Event)()],i.prototype,"actionBegin",void 0),Yt([(0,t.Event)()],i.prototype,"actionComplete",void 0),Yt([(0,t.Event)()],i.prototype,"beginEdit",void 0),Yt([(0,t.Event)()],i.prototype,"batchAdd",void 0),Yt([(0,t.Event)()],i.prototype,"batchDelete",void 0),Yt([(0,t.Event)()],i.prototype,"batchCancel",void 0),Yt([(0,t.Event)()],i.prototype,"beforeBatchAdd",void 0),Yt([(0,t.Event)()],i.prototype,"beforeBatchDelete",void 0),Yt([(0,t.Event)()],i.prototype,"beforeBatchSave",void 0),Yt([(0,t.Event)()],i.prototype,"cellEdit",void 0),Yt([(0,t.Event)()],i.prototype,"actionFailure",void 0),Yt([(0,t.Event)()],i.prototype,"dataBound",void 0),Yt([(0,t.Event)()],i.prototype,"dataSourceChanged",void 0),Yt([(0,t.Event)()],i.prototype,"dataStateChange",void 0),Yt([(0,t.Event)()],i.prototype,"recordDoubleClick",void 0),Yt([(0,t.Event)()],i.prototype,"rowDataBound",void 0),Yt([(0,t.Event)()],i.prototype,"detailDataBound",void 0),Yt([(0,t.Event)()],i.prototype,"queryCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"rowSelecting",void 0),Yt([(0,t.Event)()],i.prototype,"rowSelected",void 0),Yt([(0,t.Event)()],i.prototype,"rowDeselecting",void 0),Yt([(0,t.Event)()],i.prototype,"rowDeselected",void 0),Yt([(0,t.Event)()],i.prototype,"headerCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"cellSelecting",void 0),Yt([(0,t.Event)()],i.prototype,"columnMenuOpen",void 0),Yt([(0,t.Event)()],i.prototype,"columnMenuClick",void 0),Yt([(0,t.Event)()],i.prototype,"cellSelected",void 0),Yt([(0,t.Event)()],i.prototype,"cellDeselecting",void 0),Yt([(0,t.Event)()],i.prototype,"cellDeselected",void 0),Yt([(0,t.Event)()],i.prototype,"resizeStart",void 0),Yt([(0,t.Event)()],i.prototype,"resizing",void 0),Yt([(0,t.Event)()],i.prototype,"resizeStop",void 0),Yt([(0,t.Event)()],i.prototype,"columnDragStart",void 0),Yt([(0,t.Event)()],i.prototype,"columnDrag",void 0),Yt([(0,t.Event)()],i.prototype,"columnDrop",void 0),Yt([(0,t.Event)()],i.prototype,"checkboxChange",void 0),Yt([(0,t.Event)()],i.prototype,"printComplete",void 0),Yt([(0,t.Event)()],i.prototype,"beforePrint",void 0),Yt([(0,t.Event)()],i.prototype,"toolbarClick",void 0),Yt([(0,t.Event)()],i.prototype,"beforeDataBound",void 0),Yt([(0,t.Event)()],i.prototype,"contextMenuOpen",void 0),Yt([(0,t.Event)()],i.prototype,"contextMenuClick",void 0),Yt([(0,t.Event)()],i.prototype,"beforeCopy",void 0),Yt([(0,t.Event)()],i.prototype,"beforePaste",void 0),Yt([(0,t.Event)()],i.prototype,"rowDrag",void 0),Yt([(0,t.Event)()],i.prototype,"rowDragStart",void 0),Yt([(0,t.Event)()],i.prototype,"rowDragStartHelper",void 0),Yt([(0,t.Event)()],i.prototype,"rowDrop",void 0),Yt([(0,t.Event)()],i.prototype,"pdfQueryCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"pdfHeaderQueryCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"excelQueryCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"pdfAggregateQueryCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"excelAggregateQueryCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"excelHeaderQueryCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"beforeExcelExport",void 0),Yt([(0,t.Event)()],i.prototype,"excelExportComplete",void 0),Yt([(0,t.Event)()],i.prototype,"beforePdfExport",void 0),Yt([(0,t.Event)()],i.prototype,"pdfExportComplete",void 0),i=r=Yt([t.NotifyPropertyChanges],i)}(t.Component),Xt=function(){function e(e){l.Grid.Inject(l.Reorder),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"reorder"},e.prototype.addEventListener=function(){this.parent.on("getColumnIndex",this.updateTreeColumn,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("getColumnIndex",this.updateTreeColumn)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.updateTreeColumn=function(){this.parent.getTreeColumn()},e}(),$t=function(){function e(e){l.Grid.Inject(l.Resize),this.parent=e}return e.prototype.autoFitColumns=function(e){this.parent.grid.autoFitColumns(e)},e.prototype.getModuleName=function(){return"resize"},e.prototype.destroy=function(){this.parent.isDestroyed||this.parent.grid.resizeModule.destroy()},e}(),Zt=function(){function e(e){this.canDrop=!0,this.isDraggedWithChild=!1,this.modifiedRecords="modifiedRecords",this.selectedRecords="selectedRecords",this.selectedRows="selectedRows",this.hasDropItem=!0,this.isaddtoBottom=!1,l.Grid.Inject(l.RowDD),this.parent=e,this.addEventListener()}return e.prototype.getChildrecordsByParentID=function(e){return(this.parent.dataSource instanceof Ze.DataManager&&st(this.parent)?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource).filter(function(t){return t.uniqueID===e})},e.prototype.addEventListener=function(){this.parent.on(Ue,this.Rowdraging,this),this.parent.on(qe,this.rowDropped,this),this.parent.on(Ee,this.rowsAdded,this),this.parent.on(Ne,this.rowsRemoved,this)},e.prototype.reorderRows=function(e,i,r){var n=this.parent;if(e[0]!==i&&-1!==["above","below","child"].indexOf(r)){var o="action";if(e[0]!==i&&-1!==["above","below","child"].indexOf(r)){"above"===r&&(this.dropPosition="topSegment"),"below"===r&&(this.dropPosition="bottomSegment"),"child"===r&&(this.dropPosition="middleSegment"),this.parent.dropPosition=this.dropPosition;for(var a=[],s=0;s<e.length;s++){var d=this.parent.getRowByIndex(e[parseInt(s.toString(),10)]).rowIndex;a[parseInt(s.toString(),10)]=this.parent.getCurrentViewRecords()[parseInt(d.toString(),10)]}var l={data:a,dropIndex:i};if(tt(this.parent)||this.dropRows(l,!0),n.isLocalData&&(n.flatData=this.orderToIndex(n.flatData)),"outdenting"===this.parent[""+o]&&((0,t.isNullOrUndefined)(a[0].parentItem)||(a[0].level=a[0].parentItem.level+1)),this.parent.grid.refresh(),this.parent.enableImmutableMode&&"middleSegment"===this.dropPosition){d=this.parent.allowRowDragAndDrop?this.parent.treeColumnIndex+1:"indenting"===this.parent[""+o]?this.parent.treeColumnIndex:void 0;var p=this.parent.getRows()[e[0]],h=l.data[0],c=[];(f=[]).push(h),c.push(p);var u=pt(this.parent,l.data[0].parentUniqueID),g=this.parent.getRows()[parseInt(i.toString(),10)];f.push(u),c.push(g),this.updateRowAndCellElements(f,c,d)}if(this.parent.enableImmutableMode&&"outdenting"===this.parent[""+o]){d=this.parent.allowRowDragAndDrop?this.parent.treeColumnIndex+1:"outdenting"===this.parent[""+o]?this.parent.treeColumnIndex:void 0;var f,y=l.data[0];p=this.parent.getRows()[e[0]],c=[];(f=[]).push(y),c.push(p),this.updateRowAndCellElements(f,c,d)}}}},e.prototype.updateRowAndCellElements=function(e,t,i){for(var r=0;r<e.length;r++)this.parent.renderModule.cellRender({data:e[parseInt(r.toString(),10)],cell:t[parseInt(r.toString(),10)].cells[parseInt(i.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),"indenting"!==this.parent.action&&"outdenting"!==this.parent.action||this.parent.renderModule.RowModifier({data:e[parseInt(r.toString(),10)],row:t[parseInt(r.toString(),10)]})},e.prototype.indentOutdentAction=function(e,i){var r=this.parent,n="action",o="dropIndex",a=-1;if(!(0,t.isNullOrUndefined)(e)||-1!==this.parent.selectedRowIndex){this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?a=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(a=this.parent.selectedRowIndex),this.selectedItem=(0,t.isNullOrUndefined)(e)?r.getCurrentViewRecords()[parseInt(a.toString(),10)]:e;var s=this.parent.getPrimaryKeyFieldNames()[0],d=this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[""+s]);if(this.selectedRow=this.parent[this.selectedRows]=-1!==a?this.parent.getSelectedRows()[0]:this.parent.grid.getRowByIndex(d),this.selectedRecord=this.parent[this.selectedRecords]=-1!==a?r.getCurrentViewRecords()[parseInt(a.toString(),10)]:this.selectedItem,"indent"===i){var l=r.getCurrentViewRecords()[this.selectedRow.rowIndex-1],p=void 0;if(0===this.selectedRow.rowIndex||-1===this.selectedRow.rowIndex||r.getCurrentViewRecords()[this.selectedRow.rowIndex].level-l.level===1)return;if(l.level>this.selectedRecord.level)for(var h=0;h<r.getCurrentViewRecords().length;h++)r.getCurrentViewRecords()[parseInt(h.toString(),10)].taskData===l.parentItem.taskData&&(p=h,r.enableVirtualization&&(p=parseInt(r.getRows()[parseInt(h.toString(),10)].getAttribute("aria-rowindex"),10)-1));else p=this.selectedRow.rowIndex-1;!this.parent.enableVirtualization||!this.selectedRecord||l.level>this.selectedRecord.level||(p=parseInt(this.selectedRow.getAttribute("aria-rowindex"),10)-2),r[""+n]="indenting",r[""+o]=p,this.eventTrigger("indenting",p)}else if("outdent"===i){var c=-1===this.selectedRow.rowIndex||0===this.selectedRow.rowIndex,u=0===r.getCurrentViewRecords()[this.selectedRow.rowIndex].level;if(c||u)return;var g=this.selectedRecord.parentItem;p=r.getCurrentViewRecords().findIndex(function(e){return e.uniqueID===g.uniqueID});if(-1===p)return;if(this.parent.enableVirtualization&&this.selectedRecord){var f=this.parent.getRows()[parseInt(p.toString(),10)].getAttribute("aria-rowindex");p=parseInt(f,10)-1}r[""+n]="outdenting",r[""+o]=p,this.eventTrigger("outdenting",p)}}},e.prototype.eventTrigger=function(e,t){var i=this,r={action:e,cancel:!1,data:[this.parent[this.selectedRecords]],row:this.parent[this.selectedRows]};this.parent.trigger(E,r,function(e){e.cancel||("indenting"===e.action?i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("aria-rowindex"),10)-1],t,"child"):i.reorderRows([i.selectedRow.rowIndex],t,"child"):"outdenting"===e.action&&(i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("aria-rowindex"),10)-1],t,"below"):i.reorderRows([i.selectedRow.rowIndex],t,"below")))})},e.prototype.orderToIndex=function(e){for(var i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].index=i,!(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)].parentItem)){var r=(0,t.getValue)("uniqueIDCollection."+e[parseInt(i.toString(),10)].parentUniqueID,this.parent);e[parseInt(i.toString(),10)].parentItem.index=r.index}return e},e.prototype.rowsAdded=function(e){for(var i,r=e.records,n=e.records.length-1;n>-1;n--)if((i=r[parseInt(n.toString(),10)]).parentUniqueID){var o=r.filter(function(e){return e.uniqueID===i.parentUniqueID});if(o.length){var a=o[0].childRecords.indexOf(i),s=o[0];-1!==a&&((0,t.isNullOrUndefined)(this.parent.idMapping)&&(s.childRecords.splice(a,1),s.childRecords.length||(s.hasChildRecords=!1,s.hasFilteredChildRecords=!1)),this.isDraggedWithChild=!0)}}if((0,t.isNullOrUndefined)(this.parent.dataSource)||!this.parent.dataSource.length){var d,l=this.parent,p=e.records;for(n=e.records.length-1;n>-1;n--){d=p[parseInt(n.toString(),10)],!n&&d.hasChildRecords&&(d.taskData[this.parent.parentIdMapping]=null);if((0,t.isNullOrUndefined)(l.parentIdMapping)||(l.childMapping=null),(0,t.isNullOrUndefined)(d.taskData)||(0,t.isNullOrUndefined)(l.childMapping)||Object.prototype.hasOwnProperty.call(d.taskData,l.childMapping)||(d.taskData[l.childMapping]=[]),!(0,t.isNullOrUndefined)(d[l.childMapping])&&Object.prototype.hasOwnProperty.call(d,l.childMapping)&&d[l.childMapping].length&&!this.isDraggedWithChild&&!(0,t.isNullOrUndefined)(l.parentIdMapping))for(var h=d[l.childMapping],c=0;c<h.length;c++)-1===p.indexOf(h[parseInt(c.toString(),10)])&&(p.splice(c,0,h[parseInt(c.toString(),10)]),h[parseInt(c.toString(),10)].taskData=(0,t.extend)({},h[parseInt(c.toString(),10)]),n+=1);Object.prototype.hasOwnProperty.call(d,l.parentIdMapping)&&null!==d[l.parentIdMapping]&&!this.isDraggedWithChild&&(d.taskData[l.parentIdMapping]=null,delete d.parentItem,delete d.parentUniqueID),(0,t.isNullOrUndefined)(l.dataSource)&&(l.dataSource=[]),l.dataSource.splice(0,0,d.taskData)}l.setProperties({dataSource:l.dataSource},!1)}else{for(n=0;n<r.length;n++)(0,t.setValue)("uniqueIDCollection."+r[parseInt(n.toString(),10)].uniqueID,r[parseInt(n.toString(),10)],this.parent);var u={data:e.records,dropIndex:e.toIndex};this.parent.dataSource instanceof Ze.DataManager?(this.treeGridData=this.parent.dataSource.dataSource.json,this.treeData=this.parent.dataSource.dataSource.json):(this.treeGridData=this.parent.grid.dataSource,this.treeData=this.parent.dataSource),(0,t.isNullOrUndefined)(this.dropPosition)&&(this.dropPosition="bottomSegment",u.dropIndex=this.parent.getCurrentViewRecords().length>1?this.parent.getCurrentViewRecords().length-1:u.dropIndex,u.data=u.data.map(function(e){return e.hasChildRecords&&(0,t.isNullOrUndefined)(e.parentItem)?(e.level=0,e):(delete e.parentItem,delete e.parentUniqueID,e.level=0,e)})),this.dropRows(u)}},e.prototype.rowsRemoved=function(e){for(var t=0;t<e.records.length;t++)this.draggedRecord=e.records[parseInt(t.toString(),10)],(this.draggedRecord.hasChildRecords||this.draggedRecord.parentItem&&-1!==this.parent.grid.dataSource.indexOf(this.getChildrecordsByParentID(this.draggedRecord.parentUniqueID)[0])||0===this.draggedRecord.level)&&this.deleteDragRow()},e.prototype.refreshGridDataSource=function(){var e,i,r=this.draggedRecord,n=this.droppedRecord,o=this.parent;if(!(e=this.parent.dataSource instanceof Ze.DataManager&&st(this.parent)?o.dataSource.dataSource.json:o.dataSource)||(0,t.isNullOrUndefined)(n)||n.parentItem||(0,t.isNullOrUndefined)(n.taskData)){if(!this.parent.parentIdMapping&&!(0,t.isNullOrUndefined)(n)&&n.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition)){var a=this.getChildrecordsByParentID(n.parentUniqueID)[0].childRecords;for(d=0;d<a.length;d++)n.parentItem.taskData[this.parent.childMapping][parseInt(d.toString(),10)]=a[parseInt(d.toString(),10)].taskData}}else{for(var s=Object.keys(e),d=0;d<s.length;d++)if(e[parseInt(d.toString(),10)][this.parent.childMapping])e[parseInt(d.toString(),10)][this.parent.childMapping]===n.taskData[this.parent.childMapping]&&(i=d);else{var l=this.parent.getPrimaryKeyFieldNames()[0];e[parseInt(d.toString(),10)][""+l]===n.taskData[""+l]&&(i=d)}if(!this.parent.idMapping){var p="topSegment"===this.dropPosition?0:1;"topSegment"!==this.dropPosition&&"bottomSegment"!==this.dropPosition||e.splice(i+p,0,r.taskData)}}this.parent.parentIdMapping&&(r.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(r[this.parent.parentIdMapping]=n[this.parent.parentIdMapping],r.taskData[this.parent.parentIdMapping]=n[this.parent.parentIdMapping]):(r[this.parent.parentIdMapping]=n[this.parent.idMapping],r.taskData[this.parent.parentIdMapping]=n[this.parent.idMapping]):(r.taskData[this.parent.parentIdMapping]=null,r[this.parent.parentIdMapping]=null))},e.prototype.removeFirstrowBorder=function(e){var t="bottomSegment"===this.dropPosition;this.parent.element.getElementsByClassName("e-firstrow-border").length>0&&e&&(0!==e.rowIndex||t)&&this.parent.element.getElementsByClassName("e-firstrow-border")[0].remove()},e.prototype.removeLastrowBorder=function(e){if(e&&!(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow"))){var t=(this.parent.enableVirtualization?this.parent.getRows()[this.parent.getCurrentViewRecords().length-1]:this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length-1)).getAttribute("data-uid")!==e.getAttribute("data-uid")||"topSegment"===this.dropPosition,i=this.parent.element.getElementsByClassName("e-lastrow-border")[0];i&&t&&i.remove()}},e.prototype.updateIcon=function(e,i,r){var n=r.target?(0,t.closest)(r.target,"tr"):null;this.dropPosition=void 0;var o=0;this.removeFirstrowBorder(n),this.removeLastrowBorder(n);for(var a=0;a<r.rows.length;a++)((0,t.isNullOrUndefined)(n)||n.getAttribute("data-uid")!==r.rows[parseInt(a.toString(),10)].getAttribute("data-uid"))&&(0,l.parentsUntil)(r.target,"e-gridcontent")||(this.dropPosition="Invalid",this.addErrorElem(),(0,t.isNullOrUndefined)(this.parent.rowDropSettings.targetID)&&(this.removetopOrBottomBorder(),this.removeChildBorder()));var s=this.parent,d=0,p=s.toolbar&&s.toolbar.length?document.getElementById(s.element.id+"_gridcontrol_toolbarItems").offsetHeight:0,h=this.getOffset(s.element),c=s.getHeaderContent().offsetHeight+h.top+p,u=s.getContent().firstElementChild.scrollTop;(0,t.isNullOrUndefined)(n)||(o=n.offsetTop-u),d=this.parent.enableVirtualization?n.getBoundingClientRect().top:o+c+0;var g=((0!==e[0].offsetHeight&&(0,t.isNullOrUndefined)(n)?d+e[0].offsetHeight:d+n.offsetHeight)-d)/3,f=d+g,y=f+g,m=y+g,S=(0,l.getObject)("originalEvent.event",r),v=(0,l.getObject)("originalEvent.event",r),w="mousemove"===S.type?S.pageY:(0,t.isNullOrUndefined)(v)||(0,t.isNullOrUndefined)(v.changedTouches)?null:v.changedTouches[0].pageY;this.parent.enableVirtualization&&(w="mousemove"===S.type?S.clientY:(0,t.isNullOrUndefined)(v)||(0,t.isNullOrUndefined)(v.changedTouches)?null:v.changedTouches[0].clientY);var I=w<=f,R=w>f&&w<=y,x=w>y&&w<=m,C=!0;if(I||R||x)if(I&&"Invalid"!==this.dropPosition&&(this.removeChildBorder(),this.dropPosition="topSegment",this.removetopOrBottomBorder(),this.addFirstrowBorder(n),this.removeErrorElem(),this.removeLastrowBorder(n)),R&&"Invalid"!==this.dropPosition&&(this.removetopOrBottomBorder(),this.dropPosition="middleSegment",this.addLastRowborder(n),this.addFirstrowBorder(n)),x&&"Invalid"!==this.dropPosition&&(this.removeErrorElem(),this.removetopOrBottomBorder(),this.removeChildBorder(),this.dropPosition="bottomSegment",this.addLastRowborder(n),this.removeFirstrowBorder(n)),(I||x)&&"Invalid"!==this.dropPosition)C=this.updateBorderStatus(e,i),this.topOrBottomBorder(r.target,C);else if(R&&"Invalid"!==this.dropPosition){var b,D=(0,t.closest)(r.target,"tr");b=[].slice.call(D.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")),C=this.updateBorderStatus(e,i),b.length>0&&C&&this.addRemoveClasses(b,!0,"e-childborder")}return this.dropPosition},e.prototype.updateBorderStatus=function(e,i){var r=this,n=!0,o=this.parent.grid.getRows(),a=[],s=!1;(0,t.isNullOrUndefined)(this.parent.detailTemplate)||(o=this.parent.getDataRows(),s=!0);var d=this.parent.treeColumnIndex,l=this.parent.allowRowDragAndDrop?s?d+2:d+1:s?d+1:d;(0,t.isNullOrUndefined)(this.parent.rowDropSettings.targetID)||(l=d);var p=e,h=[o[""+i]];return"topSegment"===this.dropPosition&&(e.filter(function(r){if((0,t.isNullOrUndefined)(r)||(0,t.isNullOrUndefined)(r.cells)||(0,t.isNullOrUndefined)(h[0])||(0,t.isNullOrUndefined)(h[0].cells))return!0;var s=/index(\d+)|level(\d+)/g,d=null==r?void 0:r.cells[""+l].className.match(s),c=h[0].cells[""+l].className.match(s);if((0,t.isNullOrUndefined)(c)||(0,t.isNullOrUndefined)(c)||(0,t.isNullOrUndefined)(d))return!0;var u=+d[1].match(/\d+/)[0],g=+c[1].match(/\d+/)[0],f=!1;if(0!==u&&u!==g)return!0;for(var y=0;y<o.length;y++)if(o[parseInt(y.toString(),10)]===p[0]&&(f=!0),f&&o[parseInt(y.toString(),10)]!==p[0]){var m=+o[parseInt(y.toString(),10)].cells[""+l].className.match(s)[1].match(/\d+/)[0];if(!(m!==u&&m>u))break;a.push(o[parseInt(y.toString(),10)])}return u===g&&(a.length>0&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1===i-(a.length+1)||0===a.length&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1==i-1)&&(n=!1),!0}),n=!(!(0,t.isNullOrUndefined)(e)&&0===a.length&&!(0,t.isNullOrUndefined)(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1==i-1&&(0,t.isNullOrUndefined)(e[0]))&&n),"bottomSegment"===this.dropPosition&&(h.filter(function(r){if((0,t.isNullOrUndefined)(r)||(0,t.isNullOrUndefined)(r.cells)||(0,t.isNullOrUndefined)(p[0])||(0,t.isNullOrUndefined)(p[0].cells))return!0;var s=/index(\d+)|level(\d+)/g,d=null==r?void 0:r.cells[""+l].className.match(s),c=p[0].cells[""+l].className.match(s);if((0,t.isNullOrUndefined)(c)||(0,t.isNullOrUndefined)(d))return!0;var u=+d[1].match(/\d+/)[0],g=+c[1].match(/\d+/)[0],f=!1;if(0!==u&&u!==g)return!0;for(var y=0;y<o.length;y++)if(o[parseInt(y.toString(),10)]===h[0]&&(f=!0),f&&o[parseInt(y.toString(),10)]!==h[0]){var m=+o[parseInt(y.toString(),10)].cells[""+l].className.match(s)[1].match(/\d+/)[0];if(!(m!==u&&m>u))break;a.push(o[parseInt(y.toString(),10)])}return!(0,t.isNullOrUndefined)(e)&&u===g&&(a.length>0&&!(0,t.isNullOrUndefined)(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1===i+(a.length+1)||0===a.length&&!(0,t.isNullOrUndefined)(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1===i+1)&&(n=!1),!0}),n=!(!(0,t.isNullOrUndefined)(e)&&0===a.length&&!(0,t.isNullOrUndefined)(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1===i+1&&(0,t.isNullOrUndefined)(e[0]))&&n),"middleSegment"===this.dropPosition&&h.filter(function(e){if((0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.cells)||(0,t.isNullOrUndefined)(p[0])||(0,t.isNullOrUndefined)(p[0].cells))return!0;for(var i=0;i<p.length;i++){var o=h[0].rowIndex,a=p[parseInt(i.toString(),10)].cells[""+l].className.match(/index(\d+)|level(\d+)/g);if(!a)return!0;var d=parseInt(a.find(function(e){return e.includes("index")}).match(/\d+/)[0]||"0",10);if(s&&(o/=2),d!==o||r.parent.rowDropSettings.targetID){n=!0;break}n=!1}return n||(r.dropPosition="Invalid",r.addErrorElem()),n}),this.canDrop=n,n},e.prototype.removeChildBorder=function(){var e;(e=[].slice.call(this.parent.element.querySelectorAll(".e-childborder"))).length>0&&this.addRemoveClasses(e,!1,"e-childborder")},e.prototype.addFirstrowBorder=function(e){var i=this.parent.element,r=this.parent;if(e&&0===e.rowIndex&&!e.classList.contains("e-emptyrow")){var n=this.parent.createElement("div",{className:"e-firstrow-border"}),o=this.parent.getHeaderContent(),a=0;r.toolbar&&(a=r.toolbarModule.getToolbar().offsetHeight);var s=!(0,t.isNullOrUndefined)(this.parent.rowDropSettings.targetID);s&&(n.style.top=this.parent.grid.element.getElementsByClassName("e-gridheader")[0].offsetHeight+a+"px"),n.style.width=s?i.offsetWidth+"px":i.offsetWidth-this.getScrollWidth()+"px",o.querySelectorAll(".e-firstrow-border").length||o.appendChild(n)}},e.prototype.addLastRowborder=function(e){if(e){var t=e&&(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow"));if(!t&&e&&!t&&this.parent.getRows()[this.parent.getCurrentViewRecords().length-1].getAttribute("data-uid")===e.getAttribute("data-uid")){var i=this.parent.createElement("div",{className:"e-lastrow-border"}),r=this.parent.getContent();i.style.width=this.parent.element.offsetWidth-this.getScrollWidth()+"px",r.querySelectorAll(".e-lastrow-border").length||(r.classList.add("e-treegrid-relative"),r.appendChild(i),i.style.bottom=this.getScrollWidth()+"px")}}},e.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?l.Scroll.getScrollBarWidth():0},e.prototype.addErrorElem=function(){var e=document.getElementsByClassName("e-cloneproperties")[0],t="sanitize";if(!e.querySelectorAll(".e-errorelem").length&&!this.parent.rowDropSettings.targetID){var i=document.createElement("div");i.classList.add("e-errorcontainer","e-icons","e-errorelem");var r=e.querySelector(".e-rowcell"),n=e.querySelector(".errorValue"),o=r.innerHTML;n&&(o=this.parent[""+t](n.innerHTML),n.parentNode.removeChild(n)),r.innerHTML="";var a=document.createElement("span");a.className="errorValue",a.style.paddingLeft="16px",a.innerHTML=this.parent[""+t](o),r.appendChild(i),r.appendChild(a);var s=document.querySelector(".e-dropitemscount");if(this.hasDropItem&&s){var d=parseInt(s.style.left,10)+i.offsetWidth+16,l=this.parent.enableRtl?0:d;s.style.left=l+"px",this.hasDropItem=!1}}},e.prototype.removeErrorElem=function(){var e=document.querySelector(".e-errorelem"),i=document.querySelector(".errorValue"),r=document.querySelector(".e-dropitemscount");if(e){if(r){var n=parseInt(r.style.left,10)-e.offsetWidth-16;(0,t.setStyleAttribute)(i,{paddingLeft:"0px"}),this.parent.enableRtl||(0,t.setStyleAttribute)(r,{left:n+"px"})}e.remove()}this.hasDropItem=!0},e.prototype.topOrBottomBorder=function(e,i){void 0===i&&(i=!0);var r=(0,t.closest)(e,"tr"),n=r?Array.from(r.querySelectorAll(".e-rowcell, .e-rowdragdrop, .e-detailrowcollapse")):[];if(n.length){var o=i?this.addRemoveClasses.bind(this,n,!0):this.addRemoveClasses.bind(this,n,!1,"e-dragborder");if("topSegment"===this.dropPosition){o("e-droptop");var a=this.parent.element.querySelector(".e-lastrow-dragborder");a&&a.remove()}"bottomSegment"===this.dropPosition&&o("e-dropbottom")}},e.prototype.removetopOrBottomBorder=function(){var e=[];e=[].slice.call(this.parent.element.querySelectorAll(".e-dropbottom, .e-droptop")),this.parent.rowDropSettings.targetID&&(e=[].slice.call(document.querySelectorAll(".e-dropbottom, .e-droptop"))),e.length&&(this.addRemoveClasses(e,!1,"e-dropbottom"),this.addRemoveClasses(e,!1,"e-droptop"))},e.prototype.addRemoveClasses=function(e,t,i){for(var r=0,n=e.length;r<n;r++)t?e[parseInt(r.toString(),10)].classList.add(i):e[parseInt(r.toString(),10)].classList.remove(i)},e.prototype.getOffset=function(e){var t=e.getBoundingClientRect(),i=document.body,r=document.documentElement,n=window.pageYOffset||r.scrollTop||i.scrollTop,o=window.pageXOffset||r.scrollLeft||i.scrollLeft,a=r.clientTop||i.clientTop||0,s=r.clientLeft||i.clientLeft||0,d=t.top+n-a,l=t.left+o-s;return{top:Math.round(d),left:Math.round(l)}},e.prototype.Rowdraging=function(e){var i=this.parent,r=this.parent.element.querySelector(".e-cloneproperties");if(r){r.style.cursor="";var n=e.target?(0,t.closest)(e.target,"tr"):null,o=-1;if(-1===(o=(0,t.isNullOrUndefined)(this.parent.detailTemplate)?n?n.rowIndex:-1:n?this.parent.getDataRows().indexOf(n):-1))return this.canDrop=!1,this.addErrorElem(),this.removetopOrBottomBorder(),void this.removeChildBorder();var a,s,d=Array.isArray(e.data)?e.data:[e.data],p=i.getCurrentViewRecords()[parseInt(o.toString(),10)];if(i.rowDropSettings.targetID)if((s=(0,l.parentsUntil)(e.target,"e-treegrid"))&&s.id===this.parent.rowDropSettings.targetID)p=(a=s.ej2_instances[0]).getCurrentViewRecords()[parseInt(o.toString(),10)];if(this.removeErrorElem(),this.canDrop=!0,this.ensuredropPosition(d,p),i.rowDropSettings.targetID||!this.canDrop||(0,t.isNullOrUndefined)(e.rows[0])||i.rowDragAndDropModule.updateIcon(e.rows,o,e),i.rowDropSettings.targetID)if((s=(0,l.parentsUntil)(e.target,"e-treegrid"))&&s.id===this.parent.rowDropSettings.targetID)(a=s.ej2_instances[0]).rowDragAndDropModule.updateIcon(e.rows,o,e),this.dropPosition=a.rowDragAndDropModule.dropPosition;if(e.target&&(0,t.closest)(e.target,"#"+i.rowDropSettings.targetID))(s=(0,l.parentsUntil)(e.target,"e-treegrid"))||(r.style.cursor="default")}},e.prototype.rowDropped=function(e){var i=this.parent;if(i.rowDropSettings.targetID){if((e.target&&(0,t.closest)(e.target,"#"+i.rowDropSettings.targetID)||(0,l.parentsUntil)(e.target,"e-treegrid")&&(0,l.parentsUntil)(e.target,"e-treegrid").id===i.rowDropSettings.targetID||e.target&&document.getElementById(i.rowDropSettings.targetID))&&(!this.parent.element.querySelector(".e-errorelem")&&this.canDrop||(this.dropPosition="Invalid"),(0,t.setValue)("dropPosition",this.dropPosition,e),i.trigger(Pe,e),!e.cancel&&i.rowDropSettings.targetID)){if("Invalid"===this.dropPosition&&!this.canDrop)return;this.dragDropGrid(e),i.isLocalData&&(i.flatData=this.orderToIndex(i.flatData))}}else if(((0,l.parentsUntil)(e.target,"e-content")||"Invalid"===this.dropPosition||!this.canDrop)&&(!this.parent.element.querySelector(".e-errorelem")&&this.canDrop||(this.dropPosition="Invalid"),(0,t.setValue)("dropPosition",this.dropPosition,e),i.trigger(Pe,e),!e.cancel)){if(!tt(this.parent)&&"Invalid"===this.dropPosition&&!this.canDrop)return;tt(this.parent)||this.dropRows(e),i.isLocalData&&(i.flatData=this.orderToIndex(i.flatData)),i.grid.refresh(),this.removeRowBorders()}if(this.removetopOrBottomBorder(),this.removeChildBorder(),this.removeRowBorders(),this.parent.enableImmutableMode&&!this.parent.allowPaging&&!(0,t.isNullOrUndefined)(e.data[0].parentItem)){var r=this.parent.treeColumnIndex;r+=1;var n=this.parent.getPrimaryKeyFieldNames()[0],o=this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+n]),a=this.parent.getRows()[parseInt(o.toString(),10)],s=e.data[0];if("middleSegment"===this.dropPosition){var d=[],p=[];d.push(s),p.push(a);s=pt(this.parent,e.data[0].parentUniqueID),o=this.parent.grid.getRowIndexByPrimaryKey(s[""+n]);var h=this.parent.getRows()[parseInt(o.toString(),10)];d.push(s),p.push(h);for(var c=0;c<d.length;c++)this.parent.renderModule.cellRender({data:d[parseInt(c.toString(),10)],cell:p[parseInt(c.toString(),10)].cells[parseInt(r.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"});var u=h.getElementsByClassName("e-treegridcollapse")[0];(0,t.isNullOrUndefined)(u)||((0,t.removeClass)([u],"e-treegridcollapse"),(0,t.addClass)([u],"e-treegridexpand"))}else this.parent.renderModule.cellRender({data:s,cell:a.cells[parseInt(r.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"})}},e.prototype.removeRowBorders=function(){var e=this;["e-firstrow-border","e-lastrow-border"].forEach(function(t){var i=e.parent.element.getElementsByClassName(t)[0];i&&i.remove()})},e.prototype.dragDropGrid=function(e){var i,r=this.parent,n=(0,t.closest)(e.target,"tr"),o=isNaN(this.getTargetIdx(n))?0:this.getTargetIdx(n),a=(0,l.parentsUntil)(e.target,"e-treegrid");if(a&&a.id===this.parent.rowDropSettings.targetID&&!et(this.parent)&&!tt(this.parent)){i=a.ej2_instances[0];for(var s=r.getSelectedRecords(),d=[],p=0;p<s.length;p++)d[parseInt(p.toString(),10)]=s[parseInt(p.toString(),10)].index;var h=i.dataSource;if(null!==this.parent.idMapping&&((0,t.isNullOrUndefined)(this.dropPosition)||"bottomSegment"===this.dropPosition||"Invalid"===this.dropPosition)&&!h.length){var c=[];for(p=0;p<s.length;p++)if(s[parseInt(p.toString(),10)].hasChildRecords){c.push(s[parseInt(p.toString(),10)]);for(var u=at(s[parseInt(p.toString(),10)]),g=0;g<u.length;g++)c.push(u[parseInt(g.toString(),10)])}c.length&&(s=c)}r.notify(Ne,{indexes:d,records:s}),i.notify(Ee,{toIndex:o,records:s});var f=i.rowDragAndDropModule.treeGridData;if(!(0,t.isNullOrUndefined)(f))for(p=0;p<f.length;p++)if(f[parseInt(p.toString(),10)].index=p,!(0,t.isNullOrUndefined)(f[parseInt(p.toString(),10)].parentItem)){var y=(0,t.getValue)("uniqueIDCollection."+f[parseInt(p.toString(),10)].parentUniqueID+".index",i);f[parseInt(p.toString(),10)].parentItem.index=y}r.grid.refresh(),i.grid.refresh(),i.grid.dataSource.length>1&&(i.grid.refresh(),(0,t.isNullOrUndefined)(i.getHeaderContent().querySelector(".e-firstrow-border"))||i.getHeaderContent().querySelector(".e-firstrow-border").remove(),(0,t.isNullOrUndefined)(i.getContent().querySelector(".e-lastrow-border"))||i.getContent().querySelector(".e-lastrow-border").remove())}tt(this.parent)&&(i=a.ej2_instances[0],r.grid.refresh(),i.grid.refresh())},e.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute("aria-rowindex"),10)-1:0},e.prototype.getParentData=function(e,t){var i=e.parentItem,r=-1;if(this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?r=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(r=this.parent.selectedRowIndex),"bottomSegment"===this.dropPosition){var n=this.parent.getPrimaryKeyFieldNames()[0],o=-1===r?this.parent.grid.getRowIndexByPrimaryKey(t[0][""+n]):this.parent.getSelectedRowIndexes()[0],a=this.parent.getCurrentViewRecords()[parseInt(o.toString(),10)];this.droppedRecord=pt(this.parent,a.parentItem.uniqueID)}"middleSegment"===this.dropPosition&&(this.parent.getCurrentViewRecords()[parseInt(r.toString(),10)].level===i.level?this.droppedRecord=pt(this.parent,i.uniqueID):this.getParentData(i))},e.prototype.dropRows=function(e,i){if("Invalid"!==this.dropPosition&&!et(this.parent)){var r,n=this.parent,o=void 0;if((0,t.isNullOrUndefined)(e.dropIndex)){var a=this.parent.getPrimaryKeyFieldNames()[0],s=-1===n.selectedRowIndex?this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+a])-1:n.getSelectedRowIndexes()[0]-1,d=n.getCurrentViewRecords()[parseInt(s.toString(),10)];this.getParentData(d,e.data)}else if(e.dropIndex=e.dropIndex===e.fromIndex?this.getTargetIdx(e.target.parentElement):e.dropIndex,this.parent.enableVirtualization){var l=this.parent.getRowByIndex(e.dropIndex).rowIndex;this.droppedRecord=n.getCurrentViewRecords()[parseInt(l.toString(),10)]}else if((0,t.isNullOrUndefined)(this.parent.rowDropSettings.targetID))this.droppedRecord=n.getCurrentViewRecords()[e.dropIndex];else{var p=this.parent.grid.getRowsObject();this.droppedRecord=p.length>0?p[e.dropIndex].data:void 0}var h=[];o=this.droppedRecord,e.data[0]?h=e.data:h.push(e.data),this.parent[this.modifiedRecords].push(e.data[0],o);var c=0,u=this.parent.rowDropSettings.targetID;this.isMultipleGrid=u,u?this.isaddtoBottom=u&&this.isDraggedWithChild:this.ensuredropPosition(h,o);var g=h.length;(!(0,t.isNullOrUndefined)(this.parent.idMapping)||"bottomSegment"===this.dropPosition&&h.length>1&&(0,t.isNullOrUndefined)(this.parent.idMapping))&&h.reverse();for(var f=function(a){if(r=h[parseInt(a.toString(),10)],y.draggedRecord=r,!y.draggedRecord.hasChildRecords)for(var s=0,d=h;s<d.length;s++){var l=d[s];(0,t.isNullOrUndefined)(l.childRecords)||-1===l.childRecords.indexOf(y.draggedRecord)||(y.draggedRecord=void 0)}if(!(0,t.isNullOrUndefined)(y.draggedRecord)){if("Invalid"!==y.dropPosition&&!(0,t.isNullOrUndefined)(y.droppedRecord)){if(n.rowDropSettings.targetID&&!i||y.deleteDragRow(),y.draggedRecord===y.droppedRecord){var p=y.getTargetIdx(e.target.offsetParent.parentElement);isNaN(p)&&(p=y.getTargetIdx(e.target.parentElement)),e.dropIndex=p,o=y.droppedRecord=y.parent.getCurrentViewRecords()[e.dropIndex]}if(o.parentItem||"middleSegment"===y.dropPosition)-1!==(S=(m=n.parentData).indexOf(y.draggedRecord))&&m.splice(S,1);var u=y.treeGridData.indexOf(o);if(y.dropAtTop(u),"bottomSegment"===y.dropPosition){if(o.hasChildRecords?(c=y.getChildCount(o,0),y.parent.parentIdMapping&&y.treeData.splice(u+c+1,0,y.draggedRecord.taskData),y.treeGridData.splice(u+c+1,0,y.draggedRecord)):(y.parent.parentIdMapping&&y.treeData.splice(u+1,0,y.draggedRecord.taskData),y.treeGridData.splice(u+1,0,y.draggedRecord)),(0,t.isNullOrUndefined)(o.parentItem)&&(delete r.parentItem,delete r.parentUniqueID,r.level=0,y.parent.parentIdMapping&&(r[y.parent.parentIdMapping]=null)),o.parentItem){var g=y.getChildrecordsByParentID(o.parentUniqueID)[0].childRecords,f=g.indexOf(o)+1;g.splice(f,0,r),r.parentItem=o.parentItem,r.parentUniqueID=o.parentUniqueID,r.level=o.level,y.parent.parentIdMapping&&(r[y.parent.parentIdMapping]=o[y.parent.parentIdMapping],r.parentItem=o.parentItem,r.level=o.level)}if(r.hasChildRecords){y.updateChildRecordLevel(r,1),y.updateChildRecord(r,u+c+1)}}y.dropMiddle(u)}if((0,t.isNullOrUndefined)(r.parentItem)){var m,S=(m=n.parentData).indexOf(y.droppedRecord),v=0;m.filter(function(e){r.uniqueID===e.uniqueID&&v++}),"bottomSegment"===y.dropPosition&&0===v?m.splice(S+1,0,r):"topSegment"===y.dropPosition&&0===v&&m.splice(S,0,r)}n.rowDragAndDropModule.refreshGridDataSource()}},y=this,m=0;m<g;m++)f(m)}},e.prototype.dropMiddle=function(e){var i=this.parent,r=at(this.droppedRecord),n=(0,t.isNullOrUndefined)(r)||0===r.length?e+1:r.length+e+1;"middleSegment"===this.dropPosition&&(i.parentIdMapping?(this.treeData.splice(n,0,this.draggedRecord.taskData),this.treeGridData.splice(n,0,this.draggedRecord)):this.treeGridData.splice(n,0,this.draggedRecord),this.recordLevel(),this.draggedRecord.hasChildRecords&&this.updateChildRecord(this.draggedRecord,n))},e.prototype.dropAtTop=function(e){var t=this.parent;if("topSegment"===this.dropPosition){t.parentIdMapping&&this.treeData.splice(e,0,this.draggedRecord.taskData);var i=this.treeGridData[parseInt(e.toString(),10)];if(this.draggedRecord.parentItem=i.parentItem,this.draggedRecord.parentUniqueID=i.parentUniqueID,this.draggedRecord.level=i.level,this.treeGridData.splice(parseInt(e.toString(),10),0,this.draggedRecord),this.draggedRecord.hasChildRecords){this.updateChildRecord(this.draggedRecord,e),this.updateChildRecordLevel(this.draggedRecord,1)}if(this.droppedRecord.parentItem){var r=this.getChildrecordsByParentID(this.droppedRecord.parentUniqueID)[0].childRecords,n=r.indexOf(this.droppedRecord);r.splice(n,0,this.draggedRecord)}}},e.prototype.recordLevel=function(){var e=this.parent,i=this.draggedRecord,r=this.droppedRecord,n=e.childMapping;if(r.hasChildRecords||(r.hasChildRecords=!0,r.hasFilteredChildRecords=!0,((0,t.isNullOrUndefined)(r.childRecords)||0===r.childRecords.length)&&(r.childRecords=[],!e.parentIdMapping&&(0,t.isNullOrUndefined)(r.taskData[""+n])&&(r.taskData[""+n]=[]))),"middleSegment"===this.dropPosition){var o=(0,t.extend)({},r);delete o.childRecords,i.parentItem=o,i.parentUniqueID=r.uniqueID,r.childRecords.splice(r.childRecords.length,0,i),(0,t.setValue)("uniqueIDCollection."+i.uniqueID,i,e);if(e.isSelfReference&&(r[e.childMapping]=[],r[e.childMapping].splice(r[e.childMapping].length,0,i)),(0,t.isNullOrUndefined)(i)||e.parentIdMapping||(0,t.isNullOrUndefined)(r.taskData[""+n])||r.taskData[e.childMapping].splice(r.childRecords.length,0,i.taskData),i.hasChildRecords){i.level=r.level+1,this.updateChildRecordLevel(i,1)}else i.level=r.level+1;r.expanded=!0}},e.prototype.deleteDragRow=function(){this.parent.dataSource instanceof Ze.DataManager&&st(this.parent)?(this.treeGridData=this.parent.grid.dataSource.dataSource.json,this.treeData=this.parent.dataSource.dataSource.json):(this.treeGridData=this.parent.grid.dataSource,this.treeData=this.parent.dataSource);var e=pt(this.parent,this.draggedRecord.uniqueID);!(0,t.isNullOrUndefined)(e.childRecords)&&e.childRecords.length&&(e.hasChildRecords=!0),this.removeRecords(e)},e.prototype.updateChildRecord=function(e,i){var r,n,o=this.parent;if(!e.hasChildRecords)return 0;n=e.childRecords.length;for(var a=0;a<n;a++)r=this.isMultipleGrid?e.childRecords[parseInt(a.toString(),10)]:(0,t.getValue)("uniqueIDCollection."+e.childRecords[parseInt(a.toString(),10)].uniqueID,o),i++,o.flatData.splice(i,0,r),(0,t.setValue)("uniqueIDCollection."+r.uniqueID,r,this.parent),o.parentIdMapping&&this.treeData.splice(i,0,r.taskData),r.hasChildRecords&&(i=this.updateChildRecord(r,i));return i},e.prototype.updateChildRecordLevel=function(e,i){var r,n;if(i++,!e.hasChildRecords)return 0;r=e.childRecords.length;for(var o=0;o<r;o++){n=this.isMultipleGrid?e.childRecords[parseInt(o.toString(),10)]:(0,t.getValue)("uniqueIDCollection."+e.childRecords[parseInt(o.toString(),10)].uniqueID,this.parent);var a=void 0;e.parentItem&&(a=pt(this.parent,e.parentItem.uniqueID)),(0,t.isNullOrUndefined)(a)&&!(0,t.isNullOrUndefined)(e.parentItem)&&(a=e.parentItem),n.level=e.parentItem?a.level+i:e.level+1,n.hasChildRecords&&(i--,i=this.updateChildRecordLevel(n,i))}return i},e.prototype.removeRecords=function(e){var i,r=this,n=this.parent;i=this.parent.dataSource instanceof Ze.DataManager&&st(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;var o=e,a=!(0,t.isNullOrUndefined)(n.parentIdMapping),s=this.getChildrecordsByParentID(o.parentUniqueID)[0];if(o){if(o.parentItem){var d=s?s.childRecords:[],l=0;d&&d.length>0&&(l=d.indexOf(o),s.childRecords.splice(l,1),this.parent.parentIdMapping&&!n.enableImmutableMode||zt({value:o,action:"delete"},this.parent,a,o.index,o.index))}if(n.parentIdMapping){o.hasChildRecords&&o.childRecords.length>0&&this.removeChildItem(o);var p=i.findIndex(function(e){return e[r.parent.idMapping]===o.taskData[r.parent.idMapping]}),h=this.treeGridData.findIndex(function(e){return e[r.parent.idMapping]===o.taskData[r.parent.idMapping]});-1===p||(0,t.isNullOrUndefined)(p)||i.splice(p,1),-1===h||(0,t.isNullOrUndefined)(h)||this.treeGridData.splice(h,1)}var c=this.treeGridData.indexOf(o);if(!n.parentIdMapping){var u=this.parent.parentData.indexOf(o);-1!==u&&(n.parentData.splice(u,1),i.splice(u,1))}if(-1===c&&!n.parentIdMapping)for(var g=n.getPrimaryKeyFieldNames()[0],f=0;f<this.treeGridData.length;f++)this.treeGridData[parseInt(f.toString(),10)][""+g]===o[""+g]&&(c=f);if(!n.parentIdMapping){var y=this.getChildCount(o,0);this.treeGridData.splice(c,y+1)}o.parentItem&&s&&s.childRecords&&!s.childRecords.length&&(s.expanded=!1,s.hasChildRecords=!1,s.hasFilteredChildRecords=!1),-1!==this.parent[this.modifiedRecords].indexOf(s)||(0,t.isNullOrUndefined)(s)||this.parent[this.modifiedRecords].push(s),(0,t.isNullOrUndefined)(s)||this.updateModifiedRecords(s)}},e.prototype.updateModifiedRecords=function(e){var i=pt(this.parent,e.parentUniqueID);(0,t.isNullOrUndefined)(i)||(this.parent[this.modifiedRecords].push(i),this.updateModifiedRecords(i))},e.prototype.removeChildItem=function(e){var i,r,n,o;o=this.parent.dataSource instanceof Ze.DataManager&&st(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;for(var a=0;a<e.childRecords.length;a++){i=e.childRecords[parseInt(a.toString(),10)],!(0,t.isNullOrUndefined)(i.childRecords)&&i.childRecords.length&&(i.hasChildRecords=!0);var s=void 0;s=this.parent.dataSource instanceof Ze.DataManager&&st(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;for(var d=0;d<s.length;d++)s[parseInt(d.toString(),10)][this.parent.idMapping]===i.taskData[this.parent.idMapping]&&(r=d);for(var l=0;l<this.treeGridData.length;l++)if(this.treeGridData[parseInt(l.toString(),10)][this.parent.idMapping]===i.taskData[this.parent.idMapping]){n=l;break}-1===r||(0,t.isNullOrUndefined)(r)||o.splice(r,1),-1===n||(0,t.isNullOrUndefined)(n)||this.treeGridData.splice(n,1),i.hasChildRecords&&this.removeChildItem(i)}},e.prototype.getChildCount=function(e,t){var i;if(!e.hasChildRecords)return 0;for(var r=0;r<e.childRecords.length;r++)t++,(i=e.childRecords[parseInt(r.toString(),10)]).hasChildRecords&&(t=this.getChildCount(i,t));return t},e.prototype.ensuredropPosition=function(e,i){var r=this;e.filter(function(e){if(e.hasChildRecords&&!(0,t.isNullOrUndefined)(e.childRecords)){if(-1!==e.childRecords.indexOf(i))return r.dropPosition="Invalid",r.addErrorElem(),r.canDrop=!1,void((0,t.isNullOrUndefined)(r.parent.rowDropSettings.targetID)&&(r.removetopOrBottomBorder(),r.removeChildBorder()));r.ensuredropPosition(e.childRecords,i)}})},e.prototype.isDuplicateData=function(e){var t=this.parent.getPrimaryKeyFieldNames();return 0!==t.length&&this.parent.flatData.some(function(i){return t.every(function(t){return i[t]===e[t]})})},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ue,this.Rowdraging),this.parent.off(qe,this.rowDropped),this.parent.off(Ee,this.rowsAdded),this.parent.off(Ne,this.rowsRemoved))},e.prototype.getModuleName=function(){return"rowDragAndDrop"},e}(),ei=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ti=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},ii=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ei(i,e),ti([(0,t.Property)()],i.prototype,"targetID",void 0),i}(t.ChildProperty),ri=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ni=function(e){function i(t){var i=e.call(this,t)||this;return i.addEventListener(),i}return ri(i,e),i.prototype.addEventListener=function(){this.parent.on(Ie,this.getDatas,this)},i.prototype.getDatas=function(e){this.visualData=e.data},i.prototype.getDataInfo=function(){return e.prototype.getData.call(this)},i.prototype.generateRows=function(i,r){var n=this.getDataInfo();if("refresh"===r.requestType&&r.isExpandCollapse&&(r.virtualInfo=this.prevInfo),(0,t.isNullOrUndefined)(r.virtualInfo)||this.parent.root.loadChildOnDemand&&et(this.parent.root)||("right"!==r.virtualInfo.direction&&"left"!==r.virtualInfo.direction?et(this.parent.root)&&!tt(this.parent)&&1!==r.virtualInfo.blockIndexes.length||(r.virtualInfo.blockIndexes=n.blockIndexes):r.virtualInfo.blockIndexes=this.getBlockIndexes(r.virtualInfo.page)),this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||tt(this.parent))return e.prototype.generateRows.call(this,i,r);(0,t.isNullOrUndefined)(r.requestType)||"collapseAll"!==r.requestType.toString()||(r.requestType="refresh");var o=e.prototype.generateRows.call(this,i,r);if(!(0,t.isNullOrUndefined)(this.visualData))for(var a=0;a<o.length;a++)o[parseInt(a.toString(),10)].index=this.visualData.indexOf(o[parseInt(a.toString(),10)].data);return o},i.prototype.checkAndResetCache=function(e){var t=["paging","refresh","sorting","filtering","searching","reorder","save","delete"].some(function(t){return e===t});if(this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||tt(this.parent)){var i=this.model.currentPage;t?(this.cache={},this.data={},this.groups={}):"virtualscroll"===e&&this.cache[parseInt(i.toString(),10)]&&this.cache[parseInt(i.toString(),10)].length>this.parent.contentModule.getBlockSize()&&this.cache[parseInt(i.toString(),10)].length>this.parent.contentModule.getBlockSize()&&(this.cache[parseInt(i.toString(),10)]=this.cache[parseInt(i.toString(),10)].slice(0,this.parent.contentModule.getBlockSize()))}else(t||"virtualscroll"===e)&&(this.cache={},this.data={},this.groups={});return t},i}(l.VirtualRowModelGenerator),oi=function(){function e(e){l.Grid.Inject(l.Filter),this.parent=e,this.isHierarchyFilter=!1,this.filteredResult=[],this.flatFilteredData=[],this.filteredParentRecs=[],this.addEventListener()}return e.prototype.getModuleName=function(){return"filter"},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.addEventListener=function(){this.parent.on("updateFilterRecs",this.updatedFilteredRecord,this),this.parent.on("clearFilters",this.clearFilterLevel,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateFilterRecs",this.updatedFilteredRecord),this.parent.off("clearFilters",this.clearFilterLevel))},e.prototype.updatedFilteredRecord=function(e){(0,t.setValue)("uniqueIDFilterCollection",{},this.parent),this.flatFilteredData=e.data,this.filteredParentRecs=[],this.filteredResult=[],this.isHierarchyFilter=!1;for(var i=""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode,r=0;r<this.flatFilteredData.length;r++){var n=this.flatFilteredData[parseInt(r.toString(),10)];this.addParentRecord(n),"Child"!==i&&"None"!==i||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||(this.isHierarchyFilter=!0);var o=(0,l.getObject)("childRecords",n);!(0,t.isNullOrUndefined)(o)&&o.length&&(0,t.setValue)("hasFilteredChildRecords",this.checkChildExsist(n),n);var a=(0,l.getObject)("parentItem",n);if(!(0,t.isNullOrUndefined)(a)){var s=pt(this.parent,n.parentItem.uniqueID,!0);(0,t.setValue)("hasFilteredChildRecords",!0,s),s&&s.parentItem&&this.updateParentFilteredRecord(s)}}this.flatFilteredData.length>0&&this.isHierarchyFilter&&this.updateFilterLevel(),this.parent.notify("updateAction",{result:this.filteredResult})},e.prototype.updateParentFilteredRecord=function(e){var i=pt(this.parent,e.parentItem.uniqueID,!0),r=(0,t.getValue)("uniqueIDFilterCollection",this.parent);i&&Object.prototype.hasOwnProperty.call(r,i.uniqueID)&&(0,t.setValue)("hasFilteredChildRecords",!0,i),i&&i.parentItem&&this.updateParentFilteredRecord(i)},e.prototype.addParentRecord=function(e){var i=pt(this.parent,e.parentUniqueID);if("None"!==(""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode)||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key){if(!(0,t.isNullOrUndefined)(i))("Child"!==(""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode)||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||-1!==this.flatFilteredData.indexOf(i))&&this.addParentRecord(i);-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),(0,t.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent))}else if((0,t.isNullOrUndefined)(i)){if(-1!==this.flatFilteredData.indexOf(e))return void(-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),(0,t.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent),e.hasFilteredChildRecords=!0))}else this.addParentRecord(i),-1!==this.flatFilteredData.indexOf(i)||-1!==this.filteredResult.indexOf(i)?-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),(0,t.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent)):-1===this.filteredResult.indexOf(e)&&-1!==this.flatFilteredData.indexOf(e)&&(this.filteredResult.push(e),(0,t.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent))},e.prototype.checkChildExsist=function(e){for(var i=(0,l.getObject)("childRecords",e),r=!1,n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)].childRecords,a=""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode;if(!("Child"!==a&&"Both"!==a||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key)){var s=(0,t.getValue)("uniqueIDFilterCollection",this.parent);Object.prototype.hasOwnProperty.call(s,i[parseInt(n.toString(),10)].uniqueID)||(this.filteredResult.push(i[parseInt(n.toString(),10)]),(0,t.setValue)("uniqueIDFilterCollection."+i[parseInt(n.toString(),10)].uniqueID,i[parseInt(n.toString(),10)],this.parent),r=!0)}if("None"===a&&(0!==this.parent.grid.filterSettings.columns.length||""!==this.parent.grid.searchSettings.key)&&-1!==this.flatFilteredData.indexOf(i[parseInt(n.toString(),10)])){r=!0;break}!(0,t.isNullOrUndefined)(o)&&o.length&&(r=this.checkChildExsist(i[parseInt(n.toString(),10)])),"Child"!==a&&"Both"!==a||!i.length||(r=!0)}return r},e.prototype.updateFilterLevel=function(){for(var e=this.filteredResult,t=this.filteredResult.length,i=0;i<t;i++){var r=pt(this.parent,e[parseInt(i.toString(),10)].parentUniqueID);if(-1!==e.indexOf(r)){var n=pt(this.parent,e[parseInt(i.toString(),10)].parentUniqueID,!0);e[parseInt(i.toString(),10)].filterLevel=n.filterLevel+1}else e[parseInt(i.toString(),10)].filterLevel=0,this.filteredParentRecs.push(e[parseInt(i.toString(),10)])}},e.prototype.clearFilterLevel=function(e){for(var i,r=0,n=e.flatData,o=n.length;r<o;r++){var a=(i=n[parseInt(r.toString(),10)]).filterLevel;!a&&0!==a&&(0,t.isNullOrUndefined)(i.hasFilteredChildRecords)||(i.hasFilteredChildRecords=null,i.filterLevel=null)}this.filteredResult=[],this.parent.notify("updateResults",{result:n,count:n.length})},e}(),ai=function(){function e(e){this.isCollapsedStatePersist=!1,l.Grid.Inject(l.ExcelExport),this.parent=e,this.dataResults={},this.addEventListener()}return e.prototype.getModuleName=function(){return"ExcelExport"},e.prototype.addEventListener=function(){this.parent.on("updateResults",this.updateExcelResultModel,this),this.parent.on("excelCellInfo",this.excelQueryCellInfo,this),this.parent.grid.on("export-RowDataBound",this.exportRowDataBound,this),this.parent.on("excelAggregateCellInfo",this.excelAggregateCellInfo,this),this.parent.grid.on("finalPageSetup",this.finalPageSetup,this)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateResults",this.updateExcelResultModel),this.parent.off("excelCellInfo",this.excelQueryCellInfo),this.parent.grid.off("export-RowDataBound",this.exportRowDataBound),this.parent.off("excelAggregateCellInfo",this.excelAggregateCellInfo),this.parent.grid.off("finalPageSetup",this.finalPageSetup))},e.prototype.updateExcelResultModel=function(e){this.dataResults=e},e.prototype.Map=function(e,i,r,n,o){var a=this,s=this.parent.dataSource,d=new l.Data(this.parent.grid),p=Object();if((0,t.setValue)("isCsv",o,p),(0,t.setValue)("cancel",!1,p),(0,t.isNullOrUndefined)(e)||(this.isCollapsedStatePersist=e.isCollapsedStatePersist),!(0,t.isNullOrUndefined)(e)){if(!this.isLocal()&&!(0,t.isNullOrUndefined)(e.dataSource)&&!e.dataSource.dataSource)return this.parent.grid.excelExportModule.Map(this.parent.grid,e,i,r,o,n);if("CurrentPage"===e.exportType)return e.dataSource=this.parent.getCurrentViewRecords(),this.parent.grid.excelExportModule.Map(this.parent.grid,e,i,r,o,n)}return new Promise(function(h){var c=!a.isLocal()||s instanceof Ze.DataManager?a.parent.dataSource:new Ze.DataManager(s),u=new Ze.Query;if(a.isLocal()||((u=a.generateQuery(u)).queries=a.parent.grid.getDataModule().generateQuery().queries,u=l.ExportHelper.getQuery(a.parent.grid,d),(0,t.isNullOrUndefined)(a.parent.filterModule)&&(u.queries=u.queries.slice(1,2),u.params=u.params.slice(0,0)),(0,t.setValue)("query",u,p)),a.parent.trigger(z,(0,t.extend)(p,e)),(0,l.getObject)("cancel",p))return null;c.executeQuery(u).then(function(d){var l=null;return(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.dataSource)||(l=e.dataSource),e=a.manipulateExportProperties(e,s,d),a.parent.grid.excelExportModule.Map(a.parent.grid,e,i,r,o,n).then(function(t){null!=l?e.dataSource=l:delete e.dataSource,h(t)})})})},e.prototype.generateQuery=function(e,i){return!(0,t.isNullOrUndefined)(i)&&"CurrentPage"===i.exportType&&this.parent.allowPaging&&(i.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=(0,l.getObject)("grid.renderModule.data.pageQuery",this.parent)(e)),e},e.prototype.manipulateExportProperties=function(e,i,r){var n=Object();if((0,t.isNullOrUndefined)(this.parent.grid.getDataModule())||(0,t.setValue)("query",this.parent.grid.getDataModule().generateQuery(!0),n),(0,t.setValue)("isExport",!0,n),(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.exportType)||(0,t.setValue)("exportType",e.exportType,n),this.isLocal()||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData((0,l.getObject)("result",r)),(0,t.setValue)("expresults",this.parent.flatData,n)),this.parent.notify("dataProcessor",n),n=this.dataResults,i=(0,t.isNullOrUndefined)(n.result)?this.parent.flatData.slice(0):n.result,this.isLocal()||(this.parent.flatData=[]),e&&e.dataSource){var o=this.parent.flatData,a=e.dataSource instanceof Ze.DataManager?e.dataSource.dataSource.json:e.dataSource;this.parent.dataModule.convertToFlatData(a),i=this.parent.flatData,this.parent.flatData=o}return(e=(0,t.isNullOrUndefined)(e)?Object():e).dataSource=new Ze.DataManager({json:i}),this.parent.aggregates.length>0&&(e.query=n.query),e},e.prototype.excelQueryCellInfo=function(e){if(this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex){var i={},r=e.data,n=(0,t.isNullOrUndefined)(r.filterLevel)?r.level:r.filterLevel;i.indent=n,e.style=i}this.parent.notify("updateResults",e),this.parent.trigger("excelQueryCellInfo",e)},e.prototype.excelAggregateCellInfo=function(e){this.parent.trigger("excelAggregateQueryCellInfo",e)},e.prototype.exportRowDataBound=function(e){if("excel"===e.type){var i=e.rowObj.data,r=this.parent.grid.filterSettings.columns.length,n=e.excelRows.length,o=i.level;if(i.parentItem&&pt(this.parent,i.parentItem.uniqueID,Boolean(r))){var a=!1,s=!1,d=ot(this.parent,i,this.parent.parentData);!this.isCollapsedStatePersist||d&&this.parent.isLocalData||(a=!0,s=!i.expanded),e.excelRows[n-1].grouping={outlineLevel:o,isCollapsed:s,isHidden:a}}else i.hasChildRecords&&(0,t.isNullOrUndefined)(i.parentItem)&&(e.excelRows[n-1].grouping={outlineLevel:o})}},e.prototype.finalPageSetup=function(e){for(var t=0;t<e.worksheets.length;t++)e.worksheets[parseInt(t.toString(),10)].rows&&(e.worksheets[parseInt(t.toString(),10)].pageSetup={isSummaryRowBelow:!1})},e.prototype.isLocal=function(){return!et(this.parent)&&st(this.parent)},e}(),si=function(){function e(e){l.Grid.Inject(l.PdfExport),this.parent=e,this.dataResults={},this.addEventListener()}return e.prototype.getModuleName=function(){return"PdfExport"},e.prototype.addEventListener=function(){this.parent.on("pdfCellInfo",this.pdfQueryCellInfo,this),this.parent.on("updateResults",this.updatePdfResultModel,this),this.parent.on("pdfAggregateCellInfo",this.pdfAggregateCellInfo,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("pdfCellInfo",this.pdfQueryCellInfo),this.parent.off("updateResults",this.updatePdfResultModel),this.parent.off("pdfAggregateCellInfo",this.pdfAggregateCellInfo))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.updatePdfResultModel=function(e){this.dataResults=e},e.prototype.Map=function(e,i,r,n){var o=this,a=this.parent.dataSource,s=Object(),d=!et(this.parent)&&st(this.parent);return(0,t.setValue)("cancel",!1,s),new Promise(function(p){var h=!d||a instanceof Ze.DataManager?o.parent.dataSource:new Ze.DataManager(a),c=new Ze.Query;if(d||(c=o.generateQuery(c),(0,t.setValue)("query",c,s)),o.parent.trigger(L,(0,t.extend)(s,e)),(0,l.getObject)("cancel",s))return null;h.executeQuery(c).then(function(s){var d=null;return(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.dataSource)||(d=e.dataSource),e=o.manipulatePdfProperties(e,a,s),o.parent.grid.pdfExportModule.Map(o.parent.grid,e,i,r,n).then(function(t){null!=d?e.dataSource=d:delete e.dataSource,p(t)})})})},e.prototype.generateQuery=function(e,i){return!(0,t.isNullOrUndefined)(i)&&"CurrentPage"===i.exportType&&this.parent.allowPaging&&(i.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=(0,l.getObject)("grid.renderModule.data.pageQuery",this.parent)(e)),e},e.prototype.manipulatePdfProperties=function(e,i,r){var n={},o=!et(this.parent)&&st(this.parent);if((0,t.setValue)("query",this.parent.grid.getDataModule().generateQuery(!0),n),(0,t.setValue)("isExport",!0,n),(0,t.setValue)("isPdfExport",!0,n),(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.isCollapsedStatePersist)||(0,t.setValue)("isCollapsedStatePersist",e.isCollapsedStatePersist,n),(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.exportType)||(0,t.setValue)("exportType",e.exportType,n),o||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData((0,t.getValue)("result",r)),(0,t.setValue)("expresults",this.parent.flatData,n)),this.parent.notify("dataProcessor",n),n=this.dataResults,i=(0,t.isNullOrUndefined)(n.result)?this.parent.flatData.slice(0):n.result,o||(this.parent.flatData=[]),e&&e.dataSource&&o){var a=this.parent.flatData,s=e.dataSource instanceof Ze.DataManager?e.dataSource.dataSource.json:e.dataSource;this.parent.dataModule.convertToFlatData(s),i=this.parent.flatData,this.parent.flatData=a}return(e=(0,t.isNullOrUndefined)(e)?{}:e).dataSource=new Ze.DataManager({json:i}),e.query=n.query,e},e.prototype.pdfQueryCellInfo=function(e){if(this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex){var i={},r=(0,l.getObject)("data",e),n=(0,t.isNullOrUndefined)(r.filterLevel)?r.level:r.filterLevel;i.paragraphIndent=3*n,e.style=i}this.parent.notify("updateResults",e),this.parent.trigger("pdfQueryCellInfo",e)},e.prototype.pdfAggregateCellInfo=function(e){this.parent.trigger("pdfAggregateQueryCellInfo",e)},e}(),di=function(){function e(e){l.Grid.Inject(l.Page),this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on(K,this.collapseExpandPagedchilds,this),this.parent.on(W,this.pageAction,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(K,this.collapseExpandPagedchilds),this.parent.off(W,this.pageAction))},e.prototype.getModuleName=function(){return"pager"},e.prototype.refresh=function(){this.parent.grid.pagerModule.refresh()},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.goToPage=function(e){this.parent.grid.pagerModule.goToPage(e)},e.prototype.updateExternalMessage=function(e){if((0,t.isNullOrUndefined)(e)){this.parent.trigger(Ye,{error:"The provided value for the message is undefined. Please ensure the message contains string."})}this.parent.grid.pagerModule.updateExternalMessage(e)},e.prototype.collapseExpandPagedchilds=function(e){if(e.record.expanded="collapse"!==e.action,this.parent.flatData.map(function(t){return t.expanded=t.uniqueID===e.record.uniqueID&&t.expanded!==e.record.expanded?e.record.expanded:t.expanded}),this.parent.enableImmutableMode){var i=this.parent.getPrimaryKeyFieldNames()[0],r=this.parent.flatData.filter(function(t){return t[""+i]===e.record[""+i]});r.length&&(r[0].expanded=e.record.expanded)}var n={result:this.parent.flatData,row:e.row,action:e.action,record:e.record,count:this.parent.flatData.length};if((0,t.getValue)("grid.renderModule",this.parent).dataManagerSuccess(n),this.parent.enableImmutableMode){var o="action",a=void 0;"collapse"===n[""+o]?(a=n.row.getElementsByClassName("e-treegridexpand")[0],(0,t.isNullOrUndefined)(a)||((0,t.removeClass)([a],"e-treegridexpand"),(0,t.addClass)([a],"e-treegridcollapse"))):"expand"===n[""+o]&&(a=n.row.getElementsByClassName("e-treegridcollapse")[0],(0,t.isNullOrUndefined)(a)||((0,t.removeClass)([a],"e-treegridcollapse"),(0,t.addClass)([a],"e-treegridexpand")))}},e.prototype.pageRoot=function(e,i,r){for(var n=(0,t.isNullOrUndefined)(r)?[]:r,o=function(t){n.push(i[parseInt(t.toString(),10)]);var r=[];i[parseInt(t.toString(),10)].hasChildRecords&&(r=e.filter(function(e){return i[parseInt(t.toString(),10)].uniqueID===e.parentUniqueID}),n=a.pageRoot(e,r,n))},a=this,s=0;s<i.length;s++)o(s);return n},e.prototype.updatePageSize=function(e){var t=e.count,i=this.parent.grid.pagerModule;!0===this.parent.pageSettings.pageSizes&&i.pagerObj.pagerdropdownModule.dropDownListObject.value===i.pagerObj.getLocalizedLabel("All")&&(i.pagerObj.totalRecordsCount=t,this.parent.grid.pageSettings.pageSize=t)},e.prototype.pageAction=function(e){var t=this,i=new Ze.DataManager(e.result);if("Root"===this.parent.pageSettings.pageSizeMode){var r=[],n=this.parent.grid.filterSettings.columns.length>0&&("Child"===this.parent.filterSettings.hierarchyMode||"None"===this.parent.filterSettings.hierarchyMode)?"filterLevel":"level",o=(new Ze.Query).where(n,"equal",0);r=i.executeLocal(o),e.count=r.length;var a=(c=this.parent.grid.pageSettings.pageSize)*((u=this.parent.grid.pageSettings.currentPage)-1);o=o.skip(a).take(c),r=i.executeLocal(o);var s=this.pageRoot(e.result,r);e.result=s}else{var d=new Ze.DataManager(e.result),l=new Ze.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),p=d.executeLocal((new Ze.Query).where(l)),h=void 0;h=rt(this.parent)&&"collapse"!==e.actionArgs.action&&"expand"!==e.actionArgs.action?p:p.filter(function(e){return ot(t.parent,e,p)}),e.count=h.length;o=new Ze.Query;var c=this.parent.grid.pageSettings.pageSize;this.updatePageSize(e);var u=this.parent.grid.pageSettings.currentPage;h.length<u*c&&(u=(u=Math.floor(h.length/c)+(h.length%c?1:0))||1,this.parent.grid.setProperties({pageSettings:{currentPage:u}},!0));a=c*(u-1);o=o.skip(a).take(c),d.dataSource.json=h,e.result=d.executeLocal(o)}this.parent.notify("updateAction",e)},e}(),li=function(){function e(e){l.Grid.Inject(l.Toolbar),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"toolbar"},e.prototype.addEventListener=function(){this.parent.on(k,this.refreshToolbar,this),this.parent.on(V,this.refreshToolbar,this),this.parent.on(B,this.toolbarClickHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(k,this.refreshToolbar),this.parent.off(V,this.refreshToolbar),this.parent.off(B,this.toolbarClickHandler))},e.prototype.refreshToolbar=function(e){var i=this.parent.grid.toolbarModule.getToolbar();if(!(0,t.isNullOrUndefined)(i)){var r=this.parent,n=void 0,o=void 0,a=r.element.id+"_gridcontrol_indent",s=r.element.id+"_gridcontrol_outdent",d=i.querySelector("#"+a),l=i.querySelector("#"+s),p=e.row,h=r.getSelectedRows()[0];if((0,t.isNullOrUndefined)(p[0])||(p=p[0]),p=(0,t.isNullOrUndefined)(h)||h.rowIndex===p.rowIndex?p:h,null!==d&&null!==l){if(n=d.parentElement,o=l.parentElement,0===p.rowIndex||r.getSelectedRowIndexes().length>1)n.classList.add("e-hidden"),o.classList.add("e-hidden");else if("rowDeselected"!==e.name||!(0,t.isNullOrUndefined)(h)&&r.grid.isCheckBoxSelection){var c=r.getCurrentViewRecords()[p.rowIndex];(0,t.isNullOrUndefined)(c)||(c.level>r.getCurrentViewRecords()[p.rowIndex-1].level?n.classList.add("e-hidden"):n.classList.remove("e-hidden"),c.level===r.getCurrentViewRecords()[p.rowIndex-1].level&&n.classList.remove("e-hidden"),0===c.level&&o.classList.add("e-hidden"),0!==c.level&&o.classList.remove("e-hidden"))}"rowDeselected"===e.name&&(0,t.isNullOrUndefined)(h)&&!r.grid.isCheckBoxSelection&&(this.parent.toolbar.includes("Indent")&&n.classList.add("e-hidden"),this.parent.toolbar.includes("Outdent")&&o.classList.add("e-hidden"))}}},e.prototype.toolbarClickHandler=function(e){var i=this.parent,r="indentOutdentAction";"Cell"===this.parent.editSettings.mode&&"Batch"===this.parent.grid.editSettings.mode&&e.item.id===this.parent.grid.element.id+"_update"&&(e.cancel=!0,this.parent.grid.editModule.saveCell()),e.item.id===this.parent.grid.element.id+"_expandall"&&this.parent.expandAll(),e.item.id===this.parent.grid.element.id+"_collapseall"&&this.parent.collapseAll(),e.item.id===i.grid.element.id+"_indent"&&i.getSelectedRecords().length&&!(0,t.isNullOrUndefined)(i.rowDragAndDropModule)&&this.parent.rowDragAndDropModule[""+r](null,"indent"),e.item.id===i.grid.element.id+"_outdent"&&i.getSelectedRecords().length&&!(0,t.isNullOrUndefined)(i.rowDragAndDropModule)&&this.parent.rowDragAndDropModule[""+r](null,"outdent")},e.prototype.getToolbar=function(){return this.parent.grid.toolbarModule.getToolbar()},e.prototype.enableItems=function(e,t){this.parent.grid.toolbarModule.enableItems(e,t)},e.prototype.destroy=function(){this.removeEventListener()},e}(),pi=function(){function e(e){l.Grid.Inject(l.Aggregate),this.parent=e,this.flatChildRecords=[],this.summaryQuery=[]}return e.prototype.getModuleName=function(){return"summary"},e.prototype.removeEventListener=function(){this.parent.isDestroyed},e.prototype.calculateSummaryValue=function(e,i,r){var n;this.summaryQuery=e;var o,a=i.filter(function(e){return!(0,l.getObject)("isSummaryRow",e)}),s=nt(a),d=a.slice(),p=Object.keys(this.parent.aggregates).length,h=Object.keys(s).length,c=this.parent.getColumns();if(this.parent.aggregates.filter(function(e){return e.showChildSummary}).length){for(var u=0,g=h;u<g;u++)if(n=s[parseInt(u.toString(),10)],o=this.getChildRecordsLength(n,d)){for(var f=function(e,i){var a,s=void 0;s={};for(var p=0;p<c.length;p++){s[""+((0,t.isNullOrUndefined)((0,l.getObject)("field",c[parseInt(p.toString(),10)]))?c[parseInt(p.toString(),10)]:(0,l.getObject)("field",c[parseInt(p.toString(),10)]))]=null}if(s=y.createSummaryItem(s,y.parent.aggregates[e-1]),!y.parent.aggregates[e-1].showChildSummary)return"continue";d.map(function(e,t){e.uniqueID!==n.uniqueID||(a=t)});var h=a+o+e,u=(0,t.extend)({},n);delete u.childRecords,delete u[y.parent.childMapping],(0,t.setValue)("parentItem",u,s);var g=(0,l.getObject)("level",u);if((0,t.setValue)("level",g+1,s),(0,t.setValue)("isSummaryRow",!0,s),(0,t.setValue)("parentUniqueID",u.uniqueID,s),r){var f=(0,l.getObject)("childRecords",n);f.length&&f.push(s)}d.splice(h,0,s)},y=this,m=1,S=p;m<=S;m++)f(m);this.flatChildRecords=[]}}else{for(var v={},w=0,I=c.length;w<I;w++){v[""+((0,t.isNullOrUndefined)((0,l.getObject)("field",c[parseInt(w.toString(),10)]))?c[parseInt(w.toString(),10)]:(0,l.getObject)("field",c[parseInt(w.toString(),10)]))]=null}m=1;for(var R=p;m<=R;m++)this.createSummaryItem(v,this.parent.aggregates[m-1])}return d},e.prototype.getChildRecordsLength=function(e,i){for(var r,n=0,o=Object.keys(i).length;n<o;n++){if(r=i[parseInt(n.toString(),10)],e===((0,t.isNullOrUndefined)(r.parentItem)?null:i.filter(function(e){return e.uniqueID===r.parentItem.uniqueID})[0])){if(this.flatChildRecords.push(r),!(0,l.getObject)("hasChildRecords",r))continue;this.getChildRecordsLength(r,i)}}return this.flatChildRecords.length},e.prototype.createSummaryItem=function(e,i){for(var r=0,n=Object.keys(i.columns).length;r<n;r++)for(var o=(0,t.isNullOrUndefined)(i.columns[parseInt(r.toString(),10)].columnName)?i.columns[parseInt(r.toString(),10)].field:i.columns[parseInt(r.toString(),10)].columnName,a=0,s=Object.keys(e);a<s.length;a++){var d=s[a];if(d===o)if(this.flatChildRecords.length)e[""+d]=this.getSummaryValues(i.columns[parseInt(r.toString(),10)],this.flatChildRecords);else if(this.parent.isLocalData){var l=this.parent.dataSource instanceof Ze.DataManager?this.parent.dataSource.dataSource.json:this.parent.flatData;e[""+d]=this.getSummaryValues(i.columns[parseInt(r.toString(),10)],l)}}return e},e.prototype.getSummaryValues=function(e,i){var r=new Ze.Query,n={},o={},a=(0,t.isNullOrUndefined)(e.field)?void 0:this.parent.getColumnByField(e.field).type;e.setPropertiesSilent({format:this.getFormatFromType(e.format,a)}),e.setFormatter(this.parent.grid.locale);var s=e.getFormatter()||function(e){return e};e.setTemplate(o);var d=e.getTemplate(2);r.queries=this.summaryQuery,r.requiresCount();var p,h=new Ze.DataManager(i).executeLocal(r),c=e.type;c=[e.type];for(var u=0;u<c.length;u++){p=c[parseInt(u.toString(),10)];var g=e.field+" - "+c[parseInt(u.toString(),10)].toLowerCase(),f="Custom"!==c[parseInt(u.toString(),10)]?(0,l.getObject)("aggregates",h):(0,l.calculateAggregate)(c[parseInt(u.toString(),10)],h,e,this.parent),y=e.columnName,m="Custom"!==c[parseInt(u.toString(),10)]?f[""+g]:f;n[""+y]=n[""+y]||{},n[""+y][""+g]=m,n[""+y][c[parseInt(u.toString(),10)]]=(0,t.isNullOrUndefined)(f)?" ":s(m)}o.format=e.getFormatter();var S=(0,t.createElement)("td",{className:"e-summary"});if(this.parent.isReact&&"string"!=typeof e.footerTemplate){d.fn(n[e.columnName],this.parent,d.property,"",null,null,S),this.parent.renderReactTemplates()}else(0,l.appendChildren)(S,d.fn(n[e.columnName],this.parent,d.property));var v=n[""+e.columnName][""+p];return-1===S.innerHTML.indexOf(v)?S.innerHTML+v:S.innerHTML},e.prototype.getFormatFromType=function(e,i){if((0,t.isNullOrUndefined)(i)||"string"!=typeof e)return e;var r;switch(i){case"number":r={format:e};break;case"datetime":r={type:"dateTime",skeleton:e};break;case"date":r={type:i,skeleton:e}}return r},e.prototype.destroy=function(){this.removeEventListener()},e}(),hi=function(){function e(e){l.Grid.Inject(l.Sort),this.parent=e,this.taskIds=[],this.flatSortedData=[],this.storedIndex=-1,this.isSelfReference=!(0,t.isNullOrUndefined)(this.parent.parentIdMapping),this.addEventListener()}return e.prototype.getModuleName=function(){return"sort"},e.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this),this.parent.on("createSort",this.createdSortedRecords,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateModel",this.updateModel),this.parent.off("createSort",this.createdSortedRecords))},e.prototype.createdSortedRecords=function(e){var t=e.modifiedData,i=e.srtQry;this.iterateSort(t,i),this.storedIndex=-1,e.modifiedData=this.flatSortedData,this.flatSortedData=[]},e.prototype.iterateSort=function(e,i){var r=this.parent.query,n=[];(0,t.isNullOrUndefined)(r)||(n=r.queries.filter(function(e){return"onWhere"===e.fn}));for(var o=0;o<e.length;o++)if((n.length>0||this.parent.grid.filterSettings.columns.length>0||""!==this.parent.grid.searchSettings.key)&&(0,t.isNullOrUndefined)(pt(this.parent,e[parseInt(o.toString(),10)].uniqueID,!0))||(this.storedIndex++,this.flatSortedData[this.storedIndex]=e[parseInt(o.toString(),10)]),e[parseInt(o.toString(),10)].hasChildRecords){var a=new Ze.DataManager(e[parseInt(o.toString(),10)].childRecords).executeLocal(i);if(this.parent.allowRowDragAndDrop&&-1!==e[parseInt(o.toString(),10)].childRecords.indexOf(this.parent.rowDragAndDropModule.draggedRecord)&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition){var s=a.indexOf(this.parent.rowDragAndDropModule.draggedRecord);a.splice(s,1);var d=a.indexOf(this.parent.rowDragAndDropModule.droppedRecord);"topSegment"===this.parent.rowDragAndDropModule.dropPosition?a.splice(d,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&a.splice(d+1,0,this.parent.rowDragAndDropModule.draggedRecord)}this.iterateSort(a,i)}},e.prototype.sortColumn=function(e,t,i){this.parent.grid.sortColumn(e,t,i)},e.prototype.removeSortColumn=function(e){this.parent.grid.removeSortColumn(e)},e.prototype.updateModel=function(){this.parent.setProperties({sortSettings:(0,l.getActualProperties)(this.parent.grid.sortSettings)},!0)},e.prototype.clearSorting=function(){this.parent.grid.clearSorting(),this.updateModel()},e.prototype.destroy=function(){this.removeEventListener()},e}(),ci=function(){function e(e){l.Grid.Inject(l.ColumnMenu),this.parent=e}return e.prototype.getColumnMenu=function(){return this.parent.grid.columnMenuModule.getColumnMenu()},e.prototype.destroy=function(){},e.prototype.getModuleName=function(){return"columnMenu"},e}(),ui=function(){function e(e){l.Grid.Inject(l.ContextMenu),this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("contextMenuOpen",this.contextMenuOpen,this),this.parent.on("contextMenuClick",this.contextMenuClick,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("contextMenuOpen",this.contextMenuOpen),this.parent.off("contextMenuClick",this.contextMenuClick))},e.prototype.contextMenuOpen=function(e){var i=(0,t.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_AddRow",e.element),r=(0,t.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_Edit",e.element),n=(0,t.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_Indent",e.element),o=(0,t.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_Outdent",e.element);i&&(!1===this.parent.grid.editSettings.allowAdding||this.parent.grid.isEdit?i.style.display="none":i.style.display="block"),"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||(0,t.isNullOrUndefined)(r)||r.classList.contains("e-menu-hide")||(r.style.display="none");var a=this.parent,s=a.getSelectedRows()[0];if(!n&&!o||(0,t.isNullOrUndefined)(s)){if((n||o||a.grid.isEdit)&&(0,t.isNullOrUndefined)(s)){for(var d=0,l=e.items;d<l.length;d++){"Outdent"!==(g=l[d]).text&&"Indent"!==g.text||a.grid.contextMenuModule.hiddenItems.includes(g.text)||a.grid.contextMenuModule.hiddenItems.push(g.text)}a.grid.contextMenuModule.contextMenu.hideItems(a.grid.contextMenuModule.hiddenItems),(n||o)&&(n.style.display=o.style.display="none")}}else{var p=e.event.target.closest("td");if(!(0,t.isNullOrUndefined)(p)&&((0,t.isNullOrUndefined)(p)||p.classList.contains("e-rowcell")&&0===p.querySelectorAll(".e-gridform").length)){if(0===s.rowIndex||a.getSelectedRowIndexes().length>1)n.style.display=o.style.display="none";else if("rowDeselected"!==e.name||!(0,t.isNullOrUndefined)(s)&&a.grid.isCheckBoxSelection){var h=a.getCurrentViewRecords()[s.rowIndex];(0,t.isNullOrUndefined)(h)||(h.level>a.getCurrentViewRecords()[s.rowIndex-1].level?n.style.display="none":n.style.display="block",h.level===a.getCurrentViewRecords()[s.rowIndex-1].level&&(n.style.display="block"),0===h.level?o.style.display="none":o.style.display="block")}}else{for(var c=0,u=e.items;c<u.length;c++){var g;"Outdent"!==(g=u[c]).text&&"Indent"!==g.text||a.grid.contextMenuModule.hiddenItems.push(g.text)}a.grid.contextMenuModule.contextMenu.hideItems(a.grid.contextMenuModule.hiddenItems),n.style.display=o.style.display="none"}}},e.prototype.contextMenuClick=function(e){if("Above"!==e.item.id&&"Below"!==e.item.id&&"Child"!==e.item.id||(this.parent.notify("savePreviousRowPosition",e),this.parent.setProperties({editSettings:{newRowPosition:e.item.id}},!0),this.parent.editModule.isAddedRowByContextMenu=!0,this.parent.addRecord()),(e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Indent"||e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Outdent")&&!(0,t.isNullOrUndefined)(this.parent.rowDragAndDropModule)){var i=e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Indent"?"indent":"outdent";this.parent.rowDragAndDropModule.indentOutdentAction(null,i)}},e.prototype.getModuleName=function(){return"contextMenu"},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getContextMenu=function(){return this.parent.grid.contextMenuModule.getContextMenu()},e}(),gi=function(){function e(e){this.batchChildCount=0,this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.batchAddedRecords=[],this.batchDeletedRecords=[],this.batchAddRowRecord=[],this.parent=e,this.isSelfReference=!(0,t.isNullOrUndefined)(e.parentIdMapping),this.batchRecords=[],this.currentViewRecords=[],this.isAdd=!1,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on(ae,this.cellSaved,this),this.parent.on(pe,this.batchAdd,this),this.parent.on(ce,this.beforeBatchAdd,this),this.parent.on(ge,this.batchSave,this),this.parent.on(he,this.beforeBatchDelete,this),this.parent.on(ue,this.beforeBatchSave,this),this.parent.on("batchPageAction",this.batchPageAction,this),this.parent.on("batchCancelAction",this.batchCancelAction,this),this.parent.grid.on("immutable-batch-cancel",this.immutableBatchAction,this),this.parent.grid.on("next-cell-index",this.nextCellIndex,this),this.parent.grid.on("cellfocused",this.onCellFocused,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ae,this.cellSaved),this.parent.off(pe,this.batchAdd),this.parent.off(ge,this.batchSave),this.parent.off(ce,this.beforeBatchAdd),this.parent.off(he,this.beforeBatchDelete),this.parent.off(ue,this.beforeBatchSave),this.parent.off("batchPageAction",this.batchPageAction),this.parent.off("batchCancelAction",this.batchCancelAction),this.parent.grid.off("immutable-batch-cancel",this.immutableBatchAction),this.parent.grid.off("next-cell-index",this.nextCellIndex),this.parent.grid.off("cellfocused",this.onCellFocused))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getBatchRecords=function(){return this.batchRecords},e.prototype.getAddRowIndex=function(){return this.addRowIndex},e.prototype.getSelectedIndex=function(){return this.selectedIndex},e.prototype.getBatchChildCount=function(){return this.batchChildCount},e.prototype.batchPageAction=function(){var e,i=this,r=this.parent.grid.dataSource instanceof Ze.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,n=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!(0,t.isNullOrUndefined)(this.batchAddedRecords)&&this.batchAddedRecords.length)for(var o=function(t){e=r.findIndex(function(e){return e[""+n]===i.batchAddedRecords[parseInt(t.toString(),10)][""+n]}),r.splice(e,1)},a=0;a<this.batchAddedRecords.length;a++)o(a);this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.batchDeletedRecords=this.currentViewRecords=[]},e.prototype.cellSaved=function(e){if(e.column.index===this.parent.treeColumnIndex&&this.parent.renderModule.cellRender({data:e.rowData,cell:e.cell,column:this.parent.grid.getColumnByIndex(e.column.index)}),this.isAdd&&"Batch"===this.parent.editSettings.mode&&"Bottom"!==this.parent.editSettings.newRowPosition){var i=this.parent.grid.dataSource instanceof Ze.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,r=void 0,n=this.parent.grid.getPrimaryKeyFieldNames()[0],o=void 0,a=void 0,s="parentItem",d=this.selectedIndex>-1?this.batchRecords[parseInt(this.addRowIndex.toString(),10)][""+s]:null,p=void 0,h=void 0,c=void 0,u="Top"===this.parent.editSettings.newRowPosition||-1===this.selectedIndex?0:"Above"===this.parent.editSettings.newRowPosition?this.addRowIndex:this.addRowIndex+1;if(u=this.getActualRowObjectIndex(u),this.newBatchRowAdded){if(this.batchRecords.length&&(p=this.batchRecords[this.addRowIndex][this.parent.idMapping],c=this.batchRecords[this.addRowIndex][this.parent.parentIdMapping],this.batchRecords[parseInt(this.addRowIndex.toString(),10)][""+s]&&(h=this.batchRecords[parseInt(this.addRowIndex.toString(),10)][""+s].uniqueID)),this.batchAddedRecords=dt(this.batchAddedRecords),this.batchAddRowRecord=dt(this.batchAddRowRecord),this.batchAddRowRecord.push(this.batchRecords[this.addRowIndex]),r=this.parent.grid.getRowsObject()[parseInt(u.toString(),10)].changes,!(0,t.isNullOrUndefined)(r)&&(r.uniqueID=(0,l.getUid)(this.parent.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+r.uniqueID,r,this.parent),!Object.prototype.hasOwnProperty.call(r,"level"))){if(this.batchIndex=-1===this.selectedIndex?0:this.batchIndex,"Child"===this.parent.editSettings.newRowPosition){if(r.primaryParent=d,this.selectedIndex>-1){r.parentItem=(0,t.extend)({},this.batchRecords[this.addRowIndex]),r.parentUniqueID=r.parentItem.uniqueID,delete r.parentItem.childRecords,delete r.parentItem[this.parent.childMapping],r.level=r.parentItem.level+1,r.index=this.batchIndex;var g=at(this.batchRecords[this.addRowIndex]).length,f=at(this.batchRecords[this.addRowIndex])[g-1];f=(0,t.isNullOrUndefined)(f)?this.batchRecords[this.addRowIndex]:f,o=i.map(function(e){return e[""+n]}).indexOf(f[""+n]),this.isSelfReference&&(r[this.parent.parentIdMapping]=p),Ft(n,r.parentItem,"add",this.parent,this.isSelfReference,r)}}else if(("Above"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition)&&!(0,t.isNullOrUndefined)(this.batchRecords[this.addRowIndex])){if(r.level=this.batchRecords[parseInt(this.addRowIndex.toString(),10)].level,r.level&&this.selectedIndex>-1&&(r.parentItem=d,r.parentUniqueID=h,delete r.parentItem.childRecords,delete r.parentItem[this.parent.childMapping]),r.index="Below"===this.parent.editSettings.newRowPosition?this.batchIndex:this.batchIndex-1,"Below"===this.parent.editSettings.newRowPosition&&this.selectedIndex>-1){g=at(this.batchRecords[this.addRowIndex]).length,f=at(this.batchRecords[this.addRowIndex])[g-1];f=(0,t.isNullOrUndefined)(f)?this.batchRecords[this.addRowIndex]:f,o=i.map(function(e){return e[""+n]}).indexOf(f[""+n])}if("Above"===this.parent.editSettings.newRowPosition&&this.selectedIndex>-1){f=this.batchRecords[this.addRowIndex];o=i.map(function(e){return e[""+n]}).indexOf(f[""+n])}this.isSelfReference&&(r[this.parent.parentIdMapping]=c)}r.index=-1===r.index?0:r.index,r.hasChildRecords=!1,r.childRecords=[],this.batchRecords.splice(r.index,0,r),this.currentViewRecords.splice(r.index,0,r),a=o||r.index,"Above"!==this.parent.editSettings.newRowPosition&&(a=0===r.index?a:a+1),i.splice(a,0,r),this.batchAddedRecords.push(r)}this.parent.grid.getRowsObject()[parseInt(u.toString(),10)].data=r,this.newBatchRowAdded=!1}}},e.prototype.beforeBatchAdd=function(e){var i="isTabLastRow";if("Cell"===this.parent.editSettings.mode&&this.parent.editModule[""+i])return e.cancel=!0,void(this.parent.editModule[""+i]=!1);!this.parent.editModule.isAddedRowByMethod||(0,t.isNullOrUndefined)(this.parent.editModule.addRowIndex)||this.parent.editModule.isAddedRowByContextMenu||-1!==this.parent.grid.selectedRowIndex&&!this.parent.editModule.batchEditModule.isAdd?(this.selectedIndex=this.parent.grid.selectedRowIndex,this.addRowIndex=this.parent.grid.selectedRowIndex>-1?this.parent.grid.selectedRowIndex:0,this.parent.editModule.addRowIndex=this.parent.grid.selectedRowIndex>-1?this.parent.grid.selectedRowIndex:0,this.addRowRecord=this.parent.getSelectedRecords()[0]):(this.selectedIndex=this.parent.editModule.selectedIndex,this.addRowIndex=this.parent.editModule.addRowIndex,this.addRowRecord=this.batchRecords.length?this.batchRecords[this.selectedIndex]:this.parent.getCurrentViewRecords()[this.selectedIndex])},e.prototype.batchAdd=function(e){if("Bottom"!==this.parent.editSettings.newRowPosition){this.isAdd=!0,this.newBatchRowAdded=!0;var i=0;if(this.batchRecords.length||(this.batchAddedRecords=[],this.batchRecords=dt(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=dt(this.parent.grid.getCurrentViewRecords())),this.parent.editModule.isAddedRowByMethod&&!(0,t.isNullOrUndefined)(this.parent.editModule.addRowIndex)&&(0,t.classList)(this.parent.grid.getDataRows()[0],["e-batchrow"],[]),"Top"!==this.parent.editSettings.newRowPosition){var r=this.parent.grid.getCurrentViewRecords();"Batch"===this.parent.editSettings.mode&&(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)&&(r=this.batchRecords),this.updateChildCount(r),this.parent.notify(re,{}),this.batchChildCount=0}this.updateRowIndex();var n=(0,t.getValue)("focusModule",this.parent.grid),o=this.parent.getContentTable();if(this.parent.getBatchChanges()[this.deletedRecords].length&&"Above"===this.parent.editSettings.newRowPosition?(i=e.row.rowIndex,n.getContent().matrix.matrix=this.matrix):i=o.getElementsByClassName("e-batchrow")[0].rowIndex,n.getContent().matrix.current=[i,n.getContent().matrix.current[1]],this.parent.editModule.isAddedRowByMethod&&!(0,t.isNullOrUndefined)(this.parent.editModule.addRowIndex)&&!this.parent.editModule.isAddedRowByContextMenu){var a=this.parent.getBatchChanges().addedRecords,s=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[a.length-1].getAttribute("aria-rowindex"),10)-1;this.batchRecords.splice(s,0,a[a.length-1])}}},e.prototype.beforeBatchDelete=function(e){this.batchRecords.length||(this.batchRecords=dt(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=dt(this.parent.grid.getCurrentViewRecords()));var i=(0,t.getValue)("focusModule",this.parent.grid);this.matrix=i.getContent().matrix.matrix;var r,n,o,a,s=[],d=this.parent.grid.getPrimaryKeyFieldNames()[0],l=Array.isArray(e.row)?e.row[0]:e.row;(0,t.isNullOrUndefined)(l)||-1!==this.parent.getSelectedRows().indexOf(l)?(o=at(n=this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length-1]),a=this.parent.getSelectedRows()[0].getAttribute("data-uid")):(o=at(n=e.rowData),a=l.getAttribute("data-uid"));var p=parseInt(this.parent.grid.getRowElementByUID(a).getAttribute("aria-rowindex"),10)-1;if(o.length)for(var h=p+o.length,c=p+1;c<=h;c++)s.push(this.parent.grid.getDataRows()[parseInt(c.toString(),10)]),(this.parent.frozenRows||this.parent.frozenColumns||this.parent.getFrozenColumns())&&s.push(this.parent.grid.getHeaderContent()[parseInt(c.toString(),10)]);if(!(0,t.isNullOrUndefined)(n.parentItem)){var u=pt(this.parent,n.parentItem.uniqueID);if(!(0,t.isNullOrUndefined)(u)&&u.hasChildRecords){var g=u.childRecords.indexOf(n);u.childRecords.splice(g,1)}this.batchDeletedRecords=dt(this.batchDeletedRecords),this.batchDeletedRecords.push(n)}o.push(n),r=o;var f=function(e){var t=y.batchRecords.findIndex(function(t){return t[""+d]===r[parseInt(e.toString(),10)][""+d]});-1!==t&&y.batchRecords.splice(t,1)},y=this;for(c=0;c<r.length;c++)f(c);for(c=0;c<s.length;c++)(0,t.isNullOrUndefined)(s[parseInt(c.toString(),10)])||this.parent.grid.selectionModule.selectedRecords.push(s[parseInt(c.toString(),10)])},e.prototype.updateRowIndex=function(){for(var e=this.parent.grid.getDataRows(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].setAttribute("aria-rowindex",(t+1).toString())},e.prototype.updateChildCount=function(e){for(var i=this.parent.grid.getPrimaryKeyFieldNames()[0],r=this.parent.getBatchChanges().addedRecords||[],n="Child"===this.parent.editSettings.newRowPosition?"primaryParent":"parentItem",o=0;o<r.length;o++)(0,t.isNullOrUndefined)(r[parseInt(o.toString(),10)][""+n])||r[parseInt(o.toString(),10)][""+n][""+i]===e[parseInt(this.addRowIndex.toString(),10)][""+i]&&(this.batchChildCount=this.batchChildCount+1)},e.prototype.beforeBatchSave=function(e){var t="changedRecords",i="deletedRecords",r=e.batchChanges[""+t];if(e.batchChanges[""+t].length)for(var n=0;n<r.length;n++)zt({value:r[parseInt(n.toString(),10)],action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,undefined);if(e.batchChanges[""+i].length){var o=e.batchChanges[""+i];for(n=0;n<o.length;n++){this.deleteUniqueID(o[parseInt(n.toString(),10)].uniqueID);for(var a=at(o[parseInt(n.toString(),10)]),s=0;s<a.length;s++)this.deleteUniqueID(a[parseInt(s.toString(),10)].uniqueID);e.batchChanges[""+i]=e.batchChanges[""+i].concat(a)}}this.isAdd=!1},e.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},e.prototype.batchCancelAction=function(){var e,i=this,r="targetElement",n="parentItem",o="index",a=this.parent.grid.getCurrentViewRecords(),s="childRecords",d=this.parent.grid.dataSource instanceof Ze.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,l=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!(0,t.isNullOrUndefined)(this.batchAddedRecords))for(var p=function(r){if(-1!==(e=d.findIndex(function(e){return e[""+l]===i.batchAddedRecords[parseInt(r.toString(),10)][""+l]}))&&d.splice(e,1),"Child"===h.parent.editSettings.newRowPosition&&(e=a.map(function(e){return e[""+l]}).indexOf(h.batchAddedRecords[parseInt(r.toString(),10)][""+n]?h.batchAddedRecords[parseInt(r.toString(),10)][""+n][""+l]:h.batchAddedRecords[parseInt(r.toString(),10)][""+l]),!(0,t.isNullOrUndefined)(a[parseInt(e.toString(),10)])))for(var o=a[parseInt(e.toString(),10)][""+s],p=0;o&&p<o.length;p++)o[parseInt(p.toString(),10)][""+l]===h.batchAddedRecords[parseInt(r.toString(),10)][""+l]&&o.splice(p,1)},h=this,c=0;c<this.batchAddedRecords.length;c++)p(c);if(!(0,t.isNullOrUndefined)(this.parent[""+r])){var u=this.parent[""+r].closest("tr");this.parent.collapseRow(u),this.parent[""+r]=null}if(!(0,t.isNullOrUndefined)(this.batchDeletedRecords))for(c=0;c<this.batchDeletedRecords.length;c++)if(!(0,t.isNullOrUndefined)(this.batchDeletedRecords[parseInt(c.toString(),10)][""+n])){e=a.map(function(e){return e[""+l]}).indexOf(this.batchDeletedRecords[parseInt(c.toString(),10)][""+n][""+l]);var g=0===this.batchDeletedRecords[parseInt(c.toString(),10)][""+o]?this.batchDeletedRecords[parseInt(c.toString(),10)][""+o]:this.batchDeletedRecords[parseInt(c.toString(),10)][""+o]-1;(0,t.isNullOrUndefined)(a[parseInt(e.toString(),10)])||a[parseInt(e.toString(),10)][""+s].splice(g,0,this.batchDeletedRecords[parseInt(c.toString(),10)])}this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.currentViewRecords=[],this.batchRecords=dt(this.parent.grid.getCurrentViewRecords()),this.batchIndex=0,this.currentViewRecords=dt(this.parent.grid.getCurrentViewRecords()),this.batchDeletedRecords=[],this.parent.grid.renderModule.refresh()},e.prototype.batchSave=function(e){if("Batch"===this.parent.editSettings.mode){var i,r=void 0,n=Object.hasOwnProperty.call(e,"updatedRecords")?e.updatedRecords:this.parent.getBatchChanges(),o="deletedRecords",a=this.parent.grid.dataSource instanceof Ze.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,s=this.parent.grid.getCurrentViewRecords(),d=this.parent.grid.getPrimaryKeyFieldNames()[0],l=n.addedRecords,p="parentItem",h=void 0,c=void 0,u=void 0,g="childRecords";if(l.length>1&&"Bottom"!==this.parent.editSettings.newRowPosition&&l.reverse(),"Bottom"!==this.parent.editSettings.newRowPosition&&!Object.hasOwnProperty.call(e,"updatedRecords")){if(a.splice(a.length-l.length,l.length),this.parent.editModule.isAddedRowByMethod&&l.length&&!(0,t.isNullOrUndefined)(this.parent.editModule.addRowIndex)&&!this.parent.editModule.isAddedRowByContextMenu){l.reverse();for(var f=0;f<l.length;f++){var y=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[parseInt(f.toString(),10)].getAttribute("aria-rowindex"),10)-1;a.splice(y,0,l[parseInt(f.toString(),10)])}}if(this.parent.allowPaging||a.length===s.length){var m=dt(a);if(m.length){var S=m.map(function(e){return e[""+d]}).indexOf(s[0][""+d]),v=S+this.parent.grid.pageSettings.pageSize;s=m.splice(S,v)}}else s.length>l.length&&s.splice(s.length-l.length,l.length)}for(0===this.batchAddRowRecord.length&&this.batchAddRowRecord.push(this.parent.flatData[e.index]),this.parent.editModule.isAddedRowByContextMenu&&l.reverse(),r=0;r<l.length;r++){var w=(0,t.extend)({},l[parseInt(r.toString(),10)]);if(delete w.parentItem,delete w.uniqueID,delete w.index,delete w.level,delete w.hasChildRecords,delete w.childRecords,delete w.parentUniqueID,(0,t.isNullOrUndefined)(w.primaryParent)||delete w.primaryParent,l.length>1&&this.parent.editModule.isAddedRowByContextMenu){var I=this.parent.editSettings.newRowPosition;this.parent.editSettings.newRowPosition=this.parent.editModule.previousNewRowPosition,this.parent.editModule.previousNewRowPosition=I}if(l[parseInt(r.toString(),10)].taskData=w,i=this.batchAddRowRecord[parseInt(r.toString(),10)],(0,t.isNullOrUndefined)(i)&&(i=this.batchAddRowRecord[r-1]),this.isSelfReference&&((0,t.isNullOrUndefined)(l[parseInt(r.toString(),10)].parentItem)||Ft(d,l[parseInt(r.toString(),10)].parentItem,"add",this.parent,this.isSelfReference,l[parseInt(r.toString(),10)])),(0,t.isNullOrUndefined)(i)||(c=i.index),(0,t.isNullOrUndefined)(l[parseInt(r.toString(),10)].index)&&(c=0),"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition&&(0,t.isNullOrUndefined)(l[parseInt(r.toString(),10)].parentItem)&&-1===this.selectedIndex&&(h=-1,i=null),zt({value:l[parseInt(r.toString(),10)],action:"add"},this.parent,this.isSelfReference,c,h,u,i),h=null,"Child"===this.parent.editSettings.newRowPosition&&!(0,t.isNullOrUndefined)(l[parseInt(r.toString(),10)][""+p])&&((0,t.isNullOrUndefined)(this.parent.editModule.addRowIndex)||this.isSelfReference)){var R=s.map(function(e){return e[""+d]}).indexOf(l[parseInt(r.toString(),10)][""+p][""+d]),x=s[parseInt(R.toString(),10)][""+g];if(!(0,t.isNullOrUndefined)(c)&&x.some(function(e){return e.uniqueID===i.uniqueID}))for(var C=0;C<x.length;C++)x[parseInt(C.toString(),10)][""+d]===l[parseInt(r.toString(),10)][""+d]&&s[parseInt(R.toString(),10)][""+g].splice(C,1)}}if(n[""+o].length)for(r=0;r<n[""+o].length;r++)zt({value:n[""+o][parseInt(r.toString(),10)],action:"delete"},this.parent,this.isSelfReference,c,h,u,i);this.parent.parentData=[];for(var b=0;b<a.length;b++)a[parseInt(b.toString(),10)].index=b,(0,t.setValue)("uniqueIDCollection."+a[parseInt(b.toString(),10)].uniqueID+".index",b,this.parent),a[parseInt(b.toString(),10)].level||this.parent.parentData.push(a[parseInt(b.toString(),10)])}this.batchAddRowRecord=this.batchAddedRecords=this.batchRecords=this.batchDeletedRecords=this.currentViewRecords=[],this.parent.editModule.isAddedRowByContextMenu&&(this.parent.editModule.isAddedRowByContextMenu=!1)},e.prototype.getActualRowObjectIndex=function(e){var i=this.parent.grid.getDataRows();if(("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&this.selectedIndex>-1){if(!(0,t.isNullOrUndefined)(this.batchRecords[this.addRowIndex])&&this.batchRecords[this.addRowIndex].expanded)if(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length){if(e+=at(this.batchRecords[this.addRowIndex]).length,"Child"!==this.parent.editSettings.newRowPosition)e+=this.getBatchChildCount()}else e+=at(this.batchRecords[this.addRowIndex]).length;e>=i.length&&(e=i.length-1),this.updateChildCount(this.parent.grid.getCurrentViewRecords()),this.batchChildCount&&(e+=this.batchChildCount),this.batchChildCount=0}return e},e.prototype.immutableBatchAction=function(e){e.args.cancel=!0;var t=this.parent.grid.getBatchChanges(),i=[];Object.keys(t).length&&(i=t.addedRecords);for(var r=0;r<i.length;r++)e.rows.splice(i[parseInt(r.toString(),10)].index,1)},e.prototype.nextCellIndex=function(e){var t="index",i=this.parent.getBatchChanges().deletedRecords;this.parent.getSelectedRows().length?this.isAdd&&i.length>0?e[""+t]=this.parent.getSelectedRecords()[0][""+t]:e[""+t]=this.parent.getSelectedRows()[0].rowIndex:e[""+t]=this.batchIndex},e.prototype.onCellFocused=function(e){if("Cell"===this.parent.editSettings.mode&&this.parent.grid.isEdit&&e.keyArgs&&"shiftEnter"===e.keyArgs.action)return e.keyArgs.preventDefault(),void this.parent.endEdit()},e}(),fi=function(){function e(e){this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.prevAriaRowIndex="-1",this.isAddedRowByMethod=!1,this.isAddedRowByContextMenu=!1,this.isIndexUndefined=!1,l.Grid.Inject(l.Edit),this.parent=e,this.isSelfReference=!(0,t.isNullOrUndefined)(e.parentIdMapping),this.previousNewRowPosition=null,this.internalProperties={},this.batchEditModule=new gi(this.parent),this.addEventListener()}return e.prototype.getModuleName=function(){return"edit"},e.prototype.addEventListener=function(){this.parent.on(te,this.crudAction,this),this.parent.on(ie,this.beginEdit,this),this.parent.on(re,this.beginAdd,this),this.parent.on(ne,this.recordDoubleClick,this),this.parent.on(oe,this.cellSave,this),this.parent.on(le,this.batchCancel,this),this.parent.grid.on(fe,this.keyPressed,this),this.parent.grid.on("batchedit-form",this.lastCellTab,this),this.parent.grid.on("content-ready",this.contentready,this),this.parent.on(se,this.cellEdit,this),this.parent.on("actionBegin",this.editActionEvents,this),this.parent.on("actionComplete",this.editActionEvents,this),this.parent.grid.on(me,this.recordDoubleClick,this),this.parent.grid.on("dblclick",this.gridDblClick,this),this.parent.grid.on("recordAdded",this.customCellSave,this),this.parent.on("savePreviousRowPosition",this.savePreviousRowPosition,this),this.parent.grid.on(xe,this.beforeStartEdit,this),this.parent.grid.on(Ce,this.beforeBatchCancel,this),this.parent.grid.on("reset-edit-props",this.resetIsOnBatch,this),this.parent.grid.on("get-row-position",this.getRowPosition,this)},e.prototype.gridDblClick=function(e){if(this.doubleClickTarget=e.target,e.target.classList.contains("e-frame")&&0===this.parent.getCurrentViewRecords().length&&(this.doubleClickTarget=null),e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-treegridexpand")){var i=(0,l.parentsUntil)(e.target,"e-row"),r=i&&parseInt(i.getAttribute("aria-rowindex"),10)-1;!(0,t.isNullOrUndefined)(r)&&r>=0&&this.parent.allowPaging&&(this.parent.grid.getDataRows()[r].dataset.uid=this.parent.grid.contentModule.getRows()[r].uid)}},e.prototype.getRowPosition=function(e){e.newRowPosition=this.parent.editSettings.newRowPosition,e.addRowIndex=this.addRowIndex,e.dataRowIndex=+this.prevAriaRowIndex},e.prototype.beforeStartEdit=function(e){"Cell"===this.parent.editSettings.mode&&this.parent.trigger(E,e)},e.prototype.beforeBatchCancel=function(e){"Cell"===this.parent.editSettings.mode&&(e.requestType="cancel",this.parent.trigger(U,e))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(te,this.crudAction),this.parent.off(ie,this.beginEdit),this.parent.off(re,this.beginAdd),this.parent.off(ne,this.recordDoubleClick),this.parent.off(le,this.batchCancel),this.parent.grid.off(fe,this.keyPressed),this.parent.grid.off("batchedit-form",this.lastCellTab),this.parent.grid.off("content-ready",this.contentready),this.parent.off(se,this.cellEdit),this.parent.off("actionBegin",this.editActionEvents),this.parent.off("actionComplete",this.editActionEvents),this.parent.grid.off("recordAdded",this.customCellSave),this.parent.grid.off(me,this.recordDoubleClick),this.parent.off("savePreviousRowPosition",this.savePreviousRowPosition),this.parent.grid.off(xe,this.beforeStartEdit),this.parent.grid.off(Ce,this.beforeBatchCancel),this.parent.grid.off("dblclick",this.gridDblClick),this.parent.grid.off("reset-edit-props",this.resetIsOnBatch),this.parent.grid.off("get-row-position",this.getRowPosition))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.applyFormValidation=function(e){this.parent.grid.editModule.applyFormValidation(e)},e.prototype.editActionEvents=function(e){var i=(0,l.getObject)("editAction",e),r=(0,l.getObject)("name",i),n=this.parent,o=!(0,t.isNullOrUndefined)(n.dataSource)&&n.dataSource.adaptor;if(!(0,t.isNullOrUndefined)(o)&&(et(n)||o instanceof Ze.RemoteSaveAdaptor)&&"save"===i.requestType&&"add"===i.action&&("Child"===n.editSettings.newRowPosition||"Below"===n.editSettings.newRowPosition||"Above"===n.editSettings.newRowPosition))if("actionBegin"===r){var a=(0,t.isNullOrUndefined)(i.row)||!Object.keys(i.row).length?this.selectedIndex:i.row.rowIndex-1,s=(0,t.isNullOrUndefined)(a)||-1===a?-1:n.getCurrentViewRecords()[parseInt(a.toString(),10)][n.getPrimaryKeyFieldNames()[0]];n.grid.query.addParams("relationalKey",s)}else if("actionComplete"===r)for(var d=n.grid.query.params.length,p=0;p<d;p++)"relationalKey"===n.grid.query.params[parseInt(p.toString(),10)].key&&n.grid.query.params.splice(p);this.parent.enableInfiniteScrolling&&"actionComplete"===r&&this.infiniteAddAction(i),"Batch"===this.parent.editSettings.mode&&"paging"===i.requestType&&this.parent.notify("batchPageAction",{})},e.prototype.infiniteAddAction=function(e){if("save"===e.requestType&&"add"===e.action||"delete"===e.requestType){if("Top"!==this.parent.editSettings.newRowPosition&&-1!==this.selectedIndex&&"save"===e.requestType&&"add"===e.action){var t=this.parent.grid.getRowsObject(),i=t.splice(0,1)[0],r=this.addRowIndex,n=this.parent.getCurrentViewRecords();"Below"!==this.parent.editSettings.newRowPosition&&"Child"!==this.parent.editSettings.newRowPosition||(r+=at(n[r+1]).length),r="Below"===this.parent.editSettings.newRowPosition?r+1:r,t.splice(r,0,i);var o=n.splice(0,1)[0];n.splice(r,0,o),this.updateInfiniteCurrentViewData(o,this.addRowIndex)}var a=this.parent.grid.getRows(),s=this.parent.grid.getRowsObject(),d=this.parent.infiniteScrollSettings.enableCache;d||((0,l.resetRowIndex)(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0),this.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords())),!d&&this.parent.getFrozenColumns()>0&&((0,l.resetRowIndex)(this.parent.grid,s,a,0),this.updateIndex(this.parent.grid.dataSource,a,this.parent.getCurrentViewRecords()))}},e.prototype.updateInfiniteCurrentViewData=function(e,i){var r=this,n=Math.ceil(i/this.parent.grid.pageSettings.pageSize),o=n>0?n:1,a=i-(o-1)*this.parent.pageSettings.pageSize,s=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData;s[1].splice(0,1);var d=s[parseInt(o.toString(),10)];(0,t.isNullOrUndefined)(this.addRowRecord)||(d.filter(function(e,t){e.uniqueID===r.addRowRecord.uniqueID&&(a=t)}),(this.addRowRecord.hasChildRecords&&this.addRowRecord.childRecords.length&&"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(a+=at(this.addRowRecord).length)),a>=this.parent.pageSettings.pageSize&&(o+=1,d=s[parseInt(o.toString(),10)],a=a-this.parent.pageSettings.pageSize>=0?a-this.parent.pageSettings.pageSize:0),a="Below"===this.parent.editSettings.newRowPosition?a+1:a,d.splice(a,0,e),this.parent.grid.infiniteScrollModule.updateCurrentViewData()},e.prototype.recordDoubleClick=function(e){var i=e.target;if(!(0,t.isNullOrUndefined)(i.closest("td.e-rowcell"))&&this.parent.grid.editSettings.allowEditing&&!this.parent.grid.isEdit){var r=this.parent.grid.getColumnByIndex(+i.closest("td.e-rowcell").getAttribute("aria-colindex")-1);if("Cell"===this.parent.editSettings.mode&&!this.isOnBatch&&r&&!r.isPrimaryKey&&this.parent.editSettings.allowEditing&&r.allowEditing&&!i.classList.contains("e-treegridexpand")&&!i.classList.contains("e-treegridcollapse")&&this.parent.editSettings.allowEditOnDblClick){if(this.isOnBatch=!0,this.parent.grid.setProperties({selectedRowIndex:e.rowIndex},!0),this.parent.enableVirtualization){var n=(0,l.parentsUntil)(e.target,"e-row");this.prevAriaRowIndex=n.getAttribute("aria-rowindex"),n.setAttribute("aria-rowindex",n.rowIndex+1+"")}this.updateGridEditMode("Batch")}else"Cell"!==this.parent.editSettings.mode||r.allowEditing&&!r.isPrimaryKey||(this.isOnBatch=!0,this.updateGridEditMode("Batch"))}},e.prototype.updateGridEditMode=function(e){this.parent.grid.setProperties({editSettings:{mode:e}},!0),(0,l.getObject)("updateEditObj",this.parent.grid.editModule).apply(this.parent.grid.editModule),this.parent.grid.isEdit=!1},e.prototype.resetIsOnBatch=function(){this.parent.enableVirtualization&&"Cell"===this.parent.editSettings.mode&&(this.isOnBatch=!1,this.updateGridEditMode("Normal"))},e.prototype.keyPressed=function(e){(this.isOnBatch||"tab"===e.action||"shiftTab"===e.action)&&(this.keyPress=e.action),"f2"===e.action&&this.recordDoubleClick(e),"escape"===e.action&&this.closeEdit()},e.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},e.prototype.cellEdit=function(e){var i=this,r="promise",n=e[""+r];if(delete e[""+r],this.parent.enableVirtualization&&!(0,t.isNullOrUndefined)(this.prevAriaRowIndex)&&"-1"!==this.prevAriaRowIndex&&(e.row.setAttribute("aria-rowindex",this.prevAriaRowIndex),this.prevAriaRowIndex=void 0),"enter"!==this.keyPress&&this.parent.trigger(se,e,function(e){e.cancel||"Cell"!==i.parent.editSettings.mode?e.cancel&&"Cell"===i.parent.editSettings.mode&&(i.isOnBatch=!1,i.updateGridEditMode("Normal")):i.enableToolbarItems("edit"),(0,t.isNullOrUndefined)(n)||n.resolve(e)}),this.doubleClickTarget&&(this.doubleClickTarget.classList.contains("e-treegridexpand")||this.doubleClickTarget.classList.contains("e-treegridcollapse")||this.doubleClickTarget.classList.contains("e-summarycell")))return e.cancel=!0,void(this.doubleClickTarget=null);"Cell"===this.parent.editSettings.mode&&("tab"===this.keyPress||"shiftTab"===this.keyPress?this.keyPress=null:"enter"===this.keyPress&&(e.cancel=!0,this.keyPress=null,(0,t.setValue)("isEditCollapse",!1,this.parent)),e.columnObject.allowEditing||(e.cancel=!0)),this.parent.enableVirtualization&&(this.parent.grid.contentModule.editedRowIndex=this.parent.grid.editModule.editModule.index)},e.prototype.enableToolbarItems=function(e){if(!(0,t.isNullOrUndefined)(this.parent.grid.toolbarModule)){var i=this.parent.element.id+"_gridcontrol_";this.parent.grid.toolbarModule.enableItems([i+"add",i+"edit",i+"delete"],"save"===e),this.parent.grid.toolbarModule.enableItems([i+"update",i+"cancel"],"edit"===e)}},e.prototype.batchCancel=function(){if("Cell"===this.parent.editSettings.mode){var e=(0,t.getValue)("editModule.cellDetails",this.parent.grid.editModule);(0,t.isNullOrUndefined)(this.editedRowIndex)||(e.rowIndex=this.editedRowIndex);var i=this.parent.getCellFromIndex(e.rowIndex,this.parent.treeColumnIndex);this.parent.renderModule.cellRender({data:e.rowData,cell:i,column:this.parent.grid.getColumns()[this.parent.treeColumnIndex]}),this.updateGridEditMode("Normal"),this.isOnBatch=!1}"Batch"===this.parent.editSettings.mode&&this.parent.notify("batchCancelAction",{})},e.prototype.customCellSave=function(e){tt(this.parent)&&"Cell"===this.parent.editSettings.mode&&"edit"===e.action&&(this.updateCell(e,e.rowIndex),this.afterCellSave(e,e.row))},e.prototype.cellSave=function(e){var i=this;if("Cell"===this.parent.editSettings.mode&&this.parent.element.querySelector("form")){e.cancel=!0;var r,n;(0,t.setValue)("isEditCollapse",!0,this.parent),e.rowData[e.columnName]=e.value,r=(0,t.isNullOrUndefined)(e.cell)?this.parent.grid.editModule.editModule.form.parentElement.parentNode:e.cell.parentNode;var o=this.parent.getPrimaryKeyFieldNames();if((0,t.isNullOrUndefined)(r))this.parent.grid.getCurrentViewRecords().filter(function(t,i){t[o[0]]!==e.rowData[o[0]]||(n=i)});else{var a=this.parent.getFrozenLeftColumnsCount()>0||this.parent.getFrozenRightColumnsCount()>0;n=a?(this.parent.getRows().indexOf(r),this.parent.getRows().indexOf(r)):-1===this.parent.getRows().indexOf(r)&&this.parent.getFrozenColumns()>0?this.parent.grid.getRows().indexOf(r):this.parent.getRows().indexOf(r)}var s={};if((0,t.extend)(s,e),s.cancel=!1,s.type="save",r=this.parent.grid.getRows()[r.rowIndex],this.parent.trigger(E,s),s.cancel)this.parent.grid.isEdit=!0;else if(r.rowIndex===this.parent.getCurrentViewRecords().length-1&&"tab"===this.keyPress&&(this.isTabLastRow=!0),et(this.parent)||this.parent.dataSource instanceof Ze.DataManager&&this.parent.dataSource.adaptor instanceof Ze.RemoteSaveAdaptor){if(et(this.parent)||this.parent.dataSource instanceof Ze.DataManager&&this.parent.dataSource.adaptor instanceof Ze.RemoteSaveAdaptor){var d=this.parent.grid.query;if(this.parent.isGantt&&this.parent.loadChildOnDemand)this.updateCell(e,n),(0,t.setValue)("isEdit",!1,this.parent.grid),this.afterCellSave(e,r);else{this.parent.grid.dataSource.update(o[0],e.rowData,d.fromTable,d,e.previousValue).then(function(o){(0,t.isNullOrUndefined)(o)||(e.rowData[e.columnName]=o[e.columnName]),i.updateCell(e,n),(0,t.setValue)("isEdit",!1,i.parent.grid),i.afterCellSave(e,r)})}}}else if(tt(this.parent)){var l={requestType:"save",data:e.rowData,action:"edit",row:r,rowIndex:n,rowData:e.rowData,columnName:e.columnName,filterChoiceCount:null,excelSearchOperator:null};this.parent.grid.getDataModule().eventPromise(l,this.parent.grid.query)}else this.updateCell(e,n),(0,t.setValue)("isEdit",!1,this.parent.grid),this.afterCellSave(e,r)}this.parent.enableVirtualization&&(this.parent.grid.contentModule.virtualData={})},e.prototype.afterCellSave=function(e,i){this.parent.grid.aggregateModule&&this.parent.grid.aggregateModule.refresh(e.rowData),this.parent.grid.editModule.destroyWidgets([this.parent.grid.getColumnByField(e.columnName)]),this.parent.grid.editModule.formObj.destroy(),"tab"!==this.keyPress&&"shiftTab"!==this.keyPress&&(this.updateGridEditMode("Normal"),this.isOnBatch=!1),this.enableToolbarItems("save"),(0,t.removeClass)([i],["e-editedrow","e-batchrow"]),(0,t.removeClass)(i.querySelectorAll(".e-rowcell"),["e-editedbatchcell","e-updatedtd"]),!1!==this.parent.isCellSaveFocus&&this.parent.grid.focusModule.restoreFocus(),zt({value:e.rowData,action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,e.columnName),i.rowIndex===this.parent.getCurrentViewRecords().length-1&&"enter"===this.keyPress&&(this.keyPress=null);var r={type:"save",column:this.parent.getColumnByField(e.columnName),data:e.rowData,previousData:e.previousValue,row:i,target:e.cell};this.parent.aggregates.map(function(e){return!0===e.showChildSummary}).length&&this.parent.grid.refresh(),this.parent.trigger(U,r)},e.prototype.lastCellTab=function(){!this.parent.grid.isEdit&&this.isOnBatch&&"tab"===this.keyPress&&"Cell"===this.parent.editSettings.mode&&(this.parent.editSettings.allowNextRowEdit?this.enableToolbarItems("edit"):(this.updateGridEditMode("Normal"),this.isOnBatch=!1,this.keyPress=null))},e.prototype.updateCell=function(e,t){this.parent.grid.editModule.updateCell(t,e.columnName,e.rowData[e.columnName]),this.parent.grid.getRowsObject()[parseInt(t.toString(),10)].data=e.rowData},e.prototype.crudAction=function(e,i){zt(e,this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,i,this.addRowRecord),this.parent.parentData=[];for(var r=this.parent.grid.dataSource instanceof Ze.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,n=0;n<r.length;n++){r[parseInt(n.toString(),10)].index=n;var o=this.parent.grid.getPrimaryKeyFieldNames()[0];e.value[""+o]===r[parseInt(n.toString(),10)][""+o]&&"add"===e.action&&(r[parseInt(n.toString(),10)].level=this.internalProperties.level,r[parseInt(n.toString(),10)].taskData=this.internalProperties.taskData,r[parseInt(n.toString(),10)].uniqueID=this.internalProperties.uniqueID,(0,t.isNullOrUndefined)(this.internalProperties.parentItem)||(r[parseInt(n.toString(),10)].parentItem=this.internalProperties.parentItem,r[parseInt(n.toString(),10)].parentUniqueID=this.internalProperties.parentUniqueID),r[parseInt(n.toString(),10)].childRecords=this.internalProperties.childRecords),(0,t.setValue)("uniqueIDCollection."+r[parseInt(n.toString(),10)].uniqueID+".index",n,this.parent);var a=this.parent.dataSource.adaptor;(et(this.parent)||a instanceof Ze.RemoteSaveAdaptor)&&(0,t.setValue)("uniqueIDCollection."+r[parseInt(n.toString(),10)].uniqueID,r[parseInt(n.toString(),10)],this.parent),r[parseInt(n.toString(),10)].level||this.parent.parentData.push(r[parseInt(n.toString(),10)])}this.parent.enableInfiniteScrolling||"add"===e.action&&null!=this.previousNewRowPosition&&(this.parent.setProperties({editSettings:{newRowPosition:this.previousNewRowPosition}},!0),this.previousNewRowPosition=null)},e.prototype.updateIndex=function(e,i,r){for(var n=0;n<this.parent.getDataRows().length;n++){var o=r[parseInt(n.toString(),10)];if(!(0,t.isNullOrUndefined)(o)){var a=(0,t.getValue)("uniqueIDCollection."+o.uniqueID+".index",this.parent);if(o.index=a,!(0,t.isNullOrUndefined)(o.parentItem)){var s=(0,t.getValue)("uniqueIDCollection."+o.parentItem.uniqueID+".index",this.parent);o.parentItem.index=s}}}var d=-1,l=this.parent.treeColumnIndex;if(this.parent.getFrozenColumns()>0)for(var p=i[0].querySelectorAll(".e-rowcell"),h=0;h<p.length;h++)if(p[parseInt(h.toString(),10)].classList.contains("e-gridrowindex0level0")){l=h;break}for(var c=0;c<this.parent.getRows().length;c++){i[parseInt(c.toString(),10)].classList.contains("e-detailrow")||d++;var u=r[parseInt(d.toString(),10)];if(!(0,t.isNullOrUndefined)(u)){a=u.index;var g=u.level,f=i[parseInt(c.toString(),10)];(0,t.isNullOrUndefined)(u.parentItem)||(a=(0,t.getValue)("uniqueIDCollection."+u.parentItem.uniqueID+".index",this.parent));var y=f.cells[parseInt(l.toString(),10)];if(!(0,t.isNullOrUndefined)(y)){for(h=0;h<y.classList.length;h++){var m=y.classList[parseInt(h.toString(),10)],S=m.match(/e-gridrowindex/i),v=m.match(/e-griddetailrowindex/i);null!=S&&(0,t.removeClass)([y],m),null!=v&&(0,t.removeClass)([y],m)}i[parseInt(c.toString(),10)].classList.contains("e-detailrow")?(0,t.addClass)([y],"e-griddetailrowindex"+a+"level"+g):(0,t.addClass)([y],"e-gridrowindex"+a+"level"+g)}}}},e.prototype.beginAdd=function(){var e,i=this.addRowIndex,r=this.parent.grid.getCurrentViewRecords();"Batch"===this.parent.editSettings.mode&&(i=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex(),(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)&&(r=this.batchEditModule.getBatchRecords()));var n=this.parent.grid.getDataRows(),o=n.length?+n[0].getAttribute("aria-rowindex")-1:0,a=n.length?+n[n.length-1].getAttribute("aria-rowindex")-1:0,s=this.selectedIndex>=o&&this.selectedIndex<=a,d=this.parent.enableVirtualization&&this.addRowIndex>-1&&"-1"!==this.prevAriaRowIndex;if("Dialog"!==this.parent.editSettings.mode){if("Above"===this.parent.editSettings.newRowPosition)e="before";else if(("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(this.selectedIndex>-1||d)&&s){if(e="after",!(0,t.isNullOrUndefined)(r[parseInt(i.toString(),10)])&&r[parseInt(i.toString(),10)].expanded)if("Batch"===this.parent.editSettings.mode&&(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)){if(i+=at(r[parseInt(i.toString(),10)]).length,"Child"!==this.parent.editSettings.newRowPosition)i+=this.batchEditModule.getBatchChildCount()}else this.parent.enableVirtualization||(i+=at(r[parseInt(i.toString(),10)]).length)}if((this.selectedIndex>-1||d)&&s&&(i||"Child"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition)){i>=n.length-1&&(i=n.length-2);var l="rows",p=this.parent.grid.contentModule[""+l][0],h=document.activeElement;n[i+1][""+e](n[0]),(0,t.setValue)("batchIndex",i+1,this.batchEditModule);var c="Above"===this.parent.editSettings.newRowPosition?i:i+1;if("Batch"===this.parent.editSettings.mode&&(this.parent.grid.contentModule[""+l].splice(0,1),this.parent.grid.contentModule[""+l].splice(c,0,p)),"Row"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode){for(var u=this.parent.grid.getContentTable().querySelectorAll(".e-griderror"),g=0;g<u.length;g++)u[parseInt(g.toString(),10)].remove();(0,t.setValue)("errorRules",[],this.parent.grid.editModule.formObj)}d&&(this.prevAriaRowIndex="-1"),this.parent.enableVirtualization&&!this.parent.enableVirtualization||(this.isScrollByFocus=!0,h.focus()),this.parent.enableVirtualization&&!Object.keys(this.parent.grid.contentModule.emptyRowData).length&&this.parent.grid.contentModule.createEmptyRowdata()}}if("Batch"===this.parent.editSettings.mode&&!(0,t.isNullOrUndefined)(this.addRowIndex)&&-1!==this.addRowIndex&&this.isAddedRowByMethod&&!this.isAddedRowByContextMenu){i=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex();var f=this.parent.getBatchChanges().addedRecords,y=void 0;if(f.length)for(g=0;g<f.length;g++)(0,t.isNullOrUndefined)(f[parseInt(g.toString(),10)].uniqueID)&&(y=f[parseInt(g.toString(),10)]);var m={action:"add",data:y,index:i,seletedRow:0};this.beginAddEdit(m),this.batchEditModule.batchAddRowRecord.push(this.batchEditModule.addRowRecord),this.batchEditModule.batchAddedRecords.push(m.data)}},e.prototype.beginEdit=function(e){if("refresh"===e.requestType&&this.isOnBatch)e.cancel=!0;else if("Cell"!==this.parent.editSettings.mode||"beginEdit"!==e.requestType){if(this.doubleClickTarget&&"delete"!==e.requestType&&(this.doubleClickTarget.classList.contains("e-treegridexpand")||this.doubleClickTarget.classList.contains("e-treegridcollapse")||this.doubleClickTarget.classList.contains("e-frame")))return e.cancel=!0,void(this.doubleClickTarget=null);if("delete"===e.requestType){var i=e.data;if((0,t.isNullOrUndefined)(e.data[0].uniqueID))for(var r=this.parent.getPrimaryKeyFieldNames(),n=function(t){o.parent.flatData.filter(function(n){n[""+r[0]]===e.data[parseInt(t.toString(),10)][r[0]]&&(i[parseInt(t.toString(),10)]=n)})},o=this,a=0;a<i.length;a++)n(a);for(a=0;a<i.length;a++){this.deleteUniqueID(i[parseInt(a.toString(),10)].uniqueID);for(var s=at(i[parseInt(a.toString(),10)]),d=0;d<s.length;d++)this.deleteUniqueID(s[parseInt(d.toString(),10)].uniqueID);e.data=e.data.concat(s)}}if("add"===e.requestType||this.isAddedRowByMethod&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)){if((-1===this.parent.grid.selectedRowIndex&&this.isAddedRowByMethod||e.index!==this.parent.grid.selectedRowIndex)&&0!==e.index||(this.selectedIndex=this.parent.grid.selectedRowIndex),this.parent.enableVirtualization){var l='.e-row[aria-rowindex="'+(this.selectedIndex+1)+'"]',p=void 0;this.selectedIndex>-1&&"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition?(this.prevAriaRowIndex=this.selectedIndex.toString(),p=this.parent.getContent().querySelector(l),this.addRowIndex=p?p.rowIndex:0):this.prevAriaRowIndex&&"-1"!==this.prevAriaRowIndex?(l='.e-row[aria-rowindex="'+(this.prevAriaRowIndex+1)+'"]',p=this.parent.getContent().querySelector(l),this.addRowIndex=p?p.rowIndex:0):this.addRowIndex=0}else this.isAddedRowByMethod&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?0!==e.index?this.addRowIndex=e.index:this.addRowIndex=this.parent.grid.selectedRowIndex:this.addRowIndex=this.parent.grid.selectedRowIndex>-1?this.parent.grid.selectedRowIndex:0;var h=this.parent.getSelectedRecords()[0];(this.isAddedRowByMethod||this.isAddedRowByContextMenu&&-1!==this.parent.grid.selectedRowIndex)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?(this.addRowRecord=this.parent.flatData[this.parent.grid.selectedRowIndex],this.parent.enableVirtualization&&this.isAddedRowByContextMenu&&(this.addRowRecord=this.parent.getCurrentViewRecords()[this.addRowIndex])):(0,t.isNullOrUndefined)(h)||(this.addRowRecord=h)}this.isAddedRowByMethod&&0!==e.index&&(this.addRowRecord=this.parent.flatData[e.index],this.addRowIndex=e.index),"Child"!==this.parent.editSettings.newRowPosition||!this.isIndexUndefined&&!this.isAddedRowByMethod||(0,t.isNullOrUndefined)(this.parent.getSelectedRecords()[0])||(this.addRowRecord=this.parent.getSelectedRecords()[0],this.isIndexUndefined=!1),(0,t.isNullOrUndefined)(this.addRowRecord)&&this.parent.getCurrentViewRecords().length>this.addRowIndex&&"save"===e.requestType&&0!==this.parent.getSelectedRecords().length&&(this.addRowRecord=this.parent.getCurrentViewRecords()[this.addRowIndex]),this.isAddedRowByMethod=!1,e=this.beginAddEdit(e)}else e.cancel=!0},e.prototype.savePreviousRowPosition=function(){null===this.previousNewRowPosition&&(this.previousNewRowPosition=this.parent.editSettings.newRowPosition)},e.prototype.beginAddEdit=function(e){var i=e.data;if("add"===e.action){var r=this.parent.grid.getPrimaryKeyFieldNames()[0],n=null;i.taskData=(0,t.isNullOrUndefined)(i.taskData)?(0,t.extend)({},e.data):i.taskData;var o=void 0;o=this.parent.enableVirtualization&&0!==e.index?this.parent.flatData:"Batch"===this.parent.editSettings.mode&&this.isAddedRowByMethod&&!(0,t.isNullOrUndefined)(this.addRowIndex)?this.batchEditModule.batchRecords:this.parent.grid.getCurrentViewRecords(),this.parent.enableVirtualization&&0!==e.index&&(this.addRowIndex=this.parent.flatData.indexOf(this.addRowRecord),this.selectedIndex=this.addRowIndex);var a=this.addRowIndex;i.uniqueID=(0,l.getUid)(this.parent.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+i.uniqueID,i,this.parent);var s=0,d=void 0,p=void 0,h=void 0,c=void 0,u=this.parent.enableVirtualization&&this.addRowIndex>-1&&"-1"!==this.prevAriaRowIndex,g=this.parent.getRows(),f=g.length?o.indexOf(o[0]):0,y=g.length?+g[g.length-1].getAttribute("aria-rowindex")-1:0,m=!(!this.parent.enableVirtualization||0===e.index)||this.selectedIndex>=f&&this.selectedIndex<=y;if(o.length&&!(0,t.isNullOrUndefined)(a)&&(d=o[this.addRowIndex][this.parent.idMapping],c=o[this.addRowIndex][this.parent.parentIdMapping],o[this.addRowIndex].parentItem&&(p=o[this.addRowIndex].parentItem.uniqueID),h=o[this.addRowIndex].parentItem),"Top"!==this.parent.editSettings.newRowPosition&&o.length&&!(0,t.isNullOrUndefined)(a)){if(s=o[this.addRowIndex].level,"Above"===this.parent.editSettings.newRowPosition)n="before",a=o[this.addRowIndex].index;else if("Below"===this.parent.editSettings.newRowPosition){n="after";var S=at(o[this.addRowIndex]).length,v=o[this.addRowIndex].index;a=S>0?v+S:v}else if("Child"===this.parent.editSettings.newRowPosition){n="after",(this.selectedIndex>-1||u)&&m&&(i.parentItem=(0,t.extend)({},o[this.addRowIndex]),i.parentUniqueID=i.parentItem.uniqueID,delete i.parentItem.childRecords,delete i.parentItem[this.parent.childMapping]);var w=at(o[this.addRowIndex]).length,I=o[this.addRowIndex].index;this.selectedIndex>=0&&(i.level=s+1),a=w>0?I+w:I,this.isSelfReference&&(this.parent.isLocalData||-1!==this.parent.editModule.selectedIndex?i.taskData[this.parent.parentIdMapping]=i[this.parent.parentIdMapping]=d:i.taskData[this.parent.parentIdMapping]=i[this.parent.parentIdMapping]=null,(0,t.isNullOrUndefined)(i.parentItem)||Ft(r,i.parentItem,"add",this.parent,this.isSelfReference,i))}if("Above"!==this.parent.editSettings.newRowPosition&&"Below"!==this.parent.editSettings.newRowPosition||((this.selectedIndex>-1||u)&&s&&m&&(i.parentUniqueID=p,i.parentItem=(0,t.extend)({},h),delete i.parentItem.childRecords,delete i.parentItem[this.parent.childMapping]),i.level=s,this.isSelfReference&&(i.taskData[this.parent.parentIdMapping]=i[this.parent.parentIdMapping]=c,(0,t.isNullOrUndefined)(i.parentItem)||Ft(r,i.parentItem,"add",this.parent,this.isSelfReference,i))),null!=n&&(this.selectedIndex>-1||u)&&m&&(e.index="before"===n?a:a+1),"Bottom"===this.parent.editSettings.newRowPosition){s=0;var R=this.parent.grid.dataSource instanceof Ze.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource;e.index=R.length}}(0,t.isNullOrUndefined)(i.level)&&(i.level=s),i.hasChildRecords=!1,i.childRecords=[],i.index=0}if("add"===e.action&&(this.internalProperties={level:i.level,parentItem:i.parentItem,uniqueID:i.uniqueID,taskData:i.taskData,parentUniqueID:(0,t.isNullOrUndefined)(i.parentItem)?void 0:i.parentItem.uniqueID,childRecords:i.childRecords}),"delete"===e.requestType){var x=e.data,C=this.parent.getPrimaryKeyFieldNames();if(!(0,t.isNullOrUndefined)(C)&&C.length>0)for(var b=function(e){var i=x[parseInt(e.toString(),10)].parentItem;if(i){var r=pt(D.parent,i.uniqueID);if(!(0,t.isNullOrUndefined)(r)&&r.hasChildRecords){var n=r.childRecords.findIndex(function(t){return x[parseInt(e.toString(),10)][C[0]]===t[C[0]]});r.childRecords.splice(n,1)}}},D=this,M=0;M<x.length;M++)b(M)}return e},e.prototype.addRecord=function(e,i,r){if(this.parent.editSettings.newRowPosition!==this.previousNewRowPosition&&null!==this.previousNewRowPosition||(this.previousNewRowPosition=this.parent.editSettings.newRowPosition),(0,t.isNullOrUndefined)(i)&&(this.isIndexUndefined=!0),this.isSelfReference||(0,t.isNullOrUndefined)(e)||!Object.hasOwnProperty.call(e,this.parent.childMapping))e?(i>-1?(this.selectedIndex=i,this.addRowIndex=i):(this.selectedIndex=this.parent.selectedRowIndex,this.addRowIndex=this.parent.selectedRowIndex),r&&this.parent.setProperties({editSettings:{newRowPosition:r}},!0),this.parent.grid.editModule.addRecord(e,i)):this.parent.grid.editModule.addRecord(e,i);else{var n=[],o=this.parent.editSettings.mode,a=this.parent.grid.editSettings.mode;n.push(e),this.parent.setProperties({editSettings:{mode:"Batch"}},!0),this.parent.grid.setProperties({editSettings:{mode:"Batch"}},!0),(0,t.isNullOrUndefined)(r)||this.parent.setProperties({editSettings:{newRowPosition:r}},!0);var s={addedRecords:n,changedRecords:[],deletedRecords:[]};this.parent.notify(ge,{updatedRecords:s,index:i}),this.parent.setProperties({editSettings:{mode:o}},!0),this.parent.grid.setProperties({editSettings:{mode:a}},!0),this.parent.refresh()}},e.prototype.editFormValidate=function(){return this.parent.grid.editModule.editFormValidate()},e.prototype.destroyForm=function(){this.parent.grid.editModule.destroyForm()},e.prototype.contentready=function(e){(0,t.isNullOrUndefined)(e.args.requestType)||"delete"!==e.args.requestType.toString()&&"save"!==e.args.requestType.toString()&&("Batch"!==this.parent.editSettings.mode||"batchsave"!==e.args.requestType.toString())||(this.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),(this.parent.frozenRows||this.parent.getFrozenColumns()||this.parent.frozenColumns)&&this.parent.grid.dataSource.length===this.parent.getDataRows().length&&this.updateIndex(this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords()))},e.prototype.editCell=function(e,t){"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||("Batch"!==this.parent.editSettings.mode&&(this.isOnBatch=!0,this.updateGridEditMode("Batch")),this.parent.grid.editModule.editCell(e,t))},e.prototype.closeEdit=function(){this.parent.enableVirtualization&&"Batch"===this.parent.grid.editSettings.mode&&this.parent.grid.pageSettings.currentPage>1&&(this.editedRowIndex=this.parent.grid.editModule.editModule.cellDetails.rowIndex,this.parent.grid.editModule.editModule.cellDetails.rowIndex=parseInt(this.parent.getRows()[this.parent.grid.editModule.editModule.cellDetails.rowIndex].getAttribute("aria-rowIndex"),10)-1),this.parent.grid.editModule.closeEdit()},e}(),yi=function(){function e(e){l.Grid.Inject(l.CommandColumn),this.parent=e}return e.prototype.getModuleName=function(){return"commandColumn"},e.prototype.destroy=function(){},e}(),mi=function(){function e(e){l.Grid.Inject(l.DetailRow),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"detailRow"},e.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.dataBoundArg,this),this.parent.on("detaildataBound",this.detaildataBound,this),this.parent.grid.on("detail-indentcell-info",this.setIndentVisibility,this),this.parent.on("childRowExpand",this.childRowExpand,this),this.parent.on("rowExpandCollapse",this.rowExpandCollapse,this),this.parent.on("actioncomplete",this.actioncomplete,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.dataBoundArg),this.parent.off("detaildataBound",this.detaildataBound),this.parent.off("childRowExpand",this.childRowExpand),this.parent.off("rowExpandCollapse",this.rowExpandCollapse),this.parent.off("actioncomplete",this.actioncomplete),this.parent.grid.off("detail-indentcell-info",this.setIndentVisibility))},e.prototype.setIndentVisibility=function(e){e.visible=!1},e.prototype.dataBoundArg=function(){for(var e=this.parent.getRows().filter(function(e){return!e.classList.contains("e-detailrow")}),i=0;i<e.length;i++){var r=e[parseInt(i.toString(),10)].getElementsByClassName("e-detailrowcollapse"),n=this.parent.grid.getRowObjectFromUID(e[parseInt(i.toString(),10)].getAttribute("data-Uid")),o=(0,l.getObject)("parentItem",this.parent.grid.getCurrentViewRecords()[parseInt(i.toString(),10)]);((0,t.isNullOrUndefined)(o)||!(0,t.isNullOrUndefined)(o)&&ot(this.parent,n.data,this.parent.grid.getCurrentViewRecords()))&&this.parent.grid.detailRowModule.expand(r[0])}},e.prototype.childRowExpand=function(e){var i=e.row.getElementsByClassName("e-detailrowcollapse");(0,t.isNullOrUndefined)(i[0])||this.parent.grid.detailRowModule.expand(i[0])},e.prototype.rowExpandCollapse=function(e){if(!et(this.parent))for(var t=0;t<e.detailrows.length;t++)this.parent.toggleRowVisibility(e.detailrows[parseInt(t.toString(),10)],e.action)},e.prototype.detaildataBound=function(e){var i=e.data,r=e.detailElement.parentElement.previousSibling,n="e-gridrowindex"+((0,t.isNullOrUndefined)(i.parentItem)?i.index:i.parentItem.index)+"level"+i.level,o=r.querySelector("."+n).classList,a=[].slice.call(o).filter(function(e){return e===n}),s=a[0].length,d="e-griddetail"+a.toString().slice(6,s);(0,t.addClass)([e.detailElement.parentElement],d)},e.prototype.actioncomplete=function(e){if("beginEdit"===e.requestType||"add"===e.requestType){var t=e.row.querySelectorAll(".e-editcell")[0].getAttribute("colSpan"),i=parseInt(t,10)-1;e.row.querySelectorAll(".e-editcell")[0].setAttribute("colSpan",i.toString())}for(var r=this.parent.grid.contentModule.getRows(),n=0;n<r.length;n++)r[parseInt(n.toString(),10)].cells[0].visible=!1;(0,l.getObject)("focusModule",this.parent.grid).refreshMatrix(!0)({rows:this.parent.grid.contentModule.getRows()})},e.prototype.destroy=function(){this.removeEventListener()},e}(),Si=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vi=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.isExpandCollapse=!1,r.translateY=0,r.maxiPage=0,r.recordAdded=!1,r.startIndex=-1,r.endIndex=-1,r.preTranslate=0,r.isRemoteExpand=!1,r.isDataSourceChanged=!1,r.addEventListener(),r}return Si(i,e),i.prototype.getModelGenerator=function(){return new ni(this.parent)},i.prototype.getRowByIndex=function(e){if(this.parent.enableVirtualization&&this.parent.isFrozenGrid())return this.getRowCollection(e,!0);var t=this.parent.getDataRows().find(function(t){return parseInt(t.getAttribute("aria-rowindex"),10)-1===e});return!t&&this.parent.isEdit&&"Batch"===this.parent.editSettings.mode?null!=e?this.parent.getRows()[parseInt(e.toString(),10)]:void 0:t},i.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1,!1,!0)},i.prototype.getRowCollection=function(e,t,i,r){var n=parseInt(this.parent.getRows()[0].getAttribute(We),10)-1,o=this.parent.getDataRows(),a=(i?this.parent.getCurrentViewRecords():o)[e-n];return this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(a=i?e<=this.parent.frozenRows?this.parent.getRowsObject()[parseInt(e.toString(),10)].data:a:e<=this.parent.frozenRows?o[parseInt(e.toString(),10)]:o[e-n+this.parent.frozenRows]),null==a&&null!=e&&"Batch"===this.parent.editSettings.mode&&this.parent.isEdit&&t&&(a=o[parseInt(e.toString(),10)]),a},i.prototype.addEventListener=function(){this.parent.on(ve,this.virtualOtherAction,this),this.parent.on(Re,this.indexModifier,this)},i.prototype.virtualOtherAction=function(e){e.setTop?(this.translateY=0,this.startIndex=0,this.endIndex=this.parent.pageSettings.pageSize-1):e.isExpandCollapse&&(this.isExpandCollapse=!0)},i.prototype.indexModifier=function(e){var t=this.parent.getContent().querySelector(".e-content"),i=this.parent.pageSettings.pageSize;if((this.recordAdded||"delete"===e.requestType&&this.endIndex>e.count-this.parent.pageSettings.pageSize)&&this.startIndex>-1&&this.endIndex>-1){if(this.endIndex>e.count-i){var r=~~(t.scrollTop/this.parent.getRowHeight()),n=r+this.parent.getRows().length;n>e.count&&(n=r+(e.count-r)),this.startIndex=n-this.parent.getRows().length,this.endIndex=n}else("Top"!==this.parent.root.editSettings.newRowPosition&&-1!==this.parent.root.editModule.selectedIndex||-1!==this.parent.root.editModule.selectedIndex)&&(this.startIndex+=1,this.endIndex+=1);this.recordAdded=!1}this.isDataSourceChanged&&(this.startIndex=0,this.endIndex=i-1),this.endIndex-this.startIndex!==i&&this.totalRecords>i&&this.endIndex===this.totalRecords?(e.startIndex=this.endIndex-i,e.endIndex=this.endIndex):(e.startIndex=this.startIndex,e.endIndex=this.endIndex)},i.prototype.eventListener=function(t){var i=this;this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&tt(this.parent)?e.prototype.eventListener.call(this,"on"):(this.parent[""+t]("data-ready",this.onDataReady,this),this.parent[""+t]("refresh-virtual-block",this.refreshContentRows,this),this.fn=function(){i.observers.observes(function(e){return i.scrollListeners(e)},i.onEnteredAction(),i.parent);var e=i.parent;if(e.root.enablePersistence&&e.root.scrollPosition){i.content.scrollTop=e.root.scrollPosition.top,e.root.enableColumnVirtualization&&(i.content.scrollLeft=e.root.scrollPosition.left);var t={direction:"down",sentinel:i.observer.sentinelInfo.down,offset:e.root.scrollPosition,focusElement:e.element};i.scrollListeners(t)}i.parent.off("content-ready",i.fn)},this.parent.addEventListener("dataBound",this.dataBoundEvent.bind(this)),this.parent.addEventListener("rowSelected",this.rowSelectedEvent.bind(this)),this.parent[""+t]("select-virtual-Row",this.toSelectVirtualRow,this),this.parent.on("content-ready",this.fn,this),this.parent.addEventListener(E,this.handleActionBegin.bind(this)),this.parent.addEventListener(U,this.onActionComplete.bind(this)),this.parent[""+t]("virtual-scroll-edit-action-begin",this.beginEdit,this),this.parent[""+t]("virtual-scroll-add-action-begin",this.beginAdd,this),this.parent[""+t]("virtual-scroll-edit-success",this.virtualEditSuccess,this),this.parent[""+t]("edit-reset",this.resetIseditValue,this),this.parent[""+t]("get-virtual-data",this.getData,this),this.parent[""+t]("virtual-scroll-edit-cancel",this.cancelEdit,this),this.parent[""+t]("select-row-on-context-open",this.toSelectRowOnContextOpen,this),this.parent[""+t]("refresh-virtual-editform-cells",this.refreshCell,this),this.parent[""+t]("virtaul-cell-focus",this.cellFocus,this),this.parent[""+t]("virtual-scroll-edit",this.restoreEditState,this),this.parent[""+t]("set-virtual-page-query",this.SetVirtualPageQury,this))},i.prototype.cellFocus=function(t){e.prototype.virtualCellFocus.call(this,t)},i.prototype.onDataReady=function(i){if(e.prototype.onDataReady.call(this,i),!(this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&tt(this.parent))){if(!(0,t.isNullOrUndefined)(i.count)){if(this.totalRecords=i.count,this.parent.isFrozenGrid()&&i.count<Object.keys(this.parent.dataSource).length){var r=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.columns.length-1)+"px":"100%",n=this.parent.getRowHeight()*i.count-this.parent.getRowHeight()*this.parent.pageSettings.pageSize;(0,t.getValue)("virtualEle",this).setVirtualHeight(n,r)}this.parent.enableColumnVirtualization||this.parent.isFrozenGrid()||(0,t.getValue)("virtualEle",this).setVirtualHeight(this.parent.getRowHeight()*i.count,"100%")}(!(0,t.isNullOrUndefined)(i.requestType)&&"collapseAll"===i.requestType.toString()||this.isDataSourceChanged&&(-1===this.startIndex||0===this.startIndex&&0===this.preStartIndex))&&(this.contents.scrollTop=0,this.isDataSourceChanged=!1)}},i.prototype.renderTable=function(){e.prototype.renderTable.call(this),this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&tt(this.parent)||((0,t.getValue)("observer",this).options.debounceEvent=!1,this.observers=new wi((0,t.getValue)("observer",this).element,(0,t.getValue)("observer",this).options),this.contents=this.getPanel().firstChild)},i.prototype.getTranslateY=function(t,i,r,n){if(this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||tt(this.parent)){if(this.isRemoteExpand)return this.isRemoteExpand=!1,this.preTranslate;this.preTranslate=e.prototype.getTranslateY.call(this,t,i,r,n)}return e.prototype.getTranslateY.call(this,t,i,r,n)},i.prototype.dataBoundEvent=function(){var i="initialRowTop";if(!(0,t.isNullOrUndefined)(this.parent.getRows())&&this.parent.getRows().length&&!(0,t.isNullOrUndefined)(this.parent.getRowByIndex(0))&&!this[""+i]){var r=this.parent.getRowByIndex(0).getBoundingClientRect().top,n=this.parent.element.getBoundingClientRect().top;r>0?this[""+i]=this.parent.getRowByIndex(0).getBoundingClientRect().top-n:-1===this.parent.selectedRowIndex&&(this[""+i]=this.content.getBoundingClientRect().top-this.parent.getRowByIndex(0).getBoundingClientRect().height)}e.prototype.dataBound.call(this)},i.prototype.rowSelectedEvent=function(t){e.prototype.rowSelected.call(this,t),this.parent.notify("virtualTransform",{requestType:"transformChange"})},i.prototype.toSelectVirtualRow=function(i){if(!this.parent.isEdit){var r="containerRect";(0,t.isNullOrUndefined)(this.observer[""+r])&&(this.observer[""+r]=this.observers[""+r]);var n=this.parent.clipboardModule.treeGridParent;if((0,t.isNullOrUndefined)(n.editModule)||(0,t.isNullOrUndefined)(n.editModule.addRowIndex)||0!==i.selectedIndex){if(!(0,t.isNullOrUndefined)(n.grid.sortModule)&&n.grid.sortModule.sortedColumns.length>0){var o=n.dataModule.sortedData;if(!(0,t.isNullOrUndefined)(o)&&o.length>0){var a=o.findIndex(function(e){return e.index===i.selectedIndex});i.selectedIndex=a}}e.prototype.selectVirtualRow.call(this,i)}}},i.prototype.refreshCell=function(e){e.cells=this.generateCells()},i.prototype.generateCells=function(){for(var e=[],t=0;t<this.parent.columns.length;t++)e.push(this.generateCell(this.parent.columns[parseInt(t.toString(),10)]));return e},i.prototype.getVirtualRowIndex=function(e){return(0,t.isNullOrUndefined)(this.prevInfo)?e:this.parent.getRowsObject()[0].index+e},i.prototype.generateCell=function(e,i,r,n,o,a){var s={visible:e.visible,isDataCell:!(0,t.isNullOrUndefined)(e.field||e.template),isTemplate:!(0,t.isNullOrUndefined)(e.template),rowID:i,column:e,cellType:(0,t.isNullOrUndefined)(r)?l.CellType.Data:r,colSpan:n,commands:e.commands,isForeignKey:e.isForeignColumn&&e.isForeignColumn(),foreignKeyData:e.isForeignColumn&&e.isForeignColumn()&&(0,t.getValue)(e.field,a)};return(s.isDataCell||"checkbox"===s.column.type||s.commands)&&(s.index=o),new l.Cell(s)},i.prototype.beginEdit=function(e){this.editedRowIndex=e.index;var t='.e-row[aria-rowindex="'+(e.index+1)+'"]',i=this.parent.getContent().querySelector(t).rowIndex,r=this.parent.getCurrentViewRecords()[parseInt(i.toString(),10)];e.data=r},i.prototype.beginAdd=function(t){var i={newRowPosition:this.rowPosition,addRowIndex:this.addRowIndex,dataRowIndex:this.dataRowIndex};this.parent.notify("get-row-position",i),this.rowPosition=i.newRowPosition,this.addRowIndex=i.addRowIndex,this.dataRowIndex=i.dataRowIndex;var r=this.parent.getRows(),n=r.length?+r[0].getAttribute("aria-rowindex")-1:0,o=r.length?+r[r.length-1].getAttribute("aria-rowindex")-1:0,a=this.parent.selectedRowIndex>=n&&this.parent.selectedRowIndex<=o;"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.isAdd=!0),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.addRowIndex&&-1!==this.addRowIndex||-1!==this.parent.selectedRowIndex&&a)||e.prototype.addActionBegin.call(this,t)},i.prototype.restoreEditState=function(){e.prototype.restoreEdit.call(this)},i.prototype.SetVirtualPageQury=function(e){var t=[];if(this.prevInfo&&this.prevInfo.blockIndexes&&(t=(0,l.getVisiblePage)(this.prevInfo.blockIndexes)),"refresh"===this.requestType&&t.length)return e.query.skip(this.parent.pageSettings.pageSize*(t[0]-1)),e.query.take(this.parent.pageSettings.pageSize*t.length),void(e.skipPage=!0)},i.prototype.resetIseditValue=function(){this.parent.notify("reset-edit-props",{}),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition||!this.isAdd||e.prototype.resetIsedit.call(this)},i.prototype.virtualEditSuccess=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&e.querySelector(".e-addedrow")&&(this.recordAdded=!0)},i.prototype.cancelEdit=function(t){e.prototype.editCancel.call(this,t)},i.prototype.toSelectRowOnContextOpen=function(t){e.prototype.selectRowOnContextOpen.call(this,t)},i.prototype.restoreNewRow=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&!e.querySelector(".e-addedrow")&&(this.parent.isEdit=!1,this.parent.editModule.addRecord(null,this.parent.root.editModule.selectedIndex))},i.prototype.getData=function(t){e.prototype.getVirtualData.call(this,t)},i.prototype.handleActionBegin=function(t){e.prototype.actionBegin.call(this,t)},i.prototype.onActionComplete=function(t){if("add"===t.requestType){var i={newRowPosition:this.rowPosition,addRowIndex:this.addRowIndex,dataRowIndex:this.dataRowIndex};this.parent.notify("get-row-position",i),this.rowPosition=i.newRowPosition,this.addRowIndex=i.addRowIndex,this.dataRowIndex=this.parent.root.editModule.selectedIndex}e.prototype.actionComplete.call(this,t)},i.prototype.onEnteredAction=function(){var e=this;return function(i,r,n,o,a,s){if(!e.parent.directVirtualRender){var d="preventEvent";!t.Browser.isIE||a||!s||e[""+d]||e.parent.enableVirtualMaskRow||e.parent.showSpinner(),e.parent.enableVirtualMaskRow&&!e[""+d]&&setTimeout(function(){e.parent.showMaskRow(r.axis),e.parent.notify("showGanttShimmer",{requestType:"showShimmer"})},0);var l=e.content.getBoundingClientRect().height,p=e.prevInfo.offsets?e.prevInfo.offsets.top:null,h="X"===r.axis,c=e.getColumnOffset(h?e.vgenerator.getColumnIndexes()[0]-1:e.prevInfo.columnIndexes[0]-1);if(e.parent.isFrozenGrid()&&e.parent.enableColumnVirtualization&&e.currentInfo&&e.currentInfo.columnIndexes){var u=e.currentInfo.columnIndexes[0]-1,g=0;e.parent.getColumns().filter(function(e){e.visible&&"Left"===e.freeze&&(g+=parseInt(e.width.toString(),10))}),u>e.parent.getVisibleFrozenLeftCount()&&(c-=g)}if(h){var f=Object.keys(e.vgenerator.cOffsets).length-e.prevInfo.columnIndexes.length,y=e.vgenerator.cOffsets[f-1];c=c>y?y:c}var m=e.getTranslateY(o.top,l,h&&p===o.top?e.prevInfo:void 0,!0);if(!e.parent.isFrozenGrid()||e.parent.enableVirtualMaskRow){if(e.parent.enableVirtualMaskRow){var S=o.top-e.translateY<0;m=Math.round(e.translateY)>m&&!S?Math.round(e.translateY):m,e.virtualEle.adjustTable(c,m)}else e.virtualEle.adjustTable(c,e.translateY);e.parent.enableColumnVirtualization&&(e.header.virtualEle.adjustTable(c,0),e.parent.isFrozenGrid()&&e.parent.contentModule.resetStickyLeftPos(c))}}}},i.prototype.scrollListeners=function(e){this.scrollAfterEdit(),this.shouldPreventScrolling(e),this.parent.root.enablePersistence&&(this.parent.root.scrollPosition=e.offset);var i,r=e.sentinel,n=this.parent.getRowHeight(),o=this.parent.pageSettings.pageSize-Math.ceil(this.parent.pageSettings.pageSize/2);(0,t.isNullOrUndefined)(this.parent.contentModule)||(i=this.parent.getContent().querySelector(".e-content"));var a=o*n,s=e.offset.top-this.translateY<0&&"downArrow"!==this.activeKey,d=Math.ceil(e.offset.top-this.translateY)+n>=a,l="selectedRowIndex",p=this.parent.currentViewData,h="index";if(s&&"right"!==e.direction&&"left"!==e.direction&&!(0,t.isNullOrUndefined)(i)){var c=+(this.parent.height.toString().indexOf("%")<0?parseInt(this.parent.height.toString(),10):this.parent.element.getBoundingClientRect().height),u=Math.floor(i.scrollTop/n)+Math.ceil(c/n)-this.parent.pageSettings.pageSize;if(u=u>0?u:0,!(0,t.isNullOrUndefined)(this[""+l])&&-1!==this[""+l]&&u!==this[""+l]&&this.parent.rowHeight*this.parent.pageSettings.pageSize<i.scrollTop&&!this.parent.allowRowDragAndDrop&&(u=this[""+l]),this.startIndex=u,this.endIndex=u+this.parent.pageSettings.pageSize,this.endIndex>this.totalRecords){var g=this.totalRecords,f=this.endIndex%g;this.endIndex=g,this.startIndex=this.startIndex-f<0?0:this.startIndex-f}p.length&&p[0][""+h]>=this.parent.pageSettings.pageSize/2&&p[0][""+h]-this.startIndex<this.parent.pageSettings.pageSize/2&&this.parent.selectionModule&&this.parent.selectionModule.isRowSelected&&(this.startIndex=p[0][""+h]-this.parent.pageSettings.pageSize/2,this.endIndex=this.startIndex+this.parent.pageSettings.pageSize);var y=Math.ceil(e.offset.top/n);y%=this.parent.pageSettings.pageSize;var m=0;if(!(0,t.isNullOrUndefined)(this.parent.getRows()[parseInt(y.toString(),10)])&&!(0,t.isNullOrUndefined)(this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(y.toString(),10)]))m=+this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(y.toString(),10)].querySelector("td").getAttribute("index");0===m?this.endIndex-this.startIndex<this.parent.pageSettings.pageSize?this.translateY=(0,t.isNullOrUndefined)(this.endIndex)?0:(this.endIndex-this.parent.pageSettings.pageSize)*(this.parent.rowHeight?this.parent.rowHeight:this.parent.getRowHeight()):this.startIndex===this[""+l]?this.translateY=e.offset.top:this.translateY=e.offset.top-o*n>0?e.offset.top-o*n+n:0:this.parent.getFrozenColumns()>0?(e.offset.top=e.offset.top+80,this.translateY=e.offset.top-o*n>0?e.offset.top-o*n+10:0):this.translateY=e.offset.top-o*n>0?e.offset.top-o*n+10:0}else if(d&&"right"!==e.direction&&"left"!==e.direction&&!(0,t.isNullOrUndefined)(i)){var S=~~(i.scrollTop/n),v=!(this[""+l]+this.parent.pageSettings.pageSize<this.totalRecords);(0,t.isNullOrUndefined)(this[""+l])||-1===this[""+l]||S===this[""+l]||v||this.parent.allowRowDragAndDrop||(S=this[""+l]);var w=S+this.parent.pageSettings.pageSize;w>this.totalRecords&&(w=S+(this.totalRecords-S)),this.startIndex=!v||(0,t.isNullOrUndefined)(this[""+l])?w-this.parent.pageSettings.pageSize:S,this.endIndex=w,S+this.parent.pageSettings.pageSize>this.totalRecords&&this.endIndex-this.startIndex<this.parent.pageSettings.pageSize/2&&this.endIndex-S<this.parent.pageSettings.pageSize/2&&(this.startIndex=w-this.parent.pageSettings.pageSize/2),e.offset.top>n*this.totalRecords?this.translateY=this.getTranslateY(e.offset.top,i.getBoundingClientRect().height):this.totalRecords===this.endIndex?this.totalRecords===this.endIndex&&(this.parent.isEdit?this.translateY=this.totalRecords*n-this.parent.pageSettings.pageSize*n+n:this.translateY=this.totalRecords*n-this.parent.pageSettings.pageSize*n):this.parent.getFrozenColumns()>0?this.translateY=e.offset.top-(2*n+this.parent.pageSettings.pageSize):this.translateY=e.offset.top}if(d&&"up"!==e.direction&&e.offset.top<n*this.totalRecords||s||"right"===e.direction||"left"===e.direction||this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url){var I=this.currentInfo=(0,t.getValue)("getInfoFromView",this).apply(this,[e.direction,r,e.offset]);if(this.previousInfo=I,this.prevInfo&&et(this.parent.root)&&"model-changed"!==I.event&&("Y"===r.axis&&this.prevInfo.blockIndexes.toString()===I.blockIndexes.toString()||"X"===r.axis&&this.prevInfo.columnIndexes.toString()===I.columnIndexes.toString()||this.parent.isFrozenGrid()&&this.parent.getVisibleFrozenLeftCount()>=I.columnIndexes[0]&&this.prevInfo.columnIndexes.toString().includes(I.columnIndexes.toString())))return this.parent.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}),t.Browser.isIE&&this.parent.hideSpinner(),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,void("Y"===r.axis&&this.restoreEditState());this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?I.columnIndexes:[]);var R=I.loadNext&&!I.loadSelf?I.nextInfo.page:I.page;this.parent.setProperties({pageSettings:{currentPage:R}},!0),this.requestType="virtualscroll","right"===e.direction||"left"===e.direction||et(this.parent.root)||(I.event="refresh-virtual-block"===I.event?"model-changed":I.event),this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(r.axis),this.parent.addShimmerEffect(),this.parent.notify("showGanttShimmer",{requestType:"showShimmer"})),this.parent.notify(I.event,{requestType:"virtualscroll",virtualInfo:I,focusElement:e.focusElement})}else this.parent.enableVirtualMaskRow&&(this.parent.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}))},i.prototype.shouldPreventScrolling=function(e){this.parent.element.querySelector(".e-addedrow")&&"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&0!==e.offset.top&&this.parent.closeEdit()},i.prototype.appendContent=function(i,r,n){if(this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||tt(this.parent)||this.parent.isFrozenGrid()&&(void 0===n.requestType||!(0,t.isNullOrUndefined)(n.virtualInfo)&&("right"===n.virtualInfo.direction||"left"===n.virtualInfo.direction)))(0,t.getValue)("isExpandCollapse",n)&&(this.isRemoteExpand=!0),e.prototype.appendContent.call(this,i,r,n),-1!==(0,t.getValue)("requestTypes",this).indexOf("isFrozen")&&((0,t.getValue)("requestTypes",this).splice((0,t.getValue)("requestTypes",this).indexOf("isFrozen"),1),this.requestType="isFrozen"===this.requestType?void 0:this.requestType);else{var o=n.virtualInfo.sentinelInfo&&"Y"===n.virtualInfo.sentinelInfo.axis&&(0,t.getValue)("currentInfo",this).page&&(0,t.getValue)("currentInfo",this).page!==n.virtualInfo.page?(0,t.getValue)("currentInfo",this):n.virtualInfo,a=o.columnIndexes[0]-1,s=this.getColumnOffset(a),d=void 0;if(this.parent.enableColumnVirtualization){this.header.virtualEle.adjustTable(s,0);var l=o.columnIndexes;d=this.getColumnOffset(l[l.length-1])-this.getColumnOffset(l[0]-1)+"",this.header.virtualEle.setWrapperWidth(d)}this.virtualEle.setWrapperWidth(d,t.Browser.isIE||"edge"===t.Browser.info.name),(i=this.parent.createElement("tbody")).appendChild(r);this.getTable().querySelector("tbody").replaceWith(i),"virtualscroll"===n.requestType&&"Y"===n.virtualInfo.sentinelInfo.axis&&(this.isExpandCollapse=!1);if(this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()){var p=0;this.parent.getColumns().filter(function(e){e.visible&&(parseInt(e.width.toString(),10),"Left"===e.freeze&&(p+=parseInt(e.width.toString(),10)))});l=o.columnIndexes;d=this.getColumnOffset(l[l.length-1])-this.getColumnOffset(l[0]-1)+"",a>this.parent.getVisibleFrozenLeftCount()&&(s-=p),this.resetStickyLeftPos(s,r)}this.isExpandCollapse&&0!==this.translateY?this.isExpandCollapse=!1:(this.translateY=this.translateY<0?0:this.translateY,(0,t.getValue)("virtualEle",this).adjustTable(s,this.translateY),this.parent.enableColumnVirtualization&&(this.header.virtualEle.adjustTable(s,0),this.parent.isFrozenGrid()&&this.resetStickyLeftPos(s))),(0,t.setValue)("prevInfo",this.previousInfo?this.previousInfo:o,this),"virtualscroll"===n.requestType&&"X"===n.virtualInfo.sentinelInfo.axis&&this.parent.notify(ke,{});e.prototype.focusCell.call(this,n);var h="isAdd";this[""+h]&&!this.parent.getContent().querySelector(".e-content").querySelector(".e-addedrow")&&"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.dataRowIndex>=this.startIndex?this.restoreNewRow():this.addRowIndex&&this.addRowIndex>-1&&(this[""+h]=!1,this.parent.isEdit=!1)),this.restoreEditState(),e.prototype.restoreAdd.call(this),e.prototype.ensureSelectedRowPosition.call(this)}},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("data-ready",this.onDataReady),this.parent.off("content-ready",this.fn),this.parent.off("select-virtual-Row",this.toSelectVirtualRow),this.parent.off("dataBound",this.dataBoundEvent),this.parent.off("rowSelected",this.rowSelectedEvent),this.parent.off(ve,this.virtualOtherAction),this.parent.off(Re,this.indexModifier),this.parent.off("virtual-scroll-edit-action-begin",this.beginEdit),this.parent.off("virtual-scroll-add-action-begin",this.beginAdd),this.parent.off("virtual-scroll-edit-success",this.virtualEditSuccess),this.parent.off("edit-reset",this.resetIseditValue),this.parent.off("get-virtual-data",this.getData),this.parent.off("virtual-scroll-edit-cancel",this.cancelEdit),this.parent.off("select-row-on-context-open",this.toSelectRowOnContextOpen),this.parent.off("refresh-virtual-editform-cells",this.refreshCell),this.parent.off("virtaul-cell-focus",this.cellFocus),this.parent.off("virtual-scroll-edit",this.restoreEditState))},i}(l.VirtualContentRenderer),wi=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.isWheeling=!1,t.newPos=0,t.lastPos=0,t.timer=0,t}return Si(i,e),i.prototype.observes=function(i,r,n){if(e.prototype.containerRect=(0,t.getValue)("options",this).container.getBoundingClientRect(),t.EventHandler.add((0,t.getValue)("options",this).container,"scroll",this.virtualScrollHandlers(i,r,n),this),(0,t.getValue)("options",this).movableContainer){e.prototype.movableContainerRect=(0,t.getValue)("options",this).movableContainer.getBoundingClientRect(),t.EventHandler.add((0,t.getValue)("options",this).movableContainer,"scroll",this.virtualScrollHandlers(i,r,n),this)}},i.prototype.clear=function(){this.lastPos=null},i.prototype.virtualScrollHandlers=function(e,i,r){var n=this,o="chrome"===t.Browser.info.name?200:100,a="options",s="movableEle",d="fromWheel",l=(0,t.debounce)(e,o),p=(0,t.debounce)(e,50);this[""+a].prevTop=this[""+a].prevLeft=0;var h="isScrollByFocus";return function(t){var o,c="keyPress";if(r&&r.root&&r.root.editModule&&r.root.editModule[""+c]&&(o=r.root.editModule[""+c]),r.isEdit&&r.root.editModule[""+h]||r.isEdit&&("tab"===o||"shiftTab"===o))r.root.editModule[""+h]=!1;else{var u=n[""+a].movableContainer?n[""+a].container.scrollTop:t.target.scrollTop,g=n[""+a].movableContainer?n[""+a].scrollbar.scrollLeft:t.target.scrollLeft,f=n[""+a].prevTop<u?"down":"up";f=n[""+a].prevLeft===g?f:n[""+a].prevLeft<g?"right":"left",n[""+a].prevTop=u,n[""+a].prevLeft=g;var y=n.sentinelInfo[""+f],m=0;if(n.newPos=u,null!=n.lastPos&&(m=n.newPos-n.lastPos),n.lastPos=n.newPos,n.timer&&clearTimeout(n.timer),n.timer=setTimeout(n.clear,0),(m>100||m<-100)&&t&&t.preventDefault&&(t.returnValue=!1,t.preventDefault()),-1!==n[""+a].axes.indexOf(y.axis)){n.containerRect=n[""+a].container.getBoundingClientRect();var S=n.check(f);if(y.entered&&("X"===y.axis||r.enableVirtualMaskRow)&&(!n[""+s]||"right"!==f&&"left"!==f?i(n.element,y,f,{top:u,left:g},n[""+d],S):i(n[""+s],y,f,{top:u,left:g},n[""+d],S)),S){var v=p;"X"===y.axis?v({direction:f,sentinel:y,offset:{top:u,left:g},focusElement:document.activeElement}):r.dataSource instanceof Ze.DataManager&&void 0!==r.dataSource.dataSource.url&&!r.dataSource.dataSource.offline&&""!==r.dataSource.dataSource.url||tt(r)||r.enableVirtualMaskRow?(v=r.enableVirtualMaskRow?l:v)({direction:f,sentinel:y,offset:{top:u,left:g},focusElement:document.activeElement}):e({direction:f,sentinel:y,offset:{top:u,left:g},focusElement:document.activeElement})}n[""+d]=!1}}}},i}(l.InterSectionObserver),Ii=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ri=function(){function e(e){this.prevstartIndex=-1,this.setEndIndexToGantt=!0,this.prevendIndex=-1,this.prevSelectedRecord=[],this.parent=e,l.Grid.Inject(xi),this.addEventListener()}return e.prototype.getModuleName=function(){return"virtualScroll"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(K,this.collapseExpandVirtualchilds,this),this.parent.on(W,this.virtualPageAction,this),this.parent.on(we,this.destroy,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(K,this.collapseExpandVirtualchilds),this.parent.off(W,this.virtualPageAction),this.parent.off(we,this.destroy))},e.prototype.collapseExpandVirtualchilds=function(e){this.parent.grid.notify(ve,{isExpandCollapse:!0}),this.expandCollapseRec=e.record,e.record.expanded="collapse"!==e.action,this.parent.flatData.map(function(t){return t.expanded=t.uniqueID===e.record.uniqueID&&t.expanded!==e.record.expanded?e.record.expanded:t.expanded});var i={result:this.parent.flatData,row:e.row,action:e.action,record:e.record,count:this.parent.flatData.length};this.handleSelection();var r=(0,t.getValue)("isCollapseAll",this.parent)?"collapseAll":"refresh";(0,t.getValue)("grid.renderModule",this.parent).dataManagerSuccess(i,{requestType:r})},e.prototype.handleSelection=function(){("Cell"===this.parent.selectionSettings.mode||"Row"===this.parent.selectionSettings.mode&&!this.parent.selectionSettings.persistSelection)&&this.parent.grid.clearSelection(),(0,t.getValue)("isCollapseAll",this.parent)&&this.parent.selectionSettings.persistSelection&&this.parent.getSelectedRecords().length>0&&(this.prevSelectedRecord=this.parent.getSelectedRecords(),this.parent.grid.clearSelection())},e.prototype.virtualPageAction=function(e){var i=this,r=new Ze.DataManager(e.result),n=new Ze.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),o=r.executeLocal((new Ze.Query).where(n)),a=o.filter(function(e){return ot(i.parent,e,o)});this.visualData=a,e.count=a.length,this.parent.grid.notify(Ie,{data:a});var s={startIndex:-1,endIndex:-1,count:e.count,requestType:e.actionArgs.requestType};this.parent.grid.notify(Re,s);var d=s.startIndex,p=s.endIndex;if(e.count=a.length,-1===d&&-1===p){var h=new Ze.Query,c=this.parent.grid.pageSettings.pageSize,u=c*(this.parent.grid.pageSettings.currentPage-1);h=h.skip(u).take(c),r.dataSource.json=a,e.result=r.executeLocal(h)}else{var g=e.actionArgs.requestType;("filtering"===g||"collapseAll"===g||"searching"===g||"refresh"===g&&(0,t.getValue)("isExpandAll",this.parent)||"refresh"===g&&this.parent.enableCollapseAll&&p>a.length&&(0,t.isNullOrUndefined)(this.expandCollapseRec))&&(d=0,p=this.parent.grid.pageSettings.pageSize,this.parent.grid.getContent().firstElementChild.scrollTop=0,this.parent.grid.notify(ve,{setTop:!0})),("save"===g&&e.actionArgs.index>=s.count-this.parent.grid.pageSettings.pageSize||"refresh"===g&&this.parent.isGantt&&this.parent.isAddedFromGantt)&&(this.setEndIndexToGantt&&(this.ganttEndIndex=s.endIndex),(s.endIndex+this.parent.pageSettings.pageSize>=s.count&&this.parent.root&&s.count!==this.ganttEndIndex&&this.parent.isAddedFromGantt||!this.parent.isGantt||!this.parent.isAddedFromGantt)&&(d=s.startIndex+(s.count-s.endIndex),p=s.count,this.setEndIndexToGantt=!1),this.ganttEndIndex=p,this.parent.isAddedFromGantt=!1);var f=this.parent.grid.contentModule.virtualEle.wrapper,y=(0,l.getTransformValues)(f).height;if(!(0,t.isNullOrUndefined)(this.expandCollapseRec)&&("virtualscroll"===e.actionArgs.requestType||"refresh"===e.actionArgs.requestType&&d!==this.prevstartIndex)&&d<this.parent.getRows().length&&p<=d+this.parent.getRows().length&&0===y&&(d=0),"save"===e.actionArgs.requestType&&d!==this.prevstartIndex&&d<this.parent.getRows().length&&p<=d+this.parent.getRows().length&&0===y&&(p=(d=0)+this.parent.grid.pageSettings.pageSize),!(0,t.isNullOrUndefined)(this.expandCollapseRec)){var m=this.parent.grid.pageSettings.pageSize,S=a.indexOf(this.expandCollapseRec);if(a.slice(S,S+m).length<m&&S>=0&&0!==d){if(S=(S=a.length-m)>0?S:0,(p=a.length)-d<m){if(d=S,a.indexOf(this.expandCollapseRec)>a.length-m/2){var v=d*this.parent.grid.getRowHeight();this.parent.grid.contentModule.translateY=v,this.parent.grid.contentModule.virtualEle.adjustTable(0,v)}}}else(0,t.getValue)("isCollapseAll",this.parent)&&(d=0,p=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify(ve,{setTop:!0}))}"collapseAll"!==this.prevrequestType||"virtualscroll"!==e.actionArgs.requestType||(0,t.isNullOrUndefined)(this.parent.idMapping)||0!==d||(d=0,p=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify(ve,{setTop:!0})),!this.parent.enableCollapseAll&&!this.parent.expandStateMapping||(0,t.isNullOrUndefined)(this.expandCollapseRec)||(e.count<this.parent.getRows()[0].getBoundingClientRect().height?d=0:this.parent.isExpandAll||0!==this.parent.grid.contentModule.translateY||(d=-1===this.prevstartIndex?0:this.prevstartIndex)),this.expandCollapseRec=null,d=d<0?0:d,0===p&&a.length>0?e.result=a:e.result=a.slice(d,p),this.prevstartIndex=d,this.prevendIndex=p,this.prevrequestType=e.actionArgs.requestType}this.parent.notify("updateAction",e)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.updateSelection=function(e){if(e.isHeaderCheckboxClicked&&this.parent.grid.currentViewData.length!==this.parent.grid.selectionModule.selectedRowIndexes.length&&e.target.classList.contains("e-uncheck"))for(var t=0;t<this.parent.getRows().length;t++)this.parent.getRows()[parseInt(t.toString(),10)].getElementsByClassName("e-frame e-icons e-uncheck").length&&!this.parent.getRows()[parseInt(t.toString(),10)].querySelector(".e-checkbox-disabled")&&this.parent.grid.selectionModule.updateRowSelection(this.parent.getRows()[parseInt(t.toString(),10)],this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)].index)},e}(),xi=function(e){function i(i,r){var n=e.call(this,i,r)||this;return(0,t.getValue)("parent",n).off("initial-load",(0,t.getValue)("instantiateRenderer",n),n),(0,t.getValue)("parent",n).on("initial-load",n.instantiateRenderers,n),n}return Ii(i,e),i.prototype.getModuleName=function(){return"treeVirtualScroll"},i.prototype.instantiateRenderers=function(){var e=(0,t.getValue)("parent",this);(0,t.getValue)("parent",this).log(["limitation","virtual_height"],"virtualization");var i=(0,t.getValue)("locator",this).getService("rendererFactory");e.enableColumnVirtualization&&(0,t.getValue)("addRenderer",i).apply(i,[l.RenderType.Header,new l.VirtualHeaderRenderer((0,t.getValue)("parent",this),(0,t.getValue)("locator",this))]),(0,t.getValue)("addRenderer",i).apply(i,[l.RenderType.Content,new vi((0,t.getValue)("parent",this),(0,t.getValue)("locator",this))]),this.ensurePageSize()},i.prototype.ensurePageSize=function(){var e=(0,t.getValue)("parent",this),i=e.getRowHeight();(0,t.isNullOrUndefined)(e.height)||"string"!=typeof e.height||-1===e.height.indexOf("%")||(e.element.style.height=e.height);var r=2*~~((e.height.toString().indexOf("%")<0?parseInt(e.height.toString(),10):e.element.getBoundingClientRect().height)/i),n=e.pageSettings.pageSize;e.setProperties({pageSettings:{pageSize:n<r?r:n}},!0)},i}(l.VirtualScroll),Ci=function(){function e(e){l.Grid.Inject(l.Freeze),this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("rowExpandCollapse",this.rowExpandCollapse,this),this.parent.on("dataBoundArg",this.dataBoundArg,this),this.parent.grid.on("dblclick",this.dblClickHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("rowExpandCollapse",this.rowExpandCollapse),this.parent.off("dataBoundArg",this.dataBoundArg),this.parent.grid.off("dblclick",this.dblClickHandler))},e.prototype.rowExpandCollapse=function(e){var i,r,n=this.parent.getDataRows(),o=this.parent.getRows(),a=this.parent.getFrozenLeftColumnsCount()>0||this.parent.getFrozenRightColumnsCount()>0;a&&(r=this.parent.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))})),i=e.detailrows.length?e.detailrows:n.filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))});for(var s=0;s<i.length;s++){var d=i[parseInt(s.toString(),10)],l=this.parent.grid.getRowObjectFromUID(d.getAttribute("data-uid")).data;!(0,t.isNullOrUndefined)(n)&&d.parentElement.firstElementChild.clientHeight>0&&(d.style.height=d.parentElement.firstElementChild.clientHeight+"px"),this.parent.toggleRowVisibility(d,e.action),a&&r.length&&this.parent.toggleRowVisibility(r[parseInt(s.toString(),10)],e.action);var p="e-childrow-hidden"===e.action?".e-treecolumn-container .e-treegridcollapse":".e-treecolumn-container .e-treegridexpand";if(o[d.rowIndex].querySelector(p)){for(var h=[],c=0;c<n.length;c++)n[parseInt(c.toString(),10)].querySelector(".e-gridrowindex"+l.index+"level"+(l.level+1))&&h.push(n[parseInt(c.toString(),10)]);if(h.length){var u=this.parent.getCurrentViewRecords()[h[0].rowIndex];this.rowExpandCollapse({detailrows:h,action:e.action,record:u})}}}},e.prototype.dblClickHandler=function(e){(0,l.parentsUntil)(e.target,"e-rowcell")&&this.parent.grid.editSettings.allowEditOnDblClick&&"Cell"!==this.parent.editSettings.mode&&!e.target.classList.contains("e-treegridcollapse")&&!e.target.classList.contains("e-treegridexpand")&&this.parent.startEdit((0,l.parentsUntil)(e.target,"e-row"))},e.prototype.dataBoundArg=function(){this.parent.getColumns().filter(function(e){return e.showCheckbox}).length&&this.parent.freezeModule&&this.parent.initialRender&&(0,t.addClass)([this.parent.element.getElementsByClassName("e-grid")[0]],"e-checkselection")},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getModuleName=function(){return"freeze"},e}(),bi=function(){function e(e){l.Grid.Inject(l.ColumnChooser),this.parent=e}return e.prototype.openColumnChooser=function(e,t){return this.parent.grid.columnChooserModule.openColumnChooser(e,t)},e.prototype.destroy=function(){},e.prototype.getModuleName=function(){return"ColumnChooser"},e}(),Di=function(){function e(e){this.parent=e,l.Grid.Inject(l.InfiniteScroll),this.addEventListener()}return e.prototype.getModuleName=function(){return"infiniteScroll"},e.prototype.addEventListener=function(){this.parent.on(W,this.infinitePageAction,this),this.parent.on("infinite-remote-expand",this.infiniteRemoteExpand,this),this.parent.grid.on("delete-complete",this.infiniteDeleteHandler,this),this.parent.grid.on("infinite-edit-handler",this.infiniteEditHandler,this),this.parent.grid.on("infinite-crud-cancel",this.createRows,this),this.parent.grid.on("content-ready",this.contentready,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("infinite-remote-expand",this.infiniteRemoteExpand),this.parent.grid.off("delete-complete",this.infiniteDeleteHandler),this.parent.grid.off("infinite-edit-handler",this.infiniteEditHandler),this.parent.off(W,this.infinitePageAction),this.parent.grid.off("infinite-crud-cancel",this.createRows),this.parent.grid.off("content-ready",this.contentready))},e.prototype.infiniteRemoteExpand=function(e){for(var t=this.parent.grid.getRowsObject(),i=this.parent.grid.infiniteScrollModule.serviceLocator,r=new l.RowRenderer(i,null,this.parent.grid),n=this.parent.getRows(),o=e.index===n.length-1?"after":"before",a=this.parent.grid.getColumns(),s=this.parent.grid.infiniteScrollModule.generateRows(e.childData,e),d=[],p=0;p<s.length;p++)d.push(r.render(s[parseInt(p.toString(),10)],a));t.splice.apply(t,[e.index+1,0].concat(s));for(p=0;p<d.length;p++)"after"===o?n[e.index+p][""+o](d[parseInt(p.toString(),10)]):n[e.index+p+1][""+o](d[parseInt(p.toString(),10)]),n.splice(e.index+1+p,0,d[parseInt(p.toString(),10)]);(0,l.resetRowIndex)(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0)},e.prototype.contentready=function(){if(this.parent.infiniteScrollSettings.enableCache&&!(0,t.isNullOrUndefined)(this.parent.editModule)){var e="updateIndex";this.parent.editModule[""+e](this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),this.parent.getFrozenColumns()&&this.parent.editModule[""+e](this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords())}},e.prototype.infinitePageAction=function(e){var i=new Ze.DataManager(e.result),r=new Ze.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),n=i.executeLocal((new Ze.Query).where(r)),o=(0,t.getValue)("actionArgs",e.actionArgs),a=(0,t.getValue)("actions",this.parent.grid.infiniteScrollModule);this.parent.grid.infiniteScrollModule.isInitialRender&&!this.parent.initialRender&&(this.parent.grid.pageSettings.currentPage=1);var s=!!a.some(function(e){return e===o.requestType})||!!this.parent.initialRender;if(this.visualData=n,e.count=n.length,(0,t.getValue)("isPrinting",e.actionArgs))e.result=n;else{var d=new Ze.Query,l=this.parent.infiniteScrollSettings.enableCache;l&&this.parent.infiniteScrollSettings.initialBlocks>this.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks);var p=s?this.parent.grid.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks:this.parent.grid.pageSettings.pageSize,h=this.parent.grid.pageSettings.currentPage;if((0,t.isNullOrUndefined)(o))d=d.page(h,p);else{var c=(0,t.getValue)("lastIndex",this.parent.grid.infiniteScrollModule),u=(0,t.getValue)("firstIndex",this.parent.grid.infiniteScrollModule);if(l||"delete"!==o.requestType)d=l&&"delete"===o.requestType||"save"===o.requestType&&"add"===o.action?(d=d.skip(u)).take(this.parent.infiniteScrollSettings.initialBlocks*this.parent.pageSettings.pageSize):d.page(h,p);else{var g=c-o.data.length+1,f=o.data.length;d=d.skip(g).take(f)}}i.dataSource.json=n,l||(0,t.isNullOrUndefined)(o)||"save"!==o.requestType||"add"!==o.action?e.result=i.executeLocal(d):e.result=[o.data]}this.parent.notify("updateAction",e)},e.prototype.infiniteEditHandler=function(e){var t=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData,i=Object.keys(t);if("delete"===e.e.requestType&&e.result.length>1)for(var r=1;r<e.result.length;r++)t[i[i.length-1]].push(e.result[parseInt(r.toString(),10)])},e.prototype.infiniteDeleteHandler=function(e){if("delete"===e.requestType){var t=this.parent.grid.getRowsObject(),i=this.parent.getRows(),r=e.data instanceof Array?e.data:[e.data],n=this.parent.grid.getPrimaryKeyFieldNames()[0];if(this.removeRows(i,t,r,n,!0),this.parent.getFrozenColumns()>0){var o=this.parent.grid.getRowsObject(),a=this.parent.grid.getRows();this.removeRows(a,o,r,n)}}},e.prototype.removeRows=function(e,i,r,n,o){for(var a=this,s=function(s){i.filter(function(d,l){if(d.data[""+n]===r[parseInt(s.toString(),10)][""+n]){if(o){var p=Math.ceil((l+1)/a.parent.grid.pageSettings.pageSize);a.parent.grid.infiniteScrollModule.resetInfiniteCurrentViewData(p,l)}i.splice(l,1),(0,t.remove)(e[parseInt(l.toString(),10)]),e.splice(l,1)}})},d=0;d<r.length;d++)s(d)},e.prototype.createRows=function(e){var i,r,n=e.args.e,o=e.row,a=this.parent.grid.infiniteScrollModule.serviceLocator,s=new l.RowRenderer(a,null,this.parent.grid),d=this.parent.getCurrentViewRecords(),p=e.isMovable?this.parent.grid.getRows():this.parent.grid.getDataRows();i=e.isFrozenRight?this.parent.element.querySelector(".e-frozen-right-content").querySelector("tbody"):this.parent.grid.isFrozenGrid()?(e.isMovable,this.parent.grid.getContent().querySelector("tbody")):this.parent.getContent().querySelector("tbody"),this.parent.frozenRows&&(i=e.isFrozenRows&&"add"!==this.parent.grid.infiniteScrollModule.requestType||!e.isFrozenRows&&"add"===this.parent.grid.infiniteScrollModule.requestType?this.parent.grid.isFrozenGrid()?e.isMovable?this.parent.grid.getHeaderContent().querySelector("tbody"):e.isFrozenRight?this.parent.element.querySelector(".e-frozen-right-header").querySelector("tbody"):this.parent.grid.getHeaderContent().querySelector("tbody"):this.parent.getHeaderContent().querySelector("tbody"):i);for(var h="addRowIndex",c=this.parent.editModule[""+h],u=0;u<o.length;u++){var g=s.render(o[parseInt(u.toString(),10)],this.parent.grid.getColumns());"save"===n.requestType&&"add"===n.action?-1!==(0,t.getValue)("selectedIndex",this.parent.editModule)&&"Top"!==this.parent.editSettings.newRowPosition?"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition?(r="after",c+=at(d[parseInt(c.toString(),10)]).length,"Child"===this.parent.editSettings.newRowPosition&&(c-=1),p[parseInt(c.toString(),10)][""+r](g)):"Above"===this.parent.editSettings.newRowPosition&&(r="before",p[this.parent.editModule[""+h]][""+r](g)):"Bottom"===this.parent.editSettings.newRowPosition?i.appendChild(g):i.insertBefore(g,i.firstElementChild):"delete"===n.requestType&&i.appendChild(g)}e.cancel=!0},e.prototype.destroy=function(){this.removeEventListener()},e}()})(),d})());
|
|
10
|
+
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("SyncfusionBase"),require("SyncfusionGrids"),require("SyncfusionButtons"),require("SyncfusionData"),require("SyncfusionPopups")):"function"==typeof define&&define.amd?define(["SyncfusionBase","SyncfusionGrids","SyncfusionButtons","SyncfusionData","SyncfusionPopups"],t):"object"==typeof exports?exports.SyncfusionTreegrid=t(require("SyncfusionBase"),require("SyncfusionGrids"),require("SyncfusionButtons"),require("SyncfusionData"),require("SyncfusionPopups")):e.SyncfusionTreegrid=t(e.SyncfusionBase,e.SyncfusionGrids,e.SyncfusionButtons,e.SyncfusionData,e.SyncfusionPopups)}(self,(e,t,i,r,n)=>(()=>{"use strict";var o={766:t=>{t.exports=e},741:e=>{e.exports=i},74:e=>{e.exports=r},707:e=>{e.exports=t},197:e=>{e.exports=n}},a={};function s(e){var t=a[e];if(void 0!==t)return t.exports;var i=a[e]={exports:{}};return o[e](i,i.exports,s),i.exports}s.d=(e,t)=>{for(var i in t)s.o(t,i)&&!s.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:t[i]})},s.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),s.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})};var d={};return(()=>{s.r(d),s.d(d,{Aggregate:()=>pi,AggregateColumn:()=>At,AggregateRow:()=>Et,Column:()=>n,ColumnChooser:()=>bi,ColumnMenu:()=>ci,CommandColumn:()=>yi,ContextMenu:()=>ui,ContextMenuItems:()=>ut,DataManipulation:()=>Ct,DetailRow:()=>mi,Edit:()=>fi,EditSettings:()=>qt,ExcelExport:()=>ai,Filter:()=>oi,FilterSettings:()=>y,Freeze:()=>Ci,InfiniteScroll:()=>Di,InfiniteScrollSettings:()=>Ht,LoadingIndicator:()=>c,Logger:()=>C,Page:()=>di,PageSettings:()=>Mt,PdfExport:()=>si,Predicate:()=>f,Render:()=>xt,Reorder:()=>Xt,Resize:()=>$t,RowDD:()=>Zt,RowDropSettings:()=>ii,SearchSettings:()=>St,Selection:()=>gt,SelectionSettings:()=>It,Sort:()=>hi,SortDescriptor:()=>Vt,SortSettings:()=>Bt,StackedColumn:()=>a,Toolbar:()=>li,ToolbarItem:()=>ct,TreeClipboard:()=>Xe,TreeGrid:()=>Jt,TreeGridColumn:()=>o,TreeVirtual:()=>xi,TreeVirtualRowModelGenerator:()=>ni,VirtualScroll:()=>Ri,actionBegin:()=>E,actionComplete:()=>U,actionFailure:()=>Ye,ariaColIndex:()=>Ke,ariaRowIndex:()=>We,autoCol:()=>ke,batchAdd:()=>pe,batchCancel:()=>le,batchDelete:()=>de,batchEditFormRendered:()=>be,batchSave:()=>ge,beforeBatchAdd:()=>ce,beforeBatchCancel:()=>Ce,beforeBatchDelete:()=>he,beforeBatchSave:()=>ue,beforeCopy:()=>$,beforeDataBound:()=>A,beforeExcelExport:()=>z,beforePaste:()=>Z,beforePdfExport:()=>L,beforeStartEdit:()=>xe,beginAdd:()=>re,beginEdit:()=>ie,cellEdit:()=>se,cellSave:()=>oe,cellSaved:()=>ae,checkboxChange:()=>T,collapsed:()=>H,collapsing:()=>G,content:()=>je,contextMenuClick:()=>X,contextMenuOpen:()=>J,crudAction:()=>te,dataBound:()=>O,dataListener:()=>Ie,dataStateChange:()=>N,destroy:()=>we,detailDataBound:()=>De,doubleTap:()=>me,expanded:()=>j,expanding:()=>_,extendArray:()=>dt,findChildrenRecords:()=>at,findParentRecords:()=>nt,frozenContent:()=>Le,frozenHeader:()=>Fe,frozenLeft:()=>Qe,frozenRight:()=>Ge,getExpandStatus:()=>ot,getParentData:()=>pt,getPlainData:()=>lt,headerContent:()=>Ve,indexModifier:()=>Re,isCheckboxcolumn:()=>it,isCountRequired:()=>tt,isFilterChildHierarchy:()=>rt,isHidden:()=>ht,isOffline:()=>st,isRemoteData:()=>et,keyPressed:()=>fe,leftRight:()=>He,load:()=>D,localPagedExpandCollapse:()=>K,movableContent:()=>Be,movableHeader:()=>ze,pagingActions:()=>W,printGridInit:()=>Y,queryCellInfo:()=>P,recordDoubleClick:()=>ne,remoteExpand:()=>Q,resizeStop:()=>F,rowDataBound:()=>M,rowDeselected:()=>V,rowDeselecting:()=>Te,rowDrag:()=>Me,rowDragStart:()=>Ae,rowDragStartHelper:()=>Oe,rowDrop:()=>Pe,rowDropped:()=>qe,rowSelected:()=>k,rowSelecting:()=>q,rowdraging:()=>Ue,rowsAdd:()=>Ee,rowsRemove:()=>Ne,savePreviousRowPosition:()=>ee,table:()=>_e,toolbarClick:()=>B,treeGridDetails:()=>b,updateData:()=>ye,virtualActionArgs:()=>ve,virtualColumnIndex:()=>Se});var e,t=s(766),i=(e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)},function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}),r=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},n=function(){function e(e){this.allowEditing=!0,this.edit={},this.disableHtmlEncode=!0,this.allowReordering=!0,this.showColumnMenu=!0,this.allowFiltering=!0,this.allowSorting=!0,this.allowResizing=!0,this.filter={},(0,t.merge)(this,e)}return e.prototype.setProperties=function(e){for(var t=Object.keys(e),i=0;i<t.length;i++)if(this[t[parseInt(i.toString(),10)]]=e[t[parseInt(i.toString(),10)]],this.parent&&this.parent.isReact&&"template"===t[parseInt(i.toString(),10)]){this.parent.clipboardModule.treeGridParent.renderModule.refreshReactColumnTemplateByUid(this.uid)}},e}(),o=function(e){function n(){return null!==e&&e.apply(this,arguments)||this}return i(n,e),r([(0,t.Property)(null)],n.prototype,"columns",void 0),n}(n),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t}(o),l=s(707),p=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),h=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},c=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return p(i,e),h([(0,t.Property)("Spinner")],i.prototype,"indicatorType",void 0),i}(t.ChildProperty),u=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),g=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},f=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return u(i,e),g([(0,t.Property)()],i.prototype,"field",void 0),g([(0,t.Property)()],i.prototype,"operator",void 0),g([(0,t.Property)()],i.prototype,"value",void 0),g([(0,t.Property)()],i.prototype,"matchCase",void 0),g([(0,t.Property)()],i.prototype,"ignoreAccent",void 0),g([(0,t.Property)()],i.prototype,"predicate",void 0),g([(0,t.Property)({})],i.prototype,"actualFilterValue",void 0),g([(0,t.Property)({})],i.prototype,"actualOperator",void 0),g([(0,t.Property)()],i.prototype,"type",void 0),g([(0,t.Property)()],i.prototype,"ejpredicate",void 0),g([(0,t.Property)()],i.prototype,"uid",void 0),g([(0,t.Property)()],i.prototype,"isForeignKey",void 0),i}(t.ChildProperty),y=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return u(i,e),g([(0,t.Collection)([],f)],i.prototype,"columns",void 0),g([(0,t.Property)("FilterBar")],i.prototype,"type",void 0),g([(0,t.Property)()],i.prototype,"mode",void 0),g([(0,t.Property)(!0)],i.prototype,"showFilterBarStatus",void 0),g([(0,t.Property)(1500)],i.prototype,"immediateModeDelay",void 0),g([(0,t.Property)()],i.prototype,"operators",void 0),g([(0,t.Property)(!1)],i.prototype,"ignoreAccent",void 0),g([(0,t.Property)("Parent")],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),m=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),S=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},v=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return m(i,e),S([(0,t.Property)("Both")],i.prototype,"wrapMode",void 0),i}(t.ChildProperty),w=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),I="https://ej2.syncfusion.com/documentation/treegrid",R="https://ej2.syncfusion.com/documentation",x=!1,C=function(e){function i(t){return l.Grid.Inject(l.Logger),e.call(this,t)||this}return w(i,e),i.prototype.getModuleName=function(){return"logger"},i.prototype.log=function(e,i){e instanceof Array||(e=[e]);for(var r=e,n=0;n<r.length;n++){var o=l.detailLists[r[parseInt(n.toString(),10)]],a=o.check(i,this.parent);if(a.success){var s=o.generateMessage(i,this.parent,a.options);s=s.replace("EJ2Grid","EJ2TreeGrid").replace("* Hierarchy Grid","").replace("* Grouping",""),x&&"primary_column_missing"===r[parseInt(n.toString(),10)]&&(s=s.replace("Editing","Row DragAndDrop"),x=!1);var d=s.indexOf("https"),p=s.substring(d);"module_missing"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/modules"):"primary_column_missing"===r[parseInt(n.toString(),10)]||"selection_key_missing"===r[parseInt(n.toString(),10)]?s=s.replace(p,R+"/api/treegrid/column/#isprimarykey"):"grid_remote_edit"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/edit"):"virtual_height"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/virtual"):"check_datasource_columns"===r[parseInt(n.toString(),10)]?s=s.replace(p,I+"/columns"):"locale_missing"===r[parseInt(n.toString(),10)]&&(s=s.replace(p,I+"/global-local/#localization")),"datasource_syntax_mismatch"===r[parseInt(n.toString(),10)]&&((0,t.isNullOrUndefined)(this.treeGridObj)||(0,t.isNullOrUndefined)(this.treeGridObj.dataStateChange))||console[o.logType](s)}}},i.prototype.treeLog=function(e,t,i){this.treeGridObj=i,e instanceof Array||(e=[e]);var r=e;i.allowRowDragAndDrop&&!i.columns.filter(function(e){return e.isPrimaryKey}).length&&(x=!0,this.log("primary_column_missing",t));for(var n=0;n<r.length;n++){var o=b[r[parseInt(n.toString(),10)]],a=o.check(t,i);if(a.success){var s=o.generateMessage(t,i,a.options);console[o.logType](s)}}},i}(l.Logger),b={mapping_fields_missing:{type:"mapping_fields_missing",logType:"error",check:function(e,i){var r={success:!1};return((0,t.isNullOrUndefined)(i.idMapping)&&(0,t.isNullOrUndefined)(i.childMapping)&&(0,t.isNullOrUndefined)(i.parentIdMapping)||!(0,t.isNullOrUndefined)(i.idMapping)&&(0,t.isNullOrUndefined)(i.parentIdMapping)||(0,t.isNullOrUndefined)(i.idMapping)&&!(0,t.isNullOrUndefined)(i.parentIdMapping))&&(r={success:!0}),r},generateMessage:function(){return"[EJ2TreeGrid.Error]: MAPPING FIELDS MISSING \nOne of the following fields is missing. It is required for the hierarchical relationship of records in TreeGrid:\n* childMapping\n* idMapping\n* parentIdMapping\nRefer to the following documentation links for more details.\n"+R+"/api/treegrid#childmapping\n"+R+"/api/treegrid#idmapping\n"+R+"/api/treegrid#$parentidmapping"}}},D="load",M="rowDataBound",O="dataBound",P="queryCellInfo",A="beforeDataBound",E="actionBegin",N="dataStateChange",U="actionComplete",q="rowSelecting",k="rowSelected",T="checkboxChange",V="rowDeselected",B="toolbarClick",z="beforeExcelExport",L="beforePdfExport",F="resizeStop",j="expanded",_="expanding",H="collapsed",G="collapsing",Q="remoteExpand",K="localPagedExpandCollapse",W="pagingActions",Y="printGrid-Init",J="contextMenuOpen",X="contextMenuClick",$="beforeCopy",Z="beforePaste",ee="savePreviousRowPosition",te="crudAction",ie="beginEdit",re="beginAdd",ne="recordDoubleClick",oe="cellSave",ae="cellSaved",se="cellEdit",de="batchDelete",le="batchCancel",pe="batchAdd",he="beforeBatchDelete",ce="beforeBatchAdd",ue="beforeBatchSave",ge="batchSave",fe="key-pressed",ye="update-data",me="double-tap",Se="virtualColumnIndex",ve="virtual-action-args",we="destroy",Ie="data-listener",Re="index-modifier",xe="edit-form",Ce="before-batch-cancel",be="batcheditform-rendered",De="detailDataBound",Me="rowDrag",Oe="rowDragStartHelper",Pe="rowDrop",Ae="rowDragStart",Ee="rows-add",Ne="rows-remove",Ue="row-draging",qe="row-dropped",ke="auto-col",Te="rowDeselecting",Ve="e-headercontent",Be="e-movablecontent",ze="e-movableheader",Le="e-frozencontent",Fe="e-frozenheader",je="e-content",_e="e-table",He="Left-Right",Ge="frozen-right",Qe="frozen-left",Ke="aria-colindex",We="aria-rowindex",Ye="actionFailure",Je=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Xe=function(e){function i(t,i){var r=e.call(this,t.grid,i)||this;return r.treeCopyContent="",r.copiedUniqueIdCollection=[],r.treeGridParent=t,r.serviceLocator=i,r}return Je(i,e),i.prototype.setCopyData=function(i){var r="copyContent",n="getCopyData",o=this.treeGridParent.getCurrentViewRecords();if(""===window.getSelection().toString()){this.clipBoardTextArea.value=this[""+r]="";var a=this.treeGridParent.grid.getRows();if("Cell"!==this.treeGridParent.selectionSettings.mode){for(var s=this.treeGridParent.getSelectedRowIndexes().sort(function(e,t){return e-t}),d=0;d<s.length;d++){d>0&&(this.treeCopyContent+="\n");var l=s[parseInt(d.toString(),10)];if(!a[l].classList.contains("e-summaryrow")){var p=[].slice.call(a[l].querySelectorAll(".e-rowcell")),h=this.treeGridParent.getSelectedRecords()[parseInt(d.toString(),10)].uniqueID;-1===this.copiedUniqueIdCollection.indexOf(h)&&("Parent"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.parentContentData(o,l,a,i,d),this[""+n](p,!1,"\t",i),this.treeCopyContent+=this[""+r],this.copiedUniqueIdCollection.push(h),this[""+r]="","Child"!==this.treeGridParent.copyHierarchyMode&&"Both"!==this.treeGridParent.copyHierarchyMode||this.childContentData(o,s[parseInt(d.toString(),10)],a,i))}}if(i){var c=this.treeGridParent.getVisibleColumns().map(function(e){return e.headerText});this[""+n](c,!1,"\t",i),this.treeCopyContent=this[""+r]+"\n"+this.treeCopyContent}var u={data:this.treeCopyContent,cancel:!1};if(this.treeGridParent.trigger($,u),u.cancel)return;this.clipBoardTextArea.value=this[""+r]=u.data,t.Browser.userAgent.match(/ipad|ipod|iphone/i)?this.clipBoardTextArea.setSelectionRange(0,this.clipBoardTextArea.value.length):this.clipBoardTextArea.select(),this.isSelect=!0,this.copiedUniqueIdCollection=[],this.treeCopyContent=""}else e.prototype.setCopyData.call(this,i)}},i.prototype.parentContentData=function(e,i,r,n,o){var a="copyContent",s="parentItem",d="uniqueID";if(!(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)][""+s]))for(var l=e[parseInt(i.toString(),10)][""+s].level,p=0;p<l+1;p++)for(var h=0;h<e.length;h++)if(!(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)][""+s])&&e[parseInt(h.toString(),10)][""+d]===e[parseInt(i.toString(),10)][""+s][""+d]){i=h;var c=[].slice.call(r[parseInt(i.toString(),10)].querySelectorAll(".e-rowcell")),u=e[parseInt(h.toString(),10)][""+d];if(-1===this.copiedUniqueIdCollection.indexOf(u)){this.getCopyData(c,!1,"\t",n),this.treeCopyContent=o>0?this.treeCopyContent+this[""+a]+"\n":this[""+a]+"\n"+this.treeCopyContent,this.copiedUniqueIdCollection.push(u),this[""+a]="";break}}},i.prototype.copy=function(t){e.prototype.copy.call(this,t)},i.prototype.paste=function(t,i,r){e.prototype.paste.call(this,t,i,r)},i.prototype.getModuleName=function(){return"clipboard"},i.prototype.destroy=function(){e.prototype.destroy.call(this)},i.prototype.childContentData=function(e,i,r,n){var o="copyContent",a="uniqueID";if(e[parseInt(i.toString(),10)].hasChildRecords)for(var s=e[parseInt(i.toString(),10)].childRecords,d=0;d<s.length;d++)for(var l=0;l<e.length;l++)if(!(0,t.isNullOrUndefined)(s[parseInt(d.toString(),10)][""+a])&&e[parseInt(l.toString(),10)][""+a]===s[parseInt(d.toString(),10)][""+a]){if(!(0,t.isNullOrUndefined)(r[parseInt(l.toString(),10)])&&!r[parseInt(l.toString(),10)].classList.contains("e-summaryrow")){var p=[].slice.call(r[parseInt(l.toString(),10)].querySelectorAll(".e-rowcell")),h=e[parseInt(l.toString(),10)][""+a];-1===this.copiedUniqueIdCollection.indexOf(h)&&(this.getCopyData(p,!1,"\t",n),this.treeCopyContent+="\n"+this[""+o],this[""+o]="",this.copiedUniqueIdCollection.push(h),this.childContentData(e,l,r,n))}break}},i}(l.Clipboard),$e=s(741),Ze=s(74);function et(e){var t;return e.treeGrid&&e.treeGrid.isGantt?!!e.taskFields.hasChildMapping&&(e.dataSource instanceof Ze.DataManager&&((t=e.dataSource.adaptor)instanceof Ze.ODataAdaptor||t instanceof Ze.WebApiAdaptor||t instanceof Ze.WebMethodAdaptor||t instanceof Ze.CacheAdaptor||t instanceof Ze.UrlAdaptor)):e.dataSource instanceof Ze.DataManager&&((t=e.dataSource.adaptor)instanceof Ze.ODataAdaptor||t instanceof Ze.WebApiAdaptor||t instanceof Ze.WebMethodAdaptor||t instanceof Ze.CacheAdaptor||t instanceof Ze.UrlAdaptor)}function tt(e){return!(!e.dataSource||!("result"in e.dataSource))}function it(e){for(var t=0;t<e.columns.length;t++)if(e.columns[parseInt(t.toString(),10)].showCheckbox)return!0;return!1}function rt(e){return!(((0,t.isNullOrUndefined)(e.grid.searchSettings.key)||""===e.grid.searchSettings.key||"Child"!==e.searchSettings.hierarchyMode&&"None"!==e.searchSettings.hierarchyMode)&&(!e.allowFiltering||!e.grid.filterSettings.columns.length||"Child"!==e.filterSettings.hierarchyMode&&"None"!==e.filterSettings.hierarchyMode))}function nt(e){for(var t=[],i=0,r=Object.keys(e).length;i<r;i++){(0,l.getObject)("hasChildRecords",e[parseInt(i.toString(),10)])&&t.push(e[parseInt(i.toString(),10)])}return t}function ot(e,i,r){var n,o=(0,t.isNullOrUndefined)(i.parentItem)?null:pt(e,i.parentItem.uniqueID);return null==o||(!e.initialRender||(0,t.isNullOrUndefined)(o[e.expandStateMapping])||o[e.expandStateMapping]?!1!==o.expanded&&(!o.parentItem||((n=pt(e,o.parentItem.uniqueID))&&e.initialRender&&!(0,t.isNullOrUndefined)(n[e.expandStateMapping])&&!n[e.expandStateMapping]?(n.expanded=!1,!1):(!n||!1!==n.expanded)&&(!n||ot(e,n,r)))):(o.expanded=!1,!1))}function at(e){var i=[];if((0,t.isNullOrUndefined)(e)||!e.hasChildRecords&&!(0,t.isNullOrUndefined)(e.childRecords)&&!e.childRecords.length)return[];if(!(0,t.isNullOrUndefined)(e.childRecords))for(var r=e.childRecords.filter(function(e){return!e.isSummaryRow}),n=0,o=Object.keys(r).length;n<o;n++)i.push(r[parseInt(n.toString(),10)]),(r[parseInt(n.toString(),10)].hasChildRecords||!(0,t.isNullOrUndefined)(r[parseInt(n.toString(),10)].childRecords)&&r[parseInt(n.toString(),10)].childRecords.length)&&(i=i.concat(at(r[parseInt(n.toString(),10)])));return i}function st(e){if(et(e)){var i=e.dataSource;return!(0,t.isNullOrUndefined)(i.ready)}return!0}function dt(e){for(var t,i,r=[],n=0;e&&n<e.length;n++){i=Object.keys(e[parseInt(n.toString(),10)]),t={};for(var o=0;o<i.length;o++)t[i[parseInt(o.toString(),10)]]=e[parseInt(n.toString(),10)][i[parseInt(o.toString(),10)]];r.push(t)}return r}function lt(e){return delete e.hasChildRecords,delete e.childRecords,delete e.index,delete e.parentItem,delete e.level,delete e.taskData,delete e.uniqueID,e}function pt(e,t,i){if(i){return e.uniqueIDFilterCollection[""+t]}return e.uniqueIDCollection[""+t]}function ht(e){var t=window.getComputedStyle(e);return"none"===t.display||"hidden"===t.visibility}var ct,ut,gt=function(){function e(e){this.parent=e,this.selectedItems=[],this.selectedIndexes=[],this.filteredList=[],this.searchingRecords=[],this.addEventListener()}return e.prototype.getModuleName=function(){return"selection"},e.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.headerCheckbox,this),this.parent.on("columnCheckbox",this.columnCheckbox,this),this.parent.on("updateGridActions",this.updateGridActions,this),this.parent.grid.on("colgroup-refresh",this.headerCheckbox,this),this.parent.on("checkboxSelection",this.checkboxSelection,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.headerCheckbox),this.parent.off("columnCheckbox",this.columnCheckbox),this.parent.grid.off("colgroup-refresh",this.headerCheckbox),this.parent.off("checkboxSelection",this.checkboxSelection),this.parent.off("updateGridActions",this.updateGridActions))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.checkboxSelection=function(e){var i,r,n=(0,l.getObject)("target",e),o=(0,l.parentsUntil)(n,"e-checkbox-wrapper");if(o&&o.querySelectorAll(".e-treecheckselect").length>0){r=o.querySelector('input[type="checkbox"]');var a=[];a.push(n.closest("tr").rowIndex),this.selectCheckboxes(a),this.triggerChkChangeEvent(r,r.nextElementSibling.classList.contains("e-check"),n.closest("tr"))}else if(o&&o.querySelectorAll(".e-treeselectall").length>0&&this.parent.autoCheckHierarchy){var s=!o.querySelector(".e-frame").classList.contains("e-check")&&!o.querySelector(".e-frame").classList.contains("e-stop");this.headerSelection(s),r=o.querySelector('input[type="checkbox"]'),this.triggerChkChangeEvent(r,s,n.closest("tr"))}!(0,t.isNullOrUndefined)(this.parent.parentQuery)&&this.parent.selectionSettings.persistSelection&&this.parent.columnModel.filter(function(e){return"checkbox"===e.type}).length>0&&et(this.parent)&&this.parent.parentQuery.length>0&&((i=this.parent.query.queries).push.apply(i,this.parent.parentQuery),this.parent.parentQuery=[])},e.prototype.triggerChkChangeEvent=function(e,t,i){var r=this.parent.getCurrentViewRecords()[i.rowIndex],n={checked:t,target:e,rowElement:i,rowData:e.classList.contains("e-treeselectall")?this.parent.getCheckedRecords():r};this.parent.trigger(T,n)},e.prototype.getCheckboxcolumnIndex=function(){for(var e,t,i=this.parent.stackedHeader?this.parent.columnModel:this.parent.columns,r=0;r<i.length;r++)i[parseInt(r.toString(),10)].showCheckbox&&(e=i[parseInt(r.toString(),10)].uid);for(var n=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv").length,o=0;o<n;o++){this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[parseInt(o.toString(),10)].getAttribute("data-mappinguid")===e&&(t=o)}return t},e.prototype.headerCheckbox=function(){if(this.columnIndex=this.getCheckboxcolumnIndex(),this.columnIndex>-1&&0===this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length){var e=this.parent.getHeaderContent().querySelectorAll(".e-headercelldiv")[this.columnIndex],i=this.parent.createElement("input",{className:"e-treeselectall",attrs:{type:"checkbox"}});(r=(0,$e.createCheckBox)(this.parent.createElement,!1,{checked:!1,label:" "})).classList.add("e-hierarchycheckbox"),r.insertBefore(i.cloneNode(),r.firstChild),(0,t.isNullOrUndefined)(e)||e.insertBefore(r,e.firstChild),this.parent.autoCheckHierarchy&&this.headerSelection()}else if(this.columnIndex>-1&&this.parent.getHeaderContent().querySelectorAll(".e-treeselectall").length>0){var r,n=(r=this.parent.getHeaderContent().querySelectorAll(".e-checkbox-wrapper")[0]).querySelector(".e-frame").classList.contains("e-check");this.parent.autoCheckHierarchy&&n&&this.headerSelection(n)}},e.prototype.renderColumnCheckbox=function(e){var i=this.parent.createElement("input",{className:"e-treecheckselect",attrs:{type:"checkbox","aria-label":"checkbox"}}),r=e.data;e.cell.classList.add("e-treegridcheckbox"),e.cell.setAttribute("aria-label","checkbox");var n=!(0,t.isNullOrUndefined)(r.checkboxState)&&"uncheck"!==r.checkboxState,o=(0,$e.createCheckBox)(this.parent.createElement,!1,{checked:n,label:" "});if(o.classList.add("e-hierarchycheckbox"),this.parent.allowTextWrap&&(o.querySelector(".e-frame").style.width="18px"),"indeterminate"===r.checkboxState){var a=o.querySelectorAll(".e-frame")[0];(0,t.removeClass)([a],["e-check","e-stop","e-uncheck"]),o.querySelector(".e-frame").classList.add("e-stop")}return o.insertBefore(i.cloneNode(),o.firstChild),o},e.prototype.columnCheckbox=function(e){var i=this.renderColumnCheckbox(e),r=e.cell.querySelector(".e-treecolumn-container");if((0,t.isNullOrUndefined)(r)){var n=this.parent.createElement("span",{className:"e-treecheckbox"}),o=e.cell.innerHTML;e.cell.innerHTML="",n.innerHTML=o;var a=this.parent.createElement("div",{className:"e-treecheckbox-container"});a.appendChild(i),a.appendChild(n),e.cell.appendChild(a)}else e.cell.querySelector(".e-hierarchycheckbox")||r.insertBefore(i,r.querySelectorAll(".e-treecell")[0])},e.prototype.selectCheckboxes=function(e){if((0,t.isNullOrUndefined)(e)){this.parent.trigger(Ye,{error:"The provided value for the rowIndexes is undefined. Please ensure the rowIndexes contains number."})}for(var i=0;i<e.length;i++){var r=this.parent.getCurrentViewRecords()[e[parseInt(i.toString(),10)]],n=pt(this.parent,r.uniqueID),o="uncheck"===(r=n).checkboxState?"check":"uncheck";r.checkboxState=o;for(var a=Object.keys(r),s=0;s<a.length;s++)Object.prototype.hasOwnProperty.call(n,a[parseInt(s.toString(),10)])&&(n[a[parseInt(s.toString(),10)]]=r[a[parseInt(s.toString(),10)]]);this.traverSelection(r,o,!1),this.parent.autoCheckHierarchy&&this.headerSelection()}},e.prototype.traverSelection=function(e,i,r){var n=0;if(this.updateSelectedItems(e,i),!r&&e.parentItem&&this.parent.autoCheckHierarchy&&this.updateParentSelection(e.parentItem),e.childRecords&&this.parent.autoCheckHierarchy){var o=e.childRecords;!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.parent.autoCheckHierarchy&&(o=this.getFilteredChildRecords(o)),n=o.length;for(var a=0;a<n;a++)o[parseInt(a.toString(),10)].isSummaryRow||(o[parseInt(a.toString(),10)].hasChildRecords?this.traverSelection(o[parseInt(a.toString(),10)],i,!0):this.updateSelectedItems(o[parseInt(a.toString(),10)],i))}},e.prototype.getFilteredChildRecords=function(e){var t=this;return e.filter(function(e){return t.parent.filterModule.filteredResult.indexOf(e)>-1})},e.prototype.updateParentSelection=function(e){var i,r=[],n=pt(this.parent,e.uniqueID);n&&n.childRecords&&(r=n.childRecords),!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.parent.autoCheckHierarchy&&(r=this.getFilteredChildRecords(r)),i=r&&r.length;var o=0,a=0;if(!(0,t.isNullOrUndefined)(n)){for(var s=0;s<r.length;s++){var d=pt(this.parent,r[parseInt(s.toString(),10)].uniqueID);(0,t.isNullOrUndefined)(d)||("indeterminate"===d.checkboxState?o++:"check"===d.checkboxState&&a++)}o>0||a>0&&a!==i?n.checkboxState="indeterminate":(0!==a||n.hasFilteredChildRecords&&!(0,t.isNullOrUndefined)(n.hasFilteredChildRecords)||(0,t.isNullOrUndefined)(this.parent.dataResults.actionArgs)||"searching"!==this.parent.dataResults.actionArgs.requestType&&"filtering"!==this.parent.dataResults.actionArgs.requestType||"check"!==n.checkboxState)&&(0===a&&0===o||0===a&&n.hasFilteredChildRecords&&!(0,t.isNullOrUndefined)(this.parent.dataResults.actionArgs)&&("searching"===this.parent.dataResults.actionArgs.requestType||"filtering"===this.parent.dataResults.actionArgs.requestType)&&"check"===n.checkboxState)?n.checkboxState="uncheck":n.checkboxState="check",this.updateSelectedItems(n,n.checkboxState),n.parentItem&&this.updateParentSelection(n.parentItem)}},e.prototype.headerSelection=function(e){var i,r,n=this,o=!1;if(!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0){var a=this.parent.filterModule.filteredResult;0===this.filteredList.length&&(this.filteredList=a),this.parent.grid.searchSettings.key.length?this.searchingRecords=a:this.filteredList!==a?(this.filteredList=a,o=!0):o=!1}if(this.filteredList.length>0&&(this.parent.filterSettings.columns.length||!this.filteredList.length||this.parent.grid.searchSettings.key.length||(this.filteredList=[]),this.searchingRecords.length&&!(0,t.isNullOrUndefined)(e)&&(this.filteredList=this.searchingRecords)),r=!(0,t.isNullOrUndefined)(this.parent.filterModule)&&0===this.parent.filterModule.filteredResult.length&&0===this.parent.getCurrentViewRecords().length&&this.parent.filterSettings.columns.length>0||!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.filteredList.length>0?this.filteredList:this.parent.flatData,r=et(this.parent)?this.parent.getCurrentViewRecords():r,!(0,t.isNullOrUndefined)(e))for(var s=0;s<r.length;s++)if(e){if("check"===r[parseInt(s.toString(),10)].checkboxState)continue;if(o)continue;r[parseInt(s.toString(),10)].checkboxState="check",this.updateSelectedItems(r[parseInt(s.toString(),10)],r[parseInt(s.toString(),10)].checkboxState)}else this.selectedItems.indexOf(r[parseInt(s.toString(),10)])>-1&&(r[parseInt(s.toString(),10)].checkboxState="uncheck",this.updateSelectedItems(r[parseInt(s.toString(),10)],r[parseInt(s.toString(),10)].checkboxState),this.parent.autoCheckHierarchy&&this.updateParentSelection(r[parseInt(s.toString(),10)]));!1===e&&this.parent.enableVirtualization&&(this.selectedItems=[],this.selectedIndexes=[],r.filter(function(e){e.checkboxState="uncheck",n.updateSelectedItems(e,e.checkboxState)})),i=this.selectedItems.length;var d=this.parent.getHeaderContent().querySelectorAll(".e-frame")[0];i>0&&r.length>0?i===r.length||e?((0,t.removeClass)([d],["e-stop"]),d.classList.add("e-check")):((0,t.removeClass)([d],["e-check"]),d.classList.add("e-stop")):(0,t.removeClass)([d],["e-check","e-stop"])},e.prototype.updateSelectedItems=function(e,i){var r,n,o=this.parent.grid.currentViewData.filter(function(t){return t.uniqueID===e.uniqueID}),a=this.parent.grid.currentViewData.indexOf(o[0]),s=pt(this.parent,e.uniqueID),d=this.parent.getRows()[parseInt(a.toString(),10)];if(a>-1){var l=void 0;(this.parent.frozenRows||this.parent.getFrozenColumns())&&(l=this.parent.getDataRows()[parseInt(a.toString(),10)]),n=d.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]?d.querySelectorAll(".e-hierarchycheckbox .e-frame")[0]:l.querySelectorAll(".e-hierarchycheckbox .e-frame")[0],(0,t.isNullOrUndefined)(n)||(0,t.removeClass)([n],["e-check","e-stop","e-uncheck"])}if(r=s,(0,t.isNullOrUndefined)(r)&&(r=e),r.checkboxState=i,"check"===i&&(0,t.isNullOrUndefined)(e.isSummaryRow))-1!==a&&-1===this.selectedIndexes.indexOf(a)&&this.selectedIndexes.push(a),-1===this.selectedItems.indexOf(r)&&-1!==a&&!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.selectedItems.push(r),-1===this.selectedItems.indexOf(r)&&(this.parent.enableVirtualization||this.parent.allowPaging)&&!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0&&this.selectedItems.push(r),-1!==this.selectedItems.indexOf(r)||(0,t.isNullOrUndefined)(this.parent.filterModule)||0!==this.parent.filterModule.filteredResult.length||this.selectedItems.push(r),-1===this.selectedItems.indexOf(r)&&(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.selectedItems.push(r);else if(("uncheck"===i||"indeterminate"===i)&&(0,t.isNullOrUndefined)(e.isSummaryRow)){var p=this.selectedItems.indexOf(r);if(-1!==p&&this.selectedItems.splice(p,1),-1!==this.selectedIndexes.indexOf(a)){var h=this.selectedIndexes.indexOf(a);this.selectedIndexes.splice(h,1)}}var c="indeterminate"===i?"e-stop":"e-"+i;a>-1&&((0,t.isNullOrUndefined)(n)||(n.classList.add(c),d.querySelector(".e-treecheckselect").setAttribute("aria-checked","check"===i?"true":"uncheck"===i?"false":"mixed")))},e.prototype.updateGridActions=function(e){var i,r,n=this,o=e.requestType;if(it(this.parent))if(this.parent.autoCheckHierarchy)if("sorting"===o||"paging"===o){var a=this.parent.grid.getRows();r=(i=this.parent.getCurrentViewRecords()).length,this.selectedIndexes=[];for(var s=0;s<r;s++)a[parseInt(s.toString(),10)].classList.contains("e-summaryrow")||this.updateSelectedItems(i[parseInt(s.toString(),10)],i[parseInt(s.toString(),10)].checkboxState)}else if("delete"===o||"add"===e.action){var d=[];"delete"===o?d=e.data:d.push(e.data);for(s=0;s<d.length;s++){if("delete"===o){var l=this.parent.flatData.indexOf(d[parseInt(s.toString(),10)]),p=this.selectedIndexes.indexOf(l);this.selectedIndexes.splice(p,1),this.updateSelectedItems(d[parseInt(s.toString(),10)],"uncheck")}(0,t.isNullOrUndefined)(d[parseInt(s.toString(),10)].parentItem)||this.updateParentSelection(d[parseInt(s.toString(),10)].parentItem)}}else"add"===e.requestType&&this.parent.autoCheckHierarchy?e.data.checkboxState="uncheck":("filtering"===o||"searching"===o||"refresh"===o&&!et(this.parent))&&(this.selectedItems=[],this.selectedIndexes=[],(i=!(0,t.isNullOrUndefined)(this.parent.filterModule)&&this.parent.filterModule.filteredResult.length>0?this.parent.filterModule.filteredResult:this.parent.flatData).forEach(function(e){if(n.parent.enableVirtualization){e.hasChildRecords&&e.childRecords.length>0?n.updateParentSelection(e):n.updateSelectedItems(e,e.checkboxState);var i=at(e);i=n.getFilteredChildRecords(i);for(var r=0;r<i.length;r++)i[parseInt(r.toString(),10)].hasChildRecords?n.updateParentSelection(i[parseInt(r.toString(),10)]):i[parseInt(r.toString(),10)].hasChildRecords||(0,t.isNullOrUndefined)(i[parseInt(r.toString(),10)])||n.updateSelectedItems(i[parseInt(r.toString(),10)],i[parseInt(r.toString(),10)].checkboxState)}else e.hasChildRecords?n.updateParentSelection(e):n.updateSelectedItems(e,e.checkboxState)}),this.headerSelection());else"filtering"!==o&&"searching"!==o&&"refresh"!==o||et(this.parent)||(this.selectedItems=[],this.selectedIndexes=[])},e.prototype.getCheckedrecords=function(){return this.selectedItems},e.prototype.getCheckedRowIndexes=function(){return this.selectedIndexes},e}(),ft=function(){function e(e){this.parent=e,l.Grid.Inject(l.Print),this.addEventListener()}return e.prototype.getModuleName=function(){return"print"},e.prototype.addEventListener=function(){this.parent.grid.on(Y,this.printTreeGrid,this)},e.prototype.removeEventListener=function(){this.parent.grid.off(Y,this.printTreeGrid)},e.prototype.printTreeGrid=function(e){var i=(0,l.getObject)("printgrid",e),r=(0,l.getObject)("element",e);i.addEventListener(P,this.parent.grid.queryCellInfo),i.addEventListener(M,this.parent.grid.rowDataBound),i.addEventListener(A,this.parent.grid.beforeDataBound),(0,t.addClass)([r],"e-treegrid")},e.prototype.print=function(){this.parent.grid.print()},e.prototype.destroy=function(){this.removeEventListener()},e}(),yt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),mt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},St=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return yt(i,e),mt([(0,t.Property)()],i.prototype,"fields",void 0),mt([(0,t.Property)(!1)],i.prototype,"ignoreCase",void 0),mt([(0,t.Property)("contains")],i.prototype,"operator",void 0),mt([(0,t.Property)()],i.prototype,"key",void 0),mt([(0,t.Property)()],i.prototype,"hierarchyMode",void 0),i}(t.ChildProperty),vt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),wt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},It=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return vt(i,e),wt([(0,t.Property)("Row")],i.prototype,"mode",void 0),wt([(0,t.Property)("Flow")],i.prototype,"cellSelectionMode",void 0),wt([(0,t.Property)("Single")],i.prototype,"type",void 0),wt([(0,t.Property)(!1)],i.prototype,"persistSelection",void 0),wt([(0,t.Property)("Default")],i.prototype,"checkboxMode",void 0),wt([(0,t.Property)(!1)],i.prototype,"checkboxOnly",void 0),wt([(0,t.Property)(!0)],i.prototype,"enableToggle",void 0),i}(t.ChildProperty),Rt=s(197),xt=function(){function e(e){this.parent=e,this.templateResult=null,this.parent.grid.on("template-result",this.columnTemplateResult,this),this.parent.grid.on("reactTemplateRender",this.reactTemplateRender,this)}return e.prototype.RowModifier=function(e){if(e.data){var i=e.data,r=i.parentItem;if(!(0,t.isNullOrUndefined)(i.parentItem)&&!rt(this.parent)&&(!this.parent.allowPaging||"Root"===this.parent.pageSettings.pageSizeMode||et(this.parent)&&!st(this.parent)))if((this.parent.initialRender&&(!((0,t.isNullOrUndefined)(r[this.parent.expandStateMapping])||r[this.parent.expandStateMapping])||this.parent.enableCollapseAll)||!ot(this.parent,e.data,this.parent.grid.getCurrentViewRecords()))&&!(0,t.isNullOrUndefined)(e.row)){this.parent.toggleRowVisibility(e.row,"e-childrow-hidden");var n=this.parent.grid.getRowsObject();this.parent.grid.isFrozenGrid()||(0,t.isNullOrUndefined)(e.row.getAttribute("data-uid"))||(n.filter(function(t){return t.uid===e.row.getAttribute("data-uid")})[0].visible=!1)}if(et(this.parent)&&!st(this.parent)){var o=this.parent,a=this.parent.getCurrentViewRecords().filter(function(e){return(0,t.getValue)(o.idMapping,e)===(0,t.getValue)(o.parentIdMapping,i)});if(a.length>0&&!a[0].isSummaryRow&&!(0,t.isNullOrUndefined)(e.row)){var s=a[0].expanded?"e-childrow-visible":"e-childrow-hidden";this.parent.toggleRowVisibility(e.row,s)}}(0,l.getObject)("isSummaryRow",e.data)&&(0,t.addClass)([e.row],"e-summaryrow"),(0,t.isNullOrUndefined)(e.row)||(e.row.querySelector(".e-treegridexpand")?e.row.setAttribute("aria-expanded","true"):e.row.querySelector(".e-treegridcollapse")&&e.row.setAttribute("aria-expanded","false"),this.parent.enableCollapseAll&&this.parent.initialRender&&((0,t.isNullOrUndefined)(i.parentItem)||this.parent.toggleRowVisibility(e.row,"e-childrow-hidden")));if(this.parent.rowDragAndDropModule&&this.parent.grid.rowDragAndDropModule&&(this.parent.grid.rowDragAndDropModule.dragStartData||this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.getContentTable().scrollHeight<=this.parent.getContent().clientHeight){this.parent.getVisibleRecords()[this.parent.getVisibleRecords().length-1].uniqueID!==e.data.uniqueID||(0,t.isNullOrUndefined)(e.row)||e.row.cells[0].classList.contains("e-lastrowcell")||this.parent.lastRowBorder(e.row,!0)}if(this.parent.isReact){var d=this;d.parent.renderReactTemplates(function(){d.parent.trigger(M,e)})}else this.parent.trigger(M,e)}},e.prototype.cellRender=function(e){if(e.data){var i,r,n=this.parent.grid,o=e.data,a=(0,t.isNullOrUndefined)(o.filterLevel)?o.level:o.filterLevel,s=0,d=this.parent.getColumnByUid(e.column.uid),p=o.isSummaryRow,h=this.parent.getFrozenColumns();i=(0,t.isNullOrUndefined)(o.parentItem)?o.index:o.parentItem.index;if((this.parent.enableColumnVirtualization&&!this.parent.initialRender?this.parent.getVirtualColIndexByUid(e.column.uid):n.getColumnIndexByUid(e.column.uid))!==this.parent.treeColumnIndex||"add"!==e.requestType&&"rowDragAndDrop"!==e.requestType&&"delete"!==e.requestType&&!(0,t.isNullOrUndefined)(e.cell.querySelector(".e-treecell")))this.templateResult&&(this.templateResult=null);else{var c=(0,t.createElement)("div",{className:"e-treecolumn-container"}),u=(0,t.createElement)("span",{className:"e-icons e-none"});u.style.width="10px",u.style.display="inline-block";for(var g=0;g<a;g++)s+=10,c.appendChild(u.cloneNode());var f=(0,t.isNullOrUndefined)(o.hasFilteredChildRecords)?o.hasChildRecords:o.hasFilteredChildRecords;if(f&&!(0,t.isNullOrUndefined)(o.childRecords)&&(f=this.parent.isFromGantt&&this.parent.loadChildOnDemand?o.hasChildRecords:!(0===o.childRecords.length)),f){(0,t.addClass)([e.cell],"e-treerowcell"),e.cell.setAttribute("aria-expanded",o.expanded?"true":"false");var y=(0,t.createElement)("span",{className:"e-icons"}),m=void 0;if(this.parent.initialRender)m=o.expanded&&((0,t.isNullOrUndefined)(o[this.parent.expandStateMapping])||o[this.parent.expandStateMapping])&&!this.parent.enableCollapseAll;else if(m=!(!o.expanded||!ot(this.parent,o,this.parent.grid.getCurrentViewRecords())),"Cell"===this.parent.editSettings.mode&&!et(this.parent)){var S=this.parent.flatData.find(function(e){return e.uniqueID===o.uniqueID});(0,t.isNullOrUndefined)(S)||(m=o.expanded!==S.expanded?S.expanded:o.expanded)}(0,t.addClass)([y],m?"e-treegridexpand":"e-treegridcollapse"),s+=18,c.appendChild(y),u.style.width="4px",s+=7,c.appendChild(u.cloneNode())}else(a||!a&&!o.level)&&(s+=20,c.appendChild(u.cloneNode()),c.appendChild(u.cloneNode()));r=(0,t.createElement)("span",{className:"e-treecell"}),this.parent.allowTextWrap&&(r.style.width="Calc(100% - "+s+"px)"),(0,t.addClass)([e.cell],"e-gridrowindex"+i+"level"+o.level),this.updateTreeCell(e,r),c.appendChild(r),e.cell.appendChild(c)}if(n.getFrozenLeftColumnsCount()>0||n.getFrozenRightColumnsCount()>0){var v=n.getFrozenRightColumns(),w=n.getFrozenLeftColumns(),I=n.getMovableColumns();(v.length>0&&v[0].field===e.column.field||w.length>0&&w[0].field===e.column.field||I.length>0&&I[0].field===e.column.field)&&(0,t.addClass)([e.cell],"e-gridrowindex"+i+"level"+o.level)}else(h>this.parent.treeColumnIndex&&h>0&&n.getColumnIndexByUid(e.column.uid)===h||h<this.parent.treeColumnIndex&&h>0&&(n.getColumnIndexByUid(e.column.uid)===h||n.getColumnIndexByUid(e.column.uid)===h-1)||h===this.parent.treeColumnIndex&&h>0&&n.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex-1)&&(0,t.addClass)([e.cell],"e-gridrowindex"+i+"level"+o.level);if(!(0,t.isNullOrUndefined)(d)&&d.showCheckbox&&(this.parent.notify("columnCheckbox",e),this.parent.allowTextWrap)){var R=e.cell.querySelectorAll(".e-frame")[0];s+=parseInt(R.style.width,16),s+=10,(r=n.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex?e.cell.querySelector(".e-treecell"):e.cell.querySelector(".e-treecheckbox")).style.width="Calc(100% - "+s+"px)"}if(p){(0,t.addClass)([e.cell],"e-summarycell");var x=(0,l.getObject)(e.column.field,e.data);x=(0,t.isNullOrUndefined)(x)?null:x,null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML=x:e.column.template?e.cell.innerHTML=null:e.cell.innerHTML=x}this.parent.args=e;var C=(0,t.getValue)("columnModel",this.parent)[this.parent.treeColumnIndex];if((0,t.isNullOrUndefined)(this.parent.rowTemplate)&&!this.parent.isReact||this.parent.isReact&&!e.column.template)this.parent.trigger(P,e);else if(this.parent.isReact&&C.field!==e.column.field){var b=this;b.parent.renderReactTemplates(function(){b.parent.trigger(P,e)})}}},e.prototype.updateTreeCell=function(e,i){var r=(0,t.getValue)("columnModel",this.parent)[this.parent.treeColumnIndex],n="templateFn",o=e.column.index;(0,t.isNullOrUndefined)(r.field)&&e.cell.setAttribute("aria-colindex",o+1+""),r.field!==e.column.field||(0,t.isNullOrUndefined)(r.template)||(e.column.template=r.template,e.column[""+n]=(0,l.templateCompiler)(e.column.template),e.cell.classList.add("e-templatecell"));var a=null!=e.cell.querySelector(".e-treecell")?e.cell.querySelector(".e-treecell").innerHTML:e.cell.innerHTML;if("object"==typeof e.column.template&&this.templateResult)(0,l.appendChildren)(i,this.templateResult),this.templateResult=null,e.cell.innerHTML="";else if(e.cell.classList.contains("e-templatecell")){var s=e.cell.children.length,d=this.parent.element.id+e.column.uid;if(r.field!==e.column.field||(0,t.isNullOrUndefined)(r.template))for(;0<s;s=e.cell.children.length)i.appendChild(e.cell.children[parseInt((0).toString(),10)]);else{var p="portals";if(this.parent.isReact&&"string"!=typeof e.column.template){e.column[""+n](e.data,this.parent,"columnTemplate",d,null,null,i),(0,t.isNullOrUndefined)(this.parent.grid[""+p])&&(this.parent.grid[""+p]=this.parent[""+p]),this.parent.notify("renderReactTemplate",this.parent[""+p]);var h=this;h.parent.renderReactTemplates(function(){h.parent.trigger(P,e)})}else{var c=e.column[""+n]((0,l.extend)({index:""},e.data),this.parent,"template",d,this.parent.isStringTemplate);(0,l.appendChildren)(i,c)}delete e.column.template,delete e.column[""+n],e.cell.innerHTML=""}}else i.innerHTML=a,e.cell.innerHTML=""},e.prototype.refreshReactColumnTemplateByUid=function(e){var i=this;this.parent.isReact&&this.parent.clearTemplate(["columnTemplate"],void 0,function(){var r=i.parent.grid.getRowsObject(),n=i.parent.getDataRows(),o=i.parent.grid.getIndentCount(),a=i.parent.grid.getNormalizedColumnIndex(e);if(0!==n.length)for(var s=0;s<r.length;s++)if(r[parseInt(s.toString(),10)].isDataRow&&!(0,t.isNullOrUndefined)(r[parseInt(s.toString(),10)].index)){var d=r[parseInt(s.toString(),10)].cells[parseInt(a.toString(),10)],p=new l.CellRenderer(i.parent.grid,i.parent.grid.serviceLocator),h=n.length>=r.length?i.parent.getCellFromIndex(r[parseInt(s.toString(),10)].index,a-o):n[r[parseInt(s.toString(),10)].index].querySelector(".e-templatecell");p.refreshTD(h,d,r[parseInt(s.toString(),10)].data,{index:r[parseInt(s.toString(),10)].index});var c=i.parent.getRows()[parseInt(s.toString(),10)].cells[parseInt(a.toString(),10)];i.cellRender({data:r[parseInt(s.toString(),10)].data,cell:c,column:d.column})}})},e.prototype.columnTemplateResult=function(e){this.templateResult=e.template},e.prototype.reactTemplateRender=function(e,t){var i="portals";this.parent[""+i]=e,this.parent.notify("renderReactTemplate",this.parent[""+i]),this.parent.renderReactTemplates(t)},e.prototype.destroy=function(){this.parent.grid.off("template-result",this.columnTemplateResult),this.parent.grid.off("reactTemplateRender",this.reactTemplateRender)},e}(),Ct=function(){function e(e){this.addedRecords="addedRecords",this.parent=e,this.parentItems=[],this.taskIds=[],this.hierarchyData=[],this.storedIndex=-1,this.sortedData=[],this.isSortAction=!1,this.addEventListener(),this.dataResults={},this.isSelfReference=!(0,t.isNullOrUndefined)(this.parent.parentIdMapping)}return e.prototype.addEventListener=function(){this.parent.on("updateRemoteLevel",this.updateParentRemoteData,this),this.parent.grid.on("sorting-begin",this.beginSorting,this),this.parent.on("updateAction",this.updateData,this),this.parent.on(Q,this.collectExpandingRecs,this),this.parent.on("dataProcessor",this.dataProcessor,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Q,this.collectExpandingRecs),this.parent.off("updateRemoteLevel",this.updateParentRemoteData),this.parent.off("updateAction",this.updateData),this.parent.off("dataProcessor",this.dataProcessor),this.parent.grid.off("sorting-begin",this.beginSorting))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.isRemote=function(){return this.parent.dataSource instanceof Ze.DataManager},e.prototype.convertToFlatData=function(e){var i=this;if(this.parent.flatData=(0,t.isNullOrUndefined)(e)||0!==Object.keys(e).length||this.parent.dataSource instanceof Ze.DataManager?[]:this.parent.dataSource,this.parent.parentData=[],et(this.parent)&&!st(this.parent)&&e instanceof Ze.DataManager&&!(e instanceof Array)){var r=this.parent.dataSource;if(this.parent.parentIdMapping){if(this.parent.query=(0,t.isNullOrUndefined)(this.parent.query)?new Ze.Query:this.parent.query,this.parent.parentIdMapping){var n=this.parent.query.params.filter(function(e){return"IdMapping"===e.key});this.parent.initialRender&&!n.length&&(this.parent.query.where(this.parent.parentIdMapping,"equal",null),this.parent.query.addParams("IdMapping",this.parent.idMapping))}if(!this.parent.hasChildMapping){var o=this.parent.query.clone();o.queries=[],(o=o.select([this.parent.parentIdMapping])).isCountRequired=!0,r.executeQuery(o).then(function(e){i.parentItems=Ze.DataUtil.distinct(e.result,i.parent.parentIdMapping,!1),0===(e.result?0:1)&&((0,t.setValue)("grid.contentModule.isLoaded",!0,i.parent),(0,t.isNullOrUndefined)(i.zerothLevelData)||((0,t.setValue)("cancel",!1,i.zerothLevelData),(0,t.getValue)("grid.renderModule",i.parent).dataManagerSuccess(i.zerothLevelData),i.zerothLevelData=null),i.parent.grid.hideSpinner())})}}}else e instanceof Array&&this.convertJSONData(e)},e.prototype.convertJSONData=function(e){if(this.hierarchyData=[],this.taskIds=[],this.parent.idMapping)for(var i=Object.keys(e),r=0;r<i.length;r++){var n=e[parseInt(r.toString(),10)];this.hierarchyData.push((0,t.extend)({},n)),(0,t.isNullOrUndefined)(n[this.parent.idMapping])||this.taskIds.push(n[this.parent.idMapping])}else this.hierarchyData=e;if(this.isSelfReference){var o=[],a=new Ze.DataManager(this.hierarchyData).executeLocal((new Ze.Query).group(this.parent.parentIdMapping));for(r=0;r<a.length;r++){var s=a[parseInt(r.toString(),10)],d=this.taskIds.indexOf(s.key);if(!(0,t.isNullOrUndefined)(s.key)&&d>-1){var l=s.items;this.hierarchyData[parseInt(d.toString(),10)][this.parent.childMapping]=l}else o.push.apply(o,s.items)}this.hierarchyData=this.selfReferenceUpdate(o)}if(Object.keys(this.hierarchyData).length)this.createRecords(this.hierarchyData);else{var p=!(this.parent.dataSource instanceof Ze.DataManager)&&this.parent.isGantt;this.parent.flatData=p?this.parent.dataSource:[]}this.storedIndex=-1},e.prototype.selfReferenceUpdate=function(e){for(var t=[];this.hierarchyData.length>0&&e.length>0;){var i=e.indexOf(this.hierarchyData[0]);-1===i?this.hierarchyData.shift():(t.push(this.hierarchyData.shift()),e.splice(i,1))}return t},e.prototype.updateParentRemoteData=function(e){var i=this,r="actionArgs";et(this.parent)&&this.parent.enableVirtualization&&"virtualscroll"===e[""+r].requestType&&this.parent.hideSpinner();var n=e.result;if(et(this.parent)&&this.parent.enableVirtualization&&("virtualscroll"===e[""+r].requestType||"clearFilter"===e[""+r].action||""===e[""+r].searchString)&&(this.parent.query.expands=[]),this.parent.hasChildMapping||this.parentItems.length||!this.parent.loadChildOnDemand)if(this.parent.loadChildOnDemand)for(var o=function(r){if(tt(a.parent)&&n[parseInt(r.toString(),10)].hasChildRecords&&a.parent.initialRender&&(n[parseInt(r.toString(),10)].expanded=!1),et(a.parent)&&a.parent.enableVirtualization){var o=[],s=a.parent;n.filter(function(e){e[""+s.parentIdMapping]===n[parseInt(r.toString(),10)][""+s.idMapping]&&o.push(e)}),o.length?n[parseInt(r.toString(),10)].expanded=!0:n[parseInt(r.toString(),10)].hasChildRecords&&(n[parseInt(r.toString(),10)].expanded=!1)}if((0,t.isNullOrUndefined)(n[parseInt(r.toString(),10)].index)){if(n[parseInt(r.toString(),10)].taskData=(0,t.extend)({},n[parseInt(r.toString(),10)]),n[parseInt(r.toString(),10)].uniqueID=(0,l.getUid)(a.parent.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+n[parseInt(r.toString(),10)].uniqueID,n[parseInt(r.toString(),10)],a.parent),et(a.parent)&&a.parent.enableVirtualization&&n[parseInt(r.toString(),10)][""+a.parent.parentIdMapping]&&((0,t.isNullOrUndefined)(n[parseInt(r.toString(),10)].level)||0===n[parseInt(r.toString(),10)].level)){var d=n[parseInt(r.toString(),10)][""+a.parent.parentIdMapping],p=n.find(function(e){return e[""+i.parent.idMapping]===d});if(p)n[parseInt(r.toString(),10)].level=p.level+1;else{var h=e.actual.flatData.find(function(e){return e[""+i.parent.idMapping]===d});(0,t.isNullOrUndefined)(h[""+a.parent.parentIdMapping])?n[parseInt(r.toString(),10)].level=1:n[parseInt(r.toString(),10)].level=h.level+1}}else n[parseInt(r.toString(),10)].level=0;n[parseInt(r.toString(),10)].index=Math.ceil(1e3*Math.random()),(n[parseInt(r.toString(),10)][a.parent.hasChildMapping]||-1!==a.parentItems.indexOf(n[parseInt(r.toString(),10)][a.parent.idMapping]))&&(n[parseInt(r.toString(),10)].hasChildRecords=!0),n[parseInt(r.toString(),10)].checkboxState="uncheck"}},a=this,s=0;s<n.length;s++)o(s);else{(0,t.isNullOrUndefined)(n)||!this.parent.loadChildOnDemand&&tt(this.parent)&&!(0,t.isNullOrUndefined)(this.parent.dataResults.expandRecord)||et(this.parent)&&!this.parent.loadChildOnDemand&&e[""+r].isExpandCollapse&&this.parent.enableVirtualization||this.convertToFlatData(n)}else this.zerothLevelData=e,(0,t.setValue)("cancel",!0,e);if(et(this.parent)&&!this.parent.loadChildOnDemand&&e[""+r].isExpandCollapse&&this.parent.enableVirtualization||et(this.parent)&&this.parent.enableVirtualization&&this.parent.loadChildOnDemand?e.result=n:e.result=this.parent.loadChildOnDemand?n:this.parent.flatData,et(this.parent)&&this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length){var d=e.query.queries.filter(function(e){return"onAggregates"===e.fn});e.result=this.parent.summaryModule.calculateSummaryValue(d,this.parent.flatData,!0)}this.parent.notify("updateResults",e)},e.prototype.collectExpandingRecs=function(e,i){var r,n=this.parent.getRows();if(this.parent.rowTemplate){var o=this.parent.getContentTable().rows;n=[].slice.call(o)}if(e.rows.length>0){i||(e.record.expanded=!0);for(var a=0;a<e.rows.length;a++){if(this.parent.toggleRowVisibility(e.rows[parseInt(a.toString(),10)],"e-childrow-visible"),!this.parent.loadChildOnDemand){var s=e.rows[parseInt(a.toString(),10)].getElementsByClassName("e-treegridcollapse")[0];r=this.parent.rowTemplate?this.parent.grid.getCurrentViewRecords()[e.rows[parseInt(a.toString(),10)].rowIndex]:this.parent.grid.getRowObjectFromUID(e.rows[parseInt(a.toString(),10)].getAttribute("data-uid")).data,!(0,t.isNullOrUndefined)(s)&&r.expanded&&((0,t.addClass)([s],"e-treegridexpand"),(0,t.removeClass)([s],"e-treegridcollapse"));var d;(d=n.filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))})).length&&r.expanded&&this.collectExpandingRecs({record:r,rows:d,parentRow:e.parentRow},!0)}var l=e.rows[parseInt(a.toString(),10)].querySelector(".e-detailrowcollapse");(0,t.isNullOrUndefined)(l)||this.parent.grid.detailRowModule.expand(l)}this.parent.grid.pageSettings.totalRecordsCount+=e.rows.length}else this.fetchRemoteChildData({action:e.name,record:e.record,rows:e.rows,parentRow:e.parentRow})},e.prototype.fetchRemoteChildData=function(e){var i=this,r={row:e.parentRow,data:e.record},n=this.parent.dataSource,o=this.parent.grid.getDataModule().generateQuery(),a=o.queries.filter(function(e){return"onPage"!==e.fn&&"onWhere"!==e.fn});o.queries=a,o.isCountRequired=!0;var s=parseInt(e.record[this.parent.idMapping],10);if(isNaN(s)&&(s=e.record[this.parent.idMapping].toString()),this.parent.enableVirtualization&&"remoteExpand"===e.action)o.take(this.parent.grid.pageSettings.pageSize),(d=[]).push("ExpandingAction",s.toString()),o.expand(d);else if(this.parent.enableVirtualization&&"collapse"===e.action){var d;o.take(this.parent.grid.pageSettings.pageSize),(d=[]).push("CollapsingAction",s.toString()),o.expand(d)}if(o.where(this.parent.parentIdMapping,"equal",e.record[this.parent.idMapping]),"remoteExpand"===e.action&&this.parent.grid.filterSettings&&this.parent.grid.filterSettings.columns.length){var p=this.parent.grid.getDataModule().generateQuery().queries.filter(function(e){return"onPage"!==e.fn&&void 0!==e.e.predicates});o.queries.push(p[0])}(0,Rt.showSpinner)(this.parent.element),n.executeQuery(o).then(function(n){var o,a="remoteExpandedData",s="remoteCollapsedData",d=i.parent.grid.currentViewData.slice(),p=i.parent.idMapping;if(i.parent.isGantt&&i.parent.loadChildOnDemand&&i.parent.hasChildMapping){for(var h=0;h<i.parent.grid.currentViewData.length;h++)if(e.record[p]===i.parent.grid.currentViewData[h][p]){o=h;break}}else o=d.indexOf(e.record);if(i.parent.enableVirtualization&&("collapse"===e.action||"remoteExpand"===e.action)){d=[];for(h=0;h<o;h++)d.push(i.parent.grid.currentViewData[parseInt(h.toString(),10)])}-1===o&&i.parent.grid.getRowsObject().forEach(function(t){t.data.uniqueID===e.record.uniqueID&&(o=t.index)});var c=(0,l.getObject)("actual.nextLevel",n),u=n.result,g=[];if("remoteExpand"===e.action&&i.parent.grid.filterModule&&i.parent.grid.filterModule.value){for(h=0;h<d.length;h++)Object.prototype.hasOwnProperty.call(d[parseInt(h.toString(),10)],i.parent.parentIdMapping)&&null!==d[parseInt(h.toString(),10)][""+i.parent.parentIdMapping]&&0===d[parseInt(h.toString(),10)].level&&(d.splice(h,1),h--);for(h=0;h<u.length;h++)e.record[""+i.parent.idMapping]!==u[parseInt(h.toString(),10)][""+i.parent.idMapping]&&e.record[""+i.parent.idMapping]===u[parseInt(h.toString(),10)][""+i.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(u,h)&&g.push(u[parseInt(h.toString(),10)]);u=g}if(i.parent.enableVirtualization&&"remoteExpand"===e.action){e.record.childRecords=[];for(h=0;h<u.length;h++)e.record[""+i.parent.idMapping]!==u[parseInt(h.toString(),10)][""+i.parent.idMapping]&&e.record[""+i.parent.idMapping]===u[parseInt(h.toString(),10)][""+i.parent.parentIdMapping]&&Object.prototype.hasOwnProperty.call(u,h)&&e.record.childRecords.push(u[parseInt(h.toString(),10)])}else e.record.childRecords=u;for(var f=function(r){var n=u[parseInt(r.toString(),10)];if(i.parent.enableVirtualization&&n[""+i.parent.idMapping]===e.record[""+i.parent.idMapping]&&"remoteExpand"===e.action)i.parent[""+a].push(e.record);else if(i.parent.enableVirtualization&&n[""+i.parent.idMapping]===e.record[""+i.parent.idMapping]&&"collapse"===e.action)for(var p=0;p<i.parent[""+a].length;p++)e.record[""+i.parent.idMapping]===i.parent[""+a][parseInt(p.toString(),10)][""+i.parent.idMapping]&&i.parent[""+a].splice(p,1);if(n.taskData=(0,t.extend)({},n),n[""+i.parent.parentIdMapping]&&i.parent.enableVirtualization&&i.parent[""+a].length)for(p=0;p<i.parent[""+a].length;p++){if(n[""+i.parent.parentIdMapping]===i.parent[""+a][parseInt(p.toString(),10)][""+i.parent.idMapping])n.level=i.parent[""+a][parseInt(p.toString(),10)].level+1,delete(h=i.parent[""+a][parseInt(p.toString(),10)]).childRecords,n.parentItem=h,n.parentUniqueID=h.uniqueID}else if(i.parent.enableVirtualization){if(!n[""+i.parent.hasChildMapping]&&-1===i.parentItems.indexOf(n[""+i.parent.idMapping])||c&&!c[parseInt(r.toString(),10)])delete(h=(0,t.extend)({},e.record)).childRecords,n.parentItem=h,n.parentUniqueID=e.record.uniqueID;else(0,t.isNullOrUndefined)(n[""+i.parent.parentIdMapping])?(n.level=0,"remoteExpand"===e.action&&(n.childRecords=[],n.childRecords=e.record.childRecords)):n.level=e.record.level}else{var h;n.level=e.record.level+1,delete(h=(0,t.extend)({},e.record)).childRecords,n.parentItem=h,n.parentUniqueID=e.record.uniqueID}if(n.index=Math.ceil(1e3*Math.random()),n.uniqueID=(0,l.getUid)(i.parent.element.id+"_data_"),e.record[""+i.parent.idMapping]===n[""+i.parent.idMapping]&&(e.record.uniqueID=n.uniqueID),n.checkboxState="uncheck",i.parent.enableVirtualization&&(0,t.isNullOrUndefined)(n.level))for(var g=0;g<i.parent.grid.currentViewData.length;g++)i.parent.grid.currentViewData[parseInt(g.toString(),10)][""+i.parent.idMapping]===n[""+i.parent.parentIdMapping]&&(n.level=i.parent.grid.currentViewData[parseInt(g.toString(),10)].level+1);if((0,t.setValue)("uniqueIDCollection."+n.uniqueID,n,i.parent),(n[""+i.parent.hasChildMapping]||-1!==i.parentItems.indexOf(n[""+i.parent.idMapping]))&&(!c||c[parseInt(r.toString(),10)]))if(n.hasChildRecords=!0,i.parent.enableVirtualization&&!i.parent.loadChildOnDemand){for(p=0;p<i.parent[""+s].length;p++)n[""+i.parent.idMapping]===i.parent[""+s][parseInt(p.toString(),10)][""+i.parent.idMapping]&&(n.expanded=i.parent[""+s][parseInt(p.toString(),10)].expanded);if("collapse"===e.action&&n[""+i.parent.idMapping]!==e.record[""+i.parent.idMapping]&&!1!==n.expanded)n.expanded=!0;else if("collapse"===e.action&&n[""+i.parent.idMapping]===e.record[""+i.parent.idMapping])n.expanded=!1,i.parent[""+s].push(e.record);else if("remoteExpand"===e.action){for(p=0;p<i.parent.grid.currentViewData.length;p++)i.parent.grid.currentViewData[parseInt(p.toString(),10)][""+i.parent.idMapping]===n[""+i.parent.idMapping]&&u.splice(r,1,i.parent.grid.currentViewData[parseInt(p.toString(),10)]);if(n[i.parent.idMapping]===e.record[""+i.parent.idMapping])for(p=0;p<i.parent[""+s].length;p++)e.record[""+i.parent.idMapping]===i.parent[""+s][parseInt(p.toString(),10)][""+i.parent.idMapping]&&i.parent[""+s].splice(p,1);!1!==n.expanded&&(n.expanded=!0)}}else i.parent.enableVirtualization&&n[""+i.parent.idMapping]===e.record[""+i.parent.idMapping]&&"collapse"!==e.action?n.expanded=!0:i.parent.enableVirtualization&&!i.parent.loadChildOnDemand||(n.expanded=!1);d.some(function(e){return e[""+i.parent.idMapping]===n[i.parent.idMapping]})||d.splice(o+r+1,0,n)},y=0;y<u.length;y++)f(y);var m=i.parent.idMapping;if(i.parent.enableVirtualization&&i.parent.loadChildOnDemand&&d.sort(function(e,t){return e[""+m]-t[""+m]}),(0,t.setValue)("result",d,n),(0,t.setValue)("action","beforecontentrender",n),i.parent.trigger(U,n),(0,Rt.hideSpinner)(i.parent.element),i.parent.grid.aggregates.length>0&&!i.parent.enableVirtualization){var S=(0,l.getObject)("query",n),v="result";if((0,t.isNullOrUndefined)(S)&&(S=(0,t.getValue)("grid.renderModule.data",i.parent).aggregateQuery(new Ze.Query)),!(0,t.isNullOrUndefined)(S)){var w=S.queries.filter(function(e){return"onAggregates"===e.fn});n[""+v]=i.parent.summaryModule.calculateSummaryValue(w,n[""+v],!0)}}"remoteExpand"===e.action&&i.parent.allowPaging&&"All"===i.parent.pageSettings.pageSizeMode&&(i.parent.grid.pageSettings.totalRecordsCount=i.parent.grid.pageSettings.totalRecordsCount+u.length),i.parent.enableVirtualization&&(i.parent.grid.pageSettings.totalRecordsCount=n.count),n.count=i.parent.grid.pageSettings.totalRecordsCount;var I={};i.parent.enableVirtualization&&i.remoteVirtualAction(I);var R={index:o,childData:u};i.parent.enableInfiniteScrolling?i.parent.notify("infinite-remote-expand",R):(0,t.getValue)("grid.renderModule",i.parent).dataManagerSuccess(n,I),i.parent.trigger(j,r)})},e.prototype.remoteVirtualAction=function(e){e.requestType="refresh",(0,t.setValue)("isExpandCollapse",!0,e);var i=(0,t.getValue)("grid.contentModule",this.parent),r=(0,t.getValue)("currentInfo",i),n=(0,t.getValue)("prevInfo",i);r.loadNext&&this.parent.grid.pageSettings.currentPage===r.nextInfo.page&&!this.parent.loadChildOnDemand&&(this.parent.grid.pageSettings.currentPage=n.page)},e.prototype.beginSorting=function(){if(this.isSortAction=!0,et(this.parent)&&this.parent.enableVirtualization){var e=this.parent.query.queries.indexOf(this.parent.query.queries.filter(function(e){return"onSortBy"===e.fn})[0]);-1!==e&&this.parent.query.queries.splice(e,1),0===this.parent.grid.sortSettings.columns.length&&this.parent.query.sortBy(null,null)}},e.prototype.createRecords=function(e,i){for(var r=[],n=0,o=Object.keys(e).length;n<o;n++){var a=(0,t.extend)({},e[parseInt(n.toString(),10)]);a.taskData=e[parseInt(n.toString(),10)];var s=0;this.storedIndex++,Object.prototype.hasOwnProperty.call(a,"index")||(a.index=this.storedIndex);var d=a[this.parent.childMapping],p=!(0,t.isNullOrUndefined)(d)&&d.length>0,h=tt(this.parent),c=a[this.parent.hasChildMapping];if(a.hasChildRecords=!!(p&&!h||c&&h),(!(0,t.isNullOrUndefined)(d)&&!h||c&&h)&&(this.parent.enableCollapseAll||!(0,t.isNullOrUndefined)(this.parent.dataStateChange)&&(0,t.isNullOrUndefined)(d)?a.expanded=!1:a.expanded=!!(0,t.isNullOrUndefined)(a[this.parent.expandStateMapping])||a[this.parent.expandStateMapping]),Object.prototype.hasOwnProperty.call(a,"index")||(a.index=(a.hasChildRecords,this.storedIndex)),this.isSelfReference&&(0,t.isNullOrUndefined)(a[this.parent.parentIdMapping])&&this.parent.parentData.push(a),a.uniqueID=(0,l.getUid)(this.parent.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+a.uniqueID,a,this.parent),!(0,t.isNullOrUndefined)(i)){var u=(0,t.extend)({},i);delete u.childRecords,delete u[this.parent.childMapping],this.isSelfReference&&delete u.taskData[this.parent.childMapping],a.parentItem=u,a.parentUniqueID=u.uniqueID,s=i.level+1}Object.prototype.hasOwnProperty.call(a,"level")||(a.level=s),a.checkboxState="uncheck";var g="remoteCollapsedData";if(this.parent.enableVirtualization&&!this.parent.loadChildOnDemand&&et(this.parent)&&!this.parent.initialRender){if(!a.hasChildRecords&&(0,t.isNullOrUndefined)(a[""+this.parent.parentIdMapping])){a.hasChildRecords=!0;for(var f=0;f<this.parent[""+g].length;f++)this.parent[""+g][parseInt(f.toString(),10)][""+this.parent.idMapping]===a[""+this.parent.idMapping]&&(a.expanded=!1)}else 0===a.level&&(0,t.isNullOrUndefined)(i)&&!a.hasChildRecords&&(a.level=a.level+1);a[""+this.parent.hasChildMapping]&&!(0,t.isNullOrUndefined)(a[""+this.parent.expandStateMapping])&&(a.expanded=a[""+this.parent.expandStateMapping],a.hasChildRecords=!0),this.parent.flatData.push(a)}else((0,t.isNullOrUndefined)(a[""+this.parent.parentIdMapping])||a.parentItem)&&((0,t.isNullOrUndefined)(this.parent.rowDropSettings.targetID)?this.parent.flatData.push(a):this.parent.rowDragAndDropModule.isDuplicateData(a)||this.parent.flatData.push(a),this.parent.infiniteScrollData.push(a));if(this.isSelfReference||0!==a.level||this.parent.parentData.push(a),!(0,t.isNullOrUndefined)(a[this.parent.childMapping]&&a[this.parent.childMapping].length)){var y=this.createRecords(a[this.parent.childMapping],a);a.childRecords=y}r.push(a)}return r},e.prototype.dataProcessor=function(e){var i,r=(0,l.getObject)("isExport",e),n=(0,l.getObject)("expresults",e),o=(0,l.getObject)("exportType",e),a=(0,l.getObject)("isPrinting",e),s=(0,l.getObject)("actionArgs",e),d=(0,l.getObject)("requestType",e),p=(0,l.getObject)("data",e),h=(0,l.getObject)("action",e),c=s,u=this.parent.getPrimaryKeyFieldNames()[0],g=(0,l.getObject)("data",c);(0,t.isNullOrUndefined)(c)||(0,t.isNullOrUndefined)(c.action)||"add"!==c.action||(0,t.isNullOrUndefined)(c.data)||!(0,t.isNullOrUndefined)(c.data[""+u])||(c.data[""+u]=e.result[c.index][""+u],g.taskData[""+u]=e.result[c.index][""+u]),(!(0,t.isNullOrUndefined)(s)&&Object.keys(s).length||"save"===d)&&(d=d||s.requestType,p=p||(0,l.getObject)("data",s),h=h||(0,l.getObject)("action",s),"Batch"===this.parent.editSettings.mode&&(this.batchChanges=this.parent.grid.editModule.getBatchChanges()),this.parent.isLocalData&&this.updateAction(p,h,d));var f,y,m=(i=r&&!(0,t.isNullOrUndefined)(n)?n:tt(this.parent)?(0,t.getValue)("result",this.parent.grid.dataSource):this.parent.grid.dataSource)instanceof Ze.DataManager?i.dataSource.json:i,S=tt(this.parent)?(0,t.getValue)("count",this.parent.dataSource):m.length,v=new Ze.Query,w=(0,l.getObject)("query",e);if((0,t.isNullOrUndefined)(w)||(f=w.queries.filter(function(e){return"onWhere"===e.fn}),y=w.queries.filter(function(e){return"onSearch"===e.fn})),this.parent.grid.allowFiltering&&this.parent.grid.filterSettings.columns.length||this.parent.grid.searchSettings.key.length>0||!(0,t.isNullOrUndefined)(w)&&(f.length||y.length)&&this.parent.isLocalData){(0,t.isNullOrUndefined)(w)&&(w=new Ze.Query,w=(0,t.getValue)("grid.renderModule.data",this.parent).filterQuery(w),w=(0,t.getValue)("grid.renderModule.data",this.parent).searchQuery(w));var I=w.queries.filter(function(e){return"onWhere"===e.fn}),R=w.queries.filter(function(e){return"onSearch"===e.fn});v.queries=I.concat(R);var x=new Ze.DataManager(m).executeLocal(v);if(this.parent.notify("updateFilterRecs",{data:x}),m=this.dataResults.result,this.dataResults.result=null,this.parent.grid.aggregates.length>0){var C=(0,l.getObject)("query",e);if((0,t.isNullOrUndefined)(w)&&(w=(0,t.getValue)("grid.renderModule.data",this.parent).aggregateQuery(new Ze.Query)),!(0,t.isNullOrUndefined)(C)){var b=C.queries.filter(function(e){return"onAggregates"===e.fn});m=this.parent.summaryModule.calculateSummaryValue(b,m,!0)}}}if(this.parent.grid.aggregates.length&&0===this.parent.grid.sortSettings.columns.length&&0===this.parent.grid.filterSettings.columns.length&&!this.parent.grid.searchSettings.key.length){var D=(0,l.getObject)("query",e);(0,t.isNullOrUndefined)(D)&&(D=(0,t.getValue)("grid.renderModule.data",this.parent).aggregateQuery(new Ze.Query));b=D.queries.filter(function(e){return"onAggregates"===e.fn});m=this.parent.summaryModule.calculateSummaryValue(b,this.parent.flatData,!0)}if(this.parent.grid.sortSettings.columns.length>0||this.isSortAction){this.isSortAction=!1;for(var M=this.parent.parentData,O=(C=(0,l.getObject)("query",e),new Ze.Query),P=this.parent.grid.sortSettings.columns.length-1;P>=0;P--){var A=this.parent.grid.renderModule.data.getColumnByField(this.parent.grid.sortSettings.columns[parseInt(P.toString(),10)].field),E=A.sortComparer&&st(this.parent)?A.sortComparer.bind(A):this.parent.grid.sortSettings.columns[parseInt(P.toString(),10)].direction;O.sortBy(this.parent.grid.sortSettings.columns[parseInt(P.toString(),10)].field,E)}var N=new Ze.DataManager(M).executeLocal(O);if(this.parent.allowRowDragAndDrop&&!(0,t.isNullOrUndefined)(this.parent.rowDragAndDropModule.draggedRecord)&&this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition){var U=N.indexOf(this.parent.rowDragAndDropModule.draggedRecord);N.splice(U,1);var q=N.indexOf(this.parent.rowDragAndDropModule.droppedRecord);this.parent.rowDragAndDropModule.droppedRecord.hasChildRecords&&"topSegment"===this.parent.rowDragAndDropModule.dropPosition?N.splice(q,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&N.splice(q+1,0,this.parent.rowDragAndDropModule.draggedRecord)}var k={modifiedData:N,filteredData:m,srtQry:O};if(this.parent.notify("createSort",k),m=k.modifiedData,this.dataResults.result=null,this.sortedData=m,this.parent.notify("updateModel",{}),this.parent.grid.aggregates.length>0&&!(0,t.isNullOrUndefined)(C)){b=(0,l.getObject)("query",e).queries.filter(function(e){return"onAggregates"===e.fn});m=this.parent.summaryModule.calculateSummaryValue(b,this.sortedData,!1)}}S=tt(this.parent)?(0,t.getValue)("count",this.parent.dataSource):m.length;var T=this.paging(m,S,r,a,o,e);m=T.result,S=T.count,e.result=m,e.count=S,this.parent.notify("updateResults",e)},e.prototype.paging=function(e,i,r,n,o,a){if(!this.parent.allowPaging||r&&"CurrentPage"!==o||n&&"CurrentPage"!==this.parent.printMode){if((this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)&&(!r||"CurrentPage"===o)&&"save"!==(0,t.getValue)("requestType",a)){var s=this.parent.enableInfiniteScrolling?a:(0,t.getValue)("actionArgs",a);this.parent.notify(W,{result:e,count:i,actionArgs:s}),e=this.dataResults.result,i=this.dataResults.count}}else this.parent.notify(W,{result:e,count:i,actionArgs:a}),e=this.dataResults.result,i=tt(this.parent)?(0,t.getValue)("count",this.parent.dataSource):this.dataResults.count;var d="isCollapsedStatePersist";if((!0===n||a.isPdfExport&&((0,t.isNullOrUndefined)(a[""+d])||a[""+d]))&&"AllPages"===this.parent.printMode){for(var l=[],p=0;p<e.length;p++){ot(this.parent,e[parseInt(p.toString(),10)],this.parent.parentData)&&l.push(e[parseInt(p.toString(),10)])}i=(e=l).length}return{result:e,count:i}},e.prototype.updateData=function(e){this.dataResults=e},e.prototype.updateAction=function(e,t,i){"delete"!==i&&"save"!==i||this.parent.notify(te,{value:e,action:t||i}),"batchsave"===i&&"Batch"===this.parent.editSettings.mode&&this.parent.notify(ge,{})},e}();!function(e){e[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.Search=5]="Search",e[e.ExpandAll=6]="ExpandAll",e[e.CollapseAll=7]="CollapseAll",e[e.ExcelExport=8]="ExcelExport",e[e.PdfExport=9]="PdfExport",e[e.CsvExport=10]="CsvExport",e[e.Print=11]="Print",e[e.RowIndent=12]="RowIndent",e[e.RowOutdent=13]="RowOutdent"}(ct||(ct={})),function(e){e[e.AutoFit=0]="AutoFit",e[e.AutoFitAll=1]="AutoFitAll",e[e.SortAscending=2]="SortAscending",e[e.SortDescending=3]="SortDescending",e[e.Edit=4]="Edit",e[e.Delete=5]="Delete",e[e.Save=6]="Save",e[e.Cancel=7]="Cancel",e[e.PdfExport=8]="PdfExport",e[e.ExcelExport=9]="ExcelExport",e[e.CsvExport=10]="CsvExport",e[e.FirstPage=11]="FirstPage",e[e.PrevPage=12]="PrevPage",e[e.LastPage=13]="LastPage",e[e.NextPage=14]="NextPage",e[e.AddRow=15]="AddRow",e[e.RowIndent=16]="RowIndent",e[e.RowOutdent=17]="RowOutdent"}(ut||(ut={}));var bt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Dt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},Mt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return bt(i,e),Dt([(0,t.Property)(12)],i.prototype,"pageSize",void 0),Dt([(0,t.Property)(8)],i.prototype,"pageCount",void 0),Dt([(0,t.Property)(1)],i.prototype,"currentPage",void 0),Dt([(0,t.Property)()],i.prototype,"totalRecordsCount",void 0),Dt([(0,t.Property)(!1)],i.prototype,"enableQueryString",void 0),Dt([(0,t.Property)(!1)],i.prototype,"pageSizes",void 0),Dt([(0,t.Property)(null)],i.prototype,"template",void 0),Dt([(0,t.Property)("All")],i.prototype,"pageSizeMode",void 0),i}(t.ChildProperty),Ot=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Pt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},At=function(e){function i(){var i=null!==e&&e.apply(this,arguments)||this;return i.intl=new t.Internationalization,i.templateFn={},i}return Ot(i,e),i.prototype.setFormatter=function(e){this.format&&(this.format.skeleton||this.format.format)&&(this.formatFn=this.getFormatFunction(this.format))},i.prototype.getFormatFunction=function(e){return e.type?this.intl.getDateFormat(e):this.intl.getNumberFormat(e)},i.prototype.getFormatter=function(){return this.formatFn},i.prototype.setTemplate=function(e){void 0===e&&(e={}),void 0!==this.footerTemplate&&(this.templateFn[(0,t.getEnumValue)(l.CellType,l.CellType.Summary)]={fn:(0,t.compile)(this.footerTemplate,e),property:"footerTemplate"})},i.prototype.getTemplate=function(e){return this.templateFn[(0,t.getEnumValue)(l.CellType,e)]},i.prototype.setPropertiesSilent=function(e){this.setProperties(e,!0)},Pt([(0,t.Property)()],i.prototype,"type",void 0),Pt([(0,t.Property)()],i.prototype,"footerTemplate",void 0),Pt([(0,t.Property)()],i.prototype,"field",void 0),Pt([(0,t.Property)()],i.prototype,"format",void 0),Pt([(0,t.Property)()],i.prototype,"columnName",void 0),Pt([(0,t.Property)()],i.prototype,"customAggregate",void 0),i}(t.ChildProperty),Et=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Ot(i,e),Pt([(0,t.Collection)([],At)],i.prototype,"columns",void 0),Pt([(0,t.Property)(!0)],i.prototype,"showChildSummary",void 0),i}(t.ChildProperty),Nt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ut=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},qt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Nt(i,e),Ut([(0,t.Property)(!1)],i.prototype,"allowAdding",void 0),Ut([(0,t.Property)(!1)],i.prototype,"allowEditing",void 0),Ut([(0,t.Property)(!1)],i.prototype,"allowDeleting",void 0),Ut([(0,t.Property)("Cell")],i.prototype,"mode",void 0),Ut([(0,t.Property)("Top")],i.prototype,"newRowPosition",void 0),Ut([(0,t.Property)(!0)],i.prototype,"allowEditOnDblClick",void 0),Ut([(0,t.Property)(!0)],i.prototype,"showConfirmDialog",void 0),Ut([(0,t.Property)(!1)],i.prototype,"showDeleteConfirmDialog",void 0),Ut([(0,t.Property)("")],i.prototype,"template",void 0),Ut([(0,t.Property)({})],i.prototype,"dialog",void 0),Ut([(0,t.Property)(!1)],i.prototype,"allowNextRowEdit",void 0),i}(t.ChildProperty),kt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Tt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},Vt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return kt(i,e),Tt([(0,t.Property)()],i.prototype,"field",void 0),Tt([(0,t.Property)()],i.prototype,"direction",void 0),i}(t.ChildProperty),Bt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return kt(i,e),Tt([(0,t.Collection)([],Vt)],i.prototype,"columns",void 0),Tt([(0,t.Property)(!0)],i.prototype,"allowUnsort",void 0),i}(t.ChildProperty);function zt(e,i,r,n,o,a,s){var d,l,p,h=e.value,c=e.action,u=i.grid.getPrimaryKeyFieldNames()[0],g=i.dataSource instanceof Ze.DataManager?i.dataSource.dataSource.json:i.dataSource,f=i.grid.dataSource,y=[],m=h,S=!1;if("Batch"===i.editSettings.mode&&(p=i.grid.editModule.getBatchChanges()),"add"===c||"batchsave"===c&&"Batch"===i.editSettings.mode&&p.addedRecords.length){var v=function(e,i,r,n,o,a,s){var d,l=!1,p=r.grid.getCurrentViewRecords();switch(d=lt(d=(0,t.extend)({},e.value)),r.editSettings.newRowPosition){case"Top":i.unshift(d),l=!0;break;case"Bottom":i.push(d),l=!0;break;case"Above":d=(0,t.isNullOrUndefined)(s)?0===p.length?lt(d):lt(d=(0,t.extend)({},p[o+1])):lt(d=(0,t.extend)({},s));break;case"Below":case"Child":if((0,t.isNullOrUndefined)(s)){var h=r.grid.getPrimaryKeyFieldNames()[0],c=p.length>0?p[parseInt(o.toString(),10)]:[];d=lt(d=!(0,t.isNullOrUndefined)(c)&&c[""+h]===e.value[""+h]||-1!==a&&0!==i.length?(0,t.extend)({},c):(0,t.extend)({},e.value));var u="internalProperties";r.editModule[""+u].taskData=d}else d=lt(d=(0,t.extend)({},s));-1===a&&(i.unshift(d),l=!0)}return{value:d,isSkip:l}}(e,g,i,0,n,o,s);h=v.value,S=v.isSkip}if(h instanceof Array?y=dt(h):y.push((0,t.extend)({},h)),!S&&("add"!==c||"Top"!==i.editSettings.newRowPosition&&"Bottom"!==i.editSettings.newRowPosition))for(var w=0;w<y.length;w++){"object"==typeof y[parseInt(w.toString(),10)][""+u]&&(y[parseInt(w.toString(),10)]=y[parseInt(w.toString(),10)][""+u]);var I=y[parseInt(w.toString(),10)].taskData?Object.keys(y[parseInt(w.toString(),10)].taskData):Object.keys(y[parseInt(w.toString(),10)]);d=0===g.length&&1===f.length?f.length:g.length;for(var R=function(){if(0===g.length&&1===f.length&&f[parseInt(d.toString(),10)][""+u]===y[parseInt(w.toString(),10)][""+u]||g[parseInt(d.toString(),10)][""+u]===y[parseInt(w.toString(),10)][""+u]){if("delete"!==c){if("edit"===c){for(l=0;l<I.length;l++)if(Object.prototype.hasOwnProperty.call(g[parseInt(d.toString(),10)],I[parseInt(l.toString(),10)])&&("Cell"!==i.editSettings.mode||!(0,t.isNullOrUndefined)(p)&&0===p.changedRecords.length||I[parseInt(l.toString(),10)]===a)){var e=pt(i,y[parseInt(w.toString(),10)].uniqueID);g[parseInt(d.toString(),10)][I[parseInt(l.toString(),10)]]=y[parseInt(w.toString(),10)][I[parseInt(l.toString(),10)]],e&&e.taskData&&(e.taskData[I[parseInt(l.toString(),10)]]=e[I[parseInt(l.toString(),10)]]=g[parseInt(d.toString(),10)][I[parseInt(l.toString(),10)]])}}else if("add"===c||"batchsave"===c){var o=void 0;"Child"===i.editSettings.newRowPosition?0===g.length&&1===f.length?g.push(m.taskData):r?(m.taskData[""+i.parentIdMapping]=g[parseInt(d.toString(),10)][""+i.idMapping],g.splice(d+1,0,m.taskData)):(Object.prototype.hasOwnProperty.call(g[parseInt(d.toString(),10)],i.childMapping)||(g[parseInt(d.toString(),10)][""+i.childMapping]=[]),g[parseInt(d.toString(),10)][""+i.childMapping].push(m.taskData),Ft(u,g[parseInt(d.toString(),10)],c,i,r,m)):"Below"===i.editSettings.newRowPosition?(g.splice(d+1,0,m.taskData),(0,t.isNullOrUndefined)(m.parentItem)||Ft(u,g[d+1],c,i,r,m)):n?"Above"===i.editSettings.newRowPosition&&(g.splice(d,0,m.taskData),(0,t.isNullOrUndefined)(m.parentItem)||Ft(u,g[parseInt(d.toString(),10)],c,i,r,m)):(o=0,g.splice(o,0,m.taskData))}return"break"}var s=g[parseInt(d.toString(),10)];if(g.splice(d,1),r){if(!(0,t.isNullOrUndefined)(s[""+i.parentIdMapping]))for(var h=i.flatData.filter(function(e){return e[""+i.idMapping]===s[""+i.parentIdMapping]})[0],S=h?h[""+i.childMapping]:[],v=S.length-1;v>=0;v--)if(S[parseInt(v.toString(),10)][""+i.idMapping]===s[""+i.idMapping]){i.enableImmutableMode||h.childRecords.length!==h.Children.length||h.childRecords.splice(v,1),S.splice(v,1),S.length||(h.hasChildRecords=!1,Ft(u,h,c,i,r));break}return"break"}}else(0,t.isNullOrUndefined)(g[parseInt(d.toString(),10)][""+i.childMapping])||Lt(g[parseInt(d.toString(),10)][""+i.childMapping],y[parseInt(w.toString(),10)],c,u,i,r,m,a)&&Ft(u,g[parseInt(d.toString(),10)],c,i,r)};d--&&d>=0;){if("break"===R())break}}}function Lt(e,i,r,n,o,a,s,d){for(var l=!1,p=e.length;p--&&p>=0;)if(e[parseInt(p.toString(),10)][""+n]===i[""+n]||a&&e[parseInt(p.toString(),10)][o.parentIdMapping]===i[o.idMapping]){if("edit"===r){for(var h=Object.keys(i),c=pt(o,i.uniqueID),u=0;u<h.length;u++)if(Object.prototype.hasOwnProperty.call(e[parseInt(p.toString(),10)],h[parseInt(u.toString(),10)])&&("Cell"!==o.editSettings.mode||h[parseInt(u.toString(),10)]===d)&&(c[h[parseInt(u.toString(),10)]]=c.taskData[h[parseInt(u.toString(),10)]]=e[parseInt(p.toString(),10)][h[parseInt(u.toString(),10)]]=i[h[parseInt(u.toString(),10)]],"Normal"===o.grid.editSettings.mode&&"Cell"===o.editSettings.mode&&!(0,t.isNullOrUndefined)(o.grid.editModule))){var g="editModule";o.grid.editModule[""+g].editRowIndex=i.index,o.grid.editModule[""+g].updateCurrentViewData(i)}break}"add"===r||"batchsave"===r?"Child"===o.editSettings.newRowPosition?a?(s[""+o.parentIdMapping]=e[parseInt(p.toString(),10)][o.idMapping],e.splice(p+1,0,s),Ft(n,e[parseInt(p.toString(),10)],r,o,a,s)):(Object.prototype.hasOwnProperty.call(e[parseInt(p.toString(),10)],o.childMapping)||(e[parseInt(p.toString(),10)][o.childMapping]=[]),e[parseInt(p.toString(),10)][o.childMapping].push(s.taskData),Ft(n,e[parseInt(p.toString(),10)],r,o,a,s)):"Above"===o.editSettings.newRowPosition?(e.splice(p,0,s.taskData),(0,t.isNullOrUndefined)(s.parentItem)||Ft(n,e[parseInt(p.toString(),10)],r,o,a,s)):"Below"===o.editSettings.newRowPosition&&(e.splice(p+1,0,s.taskData),(0,t.isNullOrUndefined)(s.parentItem)||Ft(n,e[parseInt(p.toString(),10)],r,o,a,s)):(e.splice(p,1),e.length||(l=!0))}else(0,t.isNullOrUndefined)(e[parseInt(p.toString(),10)][o.childMapping])||Lt(e[parseInt(p.toString(),10)][o.childMapping],i,r,n,o,a,s,d)&&Ft(n,e[parseInt(p.toString(),10)],r,o,a);return l}function Ft(e,i,r,n,o,a){if("Above"!==n.editSettings.newRowPosition&&"Below"!==n.editSettings.newRowPosition||"add"!==r&&"batchsave"!==r||(0,t.isNullOrUndefined)(a.parentItem)){var s,d=n.grid.getCurrentViewRecords();if(d.map(function(t,r){t[""+e]!==i[""+e]||(s=r)}),n.enableVirtualization&&(0,t.isNullOrUndefined)(s)){var l=(0,t.getValue)("uniqueIDCollection."+a.parentUniqueID,n);i=l}if((0,t.isNullOrUndefined)(s)||(i=d[parseInt(s.toString(),10)]),n.enableVirtualization&&(0,t.isNullOrUndefined)(i)&&!(0,t.isNullOrUndefined)(a)&&(i=(0,t.getValue)("uniqueIDCollection."+a.parentUniqueID,n)),o||(0,t.isNullOrUndefined)(i.childRecords)||!i.childRecords.length?i.hasChildRecords=!1:i.hasChildRecords=!0,"add"===r||"batchsave"===r){i.expanded=!0,i.hasChildRecords=!0,n.sortSettings.columns.length&&(0,t.isNullOrUndefined)(a)&&(a=d.filter(function(e){return e.parentUniqueID===i.uniqueID?e:null}));var p=a?a instanceof Array?a[0]:a:d[s+1];"Below"!==n.editSettings.newRowPosition&&(Object.prototype.hasOwnProperty.call(i,"childRecords")?(0,t.isNullOrUndefined)(a)||i[""+e]===a[""+e]||i.childRecords.some(function(e){return e.uniqueID===a.uniqueID})||i.childRecords.push(a):i.childRecords=[],-1===i.childRecords.indexOf(p)&&i[""+e]!==a[""+e]&&i.childRecords.unshift(p),o&&(Object.prototype.hasOwnProperty.call(i,n.childMapping)||(i[n.childMapping]=[]),-1===i[""+n.childMapping].indexOf(p)&&i[""+e]!==a[""+e]&&i[n.childMapping].unshift(p)))}for(var h=n.grid.getPrimaryKeyFieldNames()[0],c=n.grid.dataSource instanceof Ze.DataManager?n.grid.dataSource.dataSource.json:n.grid.dataSource,u=0;u<c.length;u++)if(c[parseInt(u.toString(),10)][""+h]===i[""+h]){c[parseInt(u.toString(),10)]=i;break}n.grid.setRowData(e,i);var g=n.getRowByIndex(s);"Batch"===n.editSettings.mode&&(g="add"===r?n.getRows()[n.grid.getCurrentViewRecords().indexOf(i)]:n.getRows()[n.grid.getRowIndexByPrimaryKey(i[""+e])]);var f=void 0;if((n.frozenRows||n.getFrozenColumns())&&(f=n.getRowByIndex(s)),!n.enableVirtualization&&!(0,t.isNullOrUndefined)(g)||!(0,t.isNullOrUndefined)(f)){var y=n.treeColumnIndex;n.allowRowDragAndDrop&&n.enableImmutableMode&&(y+=1),n.renderModule.cellRender({data:i,cell:g.cells[parseInt(y.toString(),10)]?g.cells[parseInt(y.toString(),10)]:f.cells[y-n.getFrozenColumns()],column:n.grid.getColumns()[n.treeColumnIndex],requestType:r}),(n.enableImmutableMode&&"indenting"===n.action||"outdenting"===n.action)&&n.renderModule.RowModifier({data:i,row:g})}}else{pt(n,a.parentItem.uniqueID).childRecords.push(a)}}var jt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),_t=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},Ht=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return jt(i,e),_t([(0,t.Property)(!1)],i.prototype,"enableCache",void 0),_t([(0,t.Property)(3)],i.prototype,"maxBlocks",void 0),_t([(0,t.Property)(3)],i.prototype,"initialBlocks",void 0),i}(t.ChildProperty),Gt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Qt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},Kt=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return Gt(i,e),Qt([(0,t.Property)("startsWith")],i.prototype,"operator",void 0),Qt([(0,t.Property)(!1)],i.prototype,"ignoreAccent",void 0),Qt([(0,t.Property)(null)],i.prototype,"headerTemplate",void 0),Qt([(0,t.Property)(null)],i.prototype,"template",void 0),Qt([(0,t.Property)(null)],i.prototype,"footerTemplate",void 0),Qt([(0,t.Property)(!0)],i.prototype,"enableSearching",void 0),Qt([(0,t.Property)(null)],i.prototype,"renderCustomColumnChooser",void 0),i}(t.ChildProperty),Wt=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Yt=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},Jt=function(e){function i(i,n){var o=e.call(this,i,n)||this;o.dataResults={},o.uniqueIDCollection={},o.uniqueIDFilterCollection={},o.changedRecords="changedRecords",o.deletedRecords="deletedRecords",o.addedRecords="addedRecords",o.indentOutdentAction="indentOutdentAction",o.isFromChartSide=!1,o.modifiedRecords=[],o.stackedHeader=!1,o.freezeColumnRefresh=!0,o.objectEqualityChecker=function(e,t){if(e){for(var i=Object.keys(e),r=!0,n=["Children","childRecords","taskData","uniqueID","parentItem","parentUniqueID","index"],o=0;o<i.length;o++){if(e[i[parseInt(o.toString(),10)]]!==t[i[parseInt(o.toString(),10)]]&&-1===n.indexOf(i[parseInt(o.toString(),10)]))if(!(e[i[parseInt(o.toString(),10)]]instanceof Date&&t[i[parseInt(o.toString(),10)]]instanceof Date)||e[i[parseInt(o.toString(),10)]].getTime()!==t[i[parseInt(o.toString(),10)]].getTime()){r=!1;break}}return r}return!1},r.Inject(gt,C),(0,t.setValue)("mergePersistData",o.mergePersistTreeGridData,o);(0,t.isNullOrUndefined)(o.injectedModules.Logger)||l.Grid.Inject(l.Logger);o.injectedModules.filter(function(e){"freeze"===e.prototype.getModuleName()&&l.Grid.Inject(l.Freeze)});return o.grid=new l.Grid,o}var r;return Wt(i,e),r=i,i.prototype.excelExport=function(e,t,i,r){return this.excelExportModule.Map(e,t,i,r,!1)},i.prototype.csvExport=function(e,t,i,r){return this.excelExportModule.Map(e,t,i,r,!0)},i.prototype.pdfExport=function(e,t,i,r){return this.pdfExportModule.Map(e,t,i,r)},i.prototype.serverExcelExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},i.prototype.serverPdfExport=function(e){this.isExcel=!1,this.exportTreeGrid(e)},i.prototype.serverCsvExport=function(e){this.isExcel=!0,this.exportTreeGrid(e)},i.prototype.exportTreeGrid=function(e){var t=this.grid.getDataModule().generateQuery(!0),i=(new Ze.UrlAdaptor).processQuery(new Ze.DataManager({url:""}),t),r=JSON.parse(i.data),n=JSON.parse(this.addOnPersist(["allowPaging","pageSettings","sortSettings","allowPdfExport","allowExcelExport","aggregates","filterSettings","columns","locale","searchSettings","idMapping","parentIdMapping","childMapping","treeColumnIndex"]));n.filterSettings.columns=r.where,n.searchSettings.fields=r.search&&r.search[0].fields||[],n.sortSettings.columns=r.sorted,n.columns=this.setHeaderText(n.columns,["field","headerText","type","format","visible","template","index","width","textAlign","headerTextAlign","columns"]);var o=this.createElement("form",{id:"ExportForm"});o.style.display="none";var a=this.createElement("input",{id:"treeGridInput",attrs:{name:"treeGridModel"}});a.value=JSON.stringify(n),o.method="POST",o.action=e,o.appendChild(a),document.body.appendChild(o),o.submit(),o.remove()},i.prototype.setHeaderText=function(e,i){for(var r=0;r<e.length;r++){var n=this.getColumnByUid(e[parseInt(r.toString(),10)].uid);this.stackedHeader&&(0,t.isNullOrUndefined)(n)&&(n=(0,t.isNullOrUndefined)(e[parseInt(r.toString(),10)].field)?e[parseInt(r.toString(),10)]:this.getColumnByField(e[parseInt(r.toString(),10)].field)),e[parseInt(r.toString(),10)].headerText=n.headerText,(0,t.isNullOrUndefined)(n.template)||(e[parseInt(r.toString(),10)].template="true"),e[parseInt(r.toString(),10)].format&&(e[parseInt(r.toString(),10)].format=(0,l.getNumberFormat)(this.getFormat(n.format),n.type,!1,this.currencyCode),this.isExcel||"datetime"!==n.type&&"date"!==n.type||(e[parseInt(r.toString(),10)].format=e[parseInt(r.toString(),10)].format.toString().replace("AM/PM","tt")),e[parseInt(r.toString(),10)].type=n.type),e[parseInt(r.toString(),10)].columns&&this.setHeaderText(e[parseInt(r.toString(),10)].columns,i);for(var o=Object.keys(e[parseInt(r.toString(),10)]),a=0;a<o.length;a++)i.indexOf(o[parseInt(a.toString(),10)])<0&&delete e[parseInt(r.toString(),10)][o[parseInt(a.toString(),10)]]}return e},i.prototype.getFormat=function(e){return"object"==typeof e?(0,t.isNullOrUndefined)(e.format)?e.skeleton:e.format:e},i.prototype.getModuleName=function(){return"treegrid"},i.prototype.preRender=function(){this.TreeGridLocale(),this.initProperties(),this.defaultLocale={Above:"Above",Below:"Below",Child:"Child",AddRow:"Add Row",ExpandAll:"Expand All",CollapseAll:"Collapse All",RowIndent:"Indent",RowOutdent:"Outdent"},this.l10n=new t.L10n("treegrid",this.defaultLocale,this.locale),this.isSelfReference&&(0,t.isNullOrUndefined)(this.childMapping)&&(this.childMapping="Children")},i.prototype.sortByColumn=function(e,t,i){this.sortModule&&this.sortModule.sortColumn(e,t,i)},i.prototype.clearSorting=function(){this.sortModule&&this.sortModule.clearSorting()},i.prototype.removeSortColumn=function(e){this.sortModule&&this.sortModule.removeSortColumn(e)},i.prototype.search=function(e){this.grid.search(e)},i.prototype.autoFitColumns=function(e){this.resizeModule.autoFitColumns(e),this.updateColumnModel()},i.prototype.reorderColumns=function(e,t){this.grid.reorderColumns(e,t)},i.prototype.TreeGridLocale=function(){if(!(0,t.isNullOrUndefined)(this.locale)){var e=t.L10n.locale,i={};(0,t.setValue)(this.locale,{},i);var r;({}),r=(0,l.getObject)(this.locale,e);var n;({}),n=(0,l.getObject)(this.getModuleName(),r),(0,t.setValue)("grid",n,(0,l.getObject)(this.locale,i)),t.L10n.load(i)}},i.prototype.print=function(){this.printModule.print()},i.prototype.treeGridkeyActionHandler=function(e){if(this.allowKeyboard){var i=void 0,r=void 0,n=void 0,o=void 0,a=void 0;switch(e.action){case"ctrlDownArrow":this.expandAll();break;case"ctrlUpArrow":this.collapseAll();break;case"ctrlShiftUpArrow":n=(i=e.target).closest(".e-rowcell"),(0,t.isNullOrUndefined)(n)||(o=n.closest("tr"),(0,t.isNullOrUndefined)(o)||(0,t.isNullOrUndefined)(o.getElementsByClassName("e-treegridexpand")[0])||this.expandCollapseRequest(o.querySelector(".e-treegridexpand")));break;case"ctrlShiftDownArrow":n=(i=e.target).closest(".e-rowcell"),(0,t.isNullOrUndefined)(n)||(o=n.closest("tr"),(0,t.isNullOrUndefined)(o)||(0,t.isNullOrUndefined)(o.getElementsByClassName("e-treegridcollapse")[0])||this.expandCollapseRequest(o.querySelector(".e-treegridcollapse")));break;case"downArrow":if(!this.enableVirtualization&&(0,t.isNullOrUndefined)(this.rowTemplate))if(i=e.target,(0,t.isNullOrUndefined)(i.querySelectorAll(".e-rowcell"))||(i=(0,l.parentsUntil)(i,"e-rowcell")),!(0,t.isNullOrUndefined)(i))if(r=i.parentElement,!(0,t.isNullOrUndefined)(r))if((p=r.cellIndex)&&"dropdownedit"===this.grid.getColumnByIndex(p).editType&&(0,t.isNullOrUndefined)(this.grid.getColumnByIndex(p).edit.obj)&&(r=i),null!==(a=this.findnextRowElement(r))){var s=i.cellIndex,d=a.children[parseInt(s.toString(),10)];if(!(0,t.isNullOrUndefined)(d)&&!this.grid.isEdit)this.grid.getContent().querySelectorAll(".e-rowcell.e-focused, .e-rowcell.e-focus").forEach(function(e){(0,t.removeClass)([e],["e-focused","e-focus"])}),(0,t.addClass)([d],["e-focused","e-focus"])}else this.clearSelection();break;case"upArrow":var p;if(!this.enableVirtualization&&(0,t.isNullOrUndefined)(this.rowTemplate))if(i=e.target,(0,t.isNullOrUndefined)(i.querySelectorAll(".e-rowcell"))||(i=(0,l.parentsUntil)(i,"e-rowcell")),!(0,t.isNullOrUndefined)(i))if(r=i.parentElement,!(0,t.isNullOrUndefined)(r))if((p=r.cellIndex)&&"dropdownedit"===this.grid.getColumnByIndex(p).editType&&(0,t.isNullOrUndefined)(this.grid.getColumnByIndex(p).edit.obj)&&(r=i),null!==(a=this.findPreviousRowElement(r))){var h=i.cellIndex;if(!(0,t.isNullOrUndefined)(h)){var c=a.children[parseInt(h.toString(),10)];if(!(0,t.isNullOrUndefined)(c)&&!this.grid.isEdit)this.grid.getContent().querySelectorAll(".e-rowcell.e-focused, .e-rowcell.e-focus").forEach(function(e){(0,t.removeClass)([e],["e-focused","e-focus"])}),(0,t.addClass)([c],["e-focused","e-focus"])}}else this.clearSelection()}}},i.prototype.findnextRowElement=function(e){var t=e.nextElementSibling;return null===t||-1===t.className.indexOf("e-summaryrow")&&!t.classList.contains("e-childrow-hidden")||(t=this.findnextRowElement(t)),t},i.prototype.findPreviousRowElement=function(e){var t=e.previousElementSibling;return null===t||-1===t.className.indexOf("e-summaryrow")&&!t.classList.contains("e-childrow-hidden")||(t=this.findPreviousRowElement(t)),t},i.prototype.initProperties=function(){this.defaultLocale={},this.flatData=[],this.infiniteScrollData=[],this.remoteCollapsedData=[],this.remoteExpandedData=[],this.parentData=[],this.columnModel=[],this.isExpandAll=!1,this.isCollapseAll=!1,this.freezeColumnRefresh=!0,this.keyConfigs={ctrlDownArrow:"ctrl+downarrow",ctrlUpArrow:"ctrl+uparrow",ctrlShiftUpArrow:"ctrl+shift+uparrow",ctrlShiftDownArrow:"ctrl+shift+downarrow",downArrow:"downArrow",upArrow:"upArrow"},this.isLocalData=!(this.dataSource instanceof Ze.DataManager)||this.dataSource.dataSource.offline||!(0,t.isNullOrUndefined)(this.dataSource.ready)||this.dataSource.adaptor instanceof Ze.RemoteSaveAdaptor,this.isSelfReference=!(0,t.isNullOrUndefined)(this.parentIdMapping)},i.prototype.wireEvents=function(){t.EventHandler.add(this.grid.element,"click",this.mouseClickHandler,this),t.EventHandler.add(this.element,"touchend",this.mouseClickHandler,this),this.keyboardModule=new t.KeyboardEvents(this.element,{keyAction:this.treeGridkeyActionHandler.bind(this),keyConfigs:this.keyConfigs,eventName:"keydown"}),this.allowKeyboard&&(this.element.tabIndex=-1===this.element.tabIndex?0:this.element.tabIndex)},i.prototype.requiredModules=function(){var e=[],i="mergedColumns";if(this[""+i]&&(this.grid[""+i]=this[""+i]),(0,t.isNullOrUndefined)(this.changedProperties.columns)&&this.grid.splitFrozenCount(this.getColumns()),this.isDestroyed)return e;e.push({member:"filter",args:[this,this.filterSettings],name:"Filter"}),(0,t.isNullOrUndefined)(this.toolbar)||e.push({member:"toolbar",args:[this],name:"Toolbar"}),this.contextMenuItems&&e.push({member:"contextMenu",args:[this],name:"ContextMenu"}),this.allowPaging&&e.push({member:"pager",args:[this,this.pageSettings],name:"Page"}),this.allowReordering&&e.push({member:"reorder",args:[this],name:"Reorder"}),this.allowSorting&&e.push({member:"sort",args:[this],name:"Sort"}),this.aggregates.length>0&&e.push({member:"summary",args:[this],name:"Aggregate"}),this.resizeCheck()&&e.push({member:"resize",args:[this],name:"Resize"}),this.allowExcelExport&&e.push({member:"ExcelExport",args:[this],name:"ExcelExport"});var r=this.injectedModules.filter(function(e){return"freeze"===e.prototype.getModuleName()}),n=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze});return(this.frozenColumns||this.frozenRows||this.getFrozenColumns()||n)&&r.length>0&&e.push({member:"freeze",args:[this],name:"Freeze"}),this.detailTemplate&&e.push({member:"detailRow",args:[this],name:"DetailRow"}),this.allowPdfExport&&e.push({member:"PdfExport",args:[this],name:"PdfExport"}),this.showColumnMenu&&e.push({member:"columnMenu",args:[this],name:"ColumnMenu"}),this.showColumnChooser&&e.push({member:"ColumnChooser",args:[this],name:"ColumnChooser"}),this.extendRequiredModules(e),e},i.prototype.resizeCheck=function(){var e=!(!this.showColumnMenu||this.columnMenuItems&&!this.columnMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length),t=!(!this.contextMenuItems||!this.contextMenuItems.filter(function(e){return"AutoFit"===e||"AutoFitAll"===e}).length);return this.allowResizing||e||t},i.prototype.extendRequiredModules=function(e){var i=this.injectedModules.filter(function(e){return"rowDragAndDrop"===e.prototype.getModuleName()});(this.allowRowDragAndDrop||i.length)&&((0,t.isNullOrUndefined)(this.toolbar)||!this.toolbar.includes("Indent")&&!this.toolbar.includes("Outdent")||(this.isIndentEnabled=!0),e.push({member:"rowDragAndDrop",args:[this],name:"RowDD"})),(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&e.push({member:"edit",args:[this],name:"Edit"}),!(0,t.isNullOrUndefined)(this.columns)&&this.isCommandColumn(this.columns)&&e.push({member:"commandColumn",args:[this],name:"CommandColumn"}),this.allowSelection&&e.push({member:"selection",args:[this],name:"Selection"}),this.enableVirtualization&&e.push({member:"virtualScroll",args:[this],name:"VirtualScroll"}),this.enableInfiniteScrolling&&e.push({member:"infiniteScroll",args:[this],name:"InfiniteScroll"}),e.push({member:"logger",args:[this.grid]})},i.prototype.isCommandColumn=function(e){var t=this;return e.some(function(e){return e.columns?t.isCommandColumn(e.columns):!(!e.commands&&!e.commandsTemplate)})},i.prototype.unwireEvents=function(){this.grid&&this.grid.element&&t.EventHandler.remove(this.grid.element,"click",this.mouseClickHandler),this.element&&(t.EventHandler.remove(this.element,"touchend",this.mouseClickHandler),this.keyboardModule&&(this.keyboardModule.destroy(),this.keyboardModule=null),this.allowKeyboard&&this.element.removeAttribute("tabIndex"))},i.prototype.log=function(e,t){this.loggerModule&&this.loggerModule.treeLog(e,t,this)},i.prototype.render=function(){var e=this;this.isReact&&(this.grid.isReact=!0,this.grid.portals=[]),this.isVue&&(this.grid.isVue=!0,this.grid.vueInstance=this.vueInstance),(0,Rt.createSpinner)({target:this.element},this.createElement),this.log(["mapping_fields_missing"]),this.renderModule=new xt(this),this.dataModule=new Ct(this),this.printModule=new ft(this),this.trigger(D),this.autoGenerateColumns(),this.initialRender=!0,(0,t.isNullOrUndefined)(this.dataSource)||this.convertTreeData(this.dataSource),this.loadGrid(),this.element.classList.contains("e-treegrid")&&this.rowDropSettings.targetID&&(this.grid.rowDropSettings.targetID+="_gridcontrol"),this.addListener();var i=(0,t.createElement)("div",{id:this.element.id+"_gridcontrol",className:"e-treelistgrid"});(0,t.addClass)([this.element],"e-treegrid"),(0,t.isNullOrUndefined)(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),(0,t.isNullOrUndefined)(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.element.appendChild(i);var r=this.grid.requiredModules;this.grid.requiredModules=function(){var e=[];e=r.apply(this);for(var t=0;t<e.length;t++)"virtualscroll"===e[parseInt(t.toString(),10)].member&&(e[parseInt(t.toString(),10)].member="treeVirtualScroll");return e};var n="root";this.grid[""+n]=this[""+n]?this[""+n]:this,this.grid.appendTo(i),this.actionFailureHandler(),this.element.getElementsByClassName("e-gridcontent")[0].childNodes[0].setAttribute("tabindex","0");var o=this.element.getElementsByClassName("e-content")[0].querySelector(".e-table");(0,t.isNullOrUndefined)(o)||o.setAttribute("role","treegrid"),this.isIndentEnabled&&this.refreshToolbarItems(),this.updateColumnModel(),this.wireEvents(),this.renderComplete();var a="destroyTemplate",s=this.grid[""+a];this.grid[""+a]=function(i,r,n){s.apply(e.grid);e.isReact&&(0,t.isNullOrUndefined)(e.portals)?(0,t.isNullOrUndefined)(n)||n():e.clearTemplate(i,r,n)}},i.prototype.actionFailureHandler=function(){var e=this,i=[],r=this.getPrimaryKeyFieldNames(),n=this.flatData.length;(this.editSettings.allowAdding||this.editSettings.allowDeleting||this.editSettings.allowEditing)&&0===r.length&&0!==n&&i.push("For the CRUD actions, it is necessary to enable Primary Key field for the unique data column."),this.allowRowDragAndDrop&&0===r.length&&0!==n&&i.push("For the Row Drag and Drop actions, it is necessary to enable Primary Key field for the unique data column."),this.allowPaging&&this.enableVirtualization&&i.push("Paging is not allowed in virtualization case."),0===n&&0===this.columns.length&&i.push("Either of the Data source or columns should be given."),this.frozenColumns>0&&this.columnModel.filter(function(e){return e.isFrozen})&&i.push("Use only one attribute for Frozen either IsFrozen or FrozenColumns."),this.enableVirtualization&&!(0,t.isNullOrUndefined)(this.detailTemplate)&&i.push("Virtual scrolling is not compatible with the detail template"),!(this.frozenColumns>0||this.frozenRows>0||this.columnModel.filter(function(e){return e.isFrozen}))||(0,t.isNullOrUndefined)(this.detailTemplate)&&(0,t.isNullOrUndefined)(this.rowTemplate)||i.push("Frozen rows and columns are not supported with the Detail template and row template."),(this.frozenColumns>0||this.columnModel.filter(function(e){return e.isFrozen}).length>0||this.frozenRows>0)&&"Cell"===this.editSettings.mode&&i.push("Frozen rows and columns are not supported with cell editing."),this.allowSelection&&!(0,t.isNullOrUndefined)(this.rowTemplate)&&i.push("Selection is not supported in RowTemplate"),this.treeColumnIndex>=this.columns.length&&i.push("TreeColumnIndex value should not exceed the total column count."),this.enableVirtualization&&(this.columnModel.some(function(e){return/%$/.test(e.width)})||/%$/.test(this.height.toString()))&&i.push("column width and height should be in pixels"),"Children"===this.childMapping||(0,t.isNullOrUndefined)(this.idMapping)||i.push("Both IdMapping and ChildMapping should not be used together for tree grid rendering."),(!(0,t.isNullOrUndefined)(this.idMapping)&&(0,t.isNullOrUndefined)(this.parentIdMapping)||(0,t.isNullOrUndefined)(this.idMapping)&&!(0,t.isNullOrUndefined)(this.parentIdMapping))&&i.push("IdMapping and ParentIdMapping properties should be defined and vice versa.");var o=this.columnModel.filter(function(e){return e.showCheckbox}),a=this.columns[this.treeColumnIndex];if(0!==o.length&&(o!==a&&i.push("ShowCheckbox column should not be defined other than the tree column."),o.length>1&&i.push("Only one column can have the ShowCheckbox option enabled.")),null!==this.treeColumnIndex&&-1!==this.treeColumnIndex&&this.treeColumnIndex<this.columns.length&&0!==this.columnModel.filter(function(t){return"Right"===t.textAlign&&t.field===e.columnModel[e.treeColumnIndex].field}).length&&i.push("TextAlign right for the tree column is not applicable."),i.length>0){var s={error:{}};i.forEach(function(e,t){s.error[parseInt(t.toString(),10)]=e}),this.trigger(Ye,s)}},i.prototype.refreshToolbarItems=function(){var e=this.toolbarModule.getToolbar(),t=this.element.id+"_gridcontrol_indent",i=this.element.id+"_gridcontrol_outdent",r=e.querySelector("#"+t).parentElement,n=e.querySelector("#"+i).parentElement;r.classList.add("e-hidden"),n.classList.add("e-hidden")},i.prototype.afterGridRender=function(){(0,t.isNullOrUndefined)(this.grid.clipboardModule)||this.grid.clipboardModule.destroy(),this.clipboardModule=this.grid.clipboardModule=new Xe(this,this.grid.serviceLocator)},i.prototype.convertTreeData=function(e){if(tt(this)&&(e=(0,t.getValue)("result",e)),e instanceof Array&&e.length>0&&Object.prototype.hasOwnProperty.call(e[0],"level")){this.flatData=e;for(var i=function(e,i){var n=r.flatData[parseInt(e.toString(),10)];(0,t.setValue)("uniqueIDCollection."+n.uniqueID,n,r),0!==n.level||r.parentData.some(function(e){return e.uniqueID===n.uniqueID})||r.parentData.push(n)},r=this,n=0,o=this.flatData.length;n<o;n++)i(n)}else if(tt(this)){var a=(0,t.getValue)("result",this.dataSource);this.dataModule.convertToFlatData(a)}else this.dataModule.convertToFlatData(e)},i.prototype.bindGridProperties=function(){this.bindedDataSource(),this.grid.enableRtl=this.enableRtl,this.grid.allowKeyboard=this.allowKeyboard,this.grid.columns=this.getGridColumns(this.columns),this.grid.allowExcelExport=this.allowExcelExport,this.grid.allowPdfExport=this.allowPdfExport,this.grid.query=this.query,this.grid.columnQueryMode=this.columnQueryMode,this.grid.allowPaging=this.allowPaging,this.grid.pageSettings=(0,l.getActualProperties)(this.pageSettings),this.grid.pagerTemplate=this.pagerTemplate,this.grid.showColumnMenu=this.showColumnMenu,this.grid.allowSorting=this.allowSorting,this.grid.allowMultiSorting=this.allowMultiSorting,this.grid.allowFiltering=this.allowFiltering,this.grid.enableVirtualization=this.enableVirtualization,this.grid.enableColumnVirtualization=this.enableColumnVirtualization,this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling,this.grid.infiniteScrollSettings=this.infiniteScrollSettings,this.grid.enableVirtualMaskRow=this.enableVirtualMaskRow,this.grid.loadingIndicator=this.loadingIndicator,this.grid.width=this.width,this.grid.height=this.height,this.grid.enableAltRow=this.enableAltRow,this.grid.allowReordering=this.allowReordering,this.grid.allowTextWrap=this.allowTextWrap,this.grid.allowResizing=this.allowResizing,this.grid.enableHover=this.enableHover,this.grid.enableAutoFill=this.enableAutoFill,this.grid.enableAdaptiveUI=this.enableAdaptiveUI,this.grid.enableImmutableMode=this.enableImmutableMode,this.grid.allowRowDragAndDrop=this.allowRowDragAndDrop,this.grid.rowDropSettings=(0,l.getActualProperties)(this.rowDropSettings),this.grid.rowHeight=this.rowHeight,this.grid.gridLines=this.gridLines,this.grid.allowSelection=this.allowSelection,this.grid.toolbar=(0,l.getActualProperties)(this.getGridToolbar()),this.grid.toolbarTemplate=this.toolbarTemplate,this.grid.showColumnChooser=this.showColumnChooser,this.grid.columnChooserSettings=this.columnChooserSettings,this.grid.filterSettings=(0,l.getActualProperties)(this.filterSettings),this.grid.selectionSettings=(0,l.getActualProperties)(this.selectionSettings),this.grid.sortSettings=(0,l.getActualProperties)(this.sortSettings),this.grid.searchSettings=(0,l.getActualProperties)(this.searchSettings),this.grid.aggregates=(0,l.getActualProperties)(this.aggregates),this.grid.textWrapSettings=(0,l.getActualProperties)(this.textWrapSettings),this.grid.printMode=(0,l.getActualProperties)(this.printMode),this.grid.locale=(0,l.getActualProperties)(this.locale),this.grid.selectedRowIndex=this.selectedRowIndex,this.grid.contextMenuItems=(0,l.getActualProperties)(this.getContextMenu()),this.grid.columnMenuItems=(0,l.getActualProperties)(this.columnMenuItems),this.grid.editSettings=this.getGridEditSettings(),this.grid.rowTemplate=(0,l.getActualProperties)(this.rowTemplate),this.grid.detailTemplate=(0,l.getActualProperties)(this.detailTemplate),this.grid.frozenRows=this.frozenRows,this.grid.frozenColumns=this.frozenColumns,this.grid.clipMode=(0,l.getActualProperties)(this.clipMode);var e="templateDotnetInstance";this.grid[""+e]=this[""+e];this.grid.isJsComponent=!0;this.grid.enableHtmlSanitizer=this.enableHtmlSanitizer,this.grid.enableStickyHeader=this.enableStickyHeader,this.grid.emptyRecordTemplate=this.emptyRecordTemplate,this.grid.isRowSelectable=this.isRowSelectable;this.grid.isTreeGrid=!0},i.prototype.triggerEvents=function(e){this.trigger((0,l.getObject)("name",e),e)},i.prototype.IsExpandCollapseClicked=function(e){this.isFromChartSide||(0,t.isNullOrUndefined)(e.target)||!(e.target.classList.contains("e-treegridexpand")||e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-summarycell"))||this.selectionSettings.checkboxOnly||!(!(0,t.isNullOrUndefined)(e.data)&&e.data.hasChildRecords||-1!==e.rowIndex&&(0,t.isNullOrUndefined)(e.data))||(e.cancel=!0)},i.prototype.bindGridEvents=function(){var e=this;this.grid.rowSelecting=function(i){e.IsExpandCollapseClicked(i),!(0,t.isNullOrUndefined)(i.data)&&e.selectionSettings.persistSelection&&e.columnModel.filter(function(e){return"checkbox"===e.type}).length>0&&et(e)&&((0,t.isNullOrUndefined)(i.data.parentItem)&&!i.isHeaderCheckboxClicked||(e.parentQuery=e.query.queries.filter(function(t){return t.e.field===e.parentIdMapping}),e.query.queries=e.query.queries.slice(0,0))),"Root"===e.pageSettings.pageSizeMode&&(e.grid.selectionModule.totalRecordsCount=e.grid.currentViewData.length),i.cancel||e.trigger(q,i)},this.grid.rowDeselecting=function(i){e.IsExpandCollapseClicked(i),!(0,t.isNullOrUndefined)(i.data)&&e.selectionSettings.persistSelection&&e.columnModel.filter(function(e){return"checkbox"===e.type}).length>0&&et(e)&&(e.parentQuery=e.query.queries.filter(function(t){return t.e.field===e.parentIdMapping}),e.query.queries=e.query.queries.slice(0,0)),e.trigger(Te,i)},this.grid.rowSelected=function(t){e.enableVirtualization&&e.virtualScrollModule.updateSelection(t),e.selectedRowIndex=e.grid.selectedRowIndex,e.notify(k,t),e.trigger(k,t)},this.grid.rowDeselected=function(i){e.selectedRowIndex=e.grid.selectedRowIndex,(0,t.isNullOrUndefined)(i.data)||e.notify(V,i),e.trigger(V,i)},this.grid.resizeStop=function(t){e.updateColumnModel(),e.trigger(F,t)},this.grid.excelQueryCellInfo=function(t){e.notify("excelCellInfo",t),t=e.dataResults},this.grid.excelAggregateQueryCellInfo=function(t){e.notify("excelAggregateCellInfo",t),t=e.dataResults},this.grid.pdfAggregateQueryCellInfo=function(t){e.notify("pdfAggregateCellInfo",t),t=e.dataResults},this.grid.pdfQueryCellInfo=function(t){e.notify("pdfCellInfo",t),t=e.dataResults},this.grid.checkBoxChange=function(t){e.trigger(T,t)},this.grid.pdfExportComplete=this.triggerEvents.bind(this),this.grid.excelExportComplete=this.triggerEvents.bind(this),this.grid.excelHeaderQueryCellInfo=this.triggerEvents.bind(this),this.grid.pdfHeaderQueryCellInfo=this.triggerEvents.bind(this),this.grid.dataSourceChanged=this.triggerEvents.bind(this),this.grid.recordDoubleClick=this.triggerEvents.bind(this),this.grid.cellDeselected=this.triggerEvents.bind(this),this.grid.cellDeselecting=this.triggerEvents.bind(this),this.grid.columnMenuOpen=this.triggerEvents.bind(this),this.grid.columnMenuClick=this.triggerEvents.bind(this),this.grid.cellSelected=this.triggerEvents.bind(this),this.grid.headerCellInfo=this.triggerEvents.bind(this),this.grid.resizeStart=this.triggerEvents.bind(this),this.grid.resizing=this.triggerEvents.bind(this),this.grid.columnDrag=this.triggerEvents.bind(this),this.grid.columnDragStart=this.triggerEvents.bind(this),this.grid.columnDrop=this.triggerEvents.bind(this),this.grid.beforePrint=this.triggerEvents.bind(this),this.grid.beforeCopy=this.triggerEvents.bind(this),this.grid.beforePaste=function(t){for(var i=e.getRows(),r="rowIndex";i[t[""+r]].classList.contains("e-summaryrow");)t[""+r]++;e.trigger(Z,t)},this.grid.load=function(){if(e.grid.on("initial-end",e.afterGridRender,e),!(0,t.isNullOrUndefined)(e.loggerModule)){e.loggerModule=e.grid.loggerModule=new C(e.grid)}},this.grid.printComplete=this.triggerEvents.bind(this),this.grid.actionFailure=function(t){e.trigger(Ye,t)},this.extendedGridDataBoundEvent(),this.extendedGridEvents(),this.extendedGridActionEvents(),this.extendedGridEditEvents(),this.bindGridDragEvents(),this.bindCallBackEvents()},i.prototype.lastRowBorder=function(e,i){for(var r=0;r<e.cells.length;r++)i?(0,t.addClass)([e.cells[parseInt(r.toString(),10)]],"e-lastrowcell"):(0,t.removeClass)([e.cells[parseInt(r.toString(),10)]],"e-lastrowcell")},i.prototype.isPixelHeight=function(){return"auto"!==this.height&&-1===this.height.toString().indexOf("%")},i.prototype.extendedGridDataBoundEvent=function(){var e=this;this.grid.dataBound=function(i){if(e.lastRowBorderEventListener(),e.updateRowTemplate(),e.updateColumnModel(),e.updateAltRow(e.getRows()),e.notify("dataBoundArg",i),et(e)&&!st(e)&&!e.hasChildMapping){var r=void 0;r=e.dataResults.result?0:1,(0,t.setValue)("grid.contentModule.isLoaded",!(r>0),e)}if(e.isPixelHeight()&&e.initialRender)for(var n=e.getContentTable().rows,o=[].slice.call(n),a=o.length-1;a>0;a--)if(!ht(o[parseInt(a.toString(),10)])){o[parseInt(a.toString(),10)].nextElementSibling&&e.lastRowBorder(o[parseInt(a.toString(),10)],!0);break}var s="action";if(e.enableVirtualization&&e.selectionSettings.persistSelection&&("expand"===e.dataResults[""+s]||"collapse"===e.dataResults[""+s])){if(e.grid.selectionModule.refreshPersistSelection(),"Single"===e.grid.selectionSettings.type){var d="updateRowSelection",l=e.getCurrentViewRecords().indexOf(e.grid.selectionModule.data);e.grid.selectionModule[""+d](e.getRows()[parseInt(l.toString(),10)],l)}}if(e.enableVirtualization&&e.selectionSettings.persistSelection&&!(0,t.isNullOrUndefined)(e.virtualScrollModule.prevSelectedRecord))for(a=0;a<e.virtualScrollModule.prevSelectedRecord.length;a++){d="updateRowSelection",l=e.getCurrentViewRecords().indexOf(e.virtualScrollModule.prevSelectedRecord[parseInt(a.toString(),10)]);e.grid.selectionModule[""+d](e.getRows()[parseInt(l.toString(),10)],l)}e.trigger(O,i),e.initialRender=!1};var i=this;this.grid.beforeDataBound=function(e){var r=(0,l.getObject)("action",e);if((et(i)&&!st(i)||tt(this))&&"edit"!==r)i.notify("updateRemoteLevel",e),e=i.dataResults;else if(0===i.flatData.length&&st(i)&&i.dataSource instanceof Ze.DataManager){var n=i.dataSource;i.dataModule.convertToFlatData(n.dataSource.json),e.result=i.grid.dataSource.dataSource.json=i.flatData}if(et(i)||tt(this)||(0,t.isNullOrUndefined)(i.dataSource)||(this.isPrinting&&(0,t.setValue)("isPrinting",!0,e),i.notify("dataProcessor",e)),(0,t.extend)(e,i.dataResults),i.enableImmutableMode&&(e.result=e.result.slice()),i.initialRender&&(this.contentModule.objectEqualityChecker=i.objectEqualityChecker),!this.isPrinting){var o=new Ze.Deferred;return i.trigger(A,e,function(e){o.resolve(e)}),o}},this.grid.log=function(t,i){e.loggerModule&&e.loggerModule.log(t,i)}},i.prototype.lastRowBorderEventListener=function(){this.grid.on("last-rowcell-border-updated",this.lastRowCellBorderUpdated,this)},i.prototype.bindCallBackEvents=function(){var e=this;this.grid.toolbarClick=function(t){if(!(t.item.id===e.grid.element.id+"_excelexport"&&!1===e.allowExcelExport||t.item.id===e.grid.element.id+"_pdfexport"&&!1===e.allowPdfExport||t.item.id===e.grid.element.id+"_csvexport"&&!1===e.allowExcelExport)){var i=new Ze.Deferred;return e.trigger(B,t,function(r){r.cancel||e.notify(B,t),i.resolve(r)}),i}},this.grid.cellSelecting=function(i){var r=e.grid.selectionModule.actualTarget;(0,t.isNullOrUndefined)(r)||!r.classList.contains("e-treegridexpand")&&!r.classList.contains("e-treegridcollapse")||(i.cancel=!0);var n=new Ze.Deferred;return e.trigger((0,l.getObject)("name",i),i,function(e){n.resolve(e)}),n},this.grid.beginEdit=function(i){if((0,t.isNullOrUndefined)(i.row)||!i.row.classList.contains("e-summaryrow")){var r=new Ze.Deferred;return e.trigger(ie,i,function(e){r.resolve(e)}),r}i.cancel=!0}},i.prototype.extendedGridEditEvents=function(){var e=this;this.grid.dataStateChange=function(i){e.isExpandRefresh?(e.isExpandRefresh=!1,e.grid.dataSource={result:e.flatData,count:(0,t.getValue)("count",e.grid.dataSource)}):("infiniteScroll"!==i.action.requestType&&(e.infiniteScrollData=[]),e.trigger(N,i))},this.grid.cellSave=function(i){if(e.grid.isContextMenuOpen()){var r=e.grid.contextMenuModule.contextMenu.element.getElementsByClassName("e-selected")[0];((0,t.isNullOrUndefined)(r)||r.id!==e.element.id+"_gridcontrol_cmenu_Save")&&(i.cancel=!0)}var n=new Ze.Deferred;return e.trigger(oe,i,function(t){t.cancel||e.notify(oe,t),n.resolve(t)}),n},this.grid.cellSaved=function(t){e.trigger(ae,t),e.notify(ae,t)},this.grid.cellEdit=function(t){var i=new Ze.Deferred;return t.promise=i,e.notify(se,t),i},this.grid.batchAdd=function(t){e.trigger(pe,t),e.notify(pe,t)},this.grid.beforeBatchSave=function(t){e.trigger(ue,t),e.notify(ue,t)},this.grid.beforeBatchAdd=function(t){e.trigger(ce,t),e.notify(ce,t)},this.grid.batchDelete=function(t){e.trigger(de,t),e.notify(de,t)},this.grid.beforeBatchDelete=function(t){e.trigger(he,t),e.notify(he,t)},this.grid.batchCancel=function(t){"Cell"!==e.editSettings.mode&&e.trigger(le,t),e.notify(le,t)}},i.prototype.updateRowTemplate=function(){var e=this;this.rowTemplate&&(this.isReact&&0===this.getContentTable().rows.length?setTimeout(function(){if(e.treeColumnRowTemplate(),e.enableCollapseAll)for(var t=e.getCurrentViewRecords(),i=e.getContentTable().rows,r=0;r<i.length;r++){var n={data:t[parseInt(r.toString(),10)],row:i[parseInt(r.toString(),10)]};e.renderModule.RowModifier(n)}},0):this.treeColumnRowTemplate())},i.prototype.bindedDataSource=function(){var e="dataSource",i="ready";if(this.dataSource&&tt(this)){var r=this.flatData,n=(0,t.getValue)("count",this.dataSource);this.grid.dataSource={result:r,count:n}}else this.grid.dataSource=this.dataSource instanceof Ze.DataManager?new Ze.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor,this.hasPreAndPostMiddleware(this.dataSource)?this.dataSource:void 0):this.flatData;if(this.dataSource instanceof Ze.DataManager&&(this.dataSource.dataSource.offline||this.dataSource.ready)){this.grid.dataSource[""+e].json=dt(this.dataSource[""+e].json),this.grid.dataSource[""+i]=this.dataSource.ready;var o=this;(0,t.isNullOrUndefined)(this.grid.dataSource[""+i])||this.grid.dataSource[""+i].then(function(t){var i=o.grid.dataSource;i[""+e].offline=!0,i.isDataAvailable=!0,i[""+e].json=t.result,i.adaptor=new Ze.JsonAdaptor})}},i.prototype.extendedGridActionEvents=function(){var e=this;this.grid.actionBegin=function(i){if("sorting"===i.requestType&&i.target&&i.target.parentElement&&i.target.parentElement.classList.contains("e-hierarchycheckbox"))i.cancel=!0;else if("reorder"===(0,l.getObject)("requestType",i)&&e.notify("getColumnIndex",{}),et(e)&&e.enableVirtualization&&("virtualscroll"===i.requestType?(e.query.expand("VirtualScrollingAction"),e.showSpinner()):"searching"===i.requestType&&""===i.searchString?e.query.expand("ClearSearchingAction"):"clearFilter"===i.action&&e.query.expand("ClearFilteringAction")),e.notify("actionBegin",{editAction:i}),et(e)||(0,t.isNullOrUndefined)(e.filterModule)||tt(e)||0!==e.grid.filterSettings.columns.length||0!==e.grid.searchSettings.key.length||(e.notify("clearFilters",{flatData:e.grid.dataSource}),e.grid.setProperties({dataSource:e.dataResults.result},!0),(0,t.isNullOrUndefined)(e.grid.changedProperties.dataSource)&&(e.grid.renderModule.data.dataManager=e.grid.dataSource instanceof Ze.DataManager?e.grid.dataSource:(0,t.isNullOrUndefined)(e.grid.dataSource)?new Ze.DataManager:new Ze.DataManager(e.grid.dataSource),e.grid.renderModule.data.isQueryInvokedFromData=!0,e.grid.query=e.grid.query instanceof Ze.Query?e.grid.query:new Ze.Query)),"indenting"!==e.action&&"outdenting"!==e.action){var r=new Ze.Deferred;return e.trigger(E,i,function(t){t.cancel||e.notify(ie,t),r.resolve(t)}),r}},this.grid.actionComplete=function(t){if(e.notify("actioncomplete",t),e.updateColumnModel(),e.updateTreeGridModel(),"reorder"===t.requestType&&e.notify("setColumnIndex",{}),e.notify("actionComplete",{editAction:t}),"add"===t.requestType&&"Top"!==e.editSettings.newRowPosition&&"Bottom"!==e.editSettings.newRowPosition&&e.notify(re,t),"batchsave"===t.requestType&&e.notify(ge,t),e.notify("updateGridActions",t),"save"===t.requestType&&e.aggregates.map(function(e){return!0===e.showChildSummary}).length&&e.grid.refresh(),"filter"===t.action&&(t.isCollapseMaintain||""===e.filterModule.currentFilterObject||!e.enableVirtualization||e.initialRender||et(e)&&e.enableVirtualization||e.expandAll()),"searching"===t.requestType&&(t.isCollapseMaintain||""===e.searchSettings.key||!e.enableVirtualization||e.initialRender||et(e)&&e.enableVirtualization||e.expandAll()),"clearFilter"===t.action&&e.enableCollapseAll&&e.collapseAll(),"indenting"===e.action||"outdenting"===e.action){e.action="indenting"===e.action?"indented":"outdented";var i=[e.selectedRecords],r={data:i,dropIndex:e.dropIndex,dropPosition:e.dropPosition,modifiedRecords:e.modifiedRecords,requestType:e.action,row:e.selectedRows};e.trigger(U,r),e.getCurrentViewRecords().filter(function(e){return e.uniqueID===i[0].uniqueID}).length||e.refreshToolbarItems(),e.action="",e.selectedRecords=e.selectedRows=e.modifiedRecords=[]}else{if(e.grid.isFrozenGrid()&&e.enableVirtualization&&"movable"===t.tableName){var n=e.grid.element.querySelector("."+Be),o=e.grid.element.querySelector("."+Le);n.style.height=o.style.height="auto"}e.trigger(U,t)}}},i.prototype.extendedGridEvents=function(){var e=this,i=this;this.grid.recordDoubleClick=function(t){e.trigger(ne,t),e.notify(ne,t)},this.grid.detailDataBound=function(t){e.notify("detaildataBound",t),e.trigger(De,t)},this.grid.rowDataBound=function(e){(0,t.isNullOrUndefined)(this.isPrinting)?(0,t.setValue)("isPrinting",!1,e):(0,t.setValue)("isPrinting",this.isPrinting,e),i.renderModule.RowModifier(e)},this.grid.queryCellInfo=function(e){(0,t.isNullOrUndefined)(this.isPrinting)?(0,t.setValue)("isPrinting",!1,e):(0,t.setValue)("isPrinting",this.isPrinting,e),i.renderModule.cellRender(e)},this.grid.contextMenuClick=function(t){e.notify(X,t),e.trigger(X,t)},this.grid.contextMenuOpen=function(t){e.notify(J,t),e.trigger(J,t)},this.grid.queryCellInfo=function(t){e.renderModule.cellRender(t)}},i.prototype.bindGridDragEvents=function(){var e=this;this.grid.rowDragStartHelper=function(t){e.trigger(Oe,t)},this.grid.rowDragStart=function(t){e.trigger(Ae,t)},this.grid.rowDrag=function(t){e.grid.isEdit?t.cancel=!0:(e.notify(Ue,t),e.trigger(Me,t))},this.grid.rowDrop=function(t){e.grid.isEdit||e.notify(qe,t),t.cancel=!0}},i.prototype.loadGrid=function(){this.bindGridProperties(),this.bindGridEvents(),(0,t.setValue)("registeredTemplate",this.registeredTemplate,this.grid);(0,t.setValue)("viewContainerRef",this.viewContainerRef,this.grid)},i.prototype.autoGenerateColumns=function(){var e=this;if(!this.columns.length&&!this.dataModule.isRemote()&&Object.keys(this.dataSource).length){this.columns=[];var t=this.dataSource[0],i=Object.keys(t);this.columns=i.filter(function(t){return-1===[e.childMapping,e.parentIdMapping].indexOf(t)})}},i.prototype.getGridEditSettings=function(){var e={},t="guid";switch(e.allowAdding=this.editSettings.allowAdding,e.allowEditing=this.editSettings.allowEditing,e.allowDeleting=this.editSettings.allowDeleting,e.newRowPosition="Bottom"===this.editSettings.newRowPosition?"Bottom":"Top",e.allowEditOnDblClick=this.editSettings.allowEditOnDblClick,e.showConfirmDialog=this.editSettings.showConfirmDialog,e.template=this.editSettings.template,e.showDeleteConfirmDialog=this.editSettings.showDeleteConfirmDialog,e.allowNextRowEdit=this.editSettings.allowNextRowEdit,e[""+t]=this.editSettings[""+t],e.dialog=this.editSettings.dialog,this.editSettings.mode){case"Dialog":case"Batch":e.mode=this.editSettings.mode;break;case"Row":e.mode="Normal";break;case"Cell":e.mode="Normal",e.showConfirmDialog=!1}return e},i.prototype.getContextMenu=function(){if(this.contextMenuItems){for(var e=[],t=0;t<this.contextMenuItems.length;t++)switch(this.contextMenuItems[parseInt(t.toString(),10)]){case"AddRow":case ut.AddRow:e.push({text:this.l10n.getConstant("AddRow"),target:".e-content",id:this.element.id+"_gridcontrol_cmenu_AddRow",items:[{text:this.l10n.getConstant("Above"),id:"Above"},{text:this.l10n.getConstant("Below"),id:"Below"},{text:this.l10n.getConstant("Child"),id:"Child"}]});break;case"Indent":case ut.RowIndent:e.push({text:this.l10n.getConstant("RowIndent"),target:".e-content",iconCss:"e-indent e-icons",id:this.element.id+"_gridcontrol_cmenu_Indent"});break;case"Outdent":case ut.RowOutdent:e.push({text:this.l10n.getConstant("RowOutdent"),target:".e-content",iconCss:"e-outdent e-icons",id:this.element.id+"_gridcontrol_cmenu_Outdent"});break;default:e.push(this.contextMenuItems[parseInt(t.toString(),10)])}return e}return null},i.prototype.getGridToolbar=function(){if(this.toolbar){this.l10n=new t.L10n("treegrid",this.defaultLocale,this.locale);for(var e=[],i=void 0,r=0;r<this.toolbar.length;r++)switch(this.toolbar[parseInt(r.toString(),10)]){case"Search":case ct.Search:e.push("Search");break;case"Print":case ct.Print:e.push("Print");break;case"ExpandAll":case ct.ExpandAll:i=this.l10n.getConstant("ExpandAll"),e.push({text:i,tooltipText:i,prefixIcon:"e-expand",id:this.element.id+"_gridcontrol_expandall"});break;case"CollapseAll":case ct.CollapseAll:i=this.l10n.getConstant("CollapseAll"),e.push({text:i,tooltipText:i,prefixIcon:"e-collapse",id:this.element.id+"_gridcontrol_collapseall"});break;case"Indent":case ct.RowIndent:i=this.l10n.getConstant("RowIndent"),e.push({text:i,tooltipText:i,prefixIcon:"e-indent",id:this.element.id+"_gridcontrol_indent"});break;case"Outdent":case ct.RowOutdent:i=this.l10n.getConstant("RowOutdent"),e.push({text:i,tooltipText:i,prefixIcon:"e-outdent",id:this.element.id+"_gridcontrol_outdent"});break;default:e.push(this.toolbar[parseInt(r.toString(),10)])}return e}return null},i.prototype.getGridColumns=function(e,i,r){void 0===i&&(i=!0),void 0===r&&(r=0);var o,a,s=e;i&&(this.columnModel=[]),0===this.columnModel.length&&(r=0===r?-1:r);for(var d=[],l=0;l<s.length;l++){r+=1;var p=this.grid.getColumnByUid(s[parseInt(l.toString(),10)].uid);if(a=p||{},o={},"string"==typeof this.columns[parseInt(l.toString(),10)])a.field=o.field=this.columns[parseInt(l.toString(),10)];else for(var h=Object.keys(s[parseInt(l.toString(),10)]),c=0;c<h.length;c++){var u=h[parseInt(c.toString(),10)];r===this.treeColumnIndex&&"template"===u?o[""+u]=s[parseInt(l.toString(),10)][""+u]:"columns"!==u||(0,t.isNullOrUndefined)(s[parseInt(l.toString(),10)][""+u])?this.initialRender&&!(0,t.isNullOrUndefined)(p)&&this.enablePersistence&&"edit"===u?a[""+u]=o[""+u]=p[""+u]:p&&"sortComparer"===u||(a[""+u]=o[""+u]=s[parseInt(l.toString(),10)][""+u]):(a[""+u]=this.getGridColumns(s[parseInt(l.toString(),10)][""+u],!1,this.columnModel.length-1),o[""+u]=s[parseInt(l.toString(),10)][""+u])}o.columns||this.columnModel.push(new n(o)),d.push(a),!(0,t.isNullOrUndefined)(this.columnModel[this.treeColumnIndex])&&this.enableRtl&&a.field===this.columnModel[this.treeColumnIndex].field&&((0,t.isNullOrUndefined)(this.treeColumnTextAlign)&&(this.treeColumnTextAlign=this.columnModel[this.treeColumnIndex].textAlign,this.treeColumnField=this.columnModel[this.treeColumnIndex].field),a.textAlign="Right")}return d},i.prototype.lastRowCellBorderUpdated=function(){var e=this.getContentTable().querySelectorAll("tr.e-row"),t=Array.from(e).filter(function(e){return!e.classList.contains("e-childrow-hidden")});if(t.length>0){var i=t[t.length-1];this.lastRowBorder(i,!0)}},i.prototype.onPropertyChanged=function(e){var i=Object.keys(e),r=!1;i.indexOf("columns")>-1&&!(0,t.isNullOrUndefined)(e.columns)&&this.refreshColumns();for(var n=0,o=i;n<o.length;n++){var a=o[n];switch(a){case"treeColumnIndex":this.grid.refreshColumns();break;case"allowPaging":this.grid.allowPaging=this.allowPaging;break;case"pageSettings":this.grid.pageSettings=(0,l.getActualProperties)(this.pageSettings),r=!0;break;case"enableVirtualization":this.grid.enableVirtualization=this.enableVirtualization;break;case"enableColumnVirtualization":this.grid.enableColumnVirtualization=this.enableColumnVirtualization;break;case"toolbar":this.grid.toolbar=this.getGridToolbar();break;case"allowSelection":this.grid.allowSelection=this.allowSelection;break;case"selectionSettings":this.grid.selectionSettings=(0,l.getActualProperties)(this.selectionSettings);break;case"allowSorting":this.grid.allowSorting=this.allowSorting;break;case"allowMultiSorting":this.grid.allowMultiSorting=this.allowMultiSorting;break;case"sortSettings":this.grid.sortSettings=(0,l.getActualProperties)(this.sortSettings);break;case"searchSettings":this.grid.searchSettings=(0,l.getActualProperties)(this.searchSettings);break;case"allowFiltering":this.grid.allowFiltering=this.allowFiltering;break;case"filterSettings":this.initialRender||(this.grid.filterSettings=(0,l.getActualProperties)(this.filterSettings));break;case"showColumnMenu":this.grid.showColumnMenu=this.showColumnMenu;break;case"allowRowDragAndDrop":this.grid.allowRowDragAndDrop=this.allowRowDragAndDrop;break;case"aggregates":this.grid.aggregates=(0,l.getActualProperties)(this.aggregates);break;case"enableInfiniteScrolling":this.grid.enableInfiniteScrolling=this.enableInfiniteScrolling;break;case"dataSource":if(this.isLocalData=!(this.dataSource instanceof Ze.DataManager)||!(0,t.isNullOrUndefined)(this.dataSource.ready)||this.dataSource.adaptor instanceof Ze.RemoteSaveAdaptor,this.convertTreeData(this.dataSource),this.isLocalData){if(tt(this)){var s=(0,t.getValue)("count",this.dataSource);this.grid.dataSource={result:this.flatData,count:s}}else{var d=this.dataSource;this.grid.dataSource=d instanceof Ze.DataManager?new Ze.DataManager(d.dataSource,d.defaultQuery,d.adaptor):this.flatData}this.enableVirtualization&&(this.grid.contentModule.isDataSourceChanged=!0)}else this.bindedDataSource(),this.enableVirtualization&&(this.grid.contentModule.removeEventListener(),this.grid.contentModule.eventListener("on"),this.grid.contentModule.renderTable());break;case"query":this.grid.query=this.query;break;case"enableCollapseAll":e[""+a]?this.collapseAll():this.expandAll();break;case"expandStateMapping":this.grid.refresh();break;case"gridLines":this.grid.gridLines=this.gridLines;break;case"rowTemplate":this.grid.rowTemplate=(0,l.getActualProperties)(this.rowTemplate);break;case"frozenRows":this.grid.frozenRows=this.frozenRows;break;case"frozenColumns":this.grid.frozenColumns=this.frozenColumns;break;case"rowHeight":this.grid.rowHeight=this.rowHeight,this.refresh();break;case"height":(0,t.isNullOrUndefined)(this.height)||"string"!=typeof this.height||-1===this.height.indexOf("%")||(this.element.style.height=this.height),this.grid.height=this.height;break;case"width":(0,t.isNullOrUndefined)(this.width)||"string"!=typeof this.width||-1===this.width.indexOf("%")||(this.element.style.width=this.width),this.grid.width=this.width;break;case"locale":this.grid.locale=this.locale,this.TreeGridLocale(),this.grid.toolbar=this.getGridToolbar(),this.grid.contextMenuItems=this.getContextMenu();break;case"selectedRowIndex":this.grid.selectedRowIndex=this.selectedRowIndex;break;case"enableAltRow":this.grid.enableAltRow=this.enableAltRow;break;case"enableHover":this.grid.enableHover=this.enableHover;break;case"enableAutoFill":this.grid.enableAutoFill=this.enableAutoFill;break;case"columnChooserSettings":this.grid.columnChooserSettings=(0,l.getActualProperties)(this.columnChooserSettings);break;case"enableAdaptiveUI":this.grid.enableAdaptiveUI=this.enableAdaptiveUI;break;case"enableImmutableMode":this.grid.enableImmutableMode=this.enableImmutableMode;break;case"allowExcelExport":this.grid.allowExcelExport=this.allowExcelExport;break;case"allowPdfExport":this.grid.allowPdfExport=this.allowPdfExport;break;case"enableRtl":(0,t.isNullOrUndefined)(this.treeColumnField)||this.updateTreeColumnTextAlign(),this.grid.enableRtl=this.enableRtl;break;case"allowReordering":this.grid.allowReordering=this.allowReordering;break;case"allowResizing":this.grid.allowResizing=this.allowResizing;break;case"textWrapSettings":this.grid.textWrapSettings=(0,l.getActualProperties)(this.textWrapSettings);break;case"allowTextWrap":this.grid.allowTextWrap=(0,l.getActualProperties)(this.allowTextWrap),this.grid.refresh();break;case"contextMenuItems":this.grid.contextMenuItems=this.getContextMenu();break;case"showColumnChooser":this.grid.showColumnChooser=this.showColumnChooser;break;case"detailTemplate":this.grid.detailTemplate=(0,l.getActualProperties)(this.detailTemplate);break;case"columnMenuItems":this.grid.columnMenuItems=(0,l.getActualProperties)(this.columnMenuItems);break;case"enableStickyHeader":this.grid.enableStickyHeader=this.enableStickyHeader;break;case"emptyRecordTemplate":this.grid.emptyRecordTemplate=this.emptyRecordTemplate;break;case"isRowSelectable":this.grid.isRowSelectable=this.isRowSelectable;break;case"editSettings":this.grid.isEdit&&"Normal"===this.grid.editSettings.mode&&e[""+a].mode&&("Cell"===e[""+a].mode||"Row"===e[""+a].mode)&&this.grid.closeEdit(),this.grid.editSettings=this.getGridEditSettings()}r&&this.grid.refresh()}},i.prototype.updateTreeColumnTextAlign=function(){this.grid.getColumnByField(this.treeColumnField).textAlign=this.enableRtl?"Right":this.treeColumnTextAlign,this.grid.refreshColumns()},i.prototype.destroy=function(){var t=this.element;if(t){var i=!(!t.querySelector(".e-gridheader")||!t.querySelector(".e-gridcontent"));i&&this.unwireEvents(),this.removeListener(),i&&e.prototype.destroy.call(this),this.grid&&this.grid.destroy(),this.dataModule&&this.dataModule.destroy();for(var r=["dataModule","sortModule","renderModule","filterModule","printModule","clipboardModule","excelExportModule","pdfExportModule","toolbarModule","summaryModule","reorderModule","resizeModule","pagerModule","keyboardModule","columnMenuModule","contextMenuModule","editModule","virtualScrollModule","selectionModule","detailRow","rowDragAndDropModule","freezeModule"],n=0;n<r.length;n++)this[r[parseInt(n.toString(),10)]]&&(this[r[parseInt(n.toString(),10)]]=null);this.element.innerHTML="",this.grid=null}},i.prototype.dataBind=function(){(0,t.isNullOrUndefined)(this.grid)||(!(0,t.isNullOrUndefined)(this.rowDropSettings.targetID)&&(0,t.isNullOrUndefined)(document.getElementById(this.grid.rowDropSettings.targetID))&&(document.getElementById(this.rowDropSettings.targetID).id=this.grid.rowDropSettings.targetID,this.rowDropSettings.targetID=this.grid.rowDropSettings.targetID),e.prototype.dataBind.call(this),this.grid.dataBind())},i.prototype.getPersistData=function(){for(var e=["pageSettings","sortSettings","filterSettings","columns","searchSettings","selectedRowIndex","treeColumnIndex","scrollPosition"],i={pageSettings:["template","pageSizes","pageSizeMode","enableQueryString","totalRecordsCount","pageCount"],filterSettings:["type","mode","showFilterBarStatus","immediateModeDelay","ignoreAccent","hierarchyMode"],searchSettings:["fields","operator","ignoreCase"],sortSettings:[],columns:[],selectedRowIndex:[],scrollPosition:[]},r=0;r<e.length;r++)for(var n=this[e[parseInt(r.toString(),10)]],o=0,a=i[e[parseInt(r.toString(),10)]];!(0,t.isNullOrUndefined)(a)&&o<a.length;o++){delete n[""+a[parseInt(o.toString(),10)]]}return this.ignoreInArrays(["filter","edit","filterBarTemplate","headerTemplate","template","commandTemplate","commands","dataSource"],this.columns),this.addOnPersist(e)},i.prototype.ignoreInArrays=function(e,t){for(var i=0;i<t.length;i++)t[parseInt(i.toString(),10)].columns?(this.ignoreInColumn(e,t[parseInt(i.toString(),10)]),this.ignoreInArrays(e,t[parseInt(i.toString(),10)].columns)):this.ignoreInColumn(e,t[parseInt(i.toString(),10)])},i.prototype.ignoreInColumn=function(e,i){if((0,t.isNullOrUndefined)(i.template))for(var r=0;r<e.length;r++)delete i[e[parseInt(r.toString(),10)]],i.filter={}},i.prototype.mouseClickHandler=function(e){var i=this;if((0,t.isNullOrUndefined)(e.touches)){var r=e.target;!r.classList.contains("e-treegridexpand")&&!r.classList.contains("e-treegridcollapse")||this.isEditCollapse||this.grid.isEdit||this.expandCollapseRequest(r);if((r.classList.contains("e-treegridexpand")||r.classList.contains("e-treegridcollapse"))&&this.grid.isEllipsisTooltip()&&this.grid.toolTipObj.close(),this.isEditCollapse=!1,this.notify("checkboxSelection",{target:r}),this.grid.isCheckBoxSelection&&!this.grid.isPersistSelection&&this.aggregates.map(function(e){return!0===e.showChildSummary}).length){var n=this.grid.getHeaderContent().querySelector(".e-checkselectall"),o=this.grid.getSelectedRowIndexes().length,a=this.getCurrentViewRecords().length;if(a>0&&o===a){var s=n.nextElementSibling;(0,t.removeClass)([s],["e-stop","e-uncheck"]),(0,t.addClass)([s],["e-check"])}}if((r.classList.contains("e-flmenu-cancelbtn")||r.classList.contains("e-flmenu-okbtn")||r.classList.contains("e-content")||r.classList.contains("e-rowcell"))&&!(0,t.isNullOrUndefined)(this.grid.filterModule)&&this.isReact&&!(0,t.isNullOrUndefined)(this.grid.filterModule.column)&&this.grid.filterModule.column.filterTemplate){var d=document.getElementById(this.grid.filterModule.filterModule.dlgObj.element.id);this.grid.filterModule.fltrDlgDetails.isOpen=!1,this.grid.filterModule.filterModule.dlgObj&&!this.grid.filterModule.filterModule.dlgObj.isDestroyed&&d&&this.clearTemplate(["filterTemplate"],void 0,function(){i.grid.filterModule.filterModule.dlgObj.destroy()})}}},i.prototype.getRows=function(){return this.grid.getRows()},i.prototype.getPager=function(){return this.grid.getPager()},i.prototype.addRecord=function(e,t,i){if(this.editModule){this.editModule.isAddedRowByMethod=!0,this.editModule.addRecord(e,t,i)}},i.prototype.closeEdit=function(){this.grid.editModule&&this.editModule.closeEdit()},i.prototype.saveCell=function(){this.grid.editModule&&this.grid.editModule.saveCell()},i.prototype.updateCell=function(e,t,i){this.grid.editModule&&this.grid.editModule.updateCell(e,t,i)},i.prototype.updateRow=function(e,i){if(this.grid.editModule)if((0,t.isNullOrUndefined)(e))this.grid.editModule.updateRow(e,i);else{var r=this.grid.getCurrentViewRecords()[parseInt(e.toString(),10)];(0,t.extend)(r,i),this.grid.editModule.updateRow(e,r)}},i.prototype.deleteRecord=function(e,i){if((0,t.isNullOrUndefined)(e)&&(0,t.isNullOrUndefined)(i)||this.getSelectedRecords().length<=0){this.trigger(Ye,{error:"The provided value for the fieldName and data is undefined. Please ensure the fieldName and data contains number."})}this.grid.editModule&&this.grid.editModule.deleteRecord(e,i)},i.prototype.startEdit=function(e){this.grid.editModule&&this.grid.editModule.startEdit(e)},i.prototype.editCell=function(e,t){this.editModule&&this.editModule.editCell(e,t)},i.prototype.enableToolbarItems=function(e,t){this.grid.toolbarModule&&this.grid.toolbarModule.enableItems(e,t)},i.prototype.endEdit=function(){this.grid.editModule&&this.grid.editModule.endEdit()},i.prototype.openColumnChooser=function(e,t){this.columnChooserModule&&this.columnChooserModule.openColumnChooser(e,t)},i.prototype.deleteRow=function(e){this.grid.editModule&&this.grid.editModule.deleteRow(e)},i.prototype.getPrimaryKeyFieldNames=function(){return this.grid.getPrimaryKeyFieldNames()},i.prototype.setCellValue=function(e,t,i){this.grid.setCellValue(e,t,i);var r=this.grid.getRowIndexByPrimaryKey(e),n=this.getCurrentViewRecords()[parseInt(r.toString(),10)];zt({value:n,action:"edit"},this,this.isSelfReference,n.index,this.grid.selectedRowIndex,t)},i.prototype.setRowData=function(e,t){var i,r=this.getCurrentViewRecords(),n=this.grid.getPrimaryKeyFieldNames()[0],o={};r.some(function(t){return t[""+n]===e&&(o=t,!0)}),i=o.level,t.level=i,t.index=o.index,t.childRecords=o.childRecords,t.taskData=o.taskData,t.uniqueID=o.uniqueID,t.parentItem=o.parentItem,t.checkboxState=o.checkboxState,t.hasChildRecords=o.hasChildRecords,t.parentUniqueID=o.parentUniqueID,t.expanded=o.expanded,this.grid.setRowData(e,t);var a=this.getVisibleRecords();if(a.length>0&&e===a[a.length-1][""+n]){var s=this.getContentTable().scrollHeight,d=this.getContent().clientHeight;this.lastRowBorder(this.getRows()[r.indexOf(o)],s<=d)}},i.prototype.goToPage=function(e){this.grid.pagerModule&&this.grid.pagerModule.goToPage(e)},i.prototype.updateExternalMessage=function(e){this.pagerModule&&this.grid.pagerModule.updateExternalMessage(e)},i.prototype.getCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},i.prototype.getColumnByField=function(e){return(0,l.iterateArrayOrObject)(this.columnModel,function(t){if(t.field===e)return t})[0]},i.prototype.getColumnByUid=function(e){var t=this.initialRender?this.grid.columns:this.columns;return this.grid.columns.length!==this.columnModel.length&&(t=this.grid.columnModel),(0,l.iterateArrayOrObject)(t,function(t){if(t.uid===e)return t})[0]},i.prototype.getColumnFieldNames=function(){return this.grid.getColumnFieldNames()},i.prototype.getFooterContent=function(){return this.grid.getFooterContent()},i.prototype.getFooterContentTable=function(){return this.grid.getFooterContentTable()},i.prototype.showColumns=function(e,t){this.grid.showColumns(e,t),this.updateColumnModel()},i.prototype.hideColumns=function(e,t){this.grid.hideColumns(e,t),this.updateColumnModel()},i.prototype.getColumnHeaderByField=function(e){return this.grid.getColumnHeaderByField(e)},i.prototype.getColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},i.prototype.getColumnHeaderByUid=function(e){return this.grid.getColumnHeaderByUid(e)},i.prototype.getColumnIndexByField=function(e){return this.grid.getColumnIndexByField(e)},i.prototype.getVirtualColIndexByUid=function(e){var i=(0,l.iterateArrayOrObject)(this.grid.columnModel,function(t,i){if(t.uid===e)return i})[0];return(0,t.isNullOrUndefined)(i)?-1:i},i.prototype.getColumnIndexByUid=function(e){return this.grid.getColumnIndexByUid(e)},i.prototype.getColumns=function(e){return this.updateColumnModel(this.grid.getColumns(e)),this.columnModel},i.prototype.updateColumnModel=function(e){var i,r,o,a=(0,t.isNullOrUndefined)(e)?this.grid.getColumns():e;if(-1!==this.treeColumnIndex&&this.columnModel[this.treeColumnIndex]&&!(0,t.isNullOrUndefined)(this.columnModel[this.treeColumnIndex].template)&&(i=this.columnModel[this.treeColumnIndex].template,r=this.columnModel[this.treeColumnIndex].field),!this.enableColumnVirtualization||this.enableColumnVirtualization&&this.columnModel.length===a.length){this.columnModel=[];for(var s=0;s<a.length;s++){o={};for(var d=0,l=Object.keys(a[parseInt(s.toString(),10)]);d<l.length;d++){var p=l[d];o[""+p]=a[parseInt(s.toString(),10)][""+p]}this.columnModel.push(new n(o)),r!==this.columnModel[parseInt(s.toString(),10)].field||"checkbox"===this.columnModel[parseInt(s.toString(),10)].type||(0,t.isNullOrUndefined)(i)||""===i||(this.columnModel[parseInt(s.toString(),10)].template=i)}}var h="deepMerge";if(this[""+h]=["columns"],this.grid.columns.length!==this.columnModel.length&&(this.stackedHeader=!0),this.stackedHeader&&!(0,t.isNullOrUndefined)(this.detailTemplate)){this.trigger(Ye,{error:"Stacked header is not compatible with the detail template"})}return this.stackedHeader&&this.allowResizing&&!(0,t.isNullOrUndefined)(this.columns)&&this.updateColumnsWidth(this.columns),this.stackedHeader||(0,t.isNullOrUndefined)(this.columns)||(0,t.merge)(this.columns,this.columnModel),this[""+h]=void 0,this.columnModel},i.prototype.updateColumnsWidth=function(e){var i=this;e.forEach(function(e){if(!(0,t.isNullOrUndefined)(e)&&e.columns)i.updateColumnsWidth(e.columns);else if(!(0,t.isNullOrUndefined)(e)&&e.field){var r=i.grid.getColumnByField(e.field);(0,t.isNullOrUndefined)(r)||(e.width=r.width)}})},i.prototype.getContent=function(){return this.grid.getContent()},i.prototype.mergePersistTreeGridData=function(){this.grid.mergePersistGridData.apply(this)},i.prototype.mergeColumns=function(e,t){this.grid.mergeColumns.apply(this,[e,t])},i.prototype.setFrozenCount=function(){this.grid.setFrozenCount.apply(this)},i.prototype.splitFrozenCount=function(e){var t=this.frozenColumns>0?this.grid:this;this.grid.splitFrozenCount.apply(t,[e])},i.prototype.removeBorder=function(e){this.grid.removeBorder.apply(this.grid,[e])},i.prototype.frozenLeftBorderColumns=function(e){this.grid.frozenLeftBorderColumns.apply(this.grid,[e])},i.prototype.frozenRightBorderColumns=function(e){this.grid.frozenRightBorderColumns.apply(this.grid,[e])},i.prototype.isFrozenGrid=function(){var e=Array.isArray(this.columns)&&this.columns.some(function(e){return!!e.freeze});return this.frozenColumns>0||this.frozenRows>0||this.getFrozenColumns()>0||e},i.prototype.updateTreeGridModel=function(){this.setProperties({filterSettings:(0,l.getObject)("properties",this.grid.filterSettings)},!0),this.setProperties({pageSettings:(0,l.getObject)("properties",this.grid.pageSettings)},!0),this.setProperties({searchSettings:(0,l.getObject)("properties",this.grid.searchSettings)},!0),this.setProperties({sortSettings:(0,l.getObject)("properties",this.grid.sortSettings)},!0)},i.prototype.hasPreAndPostMiddleware=function(e){return e&&"function"==typeof e.applyPreRequestMiddlewares&&"function"==typeof e.applyPostRequestMiddlewares},i.prototype.getContentTable=function(){return this.grid.getContentTable()},i.prototype.getDataRows=function(){for(var e=[],t=this.grid.getDataRows(),i=0,r=t.length;i<r;i++)t[parseInt(i.toString(),10)].classList.contains("e-summaryrow")||e.push(t[parseInt(i.toString(),10)]);return e},i.prototype.getCurrentViewRecords=function(){return this.grid.currentViewData.filter(function(e){return(0,t.isNullOrUndefined)(e.isSummaryRow)})},i.prototype.getBatchChanges=function(){return this.grid.editModule.getBatchChanges()},i.prototype.getHeaderContent=function(){return this.grid.getHeaderContent()},i.prototype.getHeaderTable=function(){return this.grid.getHeaderTable()},i.prototype.getRowByIndex=function(e){return this.grid.getRowByIndex(e)},i.prototype.getRowInfo=function(e){return this.grid.getRowInfo(e)},i.prototype.getUidByColumnField=function(e){return this.grid.getUidByColumnField(e)},i.prototype.getVisibleColumns=function(){return this.columnModel.filter(function(e){return e.visible})},i.prototype.showSpinner=function(){(0,Rt.showSpinner)(this.element)},i.prototype.hideSpinner=function(){(0,Rt.hideSpinner)(this.element)},i.prototype.refresh=function(){this.uniqueIDCollection={},this.convertTreeData(this.dataSource),tt(this)||(this.dataSource instanceof Ze.DataManager?this.grid.setProperties({dataSource:new Ze.DataManager(this.dataSource.dataSource,this.dataSource.defaultQuery,this.dataSource.adaptor,this.hasPreAndPostMiddleware(this.dataSource)?this.dataSource:void 0)},!0):this.grid.dataSource=this.flatData),this.grid.refresh()},i.prototype.getCheckedRecords=function(){return this.selectionModule.getCheckedrecords()},i.prototype.getVisibleRecords=function(){var e=[],t=this.getCurrentViewRecords();if(this.allowPaging)e=t;else for(var i=0;i<t.length;i++)e.push(t[parseInt(i.toString(),10)]),t[parseInt(i.toString(),10)].expanded||(i+=at(t[parseInt(i.toString(),10)]).length);return e},i.prototype.getCheckedRowIndexes=function(){return this.selectionModule.getCheckedRowIndexes()},i.prototype.selectCheckboxes=function(e){this.selectionModule.selectCheckboxes(e)},i.prototype.refreshColumns=function(e){(0,t.isNullOrUndefined)(e)||e?(this.grid.columns=this.getGridColumns(this.columns),this.getTreeColumn(),this.grid.refreshColumns()):this.grid.setProperties({columns:this.getGridColumns(this.columns)},!0)},i.prototype.getTreeColumn=function(){var e=this.columnModel[this.treeColumnIndex],i=this.getColumns(),r=(0,l.getObject)("field",e),n=i.findIndex(function(e){return(0,l.getObject)("field",e)===r});(0,t.isNullOrUndefined)(n)||this.setProperties({treeColumnIndex:n},!0)},i.prototype.refreshHeader=function(){this.grid.refreshHeader()},i.prototype.expandCollapseRequest=function(e){if("Batch"===this.editSettings.mode){if((this.getBatchChanges()[this.changedRecords].length||this.getBatchChanges()[this.deletedRecords].length||this.getBatchChanges()[this.addedRecords].length)&&this.editSettings.showConfirmDialog){var t=this.grid.editModule.dialogObj;return this.grid.editModule.showDialog("CancelEdit",t),void(this.targetElement=e)}}if(this.rowTemplate){var i=e.closest(".e-treerowcell").parentElement,r=this.getCurrentViewRecords()[i.rowIndex];e.classList.contains("e-treegridexpand")?this.collapseRow(i,r):this.expandRow(i,r)}else{var n=this.grid.getRowInfo(e);r=n.rowData;if(this.grid.isFrozenGrid()&&this.enableVirtualization&&!Object.keys(r).length){r=this.grid.contentModule.freezeRows.filter(function(e){return e.uid===n.row.getAttribute("data-uid")})[0].data}this.enableImmutableMode&&(r=this.getCurrentViewRecords()[n.rowIndex]),e.classList.contains("e-treegridexpand")?this.collapseRow(n.row,r):this.expandRow(n.row,r)}},i.prototype.expandRow=function(e,i,r,n){var o=this;this.isCollapseAll=!1;var a=this.parentData;if(this.enableVirtualization||(a=this.flatData.filter(function(e){return e.hasChildRecords})),i=this.getCollapseExpandRecords(e,i),!(0,t.isNullOrUndefined)(e)||!(0,t.isNullOrUndefined)(i))if(!(0,t.isNullOrUndefined)(e)&&e.cells&&e.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(e,!1),this.isExpandAll&&!et(this)){var s={data:a,row:e,cancel:!1},d=!1;this.grid.pagerModule&&!(0,t.isNullOrUndefined)(this.grid.pagerModule.pagerObj.pagerdropdownModule)&&(d=!!this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value),this.isExpandingEventTriggered?(!this.allowPaging||d&&"All"===this.grid.pagerModule.pagerObj.pagerdropdownModule.dropDownListObject.value)&&!this.expandAllPrevent&&this.isExpandingEventTriggered&&this.expandRows(e,i,a):this.trigger(_,s,function(s){o.expandAllPrevent=s.cancel,s.cancel||(0,t.isNullOrUndefined)(i)||(s.expandAll&&o.expandCollapseAllChildren(i,"expand",r,n),o.expandRows(e,i,a))}),this.isExpandingEventTriggered=!0}else if(!this.isExpandAll||this.isExpandAll&&et(this)){s={data:i,row:e,cancel:!1};this.trigger(_,s,function(t){t.cancel||(t.expandAll&&o.expandCollapseAllChildren(i,"expand",r,n),o.expandRows(e,i,a))})}},i.prototype.expandRows=function(e,i,r){this.expandCollapse("expand",e,i);if((!et(this)||st(this))&&(!tt(this)||!(0,t.isNullOrUndefined)(i.Children))){var n={data:i,row:e};(0,t.isNullOrUndefined)(this.expandStateMapping)||this.updateExpandStateMapping(n.data,!0),this.isExpandAll&&!this.isExpandedEventTriggered?(this.isExpandedEventTriggered=!0,n={data:r,row:e},this.trigger(j,n)):!this.isExpandAll&&this.enableVirtualization&&this.selectionSettings.persistSelection&&!(0,t.isNullOrUndefined)(this.virtualScrollModule.prevSelectedRecord)?this.virtualScrollModule.prevSelectedRecord=[]:this.isExpandAll||this.trigger(j,n)}},i.prototype.expandCollapseAllChildren=function(e,i,r,n){if(((0,t.isNullOrUndefined)(r)||e[this.getPrimaryKeyFieldNames()[0]]===r)&&((0,t.isNullOrUndefined)(n)||n===e.level)){var o=at(e).filter(function(e){return e.hasChildRecords});o.unshift(e);for(var a=0;a<o.length;a++)this.expandCollapse(i,null,o[parseInt(a.toString(),10)])}},i.prototype.getCollapseExpandRecords=function(e,i){return this.allowPaging&&"All"===this.pageSettings.pageSizeMode&&this.isExpandAll&&(0,t.isNullOrUndefined)(i)&&!et(this)?i=this.flatData.filter(function(e){return e.hasChildRecords}):(0,t.isNullOrUndefined)(i)&&!(0,t.isNullOrUndefined)(e)&&(i=this.detailTemplate?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]:this.enableVirtualization&&(this.isCollapseAll||this.isExpandAll)?-1===e.rowIndex?this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]:this.grid.getCurrentViewRecords()[e.rowIndex]:this.rowTemplate?this.grid.getCurrentViewRecords()[e.rowIndex]:this.grid.getCurrentViewRecords()[parseInt(e.getAttribute("aria-rowindex"),10)-1]),i},i.prototype.collapseRow=function(e,i,r){var n=this;this.isExpandAll=!1;var o=this.parentData;if(this.enableVirtualization||(o=this.flatData.filter(function(e){return e.hasChildRecords})),i=this.getCollapseExpandRecords(e,i),!(0,t.isNullOrUndefined)(e)||!(0,t.isNullOrUndefined)(i))if(this.isCollapseAll&&!et(this)){var a={data:o,row:e,cancel:!1};this.isCollapsingEventTriggered?this.allowPaging||this.collapseAllPrevent||!this.isCollapsingEventTriggered||this.collapseRows(e,i,o):this.trigger(G,a,function(t){n.collapseAllPrevent=t.cancel,t.cancel||(t.collapseAll&&n.expandCollapseAllChildren(i,"collapse",r),n.collapseRows(e,i,o))}),this.isCollapsingEventTriggered=!0}else if(!this.isCollapseAll||this.isCollapseAll&&et(this)){a={data:i,row:e,cancel:!1};this.trigger(G,a,function(t){t.cancel||n.collapseRows(e,i,o)})}},i.prototype.collapseRows=function(e,i,r){this.expandCollapse("collapse",e,i);var n={data:i,row:e};et(this)||((0,t.isNullOrUndefined)(this.expandStateMapping)||this.updateExpandStateMapping(n.data,!1),this.isCollapseAll&&!this.isCollapsedEventTriggered?(this.isCollapsedEventTriggered=!0,n={data:r,row:e},this.trigger(H,n)):this.isCollapseAll||this.trigger(H,n),this.enableInfiniteScrolling&&this.grid.getContent().firstElementChild.scrollHeight-this.grid.getContent().firstElementChild.scrollTop<this.grid.getRowHeight()+ +this.height&&this.grid.getContent().firstElementChild.scrollBy(0,this.grid.getRowHeight()))},i.prototype.updateExpandStateMapping=function(e,t){var i=e;if(i.length)for(var r=0;r<i.length;r++)i[parseInt(r.toString(),10)][this.expandStateMapping]=t,zt({value:i[parseInt(r.toString(),10)],action:"edit"},this,this.isSelfReference,i[parseInt(r.toString(),10)].index,this.grid.selectedRowIndex,this.expandStateMapping);else e[""+this.expandStateMapping]=t,zt({value:e,action:"edit"},this,this.isSelfReference,e.index,this.grid.selectedRowIndex,this.expandStateMapping)},i.prototype.expandAtLevel=function(e){if((this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!et(this)){var t=this.grid.dataSource.filter(function(t){return t.hasChildRecords&&t.level===e&&(t.expanded=!0),t.hasChildRecords&&t.level===e});this.expandAction(t,null,e,!0)}else{t=this.getRecordDetails(e);var i=(0,l.getObject)("records",t);this.expandAction(i,null,e)}},i.prototype.expandByKey=function(e){this.expandCollapseActionByKey(e,"Expand")},i.prototype.expandAction=function(e,i,r,n){void 0===n&&(n=!1);for(var o=function(o){if(!(0,t.isNullOrUndefined)(e[parseInt(o.toString(),10)].parentItem)){var s=e[parseInt(o.toString(),10)].parentItem.uniqueID,d=a.flatData.filter(function(e){return e.uniqueID===s});et(a)&&(d=a.getCurrentViewRecords().filter(function(e){return e.uniqueID===s})),!1===d[0].expanded?(e.push(d[0]),d[0].expanded=!0):ot(a,d[0],a.parentData)||d[0].expanded&&void 0!==d[0].parentItem&&e.push(d[0])}n||a.expandRow(null,e[parseInt(o.toString(),10)],i,r)},a=this,s=0;s<e.length;s++)o(s);n&&this.expandRow(null,e,i,r)},i.prototype.getRecordDetails=function(e){var t=this.getRows().filter(function(t){return-1!==t.className.indexOf("level"+e)&&(t.querySelector(".e-treegridcollapse")||t.querySelector(".e-treegridexpand"))});return{records:this.getCurrentViewRecords().filter(function(t){return t.level===e&&t.hasChildRecords}),rows:t}},i.prototype.collapseAtLevel=function(e){if((this.allowPaging&&"All"===this.pageSettings.pageSizeMode||this.enableVirtualization)&&!et(this)){var t=this.grid.dataSource.filter(function(t){return t.hasChildRecords&&t.level===e&&(t.expanded=!1),t.hasChildRecords&&t.level===e});this.collapseAction(t,null,!0)}else{var i=this.getRecordDetails(e),r=(0,l.getObject)("records",i);this.collapseAction(r)}},i.prototype.collapseByKey=function(e){this.expandCollapseActionByKey(e,"Collapse")},i.prototype.expandCollapseActionByKey=function(e,i){var r=this.getPrimaryKeyFieldNames()[0],n=et(this)?this.getCurrentViewRecords():this.grid.dataSource;if(!(0,t.isNullOrUndefined)(r)){var o=n.filter(function(t){return t[""+r].toString()===e.toString()});"Expand"===i?this.expandAction(o,e,null):this.collapseAction(o,e)}},i.prototype.collapseAction=function(e,t,i){if(void 0===i&&(i=!1),i)this.collapseRow(null,e);else for(var r=0;r<e.length;r++)this.collapseRow(null,e[parseInt(r.toString(),10)],t);if(!this.grid.contentModule.isDataSourceChanged&&this.enableVirtualization&&this.getRows()&&this.parentData.length===this.getRows().length){this.grid.contentModule.startIndex=-1,this.grid.contentModule.endIndex=-1}},i.prototype.expandAll=function(){if(0===this.getCurrentViewRecords().length){this.trigger(Ye,{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."})}if(this.isExpandedEventTriggered=!1,this.isExpandingEventTriggered=!1,"Batch"===this.editSettings.mode){var e=this.getBatchChanges?this.getBatchChanges():{},t=Array.isArray(e.changedRecords)?e.changedRecords:[],i=Array.isArray(e.deletedRecords)?e.deletedRecords:[],r=Array.isArray(e.addedRecords)?e.addedRecords:[];if((t.length>0||i.length>0||r.length>0)&&this.editSettings.showConfirmDialog){var n=this.grid.editModule.dialogObj;return void this.grid.editModule.showDialog("CancelEdit",n)}}this.expandCollapseAll("expand")},i.prototype.collapseAll=function(){if(0===this.getCurrentViewRecords().length){this.trigger(Ye,{error:"The provided value for the datasource is undefined. Please ensure to add the dataSource."})}if(this.isCollapsedEventTriggered=!1,this.isCollapsingEventTriggered=!1,"Batch"===this.editSettings.mode){var e=this.getBatchChanges?this.getBatchChanges():{},t=Array.isArray(e.changedRecords)?e.changedRecords:[],i=Array.isArray(e.deletedRecords)?e.deletedRecords:[],r=Array.isArray(e.addedRecords)?e.addedRecords:[];if((t.length>0||i.length>0||r.length>0)&&this.editSettings.showConfirmDialog){var n=this.grid.editModule.dialogObj;return void this.grid.editModule.showDialog("CancelEdit",n)}}this.expandCollapseAll("collapse")},i.prototype.expandCollapseAll=function(e){var i;if(!(i=this.rowTemplate?[].slice.call(this.grid.getContentTable().querySelectorAll("tr")).filter(function(t){return t.querySelector(".e-treegrid"+("expand"===e?"collapse":"expand"))}):this.getRows().filter(function(t){return t.querySelector(".e-treegrid"+("expand"===e?"collapse":"expand"))})).length&&this.getRows().length&&i.push(this.getRows()[0]),this.isExpandAll=!0,this.isCollapseAll=!0,(this.allowPaging&&("All"===this.pageSettings.pageSizeMode||"Root"===this.pageSettings.pageSizeMode)||this.enableVirtualization||this.enableInfiniteScrolling)&&!et(this)){if(this.flatData.filter(function(t){t.hasChildRecords&&(t.expanded="collapse"!==e)}),i.length)for(var r=0;r<i.length;r++)"collapse"===e?(0,t.isNullOrUndefined)(this.getCurrentViewRecords()[i[parseInt(r.toString(),10)].rowIndex])||this.collapseRow(i[parseInt(r.toString(),10)]):this.enableVirtualization?"true"!==i[0].getAttribute("aria-expanded")&&this.expandRow(i[0]):this.expandRow(i[parseInt(r.toString(),10)]);else if(this.allowPaging){var n=this.enableCollapseAll;this.setProperties({enableCollapseAll:!0},!0),this.grid.pagerModule.goToPage(1),this.setProperties({enableCollapseAll:n},!0)}}else for(r=0;r<i.length;r++)"collapse"===e?this.collapseRow(i[parseInt(r.toString(),10)]):this.expandRow(i[parseInt(r.toString(),10)]);this.isExpandAll=!1,this.isCollapseAll=!1},i.prototype.expandCollapse=function(e,i,r,n){var o,a=this,s={row:i,data:r,childData:[],requestType:e},d=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===r.uniqueID});(!et(this)&&"expand"===e&&this.isSelfReference&&tt(this)&&!d.length||"collapse"===e||this.isExpandAll&&!this.loadChildOnDemand&&!et(this)&&this.isSelfReference&&tt(this))&&this.updateChildOnDemand(s);var l,p=this.getRows();if(this.rowTemplate){var h=this.getContentTable().rows;p=[].slice.call(h)}if((0,t.isNullOrUndefined)(i)?(l=this.grid.currentViewData.indexOf(r),i=p[parseInt(l.toString(),10)]):l=+i.getAttribute("aria-rowindex")-1,(0,t.isNullOrUndefined)(i)||i.setAttribute("aria-expanded","expand"===e?"true":"false"),(!this.allowPaging||"All"!==this.pageSettings.pageSizeMode&&"Root"!==this.pageSettings.pageSizeMode)&&!this.enableVirtualization||et(this)||tt(this)){var c=void 0;if("expand"===e){if(c="e-childrow-visible",n||(r.expanded=!0,this.flatData.forEach(function(e){e.expanded=e.uniqueID===r.uniqueID&&e.expanded!==r.expanded?r.expanded:e.expanded}),this.uniqueIDCollection[r.uniqueID].expanded=r.expanded),(0,t.isNullOrUndefined)(i)||(o=i.getElementsByClassName("e-treegridcollapse")[0]),n&&!(0,t.isNullOrUndefined)(r[this.expandStateMapping])&&r[this.expandStateMapping]&&(0,t.isNullOrUndefined)(o)&&(o=i.getElementsByClassName("e-treegridexpand")[0]),(0,t.isNullOrUndefined)(o))return;o.classList.contains("e-treegridexpand")||(0,t.addClass)([o],"e-treegridexpand"),(0,t.removeClass)([o],"e-treegridcollapse")}else{if(c="e-childrow-hidden",n&&!tt(this)||(r.expanded=!1,this.flatData.forEach(function(e){e.expanded=e.uniqueID===r.uniqueID&&e.expanded!==r.expanded?r.expanded:e.expanded}),this.uniqueIDCollection[r.uniqueID].expanded=r.expanded),(0,t.isNullOrUndefined)(i)||(o=i.getElementsByClassName("e-treegridexpand")[0]),n&&!(0,t.isNullOrUndefined)(r[this.expandStateMapping])&&!r[this.expandStateMapping]&&(0,t.isNullOrUndefined)(o)&&(o=i.getElementsByClassName("e-treegridcollapse")[0]),(0,t.isNullOrUndefined)(o))return;o.classList.contains("e-treegridcollapse")||(0,t.addClass)([o],"e-treegridcollapse"),(0,t.removeClass)([o],"e-treegridexpand")}i.querySelectorAll(".e-treerowcell")[0].setAttribute("aria-expanded","expand"===e?"true":"false");var u=p.filter(function(e){return e.classList.contains("e-griddetailrowindex"+r.index+"level"+(r.level+1))});if(et(this)&&!st(this))this.remoteExpand(e,i,r);else{tt(this)&&!d.length&&"collapse"!==e||this.localExpand(e,i,r);var g=this.getVisibleRecords()[this.getVisibleRecords().length-1].index,f=this.getRowByIndex(g);this.grid.getContentTable().clientHeight<=this.grid.getContent().clientHeight&&!(0,t.isNullOrUndefined)(f)&&!f.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(f,!0)}if(tt(this)&&"expand"===e){var y=this.getCurrentViewRecords().filter(function(e){return ot(a,e,a.parentData)});this.dataResults.result=y}if(!(0,t.isNullOrUndefined)(o)&&o.closest(".e-treerowcell").classList.contains("e-cellselectionbackground")&&(o.closest(".e-treerowcell").classList.remove("e-cellselectionbackground"),o.closest(".e-treerowcell").removeAttribute("aria-selected")),this.isPixelHeight()&&!i.cells[0].classList.contains("e-lastrowcell"))for(var m=this.getRows(),S=(h=this.getContentTable().rows,(m=[].slice.call(h)).length-1);S>=0;S--)if(!ht(m[parseInt(S.toString(),10)])){var v=this.getContentTable().scrollHeight,w=this.getContent().clientHeight;this.lastRowBorder(m[parseInt(S.toString(),10)],v<=w);break}this.notify("rowExpandCollapse",{detailrows:u,action:c,record:r,row:i}),this.updateAltRow(p)}else this.notify(K,{action:e,row:i,record:r})},i.prototype.updateChildOnDemand=function(e){var i=this;if("collapse"===e.requestType&&tt(this)){for(var r=this.flatData.slice(),n=0;n<r.length;n++)r[parseInt(n.toString(),10)].parentUniqueID===e.data.uniqueID&&(r.splice(n,1),n-=1);this.dataResults.result=r}else{var o,a=new Ze.Deferred;this.query?(o=this.grid.getDataModule().getStateEventArgument(this.query)).action=e:o=e,e.childDataBind=a.resolve;var s=e.data;this.trigger(N,o),a.promise.then(function(){if(e.childData.length){tt(i)&&(i.flatData=i.dataResults.result),i.enableInfiniteScrolling&&tt(i)&&(i.flatData=i.infiniteScrollData);for(var r=i.flatData,n=0,o=0;o<r.length;o++)if(r[parseInt(o.toString(),10)].taskData===s.taskData){n=o;break}var a=(0,t.getValue)("result",i.dataSource),d=dt(e.childData),p=s[i.childMapping]&&s[i.childMapping].length>d.length?s[i.childMapping].length:d.length;for(o=0;o<p;o++)s[i.childMapping]&&a.filter(function(e,t){e[i.parentIdMapping]===s[i.idMapping]&&a.splice(t,1)}),d[parseInt(o.toString(),10)]?(d[parseInt(o.toString(),10)].level=s.level+1,d[parseInt(o.toString(),10)].index=Math.ceil(1e3*Math.random()),d[parseInt(o.toString(),10)].parentItem=(0,t.extend)({},s),d[parseInt(o.toString(),10)].taskData=(0,t.extend)({},d[parseInt(o.toString(),10)]),delete d[parseInt(o.toString(),10)].parentItem.childRecords,delete d[parseInt(o.toString(),10)].taskData.parentItem,d[parseInt(o.toString(),10)].parentUniqueID=s.uniqueID,d[parseInt(o.toString(),10)].uniqueID=(0,l.getUid)(i.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+d[parseInt(o.toString(),10)].uniqueID,d[parseInt(o.toString(),10)],i),(!(0,t.isNullOrUndefined)(d[parseInt(o.toString(),10)][i.childMapping])||d[parseInt(o.toString(),10)][i.hasChildMapping]&&tt(i))&&(d[parseInt(o.toString(),10)].hasChildRecords=!0),tt(i)&&s[i.childMapping]&&s[i.childMapping][parseInt(o.toString(),10)]?r.splice(n+1+o,0,d[parseInt(o.toString(),10)]):r.splice(n+1+o,s[i.childMapping]&&s[i.childMapping][parseInt(o.toString(),10)]?1:0,d[parseInt(o.toString(),10)])):r.splice(n+1+o,1);r[parseInt(n.toString(),10)][""+i.childMapping]=d,r[parseInt(n.toString(),10)].childRecords=d,r[parseInt(n.toString(),10)].expanded=!0,(0,t.setValue)("uniqueIDCollection."+r[parseInt(n.toString(),10)].uniqueID,r[parseInt(n.toString(),10)],i);for(var h=0;h<e.childData.length;h++)a.push(e.childData[parseInt(h.toString(),10)])}tt(i)&&!i.loadChildOnDemand&&"expand"===e.requestType&&(i.dataResults.expandRecord={},i.dataResults.expandRecord=e.data),i.isExpandRefresh=!0;var c=i.getContentTable().parentElement.scrollTop;i.grid.refresh(),i.enableInfiniteScrolling&&(i.getContentTable().parentElement.scrollTop=c),i.trigger(j,e)})}},i.prototype.remoteExpand=function(e,i,r){var n=this.getRows(),o=(0,t.getValue)("isCollapseAll",this)?"collapseAll":"refresh";if(this.grid.contentModule.requestType=o,this.rowTemplate){var a=this.getContentTable().rows;n=[].slice.call(a)}var s,d={data:r,row:i};if(s=n.filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))||e.querySelector(".e-gridrowindex"+r.index+"level0.e-summarycell")}),"expand"===e){this.notify(Q,{record:r,rows:s,parentRow:i});var l={row:i,data:r};s.length>0&&this.trigger(j,l)}else"collapse"===e&&this.enableVirtualization?this.dataModule.fetchRemoteChildData({action:e,record:d.data,rows:null,parentRow:d.row}):(this.collapseRemoteChild({record:r,rows:s}),this.trigger(H,d))},i.prototype.localExpand=function(e,i,r){var n,o,a,s=this.grid.currentViewData.filter(function(e){return e.parentUniqueID===r.uniqueID});this.isPixelHeight()&&i.cells[0].classList.contains("e-lastrowcell")&&this.lastRowBorder(i,!1);var d=this.getRows();if(this.rowTemplate){var l=this.getContentTable().rows;d=[].slice.call(l)}var p="expand"===e?"e-childrow-visible":"e-childrow-hidden",h=this.getPrimaryKeyFieldNames()[0];if(this.enableImmutableMode&&!this.allowPaging){n=[];for(var c=0;c<s.length;c++){var u=this.grid.getRowIndexByPrimaryKey(s[parseInt(c.toString(),10)][""+h]);n.push(this.getRows()[parseInt(u.toString(),10)])}}else n=d.filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))});var g=this.grid.getFrozenLeftColumnsCount()>0||this.grid.getFrozenRightColumnsCount()>0;(this.frozenRows||this.frozenColumns||this.getFrozenColumns()||g)&&(o=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))})),g&&(a=this.getRows().filter(function(e){return e.querySelector(".e-gridrowindex"+r.index+"level"+(r.level+1))}));var f=this.grid.getRowsObject(),y=this.grid.currentViewData,m=y.filter(function(e){return e.uniqueID===r.uniqueID}),S=y.indexOf(m[0]);(0,t.isNullOrUndefined)(f[parseInt(S.toString(),10)].visible)||!1===f[parseInt(S.toString(),10)].visible||(f[parseInt(S.toString(),10)].visible=!0),this.detailTemplate&&d.forEach(function(e){e.classList.contains("e-detailrow")&&"none"===e.style.display&&(e.style.display="")});var v=d.filter(function(e){return e.classList.contains("e-griddetailrowindex"+r.index+"level"+(r.level+1))});for(c=0;c<n.length;c++){if((0,t.isNullOrUndefined)(n[parseInt(c.toString(),10)])||this.toggleRowVisibility(n[parseInt(c.toString(),10)],p),!(0,t.isNullOrUndefined)(n[parseInt(c.toString(),10)])&&!this.allowPaging&&!(this.enableVirtualization||this.enableInfiniteScrolling||et(this)||tt(this))){(0,t.isNullOrUndefined)(f[n[parseInt(c.toString(),10)].rowIndex])||(f[n[parseInt(c.toString(),10)].rowIndex].visible="e-childrow-hidden"!==p);var w=y.filter(function(e){return e.uniqueID===m[0].parentUniqueID});!(0,t.isNullOrUndefined)(w[0])&&d[y.indexOf(w[0])].getElementsByClassName("e-treegridcollapse").length&&(f[parseInt(S.toString(),10)].visible=!1)}(0,t.isNullOrUndefined)(o)||this.toggleRowVisibility(o[parseInt(c.toString(),10)],p),(0,t.isNullOrUndefined)(a)||this.toggleRowVisibility(a[parseInt(c.toString(),10)],p),this.notify("childRowExpand",{row:n[parseInt(c.toString(),10)]}),!(0,t.isNullOrUndefined)(s)&&!(0,t.isNullOrUndefined)(s[parseInt(c.toString(),10)].childRecords)&&s[parseInt(c.toString(),10)].childRecords.length>0&&("expand"!==e||(0,t.isNullOrUndefined)(s[parseInt(c.toString(),10)].expanded)||s[parseInt(c.toString(),10)].expanded)&&(this.expandCollapse(e,n[parseInt(c.toString(),10)],s[parseInt(c.toString(),10)],!0),this.frozenColumns<=this.treeColumnIndex&&!(0,t.isNullOrUndefined)(o)&&this.expandCollapse(e,o[parseInt(c.toString(),10)],s[parseInt(c.toString(),10)],!0))}for(c=0;c<v.length;c++)(0,t.isNullOrUndefined)(v[parseInt(c.toString(),10)])||this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||et(this)||tt(this)||(f[v[parseInt(c.toString(),10)].rowIndex].visible="e-childrow-hidden"!==p,this.toggleRowVisibility(v[parseInt(c.toString(),10)],p));this.allowPaging||this.enableVirtualization||this.enableInfiniteScrolling||et(this)||tt(this)||this.grid.notify("refresh-Expand-and-Collapse",{rows:this.grid.getRowsObject()})},i.prototype.toggleRowVisibility=function(e,t){e&&(e.classList.remove("e-childrow-hidden","e-childrow-visible","e-hide"),e.classList.add(t))},i.prototype.updateAltRow=function(e){if(this.enableAltRow&&!this.rowTemplate)for(var i=0,r=0;e&&r<e.length;r++){var n=e[parseInt(r.toString(),10)];n.classList.contains("e-childrow-hidden")||(n.classList.contains("e-altrow")&&(0,t.removeClass)([n],"e-altrow"),i%2==0||n.classList.contains("e-summaryrow")||n.classList.contains("e-detailrow")||(0,t.addClass)([n],"e-altrow"),n.classList.contains("e-summaryrow")||n.classList.contains("e-detailrow")||i++)}},i.prototype.treeColumnRowTemplate=function(){var e=this.getContentTable().rows;e=[].slice.call(e);for(var t=this.grid.getRowsObject(),i=0;i<e.length;i++){var r=this.grid.getContentTable().rows[parseInt(i.toString(),10)].cells[this.treeColumnIndex],n=e[parseInt(i.toString(),10)],o={data:0!==t.length?t[parseInt(i.toString(),10)].data:new Object,row:n,cell:r,column:this.getColumns()[this.treeColumnIndex]};this.renderModule.cellRender(o)}},i.prototype.collapseRemoteChild=function(e,i){(0,t.isNullOrUndefined)(i)||i||!this.loadChildOnDemand||(e.record.expanded=!1);var r,n,o=e.rows,a=[],s=[],d=this.getFrozenLeftColumnsCount()>0||this.getFrozenRightColumnsCount()>0;d&&(a=this.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))}),s=this.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))}));for(var l=0;l<o.length;l++){this.toggleRowVisibility(o[parseInt(l.toString(),10)],"e-childrow-hidden"),r=o[parseInt(l.toString(),10)];var p=o[parseInt(l.toString(),10)].querySelector(".e-detailrowexpand");if((0,t.isNullOrUndefined)(p)||this.grid.detailRowModule.collapse(p),d&&(this.toggleRowVisibility(a[parseInt(l.toString(),10)],"e-childrow-hidden"),this.toggleRowVisibility(s[parseInt(l.toString(),10)],"e-childrow-hidden"),o[parseInt(l.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")||(a[parseInt(l.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")?r=a[parseInt(l.toString(),10)]:s[parseInt(l.toString(),10)].querySelector(".e-treecolumn-container .e-treegridexpand")&&(r=s[parseInt(l.toString(),10)]))),r.querySelector(".e-treecolumn-container .e-treegridexpand")){var h=r.querySelector(".e-treecolumn-container .e-treegridexpand");n=this.rowTemplate?this.grid.getCurrentViewRecords()[o[parseInt(l.toString(),10)].rowIndex]:this.grid.getRowObjectFromUID(o[parseInt(l.toString(),10)].getAttribute("data-Uid")).data,!(0,t.isNullOrUndefined)(h)&&n.expanded&&((0,t.removeClass)([h],"e-treegridexpand"),(0,t.addClass)([h],"e-treegridcollapse"));for(var c=[],u=this.getRows(),g=0;g<u.length;g++)u[parseInt(g.toString(),10)].querySelector(".e-gridrowindex"+n.index+"level"+(n.level+1))&&c.push(u[parseInt(g.toString(),10)]);c.length&&n.expanded&&this.collapseRemoteChild({record:n,rows:c},!1)}}this.grid.pageSettings.totalRecordsCount-=o.length},i.prototype.sanitize=function(e){return this.enableHtmlSanitizer&&"string"==typeof e?t.SanitizeHtmlHelper.sanitize(e):e},i.prototype.addListener=function(){this.on("updateResults",this.updateResultModel,this),this.grid.on("initial-end",this.afterGridRender,this),this.grid.on("partial-filter-update",this.partialFilterUpdate,this)},i.prototype.updateResultModel=function(e){this.dataResults=e},i.prototype.removeListener=function(){this.isDestroyed||(this.off("updateResults",this.updateResultModel),this.grid.off("initial-end",this.afterGridRender),this.grid.off("last-rowcell-border-updated",this.lastRowCellBorderUpdated),this.grid.off("partial-filter-update",this.partialFilterUpdate))},i.prototype.partialFilterUpdate=function(e){var t=e.gridFiltered;this.notify("updateFilterRecs",{data:t})},i.prototype.filterByColumn=function(e,t,i,r,n,o,a,s){this.grid.filterByColumn(e,t,i,r,n,o,a,s)},i.prototype.clearFiltering=function(){this.grid.clearFiltering()},i.prototype.removeFilteredColsByField=function(e,t){this.grid.removeFilteredColsByField(e,t)},i.prototype.selectRow=function(e,t){this.grid.selectRow(e,t)},i.prototype.selectRows=function(e){this.grid.selectRows(e)},i.prototype.clearSelection=function(){(0,t.isNullOrUndefined)(this.grid.selectionModule)||(this.grid.selectionModule.actualTarget=null),this.grid.clearSelection()},i.prototype.copy=function(e){this.clipboardModule.copy(e)},i.prototype.paste=function(e,t,i){this.clipboardModule.paste(e,t,i)},i.prototype.selectCell=function(e,t){this.grid.selectCell(e,t)},i.prototype.getSelectedRows=function(){return this.grid.getSelectedRows()},i.prototype.getMovableCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},i.prototype.getMovableDataRows=function(){return this.grid.getDataRows()},i.prototype.getMovableRowByIndex=function(e){return this.grid.getRowByIndex(e)},i.prototype.getMovableRows=function(){return this.grid.getRows()},i.prototype.getFrozenRightRowByIndex=function(e){return this.grid.getRowByIndex(e)},i.prototype.getFrozenRightRows=function(){return this.grid.getRows()},i.prototype.getFrozenRightDataRows=function(){return this.grid.getDataRows()},i.prototype.getFrozenRightCellFromIndex=function(e,t){return this.grid.getCellFromIndex(e,t)},i.prototype.getFrozenLeftColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},i.prototype.getFrozenRightColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},i.prototype.getMovableColumnHeaderByIndex=function(e){return this.grid.getColumnHeaderByIndex(e)},i.prototype.getMovableColumnsCount=function(){return this.grid.getMovableColumnsCount()},i.prototype.getFrozenLeftColumnsCount=function(){return this.grid.getFrozenLeftColumnsCount()},i.prototype.getFrozenRightColumnsCount=function(){return this.grid.getFrozenRightColumnsCount()},i.prototype.getFrozenLeftColumns=function(){return this.updateColumnModel(this.grid.getFrozenLeftColumns()),this.columnModel},i.prototype.getFrozenRightColumns=function(){return this.updateColumnModel(this.grid.getFrozenRightColumns()),this.columnModel},i.prototype.getVisibleMovableCount=function(){return this.grid.getVisibleMovableCount()},i.prototype.getVisibleFrozenRightCount=function(){return this.grid.getVisibleFrozenRightCount()},i.prototype.getVisibleFrozenLeftCount=function(){return this.grid.getVisibleFrozenLeftCount()},i.prototype.getMovableColumns=function(){return this.updateColumnModel(this.grid.getMovableColumns()),this.columnModel},i.prototype.getFrozenColumns=function(){return this.getFrozenCount(!(0,t.isNullOrUndefined)(this.columns)&&this.columns,0)+this.frozenColumns},i.prototype.getFrozenCount=function(e,t){for(var i=0,r=e.length;i<r;i++)e[parseInt(i.toString(),10)].columns?t=this.getFrozenCount(e[parseInt(i.toString(),10)].columns,t):e[parseInt(i.toString(),10)].isFrozen&&t++;return t},i.prototype.getSelectedRowIndexes=function(){return this.grid.getSelectedRowIndexes()},i.prototype.getSelectedRowCellIndexes=function(){return this.grid.getSelectedRowCellIndexes()},i.prototype.getSelectedRecords=function(){return this.grid.getSelectedRecords()},i.prototype.getDataModule=function(){return{baseModule:this.grid.getDataModule(),treeModule:this.dataModule}},i.prototype.reorderRows=function(e,i,r){(0,t.isNullOrUndefined)(this.rowDragAndDropModule)||this.rowDragAndDropModule.reorderRows(e,i,r)},i.prototype.indent=function(e){(0,t.isNullOrUndefined)(this.rowDragAndDropModule)||this.rowDragAndDropModule[this.indentOutdentAction](e,"indent")},i.prototype.outdent=function(e){(0,t.isNullOrUndefined)(this.rowDragAndDropModule)||this.rowDragAndDropModule[this.indentOutdentAction](e,"outdent")},Yt([(0,t.Property)(0)],i.prototype,"frozenRows",void 0),Yt([(0,t.Property)(0)],i.prototype,"frozenColumns",void 0),Yt([(0,t.Property)("Ellipsis")],i.prototype,"clipMode",void 0),Yt([(0,t.Property)([])],i.prototype,"columns",void 0),Yt([(0,t.Property)(null)],i.prototype,"childMapping",void 0),Yt([(0,t.Property)(null)],i.prototype,"hasChildMapping",void 0),Yt([(0,t.Property)(0)],i.prototype,"treeColumnIndex",void 0),Yt([(0,t.Property)(null)],i.prototype,"idMapping",void 0),Yt([(0,t.Property)(null)],i.prototype,"parentIdMapping",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableCollapseAll",void 0),Yt([(0,t.Property)(null)],i.prototype,"expandStateMapping",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowRowDragAndDrop",void 0),Yt([(0,t.Property)([])],i.prototype,"dataSource",void 0),Yt([(0,t.Property)()],i.prototype,"query",void 0),Yt([(0,t.Property)()],i.prototype,"cloneQuery",void 0),Yt([(0,t.Property)("AllPages")],i.prototype,"printMode",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowPaging",void 0),Yt([(0,t.Property)(!0)],i.prototype,"loadChildOnDemand",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowTextWrap",void 0),Yt([(0,t.Complex)({},v)],i.prototype,"textWrapSettings",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowReordering",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowResizing",void 0),Yt([(0,t.Property)(!1)],i.prototype,"autoCheckHierarchy",void 0),Yt([(0,t.Complex)({},Mt)],i.prototype,"pageSettings",void 0),Yt([(0,t.Complex)({},l.RowDropSettings)],i.prototype,"rowDropSettings",void 0),Yt([(0,t.Property)("USD")],i.prototype,"currencyCode",void 0),Yt([(0,t.Property)()],i.prototype,"pagerTemplate",void 0),Yt([(0,t.Property)(!1)],i.prototype,"showColumnMenu",void 0),Yt([(0,t.Property)(!1)],i.prototype,"showColumnChooser",void 0),Yt([(0,t.Complex)({},Kt)],i.prototype,"columnChooserSettings",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowSorting",void 0),Yt([(0,t.Property)(!0)],i.prototype,"allowMultiSorting",void 0),Yt([(0,t.Complex)({},Bt)],i.prototype,"sortSettings",void 0),Yt([(0,t.Collection)([],Et)],i.prototype,"aggregates",void 0),Yt([(0,t.Complex)({},qt)],i.prototype,"editSettings",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowFiltering",void 0),Yt([(0,t.Property)()],i.prototype,"detailTemplate",void 0),Yt([(0,t.Complex)({},y)],i.prototype,"filterSettings",void 0),Yt([(0,t.Complex)({},St)],i.prototype,"searchSettings",void 0),Yt([(0,t.Property)()],i.prototype,"toolbar",void 0),Yt([(0,t.Property)()],i.prototype,"toolbarTemplate",void 0),Yt([(0,t.Property)("Default")],i.prototype,"gridLines",void 0),Yt([(0,t.Property)()],i.prototype,"contextMenuItems",void 0),Yt([(0,t.Property)()],i.prototype,"columnMenuItems",void 0),Yt([(0,t.Property)()],i.prototype,"rowTemplate",void 0),Yt([(0,t.Property)("Parent")],i.prototype,"copyHierarchyMode",void 0),Yt([(0,t.Property)(null)],i.prototype,"rowHeight",void 0),Yt([(0,t.Property)(!0)],i.prototype,"enableAltRow",void 0),Yt([(0,t.Property)(!0)],i.prototype,"allowKeyboard",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableHover",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableAutoFill",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableAdaptiveUI",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableImmutableMode",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableStickyHeader",void 0),Yt([(0,t.Property)()],i.prototype,"emptyRecordTemplate",void 0),Yt([(0,t.Property)("auto")],i.prototype,"height",void 0),Yt([(0,t.Property)("auto")],i.prototype,"width",void 0),Yt([(0,t.Complex)({},c)],i.prototype,"loadingIndicator",void 0),Yt([(0,t.Property)(!0)],i.prototype,"enableVirtualMaskRow",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableVirtualization",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableColumnVirtualization",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableHtmlSanitizer",void 0),Yt([(0,t.Property)(!1)],i.prototype,"enableInfiniteScrolling",void 0),Yt([(0,t.Complex)({},Ht)],i.prototype,"infiniteScrollSettings",void 0),Yt([(0,t.Property)("All")],i.prototype,"columnQueryMode",void 0),Yt([(0,t.Property)(!0)],i.prototype,"allowSelection",void 0),Yt([(0,t.Property)(-1)],i.prototype,"selectedRowIndex",void 0),Yt([(0,t.Property)(null)],i.prototype,"isRowSelectable",void 0),Yt([(0,t.Complex)({},It)],i.prototype,"selectionSettings",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowExcelExport",void 0),Yt([(0,t.Property)(!1)],i.prototype,"allowPdfExport",void 0),Yt([(0,t.Event)()],i.prototype,"created",void 0),Yt([(0,t.Event)()],i.prototype,"load",void 0),Yt([(0,t.Event)()],i.prototype,"expanding",void 0),Yt([(0,t.Event)()],i.prototype,"expanded",void 0),Yt([(0,t.Event)()],i.prototype,"collapsing",void 0),Yt([(0,t.Event)()],i.prototype,"collapsed",void 0),Yt([(0,t.Event)()],i.prototype,"cellSave",void 0),Yt([(0,t.Event)()],i.prototype,"cellSaved",void 0),Yt([(0,t.Event)()],i.prototype,"actionBegin",void 0),Yt([(0,t.Event)()],i.prototype,"actionComplete",void 0),Yt([(0,t.Event)()],i.prototype,"beginEdit",void 0),Yt([(0,t.Event)()],i.prototype,"batchAdd",void 0),Yt([(0,t.Event)()],i.prototype,"batchDelete",void 0),Yt([(0,t.Event)()],i.prototype,"batchCancel",void 0),Yt([(0,t.Event)()],i.prototype,"beforeBatchAdd",void 0),Yt([(0,t.Event)()],i.prototype,"beforeBatchDelete",void 0),Yt([(0,t.Event)()],i.prototype,"beforeBatchSave",void 0),Yt([(0,t.Event)()],i.prototype,"cellEdit",void 0),Yt([(0,t.Event)()],i.prototype,"actionFailure",void 0),Yt([(0,t.Event)()],i.prototype,"dataBound",void 0),Yt([(0,t.Event)()],i.prototype,"dataSourceChanged",void 0),Yt([(0,t.Event)()],i.prototype,"dataStateChange",void 0),Yt([(0,t.Event)()],i.prototype,"recordDoubleClick",void 0),Yt([(0,t.Event)()],i.prototype,"rowDataBound",void 0),Yt([(0,t.Event)()],i.prototype,"detailDataBound",void 0),Yt([(0,t.Event)()],i.prototype,"queryCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"rowSelecting",void 0),Yt([(0,t.Event)()],i.prototype,"rowSelected",void 0),Yt([(0,t.Event)()],i.prototype,"rowDeselecting",void 0),Yt([(0,t.Event)()],i.prototype,"rowDeselected",void 0),Yt([(0,t.Event)()],i.prototype,"headerCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"cellSelecting",void 0),Yt([(0,t.Event)()],i.prototype,"columnMenuOpen",void 0),Yt([(0,t.Event)()],i.prototype,"columnMenuClick",void 0),Yt([(0,t.Event)()],i.prototype,"cellSelected",void 0),Yt([(0,t.Event)()],i.prototype,"cellDeselecting",void 0),Yt([(0,t.Event)()],i.prototype,"cellDeselected",void 0),Yt([(0,t.Event)()],i.prototype,"resizeStart",void 0),Yt([(0,t.Event)()],i.prototype,"resizing",void 0),Yt([(0,t.Event)()],i.prototype,"resizeStop",void 0),Yt([(0,t.Event)()],i.prototype,"columnDragStart",void 0),Yt([(0,t.Event)()],i.prototype,"columnDrag",void 0),Yt([(0,t.Event)()],i.prototype,"columnDrop",void 0),Yt([(0,t.Event)()],i.prototype,"checkboxChange",void 0),Yt([(0,t.Event)()],i.prototype,"printComplete",void 0),Yt([(0,t.Event)()],i.prototype,"beforePrint",void 0),Yt([(0,t.Event)()],i.prototype,"toolbarClick",void 0),Yt([(0,t.Event)()],i.prototype,"beforeDataBound",void 0),Yt([(0,t.Event)()],i.prototype,"contextMenuOpen",void 0),Yt([(0,t.Event)()],i.prototype,"contextMenuClick",void 0),Yt([(0,t.Event)()],i.prototype,"beforeCopy",void 0),Yt([(0,t.Event)()],i.prototype,"beforePaste",void 0),Yt([(0,t.Event)()],i.prototype,"rowDrag",void 0),Yt([(0,t.Event)()],i.prototype,"rowDragStart",void 0),Yt([(0,t.Event)()],i.prototype,"rowDragStartHelper",void 0),Yt([(0,t.Event)()],i.prototype,"rowDrop",void 0),Yt([(0,t.Event)()],i.prototype,"pdfQueryCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"pdfHeaderQueryCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"excelQueryCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"pdfAggregateQueryCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"excelAggregateQueryCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"excelHeaderQueryCellInfo",void 0),Yt([(0,t.Event)()],i.prototype,"beforeExcelExport",void 0),Yt([(0,t.Event)()],i.prototype,"excelExportComplete",void 0),Yt([(0,t.Event)()],i.prototype,"beforePdfExport",void 0),Yt([(0,t.Event)()],i.prototype,"pdfExportComplete",void 0),i=r=Yt([t.NotifyPropertyChanges],i)}(t.Component),Xt=function(){function e(e){l.Grid.Inject(l.Reorder),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"reorder"},e.prototype.addEventListener=function(){this.parent.on("getColumnIndex",this.updateTreeColumn,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||this.parent.off("getColumnIndex",this.updateTreeColumn)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.updateTreeColumn=function(){this.parent.getTreeColumn()},e}(),$t=function(){function e(e){l.Grid.Inject(l.Resize),this.parent=e}return e.prototype.autoFitColumns=function(e){this.parent.grid.autoFitColumns(e)},e.prototype.getModuleName=function(){return"resize"},e.prototype.destroy=function(){this.parent.isDestroyed||this.parent.grid.resizeModule.destroy()},e}(),Zt=function(){function e(e){this.canDrop=!0,this.isDraggedWithChild=!1,this.modifiedRecords="modifiedRecords",this.selectedRecords="selectedRecords",this.selectedRows="selectedRows",this.hasDropItem=!0,this.isaddtoBottom=!1,l.Grid.Inject(l.RowDD),this.parent=e,this.addEventListener()}return e.prototype.getChildrecordsByParentID=function(e){return(this.parent.dataSource instanceof Ze.DataManager&&st(this.parent)?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource).filter(function(t){return t.uniqueID===e})},e.prototype.addEventListener=function(){this.parent.on(Ue,this.Rowdraging,this),this.parent.on(qe,this.rowDropped,this),this.parent.on(Ee,this.rowsAdded,this),this.parent.on(Ne,this.rowsRemoved,this)},e.prototype.reorderRows=function(e,i,r){var n=this.parent;if(e[0]!==i&&-1!==["above","below","child"].indexOf(r)){var o="action";if(e[0]!==i&&-1!==["above","below","child"].indexOf(r)){"above"===r&&(this.dropPosition="topSegment"),"below"===r&&(this.dropPosition="bottomSegment"),"child"===r&&(this.dropPosition="middleSegment"),this.parent.dropPosition=this.dropPosition;for(var a=[],s=0;s<e.length;s++){var d=this.parent.getRowByIndex(e[parseInt(s.toString(),10)]).rowIndex;a[parseInt(s.toString(),10)]=this.parent.getCurrentViewRecords()[parseInt(d.toString(),10)]}var l={data:a,dropIndex:i};if(tt(this.parent)||this.dropRows(l,!0),n.isLocalData&&(n.flatData=this.orderToIndex(n.flatData)),"outdenting"===this.parent[""+o]&&((0,t.isNullOrUndefined)(a[0].parentItem)||(a[0].level=a[0].parentItem.level+1)),this.parent.grid.refresh(),this.parent.enableImmutableMode&&"middleSegment"===this.dropPosition){d=this.parent.allowRowDragAndDrop?this.parent.treeColumnIndex+1:"indenting"===this.parent[""+o]?this.parent.treeColumnIndex:void 0;var p=this.parent.getRows()[e[0]],h=l.data[0],c=[];(f=[]).push(h),c.push(p);var u=pt(this.parent,l.data[0].parentUniqueID),g=this.parent.getRows()[parseInt(i.toString(),10)];f.push(u),c.push(g),this.updateRowAndCellElements(f,c,d)}if(this.parent.enableImmutableMode&&"outdenting"===this.parent[""+o]){d=this.parent.allowRowDragAndDrop?this.parent.treeColumnIndex+1:"outdenting"===this.parent[""+o]?this.parent.treeColumnIndex:void 0;var f,y=l.data[0];p=this.parent.getRows()[e[0]],c=[];(f=[]).push(y),c.push(p),this.updateRowAndCellElements(f,c,d)}}}},e.prototype.updateRowAndCellElements=function(e,t,i){for(var r=0;r<e.length;r++)this.parent.renderModule.cellRender({data:e[parseInt(r.toString(),10)],cell:t[parseInt(r.toString(),10)].cells[parseInt(i.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"}),"indenting"!==this.parent.action&&"outdenting"!==this.parent.action||this.parent.renderModule.RowModifier({data:e[parseInt(r.toString(),10)],row:t[parseInt(r.toString(),10)]})},e.prototype.indentOutdentAction=function(e,i){var r=this.parent,n="action",o="dropIndex",a=-1;if(!(0,t.isNullOrUndefined)(e)||-1!==this.parent.selectedRowIndex){this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?a=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(a=this.parent.selectedRowIndex),this.selectedItem=(0,t.isNullOrUndefined)(e)?r.getCurrentViewRecords()[parseInt(a.toString(),10)]:e;var s=this.parent.getPrimaryKeyFieldNames()[0],d=this.parent.grid.getRowIndexByPrimaryKey(this.selectedItem[""+s]);if(this.selectedRow=this.parent[this.selectedRows]=-1!==a?this.parent.getSelectedRows()[0]:this.parent.grid.getRowByIndex(d),this.selectedRecord=this.parent[this.selectedRecords]=-1!==a?r.getCurrentViewRecords()[parseInt(a.toString(),10)]:this.selectedItem,"indent"===i){var l=r.getCurrentViewRecords()[this.selectedRow.rowIndex-1],p=void 0;if(0===this.selectedRow.rowIndex||-1===this.selectedRow.rowIndex||r.getCurrentViewRecords()[this.selectedRow.rowIndex].level-l.level===1)return;if(l.level>this.selectedRecord.level)for(var h=0;h<r.getCurrentViewRecords().length;h++)r.getCurrentViewRecords()[parseInt(h.toString(),10)].taskData===l.parentItem.taskData&&(p=h,r.enableVirtualization&&(p=parseInt(r.getRows()[parseInt(h.toString(),10)].getAttribute("aria-rowindex"),10)-1));else p=this.selectedRow.rowIndex-1;!this.parent.enableVirtualization||!this.selectedRecord||l.level>this.selectedRecord.level||(p=parseInt(this.selectedRow.getAttribute("aria-rowindex"),10)-2),r[""+n]="indenting",r[""+o]=p,this.eventTrigger("indenting",p)}else if("outdent"===i){var c=-1===this.selectedRow.rowIndex||0===this.selectedRow.rowIndex,u=0===r.getCurrentViewRecords()[this.selectedRow.rowIndex].level;if(c||u)return;var g=this.selectedRecord.parentItem;p=r.getCurrentViewRecords().findIndex(function(e){return e.uniqueID===g.uniqueID});if(-1===p)return;if(this.parent.enableVirtualization&&this.selectedRecord){var f=this.parent.getRows()[parseInt(p.toString(),10)].getAttribute("aria-rowindex");p=parseInt(f,10)-1}r[""+n]="outdenting",r[""+o]=p,this.eventTrigger("outdenting",p)}}},e.prototype.eventTrigger=function(e,t){var i=this,r={action:e,cancel:!1,data:[this.parent[this.selectedRecords]],row:this.parent[this.selectedRows]};this.parent.trigger(E,r,function(e){e.cancel||("indenting"===e.action?i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("aria-rowindex"),10)-1],t,"child"):i.reorderRows([i.selectedRow.rowIndex],t,"child"):"outdenting"===e.action&&(i.parent.enableVirtualization?i.reorderRows([parseInt(i.selectedRow.getAttribute("aria-rowindex"),10)-1],t,"below"):i.reorderRows([i.selectedRow.rowIndex],t,"below")))})},e.prototype.orderToIndex=function(e){for(var i=0;i<e.length;i++)if(e[parseInt(i.toString(),10)].index=i,!(0,t.isNullOrUndefined)(e[parseInt(i.toString(),10)].parentItem)){var r=(0,t.getValue)("uniqueIDCollection."+e[parseInt(i.toString(),10)].parentUniqueID,this.parent);e[parseInt(i.toString(),10)].parentItem.index=r.index}return e},e.prototype.rowsAdded=function(e){for(var i,r=e.records,n=e.records.length-1;n>-1;n--)if((i=r[parseInt(n.toString(),10)]).parentUniqueID){var o=r.filter(function(e){return e.uniqueID===i.parentUniqueID});if(o.length){var a=o[0].childRecords.indexOf(i),s=o[0];-1!==a&&((0,t.isNullOrUndefined)(this.parent.idMapping)&&(s.childRecords.splice(a,1),s.childRecords.length||(s.hasChildRecords=!1,s.hasFilteredChildRecords=!1)),this.isDraggedWithChild=!0)}}if((0,t.isNullOrUndefined)(this.parent.dataSource)||!this.parent.dataSource.length){var d,l=this.parent,p=e.records;for(n=e.records.length-1;n>-1;n--){d=p[parseInt(n.toString(),10)],!n&&d.hasChildRecords&&(d.taskData[this.parent.parentIdMapping]=null);if((0,t.isNullOrUndefined)(l.parentIdMapping)||(l.childMapping=null),(0,t.isNullOrUndefined)(d.taskData)||(0,t.isNullOrUndefined)(l.childMapping)||Object.prototype.hasOwnProperty.call(d.taskData,l.childMapping)||(d.taskData[l.childMapping]=[]),!(0,t.isNullOrUndefined)(d[l.childMapping])&&Object.prototype.hasOwnProperty.call(d,l.childMapping)&&d[l.childMapping].length&&!this.isDraggedWithChild&&!(0,t.isNullOrUndefined)(l.parentIdMapping))for(var h=d[l.childMapping],c=0;c<h.length;c++)-1===p.indexOf(h[parseInt(c.toString(),10)])&&(p.splice(c,0,h[parseInt(c.toString(),10)]),h[parseInt(c.toString(),10)].taskData=(0,t.extend)({},h[parseInt(c.toString(),10)]),n+=1);Object.prototype.hasOwnProperty.call(d,l.parentIdMapping)&&null!==d[l.parentIdMapping]&&!this.isDraggedWithChild&&(d.taskData[l.parentIdMapping]=null,delete d.parentItem,delete d.parentUniqueID),(0,t.isNullOrUndefined)(l.dataSource)&&(l.dataSource=[]),l.dataSource.splice(0,0,d.taskData)}l.setProperties({dataSource:l.dataSource},!1)}else{for(n=0;n<r.length;n++)(0,t.setValue)("uniqueIDCollection."+r[parseInt(n.toString(),10)].uniqueID,r[parseInt(n.toString(),10)],this.parent);var u={data:e.records,dropIndex:e.toIndex};this.parent.dataSource instanceof Ze.DataManager?(this.treeGridData=this.parent.dataSource.dataSource.json,this.treeData=this.parent.dataSource.dataSource.json):(this.treeGridData=this.parent.grid.dataSource,this.treeData=this.parent.dataSource),(0,t.isNullOrUndefined)(this.dropPosition)&&(this.dropPosition="bottomSegment",u.dropIndex=this.parent.getCurrentViewRecords().length>1?this.parent.getCurrentViewRecords().length-1:u.dropIndex,u.data=u.data.map(function(e){return e.hasChildRecords&&(0,t.isNullOrUndefined)(e.parentItem)?(e.level=0,e):(delete e.parentItem,delete e.parentUniqueID,e.level=0,e)})),this.dropRows(u)}},e.prototype.rowsRemoved=function(e){for(var t=0;t<e.records.length;t++)this.draggedRecord=e.records[parseInt(t.toString(),10)],(this.draggedRecord.hasChildRecords||this.draggedRecord.parentItem&&-1!==this.parent.grid.dataSource.indexOf(this.getChildrecordsByParentID(this.draggedRecord.parentUniqueID)[0])||0===this.draggedRecord.level)&&this.deleteDragRow()},e.prototype.refreshGridDataSource=function(){var e,i,r=this.draggedRecord,n=this.droppedRecord,o=this.parent;if(!(e=this.parent.dataSource instanceof Ze.DataManager&&st(this.parent)?o.dataSource.dataSource.json:o.dataSource)||(0,t.isNullOrUndefined)(n)||n.parentItem||(0,t.isNullOrUndefined)(n.taskData)){if(!this.parent.parentIdMapping&&!(0,t.isNullOrUndefined)(n)&&n.parentItem&&("topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition)){var a=this.getChildrecordsByParentID(n.parentUniqueID)[0].childRecords;for(d=0;d<a.length;d++)n.parentItem.taskData[this.parent.childMapping][parseInt(d.toString(),10)]=a[parseInt(d.toString(),10)].taskData}}else{for(var s=Object.keys(e),d=0;d<s.length;d++)if(e[parseInt(d.toString(),10)][this.parent.childMapping])e[parseInt(d.toString(),10)][this.parent.childMapping]===n.taskData[this.parent.childMapping]&&(i=d);else{var l=this.parent.getPrimaryKeyFieldNames()[0];e[parseInt(d.toString(),10)][""+l]===n.taskData[""+l]&&(i=d)}if(!this.parent.idMapping){var p="topSegment"===this.dropPosition?0:1;"topSegment"!==this.dropPosition&&"bottomSegment"!==this.dropPosition||e.splice(i+p,0,r.taskData)}}this.parent.parentIdMapping&&(r.parentItem?"topSegment"===this.dropPosition||"bottomSegment"===this.dropPosition?(r[this.parent.parentIdMapping]=n[this.parent.parentIdMapping],r.taskData[this.parent.parentIdMapping]=n[this.parent.parentIdMapping]):(r[this.parent.parentIdMapping]=n[this.parent.idMapping],r.taskData[this.parent.parentIdMapping]=n[this.parent.idMapping]):(r.taskData[this.parent.parentIdMapping]=null,r[this.parent.parentIdMapping]=null))},e.prototype.removeFirstrowBorder=function(e){var t="bottomSegment"===this.dropPosition;this.parent.element.getElementsByClassName("e-firstrow-border").length>0&&e&&(0!==e.rowIndex||t)&&this.parent.element.getElementsByClassName("e-firstrow-border")[0].remove()},e.prototype.removeLastrowBorder=function(e){if(e&&!(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow"))){var t=(this.parent.enableVirtualization?this.parent.getRows()[this.parent.getCurrentViewRecords().length-1]:this.parent.getRowByIndex(this.parent.getCurrentViewRecords().length-1)).getAttribute("data-uid")!==e.getAttribute("data-uid")||"topSegment"===this.dropPosition,i=this.parent.element.getElementsByClassName("e-lastrow-border")[0];i&&t&&i.remove()}},e.prototype.updateIcon=function(e,i,r){var n=r.target?(0,t.closest)(r.target,"tr"):null;this.dropPosition=void 0;var o=0;this.removeFirstrowBorder(n),this.removeLastrowBorder(n);for(var a=0;a<r.rows.length;a++)((0,t.isNullOrUndefined)(n)||n.getAttribute("data-uid")!==r.rows[parseInt(a.toString(),10)].getAttribute("data-uid"))&&(0,l.parentsUntil)(r.target,"e-gridcontent")||(this.dropPosition="Invalid",this.addErrorElem(),(0,t.isNullOrUndefined)(this.parent.rowDropSettings.targetID)&&(this.removetopOrBottomBorder(),this.removeChildBorder()));var s=this.parent,d=0,p=s.toolbar&&s.toolbar.length?document.getElementById(s.element.id+"_gridcontrol_toolbarItems").offsetHeight:0,h=this.getOffset(s.element),c=s.getHeaderContent().offsetHeight+h.top+p,u=s.getContent().firstElementChild.scrollTop;(0,t.isNullOrUndefined)(n)||(o=n.offsetTop-u),d=this.parent.enableVirtualization?n.getBoundingClientRect().top:o+c+0;var g=((0!==e[0].offsetHeight&&(0,t.isNullOrUndefined)(n)?d+e[0].offsetHeight:d+n.offsetHeight)-d)/3,f=d+g,y=f+g,m=y+g,S=(0,l.getObject)("originalEvent.event",r),v=(0,l.getObject)("originalEvent.event",r),w="mousemove"===S.type?S.pageY:(0,t.isNullOrUndefined)(v)||(0,t.isNullOrUndefined)(v.changedTouches)?null:v.changedTouches[0].pageY;this.parent.enableVirtualization&&(w="mousemove"===S.type?S.clientY:(0,t.isNullOrUndefined)(v)||(0,t.isNullOrUndefined)(v.changedTouches)?null:v.changedTouches[0].clientY);var I=w<=f,R=w>f&&w<=y,x=w>y&&w<=m,C=!0;if(I||R||x)if(I&&"Invalid"!==this.dropPosition&&(this.removeChildBorder(),this.dropPosition="topSegment",this.removetopOrBottomBorder(),this.addFirstrowBorder(n),this.removeErrorElem(),this.removeLastrowBorder(n)),R&&"Invalid"!==this.dropPosition&&(this.removetopOrBottomBorder(),this.dropPosition="middleSegment",this.addLastRowborder(n),this.addFirstrowBorder(n)),x&&"Invalid"!==this.dropPosition&&(this.removeErrorElem(),this.removetopOrBottomBorder(),this.removeChildBorder(),this.dropPosition="bottomSegment",this.addLastRowborder(n),this.removeFirstrowBorder(n)),(I||x)&&"Invalid"!==this.dropPosition)C=this.updateBorderStatus(e,i),this.topOrBottomBorder(r.target,C);else if(R&&"Invalid"!==this.dropPosition){var b,D=(0,t.closest)(r.target,"tr");b=[].slice.call(D.querySelectorAll(".e-rowcell,.e-rowdragdrop,.e-detailrowcollapse")),C=this.updateBorderStatus(e,i),b.length>0&&C&&this.addRemoveClasses(b,!0,"e-childborder")}return this.dropPosition},e.prototype.updateBorderStatus=function(e,i){var r=this,n=!0,o=this.parent.grid.getRows(),a=[],s=!1;(0,t.isNullOrUndefined)(this.parent.detailTemplate)||(o=this.parent.getDataRows(),s=!0);var d=this.parent.treeColumnIndex,l=this.parent.allowRowDragAndDrop?s?d+2:d+1:s?d+1:d;(0,t.isNullOrUndefined)(this.parent.rowDropSettings.targetID)||(l=d);var p=e,h=[o[""+i]];return"topSegment"===this.dropPosition&&(e.filter(function(r){if((0,t.isNullOrUndefined)(r)||(0,t.isNullOrUndefined)(r.cells)||(0,t.isNullOrUndefined)(h[0])||(0,t.isNullOrUndefined)(h[0].cells))return!0;var s=/index(\d+)|level(\d+)/g,d=null==r?void 0:r.cells[""+l].className.match(s),c=h[0].cells[""+l].className.match(s);if((0,t.isNullOrUndefined)(c)||(0,t.isNullOrUndefined)(c)||(0,t.isNullOrUndefined)(d))return!0;var u=+d[1].match(/\d+/)[0],g=+c[1].match(/\d+/)[0],f=!1;if(0!==u&&u!==g)return!0;for(var y=0;y<o.length;y++)if(o[parseInt(y.toString(),10)]===p[0]&&(f=!0),f&&o[parseInt(y.toString(),10)]!==p[0]){var m=+o[parseInt(y.toString(),10)].cells[""+l].className.match(s)[1].match(/\d+/)[0];if(!(m!==u&&m>u))break;a.push(o[parseInt(y.toString(),10)])}return u===g&&(a.length>0&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1===i-(a.length+1)||0===a.length&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1==i-1)&&(n=!1),!0}),n=!(!(0,t.isNullOrUndefined)(e)&&0===a.length&&!(0,t.isNullOrUndefined)(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1==i-1&&(0,t.isNullOrUndefined)(e[0]))&&n),"bottomSegment"===this.dropPosition&&(h.filter(function(r){if((0,t.isNullOrUndefined)(r)||(0,t.isNullOrUndefined)(r.cells)||(0,t.isNullOrUndefined)(p[0])||(0,t.isNullOrUndefined)(p[0].cells))return!0;var s=/index(\d+)|level(\d+)/g,d=null==r?void 0:r.cells[""+l].className.match(s),c=p[0].cells[""+l].className.match(s);if((0,t.isNullOrUndefined)(c)||(0,t.isNullOrUndefined)(d))return!0;var u=+d[1].match(/\d+/)[0],g=+c[1].match(/\d+/)[0],f=!1;if(0!==u&&u!==g)return!0;for(var y=0;y<o.length;y++)if(o[parseInt(y.toString(),10)]===h[0]&&(f=!0),f&&o[parseInt(y.toString(),10)]!==h[0]){var m=+o[parseInt(y.toString(),10)].cells[""+l].className.match(s)[1].match(/\d+/)[0];if(!(m!==u&&m>u))break;a.push(o[parseInt(y.toString(),10)])}return!(0,t.isNullOrUndefined)(e)&&u===g&&(a.length>0&&!(0,t.isNullOrUndefined)(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1===i+(a.length+1)||0===a.length&&!(0,t.isNullOrUndefined)(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1===i+1)&&(n=!1),!0}),n=!(!(0,t.isNullOrUndefined)(e)&&0===a.length&&!(0,t.isNullOrUndefined)(e[0].getAttribute("aria-rowindex"))&&parseInt(e[0].getAttribute("aria-rowindex"),10)-1===i+1&&(0,t.isNullOrUndefined)(e[0]))&&n),"middleSegment"===this.dropPosition&&h.filter(function(e){if((0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.cells)||(0,t.isNullOrUndefined)(p[0])||(0,t.isNullOrUndefined)(p[0].cells))return!0;for(var i=0;i<p.length;i++){var o=h[0].rowIndex,a=p[parseInt(i.toString(),10)].cells[""+l].className.match(/index(\d+)|level(\d+)/g);if(!a)return!0;var d=parseInt(a.find(function(e){return e.includes("index")}).match(/\d+/)[0]||"0",10);if(s&&(o/=2),d!==o||r.parent.rowDropSettings.targetID){n=!0;break}n=!1}return n||(r.dropPosition="Invalid",r.addErrorElem()),n}),this.canDrop=n,n},e.prototype.removeChildBorder=function(){var e;(e=[].slice.call(this.parent.element.querySelectorAll(".e-childborder"))).length>0&&this.addRemoveClasses(e,!1,"e-childborder")},e.prototype.addFirstrowBorder=function(e){var i=this.parent.element,r=this.parent;if(e&&0===e.rowIndex&&!e.classList.contains("e-emptyrow")){var n=this.parent.createElement("div",{className:"e-firstrow-border"}),o=this.parent.getHeaderContent(),a=0;r.toolbar&&(a=r.toolbarModule.getToolbar().offsetHeight);var s=!(0,t.isNullOrUndefined)(this.parent.rowDropSettings.targetID);s&&(n.style.top=this.parent.grid.element.getElementsByClassName("e-gridheader")[0].offsetHeight+a+"px"),n.style.width=s?i.offsetWidth+"px":i.offsetWidth-this.getScrollWidth()+"px",o.querySelectorAll(".e-firstrow-border").length||o.appendChild(n)}},e.prototype.addLastRowborder=function(e){if(e){var t=e&&(e.classList.contains("e-emptyrow")||e.classList.contains("e-columnheader")||e.classList.contains("e-detailrow"));if(!t&&e&&!t&&this.parent.getRows()[this.parent.getCurrentViewRecords().length-1].getAttribute("data-uid")===e.getAttribute("data-uid")){var i=this.parent.createElement("div",{className:"e-lastrow-border"}),r=this.parent.getContent();i.style.width=this.parent.element.offsetWidth-this.getScrollWidth()+"px",r.querySelectorAll(".e-lastrow-border").length||(r.classList.add("e-treegrid-relative"),r.appendChild(i),i.style.bottom=this.getScrollWidth()+"px")}}},e.prototype.getScrollWidth=function(){var e=this.parent.getContent().firstElementChild;return e.scrollWidth>e.offsetWidth?l.Scroll.getScrollBarWidth():0},e.prototype.addErrorElem=function(){var e=document.getElementsByClassName("e-cloneproperties")[0],t="sanitize";if(!e.querySelectorAll(".e-errorelem").length&&!this.parent.rowDropSettings.targetID){var i=document.createElement("div");i.classList.add("e-errorcontainer","e-icons","e-errorelem");var r=e.querySelector(".e-rowcell"),n=e.querySelector(".errorValue"),o=r.innerHTML;n&&(o=this.parent[""+t](n.innerHTML),n.parentNode.removeChild(n)),r.innerHTML="";var a=document.createElement("span");a.className="errorValue",a.style.paddingLeft="16px",a.innerHTML=this.parent[""+t](o),r.appendChild(i),r.appendChild(a);var s=document.querySelector(".e-dropitemscount");if(this.hasDropItem&&s){var d=parseInt(s.style.left,10)+i.offsetWidth+16,l=this.parent.enableRtl?0:d;s.style.left=l+"px",this.hasDropItem=!1}}},e.prototype.removeErrorElem=function(){var e=document.querySelector(".e-errorelem"),i=document.querySelector(".errorValue"),r=document.querySelector(".e-dropitemscount");if(e){if(r){var n=parseInt(r.style.left,10)-e.offsetWidth-16;(0,t.setStyleAttribute)(i,{paddingLeft:"0px"}),this.parent.enableRtl||(0,t.setStyleAttribute)(r,{left:n+"px"})}e.remove()}this.hasDropItem=!0},e.prototype.topOrBottomBorder=function(e,i){void 0===i&&(i=!0);var r=(0,t.closest)(e,"tr"),n=r?Array.from(r.querySelectorAll(".e-rowcell, .e-rowdragdrop, .e-detailrowcollapse")):[];if(n.length){var o=i?this.addRemoveClasses.bind(this,n,!0):this.addRemoveClasses.bind(this,n,!1,"e-dragborder");if("topSegment"===this.dropPosition){o("e-droptop");var a=this.parent.element.querySelector(".e-lastrow-dragborder");a&&a.remove()}"bottomSegment"===this.dropPosition&&o("e-dropbottom")}},e.prototype.removetopOrBottomBorder=function(){var e=[];e=[].slice.call(this.parent.element.querySelectorAll(".e-dropbottom, .e-droptop")),this.parent.rowDropSettings.targetID&&(e=[].slice.call(document.querySelectorAll(".e-dropbottom, .e-droptop"))),e.length&&(this.addRemoveClasses(e,!1,"e-dropbottom"),this.addRemoveClasses(e,!1,"e-droptop"))},e.prototype.addRemoveClasses=function(e,t,i){for(var r=0,n=e.length;r<n;r++)t?e[parseInt(r.toString(),10)].classList.add(i):e[parseInt(r.toString(),10)].classList.remove(i)},e.prototype.getOffset=function(e){var t=e.getBoundingClientRect(),i=document.body,r=document.documentElement,n=window.pageYOffset||r.scrollTop||i.scrollTop,o=window.pageXOffset||r.scrollLeft||i.scrollLeft,a=r.clientTop||i.clientTop||0,s=r.clientLeft||i.clientLeft||0,d=t.top+n-a,l=t.left+o-s;return{top:Math.round(d),left:Math.round(l)}},e.prototype.Rowdraging=function(e){var i=this.parent,r=this.parent.element.querySelector(".e-cloneproperties");if(r){r.style.cursor="";var n=e.target?(0,t.closest)(e.target,"tr"):null,o=-1;if(-1===(o=(0,t.isNullOrUndefined)(this.parent.detailTemplate)?n?n.rowIndex:-1:n?this.parent.getDataRows().indexOf(n):-1))return this.canDrop=!1,this.addErrorElem(),this.removetopOrBottomBorder(),void this.removeChildBorder();var a,s,d=Array.isArray(e.data)?e.data:[e.data],p=i.getCurrentViewRecords()[parseInt(o.toString(),10)];if(i.rowDropSettings.targetID)if((s=(0,l.parentsUntil)(e.target,"e-treegrid"))&&s.id===this.parent.rowDropSettings.targetID)p=(a=s.ej2_instances[0]).getCurrentViewRecords()[parseInt(o.toString(),10)];if(this.removeErrorElem(),this.canDrop=!0,this.ensuredropPosition(d,p),i.rowDropSettings.targetID||!this.canDrop||(0,t.isNullOrUndefined)(e.rows[0])||i.rowDragAndDropModule.updateIcon(e.rows,o,e),i.rowDropSettings.targetID)if((s=(0,l.parentsUntil)(e.target,"e-treegrid"))&&s.id===this.parent.rowDropSettings.targetID)(a=s.ej2_instances[0]).rowDragAndDropModule.updateIcon(e.rows,o,e),this.dropPosition=a.rowDragAndDropModule.dropPosition;if(e.target&&(0,t.closest)(e.target,"#"+i.rowDropSettings.targetID))(s=(0,l.parentsUntil)(e.target,"e-treegrid"))||(r.style.cursor="default")}},e.prototype.rowDropped=function(e){var i=this.parent;if(i.rowDropSettings.targetID){if((e.target&&(0,t.closest)(e.target,"#"+i.rowDropSettings.targetID)||(0,l.parentsUntil)(e.target,"e-treegrid")&&(0,l.parentsUntil)(e.target,"e-treegrid").id===i.rowDropSettings.targetID||e.target&&document.getElementById(i.rowDropSettings.targetID))&&(!this.parent.element.querySelector(".e-errorelem")&&this.canDrop||(this.dropPosition="Invalid"),(0,t.setValue)("dropPosition",this.dropPosition,e),i.trigger(Pe,e),!e.cancel&&i.rowDropSettings.targetID)){if("Invalid"===this.dropPosition&&!this.canDrop)return;this.dragDropGrid(e),i.isLocalData&&(i.flatData=this.orderToIndex(i.flatData))}}else if(((0,l.parentsUntil)(e.target,"e-content")||"Invalid"===this.dropPosition||!this.canDrop)&&(!this.parent.element.querySelector(".e-errorelem")&&this.canDrop||(this.dropPosition="Invalid"),(0,t.setValue)("dropPosition",this.dropPosition,e),i.trigger(Pe,e),!e.cancel)){if(!tt(this.parent)&&"Invalid"===this.dropPosition&&!this.canDrop)return;tt(this.parent)||this.dropRows(e),i.isLocalData&&(i.flatData=this.orderToIndex(i.flatData)),i.grid.refresh(),this.removeRowBorders()}if(this.removetopOrBottomBorder(),this.removeChildBorder(),this.removeRowBorders(),this.parent.enableImmutableMode&&!this.parent.allowPaging&&!(0,t.isNullOrUndefined)(e.data[0].parentItem)){var r=this.parent.treeColumnIndex;r+=1;var n=this.parent.getPrimaryKeyFieldNames()[0],o=this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+n]),a=this.parent.getRows()[parseInt(o.toString(),10)],s=e.data[0];if("middleSegment"===this.dropPosition){var d=[],p=[];d.push(s),p.push(a);s=pt(this.parent,e.data[0].parentUniqueID),o=this.parent.grid.getRowIndexByPrimaryKey(s[""+n]);var h=this.parent.getRows()[parseInt(o.toString(),10)];d.push(s),p.push(h);for(var c=0;c<d.length;c++)this.parent.renderModule.cellRender({data:d[parseInt(c.toString(),10)],cell:p[parseInt(c.toString(),10)].cells[parseInt(r.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"});var u=h.getElementsByClassName("e-treegridcollapse")[0];(0,t.isNullOrUndefined)(u)||((0,t.removeClass)([u],"e-treegridcollapse"),(0,t.addClass)([u],"e-treegridexpand"))}else this.parent.renderModule.cellRender({data:s,cell:a.cells[parseInt(r.toString(),10)],column:this.parent.grid.getColumns()[this.parent.treeColumnIndex],requestType:"rowDragAndDrop"})}},e.prototype.removeRowBorders=function(){var e=this;["e-firstrow-border","e-lastrow-border"].forEach(function(t){var i=e.parent.element.getElementsByClassName(t)[0];i&&i.remove()})},e.prototype.dragDropGrid=function(e){var i,r=this.parent,n=(0,t.closest)(e.target,"tr"),o=isNaN(this.getTargetIdx(n))?0:this.getTargetIdx(n),a=(0,l.parentsUntil)(e.target,"e-treegrid");if(a&&a.id===this.parent.rowDropSettings.targetID&&!et(this.parent)&&!tt(this.parent)){i=a.ej2_instances[0];for(var s=r.getSelectedRecords(),d=[],p=0;p<s.length;p++)d[parseInt(p.toString(),10)]=s[parseInt(p.toString(),10)].index;var h=i.dataSource;if(null!==this.parent.idMapping&&((0,t.isNullOrUndefined)(this.dropPosition)||"bottomSegment"===this.dropPosition||"Invalid"===this.dropPosition)&&!h.length){var c=[];for(p=0;p<s.length;p++)if(s[parseInt(p.toString(),10)].hasChildRecords){c.push(s[parseInt(p.toString(),10)]);for(var u=at(s[parseInt(p.toString(),10)]),g=0;g<u.length;g++)c.push(u[parseInt(g.toString(),10)])}c.length&&(s=c)}r.notify(Ne,{indexes:d,records:s}),i.notify(Ee,{toIndex:o,records:s});var f=i.rowDragAndDropModule.treeGridData;if(!(0,t.isNullOrUndefined)(f))for(p=0;p<f.length;p++)if(f[parseInt(p.toString(),10)].index=p,!(0,t.isNullOrUndefined)(f[parseInt(p.toString(),10)].parentItem)){var y=(0,t.getValue)("uniqueIDCollection."+f[parseInt(p.toString(),10)].parentUniqueID+".index",i);f[parseInt(p.toString(),10)].parentItem.index=y}r.grid.refresh(),i.grid.refresh(),i.grid.dataSource.length>1&&(i.grid.refresh(),(0,t.isNullOrUndefined)(i.getHeaderContent().querySelector(".e-firstrow-border"))||i.getHeaderContent().querySelector(".e-firstrow-border").remove(),(0,t.isNullOrUndefined)(i.getContent().querySelector(".e-lastrow-border"))||i.getContent().querySelector(".e-lastrow-border").remove())}tt(this.parent)&&(i=a.ej2_instances[0],r.grid.refresh(),i.grid.refresh())},e.prototype.getTargetIdx=function(e){return e?parseInt(e.getAttribute("aria-rowindex"),10)-1:0},e.prototype.getParentData=function(e,t){var i=e.parentItem,r=-1;if(this.parent.enableVirtualization&&-1!==this.parent.selectedRowIndex?r=this.parent.getSelectedRows()[0].rowIndex:-1!==this.parent.selectedRowIndex&&(r=this.parent.selectedRowIndex),"bottomSegment"===this.dropPosition){var n=this.parent.getPrimaryKeyFieldNames()[0],o=-1===r?this.parent.grid.getRowIndexByPrimaryKey(t[0][""+n]):this.parent.getSelectedRowIndexes()[0],a=this.parent.getCurrentViewRecords()[parseInt(o.toString(),10)];this.droppedRecord=pt(this.parent,a.parentItem.uniqueID)}"middleSegment"===this.dropPosition&&(this.parent.getCurrentViewRecords()[parseInt(r.toString(),10)].level===i.level?this.droppedRecord=pt(this.parent,i.uniqueID):this.getParentData(i))},e.prototype.dropRows=function(e,i){if("Invalid"!==this.dropPosition&&!et(this.parent)){var r,n=this.parent,o=void 0;if((0,t.isNullOrUndefined)(e.dropIndex)){var a=this.parent.getPrimaryKeyFieldNames()[0],s=-1===n.selectedRowIndex?this.parent.grid.getRowIndexByPrimaryKey(e.data[0][""+a])-1:n.getSelectedRowIndexes()[0]-1,d=n.getCurrentViewRecords()[parseInt(s.toString(),10)];this.getParentData(d,e.data)}else if(e.dropIndex=e.dropIndex===e.fromIndex?this.getTargetIdx(e.target.parentElement):e.dropIndex,this.parent.enableVirtualization){var l=this.parent.getRowByIndex(e.dropIndex).rowIndex;this.droppedRecord=n.getCurrentViewRecords()[parseInt(l.toString(),10)]}else if((0,t.isNullOrUndefined)(this.parent.rowDropSettings.targetID))this.droppedRecord=n.getCurrentViewRecords()[e.dropIndex];else{var p=this.parent.grid.getRowsObject();this.droppedRecord=p.length>0?p[e.dropIndex].data:void 0}var h=[];o=this.droppedRecord,e.data[0]?h=e.data:h.push(e.data),this.parent[this.modifiedRecords].push(e.data[0],o);var c=0,u=this.parent.rowDropSettings.targetID;this.isMultipleGrid=u,u?this.isaddtoBottom=u&&this.isDraggedWithChild:this.ensuredropPosition(h,o);var g=h.length;(!(0,t.isNullOrUndefined)(this.parent.idMapping)||"bottomSegment"===this.dropPosition&&h.length>1&&(0,t.isNullOrUndefined)(this.parent.idMapping))&&h.reverse();for(var f=function(a){if(r=h[parseInt(a.toString(),10)],y.draggedRecord=r,!y.draggedRecord.hasChildRecords)for(var s=0,d=h;s<d.length;s++){var l=d[s];(0,t.isNullOrUndefined)(l.childRecords)||-1===l.childRecords.indexOf(y.draggedRecord)||(y.draggedRecord=void 0)}if(!(0,t.isNullOrUndefined)(y.draggedRecord)){if("Invalid"!==y.dropPosition&&!(0,t.isNullOrUndefined)(y.droppedRecord)){if(n.rowDropSettings.targetID&&!i||y.deleteDragRow(),y.draggedRecord===y.droppedRecord){var p=y.getTargetIdx(e.target.offsetParent.parentElement);isNaN(p)&&(p=y.getTargetIdx(e.target.parentElement)),e.dropIndex=p,o=y.droppedRecord=y.parent.getCurrentViewRecords()[e.dropIndex]}if(o.parentItem||"middleSegment"===y.dropPosition)-1!==(S=(m=n.parentData).indexOf(y.draggedRecord))&&m.splice(S,1);var u=y.treeGridData.indexOf(o);if(y.dropAtTop(u),"bottomSegment"===y.dropPosition){if(o.hasChildRecords?(c=y.getChildCount(o,0),y.parent.parentIdMapping&&y.treeData.splice(u+c+1,0,y.draggedRecord.taskData),y.treeGridData.splice(u+c+1,0,y.draggedRecord)):(y.parent.parentIdMapping&&y.treeData.splice(u+1,0,y.draggedRecord.taskData),y.treeGridData.splice(u+1,0,y.draggedRecord)),(0,t.isNullOrUndefined)(o.parentItem)&&(delete r.parentItem,delete r.parentUniqueID,r.level=0,y.parent.parentIdMapping&&(r[y.parent.parentIdMapping]=null)),o.parentItem){var g=y.getChildrecordsByParentID(o.parentUniqueID)[0].childRecords,f=g.indexOf(o)+1;g.splice(f,0,r),r.parentItem=o.parentItem,r.parentUniqueID=o.parentUniqueID,r.level=o.level,y.parent.parentIdMapping&&(r[y.parent.parentIdMapping]=o[y.parent.parentIdMapping],r.parentItem=o.parentItem,r.level=o.level)}if(r.hasChildRecords){y.updateChildRecordLevel(r,1),y.updateChildRecord(r,u+c+1)}}y.dropMiddle(u)}if((0,t.isNullOrUndefined)(r.parentItem)){var m,S=(m=n.parentData).indexOf(y.droppedRecord),v=0;m.filter(function(e){r.uniqueID===e.uniqueID&&v++}),"bottomSegment"===y.dropPosition&&0===v?m.splice(S+1,0,r):"topSegment"===y.dropPosition&&0===v&&m.splice(S,0,r)}n.rowDragAndDropModule.refreshGridDataSource()}},y=this,m=0;m<g;m++)f(m)}},e.prototype.dropMiddle=function(e){var i=this.parent,r=at(this.droppedRecord),n=(0,t.isNullOrUndefined)(r)||0===r.length?e+1:r.length+e+1;"middleSegment"===this.dropPosition&&(i.parentIdMapping?(this.treeData.splice(n,0,this.draggedRecord.taskData),this.treeGridData.splice(n,0,this.draggedRecord)):this.treeGridData.splice(n,0,this.draggedRecord),this.recordLevel(),this.draggedRecord.hasChildRecords&&this.updateChildRecord(this.draggedRecord,n))},e.prototype.dropAtTop=function(e){var t=this.parent;if("topSegment"===this.dropPosition){t.parentIdMapping&&this.treeData.splice(e,0,this.draggedRecord.taskData);var i=this.treeGridData[parseInt(e.toString(),10)];if(this.draggedRecord.parentItem=i.parentItem,this.draggedRecord.parentUniqueID=i.parentUniqueID,this.draggedRecord.level=i.level,this.treeGridData.splice(parseInt(e.toString(),10),0,this.draggedRecord),this.draggedRecord.hasChildRecords){this.updateChildRecord(this.draggedRecord,e),this.updateChildRecordLevel(this.draggedRecord,1)}if(this.droppedRecord.parentItem){var r=this.getChildrecordsByParentID(this.droppedRecord.parentUniqueID)[0].childRecords,n=r.indexOf(this.droppedRecord);r.splice(n,0,this.draggedRecord)}}},e.prototype.recordLevel=function(){var e=this.parent,i=this.draggedRecord,r=this.droppedRecord,n=e.childMapping;if(r.hasChildRecords||(r.hasChildRecords=!0,r.hasFilteredChildRecords=!0,((0,t.isNullOrUndefined)(r.childRecords)||0===r.childRecords.length)&&(r.childRecords=[],!e.parentIdMapping&&(0,t.isNullOrUndefined)(r.taskData[""+n])&&(r.taskData[""+n]=[]))),"middleSegment"===this.dropPosition){var o=(0,t.extend)({},r);delete o.childRecords,i.parentItem=o,i.parentUniqueID=r.uniqueID,r.childRecords.splice(r.childRecords.length,0,i),(0,t.setValue)("uniqueIDCollection."+i.uniqueID,i,e);if(e.isSelfReference&&(r[e.childMapping]=[],r[e.childMapping].splice(r[e.childMapping].length,0,i)),(0,t.isNullOrUndefined)(i)||e.parentIdMapping||(0,t.isNullOrUndefined)(r.taskData[""+n])||r.taskData[e.childMapping].splice(r.childRecords.length,0,i.taskData),i.hasChildRecords){i.level=r.level+1,this.updateChildRecordLevel(i,1)}else i.level=r.level+1;r.expanded=!0}},e.prototype.deleteDragRow=function(){this.parent.dataSource instanceof Ze.DataManager&&st(this.parent)?(this.treeGridData=this.parent.grid.dataSource.dataSource.json,this.treeData=this.parent.dataSource.dataSource.json):(this.treeGridData=this.parent.grid.dataSource,this.treeData=this.parent.dataSource);var e=pt(this.parent,this.draggedRecord.uniqueID);!(0,t.isNullOrUndefined)(e.childRecords)&&e.childRecords.length&&(e.hasChildRecords=!0),this.removeRecords(e)},e.prototype.updateChildRecord=function(e,i){var r,n,o=this.parent;if(!e.hasChildRecords)return 0;n=e.childRecords.length;for(var a=0;a<n;a++)r=this.isMultipleGrid?e.childRecords[parseInt(a.toString(),10)]:(0,t.getValue)("uniqueIDCollection."+e.childRecords[parseInt(a.toString(),10)].uniqueID,o),i++,o.flatData.splice(i,0,r),(0,t.setValue)("uniqueIDCollection."+r.uniqueID,r,this.parent),o.parentIdMapping&&this.treeData.splice(i,0,r.taskData),r.hasChildRecords&&(i=this.updateChildRecord(r,i));return i},e.prototype.updateChildRecordLevel=function(e,i){var r,n;if(i++,!e.hasChildRecords)return 0;r=e.childRecords.length;for(var o=0;o<r;o++){n=this.isMultipleGrid?e.childRecords[parseInt(o.toString(),10)]:(0,t.getValue)("uniqueIDCollection."+e.childRecords[parseInt(o.toString(),10)].uniqueID,this.parent);var a=void 0;e.parentItem&&(a=pt(this.parent,e.parentItem.uniqueID)),(0,t.isNullOrUndefined)(a)&&!(0,t.isNullOrUndefined)(e.parentItem)&&(a=e.parentItem),n.level=e.parentItem?a.level+i:e.level+1,n.hasChildRecords&&(i--,i=this.updateChildRecordLevel(n,i))}return i},e.prototype.removeRecords=function(e){var i,r=this,n=this.parent;i=this.parent.dataSource instanceof Ze.DataManager&&st(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;var o=e,a=!(0,t.isNullOrUndefined)(n.parentIdMapping),s=this.getChildrecordsByParentID(o.parentUniqueID)[0];if(o){if(o.parentItem){var d=s?s.childRecords:[],l=0;d&&d.length>0&&(l=d.indexOf(o),s.childRecords.splice(l,1),this.parent.parentIdMapping&&!n.enableImmutableMode||zt({value:o,action:"delete"},this.parent,a,o.index,o.index))}if(n.parentIdMapping){o.hasChildRecords&&o.childRecords.length>0&&this.removeChildItem(o);var p=i.findIndex(function(e){return e[r.parent.idMapping]===o.taskData[r.parent.idMapping]}),h=this.treeGridData.findIndex(function(e){return e[r.parent.idMapping]===o.taskData[r.parent.idMapping]});-1===p||(0,t.isNullOrUndefined)(p)||i.splice(p,1),-1===h||(0,t.isNullOrUndefined)(h)||this.treeGridData.splice(h,1)}var c=this.treeGridData.indexOf(o);if(!n.parentIdMapping){var u=this.parent.parentData.indexOf(o);-1!==u&&(n.parentData.splice(u,1),i.splice(u,1))}if(-1===c&&!n.parentIdMapping)for(var g=n.getPrimaryKeyFieldNames()[0],f=0;f<this.treeGridData.length;f++)this.treeGridData[parseInt(f.toString(),10)][""+g]===o[""+g]&&(c=f);if(!n.parentIdMapping){var y=this.getChildCount(o,0);this.treeGridData.splice(c,y+1)}o.parentItem&&s&&s.childRecords&&!s.childRecords.length&&(s.expanded=!1,s.hasChildRecords=!1,s.hasFilteredChildRecords=!1),-1!==this.parent[this.modifiedRecords].indexOf(s)||(0,t.isNullOrUndefined)(s)||this.parent[this.modifiedRecords].push(s),(0,t.isNullOrUndefined)(s)||this.updateModifiedRecords(s)}},e.prototype.updateModifiedRecords=function(e){var i=pt(this.parent,e.parentUniqueID);(0,t.isNullOrUndefined)(i)||(this.parent[this.modifiedRecords].push(i),this.updateModifiedRecords(i))},e.prototype.removeChildItem=function(e){var i,r,n,o;o=this.parent.dataSource instanceof Ze.DataManager&&st(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;for(var a=0;a<e.childRecords.length;a++){i=e.childRecords[parseInt(a.toString(),10)],!(0,t.isNullOrUndefined)(i.childRecords)&&i.childRecords.length&&(i.hasChildRecords=!0);var s=void 0;s=this.parent.dataSource instanceof Ze.DataManager&&st(this.parent)?this.parent.dataSource.dataSource.json:this.parent.dataSource;for(var d=0;d<s.length;d++)s[parseInt(d.toString(),10)][this.parent.idMapping]===i.taskData[this.parent.idMapping]&&(r=d);for(var l=0;l<this.treeGridData.length;l++)if(this.treeGridData[parseInt(l.toString(),10)][this.parent.idMapping]===i.taskData[this.parent.idMapping]){n=l;break}-1===r||(0,t.isNullOrUndefined)(r)||o.splice(r,1),-1===n||(0,t.isNullOrUndefined)(n)||this.treeGridData.splice(n,1),i.hasChildRecords&&this.removeChildItem(i)}},e.prototype.getChildCount=function(e,t){var i;if(!e.hasChildRecords)return 0;for(var r=0;r<e.childRecords.length;r++)t++,(i=e.childRecords[parseInt(r.toString(),10)]).hasChildRecords&&(t=this.getChildCount(i,t));return t},e.prototype.ensuredropPosition=function(e,i){var r=this;e.filter(function(e){if(e.hasChildRecords&&!(0,t.isNullOrUndefined)(e.childRecords)){if(-1!==e.childRecords.indexOf(i))return r.dropPosition="Invalid",r.addErrorElem(),r.canDrop=!1,void((0,t.isNullOrUndefined)(r.parent.rowDropSettings.targetID)&&(r.removetopOrBottomBorder(),r.removeChildBorder()));r.ensuredropPosition(e.childRecords,i)}})},e.prototype.isDuplicateData=function(e){var t=this.parent.getPrimaryKeyFieldNames();return 0!==t.length&&this.parent.flatData.some(function(i){return t.every(function(t){return i[t]===e[t]})})},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(Ue,this.Rowdraging),this.parent.off(qe,this.rowDropped),this.parent.off(Ee,this.rowsAdded),this.parent.off(Ne,this.rowsRemoved))},e.prototype.getModuleName=function(){return"rowDragAndDrop"},e}(),ei=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ti=function(e,t,i,r){var n,o=arguments.length,a=o<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,i,r);else for(var s=e.length-1;s>=0;s--)(n=e[s])&&(a=(o<3?n(a):o>3?n(t,i,a):n(t,i))||a);return o>3&&a&&Object.defineProperty(t,i,a),a},ii=function(e){function i(){return null!==e&&e.apply(this,arguments)||this}return ei(i,e),ti([(0,t.Property)()],i.prototype,"targetID",void 0),i}(t.ChildProperty),ri=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),ni=function(e){function i(t){var i=e.call(this,t)||this;return i.addEventListener(),i}return ri(i,e),i.prototype.addEventListener=function(){this.parent.on(Ie,this.getDatas,this)},i.prototype.getDatas=function(e){this.visualData=e.data},i.prototype.getDataInfo=function(){return e.prototype.getData.call(this)},i.prototype.generateRows=function(i,r){var n=this.getDataInfo();if("refresh"===r.requestType&&r.isExpandCollapse&&(r.virtualInfo=this.prevInfo),(0,t.isNullOrUndefined)(r.virtualInfo)||this.parent.root.loadChildOnDemand&&et(this.parent.root)||("right"!==r.virtualInfo.direction&&"left"!==r.virtualInfo.direction?et(this.parent.root)&&!tt(this.parent)&&1!==r.virtualInfo.blockIndexes.length||(r.virtualInfo.blockIndexes=n.blockIndexes):r.virtualInfo.blockIndexes=this.getBlockIndexes(r.virtualInfo.page)),this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||tt(this.parent))return e.prototype.generateRows.call(this,i,r);(0,t.isNullOrUndefined)(r.requestType)||"collapseAll"!==r.requestType.toString()||(r.requestType="refresh");var o=e.prototype.generateRows.call(this,i,r);if(!(0,t.isNullOrUndefined)(this.visualData))for(var a=0;a<o.length;a++)o[parseInt(a.toString(),10)].index=this.visualData.indexOf(o[parseInt(a.toString(),10)].data);return o},i.prototype.checkAndResetCache=function(e){var t=["paging","refresh","sorting","filtering","searching","reorder","save","delete"].some(function(t){return e===t});if(this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||tt(this.parent)){var i=this.model.currentPage;t?(this.cache={},this.data={},this.groups={}):"virtualscroll"===e&&this.cache[parseInt(i.toString(),10)]&&this.cache[parseInt(i.toString(),10)].length>this.parent.contentModule.getBlockSize()&&this.cache[parseInt(i.toString(),10)].length>this.parent.contentModule.getBlockSize()&&(this.cache[parseInt(i.toString(),10)]=this.cache[parseInt(i.toString(),10)].slice(0,this.parent.contentModule.getBlockSize()))}else(t||"virtualscroll"===e)&&(this.cache={},this.data={},this.groups={});return t},i}(l.VirtualRowModelGenerator),oi=function(){function e(e){l.Grid.Inject(l.Filter),this.parent=e,this.isHierarchyFilter=!1,this.filteredResult=[],this.flatFilteredData=[],this.filteredParentRecs=[],this.addEventListener()}return e.prototype.getModuleName=function(){return"filter"},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.addEventListener=function(){this.parent.on("updateFilterRecs",this.updatedFilteredRecord,this),this.parent.on("clearFilters",this.clearFilterLevel,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateFilterRecs",this.updatedFilteredRecord),this.parent.off("clearFilters",this.clearFilterLevel))},e.prototype.updatedFilteredRecord=function(e){(0,t.setValue)("uniqueIDFilterCollection",{},this.parent),this.flatFilteredData=e.data,this.filteredParentRecs=[],this.filteredResult=[],this.isHierarchyFilter=!1;for(var i=""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode,r=0;r<this.flatFilteredData.length;r++){var n=this.flatFilteredData[parseInt(r.toString(),10)];this.addParentRecord(n),"Child"!==i&&"None"!==i||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||(this.isHierarchyFilter=!0);var o=(0,l.getObject)("childRecords",n);!(0,t.isNullOrUndefined)(o)&&o.length&&(0,t.setValue)("hasFilteredChildRecords",this.checkChildExsist(n),n);var a=(0,l.getObject)("parentItem",n);if(!(0,t.isNullOrUndefined)(a)){var s=pt(this.parent,n.parentItem.uniqueID,!0);(0,t.setValue)("hasFilteredChildRecords",!0,s),s&&s.parentItem&&this.updateParentFilteredRecord(s)}}this.flatFilteredData.length>0&&this.isHierarchyFilter&&this.updateFilterLevel(),this.parent.notify("updateAction",{result:this.filteredResult})},e.prototype.updateParentFilteredRecord=function(e){var i=pt(this.parent,e.parentItem.uniqueID,!0),r=(0,t.getValue)("uniqueIDFilterCollection",this.parent);i&&Object.prototype.hasOwnProperty.call(r,i.uniqueID)&&(0,t.setValue)("hasFilteredChildRecords",!0,i),i&&i.parentItem&&this.updateParentFilteredRecord(i)},e.prototype.addParentRecord=function(e){var i=pt(this.parent,e.parentUniqueID);if("None"!==(""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode)||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key){if(!(0,t.isNullOrUndefined)(i))("Child"!==(""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode)||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key||-1!==this.flatFilteredData.indexOf(i))&&this.addParentRecord(i);-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),(0,t.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent))}else if((0,t.isNullOrUndefined)(i)){if(-1!==this.flatFilteredData.indexOf(e))return void(-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),(0,t.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent),e.hasFilteredChildRecords=!0))}else this.addParentRecord(i),-1!==this.flatFilteredData.indexOf(i)||-1!==this.filteredResult.indexOf(i)?-1===this.filteredResult.indexOf(e)&&(this.filteredResult.push(e),(0,t.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent)):-1===this.filteredResult.indexOf(e)&&-1!==this.flatFilteredData.indexOf(e)&&(this.filteredResult.push(e),(0,t.setValue)("uniqueIDFilterCollection."+e.uniqueID,e,this.parent))},e.prototype.checkChildExsist=function(e){for(var i=(0,l.getObject)("childRecords",e),r=!1,n=0;n<i.length;n++){var o=i[parseInt(n.toString(),10)].childRecords,a=""===this.parent.grid.searchSettings.key?this.parent.filterSettings.hierarchyMode:this.parent.searchSettings.hierarchyMode;if(!("Child"!==a&&"Both"!==a||0===this.parent.grid.filterSettings.columns.length&&""===this.parent.grid.searchSettings.key)){var s=(0,t.getValue)("uniqueIDFilterCollection",this.parent);Object.prototype.hasOwnProperty.call(s,i[parseInt(n.toString(),10)].uniqueID)||(this.filteredResult.push(i[parseInt(n.toString(),10)]),(0,t.setValue)("uniqueIDFilterCollection."+i[parseInt(n.toString(),10)].uniqueID,i[parseInt(n.toString(),10)],this.parent),r=!0)}if("None"===a&&(0!==this.parent.grid.filterSettings.columns.length||""!==this.parent.grid.searchSettings.key)&&-1!==this.flatFilteredData.indexOf(i[parseInt(n.toString(),10)])){r=!0;break}!(0,t.isNullOrUndefined)(o)&&o.length&&(r=this.checkChildExsist(i[parseInt(n.toString(),10)])),"Child"!==a&&"Both"!==a||!i.length||(r=!0)}return r},e.prototype.updateFilterLevel=function(){for(var e=this.filteredResult,t=this.filteredResult.length,i=0;i<t;i++){var r=pt(this.parent,e[parseInt(i.toString(),10)].parentUniqueID);if(-1!==e.indexOf(r)){var n=pt(this.parent,e[parseInt(i.toString(),10)].parentUniqueID,!0);e[parseInt(i.toString(),10)].filterLevel=n.filterLevel+1}else e[parseInt(i.toString(),10)].filterLevel=0,this.filteredParentRecs.push(e[parseInt(i.toString(),10)])}},e.prototype.clearFilterLevel=function(e){for(var i,r=0,n=e.flatData,o=n.length;r<o;r++){var a=(i=n[parseInt(r.toString(),10)]).filterLevel;!a&&0!==a&&(0,t.isNullOrUndefined)(i.hasFilteredChildRecords)||(i.hasFilteredChildRecords=null,i.filterLevel=null)}this.filteredResult=[],this.parent.notify("updateResults",{result:n,count:n.length})},e}(),ai=function(){function e(e){this.isCollapsedStatePersist=!1,l.Grid.Inject(l.ExcelExport),this.parent=e,this.dataResults={},this.addEventListener()}return e.prototype.getModuleName=function(){return"ExcelExport"},e.prototype.addEventListener=function(){this.parent.on("updateResults",this.updateExcelResultModel,this),this.parent.on("excelCellInfo",this.excelQueryCellInfo,this),this.parent.grid.on("export-RowDataBound",this.exportRowDataBound,this),this.parent.on("excelAggregateCellInfo",this.excelAggregateCellInfo,this),this.parent.grid.on("finalPageSetup",this.finalPageSetup,this)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateResults",this.updateExcelResultModel),this.parent.off("excelCellInfo",this.excelQueryCellInfo),this.parent.grid.off("export-RowDataBound",this.exportRowDataBound),this.parent.off("excelAggregateCellInfo",this.excelAggregateCellInfo),this.parent.grid.off("finalPageSetup",this.finalPageSetup))},e.prototype.updateExcelResultModel=function(e){this.dataResults=e},e.prototype.Map=function(e,i,r,n,o){var a=this,s=this.parent.dataSource,d=new l.Data(this.parent.grid),p=Object();if((0,t.setValue)("isCsv",o,p),(0,t.setValue)("cancel",!1,p),(0,t.isNullOrUndefined)(e)||(this.isCollapsedStatePersist=e.isCollapsedStatePersist),!(0,t.isNullOrUndefined)(e)){if(!this.isLocal()&&!(0,t.isNullOrUndefined)(e.dataSource)&&!e.dataSource.dataSource)return this.parent.grid.excelExportModule.Map(this.parent.grid,e,i,r,o,n);if("CurrentPage"===e.exportType)return e.dataSource=this.parent.getCurrentViewRecords(),this.parent.grid.excelExportModule.Map(this.parent.grid,e,i,r,o,n)}return new Promise(function(h){var c=!a.isLocal()||s instanceof Ze.DataManager?a.parent.dataSource:new Ze.DataManager(s),u=new Ze.Query;if(a.isLocal()||((u=a.generateQuery(u)).queries=a.parent.grid.getDataModule().generateQuery().queries,u=l.ExportHelper.getQuery(a.parent.grid,d),(0,t.isNullOrUndefined)(a.parent.filterModule)&&(u.queries=u.queries.slice(1,2),u.params=u.params.slice(0,0)),(0,t.setValue)("query",u,p)),a.parent.trigger(z,(0,t.extend)(p,e)),(0,l.getObject)("cancel",p))return null;c.executeQuery(u).then(function(d){var l=null;return(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.dataSource)||(l=e.dataSource),e=a.manipulateExportProperties(e,s,d),a.parent.grid.excelExportModule.Map(a.parent.grid,e,i,r,o,n).then(function(t){null!=l?e.dataSource=l:delete e.dataSource,h(t)})})})},e.prototype.generateQuery=function(e,i){return!(0,t.isNullOrUndefined)(i)&&"CurrentPage"===i.exportType&&this.parent.allowPaging&&(i.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=(0,l.getObject)("grid.renderModule.data.pageQuery",this.parent)(e)),e},e.prototype.manipulateExportProperties=function(e,i,r){var n=Object();if((0,t.isNullOrUndefined)(this.parent.grid.getDataModule())||(0,t.setValue)("query",this.parent.grid.getDataModule().generateQuery(!0),n),(0,t.setValue)("isExport",!0,n),(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.exportType)||(0,t.setValue)("exportType",e.exportType,n),this.isLocal()||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData((0,l.getObject)("result",r)),(0,t.setValue)("expresults",this.parent.flatData,n)),this.parent.notify("dataProcessor",n),n=this.dataResults,i=(0,t.isNullOrUndefined)(n.result)?this.parent.flatData.slice(0):n.result,this.isLocal()||(this.parent.flatData=[]),e&&e.dataSource){var o=this.parent.flatData,a=e.dataSource instanceof Ze.DataManager?e.dataSource.dataSource.json:e.dataSource;this.parent.dataModule.convertToFlatData(a),i=this.parent.flatData,this.parent.flatData=o}return(e=(0,t.isNullOrUndefined)(e)?Object():e).dataSource=new Ze.DataManager({json:i}),this.parent.aggregates.length>0&&(e.query=n.query),e},e.prototype.excelQueryCellInfo=function(e){if(this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex){var i={},r=e.data,n=(0,t.isNullOrUndefined)(r.filterLevel)?r.level:r.filterLevel;i.indent=n,e.style=i}this.parent.notify("updateResults",e),this.parent.trigger("excelQueryCellInfo",e)},e.prototype.excelAggregateCellInfo=function(e){this.parent.trigger("excelAggregateQueryCellInfo",e)},e.prototype.exportRowDataBound=function(e){if("excel"===e.type){var i=e.rowObj.data,r=this.parent.grid.filterSettings.columns.length,n=e.excelRows.length,o=i.level;if(i.parentItem&&pt(this.parent,i.parentItem.uniqueID,Boolean(r))){var a=!1,s=!1,d=ot(this.parent,i,this.parent.parentData);!this.isCollapsedStatePersist||d&&this.parent.isLocalData||(a=!0,s=!i.expanded),e.excelRows[n-1].grouping={outlineLevel:o,isCollapsed:s,isHidden:a}}else i.hasChildRecords&&(0,t.isNullOrUndefined)(i.parentItem)&&(e.excelRows[n-1].grouping={outlineLevel:o})}},e.prototype.finalPageSetup=function(e){for(var t=0;t<e.worksheets.length;t++)e.worksheets[parseInt(t.toString(),10)].rows&&(e.worksheets[parseInt(t.toString(),10)].pageSetup={isSummaryRowBelow:!1})},e.prototype.isLocal=function(){return!et(this.parent)&&st(this.parent)},e}(),si=function(){function e(e){l.Grid.Inject(l.PdfExport),this.parent=e,this.dataResults={},this.addEventListener()}return e.prototype.getModuleName=function(){return"PdfExport"},e.prototype.addEventListener=function(){this.parent.on("pdfCellInfo",this.pdfQueryCellInfo,this),this.parent.on("updateResults",this.updatePdfResultModel,this),this.parent.on("pdfAggregateCellInfo",this.pdfAggregateCellInfo,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("pdfCellInfo",this.pdfQueryCellInfo),this.parent.off("updateResults",this.updatePdfResultModel),this.parent.off("pdfAggregateCellInfo",this.pdfAggregateCellInfo))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.updatePdfResultModel=function(e){this.dataResults=e},e.prototype.Map=function(e,i,r,n){var o=this,a=this.parent.dataSource,s=Object(),d=!et(this.parent)&&st(this.parent);return(0,t.setValue)("cancel",!1,s),new Promise(function(p){var h=!d||a instanceof Ze.DataManager?o.parent.dataSource:new Ze.DataManager(a),c=new Ze.Query;if(d||(c=o.generateQuery(c),(0,t.setValue)("query",c,s)),o.parent.trigger(L,(0,t.extend)(s,e)),(0,l.getObject)("cancel",s))return null;h.executeQuery(c).then(function(s){var d=null;return(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.dataSource)||(d=e.dataSource),e=o.manipulatePdfProperties(e,a,s),o.parent.grid.pdfExportModule.Map(o.parent.grid,e,i,r,n).then(function(t){null!=d?e.dataSource=d:delete e.dataSource,p(t)})})})},e.prototype.generateQuery=function(e,i){return!(0,t.isNullOrUndefined)(i)&&"CurrentPage"===i.exportType&&this.parent.allowPaging&&(i.exportType="AllPages",e.addParams("ExportType","CurrentPage"),e.where(this.parent.parentIdMapping,"equal",null),e=(0,l.getObject)("grid.renderModule.data.pageQuery",this.parent)(e)),e},e.prototype.manipulatePdfProperties=function(e,i,r){var n={},o=!et(this.parent)&&st(this.parent);if((0,t.setValue)("query",this.parent.grid.getDataModule().generateQuery(!0),n),(0,t.setValue)("isExport",!0,n),(0,t.setValue)("isPdfExport",!0,n),(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.isCollapsedStatePersist)||(0,t.setValue)("isCollapsedStatePersist",e.isCollapsedStatePersist,n),(0,t.isNullOrUndefined)(e)||(0,t.isNullOrUndefined)(e.exportType)||(0,t.setValue)("exportType",e.exportType,n),o||(this.parent.parentData=[],this.parent.dataModule.convertToFlatData((0,t.getValue)("result",r)),(0,t.setValue)("expresults",this.parent.flatData,n)),this.parent.notify("dataProcessor",n),n=this.dataResults,i=(0,t.isNullOrUndefined)(n.result)?this.parent.flatData.slice(0):n.result,o||(this.parent.flatData=[]),e&&e.dataSource&&o){var a=this.parent.flatData,s=e.dataSource instanceof Ze.DataManager?e.dataSource.dataSource.json:e.dataSource;this.parent.dataModule.convertToFlatData(s),i=this.parent.flatData,this.parent.flatData=a}return(e=(0,t.isNullOrUndefined)(e)?{}:e).dataSource=new Ze.DataManager({json:i}),e.query=n.query,e},e.prototype.pdfQueryCellInfo=function(e){if(this.parent.grid.getColumnIndexByUid(e.column.uid)===this.parent.treeColumnIndex){var i={},r=(0,l.getObject)("data",e),n=(0,t.isNullOrUndefined)(r.filterLevel)?r.level:r.filterLevel;i.paragraphIndent=3*n,e.style=i}this.parent.notify("updateResults",e),this.parent.trigger("pdfQueryCellInfo",e)},e.prototype.pdfAggregateCellInfo=function(e){this.parent.trigger("pdfAggregateQueryCellInfo",e)},e}(),di=function(){function e(e){l.Grid.Inject(l.Page),this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on(K,this.collapseExpandPagedchilds,this),this.parent.on(W,this.pageAction,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(K,this.collapseExpandPagedchilds),this.parent.off(W,this.pageAction))},e.prototype.getModuleName=function(){return"pager"},e.prototype.refresh=function(){this.parent.grid.pagerModule.refresh()},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.goToPage=function(e){this.parent.grid.pagerModule.goToPage(e)},e.prototype.updateExternalMessage=function(e){if((0,t.isNullOrUndefined)(e)){this.parent.trigger(Ye,{error:"The provided value for the message is undefined. Please ensure the message contains string."})}this.parent.grid.pagerModule.updateExternalMessage(e)},e.prototype.collapseExpandPagedchilds=function(e){if(e.record.expanded="collapse"!==e.action,this.parent.flatData.map(function(t){return t.expanded=t.uniqueID===e.record.uniqueID&&t.expanded!==e.record.expanded?e.record.expanded:t.expanded}),this.parent.enableImmutableMode){var i=this.parent.getPrimaryKeyFieldNames()[0],r=this.parent.flatData.filter(function(t){return t[""+i]===e.record[""+i]});r.length&&(r[0].expanded=e.record.expanded)}var n={result:this.parent.flatData,row:e.row,action:e.action,record:e.record,count:this.parent.flatData.length};if((0,t.getValue)("grid.renderModule",this.parent).dataManagerSuccess(n),this.parent.enableImmutableMode){var o="action",a=void 0;"collapse"===n[""+o]?(a=n.row.getElementsByClassName("e-treegridexpand")[0],(0,t.isNullOrUndefined)(a)||((0,t.removeClass)([a],"e-treegridexpand"),(0,t.addClass)([a],"e-treegridcollapse"))):"expand"===n[""+o]&&(a=n.row.getElementsByClassName("e-treegridcollapse")[0],(0,t.isNullOrUndefined)(a)||((0,t.removeClass)([a],"e-treegridcollapse"),(0,t.addClass)([a],"e-treegridexpand")))}},e.prototype.pageRoot=function(e,i,r){for(var n=(0,t.isNullOrUndefined)(r)?[]:r,o=function(t){n.push(i[parseInt(t.toString(),10)]);var r=[];i[parseInt(t.toString(),10)].hasChildRecords&&(r=e.filter(function(e){return i[parseInt(t.toString(),10)].uniqueID===e.parentUniqueID}),n=a.pageRoot(e,r,n))},a=this,s=0;s<i.length;s++)o(s);return n},e.prototype.updatePageSize=function(e){var t=e.count,i=this.parent.grid.pagerModule;!0===this.parent.pageSettings.pageSizes&&i.pagerObj.pagerdropdownModule.dropDownListObject.value===i.pagerObj.getLocalizedLabel("All")&&(i.pagerObj.totalRecordsCount=t,this.parent.grid.pageSettings.pageSize=t)},e.prototype.pageAction=function(e){var t=this,i=new Ze.DataManager(e.result);if("Root"===this.parent.pageSettings.pageSizeMode){var r=[],n=this.parent.grid.filterSettings.columns.length>0&&("Child"===this.parent.filterSettings.hierarchyMode||"None"===this.parent.filterSettings.hierarchyMode)?"filterLevel":"level",o=(new Ze.Query).where(n,"equal",0);r=i.executeLocal(o),e.count=r.length;var a=(c=this.parent.grid.pageSettings.pageSize)*((u=this.parent.grid.pageSettings.currentPage)-1);o=o.skip(a).take(c),r=i.executeLocal(o);var s=this.pageRoot(e.result,r);e.result=s}else{var d=new Ze.DataManager(e.result),l=new Ze.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),p=d.executeLocal((new Ze.Query).where(l)),h=void 0;h=rt(this.parent)&&"collapse"!==e.actionArgs.action&&"expand"!==e.actionArgs.action?p:p.filter(function(e){return ot(t.parent,e,p)}),e.count=h.length;o=new Ze.Query;var c=this.parent.grid.pageSettings.pageSize;this.updatePageSize(e);var u=this.parent.grid.pageSettings.currentPage;h.length<u*c&&(u=(u=Math.floor(h.length/c)+(h.length%c?1:0))||1,this.parent.grid.setProperties({pageSettings:{currentPage:u}},!0));a=c*(u-1);o=o.skip(a).take(c),d.dataSource.json=h,e.result=d.executeLocal(o)}this.parent.notify("updateAction",e)},e}(),li=function(){function e(e){l.Grid.Inject(l.Toolbar),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"toolbar"},e.prototype.addEventListener=function(){this.parent.on(k,this.refreshToolbar,this),this.parent.on(V,this.refreshToolbar,this),this.parent.on(B,this.toolbarClickHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(k,this.refreshToolbar),this.parent.off(V,this.refreshToolbar),this.parent.off(B,this.toolbarClickHandler))},e.prototype.refreshToolbar=function(e){var i=this.parent.grid.toolbarModule.getToolbar();if(!(0,t.isNullOrUndefined)(i)){var r=this.parent,n=void 0,o=void 0,a=r.element.id+"_gridcontrol_indent",s=r.element.id+"_gridcontrol_outdent",d=i.querySelector("#"+a),l=i.querySelector("#"+s),p=e.row,h=r.getSelectedRows()[0];if((0,t.isNullOrUndefined)(p[0])||(p=p[0]),p=(0,t.isNullOrUndefined)(h)||h.rowIndex===p.rowIndex?p:h,null!==d&&null!==l){if(n=d.parentElement,o=l.parentElement,0===p.rowIndex||r.getSelectedRowIndexes().length>1)n.classList.add("e-hidden"),o.classList.add("e-hidden");else if("rowDeselected"!==e.name||!(0,t.isNullOrUndefined)(h)&&r.grid.isCheckBoxSelection){var c=r.getCurrentViewRecords()[p.rowIndex];(0,t.isNullOrUndefined)(c)||(c.level>r.getCurrentViewRecords()[p.rowIndex-1].level?n.classList.add("e-hidden"):n.classList.remove("e-hidden"),c.level===r.getCurrentViewRecords()[p.rowIndex-1].level&&n.classList.remove("e-hidden"),0===c.level&&o.classList.add("e-hidden"),0!==c.level&&o.classList.remove("e-hidden"))}"rowDeselected"===e.name&&(0,t.isNullOrUndefined)(h)&&!r.grid.isCheckBoxSelection&&(this.parent.toolbar.includes("Indent")&&n.classList.add("e-hidden"),this.parent.toolbar.includes("Outdent")&&o.classList.add("e-hidden"))}}},e.prototype.toolbarClickHandler=function(e){var i=this.parent,r="indentOutdentAction";"Cell"===this.parent.editSettings.mode&&"Batch"===this.parent.grid.editSettings.mode&&e.item.id===this.parent.grid.element.id+"_update"&&(e.cancel=!0,this.parent.grid.editModule.saveCell()),e.item.id===this.parent.grid.element.id+"_expandall"&&this.parent.expandAll(),e.item.id===this.parent.grid.element.id+"_collapseall"&&this.parent.collapseAll(),e.item.id===i.grid.element.id+"_indent"&&i.getSelectedRecords().length&&!(0,t.isNullOrUndefined)(i.rowDragAndDropModule)&&this.parent.rowDragAndDropModule[""+r](null,"indent"),e.item.id===i.grid.element.id+"_outdent"&&i.getSelectedRecords().length&&!(0,t.isNullOrUndefined)(i.rowDragAndDropModule)&&this.parent.rowDragAndDropModule[""+r](null,"outdent")},e.prototype.getToolbar=function(){return this.parent.grid.toolbarModule.getToolbar()},e.prototype.enableItems=function(e,t){this.parent.grid.toolbarModule.enableItems(e,t)},e.prototype.destroy=function(){this.removeEventListener()},e}(),pi=function(){function e(e){l.Grid.Inject(l.Aggregate),this.parent=e,this.flatChildRecords=[],this.summaryQuery=[]}return e.prototype.getModuleName=function(){return"summary"},e.prototype.removeEventListener=function(){this.parent.isDestroyed},e.prototype.calculateSummaryValue=function(e,i,r){var n;this.summaryQuery=e;var o,a=i.filter(function(e){return!(0,l.getObject)("isSummaryRow",e)}),s=nt(a),d=a.slice(),p=Object.keys(this.parent.aggregates).length,h=Object.keys(s).length,c=this.parent.getColumns();if(this.parent.aggregates.filter(function(e){return e.showChildSummary}).length){for(var u=0,g=h;u<g;u++)if(n=s[parseInt(u.toString(),10)],o=this.getChildRecordsLength(n,d)){for(var f=function(e,i){var a,s=void 0;s={};for(var p=0;p<c.length;p++){s[""+((0,t.isNullOrUndefined)((0,l.getObject)("field",c[parseInt(p.toString(),10)]))?c[parseInt(p.toString(),10)]:(0,l.getObject)("field",c[parseInt(p.toString(),10)]))]=null}if(s=y.createSummaryItem(s,y.parent.aggregates[e-1]),!y.parent.aggregates[e-1].showChildSummary)return"continue";d.map(function(e,t){e.uniqueID!==n.uniqueID||(a=t)});var h=a+o+e,u=(0,t.extend)({},n);delete u.childRecords,delete u[y.parent.childMapping],(0,t.setValue)("parentItem",u,s);var g=(0,l.getObject)("level",u);if((0,t.setValue)("level",g+1,s),(0,t.setValue)("isSummaryRow",!0,s),(0,t.setValue)("parentUniqueID",u.uniqueID,s),r){var f=(0,l.getObject)("childRecords",n);f.length&&f.push(s)}d.splice(h,0,s)},y=this,m=1,S=p;m<=S;m++)f(m);this.flatChildRecords=[]}}else{for(var v={},w=0,I=c.length;w<I;w++){v[""+((0,t.isNullOrUndefined)((0,l.getObject)("field",c[parseInt(w.toString(),10)]))?c[parseInt(w.toString(),10)]:(0,l.getObject)("field",c[parseInt(w.toString(),10)]))]=null}m=1;for(var R=p;m<=R;m++)this.createSummaryItem(v,this.parent.aggregates[m-1])}return d},e.prototype.getChildRecordsLength=function(e,i){for(var r,n=0,o=Object.keys(i).length;n<o;n++){if(r=i[parseInt(n.toString(),10)],e===((0,t.isNullOrUndefined)(r.parentItem)?null:i.filter(function(e){return e.uniqueID===r.parentItem.uniqueID})[0])){if(this.flatChildRecords.push(r),!(0,l.getObject)("hasChildRecords",r))continue;this.getChildRecordsLength(r,i)}}return this.flatChildRecords.length},e.prototype.createSummaryItem=function(e,i){for(var r=0,n=Object.keys(i.columns).length;r<n;r++)for(var o=(0,t.isNullOrUndefined)(i.columns[parseInt(r.toString(),10)].columnName)?i.columns[parseInt(r.toString(),10)].field:i.columns[parseInt(r.toString(),10)].columnName,a=0,s=Object.keys(e);a<s.length;a++){var d=s[a];if(d===o)if(this.flatChildRecords.length)e[""+d]=this.getSummaryValues(i.columns[parseInt(r.toString(),10)],this.flatChildRecords);else if(this.parent.isLocalData){var l=this.parent.dataSource instanceof Ze.DataManager?this.parent.dataSource.dataSource.json:this.parent.flatData;e[""+d]=this.getSummaryValues(i.columns[parseInt(r.toString(),10)],l)}}return e},e.prototype.getSummaryValues=function(e,i){var r=new Ze.Query,n={},o={},a=(0,t.isNullOrUndefined)(e.field)?void 0:this.parent.getColumnByField(e.field).type;e.setPropertiesSilent({format:this.getFormatFromType(e.format,a)}),e.setFormatter(this.parent.grid.locale);var s=e.getFormatter()||function(e){return e};e.setTemplate(o);var d=e.getTemplate(2);r.queries=this.summaryQuery,r.requiresCount();var p,h=new Ze.DataManager(i).executeLocal(r),c=e.type;c=[e.type];for(var u=0;u<c.length;u++){p=c[parseInt(u.toString(),10)];var g=e.field+" - "+c[parseInt(u.toString(),10)].toLowerCase(),f="Custom"!==c[parseInt(u.toString(),10)]?(0,l.getObject)("aggregates",h):(0,l.calculateAggregate)(c[parseInt(u.toString(),10)],h,e,this.parent),y=e.columnName,m="Custom"!==c[parseInt(u.toString(),10)]?f[""+g]:f;n[""+y]=n[""+y]||{},n[""+y][""+g]=m,n[""+y][c[parseInt(u.toString(),10)]]=(0,t.isNullOrUndefined)(f)?" ":s(m)}o.format=e.getFormatter();var S=(0,t.createElement)("td",{className:"e-summary"});if(this.parent.isReact&&"string"!=typeof e.footerTemplate){d.fn(n[e.columnName],this.parent,d.property,"",null,null,S),this.parent.renderReactTemplates()}else(0,l.appendChildren)(S,d.fn(n[e.columnName],this.parent,d.property));var v=n[""+e.columnName][""+p];return-1===S.innerHTML.indexOf(v)?S.innerHTML+v:S.innerHTML},e.prototype.getFormatFromType=function(e,i){if((0,t.isNullOrUndefined)(i)||"string"!=typeof e)return e;var r;switch(i){case"number":r={format:e};break;case"datetime":r={type:"dateTime",skeleton:e};break;case"date":r={type:i,skeleton:e}}return r},e.prototype.destroy=function(){this.removeEventListener()},e}(),hi=function(){function e(e){l.Grid.Inject(l.Sort),this.parent=e,this.taskIds=[],this.flatSortedData=[],this.storedIndex=-1,this.isSelfReference=!(0,t.isNullOrUndefined)(this.parent.parentIdMapping),this.addEventListener()}return e.prototype.getModuleName=function(){return"sort"},e.prototype.addEventListener=function(){this.parent.on("updateModel",this.updateModel,this),this.parent.on("createSort",this.createdSortedRecords,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("updateModel",this.updateModel),this.parent.off("createSort",this.createdSortedRecords))},e.prototype.createdSortedRecords=function(e){var t=e.modifiedData,i=e.srtQry;this.iterateSort(t,i),this.storedIndex=-1,e.modifiedData=this.flatSortedData,this.flatSortedData=[]},e.prototype.iterateSort=function(e,i){var r=this.parent.query,n=[];(0,t.isNullOrUndefined)(r)||(n=r.queries.filter(function(e){return"onWhere"===e.fn}));for(var o=0;o<e.length;o++)if((n.length>0||this.parent.grid.filterSettings.columns.length>0||""!==this.parent.grid.searchSettings.key)&&(0,t.isNullOrUndefined)(pt(this.parent,e[parseInt(o.toString(),10)].uniqueID,!0))||(this.storedIndex++,this.flatSortedData[this.storedIndex]=e[parseInt(o.toString(),10)]),e[parseInt(o.toString(),10)].hasChildRecords){var a=new Ze.DataManager(e[parseInt(o.toString(),10)].childRecords).executeLocal(i);if(this.parent.allowRowDragAndDrop&&-1!==e[parseInt(o.toString(),10)].childRecords.indexOf(this.parent.rowDragAndDropModule.draggedRecord)&&"middleSegment"!==this.parent.rowDragAndDropModule.dropPosition){var s=a.indexOf(this.parent.rowDragAndDropModule.draggedRecord);a.splice(s,1);var d=a.indexOf(this.parent.rowDragAndDropModule.droppedRecord);"topSegment"===this.parent.rowDragAndDropModule.dropPosition?a.splice(d,0,this.parent.rowDragAndDropModule.draggedRecord):"bottomSegment"===this.parent.rowDragAndDropModule.dropPosition&&a.splice(d+1,0,this.parent.rowDragAndDropModule.draggedRecord)}this.iterateSort(a,i)}},e.prototype.sortColumn=function(e,t,i){this.parent.grid.sortColumn(e,t,i)},e.prototype.removeSortColumn=function(e){this.parent.grid.removeSortColumn(e)},e.prototype.updateModel=function(){this.parent.setProperties({sortSettings:(0,l.getActualProperties)(this.parent.grid.sortSettings)},!0)},e.prototype.clearSorting=function(){this.parent.grid.clearSorting(),this.updateModel()},e.prototype.destroy=function(){this.removeEventListener()},e}(),ci=function(){function e(e){l.Grid.Inject(l.ColumnMenu),this.parent=e}return e.prototype.getColumnMenu=function(){return this.parent.grid.columnMenuModule.getColumnMenu()},e.prototype.destroy=function(){},e.prototype.getModuleName=function(){return"columnMenu"},e}(),ui=function(){function e(e){l.Grid.Inject(l.ContextMenu),this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("contextMenuOpen",this.contextMenuOpen,this),this.parent.on("contextMenuClick",this.contextMenuClick,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("contextMenuOpen",this.contextMenuOpen),this.parent.off("contextMenuClick",this.contextMenuClick))},e.prototype.contextMenuOpen=function(e){var i=(0,t.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_AddRow",e.element),r=(0,t.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_Edit",e.element),n=(0,t.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_Indent",e.element),o=(0,t.select)("#"+this.parent.element.id+"_gridcontrol_cmenu_Outdent",e.element);i&&(!1===this.parent.grid.editSettings.allowAdding||this.parent.grid.isEdit?i.style.display="none":i.style.display="block"),"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||(0,t.isNullOrUndefined)(r)||r.classList.contains("e-menu-hide")||(r.style.display="none");var a=this.parent,s=a.getSelectedRows()[0];if(!n&&!o||(0,t.isNullOrUndefined)(s)){if((n||o||a.grid.isEdit)&&(0,t.isNullOrUndefined)(s)){for(var d=0,l=e.items;d<l.length;d++){"Outdent"!==(g=l[d]).text&&"Indent"!==g.text||a.grid.contextMenuModule.hiddenItems.includes(g.text)||a.grid.contextMenuModule.hiddenItems.push(g.text)}a.grid.contextMenuModule.contextMenu.hideItems(a.grid.contextMenuModule.hiddenItems),(n||o)&&(n.style.display=o.style.display="none")}}else{var p=e.event.target.closest("td");if(!(0,t.isNullOrUndefined)(p)&&((0,t.isNullOrUndefined)(p)||p.classList.contains("e-rowcell")&&0===p.querySelectorAll(".e-gridform").length)){if(0===s.rowIndex||a.getSelectedRowIndexes().length>1)n.style.display=o.style.display="none";else if("rowDeselected"!==e.name||!(0,t.isNullOrUndefined)(s)&&a.grid.isCheckBoxSelection){var h=a.getCurrentViewRecords()[s.rowIndex];(0,t.isNullOrUndefined)(h)||(h.level>a.getCurrentViewRecords()[s.rowIndex-1].level?n.style.display="none":n.style.display="block",h.level===a.getCurrentViewRecords()[s.rowIndex-1].level&&(n.style.display="block"),0===h.level?o.style.display="none":o.style.display="block")}}else{for(var c=0,u=e.items;c<u.length;c++){var g;"Outdent"!==(g=u[c]).text&&"Indent"!==g.text||a.grid.contextMenuModule.hiddenItems.push(g.text)}a.grid.contextMenuModule.contextMenu.hideItems(a.grid.contextMenuModule.hiddenItems),n.style.display=o.style.display="none"}}},e.prototype.contextMenuClick=function(e){if("Above"!==e.item.id&&"Below"!==e.item.id&&"Child"!==e.item.id||(this.parent.notify("savePreviousRowPosition",e),this.parent.setProperties({editSettings:{newRowPosition:e.item.id}},!0),this.parent.editModule.isAddedRowByContextMenu=!0,this.parent.addRecord()),(e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Indent"||e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Outdent")&&!(0,t.isNullOrUndefined)(this.parent.rowDragAndDropModule)){var i=e.item.id===this.parent.element.id+"_gridcontrol_cmenu_Indent"?"indent":"outdent";this.parent.rowDragAndDropModule.indentOutdentAction(null,i)}},e.prototype.getModuleName=function(){return"contextMenu"},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getContextMenu=function(){return this.parent.grid.contextMenuModule.getContextMenu()},e}(),gi=function(){function e(e){this.batchChildCount=0,this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.batchAddedRecords=[],this.batchDeletedRecords=[],this.batchAddRowRecord=[],this.parent=e,this.isSelfReference=!(0,t.isNullOrUndefined)(e.parentIdMapping),this.batchRecords=[],this.currentViewRecords=[],this.isAdd=!1,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on(ae,this.cellSaved,this),this.parent.on(pe,this.batchAdd,this),this.parent.on(ce,this.beforeBatchAdd,this),this.parent.on(ge,this.batchSave,this),this.parent.on(he,this.beforeBatchDelete,this),this.parent.on(ue,this.beforeBatchSave,this),this.parent.on("batchPageAction",this.batchPageAction,this),this.parent.on("batchCancelAction",this.batchCancelAction,this),this.parent.grid.on("immutable-batch-cancel",this.immutableBatchAction,this),this.parent.grid.on("next-cell-index",this.nextCellIndex,this),this.parent.grid.on("cellfocused",this.onCellFocused,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(ae,this.cellSaved),this.parent.off(pe,this.batchAdd),this.parent.off(ge,this.batchSave),this.parent.off(ce,this.beforeBatchAdd),this.parent.off(he,this.beforeBatchDelete),this.parent.off(ue,this.beforeBatchSave),this.parent.off("batchPageAction",this.batchPageAction),this.parent.off("batchCancelAction",this.batchCancelAction),this.parent.grid.off("immutable-batch-cancel",this.immutableBatchAction),this.parent.grid.off("next-cell-index",this.nextCellIndex),this.parent.grid.off("cellfocused",this.onCellFocused))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getBatchRecords=function(){return this.batchRecords},e.prototype.getAddRowIndex=function(){return this.addRowIndex},e.prototype.getSelectedIndex=function(){return this.selectedIndex},e.prototype.getBatchChildCount=function(){return this.batchChildCount},e.prototype.batchPageAction=function(){var e,i=this,r=this.parent.grid.dataSource instanceof Ze.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,n=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!(0,t.isNullOrUndefined)(this.batchAddedRecords)&&this.batchAddedRecords.length)for(var o=function(t){e=r.findIndex(function(e){return e[""+n]===i.batchAddedRecords[parseInt(t.toString(),10)][""+n]}),r.splice(e,1)},a=0;a<this.batchAddedRecords.length;a++)o(a);this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.batchDeletedRecords=this.currentViewRecords=[]},e.prototype.cellSaved=function(e){if(e.column.index===this.parent.treeColumnIndex&&this.parent.renderModule.cellRender({data:e.rowData,cell:e.cell,column:this.parent.grid.getColumnByIndex(e.column.index)}),this.isAdd&&"Batch"===this.parent.editSettings.mode&&"Bottom"!==this.parent.editSettings.newRowPosition){var i=this.parent.grid.dataSource instanceof Ze.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,r=void 0,n=this.parent.grid.getPrimaryKeyFieldNames()[0],o=void 0,a=void 0,s="parentItem",d=this.selectedIndex>-1?this.batchRecords[parseInt(this.addRowIndex.toString(),10)][""+s]:null,p=void 0,h=void 0,c=void 0,u="Top"===this.parent.editSettings.newRowPosition||-1===this.selectedIndex?0:"Above"===this.parent.editSettings.newRowPosition?this.addRowIndex:this.addRowIndex+1;if(u=this.getActualRowObjectIndex(u),this.newBatchRowAdded){if(this.batchRecords.length&&(p=this.batchRecords[this.addRowIndex][this.parent.idMapping],c=this.batchRecords[this.addRowIndex][this.parent.parentIdMapping],this.batchRecords[parseInt(this.addRowIndex.toString(),10)][""+s]&&(h=this.batchRecords[parseInt(this.addRowIndex.toString(),10)][""+s].uniqueID)),this.batchAddedRecords=dt(this.batchAddedRecords),this.batchAddRowRecord=dt(this.batchAddRowRecord),this.batchAddRowRecord.push(this.batchRecords[this.addRowIndex]),r=this.parent.grid.getRowsObject()[parseInt(u.toString(),10)].changes,!(0,t.isNullOrUndefined)(r)&&(r.uniqueID=(0,l.getUid)(this.parent.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+r.uniqueID,r,this.parent),!Object.prototype.hasOwnProperty.call(r,"level"))){if(this.batchIndex=-1===this.selectedIndex?0:this.batchIndex,"Child"===this.parent.editSettings.newRowPosition){if(r.primaryParent=d,this.selectedIndex>-1){r.parentItem=(0,t.extend)({},this.batchRecords[this.addRowIndex]),r.parentUniqueID=r.parentItem.uniqueID,delete r.parentItem.childRecords,delete r.parentItem[this.parent.childMapping],r.level=r.parentItem.level+1,r.index=this.batchIndex;var g=at(this.batchRecords[this.addRowIndex]).length,f=at(this.batchRecords[this.addRowIndex])[g-1];f=(0,t.isNullOrUndefined)(f)?this.batchRecords[this.addRowIndex]:f,o=i.map(function(e){return e[""+n]}).indexOf(f[""+n]),this.isSelfReference&&(r[this.parent.parentIdMapping]=p),Ft(n,r.parentItem,"add",this.parent,this.isSelfReference,r)}}else if(("Above"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition)&&!(0,t.isNullOrUndefined)(this.batchRecords[this.addRowIndex])){if(r.level=this.batchRecords[parseInt(this.addRowIndex.toString(),10)].level,r.level&&this.selectedIndex>-1&&(r.parentItem=d,r.parentUniqueID=h,delete r.parentItem.childRecords,delete r.parentItem[this.parent.childMapping]),r.index="Below"===this.parent.editSettings.newRowPosition?this.batchIndex:this.batchIndex-1,"Below"===this.parent.editSettings.newRowPosition&&this.selectedIndex>-1){g=at(this.batchRecords[this.addRowIndex]).length,f=at(this.batchRecords[this.addRowIndex])[g-1];f=(0,t.isNullOrUndefined)(f)?this.batchRecords[this.addRowIndex]:f,o=i.map(function(e){return e[""+n]}).indexOf(f[""+n])}if("Above"===this.parent.editSettings.newRowPosition&&this.selectedIndex>-1){f=this.batchRecords[this.addRowIndex];o=i.map(function(e){return e[""+n]}).indexOf(f[""+n])}this.isSelfReference&&(r[this.parent.parentIdMapping]=c)}r.index=-1===r.index?0:r.index,r.hasChildRecords=!1,r.childRecords=[],this.batchRecords.splice(r.index,0,r),this.currentViewRecords.splice(r.index,0,r),a=o||r.index,"Above"!==this.parent.editSettings.newRowPosition&&(a=0===r.index?a:a+1),i.splice(a,0,r),this.batchAddedRecords.push(r)}this.parent.grid.getRowsObject()[parseInt(u.toString(),10)].data=r,this.newBatchRowAdded=!1}}},e.prototype.beforeBatchAdd=function(e){var i="isTabLastRow";if("Cell"===this.parent.editSettings.mode&&this.parent.editModule[""+i])return e.cancel=!0,void(this.parent.editModule[""+i]=!1);!this.parent.editModule.isAddedRowByMethod||(0,t.isNullOrUndefined)(this.parent.editModule.addRowIndex)||this.parent.editModule.isAddedRowByContextMenu||-1!==this.parent.grid.selectedRowIndex&&!this.parent.editModule.batchEditModule.isAdd?(this.selectedIndex=this.parent.grid.selectedRowIndex,this.addRowIndex=this.parent.grid.selectedRowIndex>-1?this.parent.grid.selectedRowIndex:0,this.parent.editModule.addRowIndex=this.parent.grid.selectedRowIndex>-1?this.parent.grid.selectedRowIndex:0,this.addRowRecord=this.parent.getSelectedRecords()[0]):(this.selectedIndex=this.parent.editModule.selectedIndex,this.addRowIndex=this.parent.editModule.addRowIndex,this.addRowRecord=this.batchRecords.length?this.batchRecords[this.selectedIndex]:this.parent.getCurrentViewRecords()[this.selectedIndex])},e.prototype.batchAdd=function(e){if("Bottom"!==this.parent.editSettings.newRowPosition){this.isAdd=!0,this.newBatchRowAdded=!0;var i=0;if(this.batchRecords.length||(this.batchAddedRecords=[],this.batchRecords=dt(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=dt(this.parent.grid.getCurrentViewRecords())),this.parent.editModule.isAddedRowByMethod&&!(0,t.isNullOrUndefined)(this.parent.editModule.addRowIndex)&&(0,t.classList)(this.parent.grid.getDataRows()[0],["e-batchrow"],[]),"Top"!==this.parent.editSettings.newRowPosition){var r=this.parent.grid.getCurrentViewRecords();"Batch"===this.parent.editSettings.mode&&(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)&&(r=this.batchRecords),this.updateChildCount(r),this.parent.notify(re,{}),this.batchChildCount=0}this.updateRowIndex();var n=(0,t.getValue)("focusModule",this.parent.grid),o=this.parent.getContentTable();if(this.parent.getBatchChanges()[this.deletedRecords].length&&"Above"===this.parent.editSettings.newRowPosition?(i=e.row.rowIndex,n.getContent().matrix.matrix=this.matrix):i=o.getElementsByClassName("e-batchrow")[0].rowIndex,n.getContent().matrix.current=[i,n.getContent().matrix.current[1]],this.parent.editModule.isAddedRowByMethod&&!(0,t.isNullOrUndefined)(this.parent.editModule.addRowIndex)&&!this.parent.editModule.isAddedRowByContextMenu){var a=this.parent.getBatchChanges().addedRecords,s=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[a.length-1].getAttribute("aria-rowindex"),10)-1;this.batchRecords.splice(s,0,a[a.length-1])}}},e.prototype.beforeBatchDelete=function(e){this.batchRecords.length||(this.batchRecords=dt(this.parent.grid.getCurrentViewRecords()),this.currentViewRecords=dt(this.parent.grid.getCurrentViewRecords()));var i=(0,t.getValue)("focusModule",this.parent.grid);this.matrix=i.getContent().matrix.matrix;var r,n,o,a,s=[],d=this.parent.grid.getPrimaryKeyFieldNames()[0],l=Array.isArray(e.row)?e.row[0]:e.row;(0,t.isNullOrUndefined)(l)||-1!==this.parent.getSelectedRows().indexOf(l)?(o=at(n=this.parent.grid.getSelectedRecords()[this.parent.grid.getSelectedRecords().length-1]),a=this.parent.getSelectedRows()[0].getAttribute("data-uid")):(o=at(n=e.rowData),a=l.getAttribute("data-uid"));var p=parseInt(this.parent.grid.getRowElementByUID(a).getAttribute("aria-rowindex"),10)-1;if(o.length)for(var h=p+o.length,c=p+1;c<=h;c++)s.push(this.parent.grid.getDataRows()[parseInt(c.toString(),10)]),(this.parent.frozenRows||this.parent.frozenColumns||this.parent.getFrozenColumns())&&s.push(this.parent.grid.getHeaderContent()[parseInt(c.toString(),10)]);if(!(0,t.isNullOrUndefined)(n.parentItem)){var u=pt(this.parent,n.parentItem.uniqueID);if(!(0,t.isNullOrUndefined)(u)&&u.hasChildRecords){var g=u.childRecords.indexOf(n);u.childRecords.splice(g,1)}this.batchDeletedRecords=dt(this.batchDeletedRecords),this.batchDeletedRecords.push(n)}o.push(n),r=o;var f=function(e){var t=y.batchRecords.findIndex(function(t){return t[""+d]===r[parseInt(e.toString(),10)][""+d]});-1!==t&&y.batchRecords.splice(t,1)},y=this;for(c=0;c<r.length;c++)f(c);for(c=0;c<s.length;c++)(0,t.isNullOrUndefined)(s[parseInt(c.toString(),10)])||this.parent.grid.selectionModule.selectedRecords.push(s[parseInt(c.toString(),10)])},e.prototype.updateRowIndex=function(){for(var e=this.parent.grid.getDataRows(),t=0;t<e.length;t++)e[parseInt(t.toString(),10)].setAttribute("aria-rowindex",(t+1).toString())},e.prototype.updateChildCount=function(e){for(var i=this.parent.grid.getPrimaryKeyFieldNames()[0],r=this.parent.getBatchChanges().addedRecords||[],n="Child"===this.parent.editSettings.newRowPosition?"primaryParent":"parentItem",o=0;o<r.length;o++)(0,t.isNullOrUndefined)(r[parseInt(o.toString(),10)][""+n])||r[parseInt(o.toString(),10)][""+n][""+i]===e[parseInt(this.addRowIndex.toString(),10)][""+i]&&(this.batchChildCount=this.batchChildCount+1)},e.prototype.beforeBatchSave=function(e){var t="changedRecords",i="deletedRecords",r=e.batchChanges[""+t];if(e.batchChanges[""+t].length)for(var n=0;n<r.length;n++)zt({value:r[parseInt(n.toString(),10)],action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,undefined);if(e.batchChanges[""+i].length){var o=e.batchChanges[""+i];for(n=0;n<o.length;n++){this.deleteUniqueID(o[parseInt(n.toString(),10)].uniqueID);for(var a=at(o[parseInt(n.toString(),10)]),s=0;s<a.length;s++)this.deleteUniqueID(a[parseInt(s.toString(),10)].uniqueID);e.batchChanges[""+i]=e.batchChanges[""+i].concat(a)}}this.isAdd=!1},e.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},e.prototype.batchCancelAction=function(){var e,i=this,r="targetElement",n="parentItem",o="index",a=this.parent.grid.getCurrentViewRecords(),s="childRecords",d=this.parent.grid.dataSource instanceof Ze.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,l=this.parent.grid.getPrimaryKeyFieldNames()[0];if(!(0,t.isNullOrUndefined)(this.batchAddedRecords))for(var p=function(r){if(-1!==(e=d.findIndex(function(e){return e[""+l]===i.batchAddedRecords[parseInt(r.toString(),10)][""+l]}))&&d.splice(e,1),"Child"===h.parent.editSettings.newRowPosition&&(e=a.map(function(e){return e[""+l]}).indexOf(h.batchAddedRecords[parseInt(r.toString(),10)][""+n]?h.batchAddedRecords[parseInt(r.toString(),10)][""+n][""+l]:h.batchAddedRecords[parseInt(r.toString(),10)][""+l]),!(0,t.isNullOrUndefined)(a[parseInt(e.toString(),10)])))for(var o=a[parseInt(e.toString(),10)][""+s],p=0;o&&p<o.length;p++)o[parseInt(p.toString(),10)][""+l]===h.batchAddedRecords[parseInt(r.toString(),10)][""+l]&&o.splice(p,1)},h=this,c=0;c<this.batchAddedRecords.length;c++)p(c);if(!(0,t.isNullOrUndefined)(this.parent[""+r])){var u=this.parent[""+r].closest("tr");this.parent.collapseRow(u),this.parent[""+r]=null}if(!(0,t.isNullOrUndefined)(this.batchDeletedRecords))for(c=0;c<this.batchDeletedRecords.length;c++)if(!(0,t.isNullOrUndefined)(this.batchDeletedRecords[parseInt(c.toString(),10)][""+n])){e=a.map(function(e){return e[""+l]}).indexOf(this.batchDeletedRecords[parseInt(c.toString(),10)][""+n][""+l]);var g=0===this.batchDeletedRecords[parseInt(c.toString(),10)][""+o]?this.batchDeletedRecords[parseInt(c.toString(),10)][""+o]:this.batchDeletedRecords[parseInt(c.toString(),10)][""+o]-1;(0,t.isNullOrUndefined)(a[parseInt(e.toString(),10)])||a[parseInt(e.toString(),10)][""+s].splice(g,0,this.batchDeletedRecords[parseInt(c.toString(),10)])}this.batchAddedRecords=this.batchRecords=this.batchAddRowRecord=this.currentViewRecords=[],this.batchRecords=dt(this.parent.grid.getCurrentViewRecords()),this.batchIndex=0,this.currentViewRecords=dt(this.parent.grid.getCurrentViewRecords()),this.batchDeletedRecords=[],this.parent.grid.renderModule.refresh()},e.prototype.batchSave=function(e){if("Batch"===this.parent.editSettings.mode){var i,r=void 0,n=Object.hasOwnProperty.call(e,"updatedRecords")?e.updatedRecords:this.parent.getBatchChanges(),o="deletedRecords",a=this.parent.grid.dataSource instanceof Ze.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,s=this.parent.grid.getCurrentViewRecords(),d=this.parent.grid.getPrimaryKeyFieldNames()[0],l=n.addedRecords,p="parentItem",h=void 0,c=void 0,u=void 0,g="childRecords";if(l.length>1&&"Bottom"!==this.parent.editSettings.newRowPosition&&l.reverse(),"Bottom"!==this.parent.editSettings.newRowPosition&&!Object.hasOwnProperty.call(e,"updatedRecords")){if(a.splice(a.length-l.length,l.length),this.parent.editModule.isAddedRowByMethod&&l.length&&!(0,t.isNullOrUndefined)(this.parent.editModule.addRowIndex)&&!this.parent.editModule.isAddedRowByContextMenu){l.reverse();for(var f=0;f<l.length;f++){var y=parseInt(this.parent.getContentTable().getElementsByClassName("e-insertedrow")[parseInt(f.toString(),10)].getAttribute("aria-rowindex"),10)-1;a.splice(y,0,l[parseInt(f.toString(),10)])}}if(this.parent.allowPaging||a.length===s.length){var m=dt(a);if(m.length&&0!==s.length){var S=m.map(function(e){return e[""+d]}).indexOf(s[0][""+d]),v=S+this.parent.grid.pageSettings.pageSize;s=m.splice(S,v)}}else s.length>l.length&&s.splice(s.length-l.length,l.length)}for(0===this.batchAddRowRecord.length&&this.batchAddRowRecord.push(this.parent.flatData[e.index]),this.parent.editModule.isAddedRowByContextMenu&&l.reverse(),r=0;r<l.length;r++){var w=(0,t.extend)({},l[parseInt(r.toString(),10)]);if(delete w.parentItem,delete w.uniqueID,delete w.index,delete w.level,delete w.hasChildRecords,delete w.childRecords,delete w.parentUniqueID,(0,t.isNullOrUndefined)(w.primaryParent)||delete w.primaryParent,l.length>1&&this.parent.editModule.isAddedRowByContextMenu){var I=this.parent.editSettings.newRowPosition;this.parent.editSettings.newRowPosition=this.parent.editModule.previousNewRowPosition,this.parent.editModule.previousNewRowPosition=I}if(l[parseInt(r.toString(),10)].taskData=w,i=this.batchAddRowRecord[parseInt(r.toString(),10)],(0,t.isNullOrUndefined)(i)&&(i=this.batchAddRowRecord[r-1]),this.isSelfReference&&((0,t.isNullOrUndefined)(l[parseInt(r.toString(),10)].parentItem)||Ft(d,l[parseInt(r.toString(),10)].parentItem,"add",this.parent,this.isSelfReference,l[parseInt(r.toString(),10)])),(0,t.isNullOrUndefined)(i)||(c=i.index),(0,t.isNullOrUndefined)(l[parseInt(r.toString(),10)].index)&&(c=0),"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition&&(0,t.isNullOrUndefined)(l[parseInt(r.toString(),10)].parentItem)&&-1===this.selectedIndex&&(h=-1,i=null),zt({value:l[parseInt(r.toString(),10)],action:"add"},this.parent,this.isSelfReference,c,h,u,i),h=null,"Child"===this.parent.editSettings.newRowPosition&&!(0,t.isNullOrUndefined)(l[parseInt(r.toString(),10)][""+p])&&((0,t.isNullOrUndefined)(this.parent.editModule.addRowIndex)||this.isSelfReference)){var R=s.map(function(e){return e[""+d]}).indexOf(l[parseInt(r.toString(),10)][""+p][""+d]),x=s[parseInt(R.toString(),10)][""+g];if(!(0,t.isNullOrUndefined)(c)&&x.some(function(e){return e.uniqueID===i.uniqueID}))for(var C=0;C<x.length;C++)x[parseInt(C.toString(),10)][""+d]===l[parseInt(r.toString(),10)][""+d]&&s[parseInt(R.toString(),10)][""+g].splice(C,1)}}if(n[""+o].length)for(r=0;r<n[""+o].length;r++)zt({value:n[""+o][parseInt(r.toString(),10)],action:"delete"},this.parent,this.isSelfReference,c,h,u,i);this.parent.parentData=[];for(var b=0;b<a.length;b++)a[parseInt(b.toString(),10)].index=b,(0,t.setValue)("uniqueIDCollection."+a[parseInt(b.toString(),10)].uniqueID+".index",b,this.parent),a[parseInt(b.toString(),10)].level||this.parent.parentData.push(a[parseInt(b.toString(),10)])}this.batchAddRowRecord=this.batchAddedRecords=this.batchRecords=this.batchDeletedRecords=this.currentViewRecords=[],this.parent.editModule.isAddedRowByContextMenu&&(this.parent.editModule.isAddedRowByContextMenu=!1)},e.prototype.getActualRowObjectIndex=function(e){var i=this.parent.grid.getDataRows();if(("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&this.selectedIndex>-1){if(!(0,t.isNullOrUndefined)(this.batchRecords[this.addRowIndex])&&this.batchRecords[this.addRowIndex].expanded)if(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length){if(e+=at(this.batchRecords[this.addRowIndex]).length,"Child"!==this.parent.editSettings.newRowPosition)e+=this.getBatchChildCount()}else e+=at(this.batchRecords[this.addRowIndex]).length;e>=i.length&&(e=i.length-1),this.updateChildCount(this.parent.grid.getCurrentViewRecords()),this.batchChildCount&&(e+=this.batchChildCount),this.batchChildCount=0}return e},e.prototype.immutableBatchAction=function(e){e.args.cancel=!0;var t=this.parent.grid.getBatchChanges(),i=[];Object.keys(t).length&&(i=t.addedRecords);for(var r=0;r<i.length;r++)e.rows.splice(i[parseInt(r.toString(),10)].index,1)},e.prototype.nextCellIndex=function(e){var t="index",i=this.parent.getBatchChanges().deletedRecords;this.parent.getSelectedRows().length?this.isAdd&&i.length>0?e[""+t]=this.parent.getSelectedRecords()[0][""+t]:e[""+t]=this.parent.getSelectedRows()[0].rowIndex:e[""+t]=this.batchIndex},e.prototype.onCellFocused=function(e){if("Cell"===this.parent.editSettings.mode&&this.parent.grid.isEdit&&e.keyArgs&&"shiftEnter"===e.keyArgs.action)return e.keyArgs.preventDefault(),void this.parent.endEdit()},e}(),fi=function(){function e(e){this.addedRecords="addedRecords",this.deletedRecords="deletedRecords",this.prevAriaRowIndex="-1",this.isAddedRowByMethod=!1,this.isAddedRowByContextMenu=!1,this.isIndexUndefined=!1,l.Grid.Inject(l.Edit),this.parent=e,this.isSelfReference=!(0,t.isNullOrUndefined)(e.parentIdMapping),this.previousNewRowPosition=null,this.internalProperties={},this.batchEditModule=new gi(this.parent),this.addEventListener()}return e.prototype.getModuleName=function(){return"edit"},e.prototype.addEventListener=function(){this.parent.on(te,this.crudAction,this),this.parent.on(ie,this.beginEdit,this),this.parent.on(re,this.beginAdd,this),this.parent.on(ne,this.recordDoubleClick,this),this.parent.on(oe,this.cellSave,this),this.parent.on(le,this.batchCancel,this),this.parent.grid.on(fe,this.keyPressed,this),this.parent.grid.on("batchedit-form",this.lastCellTab,this),this.parent.grid.on("content-ready",this.contentready,this),this.parent.on(se,this.cellEdit,this),this.parent.on("actionBegin",this.editActionEvents,this),this.parent.on("actionComplete",this.editActionEvents,this),this.parent.grid.on(me,this.recordDoubleClick,this),this.parent.grid.on("dblclick",this.gridDblClick,this),this.parent.grid.on("recordAdded",this.customCellSave,this),this.parent.on("savePreviousRowPosition",this.savePreviousRowPosition,this),this.parent.grid.on(xe,this.beforeStartEdit,this),this.parent.grid.on(Ce,this.beforeBatchCancel,this),this.parent.grid.on("reset-edit-props",this.resetIsOnBatch,this),this.parent.grid.on("get-row-position",this.getRowPosition,this)},e.prototype.gridDblClick=function(e){if(this.doubleClickTarget=e.target,e.target.classList.contains("e-frame")&&0===this.parent.getCurrentViewRecords().length&&(this.doubleClickTarget=null),e.target.classList.contains("e-treegridcollapse")||e.target.classList.contains("e-treegridexpand")){var i=(0,l.parentsUntil)(e.target,"e-row"),r=i&&parseInt(i.getAttribute("aria-rowindex"),10)-1;!(0,t.isNullOrUndefined)(r)&&r>=0&&this.parent.allowPaging&&(this.parent.grid.getDataRows()[r].dataset.uid=this.parent.grid.contentModule.getRows()[r].uid)}},e.prototype.getRowPosition=function(e){e.newRowPosition=this.parent.editSettings.newRowPosition,e.addRowIndex=this.addRowIndex,e.dataRowIndex=+this.prevAriaRowIndex},e.prototype.beforeStartEdit=function(e){"Cell"===this.parent.editSettings.mode&&this.parent.trigger(E,e)},e.prototype.beforeBatchCancel=function(e){"Cell"===this.parent.editSettings.mode&&(e.requestType="cancel",this.parent.trigger(U,e))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(te,this.crudAction),this.parent.off(ie,this.beginEdit),this.parent.off(re,this.beginAdd),this.parent.off(ne,this.recordDoubleClick),this.parent.off(le,this.batchCancel),this.parent.grid.off(fe,this.keyPressed),this.parent.grid.off("batchedit-form",this.lastCellTab),this.parent.grid.off("content-ready",this.contentready),this.parent.off(se,this.cellEdit),this.parent.off("actionBegin",this.editActionEvents),this.parent.off("actionComplete",this.editActionEvents),this.parent.grid.off("recordAdded",this.customCellSave),this.parent.grid.off(me,this.recordDoubleClick),this.parent.off("savePreviousRowPosition",this.savePreviousRowPosition),this.parent.grid.off(xe,this.beforeStartEdit),this.parent.grid.off(Ce,this.beforeBatchCancel),this.parent.grid.off("dblclick",this.gridDblClick),this.parent.grid.off("reset-edit-props",this.resetIsOnBatch),this.parent.grid.off("get-row-position",this.getRowPosition))},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.applyFormValidation=function(e){this.parent.grid.editModule.applyFormValidation(e)},e.prototype.editActionEvents=function(e){var i=(0,l.getObject)("editAction",e),r=(0,l.getObject)("name",i),n=this.parent,o=!(0,t.isNullOrUndefined)(n.dataSource)&&n.dataSource.adaptor;if(!(0,t.isNullOrUndefined)(o)&&(et(n)||o instanceof Ze.RemoteSaveAdaptor)&&"save"===i.requestType&&"add"===i.action&&("Child"===n.editSettings.newRowPosition||"Below"===n.editSettings.newRowPosition||"Above"===n.editSettings.newRowPosition))if("actionBegin"===r){var a=(0,t.isNullOrUndefined)(i.row)||!Object.keys(i.row).length?this.selectedIndex:i.row.rowIndex-1,s=(0,t.isNullOrUndefined)(a)||-1===a?-1:n.getCurrentViewRecords()[parseInt(a.toString(),10)][n.getPrimaryKeyFieldNames()[0]];n.grid.query.addParams("relationalKey",s)}else if("actionComplete"===r)for(var d=n.grid.query.params.length,p=0;p<d;p++)"relationalKey"===n.grid.query.params[parseInt(p.toString(),10)].key&&n.grid.query.params.splice(p);this.parent.enableInfiniteScrolling&&"actionComplete"===r&&this.infiniteAddAction(i),"Batch"===this.parent.editSettings.mode&&"paging"===i.requestType&&this.parent.notify("batchPageAction",{})},e.prototype.infiniteAddAction=function(e){if("save"===e.requestType&&"add"===e.action||"delete"===e.requestType){if("Top"!==this.parent.editSettings.newRowPosition&&-1!==this.selectedIndex&&"save"===e.requestType&&"add"===e.action){var t=this.parent.grid.getRowsObject(),i=t.splice(0,1)[0],r=this.addRowIndex,n=this.parent.getCurrentViewRecords();"Below"!==this.parent.editSettings.newRowPosition&&"Child"!==this.parent.editSettings.newRowPosition||(r+=at(n[r+1]).length),r="Below"===this.parent.editSettings.newRowPosition?r+1:r,t.splice(r,0,i);var o=n.splice(0,1)[0];n.splice(r,0,o),this.updateInfiniteCurrentViewData(o,this.addRowIndex)}var a=this.parent.grid.getRows(),s=this.parent.grid.getRowsObject(),d=this.parent.infiniteScrollSettings.enableCache;d||((0,l.resetRowIndex)(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0),this.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords())),!d&&this.parent.getFrozenColumns()>0&&((0,l.resetRowIndex)(this.parent.grid,s,a,0),this.updateIndex(this.parent.grid.dataSource,a,this.parent.getCurrentViewRecords()))}},e.prototype.updateInfiniteCurrentViewData=function(e,i){var r=this,n=Math.ceil(i/this.parent.grid.pageSettings.pageSize),o=n>0?n:1,a=i-(o-1)*this.parent.pageSettings.pageSize,s=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData;s[1].splice(0,1);var d=s[parseInt(o.toString(),10)];(0,t.isNullOrUndefined)(this.addRowRecord)||(d.filter(function(e,t){e.uniqueID===r.addRowRecord.uniqueID&&(a=t)}),(this.addRowRecord.hasChildRecords&&this.addRowRecord.childRecords.length&&"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(a+=at(this.addRowRecord).length)),a>=this.parent.pageSettings.pageSize&&(o+=1,d=s[parseInt(o.toString(),10)],a=a-this.parent.pageSettings.pageSize>=0?a-this.parent.pageSettings.pageSize:0),a="Below"===this.parent.editSettings.newRowPosition?a+1:a,d.splice(a,0,e),this.parent.grid.infiniteScrollModule.updateCurrentViewData()},e.prototype.recordDoubleClick=function(e){var i=e.target;if(!(0,t.isNullOrUndefined)(i.closest("td.e-rowcell"))&&this.parent.grid.editSettings.allowEditing&&!this.parent.grid.isEdit){var r=this.parent.grid.getColumnByIndex(+i.closest("td.e-rowcell").getAttribute("aria-colindex")-1);if("Cell"===this.parent.editSettings.mode&&!this.isOnBatch&&r&&!r.isPrimaryKey&&this.parent.editSettings.allowEditing&&r.allowEditing&&!i.classList.contains("e-treegridexpand")&&!i.classList.contains("e-treegridcollapse")&&this.parent.editSettings.allowEditOnDblClick){if(this.isOnBatch=!0,this.parent.grid.setProperties({selectedRowIndex:e.rowIndex},!0),this.parent.enableVirtualization){var n=(0,l.parentsUntil)(e.target,"e-row");this.prevAriaRowIndex=n.getAttribute("aria-rowindex"),n.setAttribute("aria-rowindex",n.rowIndex+1+"")}this.updateGridEditMode("Batch")}else"Cell"!==this.parent.editSettings.mode||r.allowEditing&&!r.isPrimaryKey||(this.isOnBatch=!0,this.updateGridEditMode("Batch"))}},e.prototype.updateGridEditMode=function(e){this.parent.grid.setProperties({editSettings:{mode:e}},!0),(0,l.getObject)("updateEditObj",this.parent.grid.editModule).apply(this.parent.grid.editModule),this.parent.grid.isEdit=!1},e.prototype.resetIsOnBatch=function(){this.parent.enableVirtualization&&"Cell"===this.parent.editSettings.mode&&(this.isOnBatch=!1,this.updateGridEditMode("Normal"))},e.prototype.keyPressed=function(e){(this.isOnBatch||"tab"===e.action||"shiftTab"===e.action)&&(this.keyPress=e.action),"f2"===e.action&&this.recordDoubleClick(e),"escape"===e.action&&this.closeEdit()},e.prototype.deleteUniqueID=function(e){delete this.parent.uniqueIDFilterCollection[""+e];delete this.parent.uniqueIDCollection[""+e]},e.prototype.cellEdit=function(e){var i=this,r="promise",n=e[""+r];if(delete e[""+r],this.parent.enableVirtualization&&!(0,t.isNullOrUndefined)(this.prevAriaRowIndex)&&"-1"!==this.prevAriaRowIndex&&(e.row.setAttribute("aria-rowindex",this.prevAriaRowIndex),this.prevAriaRowIndex=void 0),"enter"!==this.keyPress&&this.parent.trigger(se,e,function(e){e.cancel||"Cell"!==i.parent.editSettings.mode?e.cancel&&"Cell"===i.parent.editSettings.mode&&(i.isOnBatch=!1,i.updateGridEditMode("Normal")):i.enableToolbarItems("edit"),(0,t.isNullOrUndefined)(n)||n.resolve(e)}),this.doubleClickTarget&&(this.doubleClickTarget.classList.contains("e-treegridexpand")||this.doubleClickTarget.classList.contains("e-treegridcollapse")||this.doubleClickTarget.classList.contains("e-summarycell")))return e.cancel=!0,void(this.doubleClickTarget=null);"Cell"===this.parent.editSettings.mode&&("tab"===this.keyPress||"shiftTab"===this.keyPress?this.keyPress=null:"enter"===this.keyPress&&(e.cancel=!0,this.keyPress=null,(0,t.setValue)("isEditCollapse",!1,this.parent)),e.columnObject.allowEditing||(e.cancel=!0)),this.parent.enableVirtualization&&(this.parent.grid.contentModule.editedRowIndex=this.parent.grid.editModule.editModule.index)},e.prototype.enableToolbarItems=function(e){if(!(0,t.isNullOrUndefined)(this.parent.grid.toolbarModule)){var i=this.parent.element.id+"_gridcontrol_";this.parent.grid.toolbarModule.enableItems([i+"add",i+"edit",i+"delete"],"save"===e),this.parent.grid.toolbarModule.enableItems([i+"update",i+"cancel"],"edit"===e)}},e.prototype.batchCancel=function(){if("Cell"===this.parent.editSettings.mode){var e=(0,t.getValue)("editModule.cellDetails",this.parent.grid.editModule);(0,t.isNullOrUndefined)(this.editedRowIndex)||(e.rowIndex=this.editedRowIndex);var i=this.parent.getCellFromIndex(e.rowIndex,this.parent.treeColumnIndex);this.parent.renderModule.cellRender({data:e.rowData,cell:i,column:this.parent.grid.getColumns()[this.parent.treeColumnIndex]}),this.updateGridEditMode("Normal"),this.isOnBatch=!1}"Batch"===this.parent.editSettings.mode&&this.parent.notify("batchCancelAction",{})},e.prototype.customCellSave=function(e){tt(this.parent)&&"Cell"===this.parent.editSettings.mode&&"edit"===e.action&&(this.updateCell(e,e.rowIndex),this.afterCellSave(e,e.row))},e.prototype.cellSave=function(e){var i=this;if("Cell"===this.parent.editSettings.mode&&this.parent.element.querySelector("form")){e.cancel=!0;var r,n;(0,t.setValue)("isEditCollapse",!0,this.parent),e.rowData[e.columnName]=e.value,r=(0,t.isNullOrUndefined)(e.cell)?this.parent.grid.editModule.editModule.form.parentElement.parentNode:e.cell.parentNode;var o=this.parent.getPrimaryKeyFieldNames();if((0,t.isNullOrUndefined)(r))this.parent.grid.getCurrentViewRecords().filter(function(t,i){t[o[0]]!==e.rowData[o[0]]||(n=i)});else{var a=this.parent.getFrozenLeftColumnsCount()>0||this.parent.getFrozenRightColumnsCount()>0;n=a?(this.parent.getRows().indexOf(r),this.parent.getRows().indexOf(r)):-1===this.parent.getRows().indexOf(r)&&this.parent.getFrozenColumns()>0?this.parent.grid.getRows().indexOf(r):this.parent.getRows().indexOf(r)}var s={};if((0,t.extend)(s,e),s.cancel=!1,s.type="save",r=this.parent.grid.getRows()[r.rowIndex],this.parent.trigger(E,s),s.cancel)this.parent.grid.isEdit=!0;else if(r.rowIndex===this.parent.getCurrentViewRecords().length-1&&"tab"===this.keyPress&&(this.isTabLastRow=!0),et(this.parent)||this.parent.dataSource instanceof Ze.DataManager&&this.parent.dataSource.adaptor instanceof Ze.RemoteSaveAdaptor){if(et(this.parent)||this.parent.dataSource instanceof Ze.DataManager&&this.parent.dataSource.adaptor instanceof Ze.RemoteSaveAdaptor){var d=this.parent.grid.query;if(this.parent.isGantt&&this.parent.loadChildOnDemand)this.updateCell(e,n),(0,t.setValue)("isEdit",!1,this.parent.grid),this.afterCellSave(e,r);else{this.parent.grid.dataSource.update(o[0],e.rowData,d.fromTable,d,e.previousValue).then(function(o){(0,t.isNullOrUndefined)(o)||(e.rowData[e.columnName]=o[e.columnName]),i.updateCell(e,n),(0,t.setValue)("isEdit",!1,i.parent.grid),i.afterCellSave(e,r)})}}}else if(tt(this.parent)){var l={requestType:"save",data:e.rowData,action:"edit",row:r,rowIndex:n,rowData:e.rowData,columnName:e.columnName,filterChoiceCount:null,excelSearchOperator:null};this.parent.grid.getDataModule().eventPromise(l,this.parent.grid.query)}else this.updateCell(e,n),(0,t.setValue)("isEdit",!1,this.parent.grid),this.afterCellSave(e,r)}this.parent.enableVirtualization&&(this.parent.grid.contentModule.virtualData={})},e.prototype.afterCellSave=function(e,i){this.parent.grid.aggregateModule&&this.parent.grid.aggregateModule.refresh(e.rowData),this.parent.grid.editModule.destroyWidgets([this.parent.grid.getColumnByField(e.columnName)]),this.parent.grid.editModule.formObj.destroy(),"tab"!==this.keyPress&&"shiftTab"!==this.keyPress&&(this.updateGridEditMode("Normal"),this.isOnBatch=!1),this.enableToolbarItems("save"),(0,t.removeClass)([i],["e-editedrow","e-batchrow"]),(0,t.removeClass)(i.querySelectorAll(".e-rowcell"),["e-editedbatchcell","e-updatedtd"]),!1!==this.parent.isCellSaveFocus&&this.parent.grid.focusModule.restoreFocus(),zt({value:e.rowData,action:"edit"},this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,e.columnName),i.rowIndex===this.parent.getCurrentViewRecords().length-1&&"enter"===this.keyPress&&(this.keyPress=null);var r={type:"save",column:this.parent.getColumnByField(e.columnName),data:e.rowData,previousData:e.previousValue,row:i,target:e.cell};this.parent.aggregates.map(function(e){return!0===e.showChildSummary}).length&&this.parent.grid.refresh(),this.parent.trigger(U,r)},e.prototype.lastCellTab=function(){!this.parent.grid.isEdit&&this.isOnBatch&&"tab"===this.keyPress&&"Cell"===this.parent.editSettings.mode&&(this.parent.editSettings.allowNextRowEdit?this.enableToolbarItems("edit"):(this.updateGridEditMode("Normal"),this.isOnBatch=!1,this.keyPress=null))},e.prototype.updateCell=function(e,t){this.parent.grid.editModule.updateCell(t,e.columnName,e.rowData[e.columnName]),this.parent.grid.getRowsObject()[parseInt(t.toString(),10)].data=e.rowData},e.prototype.crudAction=function(e,i){zt(e,this.parent,this.isSelfReference,this.addRowIndex,this.selectedIndex,i,this.addRowRecord),this.parent.parentData=[];for(var r=this.parent.grid.dataSource instanceof Ze.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource,n=0;n<r.length;n++){r[parseInt(n.toString(),10)].index=n;var o=this.parent.grid.getPrimaryKeyFieldNames()[0];e.value[""+o]===r[parseInt(n.toString(),10)][""+o]&&"add"===e.action&&(r[parseInt(n.toString(),10)].level=this.internalProperties.level,r[parseInt(n.toString(),10)].taskData=this.internalProperties.taskData,r[parseInt(n.toString(),10)].uniqueID=this.internalProperties.uniqueID,(0,t.isNullOrUndefined)(this.internalProperties.parentItem)||(r[parseInt(n.toString(),10)].parentItem=this.internalProperties.parentItem,r[parseInt(n.toString(),10)].parentUniqueID=this.internalProperties.parentUniqueID),r[parseInt(n.toString(),10)].childRecords=this.internalProperties.childRecords),(0,t.setValue)("uniqueIDCollection."+r[parseInt(n.toString(),10)].uniqueID+".index",n,this.parent);var a=this.parent.dataSource.adaptor;(et(this.parent)||a instanceof Ze.RemoteSaveAdaptor)&&(0,t.setValue)("uniqueIDCollection."+r[parseInt(n.toString(),10)].uniqueID,r[parseInt(n.toString(),10)],this.parent),r[parseInt(n.toString(),10)].level||this.parent.parentData.push(r[parseInt(n.toString(),10)])}this.parent.enableInfiniteScrolling||"add"===e.action&&null!=this.previousNewRowPosition&&(this.parent.setProperties({editSettings:{newRowPosition:this.previousNewRowPosition}},!0),this.previousNewRowPosition=null)},e.prototype.updateIndex=function(e,i,r){for(var n=0;n<this.parent.getDataRows().length;n++){var o=r[parseInt(n.toString(),10)];if(!(0,t.isNullOrUndefined)(o)){var a=(0,t.getValue)("uniqueIDCollection."+o.uniqueID+".index",this.parent);if(o.index=a,!(0,t.isNullOrUndefined)(o.parentItem)){var s=(0,t.getValue)("uniqueIDCollection."+o.parentItem.uniqueID+".index",this.parent);o.parentItem.index=s}}}var d=-1,l=this.parent.treeColumnIndex;if(this.parent.getFrozenColumns()>0)for(var p=i[0].querySelectorAll(".e-rowcell"),h=0;h<p.length;h++)if(p[parseInt(h.toString(),10)].classList.contains("e-gridrowindex0level0")){l=h;break}for(var c=0;c<this.parent.getRows().length;c++){i[parseInt(c.toString(),10)].classList.contains("e-detailrow")||d++;var u=r[parseInt(d.toString(),10)];if(!(0,t.isNullOrUndefined)(u)){a=u.index;var g=u.level,f=i[parseInt(c.toString(),10)];(0,t.isNullOrUndefined)(u.parentItem)||(a=(0,t.getValue)("uniqueIDCollection."+u.parentItem.uniqueID+".index",this.parent));var y=f.cells[parseInt(l.toString(),10)];if(!(0,t.isNullOrUndefined)(y)){for(h=0;h<y.classList.length;h++){var m=y.classList[parseInt(h.toString(),10)],S=m.match(/e-gridrowindex/i),v=m.match(/e-griddetailrowindex/i);null!=S&&(0,t.removeClass)([y],m),null!=v&&(0,t.removeClass)([y],m)}i[parseInt(c.toString(),10)].classList.contains("e-detailrow")?(0,t.addClass)([y],"e-griddetailrowindex"+a+"level"+g):(0,t.addClass)([y],"e-gridrowindex"+a+"level"+g)}}}},e.prototype.beginAdd=function(){var e,i=this.addRowIndex,r=this.parent.grid.getCurrentViewRecords();"Batch"===this.parent.editSettings.mode&&(i=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex(),(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)&&(r=this.batchEditModule.getBatchRecords()));var n=this.parent.grid.getDataRows(),o=n.length?+n[0].getAttribute("aria-rowindex")-1:0,a=n.length?+n[n.length-1].getAttribute("aria-rowindex")-1:0,s=this.selectedIndex>=o&&this.selectedIndex<=a,d=this.parent.enableVirtualization&&this.addRowIndex>-1&&"-1"!==this.prevAriaRowIndex;if("Dialog"!==this.parent.editSettings.mode){if("Above"===this.parent.editSettings.newRowPosition)e="before";else if(("Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition)&&(this.selectedIndex>-1||d)&&s){if(e="after",!(0,t.isNullOrUndefined)(r[parseInt(i.toString(),10)])&&r[parseInt(i.toString(),10)].expanded)if("Batch"===this.parent.editSettings.mode&&(this.parent.getBatchChanges()[this.addedRecords].length>1||this.parent.getBatchChanges()[this.deletedRecords].length)){if(i+=at(r[parseInt(i.toString(),10)]).length,"Child"!==this.parent.editSettings.newRowPosition)i+=this.batchEditModule.getBatchChildCount()}else this.parent.enableVirtualization||(i+=at(r[parseInt(i.toString(),10)]).length)}if((this.selectedIndex>-1||d)&&s&&(i||"Child"===this.parent.editSettings.newRowPosition||"Below"===this.parent.editSettings.newRowPosition)){i>=n.length-1&&(i=n.length-2);var l="rows",p=this.parent.grid.contentModule[""+l][0],h=document.activeElement;n[i+1][""+e](n[0]),(0,t.setValue)("batchIndex",i+1,this.batchEditModule);var c="Above"===this.parent.editSettings.newRowPosition?i:i+1;if("Batch"===this.parent.editSettings.mode&&(this.parent.grid.contentModule[""+l].splice(0,1),this.parent.grid.contentModule[""+l].splice(c,0,p)),"Row"===this.parent.editSettings.mode||"Cell"===this.parent.editSettings.mode){for(var u=this.parent.grid.getContentTable().querySelectorAll(".e-griderror"),g=0;g<u.length;g++)u[parseInt(g.toString(),10)].remove();(0,t.setValue)("errorRules",[],this.parent.grid.editModule.formObj)}d&&(this.prevAriaRowIndex="-1"),this.parent.enableVirtualization&&!this.parent.enableVirtualization||(this.isScrollByFocus=!0,h.focus()),this.parent.enableVirtualization&&!Object.keys(this.parent.grid.contentModule.emptyRowData).length&&this.parent.grid.contentModule.createEmptyRowdata()}}if("Batch"===this.parent.editSettings.mode&&!(0,t.isNullOrUndefined)(this.addRowIndex)&&-1!==this.addRowIndex&&this.isAddedRowByMethod&&!this.isAddedRowByContextMenu){i=this.batchEditModule.getAddRowIndex(),this.selectedIndex=this.batchEditModule.getSelectedIndex();var f=this.parent.getBatchChanges().addedRecords,y=void 0;if(f.length)for(g=0;g<f.length;g++)(0,t.isNullOrUndefined)(f[parseInt(g.toString(),10)].uniqueID)&&(y=f[parseInt(g.toString(),10)]);var m={action:"add",data:y,index:i,seletedRow:0};this.beginAddEdit(m),this.batchEditModule.batchAddRowRecord.push(this.batchEditModule.addRowRecord),this.batchEditModule.batchAddedRecords.push(m.data)}},e.prototype.beginEdit=function(e){if(0!==this.parent.flatData.length||(0,t.isNullOrUndefined)(this.addRowRecord)||(this.addRowRecord=void 0),"refresh"===e.requestType&&this.isOnBatch)e.cancel=!0;else if("Cell"!==this.parent.editSettings.mode||"beginEdit"!==e.requestType){if(this.doubleClickTarget&&"delete"!==e.requestType&&(this.doubleClickTarget.classList.contains("e-treegridexpand")||this.doubleClickTarget.classList.contains("e-treegridcollapse")||this.doubleClickTarget.classList.contains("e-frame")))return e.cancel=!0,void(this.doubleClickTarget=null);if("delete"===e.requestType){var i=e.data;if((0,t.isNullOrUndefined)(e.data[0].uniqueID))for(var r=this.parent.getPrimaryKeyFieldNames(),n=function(t){o.parent.flatData.filter(function(n){n[""+r[0]]===e.data[parseInt(t.toString(),10)][r[0]]&&(i[parseInt(t.toString(),10)]=n)})},o=this,a=0;a<i.length;a++)n(a);for(a=0;a<i.length;a++){this.deleteUniqueID(i[parseInt(a.toString(),10)].uniqueID);for(var s=at(i[parseInt(a.toString(),10)]),d=0;d<s.length;d++)this.deleteUniqueID(s[parseInt(d.toString(),10)].uniqueID);e.data=e.data.concat(s)}}if("add"===e.requestType||this.isAddedRowByMethod&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)){if((-1===this.parent.grid.selectedRowIndex&&this.isAddedRowByMethod||e.index!==this.parent.grid.selectedRowIndex)&&0!==e.index||(this.selectedIndex=this.parent.grid.selectedRowIndex),this.parent.enableVirtualization){var l='.e-row[aria-rowindex="'+(this.selectedIndex+1)+'"]',p=void 0;this.selectedIndex>-1&&"Top"!==this.parent.editSettings.newRowPosition&&"Bottom"!==this.parent.editSettings.newRowPosition?(this.prevAriaRowIndex=this.selectedIndex.toString(),p=this.parent.getContent().querySelector(l),this.addRowIndex=p?p.rowIndex:0):this.prevAriaRowIndex&&"-1"!==this.prevAriaRowIndex?(l='.e-row[aria-rowindex="'+(this.prevAriaRowIndex+1)+'"]',p=this.parent.getContent().querySelector(l),this.addRowIndex=p?p.rowIndex:0):this.addRowIndex=0}else this.isAddedRowByMethod&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?0!==e.index?this.addRowIndex=e.index:this.addRowIndex=this.parent.grid.selectedRowIndex:this.addRowIndex=this.parent.grid.selectedRowIndex>-1?this.parent.grid.selectedRowIndex:0;var h=this.parent.getSelectedRecords()[0];(this.isAddedRowByMethod||this.isAddedRowByContextMenu&&-1!==this.parent.grid.selectedRowIndex)&&(this.parent.enableVirtualization||this.parent.enableInfiniteScrolling)?(this.addRowRecord=this.parent.flatData[this.parent.grid.selectedRowIndex],this.parent.enableVirtualization&&this.isAddedRowByContextMenu&&(this.addRowRecord=this.parent.getCurrentViewRecords()[this.addRowIndex])):(0,t.isNullOrUndefined)(h)||(this.addRowRecord=h)}this.isAddedRowByMethod&&0!==e.index&&(this.addRowRecord=this.parent.flatData[e.index],this.addRowIndex=e.index),"Child"!==this.parent.editSettings.newRowPosition||!this.isIndexUndefined&&!this.isAddedRowByMethod||(0,t.isNullOrUndefined)(this.parent.getSelectedRecords()[0])||(this.addRowRecord=this.parent.getSelectedRecords()[0],this.isIndexUndefined=!1),(0,t.isNullOrUndefined)(this.addRowRecord)&&this.parent.getCurrentViewRecords().length>this.addRowIndex&&"save"===e.requestType&&0!==this.parent.getSelectedRecords().length&&(this.addRowRecord=this.parent.getCurrentViewRecords()[this.addRowIndex]),this.isAddedRowByMethod=!1,e=this.beginAddEdit(e)}else e.cancel=!0},e.prototype.savePreviousRowPosition=function(){null===this.previousNewRowPosition&&(this.previousNewRowPosition=this.parent.editSettings.newRowPosition)},e.prototype.beginAddEdit=function(e){var i=e.data;if("add"===e.action){var r=this.parent.grid.getPrimaryKeyFieldNames()[0],n=null;i.taskData=(0,t.isNullOrUndefined)(i.taskData)?(0,t.extend)({},e.data):i.taskData;var o=void 0;o=this.parent.enableVirtualization&&0!==e.index?this.parent.flatData:"Batch"===this.parent.editSettings.mode&&this.isAddedRowByMethod&&!(0,t.isNullOrUndefined)(this.addRowIndex)?this.batchEditModule.batchRecords:this.parent.grid.getCurrentViewRecords(),this.parent.enableVirtualization&&0!==e.index&&(this.addRowIndex=this.parent.flatData.indexOf(this.addRowRecord),this.selectedIndex=this.addRowIndex);var a=this.addRowIndex;i.uniqueID=(0,l.getUid)(this.parent.element.id+"_data_"),(0,t.setValue)("uniqueIDCollection."+i.uniqueID,i,this.parent);var s=0,d=void 0,p=void 0,h=void 0,c=void 0,u=this.parent.enableVirtualization&&this.addRowIndex>-1&&"-1"!==this.prevAriaRowIndex,g=this.parent.getRows(),f=g.length?o.indexOf(o[0]):0,y=g.length?+g[g.length-1].getAttribute("aria-rowindex")-1:0,m=!(!this.parent.enableVirtualization||0===e.index)||this.selectedIndex>=f&&this.selectedIndex<=y;if(o.length&&!(0,t.isNullOrUndefined)(a)&&(d=o[this.addRowIndex][this.parent.idMapping],c=o[this.addRowIndex][this.parent.parentIdMapping],o[this.addRowIndex].parentItem&&(p=o[this.addRowIndex].parentItem.uniqueID),h=o[this.addRowIndex].parentItem),"Top"!==this.parent.editSettings.newRowPosition&&o.length&&!(0,t.isNullOrUndefined)(a)){if(s=o[this.addRowIndex].level,"Above"===this.parent.editSettings.newRowPosition)n="before",a=o[this.addRowIndex].index;else if("Below"===this.parent.editSettings.newRowPosition){n="after";var S=at(o[this.addRowIndex]).length,v=o[this.addRowIndex].index;a=S>0?v+S:v}else if("Child"===this.parent.editSettings.newRowPosition){n="after",(this.selectedIndex>-1||u)&&m&&(i.parentItem=(0,t.extend)({},o[this.addRowIndex]),i.parentUniqueID=i.parentItem.uniqueID,delete i.parentItem.childRecords,delete i.parentItem[this.parent.childMapping]);var w=at(o[this.addRowIndex]).length,I=o[this.addRowIndex].index;this.selectedIndex>=0&&(i.level=s+1),a=w>0?I+w:I,this.isSelfReference&&(this.parent.isLocalData||-1!==this.parent.editModule.selectedIndex?i.taskData[this.parent.parentIdMapping]=i[this.parent.parentIdMapping]=d:i.taskData[this.parent.parentIdMapping]=i[this.parent.parentIdMapping]=null,(0,t.isNullOrUndefined)(i.parentItem)||Ft(r,i.parentItem,"add",this.parent,this.isSelfReference,i))}if("Above"!==this.parent.editSettings.newRowPosition&&"Below"!==this.parent.editSettings.newRowPosition||((this.selectedIndex>-1||u)&&s&&m&&(i.parentUniqueID=p,i.parentItem=(0,t.extend)({},h),delete i.parentItem.childRecords,delete i.parentItem[this.parent.childMapping]),i.level=s,this.isSelfReference&&(i.taskData[this.parent.parentIdMapping]=i[this.parent.parentIdMapping]=c,(0,t.isNullOrUndefined)(i.parentItem)||Ft(r,i.parentItem,"add",this.parent,this.isSelfReference,i))),null!=n&&(this.selectedIndex>-1||u)&&m&&(e.index="before"===n?a:a+1),"Bottom"===this.parent.editSettings.newRowPosition){s=0;var R=this.parent.grid.dataSource instanceof Ze.DataManager?this.parent.grid.dataSource.dataSource.json:this.parent.grid.dataSource;e.index=R.length}}(0,t.isNullOrUndefined)(i.level)&&(i.level=s),i.hasChildRecords=!1,i.childRecords=[],i.index=0}if("add"===e.action&&(this.internalProperties={level:i.level,parentItem:i.parentItem,uniqueID:i.uniqueID,taskData:i.taskData,parentUniqueID:(0,t.isNullOrUndefined)(i.parentItem)?void 0:i.parentItem.uniqueID,childRecords:i.childRecords}),"delete"===e.requestType){var x=e.data,C=this.parent.getPrimaryKeyFieldNames();if(!(0,t.isNullOrUndefined)(C)&&C.length>0)for(var b=function(e){var i=x[parseInt(e.toString(),10)].parentItem;if(i){var r=pt(D.parent,i.uniqueID);if(!(0,t.isNullOrUndefined)(r)&&r.hasChildRecords){var n=r.childRecords.findIndex(function(t){return x[parseInt(e.toString(),10)][C[0]]===t[C[0]]});r.childRecords.splice(n,1)}}},D=this,M=0;M<x.length;M++)b(M)}return e},e.prototype.addRecord=function(e,i,r){if(this.parent.editSettings.newRowPosition!==this.previousNewRowPosition&&null!==this.previousNewRowPosition||(this.previousNewRowPosition=this.parent.editSettings.newRowPosition),(0,t.isNullOrUndefined)(i)&&(this.isIndexUndefined=!0),this.isSelfReference||(0,t.isNullOrUndefined)(e)||!Object.hasOwnProperty.call(e,this.parent.childMapping))e?(i>-1?(this.selectedIndex=i,this.addRowIndex=i):(this.selectedIndex=this.parent.selectedRowIndex,this.addRowIndex=this.parent.selectedRowIndex),r&&this.parent.setProperties({editSettings:{newRowPosition:r}},!0),this.parent.grid.editModule.addRecord(e,i)):this.parent.grid.editModule.addRecord(e,i);else{var n=[],o=this.parent.editSettings.mode,a=this.parent.grid.editSettings.mode;n.push(e),this.parent.setProperties({editSettings:{mode:"Batch"}},!0),this.parent.grid.setProperties({editSettings:{mode:"Batch"}},!0),(0,t.isNullOrUndefined)(r)||this.parent.setProperties({editSettings:{newRowPosition:r}},!0);var s={addedRecords:n,changedRecords:[],deletedRecords:[]};this.parent.notify(ge,{updatedRecords:s,index:i}),this.parent.setProperties({editSettings:{mode:o}},!0),this.parent.grid.setProperties({editSettings:{mode:a}},!0),this.parent.refresh()}},e.prototype.editFormValidate=function(){return this.parent.grid.editModule.editFormValidate()},e.prototype.destroyForm=function(){this.parent.grid.editModule.destroyForm()},e.prototype.contentready=function(e){(0,t.isNullOrUndefined)(e.args.requestType)||"delete"!==e.args.requestType.toString()&&"save"!==e.args.requestType.toString()&&("Batch"!==this.parent.editSettings.mode||"batchsave"!==e.args.requestType.toString())||(this.updateIndex(this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),(this.parent.frozenRows||this.parent.getFrozenColumns()||this.parent.frozenColumns)&&this.parent.grid.dataSource.length===this.parent.getDataRows().length&&this.updateIndex(this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords()))},e.prototype.editCell=function(e,t){"Cell"!==this.parent.editSettings.mode&&"Batch"!==this.parent.editSettings.mode||("Batch"!==this.parent.editSettings.mode&&(this.isOnBatch=!0,this.updateGridEditMode("Batch")),this.parent.grid.editModule.editCell(e,t))},e.prototype.closeEdit=function(){this.parent.enableVirtualization&&"Batch"===this.parent.grid.editSettings.mode&&this.parent.grid.pageSettings.currentPage>1&&(this.editedRowIndex=this.parent.grid.editModule.editModule.cellDetails.rowIndex,this.parent.grid.editModule.editModule.cellDetails.rowIndex=parseInt(this.parent.getRows()[this.parent.grid.editModule.editModule.cellDetails.rowIndex].getAttribute("aria-rowIndex"),10)-1),this.parent.grid.editModule.closeEdit()},e}(),yi=function(){function e(e){l.Grid.Inject(l.CommandColumn),this.parent=e}return e.prototype.getModuleName=function(){return"commandColumn"},e.prototype.destroy=function(){},e}(),mi=function(){function e(e){l.Grid.Inject(l.DetailRow),this.parent=e,this.addEventListener()}return e.prototype.getModuleName=function(){return"detailRow"},e.prototype.addEventListener=function(){this.parent.on("dataBoundArg",this.dataBoundArg,this),this.parent.on("detaildataBound",this.detaildataBound,this),this.parent.grid.on("detail-indentcell-info",this.setIndentVisibility,this),this.parent.on("childRowExpand",this.childRowExpand,this),this.parent.on("rowExpandCollapse",this.rowExpandCollapse,this),this.parent.on("actioncomplete",this.actioncomplete,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("dataBoundArg",this.dataBoundArg),this.parent.off("detaildataBound",this.detaildataBound),this.parent.off("childRowExpand",this.childRowExpand),this.parent.off("rowExpandCollapse",this.rowExpandCollapse),this.parent.off("actioncomplete",this.actioncomplete),this.parent.grid.off("detail-indentcell-info",this.setIndentVisibility))},e.prototype.setIndentVisibility=function(e){e.visible=!1},e.prototype.dataBoundArg=function(){for(var e=this.parent.getRows().filter(function(e){return!e.classList.contains("e-detailrow")}),i=0;i<e.length;i++){var r=e[parseInt(i.toString(),10)].getElementsByClassName("e-detailrowcollapse"),n=this.parent.grid.getRowObjectFromUID(e[parseInt(i.toString(),10)].getAttribute("data-Uid")),o=(0,l.getObject)("parentItem",this.parent.grid.getCurrentViewRecords()[parseInt(i.toString(),10)]);((0,t.isNullOrUndefined)(o)||!(0,t.isNullOrUndefined)(o)&&ot(this.parent,n.data,this.parent.grid.getCurrentViewRecords()))&&this.parent.grid.detailRowModule.expand(r[0])}},e.prototype.childRowExpand=function(e){var i=e.row.getElementsByClassName("e-detailrowcollapse");(0,t.isNullOrUndefined)(i[0])||this.parent.grid.detailRowModule.expand(i[0])},e.prototype.rowExpandCollapse=function(e){if(!et(this.parent))for(var t=0;t<e.detailrows.length;t++)this.parent.toggleRowVisibility(e.detailrows[parseInt(t.toString(),10)],e.action)},e.prototype.detaildataBound=function(e){var i=e.data,r=e.detailElement.parentElement.previousSibling,n="e-gridrowindex"+((0,t.isNullOrUndefined)(i.parentItem)?i.index:i.parentItem.index)+"level"+i.level,o=r.querySelector("."+n).classList,a=[].slice.call(o).filter(function(e){return e===n}),s=a[0].length,d="e-griddetail"+a.toString().slice(6,s);(0,t.addClass)([e.detailElement.parentElement],d)},e.prototype.actioncomplete=function(e){if("beginEdit"===e.requestType||"add"===e.requestType){var t=e.row.querySelectorAll(".e-editcell")[0].getAttribute("colSpan"),i=parseInt(t,10)-1;e.row.querySelectorAll(".e-editcell")[0].setAttribute("colSpan",i.toString())}for(var r=this.parent.grid.contentModule.getRows(),n=0;n<r.length;n++)r[parseInt(n.toString(),10)].cells[0].visible=!1;(0,l.getObject)("focusModule",this.parent.grid).refreshMatrix(!0)({rows:this.parent.grid.contentModule.getRows()})},e.prototype.destroy=function(){this.removeEventListener()},e}(),Si=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),vi=function(e){function i(t,i){var r=e.call(this,t,i)||this;return r.isExpandCollapse=!1,r.translateY=0,r.maxiPage=0,r.recordAdded=!1,r.startIndex=-1,r.endIndex=-1,r.preTranslate=0,r.isRemoteExpand=!1,r.isDataSourceChanged=!1,r.addEventListener(),r}return Si(i,e),i.prototype.getModelGenerator=function(){return new ni(this.parent)},i.prototype.getRowByIndex=function(e){if(this.parent.enableVirtualization&&this.parent.isFrozenGrid())return this.getRowCollection(e,!0);var t=this.parent.getDataRows().find(function(t){return parseInt(t.getAttribute("aria-rowindex"),10)-1===e});return!t&&this.parent.isEdit&&"Batch"===this.parent.editSettings.mode?null!=e?this.parent.getRows()[parseInt(e.toString(),10)]:void 0:t},i.prototype.getFrozenRightVirtualRowByIndex=function(e){return this.getRowCollection(e,!1,!1,!0)},i.prototype.getRowCollection=function(e,t,i,r){var n=parseInt(this.parent.getRows()[0].getAttribute(We),10)-1,o=this.parent.getDataRows(),a=(i?this.parent.getCurrentViewRecords():o)[e-n];return this.parent.frozenRows&&this.parent.pageSettings.currentPage>1&&(a=i?e<=this.parent.frozenRows?this.parent.getRowsObject()[parseInt(e.toString(),10)].data:a:e<=this.parent.frozenRows?o[parseInt(e.toString(),10)]:o[e-n+this.parent.frozenRows]),null==a&&null!=e&&"Batch"===this.parent.editSettings.mode&&this.parent.isEdit&&t&&(a=o[parseInt(e.toString(),10)]),a},i.prototype.addEventListener=function(){this.parent.on(ve,this.virtualOtherAction,this),this.parent.on(Re,this.indexModifier,this)},i.prototype.virtualOtherAction=function(e){e.setTop?(this.translateY=0,this.startIndex=0,this.endIndex=this.parent.pageSettings.pageSize-1):e.isExpandCollapse&&(this.isExpandCollapse=!0)},i.prototype.indexModifier=function(e){var t=this.parent.getContent().querySelector(".e-content"),i=this.parent.pageSettings.pageSize;if((this.recordAdded||"delete"===e.requestType&&this.endIndex>e.count-this.parent.pageSettings.pageSize)&&this.startIndex>-1&&this.endIndex>-1){if(this.endIndex>e.count-i){var r=~~(t.scrollTop/this.parent.getRowHeight()),n=r+this.parent.getRows().length;n>e.count&&(n=r+(e.count-r)),this.startIndex=n-this.parent.getRows().length,this.endIndex=n}else("Top"!==this.parent.root.editSettings.newRowPosition&&-1!==this.parent.root.editModule.selectedIndex||-1!==this.parent.root.editModule.selectedIndex)&&(this.startIndex+=1,this.endIndex+=1);this.recordAdded=!1}this.isDataSourceChanged&&(this.startIndex=0,this.endIndex=i-1),this.endIndex-this.startIndex!==i&&this.totalRecords>i&&this.endIndex===this.totalRecords?(e.startIndex=this.endIndex-i,e.endIndex=this.endIndex):(e.startIndex=this.startIndex,e.endIndex=this.endIndex)},i.prototype.eventListener=function(t){var i=this;this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&tt(this.parent)?e.prototype.eventListener.call(this,"on"):(this.parent[""+t]("data-ready",this.onDataReady,this),this.parent[""+t]("refresh-virtual-block",this.refreshContentRows,this),this.fn=function(){i.observers.observes(function(e){return i.scrollListeners(e)},i.onEnteredAction(),i.parent);var e=i.parent;if(e.root.enablePersistence&&e.root.scrollPosition){i.content.scrollTop=e.root.scrollPosition.top,e.root.enableColumnVirtualization&&(i.content.scrollLeft=e.root.scrollPosition.left);var t={direction:"down",sentinel:i.observer.sentinelInfo.down,offset:e.root.scrollPosition,focusElement:e.element};i.scrollListeners(t)}i.parent.off("content-ready",i.fn)},this.parent.addEventListener("dataBound",this.dataBoundEvent.bind(this)),this.parent.addEventListener("rowSelected",this.rowSelectedEvent.bind(this)),this.parent[""+t]("select-virtual-Row",this.toSelectVirtualRow,this),this.parent.on("content-ready",this.fn,this),this.parent.addEventListener(E,this.handleActionBegin.bind(this)),this.parent.addEventListener(U,this.onActionComplete.bind(this)),this.parent[""+t]("virtual-scroll-edit-action-begin",this.beginEdit,this),this.parent[""+t]("virtual-scroll-add-action-begin",this.beginAdd,this),this.parent[""+t]("virtual-scroll-edit-success",this.virtualEditSuccess,this),this.parent[""+t]("edit-reset",this.resetIseditValue,this),this.parent[""+t]("get-virtual-data",this.getData,this),this.parent[""+t]("virtual-scroll-edit-cancel",this.cancelEdit,this),this.parent[""+t]("select-row-on-context-open",this.toSelectRowOnContextOpen,this),this.parent[""+t]("refresh-virtual-editform-cells",this.refreshCell,this),this.parent[""+t]("virtaul-cell-focus",this.cellFocus,this),this.parent[""+t]("virtual-scroll-edit",this.restoreEditState,this),this.parent[""+t]("set-virtual-page-query",this.SetVirtualPageQury,this))},i.prototype.cellFocus=function(t){e.prototype.virtualCellFocus.call(this,t)},i.prototype.onDataReady=function(i){if(e.prototype.onDataReady.call(this,i),!(this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&tt(this.parent))){if(!(0,t.isNullOrUndefined)(i.count)){if(this.totalRecords=i.count,this.parent.isFrozenGrid()&&i.count<Object.keys(this.parent.dataSource).length){var r=this.parent.enableColumnVirtualization?this.getColumnOffset(this.parent.columns.length-1)+"px":"100%",n=this.parent.getRowHeight()*i.count-this.parent.getRowHeight()*this.parent.pageSettings.pageSize;(0,t.getValue)("virtualEle",this).setVirtualHeight(n,r)}this.parent.enableColumnVirtualization||this.parent.isFrozenGrid()||(0,t.getValue)("virtualEle",this).setVirtualHeight(this.parent.getRowHeight()*i.count,"100%")}(!(0,t.isNullOrUndefined)(i.requestType)&&"collapseAll"===i.requestType.toString()||this.isDataSourceChanged&&(-1===this.startIndex||0===this.startIndex&&0===this.preStartIndex))&&(this.contents.scrollTop=0,this.isDataSourceChanged=!1)}},i.prototype.renderTable=function(){e.prototype.renderTable.call(this),this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url&&tt(this.parent)||((0,t.getValue)("observer",this).options.debounceEvent=!1,this.observers=new wi((0,t.getValue)("observer",this).element,(0,t.getValue)("observer",this).options),this.contents=this.getPanel().firstChild)},i.prototype.getTranslateY=function(t,i,r,n){if(this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||tt(this.parent)){if(this.isRemoteExpand)return this.isRemoteExpand=!1,this.preTranslate;this.preTranslate=e.prototype.getTranslateY.call(this,t,i,r,n)}return e.prototype.getTranslateY.call(this,t,i,r,n)},i.prototype.dataBoundEvent=function(){var i="initialRowTop";if(!(0,t.isNullOrUndefined)(this.parent.getRows())&&this.parent.getRows().length&&!(0,t.isNullOrUndefined)(this.parent.getRowByIndex(0))&&!this[""+i]){var r=this.parent.getRowByIndex(0).getBoundingClientRect().top,n=this.parent.element.getBoundingClientRect().top;r>0?this[""+i]=this.parent.getRowByIndex(0).getBoundingClientRect().top-n:-1===this.parent.selectedRowIndex&&(this[""+i]=this.content.getBoundingClientRect().top-this.parent.getRowByIndex(0).getBoundingClientRect().height)}e.prototype.dataBound.call(this)},i.prototype.rowSelectedEvent=function(t){e.prototype.rowSelected.call(this,t),this.parent.notify("virtualTransform",{requestType:"transformChange"})},i.prototype.toSelectVirtualRow=function(i){if(!this.parent.isEdit){var r="containerRect";(0,t.isNullOrUndefined)(this.observer[""+r])&&(this.observer[""+r]=this.observers[""+r]);var n=this.parent.clipboardModule.treeGridParent;if((0,t.isNullOrUndefined)(n.editModule)||(0,t.isNullOrUndefined)(n.editModule.addRowIndex)||0!==i.selectedIndex){if(!(0,t.isNullOrUndefined)(n.grid.sortModule)&&n.grid.sortModule.sortedColumns.length>0){var o=n.dataModule.sortedData;if(!(0,t.isNullOrUndefined)(o)&&o.length>0){var a=o.findIndex(function(e){return e.index===i.selectedIndex});i.selectedIndex=a}}e.prototype.selectVirtualRow.call(this,i)}}},i.prototype.refreshCell=function(e){e.cells=this.generateCells()},i.prototype.generateCells=function(){for(var e=[],t=0;t<this.parent.columns.length;t++)e.push(this.generateCell(this.parent.columns[parseInt(t.toString(),10)]));return e},i.prototype.getVirtualRowIndex=function(e){return(0,t.isNullOrUndefined)(this.prevInfo)?e:this.parent.getRowsObject()[0].index+e},i.prototype.generateCell=function(e,i,r,n,o,a){var s={visible:e.visible,isDataCell:!(0,t.isNullOrUndefined)(e.field||e.template),isTemplate:!(0,t.isNullOrUndefined)(e.template),rowID:i,column:e,cellType:(0,t.isNullOrUndefined)(r)?l.CellType.Data:r,colSpan:n,commands:e.commands,isForeignKey:e.isForeignColumn&&e.isForeignColumn(),foreignKeyData:e.isForeignColumn&&e.isForeignColumn()&&(0,t.getValue)(e.field,a)};return(s.isDataCell||"checkbox"===s.column.type||s.commands)&&(s.index=o),new l.Cell(s)},i.prototype.beginEdit=function(e){this.editedRowIndex=e.index;var t='.e-row[aria-rowindex="'+(e.index+1)+'"]',i=this.parent.getContent().querySelector(t).rowIndex,r=this.parent.getCurrentViewRecords()[parseInt(i.toString(),10)];e.data=r},i.prototype.beginAdd=function(t){var i={newRowPosition:this.rowPosition,addRowIndex:this.addRowIndex,dataRowIndex:this.dataRowIndex};this.parent.notify("get-row-position",i),this.rowPosition=i.newRowPosition,this.addRowIndex=i.addRowIndex,this.dataRowIndex=i.dataRowIndex;var r=this.parent.getRows(),n=r.length?+r[0].getAttribute("aria-rowindex")-1:0,o=r.length?+r[r.length-1].getAttribute("aria-rowindex")-1:0,a=this.parent.selectedRowIndex>=n&&this.parent.selectedRowIndex<=o;"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.isAdd=!0),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.addRowIndex&&-1!==this.addRowIndex||-1!==this.parent.selectedRowIndex&&a)||e.prototype.addActionBegin.call(this,t)},i.prototype.restoreEditState=function(){e.prototype.restoreEdit.call(this)},i.prototype.SetVirtualPageQury=function(e){var t=[];if(this.prevInfo&&this.prevInfo.blockIndexes&&(t=(0,l.getVisiblePage)(this.prevInfo.blockIndexes)),"refresh"===this.requestType&&t.length)return e.query.skip(this.parent.pageSettings.pageSize*(t[0]-1)),e.query.take(this.parent.pageSettings.pageSize*t.length),void(e.skipPage=!0)},i.prototype.resetIseditValue=function(){this.parent.notify("reset-edit-props",{}),"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition||!this.isAdd||e.prototype.resetIsedit.call(this)},i.prototype.virtualEditSuccess=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&e.querySelector(".e-addedrow")&&(this.recordAdded=!0)},i.prototype.cancelEdit=function(t){e.prototype.editCancel.call(this,t)},i.prototype.toSelectRowOnContextOpen=function(t){e.prototype.selectRowOnContextOpen.call(this,t)},i.prototype.restoreNewRow=function(){var e=this.parent.getContent().querySelector(".e-content");this.isAdd&&!e.querySelector(".e-addedrow")&&(this.parent.isEdit=!1,this.parent.editModule.addRecord(null,this.parent.root.editModule.selectedIndex))},i.prototype.getData=function(t){e.prototype.getVirtualData.call(this,t)},i.prototype.handleActionBegin=function(t){e.prototype.actionBegin.call(this,t)},i.prototype.onActionComplete=function(t){if("add"===t.requestType){var i={newRowPosition:this.rowPosition,addRowIndex:this.addRowIndex,dataRowIndex:this.dataRowIndex};this.parent.notify("get-row-position",i),this.rowPosition=i.newRowPosition,this.addRowIndex=i.addRowIndex,this.dataRowIndex=this.parent.root.editModule.selectedIndex}e.prototype.actionComplete.call(this,t)},i.prototype.onEnteredAction=function(){var e=this;return function(i,r,n,o,a,s){if(!e.parent.directVirtualRender){var d="preventEvent";!t.Browser.isIE||a||!s||e[""+d]||e.parent.enableVirtualMaskRow||e.parent.showSpinner(),e.parent.enableVirtualMaskRow&&!e[""+d]&&setTimeout(function(){e.parent.showMaskRow(r.axis),e.parent.notify("showGanttShimmer",{requestType:"showShimmer"})},0);var l=e.content.getBoundingClientRect().height,p=e.prevInfo.offsets?e.prevInfo.offsets.top:null,h="X"===r.axis,c=e.getColumnOffset(h?e.vgenerator.getColumnIndexes()[0]-1:e.prevInfo.columnIndexes[0]-1);if(e.parent.isFrozenGrid()&&e.parent.enableColumnVirtualization&&e.currentInfo&&e.currentInfo.columnIndexes){var u=e.currentInfo.columnIndexes[0]-1,g=0;e.parent.getColumns().filter(function(e){e.visible&&"Left"===e.freeze&&(g+=parseInt(e.width.toString(),10))}),u>e.parent.getVisibleFrozenLeftCount()&&(c-=g)}if(h){var f=Object.keys(e.vgenerator.cOffsets).length-e.prevInfo.columnIndexes.length,y=e.vgenerator.cOffsets[f-1];c=c>y?y:c}var m=e.getTranslateY(o.top,l,h&&p===o.top?e.prevInfo:void 0,!0);if(!e.parent.isFrozenGrid()||e.parent.enableVirtualMaskRow){if(e.parent.enableVirtualMaskRow){var S=o.top-e.translateY<0;m=Math.round(e.translateY)>m&&!S?Math.round(e.translateY):m,e.virtualEle.adjustTable(c,m)}else e.virtualEle.adjustTable(c,e.translateY);e.parent.enableColumnVirtualization&&(e.header.virtualEle.adjustTable(c,0),e.parent.isFrozenGrid()&&e.parent.contentModule.resetStickyLeftPos(c))}}}},i.prototype.scrollListeners=function(e){this.scrollAfterEdit(),this.shouldPreventScrolling(e),this.parent.root.enablePersistence&&(this.parent.root.scrollPosition=e.offset);var i,r=e.sentinel,n=this.parent.getRowHeight(),o=this.parent.pageSettings.pageSize-Math.ceil(this.parent.pageSettings.pageSize/2);(0,t.isNullOrUndefined)(this.parent.contentModule)||(i=this.parent.getContent().querySelector(".e-content"));var a=o*n,s=e.offset.top-this.translateY<0&&"downArrow"!==this.activeKey,d=Math.ceil(e.offset.top-this.translateY)+n>=a,l="selectedRowIndex",p=this.parent.currentViewData,h="index";if(s&&"right"!==e.direction&&"left"!==e.direction&&!(0,t.isNullOrUndefined)(i)){var c=+(this.parent.height.toString().indexOf("%")<0?parseInt(this.parent.height.toString(),10):this.parent.element.getBoundingClientRect().height),u=Math.floor(i.scrollTop/n)+Math.ceil(c/n)-this.parent.pageSettings.pageSize;if(u=u>0?u:0,!(0,t.isNullOrUndefined)(this[""+l])&&-1!==this[""+l]&&u!==this[""+l]&&this.parent.rowHeight*this.parent.pageSettings.pageSize<i.scrollTop&&!this.parent.allowRowDragAndDrop&&(u=this[""+l]),this.startIndex=u,this.endIndex=u+this.parent.pageSettings.pageSize,this.endIndex>this.totalRecords){var g=this.totalRecords,f=this.endIndex%g;this.endIndex=g,this.startIndex=this.startIndex-f<0?0:this.startIndex-f}p.length&&p[0][""+h]>=this.parent.pageSettings.pageSize/2&&p[0][""+h]-this.startIndex<this.parent.pageSettings.pageSize/2&&this.parent.selectionModule&&this.parent.selectionModule.isRowSelected&&(this.startIndex=p[0][""+h]-this.parent.pageSettings.pageSize/2,this.endIndex=this.startIndex+this.parent.pageSettings.pageSize);var y=Math.ceil(e.offset.top/n);y%=this.parent.pageSettings.pageSize;var m=0;if(!(0,t.isNullOrUndefined)(this.parent.getRows()[parseInt(y.toString(),10)])&&!(0,t.isNullOrUndefined)(this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(y.toString(),10)]))m=+this.parent.getContent().querySelectorAll(".e-content tr")[parseInt(y.toString(),10)].querySelector("td").getAttribute("index");0===m?this.endIndex-this.startIndex<this.parent.pageSettings.pageSize?this.translateY=(0,t.isNullOrUndefined)(this.endIndex)?0:(this.endIndex-this.parent.pageSettings.pageSize)*(this.parent.rowHeight?this.parent.rowHeight:this.parent.getRowHeight()):this.startIndex===this[""+l]?this.translateY=e.offset.top:this.translateY=e.offset.top-o*n>0?e.offset.top-o*n+n:0:this.parent.getFrozenColumns()>0?(e.offset.top=e.offset.top+80,this.translateY=e.offset.top-o*n>0?e.offset.top-o*n+10:0):this.translateY=e.offset.top-o*n>0?e.offset.top-o*n+10:0}else if(d&&"right"!==e.direction&&"left"!==e.direction&&!(0,t.isNullOrUndefined)(i)){var S=~~(i.scrollTop/n),v=!(this[""+l]+this.parent.pageSettings.pageSize<this.totalRecords);(0,t.isNullOrUndefined)(this[""+l])||-1===this[""+l]||S===this[""+l]||v||this.parent.allowRowDragAndDrop||(S=this[""+l]);var w=S+this.parent.pageSettings.pageSize;w>this.totalRecords&&(w=S+(this.totalRecords-S)),this.startIndex=!v||(0,t.isNullOrUndefined)(this[""+l])?w-this.parent.pageSettings.pageSize:S,this.endIndex=w,S+this.parent.pageSettings.pageSize>this.totalRecords&&this.endIndex-this.startIndex<this.parent.pageSettings.pageSize/2&&this.endIndex-S<this.parent.pageSettings.pageSize/2&&(this.startIndex=w-this.parent.pageSettings.pageSize/2),e.offset.top>n*this.totalRecords?this.translateY=this.getTranslateY(e.offset.top,i.getBoundingClientRect().height):this.totalRecords===this.endIndex?this.totalRecords===this.endIndex&&(this.parent.isEdit?this.translateY=this.totalRecords*n-this.parent.pageSettings.pageSize*n+n:this.translateY=this.totalRecords*n-this.parent.pageSettings.pageSize*n):this.parent.getFrozenColumns()>0?this.translateY=e.offset.top-(2*n+this.parent.pageSettings.pageSize):this.translateY=e.offset.top}if(d&&"up"!==e.direction&&e.offset.top<n*this.totalRecords||s||"right"===e.direction||"left"===e.direction||this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url){var I=this.currentInfo=(0,t.getValue)("getInfoFromView",this).apply(this,[e.direction,r,e.offset]);if(this.previousInfo=I,this.prevInfo&&et(this.parent.root)&&"model-changed"!==I.event&&("Y"===r.axis&&this.prevInfo.blockIndexes.toString()===I.blockIndexes.toString()||"X"===r.axis&&this.prevInfo.columnIndexes.toString()===I.columnIndexes.toString()||this.parent.isFrozenGrid()&&this.parent.getVisibleFrozenLeftCount()>=I.columnIndexes[0]&&this.prevInfo.columnIndexes.toString().includes(I.columnIndexes.toString())))return this.parent.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}),t.Browser.isIE&&this.parent.hideSpinner(),this.requestType="virtualscroll"===this.requestType?this.empty:this.requestType,void("Y"===r.axis&&this.restoreEditState());this.parent.setColumnIndexesInView(this.parent.enableColumnVirtualization?I.columnIndexes:[]);var R=I.loadNext&&!I.loadSelf?I.nextInfo.page:I.page;this.parent.setProperties({pageSettings:{currentPage:R}},!0),this.requestType="virtualscroll","right"===e.direction||"left"===e.direction||et(this.parent.root)||(I.event="refresh-virtual-block"===I.event?"model-changed":I.event),this.parent.enableVirtualMaskRow&&(this.parent.showMaskRow(r.axis),this.parent.addShimmerEffect(),this.parent.notify("showGanttShimmer",{requestType:"showShimmer"})),this.parent.notify(I.event,{requestType:"virtualscroll",virtualInfo:I,focusElement:e.focusElement})}else this.parent.enableVirtualMaskRow&&(this.parent.removeMaskRow(),this.parent.notify("removeGanttShimmer",{requestType:"hideShimmer"}))},i.prototype.shouldPreventScrolling=function(e){this.parent.element.querySelector(".e-addedrow")&&"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&0!==e.offset.top&&this.parent.closeEdit()},i.prototype.appendContent=function(i,r,n){if(this.parent.dataSource instanceof Ze.DataManager&&void 0!==this.parent.dataSource.dataSource.url&&!this.parent.dataSource.dataSource.offline&&""!==this.parent.dataSource.dataSource.url||tt(this.parent)||this.parent.isFrozenGrid()&&(void 0===n.requestType||!(0,t.isNullOrUndefined)(n.virtualInfo)&&("right"===n.virtualInfo.direction||"left"===n.virtualInfo.direction)))(0,t.getValue)("isExpandCollapse",n)&&(this.isRemoteExpand=!0),e.prototype.appendContent.call(this,i,r,n),-1!==(0,t.getValue)("requestTypes",this).indexOf("isFrozen")&&((0,t.getValue)("requestTypes",this).splice((0,t.getValue)("requestTypes",this).indexOf("isFrozen"),1),this.requestType="isFrozen"===this.requestType?void 0:this.requestType);else{var o=n.virtualInfo.sentinelInfo&&"Y"===n.virtualInfo.sentinelInfo.axis&&(0,t.getValue)("currentInfo",this).page&&(0,t.getValue)("currentInfo",this).page!==n.virtualInfo.page?(0,t.getValue)("currentInfo",this):n.virtualInfo,a=o.columnIndexes[0]-1,s=this.getColumnOffset(a),d=void 0;if(this.parent.enableColumnVirtualization){this.header.virtualEle.adjustTable(s,0);var l=o.columnIndexes;d=this.getColumnOffset(l[l.length-1])-this.getColumnOffset(l[0]-1)+"",this.header.virtualEle.setWrapperWidth(d)}this.virtualEle.setWrapperWidth(d,t.Browser.isIE||"edge"===t.Browser.info.name),(i=this.parent.createElement("tbody")).appendChild(r);this.getTable().querySelector("tbody").replaceWith(i),"virtualscroll"===n.requestType&&"Y"===n.virtualInfo.sentinelInfo.axis&&(this.isExpandCollapse=!1);if(this.parent.enableColumnVirtualization&&this.parent.isFrozenGrid()){var p=0;this.parent.getColumns().filter(function(e){e.visible&&(parseInt(e.width.toString(),10),"Left"===e.freeze&&(p+=parseInt(e.width.toString(),10)))});l=o.columnIndexes;d=this.getColumnOffset(l[l.length-1])-this.getColumnOffset(l[0]-1)+"",a>this.parent.getVisibleFrozenLeftCount()&&(s-=p),this.resetStickyLeftPos(s,r)}this.isExpandCollapse&&0!==this.translateY?this.isExpandCollapse=!1:(this.translateY=this.translateY<0?0:this.translateY,(0,t.getValue)("virtualEle",this).adjustTable(s,this.translateY),this.parent.enableColumnVirtualization&&(this.header.virtualEle.adjustTable(s,0),this.parent.isFrozenGrid()&&this.resetStickyLeftPos(s))),(0,t.setValue)("prevInfo",this.previousInfo?this.previousInfo:o,this),"virtualscroll"===n.requestType&&"X"===n.virtualInfo.sentinelInfo.axis&&this.parent.notify(ke,{});e.prototype.focusCell.call(this,n);var h="isAdd";this[""+h]&&!this.parent.getContent().querySelector(".e-content").querySelector(".e-addedrow")&&"Top"!==this.rowPosition&&"Bottom"!==this.rowPosition&&(this.dataRowIndex>=this.startIndex?this.restoreNewRow():this.addRowIndex&&this.addRowIndex>-1&&(this[""+h]=!1,this.parent.isEdit=!1)),this.restoreEditState(),e.prototype.restoreAdd.call(this),e.prototype.ensureSelectedRowPosition.call(this)}},i.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("data-ready",this.onDataReady),this.parent.off("content-ready",this.fn),this.parent.off("select-virtual-Row",this.toSelectVirtualRow),this.parent.off("dataBound",this.dataBoundEvent),this.parent.off("rowSelected",this.rowSelectedEvent),this.parent.off(ve,this.virtualOtherAction),this.parent.off(Re,this.indexModifier),this.parent.off("virtual-scroll-edit-action-begin",this.beginEdit),this.parent.off("virtual-scroll-add-action-begin",this.beginAdd),this.parent.off("virtual-scroll-edit-success",this.virtualEditSuccess),this.parent.off("edit-reset",this.resetIseditValue),this.parent.off("get-virtual-data",this.getData),this.parent.off("virtual-scroll-edit-cancel",this.cancelEdit),this.parent.off("select-row-on-context-open",this.toSelectRowOnContextOpen),this.parent.off("refresh-virtual-editform-cells",this.refreshCell),this.parent.off("virtaul-cell-focus",this.cellFocus),this.parent.off("virtual-scroll-edit",this.restoreEditState))},i}(l.VirtualContentRenderer),wi=function(e){function i(){var t=null!==e&&e.apply(this,arguments)||this;return t.isWheeling=!1,t.newPos=0,t.lastPos=0,t.timer=0,t}return Si(i,e),i.prototype.observes=function(i,r,n){if(e.prototype.containerRect=(0,t.getValue)("options",this).container.getBoundingClientRect(),t.EventHandler.add((0,t.getValue)("options",this).container,"scroll",this.virtualScrollHandlers(i,r,n),this),(0,t.getValue)("options",this).movableContainer){e.prototype.movableContainerRect=(0,t.getValue)("options",this).movableContainer.getBoundingClientRect(),t.EventHandler.add((0,t.getValue)("options",this).movableContainer,"scroll",this.virtualScrollHandlers(i,r,n),this)}},i.prototype.clear=function(){this.lastPos=null},i.prototype.virtualScrollHandlers=function(e,i,r){var n=this,o="chrome"===t.Browser.info.name?200:100,a="options",s="movableEle",d="fromWheel",l=(0,t.debounce)(e,o),p=(0,t.debounce)(e,50);this[""+a].prevTop=this[""+a].prevLeft=0;var h="isScrollByFocus";return function(t){var o,c="keyPress";if(r&&r.root&&r.root.editModule&&r.root.editModule[""+c]&&(o=r.root.editModule[""+c]),r.isEdit&&r.root.editModule[""+h]||r.isEdit&&("tab"===o||"shiftTab"===o))r.root.editModule[""+h]=!1;else{var u=n[""+a].movableContainer?n[""+a].container.scrollTop:t.target.scrollTop,g=n[""+a].movableContainer?n[""+a].scrollbar.scrollLeft:t.target.scrollLeft,f=n[""+a].prevTop<u?"down":"up";f=n[""+a].prevLeft===g?f:n[""+a].prevLeft<g?"right":"left",n[""+a].prevTop=u,n[""+a].prevLeft=g;var y=n.sentinelInfo[""+f],m=0;if(n.newPos=u,null!=n.lastPos&&(m=n.newPos-n.lastPos),n.lastPos=n.newPos,n.timer&&clearTimeout(n.timer),n.timer=setTimeout(n.clear,0),(m>100||m<-100)&&t&&t.preventDefault&&(t.returnValue=!1,t.preventDefault()),-1!==n[""+a].axes.indexOf(y.axis)){n.containerRect=n[""+a].container.getBoundingClientRect();var S=n.check(f);if(y.entered&&("X"===y.axis||r.enableVirtualMaskRow)&&(!n[""+s]||"right"!==f&&"left"!==f?i(n.element,y,f,{top:u,left:g},n[""+d],S):i(n[""+s],y,f,{top:u,left:g},n[""+d],S)),S){var v=p;"X"===y.axis?v({direction:f,sentinel:y,offset:{top:u,left:g},focusElement:document.activeElement}):r.dataSource instanceof Ze.DataManager&&void 0!==r.dataSource.dataSource.url&&!r.dataSource.dataSource.offline&&""!==r.dataSource.dataSource.url||tt(r)||r.enableVirtualMaskRow?(v=r.enableVirtualMaskRow?l:v)({direction:f,sentinel:y,offset:{top:u,left:g},focusElement:document.activeElement}):e({direction:f,sentinel:y,offset:{top:u,left:g},focusElement:document.activeElement})}n[""+d]=!1}}}},i}(l.InterSectionObserver),Ii=function(){var e=function(t,i){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])},e(t,i)};return function(t,i){function r(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}(),Ri=function(){function e(e){this.prevstartIndex=-1,this.setEndIndexToGantt=!0,this.prevendIndex=-1,this.prevSelectedRecord=[],this.parent=e,l.Grid.Inject(xi),this.addEventListener()}return e.prototype.getModuleName=function(){return"virtualScroll"},e.prototype.addEventListener=function(){this.parent.isDestroyed||(this.parent.on(K,this.collapseExpandVirtualchilds,this),this.parent.on(W,this.virtualPageAction,this),this.parent.on(we,this.destroy,this))},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off(K,this.collapseExpandVirtualchilds),this.parent.off(W,this.virtualPageAction),this.parent.off(we,this.destroy))},e.prototype.collapseExpandVirtualchilds=function(e){this.parent.grid.notify(ve,{isExpandCollapse:!0}),this.expandCollapseRec=e.record,e.record.expanded="collapse"!==e.action,this.parent.flatData.map(function(t){return t.expanded=t.uniqueID===e.record.uniqueID&&t.expanded!==e.record.expanded?e.record.expanded:t.expanded});var i={result:this.parent.flatData,row:e.row,action:e.action,record:e.record,count:this.parent.flatData.length};this.handleSelection();var r=(0,t.getValue)("isCollapseAll",this.parent)?"collapseAll":"refresh";(0,t.getValue)("grid.renderModule",this.parent).dataManagerSuccess(i,{requestType:r})},e.prototype.handleSelection=function(){("Cell"===this.parent.selectionSettings.mode||"Row"===this.parent.selectionSettings.mode&&!this.parent.selectionSettings.persistSelection)&&this.parent.grid.clearSelection(),(0,t.getValue)("isCollapseAll",this.parent)&&this.parent.selectionSettings.persistSelection&&this.parent.getSelectedRecords().length>0&&(this.prevSelectedRecord=this.parent.getSelectedRecords(),this.parent.grid.clearSelection())},e.prototype.virtualPageAction=function(e){var i=this,r=new Ze.DataManager(e.result),n=new Ze.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),o=r.executeLocal((new Ze.Query).where(n)),a=o.filter(function(e){return ot(i.parent,e,o)});this.visualData=a,e.count=a.length,this.parent.grid.notify(Ie,{data:a});var s={startIndex:-1,endIndex:-1,count:e.count,requestType:e.actionArgs.requestType};this.parent.grid.notify(Re,s);var d=s.startIndex,p=s.endIndex;if(e.count=a.length,-1===d&&-1===p){var h=new Ze.Query,c=this.parent.grid.pageSettings.pageSize,u=c*(this.parent.grid.pageSettings.currentPage-1);h=h.skip(u).take(c),r.dataSource.json=a,e.result=r.executeLocal(h)}else{var g=e.actionArgs.requestType;("filtering"===g||"collapseAll"===g||"searching"===g||"refresh"===g&&(0,t.getValue)("isExpandAll",this.parent)||"refresh"===g&&this.parent.enableCollapseAll&&p>a.length&&(0,t.isNullOrUndefined)(this.expandCollapseRec))&&(d=0,p=this.parent.grid.pageSettings.pageSize,this.parent.grid.getContent().firstElementChild.scrollTop=0,this.parent.grid.notify(ve,{setTop:!0})),("save"===g&&e.actionArgs.index>=s.count-this.parent.grid.pageSettings.pageSize||"refresh"===g&&this.parent.isGantt&&this.parent.isAddedFromGantt)&&(this.setEndIndexToGantt&&(this.ganttEndIndex=s.endIndex),(s.endIndex+this.parent.pageSettings.pageSize>=s.count&&this.parent.root&&s.count!==this.ganttEndIndex&&this.parent.isAddedFromGantt||!this.parent.isGantt||!this.parent.isAddedFromGantt)&&(d=s.startIndex+(s.count-s.endIndex),p=s.count,this.setEndIndexToGantt=!1),this.ganttEndIndex=p,this.parent.isAddedFromGantt=!1);var f=this.parent.grid.contentModule.virtualEle.wrapper,y=(0,l.getTransformValues)(f).height;if(!(0,t.isNullOrUndefined)(this.expandCollapseRec)&&("virtualscroll"===e.actionArgs.requestType||"refresh"===e.actionArgs.requestType&&d!==this.prevstartIndex)&&d<this.parent.getRows().length&&p<=d+this.parent.getRows().length&&0===y&&(d=0),"save"===e.actionArgs.requestType&&d!==this.prevstartIndex&&d<this.parent.getRows().length&&p<=d+this.parent.getRows().length&&0===y&&(p=(d=0)+this.parent.grid.pageSettings.pageSize),!(0,t.isNullOrUndefined)(this.expandCollapseRec)){var m=this.parent.grid.pageSettings.pageSize,S=a.indexOf(this.expandCollapseRec);if(a.slice(S,S+m).length<m&&S>=0&&0!==d){if(S=(S=a.length-m)>0?S:0,(p=a.length)-d<m){if(d=S,a.indexOf(this.expandCollapseRec)>a.length-m/2){var v=d*this.parent.grid.getRowHeight();this.parent.grid.contentModule.translateY=v,this.parent.grid.contentModule.virtualEle.adjustTable(0,v)}}}else(0,t.getValue)("isCollapseAll",this.parent)&&(d=0,p=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify(ve,{setTop:!0}))}"collapseAll"!==this.prevrequestType||"virtualscroll"!==e.actionArgs.requestType||(0,t.isNullOrUndefined)(this.parent.idMapping)||0!==d||(d=0,p=this.parent.grid.pageSettings.pageSize-1,this.parent.grid.notify(ve,{setTop:!0})),!this.parent.enableCollapseAll&&!this.parent.expandStateMapping||(0,t.isNullOrUndefined)(this.expandCollapseRec)||(e.count<this.parent.getRows()[0].getBoundingClientRect().height?d=0:this.parent.isExpandAll||0!==this.parent.grid.contentModule.translateY||(d=-1===this.prevstartIndex?0:this.prevstartIndex)),this.expandCollapseRec=null,d=d<0?0:d,0===p&&a.length>0?e.result=a:e.result=a.slice(d,p),this.prevstartIndex=d,this.prevendIndex=p,this.prevrequestType=e.actionArgs.requestType}this.parent.notify("updateAction",e)},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.updateSelection=function(e){if(e.isHeaderCheckboxClicked&&this.parent.grid.currentViewData.length!==this.parent.grid.selectionModule.selectedRowIndexes.length&&e.target.classList.contains("e-uncheck"))for(var t=0;t<this.parent.getRows().length;t++)this.parent.getRows()[parseInt(t.toString(),10)].getElementsByClassName("e-frame e-icons e-uncheck").length&&!this.parent.getRows()[parseInt(t.toString(),10)].querySelector(".e-checkbox-disabled")&&this.parent.grid.selectionModule.updateRowSelection(this.parent.getRows()[parseInt(t.toString(),10)],this.parent.getCurrentViewRecords()[parseInt(t.toString(),10)].index)},e}(),xi=function(e){function i(i,r){var n=e.call(this,i,r)||this;return(0,t.getValue)("parent",n).off("initial-load",(0,t.getValue)("instantiateRenderer",n),n),(0,t.getValue)("parent",n).on("initial-load",n.instantiateRenderers,n),n}return Ii(i,e),i.prototype.getModuleName=function(){return"treeVirtualScroll"},i.prototype.instantiateRenderers=function(){var e=(0,t.getValue)("parent",this);(0,t.getValue)("parent",this).log(["limitation","virtual_height"],"virtualization");var i=(0,t.getValue)("locator",this).getService("rendererFactory");e.enableColumnVirtualization&&(0,t.getValue)("addRenderer",i).apply(i,[l.RenderType.Header,new l.VirtualHeaderRenderer((0,t.getValue)("parent",this),(0,t.getValue)("locator",this))]),(0,t.getValue)("addRenderer",i).apply(i,[l.RenderType.Content,new vi((0,t.getValue)("parent",this),(0,t.getValue)("locator",this))]),this.ensurePageSize()},i.prototype.ensurePageSize=function(){var e=(0,t.getValue)("parent",this),i=e.getRowHeight();(0,t.isNullOrUndefined)(e.height)||"string"!=typeof e.height||-1===e.height.indexOf("%")||(e.element.style.height=e.height);var r=2*~~((e.height.toString().indexOf("%")<0?parseInt(e.height.toString(),10):e.element.getBoundingClientRect().height)/i),n=e.pageSettings.pageSize;e.setProperties({pageSettings:{pageSize:n<r?r:n}},!0)},i}(l.VirtualScroll),Ci=function(){function e(e){l.Grid.Inject(l.Freeze),this.parent=e,this.addEventListener()}return e.prototype.addEventListener=function(){this.parent.on("rowExpandCollapse",this.rowExpandCollapse,this),this.parent.on("dataBoundArg",this.dataBoundArg,this),this.parent.grid.on("dblclick",this.dblClickHandler,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("rowExpandCollapse",this.rowExpandCollapse),this.parent.off("dataBoundArg",this.dataBoundArg),this.parent.grid.off("dblclick",this.dblClickHandler))},e.prototype.rowExpandCollapse=function(e){var i,r,n=this.parent.getDataRows(),o=this.parent.getRows(),a=this.parent.getFrozenLeftColumnsCount()>0||this.parent.getFrozenRightColumnsCount()>0;a&&(r=this.parent.getRows().filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))})),i=e.detailrows.length?e.detailrows:n.filter(function(t){return t.querySelector(".e-gridrowindex"+e.record.index+"level"+(e.record.level+1))});for(var s=0;s<i.length;s++){var d=i[parseInt(s.toString(),10)],l=this.parent.grid.getRowObjectFromUID(d.getAttribute("data-uid")).data;!(0,t.isNullOrUndefined)(n)&&d.parentElement.firstElementChild.clientHeight>0&&(d.style.height=d.parentElement.firstElementChild.clientHeight+"px"),this.parent.toggleRowVisibility(d,e.action),a&&r.length&&this.parent.toggleRowVisibility(r[parseInt(s.toString(),10)],e.action);var p="e-childrow-hidden"===e.action?".e-treecolumn-container .e-treegridcollapse":".e-treecolumn-container .e-treegridexpand";if(o[d.rowIndex].querySelector(p)){for(var h=[],c=0;c<n.length;c++)n[parseInt(c.toString(),10)].querySelector(".e-gridrowindex"+l.index+"level"+(l.level+1))&&h.push(n[parseInt(c.toString(),10)]);if(h.length){var u=this.parent.getCurrentViewRecords()[h[0].rowIndex];this.rowExpandCollapse({detailrows:h,action:e.action,record:u})}}}},e.prototype.dblClickHandler=function(e){(0,l.parentsUntil)(e.target,"e-rowcell")&&this.parent.grid.editSettings.allowEditOnDblClick&&"Cell"!==this.parent.editSettings.mode&&!e.target.classList.contains("e-treegridcollapse")&&!e.target.classList.contains("e-treegridexpand")&&this.parent.startEdit((0,l.parentsUntil)(e.target,"e-row"))},e.prototype.dataBoundArg=function(){this.parent.getColumns().filter(function(e){return e.showCheckbox}).length&&this.parent.freezeModule&&this.parent.initialRender&&(0,t.addClass)([this.parent.element.getElementsByClassName("e-grid")[0]],"e-checkselection")},e.prototype.destroy=function(){this.removeEventListener()},e.prototype.getModuleName=function(){return"freeze"},e}(),bi=function(){function e(e){l.Grid.Inject(l.ColumnChooser),this.parent=e}return e.prototype.openColumnChooser=function(e,t){return this.parent.grid.columnChooserModule.openColumnChooser(e,t)},e.prototype.destroy=function(){},e.prototype.getModuleName=function(){return"ColumnChooser"},e}(),Di=function(){function e(e){this.parent=e,l.Grid.Inject(l.InfiniteScroll),this.addEventListener()}return e.prototype.getModuleName=function(){return"infiniteScroll"},e.prototype.addEventListener=function(){this.parent.on(W,this.infinitePageAction,this),this.parent.on("infinite-remote-expand",this.infiniteRemoteExpand,this),this.parent.grid.on("delete-complete",this.infiniteDeleteHandler,this),this.parent.grid.on("infinite-edit-handler",this.infiniteEditHandler,this),this.parent.grid.on("infinite-crud-cancel",this.createRows,this),this.parent.grid.on("content-ready",this.contentready,this)},e.prototype.removeEventListener=function(){this.parent.isDestroyed||(this.parent.off("infinite-remote-expand",this.infiniteRemoteExpand),this.parent.grid.off("delete-complete",this.infiniteDeleteHandler),this.parent.grid.off("infinite-edit-handler",this.infiniteEditHandler),this.parent.off(W,this.infinitePageAction),this.parent.grid.off("infinite-crud-cancel",this.createRows),this.parent.grid.off("content-ready",this.contentready))},e.prototype.infiniteRemoteExpand=function(e){for(var t=this.parent.grid.getRowsObject(),i=this.parent.grid.infiniteScrollModule.serviceLocator,r=new l.RowRenderer(i,null,this.parent.grid),n=this.parent.getRows(),o=e.index===n.length-1?"after":"before",a=this.parent.grid.getColumns(),s=this.parent.grid.infiniteScrollModule.generateRows(e.childData,e),d=[],p=0;p<s.length;p++)d.push(r.render(s[parseInt(p.toString(),10)],a));t.splice.apply(t,[e.index+1,0].concat(s));for(p=0;p<d.length;p++)"after"===o?n[e.index+p][""+o](d[parseInt(p.toString(),10)]):n[e.index+p+1][""+o](d[parseInt(p.toString(),10)]),n.splice(e.index+1+p,0,d[parseInt(p.toString(),10)]);(0,l.resetRowIndex)(this.parent.grid,this.parent.grid.getRowsObject(),this.parent.grid.getRows(),0)},e.prototype.contentready=function(){if(this.parent.infiniteScrollSettings.enableCache&&!(0,t.isNullOrUndefined)(this.parent.editModule)){var e="updateIndex";this.parent.editModule[""+e](this.parent.grid.dataSource,this.parent.getRows(),this.parent.getCurrentViewRecords()),this.parent.getFrozenColumns()&&this.parent.editModule[""+e](this.parent.grid.dataSource,this.parent.getDataRows(),this.parent.getCurrentViewRecords())}},e.prototype.infinitePageAction=function(e){var i=new Ze.DataManager(e.result),r=new Ze.Predicate("expanded","notequal",null).or("expanded","notequal",void 0),n=i.executeLocal((new Ze.Query).where(r)),o=(0,t.getValue)("actionArgs",e.actionArgs),a=(0,t.getValue)("actions",this.parent.grid.infiniteScrollModule);this.parent.grid.infiniteScrollModule.isInitialRender&&!this.parent.initialRender&&(this.parent.grid.pageSettings.currentPage=1);var s=!!a.some(function(e){return e===o.requestType})||!!this.parent.initialRender;if(this.visualData=n,e.count=n.length,(0,t.getValue)("isPrinting",e.actionArgs))e.result=n;else{var d=new Ze.Query,l=this.parent.infiniteScrollSettings.enableCache;l&&this.parent.infiniteScrollSettings.initialBlocks>this.parent.infiniteScrollSettings.maxBlocks&&(this.parent.infiniteScrollSettings.initialBlocks=this.parent.infiniteScrollSettings.maxBlocks);var p=s?this.parent.grid.pageSettings.pageSize*this.parent.infiniteScrollSettings.initialBlocks:this.parent.grid.pageSettings.pageSize,h=this.parent.grid.pageSettings.currentPage;if((0,t.isNullOrUndefined)(o))d=d.page(h,p);else{var c=(0,t.getValue)("lastIndex",this.parent.grid.infiniteScrollModule),u=(0,t.getValue)("firstIndex",this.parent.grid.infiniteScrollModule);if(l||"delete"!==o.requestType)d=l&&"delete"===o.requestType||"save"===o.requestType&&"add"===o.action?(d=d.skip(u)).take(this.parent.infiniteScrollSettings.initialBlocks*this.parent.pageSettings.pageSize):d.page(h,p);else{var g=c-o.data.length+1,f=o.data.length;d=d.skip(g).take(f)}}i.dataSource.json=n,l||(0,t.isNullOrUndefined)(o)||"save"!==o.requestType||"add"!==o.action?e.result=i.executeLocal(d):e.result=[o.data]}this.parent.notify("updateAction",e)},e.prototype.infiniteEditHandler=function(e){var t=this.parent.grid.infiniteScrollModule.infiniteCurrentViewData,i=Object.keys(t);if("delete"===e.e.requestType&&e.result.length>1)for(var r=1;r<e.result.length;r++)t[i[i.length-1]].push(e.result[parseInt(r.toString(),10)])},e.prototype.infiniteDeleteHandler=function(e){if("delete"===e.requestType){var t=this.parent.grid.getRowsObject(),i=this.parent.getRows(),r=e.data instanceof Array?e.data:[e.data],n=this.parent.grid.getPrimaryKeyFieldNames()[0];if(this.removeRows(i,t,r,n,!0),this.parent.getFrozenColumns()>0){var o=this.parent.grid.getRowsObject(),a=this.parent.grid.getRows();this.removeRows(a,o,r,n)}}},e.prototype.removeRows=function(e,i,r,n,o){for(var a=this,s=function(s){i.filter(function(d,l){if(d.data[""+n]===r[parseInt(s.toString(),10)][""+n]){if(o){var p=Math.ceil((l+1)/a.parent.grid.pageSettings.pageSize);a.parent.grid.infiniteScrollModule.resetInfiniteCurrentViewData(p,l)}i.splice(l,1),(0,t.remove)(e[parseInt(l.toString(),10)]),e.splice(l,1)}})},d=0;d<r.length;d++)s(d)},e.prototype.createRows=function(e){var i,r,n=e.args.e,o=e.row,a=this.parent.grid.infiniteScrollModule.serviceLocator,s=new l.RowRenderer(a,null,this.parent.grid),d=this.parent.getCurrentViewRecords(),p=e.isMovable?this.parent.grid.getRows():this.parent.grid.getDataRows();i=e.isFrozenRight?this.parent.element.querySelector(".e-frozen-right-content").querySelector("tbody"):this.parent.grid.isFrozenGrid()?(e.isMovable,this.parent.grid.getContent().querySelector("tbody")):this.parent.getContent().querySelector("tbody"),this.parent.frozenRows&&(i=e.isFrozenRows&&"add"!==this.parent.grid.infiniteScrollModule.requestType||!e.isFrozenRows&&"add"===this.parent.grid.infiniteScrollModule.requestType?this.parent.grid.isFrozenGrid()?e.isMovable?this.parent.grid.getHeaderContent().querySelector("tbody"):e.isFrozenRight?this.parent.element.querySelector(".e-frozen-right-header").querySelector("tbody"):this.parent.grid.getHeaderContent().querySelector("tbody"):this.parent.getHeaderContent().querySelector("tbody"):i);for(var h="addRowIndex",c=this.parent.editModule[""+h],u=0;u<o.length;u++){var g=s.render(o[parseInt(u.toString(),10)],this.parent.grid.getColumns());"save"===n.requestType&&"add"===n.action?-1!==(0,t.getValue)("selectedIndex",this.parent.editModule)&&"Top"!==this.parent.editSettings.newRowPosition?"Below"===this.parent.editSettings.newRowPosition||"Child"===this.parent.editSettings.newRowPosition?(r="after",c+=at(d[parseInt(c.toString(),10)]).length,"Child"===this.parent.editSettings.newRowPosition&&(c-=1),p[parseInt(c.toString(),10)][""+r](g)):"Above"===this.parent.editSettings.newRowPosition&&(r="before",p[this.parent.editModule[""+h]][""+r](g)):"Bottom"===this.parent.editSettings.newRowPosition?i.appendChild(g):i.insertBefore(g,i.firstElementChild):"delete"===n.requestType&&i.appendChild(g)}e.cancel=!0},e.prototype.destroy=function(){this.removeEventListener()},e}()})(),d})());
|