{"version":3,"sources":["node_modules/@ag-grid-community/core/dist/esm/es6/utils/generic.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/columns/columnKeyCreator.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/object.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/function.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/modules/moduleNames.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/modules/moduleRegistry.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/context/context.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/eventService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/entities/column.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/entities/providedColumnGroup.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/entities/defaultColumnTypes.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/event.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/array.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/context/beanStub.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/columns/columnFactory.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/entities/columnGroup.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/eventKeys.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/columns/groupInstanceIdCreator.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/columns/autoGroupColService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/string.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/map.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/components/colDefUtil.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/propertyKeys.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/components/componentUtil.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/fuzzyMatch.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridOptionsValidator.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/columns/columnModel.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/columns/columnUtils.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/columns/displayedGroupCreator.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/components/agStackComponentsRegistry.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/aria.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/browser.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/date.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/number.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/dom.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/icon.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/keyboard.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/constants/keyCode.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/mouse.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/rowNode.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/set.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/utils.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/numberSequence.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/promise.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/customTooltipFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cssClassManager.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/component.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/componentAnnotations.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/floating/provided/readOnlyFloatingFilter.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/provided/date/dateCompWrapper.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/provided/optionsFactory.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/filterLocaleText.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/managedFocusFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/features/positionableFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/provided/providedFilter.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agAbstractLabel.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agAbstractField.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agPickerField.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agList.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agSelect.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agAbstractInputField.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agCheckbox.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agRadioButton.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/provided/simpleFilter.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/provided/scalarFilter.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/provided/date/dateFilter.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/floating/provided/simpleFloatingFilter.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/provided/date/dateFloatingFilter.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/provided/date/defaultDateComponent.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agInputTextField.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agInputNumberField.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/provided/number/numberFilter.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/provided/text/textFilter.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/floating/provided/textInputFloatingFilter.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/provided/number/numberFloatingFilter.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/provided/text/textFloatingFilter.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/touchListener.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/column/sortIndicatorComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/column/headerComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/columnGroup/headerGroupComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/popupComponent.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellEditors/largeTextCellEditor.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellEditors/selectCellEditor.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellEditors/simpleCellEditor.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellEditors/textCellEditor.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellRenderers/animateShowChangeCellRenderer.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellRenderers/animateSlideCellRenderer.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/entities/rowNode.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/checkboxSelectionComponent.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/dragAndDrop/dragAndDropService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/row/rowDragComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellRenderers/groupCellRendererCtrl.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellRenderers/groupCellRenderer.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellRenderers/loadingCellRenderer.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/overlays/loadingOverlayComponent.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/overlays/noRowsOverlayComponent.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/tooltipComponent.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellEditors/numberCellEditor.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellEditors/dateCellEditor.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellEditors/dateStringCellEditor.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellRenderers/checkboxCellRenderer.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellEditors/checkboxCellEditor.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/components/framework/userComponentRegistry.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/components/framework/componentTypes.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/floating/floatingFilterMapper.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/components/framework/userComponentFactory.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/interfaces/iExcelCreator.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/dragAndDrop/dragService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/interfaces/iRowNode.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/interfaces/iClientSideRowModel.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridApi.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/filter/filterManager.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/abstractCell/abstractHeaderCellComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/floatingFilter/headerFilterCellComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/styling/layoutFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/gridBodyScrollFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/autoScrollService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/rowDragFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/gridBodyCtrl.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/interfaces/IRangeService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cell/cellRangeFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cell/cellPositionFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cell/cellCustomStyleFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/tooltipFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/beans.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cell/cellMouseListenerFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cell/cellKeyboardListenerFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/dndSourceComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cell/cellCtrl.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/row/rowCtrl.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/rowContainer/rowContainerEventsFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/viewportSizeFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/rowContainer/setPinnedLeftWidthFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/rowContainer/setPinnedRightWidthFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/rowContainer/setHeightFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/rowContainer/dragListenerFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/centerWidthFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/rowContainer/rowContainerCtrl.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/gridBodyComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/scrollVisibleService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/mouseEventService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/navigationService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cellEditors/popupEditorWrapper.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/cell/cellComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/row/rowComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/rowContainer/rowContainerComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/columnDrag/bodyDropPivotTarget.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/columnDrag/moveColumnFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/columnDrag/bodyDropTarget.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/cssClassApplier.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/column/headerCellComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/columnGroup/headerGroupCellComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/row/headerRowComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/abstractCell/abstractHeaderCellCtrl.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/features/setLeftFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/hoverFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/floatingFilter/headerFilterCellCtrl.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/column/resizeFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/column/selectAllFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/tabGuardCtrl.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/focusService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/column/headerCellCtrl.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/columnGroup/groupResizeFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/columnGroup/groupWidthFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/columnGroup/headerGroupCellCtrl.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/row/headerRowCtrl.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/rowContainer/headerRowContainerCtrl.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/rowContainer/headerRowContainerComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/common/headerNavigationService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/gridHeaderCtrl.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/gridHeaderComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/common/horizontalResizeService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/cells/column/standardMenu.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/layout/tabbedLayout.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/misc/resizeObserverService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/misc/animationFrameService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/autoWidthCalculator.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/features/stickyRowFeature.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/rowRenderer.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/valueFormatterService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/pinnedRowModel/pinnedRowModel.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/utils/changedPath.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rowNodeCache/rowNodeBlock.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rowNodeCache/rowNodeBlockLoader.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/pagination/paginationProxy.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/styling/stylingService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agToggleButton.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agInputTextArea.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agInputDateField.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agInputRange.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agRichSelectRow.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/tabGuardComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/virtualList.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agRichSelect.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agSlider.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agGroupComponent.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agMenuList.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agMenuPanel.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agMenuItemComponent.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agPanel.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agDialog.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/popupService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agAutocompleteRow.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agAutocompleteList.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/widgets/agAutocomplete.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/vanillaFrameworkOverrides.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/cellNavigationService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/alignedGridsService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/selectionService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/columns/columnApi.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/valueService/valueService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/valueService/expressionService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/templateService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/logger.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridComp/gridCtrl.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridComp/gridComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/sortController.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/columnHoverService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/columnAnimationService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/pagination/paginationAutoPageSizeService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/valueService/valueCache.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/valueService/changeDetectionService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/components/framework/agComponentUtils.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/components/framework/componentMetadataProvider.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/environment.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/rowContainerHeightService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rowNodes/selectableService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/pagination/paginationComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/overlays/overlayWrapperComponent.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/entities/rowPositionUtils.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/entities/cellPositionUtils.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/undoRedo/undoRedoStack.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/undoRedo/undoRedoService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/headerRendering/common/headerPosition.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/columns/columnDefFactory.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rendering/row/rowCssClassCalculator.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/rowNodes/rowNodeSorter.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/ctrlsService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/ctrlsFactory.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/abstractFakeScrollComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/fakeHScrollComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/pinnedWidthService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/entities/rowNodeEventThrottle.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridOptionsService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/localeService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/gridBodyComp/fakeVScrollComp.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/columns/dataTypeService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/valueService/valueParserService.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/grid.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/components/framework/frameworkComponentWrapper.mjs","node_modules/@ag-grid-community/core/dist/esm/es6/main.mjs","node_modules/@ag-grid-enterprise/core/dist/esm/es6/license/shared/md5.mjs","node_modules/@ag-grid-enterprise/core/dist/esm/es6/license/shared/licenseManager.mjs","node_modules/@ag-grid-enterprise/core/dist/esm/es6/license/gridLicenseManager.mjs","node_modules/@ag-grid-enterprise/core/dist/esm/es6/license/watermark.mjs","node_modules/@ag-grid-enterprise/core/dist/esm/es6/version.mjs","node_modules/@ag-grid-enterprise/core/dist/esm/es6/agGridEnterpriseModule.mjs"],"sourcesContent":["/**\n * If value is undefined, null or blank, returns null, otherwise returns the value\n * @param {T} value\n * @returns {T | null}\n */\nexport function makeNull(value) {\n if (value == null || value === '') {\n return null;\n }\n return value;\n}\nexport function exists(value, allowEmptyString = false) {\n return value != null && (value !== '' || allowEmptyString);\n}\nexport function missing(value) {\n return !exists(value);\n}\nexport function missingOrEmpty(value) {\n return value == null || value.length === 0;\n}\nexport function toStringOrNull(value) {\n return value != null && typeof value.toString === 'function' ? value.toString() : null;\n}\n// for parsing html attributes, where we want empty strings and missing attributes to be undefined\nexport function attrToNumber(value) {\n if (value === undefined) {\n // undefined or empty means ignore the value\n return;\n }\n if (value === null || value === '') {\n // null or blank means clear\n return null;\n }\n if (typeof value === 'number') {\n return isNaN(value) ? undefined : value;\n }\n const valueParsed = parseInt(value, 10);\n return isNaN(valueParsed) ? undefined : valueParsed;\n}\n// for parsing html attributes, where we want empty strings and missing attributes to be undefined\nexport function attrToBoolean(value) {\n if (value === undefined) {\n // undefined or empty means ignore the value\n return;\n }\n if (value === null || value === '') {\n // null means clear\n return false;\n }\n if (typeof value === 'boolean') {\n // if simple boolean, return the boolean\n return value;\n }\n // if equal to the string 'true' (ignoring case) then return true\n return /true/i.test(value);\n}\n// for parsing html attributes, where we want empty strings and missing attributes to be undefined\nexport function attrToString(value) {\n if (value == null || value === '') {\n return;\n }\n return value;\n}\n/** @deprecated */\nexport function referenceCompare(left, right) {\n if (left == null && right == null) {\n return true;\n }\n if (left == null && right != null) {\n return false;\n }\n if (left != null && right == null) {\n return false;\n }\n return left === right;\n}\nexport function jsonEquals(val1, val2) {\n const val1Json = val1 ? JSON.stringify(val1) : null;\n const val2Json = val2 ? JSON.stringify(val2) : null;\n return val1Json === val2Json;\n}\nexport function defaultComparator(valueA, valueB, accentedCompare = false) {\n const valueAMissing = valueA == null;\n const valueBMissing = valueB == null;\n // this is for aggregations sum and avg, where the result can be a number that is wrapped.\n // if we didn't do this, then the toString() value would be used, which would result in\n // the strings getting used instead of the numbers.\n if (valueA && valueA.toNumber) {\n valueA = valueA.toNumber();\n }\n if (valueB && valueB.toNumber) {\n valueB = valueB.toNumber();\n }\n if (valueAMissing && valueBMissing) {\n return 0;\n }\n if (valueAMissing) {\n return -1;\n }\n if (valueBMissing) {\n return 1;\n }\n function doQuickCompare(a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n }\n if (typeof valueA !== 'string') {\n return doQuickCompare(valueA, valueB);\n }\n if (!accentedCompare) {\n return doQuickCompare(valueA, valueB);\n }\n try {\n // using local compare also allows chinese comparisons\n return valueA.localeCompare(valueB);\n } catch (e) {\n // if something wrong with localeCompare, eg not supported\n // by browser, then just continue with the quick one\n return doQuickCompare(valueA, valueB);\n }\n}\nexport function values(object) {\n if (object instanceof Set || object instanceof Map) {\n const arr = [];\n object.forEach(value => arr.push(value));\n return arr;\n }\n return Object.values(object);\n}","// class returns a unique id to use for the column. it checks the existing columns, and if the requested\n// id is already taken, it will start appending numbers until it gets a unique id.\n// eg, if the col field is 'name', it will try ids: {name, name_1, name_2...}\n// if no field or id provided in the col, it will try the ids of natural numbers\nimport { toStringOrNull } from \"../utils/generic.mjs\";\nexport class ColumnKeyCreator {\n constructor() {\n this.existingKeys = {};\n }\n addExistingKeys(keys) {\n for (let i = 0; i < keys.length; i++) {\n this.existingKeys[keys[i]] = true;\n }\n }\n getUniqueKey(colId, colField) {\n // in case user passed in number for colId, convert to string\n colId = toStringOrNull(colId);\n let count = 0;\n while (true) {\n let idToTry;\n if (colId) {\n idToTry = colId;\n if (count !== 0) {\n idToTry += '_' + count;\n }\n } else if (colField) {\n idToTry = colField;\n if (count !== 0) {\n idToTry += '_' + count;\n }\n } else {\n // no point in stringing this, object treats it the same anyway.\n idToTry = count;\n }\n if (!this.existingKeys[idToTry]) {\n this.existingKeys[idToTry] = true;\n return String(idToTry);\n }\n count++;\n }\n }\n}","import { missing, exists } from './generic.mjs';\nexport function iterateObject(object, callback) {\n if (object == null) {\n return;\n }\n if (Array.isArray(object)) {\n for (let i = 0; i < object.length; i++) {\n callback(i.toString(), object[i]);\n }\n return;\n }\n for (const [key, value] of Object.entries(object)) {\n callback(key, value);\n }\n}\nexport function cloneObject(object) {\n const copy = {};\n const keys = Object.keys(object);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const value = object[key];\n copy[key] = value;\n }\n return copy;\n}\nexport function deepCloneObject(object) {\n return JSON.parse(JSON.stringify(object));\n}\n// returns copy of an object, doing a deep clone of any objects with that object.\n// this is used for eg creating copies of Column Definitions, where we want to\n// deep copy all objects, but do not want to deep copy functions (eg when user provides\n// a function or class for colDef.cellRenderer)\nexport function deepCloneDefinition(object, keysToSkip) {\n if (!object) {\n return;\n }\n const obj = object;\n const res = {};\n Object.keys(obj).forEach(key => {\n if (keysToSkip && keysToSkip.indexOf(key) >= 0) {\n return;\n }\n const value = obj[key];\n // 'simple object' means a bunch of key/value pairs, eg {filter: 'myFilter'}. it does\n // NOT include the following:\n // 1) arrays\n // 2) functions or classes (eg ColumnAPI instance)\n const sourceIsSimpleObject = isNonNullObject(value) && value.constructor === Object;\n if (sourceIsSimpleObject) {\n res[key] = deepCloneDefinition(value);\n } else {\n res[key] = value;\n }\n });\n return res;\n}\nexport function getProperty(object, key) {\n return object[key];\n}\nexport function setProperty(object, key, value) {\n object[key] = value;\n}\n/**\n * Will copy the specified properties from `source` into the equivalent properties on `target`, ignoring properties with\n * a value of `undefined`.\n */\nexport function copyPropertiesIfPresent(source, target, ...properties) {\n properties.forEach(p => copyPropertyIfPresent(source, target, p));\n}\n/**\n * Will copy the specified property from `source` into the equivalent property on `target`, unless the property has a\n * value of `undefined`. If a transformation is provided, it will be applied to the value before being set on `target`.\n */\nexport function copyPropertyIfPresent(source, target, property, transform) {\n const value = getProperty(source, property);\n if (value !== undefined) {\n setProperty(target, property, transform ? transform(value) : value);\n }\n}\nexport function getAllKeysInObjects(objects) {\n const allValues = {};\n objects.filter(obj => obj != null).forEach(obj => {\n Object.keys(obj).forEach(key => allValues[key] = null);\n });\n return Object.keys(allValues);\n}\nexport function getAllValuesInObject(obj) {\n if (!obj) {\n return [];\n }\n const anyObject = Object;\n if (typeof anyObject.values === 'function') {\n return anyObject.values(obj);\n }\n const ret = [];\n for (const key in obj) {\n if (obj.hasOwnProperty(key) && obj.propertyIsEnumerable(key)) {\n ret.push(obj[key]);\n }\n }\n return ret;\n}\nexport function mergeDeep(dest, source, copyUndefined = true, makeCopyOfSimpleObjects = false) {\n if (!exists(source)) {\n return;\n }\n iterateObject(source, (key, sourceValue) => {\n let destValue = dest[key];\n if (destValue === sourceValue) {\n return;\n }\n // when creating params, we don't want to just copy objects over. otherwise merging ColDefs (eg DefaultColDef\n // and Column Types) would result in params getting shared between objects.\n // by putting an empty value into destValue first, it means we end up copying over values from\n // the source object, rather than just copying in the source object in it's entirety.\n if (makeCopyOfSimpleObjects) {\n const objectIsDueToBeCopied = destValue == null && sourceValue != null;\n if (objectIsDueToBeCopied) {\n // 'simple object' means a bunch of key/value pairs, eg {filter: 'myFilter'}, as opposed\n // to a Class instance (such as ColumnAPI instance).\n const sourceIsSimpleObject = typeof sourceValue === 'object' && sourceValue.constructor === Object;\n const dontCopy = sourceIsSimpleObject;\n if (dontCopy) {\n destValue = {};\n dest[key] = destValue;\n }\n }\n }\n if (isNonNullObject(sourceValue) && isNonNullObject(destValue) && !Array.isArray(destValue)) {\n mergeDeep(destValue, sourceValue, copyUndefined, makeCopyOfSimpleObjects);\n } else if (copyUndefined || sourceValue !== undefined) {\n dest[key] = sourceValue;\n }\n });\n}\nexport function missingOrEmptyObject(value) {\n return missing(value) || Object.keys(value).length === 0;\n}\nexport function get(source, expression, defaultValue) {\n if (source == null) {\n return defaultValue;\n }\n const keys = expression.split('.');\n let objectToRead = source;\n while (keys.length > 1) {\n objectToRead = objectToRead[keys.shift()];\n if (objectToRead == null) {\n return defaultValue;\n }\n }\n const value = objectToRead[keys[0]];\n return value != null ? value : defaultValue;\n}\nexport function set(target, expression, value) {\n if (target == null) {\n return;\n }\n const keys = expression.split('.');\n let objectToUpdate = target;\n // Create empty objects\n keys.forEach((key, i) => {\n if (!objectToUpdate[key]) {\n objectToUpdate[key] = {};\n }\n if (i < keys.length - 1) {\n objectToUpdate = objectToUpdate[key];\n }\n });\n objectToUpdate[keys[keys.length - 1]] = value;\n}\nexport function getValueUsingField(data, field, fieldContainsDots) {\n if (!field || !data) {\n return;\n }\n // if no '.', then it's not a deep value\n if (!fieldContainsDots) {\n return data[field];\n }\n // otherwise it is a deep value, so need to dig for it\n const fields = field.split('.');\n let currentObject = data;\n for (let i = 0; i < fields.length; i++) {\n if (currentObject == null) {\n return undefined;\n }\n currentObject = currentObject[fields[i]];\n }\n return currentObject;\n}\n// used by ColumnAPI and GridAPI to remove all references, so keeping grid in memory resulting in a\n// memory leak if user is not disposing of the GridAPI or ColumnApi references\nexport function removeAllReferences(obj, objectName) {\n Object.keys(obj).forEach(key => {\n const value = obj[key];\n // we want to replace all the @autowired services, which are objects. any simple types (boolean, string etc)\n // we don't care about\n if (typeof value === 'object') {\n obj[key] = undefined;\n }\n });\n const proto = Object.getPrototypeOf(obj);\n const properties = {};\n Object.keys(proto).forEach(key => {\n const value = proto[key];\n // leave all basic types - this is needed for GridAPI to leave the \"destroyed: boolean\" attribute alone\n if (typeof value === 'function') {\n const func = () => {\n console.warn(`AG Grid: ${objectName} function ${key}() cannot be called as the grid has been destroyed.\n Please don't call grid API functions on destroyed grids - as a matter of fact you shouldn't\n be keeping the API reference, your application has a memory leak! Remove the API reference\n when the grid is destroyed.`);\n };\n properties[key] = {\n value: func,\n writable: true\n };\n }\n });\n Object.defineProperties(obj, properties);\n}\nexport function isNonNullObject(value) {\n return typeof value === 'object' && value !== null;\n}","const doOnceFlags = {};\n/**\n * If the key was passed before, then doesn't execute the func\n * @param {Function} func\n * @param {string} key\n */\nexport function doOnce(func, key) {\n if (doOnceFlags[key]) {\n return;\n }\n func();\n doOnceFlags[key] = true;\n}\nexport function getFunctionName(funcConstructor) {\n // for every other browser in the world\n if (funcConstructor.name) {\n return funcConstructor.name;\n }\n // for the pestilence that is ie11\n const matches = /function\\s+([^\\(]+)/.exec(funcConstructor.toString());\n return matches && matches.length === 2 ? matches[1].trim() : null;\n}\nexport function isFunction(val) {\n return !!(val && val.constructor && val.call && val.apply);\n}\nexport function executeInAWhile(funcs) {\n executeAfter(funcs, 400);\n}\nconst executeNextVMTurnFuncs = [];\nlet executeNextVMTurnPending = false;\nexport function executeNextVMTurn(func) {\n executeNextVMTurnFuncs.push(func);\n if (executeNextVMTurnPending) {\n return;\n }\n executeNextVMTurnPending = true;\n window.setTimeout(() => {\n const funcsCopy = executeNextVMTurnFuncs.slice();\n executeNextVMTurnFuncs.length = 0;\n executeNextVMTurnPending = false;\n funcsCopy.forEach(func => func());\n }, 0);\n}\nexport function executeAfter(funcs, milliseconds = 0) {\n if (funcs.length > 0) {\n window.setTimeout(() => funcs.forEach(func => func()), milliseconds);\n }\n}\n/**\n * @param {Function} func The function to be debounced\n * @param {number} delay The time in ms to debounce\n * @return {Function} The debounced function\n */\nexport function debounce(func, delay) {\n let timeout;\n // Calling debounce returns a new anonymous function\n return function (...args) {\n const context = this;\n window.clearTimeout(timeout);\n // Set the new timeout\n timeout = window.setTimeout(function () {\n func.apply(context, args);\n }, delay);\n };\n}\n/**\n * @param {Function} func The function to be throttled\n * @param {number} wait The time in ms to throttle\n * @return {Function} The throttled function\n */\nexport function throttle(func, wait) {\n let previousCall = 0;\n return function (...args) {\n const context = this;\n const currentCall = new Date().getTime();\n if (currentCall - previousCall < wait) {\n return;\n }\n previousCall = currentCall;\n func.apply(context, args);\n };\n}\nexport function waitUntil(condition, callback, timeout = 100, timeoutMessage) {\n const timeStamp = new Date().getTime();\n let interval = null;\n let executed = false;\n const internalCallback = () => {\n const reachedTimeout = new Date().getTime() - timeStamp > timeout;\n if (condition() || reachedTimeout) {\n callback();\n executed = true;\n if (interval != null) {\n window.clearInterval(interval);\n interval = null;\n }\n if (reachedTimeout && timeoutMessage) {\n console.warn(timeoutMessage);\n }\n }\n };\n internalCallback();\n if (!executed) {\n interval = window.setInterval(internalCallback, 10);\n }\n}\nexport function compose(...fns) {\n return arg => fns.reduce((composed, f) => f(composed), arg);\n}\nexport function callIfPresent(func) {\n if (func) {\n func();\n }\n}\nexport const noop = () => {\n return;\n};","export var ModuleNames = /*#__PURE__*/function (ModuleNames) {\n ModuleNames[\"CommunityCoreModule\"] = \"@ag-grid-community/core\";\n // community modules\n ModuleNames[\"InfiniteRowModelModule\"] = \"@ag-grid-community/infinite-row-model\";\n ModuleNames[\"ClientSideRowModelModule\"] = \"@ag-grid-community/client-side-row-model\";\n ModuleNames[\"CsvExportModule\"] = \"@ag-grid-community/csv-export\";\n // enterprise core - users don't need to import on this, but other enterprise modules do\n ModuleNames[\"EnterpriseCoreModule\"] = \"@ag-grid-enterprise/core\";\n // enterprise modules\n ModuleNames[\"RowGroupingModule\"] = \"@ag-grid-enterprise/row-grouping\";\n ModuleNames[\"ColumnsToolPanelModule\"] = \"@ag-grid-enterprise/column-tool-panel\";\n ModuleNames[\"FiltersToolPanelModule\"] = \"@ag-grid-enterprise/filter-tool-panel\";\n ModuleNames[\"MenuModule\"] = \"@ag-grid-enterprise/menu\";\n ModuleNames[\"SetFilterModule\"] = \"@ag-grid-enterprise/set-filter\";\n ModuleNames[\"MultiFilterModule\"] = \"@ag-grid-enterprise/multi-filter\";\n ModuleNames[\"StatusBarModule\"] = \"@ag-grid-enterprise/status-bar\";\n ModuleNames[\"SideBarModule\"] = \"@ag-grid-enterprise/side-bar\";\n ModuleNames[\"RangeSelectionModule\"] = \"@ag-grid-enterprise/range-selection\";\n ModuleNames[\"MasterDetailModule\"] = \"@ag-grid-enterprise/master-detail\";\n ModuleNames[\"RichSelectModule\"] = \"@ag-grid-enterprise/rich-select\";\n ModuleNames[\"GridChartsModule\"] = \"@ag-grid-enterprise/charts\";\n ModuleNames[\"ViewportRowModelModule\"] = \"@ag-grid-enterprise/viewport-row-model\";\n ModuleNames[\"ServerSideRowModelModule\"] = \"@ag-grid-enterprise/server-side-row-model\";\n ModuleNames[\"ExcelExportModule\"] = \"@ag-grid-enterprise/excel-export\";\n ModuleNames[\"ClipboardModule\"] = \"@ag-grid-enterprise/clipboard\";\n ModuleNames[\"SparklinesModule\"] = \"@ag-grid-enterprise/sparklines\";\n ModuleNames[\"AdvancedFilterModule\"] = \"@ag-grid-enterprise/advanced-filter\";\n // framework wrappers currently don't provide beans, comps etc, so no need to be modules,\n // however i argue they should be as in theory they 'could' provide beans etc\n ModuleNames[\"AngularModule\"] = \"@ag-grid-community/angular\";\n ModuleNames[\"ReactModule\"] = \"@ag-grid-community/react\";\n ModuleNames[\"VueModule\"] = \"@ag-grid-community/vue\";\n // and then this, which is definitely not a grid module, as it should not have any dependency\n // on the grid (ie shouldn't even reference the Module interface)\n // ChartsModule = \"@ag-grid-community/charts-core\",\n return ModuleNames;\n}(ModuleNames || {});","import { ModuleNames } from \"./moduleNames.mjs\";\nimport { doOnce } from \"../utils/function.mjs\";\nimport { values } from \"../utils/generic.mjs\";\nexport let ModuleRegistry = /*#__PURE__*/(() => {\n class ModuleRegistry {\n /**\n * Globally register the given module for all grids.\n * @param module - module to register\n */\n static register(module) {\n ModuleRegistry.__register(module, true, undefined);\n }\n /**\n * Globally register the given modules for all grids.\n * @param modules - modules to register\n */\n static registerModules(modules) {\n ModuleRegistry.__registerModules(modules, true, undefined);\n }\n /** AG GRID INTERNAL - Module registration helper. */\n static __register(module, moduleBased, gridId) {\n ModuleRegistry.runVersionChecks(module);\n if (gridId !== undefined) {\n ModuleRegistry.areGridScopedModules = true;\n if (ModuleRegistry.gridModulesMap[gridId] === undefined) {\n ModuleRegistry.gridModulesMap[gridId] = {};\n }\n ModuleRegistry.gridModulesMap[gridId][module.moduleName] = module;\n } else {\n ModuleRegistry.globalModulesMap[module.moduleName] = module;\n }\n ModuleRegistry.setModuleBased(moduleBased);\n }\n /** AG GRID INTERNAL - Unregister grid scoped module. */\n static __unRegisterGridModules(gridId) {\n delete ModuleRegistry.gridModulesMap[gridId];\n }\n /** AG GRID INTERNAL - Module registration helper. */\n static __registerModules(modules, moduleBased, gridId) {\n ModuleRegistry.setModuleBased(moduleBased);\n if (!modules) {\n return;\n }\n modules.forEach(module => ModuleRegistry.__register(module, moduleBased, gridId));\n }\n static isValidModuleVersion(module) {\n const [moduleMajor, moduleMinor] = module.version.split('.') || [];\n const [currentModuleMajor, currentModuleMinor] = ModuleRegistry.currentModuleVersion.split('.') || [];\n return moduleMajor === currentModuleMajor && moduleMinor === currentModuleMinor;\n }\n static runVersionChecks(module) {\n if (!ModuleRegistry.currentModuleVersion) {\n ModuleRegistry.currentModuleVersion = module.version;\n }\n if (!module.version) {\n console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${module.moduleName}' is incompatible. Please update all modules to the same version.`);\n } else if (!ModuleRegistry.isValidModuleVersion(module)) {\n console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${module.moduleName}' is version ${module.version} but the other modules are version ${this.currentModuleVersion}. Please update all modules to the same version.`);\n }\n if (module.validate) {\n const result = module.validate();\n if (!result.isValid) {\n const errorResult = result;\n console.error(`AG Grid: ${errorResult.message}`);\n }\n }\n }\n static setModuleBased(moduleBased) {\n if (ModuleRegistry.moduleBased === undefined) {\n ModuleRegistry.moduleBased = moduleBased;\n } else {\n if (ModuleRegistry.moduleBased !== moduleBased) {\n doOnce(() => {\n console.warn(`AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms.`);\n console.warn('Please see https://www.ag-grid.com/javascript-grid/packages-modules/ for more information.');\n }, 'ModulePackageCheck');\n }\n }\n }\n /**\n * AG GRID INTERNAL - Set if files are being served from a single UMD bundle to provide accurate enterprise upgrade steps.\n */\n static __setIsBundled() {\n ModuleRegistry.isBundled = true;\n }\n /** AG GRID INTERNAL - Assert a given module has been register, globally or individually with this grid. */\n static __assertRegistered(moduleName, reason, gridId) {\n var _a;\n if (this.__isRegistered(moduleName, gridId)) {\n return true;\n }\n const warningKey = reason + moduleName;\n let warningMessage;\n if (ModuleRegistry.isBundled) {\n {\n warningMessage = `AG Grid: unable to use ${reason} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\n \n \n \nFor more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;\n }\n } else if (ModuleRegistry.moduleBased || ModuleRegistry.moduleBased === undefined) {\n let modName = (_a = Object.entries(ModuleNames).find(([k, v]) => v === moduleName)) === null || _a === void 0 ? void 0 : _a[0];\n warningMessage = `AG Grid: unable to use ${reason} as the ${modName} is not registered${ModuleRegistry.areGridScopedModules ? ` for gridId: ${gridId}` : ''}. Check if you have registered the module:\n \n import { ModuleRegistry } from '@ag-grid-community/core';\n import { ${modName} } from '${moduleName}';\n \n ModuleRegistry.registerModules([ ${modName} ]);\n\nFor more info see: https://www.ag-grid.com/javascript-grid/modules/`;\n } else {\n warningMessage = `AG Grid: unable to use ${reason} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:\n \n import 'ag-grid-enterprise';\n \nFor more info see: https://www.ag-grid.com/javascript-grid/packages/`;\n }\n doOnce(() => {\n console.warn(warningMessage);\n }, warningKey);\n return false;\n }\n /** AG GRID INTERNAL - Is the given module registered, globally or individually with this grid. */\n static __isRegistered(moduleName, gridId) {\n var _a;\n return !!ModuleRegistry.globalModulesMap[moduleName] || !!((_a = ModuleRegistry.gridModulesMap[gridId]) === null || _a === void 0 ? void 0 : _a[moduleName]);\n }\n /** AG GRID INTERNAL - Get all registered modules globally / individually for this grid. */\n static __getRegisteredModules(gridId) {\n return [...values(ModuleRegistry.globalModulesMap), ...values(ModuleRegistry.gridModulesMap[gridId] || {})];\n }\n /** AG GRID INTERNAL - Get the list of modules registered individually for this grid. */\n static __getGridRegisteredModules(gridId) {\n var _a;\n return values((_a = ModuleRegistry.gridModulesMap[gridId]) !== null && _a !== void 0 ? _a : {}) || [];\n }\n /** INTERNAL */\n static __isPackageBased() {\n return !ModuleRegistry.moduleBased;\n }\n }\n // having in a map a) removes duplicates and b) allows fast lookup\n ModuleRegistry.globalModulesMap = {};\n ModuleRegistry.gridModulesMap = {};\n ModuleRegistry.areGridScopedModules = false;\n return ModuleRegistry;\n})();","import { exists, values } from \"../utils/generic.mjs\";\nimport { iterateObject } from \"../utils/object.mjs\";\nimport { getFunctionName } from \"../utils/function.mjs\";\nimport { ModuleRegistry } from \"../modules/moduleRegistry.mjs\";\nexport class Context {\n constructor(params, logger) {\n this.beanWrappers = {};\n this.destroyed = false;\n if (!params || !params.beanClasses) {\n return;\n }\n this.contextParams = params;\n this.logger = logger;\n this.logger.log(\">> creating ag-Application Context\");\n this.createBeans();\n const beanInstances = this.getBeanInstances();\n this.wireBeans(beanInstances);\n this.logger.log(\">> ag-Application Context ready - component is alive\");\n }\n getBeanInstances() {\n return values(this.beanWrappers).map(beanEntry => beanEntry.beanInstance);\n }\n createBean(bean, afterPreCreateCallback) {\n if (!bean) {\n throw Error(`Can't wire to bean since it is null`);\n }\n this.wireBeans([bean], afterPreCreateCallback);\n return bean;\n }\n wireBeans(beanInstances, afterPreCreateCallback) {\n this.autoWireBeans(beanInstances);\n this.methodWireBeans(beanInstances);\n this.callLifeCycleMethods(beanInstances, 'preConstructMethods');\n // the callback sets the attributes, so the component has access to attributes\n // before postConstruct methods in the component are executed\n if (exists(afterPreCreateCallback)) {\n beanInstances.forEach(afterPreCreateCallback);\n }\n this.callLifeCycleMethods(beanInstances, 'postConstructMethods');\n }\n createBeans() {\n // register all normal beans\n this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this));\n // register override beans, these will overwrite beans above of same name\n // instantiate all beans - overridden beans will be left out\n iterateObject(this.beanWrappers, (key, beanEntry) => {\n let constructorParamsMeta;\n if (beanEntry.bean.__agBeanMetaData && beanEntry.bean.__agBeanMetaData.autowireMethods && beanEntry.bean.__agBeanMetaData.autowireMethods.agConstructor) {\n constructorParamsMeta = beanEntry.bean.__agBeanMetaData.autowireMethods.agConstructor;\n }\n const constructorParams = this.getBeansForParameters(constructorParamsMeta, beanEntry.bean.name);\n const newInstance = new (beanEntry.bean.bind.apply(beanEntry.bean, [null, ...constructorParams]))();\n beanEntry.beanInstance = newInstance;\n });\n const createdBeanNames = Object.keys(this.beanWrappers).join(', ');\n this.logger.log(`created beans: ${createdBeanNames}`);\n }\n // tslint:disable-next-line\n createBeanWrapper(BeanClass) {\n const metaData = BeanClass.__agBeanMetaData;\n if (!metaData) {\n let beanName;\n if (BeanClass.prototype.constructor) {\n beanName = getFunctionName(BeanClass.prototype.constructor);\n } else {\n beanName = \"\" + BeanClass;\n }\n console.error(`Context item ${beanName} is not a bean`);\n return;\n }\n const beanEntry = {\n bean: BeanClass,\n beanInstance: null,\n beanName: metaData.beanName\n };\n this.beanWrappers[metaData.beanName] = beanEntry;\n }\n autoWireBeans(beanInstances) {\n beanInstances.forEach(beanInstance => {\n this.forEachMetaDataInHierarchy(beanInstance, (metaData, beanName) => {\n const attributes = metaData.agClassAttributes;\n if (!attributes) {\n return;\n }\n attributes.forEach(attribute => {\n const otherBean = this.lookupBeanInstance(beanName, attribute.beanName, attribute.optional);\n beanInstance[attribute.attributeName] = otherBean;\n });\n });\n });\n }\n methodWireBeans(beanInstances) {\n beanInstances.forEach(beanInstance => {\n this.forEachMetaDataInHierarchy(beanInstance, (metaData, beanName) => {\n iterateObject(metaData.autowireMethods, (methodName, wireParams) => {\n // skip constructor, as this is dealt with elsewhere\n if (methodName === \"agConstructor\") {\n return;\n }\n const initParams = this.getBeansForParameters(wireParams, beanName);\n beanInstance[methodName].apply(beanInstance, initParams);\n });\n });\n });\n }\n forEachMetaDataInHierarchy(beanInstance, callback) {\n let prototype = Object.getPrototypeOf(beanInstance);\n while (prototype != null) {\n const constructor = prototype.constructor;\n if (constructor.hasOwnProperty('__agBeanMetaData')) {\n const metaData = constructor.__agBeanMetaData;\n const beanName = this.getBeanName(constructor);\n callback(metaData, beanName);\n }\n prototype = Object.getPrototypeOf(prototype);\n }\n }\n getBeanName(constructor) {\n if (constructor.__agBeanMetaData && constructor.__agBeanMetaData.beanName) {\n return constructor.__agBeanMetaData.beanName;\n }\n const constructorString = constructor.toString();\n const beanName = constructorString.substring(9, constructorString.indexOf(\"(\"));\n return beanName;\n }\n getBeansForParameters(parameters, beanName) {\n const beansList = [];\n if (parameters) {\n iterateObject(parameters, (paramIndex, otherBeanName) => {\n const otherBean = this.lookupBeanInstance(beanName, otherBeanName);\n beansList[Number(paramIndex)] = otherBean;\n });\n }\n return beansList;\n }\n lookupBeanInstance(wiringBean, beanName, optional = false) {\n if (this.destroyed) {\n this.logger.log(`AG Grid: bean reference ${beanName} is used after the grid is destroyed!`);\n return null;\n }\n if (beanName === \"context\") {\n return this;\n }\n if (this.contextParams.providedBeanInstances && this.contextParams.providedBeanInstances.hasOwnProperty(beanName)) {\n return this.contextParams.providedBeanInstances[beanName];\n }\n const beanEntry = this.beanWrappers[beanName];\n if (beanEntry) {\n return beanEntry.beanInstance;\n }\n if (!optional) {\n console.error(`AG Grid: unable to find bean reference ${beanName} while initialising ${wiringBean}`);\n }\n return null;\n }\n callLifeCycleMethods(beanInstances, lifeCycleMethod) {\n beanInstances.forEach(beanInstance => this.callLifeCycleMethodsOnBean(beanInstance, lifeCycleMethod));\n }\n callLifeCycleMethodsOnBean(beanInstance, lifeCycleMethod, methodToIgnore) {\n // putting all methods into a map removes duplicates\n const allMethods = {};\n // dump methods from each level of the metadata hierarchy\n this.forEachMetaDataInHierarchy(beanInstance, metaData => {\n const methods = metaData[lifeCycleMethod];\n if (methods) {\n methods.forEach(methodName => {\n if (methodName != methodToIgnore) {\n allMethods[methodName] = true;\n }\n });\n }\n });\n const allMethodsList = Object.keys(allMethods);\n allMethodsList.forEach(methodName => beanInstance[methodName]());\n }\n getBean(name) {\n return this.lookupBeanInstance(\"getBean\", name, true);\n }\n destroy() {\n if (this.destroyed) {\n return;\n }\n // Set before doing the destroy, so if context.destroy() gets called via another bean\n // we are marked as destroyed already to prevent running destroy() twice\n this.destroyed = true;\n this.logger.log(\">> Shutting down ag-Application Context\");\n const beanInstances = this.getBeanInstances();\n this.destroyBeans(beanInstances);\n this.contextParams.providedBeanInstances = null;\n ModuleRegistry.__unRegisterGridModules(this.contextParams.gridId);\n this.logger.log(\">> ag-Application Context shut down - component is dead\");\n }\n destroyBean(bean) {\n if (!bean) {\n return;\n }\n this.destroyBeans([bean]);\n }\n destroyBeans(beans) {\n if (!beans) {\n return [];\n }\n beans.forEach(bean => {\n this.callLifeCycleMethodsOnBean(bean, 'preDestroyMethods', 'destroy');\n // call destroy() explicitly if it exists\n const beanAny = bean;\n if (typeof beanAny.destroy === 'function') {\n beanAny.destroy();\n }\n });\n return [];\n }\n isDestroyed() {\n return this.destroyed;\n }\n getGridId() {\n return this.contextParams.gridId;\n }\n}\nexport function PreConstruct(target, methodName, descriptor) {\n const props = getOrCreateProps(target.constructor);\n if (!props.preConstructMethods) {\n props.preConstructMethods = [];\n }\n props.preConstructMethods.push(methodName);\n}\nexport function PostConstruct(target, methodName, descriptor) {\n const props = getOrCreateProps(target.constructor);\n if (!props.postConstructMethods) {\n props.postConstructMethods = [];\n }\n props.postConstructMethods.push(methodName);\n}\nexport function PreDestroy(target, methodName, descriptor) {\n const props = getOrCreateProps(target.constructor);\n if (!props.preDestroyMethods) {\n props.preDestroyMethods = [];\n }\n props.preDestroyMethods.push(methodName);\n}\nexport function Bean(beanName) {\n return classConstructor => {\n const props = getOrCreateProps(classConstructor);\n props.beanName = beanName;\n };\n}\nexport function Autowired(name) {\n return (target, propertyKey, descriptor) => {\n autowiredFunc(target, name, false, target, propertyKey, null);\n };\n}\nexport function Optional(name) {\n return (target, propertyKey, descriptor) => {\n autowiredFunc(target, name, true, target, propertyKey, null);\n };\n}\nfunction autowiredFunc(target, name, optional, classPrototype, methodOrAttributeName, index) {\n if (name === null) {\n console.error(\"AG Grid: Autowired name should not be null\");\n return;\n }\n if (typeof index === \"number\") {\n console.error(\"AG Grid: Autowired should be on an attribute\");\n return;\n }\n // it's an attribute on the class\n const props = getOrCreateProps(target.constructor);\n if (!props.agClassAttributes) {\n props.agClassAttributes = [];\n }\n props.agClassAttributes.push({\n attributeName: methodOrAttributeName,\n beanName: name,\n optional: optional\n });\n}\nexport function Qualifier(name) {\n return (classPrototype, methodOrAttributeName, index) => {\n const constructor = typeof classPrototype == \"function\" ? classPrototype : classPrototype.constructor;\n let props;\n if (typeof index === \"number\") {\n // it's a parameter on a method\n let methodName;\n if (methodOrAttributeName) {\n props = getOrCreateProps(constructor);\n methodName = methodOrAttributeName;\n } else {\n props = getOrCreateProps(constructor);\n methodName = \"agConstructor\";\n }\n if (!props.autowireMethods) {\n props.autowireMethods = {};\n }\n if (!props.autowireMethods[methodName]) {\n props.autowireMethods[methodName] = {};\n }\n props.autowireMethods[methodName][index] = name;\n }\n };\n}\nfunction getOrCreateProps(target) {\n if (!target.hasOwnProperty(\"__agBeanMetaData\")) {\n target.__agBeanMetaData = {};\n }\n return target.__agBeanMetaData;\n}","var __decorate = this && this.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = this && this.__param || function (paramIndex, decorator) {\n return function (target, key) {\n decorator(target, key, paramIndex);\n };\n};\nimport { Bean, Qualifier } from \"./context/context.mjs\";\nlet EventService = class EventService {\n constructor() {\n this.allSyncListeners = new Map();\n this.allAsyncListeners = new Map();\n this.globalSyncListeners = new Set();\n this.globalAsyncListeners = new Set();\n this.asyncFunctionsQueue = [];\n this.scheduled = false;\n // using an object performs better than a Set for the number of different events we have\n this.firedEvents = {};\n }\n // because this class is used both inside the context and outside the context, we do not\n // use autowired attributes, as that would be confusing, as sometimes the attributes\n // would be wired, and sometimes not.\n //\n // the global event servers used by AG Grid is autowired by the context once, and this\n // setBeans method gets called once.\n //\n // the times when this class is used outside of the context (eg RowNode has an instance of this\n // class) then it is not a bean, and this setBeans method is not called.\n setBeans(loggerFactory, gridOptionsService, frameworkOverrides, globalEventListener = null) {\n this.frameworkOverrides = frameworkOverrides;\n this.gridOptionsService = gridOptionsService;\n if (globalEventListener) {\n const async = gridOptionsService.useAsyncEvents();\n this.addGlobalListener(globalEventListener, async);\n }\n }\n getListeners(eventType, async, autoCreateListenerCollection) {\n const listenerMap = async ? this.allAsyncListeners : this.allSyncListeners;\n let listeners = listenerMap.get(eventType);\n // Note: 'autoCreateListenerCollection' should only be 'true' if a listener is about to be added. For instance\n // getListeners() is also called during event dispatch even though no listeners are added. This measure protects\n // against 'memory bloat' as empty collections will prevent the RowNode's event service from being removed after\n // the RowComp is destroyed, see noRegisteredListenersExist() below.\n if (!listeners && autoCreateListenerCollection) {\n listeners = new Set();\n listenerMap.set(eventType, listeners);\n }\n return listeners;\n }\n noRegisteredListenersExist() {\n return this.allSyncListeners.size === 0 && this.allAsyncListeners.size === 0 && this.globalSyncListeners.size === 0 && this.globalAsyncListeners.size === 0;\n }\n addEventListener(eventType, listener, async = false) {\n this.getListeners(eventType, async, true).add(listener);\n }\n removeEventListener(eventType, listener, async = false) {\n const listeners = this.getListeners(eventType, async, false);\n if (!listeners) {\n return;\n }\n listeners.delete(listener);\n if (listeners.size === 0) {\n const listenerMap = async ? this.allAsyncListeners : this.allSyncListeners;\n listenerMap.delete(eventType);\n }\n }\n addGlobalListener(listener, async = false) {\n (async ? this.globalAsyncListeners : this.globalSyncListeners).add(listener);\n }\n removeGlobalListener(listener, async = false) {\n (async ? this.globalAsyncListeners : this.globalSyncListeners).delete(listener);\n }\n dispatchEvent(event) {\n let agEvent = event;\n if (this.gridOptionsService) {\n // Apply common properties to all dispatched events if this event service has had its beans set with gridOptionsService.\n // Note there are multiple instances of EventService that are used local to components which do not set gridOptionsService.\n const {\n api,\n columnApi,\n context\n } = this.gridOptionsService;\n agEvent.api = api;\n agEvent.columnApi = columnApi;\n agEvent.context = context;\n }\n this.dispatchToListeners(agEvent, true);\n this.dispatchToListeners(agEvent, false);\n this.firedEvents[agEvent.type] = true;\n }\n dispatchEventOnce(event) {\n if (!this.firedEvents[event.type]) {\n this.dispatchEvent(event);\n }\n }\n dispatchToListeners(event, async) {\n const eventType = event.type;\n if (async && 'event' in event) {\n const browserEvent = event.event;\n if (browserEvent instanceof Event) {\n // AG-7893 - Persist composedPath() so that its result can still be accessed by the user asynchronously.\n // Within an async event handler if they call composedPath() on the event it will always return an empty [].\n event.eventPath = browserEvent.composedPath();\n }\n }\n const processEventListeners = listeners => listeners.forEach(listener => {\n if (async) {\n this.dispatchAsync(() => listener(event));\n } else {\n listener(event);\n }\n });\n // create a shallow copy to prevent listeners cyclically adding more listeners to capture this event\n const listeners = new Set(this.getListeners(eventType, async, false));\n if (listeners) {\n processEventListeners(listeners);\n }\n const globalListeners = new Set(async ? this.globalAsyncListeners : this.globalSyncListeners);\n globalListeners.forEach(listener => {\n if (async) {\n this.dispatchAsync(() => this.frameworkOverrides.dispatchEvent(eventType, () => listener(eventType, event), true));\n } else {\n this.frameworkOverrides.dispatchEvent(eventType, () => listener(eventType, event), true);\n }\n });\n }\n // this gets called inside the grid's thread, for each event that it\n // wants to set async. the grid then batches the events into one setTimeout()\n // because setTimeout() is an expensive operation. ideally we would have\n // each event in it's own setTimeout(), but we batch for performance.\n dispatchAsync(func) {\n // add to the queue for executing later in the next VM turn\n this.asyncFunctionsQueue.push(func);\n // check if timeout is already scheduled. the first time the grid calls\n // this within it's thread turn, this should be false, so it will schedule\n // the 'flush queue' method the first time it comes here. then the flag is\n // set to 'true' so it will know it's already scheduled for subsequent calls.\n if (!this.scheduled) {\n // if not scheduled, schedule one\n window.setTimeout(this.flushAsyncQueue.bind(this), 0);\n // mark that it is scheduled\n this.scheduled = true;\n }\n }\n // this happens in the next VM turn only, and empties the queue of events\n flushAsyncQueue() {\n this.scheduled = false;\n // we take a copy, because the event listener could be using\n // the grid, which would cause more events, which would be potentially\n // added to the queue, so safe to take a copy, the new events will\n // get executed in a later VM turn rather than risk updating the\n // queue as we are flushing it.\n const queueCopy = this.asyncFunctionsQueue.slice();\n this.asyncFunctionsQueue = [];\n // execute the queue\n queueCopy.forEach(func => func());\n }\n};\n__decorate([__param(0, Qualifier('loggerFactory')), __param(1, Qualifier('gridOptionsService')), __param(2, Qualifier('frameworkOverrides')), __param(3, Qualifier('globalEventListener'))], EventService.prototype, \"setBeans\", null);\nEventService = __decorate([Bean('eventService')], EventService);\nexport { EventService };","var __decorate = this && this.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EventService } from \"../eventService.mjs\";\nimport { Autowired, PostConstruct } from \"../context/context.mjs\";\nimport { ModuleNames } from \"../modules/moduleNames.mjs\";\nimport { ModuleRegistry } from \"../modules/moduleRegistry.mjs\";\nimport { attrToNumber, attrToBoolean, exists, missing } from \"../utils/generic.mjs\";\nimport { doOnce } from \"../utils/function.mjs\";\nimport { mergeDeep } from \"../utils/object.mjs\";\nlet instanceIdSequence = 0;\nexport function getNextColInstanceId() {\n return instanceIdSequence++;\n}\n// Wrapper around a user provide column definition. The grid treats the column definition as ready only.\n// This class contains all the runtime information about a column, plus some logic (the definition has no logic).\n// This class implements both interfaces ColumnGroupChild and ProvidedColumnGroupChild as the class can\n// appear as a child of either the original tree or the displayed tree. However the relevant group classes\n// for each type only implements one, as each group can only appear in it's associated tree (eg ProvidedColumnGroup\n// can only appear in OriginalColumn tree).\nexport class Column {\n constructor(colDef, userProvidedColDef, colId, primary) {\n // used by React (and possibly other frameworks) as key for rendering. also used to\n // identify old vs new columns for destroying cols when no longer used.\n this.instanceId = getNextColInstanceId();\n // The measured height of this column's header when autoHeaderHeight is enabled\n this.autoHeaderHeight = null;\n this.moving = false;\n this.menuVisible = false;\n this.lastLeftPinned = false;\n this.firstRightPinned = false;\n this.filterActive = false;\n this.eventService = new EventService();\n this.tooltipEnabled = false;\n this.rowGroupActive = false;\n this.pivotActive = false;\n this.aggregationActive = false;\n this.colDef = colDef;\n this.userProvidedColDef = userProvidedColDef;\n this.colId = colId;\n this.primary = primary;\n this.setState(colDef);\n }\n getInstanceId() {\n return this.instanceId;\n }\n setState(colDef) {\n // sort\n if (colDef.sort !== undefined) {\n if (colDef.sort === 'asc' || colDef.sort === 'desc') {\n this.sort = colDef.sort;\n }\n } else {\n if (colDef.initialSort === 'asc' || colDef.initialSort === 'desc') {\n this.sort = colDef.initialSort;\n }\n }\n // sortIndex\n const sortIndex = attrToNumber(colDef.sortIndex);\n const initialSortIndex = attrToNumber(colDef.initialSortIndex);\n if (sortIndex !== undefined) {\n if (sortIndex !== null) {\n this.sortIndex = sortIndex;\n }\n } else {\n if (initialSortIndex !== null) {\n this.sortIndex = initialSortIndex;\n }\n }\n // hide\n const hide = attrToBoolean(colDef.hide);\n const initialHide = attrToBoolean(colDef.initialHide);\n if (hide !== undefined) {\n this.visible = !hide;\n } else {\n this.visible = !initialHide;\n }\n // pinned\n if (colDef.pinned !== undefined) {\n this.setPinned(colDef.pinned);\n } else {\n this.setPinned(colDef.initialPinned);\n }\n // flex\n const flex = attrToNumber(colDef.flex);\n const initialFlex = attrToNumber(colDef.initialFlex);\n if (flex !== undefined) {\n this.flex = flex;\n } else if (initialFlex !== undefined) {\n this.flex = initialFlex;\n }\n }\n // gets called when user provides an alternative colDef, eg\n setColDef(colDef, userProvidedColDef) {\n this.colDef = colDef;\n this.userProvidedColDef = userProvidedColDef;\n this.initMinAndMaxWidths();\n this.initDotNotation();\n this.eventService.dispatchEvent(this.createColumnEvent('colDefChanged', \"api\"));\n }\n /**\n * Returns the column definition provided by the application.\n * This may not be correct, as items can be superseded by default column options.\n * However it's useful for comparison, eg to know which application column definition matches that column.\n */\n getUserProvidedColDef() {\n return this.userProvidedColDef;\n }\n setParent(parent) {\n this.parent = parent;\n }\n /** Returns the parent column group, if column grouping is active. */\n getParent() {\n return this.parent;\n }\n setOriginalParent(originalParent) {\n this.originalParent = originalParent;\n }\n /**\n * Used for marryChildren, helps with comparing when duplicate groups have been created to manage split groups.\n *\n * Parent may contain a duplicate but not identical group when the group is split.\n */\n getOriginalParent() {\n return this.originalParent;\n }\n // this is done after constructor as it uses gridOptionsService\n initialise() {\n this.initMinAndMaxWidths();\n this.resetActualWidth('gridInitializing');\n this.initDotNotation();\n this.initTooltip();\n this.validate();\n }\n initDotNotation() {\n const suppressDotNotation = this.gridOptionsService.is('suppressFieldDotNotation');\n this.fieldContainsDots = exists(this.colDef.field) && this.colDef.field.indexOf('.') >= 0 && !suppressDotNotation;\n this.tooltipFieldContainsDots = exists(this.colDef.tooltipField) && this.colDef.tooltipField.indexOf('.') >= 0 && !suppressDotNotation;\n }\n initMinAndMaxWidths() {\n const colDef = this.colDef;\n this.minWidth = this.columnUtils.calculateColMinWidth(colDef);\n this.maxWidth = this.columnUtils.calculateColMaxWidth(colDef);\n }\n initTooltip() {\n this.tooltipEnabled = exists(this.colDef.tooltipField) || exists(this.colDef.tooltipValueGetter) || exists(this.colDef.tooltipComponent);\n }\n resetActualWidth(source = 'api') {\n const initialWidth = this.columnUtils.calculateColInitialWidth(this.colDef);\n this.setActualWidth(initialWidth, source, true);\n }\n isEmptyGroup() {\n return false;\n }\n isRowGroupDisplayed(colId) {\n if (missing(this.colDef) || missing(this.colDef.showRowGroup)) {\n return false;\n }\n const showingAllGroups = this.colDef.showRowGroup === true;\n const showingThisGroup = this.colDef.showRowGroup === colId;\n return showingAllGroups || showingThisGroup;\n }\n /** Returns `true` if column is a primary column, `false` if secondary. Secondary columns are used for pivoting. */\n isPrimary() {\n return this.primary;\n }\n /** Returns `true` if column filtering is allowed. */\n isFilterAllowed() {\n // filter defined means it's a string, class or true.\n // if its false, null or undefined then it's false.\n const filterDefined = !!this.colDef.filter;\n return filterDefined;\n }\n isFieldContainsDots() {\n return this.fieldContainsDots;\n }\n isTooltipEnabled() {\n return this.tooltipEnabled;\n }\n isTooltipFieldContainsDots() {\n return this.tooltipFieldContainsDots;\n }\n validate() {\n const colDefAny = this.colDef;\n function warnOnce(msg, key, obj) {\n doOnce(() => {\n if (obj) {\n console.warn(msg, obj);\n } else {\n doOnce(() => console.warn(msg), key);\n }\n }, key);\n }\n const usingCSRM = this.gridOptionsService.isRowModelType('clientSide');\n if (usingCSRM && !ModuleRegistry.__isRegistered(ModuleNames.RowGroupingModule, this.gridOptionsService.getGridId())) {\n const rowGroupingItems = ['enableRowGroup', 'rowGroup', 'rowGroupIndex', 'enablePivot', 'enableValue', 'pivot', 'pivotIndex', 'aggFunc'];\n const itemsUsed = rowGroupingItems.filter(x => exists(colDefAny[x]));\n if (itemsUsed.length > 0) {\n ModuleRegistry.__assertRegistered(ModuleNames.RowGroupingModule, itemsUsed.map(i => 'colDef.' + i).join(', '), this.gridOptionsService.getGridId());\n }\n }\n if (this.colDef.cellEditor === 'agRichSelect' || this.colDef.cellEditor === 'agRichSelectCellEditor') {\n ModuleRegistry.__assertRegistered(ModuleNames.RichSelectModule, this.colDef.cellEditor, this.gridOptionsService.getGridId());\n }\n if (this.gridOptionsService.isTreeData()) {\n const itemsNotAllowedWithTreeData = ['rowGroup', 'rowGroupIndex', 'pivot', 'pivotIndex'];\n const itemsUsed = itemsNotAllowedWithTreeData.filter(x => exists(colDefAny[x]));\n if (itemsUsed.length > 0) {\n warnOnce(`AG Grid: ${itemsUsed.join()} is not possible when doing tree data, your column definition should not have ${itemsUsed.join()}`, 'TreeDataCannotRowGroup');\n }\n }\n if (exists(colDefAny.menuTabs)) {\n if (Array.isArray(colDefAny.menuTabs)) {\n const communityMenuTabs = ['filterMenuTab'];\n const enterpriseMenuTabs = ['columnsMenuTab', 'generalMenuTab'];\n const itemsUsed = enterpriseMenuTabs.filter(x => colDefAny.menuTabs.includes(x));\n if (itemsUsed.length > 0) {\n ModuleRegistry.__assertRegistered(ModuleNames.MenuModule, `menuTab(s): ${itemsUsed.map(t => `'${t}'`).join()}`, this.gridOptionsService.getGridId());\n }\n colDefAny.menuTabs.forEach(tab => {\n if (!enterpriseMenuTabs.includes(tab) && !communityMenuTabs.includes(tab)) {\n warnOnce(`AG Grid: '${tab}' is not valid for 'colDef.menuTabs'. Valid values are: ${[...communityMenuTabs, ...enterpriseMenuTabs].map(t => `'${t}'`).join()}.`, 'wrongValue_menuTabs_' + tab);\n }\n });\n } else {\n warnOnce(`AG Grid: The typeof 'colDef.menuTabs' should be an array not:` + typeof colDefAny.menuTabs, 'wrongType_menuTabs');\n }\n }\n if (exists(colDefAny.columnsMenuParams)) {\n ModuleRegistry.__assertRegistered(ModuleNames.MenuModule, 'columnsMenuParams', this.gridOptionsService.getGridId());\n }\n if (exists(colDefAny.columnsMenuParams)) {\n ModuleRegistry.__assertRegistered(ModuleNames.ColumnsToolPanelModule, 'columnsMenuParams', this.gridOptionsService.getGridId());\n }\n if (exists(this.colDef.width) && typeof this.colDef.width !== 'number') {\n warnOnce('AG Grid: colDef.width should be a number, not ' + typeof this.colDef.width, 'ColumnCheck');\n }\n if (exists(colDefAny.columnGroupShow) && colDefAny.columnGroupShow !== 'closed' && colDefAny.columnGroupShow !== 'open') {\n warnOnce(`AG Grid: '${colDefAny.columnGroupShow}' is not valid for columnGroupShow. Valid values are 'open', 'closed', undefined, null`, 'columnGroupShow_invalid');\n }\n }\n /** Add an event listener to the column. */\n addEventListener(eventType, listener) {\n this.eventService.addEventListener(eventType, listener);\n }\n /** Remove event listener from the column. */\n removeEventListener(eventType, listener) {\n this.eventService.removeEventListener(eventType, listener);\n }\n createColumnFunctionCallbackParams(rowNode) {\n return {\n node: rowNode,\n data: rowNode.data,\n column: this,\n colDef: this.colDef,\n context: this.gridOptionsService.context,\n api: this.gridOptionsService.api,\n columnApi: this.gridOptionsService.columnApi\n };\n }\n isSuppressNavigable(rowNode) {\n // if boolean set, then just use it\n if (typeof this.colDef.suppressNavigable === 'boolean') {\n return this.colDef.suppressNavigable;\n }\n // if function, then call the function to find out\n if (typeof this.colDef.suppressNavigable === 'function') {\n const params = this.createColumnFunctionCallbackParams(rowNode);\n const userFunc = this.colDef.suppressNavigable;\n return userFunc(params);\n }\n return false;\n }\n /**\n * Returns `true` if the cell for this column is editable for the given `rowNode`, otherwise `false`.\n */\n isCellEditable(rowNode) {\n // only allow editing of groups if the user has this option enabled\n if (rowNode.group && !this.gridOptionsService.is('enableGroupEdit')) {\n return false;\n }\n return this.isColumnFunc(rowNode, this.colDef.editable);\n }\n isSuppressFillHandle() {\n return !!attrToBoolean(this.colDef.suppressFillHandle);\n }\n isAutoHeight() {\n return !!attrToBoolean(this.colDef.autoHeight);\n }\n isAutoHeaderHeight() {\n return !!attrToBoolean(this.colDef.autoHeaderHeight);\n }\n isRowDrag(rowNode) {\n return this.isColumnFunc(rowNode, this.colDef.rowDrag);\n }\n isDndSource(rowNode) {\n return this.isColumnFunc(rowNode, this.colDef.dndSource);\n }\n isCellCheckboxSelection(rowNode) {\n return this.isColumnFunc(rowNode, this.colDef.checkboxSelection);\n }\n isSuppressPaste(rowNode) {\n return this.isColumnFunc(rowNode, this.colDef ? this.colDef.suppressPaste : null);\n }\n isResizable() {\n return !!attrToBoolean(this.colDef.resizable);\n }\n isColumnFunc(rowNode, value) {\n // if boolean set, then just use it\n if (typeof value === 'boolean') {\n return value;\n }\n // if function, then call the function to find out\n if (typeof value === 'function') {\n const params = this.createColumnFunctionCallbackParams(rowNode);\n const editableFunc = value;\n return editableFunc(params);\n }\n return false;\n }\n setMoving(moving, source = \"api\") {\n this.moving = moving;\n this.eventService.dispatchEvent(this.createColumnEvent('movingChanged', source));\n }\n createColumnEvent(type, source) {\n return {\n type: type,\n column: this,\n columns: [this],\n source: source,\n api: this.gridOptionsService.api,\n columnApi: this.gridOptionsService.columnApi,\n context: this.gridOptionsService.context\n };\n }\n isMoving() {\n return this.moving;\n }\n /** If sorting is active, returns the sort direction e.g. `'asc'` or `'desc'`. */\n getSort() {\n return this.sort;\n }\n setSort(sort, source = \"api\") {\n if (this.sort !== sort) {\n this.sort = sort;\n this.eventService.dispatchEvent(this.createColumnEvent('sortChanged', source));\n }\n this.dispatchStateUpdatedEvent('sort');\n }\n setMenuVisible(visible, source = \"api\") {\n if (this.menuVisible !== visible) {\n this.menuVisible = visible;\n this.eventService.dispatchEvent(this.createColumnEvent('menuVisibleChanged', source));\n }\n }\n isMenuVisible() {\n return this.menuVisible;\n }\n isSortAscending() {\n return this.sort === 'asc';\n }\n isSortDescending() {\n return this.sort === 'desc';\n }\n isSortNone() {\n return missing(this.sort);\n }\n isSorting() {\n return exists(this.sort);\n }\n getSortIndex() {\n return this.sortIndex;\n }\n setSortIndex(sortOrder) {\n this.sortIndex = sortOrder;\n this.dispatchStateUpdatedEvent('sortIndex');\n }\n setAggFunc(aggFunc) {\n this.aggFunc = aggFunc;\n this.dispatchStateUpdatedEvent('aggFunc');\n }\n /** If aggregation is set for the column, returns the aggregation function. */\n getAggFunc() {\n return this.aggFunc;\n }\n getLeft() {\n return this.left;\n }\n getOldLeft() {\n return this.oldLeft;\n }\n getRight() {\n return this.left + this.actualWidth;\n }\n setLeft(left, source = \"api\") {\n this.oldLeft = this.left;\n if (this.left !== left) {\n this.left = left;\n this.eventService.dispatchEvent(this.createColumnEvent('leftChanged', source));\n }\n }\n /** Returns `true` if filter is active on the column. */\n isFilterActive() {\n return this.filterActive;\n }\n // additionalEventAttributes is used by provided simple floating filter, so it can add 'floatingFilter=true' to the event\n setFilterActive(active, source = \"api\", additionalEventAttributes) {\n if (this.filterActive !== active) {\n this.filterActive = active;\n this.eventService.dispatchEvent(this.createColumnEvent('filterActiveChanged', source));\n }\n const filterChangedEvent = this.createColumnEvent('filterChanged', source);\n if (additionalEventAttributes) {\n mergeDeep(filterChangedEvent, additionalEventAttributes);\n }\n this.eventService.dispatchEvent(filterChangedEvent);\n }\n /** Returns `true` when this `Column` is hovered, otherwise `false` */\n isHovered() {\n return this.columnHoverService.isHovered(this);\n }\n setPinned(pinned) {\n if (pinned === true || pinned === 'left') {\n this.pinned = 'left';\n } else if (pinned === 'right') {\n this.pinned = 'right';\n } else {\n this.pinned = null;\n }\n this.dispatchStateUpdatedEvent('pinned');\n }\n setFirstRightPinned(firstRightPinned, source = \"api\") {\n if (this.firstRightPinned !== firstRightPinned) {\n this.firstRightPinned = firstRightPinned;\n this.eventService.dispatchEvent(this.createColumnEvent('firstRightPinnedChanged', source));\n }\n }\n setLastLeftPinned(lastLeftPinned, source = \"api\") {\n if (this.lastLeftPinned !== lastLeftPinned) {\n this.lastLeftPinned = lastLeftPinned;\n this.eventService.dispatchEvent(this.createColumnEvent('lastLeftPinnedChanged', source));\n }\n }\n isFirstRightPinned() {\n return this.firstRightPinned;\n }\n isLastLeftPinned() {\n return this.lastLeftPinned;\n }\n isPinned() {\n return this.pinned === 'left' || this.pinned === 'right';\n }\n isPinnedLeft() {\n return this.pinned === 'left';\n }\n isPinnedRight() {\n return this.pinned === 'right';\n }\n getPinned() {\n return this.pinned;\n }\n setVisible(visible, source = \"api\") {\n const newValue = visible === true;\n if (this.visible !== newValue) {\n this.visible = newValue;\n this.eventService.dispatchEvent(this.createColumnEvent('visibleChanged', source));\n }\n this.dispatchStateUpdatedEvent('hide');\n }\n isVisible() {\n return this.visible;\n }\n isSpanHeaderHeight() {\n const colDef = this.getColDef();\n return !colDef.suppressSpanHeaderHeight && !colDef.autoHeaderHeight;\n }\n /** Returns the column definition for this column.\n * The column definition will be the result of merging the application provided column definition with any provided defaults\n * (e.g. `defaultColDef` grid option, or column types.\n *\n * Equivalent: `getDefinition` */\n getColDef() {\n return this.colDef;\n }\n getColumnGroupShow() {\n return this.colDef.columnGroupShow;\n }\n /**\n * Returns the unique ID for the column.\n *\n * Equivalent: `getId`, `getUniqueId` */\n getColId() {\n return this.colId;\n }\n /**\n * Returns the unique ID for the column.\n *\n * Equivalent: `getColId`, `getUniqueId` */\n getId() {\n return this.colId;\n }\n /**\n * Returns the unique ID for the column.\n *\n * Equivalent: `getColId`, `getId` */\n getUniqueId() {\n return this.colId;\n }\n getDefinition() {\n return this.colDef;\n }\n /** Returns the current width of the column. If the column is resized, the actual width is the new size. */\n getActualWidth() {\n return this.actualWidth;\n }\n getAutoHeaderHeight() {\n return this.autoHeaderHeight;\n }\n /** Returns true if the header height has changed */\n setAutoHeaderHeight(height) {\n const changed = height !== this.autoHeaderHeight;\n this.autoHeaderHeight = height;\n return changed;\n }\n createBaseColDefParams(rowNode) {\n const params = {\n node: rowNode,\n data: rowNode.data,\n colDef: this.colDef,\n column: this,\n api: this.gridOptionsService.api,\n columnApi: this.gridOptionsService.columnApi,\n context: this.gridOptionsService.context\n };\n return params;\n }\n getColSpan(rowNode) {\n if (missing(this.colDef.colSpan)) {\n return 1;\n }\n const params = this.createBaseColDefParams(rowNode);\n const colSpan = this.colDef.colSpan(params);\n // colSpan must be number equal to or greater than 1\n return Math.max(colSpan, 1);\n }\n getRowSpan(rowNode) {\n if (missing(this.colDef.rowSpan)) {\n return 1;\n }\n const params = this.createBaseColDefParams(rowNode);\n const rowSpan = this.colDef.rowSpan(params);\n // rowSpan must be number equal to or greater than 1\n return Math.max(rowSpan, 1);\n }\n setActualWidth(actualWidth, source = \"api\", silent = false) {\n if (this.minWidth != null) {\n actualWidth = Math.max(actualWidth, this.minWidth);\n }\n if (this.maxWidth != null) {\n actualWidth = Math.min(actualWidth, this.maxWidth);\n }\n if (this.actualWidth !== actualWidth) {\n // disable flex for this column if it was manually resized.\n this.actualWidth = actualWidth;\n if (this.flex && source !== 'flex' && source !== 'gridInitializing') {\n this.flex = null;\n }\n if (!silent) {\n this.fireColumnWidthChangedEvent(source);\n }\n }\n this.dispatchStateUpdatedEvent('width');\n }\n fireColumnWidthChangedEvent(source) {\n this.eventService.dispatchEvent(this.createColumnEvent('widthChanged', source));\n }\n isGreaterThanMax(width) {\n if (this.maxWidth != null) {\n return width > this.maxWidth;\n }\n return false;\n }\n getMinWidth() {\n return this.minWidth;\n }\n getMaxWidth() {\n return this.maxWidth;\n }\n getFlex() {\n return this.flex || 0;\n }\n // this method should only be used by the columnModel to\n // change flex when required by the applyColumnState method.\n setFlex(flex) {\n if (this.flex !== flex) {\n this.flex = flex;\n }\n this.dispatchStateUpdatedEvent('flex');\n }\n setMinimum(source = \"api\") {\n if (exists(this.minWidth)) {\n this.setActualWidth(this.minWidth, source);\n }\n }\n setRowGroupActive(rowGroup, source = \"api\") {\n if (this.rowGroupActive !== rowGroup) {\n this.rowGroupActive = rowGroup;\n this.eventService.dispatchEvent(this.createColumnEvent('columnRowGroupChanged', source));\n }\n this.dispatchStateUpdatedEvent('rowGroup');\n }\n /** Returns `true` if row group is currently active for this column. */\n isRowGroupActive() {\n return this.rowGroupActive;\n }\n setPivotActive(pivot, source = \"api\") {\n if (this.pivotActive !== pivot) {\n this.pivotActive = pivot;\n this.eventService.dispatchEvent(this.createColumnEvent('columnPivotChanged', source));\n }\n this.dispatchStateUpdatedEvent('pivot');\n }\n /** Returns `true` if pivot is currently active for this column. */\n isPivotActive() {\n return this.pivotActive;\n }\n isAnyFunctionActive() {\n return this.isPivotActive() || this.isRowGroupActive() || this.isValueActive();\n }\n isAnyFunctionAllowed() {\n return this.isAllowPivot() || this.isAllowRowGroup() || this.isAllowValue();\n }\n setValueActive(value, source = \"api\") {\n if (this.aggregationActive !== value) {\n this.aggregationActive = value;\n this.eventService.dispatchEvent(this.createColumnEvent('columnValueChanged', source));\n }\n }\n /** Returns `true` if value (aggregation) is currently active for this column. */\n isValueActive() {\n return this.aggregationActive;\n }\n isAllowPivot() {\n return this.colDef.enablePivot === true;\n }\n isAllowValue() {\n return this.colDef.enableValue === true;\n }\n isAllowRowGroup() {\n return this.colDef.enableRowGroup === true;\n }\n getMenuTabs(defaultValues) {\n let menuTabs = this.getColDef().menuTabs;\n if (menuTabs == null) {\n menuTabs = defaultValues;\n }\n return menuTabs;\n }\n dispatchStateUpdatedEvent(key) {\n this.eventService.dispatchEvent({\n type: Column.EVENT_STATE_UPDATED,\n key\n });\n }\n}\n// + renderedHeaderCell - for making header cell transparent when moving\nColumn.EVENT_MOVING_CHANGED = 'movingChanged';\n// + renderedCell - changing left position\nColumn.EVENT_LEFT_CHANGED = 'leftChanged';\n// + renderedCell - changing width\nColumn.EVENT_WIDTH_CHANGED = 'widthChanged';\n// + renderedCell - for changing pinned classes\nColumn.EVENT_LAST_LEFT_PINNED_CHANGED = 'lastLeftPinnedChanged';\nColumn.EVENT_FIRST_RIGHT_PINNED_CHANGED = 'firstRightPinnedChanged';\n// + renderedColumn - for changing visibility icon\nColumn.EVENT_VISIBLE_CHANGED = 'visibleChanged';\n// + every time the filter changes, used in the floating filters\nColumn.EVENT_FILTER_CHANGED = 'filterChanged';\n// + renderedHeaderCell - marks the header with filter icon\nColumn.EVENT_FILTER_ACTIVE_CHANGED = 'filterActiveChanged';\n// + renderedHeaderCell - marks the header with sort icon\nColumn.EVENT_SORT_CHANGED = 'sortChanged';\n// + renderedHeaderCell - marks the header with sort icon\nColumn.EVENT_COL_DEF_CHANGED = 'colDefChanged';\nColumn.EVENT_MENU_VISIBLE_CHANGED = 'menuVisibleChanged';\n// + toolpanel, for gui updates\nColumn.EVENT_ROW_GROUP_CHANGED = 'columnRowGroupChanged';\n// + toolpanel, for gui updates\nColumn.EVENT_PIVOT_CHANGED = 'columnPivotChanged';\n// + toolpanel, for gui updates\nColumn.EVENT_VALUE_CHANGED = 'columnValueChanged';\n// + dataTypeService - when waiting to infer cell data types\nColumn.EVENT_STATE_UPDATED = 'columnStateUpdated';\n__decorate([Autowired('gridOptionsService')], Column.prototype, \"gridOptionsService\", void 0);\n__decorate([Autowired('columnUtils')], Column.prototype, \"columnUtils\", void 0);\n__decorate([Autowired('columnHoverService')], Column.prototype, \"columnHoverService\", void 0);\n__decorate([PostConstruct], Column.prototype, \"initialise\", null);","var __decorate = this && this.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Column, getNextColInstanceId } from \"./column.mjs\";\nimport { EventService } from \"../eventService.mjs\";\nimport { PreDestroy } from \"../context/context.mjs\";\nexport class ProvidedColumnGroup {\n constructor(colGroupDef, groupId, padding, level) {\n this.localEventService = new EventService();\n this.expandable = false;\n // used by React (and possibly other frameworks) as key for rendering. also used to\n // identify old vs new columns for destroying cols when no longer used.\n this.instanceId = getNextColInstanceId();\n this.expandableListenerRemoveCallback = null;\n this.colGroupDef = colGroupDef;\n this.groupId = groupId;\n this.expanded = !!colGroupDef && !!colGroupDef.openByDefault;\n this.padding = padding;\n this.level = level;\n }\n destroy() {\n if (this.expandableListenerRemoveCallback) {\n this.reset(null, undefined);\n }\n }\n reset(colGroupDef, level) {\n this.colGroupDef = colGroupDef;\n this.level = level;\n this.originalParent = null;\n if (this.expandableListenerRemoveCallback) {\n this.expandableListenerRemoveCallback();\n }\n // we use ! below, as we want to set the object back to the\n // way it was when it was first created\n this.children = undefined;\n this.expandable = undefined;\n }\n getInstanceId() {\n return this.instanceId;\n }\n setOriginalParent(originalParent) {\n this.originalParent = originalParent;\n }\n getOriginalParent() {\n return this.originalParent;\n }\n getLevel() {\n return this.level;\n }\n isVisible() {\n // return true if at least one child is visible\n if (this.children) {\n return this.children.some(child => child.isVisible());\n }\n return false;\n }\n isPadding() {\n return this.padding;\n }\n setExpanded(expanded) {\n this.expanded = expanded === undefined ? false : expanded;\n const event = {\n type: ProvidedColumnGroup.EVENT_EXPANDED_CHANGED\n };\n this.localEventService.dispatchEvent(event);\n }\n isExpandable() {\n return this.expandable;\n }\n isExpanded() {\n return this.expanded;\n }\n getGroupId() {\n return this.groupId;\n }\n getId() {\n return this.getGroupId();\n }\n setChildren(children) {\n this.children = children;\n }\n getChildren() {\n return this.children;\n }\n getColGroupDef() {\n return this.colGroupDef;\n }\n getLeafColumns() {\n const result = [];\n this.addLeafColumns(result);\n return result;\n }\n addLeafColumns(leafColumns) {\n if (!this.children) {\n return;\n }\n this.children.forEach(child => {\n if (child instanceof Column) {\n leafColumns.push(child);\n } else if (child instanceof ProvidedColumnGroup) {\n child.addLeafColumns(leafColumns);\n }\n });\n }\n getColumnGroupShow() {\n const colGroupDef = this.colGroupDef;\n if (!colGroupDef) {\n return;\n }\n return colGroupDef.columnGroupShow;\n }\n // need to check that this group has at least one col showing when both expanded and contracted.\n // if not, then we don't allow expanding and contracting on this group\n setupExpandable() {\n this.setExpandable();\n if (this.expandableListenerRemoveCallback) {\n this.expandableListenerRemoveCallback();\n }\n const listener = this.onColumnVisibilityChanged.bind(this);\n this.getLeafColumns().forEach(col => col.addEventListener('visibleChanged', listener));\n this.expandableListenerRemoveCallback = () => {\n this.getLeafColumns().forEach(col => col.removeEventListener('visibleChanged', listener));\n this.expandableListenerRemoveCallback = null;\n };\n }\n setExpandable() {\n if (this.isPadding()) {\n return;\n }\n // want to make sure the group doesn't disappear when it's open\n let atLeastOneShowingWhenOpen = false;\n // want to make sure the group doesn't disappear when it's closed\n let atLeastOneShowingWhenClosed = false;\n // want to make sure the group has something to show / hide\n let atLeastOneChangeable = false;\n const children = this.findChildrenRemovingPadding();\n for (let i = 0, j = children.length; i < j; i++) {\n const abstractColumn = children[i];\n if (!abstractColumn.isVisible()) {\n continue;\n }\n // if the abstractColumn is a grid generated group, there will be no colDef\n const headerGroupShow = abstractColumn.getColumnGroupShow();\n if (headerGroupShow === 'open') {\n atLeastOneShowingWhenOpen = true;\n atLeastOneChangeable = true;\n } else if (headerGroupShow === 'closed') {\n atLeastOneShowingWhenClosed = true;\n atLeastOneChangeable = true;\n } else {\n atLeastOneShowingWhenOpen = true;\n atLeastOneShowingWhenClosed = true;\n }\n }\n const expandable = atLeastOneShowingWhenOpen && atLeastOneShowingWhenClosed && atLeastOneChangeable;\n if (this.expandable !== expandable) {\n this.expandable = expandable;\n const event = {\n type: ProvidedColumnGroup.EVENT_EXPANDABLE_CHANGED\n };\n this.localEventService.dispatchEvent(event);\n }\n }\n findChildrenRemovingPadding() {\n const res = [];\n const process = items => {\n items.forEach(item => {\n // if padding, we add this children instead of the padding\n const skipBecausePadding = item instanceof ProvidedColumnGroup && item.isPadding();\n if (skipBecausePadding) {\n process(item.children);\n } else {\n res.push(item);\n }\n });\n };\n process(this.children);\n return res;\n }\n onColumnVisibilityChanged() {\n this.setExpandable();\n }\n addEventListener(eventType, listener) {\n this.localEventService.addEventListener(eventType, listener);\n }\n removeEventListener(eventType, listener) {\n this.localEventService.removeEventListener(eventType, listener);\n }\n}\nProvidedColumnGroup.EVENT_EXPANDED_CHANGED = 'expandedChanged';\nProvidedColumnGroup.EVENT_EXPANDABLE_CHANGED = 'expandableChanged';\n__decorate([PreDestroy], ProvidedColumnGroup.prototype, \"destroy\", null);","export const DefaultColumnTypes = {\n numericColumn: {\n headerClass: 'ag-right-aligned-header',\n cellClass: 'ag-right-aligned-cell'\n },\n rightAligned: {\n headerClass: 'ag-right-aligned-header',\n cellClass: 'ag-right-aligned-cell'\n }\n};","import { includes } from './array.mjs';\nconst AG_GRID_STOP_PROPAGATION = '__ag_Grid_Stop_Propagation';\nconst PASSIVE_EVENTS = ['touchstart', 'touchend', 'touchmove', 'touchcancel', 'scroll'];\nconst supports = {};\n/**\n * a user once raised an issue - they said that when you opened a popup (eg context menu)\n * and then clicked on a selection checkbox, the popup wasn't closed. this is because the\n * popup listens for clicks on the body, however ag-grid WAS stopping propagation on the\n * checkbox clicks (so the rows didn't pick them up as row selection selection clicks).\n * to get around this, we have a pattern to stop propagation for the purposes of AG Grid,\n * but we still let the event pass back to the body.\n * @param {Event} event\n */\nexport function stopPropagationForAgGrid(event) {\n event[AG_GRID_STOP_PROPAGATION] = true;\n}\nexport function isStopPropagationForAgGrid(event) {\n return event[AG_GRID_STOP_PROPAGATION] === true;\n}\nexport const isEventSupported = (() => {\n const tags = {\n select: 'input',\n change: 'input',\n submit: 'form',\n reset: 'form',\n error: 'img',\n load: 'img',\n abort: 'img'\n };\n const eventChecker = eventName => {\n if (typeof supports[eventName] === 'boolean') {\n return supports[eventName];\n }\n const el = document.createElement(tags[eventName] || 'div');\n eventName = 'on' + eventName;\n return supports[eventName] = eventName in el;\n };\n return eventChecker;\n})();\nexport function getCtrlForEventTarget(gridOptionsService, eventTarget, type) {\n let sourceElement = eventTarget;\n while (sourceElement) {\n const renderedComp = gridOptionsService.getDomData(sourceElement, type);\n if (renderedComp) {\n return renderedComp;\n }\n sourceElement = sourceElement.parentElement;\n }\n return null;\n}\nexport function isElementInEventPath(element, event) {\n if (!event || !element) {\n return false;\n }\n return getEventPath(event).indexOf(element) >= 0;\n}\nexport function createEventPath(event) {\n const res = [];\n let pointer = event.target;\n while (pointer) {\n res.push(pointer);\n pointer = pointer.parentElement;\n }\n return res;\n}\n/**\n * Gets the path for a browser Event or from the target on an AG Grid Event\n * https://developer.mozilla.org/en-US/docs/Web/API/Event\n * @param {Event| { target: EventTarget }} event\n * @returns {EventTarget[]}\n */\nexport function getEventPath(event) {\n // This can be called with either a browser event or an AG Grid Event that has a target property.\n const eventNoType = event;\n if (eventNoType.path) {\n return eventNoType.path;\n }\n if (eventNoType.composedPath) {\n return eventNoType.composedPath();\n }\n // If this is an AG Grid event build the path ourselves\n return createEventPath(eventNoType);\n}\nexport function addSafePassiveEventListener(frameworkOverrides, eElement, event, listener) {\n const isPassive = includes(PASSIVE_EVENTS, event);\n const options = isPassive ? {\n passive: true\n } : undefined;\n // this check is here for certain scenarios where I believe the user must be destroying\n // the grid somehow but continuing for it to be used\n if (frameworkOverrides && frameworkOverrides.addEventListener) {\n frameworkOverrides.addEventListener(eElement, event, listener, options);\n }\n}","import { exists, toStringOrNull } from './generic.mjs';\nexport function firstExistingValue(...values) {\n for (let i = 0; i < values.length; i++) {\n const value = values[i];\n if (exists(value)) {\n return value;\n }\n }\n return null;\n}\nexport function existsAndNotEmpty(value) {\n return value != null && value.length > 0;\n}\nexport function last(arr) {\n if (!arr || !arr.length) {\n return;\n }\n return arr[arr.length - 1];\n}\nexport function areEqual(a, b, comparator) {\n if (a == null && b == null) {\n return true;\n }\n return a != null && b != null && a.length === b.length && a.every((value, index) => comparator ? comparator(value, b[index]) : b[index] === value);\n}\n/** @deprecated */\nexport function shallowCompare(arr1, arr2) {\n return areEqual(arr1, arr2);\n}\nexport function sortNumerically(array) {\n return array.sort((a, b) => a - b);\n}\nexport function removeRepeatsFromArray(array, object) {\n if (!array) {\n return;\n }\n for (let index = array.length - 2; index >= 0; index--) {\n const thisOneMatches = array[index] === object;\n const nextOneMatches = array[index + 1] === object;\n if (thisOneMatches && nextOneMatches) {\n array.splice(index + 1, 1);\n }\n }\n}\nexport function removeFromUnorderedArray(array, object) {\n const index = array.indexOf(object);\n if (index >= 0) {\n // preserve the last element, then shorten array length by 1 to delete index\n array[index] = array[array.length - 1];\n array.pop();\n }\n}\nexport function removeFromArray(array, object) {\n const index = array.indexOf(object);\n if (index >= 0) {\n array.splice(index, 1);\n }\n}\nexport function removeAllFromUnorderedArray(array, toRemove) {\n for (let i = 0; i < toRemove.length; i++) {\n removeFromUnorderedArray(array, toRemove[i]);\n }\n}\nexport function removeAllFromArray(array, toRemove) {\n for (let i = 0; i < toRemove.length; i++) {\n removeFromArray(array, toRemove[i]);\n }\n}\nexport function insertIntoArray(array, object, toIndex) {\n array.splice(toIndex, 0, object);\n}\nexport function insertArrayIntoArray(dest, src, toIndex) {\n if (dest == null || src == null) {\n return;\n }\n // put items in backwards, otherwise inserted items end up in reverse order\n for (let i = src.length - 1; i >= 0; i--) {\n const item = src[i];\n insertIntoArray(dest, item, toIndex);\n }\n}\nexport function moveInArray(array, objectsToMove, toIndex) {\n // first take out items from the array\n removeAllFromArray(array, objectsToMove);\n // now add the objects, in same order as provided to us, that means we start at the end\n // as the objects will be pushed to the right as they are inserted\n objectsToMove.slice().reverse().forEach(obj => insertIntoArray(array, obj, toIndex));\n}\nexport function includes(array, value) {\n return array.indexOf(value) > -1;\n}\nexport function flatten(arrayOfArrays) {\n return [].concat.apply([], arrayOfArrays);\n}\nexport function pushAll(target, source) {\n if (source == null || target == null) {\n return;\n }\n source.forEach(value => target.push(value));\n}\nexport function toStrings(array) {\n return array.map(toStringOrNull);\n}\nexport function forEachReverse(list, action) {\n if (list == null) {\n return;\n }\n for (let i = list.length - 1; i >= 0; i--) {\n action(list[i], i);\n }\n}","var __decorate = this && this.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { EventService } from \"../eventService.mjs\";\nimport { Autowired, PreDestroy } from \"./context.mjs\";\nimport { addSafePassiveEventListener } from \"../utils/event.mjs\";\nexport class BeanStub {\n constructor() {\n this.destroyFunctions = [];\n this.destroyed = false;\n // for vue 3 - prevents Vue from trying to make this (and obviously any sub classes) from being reactive\n // prevents vue from creating proxies for created objects and prevents identity related issues\n this.__v_skip = true;\n this.isAlive = () => !this.destroyed;\n }\n // this was a test constructor niall built, when active, it prints after 5 seconds all beans/components that are\n // not destroyed. to use, create a new grid, then api.destroy() before 5 seconds. then anything that gets printed\n // points to a bean or component that was not properly disposed of.\n // constructor() {\n // setTimeout(()=> {\n // if (this.isAlive()) {\n // let prototype: any = Object.getPrototypeOf(this);\n // const constructor: any = prototype.constructor;\n // const constructorString = constructor.toString();\n // const beanName = constructorString.substring(9, constructorString.indexOf(\"(\"));\n // console.log('is alive ' + beanName);\n // }\n // }, 5000);\n // }\n // CellComp and GridComp and override this because they get the FrameworkOverrides from the Beans bean\n getFrameworkOverrides() {\n return this.frameworkOverrides;\n }\n getContext() {\n return this.context;\n }\n destroy() {\n // let prototype: any = Object.getPrototypeOf(this);\n // const constructor: any = prototype.constructor;\n // const constructorString = constructor.toString();\n // const beanName = constructorString.substring(9, constructorString.indexOf(\"(\"));\n this.destroyFunctions.forEach(func => func());\n this.destroyFunctions.length = 0;\n this.destroyed = true;\n this.dispatchEvent({\n type: BeanStub.EVENT_DESTROYED\n });\n }\n addEventListener(eventType, listener) {\n if (!this.localEventService) {\n this.localEventService = new EventService();\n }\n this.localEventService.addEventListener(eventType, listener);\n }\n removeEventListener(eventType, listener) {\n if (this.localEventService) {\n this.localEventService.removeEventListener(eventType, listener);\n }\n }\n dispatchEventAsync(event) {\n window.setTimeout(() => this.dispatchEvent(event), 0);\n }\n dispatchEvent(event) {\n if (this.localEventService) {\n this.localEventService.dispatchEvent(event);\n }\n }\n addManagedListener(object, event, listener) {\n if (this.destroyed) {\n return;\n }\n if (object instanceof HTMLElement) {\n addSafePassiveEventListener(this.getFrameworkOverrides(), object, event, listener);\n } else {\n object.addEventListener(event, listener);\n }\n const destroyFunc = () => {\n object.removeEventListener(event, listener);\n this.destroyFunctions = this.destroyFunctions.filter(fn => fn !== destroyFunc);\n return null;\n };\n this.destroyFunctions.push(destroyFunc);\n return destroyFunc;\n }\n addManagedPropertyListener(event, listener) {\n if (this.destroyed) {\n return;\n }\n this.gridOptionsService.addEventListener(event, listener);\n const destroyFunc = () => {\n this.gridOptionsService.removeEventListener(event, listener);\n this.destroyFunctions = this.destroyFunctions.filter(fn => fn !== destroyFunc);\n return null;\n };\n this.destroyFunctions.push(destroyFunc);\n return destroyFunc;\n }\n addDestroyFunc(func) {\n // if we are already destroyed, we execute the func now\n if (this.isAlive()) {\n this.destroyFunctions.push(func);\n } else {\n func();\n }\n }\n createManagedBean(bean, context) {\n const res = this.createBean(bean, context);\n this.addDestroyFunc(this.destroyBean.bind(this, bean, context));\n return res;\n }\n createBean(bean, context, afterPreCreateCallback) {\n return (context || this.getContext()).createBean(bean, afterPreCreateCallback);\n }\n destroyBean(bean, context) {\n return (context || this.getContext()).destroyBean(bean);\n }\n destroyBeans(beans, context) {\n if (beans) {\n beans.forEach(bean => this.destroyBean(bean, context));\n }\n return [];\n }\n}\nBeanStub.EVENT_DESTROYED = 'destroyed';\n__decorate([Autowired('frameworkOverrides')], BeanStub.prototype, \"frameworkOverrides\", void 0);\n__decorate([Autowired('context')], BeanStub.prototype, \"context\", void 0);\n__decorate([Autowired('eventService')], BeanStub.prototype, \"eventService\", void 0);\n__decorate([Autowired('gridOptionsService')], BeanStub.prototype, \"gridOptionsService\", void 0);\n__decorate([Autowired('localeService')], BeanStub.prototype, \"localeService\", void 0);\n__decorate([Autowired('environment')], BeanStub.prototype, \"environment\", void 0);\n__decorate([PreDestroy], BeanStub.prototype, \"destroy\", null);","var __decorate = this && this.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = this && this.__param || function (paramIndex, decorator) {\n return function (target, key) {\n decorator(target, key, paramIndex);\n };\n};\nimport { ColumnKeyCreator } from \"./columnKeyCreator.mjs\";\nimport { ProvidedColumnGroup } from \"../entities/providedColumnGroup.mjs\";\nimport { Column } from \"../entities/column.mjs\";\nimport { Autowired, Bean, Qualifier } from \"../context/context.mjs\";\nimport { DefaultColumnTypes } from \"../entities/defaultColumnTypes.mjs\";\nimport { BeanStub } from \"../context/beanStub.mjs\";\nimport { iterateObject, mergeDeep } from '../utils/object.mjs';\nimport { attrToNumber, attrToBoolean } from '../utils/generic.mjs';\nimport { removeFromArray } from '../utils/array.mjs';\n// takes ColDefs and ColGroupDefs and turns them into Columns and OriginalGroups\nlet ColumnFactory = class ColumnFactory extends BeanStub {\n setBeans(loggerFactory) {\n this.logger = loggerFactory.create('ColumnFactory');\n }\n createColumnTree(defs, primaryColumns, existingTree) {\n // column key creator dishes out unique column id's in a deterministic way,\n // so if we have two grids (that could be master/slave) with same column definitions,\n // then this ensures the two grids use identical id's.\n const columnKeyCreator = new ColumnKeyCreator();\n const {\n existingCols,\n existingGroups,\n existingColKeys\n } = this.extractExistingTreeData(existingTree);\n columnKeyCreator.addExistingKeys(existingColKeys);\n // create am unbalanced tree that maps the provided definitions\n const unbalancedTree = this.recursivelyCreateColumns(defs, 0, primaryColumns, existingCols, columnKeyCreator, existingGroups);\n const treeDept = this.findMaxDept(unbalancedTree, 0);\n this.logger.log('Number of levels for grouped columns is ' + treeDept);\n const columnTree = this.balanceColumnTree(unbalancedTree, 0, treeDept, columnKeyCreator);\n const deptFirstCallback = (child, parent) => {\n if (child instanceof ProvidedColumnGroup) {\n child.setupExpandable();\n }\n // we set the original parents at the end, rather than when we go along, as balancing the tree\n // adds extra levels into the tree. so we can only set parents when balancing is done.\n child.setOriginalParent(parent);\n };\n this.columnUtils.depthFirstOriginalTreeSearch(null, columnTree, deptFirstCallback);\n return {\n columnTree,\n treeDept\n };\n }\n extractExistingTreeData(existingTree) {\n const existingCols = [];\n const existingGroups = [];\n const existingColKeys = [];\n if (existingTree) {\n this.columnUtils.depthFirstOriginalTreeSearch(null, existingTree, item => {\n if (item instanceof ProvidedColumnGroup) {\n const group = item;\n existingGroups.push(group);\n } else {\n const col = item;\n existingColKeys.push(col.getId());\n existingCols.push(col);\n }\n });\n }\n return {\n existingCols,\n existingGroups,\n existingColKeys\n };\n }\n createForAutoGroups(autoGroupCols, gridBalancedTree) {\n return autoGroupCols.map(col => this.createAutoGroupTreeItem(gridBalancedTree, col));\n }\n createAutoGroupTreeItem(balancedColumnTree, column) {\n const dept = this.findDepth(balancedColumnTree);\n // at the end, this will be the top of the tree item.\n let nextChild = column;\n for (let i = dept - 1; i >= 0; i--) {\n const autoGroup = new ProvidedColumnGroup(null, `FAKE_PATH_${column.getId()}}_${i}`, true, i);\n this.createBean(autoGroup);\n autoGroup.setChildren([nextChild]);\n nextChild.setOriginalParent(autoGroup);\n nextChild = autoGroup;\n }\n if (dept === 0) {\n column.setOriginalParent(null);\n }\n // at this point, the nextChild is the top most item in the tree\n return nextChild;\n }\n findDepth(balancedColumnTree) {\n let dept = 0;\n let pointer = balancedColumnTree;\n while (pointer && pointer[0] && pointer[0] instanceof ProvidedColumnGroup) {\n dept++;\n pointer = pointer[0].getChildren();\n }\n return dept;\n }\n balanceColumnTree(unbalancedTree, currentDept, columnDept, columnKeyCreator) {\n const result = [];\n // go through each child, for groups, recurse a level deeper,\n // for columns we need to pad\n for (let i = 0; i < unbalancedTree.length; i++) {\n const child = unbalancedTree[i];\n if (child instanceof ProvidedColumnGroup) {\n // child is a group, all we do is go to the next level of recursion\n const originalGroup = child;\n const newChildren = this.balanceColumnTree(originalGroup.getChildren(), currentDept + 1, columnDept, columnKeyCreator);\n originalGroup.setChildren(newChildren);\n result.push(originalGroup);\n } else {\n // child is a column - so here we add in the padded column groups if needed\n let firstPaddedGroup;\n let currentPaddedGroup;\n // this for loop will NOT run any loops if no padded column groups are needed\n for (let j = columnDept - 1; j >= currentDept; j--) {\n const newColId = columnKeyCreator.getUniqueKey(null, null);\n const colGroupDefMerged = this.createMergedColGroupDef(null);\n const paddedGroup = new ProvidedColumnGroup(colGroupDefMerged, newColId, true, currentDept);\n this.createBean(paddedGroup);\n if (currentPaddedGroup) {\n currentPaddedGroup.setChildren([paddedGroup]);\n }\n currentPaddedGroup = paddedGroup;\n if (!firstPaddedGroup) {\n firstPaddedGroup = currentPaddedGroup;\n }\n }\n // likewise this if statement will not run if no padded groups\n if (firstPaddedGroup && currentPaddedGroup) {\n result.push(firstPaddedGroup);\n const hasGroups = unbalancedTree.some(leaf => leaf instanceof ProvidedColumnGroup);\n if (hasGroups) {\n currentPaddedGroup.setChildren([child]);\n continue;\n } else {\n currentPaddedGroup.setChildren(unbalancedTree);\n break;\n }\n }\n result.push(child);\n }\n }\n return result;\n }\n findMaxDept(treeChildren, dept) {\n let maxDeptThisLevel = dept;\n for (let i = 0; i < treeChildren.length; i++) {\n const abstractColumn = treeChildren[i];\n if (abstractColumn instanceof ProvidedColumnGroup) {\n const originalGroup = abstractColumn;\n const newDept = this.findMaxDept(originalGroup.getChildren(), dept + 1);\n if (maxDeptThisLevel < newDept) {\n maxDeptThisLevel = newDept;\n }\n }\n }\n return maxDeptThisLevel;\n }\n recursivelyCreateColumns(defs, level, primaryColumns, existingColsCopy, columnKeyCreator, existingGroups) {\n if (!defs) return [];\n const result = new Array(defs.length);\n for (let i = 0; i < result.length; i++) {\n const def = defs[i];\n if (this.isColumnGroup(def)) {\n result[i] = this.createColumnGroup(primaryColumns, def, level, existingColsCopy, columnKeyCreator, existingGroups);\n } else {\n result[i] = this.createColumn(primaryColumns, def, existingColsCopy, columnKeyCreator);\n }\n }\n return result;\n }\n createColumnGroup(primaryColumns, colGroupDef, level, existingColumns, columnKeyCreator, existingGroups) {\n const colGroupDefMerged = this.createMergedColGroupDef(colGroupDef);\n const groupId = columnKeyCreator.getUniqueKey(colGroupDefMerged.groupId || null, null);\n const providedGroup = new ProvidedColumnGroup(colGroupDefMerged, groupId, false, level);\n this.createBean(providedGroup);\n const existingGroup = this.findExistingGroup(colGroupDef, existingGroups);\n // make sure we remove, so if user provided duplicate id, then we don't have more than\n // one column instance for colDef with common id\n if (existingGroup) {\n removeFromArray(existingGroups, existingGroup);\n }\n if (existingGroup && existingGroup.isExpanded()) {\n providedGroup.setExpanded(true);\n }\n const children = this.recursivelyCreateColumns(colGroupDefMerged.children, level + 1, primaryColumns, existingColumns, columnKeyCreator, existingGroups);\n providedGroup.setChildren(children);\n return providedGroup;\n }\n createMergedColGroupDef(colGroupDef) {\n const colGroupDefMerged = {};\n Object.assign(colGroupDefMerged, this.gridOptionsService.get('defaultColGroupDef'));\n Object.assign(colGroupDefMerged, colGroupDef);\n return colGroupDefMerged;\n }\n createColumn(primaryColumns, colDef, existingColsCopy, columnKeyCreator) {\n // see if column already exists\n let column = this.findExistingColumn(colDef, existingColsCopy);\n // make sure we remove, so if user provided duplicate id, then we don't have more than\n // one column instance for colDef with common id\n if (existingColsCopy && column) {\n removeFromArray(existingColsCopy, column);\n }\n if (!column) {\n // no existing column, need to create one\n const colId = columnKeyCreator.getUniqueKey(colDef.colId, colDef.field);\n const colDefMerged = this.addColumnDefaultAndTypes(colDef, colId);\n column = new Column(colDefMerged, colDef, colId, primaryColumns);\n this.context.createBean(column);\n } else {\n const colDefMerged = this.addColumnDefaultAndTypes(colDef, column.getColId());\n column.setColDef(colDefMerged, colDef);\n this.applyColumnState(column, colDefMerged);\n }\n this.dataTypeService.addColumnListeners(column);\n return column;\n }\n applyColumnState(column, colDef) {\n // flex\n const flex = attrToNumber(colDef.flex);\n if (flex !== undefined) {\n column.setFlex(flex);\n }\n // width - we only set width if column is not flexing\n const noFlexThisCol = column.getFlex() <= 0;\n if (noFlexThisCol) {\n // both null and undefined means we skip, as it's not possible to 'clear' width (a column must have a width)\n const width = attrToNumber(colDef.width);\n if (width != null) {\n column.setActualWidth(width);\n } else {\n // otherwise set the width again, in case min or max width has changed,\n // and width needs to be adjusted.\n const widthBeforeUpdate = column.getActualWidth();\n column.setActualWidth(widthBeforeUpdate);\n }\n }\n // sort - anything but undefined will set sort, thus null or empty string will clear the sort\n if (colDef.sort !== undefined) {\n if (colDef.sort == 'asc' || colDef.sort == 'desc') {\n column.setSort(colDef.sort);\n } else {\n column.setSort(undefined);\n }\n }\n // sorted at - anything but undefined, thus null will clear the sortIndex\n const sortIndex = attrToNumber(colDef.sortIndex);\n if (sortIndex !== undefined) {\n column.setSortIndex(sortIndex);\n }\n // hide - anything but undefined, thus null will clear the hide\n const hide = attrToBoolean(colDef.hide);\n if (hide !== undefined) {\n column.setVisible(!hide);\n }\n // pinned - anything but undefined, thus null or empty string will remove pinned\n if (colDef.pinned !== undefined) {\n column.setPinned(colDef.pinned);\n }\n }\n findExistingColumn(newColDef, existingColsCopy) {\n if (!existingColsCopy) return undefined;\n for (let i = 0; i < existingColsCopy.length; i++) {\n const def = existingColsCopy[i].getUserProvidedColDef();\n if (!def) continue;\n const newHasId = newColDef.colId != null;\n if (newHasId) {\n if (existingColsCopy[i].getId() === newColDef.colId) {\n return existingColsCopy[i];\n }\n continue;\n }\n const newHasField = newColDef.field != null;\n if (newHasField) {\n if (def.field === newColDef.field) {\n return existingColsCopy[i];\n }\n continue;\n }\n if (def === newColDef) {\n return existingColsCopy[i];\n }\n }\n return undefined;\n }\n findExistingGroup(newGroupDef, existingGroups) {\n return existingGroups.find(existingGroup => {\n const existingDef = existingGroup.getColGroupDef();\n if (!existingDef) {\n return false;\n }\n const newHasId = newGroupDef.groupId != null;\n if (newHasId) {\n return existingGroup.getId() === newGroupDef.groupId;\n }\n return false;\n });\n }\n addColumnDefaultAndTypes(colDef, colId) {\n // start with empty merged definition\n const res = {};\n // merge properties from default column definitions\n const defaultColDef = this.gridOptionsService.get('defaultColDef');\n mergeDeep(res, defaultColDef, false, true);\n const columnType = this.dataTypeService.updateColDefAndGetColumnType(res, colDef, colId);\n if (columnType) {\n this.assignColumnTypes(columnType, res);\n }\n // merge properties from column definitions\n mergeDeep(res, colDef, false, true);\n const autoGroupColDef = this.gridOptionsService.get('autoGroupColumnDef');\n const isSortingCoupled = this.gridOptionsService.isColumnsSortingCoupledToGroup();\n if (colDef.rowGroup && autoGroupColDef && isSortingCoupled) {\n // override the sort for row group columns where the autoGroupColDef defines these values.\n mergeDeep(res, {\n sort: autoGroupColDef.sort,\n initialSort: autoGroupColDef.initialSort\n }, false, true);\n }\n this.dataTypeService.validateColDef(res);\n return res;\n }\n assignColumnTypes(typeKeys, colDefMerged) {\n if (!typeKeys.length) {\n return;\n }\n // merge user defined with default column types\n const allColumnTypes = Object.assign({}, DefaultColumnTypes);\n const userTypes = this.gridOptionsService.get('columnTypes') || {};\n iterateObject(userTypes, (key, value) => {\n if (key in allColumnTypes) {\n console.warn(`AG Grid: the column type '${key}' is a default column type and cannot be overridden.`);\n } else {\n allColumnTypes[key] = value;\n }\n });\n typeKeys.forEach(t => {\n const typeColDef = allColumnTypes[t.trim()];\n if (typeColDef) {\n mergeDeep(colDefMerged, typeColDef, false, true);\n } else {\n console.warn(\"AG Grid: colDef.type '\" + t + \"' does not correspond to defined gridOptions.columnTypes\");\n }\n });\n }\n // if object has children, we assume it's a group\n isColumnGroup(abstractColDef) {\n return abstractColDef.children !== undefined;\n }\n};\n__decorate([Autowired('columnUtils')], ColumnFactory.prototype, \"columnUtils\", void 0);\n__decorate([Autowired('dataTypeService')], ColumnFactory.prototype, \"dataTypeService\", void 0);\n__decorate([__param(0, Qualifier('loggerFactory'))], ColumnFactory.prototype, \"setBeans\", null);\nColumnFactory = __decorate([Bean('columnFactory')], ColumnFactory);\nexport { ColumnFactory };","var __decorate = this && this.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Column } from \"./column.mjs\";\nimport { EventService } from \"../eventService.mjs\";\nimport { Autowired } from \"../context/context.mjs\";\nimport { last } from \"../utils/array.mjs\";\nexport class ColumnGroup {\n constructor(providedColumnGroup, groupId, partId, pinned) {\n // depends on the open/closed state of the group, only displaying columns are stored here\n this.displayedChildren = [];\n this.localEventService = new EventService();\n this.groupId = groupId;\n this.partId = partId;\n this.providedColumnGroup = providedColumnGroup;\n this.pinned = pinned;\n }\n // this is static, a it is used outside of this class\n static createUniqueId(groupId, instanceId) {\n return groupId + '_' + instanceId;\n }\n // as the user is adding and removing columns, the groups are recalculated.\n // this reset clears out all children, ready for children to be added again\n reset() {\n this.parent = null;\n this.children = null;\n this.displayedChildren = null;\n }\n getParent() {\n return this.parent;\n }\n setParent(parent) {\n this.parent = parent;\n }\n getUniqueId() {\n return ColumnGroup.createUniqueId(this.groupId, this.partId);\n }\n isEmptyGroup() {\n return this.displayedChildren.length === 0;\n }\n isMoving() {\n const allLeafColumns = this.getProvidedColumnGroup().getLeafColumns();\n if (!allLeafColumns || allLeafColumns.length === 0) {\n return false;\n }\n return allLeafColumns.every(col => col.isMoving());\n }\n checkLeft() {\n // first get all children to setLeft, as it impacts our decision below\n this.displayedChildren.forEach(child => {\n if (child instanceof ColumnGroup) {\n child.checkLeft();\n }\n });\n // set our left based on first displayed column\n if (this.displayedChildren.length > 0) {\n if (this.gridOptionsService.is('enableRtl')) {\n const lastChild = last(this.displayedChildren);\n const lastChildLeft = lastChild.getLeft();\n this.setLeft(lastChildLeft);\n } else {\n const firstChildLeft = this.displayedChildren[0].getLeft();\n this.setLeft(firstChildLeft);\n }\n } else {\n // this should never happen, as if we have no displayed columns, then\n // this groups should not even exist.\n this.setLeft(null);\n }\n }\n getLeft() {\n return this.left;\n }\n getOldLeft() {\n return this.oldLeft;\n }\n setLeft(left) {\n this.oldLeft = left;\n if (this.left !== left) {\n this.left = left;\n this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_LEFT_CHANGED));\n }\n }\n getPinned() {\n return this.pinned;\n }\n createAgEvent(type) {\n return {\n type\n };\n }\n addEventListener(eventType, listener) {\n this.localEventService.addEventListener(eventType, listener);\n }\n removeEventListener(eventType, listener) {\n this.localEventService.removeEventListener(eventType, listener);\n }\n getGroupId() {\n return this.groupId;\n }\n getPartId() {\n return this.partId;\n }\n isChildInThisGroupDeepSearch(wantedChild) {\n let result = false;\n this.children.forEach(foundChild => {\n if (wantedChild === foundChild) {\n result = true;\n }\n if (foundChild instanceof ColumnGroup) {\n if (foundChild.isChildInThisGroupDeepSearch(wantedChild)) {\n result = true;\n }\n }\n });\n return result;\n }\n getActualWidth() {\n let groupActualWidth = 0;\n if (this.displayedChildren) {\n this.displayedChildren.forEach(child => {\n groupActualWidth += child.getActualWidth();\n });\n }\n return groupActualWidth;\n }\n isResizable() {\n if (!this.displayedChildren) {\n return false;\n }\n // if at least one child is resizable, then the group is resizable\n let result = false;\n this.displayedChildren.forEach(child => {\n if (child.isResizable()) {\n result = true;\n }\n });\n return result;\n }\n getMinWidth() {\n let result = 0;\n this.displayedChildren.forEach(groupChild => {\n result += groupChild.getMinWidth() || 0;\n });\n return result;\n }\n addChild(child) {\n if (!this.children) {\n this.children = [];\n }\n this.children.push(child);\n }\n getDisplayedChildren() {\n return this.displayedChildren;\n }\n getLeafColumns() {\n const result = [];\n this.addLeafColumns(result);\n return result;\n }\n getDisplayedLeafColumns() {\n const result = [];\n this.addDisplayedLeafColumns(result);\n return result;\n }\n getDefinition() {\n return this.providedColumnGroup.getColGroupDef();\n }\n getColGroupDef() {\n return this.providedColumnGroup.getColGroupDef();\n }\n isPadding() {\n return this.providedColumnGroup.isPadding();\n }\n isExpandable() {\n return this.providedColumnGroup.isExpandable();\n }\n isExpanded() {\n return this.providedColumnGroup.isExpanded();\n }\n setExpanded(expanded) {\n this.providedColumnGroup.setExpanded(expanded);\n }\n addDisplayedLeafColumns(leafColumns) {\n this.displayedChildren.forEach(child => {\n if (child instanceof Column) {\n leafColumns.push(child);\n } else if (child instanceof ColumnGroup) {\n child.addDisplayedLeafColumns(leafColumns);\n }\n });\n }\n addLeafColumns(leafColumns) {\n this.children.forEach(child => {\n if (child instanceof Column) {\n leafColumns.push(child);\n } else if (child instanceof ColumnGroup) {\n child.addLeafColumns(leafColumns);\n }\n });\n }\n getChildren() {\n return this.children;\n }\n getColumnGroupShow() {\n return this.providedColumnGroup.getColumnGroupShow();\n }\n getProvidedColumnGroup() {\n return this.providedColumnGroup;\n }\n getPaddingLevel() {\n const parent = this.getParent();\n if (!this.isPadding() || !parent || !parent.isPadding()) {\n return 0;\n }\n return 1 + parent.getPaddingLevel();\n }\n calculateDisplayedColumns() {\n // clear out last time we calculated\n this.displayedChildren = [];\n // find the column group that is controlling expandable. this is relevant when we have padding (empty)\n // groups, where the expandable is actually the first parent that is not a padding group.\n let parentWithExpansion = this;\n while (parentWithExpansion != null && parentWithExpansion.isPadding()) {\n parentWithExpansion = parentWithExpansion.getParent();\n }\n const isExpandable = parentWithExpansion ? parentWithExpansion.providedColumnGroup.isExpandable() : false;\n // it not expandable, everything is visible\n if (!isExpandable) {\n this.displayedChildren = this.children;\n this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED));\n return;\n }\n // Add cols based on columnGroupShow\n // Note - the below also adds padding groups, these are always added because they never have\n // colDef.columnGroupShow set.\n this.children.forEach(child => {\n // never add empty groups\n const emptyGroup = child instanceof ColumnGroup && (!child.displayedChildren || !child.displayedChildren.length);\n if (emptyGroup) {\n return;\n }\n const headerGroupShow = child.getColumnGroupShow();\n switch (headerGroupShow) {\n case 'open':\n // when set to open, only show col if group is open\n if (parentWithExpansion.providedColumnGroup.isExpanded()) {\n this.displayedChildren.push(child);\n }\n break;\n case 'closed':\n // when set to open, only show col if group is open\n if (!parentWithExpansion.providedColumnGroup.isExpanded()) {\n this.displayedChildren.push(child);\n }\n break;\n default:\n this.displayedChildren.push(child);\n break;\n }\n });\n this.localEventService.dispatchEvent(this.createAgEvent(ColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED));\n }\n}\nColumnGroup.EVENT_LEFT_CHANGED = 'leftChanged';\nColumnGroup.EVENT_DISPLAYED_CHILDREN_CHANGED = 'displayedChildrenChanged';\n__decorate([Autowired('gridOptionsService')], ColumnGroup.prototype, \"gridOptionsService\", void 0);","export let Events = /*#__PURE__*/(() => {\n class Events {}\n /** Everything has changed with the columns. Either complete new set of columns set, or user called applyColumnState() */\n /** @deprecated - grid no longer uses this, and setSate() also fires individual events */\n\n /** User has set in new columns. */\n\n /** The pivot mode flag was changed */\n\n /** A row group column was added, removed or order changed. */\n\n /** expandAll / collapseAll was called from the api. */\n\n /** A pivot column was added, removed or order changed. */\n\n /** The list of grid columns has changed. */\n\n /** A value column was added, removed or agg function was changed. */\n\n /** A column was moved */\n\n /** One or more columns was shown / hidden */\n\n /** One or more columns was pinned / unpinned*/\n\n /** A column group was opened / closed */\n\n /** One or more columns was resized. If just one, the column in the event is set. */\n\n /** The list of displayed columns has changed, can result from columns open / close, column move, pivot, group, etc */\n\n /** The list of virtual columns has changed, results from viewport changing */\n\n /** Async Transactions Executed */\n\n /** A row group was opened / closed */\n\n /** @deprecated v28 use EVENT_ROW_DATA_UPDATED instead */\n\n /** The client has updated data for the grid */\n\n /** The client has set new floating data into the grid */\n\n /** Range selection has changed */\n\n /** Chart was created */\n\n /** Chart Range selection has changed */\n\n /** Chart Options have changed */\n\n /** Chart was destroyed */\n\n /** For when the tool panel is shown / hidden */\n\n /** Model was updated - grid updates the drawn rows when this happens */\n\n /** Undo operation has started. */\n\n /** Undo operation has ended. */\n\n /** Redo operation has started. */\n\n /** Redo operation has ended. */\n\n /** 2 events for filtering. The grid LISTENS for filterChanged and afterFilterChanged */\n\n /** Filter was change but not applied. Only useful if apply buttons are used in filters. */\n\n /** A row was removed from the dom, for any reason. Use to clean up resources (if any) used by the row. */\n\n /** Gets called once after the grid has finished initialising. */\n\n /** Width of height of the main grid div has changed. Grid listens for this and does layout of grid if it's\n * changed, so always filling the space it was given. */\n\n /** The indexes of the rows rendered has changed, eg user has scrolled to a new vertical position. */\n\n /* The width of the scrollbar has been calculated */\n\n /** Rows were rendered for the first time (ie on async data load). */\n\n /** A column drag has started, either resizing a column or moving a column. */\n\n /** A column drag has stopped */\n\n /** Main body of grid has scrolled, either horizontally or vertically */\n\n /** Main body of the grid has stopped scrolling, either horizontally or vertically */\n\n /** The displayed page for pagination has changed. For example the data was filtered or sorted,\n * or the user has moved to a different page. */\n\n /** Only used by React, Angular, Web Components and VueJS AG Grid components\n * (not used if doing plain JavaScript). If the grid receives changes due\n * to bound properties, this event fires after the grid has finished processing the change. */\n\n /** Only used by the SSRM, called when the grid has no more rows to refresh */\n\n /***************************** INTERNAL EVENTS: START ******************************************* */\n /** Please remember to add to ComponentUtil.EXCLUDED_INTERNAL_EVENTS to not have these events exposed to framework components. */\n /** All items from here down are used internally by the grid, not intended for external use. */\n // not documented, either experimental, or we just don't want users using an depending on them\n\n // environment\n\n // primarily for charts\n\n // these are used for server side group and agg - only used by CS with Viewport Row Model - intention is\n // to design these better around server side functions and then release to general public when fully working with\n // all the row models.\n\n // Advanced Filters\n\n // Widgets\n Events.EVENT_COLUMN_EVERYTHING_CHANGED = 'columnEverythingChanged';\n Events.EVENT_NEW_COLUMNS_LOADED = 'newColumnsLoaded';\n Events.EVENT_COLUMN_PIVOT_MODE_CHANGED = 'columnPivotModeChanged';\n Events.EVENT_COLUMN_ROW_GROUP_CHANGED = 'columnRowGroupChanged';\n Events.EVENT_EXPAND_COLLAPSE_ALL = 'expandOrCollapseAll';\n Events.EVENT_COLUMN_PIVOT_CHANGED = 'columnPivotChanged';\n Events.EVENT_GRID_COLUMNS_CHANGED = 'gridColumnsChanged';\n Events.EVENT_COLUMN_VALUE_CHANGED = 'columnValueChanged';\n Events.EVENT_COLUMN_MOVED = 'columnMoved';\n Events.EVENT_COLUMN_VISIBLE = 'columnVisible';\n Events.EVENT_COLUMN_PINNED = 'columnPinned';\n Events.EVENT_COLUMN_GROUP_OPENED = 'columnGroupOpened';\n Events.EVENT_COLUMN_RESIZED = 'columnResized';\n Events.EVENT_DISPLAYED_COLUMNS_CHANGED = 'displayedColumnsChanged';\n Events.EVENT_VIRTUAL_COLUMNS_CHANGED = 'virtualColumnsChanged';\n Events.EVENT_ASYNC_TRANSACTIONS_FLUSHED = 'asyncTransactionsFlushed';\n Events.EVENT_ROW_GROUP_OPENED = 'rowGroupOpened';\n Events.EVENT_ROW_DATA_CHANGED = 'rowDataChanged';\n Events.EVENT_ROW_DATA_UPDATED = 'rowDataUpdated';\n Events.EVENT_PINNED_ROW_DATA_CHANGED = 'pinnedRowDataChanged';\n Events.EVENT_RANGE_SELECTION_CHANGED = 'rangeSelectionChanged';\n Events.EVENT_CHART_CREATED = 'chartCreated';\n Events.EVENT_CHART_RANGE_SELECTION_CHANGED = 'chartRangeSelectionChanged';\n Events.EVENT_CHART_OPTIONS_CHANGED = 'chartOptionsChanged';\n Events.EVENT_CHART_DESTROYED = 'chartDestroyed';\n Events.EVENT_TOOL_PANEL_VISIBLE_CHANGED = 'toolPanelVisibleChanged';\n Events.EVENT_TOOL_PANEL_SIZE_CHANGED = 'toolPanelSizeChanged';\n Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START = 'columnPanelItemDragStart';\n Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END = 'columnPanelItemDragEnd';\n Events.EVENT_MODEL_UPDATED = 'modelUpdated';\n Events.EVENT_CUT_START = 'cutStart';\n Events.EVENT_CUT_END = 'cutEnd';\n Events.EVENT_PASTE_START = 'pasteStart';\n Events.EVENT_PASTE_END = 'pasteEnd';\n Events.EVENT_FILL_START = 'fillStart';\n Events.EVENT_FILL_END = 'fillEnd';\n Events.EVENT_RANGE_DELETE_START = 'rangeDeleteStart';\n Events.EVENT_RANGE_DELETE_END = 'rangeDeleteEnd';\n Events.EVENT_UNDO_STARTED = 'undoStarted';\n Events.EVENT_UNDO_ENDED = 'undoEnded';\n Events.EVENT_REDO_STARTED = 'redoStarted';\n Events.EVENT_REDO_ENDED = 'redoEnded';\n Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START = 'keyShortcutChangedCellStart';\n Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END = 'keyShortcutChangedCellEnd';\n Events.EVENT_CELL_CLICKED = 'cellClicked';\n Events.EVENT_CELL_DOUBLE_CLICKED = 'cellDoubleClicked';\n Events.EVENT_CELL_MOUSE_DOWN = 'cellMouseDown';\n Events.EVENT_CELL_CONTEXT_MENU = 'cellContextMenu';\n Events.EVENT_CELL_VALUE_CHANGED = 'cellValueChanged';\n Events.EVENT_CELL_EDIT_REQUEST = 'cellEditRequest';\n Events.EVENT_ROW_VALUE_CHANGED = 'rowValueChanged';\n Events.EVENT_CELL_FOCUSED = 'cellFocused';\n Events.EVENT_CELL_FOCUS_CLEARED = 'cellFocusCleared';\n Events.EVENT_FULL_WIDTH_ROW_FOCUSED = 'fullWidthRowFocused';\n Events.EVENT_ROW_SELECTED = 'rowSelected';\n Events.EVENT_SELECTION_CHANGED = 'selectionChanged';\n Events.EVENT_TOOLTIP_SHOW = 'tooltipShow';\n Events.EVENT_TOOLTIP_HIDE = 'tooltipHide';\n Events.EVENT_CELL_KEY_DOWN = 'cellKeyDown';\n Events.EVENT_CELL_MOUSE_OVER = 'cellMouseOver';\n Events.EVENT_CELL_MOUSE_OUT = 'cellMouseOut';\n Events.EVENT_FILTER_CHANGED = 'filterChanged';\n Events.EVENT_FILTER_MODIFIED = 'filterModified';\n Events.EVENT_FILTER_OPENED = 'filterOpened';\n Events.EVENT_SORT_CHANGED = 'sortChanged';\n Events.EVENT_VIRTUAL_ROW_REMOVED = 'virtualRowRemoved';\n Events.EVENT_ROW_CLICKED = 'rowClicked';\n Events.EVENT_ROW_DOUBLE_CLICKED = 'rowDoubleClicked';\n Events.EVENT_GRID_READY = 'gridReady';\n Events.EVENT_GRID_SIZE_CHANGED = 'gridSizeChanged';\n Events.EVENT_VIEWPORT_CHANGED = 'viewportChanged';\n Events.EVENT_SCROLLBAR_WIDTH_CHANGED = 'scrollbarWidthChanged';\n Events.EVENT_FIRST_DATA_RENDERED = 'firstDataRendered';\n Events.EVENT_DRAG_STARTED = 'dragStarted';\n Events.EVENT_DRAG_STOPPED = 'dragStopped';\n Events.EVENT_CHECKBOX_CHANGED = 'checkboxChanged';\n Events.EVENT_ROW_EDITING_STARTED = 'rowEditingStarted';\n Events.EVENT_ROW_EDITING_STOPPED = 'rowEditingStopped';\n Events.EVENT_CELL_EDITING_STARTED = 'cellEditingStarted';\n Events.EVENT_CELL_EDITING_STOPPED = 'cellEditingStopped';\n Events.EVENT_BODY_SCROLL = 'bodyScroll';\n Events.EVENT_BODY_SCROLL_END = 'bodyScrollEnd';\n Events.EVENT_HEIGHT_SCALE_CHANGED = 'heightScaleChanged';\n Events.EVENT_PAGINATION_CHANGED = 'paginationChanged';\n Events.EVENT_COMPONENT_STATE_CHANGED = 'componentStateChanged';\n Events.EVENT_STORE_REFRESHED = 'storeRefreshed';\n Events.EVENT_BODY_HEIGHT_CHANGED = 'bodyHeightChanged';\n Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED = 'displayedColumnsWidthChanged';\n Events.EVENT_SCROLL_VISIBILITY_CHANGED = 'scrollVisibilityChanged';\n Events.EVENT_COLUMN_HOVER_CHANGED = 'columnHoverChanged';\n Events.EVENT_FLASH_CELLS = 'flashCells';\n Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED = 'paginationPixelOffsetChanged';\n Events.EVENT_DISPLAYED_ROWS_CHANGED = 'displayedRowsChanged';\n Events.EVENT_LEFT_PINNED_WIDTH_CHANGED = 'leftPinnedWidthChanged';\n Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED = 'rightPinnedWidthChanged';\n Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED = 'rowContainerHeightChanged';\n Events.EVENT_HEADER_HEIGHT_CHANGED = 'headerHeightChanged';\n Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED = 'columnHeaderHeightChanged';\n Events.EVENT_ROW_DRAG_ENTER = 'rowDragEnter';\n Events.EVENT_ROW_DRAG_MOVE = 'rowDragMove';\n Events.EVENT_ROW_DRAG_LEAVE = 'rowDragLeave';\n Events.EVENT_ROW_DRAG_END = 'rowDragEnd';\n Events.EVENT_GRID_STYLES_CHANGED = 'gridStylesChanged';\n Events.EVENT_POPUP_TO_FRONT = 'popupToFront';\n Events.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST = 'columnRowGroupChangeRequest';\n Events.EVENT_COLUMN_PIVOT_CHANGE_REQUEST = 'columnPivotChangeRequest';\n Events.EVENT_COLUMN_VALUE_CHANGE_REQUEST = 'columnValueChangeRequest';\n Events.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST = 'columnAggFuncChangeRequest';\n Events.EVENT_KEYBOARD_FOCUS = 'keyboardFocus';\n Events.EVENT_MOUSE_FOCUS = 'mouseFocus';\n Events.EVENT_STORE_UPDATED = 'storeUpdated';\n Events.EVENT_FILTER_DESTROYED = 'filterDestroyed';\n Events.EVENT_ROW_DATA_UPDATE_STARTED = 'rowDataUpdateStarted';\n Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED = 'advancedFilterEnabledChanged';\n Events.EVENT_DATA_TYPES_INFERRED = 'dataTypesInferred';\n Events.EVENT_FIELD_VALUE_CHANGED = 'fieldValueChanged';\n Events.EVENT_FIELD_PICKER_VALUE_SELECTED = 'fieldPickerValueSelected';\n return Events;\n})();","// class returns unique instance id's for columns.\n// eg, the following calls (in this order) will result in:\n//\n// getInstanceIdForKey('country') => 0\n// getInstanceIdForKey('country') => 1\n// getInstanceIdForKey('country') => 2\n// getInstanceIdForKey('country') => 3\n// getInstanceIdForKey('age') => 0\n// getInstanceIdForKey('age') => 1\n// getInstanceIdForKey('country') => 4\nexport class GroupInstanceIdCreator {\n constructor() {\n // this map contains keys to numbers, so we remember what the last call was\n this.existingIds = {};\n }\n getInstanceIdForKey(key) {\n const lastResult = this.existingIds[key];\n let result;\n if (typeof lastResult !== 'number') {\n // first time this key\n result = 0;\n } else {\n result = lastResult + 1;\n }\n this.existingIds[key] = result;\n return result;\n }\n}","var __decorate = this && this.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Autowired, Bean } from \"../context/context.mjs\";\nimport { Column } from \"../entities/column.mjs\";\nimport { BeanStub } from \"../context/beanStub.mjs\";\nimport { mergeDeep } from \"../utils/object.mjs\";\nimport { missing } from \"../utils/generic.mjs\";\nexport const GROUP_AUTO_COLUMN_ID = 'ag-Grid-AutoColumn';\nlet AutoGroupColService = class AutoGroupColService extends BeanStub {\n createAutoGroupColumns(rowGroupColumns) {\n const groupAutoColumns = [];\n const doingTreeData = this.gridOptionsService.isTreeData();\n let doingMultiAutoColumn = this.gridOptionsService.isGroupMultiAutoColumn();\n if (doingTreeData && doingMultiAutoColumn) {\n console.warn('AG Grid: you cannot mix groupDisplayType = \"multipleColumns\" with treeData, only one column can be used to display groups when doing tree data');\n doingMultiAutoColumn = false;\n }\n // if doing groupDisplayType = \"multipleColumns\", then we call the method multiple times, once\n // for each column we are grouping by\n if (doingMultiAutoColumn) {\n rowGroupColumns.forEach((rowGroupCol, index) => {\n groupAutoColumns.push(this.createOneAutoGroupColumn(rowGroupCol, index));\n });\n } else {\n groupAutoColumns.push(this.createOneAutoGroupColumn());\n }\n return groupAutoColumns;\n }\n updateAutoGroupColumns(autoGroupColumns) {\n autoGroupColumns.forEach((column, index) => this.updateOneAutoGroupColumn(column, index));\n }\n // rowGroupCol and index are missing if groupDisplayType != \"multipleColumns\"\n createOneAutoGroupColumn(rowGroupCol, index) {\n // if doing multi, set the field\n let colId;\n if (rowGroupCol) {\n colId = `${GROUP_AUTO_COLUMN_ID}-${rowGroupCol.getId()}`;\n } else {\n colId = GROUP_AUTO_COLUMN_ID;\n }\n const colDef = this.createAutoGroupColDef(colId, rowGroupCol, index);\n colDef.colId = colId;\n const newCol = new Column(colDef, null, colId, true);\n this.context.createBean(newCol);\n return newCol;\n }\n /**\n * Refreshes an auto group col to load changes from defaultColDef or autoGroupColDef\n */\n updateOneAutoGroupColumn(colToUpdate, index) {\n const oldColDef = colToUpdate.getColDef();\n const underlyingColId = typeof oldColDef.showRowGroup == 'string' ? oldColDef.showRowGroup : undefined;\n const underlyingColumn = underlyingColId != null ? this.columnModel.getPrimaryColumn(underlyingColId) : undefined;\n const colDef = this.createAutoGroupColDef(colToUpdate.getId(), underlyingColumn !== null && underlyingColumn !== void 0 ? underlyingColumn : undefined, index);\n colToUpdate.setColDef(colDef, null);\n this.columnFactory.applyColumnState(colToUpdate, colDef);\n }\n createAutoGroupColDef(colId, underlyingColumn, index) {\n // if one provided by user, use it, otherwise create one\n let res = this.createBaseColDef(underlyingColumn);\n const autoGroupColumnDef = this.gridOptionsService.get('autoGroupColumnDef');\n mergeDeep(res, autoGroupColumnDef);\n res = this.columnFactory.addColumnDefaultAndTypes(res, colId);\n // For tree data the filter is always allowed\n if (!this.gridOptionsService.isTreeData()) {\n // we would only allow filter if the user has provided field or value getter. otherwise the filter\n // would not be able to work.\n const noFieldOrValueGetter = missing(res.field) && missing(res.valueGetter) && missing(res.filterValueGetter) && res.filter !== 'agGroupColumnFilter';\n if (noFieldOrValueGetter) {\n res.filter = false;\n }\n }\n // if showing many cols, we don't want to show more than one with a checkbox for selection\n if (index && index > 0) {\n res.headerCheckboxSelection = false;\n }\n const isSortingCoupled = this.gridOptionsService.isColumnsSortingCoupledToGroup();\n const hasOwnData = res.valueGetter || res.field != null;\n if (isSortingCoupled && !hasOwnData) {\n // if col is coupled sorting, and has sort attribute, we want to ignore this\n // because we only accept the sort on creation of the col\n res.sortIndex = undefined;\n res.initialSort = undefined;\n }\n return res;\n }\n createBaseColDef(rowGroupCol) {\n const userDef = this.gridOptionsService.get('autoGroupColumnDef');\n const localeTextFunc = this.localeService.getLocaleTextFunc();\n const res = {\n headerName: localeTextFunc('group', 'Group')\n };\n const userHasProvidedGroupCellRenderer = userDef && (userDef.cellRenderer || userDef.cellRendererSelector);\n // only add the default group cell renderer if user hasn't provided one\n if (!userHasProvidedGroupCellRenderer) {\n res.cellRenderer = 'agGroupCellRenderer';\n }\n // we never allow moving the group column\n // defaultAutoColDef.suppressMovable = true;\n if (rowGroupCol) {\n const colDef = rowGroupCol.getColDef();\n Object.assign(res, {\n // cellRendererParams.groupKey: colDefToCopy.field;\n headerName: this.columnModel.getDisplayNameForColumn(rowGroupCol, 'header'),\n headerValueGetter: colDef.headerValueGetter\n });\n if (colDef.cellRenderer) {\n Object.assign(res, {\n cellRendererParams: {\n innerRenderer: colDef.cellRenderer,\n innerRendererParams: colDef.cellRendererParams\n }\n });\n }\n res.showRowGroup = rowGroupCol.getColId();\n } else {\n res.showRowGroup = true;\n }\n return res;\n }\n};\n__decorate([Autowired('columnModel')], AutoGroupColService.prototype, \"columnModel\", void 0);\n__decorate([Autowired('columnFactory')], AutoGroupColService.prototype, \"columnFactory\", void 0);\nAutoGroupColService = __decorate([Bean('autoGroupColService')], AutoGroupColService);\nexport { AutoGroupColService };","const reUnescapedHtml = /[&<>\"']/g;\n/**\n * HTML Escapes.\n */\nconst HTML_ESCAPES = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": '''\n};\n/**\n * It encodes any string in UTF-8 format\n * taken from https://github.com/mathiasbynens/utf8.js\n * @param {string} s\n * @returns {string}\n */\nexport function utf8_encode(s) {\n const stringFromCharCode = String.fromCharCode;\n function ucs2decode(string) {\n const output = [];\n if (!string) {\n return [];\n }\n const len = string.length;\n let counter = 0;\n let value;\n let extra;\n while (counter < len) {\n value = string.charCodeAt(counter++);\n if (value >= 0xD800 && value <= 0xDBFF && counter < len) {\n // high surrogate, and there is a next character\n extra = string.charCodeAt(counter++);\n if ((extra & 0xFC00) == 0xDC00) {\n // low surrogate\n output.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n } else {\n // unmatched surrogate; only append this code unit, in case the next\n // code unit is the high surrogate of a surrogate pair\n output.push(value);\n counter--;\n }\n } else {\n output.push(value);\n }\n }\n return output;\n }\n function checkScalarValue(point) {\n if (point >= 0xD800 && point <= 0xDFFF) {\n throw Error('Lone surrogate U+' + point.toString(16).toUpperCase() + ' is not a scalar value');\n }\n }\n function createByte(point, shift) {\n return stringFromCharCode(point >> shift & 0x3F | 0x80);\n }\n function encodeCodePoint(point) {\n if (point >= 0 && point <= 31 && point !== 10) {\n const convertedCode = point.toString(16).toUpperCase();\n const paddedCode = convertedCode.padStart(4, '0');\n return `_x${paddedCode}_`;\n }\n if ((point & 0xFFFFFF80) == 0) {\n // 1-byte sequence\n return stringFromCharCode(point);\n }\n let symbol = '';\n if ((point & 0xFFFFF800) == 0) {\n // 2-byte sequence\n symbol = stringFromCharCode(point >> 6 & 0x1F | 0xC0);\n } else if ((point & 0xFFFF0000) == 0) {\n // 3-byte sequence\n checkScalarValue(point);\n symbol = stringFromCharCode(point >> 12 & 0x0F | 0xE0);\n symbol += createByte(point, 6);\n } else if ((point & 0xFFE00000) == 0) {\n // 4-byte sequence\n symbol = stringFromCharCode(point >> 18 & 0x07 | 0xF0);\n symbol += createByte(point, 12);\n symbol += createByte(point, 6);\n }\n symbol += stringFromCharCode(point & 0x3F | 0x80);\n return symbol;\n }\n const codePoints = ucs2decode(s);\n const length = codePoints.length;\n let index = -1;\n let codePoint;\n let byteString = '';\n while (++index < length) {\n codePoint = codePoints[index];\n byteString += encodeCodePoint(codePoint);\n }\n return byteString;\n}\nexport function capitalise(str) {\n return str[0].toUpperCase() + str.substr(1).toLowerCase();\n}\nexport function escapeString(toEscape, skipEscapingHtmlChars) {\n if (toEscape == null) {\n return null;\n }\n // we call toString() twice, in case value is an object, where user provides\n // a toString() method, and first call to toString() returns back something other\n // than a string (eg a number to render)\n const stringResult = toEscape.toString().toString();\n if (skipEscapingHtmlChars) {\n return stringResult;\n }\n // in react we don't need to escape html characters, as it's done by the framework\n return stringResult.replace(reUnescapedHtml, chr => HTML_ESCAPES[chr]);\n}\n/**\n * Converts a camelCase string into startCase\n * @param {string} camelCase\n * @return {string}\n */\nexport function camelCaseToHumanText(camelCase) {\n if (!camelCase || camelCase == null) {\n return null;\n }\n // either split on a lowercase followed by uppercase ie asHereTo -> as Here To\n const rex = /([a-z])([A-Z])/g;\n // or starts with uppercase and we take all expect the last which is assumed to be part of next word if followed by lowercase HEREToThere -> HERE To There\n const rexCaps = /([A-Z]+)([A-Z])([a-z])/g;\n const words = camelCase.replace(rex, '$1 $2').replace(rexCaps, '$1 $2$3').replace(/\\./g, ' ').split(' ');\n return words.map(word => word.substring(0, 1).toUpperCase() + (word.length > 1 ? word.substring(1, word.length) : '')).join(' ');\n}\n/**\n * Converts a camelCase string into hyphenated string\n * @param {string} camelCase\n * @return {string}\n */\nexport function camelCaseToHyphenated(camelCase) {\n return camelCase.replace(/[A-Z]/g, s => `-${s.toLocaleLowerCase()}`);\n}","export function convertToMap(arr) {\n const map = new Map();\n arr.forEach(pair => map.set(pair[0], pair[1]));\n return map;\n}\n// handy for organising a list into a map, where each item is mapped by an attribute, eg mapping Columns by ID\nexport function mapById(arr, callback) {\n const map = new Map();\n arr.forEach(item => map.set(callback(item), item));\n return map;\n}\nexport function keys(map) {\n const arr = [];\n map.forEach((_, key) => arr.push(key));\n return arr;\n}","export class ColDefUtil {}\nColDefUtil.ColDefPropertyMap = {\n headerName: undefined,\n columnGroupShow: undefined,\n headerClass: undefined,\n toolPanelClass: undefined,\n headerValueGetter: undefined,\n pivotKeys: undefined,\n groupId: undefined,\n colId: undefined,\n sort: undefined,\n initialSort: undefined,\n field: undefined,\n type: undefined,\n cellDataType: undefined,\n tooltipComponent: undefined,\n tooltipField: undefined,\n headerTooltip: undefined,\n cellClass: undefined,\n showRowGroup: undefined,\n filter: undefined,\n initialAggFunc: undefined,\n defaultAggFunc: undefined,\n aggFunc: undefined,\n pinned: undefined,\n initialPinned: undefined,\n chartDataType: undefined,\n cellEditorPopupPosition: undefined,\n headerGroupComponent: undefined,\n headerGroupComponentParams: undefined,\n cellStyle: undefined,\n cellRenderer: undefined,\n cellRendererParams: undefined,\n cellEditor: undefined,\n cellEditorParams: undefined,\n filterParams: undefined,\n pivotValueColumn: undefined,\n headerComponent: undefined,\n headerComponentParams: undefined,\n floatingFilterComponent: undefined,\n floatingFilterComponentParams: undefined,\n tooltipComponentParams: undefined,\n refData: undefined,\n columnsMenuParams: undefined,\n children: undefined,\n sortingOrder: undefined,\n allowedAggFuncs: undefined,\n menuTabs: undefined,\n pivotTotalColumnIds: undefined,\n cellClassRules: undefined,\n icons: undefined,\n sortIndex: undefined,\n initialSortIndex: undefined,\n flex: undefined,\n initialFlex: undefined,\n width: undefined,\n initialWidth: undefined,\n minWidth: undefined,\n maxWidth: undefined,\n rowGroupIndex: undefined,\n initialRowGroupIndex: undefined,\n pivotIndex: undefined,\n initialPivotIndex: undefined,\n suppressCellFlash: undefined,\n suppressColumnsToolPanel: undefined,\n suppressFiltersToolPanel: undefined,\n openByDefault: undefined,\n marryChildren: undefined,\n suppressStickyLabel: undefined,\n hide: undefined,\n initialHide: undefined,\n rowGroup: undefined,\n initialRowGroup: undefined,\n pivot: undefined,\n initialPivot: undefined,\n checkboxSelection: undefined,\n showDisabledCheckboxes: undefined,\n headerCheckboxSelection: undefined,\n headerCheckboxSelectionFilteredOnly: undefined,\n headerCheckboxSelectionCurrentPageOnly: undefined,\n suppressMenu: undefined,\n suppressMovable: undefined,\n lockPosition: undefined,\n lockVisible: undefined,\n lockPinned: undefined,\n unSortIcon: undefined,\n suppressSizeToFit: undefined,\n suppressAutoSize: undefined,\n enableRowGroup: undefined,\n enablePivot: undefined,\n enableValue: undefined,\n editable: undefined,\n suppressPaste: undefined,\n suppressNavigable: undefined,\n enableCellChangeFlash: undefined,\n rowDrag: undefined,\n dndSource: undefined,\n autoHeight: undefined,\n wrapText: undefined,\n sortable: undefined,\n resizable: undefined,\n singleClickEdit: undefined,\n floatingFilter: undefined,\n cellEditorPopup: undefined,\n suppressFillHandle: undefined,\n wrapHeaderText: undefined,\n autoHeaderHeight: undefined,\n dndSourceOnRowDrag: undefined,\n valueGetter: undefined,\n valueSetter: undefined,\n filterValueGetter: undefined,\n keyCreator: undefined,\n valueFormatter: undefined,\n valueParser: undefined,\n comparator: undefined,\n equals: undefined,\n pivotComparator: undefined,\n suppressKeyboardEvent: undefined,\n suppressHeaderKeyboardEvent: undefined,\n colSpan: undefined,\n rowSpan: undefined,\n getQuickFilterText: undefined,\n onCellValueChanged: undefined,\n onCellClicked: undefined,\n onCellDoubleClicked: undefined,\n onCellContextMenu: undefined,\n rowDragText: undefined,\n tooltipValueGetter: undefined,\n cellRendererSelector: undefined,\n cellEditorSelector: undefined,\n suppressSpanHeaderHeight: undefined,\n useValueFormatterForExport: undefined,\n useValueParserForImport: undefined\n};\nColDefUtil.ALL_PROPERTIES = Object.keys(ColDefUtil.ColDefPropertyMap);","/**\n * These keys are used for validating properties supplied on a gridOptions object, and for code generation.\n * If you change the properties on the gridOptions interface, you *must* update this file as well to be consistent.\n */\nexport class PropertyKeys {}\nPropertyKeys.STRING_PROPERTIES = ['rowSelection', 'overlayLoadingTemplate', 'overlayNoRowsTemplate', 'gridId', 'quickFilterText', 'rowModelType', 'editType', 'domLayout', 'clipboardDelimiter', 'rowGroupPanelShow', 'multiSortKey', 'pivotColumnGroupTotals', 'pivotRowTotals', 'pivotPanelShow', 'fillHandleDirection', 'serverSideStoreType', 'groupDisplayType', 'treeDataDisplayType', 'colResizeDefault', 'tooltipTrigger', 'serverSidePivotResultFieldSeparator'];\nPropertyKeys.OBJECT_PROPERTIES = ['components', 'rowStyle', 'context', 'autoGroupColumnDef', 'localeText', 'icons', 'datasource', 'serverSideDatasource', 'viewportDatasource', 'groupRowRendererParams', 'aggFuncs', 'fullWidthCellRendererParams', 'defaultColGroupDef', 'defaultColDef', 'defaultCsvExportParams', 'defaultExcelExportParams', 'columnTypes', 'rowClassRules', 'detailCellRendererParams', 'loadingCellRendererParams', 'loadingOverlayComponentParams', 'noRowsOverlayComponentParams', 'popupParent', 'statusBar', 'sideBar', 'chartThemeOverrides', 'customChartThemes', 'chartToolPanelsDef', 'dataTypeDefinitions', 'advancedFilterModel', 'advancedFilterParent'];\nPropertyKeys.ARRAY_PROPERTIES = ['sortingOrder', 'alignedGrids', 'rowData', 'columnDefs', 'excelStyles', 'pinnedTopRowData', 'pinnedBottomRowData', 'chartThemes', 'rowClass'];\nPropertyKeys.NUMBER_PROPERTIES = ['rowHeight', 'detailRowHeight', 'rowBuffer', 'headerHeight', 'groupHeaderHeight', 'floatingFiltersHeight', 'pivotHeaderHeight', 'pivotGroupHeaderHeight', 'groupDefaultExpanded', 'pivotDefaultExpanded', 'viewportRowModelPageSize', 'viewportRowModelBufferSize', 'autoSizePadding', 'maxBlocksInCache', 'maxConcurrentDatasourceRequests', 'tooltipShowDelay', 'tooltipHideDelay', 'cacheOverflowSize', 'paginationPageSize', 'cacheBlockSize', 'infiniteInitialRowCount', 'serverSideInitialRowCount', 'scrollbarWidth', 'asyncTransactionWaitMillis', 'blockLoadDebounceMillis', 'keepDetailRowsCount', 'undoRedoCellEditingLimit', 'cellFlashDelay', 'cellFadeDelay', 'tabIndex'];\nPropertyKeys.BOOLEAN_PROPERTIES = ['suppressMakeColumnVisibleAfterUnGroup', 'suppressRowClickSelection', 'suppressCellFocus', 'suppressHorizontalScroll', 'alwaysShowHorizontalScroll', 'alwaysShowVerticalScroll', 'debug', 'enableBrowserTooltips', 'enableCellExpressions', 'groupSelectsChildren', 'groupIncludeFooter', 'groupIncludeTotalFooter', 'groupSuppressBlankHeader', 'suppressMenuHide', 'suppressRowDeselection', 'unSortIcon', 'suppressMultiSort', 'alwaysMultiSort', 'singleClickEdit', 'suppressLoadingOverlay', 'suppressNoRowsOverlay', 'suppressAutoSize', 'skipHeaderOnAutoSize', 'suppressParentsInRowNodes', 'suppressColumnMoveAnimation', 'suppressMovableColumns', 'suppressFieldDotNotation', 'enableRangeSelection', 'enableRangeHandle', 'enableFillHandle', 'suppressClearOnFillReduction', 'deltaSort', 'suppressTouch', 'suppressAsyncEvents', 'allowContextMenuWithControlKey', 'suppressContextMenu', 'rememberGroupStateWhenNewData', 'enableCellChangeFlash', 'suppressDragLeaveHidesColumns', 'suppressRowGroupHidesColumns', 'suppressMiddleClickScrolls', 'suppressPreventDefaultOnMouseWheel', 'suppressCopyRowsToClipboard', 'copyHeadersToClipboard', 'copyGroupHeadersToClipboard', 'pivotMode', 'suppressAggFuncInHeader', 'suppressColumnVirtualisation', 'alwaysAggregateAtRootLevel', 'suppressAggAtRootLevel', 'suppressFocusAfterRefresh', 'functionsPassive', 'functionsReadOnly', 'animateRows', 'groupSelectsFiltered', 'groupRemoveSingleChildren', 'groupRemoveLowestSingleChildren', 'enableRtl', 'suppressClickEdit', 'rowDragEntireRow', 'rowDragManaged', 'suppressRowDrag', 'suppressMoveWhenRowDragging', 'rowDragMultiRow', 'enableGroupEdit', 'embedFullWidthRows', 'suppressPaginationPanel', 'groupHideOpenParents', 'groupAllowUnbalanced', 'pagination', 'paginationAutoPageSize', 'suppressScrollOnNewData', 'suppressScrollWhenPopupsAreOpen', 'purgeClosedRowNodes', 'cacheQuickFilter', 'includeHiddenColumnsInQuickFilter', 'excludeHiddenColumnsFromQuickFilter', 'ensureDomOrder', 'accentedSort', 'suppressChangeDetection', 'valueCache', 'valueCacheNeverExpires', 'aggregateOnlyChangedColumns', 'suppressAnimationFrame', 'suppressExcelExport', 'suppressCsvExport', 'treeData', 'masterDetail', 'suppressMultiRangeSelection', 'enterMovesDown', 'enterMovesDownAfterEdit', 'enterNavigatesVerticallyAfterEdit', 'enterNavigatesVertically', 'suppressPropertyNamesCheck', 'rowMultiSelectWithClick', 'suppressRowHoverHighlight', 'suppressRowTransform', 'suppressClipboardPaste', 'suppressLastEmptyLineOnPaste', 'enableCharts', 'enableChartToolPanelsButton', 'suppressChartToolPanelsButton', 'suppressMaintainUnsortedOrder', 'enableCellTextSelection', 'suppressBrowserResizeObserver', 'suppressMaxRenderedRowRestriction', 'excludeChildrenWhenTreeDataFiltering', 'tooltipMouseTrack', 'tooltipInteraction', 'keepDetailRows', 'paginateChildRows', 'preventDefaultOnContextMenu', 'undoRedoCellEditing', 'allowDragFromColumnsToolPanel', 'pivotSuppressAutoColumn', 'suppressExpandablePivotGroups', 'debounceVerticalScrollbar', 'detailRowAutoHeight', 'serverSideFilteringAlwaysResets', 'serverSideFilterAllLevels', 'serverSideSortingAlwaysResets', 'serverSideSortAllLevels', 'serverSideOnlyRefreshFilteredGroups', 'serverSideSortOnServer', 'serverSideFilterOnServer', 'suppressAggFilteredOnly', 'showOpenedGroup', 'suppressClipboardApi', 'suppressModelUpdateAfterUpdateTransaction', 'stopEditingWhenCellsLoseFocus', 'maintainColumnOrder', 'groupMaintainOrder', 'columnHoverHighlight', 'suppressReactUi', 'readOnlyEdit', 'suppressRowVirtualisation', 'enableCellEditingOnBackspace', 'resetRowDataOnUpdate', 'removePivotHeaderRowWhenSingleValueColumn', 'suppressCopySingleCellRanges', 'suppressGroupRowsSticky', 'suppressServerSideInfiniteScroll', 'rowGroupPanelSuppressSort', 'allowShowChangeAfterFilter', 'suppressCutToClipboard', 'enableAdvancedFilter', 'includeHiddenColumnsInAdvancedFilter'];\n/** You do not need to include event callbacks in this list, as they are generated automatically. */\nPropertyKeys.FUNCTIONAL_PROPERTIES = ['doesExternalFilterPass', 'processSecondaryColDef', 'processSecondaryColGroupDef', 'processPivotResultColDef', 'processPivotResultColGroupDef', 'getBusinessKeyForNode', 'isRowSelectable', 'rowDragText', 'groupRowRenderer', 'fullWidthCellRenderer', 'loadingCellRenderer', 'loadingOverlayComponent', 'noRowsOverlayComponent', 'detailCellRenderer'];\nPropertyKeys.CALLBACK_PROPERTIES = ['getLocaleText', 'isExternalFilterPresent', 'getRowHeight', 'getRowClass', 'getRowStyle', 'getContextMenuItems', 'getMainMenuItems', 'processRowPostCreate', 'processCellForClipboard', 'getGroupRowAgg', 'isFullWidthRow', 'sendToClipboard', 'navigateToNextHeader', 'tabToNextHeader', 'navigateToNextCell', 'tabToNextCell', 'processCellFromClipboard', 'getDocument', 'postProcessPopup', 'getChildCount', 'getDataPath', 'isRowMaster', 'postSortRows', 'processHeaderForClipboard', 'processGroupHeaderForClipboard', 'paginationNumberFormatter', 'processDataFromClipboard', 'getServerSideGroupKey', 'isServerSideGroup', 'createChartContainer', 'getChartToolbarItems', 'fillOperation', 'isApplyServerSideTransaction', 'getServerSideStoreParams', 'getServerSideGroupLevelParams', 'isServerSideGroupOpenByDefault', 'isGroupOpenByDefault', 'initialGroupOrderComparator', 'loadingCellRendererSelector', 'getRowId', 'groupAggFiltering'];\nPropertyKeys.FUNCTION_PROPERTIES = [...PropertyKeys.FUNCTIONAL_PROPERTIES, ...PropertyKeys.CALLBACK_PROPERTIES];\nPropertyKeys.ALL_PROPERTIES = [...PropertyKeys.ARRAY_PROPERTIES, ...PropertyKeys.OBJECT_PROPERTIES, ...PropertyKeys.STRING_PROPERTIES, ...PropertyKeys.NUMBER_PROPERTIES, ...PropertyKeys.FUNCTION_PROPERTIES, ...PropertyKeys.BOOLEAN_PROPERTIES];","import { Events } from '../events.mjs';\nimport { PropertyKeys } from '../propertyKeys.mjs';\nimport { iterateObject } from '../utils/object.mjs';\nimport { includes } from '../utils/array.mjs';\nimport { values } from '../utils/generic.mjs';\nexport class ComponentUtil {\n static getCallbackForEvent(eventName) {\n if (!eventName || eventName.length < 2) {\n return eventName;\n }\n return 'on' + eventName[0].toUpperCase() + eventName.substr(1);\n }\n static getCoercionLookup() {\n let coercionLookup = {};\n [...ComponentUtil.ARRAY_PROPERTIES, ...ComponentUtil.OBJECT_PROPERTIES, ...ComponentUtil.STRING_PROPERTIES, ...ComponentUtil.FUNCTION_PROPERTIES, ...ComponentUtil.EVENT_CALLBACKS].forEach(key => coercionLookup[key] = 'none');\n ComponentUtil.BOOLEAN_PROPERTIES.forEach(key => coercionLookup[key] = 'boolean');\n ComponentUtil.NUMBER_PROPERTIES.forEach(key => coercionLookup[key] = 'number');\n return coercionLookup;\n }\n static getValue(key, rawValue) {\n const coercionStep = ComponentUtil.coercionLookup[key];\n if (coercionStep) {\n let newValue = rawValue;\n switch (coercionStep) {\n case 'number':\n {\n newValue = ComponentUtil.toNumber(rawValue);\n break;\n }\n case 'boolean':\n {\n newValue = ComponentUtil.toBoolean(rawValue);\n break;\n }\n case 'none':\n {\n // if groupAggFiltering exists and isn't a function, handle as a boolean.\n if (key === 'groupAggFiltering' && typeof rawValue !== 'function') {\n newValue = ComponentUtil.toBoolean(rawValue);\n }\n break;\n }\n }\n return newValue;\n }\n return undefined;\n }\n static getGridOptionKeys(component, isVue) {\n // Vue does not have keys in prod so instead need to run through all the \n // gridOptions checking for presence of a gridOption key.\n return isVue ? Object.keys(ComponentUtil.coercionLookup) : Object.keys(component);\n }\n static copyAttributesToGridOptions(gridOptions, component, isVue = false) {\n // create empty grid options if none were passed\n if (typeof gridOptions !== 'object') {\n gridOptions = {};\n }\n // to allow array style lookup in TypeScript, take type away from 'this' and 'gridOptions'\n const pGridOptions = gridOptions;\n const keys = ComponentUtil.getGridOptionKeys(component, isVue);\n // Loop through component props, if they are not undefined and a valid gridOption copy to gridOptions\n keys.forEach(key => {\n const value = component[key];\n if (typeof value !== 'undefined') {\n const coercedValue = ComponentUtil.getValue(key, value);\n if (coercedValue !== undefined) {\n pGridOptions[key] = coercedValue;\n }\n }\n });\n return gridOptions;\n }\n static processOnChange(changes, api) {\n if (!changes || Object.keys(changes).length === 0) {\n return;\n }\n const changesToApply = Object.assign({}, changes);\n // We manually call these updates so that we can provide a different source of gridOptionsChanged\n // We do not call setProperty as this will be called by the grid api methods\n if (changesToApply.columnTypes) {\n api.setColumnTypes(changesToApply.columnTypes.currentValue, \"gridOptionsChanged\");\n delete changesToApply.columnTypes;\n }\n if (changesToApply.autoGroupColumnDef) {\n api.setAutoGroupColumnDef(changesToApply.autoGroupColumnDef.currentValue, \"gridOptionsChanged\");\n delete changesToApply.autoGroupColumnDef;\n }\n if (changesToApply.defaultColDef) {\n api.setDefaultColDef(changesToApply.defaultColDef.currentValue, \"gridOptionsChanged\");\n delete changesToApply.defaultColDef;\n }\n if (changesToApply.columnDefs) {\n api.setColumnDefs(changesToApply.columnDefs.currentValue, \"gridOptionsChanged\");\n delete changesToApply.columnDefs;\n }\n Object.keys(changesToApply).forEach(key => {\n const gridKey = key;\n const coercedValue = ComponentUtil.getValue(gridKey, changesToApply[gridKey].currentValue);\n api.__setProperty(gridKey, coercedValue);\n });\n // copy changes into an event for dispatch\n const event = {\n type: Events.EVENT_COMPONENT_STATE_CHANGED\n };\n iterateObject(changes, (key, value) => {\n event[key] = value;\n });\n api.dispatchEvent(event);\n }\n static toBoolean(value) {\n if (typeof value === 'boolean') {\n return value;\n }\n if (typeof value === 'string') {\n // for boolean, compare to empty String to allow attributes appearing with\n // no value to be treated as 'true'\n return value.toUpperCase() === 'TRUE' || value == '';\n }\n return false;\n }\n static toNumber(value) {\n if (typeof value === 'number') {\n return value;\n }\n if (typeof value === 'string') {\n return Number(value);\n }\n }\n}\n// all events\nComponentUtil.EVENTS = values(Events);\n// events that are internal to AG Grid and should not be exposed to users via documentation or generated framework components\n/** Exclude the following internal events from code generation to prevent exposing these events via framework components */\nComponentUtil.EXCLUDED_INTERNAL_EVENTS = [Events.EVENT_SCROLLBAR_WIDTH_CHANGED, Events.EVENT_CHECKBOX_CHANGED, Events.EVENT_HEIGHT_SCALE_CHANGED, Events.EVENT_BODY_HEIGHT_CHANGED, Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED, Events.EVENT_SCROLL_VISIBILITY_CHANGED, Events.EVENT_COLUMN_HOVER_CHANGED, Events.EVENT_FLASH_CELLS, Events.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED, Events.EVENT_DISPLAYED_ROWS_CHANGED, Events.EVENT_LEFT_PINNED_WIDTH_CHANGED, Events.EVENT_RIGHT_PINNED_WIDTH_CHANGED, Events.EVENT_ROW_CONTAINER_HEIGHT_CHANGED, Events.EVENT_POPUP_TO_FRONT, Events.EVENT_KEYBOARD_FOCUS, Events.EVENT_MOUSE_FOCUS, Events.EVENT_STORE_UPDATED, Events.EVENT_COLUMN_PANEL_ITEM_DRAG_START, Events.EVENT_COLUMN_PANEL_ITEM_DRAG_END, Events.EVENT_FILL_START, Events.EVENT_FILL_END, Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_START, Events.EVENT_KEY_SHORTCUT_CHANGED_CELL_END, Events.EVENT_FULL_WIDTH_ROW_FOCUSED, Events.EVENT_HEADER_HEIGHT_CHANGED, Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED, Events.EVENT_CELL_FOCUS_CLEARED, Events.EVENT_GRID_STYLES_CHANGED, Events.EVENT_FILTER_DESTROYED, Events.EVENT_ROW_DATA_UPDATE_STARTED, Events.EVENT_ADVANCED_FILTER_ENABLED_CHANGED, Events.EVENT_DATA_TYPES_INFERRED, Events.EVENT_FIELD_VALUE_CHANGED, Events.EVENT_FIELD_PICKER_VALUE_SELECTED];\n// events that are available for use by users of AG Grid and so should be documented\n/** EVENTS that should be exposed via code generation for the framework components. */\nComponentUtil.PUBLIC_EVENTS = ComponentUtil.EVENTS.filter(e => !includes(ComponentUtil.EXCLUDED_INTERNAL_EVENTS, e));\n// onXXX methods, based on the above events\nComponentUtil.EVENT_CALLBACKS = ComponentUtil.EVENTS.map(event => ComponentUtil.getCallbackForEvent(event));\nComponentUtil.STRING_PROPERTIES = PropertyKeys.STRING_PROPERTIES;\nComponentUtil.OBJECT_PROPERTIES = PropertyKeys.OBJECT_PROPERTIES;\nComponentUtil.ARRAY_PROPERTIES = PropertyKeys.ARRAY_PROPERTIES;\nComponentUtil.NUMBER_PROPERTIES = PropertyKeys.NUMBER_PROPERTIES;\nComponentUtil.BOOLEAN_PROPERTIES = PropertyKeys.BOOLEAN_PROPERTIES;\nComponentUtil.FUNCTION_PROPERTIES = PropertyKeys.FUNCTION_PROPERTIES;\nComponentUtil.ALL_PROPERTIES = PropertyKeys.ALL_PROPERTIES;\nComponentUtil.ALL_PROPERTIES_SET = new Set(PropertyKeys.ALL_PROPERTIES);\nComponentUtil.coercionLookup = ComponentUtil.getCoercionLookup();","export function fuzzyCheckStrings(inputValues, validValues, allSuggestions) {\n const fuzzyMatches = {};\n const invalidInputs = inputValues.filter(inputValue => !validValues.some(validValue => validValue === inputValue));\n if (invalidInputs.length > 0) {\n invalidInputs.forEach(invalidInput => fuzzyMatches[invalidInput] = fuzzySuggestions(invalidInput, allSuggestions));\n }\n return fuzzyMatches;\n}\n/**\n *\n * @param {String} inputValue The value to be compared against a list of strings\n * @param allSuggestions The list of strings to be compared against\n */\nexport function fuzzySuggestions(inputValue, allSuggestions, hideIrrelevant, filterByPercentageOfBestMatch) {\n let thisSuggestions = allSuggestions.map(text => ({\n value: text,\n relevance: stringWeightedDistances(inputValue.toLowerCase(), text.toLocaleLowerCase())\n }));\n thisSuggestions.sort((a, b) => b.relevance - a.relevance);\n if (hideIrrelevant) {\n thisSuggestions = thisSuggestions.filter(suggestion => suggestion.relevance !== 0);\n }\n if (thisSuggestions.length > 0 && filterByPercentageOfBestMatch && filterByPercentageOfBestMatch > 0) {\n const bestMatch = thisSuggestions[0].relevance;\n const limit = bestMatch * filterByPercentageOfBestMatch;\n thisSuggestions = thisSuggestions.filter(suggestion => limit - suggestion.relevance < 0);\n }\n return thisSuggestions.map(suggestion => suggestion.value);\n}\nfunction stringWeightedDistances(str1, str2) {\n const a = str1.replace(/\\s/g, '');\n const b = str2.replace(/\\s/g, '');\n let weight = 0;\n let lastIndex = -1;\n for (let i = 0; i < a.length; i++) {\n const idx = b.indexOf(a[i], lastIndex + 1);\n if (idx === -1) {\n continue;\n }\n lastIndex = idx;\n weight += 100 - lastIndex * 100 / 10000 * 100;\n }\n return weight;\n}","var __decorate = this && this.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { ColDefUtil } from './components/colDefUtil.mjs';\nimport { ComponentUtil } from './components/componentUtil.mjs';\nimport { Autowired, Bean, PostConstruct } from './context/context.mjs';\nimport { ModuleNames } from './modules/moduleNames.mjs';\nimport { ModuleRegistry } from './modules/moduleRegistry.mjs';\nimport { PropertyKeys } from './propertyKeys.mjs';\nimport { doOnce } from './utils/function.mjs';\nimport { fuzzyCheckStrings } from './utils/fuzzyMatch.mjs';\nimport { iterateObject } from './utils/object.mjs';\nexport function logDeprecation(version, oldProp, newProp, message) {\n const newPropMsg = newProp ? `Please use '${newProp}' instead. ` : '';\n doOnce(() => console.warn(`AG Grid: since v${version}, '${oldProp}' is deprecated. ${newPropMsg}${message !== null && message !== void 0 ? message : ''}`), `Deprecated_${oldProp}`);\n}\n// Vue adds these properties to all objects, so we ignore them when checking for invalid properties\nconst VUE_FRAMEWORK_PROPS = ['__ob__', '__v_skip', '__metadata__'];\nlet GridOptionsValidator = class GridOptionsValidator {\n constructor() {\n this.deprecatedProperties = {\n rememberGroupStateWhenNewData: {\n version: '24',\n message: 'Now that transaction updates are possible and they keep group state, this feature is no longer needed.'\n },\n serverSideFilteringAlwaysResets: {\n version: '28.0',\n newProp: 'serverSideOnlyRefreshFilteredGroups',\n copyToNewProp: true\n },\n serverSideSortingAlwaysResets: {\n version: '28.0',\n newProp: 'serverSideSortAllLevels',\n copyToNewProp: true\n },\n suppressReactUi: {\n version: '28',\n message: 'The legacy React rendering engine is deprecated and will be removed in the next major version of the grid.'\n },\n processSecondaryColDef: {\n version: '28',\n newProp: 'processPivotResultColDef',\n copyToNewProp: true\n },\n processSecondaryColGroupDef: {\n version: '28',\n newProp: 'processPivotResultColGroupDef',\n copyToNewProp: true\n },\n getServerSideStoreParams: {\n version: '28',\n newProp: 'getServerSideGroupLevelParams',\n copyToNewProp: true\n },\n serverSideInfiniteScroll: {\n version: '29',\n message: 'Infinite Scrolling is now the default behaviour. This can be suppressed with `suppressServerSideInfiniteScroll`.'\n },\n enableChartToolPanelsButton: {\n version: '29',\n message: 'The Chart Tool Panels button is now enabled by default. To hide the Chart Tool Panels button and display the hamburger button instead, set suppressChartToolPanelsButton=true.'\n },\n functionsPassive: {\n version: '29.2'\n },\n onColumnRowGroupChangeRequest: {\n version: '29.2'\n },\n onColumnPivotChangeRequest: {\n version: '29.2'\n },\n onColumnValueChangeRequest: {\n version: '29.2'\n },\n onColumnAggFuncChangeRequest: {\n version: '29.2'\n },\n serverSideFilterAllLevels: {\n version: '30',\n message: 'All server-side group levels are now filtered by default. This can be toggled using `serverSideOnlyRefreshFilteredGroups`.'\n },\n suppressAggAtRootLevel: {\n version: '30',\n message: 'The root level aggregation is now suppressed by default. This can be toggled using `alwaysAggregateAtRootLevel`.'\n },\n excludeHiddenColumnsFromQuickFilter: {\n version: '30',\n message: 'Hidden columns are now excluded from the Quick Filter by default. This can be toggled using `includeHiddenColumnsInQuickFilter`.'\n },\n enterMovesDown: {\n version: '30',\n newProp: 'enterNavigatesVertically',\n copyToNewProp: true\n },\n enterMovesDownAfterEdit: {\n version: '30',\n newProp: 'enterNavigatesVerticallyAfterEdit',\n copyToNewProp: true\n }\n };\n }\n pickOneWarning(prop1, prop2) {\n console.warn(`AG Grid: ${prop1} and ${prop2} do not work with each other, you need to pick one.`);\n }\n init() {\n this.checkForDeprecated();\n this.checkForViolations();\n if (this.gridOptions.suppressPropertyNamesCheck !== true) {\n this.checkGridOptionsProperties();\n this.checkColumnDefProperties();\n }\n this.checkColumnDefViolations();\n if (this.gridOptionsService.is('groupSelectsChildren') && this.gridOptionsService.is('suppressParentsInRowNodes')) {\n console.warn(\"AG Grid: 'groupSelectsChildren' does not work with 'suppressParentsInRowNodes', this selection method needs the part in rowNode to work\");\n }\n if (this.gridOptionsService.is('groupSelectsChildren')) {\n if (this.gridOptionsService.get('rowSelection') !== 'multiple') {\n console.warn(\"AG Grid: rowSelection must be 'multiple' for groupSelectsChildren to make sense\");\n }\n }\n if (this.gridOptionsService.is('groupRemoveSingleChildren') && this.gridOptionsService.is('groupHideOpenParents')) {\n this.pickOneWarning('groupRemoveSingleChildren', 'groupHideOpenParents');\n }\n if (this.gridOptionsService.isRowModelType('serverSide')) {\n const msg = (prop, alt) => `AG Grid: '${prop}' is not supported on the Server-Side Row Model.` + (alt ? ` Please use ${alt} instead.` : '');\n if (this.gridOptionsService.exists('groupDefaultExpanded')) {\n console.warn(msg('groupDefaultExpanded', 'isServerSideGroupOpenByDefault callback'));\n }\n if (this.gridOptionsService.exists('groupIncludeFooter') && this.gridOptionsService.is('suppressServerSideInfiniteScroll')) {\n console.warn(msg('groupIncludeFooter'));\n }\n if (this.gridOptionsService.exists('groupIncludeTotalFooter')) {\n console.warn(msg('groupIncludeTotalFooter'));\n }\n }\n if (this.gridOptionsService.is('enableRangeSelection')) {\n ModuleRegistry.__assertRegistered(ModuleNames.RangeSelectionModule, 'enableRangeSelection', this.gridOptionsService.getGridId());\n } else if (this.gridOptionsService.is('enableRangeHandle') || this.gridOptionsService.is('enableFillHandle')) {\n console.warn(\"AG Grid: 'enableRangeHandle' or 'enableFillHandle' will not work unless 'enableRangeSelection' is set to true\");\n }\n const validateRegistered = (prop, module) => this.gridOptionsService.exists(prop) && ModuleRegistry.__assertRegistered(module, prop, this.gridOptionsService.getGridId());\n // Ensure the SideBar is registered which will then lead them to register Column / Filter Tool panels as required by their config.\n // It is possible to use the SideBar only with your own custom tool panels.\n validateRegistered('sideBar', ModuleNames.SideBarModule);\n validateRegistered('statusBar', ModuleNames.StatusBarModule);\n validateRegistered('enableCharts', ModuleNames.GridChartsModule);\n validateRegistered('getMainMenuItems', ModuleNames.MenuModule);\n validateRegistered('getContextMenuItems', ModuleNames.MenuModule);\n validateRegistered('allowContextMenuWithControlKey', ModuleNames.MenuModule);\n validateRegistered('enableAdvancedFilter', ModuleNames.AdvancedFilterModule);\n }\n checkColumnDefProperties() {\n if (this.gridOptions.columnDefs == null) {\n return;\n }\n const validProperties = ColDefUtil.ALL_PROPERTIES;\n const validateColDef = (colDef, propertyName) => {\n const userProperties = Object.getOwnPropertyNames(colDef);\n this.checkProperties(userProperties, [...validProperties, ...VUE_FRAMEWORK_PROPS], validProperties, propertyName, 'https://www.ag-grid.com/javascript-data-grid/column-properties/');\n if (colDef.children) {\n colDef.children.forEach(child => validateColDef(child, 'columnDefs.children'));\n }\n };\n this.gridOptions.columnDefs.forEach(colDef => validateColDef(colDef, 'columnDefs'));\n if (this.gridOptions.defaultColDef) {\n validateColDef(this.gridOptions.defaultColDef, 'defaultColDef');\n }\n }\n checkColumnDefViolations() {\n var _a;\n const rowModel = (_a = this.gridOptionsService.get('rowModelType')) !== null && _a !== void 0 ? _a : 'clientSide';\n const unsupportedPropertiesMap = {\n infinite: ['headerCheckboxSelection', 'headerCheckboxSelectionFilteredOnly', 'headerCheckboxSelectionCurrentPageOnly'],\n viewport: ['headerCheckboxSelection', 'headerCheckboxSelectionFilteredOnly', 'headerCheckboxSelectionCurrentPageOnly'],\n serverSide: ['headerCheckboxSelectionFilteredOnly', 'headerCheckboxSelectionCurrentPageOnly'],\n clientSide: []\n };\n const unsupportedProperties = unsupportedPropertiesMap[rowModel];\n if (!(unsupportedProperties === null || unsupportedProperties === void 0 ? void 0 : unsupportedProperties.length)) {\n return;\n }\n const validateColDef = colDef => {\n unsupportedProperties.forEach(property => {\n if (property in colDef && !!colDef[property]) {\n console.warn(`AG Grid: Column property ${property} is not supported with the row model type ${rowModel}.`);\n }\n });\n };\n if (this.gridOptions.columnDefs != null) {\n this.gridOptions.columnDefs.forEach(colDef => validateColDef(colDef));\n }\n if (this.gridOptions.autoGroupColumnDef != null) {\n validateColDef(this.gridOptions.autoGroupColumnDef);\n }\n if (this.gridOptions.defaultColDef != null) {\n validateColDef(this.gridOptions.defaultColDef);\n }\n }\n checkGridOptionsProperties() {\n const userProperties = Object.getOwnPropertyNames(this.gridOptions);\n const validProperties = [...PropertyKeys.ALL_PROPERTIES, ...ComponentUtil.EVENT_CALLBACKS];\n const validPropertiesAndExceptions = [...validProperties, 'api', 'columnApi', ...VUE_FRAMEWORK_PROPS, ...Object.keys(this.deprecatedProperties)];\n this.checkProperties(userProperties, validPropertiesAndExceptions, validProperties, 'gridOptions', 'https://www.ag-grid.com/javascript-data-grid/grid-options/');\n }\n checkProperties(userProperties, validPropertiesAndExceptions, validProperties, containerName, docsUrl) {\n const invalidProperties = fuzzyCheckStrings(userProperties, validPropertiesAndExceptions, validProperties);\n iterateObject(invalidProperties, (key, value) => {\n doOnce(() => console.warn(`AG Grid: invalid ${containerName} property '${key}' did you mean any of these: ${value.slice(0, 8).join(\", \")}`), 'invalidProperty' + containerName + key);\n });\n if (Object.keys(invalidProperties).length > 0) {\n doOnce(() => console.warn(`AG Grid: to see all the valid ${containerName} properties please check: ${docsUrl}`), 'invalidProperties' + containerName + docsUrl);\n }\n }\n checkForDeprecated() {\n // casting to generic object, so typescript compiles even though\n // we are looking for attributes that don't exist\n const options = this.gridOptions;\n Object.entries(this.deprecatedProperties).forEach(([oldProp, details]) => {\n var _a;\n const oldPropValue = options[oldProp];\n if (oldPropValue) {\n logDeprecation(details.version, oldProp, details.newProp, details.message);\n if (details.copyToNewProp && details.newProp && options[details.newProp] == null) {\n options[details.newProp] = (_a = details.newPropValue) !== null && _a !== void 0 ? _a : oldPropValue;\n }\n }\n });\n // Manual messages and deprecation behaviour that don't fit our standard approach above.\n if (options.serverSideStoreType) {\n console.warn('AG Grid: since v29.0, `serverSideStoreType` has been replaced by `suppressServerSideInfiniteScroll`. Set to false to use Partial Store, and true to use Full Store.');\n options.suppressServerSideInfiniteScroll = options.serverSideStoreType !== 'partial';\n }\n }\n checkForViolations() {\n if (this.gridOptionsService.is('treeData')) {\n this.treeDataViolations();\n }\n }\n treeDataViolations() {\n if (this.gridOptionsService.isRowModelType('clientSide')) {\n if (!this.gridOptionsService.exists('getDataPath')) {\n console.warn('AG Grid: property usingTreeData=true with rowModel=clientSide, but you did not ' + 'provide getDataPath function, please provide getDataPath function if using tree data.');\n }\n }\n if (this.gridOptionsService.isRowModelType('serverSide')) {\n if (!this.gridOptionsService.exists('isServerSideGroup')) {\n console.warn('AG Grid: property usingTreeData=true with rowModel=serverSide, but you did not ' + 'provide isServerSideGroup function, please provide isServerSideGroup function if using tree data.');\n }\n if (!this.gridOptionsService.exists('getServerSideGroupKey')) {\n console.warn('AG Grid: property usingTreeData=true with rowModel=serverSide, but you did not ' + 'provide getServerSideGroupKey function, please provide getServerSideGroupKey function if using tree data.');\n }\n }\n }\n};\n__decorate([Autowired('gridOptions')], GridOptionsValidator.prototype, \"gridOptions\", void 0);\n__decorate([Autowired('gridOptionsService')], GridOptionsValidator.prototype, \"gridOptionsService\", void 0);\n__decorate([PostConstruct], GridOptionsValidator.prototype, \"init\", null);\nGridOptionsValidator = __decorate([Bean('gridOptionsValidator')], GridOptionsValidator);\nexport { GridOptionsValidator };\nexport function matchesGroupDisplayType(toMatch, supplied) {\n const groupDisplayTypeValues = ['groupRows', 'multipleColumns', 'custom', 'singleColumn'];\n if (groupDisplayTypeValues.indexOf(supplied) < 0) {\n console.warn(`AG Grid: '${supplied}' is not a valid groupDisplayType value - possible values are: '${groupDisplayTypeValues.join(\"', '\")}'`);\n return false;\n }\n return supplied === toMatch;\n}\nexport function matchesTreeDataDisplayType(toMatch, supplied) {\n const treeDataDisplayTypeValues = ['auto', 'custom'];\n if (treeDataDisplayTypeValues.indexOf(supplied) < 0) {\n console.warn(`AG Grid: '${supplied}' is not a valid treeDataDisplayType value - possible values are: '${treeDataDisplayTypeValues.join(\"', '\")}'`);\n return false;\n }\n return supplied === toMatch;\n}","var __decorate = this && this.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nvar __param = this && this.__param || function (paramIndex, decorator) {\n return function (target, key) {\n decorator(target, key, paramIndex);\n };\n};\nvar __rest = this && this.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\nimport { ColumnGroup } from '../entities/columnGroup.mjs';\nimport { Column } from '../entities/column.mjs';\nimport { Events } from '../events.mjs';\nimport { BeanStub } from \"../context/beanStub.mjs\";\nimport { ProvidedColumnGroup } from '../entities/providedColumnGroup.mjs';\nimport { GroupInstanceIdCreator } from './groupInstanceIdCreator.mjs';\nimport { Autowired, Bean, Optional, PostConstruct, PreDestroy, Qualifier } from '../context/context.mjs';\nimport { GROUP_AUTO_COLUMN_ID } from './autoGroupColService.mjs';\nimport { areEqual, last, removeFromArray, moveInArray, includes, insertIntoArray, removeAllFromUnorderedArray, removeFromUnorderedArray } from '../utils/array.mjs';\nimport { missingOrEmpty, exists, missing, attrToBoolean, attrToNumber } from '../utils/generic.mjs';\nimport { camelCaseToHumanText } from '../utils/string.mjs';\nimport { convertToMap } from '../utils/map.mjs';\nimport { doOnce } from '../utils/function.mjs';\nimport { matchesGroupDisplayType, matchesTreeDataDisplayType } from '../gridOptionsValidator.mjs';\nlet ColumnModel = class ColumnModel extends BeanStub {\n constructor() {\n super(...arguments);\n // header row count, based on user provided columns\n this.primaryHeaderRowCount = 0;\n this.secondaryHeaderRowCount = 0;\n // header row count, either above, or based on pivoting if we are pivoting\n this.gridHeaderRowCount = 0;\n // leave level columns of the displayed trees\n this.displayedColumnsLeft = [];\n this.displayedColumnsRight = [];\n this.displayedColumnsCenter = [];\n // all three lists above combined\n this.displayedColumns = [];\n // for fast lookup, to see if a column or group is still displayed\n this.displayedColumnsAndGroupsMap = {};\n // all columns to be rendered\n this.viewportColumns = [];\n // A hash key to keep track of changes in viewport columns\n this.viewportColumnsHash = '';\n // same as viewportColumns, except we always include columns with headerAutoHeight\n this.headerViewportColumns = [];\n // all columns to be rendered in the centre\n this.viewportColumnsCenter = [];\n // same as viewportColumnsCenter, except we always include columns with headerAutoHeight\n this.headerViewportColumnsCenter = [];\n this.autoHeightActiveAtLeastOnce = false;\n this.rowGroupColumns = [];\n this.valueColumns = [];\n this.pivotColumns = [];\n this.ready = false;\n this.autoGroupsNeedBuilding = false;\n this.forceRecreateAutoGroups = false;\n this.pivotMode = false;\n this.bodyWidth = 0;\n this.leftWidth = 0;\n this.rightWidth = 0;\n this.bodyWidthDirty = true;\n // when we're waiting for cell data types to be inferred, we need to defer column resizing\n this.shouldQueueResizeOperations = false;\n this.resizeOperationQueue = [];\n }\n init() {\n this.suppressColumnVirtualisation = this.gridOptionsService.is('suppressColumnVirtualisation');\n const pivotMode = this.gridOptionsService.is('pivotMode');\n if (this.isPivotSettingAllowed(pivotMode)) {\n this.pivotMode = pivotMode;\n }\n this.usingTreeData = this.gridOptionsService.isTreeData();\n this.addManagedPropertyListener('groupDisplayType', () => this.onGroupDisplayTypeChanged());\n this.addManagedPropertyListener('autoGroupColumnDef', () => this.onAutoGroupColumnDefChanged());\n this.addManagedPropertyListener('defaultColDef', params => this.onSharedColDefChanged(params.source));\n this.addManagedPropertyListener('columnTypes', params => this.onSharedColDefChanged(params.source));\n }\n onGroupDisplayTypeChanged() {\n // Possible for update to be called before columns are present in which case there is nothing to do here.\n if (!this.columnDefs) {\n return;\n }\n this.autoGroupsNeedBuilding = true;\n this.forceRecreateAutoGroups = true;\n this.updateGridColumns();\n this.updateDisplayedColumns('gridOptionsChanged');\n }\n onAutoGroupColumnDefChanged() {\n if (this.groupAutoColumns) {\n this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns);\n }\n }\n onSharedColDefChanged(source = 'api') {\n // if we aren't going to force, update the auto cols in place\n if (this.groupAutoColumns) {\n this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns);\n }\n this.createColumnsFromColumnDefs(true, source);\n }\n setColumnDefs(columnDefs, source = 'api') {\n const colsPreviouslyExisted = !!this.columnDefs;\n this.columnDefs = columnDefs;\n this.createColumnsFromColumnDefs(colsPreviouslyExisted, source);\n }\n recreateColumnDefs(source = 'api') {\n this.onSharedColDefChanged(source);\n }\n destroyOldColumns(oldTree, newTree) {\n const oldObjectsById = {};\n if (!oldTree) {\n return;\n }\n // add in all old columns to be destroyed\n this.columnUtils.depthFirstOriginalTreeSearch(null, oldTree, child => {\n oldObjectsById[child.getInstanceId()] = child;\n });\n // however we don't destroy anything in the new tree. if destroying the grid, there is no new tree\n if (newTree) {\n this.columnUtils.depthFirstOriginalTreeSearch(null, newTree, child => {\n oldObjectsById[child.getInstanceId()] = null;\n });\n }\n // what's left can be destroyed\n const colsToDestroy = Object.values(oldObjectsById).filter(item => item != null);\n this.destroyBeans(colsToDestroy);\n }\n destroyColumns() {\n this.destroyOldColumns(this.primaryColumnTree);\n this.destroyOldColumns(this.secondaryBalancedTree);\n this.destroyOldColumns(this.groupAutoColsBalancedTree);\n }\n createColumnsFromColumnDefs(colsPreviouslyExisted, source = 'api') {\n // only need to dispatch before/after events if updating columns, never if setting columns for first time\n const dispatchEventsFunc = colsPreviouslyExisted ? this.compareColumnStatesAndDispatchEvents(source) : undefined;\n // always invalidate cache on changing columns, as the column id's for the new columns\n // could overlap with the old id's, so the cache would return old values for new columns.\n this.valueCache.expire();\n // NOTE ==================\n // we should be destroying the existing columns and groups if they exist, for example, the original column\n // group adds a listener to the columns, it should be also removing the listeners\n this.autoGroupsNeedBuilding = true;\n const oldPrimaryColumns = this.primaryColumns;\n const oldPrimaryTree = this.primaryColumnTree;\n const balancedTreeResult = this.columnFactory.createColumnTree(this.columnDefs, true, oldPrimaryTree);\n this.destroyOldColumns(this.primaryColumnTree, balancedTreeResult.columnTree);\n this.primaryColumnTree = balancedTreeResult.columnTree;\n this.primaryHeaderRowCount = balancedTreeResult.treeDept + 1;\n this.primaryColumns = this.getColumnsFromTree(this.primaryColumnTree);\n this.primaryColumnsMap = {};\n this.primaryColumns.forEach(col => this.primaryColumnsMap[col.getId()] = col);\n this.extractRowGroupColumns(source, oldPrimaryColumns);\n this.extractPivotColumns(source, oldPrimaryColumns);\n this.extractValueColumns(source, oldPrimaryColumns);\n this.ready = true;\n // if we are showing secondary columns, then no need to update grid columns\n // at this point, as it's the pivot service responsibility to change these\n // if we are no longer pivoting (ie and need to revert back to primary, otherwise\n // we shouldn't be touching the primary).\n const gridColsNotProcessed = this.gridColsArePrimary === undefined;\n const processGridCols = this.gridColsArePrimary || gridColsNotProcessed;\n if (processGridCols) {\n this.updateGridColumns();\n if (colsPreviouslyExisted && !this.gridOptionsService.is('maintainColumnOrder')) {\n this.orderGridColumnsLikePrimary();\n }\n this.updateDisplayedColumns(source);\n this.checkViewportColumns();\n }\n // this event is not used by AG Grid, but left here for backwards compatibility,\n // in case applications use it\n this.dispatchEverythingChanged(source);\n if (dispatchEventsFunc) {\n dispatchEventsFunc();\n }\n this.dispatchNewColumnsLoaded(source);\n }\n dispatchNewColumnsLoaded(source) {\n const newColumnsLoadedEvent = {\n type: Events.EVENT_NEW_COLUMNS_LOADED,\n source\n };\n this.eventService.dispatchEvent(newColumnsLoadedEvent);\n }\n // this event is legacy, no grid code listens to it. instead the grid listens to New Columns Loaded\n dispatchEverythingChanged(source = 'api') {\n const eventEverythingChanged = {\n type: Events.EVENT_COLUMN_EVERYTHING_CHANGED,\n source\n };\n this.eventService.dispatchEvent(eventEverythingChanged);\n }\n orderGridColumnsLikePrimary() {\n const primaryColumns = this.primaryColumns;\n if (!primaryColumns) {\n return;\n }\n const primaryColsOrdered = primaryColumns.filter(col => this.gridColumns.indexOf(col) >= 0);\n const otherCols = this.gridColumns.filter(col => primaryColsOrdered.indexOf(col) < 0);\n this.gridColumns = [...otherCols, ...primaryColsOrdered];\n this.gridColumns = this.placeLockedColumns(this.gridColumns);\n }\n getAllDisplayedAutoHeightCols() {\n return this.displayedAutoHeightCols;\n }\n setViewport() {\n if (this.gridOptionsService.is('enableRtl')) {\n this.viewportLeft = this.bodyWidth - this.scrollPosition - this.scrollWidth;\n this.viewportRight = this.bodyWidth - this.scrollPosition;\n } else {\n this.viewportLeft = this.scrollPosition;\n this.viewportRight = this.scrollWidth + this.scrollPosition;\n }\n }\n // used by clipboard service, to know what columns to paste into\n getDisplayedColumnsStartingAt(column) {\n let currentColumn = column;\n const columns = [];\n while (currentColumn != null) {\n columns.push(currentColumn);\n currentColumn = this.getDisplayedColAfter(currentColumn);\n }\n return columns;\n }\n // checks what columns are currently displayed due to column virtualisation. dispatches an event\n // if the list of columns has changed.\n // + setColumnWidth(), setViewportPosition(), setColumnDefs(), sizeColumnsToFit()\n checkViewportColumns() {\n // check displayCenterColumnTree exists first, as it won't exist when grid is initialising\n if (this.displayedColumnsCenter == null) {\n return;\n }\n const viewportColumnsChanged = this.extractViewport();\n if (!viewportColumnsChanged) {\n return;\n }\n const event = {\n type: Events.EVENT_VIRTUAL_COLUMNS_CHANGED\n };\n this.eventService.dispatchEvent(event);\n }\n setViewportPosition(scrollWidth, scrollPosition) {\n if (scrollWidth !== this.scrollWidth || scrollPosition !== this.scrollPosition || this.bodyWidthDirty) {\n this.scrollWidth = scrollWidth;\n this.scrollPosition = scrollPosition;\n // we need to call setVirtualViewportLeftAndRight() at least once after the body width changes,\n // as the viewport can stay the same, but in RTL, if body width changes, we need to work out the\n // virtual columns again\n this.bodyWidthDirty = true;\n this.setViewport();\n if (this.ready) {\n this.checkViewportColumns();\n }\n }\n }\n isPivotMode() {\n return this.pivotMode;\n }\n isPivotSettingAllowed(pivot) {\n if (pivot && this.gridOptionsService.isTreeData()) {\n console.warn(\"AG Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'\");\n return false;\n }\n return true;\n }\n setPivotMode(pivotMode, source = 'api') {\n if (pivotMode === this.pivotMode || !this.isPivotSettingAllowed(this.pivotMode)) {\n return;\n }\n this.pivotMode = pivotMode;\n // we need to update grid columns to cover the scenario where user has groupDisplayType = 'custom', as\n // this means we don't use auto group column UNLESS we are in pivot mode (it's mandatory in pivot mode),\n // so need to updateGridColumn() to check it autoGroupCol needs to be added / removed\n this.autoGroupsNeedBuilding = true;\n this.updateGridColumns();\n this.updateDisplayedColumns(source);\n const event = {\n type: Events.EVENT_COLUMN_PIVOT_MODE_CHANGED\n };\n this.eventService.dispatchEvent(event);\n }\n getSecondaryPivotColumn(pivotKeys, valueColKey) {\n if (missing(this.secondaryColumns)) {\n return null;\n }\n const valueColumnToFind = this.getPrimaryColumn(valueColKey);\n let foundColumn = null;\n this.secondaryColumns.forEach(column => {\n const thisPivotKeys = column.getColDef().pivotKeys;\n const pivotValueColumn = column.getColDef().pivotValueColumn;\n const pivotKeyMatches = areEqual(thisPivotKeys, pivotKeys);\n const pivotValueMatches = pivotValueColumn === valueColumnToFind;\n if (pivotKeyMatches && pivotValueMatches) {\n foundColumn = column;\n }\n });\n return foundColumn;\n }\n setBeans(loggerFactory) {\n this.logger = loggerFactory.create('columnModel');\n }\n setFirstRightAndLastLeftPinned(source) {\n let lastLeft;\n let firstRight;\n if (this.gridOptionsService.is('enableRtl')) {\n lastLeft = this.displayedColumnsLeft ? this.displayedColumnsLeft[0] : null;\n firstRight = this.displayedColumnsRight ? last(this.displayedColumnsRight) : null;\n } else {\n lastLeft = this.displayedColumnsLeft ? last(this.displayedColumnsLeft) : null;\n firstRight = this.displayedColumnsRight ? this.displayedColumnsRight[0] : null;\n }\n this.gridColumns.forEach(column => {\n column.setLastLeftPinned(column === lastLeft, source);\n column.setFirstRightPinned(column === firstRight, source);\n });\n }\n autoSizeColumns(params) {\n if (this.shouldQueueResizeOperations) {\n this.resizeOperationQueue.push(() => this.autoSizeColumns(params));\n return;\n }\n const {\n columns,\n skipHeader,\n skipHeaderGroups,\n stopAtGroup,\n source = 'api'\n } = params;\n // because of column virtualisation, we can only do this function on columns that are\n // actually rendered, as non-rendered columns (outside the viewport and not rendered\n // due to column virtualisation) are not present. this can result in all rendered columns\n // getting narrowed, which in turn introduces more rendered columns on the RHS which\n // did not get autosized in the original run, leaving the visible grid with columns on\n // the LHS sized, but RHS no. so we keep looping through the visible columns until\n // no more cols are available (rendered) to be resized\n // we autosize after animation frames finish in case any cell renderers need to complete first. this can\n // happen eg if client code is calling api.autoSizeAllColumns() straight after grid is initialised, but grid\n // hasn't fully drawn out all the cells yet (due to cell renderers in animation frames).\n this.animationFrameService.flushAllFrames();\n // keep track of which cols we have resized in here\n const columnsAutosized = [];\n // initialise with anything except 0 so that while loop executes at least once\n let changesThisTimeAround = -1;\n const shouldSkipHeader = skipHeader != null ? skipHeader : this.gridOptionsService.is('skipHeaderOnAutoSize');\n const shouldSkipHeaderGroups = skipHeaderGroups != null ? skipHeaderGroups : shouldSkipHeader;\n while (changesThisTimeAround !== 0) {\n changesThisTimeAround = 0;\n this.actionOnGridColumns(columns, column => {\n // if already autosized, skip it\n if (columnsAutosized.indexOf(column) >= 0) {\n return false;\n }\n // get how wide this col should be\n const preferredWidth = this.autoWidthCalculator.getPreferredWidthForColumn(column, shouldSkipHeader);\n // preferredWidth = -1 if this col is not on the screen\n if (preferredWidth > 0) {\n const newWidth = this.normaliseColumnWidth(column, preferredWidth);\n column.setActualWidth(newWidth, source);\n columnsAutosized.push(column);\n changesThisTimeAround++;\n }\n return true;\n }, source);\n }\n if (!shouldSkipHeaderGroups) {\n this.autoSizeColumnGroupsByColumns(columns, source, stopAtGroup);\n }\n this.dispatchColumnResizedEvent(columnsAutosized, true, 'autosizeColumns');\n }\n dispatchColumnResizedEvent(columns, finished, source, flexColumns = null) {\n if (columns && columns.length) {\n const event = {\n type: Events.EVENT_COLUMN_RESIZED,\n columns: columns,\n column: columns.length === 1 ? columns[0] : null,\n flexColumns: flexColumns,\n finished: finished,\n source: source\n };\n this.eventService.dispatchEvent(event);\n }\n }\n dispatchColumnChangedEvent(type, columns, source) {\n const event = {\n type: type,\n columns: columns,\n column: columns && columns.length == 1 ? columns[0] : null,\n source: source\n };\n this.eventService.dispatchEvent(event);\n }\n dispatchColumnMovedEvent(params) {\n const {\n movedColumns,\n source,\n toIndex,\n finished\n } = params;\n const event = {\n type: Events.EVENT_COLUMN_MOVED,\n columns: movedColumns,\n column: movedColumns && movedColumns.length === 1 ? movedColumns[0] : null,\n toIndex,\n finished,\n source\n };\n this.eventService.dispatchEvent(event);\n }\n dispatchColumnPinnedEvent(changedColumns, source) {\n if (!changedColumns.length) {\n return;\n }\n // if just one column, we use this, otherwise we don't include the col\n const column = changedColumns.length === 1 ? changedColumns[0] : null;\n // only include visible if it's common in all columns\n const pinned = this.getCommonValue(changedColumns, col => col.getPinned());\n const event = {\n type: Events.EVENT_COLUMN_PINNED,\n // mistake in typing, 'undefined' should be allowed, as 'null' means 'not pinned'\n pinned: pinned != null ? pinned : null,\n columns: changedColumns,\n column,\n source: source\n };\n this.eventService.dispatchEvent(event);\n }\n dispatchColumnVisibleEvent(changedColumns, source) {\n if (!changedColumns.length) {\n return;\n }\n // if just one column, we use this, otherwise we don't include the col\n const column = changedColumns.length === 1 ? changedColumns[0] : null;\n // only include visible if it's common in all columns\n const visible = this.getCommonValue(changedColumns, col => col.isVisible());\n const event = {\n type: Events.EVENT_COLUMN_VISIBLE,\n visible,\n columns: changedColumns,\n column,\n source: source\n };\n this.eventService.dispatchEvent(event);\n }\n autoSizeColumn(key, skipHeader, source = \"api\") {\n if (key) {\n this.autoSizeColumns({\n columns: [key],\n skipHeader,\n skipHeaderGroups: true,\n source\n });\n }\n }\n autoSizeColumnGroupsByColumns(keys, source, stopAtGroup) {\n const columnGroups = new Set();\n const columns = this.getGridColumns(keys);\n columns.forEach(col => {\n let parent = col.getParent();\n while (parent && parent != stopAtGroup) {\n if (!parent.isPadding()) {\n columnGroups.add(parent);\n }\n parent = parent.getParent();\n }\n });\n let headerGroupCtrl;\n const resizedColumns = [];\n for (const columnGroup of columnGroups) {\n for (const headerContainerCtrl of this.ctrlsService.getHeaderRowContainerCtrls()) {\n headerGroupCtrl = headerContainerCtrl.getHeaderCtrlForColumn(columnGroup);\n if (headerGroupCtrl) {\n break;\n }\n }\n if (headerGroupCtrl) {\n headerGroupCtrl.resizeLeafColumnsToFit(source);\n }\n }\n return resizedColumns;\n }\n autoSizeAllColumns(skipHeader, source = \"api\") {\n if (this.shouldQueueResizeOperations) {\n this.resizeOperationQueue.push(() => this.autoSizeAllColumns(skipHeader, source));\n return;\n }\n const allDisplayedColumns = this.getAllDisplayedColumns();\n this.autoSizeColumns({\n columns: allDisplayedColumns,\n skipHeader,\n source\n });\n }\n // Possible candidate for reuse (alot of recursive traversal duplication)\n getColumnsFromTree(rootColumns) {\n const result = [];\n const recursiveFindColumns = childColumns => {\n for (let i = 0; i < childColumns.length; i++) {\n const child = childColumns[i];\n if (child instanceof Column) {\n result.push(child);\n } else if (child instanceof ProvidedColumnGroup) {\n recursiveFindColumns(child.getChildren());\n }\n }\n };\n recursiveFindColumns(rootColumns);\n return result;\n }\n getAllDisplayedTrees() {\n if (this.displayedTreeLeft && this.displayedTreeRight && this.displayedTreeCentre) {\n return this.displayedTreeLeft.concat(this.displayedTreeCentre).concat(this.displayedTreeRight);\n }\n return null;\n }\n // + columnSelectPanel\n getPrimaryColumnTree() {\n return this.primaryColumnTree;\n }\n // + gridPanel -> for resizing the body and setting top margin\n getHeaderRowCount() {\n return this.gridHeaderRowCount;\n }\n // + headerRenderer -> setting pinned body width\n getDisplayedTreeLeft() {\n return this.displayedTreeLeft;\n }\n // + headerRenderer -> setting pinned body width\n getDisplayedTreeRight() {\n return this.displayedTreeRight;\n }\n // + headerRenderer -> setting pinned body width\n getDisplayedTreeCentre() {\n return this.displayedTreeCentre;\n }\n // gridPanel -> ensureColumnVisible\n isColumnDisplayed(column) {\n return this.getAllDisplayedColumns().indexOf(column) >= 0;\n }\n // + csvCreator\n getAllDisplayedColumns() {\n return this.displayedColumns;\n }\n getViewportColumns() {\n return this.viewportColumns;\n }\n getDisplayedLeftColumnsForRow(rowNode) {\n if (!this.colSpanActive) {\n return this.displayedColumnsLeft;\n }\n return this.getDisplayedColumnsForRow(rowNode, this.displayedColumnsLeft);\n }\n getDisplayedRightColumnsForRow(rowNode) {\n if (!this.colSpanActive) {\n return this.displayedColumnsRight;\n }\n return this.getDisplayedColumnsForRow(rowNode, this.displayedColumnsRight);\n }\n isColSpanActive() {\n return this.colSpanActive;\n }\n getDisplayedColumnsForRow(rowNode, displayedColumns, filterCallback, emptySpaceBeforeColumn) {\n const result = [];\n let lastConsideredCol = null;\n for (let i = 0; i < displayedColumns.length; i++) {\n const col = displayedColumns[i];\n const maxAllowedColSpan = displayedColumns.length - i;\n const colSpan = Math.min(col.getColSpan(rowNode), maxAllowedColSpan);\n const columnsToCheckFilter = [col];\n if (colSpan > 1) {\n const colsToRemove = colSpan - 1;\n for (let j = 1; j <= colsToRemove; j++) {\n columnsToCheckFilter.push(displayedColumns[i + j]);\n }\n i += colsToRemove;\n }\n // see which cols we should take out for column virtualisation\n let filterPasses;\n if (filterCallback) {\n // if user provided a callback, means some columns may not be in the viewport.\n // the user will NOT provide a callback if we are talking about pinned areas,\n // as pinned areas have no horizontal scroll and do not virtualise the columns.\n // if lots of columns, that means column spanning, and we set filterPasses = true\n // if one or more of the columns spanned pass the filter.\n filterPasses = false;\n columnsToCheckFilter.forEach(colForFilter => {\n if (filterCallback(colForFilter)) {\n filterPasses = true;\n }\n });\n } else {\n filterPasses = true;\n }\n if (filterPasses) {\n if (result.length === 0 && lastConsideredCol) {\n const gapBeforeColumn = emptySpaceBeforeColumn ? emptySpaceBeforeColumn(col) : false;\n if (gapBeforeColumn) {\n result.push(lastConsideredCol);\n }\n }\n result.push(col);\n }\n lastConsideredCol = col;\n }\n return result;\n }\n // + rowRenderer\n // if we are not column spanning, this just returns back the virtual centre columns,\n // however if we are column spanning, then different rows can have different virtual\n // columns, so we have to work out the list for each individual row.\n getViewportCenterColumnsForRow(rowNode) {\n if (!this.colSpanActive) {\n return this.viewportColumnsCenter;\n }\n const emptySpaceBeforeColumn = col => {\n const left = col.getLeft();\n return exists(left) && left > this.viewportLeft;\n };\n // if doing column virtualisation, then we filter based on the viewport.\n const filterCallback = this.suppressColumnVirtualisation ? null : this.isColumnInRowViewport.bind(this);\n return this.getDisplayedColumnsForRow(rowNode, this.displayedColumnsCenter, filterCallback, emptySpaceBeforeColumn);\n }\n getAriaColumnIndex(col) {\n return this.getAllGridColumns().indexOf(col) + 1;\n }\n isColumnInHeaderViewport(col) {\n // for headers, we never filter out autoHeaderHeight columns, if calculating\n if (col.isAutoHeaderHeight()) {\n return true;\n }\n return this.isColumnInRowViewport(col);\n }\n isColumnInRowViewport(col) {\n // we never filter out autoHeight columns, as we need them in the DOM for calculating Auto Height\n if (col.isAutoHeight()) {\n return true;\n }\n const columnLeft = col.getLeft() || 0;\n const columnRight = columnLeft + col.getActualWidth();\n // adding 200 for buffer size, so some cols off viewport are rendered.\n // this helps horizontal scrolling so user rarely sees white space (unless\n // they scroll horizontally fast). however we are conservative, as the more\n // buffer the slower the vertical redraw speed\n const leftBounds = this.viewportLeft - 200;\n const rightBounds = this.viewportRight + 200;\n const columnToMuchLeft = columnLeft < leftBounds && columnRight < leftBounds;\n const columnToMuchRight = columnLeft > rightBounds && columnRight > rightBounds;\n return !columnToMuchLeft && !columnToMuchRight;\n }\n // used by:\n // + angularGrid -> setting pinned body width\n // note: this should be cached\n getDisplayedColumnsLeftWidth() {\n return this.getWidthOfColsInList(this.displayedColumnsLeft);\n }\n // note: this should be cached\n getDisplayedColumnsRightWidth() {\n return this.getWidthOfColsInList(this.displayedColumnsRight);\n }\n updatePrimaryColumnList(keys, masterList, actionIsAdd, columnCallback, eventType, source = \"api\") {\n if (!keys || missingOrEmpty(keys)) {\n return;\n }\n let atLeastOne = false;\n keys.forEach(key => {\n const columnToAdd = this.getPrimaryColumn(key);\n if (!columnToAdd) {\n return;\n }\n if (actionIsAdd) {\n if (masterList.indexOf(columnToAdd) >= 0) {\n return;\n }\n masterList.push(columnToAdd);\n } else {\n if (masterList.indexOf(columnToAdd) < 0) {\n return;\n }\n removeFromArray(masterList, columnToAdd);\n }\n columnCallback(columnToAdd);\n atLeastOne = true;\n });\n if (!atLeastOne) {\n return;\n }\n if (this.autoGroupsNeedBuilding) {\n this.updateGridColumns();\n }\n this.updateDisplayedColumns(source);\n const event = {\n type: eventType,\n columns: masterList,\n column: masterList.length === 1 ? masterList[0] : null,\n source: source\n };\n this.eventService.dispatchEvent(event);\n }\n setRowGroupColumns(colKeys, source = \"api\") {\n this.autoGroupsNeedBuilding = true;\n this.setPrimaryColumnList(colKeys, this.rowGroupColumns, Events.EVENT_COLUMN_ROW_GROUP_CHANGED, true, this.setRowGroupActive.bind(this), source);\n }\n setRowGroupActive(active, column, source) {\n if (active === column.isRowGroupActive()) {\n return;\n }\n column.setRowGroupActive(active, source);\n if (active && !this.gridOptionsService.is('suppressRowGroupHidesColumns')) {\n this.setColumnVisible(column, false, source);\n }\n if (!active && !this.gridOptionsService.is('suppressMakeColumnVisibleAfterUnGroup')) {\n this.setColumnVisible(column, true, source);\n }\n }\n addRowGroupColumn(key, source = \"api\") {\n if (key) {\n this.addRowGroupColumns([key], source);\n }\n }\n addRowGroupColumns(keys, source = \"api\") {\n this.autoGroupsNeedBuilding = true;\n this.updatePrimaryColumnList(keys, this.rowGroupColumns, true, this.setRowGroupActive.bind(this, true), Events.EVENT_COLUMN_ROW_GROUP_CHANGED, source);\n }\n removeRowGroupColumns(keys, source = \"api\") {\n this.autoGroupsNeedBuilding = true;\n this.updatePrimaryColumnList(keys, this.rowGroupColumns, false, this.setRowGroupActive.bind(this, false), Events.EVENT_COLUMN_ROW_GROUP_CHANGED, source);\n }\n removeRowGroupColumn(key, source = \"api\") {\n if (key) {\n this.removeRowGroupColumns([key], source);\n }\n }\n addPivotColumns(keys, source = \"api\") {\n this.updatePrimaryColumnList(keys, this.pivotColumns, true, column => column.setPivotActive(true, source), Events.EVENT_COLUMN_PIVOT_CHANGED, source);\n }\n setPivotColumns(colKeys, source = \"api\") {\n this.setPrimaryColumnList(colKeys, this.pivotColumns, Events.EVENT_COLUMN_PIVOT_CHANGED, true, (added, column) => {\n column.setPivotActive(added, source);\n }, source);\n }\n addPivotColumn(key, source = \"api\") {\n this.addPivotColumns([key], source);\n }\n removePivotColumns(keys, source = \"api\") {\n this.updatePrimaryColumnList(keys, this.pivotColumns, false, column => column.setPivotActive(false, source), Events.EVENT_COLUMN_PIVOT_CHANGED, source);\n }\n removePivotColumn(key, source = \"api\") {\n this.removePivotColumns([key], source);\n }\n setPrimaryColumnList(colKeys, masterList, eventName, detectOrderChange, columnCallback, source) {\n const changes = new Map();\n // store all original cols and their index.\n masterList.forEach((col, idx) => changes.set(col, idx));\n masterList.length = 0;\n if (exists(colKeys)) {\n colKeys.forEach(key => {\n const column = this.getPrimaryColumn(key);\n if (column) {\n masterList.push(column);\n }\n });\n }\n masterList.forEach((col, idx) => {\n const oldIndex = changes.get(col);\n // if the column was not in the list, we add it as it's a change\n // idx is irrelevant now.\n if (oldIndex === undefined) {\n changes.set(col, 0);\n return;\n }\n if (detectOrderChange && oldIndex !== idx) {\n // if we're detecting order changes, and the indexes differ, we retain this as it's changed\n return;\n }\n // otherwise remove this col, as it's unchanged.\n changes.delete(col);\n });\n (this.primaryColumns || []).forEach(column => {\n const added = masterList.indexOf(column) >= 0;\n columnCallback(added, column);\n });\n if (this.autoGroupsNeedBuilding) {\n this.updateGridColumns();\n }\n this.updateDisplayedColumns(source);\n this.dispatchColumnChangedEvent(eventName, [...changes.keys()], source);\n }\n setValueColumns(colKeys, source = \"api\") {\n this.setPrimaryColumnList(colKeys, this.valueColumns, Events.EVENT_COLUMN_VALUE_CHANGED, false, this.setValueActive.bind(this), source);\n }\n setValueActive(active, column, source) {\n if (active === column.isValueActive()) {\n return;\n }\n column.setValueActive(active, source);\n if (active && !column.getAggFunc()) {\n const initialAggFunc = this.aggFuncService.getDefaultAggFunc(column);\n column.setAggFunc(initialAggFunc);\n }\n }\n addValueColumns(keys, source = \"api\") {\n this.updatePrimaryColumnList(keys, this.valueColumns, true, this.setValueActive.bind(this, true), Events.EVENT_COLUMN_VALUE_CHANGED, source);\n }\n addValueColumn(colKey, source = \"api\") {\n if (colKey) {\n this.addValueColumns([colKey], source);\n }\n }\n removeValueColumn(colKey, source = \"api\") {\n this.removeValueColumns([colKey], source);\n }\n removeValueColumns(keys, source = \"api\") {\n this.updatePrimaryColumnList(keys, this.valueColumns, false, this.setValueActive.bind(this, false), Events.EVENT_COLUMN_VALUE_CHANGED, source);\n }\n // returns the width we can set to this col, taking into consideration min and max widths\n normaliseColumnWidth(column, newWidth) {\n const minWidth = column.getMinWidth();\n if (exists(minWidth) && newWidth < minWidth) {\n newWidth = minWidth;\n }\n const maxWidth = column.getMaxWidth();\n if (exists(maxWidth) && column.isGreaterThanMax(newWidth)) {\n newWidth = maxWidth;\n }\n return newWidth;\n }\n getPrimaryOrGridColumn(key) {\n const column = this.getPrimaryColumn(key);\n return column || this.getGridColumn(key);\n }\n setColumnWidths(columnWidths, shiftKey,\n // @takeFromAdjacent - if user has 'shift' pressed, then pixels are taken from adjacent column\n finished,\n // @finished - ends up in the event, tells the user if more events are to come\n source = \"api\") {\n const sets = [];\n columnWidths.forEach(columnWidth => {\n const col = this.getPrimaryOrGridColumn(columnWidth.key);\n if (!col) {\n return;\n }\n sets.push({\n width: columnWidth.newWidth,\n ratios: [1],\n columns: [col]\n });\n // if user wants to do shift resize by default, then we invert the shift operation\n const defaultIsShift = this.gridOptionsService.get('colResizeDefault') === 'shift';\n if (defaultIsShift) {\n shiftKey = !shiftKey;\n }\n if (shiftKey) {\n const otherCol = this.getDisplayedColAfter(col);\n if (!otherCol) {\n return;\n }\n const widthDiff = col.getActualWidth() - columnWidth.newWidth;\n const otherColWidth = otherCol.getActualWidth() + widthDiff;\n sets.push({\n width: otherColWidth,\n ratios: [1],\n columns: [otherCol]\n });\n }\n });\n if (sets.length === 0) {\n return;\n }\n this.resizeColumnSets({\n resizeSets: sets,\n finished,\n source\n });\n }\n checkMinAndMaxWidthsForSet(columnResizeSet) {\n const {\n columns,\n width\n } = columnResizeSet;\n // every col has a min width, so sum them all up and see if we have enough room\n // for all the min widths\n let minWidthAccumulated = 0;\n let maxWidthAccumulated = 0;\n let maxWidthActive = true;\n columns.forEach(col => {\n const minWidth = col.getMinWidth();\n minWidthAccumulated += minWidth || 0;\n const maxWidth = col.getMaxWidth();\n if (exists(maxWidth) && maxWidth > 0) {\n maxWidthAccumulated += maxWidth;\n } else {\n // if at least one columns has no max width, it means the group of columns\n // then has no max width, as at least one column can take as much width as possible\n maxWidthActive = false;\n }\n });\n const minWidthPasses = width >= minWidthAccumulated;\n const maxWidthPasses = !maxWidthActive || width <= maxWidthAccumulated;\n return minWidthPasses && maxWidthPasses;\n }\n // method takes sets of columns and resizes them. either all sets will be resized, or nothing\n // be resized. this is used for example when user tries to resize a group and holds shift key,\n // then both the current group (grows), and the adjacent group (shrinks), will get resized,\n // so that's two sets for this method.\n resizeColumnSets(params) {\n const {\n resizeSets,\n finished,\n source\n } = params;\n const passMinMaxCheck = !resizeSets || resizeSets.every(columnResizeSet => this.checkMinAndMaxWidthsForSet(columnResizeSet));\n if (!passMinMaxCheck) {\n // even though we are not going to resize beyond min/max size, we still need to dispatch event when finished\n if (finished) {\n const columns = resizeSets && resizeSets.length > 0 ? resizeSets[0].columns : null;\n this.dispatchColumnResizedEvent(columns, finished, source);\n }\n return; // don't resize!\n }\n const changedCols = [];\n const allResizedCols = [];\n resizeSets.forEach(set => {\n const {\n width,\n columns,\n ratios\n } = set;\n // keep track of pixels used, and last column gets the remaining,\n // to cater for rounding errors, and min width adjustments\n const newWidths = {};\n const finishedCols = {};\n columns.forEach(col => allResizedCols.push(col));\n // the loop below goes through each col. if a col exceeds it's min/max width,\n // it then gets set to its min/max width and the column is removed marked as 'finished'\n // and the calculation is done again leaving this column out. take for example columns\n // {A, width: 50, maxWidth: 100}\n // {B, width: 50}\n // {C, width: 50}\n // and then the set is set to width 600 - on the first pass the grid tries to set each column\n // to 200. it checks A and sees 200 > 100 and so sets the width to 100. col A is then marked\n // as 'finished' and the calculation is done again with the remaining cols B and C, which end up\n // splitting the remaining 500 pixels.\n let finishedColsGrew = true;\n let loopCount = 0;\n while (finishedColsGrew) {\n loopCount++;\n if (loopCount > 1000) {\n // this should never happen, but in the future, someone might introduce a bug here,\n // so we stop the browser from hanging and report bug properly\n console.error('AG Grid: infinite loop in resizeColumnSets');\n break;\n }\n finishedColsGrew = false;\n const subsetCols = [];\n let subsetRatioTotal = 0;\n let pixelsToDistribute = width;\n columns.forEach((col, index) => {\n const thisColFinished = finishedCols[col.getId()];\n if (thisColFinished) {\n pixelsToDistribute -= newWidths[col.getId()];\n } else {\n subsetCols.push(col);\n const ratioThisCol = ratios[index];\n subsetRatioTotal += ratioThisCol;\n }\n });\n // because we are not using all of the ratios (cols can be missing),\n // we scale the ratio. if all columns are included, then subsetRatioTotal=1,\n // and so the ratioScale will be 1.\n const ratioScale = 1 / subsetRatioTotal;\n subsetCols.forEach((col, index) => {\n const lastCol = index === subsetCols.length - 1;\n let colNewWidth;\n if (lastCol) {\n colNewWidth = pixelsToDistribute;\n } else {\n colNewWidth = Math.round(ratios[index] * width * ratioScale);\n pixelsToDistribute -= colNewWidth;\n }\n const minWidth = col.getMinWidth();\n const maxWidth = col.getMaxWidth();\n if (exists(minWidth) && colNewWidth < minWidth) {\n colNewWidth = minWidth;\n finishedCols[col.getId()] = true;\n finishedColsGrew = true;\n } else if (exists(maxWidth) && maxWidth > 0 && colNewWidth > maxWidth) {\n colNewWidth = maxWidth;\n finishedCols[col.getId()] = true;\n finishedColsGrew = true;\n }\n newWidths[col.getId()] = colNewWidth;\n });\n }\n columns.forEach(col => {\n const newWidth = newWidths[col.getId()];\n const actualWidth = col.getActualWidth();\n if (actualWidth !== newWidth) {\n col.setActualWidth(newWidth, source);\n changedCols.push(col);\n }\n });\n });\n // if no cols changed, then no need to update more or send event.\n const atLeastOneColChanged = changedCols.length > 0;\n let flexedCols = [];\n if (atLeastOneColChanged) {\n flexedCols = this.refreshFlexedColumns({\n resizingCols: allResizedCols,\n skipSetLeft: true\n });\n this.setLeftValues(source);\n this.updateBodyWidths();\n this.checkViewportColumns();\n }\n // check for change first, to avoid unnecessary firing of events\n // however we always dispatch 'finished' events. this is important\n // when groups are resized, as if the group is changing slowly,\n // eg 1 pixel at a time, then each change will dispatch change events\n // in all the columns in the group, but only one with get the pixel.\n const colsForEvent = allResizedCols.concat(flexedCols);\n if (atLeastOneColChanged || finished) {\n this.dispatchColumnResizedEvent(colsForEvent, finished, source, flexedCols);\n }\n }\n setColumnAggFunc(key, aggFunc, source = \"api\") {\n if (!key) {\n return;\n }\n const column = this.getPrimaryColumn(key);\n if (!column) {\n return;\n }\n column.setAggFunc(aggFunc);\n this.dispatchColumnChangedEvent(Events.EVENT_COLUMN_VALUE_CHANGED, [column], source);\n }\n moveRowGroupColumn(fromIndex, toIndex, source = \"api\") {\n const column = this.rowGroupColumns[fromIndex];\n const impactedColumns = this.rowGroupColumns.slice(fromIndex, toIndex);\n this.rowGroupColumns.splice(fromIndex, 1);\n this.rowGroupColumns.splice(toIndex, 0, column);\n const event = {\n type: Events.EVENT_COLUMN_ROW_GROUP_CHANGED,\n columns: impactedColumns,\n column: impactedColumns.length === 1 ? impactedColumns[0] : null,\n source: source\n };\n this.eventService.dispatchEvent(event);\n }\n moveColumns(columnsToMoveKeys, toIndex, source = \"api\", finished = true) {\n this.columnAnimationService.start();\n if (toIndex > this.gridColumns.length - columnsToMoveKeys.length) {\n console.warn('AG Grid: tried to insert columns in invalid location, toIndex = ' + toIndex);\n console.warn('AG Grid: remember that you should not count the moving columns when calculating the new index');\n return;\n }\n // we want to pull all the columns out first and put them into an ordered list\n const movedColumns = this.getGridColumns(columnsToMoveKeys);\n const failedRules = !this.doesMovePassRules(movedColumns, toIndex);\n if (failedRules) {\n return;\n }\n moveInArray(this.gridColumns, movedColumns, toIndex);\n this.updateDisplayedColumns(source);\n this.dispatchColumnMovedEvent({\n movedColumns,\n source,\n toIndex,\n finished\n });\n this.columnAnimationService.finish();\n }\n doesMovePassRules(columnsToMove, toIndex) {\n // make a copy of what the grid columns would look like after the move\n const proposedColumnOrder = this.getProposedColumnOrder(columnsToMove, toIndex);\n return this.doesOrderPassRules(proposedColumnOrder);\n }\n doesOrderPassRules(gridOrder) {\n if (!this.doesMovePassMarryChildren(gridOrder)) {\n return false;\n }\n if (!this.doesMovePassLockedPositions(gridOrder)) {\n return false;\n }\n return true;\n }\n getProposedColumnOrder(columnsToMove, toIndex) {\n const proposedColumnOrder = this.gridColumns.slice();\n moveInArray(proposedColumnOrder, columnsToMove, toIndex);\n return proposedColumnOrder;\n }\n // returns the provided cols sorted in same order as they appear in grid columns. eg if grid columns\n // contains [a,b,c,d,e] and col passed is [e,a] then the passed cols are sorted into [a,e]\n sortColumnsLikeGridColumns(cols) {\n if (!cols || cols.length <= 1) {\n return;\n }\n const notAllColsInGridColumns = cols.filter(c => this.gridColumns.indexOf(c) < 0).length > 0;\n if (notAllColsInGridColumns) {\n return;\n }\n cols.sort((a, b) => {\n const indexA = this.gridColumns.indexOf(a);\n const indexB = this.gridColumns.indexOf(b);\n return indexA - indexB;\n });\n }\n doesMovePassLockedPositions(proposedColumnOrder) {\n // Placement is a number indicating 'left' 'center' or 'right' as 0 1 2\n let lastPlacement = 0;\n let rulePassed = true;\n const lockPositionToPlacement = position => {\n if (!position) {\n // false or undefined\n return 1;\n }\n if (position === true) {\n return 0;\n }\n return position === 'left' ? 0 : 2; // Otherwise 'right'\n };\n proposedColumnOrder.forEach(col => {\n const placement = lockPositionToPlacement(col.getColDef().lockPosition);\n if (placement < lastPlacement) {\n // If placement goes down, we're not in the correct order\n rulePassed = false;\n }\n lastPlacement = placement;\n });\n return rulePassed;\n }\n doesMovePassMarryChildren(allColumnsCopy) {\n let rulePassed = true;\n this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, child => {\n if (!(child instanceof ProvidedColumnGroup)) {\n return;\n }\n const columnGroup = child;\n const colGroupDef = columnGroup.getColGroupDef();\n const marryChildren = colGroupDef && colGroupDef.marryChildren;\n if (!marryChildren) {\n return;\n }\n const newIndexes = [];\n columnGroup.getLeafColumns().forEach(col => {\n const newColIndex = allColumnsCopy.indexOf(col);\n newIndexes.push(newColIndex);\n });\n const maxIndex = Math.max.apply(Math, newIndexes);\n const minIndex = Math.min.apply(Math, newIndexes);\n // spread is how far the first column in this group is away from the last column\n const spread = maxIndex - minIndex;\n const maxSpread = columnGroup.getLeafColumns().length - 1;\n // if the columns\n if (spread > maxSpread) {\n rulePassed = false;\n }\n // console.log(`maxIndex = ${maxIndex}, minIndex = ${minIndex}, spread = ${spread}, maxSpread = ${maxSpread}, fail = ${spread > (count-1)}`)\n // console.log(allColumnsCopy.map( col => col.getColDef().field).join(','));\n });\n return rulePassed;\n }\n moveColumn(key, toIndex, source = \"api\") {\n this.moveColumns([key], toIndex, source);\n }\n moveColumnByIndex(fromIndex, toIndex, source = \"api\") {\n const column = this.gridColumns[fromIndex];\n this.moveColumn(column, toIndex, source);\n }\n getColumnDefs() {\n if (!this.primaryColumns) {\n return;\n }\n const cols = this.primaryColumns.slice();\n if (this.gridColsArePrimary) {\n cols.sort((a, b) => this.gridColumns.indexOf(a) - this.gridColumns.indexOf(b));\n } else if (this.lastPrimaryOrder) {\n cols.sort((a, b) => this.lastPrimaryOrder.indexOf(a) - this.lastPrimaryOrder.indexOf(b));\n }\n return this.columnDefFactory.buildColumnDefs(cols, this.rowGroupColumns, this.pivotColumns);\n }\n // used by:\n // + angularGrid -> for setting body width\n // + rowController -> setting main row widths (when inserting and resizing)\n // need to cache this\n getBodyContainerWidth() {\n return this.bodyWidth;\n }\n getContainerWidth(pinned) {\n switch (pinned) {\n case 'left':\n return this.leftWidth;\n case 'right':\n return this.rightWidth;\n default:\n return this.bodyWidth;\n }\n }\n // after setColumnWidth or updateGroupsAndDisplayedColumns\n updateBodyWidths() {\n const newBodyWidth = this.getWidthOfColsInList(this.displayedColumnsCenter);\n const newLeftWidth = this.getWidthOfColsInList(this.displayedColumnsLeft);\n const newRightWidth = this.getWidthOfColsInList(this.displayedColumnsRight);\n // this is used by virtual col calculation, for RTL only, as a change to body width can impact displayed\n // columns, due to RTL inverting the y coordinates\n this.bodyWidthDirty = this.bodyWidth !== newBodyWidth;\n const atLeastOneChanged = this.bodyWidth !== newBodyWidth || this.leftWidth !== newLeftWidth || this.rightWidth !== newRightWidth;\n if (atLeastOneChanged) {\n this.bodyWidth = newBodyWidth;\n this.leftWidth = newLeftWidth;\n this.rightWidth = newRightWidth;\n // when this fires, it is picked up by the gridPanel, which ends up in\n // gridPanel calling setWidthAndScrollPosition(), which in turn calls setViewportPosition()\n const event = {\n type: Events.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED\n };\n this.eventService.dispatchEvent(event);\n }\n }\n // + rowController\n getValueColumns() {\n return this.valueColumns ? this.valueColumns : [];\n }\n // + rowController\n getPivotColumns() {\n return this.pivotColumns ? this.pivotColumns : [];\n }\n // + clientSideRowModel\n isPivotActive() {\n return this.pivotColumns && this.pivotColumns.length > 0 && this.pivotMode;\n }\n // + toolPanel\n getRowGroupColumns() {\n return this.rowGroupColumns ? this.rowGroupColumns : [];\n }\n // + rowController -> while inserting rows\n getDisplayedCenterColumns() {\n return this.displayedColumnsCenter;\n }\n // + rowController -> while inserting rows\n getDisplayedLeftColumns() {\n return this.displayedColumnsLeft;\n }\n getDisplayedRightColumns() {\n return this.displayedColumnsRight;\n }\n getDisplayedColumns(type) {\n switch (type) {\n case 'left':\n return this.getDisplayedLeftColumns();\n case 'right':\n return this.getDisplayedRightColumns();\n default:\n return this.getDisplayedCenterColumns();\n }\n }\n // used by:\n // + clientSideRowController -> sorting, building quick filter text\n // + headerRenderer -> sorting (clearing icon)\n getAllPrimaryColumns() {\n return this.primaryColumns ? this.primaryColumns.slice() : null;\n }\n getSecondaryColumns() {\n return this.secondaryColumns ? this.secondaryColumns.slice() : null;\n }\n getAllColumnsForQuickFilter() {\n return this.columnsForQuickFilter;\n }\n // + moveColumnController\n getAllGridColumns() {\n return this.gridColumns;\n }\n isEmpty() {\n return missingOrEmpty(this.gridColumns);\n }\n isRowGroupEmpty() {\n return missingOrEmpty(this.rowGroupColumns);\n }\n setColumnVisible(key, visible, source = \"api\") {\n this.setColumnsVisible([key], visible, source);\n }\n setColumnsVisible(keys, visible = false, source = \"api\") {\n this.applyColumnState({\n state: keys.map(key => ({\n colId: typeof key === 'string' ? key : key.getColId(),\n hide: !visible\n }))\n }, source);\n }\n setColumnPinned(key, pinned, source = \"api\") {\n if (key) {\n this.setColumnsPinned([key], pinned, source);\n }\n }\n setColumnsPinned(keys, pinned, source = \"api\") {\n if (this.gridOptionsService.isDomLayout('print')) {\n console.warn(`AG Grid: Changing the column pinning status is not allowed with domLayout='print'`);\n return;\n }\n this.columnAnimationService.start();\n let actualPinned;\n if (pinned === true || pinned === 'left') {\n actualPinned = 'left';\n } else if (pinned === 'right') {\n actualPinned = 'right';\n } else {\n actualPinned = null;\n }\n this.actionOnGridColumns(keys, col => {\n if (col.getPinned() !== actualPinned) {\n col.setPinned(actualPinned);\n return true;\n }\n return false;\n }, source, () => {\n const event = {\n type: Events.EVENT_COLUMN_PINNED,\n pinned: actualPinned,\n column: null,\n columns: null,\n source: source\n };\n return event;\n });\n this.columnAnimationService.finish();\n }\n // does an action on a set of columns. provides common functionality for looking up the\n // columns based on key, getting a list of effected columns, and then updated the event\n // with either one column (if it was just one col) or a list of columns\n // used by: autoResize, setVisible, setPinned\n actionOnGridColumns(\n // the column keys this action will be on\n keys,\n // the action to do - if this returns false, the column was skipped\n // and won't be included in the event\n action,\n // should return back a column event of the right type\n source, createEvent) {\n if (missingOrEmpty(keys)) {\n return;\n }\n const updatedColumns = [];\n keys.forEach(key => {\n const column = this.getGridColumn(key);\n if (!column) {\n return;\n }\n // need to check for false with type (ie !== instead of !=)\n // as not returning anything (undefined) would also be false\n const resultOfAction = action(column);\n if (resultOfAction !== false) {\n updatedColumns.push(column);\n }\n });\n if (!updatedColumns.length) {\n return;\n }\n this.updateDisplayedColumns(source);\n if (exists(createEvent) && createEvent) {\n const event = createEvent();\n event.columns = updatedColumns;\n event.column = updatedColumns.length === 1 ? updatedColumns[0] : null;\n this.eventService.dispatchEvent(event);\n }\n }\n getDisplayedColBefore(col) {\n const allDisplayedColumns = this.getAllDisplayedColumns();\n const oldIndex = allDisplayedColumns.indexOf(col);\n if (oldIndex > 0) {\n return allDisplayedColumns[oldIndex - 1];\n }\n return null;\n }\n // used by:\n // + rowRenderer -> for navigation\n getDisplayedColAfter(col) {\n const allDisplayedColumns = this.getAllDisplayedColumns();\n const oldIndex = allDisplayedColumns.indexOf(col);\n if (oldIndex < allDisplayedColumns.length - 1) {\n return allDisplayedColumns[oldIndex + 1];\n }\n return null;\n }\n getDisplayedGroupAfter(columnGroup) {\n return this.getDisplayedGroupAtDirection(columnGroup, 'After');\n }\n getDisplayedGroupBefore(columnGroup) {\n return this.getDisplayedGroupAtDirection(columnGroup, 'Before');\n }\n getDisplayedGroupAtDirection(columnGroup, direction) {\n // pick the last displayed column in this group\n const requiredLevel = columnGroup.getProvidedColumnGroup().getLevel() + columnGroup.getPaddingLevel();\n const colGroupLeafColumns = columnGroup.getDisplayedLeafColumns();\n const col = direction === 'After' ? last(colGroupLeafColumns) : colGroupLeafColumns[0];\n const getDisplayColMethod = `getDisplayedCol${direction}`;\n while (true) {\n // keep moving to the next col, until we get to another group\n const column = this[getDisplayColMethod](col);\n if (!column) {\n return null;\n }\n const groupPointer = this.getColumnGroupAtLevel(column, requiredLevel);\n if (groupPointer !== columnGroup) {\n return groupPointer;\n }\n }\n }\n getColumnGroupAtLevel(column, level) {\n // get group at same level as the one we are looking for\n let groupPointer = column.getParent();\n let originalGroupLevel;\n let groupPointerLevel;\n while (true) {\n const groupPointerProvidedColumnGroup = groupPointer.getProvidedColumnGroup();\n originalGroupLevel = groupPointerProvidedColumnGroup.getLevel();\n groupPointerLevel = groupPointer.getPaddingLevel();\n if (originalGroupLevel + groupPointerLevel <= level) {\n break;\n }\n groupPointer = groupPointer.getParent();\n }\n return groupPointer;\n }\n isPinningLeft() {\n return this.displayedColumnsLeft.length > 0;\n }\n isPinningRight() {\n return this.displayedColumnsRight.length > 0;\n }\n getPrimaryAndSecondaryAndAutoColumns() {\n return [].concat(...[this.primaryColumns || [], this.groupAutoColumns || [], this.secondaryColumns || []]);\n }\n createStateItemFromColumn(column) {\n const rowGroupIndex = column.isRowGroupActive() ? this.rowGroupColumns.indexOf(column) : null;\n const pivotIndex = column.isPivotActive() ? this.pivotColumns.indexOf(column) : null;\n const aggFunc = column.isValueActive() ? column.getAggFunc() : null;\n const sort = column.getSort() != null ? column.getSort() : null;\n const sortIndex = column.getSortIndex() != null ? column.getSortIndex() : null;\n const flex = column.getFlex() != null && column.getFlex() > 0 ? column.getFlex() : null;\n const res = {\n colId: column.getColId(),\n width: column.getActualWidth(),\n hide: !column.isVisible(),\n pinned: column.getPinned(),\n sort,\n sortIndex,\n aggFunc,\n rowGroup: column.isRowGroupActive(),\n rowGroupIndex,\n pivot: column.isPivotActive(),\n pivotIndex: pivotIndex,\n flex\n };\n return res;\n }\n getColumnState() {\n if (missing(this.primaryColumns) || !this.isAlive()) {\n return [];\n }\n const colsForState = this.getPrimaryAndSecondaryAndAutoColumns();\n const res = colsForState.map(this.createStateItemFromColumn.bind(this));\n this.orderColumnStateList(res);\n return res;\n }\n orderColumnStateList(columnStateList) {\n // for fast looking, store the index of each column\n const colIdToGridIndexMap = convertToMap(this.gridColumns.map((col, index) => [col.getColId(), index]));\n columnStateList.sort((itemA, itemB) => {\n const posA = colIdToGridIndexMap.has(itemA.colId) ? colIdToGridIndexMap.get(itemA.colId) : -1;\n const posB = colIdToGridIndexMap.has(itemB.colId) ? colIdToGridIndexMap.get(itemB.colId) : -1;\n return posA - posB;\n });\n }\n resetColumnState(source = \"api\") {\n // NOTE = there is one bug here that no customer has noticed - if a column has colDef.lockPosition,\n // this is ignored below when ordering the cols. to work, we should always put lockPosition cols first.\n // As a work around, developers should just put lockPosition columns first in their colDef list.\n // we can't use 'allColumns' as the order might of messed up, so get the primary ordered list\n const primaryColumns = this.getColumnsFromTree(this.primaryColumnTree);\n const columnStates = [];\n // we start at 1000, so if user has mix of rowGroup and group specified, it will work with both.\n // eg IF user has ColA.rowGroupIndex=0, ColB.rowGroupIndex=1, ColC.rowGroup=true,\n // THEN result will be ColA.rowGroupIndex=0, ColB.rowGroupIndex=1, ColC.rowGroup=1000\n let letRowGroupIndex = 1000;\n let letPivotIndex = 1000;\n let colsToProcess = [];\n if (this.groupAutoColumns) {\n colsToProcess = colsToProcess.concat(this.groupAutoColumns);\n }\n if (primaryColumns) {\n colsToProcess = colsToProcess.concat(primaryColumns);\n }\n colsToProcess.forEach(column => {\n const stateItem = this.getColumnStateFromColDef(column);\n if (missing(stateItem.rowGroupIndex) && stateItem.rowGroup) {\n stateItem.rowGroupIndex = letRowGroupIndex++;\n }\n if (missing(stateItem.pivotIndex) && stateItem.pivot) {\n stateItem.pivotIndex = letPivotIndex++;\n }\n columnStates.push(stateItem);\n });\n this.applyColumnState({\n state: columnStates,\n applyOrder: true\n }, source);\n }\n getColumnStateFromColDef(column) {\n const getValueOrNull = (a, b) => a != null ? a : b != null ? b : null;\n const colDef = column.getColDef();\n const sort = getValueOrNull(colDef.sort, colDef.initialSort);\n const sortIndex = getValueOrNull(colDef.sortIndex, colDef.initialSortIndex);\n const hide = getValueOrNull(colDef.hide, colDef.initialHide);\n const pinned = getValueOrNull(colDef.pinned, colDef.initialPinned);\n const width = getValueOrNull(colDef.width, colDef.initialWidth);\n const flex = getValueOrNull(colDef.flex, colDef.initialFlex);\n let rowGroupIndex = getValueOrNull(colDef.rowGroupIndex, colDef.initialRowGroupIndex);\n let rowGroup = getValueOrNull(colDef.rowGroup, colDef.initialRowGroup);\n if (rowGroupIndex == null && (rowGroup == null || rowGroup == false)) {\n rowGroupIndex = null;\n rowGroup = null;\n }\n let pivotIndex = getValueOrNull(colDef.pivotIndex, colDef.initialPivotIndex);\n let pivot = getValueOrNull(colDef.pivot, colDef.initialPivot);\n if (pivotIndex == null && (pivot == null || pivot == false)) {\n pivotIndex = null;\n pivot = null;\n }\n const aggFunc = getValueOrNull(colDef.aggFunc, colDef.initialAggFunc);\n return {\n colId: column.getColId(),\n sort,\n sortIndex,\n hide,\n pinned,\n width,\n flex,\n rowGroup,\n rowGroupIndex,\n pivot,\n pivotIndex,\n aggFunc\n };\n }\n applyColumnState(params, source) {\n if (missingOrEmpty(this.primaryColumns)) {\n return false;\n }\n if (params && params.state && !params.state.forEach) {\n console.warn('AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state.');\n return false;\n }\n const applyStates = (states, existingColumns, getById) => {\n const dispatchEventsFunc = this.compareColumnStatesAndDispatchEvents(source);\n this.autoGroupsNeedBuilding = true;\n // at the end below, this list will have all columns we got no state for\n const columnsWithNoState = existingColumns.slice();\n const rowGroupIndexes = {};\n const pivotIndexes = {};\n const autoGroupColumnStates = [];\n // If pivoting is modified, these are the states we try to reapply after\n // the secondary columns are re-generated\n const unmatchedAndAutoStates = [];\n let unmatchedCount = 0;\n const previousRowGroupCols = this.rowGroupColumns.slice();\n const previousPivotCols = this.pivotColumns.slice();\n states.forEach(state => {\n const colId = state.colId || '';\n // auto group columns are re-created so deferring syncing with ColumnState\n const isAutoGroupColumn = colId.startsWith(GROUP_AUTO_COLUMN_ID);\n if (isAutoGroupColumn) {\n autoGroupColumnStates.push(state);\n unmatchedAndAutoStates.push(state);\n return;\n }\n const column = getById(colId);\n if (!column) {\n unmatchedAndAutoStates.push(state);\n unmatchedCount += 1;\n } else {\n this.syncColumnWithStateItem(column, state, params.defaultState, rowGroupIndexes, pivotIndexes, false, source);\n removeFromArray(columnsWithNoState, column);\n }\n });\n // anything left over, we got no data for, so add in the column as non-value, non-rowGroup and hidden\n const applyDefaultsFunc = col => this.syncColumnWithStateItem(col, null, params.defaultState, rowGroupIndexes, pivotIndexes, false, source);\n columnsWithNoState.forEach(applyDefaultsFunc);\n // sort the lists according to the indexes that were provided\n const comparator = (indexes, oldList, colA, colB) => {\n const indexA = indexes[colA.getId()];\n const indexB = indexes[colB.getId()];\n const aHasIndex = indexA != null;\n const bHasIndex = indexB != null;\n if (aHasIndex && bHasIndex) {\n // both a and b are new cols with index, so sort on index\n return indexA - indexB;\n }\n if (aHasIndex) {\n // a has an index, so it should be before a\n return -1;\n }\n if (bHasIndex) {\n // b has an index, so it should be before a\n return 1;\n }\n const oldIndexA = oldList.indexOf(colA);\n const oldIndexB = oldList.indexOf(colB);\n const aHasOldIndex = oldIndexA >= 0;\n const bHasOldIndex = oldIndexB >= 0;\n if (aHasOldIndex && bHasOldIndex) {\n // both a and b are old cols, so sort based on last order\n return oldIndexA - oldIndexB;\n }\n if (aHasOldIndex) {\n // a is old, b is new, so b is first\n return -1;\n }\n // this bit does matter, means both are new cols\n // but without index or that b is old and a is new\n return 1;\n };\n this.rowGroupColumns.sort(comparator.bind(this, rowGroupIndexes, previousRowGroupCols));\n this.pivotColumns.sort(comparator.bind(this, pivotIndexes, previousPivotCols));\n this.updateGridColumns();\n // sync newly created auto group columns with ColumnState\n const autoGroupColsCopy = this.groupAutoColumns ? this.groupAutoColumns.slice() : [];\n autoGroupColumnStates.forEach(stateItem => {\n const autoCol = this.getAutoColumn(stateItem.colId);\n removeFromArray(autoGroupColsCopy, autoCol);\n this.syncColumnWithStateItem(autoCol, stateItem, params.defaultState, null, null, true, source);\n });\n // autogroup cols with nothing else, apply the default\n autoGroupColsCopy.forEach(applyDefaultsFunc);\n this.applyOrderAfterApplyState(params);\n this.updateDisplayedColumns(source);\n this.dispatchEverythingChanged(source);\n dispatchEventsFunc(); // Will trigger secondary column changes if pivoting modified\n return {\n unmatchedAndAutoStates,\n unmatchedCount\n };\n };\n this.columnAnimationService.start();\n let {\n unmatchedAndAutoStates,\n unmatchedCount\n } = applyStates(params.state || [], this.primaryColumns || [], id => this.getPrimaryColumn(id));\n // If there are still states left over, see if we can apply them to newly generated\n // secondary or auto columns. Also if defaults exist, ensure they are applied to secondary cols\n if (unmatchedAndAutoStates.length > 0 || exists(params.defaultState)) {\n unmatchedCount = applyStates(unmatchedAndAutoStates, this.secondaryColumns || [], id => this.getSecondaryColumn(id)).unmatchedCount;\n }\n this.columnAnimationService.finish();\n return unmatchedCount === 0; // Successful if no states unaccounted for\n }\n applyOrderAfterApplyState(params) {\n if (!params.applyOrder || !params.state) {\n return;\n }\n let newOrder = [];\n const processedColIds = {};\n params.state.forEach(item => {\n if (!item.colId || processedColIds[item.colId]) {\n return;\n }\n const col = this.gridColumnsMap[item.colId];\n if (col) {\n newOrder.push(col);\n processedColIds[item.colId] = true;\n }\n });\n // add in all other columns\n let autoGroupInsertIndex = 0;\n this.gridColumns.forEach(col => {\n const colId = col.getColId();\n const alreadyProcessed = processedColIds[colId] != null;\n if (alreadyProcessed) {\n return;\n }\n const isAutoGroupCol = colId.startsWith(GROUP_AUTO_COLUMN_ID);\n if (isAutoGroupCol) {\n // auto group columns, if missing from state list, are added to the start.\n // it's common to have autoGroup missing, as grouping could be on by default\n // on a column, but the user could of since removed the grouping via the UI.\n // if we don't inc the insert index, autoGroups will be inserted in reverse order\n insertIntoArray(newOrder, col, autoGroupInsertIndex++);\n } else {\n // normal columns, if missing from state list, are added at the end\n newOrder.push(col);\n }\n });\n // this is already done in updateGridColumns, however we changed the order above (to match the order of the state\n // columns) so we need to do it again. we could of put logic into the order above to take into account fixed\n // columns, however if we did then we would have logic for updating fixed columns twice. reusing the logic here\n // is less sexy for the code here, but it keeps consistency.\n newOrder = this.placeLockedColumns(newOrder);\n if (!this.doesMovePassMarryChildren(newOrder)) {\n console.warn('AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.');\n return;\n }\n this.gridColumns = newOrder;\n }\n compareColumnStatesAndDispatchEvents(source) {\n const startState = {\n rowGroupColumns: this.rowGroupColumns.slice(),\n pivotColumns: this.pivotColumns.slice(),\n valueColumns: this.valueColumns.slice()\n };\n const columnStateBefore = this.getColumnState();\n const columnStateBeforeMap = {};\n columnStateBefore.forEach(col => {\n columnStateBeforeMap[col.colId] = col;\n });\n return () => {\n const colsForState = this.getPrimaryAndSecondaryAndAutoColumns();\n // dispatches generic ColumnEvents where all columns are returned rather than what has changed\n const dispatchWhenListsDifferent = (eventType, colsBefore, colsAfter, idMapper) => {\n const beforeList = colsBefore.map(idMapper);\n const afterList = colsAfter.map(idMapper);\n const unchanged = areEqual(beforeList, afterList);\n if (unchanged) {\n return;\n }\n const changes = new Set(colsBefore);\n colsAfter.forEach(id => {\n // if the first list had it, delete it, as it's unchanged.\n if (!changes.delete(id)) {\n // if the second list has it, and first doesn't, add it.\n changes.add(id);\n }\n });\n const changesArr = [...changes];\n const event = {\n type: eventType,\n columns: changesArr,\n column: changesArr.length === 1 ? changesArr[0] : null,\n source: source\n };\n this.eventService.dispatchEvent(event);\n };\n // determines which columns have changed according to supplied predicate\n const getChangedColumns = changedPredicate => {\n const changedColumns = [];\n colsForState.forEach(column => {\n const colStateBefore = columnStateBeforeMap[column.getColId()];\n if (colStateBefore && changedPredicate(colStateBefore, column)) {\n changedColumns.push(column);\n }\n });\n return changedColumns;\n };\n const columnIdMapper = c => c.getColId();\n dispatchWhenListsDifferent(Events.EVENT_COLUMN_ROW_GROUP_CHANGED, startState.rowGroupColumns, this.rowGroupColumns, columnIdMapper);\n dispatchWhenListsDifferent(Events.EVENT_COLUMN_PIVOT_CHANGED, startState.pivotColumns, this.pivotColumns, columnIdMapper);\n const valueChangePredicate = (cs, c) => {\n const oldActive = cs.aggFunc != null;\n const activeChanged = oldActive != c.isValueActive();\n // we only check aggFunc if the agg is active\n const aggFuncChanged = oldActive && cs.aggFunc != c.getAggFunc();\n return activeChanged || aggFuncChanged;\n };\n const changedValues = getChangedColumns(valueChangePredicate);\n if (changedValues.length > 0) {\n this.dispatchColumnChangedEvent(Events.EVENT_COLUMN_VALUE_CHANGED, changedValues, source);\n }\n const resizeChangePredicate = (cs, c) => cs.width != c.getActualWidth();\n this.dispatchColumnResizedEvent(getChangedColumns(resizeChangePredicate), true, source);\n const pinnedChangePredicate = (cs, c) => cs.pinned != c.getPinned();\n this.dispatchColumnPinnedEvent(getChangedColumns(pinnedChangePredicate), source);\n const visibilityChangePredicate = (cs, c) => cs.hide == c.isVisible();\n this.dispatchColumnVisibleEvent(getChangedColumns(visibilityChangePredicate), source);\n const sortChangePredicate = (cs, c) => cs.sort != c.getSort() || cs.sortIndex != c.getSortIndex();\n if (getChangedColumns(sortChangePredicate).length > 0) {\n this.sortController.dispatchSortChangedEvents(source);\n }\n // special handling for moved column events\n this.normaliseColumnMovedEventForColumnState(columnStateBefore, source);\n };\n }\n getCommonValue(cols, valueGetter) {\n if (!cols || cols.length == 0) {\n return undefined;\n }\n // compare each value to the first value. if nothing differs, then value is common so return it.\n const firstValue = valueGetter(cols[0]);\n for (let i = 1; i < cols.length; i++) {\n if (firstValue !== valueGetter(cols[i])) {\n // values differ, no common value\n return undefined;\n }\n }\n return firstValue;\n }\n normaliseColumnMovedEventForColumnState(colStateBefore, source) {\n // we are only interested in columns that were both present and visible before and after\n const colStateAfter = this.getColumnState();\n const colStateAfterMapped = {};\n colStateAfter.forEach(s => colStateAfterMapped[s.colId] = s);\n // get id's of cols in both before and after lists\n const colsIntersectIds = {};\n colStateBefore.forEach(s => {\n if (colStateAfterMapped[s.colId]) {\n colsIntersectIds[s.colId] = true;\n }\n });\n // filter state lists, so we only have cols that were present before and after\n const beforeFiltered = colStateBefore.filter(c => colsIntersectIds[c.colId]);\n const afterFiltered = colStateAfter.filter(c => colsIntersectIds[c.colId]);\n // see if any cols are in a different location\n const movedColumns = [];\n afterFiltered.forEach((csAfter, index) => {\n const csBefore = beforeFiltered && beforeFiltered[index];\n if (csBefore && csBefore.colId !== csAfter.colId) {\n const gridCol = this.getGridColumn(csBefore.colId);\n if (gridCol) {\n movedColumns.push(gridCol);\n }\n }\n });\n if (!movedColumns.length) {\n return;\n }\n this.dispatchColumnMovedEvent({\n movedColumns,\n source,\n finished: true\n });\n }\n syncColumnWithStateItem(column, stateItem, defaultState, rowGroupIndexes, pivotIndexes, autoCol, source) {\n if (!column) {\n return;\n }\n const getValue = (key1, key2) => {\n const obj = {\n value1: undefined,\n value2: undefined\n };\n let calculated = false;\n if (stateItem) {\n if (stateItem[key1] !== undefined) {\n obj.value1 = stateItem[key1];\n calculated = true;\n }\n if (exists(key2) && stateItem[key2] !== undefined) {\n obj.value2 = stateItem[key2];\n calculated = true;\n }\n }\n if (!calculated && defaultState) {\n if (defaultState[key1] !== undefined) {\n obj.value1 = defaultState[key1];\n }\n if (exists(key2) && defaultState[key2] !== undefined) {\n obj.value2 = defaultState[key2];\n }\n }\n return obj;\n };\n // following ensures we are left with boolean true or false, eg converts (null, undefined, 0) all to true\n const hide = getValue('hide').value1;\n if (hide !== undefined) {\n column.setVisible(!hide, source);\n }\n // sets pinned to 'left' or 'right'\n const pinned = getValue('pinned').value1;\n if (pinned !== undefined) {\n column.setPinned(pinned);\n }\n // if width provided and valid, use it, otherwise stick with the old width\n const minColWidth = this.columnUtils.calculateColMinWidth(column.getColDef());\n // flex\n const flex = getValue('flex').value1;\n if (flex !== undefined) {\n column.setFlex(flex);\n }\n // width - we only set width if column is not flexing\n const noFlexThisCol = column.getFlex() <= 0;\n if (noFlexThisCol) {\n // both null and undefined means we skip, as it's not possible to 'clear' width (a column must have a width)\n const width = getValue('width').value1;\n if (width != null) {\n if (minColWidth != null && width >= minColWidth) {\n column.setActualWidth(width, source);\n }\n }\n }\n const sort = getValue('sort').value1;\n if (sort !== undefined) {\n if (sort === 'desc' || sort === 'asc') {\n column.setSort(sort, source);\n } else {\n column.setSort(undefined, source);\n }\n }\n const sortIndex = getValue('sortIndex').value1;\n if (sortIndex !== undefined) {\n column.setSortIndex(sortIndex);\n }\n // we do not do aggFunc, rowGroup or pivot for auto cols or secondary cols\n if (autoCol || !column.isPrimary()) {\n return;\n }\n const aggFunc = getValue('aggFunc').value1;\n if (aggFunc !== undefined) {\n if (typeof aggFunc === 'string') {\n column.setAggFunc(aggFunc);\n if (!column.isValueActive()) {\n column.setValueActive(true, source);\n this.valueColumns.push(column);\n }\n } else {\n if (exists(aggFunc)) {\n console.warn('AG Grid: stateItem.aggFunc must be a string. if using your own aggregation ' + 'functions, register the functions first before using them in get/set state. This is because it is ' + 'intended for the column state to be stored and retrieved as simple JSON.');\n }\n // Note: we do not call column.setAggFunc(null), so that next time we aggregate\n // by this column (eg drag the column to the agg section int he toolpanel) it will\n // default to the last aggregation function.\n if (column.isValueActive()) {\n column.setValueActive(false, source);\n removeFromArray(this.valueColumns, column);\n }\n }\n }\n const {\n value1: rowGroup,\n value2: rowGroupIndex\n } = getValue('rowGroup', 'rowGroupIndex');\n if (rowGroup !== undefined || rowGroupIndex !== undefined) {\n if (typeof rowGroupIndex === 'number' || rowGroup) {\n if (!column.isRowGroupActive()) {\n column.setRowGroupActive(true, source);\n this.rowGroupColumns.push(column);\n }\n if (rowGroupIndexes && typeof rowGroupIndex === 'number') {\n rowGroupIndexes[column.getId()] = rowGroupIndex;\n }\n } else {\n if (column.isRowGroupActive()) {\n column.setRowGroupActive(false, source);\n removeFromArray(this.rowGroupColumns, column);\n }\n }\n }\n const {\n value1: pivot,\n value2: pivotIndex\n } = getValue('pivot', 'pivotIndex');\n if (pivot !== undefined || pivotIndex !== undefined) {\n if (typeof pivotIndex === 'number' || pivot) {\n if (!column.isPivotActive()) {\n column.setPivotActive(true, source);\n this.pivotColumns.push(column);\n }\n if (pivotIndexes && typeof pivotIndex === 'number') {\n pivotIndexes[column.getId()] = pivotIndex;\n }\n } else {\n if (column.isPivotActive()) {\n column.setPivotActive(false, source);\n removeFromArray(this.pivotColumns, column);\n }\n }\n }\n }\n getGridColumns(keys) {\n return this.getColumns(keys, this.getGridColumn.bind(this));\n }\n getColumns(keys, columnLookupCallback) {\n const foundColumns = [];\n if (keys) {\n keys.forEach(key => {\n const column = columnLookupCallback(key);\n if (column) {\n foundColumns.push(column);\n }\n });\n }\n return foundColumns;\n }\n // used by growGroupPanel\n getColumnWithValidation(key) {\n if (key == null) {\n return null;\n }\n const column = this.getGridColumn(key);\n if (!column) {\n console.warn('AG Grid: could not find column ' + key);\n }\n return column;\n }\n getPrimaryColumn(key) {\n if (!this.primaryColumns) {\n return null;\n }\n return this.getColumn(key, this.primaryColumns, this.primaryColumnsMap);\n }\n getGridColumn(key) {\n return this.getColumn(key, this.gridColumns, this.gridColumnsMap);\n }\n getSecondaryColumn(key) {\n if (!this.secondaryColumns) {\n return null;\n }\n return this.getColumn(key, this.secondaryColumns, this.secondaryColumnsMap);\n }\n getColumn(key, columnList, columnMap) {\n if (!key) {\n return null;\n }\n // most of the time this method gets called the key is a string, so we put this shortcut in\n // for performance reasons, to see if we can match for ID (it doesn't do auto columns, that's done below)\n if (typeof key == 'string' && columnMap[key]) {\n return columnMap[key];\n }\n for (let i = 0; i < columnList.length; i++) {\n if (this.columnsMatch(columnList[i], key)) {\n return columnList[i];\n }\n }\n return this.getAutoColumn(key);\n }\n getSourceColumnsForGroupColumn(groupCol) {\n const sourceColumnId = groupCol.getColDef().showRowGroup;\n if (!sourceColumnId) {\n return null;\n }\n if (sourceColumnId === true) {\n return this.rowGroupColumns.slice(0);\n }\n const column = this.getPrimaryColumn(sourceColumnId);\n return column ? [column] : null;\n }\n getAutoColumn(key) {\n if (!this.groupAutoColumns || !exists(this.groupAutoColumns) || missing(this.groupAutoColumns)) {\n return null;\n }\n return this.groupAutoColumns.find(groupCol => this.columnsMatch(groupCol, key)) || null;\n }\n columnsMatch(column, key) {\n const columnMatches = column === key;\n const colDefMatches = column.getColDef() === key;\n const idMatches = column.getColId() == key;\n return columnMatches || colDefMatches || idMatches;\n }\n getDisplayNameForColumn(column, location, includeAggFunc = false) {\n if (!column) {\n return null;\n }\n const headerName = this.getHeaderName(column.getColDef(), column, null, null, location);\n if (includeAggFunc) {\n return this.wrapHeaderNameWithAggFunc(column, headerName);\n }\n return headerName;\n }\n getDisplayNameForProvidedColumnGroup(columnGroup, providedColumnGroup, location) {\n const colGroupDef = providedColumnGroup ? providedColumnGroup.getColGroupDef() : null;\n if (colGroupDef) {\n return this.getHeaderName(colGroupDef, null, columnGroup, providedColumnGroup, location);\n }\n return null;\n }\n getDisplayNameForColumnGroup(columnGroup, location) {\n return this.getDisplayNameForProvidedColumnGroup(columnGroup, columnGroup.getProvidedColumnGroup(), location);\n }\n // location is where the column is going to appear, ie who is calling us\n getHeaderName(colDef, column, columnGroup, providedColumnGroup, location) {\n const headerValueGetter = colDef.headerValueGetter;\n if (headerValueGetter) {\n const params = {\n colDef: colDef,\n column: column,\n columnGroup: columnGroup,\n providedColumnGroup: providedColumnGroup,\n location: location,\n api: this.gridOptionsService.api,\n columnApi: this.gridOptionsService.columnApi,\n context: this.gridOptionsService.context\n };\n if (typeof headerValueGetter === 'function') {\n // valueGetter is a function, so just call it\n return headerValueGetter(params);\n } else if (typeof headerValueGetter === 'string') {\n // valueGetter is an expression, so execute the expression\n return this.expressionService.evaluate(headerValueGetter, params);\n }\n console.warn('AG Grid: headerValueGetter must be a function or a string');\n return '';\n } else if (colDef.headerName != null) {\n return colDef.headerName;\n } else if (colDef.field) {\n return camelCaseToHumanText(colDef.field);\n }\n return '';\n }\n wrapHeaderNameWithAggFunc(column, headerName) {\n if (this.gridOptionsService.is('suppressAggFuncInHeader')) {\n return headerName;\n }\n // only columns with aggregation active can have aggregations\n const pivotValueColumn = column.getColDef().pivotValueColumn;\n const pivotActiveOnThisColumn = exists(pivotValueColumn);\n let aggFunc = null;\n let aggFuncFound;\n // otherwise we have a measure that is active, and we are doing aggregation on it\n if (pivotActiveOnThisColumn) {\n const isCollapsedHeaderEnabled = this.gridOptionsService.is('removePivotHeaderRowWhenSingleValueColumn') && this.valueColumns.length === 1;\n const isTotalColumn = column.getColDef().pivotTotalColumnIds !== undefined;\n if (isCollapsedHeaderEnabled && !isTotalColumn) {\n return headerName; // Skip decorating the header - in this case the label is the pivot key, not the value col\n }\n aggFunc = pivotValueColumn ? pivotValueColumn.getAggFunc() : null;\n aggFuncFound = true;\n } else {\n const measureActive = column.isValueActive();\n const aggregationPresent = this.pivotMode || !this.isRowGroupEmpty();\n if (measureActive && aggregationPresent) {\n aggFunc = column.getAggFunc();\n aggFuncFound = true;\n } else {\n aggFuncFound = false;\n }\n }\n if (aggFuncFound) {\n const aggFuncString = typeof aggFunc === 'string' ? aggFunc : 'func';\n const localeTextFunc = this.localeService.getLocaleTextFunc();\n const aggFuncStringTranslated = localeTextFunc(aggFuncString, aggFuncString);\n return `${aggFuncStringTranslated}(${headerName})`;\n }\n return headerName;\n }\n // returns the group with matching colId and instanceId. If instanceId is missing,\n // matches only on the colId.\n getColumnGroup(colId, partId) {\n if (!colId) {\n return null;\n }\n if (colId instanceof ColumnGroup) {\n return colId;\n }\n const allColumnGroups = this.getAllDisplayedTrees();\n const checkPartId = typeof partId === 'number';\n let result = null;\n this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, child => {\n if (child instanceof ColumnGroup) {\n const columnGroup = child;\n let matched;\n if (checkPartId) {\n matched = colId === columnGroup.getGroupId() && partId === columnGroup.getPartId();\n } else {\n matched = colId === columnGroup.getGroupId();\n }\n if (matched) {\n result = columnGroup;\n }\n }\n });\n return result;\n }\n isReady() {\n return this.ready;\n }\n extractValueColumns(source, oldPrimaryColumns) {\n this.valueColumns = this.extractColumns(oldPrimaryColumns, this.valueColumns, (col, flag) => col.setValueActive(flag, source),\n // aggFunc doesn't have index variant, cos order of value cols doesn't matter, so always return null\n () => undefined, () => undefined,\n // aggFunc is a string, so return it's existence\n colDef => {\n const aggFunc = colDef.aggFunc;\n // null or empty string means clear\n if (aggFunc === null || aggFunc === '') {\n return null;\n }\n if (aggFunc === undefined) {\n return;\n }\n return !!aggFunc;\n }, colDef => {\n // return false if any of the following: null, undefined, empty string\n return colDef.initialAggFunc != null && colDef.initialAggFunc != '';\n });\n // all new columns added will have aggFunc missing, so set it to what is in the colDef\n this.valueColumns.forEach(col => {\n const colDef = col.getColDef();\n // if aggFunc provided, we always override, as reactive property\n if (colDef.aggFunc != null && colDef.aggFunc != '') {\n col.setAggFunc(colDef.aggFunc);\n } else {\n // otherwise we use initialAggFunc only if no agg func set - which happens when new column only\n if (!col.getAggFunc()) {\n col.setAggFunc(colDef.initialAggFunc);\n }\n }\n });\n }\n extractRowGroupColumns(source, oldPrimaryColumns) {\n this.rowGroupColumns = this.extractColumns(oldPrimaryColumns, this.rowGroupColumns, (col, flag) => col.setRowGroupActive(flag, source), colDef => colDef.rowGroupIndex, colDef => colDef.initialRowGroupIndex, colDef => colDef.rowGroup, colDef => colDef.initialRowGroup);\n }\n extractColumns(oldPrimaryColumns = [], previousCols = [], setFlagFunc, getIndexFunc, getInitialIndexFunc, getValueFunc, getInitialValueFunc) {\n const colsWithIndex = [];\n const colsWithValue = [];\n // go though all cols.\n // if value, change\n // if default only, change only if new\n (this.primaryColumns || []).forEach(col => {\n const colIsNew = oldPrimaryColumns.indexOf(col) < 0;\n const colDef = col.getColDef();\n const value = attrToBoolean(getValueFunc(colDef));\n const initialValue = attrToBoolean(getInitialValueFunc(colDef));\n const index = attrToNumber(getIndexFunc(colDef));\n const initialIndex = attrToNumber(getInitialIndexFunc(colDef));\n let include;\n const valuePresent = value !== undefined;\n const indexPresent = index !== undefined;\n const initialValuePresent = initialValue !== undefined;\n const initialIndexPresent = initialIndex !== undefined;\n if (valuePresent) {\n include = value; // boolean value is guaranteed as attrToBoolean() is used above\n } else if (indexPresent) {\n if (index === null) {\n // if col is new we don't want to use the default / initial if index is set to null. Similarly,\n // we don't want to include the property for existing columns, i.e. we want to 'clear' it.\n include = false;\n } else {\n // note that 'null >= 0' evaluates to true which means 'rowGroupIndex = null' would enable row\n // grouping if the null check didn't exist above.\n include = index >= 0;\n }\n } else {\n if (colIsNew) {\n // as no value or index is 'present' we use the default / initial when col is new\n if (initialValuePresent) {\n include = initialValue;\n } else if (initialIndexPresent) {\n include = initialIndex != null && initialIndex >= 0;\n } else {\n include = false;\n }\n } else {\n // otherwise include it if included last time, e.g. if we are extracting row group cols and this col\n // is an existing row group col (i.e. it exists in 'previousCols') then we should include it.\n include = previousCols.indexOf(col) >= 0;\n }\n }\n if (include) {\n const useIndex = colIsNew ? index != null || initialIndex != null : index != null;\n useIndex ? colsWithIndex.push(col) : colsWithValue.push(col);\n }\n });\n const getIndexForCol = col => {\n const index = getIndexFunc(col.getColDef());\n const defaultIndex = getInitialIndexFunc(col.getColDef());\n return index != null ? index : defaultIndex;\n };\n // sort cols with index, and add these first\n colsWithIndex.sort((colA, colB) => {\n const indexA = getIndexForCol(colA);\n const indexB = getIndexForCol(colB);\n if (indexA === indexB) {\n return 0;\n }\n if (indexA < indexB) {\n return -1;\n }\n return 1;\n });\n const res = [].concat(colsWithIndex);\n // second add columns that were there before and in the same order as they were before,\n // so we are preserving order of current grouping of columns that simply have rowGroup=true\n previousCols.forEach(col => {\n if (colsWithValue.indexOf(col) >= 0) {\n res.push(col);\n }\n });\n // lastly put in all remaining cols\n colsWithValue.forEach(col => {\n if (res.indexOf(col) < 0) {\n res.push(col);\n }\n });\n // set flag=false for removed cols\n previousCols.forEach(col => {\n if (res.indexOf(col) < 0) {\n setFlagFunc(col, false);\n }\n });\n // set flag=true for newly added cols\n res.forEach(col => {\n if (previousCols.indexOf(col) < 0) {\n setFlagFunc(col, true);\n }\n });\n return res;\n }\n extractPivotColumns(source, oldPrimaryColumns) {\n this.pivotColumns = this.extractColumns(oldPrimaryColumns, this.pivotColumns, (col, flag) => col.setPivotActive(flag, source), colDef => colDef.pivotIndex, colDef => colDef.initialPivotIndex, colDef => colDef.pivot, colDef => colDef.initialPivot);\n }\n resetColumnGroupState(source = \"api\") {\n const stateItems = [];\n this.columnUtils.depthFirstOriginalTreeSearch(null, this.primaryColumnTree, child => {\n if (child instanceof ProvidedColumnGroup) {\n const colGroupDef = child.getColGroupDef();\n const groupState = {\n groupId: child.getGroupId(),\n open: !colGroupDef ? undefined : colGroupDef.openByDefault\n };\n stateItems.push(groupState);\n }\n });\n this.setColumnGroupState(stateItems, source);\n }\n getColumnGroupState() {\n const columnGroupState = [];\n this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, node => {\n if (node instanceof ProvidedColumnGroup) {\n columnGroupState.push({\n groupId: node.getGroupId(),\n open: node.isExpanded()\n });\n }\n });\n return columnGroupState;\n }\n setColumnGroupState(stateItems, source = \"api\") {\n this.columnAnimationService.start();\n const impactedGroups = [];\n stateItems.forEach(stateItem => {\n const groupKey = stateItem.groupId;\n const newValue = stateItem.open;\n const providedColumnGroup = this.getProvidedColumnGroup(groupKey);\n if (!providedColumnGroup) {\n return;\n }\n if (providedColumnGroup.isExpanded() === newValue) {\n return;\n }\n this.logger.log('columnGroupOpened(' + providedColumnGroup.getGroupId() + ',' + newValue + ')');\n providedColumnGroup.setExpanded(newValue);\n impactedGroups.push(providedColumnGroup);\n });\n this.updateGroupsAndDisplayedColumns(source);\n this.setFirstRightAndLastLeftPinned(source);\n impactedGroups.forEach(providedColumnGroup => {\n const event = {\n type: Events.EVENT_COLUMN_GROUP_OPENED,\n columnGroup: providedColumnGroup\n };\n this.eventService.dispatchEvent(event);\n });\n this.columnAnimationService.finish();\n }\n // called by headerRenderer - when a header is opened or closed\n setColumnGroupOpened(key, newValue, source = \"api\") {\n let keyAsString;\n if (key instanceof ProvidedColumnGroup) {\n keyAsString = key.getId();\n } else {\n keyAsString = key || '';\n }\n this.setColumnGroupState([{\n groupId: keyAsString,\n open: newValue\n }], source);\n }\n getProvidedColumnGroup(key) {\n // if (key instanceof ProvidedColumnGroup) { return key; }\n if (typeof key !== 'string') {\n console.error('AG Grid: group key must be a string');\n }\n // otherwise, search for the column group by id\n let res = null;\n this.columnUtils.depthFirstOriginalTreeSearch(null, this.gridBalancedTree, node => {\n if (node instanceof ProvidedColumnGroup) {\n if (node.getId() === key) {\n res = node;\n }\n }\n });\n return res;\n }\n calculateColumnsForDisplay() {\n let columnsForDisplay;\n if (this.pivotMode && missing(this.secondaryColumns)) {\n // pivot mode is on, but we are not pivoting, so we only\n // show columns we are aggregating on\n columnsForDisplay = this.gridColumns.filter(column => {\n const isAutoGroupCol = this.groupAutoColumns && includes(this.groupAutoColumns, column);\n const isValueCol = this.valueColumns && includes(this.valueColumns, column);\n return isAutoGroupCol || isValueCol;\n });\n } else {\n // otherwise continue as normal. this can be working on the primary\n // or secondary columns, whatever the gridColumns are set to\n columnsForDisplay = this.gridColumns.filter(column => {\n // keep col if a) it's auto-group or b) it's visible\n const isAutoGroupCol = this.groupAutoColumns && includes(this.groupAutoColumns, column);\n return isAutoGroupCol || column.isVisible();\n });\n }\n return columnsForDisplay;\n }\n checkColSpanActiveInCols(columns) {\n let result = false;\n columns.forEach(col => {\n if (exists(col.getColDef().colSpan)) {\n result = true;\n }\n });\n return result;\n }\n calculateColumnsForGroupDisplay() {\n this.groupDisplayColumns = [];\n this.groupDisplayColumnsMap = {};\n const checkFunc = col => {\n const colDef = col.getColDef();\n const underlyingColumn = colDef.showRowGroup;\n if (colDef && exists(underlyingColumn)) {\n this.groupDisplayColumns.push(col);\n if (typeof underlyingColumn === 'string') {\n this.groupDisplayColumnsMap[underlyingColumn] = col;\n } else if (underlyingColumn === true) {\n this.getRowGroupColumns().forEach(rowGroupCol => {\n this.groupDisplayColumnsMap[rowGroupCol.getId()] = col;\n });\n }\n }\n };\n this.gridColumns.forEach(checkFunc);\n }\n getGroupDisplayColumns() {\n return this.groupDisplayColumns;\n }\n getGroupDisplayColumnForGroup(rowGroupColumnId) {\n return this.groupDisplayColumnsMap[rowGroupColumnId];\n }\n updateDisplayedColumns(source) {\n const columnsForDisplay = this.calculateColumnsForDisplay();\n this.buildDisplayedTrees(columnsForDisplay);\n // also called when group opened/closed\n this.updateGroupsAndDisplayedColumns(source);\n // also called when group opened/closed\n this.setFirstRightAndLastLeftPinned(source);\n }\n isSecondaryColumnsPresent() {\n return exists(this.secondaryColumns);\n }\n setSecondaryColumns(colDefs, source = \"api\") {\n const newColsPresent = colDefs && colDefs.length > 0;\n // if not cols passed, and we had no cols anyway, then do nothing\n if (!newColsPresent && missing(this.secondaryColumns)) {\n return;\n }\n if (newColsPresent) {\n this.processSecondaryColumnDefinitions(colDefs);\n const balancedTreeResult = this.columnFactory.createColumnTree(colDefs, false, this.secondaryBalancedTree || this.previousSecondaryColumns || undefined);\n this.destroyOldColumns(this.secondaryBalancedTree, balancedTreeResult.columnTree);\n this.secondaryBalancedTree = balancedTreeResult.columnTree;\n this.secondaryHeaderRowCount = balancedTreeResult.treeDept + 1;\n this.secondaryColumns = this.getColumnsFromTree(this.secondaryBalancedTree);\n this.secondaryColumnsMap = {};\n this.secondaryColumns.forEach(col => this.secondaryColumnsMap[col.getId()] = col);\n this.previousSecondaryColumns = null;\n } else {\n this.previousSecondaryColumns = this.secondaryBalancedTree;\n this.secondaryBalancedTree = null;\n this.secondaryHeaderRowCount = -1;\n this.secondaryColumns = null;\n this.secondaryColumnsMap = {};\n }\n this.updateGridColumns();\n this.updateDisplayedColumns(source);\n }\n processSecondaryColumnDefinitions(colDefs) {\n const columnCallback = this.gridOptionsService.get('processPivotResultColDef') || this.gridOptionsService.get('processSecondaryColDef');\n const groupCallback = this.gridOptionsService.get('processPivotResultColGroupDef') || this.gridOptionsService.get('processSecondaryColGroupDef');\n if (!columnCallback && !groupCallback) {\n return undefined;\n }\n const searchForColDefs = colDefs2 => {\n colDefs2.forEach(abstractColDef => {\n const isGroup = exists(abstractColDef.children);\n if (isGroup) {\n const colGroupDef = abstractColDef;\n if (groupCallback) {\n groupCallback(colGroupDef);\n }\n searchForColDefs(colGroupDef.children);\n } else {\n const colDef = abstractColDef;\n if (columnCallback) {\n columnCallback(colDef);\n }\n }\n });\n };\n if (colDefs) {\n searchForColDefs(colDefs);\n }\n }\n // called from: applyColumnState, setColumnDefs, setSecondaryColumns\n updateGridColumns() {\n const prevGridCols = this.gridBalancedTree;\n if (this.gridColsArePrimary) {\n this.lastPrimaryOrder = this.gridColumns;\n } else {\n this.lastSecondaryOrder = this.gridColumns;\n }\n let sortOrderToRecover;\n if (this.secondaryColumns && this.secondaryBalancedTree) {\n const hasSameColumns = this.secondaryColumns.every(col => {\n return this.gridColumnsMap[col.getColId()] !== undefined;\n });\n this.gridBalancedTree = this.secondaryBalancedTree.slice();\n this.gridHeaderRowCount = this.secondaryHeaderRowCount;\n this.gridColumns = this.secondaryColumns.slice();\n this.gridColsArePrimary = false;\n // If the current columns are the same or a subset of the previous\n // we keep the previous order, otherwise we go back to the order the pivot\n // cols are generated in\n if (hasSameColumns) {\n sortOrderToRecover = this.lastSecondaryOrder;\n }\n } else if (this.primaryColumns) {\n this.gridBalancedTree = this.primaryColumnTree.slice();\n this.gridHeaderRowCount = this.primaryHeaderRowCount;\n this.gridColumns = this.primaryColumns.slice();\n this.gridColsArePrimary = true;\n // updateGridColumns gets called after user adds a row group. we want to maintain the order of the columns\n // when this happens (eg if user moved a column) rather than revert back to the original column order.\n // likewise if changing in/out of pivot mode, we want to maintain the order of the cols\n sortOrderToRecover = this.lastPrimaryOrder;\n }\n // create the new auto columns\n const areAutoColsChanged = this.createGroupAutoColumnsIfNeeded();\n // if auto group cols have changed, and we have a sort order, we need to move auto cols to the start\n if (areAutoColsChanged && sortOrderToRecover) {\n const groupAutoColsMap = convertToMap(this.groupAutoColumns.map(col => [col, true]));\n // if group columns has changed, we don't preserve the group column order, so remove them from the old order\n sortOrderToRecover = sortOrderToRecover.filter(col => !groupAutoColsMap.has(col));\n // and add them to the start of the order\n sortOrderToRecover = [...this.groupAutoColumns, ...sortOrderToRecover];\n }\n this.addAutoGroupToGridColumns();\n this.orderGridColsLike(sortOrderToRecover);\n this.gridColumns = this.placeLockedColumns(this.gridColumns);\n this.calculateColumnsForGroupDisplay();\n this.refreshQuickFilterColumns();\n this.clearDisplayedAndViewportColumns();\n this.colSpanActive = this.checkColSpanActiveInCols(this.gridColumns);\n this.gridColumnsMap = {};\n this.gridColumns.forEach(col => this.gridColumnsMap[col.getId()] = col);\n this.setAutoHeightActive();\n if (!areEqual(prevGridCols, this.gridBalancedTree)) {\n const event = {\n type: Events.EVENT_GRID_COLUMNS_CHANGED\n };\n this.eventService.dispatchEvent(event);\n }\n }\n setAutoHeightActive() {\n this.autoHeightActive = this.gridColumns.filter(col => col.isAutoHeight()).length > 0;\n if (this.autoHeightActive) {\n this.autoHeightActiveAtLeastOnce = true;\n const supportedRowModel = this.gridOptionsService.isRowModelType('clientSide') || this.gridOptionsService.isRowModelType('serverSide');\n if (!supportedRowModel) {\n const message = 'AG Grid - autoHeight columns only work with Client Side Row Model and Server Side Row Model.';\n doOnce(() => console.warn(message), 'autoHeightActive.wrongRowModel');\n }\n }\n }\n orderGridColsLike(colsOrder) {\n if (missing(colsOrder)) {\n return;\n }\n const lastOrderMapped = convertToMap(colsOrder.map((col, index) => [col, index]));\n // only do the sort if at least one column is accounted for. columns will be not accounted for\n // if changing from secondary to primary columns\n let noColsFound = true;\n this.gridColumns.forEach(col => {\n if (lastOrderMapped.has(col)) {\n noColsFound = false;\n }\n });\n if (noColsFound) {\n return;\n }\n // order cols in the same order as before. we need to make sure that all\n // cols still exists, so filter out any that no longer exist.\n const gridColsMap = convertToMap(this.gridColumns.map(col => [col, true]));\n const oldColsOrdered = colsOrder.filter(col => gridColsMap.has(col));\n const oldColsMap = convertToMap(oldColsOrdered.map(col => [col, true]));\n const newColsOrdered = this.gridColumns.filter(col => !oldColsMap.has(col));\n // add in the new columns, at the end (if no group), or at the end of the group (if a group)\n const newGridColumns = oldColsOrdered.slice();\n newColsOrdered.forEach(newCol => {\n let parent = newCol.getOriginalParent();\n // if no parent, means we are not grouping, so just add the column to the end\n if (!parent) {\n newGridColumns.push(newCol);\n return;\n }\n // find the group the column belongs to. if no siblings at the current level (eg col in group on it's\n // own) then go up one level and look for siblings there.\n const siblings = [];\n while (!siblings.length && parent) {\n const leafCols = parent.getLeafColumns();\n leafCols.forEach(leafCol => {\n const presentInNewGriColumns = newGridColumns.indexOf(leafCol) >= 0;\n const noYetInSiblings = siblings.indexOf(leafCol) < 0;\n if (presentInNewGriColumns && noYetInSiblings) {\n siblings.push(leafCol);\n }\n });\n parent = parent.getOriginalParent();\n }\n // if no siblings exist at any level, this means the col is in a group (or parent groups) on it's own\n if (!siblings.length) {\n newGridColumns.push(newCol);\n return;\n }\n // find index of last column in the group\n const indexes = siblings.map(col => newGridColumns.indexOf(col));\n const lastIndex = Math.max(...indexes);\n insertIntoArray(newGridColumns, newCol, lastIndex + 1);\n });\n this.gridColumns = newGridColumns;\n }\n isPrimaryColumnGroupsPresent() {\n return this.primaryHeaderRowCount > 1;\n }\n // if we are using autoGroupCols, then they should be included for quick filter. this covers the\n // following scenarios:\n // a) user provides 'field' into autoGroupCol of normal grid, so now because a valid col to filter leafs on\n // b) using tree data and user depends on autoGroupCol for first col, and we also want to filter on this\n // (tree data is a bit different, as parent rows can be filtered on, unlike row grouping)\n refreshQuickFilterColumns() {\n var _a;\n let columnsForQuickFilter = (_a = this.isPivotMode() ? this.secondaryColumns : this.primaryColumns) !== null && _a !== void 0 ? _a : [];\n if (this.groupAutoColumns) {\n columnsForQuickFilter = columnsForQuickFilter.concat(this.groupAutoColumns);\n }\n this.columnsForQuickFilter = this.gridOptionsService.is('includeHiddenColumnsInQuickFilter') ? columnsForQuickFilter : columnsForQuickFilter.filter(col => col.isVisible() || col.isRowGroupActive());\n }\n placeLockedColumns(cols) {\n const left = [];\n const normal = [];\n const right = [];\n cols.forEach(col => {\n const position = col.getColDef().lockPosition;\n if (position === 'right') {\n right.push(col);\n } else if (position === 'left' || position === true) {\n left.push(col);\n } else {\n normal.push(col);\n }\n });\n return [...left, ...normal, ...right];\n }\n addAutoGroupToGridColumns() {\n if (missing(this.groupAutoColumns)) {\n this.destroyOldColumns(this.groupAutoColsBalancedTree);\n this.groupAutoColsBalancedTree = null;\n return;\n }\n this.gridColumns = this.groupAutoColumns ? this.groupAutoColumns.concat(this.gridColumns) : this.gridColumns;\n const newAutoColsTree = this.columnFactory.createForAutoGroups(this.groupAutoColumns, this.gridBalancedTree);\n this.destroyOldColumns(this.groupAutoColsBalancedTree, newAutoColsTree);\n this.groupAutoColsBalancedTree = newAutoColsTree;\n this.gridBalancedTree = newAutoColsTree.concat(this.gridBalancedTree);\n }\n // gets called after we copy down grid columns, to make sure any part of the gui\n // that tries to draw, eg the header, it will get empty lists of columns rather\n // than stale columns. for example, the header will received gridColumnsChanged\n // event, so will try and draw, but it will draw successfully when it acts on the\n // virtualColumnsChanged event\n clearDisplayedAndViewportColumns() {\n this.viewportRowLeft = {};\n this.viewportRowRight = {};\n this.viewportRowCenter = {};\n this.displayedColumnsLeft = [];\n this.displayedColumnsRight = [];\n this.displayedColumnsCenter = [];\n this.displayedColumns = [];\n this.viewportColumns = [];\n this.headerViewportColumns = [];\n this.viewportColumnsHash = '';\n }\n updateGroupsAndDisplayedColumns(source) {\n this.updateOpenClosedVisibilityInColumnGroups();\n this.deriveDisplayedColumns(source);\n this.refreshFlexedColumns();\n this.extractViewport();\n this.updateBodyWidths();\n // this event is picked up by the gui, headerRenderer and rowRenderer, to recalculate what columns to display\n const event = {\n type: Events.EVENT_DISPLAYED_COLUMNS_CHANGED\n };\n this.eventService.dispatchEvent(event);\n }\n deriveDisplayedColumns(source) {\n this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft, this.displayedColumnsLeft);\n this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre, this.displayedColumnsCenter);\n this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight, this.displayedColumnsRight);\n this.joinDisplayedColumns();\n this.setLeftValues(source);\n this.displayedAutoHeightCols = this.displayedColumns.filter(col => col.isAutoHeight());\n }\n isAutoRowHeightActive() {\n return this.autoHeightActive;\n }\n wasAutoRowHeightEverActive() {\n return this.autoHeightActiveAtLeastOnce;\n }\n joinDisplayedColumns() {\n if (this.gridOptionsService.is('enableRtl')) {\n this.displayedColumns = this.displayedColumnsRight.concat(this.displayedColumnsCenter).concat(this.displayedColumnsLeft);\n } else {\n this.displayedColumns = this.displayedColumnsLeft.concat(this.displayedColumnsCenter).concat(this.displayedColumnsRight);\n }\n }\n // sets the left pixel position of each column\n setLeftValues(source) {\n this.setLeftValuesOfColumns(source);\n this.setLeftValuesOfGroups();\n }\n setLeftValuesOfColumns(source) {\n if (!this.primaryColumns) {\n return;\n }\n // go through each list of displayed columns\n const allColumns = this.primaryColumns.slice(0);\n // let totalColumnWidth = this.getWidthOfColsInList()\n const doingRtl = this.gridOptionsService.is('enableRtl');\n [this.displayedColumnsLeft, this.displayedColumnsRight, this.displayedColumnsCenter].forEach(columns => {\n if (doingRtl) {\n // when doing RTL, we start at the top most pixel (ie RHS) and work backwards\n let left = this.getWidthOfColsInList(columns);\n columns.forEach(column => {\n left -= column.getActualWidth();\n column.setLeft(left, source);\n });\n } else {\n // otherwise normal LTR, we start at zero\n let left = 0;\n columns.forEach(column => {\n column.setLeft(left, source);\n left += column.getActualWidth();\n });\n }\n removeAllFromUnorderedArray(allColumns, columns);\n });\n // items left in allColumns are columns not displayed, so remove the left position. this is\n // important for the rows, as if a col is made visible, then taken out, then made visible again,\n // we don't want the animation of the cell floating in from the old position, whatever that was.\n allColumns.forEach(column => {\n column.setLeft(null, source);\n });\n }\n setLeftValuesOfGroups() {\n // a groups left value is the lest left value of it's children\n [this.displayedTreeLeft, this.displayedTreeRight, this.displayedTreeCentre].forEach(columns => {\n columns.forEach(column => {\n if (column instanceof ColumnGroup) {\n const columnGroup = column;\n columnGroup.checkLeft();\n }\n });\n });\n }\n derivedDisplayedColumnsFromDisplayedTree(tree, columns) {\n columns.length = 0;\n this.columnUtils.depthFirstDisplayedColumnTreeSearch(tree, child => {\n if (child instanceof Column) {\n columns.push(child);\n }\n });\n }\n extractViewportColumns() {\n if (this.suppressColumnVirtualisation) {\n // no virtualisation, so don't filter\n this.viewportColumnsCenter = this.displayedColumnsCenter;\n this.headerViewportColumnsCenter = this.displayedColumnsCenter;\n } else {\n // filter out what should be visible\n this.viewportColumnsCenter = this.displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this));\n this.headerViewportColumnsCenter = this.displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this));\n }\n this.viewportColumns = this.viewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight);\n this.headerViewportColumns = this.headerViewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight);\n }\n getVirtualHeaderGroupRow(type, dept) {\n let result;\n switch (type) {\n case 'left':\n result = this.viewportRowLeft[dept];\n break;\n case 'right':\n result = this.viewportRowRight[dept];\n break;\n default:\n result = this.viewportRowCenter[dept];\n break;\n }\n if (missing(result)) {\n result = [];\n }\n return result;\n }\n calculateHeaderRows() {\n // go through each group, see if any of it's cols are displayed, and if yes,\n // then this group is included\n this.viewportRowLeft = {};\n this.viewportRowRight = {};\n this.viewportRowCenter = {};\n // for easy lookup when building the groups.\n const virtualColIds = {};\n this.headerViewportColumns.forEach(col => virtualColIds[col.getId()] = true);\n const testGroup = (children, result, dept) => {\n let returnValue = false;\n for (let i = 0; i < children.length; i++) {\n // see if this item is within viewport\n const child = children[i];\n let addThisItem = false;\n if (child instanceof Column) {\n // for column, test if column is included\n addThisItem = virtualColIds[child.getId()] === true;\n } else {\n // if group, base decision on children\n const columnGroup = child;\n const displayedChildren = columnGroup.getDisplayedChildren();\n if (displayedChildren) {\n addThisItem = testGroup(displayedChildren, result, dept + 1);\n }\n }\n if (addThisItem) {\n returnValue = true;\n if (!result[dept]) {\n result[dept] = [];\n }\n result[dept].push(child);\n }\n }\n return returnValue;\n };\n testGroup(this.displayedTreeLeft, this.viewportRowLeft, 0);\n testGroup(this.displayedTreeRight, this.viewportRowRight, 0);\n testGroup(this.displayedTreeCentre, this.viewportRowCenter, 0);\n }\n extractViewport() {\n const hashColumn = c => `${c.getId()}-${c.getPinned() || 'normal'}`;\n this.extractViewportColumns();\n const newHash = this.viewportColumns.map(hashColumn).join('#');\n const changed = this.viewportColumnsHash !== newHash;\n if (changed) {\n this.viewportColumnsHash = newHash;\n this.calculateHeaderRows();\n }\n return changed;\n }\n refreshFlexedColumns(params = {}) {\n var _a;\n const source = params.source ? params.source : 'flex';\n if (params.viewportWidth != null) {\n this.flexViewportWidth = params.viewportWidth;\n }\n if (!this.flexViewportWidth) {\n return [];\n }\n // If the grid has left-over space, divide it between flexing columns in proportion to their flex value.\n // A \"flexing column\" is one that has a 'flex' value set and is not currently being constrained by its\n // minWidth or maxWidth rules.\n let flexAfterDisplayIndex = -1;\n if (params.resizingCols) {\n const allResizingCols = new Set(params.resizingCols);\n // find the last resizing col, as only cols after this one are affected by the resizing\n let displayedCols = this.displayedColumnsCenter;\n for (let i = displayedCols.length - 1; i >= 0; i--) {\n if (allResizingCols.has(displayedCols[i])) {\n flexAfterDisplayIndex = i;\n break;\n }\n }\n }\n // the width of all of the columns for which the width has been determined\n let knownColumnsWidth = 0;\n let flexingColumns = [];\n // store the minimum width of all the flex columns, so we can determine if flex is even possible more quickly\n let minimumFlexedWidth = 0;\n let totalFlex = 0;\n for (let i = 0; i < this.displayedColumnsCenter.length; i++) {\n const isFlex = this.displayedColumnsCenter[i].getFlex() && i > flexAfterDisplayIndex;\n if (isFlex) {\n flexingColumns.push(this.displayedColumnsCenter[i]);\n totalFlex += this.displayedColumnsCenter[i].getFlex();\n minimumFlexedWidth += (_a = this.displayedColumnsCenter[i].getMinWidth()) !== null && _a !== void 0 ? _a : 0;\n } else {\n knownColumnsWidth += this.displayedColumnsCenter[i].getActualWidth();\n }\n }\n ;\n if (!flexingColumns.length) {\n return [];\n }\n let changedColumns = [];\n // this is for performance to prevent trying to flex when unnecessary\n if (knownColumnsWidth + minimumFlexedWidth > this.flexViewportWidth) {\n // known columns and the minimum width of all the flex cols are too wide for viewport\n // so don't flex\n flexingColumns.forEach(col => {\n var _a;\n return col.setActualWidth((_a = col.getMinWidth()) !== null && _a !== void 0 ? _a : 0, source);\n });\n // No columns should flex, but all have been changed. Swap arrays so events fire properly.\n // Expensive logic won't execute as flex columns is empty.\n changedColumns = flexingColumns;\n flexingColumns = [];\n }\n const flexingColumnSizes = [];\n let spaceForFlexingColumns;\n outer: while (true) {\n spaceForFlexingColumns = this.flexViewportWidth - knownColumnsWidth;\n const spacePerFlex = spaceForFlexingColumns / totalFlex;\n for (let i = 0; i < flexingColumns.length; i++) {\n const col = flexingColumns[i];\n const widthByFlexRule = spacePerFlex * col.getFlex();\n let constrainedWidth = 0;\n const minWidth = col.getMinWidth();\n const maxWidth = col.getMaxWidth();\n if (exists(minWidth) && widthByFlexRule < minWidth) {\n constrainedWidth = minWidth;\n } else if (exists(maxWidth) && widthByFlexRule > maxWidth) {\n constrainedWidth = maxWidth;\n }\n if (constrainedWidth) {\n // This column is not in fact flexing as it is being constrained to a specific size\n // so remove it from the list of flexing columns and start again\n col.setActualWidth(constrainedWidth, source);\n removeFromUnorderedArray(flexingColumns, col);\n totalFlex -= col.getFlex();\n changedColumns.push(col);\n knownColumnsWidth += col.getActualWidth();\n continue outer;\n }\n flexingColumnSizes[i] = Math.round(widthByFlexRule);\n }\n break;\n }\n let remainingSpace = spaceForFlexingColumns;\n flexingColumns.forEach((col, i) => {\n col.setActualWidth(Math.min(flexingColumnSizes[i], remainingSpace), source);\n changedColumns.push(col);\n remainingSpace -= flexingColumnSizes[i];\n });\n if (!params.skipSetLeft) {\n this.setLeftValues(source);\n }\n if (params.updateBodyWidths) {\n this.updateBodyWidths();\n }\n if (params.fireResizedEvent) {\n this.dispatchColumnResizedEvent(changedColumns, true, source, flexingColumns);\n }\n return flexingColumns;\n }\n // called from api\n sizeColumnsToFit(gridWidth, source = \"sizeColumnsToFit\", silent, params) {\n var _a, _b, _c, _d, _e;\n if (this.shouldQueueResizeOperations) {\n this.resizeOperationQueue.push(() => this.sizeColumnsToFit(gridWidth, source, silent, params));\n return;\n }\n const limitsMap = {};\n if (params) {\n (_a = params === null || params === void 0 ? void 0 : params.columnLimits) === null || _a === void 0 ? void 0 : _a.forEach(_a => {\n var {\n key\n } = _a,\n dimensions = __rest(_a, [\"key\"]);\n limitsMap[typeof key === 'string' ? key : key.getColId()] = dimensions;\n });\n }\n // avoid divide by zero\n const allDisplayedColumns = this.getAllDisplayedColumns();\n const doColumnsAlreadyFit = gridWidth === this.getWidthOfColsInList(allDisplayedColumns);\n if (gridWidth <= 0 || !allDisplayedColumns.length || doColumnsAlreadyFit) {\n return;\n }\n const colsToSpread = [];\n const colsToNotSpread = [];\n allDisplayedColumns.forEach(column => {\n if (column.getColDef().suppressSizeToFit === true) {\n colsToNotSpread.push(column);\n } else {\n colsToSpread.push(column);\n }\n });\n // make a copy of the cols that are going to be resized\n const colsToDispatchEventFor = colsToSpread.slice(0);\n let finishedResizing = false;\n const moveToNotSpread = column => {\n removeFromArray(colsToSpread, column);\n colsToNotSpread.push(column);\n };\n // resetting cols to their original width makes the sizeColumnsToFit more deterministic,\n // rather than depending on the current size of the columns. most users call sizeColumnsToFit\n // immediately after grid is created, so will make no difference. however if application is calling\n // sizeColumnsToFit repeatedly (eg after column group is opened / closed repeatedly) we don't want\n // the columns to start shrinking / growing over time.\n //\n // NOTE: the process below will assign values to `this.actualWidth` of each column without firing events\n // for this reason we need to manually dispatch resize events after the resize has been done for each column.\n colsToSpread.forEach(column => {\n var _a, _b;\n column.resetActualWidth(source);\n const widthOverride = limitsMap === null || limitsMap === void 0 ? void 0 : limitsMap[column.getId()];\n const minOverride = (_a = widthOverride === null || widthOverride === void 0 ? void 0 : widthOverride.minWidth) !== null && _a !== void 0 ? _a : params === null || params === void 0 ? void 0 : params.defaultMinWidth;\n const maxOverride = (_b = widthOverride === null || widthOverride === void 0 ? void 0 : widthOverride.maxWidth) !== null && _b !== void 0 ? _b : params === null || params === void 0 ? void 0 : params.defaultMaxWidth;\n const colWidth = column.getActualWidth();\n if (typeof minOverride === 'number' && colWidth < minOverride) {\n column.setActualWidth(minOverride, source, true);\n } else if (typeof maxOverride === 'number' && colWidth > maxOverride) {\n column.setActualWidth(maxOverride, source, true);\n }\n });\n while (!finishedResizing) {\n finishedResizing = true;\n const availablePixels = gridWidth - this.getWidthOfColsInList(colsToNotSpread);\n if (availablePixels <= 0) {\n // no width, set everything to minimum\n colsToSpread.forEach(column => {\n var _a, _b;\n const widthOverride = (_b = (_a = limitsMap === null || limitsMap === void 0 ? void 0 : limitsMap[column.getId()]) === null || _a === void 0 ? void 0 : _a.minWidth) !== null && _b !== void 0 ? _b : params === null || params === void 0 ? void 0 : params.defaultMinWidth;\n if (typeof widthOverride === 'number') {\n column.setActualWidth(widthOverride, source, true);\n return;\n }\n column.setMinimum(source);\n });\n } else {\n const scale = availablePixels / this.getWidthOfColsInList(colsToSpread);\n // we set the pixels for the last col based on what's left, as otherwise\n // we could be a pixel or two short or extra because of rounding errors.\n let pixelsForLastCol = availablePixels;\n // backwards through loop, as we are removing items as we go\n for (let i = colsToSpread.length - 1; i >= 0; i--) {\n const column = colsToSpread[i];\n const widthOverride = limitsMap === null || limitsMap === void 0 ? void 0 : limitsMap[column.getId()];\n const minOverride = (_b = widthOverride === null || widthOverride === void 0 ? void 0 : widthOverride.minWidth) !== null && _b !== void 0 ? _b : params === null || params === void 0 ? void 0 : params.defaultMinWidth;\n const maxOverride = (_c = widthOverride === null || widthOverride === void 0 ? void 0 : widthOverride.maxWidth) !== null && _c !== void 0 ? _c : params === null || params === void 0 ? void 0 : params.defaultMaxWidth;\n const colMinWidth = (_d = column.getMinWidth()) !== null && _d !== void 0 ? _d : 0;\n const colMaxWidth = (_e = column.getMaxWidth()) !== null && _e !== void 0 ? _e : Number.MAX_VALUE;\n const minWidth = typeof minOverride === 'number' && minOverride > colMinWidth ? minOverride : column.getMinWidth();\n const maxWidth = typeof maxOverride === 'number' && maxOverride < colMaxWidth ? maxOverride : column.getMaxWidth();\n let newWidth = Math.round(column.getActualWidth() * scale);\n if (exists(minWidth) && newWidth < minWidth) {\n newWidth = minWidth;\n moveToNotSpread(column);\n finishedResizing = false;\n } else if (exists(maxWidth) && newWidth > maxWidth) {\n newWidth = maxWidth;\n moveToNotSpread(column);\n finishedResizing = false;\n } else if (i === 0) {\n // if this is the last column\n newWidth = pixelsForLastCol;\n }\n column.setActualWidth(newWidth, source, true);\n pixelsForLastCol -= newWidth;\n }\n }\n }\n // see notes above\n colsToDispatchEventFor.forEach(col => {\n col.fireColumnWidthChangedEvent(source);\n });\n this.setLeftValues(source);\n this.updateBodyWidths();\n if (silent) {\n return;\n }\n this.dispatchColumnResizedEvent(colsToDispatchEventFor, true, source);\n }\n buildDisplayedTrees(visibleColumns) {\n const leftVisibleColumns = [];\n const rightVisibleColumns = [];\n const centerVisibleColumns = [];\n visibleColumns.forEach(column => {\n switch (column.getPinned()) {\n case \"left\":\n leftVisibleColumns.push(column);\n break;\n case \"right\":\n rightVisibleColumns.push(column);\n break;\n default:\n centerVisibleColumns.push(column);\n break;\n }\n });\n const groupInstanceIdCreator = new GroupInstanceIdCreator();\n this.displayedTreeLeft = this.displayedGroupCreator.createDisplayedGroups(leftVisibleColumns, groupInstanceIdCreator, 'left', this.displayedTreeLeft);\n this.displayedTreeRight = this.displayedGroupCreator.createDisplayedGroups(rightVisibleColumns, groupInstanceIdCreator, 'right', this.displayedTreeRight);\n this.displayedTreeCentre = this.displayedGroupCreator.createDisplayedGroups(centerVisibleColumns, groupInstanceIdCreator, null, this.displayedTreeCentre);\n this.updateDisplayedMap();\n }\n updateDisplayedMap() {\n this.displayedColumnsAndGroupsMap = {};\n const func = child => {\n this.displayedColumnsAndGroupsMap[child.getUniqueId()] = child;\n };\n this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeCentre, func);\n this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeLeft, func);\n this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeRight, func);\n }\n isDisplayed(item) {\n const fromMap = this.displayedColumnsAndGroupsMap[item.getUniqueId()];\n // check for reference, in case new column / group with same id is now present\n return fromMap === item;\n }\n updateOpenClosedVisibilityInColumnGroups() {\n const allColumnGroups = this.getAllDisplayedTrees();\n this.columnUtils.depthFirstAllColumnTreeSearch(allColumnGroups, child => {\n if (child instanceof ColumnGroup) {\n child.calculateDisplayedColumns();\n }\n });\n }\n getGroupAutoColumns() {\n return this.groupAutoColumns;\n }\n /**\n * Creates new auto group columns if required\n * @returns whether auto cols have changed\n */\n createGroupAutoColumnsIfNeeded() {\n const forceRecreateAutoGroups = this.forceRecreateAutoGroups;\n this.forceRecreateAutoGroups = false;\n if (!this.autoGroupsNeedBuilding) {\n return false;\n }\n this.autoGroupsNeedBuilding = false;\n const groupFullWidthRow = this.gridOptionsService.isGroupUseEntireRow(this.pivotMode);\n // we need to allow suppressing auto-column separately for group and pivot as the normal situation\n // is CSRM and user provides group column themselves for normal view, but when they go into pivot the\n // columns are generated by the grid so no opportunity for user to provide group column. so need a way\n // to suppress auto-col for grouping only, and not pivot.\n // however if using Viewport RM or SSRM and user is providing the columns, the user may wish full control\n // of the group column in this instance.\n const suppressAutoColumn = this.pivotMode ? this.gridOptionsService.is('pivotSuppressAutoColumn') : this.isGroupSuppressAutoColumn();\n const groupingActive = this.rowGroupColumns.length > 0 || this.usingTreeData;\n const needAutoColumns = groupingActive && !suppressAutoColumn && !groupFullWidthRow;\n if (needAutoColumns) {\n const newAutoGroupCols = this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);\n const autoColsDifferent = !this.autoColsEqual(newAutoGroupCols, this.groupAutoColumns);\n // we force recreate so new group cols pick up the new\n // definitions. otherwise we could ignore the new cols because they appear to be the same.\n if (autoColsDifferent || forceRecreateAutoGroups) {\n this.groupAutoColumns = newAutoGroupCols;\n return true;\n }\n } else {\n this.groupAutoColumns = null;\n }\n return false;\n }\n isGroupSuppressAutoColumn() {\n const groupDisplayType = this.gridOptionsService.get('groupDisplayType');\n const isCustomRowGroups = groupDisplayType ? matchesGroupDisplayType('custom', groupDisplayType) : false;\n if (isCustomRowGroups) {\n return true;\n }\n const treeDataDisplayType = this.gridOptionsService.get('treeDataDisplayType');\n return treeDataDisplayType ? matchesTreeDataDisplayType('custom', treeDataDisplayType) : false;\n }\n autoColsEqual(colsA, colsB) {\n return areEqual(colsA, colsB, (a, b) => a.getColId() === b.getColId());\n }\n getWidthOfColsInList(columnList) {\n return columnList.reduce((width, col) => width + col.getActualWidth(), 0);\n }\n getGridBalancedTree() {\n return this.gridBalancedTree;\n }\n getFirstDisplayedColumn() {\n const isRtl = this.gridOptionsService.is('enableRtl');\n const queryOrder = ['getDisplayedLeftColumns', 'getDisplayedCenterColumns', 'getDisplayedRightColumns'];\n if (isRtl) {\n queryOrder.reverse();\n }\n for (let i = 0; i < queryOrder.length; i++) {\n const container = this[queryOrder[i]]();\n if (container.length) {\n return isRtl ? last(container) : container[0];\n }\n }\n return null;\n }\n setColumnHeaderHeight(col, height) {\n const changed = col.setAutoHeaderHeight(height);\n if (changed) {\n const event = {\n type: Events.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,\n column: col,\n columns: [col],\n source: 'autosizeColumnHeaderHeight'\n };\n this.eventService.dispatchEvent(event);\n }\n }\n getColumnGroupHeaderRowHeight() {\n if (this.isPivotMode()) {\n return this.getPivotGroupHeaderHeight();\n }\n return this.getGroupHeaderHeight();\n }\n getColumnHeaderRowHeight() {\n const defaultHeight = this.isPivotMode() ? this.getPivotHeaderHeight() : this.getHeaderHeight();\n const displayedHeights = this.getAllDisplayedColumns().filter(col => col.isAutoHeaderHeight()).map(col => col.getAutoHeaderHeight() || 0);\n return Math.max(defaultHeight, ...displayedHeights);\n }\n getHeaderHeight() {\n var _a;\n return (_a = this.gridOptionsService.getNum('headerHeight')) !== null && _a !== void 0 ? _a : this.environment.getFromTheme(25, 'headerHeight');\n }\n getFloatingFiltersHeight() {\n var _a;\n return (_a = this.gridOptionsService.getNum('floatingFiltersHeight')) !== null && _a !== void 0 ? _a : this.getHeaderHeight();\n }\n getGroupHeaderHeight() {\n var _a;\n return (_a = this.gridOptionsService.getNum('groupHeaderHeight')) !== null && _a !== void 0 ? _a : this.getHeaderHeight();\n }\n getPivotHeaderHeight() {\n var _a;\n return (_a = this.gridOptionsService.getNum('pivotHeaderHeight')) !== null && _a !== void 0 ? _a : this.getHeaderHeight();\n }\n getPivotGroupHeaderHeight() {\n var _a;\n return (_a = this.gridOptionsService.getNum('pivotGroupHeaderHeight')) !== null && _a !== void 0 ? _a : this.getGroupHeaderHeight();\n }\n queueResizeOperations() {\n this.shouldQueueResizeOperations = true;\n }\n processResizeOperations() {\n this.shouldQueueResizeOperations = false;\n this.resizeOperationQueue.forEach(resizeOperation => resizeOperation());\n this.resizeOperationQueue = [];\n }\n resetColumnDefIntoColumn(column) {\n const userColDef = column.getUserProvidedColDef();\n if (!userColDef) {\n return false;\n }\n const newColDef = this.columnFactory.addColumnDefaultAndTypes(userColDef, column.getColId());\n column.setColDef(newColDef, userColDef);\n return true;\n }\n generateColumnStateForRowGroupAndPivotIndexes(updatedRowGroupColumnState, updatedPivotColumnState) {\n // Generally columns should appear in the order they were before. For any new columns, these should appear in the original col def order.\n // The exception is for columns that were added via `addGroupColumns`. These should appear at the end.\n // We don't have to worry about full updates, as in this case the arrays are correct, and they won't appear in the updated lists.\n let existingColumnStateUpdates = {};\n const orderColumns = (updatedColumnState, colList, enableProp, initialEnableProp, indexProp, initialIndexProp) => {\n if (!colList.length || !this.primaryColumns) {\n return [];\n }\n const updatedColIdArray = Object.keys(updatedColumnState);\n const updatedColIds = new Set(updatedColIdArray);\n const newColIds = new Set(updatedColIdArray);\n const allColIds = new Set(colList.map(column => {\n const colId = column.getColId();\n newColIds.delete(colId);\n return colId;\n }).concat(updatedColIdArray));\n const colIdsInOriginalOrder = [];\n const originalOrderMap = {};\n let orderIndex = 0;\n for (let i = 0; i < this.primaryColumns.length; i++) {\n const colId = this.primaryColumns[i].getColId();\n if (allColIds.has(colId)) {\n colIdsInOriginalOrder.push(colId);\n originalOrderMap[colId] = orderIndex++;\n }\n }\n // follow approach in `resetColumnState`\n let index = 1000;\n let hasAddedNewCols = false;\n let lastIndex = 0;\n const processPrecedingNewCols = colId => {\n const originalOrderIndex = originalOrderMap[colId];\n for (let i = lastIndex; i < originalOrderIndex; i++) {\n const newColId = colIdsInOriginalOrder[i];\n if (newColIds.has(newColId)) {\n updatedColumnState[newColId][indexProp] = index++;\n newColIds.delete(newColId);\n }\n }\n lastIndex = originalOrderIndex;\n };\n colList.forEach(column => {\n const colId = column.getColId();\n if (updatedColIds.has(colId)) {\n // New col already exists. Add any other new cols that should be before it.\n processPrecedingNewCols(colId);\n updatedColumnState[colId][indexProp] = index++;\n } else {\n const colDef = column.getColDef();\n const missingIndex = colDef[indexProp] === null || colDef[indexProp] === undefined && colDef[initialIndexProp] == null;\n if (missingIndex) {\n if (!hasAddedNewCols) {\n const propEnabled = colDef[enableProp] || colDef[enableProp] === undefined && colDef[initialEnableProp];\n if (propEnabled) {\n processPrecedingNewCols(colId);\n } else {\n // Reached the first manually added column. Add all the new columns now.\n newColIds.forEach(newColId => {\n // Rather than increment the index, just use the original order index - doesn't need to be contiguous.\n updatedColumnState[newColId][indexProp] = index + originalOrderMap[newColId];\n });\n index += colIdsInOriginalOrder.length;\n hasAddedNewCols = true;\n }\n }\n if (!existingColumnStateUpdates[colId]) {\n existingColumnStateUpdates[colId] = {\n colId\n };\n }\n existingColumnStateUpdates[colId][indexProp] = index++;\n }\n }\n });\n };\n orderColumns(updatedRowGroupColumnState, this.rowGroupColumns, 'rowGroup', 'initialRowGroup', 'rowGroupIndex', 'initialRowGroupIndex');\n orderColumns(updatedPivotColumnState, this.pivotColumns, 'pivot', 'initialPivot', 'pivotIndex', 'initialPivotIndex');\n return Object.values(existingColumnStateUpdates);\n }\n};\n__decorate([Autowired('expressionService')], ColumnModel.prototype, \"expressionService\", void 0);\n__decorate([Autowired('columnFactory')], ColumnModel.prototype, \"columnFactory\", void 0);\n__decorate([Autowired('displayedGroupCreator')], ColumnModel.prototype, \"displayedGroupCreator\", void 0);\n__decorate([Autowired('ctrlsService')], ColumnModel.prototype, \"ctrlsService\", void 0);\n__decorate([Autowired('autoWidthCalculator')], ColumnModel.prototype, \"autoWidthCalculator\", void 0);\n__decorate([Autowired('columnUtils')], ColumnModel.prototype, \"columnUtils\", void 0);\n__decorate([Autowired('columnAnimationService')], ColumnModel.prototype, \"columnAnimationService\", void 0);\n__decorate([Autowired('autoGroupColService')], ColumnModel.prototype, \"autoGroupColService\", void 0);\n__decorate([Optional('aggFuncService')], ColumnModel.prototype, \"aggFuncService\", void 0);\n__decorate([Optional('valueCache')], ColumnModel.prototype, \"valueCache\", void 0);\n__decorate([Optional('animationFrameService')], ColumnModel.prototype, \"animationFrameService\", void 0);\n__decorate([Autowired('sortController')], ColumnModel.prototype, \"sortController\", void 0);\n__decorate([Autowired('columnDefFactory')], ColumnModel.prototype, \"columnDefFactory\", void 0);\n__decorate([PostConstruct], ColumnModel.prototype, \"init\", null);\n__decorate([PreDestroy], ColumnModel.prototype, \"destroyColumns\", null);\n__decorate([__param(0, Qualifier('loggerFactory'))], ColumnModel.prototype, \"setBeans\", null);\nColumnModel = __decorate([Bean('columnModel')], ColumnModel);\nexport { ColumnModel };","var __decorate = this && this.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { ColumnGroup } from \"../entities/columnGroup.mjs\";\nimport { ProvidedColumnGroup } from \"../entities/providedColumnGroup.mjs\";\nimport { Bean } from \"../context/context.mjs\";\nimport { BeanStub } from \"../context/beanStub.mjs\";\nimport { attrToNumber } from \"../utils/generic.mjs\";\n// takes in a list of columns, as specified by the column definitions, and returns column groups\nlet ColumnUtils = class ColumnUtils extends BeanStub {\n calculateColMinWidth(colDef) {\n return colDef.minWidth != null ? colDef.minWidth : this.environment.getMinColWidth();\n }\n calculateColMaxWidth(colDef) {\n return colDef.maxWidth != null ? colDef.maxWidth : Number.MAX_SAFE_INTEGER;\n }\n calculateColInitialWidth(colDef) {\n const minColWidth = this.calculateColMinWidth(colDef);\n const maxColWidth = this.calculateColMaxWidth(colDef);\n let width;\n const colDefWidth = attrToNumber(colDef.width);\n const colDefInitialWidth = attrToNumber(colDef.initialWidth);\n if (colDefWidth != null) {\n width = colDefWidth;\n } else if (colDefInitialWidth != null) {\n width = colDefInitialWidth;\n } else {\n width = 200;\n }\n return Math.max(Math.min(width, maxColWidth), minColWidth);\n }\n getOriginalPathForColumn(column, originalBalancedTree) {\n const result = [];\n let found = false;\n const recursePath = (balancedColumnTree, dept) => {\n for (let i = 0; i < balancedColumnTree.length; i++) {\n if (found) {\n return;\n }\n // quit the search, so 'result' is kept with the found result\n const node = balancedColumnTree[i];\n if (node instanceof ProvidedColumnGroup) {\n const nextNode = node;\n recursePath(nextNode.getChildren(), dept + 1);\n result[dept] = node;\n } else if (node === column) {\n found = true;\n }\n }\n };\n recursePath(originalBalancedTree, 0);\n // we should always find the path, but in case there is a bug somewhere, returning null\n // will make it fail rather than provide a 'hard to track down' bug\n return found ? result : null;\n }\n depthFirstOriginalTreeSearch(parent, tree, callback) {\n if (!tree) {\n return;\n }\n tree.forEach(child => {\n if (child instanceof ProvidedColumnGroup) {\n this.depthFirstOriginalTreeSearch(child, child.getChildren(), callback);\n }\n callback(child, parent);\n });\n }\n depthFirstAllColumnTreeSearch(tree, callback) {\n if (!tree) {\n return;\n }\n tree.forEach(child => {\n if (child instanceof ColumnGroup) {\n this.depthFirstAllColumnTreeSearch(child.getChildren(), callback);\n }\n callback(child);\n });\n }\n depthFirstDisplayedColumnTreeSearch(tree, callback) {\n if (!tree) {\n return;\n }\n tree.forEach(child => {\n if (child instanceof ColumnGroup) {\n this.depthFirstDisplayedColumnTreeSearch(child.getDisplayedChildren(), callback);\n }\n callback(child);\n });\n }\n};\nColumnUtils = __decorate([Bean('columnUtils')], ColumnUtils);\nexport { ColumnUtils };","var __decorate = this && this.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { ColumnGroup } from \"../entities/columnGroup.mjs\";\nimport { Bean } from \"../context/context.mjs\";\nimport { BeanStub } from \"../context/beanStub.mjs\";\nimport { exists } from \"../utils/generic.mjs\";\n// takes in a list of columns, as specified by the column definitions, and returns column groups\nlet DisplayedGroupCreator = class DisplayedGroupCreator extends BeanStub {\n createDisplayedGroups(\n // all displayed columns sorted - this is the columns the grid should show\n sortedVisibleColumns,\n // creates unique id's for the group\n groupInstanceIdCreator,\n // whether it's left, right or center col\n pinned,\n // we try to reuse old groups if we can, to allow gui to do animation\n oldDisplayedGroups) {\n const oldColumnsMapped = this.mapOldGroupsById(oldDisplayedGroups);\n /**\n * The following logic starts at the leaf level of columns, iterating through them to build their parent\n * groups when the parents match.\n *\n * The created groups are then added to an array, and similarly iterated on until we reach the top level.\n *\n * When row groups have no original parent, it's added to the result.\n */\n const topLevelResultCols = [];\n // this is an array of cols or col groups at one level of depth, starting from leaf and ending at root\n let groupsOrColsAtCurrentLevel = sortedVisibleColumns;\n while (groupsOrColsAtCurrentLevel.length) {\n // store what's currently iterating so the function can build the next level of col groups\n const currentlyIterating = groupsOrColsAtCurrentLevel;\n groupsOrColsAtCurrentLevel = [];\n // store the index of the last row which was different from the previous row, this is used as a slice\n // index for finding the children to group together\n let lastGroupedColIdx = 0;\n // create a group of children from lastGroupedColIdx to the provided `to` parameter\n const createGroupToIndex = to => {\n const from = lastGroupedColIdx;\n lastGroupedColIdx = to;\n const previousNode = currentlyIterating[from];\n const previousNodeProvided = previousNode instanceof ColumnGroup ? previousNode.getProvidedColumnGroup() : previousNode;\n const previousNodeParent = previousNodeProvided.getOriginalParent();\n if (previousNodeParent == null) {\n // if the last node was different, and had a null parent, then we add all the nodes to the final\n // results)\n for (let i = from; i < to; i++) {\n topLevelResultCols.push(currentlyIterating[i]);\n }\n return;\n }\n // the parent differs from the previous node, so we create a group from the previous node\n // and add all to the result array, except the current node.\n const newGroup = this.createColumnGroup(previousNodeParent, groupInstanceIdCreator, oldColumnsMapped, pinned);\n for (let i = from; i < to; i++) {\n newGroup.addChild(currentlyIterating[i]);\n }\n groupsOrColsAtCurrentLevel.push(newGroup);\n };\n for (let i = 1; i < currentlyIterating.length; i++) {\n const thisNode = currentlyIterating[i];\n const thisNodeProvided = thisNode instanceof ColumnGroup ? thisNode.getProvidedColumnGroup() : thisNode;\n const thisNodeParent = thisNodeProvided.getOriginalParent();\n const previousNode = currentlyIterating[lastGroupedColIdx];\n const previousNodeProvided = previousNode instanceof ColumnGroup ? previousNode.getProvidedColumnGroup() : previousNode;\n const previousNodeParent = previousNodeProvided.getOriginalParent();\n if (thisNodeParent !== previousNodeParent) {\n createGroupToIndex(i);\n }\n }\n if (lastGroupedColIdx < currentlyIterating.length) {\n createGroupToIndex(currentlyIterating.length);\n }\n }\n this.setupParentsIntoColumns(topLevelResultCols, null);\n return topLevelResultCols;\n }\n createColumnGroup(providedGroup, groupInstanceIdCreator, oldColumnsMapped, pinned) {\n const groupId = providedGroup.getGroupId();\n const instanceId = groupInstanceIdCreator.getInstanceIdForKey(groupId);\n const uniqueId = ColumnGroup.createUniqueId(groupId, instanceId);\n let columnGroup = oldColumnsMapped[uniqueId];\n // if the user is setting new colDefs, it is possible that the id's overlap, and we\n // would have a false match from above. so we double check we are talking about the\n // same original column group.\n if (columnGroup && columnGroup.getProvidedColumnGroup() !== providedGroup) {\n columnGroup = null;\n }\n if (exists(columnGroup)) {\n // clean out the old column group here, as we will be adding children into it again\n columnGroup.reset();\n } else {\n columnGroup = new ColumnGroup(providedGroup, groupId, instanceId, pinned);\n this.context.createBean(columnGroup);\n }\n return columnGroup;\n }\n // returns back a 2d map of ColumnGroup as follows: groupId -> instanceId -> ColumnGroup\n mapOldGroupsById(displayedGroups) {\n const result = {};\n const recursive = columnsOrGroups => {\n columnsOrGroups.forEach(columnOrGroup => {\n if (columnOrGroup instanceof ColumnGroup) {\n const columnGroup = columnOrGroup;\n result[columnOrGroup.getUniqueId()] = columnGroup;\n recursive(columnGroup.getChildren());\n }\n });\n };\n if (displayedGroups) {\n recursive(displayedGroups);\n }\n return result;\n }\n setupParentsIntoColumns(columnsOrGroups, parent) {\n columnsOrGroups.forEach(columnsOrGroup => {\n columnsOrGroup.setParent(parent);\n if (columnsOrGroup instanceof ColumnGroup) {\n const columnGroup = columnsOrGroup;\n this.setupParentsIntoColumns(columnGroup.getChildren(), columnGroup);\n }\n });\n }\n};\nDisplayedGroupCreator = __decorate([Bean('displayedGroupCreator')], DisplayedGroupCreator);\nexport { DisplayedGroupCreator };","var __decorate = this && this.__decorate || function (decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n};\nimport { Bean } from \"../context/context.mjs\";\nimport { BeanStub } from \"../context/beanStub.mjs\";\nlet AgStackComponentsRegistry = class AgStackComponentsRegistry extends BeanStub {\n constructor() {\n super(...arguments);\n this.componentsMappedByName = {};\n }\n setupComponents(components) {\n if (components) {\n components.forEach(componentMeta => this.addComponent(componentMeta));\n }\n }\n addComponent(componentMeta) {\n // get name of the class as a string\n // insert a dash after every capital letter\n // let classEscaped = className.replace(/([A-Z])/g, \"-$1\").toLowerCase();\n const classEscaped = componentMeta.componentName.replace(/([a-z])([A-Z])/g, \"$1-$2\").toLowerCase();\n // put all to upper case\n const classUpperCase = classEscaped.toUpperCase();\n // finally store\n this.componentsMappedByName[classUpperCase] = componentMeta.componentClass;\n }\n getComponentClass(htmlTag) {\n return this.componentsMappedByName[htmlTag];\n }\n};\nAgStackComponentsRegistry = __decorate([Bean('agStackComponentsRegistry')], AgStackComponentsRegistry);\nexport { AgStackComponentsRegistry };","// ARIA HELPER FUNCTIONS\nfunction toggleAriaAttribute(element, attribute, value) {\n if (value == null || value == '') {\n removeAriaAttribute(element, attribute);\n } else {\n setAriaAttribute(element, attribute, value);\n }\n}\nfunction setAriaAttribute(element, attribute, value) {\n element.setAttribute(ariaAttributeName(attribute), value.toString());\n}\nfunction removeAriaAttribute(element, attribute) {\n element.removeAttribute(ariaAttributeName(attribute));\n}\nfunction ariaAttributeName(attribute) {\n return `aria-${attribute}`;\n}\nexport function setAriaRole(element, role) {\n if (role) {\n element.setAttribute('role', role);\n } else {\n element.removeAttribute('role');\n }\n}\nexport function getAriaSortState(sortDirection) {\n let sort;\n if (sortDirection === 'asc') {\n sort = 'ascending';\n } else if (sortDirection === 'desc') {\n sort = 'descending';\n } else if (sortDirection === 'mixed') {\n sort = 'other';\n } else {\n sort = 'none';\n }\n return sort;\n}\n// ARIA ATTRIBUTE GETTERS\nexport function getAriaLevel(element) {\n return parseInt(element.getAttribute('aria-level'), 10);\n}\nexport function getAriaPosInSet(element) {\n return parseInt(element.getAttribute('aria-posinset'), 10);\n}\nexport function getAriaDescribedBy(element) {\n return element.getAttribute('aria-describedby') || '';\n}\n// ARIA ATTRIBUTE SETTERS\nexport function setAriaLabel(element, label) {\n toggleAriaAttribute(element, 'label', label);\n}\nexport function setAriaLabelledBy(element, labelledBy) {\n toggleAriaAttribute(element, 'labelledby', labelledBy);\n}\nexport function setAriaDescription(element, description) {\n toggleAriaAttribute(element, 'description', description);\n}\nexport function setAriaDescribedBy(element, describedby) {\n toggleAriaAttribute(element, 'describedby', describedby);\n}\nexport function setAriaLive(element, live) {\n toggleAriaAttribute(element, 'live', live);\n}\nexport function setAriaLevel(element, level) {\n toggleAriaAttribute(element, 'level', level);\n}\nexport function setAriaDisabled(element, disabled) {\n toggleAriaAttribute(element, 'disabled', disabled);\n}\nexport function setAriaHidden(element, hidden) {\n toggleAriaAttribute(element, 'hidden', hidden);\n}\nexport function setAriaExpanded(element, expanded) {\n setAriaAttribute(element, 'expanded', expanded);\n}\nexport function removeAriaExpanded(element) {\n removeAriaAttribute(element, 'expanded');\n}\nexport function setAriaSetSize(element, setsize) {\n setAriaAttribute(element, 'setsize', setsize);\n}\nexport function setAriaPosInSet(element, position) {\n setAriaAttribute(element, 'posinset', position);\n}\nexport function setAriaMultiSelectable(element, multiSelectable) {\n setAriaAttribute(element, 'multiselectable', multiSelectable);\n}\nexport function setAriaRowCount(element, rowCount) {\n setAriaAttribute(element, 'rowcount', rowCount);\n}\nexport function setAriaRowIndex(element, rowIndex) {\n setAriaAttribute(element, 'rowindex', rowIndex);\n}\nexport function setAriaColCount(element, colCount) {\n setAriaAttribute(element, 'colcount', colCount);\n}\nexport function setAriaColIndex(element, colIndex) {\n setAriaAttribute(element, 'colindex', colIndex);\n}\nexport function setAriaColSpan(element, colSpan) {\n setAriaAttribute(element, 'colspan', colSpan);\n}\nexport function setAriaSort(element, sort) {\n setAriaAttribute(element, 'sort', sort);\n}\nexport function removeAriaSort(element) {\n removeAriaAttribute(element, 'sort');\n}\nexport function setAriaSelected(element, selected) {\n toggleAriaAttribute(element, 'selected', selected);\n}\nexport function setAriaChecked(element, checked) {\n setAriaAttribute(element, 'checked', checked === undefined ? 'mixed' : checked);\n}\nexport function setAriaControls(controllerElement, controlledElement) {\n toggleAriaAttribute(controllerElement, 'controls', controlledElement.id);\n setAriaLabelledBy(controlledElement, controllerElement.id);\n}\nexport function getAriaCheckboxStateName(translate, state) {\n return state === undefined ? translate('ariaIndeterminate', 'indeterminate') : state === true ? translate('ariaChecked', 'checked') : translate('ariaUnchecked', 'unchecked');\n}","/**\n * These variables are lazy loaded, as otherwise they try and get initialised when we are loading\n * unit tests and we don't have references to window or document in the unit tests\n */\nlet isSafari;\nlet safariVersion;\nlet isChrome;\nlet isFirefox;\nlet isMacOs;\nlet isIOS;\nlet invisibleScrollbar;\nlet browserScrollbarWidth;\nexport function isBrowserSafari() {\n if (isSafari === undefined) {\n isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n }\n return isSafari;\n}\nexport function getSafariVersion() {\n if (safariVersion === undefined) {\n if (isBrowserSafari()) {\n const versionMatch = navigator.userAgent.match(/version\\/(\\d+)/i);\n if (versionMatch) {\n safariVersion = versionMatch[1] != null ? parseFloat(versionMatch[1]) : 0;\n }\n } else {\n safariVersion = 0;\n }\n }\n return safariVersion;\n}\n/**\n * Returns true for Chrome and also for Edge (Chromium)\n */\nexport function isBrowserChrome() {\n if (isChrome === undefined) {\n const win = window;\n isChrome = !!win.chrome && (!!win.chrome.webstore || !!win.chrome.runtime) || /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);\n }\n return isChrome;\n}\nexport function isBrowserFirefox() {\n if (isFirefox === undefined) {\n isFirefox = /(firefox)/i.test(navigator.userAgent);\n }\n return isFirefox;\n}\nexport function isMacOsUserAgent() {\n if (isMacOs === undefined) {\n isMacOs = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);\n }\n return isMacOs;\n}\nexport function isIOSUserAgent() {\n if (isIOS === undefined) {\n isIOS = /iPad|iPhone|iPod/.test(navigator.platform) ||\n // eslint-disable-next-line\n navigator.platform === 'MacIntel' && navigator.maxTouchPoints > 1;\n }\n return isIOS;\n}\nexport function browserSupportsPreventScroll() {\n // all browsers except safari support focus({ preventScroll: true }).\n // this feature was added on Safari 15+\n return !isBrowserSafari() || getSafariVersion() >= 15;\n}\nexport function getTabIndex(el) {\n if (!el) {\n return null;\n }\n const numberTabIndex = el.tabIndex;\n const tabIndex = el.getAttribute('tabIndex');\n if (numberTabIndex === -1 && (tabIndex === null || tabIndex === '' && !isBrowserFirefox())) {\n return null;\n }\n return numberTabIndex.toString();\n}\nexport function getMaxDivHeight() {\n if (!document.body) {\n return -1;\n }\n let res = 1000000;\n // FF reports the height back but still renders blank after ~6M px\n const testUpTo = navigator.userAgent.toLowerCase().match(/firefox/) ? 6000000 : 1000000000;\n const div = document.createElement('div');\n document.body.appendChild(div);\n while (true) {\n const test = res * 2;\n div.style.height = test + 'px';\n if (test > testUpTo || div.clientHeight !== test) {\n break;\n } else {\n res = test;\n }\n }\n document.body.removeChild(div);\n return res;\n}\nexport function getBodyWidth() {\n var _a, _b, _c;\n return (_b = (_a = document.body) === null || _a === void 0 ? void 0 : _a.clientWidth) !== null && _b !== void 0 ? _b : window.innerHeight || ((_c = document.documentElement) === null || _c === void 0 ? void 0 : _c.clientWidth) || -1;\n}\nexport function getBodyHeight() {\n var _a, _b, _c;\n return (_b = (_a = document.body) === null || _a === void 0 ? void 0 : _a.clientHeight) !== null && _b !== void 0 ? _b : window.innerHeight || ((_c = document.documentElement) === null || _c === void 0 ? void 0 : _c.clientHeight) || -1;\n}\nexport function getScrollbarWidth() {\n if (browserScrollbarWidth == null) {\n initScrollbarWidthAndVisibility();\n }\n return browserScrollbarWidth;\n}\nfunction initScrollbarWidthAndVisibility() {\n const body = document.body;\n const div = document.createElement('div');\n div.style.width = div.style.height = '100px';\n div.style.opacity = '0';\n div.style.overflow = 'scroll';\n div.style.msOverflowStyle = 'scrollbar'; // needed for WinJS apps\n div.style.position = 'absolute';\n body.appendChild(div);\n let width = div.offsetWidth - div.clientWidth;\n // if width is 0 and client width is 0, means the DOM isn't ready\n if (width === 0 && div.clientWidth === 0) {\n width = null;\n }\n // remove div\n if (div.parentNode) {\n div.parentNode.removeChild(div);\n }\n if (width != null) {\n browserScrollbarWidth = width;\n invisibleScrollbar = width === 0;\n }\n}\nexport function isInvisibleScrollbar() {\n if (invisibleScrollbar == null) {\n initScrollbarWidthAndVisibility();\n }\n return invisibleScrollbar;\n}","import { padStartWidthZeros } from './number.mjs';\n/**\n * Serialises a Date to a string of format `yyyy-MM-dd HH:mm:ss`.\n * An alternative separator can be provided to be used instead of hyphens.\n * @param date The date to serialise\n * @param includeTime Whether to include the time in the serialised string\n * @param separator The separator to use between date parts\n */\nexport function serialiseDate(date, includeTime = true, separator = '-') {\n if (!date) {\n return null;\n }\n let serialised = [date.getFullYear(), date.getMonth() + 1, date.getDate()].map(part => padStartWidthZeros(part, 2)).join(separator);\n if (includeTime) {\n serialised += ' ' + [date.getHours(), date.getMinutes(), date.getSeconds()].map(part => padStartWidthZeros(part, 2)).join(':');\n }\n return serialised;\n}\nconst calculateOrdinal = value => {\n if (value > 3 && value < 21) {\n return 'th';\n }\n const remainder = value % 10;\n switch (remainder) {\n case 1:\n return \"st\";\n case 2:\n return \"nd\";\n case 3:\n return \"rd\";\n }\n return 'th';\n};\n/**\n * Serialises a Date to a string of format the defined format, does not include time.\n * @param date The date to serialise\n * @param format The string to format the date to, defaults to YYYY-MM-DD\n */\nexport function dateToFormattedString(date, format = 'YYYY-MM-DD') {\n const fullYear = padStartWidthZeros(date.getFullYear(), 4);\n const months = ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'];\n const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];\n const replace = {\n YYYY: () => fullYear.slice(fullYear.length - 4, fullYear.length),\n YY: () => fullYear.slice(fullYear.length - 2, fullYear.length),\n Y: () => `${date.getFullYear()}`,\n MMMM: () => months[date.getMonth()],\n MMM: () => months[date.getMonth()].slice(0, 3),\n MM: () => padStartWidthZeros(date.getMonth() + 1, 2),\n Mo: () => `${date.getMonth() + 1}${calculateOrdinal(date.getMonth() + 1)}`,\n M: () => `${date.getMonth() + 1}`,\n Do: () => `${date.getDate()}${calculateOrdinal(date.getDate())}`,\n DD: () => padStartWidthZeros(date.getDate(), 2),\n D: () => `${date.getDate()}`,\n dddd: () => days[date.getDay()],\n ddd: () => days[date.getDay()].slice(0, 3),\n dd: () => days[date.getDay()].slice(0, 2),\n do: () => `${date.getDay()}${calculateOrdinal(date.getDay())}`,\n d: () => `${date.getDay()}`\n };\n const regexp = new RegExp(Object.keys(replace).join('|'), 'g');\n return format.replace(regexp, match => {\n if (match in replace) {\n return replace[match]();\n }\n return match;\n });\n}\n/**\n * Parses a date and time from a string in the format `yyyy-MM-dd HH:mm:ss`\n */\nexport function parseDateTimeFromString(value) {\n if (!value) {\n return null;\n }\n const [dateStr, timeStr] = value.split(' ');\n if (!dateStr) {\n return null;\n }\n const fields = dateStr.split('-').map(f => parseInt(f, 10));\n if (fields.filter(f => !isNaN(f)).length !== 3) {\n return null;\n }\n const [year, month, day] = fields;\n const date = new Date(year, month - 1, day);\n if (date.getFullYear() !== year || date.getMonth() !== month - 1 || date.getDate() !== day) {\n // date was not parsed as expected so must have been invalid\n return null;\n }\n if (!timeStr || timeStr === '00:00:00') {\n return date;\n }\n const [hours, minutes, seconds] = timeStr.split(':').map(part => parseInt(part, 10));\n if (hours >= 0 && hours < 24) {\n date.setHours(hours);\n }\n if (minutes >= 0 && minutes < 60) {\n date.setMinutes(minutes);\n }\n if (seconds >= 0 && seconds < 60) {\n date.setSeconds(seconds);\n }\n return date;\n}","export function padStartWidthZeros(value, totalStringSize) {\n return value.toString().padStart(totalStringSize, '0');\n}\nexport function createArrayOfNumbers(first, last) {\n const result = [];\n for (let i = first; i <= last; i++) {\n result.push(i);\n }\n return result;\n}\nexport function cleanNumber(value) {\n if (typeof value === 'string') {\n value = parseInt(value, 10);\n }\n if (typeof value === 'number') {\n return Math.floor(value);\n }\n return null;\n}\nexport function decToHex(number, bytes) {\n let hex = '';\n for (let i = 0; i < bytes; i++) {\n hex += String.fromCharCode(number & 0xff);\n number >>>= 8;\n }\n return hex;\n}\nexport function formatNumberTwoDecimalPlacesAndCommas(value, thousandSeparator, decimalSeparator) {\n if (typeof value !== 'number') {\n return '';\n }\n return formatNumberCommas(Math.round(value * 100) / 100, thousandSeparator, decimalSeparator);\n}\n/**\n * the native method number.toLocaleString(undefined, {minimumFractionDigits: 0})\n * puts in decimal places in IE, so we use this method instead\n * from: http://blog.tompawlak.org/number-currency-formatting-javascript\n * @param {number} value\n * @returns {string}\n */\nexport function formatNumberCommas(value, thousandSeparator, decimalSeparator) {\n if (typeof value !== 'number') {\n return '';\n }\n return value.toString().replace('.', decimalSeparator).replace(/(\\d)(?=(\\d{3})+(?!\\d))/g, `$1${thousandSeparator}`);\n}\nexport function sum(values) {\n return values == null ? null : values.reduce((total, value) => total + value, 0);\n}\nexport function zeroOrGreater(value, defaultValue) {\n if (value >= 0) {\n return value;\n }\n // zero gets returned if number is missing or the wrong type\n return defaultValue;\n}\nexport function oneOrGreater(value, defaultValue) {\n const valueNumber = parseInt(value, 10);\n if (!isNaN(valueNumber) && isFinite(valueNumber) && valueNumber > 0) {\n return valueNumber;\n }\n return defaultValue;\n}","import { browserSupportsPreventScroll, isBrowserChrome, isBrowserSafari } from './browser.mjs';\nimport { exists } from './generic.mjs';\nimport { setAriaHidden } from './aria.mjs';\nimport { camelCaseToHyphenated } from './string.mjs';\nlet rtlNegativeScroll;\n/**\n * This method adds a class to an element and remove that class from all siblings.\n * Useful for toggling state.\n * @param {HTMLElement} element The element to receive the class\n * @param {string} elementClass The class to be assigned to the element\n * @param {boolean} otherElementClass The class to be assigned to siblings of the element, but not the element itself\n */\nexport function radioCssClass(element, elementClass, otherElementClass) {\n const parent = element.parentElement;\n let sibling = parent && parent.firstChild;\n while (sibling) {\n if (elementClass) {\n sibling.classList.toggle(elementClass, sibling === element);\n }\n if (otherElementClass) {\n sibling.classList.toggle(otherElementClass, sibling !== element);\n }\n sibling = sibling.nextSibling;\n }\n}\nexport const FOCUSABLE_SELECTOR = '[tabindex], input, select, button, textarea, [href]';\nexport const FOCUSABLE_EXCLUDE = '.ag-hidden, .ag-hidden *, [disabled], .ag-disabled:not(.ag-button), .ag-disabled *.mjs';\nexport function isFocusableFormField(element) {\n const matches = Element.prototype.matches || Element.prototype.msMatchesSelector;\n const inputSelector = 'input, select, button, textarea';\n const isFocusable = matches.call(element, inputSelector);\n const isNotFocusable = matches.call(element, FOCUSABLE_EXCLUDE);\n const isElementVisible = isVisible(element);\n const focusable = isFocusable && !isNotFocusable && isElementVisible;\n return focusable;\n}\nexport function setDisplayed(element, displayed, options = {}) {\n const {\n skipAriaHidden\n } = options;\n element.classList.toggle('ag-hidden', !displayed);\n if (!skipAriaHidden) {\n setAriaHidden(element, !displayed);\n }\n}\nexport function setVisible(element, visible, options = {}) {\n const {\n skipAriaHidden\n } = options;\n element.classList.toggle('ag-invisible', !visible);\n if (!skipAriaHidden) {\n setAriaHidden(element, !visible);\n }\n}\nexport function setDisabled(element, disabled) {\n const attributeName = 'disabled';\n const addOrRemoveDisabledAttribute = disabled ? e => e.setAttribute(attributeName, '') : e => e.removeAttribute(attributeName);\n addOrRemoveDisabledAttribute(element);\n nodeListForEach(element.querySelectorAll('input'), input => addOrRemoveDisabledAttribute(input));\n}\nexport function isElementChildOfClass(element, cls, maxNest) {\n let counter = 0;\n while (element) {\n if (element.classList.contains(cls)) {\n return true;\n }\n element = element.parentElement;\n if (typeof maxNest == 'number') {\n if (++counter > maxNest) {\n break;\n }\n } else if (element === maxNest) {\n break;\n }\n }\n return false;\n}\n// returns back sizes as doubles instead of strings. similar to\n// getBoundingClientRect, however getBoundingClientRect does not:\n// a) work with fractions (eg browser is zooming)\n// b) has CSS transitions applied (eg CSS scale, browser zoom), which we don't want, we want the un-transitioned values\nexport function getElementSize(el) {\n const {\n height,\n width,\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n boxSizing\n } = window.getComputedStyle(el);\n return {\n height: parseFloat(height),\n width: parseFloat(width),\n borderTopWidth: parseFloat(borderTopWidth),\n borderRightWidth: parseFloat(borderRightWidth),\n borderBottomWidth: parseFloat(borderBottomWidth),\n borderLeftWidth: parseFloat(borderLeftWidth),\n paddingTop: parseFloat(paddingTop),\n paddingRight: parseFloat(paddingRight),\n paddingBottom: parseFloat(paddingBottom),\n paddingLeft: parseFloat(paddingLeft),\n marginTop: parseFloat(marginTop),\n marginRight: parseFloat(marginRight),\n marginBottom: parseFloat(marginBottom),\n marginLeft: parseFloat(marginLeft),\n boxSizing\n };\n}\nexport function getInnerHeight(el) {\n const size = getElementSize(el);\n if (size.boxSizing === 'border-box') {\n return size.height - size.paddingTop - size.paddingBottom;\n }\n return size.height;\n}\nexport function getInnerWidth(el) {\n const size = getElementSize(el);\n if (size.boxSizing === 'border-box') {\n return size.width - size.paddingLeft - size.paddingRight;\n }\n return size.width;\n}\nexport function getAbsoluteHeight(el) {\n const size = getElementSize(el);\n const marginRight = size.marginBottom + size.marginTop;\n return Math.ceil(el.offsetHeight + marginRight);\n}\nexport function getAbsoluteWidth(el) {\n const size = getElementSize(el);\n const marginWidth = size.marginLeft + size.marginRight;\n return Math.ceil(el.offsetWidth + marginWidth);\n}\nexport function getElementRectWithOffset(el) {\n const offsetElementRect = el.getBoundingClientRect();\n const {\n borderTopWidth,\n borderLeftWidth,\n borderRightWidth,\n borderBottomWidth\n } = getElementSize(el);\n return {\n top: offsetElementRect.top + (borderTopWidth || 0),\n left: offsetElementRect.left + (borderLeftWidth || 0),\n right: offsetElementRect.right + (borderRightWidth || 0),\n bottom: offsetElementRect.bottom + (borderBottomWidth || 0)\n };\n}\nexport function isRtlNegativeScroll() {\n if (typeof rtlNegativeScroll === \"boolean\") {\n return rtlNegativeScroll;\n }\n const template = document.createElement('div');\n template.style.direction = 'rtl';\n template.style.width = '1px';\n template.style.height = '1px';\n template.style.position = 'fixed';\n template.style.top = '0px';\n template.style.overflow = 'hidden';\n template.dir = 'rtl';\n template.innerHTML = /* html */\n `