@ag-grid-enterprise/server-side-row-model
Advanced tools
Comparing version 26.2.0 to 26.2.1
@@ -18,6 +18,7 @@ import { RowBounds, BeanStub, Column, RowNode, NumberSequence } from "@ag-grid-community/core"; | ||
rowGroupColumn: Column; | ||
rowHeight?: number; | ||
}): RowNode; | ||
destroyRowNodes(rowNodes: RowNode[]): void; | ||
destroyRowNode(rowNode: RowNode): void; | ||
setDataIntoRowNode(rowNode: RowNode, data: any, defaultId: string): void; | ||
setDataIntoRowNode(rowNode: RowNode, data: any, defaultId: string, cachedRowHeight: number | undefined): void; | ||
private setChildCountIntoRowNode; | ||
@@ -24,0 +25,0 @@ private setGroupDataIntoRowNode; |
@@ -35,3 +35,4 @@ "use strict"; | ||
var rowNode = new core_1.RowNode(this.beans); | ||
rowNode.setRowHeight(this.rowHeight); | ||
var rowHeight = params.rowHeight != null ? params.rowHeight : this.rowHeight; | ||
rowNode.setRowHeight(rowHeight); | ||
rowNode.group = params.group; | ||
@@ -69,3 +70,3 @@ rowNode.leafGroup = params.leafGroup; | ||
}; | ||
BlockUtils.prototype.setDataIntoRowNode = function (rowNode, data, defaultId) { | ||
BlockUtils.prototype.setDataIntoRowNode = function (rowNode, data, defaultId, cachedRowHeight) { | ||
rowNode.stub = false; | ||
@@ -117,3 +118,3 @@ if (core_1._.exists(data)) { | ||
if (core_1._.exists(data)) { | ||
rowNode.setRowHeight(this.gridOptionsWrapper.getRowHeightForNode(rowNode).height); | ||
rowNode.setRowHeight(this.gridOptionsWrapper.getRowHeightForNode(rowNode, false, cachedRowHeight).height); | ||
} | ||
@@ -120,0 +121,0 @@ }; |
@@ -161,5 +161,14 @@ "use strict"; | ||
var rowsToCreate = endRow - startRow; | ||
var cachedBlockHeight = this.parentStore.getCachedBlockHeight(this.getId()); | ||
var cachedRowHeight = cachedBlockHeight ? Math.round(cachedBlockHeight / rowsToCreate) : undefined; | ||
for (var i = 0; i < rowsToCreate; i++) { | ||
var rowNode = this.blockUtils.createRowNode({ field: this.groupField, group: this.groupLevel, leafGroup: this.leafGroup, | ||
level: this.level, parent: this.parentRowNode, rowGroupColumn: this.rowGroupColumn }); | ||
var rowNode = this.blockUtils.createRowNode({ | ||
field: this.groupField, | ||
group: this.groupLevel, | ||
leafGroup: this.leafGroup, | ||
level: this.level, | ||
parent: this.parentRowNode, | ||
rowGroupColumn: this.rowGroupColumn, | ||
rowHeight: cachedRowHeight | ||
}); | ||
var dataLoadedForThisRow = i < rows.length; | ||
@@ -169,3 +178,3 @@ if (dataLoadedForThisRow) { | ||
var defaultId = this.prefixId(this.startRow + i); | ||
this.blockUtils.setDataIntoRowNode(rowNode, data, defaultId); | ||
this.blockUtils.setDataIntoRowNode(rowNode, data, defaultId, cachedRowHeight); | ||
var newId = rowNode.id; | ||
@@ -172,0 +181,0 @@ this.parentStore.removeDuplicateNode(newId); |
@@ -107,3 +107,3 @@ "use strict"; | ||
var defaultId = this.prefixId(this.nodeIdSequence.next()); | ||
this.blockUtils.setDataIntoRowNode(rowNode, data, defaultId); | ||
this.blockUtils.setDataIntoRowNode(rowNode, data, defaultId, undefined); | ||
this.nodeManager.addRowNode(rowNode); | ||
@@ -110,0 +110,0 @@ this.blockUtils.checkOpenByDefault(rowNode); |
@@ -61,2 +61,3 @@ import { BeanStub, IServerSideStore, LoadSuccessParams, NumberSequence, RowBounds, RowNode, RowRenderer, ServerSideStoreParams, ServerSideStoreState, ServerSideTransaction, ServerSideTransactionResult, StoreRefreshAfterParams } from "@ag-grid-community/core"; | ||
addStoreStates(result: ServerSideStoreState[]): void; | ||
getCachedBlockHeight(blockNumber: number): number | undefined; | ||
private createBlock; | ||
@@ -63,0 +64,0 @@ getDisplayIndexEnd(): number | undefined; |
@@ -360,4 +360,26 @@ "use strict"; | ||
} | ||
// we start at the last loaded block before this block, and go down | ||
// block by block, adding in the block sizes (using cached sizes if available) | ||
// until we get to a block that does should have the pixel | ||
var blockSize = _this.storeParams.cacheBlockSize; | ||
var defaultBlockHeight = _this.defaultRowHeight * blockSize; | ||
var nextBlockId = previousBlock ? (previousBlock.getId() + 1) : 0; | ||
var getBlockDetails = function (id) { | ||
var cachedBlockHeight = _this.getCachedBlockHeight(id); | ||
var blockHeight = cachedBlockHeight != null ? cachedBlockHeight : defaultBlockHeight; | ||
var pixelInBlock = pixel <= (blockHeight + nextRowTop); | ||
return { | ||
height: blockHeight, pixelInBlock: pixelInBlock | ||
}; | ||
}; | ||
var blockDetails = getBlockDetails(nextBlockId); | ||
while (!blockDetails.pixelInBlock) { | ||
nextRowTop += blockDetails.height; | ||
nextRowIndex += blockSize; | ||
nextBlockId++; | ||
blockDetails = getBlockDetails(nextBlockId); | ||
} | ||
var pixelsBetween = pixel - nextRowTop; | ||
var rowsBetween = (pixelsBetween / _this.defaultRowHeight) | 0; | ||
var rowHeight = blockDetails.height / blockSize; | ||
var rowsBetween = Math.floor(pixelsBetween / rowHeight) | 0; | ||
return nextRowIndex + rowsBetween; | ||
@@ -539,2 +561,5 @@ }; | ||
}; | ||
PartialStore.prototype.getCachedBlockHeight = function (blockNumber) { | ||
return this.blockHeights[blockNumber]; | ||
}; | ||
PartialStore.prototype.createBlock = function (blockNumber, displayIndex, nextRowTop) { | ||
@@ -541,0 +566,0 @@ var block = this.createBean(new partialStoreBlock_1.PartialStoreBlock(blockNumber, this.parentRowNode, this.ssrmParams, this.storeParams, this)); |
@@ -18,6 +18,7 @@ import { RowBounds, BeanStub, Column, RowNode, NumberSequence } from "@ag-grid-community/core"; | ||
rowGroupColumn: Column; | ||
rowHeight?: number; | ||
}): RowNode; | ||
destroyRowNodes(rowNodes: RowNode[]): void; | ||
destroyRowNode(rowNode: RowNode): void; | ||
setDataIntoRowNode(rowNode: RowNode, data: any, defaultId: string): void; | ||
setDataIntoRowNode(rowNode: RowNode, data: any, defaultId: string, cachedRowHeight: number | undefined): void; | ||
private setChildCountIntoRowNode; | ||
@@ -24,0 +25,0 @@ private setGroupDataIntoRowNode; |
@@ -33,3 +33,4 @@ var __extends = (this && this.__extends) || (function () { | ||
var rowNode = new RowNode(this.beans); | ||
rowNode.setRowHeight(this.rowHeight); | ||
var rowHeight = params.rowHeight != null ? params.rowHeight : this.rowHeight; | ||
rowNode.setRowHeight(rowHeight); | ||
rowNode.group = params.group; | ||
@@ -67,3 +68,3 @@ rowNode.leafGroup = params.leafGroup; | ||
}; | ||
BlockUtils.prototype.setDataIntoRowNode = function (rowNode, data, defaultId) { | ||
BlockUtils.prototype.setDataIntoRowNode = function (rowNode, data, defaultId, cachedRowHeight) { | ||
rowNode.stub = false; | ||
@@ -115,3 +116,3 @@ if (_.exists(data)) { | ||
if (_.exists(data)) { | ||
rowNode.setRowHeight(this.gridOptionsWrapper.getRowHeightForNode(rowNode).height); | ||
rowNode.setRowHeight(this.gridOptionsWrapper.getRowHeightForNode(rowNode, false, cachedRowHeight).height); | ||
} | ||
@@ -118,0 +119,0 @@ }; |
@@ -159,5 +159,14 @@ var __extends = (this && this.__extends) || (function () { | ||
var rowsToCreate = endRow - startRow; | ||
var cachedBlockHeight = this.parentStore.getCachedBlockHeight(this.getId()); | ||
var cachedRowHeight = cachedBlockHeight ? Math.round(cachedBlockHeight / rowsToCreate) : undefined; | ||
for (var i = 0; i < rowsToCreate; i++) { | ||
var rowNode = this.blockUtils.createRowNode({ field: this.groupField, group: this.groupLevel, leafGroup: this.leafGroup, | ||
level: this.level, parent: this.parentRowNode, rowGroupColumn: this.rowGroupColumn }); | ||
var rowNode = this.blockUtils.createRowNode({ | ||
field: this.groupField, | ||
group: this.groupLevel, | ||
leafGroup: this.leafGroup, | ||
level: this.level, | ||
parent: this.parentRowNode, | ||
rowGroupColumn: this.rowGroupColumn, | ||
rowHeight: cachedRowHeight | ||
}); | ||
var dataLoadedForThisRow = i < rows.length; | ||
@@ -167,3 +176,3 @@ if (dataLoadedForThisRow) { | ||
var defaultId = this.prefixId(this.startRow + i); | ||
this.blockUtils.setDataIntoRowNode(rowNode, data, defaultId); | ||
this.blockUtils.setDataIntoRowNode(rowNode, data, defaultId, cachedRowHeight); | ||
var newId = rowNode.id; | ||
@@ -170,0 +179,0 @@ this.parentStore.removeDuplicateNode(newId); |
@@ -105,3 +105,3 @@ var __extends = (this && this.__extends) || (function () { | ||
var defaultId = this.prefixId(this.nodeIdSequence.next()); | ||
this.blockUtils.setDataIntoRowNode(rowNode, data, defaultId); | ||
this.blockUtils.setDataIntoRowNode(rowNode, data, defaultId, undefined); | ||
this.nodeManager.addRowNode(rowNode); | ||
@@ -108,0 +108,0 @@ this.blockUtils.checkOpenByDefault(rowNode); |
@@ -61,2 +61,3 @@ import { BeanStub, IServerSideStore, LoadSuccessParams, NumberSequence, RowBounds, RowNode, RowRenderer, ServerSideStoreParams, ServerSideStoreState, ServerSideTransaction, ServerSideTransactionResult, StoreRefreshAfterParams } from "@ag-grid-community/core"; | ||
addStoreStates(result: ServerSideStoreState[]): void; | ||
getCachedBlockHeight(blockNumber: number): number | undefined; | ||
private createBlock; | ||
@@ -63,0 +64,0 @@ getDisplayIndexEnd(): number | undefined; |
@@ -358,4 +358,26 @@ var __extends = (this && this.__extends) || (function () { | ||
} | ||
// we start at the last loaded block before this block, and go down | ||
// block by block, adding in the block sizes (using cached sizes if available) | ||
// until we get to a block that does should have the pixel | ||
var blockSize = _this.storeParams.cacheBlockSize; | ||
var defaultBlockHeight = _this.defaultRowHeight * blockSize; | ||
var nextBlockId = previousBlock ? (previousBlock.getId() + 1) : 0; | ||
var getBlockDetails = function (id) { | ||
var cachedBlockHeight = _this.getCachedBlockHeight(id); | ||
var blockHeight = cachedBlockHeight != null ? cachedBlockHeight : defaultBlockHeight; | ||
var pixelInBlock = pixel <= (blockHeight + nextRowTop); | ||
return { | ||
height: blockHeight, pixelInBlock: pixelInBlock | ||
}; | ||
}; | ||
var blockDetails = getBlockDetails(nextBlockId); | ||
while (!blockDetails.pixelInBlock) { | ||
nextRowTop += blockDetails.height; | ||
nextRowIndex += blockSize; | ||
nextBlockId++; | ||
blockDetails = getBlockDetails(nextBlockId); | ||
} | ||
var pixelsBetween = pixel - nextRowTop; | ||
var rowsBetween = (pixelsBetween / _this.defaultRowHeight) | 0; | ||
var rowHeight = blockDetails.height / blockSize; | ||
var rowsBetween = Math.floor(pixelsBetween / rowHeight) | 0; | ||
return nextRowIndex + rowsBetween; | ||
@@ -537,2 +559,5 @@ }; | ||
}; | ||
PartialStore.prototype.getCachedBlockHeight = function (blockNumber) { | ||
return this.blockHeights[blockNumber]; | ||
}; | ||
PartialStore.prototype.createBlock = function (blockNumber, displayIndex, nextRowTop) { | ||
@@ -539,0 +564,0 @@ var block = this.createBean(new PartialStoreBlock(blockNumber, this.parentRowNode, this.ssrmParams, this.storeParams, this)); |
/** | ||
* @ag-grid-enterprise/server-side-row-model - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.2.0 | ||
* @ag-grid-enterprise/server-side-row-model - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.2.1 | ||
* @link http://www.ag-grid.com/ | ||
@@ -8,6 +8,6 @@ ' * @license Commercial | ||
/** | ||
* @ag-grid-enterprise/server-side-row-model - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.2.0 | ||
* @ag-grid-enterprise/server-side-row-model - Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components * @version v26.2.1 | ||
* @link http://www.ag-grid.com/ | ||
' * @license Commercial | ||
*/ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e,o=require("@ag-grid-community/core"),r=require("@ag-grid-enterprise/core"),n=(t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)},function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}),i=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},s=function(t,e){return function(o,r){e(o,r,t)}},a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.pauseStoreUpdateListening=!1,e}return n(e,t),e.prototype.ensureRowHeightsValid=function(){return!1},e.prototype.start=function(){var t=this.gridOptionsWrapper.getServerSideDatasource();t&&this.setDatasource(t)},e.prototype.destroyDatasource=function(){this.datasource&&(this.datasource.destroy&&this.datasource.destroy(),this.rowRenderer.datasourceChanged(),this.datasource=void 0)},e.prototype.setBeans=function(t){this.logger=t.create("ServerSideRowModel")},e.prototype.addEventListeners=function(){this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_STORE_UPDATED,this.onStoreUpdated.bind(this));var t=this.resetRootStore.bind(this);this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_VALUE_CHANGED,t),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_CHANGED,t),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,t),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,t),this.verifyProps()},e.prototype.verifyProps=function(){if(null!=this.gridOptionsWrapper.getDefaultGroupOrderComparator()){o._.doOnce((function(){return console.warn("AG Grid: defaultGroupOrderComparator cannot be used with Server Side Row Model. If using Full Store, then provide the rows to the grid in the desired sort order. If using Partial Store, then sorting is done on the server side, nothing to do with the client.")}),"SSRM.DefaultGroupOrderComparator")}},e.prototype.setDatasource=function(t){this.destroyDatasource(),this.datasource=t,this.resetRootStore()},e.prototype.isLastRowIndexKnown=function(){var t=this.getRootStore();return!!t&&t.isLastRowIndexKnown()},e.prototype.onColumnEverything=function(){if(!this.gridOptionsWrapper.isSuppressEnterpriseResetOnNewColumns())if(this.storeParams){var t=this.columnsToValueObjects(this.columnModel.getRowGroupColumns()),e=this.columnsToValueObjects(this.columnModel.getValueColumns()),r=this.columnsToValueObjects(this.columnModel.getPivotColumns()),n=!o._.jsonEquals(this.storeParams.sortModel,this.sortController.getSortModel()),i=!o._.jsonEquals(this.storeParams.rowGroupCols,t),s=!o._.jsonEquals(this.storeParams.pivotCols,r),a=!o._.jsonEquals(this.storeParams.valueCols,e);(n||i||s||a)&&this.resetRootStore()}else this.resetRootStore()},e.prototype.destroyRootStore=function(){this.rootNode&&this.rootNode.childStore&&(this.rootNode.childStore=this.destroyBean(this.rootNode.childStore),this.nodeManager.clear())},e.prototype.refreshAfterSort=function(t,e){this.storeParams&&(this.storeParams.sortModel=t);var o=this.getRootStore();o&&(o.refreshAfterSort(e),this.onStoreUpdated())},e.prototype.resetRootStore=function(){this.destroyRootStore(),this.rootNode=new o.RowNode(this.beans),this.rootNode.group=!0,this.rootNode.level=-1,this.datasource&&(this.storeParams=this.createStoreParams(),this.rootNode.childStore=this.createBean(this.storeFactory.createStore(this.storeParams,this.rootNode)),this.updateRowIndexesAndBounds());var t={type:o.Events.EVENT_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(t),this.dispatchModelUpdated(!0)},e.prototype.columnsToValueObjects=function(t){var e=this;return t.map((function(t){return{id:t.getId(),aggFunc:t.getAggFunc(),displayName:e.columnModel.getDisplayNameForColumn(t,"model"),field:t.getColDef().field}}))},e.prototype.createStoreParams=function(){var t=this.columnsToValueObjects(this.columnModel.getRowGroupColumns()),e=this.columnsToValueObjects(this.columnModel.getValueColumns()),r=this.columnsToValueObjects(this.columnModel.getPivotColumns()),n=this.gridOptionsWrapper.isDynamicRowHeight();return{valueCols:e,rowGroupCols:t,pivotCols:r,pivotMode:this.columnModel.isPivotMode(),filterModel:this.filterManager.getFilterModel(),sortModel:this.sortListener.extractSortModel(),datasource:this.datasource,lastAccessedSequence:new o.NumberSequence,dynamicRowHeight:n}},e.prototype.getParams=function(){return this.storeParams},e.prototype.dispatchModelUpdated=function(t){void 0===t&&(t=!1);var e={type:o.Events.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,animate:!t,keepRenderedRows:!t,newPage:!1,newData:!1};this.eventService.dispatchEvent(e)},e.prototype.onStoreUpdated=function(){this.pauseStoreUpdateListening||(this.updateRowIndexesAndBounds(),this.dispatchModelUpdated())},e.prototype.onRowHeightChanged=function(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()},e.prototype.updateRowIndexesAndBounds=function(){var t=this.getRootStore();t&&t.setDisplayIndexes(new o.NumberSequence,{value:0})},e.prototype.retryLoads=function(){var t=this.getRootStore();t&&(t.retryLoads(),this.onStoreUpdated())},e.prototype.getRow=function(t){var e=this.getRootStore();if(e)return e.getRowUsingDisplayIndex(t)},e.prototype.expandAll=function(t){this.pauseStoreUpdateListening=!0,this.forEachNode((function(e){e.group&&e.setExpanded(t)})),this.pauseStoreUpdateListening=!1,this.onStoreUpdated()},e.prototype.refreshAfterFilter=function(t,e){this.storeParams&&(this.storeParams.filterModel=t);var o=this.getRootStore();o&&(o.refreshAfterFilter(e),this.onStoreUpdated())},e.prototype.getRootStore=function(){if(this.rootNode&&this.rootNode.childStore)return this.rootNode.childStore},e.prototype.getRowCount=function(){var t=this.getRootStore();return t?t.getDisplayIndexEnd():1},e.prototype.getTopLevelRowCount=function(){var t=this.getRootStore();return t?t.getRowCount():1},e.prototype.getTopLevelRowDisplayedIndex=function(t){var e=this.getRootStore();return e?e.getTopLevelRowDisplayedIndex(t):t},e.prototype.getRowBounds=function(t){var e=this.getRootStore();return e?e.getRowBounds(t):{rowTop:0,rowHeight:this.gridOptionsWrapper.getRowHeightAsNumber()}},e.prototype.getRowIndexAtPixel=function(t){var e=this.getRootStore();return t<=0||!e?0:e.getRowIndexAtPixel(t)},e.prototype.isEmpty=function(){return!1},e.prototype.isRowsToRender=function(){return null!=this.getRootStore()&&this.getRowCount()>0},e.prototype.getType=function(){return o.Constants.ROW_MODEL_TYPE_SERVER_SIDE},e.prototype.forEachNode=function(t){var e=this.getRootStore();e&&e.forEachNodeDeep(t)},e.prototype.forEachNodeAfterFilterAndSort=function(t){var e=this.getRootStore();e&&e.forEachNodeDeepAfterFilterAndSort(t)},e.prototype.executeOnStore=function(t,e){var o=this.getRootStore();if(o){var r=o.getChildStore(t);r&&e(r)}},e.prototype.refreshStore=function(t){void 0===t&&(t={});var e=t.route?t.route:[];this.executeOnStore(e,(function(e){return e.refreshStore(1==t.purge)}))},e.prototype.getStoreState=function(){var t=[],e=this.getRootStore();return e&&e.addStoreStates(t),t},e.prototype.getNodesInRangeForSelection=function(t,e){return o._.exists(e)&&t.parent!==e.parent?[]:t.parent.childStore.getRowNodesInRange(e,t)},e.prototype.getRowNode=function(t){var e=void 0;return this.forEachNode((function(o){o.id===t&&(e=o),o.detailNode&&o.detailNode.id===t&&(e=o.detailNode)})),e},e.prototype.isRowPresent=function(t){return!!this.getRowNode(t.id)},i([o.Autowired("columnModel")],e.prototype,"columnModel",void 0),i([o.Autowired("filterManager")],e.prototype,"filterManager",void 0),i([o.Autowired("sortController")],e.prototype,"sortController",void 0),i([o.Autowired("gridApi")],e.prototype,"gridApi",void 0),i([o.Autowired("columnApi")],e.prototype,"columnApi",void 0),i([o.Autowired("rowRenderer")],e.prototype,"rowRenderer",void 0),i([o.Autowired("ssrmSortService")],e.prototype,"sortListener",void 0),i([o.Autowired("ssrmNodeManager")],e.prototype,"nodeManager",void 0),i([o.Autowired("ssrmStoreFactory")],e.prototype,"storeFactory",void 0),i([o.Autowired("beans")],e.prototype,"beans",void 0),i([o.PreDestroy],e.prototype,"destroyDatasource",null),i([s(0,o.Qualifier("loggerFactory"))],e.prototype,"setBeans",null),i([o.PostConstruct],e.prototype,"addEventListeners",null),i([o.PreDestroy],e.prototype,"destroyRootStore",null),e=i([o.Bean("rowModel")],e)}(o.BeanStub),d=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),l=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return d(e,t),e.prototype.createGroupKeys=function(t){for(var e=[],o=t;o&&o.level>=0;)e.push(o.key),o=o.parent;return e.reverse(),e},e.prototype.loadFromDatasource=function(t){var e=this.createGroupKeys(t.parentNode),o=t.storeParams;if(o.datasource){var r={startRow:t.startRow,endRow:t.endRow,rowGroupCols:o.rowGroupCols,valueCols:o.valueCols,pivotCols:o.pivotCols,pivotMode:o.pivotMode,groupKeys:e,filterModel:o.filterModel,sortModel:o.sortModel},n={successCallback:t.successCallback,success:t.success,failCallback:t.failCallback,fail:t.fail,request:r,parentNode:t.parentNode,api:this.gridApi,columnApi:this.columnApi};window.setTimeout((function(){o.datasource&&o.datasource.getRows(n)}),0)}},e.prototype.getChildStore=function(t,e,r){if(o._.missingOrEmpty(t))return e;var n=r(t[0]);if(n){var i=t.slice(1,t.length),s=n.childStore;return s?s.getChildStore(i):null}return null},e.prototype.isServerRefreshNeeded=function(t,e,o){if(o.alwaysReset||o.valueColChanged||o.secondaryColChanged)return!0;var r=t.level+1;if(!(r<e.length))return!0;var n=e[r].id;return!!(o.changedColumns.indexOf(n)>-1)},l([o.Autowired("columnApi")],e.prototype,"columnApi",void 0),l([o.Autowired("gridApi")],e.prototype,"gridApi",void 0),e=l([o.Bean("ssrmCacheUtils")],e)}(o.BeanStub),u=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),p=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.postConstruct=function(){this.rowHeight=this.gridOptionsWrapper.getRowHeightAsNumber(),this.usingTreeData=this.gridOptionsWrapper.isTreeData(),this.usingMasterDetail=this.gridOptionsWrapper.isMasterDetail()},e.prototype.createRowNode=function(t){var e=new o.RowNode(this.beans);return e.setRowHeight(this.rowHeight),e.group=t.group,e.leafGroup=t.leafGroup,e.level=t.level,e.uiLevel=t.level,e.parent=t.parent,e.stub=!0,e.group&&(e.expanded=!1,e.field=t.field,e.rowGroupColumn=t.rowGroupColumn),e},e.prototype.destroyRowNodes=function(t){t&&t.forEach(this.destroyRowNode.bind(this))},e.prototype.destroyRowNode=function(t){t.childStore&&(this.destroyBean(t.childStore),t.childStore=null),t.clearRowTopAndRowIndex(),null!=t.id&&this.nodeManager.removeNode(t)},e.prototype.setDataIntoRowNode=function(t,e,r){if(t.stub=!1,o._.exists(e)){if(t.setDataAndId(e,r),this.usingTreeData){var n=this.gridOptionsWrapper.getIsServerSideGroupFunc(),i=this.gridOptionsWrapper.getServerSideGroupKeyFunc();null!=n&&(t.group=n(t.data),t.group&&null!=i&&(t.key=i(t.data)))}else if(t.group)t.key=this.valueService.getValue(t.rowGroupColumn,t),null!==t.key&&void 0!==t.key||o._.doOnce((function(){console.warn("null and undefined values are not allowed for server side row model keys"),t.rowGroupColumn&&console.warn("column = "+t.rowGroupColumn.getId()),console.warn("data is ",t.data)}),"ServerSideBlock-CannotHaveNullOrUndefinedForKey");else if(this.usingMasterDetail){var s=this.gridOptionsWrapper.getIsRowMasterFunc();t.master=null==s||s(t.data)}}else t.setDataAndId(void 0,void 0),t.key=null;(this.usingTreeData||t.group)&&(this.setGroupDataIntoRowNode(t),this.setChildCountIntoRowNode(t)),o._.exists(e)&&t.setRowHeight(this.gridOptionsWrapper.getRowHeightForNode(t).height)},e.prototype.setChildCountIntoRowNode=function(t){var e=this.gridOptionsWrapper.getChildCountFunc();e&&(t.allChildrenCount=e(t.data))},e.prototype.setGroupDataIntoRowNode=function(t){var e=this,o=this.columnModel.getGroupDisplayColumns(),r=this.gridOptionsWrapper.isTreeData();o.forEach((function(o){if(null==t.groupData&&(t.groupData={}),r)t.groupData[o.getColId()]=t.key;else if(o.isRowGroupDisplayed(t.rowGroupColumn.getId())){var n=e.valueService.getValue(t.rowGroupColumn,t);t.groupData[o.getColId()]=n}}))},e.prototype.clearDisplayIndex=function(t){(t.clearRowTopAndRowIndex(),t.group&&o._.exists(t.childStore))&&t.childStore.clearDisplayIndexes();t.master&&t.detailNode&&t.detailNode.clearRowTopAndRowIndex()},e.prototype.setDisplayIndex=function(t,e,r){if(t.setRowIndex(e.next()),t.setRowTop(r.value),r.value+=t.rowHeight,t.master&&(t.expanded&&t.detailNode?(t.detailNode.setRowIndex(e.next()),t.detailNode.setRowTop(r.value),r.value+=t.detailNode.rowHeight):t.detailNode&&t.detailNode.clearRowTopAndRowIndex()),t.group&&o._.exists(t.childStore)){var n=t.childStore;t.expanded?n.setDisplayIndexes(e,r):n.clearDisplayIndexes()}},e.prototype.binarySearchForDisplayIndex=function(t,e){var r=0,n=e.length-1;if(o._.missing(n)||o._.missing(r))console.warn("ag-grid: error: topPointer = "+n+", bottomPointer = "+r);else for(;;){var i=Math.floor((r+n)/2),s=e[i];if(s.rowIndex===t)return s;if(s.master&&s.expanded&&s.detailNode.rowIndex===t)return s.detailNode;var a=s.childStore;if(s.expanded&&a&&a.isDisplayIndexInStore(t))return a.getRowUsingDisplayIndex(t);if(s.rowIndex<t)r=i+1;else{if(!(s.rowIndex>t))return void console.warn("AG Grid: error: unable to locate rowIndex = "+t+" in cache");n=i-1}}},e.prototype.extractRowBounds=function(t,e){var r=function(t){return{rowHeight:t.rowHeight,rowTop:t.rowTop}};if(t.rowIndex===e)return r(t);if(t.group&&t.expanded&&o._.exists(t.childStore)){var n=t.childStore;if(n.isDisplayIndexInStore(e))return n.getRowBounds(e)}else if(t.master&&t.expanded&&o._.exists(t.detailNode)&&t.detailNode.rowIndex===e)return r(t.detailNode)},e.prototype.getIndexAtPixel=function(t,e){if(t.isPixelInRange(e))return t.rowIndex;if(t.master&&t.expanded&&t.detailNode.isPixelInRange(e))return t.detailNode.rowIndex;if(t.group&&t.expanded&&o._.exists(t.childStore)){var r=t.childStore;if(r.isPixelInRange(e))return r.getRowIndexAtPixel(e)}return null},e.prototype.createNodeIdPrefix=function(t){for(var e=[],o=t;o&&o.level>=0;)e.push(o.key),o=o.parent;if(e.length>0)return e.reverse().join("-")},e.prototype.checkOpenByDefault=function(t){if(t.isExpandable()){var e=this.gridOptionsWrapper.getIsServerSideGroupOpenByDefaultFunc();if(e)e({data:t.data,rowNode:t})&&window.setTimeout((function(){return t.setExpanded(!0)}),0)}},p([o.Autowired("valueService")],e.prototype,"valueService",void 0),p([o.Autowired("columnModel")],e.prototype,"columnModel",void 0),p([o.Autowired("ssrmNodeManager")],e.prototype,"nodeManager",void 0),p([o.Autowired("beans")],e.prototype,"beans",void 0),p([o.PostConstruct],e.prototype,"postConstruct",null),e=p([o.Bean("ssrmBlockUtils")],e)}(o.BeanStub),f=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},y=function(){function t(){this.rowNodes={}}return t.prototype.addRowNode=function(t){var e=t.id;this.rowNodes[e]&&(console.warn("AG Grid: duplicate node id "+t.id),console.warn("first instance",this.rowNodes[e].data),console.warn("second instance",t.data)),this.rowNodes[e]=t},t.prototype.removeNode=function(t){var e=t.id;this.rowNodes[e]&&(this.rowNodes[e]=void 0)},t.prototype.clear=function(){this.rowNodes={}},f([o.PreDestroy],t.prototype,"clear",null),t=f([o.Bean("ssrmNodeManager")],t)}(),g=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),v=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.asyncTransactions=[],e}return g(e,t),e.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()},e.prototype.applyTransactionAsync=function(t,e){null==this.asyncTransactionsTimeout&&this.scheduleExecuteAsync(),this.asyncTransactions.push({transaction:t,callback:e})},e.prototype.scheduleExecuteAsync=function(){var t=this,e=this.gridOptionsWrapper.getAsyncTransactionWaitMillis();this.asyncTransactionsTimeout=window.setTimeout((function(){t.executeAsyncTransactions()}),e)},e.prototype.executeAsyncTransactions=function(){var t=this;if(this.asyncTransactions){var e=[],r=[],n=[],i=!1;if(this.asyncTransactions.forEach((function(s){var a;t.serverSideRowModel.executeOnStore(s.transaction.route,(function(t){a=t.applyTransaction(s.transaction)})),null==a&&(a={status:o.ServerSideTransactionResultStatus.StoreNotFound}),r.push(a),a.status==o.ServerSideTransactionResultStatus.StoreLoading?n.push(s):(s.callback&&e.push((function(){return s.callback(a)})),a.status===o.ServerSideTransactionResultStatus.Applied&&(i=!0))})),e.length>0&&window.setTimeout((function(){e.forEach((function(t){return t()}))}),0),this.asyncTransactionsTimeout=void 0,this.asyncTransactions=n,i&&(this.valueCache.onDataChanged(),this.eventService.dispatchEvent({type:o.Events.EVENT_STORE_UPDATED})),r.length>0){var s={api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),type:o.Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:r};this.eventService.dispatchEvent(s)}}},e.prototype.flushAsyncTransactions=function(){null!=this.asyncTransactionsTimeout&&clearTimeout(this.asyncTransactionsTimeout),this.executeAsyncTransactions()},e.prototype.applyTransaction=function(t){var e;return this.serverSideRowModel.executeOnStore(t.route,(function(o){e=o.applyTransaction(t)})),e?(this.valueCache.onDataChanged(),this.eventService.dispatchEvent({type:o.Events.EVENT_STORE_UPDATED}),e):{status:o.ServerSideTransactionResultStatus.StoreNotFound}},v([o.Autowired("rowNodeBlockLoader")],e.prototype,"rowNodeBlockLoader",void 0),v([o.Autowired("valueCache")],e.prototype,"valueCache",void 0),v([o.Autowired("rowModel")],e.prototype,"serverSideRowModel",void 0),v([o.PostConstruct],e.prototype,"postConstruct",null),e=v([o.Bean("ssrmTransactionManager")],e)}(o.BeanStub),S=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),R=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()&&this.addManagedListener(this.eventService,o.Events.EVENT_ROW_GROUP_OPENED,this.onRowGroupOpened.bind(this))},e.prototype.onRowGroupOpened=function(t){var e=t.node;if(e.expanded){if(e.master)this.createDetailNode(e);else if(o._.missing(e.childStore)){var r=this.serverSideRowModel.getParams();e.childStore=this.createBean(this.storeFactory.createStore(r,e))}}else this.gridOptionsWrapper.isPurgeClosedRowNodes()&&o._.exists(e.childStore)&&(e.childStore=this.destroyBean(e.childStore));var n={type:o.Events.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(n)},e.prototype.createDetailNode=function(t){if(o._.exists(t.detailNode))return t.detailNode;var e=new o.RowNode(this.beans);e.detail=!0,e.selectable=!1,e.parent=t,o._.exists(t.id)&&(e.id="detail_"+t.id),e.data=t.data,e.level=t.level+1;var r=this.gridOptionsWrapper.getRowHeightForNode(e).height;return e.rowHeight=r||200,t.detailNode=e,e},R([o.Autowired("rowModel")],e.prototype,"serverSideRowModel",void 0),R([o.Autowired("ssrmStoreFactory")],e.prototype,"storeFactory",void 0),R([o.Autowired("beans")],e.prototype,"beans",void 0),R([o.PostConstruct],e.prototype,"postConstruct",null),e=R([o.Bean("ssrmExpandListener")],e)}(o.BeanStub),I=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),m=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()&&this.addManagedListener(this.eventService,o.Events.EVENT_SORT_CHANGED,this.onSortChanged.bind(this))},e.prototype.extractSortModel=function(){var t=this.sortController.getSortModel();return this.gridOptionsWrapper.isTreeData()||(this.replaceAutoGroupColumnWithActualRowGroupColumns(t),this.removeMultiColumnPrefixOnColumnIds(t)),t},e.prototype.removeMultiColumnPrefixOnColumnIds=function(t){if(this.gridOptionsWrapper.isGroupMultiAutoColumn())for(var e=o.Constants.GROUP_AUTO_COLUMN_ID+"-",r=0;r<t.length;++r)t[r].colId.indexOf(e)>-1&&(t[r].colId=t[r].colId.substr(e.length))},e.prototype.replaceAutoGroupColumnWithActualRowGroupColumns=function(t){var e=o._.find(t,(function(t){return t.colId==o.Constants.GROUP_AUTO_COLUMN_ID}));if(e){var r=t.indexOf(e);o._.removeFromArray(t,e);var n=this.columnModel.getRowGroupColumns().filter((function(e){return 0==t.filter((function(t){return t.colId===e.getColId()})).length})).map((function(t){return{colId:t.getId(),sort:e.sort}}));o._.insertArrayIntoArray(t,n,r)}},e.prototype.onSortChanged=function(){var t=this.serverSideRowModel.getParams();if(t){var e=this.extractSortModel(),o=t.sortModel,r=this.findChangedColumnsInSort(e,o),n={valueColChanged:this.listenerUtils.isSortingWithValueColumn(r),secondaryColChanged:this.listenerUtils.isSortingWithSecondaryColumn(r),alwaysReset:this.gridOptionsWrapper.isServerSideSortingAlwaysResets(),changedColumns:r};this.serverSideRowModel.refreshAfterSort(e,n)}},e.prototype.findChangedColumnsInSort=function(t,e){var r=[];[t,e].forEach((function(t){if(t){var e=t.map((function(t){return t.colId}));r=r.concat(e)}}));return r.filter((function(r){var n=o._.find(e,(function(t){return t.colId===r})),i=o._.find(t,(function(t){return t.colId===r}));return function(t,e){return(t?t.sort:null)!==(e?e.sort:null)}(n,i)||function(o,r){return e.indexOf(o)!==t.indexOf(r)}(n,i)}))},m([o.Autowired("sortController")],e.prototype,"sortController",void 0),m([o.Autowired("columnModel")],e.prototype,"columnModel",void 0),m([o.Autowired("rowModel")],e.prototype,"serverSideRowModel",void 0),m([o.Autowired("ssrmListenerUtils")],e.prototype,"listenerUtils",void 0),m([o.PostConstruct],e.prototype,"postConstruct",null),e=m([o.Bean("ssrmSortService")],e)}(o.BeanStub),A=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),C=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return A(e,t),e.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()&&this.addManagedListener(this.eventService,o.Events.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this))},e.prototype.onFilterChanged=function(){var t=this.serverSideRowModel.getParams();if(t){var e=this.filterManager.getFilterModel(),o=t?t.filterModel:{},r=this.findChangedColumns(e,o),n={valueColChanged:this.listenerUtils.isSortingWithValueColumn(r),secondaryColChanged:this.listenerUtils.isSortingWithSecondaryColumn(r),alwaysReset:this.gridOptionsWrapper.isServerSideFilteringAlwaysResets(),changedColumns:r};this.serverSideRowModel.refreshAfterFilter(e,n)}},e.prototype.findChangedColumns=function(t,e){var o={};Object.keys(t).forEach((function(t){return o[t]=!0})),Object.keys(e).forEach((function(t){return o[t]=!0}));var r=[];return Object.keys(o).forEach((function(o){JSON.stringify(t[o])!=JSON.stringify(e[o])&&r.push(o)})),r},C([o.Autowired("rowModel")],e.prototype,"serverSideRowModel",void 0),C([o.Autowired("filterManager")],e.prototype,"filterManager",void 0),C([o.Autowired("ssrmListenerUtils")],e.prototype,"listenerUtils",void 0),C([o.PostConstruct],e.prototype,"postConstruct",null),e=C([o.Bean("ssrmFilterListener")],e)}(o.BeanStub),O=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),D=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},_=function(t,e){return function(o,r){e(o,r,t)}},P=function(t){function e(e,o,r,n,i){var s=t.call(this,e)||this;return s.ssrmParams=r,s.storeParams=n,s.parentRowNode=o,s.startRow=e*n.cacheBlockSize,s.parentStore=i,s.level=o.level+1,s.groupLevel=r.rowGroupCols?s.level<r.rowGroupCols.length:void 0,s.leafGroup=!!r.rowGroupCols&&s.level===r.rowGroupCols.length-1,s}return O(e,t),e.prototype.postConstruct=function(){if(this.usingTreeData=this.gridOptionsWrapper.isTreeData(),!this.usingTreeData&&this.groupLevel){var t=this.ssrmParams.rowGroupCols[this.level];this.groupField=t.field,this.rowGroupColumn=this.columnModel.getRowGroupColumns()[this.level]}this.nodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.parentRowNode),this.setData([])},e.prototype.isDisplayIndexInBlock=function(t){return t>=this.displayIndexStart&&t<this.displayIndexEnd},e.prototype.isBlockBefore=function(t){return t>=this.displayIndexEnd},e.prototype.getDisplayIndexStart=function(){return this.displayIndexStart},e.prototype.getDisplayIndexEnd=function(){return this.displayIndexEnd},e.prototype.getBlockHeightPx=function(){return this.blockHeightPx},e.prototype.getBlockTopPx=function(){return this.blockTopPx},e.prototype.isGroupLevel=function(){return this.groupLevel},e.prototype.getGroupField=function(){return this.groupField},e.prototype.prefixId=function(t){return null!=this.nodeIdPrefix?this.nodeIdPrefix+"-"+t:t.toString()},e.prototype.getBlockStateJson=function(){return{id:this.prefixId(this.getId()),state:{blockNumber:this.getId(),startRow:this.startRow,endRow:this.startRow+this.storeParams.cacheBlockSize,pageStatus:this.getState()}}},e.prototype.isAnyNodeOpen=function(){return this.rowNodes.filter((function(t){return t.expanded})).length>0},e.prototype.forEachNode=function(t,e,r,n){void 0===e&&(e=new o.NumberSequence),this.rowNodes.forEach((function(o){if(t(o,e.next()),r&&o.childStore){var i=o.childStore;n?i.forEachNodeDeepAfterFilterAndSort(t,e):i.forEachNodeDeep(t,e)}}))},e.prototype.forEachNodeDeep=function(t,e){this.forEachNode(t,e,!0,!1)},e.prototype.forEachNodeAfterFilterAndSort=function(t,e){this.forEachNode(t,e,!0,!0)},e.prototype.forEachNodeShallow=function(t,e){this.forEachNode(t,e,!1,!1)},e.prototype.getLastAccessed=function(){return this.lastAccessed},e.prototype.getRowUsingLocalIndex=function(t){return this.rowNodes[t-this.startRow]},e.prototype.touchLastAccessed=function(){this.lastAccessed=this.ssrmParams.lastAccessedSequence.next()},e.prototype.processServerFail=function(){this.parentStore.onBlockLoadFailed(this)},e.prototype.retryLoads=function(){this.getState()===o.RowNodeBlock.STATE_FAILED&&(this.setStateWaitingToLoad(),this.rowNodeBlockLoader.checkBlockToLoad(),this.setData()),this.forEachNodeShallow((function(t){t.childStore&&t.childStore.retryLoads()}))},e.prototype.processServerResult=function(t){this.parentStore.onBlockLoaded(this,t)},e.prototype.setData=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1),this.destroyRowNodes();for(var o=this.parentStore.getRowCount(),r=this.getId()*this.storeParams.cacheBlockSize,n=Math.min(r+this.storeParams.cacheBlockSize,o)-r,i=0;i<n;i++){var s=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});if(i<t.length){var a=t[i],d=this.prefixId(this.startRow+i);this.blockUtils.setDataIntoRowNode(s,a,d);var l=s.id;this.parentStore.removeDuplicateNode(l),this.nodeManager.addRowNode(s),this.allNodesMap[s.id]=s,this.blockUtils.checkOpenByDefault(s)}this.rowNodes.push(s),e&&(s.failedLoad=!0)}},e.prototype.removeDuplicateNode=function(t){var e=this.allNodesMap[t];if(e){this.blockUtils.destroyRowNode(e);var o=this.rowNodes.indexOf(e),r=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});this.rowNodes[o]=r}},e.prototype.refresh=function(){this.getState()!==o.RowNodeBlock.STATE_WAITING_TO_LOAD&&this.setStateWaitingToLoad()},e.prototype.destroyRowNodes=function(){this.blockUtils.destroyRowNodes(this.rowNodes),this.rowNodes=[],this.allNodesMap={}},e.prototype.setBeans=function(t){this.logger=t.create("ServerSideBlock")},e.prototype.getRowUsingDisplayIndex=function(t){return this.touchLastAccessed(),this.blockUtils.binarySearchForDisplayIndex(t,this.rowNodes)},e.prototype.loadFromDatasource=function(){this.cacheUtils.loadFromDatasource({startRow:this.startRow,endRow:this.startRow+this.storeParams.cacheBlockSize,parentNode:this.parentRowNode,storeParams:this.ssrmParams,successCallback:this.pageLoaded.bind(this,this.getVersion()),success:this.success.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),fail:this.pageLoadFailed.bind(this,this.getVersion())})},e.prototype.isPixelInRange=function(t){return t>=this.blockTopPx&&t<this.blockTopPx+this.blockHeightPx},e.prototype.getRowBounds=function(t){var e,r=this;return this.touchLastAccessed(),o._.find(this.rowNodes,(function(o){return null!=(e=r.blockUtils.extractRowBounds(o,t))})),e},e.prototype.getRowIndexAtPixel=function(t){var e=this;this.touchLastAccessed();var r=null;return o._.find(this.rowNodes,(function(o){return null!=(r=e.blockUtils.getIndexAtPixel(o,t))})),r},e.prototype.clearDisplayIndexes=function(){var t=this;this.displayIndexEnd=void 0,this.displayIndexStart=void 0,this.rowNodes.forEach((function(e){return t.blockUtils.clearDisplayIndex(e)}))},e.prototype.setDisplayIndexes=function(t,e){var o=this;this.displayIndexStart=t.peek(),this.blockTopPx=e.value,this.rowNodes.forEach((function(r){return o.blockUtils.setDisplayIndex(r,t,e)})),this.displayIndexEnd=t.peek(),this.blockHeightPx=e.value-this.blockTopPx},D([o.Autowired("columnModel")],e.prototype,"columnModel",void 0),D([o.Autowired("ssrmCacheUtils")],e.prototype,"cacheUtils",void 0),D([o.Autowired("ssrmBlockUtils")],e.prototype,"blockUtils",void 0),D([o.Autowired("ssrmNodeManager")],e.prototype,"nodeManager",void 0),D([o.Autowired("rowNodeBlockLoader")],e.prototype,"rowNodeBlockLoader",void 0),D([o.PostConstruct],e.prototype,"postConstruct",null),D([o.PreDestroy],e.prototype,"destroyRowNodes",null),D([_(0,o.Qualifier("loggerFactory"))],e.prototype,"setBeans",null),e}(o.RowNodeBlock),k=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),T=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},b=function(t,e){return function(o,r){e(o,r,t)}};!function(t){t[t.FOUND=0]="FOUND",t[t.CONTINUE_FIND=1]="CONTINUE_FIND",t[t.BREAK_FIND=2]="BREAK_FIND"}(e||(e={}));var B=function(t){function r(e,o,n){var i=t.call(this)||this;return i.blocks={},i.blockHeights={},i.lastRowIndexKnown=!1,i.displayIndexStart=0,i.displayIndexEnd=0,i.cacheTopPixel=0,i.info={},i.ssrmParams=e,i.storeParams=o,i.parentRowNode=n,i.rowCount=r.INITIAL_ROW_COUNT,i}return k(r,t),r.prototype.postConstruct=function(){this.defaultRowHeight=this.gridOptionsWrapper.getRowHeightAsNumber()},r.prototype.destroyAllBlocks=function(){var t=this;this.getBlocksInOrder().forEach((function(e){return t.destroyBlock(e)}))},r.prototype.setBeans=function(t){this.logger=t.create("ServerSideCache")},r.prototype.getRowCount=function(){return this.rowCount},r.prototype.isLastRowIndexKnown=function(){return this.lastRowIndexKnown},r.prototype.retryLoads=function(){this.getBlocksInOrder().forEach((function(t){return t.retryLoads()}))},r.prototype.onBlockLoadFailed=function(t){t.setData([],!0),this.fireCacheUpdatedEvent()},r.prototype.onBlockLoaded=function(t,e){if(this.logger.log("onPageLoaded: page = "+t.getId()+", lastRow = "+e.rowCount),e.storeInfo&&o._.assign(this.info,e.storeInfo),!e.rowData){o._.doOnce((function(){return console.warn('AG Grid: "params.rowData" is missing from Server-Side Row Model success() callback. Please use the "rowData" attribute. If no data is returned, set an empty list.',e)}),"InfiniteStore.noData")}var r=null!=e.rowCount&&e.rowCount>=0?e.rowCount:void 0;this.isAlive()&&(this.checkRowCount(t,r),t.setData(e.rowData),this.destroyAllBlocksPastVirtualRowCount(),this.fireCacheUpdatedEvent())},r.prototype.purgeBlocksIfNeeded=function(t){var e=this,o=this.getBlocksInOrder().filter((function(e){return e!=t}));o.sort((function(t,e){return e.getLastAccessed()-t.getLastAccessed()}));var n=this.storeParams.maxBlocksInCache>0,i=n?this.storeParams.maxBlocksInCache-1:null,s=r.MAX_EMPTY_BLOCKS_TO_KEEP-1;o.forEach((function(t,o){if(t.getState()===P.STATE_WAITING_TO_LOAD&&o>=s||!!n&&o>=i){if(t.isAnyNodeOpen())return;if(e.isBlockCurrentlyDisplayed(t))return;if(e.isBlockFocused(t))return;e.destroyBlock(t)}}))},r.prototype.isBlockFocused=function(t){var e=this.focusService.getFocusCellToUseAfterRefresh();if(!e)return!1;if(null!=e.rowPinned)return!1;var o=t.getDisplayIndexStart(),r=t.getDisplayIndexEnd();return null!=r&&null!=o&&(e.rowIndex>=o&&e.rowIndex<r)},r.prototype.isBlockCurrentlyDisplayed=function(t){var e=t.getDisplayIndexStart(),o=t.getDisplayIndexEnd()-1;return this.rowRenderer.isRangeInRenderedViewport(e,o)},r.prototype.removeDuplicateNode=function(t){this.getBlocksInOrder().forEach((function(e){return e.removeDuplicateNode(t)}))},r.prototype.checkRowCount=function(t,e){if("number"==typeof e&&e>=0)this.rowCount=e,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){var o=(t.getId()+1)*this.storeParams.cacheBlockSize+r.OVERFLOW_SIZE;this.rowCount<o&&(this.rowCount=o)}},r.prototype.forEachNodeDeep=function(t,e){void 0===e&&(e=new o.NumberSequence),this.getBlocksInOrder().forEach((function(o){return o.forEachNodeDeep(t,e)}))},r.prototype.forEachNodeDeepAfterFilterAndSort=function(t,e){void 0===e&&(e=new o.NumberSequence),this.getBlocksInOrder().forEach((function(o){return o.forEachNodeAfterFilterAndSort(t,e)}))},r.prototype.getBlocksInOrder=function(){return o._.getAllValuesInObject(this.blocks).sort((function(t,e){return t.getId()-e.getId()}))},r.prototype.destroyBlock=function(t){delete this.blocks[t.getId()],this.destroyBean(t),this.rowNodeBlockLoader.removeBlock(t)},r.prototype.fireCacheUpdatedEvent=function(){var t={type:o.Events.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(t)},r.prototype.destroyAllBlocksPastVirtualRowCount=function(){var t=this,e=[];this.getBlocksInOrder().forEach((function(o){o.getId()*t.storeParams.cacheBlockSize>=t.rowCount&&e.push(o)})),e.length>0&&e.forEach((function(e){return t.destroyBlock(e)}))},r.prototype.refreshStore=function(t){0==this.getRowCount()||t?this.resetStore():this.refreshBlocks(),this.fireCacheUpdatedEvent()},r.prototype.refreshBlocks=function(){this.getBlocksInOrder().forEach((function(t){t.refresh()})),this.lastRowIndexKnown=!1,this.rowNodeBlockLoader.checkBlockToLoad()},r.prototype.resetStore=function(){this.destroyAllBlocks(),this.lastRowIndexKnown=!1,(this.columnModel.isAutoRowHeightActive||0===this.rowCount)&&(this.rowCount=r.INITIAL_ROW_COUNT)},r.prototype.getRowNodesInRange=function(t,e){var r=[],n=-1,i=!1;o._.missing(t)&&(i=!0);var s=!1;return this.getBlocksInOrder().forEach((function(o){s||(i&&n+1!==o.getId()?s=!0:(n=o.getId(),o.forEachNodeShallow((function(o){var n=o===t||o===e;(i||n)&&r.push(o),n&&(i=!i)}))))})),s||i?[]:r},r.prototype.findBlockAndExecute=function(t,o,r){var n,i=!1,s=!1,a=null;return this.getBlocksInOrder().forEach((function(r){if(!i&&!s){var d=t(r);d==e.FOUND?(n=o(r),i=!0):d==e.CONTINUE_FIND?a=r:d==e.BREAK_FIND&&(s=!0)}})),i||(n=r(a)),n},r.prototype.getRowBounds=function(t){var o=this;return this.findBlockAndExecute((function(o){return o.isDisplayIndexInBlock(t)?e.FOUND:o.isBlockBefore(t)?e.CONTINUE_FIND:e.BREAK_FIND}),(function(e){return e.getRowBounds(t)}),(function(e){var r,n;null!==e?(r=e.getBlockTopPx()+e.getBlockHeightPx(),n=e.getDisplayIndexEnd()):(r=o.cacheTopPixel,n=o.displayIndexStart);var i=t-n;return{rowHeight:o.defaultRowHeight,rowTop:r+i*o.defaultRowHeight}}))},r.prototype.getRowIndexAtPixel=function(t){var o=this,r=this.findBlockAndExecute((function(o){return o.isPixelInRange(t)?e.FOUND:o.getBlockTopPx()<t?e.CONTINUE_FIND:e.BREAK_FIND}),(function(e){return e.getRowIndexAtPixel(t)}),(function(e){var r,n;return e?(r=e.getBlockTopPx()+e.getBlockHeightPx(),n=e.getDisplayIndexEnd()):(r=o.cacheTopPixel,n=o.displayIndexStart),n+((t-r)/o.defaultRowHeight|0)})),n=this.getDisplayIndexEnd()-1;return r=Math.min(r,n)},r.prototype.clearDisplayIndexes=function(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.getBlocksInOrder().forEach((function(t){return t.clearDisplayIndexes()}))},r.prototype.setDisplayIndexes=function(t,e){var r=this;this.displayIndexStart=t.peek(),this.cacheTopPixel=e.value;var n=-1,i=this.storeParams.cacheBlockSize;this.getBlocksInOrder().forEach((function(s){var a=s.getId(),d=a-n-1,l=d*i;l>0&&t.skip(l);for(var c=1;c<=d;c++){var u=a-c;o._.exists(r.blockHeights[u])?e.value+=r.blockHeights[u]:e.value+=i*r.defaultRowHeight}n=a,s.setDisplayIndexes(t,e),r.blockHeights[a]=s.getBlockHeightPx()}));var s=(n+1)*i-1,a=this.getRowCount()-s-1;a>0&&(t.skip(a),e.value+=a*this.defaultRowHeight),this.displayIndexEnd=t.peek(),this.cacheHeightPixels=e.value-this.cacheTopPixel},r.prototype.getRowUsingDisplayIndex=function(t,r){var n=this;if(void 0===r&&(r=!1),this.isDisplayIndexInStore(t)){return this.findBlockAndExecute((function(o){return o.isDisplayIndexInBlock(t)?e.FOUND:o.isBlockBefore(t)?e.CONTINUE_FIND:e.BREAK_FIND}),(function(e){return e.getRowUsingDisplayIndex(t)}),(function(e){if(!r){var i,s,a,d=n.storeParams.cacheBlockSize;if(e){i=e.getId()+1,s=e.getDisplayIndexEnd(),a=e.getBlockHeightPx()+e.getBlockTopPx();for(;!(t>=s&&t<s+d);){s+=d;var l=n.blockHeights[i];o._.exists(l)?a+=l:a+=n.defaultRowHeight*d,i++}}else{var c=t-n.displayIndexStart;i=Math.floor(c/d),s=n.displayIndexStart+i*d,a=n.cacheTopPixel+i*d*n.defaultRowHeight}return n.logger.log("block missing, rowIndex = "+t+", creating #"+i+", displayIndexStart = "+s),n.createBlock(i,s,{value:a}).getRowUsingDisplayIndex(t)}}))}},r.prototype.getTopLevelRowDisplayedIndex=function(t){var o=this.storeParams.cacheBlockSize,r=Math.floor(t/o);return this.findBlockAndExecute((function(t){return t.getId()===r?e.FOUND:t.getId()<r?e.CONTINUE_FIND:e.BREAK_FIND}),(function(e){return e.getRowUsingLocalIndex(t).rowIndex}),(function(e){if(!e)return t;var r,n=o*(e.getId()+1)-1,i=e.getRowUsingLocalIndex(n);i.expanded&&i.childStore?r=i.childStore.getDisplayIndexEnd()-1:r=i.expanded&&i.detailNode?i.detailNode.rowIndex:i.rowIndex;return r+(t-n)}))},r.prototype.addStoreStates=function(t){t.push({type:"partial",route:this.storeUtils.createGroupKeys(this.parentRowNode),rowCount:this.rowCount,lastRowIndexKnown:this.lastRowIndexKnown,info:this.info,maxBlocksInCache:this.storeParams.maxBlocksInCache,cacheBlockSize:this.storeParams.cacheBlockSize}),this.forEachChildStoreShallow((function(e){return e.addStoreStates(t)}))},r.prototype.createBlock=function(t,e,r){var n=this.createBean(new P(t,this.parentRowNode,this.ssrmParams,this.storeParams,this));return n.setDisplayIndexes(new o.NumberSequence(e),r),this.blocks[n.getId()]=n,this.purgeBlocksIfNeeded(n),this.rowNodeBlockLoader.addBlock(n),n},r.prototype.getDisplayIndexEnd=function(){return this.displayIndexEnd},r.prototype.isDisplayIndexInStore=function(t){return 0!==this.getRowCount()&&(t>=this.displayIndexStart&&t<this.displayIndexEnd)},r.prototype.applyTransaction=function(t){return{status:o.ServerSideTransactionResultStatus.StoreWrongType}},r.prototype.getChildStore=function(t){var e=this;return this.storeUtils.getChildStore(t,this,(function(t){var r=null;return e.getBlocksInOrder().forEach((function(e){e.forEachNodeShallow((function(e){e.key===t&&(r=e)}),new o.NumberSequence)})),r}))},r.prototype.isPixelInRange=function(t){return 0!==this.getRowCount()&&(t>=this.cacheTopPixel&&t<this.cacheTopPixel+this.cacheHeightPixels)},r.prototype.refreshAfterFilter=function(t){this.resetStore()},r.prototype.refreshAfterSort=function(t){this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,t)?this.resetStore():this.forEachChildStoreShallow((function(e){return e.refreshAfterSort(t)}))},r.prototype.forEachChildStoreShallow=function(t){this.getBlocksInOrder().forEach((function(e){if(e.isGroupLevel()){e.forEachNodeShallow((function(e){var o=e.childStore;o&&t(o)}),new o.NumberSequence)}}))},r.MAX_EMPTY_BLOCKS_TO_KEEP=2,r.INITIAL_ROW_COUNT=1,r.OVERFLOW_SIZE=1,T([o.Autowired("rowRenderer")],r.prototype,"rowRenderer",void 0),T([o.Autowired("rowNodeBlockLoader")],r.prototype,"rowNodeBlockLoader",void 0),T([o.Autowired("ssrmCacheUtils")],r.prototype,"storeUtils",void 0),T([o.Autowired("focusService")],r.prototype,"focusService",void 0),T([o.Autowired("columnModel")],r.prototype,"columnModel",void 0),T([o.PostConstruct],r.prototype,"postConstruct",null),T([o.PreDestroy],r.prototype,"destroyAllBlocks",null),T([b(0,o.Qualifier("loggerFactory"))],r.prototype,"setBeans",null),r}(o.BeanStub),M=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),L=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},U=function(t){function e(e,r,n){var i=t.call(this,0)||this;return i.nodeIdSequence=new o.NumberSequence,i.info={},i.ssrmParams=e,i.parentRowNode=n,i.level=n.level+1,i.groupLevel=e.rowGroupCols?i.level<e.rowGroupCols.length:void 0,i.leafGroup=!!e.rowGroupCols&&i.level===e.rowGroupCols.length-1,i}return M(e,t),e.prototype.postConstruct=function(){var t=this;if(this.usingTreeData=this.gridOptionsWrapper.isTreeData(),this.nodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.parentRowNode),!this.usingTreeData&&this.groupLevel){var e=this.ssrmParams.rowGroupCols[this.level];this.groupField=e.field,this.rowGroupColumn=this.columnModel.getRowGroupColumns()[this.level]}this.initialiseRowNodes(),this.rowNodeBlockLoader.addBlock(this),this.addDestroyFunc((function(){return t.rowNodeBlockLoader.removeBlock(t)}))},e.prototype.destroyRowNodes=function(){this.blockUtils.destroyRowNodes(this.allRowNodes),this.allRowNodes=[],this.nodesAfterSort=[],this.nodesAfterFilter=[],this.allNodesMap={}},e.prototype.initialiseRowNodes=function(t,e){void 0===t&&(t=1),void 0===e&&(e=!1),this.destroyRowNodes();for(var o=0;o<t;o++){var r=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});e&&(r.failedLoad=!0),this.allRowNodes.push(r),this.nodesAfterFilter.push(r),this.nodesAfterSort.push(r)}},e.prototype.getBlockStateJson=function(){return{id:this.nodeIdPrefix?this.nodeIdPrefix:"",state:this.getState()}},e.prototype.loadFromDatasource=function(){this.storeUtils.loadFromDatasource({startRow:void 0,endRow:void 0,parentNode:this.parentRowNode,storeParams:this.ssrmParams,successCallback:this.pageLoaded.bind(this,this.getVersion()),success:this.success.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),fail:this.pageLoadFailed.bind(this,this.getVersion())})},e.prototype.getStartRow=function(){return 0},e.prototype.getEndRow=function(){return this.nodesAfterSort.length},e.prototype.createDataNode=function(t,e){var r=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});null!=e?o._.insertIntoArray(this.allRowNodes,r,e):this.allRowNodes.push(r);var n=this.prefixId(this.nodeIdSequence.next());return this.blockUtils.setDataIntoRowNode(r,t,n),this.nodeManager.addRowNode(r),this.blockUtils.checkOpenByDefault(r),this.allNodesMap[r.id]=r,r},e.prototype.prefixId=function(t){return this.nodeIdPrefix?this.nodeIdPrefix+"-"+t:t.toString()},e.prototype.processServerFail=function(){this.initialiseRowNodes(1,!0),this.fireStoreUpdatedEvent(),this.flushAsyncTransactions()},e.prototype.processServerResult=function(t){if(this.isAlive()){t.storeInfo&&o._.assign(this.info,t.storeInfo);var e=this.allRowNodes.length>0?this.allNodesMap:void 0;if(this.allRowNodes=[],this.nodesAfterSort=[],this.nodesAfterFilter=[],this.allNodesMap={},!t.rowData){o._.doOnce((function(){return console.warn('AG Grid: "params.data" is missing from Server-Side Row Model success() callback. Please use the "data" attribute. If no data is returned, set an empty list.',t)}),"FullStore.noData")}this.createOrRecycleNodes(e,t.rowData),e&&this.blockUtils.destroyRowNodes(o._.getAllValuesInObject(e)),this.filterAndSortNodes(),this.fireStoreUpdatedEvent(),this.flushAsyncTransactions()}},e.prototype.createOrRecycleNodes=function(t,e){var o=this;if(e){e.forEach((function(e){var r=function(e){if(t){var r=o.gridOptionsWrapper.getRowNodeIdFunc();if(r){var n=r(e),i=t[n];if(i)return delete t[n],i}}}(e);r?function(t,e){o.allNodesMap[t.id]=t,t.updateData(e),o.allRowNodes.push(t)}(r,e):o.createDataNode(e)}))}},e.prototype.flushAsyncTransactions=function(){var t=this;window.setTimeout((function(){return t.transactionManager.flushAsyncTransactions()}),0)},e.prototype.filterAndSortNodes=function(){this.filterRowNodes(),this.sortRowNodes()},e.prototype.sortRowNodes=function(){var t=this.sortController.getSortOptions(),e=!t||0==t.length,o=this.gridOptionsWrapper.isServerSideSortingAlwaysResets();this.nodesAfterSort=e||o?this.nodesAfterFilter:this.rowNodeSorter.doFullSort(this.nodesAfterFilter,t)},e.prototype.filterRowNodes=function(){var t=this,e=this.gridOptionsWrapper.isServerSideFilteringAlwaysResets(),o=this.groupLevel;this.nodesAfterFilter=e||o?this.allRowNodes:this.allRowNodes.filter((function(e){return t.filterManager.doesRowPassFilter({rowNode:e})}))},e.prototype.clearDisplayIndexes=function(){var t=this;this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.allRowNodes.forEach((function(e){return t.blockUtils.clearDisplayIndex(e)}))},e.prototype.getDisplayIndexEnd=function(){return this.displayIndexEnd},e.prototype.isDisplayIndexInStore=function(t){return 0!==this.getRowCount()&&(t>=this.displayIndexStart&&t<this.displayIndexEnd)},e.prototype.setDisplayIndexes=function(t,e){var o=this;this.displayIndexStart=t.peek(),this.topPx=e.value;var r={};this.nodesAfterSort.forEach((function(n){o.blockUtils.setDisplayIndex(n,t,e),r[n.id]=!0})),this.allRowNodes.forEach((function(t){r[t.id]||o.blockUtils.clearDisplayIndex(t)})),this.displayIndexEnd=t.peek(),this.heightPx=e.value-this.topPx},e.prototype.forEachNodeDeep=function(t,e){void 0===e&&(e=new o.NumberSequence),this.allRowNodes.forEach((function(o){t(o,e.next());var r=o.childStore;r&&r.forEachNodeDeep(t,e)}))},e.prototype.forEachNodeDeepAfterFilterAndSort=function(t,e){void 0===e&&(e=new o.NumberSequence),this.nodesAfterSort.forEach((function(o){t(o,e.next());var r=o.childStore;r&&r.forEachNodeDeepAfterFilterAndSort(t,e)}))},e.prototype.getRowUsingDisplayIndex=function(t){if(this.isDisplayIndexInStore(t))return this.blockUtils.binarySearchForDisplayIndex(t,this.nodesAfterSort)},e.prototype.getRowBounds=function(t){for(var e=0;e<this.nodesAfterSort.length;e++){var o=this.nodesAfterSort[e],r=this.blockUtils.extractRowBounds(o,t);if(r)return r}return null},e.prototype.isPixelInRange=function(t){return t>=this.topPx&&t<this.topPx+this.heightPx},e.prototype.getRowIndexAtPixel=function(t){var e=this;if(t<=this.topPx)return this.nodesAfterSort[0].rowIndex;if(t>=this.topPx+this.heightPx){var o=this.nodesAfterSort[this.nodesAfterSort.length-1],r=o.rowTop+o.rowHeight;if(t>=r&&o.expanded){if(o.childStore&&o.childStore.getRowCount()>0)return o.childStore.getRowIndexAtPixel(t);if(o.detailNode)return o.detailNode.rowIndex}return o.rowIndex}var n=null;return this.nodesAfterSort.forEach((function(o){var r=e.blockUtils.getIndexAtPixel(o,t);null!=r&&(n=r)})),null==n?this.displayIndexEnd-1:n},e.prototype.getChildStore=function(t){var e=this;return this.storeUtils.getChildStore(t,this,(function(t){return o._.find(e.allRowNodes,(function(e){return e.key===t}))}))},e.prototype.forEachChildStoreShallow=function(t){this.allRowNodes.forEach((function(e){var o=e.childStore;o&&t(o)}))},e.prototype.refreshAfterFilter=function(t){t.alwaysReset||this.gridOptionsWrapper.isTreeData()?this.refreshStore(!0):(this.filterAndSortNodes(),this.forEachChildStoreShallow((function(e){return e.refreshAfterFilter(t)})))},e.prototype.refreshAfterSort=function(t){t.alwaysReset?this.refreshStore(!0):(this.sortRowNodes(),this.forEachChildStoreShallow((function(e){return e.refreshAfterSort(t)})))},e.prototype.applyTransaction=function(t){switch(this.getState()){case o.RowNodeBlock.STATE_FAILED:return{status:o.ServerSideTransactionResultStatus.StoreLoadingFailed};case o.RowNodeBlock.STATE_LOADING:return{status:o.ServerSideTransactionResultStatus.StoreLoading};case o.RowNodeBlock.STATE_WAITING_TO_LOAD:return{status:o.ServerSideTransactionResultStatus.StoreWaitingToLoad}}var e=this.gridOptionsWrapper.getIsApplyServerSideTransactionFunc();if(e&&!e({transaction:t,parentNode:this.parentRowNode,storeInfo:this.info}))return{status:o.ServerSideTransactionResultStatus.Cancelled};var r={status:o.ServerSideTransactionResultStatus.Applied,remove:[],update:[],add:[]},n=[];return this.executeAdd(t,r),this.executeRemove(t,r,n),this.executeUpdate(t,r,n),this.filterAndSortNodes(),this.updateSelection(n),r},e.prototype.updateSelection=function(t){if(t.length>0){t.forEach((function(t){t.setSelected(!1,!1,!0)}));var e={type:o.Events.EVENT_SELECTION_CHANGED,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()};this.eventService.dispatchEvent(e)}},e.prototype.executeAdd=function(t,e){var r=this,n=t.add,i=t.addIndex;o._.missingOrEmpty(n)||("number"==typeof i&&i>=0?n.reverse().forEach((function(t){var o=r.createDataNode(t,i);e.add.push(o)})):n.forEach((function(t){var o=r.createDataNode(t);e.add.push(o)})))},e.prototype.executeRemove=function(t,e,o){var r=this,n=t.remove;if(null!=n){var i={};n.forEach((function(t){var n=r.lookupRowNode(t);n&&(n.isSelected()&&o.push(n),n.clearRowTopAndRowIndex(),i[n.id]=!0,delete r.allNodesMap[n.id],e.remove.push(n),r.nodeManager.removeNode(n))})),this.allRowNodes=this.allRowNodes.filter((function(t){return!i[t.id]}))}},e.prototype.executeUpdate=function(t,e,o){var r=this,n=t.update;null!=n&&n.forEach((function(t){var n=r.lookupRowNode(t);n&&(n.updateData(t),!n.selectable&&n.isSelected()&&o.push(n),e.update.push(n))}))},e.prototype.lookupRowNode=function(t){var e,r=this.gridOptionsWrapper.getRowNodeIdFunc();if(o._.exists(r)){var n=r(t);if(!(e=this.allNodesMap[n]))return console.error("AG Grid: could not find row id="+n+", data item was not found for this id"),null}else if(!(e=o._.find(this.allRowNodes,(function(e){return e.data===t}))))return console.error("AG Grid: could not find data item as object was not found",t),null;return e},e.prototype.addStoreStates=function(t){t.push({type:"full",route:this.storeUtils.createGroupKeys(this.parentRowNode),rowCount:this.allRowNodes.length,info:this.info}),this.forEachChildStoreShallow((function(e){return e.addStoreStates(t)}))},e.prototype.refreshStore=function(t){if(t){var e=this.nodesAfterSort?this.nodesAfterSort.length:1;this.initialiseRowNodes(e)}this.scheduleLoad(),this.fireStoreUpdatedEvent()},e.prototype.retryLoads=function(){this.getState()===o.RowNodeBlock.STATE_FAILED&&(this.initialiseRowNodes(1),this.scheduleLoad()),this.forEachChildStoreShallow((function(t){return t.retryLoads()}))},e.prototype.scheduleLoad=function(){this.setStateWaitingToLoad(),this.rowNodeBlockLoader.checkBlockToLoad()},e.prototype.fireStoreUpdatedEvent=function(){var t={type:o.Events.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(t)},e.prototype.getRowCount=function(){return this.nodesAfterSort.length},e.prototype.getTopLevelRowDisplayedIndex=function(t){return this.nodesAfterSort[t].rowIndex},e.prototype.isLastRowIndexKnown=function(){return this.getState()==o.RowNodeBlock.STATE_LOADED},e.prototype.getRowNodesInRange=function(t,e){var r=[],n=!1;return o._.missing(t)&&(n=!0),this.nodesAfterSort.forEach((function(o){var i=o===t||o===e;(n||i)&&r.push(o),i&&(n=!n)})),n?[]:r},L([o.Autowired("ssrmCacheUtils")],e.prototype,"storeUtils",void 0),L([o.Autowired("ssrmBlockUtils")],e.prototype,"blockUtils",void 0),L([o.Autowired("columnModel")],e.prototype,"columnModel",void 0),L([o.Autowired("rowNodeBlockLoader")],e.prototype,"rowNodeBlockLoader",void 0),L([o.Autowired("rowNodeSorter")],e.prototype,"rowNodeSorter",void 0),L([o.Autowired("sortController")],e.prototype,"sortController",void 0),L([o.Autowired("ssrmNodeManager")],e.prototype,"nodeManager",void 0),L([o.Autowired("filterManager")],e.prototype,"filterManager",void 0),L([o.Autowired("ssrmTransactionManager")],e.prototype,"transactionManager",void 0),L([o.PostConstruct],e.prototype,"postConstruct",null),L([o.PreDestroy],e.prototype,"destroyRowNodes",null),e}(o.RowNodeBlock),F=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},G=function(){function t(){}return t.prototype.createStore=function(t,e){var o=this.getStoreParams(t,e);return new("partial"===o.storeType?B:U)(t,o,e)},t.prototype.getStoreParams=function(t,e){var o=this.getLevelSpecificParams(e),r=this.getStoreType(o);return{storeType:r,cacheBlockSize:this.getBlockSize(r,o),maxBlocksInCache:this.getMaxBlocksInCache(r,t,o)}},t.prototype.getMaxBlocksInCache=function(t,e,r){if("full"!=t){var n=r&&null!=r.maxBlocksInCache?r.maxBlocksInCache:this.gridOptionsWrapper.getMaxBlocksInCache();if(null!=n&&n>=0)if(e.dynamicRowHeight){o._.doOnce((function(){return console.warn("AG Grid: Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.")}),"storeFactory.maxBlocksInCache.dynamicRowHeight")}else{if(!this.columnModel.isAutoRowHeightActive())return n;o._.doOnce((function(){return console.warn("AG Grid: Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.")}),"storeFactory.maxBlocksInCache.autoRowHeightActive")}}},t.prototype.getBlockSize=function(t,e){if("full"!=t){var o=e&&null!=e.cacheBlockSize?e.cacheBlockSize:this.gridOptionsWrapper.getCacheBlockSize();return null!=o&&o>0?o:100}},t.prototype.getLevelSpecificParams=function(t){var e=this.gridOptionsWrapper.getServerSideStoreParamsFunc();if(e)return e({level:t.level+1,parentRowNode:t.level>=0?t:void 0,rowGroupColumns:this.columnModel.getRowGroupColumns(),pivotColumns:this.columnModel.getPivotColumns(),pivotMode:this.columnModel.isPivotMode()})},t.prototype.getStoreType=function(t){var e=t&&null!=t.storeType?t.storeType:this.gridOptionsWrapper.getServerSideStoreType();switch(e){case"partial":case"full":return e;case null:case void 0:return"full";default:var o=["full","partial"].join(", ");return console.warn("AG Grid: invalid Server Side Store Type "+e+", valid types are ["+o+"]"),"partial"}},F([o.Autowired("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),F([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),t=F([o.Bean("ssrmStoreFactory")],t)}(),j=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},W=function(){function t(){}return t.prototype.isSortingWithValueColumn=function(t){for(var e=this.columnModel.getValueColumns().map((function(t){return t.getColId()})),o=0;o<t.length;o++)if(e.indexOf(t[o])>-1)return!0;return!1},t.prototype.isSortingWithSecondaryColumn=function(t){if(!this.columnModel.getSecondaryColumns())return!1;for(var e=this.columnModel.getSecondaryColumns().map((function(t){return t.getColId()})),o=0;o<t.length;o++)if(e.indexOf(t[o])>-1)return!0;return!1},j([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),t=j([o.Bean("ssrmListenerUtils")],t)}(),H={moduleName:o.ModuleNames.ServerSideRowModelModule,rowModels:{serverSide:a},beans:[N,x,c,h,y,w,E,G,W],dependantModules:[r.EnterpriseCoreModule]};exports.ServerSideRowModelModule=H; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var t,e,o=require("@ag-grid-community/core"),r=require("@ag-grid-enterprise/core"),n=(t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)},function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}),i=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},s=function(t,e){return function(o,r){e(o,r,t)}},a=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.pauseStoreUpdateListening=!1,e}return n(e,t),e.prototype.ensureRowHeightsValid=function(){return!1},e.prototype.start=function(){var t=this.gridOptionsWrapper.getServerSideDatasource();t&&this.setDatasource(t)},e.prototype.destroyDatasource=function(){this.datasource&&(this.datasource.destroy&&this.datasource.destroy(),this.rowRenderer.datasourceChanged(),this.datasource=void 0)},e.prototype.setBeans=function(t){this.logger=t.create("ServerSideRowModel")},e.prototype.addEventListeners=function(){this.addManagedListener(this.eventService,o.Events.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,o.Events.EVENT_STORE_UPDATED,this.onStoreUpdated.bind(this));var t=this.resetRootStore.bind(this);this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_VALUE_CHANGED,t),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_CHANGED,t),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_ROW_GROUP_CHANGED,t),this.addManagedListener(this.eventService,o.Events.EVENT_COLUMN_PIVOT_MODE_CHANGED,t),this.verifyProps()},e.prototype.verifyProps=function(){if(null!=this.gridOptionsWrapper.getDefaultGroupOrderComparator()){o._.doOnce((function(){return console.warn("AG Grid: defaultGroupOrderComparator cannot be used with Server Side Row Model. If using Full Store, then provide the rows to the grid in the desired sort order. If using Partial Store, then sorting is done on the server side, nothing to do with the client.")}),"SSRM.DefaultGroupOrderComparator")}},e.prototype.setDatasource=function(t){this.destroyDatasource(),this.datasource=t,this.resetRootStore()},e.prototype.isLastRowIndexKnown=function(){var t=this.getRootStore();return!!t&&t.isLastRowIndexKnown()},e.prototype.onColumnEverything=function(){if(!this.gridOptionsWrapper.isSuppressEnterpriseResetOnNewColumns())if(this.storeParams){var t=this.columnsToValueObjects(this.columnModel.getRowGroupColumns()),e=this.columnsToValueObjects(this.columnModel.getValueColumns()),r=this.columnsToValueObjects(this.columnModel.getPivotColumns()),n=!o._.jsonEquals(this.storeParams.sortModel,this.sortController.getSortModel()),i=!o._.jsonEquals(this.storeParams.rowGroupCols,t),s=!o._.jsonEquals(this.storeParams.pivotCols,r),a=!o._.jsonEquals(this.storeParams.valueCols,e);(n||i||s||a)&&this.resetRootStore()}else this.resetRootStore()},e.prototype.destroyRootStore=function(){this.rootNode&&this.rootNode.childStore&&(this.rootNode.childStore=this.destroyBean(this.rootNode.childStore),this.nodeManager.clear())},e.prototype.refreshAfterSort=function(t,e){this.storeParams&&(this.storeParams.sortModel=t);var o=this.getRootStore();o&&(o.refreshAfterSort(e),this.onStoreUpdated())},e.prototype.resetRootStore=function(){this.destroyRootStore(),this.rootNode=new o.RowNode(this.beans),this.rootNode.group=!0,this.rootNode.level=-1,this.datasource&&(this.storeParams=this.createStoreParams(),this.rootNode.childStore=this.createBean(this.storeFactory.createStore(this.storeParams,this.rootNode)),this.updateRowIndexesAndBounds());var t={type:o.Events.EVENT_ROW_DATA_CHANGED,api:this.gridApi,columnApi:this.columnApi};this.eventService.dispatchEvent(t),this.dispatchModelUpdated(!0)},e.prototype.columnsToValueObjects=function(t){var e=this;return t.map((function(t){return{id:t.getId(),aggFunc:t.getAggFunc(),displayName:e.columnModel.getDisplayNameForColumn(t,"model"),field:t.getColDef().field}}))},e.prototype.createStoreParams=function(){var t=this.columnsToValueObjects(this.columnModel.getRowGroupColumns()),e=this.columnsToValueObjects(this.columnModel.getValueColumns()),r=this.columnsToValueObjects(this.columnModel.getPivotColumns()),n=this.gridOptionsWrapper.isDynamicRowHeight();return{valueCols:e,rowGroupCols:t,pivotCols:r,pivotMode:this.columnModel.isPivotMode(),filterModel:this.filterManager.getFilterModel(),sortModel:this.sortListener.extractSortModel(),datasource:this.datasource,lastAccessedSequence:new o.NumberSequence,dynamicRowHeight:n}},e.prototype.getParams=function(){return this.storeParams},e.prototype.dispatchModelUpdated=function(t){void 0===t&&(t=!1);var e={type:o.Events.EVENT_MODEL_UPDATED,api:this.gridApi,columnApi:this.columnApi,animate:!t,keepRenderedRows:!t,newPage:!1,newData:!1};this.eventService.dispatchEvent(e)},e.prototype.onStoreUpdated=function(){this.pauseStoreUpdateListening||(this.updateRowIndexesAndBounds(),this.dispatchModelUpdated())},e.prototype.onRowHeightChanged=function(){this.updateRowIndexesAndBounds(),this.dispatchModelUpdated()},e.prototype.updateRowIndexesAndBounds=function(){var t=this.getRootStore();t&&t.setDisplayIndexes(new o.NumberSequence,{value:0})},e.prototype.retryLoads=function(){var t=this.getRootStore();t&&(t.retryLoads(),this.onStoreUpdated())},e.prototype.getRow=function(t){var e=this.getRootStore();if(e)return e.getRowUsingDisplayIndex(t)},e.prototype.expandAll=function(t){this.pauseStoreUpdateListening=!0,this.forEachNode((function(e){e.group&&e.setExpanded(t)})),this.pauseStoreUpdateListening=!1,this.onStoreUpdated()},e.prototype.refreshAfterFilter=function(t,e){this.storeParams&&(this.storeParams.filterModel=t);var o=this.getRootStore();o&&(o.refreshAfterFilter(e),this.onStoreUpdated())},e.prototype.getRootStore=function(){if(this.rootNode&&this.rootNode.childStore)return this.rootNode.childStore},e.prototype.getRowCount=function(){var t=this.getRootStore();return t?t.getDisplayIndexEnd():1},e.prototype.getTopLevelRowCount=function(){var t=this.getRootStore();return t?t.getRowCount():1},e.prototype.getTopLevelRowDisplayedIndex=function(t){var e=this.getRootStore();return e?e.getTopLevelRowDisplayedIndex(t):t},e.prototype.getRowBounds=function(t){var e=this.getRootStore();return e?e.getRowBounds(t):{rowTop:0,rowHeight:this.gridOptionsWrapper.getRowHeightAsNumber()}},e.prototype.getRowIndexAtPixel=function(t){var e=this.getRootStore();return t<=0||!e?0:e.getRowIndexAtPixel(t)},e.prototype.isEmpty=function(){return!1},e.prototype.isRowsToRender=function(){return null!=this.getRootStore()&&this.getRowCount()>0},e.prototype.getType=function(){return o.Constants.ROW_MODEL_TYPE_SERVER_SIDE},e.prototype.forEachNode=function(t){var e=this.getRootStore();e&&e.forEachNodeDeep(t)},e.prototype.forEachNodeAfterFilterAndSort=function(t){var e=this.getRootStore();e&&e.forEachNodeDeepAfterFilterAndSort(t)},e.prototype.executeOnStore=function(t,e){var o=this.getRootStore();if(o){var r=o.getChildStore(t);r&&e(r)}},e.prototype.refreshStore=function(t){void 0===t&&(t={});var e=t.route?t.route:[];this.executeOnStore(e,(function(e){return e.refreshStore(1==t.purge)}))},e.prototype.getStoreState=function(){var t=[],e=this.getRootStore();return e&&e.addStoreStates(t),t},e.prototype.getNodesInRangeForSelection=function(t,e){return o._.exists(e)&&t.parent!==e.parent?[]:t.parent.childStore.getRowNodesInRange(e,t)},e.prototype.getRowNode=function(t){var e=void 0;return this.forEachNode((function(o){o.id===t&&(e=o),o.detailNode&&o.detailNode.id===t&&(e=o.detailNode)})),e},e.prototype.isRowPresent=function(t){return!!this.getRowNode(t.id)},i([o.Autowired("columnModel")],e.prototype,"columnModel",void 0),i([o.Autowired("filterManager")],e.prototype,"filterManager",void 0),i([o.Autowired("sortController")],e.prototype,"sortController",void 0),i([o.Autowired("gridApi")],e.prototype,"gridApi",void 0),i([o.Autowired("columnApi")],e.prototype,"columnApi",void 0),i([o.Autowired("rowRenderer")],e.prototype,"rowRenderer",void 0),i([o.Autowired("ssrmSortService")],e.prototype,"sortListener",void 0),i([o.Autowired("ssrmNodeManager")],e.prototype,"nodeManager",void 0),i([o.Autowired("ssrmStoreFactory")],e.prototype,"storeFactory",void 0),i([o.Autowired("beans")],e.prototype,"beans",void 0),i([o.PreDestroy],e.prototype,"destroyDatasource",null),i([s(0,o.Qualifier("loggerFactory"))],e.prototype,"setBeans",null),i([o.PostConstruct],e.prototype,"addEventListeners",null),i([o.PreDestroy],e.prototype,"destroyRootStore",null),e=i([o.Bean("rowModel")],e)}(o.BeanStub),l=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),d=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},c=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return l(e,t),e.prototype.createGroupKeys=function(t){for(var e=[],o=t;o&&o.level>=0;)e.push(o.key),o=o.parent;return e.reverse(),e},e.prototype.loadFromDatasource=function(t){var e=this.createGroupKeys(t.parentNode),o=t.storeParams;if(o.datasource){var r={startRow:t.startRow,endRow:t.endRow,rowGroupCols:o.rowGroupCols,valueCols:o.valueCols,pivotCols:o.pivotCols,pivotMode:o.pivotMode,groupKeys:e,filterModel:o.filterModel,sortModel:o.sortModel},n={successCallback:t.successCallback,success:t.success,failCallback:t.failCallback,fail:t.fail,request:r,parentNode:t.parentNode,api:this.gridApi,columnApi:this.columnApi};window.setTimeout((function(){o.datasource&&o.datasource.getRows(n)}),0)}},e.prototype.getChildStore=function(t,e,r){if(o._.missingOrEmpty(t))return e;var n=r(t[0]);if(n){var i=t.slice(1,t.length),s=n.childStore;return s?s.getChildStore(i):null}return null},e.prototype.isServerRefreshNeeded=function(t,e,o){if(o.alwaysReset||o.valueColChanged||o.secondaryColChanged)return!0;var r=t.level+1;if(!(r<e.length))return!0;var n=e[r].id;return!!(o.changedColumns.indexOf(n)>-1)},d([o.Autowired("columnApi")],e.prototype,"columnApi",void 0),d([o.Autowired("gridApi")],e.prototype,"gridApi",void 0),e=d([o.Bean("ssrmCacheUtils")],e)}(o.BeanStub),u=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),p=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},h=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return u(e,t),e.prototype.postConstruct=function(){this.rowHeight=this.gridOptionsWrapper.getRowHeightAsNumber(),this.usingTreeData=this.gridOptionsWrapper.isTreeData(),this.usingMasterDetail=this.gridOptionsWrapper.isMasterDetail()},e.prototype.createRowNode=function(t){var e=new o.RowNode(this.beans),r=null!=t.rowHeight?t.rowHeight:this.rowHeight;return e.setRowHeight(r),e.group=t.group,e.leafGroup=t.leafGroup,e.level=t.level,e.uiLevel=t.level,e.parent=t.parent,e.stub=!0,e.group&&(e.expanded=!1,e.field=t.field,e.rowGroupColumn=t.rowGroupColumn),e},e.prototype.destroyRowNodes=function(t){t&&t.forEach(this.destroyRowNode.bind(this))},e.prototype.destroyRowNode=function(t){t.childStore&&(this.destroyBean(t.childStore),t.childStore=null),t.clearRowTopAndRowIndex(),null!=t.id&&this.nodeManager.removeNode(t)},e.prototype.setDataIntoRowNode=function(t,e,r,n){if(t.stub=!1,o._.exists(e)){if(t.setDataAndId(e,r),this.usingTreeData){var i=this.gridOptionsWrapper.getIsServerSideGroupFunc(),s=this.gridOptionsWrapper.getServerSideGroupKeyFunc();null!=i&&(t.group=i(t.data),t.group&&null!=s&&(t.key=s(t.data)))}else if(t.group)t.key=this.valueService.getValue(t.rowGroupColumn,t),null!==t.key&&void 0!==t.key||o._.doOnce((function(){console.warn("null and undefined values are not allowed for server side row model keys"),t.rowGroupColumn&&console.warn("column = "+t.rowGroupColumn.getId()),console.warn("data is ",t.data)}),"ServerSideBlock-CannotHaveNullOrUndefinedForKey");else if(this.usingMasterDetail){var a=this.gridOptionsWrapper.getIsRowMasterFunc();t.master=null==a||a(t.data)}}else t.setDataAndId(void 0,void 0),t.key=null;(this.usingTreeData||t.group)&&(this.setGroupDataIntoRowNode(t),this.setChildCountIntoRowNode(t)),o._.exists(e)&&t.setRowHeight(this.gridOptionsWrapper.getRowHeightForNode(t,!1,n).height)},e.prototype.setChildCountIntoRowNode=function(t){var e=this.gridOptionsWrapper.getChildCountFunc();e&&(t.allChildrenCount=e(t.data))},e.prototype.setGroupDataIntoRowNode=function(t){var e=this,o=this.columnModel.getGroupDisplayColumns(),r=this.gridOptionsWrapper.isTreeData();o.forEach((function(o){if(null==t.groupData&&(t.groupData={}),r)t.groupData[o.getColId()]=t.key;else if(o.isRowGroupDisplayed(t.rowGroupColumn.getId())){var n=e.valueService.getValue(t.rowGroupColumn,t);t.groupData[o.getColId()]=n}}))},e.prototype.clearDisplayIndex=function(t){(t.clearRowTopAndRowIndex(),t.group&&o._.exists(t.childStore))&&t.childStore.clearDisplayIndexes();t.master&&t.detailNode&&t.detailNode.clearRowTopAndRowIndex()},e.prototype.setDisplayIndex=function(t,e,r){if(t.setRowIndex(e.next()),t.setRowTop(r.value),r.value+=t.rowHeight,t.master&&(t.expanded&&t.detailNode?(t.detailNode.setRowIndex(e.next()),t.detailNode.setRowTop(r.value),r.value+=t.detailNode.rowHeight):t.detailNode&&t.detailNode.clearRowTopAndRowIndex()),t.group&&o._.exists(t.childStore)){var n=t.childStore;t.expanded?n.setDisplayIndexes(e,r):n.clearDisplayIndexes()}},e.prototype.binarySearchForDisplayIndex=function(t,e){var r=0,n=e.length-1;if(o._.missing(n)||o._.missing(r))console.warn("ag-grid: error: topPointer = "+n+", bottomPointer = "+r);else for(;;){var i=Math.floor((r+n)/2),s=e[i];if(s.rowIndex===t)return s;if(s.master&&s.expanded&&s.detailNode.rowIndex===t)return s.detailNode;var a=s.childStore;if(s.expanded&&a&&a.isDisplayIndexInStore(t))return a.getRowUsingDisplayIndex(t);if(s.rowIndex<t)r=i+1;else{if(!(s.rowIndex>t))return void console.warn("AG Grid: error: unable to locate rowIndex = "+t+" in cache");n=i-1}}},e.prototype.extractRowBounds=function(t,e){var r=function(t){return{rowHeight:t.rowHeight,rowTop:t.rowTop}};if(t.rowIndex===e)return r(t);if(t.group&&t.expanded&&o._.exists(t.childStore)){var n=t.childStore;if(n.isDisplayIndexInStore(e))return n.getRowBounds(e)}else if(t.master&&t.expanded&&o._.exists(t.detailNode)&&t.detailNode.rowIndex===e)return r(t.detailNode)},e.prototype.getIndexAtPixel=function(t,e){if(t.isPixelInRange(e))return t.rowIndex;if(t.master&&t.expanded&&t.detailNode.isPixelInRange(e))return t.detailNode.rowIndex;if(t.group&&t.expanded&&o._.exists(t.childStore)){var r=t.childStore;if(r.isPixelInRange(e))return r.getRowIndexAtPixel(e)}return null},e.prototype.createNodeIdPrefix=function(t){for(var e=[],o=t;o&&o.level>=0;)e.push(o.key),o=o.parent;if(e.length>0)return e.reverse().join("-")},e.prototype.checkOpenByDefault=function(t){if(t.isExpandable()){var e=this.gridOptionsWrapper.getIsServerSideGroupOpenByDefaultFunc();if(e)e({data:t.data,rowNode:t})&&window.setTimeout((function(){return t.setExpanded(!0)}),0)}},p([o.Autowired("valueService")],e.prototype,"valueService",void 0),p([o.Autowired("columnModel")],e.prototype,"columnModel",void 0),p([o.Autowired("ssrmNodeManager")],e.prototype,"nodeManager",void 0),p([o.Autowired("beans")],e.prototype,"beans",void 0),p([o.PostConstruct],e.prototype,"postConstruct",null),e=p([o.Bean("ssrmBlockUtils")],e)}(o.BeanStub),f=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},y=function(){function t(){this.rowNodes={}}return t.prototype.addRowNode=function(t){var e=t.id;this.rowNodes[e]&&(console.warn("AG Grid: duplicate node id "+t.id),console.warn("first instance",this.rowNodes[e].data),console.warn("second instance",t.data)),this.rowNodes[e]=t},t.prototype.removeNode=function(t){var e=t.id;this.rowNodes[e]&&(this.rowNodes[e]=void 0)},t.prototype.clear=function(){this.rowNodes={}},f([o.PreDestroy],t.prototype,"clear",null),t=f([o.Bean("ssrmNodeManager")],t)}(),g=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),v=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},w=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.asyncTransactions=[],e}return g(e,t),e.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()},e.prototype.applyTransactionAsync=function(t,e){null==this.asyncTransactionsTimeout&&this.scheduleExecuteAsync(),this.asyncTransactions.push({transaction:t,callback:e})},e.prototype.scheduleExecuteAsync=function(){var t=this,e=this.gridOptionsWrapper.getAsyncTransactionWaitMillis();this.asyncTransactionsTimeout=window.setTimeout((function(){t.executeAsyncTransactions()}),e)},e.prototype.executeAsyncTransactions=function(){var t=this;if(this.asyncTransactions){var e=[],r=[],n=[],i=!1;if(this.asyncTransactions.forEach((function(s){var a;t.serverSideRowModel.executeOnStore(s.transaction.route,(function(t){a=t.applyTransaction(s.transaction)})),null==a&&(a={status:o.ServerSideTransactionResultStatus.StoreNotFound}),r.push(a),a.status==o.ServerSideTransactionResultStatus.StoreLoading?n.push(s):(s.callback&&e.push((function(){return s.callback(a)})),a.status===o.ServerSideTransactionResultStatus.Applied&&(i=!0))})),e.length>0&&window.setTimeout((function(){e.forEach((function(t){return t()}))}),0),this.asyncTransactionsTimeout=void 0,this.asyncTransactions=n,i&&(this.valueCache.onDataChanged(),this.eventService.dispatchEvent({type:o.Events.EVENT_STORE_UPDATED})),r.length>0){var s={api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi(),type:o.Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:r};this.eventService.dispatchEvent(s)}}},e.prototype.flushAsyncTransactions=function(){null!=this.asyncTransactionsTimeout&&clearTimeout(this.asyncTransactionsTimeout),this.executeAsyncTransactions()},e.prototype.applyTransaction=function(t){var e;return this.serverSideRowModel.executeOnStore(t.route,(function(o){e=o.applyTransaction(t)})),e?(this.valueCache.onDataChanged(),this.eventService.dispatchEvent({type:o.Events.EVENT_STORE_UPDATED}),e):{status:o.ServerSideTransactionResultStatus.StoreNotFound}},v([o.Autowired("rowNodeBlockLoader")],e.prototype,"rowNodeBlockLoader",void 0),v([o.Autowired("valueCache")],e.prototype,"valueCache",void 0),v([o.Autowired("rowModel")],e.prototype,"serverSideRowModel",void 0),v([o.PostConstruct],e.prototype,"postConstruct",null),e=v([o.Bean("ssrmTransactionManager")],e)}(o.BeanStub),S=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),R=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},N=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return S(e,t),e.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()&&this.addManagedListener(this.eventService,o.Events.EVENT_ROW_GROUP_OPENED,this.onRowGroupOpened.bind(this))},e.prototype.onRowGroupOpened=function(t){var e=t.node;if(e.expanded){if(e.master)this.createDetailNode(e);else if(o._.missing(e.childStore)){var r=this.serverSideRowModel.getParams();e.childStore=this.createBean(this.storeFactory.createStore(r,e))}}else this.gridOptionsWrapper.isPurgeClosedRowNodes()&&o._.exists(e.childStore)&&(e.childStore=this.destroyBean(e.childStore));var n={type:o.Events.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(n)},e.prototype.createDetailNode=function(t){if(o._.exists(t.detailNode))return t.detailNode;var e=new o.RowNode(this.beans);e.detail=!0,e.selectable=!1,e.parent=t,o._.exists(t.id)&&(e.id="detail_"+t.id),e.data=t.data,e.level=t.level+1;var r=this.gridOptionsWrapper.getRowHeightForNode(e).height;return e.rowHeight=r||200,t.detailNode=e,e},R([o.Autowired("rowModel")],e.prototype,"serverSideRowModel",void 0),R([o.Autowired("ssrmStoreFactory")],e.prototype,"storeFactory",void 0),R([o.Autowired("beans")],e.prototype,"beans",void 0),R([o.PostConstruct],e.prototype,"postConstruct",null),e=R([o.Bean("ssrmExpandListener")],e)}(o.BeanStub),I=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),m=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},x=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return I(e,t),e.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()&&this.addManagedListener(this.eventService,o.Events.EVENT_SORT_CHANGED,this.onSortChanged.bind(this))},e.prototype.extractSortModel=function(){var t=this.sortController.getSortModel();return this.gridOptionsWrapper.isTreeData()||(this.replaceAutoGroupColumnWithActualRowGroupColumns(t),this.removeMultiColumnPrefixOnColumnIds(t)),t},e.prototype.removeMultiColumnPrefixOnColumnIds=function(t){if(this.gridOptionsWrapper.isGroupMultiAutoColumn())for(var e=o.Constants.GROUP_AUTO_COLUMN_ID+"-",r=0;r<t.length;++r)t[r].colId.indexOf(e)>-1&&(t[r].colId=t[r].colId.substr(e.length))},e.prototype.replaceAutoGroupColumnWithActualRowGroupColumns=function(t){var e=o._.find(t,(function(t){return t.colId==o.Constants.GROUP_AUTO_COLUMN_ID}));if(e){var r=t.indexOf(e);o._.removeFromArray(t,e);var n=this.columnModel.getRowGroupColumns().filter((function(e){return 0==t.filter((function(t){return t.colId===e.getColId()})).length})).map((function(t){return{colId:t.getId(),sort:e.sort}}));o._.insertArrayIntoArray(t,n,r)}},e.prototype.onSortChanged=function(){var t=this.serverSideRowModel.getParams();if(t){var e=this.extractSortModel(),o=t.sortModel,r=this.findChangedColumnsInSort(e,o),n={valueColChanged:this.listenerUtils.isSortingWithValueColumn(r),secondaryColChanged:this.listenerUtils.isSortingWithSecondaryColumn(r),alwaysReset:this.gridOptionsWrapper.isServerSideSortingAlwaysResets(),changedColumns:r};this.serverSideRowModel.refreshAfterSort(e,n)}},e.prototype.findChangedColumnsInSort=function(t,e){var r=[];[t,e].forEach((function(t){if(t){var e=t.map((function(t){return t.colId}));r=r.concat(e)}}));return r.filter((function(r){var n=o._.find(e,(function(t){return t.colId===r})),i=o._.find(t,(function(t){return t.colId===r}));return function(t,e){return(t?t.sort:null)!==(e?e.sort:null)}(n,i)||function(o,r){return e.indexOf(o)!==t.indexOf(r)}(n,i)}))},m([o.Autowired("sortController")],e.prototype,"sortController",void 0),m([o.Autowired("columnModel")],e.prototype,"columnModel",void 0),m([o.Autowired("rowModel")],e.prototype,"serverSideRowModel",void 0),m([o.Autowired("ssrmListenerUtils")],e.prototype,"listenerUtils",void 0),m([o.PostConstruct],e.prototype,"postConstruct",null),e=m([o.Bean("ssrmSortService")],e)}(o.BeanStub),A=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),C=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},E=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return A(e,t),e.prototype.postConstruct=function(){this.gridOptionsWrapper.isRowModelServerSide()&&this.addManagedListener(this.eventService,o.Events.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this))},e.prototype.onFilterChanged=function(){var t=this.serverSideRowModel.getParams();if(t){var e=this.filterManager.getFilterModel(),o=t?t.filterModel:{},r=this.findChangedColumns(e,o),n={valueColChanged:this.listenerUtils.isSortingWithValueColumn(r),secondaryColChanged:this.listenerUtils.isSortingWithSecondaryColumn(r),alwaysReset:this.gridOptionsWrapper.isServerSideFilteringAlwaysResets(),changedColumns:r};this.serverSideRowModel.refreshAfterFilter(e,n)}},e.prototype.findChangedColumns=function(t,e){var o={};Object.keys(t).forEach((function(t){return o[t]=!0})),Object.keys(e).forEach((function(t){return o[t]=!0}));var r=[];return Object.keys(o).forEach((function(o){JSON.stringify(t[o])!=JSON.stringify(e[o])&&r.push(o)})),r},C([o.Autowired("rowModel")],e.prototype,"serverSideRowModel",void 0),C([o.Autowired("filterManager")],e.prototype,"filterManager",void 0),C([o.Autowired("ssrmListenerUtils")],e.prototype,"listenerUtils",void 0),C([o.PostConstruct],e.prototype,"postConstruct",null),e=C([o.Bean("ssrmFilterListener")],e)}(o.BeanStub),O=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),D=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},k=function(t,e){return function(o,r){e(o,r,t)}},_=function(t){function e(e,o,r,n,i){var s=t.call(this,e)||this;return s.ssrmParams=r,s.storeParams=n,s.parentRowNode=o,s.startRow=e*n.cacheBlockSize,s.parentStore=i,s.level=o.level+1,s.groupLevel=r.rowGroupCols?s.level<r.rowGroupCols.length:void 0,s.leafGroup=!!r.rowGroupCols&&s.level===r.rowGroupCols.length-1,s}return O(e,t),e.prototype.postConstruct=function(){if(this.usingTreeData=this.gridOptionsWrapper.isTreeData(),!this.usingTreeData&&this.groupLevel){var t=this.ssrmParams.rowGroupCols[this.level];this.groupField=t.field,this.rowGroupColumn=this.columnModel.getRowGroupColumns()[this.level]}this.nodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.parentRowNode),this.setData([])},e.prototype.isDisplayIndexInBlock=function(t){return t>=this.displayIndexStart&&t<this.displayIndexEnd},e.prototype.isBlockBefore=function(t){return t>=this.displayIndexEnd},e.prototype.getDisplayIndexStart=function(){return this.displayIndexStart},e.prototype.getDisplayIndexEnd=function(){return this.displayIndexEnd},e.prototype.getBlockHeightPx=function(){return this.blockHeightPx},e.prototype.getBlockTopPx=function(){return this.blockTopPx},e.prototype.isGroupLevel=function(){return this.groupLevel},e.prototype.getGroupField=function(){return this.groupField},e.prototype.prefixId=function(t){return null!=this.nodeIdPrefix?this.nodeIdPrefix+"-"+t:t.toString()},e.prototype.getBlockStateJson=function(){return{id:this.prefixId(this.getId()),state:{blockNumber:this.getId(),startRow:this.startRow,endRow:this.startRow+this.storeParams.cacheBlockSize,pageStatus:this.getState()}}},e.prototype.isAnyNodeOpen=function(){return this.rowNodes.filter((function(t){return t.expanded})).length>0},e.prototype.forEachNode=function(t,e,r,n){void 0===e&&(e=new o.NumberSequence),this.rowNodes.forEach((function(o){if(t(o,e.next()),r&&o.childStore){var i=o.childStore;n?i.forEachNodeDeepAfterFilterAndSort(t,e):i.forEachNodeDeep(t,e)}}))},e.prototype.forEachNodeDeep=function(t,e){this.forEachNode(t,e,!0,!1)},e.prototype.forEachNodeAfterFilterAndSort=function(t,e){this.forEachNode(t,e,!0,!0)},e.prototype.forEachNodeShallow=function(t,e){this.forEachNode(t,e,!1,!1)},e.prototype.getLastAccessed=function(){return this.lastAccessed},e.prototype.getRowUsingLocalIndex=function(t){return this.rowNodes[t-this.startRow]},e.prototype.touchLastAccessed=function(){this.lastAccessed=this.ssrmParams.lastAccessedSequence.next()},e.prototype.processServerFail=function(){this.parentStore.onBlockLoadFailed(this)},e.prototype.retryLoads=function(){this.getState()===o.RowNodeBlock.STATE_FAILED&&(this.setStateWaitingToLoad(),this.rowNodeBlockLoader.checkBlockToLoad(),this.setData()),this.forEachNodeShallow((function(t){t.childStore&&t.childStore.retryLoads()}))},e.prototype.processServerResult=function(t){this.parentStore.onBlockLoaded(this,t)},e.prototype.setData=function(t,e){void 0===t&&(t=[]),void 0===e&&(e=!1),this.destroyRowNodes();for(var o=this.parentStore.getRowCount(),r=this.getId()*this.storeParams.cacheBlockSize,n=Math.min(r+this.storeParams.cacheBlockSize,o)-r,i=this.parentStore.getCachedBlockHeight(this.getId()),s=i?Math.round(i/n):void 0,a=0;a<n;a++){var l=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn,rowHeight:s});if(a<t.length){var d=t[a],c=this.prefixId(this.startRow+a);this.blockUtils.setDataIntoRowNode(l,d,c,s);var u=l.id;this.parentStore.removeDuplicateNode(u),this.nodeManager.addRowNode(l),this.allNodesMap[l.id]=l,this.blockUtils.checkOpenByDefault(l)}this.rowNodes.push(l),e&&(l.failedLoad=!0)}},e.prototype.removeDuplicateNode=function(t){var e=this.allNodesMap[t];if(e){this.blockUtils.destroyRowNode(e);var o=this.rowNodes.indexOf(e),r=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});this.rowNodes[o]=r}},e.prototype.refresh=function(){this.getState()!==o.RowNodeBlock.STATE_WAITING_TO_LOAD&&this.setStateWaitingToLoad()},e.prototype.destroyRowNodes=function(){this.blockUtils.destroyRowNodes(this.rowNodes),this.rowNodes=[],this.allNodesMap={}},e.prototype.setBeans=function(t){this.logger=t.create("ServerSideBlock")},e.prototype.getRowUsingDisplayIndex=function(t){return this.touchLastAccessed(),this.blockUtils.binarySearchForDisplayIndex(t,this.rowNodes)},e.prototype.loadFromDatasource=function(){this.cacheUtils.loadFromDatasource({startRow:this.startRow,endRow:this.startRow+this.storeParams.cacheBlockSize,parentNode:this.parentRowNode,storeParams:this.ssrmParams,successCallback:this.pageLoaded.bind(this,this.getVersion()),success:this.success.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),fail:this.pageLoadFailed.bind(this,this.getVersion())})},e.prototype.isPixelInRange=function(t){return t>=this.blockTopPx&&t<this.blockTopPx+this.blockHeightPx},e.prototype.getRowBounds=function(t){var e,r=this;return this.touchLastAccessed(),o._.find(this.rowNodes,(function(o){return null!=(e=r.blockUtils.extractRowBounds(o,t))})),e},e.prototype.getRowIndexAtPixel=function(t){var e=this;this.touchLastAccessed();var r=null;return o._.find(this.rowNodes,(function(o){return null!=(r=e.blockUtils.getIndexAtPixel(o,t))})),r},e.prototype.clearDisplayIndexes=function(){var t=this;this.displayIndexEnd=void 0,this.displayIndexStart=void 0,this.rowNodes.forEach((function(e){return t.blockUtils.clearDisplayIndex(e)}))},e.prototype.setDisplayIndexes=function(t,e){var o=this;this.displayIndexStart=t.peek(),this.blockTopPx=e.value,this.rowNodes.forEach((function(r){return o.blockUtils.setDisplayIndex(r,t,e)})),this.displayIndexEnd=t.peek(),this.blockHeightPx=e.value-this.blockTopPx},D([o.Autowired("columnModel")],e.prototype,"columnModel",void 0),D([o.Autowired("ssrmCacheUtils")],e.prototype,"cacheUtils",void 0),D([o.Autowired("ssrmBlockUtils")],e.prototype,"blockUtils",void 0),D([o.Autowired("ssrmNodeManager")],e.prototype,"nodeManager",void 0),D([o.Autowired("rowNodeBlockLoader")],e.prototype,"rowNodeBlockLoader",void 0),D([o.PostConstruct],e.prototype,"postConstruct",null),D([o.PreDestroy],e.prototype,"destroyRowNodes",null),D([k(0,o.Qualifier("loggerFactory"))],e.prototype,"setBeans",null),e}(o.RowNodeBlock),P=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),b=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},T=function(t,e){return function(o,r){e(o,r,t)}};!function(t){t[t.FOUND=0]="FOUND",t[t.CONTINUE_FIND=1]="CONTINUE_FIND",t[t.BREAK_FIND=2]="BREAK_FIND"}(e||(e={}));var B=function(t){function r(e,o,n){var i=t.call(this)||this;return i.blocks={},i.blockHeights={},i.lastRowIndexKnown=!1,i.displayIndexStart=0,i.displayIndexEnd=0,i.cacheTopPixel=0,i.info={},i.ssrmParams=e,i.storeParams=o,i.parentRowNode=n,i.rowCount=r.INITIAL_ROW_COUNT,i}return P(r,t),r.prototype.postConstruct=function(){this.defaultRowHeight=this.gridOptionsWrapper.getRowHeightAsNumber()},r.prototype.destroyAllBlocks=function(){var t=this;this.getBlocksInOrder().forEach((function(e){return t.destroyBlock(e)}))},r.prototype.setBeans=function(t){this.logger=t.create("ServerSideCache")},r.prototype.getRowCount=function(){return this.rowCount},r.prototype.isLastRowIndexKnown=function(){return this.lastRowIndexKnown},r.prototype.retryLoads=function(){this.getBlocksInOrder().forEach((function(t){return t.retryLoads()}))},r.prototype.onBlockLoadFailed=function(t){t.setData([],!0),this.fireCacheUpdatedEvent()},r.prototype.onBlockLoaded=function(t,e){if(this.logger.log("onPageLoaded: page = "+t.getId()+", lastRow = "+e.rowCount),e.storeInfo&&o._.assign(this.info,e.storeInfo),!e.rowData){o._.doOnce((function(){return console.warn('AG Grid: "params.rowData" is missing from Server-Side Row Model success() callback. Please use the "rowData" attribute. If no data is returned, set an empty list.',e)}),"InfiniteStore.noData")}var r=null!=e.rowCount&&e.rowCount>=0?e.rowCount:void 0;this.isAlive()&&(this.checkRowCount(t,r),t.setData(e.rowData),this.destroyAllBlocksPastVirtualRowCount(),this.fireCacheUpdatedEvent())},r.prototype.purgeBlocksIfNeeded=function(t){var e=this,o=this.getBlocksInOrder().filter((function(e){return e!=t}));o.sort((function(t,e){return e.getLastAccessed()-t.getLastAccessed()}));var n=this.storeParams.maxBlocksInCache>0,i=n?this.storeParams.maxBlocksInCache-1:null,s=r.MAX_EMPTY_BLOCKS_TO_KEEP-1;o.forEach((function(t,o){if(t.getState()===_.STATE_WAITING_TO_LOAD&&o>=s||!!n&&o>=i){if(t.isAnyNodeOpen())return;if(e.isBlockCurrentlyDisplayed(t))return;if(e.isBlockFocused(t))return;e.destroyBlock(t)}}))},r.prototype.isBlockFocused=function(t){var e=this.focusService.getFocusCellToUseAfterRefresh();if(!e)return!1;if(null!=e.rowPinned)return!1;var o=t.getDisplayIndexStart(),r=t.getDisplayIndexEnd();return null!=r&&null!=o&&(e.rowIndex>=o&&e.rowIndex<r)},r.prototype.isBlockCurrentlyDisplayed=function(t){var e=t.getDisplayIndexStart(),o=t.getDisplayIndexEnd()-1;return this.rowRenderer.isRangeInRenderedViewport(e,o)},r.prototype.removeDuplicateNode=function(t){this.getBlocksInOrder().forEach((function(e){return e.removeDuplicateNode(t)}))},r.prototype.checkRowCount=function(t,e){if("number"==typeof e&&e>=0)this.rowCount=e,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){var o=(t.getId()+1)*this.storeParams.cacheBlockSize+r.OVERFLOW_SIZE;this.rowCount<o&&(this.rowCount=o)}},r.prototype.forEachNodeDeep=function(t,e){void 0===e&&(e=new o.NumberSequence),this.getBlocksInOrder().forEach((function(o){return o.forEachNodeDeep(t,e)}))},r.prototype.forEachNodeDeepAfterFilterAndSort=function(t,e){void 0===e&&(e=new o.NumberSequence),this.getBlocksInOrder().forEach((function(o){return o.forEachNodeAfterFilterAndSort(t,e)}))},r.prototype.getBlocksInOrder=function(){return o._.getAllValuesInObject(this.blocks).sort((function(t,e){return t.getId()-e.getId()}))},r.prototype.destroyBlock=function(t){delete this.blocks[t.getId()],this.destroyBean(t),this.rowNodeBlockLoader.removeBlock(t)},r.prototype.fireCacheUpdatedEvent=function(){var t={type:o.Events.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(t)},r.prototype.destroyAllBlocksPastVirtualRowCount=function(){var t=this,e=[];this.getBlocksInOrder().forEach((function(o){o.getId()*t.storeParams.cacheBlockSize>=t.rowCount&&e.push(o)})),e.length>0&&e.forEach((function(e){return t.destroyBlock(e)}))},r.prototype.refreshStore=function(t){0==this.getRowCount()||t?this.resetStore():this.refreshBlocks(),this.fireCacheUpdatedEvent()},r.prototype.refreshBlocks=function(){this.getBlocksInOrder().forEach((function(t){t.refresh()})),this.lastRowIndexKnown=!1,this.rowNodeBlockLoader.checkBlockToLoad()},r.prototype.resetStore=function(){this.destroyAllBlocks(),this.lastRowIndexKnown=!1,(this.columnModel.isAutoRowHeightActive||0===this.rowCount)&&(this.rowCount=r.INITIAL_ROW_COUNT)},r.prototype.getRowNodesInRange=function(t,e){var r=[],n=-1,i=!1;o._.missing(t)&&(i=!0);var s=!1;return this.getBlocksInOrder().forEach((function(o){s||(i&&n+1!==o.getId()?s=!0:(n=o.getId(),o.forEachNodeShallow((function(o){var n=o===t||o===e;(i||n)&&r.push(o),n&&(i=!i)}))))})),s||i?[]:r},r.prototype.findBlockAndExecute=function(t,o,r){var n,i=!1,s=!1,a=null;return this.getBlocksInOrder().forEach((function(r){if(!i&&!s){var l=t(r);l==e.FOUND?(n=o(r),i=!0):l==e.CONTINUE_FIND?a=r:l==e.BREAK_FIND&&(s=!0)}})),i||(n=r(a)),n},r.prototype.getRowBounds=function(t){var o=this;return this.findBlockAndExecute((function(o){return o.isDisplayIndexInBlock(t)?e.FOUND:o.isBlockBefore(t)?e.CONTINUE_FIND:e.BREAK_FIND}),(function(e){return e.getRowBounds(t)}),(function(e){var r,n;null!==e?(r=e.getBlockTopPx()+e.getBlockHeightPx(),n=e.getDisplayIndexEnd()):(r=o.cacheTopPixel,n=o.displayIndexStart);var i=t-n;return{rowHeight:o.defaultRowHeight,rowTop:r+i*o.defaultRowHeight}}))},r.prototype.getRowIndexAtPixel=function(t){var o=this,r=this.findBlockAndExecute((function(o){return o.isPixelInRange(t)?e.FOUND:o.getBlockTopPx()<t?e.CONTINUE_FIND:e.BREAK_FIND}),(function(e){return e.getRowIndexAtPixel(t)}),(function(e){var r,n;e?(r=e.getBlockTopPx()+e.getBlockHeightPx(),n=e.getDisplayIndexEnd()):(r=o.cacheTopPixel,n=o.displayIndexStart);for(var i=o.storeParams.cacheBlockSize,s=o.defaultRowHeight*i,a=e?e.getId()+1:0,l=function(e){var n=o.getCachedBlockHeight(e),i=null!=n?n:s;return{height:i,pixelInBlock:t<=i+r}},d=l(a);!d.pixelInBlock;)r+=d.height,n+=i,d=l(++a);var c=t-r,u=d.height/i;return n+(0|Math.floor(c/u))})),n=this.getDisplayIndexEnd()-1;return r=Math.min(r,n)},r.prototype.clearDisplayIndexes=function(){this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.getBlocksInOrder().forEach((function(t){return t.clearDisplayIndexes()}))},r.prototype.setDisplayIndexes=function(t,e){var r=this;this.displayIndexStart=t.peek(),this.cacheTopPixel=e.value;var n=-1,i=this.storeParams.cacheBlockSize;this.getBlocksInOrder().forEach((function(s){var a=s.getId(),l=a-n-1,d=l*i;d>0&&t.skip(d);for(var c=1;c<=l;c++){var u=a-c;o._.exists(r.blockHeights[u])?e.value+=r.blockHeights[u]:e.value+=i*r.defaultRowHeight}n=a,s.setDisplayIndexes(t,e),r.blockHeights[a]=s.getBlockHeightPx()}));var s=(n+1)*i-1,a=this.getRowCount()-s-1;a>0&&(t.skip(a),e.value+=a*this.defaultRowHeight),this.displayIndexEnd=t.peek(),this.cacheHeightPixels=e.value-this.cacheTopPixel},r.prototype.getRowUsingDisplayIndex=function(t,r){var n=this;if(void 0===r&&(r=!1),this.isDisplayIndexInStore(t)){return this.findBlockAndExecute((function(o){return o.isDisplayIndexInBlock(t)?e.FOUND:o.isBlockBefore(t)?e.CONTINUE_FIND:e.BREAK_FIND}),(function(e){return e.getRowUsingDisplayIndex(t)}),(function(e){if(!r){var i,s,a,l=n.storeParams.cacheBlockSize;if(e){i=e.getId()+1,s=e.getDisplayIndexEnd(),a=e.getBlockHeightPx()+e.getBlockTopPx();for(;!(t>=s&&t<s+l);){s+=l;var d=n.blockHeights[i];o._.exists(d)?a+=d:a+=n.defaultRowHeight*l,i++}}else{var c=t-n.displayIndexStart;i=Math.floor(c/l),s=n.displayIndexStart+i*l,a=n.cacheTopPixel+i*l*n.defaultRowHeight}return n.logger.log("block missing, rowIndex = "+t+", creating #"+i+", displayIndexStart = "+s),n.createBlock(i,s,{value:a}).getRowUsingDisplayIndex(t)}}))}},r.prototype.getTopLevelRowDisplayedIndex=function(t){var o=this.storeParams.cacheBlockSize,r=Math.floor(t/o);return this.findBlockAndExecute((function(t){return t.getId()===r?e.FOUND:t.getId()<r?e.CONTINUE_FIND:e.BREAK_FIND}),(function(e){return e.getRowUsingLocalIndex(t).rowIndex}),(function(e){if(!e)return t;var r,n=o*(e.getId()+1)-1,i=e.getRowUsingLocalIndex(n);i.expanded&&i.childStore?r=i.childStore.getDisplayIndexEnd()-1:r=i.expanded&&i.detailNode?i.detailNode.rowIndex:i.rowIndex;return r+(t-n)}))},r.prototype.addStoreStates=function(t){t.push({type:"partial",route:this.storeUtils.createGroupKeys(this.parentRowNode),rowCount:this.rowCount,lastRowIndexKnown:this.lastRowIndexKnown,info:this.info,maxBlocksInCache:this.storeParams.maxBlocksInCache,cacheBlockSize:this.storeParams.cacheBlockSize}),this.forEachChildStoreShallow((function(e){return e.addStoreStates(t)}))},r.prototype.getCachedBlockHeight=function(t){return this.blockHeights[t]},r.prototype.createBlock=function(t,e,r){var n=this.createBean(new _(t,this.parentRowNode,this.ssrmParams,this.storeParams,this));return n.setDisplayIndexes(new o.NumberSequence(e),r),this.blocks[n.getId()]=n,this.purgeBlocksIfNeeded(n),this.rowNodeBlockLoader.addBlock(n),n},r.prototype.getDisplayIndexEnd=function(){return this.displayIndexEnd},r.prototype.isDisplayIndexInStore=function(t){return 0!==this.getRowCount()&&(t>=this.displayIndexStart&&t<this.displayIndexEnd)},r.prototype.applyTransaction=function(t){return{status:o.ServerSideTransactionResultStatus.StoreWrongType}},r.prototype.getChildStore=function(t){var e=this;return this.storeUtils.getChildStore(t,this,(function(t){var r=null;return e.getBlocksInOrder().forEach((function(e){e.forEachNodeShallow((function(e){e.key===t&&(r=e)}),new o.NumberSequence)})),r}))},r.prototype.isPixelInRange=function(t){return 0!==this.getRowCount()&&(t>=this.cacheTopPixel&&t<this.cacheTopPixel+this.cacheHeightPixels)},r.prototype.refreshAfterFilter=function(t){this.resetStore()},r.prototype.refreshAfterSort=function(t){this.storeUtils.isServerRefreshNeeded(this.parentRowNode,this.ssrmParams.rowGroupCols,t)?this.resetStore():this.forEachChildStoreShallow((function(e){return e.refreshAfterSort(t)}))},r.prototype.forEachChildStoreShallow=function(t){this.getBlocksInOrder().forEach((function(e){if(e.isGroupLevel()){e.forEachNodeShallow((function(e){var o=e.childStore;o&&t(o)}),new o.NumberSequence)}}))},r.MAX_EMPTY_BLOCKS_TO_KEEP=2,r.INITIAL_ROW_COUNT=1,r.OVERFLOW_SIZE=1,b([o.Autowired("rowRenderer")],r.prototype,"rowRenderer",void 0),b([o.Autowired("rowNodeBlockLoader")],r.prototype,"rowNodeBlockLoader",void 0),b([o.Autowired("ssrmCacheUtils")],r.prototype,"storeUtils",void 0),b([o.Autowired("focusService")],r.prototype,"focusService",void 0),b([o.Autowired("columnModel")],r.prototype,"columnModel",void 0),b([o.PostConstruct],r.prototype,"postConstruct",null),b([o.PreDestroy],r.prototype,"destroyAllBlocks",null),b([T(0,o.Qualifier("loggerFactory"))],r.prototype,"setBeans",null),r}(o.BeanStub),M=function(){var t=function(e,o){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(e,o)};return function(e,o){function r(){this.constructor=e}t(e,o),e.prototype=null===o?Object.create(o):(r.prototype=o.prototype,new r)}}(),L=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},U=function(t){function e(e,r,n){var i=t.call(this,0)||this;return i.nodeIdSequence=new o.NumberSequence,i.info={},i.ssrmParams=e,i.parentRowNode=n,i.level=n.level+1,i.groupLevel=e.rowGroupCols?i.level<e.rowGroupCols.length:void 0,i.leafGroup=!!e.rowGroupCols&&i.level===e.rowGroupCols.length-1,i}return M(e,t),e.prototype.postConstruct=function(){var t=this;if(this.usingTreeData=this.gridOptionsWrapper.isTreeData(),this.nodeIdPrefix=this.blockUtils.createNodeIdPrefix(this.parentRowNode),!this.usingTreeData&&this.groupLevel){var e=this.ssrmParams.rowGroupCols[this.level];this.groupField=e.field,this.rowGroupColumn=this.columnModel.getRowGroupColumns()[this.level]}this.initialiseRowNodes(),this.rowNodeBlockLoader.addBlock(this),this.addDestroyFunc((function(){return t.rowNodeBlockLoader.removeBlock(t)}))},e.prototype.destroyRowNodes=function(){this.blockUtils.destroyRowNodes(this.allRowNodes),this.allRowNodes=[],this.nodesAfterSort=[],this.nodesAfterFilter=[],this.allNodesMap={}},e.prototype.initialiseRowNodes=function(t,e){void 0===t&&(t=1),void 0===e&&(e=!1),this.destroyRowNodes();for(var o=0;o<t;o++){var r=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});e&&(r.failedLoad=!0),this.allRowNodes.push(r),this.nodesAfterFilter.push(r),this.nodesAfterSort.push(r)}},e.prototype.getBlockStateJson=function(){return{id:this.nodeIdPrefix?this.nodeIdPrefix:"",state:this.getState()}},e.prototype.loadFromDatasource=function(){this.storeUtils.loadFromDatasource({startRow:void 0,endRow:void 0,parentNode:this.parentRowNode,storeParams:this.ssrmParams,successCallback:this.pageLoaded.bind(this,this.getVersion()),success:this.success.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),fail:this.pageLoadFailed.bind(this,this.getVersion())})},e.prototype.getStartRow=function(){return 0},e.prototype.getEndRow=function(){return this.nodesAfterSort.length},e.prototype.createDataNode=function(t,e){var r=this.blockUtils.createRowNode({field:this.groupField,group:this.groupLevel,leafGroup:this.leafGroup,level:this.level,parent:this.parentRowNode,rowGroupColumn:this.rowGroupColumn});null!=e?o._.insertIntoArray(this.allRowNodes,r,e):this.allRowNodes.push(r);var n=this.prefixId(this.nodeIdSequence.next());return this.blockUtils.setDataIntoRowNode(r,t,n,void 0),this.nodeManager.addRowNode(r),this.blockUtils.checkOpenByDefault(r),this.allNodesMap[r.id]=r,r},e.prototype.prefixId=function(t){return this.nodeIdPrefix?this.nodeIdPrefix+"-"+t:t.toString()},e.prototype.processServerFail=function(){this.initialiseRowNodes(1,!0),this.fireStoreUpdatedEvent(),this.flushAsyncTransactions()},e.prototype.processServerResult=function(t){if(this.isAlive()){t.storeInfo&&o._.assign(this.info,t.storeInfo);var e=this.allRowNodes.length>0?this.allNodesMap:void 0;if(this.allRowNodes=[],this.nodesAfterSort=[],this.nodesAfterFilter=[],this.allNodesMap={},!t.rowData){o._.doOnce((function(){return console.warn('AG Grid: "params.data" is missing from Server-Side Row Model success() callback. Please use the "data" attribute. If no data is returned, set an empty list.',t)}),"FullStore.noData")}this.createOrRecycleNodes(e,t.rowData),e&&this.blockUtils.destroyRowNodes(o._.getAllValuesInObject(e)),this.filterAndSortNodes(),this.fireStoreUpdatedEvent(),this.flushAsyncTransactions()}},e.prototype.createOrRecycleNodes=function(t,e){var o=this;if(e){e.forEach((function(e){var r=function(e){if(t){var r=o.gridOptionsWrapper.getRowNodeIdFunc();if(r){var n=r(e),i=t[n];if(i)return delete t[n],i}}}(e);r?function(t,e){o.allNodesMap[t.id]=t,t.updateData(e),o.allRowNodes.push(t)}(r,e):o.createDataNode(e)}))}},e.prototype.flushAsyncTransactions=function(){var t=this;window.setTimeout((function(){return t.transactionManager.flushAsyncTransactions()}),0)},e.prototype.filterAndSortNodes=function(){this.filterRowNodes(),this.sortRowNodes()},e.prototype.sortRowNodes=function(){var t=this.sortController.getSortOptions(),e=!t||0==t.length,o=this.gridOptionsWrapper.isServerSideSortingAlwaysResets();this.nodesAfterSort=e||o?this.nodesAfterFilter:this.rowNodeSorter.doFullSort(this.nodesAfterFilter,t)},e.prototype.filterRowNodes=function(){var t=this,e=this.gridOptionsWrapper.isServerSideFilteringAlwaysResets(),o=this.groupLevel;this.nodesAfterFilter=e||o?this.allRowNodes:this.allRowNodes.filter((function(e){return t.filterManager.doesRowPassFilter({rowNode:e})}))},e.prototype.clearDisplayIndexes=function(){var t=this;this.displayIndexStart=void 0,this.displayIndexEnd=void 0,this.allRowNodes.forEach((function(e){return t.blockUtils.clearDisplayIndex(e)}))},e.prototype.getDisplayIndexEnd=function(){return this.displayIndexEnd},e.prototype.isDisplayIndexInStore=function(t){return 0!==this.getRowCount()&&(t>=this.displayIndexStart&&t<this.displayIndexEnd)},e.prototype.setDisplayIndexes=function(t,e){var o=this;this.displayIndexStart=t.peek(),this.topPx=e.value;var r={};this.nodesAfterSort.forEach((function(n){o.blockUtils.setDisplayIndex(n,t,e),r[n.id]=!0})),this.allRowNodes.forEach((function(t){r[t.id]||o.blockUtils.clearDisplayIndex(t)})),this.displayIndexEnd=t.peek(),this.heightPx=e.value-this.topPx},e.prototype.forEachNodeDeep=function(t,e){void 0===e&&(e=new o.NumberSequence),this.allRowNodes.forEach((function(o){t(o,e.next());var r=o.childStore;r&&r.forEachNodeDeep(t,e)}))},e.prototype.forEachNodeDeepAfterFilterAndSort=function(t,e){void 0===e&&(e=new o.NumberSequence),this.nodesAfterSort.forEach((function(o){t(o,e.next());var r=o.childStore;r&&r.forEachNodeDeepAfterFilterAndSort(t,e)}))},e.prototype.getRowUsingDisplayIndex=function(t){if(this.isDisplayIndexInStore(t))return this.blockUtils.binarySearchForDisplayIndex(t,this.nodesAfterSort)},e.prototype.getRowBounds=function(t){for(var e=0;e<this.nodesAfterSort.length;e++){var o=this.nodesAfterSort[e],r=this.blockUtils.extractRowBounds(o,t);if(r)return r}return null},e.prototype.isPixelInRange=function(t){return t>=this.topPx&&t<this.topPx+this.heightPx},e.prototype.getRowIndexAtPixel=function(t){var e=this;if(t<=this.topPx)return this.nodesAfterSort[0].rowIndex;if(t>=this.topPx+this.heightPx){var o=this.nodesAfterSort[this.nodesAfterSort.length-1],r=o.rowTop+o.rowHeight;if(t>=r&&o.expanded){if(o.childStore&&o.childStore.getRowCount()>0)return o.childStore.getRowIndexAtPixel(t);if(o.detailNode)return o.detailNode.rowIndex}return o.rowIndex}var n=null;return this.nodesAfterSort.forEach((function(o){var r=e.blockUtils.getIndexAtPixel(o,t);null!=r&&(n=r)})),null==n?this.displayIndexEnd-1:n},e.prototype.getChildStore=function(t){var e=this;return this.storeUtils.getChildStore(t,this,(function(t){return o._.find(e.allRowNodes,(function(e){return e.key===t}))}))},e.prototype.forEachChildStoreShallow=function(t){this.allRowNodes.forEach((function(e){var o=e.childStore;o&&t(o)}))},e.prototype.refreshAfterFilter=function(t){t.alwaysReset||this.gridOptionsWrapper.isTreeData()?this.refreshStore(!0):(this.filterAndSortNodes(),this.forEachChildStoreShallow((function(e){return e.refreshAfterFilter(t)})))},e.prototype.refreshAfterSort=function(t){t.alwaysReset?this.refreshStore(!0):(this.sortRowNodes(),this.forEachChildStoreShallow((function(e){return e.refreshAfterSort(t)})))},e.prototype.applyTransaction=function(t){switch(this.getState()){case o.RowNodeBlock.STATE_FAILED:return{status:o.ServerSideTransactionResultStatus.StoreLoadingFailed};case o.RowNodeBlock.STATE_LOADING:return{status:o.ServerSideTransactionResultStatus.StoreLoading};case o.RowNodeBlock.STATE_WAITING_TO_LOAD:return{status:o.ServerSideTransactionResultStatus.StoreWaitingToLoad}}var e=this.gridOptionsWrapper.getIsApplyServerSideTransactionFunc();if(e&&!e({transaction:t,parentNode:this.parentRowNode,storeInfo:this.info}))return{status:o.ServerSideTransactionResultStatus.Cancelled};var r={status:o.ServerSideTransactionResultStatus.Applied,remove:[],update:[],add:[]},n=[];return this.executeAdd(t,r),this.executeRemove(t,r,n),this.executeUpdate(t,r,n),this.filterAndSortNodes(),this.updateSelection(n),r},e.prototype.updateSelection=function(t){if(t.length>0){t.forEach((function(t){t.setSelected(!1,!1,!0)}));var e={type:o.Events.EVENT_SELECTION_CHANGED,api:this.gridOptionsWrapper.getApi(),columnApi:this.gridOptionsWrapper.getColumnApi()};this.eventService.dispatchEvent(e)}},e.prototype.executeAdd=function(t,e){var r=this,n=t.add,i=t.addIndex;o._.missingOrEmpty(n)||("number"==typeof i&&i>=0?n.reverse().forEach((function(t){var o=r.createDataNode(t,i);e.add.push(o)})):n.forEach((function(t){var o=r.createDataNode(t);e.add.push(o)})))},e.prototype.executeRemove=function(t,e,o){var r=this,n=t.remove;if(null!=n){var i={};n.forEach((function(t){var n=r.lookupRowNode(t);n&&(n.isSelected()&&o.push(n),n.clearRowTopAndRowIndex(),i[n.id]=!0,delete r.allNodesMap[n.id],e.remove.push(n),r.nodeManager.removeNode(n))})),this.allRowNodes=this.allRowNodes.filter((function(t){return!i[t.id]}))}},e.prototype.executeUpdate=function(t,e,o){var r=this,n=t.update;null!=n&&n.forEach((function(t){var n=r.lookupRowNode(t);n&&(n.updateData(t),!n.selectable&&n.isSelected()&&o.push(n),e.update.push(n))}))},e.prototype.lookupRowNode=function(t){var e,r=this.gridOptionsWrapper.getRowNodeIdFunc();if(o._.exists(r)){var n=r(t);if(!(e=this.allNodesMap[n]))return console.error("AG Grid: could not find row id="+n+", data item was not found for this id"),null}else if(!(e=o._.find(this.allRowNodes,(function(e){return e.data===t}))))return console.error("AG Grid: could not find data item as object was not found",t),null;return e},e.prototype.addStoreStates=function(t){t.push({type:"full",route:this.storeUtils.createGroupKeys(this.parentRowNode),rowCount:this.allRowNodes.length,info:this.info}),this.forEachChildStoreShallow((function(e){return e.addStoreStates(t)}))},e.prototype.refreshStore=function(t){if(t){var e=this.nodesAfterSort?this.nodesAfterSort.length:1;this.initialiseRowNodes(e)}this.scheduleLoad(),this.fireStoreUpdatedEvent()},e.prototype.retryLoads=function(){this.getState()===o.RowNodeBlock.STATE_FAILED&&(this.initialiseRowNodes(1),this.scheduleLoad()),this.forEachChildStoreShallow((function(t){return t.retryLoads()}))},e.prototype.scheduleLoad=function(){this.setStateWaitingToLoad(),this.rowNodeBlockLoader.checkBlockToLoad()},e.prototype.fireStoreUpdatedEvent=function(){var t={type:o.Events.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(t)},e.prototype.getRowCount=function(){return this.nodesAfterSort.length},e.prototype.getTopLevelRowDisplayedIndex=function(t){return this.nodesAfterSort[t].rowIndex},e.prototype.isLastRowIndexKnown=function(){return this.getState()==o.RowNodeBlock.STATE_LOADED},e.prototype.getRowNodesInRange=function(t,e){var r=[],n=!1;return o._.missing(t)&&(n=!0),this.nodesAfterSort.forEach((function(o){var i=o===t||o===e;(n||i)&&r.push(o),i&&(n=!n)})),n?[]:r},L([o.Autowired("ssrmCacheUtils")],e.prototype,"storeUtils",void 0),L([o.Autowired("ssrmBlockUtils")],e.prototype,"blockUtils",void 0),L([o.Autowired("columnModel")],e.prototype,"columnModel",void 0),L([o.Autowired("rowNodeBlockLoader")],e.prototype,"rowNodeBlockLoader",void 0),L([o.Autowired("rowNodeSorter")],e.prototype,"rowNodeSorter",void 0),L([o.Autowired("sortController")],e.prototype,"sortController",void 0),L([o.Autowired("ssrmNodeManager")],e.prototype,"nodeManager",void 0),L([o.Autowired("filterManager")],e.prototype,"filterManager",void 0),L([o.Autowired("ssrmTransactionManager")],e.prototype,"transactionManager",void 0),L([o.PostConstruct],e.prototype,"postConstruct",null),L([o.PreDestroy],e.prototype,"destroyRowNodes",null),e}(o.RowNodeBlock),F=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},G=function(){function t(){}return t.prototype.createStore=function(t,e){var o=this.getStoreParams(t,e);return new("partial"===o.storeType?B:U)(t,o,e)},t.prototype.getStoreParams=function(t,e){var o=this.getLevelSpecificParams(e),r=this.getStoreType(o);return{storeType:r,cacheBlockSize:this.getBlockSize(r,o),maxBlocksInCache:this.getMaxBlocksInCache(r,t,o)}},t.prototype.getMaxBlocksInCache=function(t,e,r){if("full"!=t){var n=r&&null!=r.maxBlocksInCache?r.maxBlocksInCache:this.gridOptionsWrapper.getMaxBlocksInCache();if(null!=n&&n>=0)if(e.dynamicRowHeight){o._.doOnce((function(){return console.warn("AG Grid: Server Side Row Model does not support Dynamic Row Height and Cache Purging. Either a) remove getRowHeight() callback or b) remove maxBlocksInCache property. Purging has been disabled.")}),"storeFactory.maxBlocksInCache.dynamicRowHeight")}else{if(!this.columnModel.isAutoRowHeightActive())return n;o._.doOnce((function(){return console.warn("AG Grid: Server Side Row Model does not support Auto Row Height and Cache Purging. Either a) remove colDef.autoHeight or b) remove maxBlocksInCache property. Purging has been disabled.")}),"storeFactory.maxBlocksInCache.autoRowHeightActive")}}},t.prototype.getBlockSize=function(t,e){if("full"!=t){var o=e&&null!=e.cacheBlockSize?e.cacheBlockSize:this.gridOptionsWrapper.getCacheBlockSize();return null!=o&&o>0?o:100}},t.prototype.getLevelSpecificParams=function(t){var e=this.gridOptionsWrapper.getServerSideStoreParamsFunc();if(e)return e({level:t.level+1,parentRowNode:t.level>=0?t:void 0,rowGroupColumns:this.columnModel.getRowGroupColumns(),pivotColumns:this.columnModel.getPivotColumns(),pivotMode:this.columnModel.isPivotMode()})},t.prototype.getStoreType=function(t){var e=t&&null!=t.storeType?t.storeType:this.gridOptionsWrapper.getServerSideStoreType();switch(e){case"partial":case"full":return e;case null:case void 0:return"full";default:var o=["full","partial"].join(", ");return console.warn("AG Grid: invalid Server Side Store Type "+e+", valid types are ["+o+"]"),"partial"}},F([o.Autowired("gridOptionsWrapper")],t.prototype,"gridOptionsWrapper",void 0),F([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),t=F([o.Bean("ssrmStoreFactory")],t)}(),j=function(t,e,o,r){var n,i=arguments.length,s=i<3?e:null===r?r=Object.getOwnPropertyDescriptor(e,o):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(t,e,o,r);else for(var a=t.length-1;a>=0;a--)(n=t[a])&&(s=(i<3?n(s):i>3?n(e,o,s):n(e,o))||s);return i>3&&s&&Object.defineProperty(e,o,s),s},W=function(){function t(){}return t.prototype.isSortingWithValueColumn=function(t){for(var e=this.columnModel.getValueColumns().map((function(t){return t.getColId()})),o=0;o<t.length;o++)if(e.indexOf(t[o])>-1)return!0;return!1},t.prototype.isSortingWithSecondaryColumn=function(t){if(!this.columnModel.getSecondaryColumns())return!1;for(var e=this.columnModel.getSecondaryColumns().map((function(t){return t.getColId()})),o=0;o<t.length;o++)if(e.indexOf(t[o])>-1)return!0;return!1},j([o.Autowired("columnModel")],t.prototype,"columnModel",void 0),t=j([o.Bean("ssrmListenerUtils")],t)}(),H={moduleName:o.ModuleNames.ServerSideRowModelModule,rowModels:{serverSide:a},beans:[N,x,c,h,y,w,E,G,W],dependantModules:[r.EnterpriseCoreModule]};exports.ServerSideRowModelModule=H; |
{ | ||
"name": "@ag-grid-enterprise/server-side-row-model", | ||
"version": "26.2.0", | ||
"version": "26.2.1", | ||
"description": "Advanced Data Grid / Data Table supporting Javascript / React / AngularJS / Web Components", | ||
@@ -54,2 +54,2 @@ "main": "./dist/cjs/main.js", | ||
} | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4016902
62801
0