ag-grid-community 32.0.0 → 32.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ag-grid-community.js +83 -39
- package/dist/ag-grid-community.min.js +1 -1
- package/dist/ag-grid-community.min.noStyle.js +1 -1
- package/dist/ag-grid-community.noStyle.js +83 -39
- package/dist/package/main.cjs.js +83 -39
- package/dist/package/main.cjs.min.js +17 -17
- package/dist/package/main.esm.min.mjs +41 -41
- package/dist/package/main.esm.mjs +83 -39
- package/dist/package/package.json +7 -7
- package/dist/types/client-side-row-model/version.d.ts +1 -1
- package/dist/types/core/interfaces/iCallbackParams.d.ts +3 -1
- package/dist/types/core/interfaces/iColumn.d.ts +4 -6
- package/dist/types/core/interfaces/iRowNode.d.ts +2 -2
- package/dist/types/core/main.d.ts +1 -1
- package/dist/types/core/pinnedRowModel/pinnedRowModel.d.ts +1 -0
- package/dist/types/core/rendering/row/rowDragComp.d.ts +2 -0
- package/dist/types/core/utils/object.d.ts +1 -0
- package/dist/types/core/version.d.ts +1 -1
- package/dist/types/core/widgets/component.d.ts +1 -0
- package/dist/types/csv-export/version.d.ts +1 -1
- package/dist/types/infinite-row-model/version.d.ts +1 -1
- package/package.json +7 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var i in t)__defProp(e,i,{get:t[i],enumerable:!0})},__copyProps=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of __getOwnPropNames(t))!__hasOwnProp.call(e,o)&&o!==i&&__defProp(e,o,{get:()=>t[o],enumerable:!(s=__getOwnPropDesc(t,o))||s.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),main_exports={};__export(main_exports,{ALWAYS_SYNC_GLOBAL_EVENTS:()=>ALWAYS_SYNC_GLOBAL_EVENTS,AbstractHeaderCellCtrl:()=>AbstractHeaderCellCtrl,AgAbstractField:()=>AgAbstractField,AgAbstractInputField:()=>AgAbstractInputField,AgAbstractLabel:()=>AgAbstractLabel,AgCheckbox:()=>AgCheckbox,AgCheckboxSelector:()=>AgCheckboxSelector,AgColumn:()=>AgColumn,AgColumnGroup:()=>AgColumnGroup,AgInputDateField:()=>AgInputDateField,AgInputNumberField:()=>AgInputNumberField,AgInputNumberFieldSelector:()=>AgInputNumberFieldSelector,AgInputTextArea:()=>AgInputTextArea,AgInputTextField:()=>AgInputTextField,AgInputTextFieldSelector:()=>AgInputTextFieldSelector,AgPickerField:()=>AgPickerField,AgPromise:()=>AgPromise,AgProvidedColumnGroup:()=>AgProvidedColumnGroup,AgRadioButton:()=>AgRadioButton,AgSelect:()=>AgSelect,AgSelectSelector:()=>AgSelectSelector,AgToggleButton:()=>AgToggleButton,AgToggleButtonSelector:()=>AgToggleButtonSelector,AnimateShowChangeCellRenderer:()=>AnimateShowChangeCellRenderer,AnimateSlideCellRenderer:()=>AnimateSlideCellRenderer,AnimationFrameService:()=>AnimationFrameService,AriaAnnouncementService:()=>AriaAnnouncementService,AutoScrollService:()=>AutoScrollService,AutoWidthCalculator:()=>AutoWidthCalculator,BarColumnLabelPlacement:()=>BarColumnLabelPlacement,BaseComponentWrapper:()=>BaseComponentWrapper,BaseCreator:()=>BaseCreator,BaseGridSerializingSession:()=>BaseGridSerializingSession,BeanStub:()=>BeanStub,BodyDropPivotTarget:()=>BodyDropPivotTarget,BodyDropTarget:()=>BodyDropTarget,CellComp:()=>CellComp,CellCtrl:()=>CellCtrl,CellNavigationService:()=>CellNavigationService,CellPositionUtils:()=>CellPositionUtils,CellRangeType:()=>CellRangeType,ChangedPath:()=>ChangedPath,ChartMappings:()=>ChartMappings,CheckboxCellEditor:()=>CheckboxCellEditor,CheckboxCellRenderer:()=>CheckboxCellRenderer,CheckboxSelectionComponent:()=>CheckboxSelectionComponent,ClientSideRowModelModule:()=>ClientSideRowModelModule,ClientSideRowModelSteps:()=>ClientSideRowModelSteps,ColumnApplyStateService:()=>ColumnApplyStateService,ColumnAutosizeService:()=>ColumnAutosizeService,ColumnFactory:()=>ColumnFactory,ColumnKeyCreator:()=>ColumnKeyCreator,ColumnModel:()=>ColumnModel,ColumnMoveService:()=>ColumnMoveService,ColumnNameService:()=>ColumnNameService,ColumnSizeService:()=>ColumnSizeService,CommunityFeaturesModule:()=>CommunityFeaturesModule,Component:()=>Component,ComponentUtil:()=>ComponentUtil,Context:()=>Context,CssClassManager:()=>CssClassManager,CsvCreator:()=>CsvCreator,CsvExportModule:()=>CsvExportModule,CtrlsService:()=>CtrlsService,DataTypeService:()=>DataTypeService,DateCellEditor:()=>DateCellEditor,DateFilter:()=>DateFilter,DateStringCellEditor:()=>DateStringCellEditor,Downloader:()=>Downloader,DragAndDropService:()=>DragAndDropService,DragService:()=>DragService,DragSourceType:()=>DragSourceType,Environment:()=>Environment,EventService:()=>EventService,ExcelFactoryMode:()=>ExcelFactoryMode,ExpansionService:()=>ExpansionService,ExpressionService:()=>ExpressionService,FakeHScrollComp:()=>FakeHScrollComp,FakeVScrollComp:()=>FakeVScrollComp,FilterManager:()=>FilterManager,FilterWrapperComp:()=>FilterWrapperComp,FocusService:()=>FocusService,FuncColsService:()=>FuncColsService,GROUP_AUTO_COLUMN_ID:()=>GROUP_AUTO_COLUMN_ID,Grid:()=>Grid,GridBodyComp:()=>GridBodyComp,GridBodyCtrl:()=>GridBodyCtrl,GridComp:()=>GridComp,GridCoreCreator:()=>GridCoreCreator,GridCoreModule:()=>GridCoreModule,GridCtrl:()=>GridCtrl,GridHeaderComp:()=>GridHeaderComp,GridHeaderCtrl:()=>GridHeaderCtrl,GridOptionsService:()=>GridOptionsService,GridSerializer:()=>GridSerializer,GroupInstanceIdCreator:()=>GroupInstanceIdCreator,HeaderCellCtrl:()=>HeaderCellCtrl,HeaderFilterCellComp:()=>HeaderFilterCellComp,HeaderFilterCellCtrl:()=>HeaderFilterCellCtrl,HeaderGroupCellCtrl:()=>HeaderGroupCellCtrl,HeaderNavigationDirection:()=>HeaderNavigationDirection,HeaderNavigationService:()=>HeaderNavigationService,HeaderPositionUtils:()=>HeaderPositionUtils,HeaderRowComp:()=>HeaderRowComp,HeaderRowContainerComp:()=>HeaderRowContainerComp,HeaderRowContainerCtrl:()=>HeaderRowContainerCtrl,HeaderRowCtrl:()=>HeaderRowCtrl,HeaderRowType:()=>HeaderRowType,HorizontalDirection:()=>HorizontalDirection,HorizontalResizeService:()=>HorizontalResizeService,InfiniteRowModelModule:()=>InfiniteRowModelModule,KeyCode:()=>KeyCode,LargeTextCellEditor:()=>LargeTextCellEditor,LayoutCssClasses:()=>LayoutCssClasses,LocalEventService:()=>LocalEventService,LocaleService:()=>LocaleService,ManagedFocusFeature:()=>ManagedFocusFeature,MenuService:()=>MenuService,ModuleNames:()=>ModuleNames,ModuleRegistry:()=>ModuleRegistry,MouseEventService:()=>MouseEventService,MoveColumnFeature:()=>MoveColumnFeature,NavigationService:()=>NavigationService,NumberCellEditor:()=>NumberCellEditor,NumberFilter:()=>NumberFilter,NumberSequence:()=>NumberSequence,OverlayWrapperComponent:()=>OverlayWrapperComponent,PinnedRowModel:()=>PinnedRowModel,PivotResultColsService:()=>PivotResultColsService,PopupComponent:()=>PopupComponent,PopupEditorWrapper:()=>PopupEditorWrapper,PopupService:()=>PopupService,PositionableFeature:()=>PositionableFeature,PropertyKeys:()=>PropertyKeys,ProvidedFilter:()=>ProvidedFilter,RefPlaceholder:()=>RefPlaceholder,ResizeObserverService:()=>ResizeObserverService,RowContainerComp:()=>RowContainerComp,RowContainerCtrl:()=>RowContainerCtrl,RowCtrl:()=>RowCtrl,RowDragComp:()=>RowDragComp,RowHighlightPosition:()=>RowHighlightPosition,RowModelHelperService:()=>RowModelHelperService,RowNode:()=>RowNode,RowNodeBlock:()=>RowNodeBlock,RowNodeBlockLoader:()=>RowNodeBlockLoader,RowNodeSorter:()=>RowNodeSorter,RowPositionUtils:()=>RowPositionUtils,RowRenderer:()=>RowRenderer,RowType:()=>RowType,ScalarFilter:()=>ScalarFilter,ScrollVisibleService:()=>ScrollVisibleService,SelectCellEditor:()=>SelectCellEditor,SelectableService:()=>SelectableService,SelectionHandleType:()=>SelectionHandleType,ServerSideTransactionResultStatus:()=>ServerSideTransactionResultStatus,SetLeftFeature:()=>SetLeftFeature,SimpleFilter:()=>SimpleFilter,SortController:()=>SortController,SortIndicatorComp:()=>SortIndicatorComp,SortIndicatorSelector:()=>SortIndicatorSelector,StandardMenuFactory:()=>StandardMenuFactory,StylingService:()=>StylingService,TabGuardClassNames:()=>TabGuardClassNames,TabGuardComp:()=>TabGuardComp,TabGuardCtrl:()=>TabGuardCtrl,TabGuardFeature:()=>TabGuardFeature,TextCellEditor:()=>TextCellEditor,TextFilter:()=>TextFilter,TextFloatingFilter:()=>TextFloatingFilter,TooltipFeature:()=>TooltipFeature,TooltipStateManager:()=>TooltipStateManager,TouchListener:()=>TouchListener,UserComponentFactory:()=>UserComponentFactory,UserComponentRegistry:()=>UserComponentRegistry,ValueCache:()=>ValueCache,ValueService:()=>ValueService,VanillaFrameworkOverrides:()=>VanillaFrameworkOverrides,VerticalDirection:()=>VerticalDirection,VisibleColsService:()=>VisibleColsService,XmlFactory:()=>XmlFactory,ZipContainer:()=>ZipContainer,_ColumnFilterModule:()=>ColumnFilterModule,_CommunityMenuApiModule:()=>CommunityMenuApiModule,_CsrmSsrmSharedApiModule:()=>CsrmSsrmSharedApiModule,_CsvExportCoreModule:()=>CsvExportCoreModule,_EditCoreModule:()=>EditCoreModule,_FilterCoreModule:()=>FilterCoreModule,_FloatingFilterModule:()=>FloatingFilterModule,_ReadOnlyFloatingFilterModule:()=>ReadOnlyFloatingFilterModule,_RowNodeBlockModule:()=>RowNodeBlockModule,_SsrmInfiniteSharedApiModule:()=>SsrmInfiniteSharedApiModule,_addFocusableContainerListener:()=>_addFocusableContainerListener,_areEqual:()=>_areEqual,_bindCellRendererToHtmlElement:()=>_bindCellRendererToHtmlElement,_capitalise:()=>_capitalise,_clearElement:()=>_clearElement,_cloneObject:()=>_cloneObject,_combineAttributesAndGridOptions:()=>_combineAttributesAndGridOptions,_compose:()=>_compose,_createIcon:()=>_createIcon,_createIconNoSpan:()=>_createIconNoSpan,_debounce:()=>_debounce,_defaultComparator:()=>_defaultComparator,_doOnce:()=>_doOnce,_errorOnce:()=>_errorOnce,_escapeString:()=>_escapeString,_exists:()=>_exists,_existsAndNotEmpty:()=>_existsAndNotEmpty,_flatten:()=>_flatten,_forEachReverse:()=>_forEachReverse,_formatNumberCommas:()=>_formatNumberCommas,_formatNumberTwoDecimalPlacesAndCommas:()=>_formatNumberTwoDecimalPlacesAndCommas,_fuzzySuggestions:()=>_fuzzySuggestions,_getAbsoluteHeight:()=>_getAbsoluteHeight,_getAbsoluteWidth:()=>_getAbsoluteWidth,_getAllValuesInObject:()=>_getAllValuesInObject,_getAriaPosInSet:()=>_getAriaPosInSet,_getCtrlForEventTarget:()=>_getCtrlForEventTarget,_getHeaderClassesFromColDef:()=>_getHeaderClassesFromColDef,_getInnerHeight:()=>_getInnerHeight,_getInnerWidth:()=>_getInnerWidth,_getRowContainerOptions:()=>_getRowContainerOptions,_getToolPanelClassesFromColDef:()=>_getToolPanelClassesFromColDef,_includes:()=>_includes,_insertArrayIntoArray:()=>_insertArrayIntoArray,_insertIntoArray:()=>_insertIntoArray,_isElementInEventPath:()=>_isElementInEventPath,_isEventFromPrintableCharacter:()=>_isEventFromPrintableCharacter,_isIOSUserAgent:()=>_isIOSUserAgent,_isNodeOrElement:()=>_isNodeOrElement,_isStopPropagationForAgGrid:()=>_isStopPropagationForAgGrid,_isVisible:()=>_isVisible,_iterateObject:()=>_iterateObject,_jsonEquals:()=>_jsonEquals,_last:()=>_last,_loadTemplate:()=>_loadTemplate,_log:()=>_log,_makeNull:()=>_makeNull,_mergeDeep:()=>_mergeDeep,_missing:()=>_missing,_missingOrEmpty:()=>_missingOrEmpty,_parseDateTimeFromString:()=>_parseDateTimeFromString,_processOnChange:()=>_processOnChange,_radioCssClass:()=>_radioCssClass,_removeAriaExpanded:()=>_removeAriaExpanded,_removeAriaSort:()=>_removeAriaSort,_removeFromArray:()=>_removeFromArray,_removeFromParent:()=>_removeFromParent,_removeRepeatsFromArray:()=>_removeRepeatsFromArray,_serialiseDate:()=>_serialiseDate,_setAriaActiveDescendant:()=>_setAriaActiveDescendant,_setAriaChecked:()=>_setAriaChecked,_setAriaColCount:()=>_setAriaColCount,_setAriaColIndex:()=>_setAriaColIndex,_setAriaColSpan:()=>_setAriaColSpan,_setAriaControls:()=>_setAriaControls,_setAriaDescribedBy:()=>_setAriaDescribedBy,_setAriaDisabled:()=>_setAriaDisabled,_setAriaExpanded:()=>_setAriaExpanded,_setAriaHidden:()=>_setAriaHidden,_setAriaLabel:()=>_setAriaLabel,_setAriaLabelledBy:()=>_setAriaLabelledBy,_setAriaLevel:()=>_setAriaLevel,_setAriaPosInSet:()=>_setAriaPosInSet,_setAriaRole:()=>_setAriaRole,_setAriaRowCount:()=>_setAriaRowCount,_setAriaRowIndex:()=>_setAriaRowIndex,_setAriaSelected:()=>_setAriaSelected,_setAriaSetSize:()=>_setAriaSetSize,_setAriaSort:()=>_setAriaSort,_setDisabled:()=>_setDisabled,_setDisplayed:()=>_setDisplayed,_setFixedWidth:()=>_setFixedWidth,_setVisible:()=>_setVisible,_shallowCompare:()=>_shallowCompare,_sortRowNodesByOrder:()=>_sortRowNodesByOrder,_stopPropagationForAgGrid:()=>_stopPropagationForAgGrid,_toStringOrNull:()=>_toStringOrNull,_unwrapUserComp:()=>_unwrapUserComp,_utf8_encode:()=>_utf8_encode,_values:()=>_values,_waitUntil:()=>_waitUntil,_warnOnce:()=>_warnOnce,createGrid:()=>createGrid,getDefaultFloatingFilterType:()=>getDefaultFloatingFilterType,isColumn:()=>isColumn,isColumnGroup:()=>isColumnGroup,isProvidedColumnGroup:()=>isProvidedColumnGroup,isSelectionUIEvent:()=>isSelectionUIEvent,provideGlobalGridOptions:()=>provideGlobalGridOptions}),module.exports=__toCommonJS(main_exports);var LocalEventService=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,i){const s=t?this.allAsyncListeners:this.allSyncListeners;let o=s.get(e);return!o&&i&&(o=new Set,s.set(e,o)),o}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const s=this.getListeners(e,i,!1);s&&(s.delete(t),s.size===0&&(i?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){const t=e;this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const i=e.type;if(t&&"event"in e){const l=e.event;l instanceof Event&&(e.eventPath=l.composedPath())}const s=(l,a)=>l.forEach(d=>{if(!a.has(d))return;const h=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>d(e)):()=>d(e);t?this.dispatchAsync(h):h()}),o=this.getListeners(i,t,!1)??new Set,r=new Set(o);r.size>0&&s(r,o),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(l=>{const a=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>l(i,e)):()=>l(i,e);t?this.dispatchAsync(a):a()})}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(t=>t())}};function _existsAndNotEmpty(e){return e!=null&&e.length>0}function _last(e){if(!(!e||!e.length))return e[e.length-1]}function _areEqual(e,t,i){return e==null&&t==null?!0:e!=null&&t!=null&&e.length===t.length&&e.every((s,o)=>i?i(s,t[o]):t[o]===s)}function _shallowCompare(e,t){return _areEqual(e,t)}function _sortNumerically(e){return e.sort((t,i)=>t-i)}function _removeRepeatsFromArray(e,t){if(e)for(let i=e.length-2;i>=0;i--){const s=e[i]===t,o=e[i+1]===t;s&&o&&e.splice(i+1,1)}}function _removeFromUnorderedArray(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function _removeFromArray(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function _removeAllFromUnorderedArray(e,t){for(let i=0;i<t.length;i++)_removeFromUnorderedArray(e,t[i])}function _removeAllFromArray(e,t){for(let i=0;i<t.length;i++)_removeFromArray(e,t[i])}function _insertIntoArray(e,t,i){e.splice(i,0,t)}function _insertArrayIntoArray(e,t,i){if(!(e==null||t==null))for(let s=t.length-1;s>=0;s--){const o=t[s];_insertIntoArray(e,o,i)}}function _moveInArray(e,t,i){_removeAllFromArray(e,t),t.slice().reverse().forEach(s=>_insertIntoArray(e,s,i))}function _includes(e,t){return e.indexOf(t)>-1}function _flatten(e){return[].concat.apply([],e)}function _pushAll(e,t){t==null||e==null||t.forEach(i=>e.push(i))}function _forEachReverse(e,t){if(e!=null)for(let i=e.length-1;i>=0;i--)t(e[i],i)}var AG_GRID_STOP_PROPAGATION="__ag_Grid_Stop_Propagation",PASSIVE_EVENTS=["touchstart","touchend","touchmove","touchcancel","scroll"],supports={};function _stopPropagationForAgGrid(e){e[AG_GRID_STOP_PROPAGATION]=!0}function _isStopPropagationForAgGrid(e){return e[AG_GRID_STOP_PROPAGATION]===!0}var _isEventSupported=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return i=>{if(typeof supports[i]=="boolean")return supports[i];const s=document.createElement(e[i]||"div");return i="on"+i,supports[i]=i in s}})();function _getCtrlForEventTarget(e,t,i){let s=t;for(;s;){const o=e.getDomData(s,i);if(o)return o;s=s.parentElement}return null}function _isElementInEventPath(e,t){return!t||!e?!1:_getEventPath(t).indexOf(e)>=0}function _createEventPath(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function _getEventPath(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():_createEventPath(t)}function _addSafePassiveEventListener(e,t,i,s){const r=_includes(PASSIVE_EVENTS,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,r)}var BeanStub=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.gridId=e.context.getGridId(),this.frameworkOverrides=e.frameworkOverrides,this.stubContext=e.context,this.eventService=e.eventService,this.gos=e.gos,this.localeService=e.localeService}getFrameworkOverrides(){return this.frameworkOverrides}destroy(){for(let e=0;e<this.destroyFunctions.length;e++)this.destroyFunctions[e]();this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t){this.localEventService||(this.localEventService=new LocalEventService),this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService&&this.localEventService.removeEventListener(e,t)}dispatchLocalEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventService,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const i=[];for(const s in t){const o=t[s];o&&i.push(this._setupListener(e,s,o))}return i}_setupListener(e,t,i){if(this.destroyed)return()=>null;e instanceof HTMLElement?_addSafePassiveEventListener(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const s=()=>(e.removeEventListener(t,i),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),null)}setupGridOptionListener(e,t){this.gos.addPropertyEventListener(e,t);const i=()=>(this.gos.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(s=>s!==i),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,s=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=o.changeSet.id}const r={type:"gridPropertyChanged",changeSet:o.changeSet,source:o.source};t(r)};e.forEach(o=>this.setupGridOptionListener(o,s))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.stubContext).createBean(e,i)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}},FrameworkEventListenerService=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=i=>{this.frameworkOverrides.wrapOutgoing(()=>e(i))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(i,s)=>{this.frameworkOverrides.wrapOutgoing(()=>e(i,s))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){return this.wrappedListeners.get(e)??e}unwrapGlobal(e){return this.wrappedGlobalListeners.get(e)??e}};function _makeNull(e){return e==null||e===""?null:e}function _exists(e,t=!1){return e!=null&&(e!==""||t)}function _missing(e){return!_exists(e)}function _missingOrEmpty(e){return e==null||e.length===0}function _toStringOrNull(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function _attrToNumber(e){if(e===void 0)return;if(e===null||e==="")return null;if(typeof e=="number")return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function _attrToBoolean(e){if(e!==void 0)return e===null||e===""?!1:toBoolean(e)}function toBoolean(e){return typeof e=="boolean"?e:typeof e=="string"?e.toUpperCase()==="TRUE"||e=="":!1}function _jsonEquals(e,t){const i=e?JSON.stringify(e):null,s=t?JSON.stringify(t):null;return i===s}function _defaultComparator(e,t,i=!1){const s=e==null,o=t==null;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),s&&o)return 0;if(s)return-1;if(o)return 1;function r(n,l){return n>l?1:n<l?-1:0}if(typeof e!="string"||!i)return r(e,t);try{return e.localeCompare(t)}catch{return r(e,t)}}function _values(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach(i=>t.push(i)),t}return Object.values(e)}function _iterateObject(e,t){if(e!=null){if(Array.isArray(e)){for(let i=0;i<e.length;i++)t(i.toString(),e[i]);return}for(const[i,s]of Object.entries(e))t(i,s)}}function _cloneObject(e){const t={},i=Object.keys(e);for(let s=0;s<i.length;s++){const o=i[s],r=e[o];t[o]=r}return t}function _deepCloneDefinition(e,t){if(!e)return;const i=e,s={};return Object.keys(i).forEach(o=>{if(t&&t.indexOf(o)>=0)return;const r=i[o];_isNonNullObject(r)&&r.constructor===Object?s[o]=_deepCloneDefinition(r):s[o]=r}),s}function _getAllValuesInObject(e){if(!e)return[];const t=Object;if(typeof t.values=="function")return t.values(e);const i=[];for(const s in e)e.hasOwnProperty(s)&&e.propertyIsEnumerable(s)&&i.push(e[s]);return i}function _mergeDeep(e,t,i=!0,s=!1){_exists(t)&&_iterateObject(t,(o,r)=>{let n=e[o];n!==r&&(s&&n==null&&r!=null&&typeof r=="object"&&r.constructor===Object&&(n={},e[o]=n),_isNonNullObject(r)&&_isNonNullObject(n)&&!Array.isArray(n)?_mergeDeep(n,r,i,s):(i||r!==void 0)&&(e[o]=r))})}function _getValueUsingField(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let o=e;for(let r=0;r<s.length;r++){if(o==null)return;o=o[s[r]]}return o}function _isNonNullObject(e){return typeof e=="object"&&e!==null}var COL_DEF_DEFAULTS={resizable:!0,sortable:!0},instanceIdSequence=0;function getNextColInstanceId(){return instanceIdSequence++}function isColumn(e){return e instanceof AgColumn}var DEFAULT_COLUMN_MIN_WIDTH=20,AgColumn=class extends BeanStub{constructor(e,t,i,s){super(),this.isColumn=!0,this.instanceId=getNextColInstanceId(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.columnEventService=new LocalEventService,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=s,this.setState(e)}wireBeans(e){this.columnHoverService=e.columnHoverService}getInstanceId(){return this.instanceId}setState(e){e.sort!==void 0?(e.sort==="asc"||e.sort==="desc")&&(this.sort=e.sort):(e.initialSort==="asc"||e.initialSort==="desc")&&(this.sort=e.initialSort);const t=e.sortIndex,i=e.initialSortIndex;t!==void 0?t!==null&&(this.sortIndex=t):i!==null&&(this.sortIndex=i);const s=e.hide,o=e.initialHide;s!==void 0?this.visible=!s:this.visible=!o,e.pinned!==void 0?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const r=e.flex,n=e.initialFlex;r!==void 0?this.flex=r:n!==void 0&&(this.flex=n)}setColDef(e,t,i){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.columnEventService.dispatchEvent(this.createColumnEvent("colDefChanged",i))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}postConstruct(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const e=this.gos.get("suppressFieldDotNotation");this.fieldContainsDots=_exists(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=_exists(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??DEFAULT_COLUMN_MIN_WIDTH,this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=_exists(this.colDef.tooltipField)||_exists(this.colDef.tooltipValueGetter)||_exists(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const i=_attrToNumber(e.width),s=_attrToNumber(e.initialWidth);return i!=null?t=i:s!=null?t=s:t=200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(_missing(this.colDef)||_missing(this.colDef.showRowGroup))return!1;const t=this.colDef.showRowGroup===!0,i=this.colDef.showRowGroup===e;return t||i}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}addEventListener(e,t){this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.columnEventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new FrameworkEventListenerService(this.frameworkOverrides));const i=this.frameworkEventListenerService?.wrap(t)??t;this.columnEventService.addEventListener(e,i)}removeEventListener(e,t){const i=this.frameworkEventListenerService?.unwrap(t)??t;this.columnEventService.removeEventListener(e,i)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if(typeof this.colDef.suppressNavigable=="boolean")return this.colDef.suppressNavigable;if(typeof this.colDef.suppressNavigable=="function"){const t=this.createColumnFunctionCallbackParams(e),i=this.colDef.suppressNavigable;return i(t)}return!1}isCellEditable(e){return e.group&&!this.gos.get("enableGroupEdit")?!1:this.isColumnFunc(e,this.colDef.editable)}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??COL_DEF_DEFAULTS[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const i=this.createColumnFunctionCallbackParams(e);return t(i)}return!1}setMoving(e,t){this.moving=e,this.columnEventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return this.gos.addGridCommonParams({type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t){this.sort!==e&&(this.sort=e,this.columnEventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return _missing(this.sort)}isSorting(){return _exists(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setMenuVisible(e,t){this.menuVisible!==e&&(this.menuVisible=e,this.columnEventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.columnEventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t,i){this.filterActive!==e&&(this.filterActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const s=this.createColumnEvent("filterChanged",t);i&&_mergeDeep(s,i),this.columnEventService.dispatchEvent(s)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){e===!0||e==="left"?this.pinned="left":e==="right"?this.pinned="right":this.pinned=null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",t)))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const i=e===!0;this.visible!==i&&(this.visible=i,this.columnEventService.dispatchEvent(this.createColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(_missing(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(_missing(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}setActualWidth(e,t,i=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.columnEventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e){this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t){this.pivotActive!==e&&(this.pivotActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t){this.aggregationActive!==e&&(this.aggregationActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnValueChanged",t)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}dispatchStateUpdatedEvent(e){this.columnEventService.dispatchEvent({type:"columnStateUpdated",key:e})}};function isProvidedColumnGroup(e){return e instanceof AgProvidedColumnGroup}var AgProvidedColumnGroup=class extends BeanStub{constructor(e,t,i,s){super(),this.isColumn=!1,this.expandable=!1,this.instanceId=getNextColInstanceId(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=s}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(e){this.children&&this.children.forEach(t=>{isColumn(t)?e.push(t):isProvidedColumnGroup(t)&&t.addLeafColumns(e)})}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach(t=>t.addEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach(t=>t.removeEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,i=!1;const s=this.findChildrenRemovingPadding();for(let r=0,n=s.length;r<n;r++){const l=s[r];if(!l.isVisible())continue;const a=l.getColumnGroupShow();a==="open"?(e=!0,i=!0):a==="closed"?(t=!0,i=!0):(e=!0,t=!0)}const o=e&&t&&i;this.expandable!==o&&(this.expandable=o,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=i=>{i.forEach(s=>{isProvidedColumnGroup(s)&&s.isPadding()?t(s.children):e.push(s)})};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},DefaultColumnTypes={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},doOnceFlags={};function _doOnce(e,t){doOnceFlags[t]||(e(),doOnceFlags[t]=!0)}function _log(e,...t){console.log("AG Grid: "+e,...t)}function _warnOnce(e,...t){_doOnce(()=>console.warn("AG Grid: "+e,...t),e)}function _errorOnce(e,...t){_doOnce(()=>console.error("AG Grid: "+e,...t),e)}function _isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)}function _executeInAWhile(e){_executeAfter(e,400)}var executeNextVMTurnFuncs=[],executeNextVMTurnPending=!1;function _executeNextVMTurn(e){executeNextVMTurnFuncs.push(e),!executeNextVMTurnPending&&(executeNextVMTurnPending=!0,window.setTimeout(()=>{const t=executeNextVMTurnFuncs.slice();executeNextVMTurnFuncs.length=0,executeNextVMTurnPending=!1,t.forEach(i=>i())},0))}function _executeAfter(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(i=>i()),t)}function _debounce(e,t){let i;return function(...s){const o=this;window.clearTimeout(i),i=window.setTimeout(function(){e.apply(o,s)},t)}}function _throttle(e,t){let i=0;return function(...s){const o=this,r=new Date().getTime();r-i<t||(i=r,e.apply(o,s))}}function _waitUntil(e,t,i=100,s){const o=new Date().getTime();let r=null,n=!1;const l=()=>{const a=new Date().getTime()-o>i;(e()||a)&&(t(),n=!0,r!=null&&(window.clearInterval(r),r=null),a&&s&&_warnOnce(s))};l(),n||(r=window.setInterval(l,10))}function _compose(...e){return t=>e.reduce((i,s)=>s(i),t)}var ColumnKeyCreator=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=_toStringOrNull(e);let i=0;for(;;){let s;if(e?(s=e,i!==0&&(s+="_"+i)):t?(s=t,i!==0&&(s+="_"+i)):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}},GROUP_AUTO_COLUMN_ID="ag-Grid-AutoColumn";function getColumnsFromTree(e){const t=[],i=s=>{for(let o=0;o<s.length;o++){const r=s[o];isColumn(r)?t.push(r):isProvidedColumnGroup(r)&&i(r.getChildren())}};return i(e),t}function getWidthOfColsInList(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}function destroyColumnTree(e,t,i){const s={};if(!t)return;depthFirstOriginalTreeSearch(null,t,r=>{s[r.getInstanceId()]=r}),i&&depthFirstOriginalTreeSearch(null,i,r=>{s[r.getInstanceId()]=null});const o=Object.values(s).filter(r=>r!=null);e.destroyBeans(o)}function isColumnGroupAutoCol(e){return e.getId().startsWith(GROUP_AUTO_COLUMN_ID)}function convertColumnTypes(e){let t=[];return e instanceof Array?e.some(s=>typeof s!="string")?_warnOnce("if colDef.type is supplied an array it should be of type 'string[]'"):t=e:typeof e=="string"?t=e.split(","):_warnOnce("colDef.type should be of type 'string' | 'string[]'"),t}var ColumnFactory=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnFactory"}wireBeans(e){this.dataTypeService=e.dataTypeService}createColumnTree(e,t,i,s){const o=new ColumnKeyCreator,{existingCols:r,existingGroups:n,existingColKeys:l}=this.extractExistingTreeData(i);o.addExistingKeys(l);const a=this.recursivelyCreateColumns(e,0,t,r,o,n,s),d=this.findMaxDept(a,0),h=this.balanceColumnTree(a,0,d,o);return depthFirstOriginalTreeSearch(null,h,(u,g)=>{isProvidedColumnGroup(u)&&u.setupExpandable(),u.setOriginalParent(g)}),{columnTree:h,treeDept:d}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&depthFirstOriginalTreeSearch(null,e,o=>{if(isProvidedColumnGroup(o)){const r=o;i.push(r)}else{const r=o;s.push(r.getId()),t.push(r)}}),{existingCols:t,existingGroups:i,existingColKeys:s}}createForAutoGroups(e,t){const i=[],s=this.findDepth(t);return e.forEach(o=>{let r=o;for(let n=s-1;n>=0;n--){const l=new AgProvidedColumnGroup(null,`FAKE_PATH_${o.getId()}}_${n}`,!0,n);this.createBean(l),l.setChildren([r]),r.setOriginalParent(l),r=l}s===0&&o.setOriginalParent(null),i.push(r)}),[i,s]}findDepth(e){let t=0,i=e;for(;i&&i[0]&&isProvidedColumnGroup(i[0]);)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const o=[];for(let r=0;r<e.length;r++){const n=e[r];if(isProvidedColumnGroup(n)){const l=n,a=this.balanceColumnTree(l.getChildren(),t+1,i,s);l.setChildren(a),o.push(l)}else{let l,a;for(let d=i-1;d>=t;d--){const h=s.getUniqueKey(null,null),c=this.createMergedColGroupDef(null),u=new AgProvidedColumnGroup(c,h,!0,t);this.createBean(u),a&&a.setChildren([u]),a=u,l||(l=a)}if(l&&a)if(o.push(l),e.some(h=>isProvidedColumnGroup(h))){a.setChildren([n]);continue}else{a.setChildren(e);break}o.push(n)}}return o}findMaxDept(e,t){let i=t;for(let s=0;s<e.length;s++){const o=e[s];if(isProvidedColumnGroup(o)){const r=o,n=this.findMaxDept(r.getChildren(),t+1);i<n&&(i=n)}}return i}recursivelyCreateColumns(e,t,i,s,o,r,n){if(!e)return[];const l=new Array(e.length);for(let a=0;a<l.length;a++){const d=e[a];this.isColumnGroup(d)?l[a]=this.createColumnGroup(i,d,t,s,o,r,n):l[a]=this.createColumn(i,d,s,o,n)}return l}createColumnGroup(e,t,i,s,o,r,n){const l=this.createMergedColGroupDef(t),a=o.getUniqueKey(l.groupId||null,null),d=new AgProvidedColumnGroup(l,a,!1,i);this.createBean(d);const h=this.findExistingGroup(t,r);h&&r.splice(h.idx,1);const c=h?.group;c&&d.setExpanded(c.isExpanded());const u=this.recursivelyCreateColumns(l.children,i+1,e,s,o,r,n);return d.setChildren(u),d}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gos.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,s,o){const r=this.findExistingColumn(t,i);r&&i?.splice(r.idx,1);let n=r?.column;if(n){const l=this.addColumnDefaultAndTypes(t,n.getColId());n.setColDef(l,t,o),this.applyColumnState(n,l,o)}else{const l=s.getUniqueKey(t.colId,t.field),a=this.addColumnDefaultAndTypes(t,l);n=new AgColumn(a,t,l,e),this.createBean(n)}return this.dataTypeService?.addColumnListeners(n),n}applyColumnState(e,t,i){const s=_attrToNumber(t.flex);if(s!==void 0&&e.setFlex(s),e.getFlex()<=0){const l=_attrToNumber(t.width);if(l!=null)e.setActualWidth(l,i);else{const a=e.getActualWidth();e.setActualWidth(a,i)}}t.sort!==void 0&&(t.sort=="asc"||t.sort=="desc"?e.setSort(t.sort,i):e.setSort(void 0,i));const r=_attrToNumber(t.sortIndex);r!==void 0&&e.setSortIndex(r);const n=_attrToBoolean(t.hide);n!==void 0&&e.setVisible(!n,i),t.pinned!==void 0&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const s=t[i].getUserProvidedColDef();if(!s)continue;if(e.colId!=null){if(t[i].getId()===e.colId)return{idx:i,column:t[i]};continue}if(e.field!=null){if(s.field===e.field)return{idx:i,column:t[i]};continue}if(s===e)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(e.groupId!=null)for(let s=0;s<t.length;s++){const o=t[s];if(o.getColGroupDef()&&o.getId()===e.groupId)return{idx:s,group:o}}}addColumnDefaultAndTypes(e,t){const i={},s=this.gos.get("defaultColDef");_mergeDeep(i,s,!1,!0);const o=this.updateColDefAndGetColumnType(i,e,t);o&&this.assignColumnTypes(o,i),_mergeDeep(i,e,!1,!0);const r=this.gos.get("autoGroupColumnDef"),n=this.gos.isColumnsSortingCoupledToGroup();return e.rowGroup&&r&&n&&_mergeDeep(i,{sort:r.sort,initialSort:r.initialSort},!1,!0),this.dataTypeService?.validateColDef(i),i}updateColDefAndGetColumnType(e,t,i){const s=this.dataTypeService?.updateColDefAndGetColumnType(e,t,i),o=t.type??s??e.type;return e.type=o,o?convertColumnTypes(o):void 0}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},DefaultColumnTypes),s=this.gos.get("columnTypes")||{};_iterateObject(s,(o,r)=>{o in i?_warnOnce(`the column type '${o}' is a default column type and cannot be overridden.`):(r.type&&_warnOnce("Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."),i[o]=r)}),e.forEach(o=>{const r=i[o.trim()];r?_mergeDeep(t,r,!1,!0):_warnOnce("colDef.type '"+o+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return e.children!==void 0}};function depthFirstOriginalTreeSearch(e,t,i){if(t)for(let s=0;s<t.length;s++){const o=t[s];isProvidedColumnGroup(o)&&depthFirstOriginalTreeSearch(o,o.getChildren(),i),i(o,e)}}var ColumnModel=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnModel",this.pivotMode=!1,this.autoHeightActiveAtLeastOnce=!1,this.ready=!1,this.changeEventsDispatching=!1,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}wireBeans(e){this.context=e.context,this.columnFactory=e.columnFactory,this.columnSizeService=e.columnSizeService,this.visibleColsService=e.visibleColsService,this.columnViewportService=e.columnViewportService,this.pivotResultColsService=e.pivotResultColsService,this.columnAnimationService=e.columnAnimationService,this.autoColService=e.autoColService,this.valueCache=e.valueCache,this.columnDefFactory=e.columnDefFactory,this.columnApplyStateService=e.columnApplyStateService,this.columnGroupStateService=e.columnGroupStateService,this.eventDispatcher=e.columnEventDispatcher,this.columnMoveService=e.columnMoveService,this.columnAutosizeService=e.columnAutosizeService,this.funcColsService=e.funcColsService,this.quickFilterService=e.quickFilterService,this.showRowGroupColsService=e.showRowGroupColsService,this.environment=e.environment}postConstruct(){const e=this.gos.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],t=>this.refreshAll(convertSourceType(t.source))),this.addManagedPropertyListener("autoGroupColumnDef",t=>this.onAutoGroupColumnDefChanged(convertSourceType(t.source))),this.addManagedPropertyListeners(["defaultColDef","columnTypes","suppressFieldDotNotation"],t=>this.recreateColumnDefs(convertSourceType(t.source))),this.addManagedPropertyListener("pivotMode",t=>this.setPivotMode(this.gos.get("pivotMode"),convertSourceType(t.source))),this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered()})}createColsFromColDefs(e,t){const i=e?this.columnApplyStateService.compareColumnStatesAndDispatchEvents(t):void 0;this.valueCache.expire();const s=this.colDefCols&&this.colDefCols.list,o=this.colDefCols&&this.colDefCols.tree,r=this.columnFactory.createColumnTree(this.colDefs,!0,o,t);destroyColumnTree(this.context,this.colDefCols?.tree,r.columnTree);const n=r.columnTree,l=r.treeDept,a=getColumnsFromTree(n),d={};a.forEach(c=>d[c.getId()]=c),this.colDefCols={tree:n,treeDepth:l,list:a,map:d},this.funcColsService.extractCols(t,s),this.ready=!0,this.refreshCols(),e&&!this.showingPivotResult&&!this.gos.get("maintainColumnOrder")&&this.orderColsLikeColDefCols(),this.visibleColsService.refresh(t),this.columnViewportService.checkViewportColumns(),this.eventDispatcher.everythingChanged(t),i&&(this.changeEventsDispatching=!0,i(),this.changeEventsDispatching=!1),this.eventDispatcher.newColumnsLoaded(t),t==="gridInitializing"&&this.columnSizeService.applyAutosizeStrategy()}refreshCols(){if(!this.colDefCols)return;const e=this.cols?.tree;this.saveColOrder(),this.selectCols(),this.createAutoCols(),this.addAutoCols(),this.restoreColOrder(),this.positionLockedCols(),this.showRowGroupColsService?.refresh(),this.quickFilterService?.refreshQuickFilterCols(),this.setColSpanActive(),this.setAutoHeightActive(),this.visibleColsService.clear(),this.columnViewportService.clear(),!_areEqual(e,this.cols.tree)&&this.eventDispatcher.gridColumns()}selectCols(){const e=this.pivotResultColsService.getPivotResultCols();if(this.showingPivotResult=e!=null,e){const{map:t,list:i,tree:s,treeDepth:o}=e;this.cols={list:i.slice(),map:{...t},tree:s.slice(),treeDepth:o},e.list.some(n=>this.cols?.map[n.getColId()]!==void 0)||(this.lastPivotOrder=null)}else{const{map:t,list:i,tree:s,treeDepth:o}=this.colDefCols;this.cols={list:i.slice(),map:{...t},tree:s.slice(),treeDepth:o}}}getColsToShow(){const e=this.isPivotMode()&&!this.isShowingPivotResult(),t=this.funcColsService.getValueColumns();return this.cols.list.filter(s=>{const o=isColumnGroupAutoCol(s);if(e){const r=t&&_includes(t,s);return o||r}else return o||s.isVisible()})}addAutoCols(){this.autoCols!=null&&(this.cols.list=this.autoCols.list.concat(this.cols.list),this.cols.tree=this.autoCols.tree.concat(this.cols.tree),updateColsMap(this.cols))}createAutoCols(){const e=this.gos.isGroupUseEntireRow(this.pivotMode),t=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),i=this.funcColsService.getRowGroupColumns(),o=!(i.length>0||this.gos.get("treeData"))||t||e,r=()=>{this.autoCols&&(destroyColumnTree(this.context,this.autoCols.tree),this.autoCols=null)};if(o||!this.autoColService){r();return}const n=this.autoColService.createAutoCols(i)??[],l=areColIdsEqual(n,this.autoCols?.list||null),a=this.cols.treeDepth,h=(this.autoCols?this.autoCols.treeDepth:-1)==a;if(l&&h)return;r();const[c,u]=this.columnFactory.createForAutoGroups(n,this.cols?.tree);this.autoCols={list:n,tree:c,treeDepth:u,map:{}};const g=p=>{if(!p)return null;const m=p.filter(f=>!isColumnGroupAutoCol(f));return[...n,...m]};this.lastOrder=g(this.lastOrder),this.lastPivotOrder=g(this.lastPivotOrder)}refreshAll(e){this.isReady()&&(this.refreshCols(),this.visibleColsService.refresh(e))}setColsVisible(e,t=!1,i){this.columnApplyStateService.applyColumnState({state:e.map(s=>({colId:typeof s=="string"?s:s.getColId(),hide:!t}))},i)}setColsPinned(e,t,i){if(!this.cols||_missingOrEmpty(e))return;if(this.gos.isDomLayout("print")){_warnOnce("Changing the column pinning status is not allowed with domLayout='print'");return}this.columnAnimationService.start();let s;t===!0||t==="left"?s="left":t==="right"?s="right":s=null;const o=[];e.forEach(r=>{if(!r)return;const n=this.getCol(r);n&&n.getPinned()!==s&&(n.setPinned(s),o.push(n))}),o.length&&(this.visibleColsService.refresh(i),this.eventDispatcher.columnPinned(o,i)),this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let s;isProvidedColumnGroup(e)?s=e.getId():s=e||"",this.columnGroupStateService.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColGroup(e){let t=null;return depthFirstOriginalTreeSearch(null,this.cols?.tree,i=>{isProvidedColumnGroup(i)&&i.getId()===e&&(t=i)}),t}isColGroupLocked(e){const t=this.gos.get("groupLockGroupColumns");if(!e.isRowGroupActive()||t===0)return!1;if(t===-1)return!0;const s=this.funcColsService.getRowGroupColumns().findIndex(o=>o.getColId()===e.getColId());return t>s}isSuppressAutoCol(){return this.gos.get("groupDisplayType")==="custom"?!0:this.gos.get("treeDataDisplayType")==="custom"}setAutoHeightActive(){this.autoHeightActive=this.cols.list.some(e=>e.isAutoHeight()),this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,this.gos.isRowModelType("clientSide")||this.gos.isRowModelType("serverSide")||_warnOnce("autoHeight columns only work with Client Side Row Model and Server Side Row Model."))}restoreColOrder(){const e=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!e)return;const t=new Map(e.map((a,d)=>[a,d]));if(!this.cols.list.some(a=>t.has(a)))return;const s=new Map(this.cols.list.map(a=>[a,!0])),o=e.filter(a=>s.has(a)),r=new Map(o.map(a=>[a,!0])),n=this.cols.list.filter(a=>!r.has(a)),l=o.slice();n.forEach(a=>{let d=a.getOriginalParent();if(!d){l.push(a);return}const h=[];for(;!h.length&&d;)d.getLeafColumns().forEach(p=>{const m=l.indexOf(p)>=0,f=h.indexOf(p)<0;m&&f&&h.push(p)}),d=d.getOriginalParent();if(!h.length){l.push(a);return}const c=h.map(g=>l.indexOf(g)),u=Math.max(...c);_insertIntoArray(l,a,u+1)}),this.cols.list=l}orderColsLikeColDefCols(){if(!this.colDefCols||!this.cols)return;const e=this.colDefCols.list.filter(i=>this.cols.list.indexOf(i)>=0),t=this.cols.list.filter(i=>e.indexOf(i)<0);this.cols.list=[...t,...e],this.cols.list=this.columnMoveService.placeLockedColumns(this.cols.list)}sortColsLikeKeys(e){if(this.cols==null)return;let t=[];const i={};e.forEach(o=>{if(i[o])return;const r=this.cols.map[o];r&&(t.push(r),i[o]=!0)});let s=0;if(this.cols.list.forEach(o=>{const r=o.getColId();if(i[r]!=null)return;r.startsWith(GROUP_AUTO_COLUMN_ID)?_insertIntoArray(t,o,s++):t.push(o)}),t=this.columnMoveService.placeLockedColumns(t),!this.columnMoveService.doesMovePassMarryChildren(t)){_warnOnce("Applying column order broke a group where columns should be married together. Applying new order has been discarded.");return}this.cols.list=t}sortColsLikeCols(e){!e||e.length<=1||e.filter(i=>this.cols.list.indexOf(i)<0).length>0||e.sort((i,s)=>{const o=this.cols.list.indexOf(i),r=this.cols.list.indexOf(s);return o-r})}resetColDefIntoCol(e,t){const i=e.getUserProvidedColDef();if(!i)return!1;const s=this.columnFactory.addColumnDefaultAndTypes(i,e.getColId());return e.setColDef(s,i,t),!0}queueResizeOperations(){this.shouldQueueResizeOperations=!0}isShouldQueueResizeOperations(){return this.shouldQueueResizeOperations}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach(e=>e()),this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}moveInCols(e,t,i){_moveInArray(this.cols?.list,e,t),this.visibleColsService.refresh(i)}positionLockedCols(){this.cols.list=this.columnMoveService.placeLockedColumns(this.cols.list)}saveColOrder(){this.showingPivotResult?this.lastPivotOrder=this.cols?.list:this.lastOrder=this.cols?.list}getColumnDefs(){if(!this.colDefCols)return;const e=this.colDefCols.list.slice();this.showingPivotResult?e.sort((s,o)=>this.lastOrder.indexOf(s)-this.lastOrder.indexOf(o)):this.lastOrder&&e.sort((s,o)=>this.cols.list.indexOf(s)-this.cols.list.indexOf(o));const t=this.funcColsService.getRowGroupColumns(),i=this.funcColsService.getPivotColumns();return this.columnDefFactory.buildColumnDefs(e,t,i)}isShowingPivotResult(){return this.showingPivotResult}isChangeEventsDispatching(){return this.changeEventsDispatching}isColSpanActive(){return this.colSpanActive}isProvidedColGroupsPresent(){return this.colDefCols?.treeDepth>0}setColSpanActive(){this.colSpanActive=this.cols.list.some(e=>e.getColDef().colSpan!=null)}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}getHeaderRowCount(){return this.cols?this.cols.treeDepth+1:-1}isReady(){return this.ready}isPivotMode(){return this.pivotMode}setPivotMode(e,t){e===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode)||(this.pivotMode=e,this.ready&&(this.refreshCols(),this.visibleColsService.refresh(t),this.eventDispatcher.pivotModeChanged()))}isPivotSettingAllowed(e){return e&&this.gos.get("treeData")?(_warnOnce("Pivot mode not available with treeData."),!1):!0}isPivotActive(){const e=this.funcColsService.getPivotColumns();return this.pivotMode&&!_missingOrEmpty(e)}recreateColumnDefs(e){this.cols&&(this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e),this.createColsFromColDefs(!0,e))}setColumnDefs(e,t){const i=!!this.colDefs;this.colDefs=e,this.createColsFromColDefs(i,t)}destroy(){destroyColumnTree(this.context,this.colDefCols?.tree),destroyColumnTree(this.context,this.autoCols?.tree),super.destroy()}getColTree(){return this.cols.tree}getColDefColTree(){return this.colDefCols.tree}getColDefCols(){return this.colDefCols?.list?this.colDefCols.list:null}getCols(){return this.cols?.list??[]}getAllCols(){const t=this.pivotResultColsService.getPivotResultCols()?.list;return[].concat(this.colDefCols?.list||[],this.autoCols?.list||[],t||[])}getColsForKeys(e){return e?e.map(i=>this.getCol(i)).filter(i=>i!=null):[]}getColDefCol(e){return this.colDefCols?.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)}getColFromCollection(e,t){if(t==null)return null;const{map:i,list:s}=t;if(typeof e=="string"&&i[e])return i[e];for(let o=0;o<s.length;o++)if(columnsMatch(s[o],e))return s[o];return this.getAutoCol(e)}getAutoCol(e){return this.autoCols==null?null:this.autoCols.list.find(t=>columnsMatch(t,e))||null}getAutoCols(){return this.autoCols?.list||null}setColHeaderHeight(e,t){e.setAutoHeaderHeight(t)&&this.eventDispatcher.headerHeight(e)}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),i=this.visibleColsService.getAllCols().filter(s=>s.isAutoHeaderHeight()).map(s=>s.getAutoHeaderHeight()||0);return Math.max(e,...i)}getHeaderHeight(){return this.gos.get("headerHeight")??this.environment.getDefaultHeaderHeight()}getFloatingFiltersHeight(){return this.gos.get("floatingFiltersHeight")??this.getHeaderHeight()}getGroupHeaderHeight(){return this.gos.get("groupHeaderHeight")??this.getHeaderHeight()}getPivotHeaderHeight(){return this.gos.get("pivotHeaderHeight")??this.getHeaderHeight()}getPivotGroupHeaderHeight(){return this.gos.get("pivotGroupHeaderHeight")??this.getGroupHeaderHeight()}onFirstDataRendered(){const e=this.gos.get("autoSizeStrategy");if(e?.type!=="fitCellContents")return;const{colIds:t,skipHeader:i}=e;setTimeout(()=>{t?this.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"autosizeColumns"}):this.columnAutosizeService.autoSizeAllColumns("autosizeColumns",i)})}onAutoGroupColumnDefChanged(e){this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e)}};function convertSourceType(e){return e==="gridOptionsUpdated"?"gridOptionsChanged":e}function updateColsMap(e){e.map={},e.list.forEach(t=>e.map[t.getId()]=t)}function columnsMatch(e,t){const i=e===t,s=e.getColDef()===t,o=e.getColId()==t;return i||s||o}function areColIdsEqual(e,t){return _areEqual(e,t,(i,s)=>i.getColId()===s.getColId())}var ColumnAutosizeService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnAutosizeService",this.timesDelayed=0}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.animationFrameService=e.animationFrameService,this.autoWidthCalculator=e.autoWidthCalculator,this.eventDispatcher=e.columnEventDispatcher,this.ctrlsService=e.ctrlsService,this.renderStatusService=e.renderStatusService}autoSizeCols(e){if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.autoSizeCols(e));return}const{colKeys:t,skipHeader:i,skipHeaderGroups:s,stopAtGroup:o,source:r="api"}=e;if(this.animationFrameService.flushAllFrames(),this.timesDelayed<5&&this.renderStatusService&&!this.renderStatusService.areHeaderCellsRendered()){this.timesDelayed++,setTimeout(()=>this.autoSizeCols(e));return}this.timesDelayed=0;const n=[];let l=-1;const a=i??this.gos.get("skipHeaderOnAutoSize"),d=s??a;for(;l!==0;){l=0;const h=[];t.forEach(c=>{if(!c)return;const u=this.columnModel.getCol(c);if(!u||n.indexOf(u)>=0)return;const g=this.autoWidthCalculator.getPreferredWidthForColumn(u,a);if(g>0){const p=this.normaliseColumnWidth(u,g);u.setActualWidth(p,r),n.push(u),l++}h.push(u)}),h.length&&this.visibleColsService.refresh(r)}d||this.autoSizeColumnGroupsByColumns(t,r,o),this.eventDispatcher.columnResized(n,!0,"autosizeColumns")}autoSizeColumn(e,t,i){e&&this.autoSizeCols({colKeys:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const s=new Set;this.columnModel.getColsForKeys(e).forEach(l=>{let a=l.getParent();for(;a&&a!=i;)a.isPadding()||s.add(a),a=a.getParent()});let r;const n=[];for(const l of s){for(const a of this.ctrlsService.getHeaderRowContainerCtrls())if(r=a.getHeaderCtrlForColumn(l),r)break;r&&r.resizeLeafColumnsToFit(t)}return n}autoSizeAllColumns(e,t){if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.autoSizeAllColumns(e,t));return}const i=this.visibleColsService.getAllCols();this.autoSizeCols({colKeys:i,skipHeader:t,source:e})}normaliseColumnWidth(e,t){const i=e.getMinWidth();t<i&&(t=i);const s=e.getMaxWidth();return e.isGreaterThanMax(t)&&(t=s),t}},FuncColsService=class extends BeanStub{constructor(){super(...arguments),this.beanName="funcColsService",this.rowGroupCols=[],this.valueCols=[],this.pivotCols=[]}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.aggFuncService=e.aggFuncService,this.visibleColsService=e.visibleColsService}getModifyColumnsNoEventsCallbacks(){return{addGroupCol:e=>this.rowGroupCols.push(e),removeGroupCol:e=>_removeFromArray(this.rowGroupCols,e),addPivotCol:e=>this.pivotCols.push(e),removePivotCol:e=>_removeFromArray(this.pivotCols,e),addValueCol:e=>this.valueCols.push(e),removeValueCol:e=>_removeFromArray(this.valueCols,e)}}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(t===!0)return this.rowGroupCols.slice(0);const i=this.columnModel.getColDefCol(t);return i?[i]:null}sortRowGroupColumns(e){this.rowGroupCols.sort(e)}sortPivotColumns(e){this.pivotCols.sort(e)}getValueColumns(){return this.valueCols?this.valueCols:[]}getPivotColumns(){return this.pivotCols?this.pivotCols:[]}getRowGroupColumns(){return this.rowGroupCols?this.rowGroupCols:[]}isRowGroupEmpty(){return _missingOrEmpty(this.rowGroupCols)}setColumnAggFunc(e,t,i){if(!e)return;const s=this.columnModel.getColDefCol(e);s&&(s.setAggFunc(t),this.eventDispatcher.columnChanged("columnValueChanged",[s],i))}setRowGroupColumns(e,t){this.setColList(e,this.rowGroupCols,"columnRowGroupChanged",!0,!0,(i,s)=>this.setRowGroupActive(i,s,t),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gos.get("suppressRowGroupHidesColumns")&&this.columnModel.setColsVisible([t],!1,i),!e&&!this.gos.get("suppressMakeColumnVisibleAfterUnGroup")&&this.columnModel.setColsVisible([t],!0,i))}addRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!0,!0,i=>this.setRowGroupActive(!0,i,t),"columnRowGroupChanged",t)}removeRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!1,!0,i=>this.setRowGroupActive(!1,i,t),"columnRowGroupChanged",t)}addPivotColumns(e,t){this.updateColList(e,this.pivotCols,!0,!1,i=>i.setPivotActive(!0,t),"columnPivotChanged",t)}setPivotColumns(e,t){this.setColList(e,this.pivotCols,"columnPivotChanged",!0,!1,(i,s)=>{s.setPivotActive(i,t)},t)}removePivotColumns(e,t){this.updateColList(e,this.pivotCols,!1,!1,i=>i.setPivotActive(!1,t),"columnPivotChanged",t)}setValueColumns(e,t){this.setColList(e,this.valueCols,"columnValueChanged",!1,!1,(i,s)=>this.setValueActive(i,s,t),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc()&&this.aggFuncService)){const s=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(s)}}addValueColumns(e,t){this.updateColList(e,this.valueCols,!0,!1,i=>this.setValueActive(!0,i,t),"columnValueChanged",t)}removeValueColumns(e,t){this.updateColList(e,this.valueCols,!1,!1,i=>this.setValueActive(!1,i,t),"columnValueChanged",t)}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const s=this.rowGroupCols[e],o=this.rowGroupCols.slice(e,t);this.rowGroupCols.splice(e,1),this.rowGroupCols.splice(t,0,s),this.eventDispatcher.rowGroupChanged(o,i)}setColList(e,t,i,s,o,r,n){const l=this.columnModel.getCols();if(_missingOrEmpty(l))return;const a=new Map;t.forEach((h,c)=>a.set(h,c)),t.length=0,_exists(e)&&e.forEach(h=>{const c=this.columnModel.getColDefCol(h);c&&t.push(c)}),t.forEach((h,c)=>{const u=a.get(h);if(u===void 0){a.set(h,0);return}s&&u!==c||a.delete(h)}),(this.columnModel.getColDefCols()||[]).forEach(h=>{const c=t.indexOf(h)>=0;r(c,h)}),o&&this.columnModel.refreshCols(),this.visibleColsService.refresh(n),this.eventDispatcher.columnChanged(i,[...a.keys()],n)}updateColList(e,t,i,s,o,r,n){if(!e||_missingOrEmpty(e))return;let l=!1;e.forEach(a=>{if(!a)return;const d=this.columnModel.getColDefCol(a);if(d){if(i){if(t.indexOf(d)>=0)return;t.push(d)}else{if(t.indexOf(d)<0)return;_removeFromArray(t,d)}o(d),l=!0}}),l&&(s&&this.columnModel.refreshCols(),this.visibleColsService.refresh(n),this.eventDispatcher.genericColumnEvent(r,t,n))}extractCols(e,t){this.extractRowGroupCols(e,t),this.extractPivotCols(e,t),this.extractValueCols(e,t)}extractValueCols(e,t){this.valueCols=this.extractColsCommon(t,this.valueCols,(i,s)=>i.setValueActive(s,e),()=>{},()=>{},i=>{const s=i.aggFunc;if(s===null||s==="")return null;if(s!==void 0)return!!s},i=>i.initialAggFunc!=null&&i.initialAggFunc!=""),this.valueCols.forEach(i=>{const s=i.getColDef();s.aggFunc!=null&&s.aggFunc!=""?i.setAggFunc(s.aggFunc):i.getAggFunc()||i.setAggFunc(s.initialAggFunc)})}extractRowGroupCols(e,t){this.rowGroupCols=this.extractColsCommon(t,this.rowGroupCols,(i,s)=>i.setRowGroupActive(s,e),i=>i.rowGroupIndex,i=>i.initialRowGroupIndex,i=>i.rowGroup,i=>i.initialRowGroup)}extractPivotCols(e,t){this.pivotCols=this.extractColsCommon(t,this.pivotCols,(i,s)=>i.setPivotActive(s,e),i=>i.pivotIndex,i=>i.initialPivotIndex,i=>i.pivot,i=>i.initialPivot)}extractColsCommon(e=[],t=[],i,s,o,r,n){const l=[],a=[];(this.columnModel.getColDefCols()||[]).forEach(u=>{const g=e.indexOf(u)<0,p=u.getColDef(),m=_attrToBoolean(r(p)),f=_attrToBoolean(n(p)),v=_attrToNumber(s(p)),C=_attrToNumber(o(p));let w;m!==void 0?w=m:v!==void 0?v===null?w=!1:w=v>=0:g?f!==void 0?w=f:C!==void 0?w=C!=null&&C>=0:w=!1:w=t.indexOf(u)>=0,w&&((g?v!=null||C!=null:v!=null)?l.push(u):a.push(u))});const h=u=>{const g=s(u.getColDef()),p=o(u.getColDef());return g??p};l.sort((u,g)=>{const p=h(u),m=h(g);return p===m?0:p<m?-1:1});const c=[].concat(l);return t.forEach(u=>{a.indexOf(u)>=0&&c.push(u)}),a.forEach(u=>{c.indexOf(u)<0&&c.push(u)}),t.forEach(u=>{c.indexOf(u)<0&&i(u,!1)}),c.forEach(u=>{t.indexOf(u)<0&&i(u,!0)}),c}generateColumnStateForRowGroupAndPivotIndexes(e,t){const i={},s=(o,r,n,l,a,d)=>{const h=this.columnModel.getColDefCols();if(!r.length||!h)return[];const c=Object.keys(o),u=new Set(c),g=new Set(c),p=new Set(r.map(S=>{const R=S.getColId();return g.delete(R),R}).concat(c)),m=[],f={};let v=0;for(let S=0;S<h.length;S++){const R=h[S].getColId();p.has(R)&&(m.push(R),f[R]=v++)}let C=1e3,w=!1,y=0;const F=S=>{const R=f[S];for(let P=y;P<R;P++){const b=m[P];g.has(b)&&(o[b][a]=C++,g.delete(b))}y=R};r.forEach(S=>{const R=S.getColId();if(u.has(R))F(R),o[R][a]=C++;else{const P=S.getColDef();(P[a]===null||P[a]===void 0&&P[d]==null)&&(w||(P[n]||P[n]===void 0&&P[l]?F(R):(g.forEach(M=>{o[M][a]=C+f[M]}),C+=m.length,w=!0)),i[R]||(i[R]={colId:R}),i[R][a]=C++)}})};return s(e,this.rowGroupCols,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(t,this.pivotCols,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}},ColumnApplyStateService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnApplyStateService"}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.sortController=e.sortController,this.columnGetStateService=e.columnGetStateService,this.funcColsService=e.funcColsService,this.visibleColsService=e.visibleColsService,this.columnAnimationService=e.columnAnimationService,this.pivotResultColsService=e.pivotResultColsService}applyColumnState(e,t){const i=this.columnModel.getColDefCols()||[];if(_missingOrEmpty(i))return!1;if(e&&e.state&&!e.state.forEach)return _warnOnce("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."),!1;const s=this.funcColsService.getModifyColumnsNoEventsCallbacks(),o=(l,a,d)=>{const h=this.compareColumnStatesAndDispatchEvents(t),c=a.slice(),u={},g={},p=[],m=[];let f=0;const v=this.funcColsService.getRowGroupColumns().slice(),C=this.funcColsService.getPivotColumns().slice();l.forEach(S=>{const R=S.colId||"";if(R.startsWith(GROUP_AUTO_COLUMN_ID)){p.push(S),m.push(S);return}const b=d(R);b?(this.syncColumnWithStateItem(b,S,e.defaultState,u,g,!1,t,s),_removeFromArray(c,b)):(m.push(S),f+=1)});const w=S=>this.syncColumnWithStateItem(S,null,e.defaultState,u,g,!1,t,s);c.forEach(w),this.funcColsService.sortRowGroupColumns(comparatorByIndex.bind(this,u,v)),this.funcColsService.sortPivotColumns(comparatorByIndex.bind(this,g,C)),this.columnModel.refreshCols();const F=(this.columnModel.getAutoCols()||[]).slice();return p.forEach(S=>{const R=this.columnModel.getAutoCol(S.colId);_removeFromArray(F,R),this.syncColumnWithStateItem(R,S,e.defaultState,null,null,!0,t,s)}),F.forEach(w),this.orderLiveColsLikeState(e),this.visibleColsService.refresh(t),this.eventDispatcher.everythingChanged(t),h(),{unmatchedAndAutoStates:m,unmatchedCount:f}};this.columnAnimationService.start();let{unmatchedAndAutoStates:r,unmatchedCount:n}=o(e.state||[],i,l=>this.columnModel.getColDefCol(l));if(r.length>0||_exists(e.defaultState)){const a=this.pivotResultColsService.getPivotResultCols()?.list;n=o(r,a||[],d=>this.pivotResultColsService.getPivotResultCol(d)).unmatchedCount}return this.columnAnimationService.finish(),n===0}resetColumnState(e){const t=this.columnModel.getColDefCols();if(_missingOrEmpty(t))return;const i=this.columnModel.getColDefColTree(),s=getColumnsFromTree(i),o=[];let r=1e3,n=1e3,l=[];const a=this.columnModel.getAutoCols();a&&(l=l.concat(a)),s&&(l=l.concat(s)),l.forEach(d=>{const h=this.getColumnStateFromColDef(d);_missing(h.rowGroupIndex)&&h.rowGroup&&(h.rowGroupIndex=r++),_missing(h.pivotIndex)&&h.pivot&&(h.pivotIndex=n++),o.push(h)}),this.applyColumnState({state:o,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(p,m)=>p??m??null,i=e.getColDef(),s=t(i.sort,i.initialSort),o=t(i.sortIndex,i.initialSortIndex),r=t(i.hide,i.initialHide),n=t(i.pinned,i.initialPinned),l=t(i.width,i.initialWidth),a=t(i.flex,i.initialFlex);let d=t(i.rowGroupIndex,i.initialRowGroupIndex),h=t(i.rowGroup,i.initialRowGroup);d==null&&(h==null||h==!1)&&(d=null,h=null);let c=t(i.pivotIndex,i.initialPivotIndex),u=t(i.pivot,i.initialPivot);c==null&&(u==null||u==!1)&&(c=null,u=null);const g=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:o,hide:r,pinned:n,width:l,flex:a,rowGroup:h,rowGroupIndex:d,pivot:u,pivotIndex:c,aggFunc:g}}syncColumnWithStateItem(e,t,i,s,o,r,n,l){if(!e)return;const a=(y,F)=>{const S={value1:void 0,value2:void 0};let R=!1;return t&&(t[y]!==void 0&&(S.value1=t[y],R=!0),_exists(F)&&t[F]!==void 0&&(S.value2=t[F],R=!0)),!R&&i&&(i[y]!==void 0&&(S.value1=i[y]),_exists(F)&&i[F]!==void 0&&(S.value2=i[F])),S},d=a("hide").value1;d!==void 0&&e.setVisible(!d,n);const h=a("pinned").value1;h!==void 0&&e.setPinned(h);const c=e.getColDef().minWidth??DEFAULT_COLUMN_MIN_WIDTH,u=a("flex").value1;if(u!==void 0&&e.setFlex(u),u==null){const y=a("width").value1;y!=null&&c!=null&&y>=c&&e.setActualWidth(y,n)}const g=a("sort").value1;g!==void 0&&(g==="desc"||g==="asc"?e.setSort(g,n):e.setSort(void 0,n));const p=a("sortIndex").value1;if(p!==void 0&&e.setSortIndex(p),r||!e.isPrimary())return;const m=a("aggFunc").value1;m!==void 0&&(typeof m=="string"?(e.setAggFunc(m),e.isValueActive()||(e.setValueActive(!0,n),l.addValueCol(e))):(_exists(m)&&_warnOnce("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."),e.isValueActive()&&(e.setValueActive(!1,n),l.removeValueCol(e))));const{value1:f,value2:v}=a("rowGroup","rowGroupIndex");(f!==void 0||v!==void 0)&&(typeof v=="number"||f?(e.isRowGroupActive()||(e.setRowGroupActive(!0,n),l.addGroupCol(e)),s&&typeof v=="number"&&(s[e.getId()]=v)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,n),l.removeGroupCol(e)));const{value1:C,value2:w}=a("pivot","pivotIndex");(C!==void 0||w!==void 0)&&(typeof w=="number"||C?(e.isPivotActive()||(e.setPivotActive(!0,n),l.addPivotCol(e)),o&&typeof w=="number"&&(o[e.getId()]=w)):e.isPivotActive()&&(e.setPivotActive(!1,n),l.removePivotCol(e)))}orderLiveColsLikeState(e){if(!e.applyOrder||!e.state)return;const t=[];e.state.forEach(i=>{i.colId!=null&&t.push(i.colId)}),this.columnModel.sortColsLikeKeys(t)}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.funcColsService.getRowGroupColumns().slice(),pivotColumns:this.funcColsService.getPivotColumns().slice(),valueColumns:this.funcColsService.getValueColumns().slice()},i=this.columnGetStateService.getColumnState(),s={};return i.forEach(o=>{s[o.colId]=o}),()=>{const o=this.columnModel.getAllCols(),r=(m,f,v,C)=>{const w=f.map(C),y=v.map(C);if(_areEqual(w,y))return;const S=new Set(f);v.forEach(b=>{S.delete(b)||S.add(b)});const R=[...S],P={type:m,columns:R,column:R.length===1?R[0]:null,source:e};this.eventService.dispatchEvent(P)},n=m=>{const f=[];return o.forEach(v=>{const C=s[v.getColId()];C&&m(C,v)&&f.push(v)}),f},l=m=>m.getColId();r("columnRowGroupChanged",t.rowGroupColumns,this.funcColsService.getRowGroupColumns(),l),r("columnPivotChanged",t.pivotColumns,this.funcColsService.getPivotColumns(),l);const d=n((m,f)=>{const v=m.aggFunc!=null,C=v!=f.isValueActive(),w=v&&m.aggFunc!=f.getAggFunc();return C||w});d.length>0&&this.eventDispatcher.columnChanged("columnValueChanged",d,e);const h=(m,f)=>m.width!=f.getActualWidth();this.eventDispatcher.columnResized(n(h),!0,e);const c=(m,f)=>m.pinned!=f.getPinned();this.eventDispatcher.columnPinned(n(c),e);const u=(m,f)=>m.hide==f.isVisible();this.eventDispatcher.columnVisible(n(u),e);const p=n((m,f)=>m.sort!=f.getSort()||m.sortIndex!=f.getSortIndex());p.length>0&&this.sortController.dispatchSortChangedEvents(e,p),this.normaliseColumnMovedEventForColumnState(i,e)}}normaliseColumnMovedEventForColumnState(e,t){const i=this.columnGetStateService.getColumnState(),s={};i.forEach(a=>s[a.colId]=a);const o={};e.forEach(a=>{s[a.colId]&&(o[a.colId]=!0)});const r=e.filter(a=>o[a.colId]),n=i.filter(a=>o[a.colId]),l=[];n.forEach((a,d)=>{const h=r&&r[d];if(h&&h.colId!==a.colId){const c=this.columnModel.getCol(h.colId);c&&l.push(c)}}),l.length&&this.eventDispatcher.columnMoved({movedColumns:l,source:t,finished:!0})}},comparatorByIndex=(e,t,i,s)=>{const o=e[i.getId()],r=e[s.getId()],n=o!=null,l=r!=null;if(n&&l)return o-r;if(n)return-1;if(l)return 1;const a=t.indexOf(i),d=t.indexOf(s),h=a>=0,c=d>=0;return h&&c?a-d:h?-1:1},ColumnMoveService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnMoveService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher}moveColumnByIndex(e,t,i){const s=this.columnModel.getCols();if(!s)return;const o=s[e];this.moveColumns([o],t,i)}moveColumns(e,t,i,s=!0){const o=this.columnModel.getCols();if(!o)return;if(this.columnAnimationService.start(),t>o.length-e.length){_warnOnce("tried to insert columns in invalid location, toIndex = ",t),_warnOnce("remember that you should not count the moving columns when calculating the new index");return}const r=this.columnModel.getColsForKeys(e);this.doesMovePassRules(r,t)&&(this.columnModel.moveInCols(r,t,i),this.eventDispatcher.columnMoved({movedColumns:r,source:i,toIndex:t,finished:s}),this.columnAnimationService.finish())}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!(!this.doesMovePassMarryChildren(e)||!this.doesMovePassLockedPositions(e))}getProposedColumnOrder(e,t){const s=this.columnModel.getCols().slice();return _moveInArray(s,e,t),s}doesMovePassLockedPositions(e){let t=0,i=!0;const s=o=>o?o===!0||o==="left"?0:2:1;return e.forEach(o=>{const r=s(o.getColDef().lockPosition);r<t&&(i=!1),t=r}),i}doesMovePassMarryChildren(e){let t=!0;const i=this.columnModel.getColTree();return depthFirstOriginalTreeSearch(null,i,s=>{if(!isProvidedColumnGroup(s))return;const o=s,r=o.getColGroupDef();if(!(r&&r.marryChildren))return;const l=[];o.getLeafColumns().forEach(u=>{const g=e.indexOf(u);l.push(g)});const a=Math.max.apply(Math,l),d=Math.min.apply(Math,l),h=a-d,c=o.getLeafColumns().length-1;h>c&&(t=!1)}),t}placeLockedColumns(e){const t=[],i=[],s=[];return e.forEach(r=>{const n=r.getColDef().lockPosition;n==="right"?s.push(r):n==="left"||n===!0?t.push(r):i.push(r)}),this.gos.get("enableRtl")?[...s,...i,...t]:[...t,...i,...s]}},reUnescapedHtml=/[&<>"']/g,HTML_ESCAPES={"&":"&","<":"<",">":">",'"':""","'":"'"};function _utf8_encode(e){const t=String.fromCharCode;function i(c){const u=[];if(!c)return[];const g=c.length;let p=0,m,f;for(;p<g;)m=c.charCodeAt(p++),m>=55296&&m<=56319&&p<g?(f=c.charCodeAt(p++),(f&64512)==56320?u.push(((m&1023)<<10)+(f&1023)+65536):(u.push(m),p--)):u.push(m);return u}function s(c){if(c>=55296&&c<=57343)throw Error("Lone surrogate U+"+c.toString(16).toUpperCase()+" is not a scalar value")}function o(c,u){return t(c>>u&63|128)}function r(c){if(!(c&4294967168))return t(c);let u="";return c&4294965248?c&4294901760?c&4292870144||(u=t(c>>18&7|240),u+=o(c,12),u+=o(c,6)):(s(c),u=t(c>>12&15|224),u+=o(c,6)):u=t(c>>6&31|192),u+=t(c&63|128),u}const n=i(e),l=n.length;let a=-1,d,h="";for(;++a<l;)d=n[a],h+=r(d);return h}function _capitalise(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}function _escapeString(e,t){if(e==null)return null;const i=e.toString().toString();return t?i:i.replace(reUnescapedHtml,s=>HTML_ESCAPES[s])}function _camelCaseToHumanText(e){if(!e||e==null)return null;const t=/([a-z])([A-Z])/g,i=/([A-Z]+)([A-Z])([a-z])/g;return e.replace(t,"$1 $2").replace(i,"$1 $2$3").replace(/\./g," ").split(" ").map(o=>o.substring(0,1).toUpperCase()+(o.length>1?o.substring(1,o.length):"")).join(" ")}function _camelCaseToHyphenated(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}var ColumnNameService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnNameService"}wireBeans(e){this.expressionService=e.expressionService,this.funcColsService=e.funcColsService,this.columnModel=e.columnModel}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,i){const s=t?t.getColGroupDef():null;return s?this.getHeaderName(s,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,s,o){const r=e.headerValueGetter;if(r){const n=this.gos.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:s,location:o});return typeof r=="function"?r(n):typeof r=="string"?this.expressionService.evaluate(r,n):(_warnOnce("headerValueGetter must be a function or a string"),"")}else{if(e.headerName!=null)return e.headerName;if(e.field)return _camelCaseToHumanText(e.field)}return""}wrapHeaderNameWithAggFunc(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn,s=_exists(i);let o=null,r;if(s){const n=this.funcColsService.getValueColumns(),l=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&n.length===1,a=e.getColDef().pivotTotalColumnIds!==void 0;if(l&&!a)return t;o=i?i.getAggFunc():null,r=!0}else{const n=e.isValueActive(),l=this.columnModel.isPivotMode()||!this.funcColsService.isRowGroupEmpty();n&&l?(o=e.getAggFunc(),r=!0):r=!1}if(r){const n=typeof o=="string"?o:"func";return`${this.localeService.getLocaleTextFunc()(n,n)}(${t})`}return t}},PivotResultColsService=class extends BeanStub{constructor(){super(...arguments),this.beanName="pivotResultColsService"}wireBeans(e){this.context=e.context,this.columnModel=e.columnModel,this.columnFactory=e.columnFactory,this.visibleColsService=e.visibleColsService}destroy(){destroyColumnTree(this.context,this.pivotResultCols?.tree),super.destroy()}isPivotResultColsPresent(){return this.pivotResultCols!=null}lookupPivotResultCol(e,t){if(this.pivotResultCols==null)return null;const i=this.columnModel.getColDefCol(t);let s=null;return this.pivotResultCols.list.forEach(o=>{const r=o.getColDef().pivotKeys,n=o.getColDef().pivotValueColumn;_areEqual(r,e)&&n===i&&(s=o)}),s}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){return this.pivotResultCols?this.columnModel.getColFromCollection(e,this.pivotResultCols):null}setPivotResultCols(e,t){if(this.columnModel.isReady()&&!(e==null&&this.pivotResultCols==null)){if(e){this.processPivotResultColDef(e);const i=this.columnFactory.createColumnTree(e,!1,this.pivotResultCols?.tree||this.previousPivotResultCols||void 0,t);destroyColumnTree(this.context,this.pivotResultCols?.tree,i.columnTree);const s=i.columnTree,o=i.treeDept,r=getColumnsFromTree(s),n={};this.pivotResultCols={tree:s,treeDepth:o,list:r,map:n},this.pivotResultCols.list.forEach(l=>this.pivotResultCols.map[l.getId()]=l),this.previousPivotResultCols=null}else this.previousPivotResultCols=this.pivotResultCols?this.pivotResultCols.tree:null,this.pivotResultCols=null;this.columnModel.refreshCols(),this.visibleColsService.refresh(t)}}processPivotResultColDef(e){const t=this.gos.get("processPivotResultColDef"),i=this.gos.get("processPivotResultColGroupDef");if(!t&&!i)return;const s=o=>{o.forEach(r=>{if(_exists(r.children)){const l=r;i&&i(l),s(l.children)}else t&&t(r)})};e&&s(e)}},ColumnSizeService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnSizeService"}wireBeans(e){this.columnModel=e.columnModel,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}setColumnWidths(e,t,i,s){const o=[];e.forEach(r=>{const n=this.columnModel.getColDefCol(r.key)||this.columnModel.getCol(r.key);if(!n)return;if(o.push({width:r.newWidth,ratios:[1],columns:[n]}),this.gos.get("colResizeDefault")==="shift"&&(t=!t),t){const a=this.visibleColsService.getColAfter(n);if(!a)return;const d=n.getActualWidth()-r.newWidth,h=a.getActualWidth()+d;o.push({width:h,ratios:[1],columns:[a]})}}),o.length!==0&&this.resizeColumnSets({resizeSets:o,finished:i,source:s})}resizeColumnSets(e){const{resizeSets:t,finished:i,source:s}=e;if(!(!t||t.every(h=>this.checkMinAndMaxWidthsForSet(h)))){if(i){const h=t&&t.length>0?t[0].columns:null;this.eventDispatcher.columnResized(h,i,s)}return}const r=[],n=[];t.forEach(h=>{const{width:c,columns:u,ratios:g}=h,p={},m={};u.forEach(C=>n.push(C));let f=!0,v=0;for(;f;){if(v++,v>1e3){_errorOnce("infinite loop in resizeColumnSets");break}f=!1;const C=[];let w=0,y=c;u.forEach((S,R)=>{if(m[S.getId()])y-=p[S.getId()];else{C.push(S);const b=g[R];w+=b}});const F=1/w;C.forEach((S,R)=>{const P=R===C.length-1;let b;P?b=y:(b=Math.round(g[R]*c*F),y-=b);const x=S.getMinWidth(),M=S.getMaxWidth();b<x?(b=x,m[S.getId()]=!0,f=!0):M>0&&b>M&&(b=M,m[S.getId()]=!0,f=!0),p[S.getId()]=b})}u.forEach(C=>{const w=p[C.getId()];C.getActualWidth()!==w&&(C.setActualWidth(w,s),r.push(C))})});const l=r.length>0;let a=[];l&&(a=this.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0}),this.visibleColsService.setLeftValues(s),this.visibleColsService.updateBodyWidths(),this.columnViewportService.checkViewportColumns());const d=n.concat(a);(l||i)&&this.eventDispatcher.columnResized(d,i,s,a)}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let s=0,o=0,r=!0;t.forEach(a=>{const d=a.getMinWidth();s+=d||0;const h=a.getMaxWidth();h>0?o+=h:r=!1});const n=i>=s,l=!r||i<=o;return n&&l}refreshFlexedColumns(e={}){const t=e.source?e.source:"flex";if(e.viewportWidth!=null&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];const i=this.visibleColsService.getCenterCols();let s=-1;if(e.resizingCols){const u=new Set(e.resizingCols);for(let g=i.length-1;g>=0;g--)if(u.has(i[g])){s=g;break}}let o=0,r=[],n=0,l=0;for(let u=0;u<i.length;u++)i[u].getFlex()&&u>s?(r.push(i[u]),l+=i[u].getFlex(),n+=i[u].getMinWidth()):o+=i[u].getActualWidth();if(!r.length)return[];let a=[];o+n>this.flexViewportWidth&&(r.forEach(u=>u.setActualWidth(u.getMinWidth(),t)),a=r,r=[]);const d=[];let h;e:for(;;){h=this.flexViewportWidth-o;const u=h/l;for(let g=0;g<r.length;g++){const p=r[g],m=u*p.getFlex();let f=0;const v=p.getMinWidth(),C=p.getMaxWidth();if(m<v?f=v:m>C&&(f=C),f){p.setActualWidth(f,t),_removeFromUnorderedArray(r,p),l-=p.getFlex(),a.push(p),o+=p.getActualWidth();continue e}d[g]=Math.round(m)}break}let c=h;return r.forEach((u,g)=>{u.setActualWidth(Math.min(d[g],c),t),a.push(u),c-=d[g]}),e.skipSetLeft||this.visibleColsService.setLeftValues(t),e.updateBodyWidths&&this.visibleColsService.updateBodyWidths(),e.fireResizedEvent&&this.eventDispatcher.columnResized(a,!0,t,r),r}sizeColumnsToFit(e,t="sizeColumnsToFit",i,s){if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,i,s));return}const o={};s&&s?.columnLimits?.forEach(({key:u,...g})=>{o[typeof u=="string"?u:u.getColId()]=g});const r=this.visibleColsService.getAllCols(),n=e===getWidthOfColsInList(r);if(e<=0||!r.length||n)return;const l=[],a=[];r.forEach(u=>{u.getColDef().suppressSizeToFit===!0?a.push(u):l.push(u)});const d=l.slice(0);let h=!1;const c=u=>{_removeFromArray(l,u),a.push(u)};for(l.forEach(u=>{u.resetActualWidth(t);const g=o?.[u.getId()],p=g?.minWidth??s?.defaultMinWidth,m=g?.maxWidth??s?.defaultMaxWidth,f=u.getActualWidth();typeof p=="number"&&f<p?u.setActualWidth(p,t,!0):typeof m=="number"&&f>m&&u.setActualWidth(m,t,!0)});!h;){h=!0;const u=e-getWidthOfColsInList(a);if(u<=0)l.forEach(g=>{const p=o?.[g.getId()]?.minWidth??s?.defaultMinWidth;if(typeof p=="number"){g.setActualWidth(p,t,!0);return}g.setMinimum(t)});else{const g=u/getWidthOfColsInList(l);let p=u;for(let m=l.length-1;m>=0;m--){const f=l[m],v=o?.[f.getId()],C=v?.minWidth??s?.defaultMinWidth,w=v?.maxWidth??s?.defaultMaxWidth,y=f.getMinWidth(),F=f.getMaxWidth(),S=typeof C=="number"&&C>y?C:y,R=typeof w=="number"&&w<F?w:F;let P=Math.round(f.getActualWidth()*g);P<S?(P=S,c(f),h=!1):P>R?(P=R,c(f),h=!1):m===0&&(P=p),f.setActualWidth(P,t,!0),p-=P}}}d.forEach(u=>{u.fireColumnWidthChangedEvent(t)}),this.visibleColsService.setLeftValues(t),this.visibleColsService.updateBodyWidths(),!i&&this.eventDispatcher.columnResized(d,!0,t)}applyAutosizeStrategy(){const e=this.gos.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout(()=>{if(t==="fitGridWidth"){const{columnLimits:i,defaultMinWidth:s,defaultMaxWidth:o}=e,r=i?.map(({colId:n,minWidth:l,maxWidth:a})=>({key:n,minWidth:l,maxWidth:a}));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:s,defaultMaxWidth:o,columnLimits:r})}else t==="fitProvidedWidth"&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")})}};function createUniqueColumnGroupId(e,t){return e+"_"+t}function isColumnGroup(e){return e instanceof AgColumnGroup}var AgColumnGroup=class extends BeanStub{constructor(e,t,i,s){super(),this.isColumn=!1,this.displayedChildren=[],this.parent=null,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=s}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return createUniqueColumnGroupId(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!e||e.length===0?!1:e.every(t=>t.isMoving())}checkLeft(){if(this.displayedChildren.forEach(e=>{isColumnGroup(e)&&e.checkLeft()}),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const t=_last(this.displayedChildren).getLeft();this.setLeft(t)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach(t=>{e+=t.getActualWidth()}),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach(t=>{t.isResizable()&&(e=!0)}),e}getMinWidth(){let e=0;return this.displayedChildren.forEach(t=>{e+=t.getMinWidth()}),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}addDisplayedLeafColumns(e){this.displayedChildren.forEach(t=>{isColumn(t)?e.push(t):isColumnGroup(t)&&t.addDisplayedLeafColumns(e)})}addLeafColumns(e){this.children.forEach(t=>{isColumn(t)?e.push(t):isColumnGroup(t)&&t.addLeafColumns(e)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return!this.isPadding()||!e||!e.isPadding()?0:1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e!=null&&e.isPadding();)e=e.getParent();if(!(e?e.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}this.children.forEach(i=>{if(isColumnGroup(i)&&(!i.displayedChildren||!i.displayedChildren.length))return;switch(i.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(i);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(i);break;default:this.displayedChildren.push(i);break}}),this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},GroupInstanceIdCreator=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return typeof t!="number"?i=0:i=t+1,this.existingIds[e]=i,i}},VisibleColsService=class extends BeanStub{constructor(){super(...arguments),this.beanName="visibleColsService",this.colsAndGroupsMap={},this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher}refresh(e,t=!1){t||this.buildTrees(),this.updateOpenClosedVisibilityInColumnGroups(),this.columnsLeft=pickDisplayedCols(this.treeLeft),this.columnsCenter=pickDisplayedCols(this.treeCenter),this.columnsRight=pickDisplayedCols(this.treeRight),this.joinColsAriaOrder(),this.joinCols(),this.setLeftValues(e),this.autoHeightCols=this.columns.filter(i=>i.isAutoHeight()),this.columnSizeService.refreshFlexedColumns(),this.updateBodyWidths(),this.columnViewportService.checkViewportColumns(!1),this.setFirstRightAndLastLeftPinned(e),this.eventDispatcher.visibleCols()}updateBodyWidths(){const e=getWidthOfColsInList(this.columnsCenter),t=getWidthOfColsInList(this.columnsLeft),i=getWidthOfColsInList(this.columnsRight);if(this.bodyWidthDirty=this.bodyWidth!==e,this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i){this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i;const o={type:"columnContainerWidthChanged"};this.eventService.dispatchEvent(o);const r={type:"displayedColumnsWidthChanged"};this.eventService.dispatchEvent(r)}}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e){let t,i;this.gos.get("enableRtl")?(t=this.columnsLeft?this.columnsLeft[0]:null,i=this.columnsRight?_last(this.columnsRight):null):(t=this.columnsLeft?_last(this.columnsLeft):null,i=this.columnsRight?this.columnsRight[0]:null),this.columnModel.getCols().forEach(s=>{s.setLastLeftPinned(s===t,e),s.setFirstRightPinned(s===i,e)})}buildTrees(){const e=this.columnModel.getColsToShow(),t=e.filter(r=>r.getPinned()=="left"),i=e.filter(r=>r.getPinned()=="right"),s=e.filter(r=>r.getPinned()!="left"&&r.getPinned()!="right"),o=new GroupInstanceIdCreator;this.treeLeft=this.createGroups({columns:t,idCreator:o,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=this.createGroups({columns:i,idCreator:o,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=this.createGroups({columns:s,idCreator:o,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.ariaOrderColumns=[]}joinColsAriaOrder(){const e=this.columnModel.getCols(),t=[],i=[],s=[];for(const o of e){const r=o.getPinned();r?r===!0||r==="left"?t.push(o):s.push(o):i.push(o)}this.ariaOrderColumns=t.concat(i).concat(s)}getAriaColIndex(e){let t;return isColumnGroup(e)?t=e.getLeafColumns()[0]:t=e,this.ariaOrderColumns.indexOf(t)+1}getAllAutoHeightCols(){return this.autoHeightCols}setLeftValuesOfGroups(){[this.treeLeft,this.treeRight,this.treeCenter].forEach(e=>{e.forEach(t=>{isColumnGroup(t)&&t.checkLeft()})})}setLeftValuesOfCols(e){if(!this.columnModel.getColDefCols())return;const i=this.columnModel.getCols().slice(0),s=this.gos.get("enableRtl");[this.columnsLeft,this.columnsRight,this.columnsCenter].forEach(o=>{if(s){let r=getWidthOfColsInList(o);o.forEach(n=>{r-=n.getActualWidth(),n.setLeft(r,e)})}else{let r=0;o.forEach(n=>{n.setLeft(r,e),r+=n.getActualWidth()})}_removeAllFromUnorderedArray(i,o)}),i.forEach(o=>{o.setLeft(null,e)})}joinCols(){this.gos.get("enableRtl")?this.columns=this.columnsRight.concat(this.columnsCenter).concat(this.columnsLeft):this.columns=this.columnsLeft.concat(this.columnsCenter).concat(this.columnsRight)}getColsCenter(){return this.columnsCenter}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}getTreeLeft(){return this.treeLeft}getTreeRight(){return this.treeRight}getTreeCenter(){return this.treeCenter}getAllCols(){return this.columns}isColDisplayed(e){return this.getAllCols().indexOf(e)>=0}getLeftColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsLeft):this.columnsLeft}getRightColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsRight):this.columnsRight}getColsForRow(e,t,i,s){const o=[];let r=null;for(let n=0;n<t.length;n++){const l=t[n],a=t.length-n,d=Math.min(l.getColSpan(e),a),h=[l];if(d>1){const u=d-1;for(let g=1;g<=u;g++)h.push(t[n+g]);n+=u}let c;i?(c=!1,h.forEach(u=>{i(u)&&(c=!0)})):c=!0,c&&(o.length===0&&r&&(s&&s(l))&&o.push(r),o.push(l)),r=l}return o}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getCenterCols(){return this.columnsCenter}getLeftCols(){return this.columnsLeft}getRightCols(){return this.columnsRight}getColBefore(e){const t=this.getAllCols(),i=t.indexOf(e);return i>0?t[i-1]:null}getGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),s=e.getDisplayedLeafColumns(),o=t==="After"?_last(s):s[0],r=`getCol${t}`;for(;;){const n=this[r](o);if(!n)return null;const l=this.getColGroupAtLevel(n,i);if(l!==e)return l}}getColGroupAtLevel(e,t){let i=e.getParent(),s,o;for(;s=i.getProvidedColumnGroup().getLevel(),o=i.getPaddingLevel(),!(s+o<=t);)i=i.getParent();return i}isPinningLeft(){return this.columnsLeft.length>0}isPinningRight(){return this.columnsRight.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=t=>{this.colsAndGroupsMap[t.getUniqueId()]=t};depthFirstAllColumnTreeSearch(this.treeCenter,!1,e),depthFirstAllColumnTreeSearch(this.treeLeft,!1,e),depthFirstAllColumnTreeSearch(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){const e=this.getAllTrees();depthFirstAllColumnTreeSearch(e,!1,t=>{isColumnGroup(t)&&t.calculateDisplayedColumns()})}getFirstColumn(){const e=this.gos.get("enableRtl"),t=["getLeftCols","getCenterCols","getRightCols"];e&&t.reverse();for(let i=0;i<t.length;i++){const s=this[t[i]]();if(s.length)return e?_last(s):s[0]}return null}getColumnGroup(e,t){if(!e)return null;if(isColumnGroup(e))return e;const i=this.getAllTrees(),s=typeof t=="number";let o=null;return depthFirstAllColumnTreeSearch(i,!1,r=>{if(isColumnGroup(r)){const n=r;let l;s?l=e===n.getGroupId()&&t===n.getPartId():l=e===n.getGroupId(),l&&(o=n)}}),o}getColAfter(e){const t=this.getAllCols(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}isBodyWidthDirty(){return this.bodyWidthDirty}setBodyWidthDirty(){this.bodyWidthDirty=!0}getColsLeftWidth(){return getWidthOfColsInList(this.columnsLeft)}getDisplayedColumnsRightWidth(){return getWidthOfColsInList(this.columnsRight)}isColAtEdge(e,t){const i=this.getAllCols();if(!i.length)return!1;const s=t==="first";let o;if(isColumnGroup(e)){const r=e.getDisplayedLeafColumns();if(!r.length)return!1;o=s?r[0]:_last(r)}else o=e;return(s?i[0]:_last(i))===o}createGroups(e){const{columns:t,idCreator:i,pinned:s,oldDisplayedGroups:o,isStandaloneStructure:r}=e,n=this.mapOldGroupsById(o),l=[];let a=t;for(;a.length;){const d=a;a=[];let h=0;const c=u=>{const g=h;h=u;const p=d[g],f=(isColumnGroup(p)?p.getProvidedColumnGroup():p).getOriginalParent();if(f==null){for(let C=g;C<u;C++)l.push(d[C]);return}const v=this.createColGroup(f,i,n,s,r);for(let C=g;C<u;C++)v.addChild(d[C]);a.push(v)};for(let u=1;u<d.length;u++){const g=d[u],m=(isColumnGroup(g)?g.getProvidedColumnGroup():g).getOriginalParent(),f=d[h],C=(isColumnGroup(f)?f.getProvidedColumnGroup():f).getOriginalParent();m!==C&&c(u)}h<d.length&&c(d.length)}return r||this.setupParentsIntoCols(l,null),l}createColGroup(e,t,i,s,o){const r=e.getGroupId(),n=t.getInstanceIdForKey(r),l=createUniqueColumnGroupId(r,n);let a=i[l];return a&&a.getProvidedColumnGroup()!==e&&(a=null),_exists(a)?a.reset():(a=new AgColumnGroup(e,r,n,s),o||this.createBean(a)),a}mapOldGroupsById(e){const t={},i=s=>{s.forEach(o=>{if(isColumnGroup(o)){const r=o;t[o.getUniqueId()]=r,i(r.getChildren())}})};return e&&i(e),t}setupParentsIntoCols(e,t){e.forEach(i=>{if(i.setParent(t),isColumnGroup(i)){const s=i;this.setupParentsIntoCols(s.getChildren(),s)}})}};function depthFirstAllColumnTreeSearch(e,t,i){if(e)for(let s=0;s<e.length;s++){const o=e[s];if(isColumnGroup(o)){const r=t?o.getDisplayedChildren():o.getChildren();depthFirstAllColumnTreeSearch(r,t,i)}i(o)}}function pickDisplayedCols(e){const t=[];return depthFirstAllColumnTreeSearch(e,!0,i=>{isColumn(i)&&t.push(i)}),t}var PUBLIC_EVENTS=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","rangeSelectionChanged","chartCreated","chartRangeSelectionChanged","chartOptionsChanged","chartDestroyed","toolPanelVisibleChanged","toolPanelSizeChanged","modelUpdated","cutStart","cutEnd","pasteStart","pasteEnd","fillStart","fillEnd","rangeDeleteStart","rangeDeleteEnd","undoStarted","undoEnded","redoStarted","redoEnded","cellClicked","cellDoubleClicked","cellMouseDown","cellContextMenu","cellValueChanged","cellEditRequest","rowValueChanged","headerFocused","cellFocused","rowSelected","selectionChanged","tooltipShow","tooltipHide","cellKeyDown","cellMouseOver","cellMouseOut","filterChanged","filterModified","filterOpened","advancedFilterBuilderVisibleChanged","sortChanged","virtualRowRemoved","rowClicked","rowDoubleClicked","gridReady","gridPreDestroyed","gridSizeChanged","viewportChanged","firstDataRendered","dragStarted","dragStopped","rowEditingStarted","rowEditingStopped","cellEditingStarted","cellEditingStopped","bodyScroll","bodyScrollEnd","paginationChanged","componentStateChanged","storeRefreshed","stateUpdated","columnMenuVisibleChanged","contextMenuVisibleChanged","rowDragEnter","rowDragMove","rowDragLeave","rowDragEnd"],INTERNAL_EVENTS=["scrollbarWidthChanged","keyShortcutChangedCellStart","keyShortcutChangedCellEnd","pinnedHeightChanged","cellFocusCleared","fullWidthRowFocused","checkboxChanged","heightScaleChanged","suppressMovableColumns","suppressMenuHide","suppressFieldDotNotation","columnPanelItemDragStart","columnPanelItemDragEnd","bodyHeightChanged","columnContainerWidthChanged","displayedColumnsWidthChanged","scrollVisibilityChanged","columnHoverChanged","flashCells","paginationPixelOffsetChanged","displayedRowsChanged","leftPinnedWidthChanged","rightPinnedWidthChanged","rowContainerHeightChanged","headerHeightChanged","columnHeaderHeightChanged","gridStylesChanged","storeUpdated","filterDestroyed","rowDataUpdateStarted","rowCountReady","advancedFilterEnabledChanged","dataTypesInferred","fieldValueChanged","fieldPickerValueSelected","richSelectListRowSelected","sideBarUpdated","alignedGridScroll","alignedGridColumn","gridOptionsChanged","chartTitleEdit","recalculateRowBounds","stickyTopOffsetChanged"],ALL_EVENTS=[...PUBLIC_EVENTS,...INTERNAL_EVENTS],INITIAL_GRID_OPTION_KEYS={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,advancedFilterModel:!0,customChartThemes:!0,chartThemeOverrides:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressTouch:!0,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,removePivotHeaderRowWhenSingleValueColumn:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,columnMenu:!0},_PropertyKeys=class{};_PropertyKeys.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","grandTotalRow"],_PropertyKeys.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","advancedFilterBuilderParams","initialState","autoSizeStrategy"],_PropertyKeys.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"],_PropertyKeys.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns"],_PropertyKeys.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","maintainColumnOrder","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading"],_PropertyKeys.OTHER_PROPERTIES=["suppressStickyTotalRow"],_PropertyKeys.FUNCTION_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","focusGridInnerElement","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering","chartMenuItems","groupTotalRow"],_PropertyKeys.ALL_PROPERTIES=[..._PropertyKeys.ARRAY_PROPERTIES,..._PropertyKeys.OBJECT_PROPERTIES,..._PropertyKeys.STRING_PROPERTIES,..._PropertyKeys.NUMBER_PROPERTIES,..._PropertyKeys.FUNCTION_PROPERTIES,..._PropertyKeys.BOOLEAN_PROPERTIES,..._PropertyKeys.OTHER_PROPERTIES];var PropertyKeys=_PropertyKeys,_ComponentUtil=class{static getCallbackForEvent(t){return!t||t.length<2?t:"on"+t[0].toUpperCase()+t.substring(1)}};_ComponentUtil.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY",_ComponentUtil.PUBLIC_EVENTS=PUBLIC_EVENTS,_ComponentUtil.EVENT_CALLBACKS=ALL_EVENTS.map(e=>_ComponentUtil.getCallbackForEvent(e)),_ComponentUtil.BOOLEAN_PROPERTIES=PropertyKeys.BOOLEAN_PROPERTIES,_ComponentUtil.ALL_PROPERTIES=PropertyKeys.ALL_PROPERTIES,_ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS=[..._ComponentUtil.ALL_PROPERTIES,..._ComponentUtil.EVENT_CALLBACKS],_ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(_ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS);var ComponentUtil=_ComponentUtil;function _combineAttributesAndGridOptions(e,t){typeof e!="object"&&(e={});const i={...e};return ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS.forEach(o=>{const r=t[o];typeof r<"u"&&r!==ComponentUtil.VUE_OMITTED_PROPERTY&&(i[o]=r)}),i}function _processOnChange(e,t){if(!e)return;const i={};let s=!1;if(Object.keys(e).filter(n=>ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS_SET.has(n)).forEach(n=>{i[n]=e[n],s=!0}),!s)return;const o={type:"gridOptionsChanged",options:i};t.dispatchEvent(o);const r={type:"componentStateChanged"};_iterateObject(i,(n,l)=>{r[n]=l}),t.dispatchEvent(r)}var CssClassManager=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1){t.forEach(s=>this.addCssClass(s));return}if(this.cssClassStates[e]!==!0&&e.length){const s=this.getGui();s&&s.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1){t.forEach(s=>this.removeCssClass(s));return}if(this.cssClassStates[e]!==!1&&e.length){const s=this.getGui();s&&s.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return t?t.classList.contains(e):!1}addOrRemoveCssClass(e,t){if(!e)return;if(e.indexOf(" ")>=0){const s=(e||"").split(" ");if(s.length>1){s.forEach(o=>this.addOrRemoveCssClass(o,t));return}}if(this.cssClassStates[e]!==t&&e.length){const s=this.getGui();s&&s.classList.toggle(e,t),this.cssClassStates[e]=t}}};function _toggleAriaAttribute(e,t,i){i==null||typeof i=="string"&&i==""?_removeAriaAttribute(e,t):_setAriaAttribute(e,t,i)}function _setAriaAttribute(e,t,i){e.setAttribute(_ariaAttributeName(t),i.toString())}function _removeAriaAttribute(e,t){e.removeAttribute(_ariaAttributeName(t))}function _ariaAttributeName(e){return`aria-${e}`}function _setAriaRole(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function _getAriaSortState(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function _getAriaPosInSet(e){return parseInt(e.getAttribute("aria-posinset"),10)}function _getAriaLabel(e){return e.getAttribute("aria-label")}function _setAriaLabel(e,t){_toggleAriaAttribute(e,"label",t)}function _setAriaLabelledBy(e,t){_toggleAriaAttribute(e,"labelledby",t)}function _setAriaDescribedBy(e,t){_toggleAriaAttribute(e,"describedby",t)}function _setAriaLive(e,t){_toggleAriaAttribute(e,"live",t)}function _setAriaAtomic(e,t){_toggleAriaAttribute(e,"atomic",t)}function _setAriaRelevant(e,t){_toggleAriaAttribute(e,"relevant",t)}function _setAriaLevel(e,t){_toggleAriaAttribute(e,"level",t)}function _setAriaDisabled(e,t){_toggleAriaAttribute(e,"disabled",t)}function _setAriaHidden(e,t){_toggleAriaAttribute(e,"hidden",t)}function _setAriaActiveDescendant(e,t){_toggleAriaAttribute(e,"activedescendant",t)}function _setAriaExpanded(e,t){_setAriaAttribute(e,"expanded",t)}function _removeAriaExpanded(e){_removeAriaAttribute(e,"expanded")}function _setAriaSetSize(e,t){_setAriaAttribute(e,"setsize",t)}function _setAriaPosInSet(e,t){_setAriaAttribute(e,"posinset",t)}function _setAriaMultiSelectable(e,t){_setAriaAttribute(e,"multiselectable",t)}function _setAriaRowCount(e,t){_setAriaAttribute(e,"rowcount",t)}function _setAriaRowIndex(e,t){_setAriaAttribute(e,"rowindex",t)}function _setAriaColCount(e,t){_setAriaAttribute(e,"colcount",t)}function _setAriaColIndex(e,t){_setAriaAttribute(e,"colindex",t)}function _setAriaColSpan(e,t){_setAriaAttribute(e,"colspan",t)}function _setAriaSort(e,t){_setAriaAttribute(e,"sort",t)}function _removeAriaSort(e){_removeAriaAttribute(e,"sort")}function _setAriaSelected(e,t){_toggleAriaAttribute(e,"selected",t)}function _setAriaChecked(e,t){_setAriaAttribute(e,"checked",t===void 0?"mixed":t)}function _setAriaControls(e,t){_toggleAriaAttribute(e,"controls",t.id),_setAriaLabelledBy(t,e.id)}function _getAriaCheckboxStateName(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var isSafari,safariVersion,isChrome,isFirefox,isMacOs,isIOS,invisibleScrollbar,browserScrollbarWidth;function _isBrowserSafari(){return isSafari===void 0&&(isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),isSafari}function _getSafariVersion(){if(safariVersion===void 0)if(_isBrowserSafari()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(safariVersion=e[1]!=null?parseFloat(e[1]):0)}else safariVersion=0;return safariVersion}function _isBrowserChrome(){if(isChrome===void 0){const e=window;isChrome=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return isChrome}function _isBrowserFirefox(){return isFirefox===void 0&&(isFirefox=/(firefox)/i.test(navigator.userAgent)),isFirefox}function _isMacOsUserAgent(){return isMacOs===void 0&&(isMacOs=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),isMacOs}function _isIOSUserAgent(){return isIOS===void 0&&(isIOS=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),isIOS}function _browserSupportsPreventScroll(){return!_isBrowserSafari()||_getSafariVersion()>=15}function _getTabIndex(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return t===-1&&(i===null||i===""&&!_isBrowserFirefox())?null:t.toString()}function _getMaxDivHeight(){if(!document.body)return-1;let e=1e6;const t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const s=e*2;if(i.style.height=s+"px",s>t||i.clientHeight!==s)break;e=s}return document.body.removeChild(i),e}function _getBodyWidth(){return document.body?.clientWidth??(window.innerHeight||document.documentElement?.clientWidth||-1)}function _getBodyHeight(){return document.body?.clientHeight??(window.innerHeight||document.documentElement?.clientHeight||-1)}function _getScrollbarWidth(){return browserScrollbarWidth==null&&initScrollbarWidthAndVisibility(),browserScrollbarWidth}function initScrollbarWidthAndVisibility(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;i===0&&t.clientWidth===0&&(i=null),t.parentNode&&t.parentNode.removeChild(t),i!=null&&(browserScrollbarWidth=i,invisibleScrollbar=i===0)}function _isInvisibleScrollbar(){return invisibleScrollbar==null&&initScrollbarWidthAndVisibility(),invisibleScrollbar}var rtlNegativeScroll;function _radioCssClass(e,t,i){const s=e.parentElement;let o=s&&s.firstChild;for(;o;)t&&o.classList.toggle(t,o===e),i&&o.classList.toggle(i,o!==e),o=o.nextSibling}var FOCUSABLE_SELECTOR="[tabindex], input, select, button, textarea, [href]",FOCUSABLE_EXCLUDE="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function _isFocusableFormField(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,s=t.call(e,"input, select, button, textarea"),o=t.call(e,FOCUSABLE_EXCLUDE),r=_isVisible(e);return s&&!o&&r}function _setDisplayed(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-hidden",!t),s||_setAriaHidden(e,!t)}function _setVisible(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-invisible",!t),s||_setAriaHidden(e,!t)}function _setDisabled(e,t){const i="disabled",s=t?o=>o.setAttribute(i,""):o=>o.removeAttribute(i);s(e),_nodeListForEach(e.querySelectorAll("input"),o=>s(o))}function _isElementChildOfClass(e,t,i){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof i=="number"){if(++s>i)break}else if(e===i)break}return!1}function _getElementSize(e){const{height:t,width:i,borderTopWidth:s,borderRightWidth:o,borderBottomWidth:r,borderLeftWidth:n,paddingTop:l,paddingRight:a,paddingBottom:d,paddingLeft:h,marginTop:c,marginRight:u,marginBottom:g,marginLeft:p,boxSizing:m}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(s||"0"),borderRightWidth:parseFloat(o||"0"),borderBottomWidth:parseFloat(r||"0"),borderLeftWidth:parseFloat(n||"0"),paddingTop:parseFloat(l||"0"),paddingRight:parseFloat(a||"0"),paddingBottom:parseFloat(d||"0"),paddingLeft:parseFloat(h||"0"),marginTop:parseFloat(c||"0"),marginRight:parseFloat(u||"0"),marginBottom:parseFloat(g||"0"),marginLeft:parseFloat(p||"0"),boxSizing:m}}function _getInnerHeight(e){const t=_getElementSize(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom:t.height}function _getInnerWidth(e){const t=_getElementSize(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight:t.width}function _getAbsoluteHeight(e){const{height:t,marginBottom:i,marginTop:s}=_getElementSize(e);return Math.floor(t+i+s)}function _getAbsoluteWidth(e){const{width:t,marginLeft:i,marginRight:s}=_getElementSize(e);return Math.floor(t+i+s)}function _getElementRectWithOffset(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:s,borderRightWidth:o,borderBottomWidth:r}=_getElementSize(e);return{top:t.top+(i||0),left:t.left+(s||0),right:t.right+(o||0),bottom:t.bottom+(r||0)}}function _isRtlNegativeScroll(){if(typeof rtlNegativeScroll=="boolean")return rtlNegativeScroll;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML=`<div style="width: 2px">
|
|
1
|
+
var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var i in t)__defProp(e,i,{get:t[i],enumerable:!0})},__copyProps=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of __getOwnPropNames(t))!__hasOwnProp.call(e,o)&&o!==i&&__defProp(e,o,{get:()=>t[o],enumerable:!(s=__getOwnPropDesc(t,o))||s.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),main_exports={};__export(main_exports,{ALWAYS_SYNC_GLOBAL_EVENTS:()=>ALWAYS_SYNC_GLOBAL_EVENTS,AbstractHeaderCellCtrl:()=>AbstractHeaderCellCtrl,AgAbstractField:()=>AgAbstractField,AgAbstractInputField:()=>AgAbstractInputField,AgAbstractLabel:()=>AgAbstractLabel,AgCheckbox:()=>AgCheckbox,AgCheckboxSelector:()=>AgCheckboxSelector,AgColumn:()=>AgColumn,AgColumnGroup:()=>AgColumnGroup,AgInputDateField:()=>AgInputDateField,AgInputNumberField:()=>AgInputNumberField,AgInputNumberFieldSelector:()=>AgInputNumberFieldSelector,AgInputTextArea:()=>AgInputTextArea,AgInputTextField:()=>AgInputTextField,AgInputTextFieldSelector:()=>AgInputTextFieldSelector,AgPickerField:()=>AgPickerField,AgPromise:()=>AgPromise,AgProvidedColumnGroup:()=>AgProvidedColumnGroup,AgRadioButton:()=>AgRadioButton,AgSelect:()=>AgSelect,AgSelectSelector:()=>AgSelectSelector,AgToggleButton:()=>AgToggleButton,AgToggleButtonSelector:()=>AgToggleButtonSelector,AnimateShowChangeCellRenderer:()=>AnimateShowChangeCellRenderer,AnimateSlideCellRenderer:()=>AnimateSlideCellRenderer,AnimationFrameService:()=>AnimationFrameService,AriaAnnouncementService:()=>AriaAnnouncementService,AutoScrollService:()=>AutoScrollService,AutoWidthCalculator:()=>AutoWidthCalculator,BarColumnLabelPlacement:()=>BarColumnLabelPlacement,BaseComponentWrapper:()=>BaseComponentWrapper,BaseCreator:()=>BaseCreator,BaseGridSerializingSession:()=>BaseGridSerializingSession,BeanStub:()=>BeanStub,BodyDropPivotTarget:()=>BodyDropPivotTarget,BodyDropTarget:()=>BodyDropTarget,CellComp:()=>CellComp,CellCtrl:()=>CellCtrl,CellNavigationService:()=>CellNavigationService,CellPositionUtils:()=>CellPositionUtils,CellRangeType:()=>CellRangeType,ChangedPath:()=>ChangedPath,ChartMappings:()=>ChartMappings,CheckboxCellEditor:()=>CheckboxCellEditor,CheckboxCellRenderer:()=>CheckboxCellRenderer,CheckboxSelectionComponent:()=>CheckboxSelectionComponent,ClientSideRowModelModule:()=>ClientSideRowModelModule,ClientSideRowModelSteps:()=>ClientSideRowModelSteps,ColumnApplyStateService:()=>ColumnApplyStateService,ColumnAutosizeService:()=>ColumnAutosizeService,ColumnFactory:()=>ColumnFactory,ColumnKeyCreator:()=>ColumnKeyCreator,ColumnModel:()=>ColumnModel,ColumnMoveService:()=>ColumnMoveService,ColumnNameService:()=>ColumnNameService,ColumnSizeService:()=>ColumnSizeService,CommunityFeaturesModule:()=>CommunityFeaturesModule,Component:()=>Component,ComponentUtil:()=>ComponentUtil,Context:()=>Context,CssClassManager:()=>CssClassManager,CsvCreator:()=>CsvCreator,CsvExportModule:()=>CsvExportModule,CtrlsService:()=>CtrlsService,DataTypeService:()=>DataTypeService,DateCellEditor:()=>DateCellEditor,DateFilter:()=>DateFilter,DateStringCellEditor:()=>DateStringCellEditor,Downloader:()=>Downloader,DragAndDropService:()=>DragAndDropService,DragService:()=>DragService,DragSourceType:()=>DragSourceType,Environment:()=>Environment,EventService:()=>EventService,ExcelFactoryMode:()=>ExcelFactoryMode,ExpansionService:()=>ExpansionService,ExpressionService:()=>ExpressionService,FakeHScrollComp:()=>FakeHScrollComp,FakeVScrollComp:()=>FakeVScrollComp,FilterManager:()=>FilterManager,FilterWrapperComp:()=>FilterWrapperComp,FocusService:()=>FocusService,FuncColsService:()=>FuncColsService,GROUP_AUTO_COLUMN_ID:()=>GROUP_AUTO_COLUMN_ID,Grid:()=>Grid,GridBodyComp:()=>GridBodyComp,GridBodyCtrl:()=>GridBodyCtrl,GridComp:()=>GridComp,GridCoreCreator:()=>GridCoreCreator,GridCoreModule:()=>GridCoreModule,GridCtrl:()=>GridCtrl,GridHeaderComp:()=>GridHeaderComp,GridHeaderCtrl:()=>GridHeaderCtrl,GridOptionsService:()=>GridOptionsService,GridSerializer:()=>GridSerializer,GroupInstanceIdCreator:()=>GroupInstanceIdCreator,HeaderCellCtrl:()=>HeaderCellCtrl,HeaderFilterCellComp:()=>HeaderFilterCellComp,HeaderFilterCellCtrl:()=>HeaderFilterCellCtrl,HeaderGroupCellCtrl:()=>HeaderGroupCellCtrl,HeaderNavigationDirection:()=>HeaderNavigationDirection,HeaderNavigationService:()=>HeaderNavigationService,HeaderPositionUtils:()=>HeaderPositionUtils,HeaderRowComp:()=>HeaderRowComp,HeaderRowContainerComp:()=>HeaderRowContainerComp,HeaderRowContainerCtrl:()=>HeaderRowContainerCtrl,HeaderRowCtrl:()=>HeaderRowCtrl,HeaderRowType:()=>HeaderRowType,HorizontalDirection:()=>HorizontalDirection,HorizontalResizeService:()=>HorizontalResizeService,InfiniteRowModelModule:()=>InfiniteRowModelModule,KeyCode:()=>KeyCode,LargeTextCellEditor:()=>LargeTextCellEditor,LayoutCssClasses:()=>LayoutCssClasses,LocalEventService:()=>LocalEventService,LocaleService:()=>LocaleService,ManagedFocusFeature:()=>ManagedFocusFeature,MenuService:()=>MenuService,ModuleNames:()=>ModuleNames,ModuleRegistry:()=>ModuleRegistry,MouseEventService:()=>MouseEventService,MoveColumnFeature:()=>MoveColumnFeature,NavigationService:()=>NavigationService,NumberCellEditor:()=>NumberCellEditor,NumberFilter:()=>NumberFilter,NumberSequence:()=>NumberSequence,OverlayWrapperComponent:()=>OverlayWrapperComponent,PinnedRowModel:()=>PinnedRowModel,PivotResultColsService:()=>PivotResultColsService,PopupComponent:()=>PopupComponent,PopupEditorWrapper:()=>PopupEditorWrapper,PopupService:()=>PopupService,PositionableFeature:()=>PositionableFeature,PropertyKeys:()=>PropertyKeys,ProvidedFilter:()=>ProvidedFilter,RefPlaceholder:()=>RefPlaceholder,ResizeObserverService:()=>ResizeObserverService,RowContainerComp:()=>RowContainerComp,RowContainerCtrl:()=>RowContainerCtrl,RowCtrl:()=>RowCtrl,RowDragComp:()=>RowDragComp,RowHighlightPosition:()=>RowHighlightPosition,RowModelHelperService:()=>RowModelHelperService,RowNode:()=>RowNode,RowNodeBlock:()=>RowNodeBlock,RowNodeBlockLoader:()=>RowNodeBlockLoader,RowNodeSorter:()=>RowNodeSorter,RowPositionUtils:()=>RowPositionUtils,RowRenderer:()=>RowRenderer,RowType:()=>RowType,ScalarFilter:()=>ScalarFilter,ScrollVisibleService:()=>ScrollVisibleService,SelectCellEditor:()=>SelectCellEditor,SelectableService:()=>SelectableService,SelectionHandleType:()=>SelectionHandleType,ServerSideTransactionResultStatus:()=>ServerSideTransactionResultStatus,SetLeftFeature:()=>SetLeftFeature,SimpleFilter:()=>SimpleFilter,SortController:()=>SortController,SortIndicatorComp:()=>SortIndicatorComp,SortIndicatorSelector:()=>SortIndicatorSelector,StandardMenuFactory:()=>StandardMenuFactory,StylingService:()=>StylingService,TabGuardClassNames:()=>TabGuardClassNames,TabGuardComp:()=>TabGuardComp,TabGuardCtrl:()=>TabGuardCtrl,TabGuardFeature:()=>TabGuardFeature,TextCellEditor:()=>TextCellEditor,TextFilter:()=>TextFilter,TextFloatingFilter:()=>TextFloatingFilter,TooltipFeature:()=>TooltipFeature,TooltipStateManager:()=>TooltipStateManager,TouchListener:()=>TouchListener,UserComponentFactory:()=>UserComponentFactory,UserComponentRegistry:()=>UserComponentRegistry,ValueCache:()=>ValueCache,ValueService:()=>ValueService,VanillaFrameworkOverrides:()=>VanillaFrameworkOverrides,VerticalDirection:()=>VerticalDirection,VisibleColsService:()=>VisibleColsService,XmlFactory:()=>XmlFactory,ZipContainer:()=>ZipContainer,_ColumnFilterModule:()=>ColumnFilterModule,_CommunityMenuApiModule:()=>CommunityMenuApiModule,_CsrmSsrmSharedApiModule:()=>CsrmSsrmSharedApiModule,_CsvExportCoreModule:()=>CsvExportCoreModule,_EditCoreModule:()=>EditCoreModule,_FilterCoreModule:()=>FilterCoreModule,_FloatingFilterModule:()=>FloatingFilterModule,_ReadOnlyFloatingFilterModule:()=>ReadOnlyFloatingFilterModule,_RowNodeBlockModule:()=>RowNodeBlockModule,_SsrmInfiniteSharedApiModule:()=>SsrmInfiniteSharedApiModule,_addFocusableContainerListener:()=>_addFocusableContainerListener,_areEqual:()=>_areEqual,_bindCellRendererToHtmlElement:()=>_bindCellRendererToHtmlElement,_capitalise:()=>_capitalise,_clearElement:()=>_clearElement,_cloneObject:()=>_cloneObject,_combineAttributesAndGridOptions:()=>_combineAttributesAndGridOptions,_compose:()=>_compose,_createIcon:()=>_createIcon,_createIconNoSpan:()=>_createIconNoSpan,_debounce:()=>_debounce,_defaultComparator:()=>_defaultComparator,_doOnce:()=>_doOnce,_errorOnce:()=>_errorOnce,_escapeString:()=>_escapeString,_exists:()=>_exists,_existsAndNotEmpty:()=>_existsAndNotEmpty,_flatten:()=>_flatten,_forEachReverse:()=>_forEachReverse,_formatNumberCommas:()=>_formatNumberCommas,_formatNumberTwoDecimalPlacesAndCommas:()=>_formatNumberTwoDecimalPlacesAndCommas,_fuzzySuggestions:()=>_fuzzySuggestions,_getAbsoluteHeight:()=>_getAbsoluteHeight,_getAbsoluteWidth:()=>_getAbsoluteWidth,_getAllValuesInObject:()=>_getAllValuesInObject,_getAriaPosInSet:()=>_getAriaPosInSet,_getCtrlForEventTarget:()=>_getCtrlForEventTarget,_getHeaderClassesFromColDef:()=>_getHeaderClassesFromColDef,_getInnerHeight:()=>_getInnerHeight,_getInnerWidth:()=>_getInnerWidth,_getRowContainerOptions:()=>_getRowContainerOptions,_getToolPanelClassesFromColDef:()=>_getToolPanelClassesFromColDef,_includes:()=>_includes,_insertArrayIntoArray:()=>_insertArrayIntoArray,_insertIntoArray:()=>_insertIntoArray,_isElementInEventPath:()=>_isElementInEventPath,_isEventFromPrintableCharacter:()=>_isEventFromPrintableCharacter,_isIOSUserAgent:()=>_isIOSUserAgent,_isNodeOrElement:()=>_isNodeOrElement,_isStopPropagationForAgGrid:()=>_isStopPropagationForAgGrid,_isVisible:()=>_isVisible,_iterateObject:()=>_iterateObject,_jsonEquals:()=>_jsonEquals,_last:()=>_last,_loadTemplate:()=>_loadTemplate,_log:()=>_log,_makeNull:()=>_makeNull,_mergeDeep:()=>_mergeDeep,_missing:()=>_missing,_missingOrEmpty:()=>_missingOrEmpty,_parseDateTimeFromString:()=>_parseDateTimeFromString,_processOnChange:()=>_processOnChange,_radioCssClass:()=>_radioCssClass,_removeAriaExpanded:()=>_removeAriaExpanded,_removeAriaSort:()=>_removeAriaSort,_removeFromArray:()=>_removeFromArray,_removeFromParent:()=>_removeFromParent,_removeRepeatsFromArray:()=>_removeRepeatsFromArray,_serialiseDate:()=>_serialiseDate,_setAriaActiveDescendant:()=>_setAriaActiveDescendant,_setAriaChecked:()=>_setAriaChecked,_setAriaColCount:()=>_setAriaColCount,_setAriaColIndex:()=>_setAriaColIndex,_setAriaColSpan:()=>_setAriaColSpan,_setAriaControls:()=>_setAriaControls,_setAriaDescribedBy:()=>_setAriaDescribedBy,_setAriaDisabled:()=>_setAriaDisabled,_setAriaExpanded:()=>_setAriaExpanded,_setAriaHidden:()=>_setAriaHidden,_setAriaLabel:()=>_setAriaLabel,_setAriaLabelledBy:()=>_setAriaLabelledBy,_setAriaLevel:()=>_setAriaLevel,_setAriaPosInSet:()=>_setAriaPosInSet,_setAriaRole:()=>_setAriaRole,_setAriaRowCount:()=>_setAriaRowCount,_setAriaRowIndex:()=>_setAriaRowIndex,_setAriaSelected:()=>_setAriaSelected,_setAriaSetSize:()=>_setAriaSetSize,_setAriaSort:()=>_setAriaSort,_setDisabled:()=>_setDisabled,_setDisplayed:()=>_setDisplayed,_setFixedWidth:()=>_setFixedWidth,_setVisible:()=>_setVisible,_shallowCompare:()=>_shallowCompare,_sortRowNodesByOrder:()=>_sortRowNodesByOrder,_stopPropagationForAgGrid:()=>_stopPropagationForAgGrid,_toStringOrNull:()=>_toStringOrNull,_unwrapUserComp:()=>_unwrapUserComp,_utf8_encode:()=>_utf8_encode,_values:()=>_values,_waitUntil:()=>_waitUntil,_warnOnce:()=>_warnOnce,createGrid:()=>createGrid,getDefaultFloatingFilterType:()=>getDefaultFloatingFilterType,isColumn:()=>isColumn,isColumnGroup:()=>isColumnGroup,isProvidedColumnGroup:()=>isProvidedColumnGroup,isSelectionUIEvent:()=>isSelectionUIEvent,provideGlobalGridOptions:()=>provideGlobalGridOptions}),module.exports=__toCommonJS(main_exports);var LocalEventService=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setFrameworkOverrides(e){this.frameworkOverrides=e}getListeners(e,t,i){const s=t?this.allAsyncListeners:this.allSyncListeners;let o=s.get(e);return!o&&i&&(o=new Set,s.set(e,o)),o}noRegisteredListenersExist(){return this.allSyncListeners.size===0&&this.allAsyncListeners.size===0&&this.globalSyncListeners.size===0&&this.globalAsyncListeners.size===0}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const s=this.getListeners(e,i,!1);s&&(s.delete(t),s.size===0&&(i?this.allAsyncListeners:this.allSyncListeners).delete(e))}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){const t=e;this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const i=e.type;if(t&&"event"in e){const l=e.event;l instanceof Event&&(e.eventPath=l.composedPath())}const s=(l,a)=>l.forEach(d=>{if(!a.has(d))return;const h=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>d(e)):()=>d(e);t?this.dispatchAsync(h):h()}),o=this.getListeners(i,t,!1)??new Set,r=new Set(o);r.size>0&&s(r,o),new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(l=>{const a=this.frameworkOverrides?()=>this.frameworkOverrides.wrapIncoming(()=>l(i,e)):()=>l(i,e);t?this.dispatchAsync(a):a()})}dispatchAsync(e){if(this.asyncFunctionsQueue.push(e),!this.scheduled){const t=()=>{window.setTimeout(this.flushAsyncQueue.bind(this),0)};this.frameworkOverrides?this.frameworkOverrides.wrapIncoming(t):t(),this.scheduled=!0}}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(t=>t())}};function _existsAndNotEmpty(e){return e!=null&&e.length>0}function _last(e){if(!(!e||!e.length))return e[e.length-1]}function _areEqual(e,t,i){return e==null&&t==null?!0:e!=null&&t!=null&&e.length===t.length&&e.every((s,o)=>i?i(s,t[o]):t[o]===s)}function _shallowCompare(e,t){return _areEqual(e,t)}function _sortNumerically(e){return e.sort((t,i)=>t-i)}function _removeRepeatsFromArray(e,t){if(e)for(let i=e.length-2;i>=0;i--){const s=e[i]===t,o=e[i+1]===t;s&&o&&e.splice(i+1,1)}}function _removeFromUnorderedArray(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function _removeFromArray(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function _removeAllFromUnorderedArray(e,t){for(let i=0;i<t.length;i++)_removeFromUnorderedArray(e,t[i])}function _removeAllFromArray(e,t){for(let i=0;i<t.length;i++)_removeFromArray(e,t[i])}function _insertIntoArray(e,t,i){e.splice(i,0,t)}function _insertArrayIntoArray(e,t,i){if(!(e==null||t==null))for(let s=t.length-1;s>=0;s--){const o=t[s];_insertIntoArray(e,o,i)}}function _moveInArray(e,t,i){_removeAllFromArray(e,t),t.slice().reverse().forEach(s=>_insertIntoArray(e,s,i))}function _includes(e,t){return e.indexOf(t)>-1}function _flatten(e){return[].concat.apply([],e)}function _pushAll(e,t){t==null||e==null||t.forEach(i=>e.push(i))}function _forEachReverse(e,t){if(e!=null)for(let i=e.length-1;i>=0;i--)t(e[i],i)}var AG_GRID_STOP_PROPAGATION="__ag_Grid_Stop_Propagation",PASSIVE_EVENTS=["touchstart","touchend","touchmove","touchcancel","scroll"],supports={};function _stopPropagationForAgGrid(e){e[AG_GRID_STOP_PROPAGATION]=!0}function _isStopPropagationForAgGrid(e){return e[AG_GRID_STOP_PROPAGATION]===!0}var _isEventSupported=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return i=>{if(typeof supports[i]=="boolean")return supports[i];const s=document.createElement(e[i]||"div");return i="on"+i,supports[i]=i in s}})();function _getCtrlForEventTarget(e,t,i){let s=t;for(;s;){const o=e.getDomData(s,i);if(o)return o;s=s.parentElement}return null}function _isElementInEventPath(e,t){return!t||!e?!1:_getEventPath(t).indexOf(e)>=0}function _createEventPath(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function _getEventPath(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():_createEventPath(t)}function _addSafePassiveEventListener(e,t,i,s){const r=_includes(PASSIVE_EVENTS,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,r)}var BeanStub=class{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.propertyListenerId=0,this.lastChangeSetIdLookup={},this.isAlive=()=>!this.destroyed}preWireBeans(e){this.gridId=e.context.getGridId(),this.frameworkOverrides=e.frameworkOverrides,this.stubContext=e.context,this.eventService=e.eventService,this.gos=e.gos,this.localeService=e.localeService}getFrameworkOverrides(){return this.frameworkOverrides}destroy(){for(let e=0;e<this.destroyFunctions.length;e++)this.destroyFunctions[e]();this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchLocalEvent({type:"destroyed"})}addEventListener(e,t){this.localEventService||(this.localEventService=new LocalEventService),this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService&&this.localEventService.removeEventListener(e,t)}dispatchLocalEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedElementListeners(e,t){return this._setupListeners(e,t)}addManagedEventListeners(e){return this._setupListeners(this.eventService,e)}addManagedListeners(e,t){return this._setupListeners(e,t)}_setupListeners(e,t){const i=[];for(const s in t){const o=t[s];o&&i.push(this._setupListener(e,s,o))}return i}_setupListener(e,t,i){if(this.destroyed)return()=>null;e instanceof HTMLElement?_addSafePassiveEventListener(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const s=()=>(e.removeEventListener(t,i),null);return this.destroyFunctions.push(s),()=>(s(),this.destroyFunctions=this.destroyFunctions.filter(o=>o!==s),null)}setupGridOptionListener(e,t){this.gos.addPropertyEventListener(e,t);const i=()=>(this.gos.removePropertyEventListener(e,t),null);return this.destroyFunctions.push(i),()=>(i(),this.destroyFunctions=this.destroyFunctions.filter(s=>s!==i),null)}addManagedPropertyListener(e,t){return this.destroyed?()=>null:this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,s=o=>{if(o.changeSet){if(o.changeSet&&o.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=o.changeSet.id}const r={type:"gridPropertyChanged",changeSet:o.changeSet,source:o.source};t(r)};e.forEach(o=>this.setupGridOptionListener(o,s))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.stubContext).createBean(e,i)}destroyBean(e,t){return(t||this.stubContext).destroyBean(e)}destroyBeans(e,t){return(t||this.stubContext).destroyBeans(e)}},FrameworkEventListenerService=class{constructor(e){this.frameworkOverrides=e,this.wrappedListeners=new Map,this.wrappedGlobalListeners=new Map}wrap(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=i=>{this.frameworkOverrides.wrapOutgoing(()=>e(i))},this.wrappedListeners.set(e,t)),t}wrapGlobal(e){let t=e;return this.frameworkOverrides.shouldWrapOutgoing&&(t=(i,s)=>{this.frameworkOverrides.wrapOutgoing(()=>e(i,s))},this.wrappedGlobalListeners.set(e,t)),t}unwrap(e){return this.wrappedListeners.get(e)??e}unwrapGlobal(e){return this.wrappedGlobalListeners.get(e)??e}};function _makeNull(e){return e==null||e===""?null:e}function _exists(e,t=!1){return e!=null&&(e!==""||t)}function _missing(e){return!_exists(e)}function _missingOrEmpty(e){return e==null||e.length===0}function _toStringOrNull(e){return e!=null&&typeof e.toString=="function"?e.toString():null}function _attrToNumber(e){if(e===void 0)return;if(e===null||e==="")return null;if(typeof e=="number")return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function _attrToBoolean(e){if(e!==void 0)return e===null||e===""?!1:toBoolean(e)}function toBoolean(e){return typeof e=="boolean"?e:typeof e=="string"?e.toUpperCase()==="TRUE"||e=="":!1}function _jsonEquals(e,t){const i=e?JSON.stringify(e):null,s=t?JSON.stringify(t):null;return i===s}function _defaultComparator(e,t,i=!1){const s=e==null,o=t==null;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),s&&o)return 0;if(s)return-1;if(o)return 1;function r(n,l){return n>l?1:n<l?-1:0}if(typeof e!="string"||!i)return r(e,t);try{return e.localeCompare(t)}catch{return r(e,t)}}function _values(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach(i=>t.push(i)),t}return Object.values(e)}var SKIP_JS_BUILTINS=new Set(["__proto__","constructor","prototype"]);function _iterateObject(e,t){if(e!=null){if(Array.isArray(e)){for(let i=0;i<e.length;i++)t(i.toString(),e[i]);return}for(const[i,s]of Object.entries(e))t(i,s)}}function _cloneObject(e){const t={},i=Object.keys(e);for(let s=0;s<i.length;s++){if(SKIP_JS_BUILTINS.has(i[s]))continue;const o=i[s],r=e[o];t[o]=r}return t}function _deepCloneDefinition(e,t){if(!e)return;const i=e,s={};return Object.keys(i).forEach(o=>{if(t&&t.indexOf(o)>=0||SKIP_JS_BUILTINS.has(o))return;const r=i[o];_isNonNullObject(r)&&r.constructor===Object?s[o]=_deepCloneDefinition(r):s[o]=r}),s}function _getAllValuesInObject(e){if(!e)return[];const t=Object;if(typeof t.values=="function")return t.values(e);const i=[];for(const s in e)e.hasOwnProperty(s)&&e.propertyIsEnumerable(s)&&i.push(e[s]);return i}function _mergeDeep(e,t,i=!0,s=!1){_exists(t)&&_iterateObject(t,(o,r)=>{if(SKIP_JS_BUILTINS.has(o))return;let n=e[o];n!==r&&(s&&n==null&&r!=null&&typeof r=="object"&&r.constructor===Object&&(n={},e[o]=n),_isNonNullObject(r)&&_isNonNullObject(n)&&!Array.isArray(n)?_mergeDeep(n,r,i,s):(i||r!==void 0)&&(e[o]=r))})}function _getValueUsingField(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let o=e;for(let r=0;r<s.length;r++){if(o==null)return;o=o[s[r]]}return o}function _isNonNullObject(e){return typeof e=="object"&&e!==null}var COL_DEF_DEFAULTS={resizable:!0,sortable:!0},instanceIdSequence=0;function getNextColInstanceId(){return instanceIdSequence++}function isColumn(e){return e instanceof AgColumn}var DEFAULT_COLUMN_MIN_WIDTH=20,AgColumn=class extends BeanStub{constructor(e,t,i,s){super(),this.isColumn=!0,this.instanceId=getNextColInstanceId(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.columnEventService=new LocalEventService,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=s,this.setState(e)}wireBeans(e){this.columnHoverService=e.columnHoverService}getInstanceId(){return this.instanceId}setState(e){e.sort!==void 0?(e.sort==="asc"||e.sort==="desc")&&(this.sort=e.sort):(e.initialSort==="asc"||e.initialSort==="desc")&&(this.sort=e.initialSort);const t=e.sortIndex,i=e.initialSortIndex;t!==void 0?t!==null&&(this.sortIndex=t):i!==null&&(this.sortIndex=i);const s=e.hide,o=e.initialHide;s!==void 0?this.visible=!s:this.visible=!o,e.pinned!==void 0?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const r=e.flex,n=e.initialFlex;r!==void 0?this.flex=r:n!==void 0&&(this.flex=n)}setColDef(e,t,i){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.initTooltip(),this.columnEventService.dispatchEvent(this.createColumnEvent("colDefChanged",i))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}postConstruct(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip()}initDotNotation(){const e=this.gos.get("suppressFieldDotNotation");this.fieldContainsDots=_exists(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=_exists(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=e.minWidth??DEFAULT_COLUMN_MIN_WIDTH,this.maxWidth=e.maxWidth??Number.MAX_SAFE_INTEGER}initTooltip(){this.tooltipEnabled=_exists(this.colDef.tooltipField)||_exists(this.colDef.tooltipValueGetter)||_exists(this.colDef.tooltipComponent)}resetActualWidth(e){const t=this.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}calculateColInitialWidth(e){let t;const i=_attrToNumber(e.width),s=_attrToNumber(e.initialWidth);return i!=null?t=i:s!=null?t=s:t=200,Math.max(Math.min(t,this.maxWidth),this.minWidth)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(_missing(this.colDef)||_missing(this.colDef.showRowGroup))return!1;const t=this.colDef.showRowGroup===!0,i=this.colDef.showRowGroup===e;return t||i}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}addEventListener(e,t){this.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.columnEventService.setFrameworkOverrides(this.frameworkOverrides),this.frameworkEventListenerService=new FrameworkEventListenerService(this.frameworkOverrides));const i=this.frameworkEventListenerService?.wrap(t)??t;this.columnEventService.addEventListener(e,i)}removeEventListener(e,t){const i=this.frameworkEventListenerService?.unwrap(t)??t;this.columnEventService.removeEventListener(e,i)}createColumnFunctionCallbackParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,column:this,colDef:this.colDef})}isSuppressNavigable(e){if(typeof this.colDef.suppressNavigable=="boolean")return this.colDef.suppressNavigable;if(typeof this.colDef.suppressNavigable=="function"){const t=this.createColumnFunctionCallbackParams(e),i=this.colDef.suppressNavigable;return i(t)}return!1}isCellEditable(e){return e.group&&!this.gos.get("enableGroupEdit")?!1:this.isColumnFunc(e,this.colDef.editable)}isSuppressFillHandle(){return!!this.colDef.suppressFillHandle}isAutoHeight(){return!!this.colDef.autoHeight}isAutoHeaderHeight(){return!!this.colDef.autoHeaderHeight}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!this.getColDefValue("resizable")}getColDefValue(e){return this.colDef[e]??COL_DEF_DEFAULTS[e]}isColumnFunc(e,t){if(typeof t=="boolean")return t;if(typeof t=="function"){const i=this.createColumnFunctionCallbackParams(e);return t(i)}return!1}setMoving(e,t){this.moving=e,this.columnEventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return this.gos.addGridCommonParams({type:e,column:this,columns:[this],source:t})}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t){this.sort!==e&&(this.sort=e,this.columnEventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}isSortable(){return!!this.getColDefValue("sortable")}isSortAscending(){return this.sort==="asc"}isSortDescending(){return this.sort==="desc"}isSortNone(){return _missing(this.sort)}isSorting(){return _exists(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setMenuVisible(e,t){this.menuVisible!==e&&(this.menuVisible=e,this.columnEventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.columnEventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t,i){this.filterActive!==e&&(this.filterActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const s=this.createColumnEvent("filterChanged",t);i&&_mergeDeep(s,i),this.columnEventService.dispatchEvent(s)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){e===!0||e==="left"?this.pinned="left":e==="right"?this.pinned="right":this.pinned=null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,t){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.columnEventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",t)))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return this.pinned==="left"||this.pinned==="right"}isPinnedLeft(){return this.pinned==="left"}isPinnedRight(){return this.pinned==="right"}getPinned(){return this.pinned}setVisible(e,t){const i=e===!0;this.visible!==i&&(this.visible=i,this.columnEventService.dispatchEvent(this.createColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColumnGroupPaddingInfo(){let e=this.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}getColDef(){return this.colDef}getDefinition(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return this.gos.addGridCommonParams({node:e,data:e.data,colDef:this.colDef,column:this})}getColSpan(e){if(_missing(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.colSpan(t);return Math.max(i,1)}getRowSpan(e){if(_missing(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),i=this.colDef.rowSpan(t);return Math.max(i,1)}setActualWidth(e,t,i=!1){e=Math.max(e,this.minWidth),e=Math.min(e,this.maxWidth),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&t!=="flex"&&t!=="gridInitializing"&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.columnEventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e){this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t){this.pivotActive!==e&&(this.pivotActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t){this.aggregationActive!==e&&(this.aggregationActive=e,this.columnEventService.dispatchEvent(this.createColumnEvent("columnValueChanged",t)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return this.colDef.enablePivot===!0}isAllowValue(){return this.colDef.enableValue===!0}isAllowRowGroup(){return this.colDef.enableRowGroup===!0}dispatchStateUpdatedEvent(e){this.columnEventService.dispatchEvent({type:"columnStateUpdated",key:e})}};function isProvidedColumnGroup(e){return e instanceof AgProvidedColumnGroup}var AgProvidedColumnGroup=class extends BeanStub{constructor(e,t,i,s){super(),this.isColumn=!1,this.expandable=!1,this.instanceId=getNextColInstanceId(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=s}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0),super.destroy()}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return this.children?this.children.some(e=>e.isVisible()):!1}isPadding(){return this.padding}setExpanded(e){this.expanded=e===void 0?!1:e,this.dispatchLocalEvent({type:"expandedChanged"})}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(e){this.children&&this.children.forEach(t=>{isColumn(t)?e.push(t):isProvidedColumnGroup(t)&&t.addLeafColumns(e)})}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach(t=>t.addEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach(t=>t.removeEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,i=!1;const s=this.findChildrenRemovingPadding();for(let r=0,n=s.length;r<n;r++){const l=s[r];if(!l.isVisible())continue;const a=l.getColumnGroupShow();a==="open"?(e=!0,i=!0):a==="closed"?(t=!0,i=!0):(e=!0,t=!0)}const o=e&&t&&i;this.expandable!==o&&(this.expandable=o,this.dispatchLocalEvent({type:"expandableChanged"}))}findChildrenRemovingPadding(){const e=[],t=i=>{i.forEach(s=>{isProvidedColumnGroup(s)&&s.isPadding()?t(s.children):e.push(s)})};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}},DefaultColumnTypes={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}},doOnceFlags={};function _doOnce(e,t){doOnceFlags[t]||(e(),doOnceFlags[t]=!0)}function _log(e,...t){console.log("AG Grid: "+e,...t)}function _warnOnce(e,...t){_doOnce(()=>console.warn("AG Grid: "+e,...t),e+t?.join(""))}function _errorOnce(e,...t){_doOnce(()=>console.error("AG Grid: "+e,...t),e+t?.join(""))}function _isFunction(e){return!!(e&&e.constructor&&e.call&&e.apply)}function _executeInAWhile(e){_executeAfter(e,400)}var executeNextVMTurnFuncs=[],executeNextVMTurnPending=!1;function _executeNextVMTurn(e){executeNextVMTurnFuncs.push(e),!executeNextVMTurnPending&&(executeNextVMTurnPending=!0,window.setTimeout(()=>{const t=executeNextVMTurnFuncs.slice();executeNextVMTurnFuncs.length=0,executeNextVMTurnPending=!1,t.forEach(i=>i())},0))}function _executeAfter(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(i=>i()),t)}function _debounce(e,t){let i;return function(...s){const o=this;window.clearTimeout(i),i=window.setTimeout(function(){e.apply(o,s)},t)}}function _throttle(e,t){let i=0;return function(...s){const o=this,r=new Date().getTime();r-i<t||(i=r,e.apply(o,s))}}function _waitUntil(e,t,i=100,s){const o=new Date().getTime();let r=null,n=!1;const l=()=>{const a=new Date().getTime()-o>i;(e()||a)&&(t(),n=!0,r!=null&&(window.clearInterval(r),r=null),a&&s&&_warnOnce(s))};l(),n||(r=window.setInterval(l,10))}function _compose(...e){return t=>e.reduce((i,s)=>s(i),t)}var ColumnKeyCreator=class{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=_toStringOrNull(e);let i=0;for(;;){let s;if(e?(s=e,i!==0&&(s+="_"+i)):t?(s=t,i!==0&&(s+="_"+i)):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}},GROUP_AUTO_COLUMN_ID="ag-Grid-AutoColumn";function getColumnsFromTree(e){const t=[],i=s=>{for(let o=0;o<s.length;o++){const r=s[o];isColumn(r)?t.push(r):isProvidedColumnGroup(r)&&i(r.getChildren())}};return i(e),t}function getWidthOfColsInList(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}function destroyColumnTree(e,t,i){const s={};if(!t)return;depthFirstOriginalTreeSearch(null,t,r=>{s[r.getInstanceId()]=r}),i&&depthFirstOriginalTreeSearch(null,i,r=>{s[r.getInstanceId()]=null});const o=Object.values(s).filter(r=>r!=null);e.destroyBeans(o)}function isColumnGroupAutoCol(e){return e.getId().startsWith(GROUP_AUTO_COLUMN_ID)}function convertColumnTypes(e){let t=[];return e instanceof Array?e.some(s=>typeof s!="string")?_warnOnce("if colDef.type is supplied an array it should be of type 'string[]'"):t=e:typeof e=="string"?t=e.split(","):_warnOnce("colDef.type should be of type 'string' | 'string[]'"),t}var ColumnFactory=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnFactory"}wireBeans(e){this.dataTypeService=e.dataTypeService}createColumnTree(e,t,i,s){const o=new ColumnKeyCreator,{existingCols:r,existingGroups:n,existingColKeys:l}=this.extractExistingTreeData(i);o.addExistingKeys(l);const a=this.recursivelyCreateColumns(e,0,t,r,o,n,s),d=this.findMaxDept(a,0),h=this.balanceColumnTree(a,0,d,o);return depthFirstOriginalTreeSearch(null,h,(u,g)=>{isProvidedColumnGroup(u)&&u.setupExpandable(),u.setOriginalParent(g)}),{columnTree:h,treeDept:d}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&depthFirstOriginalTreeSearch(null,e,o=>{if(isProvidedColumnGroup(o)){const r=o;i.push(r)}else{const r=o;s.push(r.getId()),t.push(r)}}),{existingCols:t,existingGroups:i,existingColKeys:s}}createForAutoGroups(e,t){const i=[],s=this.findDepth(t);return e.forEach(o=>{let r=o;for(let n=s-1;n>=0;n--){const l=new AgProvidedColumnGroup(null,`FAKE_PATH_${o.getId()}}_${n}`,!0,n);this.createBean(l),l.setChildren([r]),r.setOriginalParent(l),r=l}s===0&&o.setOriginalParent(null),i.push(r)}),[i,s]}findDepth(e){let t=0,i=e;for(;i&&i[0]&&isProvidedColumnGroup(i[0]);)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const o=[];for(let r=0;r<e.length;r++){const n=e[r];if(isProvidedColumnGroup(n)){const l=n,a=this.balanceColumnTree(l.getChildren(),t+1,i,s);l.setChildren(a),o.push(l)}else{let l,a;for(let d=i-1;d>=t;d--){const h=s.getUniqueKey(null,null),c=this.createMergedColGroupDef(null),u=new AgProvidedColumnGroup(c,h,!0,t);this.createBean(u),a&&a.setChildren([u]),a=u,l||(l=a)}if(l&&a)if(o.push(l),e.some(h=>isProvidedColumnGroup(h))){a.setChildren([n]);continue}else{a.setChildren(e);break}o.push(n)}}return o}findMaxDept(e,t){let i=t;for(let s=0;s<e.length;s++){const o=e[s];if(isProvidedColumnGroup(o)){const r=o,n=this.findMaxDept(r.getChildren(),t+1);i<n&&(i=n)}}return i}recursivelyCreateColumns(e,t,i,s,o,r,n){if(!e)return[];const l=new Array(e.length);for(let a=0;a<l.length;a++){const d=e[a];this.isColumnGroup(d)?l[a]=this.createColumnGroup(i,d,t,s,o,r,n):l[a]=this.createColumn(i,d,s,o,n)}return l}createColumnGroup(e,t,i,s,o,r,n){const l=this.createMergedColGroupDef(t),a=o.getUniqueKey(l.groupId||null,null),d=new AgProvidedColumnGroup(l,a,!1,i);this.createBean(d);const h=this.findExistingGroup(t,r);h&&r.splice(h.idx,1);const c=h?.group;c&&d.setExpanded(c.isExpanded());const u=this.recursivelyCreateColumns(l.children,i+1,e,s,o,r,n);return d.setChildren(u),d}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gos.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,s,o){const r=this.findExistingColumn(t,i);r&&i?.splice(r.idx,1);let n=r?.column;if(n){const l=this.addColumnDefaultAndTypes(t,n.getColId());n.setColDef(l,t,o),this.applyColumnState(n,l,o)}else{const l=s.getUniqueKey(t.colId,t.field),a=this.addColumnDefaultAndTypes(t,l);n=new AgColumn(a,t,l,e),this.createBean(n)}return this.dataTypeService?.addColumnListeners(n),n}applyColumnState(e,t,i){const s=_attrToNumber(t.flex);if(s!==void 0&&e.setFlex(s),e.getFlex()<=0){const l=_attrToNumber(t.width);if(l!=null)e.setActualWidth(l,i);else{const a=e.getActualWidth();e.setActualWidth(a,i)}}t.sort!==void 0&&(t.sort=="asc"||t.sort=="desc"?e.setSort(t.sort,i):e.setSort(void 0,i));const r=_attrToNumber(t.sortIndex);r!==void 0&&e.setSortIndex(r);const n=_attrToBoolean(t.hide);n!==void 0&&e.setVisible(!n,i),t.pinned!==void 0&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const s=t[i].getUserProvidedColDef();if(!s)continue;if(e.colId!=null){if(t[i].getId()===e.colId)return{idx:i,column:t[i]};continue}if(e.field!=null){if(s.field===e.field)return{idx:i,column:t[i]};continue}if(s===e)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(e.groupId!=null)for(let s=0;s<t.length;s++){const o=t[s];if(o.getColGroupDef()&&o.getId()===e.groupId)return{idx:s,group:o}}}addColumnDefaultAndTypes(e,t){const i={},s=this.gos.get("defaultColDef");_mergeDeep(i,s,!1,!0);const o=this.updateColDefAndGetColumnType(i,e,t);o&&this.assignColumnTypes(o,i),_mergeDeep(i,e,!1,!0);const r=this.gos.get("autoGroupColumnDef"),n=this.gos.isColumnsSortingCoupledToGroup();return e.rowGroup&&r&&n&&_mergeDeep(i,{sort:r.sort,initialSort:r.initialSort},!1,!0),this.dataTypeService?.validateColDef(i),i}updateColDefAndGetColumnType(e,t,i){const s=this.dataTypeService?.updateColDefAndGetColumnType(e,t,i),o=t.type??s??e.type;return e.type=o,o?convertColumnTypes(o):void 0}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},DefaultColumnTypes),s=this.gos.get("columnTypes")||{};_iterateObject(s,(o,r)=>{o in i?_warnOnce(`the column type '${o}' is a default column type and cannot be overridden.`):(r.type&&_warnOnce("Column type definitions 'columnTypes' with a 'type' attribute are not supported because a column type cannot refer to another column type. Only column definitions 'columnDefs' can use the 'type' attribute to refer to a column type."),i[o]=r)}),e.forEach(o=>{const r=i[o.trim()];r?_mergeDeep(t,r,!1,!0):_warnOnce("colDef.type '"+o+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return e.children!==void 0}};function depthFirstOriginalTreeSearch(e,t,i){if(t)for(let s=0;s<t.length;s++){const o=t[s];isProvidedColumnGroup(o)&&depthFirstOriginalTreeSearch(o,o.getChildren(),i),i(o,e)}}var ColumnModel=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnModel",this.pivotMode=!1,this.autoHeightActiveAtLeastOnce=!1,this.ready=!1,this.changeEventsDispatching=!1,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}wireBeans(e){this.context=e.context,this.columnFactory=e.columnFactory,this.columnSizeService=e.columnSizeService,this.visibleColsService=e.visibleColsService,this.columnViewportService=e.columnViewportService,this.pivotResultColsService=e.pivotResultColsService,this.columnAnimationService=e.columnAnimationService,this.autoColService=e.autoColService,this.valueCache=e.valueCache,this.columnDefFactory=e.columnDefFactory,this.columnApplyStateService=e.columnApplyStateService,this.columnGroupStateService=e.columnGroupStateService,this.eventDispatcher=e.columnEventDispatcher,this.columnMoveService=e.columnMoveService,this.columnAutosizeService=e.columnAutosizeService,this.funcColsService=e.funcColsService,this.quickFilterService=e.quickFilterService,this.showRowGroupColsService=e.showRowGroupColsService,this.environment=e.environment}postConstruct(){const e=this.gos.get("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData","treeDataDisplayType","groupHideOpenParents"],t=>this.refreshAll(convertSourceType(t.source))),this.addManagedPropertyListener("autoGroupColumnDef",t=>this.onAutoGroupColumnDefChanged(convertSourceType(t.source))),this.addManagedPropertyListeners(["defaultColDef","columnTypes","suppressFieldDotNotation"],t=>this.recreateColumnDefs(convertSourceType(t.source))),this.addManagedPropertyListener("pivotMode",t=>this.setPivotMode(this.gos.get("pivotMode"),convertSourceType(t.source))),this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered()})}createColsFromColDefs(e,t){const i=e?this.columnApplyStateService.compareColumnStatesAndDispatchEvents(t):void 0;this.valueCache.expire();const s=this.colDefCols&&this.colDefCols.list,o=this.colDefCols&&this.colDefCols.tree,r=this.columnFactory.createColumnTree(this.colDefs,!0,o,t);destroyColumnTree(this.context,this.colDefCols?.tree,r.columnTree);const n=r.columnTree,l=r.treeDept,a=getColumnsFromTree(n),d={};a.forEach(c=>d[c.getId()]=c),this.colDefCols={tree:n,treeDepth:l,list:a,map:d},this.funcColsService.extractCols(t,s),this.ready=!0,this.refreshCols(),e&&!this.showingPivotResult&&!this.gos.get("maintainColumnOrder")&&this.orderColsLikeColDefCols(),this.visibleColsService.refresh(t),this.columnViewportService.checkViewportColumns(),this.eventDispatcher.everythingChanged(t),i&&(this.changeEventsDispatching=!0,i(),this.changeEventsDispatching=!1),this.eventDispatcher.newColumnsLoaded(t),t==="gridInitializing"&&this.columnSizeService.applyAutosizeStrategy()}refreshCols(){if(!this.colDefCols)return;const e=this.cols?.tree;this.saveColOrder(),this.selectCols(),this.createAutoCols(),this.addAutoCols(),this.restoreColOrder(),this.positionLockedCols(),this.showRowGroupColsService?.refresh(),this.quickFilterService?.refreshQuickFilterCols(),this.setColSpanActive(),this.setAutoHeightActive(),this.visibleColsService.clear(),this.columnViewportService.clear(),!_areEqual(e,this.cols.tree)&&this.eventDispatcher.gridColumns()}selectCols(){const e=this.pivotResultColsService.getPivotResultCols();if(this.showingPivotResult=e!=null,e){const{map:t,list:i,tree:s,treeDepth:o}=e;this.cols={list:i.slice(),map:{...t},tree:s.slice(),treeDepth:o},e.list.some(n=>this.cols?.map[n.getColId()]!==void 0)||(this.lastPivotOrder=null)}else{const{map:t,list:i,tree:s,treeDepth:o}=this.colDefCols;this.cols={list:i.slice(),map:{...t},tree:s.slice(),treeDepth:o}}}getColsToShow(){const e=this.isPivotMode()&&!this.isShowingPivotResult(),t=this.funcColsService.getValueColumns();return this.cols.list.filter(s=>{const o=isColumnGroupAutoCol(s);if(e){const r=t&&_includes(t,s);return o||r}else return o||s.isVisible()})}addAutoCols(){this.autoCols!=null&&(this.cols.list=this.autoCols.list.concat(this.cols.list),this.cols.tree=this.autoCols.tree.concat(this.cols.tree),updateColsMap(this.cols))}createAutoCols(){const e=this.gos.isGroupUseEntireRow(this.pivotMode),t=this.pivotMode?this.gos.get("pivotSuppressAutoColumn"):this.isSuppressAutoCol(),i=this.funcColsService.getRowGroupColumns(),o=!(i.length>0||this.gos.get("treeData"))||t||e,r=()=>{this.autoCols&&(destroyColumnTree(this.context,this.autoCols.tree),this.autoCols=null)};if(o||!this.autoColService){r();return}const n=this.autoColService.createAutoCols(i)??[],l=areColIdsEqual(n,this.autoCols?.list||null),a=this.cols.treeDepth,h=(this.autoCols?this.autoCols.treeDepth:-1)==a;if(l&&h)return;r();const[c,u]=this.columnFactory.createForAutoGroups(n,this.cols?.tree);this.autoCols={list:n,tree:c,treeDepth:u,map:{}};const g=p=>{if(!p)return null;const f=p.filter(m=>!isColumnGroupAutoCol(m));return[...n,...f]};this.lastOrder=g(this.lastOrder),this.lastPivotOrder=g(this.lastPivotOrder)}refreshAll(e){this.isReady()&&(this.refreshCols(),this.visibleColsService.refresh(e))}setColsVisible(e,t=!1,i){this.columnApplyStateService.applyColumnState({state:e.map(s=>({colId:typeof s=="string"?s:s.getColId(),hide:!t}))},i)}setColsPinned(e,t,i){if(!this.cols||_missingOrEmpty(e))return;if(this.gos.isDomLayout("print")){_warnOnce("Changing the column pinning status is not allowed with domLayout='print'");return}this.columnAnimationService.start();let s;t===!0||t==="left"?s="left":t==="right"?s="right":s=null;const o=[];e.forEach(r=>{if(!r)return;const n=this.getCol(r);n&&n.getPinned()!==s&&(n.setPinned(s),o.push(n))}),o.length&&(this.visibleColsService.refresh(i),this.eventDispatcher.columnPinned(o,i)),this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i){let s;isProvidedColumnGroup(e)?s=e.getId():s=e||"",this.columnGroupStateService.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColGroup(e){let t=null;return depthFirstOriginalTreeSearch(null,this.cols?.tree,i=>{isProvidedColumnGroup(i)&&i.getId()===e&&(t=i)}),t}isColGroupLocked(e){const t=this.gos.get("groupLockGroupColumns");if(!e.isRowGroupActive()||t===0)return!1;if(t===-1)return!0;const s=this.funcColsService.getRowGroupColumns().findIndex(o=>o.getColId()===e.getColId());return t>s}isSuppressAutoCol(){return this.gos.get("groupDisplayType")==="custom"?!0:this.gos.get("treeDataDisplayType")==="custom"}setAutoHeightActive(){this.autoHeightActive=this.cols.list.some(e=>e.isAutoHeight()),this.autoHeightActive&&(this.autoHeightActiveAtLeastOnce=!0,this.gos.isRowModelType("clientSide")||this.gos.isRowModelType("serverSide")||_warnOnce("autoHeight columns only work with Client Side Row Model and Server Side Row Model."))}restoreColOrder(){const e=this.showingPivotResult?this.lastPivotOrder:this.lastOrder;if(!e)return;const t=new Map(e.map((a,d)=>[a,d]));if(!this.cols.list.some(a=>t.has(a)))return;const s=new Map(this.cols.list.map(a=>[a,!0])),o=e.filter(a=>s.has(a)),r=new Map(o.map(a=>[a,!0])),n=this.cols.list.filter(a=>!r.has(a)),l=o.slice();n.forEach(a=>{let d=a.getOriginalParent();if(!d){l.push(a);return}const h=[];for(;!h.length&&d;)d.getLeafColumns().forEach(p=>{const f=l.indexOf(p)>=0,m=h.indexOf(p)<0;f&&m&&h.push(p)}),d=d.getOriginalParent();if(!h.length){l.push(a);return}const c=h.map(g=>l.indexOf(g)),u=Math.max(...c);_insertIntoArray(l,a,u+1)}),this.cols.list=l}orderColsLikeColDefCols(){if(!this.colDefCols||!this.cols)return;const e=this.colDefCols.list.filter(i=>this.cols.list.indexOf(i)>=0),t=this.cols.list.filter(i=>e.indexOf(i)<0);this.cols.list=[...t,...e],this.cols.list=this.columnMoveService.placeLockedColumns(this.cols.list)}sortColsLikeKeys(e){if(this.cols==null)return;let t=[];const i={};e.forEach(o=>{if(i[o])return;const r=this.cols.map[o];r&&(t.push(r),i[o]=!0)});let s=0;if(this.cols.list.forEach(o=>{const r=o.getColId();if(i[r]!=null)return;r.startsWith(GROUP_AUTO_COLUMN_ID)?_insertIntoArray(t,o,s++):t.push(o)}),t=this.columnMoveService.placeLockedColumns(t),!this.columnMoveService.doesMovePassMarryChildren(t)){_warnOnce("Applying column order broke a group where columns should be married together. Applying new order has been discarded.");return}this.cols.list=t}sortColsLikeCols(e){!e||e.length<=1||e.filter(i=>this.cols.list.indexOf(i)<0).length>0||e.sort((i,s)=>{const o=this.cols.list.indexOf(i),r=this.cols.list.indexOf(s);return o-r})}resetColDefIntoCol(e,t){const i=e.getUserProvidedColDef();if(!i)return!1;const s=this.columnFactory.addColumnDefaultAndTypes(i,e.getColId());return e.setColDef(s,i,t),!0}queueResizeOperations(){this.shouldQueueResizeOperations=!0}isShouldQueueResizeOperations(){return this.shouldQueueResizeOperations}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach(e=>e()),this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}moveInCols(e,t,i){_moveInArray(this.cols?.list,e,t),this.visibleColsService.refresh(i)}positionLockedCols(){this.cols.list=this.columnMoveService.placeLockedColumns(this.cols.list)}saveColOrder(){this.showingPivotResult?this.lastPivotOrder=this.cols?.list:this.lastOrder=this.cols?.list}getColumnDefs(){if(!this.colDefCols)return;const e=this.colDefCols.list.slice();this.showingPivotResult?e.sort((s,o)=>this.lastOrder.indexOf(s)-this.lastOrder.indexOf(o)):this.lastOrder&&e.sort((s,o)=>this.cols.list.indexOf(s)-this.cols.list.indexOf(o));const t=this.funcColsService.getRowGroupColumns(),i=this.funcColsService.getPivotColumns();return this.columnDefFactory.buildColumnDefs(e,t,i)}isShowingPivotResult(){return this.showingPivotResult}isChangeEventsDispatching(){return this.changeEventsDispatching}isColSpanActive(){return this.colSpanActive}isProvidedColGroupsPresent(){return this.colDefCols?.treeDepth>0}setColSpanActive(){this.colSpanActive=this.cols.list.some(e=>e.getColDef().colSpan!=null)}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}getHeaderRowCount(){return this.cols?this.cols.treeDepth+1:-1}isReady(){return this.ready}isPivotMode(){return this.pivotMode}setPivotMode(e,t){e===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode)||(this.pivotMode=e,this.ready&&(this.refreshCols(),this.visibleColsService.refresh(t),this.eventDispatcher.pivotModeChanged()))}isPivotSettingAllowed(e){return e&&this.gos.get("treeData")?(_warnOnce("Pivot mode not available with treeData."),!1):!0}isPivotActive(){const e=this.funcColsService.getPivotColumns();return this.pivotMode&&!_missingOrEmpty(e)}recreateColumnDefs(e){this.cols&&(this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e),this.createColsFromColDefs(!0,e))}setColumnDefs(e,t){const i=!!this.colDefs;this.colDefs=e,this.createColsFromColDefs(i,t)}destroy(){destroyColumnTree(this.context,this.colDefCols?.tree),destroyColumnTree(this.context,this.autoCols?.tree),super.destroy()}getColTree(){return this.cols.tree}getColDefColTree(){return this.colDefCols.tree}getColDefCols(){return this.colDefCols?.list?this.colDefCols.list:null}getCols(){return this.cols?.list??[]}getAllCols(){const t=this.pivotResultColsService.getPivotResultCols()?.list;return[].concat(this.colDefCols?.list||[],this.autoCols?.list||[],t||[])}getColsForKeys(e){return e?e.map(i=>this.getCol(i)).filter(i=>i!=null):[]}getColDefCol(e){return this.colDefCols?.list?this.getColFromCollection(e,this.colDefCols):null}getCol(e){return e==null?null:this.getColFromCollection(e,this.cols)}getColFromCollection(e,t){if(t==null)return null;const{map:i,list:s}=t;if(typeof e=="string"&&i[e])return i[e];for(let o=0;o<s.length;o++)if(columnsMatch(s[o],e))return s[o];return this.getAutoCol(e)}getAutoCol(e){return this.autoCols==null?null:this.autoCols.list.find(t=>columnsMatch(t,e))||null}getAutoCols(){return this.autoCols?.list||null}setColHeaderHeight(e,t){e.setAutoHeaderHeight(t)&&this.eventDispatcher.headerHeight(e)}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),i=this.visibleColsService.getAllCols().filter(s=>s.isAutoHeaderHeight()).map(s=>s.getAutoHeaderHeight()||0);return Math.max(e,...i)}getHeaderHeight(){return this.gos.get("headerHeight")??this.environment.getDefaultHeaderHeight()}getFloatingFiltersHeight(){return this.gos.get("floatingFiltersHeight")??this.getHeaderHeight()}getGroupHeaderHeight(){return this.gos.get("groupHeaderHeight")??this.getHeaderHeight()}getPivotHeaderHeight(){return this.gos.get("pivotHeaderHeight")??this.getHeaderHeight()}getPivotGroupHeaderHeight(){return this.gos.get("pivotGroupHeaderHeight")??this.getGroupHeaderHeight()}onFirstDataRendered(){const e=this.gos.get("autoSizeStrategy");if(e?.type!=="fitCellContents")return;const{colIds:t,skipHeader:i}=e;setTimeout(()=>{t?this.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"autosizeColumns"}):this.columnAutosizeService.autoSizeAllColumns("autosizeColumns",i)})}onAutoGroupColumnDefChanged(e){this.autoCols&&this.autoColService.updateAutoCols(this.autoCols.list,e)}};function convertSourceType(e){return e==="gridOptionsUpdated"?"gridOptionsChanged":e}function updateColsMap(e){e.map={},e.list.forEach(t=>e.map[t.getId()]=t)}function columnsMatch(e,t){const i=e===t,s=e.getColDef()===t,o=e.getColId()==t;return i||s||o}function areColIdsEqual(e,t){return _areEqual(e,t,(i,s)=>i.getColId()===s.getColId())}var ColumnAutosizeService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnAutosizeService",this.timesDelayed=0}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.animationFrameService=e.animationFrameService,this.autoWidthCalculator=e.autoWidthCalculator,this.eventDispatcher=e.columnEventDispatcher,this.ctrlsService=e.ctrlsService,this.renderStatusService=e.renderStatusService}autoSizeCols(e){if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.autoSizeCols(e));return}const{colKeys:t,skipHeader:i,skipHeaderGroups:s,stopAtGroup:o,source:r="api"}=e;if(this.animationFrameService.flushAllFrames(),this.timesDelayed<5&&this.renderStatusService&&!this.renderStatusService.areHeaderCellsRendered()){this.timesDelayed++,setTimeout(()=>this.autoSizeCols(e));return}this.timesDelayed=0;const n=[];let l=-1;const a=i??this.gos.get("skipHeaderOnAutoSize"),d=s??a;for(;l!==0;){l=0;const h=[];t.forEach(c=>{if(!c)return;const u=this.columnModel.getCol(c);if(!u||n.indexOf(u)>=0)return;const g=this.autoWidthCalculator.getPreferredWidthForColumn(u,a);if(g>0){const p=this.normaliseColumnWidth(u,g);u.setActualWidth(p,r),n.push(u),l++}h.push(u)}),h.length&&this.visibleColsService.refresh(r)}d||this.autoSizeColumnGroupsByColumns(t,r,o),this.eventDispatcher.columnResized(n,!0,"autosizeColumns")}autoSizeColumn(e,t,i){e&&this.autoSizeCols({colKeys:[e],skipHeader:i,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,i){const s=new Set;this.columnModel.getColsForKeys(e).forEach(l=>{let a=l.getParent();for(;a&&a!=i;)a.isPadding()||s.add(a),a=a.getParent()});let r;const n=[];for(const l of s){for(const a of this.ctrlsService.getHeaderRowContainerCtrls())if(r=a.getHeaderCtrlForColumn(l),r)break;r&&r.resizeLeafColumnsToFit(t)}return n}autoSizeAllColumns(e,t){if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.autoSizeAllColumns(e,t));return}const i=this.visibleColsService.getAllCols();this.autoSizeCols({colKeys:i,skipHeader:t,source:e})}normaliseColumnWidth(e,t){const i=e.getMinWidth();t<i&&(t=i);const s=e.getMaxWidth();return e.isGreaterThanMax(t)&&(t=s),t}},FuncColsService=class extends BeanStub{constructor(){super(...arguments),this.beanName="funcColsService",this.rowGroupCols=[],this.valueCols=[],this.pivotCols=[]}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.aggFuncService=e.aggFuncService,this.visibleColsService=e.visibleColsService}getModifyColumnsNoEventsCallbacks(){return{addGroupCol:e=>this.rowGroupCols.push(e),removeGroupCol:e=>_removeFromArray(this.rowGroupCols,e),addPivotCol:e=>this.pivotCols.push(e),removePivotCol:e=>_removeFromArray(this.pivotCols,e),addValueCol:e=>this.valueCols.push(e),removeValueCol:e=>_removeFromArray(this.valueCols,e)}}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(t===!0)return this.rowGroupCols.slice(0);const i=this.columnModel.getColDefCol(t);return i?[i]:null}sortRowGroupColumns(e){this.rowGroupCols.sort(e)}sortPivotColumns(e){this.pivotCols.sort(e)}getValueColumns(){return this.valueCols?this.valueCols:[]}getPivotColumns(){return this.pivotCols?this.pivotCols:[]}getRowGroupColumns(){return this.rowGroupCols?this.rowGroupCols:[]}isRowGroupEmpty(){return _missingOrEmpty(this.rowGroupCols)}setColumnAggFunc(e,t,i){if(!e)return;const s=this.columnModel.getColDefCol(e);s&&(s.setAggFunc(t),this.eventDispatcher.columnChanged("columnValueChanged",[s],i))}setRowGroupColumns(e,t){this.setColList(e,this.rowGroupCols,"columnRowGroupChanged",!0,!0,(i,s)=>this.setRowGroupActive(i,s,t),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gos.get("suppressRowGroupHidesColumns")&&this.columnModel.setColsVisible([t],!1,i),!e&&!this.gos.get("suppressMakeColumnVisibleAfterUnGroup")&&this.columnModel.setColsVisible([t],!0,i))}addRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!0,!0,i=>this.setRowGroupActive(!0,i,t),"columnRowGroupChanged",t)}removeRowGroupColumns(e,t){this.updateColList(e,this.rowGroupCols,!1,!0,i=>this.setRowGroupActive(!1,i,t),"columnRowGroupChanged",t)}addPivotColumns(e,t){this.updateColList(e,this.pivotCols,!0,!1,i=>i.setPivotActive(!0,t),"columnPivotChanged",t)}setPivotColumns(e,t){this.setColList(e,this.pivotCols,"columnPivotChanged",!0,!1,(i,s)=>{s.setPivotActive(i,t)},t)}removePivotColumns(e,t){this.updateColList(e,this.pivotCols,!1,!1,i=>i.setPivotActive(!1,t),"columnPivotChanged",t)}setValueColumns(e,t){this.setColList(e,this.valueCols,"columnValueChanged",!1,!1,(i,s)=>this.setValueActive(i,s,t),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc()&&this.aggFuncService)){const s=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(s)}}addValueColumns(e,t){this.updateColList(e,this.valueCols,!0,!1,i=>this.setValueActive(!0,i,t),"columnValueChanged",t)}removeValueColumns(e,t){this.updateColList(e,this.valueCols,!1,!1,i=>this.setValueActive(!1,i,t),"columnValueChanged",t)}moveRowGroupColumn(e,t,i){if(this.isRowGroupEmpty())return;const s=this.rowGroupCols[e],o=this.rowGroupCols.slice(e,t);this.rowGroupCols.splice(e,1),this.rowGroupCols.splice(t,0,s),this.eventDispatcher.rowGroupChanged(o,i)}setColList(e,t,i,s,o,r,n){const l=this.columnModel.getCols();if(_missingOrEmpty(l))return;const a=new Map;t.forEach((h,c)=>a.set(h,c)),t.length=0,_exists(e)&&e.forEach(h=>{const c=this.columnModel.getColDefCol(h);c&&t.push(c)}),t.forEach((h,c)=>{const u=a.get(h);if(u===void 0){a.set(h,0);return}s&&u!==c||a.delete(h)}),(this.columnModel.getColDefCols()||[]).forEach(h=>{const c=t.indexOf(h)>=0;r(c,h)}),o&&this.columnModel.refreshCols(),this.visibleColsService.refresh(n),this.eventDispatcher.columnChanged(i,[...a.keys()],n)}updateColList(e,t,i,s,o,r,n){if(!e||_missingOrEmpty(e))return;let l=!1;e.forEach(a=>{if(!a)return;const d=this.columnModel.getColDefCol(a);if(d){if(i){if(t.indexOf(d)>=0)return;t.push(d)}else{if(t.indexOf(d)<0)return;_removeFromArray(t,d)}o(d),l=!0}}),l&&(s&&this.columnModel.refreshCols(),this.visibleColsService.refresh(n),this.eventDispatcher.genericColumnEvent(r,t,n))}extractCols(e,t){this.extractRowGroupCols(e,t),this.extractPivotCols(e,t),this.extractValueCols(e,t)}extractValueCols(e,t){this.valueCols=this.extractColsCommon(t,this.valueCols,(i,s)=>i.setValueActive(s,e),()=>{},()=>{},i=>{const s=i.aggFunc;if(s===null||s==="")return null;if(s!==void 0)return!!s},i=>i.initialAggFunc!=null&&i.initialAggFunc!=""),this.valueCols.forEach(i=>{const s=i.getColDef();s.aggFunc!=null&&s.aggFunc!=""?i.setAggFunc(s.aggFunc):i.getAggFunc()||i.setAggFunc(s.initialAggFunc)})}extractRowGroupCols(e,t){this.rowGroupCols=this.extractColsCommon(t,this.rowGroupCols,(i,s)=>i.setRowGroupActive(s,e),i=>i.rowGroupIndex,i=>i.initialRowGroupIndex,i=>i.rowGroup,i=>i.initialRowGroup)}extractPivotCols(e,t){this.pivotCols=this.extractColsCommon(t,this.pivotCols,(i,s)=>i.setPivotActive(s,e),i=>i.pivotIndex,i=>i.initialPivotIndex,i=>i.pivot,i=>i.initialPivot)}extractColsCommon(e=[],t=[],i,s,o,r,n){const l=[],a=[];(this.columnModel.getColDefCols()||[]).forEach(u=>{const g=e.indexOf(u)<0,p=u.getColDef(),f=_attrToBoolean(r(p)),m=_attrToBoolean(n(p)),C=_attrToNumber(s(p)),v=_attrToNumber(o(p));let w;f!==void 0?w=f:C!==void 0?C===null?w=!1:w=C>=0:g?m!==void 0?w=m:v!==void 0?w=v!=null&&v>=0:w=!1:w=t.indexOf(u)>=0,w&&((g?C!=null||v!=null:C!=null)?l.push(u):a.push(u))});const h=u=>{const g=s(u.getColDef()),p=o(u.getColDef());return g??p};l.sort((u,g)=>{const p=h(u),f=h(g);return p===f?0:p<f?-1:1});const c=[].concat(l);return t.forEach(u=>{a.indexOf(u)>=0&&c.push(u)}),a.forEach(u=>{c.indexOf(u)<0&&c.push(u)}),t.forEach(u=>{c.indexOf(u)<0&&i(u,!1)}),c.forEach(u=>{t.indexOf(u)<0&&i(u,!0)}),c}generateColumnStateForRowGroupAndPivotIndexes(e,t){const i={},s=(o,r,n,l,a,d)=>{const h=this.columnModel.getColDefCols();if(!r.length||!h)return[];const c=Object.keys(o),u=new Set(c),g=new Set(c),p=new Set(r.map(S=>{const R=S.getColId();return g.delete(R),R}).concat(c)),f=[],m={};let C=0;for(let S=0;S<h.length;S++){const R=h[S].getColId();p.has(R)&&(f.push(R),m[R]=C++)}let v=1e3,w=!1,y=0;const F=S=>{const R=m[S];for(let P=y;P<R;P++){const b=f[P];g.has(b)&&(o[b][a]=v++,g.delete(b))}y=R};r.forEach(S=>{const R=S.getColId();if(u.has(R))F(R),o[R][a]=v++;else{const P=S.getColDef();(P[a]===null||P[a]===void 0&&P[d]==null)&&(w||(P[n]||P[n]===void 0&&P[l]?F(R):(g.forEach(M=>{o[M][a]=v+m[M]}),v+=f.length,w=!0)),i[R]||(i[R]={colId:R}),i[R][a]=v++)}})};return s(e,this.rowGroupCols,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(t,this.pivotCols,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}},ColumnApplyStateService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnApplyStateService"}wireBeans(e){this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher,this.sortController=e.sortController,this.columnGetStateService=e.columnGetStateService,this.funcColsService=e.funcColsService,this.visibleColsService=e.visibleColsService,this.columnAnimationService=e.columnAnimationService,this.pivotResultColsService=e.pivotResultColsService}applyColumnState(e,t){const i=this.columnModel.getColDefCols()||[];if(_missingOrEmpty(i))return!1;if(e&&e.state&&!e.state.forEach)return _warnOnce("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."),!1;const s=this.funcColsService.getModifyColumnsNoEventsCallbacks(),o=(l,a,d)=>{const h=this.compareColumnStatesAndDispatchEvents(t),c=a.slice(),u={},g={},p=[],f=[];let m=0;const C=this.funcColsService.getRowGroupColumns().slice(),v=this.funcColsService.getPivotColumns().slice();l.forEach(S=>{const R=S.colId||"";if(R.startsWith(GROUP_AUTO_COLUMN_ID)){p.push(S),f.push(S);return}const b=d(R);b?(this.syncColumnWithStateItem(b,S,e.defaultState,u,g,!1,t,s),_removeFromArray(c,b)):(f.push(S),m+=1)});const w=S=>this.syncColumnWithStateItem(S,null,e.defaultState,u,g,!1,t,s);c.forEach(w),this.funcColsService.sortRowGroupColumns(comparatorByIndex.bind(this,u,C)),this.funcColsService.sortPivotColumns(comparatorByIndex.bind(this,g,v)),this.columnModel.refreshCols();const F=(this.columnModel.getAutoCols()||[]).slice();return p.forEach(S=>{const R=this.columnModel.getAutoCol(S.colId);_removeFromArray(F,R),this.syncColumnWithStateItem(R,S,e.defaultState,null,null,!0,t,s)}),F.forEach(w),this.orderLiveColsLikeState(e),this.visibleColsService.refresh(t),this.eventDispatcher.everythingChanged(t),h(),{unmatchedAndAutoStates:f,unmatchedCount:m}};this.columnAnimationService.start();let{unmatchedAndAutoStates:r,unmatchedCount:n}=o(e.state||[],i,l=>this.columnModel.getColDefCol(l));if(r.length>0||_exists(e.defaultState)){const a=this.pivotResultColsService.getPivotResultCols()?.list;n=o(r,a||[],d=>this.pivotResultColsService.getPivotResultCol(d)).unmatchedCount}return this.columnAnimationService.finish(),n===0}resetColumnState(e){const t=this.columnModel.getColDefCols();if(_missingOrEmpty(t))return;const i=this.columnModel.getColDefColTree(),s=getColumnsFromTree(i),o=[];let r=1e3,n=1e3,l=[];const a=this.columnModel.getAutoCols();a&&(l=l.concat(a)),s&&(l=l.concat(s)),l.forEach(d=>{const h=this.getColumnStateFromColDef(d);_missing(h.rowGroupIndex)&&h.rowGroup&&(h.rowGroupIndex=r++),_missing(h.pivotIndex)&&h.pivot&&(h.pivotIndex=n++),o.push(h)}),this.applyColumnState({state:o,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(p,f)=>p??f??null,i=e.getColDef(),s=t(i.sort,i.initialSort),o=t(i.sortIndex,i.initialSortIndex),r=t(i.hide,i.initialHide),n=t(i.pinned,i.initialPinned),l=t(i.width,i.initialWidth),a=t(i.flex,i.initialFlex);let d=t(i.rowGroupIndex,i.initialRowGroupIndex),h=t(i.rowGroup,i.initialRowGroup);d==null&&(h==null||h==!1)&&(d=null,h=null);let c=t(i.pivotIndex,i.initialPivotIndex),u=t(i.pivot,i.initialPivot);c==null&&(u==null||u==!1)&&(c=null,u=null);const g=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:o,hide:r,pinned:n,width:l,flex:a,rowGroup:h,rowGroupIndex:d,pivot:u,pivotIndex:c,aggFunc:g}}syncColumnWithStateItem(e,t,i,s,o,r,n,l){if(!e)return;const a=(y,F)=>{const S={value1:void 0,value2:void 0};let R=!1;return t&&(t[y]!==void 0&&(S.value1=t[y],R=!0),_exists(F)&&t[F]!==void 0&&(S.value2=t[F],R=!0)),!R&&i&&(i[y]!==void 0&&(S.value1=i[y]),_exists(F)&&i[F]!==void 0&&(S.value2=i[F])),S},d=a("hide").value1;d!==void 0&&e.setVisible(!d,n);const h=a("pinned").value1;h!==void 0&&e.setPinned(h);const c=e.getColDef().minWidth??DEFAULT_COLUMN_MIN_WIDTH,u=a("flex").value1;if(u!==void 0&&e.setFlex(u),u==null){const y=a("width").value1;y!=null&&c!=null&&y>=c&&e.setActualWidth(y,n)}const g=a("sort").value1;g!==void 0&&(g==="desc"||g==="asc"?e.setSort(g,n):e.setSort(void 0,n));const p=a("sortIndex").value1;if(p!==void 0&&e.setSortIndex(p),r||!e.isPrimary())return;const f=a("aggFunc").value1;f!==void 0&&(typeof f=="string"?(e.setAggFunc(f),e.isValueActive()||(e.setValueActive(!0,n),l.addValueCol(e))):(_exists(f)&&_warnOnce("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."),e.isValueActive()&&(e.setValueActive(!1,n),l.removeValueCol(e))));const{value1:m,value2:C}=a("rowGroup","rowGroupIndex");(m!==void 0||C!==void 0)&&(typeof C=="number"||m?(e.isRowGroupActive()||(e.setRowGroupActive(!0,n),l.addGroupCol(e)),s&&typeof C=="number"&&(s[e.getId()]=C)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,n),l.removeGroupCol(e)));const{value1:v,value2:w}=a("pivot","pivotIndex");(v!==void 0||w!==void 0)&&(typeof w=="number"||v?(e.isPivotActive()||(e.setPivotActive(!0,n),l.addPivotCol(e)),o&&typeof w=="number"&&(o[e.getId()]=w)):e.isPivotActive()&&(e.setPivotActive(!1,n),l.removePivotCol(e)))}orderLiveColsLikeState(e){if(!e.applyOrder||!e.state)return;const t=[];e.state.forEach(i=>{i.colId!=null&&t.push(i.colId)}),this.columnModel.sortColsLikeKeys(t)}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.funcColsService.getRowGroupColumns().slice(),pivotColumns:this.funcColsService.getPivotColumns().slice(),valueColumns:this.funcColsService.getValueColumns().slice()},i=this.columnGetStateService.getColumnState(),s={};return i.forEach(o=>{s[o.colId]=o}),()=>{const o=this.columnModel.getAllCols(),r=(f,m,C,v)=>{const w=m.map(v),y=C.map(v);if(_areEqual(w,y))return;const S=new Set(m);C.forEach(b=>{S.delete(b)||S.add(b)});const R=[...S],P={type:f,columns:R,column:R.length===1?R[0]:null,source:e};this.eventService.dispatchEvent(P)},n=f=>{const m=[];return o.forEach(C=>{const v=s[C.getColId()];v&&f(v,C)&&m.push(C)}),m},l=f=>f.getColId();r("columnRowGroupChanged",t.rowGroupColumns,this.funcColsService.getRowGroupColumns(),l),r("columnPivotChanged",t.pivotColumns,this.funcColsService.getPivotColumns(),l);const d=n((f,m)=>{const C=f.aggFunc!=null,v=C!=m.isValueActive(),w=C&&f.aggFunc!=m.getAggFunc();return v||w});d.length>0&&this.eventDispatcher.columnChanged("columnValueChanged",d,e);const h=(f,m)=>f.width!=m.getActualWidth();this.eventDispatcher.columnResized(n(h),!0,e);const c=(f,m)=>f.pinned!=m.getPinned();this.eventDispatcher.columnPinned(n(c),e);const u=(f,m)=>f.hide==m.isVisible();this.eventDispatcher.columnVisible(n(u),e);const p=n((f,m)=>f.sort!=m.getSort()||f.sortIndex!=m.getSortIndex());p.length>0&&this.sortController.dispatchSortChangedEvents(e,p),this.normaliseColumnMovedEventForColumnState(i,e)}}normaliseColumnMovedEventForColumnState(e,t){const i=this.columnGetStateService.getColumnState(),s={};i.forEach(a=>s[a.colId]=a);const o={};e.forEach(a=>{s[a.colId]&&(o[a.colId]=!0)});const r=e.filter(a=>o[a.colId]),n=i.filter(a=>o[a.colId]),l=[];n.forEach((a,d)=>{const h=r&&r[d];if(h&&h.colId!==a.colId){const c=this.columnModel.getCol(h.colId);c&&l.push(c)}}),l.length&&this.eventDispatcher.columnMoved({movedColumns:l,source:t,finished:!0})}},comparatorByIndex=(e,t,i,s)=>{const o=e[i.getId()],r=e[s.getId()],n=o!=null,l=r!=null;if(n&&l)return o-r;if(n)return-1;if(l)return 1;const a=t.indexOf(i),d=t.indexOf(s),h=a>=0,c=d>=0;return h&&c?a-d:h?-1:1},ColumnMoveService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnMoveService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher}moveColumnByIndex(e,t,i){const s=this.columnModel.getCols();if(!s)return;const o=s[e];this.moveColumns([o],t,i)}moveColumns(e,t,i,s=!0){const o=this.columnModel.getCols();if(!o)return;if(this.columnAnimationService.start(),t>o.length-e.length){_warnOnce("tried to insert columns in invalid location, toIndex = ",t),_warnOnce("remember that you should not count the moving columns when calculating the new index");return}const r=this.columnModel.getColsForKeys(e);this.doesMovePassRules(r,t)&&(this.columnModel.moveInCols(r,t,i),this.eventDispatcher.columnMoved({movedColumns:r,source:i,toIndex:t,finished:s}),this.columnAnimationService.finish())}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!(!this.doesMovePassMarryChildren(e)||!this.doesMovePassLockedPositions(e))}getProposedColumnOrder(e,t){const s=this.columnModel.getCols().slice();return _moveInArray(s,e,t),s}doesMovePassLockedPositions(e){const t=r=>r?r==="left"||r===!0?-1:1:0,i=this.gos.get("enableRtl");let s=i?1:-1,o=!0;return e.forEach(r=>{const n=t(r.getColDef().lockPosition);i?n>s&&(o=!1):n<s&&(o=!1),s=n}),o}doesMovePassMarryChildren(e){let t=!0;const i=this.columnModel.getColTree();return depthFirstOriginalTreeSearch(null,i,s=>{if(!isProvidedColumnGroup(s))return;const o=s,r=o.getColGroupDef();if(!(r&&r.marryChildren))return;const l=[];o.getLeafColumns().forEach(u=>{const g=e.indexOf(u);l.push(g)});const a=Math.max.apply(Math,l),d=Math.min.apply(Math,l),h=a-d,c=o.getLeafColumns().length-1;h>c&&(t=!1)}),t}placeLockedColumns(e){const t=[],i=[],s=[];return e.forEach(r=>{const n=r.getColDef().lockPosition;n==="right"?s.push(r):n==="left"||n===!0?t.push(r):i.push(r)}),this.gos.get("enableRtl")?[...s,...i,...t]:[...t,...i,...s]}},reUnescapedHtml=/[&<>"']/g,HTML_ESCAPES={"&":"&","<":"<",">":">",'"':""","'":"'"};function _utf8_encode(e){const t=String.fromCharCode;function i(c){const u=[];if(!c)return[];const g=c.length;let p=0,f,m;for(;p<g;)f=c.charCodeAt(p++),f>=55296&&f<=56319&&p<g?(m=c.charCodeAt(p++),(m&64512)==56320?u.push(((f&1023)<<10)+(m&1023)+65536):(u.push(f),p--)):u.push(f);return u}function s(c){if(c>=55296&&c<=57343)throw Error("Lone surrogate U+"+c.toString(16).toUpperCase()+" is not a scalar value")}function o(c,u){return t(c>>u&63|128)}function r(c){if(!(c&4294967168))return t(c);let u="";return c&4294965248?c&4294901760?c&4292870144||(u=t(c>>18&7|240),u+=o(c,12),u+=o(c,6)):(s(c),u=t(c>>12&15|224),u+=o(c,6)):u=t(c>>6&31|192),u+=t(c&63|128),u}const n=i(e),l=n.length;let a=-1,d,h="";for(;++a<l;)d=n[a],h+=r(d);return h}function _capitalise(e){return e[0].toUpperCase()+e.substring(1).toLowerCase()}function _escapeString(e,t){if(e==null)return null;const i=e.toString().toString();return t?i:i.replace(reUnescapedHtml,s=>HTML_ESCAPES[s])}function _camelCaseToHumanText(e){if(!e||e==null)return null;const t=/([a-z])([A-Z])/g,i=/([A-Z]+)([A-Z])([a-z])/g;return e.replace(t,"$1 $2").replace(i,"$1 $2$3").replace(/\./g," ").split(" ").map(o=>o.substring(0,1).toUpperCase()+(o.length>1?o.substring(1,o.length):"")).join(" ")}function _camelCaseToHyphenated(e){return e.replace(/[A-Z]/g,t=>`-${t.toLocaleLowerCase()}`)}var ColumnNameService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnNameService"}wireBeans(e){this.expressionService=e.expressionService,this.funcColsService=e.funcColsService,this.columnModel=e.columnModel}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,i){const s=t?t.getColGroupDef():null;return s?this.getHeaderName(s,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,s,o){const r=e.headerValueGetter;if(r){const n=this.gos.addGridCommonParams({colDef:e,column:t,columnGroup:i,providedColumnGroup:s,location:o});return typeof r=="function"?r(n):typeof r=="string"?this.expressionService.evaluate(r,n):(_warnOnce("headerValueGetter must be a function or a string"),"")}else{if(e.headerName!=null)return e.headerName;if(e.field)return _camelCaseToHumanText(e.field)}return""}wrapHeaderNameWithAggFunc(e,t){if(this.gos.get("suppressAggFuncInHeader"))return t;const i=e.getColDef().pivotValueColumn,s=_exists(i);let o=null,r;if(s){const n=this.funcColsService.getValueColumns(),l=this.gos.get("removePivotHeaderRowWhenSingleValueColumn")&&n.length===1,a=e.getColDef().pivotTotalColumnIds!==void 0;if(l&&!a)return t;o=i?i.getAggFunc():null,r=!0}else{const n=e.isValueActive(),l=this.columnModel.isPivotMode()||!this.funcColsService.isRowGroupEmpty();n&&l?(o=e.getAggFunc(),r=!0):r=!1}if(r){const n=typeof o=="string"?o:"func";return`${this.localeService.getLocaleTextFunc()(n,n)}(${t})`}return t}},PivotResultColsService=class extends BeanStub{constructor(){super(...arguments),this.beanName="pivotResultColsService"}wireBeans(e){this.context=e.context,this.columnModel=e.columnModel,this.columnFactory=e.columnFactory,this.visibleColsService=e.visibleColsService}destroy(){destroyColumnTree(this.context,this.pivotResultCols?.tree),super.destroy()}isPivotResultColsPresent(){return this.pivotResultCols!=null}lookupPivotResultCol(e,t){if(this.pivotResultCols==null)return null;const i=this.columnModel.getColDefCol(t);let s=null;return this.pivotResultCols.list.forEach(o=>{const r=o.getColDef().pivotKeys,n=o.getColDef().pivotValueColumn;_areEqual(r,e)&&n===i&&(s=o)}),s}getPivotResultCols(){return this.pivotResultCols}getPivotResultCol(e){return this.pivotResultCols?this.columnModel.getColFromCollection(e,this.pivotResultCols):null}setPivotResultCols(e,t){if(this.columnModel.isReady()&&!(e==null&&this.pivotResultCols==null)){if(e){this.processPivotResultColDef(e);const i=this.columnFactory.createColumnTree(e,!1,this.pivotResultCols?.tree||this.previousPivotResultCols||void 0,t);destroyColumnTree(this.context,this.pivotResultCols?.tree,i.columnTree);const s=i.columnTree,o=i.treeDept,r=getColumnsFromTree(s),n={};this.pivotResultCols={tree:s,treeDepth:o,list:r,map:n},this.pivotResultCols.list.forEach(l=>this.pivotResultCols.map[l.getId()]=l),this.previousPivotResultCols=null}else this.previousPivotResultCols=this.pivotResultCols?this.pivotResultCols.tree:null,this.pivotResultCols=null;this.columnModel.refreshCols(),this.visibleColsService.refresh(t)}}processPivotResultColDef(e){const t=this.gos.get("processPivotResultColDef"),i=this.gos.get("processPivotResultColGroupDef");if(!t&&!i)return;const s=o=>{o.forEach(r=>{if(_exists(r.children)){const l=r;i&&i(l),s(l.children)}else t&&t(r)})};e&&s(e)}},ColumnSizeService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnSizeService"}wireBeans(e){this.columnModel=e.columnModel,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}setColumnWidths(e,t,i,s){const o=[];e.forEach(r=>{const n=this.columnModel.getColDefCol(r.key)||this.columnModel.getCol(r.key);if(!n)return;if(o.push({width:r.newWidth,ratios:[1],columns:[n]}),this.gos.get("colResizeDefault")==="shift"&&(t=!t),t){const a=this.visibleColsService.getColAfter(n);if(!a)return;const d=n.getActualWidth()-r.newWidth,h=a.getActualWidth()+d;o.push({width:h,ratios:[1],columns:[a]})}}),o.length!==0&&this.resizeColumnSets({resizeSets:o,finished:i,source:s})}resizeColumnSets(e){const{resizeSets:t,finished:i,source:s}=e;if(!(!t||t.every(h=>this.checkMinAndMaxWidthsForSet(h)))){if(i){const h=t&&t.length>0?t[0].columns:null;this.eventDispatcher.columnResized(h,i,s)}return}const r=[],n=[];t.forEach(h=>{const{width:c,columns:u,ratios:g}=h,p={},f={};u.forEach(v=>n.push(v));let m=!0,C=0;for(;m;){if(C++,C>1e3){_errorOnce("infinite loop in resizeColumnSets");break}m=!1;const v=[];let w=0,y=c;u.forEach((S,R)=>{if(f[S.getId()])y-=p[S.getId()];else{v.push(S);const b=g[R];w+=b}});const F=1/w;v.forEach((S,R)=>{const P=R===v.length-1;let b;P?b=y:(b=Math.round(g[R]*c*F),y-=b);const x=S.getMinWidth(),M=S.getMaxWidth();b<x?(b=x,f[S.getId()]=!0,m=!0):M>0&&b>M&&(b=M,f[S.getId()]=!0,m=!0),p[S.getId()]=b})}u.forEach(v=>{const w=p[v.getId()];v.getActualWidth()!==w&&(v.setActualWidth(w,s),r.push(v))})});const l=r.length>0;let a=[];l&&(a=this.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0}),this.visibleColsService.setLeftValues(s),this.visibleColsService.updateBodyWidths(),this.columnViewportService.checkViewportColumns());const d=n.concat(a);(l||i)&&this.eventDispatcher.columnResized(d,i,s,a)}checkMinAndMaxWidthsForSet(e){const{columns:t,width:i}=e;let s=0,o=0,r=!0;t.forEach(a=>{const d=a.getMinWidth();s+=d||0;const h=a.getMaxWidth();h>0?o+=h:r=!1});const n=i>=s,l=!r||i<=o;return n&&l}refreshFlexedColumns(e={}){const t=e.source?e.source:"flex";if(e.viewportWidth!=null&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];const i=this.visibleColsService.getCenterCols();let s=-1;if(e.resizingCols){const u=new Set(e.resizingCols);for(let g=i.length-1;g>=0;g--)if(u.has(i[g])){s=g;break}}let o=0,r=[],n=0,l=0;for(let u=0;u<i.length;u++)i[u].getFlex()&&u>s?(r.push(i[u]),l+=i[u].getFlex(),n+=i[u].getMinWidth()):o+=i[u].getActualWidth();if(!r.length)return[];let a=[];o+n>this.flexViewportWidth&&(r.forEach(u=>u.setActualWidth(u.getMinWidth(),t)),a=r,r=[]);const d=[];let h;e:for(;;){h=this.flexViewportWidth-o;const u=h/l;for(let g=0;g<r.length;g++){const p=r[g],f=u*p.getFlex();let m=0;const C=p.getMinWidth(),v=p.getMaxWidth();if(f<C?m=C:f>v&&(m=v),m){p.setActualWidth(m,t),_removeFromUnorderedArray(r,p),l-=p.getFlex(),a.push(p),o+=p.getActualWidth();continue e}d[g]=Math.round(f)}break}let c=h;return r.forEach((u,g)=>{u.setActualWidth(Math.min(d[g],c),t),a.push(u),c-=d[g]}),e.skipSetLeft||this.visibleColsService.setLeftValues(t),e.updateBodyWidths&&this.visibleColsService.updateBodyWidths(),e.fireResizedEvent&&this.eventDispatcher.columnResized(a,!0,t,r),r}sizeColumnsToFit(e,t="sizeColumnsToFit",i,s){if(this.columnModel.isShouldQueueResizeOperations()){this.columnModel.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,i,s));return}const o={};s&&s?.columnLimits?.forEach(({key:u,...g})=>{o[typeof u=="string"?u:u.getColId()]=g});const r=this.visibleColsService.getAllCols(),n=e===getWidthOfColsInList(r);if(e<=0||!r.length||n)return;const l=[],a=[];r.forEach(u=>{u.getColDef().suppressSizeToFit===!0?a.push(u):l.push(u)});const d=l.slice(0);let h=!1;const c=u=>{_removeFromArray(l,u),a.push(u)};for(l.forEach(u=>{u.resetActualWidth(t);const g=o?.[u.getId()],p=g?.minWidth??s?.defaultMinWidth,f=g?.maxWidth??s?.defaultMaxWidth,m=u.getActualWidth();typeof p=="number"&&m<p?u.setActualWidth(p,t,!0):typeof f=="number"&&m>f&&u.setActualWidth(f,t,!0)});!h;){h=!0;const u=e-getWidthOfColsInList(a);if(u<=0)l.forEach(g=>{const p=o?.[g.getId()]?.minWidth??s?.defaultMinWidth;if(typeof p=="number"){g.setActualWidth(p,t,!0);return}g.setMinimum(t)});else{const g=u/getWidthOfColsInList(l);let p=u;for(let f=l.length-1;f>=0;f--){const m=l[f],C=o?.[m.getId()],v=C?.minWidth??s?.defaultMinWidth,w=C?.maxWidth??s?.defaultMaxWidth,y=m.getMinWidth(),F=m.getMaxWidth(),S=typeof v=="number"&&v>y?v:y,R=typeof w=="number"&&w<F?w:F;let P=Math.round(m.getActualWidth()*g);P<S?(P=S,c(m),h=!1):P>R?(P=R,c(m),h=!1):f===0&&(P=p),m.setActualWidth(P,t,!0),p-=P}}}d.forEach(u=>{u.fireColumnWidthChangedEvent(t)}),this.visibleColsService.setLeftValues(t),this.visibleColsService.updateBodyWidths(),!i&&this.eventDispatcher.columnResized(d,!0,t)}applyAutosizeStrategy(){const e=this.gos.get("autoSizeStrategy");if(!e)return;const{type:t}=e;setTimeout(()=>{if(t==="fitGridWidth"){const{columnLimits:i,defaultMinWidth:s,defaultMaxWidth:o}=e,r=i?.map(({colId:n,minWidth:l,maxWidth:a})=>({key:n,minWidth:l,maxWidth:a}));this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({defaultMinWidth:s,defaultMaxWidth:o,columnLimits:r})}else t==="fitProvidedWidth"&&this.sizeColumnsToFit(e.width,"sizeColumnsToFit")})}};function createUniqueColumnGroupId(e,t){return e+"_"+t}function isColumnGroup(e){return e instanceof AgColumnGroup}var AgColumnGroup=class extends BeanStub{constructor(e,t,i,s){super(),this.isColumn=!1,this.displayedChildren=[],this.parent=null,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=s}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return createUniqueColumnGroupId(this.groupId,this.partId)}isEmptyGroup(){return this.displayedChildren.length===0}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!e||e.length===0?!1:e.every(t=>t.isMoving())}checkLeft(){if(this.displayedChildren.forEach(e=>{isColumnGroup(e)&&e.checkLeft()}),this.displayedChildren.length>0)if(this.gos.get("enableRtl")){const t=_last(this.displayedChildren).getLeft();this.setLeft(t)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.dispatchLocalEvent({type:"leftChanged"}))}getPinned(){return this.pinned}getGroupId(){return this.groupId}getPartId(){return this.partId}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach(t=>{e+=t.getActualWidth()}),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach(t=>{t.isResizable()&&(e=!0)}),e}getMinWidth(){let e=0;return this.displayedChildren.forEach(t=>{e+=t.getMinWidth()}),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}addDisplayedLeafColumns(e){this.displayedChildren.forEach(t=>{isColumn(t)?e.push(t):isColumnGroup(t)&&t.addDisplayedLeafColumns(e)})}addLeafColumns(e){this.children.forEach(t=>{isColumn(t)?e.push(t):isColumnGroup(t)&&t.addLeafColumns(e)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return!this.isPadding()||!e||!e.isPadding()?0:1+e.getPaddingLevel()}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;e!=null&&e.isPadding();)e=e.getParent();if(!(e?e.getProvidedColumnGroup().isExpandable():!1)){this.displayedChildren=this.children,this.dispatchLocalEvent({type:"displayedChildrenChanged"});return}this.children.forEach(i=>{if(isColumnGroup(i)&&(!i.displayedChildren||!i.displayedChildren.length))return;switch(i.getColumnGroupShow()){case"open":e.getProvidedColumnGroup().isExpanded()&&this.displayedChildren.push(i);break;case"closed":e.getProvidedColumnGroup().isExpanded()||this.displayedChildren.push(i);break;default:this.displayedChildren.push(i);break}}),this.dispatchLocalEvent({type:"displayedChildrenChanged"})}},GroupInstanceIdCreator=class{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return typeof t!="number"?i=0:i=t+1,this.existingIds[e]=i,i}},VisibleColsService=class extends BeanStub{constructor(){super(...arguments),this.beanName="visibleColsService",this.colsAndGroupsMap={},this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.columnViewportService=e.columnViewportService,this.eventDispatcher=e.columnEventDispatcher}refresh(e,t=!1){t||this.buildTrees(),this.updateOpenClosedVisibilityInColumnGroups(),this.columnsLeft=pickDisplayedCols(this.treeLeft),this.columnsCenter=pickDisplayedCols(this.treeCenter),this.columnsRight=pickDisplayedCols(this.treeRight),this.joinColsAriaOrder(),this.joinCols(),this.setLeftValues(e),this.autoHeightCols=this.columns.filter(i=>i.isAutoHeight()),this.columnSizeService.refreshFlexedColumns(),this.updateBodyWidths(),this.columnViewportService.checkViewportColumns(!1),this.setFirstRightAndLastLeftPinned(e),this.eventDispatcher.visibleCols()}updateBodyWidths(){const e=getWidthOfColsInList(this.columnsCenter),t=getWidthOfColsInList(this.columnsLeft),i=getWidthOfColsInList(this.columnsRight);if(this.bodyWidthDirty=this.bodyWidth!==e,this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i){this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i;const o={type:"columnContainerWidthChanged"};this.eventService.dispatchEvent(o);const r={type:"displayedColumnsWidthChanged"};this.eventService.dispatchEvent(r)}}setLeftValues(e){this.setLeftValuesOfCols(e),this.setLeftValuesOfGroups()}setFirstRightAndLastLeftPinned(e){let t,i;this.gos.get("enableRtl")?(t=this.columnsLeft?this.columnsLeft[0]:null,i=this.columnsRight?_last(this.columnsRight):null):(t=this.columnsLeft?_last(this.columnsLeft):null,i=this.columnsRight?this.columnsRight[0]:null),this.columnModel.getCols().forEach(s=>{s.setLastLeftPinned(s===t,e),s.setFirstRightPinned(s===i,e)})}buildTrees(){const e=this.columnModel.getColsToShow(),t=e.filter(r=>r.getPinned()=="left"),i=e.filter(r=>r.getPinned()=="right"),s=e.filter(r=>r.getPinned()!="left"&&r.getPinned()!="right"),o=new GroupInstanceIdCreator;this.treeLeft=this.createGroups({columns:t,idCreator:o,pinned:"left",oldDisplayedGroups:this.treeLeft}),this.treeRight=this.createGroups({columns:i,idCreator:o,pinned:"right",oldDisplayedGroups:this.treeRight}),this.treeCenter=this.createGroups({columns:s,idCreator:o,pinned:null,oldDisplayedGroups:this.treeCenter}),this.updateColsAndGroupsMap()}clear(){this.columnsLeft=[],this.columnsRight=[],this.columnsCenter=[],this.columns=[],this.ariaOrderColumns=[]}joinColsAriaOrder(){const e=this.columnModel.getCols(),t=[],i=[],s=[];for(const o of e){const r=o.getPinned();r?r===!0||r==="left"?t.push(o):s.push(o):i.push(o)}this.ariaOrderColumns=t.concat(i).concat(s)}getAriaColIndex(e){let t;return isColumnGroup(e)?t=e.getLeafColumns()[0]:t=e,this.ariaOrderColumns.indexOf(t)+1}getAllAutoHeightCols(){return this.autoHeightCols}setLeftValuesOfGroups(){[this.treeLeft,this.treeRight,this.treeCenter].forEach(e=>{e.forEach(t=>{isColumnGroup(t)&&t.checkLeft()})})}setLeftValuesOfCols(e){if(!this.columnModel.getColDefCols())return;const i=this.columnModel.getCols().slice(0),s=this.gos.get("enableRtl");[this.columnsLeft,this.columnsRight,this.columnsCenter].forEach(o=>{if(s){let r=getWidthOfColsInList(o);o.forEach(n=>{r-=n.getActualWidth(),n.setLeft(r,e)})}else{let r=0;o.forEach(n=>{n.setLeft(r,e),r+=n.getActualWidth()})}_removeAllFromUnorderedArray(i,o)}),i.forEach(o=>{o.setLeft(null,e)})}joinCols(){this.gos.get("enableRtl")?this.columns=this.columnsRight.concat(this.columnsCenter).concat(this.columnsLeft):this.columns=this.columnsLeft.concat(this.columnsCenter).concat(this.columnsRight)}getColsCenter(){return this.columnsCenter}getAllTrees(){return this.treeLeft&&this.treeRight&&this.treeCenter?this.treeLeft.concat(this.treeCenter).concat(this.treeRight):null}getTreeLeft(){return this.treeLeft}getTreeRight(){return this.treeRight}getTreeCenter(){return this.treeCenter}getAllCols(){return this.columns}isColDisplayed(e){return this.getAllCols().indexOf(e)>=0}getLeftColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsLeft):this.columnsLeft}getRightColsForRow(e){return this.columnModel.isColSpanActive()?this.getColsForRow(e,this.columnsRight):this.columnsRight}getColsForRow(e,t,i,s){const o=[];let r=null;for(let n=0;n<t.length;n++){const l=t[n],a=t.length-n,d=Math.min(l.getColSpan(e),a),h=[l];if(d>1){const u=d-1;for(let g=1;g<=u;g++)h.push(t[n+g]);n+=u}let c;i?(c=!1,h.forEach(u=>{i(u)&&(c=!0)})):c=!0,c&&(o.length===0&&r&&(s&&s(l))&&o.push(r),o.push(l)),r=l}return o}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}getCenterCols(){return this.columnsCenter}getLeftCols(){return this.columnsLeft}getRightCols(){return this.columnsRight}getColBefore(e){const t=this.getAllCols(),i=t.indexOf(e);return i>0?t[i-1]:null}getGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),s=e.getDisplayedLeafColumns(),o=t==="After"?_last(s):s[0],r=`getCol${t}`;for(;;){const n=this[r](o);if(!n)return null;const l=this.getColGroupAtLevel(n,i);if(l!==e)return l}}getColGroupAtLevel(e,t){let i=e.getParent(),s,o;for(;s=i.getProvidedColumnGroup().getLevel(),o=i.getPaddingLevel(),!(s+o<=t);)i=i.getParent();return i}isPinningLeft(){return this.columnsLeft.length>0}isPinningRight(){return this.columnsRight.length>0}updateColsAndGroupsMap(){this.colsAndGroupsMap={};const e=t=>{this.colsAndGroupsMap[t.getUniqueId()]=t};depthFirstAllColumnTreeSearch(this.treeCenter,!1,e),depthFirstAllColumnTreeSearch(this.treeLeft,!1,e),depthFirstAllColumnTreeSearch(this.treeRight,!1,e)}isVisible(e){return this.colsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){const e=this.getAllTrees();depthFirstAllColumnTreeSearch(e,!1,t=>{isColumnGroup(t)&&t.calculateDisplayedColumns()})}getFirstColumn(){const e=this.gos.get("enableRtl"),t=["getLeftCols","getCenterCols","getRightCols"];e&&t.reverse();for(let i=0;i<t.length;i++){const s=this[t[i]]();if(s.length)return e?_last(s):s[0]}return null}getColumnGroup(e,t){if(!e)return null;if(isColumnGroup(e))return e;const i=this.getAllTrees(),s=typeof t=="number";let o=null;return depthFirstAllColumnTreeSearch(i,!1,r=>{if(isColumnGroup(r)){const n=r;let l;s?l=e===n.getGroupId()&&t===n.getPartId():l=e===n.getGroupId(),l&&(o=n)}}),o}getColAfter(e){const t=this.getAllCols(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}isBodyWidthDirty(){return this.bodyWidthDirty}setBodyWidthDirty(){this.bodyWidthDirty=!0}getColsLeftWidth(){return getWidthOfColsInList(this.columnsLeft)}getDisplayedColumnsRightWidth(){return getWidthOfColsInList(this.columnsRight)}isColAtEdge(e,t){const i=this.getAllCols();if(!i.length)return!1;const s=t==="first";let o;if(isColumnGroup(e)){const r=e.getDisplayedLeafColumns();if(!r.length)return!1;o=s?r[0]:_last(r)}else o=e;return(s?i[0]:_last(i))===o}createGroups(e){const{columns:t,idCreator:i,pinned:s,oldDisplayedGroups:o,isStandaloneStructure:r}=e,n=this.mapOldGroupsById(o),l=[];let a=t;for(;a.length;){const d=a;a=[];let h=0;const c=u=>{const g=h;h=u;const p=d[g],m=(isColumnGroup(p)?p.getProvidedColumnGroup():p).getOriginalParent();if(m==null){for(let v=g;v<u;v++)l.push(d[v]);return}const C=this.createColGroup(m,i,n,s,r);for(let v=g;v<u;v++)C.addChild(d[v]);a.push(C)};for(let u=1;u<d.length;u++){const g=d[u],f=(isColumnGroup(g)?g.getProvidedColumnGroup():g).getOriginalParent(),m=d[h],v=(isColumnGroup(m)?m.getProvidedColumnGroup():m).getOriginalParent();f!==v&&c(u)}h<d.length&&c(d.length)}return r||this.setupParentsIntoCols(l,null),l}createColGroup(e,t,i,s,o){const r=e.getGroupId(),n=t.getInstanceIdForKey(r),l=createUniqueColumnGroupId(r,n);let a=i[l];return a&&a.getProvidedColumnGroup()!==e&&(a=null),_exists(a)?a.reset():(a=new AgColumnGroup(e,r,n,s),o||this.createBean(a)),a}mapOldGroupsById(e){const t={},i=s=>{s.forEach(o=>{if(isColumnGroup(o)){const r=o;t[o.getUniqueId()]=r,i(r.getChildren())}})};return e&&i(e),t}setupParentsIntoCols(e,t){e.forEach(i=>{if(i.setParent(t),isColumnGroup(i)){const s=i;this.setupParentsIntoCols(s.getChildren(),s)}})}};function depthFirstAllColumnTreeSearch(e,t,i){if(e)for(let s=0;s<e.length;s++){const o=e[s];if(isColumnGroup(o)){const r=t?o.getDisplayedChildren():o.getChildren();depthFirstAllColumnTreeSearch(r,t,i)}i(o)}}function pickDisplayedCols(e){const t=[];return depthFirstAllColumnTreeSearch(e,!0,i=>{isColumn(i)&&t.push(i)}),t}var PUBLIC_EVENTS=["columnEverythingChanged","newColumnsLoaded","columnPivotModeChanged","pivotMaxColumnsExceeded","columnRowGroupChanged","expandOrCollapseAll","columnPivotChanged","gridColumnsChanged","columnValueChanged","columnMoved","columnVisible","columnPinned","columnGroupOpened","columnResized","displayedColumnsChanged","virtualColumnsChanged","columnHeaderMouseOver","columnHeaderMouseLeave","columnHeaderClicked","columnHeaderContextMenu","asyncTransactionsFlushed","rowGroupOpened","rowDataUpdated","pinnedRowDataChanged","rangeSelectionChanged","chartCreated","chartRangeSelectionChanged","chartOptionsChanged","chartDestroyed","toolPanelVisibleChanged","toolPanelSizeChanged","modelUpdated","cutStart","cutEnd","pasteStart","pasteEnd","fillStart","fillEnd","rangeDeleteStart","rangeDeleteEnd","undoStarted","undoEnded","redoStarted","redoEnded","cellClicked","cellDoubleClicked","cellMouseDown","cellContextMenu","cellValueChanged","cellEditRequest","rowValueChanged","headerFocused","cellFocused","rowSelected","selectionChanged","tooltipShow","tooltipHide","cellKeyDown","cellMouseOver","cellMouseOut","filterChanged","filterModified","filterOpened","advancedFilterBuilderVisibleChanged","sortChanged","virtualRowRemoved","rowClicked","rowDoubleClicked","gridReady","gridPreDestroyed","gridSizeChanged","viewportChanged","firstDataRendered","dragStarted","dragStopped","rowEditingStarted","rowEditingStopped","cellEditingStarted","cellEditingStopped","bodyScroll","bodyScrollEnd","paginationChanged","componentStateChanged","storeRefreshed","stateUpdated","columnMenuVisibleChanged","contextMenuVisibleChanged","rowDragEnter","rowDragMove","rowDragLeave","rowDragEnd"],INTERNAL_EVENTS=["scrollbarWidthChanged","keyShortcutChangedCellStart","keyShortcutChangedCellEnd","pinnedHeightChanged","cellFocusCleared","fullWidthRowFocused","checkboxChanged","heightScaleChanged","suppressMovableColumns","suppressMenuHide","suppressFieldDotNotation","columnPanelItemDragStart","columnPanelItemDragEnd","bodyHeightChanged","columnContainerWidthChanged","displayedColumnsWidthChanged","scrollVisibilityChanged","columnHoverChanged","flashCells","paginationPixelOffsetChanged","displayedRowsChanged","leftPinnedWidthChanged","rightPinnedWidthChanged","rowContainerHeightChanged","headerHeightChanged","columnHeaderHeightChanged","gridStylesChanged","storeUpdated","filterDestroyed","rowDataUpdateStarted","rowCountReady","advancedFilterEnabledChanged","dataTypesInferred","fieldValueChanged","fieldPickerValueSelected","richSelectListRowSelected","sideBarUpdated","alignedGridScroll","alignedGridColumn","gridOptionsChanged","chartTitleEdit","recalculateRowBounds","stickyTopOffsetChanged"],ALL_EVENTS=[...PUBLIC_EVENTS,...INTERNAL_EVENTS],INITIAL_GRID_OPTION_KEYS={enableBrowserTooltips:!0,tooltipTrigger:!0,tooltipMouseTrack:!0,tooltipShowMode:!0,tooltipInteraction:!0,defaultColGroupDef:!0,suppressAutoSize:!0,skipHeaderOnAutoSize:!0,autoSizeStrategy:!0,components:!0,stopEditingWhenCellsLoseFocus:!0,undoRedoCellEditing:!0,undoRedoCellEditingLimit:!0,excelStyles:!0,cacheQuickFilter:!0,advancedFilterModel:!0,customChartThemes:!0,chartThemeOverrides:!0,chartToolPanelsDef:!0,loadingCellRendererSelector:!0,localeText:!0,keepDetailRows:!0,keepDetailRowsCount:!0,detailRowHeight:!0,detailRowAutoHeight:!0,tabIndex:!0,valueCache:!0,valueCacheNeverExpires:!0,enableCellExpressions:!0,suppressTouch:!0,suppressAsyncEvents:!0,suppressBrowserResizeObserver:!0,suppressPropertyNamesCheck:!0,debug:!0,loadingOverlayComponent:!0,suppressLoadingOverlay:!0,noRowsOverlayComponent:!0,paginationPageSizeSelector:!0,paginateChildRows:!0,pivotPanelShow:!0,pivotSuppressAutoColumn:!0,suppressExpandablePivotGroups:!0,aggFuncs:!0,suppressAggFuncInHeader:!0,removePivotHeaderRowWhenSingleValueColumn:!0,allowShowChangeAfterFilter:!0,ensureDomOrder:!0,enableRtl:!0,suppressColumnVirtualisation:!0,suppressMaxRenderedRowRestriction:!0,suppressRowVirtualisation:!0,rowDragText:!0,suppressGroupMaintainValueType:!0,groupLockGroupColumns:!0,rowGroupPanelSuppressSort:!0,suppressGroupRowsSticky:!0,rowModelType:!0,cacheOverflowSize:!0,infiniteInitialRowCount:!0,serverSideInitialRowCount:!0,suppressServerSideInfiniteScroll:!0,maxBlocksInCache:!0,maxConcurrentDatasourceRequests:!0,blockLoadDebounceMillis:!0,serverSideOnlyRefreshFilteredGroups:!0,serverSidePivotResultFieldSeparator:!0,viewportRowModelPageSize:!0,viewportRowModelBufferSize:!0,debounceVerticalScrollbar:!0,suppressAnimationFrame:!0,suppressPreventDefaultOnMouseWheel:!0,scrollbarWidth:!0,icons:!0,suppressRowTransform:!0,gridId:!0,enableGroupEdit:!0,initialState:!0,processUnpinnedColumns:!0,createChartContainer:!0,getLocaleText:!0,getRowId:!0,reactiveCustomComponents:!0,columnMenu:!0},_PropertyKeys=class{};_PropertyKeys.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator","columnMenu","tooltipShowMode","grandTotalRow"],_PropertyKeys.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","advancedFilterBuilderParams","initialState","autoSizeStrategy"],_PropertyKeys.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass","paginationPageSizeSelector"],_PropertyKeys.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","groupLockGroupColumns","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","cellFlashDuration","cellFadeDuration","tabIndex","pivotMaxGeneratedColumns"],_PropertyKeys.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHeaderFocus","suppressHorizontalScroll","groupSelectsChildren","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressFocusAfterRefresh","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","includeHiddenColumnsInAdvancedFilter","suppressMultiRangeSelection","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideSortAllLevels","serverSideEnableClientSideSort","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","maintainColumnOrder","groupMaintainOrder","columnHoverHighlight","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressCutToClipboard","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","enableAdvancedFilter","masterDetail","treeData","suppressGroupMaintainValueType","reactiveCustomComponents","applyQuickFilterBeforePivotOrAgg","suppressServerSideFullWidthLoadingRow","suppressAdvancedFilterEval","loading"],_PropertyKeys.OTHER_PROPERTIES=["suppressStickyTotalRow"],_PropertyKeys.FUNCTION_PROPERTIES=["doesExternalFilterPass","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher","getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","focusGridInnerElement","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processUnpinnedColumns","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering","chartMenuItems","groupTotalRow"],_PropertyKeys.ALL_PROPERTIES=[..._PropertyKeys.ARRAY_PROPERTIES,..._PropertyKeys.OBJECT_PROPERTIES,..._PropertyKeys.STRING_PROPERTIES,..._PropertyKeys.NUMBER_PROPERTIES,..._PropertyKeys.FUNCTION_PROPERTIES,..._PropertyKeys.BOOLEAN_PROPERTIES,..._PropertyKeys.OTHER_PROPERTIES];var PropertyKeys=_PropertyKeys,_ComponentUtil=class{static getCallbackForEvent(t){return!t||t.length<2?t:"on"+t[0].toUpperCase()+t.substring(1)}};_ComponentUtil.VUE_OMITTED_PROPERTY="AG-VUE-OMITTED-PROPERTY",_ComponentUtil.PUBLIC_EVENTS=PUBLIC_EVENTS,_ComponentUtil.EVENT_CALLBACKS=ALL_EVENTS.map(e=>_ComponentUtil.getCallbackForEvent(e)),_ComponentUtil.BOOLEAN_PROPERTIES=PropertyKeys.BOOLEAN_PROPERTIES,_ComponentUtil.ALL_PROPERTIES=PropertyKeys.ALL_PROPERTIES,_ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS=[..._ComponentUtil.ALL_PROPERTIES,..._ComponentUtil.EVENT_CALLBACKS],_ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS_SET=new Set(_ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS);var ComponentUtil=_ComponentUtil;function _combineAttributesAndGridOptions(e,t){typeof e!="object"&&(e={});const i={...e};return ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS.forEach(o=>{const r=t[o];typeof r<"u"&&r!==ComponentUtil.VUE_OMITTED_PROPERTY&&(i[o]=r)}),i}function _processOnChange(e,t){if(!e)return;const i={};let s=!1;if(Object.keys(e).filter(n=>ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS_SET.has(n)).forEach(n=>{i[n]=e[n],s=!0}),!s)return;const o={type:"gridOptionsChanged",options:i};t.dispatchEvent(o);const r={type:"componentStateChanged"};_iterateObject(i,(n,l)=>{r[n]=l}),t.dispatchEvent(r)}var CssClassManager=class{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1){t.forEach(s=>this.addCssClass(s));return}if(this.cssClassStates[e]!==!0&&e.length){const s=this.getGui();s&&s.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1){t.forEach(s=>this.removeCssClass(s));return}if(this.cssClassStates[e]!==!1&&e.length){const s=this.getGui();s&&s.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return t?t.classList.contains(e):!1}addOrRemoveCssClass(e,t){if(!e)return;if(e.indexOf(" ")>=0){const s=(e||"").split(" ");if(s.length>1){s.forEach(o=>this.addOrRemoveCssClass(o,t));return}}if(this.cssClassStates[e]!==t&&e.length){const s=this.getGui();s&&s.classList.toggle(e,t),this.cssClassStates[e]=t}}};function _toggleAriaAttribute(e,t,i){i==null||typeof i=="string"&&i==""?_removeAriaAttribute(e,t):_setAriaAttribute(e,t,i)}function _setAriaAttribute(e,t,i){e.setAttribute(_ariaAttributeName(t),i.toString())}function _removeAriaAttribute(e,t){e.removeAttribute(_ariaAttributeName(t))}function _ariaAttributeName(e){return`aria-${e}`}function _setAriaRole(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function _getAriaSortState(e){let t;return e==="asc"?t="ascending":e==="desc"?t="descending":e==="mixed"?t="other":t="none",t}function _getAriaPosInSet(e){return parseInt(e.getAttribute("aria-posinset"),10)}function _getAriaLabel(e){return e.getAttribute("aria-label")}function _setAriaLabel(e,t){_toggleAriaAttribute(e,"label",t)}function _setAriaLabelledBy(e,t){_toggleAriaAttribute(e,"labelledby",t)}function _setAriaDescribedBy(e,t){_toggleAriaAttribute(e,"describedby",t)}function _setAriaLive(e,t){_toggleAriaAttribute(e,"live",t)}function _setAriaAtomic(e,t){_toggleAriaAttribute(e,"atomic",t)}function _setAriaRelevant(e,t){_toggleAriaAttribute(e,"relevant",t)}function _setAriaLevel(e,t){_toggleAriaAttribute(e,"level",t)}function _setAriaDisabled(e,t){_toggleAriaAttribute(e,"disabled",t)}function _setAriaHidden(e,t){_toggleAriaAttribute(e,"hidden",t)}function _setAriaActiveDescendant(e,t){_toggleAriaAttribute(e,"activedescendant",t)}function _setAriaExpanded(e,t){_setAriaAttribute(e,"expanded",t)}function _removeAriaExpanded(e){_removeAriaAttribute(e,"expanded")}function _setAriaSetSize(e,t){_setAriaAttribute(e,"setsize",t)}function _setAriaPosInSet(e,t){_setAriaAttribute(e,"posinset",t)}function _setAriaMultiSelectable(e,t){_setAriaAttribute(e,"multiselectable",t)}function _setAriaRowCount(e,t){_setAriaAttribute(e,"rowcount",t)}function _setAriaRowIndex(e,t){_setAriaAttribute(e,"rowindex",t)}function _setAriaColCount(e,t){_setAriaAttribute(e,"colcount",t)}function _setAriaColIndex(e,t){_setAriaAttribute(e,"colindex",t)}function _setAriaColSpan(e,t){_setAriaAttribute(e,"colspan",t)}function _setAriaSort(e,t){_setAriaAttribute(e,"sort",t)}function _removeAriaSort(e){_removeAriaAttribute(e,"sort")}function _setAriaSelected(e,t){_toggleAriaAttribute(e,"selected",t)}function _setAriaChecked(e,t){_setAriaAttribute(e,"checked",t===void 0?"mixed":t)}function _setAriaControls(e,t){_toggleAriaAttribute(e,"controls",t.id),_setAriaLabelledBy(t,e.id)}function _getAriaCheckboxStateName(e,t){return t===void 0?e("ariaIndeterminate","indeterminate"):t===!0?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}var isSafari,safariVersion,isChrome,isFirefox,isMacOs,isIOS,invisibleScrollbar,browserScrollbarWidth;function _isBrowserSafari(){return isSafari===void 0&&(isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),isSafari}function _getSafariVersion(){if(safariVersion===void 0)if(_isBrowserSafari()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(safariVersion=e[1]!=null?parseFloat(e[1]):0)}else safariVersion=0;return safariVersion}function _isBrowserChrome(){if(isChrome===void 0){const e=window;isChrome=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return isChrome}function _isBrowserFirefox(){return isFirefox===void 0&&(isFirefox=/(firefox)/i.test(navigator.userAgent)),isFirefox}function _isMacOsUserAgent(){return isMacOs===void 0&&(isMacOs=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),isMacOs}function _isIOSUserAgent(){return isIOS===void 0&&(isIOS=/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1),isIOS}function _browserSupportsPreventScroll(){return!_isBrowserSafari()||_getSafariVersion()>=15}function _getTabIndex(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return t===-1&&(i===null||i===""&&!_isBrowserFirefox())?null:t.toString()}function _getMaxDivHeight(){if(!document.body)return-1;let e=1e6;const t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const s=e*2;if(i.style.height=s+"px",s>t||i.clientHeight!==s)break;e=s}return document.body.removeChild(i),e}function _getBodyWidth(){return document.body?.clientWidth??(window.innerHeight||document.documentElement?.clientWidth||-1)}function _getBodyHeight(){return document.body?.clientHeight??(window.innerHeight||document.documentElement?.clientHeight||-1)}function _getScrollbarWidth(){return browserScrollbarWidth==null&&initScrollbarWidthAndVisibility(),browserScrollbarWidth}function initScrollbarWidthAndVisibility(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;i===0&&t.clientWidth===0&&(i=null),t.parentNode&&t.parentNode.removeChild(t),i!=null&&(browserScrollbarWidth=i,invisibleScrollbar=i===0)}function _isInvisibleScrollbar(){return invisibleScrollbar==null&&initScrollbarWidthAndVisibility(),invisibleScrollbar}var rtlNegativeScroll;function _radioCssClass(e,t,i){const s=e.parentElement;let o=s&&s.firstChild;for(;o;)t&&o.classList.toggle(t,o===e),i&&o.classList.toggle(i,o!==e),o=o.nextSibling}var FOCUSABLE_SELECTOR="[tabindex], input, select, button, textarea, [href]",FOCUSABLE_EXCLUDE="[disabled], .ag-disabled:not(.ag-button), .ag-disabled *";function _isFocusableFormField(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,s=t.call(e,"input, select, button, textarea"),o=t.call(e,FOCUSABLE_EXCLUDE),r=_isVisible(e);return s&&!o&&r}function _setDisplayed(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-hidden",!t),s||_setAriaHidden(e,!t)}function _setVisible(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-invisible",!t),s||_setAriaHidden(e,!t)}function _setDisabled(e,t){const i="disabled",s=t?o=>o.setAttribute(i,""):o=>o.removeAttribute(i);s(e),_nodeListForEach(e.querySelectorAll("input"),o=>s(o))}function _isElementChildOfClass(e,t,i){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,typeof i=="number"){if(++s>i)break}else if(e===i)break}return!1}function _getElementSize(e){const{height:t,width:i,borderTopWidth:s,borderRightWidth:o,borderBottomWidth:r,borderLeftWidth:n,paddingTop:l,paddingRight:a,paddingBottom:d,paddingLeft:h,marginTop:c,marginRight:u,marginBottom:g,marginLeft:p,boxSizing:f}=window.getComputedStyle(e);return{height:parseFloat(t||"0"),width:parseFloat(i||"0"),borderTopWidth:parseFloat(s||"0"),borderRightWidth:parseFloat(o||"0"),borderBottomWidth:parseFloat(r||"0"),borderLeftWidth:parseFloat(n||"0"),paddingTop:parseFloat(l||"0"),paddingRight:parseFloat(a||"0"),paddingBottom:parseFloat(d||"0"),paddingLeft:parseFloat(h||"0"),marginTop:parseFloat(c||"0"),marginRight:parseFloat(u||"0"),marginBottom:parseFloat(g||"0"),marginLeft:parseFloat(p||"0"),boxSizing:f}}function _getInnerHeight(e){const t=_getElementSize(e);return t.boxSizing==="border-box"?t.height-t.paddingTop-t.paddingBottom:t.height}function _getInnerWidth(e){const t=_getElementSize(e);return t.boxSizing==="border-box"?t.width-t.paddingLeft-t.paddingRight:t.width}function _getAbsoluteHeight(e){const{height:t,marginBottom:i,marginTop:s}=_getElementSize(e);return Math.floor(t+i+s)}function _getAbsoluteWidth(e){const{width:t,marginLeft:i,marginRight:s}=_getElementSize(e);return Math.floor(t+i+s)}function _getElementRectWithOffset(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:s,borderRightWidth:o,borderBottomWidth:r}=_getElementSize(e);return{top:t.top+(i||0),left:t.left+(s||0),right:t.right+(o||0),bottom:t.bottom+(r||0)}}function _isRtlNegativeScroll(){if(typeof rtlNegativeScroll=="boolean")return rtlNegativeScroll;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML=`<div style="width: 2px">
|
|
2
2
|
<span style="display: inline-block; width: 1px"></span>
|
|
3
3
|
<span style="display: inline-block; width: 1px"></span>
|
|
4
|
-
</div>`,document.body.appendChild(e),e.scrollLeft=1,rtlNegativeScroll=Math.floor(e.scrollLeft)===0,document.body.removeChild(e),rtlNegativeScroll}function _getScrollLeft(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),_isBrowserChrome()&&!_isRtlNegativeScroll()&&(i=e.scrollWidth-e.clientWidth-i)),i}function _setScrollLeft(e,t,i){i&&(_isRtlNegativeScroll()?t*=-1:(_isBrowserSafari()||_isBrowserChrome())&&(t=e.scrollWidth-e.clientWidth-t)),e.scrollLeft=t}function _clearElement(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function _removeFromParent(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function _isInDOM(e){return!!e.offsetParent}function _isVisible(e){const t=e;return t.checkVisibility?t.checkVisibility({checkVisibilityCSS:!0}):!(!_isInDOM(e)||window.getComputedStyle(e).visibility!=="visible")}function _loadTemplate(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function _ensureDomOrder(e,t,i){i&&i.nextSibling===t||(i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function _setDomChildOrder(e,t){for(let i=0;i<t.length;i++){const s=t[i],o=e.children[i];o!==s&&e.insertBefore(s,o)}}function _insertWithDomOrder(e,t,i){i?i.insertAdjacentElement("afterend",t):e.firstChild?e.insertAdjacentElement("afterbegin",t):e.appendChild(t)}function _addStylesToElement(e,t){if(t)for(const[i,s]of Object.entries(t)){if(!i||!i.length||s==null)continue;const o=_camelCaseToHyphenated(i),r=s.toString(),n=r.replace(/\s*!important/g,""),l=n.length!=r.length?"important":void 0;e.style.setProperty(o,n,l)}}function _isHorizontalScrollShowing(e){return e.clientWidth<e.scrollWidth}function _isVerticalScrollShowing(e){return e.clientHeight<e.scrollHeight}function _setElementWidth(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):_setFixedWidth(e,t)}function _setFixedWidth(e,t){t=_formatSize(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function _setFixedHeight(e,t){t=_formatSize(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function _formatSize(e){return typeof e=="number"?`${e}px`:e}function _isNodeOrElement(e){return e instanceof Node||e instanceof HTMLElement}function _copyNodeList(e){if(e==null)return[];const t=[];return _nodeListForEach(e,i=>t.push(i)),t}function _iterateNamedNodeMap(e,t){if(e)for(let i=0;i<e.length;i++){const s=e[i];t(s.name,s.value)}}function _addOrRemoveAttribute(e,t,i){i==null?e.removeAttribute(t):e.setAttribute(t,i.toString())}function _nodeListForEach(e,t){if(e!=null)for(let i=0;i<e.length;i++)t(e[i])}function _bindCellRendererToHtmlElement(e,t){e.then(i=>{const s=i.getGui();s!=null&&(typeof s=="object"?t.appendChild(s):t.innerHTML=s)})}var NumberSequence=class{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}},SHOW_QUICK_TOOLTIP_DIFF=1e3,FADE_OUT_TOOLTIP_TIMEOUT=1e3,INTERACTIVE_HIDE_DELAY=100,_TooltipStateManager=class A extends BeanStub{constructor(t,i,s,o){super(),this.parentComp=t,this.tooltipShowDelayOverride=i,this.tooltipHideDelayOverride=s,this.shouldDisplayTooltip=o,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(t){this.popupService=t.popupService,this.userComponentFactory=t.userComponentFactory}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const t=this.parentComp.getGui();this.tooltipTrigger===0&&this.addManagedListeners(t,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)}),this.tooltipTrigger===1&&this.addManagedListeners(t,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)}),this.addManagedListeners(t,{mousemove:this.onMouseMove.bind(this)}),this.interactionEnabled||this.addManagedListeners(t,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(t){const i=this.gos.get(t);return i<0&&_warnOnce(`${t} should not be lower than 0`),Math.max(200,i)}getTooltipDelay(t){return t==="show"?this.tooltipShowDelayOverride??this.getGridOptionsTooltipDelay("tooltipShowDelay"):this.tooltipHideDelayOverride??this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const t=this.gos.get("tooltipTrigger");return!t||t==="hover"?0:1}onMouseEnter(t){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),!_isIOSUserAgent()&&(A.isLocked?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(t)},INTERACTIVE_HIDE_DELAY):this.prepareToShowTooltip(t))}onMouseMove(t){this.lastMouseEvent&&(this.lastMouseEvent=t),this.tooltipMouseTrack&&this.state===2&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(t){const i=t.relatedTarget,s=this.parentComp.getGui(),o=this.tooltipComp?.getGui();this.isInteractingWithTooltip||s.contains(i)||this.interactionEnabled&&o?.contains(i)||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(t){if(this.state!=0||A.isLocked)return;let i=0;t&&(i=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),i),this.state=1}isLastTooltipHiddenRecently(){const t=new Date().getTime(),i=A.lastTooltipHideTime;return t-i<SHOW_QUICK_TOOLTIP_DIFF}setToDoNothing(){this.state===2&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const t={...this.parentComp.getTooltipParams()};if(!_exists(t.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip()){this.setToDoNothing();return}this.state=2,this.tooltipInstanceCount++;const i=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(t).newAgStackInstance().then(i)}hideTooltip(t){if(!t&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),A.lastTooltipHideTime=new Date().getTime());const i={type:"tooltipHide",parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(i),t&&(this.isInteractingWithTooltip=!1),this.state=0}newTooltipComponentCallback(t,i){if(this.state!==2||this.tooltipInstanceCount!==t){this.destroyBean(i);return}const o=i.getGui();this.tooltipComp=i,o.classList.contains("ag-tooltip")||o.classList.add("ag-tooltip-custom"),this.tooltipTrigger===0&&o.classList.add("ag-tooltip-animate"),this.interactionEnabled&&o.classList.add("ag-tooltip-interactive");const r=this.localeService.getLocaleTextFunc(),n=this.popupService.addPopup({eChild:o,ariaLabel:r("ariaLabelTooltip","Tooltip")});if(n&&(this.tooltipPopupDestroyFunc=n.hideFunc),this.positionTooltip(),this.tooltipTrigger===1){const a=this.setToDoNothing.bind(this);[this.onBodyScrollEventCallback,this.onColumnMovedEventCallback]=this.addManagedEventListeners({bodyScroll:a,columnMoved:a})}this.interactionEnabled&&(this.tooltipTrigger===0?[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(o,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}):[this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(o,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)}));const l={type:"tooltipShow",tooltipGui:o,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(l),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(t){const i=this.parentComp.getGui(),s=this.tooltipComp?.getGui(),o=t.relatedTarget;s?.contains(o)||(this.isInteractingWithTooltip=!1,i.contains(o)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const t={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent({...t,mouseEvent:this.lastMouseEvent}):this.popupService.positionPopupByComponent({...t,eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const t=this.tooltipPopupDestroyFunc,i=this.tooltipComp,s=this.tooltipTrigger===0?FADE_OUT_TOOLTIP_TIMEOUT:0;window.setTimeout(()=>{t(),this.destroyBean(i)},s),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach(t=>{t&&t()}),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){A.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},INTERACTIVE_HIDE_DELAY)}unlockService(){A.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}};_TooltipStateManager.isLocked=!1;var TooltipStateManager=_TooltipStateManager,TooltipFeature=class extends BeanStub{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}wireBeans(e){this.beans=e}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",i=this.ctrl.getGui();i&&(e!=null&&e!=""?i.setAttribute(t,e):i.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){if(this.tooltipManager!=null)return;const e={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new TooltipStateManager(e,this.ctrl.getTooltipShowDelayOverride?.(),this.ctrl.getTooltipHideDelayOverride?.(),this.ctrl.shouldDisplayTooltip),this.beans.context)}refreshToolTip(){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context))):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}getTooltipParams(){const e=this.ctrl,t=e.getColumn?e.getColumn():void 0,i=e.getColDef?e.getColDef():void 0,s=e.getRowNode?e.getRowNode():void 0;return{location:e.getLocation(),colDef:i,column:t,rowIndex:e.getRowIndex?e.getRowIndex():void 0,node:s,data:s?s.data:void 0,value:this.getTooltipText(),valueFormatted:e.getValueFormatted?e.getValueFormatted():void 0,hideTooltipCallback:()=>this.tooltipManager?.hideTooltip(!0)}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}},compIdSequence=new NumberSequence,RefPlaceholder=null,Component=class k extends BeanStub{constructor(t,i){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=compIdSequence.next(),this.cssClassManager=new CssClassManager(()=>this.eGui),this.componentSelectors=new Map((i??[]).map(s=>[s.selector,s])),t&&this.setTemplate(t)}preWireBeans(t){super.preWireBeans(t)}preConstruct(){this.usingBrowserTooltips=this.gos.get("enableBrowserTooltips"),this.wireTemplate(this.getGui())}wireTemplate(t,i){t&&this.gos&&(this.applyElementsToComponent(t),this.createChildComponentsFromTags(t,i))}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(t){const{newTooltipText:i,showDelayOverride:s,hideDelayOverride:o,location:r,shouldDisplayTooltip:n}=t||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==i&&(this.tooltipText=i);const l=()=>this.tooltipText;i!=null&&(this.tooltipFeature=this.createBean(new TooltipFeature({getTooltipValue:l,getGui:()=>this.getGui(),getLocation:()=>r??"UNKNOWN",getColDef:t?.getColDef,getColumn:t?.getColumn,getTooltipShowDelayOverride:s!=null?()=>s:void 0,getTooltipHideDelayOverride:o!=null?()=>o:void 0,shouldDisplayTooltip:n})))}applyElementsToComponent(t,i,s,o=null){if(i===void 0&&(i=t.getAttribute("data-ref")),i){const r=this[i];if(r===RefPlaceholder)this[i]=o??t;else{const n=s&&s[i];!this.suppressDataRefValidation&&!n&&_warnOnce(`Issue with data-ref: ${i} on ${this.constructor.name} with ${r}`)}}}createChildComponentsFromTags(t,i){_copyNodeList(t.childNodes).forEach(o=>{if(!(o instanceof HTMLElement))return;const r=this.createComponentFromElement(o,n=>{n.getGui()&&this.copyAttributesFromNode(o,n.getGui())},i);if(r){if(r.addItems&&o.children.length){this.createChildComponentsFromTags(o,i);const n=Array.prototype.slice.call(o.children);r.addItems(n)}this.swapComponentForNode(r,t,o)}else o.childNodes&&this.createChildComponentsFromTags(o,i)})}createComponentFromElement(t,i,s){const o=t.nodeName,r=t.getAttribute("data-ref"),n=o.indexOf("AG-")===0,l=n?this.componentSelectors.get(o):null;let a=null;if(l){k.elementGettingCreated=t;const d=s&&r?s[r]:void 0;a=new l.component(d),a.setParentComponent(this),this.createBean(a,null,i)}else n&&_warnOnce(`Missing selector: ${o}`);return this.applyElementsToComponent(t,r,s,a),a}copyAttributesFromNode(t,i){_iterateNamedNodeMap(t.attributes,(s,o)=>i.setAttribute(s,o))}swapComponentForNode(t,i,s){const o=t.getGui();i.replaceChild(o,s),i.insertBefore(document.createComment(s.nodeName),o),this.addDestroyFunc(this.destroyBean.bind(this,t))}activateTabIndex(t){const i=this.gos.get("tabIndex");t||(t=[]),t.length||t.push(this.getGui()),t.forEach(s=>s.setAttribute("tabindex",i.toString()))}setTemplate(t,i,s){const o=_loadTemplate(t);this.setTemplateFromElement(o,i,s)}setTemplateFromElement(t,i,s,o=!1){if(this.eGui=t,this.suppressDataRefValidation=o,i)for(let r=0;r<i.length;r++){const n=i[r];this.componentSelectors.set(n.selector,n)}this.wireTemplate(t,s)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(t){this.parentComponent=t}getParentComponent(){return this.parentComponent}setGui(t){this.eGui=t}queryForHtmlElement(t){return this.eGui.querySelector(t)}getContainerAndElement(t,i){let s=i;return t==null?null:(s||(s=this.eGui),_isNodeOrElement(t)?{element:t,parent:s}:{element:t.getGui(),parent:s})}prependChild(t,i){const{element:s,parent:o}=this.getContainerAndElement(t,i)||{};!s||!o||o.insertAdjacentElement("afterbegin",s)}appendChild(t,i){const{element:s,parent:o}=this.getContainerAndElement(t,i)||{};!s||!o||o.appendChild(s)}isDisplayed(){return this.displayed}setVisible(t,i={}){if(t!==this.visible){this.visible=t;const{skipAriaHidden:s}=i;_setVisible(this.eGui,t,{skipAriaHidden:s})}}setDisplayed(t,i={}){if(t!==this.displayed){this.displayed=t;const{skipAriaHidden:s}=i;_setDisplayed(this.eGui,t,{skipAriaHidden:s});const o={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(o)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}addGuiEventListener(t,i,s){this.eGui.addEventListener(t,i,s),this.addDestroyFunc(()=>this.eGui.removeEventListener(t,i))}addCssClass(t){this.cssClassManager.addCssClass(t)}removeCssClass(t){this.cssClassManager.removeCssClass(t)}containsCssClass(t){return this.cssClassManager.containsCssClass(t)}addOrRemoveCssClass(t,i){this.cssClassManager.addOrRemoveCssClass(t,i)}},iconNameClassMap={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",checkboxChecked:"checkbox-checked",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off"};function _createIcon(e,t,i){const s=_createIconNoSpan(e,t,i);if(s){const{className:r}=s;if(typeof r=="string"&&r.indexOf("ag-icon")>-1||typeof r=="object"&&r["ag-icon"])return s}const o=document.createElement("span");return o.appendChild(s),o}function _createIconNoSpan(e,t,i,s){let o=null;const r=i&&i.getColDef().icons;if(r&&(o=r[e]),t&&!o){const n=t.get("icons");n&&(o=n[e])}if(o){let n;if(typeof o=="function")n=o();else if(typeof o=="string")n=o;else throw new Error("icon from grid options needs to be a string or a function");if(typeof n=="string")return _loadTemplate(n);if(_isNodeOrElement(n))return n;_warnOnce("iconRenderer should return back a string or a dom object")}else{const n=document.createElement("span");let l=iconNameClassMap[e];return l||(s?l=e:(_warnOnce(`Did not find icon ${e}`),l="")),n.setAttribute("class",`ag-icon ag-icon-${l}`),n.setAttribute("unselectable","on"),_setAriaRole(n,"presentation"),n}}function _areEventsNear(e,t,i){if(i===0)return!1;const s=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(s,o)<=i}var TouchListener=class{constructor(e,t=!1){this.DOUBLE_TAP_MILLIS=500,this.destroyFuncs=[],this.touching=!1,this.localEventService=new LocalEventService,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),s=this.onTouchMove.bind(this),o=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",s,{passive:!0}),this.eElement.addEventListener("touchend",o,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",s,{passive:!0}),this.eElement.removeEventListener("touchend",o,{passive:!1})})}getActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}onTouchStart(e){if(this.touching)return;this.touchStart=e.touches[0],this.touching=!0,this.moved=!1;const t=this.touchStart;window.setTimeout(()=>{const i=this.touchStart===t;if(this.touching&&i&&!this.moved){this.moved=!0;const s={type:"longTap",touchStart:this.touchStart,touchEvent:e};this.localEventService.dispatchEvent(s)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);if(!t)return;!_areEventsNear(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const t={type:"tap",touchStart:this.touchStart};this.localEventService.dispatchEvent(t),this.checkForDoubleTap()}this.preventMouseClick&&e.cancelable&&e.preventDefault(),this.touching=!1}}checkForDoubleTap(){const e=new Date().getTime();if(this.lastTapTime&&this.lastTapTime>0)if(e-this.lastTapTime>this.DOUBLE_TAP_MILLIS){const i={type:"doubleTap",touchStart:this.touchStart};this.localEventService.dispatchEvent(i),this.lastTapTime=null}else this.lastTapTime=e;else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach(e=>e())}},SortIndicatorTemplate=`<span class="ag-sort-indicator-container">
|
|
4
|
+
</div>`,document.body.appendChild(e),e.scrollLeft=1,rtlNegativeScroll=Math.floor(e.scrollLeft)===0,document.body.removeChild(e),rtlNegativeScroll}function _getScrollLeft(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),_isBrowserChrome()&&!_isRtlNegativeScroll()&&(i=e.scrollWidth-e.clientWidth-i)),i}function _setScrollLeft(e,t,i){i&&(_isRtlNegativeScroll()?t*=-1:(_isBrowserSafari()||_isBrowserChrome())&&(t=e.scrollWidth-e.clientWidth-t)),e.scrollLeft=t}function _clearElement(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function _removeFromParent(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function _isInDOM(e){return!!e.offsetParent}function _isVisible(e){const t=e;return t.checkVisibility?t.checkVisibility({checkVisibilityCSS:!0}):!(!_isInDOM(e)||window.getComputedStyle(e).visibility!=="visible")}function _loadTemplate(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function _ensureDomOrder(e,t,i){i&&i.nextSibling===t||(i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t))}function _setDomChildOrder(e,t){for(let i=0;i<t.length;i++){const s=t[i],o=e.children[i];o!==s&&e.insertBefore(s,o)}}function _insertWithDomOrder(e,t,i){i?i.insertAdjacentElement("afterend",t):e.firstChild?e.insertAdjacentElement("afterbegin",t):e.appendChild(t)}function _addStylesToElement(e,t){if(t)for(const[i,s]of Object.entries(t)){if(!i||!i.length||s==null)continue;const o=_camelCaseToHyphenated(i),r=s.toString(),n=r.replace(/\s*!important/g,""),l=n.length!=r.length?"important":void 0;e.style.setProperty(o,n,l)}}function _isHorizontalScrollShowing(e){return e.clientWidth<e.scrollWidth}function _isVerticalScrollShowing(e){return e.clientHeight<e.scrollHeight}function _setElementWidth(e,t){t==="flex"?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):_setFixedWidth(e,t)}function _setFixedWidth(e,t){t=_formatSize(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function _setFixedHeight(e,t){t=_formatSize(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function _formatSize(e){return typeof e=="number"?`${e}px`:e}function _isNodeOrElement(e){return e instanceof Node||e instanceof HTMLElement}function _copyNodeList(e){if(e==null)return[];const t=[];return _nodeListForEach(e,i=>t.push(i)),t}function _iterateNamedNodeMap(e,t){if(e)for(let i=0;i<e.length;i++){const s=e[i];t(s.name,s.value)}}function _addOrRemoveAttribute(e,t,i){i==null?e.removeAttribute(t):e.setAttribute(t,i.toString())}function _nodeListForEach(e,t){if(e!=null)for(let i=0;i<e.length;i++)t(e[i])}function _bindCellRendererToHtmlElement(e,t){e.then(i=>{const s=i.getGui();s!=null&&(typeof s=="object"?t.appendChild(s):t.innerHTML=s)})}var NumberSequence=class{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}},SHOW_QUICK_TOOLTIP_DIFF=1e3,FADE_OUT_TOOLTIP_TIMEOUT=1e3,INTERACTIVE_HIDE_DELAY=100,_TooltipStateManager=class A extends BeanStub{constructor(t,i,s,o){super(),this.parentComp=t,this.tooltipShowDelayOverride=i,this.tooltipHideDelayOverride=s,this.shouldDisplayTooltip=o,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=0,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}wireBeans(t){this.popupService=t.popupService,this.userComponentFactory=t.userComponentFactory}postConstruct(){this.gos.get("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipMouseTrack=this.gos.get("tooltipMouseTrack");const t=this.parentComp.getGui();this.tooltipTrigger===0&&this.addManagedListeners(t,{mouseenter:this.onMouseEnter.bind(this),mouseleave:this.onMouseLeave.bind(this)}),this.tooltipTrigger===1&&this.addManagedListeners(t,{focusin:this.onFocusIn.bind(this),focusout:this.onFocusOut.bind(this)}),this.addManagedListeners(t,{mousemove:this.onMouseMove.bind(this)}),this.interactionEnabled||this.addManagedListeners(t,{mousedown:this.onMouseDown.bind(this),keydown:this.onKeyDown.bind(this)})}getGridOptionsTooltipDelay(t){const i=this.gos.get(t);return i<0&&_warnOnce(`${t} should not be lower than 0`),Math.max(200,i)}getTooltipDelay(t){return t==="show"?this.tooltipShowDelayOverride??this.getGridOptionsTooltipDelay("tooltipShowDelay"):this.tooltipHideDelayOverride??this.getGridOptionsTooltipDelay("tooltipHideDelay")}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const t=this.gos.get("tooltipTrigger");return!t||t==="hover"?0:1}onMouseEnter(t){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),!_isIOSUserAgent()&&(A.isLocked?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(t)},INTERACTIVE_HIDE_DELAY):this.prepareToShowTooltip(t))}onMouseMove(t){this.lastMouseEvent&&(this.lastMouseEvent=t),this.tooltipMouseTrack&&this.state===2&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(t){const i=t.relatedTarget,s=this.parentComp.getGui(),o=this.tooltipComp?.getGui();this.isInteractingWithTooltip||s.contains(i)||this.interactionEnabled&&o?.contains(i)||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(t){if(this.state!=0||A.isLocked)return;let i=0;t&&(i=this.isLastTooltipHiddenRecently()?200:this.getTooltipDelay("show")),this.lastMouseEvent=t||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),i),this.state=1}isLastTooltipHiddenRecently(){const t=new Date().getTime(),i=A.lastTooltipHideTime;return t-i<SHOW_QUICK_TOOLTIP_DIFF}setToDoNothing(){this.state===2&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=0,this.lastMouseEvent=null}showTooltip(){const t={...this.parentComp.getTooltipParams()};if(!_exists(t.value)||this.shouldDisplayTooltip&&!this.shouldDisplayTooltip()){this.setToDoNothing();return}this.state=2,this.tooltipInstanceCount++;const i=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(t).newAgStackInstance().then(i)}hideTooltip(t){if(!t&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),A.lastTooltipHideTime=new Date().getTime());const i={type:"tooltipHide",parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(i),t&&(this.isInteractingWithTooltip=!1),this.state=0}newTooltipComponentCallback(t,i){if(this.state!==2||this.tooltipInstanceCount!==t){this.destroyBean(i);return}const o=i.getGui();this.tooltipComp=i,o.classList.contains("ag-tooltip")||o.classList.add("ag-tooltip-custom"),this.tooltipTrigger===0&&o.classList.add("ag-tooltip-animate"),this.interactionEnabled&&o.classList.add("ag-tooltip-interactive");const r=this.localeService.getLocaleTextFunc(),n=this.popupService.addPopup({eChild:o,ariaLabel:r("ariaLabelTooltip","Tooltip")});if(n&&(this.tooltipPopupDestroyFunc=n.hideFunc),this.positionTooltip(),this.tooltipTrigger===1){const a=this.setToDoNothing.bind(this);[this.onBodyScrollEventCallback,this.onColumnMovedEventCallback]=this.addManagedEventListeners({bodyScroll:a,columnMoved:a})}this.interactionEnabled&&(this.tooltipTrigger===0?[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener]=this.addManagedElementListeners(o,{mouseenter:this.onTooltipMouseEnter.bind(this),mouseleave:this.onTooltipMouseLeave.bind(this)}):[this.tooltipFocusInListener,this.tooltipFocusOutListener]=this.addManagedElementListeners(o,{focusin:this.onTooltipFocusIn.bind(this),focusout:this.onTooltipFocusOut.bind(this)}));const l={type:"tooltipShow",tooltipGui:o,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(l),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(t){const i=this.parentComp.getGui(),s=this.tooltipComp?.getGui(),o=t.relatedTarget;s?.contains(o)||(this.isInteractingWithTooltip=!1,i.contains(o)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const t={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent({...t,mouseEvent:this.lastMouseEvent}):this.popupService.positionPopupByComponent({...t,eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5})}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const t=this.tooltipPopupDestroyFunc,i=this.tooltipComp,s=this.tooltipTrigger===0?FADE_OUT_TOOLTIP_TIMEOUT:0;window.setTimeout(()=>{t(),this.destroyBean(i)},s),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach(t=>{t&&t()}),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){A.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},INTERACTIVE_HIDE_DELAY)}unlockService(){A.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.getTooltipDelay("hide"))}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}};_TooltipStateManager.isLocked=!1;var TooltipStateManager=_TooltipStateManager,TooltipFeature=class extends BeanStub{constructor(e,t){super(),this.ctrl=e,t&&(this.beans=t)}wireBeans(e){this.beans=e}postConstruct(){this.refreshToolTip()}setBrowserTooltip(e){const t="title",i=this.ctrl.getGui();i&&(e!=null&&e!=""?i.setAttribute(t,e):i.removeAttribute(t))}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){if(this.tooltipManager!=null)return;const e={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.tooltipManager=this.createBean(new TooltipStateManager(e,this.ctrl.getTooltipShowDelayOverride?.(),this.ctrl.getTooltipHideDelayOverride?.(),this.ctrl.shouldDisplayTooltip),this.beans.context)}refreshToolTip(){this.browserTooltips=this.beans.gos.get("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?(this.setBrowserTooltip(this.tooltip),this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context))):(this.setBrowserTooltip(null),this.createTooltipFeatureIfNeeded())}getTooltipParams(){const e=this.ctrl,t=e.getColumn?e.getColumn():void 0,i=e.getColDef?e.getColDef():void 0,s=e.getRowNode?e.getRowNode():void 0;return{location:e.getLocation(),colDef:i,column:t,rowIndex:e.getRowIndex?e.getRowIndex():void 0,node:s,data:s?s.data:void 0,value:this.getTooltipText(),valueFormatted:e.getValueFormatted?e.getValueFormatted():void 0,hideTooltipCallback:()=>this.tooltipManager?.hideTooltip(!0)}}getTooltipText(){return this.tooltip}destroy(){this.tooltipManager&&(this.tooltipManager=this.destroyBean(this.tooltipManager,this.beans.context)),super.destroy()}},compIdSequence=new NumberSequence,RefPlaceholder=null,Component=class k extends BeanStub{constructor(t,i){super(),this.suppressDataRefValidation=!1,this.displayed=!0,this.visible=!0,this.compId=compIdSequence.next(),this.cssClassManager=new CssClassManager(()=>this.eGui),this.componentSelectors=new Map((i??[]).map(s=>[s.selector,s])),t&&this.setTemplate(t)}preWireBeans(t){super.preWireBeans(t)}preConstruct(){this.usingBrowserTooltips=this.gos.get("enableBrowserTooltips"),this.wireTemplate(this.getGui())}wireTemplate(t,i){t&&this.gos&&(this.applyElementsToComponent(t),this.createChildComponentsFromTags(t,i))}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(t){const{newTooltipText:i,showDelayOverride:s,hideDelayOverride:o,location:r,shouldDisplayTooltip:n}=t||{};this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.tooltipText!==i&&(this.tooltipText=i);const l=()=>this.tooltipText;i!=null&&(this.tooltipFeature=this.createBean(new TooltipFeature({getTooltipValue:l,getGui:()=>this.getGui(),getLocation:()=>r??"UNKNOWN",getColDef:t?.getColDef,getColumn:t?.getColumn,getTooltipShowDelayOverride:s!=null?()=>s:void 0,getTooltipHideDelayOverride:o!=null?()=>o:void 0,shouldDisplayTooltip:n})))}getDataRefAttribute(t){return t.getAttribute?t.getAttribute("data-ref"):null}applyElementsToComponent(t,i,s,o=null){if(i===void 0&&(i=this.getDataRefAttribute(t)),i){const r=this[i];if(r===RefPlaceholder)this[i]=o??t;else{const n=s&&s[i];!this.suppressDataRefValidation&&!n&&_warnOnce(`Issue with data-ref: ${i} on ${this.constructor.name} with ${r}`)}}}createChildComponentsFromTags(t,i){_copyNodeList(t.childNodes).forEach(o=>{if(!(o instanceof HTMLElement))return;const r=this.createComponentFromElement(o,n=>{n.getGui()&&this.copyAttributesFromNode(o,n.getGui())},i);if(r){if(r.addItems&&o.children.length){this.createChildComponentsFromTags(o,i);const n=Array.prototype.slice.call(o.children);r.addItems(n)}this.swapComponentForNode(r,t,o)}else o.childNodes&&this.createChildComponentsFromTags(o,i)})}createComponentFromElement(t,i,s){const o=t.nodeName,r=this.getDataRefAttribute(t),n=o.indexOf("AG-")===0,l=n?this.componentSelectors.get(o):null;let a=null;if(l){k.elementGettingCreated=t;const d=s&&r?s[r]:void 0;a=new l.component(d),a.setParentComponent(this),this.createBean(a,null,i)}else n&&_warnOnce(`Missing selector: ${o}`);return this.applyElementsToComponent(t,r,s,a),a}copyAttributesFromNode(t,i){_iterateNamedNodeMap(t.attributes,(s,o)=>i.setAttribute(s,o))}swapComponentForNode(t,i,s){const o=t.getGui();i.replaceChild(o,s),i.insertBefore(document.createComment(s.nodeName),o),this.addDestroyFunc(this.destroyBean.bind(this,t))}activateTabIndex(t){const i=this.gos.get("tabIndex");t||(t=[]),t.length||t.push(this.getGui()),t.forEach(s=>s.setAttribute("tabindex",i.toString()))}setTemplate(t,i,s){const o=_loadTemplate(t);this.setTemplateFromElement(o,i,s)}setTemplateFromElement(t,i,s,o=!1){if(this.eGui=t,this.suppressDataRefValidation=o,i)for(let r=0;r<i.length;r++){const n=i[r];this.componentSelectors.set(n.selector,n)}this.wireTemplate(t,s)}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(t){this.parentComponent=t}getParentComponent(){return this.parentComponent}setGui(t){this.eGui=t}queryForHtmlElement(t){return this.eGui.querySelector(t)}getContainerAndElement(t,i){let s=i;return t==null?null:(s||(s=this.eGui),_isNodeOrElement(t)?{element:t,parent:s}:{element:t.getGui(),parent:s})}prependChild(t,i){const{element:s,parent:o}=this.getContainerAndElement(t,i)||{};!s||!o||o.insertAdjacentElement("afterbegin",s)}appendChild(t,i){const{element:s,parent:o}=this.getContainerAndElement(t,i)||{};!s||!o||o.appendChild(s)}isDisplayed(){return this.displayed}setVisible(t,i={}){if(t!==this.visible){this.visible=t;const{skipAriaHidden:s}=i;_setVisible(this.eGui,t,{skipAriaHidden:s})}}setDisplayed(t,i={}){if(t!==this.displayed){this.displayed=t;const{skipAriaHidden:s}=i;_setDisplayed(this.eGui,t,{skipAriaHidden:s});const o={type:"displayChanged",visible:this.displayed};this.dispatchLocalEvent(o)}}destroy(){this.parentComponent&&(this.parentComponent=void 0),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),super.destroy()}addGuiEventListener(t,i,s){this.eGui.addEventListener(t,i,s),this.addDestroyFunc(()=>this.eGui.removeEventListener(t,i))}addCssClass(t){this.cssClassManager.addCssClass(t)}removeCssClass(t){this.cssClassManager.removeCssClass(t)}containsCssClass(t){return this.cssClassManager.containsCssClass(t)}addOrRemoveCssClass(t,i){this.cssClassManager.addOrRemoveCssClass(t,i)}},iconNameClassMap={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",menuAlt:"menu-alt",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus",chartsMenuEdit:"chart",chartsMenuAdvancedSettings:"settings",chartsMenuAdd:"plus",checkboxChecked:"checkbox-checked",checkboxIndeterminate:"checkbox-indeterminate",checkboxUnchecked:"checkbox-unchecked",radioButtonOn:"radio-button-on",radioButtonOff:"radio-button-off"};function _createIcon(e,t,i){const s=_createIconNoSpan(e,t,i);if(s){const{className:r}=s;if(typeof r=="string"&&r.indexOf("ag-icon")>-1||typeof r=="object"&&r["ag-icon"])return s}const o=document.createElement("span");return o.appendChild(s),o}function _createIconNoSpan(e,t,i,s){let o=null;const r=i&&i.getColDef().icons;if(r&&(o=r[e]),t&&!o){const n=t.get("icons");n&&(o=n[e])}if(o){let n;if(typeof o=="function")n=o();else if(typeof o=="string")n=o;else throw new Error("icon from grid options needs to be a string or a function");if(typeof n=="string")return _loadTemplate(n);if(_isNodeOrElement(n))return n;_warnOnce("iconRenderer should return back a string or a dom object")}else{const n=document.createElement("span");let l=iconNameClassMap[e];return l||(s?l=e:(_warnOnce(`Did not find icon ${e}`),l="")),n.setAttribute("class",`ag-icon ag-icon-${l}`),n.setAttribute("unselectable","on"),_setAriaRole(n,"presentation"),n}}function _areEventsNear(e,t,i){if(i===0)return!1;const s=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(s,o)<=i}var TouchListener=class{constructor(e,t=!1){this.DOUBLE_TAP_MILLIS=500,this.destroyFuncs=[],this.touching=!1,this.localEventService=new LocalEventService,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),s=this.onTouchMove.bind(this),o=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",s,{passive:!0}),this.eElement.addEventListener("touchend",o,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",s,{passive:!0}),this.eElement.removeEventListener("touchend",o,{passive:!1})})}getActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}onTouchStart(e){if(this.touching)return;this.touchStart=e.touches[0],this.touching=!0,this.moved=!1;const t=this.touchStart;window.setTimeout(()=>{const i=this.touchStart===t;if(this.touching&&i&&!this.moved){this.moved=!0;const s={type:"longTap",touchStart:this.touchStart,touchEvent:e};this.localEventService.dispatchEvent(s)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);if(!t)return;!_areEventsNear(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const t={type:"tap",touchStart:this.touchStart};this.localEventService.dispatchEvent(t),this.checkForDoubleTap()}this.preventMouseClick&&e.cancelable&&e.preventDefault(),this.touching=!1}}checkForDoubleTap(){const e=new Date().getTime();if(this.lastTapTime&&this.lastTapTime>0)if(e-this.lastTapTime>this.DOUBLE_TAP_MILLIS){const i={type:"doubleTap",touchStart:this.touchStart};this.localEventService.dispatchEvent(i),this.lastTapTime=null}else this.lastTapTime=e;else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach(e=>e())}},SortIndicatorTemplate=`<span class="ag-sort-indicator-container">
|
|
5
5
|
<span data-ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>
|
|
6
6
|
<span data-ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>
|
|
7
7
|
<span data-ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>
|
|
@@ -44,10 +44,10 @@ For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG
|
|
|
44
44
|
</div>`,[AgCheckboxSelector]),this.eCheckbox=RefPlaceholder}init(e){this.params=e,this.updateCheckbox(e);const t=this.eCheckbox.getInputElement();t.setAttribute("tabindex","-1"),_setAriaLive(t,"polite"),this.addManagedListeners(t,{click:i=>{if(_stopPropagationForAgGrid(i),this.eCheckbox.isDisabled())return;const s=this.eCheckbox.getValue();this.onCheckboxChanged(s)},dblclick:i=>{_stopPropagationForAgGrid(i)}}),this.addManagedElementListeners(this.params.eGridCell,{keydown:i=>{if(i.key===KeyCode.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===this.gos.getActiveDomElement()&&this.eCheckbox.toggle();const s=this.eCheckbox.getValue();this.onCheckboxChanged(s),i.preventDefault()}}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){let t,i=!0;if(e.node.group&&e.column){const l=e.column.getColId();l.startsWith(GROUP_AUTO_COLUMN_ID)?t=e.value==null||e.value===""?void 0:e.value==="true":e.node.aggData&&e.node.aggData[l]!==void 0?t=e.value??void 0:i=!1}else t=e.value??void 0;if(!i){this.eCheckbox.setDisplayed(!1);return}this.eCheckbox.setValue(t);const s=e.disabled!=null?e.disabled:!e.column?.isCellEditable(e.node);this.eCheckbox.setDisabled(s);const o=this.localeService.getLocaleTextFunc(),r=_getAriaCheckboxStateName(o,t),n=s?r:`${o("ariaToggleCellValue","Press SPACE to toggle cell value")} (${r})`;this.eCheckbox.setInputAriaLabel(n)}onCheckboxChanged(e){const{column:t,node:i,value:s}=this.params,o={type:"cellEditingStarted",column:t,colDef:t?.getColDef(),data:i.data,node:i,rowIndex:i.rowIndex,rowPinned:i.rowPinned,value:s};this.eventService.dispatchEvent(o);const r=this.params.node.setDataValue(this.params.column,e,"edit"),n={type:"cellEditingStopped",column:t,colDef:t?.getColDef(),data:i.data,node:i,rowIndex:i.rowIndex,rowPinned:i.rowPinned,value:s,oldValue:s,newValue:e,valueChanged:r};this.eventService.dispatchEvent(n)}},LoadingCellRenderer=class extends Component{constructor(){super(`<div class="ag-loading">
|
|
45
45
|
<span class="ag-loading-icon" data-ref="eLoadingIcon"></span>
|
|
46
46
|
<span class="ag-loading-text" data-ref="eLoadingText"></span>
|
|
47
|
-
</div>`),this.eLoadingIcon=RefPlaceholder,this.eLoadingText=RefPlaceholder}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=_createIconNoSpan("groupLoading",this.gos,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}},SkeletonCellRenderer=class extends Component{constructor(){super('<div class="ag-skeleton-container"></div>')}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>_setAriaLabelledBy(e.eParentOfValue)),_setAriaLabelledBy(e.eParentOfValue,t),e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");_setAriaLabel(this.getGui(),t)}setupLoading(e){const i=this.gos.getDocument().createElement("div");i.classList.add("ag-skeleton-effect");const s=e.node.rowIndex;if(s!=null){const n=75+25*(s%2===0?Math.sin(s):Math.cos(s));i.style.width=`${n}%`}this.getGui().appendChild(i);const r=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");_setAriaLabel(this.getGui(),r)}refresh(e){return!1}destroy(){super.destroy()}},OverlayComponent=class extends Component{constructor(){super()}destroy(){super.destroy()}},LoadingOverlayComponent=class extends OverlayComponent{init(){const e=this.gos.get("overlayLoadingTemplate");if(this.setTemplate(e??'<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>'),!e){const t=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=t("loadingOoo","Loading...")})}}},NoRowsOverlayComponent=class extends OverlayComponent{init(){const e=this.gos.get("overlayNoRowsTemplate");if(this.setTemplate(e??'<span class="ag-overlay-no-rows-center"></span>'),!e){const t=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=t("noRowsToShow","No Rows To Show")})}}},PopupComponent=class extends Component{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},TooltipComponent=class extends PopupComponent{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().textContent=_escapeString(t,!0)}};function _fuzzyCheckStrings(e,t,i){const s={},o=e.filter(r=>!t.some(n=>n===r));return o.length>0&&o.forEach(r=>s[r]=_fuzzySuggestions(r,i).values),s}function _fuzzySuggestions(e,t,i,s){let o=t.map((l,a)=>({value:l,relevance:stringWeightedDistances(e.toLowerCase(),l.toLocaleLowerCase()),idx:a}));if(o.sort((l,a)=>a.relevance-l.relevance),i&&(o=o.filter(l=>l.relevance!==0)),o.length>0&&s&&s>0){const a=o[0].relevance*s;o=o.filter(d=>a-d.relevance<0)}const r=[],n=[];for(const l of o)r.push(l.value),n.push(l.idx);return{values:r,indices:n}}function stringWeightedDistances(e,t){const i=e.replace(/\s/g,""),s=t.replace(/\s/g,"");let o=0,r=-1;for(let n=0;n<i.length;n++){const l=s.indexOf(i[n],r+1);l!==-1&&(r=l,o+=100-r*100/1e4*100)}return o}var UserComponentRegistry=class extends BeanStub{constructor(){super(...arguments),this.beanName="userComponentRegistry",this.agGridDefaults={agColumnHeader:HeaderComp,agColumnGroupHeader:HeaderGroupComp,agSortIndicator:SortIndicatorComp,agAnimateShowChangeCellRenderer:AnimateShowChangeCellRenderer,agAnimateSlideCellRenderer:AnimateSlideCellRenderer,agLoadingCellRenderer:LoadingCellRenderer,agSkeletonCellRenderer:SkeletonCellRenderer,agCheckboxCellRenderer:CheckboxCellRenderer,agLoadingOverlay:LoadingOverlayComponent,agNoRowsOverlay:NoRowsOverlayComponent,agTooltipComponent:TooltipComponent},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:"@ag-grid-enterprise/set-filter",agSetColumnFloatingFilter:"@ag-grid-enterprise/set-filter",agMultiColumnFilter:"@ag-grid-enterprise/multi-filter",agMultiColumnFloatingFilter:"@ag-grid-enterprise/multi-filter",agGroupColumnFilter:"@ag-grid-enterprise/row-grouping",agGroupColumnFloatingFilter:"@ag-grid-enterprise/row-grouping",agGroupCellRenderer:"@ag-grid-enterprise/row-grouping",agGroupRowRenderer:"@ag-grid-enterprise/row-grouping",agRichSelect:"@ag-grid-enterprise/rich-select",agRichSelectCellEditor:"@ag-grid-enterprise/rich-select",agDetailCellRenderer:"@ag-grid-enterprise/master-detail",agSparklineCellRenderer:"@ag-grid-enterprise/sparklines"},this.jsComps={}}postConstruct(){const e=this.gos.get("components");e!=null&&_iterateObject(e,(t,i)=>this.registerJsComponent(t,i))}registerDefaultComponent(e,t){this.agGridDefaults[e]=t}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(l,a)=>({componentFromFramework:a,component:l}),s=this.getFrameworkOverrides().frameworkComponent(t,this.gos.get("components"));if(s!=null)return i(s,!0);const o=this.jsComps[t];if(o){const l=this.getFrameworkOverrides().isFrameworkComponent(o);return i(o,l)}const r=this.agGridDefaults[t];if(r)return i(r,!1);const n=this.enterpriseAgDefaultCompsModule[t];return n?ModuleRegistry.__assertRegistered(n,`AG Grid '${e}' component: ${t}`,this.gridId):_doOnce(()=>{this.warnAboutMissingComponent(e,t)},"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=[...Object.keys(this.agGridDefaults).filter(o=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(o)),...Object.keys(this.jsComps)],s=_fuzzySuggestions(t,i,!0,.8).values;_warnOnce(`Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),s.length>0&&_warnOnce(` Did you mean: [${s.slice(0,3)}]?`),_warnOnce(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}},AgPromise=class I{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(i=>this.onDone(i),i=>this.onReject(i))}static all(t){return t.length?new I(i=>{let s=t.length;const o=new Array(s);t.forEach((r,n)=>{r.then(l=>{o[n]=l,s--,s===0&&i(o)})})}):I.resolve()}static resolve(t=null){return new I(i=>i(t))}then(t){return new I(i=>{this.status===1?i(t(this.resolution)):this.waiters.push(s=>i(t(s)))})}onDone(t){this.status=1,this.resolution=t,this.waiters.forEach(i=>i(t))}onReject(t){}},DateComponent={propertyName:"dateComponent",cellRenderer:!1},HeaderComponent={propertyName:"headerComponent",cellRenderer:!1},HeaderGroupComponent={propertyName:"headerGroupComponent",cellRenderer:!1},CellRendererComponent={propertyName:"cellRenderer",cellRenderer:!0},EditorRendererComponent={propertyName:"cellRenderer",cellRenderer:!1},LoadingCellRendererComponent={propertyName:"loadingCellRenderer",cellRenderer:!0},CellEditorComponent={propertyName:"cellEditor",cellRenderer:!1},InnerRendererComponent={propertyName:"innerRenderer",cellRenderer:!0},LoadingOverlayComponent2={propertyName:"loadingOverlayComponent",cellRenderer:!1},NoRowsOverlayComponent2={propertyName:"noRowsOverlayComponent",cellRenderer:!1},TooltipComponent2={propertyName:"tooltipComponent",cellRenderer:!1},FilterComponent={propertyName:"filter",cellRenderer:!1},FloatingFilterComponent={propertyName:"floatingFilterComponent",cellRenderer:!1},ToolPanelComponent={propertyName:"toolPanel",cellRenderer:!1},StatusPanelComponent={propertyName:"statusPanel",cellRenderer:!1},FullWidth={propertyName:"fullWidthCellRenderer",cellRenderer:!0},FullWidthLoading={propertyName:"loadingCellRenderer",cellRenderer:!0},FullWidthGroup={propertyName:"groupRowRenderer",cellRenderer:!0},FullWidthDetail={propertyName:"detailCellRenderer",cellRenderer:!0},MenuItemComponent={propertyName:"menuItem",cellRenderer:!1},UserComponentFactory=class H extends BeanStub{constructor(){super(...arguments),this.beanName="userComponentFactory"}wireBeans(t){this.agComponentUtils=t.agComponentUtils,this.componentMetadataProvider=t.componentMetadataProvider,this.userComponentRegistry=t.userComponentRegistry,this.frameworkComponentWrapper=t.frameworkComponentWrapper,this.gridOptions=t.gridOptions}getHeaderCompDetails(t,i){return this.getCompDetails(t,HeaderComponent,"agColumnHeader",i)}getHeaderGroupCompDetails(t){const i=t.columnGroup.getColGroupDef();return this.getCompDetails(i,HeaderGroupComponent,"agColumnGroupHeader",t)}getFullWidthCellRendererDetails(t){return this.getCompDetails(this.gridOptions,FullWidth,null,t,!0)}getFullWidthLoadingCellRendererDetails(t){return this.getCompDetails(this.gridOptions,FullWidthLoading,"agLoadingCellRenderer",t,!0)}getFullWidthGroupCellRendererDetails(t){return this.getCompDetails(this.gridOptions,FullWidthGroup,"agGroupRowRenderer",t,!0)}getFullWidthDetailCellRendererDetails(t){return this.getCompDetails(this.gridOptions,FullWidthDetail,"agDetailCellRenderer",t,!0)}getInnerRendererDetails(t,i){return this.getCompDetails(t,InnerRendererComponent,null,i)}getFullWidthGroupRowInnerCellRenderer(t,i){return this.getCompDetails(t,InnerRendererComponent,null,i)}getCellRendererDetails(t,i){return this.getCompDetails(t,CellRendererComponent,null,i)}getEditorRendererDetails(t,i){return this.getCompDetails(t,EditorRendererComponent,null,i)}getLoadingCellRendererDetails(t,i){return this.getCompDetails(t,LoadingCellRendererComponent,"agSkeletonCellRenderer",i,!0)}getCellEditorDetails(t,i){return this.getCompDetails(t,CellEditorComponent,"agCellEditor",i,!0)}getFilterDetails(t,i,s){return this.getCompDetails(t,FilterComponent,s,i,!0)}getDateCompDetails(t){return this.getCompDetails(this.gridOptions,DateComponent,"agDateInput",t,!0)}getLoadingOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,LoadingOverlayComponent2,"agLoadingOverlay",t,!0)}getNoRowsOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,NoRowsOverlayComponent2,"agNoRowsOverlay",t,!0)}getTooltipCompDetails(t){return this.getCompDetails(t.colDef,TooltipComponent2,"agTooltipComponent",t,!0)}getSetFilterCellRendererDetails(t,i){return this.getCompDetails(t,CellRendererComponent,null,i)}getFloatingFilterCompDetails(t,i,s){return this.getCompDetails(t,FloatingFilterComponent,s,i)}getToolPanelCompDetails(t,i){return this.getCompDetails(t,ToolPanelComponent,null,i,!0)}getStatusPanelCompDetails(t,i){return this.getCompDetails(t,StatusPanelComponent,null,i,!0)}getMenuItemCompDetails(t,i){return this.getCompDetails(t,MenuItemComponent,"agMenuItem",i,!0)}getCompDetails(t,i,s,o,r=!1){const{propertyName:n,cellRenderer:l}=i;let{compName:a,jsComp:d,fwComp:h,paramsFromSelector:c,popupFromSelector:u,popupPositionFromSelector:g}=H.getCompKeys(this.frameworkOverrides,t,i,o);const p=C=>{const w=this.userComponentRegistry.retrieve(n,C);w&&(d=w.componentFromFramework?void 0:w.component,h=w.componentFromFramework?w.component:void 0)};if(a!=null&&p(a),d==null&&h==null&&s!=null&&p(s),d&&l&&!this.agComponentUtils.doesImplementIComponent(d)&&(d=this.agComponentUtils.adaptFunction(n,d)),!d&&!h){r&&_errorOnce(`Could not find component ${a}, did you forget to configure this component?`);return}const m=this.mergeParamsWithApplicationProvidedParams(t,i,o,c),f=d==null,v=d||h;return{componentFromFramework:f,componentClass:v,params:m,type:i,popupFromSelector:u,popupPositionFromSelector:g,newAgStackInstance:()=>this.newAgStackInstance(v,f,m,i)}}static getCompKeys(t,i,s,o){const{propertyName:r}=s;let n,l,a,d,h,c;if(i){const u=i,g=u[r+"Selector"],p=g?g(o):null,m=f=>{typeof f=="string"?n=f:f!=null&&f!==!0&&(t.isFrameworkComponent(f)?a=f:l=f)};p?(m(p.component),d=p.params,h=p.popup,c=p.popupPosition):m(u[r])}return{compName:n,jsComp:l,fwComp:a,paramsFromSelector:d,popupFromSelector:h,popupPositionFromSelector:c}}newAgStackInstance(t,i,s,o){const r=o.propertyName,n=!i;let l;if(n)l=new t;else{const d=this.componentMetadataProvider.retrieve(r);l=this.frameworkComponentWrapper.wrap(t,d.mandatoryMethodList,d.optionalMethodList,o)}const a=this.initComponent(l,s);return a==null?AgPromise.resolve(l):a.then(()=>l)}mergeParamsWithApplicationProvidedParams(t,i,s,o=null){const r=this.gos.getGridCommonParams();_mergeDeep(r,s);const n=t,l=n&&n[i.propertyName+"Params"];if(typeof l=="function"){const a=l(s);_mergeDeep(r,a)}else typeof l=="object"&&_mergeDeep(r,l);return _mergeDeep(r,o),r}initComponent(t,i){if(this.createBean(t),t.init!=null)return t.init(i)}};function _unwrapUserComp(e){const t=e;return t!=null&&t.getFrameworkComponentInstance!=null?t.getFrameworkComponentInstance():e}var GenericContext=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,!(!e||!e.beanClasses)&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){Object.entries(e.providedBeanInstances).forEach(([t,i])=>{this.beans[t]=i}),e.beanClasses.forEach(t=>{const i=new t;i.beanName?this.beans[i.beanName]=i:console.error(`Bean ${t.name} is missing beanName`),this.createdBeans.push(i)}),e.derivedBeans?.forEach(t=>{const{beanName:i,bean:s}=t(this);this.beans[i]=s,this.createdBeans.push(s)}),e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.initBeans([e],t),e}initBeans(e,t){e.forEach(i=>{i.preWireBeans?.(this.beans),i.wireBeans?.(this.beans)}),e.forEach(i=>i.preConstruct?.()),t&&e.forEach(t),e.forEach(i=>i.postConstruct?.())}getBeans(){return this.beans}getBean(e){return this.beans[e]}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this.getBeanInstances();this.beanDestroyComparator&&e.sort(this.beanDestroyComparator),this.destroyBeans(e),this.beans={},this.createdBeans=[]}destroyBean(e){e?.destroy?.()}destroyBeans(e){if(e)for(let t=0;t<e.length;t++)this.destroyBean(e[t]);return[]}isDestroyed(){return this.destroyed}},Context=class extends GenericContext{init(e){this.gridId=e.gridId,this.beans.context=this,super.init(e)}destroy(){super.destroy(),ModuleRegistry.__unRegisterGridModules(this.gridId)}getGridId(){return this.gridId}},ExcelFactoryMode=(e=>(e[e.SINGLE_SHEET=0]="SINGLE_SHEET",e[e.MULTI_SHEET=1]="MULTI_SHEET",e))(ExcelFactoryMode||{}),VerticalDirection=(e=>(e[e.Up=0]="Up",e[e.Down=1]="Down",e))(VerticalDirection||{}),HorizontalDirection=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(HorizontalDirection||{}),DragSourceType=(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))(DragSourceType||{}),GHOST_TEMPLATE=`<div class="ag-dnd-ghost ag-unselectable">
|
|
47
|
+
</div>`),this.eLoadingIcon=RefPlaceholder,this.eLoadingText=RefPlaceholder}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=_createIconNoSpan("groupLoading",this.gos,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}},SkeletonCellRenderer=class extends Component{constructor(){super('<div class="ag-skeleton-container"></div>')}init(e){const t=`ag-cell-skeleton-renderer-${this.getCompId()}`;this.getGui().setAttribute("id",t),this.addDestroyFunc(()=>_setAriaLabelledBy(e.eParentOfValue)),_setAriaLabelledBy(e.eParentOfValue,t),e.node.failedLoad?this.setupFailed():this.setupLoading(e)}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.getGui().innerText=e("loadingError","ERR");const t=e("ariaSkeletonCellLoadingFailed","Row failed to load");_setAriaLabel(this.getGui(),t)}setupLoading(e){const i=this.gos.getDocument().createElement("div");i.classList.add("ag-skeleton-effect");const s=e.node.rowIndex;if(s!=null){const n=75+25*(s%2===0?Math.sin(s):Math.cos(s));i.style.width=`${n}%`}this.getGui().appendChild(i);const r=this.localeService.getLocaleTextFunc()("ariaSkeletonCellLoading","Row data is loading");_setAriaLabel(this.getGui(),r)}refresh(e){return!1}destroy(){super.destroy()}},OverlayComponent=class extends Component{constructor(){super()}destroy(){super.destroy()}},LoadingOverlayComponent=class extends OverlayComponent{init(){const e=this.gos.get("overlayLoadingTemplate");if(this.setTemplate(e??'<span aria-live="polite" aria-atomic="true" class="ag-overlay-loading-center"></span>'),!e){const t=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=t("loadingOoo","Loading...")})}}},NoRowsOverlayComponent=class extends OverlayComponent{init(){const e=this.gos.get("overlayNoRowsTemplate");if(this.setTemplate(e??'<span class="ag-overlay-no-rows-center"></span>'),!e){const t=this.localeService.getLocaleTextFunc();setTimeout(()=>{this.getGui().textContent=t("noRowsToShow","No Rows To Show")})}}},PopupComponent=class extends Component{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}},TooltipComponent=class extends PopupComponent{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().textContent=_escapeString(t,!0)}};function _fuzzyCheckStrings(e,t,i){const s={},o=e.filter(r=>!t.some(n=>n===r));return o.length>0&&o.forEach(r=>s[r]=_fuzzySuggestions(r,i).values),s}function _fuzzySuggestions(e,t,i,s){let o=t.map((l,a)=>({value:l,relevance:stringWeightedDistances(e.toLowerCase(),l.toLocaleLowerCase()),idx:a}));if(o.sort((l,a)=>a.relevance-l.relevance),i&&(o=o.filter(l=>l.relevance!==0)),o.length>0&&s&&s>0){const a=o[0].relevance*s;o=o.filter(d=>a-d.relevance<0)}const r=[],n=[];for(const l of o)r.push(l.value),n.push(l.idx);return{values:r,indices:n}}function stringWeightedDistances(e,t){const i=e.replace(/\s/g,""),s=t.replace(/\s/g,"");let o=0,r=-1;for(let n=0;n<i.length;n++){const l=s.indexOf(i[n],r+1);l!==-1&&(r=l,o+=100-r*100/1e4*100)}return o}var UserComponentRegistry=class extends BeanStub{constructor(){super(...arguments),this.beanName="userComponentRegistry",this.agGridDefaults={agColumnHeader:HeaderComp,agColumnGroupHeader:HeaderGroupComp,agSortIndicator:SortIndicatorComp,agAnimateShowChangeCellRenderer:AnimateShowChangeCellRenderer,agAnimateSlideCellRenderer:AnimateSlideCellRenderer,agLoadingCellRenderer:LoadingCellRenderer,agSkeletonCellRenderer:SkeletonCellRenderer,agCheckboxCellRenderer:CheckboxCellRenderer,agLoadingOverlay:LoadingOverlayComponent,agNoRowsOverlay:NoRowsOverlayComponent,agTooltipComponent:TooltipComponent},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:"@ag-grid-enterprise/set-filter",agSetColumnFloatingFilter:"@ag-grid-enterprise/set-filter",agMultiColumnFilter:"@ag-grid-enterprise/multi-filter",agMultiColumnFloatingFilter:"@ag-grid-enterprise/multi-filter",agGroupColumnFilter:"@ag-grid-enterprise/row-grouping",agGroupColumnFloatingFilter:"@ag-grid-enterprise/row-grouping",agGroupCellRenderer:"@ag-grid-enterprise/row-grouping",agGroupRowRenderer:"@ag-grid-enterprise/row-grouping",agRichSelect:"@ag-grid-enterprise/rich-select",agRichSelectCellEditor:"@ag-grid-enterprise/rich-select",agDetailCellRenderer:"@ag-grid-enterprise/master-detail",agSparklineCellRenderer:"@ag-grid-enterprise/sparklines"},this.jsComps={}}postConstruct(){const e=this.gos.get("components");e!=null&&_iterateObject(e,(t,i)=>this.registerJsComponent(t,i))}registerDefaultComponent(e,t){this.agGridDefaults[e]=t}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(l,a)=>({componentFromFramework:a,component:l}),s=this.getFrameworkOverrides().frameworkComponent(t,this.gos.get("components"));if(s!=null)return i(s,!0);const o=this.jsComps[t];if(o){const l=this.getFrameworkOverrides().isFrameworkComponent(o);return i(o,l)}const r=this.agGridDefaults[t];if(r)return i(r,!1);const n=this.enterpriseAgDefaultCompsModule[t];return n?ModuleRegistry.__assertRegistered(n,`AG Grid '${e}' component: ${t}`,this.gridId):_doOnce(()=>{this.warnAboutMissingComponent(e,t)},"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=[...Object.keys(this.agGridDefaults).filter(o=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(o)),...Object.keys(this.jsComps)],s=_fuzzySuggestions(t,i,!0,.8).values;_warnOnce(`Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),s.length>0&&_warnOnce(` Did you mean: [${s.slice(0,3)}]?`),_warnOnce(`If using a custom component check it has been registered as described in: ${this.getFrameworkOverrides().getDocLink("components/")}`)}},AgPromise=class I{constructor(t){this.status=0,this.resolution=null,this.waiters=[],t(i=>this.onDone(i),i=>this.onReject(i))}static all(t){return t.length?new I(i=>{let s=t.length;const o=new Array(s);t.forEach((r,n)=>{r.then(l=>{o[n]=l,s--,s===0&&i(o)})})}):I.resolve()}static resolve(t=null){return new I(i=>i(t))}then(t){return new I(i=>{this.status===1?i(t(this.resolution)):this.waiters.push(s=>i(t(s)))})}onDone(t){this.status=1,this.resolution=t,this.waiters.forEach(i=>i(t))}onReject(t){}},DateComponent={propertyName:"dateComponent",cellRenderer:!1},HeaderComponent={propertyName:"headerComponent",cellRenderer:!1},HeaderGroupComponent={propertyName:"headerGroupComponent",cellRenderer:!1},CellRendererComponent={propertyName:"cellRenderer",cellRenderer:!0},EditorRendererComponent={propertyName:"cellRenderer",cellRenderer:!1},LoadingCellRendererComponent={propertyName:"loadingCellRenderer",cellRenderer:!0},CellEditorComponent={propertyName:"cellEditor",cellRenderer:!1},InnerRendererComponent={propertyName:"innerRenderer",cellRenderer:!0},LoadingOverlayComponent2={propertyName:"loadingOverlayComponent",cellRenderer:!1},NoRowsOverlayComponent2={propertyName:"noRowsOverlayComponent",cellRenderer:!1},TooltipComponent2={propertyName:"tooltipComponent",cellRenderer:!1},FilterComponent={propertyName:"filter",cellRenderer:!1},FloatingFilterComponent={propertyName:"floatingFilterComponent",cellRenderer:!1},ToolPanelComponent={propertyName:"toolPanel",cellRenderer:!1},StatusPanelComponent={propertyName:"statusPanel",cellRenderer:!1},FullWidth={propertyName:"fullWidthCellRenderer",cellRenderer:!0},FullWidthLoading={propertyName:"loadingCellRenderer",cellRenderer:!0},FullWidthGroup={propertyName:"groupRowRenderer",cellRenderer:!0},FullWidthDetail={propertyName:"detailCellRenderer",cellRenderer:!0},MenuItemComponent={propertyName:"menuItem",cellRenderer:!1},UserComponentFactory=class H extends BeanStub{constructor(){super(...arguments),this.beanName="userComponentFactory"}wireBeans(t){this.agComponentUtils=t.agComponentUtils,this.componentMetadataProvider=t.componentMetadataProvider,this.userComponentRegistry=t.userComponentRegistry,this.frameworkComponentWrapper=t.frameworkComponentWrapper,this.gridOptions=t.gridOptions}getHeaderCompDetails(t,i){return this.getCompDetails(t,HeaderComponent,"agColumnHeader",i)}getHeaderGroupCompDetails(t){const i=t.columnGroup.getColGroupDef();return this.getCompDetails(i,HeaderGroupComponent,"agColumnGroupHeader",t)}getFullWidthCellRendererDetails(t){return this.getCompDetails(this.gridOptions,FullWidth,null,t,!0)}getFullWidthLoadingCellRendererDetails(t){return this.getCompDetails(this.gridOptions,FullWidthLoading,"agLoadingCellRenderer",t,!0)}getFullWidthGroupCellRendererDetails(t){return this.getCompDetails(this.gridOptions,FullWidthGroup,"agGroupRowRenderer",t,!0)}getFullWidthDetailCellRendererDetails(t){return this.getCompDetails(this.gridOptions,FullWidthDetail,"agDetailCellRenderer",t,!0)}getInnerRendererDetails(t,i){return this.getCompDetails(t,InnerRendererComponent,null,i)}getFullWidthGroupRowInnerCellRenderer(t,i){return this.getCompDetails(t,InnerRendererComponent,null,i)}getCellRendererDetails(t,i){return this.getCompDetails(t,CellRendererComponent,null,i)}getEditorRendererDetails(t,i){return this.getCompDetails(t,EditorRendererComponent,null,i)}getLoadingCellRendererDetails(t,i){return this.getCompDetails(t,LoadingCellRendererComponent,"agSkeletonCellRenderer",i,!0)}getCellEditorDetails(t,i){return this.getCompDetails(t,CellEditorComponent,"agCellEditor",i,!0)}getFilterDetails(t,i,s){return this.getCompDetails(t,FilterComponent,s,i,!0)}getDateCompDetails(t){return this.getCompDetails(this.gridOptions,DateComponent,"agDateInput",t,!0)}getLoadingOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,LoadingOverlayComponent2,"agLoadingOverlay",t,!0)}getNoRowsOverlayCompDetails(t){return this.getCompDetails(this.gridOptions,NoRowsOverlayComponent2,"agNoRowsOverlay",t,!0)}getTooltipCompDetails(t){return this.getCompDetails(t.colDef,TooltipComponent2,"agTooltipComponent",t,!0)}getSetFilterCellRendererDetails(t,i){return this.getCompDetails(t,CellRendererComponent,null,i)}getFloatingFilterCompDetails(t,i,s){return this.getCompDetails(t,FloatingFilterComponent,s,i)}getToolPanelCompDetails(t,i){return this.getCompDetails(t,ToolPanelComponent,null,i,!0)}getStatusPanelCompDetails(t,i){return this.getCompDetails(t,StatusPanelComponent,null,i,!0)}getMenuItemCompDetails(t,i){return this.getCompDetails(t,MenuItemComponent,"agMenuItem",i,!0)}getCompDetails(t,i,s,o,r=!1){const{propertyName:n,cellRenderer:l}=i;let{compName:a,jsComp:d,fwComp:h,paramsFromSelector:c,popupFromSelector:u,popupPositionFromSelector:g}=H.getCompKeys(this.frameworkOverrides,t,i,o);const p=v=>{const w=this.userComponentRegistry.retrieve(n,v);w&&(d=w.componentFromFramework?void 0:w.component,h=w.componentFromFramework?w.component:void 0)};if(a!=null&&p(a),d==null&&h==null&&s!=null&&p(s),d&&l&&!this.agComponentUtils.doesImplementIComponent(d)&&(d=this.agComponentUtils.adaptFunction(n,d)),!d&&!h){r&&_errorOnce(`Could not find component ${a}, did you forget to configure this component?`);return}const f=this.mergeParamsWithApplicationProvidedParams(t,i,o,c),m=d==null,C=d||h;return{componentFromFramework:m,componentClass:C,params:f,type:i,popupFromSelector:u,popupPositionFromSelector:g,newAgStackInstance:()=>this.newAgStackInstance(C,m,f,i)}}static getCompKeys(t,i,s,o){const{propertyName:r}=s;let n,l,a,d,h,c;if(i){const u=i,g=u[r+"Selector"],p=g?g(o):null,f=m=>{typeof m=="string"?n=m:m!=null&&m!==!0&&(t.isFrameworkComponent(m)?a=m:l=m)};p?(f(p.component),d=p.params,h=p.popup,c=p.popupPosition):f(u[r])}return{compName:n,jsComp:l,fwComp:a,paramsFromSelector:d,popupFromSelector:h,popupPositionFromSelector:c}}newAgStackInstance(t,i,s,o){const r=o.propertyName,n=!i;let l;if(n)l=new t;else{const d=this.componentMetadataProvider.retrieve(r);l=this.frameworkComponentWrapper.wrap(t,d.mandatoryMethodList,d.optionalMethodList,o)}const a=this.initComponent(l,s);return a==null?AgPromise.resolve(l):a.then(()=>l)}mergeParamsWithApplicationProvidedParams(t,i,s,o=null){const r=this.gos.getGridCommonParams();_mergeDeep(r,s);const n=t,l=n&&n[i.propertyName+"Params"];if(typeof l=="function"){const a=l(s);_mergeDeep(r,a)}else typeof l=="object"&&_mergeDeep(r,l);return _mergeDeep(r,o),r}initComponent(t,i){if(this.createBean(t),t.init!=null)return t.init(i)}};function _unwrapUserComp(e){const t=e;return t!=null&&t.getFrameworkComponentInstance!=null?t.getFrameworkComponentInstance():e}var GenericContext=class{constructor(e){this.beans={},this.createdBeans=[],this.destroyed=!1,!(!e||!e.beanClasses)&&(this.beanDestroyComparator=e.beanDestroyComparator,this.init(e))}init(e){Object.entries(e.providedBeanInstances).forEach(([t,i])=>{this.beans[t]=i}),e.beanClasses.forEach(t=>{const i=new t;i.beanName?this.beans[i.beanName]=i:console.error(`Bean ${t.name} is missing beanName`),this.createdBeans.push(i)}),e.derivedBeans?.forEach(t=>{const{beanName:i,bean:s}=t(this);this.beans[i]=s,this.createdBeans.push(s)}),e.beanInitComparator&&this.createdBeans.sort(e.beanInitComparator),this.initBeans(this.createdBeans)}getBeanInstances(){return Object.values(this.beans)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.initBeans([e],t),e}initBeans(e,t){e.forEach(i=>{i.preWireBeans?.(this.beans),i.wireBeans?.(this.beans)}),e.forEach(i=>i.preConstruct?.()),t&&e.forEach(t),e.forEach(i=>i.postConstruct?.())}getBeans(){return this.beans}getBean(e){return this.beans[e]}destroy(){if(this.destroyed)return;this.destroyed=!0;const e=this.getBeanInstances();this.beanDestroyComparator&&e.sort(this.beanDestroyComparator),this.destroyBeans(e),this.beans={},this.createdBeans=[]}destroyBean(e){e?.destroy?.()}destroyBeans(e){if(e)for(let t=0;t<e.length;t++)this.destroyBean(e[t]);return[]}isDestroyed(){return this.destroyed}},Context=class extends GenericContext{init(e){this.gridId=e.gridId,this.beans.context=this,super.init(e)}destroy(){super.destroy(),ModuleRegistry.__unRegisterGridModules(this.gridId)}getGridId(){return this.gridId}},ExcelFactoryMode=(e=>(e[e.SINGLE_SHEET=0]="SINGLE_SHEET",e[e.MULTI_SHEET=1]="MULTI_SHEET",e))(ExcelFactoryMode||{}),VerticalDirection=(e=>(e[e.Up=0]="Up",e[e.Down=1]="Down",e))(VerticalDirection||{}),HorizontalDirection=(e=>(e[e.Left=0]="Left",e[e.Right=1]="Right",e))(HorizontalDirection||{}),DragSourceType=(e=>(e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder",e))(DragSourceType||{}),GHOST_TEMPLATE=`<div class="ag-dnd-ghost ag-unselectable">
|
|
48
48
|
<span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>
|
|
49
49
|
<div class="ag-dnd-ghost-label"></div>
|
|
50
|
-
</div>`,DragAndDropService=class extends BeanStub{constructor(){super(...arguments),this.beanName="dragAndDropService",this.dragSourceAndParamsList=[],this.dropTargets=[]}wireBeans(e){this.dragService=e.dragService,this.mouseEventService=e.mouseEventService,this.environment=e.environment}postConstruct(){this.dropIconMap={pinned:_createIcon("columnMovePin",this.gos,null),hide:_createIcon("columnMoveHide",this.gos,null),move:_createIcon("columnMoveMove",this.gos,null),left:_createIcon("columnMoveLeft",this.gos,null),right:_createIcon("columnMoveRight",this.gos,null),group:_createIcon("columnMoveGroup",this.gos,null),aggregate:_createIcon("columnMoveValue",this.gos,null),pivot:_createIcon("columnMovePivot",this.gos,null),notAllowed:_createIcon("dropNotAllowed",this.gos,null)}}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}removeDragSource(e){const t=this.dragSourceAndParamsList.find(i=>i.dragSource===e);t&&(this.dragService.removeDragSource(t.params),_removeFromArray(this.dragSourceAndParamsList,t))}destroy(){this.dragSourceAndParamsList.forEach(e=>this.dragService.removeDragSource(e.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0,super.destroy()}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(e){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=void 0,this.dragItem=null,this.removeGhost()}onDragging(e,t){const i=this.getHorizontalDirection(e),s=this.getVerticalDirection(e);this.eventLastTime=e,this.positionGhost(e);const o=this.dropTargets.filter(n=>this.isMouseOnDropTarget(e,n)),r=this.findCurrentDropTarget(e,o);if(r!==this.lastDropTarget)this.leaveLastTargetIfExists(e,i,s,t),this.lastDropTarget!==null&&r===null&&this.dragSource.onGridExit?.(this.dragItem),this.lastDropTarget===null&&r!==null&&this.dragSource.onGridEnter?.(this.dragItem),this.enterDragTargetIfExists(r,e,i,s,t),this.lastDropTarget=r;else if(r&&r.onDragging){const n=this.createDropTargetEvent(r,e,i,s,t);r.onDragging(n)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const s=i.getBoundingClientRect();if(s.width===0||s.height===0)return!1;const o=e.clientX>=s.left&&e.clientX<s.right,r=e.clientY>=s.top&&e.clientY<s.bottom;if(!o||!r)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let s=!1;for(const o of i)if(this.allContainersIntersect(e,o)){s=!0;break}return t.targetContainsSource&&!t.getContainer().contains(this.dragSource.eElement)?!1:s&&t.isInterestedIn(this.dragSource.type,this.dragSource.eElement)}findCurrentDropTarget(e,t){const i=t.length;if(i===0)return null;if(i===1)return t[0];const o=this.gos.getRootNode().elementsFromPoint(e.clientX,e.clientY);for(const r of o)for(const n of t)if(_flatten(this.getAllContainersFromDropTarget(n)).indexOf(r)!==-1)return n;return null}enterDragTargetIfExists(e,t,i,s,o){if(e){if(e.onDragEnter){const r=this.createDropTargetEvent(e,t,i,s,o);e.onDragEnter(r)}this.setGhostIcon(e.getIconName?e.getIconName():null)}}leaveLastTargetIfExists(e,t,i,s){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const o=this.createDropTargetEvent(this.lastDropTarget,e,t,i,s);this.lastDropTarget.onDragLeave(o)}this.setGhostIcon(null)}}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter(t=>t.getContainer()!==e.getContainer())}hasExternalDropZones(){return this.dropTargets.some(e=>e.external)}findExternalZone(e){return this.dropTargets.filter(i=>i.external).find(i=>i.getContainer()===e.getContainer())||null}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?0:1}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?0:1}createDropTargetEvent(e,t,i,s,o){const r=e.getContainer(),n=r.getBoundingClientRect(),{dragItem:l,dragSource:a}=this,d=t.clientX-n.left,h=t.clientY-n.top;return this.gos.addGridCommonParams({event:t,x:d,y:h,vDirection:s,hDirection:i,dragSource:a,fromNudge:o,dragItem:l,dropZoneTarget:r})}positionGhost(e){const t=this.eGhost;if(!t)return;const s=t.getBoundingClientRect().height,o=_getBodyWidth()-2,r=_getBodyHeight()-2,n=_getElementRectWithOffset(t.offsetParent),{clientY:l,clientX:a}=e;let d=l-n.top-s/2,h=a-n.left-10;const c=this.gos.getDocument(),u=c.defaultView||window,g=u.pageYOffset||c.documentElement.scrollTop,p=u.pageXOffset||c.documentElement.scrollLeft;o>0&&h+t.clientWidth>o+p&&(h=o+p-t.clientWidth),h<0&&(h=0),r>0&&d+t.clientHeight>r+g&&(d=r+g-t.clientHeight),d<0&&(d=0),t.style.left=`${h}px`,t.style.top=`${d}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=_loadTemplate(GHOST_TEMPLATE),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost),this.environment.applyThemeClasses(this.eGhost),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const e=this.eGhost.querySelector(".ag-dnd-ghost-label");let t=this.dragSource.dragItemName;_isFunction(t)&&(t=t()),e.innerHTML=_escapeString(t)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const i=this.gos.getDocument();let s=null,o=null;try{s=i.fullscreenElement}catch{}finally{s||(s=this.gos.getRootNode());const r=s.querySelector("body");r?o=r:s instanceof ShadowRoot?o=s:s instanceof Document?o=s?.documentElement:o=s}this.eGhostParent=o,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):_warnOnce("Could not find document body, it is needed for dragging columns")}setGhostIcon(e,t=!1){_clearElement(this.eGhostIcon);let i=null;e||(e=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():"notAllowed"),i=this.dropIconMap[e],this.eGhostIcon.classList.toggle("ag-shake-left-to-right",t),!(i===this.dropIconMap.hide&&this.gos.get("suppressDragLeaveHidesColumns"))&&i&&this.eGhostIcon.appendChild(i)}},AutoScrollService=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=e.scrollAxis.indexOf("x")!==-1,this.scrollVertically=e.scrollAxis.indexOf("y")!==-1,this.scrollByTick=e.scrollByTick!=null?e.scrollByTick:20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}check(e,t=!1){const i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const s=this.scrollContainer.getBoundingClientRect(),o=this.scrollByTick;this.tickLeft=e.clientX<s.left+o,this.tickRight=e.clientX>s.right-o,this.tickUp=e.clientY<s.top+o&&!i,this.tickDown=e.clientY>s.bottom-o&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},RowHighlightPosition=(e=>(e[e.Above=0]="Above",e[e.Below=1]="Below",e))(RowHighlightPosition||{}),RowDragFeature=class extends BeanStub{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.sortController=e.sortController,this.filterManager=e.filterManager,this.selectionService=e.selectionService,this.mouseEventService=e.mouseEventService,this.ctrlsService=e.ctrlsService,this.funcColsService=e.funcColsService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(e=>{const t=e.gridBodyCtrl;this.autoScrollService=new AutoScrollService({scrollContainer:t.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:i=>t.getScrollFeature().setVerticalScrollPosition(i),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})})}getContainer(){return this.eContainer}isInterestedIn(e){return e===2}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?"notAllowed":"move"}shouldPreventRowMove(){return!!(this.funcColsService.getRowGroupColumns().length||this.filterManager?.isAnyFilterPresent()||this.sortController.isSortActive())}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const s=[...this.selectionService.getSelectedNodes()].sort((o,r)=>o.rowIndex==null||r.rowIndex==null?0:this.getRowIndexNumber(o)-this.getRowIndexNumber(r));if(s.indexOf(t)!==-1)return s}return[t]}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent("rowDragEnter",e),this.getRowNodes(e).forEach(t=>{t.setDragging(!0)}),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gos.getDomDataKey()}isDropZoneWithinThisGrid(e){const i=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:s}=e;return!i.contains(s)}onEnterOrDragging(e){this.dispatchGridEvent("rowDragMove",e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),s=this.gos.get("rowDragManaged"),o=e.dragItem.rowNodes;s&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!i?this.isDropZoneWithinThisGrid(e)||this.clientSideRowModel.highlightRowAtPixel(o[0],t):this.moveRows(o,t))}getRowIndexNumber(e){const t=e.getRowIndexString();return parseInt(_last(t.split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&t.highlighted===1,s=this.mouseEventService.getNormalisedPosition(e).y,o=e.dragItem.rowNodes;let r=i?1:0;if(this.isFromThisGrid(e))o.forEach(n=>{n.rowTop<s&&(r-=1)}),this.moveRows(o,s,r);else{const n=this.gos.getRowIdCallback();let l=this.clientSideRowModel.getRowIndexAtPixel(s)+1;this.clientSideRowModel.getHighlightPosition(s)===0&&l--,this.clientSideRowModel.updateRowData({add:o.map(a=>a.data).filter(a=>!this.clientSideRowModel.getRowNode(n?.({data:a,level:0})??a.id)),addIndex:l})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),this.rangeService?.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer()){_warnOnce("addRowDropZone - A container target needs to be provided");return}if(this.dragAndDropService.findExternalZone(e)){_warnOnce("addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");return}let t={getContainer:e.getContainer};e.fromGrid?t=e:(e.onDragEnter&&(t.onDragEnter=i=>{e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",i))}),e.onDragLeave&&(t.onDragLeave=i=>{e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",i))}),e.onDragging&&(t.onDragging=i=>{e.onDragging(this.draggingToRowDragEvent("rowDragMove",i))}),e.onDragStop&&(t.onDragStop=i=>{e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",i))})),this.dragAndDropService.addDropTarget({isInterestedIn:i=>i===2,getIconName:()=>"move",external:!0,...t})}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),s=this.onDragLeave.bind(this),o=this.onDragging.bind(this),r=this.onDragStop.bind(this);return e?{getContainer:t,onDragEnter:e.onDragEnter?n=>{i(n),e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",n))}:i,onDragLeave:e.onDragLeave?n=>{s(n),e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",n))}:s,onDragging:e.onDragging?n=>{o(n),e.onDragging(this.draggingToRowDragEvent("rowDragMove",n))}:o,onDragStop:e.onDragStop?n=>{r(n),e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",n))}:r,fromGrid:!0}:{getContainer:t,onDragEnter:i,onDragLeave:s,onDragging:o,onDragStop:r,fromGrid:!0}}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y,s=i>this.pageBoundsService.getCurrentPageHeight();let o=-1,r;s||(o=this.rowModel.getRowIndexAtPixel(i),r=this.rowModel.getRow(o));let n;switch(t.vDirection){case 1:n="down";break;case 0:n="up";break;default:n=null;break}return this.gos.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:o,overNode:r,y:i,vDirection:n})}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(e){this.dispatchGridEvent("rowDragEnd",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&(this.gos.get("suppressMoveWhenRowDragging")||!this.isFromThisGrid(e))&&!this.isDropZoneWithinThisGrid(e)&&this.moveRowAndClearHighlight(e)}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach(t=>{t.setDragging(!1)})}},DragService=class extends BeanStub{constructor(){super(...arguments),this.beanName="dragService",this.dragEndFunctions=[],this.dragSources=[]}wireBeans(e){this.mouseEventService=e.mouseEventService}destroy(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0,super.destroy()}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const s=e.touchStartListener;t.removeEventListener("touchstart",s,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find(i=>i.dragSource===e);t&&(this.removeListener(t),_removeFromArray(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:s,stopPropagationForTouch:o}=e;i.addEventListener("mousedown",t);let r=null;const n=this.gos.get("suppressTouch");s&&!n&&(r=l=>{_isFocusableFormField(l.target)||(l.cancelable&&(l.preventDefault(),o&&l.stopPropagation()),this.onTouchStart(e,l))},i.addEventListener("touchstart",r,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:r,touchEnabled:!!s})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const s=a=>this.onTouchMove(a,e.eElement),o=a=>this.onTouchUp(a,e.eElement),r=a=>{a.cancelable&&a.preventDefault()},n=t.target,l=[{target:this.gos.getRootNode(),type:"touchmove",listener:r,options:{passive:!1}},{target:n,type:"touchmove",listener:s,options:{passive:!0}},{target:n,type:"touchend",listener:o,options:{passive:!0}},{target:n,type:"touchcancel",listener:o,options:{passive:!0}}];this.addTemporaryEvents(l),e.dragStartPixels===0&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t)||i._alreadyProcessedByDragService||(i._alreadyProcessedByDragService=!0,t.button!==0))return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const s=a=>this.onMouseMove(a,e.eElement),o=a=>this.onMouseUp(a,e.eElement),r=a=>a.preventDefault(),n=this.gos.getRootNode(),l=[{target:n,type:"mousemove",listener:s},{target:n,type:"mouseup",listener:o},{target:n,type:"contextmenu",listener:r}];this.addTemporaryEvents(l),e.dragStartPixels===0&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach(t=>{const{target:i,type:s,listener:o,options:r}=t;i.addEventListener(s,o,r)}),this.dragEndFunctions.push(()=>{e.forEach(t=>{const{target:i,type:s,listener:o,options:r}=t;i.removeEventListener(s,o,r)})})}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams,s=_exists(i)?i:4;return _areEventsNear(e,t,s)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(e,t))return;this.dragging=!0;const s={type:"dragStarted",target:i};this.eventService.dispatchEvent(s),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){_isBrowserSafari()&&this.gos.getDocument().getSelection()?.removeAllRanges(),this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gos.get("enableCellTextSelection"),i=e.type==="mousemove";return t&&i&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){return!!e.target?.tagName.toLocaleLowerCase()?.match("^a$|textarea|input|select|button")}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(e);const i={type:"dragStopped",target:t};this.eventService.dispatchEvent(i)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(i=>i()),this.dragEndFunctions.length=0}},RowDragComp=class extends Component{constructor(e,t,i,s,o,r){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=s,this.dragStartPixels=o,this.suppressVisibilityChange=r,this.dragSource=null}wireBeans(e){this.beans=e}isCustomGui(){return this.customGui!=null}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(_createIconNoSpan("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gos.get("rowDragManaged")?new ManagedVisibilityStrategy(this,this.beans,this.rowNode,this.column):new NonManagedVisibilityStrategy(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e),this.addDragSource(t)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const t=this.beans.selectionService.getSelectedNodes();return t.indexOf(this.rowNode)!==-1?t:[this.rowNode]}checkCompatibility(){const e=this.gos.get("rowDragManaged");this.gos.get("treeData")&&e&&_warnOnce("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gos.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:this.getGui(),dragItemName:()=>{const i=this.getDragItem(),s=i.rowNodes?.length||1,o=this.getRowDragText(this.column);return o?o(i,s):s===1?this.cellValueFn():`${s} ${t("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}destroy(){this.removeDragSource(),super.destroy()}removeDragSource(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null}},VisibilityStrategy=class extends BeanStub{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let i=!0,s=!1;this.column&&(i=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),s=_isFunction(this.column.getColDef().rowDrag)),s?(this.parent.setDisplayed(!0,t),this.parent.setVisible(i,t)):(this.parent.setDisplayed(i,t),this.parent.setVisible(!0,t))}}},NonManagedVisibilityStrategy=class extends VisibilityStrategy{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this));const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:e}),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(e)}},ManagedVisibilityStrategy=class extends VisibilityStrategy{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.beans.eventService,{sortChanged:e,filterChanged:e,columnRowGroupChanged:e,newColumnsLoaded:e}),this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const t=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(),i=t&&t.shouldPreventRowMove(),s=this.gos.get("suppressRowDrag"),o=this.beans.dragAndDropService.hasExternalDropZones(),r=i&&!o||s;this.setDisplayedOrVisible(r)}},_RowNode=class T{constructor(t){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=T.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=t}setData(t){this.setDataCommon(t,!1)}updateData(t){this.setDataCommon(t,!0)}setDataCommon(t,i){const s=this.data;this.data=t,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const o=this.createDataChangedEvent(t,s,i);this.localEventService?.dispatchEvent(o)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(t,i,s){return{type:"dataChanged",node:this,oldData:i,newData:t,update:s}}getRowIndexString(){return this.rowIndex==null?(_errorOnce("Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid."),null):this.rowPinned==="top"?"t-"+this.rowIndex:this.rowPinned==="bottom"?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const t=new T(this.beans);return t.id=this.id,t.data=this.data,t.__daemon=!0,t.selected=this.selected,t.level=this.level,t}setDataAndId(t,i){const s=_exists(this.id)?this.createDaemonNode():null,o=this.data;this.data=t,this.updateDataOnDetailNode(),this.setId(i),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,s);const r=this.createDataChangedEvent(t,o,!1);this.localEventService?.dispatchEvent(r)}checkRowSelectable(){const t=this.beans.gos.get("isRowSelectable");this.setRowSelectable(t?t(this):!0)}setRowSelectable(t,i){if(this.selectable!==t){if(this.selectable=t,this.dispatchRowEvent("selectableChanged"),i)return;if(this.beans.gos.get("groupSelectsChildren")){const o=this.calculateSelectedFromChildren();this.setSelectedParams({newValue:o??!1,source:"selectableChanged"});return}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(t){const i=this.beans.gos.getRowIdCallback();if(i)if(this.data){const s=this.getGroupKeys(!0);this.id=i({data:this.data,parentKeys:s.length>0?s:void 0,level:this.level}),this.id.startsWith(T.ID_PREFIX_ROW_GROUP)&&_errorOnce(`Row IDs cannot start with ${T.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`)}else this.id=void 0;else this.id=t}getGroupKeys(t=!1){const i=[];let s=this;for(t&&(s=s.parent);s&&s.level>=0;)i.push(s.key),s=s.parent;return i.reverse(),i}isPixelInRange(t){return!_exists(this.rowTop)||!_exists(this.rowHeight)?!1:t>=this.rowTop&&t<this.rowTop+this.rowHeight}updateIfDifferent(t,i,s){this[t]!==i&&(this[t]=i,this.dispatchRowEvent(s))}setFirstChild(t){this.updateIfDifferent("firstChild",t,"firstChildChanged")}setLastChild(t){this.updateIfDifferent("lastChild",t,"lastChildChanged")}setChildIndex(t){this.updateIfDifferent("childIndex",t,"childIndexChanged")}setRowTop(t){this.oldRowTop=this.rowTop,this.rowTop!==t&&(this.rowTop=t,this.dispatchRowEvent("topChanged"),this.setDisplayed(t!==null))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(t){this.updateIfDifferent("displayed",t,"displayedChanged")}setDragging(t){this.updateIfDifferent("dragging",t,"draggingChanged")}setHighlighted(t){this.updateIfDifferent("highlighted",t,"rowHighlightChanged")}setHovered(t){this.hovered!==t&&(this.hovered=t)}isHovered(){return this.hovered}setAllChildrenCount(t){this.updateIfDifferent("allChildrenCount",t,"allChildrenCountChanged")}setMaster(t){this.master!==t&&(this.master&&!t&&(this.expanded=!1),this.master=t,this.dispatchRowEvent("masterChanged"))}setGroup(t){this.group!==t&&(this.group&&!t&&(this.expanded=!1),this.group=t,this.updateHasChildren(),this.checkRowSelectable(),this.dispatchRowEvent("groupChanged"))}setRowHeight(t,i=!1){this.rowHeight=t,this.rowHeightEstimated=i,this.dispatchRowEvent("heightChanged")}setRowAutoHeight(t,i){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[i.getId()]=t,t!=null&&(this.checkAutoHeightsDebounced==null&&(this.checkAutoHeightsDebounced=_debounce(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let t=!1,i=!0,s=0;const o=this.__autoHeights;if(o==null||(this.beans.visibleColsService.getAllAutoHeightCols().forEach(l=>{let a=o[l.getId()];if(a==null)if(this.beans.columnModel.isColSpanActive()){let d=[];switch(l.getPinned()){case"left":d=this.beans.visibleColsService.getLeftColsForRow(this);break;case"right":d=this.beans.visibleColsService.getRightColsForRow(this);break;case null:d=this.beans.columnViewportService.getColsWithinViewport(this);break}if(d.includes(l)){t=!0;return}a=-1}else{t=!0;return}else i=!1;a>s&&(s=a)}),t)||((i||s<10)&&(s=this.beans.gos.getRowHeightForNode(this).height),s==this.rowHeight))return;this.setRowHeight(s);const n=this.beans.rowModel;n.onRowHeightChangedDebounced&&n.onRowHeightChangedDebounced()}setRowIndex(t){this.updateIfDifferent("rowIndex",t,"rowIndexChanged")}setUiLevel(t){this.updateIfDifferent("uiLevel",t,"uiLevelChanged")}setExpanded(t,i,s){if(this.expanded===t)return;this.expanded=t,this.dispatchRowEvent("expandedChanged");const o={...this.createGlobalRowEvent("rowGroupOpened"),expanded:t,event:i||null};this.beans.rowNodeEventThrottle.dispatchExpanded(o,s),this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(t){return this.beans.gos.addGridCommonParams({type:t,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}setDataValue(t,i,s){const r=typeof t!="string"?t:this.beans.columnModel.getCol(t)??this.beans.columnModel.getColDefCol(t),n=this.getValueFromValueService(r);if(this.beans.gos.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(r,n,i,s),!1;const l=this.beans.valueService.setValue(this,r,i,s);return this.dispatchCellChangedEvent(r,i,n),this.checkRowSelectable(),l}getValueFromValueService(t){const i=this.leafGroup&&this.beans.columnModel.isPivotMode(),s=this.group&&this.expanded&&!this.footer&&!i;let o=!1;const r=this.beans.gos.get("groupTotalRow")??this.beans.gos.get("groupIncludeFooter");typeof r!="function"?o=!!r:o=!!(this.beans.gos.getCallback("groupTotalRow")??this.beans.gos.getCallback("groupIncludeFooter"))({node:this});const n=this.beans.gos.get("groupSuppressBlankHeader"),l=s&&o&&!n;return this.beans.valueService.getValue(t,this,!1,l)}dispatchEventForSaveValueReadOnly(t,i,s,o){const r=this.beans.gos.addGridCommonParams({type:"cellEditRequest",event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:t,colDef:t.getColDef(),data:this.data,node:this,oldValue:i,newValue:s,value:s,source:o});this.beans.eventService.dispatchEvent(r)}setGroupValue(t,i){const s=this.beans.columnModel.getCol(t);_missing(this.groupData)&&(this.groupData={});const o=s.getColId(),r=this.groupData[o];r!==i&&(this.groupData[o]=i,this.dispatchCellChangedEvent(s,i,r))}setAggData(t){const i=this.aggData;if(this.aggData=t,this.localEventService){const s=o=>{const r=this.aggData?this.aggData[o]:void 0,n=i?i[o]:void 0;if(r===n)return;const l=this.beans.columnModel.getCol(o);l&&this.dispatchCellChangedEvent(l,r,n)};for(const o in this.aggData)s(o);for(const o in t)o in this.aggData||s(o)}}updateHasChildren(){let t=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gos.isRowModelType("serverSide")){const s=this.beans.gos.get("treeData"),o=this.beans.gos.get("isServerSideGroup");t=!this.stub&&!this.footer&&(s?!!o&&o(this.data):!!this.group)}t!==this.__hasChildren&&(this.__hasChildren=!!t,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return(this.group&&_missingOrEmpty(this.childrenAfterGroup))??!1}dispatchCellChangedEvent(t,i,s){const o={type:"cellChanged",node:this,column:t,newValue:i,oldValue:s};this.localEventService?.dispatchEvent(o)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.footer?!1:this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||!!this.master}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(t){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(i=>i.depthFirstSearch(t)),t(this)}calculateSelectedFromChildren(){let t=!1,i=!1,s=!1;if(!this.childrenAfterGroup?.length)return this.selectable?this.selected:null;for(let o=0;o<this.childrenAfterGroup.length;o++){const r=this.childrenAfterGroup[o];let n=r.isSelected();if(!r.selectable){const l=r.calculateSelectedFromChildren();if(l===null)continue;n=l}switch(n){case!0:t=!0;break;case!1:i=!0;break;default:s=!0;break}}if(!(s||t&&i))return t?!0:i?!1:this.selectable?this.selected:null}setSelectedInitialValue(t){this.selected=t}dispatchRowEvent(t){const i={type:t,node:this};this.localEventService?.dispatchEvent(i)}selectThisNode(t,i,s="api"){const o=!this.selectable&&t,r=this.selected===t;if(o||r)return!1;this.selected=t,this.dispatchRowEvent("rowSelected");const n=this.sibling;n&&n.footer&&n.localEventService&&n.dispatchRowEvent("rowSelected");const l={...this.createGlobalRowEvent("rowSelected"),event:i||null,source:s};return this.beans.eventService.dispatchEvent(l),!0}setSelected(t,i=!1,s="api"){if(typeof s=="boolean"){_warnOnce("since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.");return}this.setSelectedParams({newValue:t,clearSelection:i,rangeSelect:!1,source:s})}setSelectedParams(t){return this.rowPinned?(_warnOnce("cannot select pinned rows"),0):this.id===void 0?(_warnOnce("cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected({...t,nodes:[this.footer?this.sibling:this]})}isRowPinned(){return this.rowPinned==="top"||this.rowPinned==="bottom"}isParentOfNode(t){let i=this.parent;for(;i;){if(i===t)return!0;i=i.parent}return!1}addEventListener(t,i){this.localEventService||(this.localEventService=new LocalEventService),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.localEventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new FrameworkEventListenerService(this.beans.frameworkOverrides));const s=this.frameworkEventListenerService?.wrap(i)??i;this.localEventService.addEventListener(t,s)}removeEventListener(t,i){if(!this.localEventService)return;const s=this.frameworkEventListenerService?.unwrap(i)??i;this.localEventService.removeEventListener(t,s),this.localEventService.noRegisteredListenersExist()&&(this.localEventService=null)}onMouseEnter(){this.dispatchRowEvent("mouseEnter")}onMouseLeave(){this.dispatchRowEvent("mouseLeave")}getFirstChildOfFirstChild(t){let i=this,s=!0,o=!1,r=null;for(;s&&!o;){const n=i.parent;_exists(n)&&i.firstChild?n.rowGroupColumn===t&&(o=!0,r=n):s=!1,i=n}return o?r:null}isFullWidthCell(){if(this.detail)return!0;const t=this.beans.gos.getCallback("isFullWidthRow");return t?t({rowNode:this}):!1}getRoute(){if(this.key==null)return;const t=[];let i=this;for(;i&&i.key!=null;)t.push(i.key),i=i.parent;return t.reverse()}createFooter(){if(this.sibling)return;const t=new Set(["eventService","__objectId","sticky"]),i=new T(this.beans);Object.keys(this).forEach(s=>{t.has(s)||(i[s]=this[s])}),i.footer=!0,i.setRowTop(null),i.setRowIndex(null),i.oldRowTop=null,i.id="rowGroupFooter_"+this.id,i.sibling=this,this.sibling=i}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}};_RowNode.ID_PREFIX_ROW_GROUP="row-group-",_RowNode.ID_PREFIX_TOP_PINNED="t-",_RowNode.ID_PREFIX_BOTTOM_PINNED="b-",_RowNode.OBJECT_ID_SEQUENCE=0;var RowNode=_RowNode,FilterManager=class extends BeanStub{constructor(){super(...arguments),this.beanName="filterManager",this.advancedFilterModelUpdateQueue=[]}wireBeans(e){this.columnModel=e.columnModel,this.dataTypeService=e.dataTypeService,this.quickFilterService=e.quickFilterService,this.advancedFilterService=e.advancedFilterService,this.columnFilterService=e.columnFilterService}postConstruct(){this.addManagedEventListeners({columnValueChanged:this.refreshFiltersForAggregations.bind(this),columnPivotChanged:this.refreshFiltersForAggregations.bind(this),columnPivotModeChanged:this.refreshFiltersForAggregations.bind(this),newColumnsLoaded:this.updateAdvancedFilterColumns.bind(this),columnVisible:this.updateAdvancedFilterColumns.bind(this),advancedFilterEnabledChanged:({enabled:e})=>this.onAdvancedFilterEnabledChanged(e),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.addManagedPropertyListener("advancedFilterModel",e=>this.setAdvancedFilterModel(e.currentValue)),this.quickFilterService&&this.addManagedListeners(this.quickFilterService,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"?e({}):!1}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"?t(e):!1}setFilterModel(e,t="api"){if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}this.columnFilterService?.setFilterModel(e,t)}getFilterModel(){return this.columnFilterService?.getFilterModel()??{}}isColumnFilterPresent(){return!!this.columnFilterService?.isColumnFilterPresent()}isAggregateFilterPresent(){return!!this.columnFilterService?.isAggregateFilterPresent()}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){e?this.columnFilterService?.disableColumnFilters()&&this.onFilterChanged({source:"advancedFilter"}):this.advancedFilterService?.isFilterPresent()&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){return!!this.advancedFilterService?.isEnabled()}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}resetQuickFilterCache(){this.quickFilterService?.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gos.getGroupAggFiltering()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:i,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.columnFilterService?this.columnFilterService.updateBeforeFilterChanged(e):AgPromise.resolve()).then(()=>{const o={source:t,type:"filterChanged",columns:s};i&&_mergeDeep(o,i),this.eventService.dispatchEvent(o),this.columnFilterService?.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){return!!this.columnFilterService?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilterService?.isQuickFilterPresent()}updateAggFiltering(){this.aggFiltering=!!this.gos.getGroupAggFiltering()}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.columnModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isAggregateFilterPresent()&&!this.columnFilterService.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode)||this.isColumnFilterPresent()&&!this.columnFilterService.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip)||this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))}isFilterActive(e){return!!this.columnFilterService?.isFilterActive(e)}getOrCreateFilterWrapper(e){return this.columnFilterService?.getOrCreateFilterWrapper(e)??null}getDefaultFloatingFilter(e){return this.columnFilterService.getDefaultFloatingFilter(e)}createFilterParams(e,t){return this.columnFilterService.createFilterParams(e,t)}isFilterAllowed(e){return this.isAdvancedFilterEnabled()?!1:!!this.columnFilterService?.isFilterAllowed(e)}getFloatingFilterCompDetails(e,t){return this.columnFilterService?.getFloatingFilterCompDetails(e,t)}getCurrentFloatingFilterParentModel(e){return this.columnFilterService?.getCurrentFloatingFilterParentModel(e)}destroyFilter(e,t="api"){this.columnFilterService?.destroyFilter(e,t)}areFilterCompsDifferent(e,t){return!!this.columnFilterService?.areFilterCompsDifferent(e,t)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){if(this.isAdvancedFilterEnabled()){if(this.dataTypeService?.isPendingInference()){this.advancedFilterModelUpdateQueue.push(e);return}this.advancedFilterService.setModel(e??null),this.onFilterChanged({source:"advancedFilter"})}}toggleAdvancedFilterBuilder(e,t){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(t,e)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return this.isAdvancedFilterEnabled()?!1:!!this.columnFilterService?.hasFloatingFilters()}getFilterInstance(e,t){if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}return this.columnFilterService?.getFilterInstance(e,t)}getColumnFilterInstance(e){return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve(void 0)):this.columnFilterService?.getColumnFilterInstance(e)??Promise.resolve(void 0)}warnAdvancedFilters(){_warnOnce("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){this.advancedFilterService?.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.advancedFilterModelUpdateQueue.forEach(e=>this.setAdvancedFilterModel(e)),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){return this.columnFilterService?.getColumnFilterModel(e)}setColumnFilterModel(e,t){return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve()):this.columnFilterService?.setColumnFilterModel(e,t)??Promise.resolve()}},FilterWrapperComp=class extends Component{constructor(e,t){super('<div class="ag-filter"></div>'),this.column=e,this.source=t,this.filterWrapper=null}wireBeans(e){this.filterManager=e.filterManager,this.columnModel=e.columnModel}postConstruct(){this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return!!this.filterWrapper}getFilter(){return this.filterWrapper?.filterPromise??null}afterInit(){return this.filterWrapper?.filterPromise?.then(()=>{})??AgPromise.resolve()}afterGuiAttached(e){this.filterWrapper?.filterPromise?.then(t=>{t?.afterGuiAttached?.(e)})}afterGuiDetached(){this.filterWrapper?.filterPromise?.then(e=>{e?.afterGuiDetached?.()})}createFilter(e){const{column:t,source:i}=this;this.filterWrapper=this.filterManager?.getOrCreateFilterWrapper(t)??null,this.filterWrapper?.filterPromise&&this.filterWrapper.filterPromise.then(s=>{const o=s.getGui();if(_exists(o)||_warnOnce(`getGui method from filter returned ${o}; it should be a DOM element.`),this.appendChild(o),e){const r={type:"filterOpened",column:t,source:i,eGui:this.getGui()};this.eventService.dispatchEvent(r)}})}onFilterDestroyed(e){(e.source==="api"||e.source==="paramsUpdated")&&e.column.getId()===this.column.getId()&&this.columnModel.getColDefCol(this.column)&&(_clearElement(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}},RESIZE_CONTAINER_STYLE="ag-resizer-wrapper",RESIZE_TEMPLATE=`<div class="${RESIZE_CONTAINER_STYLE}">
|
|
50
|
+
</div>`,DragAndDropService=class extends BeanStub{constructor(){super(...arguments),this.beanName="dragAndDropService",this.dragSourceAndParamsList=[],this.dropTargets=[]}wireBeans(e){this.dragService=e.dragService,this.mouseEventService=e.mouseEventService,this.environment=e.environment}postConstruct(){this.dropIconMap={pinned:_createIcon("columnMovePin",this.gos,null),hide:_createIcon("columnMoveHide",this.gos,null),move:_createIcon("columnMoveMove",this.gos,null),left:_createIcon("columnMoveLeft",this.gos,null),right:_createIcon("columnMoveRight",this.gos,null),group:_createIcon("columnMoveGroup",this.gos,null),aggregate:_createIcon("columnMoveValue",this.gos,null),pivot:_createIcon("columnMovePivot",this.gos,null),notAllowed:_createIcon("dropNotAllowed",this.gos,null)}}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}removeDragSource(e){const t=this.dragSourceAndParamsList.find(i=>i.dragSource===e);t&&(this.dragService.removeDragSource(t.params),_removeFromArray(this.dragSourceAndParamsList,t))}destroy(){this.dragSourceAndParamsList.forEach(e=>this.dragService.removeDragSource(e.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0,super.destroy()}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(e){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=void 0,this.dragItem=null,this.removeGhost()}onDragging(e,t){const i=this.getHorizontalDirection(e),s=this.getVerticalDirection(e);this.eventLastTime=e,this.positionGhost(e);const o=this.dropTargets.filter(n=>this.isMouseOnDropTarget(e,n)),r=this.findCurrentDropTarget(e,o);if(r!==this.lastDropTarget)this.leaveLastTargetIfExists(e,i,s,t),this.lastDropTarget!==null&&r===null&&this.dragSource.onGridExit?.(this.dragItem),this.lastDropTarget===null&&r!==null&&this.dragSource.onGridEnter?.(this.dragItem),this.enterDragTargetIfExists(r,e,i,s,t),this.lastDropTarget=r;else if(r&&r.onDragging){const n=this.createDropTargetEvent(r,e,i,s,t);r.onDragging(n)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const s=i.getBoundingClientRect();if(s.width===0||s.height===0)return!1;const o=e.clientX>=s.left&&e.clientX<s.right,r=e.clientY>=s.top&&e.clientY<s.bottom;if(!o||!r)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let s=!1;for(const o of i)if(this.allContainersIntersect(e,o)){s=!0;break}return t.targetContainsSource&&!t.getContainer().contains(this.dragSource.eElement)?!1:s&&t.isInterestedIn(this.dragSource.type,this.dragSource.eElement)}findCurrentDropTarget(e,t){const i=t.length;if(i===0)return null;if(i===1)return t[0];const o=this.gos.getRootNode().elementsFromPoint(e.clientX,e.clientY);for(const r of o)for(const n of t)if(_flatten(this.getAllContainersFromDropTarget(n)).indexOf(r)!==-1)return n;return null}enterDragTargetIfExists(e,t,i,s,o){if(e){if(e.onDragEnter){const r=this.createDropTargetEvent(e,t,i,s,o);e.onDragEnter(r)}this.setGhostIcon(e.getIconName?e.getIconName():null)}}leaveLastTargetIfExists(e,t,i,s){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const o=this.createDropTargetEvent(this.lastDropTarget,e,t,i,s);this.lastDropTarget.onDragLeave(o)}this.setGhostIcon(null)}}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter(t=>t.getContainer()!==e.getContainer())}hasExternalDropZones(){return this.dropTargets.some(e=>e.external)}findExternalZone(e){return this.dropTargets.filter(i=>i.external).find(i=>i.getContainer()===e.getContainer())||null}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?0:1}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?0:1}createDropTargetEvent(e,t,i,s,o){const r=e.getContainer(),n=r.getBoundingClientRect(),{dragItem:l,dragSource:a}=this,d=t.clientX-n.left,h=t.clientY-n.top;return this.gos.addGridCommonParams({event:t,x:d,y:h,vDirection:s,hDirection:i,dragSource:a,fromNudge:o,dragItem:l,dropZoneTarget:r})}positionGhost(e){const t=this.eGhost;if(!t)return;const s=t.getBoundingClientRect().height,o=_getBodyWidth()-2,r=_getBodyHeight()-2,n=_getElementRectWithOffset(t.offsetParent),{clientY:l,clientX:a}=e;let d=l-n.top-s/2,h=a-n.left-10;const c=this.gos.getDocument(),u=c.defaultView||window,g=u.pageYOffset||c.documentElement.scrollTop,p=u.pageXOffset||c.documentElement.scrollLeft;o>0&&h+t.clientWidth>o+p&&(h=o+p-t.clientWidth),h<0&&(h=0),r>0&&d+t.clientHeight>r+g&&(d=r+g-t.clientHeight),d<0&&(d=0),t.style.left=`${h}px`,t.style.top=`${d}px`}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=_loadTemplate(GHOST_TEMPLATE),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost),this.environment.applyThemeClasses(this.eGhost),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const e=this.eGhost.querySelector(".ag-dnd-ghost-label");let t=this.dragSource.dragItemName;_isFunction(t)&&(t=t()),e.innerHTML=_escapeString(t)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const i=this.gos.getDocument();let s=null,o=null;try{s=i.fullscreenElement}catch{}finally{s||(s=this.gos.getRootNode());const r=s.querySelector("body");r?o=r:s instanceof ShadowRoot?o=s:s instanceof Document?o=s?.documentElement:o=s}this.eGhostParent=o,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):_warnOnce("Could not find document body, it is needed for dragging columns")}setGhostIcon(e,t=!1){_clearElement(this.eGhostIcon);let i=null;e||(e=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():"notAllowed"),i=this.dropIconMap[e],this.eGhostIcon.classList.toggle("ag-shake-left-to-right",t),!(i===this.dropIconMap.hide&&this.gos.get("suppressDragLeaveHidesColumns"))&&i&&this.eGhostIcon.appendChild(i)}},AutoScrollService=class{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=e.scrollAxis.indexOf("x")!==-1,this.scrollVertically=e.scrollAxis.indexOf("y")!==-1,this.scrollByTick=e.scrollByTick!=null?e.scrollByTick:20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}check(e,t=!1){const i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const s=this.scrollContainer.getBoundingClientRect(),o=this.scrollByTick;this.tickLeft=e.clientX<s.left+o,this.tickRight=e.clientX>s.right-o,this.tickUp=e.clientY<s.top+o&&!i,this.tickDown=e.clientY>s.bottom-o&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){this.tickingInterval===null&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){this.tickCount++;const e=this.tickCount>20?200:this.tickCount>10?80:40;if(this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}},RowHighlightPosition=(e=>(e[e.Above=0]="Above",e[e.Below=1]="Below",e))(RowHighlightPosition||{}),RowDragFeature=class extends BeanStub{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.sortController=e.sortController,this.filterManager=e.filterManager,this.selectionService=e.selectionService,this.mouseEventService=e.mouseEventService,this.ctrlsService=e.ctrlsService,this.funcColsService=e.funcColsService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){this.gos.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.ctrlsService.whenReady(e=>{const t=e.gridBodyCtrl;this.autoScrollService=new AutoScrollService({scrollContainer:t.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>t.getScrollFeature().getVScrollPosition().top,setVerticalPosition:i=>t.getScrollFeature().setVerticalScrollPosition(i),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})})}getContainer(){return this.eContainer}isInterestedIn(e){return e===2}getIconName(){return this.gos.get("rowDragManaged")&&this.shouldPreventRowMove()?"notAllowed":"move"}shouldPreventRowMove(){return!!(this.funcColsService.getRowGroupColumns().length||this.filterManager?.isAnyFilterPresent()||this.sortController.isSortActive())}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=e.dragItem.rowNode;if(this.gos.get("rowDragMultiRow")){const s=[...this.selectionService.getSelectedNodes()].sort((o,r)=>o.rowIndex==null||r.rowIndex==null?0:this.getRowIndexNumber(o)-this.getRowIndexNumber(r));if(s.indexOf(t)!==-1)return s}return[t]}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent("rowDragEnter",e),this.getRowNodes(e).forEach(t=>{t.setDragging(!0)}),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gos.getDomDataKey()}isDropZoneWithinThisGrid(e){const i=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:s}=e;return!i.contains(s)}onEnterOrDragging(e){this.dispatchGridEvent("rowDragMove",e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gos.get("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),s=this.gos.get("rowDragManaged"),o=e.dragItem.rowNodes;s&&this.shouldPreventRowMove()||(this.gos.get("suppressMoveWhenRowDragging")||!i?this.isDropZoneWithinThisGrid(e)||this.clientSideRowModel.highlightRowAtPixel(o[0],t):this.moveRows(o,t))}getRowIndexNumber(e){const t=e.getRowIndexString();return parseInt(_last(t.split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&t.highlighted===1,s=this.mouseEventService.getNormalisedPosition(e).y,o=e.dragItem.rowNodes;let r=i?1:0;if(this.isFromThisGrid(e))o.forEach(n=>{n.rowTop<s&&(r-=1)}),this.moveRows(o,s,r);else{const n=this.gos.getRowIdCallback();let l=this.clientSideRowModel.getRowIndexAtPixel(s)+1;this.clientSideRowModel.getHighlightPosition(s)===0&&l--,this.clientSideRowModel.updateRowData({add:o.filter(a=>!this.clientSideRowModel.getRowNode(n?.({data:a.data,level:0,rowPinned:a.rowPinned})??a.data.id)).map(a=>a.data),addIndex:l})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),this.rangeService?.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer()){_warnOnce("addRowDropZone - A container target needs to be provided");return}if(this.dragAndDropService.findExternalZone(e)){_warnOnce("addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");return}let t={getContainer:e.getContainer};e.fromGrid?t=e:(e.onDragEnter&&(t.onDragEnter=i=>{e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",i))}),e.onDragLeave&&(t.onDragLeave=i=>{e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",i))}),e.onDragging&&(t.onDragging=i=>{e.onDragging(this.draggingToRowDragEvent("rowDragMove",i))}),e.onDragStop&&(t.onDragStop=i=>{e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",i))})),this.dragAndDropService.addDropTarget({isInterestedIn:i=>i===2,getIconName:()=>"move",external:!0,...t})}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),s=this.onDragLeave.bind(this),o=this.onDragging.bind(this),r=this.onDragStop.bind(this);return e?{getContainer:t,onDragEnter:e.onDragEnter?n=>{i(n),e.onDragEnter(this.draggingToRowDragEvent("rowDragEnter",n))}:i,onDragLeave:e.onDragLeave?n=>{s(n),e.onDragLeave(this.draggingToRowDragEvent("rowDragLeave",n))}:s,onDragging:e.onDragging?n=>{o(n),e.onDragging(this.draggingToRowDragEvent("rowDragMove",n))}:o,onDragStop:e.onDragStop?n=>{r(n),e.onDragStop(this.draggingToRowDragEvent("rowDragEnd",n))}:r,fromGrid:!0}:{getContainer:t,onDragEnter:i,onDragLeave:s,onDragging:o,onDragStop:r,fromGrid:!0}}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y,s=i>this.pageBoundsService.getCurrentPageHeight();let o=-1,r;s||(o=this.rowModel.getRowIndexAtPixel(i),r=this.rowModel.getRow(o));let n;switch(t.vDirection){case 1:n="down";break;case 0:n="up";break;default:n=null;break}return this.gos.addGridCommonParams({type:e,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:o,overNode:r,y:i,vDirection:n})}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent("rowDragLeave",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&this.clearRowHighlight()}onDragStop(e){this.dispatchGridEvent("rowDragEnd",e),this.stopDragging(e),this.gos.get("rowDragManaged")&&(this.gos.get("suppressMoveWhenRowDragging")||!this.isFromThisGrid(e))&&!this.isDropZoneWithinThisGrid(e)&&this.moveRowAndClearHighlight(e)}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach(t=>{t.setDragging(!1)})}},DragService=class extends BeanStub{constructor(){super(...arguments),this.beanName="dragService",this.dragEndFunctions=[],this.dragSources=[]}wireBeans(e){this.mouseEventService=e.mouseEventService}destroy(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0,super.destroy()}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const s=e.touchStartListener;t.removeEventListener("touchstart",s,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find(i=>i.dragSource===e);t&&(this.removeListener(t),_removeFromArray(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:s,stopPropagationForTouch:o}=e;i.addEventListener("mousedown",t);let r=null;const n=this.gos.get("suppressTouch");s&&!n&&(r=l=>{_isFocusableFormField(l.target)||(l.cancelable&&(l.preventDefault(),o&&l.stopPropagation()),this.onTouchStart(e,l))},i.addEventListener("touchstart",r,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:r,touchEnabled:!!s})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const s=a=>this.onTouchMove(a,e.eElement),o=a=>this.onTouchUp(a,e.eElement),r=a=>{a.cancelable&&a.preventDefault()},n=t.target,l=[{target:this.gos.getRootNode(),type:"touchmove",listener:r,options:{passive:!1}},{target:n,type:"touchmove",listener:s,options:{passive:!0}},{target:n,type:"touchend",listener:o,options:{passive:!0}},{target:n,type:"touchcancel",listener:o,options:{passive:!0}}];this.addTemporaryEvents(l),e.dragStartPixels===0&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t)||i._alreadyProcessedByDragService||(i._alreadyProcessedByDragService=!0,t.button!==0))return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const s=a=>this.onMouseMove(a,e.eElement),o=a=>this.onMouseUp(a,e.eElement),r=a=>a.preventDefault(),n=this.gos.getRootNode(),l=[{target:n,type:"mousemove",listener:s},{target:n,type:"mouseup",listener:o},{target:n,type:"contextmenu",listener:r}];this.addTemporaryEvents(l),e.dragStartPixels===0&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach(t=>{const{target:i,type:s,listener:o,options:r}=t;i.addEventListener(s,o,r)}),this.dragEndFunctions.push(()=>{e.forEach(t=>{const{target:i,type:s,listener:o,options:r}=t;i.removeEventListener(s,o,r)})})}isEventNearStartEvent(e,t){const{dragStartPixels:i}=this.currentDragParams,s=_exists(i)?i:4;return _areEventsNear(e,t,s)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(e,t))return;this.dragging=!0;const s={type:"dragStarted",target:i};this.eventService.dispatchEvent(s),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){_isBrowserSafari()&&this.gos.getDocument().getSelection()?.removeAllRanges(),this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gos.get("enableCellTextSelection"),i=e.type==="mousemove";return t&&i&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){return!!e.target?.tagName.toLocaleLowerCase()?.match("^a$|textarea|input|select|button")}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(e);const i={type:"dragStopped",target:t};this.eventService.dispatchEvent(i)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(i=>i()),this.dragEndFunctions.length=0}},RowDragComp=class extends Component{constructor(e,t,i,s,o,r){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=s,this.dragStartPixels=o,this.suppressVisibilityChange=r,this.dragSource=null}wireBeans(e){this.beans=e}isCustomGui(){return this.customGui!=null}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(_createIconNoSpan("rowDrag",this.gos,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gos.get("rowDragManaged")?new ManagedVisibilityStrategy(this,this.beans,this.rowNode,this.column):new NonManagedVisibilityStrategy(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e),this.addDragSource(t)}getSelectedNodes(){if(!this.gos.get("rowDragMultiRow"))return[this.rowNode];const t=this.beans.selectionService.getSelectedNodes();return t.indexOf(this.rowNode)!==-1?t:[this.rowNode]}checkCompatibility(){const e=this.gos.get("rowDragManaged");this.gos.get("treeData")&&e&&_warnOnce("If using row drag with tree data, you cannot have rowDragManaged=true")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gos.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.getGui();this.gos.get("enableCellTextSelection")&&(this.removeMouseDownListener(),this.mouseDownListener=this.addManagedElementListeners(t,{mousedown:s=>{s?.preventDefault()}})[0]);const i=this.localeService.getLocaleTextFunc();this.dragSource={type:2,eElement:t,dragItemName:()=>{const s=this.getDragItem(),o=s.rowNodes?.length||1,r=this.getRowDragText(this.column);return r?r(s,o):o===1?this.cellValueFn():`${o} ${i("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gos.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}destroy(){this.removeDragSource(),this.removeMouseDownListener(),super.destroy()}removeDragSource(){this.dragSource&&(this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}removeMouseDownListener(){this.mouseDownListener&&(this.mouseDownListener(),this.mouseDownListener=void 0)}},VisibilityStrategy=class extends BeanStub{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let i=!0,s=!1;this.column&&(i=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),s=_isFunction(this.column.getColDef().rowDrag)),s?(this.parent.setDisplayed(!0,t),this.parent.setVisible(i,t)):(this.parent.setDisplayed(i,t),this.parent.setVisible(!0,t))}}},NonManagedVisibilityStrategy=class extends VisibilityStrategy{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this));const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:e}),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gos.get("suppressRowDrag");this.setDisplayedOrVisible(e)}},ManagedVisibilityStrategy=class extends VisibilityStrategy{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){const e=this.workOutVisibility.bind(this);this.addManagedListeners(this.beans.eventService,{sortChanged:e,filterChanged:e,columnRowGroupChanged:e,newColumnsLoaded:e}),this.addManagedListeners(this.rowNode,{dataChanged:e,cellChanged:e}),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const t=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(),i=t&&t.shouldPreventRowMove(),s=this.gos.get("suppressRowDrag"),o=this.beans.dragAndDropService.hasExternalDropZones(),r=i&&!o||s;this.setDisplayedOrVisible(r)}},_RowNode=class T{constructor(t){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=T.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=t}setData(t){this.setDataCommon(t,!1)}updateData(t){this.setDataCommon(t,!0)}setDataCommon(t,i){const s=this.data;this.data=t,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const o=this.createDataChangedEvent(t,s,i);this.localEventService?.dispatchEvent(o)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(t,i,s){return{type:"dataChanged",node:this,oldData:i,newData:t,update:s}}getRowIndexString(){return this.rowIndex==null?(_errorOnce("Could not find rowIndex, this means tasks are being executed on a rowNode that has been removed from the grid."),null):this.rowPinned==="top"?"t-"+this.rowIndex:this.rowPinned==="bottom"?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const t=new T(this.beans);return t.id=this.id,t.data=this.data,t.__daemon=!0,t.selected=this.selected,t.level=this.level,t}setDataAndId(t,i){const s=_exists(this.id)?this.createDaemonNode():null,o=this.data;this.data=t,this.updateDataOnDetailNode(),this.setId(i),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,s);const r=this.createDataChangedEvent(t,o,!1);this.localEventService?.dispatchEvent(r)}checkRowSelectable(){const t=this.beans.gos.get("isRowSelectable");this.setRowSelectable(t?t(this):!0)}setRowSelectable(t,i){if(this.selectable!==t){if(this.selectable=t,this.dispatchRowEvent("selectableChanged"),i)return;if(this.beans.gos.get("groupSelectsChildren")){const o=this.calculateSelectedFromChildren();this.setSelectedParams({newValue:o??!1,source:"selectableChanged"});return}this.isSelected()&&!this.selectable&&this.setSelectedParams({newValue:!1,source:"selectableChanged"})}}setId(t){const i=this.beans.gos.getRowIdCallback();if(i)if(this.data){const s=this.getGroupKeys(!0);this.id=i({data:this.data,parentKeys:s.length>0?s:void 0,level:this.level,rowPinned:this.rowPinned}),this.id.startsWith(T.ID_PREFIX_ROW_GROUP)&&_errorOnce(`Row IDs cannot start with ${T.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`)}else this.id=void 0;else this.id=t}getGroupKeys(t=!1){const i=[];let s=this;for(t&&(s=s.parent);s&&s.level>=0;)i.push(s.key),s=s.parent;return i.reverse(),i}isPixelInRange(t){return!_exists(this.rowTop)||!_exists(this.rowHeight)?!1:t>=this.rowTop&&t<this.rowTop+this.rowHeight}updateIfDifferent(t,i,s){this[t]!==i&&(this[t]=i,this.dispatchRowEvent(s))}setFirstChild(t){this.updateIfDifferent("firstChild",t,"firstChildChanged")}setLastChild(t){this.updateIfDifferent("lastChild",t,"lastChildChanged")}setChildIndex(t){this.updateIfDifferent("childIndex",t,"childIndexChanged")}setRowTop(t){this.oldRowTop=this.rowTop,this.rowTop!==t&&(this.rowTop=t,this.dispatchRowEvent("topChanged"),this.setDisplayed(t!==null))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(t){this.updateIfDifferent("displayed",t,"displayedChanged")}setDragging(t){this.updateIfDifferent("dragging",t,"draggingChanged")}setHighlighted(t){this.updateIfDifferent("highlighted",t,"rowHighlightChanged")}setHovered(t){this.hovered!==t&&(this.hovered=t)}isHovered(){return this.hovered}setAllChildrenCount(t){this.updateIfDifferent("allChildrenCount",t,"allChildrenCountChanged")}setMaster(t){this.master!==t&&(this.master&&!t&&(this.expanded=!1),this.master=t,this.dispatchRowEvent("masterChanged"))}setGroup(t){this.group!==t&&(this.group&&!t&&(this.expanded=!1),this.group=t,this.updateHasChildren(),this.checkRowSelectable(),this.dispatchRowEvent("groupChanged"))}setRowHeight(t,i=!1){this.rowHeight=t,this.rowHeightEstimated=i,this.dispatchRowEvent("heightChanged")}setRowAutoHeight(t,i){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[i.getId()]=t,t!=null&&(this.checkAutoHeightsDebounced==null&&(this.checkAutoHeightsDebounced=_debounce(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let t=!1,i=!0,s=0;const o=this.__autoHeights;if(o==null||(this.beans.visibleColsService.getAllAutoHeightCols().forEach(l=>{let a=o[l.getId()];if(a==null)if(this.beans.columnModel.isColSpanActive()){let d=[];switch(l.getPinned()){case"left":d=this.beans.visibleColsService.getLeftColsForRow(this);break;case"right":d=this.beans.visibleColsService.getRightColsForRow(this);break;case null:d=this.beans.columnViewportService.getColsWithinViewport(this);break}if(d.includes(l)){t=!0;return}a=-1}else{t=!0;return}else i=!1;a>s&&(s=a)}),t)||((i||s<10)&&(s=this.beans.gos.getRowHeightForNode(this).height),s==this.rowHeight))return;this.setRowHeight(s);const n=this.beans.rowModel;n.onRowHeightChangedDebounced&&n.onRowHeightChangedDebounced()}setRowIndex(t){this.updateIfDifferent("rowIndex",t,"rowIndexChanged")}setUiLevel(t){this.updateIfDifferent("uiLevel",t,"uiLevelChanged")}setExpanded(t,i,s){if(this.expanded===t)return;this.expanded=t,this.dispatchRowEvent("expandedChanged");const o={...this.createGlobalRowEvent("rowGroupOpened"),expanded:t,event:i||null};this.beans.rowNodeEventThrottle.dispatchExpanded(o,s),this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(t){return this.beans.gos.addGridCommonParams({type:t,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned})}setDataValue(t,i,s){const r=typeof t!="string"?t:this.beans.columnModel.getCol(t)??this.beans.columnModel.getColDefCol(t),n=this.getValueFromValueService(r);if(this.beans.gos.get("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(r,n,i,s),!1;const l=this.beans.valueService.setValue(this,r,i,s);return this.dispatchCellChangedEvent(r,i,n),this.checkRowSelectable(),l}getValueFromValueService(t){const i=this.leafGroup&&this.beans.columnModel.isPivotMode(),s=this.group&&this.expanded&&!this.footer&&!i;let o=!1;const r=this.beans.gos.get("groupTotalRow")??this.beans.gos.get("groupIncludeFooter");typeof r!="function"?o=!!r:o=!!(this.beans.gos.getCallback("groupTotalRow")??this.beans.gos.getCallback("groupIncludeFooter"))({node:this});const n=this.beans.gos.get("groupSuppressBlankHeader"),l=s&&o&&!n;return this.beans.valueService.getValue(t,this,!1,l)}dispatchEventForSaveValueReadOnly(t,i,s,o){const r=this.beans.gos.addGridCommonParams({type:"cellEditRequest",event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:t,colDef:t.getColDef(),data:this.data,node:this,oldValue:i,newValue:s,value:s,source:o});this.beans.eventService.dispatchEvent(r)}setGroupValue(t,i){const s=this.beans.columnModel.getCol(t);_missing(this.groupData)&&(this.groupData={});const o=s.getColId(),r=this.groupData[o];r!==i&&(this.groupData[o]=i,this.dispatchCellChangedEvent(s,i,r))}setAggData(t){const i=this.aggData;if(this.aggData=t,this.localEventService){const s=o=>{const r=this.aggData?this.aggData[o]:void 0,n=i?i[o]:void 0;if(r===n)return;const l=this.beans.columnModel.getCol(o);l&&this.dispatchCellChangedEvent(l,r,n)};for(const o in this.aggData)s(o);for(const o in t)o in this.aggData||s(o)}}updateHasChildren(){let t=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gos.isRowModelType("serverSide")){const s=this.beans.gos.get("treeData"),o=this.beans.gos.get("isServerSideGroup");t=!this.stub&&!this.footer&&(s?!!o&&o(this.data):!!this.group)}t!==this.__hasChildren&&(this.__hasChildren=!!t,this.dispatchRowEvent("hasChildrenChanged"))}hasChildren(){return this.__hasChildren==null&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return(this.group&&_missingOrEmpty(this.childrenAfterGroup))??!1}dispatchCellChangedEvent(t,i,s){const o={type:"cellChanged",node:this,column:t,newValue:i,oldValue:s};this.localEventService?.dispatchEvent(o)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return this.footer?!1:this.beans.columnModel.isPivotMode()?this.hasChildren()&&!this.leafGroup:this.hasChildren()||!!this.master}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(t){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(i=>i.depthFirstSearch(t)),t(this)}calculateSelectedFromChildren(){let t=!1,i=!1,s=!1;if(!this.childrenAfterGroup?.length)return this.selectable?this.selected:null;for(let o=0;o<this.childrenAfterGroup.length;o++){const r=this.childrenAfterGroup[o];let n=r.isSelected();if(!r.selectable){const l=r.calculateSelectedFromChildren();if(l===null)continue;n=l}switch(n){case!0:t=!0;break;case!1:i=!0;break;default:s=!0;break}}if(!(s||t&&i))return t?!0:i?!1:this.selectable?this.selected:null}setSelectedInitialValue(t){this.selected=t}dispatchRowEvent(t){const i={type:t,node:this};this.localEventService?.dispatchEvent(i)}selectThisNode(t,i,s="api"){const o=!this.selectable&&t,r=this.selected===t;if(o||r)return!1;this.selected=t,this.dispatchRowEvent("rowSelected");const n=this.sibling;n&&n.footer&&n.localEventService&&n.dispatchRowEvent("rowSelected");const l={...this.createGlobalRowEvent("rowSelected"),event:i||null,source:s};return this.beans.eventService.dispatchEvent(l),!0}setSelected(t,i=!1,s="api"){if(typeof s=="boolean"){_warnOnce("since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.");return}this.setSelectedParams({newValue:t,clearSelection:i,rangeSelect:!1,source:s})}setSelectedParams(t){return this.rowPinned?(_warnOnce("cannot select pinned rows"),0):this.id===void 0?(_warnOnce("cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected({...t,nodes:[this.footer?this.sibling:this]})}isRowPinned(){return this.rowPinned==="top"||this.rowPinned==="bottom"}isParentOfNode(t){let i=this.parent;for(;i;){if(i===t)return!0;i=i.parent}return!1}addEventListener(t,i){this.localEventService||(this.localEventService=new LocalEventService),this.beans.frameworkOverrides.shouldWrapOutgoing&&!this.frameworkEventListenerService&&(this.localEventService.setFrameworkOverrides(this.beans.frameworkOverrides),this.frameworkEventListenerService=new FrameworkEventListenerService(this.beans.frameworkOverrides));const s=this.frameworkEventListenerService?.wrap(i)??i;this.localEventService.addEventListener(t,s)}removeEventListener(t,i){if(!this.localEventService)return;const s=this.frameworkEventListenerService?.unwrap(i)??i;this.localEventService.removeEventListener(t,s),this.localEventService.noRegisteredListenersExist()&&(this.localEventService=null)}onMouseEnter(){this.dispatchRowEvent("mouseEnter")}onMouseLeave(){this.dispatchRowEvent("mouseLeave")}getFirstChildOfFirstChild(t){let i=this,s=!0,o=!1,r=null;for(;s&&!o;){const n=i.parent;_exists(n)&&i.firstChild?n.rowGroupColumn===t&&(o=!0,r=n):s=!1,i=n}return o?r:null}isFullWidthCell(){if(this.detail)return!0;const t=this.beans.gos.getCallback("isFullWidthRow");return t?t({rowNode:this}):!1}getRoute(){if(this.key==null)return;const t=[];let i=this;for(;i&&i.key!=null;)t.push(i.key),i=i.parent;return t.reverse()}createFooter(){if(this.sibling)return;const t=new Set(["eventService","__objectId","sticky"]),i=new T(this.beans);Object.keys(this).forEach(s=>{t.has(s)||(i[s]=this[s])}),i.footer=!0,i.setRowTop(null),i.setRowIndex(null),i.oldRowTop=null,i.id="rowGroupFooter_"+this.id,i.sibling=this,this.sibling=i}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}};_RowNode.ID_PREFIX_ROW_GROUP="row-group-",_RowNode.ID_PREFIX_TOP_PINNED="t-",_RowNode.ID_PREFIX_BOTTOM_PINNED="b-",_RowNode.OBJECT_ID_SEQUENCE=0;var RowNode=_RowNode,FilterManager=class extends BeanStub{constructor(){super(...arguments),this.beanName="filterManager",this.advancedFilterModelUpdateQueue=[]}wireBeans(e){this.columnModel=e.columnModel,this.dataTypeService=e.dataTypeService,this.quickFilterService=e.quickFilterService,this.advancedFilterService=e.advancedFilterService,this.columnFilterService=e.columnFilterService}postConstruct(){this.addManagedEventListeners({columnValueChanged:this.refreshFiltersForAggregations.bind(this),columnPivotChanged:this.refreshFiltersForAggregations.bind(this),columnPivotModeChanged:this.refreshFiltersForAggregations.bind(this),newColumnsLoaded:this.updateAdvancedFilterColumns.bind(this),columnVisible:this.updateAdvancedFilterColumns.bind(this),advancedFilterEnabledChanged:({enabled:e})=>this.onAdvancedFilterEnabledChanged(e),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.addManagedPropertyListener("advancedFilterModel",e=>this.setAdvancedFilterModel(e.currentValue)),this.quickFilterService&&this.addManagedListeners(this.quickFilterService,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"?e({}):!1}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"?t(e):!1}setFilterModel(e,t="api"){if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}this.columnFilterService?.setFilterModel(e,t)}getFilterModel(){return this.columnFilterService?.getFilterModel()??{}}isColumnFilterPresent(){return!!this.columnFilterService?.isColumnFilterPresent()}isAggregateFilterPresent(){return!!this.columnFilterService?.isAggregateFilterPresent()}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){e?this.columnFilterService?.disableColumnFilters()&&this.onFilterChanged({source:"advancedFilter"}):this.advancedFilterService?.isFilterPresent()&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){return!!this.advancedFilterService?.isEnabled()}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}resetQuickFilterCache(){this.quickFilterService?.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gos.getGroupAggFiltering()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:i,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.columnFilterService?this.columnFilterService.updateBeforeFilterChanged(e):AgPromise.resolve()).then(()=>{const o={source:t,type:"filterChanged",columns:s};i&&_mergeDeep(o,i),this.eventService.dispatchEvent(o),this.columnFilterService?.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){return!!this.columnFilterService?.isSuppressFlashingCellsBecauseFiltering()}isQuickFilterPresent(){return!!this.quickFilterService?.isQuickFilterPresent()}updateAggFiltering(){this.aggFiltering=!!this.gos.getGroupAggFiltering()}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.columnModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isAggregateFilterPresent()&&!this.columnFilterService.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode)||this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode)||this.isColumnFilterPresent()&&!this.columnFilterService.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip)||this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))}isFilterActive(e){return!!this.columnFilterService?.isFilterActive(e)}getOrCreateFilterWrapper(e){return this.columnFilterService?.getOrCreateFilterWrapper(e)??null}getDefaultFloatingFilter(e){return this.columnFilterService.getDefaultFloatingFilter(e)}createFilterParams(e,t){return this.columnFilterService.createFilterParams(e,t)}isFilterAllowed(e){return this.isAdvancedFilterEnabled()?!1:!!this.columnFilterService?.isFilterAllowed(e)}getFloatingFilterCompDetails(e,t){return this.columnFilterService?.getFloatingFilterCompDetails(e,t)}getCurrentFloatingFilterParentModel(e){return this.columnFilterService?.getCurrentFloatingFilterParentModel(e)}destroyFilter(e,t="api"){this.columnFilterService?.destroyFilter(e,t)}areFilterCompsDifferent(e,t){return!!this.columnFilterService?.areFilterCompsDifferent(e,t)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){if(this.isAdvancedFilterEnabled()){if(this.dataTypeService?.isPendingInference()){this.advancedFilterModelUpdateQueue.push(e);return}this.advancedFilterService.setModel(e??null),this.onFilterChanged({source:"advancedFilter"})}}toggleAdvancedFilterBuilder(e,t){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(t,e)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){return this.isAdvancedFilterEnabled()?!1:!!this.columnFilterService?.hasFloatingFilters()}getFilterInstance(e,t){if(this.isAdvancedFilterEnabled()){this.warnAdvancedFilters();return}return this.columnFilterService?.getFilterInstance(e,t)}getColumnFilterInstance(e){return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve(void 0)):this.columnFilterService?.getColumnFilterInstance(e)??Promise.resolve(void 0)}warnAdvancedFilters(){_warnOnce("Column Filter API methods have been disabled as Advanced Filters are enabled.")}setupAdvancedFilterHeaderComp(e){this.advancedFilterService?.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.advancedFilterModelUpdateQueue.forEach(e=>this.setAdvancedFilterModel(e)),this.advancedFilterModelUpdateQueue=[]}getColumnFilterModel(e){return this.columnFilterService?.getColumnFilterModel(e)}setColumnFilterModel(e,t){return this.isAdvancedFilterEnabled()?(this.warnAdvancedFilters(),Promise.resolve()):this.columnFilterService?.setColumnFilterModel(e,t)??Promise.resolve()}},FilterWrapperComp=class extends Component{constructor(e,t){super('<div class="ag-filter"></div>'),this.column=e,this.source=t,this.filterWrapper=null}wireBeans(e){this.filterManager=e.filterManager,this.columnModel=e.columnModel}postConstruct(){this.createFilter(!0),this.addManagedEventListeners({filterDestroyed:this.onFilterDestroyed.bind(this)})}hasFilter(){return!!this.filterWrapper}getFilter(){return this.filterWrapper?.filterPromise??null}afterInit(){return this.filterWrapper?.filterPromise?.then(()=>{})??AgPromise.resolve()}afterGuiAttached(e){this.filterWrapper?.filterPromise?.then(t=>{t?.afterGuiAttached?.(e)})}afterGuiDetached(){this.filterWrapper?.filterPromise?.then(e=>{e?.afterGuiDetached?.()})}createFilter(e){const{column:t,source:i}=this;this.filterWrapper=this.filterManager?.getOrCreateFilterWrapper(t)??null,this.filterWrapper?.filterPromise&&this.filterWrapper.filterPromise.then(s=>{const o=s.getGui();if(_exists(o)||_warnOnce(`getGui method from filter returned ${o}; it should be a DOM element.`),this.appendChild(o),e){const r={type:"filterOpened",column:t,source:i,eGui:this.getGui()};this.eventService.dispatchEvent(r)}})}onFilterDestroyed(e){(e.source==="api"||e.source==="paramsUpdated")&&e.column.getId()===this.column.getId()&&this.columnModel.getColDefCol(this.column)&&(_clearElement(this.getGui()),this.createFilter())}destroy(){this.filterWrapper=null,super.destroy()}},RESIZE_CONTAINER_STYLE="ag-resizer-wrapper",RESIZE_TEMPLATE=`<div class="${RESIZE_CONTAINER_STYLE}">
|
|
51
51
|
<div data-ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>
|
|
52
52
|
<div data-ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>
|
|
53
53
|
<div data-ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>
|
|
@@ -56,7 +56,7 @@ For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG
|
|
|
56
56
|
<div data-ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>
|
|
57
57
|
<div data-ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>
|
|
58
58
|
<div data-ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>
|
|
59
|
-
</div>`,PositionableFeature=class extends BeanStub{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}wireBeans(e){this.popupService=e.popupService,this.resizeObserverService=e.resizeObserverService,this.dragService=e.dragService}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,s=e/2-this.getHeight()/2;this.offsetElement(i,s)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:s,minHeight:o,height:r,x:n,y:l}=this.config;this.offsetParent||this.setOffsetParent();let a=0,d=0;const h=_isVisible(this.element);if(h){const c=this.findBoundaryElement(),u=window.getComputedStyle(c);if(u.minWidth!=null){const g=c.offsetWidth-this.element.offsetWidth;d=parseInt(u.minWidth,10)-g}if(u.minHeight!=null){const g=c.offsetHeight-this.element.offsetHeight;a=parseInt(u.minHeight,10)-g}}if(this.minHeight=o||a,this.minWidth=i||d,s&&this.setWidth(s),r&&this.setHeight(r),(!s||!r)&&this.refreshSize(),e)this.center();else if(n||l)this.offsetElement(n,l);else if(h&&t){let c=this.boundaryEl,u=!0;if(c||(c=this.findBoundaryElement(),u=!1),c){const g=parseFloat(c.style.top),p=parseFloat(c.style.left);u?this.offsetElement(isNaN(p)?0:p,isNaN(g)?0:g):this.setPosition(p,g)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),typeof e=="boolean"){if(e===!1)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach(t=>{const s=!!e[t],o=this.getResizerElement(t),r={dragStartPixels:0,eElement:o,onDragStart:n=>this.onResizeStart(n,t),onDragging:this.onResize.bind(this),onDragStop:n=>this.onResizeEnd(n,t)};(s||!this.isAlive()&&!s)&&(s?(this.dragService.addDragSource(r),this.resizeListeners.push(r),o.style.pointerEvents="all"):o.style.pointerEvents="none",this.resizable[t]=s)})}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;t!==-1&&(this.element.style.width=`${t}px`),e!==-1&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,i=this.element;let s=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)_setFixedHeight(i,e),e=_getAbsoluteHeight(i),s=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const o=this.getAvailableHeight();o&&e>o&&(e=o)}this.getHeight()!==e&&(s?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?_setFixedHeight(i,e):(i.style.height=`${e}px`,i.style.flex="0 0 auto",this.lastSize.height=typeof e=="number"?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:i}=this.offsetParent;if(!i)return null;const s=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=e?this.position.y:s.top,n=e?0:o.top;let l=0;if(t){const d=this.element.parentElement;if(d){const{bottom:h}=d.getBoundingClientRect();l=h-s.bottom}}return i+n-r-l}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let s=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)_setFixedWidth(t,e),e=_getAbsoluteWidth(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:o}=this.offsetParent,r=i?this.position.x:this.element.getBoundingClientRect().left;o&&e+r>o&&(e=o-r)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?_setFixedWidth(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width=typeof e=="number"?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:i}=this.config,s=i?this.boundaryEl:this.element;s&&(this.popupService.positionPopup({ePopup:s,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(s.style.left),parseFloat(s.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const i=this.getAvailableHeight();this.element.style.setProperty("max-height",`${i}px`)};e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),t):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:i,isTop:s,anywhereWithin:o,topBuffer:r}=e,n=t.clientX-this.dragStartPosition.x,l=t.clientY-this.dragStartPosition.y,a=this.shouldSkipX(t,!!i,!!o,n)?0:n,d=this.shouldSkipY(t,!!s,r,l)?0:l;return{movementX:a,movementY:d}}shouldSkipX(e,t,i,s){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.x:o.left;let a=l<=0&&r.left>=e.clientX||r.right<=e.clientX&&r.right<=n.right;return a?!0:(t?a=s<0&&e.clientX>l+r.left||s>0&&e.clientX<l+r.left:i?a=s<0&&e.clientX>n.right||s>0&&e.clientX<l+r.left:a=s<0&&e.clientX>n.right||s>0&&e.clientX<n.right,a)}shouldSkipY(e,t,i=0,s){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.y:o.top;let a=l<=0&&r.top>=e.clientY||r.bottom<=e.clientY&&r.bottom<=n.bottom;return a?!0:(t?a=s<0&&e.clientY>l+r.top+i||s>0&&e.clientY<l+r.top:a=s<0&&e.clientY>n.bottom||s>0&&e.clientY<n.bottom,a)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[data-ref=eTopLeftResizer]")},top:{element:e.querySelector("[data-ref=eTopResizer]")},topRight:{element:e.querySelector("[data-ref=eTopRightResizer]")},right:{element:e.querySelector("[data-ref=eRightResizer]")},bottomRight:{element:e.querySelector("[data-ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[data-ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[data-ref=eBottomLeftResizer]")},left:{element:e.querySelector("[data-ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const i=new DOMParser().parseFromString(RESIZE_TEMPLATE,"text/html").body;e.appendChild(i.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${RESIZE_CONTAINER_STYLE}`);e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:i,forcePopupParentAsOffsetParent:s}=this.config;!i&&!s&&this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const t=this.element.parentElement;return t?Array.prototype.slice.call(t.children).filter(i=>!i.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let s=0;s<e.length;s++){const o=e[s],r=!!o.style.flex&&o.style.flex!=="0 0 auto";if(o===this.element)continue;let n=this.minHeight||0,l=this.minWidth||0;if(r){const a=window.getComputedStyle(o);a.minHeight&&(n=parseInt(a.minHeight,10)),a.minWidth&&(l=parseInt(a.minWidth,10))}else n=o.offsetHeight,l=o.offsetWidth;t+=n,i+=l}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let s=0;s<i.length;s++){const o=i[s];o!==t&&(e?o.style.height=`${o.offsetHeight}px`:o.style.width=`${o.offsetWidth}px`,o.style.flex="0 0 auto",o===this.element&&(t=i[s+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:s,isRight:o,isBottom:r,isLeft:n}=this.currentResizer,l=o||n,a=r||s,{movementX:d,movementY:h}=this.calculateMouseMovement({e,isLeft:n,isTop:s}),c=this.position.x,u=this.position.y;let g=0,p=0;if(l&&d){const m=n?-1:1,f=this.getWidth(),v=f+d*m;let C=!1;n&&(g=f-v,(c+g<=0||v<=this.minWidth)&&(C=!0,g=0)),C||this.setWidth(v)}if(a&&h){const m=s?-1:1,f=this.getHeight(),v=f+h*m;let C=!1;s?(p=f-v,(u+p<=0||v<=this.minHeight)&&(C=!0,p=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&f<v&&this.getMinSizeOfSiblings().height+v>this.element.parentElement.offsetHeight&&(C=!0),C||this.setHeight(v)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&g||p)&&this.offsetElement(c+g,u+p)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:i}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:o,movementY:r}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+o,i+r),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if(window.getComputedStyle(e).position!=="static")return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},_ManagedFocusFeature=class N extends BeanStub{constructor(t,i={}){super(),this.eFocusableElement=t,this.callbacks=i,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:s=>{if(s.defaultPrevented)return;const o=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,s.shiftKey);o&&(o.focus(),s.preventDefault())},...i}}wireBeans(t){this.focusService=t.focusService}postConstruct(){this.eFocusableElement.classList.add(N.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedElementListeners(this.eFocusableElement,{focusin:this.callbacks.onFocusIn}),this.callbacks.onFocusOut&&this.addManagedElementListeners(this.eFocusableElement,{focusout:this.callbacks.onFocusOut})}addKeyDownListeners(t){this.addManagedElementListeners(t,{keydown:i=>{if(!(i.defaultPrevented||_isStopPropagationForAgGrid(i))){if(this.callbacks.shouldStopEventPropagation(i)){_stopPropagationForAgGrid(i);return}i.key===KeyCode.TAB?this.callbacks.onTabKeyDown(i):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(i)}}})}};_ManagedFocusFeature.FOCUS_MANAGED_CLASS="ag-focus-managed";var ManagedFocusFeature=_ManagedFocusFeature,FILTER_LOCALE_TEXT={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"};function getDebounceMs(e,t){return isUseApplyButton(e)?(e.debounceMs!=null&&_warnOnce("debounceMs is ignored when apply button is present"),0):e.debounceMs!=null?e.debounceMs:t}function isUseApplyButton(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}var ProvidedFilter=class extends Component{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.eFilterBody=RefPlaceholder,this.buttonListeners=[]}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.resetTemplate(),this.createManagedBean(new ManagedFocusFeature(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new PositionableFeature(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit);const i=`
|
|
59
|
+
</div>`,PositionableFeature=class extends BeanStub{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}wireBeans(e){this.popupService=e.popupService,this.resizeObserverService=e.resizeObserverService,this.dragService=e.dragService}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,s=e/2-this.getHeight()/2;this.offsetElement(i,s)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:s,minHeight:o,height:r,x:n,y:l}=this.config;this.offsetParent||this.setOffsetParent();let a=0,d=0;const h=_isVisible(this.element);if(h){const c=this.findBoundaryElement(),u=window.getComputedStyle(c);if(u.minWidth!=null){const g=c.offsetWidth-this.element.offsetWidth;d=parseInt(u.minWidth,10)-g}if(u.minHeight!=null){const g=c.offsetHeight-this.element.offsetHeight;a=parseInt(u.minHeight,10)-g}}if(this.minHeight=o||a,this.minWidth=i||d,s&&this.setWidth(s),r&&this.setHeight(r),(!s||!r)&&this.refreshSize(),e)this.center();else if(n||l)this.offsetElement(n,l);else if(h&&t){let c=this.boundaryEl,u=!0;if(c||(c=this.findBoundaryElement(),u=!1),c){const g=parseFloat(c.style.top),p=parseFloat(c.style.left);u?this.offsetElement(isNaN(p)?0:p,isNaN(g)?0:g):this.setPosition(p,g)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),typeof e=="boolean"){if(e===!1)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach(t=>{const s=!!e[t],o=this.getResizerElement(t),r={dragStartPixels:0,eElement:o,onDragStart:n=>this.onResizeStart(n,t),onDragging:this.onResize.bind(this),onDragStop:n=>this.onResizeEnd(n,t)};(s||!this.isAlive()&&!s)&&(s?(this.dragService.addDragSource(r),this.resizeListeners.push(r),o.style.pointerEvents="all"):o.style.pointerEvents="none",this.resizable[t]=s)})}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;t!==-1&&(this.element.style.width=`${t}px`),e!==-1&&(this.element.style.height=`${e}px`)}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,i=this.element;let s=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)_setFixedHeight(i,e),e=_getAbsoluteHeight(i),s=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const o=this.getAvailableHeight();o&&e>o&&(e=o)}this.getHeight()!==e&&(s?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?_setFixedHeight(i,e):(i.style.height=`${e}px`,i.style.flex="0 0 auto",this.lastSize.height=typeof e=="number"?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:i}=this.offsetParent;if(!i)return null;const s=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=e?this.position.y:s.top,n=e?0:o.top;let l=0;if(t){const d=this.element.parentElement;if(d){const{bottom:h}=d.getBoundingClientRect();l=h-s.bottom}}return i+n-r-l}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let s=!1;if(typeof e=="string"&&e.indexOf("%")!==-1)_setFixedWidth(t,e),e=_getAbsoluteWidth(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:o}=this.offsetParent,r=i?this.position.x:this.element.getBoundingClientRect().left;o&&e+r>o&&(e=o-r)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?_setFixedWidth(t,e):(t.style.width=`${e}px`,t.style.flex=" unset",this.lastSize.width=typeof e=="number"?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:i}=this.config,s=i?this.boundaryEl:this.element;s&&(this.popupService.positionPopup({ePopup:s,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(s.style.left),parseFloat(s.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const i=this.getAvailableHeight();this.element.style.setProperty("max-height",`${i}px`)};e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),t):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:i,isTop:s,anywhereWithin:o,topBuffer:r}=e,n=t.clientX-this.dragStartPosition.x,l=t.clientY-this.dragStartPosition.y,a=this.shouldSkipX(t,!!i,!!o,n)?0:n,d=this.shouldSkipY(t,!!s,r,l)?0:l;return{movementX:a,movementY:d}}shouldSkipX(e,t,i,s){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.x:o.left;let a=l<=0&&r.left>=e.clientX||r.right<=e.clientX&&r.right<=n.right;return a?!0:(t?a=s<0&&e.clientX>l+r.left||s>0&&e.clientX<l+r.left:i?a=s<0&&e.clientX>n.right||s>0&&e.clientX<l+r.left:a=s<0&&e.clientX>n.right||s>0&&e.clientX<n.right,a)}shouldSkipY(e,t,i=0,s){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.y:o.top;let a=l<=0&&r.top>=e.clientY||r.bottom<=e.clientY&&r.bottom<=n.bottom;return a?!0:(t?a=s<0&&e.clientY>l+r.top+i||s>0&&e.clientY<l+r.top:a=s<0&&e.clientY>n.bottom||s>0&&e.clientY<n.bottom,a)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[data-ref=eTopLeftResizer]")},top:{element:e.querySelector("[data-ref=eTopResizer]")},topRight:{element:e.querySelector("[data-ref=eTopRightResizer]")},right:{element:e.querySelector("[data-ref=eRightResizer]")},bottomRight:{element:e.querySelector("[data-ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[data-ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[data-ref=eBottomLeftResizer]")},left:{element:e.querySelector("[data-ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const i=new DOMParser().parseFromString(RESIZE_TEMPLATE,"text/html").body;e.appendChild(i.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(`.${RESIZE_CONTAINER_STYLE}`);e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:i,forcePopupParentAsOffsetParent:s}=this.config;!i&&!s&&this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const t=this.element.parentElement;return t?Array.prototype.slice.call(t.children).filter(i=>!i.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let s=0;s<e.length;s++){const o=e[s],r=!!o.style.flex&&o.style.flex!=="0 0 auto";if(o===this.element)continue;let n=this.minHeight||0,l=this.minWidth||0;if(r){const a=window.getComputedStyle(o);a.minHeight&&(n=parseInt(a.minHeight,10)),a.minWidth&&(l=parseInt(a.minWidth,10))}else n=o.offsetHeight,l=o.offsetWidth;t+=n,i+=l}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let s=0;s<i.length;s++){const o=i[s];o!==t&&(e?o.style.height=`${o.offsetHeight}px`:o.style.width=`${o.offsetWidth}px`,o.style.flex="0 0 auto",o===this.element&&(t=i[s+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:s,isRight:o,isBottom:r,isLeft:n}=this.currentResizer,l=o||n,a=r||s,{movementX:d,movementY:h}=this.calculateMouseMovement({e,isLeft:n,isTop:s}),c=this.position.x,u=this.position.y;let g=0,p=0;if(l&&d){const f=n?-1:1,m=this.getWidth(),C=m+d*f;let v=!1;n&&(g=m-C,(c+g<=0||C<=this.minWidth)&&(v=!0,g=0)),v||this.setWidth(C)}if(a&&h){const f=s?-1:1,m=this.getHeight(),C=m+h*f;let v=!1;s?(p=m-C,(u+p<=0||C<=this.minHeight)&&(v=!0,p=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&m<C&&this.getMinSizeOfSiblings().height+C>this.element.parentElement.offsetHeight&&(v=!0),v||this.setHeight(C)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&g||p)&&this.offsetElement(c+g,u+p)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null,this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchLocalEvent({type:"resize"})}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:i}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:o,movementY:r}=this.calculateMouseMovement({e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+o,i+r),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if(window.getComputedStyle(e).position!=="static")return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}},_ManagedFocusFeature=class N extends BeanStub{constructor(t,i={}){super(),this.eFocusableElement=t,this.callbacks=i,this.callbacks={shouldStopEventPropagation:()=>!1,onTabKeyDown:s=>{if(s.defaultPrevented)return;const o=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,s.shiftKey);o&&(o.focus(),s.preventDefault())},...i}}wireBeans(t){this.focusService=t.focusService}postConstruct(){this.eFocusableElement.classList.add(N.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedElementListeners(this.eFocusableElement,{focusin:this.callbacks.onFocusIn}),this.callbacks.onFocusOut&&this.addManagedElementListeners(this.eFocusableElement,{focusout:this.callbacks.onFocusOut})}addKeyDownListeners(t){this.addManagedElementListeners(t,{keydown:i=>{if(!(i.defaultPrevented||_isStopPropagationForAgGrid(i))){if(this.callbacks.shouldStopEventPropagation(i)){_stopPropagationForAgGrid(i);return}i.key===KeyCode.TAB?this.callbacks.onTabKeyDown(i):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(i)}}})}};_ManagedFocusFeature.FOCUS_MANAGED_CLASS="ag-focus-managed";var ManagedFocusFeature=_ManagedFocusFeature,FILTER_LOCALE_TEXT={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose one",equals:"Equals",notEqual:"Does not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"Between",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equal to",greaterThanOrEqual:"Greater than or equal to",contains:"Contains",notContains:"Does not contain",startsWith:"Begins with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",before:"Before",after:"After",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"};function getDebounceMs(e,t){return isUseApplyButton(e)?(e.debounceMs!=null&&_warnOnce("debounceMs is ignored when apply button is present"),0):e.debounceMs!=null?e.debounceMs:t}function isUseApplyButton(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}var ProvidedFilter=class extends Component{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null,this.eFilterBody=RefPlaceholder,this.buttonListeners=[]}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.resetTemplate(),this.createManagedBean(new ManagedFocusFeature(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new PositionableFeature(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit);const i=`
|
|
60
60
|
<form class="ag-filter-wrapper">
|
|
61
61
|
<div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" data-ref="eFilterBody">
|
|
62
62
|
${this.createBodyTemplate()}
|
|
@@ -73,7 +73,7 @@ For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG
|
|
|
73
73
|
<div data-ref="eDisplayField" class="ag-picker-field-display"></div>
|
|
74
74
|
<div data-ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>
|
|
75
75
|
</div>
|
|
76
|
-
</div>`,e?.agComponents||[],e?.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=RefPlaceholder,this.eWrapper=RefPlaceholder,this.eDisplayField=RefPlaceholder,this.eIcon=RefPlaceholder,this.ariaRole=e?.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:s,minPickerWidth:o,maxPickerWidth:r}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!s,i!=null&&this.setPickerMaxHeight(i),o!=null&&this.setPickerMinWidth(o),r!=null&&this.setPickerMaxWidth(r)}wireBeans(e){this.popupService=e.popupService}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:i,inputWidth:s}=this.config;if(i){const o=_createIconNoSpan(i,this.gos);o&&this.eIcon.appendChild(o)}s!=null&&this.setInputWidth(s)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),_setAriaExpanded(e,!1),this.ariaRole&&_setAriaRole(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&e?.target===t)return;e.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case KeyCode.UP:case KeyCode.DOWN:case KeyCode.ENTER:case KeyCode.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case KeyCode.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.gos.getDocument(),t=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const i=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:s,pickerAriaLabelValue:o,modalPicker:r=!0}=this.config,n={modal:r,eChild:t,closeOnEsc:!0,closedCallback:()=>{const g=this.gos.getActiveDomElement(),p=!g||g===e.body;this.beforeHidePicker(),p&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:i(s,o)},l=this.popupService.addPopup(n),{maxPickerHeight:a,minPickerWidth:d,maxPickerWidth:h,variableWidth:c}=this;c?(d&&(t.style.minWidth=d),t.style.width=_formatSize(_getAbsoluteWidth(this.eWrapper)),h&&(t.style.maxWidth=h)):_setElementWidth(t,h??_getAbsoluteWidth(this.eWrapper));const u=a??`${_getInnerHeight(this.popupService.getPopupParent())}px`;return t.style.setProperty("max-height",u),t.style.position="absolute",this.alignPickerToComponent(),l.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,i=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;const t=this.getAriaElement();_setAriaExpanded(t,e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){this.pickerComponent?.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return _setElementWidth(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return typeof e=="number"&&(e=`${e}px`),this.minPickerWidth=e??void 0,this}setPickerMaxWidth(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerWidth=e??void 0,this}setPickerMaxHeight(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerHeight=e??void 0,this}destroy(){this.hidePicker(),super.destroy()}},AgSelect=class extends AgPickerField{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox",...e})}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:i}=this.config;e!=null&&this.addOptions(e),t!=null&&this.setValue(t,!0),i&&t==null&&(this.eDisplayField.textContent=i),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new AgList("select",!0)),this.listComponent.setParentComponent(this);const e=this.listComponent.getAriaElement(),t=`ag-select-list-${this.listComponent.getCompId()}`;e.setAttribute("id",t),_setAriaControls(this.getAriaElement(),e),this.listComponent.addManagedListeners(this.listComponent,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})}}),this.listComponent.addManagedListeners(this.listComponent,{fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}onKeyDown(e){const{key:t}=e;switch(t===KeyCode.TAB&&this.hidePicker(),t){case KeyCode.ENTER:case KeyCode.UP:case KeyCode.DOWN:case KeyCode.PAGE_UP:case KeyCode.PAGE_DOWN:case KeyCode.PAGE_HOME:case KeyCode.PAGE_END:e.preventDefault(),this.isPickerDisplayed?this.listComponent?.handleKeyDown(e):super.onKeyDown(e);break;case KeyCode.ESCAPE:super.onKeyDown(e);break}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){return this.listComponent?.clearOptions(),this}setValue(e,t,i){if(this.value===e||!this.listComponent)return this;if(i||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue())return this;let o=this.listComponent.getDisplayValue();return o==null&&this.config.placeholder&&(o=this.config.placeholder),this.eDisplayField.textContent=o,this.setTooltip({newTooltipText:o??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth}),super.setValue(e,t)}destroy(){this.listComponent&&(this.listComponent=this.destroyBean(this.listComponent)),super.destroy()}},AgSelectSelector={selector:"AG-SELECT",component:AgSelect},OptionsFactory=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach(e=>{if(typeof e=="string")return;const t=[["displayKey"],["displayName"],["predicate","test"]],i=s=>s.some(o=>e[o]!=null)?!0:(_warnOnce(`ignoring FilterOptionDef as it doesn't contain one of '${s}'`),!1);if(!t.every(i)){this.filterOptions=this.filterOptions.filter(s=>s===e)||[];return}this.customFilterOptions[e.displayKey]=e})}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const t=this.filterOptions[0];typeof t=="string"?this.defaultOption=t:t.displayKey?this.defaultOption=t.displayKey:_warnOnce("invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else _warnOnce("no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}},SimpleFilter=class extends ProvidedFilter{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(e){const t=this.optionsFactory.getCustomOption(e);if(t){const{numberOfInputs:s}=t;return s??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,i)=>{i===0?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return this.eJoinOperatorsOr.length===0?this.defaultJoinOperator:this.eJoinOperatorsOr[0].getValue()===!0?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const i=!e.operator,s=!t.operator;if(!i&&s||i&&!s)return!1;let r;if(i){const n=e,l=t;r=this.areSimpleModelsEqual(n,l)}else{const n=e,l=t;r=n.operator===l.operator&&_areEqual(n.conditions,l.conditions,(a,d)=>this.areSimpleModelsEqual(a,d))}return r}shouldRefresh(e){const t=this.getModel(),i=t?t.conditions??[t]:null,s=e.filterOptions?.map(r=>typeof r=="string"?r:r.displayKey)??this.getDefaultFilterOptions();return!(!(!i||i.every(r=>s.find(n=>n===r.type)!==void 0))||typeof e.maxNumConditions=="number"&&i&&i.length>e.maxNumConditions)}refresh(e){return!this.shouldRefresh(e)||!super.refresh(e)?!1:(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0)}setModelIntoUi(e){if(e.operator){const i=e;let s=i.conditions;s==null&&(s=[],_warnOnce("Filter model is missing 'conditions'"));const o=this.validateAndUpdateConditions(s),r=this.getNumConditions();if(o<r)this.removeConditionsAndOperators(o);else if(o>r)for(let l=r;l<o;l++)this.createJoinOperatorPanel(),this.createOption();const n=i.operator==="OR";this.eJoinOperatorsAnd.forEach(l=>l.setValue(!n,!0)),this.eJoinOperatorsOr.forEach(l=>l.setValue(n,!0)),s.forEach((l,a)=>{this.eTypes[a].setValue(l.type,!0),this.setConditionIntoUi(l,a)})}else{const i=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(i.type,!0),this.setConditionIntoUi(i,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),AgPromise.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),_warnOnce('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),t=this.maxNumConditions),t}doesFilterPass(e){const t=this.getModel();if(t==null)return!0;const{operator:i}=t,s=[];if(i){const r=t;s.push(...r.conditions??[])}else s.push(t);return s[i&&i==="OR"?"some":"every"](r=>this.individualConditionPasses(e,r))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new OptionsFactory,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){this.maxNumConditions=e.maxNumConditions??2,this.maxNumConditions<1&&(_warnOnce('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=e.numAlwaysVisibleConditions??1,this.numAlwaysVisibleConditions<1&&(_warnOnce('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(_warnOnce('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new AgSelect);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const t=this.createValueElement();this.eConditionBodies.push(t),this.eFilterBody.appendChild(t),this.putOptionsIntoDropdown(e),this.resetType(e);const i=this.getNumConditions()-1;this.forEachPositionInput(i,s=>this.resetInput(s)),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const s=this.eJoinOperatorPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,o),this.resetJoinOperatorOr(i,s,o),this.isReadOnly()||(t.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,t,i){const s=this.createManagedBean(new AgRadioButton);return e.push(s),s.addCssClass("ag-filter-condition-operator"),s.addCssClass(`ag-filter-condition-operator-${i}`),t.appendChild(s.getGui()),s}getDefaultJoinOperator(e){return e==="AND"||e==="OR"?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map(t=>typeof t=="string"?this.createBoilerplateListOption(t):this.createCustomListOption(t))}putOptionsIntoDropdown(e){this.filterListOptions.forEach(t=>{e.addOption(t)}),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.displayName):this.translate(t)}}createBodyTemplate(){return""}getAgComponents(){return[]}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let i=0;i<this.getNumConditions();i++)this.isConditionUiComplete(i)?e=i:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const i=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<i){this.removeConditionsAndOperators(i+1);const s=e+1,o=i-s;o>0&&this.removeConditionsAndOperators(s,o),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((s,o)=>{const r=this.isConditionDisabled(o,e);s.setDisabled(r||this.filterListOptions.length<=1),o===1&&(_setDisabled(this.eJoinOperatorPanels[0],r),this.eJoinOperatorsAnd[0].setDisabled(r),this.eJoinOperatorsOr[0].setDisabled(r))}),this.eConditionBodies.forEach((s,o)=>{_setDisplayed(s,this.isConditionBodyVisible(o))});const i=(t??this.getJoinOperator())==="OR";this.eJoinOperatorsAnd.forEach(s=>{s.setValue(!i,!0)}),this.eJoinOperatorsOr.forEach(s=>{s.setValue(i,!0)}),this.forEachInput((s,o,r,n)=>{this.setElementDisplayed(s,o<n),this.setElementDisabled(s,this.isConditionDisabled(r,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,t),this.removeElements(this.eConditionBodies,e,t),this.removeValueElements(e,t);const i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,t),this.removeComponents(this.eJoinOperatorsAnd,i,t),this.removeComponents(this.eJoinOperatorsOr,i,t)}removeElements(e,t,i){this.removeItems(e,t,i).forEach(o=>_removeFromParent(o))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach(o=>{_removeFromParent(o.getGui()),this.destroyBean(o)})}removeItems(e,t,i){return i==null?e.splice(t):e.splice(t,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!e?.suppressFocus)if(this.isReadOnly())this.eFilterBody.focus();else{const t=this.getInputs(0)[0];if(!t)return;t instanceof AgAbstractInputField&&t.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,i=-1,s=!1;const o=this.getJoinOperator();for(let n=this.getNumConditions()-1;n>=0;n--)if(this.isConditionUiComplete(n))t===-1&&(t=n,i=n);else{const l=n>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(n-1),a=n<t;(l||a)&&(this.removeConditionsAndOperators(n,1),s=!0,a&&i--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(i,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if(_isFunction(this.filterPlaceholder)){const s=this.filterPlaceholder,o=this.eTypes[t].getValue(),r=this.translate(o);i=s({filterOptionKey:o,filterOption:r,placeholder:i})}else typeof this.filterPlaceholder=="string"&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput((t,i,s,o)=>{if(!(t instanceof AgAbstractInputField))return;const r=i===0&&o>1?"inRangeStart":i===0?"filterOoo":"inRangeEnd",n=i===0&&o>1?e("ariaFilterFromValue","Filter from value"):i===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,s)),t.setInputAriaLabel(n)})}setElementValue(e,t,i){e instanceof AgAbstractInputField&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){e instanceof Component&&_setDisplayed(e.getGui(),t)}setElementDisabled(e,t){e instanceof Component&&_setDisabled(e.getGui(),t)}attachElementOnChange(e,t){e instanceof AgAbstractInputField&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,i)=>{this.forEachPositionTypeInput(i,t,e)})}forEachPositionInput(e,t){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,t)}forEachPositionTypeInput(e,t,i){const s=this.getNumberOfInputs(t),o=this.getInputs(e);for(let r=0;r<o.length;r++){const n=o[r];n!=null&&i(n,r,e,s)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(i=>i==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinOperatorsAnd.forEach((t,i)=>this.resetJoinOperatorAnd(t,i,this.joinOperatorId+i)),this.eJoinOperatorsOr.forEach((t,i)=>this.resetJoinOperatorOr(t,i,this.joinOperatorId+i)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),AgPromise.resolve()}resetType(e){const i=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(i).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,t,i,s,o){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t)),this.eJoinOperatorsOr.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t))}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const i=this.mapValuesFromModel(e);this.forEachInput((s,o,r)=>{r===t&&this.setElementValue(s,i[o]!=null?i[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,i,s)=>{this.setElementValue(t,i===0&&s===0?e:null,!0)})}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,i=>{this.attachElementOnChange(i,this.listener)}))}individualConditionPasses(e,t){const i=this.getCellValue(e.node),s=this.mapValuesFromModel(t),o=this.optionsFactory.getCustomOption(t.type),r=this.evaluateCustomFilter(o,s,i);return r??(i==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,i,t,e))}evaluateCustomFilter(e,t,i){if(e==null)return;const{predicate:s}=e;if(s!=null&&!t.some(o=>o==null))return s(t,i)}isBlank(e){return e==null||typeof e=="string"&&e.trim().length===0}hasInvalidInputs(){return!1}},ScalarFilter=class extends SimpleFilter{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(e){switch(e){case"equals":case"notEqual":if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case"lessThan":case"lessThanOrEqual":if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case"inRange":if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,i){const s=this.comparator(),o=e[0]!=null?s(e[0],t):0;switch(i.type){case"equals":return o===0;case"notEqual":return o!==0;case"greaterThan":return o>0;case"greaterThanOrEqual":return o>=0;case"lessThan":return o<0;case"lessThanOrEqual":return o<=0;case"inRange":{const r=s(e[1],t);return this.scalarFilterParams.inRangeInclusive?o>=0&&r<=0:o>0&&r<0}case"blank":return this.isBlank(t);case"notBlank":return!this.isBlank(t);default:return _warnOnce('Unexpected type of filter "'+i.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}},A_KEYCODE=65,C_KEYCODE=67,V_KEYCODE=86,D_KEYCODE=68,Z_KEYCODE=90,Y_KEYCODE=89;function _isEventFromPrintableCharacter(e){return e.altKey||e.ctrlKey||e.metaKey?!1:e.key.length===1}function _isUserSuppressingKeyboardEvent(e,t,i,s,o){const r=s?s.getColDef().suppressKeyboardEvent:void 0;if(!r)return!1;const n=e.addGridCommonParams({event:t,editing:o,column:s,node:i,data:i.data,colDef:s.getColDef()});return!!(r&&r(n))}function _isUserSuppressingHeaderKeyboardEvent(e,t,i,s){const o=s.getDefinition(),r=o&&o.suppressHeaderKeyboardEvent;if(!_exists(r))return!1;const n=e.addGridCommonParams({colDef:o,column:s,headerRowIndex:i,event:t});return!!r(n)}function _normaliseQwertyAzerty(e){const{keyCode:t}=e;let i;switch(t){case A_KEYCODE:i=KeyCode.A;break;case C_KEYCODE:i=KeyCode.C;break;case V_KEYCODE:i=KeyCode.V;break;case D_KEYCODE:i=KeyCode.D;break;case Z_KEYCODE:i=KeyCode.Z;break;case Y_KEYCODE:i=KeyCode.Y;break;default:i=e.code}return i}function _isDeleteKey(e,t=!1){return e===KeyCode.DELETE?!0:!t&&e===KeyCode.BACKSPACE?_isMacOsUserAgent():!1}var AgInputTextField=class extends AgAbstractInputField{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=_exists(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=i=>{_isEventFromPrintableCharacter(i)&&i.key&&!e.test(i.key)&&i.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:i=>{const s=i.clipboardData?.getData("text");s&&s.split("").some(o=>!e.test(o))&&i.preventDefault()}})}},AgInputTextFieldSelector={selector:"AG-INPUT-TEXT-FIELD",component:AgInputTextField},AgInputNumberField=class extends AgInputTextField{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListeners(this.eInput,{blur:()=>{const o=parseFloat(this.eInput.value),r=isNaN(o)?"":this.normalizeValue(o.toString());this.value!==r&&this.setValue(r)},wheel:this.onWheel.bind(this)}),this.eInput.step="any";const{precision:e,min:t,max:i,step:s}=this.config;typeof e=="number"&&this.setPrecision(e),typeof t=="number"&&this.setMin(t),typeof i=="number"&&this.setMax(i),typeof s=="number"&&this.setStep(s)}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}normalizeValue(e){if(e==="")return"";this.precision!=null&&(e=this.adjustPrecision(e));const t=parseFloat(e);return this.min!=null&&t<this.min?e=this.min.toString():this.max!=null&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(this.precision==null)return e;if(t){const s=parseFloat(e).toFixed(this.precision);return parseFloat(s).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e?this:(this.min=e,_addOrRemoveAttribute(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,_addOrRemoveAttribute(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,_addOrRemoveAttribute(this.eInput,"step",e),this)}setValue(e,t){return this.setValueOrInputValue(i=>super.setValue(i,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,i){if(_exists(i)){let s=this.isScientificNotation(i);if(s&&this.eInput.validity.valid)return e(i);if(!s){i=this.adjustPrecision(i);const o=this.normalizeValue(i);s=i!=o}if(s)return t(i)}return e(i)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return typeof e=="string"&&e.includes("e")}},AgInputNumberFieldSelector={selector:"AG-INPUT-NUMBER-FIELD",component:AgInputNumberField},DEFAULT_NUMBER_FILTER_OPTIONS=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"],SimpleFilterModelFormatter=class{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=e.operator!=null,i=this.localeService.getLocaleTextFunc();if(t){const s=e,r=(s.conditions??[]).map(l=>this.getModelAsString(l)),n=s.operator==="AND"?"andCondition":"orCondition";return r.join(` ${i(n,FILTER_LOCALE_TEXT[n])} `)}else{if(e.type==="blank"||e.type==="notBlank")return i(e.type,e.type);{const s=e,o=this.optionsFactory.getCustomOption(s.type),{displayKey:r,displayName:n,numberOfInputs:l}=o||{};return r&&n&&l===0?(i(r,n),n):this.conditionToString(s,o)}}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){return this.valueFormatter?this.valueFormatter(e??null)??"":String(e)}},NumberFilterModelFormatter=class extends SimpleFilterModelFormatter{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type=="inRange"||i===2?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:e.filter!=null?this.formatValue(e.filter):`${e.type}`}};function getAllowedCharPattern(e){const{allowedCharPattern:t}=e??{};return t??null}var NumberFilter=class extends ScalarFilter{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern!==e.allowedCharPattern?!1:super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[this.processValue(t),this.processValue(i)].slice(0,this.getNumberOfInputs(s))}getDefaultDebounceMs(){return 500}comparator(){return(e,t)=>e===t?0:e<t?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new NumberFilterModelFormatter(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return DEFAULT_NUMBER_FILTER_OPTIONS}setElementValue(e,t,i){const s=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(t??null):t;super.setElementValue(e,s)}createValueElement(){const e=getAllowedCharPattern(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),_setAriaRole(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,i,s){const o=this.createManagedBean(s?new AgInputTextField({allowedCharPattern:s}):new AgInputNumberField);o.addCssClass(`ag-filter-${i}`),o.addCssClass("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,(i,s,o,r)=>{s<r&&t.push(this.processValue(this.stringToFloat(i.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return e==null||isNaN(e)?null:e}stringToFloat(e){if(typeof e=="number")return e;let t=_makeNull(e);return t!=null&&t.trim()===""&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):t==null||t.trim()==="-"?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValues(e);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{if(!t.getInputElement().validity.valid){e=!0;return}}),e}},DEFAULT_TEXT_FILTER_OPTIONS=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],TextFilterModelFormatter=class extends SimpleFilterModelFormatter{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type=="inRange"||i===2?`${e.filter}-${e.filterTo}`:e.filter!=null?`${e.filter}`:`${e.type}`}};function trimInputForFilter(e){const t=e&&e.trim();return t===""?e:t}var TextFilter=class extends SimpleFilter{constructor(){super("textFilter"),this.defaultFormatter=e=>e,this.defaultLowercaseFormatter=e=>e==null?null:e.toString().toLowerCase(),this.defaultMatcher=({filterOption:e,value:t,filterText:i})=>{if(i==null)return!1;switch(e){case"contains":return t.indexOf(i)>=0;case"notContains":return t.indexOf(i)<0;case"equals":return t===i;case"notEqual":return t!=i;case"startsWith":return t.indexOf(i)===0;case"endsWith":{const s=t.lastIndexOf(i);return s>=0&&s===t.length-i.length}default:return!1}},this.eValuesFrom=[],this.eValuesTo=[]}getDefaultDebounceMs(){return 500}setParams(e){this.textFilterParams=e,super.setParams(e),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?this.defaultFormatter:this.defaultLowercaseFormatter),this.filterModelFormatter=new TextFilterModelFormatter(this.localeService,this.optionsFactory)}getTextMatcher(){const e=this.textFilterParams.textCustomComparator;return e?(_warnOnce("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:t,value:i,filterText:s})=>e(t,i,s)):this.textFilterParams.textMatcher||this.defaultMatcher}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValuesWithSideEffects(e,!0);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getFilterType(){return"text"}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(e,t){const i=[];return this.forEachPositionInput(e,(s,o,r,n)=>{if(o<n){let l=_makeNull(s.getValue());t&&this.textFilterParams.trimInput&&(l=trimInputForFilter(l)??null,s.setValue(l,!0)),i.push(l)}}),i}getDefaultFilterOptions(){return DEFAULT_TEXT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),_setAriaRole(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const s=this.createManagedBean(new AgInputTextField);s.addCssClass(`ag-filter-${i}`),s.addCssClass("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(s))}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,i,s){const o=e.map(u=>this.formatter(u))||[],r=this.formatter(t),{api:n,colDef:l,column:a,context:d,textFormatter:h}=this.textFilterParams;if(i.type==="blank")return this.isBlank(t);if(i.type==="notBlank")return!this.isBlank(t);const c={api:n,colDef:l,column:a,context:d,node:s.node,data:s.data,filterOption:i.type,value:r,textFormatter:h};return o.some(u=>this.matcher({...c,filterText:u}))}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}};function toNumber(e){if(typeof e=="number")return e;if(typeof e=="string"){const t=parseInt(e);return isNaN(t)?void 0:t}}function toConstrainedNum(e,t=Number.MAX_VALUE){return i=>{const s=toNumber(i);if(!(s==null||s<e||s>t))return s}}function _padStartWidthZeros(e,t){return e.toString().padStart(t,"0")}function _createArrayOfNumbers(e,t){const i=[];for(let s=e;s<=t;s++)i.push(s);return i}function _formatNumberTwoDecimalPlacesAndCommas(e,t,i){return typeof e!="number"?"":_formatNumberCommas(Math.round(e*100)/100,t,i)}function _formatNumberCommas(e,t,i){return typeof e!="number"?"":e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${t}`)}function _serialiseDate(e,t=!0,i="-"){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(o=>_padStartWidthZeros(o,2)).join(i);return t&&(s+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map(o=>_padStartWidthZeros(o,2)).join(":")),s}var calculateOrdinal=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function _dateToFormattedString(e,t="YYYY-MM-DD"){const i=_padStartWidthZeros(e.getFullYear(),4),s=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r={YYYY:()=>i.slice(i.length-4,i.length),YY:()=>i.slice(i.length-2,i.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>s[e.getMonth()],MMM:()=>s[e.getMonth()].slice(0,3),MM:()=>_padStartWidthZeros(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${calculateOrdinal(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${calculateOrdinal(e.getDate())}`,DD:()=>_padStartWidthZeros(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>o[e.getDay()],ddd:()=>o[e.getDay()].slice(0,3),dd:()=>o[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${calculateOrdinal(e.getDay())}`,d:()=>`${e.getDay()}`},n=new RegExp(Object.keys(r).join("|"),"g");return t.replace(n,l=>l in r?r[l]():l)}function _parseDateTimeFromString(e){if(!e)return null;const[t,i]=e.split(" ");if(!t)return null;const s=t.split("-").map(c=>parseInt(c,10));if(s.filter(c=>!isNaN(c)).length!==3)return null;const[o,r,n]=s,l=new Date(o,r-1,n);if(l.getFullYear()!==o||l.getMonth()!==r-1||l.getDate()!==n)return null;if(!i||i==="00:00:00")return l;const[a,d,h]=i.split(":").map(c=>parseInt(c,10));return a>=0&&a<24&&l.setHours(a),d>=0&&d<60&&l.setMinutes(d),h>=0&&h<60&&l.setSeconds(h),l}var DateCompWrapper=class{constructor(e,t,i,s,o){this.alive=!0,this.context=e,this.eParent=s,t.getDateCompDetails(i).newAgStackInstance().then(l=>{if(!this.alive){e.destroyBean(l);return}this.dateComp=l,l&&(s.appendChild(l.getGui()),l.afterGuiAttached&&l.afterGuiAttached(),this.tempValue&&l.setDate(this.tempValue),this.disabled!=null&&this.setDateCompDisabled(this.disabled),o?.(this))})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){_setDisplayed(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&typeof this.dateComp.afterGuiAttached=="function"&&this.dateComp.afterGuiAttached(e)}updateParams(e){let t=!1;this.dateComp?.refresh&&typeof this.dateComp.refresh=="function"&&this.dateComp.refresh(e)!==null&&(t=!0),!t&&this.dateComp?.onParamsUpdated&&typeof this.dateComp.onParamsUpdated=="function"&&this.dateComp.onParamsUpdated(e)!==null&&_warnOnce("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}setDateCompDisabled(e){this.dateComp!=null&&this.dateComp.setDisabled!=null&&this.dateComp.setDisabled(e)}},DEFAULT_DATE_FILTER_OPTIONS=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"],DateFilterModelFormatter=class extends SimpleFilterModelFormatter{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:s}=t||{},o=i=="inRange"||s===2,r=_parseDateTimeFromString(e.dateFrom),n=_parseDateTimeFromString(e.dateTo),l=this.dateFilterParams.inRangeFloatingFilterDateFormat;if(o){const a=r!==null?_dateToFormattedString(r,l):"null",d=n!==null?_dateToFormattedString(n,l):"null";return`${a}-${d}`}return r!=null?_dateToFormattedString(r,l):`${i}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}},DEFAULT_MIN_YEAR=1e3,DEFAULT_MAX_YEAR=1/0,DateFilter=class extends ScalarFilter{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=DEFAULT_MIN_YEAR,this.maxValidYear=DEFAULT_MAX_YEAR,this.minValidDate=null,this.maxValidDate=null}wireBeans(e){super.wireBeans(e),this.context=e.context,this.userComponentFactory=e.userComponentFactory}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:s}=e||{};return[t&&_parseDateTimeFromString(t)||null,i&&_parseDateTimeFromString(i)||null].slice(0,this.getNumberOfInputs(s))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){const i=t;return t==null||i<e?-1:i>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(i,s)=>{if(e[i]!=null)if(isNaN(e[i]))_warnOnce(`DateFilter ${i} is not a number`);else return e[i]==null?s:Number(e[i]);return s};this.minValidYear=t("minValidYear",DEFAULT_MIN_YEAR),this.maxValidYear=t("maxValidYear",DEFAULT_MAX_YEAR),this.minValidYear>this.maxValidYear&&_warnOnce("DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:_parseDateTimeFromString(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:_parseDateTimeFromString(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&_warnOnce("DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new DateFilterModelFormatter(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new DateCompWrapper(this.context,this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc(()=>t.destroy()),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return DEFAULT_DATE_FILTER_OPTIONS}createValueElement(){const t=this.gos.getDocument().createElement("div");return t.classList.add("ag-filter-body"),this.createFromToElement(t,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(t,this.eConditionPanelsTo,this.dateConditionToComps,"to"),t}createFromToElement(e,t,i,s){const r=this.gos.getDocument().createElement("div");r.classList.add(`ag-filter-${s}`),r.classList.add(`ag-filter-date-${s}`),t.push(r),e.appendChild(r),i.push(this.createDateCompWrapper(r))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,i){this.removeItems(e,t,i).forEach(o=>o.destroy())}isValidDateValue(e){if(e===null)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((i,s,o,r)=>{o!==e||!t||s>=r||(t=t&&this.isValidDateValue(i.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}getFilterType(){return"date"}createCondition(e){const t=this.getConditionType(e),i={},s=this.getValues(e);return s.length>0&&(i.dateFrom=_serialiseDate(s[0])),s.length>1&&(i.dateTo=_serialiseDate(s[1])),{dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t,...i}}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput(s=>{s.setInputPlaceholder(t),s.setInputAriaLabel(i)})}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(i,s,o,r)=>{s<r&&t.push(i.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}},SetLeftFeature=class extends BeanStub{constructor(e,t,i,s){super(),this.columnOrGroup=e,this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=s,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?_last(this.colsSpanning):this.columnOrGroup}postConstruct(){const e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){const e=this.beans.gos.get("suppressColumnMoveAnimation"),t=_exists(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),s=this.modifyLeftForPrintLayout(e,i),o=this.modifyLeftForPrintLayout(e,t);this.setLeft(s),this.actualLeft=o,this.beans.columnAnimationService.executeNextVMTurn(()=>{this.actualLeft===o&&this.setLeft(o)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!this.beans.gos.isDomLayout("print")||e.getPinned()==="left")return t;const s=this.beans.visibleColsService.getColsLeftWidth();if(e.getPinned()==="right"){const o=this.beans.visibleColsService.getBodyContainerWidth();return s+o+t}return s+t}setLeft(e){if(_exists(e)&&(this.eCell.style.left=`${e}px`),isColumnGroup(this.columnOrGroup)){const t=this.columnOrGroup.getLeafColumns();if(!t.length)return;t.length>1&&_setAriaColSpan(this.ariaEl,t.length)}}},CSS_FIRST_COLUMN="ag-column-first",CSS_LAST_COLUMN="ag-column-last";function _getHeaderClassesFromColDef(e,t,i,s){return _missing(e)?[]:getColumnClassesFromCollDef(e.headerClass,e,t,i,s)}function _getToolPanelClassesFromColDef(e,t,i,s){return _missing(e)?[]:getColumnClassesFromCollDef(e.toolPanelClass,e,t,i,s)}function refreshFirstAndLastStyles(e,t,i){e.addOrRemoveCssClass(CSS_FIRST_COLUMN,i.isColAtEdge(t,"first")),e.addOrRemoveCssClass(CSS_LAST_COLUMN,i.isColAtEdge(t,"last"))}function getClassParams(e,t,i,s){return t.addGridCommonParams({colDef:e,column:i,columnGroup:s})}function getColumnClassesFromCollDef(e,t,i,s,o){if(_missing(e))return[];let r;if(typeof e=="function"){const n=getClassParams(t,i,s,o);r=e(n)}else r=e;return typeof r=="string"?[r]:Array.isArray(r)?[...r]:[]}var instanceIdSequence2=0,_AbstractHeaderCellCtrl=class B extends BeanStub{constructor(t,i,s){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=t,this.parentRowCtrl=s,this.beans=i,this.instanceId=t.getUniqueId()+"-"+instanceIdSequence2++}wireBeans(t){this.pinnedWidthService=t.pinnedWidthService,this.focusService=t.focusService,this.userComponentFactory=t.userComponentFactory,this.ctrlsService=t.ctrlsService,this.dragAndDropService=t.dragAndDropService,this.menuService=t.menuService}postConstruct(){this.addManagedPropertyListeners(["suppressHeaderFocus"],()=>this.refreshTabIndex())}shouldStopEventPropagation(t){const{headerRowIndex:i,column:s}=this.focusService.getFocusedHeader();return _isUserSuppressingHeaderKeyboardEvent(this.gos,t,i,s)}getWrapperHasFocus(){return this.gos.getActiveDomElement()===this.eGui}setGui(t){this.eGui=t,this.addDomData(),this.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),this.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onGuiFocus(){const t={type:"headerFocused",column:this.column};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){!this.comp||!this.column||(this.refreshFirstAndLastStyles(),this.refreshAriaColIndex())}refreshFirstAndLastStyles(){const{comp:t,column:i,beans:s}=this;refreshFirstAndLastStyles(t,i,s.visibleColsService)}refreshAriaColIndex(){const{beans:t,column:i}=this,s=t.visibleColsService.getAriaColIndex(i);_setAriaColIndex(this.eGui,s)}addResizeAndMoveKeyboardListeners(){this.resizeFeature&&this.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){this.gos.get("suppressHeaderFocus")?this.eGui.removeAttribute("tabindex"):this.eGui.setAttribute("tabindex","-1")}onGuiKeyDown(t){const i=this.gos.getActiveDomElement(),s=t.key===KeyCode.LEFT||t.key===KeyCode.RIGHT;if(this.isResizing&&(t.preventDefault(),t.stopImmediatePropagation()),i!==this.eGui||!t.shiftKey&&!t.altKey||((this.isResizing||s)&&(t.preventDefault(),t.stopImmediatePropagation()),!s))return;const o=t.key===KeyCode.LEFT!==this.gos.get("enableRtl"),r=HorizontalDirection[o?"Left":"Right"];if(t.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const n=this.getViewportAdjustedResizeDiff(t);this.resizeHeader(n,t.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(r)}getViewportAdjustedResizeDiff(t){let i=this.getResizeDiff(t);if(this.column.getPinned()){const o=this.pinnedWidthService.getPinnedLeftWidth(),r=this.pinnedWidthService.getPinnedRightWidth(),n=_getInnerWidth(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(o+r+i>n)if(n>o+r)i=n-o-r;else return 0}return i}getResizeDiff(t){let i=t.key===KeyCode.LEFT!==this.gos.get("enableRtl");const s=this.column.getPinned(),o=this.gos.get("enableRtl");return s&&o!==(s==="right")&&(i=!i),(i?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout(()=>{this.resizeFeature?.toggleColumnResizing(!1)},150))}handleKeyDown(t){const i=this.getWrapperHasFocus();switch(t.key){case KeyCode.PAGE_DOWN:case KeyCode.PAGE_UP:case KeyCode.PAGE_HOME:case KeyCode.PAGE_END:i&&t.preventDefault()}}addDomData(){const t=B.DOM_DATA_KEY_HEADER_CTRL;this.gos.setDomData(this.eGui,t,this),this.addDestroyFunc(()=>this.gos.setDomData(this.eGui,t,null))}getGui(){return this.eGui}focus(t){return this.eGui?(this.lastFocusEvent=t||null,this.eGui.focus(),!0):!1}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(t,i,s){const o=t??i;this.gos.get("preventDefaultOnContextMenu")&&o.preventDefault();const r=isColumn(s)?s:void 0;this.menuService.isHeaderContextMenuEnabled(r)&&this.menuService.showHeaderContextMenu(r,t,i),this.dispatchColumnMouseEvent("columnHeaderContextMenu",s)}dispatchColumnMouseEvent(t,i){const s={type:t,column:i};this.eventService.dispatchEvent(s)}destroy(){super.destroy(),this.removeDragSource(),this.comp=null,this.column=null,this.resizeFeature=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null,this.eGui=null}};_AbstractHeaderCellCtrl.DOM_DATA_KEY_HEADER_CTRL="headerCtrl";var AbstractHeaderCellCtrl=_AbstractHeaderCellCtrl,HoverFeature=class extends BeanStub{wireBeans(e){this.columnHoverService=e.columnHoverService}constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gos.get("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListeners(this.element,{mouseout:this.onMouseOut.bind(this),mouseover:this.onMouseOver.bind(this)})}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}},HeaderFilterCellCtrl=class extends AbstractHeaderCellCtrl{constructor(e,t,i){super(e,t,i),this.iconCreated=!1,this.column=e}setComp(e,t,i,s){this.comp=e,this.eButtonShowMainFilter=i,this.eFloatingFilterBody=s,this.setGui(t),this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(),this.addManagedListeners(this.column,{colDefChanged:this.onColDefChanged.bind(this)})}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef(),t=!!e.filter,i=!!e.floatingFilter;this.active=t&&i}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=_createIconNoSpan("filter",this.gos,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(){this.createManagedBean(new ManagedFocusFeature(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();_setAriaLabel(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(this.gos.getActiveDomElement()===this.eGui)return;const s=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(s){this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),s.focus();return}const o=this.findNextColumnWithFloatingFilter(e.shiftKey);o&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:o},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleColsService;let i=this.column;do if(i=e?t.getColBefore(i):t.getColAfter(i),!i)break;while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case KeyCode.UP:case KeyCode.DOWN:t||e.preventDefault();case KeyCode.LEFT:case KeyCode.RIGHT:if(t)return;e.stopPropagation();case KeyCode.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case KeyCode.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const i=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&_isElementChildOfClass(e.relatedTarget,"ag-floating-filter");if(i&&s&&e.target===this.eGui){const r=this.lastFocusEvent,n=!!(r&&r.key===KeyCode.TAB);if(r&&n){const l=r.shiftKey;this.focusService.focusInto(this.eGui,l)}}const o=this.getRowIndex();this.beans.focusService.setFocusedHeader(o,this.column)}setupHover(){this.createManagedBean(new HoverFeature([this.column],this.eGui));const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const t=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",t)};this.addManagedEventListeners({columnHoverChanged:e}),e()}setupLeft(){const e=new SetLeftFeature(this.column,this.eGui,this.beans);this.createManagedBean(e)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){if(!this.active)return;const e=this.beans.filterManager?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(){if(!this.active)return;const{filterManager:e}=this.beans,t=i=>{if(i?.source==="filterDestroyed"&&!this.isAlive())return;const s=this.comp.getFloatingFilterComp();s&&s.then(o=>{if(o){const r=e?.getCurrentFloatingFilterParentModel(this.column),n=i?{...i,columns:i.columns??[],source:i.source==="api"?"api":"columnFilter"}:null;o.onParentModelChanged(r,n)}})};[this.destroySyncListener]=this.addManagedListeners(this.column,{filterChanged:t}),e?.isFilterActive(this.column)&&t(null)}setupWidth(){const e=()=>{const t=`${this.column.getActualWidth()}px`;this.comp.setWidth(t)};this.addManagedListeners(this.column,{widthChanged:e}),e()}setupFilterChangedListener(){this.active&&([this.destroyFilterChangedListener]=this.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const e=!!this.beans.filterManager?.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(){const e=this.active;this.setupActive();const t=!e&&this.active;e&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const i=this.active?this.beans.filterManager?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,s=this.comp.getFloatingFilterComp();!s||!i?this.updateCompDetails(i,t):s.then(o=>{!o||this.beans.filterManager?.areFilterCompsDifferent(this.userCompDetails??null,i)?this.updateCompDetails(i,t):this.updateFloatingFilterParams(i)})}updateCompDetails(e,t){this.isAlive()&&(this.setCompDetails(e),this.setupFilterButton(),this.setupUi(),t&&(this.setupSyncWithFilter(),this.setupFilterChangedListener()))}updateFloatingFilterParams(e){if(!e)return;const t=e.params;this.comp.getFloatingFilterComp()?.then(i=>{let s=!1;i?.refresh&&typeof i.refresh=="function"&&i.refresh(t)!==null&&(s=!0),!s&&i?.onParamsUpdated&&typeof i.onParamsUpdated=="function"&&i.onParamsUpdated(t)!==null&&_warnOnce("Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")})}destroy(){super.destroy(),this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.destroySyncListener=null,this.destroyFilterChangedListener=null}},VERSION="32.0.0";function isColumnFilterPresent(e){return!!e.filterManager?.isColumnFilterPresent()||!!e.filterManager?.isAggregateFilterPresent()}function getFilterInstance(e,t,i){return e.filterManager?.getFilterInstance(t,i)}function getColumnFilterInstance(e,t){return e.filterManager?.getColumnFilterInstance(t)??Promise.resolve(void 0)}function destroyFilter(e,t){const i=e.columnModel.getColDefCol(t);if(i)return e.filterManager?.destroyFilter(i,"api")}function setFilterModel(e,t){e.frameworkOverrides.wrapIncoming(()=>e.filterManager?.setFilterModel(t))}function getFilterModel(e){return e.filterManager?.getFilterModel()??{}}function getColumnFilterModel(e,t){return e.filterManager?.getColumnFilterModel(t)??null}function setColumnFilterModel(e,t,i){return e.filterManager?.setColumnFilterModel(t,i)??Promise.resolve()}function showColumnFilter(e,t){const i=e.columnModel.getCol(t);if(!i){_errorOnce(`column '${t}' not found`);return}e.menuService.showFilterMenu({column:i,containerType:"columnFilter",positionBy:"auto"})}function getDefaultFloatingFilterType(e,t,i){if(t==null)return null;let s=null;const{compName:o,jsComp:r,fwComp:n}=UserComponentFactory.getCompKeys(e,t,FilterComponent);return o?s={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[o]:r==null&&n==null&&t.filter===!0&&(s=i()),s}var ColumnFilterService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnFilterService",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[]}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.rowModel=e.rowModel,this.userComponentFactory=e.userComponentFactory,this.rowRenderer=e.rowRenderer,this.dataTypeService=e.dataTypeService,this.filterManager=e.filterManager}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),rowDataUpdated:()=>this.onNewRowsLoaded("rowDataUpdated"),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.initialFilterModel={...this.gos.get("initialState")?.filter?.filterModel??{}}}setFilterModel(e,t="api"){if(this.dataTypeService?.isPendingInference()){this.filterModelUpdateQueue.push({model:e,source:t});return}const i=[],s=this.getFilterModel();if(e){const o=new Set(Object.keys(e));this.allColumnFilters.forEach((r,n)=>{const l=e[n];i.push(this.setModelOnFilterWrapper(r.filterPromise,l)),o.delete(n)}),o.forEach(r=>{const n=this.columnModel.getColDefCol(r)||this.columnModel.getCol(r);if(!n){_warnOnce("setFilterModel() - no column found for colId: "+r);return}if(!n.isFilterAllowed()){_warnOnce("setFilterModel() - unable to fully apply model, filtering disabled for colId: "+r);return}const l=this.getOrCreateFilterWrapper(n);if(!l){_warnOnce("setFilterModel() - unable to fully apply model, unable to create filter for colId: "+r);return}i.push(this.setModelOnFilterWrapper(l.filterPromise,e[r]))})}else this.allColumnFilters.forEach(o=>{i.push(this.setModelOnFilterWrapper(o.filterPromise,null))});AgPromise.all(i).then(()=>{const o=this.getFilterModel(),r=[];this.allColumnFilters.forEach((n,l)=>{const a=s?s[l]:null,d=o?o[l]:null;_jsonEquals(a,d)||r.push(n.column)}),r.length>0&&this.filterManager?.onFilterChanged({columns:r,source:t})})}setModelOnFilterWrapper(e,t){return new AgPromise(i=>{e.then(s=>{typeof s.setModel!="function"&&(_warnOnce("filter missing setModel method, which is needed for setFilterModel"),i()),(s.setModel(t)||AgPromise.resolve()).then(()=>i())})})}getFilterModel(){const e={};return this.allColumnFilters.forEach((t,i)=>{const s=this.getModelFromFilterWrapper(t);_exists(s)&&(e[i]=s)}),e}getModelFromFilterWrapper(e){const{filter:t}=e;return t?typeof t.getModel!="function"?(_warnOnce("filter API missing getModel method, which is needed for getFilterModel"),null):t.getModel():this.getModelFromInitialState(e.column)}getModelFromInitialState(e){return this.initialFilterModel[e.getColId()]??null}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}disableColumnFilters(){return this.allColumnFilters.size?(this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"advancedFilterEnabled")),!0):!1}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){const e=r=>r?r.isFilterActive?r.isFilterActive():(_warnOnce("Filter is missing isFilterActive() method"),!1):!1,t=!!this.gos.getGroupAggFiltering(),i=r=>{if(!r.isPrimary())return!0;const l=!this.columnModel.isPivotActive();return!r.isValueActive()||!l?!1:this.columnModel.isPivotMode()?!0:t},s=[],o=[];return this.forEachColumnFilter((r,n)=>{e(r)&&(i(n.column)?s.push(r):o.push(r))}).then(()=>{this.activeAggregateFilters=s,this.activeColumnFilters=o})}updateFilterFlagInColumns(e,t){return this.forEachColumnFilter((i,s)=>s.column.setFilterActive(i.isFilterActive(),e,t))}forEachColumnFilter(e){return AgPromise.all(Array.from(this.allColumnFilters.values()).map(t=>t.filterPromise.then(i=>e(i,t))))}doColumnFiltersPass(e,t,i){const{data:s,aggData:o}=e,r=i?this.activeAggregateFilters:this.activeColumnFilters,n=i?o:s;for(let l=0;l<r.length;l++){const a=r[l];if(!(a==null||a===t)){if(typeof a.doesFilterPass!="function")throw new Error("Filter is missing method doesFilterPass");if(!a.doesFilterPass({node:e,data:n}))return!1}}return!0}callOnFilterChangedOutsideRenderCycle(e){const t=()=>this.filterManager?.onFilterChanged(e);this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}updateBeforeFilterChanged(e={}){const{filterInstance:t,additionalEventAttributes:i}=e;return this.updateDependentFilters(),this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",i).then(()=>{this.allColumnFilters.forEach(s=>{s.filterPromise&&s.filterPromise.then(o=>{o&&o!==t&&o.onAnyFilterChanged&&o.onAnyFilterChanged()})}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){this.forEachColumnFilter(t=>{t.onNewRowsLoaded&&t.onNewRowsLoaded()}).then(()=>this.updateFilterFlagInColumns(e,{afterDataChange:!0})).then(()=>this.updateActiveFilters())}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,i)=>{const s=i?this.columnModel.getCol(i):e;return s?this.valueService.getValue(s,t,!0):void 0}}isFilterActive(e){const{filter:t}=this.cachedFilter(e)??{};return t?t.isFilterActive():this.getModelFromInitialState(e)!=null}getOrCreateFilterWrapper(e){if(!e.isFilterAllowed())return null;let t=this.cachedFilter(e);return t||(t=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,t)),t}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){let t;if(ModuleRegistry.__isRegistered("@ag-grid-enterprise/set-filter",this.gridId))t="agSetColumnFilter";else{const i=this.dataTypeService?.getBaseDataType(e);i==="number"?t="agNumberColumnFilter":i==="date"||i==="dateString"?t="agDateColumnFilter":t="agTextColumnFilter"}return t}getDefaultFloatingFilter(e){let t;if(ModuleRegistry.__isRegistered("@ag-grid-enterprise/set-filter",this.gridId))t="agSetColumnFloatingFilter";else{const i=this.dataTypeService?.getBaseDataType(e);i==="number"?t="agNumberColumnFloatingFilter":i==="date"||i==="dateString"?t="agDateColumnFloatingFilter":t="agTextColumnFloatingFilter"}return t}createFilterInstance(e,t){const i=this.getDefaultFilter(e),s=e.getColDef();let o;const r={...this.createFilterParams(e,s),filterModifiedCallback:()=>this.filterModifiedCallbackFactory(o,e)(),filterChangedCallback:l=>this.filterChangedCallbackFactory(o,e)(l),doesRowPassOtherFilter:l=>this.filterManager?this.filterManager.doesRowPassOtherFilters(o,l):!0},n=this.userComponentFactory.getFilterDetails(s,r,i);return n?{filterPromise:()=>{const l=n.newAgStackInstance();return l?.then(a=>{o=a,t&&(t.filter=a)}),l},compDetails:n}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gos.addGridCommonParams({column:e,colDef:_cloneObject(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e){const t={column:e,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:i,compDetails:s}=this.createFilterInstance(e,t);return t.filterPromise=i?.()??null,t.compDetails=s,t}onColumnsChanged(){const e=[];this.allColumnFilters.forEach((t,i)=>{let s;t.column.isPrimary()?s=this.columnModel.getColDefCol(i):s=this.columnModel.getCol(i),!(s&&s===t.column)&&(e.push(t.column),this.disposeFilterWrapper(t,"columnChanged"),this.disposeColumnListener(i))}),e.length>0?this.filterManager?.onFilterChanged({columns:e,source:"api"}):this.updateDependentFilters()}updateDependentFilters(){this.columnModel.getAutoCols()?.forEach(t=>{t.getColDef().filter==="agGroupColumnFilter"&&this.getOrCreateFilterWrapper(t)})}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const{filter:i}=this.allColumnFilters.get(e.getColId())??{};return i&&typeof i?.isFilterAllowed=="function"?i.isFilterAllowed():!0}getFloatingFilterCompDetails(e,t){const i=a=>{const d=this.getOrCreateFilterWrapper(e)?.filterPromise;d?.then(h=>{a(_unwrapUserComp(h))})},s=e.getColDef(),o={...this.createFilterParams(e,s),filterChangedCallback:()=>i(a=>this.filterChangedCallbackFactory(a,e)())},r=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(s,FilterComponent,o);let n=getDefaultFloatingFilterType(this.frameworkOverrides,s,()=>this.getDefaultFloatingFilter(e));n==null&&(n="agReadOnlyFloatingFilter");const l={column:e,filterParams:r,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(s,l,n)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilter(e,t="api"){const i=e.getColId(),s=this.allColumnFilters.get(i);this.disposeColumnListener(i),delete this.initialFilterModel[i],s&&(this.disposeFilterWrapper(s,t),this.filterManager?.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then(i=>{this.destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId());const s={type:"filterDestroyed",source:t,column:e.column};this.eventService.dispatchEvent(s)})}filterModifiedCallbackFactory(e,t){return()=>{const i={type:"filterModified",column:t,filterInstance:e};this.eventService.dispatchEvent(i)}}filterChangedCallbackFactory(e,t){return i=>{const s=i?.source??"columnFilter",o={filter:e,additionalEventAttributes:i,columns:[t],source:s};this.callOnFilterChangedOutsideRenderCycle(o)}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:s}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,s)){this.destroyFilter(i,"paramsUpdated");return}const o=i.getColDef().filterParams;if(!t.filterPromise){this.destroyFilter(i,"paramsUpdated");return}t.filterPromise.then(r=>{(r?.refresh?r.refresh({...this.createFilterParams(i,i.getColDef()),filterModifiedCallback:this.filterModifiedCallbackFactory(r,i),filterChangedCallback:this.filterChangedCallbackFactory(r,i),doesRowPassOtherFilter:l=>this.filterManager?this.filterManager.doesRowPassOtherFilters(r,l):!0,...o}):!0)===!1&&this.destroyFilter(i,"paramsUpdated")})}setColumnFilterWrapper(e,t){const i=e.getColId();this.allColumnFilters.set(i,t),this.allColumnListeners.set(i,this.addManagedListeners(e,{colDefChanged:()=>this.checkDestroyFilter(i)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:s}=t;return!(i===s||i?.render&&s?.render&&i.render===s.render)}hasFloatingFilters(){return this.columnModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e,t){t&&this.getFilterInstanceImpl(e).then(i=>{const s=_unwrapUserComp(i);t(s)})}getColumnFilterInstance(e){return new Promise(t=>{this.getFilterInstanceImpl(e).then(i=>{t(_unwrapUserComp(i))})})}getFilterInstanceImpl(e){const t=this.columnModel.getColDefCol(e);return t?this.getOrCreateFilterWrapper(t)?.filterPromise??AgPromise.resolve(null):AgPromise.resolve(void 0)}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach(({model:e,source:t})=>this.setFilterModel(e,t)),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach(({key:e,model:t,resolve:i})=>{this.setColumnFilterModel(e,t).then(()=>i())}),this.columnFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){if(this.dataTypeService?.isPendingInference()){let r=()=>{};const n=new Promise(l=>{r=l});return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:r}),n}const i=this.columnModel.getColDefCol(e),s=i?this.getOrCreateFilterWrapper(i):null;return s?(r=>new Promise(n=>{r.then(l=>n(l))}))(this.setModelOnFilterWrapper(s.filterPromise,t)):Promise.resolve()}getFilterWrapper(e){const t=this.columnModel.getColDefCol(e);return t?this.cachedFilter(t)??null:null}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear()}};function isAnyFilterPresent(e){return!!e.filterManager?.isAnyFilterPresent()}function onFilterChanged(e,t="api"){e.filterManager?.onFilterChanged({source:t})}var ReadOnlyFloatingFilter=class extends Component{constructor(){super(`
|
|
76
|
+
</div>`,e?.agComponents||[],e?.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.eLabel=RefPlaceholder,this.eWrapper=RefPlaceholder,this.eDisplayField=RefPlaceholder,this.eIcon=RefPlaceholder,this.ariaRole=e?.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:s,minPickerWidth:o,maxPickerWidth:r}=e;t!=null&&(this.pickerGap=t),this.variableWidth=!!s,i!=null&&this.setPickerMaxHeight(i),o!=null&&this.setPickerMinWidth(o),r!=null&&this.setPickerMaxWidth(r)}wireBeans(e){this.popupService=e.popupService}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();this.addManagedElementListeners(t,{keydown:this.onKeyDown.bind(this)}),this.addManagedElementListeners(this.eLabel,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)}),this.addManagedElementListeners(this.eWrapper,{mousedown:this.onLabelOrWrapperMouseDown.bind(this)});const{pickerIcon:i,inputWidth:s}=this.config;if(i){const o=_createIconNoSpan(i,this.gos);o&&this.eIcon.appendChild(o)}s!=null&&this.setInputWidth(s)}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",this.gos.get("tabIndex").toString()),_setAriaExpanded(e,!1),this.ariaRole&&_setAriaRole(e,this.ariaRole)}onLabelOrWrapperMouseDown(e){if(e){const t=this.getFocusableElement();if(t!==this.eWrapper&&e?.target===t)return;e.preventDefault(),this.getFocusableElement().focus()}if(this.skipClick){this.skipClick=!1;return}this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case KeyCode.UP:case KeyCode.DOWN:case KeyCode.ENTER:case KeyCode.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case KeyCode.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker());break}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.gos.getDocument(),t=this.pickerComponent.getGui();this.gos.get("suppressScrollWhenPopupsAreOpen")||([this.destroyMouseWheelFunc]=this.addManagedEventListeners({bodyScroll:()=>{this.hidePicker()}}));const i=this.localeService.getLocaleTextFunc(),{pickerAriaLabelKey:s,pickerAriaLabelValue:o,modalPicker:r=!0}=this.config,n={modal:r,eChild:t,closeOnEsc:!0,closedCallback:()=>{const g=this.gos.getActiveDomElement(),p=!g||g===e.body;this.beforeHidePicker(),p&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:i(s,o)},l=this.popupService.addPopup(n),{maxPickerHeight:a,minPickerWidth:d,maxPickerWidth:h,variableWidth:c}=this;c?(d&&(t.style.minWidth=d),t.style.width=_formatSize(_getAbsoluteWidth(this.eWrapper)),h&&(t.style.maxWidth=h)):_setElementWidth(t,h??_getAbsoluteWidth(this.eWrapper));const u=a??`${_getInnerHeight(this.popupService.getPopupParent())}px`;return t.style.setProperty("max-height",u),t.style.position="absolute",this.alignPickerToComponent(),l.hideFunc}alignPickerToComponent(){if(!this.pickerComponent)return;const{pickerType:e}=this.config,{pickerGap:t}=this,i=this.gos.get("enableRtl")?"right":"left";this.popupService.positionPopupByComponent({type:e,eventSource:this.eWrapper,ePopup:this.pickerComponent.getGui(),position:"under",alignSide:i,keepWithinBounds:!0,nudgeY:t})}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;const t=this.getAriaElement();_setAriaExpanded(t,e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){this.pickerComponent?.getGui().contains(e.relatedTarget)||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setInputWidth(e){return _setElementWidth(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return typeof e=="number"&&(e=`${e}px`),this.minPickerWidth=e??void 0,this}setPickerMaxWidth(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerWidth=e??void 0,this}setPickerMaxHeight(e){return typeof e=="number"&&(e=`${e}px`),this.maxPickerHeight=e??void 0,this}destroy(){this.hidePicker(),super.destroy()}},AgSelect=class extends AgPickerField{constructor(e){super({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"combobox",...e})}postConstruct(){super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=this.gos.get("tabIndex");const{options:e,value:t,placeholder:i}=this.config;e!=null&&this.addOptions(e),t!=null&&this.setValue(t,!0),i&&t==null&&(this.eDisplayField.textContent=i),this.addManagedElementListeners(this.eWrapper,{focusout:this.onWrapperFocusOut.bind(this)})}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}createListComponent(){this.listComponent=this.createBean(new AgList("select",!0)),this.listComponent.setParentComponent(this);const e=this.listComponent.getAriaElement(),t=`ag-select-list-${this.listComponent.getCompId()}`;e.setAttribute("id",t),_setAriaControls(this.getAriaElement(),e),this.listComponent.addManagedListeners(this.listComponent,{selectedItem:()=>{this.hidePicker(),this.dispatchLocalEvent({type:"selectedItem"})}}),this.listComponent.addManagedListeners(this.listComponent,{fieldValueChanged:()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())}})}createPickerComponent(){return this.listComponent}onKeyDown(e){const{key:t}=e;switch(t===KeyCode.TAB&&this.hidePicker(),t){case KeyCode.ENTER:case KeyCode.UP:case KeyCode.DOWN:case KeyCode.PAGE_UP:case KeyCode.PAGE_DOWN:case KeyCode.PAGE_HOME:case KeyCode.PAGE_END:e.preventDefault(),this.isPickerDisplayed?this.listComponent?.handleKeyDown(e):super.onKeyDown(e);break;case KeyCode.ESCAPE:super.onKeyDown(e);break}}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach(t=>this.addOption(t)),this}addOption(e){return this.listComponent.addOption(e),this}clearOptions(){return this.listComponent?.clearOptions(),this}setValue(e,t,i){if(this.value===e||!this.listComponent)return this;if(i||this.listComponent.setValue(e,!0),this.listComponent.getValue()===this.getValue())return this;let o=this.listComponent.getDisplayValue();return o==null&&this.config.placeholder&&(o=this.config.placeholder),this.eDisplayField.textContent=o,this.setTooltip({newTooltipText:o??null,shouldDisplayTooltip:()=>this.eDisplayField.scrollWidth>this.eDisplayField.clientWidth}),super.setValue(e,t)}destroy(){this.listComponent&&(this.listComponent=this.destroyBean(this.listComponent)),super.destroy()}},AgSelectSelector={selector:"AG-SELECT",component:AgSelect},OptionsFactory=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach(e=>{if(typeof e=="string")return;const t=[["displayKey"],["displayName"],["predicate","test"]],i=s=>s.some(o=>e[o]!=null)?!0:(_warnOnce(`ignoring FilterOptionDef as it doesn't contain one of '${s}'`),!1);if(!t.every(i)){this.filterOptions=this.filterOptions.filter(s=>s===e)||[];return}this.customFilterOptions[e.displayKey]=e})}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const t=this.filterOptions[0];typeof t=="string"?this.defaultOption=t:t.displayKey?this.defaultOption=t.displayKey:_warnOnce("invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else _warnOnce("no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}},SimpleFilter=class extends ProvidedFilter{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(e){const t=this.optionsFactory.getCustomOption(e);if(t){const{numberOfInputs:s}=t;return s??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,i)=>{i===0?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return this.eJoinOperatorsOr.length===0?this.defaultJoinOperator:this.eJoinOperatorsOr[0].getValue()===!0?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const i=!e.operator,s=!t.operator;if(!i&&s||i&&!s)return!1;let r;if(i){const n=e,l=t;r=this.areSimpleModelsEqual(n,l)}else{const n=e,l=t;r=n.operator===l.operator&&_areEqual(n.conditions,l.conditions,(a,d)=>this.areSimpleModelsEqual(a,d))}return r}shouldRefresh(e){const t=this.getModel(),i=t?t.conditions??[t]:null,s=e.filterOptions?.map(r=>typeof r=="string"?r:r.displayKey)??this.getDefaultFilterOptions();return!(!(!i||i.every(r=>s.find(n=>n===r.type)!==void 0))||typeof e.maxNumConditions=="number"&&i&&i.length>e.maxNumConditions)}refresh(e){return!this.shouldRefresh(e)||!super.refresh(e)?!1:(this.setParams(e),this.removeConditionsAndOperators(0),this.createOption(),this.setModel(this.getModel()),!0)}setModelIntoUi(e){if(e.operator){const i=e;let s=i.conditions;s==null&&(s=[],_warnOnce("Filter model is missing 'conditions'"));const o=this.validateAndUpdateConditions(s),r=this.getNumConditions();if(o<r)this.removeConditionsAndOperators(o);else if(o>r)for(let l=r;l<o;l++)this.createJoinOperatorPanel(),this.createOption();const n=i.operator==="OR";this.eJoinOperatorsAnd.forEach(l=>l.setValue(!n,!0)),this.eJoinOperatorsOr.forEach(l=>l.setValue(n,!0)),s.forEach((l,a)=>{this.eTypes[a].setValue(l.type,!0),this.setConditionIntoUi(l,a)})}else{const i=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(i.type,!0),this.setConditionIntoUi(i,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),AgPromise.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),_warnOnce('Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),t=this.maxNumConditions),t}doesFilterPass(e){const t=this.getModel();if(t==null)return!0;const{operator:i}=t,s=[];if(i){const r=t;s.push(...r.conditions??[])}else s.push(t);return s[i&&i==="OR"?"some":"every"](r=>this.individualConditionPasses(e,r))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new OptionsFactory,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){this.maxNumConditions=e.maxNumConditions??2,this.maxNumConditions<1&&(_warnOnce('"filterParams.maxNumConditions" must be greater than or equal to zero.'),this.maxNumConditions=1),this.numAlwaysVisibleConditions=e.numAlwaysVisibleConditions??1,this.numAlwaysVisibleConditions<1&&(_warnOnce('"filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(_warnOnce('"filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new AgSelect);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const t=this.createValueElement();this.eConditionBodies.push(t),this.eFilterBody.appendChild(t),this.putOptionsIntoDropdown(e),this.resetType(e);const i=this.getNumConditions()-1;this.forEachPositionInput(i,s=>this.resetInput(s)),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const s=this.eJoinOperatorPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,o),this.resetJoinOperatorOr(i,s,o),this.isReadOnly()||(t.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,t,i){const s=this.createManagedBean(new AgRadioButton);return e.push(s),s.addCssClass("ag-filter-condition-operator"),s.addCssClass(`ag-filter-condition-operator-${i}`),t.appendChild(s.getGui()),s}getDefaultJoinOperator(e){return e==="AND"||e==="OR"?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map(t=>typeof t=="string"?this.createBoilerplateListOption(t):this.createCustomListOption(t))}putOptionsIntoDropdown(e){this.filterListOptions.forEach(t=>{e.addOption(t)}),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.displayName):this.translate(t)}}createBodyTemplate(){return""}getAgComponents(){return[]}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let i=0;i<this.getNumConditions();i++)this.isConditionUiComplete(i)?e=i:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const i=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<i){this.removeConditionsAndOperators(i+1);const s=e+1,o=i-s;o>0&&this.removeConditionsAndOperators(s,o),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((s,o)=>{const r=this.isConditionDisabled(o,e);s.setDisabled(r||this.filterListOptions.length<=1),o===1&&(_setDisabled(this.eJoinOperatorPanels[0],r),this.eJoinOperatorsAnd[0].setDisabled(r),this.eJoinOperatorsOr[0].setDisabled(r))}),this.eConditionBodies.forEach((s,o)=>{_setDisplayed(s,this.isConditionBodyVisible(o))});const i=(t??this.getJoinOperator())==="OR";this.eJoinOperatorsAnd.forEach(s=>{s.setValue(!i,!0)}),this.eJoinOperatorsOr.forEach(s=>{s.setValue(i,!0)}),this.forEachInput((s,o,r,n)=>{this.setElementDisplayed(s,o<n),this.setElementDisabled(s,this.isConditionDisabled(r,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,t),this.removeElements(this.eConditionBodies,e,t),this.removeValueElements(e,t);const i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,t),this.removeComponents(this.eJoinOperatorsAnd,i,t),this.removeComponents(this.eJoinOperatorsOr,i,t)}removeElements(e,t,i){this.removeItems(e,t,i).forEach(o=>_removeFromParent(o))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach(o=>{_removeFromParent(o.getGui()),this.destroyBean(o)})}removeItems(e,t,i){return i==null?e.splice(t):e.splice(t,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!e?.suppressFocus)if(this.isReadOnly())this.eFilterBody.focus();else{const t=this.getInputs(0)[0];if(!t)return;t instanceof AgAbstractInputField&&t.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.resetUiToActiveModel(e);let t=-1,i=-1,s=!1;const o=this.getJoinOperator();for(let n=this.getNumConditions()-1;n>=0;n--)if(this.isConditionUiComplete(n))t===-1&&(t=n,i=n);else{const l=n>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(n-1),a=n<t;(l||a)&&(this.removeConditionsAndOperators(n,1),s=!0,a&&i--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(i,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if(_isFunction(this.filterPlaceholder)){const s=this.filterPlaceholder,o=this.eTypes[t].getValue(),r=this.translate(o);i=s({filterOptionKey:o,filterOption:r,placeholder:i})}else typeof this.filterPlaceholder=="string"&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput((t,i,s,o)=>{if(!(t instanceof AgAbstractInputField))return;const r=i===0&&o>1?"inRangeStart":i===0?"filterOoo":"inRangeEnd",n=i===0&&o>1?e("ariaFilterFromValue","Filter from value"):i===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,s)),t.setInputAriaLabel(n)})}setElementValue(e,t,i){e instanceof AgAbstractInputField&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){e instanceof Component&&_setDisplayed(e.getGui(),t)}setElementDisabled(e,t){e instanceof Component&&_setDisabled(e.getGui(),t)}attachElementOnChange(e,t){e instanceof AgAbstractInputField&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,i)=>{this.forEachPositionTypeInput(i,t,e)})}forEachPositionInput(e,t){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,t)}forEachPositionTypeInput(e,t,i){const s=this.getNumberOfInputs(t),o=this.getInputs(e);for(let r=0;r<o.length;r++){const n=o[r];n!=null&&i(n,r,e,s)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(i=>i==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinOperatorsAnd.forEach((t,i)=>this.resetJoinOperatorAnd(t,i,this.joinOperatorId+i)),this.eJoinOperatorsOr.forEach((t,i)=>this.resetJoinOperatorOr(t,i,this.joinOperatorId+i)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),AgPromise.resolve()}resetType(e){const i=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(i).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,t,i,s,o){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t)),this.eJoinOperatorsOr.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t))}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const i=this.mapValuesFromModel(e);this.forEachInput((s,o,r)=>{r===t&&this.setElementValue(s,i[o]!=null?i[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,i,s)=>{this.setElementValue(t,i===0&&s===0?e:null,!0)})}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,i=>{this.attachElementOnChange(i,this.listener)}))}individualConditionPasses(e,t){const i=this.getCellValue(e.node),s=this.mapValuesFromModel(t),o=this.optionsFactory.getCustomOption(t.type),r=this.evaluateCustomFilter(o,s,i);return r??(i==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,i,t,e))}evaluateCustomFilter(e,t,i){if(e==null)return;const{predicate:s}=e;if(s!=null&&!t.some(o=>o==null))return s(t,i)}isBlank(e){return e==null||typeof e=="string"&&e.trim().length===0}hasInvalidInputs(){return!1}},ScalarFilter=class extends SimpleFilter{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(e){switch(e){case"equals":case"notEqual":if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case"lessThan":case"lessThanOrEqual":if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case"inRange":if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,i){const s=this.comparator(),o=e[0]!=null?s(e[0],t):0;switch(i.type){case"equals":return o===0;case"notEqual":return o!==0;case"greaterThan":return o>0;case"greaterThanOrEqual":return o>=0;case"lessThan":return o<0;case"lessThanOrEqual":return o<=0;case"inRange":{const r=s(e[1],t);return this.scalarFilterParams.inRangeInclusive?o>=0&&r<=0:o>0&&r<0}case"blank":return this.isBlank(t);case"notBlank":return!this.isBlank(t);default:return _warnOnce('Unexpected type of filter "'+i.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}},A_KEYCODE=65,C_KEYCODE=67,V_KEYCODE=86,D_KEYCODE=68,Z_KEYCODE=90,Y_KEYCODE=89;function _isEventFromPrintableCharacter(e){return e.altKey||e.ctrlKey||e.metaKey?!1:e.key.length===1}function _isUserSuppressingKeyboardEvent(e,t,i,s,o){const r=s?s.getColDef().suppressKeyboardEvent:void 0;if(!r)return!1;const n=e.addGridCommonParams({event:t,editing:o,column:s,node:i,data:i.data,colDef:s.getColDef()});return!!(r&&r(n))}function _isUserSuppressingHeaderKeyboardEvent(e,t,i,s){const o=s.getDefinition(),r=o&&o.suppressHeaderKeyboardEvent;if(!_exists(r))return!1;const n=e.addGridCommonParams({colDef:o,column:s,headerRowIndex:i,event:t});return!!r(n)}function _normaliseQwertyAzerty(e){const{keyCode:t}=e;let i;switch(t){case A_KEYCODE:i=KeyCode.A;break;case C_KEYCODE:i=KeyCode.C;break;case V_KEYCODE:i=KeyCode.V;break;case D_KEYCODE:i=KeyCode.D;break;case Z_KEYCODE:i=KeyCode.Z;break;case Y_KEYCODE:i=KeyCode.Y;break;default:i=e.code}return i}function _isDeleteKey(e,t=!1){return e===KeyCode.DELETE?!0:!t&&e===KeyCode.BACKSPACE?_isMacOsUserAgent():!1}var AgInputTextField=class extends AgAbstractInputField{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,t){return this.eInput.value!==e&&(this.eInput.value=_exists(e)?e:""),super.setValue(e,t)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`),t=i=>{_isEventFromPrintableCharacter(i)&&i.key&&!e.test(i.key)&&i.preventDefault()};this.addManagedListeners(this.eInput,{keydown:t,paste:i=>{const s=i.clipboardData?.getData("text");s&&s.split("").some(o=>!e.test(o))&&i.preventDefault()}})}},AgInputTextFieldSelector={selector:"AG-INPUT-TEXT-FIELD",component:AgInputTextField},AgInputNumberField=class extends AgInputTextField{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListeners(this.eInput,{blur:()=>{const o=parseFloat(this.eInput.value),r=isNaN(o)?"":this.normalizeValue(o.toString());this.value!==r&&this.setValue(r)},wheel:this.onWheel.bind(this)}),this.eInput.step="any";const{precision:e,min:t,max:i,step:s}=this.config;typeof e=="number"&&this.setPrecision(e),typeof t=="number"&&this.setMin(t),typeof i=="number"&&this.setMax(i),typeof s=="number"&&this.setStep(s)}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}normalizeValue(e){if(e==="")return"";this.precision!=null&&(e=this.adjustPrecision(e));const t=parseFloat(e);return this.min!=null&&t<this.min?e=this.min.toString():this.max!=null&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(this.precision==null)return e;if(t){const s=parseFloat(e).toFixed(this.precision);return parseFloat(s).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e?this:(this.min=e,_addOrRemoveAttribute(this.eInput,"min",e),this)}setMax(e){return this.max===e?this:(this.max=e,_addOrRemoveAttribute(this.eInput,"max",e),this)}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e?this:(this.step=e,_addOrRemoveAttribute(this.eInput,"step",e),this)}setValue(e,t){return this.setValueOrInputValue(i=>super.setValue(i,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(t=>super.setValue(t,!0),t=>{this.eInput.value=t},e)}setValueOrInputValue(e,t,i){if(_exists(i)){let s=this.isScientificNotation(i);if(s&&this.eInput.validity.valid)return e(i);if(!s){i=this.adjustPrecision(i);const o=this.normalizeValue(i);s=i!=o}if(s)return t(i)}return e(i)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return typeof e=="string"&&e.includes("e")}},AgInputNumberFieldSelector={selector:"AG-INPUT-NUMBER-FIELD",component:AgInputNumberField},DEFAULT_NUMBER_FILTER_OPTIONS=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"],SimpleFilterModelFormatter=class{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=e.operator!=null,i=this.localeService.getLocaleTextFunc();if(t){const s=e,r=(s.conditions??[]).map(l=>this.getModelAsString(l)),n=s.operator==="AND"?"andCondition":"orCondition";return r.join(` ${i(n,FILTER_LOCALE_TEXT[n])} `)}else{if(e.type==="blank"||e.type==="notBlank")return i(e.type,e.type);{const s=e,o=this.optionsFactory.getCustomOption(s.type),{displayKey:r,displayName:n,numberOfInputs:l}=o||{};return r&&n&&l===0?(i(r,n),n):this.conditionToString(s,o)}}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){return this.valueFormatter?this.valueFormatter(e??null)??"":String(e)}},NumberFilterModelFormatter=class extends SimpleFilterModelFormatter{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type=="inRange"||i===2?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:e.filter!=null?this.formatValue(e.filter):`${e.type}`}};function getAllowedCharPattern(e){const{allowedCharPattern:t}=e??{};return t??null}var NumberFilter=class extends ScalarFilter{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}refresh(e){return this.numberFilterParams.allowedCharPattern!==e.allowedCharPattern?!1:super.refresh(e)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[this.processValue(t),this.processValue(i)].slice(0,this.getNumberOfInputs(s))}getDefaultDebounceMs(){return 500}comparator(){return(e,t)=>e===t?0:e<t?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new NumberFilterModelFormatter(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return DEFAULT_NUMBER_FILTER_OPTIONS}setElementValue(e,t,i){const s=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(t??null):t;super.setElementValue(e,s)}createValueElement(){const e=getAllowedCharPattern(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),_setAriaRole(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,i,s){const o=this.createManagedBean(s?new AgInputTextField({allowedCharPattern:s}):new AgInputNumberField);o.addCssClass(`ag-filter-${i}`),o.addCssClass("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,(i,s,o,r)=>{s<r&&t.push(this.processValue(this.stringToFloat(i.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return e==null||isNaN(e)?null:e}stringToFloat(e){if(typeof e=="number")return e;let t=_makeNull(e);return t!=null&&t.trim()===""&&(t=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(t):t==null||t.trim()==="-"?null:parseFloat(t)}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValues(e);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{if(!t.getInputElement().validity.valid){e=!0;return}}),e}},DEFAULT_TEXT_FILTER_OPTIONS=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],TextFilterModelFormatter=class extends SimpleFilterModelFormatter{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type=="inRange"||i===2?`${e.filter}-${e.filterTo}`:e.filter!=null?`${e.filter}`:`${e.type}`}};function trimInputForFilter(e){const t=e&&e.trim();return t===""?e:t}var TextFilter=class extends SimpleFilter{constructor(){super("textFilter"),this.defaultFormatter=e=>e,this.defaultLowercaseFormatter=e=>e==null?null:e.toString().toLowerCase(),this.defaultMatcher=({filterOption:e,value:t,filterText:i})=>{if(i==null)return!1;switch(e){case"contains":return t.indexOf(i)>=0;case"notContains":return t.indexOf(i)<0;case"equals":return t===i;case"notEqual":return t!=i;case"startsWith":return t.indexOf(i)===0;case"endsWith":{const s=t.lastIndexOf(i);return s>=0&&s===t.length-i.length}default:return!1}},this.eValuesFrom=[],this.eValuesTo=[]}getDefaultDebounceMs(){return 500}setParams(e){this.textFilterParams=e,super.setParams(e),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?this.defaultFormatter:this.defaultLowercaseFormatter),this.filterModelFormatter=new TextFilterModelFormatter(this.localeService,this.optionsFactory)}getTextMatcher(){const e=this.textFilterParams.textCustomComparator;return e?(_warnOnce("textCustomComparator is deprecated, use textMatcher instead."),({filterOption:t,value:i,filterText:s})=>e(t,i,s)):this.textFilterParams.textMatcher||this.defaultMatcher}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValuesWithSideEffects(e,!0);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getFilterType(){return"text"}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(e,t){const i=[];return this.forEachPositionInput(e,(s,o,r,n)=>{if(o<n){let l=_makeNull(s.getValue());t&&this.textFilterParams.trimInput&&(l=trimInputForFilter(l)??null,s.setValue(l,!0)),i.push(l)}}),i}getDefaultFilterOptions(){return DEFAULT_TEXT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),_setAriaRole(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const s=this.createManagedBean(new AgInputTextField);s.addCssClass(`ag-filter-${i}`),s.addCssClass("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(s))}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,i,s){const o=e.map(u=>this.formatter(u))||[],r=this.formatter(t),{api:n,colDef:l,column:a,context:d,textFormatter:h}=this.textFilterParams;if(i.type==="blank")return this.isBlank(t);if(i.type==="notBlank")return!this.isBlank(t);const c={api:n,colDef:l,column:a,context:d,node:s.node,data:s.data,filterOption:i.type,value:r,textFormatter:h};return o.some(u=>this.matcher({...c,filterText:u}))}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}};function toNumber(e){if(typeof e=="number")return e;if(typeof e=="string"){const t=parseInt(e);return isNaN(t)?void 0:t}}function toConstrainedNum(e,t=Number.MAX_VALUE){return i=>{const s=toNumber(i);if(!(s==null||s<e||s>t))return s}}function _padStartWidthZeros(e,t){return e.toString().padStart(t,"0")}function _createArrayOfNumbers(e,t){const i=[];for(let s=e;s<=t;s++)i.push(s);return i}function _formatNumberTwoDecimalPlacesAndCommas(e,t,i){return typeof e!="number"?"":_formatNumberCommas(Math.round(e*100)/100,t,i)}function _formatNumberCommas(e,t,i){return typeof e!="number"?"":e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${t}`)}function _serialiseDate(e,t=!0,i="-"){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(o=>_padStartWidthZeros(o,2)).join(i);return t&&(s+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map(o=>_padStartWidthZeros(o,2)).join(":")),s}var calculateOrdinal=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function _dateToFormattedString(e,t="YYYY-MM-DD"){const i=_padStartWidthZeros(e.getFullYear(),4),s=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r={YYYY:()=>i.slice(i.length-4,i.length),YY:()=>i.slice(i.length-2,i.length),Y:()=>`${e.getFullYear()}`,MMMM:()=>s[e.getMonth()],MMM:()=>s[e.getMonth()].slice(0,3),MM:()=>_padStartWidthZeros(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${calculateOrdinal(e.getMonth()+1)}`,M:()=>`${e.getMonth()+1}`,Do:()=>`${e.getDate()}${calculateOrdinal(e.getDate())}`,DD:()=>_padStartWidthZeros(e.getDate(),2),D:()=>`${e.getDate()}`,dddd:()=>o[e.getDay()],ddd:()=>o[e.getDay()].slice(0,3),dd:()=>o[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${calculateOrdinal(e.getDay())}`,d:()=>`${e.getDay()}`},n=new RegExp(Object.keys(r).join("|"),"g");return t.replace(n,l=>l in r?r[l]():l)}function _parseDateTimeFromString(e){if(!e)return null;const[t,i]=e.split(" ");if(!t)return null;const s=t.split("-").map(c=>parseInt(c,10));if(s.filter(c=>!isNaN(c)).length!==3)return null;const[o,r,n]=s,l=new Date(o,r-1,n);if(l.getFullYear()!==o||l.getMonth()!==r-1||l.getDate()!==n)return null;if(!i||i==="00:00:00")return l;const[a,d,h]=i.split(":").map(c=>parseInt(c,10));return a>=0&&a<24&&l.setHours(a),d>=0&&d<60&&l.setMinutes(d),h>=0&&h<60&&l.setSeconds(h),l}var DateCompWrapper=class{constructor(e,t,i,s,o){this.alive=!0,this.context=e,this.eParent=s,t.getDateCompDetails(i).newAgStackInstance().then(l=>{if(!this.alive){e.destroyBean(l);return}this.dateComp=l,l&&(s.appendChild(l.getGui()),l.afterGuiAttached&&l.afterGuiAttached(),this.tempValue&&l.setDate(this.tempValue),this.disabled!=null&&this.setDateCompDisabled(this.disabled),o?.(this))})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){_setDisplayed(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&typeof this.dateComp.afterGuiAttached=="function"&&this.dateComp.afterGuiAttached(e)}updateParams(e){let t=!1;this.dateComp?.refresh&&typeof this.dateComp.refresh=="function"&&this.dateComp.refresh(e)!==null&&(t=!0),!t&&this.dateComp?.onParamsUpdated&&typeof this.dateComp.onParamsUpdated=="function"&&this.dateComp.onParamsUpdated(e)!==null&&_warnOnce("Custom date component method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")}setDateCompDisabled(e){this.dateComp!=null&&this.dateComp.setDisabled!=null&&this.dateComp.setDisabled(e)}},DEFAULT_DATE_FILTER_OPTIONS=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"],DateFilterModelFormatter=class extends SimpleFilterModelFormatter{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:s}=t||{},o=i=="inRange"||s===2,r=_parseDateTimeFromString(e.dateFrom),n=_parseDateTimeFromString(e.dateTo),l=this.dateFilterParams.inRangeFloatingFilterDateFormat;if(o){const a=r!==null?_dateToFormattedString(r,l):"null",d=n!==null?_dateToFormattedString(n,l):"null";return`${a}-${d}`}return r!=null?_dateToFormattedString(r,l):`${i}`}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}},DEFAULT_MIN_YEAR=1e3,DEFAULT_MAX_YEAR=1/0,DateFilter=class extends ScalarFilter{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=DEFAULT_MIN_YEAR,this.maxValidYear=DEFAULT_MAX_YEAR,this.minValidDate=null,this.maxValidDate=null}wireBeans(e){super.wireBeans(e),this.context=e.context,this.userComponentFactory=e.userComponentFactory}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:s}=e||{};return[t&&_parseDateTimeFromString(t)||null,i&&_parseDateTimeFromString(i)||null].slice(0,this.getNumberOfInputs(s))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){const i=t;return t==null||i<e?-1:i>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(i,s)=>{if(e[i]!=null)if(isNaN(e[i]))_warnOnce(`DateFilter ${i} is not a number`);else return e[i]==null?s:Number(e[i]);return s};this.minValidYear=t("minValidYear",DEFAULT_MIN_YEAR),this.maxValidYear=t("maxValidYear",DEFAULT_MAX_YEAR),this.minValidYear>this.maxValidYear&&_warnOnce("DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:_parseDateTimeFromString(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:_parseDateTimeFromString(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&_warnOnce("DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new DateFilterModelFormatter(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new DateCompWrapper(this.context,this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc(()=>t.destroy()),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return DEFAULT_DATE_FILTER_OPTIONS}createValueElement(){const t=this.gos.getDocument().createElement("div");return t.classList.add("ag-filter-body"),this.createFromToElement(t,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(t,this.eConditionPanelsTo,this.dateConditionToComps,"to"),t}createFromToElement(e,t,i,s){const r=this.gos.getDocument().createElement("div");r.classList.add(`ag-filter-${s}`),r.classList.add(`ag-filter-date-${s}`),t.push(r),e.appendChild(r),i.push(this.createDateCompWrapper(r))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,i){this.removeItems(e,t,i).forEach(o=>o.destroy())}isValidDateValue(e){if(e===null)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((i,s,o,r)=>{o!==e||!t||s>=r||(t=t&&this.isValidDateValue(i.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}getFilterType(){return"date"}createCondition(e){const t=this.getConditionType(e),i={},s=this.getValues(e);return s.length>0&&(i.dateFrom=_serialiseDate(s[0])),s.length>1&&(i.dateTo=_serialiseDate(s[1])),{dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t,...i}}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput(s=>{s.setInputPlaceholder(t),s.setInputAriaLabel(i)})}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(i,s,o,r)=>{s<r&&t.push(i.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}getModelAsString(e){return this.filterModelFormatter.getModelAsString(e)??""}},SetLeftFeature=class extends BeanStub{constructor(e,t,i,s){super(),this.columnOrGroup=e,this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=s,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gos.get("enableRtl")&&this.colsSpanning?_last(this.colsSpanning):this.columnOrGroup}postConstruct(){const e=this.onLeftChanged.bind(this);this.addManagedListeners(this.columnOrGroup,{leftChanged:e}),this.setLeftFirstTime(),this.addManagedEventListeners({displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}setLeftFirstTime(){const e=this.beans.gos.get("suppressColumnMoveAnimation"),t=_exists(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&t&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),s=this.modifyLeftForPrintLayout(e,i),o=this.modifyLeftForPrintLayout(e,t);this.setLeft(s),this.actualLeft=o,this.beans.columnAnimationService.executeNextVMTurn(()=>{this.actualLeft===o&&this.setLeft(o)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!this.beans.gos.isDomLayout("print")||e.getPinned()==="left")return t;const s=this.beans.visibleColsService.getColsLeftWidth();if(e.getPinned()==="right"){const o=this.beans.visibleColsService.getBodyContainerWidth();return s+o+t}return s+t}setLeft(e){if(_exists(e)&&(this.eCell.style.left=`${e}px`),isColumnGroup(this.columnOrGroup)){const t=this.columnOrGroup.getLeafColumns();if(!t.length)return;t.length>1&&_setAriaColSpan(this.ariaEl,t.length)}}},CSS_FIRST_COLUMN="ag-column-first",CSS_LAST_COLUMN="ag-column-last";function _getHeaderClassesFromColDef(e,t,i,s){return _missing(e)?[]:getColumnClassesFromCollDef(e.headerClass,e,t,i,s)}function _getToolPanelClassesFromColDef(e,t,i,s){return _missing(e)?[]:getColumnClassesFromCollDef(e.toolPanelClass,e,t,i,s)}function refreshFirstAndLastStyles(e,t,i){e.addOrRemoveCssClass(CSS_FIRST_COLUMN,i.isColAtEdge(t,"first")),e.addOrRemoveCssClass(CSS_LAST_COLUMN,i.isColAtEdge(t,"last"))}function getClassParams(e,t,i,s){return t.addGridCommonParams({colDef:e,column:i,columnGroup:s})}function getColumnClassesFromCollDef(e,t,i,s,o){if(_missing(e))return[];let r;if(typeof e=="function"){const n=getClassParams(t,i,s,o);r=e(n)}else r=e;return typeof r=="string"?[r]:Array.isArray(r)?[...r]:[]}var instanceIdSequence2=0,_AbstractHeaderCellCtrl=class B extends BeanStub{constructor(t,i,s){super(),this.resizeToggleTimeout=0,this.resizeMultiplier=1,this.resizeFeature=null,this.lastFocusEvent=null,this.dragSource=null,this.columnGroupChild=t,this.parentRowCtrl=s,this.beans=i,this.instanceId=t.getUniqueId()+"-"+instanceIdSequence2++}wireBeans(t){this.pinnedWidthService=t.pinnedWidthService,this.focusService=t.focusService,this.userComponentFactory=t.userComponentFactory,this.ctrlsService=t.ctrlsService,this.dragAndDropService=t.dragAndDropService,this.menuService=t.menuService}postConstruct(){this.addManagedPropertyListeners(["suppressHeaderFocus"],()=>this.refreshTabIndex())}shouldStopEventPropagation(t){const{headerRowIndex:i,column:s}=this.focusService.getFocusedHeader();return _isUserSuppressingHeaderKeyboardEvent(this.gos,t,i,s)}getWrapperHasFocus(){return this.gos.getActiveDomElement()===this.eGui}setGui(t){this.eGui=t,this.addDomData(),this.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),this.addManagedElementListeners(this.eGui,{focus:this.onGuiFocus.bind(this)}),this.onDisplayedColumnsChanged(),this.refreshTabIndex()}onGuiFocus(){const t={type:"headerFocused",column:this.column};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){!this.comp||!this.column||(this.refreshFirstAndLastStyles(),this.refreshAriaColIndex())}refreshFirstAndLastStyles(){const{comp:t,column:i,beans:s}=this;refreshFirstAndLastStyles(t,i,s.visibleColsService)}refreshAriaColIndex(){const{beans:t,column:i}=this,s=t.visibleColsService.getAriaColIndex(i);_setAriaColIndex(this.eGui,s)}addResizeAndMoveKeyboardListeners(){this.resizeFeature&&this.addManagedListeners(this.eGui,{keydown:this.onGuiKeyDown.bind(this),keyup:this.onGuiKeyUp.bind(this)})}refreshTabIndex(){this.gos.get("suppressHeaderFocus")?this.eGui.removeAttribute("tabindex"):this.eGui.setAttribute("tabindex","-1")}onGuiKeyDown(t){const i=this.gos.getActiveDomElement(),s=t.key===KeyCode.LEFT||t.key===KeyCode.RIGHT;if(this.isResizing&&(t.preventDefault(),t.stopImmediatePropagation()),i!==this.eGui||!t.shiftKey&&!t.altKey||((this.isResizing||s)&&(t.preventDefault(),t.stopImmediatePropagation()),!s))return;const o=t.key===KeyCode.LEFT!==this.gos.get("enableRtl"),r=HorizontalDirection[o?"Left":"Right"];if(t.altKey){this.isResizing=!0,this.resizeMultiplier+=1;const n=this.getViewportAdjustedResizeDiff(t);this.resizeHeader(n,t.shiftKey),this.resizeFeature?.toggleColumnResizing(!0)}else this.moveHeader(r)}getViewportAdjustedResizeDiff(t){let i=this.getResizeDiff(t);if(this.column.getPinned()){const o=this.pinnedWidthService.getPinnedLeftWidth(),r=this.pinnedWidthService.getPinnedRightWidth(),n=_getInnerWidth(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(o+r+i>n)if(n>o+r)i=n-o-r;else return 0}return i}getResizeDiff(t){let i=t.key===KeyCode.LEFT!==this.gos.get("enableRtl");const s=this.column.getPinned(),o=this.gos.get("enableRtl");return s&&o!==(s==="right")&&(i=!i),(i?-1:1)*this.resizeMultiplier}onGuiKeyUp(){this.isResizing&&(this.resizeToggleTimeout&&(window.clearTimeout(this.resizeToggleTimeout),this.resizeToggleTimeout=0),this.isResizing=!1,this.resizeMultiplier=1,this.resizeToggleTimeout=window.setTimeout(()=>{this.resizeFeature?.toggleColumnResizing(!1)},150))}handleKeyDown(t){const i=this.getWrapperHasFocus();switch(t.key){case KeyCode.PAGE_DOWN:case KeyCode.PAGE_UP:case KeyCode.PAGE_HOME:case KeyCode.PAGE_END:i&&t.preventDefault()}}addDomData(){const t=B.DOM_DATA_KEY_HEADER_CTRL;this.gos.setDomData(this.eGui,t,this),this.addDestroyFunc(()=>this.gos.setDomData(this.eGui,t,null))}getGui(){return this.eGui}focus(t){return this.eGui?(this.lastFocusEvent=t||null,this.eGui.focus(),!0):!1}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}removeDragSource(){this.dragSource&&(this.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null)}handleContextMenuMouseEvent(t,i,s){const o=t??i;this.gos.get("preventDefaultOnContextMenu")&&o.preventDefault();const r=isColumn(s)?s:void 0;this.menuService.isHeaderContextMenuEnabled(r)&&this.menuService.showHeaderContextMenu(r,t,i),this.dispatchColumnMouseEvent("columnHeaderContextMenu",s)}dispatchColumnMouseEvent(t,i){const s={type:t,column:i};this.eventService.dispatchEvent(s)}destroy(){super.destroy(),this.removeDragSource(),this.comp=null,this.column=null,this.resizeFeature=null,this.lastFocusEvent=null,this.columnGroupChild=null,this.parentRowCtrl=null,this.eGui=null}};_AbstractHeaderCellCtrl.DOM_DATA_KEY_HEADER_CTRL="headerCtrl";var AbstractHeaderCellCtrl=_AbstractHeaderCellCtrl,HoverFeature=class extends BeanStub{wireBeans(e){this.columnHoverService=e.columnHoverService}constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gos.get("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListeners(this.element,{mouseout:this.onMouseOut.bind(this),mouseover:this.onMouseOver.bind(this)})}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}},HeaderFilterCellCtrl=class extends AbstractHeaderCellCtrl{constructor(e,t,i){super(e,t,i),this.iconCreated=!1,this.column=e}setComp(e,t,i,s){this.comp=e,this.eButtonShowMainFilter=i,this.eFloatingFilterBody=s,this.setGui(t),this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(),this.addManagedListeners(this.column,{colDefChanged:this.onColDefChanged.bind(this)})}resizeHeader(){}moveHeader(){}setupActive(){const e=this.column.getColDef(),t=!!e.filter,i=!!e.floatingFilter;this.active=t&&i}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=_createIconNoSpan("filter",this.gos,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(){this.createManagedBean(new ManagedFocusFeature(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();_setAriaLabel(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(this.gos.getActiveDomElement()===this.eGui)return;const s=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(s){this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),s.focus();return}const o=this.findNextColumnWithFloatingFilter(e.shiftKey);o&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:o},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleColsService;let i=this.column;do if(i=e?t.getColBefore(i):t.getColAfter(i),!i)break;while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case KeyCode.UP:case KeyCode.DOWN:t||e.preventDefault();case KeyCode.LEFT:case KeyCode.RIGHT:if(t)return;e.stopPropagation();case KeyCode.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case KeyCode.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const i=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&_isElementChildOfClass(e.relatedTarget,"ag-floating-filter");if(i&&s&&e.target===this.eGui){const r=this.lastFocusEvent,n=!!(r&&r.key===KeyCode.TAB);if(r&&n){const l=r.shiftKey;this.focusService.focusInto(this.eGui,l)}}const o=this.getRowIndex();this.beans.focusService.setFocusedHeader(o,this.column)}setupHover(){this.createManagedBean(new HoverFeature([this.column],this.eGui));const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const t=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",t)};this.addManagedEventListeners({columnHoverChanged:e}),e()}setupLeft(){const e=new SetLeftFeature(this.column,this.eGui,this.beans);this.createManagedBean(e)}setupFilterButton(){this.suppressFilterButton=!this.menuService.isFloatingFilterButtonEnabled(this.column),this.highlightFilterButtonWhenActive=!this.menuService.isLegacyMenuEnabled()}setupUserComp(){if(!this.active)return;const e=this.beans.filterManager?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuService.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(){if(!this.active)return;const{filterManager:e}=this.beans,t=i=>{if(i?.source==="filterDestroyed"&&!this.isAlive())return;const s=this.comp.getFloatingFilterComp();s&&s.then(o=>{if(o){const r=e?.getCurrentFloatingFilterParentModel(this.column),n=i?{...i,columns:i.columns??[],source:i.source==="api"?"api":"columnFilter"}:null;o.onParentModelChanged(r,n)}})};[this.destroySyncListener]=this.addManagedListeners(this.column,{filterChanged:t}),e?.isFilterActive(this.column)&&t(null)}setupWidth(){const e=()=>{const t=`${this.column.getActualWidth()}px`;this.comp.setWidth(t)};this.addManagedListeners(this.column,{widthChanged:e}),e()}setupFilterChangedListener(){this.active&&([this.destroyFilterChangedListener]=this.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){if(!this.suppressFilterButton&&this.comp){const e=!!this.beans.filterManager?.isFilterAllowed(this.column);this.comp.setButtonWrapperDisplayed(e),this.highlightFilterButtonWhenActive&&e&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(){const e=this.active;this.setupActive();const t=!e&&this.active;e&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const i=this.active?this.beans.filterManager?.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,s=this.comp.getFloatingFilterComp();!s||!i?this.updateCompDetails(i,t):s.then(o=>{!o||this.beans.filterManager?.areFilterCompsDifferent(this.userCompDetails??null,i)?this.updateCompDetails(i,t):this.updateFloatingFilterParams(i)})}updateCompDetails(e,t){this.isAlive()&&(this.setCompDetails(e),this.setupFilterButton(),this.setupUi(),t&&(this.setupSyncWithFilter(),this.setupFilterChangedListener()))}updateFloatingFilterParams(e){if(!e)return;const t=e.params;this.comp.getFloatingFilterComp()?.then(i=>{let s=!1;i?.refresh&&typeof i.refresh=="function"&&i.refresh(t)!==null&&(s=!0),!s&&i?.onParamsUpdated&&typeof i.onParamsUpdated=="function"&&i.onParamsUpdated(t)!==null&&_warnOnce("Custom floating filter method 'onParamsUpdated' is deprecated. Use 'refresh' instead.")})}destroy(){super.destroy(),this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.destroySyncListener=null,this.destroyFilterChangedListener=null}},VERSION="32.0.2";function isColumnFilterPresent(e){return!!e.filterManager?.isColumnFilterPresent()||!!e.filterManager?.isAggregateFilterPresent()}function getFilterInstance(e,t,i){return e.filterManager?.getFilterInstance(t,i)}function getColumnFilterInstance(e,t){return e.filterManager?.getColumnFilterInstance(t)??Promise.resolve(void 0)}function destroyFilter(e,t){const i=e.columnModel.getColDefCol(t);if(i)return e.filterManager?.destroyFilter(i,"api")}function setFilterModel(e,t){e.frameworkOverrides.wrapIncoming(()=>e.filterManager?.setFilterModel(t))}function getFilterModel(e){return e.filterManager?.getFilterModel()??{}}function getColumnFilterModel(e,t){return e.filterManager?.getColumnFilterModel(t)??null}function setColumnFilterModel(e,t,i){return e.filterManager?.setColumnFilterModel(t,i)??Promise.resolve()}function showColumnFilter(e,t){const i=e.columnModel.getCol(t);if(!i){_errorOnce(`column '${t}' not found`);return}e.menuService.showFilterMenu({column:i,containerType:"columnFilter",positionBy:"auto"})}function getDefaultFloatingFilterType(e,t,i){if(t==null)return null;let s=null;const{compName:o,jsComp:r,fwComp:n}=UserComponentFactory.getCompKeys(e,t,FilterComponent);return o?s={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"}[o]:r==null&&n==null&&t.filter===!0&&(s=i()),s}var ColumnFilterService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnFilterService",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue=[]}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.rowModel=e.rowModel,this.userComponentFactory=e.userComponentFactory,this.rowRenderer=e.rowRenderer,this.dataTypeService=e.dataTypeService,this.filterManager=e.filterManager}postConstruct(){this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),rowDataUpdated:()=>this.onNewRowsLoaded("rowDataUpdated"),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.initialFilterModel={...this.gos.get("initialState")?.filter?.filterModel??{}}}setFilterModel(e,t="api"){if(this.dataTypeService?.isPendingInference()){this.filterModelUpdateQueue.push({model:e,source:t});return}const i=[],s=this.getFilterModel();if(e){const o=new Set(Object.keys(e));this.allColumnFilters.forEach((r,n)=>{const l=e[n];i.push(this.setModelOnFilterWrapper(r.filterPromise,l)),o.delete(n)}),o.forEach(r=>{const n=this.columnModel.getColDefCol(r)||this.columnModel.getCol(r);if(!n){_warnOnce("setFilterModel() - no column found for colId: "+r);return}if(!n.isFilterAllowed()){_warnOnce("setFilterModel() - unable to fully apply model, filtering disabled for colId: "+r);return}const l=this.getOrCreateFilterWrapper(n);if(!l){_warnOnce("setFilterModel() - unable to fully apply model, unable to create filter for colId: "+r);return}i.push(this.setModelOnFilterWrapper(l.filterPromise,e[r]))})}else this.allColumnFilters.forEach(o=>{i.push(this.setModelOnFilterWrapper(o.filterPromise,null))});AgPromise.all(i).then(()=>{const o=this.getFilterModel(),r=[];this.allColumnFilters.forEach((n,l)=>{const a=s?s[l]:null,d=o?o[l]:null;_jsonEquals(a,d)||r.push(n.column)}),r.length>0&&this.filterManager?.onFilterChanged({columns:r,source:t})})}setModelOnFilterWrapper(e,t){return new AgPromise(i=>{e.then(s=>{typeof s.setModel!="function"&&(_warnOnce("filter missing setModel method, which is needed for setFilterModel"),i()),(s.setModel(t)||AgPromise.resolve()).then(()=>i())})})}getFilterModel(){const e={};return this.allColumnFilters.forEach((t,i)=>{const s=this.getModelFromFilterWrapper(t);_exists(s)&&(e[i]=s)}),e}getModelFromFilterWrapper(e){const{filter:t}=e;return t?typeof t.getModel!="function"?(_warnOnce("filter API missing getModel method, which is needed for getFilterModel"),null):t.getModel():this.getModelFromInitialState(e.column)}getModelFromInitialState(e){return this.initialFilterModel[e.getColId()]??null}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}disableColumnFilters(){return this.allColumnFilters.size?(this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"advancedFilterEnabled")),!0):!1}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){const e=r=>r?r.isFilterActive?r.isFilterActive():(_warnOnce("Filter is missing isFilterActive() method"),!1):!1,t=!!this.gos.getGroupAggFiltering(),i=r=>{if(!r.isPrimary())return!0;const l=!this.columnModel.isPivotActive();return!r.isValueActive()||!l?!1:this.columnModel.isPivotMode()?!0:t},s=[],o=[];return this.forEachColumnFilter((r,n)=>{e(r)&&(i(n.column)?s.push(r):o.push(r))}).then(()=>{this.activeAggregateFilters=s,this.activeColumnFilters=o})}updateFilterFlagInColumns(e,t){return this.forEachColumnFilter((i,s)=>s.column.setFilterActive(i.isFilterActive(),e,t))}forEachColumnFilter(e){return AgPromise.all(Array.from(this.allColumnFilters.values()).map(t=>t.filterPromise.then(i=>e(i,t))))}doColumnFiltersPass(e,t,i){const{data:s,aggData:o}=e,r=i?this.activeAggregateFilters:this.activeColumnFilters,n=i?o:s;for(let l=0;l<r.length;l++){const a=r[l];if(!(a==null||a===t)){if(typeof a.doesFilterPass!="function")throw new Error("Filter is missing method doesFilterPass");if(!a.doesFilterPass({node:e,data:n}))return!1}}return!0}callOnFilterChangedOutsideRenderCycle(e){const t=()=>this.filterManager?.onFilterChanged(e);this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}updateBeforeFilterChanged(e={}){const{filterInstance:t,additionalEventAttributes:i}=e;return this.updateDependentFilters(),this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",i).then(()=>{this.allColumnFilters.forEach(s=>{s.filterPromise&&s.filterPromise.then(o=>{o&&o!==t&&o.onAnyFilterChanged&&o.onAnyFilterChanged()})}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){this.forEachColumnFilter(t=>{t.onNewRowsLoaded&&t.onNewRowsLoaded()}).then(()=>this.updateFilterFlagInColumns(e,{afterDataChange:!0})).then(()=>this.updateActiveFilters())}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}createGetValue(e){return(t,i)=>{const s=i?this.columnModel.getCol(i):e;return s?this.valueService.getValue(s,t,!0):void 0}}isFilterActive(e){const{filter:t}=this.cachedFilter(e)??{};return t?t.isFilterActive():this.getModelFromInitialState(e)!=null}getOrCreateFilterWrapper(e){if(!e.isFilterAllowed())return null;let t=this.cachedFilter(e);return t||(t=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,t)),t}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){let t;if(ModuleRegistry.__isRegistered("@ag-grid-enterprise/set-filter",this.gridId))t="agSetColumnFilter";else{const i=this.dataTypeService?.getBaseDataType(e);i==="number"?t="agNumberColumnFilter":i==="date"||i==="dateString"?t="agDateColumnFilter":t="agTextColumnFilter"}return t}getDefaultFloatingFilter(e){let t;if(ModuleRegistry.__isRegistered("@ag-grid-enterprise/set-filter",this.gridId))t="agSetColumnFloatingFilter";else{const i=this.dataTypeService?.getBaseDataType(e);i==="number"?t="agNumberColumnFloatingFilter":i==="date"||i==="dateString"?t="agDateColumnFloatingFilter":t="agTextColumnFloatingFilter"}return t}createFilterInstance(e,t){const i=this.getDefaultFilter(e),s=e.getColDef();let o;const r={...this.createFilterParams(e,s),filterModifiedCallback:()=>this.filterModifiedCallbackFactory(o,e)(),filterChangedCallback:l=>this.filterChangedCallbackFactory(o,e)(l),doesRowPassOtherFilter:l=>this.filterManager?this.filterManager.doesRowPassOtherFilters(o,l):!0},n=this.userComponentFactory.getFilterDetails(s,r,i);return n?{filterPromise:()=>{const l=n.newAgStackInstance();return l?.then(a=>{o=a,t&&(t.filter=a)}),l},compDetails:n}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return this.gos.addGridCommonParams({column:e,colDef:_cloneObject(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),getValue:this.createGetValue(e),doesRowPassOtherFilter:()=>!0})}createFilterWrapper(e){const t={column:e,filterPromise:null,compiledElement:null,compDetails:null},{filterPromise:i,compDetails:s}=this.createFilterInstance(e,t);return t.filterPromise=i?.()??null,t.compDetails=s,t}onColumnsChanged(){const e=[];this.allColumnFilters.forEach((t,i)=>{let s;t.column.isPrimary()?s=this.columnModel.getColDefCol(i):s=this.columnModel.getCol(i),!(s&&s===t.column)&&(e.push(t.column),this.disposeFilterWrapper(t,"columnChanged"),this.disposeColumnListener(i))}),e.length>0?this.filterManager?.onFilterChanged({columns:e,source:"api"}):this.updateDependentFilters()}updateDependentFilters(){this.columnModel.getAutoCols()?.forEach(t=>{t.getColDef().filter==="agGroupColumnFilter"&&this.getOrCreateFilterWrapper(t)})}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const{filter:i}=this.allColumnFilters.get(e.getColId())??{};return i&&typeof i?.isFilterAllowed=="function"?i.isFilterAllowed():!0}getFloatingFilterCompDetails(e,t){const i=a=>{const d=this.getOrCreateFilterWrapper(e)?.filterPromise;d?.then(h=>{a(_unwrapUserComp(h))})},s=e.getColDef(),o={...this.createFilterParams(e,s),filterChangedCallback:()=>i(a=>this.filterChangedCallbackFactory(a,e)())},r=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(s,FilterComponent,o);let n=getDefaultFloatingFilterType(this.frameworkOverrides,s,()=>this.getDefaultFloatingFilter(e));n==null&&(n="agReadOnlyFloatingFilter");const l={column:e,filterParams:r,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:i,showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(s,l,n)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilter(e,t="api"){const i=e.getColId(),s=this.allColumnFilters.get(i);this.disposeColumnListener(i),delete this.initialFilterModel[i],s&&(this.disposeFilterWrapper(s,t),this.filterManager?.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then(i=>{this.destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId());const s={type:"filterDestroyed",source:t,column:e.column};this.eventService.dispatchEvent(s)})}filterModifiedCallbackFactory(e,t){return()=>{const i={type:"filterModified",column:t,filterInstance:e};this.eventService.dispatchEvent(i)}}filterChangedCallbackFactory(e,t){return i=>{const s=i?.source??"columnFilter",o={filter:e,additionalEventAttributes:i,columns:[t],source:s};this.callOnFilterChangedOutsideRenderCycle(o)}}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:s}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};if(this.areFilterCompsDifferent(t.compDetails,s)){this.destroyFilter(i,"paramsUpdated");return}const o=i.getColDef().filterParams;if(!t.filterPromise){this.destroyFilter(i,"paramsUpdated");return}t.filterPromise.then(r=>{(r?.refresh?r.refresh({...this.createFilterParams(i,i.getColDef()),filterModifiedCallback:this.filterModifiedCallbackFactory(r,i),filterChangedCallback:this.filterChangedCallbackFactory(r,i),doesRowPassOtherFilter:l=>this.filterManager?this.filterManager.doesRowPassOtherFilters(r,l):!0,...o}):!0)===!1&&this.destroyFilter(i,"paramsUpdated")})}setColumnFilterWrapper(e,t){const i=e.getColId();this.allColumnFilters.set(i,t),this.allColumnListeners.set(i,this.addManagedListeners(e,{colDefChanged:()=>this.checkDestroyFilter(i)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:s}=t;return!(i===s||i?.render&&s?.render&&i.render===s.render)}hasFloatingFilters(){return this.columnModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e,t){t&&this.getFilterInstanceImpl(e).then(i=>{const s=_unwrapUserComp(i);t(s)})}getColumnFilterInstance(e){return new Promise(t=>{this.getFilterInstanceImpl(e).then(i=>{t(_unwrapUserComp(i))})})}getFilterInstanceImpl(e){const t=this.columnModel.getColDefCol(e);return t?this.getOrCreateFilterWrapper(t)?.filterPromise??AgPromise.resolve(null):AgPromise.resolve(void 0)}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach(({model:e,source:t})=>this.setFilterModel(e,t)),this.filterModelUpdateQueue=[],this.columnFilterModelUpdateQueue.forEach(({key:e,model:t,resolve:i})=>{this.setColumnFilterModel(e,t).then(()=>i())}),this.columnFilterModelUpdateQueue=[]}getColumnFilterModel(e){const t=this.getFilterWrapper(e);return t?this.getModelFromFilterWrapper(t):null}setColumnFilterModel(e,t){if(this.dataTypeService?.isPendingInference()){let r=()=>{};const n=new Promise(l=>{r=l});return this.columnFilterModelUpdateQueue.push({key:e,model:t,resolve:r}),n}const i=this.columnModel.getColDefCol(e),s=i?this.getOrCreateFilterWrapper(i):null;return s?(r=>new Promise(n=>{r.then(l=>n(l))}))(this.setModelOnFilterWrapper(s.filterPromise,t)):Promise.resolve()}getFilterWrapper(e){const t=this.columnModel.getColDefCol(e);return t?this.cachedFilter(t)??null:null}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear()}};function isAnyFilterPresent(e){return!!e.filterManager?.isAnyFilterPresent()}function onFilterChanged(e,t="api"){e.filterManager?.onFilterChanged({source:t})}var ReadOnlyFloatingFilter=class extends Component{constructor(){super(`
|
|
77
77
|
<div class="ag-floating-filter-input" role="presentation">
|
|
78
78
|
<ag-input-text-field data-ref="eFloatingFilterText"></ag-input-text-field>
|
|
79
79
|
</div>`,[AgInputTextFieldSelector]),this.eFloatingFilterText=RefPlaceholder}wireBeans(e){this.columnNameService=e.columnNameService}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnNameService.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}})}onParamsUpdated(e){this.refresh(e)}refresh(e){this.init(e)}},SimpleFloatingFilter=class extends Component{wireBeans(e){this.columnNameService=e.columnNameService}getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return e?.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.getDefaultOption();return}const t=e.operator;let i;t?i=e.conditions[0]:i=e,this.lastType=i.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const i=e;return this.isTypeEditable(i.type)}init(e){this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){this.optionsFactory=new OptionsFactory,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),t||(this.lastType=this.optionsFactory.getDefaultOption()),this.readOnly=!!e.filterParams.readOnly;const i=this.isTypeEditable(this.optionsFactory.getDefaultOption());this.setEditable(i)}onParamsUpdated(e){this.refresh(e)}refresh(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return i==null||i==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){const t=this.columnNameService.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();return`${t} ${i("ariaFilterInput","Filter Input")}`}},DateFloatingFilter=class extends SimpleFloatingFilter{constructor(){super(`
|
|
@@ -96,7 +96,7 @@ For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG
|
|
|
96
96
|
<div data-ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>
|
|
97
97
|
</div>`,e),this.eResize=RefPlaceholder,this.eHeaderCompWrapper=RefPlaceholder,this.headerCompVersion=0,this.column=e.getColumnGroupChild(),this.pinned=e.getPinned()}postConstruct(){const e=this.getGui();((o,r)=>{r!=null&&r!=""?e.setAttribute(o,r):e.removeAttribute(o)})("col-id",this.column.getColId());const i={setWidth:o=>e.style.width=o,addOrRemoveCssClass:(o,r)=>this.addOrRemoveCssClass(o,r),setAriaSort:o=>o?_setAriaSort(e,o):_removeAriaSort(e),setUserCompDetails:o=>this.setUserCompDetails(o),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(i,this.getGui(),this.eResize,this.eHeaderCompWrapper);const s=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",s)}destroy(){this.destroyHeaderComp(),super.destroy()}destroyHeaderComp(){this.headerComp&&(this.eHeaderCompWrapper.removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then(i=>this.afterCompCreated(t,i))}afterCompCreated(e,t){if(e!=this.headerCompVersion||!this.isAlive()){this.destroyBean(t);return}this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())}},HeaderGroupCellComp=class extends AbstractHeaderCellComp{constructor(e){super(`<div class="ag-header-group-cell" role="columnheader">
|
|
98
98
|
<div data-ref="eResize" class="ag-header-cell-resize" role="presentation"></div>
|
|
99
|
-
</div>`,e),this.eResize=RefPlaceholder}postConstruct(){const e=this.getGui(),t=(s,o)=>o!=null?e.setAttribute(s,o):e.removeAttribute(s);e.setAttribute("col-id",this.ctrl.getColId());const i={addOrRemoveCssClass:(s,o)=>this.addOrRemoveCssClass(s,o),setResizableDisplayed:s=>_setDisplayed(this.eResize,s),setWidth:s=>e.style.width=s,setAriaExpanded:s=>t("aria-expanded",s),setUserCompDetails:s=>this.setUserCompDetails(s),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(i,e,this.eResize)}setUserCompDetails(e){e.newAgStackInstance().then(t=>this.afterHeaderCompCreated(t))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive()){t();return}const i=this.getGui(),s=e.getGui();i.appendChild(s),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(i)}},HeaderRowType=(e=>(e.COLUMN_GROUP="group",e.COLUMN="column",e.FLOATING_FILTER="filter",e))(HeaderRowType||{}),HeaderRowComp=class extends Component{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}postConstruct(){_setAriaRowIndex(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:t=>this.getGui().style.height=t,setTop:t=>this.getGui().style.top=t,setHeaderCtrls:(t,i)=>this.setHeaderCtrls(t,i),setWidth:t=>this.getGui().style.width=t};this.ctrl.setComp(e)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach(s=>{const o=s.getInstanceId();let r=i[o];delete i[o],r==null&&(r=this.createHeaderComp(s),this.getGui().appendChild(r.getGui())),this.headerComps[o]=r}),_iterateObject(i,(s,o)=>{this.getGui().removeChild(o.getGui()),this.destroyBean(o)}),t){const s=_getAllValuesInObject(this.headerComps);s.sort((r,n)=>{const l=r.getCtrl().getColumnGroupChild().getLeft(),a=n.getCtrl().getColumnGroupChild().getLeft();return l-a});const o=s.map(r=>r.getGui());_setDomChildOrder(this.getGui(),o)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new HeaderGroupCellComp(e);break;case"filter":t=new HeaderFilterCellComp(e);break;default:t=new HeaderCellComp(e);break}return this.createBean(t),t.setParentComponent(this),t}},HeaderNavigationDirection=(e=>(e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT",e))(HeaderNavigationDirection||{}),HeaderNavigationService=class extends BeanStub{constructor(){super(...arguments),this.beanName="headerNavigationService",this.currentHeaderRowWithoutSpan=-1}wireBeans(e){this.focusService=e.focusService,this.headerPositionUtils=e.headerPositionUtils,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.visibleColService=e.visibleColsService}postConstruct(){this.ctrlsService.whenReady(t=>{this.gridBodyCon=t.gridBodyCtrl});const e=this.gos.getDocument();this.addManagedElementListeners(e,{mousedown:()=>this.setCurrentHeaderRowWithoutSpan(-1)})}getHeaderRowCount(){const e=this.ctrlsService.getHeaderRowContainerCtrl();return e?e.getRowCount():0}getHeaderPositionForColumn(e,t){let i;if(typeof e=="string"?(i=this.columnModel.getCol(e),i||(i=this.visibleColService.getColumnGroup(e))):i=e,!i)return null;const o=this.ctrlsService.getHeaderRowContainerCtrl().getAllCtrls(),r=_last(o).getType()==="filter",n=this.getHeaderRowCount()-1;let l=-1,a=i;for(;a;)l++,a=a.getParent();let d=l;return t&&r&&d===n-1&&d++,d===-1?null:{headerRowIndex:d,column:i}}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:s}=t,o=t.column,r=this.getHeaderRowCount(),n=e===0;let{headerRowIndex:l,column:a,headerRowIndexWithoutSpan:d}=n?this.headerPositionUtils.getColumnVisibleParent(o,s):this.headerPositionUtils.getColumnVisibleChild(o,s),h=!1;return l<0&&(l=0,a=o,h=!0),l>=r?(l=-1,this.setCurrentHeaderRowWithoutSpan(-1)):d!==void 0&&(this.currentHeaderRowWithoutSpan=d),!h&&!a?!1:this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l,column:a},allowUserOverride:!0,event:i})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,i){const s=this.focusService.getFocusedHeader(),o=e===2,r=this.gos.get("enableRtl");let n,l;if(this.currentHeaderRowWithoutSpan!==-1?s.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=s.headerRowIndex,o!==r?(l="Before",n=this.headerPositionUtils.findHeader(s,l)):(l="After",n=this.headerPositionUtils.findHeader(s,l)),n||!t)return this.focusService.focusHeaderPosition({headerPosition:n,direction:l,fromTab:t,allowUserOverride:!0,event:i});if(t){const a=this.gos.getCallback("tabToNextHeader");if(a)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:a,headerPosition:n,direction:l})}return this.focusNextHeaderRow(s,l,i)}focusNextHeaderRow(e,t,i){const s=e.headerRowIndex;let o=null,r;if(t==="Before"?s>0&&(r=s-1,this.currentHeaderRowWithoutSpan-=1,o=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"end")):(r=s+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),o=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"start")),!o)return!1;const{column:n,headerRowIndex:l}=this.headerPositionUtils.getHeaderIndexToFocus(o.column,o?.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:n,headerRowIndex:l},direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(isColumnGroup(e)){const s=e.getDisplayedLeafColumns();i=t==="Before"?_last(s):s[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}},GridHeaderCtrl=class extends BeanStub{wireBeans(e){this.headerNavigationService=e.headerNavigationService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService,this.filterManager=e.filterManager,this.menuService=e.menuService}setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new ManagedFocusFeature(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),this.onPivotModeChanged(),this.setupHeaderHeight();const s=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:s}),this.mockContextMenuForIPad(s),this.ctrlsService.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("pivotHeaderHeight",e),this.addManagedPropertyListener("groupHeaderHeight",e),this.addManagedPropertyListener("pivotGroupHeaderHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addManagedEventListeners({displayedColumnsChanged:e,columnHeaderHeightChanged:e,gridStylesChanged:e,advancedFilterEnabledChanged:e})}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:e}=this;let t=0,i=e.getHeaderRowCount(),s;this.filterManager?.hasFloatingFilters()&&(i++,t=1);const r=this.columnModel.getColumnGroupHeaderRowHeight(),n=this.columnModel.getColumnHeaderRowHeight(),l=1+t,a=i-l;if(s=t*e.getFloatingFiltersHeight(),s+=a*r,s+=n,this.headerHeight===s)return;this.headerHeight=s;const d=`${s+1}px`;this.comp.setHeightAndMinHeight(d),this.eventService.dispatchEvent({type:"headerHeightChanged"})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const t=this.visibleColsService.getAllCols().some(i=>i.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",t)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),i=e.shiftKey!==t?2:3;(this.headerNavigationService.navigateHorizontally(i,!0,e)||this.focusService.focusNextGridCoreContainer(e.shiftKey))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case KeyCode.LEFT:t=2;case KeyCode.RIGHT:{_exists(t)||(t=3),this.headerNavigationService.navigateHorizontally(t,!1,e);break}case KeyCode.UP:t=0;case KeyCode.DOWN:{_exists(t)||(t=1),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break}default:return}}onFocusOut(e){const{relatedTarget:t}=e;!t&&this.eGui.contains(this.gos.getActiveDomElement())||this.eGui.contains(t)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,i){if(!e&&!i||!this.menuService.isHeaderContextMenuEnabled())return;const{target:s}=e??t;(s===this.eGui||s===this.ctrlsService.getHeaderRowContainerCtrl().getViewport())&&this.menuService.showHeaderContextMenu(void 0,e,i)}mockContextMenuForIPad(e){if(!_isIOSUserAgent())return;const t=new TouchListener(this.eGui),i=s=>{e(void 0,s.touchStart,s.touchEvent)};this.addManagedListeners(t,{longTap:i}),this.addDestroyFunc(()=>t.destroy())}},CenterWidthFeature=class extends BeanStub{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}wireBeans(e){this.visibleColsService=e.visibleColsService,this.scrollVisibleService=e.scrollVisibleService}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedEventListeners({columnContainerWidthChanged:e,displayedColumnsChanged:e,leftPinnedWidthChanged:e}),this.addSpacer&&this.addManagedEventListeners({rightPinnedWidthChanged:e,scrollVisibilityChanged:e,scrollbarWidthChanged:e}),this.setWidth()}setWidth(){const e=this.gos.isDomLayout("print"),t=this.visibleColsService.getBodyContainerWidth(),i=this.visibleColsService.getColsLeftWidth(),s=this.visibleColsService.getDisplayedColumnsRightWidth();let o;e?o=t+i+s:(o=t,this.addSpacer&&(this.gos.get("enableRtl")?i:s)===0&&this.scrollVisibleService.isVerticalScrollShowing()&&(o+=this.gos.getScrollbarWidth())),this.callback(o)}},BodyDropPivotTarget=class extends BeanStub{constructor(e){super(),this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}wireBeans(e){this.funcColsService=e.funcColsService}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach(i=>{i.isPrimary()&&(i.isAnyFunctionActive()||(i.isAllowValue()?this.columnsToAggregate.push(i):i.isAllowRowGroup()?this.columnsToGroup.push(i):i.isAllowPivot()&&this.columnsToPivot.push(i)))})}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?"pinned":"move":null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.funcColsService.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.funcColsService.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.funcColsService.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}};function attemptMoveColumns(e){const{isFromHeader:t,hDirection:i,xPosition:s,fromEnter:o,fakeEvent:r,pinned:n,gos:l,columnModel:a,columnMoveService:d,presentedColsService:h}=e,c=i===0,u=i===1;let{allMovingColumns:g}=e;if(t){const S=[];g.forEach(R=>{let P=null,b=R.getParent();for(;b!=null&&b.getDisplayedLeafColumns().length===1;)P=b,b=b.getParent();P!=null?(!!P.getColGroupDef()?.marryChildren?P.getProvidedColumnGroup().getLeafColumns():P.getLeafColumns()).forEach(G=>{S.includes(G)||S.push(G)}):S.includes(R)||S.push(R)}),g=S}const p=g.slice();a.sortColsLikeCols(p);const m=calculateValidMoves({movingCols:p,draggingRight:u,xPosition:s,pinned:n,gos:l,columnModel:a,presentedColsService:h}),f=calculateOldIndex(p,a);if(m.length===0)return;const v=m[0];let C=f!==null&&!o;if(t&&(C=f!==null),C&&!r&&(c&&v>=f||u&&v<=f))return;const w=h.getAllCols(),y=[];let F=null;for(let S=0;S<m.length;S++){const R=m[S],P=d.getProposedColumnOrder(p,R);if(!d.doesOrderPassRules(P))continue;const b=P.filter(M=>w.includes(M));if(F===null)F=b;else if(!_areEqual(b,F))break;const x=groupFragCount(P);y.push({move:R,fragCount:x})}if(y.length!==0)return y.sort((S,R)=>S.fragCount-R.fragCount),moveColumns(g,y[0].move,"uiColumnMoved",!1,d)}function moveColumns(e,t,i,s,o){return o.moveColumns(e,t,i,s),s?null:{columns:e,toIndex:t}}function calculateOldIndex(e,t){const i=t.getCols(),s=_sortNumerically(e.map(a=>i.indexOf(a))),o=s[0];return _last(s)-o!==s.length-1?null:o}function groupFragCount(e){function t(s){const o=[];let r=s.getOriginalParent();for(;r!=null;)o.push(r),r=r.getOriginalParent();return o}let i=0;for(let s=0;s<e.length-1;s++){let o=t(e[s]),r=t(e[s+1]);[o,r]=o.length>r.length?[o,r]:[r,o],o.forEach(n=>{r.indexOf(n)===-1&&i++})}return i}function getDisplayedColumns(e,t){switch(t){case"left":return e.getLeftCols();case"right":return e.getRightCols();default:return e.getCenterCols()}}function calculateValidMoves(e){const{movingCols:t,draggingRight:i,xPosition:s,pinned:o,gos:r,columnModel:n,presentedColsService:l}=e;if(r.get("suppressMovableColumns")||t.some(w=>w.getColDef().suppressMovable))return[];const d=getDisplayedColumns(l,o),h=n.getCols(),c=d.filter(w=>_includes(t,w)),u=d.filter(w=>!_includes(t,w)),g=h.filter(w=>!_includes(t,w));let p=0,m=s;if(i){let w=0;c.forEach(y=>w+=y.getActualWidth()),m-=w}if(m>0){for(let w=0;w<u.length;w++){const y=u[w];if(m-=y.getActualWidth(),m<0)break;p++}i&&p++}let f;if(p>0){const w=u[p-1];f=g.indexOf(w)+1}else f=g.indexOf(u[0]),f===-1&&(f=0);const v=[f],C=(w,y)=>w-y;if(i){let w=f+1;const y=h.length-1;for(;w<=y;)v.push(w),w++;v.sort(C)}else{let w=f;const y=h.length-1;let F=h[w];for(;w<=y&&d.indexOf(F)<0;)w++,v.push(w),F=h[w];w=f-1;const S=0;for(;w>=S;)v.push(w),w--;v.sort(C).reverse()}return v}function normaliseX(e,t,i,s,o){const r=o.getHeaderRowContainerCtrl(t).getViewport();return i&&(e-=r.getBoundingClientRect().left),s.get("enableRtl")&&(e=r.clientWidth-e),t==null&&(e+=o.get("center").getCenterViewportScrollLeft()),e}var MoveColumnFeature=class extends BeanStub{constructor(e){super(),this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.isCenterContainer=!_exists(e)}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnMoveService=e.columnMoveService,this.dragAndDropService=e.dragAndDropService,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){return this.pinned?"pinned":"move"}onDragEnter(e){const t=e.dragItem.columns;if(e.dragSource.type===0)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const s=e.dragItem.visibleState,o=(t||[]).filter(r=>s[r.getId()]);this.setColumnsVisible(o,!0,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged"),this.onDragging(e,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i){if(e){const s=e.filter(o=>!o.getColDef().lockVisible);this.columnModel.setColsVisible(s,t,i)}}setColumnsPinned(e,t,i){if(e){const s=e.filter(o=>!o.getColDef().lockPinned);this.columnModel.setColsPinned(s,t,i)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}checkCenterForScrolling(e){if(this.isCenterContainer){const t=this.ctrlsService.get("center"),i=t.getCenterViewportScrollLeft(),s=i+t.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=e<i+50,this.needToMoveLeft=e>s-50):(this.needToMoveLeft=e<i+50,this.needToMoveRight=e>s-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,s=!1){if(s){if(this.lastMovedInfo){const{columns:d,toIndex:h}=this.lastMovedInfo;moveColumns(d,h,"uiColumnMoved",!0,this.columnMoveService)}return}if(this.lastDraggingEvent=e,_missing(e.hDirection))return;const o=normaliseX(e.x,this.pinned,!1,this.gos,this.ctrlsService);t||this.checkCenterForScrolling(o);const r=this.normaliseDirection(e.hDirection),n=e.dragSource.type,l=e.dragSource.getDragItem().columns?.filter(d=>d.getColDef().lockPinned?d.getPinned()==this.pinned:!0)||[],a=attemptMoveColumns({allMovingColumns:l,isFromHeader:n===1,hDirection:r,xPosition:o,pinned:this.pinned,fromEnter:t,fakeEvent:i,gos:this.gos,columnModel:this.columnModel,columnMoveService:this.columnMoveService,presentedColsService:this.visibleColsService});a&&(this.lastMovedInfo=a)}normaliseDirection(e){if(this.gos.get("enableRtl"))switch(e){case 0:return 1;case 1:return 0;default:_errorOnce(`Unknown direction ${e}`)}else return e}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.dragAndDropService.setGhostIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon("move"))}moveInterval(){let e;this.intervalCount++,e=10+this.intervalCount*5,e>100&&(e=100);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),t!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const o=this.lastDraggingEvent.dragItem.columns.filter(r=>!r.getColDef().lockPinned);if(o.length>0&&(this.dragAndDropService.setGhostIcon("pinned"),this.failedMoveAttempts>7)){const r=this.needToMoveLeft?"left":"right";this.setColumnsPinned(o,r,"uiColumnDragged"),this.dragAndDropService.nudge()}}}},BodyDropTarget=class extends BeanStub{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.columnModel=e.columnModel,this.ctrlsService=e.ctrlsService}constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady(e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.left.getContainerElement()],[e.bottomLeft.getContainerElement()],[e.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.right.getContainerElement()],[e.bottomRight.getContainerElement()],[e.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.center.getViewportElement()],[e.bottomCenter.getViewportElement()],[e.topCenter.getViewportElement()]];break}}),this.moveColumnFeature=this.createManagedBean(new MoveColumnFeature(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new BodyDropPivotTarget(this.pinned)),this.dragAndDropService.addDropTarget(this)}isInterestedIn(e){return e===1||e===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&e.dragSource.type===0}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}},ResizeFeature=class extends BeanStub{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.pinnedWidthService=e.pinnedWidthService,this.ctrlsService=e.ctrlsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,i,s,o){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=s,this.ctrl=o}postConstruct(){const e=[];let t,i;const s=()=>{if(_setDisplayed(this.eResize,t),!t)return;const n=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(n),i){const l=this.gos.get("skipHeaderOnAutoSize"),a=()=>{this.columnAutosizeService.autoSizeColumn(this.column,"uiColumnResized",l)};this.eResize.addEventListener("dblclick",a);const d=new TouchListener(this.eResize);d.addEventListener("doubleTap",a),e.push(()=>{this.eResize.removeEventListener("dblclick",a),d.removeEventListener("doubleTap",a),d.destroy()})}},o=()=>{e.forEach(n=>n()),e.length=0},r=()=>{const n=this.column.isResizable(),l=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(n!==t||l!==i)&&(t=n,i=l,o(),s())};r(),this.addDestroyFunc(o),this.ctrl.addRefreshFunction(r)}onResizing(e,t){const{column:i,lastResizeAmount:s,resizeStartWidth:o}=this,r=this.normaliseResizeAmount(t),n=o+r,l=[{key:i,newWidth:n}];if(this.column.getPinned()){const a=this.pinnedWidthService.getPinnedLeftWidth(),d=this.pinnedWidthService.getPinnedRightWidth(),h=_getInnerWidth(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(a+d+(r-s)>h)return}this.lastResizeAmount=r,this.columnSizeService.setColumnWidths(l,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const i=this.pinned!=="left",s=this.pinned==="right";return this.gos.get("enableRtl")?i&&(t*=-1):s&&(t*=-1),t}},SelectAllFeature=class extends BeanStub{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(this.gos.getActiveDomElement())&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new AgCheckbox),this.cbSelectAll.addCssClass("ag-header-select-all"),_setAriaRole(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedEventListeners({newColumnsLoaded:this.onNewColumnsLoaded.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:this.onSelectionChanged.bind(this),paginationChanged:this.onSelectionChanged.bind(this),modelUpdated:this.onModelChanged.bind(this)}),this.addManagedListeners(this.cbSelectAll,{fieldValueChanged:this.onCbSelectAll.bind(this)}),_setAriaHidden(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),i=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),s=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${s} (${i})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${s} (${i})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return this.gos.get("rowSelection")==="multiple"?!0:(_warnOnce(`${e} is only available if using 'multiple' rowSelection.`),!1)}checkRightRowModelType(e){const t=this.rowModel.getType();return t==="clientSide"||t==="serverSide"?!0:(_warnOnce(`${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox||!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),i=this.isCurrentPageOnly();let s="uiSelectAll";i?s="uiSelectAllCurrentPage":t&&(s="uiSelectAllFiltered");const o={source:s,justFiltered:t,justCurrentPage:i};e?this.selectionService.selectAllRowNodes(o):this.selectionService.deselectAllRowNodes(o)}isCheckboxSelection(){let e=this.column.getColDef().headerCheckboxSelection;if(typeof e=="function"){const t=e,i=this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()});e=t(i)}return e?this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection"):!1}isFilteredOnly(){return!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){return!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}},HeaderCellCtrl=class extends AbstractHeaderCellCtrl{constructor(e,t,i){super(e,t,i),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,s){this.comp=e,this.setGui(t),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(s),this.addColumnHoverListener(),this.setupFilterClass(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.resizeFeature=this.createManagedBean(new ResizeFeature(this.getPinned(),this.column,i,e,this)),this.createManagedBean(new HoverFeature([this.column],t)),this.createManagedBean(new SetLeftFeature(this.column,t,this.beans)),this.createManagedBean(new ManagedFocusFeature(t,{shouldStopEventPropagation:o=>this.shouldStopEventPropagation(o),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(),this.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader"],this.refresh.bind(this)),this.addManagedListeners(this.column,{colDefChanged:this.refresh.bind(this)}),this.addManagedEventListeners({columnValueChanged:this.onColumnValueChanged.bind(this),columnRowGroupChanged:this.onColumnRowGroupChanged.bind(this),columnPivotChanged:this.onColumnPivotChanged.bind(this),headerHeightChanged:this.onHeaderHeightChanged.bind(this)})}resizeHeader(e,t){if(!this.column.isResizable())return;const i=this.column.getActualWidth(),s=this.column.getMinWidth(),o=this.column.getMaxWidth(),r=Math.min(Math.max(i+e,s),o);this.beans.columnSizeService.setColumnWidths([{key:this.column,newWidth:r}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,column:i,gos:s,ctrlsService:o}=this,r=this.getPinned(),n=t.getBoundingClientRect().left,l=i.getActualWidth(),a=s.get("enableRtl"),h=normaliseX(e===0!==a?n-20:n+l+20,r,!0,s,o);attemptMoveColumns({allMovingColumns:[i],isFromHeader:!0,hDirection:e,xPosition:h,pinned:r,fromEnter:!1,fakeEvent:!1,gos:s,columnModel:this.beans.columnModel,columnMoveService:this.beans.columnMoveService,presentedColsService:this.beans.visibleColsService}),o.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(i,"auto")}setupUserComp(){const e=this.lookupUserCompDetails();this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(t,e)}createParams(){return this.gos.addGridCommonParams({column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&this.menuService.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!this.openFilterEnabled||this.menuService.isLegacyMenuEnabled(),showColumnMenu:t=>{this.menuService.showColumnMenu({column:this.column,buttonElement:t,positionBy:"button"})},showColumnMenuAfterMouseClick:t=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:t,positionBy:"mouse"})},showFilter:t=>{this.menuService.showFilterMenu({column:this.column,buttonElement:t,containerType:"columnFilter",positionBy:"button"})},progressSort:t=>{this.beans.sortController.progressSort(this.column,!!t,"uiColumnSorted")},setSort:(t,i)=>{this.beans.sortController.setSortForColumn(this.column,t,!!i,"uiColumnSorted")},eGridHeader:this.getGui(),setTooltip:(t,i)=>{this.setupTooltip(t,i)}})}setupSelectAll(){this.selectAllFeature=this.createManagedBean(new SelectAllFeature(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===KeyCode.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===KeyCode.ENTER&&this.onEnterKeyDown(e),e.key===KeyCode.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){if(e.ctrlKey||e.metaKey)this.showMenuOnKeyPress(e,!0);else if(this.sortable){const t=e.shiftKey;this.beans.sortController.progressSort(this.column,t,"uiColumnSorted")}}showMenuOnKeyPress(e,t){const i=this.comp.getUserCompInstance();!i||!(i instanceof HeaderComp)||i.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const t=this.getRowIndex();this.focusService.setFocusedHeader(t,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i=this.gos.get("tooltipShowMode")==="whenTruncated",s=this.eGui,o=this.column.getColDef();!t&&i&&!o.headerComponent&&(t=()=>{const l=s.querySelector(".ag-header-cell-text");return l?l.scrollWidth>l.clientWidth:!0});const r={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>s,getLocation:()=>"header",getTooltipValue:()=>e??this.column.getColDef().headerTooltip,shouldDisplayTooltip:t},n=this.createManagedBean(new TooltipFeature(r));this.refreshFunctions.push(()=>n.refreshToolTip())}setupClassesFromColDef(){const e=()=>{const t=this.column.getColDef(),i=_getHeaderClassesFromColDef(t,this.gos,this.column,null),s=this.userHeaderClasses;this.userHeaderClasses=new Set(i),i.forEach(o=>{s.has(o)?s.delete(o):this.comp.addOrRemoveCssClass(o,!0)}),s.forEach(o=>this.comp.addOrRemoveCssClass(o,!1))};this.refreshFunctions.push(e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:i,displayName:s,dragAndDropService:o,gos:r}=this,{columnModel:n}=i;let l=!this.gos.get("suppressDragLeaveHidesColumns");const a=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>l?"hide":"notAllowed",getDragItem:()=>this.createDragItem(t),dragItemName:s,onDragStarted:()=>{l=!r.get("suppressDragLeaveHidesColumns"),t.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>t.setMoving(!1,"uiColumnMoved"),onGridEnter:d=>{if(l){const h=d?.columns?.filter(c=>!c.getColDef().lockVisible)||[];n.setColsVisible(h,!0,"uiColumnMoved")}},onGridExit:d=>{if(l){const h=d?.columns?.filter(c=>!c.getColDef().lockVisible)||[];n.setColsVisible(h,!1,"uiColumnMoved")}}};o.addDragSource(a,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}addRefreshFunction(e){this.refreshFunctions.push(e)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach(e=>e())}refreshHeaderComp(){const e=this.lookupUserCompDetails();(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==e.componentClass?this.attemptHeaderCompRefresh(e.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!t||!t.refresh?!1:t.refresh(e)}calculateDisplayName(){return this.beans.columnNameService.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!!(!this.gos.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const e=()=>{const t=this.column.getActualWidth();this.comp.setWidth(`${t}px`)};this.addManagedListeners(this.column,{widthChanged:e}),e()}setupMovingCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListeners(this.column,{movingChanged:e}),e()}setupMenuClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListeners(this.column,{menuVisibleChanged:e}),e()}setupSortableClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};e(),this.addRefreshFunction(e),this.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(){const e=()=>{const t=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",t),this.refreshAria()};this.addManagedListeners(this.column,{filterActiveChanged:e}),e()}setupWrapTextClass(){const e=()=>{const t=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",t)};e(),this.addRefreshFunction(e)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,beans:s}=this;if(!t.isSpanHeaderHeight()){e.style.removeProperty("top"),e.style.removeProperty("height"),i.addOrRemoveCssClass("ag-header-span-height",!1),i.addOrRemoveCssClass("ag-header-span-total",!1);return}const{numberOfParents:o,isSpanningTotal:r}=this.column.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",o>0);const{columnModel:n}=s,l=n.getColumnHeaderRowHeight();if(o===0){i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),e.style.setProperty("height",`${l}px`);return}i.addOrRemoveCssClass("ag-header-span-total",r);const d=n.isPivotMode()?n.getPivotGroupHeaderHeight():n.getGroupHeaderHeight(),h=o*d;e.style.setProperty("top",`${-h}px`),e.style.setProperty("height",`${l+h}px`)}setupAutoHeight(e){const{columnModel:t,resizeObserverService:i}=this.beans,s=d=>{if(!this.isAlive())return;const{paddingTop:h,paddingBottom:c,borderBottomWidth:u,borderTopWidth:g}=_getElementSize(this.getGui()),p=h+c+u+g,f=e.offsetHeight+p;if(d<5){const v=this.beans.gos.getDocument(),C=!v||!v.contains(e),w=f==0;if(C||w){window.setTimeout(()=>s(d+1),0);return}}t.setColHeaderHeight(this.column,f)};let o=!1,r;const n=()=>{const d=this.column.isAutoHeaderHeight();d&&!o&&l(),!d&&o&&a()},l=()=>{o=!0,s(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),r=i.observeResize(e,()=>s(0))},a=()=>{o=!1,r&&r(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),r=void 0};n(),this.addDestroyFunc(()=>a()),this.addManagedListeners(this.column,{widthChanged:()=>o&&s(0)}),this.addManagedEventListeners({sortChanged:()=>{o&&window.setTimeout(()=>s(0))}}),this.addRefreshFunction(n)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(_getAriaSortState(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){t!=null?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){if(!this.eGui.contains(this.beans.gos.getActiveDomElement()))return;const e=Array.from(this.ariaDescriptionProperties.keys()).sort((t,i)=>t==="filter"?-1:i.charCodeAt(0)-t.charCodeAt(0)).map(t=>this.ariaDescriptionProperties.get(t)).join(". ");this.beans.ariaAnnouncementService.announceValue(e)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(){const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const t=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",t)};this.addManagedEventListeners({columnHoverChanged:e}),e()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const e=s=>this.handleMouseOverChange(s.type==="mouseenter"),t=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column),i=s=>this.handleContextMenuMouseEvent(s,void 0,this.column);this.addManagedListeners(this.getGui(),{mouseenter:e,mouseleave:e,click:t,contextmenu:i})}handleMouseOverChange(e){this.setActiveHeader(e);const i={type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column};this.eventService.dispatchEvent(i)}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return t instanceof HeaderComp?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy(),this.refreshFunctions=null,this.selectAllFeature=null,this.dragSourceElement=null,this.userCompDetails=null,this.userHeaderClasses=null,this.ariaDescriptionProperties=null}},GroupResizeFeature=class extends BeanStub{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.autoWidthCalculator=e.autoWidthCalculator,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,i,s){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gos.get("suppressAutoSize")){const t=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const i=[];this.columnGroup.getDisplayedLeafColumns().forEach(o=>{o.getColDef().suppressAutoSize||i.push(o.getColId())}),i.length>0&&this.columnAutosizeService.autoSizeCols({colKeys:i,skipHeader:t,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,i="uiColumnResized"){const s=this.normaliseDragChange(t),o=this.resizeStartWidth+s;this.resizeColumnsFromLocalValues(o,i,e)}getInitialValues(e){const t=this.getColumnsToResize(),i=this.getInitialSizeOfColumns(t),s=this.getSizeRatiosOfColumns(t,i),o={columnsToResize:t,resizeStartWidth:i,resizeRatios:s};let r=null;if(e&&(r=this.visibleColsService.getGroupAtDirection(this.columnGroup,"After")),r){const n=r.getDisplayedLeafColumns(),l=o.groupAfterColumns=n.filter(d=>d.isResizable()),a=o.groupAfterStartWidth=this.getInitialSizeOfColumns(l);o.groupAfterRatios=this.getSizeRatiosOfColumns(l,a)}else o.groupAfterColumns=void 0,o.groupAfterStartWidth=void 0,o.groupAfterRatios=void 0;return o}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:i,resizeRatios:s,groupAfterColumns:o,groupAfterStartWidth:r,groupAfterRatios:n}=e;this.resizeCols=t,this.resizeStartWidth=i,this.resizeRatios=s,this.resizeTakeFromCols=o,this.resizeTakeFromStartWidth=r,this.resizeTakeFromRatios=n}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),i=this.getInitialValues();t>i.resizeStartWidth&&this.resizeColumns(i,t,e,!0)}resizeColumnsFromLocalValues(e,t,i=!0){if(!this.resizeCols||!this.resizeRatios)return;const s={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols??void 0,groupAfterStartWidth:this.resizeTakeFromStartWidth??void 0,groupAfterRatios:this.resizeTakeFromRatios??void 0};this.resizeColumns(s,e,t,i)}resizeColumns(e,t,i,s=!0){const{columnsToResize:o,resizeStartWidth:r,resizeRatios:n,groupAfterColumns:l,groupAfterStartWidth:a,groupAfterRatios:d}=e,h=[];if(h.push({columns:o,ratios:n,width:t}),l){const c=t-r;h.push({columns:l,ratios:d,width:a-c})}this.columnSizeService.resizeColumnSets({resizeSets:h,finished:s,source:i}),s&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(t=>t.isResizable())}getInitialSizeOfColumns(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}getSizeRatiosOfColumns(e,t){return e.map(i=>i.getActualWidth()/t)}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?this.pinned!=="left"&&(t*=-1):this.pinned==="right"&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}},GroupWidthFeature=class extends BeanStub{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(e=>e()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",e===0)}},HeaderGroupCellCtrl=class extends AbstractHeaderCellCtrl{constructor(e,t,i){super(e,t,i),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const s=this.getGui();this.setDragSource(s)}},this.column=e}setComp(e,t,i){this.comp=e,this.setGui(t),this.displayName=this.beans.columnNameService.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.addDestroyFunc(()=>{this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature))}),this.setupUserComp(),this.addHeaderMouseListeners();const s=this.getParentRowCtrl().getPinned(),o=this.column.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new HoverFeature(o,t)),this.createManagedBean(new SetLeftFeature(this.column,t,this.beans)),this.createManagedBean(new GroupWidthFeature(e,this.column)),this.resizeFeature=this.createManagedBean(new GroupResizeFeature(e,i,s,this.column)),this.createManagedBean(new ManagedFocusFeature(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners()}resizeHeader(e,t){if(!this.resizeFeature)return;const i=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:i,column:s,gos:o,ctrlsService:r}=this,n=o.get("enableRtl"),l=e===0,a=this.getPinned(),d=i.getBoundingClientRect(),h=d.left,c=d.width,u=normaliseX(l!==n?h-20:h+c+20,a,!0,o,r),g=s.getGroupId(),p=this.focusService.getFocusedHeader();attemptMoveColumns({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:e,xPosition:u,pinned:a,fromEnter:!1,fakeEvent:!1,gos:o,columnModel:t.columnModel,columnMoveService:t.columnMoveService,presentedColsService:t.visibleColsService});const m=s.getDisplayedLeafColumns(),f=l?m[0]:_last(m);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(f,"auto"),!this.isAlive()&&p&&this.restoreFocus(g,s,p)}restoreFocus(e,t,i){const s=t.getLeafColumns();if(!s.length)return;const o=s[0].getParent();if(!o)return;const r=this.findGroupWidthId(o,e);r&&this.focusService.focusHeaderPosition({headerPosition:{...i,column:r}})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(){const e=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:i=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),i,"gridInitializing")},setTooltip:(i,s)=>{this.setupTooltip(i,s)}}),t=this.userComponentFactory.getHeaderGroupCompDetails(e);this.comp.setUserCompDetails(t)}addHeaderMouseListeners(){const e=s=>this.handleMouseOverChange(s.type==="mouseenter"),t=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column.getProvidedColumnGroup()),i=s=>this.handleContextMenuMouseEvent(s,void 0,this.column.getProvidedColumnGroup());this.addManagedListeners(this.getGui(),{mouseenter:e,mouseleave:e,click:t,contextmenu:i})}handleMouseOverChange(e){const i={type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()};this.eventService.dispatchEvent(i)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i=this.column.getColGroupDef(),s=this.gos.get("tooltipShowMode")==="whenTruncated",o=this.eGui;!t&&s&&!i?.headerGroupComponent&&(t=()=>{const n=o.querySelector(".ag-header-group-text");return n?n.scrollWidth>n.clientWidth:!0});const r={getColumn:()=>this.column,getGui:()=>o,getLocation:()=>"headerGroup",getTooltipValue:()=>e??(i&&i.headerTooltip),shouldDisplayTooltip:t};i&&(r.getColDef=()=>i),this.createManagedBean(new TooltipFeature(r))}setupExpandable(){const e=this.column.getProvidedColumnGroup();this.refreshExpanded();const t=this.refreshExpanded.bind(this);this.addManagedListeners(e,{expandedChanged:t,expandableChanged:t})}refreshExpanded(){const{column:e}=this;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const e=this.column.getColGroupDef(),t=_getHeaderClassesFromColDef(e,this.gos,null,this.column);this.column.isPadding()?(t.push("ag-header-group-cell-no-group"),this.column.getLeafColumns().every(s=>s.isSpanHeaderHeight())&&t.push("ag-header-span-height")):t.push("ag-header-group-cell-with-group"),t.forEach(i=>this.comp.addOrRemoveCssClass(i,!0))}setupMovingCss(){const t=this.column.getProvidedColumnGroup().getLeafColumns(),i=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());t.forEach(s=>{this.addManagedListeners(s,{movingChanged:i})}),i()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const t=this.getRowIndex();this.beans.focusService.setFocusedHeader(t,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(!(!this.expandable||!t)&&e.key===KeyCode.ENTER){const i=this.column,s=!i.isExpanded();this.beans.columnModel.setColumnGroupOpened(i.getProvidedColumnGroup(),s,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving()||(this.removeDragSource(),!e))return;const{beans:t,column:i,displayName:s,gos:o,dragAndDropService:r}=this,{columnModel:n}=t,l=i.getProvidedColumnGroup().getLeafColumns();let a=!o.get("suppressDragLeaveHidesColumns");const d=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>a?"hide":"notAllowed",dragItemName:s,getDragItem:()=>this.getDragItemForGroup(i),onDragStarted:()=>{a=!o.get("suppressDragLeaveHidesColumns"),l.forEach(h=>h.setMoving(!0,"uiColumnDragged"))},onDragStopped:()=>l.forEach(h=>h.setMoving(!1,"uiColumnDragged")),onGridEnter:h=>{if(a){const c=h?.columns?.filter(u=>!u.getColDef().lockVisible)||[];n.setColsVisible(c,!0,"uiColumnMoved")}},onGridExit:h=>{if(a){const c=h?.columns?.filter(u=>!u.getColDef().lockVisible)||[];n.setColsVisible(c,!1,"uiColumnMoved")}}};r.addDragSource(d,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),i={};t.forEach(o=>i[o.getId()]=o.isVisible());const s=[];return this.beans.visibleColsService.getAllCols().forEach(o=>{t.indexOf(o)>=0&&(s.push(o),_removeFromArray(t,o))}),t.forEach(o=>s.push(o)),{columns:s,visibleState:i}}isSuppressMoving(){let e=!1;return this.column.getLeafColumns().forEach(i=>{(i.getColDef().suppressMovable||i.getColDef().lockPosition)&&(e=!0)}),e||this.gos.get("suppressMovableColumns")}},instanceIdSequence3=0,HeaderRowCtrl=class extends BeanStub{constructor(e,t,i){super(),this.instanceId=instanceIdSequence3++,this.rowIndex=e,this.pinned=t,this.type=i;const s=i=="group"?"ag-header-row-column-group":i=="filter"?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${s}`}wireBeans(e){this.beans=e}postConstruct(){this.isPrintLayout=this.gos.isDomLayout("print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}getInstanceId(){return this.instanceId}areCellsRendered(){return this.comp?this.getHeaderCellCtrls().every(e=>e.getGui()!=null):!1}setComp(e,t=!0){this.comp=e,t&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(){const e=this.onRowHeightChanged.bind(this);this.addManagedEventListeners({columnResized:this.onColumnResized.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:t=>this.onVirtualColumnsChanged(t.afterScroll),columnHeaderHeightChanged:e,gridStylesChanged:e,advancedFilterEnabledChanged:e}),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",t=>this.isEnsureDomOrder=t.currentValue),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e)}getHeaderCellCtrl(e){if(this.headerCellCtrls)return _values(this.headerCellCtrls).find(t=>t.getColumnGroupChild()===e)}onDisplayedColumnsChanged(){this.isPrintLayout=this.gos.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleColsService:e}=this.beans;return this.isPrintLayout?this.pinned!=null?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{columnModel:e,filterManager:t}=this.beans;let i=e.getHeaderRowCount();const s=[];let o=0;t?.hasFloatingFilters()&&(i++,o=1);const r=e.getColumnGroupHeaderRowHeight(),n=e.getColumnHeaderRowHeight(),l=1+o,a=i-l;for(let c=0;c<a;c++)s.push(r);s.push(n);for(let c=0;c<o;c++)s.push(e.getFloatingFiltersHeight());let d=0;for(let c=0;c<this.rowIndex;c++)d+=s[c];const h=s[this.rowIndex];return{topOffset:d,rowHeight:h}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),i=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,i,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const s of t)this.recycleAndCreateHeaderCtrls(s,e);const i=s=>{const{focusService:o,visibleColsService:r}=this.beans;return o.isHeaderWrapperFocused(s)?r.isVisible(s.getColumnGroupChild()):!1};if(e)for(const[s,o]of e)i(o)?this.headerCellCtrls.set(s,o):this.destroyBean(o);return this.getHeaderCellCtrls()}getHeaderCellCtrls(){return Array.from(this.headerCellCtrls?.values()??[])}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls||e.isEmptyGroup())return;const i=e.getUniqueId();let s;if(t&&(s=t.get(i),t.delete(i)),s&&s.getColumnGroupChild()!=e&&(this.destroyBean(s),s=void 0),s==null)switch(this.type){case"filter":{s=this.createBean(this.beans.ctrlsFactory.getInstance("headerFilterCell",e,this.beans,this));break}case"group":s=this.createBean(new HeaderGroupCellCtrl(e,this.beans,this));break;default:s=this.createBean(new HeaderCellCtrl(e,this.beans,this));break}this.headerCellCtrls.set(i,s)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(this.pinned!=null)return[];let e=[];const t=this.getActualDepth(),{columnViewportService:i}=this.beans;return["left",null,"right"].forEach(s=>{const o=i.getHeadersToRender(s,t);e=e.concat(o)}),e}getActualDepth(){return this.type=="filter"?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnViewportService.getHeadersToRender(this.pinned,this.getActualDepth())}findHeaderCellCtrl(e){return this.headerCellCtrls?this.getHeaderCellCtrls().find(s=>s.getColumnGroupChild()==e):void 0}focusHeader(e,t){const i=this.findHeaderCellCtrl(e);return i?i.focus(t):!1}destroy(){this.headerCellCtrls&&this.headerCellCtrls.forEach(e=>{this.destroyBean(e)}),this.headerCellCtrls=void 0,super.destroy()}},HeaderRowContainerCtrl=class extends BeanStub{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}wireBeans(e){this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.focusService=e.focusService,this.filterManager=e.filterManager}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport);const i=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),displayedColumnsChanged:i,advancedFilterEnabledChanged:i}),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}refresh(e=!1){const t=new NumberSequence,i=this.focusService.getFocusHeaderToUseAfterRefresh(),s=()=>{const l=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let a=0;a<l;a++){const d=this.createBean(new HeaderRowCtrl(t.next(),this.pinned,"group"));this.groupsRowCtrls.push(d)}},o=()=>{const l=t.next(),a=!this.hidden&&(this.columnsRowCtrl==null||!e||this.columnsRowCtrl.getRowIndex()!==l);(a||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),a&&(this.columnsRowCtrl=this.createBean(new HeaderRowCtrl(l,this.pinned,"column")))},r=()=>{this.includeFloatingFilter=!!this.filterManager?.hasFloatingFilters()&&!this.hidden;const l=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){l();return}const a=t.next();if(this.filtersRowCtrl){const d=this.filtersRowCtrl.getRowIndex()!==a;(!e||d)&&l()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new HeaderRowCtrl(a,this.pinned,"filter")))};s(),o(),r();const n=this.getAllCtrls();this.comp.setCtrls(n),this.restoreFocusOnHeader(i)}getHeaderCtrlForColumn(e){if(isColumn(e))return this.columnsRowCtrl?this.columnsRowCtrl.getHeaderCellCtrl(e):void 0;if(this.groupsRowCtrls.length!==0)for(let t=0;t<this.groupsRowCtrls.length;t++){const i=this.groupsRowCtrls[t].getHeaderCellCtrl(e);if(i)return i}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const i=this.getAllCtrls()[e];return i?i.getType():void 0}focusHeader(e,t,i){const o=this.getAllCtrls()[e];return o?o.focusHeader(t,i):!1}getViewport(){return this.eViewport}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}setupDragAndDrop(e){const t=new BodyDropTarget(this.pinned,e);this.createManagedBean(t)}restoreFocusOnHeader(e){if(!e)return;const{column:t}=e;t.getPinned()==this.pinned&&this.focusService.focusHeaderPosition({headerPosition:e})}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const e=this.filterManager?.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){this.pinned==null&&this.createManagedBean(new CenterWidthFeature(e=>this.comp.setCenterWidth(`${e}px`),!0))}setupPinnedWidth(){if(this.pinned==null)return;const e=this.pinned==="left",t=this.pinned==="right";this.hidden=!0;const i=()=>{const s=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(s==null)return;const o=s==0,r=this.hidden!==o,n=this.gos.get("enableRtl"),l=this.gos.getScrollbarWidth(),d=this.scrollVisibleService.isVerticalScrollShowing()&&(n&&e||!n&&t)?s+l:s;this.comp.setPinnedContainerWidth(`${d}px`),this.comp.setDisplayed(!o),r&&(this.hidden=o,this.refresh())};this.addManagedEventListeners({leftPinnedWidthChanged:i,rightPinnedWidthChanged:i,scrollVisibilityChanged:i,scrollbarWidthChanged:i})}},PINNED_LEFT_TEMPLATE='<div class="ag-pinned-left-header" role="rowgroup"></div>',PINNED_RIGHT_TEMPLATE='<div class="ag-pinned-right-header" role="rowgroup"></div>',CENTER_TEMPLATE=`<div class="ag-header-viewport" role="presentation">
|
|
99
|
+
</div>`,e),this.eResize=RefPlaceholder}postConstruct(){const e=this.getGui(),t=(s,o)=>o!=null?e.setAttribute(s,o):e.removeAttribute(s);e.setAttribute("col-id",this.ctrl.getColId());const i={addOrRemoveCssClass:(s,o)=>this.addOrRemoveCssClass(s,o),setResizableDisplayed:s=>_setDisplayed(this.eResize,s),setWidth:s=>e.style.width=s,setAriaExpanded:s=>t("aria-expanded",s),setUserCompDetails:s=>this.setUserCompDetails(s),getUserCompInstance:()=>this.headerGroupComp};this.ctrl.setComp(i,e,this.eResize)}setUserCompDetails(e){e.newAgStackInstance().then(t=>this.afterHeaderCompCreated(t))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive()){t();return}const i=this.getGui(),s=e.getGui();i.appendChild(s),this.addDestroyFunc(t),this.headerGroupComp=e,this.ctrl.setDragSource(i)}},HeaderRowType=(e=>(e.COLUMN_GROUP="group",e.COLUMN="column",e.FLOATING_FILTER="filter",e))(HeaderRowType||{}),HeaderRowComp=class extends Component{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}postConstruct(){_setAriaRowIndex(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:t=>this.getGui().style.height=t,setTop:t=>this.getGui().style.top=t,setHeaderCtrls:(t,i)=>this.setHeaderCtrls(t,i),setWidth:t=>this.getGui().style.width=t};this.ctrl.setComp(e)}destroy(){this.setHeaderCtrls([],!1),super.destroy()}setHeaderCtrls(e,t){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach(s=>{const o=s.getInstanceId();let r=i[o];delete i[o],r==null&&(r=this.createHeaderComp(s),this.getGui().appendChild(r.getGui())),this.headerComps[o]=r}),_iterateObject(i,(s,o)=>{this.getGui().removeChild(o.getGui()),this.destroyBean(o)}),t){const s=_getAllValuesInObject(this.headerComps);s.sort((r,n)=>{const l=r.getCtrl().getColumnGroupChild().getLeft(),a=n.getCtrl().getColumnGroupChild().getLeft();return l-a});const o=s.map(r=>r.getGui());_setDomChildOrder(this.getGui(),o)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case"group":t=new HeaderGroupCellComp(e);break;case"filter":t=new HeaderFilterCellComp(e);break;default:t=new HeaderCellComp(e);break}return this.createBean(t),t.setParentComponent(this),t}},HeaderNavigationDirection=(e=>(e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT",e))(HeaderNavigationDirection||{}),HeaderNavigationService=class extends BeanStub{constructor(){super(...arguments),this.beanName="headerNavigationService",this.currentHeaderRowWithoutSpan=-1}wireBeans(e){this.focusService=e.focusService,this.headerPositionUtils=e.headerPositionUtils,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.visibleColService=e.visibleColsService}postConstruct(){this.ctrlsService.whenReady(t=>{this.gridBodyCon=t.gridBodyCtrl});const e=this.gos.getDocument();this.addManagedElementListeners(e,{mousedown:()=>this.setCurrentHeaderRowWithoutSpan(-1)})}getHeaderRowCount(){const e=this.ctrlsService.getHeaderRowContainerCtrl();return e?e.getRowCount():0}getHeaderPositionForColumn(e,t){let i;if(typeof e=="string"?(i=this.columnModel.getCol(e),i||(i=this.visibleColService.getColumnGroup(e))):i=e,!i)return null;const o=this.ctrlsService.getHeaderRowContainerCtrl().getAllCtrls(),r=_last(o).getType()==="filter",n=this.getHeaderRowCount()-1;let l=-1,a=i;for(;a;)l++,a=a.getParent();let d=l;return t&&r&&d===n-1&&d++,d===-1?null:{headerRowIndex:d,column:i}}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:s}=t,o=t.column,r=this.getHeaderRowCount(),n=e===0;let{headerRowIndex:l,column:a,headerRowIndexWithoutSpan:d}=n?this.headerPositionUtils.getColumnVisibleParent(o,s):this.headerPositionUtils.getColumnVisibleChild(o,s),h=!1;return l<0&&(l=0,a=o,h=!0),l>=r?(l=-1,this.setCurrentHeaderRowWithoutSpan(-1)):d!==void 0&&(this.currentHeaderRowWithoutSpan=d),!h&&!a?!1:this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l,column:a},allowUserOverride:!0,event:i})}setCurrentHeaderRowWithoutSpan(e){this.currentHeaderRowWithoutSpan=e}navigateHorizontally(e,t=!1,i){const s=this.focusService.getFocusedHeader(),o=e===2,r=this.gos.get("enableRtl");let n,l;if(this.currentHeaderRowWithoutSpan!==-1?s.headerRowIndex=this.currentHeaderRowWithoutSpan:this.currentHeaderRowWithoutSpan=s.headerRowIndex,o!==r?(l="Before",n=this.headerPositionUtils.findHeader(s,l)):(l="After",n=this.headerPositionUtils.findHeader(s,l)),n||!t)return this.focusService.focusHeaderPosition({headerPosition:n,direction:l,fromTab:t,allowUserOverride:!0,event:i});if(t){const a=this.gos.getCallback("tabToNextHeader");if(a)return this.focusService.focusHeaderPositionFromUserFunc({userFunc:a,headerPosition:n,direction:l})}return this.focusNextHeaderRow(s,l,i)}focusNextHeaderRow(e,t,i){const s=e.headerRowIndex;let o=null,r;if(t==="Before"?s>0&&(r=s-1,this.currentHeaderRowWithoutSpan-=1,o=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"end")):(r=s+1,this.currentHeaderRowWithoutSpan<this.getHeaderRowCount()?this.currentHeaderRowWithoutSpan+=1:this.setCurrentHeaderRowWithoutSpan(-1),o=this.headerPositionUtils.findColAtEdgeForHeaderRow(r,"start")),!o)return!1;const{column:n,headerRowIndex:l}=this.headerPositionUtils.getHeaderIndexToFocus(o.column,o?.headerRowIndex);return this.focusService.focusHeaderPosition({headerPosition:{column:n,headerRowIndex:l},direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(isColumnGroup(e)){const s=e.getDisplayedLeafColumns();i=t==="Before"?_last(s):s[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}},GridHeaderCtrl=class extends BeanStub{wireBeans(e){this.headerNavigationService=e.headerNavigationService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService,this.filterManager=e.filterManager,this.menuService=e.menuService}setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new ManagedFocusFeature(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedEventListeners({columnPivotModeChanged:this.onPivotModeChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this)}),this.onPivotModeChanged(),this.setupHeaderHeight();const s=this.onHeaderContextMenu.bind(this);this.addManagedElementListeners(this.eGui,{contextmenu:s}),this.mockContextMenuForIPad(s),this.ctrlsService.register("gridHeaderCtrl",this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("pivotHeaderHeight",e),this.addManagedPropertyListener("groupHeaderHeight",e),this.addManagedPropertyListener("pivotGroupHeaderHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addManagedEventListeners({displayedColumnsChanged:e,columnHeaderHeightChanged:e,gridStylesChanged:e,advancedFilterEnabledChanged:e})}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:e}=this;let t=0,i=e.getHeaderRowCount(),s;this.filterManager?.hasFloatingFilters()&&(i++,t=1);const r=this.columnModel.getColumnGroupHeaderRowHeight(),n=this.columnModel.getColumnHeaderRowHeight(),l=1+t,a=i-l;if(s=t*e.getFloatingFiltersHeight(),s+=a*r,s+=n,this.headerHeight===s)return;this.headerHeight=s;const d=`${s+1}px`;this.comp.setHeightAndMinHeight(d),this.eventService.dispatchEvent({type:"headerHeightChanged"})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const t=this.visibleColsService.getAllCols().some(i=>i.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",t)}onTabKeyDown(e){const t=this.gos.get("enableRtl"),i=e.shiftKey!==t?2:3;(this.headerNavigationService.navigateHorizontally(i,!0,e)||this.focusService.focusNextGridCoreContainer(e.shiftKey))&&e.preventDefault()}handleKeyDown(e){let t=null;switch(e.key){case KeyCode.LEFT:t=2;case KeyCode.RIGHT:{_exists(t)||(t=3),this.headerNavigationService.navigateHorizontally(t,!1,e);break}case KeyCode.UP:t=0;case KeyCode.DOWN:{_exists(t)||(t=1),this.headerNavigationService.navigateVertically(t,null,e)&&e.preventDefault();break}default:return}}onFocusOut(e){const{relatedTarget:t}=e;!t&&this.eGui.contains(this.gos.getActiveDomElement())||this.eGui.contains(t)||this.focusService.clearFocusedHeader()}onHeaderContextMenu(e,t,i){if(!e&&!i||!this.menuService.isHeaderContextMenuEnabled())return;const{target:s}=e??t;(s===this.eGui||s===this.ctrlsService.getHeaderRowContainerCtrl().getViewport())&&this.menuService.showHeaderContextMenu(void 0,e,i)}mockContextMenuForIPad(e){if(!_isIOSUserAgent())return;const t=new TouchListener(this.eGui),i=s=>{e(void 0,s.touchStart,s.touchEvent)};this.addManagedListeners(t,{longTap:i}),this.addDestroyFunc(()=>t.destroy())}},CenterWidthFeature=class extends BeanStub{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}wireBeans(e){this.visibleColsService=e.visibleColsService,this.scrollVisibleService=e.scrollVisibleService}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedEventListeners({columnContainerWidthChanged:e,displayedColumnsChanged:e,leftPinnedWidthChanged:e}),this.addSpacer&&this.addManagedEventListeners({rightPinnedWidthChanged:e,scrollVisibilityChanged:e,scrollbarWidthChanged:e}),this.setWidth()}setWidth(){const e=this.gos.isDomLayout("print"),t=this.visibleColsService.getBodyContainerWidth(),i=this.visibleColsService.getColsLeftWidth(),s=this.visibleColsService.getDisplayedColumnsRightWidth();let o;e?o=t+i+s:(o=t,this.addSpacer&&(this.gos.get("enableRtl")?i:s)===0&&this.scrollVisibleService.isVerticalScrollShowing()&&(o+=this.gos.getScrollbarWidth())),this.callback(o)}},BodyDropPivotTarget=class extends BeanStub{constructor(e){super(),this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}wireBeans(e){this.funcColsService=e.funcColsService}onDragEnter(e){if(this.clearColumnsList(),this.gos.get("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach(i=>{i.isPrimary()&&(i.isAnyFunctionActive()||(i.isAllowValue()?this.columnsToAggregate.push(i):i.isAllowRowGroup()?this.columnsToGroup.push(i):i.isAllowPivot()&&this.columnsToPivot.push(i)))})}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?"pinned":"move":null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.funcColsService.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.funcColsService.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.funcColsService.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}};function attemptMoveColumns(e){const{isFromHeader:t,hDirection:i,xPosition:s,fromEnter:o,fakeEvent:r,pinned:n,gos:l,columnModel:a,columnMoveService:d,presentedColsService:h}=e,c=i===0,u=i===1;let{allMovingColumns:g}=e;if(t){const S=[];g.forEach(R=>{let P=null,b=R.getParent();for(;b!=null&&b.getDisplayedLeafColumns().length===1;)P=b,b=b.getParent();P!=null?(!!P.getColGroupDef()?.marryChildren?P.getProvidedColumnGroup().getLeafColumns():P.getLeafColumns()).forEach(G=>{S.includes(G)||S.push(G)}):S.includes(R)||S.push(R)}),g=S}const p=g.slice();a.sortColsLikeCols(p);const f=calculateValidMoves({movingCols:p,draggingRight:u,xPosition:s,pinned:n,gos:l,columnModel:a,presentedColsService:h}),m=calculateOldIndex(p,a);if(f.length===0)return;const C=f[0];let v=m!==null&&!o;if(t&&(v=m!==null),v&&!r&&(c&&C>=m||u&&C<=m))return;const w=h.getAllCols(),y=[];let F=null;for(let S=0;S<f.length;S++){const R=f[S],P=d.getProposedColumnOrder(p,R);if(!d.doesOrderPassRules(P))continue;const b=P.filter(M=>w.includes(M));if(F===null)F=b;else if(!_areEqual(b,F))break;const x=groupFragCount(P);y.push({move:R,fragCount:x})}if(y.length!==0)return y.sort((S,R)=>S.fragCount-R.fragCount),moveColumns(g,y[0].move,"uiColumnMoved",!1,d)}function moveColumns(e,t,i,s,o){return o.moveColumns(e,t,i,s),s?null:{columns:e,toIndex:t}}function calculateOldIndex(e,t){const i=t.getCols(),s=_sortNumerically(e.map(a=>i.indexOf(a))),o=s[0];return _last(s)-o!==s.length-1?null:o}function groupFragCount(e){function t(s){const o=[];let r=s.getOriginalParent();for(;r!=null;)o.push(r),r=r.getOriginalParent();return o}let i=0;for(let s=0;s<e.length-1;s++){let o=t(e[s]),r=t(e[s+1]);[o,r]=o.length>r.length?[o,r]:[r,o],o.forEach(n=>{r.indexOf(n)===-1&&i++})}return i}function getDisplayedColumns(e,t){switch(t){case"left":return e.getLeftCols();case"right":return e.getRightCols();default:return e.getCenterCols()}}function calculateValidMoves(e){const{movingCols:t,draggingRight:i,xPosition:s,pinned:o,gos:r,columnModel:n,presentedColsService:l}=e;if(r.get("suppressMovableColumns")||t.some(w=>w.getColDef().suppressMovable))return[];const d=getDisplayedColumns(l,o),h=n.getCols(),c=d.filter(w=>_includes(t,w)),u=d.filter(w=>!_includes(t,w)),g=h.filter(w=>!_includes(t,w));let p=0,f=s;if(i){let w=0;c.forEach(y=>w+=y.getActualWidth()),f-=w}if(f>0){for(let w=0;w<u.length;w++){const y=u[w];if(f-=y.getActualWidth(),f<0)break;p++}i&&p++}let m;if(p>0){const w=u[p-1];m=g.indexOf(w)+1}else m=g.indexOf(u[0]),m===-1&&(m=0);const C=[m],v=(w,y)=>w-y;if(i){let w=m+1;const y=h.length-1;for(;w<=y;)C.push(w),w++;C.sort(v)}else{let w=m;const y=h.length-1;let F=h[w];for(;w<=y&&d.indexOf(F)<0;)w++,C.push(w),F=h[w];w=m-1;const S=0;for(;w>=S;)C.push(w),w--;C.sort(v).reverse()}return C}function normaliseX(e,t,i,s,o){const r=o.getHeaderRowContainerCtrl(t).getViewport();return i&&(e-=r.getBoundingClientRect().left),s.get("enableRtl")&&(e=r.clientWidth-e),t==null&&(e+=o.get("center").getCenterViewportScrollLeft()),e}var MoveColumnFeature=class extends BeanStub{constructor(e){super(),this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.isCenterContainer=!_exists(e)}wireBeans(e){this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnMoveService=e.columnMoveService,this.dragAndDropService=e.dragAndDropService,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}getIconName(){return this.pinned?"pinned":"move"}onDragEnter(e){const t=e.dragItem.columns;if(e.dragSource.type===0)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const s=e.dragItem.visibleState,o=(t||[]).filter(r=>s[r.getId()]);this.setColumnsVisible(o,!0,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged"),this.onDragging(e,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i){if(e){const s=e.filter(o=>!o.getColDef().lockVisible);this.columnModel.setColsVisible(s,t,i)}}setColumnsPinned(e,t,i){if(e){const s=e.filter(o=>!o.getColDef().lockPinned);this.columnModel.setColsPinned(s,t,i)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}checkCenterForScrolling(e){if(this.isCenterContainer){const t=this.ctrlsService.get("center"),i=t.getCenterViewportScrollLeft(),s=i+t.getCenterWidth();this.gos.get("enableRtl")?(this.needToMoveRight=e<i+50,this.needToMoveLeft=e>s-50):(this.needToMoveLeft=e<i+50,this.needToMoveRight=e>s-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(e=this.lastDraggingEvent,t=!1,i=!1,s=!1){if(s){if(this.lastMovedInfo){const{columns:d,toIndex:h}=this.lastMovedInfo;moveColumns(d,h,"uiColumnMoved",!0,this.columnMoveService)}return}if(this.lastDraggingEvent=e,_missing(e.hDirection))return;const o=normaliseX(e.x,this.pinned,!1,this.gos,this.ctrlsService);t||this.checkCenterForScrolling(o);const r=this.normaliseDirection(e.hDirection),n=e.dragSource.type,l=e.dragSource.getDragItem().columns?.filter(d=>d.getColDef().lockPinned?d.getPinned()==this.pinned:!0)||[],a=attemptMoveColumns({allMovingColumns:l,isFromHeader:n===1,hDirection:r,xPosition:o,pinned:this.pinned,fromEnter:t,fakeEvent:i,gos:this.gos,columnModel:this.columnModel,columnMoveService:this.columnMoveService,presentedColsService:this.visibleColsService});a&&(this.lastMovedInfo=a)}normaliseDirection(e){if(this.gos.get("enableRtl"))switch(e){case 0:return 1;case 1:return 0;default:_errorOnce(`Unknown direction ${e}`)}else return e}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.dragAndDropService.setGhostIcon(this.needToMoveLeft?"left":"right",!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon("move"))}moveInterval(){let e;this.intervalCount++,e=10+this.intervalCount*5,e>100&&(e=100);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),t!==0)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const o=this.lastDraggingEvent.dragItem.columns.filter(r=>!r.getColDef().lockPinned);if(o.length>0&&(this.dragAndDropService.setGhostIcon("pinned"),this.failedMoveAttempts>7)){const r=this.needToMoveLeft?"left":"right";this.setColumnsPinned(o,r,"uiColumnDragged"),this.dragAndDropService.nudge()}}}},BodyDropTarget=class extends BeanStub{wireBeans(e){this.dragAndDropService=e.dragAndDropService,this.columnModel=e.columnModel,this.ctrlsService=e.ctrlsService}constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady(e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.left.getContainerElement()],[e.bottomLeft.getContainerElement()],[e.topLeft.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.right.getContainerElement()],[e.bottomRight.getContainerElement()],[e.topRight.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.center.getViewportElement()],[e.bottomCenter.getViewportElement()],[e.topCenter.getViewportElement()]];break}}),this.moveColumnFeature=this.createManagedBean(new MoveColumnFeature(this.pinned)),this.bodyDropPivotTarget=this.createManagedBean(new BodyDropPivotTarget(this.pinned)),this.dragAndDropService.addDropTarget(this)}isInterestedIn(e){return e===1||e===0&&this.gos.get("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&e.dragSource.type===0}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}},ResizeFeature=class extends BeanStub{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.pinnedWidthService=e.pinnedWidthService,this.ctrlsService=e.ctrlsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,i,s,o){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=s,this.ctrl=o}postConstruct(){const e=[];let t,i;const s=()=>{if(_setDisplayed(this.eResize,t),!t)return;const n=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(e.push(n),i){const l=this.gos.get("skipHeaderOnAutoSize"),a=()=>{this.columnAutosizeService.autoSizeColumn(this.column,"uiColumnResized",l)};this.eResize.addEventListener("dblclick",a);const d=new TouchListener(this.eResize);d.addEventListener("doubleTap",a),e.push(()=>{this.eResize.removeEventListener("dblclick",a),d.removeEventListener("doubleTap",a),d.destroy()})}},o=()=>{e.forEach(n=>n()),e.length=0},r=()=>{const n=this.column.isResizable(),l=!this.gos.get("suppressAutoSize")&&!this.column.getColDef().suppressAutoSize;(n!==t||l!==i)&&(t=n,i=l,o(),s())};r(),this.addDestroyFunc(o),this.ctrl.addRefreshFunction(r)}onResizing(e,t){const{column:i,lastResizeAmount:s,resizeStartWidth:o}=this,r=this.normaliseResizeAmount(t),n=o+r,l=[{key:i,newWidth:n}];if(this.column.getPinned()){const a=this.pinnedWidthService.getPinnedLeftWidth(),d=this.pinnedWidthService.getPinnedRightWidth(),h=_getInnerWidth(this.ctrlsService.getGridBodyCtrl().getBodyViewportElement())-50;if(a+d+(r-s)>h)return}this.lastResizeAmount=r,this.columnSizeService.setColumnWidths(l,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.toggleColumnResizing(!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.lastResizeAmount=0,this.resizeWithShiftKey=e,this.toggleColumnResizing(!0)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}normaliseResizeAmount(e){let t=e;const i=this.pinned!=="left",s=this.pinned==="right";return this.gos.get("enableRtl")?i&&(t*=-1):s&&(t*=-1),t}},SelectAllFeature=class extends BeanStub{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}onSpaceKeyDown(e){const t=this.cbSelectAll;t.isDisplayed()&&!t.getGui().contains(this.gos.getActiveDomElement())&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new AgCheckbox),this.cbSelectAll.addCssClass("ag-header-select-all"),_setAriaRole(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedEventListeners({newColumnsLoaded:this.onNewColumnsLoaded.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),selectionChanged:this.onSelectionChanged.bind(this),paginationChanged:this.onSelectionChanged.bind(this),modelUpdated:this.onModelChanged.bind(this)}),this.addManagedListeners(this.cbSelectAll,{fieldValueChanged:this.onCbSelectAll.bind(this)}),_setAriaHidden(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}onNewColumnsLoaded(){this.showOrHideSelectAll()}onDisplayedColumnsChanged(){this.isAlive()&&this.showOrHideSelectAll()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setValue(e);const t=this.selectionService.hasNodesToSelect(this.isFilteredOnly(),this.isCurrentPageOnly());this.cbSelectAll.setDisabled(!t),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),i=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),s=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${s} (${i})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${s} (${i})`),this.headerCellCtrl.announceAriaDescription()}checkSelectionType(e){return this.gos.get("rowSelection")==="multiple"?!0:(_warnOnce(`${e} is only available if using 'multiple' rowSelection.`),!1)}checkRightRowModelType(e){const t=this.rowModel.getType();return t==="clientSide"||t==="serverSide"?!0:(_warnOnce(`${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox||!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue(),t=this.isFilteredOnly(),i=this.isCurrentPageOnly();let s="uiSelectAll";i?s="uiSelectAllCurrentPage":t&&(s="uiSelectAllFiltered");const o={source:s,justFiltered:t,justCurrentPage:i};e?this.selectionService.selectAllRowNodes(o):this.selectionService.deselectAllRowNodes(o)}isCheckboxSelection(){let e=this.column.getColDef().headerCheckboxSelection;if(typeof e=="function"){const t=e,i=this.gos.addGridCommonParams({column:this.column,colDef:this.column.getColDef()});e=t(i)}return e?this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection"):!1}isFilteredOnly(){return!!this.column.getColDef().headerCheckboxSelectionFilteredOnly}isCurrentPageOnly(){return!!this.column.getColDef().headerCheckboxSelectionCurrentPageOnly}},HeaderCellCtrl=class extends AbstractHeaderCellCtrl{constructor(e,t,i){super(e,t,i),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,s){this.comp=e,this.setGui(t),this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(s),this.addColumnHoverListener(),this.setupFilterClass(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.resizeFeature=this.createManagedBean(new ResizeFeature(this.getPinned(),this.column,i,e,this)),this.createManagedBean(new HoverFeature([this.column],t)),this.createManagedBean(new SetLeftFeature(this.column,t,this.beans)),this.createManagedBean(new ManagedFocusFeature(t,{shouldStopEventPropagation:o=>this.shouldStopEventPropagation(o),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addResizeAndMoveKeyboardListeners(),this.addManagedPropertyListeners(["suppressMovableColumns","suppressMenuHide","suppressAggFuncInHeader"],this.refresh.bind(this)),this.addManagedListeners(this.column,{colDefChanged:this.refresh.bind(this)}),this.addManagedEventListeners({columnValueChanged:this.onColumnValueChanged.bind(this),columnRowGroupChanged:this.onColumnRowGroupChanged.bind(this),columnPivotChanged:this.onColumnPivotChanged.bind(this),headerHeightChanged:this.onHeaderHeightChanged.bind(this)})}resizeHeader(e,t){if(!this.column.isResizable())return;const i=this.column.getActualWidth(),s=this.column.getMinWidth(),o=this.column.getMaxWidth(),r=Math.min(Math.max(i+e,s),o);this.beans.columnSizeService.setColumnWidths([{key:this.column,newWidth:r}],t,!0,"uiColumnResized")}moveHeader(e){const{eGui:t,column:i,gos:s,ctrlsService:o}=this,r=this.getPinned(),n=t.getBoundingClientRect().left,l=i.getActualWidth(),a=s.get("enableRtl"),h=normaliseX(e===0!==a?n-20:n+l+20,r,!0,s,o);attemptMoveColumns({allMovingColumns:[i],isFromHeader:!0,hDirection:e,xPosition:h,pinned:r,fromEnter:!1,fakeEvent:!1,gos:s,columnModel:this.beans.columnModel,columnMoveService:this.beans.columnMoveService,presentedColsService:this.beans.visibleColsService}),o.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(i,"auto")}setupUserComp(){const e=this.lookupUserCompDetails();this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(t,e)}createParams(){return this.gos.addGridCommonParams({column:this.column,displayName:this.displayName,enableSorting:this.column.isSortable(),enableMenu:this.menuEnabled,enableFilterButton:this.openFilterEnabled&&this.menuService.isHeaderFilterButtonEnabled(this.column),enableFilterIcon:!this.openFilterEnabled||this.menuService.isLegacyMenuEnabled(),showColumnMenu:t=>{this.menuService.showColumnMenu({column:this.column,buttonElement:t,positionBy:"button"})},showColumnMenuAfterMouseClick:t=>{this.menuService.showColumnMenu({column:this.column,mouseEvent:t,positionBy:"mouse"})},showFilter:t=>{this.menuService.showFilterMenu({column:this.column,buttonElement:t,containerType:"columnFilter",positionBy:"button"})},progressSort:t=>{this.beans.sortController.progressSort(this.column,!!t,"uiColumnSorted")},setSort:(t,i)=>{this.beans.sortController.setSortForColumn(this.column,t,!!i,"uiColumnSorted")},eGridHeader:this.getGui(),setTooltip:(t,i)=>{this.setupTooltip(t,i)}})}setupSelectAll(){this.selectAllFeature=this.createManagedBean(new SelectAllFeature(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===KeyCode.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===KeyCode.ENTER&&this.onEnterKeyDown(e),e.key===KeyCode.DOWN&&e.altKey&&this.showMenuOnKeyPress(e,!1)}onEnterKeyDown(e){if(e.ctrlKey||e.metaKey)this.showMenuOnKeyPress(e,!0);else if(this.sortable){const t=e.shiftKey;this.beans.sortController.progressSort(this.column,t,"uiColumnSorted")}}showMenuOnKeyPress(e,t){const i=this.comp.getUserCompInstance();!i||!(i instanceof HeaderComp)||i.onMenuKeyboardShortcut(t)&&e.preventDefault()}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const t=this.getRowIndex();this.focusService.setFocusedHeader(t,this.column),this.announceAriaDescription()}this.focusService.isKeyboardMode()&&this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i=this.gos.get("tooltipShowMode")==="whenTruncated",s=this.eGui,o=this.column.getColDef();!t&&i&&!o.headerComponent&&(t=()=>{const l=s.querySelector(".ag-header-cell-text");return l?l.scrollWidth>l.clientWidth:!0});const r={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>s,getLocation:()=>"header",getTooltipValue:()=>e??this.column.getColDef().headerTooltip,shouldDisplayTooltip:t},n=this.createManagedBean(new TooltipFeature(r));this.refreshFunctions.push(()=>n.refreshToolTip())}setupClassesFromColDef(){const e=()=>{const t=this.column.getColDef(),i=_getHeaderClassesFromColDef(t,this.gos,this.column,null),s=this.userHeaderClasses;this.userHeaderClasses=new Set(i),i.forEach(o=>{s.has(o)?s.delete(o):this.comp.addOrRemoveCssClass(o,!0)}),s.forEach(o=>this.comp.addOrRemoveCssClass(o,!1))};this.refreshFunctions.push(e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e||!this.draggable)return;const{column:t,beans:i,displayName:s,dragAndDropService:o,gos:r}=this,{columnModel:n}=i;let l=!this.gos.get("suppressDragLeaveHidesColumns");const a=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>l?"hide":"notAllowed",getDragItem:()=>this.createDragItem(t),dragItemName:s,onDragStarted:()=>{l=!r.get("suppressDragLeaveHidesColumns"),t.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>t.setMoving(!1,"uiColumnMoved"),onGridEnter:d=>{if(l){const h=d?.columns?.filter(c=>!c.getColDef().lockVisible)||[];n.setColsVisible(h,!0,"uiColumnMoved")}},onGridExit:d=>{if(l){const h=d?.columns?.filter(c=>!c.getColDef().lockVisible)||[];n.setColsVisible(h,!1,"uiColumnMoved")}}};o.addDragSource(a,!0)}createDragItem(e){const t={};return t[e.getId()]=e.isVisible(),{columns:[e],visibleState:t}}updateState(){this.menuEnabled=this.menuService.isColumnMenuInHeaderEnabled(this.column),this.openFilterEnabled=this.menuService.isFilterMenuInHeaderEnabled(this.column),this.sortable=this.column.isSortable(),this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}addRefreshFunction(e){this.refreshFunctions.push(e)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach(e=>e())}refreshHeaderComp(){const e=this.lookupUserCompDetails();(this.comp.getUserCompInstance()!=null&&this.userCompDetails.componentClass==e.componentClass?this.attemptHeaderCompRefresh(e.params):!1)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();return!t||!t.refresh?!1:t.refresh(e)}calculateDisplayName(){return this.beans.columnNameService.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!!(!this.gos.get("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const e=()=>{const t=this.column.getActualWidth();this.comp.setWidth(`${t}px`)};this.addManagedListeners(this.column,{widthChanged:e}),e()}setupMovingCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListeners(this.column,{movingChanged:e}),e()}setupMenuClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListeners(this.column,{menuVisibleChanged:e}),e()}setupSortableClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};e(),this.addRefreshFunction(e),this.addManagedEventListeners({sortChanged:this.refreshAriaSort.bind(this)})}setupFilterClass(){const e=()=>{const t=this.column.isFilterActive();this.comp.addOrRemoveCssClass("ag-header-cell-filtered",t),this.refreshAria()};this.addManagedListeners(this.column,{filterActiveChanged:e}),e()}setupWrapTextClass(){const e=()=>{const t=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",t)};e(),this.addRefreshFunction(e)}onDisplayedColumnsChanged(){super.onDisplayedColumnsChanged(),this.isAlive()&&this.onHeaderHeightChanged()}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,beans:s}=this;if(!t.isSpanHeaderHeight()){e.style.removeProperty("top"),e.style.removeProperty("height"),i.addOrRemoveCssClass("ag-header-span-height",!1),i.addOrRemoveCssClass("ag-header-span-total",!1);return}const{numberOfParents:o,isSpanningTotal:r}=this.column.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",o>0);const{columnModel:n}=s,l=n.getColumnHeaderRowHeight();if(o===0){i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),e.style.setProperty("height",`${l}px`);return}i.addOrRemoveCssClass("ag-header-span-total",r);const d=n.isPivotMode()?n.getPivotGroupHeaderHeight():n.getGroupHeaderHeight(),h=o*d;e.style.setProperty("top",`${-h}px`),e.style.setProperty("height",`${l+h}px`)}setupAutoHeight(e){const{columnModel:t,resizeObserverService:i}=this.beans,s=d=>{if(!this.isAlive())return;const{paddingTop:h,paddingBottom:c,borderBottomWidth:u,borderTopWidth:g}=_getElementSize(this.getGui()),p=h+c+u+g,m=e.offsetHeight+p;if(d<5){const C=this.beans.gos.getDocument(),v=!C||!C.contains(e),w=m==0;if(v||w){window.setTimeout(()=>s(d+1),0);return}}t.setColHeaderHeight(this.column,m)};let o=!1,r;const n=()=>{const d=this.column.isAutoHeaderHeight();d&&!o&&l(),!d&&o&&a()},l=()=>{o=!0,s(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),r=i.observeResize(e,()=>s(0))},a=()=>{o=!1,r&&r(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),r=void 0};n(),this.addDestroyFunc(()=>a()),this.addManagedListeners(this.column,{widthChanged:()=>o&&s(0)}),this.addManagedEventListeners({sortChanged:()=>{o&&window.setTimeout(()=>s(0))}}),this.addRefreshFunction(n)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.beans.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(_getAriaSortState(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort"))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press ALT DOWN to open column menu"))}else this.setAriaDescriptionProperty("menu",null)}refreshAriaFilterButton(){if(this.openFilterEnabled&&!this.menuService.isLegacyMenuEnabled()){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("filterButton",e("ariaFilterColumn","Press CTRL ENTER to open filter"))}else this.setAriaDescriptionProperty("filterButton",null)}refreshAriaFiltered(){const e=this.localeService.getLocaleTextFunc();this.column.isFilterActive()?this.setAriaDescriptionProperty("filter",e("ariaColumnFiltered","Column Filtered")):this.setAriaDescriptionProperty("filter",null)}setAriaDescriptionProperty(e,t){t!=null?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}announceAriaDescription(){if(!this.eGui.contains(this.beans.gos.getActiveDomElement()))return;const e=Array.from(this.ariaDescriptionProperties.keys()).sort((t,i)=>t==="filter"?-1:i.charCodeAt(0)-t.charCodeAt(0)).map(t=>this.ariaDescriptionProperties.get(t)).join(". ");this.beans.ariaAnnouncementService.announceValue(e)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaFilterButton(),this.refreshAriaFiltered()}addColumnHoverListener(){const e=()=>{if(!this.gos.get("columnHoverHighlight"))return;const t=this.beans.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",t)};this.addManagedEventListeners({columnHoverChanged:e}),e()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const e=s=>this.handleMouseOverChange(s.type==="mouseenter"),t=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column),i=s=>this.handleContextMenuMouseEvent(s,void 0,this.column);this.addManagedListeners(this.getGui(),{mouseenter:e,mouseleave:e,click:t,contextmenu:i})}handleMouseOverChange(e){this.setActiveHeader(e);const i={type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column};this.eventService.dispatchEvent(i)}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}getAnchorElementForMenu(e){const t=this.comp.getUserCompInstance();return t instanceof HeaderComp?t.getAnchorElementForMenu(e):this.getGui()}destroy(){super.destroy(),this.refreshFunctions=null,this.selectAllFeature=null,this.dragSourceElement=null,this.userCompDetails=null,this.userHeaderClasses=null,this.ariaDescriptionProperties=null}},GroupResizeFeature=class extends BeanStub{wireBeans(e){this.horizontalResizeService=e.horizontalResizeService,this.autoWidthCalculator=e.autoWidthCalculator,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.columnAutosizeService=e.columnAutosizeService}constructor(e,t,i,s){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable()){this.comp.setResizableDisplayed(!1);return}const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gos.get("suppressAutoSize")){const t=this.gos.get("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const i=[];this.columnGroup.getDisplayedLeafColumns().forEach(o=>{o.getColDef().suppressAutoSize||i.push(o.getColId())}),i.length>0&&this.columnAutosizeService.autoSizeCols({colKeys:i,skipHeader:t,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(e){const t=this.getInitialValues(e);this.storeLocalValues(t),this.toggleColumnResizing(!0)}onResizing(e,t,i="uiColumnResized"){const s=this.normaliseDragChange(t),o=this.resizeStartWidth+s;this.resizeColumnsFromLocalValues(o,i,e)}getInitialValues(e){const t=this.getColumnsToResize(),i=this.getInitialSizeOfColumns(t),s=this.getSizeRatiosOfColumns(t,i),o={columnsToResize:t,resizeStartWidth:i,resizeRatios:s};let r=null;if(e&&(r=this.visibleColsService.getGroupAtDirection(this.columnGroup,"After")),r){const n=r.getDisplayedLeafColumns(),l=o.groupAfterColumns=n.filter(d=>d.isResizable()),a=o.groupAfterStartWidth=this.getInitialSizeOfColumns(l);o.groupAfterRatios=this.getSizeRatiosOfColumns(l,a)}else o.groupAfterColumns=void 0,o.groupAfterStartWidth=void 0,o.groupAfterRatios=void 0;return o}storeLocalValues(e){const{columnsToResize:t,resizeStartWidth:i,resizeRatios:s,groupAfterColumns:o,groupAfterStartWidth:r,groupAfterRatios:n}=e;this.resizeCols=t,this.resizeStartWidth=i,this.resizeRatios=s,this.resizeTakeFromCols=o,this.resizeTakeFromStartWidth=r,this.resizeTakeFromRatios=n}clearLocalValues(){this.resizeCols=void 0,this.resizeRatios=void 0,this.resizeTakeFromCols=void 0,this.resizeTakeFromRatios=void 0}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup),i=this.getInitialValues();t>i.resizeStartWidth&&this.resizeColumns(i,t,e,!0)}resizeColumnsFromLocalValues(e,t,i=!0){if(!this.resizeCols||!this.resizeRatios)return;const s={columnsToResize:this.resizeCols,resizeStartWidth:this.resizeStartWidth,resizeRatios:this.resizeRatios,groupAfterColumns:this.resizeTakeFromCols??void 0,groupAfterStartWidth:this.resizeTakeFromStartWidth??void 0,groupAfterRatios:this.resizeTakeFromRatios??void 0};this.resizeColumns(s,e,t,i)}resizeColumns(e,t,i,s=!0){const{columnsToResize:o,resizeStartWidth:r,resizeRatios:n,groupAfterColumns:l,groupAfterStartWidth:a,groupAfterRatios:d}=e,h=[];if(h.push({columns:o,ratios:n,width:t}),l){const c=t-r;h.push({columns:l,ratios:d,width:a-c})}this.columnSizeService.resizeColumnSets({resizeSets:h,finished:s,source:i}),s&&this.toggleColumnResizing(!1)}toggleColumnResizing(e){this.comp.addOrRemoveCssClass("ag-column-resizing",e)}getColumnsToResize(){return this.columnGroup.getDisplayedLeafColumns().filter(t=>t.isResizable())}getInitialSizeOfColumns(e){return e.reduce((t,i)=>t+i.getActualWidth(),0)}getSizeRatiosOfColumns(e,t){return e.map(i=>i.getActualWidth()/t)}normaliseDragChange(e){let t=e;return this.gos.get("enableRtl")?this.pinned!=="left"&&(t*=-1):this.pinned==="right"&&(t*=-1),t}destroy(){super.destroy(),this.clearLocalValues()}},GroupWidthFeature=class extends BeanStub{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListeners(this.columnGroup,{displayedChildrenChanged:this.onDisplayedChildrenChanged.bind(this)}),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(e=>e()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(`${e}px`),this.comp.addOrRemoveCssClass("ag-hidden",e===0)}},HeaderGroupCellCtrl=class extends AbstractHeaderCellCtrl{constructor(e,t,i){super(e,t,i),this.onSuppressColMoveChange=()=>{if(!this.isAlive()||this.isSuppressMoving())this.removeDragSource();else if(!this.dragSource){const s=this.getGui();this.setDragSource(s)}},this.column=e}setComp(e,t,i){this.comp=e,this.setGui(t),this.displayName=this.beans.columnNameService.getDisplayNameForColumnGroup(this.column,"header"),this.addClasses(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.addDestroyFunc(()=>{this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature))}),this.setupUserComp(),this.addHeaderMouseListeners();const s=this.getParentRowCtrl().getPinned(),o=this.column.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new HoverFeature(o,t)),this.createManagedBean(new SetLeftFeature(this.column,t,this.beans)),this.createManagedBean(new GroupWidthFeature(e,this.column)),this.resizeFeature=this.createManagedBean(new GroupResizeFeature(e,i,s,this.column)),this.createManagedBean(new ManagedFocusFeature(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)})),this.addManagedPropertyListener("suppressMovableColumns",this.onSuppressColMoveChange),this.addResizeAndMoveKeyboardListeners()}resizeHeader(e,t){if(!this.resizeFeature)return;const i=this.resizeFeature.getInitialValues(t);this.resizeFeature.resizeColumns(i,i.resizeStartWidth+e,"uiColumnResized",!0)}moveHeader(e){const{beans:t,eGui:i,column:s,gos:o,ctrlsService:r}=this,n=o.get("enableRtl"),l=e===0,a=this.getPinned(),d=i.getBoundingClientRect(),h=d.left,c=d.width,u=normaliseX(l!==n?h-20:h+c+20,a,!0,o,r),g=s.getGroupId(),p=this.focusService.getFocusedHeader();attemptMoveColumns({allMovingColumns:this.column.getLeafColumns(),isFromHeader:!0,hDirection:e,xPosition:u,pinned:a,fromEnter:!1,fakeEvent:!1,gos:o,columnModel:t.columnModel,columnMoveService:t.columnMoveService,presentedColsService:t.visibleColsService});const f=s.getDisplayedLeafColumns(),m=l?f[0]:_last(f);this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(m,"auto"),!this.isAlive()&&p&&this.restoreFocus(g,s,p)}restoreFocus(e,t,i){const s=t.getLeafColumns();if(!s.length)return;const o=s[0].getParent();if(!o)return;const r=this.findGroupWidthId(o,e);r&&this.focusService.focusHeaderPosition({headerPosition:{...i,column:r}})}findGroupWidthId(e,t){for(;e;){if(e.getGroupId()===t)return e;e=e.getParent()}return null}resizeLeafColumnsToFit(e){this.resizeFeature&&this.resizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(){const e=this.gos.addGridCommonParams({displayName:this.displayName,columnGroup:this.column,setExpanded:i=>{this.beans.columnModel.setColumnGroupOpened(this.column.getProvidedColumnGroup(),i,"gridInitializing")},setTooltip:(i,s)=>{this.setupTooltip(i,s)}}),t=this.userComponentFactory.getHeaderGroupCompDetails(e);this.comp.setUserCompDetails(t)}addHeaderMouseListeners(){const e=s=>this.handleMouseOverChange(s.type==="mouseenter"),t=()=>this.dispatchColumnMouseEvent("columnHeaderClicked",this.column.getProvidedColumnGroup()),i=s=>this.handleContextMenuMouseEvent(s,void 0,this.column.getProvidedColumnGroup());this.addManagedListeners(this.getGui(),{mouseenter:e,mouseleave:e,click:t,contextmenu:i})}handleMouseOverChange(e){const i={type:e?"columnHeaderMouseOver":"columnHeaderMouseLeave",column:this.column.getProvidedColumnGroup()};this.eventService.dispatchEvent(i)}setupTooltip(e,t){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature));const i=this.column.getColGroupDef(),s=this.gos.get("tooltipShowMode")==="whenTruncated",o=this.eGui;!t&&s&&!i?.headerGroupComponent&&(t=()=>{const n=o.querySelector(".ag-header-group-text");return n?n.scrollWidth>n.clientWidth:!0});const r={getColumn:()=>this.column,getGui:()=>o,getLocation:()=>"headerGroup",getTooltipValue:()=>e??(i&&i.headerTooltip),shouldDisplayTooltip:t};i&&(r.getColDef=()=>i),this.createManagedBean(new TooltipFeature(r))}setupExpandable(){const e=this.column.getProvidedColumnGroup();this.refreshExpanded();const t=this.refreshExpanded.bind(this);this.addManagedListeners(e,{expandedChanged:t,expandableChanged:t})}refreshExpanded(){const{column:e}=this;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.column.getUniqueId()}addClasses(){const e=this.column.getColGroupDef(),t=_getHeaderClassesFromColDef(e,this.gos,null,this.column);this.column.isPadding()?(t.push("ag-header-group-cell-no-group"),this.column.getLeafColumns().every(s=>s.isSpanHeaderHeight())&&t.push("ag-header-span-height")):t.push("ag-header-group-cell-with-group"),t.forEach(i=>this.comp.addOrRemoveCssClass(i,!0))}setupMovingCss(){const t=this.column.getProvidedColumnGroup().getLeafColumns(),i=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving());t.forEach(s=>{this.addManagedListeners(s,{movingChanged:i})}),i()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const t=this.getRowIndex();this.beans.focusService.setFocusedHeader(t,this.column)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(!(!this.expandable||!t)&&e.key===KeyCode.ENTER){const i=this.column,s=!i.isExpanded();this.beans.columnModel.setColumnGroupOpened(i.getProvidedColumnGroup(),s,"uiColumnExpanded")}}setDragSource(e){if(!this.isAlive()||this.isSuppressMoving()||(this.removeDragSource(),!e))return;const{beans:t,column:i,displayName:s,gos:o,dragAndDropService:r}=this,{columnModel:n}=t,l=i.getProvidedColumnGroup().getLeafColumns();let a=!o.get("suppressDragLeaveHidesColumns");const d=this.dragSource={type:1,eElement:e,getDefaultIconName:()=>a?"hide":"notAllowed",dragItemName:s,getDragItem:()=>this.getDragItemForGroup(i),onDragStarted:()=>{a=!o.get("suppressDragLeaveHidesColumns"),l.forEach(h=>h.setMoving(!0,"uiColumnDragged"))},onDragStopped:()=>l.forEach(h=>h.setMoving(!1,"uiColumnDragged")),onGridEnter:h=>{if(a){const c=h?.columns?.filter(u=>!u.getColDef().lockVisible)||[];n.setColsVisible(c,!0,"uiColumnMoved")}},onGridExit:h=>{if(a){const c=h?.columns?.filter(u=>!u.getColDef().lockVisible)||[];n.setColsVisible(c,!1,"uiColumnMoved")}}};r.addDragSource(d,!0)}getDragItemForGroup(e){const t=e.getProvidedColumnGroup().getLeafColumns(),i={};t.forEach(o=>i[o.getId()]=o.isVisible());const s=[];return this.beans.visibleColsService.getAllCols().forEach(o=>{t.indexOf(o)>=0&&(s.push(o),_removeFromArray(t,o))}),t.forEach(o=>s.push(o)),{columns:s,visibleState:i}}isSuppressMoving(){let e=!1;return this.column.getLeafColumns().forEach(i=>{(i.getColDef().suppressMovable||i.getColDef().lockPosition)&&(e=!0)}),e||this.gos.get("suppressMovableColumns")}},instanceIdSequence3=0,HeaderRowCtrl=class extends BeanStub{constructor(e,t,i){super(),this.instanceId=instanceIdSequence3++,this.rowIndex=e,this.pinned=t,this.type=i;const s=i=="group"?"ag-header-row-column-group":i=="filter"?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass=`ag-header-row ${s}`}wireBeans(e){this.beans=e}postConstruct(){this.isPrintLayout=this.gos.isDomLayout("print"),this.isEnsureDomOrder=this.gos.get("ensureDomOrder")}getInstanceId(){return this.instanceId}areCellsRendered(){return this.comp?this.getHeaderCellCtrls().every(e=>e.getGui()!=null):!1}setComp(e,t=!0){this.comp=e,t&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}addEventListeners(){const e=this.onRowHeightChanged.bind(this);this.addManagedEventListeners({columnResized:this.onColumnResized.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:t=>this.onVirtualColumnsChanged(t.afterScroll),columnHeaderHeightChanged:e,gridStylesChanged:e,advancedFilterEnabledChanged:e}),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",t=>this.isEnsureDomOrder=t.currentValue),this.addManagedPropertyListeners(["headerHeight","pivotHeaderHeight","groupHeaderHeight","pivotGroupHeaderHeight","floatingFiltersHeight"],e)}getHeaderCellCtrl(e){if(this.headerCellCtrls)return _values(this.headerCellCtrls).find(t=>t.getColumnGroupChild()===e)}onDisplayedColumnsChanged(){this.isPrintLayout=this.gos.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(`${e}px`)}getWidthForRow(){const{visibleColsService:e}=this.beans;return this.isPrintLayout?this.pinned!=null?0:e.getContainerWidth("right")+e.getContainerWidth("left")+e.getContainerWidth(null):e.getContainerWidth(this.pinned)}onRowHeightChanged(){const{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){const{columnModel:e,filterManager:t}=this.beans;let i=e.getHeaderRowCount();const s=[];let o=0;t?.hasFloatingFilters()&&(i++,o=1);const r=e.getColumnGroupHeaderRowHeight(),n=e.getColumnHeaderRowHeight(),l=1+o,a=i-l;for(let c=0;c<a;c++)s.push(r);s.push(n);for(let c=0;c<o;c++)s.push(e.getFloatingFiltersHeight());let d=0;for(let c=0;c<this.rowIndex;c++)d+=s[c];const h=s[this.rowIndex];return{topOffset:d,rowHeight:h}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),i=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,i,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls=new Map;const t=this.getColumnsInViewport();for(const s of t)this.recycleAndCreateHeaderCtrls(s,e);const i=s=>{const{focusService:o,visibleColsService:r}=this.beans;return o.isHeaderWrapperFocused(s)?r.isVisible(s.getColumnGroupChild()):!1};if(e)for(const[s,o]of e)i(o)?this.headerCellCtrls.set(s,o):this.destroyBean(o);return this.getHeaderCellCtrls()}getHeaderCellCtrls(){return Array.from(this.headerCellCtrls?.values()??[])}recycleAndCreateHeaderCtrls(e,t){if(!this.headerCellCtrls||e.isEmptyGroup())return;const i=e.getUniqueId();let s;if(t&&(s=t.get(i),t.delete(i)),s&&s.getColumnGroupChild()!=e&&(this.destroyBean(s),s=void 0),s==null)switch(this.type){case"filter":{s=this.createBean(this.beans.ctrlsFactory.getInstance("headerFilterCell",e,this.beans,this));break}case"group":s=this.createBean(new HeaderGroupCellCtrl(e,this.beans,this));break;default:s=this.createBean(new HeaderCellCtrl(e,this.beans,this));break}this.headerCellCtrls.set(i,s)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(this.pinned!=null)return[];let e=[];const t=this.getActualDepth(),{columnViewportService:i}=this.beans;return["left",null,"right"].forEach(s=>{const o=i.getHeadersToRender(s,t);e=e.concat(o)}),e}getActualDepth(){return this.type=="filter"?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.beans.columnViewportService.getHeadersToRender(this.pinned,this.getActualDepth())}findHeaderCellCtrl(e){return this.headerCellCtrls?this.getHeaderCellCtrls().find(s=>s.getColumnGroupChild()==e):void 0}focusHeader(e,t){const i=this.findHeaderCellCtrl(e);return i?i.focus(t):!1}destroy(){this.headerCellCtrls&&this.headerCellCtrls.forEach(e=>{this.destroyBean(e)}),this.headerCellCtrls=void 0,super.destroy()}},HeaderRowContainerCtrl=class extends BeanStub{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}wireBeans(e){this.ctrlsService=e.ctrlsService,this.scrollVisibleService=e.scrollVisibleService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.focusService=e.focusService,this.filterManager=e.filterManager}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport);const i=this.onDisplayedColumnsChanged.bind(this);this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),displayedColumnsChanged:i,advancedFilterEnabledChanged:i}),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}refresh(e=!1){const t=new NumberSequence,i=this.focusService.getFocusHeaderToUseAfterRefresh(),s=()=>{const l=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let a=0;a<l;a++){const d=this.createBean(new HeaderRowCtrl(t.next(),this.pinned,"group"));this.groupsRowCtrls.push(d)}},o=()=>{const l=t.next(),a=!this.hidden&&(this.columnsRowCtrl==null||!e||this.columnsRowCtrl.getRowIndex()!==l);(a||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),a&&(this.columnsRowCtrl=this.createBean(new HeaderRowCtrl(l,this.pinned,"column")))},r=()=>{this.includeFloatingFilter=!!this.filterManager?.hasFloatingFilters()&&!this.hidden;const l=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter){l();return}const a=t.next();if(this.filtersRowCtrl){const d=this.filtersRowCtrl.getRowIndex()!==a;(!e||d)&&l()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new HeaderRowCtrl(a,this.pinned,"filter")))};s(),o(),r();const n=this.getAllCtrls();this.comp.setCtrls(n),this.restoreFocusOnHeader(i)}getHeaderCtrlForColumn(e){if(isColumn(e))return this.columnsRowCtrl?this.columnsRowCtrl.getHeaderCellCtrl(e):void 0;if(this.groupsRowCtrls.length!==0)for(let t=0;t<this.groupsRowCtrls.length;t++){const i=this.groupsRowCtrls[t].getHeaderCellCtrl(e);if(i)return i}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const i=this.getAllCtrls()[e];return i?i.getType():void 0}focusHeader(e,t,i){const o=this.getAllCtrls()[e];return o?o.focusHeader(t,i):!1}getViewport(){return this.eViewport}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}setupDragAndDrop(e){const t=new BodyDropTarget(this.pinned,e);this.createManagedBean(t)}restoreFocusOnHeader(e){if(!e)return;const{column:t}=e;t.getPinned()==this.pinned&&this.focusService.focusHeaderPosition({headerPosition:e})}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const e=this.filterManager?.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){this.pinned==null&&this.createManagedBean(new CenterWidthFeature(e=>this.comp.setCenterWidth(`${e}px`),!0))}setupPinnedWidth(){if(this.pinned==null)return;const e=this.pinned==="left",t=this.pinned==="right";this.hidden=!0;const i=()=>{const s=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(s==null)return;const o=s==0,r=this.hidden!==o,n=this.gos.get("enableRtl"),l=this.gos.getScrollbarWidth(),d=this.scrollVisibleService.isVerticalScrollShowing()&&(n&&e||!n&&t)?s+l:s;this.comp.setPinnedContainerWidth(`${d}px`),this.comp.setDisplayed(!o),r&&(this.hidden=o,this.refresh())};this.addManagedEventListeners({leftPinnedWidthChanged:i,rightPinnedWidthChanged:i,scrollVisibilityChanged:i,scrollbarWidthChanged:i})}},PINNED_LEFT_TEMPLATE='<div class="ag-pinned-left-header" role="rowgroup"></div>',PINNED_RIGHT_TEMPLATE='<div class="ag-pinned-right-header" role="rowgroup"></div>',CENTER_TEMPLATE=`<div class="ag-header-viewport" role="presentation">
|
|
100
100
|
<div class="ag-header-container" data-ref="eCenterContainer" role="rowgroup"></div>
|
|
101
101
|
</div>`,HeaderRowContainerComp=class extends Component{constructor(e){super(),this.eCenterContainer=RefPlaceholder,this.headerRowComps={},this.rowCompsList=[],this.pinned=e}postConstruct(){this.selectAndSetTemplate();const e={setDisplayed:i=>this.setDisplayed(i),setCtrls:i=>this.setCtrls(i),setCenterWidth:i=>this.eCenterContainer.style.width=i,setViewportScrollLeft:i=>this.getGui().scrollLeft=i,setPinnedContainerWidth:i=>{const s=this.getGui();s.style.width=i,s.style.maxWidth=i,s.style.minWidth=i}};this.createManagedBean(new HeaderRowContainerCtrl(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e=this.pinned=="left",t=this.pinned=="right",i=e?PINNED_LEFT_TEMPLATE:t?PINNED_RIGHT_TEMPLATE:CENTER_TEMPLATE;this.setTemplate(i),this.eRowContainer=this.eCenterContainer!==RefPlaceholder?this.eCenterContainer:this.getGui()}destroy(){this.setCtrls([]),super.destroy()}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const t=this.headerRowComps;this.headerRowComps={},this.rowCompsList=[];let i;const s=o=>{const r=o.getGui();r.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(r),i&&_ensureDomOrder(this.eRowContainer,r,i),i=r};e.forEach(o=>{const r=o.getInstanceId(),n=t[r];delete t[r];const l=n||this.createBean(new HeaderRowComp(o));this.headerRowComps[r]=l,this.rowCompsList.push(l),s(l)}),_getAllValuesInObject(t).forEach(o=>this.destroyRowComp(o))}},GridHeaderComp=class extends Component{constructor(){super('<div class="ag-header" role="presentation"/>')}postConstruct(){const e={addOrRemoveCssClass:(s,o)=>this.addOrRemoveCssClass(s,o),setHeightAndMinHeight:s=>{this.getGui().style.height=s,this.getGui().style.minHeight=s}};this.createManagedBean(new GridHeaderCtrl).setComp(e,this.getGui(),this.getFocusableElement());const i=s=>{this.createManagedBean(s),this.appendChild(s)};i(new HeaderRowContainerComp("left")),i(new HeaderRowContainerComp(null)),i(new HeaderRowContainerComp("right"))}},GridHeaderSelector={selector:"AG-HEADER-ROOT",component:GridHeaderComp},LayoutCssClasses=(e=>(e.AUTO_HEIGHT="ag-layout-auto-height",e.NORMAL="ag-layout-normal",e.PRINT="ag-layout-print",e))(LayoutCssClasses||{}),LayoutFeature=class extends BeanStub{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:e==="autoHeight",normal:e==="normal",print:e==="print"},i=t.autoHeight?"ag-layout-auto-height":t.print?"ag-layout-print":"ag-layout-normal";this.view.updateLayoutClasses(i,t)}getDomLayout(){const e=this.gos.get("domLayout")??"normal";return["normal","print","autoHeight"].indexOf(e)===-1?(_warnOnce(`${e} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"normal"):e}},OverlayWrapperComponent=class extends Component{constructor(){super(`
|
|
102
102
|
<div class="ag-overlay" role="presentation">
|
|
@@ -113,10 +113,10 @@ For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG
|
|
|
113
113
|
<div class="ag-body-vertical-scroll-viewport" data-ref="eViewport">
|
|
114
114
|
<div class="ag-body-vertical-scroll-container" data-ref="eContainer"></div>
|
|
115
115
|
</div>
|
|
116
|
-
</div>`,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new SetHeightFeature(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this)})}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.gos.getScrollbarWidth()||0,s=i===0&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),_setFixedWidth(this.getGui(),s),_setFixedWidth(this.eViewport,s),_setFixedWidth(this.eContainer,s),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,i=e.getGridBodyCtrl().getBodyViewportElement(),s=this.getScrollPosition(),o=i.scrollTop;s!=o&&this.setScrollPosition(o,!0)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e,t){!t&&!_isVisible(this.getViewport())&&this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}},FakeVScrollSelector={selector:"AG-FAKE-VERTICAL-SCROLL",component:FakeVScrollComp},GridBodyScrollFeature=class extends BeanStub{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=_debounce(()=>this.lastScrollSource[1]=null,500),this.resetLastVScrollDebounced=_debounce(()=>this.lastScrollSource[0]=null,500)}wireBeans(e){this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.rowModel=e.rowModel,this.heightScaler=e.rowContainerHeightService,this.rowRenderer=e.rowRenderer,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)}),this.ctrlsService.whenReady(e=>{this.centerRowsCtrl=e.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){const{fakeHScrollComp:e,fakeVScrollComp:t}=this.ctrlsService.getParams();this.addManagedElementListeners(this.centerRowsCtrl.getViewportElement(),{scroll:this.onHScroll.bind(this)}),e.onScrollCallback(this.onFakeHScroll.bind(this));const i=this.gos.get("debounceVerticalScrollbar"),s=i?_debounce(this.onVScroll.bind(this),100):this.onVScroll.bind(this),o=i?_debounce(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedElementListeners(this.eBodyViewport,{scroll:s}),t.onScrollCallback(o)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(this.centerRowsCtrl==null)return;e===void 0&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft());const i=this.enableRtl?e:-e,{topCenter:s,stickyTopCenter:o,stickyBottomCenter:r,centerHeader:n,bottomCenter:l,fakeHScrollComp:a}=this.ctrlsService.getParams();n.setHorizontalScroll(-i),l.setContainerTranslateX(i),s.setContainerTranslateX(i),o.setContainerTranslateX(i),r.setContainerTranslateX(i);const d=this.centerRowsCtrl.getViewportElement(),h=this.lastScrollSource[1]===0;e=Math.abs(e),h?a.setScrollPosition(e):_setScrollLeft(d,e,this.enableRtl)}isControllingScroll(e,t){return this.lastScrollSource[t]==null?(this.lastScrollSource[t]=e,!0):this.lastScrollSource[t]===e}onFakeHScroll(){this.isControllingScroll(1,1)&&this.onHScrollCommon(1)}onHScroll(){this.isControllingScroll(0,1)&&this.onHScrollCommon(0)}onHScrollCommon(e){const t=this.centerRowsCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(1,i,!0))return;let s;e===0?s=_getScrollLeft(t,this.enableRtl):s=this.ctrlsService.get("fakeHScrollComp").getScrollPosition(),this.doHorizontalScroll(Math.round(s)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(1,0)&&this.onVScrollCommon(1)}onVScroll(){this.isControllingScroll(0,0)&&this.onVScrollCommon(0)}onVScrollCommon(e){let t;e===0?t=this.eBodyViewport.scrollTop:t=this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),!this.shouldBlockScrollUpdate(0,t,!0)&&(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,e===0?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:"bodyScroll",direction:e===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{const i={...t,type:"bodyScrollEnd"};this.eventService.dispatchEvent(i)},100)}shouldBlockScrollUpdate(e,t,i=!1){return i&&!_isIOSUserAgent()?!1:e===0?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t)}shouldBlockVerticalScroll(e){const t=_getInnerHeight(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&_isRtlNegativeScroll()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(0)}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const s=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(this.enableRtl&&_isRtlNegativeScroll()?e=e>0?0:s:e=Math.min(Math.max(e,0),s)),_setScrollLeft(this.centerRowsCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){return this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight,{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let s=-1;for(let o=0;o<i;o++){const r=this.rowModel.getRow(o);if(typeof e=="function"){if(r&&e(r)){s=o;break}}else if(e===r||e===r.data){s=o;break}}s>=0&&this.ensureIndexVisible(s,t)}ensureIndexVisible(e,t){if(this.gos.isDomLayout("print"))return;const i=this.rowModel.getRowCount();if(typeof e!="number"||e<0||e>=i){_warnOnce("Invalid row index for ensureIndexVisible: "+e);return}const o=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming(()=>{o||this.paginationService?.goToPageWithIndex(e);const r=this.ctrlsService.getGridBodyCtrl(),n=r.getStickyTopHeight(),l=r.getStickyBottomHeight(),a=this.rowModel.getRow(e);let d;do{const h=a.rowTop,c=a.rowHeight,u=this.pageBoundsService.getPixelOffset(),g=a.rowTop-u,p=g+a.rowHeight,m=this.getVScrollPosition(),f=this.heightScaler.getDivStretchOffset(),v=m.top+f,C=m.bottom+f,w=C-v,y=this.heightScaler.getScrollPositionForPixel(g),F=this.heightScaler.getScrollPositionForPixel(p-w),S=Math.min((y+F)/2,g),R=v+n>g,P=C-l<p;let b=null;t==="top"?b=y:t==="bottom"?b=F:t==="middle"?b=S:R?b=y-n:P&&(b=F+l),b!==null&&(this.setVerticalScrollPosition(b),this.rowRenderer.redraw({afterScroll:!0})),d=h!==a.rowTop||c!==a.rowHeight}while(d);this.animationFrameService.flushAllFrames()})}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getCol(e);if(!i||i.isPinned()||!this.visibleColsService.isColDisplayed(i))return;const s=this.getPositionedHorizontalScroll(i,t);this.getFrameworkOverrides().wrapIncoming(()=>{s!==null&&this.centerRowsCtrl.setCenterViewportScrollLeft(s),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()})}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming(()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:s}=this.isColumnOutsideViewport(e),o=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),r=this.centerRowsCtrl.getCenterWidth(),n=this.enableRtl;let l=(n?i:s)||o,a=n?s:i;t!=="auto"&&(l=t==="start",a=t==="end");const d=t==="middle";if(l||a||d){const{colLeft:h,colMiddle:c,colRight:u}=this.getColumnBounds(e);return d?c-r/2:l?n?u:h:n?h-r:u-r}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:s,colRight:o}=this.getColumnBounds(e),r=this.enableRtl,n=r?t>o:i<o,l=r?i<s:t>s;return{columnBeforeStart:n,columnAfterEnd:l}}getColumnBounds(e){const t=this.enableRtl,i=this.visibleColsService.getBodyContainerWidth(),s=e.getActualWidth(),o=e.getLeft(),r=t?-1:1,n=t?i-o:o,l=n+s*r,a=n+s/2*r;return{colLeft:n,colMiddle:a,colRight:l}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft(),i=t,s=e+t;return{start:i,end:s,width:e}}},CSS_CLASS_FORCE_VERTICAL_SCROLL="ag-force-vertical-scroll",CSS_CLASS_CELL_SELECTABLE="ag-selectable",CSS_CLASS_COLUMN_MOVING="ag-column-moving",GridBodyCtrl=class extends BeanStub{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.menuService=e.menuService,this.headerNavigationService=e.headerNavigationService,this.dragAndDropService=e.dragAndDropService,this.pinnedRowModel=e.pinnedRowModel,this.rowRenderer=e.rowRenderer,this.popupService=e.popupService,this.mouseEventService=e.mouseEventService,this.rowModel=e.rowModel,this.filterManager=e.filterManager,this.environment=e.environment}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,s,o,r,n){this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=s,this.eBottom=o,this.eStickyTop=r,this.eStickyBottom=n,this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",l=>this.setCellTextSelection(l.currentValue)),this.createManagedBean(new LayoutFeature(this.comp)),this.bodyScrollFeature=this.createManagedBean(new GridBodyScrollFeature(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,i,o,r,n]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager?.setupAdvancedFilterHeaderComp(s),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),pinnedRowDataChanged:this.setFloatingHeights.bind(this),pinnedHeightChanged:this.setFloatingHeights.bind(this),headerHeightChanged:this.onHeaderHeightChanged.bind(this)})}addFocusListeners(e){e.forEach(t=>{this.addManagedElementListeners(t,{focusin:i=>{const{target:s}=i,o=_isElementChildOfClass(s,"ag-root",t);t.classList.toggle("ag-has-focus",!o)},focusout:i=>{const{target:s,relatedTarget:o}=i,r=t.contains(o),n=_isElementChildOfClass(o,"ag-root",t);_isElementChildOfClass(s,"ag-root",t)||(!r||n)&&t.classList.remove("ag-has-focus")}})})}setColumnMovingCss(e){this.comp.setColumnMovingCss(CSS_CLASS_COLUMN_MOVING,e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss(CSS_CLASS_CELL_SELECTABLE,e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyWidth(e),this.setStickyBottomOffsetBottom();const t=e&&this.gos.getScrollbarWidth()||0,i=_isInvisibleScrollbar()?16:0,s=`calc(100% + ${t+i}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(s))}onGridColumnsChanged(){const e=this.columnModel.getCols();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const e=i=>{const s=i.relatedTarget;if(_getTabIndex(s)===null){this.rowRenderer.stopEditing();return}let o=t.some(r=>r.contains(s))&&this.mouseEventService.isElementInThisGrid(s);if(!o){const r=this.popupService;o=r.getActivePopups().some(n=>n.contains(s))||r.isElementWithinCustomPopup(s)}o||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];t.forEach(i=>this.addManagedElementListeners(i,{focusout:e}))}updateRowCount(){const e=this.headerNavigationService.getHeaderRowCount()+(this.filterManager?.getHeaderRowCount()??0),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,i=t===-1?-1:e+t;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gos.get("alwaysShowVerticalScroll"),t=e?CSS_CLASS_FORCE_VERTICAL_SCROLL:null,i=this.gos.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&_isVerticalScrollShowing(this.eBodyViewport)}setupRowAnimationCssClass(){let e=this.environment.hasMeasuredSizes();const t=()=>{const i=e&&this.gos.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),s=i?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(s,i)};t(),this.addManagedEventListeners({heightScaleChanged:t}),this.addManagedPropertyListener("animateRows",t),this.addManagedEventListeners({gridStylesChanged:()=>{!e&&this.environment.hasMeasuredSizes()&&(e=!0,t())}})}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(this.eBodyViewport,{contextmenu:e}),this.mockContextMenuForIPad(e),this.addManagedElementListeners(this.eBodyViewport,{wheel:this.onBodyViewportWheel.bind(this)}),this.addManagedElementListeners(this.eStickyTop,{wheel:this.onStickyWheel.bind(this)}),this.addManagedElementListeners(this.eStickyBottom,{wheel:this.onStickyWheel.bind(this)}),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const e=this.eBodyViewport.querySelector(".ag-full-width-container"),t=this.eBodyViewport.querySelector(".ag-center-cols-viewport");e&&t&&this.addManagedElementListeners(e,{wheel:i=>this.onFullWidthContainerWheel(i,t)})}onFullWidthContainerWheel(e,t){!e.deltaX||Math.abs(e.deltaY)>Math.abs(e.deltaX)||!this.mouseEventService.isEventFromThisGrid(e)||(e.preventDefault(),t.scrollBy({left:e.deltaX}))}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;this.gos.get("preventDefaultOnContextMenu")&&(e||i).preventDefault();const{target:s}=e||t;(s===this.eBodyViewport||s===this.ctrlsService.get("center").getViewportElement())&&this.menuService.showContextMenu({mouseEvent:e,touchEvent:i,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!_isIOSUserAgent())return;const t=new TouchListener(this.eBodyViewport),i=s=>{e(void 0,s.touchStart,s.touchEvent)};this.addManagedListeners(t,{longTap:i}),this.addDestroyFunc(()=>t.destroy())}onBodyViewportWheel(e){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}onStickyWheel(e){e.preventDefault(),e.offsetY&&this.scrollVertically(e.deltaY)}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new RowDragFeature(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}setFloatingHeights(){const{pinnedRowModel:e}=this,t=e.getPinnedTopTotalHeight(),i=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(e){if(!e)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{const t=this.gos.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${t}px)`)}}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const t=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+(this.filterManager?.getHeaderHeight()??0),i=this.pinnedRowModel.getPinnedTopTotalHeight();let s=0;t>0&&(s+=t),i>0&&(s+=i),s>0&&(s+=1),this.comp.setStickyTopTop(`${s}px`)}setStickyBottomOffsetBottom(){const e=this.pinnedRowModel.getPinnedBottomTotalHeight(),i=this.scrollVisibleService.isHorizontalScrollShowing()&&this.gos.getScrollbarWidth()||0,s=e+i;this.comp.setStickyBottomBottom(`${s}px`)}sizeColumnsToFit(e,t){const s=this.isVerticalScrollShowing()?this.gos.getScrollbarWidth():0,r=_getInnerWidth(this.eGridBody)-s;if(r>0){this.columnSizeService.sizeColumnsToFit(r,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFit(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFit(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFit(e,-1)},500):_warnOnce("tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}},CellComp=class extends Component{constructor(e,t,i,s,o){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=s,this.cellCtrl=t;const r=document.createElement("div");r.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(r);const n=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const l=(h,c)=>{c!=null&&c!=""?n.setAttribute(h,c):n.removeAttribute(h)};_setAriaRole(n,t.getCellAriaRole()),l("col-id",t.getColumnIdSanitised());const a=t.getTabIndex();a!==void 0&&l("tabindex",a.toString());const d={addOrRemoveCssClass:(h,c)=>this.addOrRemoveCssClass(h,c),setUserStyles:h=>_addStylesToElement(n,h),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:h=>this.includeSelection=h,setIncludeRowDrag:h=>this.includeRowDrag=h,setIncludeDndSource:h=>this.includeDndSource=h,setRenderDetails:(h,c,u)=>this.setRenderDetails(h,c,u),setEditDetails:(h,c,u)=>this.setEditDetails(h,c,u),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(d,this.getGui(),this.eCellWrapper,i,o)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;const o=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!(i||o)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t))}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,s=i&&this.eCellWrapper==null;if(s){const d=document.createElement("div");d.setAttribute("role","presentation"),d.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=d,this.getGui().appendChild(this.eCellWrapper)}const o=!i&&this.eCellWrapper!=null;o&&(_removeFromParent(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const r=!e&&i,n=r&&this.eCellValue==null;if(n){const d=document.createElement("span");d.setAttribute("role","presentation"),d.setAttribute("class","ag-cell-value"),this.eCellValue=d,this.eCellWrapper.appendChild(this.eCellValue)}const l=!r&&this.eCellValue!=null;l&&(_removeFromParent(this.eCellValue),this.eCellValue=void 0);const a=s||o||n||l;return a&&this.removeControls(),e||t&&this.addControls(),a}addControls(){this.includeRowDrag&&this.rowDraggingComp==null&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&this.dndSourceComp==null&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,i){const s=this.editorVersion,o=e.newAgStackInstance();if(o==null)return;const{params:r}=e;o.then(l=>this.afterCellEditorCreated(s,l,r,t,i)),_missing(this.cellEditor)&&r.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();_clearElement(t);const i=e!=null?_escapeString(e,!0):null;i!=null&&(t.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),_removeFromParent(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),_removeFromParent(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(this.cellRenderer==null||this.cellRenderer.refresh==null||this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return t===!0||t===void 0}createCellRendererInstance(e){const i=!this.beans.gos.get("suppressAnimationFrame"),s=this.rendererVersion,{componentClass:o}=e,r=()=>{if(this.rendererVersion!==s||!this.isAlive())return;const l=e.newAgStackInstance(),a=this.afterCellRendererCreated.bind(this,s,o);l&&l.then(a)};i&&this.firstRender?this.beans.animationFrameService.createTask(r,this.rowNode.rowIndex,"createTasksP2"):r()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(!this.isAlive()||e!==this.rendererVersion){this.beans.context.destroyBean(i);return}if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),this.cellRendererGui!=null){const o=this.getParentOfValue();_clearElement(o),o.appendChild(this.cellRendererGui)}}afterCellEditorCreated(e,t,i,s,o){if(e!==this.editorVersion){this.beans.context.destroyBean(t);return}if(t.isCancelBeforeStart&&t.isCancelBeforeStart()){this.beans.context.destroyBean(t),this.cellCtrl.stopEditing(!0);return}if(!t.getGui){_warnOnce(`cellEditor for column ${this.column.getId()} is missing getGui() method`),this.beans.context.destroyBean(t);return}this.cellEditor=t,this.cellEditorGui=t.getGui();const l=s||t.isPopup!==void 0&&t.isPopup();l?this.addPopupCellEditor(i,o):this.addInCellEditor(),this.refreshEditStyles(!0,l),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),this.rowCtrl?.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){this.beans.gos.get("editType")==="fullRow"&&_warnOnce("popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(this.beans.editService.createPopupEditorWrapper(e));const s=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&s.appendChild(this.cellEditorGui);const o=this.beans.popupService,r=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),n=t??(i.getPopupPosition?i.getPopupPosition():"over"),l=this.beans.gos.get("enableRtl"),a={ePopup:s,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:n,alignSide:l?"right":"left",keepWithinBounds:!0},d=o.positionPopupByComponent.bind(o,a),h=this.beans.localeService.getLocaleTextFunc(),c=o.addPopup({modal:r,eChild:s,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:d,ariaLabel:h("ariaLabelCellEditor","Cell Editor")});c&&(this.hideEditorPopup=c.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&_browserSupportsPreventScroll()&&e.focus({preventScroll:!0}),_clearElement(this.getParentOfValue())}},RowComp=class extends Component{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const s=document.createElement("div");s.setAttribute("comp-id",`${this.getCompId()}`),s.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(s);const o=this.getGui(),r=o.style;this.domOrder=this.rowCtrl.getDomOrder(),_setAriaRole(o,"row");const n=this.rowCtrl.getTabIndex();n!=null&&o.setAttribute("tabindex",n.toString());const l={setDomOrder:a=>this.domOrder=a,setCellCtrls:a=>this.setCellCtrls(a),showFullWidth:a=>this.showFullWidth(a),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(a,d)=>this.addOrRemoveCssClass(a,d),setUserStyles:a=>_addStylesToElement(o,a),setTop:a=>r.top=a,setTransform:a=>r.transform=a,setRowIndex:a=>o.setAttribute("row-index",a),setRowId:a=>o.setAttribute("row-id",a),setRowBusinessKey:a=>o.setAttribute("row-business-key",a),refreshFullWidth:a=>this.refreshFullWidth(a)};e.setComp(l,this.getGui(),i),this.addDestroyFunc(()=>{e.unsetComp(i)})}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=s=>{if(this.isAlive()){const o=s.getGui();this.getGui().appendChild(o),this.rowCtrl.setupDetailRowAutoHeight(o),this.setFullWidthRowComp(s)}else this.beans.context.destroyBean(s)},i=e.newAgStackInstance();i&&i.then(t)}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach(s=>{const o=s.getInstanceId();this.cellComps[o]==null?this.newCellComp(s):t[o]=null});const i=_getAllValuesInObject(t).filter(s=>s!=null);this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach(i=>{const s=this.cellComps[i.getInstanceId()];s&&t.push(s.getGui())}),_setDomChildOrder(this.getGui(),t)}newCellComp(e){const t=new CellComp(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.getInstanceId()]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=_getAllValuesInObject(this.cellComps).filter(t=>t!=null);this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&_errorOnce("should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)})}getFullWidthCellRenderer(){return this.fullWidthCellRenderer}destroyCells(e){e.forEach(t=>{if(!t)return;const i=t.getCtrl().getInstanceId();this.cellComps[i]===t&&(t.detach(),t.destroy(),this.cellComps[i]=null)})}refreshFullWidth(e){const{fullWidthCellRenderer:t}=this;if(!t||!t.refresh)return!1;const i=e();return t.refresh(i)}},ViewportSizeFeature=class extends BeanStub{wireBeans(e){this.ctrlsService=e.ctrlsService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.columnViewportService=e.columnViewportService}constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnSizeService.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const e=this.gridBodyCtrl.getBodyViewportElement(),t=_getInnerWidth(e);if(t<=50)return;let i=this.getPinnedColumnsOverflowingViewport(t-50);const s=this.gos.getCallback("processUnpinnedColumns");i.length&&(s&&(i=s({columns:i,viewportWidth:t})),this.columnModel.setColsPinned(i,null,"viewportSizeFeature"))}getPinnedColumnsOverflowingViewport(e){const t=this.pinnedWidthService.getPinnedRightWidth(),i=this.pinnedWidthService.getPinnedLeftWidth(),s=t+i;if(s<e)return[];const o=[...this.visibleColsService.getLeftCols()],r=[...this.visibleColsService.getRightCols()];let n=0,l=0;const a=0,d=[];let h=s-a-e;for(;(l<o.length||n<r.length)&&h>0;){if(n<r.length){const c=r[n++];h-=c.getActualWidth(),d.push(c)}if(l<o.length&&h>0){const c=o[l++];h-=c.getActualWidth(),d.push(c)}}return d}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=this.gridBodyCtrl.getBodyViewportElement(),t=_getInnerHeight(e);if(this.bodyHeight!==t){this.bodyHeight=t;const i={type:"bodyHeightChanged"};this.eventService.dispatchEvent(i)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnViewportService.setScrollPosition(e,t)}},DragListenerFeature=class extends BeanStub{wireBeans(e){this.dragService=e.dragService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){if(!this.rangeService)return;this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListener("enableRangeSelection",t=>{if(t.currentValue){this.enableFeature();return}this.disableFeature()}),this.addDestroyFunc(()=>this.disableFeature()),this.gos.get("enableRangeSelection")&&this.enableFeature()}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}},CheckboxSelectionComponent=class extends Component{constructor(){super(`
|
|
116
|
+
</div>`,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new SetHeightFeature(this.eContainer)),this.ctrlsService.register("fakeVScrollComp",this),this.addManagedEventListeners({rowContainerHeightChanged:this.onRowContainerHeightChanged.bind(this)})}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.gos.getScrollbarWidth()||0,s=i===0&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),_setFixedWidth(this.getGui(),s),_setFixedWidth(this.eViewport,s),_setFixedWidth(this.eContainer,s),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const{ctrlsService:e}=this,i=e.getGridBodyCtrl().getBodyViewportElement(),s=this.getScrollPosition(),o=i.scrollTop;s!=o&&this.setScrollPosition(o,!0)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e,t){!t&&!_isVisible(this.getViewport())&&this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}},FakeVScrollSelector={selector:"AG-FAKE-VERTICAL-SCROLL",component:FakeVScrollComp},GridBodyScrollFeature=class extends BeanStub{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.lastOffsetHeight=-1,this.lastScrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=_debounce(()=>this.lastScrollSource[1]=null,500),this.resetLastVScrollDebounced=_debounce(()=>this.lastScrollSource[0]=null,500)}wireBeans(e){this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.rowModel=e.rowModel,this.heightScaler=e.rowContainerHeightService,this.rowRenderer=e.rowRenderer,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.addManagedEventListeners({displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)}),this.ctrlsService.whenReady(e=>{this.centerRowsCtrl=e.center,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){const{fakeHScrollComp:e,fakeVScrollComp:t}=this.ctrlsService.getParams();this.addManagedElementListeners(this.centerRowsCtrl.getViewportElement(),{scroll:this.onHScroll.bind(this)}),e.onScrollCallback(this.onFakeHScroll.bind(this));const i=this.gos.get("debounceVerticalScrollbar"),s=i?_debounce(this.onVScroll.bind(this),100):this.onVScroll.bind(this),o=i?_debounce(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedElementListeners(this.eBodyViewport,{scroll:s}),t.onScrollCallback(o)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(this.centerRowsCtrl==null)return;e===void 0&&(e=this.centerRowsCtrl.getCenterViewportScrollLeft());const i=this.enableRtl?e:-e,{topCenter:s,stickyTopCenter:o,stickyBottomCenter:r,centerHeader:n,bottomCenter:l,fakeHScrollComp:a}=this.ctrlsService.getParams();n.setHorizontalScroll(-i),l.setContainerTranslateX(i),s.setContainerTranslateX(i),o.setContainerTranslateX(i),r.setContainerTranslateX(i);const d=this.centerRowsCtrl.getViewportElement(),h=this.lastScrollSource[1]===0;e=Math.abs(e),h?a.setScrollPosition(e):_setScrollLeft(d,e,this.enableRtl)}isControllingScroll(e,t){return this.lastScrollSource[t]==null?(this.lastScrollSource[t]=e,!0):this.lastScrollSource[t]===e}onFakeHScroll(){this.isControllingScroll(1,1)&&this.onHScrollCommon(1)}onHScroll(){this.isControllingScroll(0,1)&&this.onHScrollCommon(0)}onHScrollCommon(e){const t=this.centerRowsCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(1,i,!0))return;let s;e===0?s=_getScrollLeft(t,this.enableRtl):s=this.ctrlsService.get("fakeHScrollComp").getScrollPosition(),this.doHorizontalScroll(Math.round(s)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(1,0)&&this.onVScrollCommon(1)}onVScroll(){this.isControllingScroll(0,0)&&this.onVScrollCommon(0)}onVScrollCommon(e){let t;e===0?t=this.eBodyViewport.scrollTop:t=this.ctrlsService.get("fakeVScrollComp").getScrollPosition(),!this.shouldBlockScrollUpdate(0,t,!0)&&(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,e===0?this.ctrlsService.get("fakeVScrollComp").setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gos.get("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.get("fakeHScrollComp").getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(1),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowsCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:"bodyScroll",direction:e===1?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{const i={...t,type:"bodyScrollEnd"};this.eventService.dispatchEvent(i)},100)}shouldBlockScrollUpdate(e,t,i=!1){return i&&!_isIOSUserAgent()?!1:e===0?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t)}shouldBlockVerticalScroll(e){const t=_getInnerHeight(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowsCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowsCtrl.getViewportElement();if(this.enableRtl&&_isRtlNegativeScroll()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(0)}checkScrollLeft(){this.scrollLeft!==this.centerRowsCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(0)}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const s=this.centerRowsCtrl.getViewportElement().scrollWidth-this.centerRowsCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(1,e)&&(this.enableRtl&&_isRtlNegativeScroll()?e=e>0?0:s:e=Math.min(Math.max(e,0),s)),_setScrollLeft(this.centerRowsCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){return this.lastScrollTop=this.eBodyViewport.scrollTop,this.lastOffsetHeight=this.eBodyViewport.offsetHeight,{top:this.lastScrollTop,bottom:this.lastScrollTop+this.lastOffsetHeight}}getApproximateVScollPosition(){return this.lastScrollTop>=0&&this.lastOffsetHeight>=0?{top:this.scrollTop,bottom:this.scrollTop+this.lastOffsetHeight}:this.getVScrollPosition()}getHScrollPosition(){return this.centerRowsCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowsCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowsCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowsCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let s=-1;for(let o=0;o<i;o++){const r=this.rowModel.getRow(o);if(typeof e=="function"){if(r&&e(r)){s=o;break}}else if(e===r||e===r.data){s=o;break}}s>=0&&this.ensureIndexVisible(s,t)}ensureIndexVisible(e,t){if(this.gos.isDomLayout("print"))return;const i=this.rowModel.getRowCount();if(typeof e!="number"||e<0||e>=i){_warnOnce("Invalid row index for ensureIndexVisible: "+e);return}const o=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.getFrameworkOverrides().wrapIncoming(()=>{o||this.paginationService?.goToPageWithIndex(e);const r=this.ctrlsService.getGridBodyCtrl(),n=r.getStickyTopHeight(),l=r.getStickyBottomHeight(),a=this.rowModel.getRow(e);let d;do{const h=a.rowTop,c=a.rowHeight,u=this.pageBoundsService.getPixelOffset(),g=a.rowTop-u,p=g+a.rowHeight,f=this.getVScrollPosition(),m=this.heightScaler.getDivStretchOffset(),C=f.top+m,v=f.bottom+m,w=v-C,y=this.heightScaler.getScrollPositionForPixel(g),F=this.heightScaler.getScrollPositionForPixel(p-w),S=Math.min((y+F)/2,g),R=C+n>g,P=v-l<p;let b=null;t==="top"?b=y:t==="bottom"?b=F:t==="middle"?b=S:R?b=y-n:P&&(b=F+l),b!==null&&(this.setVerticalScrollPosition(b),this.rowRenderer.redraw({afterScroll:!0})),d=h!==a.rowTop||c!==a.rowHeight}while(d);this.animationFrameService.flushAllFrames()})}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getCol(e);if(!i||i.isPinned()||!this.visibleColsService.isColDisplayed(i))return;const s=this.getPositionedHorizontalScroll(i,t);this.getFrameworkOverrides().wrapIncoming(()=>{s!==null&&this.centerRowsCtrl.setCenterViewportScrollLeft(s),this.centerRowsCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()})}setScrollPosition(e,t){this.getFrameworkOverrides().wrapIncoming(()=>{this.centerRowsCtrl.setCenterViewportScrollLeft(t),this.setVerticalScrollPosition(e),this.rowRenderer.redraw({afterScroll:!0}),this.animationFrameService.flushAllFrames()})}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:s}=this.isColumnOutsideViewport(e),o=this.centerRowsCtrl.getCenterWidth()<e.getActualWidth(),r=this.centerRowsCtrl.getCenterWidth(),n=this.enableRtl;let l=(n?i:s)||o,a=n?s:i;t!=="auto"&&(l=t==="start",a=t==="end");const d=t==="middle";if(l||a||d){const{colLeft:h,colMiddle:c,colRight:u}=this.getColumnBounds(e);return d?c-r/2:l?n?u:h:n?h-r:u-r}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:s,colRight:o}=this.getColumnBounds(e),r=this.enableRtl,n=r?t>o:i<o,l=r?i<s:t>s;return{columnBeforeStart:n,columnAfterEnd:l}}getColumnBounds(e){const t=this.enableRtl,i=this.visibleColsService.getBodyContainerWidth(),s=e.getActualWidth(),o=e.getLeft(),r=t?-1:1,n=t?i-o:o,l=n+s*r,a=n+s/2*r;return{colLeft:n,colMiddle:a,colRight:l}}getViewportBounds(){const e=this.centerRowsCtrl.getCenterWidth(),t=this.centerRowsCtrl.getCenterViewportScrollLeft(),i=t,s=e+t;return{start:i,end:s,width:e}}},CSS_CLASS_FORCE_VERTICAL_SCROLL="ag-force-vertical-scroll",CSS_CLASS_CELL_SELECTABLE="ag-selectable",CSS_CLASS_COLUMN_MOVING="ag-column-moving",GridBodyCtrl=class extends BeanStub{constructor(){super(...arguments),this.stickyTopHeight=0,this.stickyBottomHeight=0}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.menuService=e.menuService,this.headerNavigationService=e.headerNavigationService,this.dragAndDropService=e.dragAndDropService,this.pinnedRowModel=e.pinnedRowModel,this.rowRenderer=e.rowRenderer,this.popupService=e.popupService,this.mouseEventService=e.mouseEventService,this.rowModel=e.rowModel,this.filterManager=e.filterManager,this.environment=e.environment}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,s,o,r,n){this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=s,this.eBottom=o,this.eStickyTop=r,this.eStickyBottom=n,this.setCellTextSelection(this.gos.get("enableCellTextSelection")),this.addManagedPropertyListener("enableCellTextSelection",l=>this.setCellTextSelection(l.currentValue)),this.createManagedBean(new LayoutFeature(this.comp)),this.bodyScrollFeature=this.createManagedBean(new GridBodyScrollFeature(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,i,o,r,n]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager?.setupAdvancedFilterHeaderComp(s),this.ctrlsService.register("gridBodyCtrl",this)}getComp(){return this.comp}addEventListeners(){this.addManagedEventListeners({gridColumnsChanged:this.onGridColumnsChanged.bind(this),scrollVisibilityChanged:this.onScrollVisibilityChanged.bind(this),pinnedRowDataChanged:this.setFloatingHeights.bind(this),pinnedHeightChanged:this.setFloatingHeights.bind(this),headerHeightChanged:this.onHeaderHeightChanged.bind(this)})}addFocusListeners(e){e.forEach(t=>{this.addManagedElementListeners(t,{focusin:i=>{const{target:s}=i,o=_isElementChildOfClass(s,"ag-root",t);t.classList.toggle("ag-has-focus",!o)},focusout:i=>{const{target:s,relatedTarget:o}=i,r=t.contains(o),n=_isElementChildOfClass(o,"ag-root",t);_isElementChildOfClass(s,"ag-root",t)||(!r||n)&&t.classList.remove("ag-has-focus")}})})}setColumnMovingCss(e){this.comp.setColumnMovingCss(CSS_CLASS_COLUMN_MOVING,e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss(CSS_CLASS_CELL_SELECTABLE,e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyWidth(e),this.setStickyBottomOffsetBottom();const t=e&&this.gos.getScrollbarWidth()||0,i=_isInvisibleScrollbar()?16:0,s=`calc(100% + ${t+i}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(s))}onGridColumnsChanged(){const e=this.columnModel.getCols();this.comp.setColumnCount(e.length)}disableBrowserDragging(){this.addManagedElementListeners(this.eGridBody,{dragstart:e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1}})}addStopEditingWhenGridLosesFocus(){if(!this.gos.get("stopEditingWhenCellsLoseFocus"))return;const e=i=>{const s=i.relatedTarget;if(_getTabIndex(s)===null){this.rowRenderer.stopEditing();return}let o=t.some(r=>r.contains(s))&&this.mouseEventService.isElementInThisGrid(s);if(!o){const r=this.popupService;o=r.getActivePopups().some(n=>n.contains(s))||r.isElementWithinCustomPopup(s)}o||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop,this.eStickyBottom];t.forEach(i=>this.addManagedElementListeners(i,{focusout:e}))}updateRowCount(){const e=this.headerNavigationService.getHeaderRowCount()+(this.filterManager?.getHeaderRowCount()??0),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,i=t===-1?-1:e+t;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gos.get("alwaysShowVerticalScroll"),t=e?CSS_CLASS_FORCE_VERTICAL_SCROLL:null,i=this.gos.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&_isVerticalScrollShowing(this.eBodyViewport)}setupRowAnimationCssClass(){let e=this.environment.hasMeasuredSizes();const t=()=>{const i=e&&this.gos.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),s=i?"ag-row-animation":"ag-row-no-animation";this.comp.setRowAnimationCssOnBodyViewport(s,i)};t(),this.addManagedEventListeners({heightScaleChanged:t}),this.addManagedPropertyListener("animateRows",t),this.addManagedEventListeners({gridStylesChanged:()=>{!e&&this.environment.hasMeasuredSizes()&&(e=!0,t())}})}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedElementListeners(this.eBodyViewport,{contextmenu:e}),this.mockContextMenuForIPad(e),this.addManagedElementListeners(this.eBodyViewport,{wheel:this.onBodyViewportWheel.bind(this)}),this.addManagedElementListeners(this.eStickyTop,{wheel:this.onStickyWheel.bind(this)}),this.addManagedElementListeners(this.eStickyBottom,{wheel:this.onStickyWheel.bind(this)}),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const e=this.eBodyViewport.querySelector(".ag-full-width-container"),t=this.eBodyViewport.querySelector(".ag-center-cols-viewport");e&&t&&this.addManagedElementListeners(e,{wheel:i=>this.onFullWidthContainerWheel(i,t)})}onFullWidthContainerWheel(e,t){!e.deltaX||Math.abs(e.deltaY)>Math.abs(e.deltaX)||!this.mouseEventService.isEventFromThisGrid(e)||(e.preventDefault(),t.scrollBy({left:e.deltaX}))}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;this.gos.get("preventDefaultOnContextMenu")&&(e||i).preventDefault();const{target:s}=e||t;(s===this.eBodyViewport||s===this.ctrlsService.get("center").getViewportElement())&&this.menuService.showContextMenu({mouseEvent:e,touchEvent:i,value:null,anchorToElement:this.eGridBody})}mockContextMenuForIPad(e){if(!_isIOSUserAgent())return;const t=new TouchListener(this.eBodyViewport),i=s=>{e(void 0,s.touchStart,s.touchEvent)};this.addManagedListeners(t,{longTap:i}),this.addDestroyFunc(()=>t.destroy())}onBodyViewportWheel(e){this.gos.get("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}onStickyWheel(e){e.preventDefault(),e.offsetY&&this.scrollVertically(e.deltaY)}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new RowDragFeature(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}setFloatingHeights(){const{pinnedRowModel:e}=this,t=e.getPinnedTopTotalHeight(),i=e.getPinnedBottomTotalHeight();this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop(),this.setStickyBottomOffsetBottom()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(`${e}px`),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyBottomHeight(e=0){this.comp.setStickyBottomHeight(`${e}px`),this.stickyBottomHeight=e}getStickyBottomHeight(){return this.stickyBottomHeight}setStickyWidth(e){if(!e)this.comp.setStickyTopWidth("100%"),this.comp.setStickyBottomWidth("100%");else{const t=this.gos.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${t}px)`),this.comp.setStickyBottomWidth(`calc(100% - ${t}px)`)}}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const t=this.ctrlsService.get("gridHeaderCtrl").getHeaderHeight()+(this.filterManager?.getHeaderHeight()??0),i=this.pinnedRowModel.getPinnedTopTotalHeight();let s=0;t>0&&(s+=t),i>0&&(s+=i),s>0&&(s+=1),this.comp.setStickyTopTop(`${s}px`)}setStickyBottomOffsetBottom(){const e=this.pinnedRowModel.getPinnedBottomTotalHeight(),i=this.scrollVisibleService.isHorizontalScrollShowing()&&this.gos.getScrollbarWidth()||0,s=e+i;this.comp.setStickyBottomBottom(`${s}px`)}sizeColumnsToFit(e,t){const s=this.isVerticalScrollShowing()?this.gos.getScrollbarWidth():0,r=_getInnerWidth(this.eGridBody)-s;if(r>0){this.columnSizeService.sizeColumnsToFit(r,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFit(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFit(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFit(e,-1)},500):_warnOnce("tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}},CellComp=class extends Component{constructor(e,t,i,s,o){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=s,this.cellCtrl=t;const r=document.createElement("div");r.setAttribute("comp-id",`${this.getCompId()}`),this.setTemplateFromElement(r);const n=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const l=(h,c)=>{c!=null&&c!=""?n.setAttribute(h,c):n.removeAttribute(h)};_setAriaRole(n,t.getCellAriaRole()),l("col-id",t.getColumnIdSanitised());const a=t.getTabIndex();a!==void 0&&l("tabindex",a.toString());const d={addOrRemoveCssClass:(h,c)=>this.addOrRemoveCssClass(h,c),setUserStyles:h=>_addStylesToElement(n,h),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:h=>this.includeSelection=h,setIncludeRowDrag:h=>this.includeRowDrag=h,setIncludeDndSource:h=>this.includeDndSource=h,setRenderDetails:(h,c,u)=>this.setRenderDetails(h,c,u),setEditDetails:(h,c,u)=>this.setEditDetails(h,c,u),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(d,this.getGui(),this.eCellWrapper,i,o)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=this.firstRender==null;const o=this.refreshWrapper(!1);this.refreshEditStyles(!1),e?!(i||o)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e)):(this.destroyRenderer(),this.insertValueWithoutCellRenderer(t))}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,s=i&&this.eCellWrapper==null;if(s){const d=document.createElement("div");d.setAttribute("role","presentation"),d.setAttribute("class","ag-cell-wrapper"),this.eCellWrapper=d,this.getGui().appendChild(this.eCellWrapper)}const o=!i&&this.eCellWrapper!=null;o&&(_removeFromParent(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const r=!e&&i,n=r&&this.eCellValue==null;if(n){const d=document.createElement("span");d.setAttribute("role","presentation"),d.setAttribute("class","ag-cell-value"),this.eCellValue=d,this.eCellWrapper.appendChild(this.eCellValue)}const l=!r&&this.eCellValue!=null;l&&(_removeFromParent(this.eCellValue),this.eCellValue=void 0);const a=s||o||n||l;return a&&this.removeControls(),e||t&&this.addControls(),a}addControls(){this.includeRowDrag&&this.rowDraggingComp==null&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&this.dndSourceComp==null&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&this.checkboxSelectionComp==null&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,i){const s=this.editorVersion,o=e.newAgStackInstance();if(o==null)return;const{params:r}=e;o.then(l=>this.afterCellEditorCreated(s,l,r,t,i)),_missing(this.cellEditor)&&r.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();_clearElement(t);const i=e!=null?_escapeString(e,!0):null;i!=null&&(t.textContent=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),_removeFromParent(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),_removeFromParent(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(this.cellRenderer==null||this.cellRenderer.refresh==null||this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return t===!0||t===void 0}createCellRendererInstance(e){const i=!this.beans.gos.get("suppressAnimationFrame"),s=this.rendererVersion,{componentClass:o}=e,r=()=>{if(this.rendererVersion!==s||!this.isAlive())return;const l=e.newAgStackInstance(),a=this.afterCellRendererCreated.bind(this,s,o);l&&l.then(a)};i&&this.firstRender?this.beans.animationFrameService.createTask(r,this.rowNode.rowIndex,"createTasksP2"):r()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(!this.isAlive()||e!==this.rendererVersion){this.beans.context.destroyBean(i);return}if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),this.cellRendererGui!=null){const o=this.getParentOfValue();_clearElement(o),o.appendChild(this.cellRendererGui)}}afterCellEditorCreated(e,t,i,s,o){if(e!==this.editorVersion){this.beans.context.destroyBean(t);return}if(t.isCancelBeforeStart&&t.isCancelBeforeStart()){this.beans.context.destroyBean(t),this.cellCtrl.stopEditing(!0);return}if(!t.getGui){_warnOnce(`cellEditor for column ${this.column.getId()} is missing getGui() method`),this.beans.context.destroyBean(t);return}this.cellEditor=t,this.cellEditorGui=t.getGui();const l=s||t.isPopup!==void 0&&t.isPopup();l?this.addPopupCellEditor(i,o):this.addInCellEditor(),this.refreshEditStyles(!0,l),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),this.rowCtrl?.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui&&this.getParentOfValue().appendChild(this.cellEditorGui)}addPopupCellEditor(e,t){this.beans.gos.get("editType")==="fullRow"&&_warnOnce("popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(this.beans.editService.createPopupEditorWrapper(e));const s=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&s.appendChild(this.cellEditorGui);const o=this.beans.popupService,r=this.beans.gos.get("stopEditingWhenCellsLoseFocus"),n=t??(i.getPopupPosition?i.getPopupPosition():"over"),l=this.beans.gos.get("enableRtl"),a={ePopup:s,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:n,alignSide:l?"right":"left",keepWithinBounds:!0},d=o.positionPopupByComponent.bind(o,a),h=this.beans.localeService.getLocaleTextFunc(),c=o.addPopup({modal:r,eChild:s,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:d,ariaLabel:h("ariaLabelCellEditor","Cell Editor")});c&&(this.hideEditorPopup=c.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui();e.contains(this.beans.gos.getActiveDomElement())&&_browserSupportsPreventScroll()&&e.focus({preventScroll:!0}),_clearElement(this.getParentOfValue())}},RowComp=class extends Component{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e;const s=document.createElement("div");s.setAttribute("comp-id",`${this.getCompId()}`),s.setAttribute("style",this.getInitialStyle(i)),this.setTemplateFromElement(s);const o=this.getGui(),r=o.style;this.domOrder=this.rowCtrl.getDomOrder(),_setAriaRole(o,"row");const n=this.rowCtrl.getTabIndex();n!=null&&o.setAttribute("tabindex",n.toString());const l={setDomOrder:a=>this.domOrder=a,setCellCtrls:a=>this.setCellCtrls(a),showFullWidth:a=>this.showFullWidth(a),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(a,d)=>this.addOrRemoveCssClass(a,d),setUserStyles:a=>_addStylesToElement(o,a),setTop:a=>r.top=a,setTransform:a=>r.transform=a,setRowIndex:a=>o.setAttribute("row-index",a),setRowId:a=>o.setAttribute("row-id",a),setRowBusinessKey:a=>o.setAttribute("row-business-key",a),refreshFullWidth:a=>this.refreshFullWidth(a)};e.setComp(l,this.getGui(),i),this.addDestroyFunc(()=>{e.unsetComp(i)})}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e);return t?`transform: ${t}`:`top: ${this.rowCtrl.getInitialRowTop(e)}`}showFullWidth(e){const t=s=>{if(this.isAlive()){const o=s.getGui();this.getGui().appendChild(o),this.rowCtrl.setupDetailRowAutoHeight(o),this.setFullWidthRowComp(s)}else this.beans.context.destroyBean(s)},i=e.newAgStackInstance();i&&i.then(t)}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach(s=>{const o=s.getInstanceId();this.cellComps[o]==null?this.newCellComp(s):t[o]=null});const i=_getAllValuesInObject(t).filter(s=>s!=null);this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach(i=>{const s=this.cellComps[i.getInstanceId()];s&&t.push(s.getGui())}),_setDomChildOrder(this.getGui(),t)}newCellComp(e){const t=new CellComp(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.getInstanceId()]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=_getAllValuesInObject(this.cellComps).filter(t=>t!=null);this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&_errorOnce("should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)})}getFullWidthCellRenderer(){return this.fullWidthCellRenderer}destroyCells(e){e.forEach(t=>{if(!t)return;const i=t.getCtrl().getInstanceId();this.cellComps[i]===t&&(t.detach(),t.destroy(),this.cellComps[i]=null)})}refreshFullWidth(e){const{fullWidthCellRenderer:t}=this;if(!t||!t.refresh)return!1;const i=e();return t.refresh(i)}},ViewportSizeFeature=class extends BeanStub{wireBeans(e){this.ctrlsService=e.ctrlsService,this.pinnedWidthService=e.pinnedWidthService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnSizeService=e.columnSizeService,this.scrollVisibleService=e.scrollVisibleService,this.columnViewportService=e.columnViewportService}constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.listenForResize()}),this.addManagedEventListeners({scrollbarWidthChanged:this.onScrollbarWidthChanged.bind(this)}),this.addManagedPropertyListeners(["alwaysShowHorizontalScroll","alwaysShowVerticalScroll"],()=>{this.checkViewportAndScrolls()})}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportInTheDOMTree()){this.keepPinnedColumnsNarrowerThanViewport(),this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnSizeService.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}keepPinnedColumnsNarrowerThanViewport(){const e=this.gridBodyCtrl.getBodyViewportElement(),t=_getInnerWidth(e);if(t<=50)return;let i=this.getPinnedColumnsOverflowingViewport(t-50);const s=this.gos.getCallback("processUnpinnedColumns");i.length&&(s&&(i=s({columns:i,viewportWidth:t})),this.columnModel.setColsPinned(i,null,"viewportSizeFeature"))}getPinnedColumnsOverflowingViewport(e){const t=this.pinnedWidthService.getPinnedRightWidth(),i=this.pinnedWidthService.getPinnedLeftWidth(),s=t+i;if(s<e)return[];const o=[...this.visibleColsService.getLeftCols()],r=[...this.visibleColsService.getRightCols()];let n=0,l=0;const a=0,d=[];let h=s-a-e;for(;(l<o.length||n<r.length)&&h>0;){if(n<r.length){const c=r[n++];h-=c.getActualWidth(),d.push(c)}if(l<o.length&&h>0){const c=o[l++];h-=c.getActualWidth(),d.push(c)}}return d}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=this.gridBodyCtrl.getBodyViewportElement(),t=_getInnerHeight(e);if(this.bodyHeight!==t){this.bodyHeight=t;const i={type:"bodyHeightChanged"};this.eventService.dispatchEvent(i)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnViewportService.setScrollPosition(e,t)}},DragListenerFeature=class extends BeanStub{wireBeans(e){this.dragService=e.dragService,this.rangeService=e.rangeService}constructor(e){super(),this.eContainer=e}postConstruct(){if(!this.rangeService)return;this.params={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)},this.addManagedPropertyListener("enableRangeSelection",t=>{if(t.currentValue){this.enableFeature();return}this.disableFeature()}),this.addDestroyFunc(()=>this.disableFeature()),this.gos.get("enableRangeSelection")&&this.enableFeature()}enableFeature(){this.dragService.addDragSource(this.params)}disableFeature(){this.dragService.removeDragSource(this.params)}},CheckboxSelectionComponent=class extends Component{constructor(){super(`
|
|
117
117
|
<div class="ag-selection-checkbox" role="presentation">
|
|
118
118
|
<ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>
|
|
119
|
-
</div>`,[AgCheckboxSelector]),this.eCheckbox=RefPlaceholder}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=_getAriaCheckboxStateName(e,t),[s,o]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],r=e(s,o);this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${r} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getInputElement(),{dblclick:s=>_stopPropagationForAgGrid(s),click:s=>{_stopPropagationForAgGrid(s);const o=this.gos.get("groupSelectsFiltered"),r=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(r,o)?this.onClicked(!0,o,s||{})===0&&this.onClicked(!1,o,s):r?this.onClicked(!1,o,s):this.onClicked(!0,o,s||{})}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)}),this.gos.get("isRowSelectable")||typeof this.getIsVisible()=="function"){const s=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:s}),this.addManagedListeners(this.rowNode,{dataChanged:s,cellChanged:s}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(this.eCheckbox.getPreviousValue()===void 0||e===void 0)&&this.gos.isRowModelType("clientSide")}showOrHideSelect(){let e=this.rowNode.selectable;const t=this.getIsVisible();if(e)if(typeof t=="function"){const s=this.overrides?.callbackParams;if(!this.column)e=t({...s,node:this.rowNode,data:this.rowNode.data});else{const o=this.column.createColumnFunctionCallbackParams(this.rowNode);e=t({...s,...o})}}else e=t??!1;if(this.column?.getColDef().showDisabledCheckboxes){this.eCheckbox.setDisabled(!e),this.setVisible(!0),this.setDisplayed(!0);return}if(this.overrides?.removeHidden){this.setDisplayed(e);return}this.setVisible(e)}getIsVisible(){return this.overrides?this.overrides.isVisible:this.column?.getColDef()?.checkboxSelection}},DndSourceComp=class extends Component{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild(_createIconNoSpan("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",t=>{t.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);const i=()=>{try{const s=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",s),e.dataTransfer.setData("text/plain",s)}catch{}};if(t){const s=this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:e});t(s)}else i()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}},CellCustomStyleFeature=class extends BeanStub{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,i=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,i,s=>this.cellComp.addOrRemoveCssClass(s,!0),s=>this.cellComp.addOrRemoveCssClass(s,!1)),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if(typeof e.cellStyle=="function"){const i=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex}),s=e.cellStyle;t=s(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach(i=>this.cellComp.addOrRemoveCssClass(i,!1)),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach(i=>this.cellComp.addOrRemoveCssClass(i,!0))}destroy(){super.destroy()}},CellKeyboardListenerFeature=class extends BeanStub{constructor(e,t,i,s,o){super(),this.cellCtrl=e,this.beans=t,this.rowNode=s,this.rowCtrl=o}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case KeyCode.ENTER:this.onEnterKeyDown(e);break;case KeyCode.F2:this.onF2KeyDown(e);break;case KeyCode.ESCAPE:this.onEscapeKeyDown(e);break;case KeyCode.TAB:this.onTabKeyDown(e);break;case KeyCode.BACKSPACE:case KeyCode.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case KeyCode.DOWN:case KeyCode.UP:case KeyCode.RIGHT:case KeyCode.LEFT:this.onNavigationKeyDown(e,t);break}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:i,beans:s,rowNode:o}=this,{gos:r,rangeService:n,eventService:l}=s;if(!i.isEditing()){if(l.dispatchEvent({type:"keyShortcutChangedCellStart"}),_isDeleteKey(e,r.get("enableCellEditingOnBackspace"))){if(n&&r.get("enableRangeSelection"))n.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(i.isCellEditable()){const a=i.getColumn(),d=this.beans.valueService.parseValue(a,o,"",o.getValueFromValueService(a))??null;o.setDataValue(a,d,"cellClear")}}else i.startRowOrCellEdit(e,t);l.dispatchEvent({type:"keyShortcutChangedCellEnd"})}}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const t=e.shiftKey?KeyCode.UP:KeyCode.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(KeyCode.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(KeyCode.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const s=e.key;s===" "?this.onSpaceKeyDown(e):(this.cellCtrl.startRowOrCellEdit(s,e),e.preventDefault())}onSpaceKeyDown(e){const{gos:t}=this.beans;if(!this.cellCtrl.isEditing()&&t.isRowSelection()){const i=this.rowNode.isSelected(),s=!i;if(s||!t.get("suppressRowDeselection")){const o=this.beans.gos.get("groupSelectsFiltered"),r=this.rowNode.setSelectedParams({newValue:s,rangeSelect:e.shiftKey,groupSelectsFiltered:o,event:e,source:"spaceKey"});i===void 0&&r===0&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:o,event:e,source:"spaceKey"})}}e.preventDefault()}destroy(){super.destroy()}},CellMouseListenerFeature=class extends BeanStub{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!_isStopPropagationForAgGrid(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t);break}}onCellClicked(e){if(this.isDoubleClickOnIPad()){this.onCellDoubleClicked(e),e.preventDefault();return}const{eventService:t,rangeService:i,gos:s}=this.beans,o=e.ctrlKey||e.metaKey;i&&o&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const r=this.cellCtrl.createEvent(e,"cellClicked");t.dispatchEvent(r);const n=this.column.getColDef();n.onCellClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{n.onCellClicked(r)})},0),(s.get("singleClickEdit")||n.singleClickEdit)&&!s.get("suppressClickEdit")&&!(e.shiftKey&&i?.getCellRanges().length!=0)&&this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!_isIOSUserAgent()||_isEventSupported("dblclick"))return!1;const e=new Date().getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const t=this.column.getColDef(),i=this.cellCtrl.createEvent(e,"cellDoubleClicked");this.beans.eventService.dispatchEvent(i),typeof t.onCellDoubleClicked=="function"&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{t.onCellDoubleClicked(i)})},0),!this.beans.gos.get("singleClickEdit")&&!this.beans.gos.get("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:s}=e,o=e.target,{cellCtrl:r,beans:n}=this,{eventService:l,rangeService:a,focusService:d}=n;if(this.isRightClickInExistingRange(e))return;const h=a&&a.getCellRanges().length!=0;if(!s||!h){const c=_isBrowserSafari()&&!r.isEditing()&&!_isFocusableFormField(o);r.focusCell(c)}if(s&&h&&!d.isCellFocused(r.getCellPosition())){e.preventDefault();const c=d.getFocusedCell();if(c){const{column:u,rowIndex:g,rowPinned:p}=c,f=n.rowRenderer.getRowByPosition({rowIndex:g,rowPinned:p})?.getCellCtrl(u);f?.isEditing()&&f.stopEditing(),d.setFocusedCell({column:u,rowIndex:g,rowPinned:p,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(o)){if(a){const c=this.cellCtrl.getCellPosition();if(s)a.extendLatestRangeToCell(c);else{const u=t||i;a.setRangeToCell(c,u)}}l.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseDown"))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),s=e.button===2||e.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(i&&s)return!0}return!1}containsWidget(e){return _isElementChildOfClass(e,"ag-selection-checkbox",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,"cellMouseOut");this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,"cellMouseOver");this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),s=t.contains(e.relatedTarget);return i&&s}destroy(){super.destroy()}},CellPositionFeature=class extends BeanStub{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}setComp(e){this.eGui=e,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();_areEqual(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){this.column.getColDef().colSpan!=null&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)}))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(e===1)t.push(this.column);else{let i=this.column;const s=this.column.getPinned();for(let o=0;i&&o<e&&(t.push(i),i=this.beans.visibleColsService.getColAfter(i),!(!i||_missing(i)||s!==i.getPinned()));o++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return this.beans.gos.get("enableRtl")&&this.colsSpanning?e=_last(this.colsSpanning):e=this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||this.column.getPinned()==="left")return e;const t=this.beans.visibleColsService.getColsLeftWidth();if(this.column.getPinned()==="right"){const i=this.beans.visibleColsService.getBodyContainerWidth();return t+i+(e||0)}return t+(e||0)}applyRowSpan(e){if(this.rowSpan===1&&!e)return;const i=this.beans.gos.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${i}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},SelectionHandleType=(e=>(e[e.FILL=0]="FILL",e[e.RANGE=1]="RANGE",e))(SelectionHandleType||{}),CellRangeType=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(CellRangeType||{}),CSS_CELL_RANGE_SELECTED="ag-cell-range-selected",CSS_CELL_RANGE_CHART="ag-cell-range-chart",CSS_CELL_RANGE_SINGLE_CELL="ag-cell-range-single-cell",CSS_CELL_RANGE_CHART_CATEGORY="ag-cell-range-chart-category",CSS_CELL_RANGE_HANDLE="ag-cell-range-handle",CSS_CELL_RANGE_TOP="ag-cell-range-top",CSS_CELL_RANGE_RIGHT="ag-cell-range-right",CSS_CELL_RANGE_BOTTOM="ag-cell-range-bottom",CSS_CELL_RANGE_LEFT="ag-cell-range-left",CellRangeFeature=class{constructor(e,t){this.beans=e,this.rangeService=e.rangeService,this.selectionHandleFactory=e.selectionHandleFactory,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_SELECTED,this.rangeCount!==0),this.cellComp.addOrRemoveCssClass(`${CSS_CELL_RANGE_SELECTED}-1`,this.rangeCount===1),this.cellComp.addOrRemoveCssClass(`${CSS_CELL_RANGE_SELECTED}-2`,this.rangeCount===2),this.cellComp.addOrRemoveCssClass(`${CSS_CELL_RANGE_SELECTED}-3`,this.rangeCount===3),this.cellComp.addOrRemoveCssClass(`${CSS_CELL_RANGE_SELECTED}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_CHART,this.hasChartRange),_setAriaSelected(this.eGui,this.rangeCount>0?!0:void 0),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_SINGLE_CELL,this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,s=!t&&e.right,o=!t&&e.bottom,r=!t&&e.left;this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_TOP,i),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_RIGHT,s),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_BOTTOM,o),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_LEFT,r)}isSingleCell(){const{rangeService:e}=this.beans;return this.rangeCount===1&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(i=>_includes([1,0],i.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,i=!1,s=!1,o=!1;const r=this.cellCtrl.getCellPosition().column,n=this.beans.visibleColsService;let l,a;e?(l=n.getColAfter(r),a=n.getColBefore(r)):(l=n.getColBefore(r),a=n.getColAfter(r));const d=this.rangeService.getCellRanges().filter(h=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),h));l||(o=!0),a||(i=!0);for(let h=0;h<d.length&&!(t&&i&&s&&o);h++){const c=d[h],u=this.rangeService.getRangeStartRow(c),g=this.rangeService.getRangeEndRow(c);!t&&this.beans.rowPositionUtils.sameRow(u,this.cellCtrl.getCellPosition())&&(t=!0),!s&&this.beans.rowPositionUtils.sameRow(g,this.cellCtrl.getCellPosition())&&(s=!0),!o&&l&&c.columns.indexOf(l)<0&&(o=!0),!i&&a&&c.columns.indexOf(a)<0&&(i=!0)}return{top:t,right:i,bottom:s,left:o}}refreshHandle(){if(this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_HANDLE,!!this.selectionHandle)}shouldHaveSelectionHandle(){const e=this.beans.gos,t=this.rangeService.getCellRanges(),i=t.length;if(this.rangeCount<1||i<1)return!1;const s=_last(t),o=this.cellCtrl.getCellPosition(),r=e.get("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),n=e.get("enableRangeHandle");let l=i===1&&!this.cellCtrl.isEditing()&&(r||n);if(this.hasChartRange){const d=t[0].type===1&&this.rangeService.isCellInSpecificRange(o,t[0]);this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_CHART_CATEGORY,d),l=s.type===0}return l&&s.endRow!=null&&this.rangeService.isContiguousRange(s)&&this.rangeService.isBottomRightCell(s,o)}addSelectionHandle(){const e=this.beans.gos,t=_last(this.rangeService.getCellRanges()).type,s=e.get("enableFillHandle")&&_missing(t)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==s&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(s)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},CSS_CELL="ag-cell",CSS_AUTO_HEIGHT="ag-cell-auto-height",CSS_NORMAL_HEIGHT="ag-cell-normal-height",CSS_CELL_FOCUS="ag-cell-focus",CSS_CELL_FIRST_RIGHT_PINNED="ag-cell-first-right-pinned",CSS_CELL_LAST_LEFT_PINNED="ag-cell-last-left-pinned",CSS_CELL_NOT_INLINE_EDITING="ag-cell-not-inline-editing",CSS_COLUMN_HOVER="ag-column-hover",CSS_CELL_WRAP_TEXT="ag-cell-wrap-text",instanceIdSequence4=0,_CellCtrl=class L extends BeanStub{constructor(t,i,s,o){super(),this.column=t,this.rowNode=i,this.beans=s,this.rowCtrl=o,this.cellRangeFeature=null,this.cellPositionFeature=null,this.cellCustomStyleFeature=null,this.tooltipFeature=null,this.cellMouseListenerFeature=null,this.cellKeyboardListenerFeature=null,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.instanceId=t.getId()+"-"+instanceIdSequence4++,this.colIdSanitised=_escapeString(this.column.getId()),s.gos.get("suppressCellFocus")||(this.tabIndex=-1),this.createCellPosition(),this.addFeatures(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}addFeatures(){this.cellPositionFeature=new CellPositionFeature(this,this.beans),this.addDestroyFunc(()=>{this.cellPositionFeature?.destroy(),this.cellPositionFeature=null}),this.cellCustomStyleFeature=new CellCustomStyleFeature(this,this.beans),this.addDestroyFunc(()=>{this.cellCustomStyleFeature?.destroy(),this.cellCustomStyleFeature=null}),this.cellMouseListenerFeature=new CellMouseListenerFeature(this,this.beans,this.column),this.addDestroyFunc(()=>{this.cellMouseListenerFeature?.destroy(),this.cellMouseListenerFeature=null}),this.cellKeyboardListenerFeature=new CellKeyboardListenerFeature(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc(()=>{this.cellKeyboardListenerFeature?.destroy(),this.cellKeyboardListenerFeature=null}),this.column.isTooltipEnabled()&&(this.enableTooltipFeature(),this.addDestroyFunc(()=>{this.disableTooltipFeature()})),this.beans.rangeService&&this.beans.gos.get("enableRangeSelection")&&(this.cellRangeFeature=new CellRangeFeature(this.beans,this),this.addDestroyFunc(()=>{this.cellRangeFeature?.destroy(),this.cellRangeFeature=null}))}enableTooltipFeature(t,i){const s=()=>{const n=this.column.getColDef(),l=this.rowNode.data;if(n.tooltipField&&_exists(l))return _getValueUsingField(l,n.tooltipField,this.column.isTooltipFieldContainsDots());const a=n.tooltipValueGetter;return a?a(this.beans.gos.addGridCommonParams({location:"cell",colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted})):null},o=this.beans.gos.get("tooltipShowMode")==="whenTruncated";!i&&o&&!this.isCellRenderer()&&(i=()=>{const n=this.getGui(),l=n.children.length===0?n:n.querySelector(".ag-cell-value");return l?l.scrollWidth>l.clientWidth:!0});const r={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:t!=null?()=>t:s,getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:i};this.tooltipFeature=new TooltipFeature(r,this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(t,i,s,o,r){this.cellComp=t,this.eGui=i,this.printLayout=o,this.addDomData(),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(s),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),this.cellPositionFeature?.setComp(i),this.cellCustomStyleFeature?.setComp(t),this.tooltipFeature?.refreshToolTip(),this.cellKeyboardListenerFeature?.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(t,i),r&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(n=>n()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(t){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!t)return;const i=t.parentElement,s=this.beans.gos.getRowHeightForNode(this.rowNode).height,o=l=>{if(this.editing||!this.isAlive())return;const{paddingTop:a,paddingBottom:d,borderBottomWidth:h,borderTopWidth:c}=_getElementSize(i),u=a+d+h+c,p=t.offsetHeight+u;if(l<5){const f=this.beans.gos.getDocument(),v=!f||!f.contains(t),C=p==0;if(v||C){window.setTimeout(()=>o(l+1),0);return}}const m=Math.max(p,s);this.rowNode.setRowAutoHeight(m,this.column)},r=()=>o(0);r();const n=this.beans.resizeObserverService.observeResize(t,r);this.addDestroyFunc(()=>{n(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getCellAriaRole(){return this.column.getColDef().cellAriaRole??"gridcell"}getInstanceId(){return this.instanceId}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}isCellRenderer(){const t=this.column.getColDef();return t.cellRenderer!=null||t.cellRendererSelector!=null}getValueToDisplay(){return this.valueFormatted??this.value}showValue(t=!1){const i=this.getValueToDisplay();let s;if(this.rowNode.stub){const o=this.createCellRendererParams();s=this.beans.userComponentFactory.getLoadingCellRendererDetails(this.column.getColDef(),o)}else if(this.isCellRenderer()){const o=this.createCellRendererParams();s=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),o)}this.cellComp.setRenderDetails(s,i,t),this.cellRangeFeature?.refreshHandle()}setupControlComps(){const t=this.column.getColDef();this.includeSelection=this.isIncludeControl(t.checkboxSelection),this.includeRowDrag=this.isIncludeControl(t.rowDrag),this.includeDndSource=this.isIncludeControl(t.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(t){return this.rowNode.rowPinned!=null?!1:typeof t=="function"||t===!0}refreshShouldDestroy(){const t=this.column.getColDef(),i=this.includeSelection!=this.isIncludeControl(t.checkboxSelection),s=this.includeRowDrag!=this.isIncludeControl(t.rowDrag),o=this.includeDndSource!=this.isIncludeControl(t.dndSource),r=this.isAutoHeight!=this.column.isAutoHeight();return i||s||o||r}startEditing(t=null,i=!1,s=null){const{editService:o}=this.beans;if(!(!this.isCellEditable()||this.editing||!o)){if(!this.cellComp){this.onCellCompAttachedFuncs.push(()=>{this.startEditing(t,i,s)});return}o.startEditing(this,t,i,s)}}setEditing(t,i){this.editCompDetails=i,this.editing!==t&&(this.editing=t,this.cellRangeFeature?.refreshHandle())}stopRowOrCellEdit(t=!1){this.beans.gos.get("editType")==="fullRow"?this.rowCtrl.stopEditing(t):this.stopEditing(t)}onPopupEditorClosed(){this.editing&&this.stopEditingAndFocus()}stopEditing(t=!1){const{editService:i}=this.beans;return!this.editing||!i?!1:i.stopEditing(this,t)}createCellRendererParams(){return this.beans.gos.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.rowNode.getValueFromValueService(this.column),setValue:i=>this.beans.valueService.setValue(this.rowNode,this.column,i),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(i,s,o,r)=>this.registerRowDragger(i,s,r),setTooltip:(i,s)=>{this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(i,s),this.tooltipFeature?.refreshToolTip()}})}setFocusOutOnEditor(){this.editing&&this.beans.editService?.setFocusOutOnEditor(this)}setFocusInOnEditor(){this.editing&&this.beans.editService?.setFocusInOnEditor(this)}onCellChanged(t){t.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(t){this.refreshShouldDestroy()?this.rowCtrl?.recreateCell(this):this.refreshCell(t)}refreshCell(t){if(this.suppressRefreshCell||this.editing)return;const i=this.column.getColDef(),s=t!=null&&!!t.newData,o=t!=null&&!!t.suppressFlash||!!i.suppressCellFlash,r=i.field==null&&i.valueGetter==null&&i.showRowGroup==null,n=t&&t.forceRefresh||r||s,l=!!this.cellComp,a=this.updateAndFormatValue(l),d=n||a;if(l){if(d){this.showValue(s);const h=this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering();!o&&!h&&(this.beans.gos.get("enableCellChangeFlash")||i.enableCellChangeFlash)&&this.flashCell(),this.cellCustomStyleFeature?.applyUserStyles(),this.cellCustomStyleFeature?.applyClassesFromColDef()}this.tooltipFeature?.refreshToolTip(),this.cellCustomStyleFeature?.applyCellClassRules()}}stopEditingAndFocus(t=!1,i=!1){this.beans.editService?.stopEditingAndFocus(this,t,i)}flashCell(t){const i=t?.flashDuration??t?.flashDelay,s=t?.fadeDuration??t?.fadeDelay;this.animateCell("data-changed",i,s)}animateCell(t,i,s){if(!this.cellComp)return;const o=`ag-cell-${t}`,r=`ag-cell-${t}-animation`,{gos:n}=this.beans;i||(i=n.get("cellFlashDuration")),_exists(s)||(s=n.get("cellFadeDuration")),this.cellComp.addOrRemoveCssClass(o,!0),this.cellComp.addOrRemoveCssClass(r,!1),this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(o,!1),this.cellComp.addOrRemoveCssClass(r,!0),this.eGui.style.transition=`background-color ${s}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(r,!1),this.eGui.style.transition="")},s))},i)})}onFlashCells(t){if(!this.cellComp)return;const i=this.beans.cellPositionUtils.createId(this.getCellPosition());t.cells[i]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(t){return this.callValueFormatter(t)??t}callValueFormatter(t){return this.beans.valueService.formatValue(this.column,this.rowNode,t)}updateAndFormatValue(t){const i=this.value,s=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),t?!this.valuesAreEqual(i,this.value)||this.valueFormatted!=s:!0}valuesAreEqual(t,i){const s=this.column.getColDef();return s.equals?s.equals(t,i):t===i}getComp(){return this.cellComp}getValue(){return this.value}addDomData(){const t=this.getGui();this.beans.gos.setDomData(t,L.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc(()=>this.beans.gos.setDomData(t,L.DOM_DATA_KEY_CELL_CTRL,null))}createEvent(t,i){return this.beans.gos.addGridCommonParams({type:i,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:t,rowIndex:this.rowNode.rowIndex})}processCharacter(t){this.cellKeyboardListenerFeature?.processCharacter(t)}onKeyDown(t){this.cellKeyboardListenerFeature?.onKeyDown(t)}onMouseEvent(t,i){this.cellMouseListenerFeature?.onMouseEvent(t,i)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){this.cellComp&&this.cellPositionFeature?.onLeftChanged()}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:t,column:i,beans:s}=this;refreshFirstAndLastStyles(t,i,s.visibleColsService)}refreshAriaColIndex(){const t=this.beans.visibleColsService.getAriaColIndex(this.column);_setAriaColIndex(this.getGui(),t)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){return this.cellPositionFeature?.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}isPrintLayout(){return this.printLayout}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(t,i=null){if(!this.cellComp){this.onCellCompAttachedFuncs.push(()=>{this.startRowOrCellEdit(t,i)});return}this.beans.gos.get("editType")==="fullRow"?this.rowCtrl.startRowEditing(t,this):this.startEditing(t,!0,i)}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onRangeSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}isRangeSelectionEnabled(){return this.cellRangeFeature!=null}focusCell(t=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:t})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}onFirstRightPinnedChanged(){if(!this.cellComp)return;const t=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass(CSS_CELL_FIRST_RIGHT_PINNED,t)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const t=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass(CSS_CELL_LAST_LEFT_PINNED,t)}onCellFocused(t){if(this.beans.gos.get("suppressCellFocus"))return;const i=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp){i&&t?.forceBrowserFocus&&(this.focusEventToRestore=t);return}if(this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass(CSS_CELL_FOCUS,i),i&&t&&t.forceBrowserFocus){let o=this.cellComp.getFocusableElement();if(this.editing){const r=this.beans.focusService.findFocusableElements(o,null,!0);r.length&&(o=r[0])}o.focus({preventScroll:!!t.preventScrollOnBrowserFocus})}const s=this.beans.gos.get("editType")==="fullRow";!i&&!s&&this.editing&&this.stopRowOrCellEdit(),i&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:_makeNull(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass(CSS_CELL,!0),this.cellComp.addOrRemoveCssClass(CSS_CELL_NOT_INLINE_EDITING,!0);const t=this.column.isAutoHeight()==!0;this.cellComp.addOrRemoveCssClass(CSS_AUTO_HEIGHT,t),this.cellComp.addOrRemoveCssClass(CSS_NORMAL_HEIGHT,!t)}onColumnHover(){if(!this.cellComp||!this.beans.gos.get("columnHoverHighlight"))return;const t=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass(CSS_COLUMN_HOVER,t)}onColDefChanged(){if(!this.cellComp)return;this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing?this.beans.editService?.handleColDefChanged(this):this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0})}setWrapText(){const t=this.column.getColDef().wrapText==!0;this.cellComp.addOrRemoveCssClass(CSS_CELL_WRAP_TEXT,t)}dispatchCellContextMenuEvent(t){const i=this.column.getColDef(),s=this.createEvent(t,"cellContextMenu");this.beans.eventService.dispatchEvent(s),i.onCellContextMenu&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{i.onCellContextMenu(s)})},0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const t=new CheckboxSelectionComponent;return this.beans.context.createBean(t),t.init({rowNode:this.rowNode,column:this.column}),t}createDndSource(){const t=new DndSourceComp(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(t),t}registerRowDragger(t,i,s){if(this.customRowDragComp){this.customRowDragComp.setDragElement(t,i);return}const o=this.createRowDragComp(t,i,s);o&&(this.customRowDragComp=o,this.addDestroyFunc(()=>{this.beans.context.destroyBean(o),this.customRowDragComp=null}))}createRowDragComp(t,i,s){const o=this.beans.gos.get("pagination"),r=this.beans.gos.get("rowDragManaged"),n=this.beans.gos.isRowModelType("clientSide");if(r){if(!n){_warnOnce("managed row dragging is only allowed in the Client Side Row Model");return}if(o){_warnOnce("managed row dragging is not possible when doing pagination");return}}const l=new RowDragComp(()=>this.value,this.rowNode,this.column,t,i,s);return this.beans.context.createBean(l),l}setSuppressRefreshCell(t){this.suppressRefreshCell=t}getEditCompDetails(){return this.editCompDetails}};_CellCtrl.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var CellCtrl=_CellCtrl,instanceIdSequence5=0,_RowCtrl=class O extends BeanStub{constructor(t,i,s,o,r){super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKeySanitised=null,this.beans=i,this.gos=i.gos,this.rowNode=t,this.paginationPage=i.paginationService?.getCurrentPage()??0,this.useAnimationFrameForCreate=o,this.printLayout=r,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=t.id+"-"+instanceIdSequence5++,this.rowId=_escapeString(t.id),this.initRowBusinessKey(),this.rowFocused=i.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=i.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(s),this.rowStyles=this.processStylesFromGridOptions(),this.isFullWidth()&&!this.gos.get("suppressCellFocus")&&(this.tabIndex=-1),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(typeof this.businessKeyForNodeFunc!="function")return;const t=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=_escapeString(t)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}getTabIndex(){return this.tabIndex}isSticky(){return this.rowNode.sticky}getInstanceId(){return this.instanceId}updateGui(t,i){t==="left"?this.leftGui=i:t==="right"?this.rightGui=i:t==="fullWidth"?this.fullWidthGui=i:this.centerGui=i}setComp(t,i,s){const o={rowComp:t,element:i,containerType:s};this.allRowGuis.push(o),this.updateGui(s,o),this.initialiseRowComp(o),this.rowType!=="FullWidthLoading"&&!this.rowNode.rowPinned&&this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(t){this.allRowGuis=this.allRowGuis.filter(i=>i.containerType!==t),this.updateGui(t,void 0)}isCacheable(){return this.rowType==="FullWidthDetail"&&this.gos.get("keepDetailRows")}setCached(t){const i=t?"none":"";this.allRowGuis.forEach(s=>s.element.style.display=i)}initialiseRowComp(t){const i=this.gos;this.listenOnDomOrder(t),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(t),this.updateRowIndexes(t),this.setFocusedClasses(t),this.setStylesFromGridOptions(!1,t),i.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(t),this.updateColumnLists(!this.useAnimationFrameForCreate);const s=t.rowComp;this.getInitialRowClasses(t.containerType).forEach(r=>s.addOrRemoveCssClass(r,!0)),this.executeSlideAndFadeAnimations(t),this.rowNode.group&&_setAriaExpanded(t.element,this.rowNode.expanded==!0),this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),i.setDomData(t.element,O.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc(()=>i.setDomData(t.element,O.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,t.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(t.element),this.isFullWidth()&&this.setupFullWidth(t),i.get("rowDragEntireRow")&&this.addRowDraggerToRow(t),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&t.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(t){this.businessKeySanitised!=null&&t.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(t){this.rowId=_escapeString(this.rowNode.id),this.rowId!=null&&t.setRowId(this.rowId)}executeSlideAndFadeAnimations(t){const{containerType:i}=t;this.slideInAnimation[i]&&(_executeNextVMTurn(()=>{this.onTopChanged()}),this.slideInAnimation[i]=!1),this.fadeInAnimation[i]&&(_executeNextVMTurn(()=>{t.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[i]=!1)}addRowDraggerToRow(t){if(this.gos.get("enableRangeSelection")){_warnOnce("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`");return}const i=this.beans.localeService.getLocaleTextFunc(),s=new RowDragComp(()=>`1 ${i("rowDragRow","row")}`,this.rowNode,void 0,t.element,void 0,!0),o=this.createBean(s,this.beans.context);this.rowDragComps.push(o)}setupFullWidth(t){const i=this.getPinnedForContainer(t.containerType);if(this.rowType=="FullWidthDetail"&&!ModuleRegistry.__assertRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;const s=this.createFullWidthCompDetails(t.element,i);t.rowComp.showFullWidth(s)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(t=>t?.rowComp?.getFullWidthCellRenderer()):[this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]}getCellElement(t){const i=this.getCellCtrl(t);return i?i.getGui():null}executeProcessRowPostCreateFunc(){const t=this.gos.getCallback("processRowPostCreate");if(!t||!this.areAllContainersReady())return;const i={eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)};t(i)}areAllContainersReady(){const t=!!this.leftGui||!this.beans.visibleColsService.isPinningLeft(),i=!!this.centerGui,s=!!this.rightGui||!this.beans.visibleColsService.isPinningRight();return t&&i&&s}setRowType(){const t=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow"),i=this.rowNode.isFullWidthCell(),s=this.gos.get("masterDetail")&&this.rowNode.detail,o=this.beans.columnModel.isPivotMode(),n=!!this.rowNode.group&&!this.rowNode.footer&&this.gos.isGroupUseEntireRow(o);t?this.rowType="FullWidthLoading":s?this.rowType="FullWidthDetail":i?this.rowType="FullWidth":n?this.rowType="FullWidthGroup":this.rowType="Normal"}updateColumnLists(t=!1,i=!1){if(this.isFullWidth())return;if(t||this.gos.get("suppressAnimationFrame")||this.printLayout){this.updateColumnListsImpl(i);return}this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0)}createCellCtrls(t,i,s=null){const o={list:[],map:{}},r=(n,l)=>{o.list.push(l),o.map[n]=l};return i.forEach(n=>{const l=n.getInstanceId();let a=t.map[l];a||(a=new CellCtrl(n,this.rowNode,this.beans,this)),r(l,a)}),t.list.forEach(n=>{if(o.map[n.getColumn().getInstanceId()]!=null)return;if(!this.isCellEligibleToBeRemoved(n,s)){r(n.getColumn().getInstanceId(),n);return}n.destroy()}),o}updateColumnListsImpl(t){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(t)}setCellCtrls(t){this.allRowGuis.forEach(i=>{const s=this.getCellCtrlsForContainer(i.containerType);i.rowComp.setCellCtrls(s,t)})}getCellCtrlsForContainer(t){switch(t){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list}}createAllCellCtrls(){const t=this.beans.columnViewportService,i=this.beans.visibleColsService;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,i.getAllCols()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const s=t.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,s);const o=i.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,o,"left");const r=i.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,r,"right")}}isCellEligibleToBeRemoved(t,i){if(t.getColumn().getPinned()!=i)return!0;const n=t.isEditing(),l=this.beans.focusService.isCellFocused(t.getCellPosition());if(n||l){const d=t.getColumn();return!(this.beans.visibleColsService.getAllCols().indexOf(d)>=0)}return!0}getDomOrder(){return this.gos.get("ensureDomOrder")||this.gos.isDomLayout("print")}listenOnDomOrder(t){const i=()=>{t.rowComp.setDomOrder(this.getDomOrder())};this.addManagedPropertyListener("domLayout",i),this.addManagedPropertyListener("ensureDomOrder",i)}setAnimateFlags(t){if(this.isSticky()||!t)return;const i=_exists(this.rowNode.oldRowTop),s=this.beans.visibleColsService.isPinningLeft(),o=this.beans.visibleColsService.isPinningRight();if(i){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){this.slideInAnimation.fullWidth=!0;return}this.slideInAnimation.center=!0,this.slideInAnimation.left=s,this.slideInAnimation.right=o}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){this.fadeInAnimation.fullWidth=!0;return}this.fadeInAnimation.center=!0,this.fadeInAnimation.left=s,this.fadeInAnimation.right=o}}isEditing(){return this.editingRow}isFullWidth(){return this.rowType!=="Normal"}refreshFullWidth(){const t=(l,a)=>l?l.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(l.element,a).params):!0,i=t(this.fullWidthGui,null),s=t(this.centerGui,null),o=t(this.leftGui,"left"),r=t(this.rightGui,"right");return i&&s&&o&&r}addListeners(){this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),expandedChanged:this.updateExpandedCss.bind(this),hasChildrenChanged:this.updateExpandedCss.bind(this)}),this.rowNode.detail&&this.addManagedListeners(this.rowNode.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)}),this.addManagedListeners(this.rowNode,{dataChanged:this.onRowNodeDataChanged.bind(this),cellChanged:this.postProcessCss.bind(this),rowHighlightChanged:this.onRowNodeHighlightChanged.bind(this),draggingChanged:this.postProcessRowDragging.bind(this),uiLevelChanged:this.onUiLevelChanged.bind(this)}),this.addManagedListeners(this.beans.eventService,{paginationPixelOffsetChanged:this.onPaginationPixelOffsetChanged.bind(this),heightScaleChanged:this.onTopChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:this.onVirtualColumnsChanged.bind(this),cellFocused:this.onCellFocusChanged.bind(this),cellFocusCleared:this.onCellFocusChanged.bind(this),paginationChanged:this.onPaginationChanged.bind(this),modelUpdated:this.refreshFirstAndLastRowStyles.bind(this),columnMoved:()=>this.updateColumnLists()}),this.addDestroyFunc(()=>{this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context))}),this.addManagedPropertyListeners(["rowDragEntireRow"],()=>{if(this.gos.get("rowDragEntireRow")){this.allRowGuis.forEach(i=>{this.addRowDraggerToRow(i)});return}this.rowDragComps=this.destroyBeans(this.rowDragComps,this.beans.context)}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{this.getAllCellCtrls().forEach(t=>t.onRowIndexChanged())},cellChanged:t=>{this.getAllCellCtrls().forEach(i=>i.onCellChanged(t))}})}onRowNodeDataChanged(t){if(this.isFullWidth()!==!!this.rowNode.isFullWidthCell()){this.beans.rowRenderer.redrawRow(this.rowNode);return}if(this.isFullWidth()){this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode);return}this.getAllCellCtrls().forEach(s=>s.refreshCell({suppressFlash:!t.update,newData:!t.update})),this.allRowGuis.forEach(s=>{this.setRowCompRowId(s.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(s.rowComp)}),this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const t=this.rowNode.highlighted;this.allRowGuis.forEach(i=>{const s=t===0,o=t===1;i.rowComp.addOrRemoveCssClass("ag-row-highlight-above",s),i.rowComp.addOrRemoveCssClass("ag-row-highlight-below",o)})}postProcessRowDragging(){const t=this.rowNode.dragging;this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-dragging",t))}updateExpandedCss(){const t=this.rowNode.isExpandable(),i=this.rowNode.expanded==!0;this.allRowGuis.forEach(s=>{s.rowComp.addOrRemoveCssClass("ag-row-group",t),s.rowComp.addOrRemoveCssClass("ag-row-group-expanded",t&&i),s.rowComp.addOrRemoveCssClass("ag-row-group-contracted",t&&!i),_setAriaExpanded(s.element,t&&i)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:_makeNull(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(t){const i=this.allRowGuis.find(a=>a.element.contains(t.target));if(!((i?i.element:null)===t.target))return;const r=this.rowNode,n=this.beans.focusService.getFocusedCell(),l={rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:n&&n.column};this.beans.navigationService.navigateToNextCell(t,t.key,l,!0),t.preventDefault()}onTabKeyDown(t){if(t.defaultPrevented||_isStopPropagationForAgGrid(t))return;const i=this.allRowGuis.find(n=>n.element.contains(t.target)),s=i?i.element:null,o=s===t.target;let r=null;o||(r=this.beans.focusService.findNextFocusableElement(s,!1,t.shiftKey)),(this.isFullWidth()&&o||!r)&&this.beans.navigationService.onTabKeyDown(this,t)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){const t=this.allRowGuis.find(i=>_isVisible(i.element))?.element;return t?t.getBoundingClientRect().top:0}onFullWidthRowFocused(t){const i=this.rowNode,s=t?this.isFullWidth()&&t.rowIndex===i.rowIndex&&t.rowPinned==i.rowPinned:!1,o=this.fullWidthGui?this.fullWidthGui.element:this.centerGui?.element;o&&(o.classList.toggle("ag-full-width-focus",s),s&&t?.forceBrowserFocus&&o.focus({preventScroll:!0}))}recreateCell(t){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,t),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,t),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,t),t.destroy(),this.updateColumnLists()}removeCellCtrl(t,i){const s={list:[],map:{}};return t.list.forEach(o=>{o!==i&&(s.list.push(o),s.map[o.getColumn().getInstanceId()]=o)}),s}onMouseEvent(t,i){switch(t){case"dblclick":this.onRowDblClick(i);break;case"click":this.onRowClick(i);break;case"touchstart":case"mousedown":this.onRowMouseDown(i);break}}createRowEvent(t,i){return this.gos.addGridCommonParams({type:t,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:i})}createRowEventWithSource(t,i){const s=this.createRowEvent(t,i);return s.source=this,s}onRowDblClick(t){if(_isStopPropagationForAgGrid(t))return;const i=this.createRowEventWithSource("rowDoubleClicked",t);this.beans.eventService.dispatchEvent(i)}onRowMouseDown(t){if(this.lastMouseDownOnDragger=_isElementChildOfClass(t.target,"ag-row-drag",3),!this.isFullWidth())return;const i=this.rowNode,s=this.beans.visibleColsService;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges();const o=this.getFullWidthElement(),r=t.target;let n=!0;o&&o.contains(r)&&_isFocusableFormField(r)&&(n=!1),this.beans.focusService.setFocusedCell({rowIndex:i.rowIndex,column:s.getAllCols()[0],rowPinned:i.rowPinned,forceBrowserFocus:n})}onRowClick(t){if(_isStopPropagationForAgGrid(t)||this.lastMouseDownOnDragger)return;const s=this.createRowEventWithSource("rowClicked",t);this.beans.eventService.dispatchEvent(s);const o=t.ctrlKey||t.metaKey,r=t.shiftKey;if(this.gos.get("groupSelectsChildren")&&this.rowNode.group||this.isRowSelectionBlocked()||this.gos.get("suppressRowClickSelection"))return;const l=this.gos.get("rowMultiSelectWithClick"),a=!this.gos.get("suppressRowDeselection"),d="rowClicked";if(this.rowNode.isSelected())l?this.rowNode.setSelectedParams({newValue:!1,event:t,source:d}):o?a&&this.rowNode.setSelectedParams({newValue:!1,event:t,source:d}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!r,rangeSelect:r,event:t,source:d});else{const h=l?!1:!o;this.rowNode.setSelectedParams({newValue:!0,clearSelection:h,rangeSelect:r,event:t,source:d})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!this.gos.isRowSelection()}setupDetailRowAutoHeight(t){if(this.rowType!=="FullWidthDetail"||!this.gos.get("detailRowAutoHeight"))return;const i=()=>{const o=t.clientHeight;if(o!=null&&o>0){const r=()=>{this.rowNode.setRowHeight(o),this.beans.rowModel.getType()==="clientSide"?this.beans.rowModel.onRowHeightChanged():this.beans.rowModel.getType()==="serverSide"&&this.beans.rowModel.onRowHeightChanged()};window.setTimeout(r,0)}},s=this.beans.resizeObserverService.observeResize(t,i);this.addDestroyFunc(s),i()}createFullWidthCompDetails(t,i){const{gos:s,rowNode:o}=this,r=s.addGridCommonParams({fullWidth:!0,data:o.data,node:o,value:o.key,valueFormatted:o.key,eGridCell:t,eParentOfValue:t,pinned:i,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(l,a,d,h)=>this.addFullWidthRowDragging(l,a,d,h),setTooltip:(l,a)=>this.refreshRowTooltip(l,a)}),n=this.beans.userComponentFactory;switch(this.rowType){case"FullWidthDetail":return n.getFullWidthDetailCellRendererDetails(r);case"FullWidthGroup":return n.getFullWidthGroupCellRendererDetails(r);case"FullWidthLoading":return n.getFullWidthLoadingCellRendererDetails(r);default:return n.getFullWidthCellRendererDetails(r)}}refreshRowTooltip(t,i){if(!this.fullWidthGui)return;const s={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>t,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:i};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new TooltipFeature(s,this.beans))}addFullWidthRowDragging(t,i,s="",o){if(!this.isFullWidth())return;const r=new RowDragComp(()=>s,this.rowNode,void 0,t,i,o);this.createBean(r,this.beans.context),this.addDestroyFunc(()=>{this.destroyBean(r,this.beans.context)})}onUiLevelChanged(){const t=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=t){const i="ag-row-level-"+t,s="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(o=>{o.rowComp.addOrRemoveCssClass(i,!0),o.rowComp.addOrRemoveCssClass(s,!1)})}this.rowLevel=t}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getLastRow()}refreshFirstAndLastRowStyles(){const t=this.isFirstRowOnPage(),i=this.isLastRowOnPage();this.firstRowOnPage!==t&&(this.firstRowOnPage=t,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-first",t))),this.lastRowOnPage!==i&&(this.lastRowOnPage=i,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-last",i)))}stopEditing(t=!1){this.stoppingRowEdit||this.beans.rowEditService?.stopEditing(this,t)}setInlineEditingCss(t){this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass("ag-row-inline-editing",t),i.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!t)})}setEditingRow(t){this.editingRow=t}startRowEditing(t=null,i=null,s=null){this.editingRow||this.beans.rowEditService?.startEditing(this,t,i,s)}getAllCellCtrls(){return this.leftCellCtrls.list.length===0&&this.rightCellCtrls.list.length===0?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const t=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);!t||!t.length||t.forEach(i=>{this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass(i,!0))})}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,t=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(t,!0))},t=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(t,!1))})}setStylesFromGridOptions(t,i){t&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(i,s=>s.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(t){return t==="left"||t==="right"?t:null}getInitialRowClasses(t){const i=this.getPinnedForContainer(t),s={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[t],rowIsEven:this.rowNode.rowIndex%2===0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:i};return this.beans.rowCssClassCalculator.getInitialRowClasses(s)}processStylesFromGridOptions(){const t=this.gos.get("rowStyle");if(t&&typeof t=="function"){_warnOnce("rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");return}const i=this.gos.getCallback("getRowStyle");let s;if(i){const o={data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex};s=i(o)}return s||t?Object.assign({},t,s):this.emptyStyle}onRowSelected(t){const i=!!this.rowNode.isSelected();this.forEachGui(t,s=>{s.rowComp.addOrRemoveCssClass("ag-row-selected",i),_setAriaSelected(s.element,i),s.element.contains(this.gos.getActiveDomElement())&&(s===this.centerGui||s===this.fullWidthGui)&&this.announceDescription()})}announceDescription(){if(this.isRowSelectionBlocked())return;const t=this.rowNode.isSelected();if(t&&this.gos.get("suppressRowDeselection"))return;const s=this.beans.localeService.getLocaleTextFunc()(t?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${t?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(s)}addHoverFunctionality(t){if(!this.active)return;const{rowNode:i,beans:s,gos:o}=this;this.addManagedListeners(t,{mouseenter:()=>i.onMouseEnter(),mouseleave:()=>i.onMouseLeave()}),this.addManagedListeners(i,{mouseEnter:()=>{!s.dragService.isDragging()&&!o.get("suppressRowHoverHighlight")&&(t.classList.add("ag-row-hover"),i.setHovered(!0))},mouseLeave:()=>{t.classList.remove("ag-row-hover"),i.setHovered(!1)}})}roundRowTopToBounds(t){const i=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),s=this.applyPaginationOffset(i.top,!0)-100,o=this.applyPaginationOffset(i.bottom,!0)+100;return Math.min(Math.max(s,t),o)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(t,i){t?i(t):this.allRowGuis.forEach(i)}onRowHeightChanged(t){if(this.rowNode.rowHeight==null)return;const i=this.rowNode.rowHeight,s=this.beans.environment.getDefaultRowHeight(),r=this.gos.isGetRowHeightFunction()?this.gos.getRowHeightForNode(this.rowNode).height:void 0,n=r?`${Math.min(s,r)-2}px`:void 0;this.forEachGui(t,l=>{l.element.style.height=`${i}px`,n&&l.element.style.setProperty("--ag-line-height",n)})}addEventListener(t,i){super.addEventListener(t,i)}removeEventListener(t,i){super.removeEventListener(t,i)}destroyFirstPass(t=!1){if(this.active=!1,!t&&this.gos.isAnimateRows()&&!this.isSticky())if(this.rowNode.rowTop!=null){const o=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(o)}else this.allRowGuis.forEach(o=>o.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0));this.rowNode.setHovered(!1);const i=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(i),this.beans.eventService.dispatchEvent(i),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const t=i=>(i.list.forEach(s=>s.destroy()),{list:[],map:{}});this.centerCellCtrls=t(this.centerCellCtrls),this.leftCellCtrls=t(this.leftCellCtrls),this.rightCellCtrls=t(this.rightCellCtrls)}setFocusedClasses(t){this.forEachGui(t,i=>{i.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),i.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){const t=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);t!==this.rowFocused&&(this.rowFocused=t,this.setFocusedClasses()),!t&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){const t=this.beans.paginationService?.getCurrentPage()??0;this.paginationPage!==t&&(this.paginationPage=t,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(t,i=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return t;const s=this.beans.pageBoundsService.getPixelOffset();return t+s*(i?1:-1)}setRowTop(t){if(!this.printLayout&&_exists(t)){const i=this.applyPaginationOffset(t),r=`${this.rowNode.isRowPinned()||this.rowNode.sticky?i:this.beans.rowContainerHeightService.getRealPixelPosition(i)}px`;this.setRowTopStyle(r)}}getInitialRowTop(t){return this.suppressRowTransform?this.getInitialRowTopShared(t):void 0}getInitialTransform(t){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(t)})`}getInitialRowTopShared(t){if(this.printLayout)return"";const i=this.rowNode;let s;if(this.isSticky())s=i.stickyRowTop;else{const o=this.slideInAnimation[t]?this.roundRowTopToBounds(i.oldRowTop):i.rowTop,r=this.applyPaginationOffset(o);s=i.isRowPinned()?r:this.beans.rowContainerHeightService.getRealPixelPosition(r)}return s+"px"}setRowTopStyle(t){this.allRowGuis.forEach(i=>this.suppressRowTransform?i.rowComp.setTop(t):i.rowComp.setTransform(`translateY(${t})`))}getRowNode(){return this.rowNode}getCellCtrl(t){let i=null;return this.getAllCellCtrls().forEach(s=>{s.getColumn()==t&&(i=s)}),i!=null||this.getAllCellCtrls().forEach(s=>{s.getColSpanningList().indexOf(t)>=0&&(i=s)}),i}onRowIndexChanged(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(t){const i=this.rowNode.getRowIndexString();if(i===null)return;const s=this.beans.headerNavigationService.getHeaderRowCount()+(this.beans.filterManager?.getHeaderRowCount()??0),o=this.rowNode.rowIndex%2===0,r=s+this.rowNode.rowIndex+1;this.forEachGui(t,n=>{n.rowComp.setRowIndex(i),n.rowComp.addOrRemoveCssClass("ag-row-even",o),n.rowComp.addOrRemoveCssClass("ag-row-odd",!o),_setAriaRowIndex(n.element,r)})}setStoppingRowEdit(t){this.stoppingRowEdit=t}};_RowCtrl.DOM_DATA_KEY_ROW_CTRL="renderedRow";var RowCtrl=_RowCtrl,RowContainerEventsFeature=class extends BeanStub{wireBeans(e){this.mouseEventService=e.mouseEventService,this.valueService=e.valueService,this.menuService=e.menuService,this.ctrlsService=e.ctrlsService,this.navigationService=e.navigationService,this.focusService=e.focusService,this.undoRedoService=e.undoRedoService,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.rangeService=e.rangeService,this.clipboardService=e.clipboardService}constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",_isEventSupported("touchstart")?"touchstart":"mousedown"].forEach(i=>{const s=this.processMouseEvent.bind(this,i);this.addManagedElementListeners(this.element,{[i]:s})})}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||_isStopPropagationForAgGrid(t))return;const i=this.getRowForEvent(t),s=this.mouseEventService.getRenderedCellForEvent(t);e==="contextmenu"?this.handleContextMenuMouseEvent(t,void 0,i,s):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!_isIOSUserAgent())return;const e=new TouchListener(this.element),t=i=>{const s=this.getRowForEvent(i.touchEvent),o=this.mouseEventService.getRenderedCellForEvent(i.touchEvent);this.handleContextMenuMouseEvent(void 0,i.touchEvent,s,o)};this.addManagedListeners(e,{longTap:t}),this.addDestroyFunc(()=>e.destroy())}getRowForEvent(e){let t=e.target;for(;t;){const i=this.gos.getDomData(t,RowCtrl.DOM_DATA_KEY_ROW_CTRL);if(i)return i;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,s){const o=i?i.getRowNode():null,r=s?s.getColumn():null;let n=null;if(r){const d=e||t;s.dispatchCellContextMenuEvent(d??null),n=this.valueService.getValue(r,o)}const l=this.ctrlsService.getGridBodyCtrl(),a=s?s.getGui():l.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:o,column:r,value:n,anchorToElement:a})}getControlsForEventTarget(e){return{cellCtrl:_getCtrlForEventTarget(this.gos,e,CellCtrl.DOM_DATA_KEY_CELL_CTRL),rowCtrl:_getCtrlForEventTarget(this.gos,e,RowCtrl.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):s&&s.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,i){const s=e.getRowNode(),o=e.getColumn(),r=e.isEditing();if(!_isUserSuppressingKeyboardEvent(this.gos,i,s,o,r)&&t==="keydown"&&(!r&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),_isEventFromPrintableCharacter(i)&&e.processCharacter(i)),t==="keydown"){const l=e.createEvent(i,"cellKeyDown");this.eventService.dispatchEvent(l)}}processFullWidthRowKeyboardEvent(e,t,i){const s=e.getRowNode(),o=this.focusService.getFocusedCell(),r=o&&o.column;if(!_isUserSuppressingKeyboardEvent(this.gos,i,s,r,!1)){const l=i.key;if(t==="keydown")switch(l){case KeyCode.PAGE_HOME:case KeyCode.PAGE_END:case KeyCode.PAGE_UP:case KeyCode.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case KeyCode.UP:case KeyCode.DOWN:e.onKeyboardNavigate(i);break;case KeyCode.TAB:e.onTabKeyDown(i);break;default:}}if(t==="keydown"){const l=e.createRowEvent("cellKeyDown",i);this.eventService.dispatchEvent(l)}}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey||t||!this.mouseEventService.isEventFromThisGrid(e))return;const i=_normaliseQwertyAzerty(e);if(i===KeyCode.A)return this.onCtrlAndA(e);if(i===KeyCode.C)return this.onCtrlAndC(e);if(i===KeyCode.D)return this.onCtrlAndD(e);if(i===KeyCode.V)return this.onCtrlAndV(e);if(i===KeyCode.X)return this.onCtrlAndX(e);if(i===KeyCode.Y)return this.onCtrlAndY();if(i===KeyCode.Z)return this.onCtrlAndZ(e)}onCtrlAndA(e){const{pinnedRowModel:t,rowModel:i,rangeService:s}=this;if(s&&i.isRowsToRender()){const[o,r]=[t.isEmpty("top"),t.isEmpty("bottom")],n=o?null:"top";let l,a;r?(l=null,a=i.getRowCount()-1):(l="bottom",a=t.getPinnedBottomRowNodes().length-1);const d=this.visibleColsService.getAllCols();if(_missingOrEmpty(d))return;s.setCellRange({rowStartIndex:0,rowStartPinned:n,rowEndIndex:a,rowEndPinned:l,columnStart:d[0],columnEnd:_last(d)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){!this.gos.get("undoRedoCellEditing")||!this.undoRedoService||(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService?.redo("ui")}},SetPinnedLeftWidthFeature=class extends BeanStub{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({leftPinnedWidthChanged:this.onPinnedLeftWidthChanged.bind(this)})}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;_setDisplayed(this.element,t),_setFixedWidth(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}},SetPinnedRightWidthFeature=class extends BeanStub{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({rightPinnedWidthChanged:this.onPinnedRightWidthChanged.bind(this)})}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;_setDisplayed(this.element,t),_setFixedWidth(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}},getTopRowCtrls=e=>e.getTopRowCtrls(),getStickyTopRowCtrls=e=>e.getStickyTopRowCtrls(),getStickyBottomRowCtrls=e=>e.getStickyBottomRowCtrls(),getBottomRowCtrls=e=>e.getBottomRowCtrls(),getCentreRowCtrls=e=>e.getCentreRowCtrls(),ContainerCssClasses={center:{type:"center",container:"ag-center-cols-container",viewport:"ag-center-cols-viewport",getRowCtrls:getCentreRowCtrls},left:{type:"left",container:"ag-pinned-left-cols-container",pinnedType:"left",getRowCtrls:getCentreRowCtrls},right:{type:"right",container:"ag-pinned-right-cols-container",pinnedType:"right",getRowCtrls:getCentreRowCtrls},fullWidth:{type:"fullWidth",container:"ag-full-width-container",fullWidth:!0,getRowCtrls:getCentreRowCtrls},topCenter:{type:"center",container:"ag-floating-top-container",viewport:"ag-floating-top-viewport",getRowCtrls:getTopRowCtrls},topLeft:{type:"left",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:getTopRowCtrls},topRight:{type:"right",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:getTopRowCtrls},topFullWidth:{type:"fullWidth",container:"ag-floating-top-full-width-container",fullWidth:!0,getRowCtrls:getTopRowCtrls},stickyTopCenter:{type:"center",container:"ag-sticky-top-container",viewport:"ag-sticky-top-viewport",getRowCtrls:getStickyTopRowCtrls},stickyTopLeft:{type:"left",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:getStickyTopRowCtrls},stickyTopRight:{type:"right",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:getStickyTopRowCtrls},stickyTopFullWidth:{type:"fullWidth",container:"ag-sticky-top-full-width-container",fullWidth:!0,getRowCtrls:getStickyTopRowCtrls},stickyBottomCenter:{type:"center",container:"ag-sticky-bottom-container",viewport:"ag-sticky-bottom-viewport",getRowCtrls:getStickyBottomRowCtrls},stickyBottomLeft:{type:"left",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:getStickyBottomRowCtrls},stickyBottomRight:{type:"right",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:getStickyBottomRowCtrls},stickyBottomFullWidth:{type:"fullWidth",container:"ag-sticky-bottom-full-width-container",fullWidth:!0,getRowCtrls:getStickyBottomRowCtrls},bottomCenter:{type:"center",container:"ag-floating-bottom-container",viewport:"ag-floating-bottom-viewport",getRowCtrls:getBottomRowCtrls},bottomLeft:{type:"left",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:getBottomRowCtrls},bottomRight:{type:"right",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:getBottomRowCtrls},bottomFullWidth:{type:"fullWidth",container:"ag-floating-bottom-full-width-container",fullWidth:!0,getRowCtrls:getBottomRowCtrls}};function _getRowContainerOptions(e){return ContainerCssClasses[e]}var allTopNoFW=["topCenter","topLeft","topRight"],allBottomNoFW=["bottomCenter","bottomLeft","bottomRight"],allMiddleNoFW=["center","left","right"],allMiddle=["center","left","right","fullWidth"],allCenter=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],allLeft=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],allRight=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],allStickyTopNoFW=["stickyTopCenter","stickyTopLeft","stickyTopRight"],allStickyBottomNoFW=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],allStickyContainers=[...allStickyTopNoFW,"stickyTopFullWidth",...allStickyBottomNoFW,"stickyBottomFullWidth"],allNoFW=[...allTopNoFW,...allBottomNoFW,...allMiddleNoFW,...allStickyTopNoFW,...allStickyBottomNoFW],RowContainerCtrl=class extends BeanStub{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.options=_getRowContainerOptions(e)}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService,this.columnViewportService=e.columnViewportService,this.resizeObserverService=e.resizeObserverService,this.rowRenderer=e.rowRenderer}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new ViewportSizeFeature(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.ctrlsService.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,i){this.comp=e,this.eContainer=t,this.eViewport=i,this.createManagedBean(new RowContainerEventsFeature(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows(),this.forContainers(allLeft,()=>{this.pinnedWidthFeature=this.createManagedBean(new SetPinnedLeftWidthFeature(this.eContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:()=>this.onPinnedWidthChanged()})}),this.forContainers(allRight,()=>{this.pinnedWidthFeature=this.createManagedBean(new SetPinnedRightWidthFeature(this.eContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:()=>this.onPinnedWidthChanged()})}),this.forContainers(allMiddle,()=>this.createManagedBean(new SetHeightFeature(this.eContainer,this.name==="center"?i:void 0))),this.forContainers(allNoFW,()=>this.createManagedBean(new DragListenerFeature(this.eContainer))),this.forContainers(allCenter,()=>this.createManagedBean(new CenterWidthFeature(s=>this.comp.setContainerWidth(`${s}px`)))),this.addListeners(),this.registerWithCtrlsService()}addListeners(){this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),displayedRowsChanged:e=>this.onDisplayedRowsChanged(e.afterScroll)}),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if(allStickyContainers.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const t=()=>{const i=this.gos.get("ensureDomOrder"),s=this.gos.isDomLayout("print");this.comp.setDomOrder(i||s)};this.addManagedPropertyListener("domLayout",t),t()}stopHScrollOnPinnedRows(){this.forContainers(["topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],()=>{const e=()=>this.eViewport.scrollLeft=0;this.addManagedElementListeners(this.eViewport,{scroll:e})})}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const e=t=>{this.dragService.isDragging()&&t.cancelable&&t.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",e))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnViewportService.setScrollPosition(t,i,e)}getCenterWidth(){return _getInnerWidth(this.eViewport)}getCenterViewportScrollLeft(){return _getScrollLeft(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return _isInDOM(this.eViewport)}getViewportScrollLeft(){return _getScrollLeft(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||_isHorizontalScrollShowing(this.eViewport)}getViewportElement(){return this.eViewport}setContainerTranslateX(e){this.eContainer.style.transform=`translateX(${e}px)`}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){_setScrollLeft(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(this.options.pinnedType!=null)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.options.getRowCtrls(this.rowRenderer);if(!this.visible||t.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}const i=this.gos.isDomLayout("print"),o=this.gos.get("embedFullWidthRows")||i,r=t.filter(n=>{const l=n.isFullWidth();return this.options.fullWidth?!o&&l:o||!l});this.comp.setRowCtrls({rowCtrls:r,useFlushSync:e})}};function templateFactory(e){let t;return e.type==="center"?t=`<div class="${e.viewport}" data-ref="eViewport" role="presentation">
|
|
119
|
+
</div>`,[AgCheckboxSelector]),this.eCheckbox=RefPlaceholder}postConstruct(){this.eCheckbox.setPassive(!0)}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=_getAriaCheckboxStateName(e,t),[s,o]=this.rowNode.selectable?["ariaRowToggleSelection","Press Space to toggle row selection"]:["ariaRowSelectionDisabled","Row Selection is disabled for this row"],r=e(s,o);this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${r} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){if(this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListeners(this.eCheckbox.getInputElement(),{dblclick:s=>_stopPropagationForAgGrid(s),click:s=>{_stopPropagationForAgGrid(s);const o=this.gos.get("groupSelectsFiltered"),r=this.eCheckbox.getValue();this.shouldHandleIndeterminateState(r,o)?this.onClicked(!0,o,s||{})===0&&this.onClicked(!1,o,s):r?this.onClicked(!1,o,s):this.onClicked(!0,o,s||{})}}),this.addManagedListeners(this.rowNode,{rowSelected:this.onSelectionChanged.bind(this),dataChanged:this.onDataChanged.bind(this),selectableChanged:this.onSelectableChanged.bind(this)}),this.gos.get("isRowSelectable")||typeof this.getIsVisible()=="function"){const s=this.showOrHideSelect.bind(this);this.addManagedEventListeners({displayedColumnsChanged:s}),this.addManagedListeners(this.rowNode,{dataChanged:s,cellChanged:s}),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(this.eCheckbox.getPreviousValue()===void 0||e===void 0)&&this.gos.isRowModelType("clientSide")}showOrHideSelect(){let e=this.rowNode.selectable;const t=this.getIsVisible();if(e)if(typeof t=="function"){const s=this.overrides?.callbackParams;if(!this.column)e=t({...s,node:this.rowNode,data:this.rowNode.data});else{const o=this.column.createColumnFunctionCallbackParams(this.rowNode);e=t({...s,...o})}}else e=t??!1;if(this.column?.getColDef().showDisabledCheckboxes){this.eCheckbox.setDisabled(!e),this.setVisible(!0),this.setDisplayed(!0);return}if(this.overrides?.removeHidden){this.setDisplayed(e);return}this.setVisible(e)}getIsVisible(){return this.overrides?this.overrides.isVisible:this.column?.getColDef()?.checkboxSelection}},DndSourceComp=class extends Component{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild(_createIconNoSpan("rowDrag",this.gos,null)),this.addGuiEventListener("mousedown",t=>{t.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);const i=()=>{try{const s=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",s),e.dataTransfer.setData("text/plain",s)}catch{}};if(t){const s=this.gos.addGridCommonParams({rowNode:this.rowNode,dragEvent:e});t(s)}else i()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}},CellCustomStyleFeature=class extends BeanStub{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),{cellClassRules:t}=e,i=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex});this.beans.stylingService.processClassRules(t===this.cellClassRules?void 0:this.cellClassRules,t,i,s=>this.cellComp.addOrRemoveCssClass(s,!0),s=>this.cellComp.addOrRemoveCssClass(s,!1)),this.cellClassRules=t}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if(typeof e.cellStyle=="function"){const i=this.beans.gos.addGridCommonParams({column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex}),s=e.cellStyle;t=s(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t=this.beans.gos.addGridCommonParams({value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex});this.staticClasses.length&&this.staticClasses.forEach(i=>this.cellComp.addOrRemoveCssClass(i,!1)),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach(i=>this.cellComp.addOrRemoveCssClass(i,!0))}destroy(){super.destroy()}},CellKeyboardListenerFeature=class extends BeanStub{constructor(e,t,i,s,o){super(),this.cellCtrl=e,this.beans=t,this.rowNode=s,this.rowCtrl=o}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case KeyCode.ENTER:this.onEnterKeyDown(e);break;case KeyCode.F2:this.onF2KeyDown(e);break;case KeyCode.ESCAPE:this.onEscapeKeyDown(e);break;case KeyCode.TAB:this.onTabKeyDown(e);break;case KeyCode.BACKSPACE:case KeyCode.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case KeyCode.DOWN:case KeyCode.UP:case KeyCode.RIGHT:case KeyCode.LEFT:this.onNavigationKeyDown(e,t);break}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:i,beans:s,rowNode:o}=this,{gos:r,rangeService:n,eventService:l}=s;if(!i.isEditing()){if(l.dispatchEvent({type:"keyShortcutChangedCellStart"}),_isDeleteKey(e,r.get("enableCellEditingOnBackspace"))){if(n&&r.get("enableRangeSelection"))n.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"});else if(i.isCellEditable()){const a=i.getColumn(),d=this.beans.valueService.parseValue(a,o,"",o.getValueFromValueService(a))??null;o.setDataValue(a,d,"cellClear")}}else i.startRowOrCellEdit(e,t);l.dispatchEvent({type:"keyShortcutChangedCellEnd"})}}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gos.get("enterNavigatesVertically")){const t=e.shiftKey?KeyCode.UP:KeyCode.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(KeyCode.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(KeyCode.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const s=e.key;s===" "?this.onSpaceKeyDown(e):(this.cellCtrl.startRowOrCellEdit(s,e),e.preventDefault())}onSpaceKeyDown(e){const{gos:t}=this.beans;if(!this.cellCtrl.isEditing()&&t.isRowSelection()){const i=this.rowNode.isSelected(),s=!i;if(s||!t.get("suppressRowDeselection")){const o=this.beans.gos.get("groupSelectsFiltered"),r=this.rowNode.setSelectedParams({newValue:s,rangeSelect:e.shiftKey,groupSelectsFiltered:o,event:e,source:"spaceKey"});i===void 0&&r===0&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:o,event:e,source:"spaceKey"})}}e.preventDefault()}destroy(){super.destroy()}},CellMouseListenerFeature=class extends BeanStub{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!_isStopPropagationForAgGrid(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t);break}}onCellClicked(e){if(this.isDoubleClickOnIPad()){this.onCellDoubleClicked(e),e.preventDefault();return}const{eventService:t,rangeService:i,gos:s}=this.beans,o=e.ctrlKey||e.metaKey;i&&o&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const r=this.cellCtrl.createEvent(e,"cellClicked");t.dispatchEvent(r);const n=this.column.getColDef();n.onCellClicked&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{n.onCellClicked(r)})},0),(s.get("singleClickEdit")||n.singleClickEdit)&&!s.get("suppressClickEdit")&&!(e.shiftKey&&i?.getCellRanges().length!=0)&&this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!_isIOSUserAgent()||_isEventSupported("dblclick"))return!1;const e=new Date().getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const{column:t,beans:i,cellCtrl:s}=this,{eventService:o,frameworkOverrides:r,gos:n}=i,l=t.getColDef(),a=s.createEvent(e,"cellDoubleClicked");o.dispatchEvent(a),typeof l.onCellDoubleClicked=="function"&&window.setTimeout(()=>{r.wrapOutgoing(()=>{l.onCellDoubleClicked(a)})},0),!n.get("singleClickEdit")&&!n.get("suppressClickEdit")&&s.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:s}=e,o=e.target,{cellCtrl:r,beans:n}=this,{eventService:l,rangeService:a,focusService:d,gos:h}=n;if(this.isRightClickInExistingRange(e))return;const c=a&&a.getCellRanges().length!=0;if(!s||!c){const g=h.get("enableCellTextSelection")&&e.defaultPrevented,p=(_isBrowserSafari()||g)&&!r.isEditing()&&!_isFocusableFormField(o);r.focusCell(p)}if(s&&c&&!d.isCellFocused(r.getCellPosition())){e.preventDefault();const u=d.getFocusedCell();if(u){const{column:g,rowIndex:p,rowPinned:f}=u,C=n.rowRenderer.getRowByPosition({rowIndex:p,rowPinned:f})?.getCellCtrl(g);C?.isEditing()&&C.stopEditing(),d.setFocusedCell({column:g,rowIndex:p,rowPinned:f,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(o)){if(a){const u=this.cellCtrl.getCellPosition();if(s)a.extendLatestRangeToCell(u);else{const g=t||i;a.setRangeToCell(u,g)}}l.dispatchEvent(this.cellCtrl.createEvent(e,"cellMouseDown"))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),s=e.button===2||e.ctrlKey&&this.beans.gos.get("allowContextMenuWithControlKey");if(i&&s)return!0}return!1}containsWidget(e){return _isElementChildOfClass(e,"ag-selection-checkbox",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,"cellMouseOut");this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,"cellMouseOver");this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),s=t.contains(e.relatedTarget);return i&&s}destroy(){super.destroy()}},CellPositionFeature=class extends BeanStub{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode),this.addManagedListeners(this.beans.eventService,{newColumnsLoaded:()=>this.onNewColumnsLoaded()})}setComp(e){this.eGui=e,this.setupColSpan(),this.setupRowSpan(),this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onNewColumnsLoaded(){const e=this.column.getRowSpan(this.rowNode);this.rowSpan!==e&&(this.rowSpan=e,this.applyRowSpan(!0))}onDisplayColumnsChanged(){const e=this.getColSpanningList();_areEqual(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){this.column.getColDef().colSpan!=null&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListeners(this.beans.eventService,{displayedColumnsChanged:this.onDisplayColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onWidthChanged.bind(this)}))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=`${e}px`}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(e===1)t.push(this.column);else{let i=this.column;const s=this.column.getPinned();for(let o=0;i&&o<e&&(t.push(i),i=this.beans.visibleColsService.getColAfter(i),!(!i||_missing(i)||s!==i.getPinned()));o++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return this.beans.gos.get("enableRtl")&&this.colsSpanning?e=_last(this.colsSpanning):e=this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||this.column.getPinned()==="left")return e;const t=this.beans.visibleColsService.getColsLeftWidth();if(this.column.getPinned()==="right"){const i=this.beans.visibleColsService.getBodyContainerWidth();return t+i+(e||0)}return t+(e||0)}applyRowSpan(e){if(this.rowSpan===1&&!e)return;const i=this.beans.gos.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=`${i}px`,this.eGui.style.zIndex="1"}destroy(){super.destroy()}},SelectionHandleType=(e=>(e[e.FILL=0]="FILL",e[e.RANGE=1]="RANGE",e))(SelectionHandleType||{}),CellRangeType=(e=>(e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION",e))(CellRangeType||{}),CSS_CELL_RANGE_SELECTED="ag-cell-range-selected",CSS_CELL_RANGE_CHART="ag-cell-range-chart",CSS_CELL_RANGE_SINGLE_CELL="ag-cell-range-single-cell",CSS_CELL_RANGE_CHART_CATEGORY="ag-cell-range-chart-category",CSS_CELL_RANGE_HANDLE="ag-cell-range-handle",CSS_CELL_RANGE_TOP="ag-cell-range-top",CSS_CELL_RANGE_RIGHT="ag-cell-range-right",CSS_CELL_RANGE_BOTTOM="ag-cell-range-bottom",CSS_CELL_RANGE_LEFT="ag-cell-range-left",CellRangeFeature=class{constructor(e,t){this.beans=e,this.rangeService=e.rangeService,this.selectionHandleFactory=e.selectionHandleFactory,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_SELECTED,this.rangeCount!==0),this.cellComp.addOrRemoveCssClass(`${CSS_CELL_RANGE_SELECTED}-1`,this.rangeCount===1),this.cellComp.addOrRemoveCssClass(`${CSS_CELL_RANGE_SELECTED}-2`,this.rangeCount===2),this.cellComp.addOrRemoveCssClass(`${CSS_CELL_RANGE_SELECTED}-3`,this.rangeCount===3),this.cellComp.addOrRemoveCssClass(`${CSS_CELL_RANGE_SELECTED}-4`,this.rangeCount>=4),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_CHART,this.hasChartRange),_setAriaSelected(this.eGui,this.rangeCount>0?!0:void 0),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_SINGLE_CELL,this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,s=!t&&e.right,o=!t&&e.bottom,r=!t&&e.left;this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_TOP,i),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_RIGHT,s),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_BOTTOM,o),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_LEFT,r)}isSingleCell(){const{rangeService:e}=this.beans;return this.rangeCount===1&&!!e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(i=>_includes([1,0],i.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gos.get("enableRtl");let t=!1,i=!1,s=!1,o=!1;const r=this.cellCtrl.getCellPosition().column,n=this.beans.visibleColsService;let l,a;e?(l=n.getColAfter(r),a=n.getColBefore(r)):(l=n.getColBefore(r),a=n.getColAfter(r));const d=this.rangeService.getCellRanges().filter(h=>this.rangeService.isCellInSpecificRange(this.cellCtrl.getCellPosition(),h));l||(o=!0),a||(i=!0);for(let h=0;h<d.length&&!(t&&i&&s&&o);h++){const c=d[h],u=this.rangeService.getRangeStartRow(c),g=this.rangeService.getRangeEndRow(c);!t&&this.beans.rowPositionUtils.sameRow(u,this.cellCtrl.getCellPosition())&&(t=!0),!s&&this.beans.rowPositionUtils.sameRow(g,this.cellCtrl.getCellPosition())&&(s=!0),!o&&l&&c.columns.indexOf(l)<0&&(o=!0),!i&&a&&c.columns.indexOf(a)<0&&(i=!0)}return{top:t,right:i,bottom:s,left:o}}refreshHandle(){if(this.beans.context.isDestroyed())return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_HANDLE,!!this.selectionHandle)}shouldHaveSelectionHandle(){const e=this.beans.gos,t=this.rangeService.getCellRanges(),i=t.length;if(this.rangeCount<1||i<1)return!1;const s=_last(t),o=this.cellCtrl.getCellPosition(),r=e.get("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),n=e.get("enableRangeHandle");let l=i===1&&!this.cellCtrl.isEditing()&&(r||n);if(this.hasChartRange){const d=t[0].type===1&&this.rangeService.isCellInSpecificRange(o,t[0]);this.cellComp.addOrRemoveCssClass(CSS_CELL_RANGE_CHART_CATEGORY,d),l=s.type===0}return l&&s.endRow!=null&&this.rangeService.isContiguousRange(s)&&this.rangeService.isBottomRightCell(s,o)}addSelectionHandle(){const e=this.beans.gos,t=_last(this.rangeService.getCellRanges()).type,s=e.get("enableFillHandle")&&_missing(t)?0:1;this.selectionHandle&&this.selectionHandle.getType()!==s&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.selectionHandleFactory.createSelectionHandle(s)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}},CSS_CELL="ag-cell",CSS_AUTO_HEIGHT="ag-cell-auto-height",CSS_NORMAL_HEIGHT="ag-cell-normal-height",CSS_CELL_FOCUS="ag-cell-focus",CSS_CELL_FIRST_RIGHT_PINNED="ag-cell-first-right-pinned",CSS_CELL_LAST_LEFT_PINNED="ag-cell-last-left-pinned",CSS_CELL_NOT_INLINE_EDITING="ag-cell-not-inline-editing",CSS_COLUMN_HOVER="ag-column-hover",CSS_CELL_WRAP_TEXT="ag-cell-wrap-text",instanceIdSequence4=0,_CellCtrl=class L extends BeanStub{constructor(t,i,s,o){super(),this.column=t,this.rowNode=i,this.beans=s,this.rowCtrl=o,this.cellRangeFeature=null,this.cellPositionFeature=null,this.cellCustomStyleFeature=null,this.tooltipFeature=null,this.cellMouseListenerFeature=null,this.cellKeyboardListenerFeature=null,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.instanceId=t.getId()+"-"+instanceIdSequence4++,this.colIdSanitised=_escapeString(this.column.getId()),s.gos.get("suppressCellFocus")||(this.tabIndex=-1),this.createCellPosition(),this.addFeatures(),this.updateAndFormatValue(!1)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}addFeatures(){this.cellPositionFeature=new CellPositionFeature(this,this.beans),this.addDestroyFunc(()=>{this.cellPositionFeature?.destroy(),this.cellPositionFeature=null}),this.cellCustomStyleFeature=new CellCustomStyleFeature(this,this.beans),this.addDestroyFunc(()=>{this.cellCustomStyleFeature?.destroy(),this.cellCustomStyleFeature=null}),this.cellMouseListenerFeature=new CellMouseListenerFeature(this,this.beans,this.column),this.addDestroyFunc(()=>{this.cellMouseListenerFeature?.destroy(),this.cellMouseListenerFeature=null}),this.cellKeyboardListenerFeature=new CellKeyboardListenerFeature(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc(()=>{this.cellKeyboardListenerFeature?.destroy(),this.cellKeyboardListenerFeature=null}),this.column.isTooltipEnabled()&&(this.enableTooltipFeature(),this.addDestroyFunc(()=>{this.disableTooltipFeature()})),this.beans.rangeService&&this.beans.gos.get("enableRangeSelection")&&(this.cellRangeFeature=new CellRangeFeature(this.beans,this),this.addDestroyFunc(()=>{this.cellRangeFeature?.destroy(),this.cellRangeFeature=null}))}enableTooltipFeature(t,i){const s=()=>{const n=this.column.getColDef(),l=this.rowNode.data;if(n.tooltipField&&_exists(l))return _getValueUsingField(l,n.tooltipField,this.column.isTooltipFieldContainsDots());const a=n.tooltipValueGetter;return a?a(this.beans.gos.addGridCommonParams({location:"cell",colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted})):null},o=this.beans.gos.get("tooltipShowMode")==="whenTruncated";!i&&o&&!this.isCellRenderer()&&(i=()=>{const n=this.getGui(),l=n.children.length===0?n:n.querySelector(".ag-cell-value");return l?l.scrollWidth>l.clientWidth:!0});const r={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:t!=null?()=>t:s,getValueFormatted:()=>this.valueFormatted,shouldDisplayTooltip:i};this.tooltipFeature=new TooltipFeature(r,this.beans)}disableTooltipFeature(){this.tooltipFeature&&(this.tooltipFeature.destroy(),this.tooltipFeature=null)}setComp(t,i,s,o,r){this.cellComp=t,this.eGui=i,this.printLayout=o,this.addDomData(),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),this.setupAutoHeight(s),this.refreshFirstAndLastStyles(),this.refreshAriaColIndex(),this.cellPositionFeature?.setComp(i),this.cellCustomStyleFeature?.setComp(t),this.tooltipFeature?.refreshToolTip(),this.cellKeyboardListenerFeature?.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(t,i),r&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(n=>n()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(t){if(this.isAutoHeight=this.column.isAutoHeight(),!this.isAutoHeight||!t)return;const i=t.parentElement,s=this.beans.gos.getRowHeightForNode(this.rowNode).height,o=l=>{if(this.editing||!this.isAlive())return;const{paddingTop:a,paddingBottom:d,borderBottomWidth:h,borderTopWidth:c}=_getElementSize(i),u=a+d+h+c,p=t.offsetHeight+u;if(l<5){const m=this.beans.gos.getDocument(),C=!m||!m.contains(t),v=p==0;if(C||v){window.setTimeout(()=>o(l+1),0);return}}const f=Math.max(p,s);this.rowNode.setRowAutoHeight(f,this.column)},r=()=>o(0);r();const n=this.beans.resizeObserverService.observeResize(t,r);this.addDestroyFunc(()=>{n(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getCellAriaRole(){return this.column.getColDef().cellAriaRole??"gridcell"}getInstanceId(){return this.instanceId}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}isCellRenderer(){const t=this.column.getColDef();return t.cellRenderer!=null||t.cellRendererSelector!=null}getValueToDisplay(){return this.valueFormatted??this.value}showValue(t=!1){const i=this.getValueToDisplay();let s;if(this.rowNode.stub){const o=this.createCellRendererParams();s=this.beans.userComponentFactory.getLoadingCellRendererDetails(this.column.getColDef(),o)}else if(this.isCellRenderer()){const o=this.createCellRendererParams();s=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),o)}this.cellComp.setRenderDetails(s,i,t),this.cellRangeFeature?.refreshHandle()}setupControlComps(){const t=this.column.getColDef();this.includeSelection=this.isIncludeControl(t.checkboxSelection),this.includeRowDrag=this.isIncludeControl(t.rowDrag),this.includeDndSource=this.isIncludeControl(t.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gos.get("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(t){return this.rowNode.rowPinned!=null?!1:typeof t=="function"||t===!0}refreshShouldDestroy(){const t=this.column.getColDef(),i=this.includeSelection!=this.isIncludeControl(t.checkboxSelection),s=this.includeRowDrag!=this.isIncludeControl(t.rowDrag),o=this.includeDndSource!=this.isIncludeControl(t.dndSource),r=this.isAutoHeight!=this.column.isAutoHeight();return i||s||o||r}startEditing(t=null,i=!1,s=null){const{editService:o}=this.beans;if(!(!this.isCellEditable()||this.editing||!o)){if(!this.cellComp){this.onCellCompAttachedFuncs.push(()=>{this.startEditing(t,i,s)});return}o.startEditing(this,t,i,s)}}setEditing(t,i){this.editCompDetails=i,this.editing!==t&&(this.editing=t,this.cellRangeFeature?.refreshHandle())}stopRowOrCellEdit(t=!1){this.beans.gos.get("editType")==="fullRow"?this.rowCtrl.stopEditing(t):this.stopEditing(t)}onPopupEditorClosed(){this.editing&&this.stopEditingAndFocus()}stopEditing(t=!1){const{editService:i}=this.beans;return!this.editing||!i?!1:i.stopEditing(this,t)}createCellRendererParams(){return this.beans.gos.addGridCommonParams({value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.rowNode.getValueFromValueService(this.column),setValue:i=>this.beans.valueService.setValue(this.rowNode,this.column,i),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(i,s,o,r)=>this.registerRowDragger(i,s,r),setTooltip:(i,s)=>{this.tooltipFeature&&this.disableTooltipFeature(),this.enableTooltipFeature(i,s),this.tooltipFeature?.refreshToolTip()}})}setFocusOutOnEditor(){this.editing&&this.beans.editService?.setFocusOutOnEditor(this)}setFocusInOnEditor(){this.editing&&this.beans.editService?.setFocusInOnEditor(this)}onCellChanged(t){t.column===this.column&&this.refreshCell({})}refreshOrDestroyCell(t){this.refreshShouldDestroy()?this.rowCtrl?.recreateCell(this):this.refreshCell(t)}refreshCell(t){if(this.suppressRefreshCell||this.editing)return;const i=this.column.getColDef(),s=t!=null&&!!t.newData,o=t!=null&&!!t.suppressFlash||!!i.suppressCellFlash,r=i.field==null&&i.valueGetter==null&&i.showRowGroup==null,n=t&&t.forceRefresh||r||s,l=!!this.cellComp,a=this.updateAndFormatValue(l),d=n||a;if(l){if(d){this.showValue(s);const h=this.beans.filterManager?.isSuppressFlashingCellsBecauseFiltering();!o&&!h&&(this.beans.gos.get("enableCellChangeFlash")||i.enableCellChangeFlash)&&this.flashCell(),this.cellCustomStyleFeature?.applyUserStyles(),this.cellCustomStyleFeature?.applyClassesFromColDef()}this.tooltipFeature?.refreshToolTip(),this.cellCustomStyleFeature?.applyCellClassRules()}}stopEditingAndFocus(t=!1,i=!1){this.beans.editService?.stopEditingAndFocus(this,t,i)}flashCell(t){const i=t?.flashDuration??t?.flashDelay,s=t?.fadeDuration??t?.fadeDelay;this.animateCell("data-changed",i,s)}animateCell(t,i,s){if(!this.cellComp)return;const o=`ag-cell-${t}`,r=`ag-cell-${t}-animation`,{gos:n}=this.beans;i||(i=n.get("cellFlashDuration")),_exists(s)||(s=n.get("cellFadeDuration")),this.cellComp.addOrRemoveCssClass(o,!0),this.cellComp.addOrRemoveCssClass(r,!1),this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(o,!1),this.cellComp.addOrRemoveCssClass(r,!0),this.eGui.style.transition=`background-color ${s}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(r,!1),this.eGui.style.transition="")},s))},i)})}onFlashCells(t){if(!this.cellComp)return;const i=this.beans.cellPositionUtils.createId(this.getCellPosition());t.cells[i]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(t){return this.callValueFormatter(t)??t}callValueFormatter(t){return this.beans.valueService.formatValue(this.column,this.rowNode,t)}updateAndFormatValue(t){const i=this.value,s=this.valueFormatted;return this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value),t?!this.valuesAreEqual(i,this.value)||this.valueFormatted!=s:!0}valuesAreEqual(t,i){const s=this.column.getColDef();return s.equals?s.equals(t,i):t===i}getComp(){return this.cellComp}getValue(){return this.value}addDomData(){const t=this.getGui();this.beans.gos.setDomData(t,L.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc(()=>this.beans.gos.setDomData(t,L.DOM_DATA_KEY_CELL_CTRL,null))}createEvent(t,i){return this.beans.gos.addGridCommonParams({type:i,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),rowPinned:this.rowNode.rowPinned,event:t,rowIndex:this.rowNode.rowIndex})}processCharacter(t){this.cellKeyboardListenerFeature?.processCharacter(t)}onKeyDown(t){this.cellKeyboardListenerFeature?.onKeyDown(t)}onMouseEvent(t,i){this.cellMouseListenerFeature?.onMouseEvent(t,i)}getGui(){return this.eGui}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){this.cellComp&&this.cellPositionFeature?.onLeftChanged()}onDisplayedColumnsChanged(){this.eGui&&(this.refreshAriaColIndex(),this.refreshFirstAndLastStyles())}refreshFirstAndLastStyles(){const{cellComp:t,column:i,beans:s}=this;refreshFirstAndLastStyles(t,i,s.visibleColsService)}refreshAriaColIndex(){const t=this.beans.visibleColsService.getAriaColIndex(this.column);_setAriaColIndex(this.getGui(),t)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){return this.cellPositionFeature?.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}isPrintLayout(){return this.printLayout}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(t,i=null){if(!this.cellComp){this.onCellCompAttachedFuncs.push(()=>{this.startRowOrCellEdit(t,i)});return}this.beans.gos.get("editType")==="fullRow"?this.rowCtrl.startRowEditing(t,this):this.startEditing(t,!0,i)}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onRangeSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}isRangeSelectionEnabled(){return this.cellRangeFeature!=null}focusCell(t=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:t})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}onFirstRightPinnedChanged(){if(!this.cellComp)return;const t=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass(CSS_CELL_FIRST_RIGHT_PINNED,t)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const t=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass(CSS_CELL_LAST_LEFT_PINNED,t)}onCellFocused(t){if(this.beans.gos.get("suppressCellFocus"))return;const i=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp){i&&t?.forceBrowserFocus&&(this.focusEventToRestore=t);return}if(this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass(CSS_CELL_FOCUS,i),i&&t&&t.forceBrowserFocus){let o=this.cellComp.getFocusableElement();if(this.editing){const r=this.beans.focusService.findFocusableElements(o,null,!0);r.length&&(o=r[0])}o.focus({preventScroll:!!t.preventScrollOnBrowserFocus})}const s=this.beans.gos.get("editType")==="fullRow";!i&&!s&&this.editing&&this.stopRowOrCellEdit(),i&&this.rowCtrl.announceDescription()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:_makeNull(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass(CSS_CELL,!0),this.cellComp.addOrRemoveCssClass(CSS_CELL_NOT_INLINE_EDITING,!0);const t=this.column.isAutoHeight()==!0;this.cellComp.addOrRemoveCssClass(CSS_AUTO_HEIGHT,t),this.cellComp.addOrRemoveCssClass(CSS_NORMAL_HEIGHT,!t)}onColumnHover(){if(!this.cellComp||!this.beans.gos.get("columnHoverHighlight"))return;const t=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass(CSS_COLUMN_HOVER,t)}onColDefChanged(){if(!this.cellComp)return;this.column.isTooltipEnabled()?(this.disableTooltipFeature(),this.enableTooltipFeature()):this.disableTooltipFeature(),this.setWrapText(),this.editing?this.beans.editService?.handleColDefChanged(this):this.refreshOrDestroyCell({forceRefresh:!0,suppressFlash:!0})}setWrapText(){const t=this.column.getColDef().wrapText==!0;this.cellComp.addOrRemoveCssClass(CSS_CELL_WRAP_TEXT,t)}dispatchCellContextMenuEvent(t){const i=this.column.getColDef(),s=this.createEvent(t,"cellContextMenu");this.beans.eventService.dispatchEvent(s),i.onCellContextMenu&&window.setTimeout(()=>{this.beans.frameworkOverrides.wrapOutgoing(()=>{i.onCellContextMenu(s)})},0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const t=new CheckboxSelectionComponent;return this.beans.context.createBean(t),t.init({rowNode:this.rowNode,column:this.column}),t}createDndSource(){const t=new DndSourceComp(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(t),t}registerRowDragger(t,i,s){if(this.customRowDragComp){this.customRowDragComp.setDragElement(t,i);return}const o=this.createRowDragComp(t,i,s);o&&(this.customRowDragComp=o,this.addDestroyFunc(()=>{this.beans.context.destroyBean(o),this.customRowDragComp=null}))}createRowDragComp(t,i,s){const o=this.beans.gos.get("pagination"),r=this.beans.gos.get("rowDragManaged"),n=this.beans.gos.isRowModelType("clientSide");if(r){if(!n){_warnOnce("managed row dragging is only allowed in the Client Side Row Model");return}if(o){_warnOnce("managed row dragging is not possible when doing pagination");return}}const l=new RowDragComp(()=>this.value,this.rowNode,this.column,t,i,s);return this.beans.context.createBean(l),l}setSuppressRefreshCell(t){this.suppressRefreshCell=t}getEditCompDetails(){return this.editCompDetails}};_CellCtrl.DOM_DATA_KEY_CELL_CTRL="cellCtrl";var CellCtrl=_CellCtrl,instanceIdSequence5=0,_RowCtrl=class O extends BeanStub{constructor(t,i,s,o,r){super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.rowDragComps=[],this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKeySanitised=null,this.beans=i,this.gos=i.gos,this.rowNode=t,this.paginationPage=i.paginationService?.getCurrentPage()??0,this.useAnimationFrameForCreate=o,this.printLayout=r,this.suppressRowTransform=this.gos.get("suppressRowTransform"),this.instanceId=t.id+"-"+instanceIdSequence5++,this.rowId=_escapeString(t.id),this.initRowBusinessKey(),this.rowFocused=i.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=i.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(s),this.rowStyles=this.processStylesFromGridOptions(),this.isFullWidth()&&!this.gos.get("suppressCellFocus")&&(this.tabIndex=-1),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gos.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if(typeof this.businessKeyForNodeFunc!="function")return;const t=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=_escapeString(t)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}getTabIndex(){return this.tabIndex}isSticky(){return this.rowNode.sticky}getInstanceId(){return this.instanceId}updateGui(t,i){t==="left"?this.leftGui=i:t==="right"?this.rightGui=i:t==="fullWidth"?this.fullWidthGui=i:this.centerGui=i}setComp(t,i,s){const o={rowComp:t,element:i,containerType:s};this.allRowGuis.push(o),this.updateGui(s,o),this.initialiseRowComp(o),this.rowType!=="FullWidthLoading"&&!this.rowNode.rowPinned&&this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(t){this.allRowGuis=this.allRowGuis.filter(i=>i.containerType!==t),this.updateGui(t,void 0)}isCacheable(){return this.rowType==="FullWidthDetail"&&this.gos.get("keepDetailRows")}setCached(t){const i=t?"none":"";this.allRowGuis.forEach(s=>s.element.style.display=i)}initialiseRowComp(t){const i=this.gos;this.listenOnDomOrder(t),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights(),this.onRowHeightChanged(t),this.updateRowIndexes(t),this.setFocusedClasses(t),this.setStylesFromGridOptions(!1,t),i.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(t),this.updateColumnLists(!this.useAnimationFrameForCreate);const s=t.rowComp;this.getInitialRowClasses(t.containerType).forEach(r=>s.addOrRemoveCssClass(r,!0)),this.executeSlideAndFadeAnimations(t),this.rowNode.group&&_setAriaExpanded(t.element,this.rowNode.expanded==!0),this.setRowCompRowId(s),this.setRowCompRowBusinessKey(s),i.setDomData(t.element,O.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc(()=>i.setDomData(t.element,O.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,t.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(t.element),this.isFullWidth()&&this.setupFullWidth(t),i.get("rowDragEntireRow")&&this.addRowDraggerToRow(t),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&t.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(t){this.businessKeySanitised!=null&&t.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(t){this.rowId=_escapeString(this.rowNode.id),this.rowId!=null&&t.setRowId(this.rowId)}executeSlideAndFadeAnimations(t){const{containerType:i}=t;this.slideInAnimation[i]&&(_executeNextVMTurn(()=>{this.onTopChanged()}),this.slideInAnimation[i]=!1),this.fadeInAnimation[i]&&(_executeNextVMTurn(()=>{t.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[i]=!1)}addRowDraggerToRow(t){if(this.gos.get("enableRangeSelection")){_warnOnce("Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`");return}const i=this.beans.localeService.getLocaleTextFunc(),s=new RowDragComp(()=>`1 ${i("rowDragRow","row")}`,this.rowNode,void 0,t.element,void 0,!0),o=this.createBean(s,this.beans.context);this.rowDragComps.push(o)}setupFullWidth(t){const i=this.getPinnedForContainer(t.containerType);if(this.rowType=="FullWidthDetail"&&!ModuleRegistry.__assertRegistered("@ag-grid-enterprise/master-detail","cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;const s=this.createFullWidthCompDetails(t.element,i);t.rowComp.showFullWidth(s)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderers(){return this.gos.get("embedFullWidthRows")?this.allRowGuis.map(t=>t?.rowComp?.getFullWidthCellRenderer()):[this.fullWidthGui?.rowComp?.getFullWidthCellRenderer()]}getCellElement(t){const i=this.getCellCtrl(t);return i?i.getGui():null}executeProcessRowPostCreateFunc(){const t=this.gos.getCallback("processRowPostCreate");if(!t||!this.areAllContainersReady())return;const i={eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)};t(i)}areAllContainersReady(){const t=!!this.leftGui||!this.beans.visibleColsService.isPinningLeft(),i=!!this.centerGui,s=!!this.rightGui||!this.beans.visibleColsService.isPinningRight();return t&&i&&s}setRowType(){const t=this.rowNode.stub&&!this.gos.get("suppressServerSideFullWidthLoadingRow"),i=this.rowNode.isFullWidthCell(),s=this.gos.get("masterDetail")&&this.rowNode.detail,o=this.beans.columnModel.isPivotMode(),n=!!this.rowNode.group&&!this.rowNode.footer&&this.gos.isGroupUseEntireRow(o);t?this.rowType="FullWidthLoading":s?this.rowType="FullWidthDetail":i?this.rowType="FullWidth":n?this.rowType="FullWidthGroup":this.rowType="Normal"}updateColumnLists(t=!1,i=!1){if(this.isFullWidth())return;if(t||this.gos.get("suppressAnimationFrame")||this.printLayout){this.updateColumnListsImpl(i);return}this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0)}createCellCtrls(t,i,s=null){const o={list:[],map:{}},r=(n,l)=>{o.list.push(l),o.map[n]=l};return i.forEach(n=>{const l=n.getInstanceId();let a=t.map[l];a||(a=new CellCtrl(n,this.rowNode,this.beans,this)),r(l,a)}),t.list.forEach(n=>{if(o.map[n.getColumn().getInstanceId()]!=null)return;if(!this.isCellEligibleToBeRemoved(n,s)){r(n.getColumn().getInstanceId(),n);return}n.destroy()}),o}updateColumnListsImpl(t){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(t)}setCellCtrls(t){this.allRowGuis.forEach(i=>{const s=this.getCellCtrlsForContainer(i.containerType);i.rowComp.setCellCtrls(s,t)})}getCellCtrlsForContainer(t){switch(t){case"left":return this.leftCellCtrls.list;case"right":return this.rightCellCtrls.list;case"fullWidth":return[];case"center":return this.centerCellCtrls.list}}createAllCellCtrls(){const t=this.beans.columnViewportService,i=this.beans.visibleColsService;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,i.getAllCols()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const s=t.getColsWithinViewport(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,s);const o=i.getLeftColsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,o,"left");const r=i.getRightColsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,r,"right")}}isCellEligibleToBeRemoved(t,i){if(t.getColumn().getPinned()!=i)return!0;const n=t.isEditing(),l=this.beans.focusService.isCellFocused(t.getCellPosition());if(n||l){const d=t.getColumn();return!(this.beans.visibleColsService.getAllCols().indexOf(d)>=0)}return!0}getDomOrder(){return this.gos.get("ensureDomOrder")||this.gos.isDomLayout("print")}listenOnDomOrder(t){const i=()=>{t.rowComp.setDomOrder(this.getDomOrder())};this.addManagedPropertyListener("domLayout",i),this.addManagedPropertyListener("ensureDomOrder",i)}setAnimateFlags(t){if(this.isSticky()||!t)return;const i=_exists(this.rowNode.oldRowTop),s=this.beans.visibleColsService.isPinningLeft(),o=this.beans.visibleColsService.isPinningRight();if(i){if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){this.slideInAnimation.fullWidth=!0;return}this.slideInAnimation.center=!0,this.slideInAnimation.left=s,this.slideInAnimation.right=o}else{if(this.isFullWidth()&&!this.gos.get("embedFullWidthRows")){this.fadeInAnimation.fullWidth=!0;return}this.fadeInAnimation.center=!0,this.fadeInAnimation.left=s,this.fadeInAnimation.right=o}}isEditing(){return this.editingRow}isFullWidth(){return this.rowType!=="Normal"}refreshFullWidth(){const t=(l,a)=>l?l.rowComp.refreshFullWidth(()=>this.createFullWidthCompDetails(l.element,a).params):!0,i=t(this.fullWidthGui,null),s=t(this.centerGui,null),o=t(this.leftGui,"left"),r=t(this.rightGui,"right");return i&&s&&o&&r}addListeners(){this.addManagedListeners(this.rowNode,{heightChanged:()=>this.onRowHeightChanged(),rowSelected:()=>this.onRowSelected(),rowIndexChanged:this.onRowIndexChanged.bind(this),topChanged:this.onTopChanged.bind(this),expandedChanged:this.updateExpandedCss.bind(this),hasChildrenChanged:this.updateExpandedCss.bind(this)}),this.rowNode.detail&&this.addManagedListeners(this.rowNode.parent,{dataChanged:this.onRowNodeDataChanged.bind(this)}),this.addManagedListeners(this.rowNode,{dataChanged:this.onRowNodeDataChanged.bind(this),cellChanged:this.postProcessCss.bind(this),rowHighlightChanged:this.onRowNodeHighlightChanged.bind(this),draggingChanged:this.postProcessRowDragging.bind(this),uiLevelChanged:this.onUiLevelChanged.bind(this)}),this.addManagedListeners(this.beans.eventService,{paginationPixelOffsetChanged:this.onPaginationPixelOffsetChanged.bind(this),heightScaleChanged:this.onTopChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),virtualColumnsChanged:this.onVirtualColumnsChanged.bind(this),cellFocused:this.onCellFocusChanged.bind(this),cellFocusCleared:this.onCellFocusChanged.bind(this),paginationChanged:this.onPaginationChanged.bind(this),modelUpdated:this.refreshFirstAndLastRowStyles.bind(this),columnMoved:()=>this.updateColumnLists()}),this.addDestroyFunc(()=>{this.destroyBeans(this.rowDragComps,this.beans.context),this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature,this.beans.context))}),this.addManagedPropertyListeners(["rowDragEntireRow"],()=>{if(this.gos.get("rowDragEntireRow")){this.allRowGuis.forEach(i=>{this.addRowDraggerToRow(i)});return}this.rowDragComps=this.destroyBeans(this.rowDragComps,this.beans.context)}),this.addListenersForCellComps()}addListenersForCellComps(){this.addManagedListeners(this.rowNode,{rowIndexChanged:()=>{this.getAllCellCtrls().forEach(t=>t.onRowIndexChanged())},cellChanged:t=>{this.getAllCellCtrls().forEach(i=>i.onCellChanged(t))}})}onRowNodeDataChanged(t){if(this.isFullWidth()!==!!this.rowNode.isFullWidthCell()){this.beans.rowRenderer.redrawRow(this.rowNode);return}if(this.isFullWidth()){this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode);return}this.getAllCellCtrls().forEach(s=>s.refreshCell({suppressFlash:!t.update,newData:!t.update})),this.allRowGuis.forEach(s=>{this.setRowCompRowId(s.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(s.rowComp)}),this.onRowSelected(),this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const t=this.rowNode.highlighted;this.allRowGuis.forEach(i=>{const s=t===0,o=t===1;i.rowComp.addOrRemoveCssClass("ag-row-highlight-above",s),i.rowComp.addOrRemoveCssClass("ag-row-highlight-below",o)})}postProcessRowDragging(){const t=this.rowNode.dragging;this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass("ag-row-dragging",t))}updateExpandedCss(){const t=this.rowNode.isExpandable(),i=this.rowNode.expanded==!0;this.allRowGuis.forEach(s=>{s.rowComp.addOrRemoveCssClass("ag-row-group",t),s.rowComp.addOrRemoveCssClass("ag-row-group-expanded",t&&i),s.rowComp.addOrRemoveCssClass("ag-row-group-contracted",t&&!i),_setAriaExpanded(s.element,t&&i)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:_makeNull(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(t){const i=this.allRowGuis.find(a=>a.element.contains(t.target));if(!((i?i.element:null)===t.target))return;const r=this.rowNode,n=this.beans.focusService.getFocusedCell(),l={rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:n&&n.column};this.beans.navigationService.navigateToNextCell(t,t.key,l,!0),t.preventDefault()}onTabKeyDown(t){if(t.defaultPrevented||_isStopPropagationForAgGrid(t))return;const i=this.allRowGuis.find(n=>n.element.contains(t.target)),s=i?i.element:null,o=s===t.target;let r=null;o||(r=this.beans.focusService.findNextFocusableElement(s,!1,t.shiftKey)),(this.isFullWidth()&&o||!r)&&this.beans.navigationService.onTabKeyDown(this,t)}getFullWidthElement(){return this.fullWidthGui?this.fullWidthGui.element:null}getRowYPosition(){const t=this.allRowGuis.find(i=>_isVisible(i.element))?.element;return t?t.getBoundingClientRect().top:0}onFullWidthRowFocused(t){const i=this.rowNode,s=t?this.isFullWidth()&&t.rowIndex===i.rowIndex&&t.rowPinned==i.rowPinned:!1,o=this.fullWidthGui?this.fullWidthGui.element:this.centerGui?.element;o&&(o.classList.toggle("ag-full-width-focus",s),s&&t?.forceBrowserFocus&&o.focus({preventScroll:!0}))}recreateCell(t){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,t),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,t),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,t),t.destroy(),this.updateColumnLists()}removeCellCtrl(t,i){const s={list:[],map:{}};return t.list.forEach(o=>{o!==i&&(s.list.push(o),s.map[o.getColumn().getInstanceId()]=o)}),s}onMouseEvent(t,i){switch(t){case"dblclick":this.onRowDblClick(i);break;case"click":this.onRowClick(i);break;case"touchstart":case"mousedown":this.onRowMouseDown(i);break}}createRowEvent(t,i){return this.gos.addGridCommonParams({type:t,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,event:i})}createRowEventWithSource(t,i){const s=this.createRowEvent(t,i);return s.source=this,s}onRowDblClick(t){if(_isStopPropagationForAgGrid(t))return;const i=this.createRowEventWithSource("rowDoubleClicked",t);this.beans.eventService.dispatchEvent(i)}onRowMouseDown(t){if(this.lastMouseDownOnDragger=_isElementChildOfClass(t.target,"ag-row-drag",3),!this.isFullWidth())return;const i=this.rowNode,s=this.beans.visibleColsService;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges();const o=this.getFullWidthElement(),r=t.target;let n=!0;o&&o.contains(r)&&_isFocusableFormField(r)&&(n=!1),this.beans.focusService.setFocusedCell({rowIndex:i.rowIndex,column:s.getAllCols()[0],rowPinned:i.rowPinned,forceBrowserFocus:n})}onRowClick(t){if(_isStopPropagationForAgGrid(t)||this.lastMouseDownOnDragger)return;const s=this.createRowEventWithSource("rowClicked",t);this.beans.eventService.dispatchEvent(s);const o=t.ctrlKey||t.metaKey,r=t.shiftKey;if(this.gos.get("groupSelectsChildren")&&this.rowNode.group||this.isRowSelectionBlocked()||this.gos.get("suppressRowClickSelection"))return;const l=this.gos.get("rowMultiSelectWithClick"),a=!this.gos.get("suppressRowDeselection"),d="rowClicked";if(this.rowNode.isSelected())l?this.rowNode.setSelectedParams({newValue:!1,event:t,source:d}):o?a&&this.rowNode.setSelectedParams({newValue:!1,event:t,source:d}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!r,rangeSelect:r,event:t,source:d});else{const h=l?!1:!o;this.rowNode.setSelectedParams({newValue:!0,clearSelection:h,rangeSelect:r,event:t,source:d})}}isRowSelectionBlocked(){return!this.rowNode.selectable||!!this.rowNode.rowPinned||!this.gos.isRowSelection()}setupDetailRowAutoHeight(t){if(this.rowType!=="FullWidthDetail"||!this.gos.get("detailRowAutoHeight"))return;const i=()=>{const o=t.clientHeight;if(o!=null&&o>0){const r=()=>{this.rowNode.setRowHeight(o),this.beans.rowModel.getType()==="clientSide"?this.beans.rowModel.onRowHeightChanged():this.beans.rowModel.getType()==="serverSide"&&this.beans.rowModel.onRowHeightChanged()};window.setTimeout(r,0)}},s=this.beans.resizeObserverService.observeResize(t,i);this.addDestroyFunc(s),i()}createFullWidthCompDetails(t,i){const{gos:s,rowNode:o}=this,r=s.addGridCommonParams({fullWidth:!0,data:o.data,node:o,value:o.key,valueFormatted:o.key,eGridCell:t,eParentOfValue:t,pinned:i,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(l,a,d,h)=>this.addFullWidthRowDragging(l,a,d,h),setTooltip:(l,a)=>this.refreshRowTooltip(l,a)}),n=this.beans.userComponentFactory;switch(this.rowType){case"FullWidthDetail":return n.getFullWidthDetailCellRendererDetails(r);case"FullWidthGroup":return n.getFullWidthGroupCellRendererDetails(r);case"FullWidthLoading":return n.getFullWidthLoadingCellRendererDetails(r);default:return n.getFullWidthCellRendererDetails(r)}}refreshRowTooltip(t,i){if(!this.fullWidthGui)return;const s={getGui:()=>this.fullWidthGui.element,getTooltipValue:()=>t,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:i};this.tooltipFeature&&this.destroyBean(this.tooltipFeature,this.beans.context),this.tooltipFeature=this.createBean(new TooltipFeature(s,this.beans))}addFullWidthRowDragging(t,i,s="",o){if(!this.isFullWidth())return;const r=new RowDragComp(()=>s,this.rowNode,void 0,t,i,o);this.createBean(r,this.beans.context),this.addDestroyFunc(()=>{this.destroyBean(r,this.beans.context)})}onUiLevelChanged(){const t=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=t){const i="ag-row-level-"+t,s="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(o=>{o.rowComp.addOrRemoveCssClass(i,!0),o.rowComp.addOrRemoveCssClass(s,!1)})}this.rowLevel=t}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.pageBoundsService.getLastRow()}refreshFirstAndLastRowStyles(){const t=this.isFirstRowOnPage(),i=this.isLastRowOnPage();this.firstRowOnPage!==t&&(this.firstRowOnPage=t,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-first",t))),this.lastRowOnPage!==i&&(this.lastRowOnPage=i,this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass("ag-row-last",i)))}stopEditing(t=!1){this.stoppingRowEdit||this.beans.rowEditService?.stopEditing(this,t)}setInlineEditingCss(t){this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass("ag-row-inline-editing",t),i.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!t)})}setEditingRow(t){this.editingRow=t}startRowEditing(t=null,i=null,s=null){this.editingRow||this.beans.rowEditService?.startEditing(this,t,i,s)}getAllCellCtrls(){return this.leftCellCtrls.list.length===0&&this.rightCellCtrls.list.length===0?this.centerCellCtrls.list:[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const t=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);!t||!t.length||t.forEach(i=>{this.allRowGuis.forEach(s=>s.rowComp.addOrRemoveCssClass(i,!0))})}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,t=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(t,!0))},t=>{this.allRowGuis.forEach(i=>i.rowComp.addOrRemoveCssClass(t,!1))})}setStylesFromGridOptions(t,i){t&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(i,s=>s.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(t){return t==="left"||t==="right"?t:null}getInitialRowClasses(t){const i=this.getPinnedForContainer(t),s={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[t],rowIsEven:this.rowNode.rowIndex%2===0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:i};return this.beans.rowCssClassCalculator.getInitialRowClasses(s)}processStylesFromGridOptions(){const t=this.gos.get("rowStyle");if(t&&typeof t=="function"){_warnOnce("rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");return}const i=this.gos.getCallback("getRowStyle");let s;if(i){const o={data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex};s=i(o)}return s||t?Object.assign({},t,s):this.emptyStyle}onRowSelected(t){const i=!!this.rowNode.isSelected();this.forEachGui(t,s=>{s.rowComp.addOrRemoveCssClass("ag-row-selected",i),_setAriaSelected(s.element,i),s.element.contains(this.gos.getActiveDomElement())&&(s===this.centerGui||s===this.fullWidthGui)&&this.announceDescription()})}announceDescription(){if(this.isRowSelectionBlocked())return;const t=this.rowNode.isSelected();if(t&&this.gos.get("suppressRowDeselection"))return;const s=this.beans.localeService.getLocaleTextFunc()(t?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${t?"deselect":"select"} this row.`);this.beans.ariaAnnouncementService.announceValue(s)}addHoverFunctionality(t){if(!this.active)return;const{rowNode:i,beans:s,gos:o}=this;this.addManagedListeners(t,{mouseenter:()=>i.onMouseEnter(),mouseleave:()=>i.onMouseLeave()}),this.addManagedListeners(i,{mouseEnter:()=>{!s.dragService.isDragging()&&!o.get("suppressRowHoverHighlight")&&(t.classList.add("ag-row-hover"),i.setHovered(!0))},mouseLeave:()=>{t.classList.remove("ag-row-hover"),i.setHovered(!1)}})}roundRowTopToBounds(t){const i=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getApproximateVScollPosition(),s=this.applyPaginationOffset(i.top,!0)-100,o=this.applyPaginationOffset(i.bottom,!0)+100;return Math.min(Math.max(s,t),o)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(t,i){t?i(t):this.allRowGuis.forEach(i)}onRowHeightChanged(t){if(this.rowNode.rowHeight==null)return;const i=this.rowNode.rowHeight,s=this.beans.environment.getDefaultRowHeight(),r=this.gos.isGetRowHeightFunction()?this.gos.getRowHeightForNode(this.rowNode).height:void 0,n=r?`${Math.min(s,r)-2}px`:void 0;this.forEachGui(t,l=>{l.element.style.height=`${i}px`,n&&l.element.style.setProperty("--ag-line-height",n)})}addEventListener(t,i){super.addEventListener(t,i)}removeEventListener(t,i){super.removeEventListener(t,i)}destroyFirstPass(t=!1){if(this.active=!1,!t&&this.gos.isAnimateRows()&&!this.isSticky())if(this.rowNode.rowTop!=null){const o=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(o)}else this.allRowGuis.forEach(o=>o.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0));this.rowNode.setHovered(!1);const i=this.createRowEvent("virtualRowRemoved");this.dispatchLocalEvent(i),this.beans.eventService.dispatchEvent(i),super.destroy()}destroySecondPass(){this.allRowGuis.length=0,this.stopEditing();const t=i=>(i.list.forEach(s=>s.destroy()),{list:[],map:{}});this.centerCellCtrls=t(this.centerCellCtrls),this.leftCellCtrls=t(this.leftCellCtrls),this.rightCellCtrls=t(this.rightCellCtrls)}setFocusedClasses(t){this.forEachGui(t,i=>{i.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),i.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)})}onCellFocusChanged(){const t=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);t!==this.rowFocused&&(this.rowFocused=t,this.setFocusedClasses()),!t&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){const t=this.beans.paginationService?.getCurrentPage()??0;this.paginationPage!==t&&(this.paginationPage=t,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(t,i=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return t;const s=this.beans.pageBoundsService.getPixelOffset();return t+s*(i?1:-1)}setRowTop(t){if(!this.printLayout&&_exists(t)){const i=this.applyPaginationOffset(t),r=`${this.rowNode.isRowPinned()||this.rowNode.sticky?i:this.beans.rowContainerHeightService.getRealPixelPosition(i)}px`;this.setRowTopStyle(r)}}getInitialRowTop(t){return this.suppressRowTransform?this.getInitialRowTopShared(t):void 0}getInitialTransform(t){return this.suppressRowTransform?void 0:`translateY(${this.getInitialRowTopShared(t)})`}getInitialRowTopShared(t){if(this.printLayout)return"";const i=this.rowNode;let s;if(this.isSticky())s=i.stickyRowTop;else{const o=this.slideInAnimation[t]?this.roundRowTopToBounds(i.oldRowTop):i.rowTop,r=this.applyPaginationOffset(o);s=i.isRowPinned()?r:this.beans.rowContainerHeightService.getRealPixelPosition(r)}return s+"px"}setRowTopStyle(t){this.allRowGuis.forEach(i=>this.suppressRowTransform?i.rowComp.setTop(t):i.rowComp.setTransform(`translateY(${t})`))}getRowNode(){return this.rowNode}getCellCtrl(t){let i=null;return this.getAllCellCtrls().forEach(s=>{s.getColumn()==t&&(i=s)}),i!=null||this.getAllCellCtrls().forEach(s=>{s.getColSpanningList().indexOf(t)>=0&&(i=s)}),i}onRowIndexChanged(){this.rowNode.rowIndex!=null&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(t){const i=this.rowNode.getRowIndexString();if(i===null)return;const s=this.beans.headerNavigationService.getHeaderRowCount()+(this.beans.filterManager?.getHeaderRowCount()??0),o=this.rowNode.rowIndex%2===0,r=s+this.rowNode.rowIndex+1;this.forEachGui(t,n=>{n.rowComp.setRowIndex(i),n.rowComp.addOrRemoveCssClass("ag-row-even",o),n.rowComp.addOrRemoveCssClass("ag-row-odd",!o),_setAriaRowIndex(n.element,r)})}setStoppingRowEdit(t){this.stoppingRowEdit=t}};_RowCtrl.DOM_DATA_KEY_ROW_CTRL="renderedRow";var RowCtrl=_RowCtrl,RowContainerEventsFeature=class extends BeanStub{wireBeans(e){this.mouseEventService=e.mouseEventService,this.valueService=e.valueService,this.menuService=e.menuService,this.ctrlsService=e.ctrlsService,this.navigationService=e.navigationService,this.focusService=e.focusService,this.undoRedoService=e.undoRedoService,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.rangeService=e.rangeService,this.clipboardService=e.clipboardService}constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e="keydown",t=this.processKeyboardEvent.bind(this,e);this.addManagedElementListeners(this.element,{[e]:t})}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",_isEventSupported("touchstart")?"touchstart":"mousedown"].forEach(i=>{const s=this.processMouseEvent.bind(this,i);this.addManagedElementListeners(this.element,{[i]:s})})}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||_isStopPropagationForAgGrid(t))return;const i=this.getRowForEvent(t),s=this.mouseEventService.getRenderedCellForEvent(t);e==="contextmenu"?this.handleContextMenuMouseEvent(t,void 0,i,s):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!_isIOSUserAgent())return;const e=new TouchListener(this.element),t=i=>{const s=this.getRowForEvent(i.touchEvent),o=this.mouseEventService.getRenderedCellForEvent(i.touchEvent);this.handleContextMenuMouseEvent(void 0,i.touchEvent,s,o)};this.addManagedListeners(e,{longTap:t}),this.addDestroyFunc(()=>e.destroy())}getRowForEvent(e){let t=e.target;for(;t;){const i=this.gos.getDomData(t,RowCtrl.DOM_DATA_KEY_ROW_CTRL);if(i)return i;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,s){const o=i?i.getRowNode():null,r=s?s.getColumn():null;let n=null;if(r){const d=e||t;s.dispatchCellContextMenuEvent(d??null),n=this.valueService.getValue(r,o)}const l=this.ctrlsService.getGridBodyCtrl(),a=s?s.getGui():l.getGridBodyElement();this.menuService.showContextMenu({mouseEvent:e,touchEvent:t,rowNode:o,column:r,value:n,anchorToElement:a})}getControlsForEventTarget(e){return{cellCtrl:_getCtrlForEventTarget(this.gos,e,CellCtrl.DOM_DATA_KEY_CELL_CTRL),rowCtrl:_getCtrlForEventTarget(this.gos,e,RowCtrl.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):s&&s.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,i){const s=e.getRowNode(),o=e.getColumn(),r=e.isEditing();if(!_isUserSuppressingKeyboardEvent(this.gos,i,s,o,r)&&t==="keydown"&&(!r&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),_isEventFromPrintableCharacter(i)&&e.processCharacter(i)),t==="keydown"){const l=e.createEvent(i,"cellKeyDown");this.eventService.dispatchEvent(l)}}processFullWidthRowKeyboardEvent(e,t,i){const s=e.getRowNode(),o=this.focusService.getFocusedCell(),r=o&&o.column;if(!_isUserSuppressingKeyboardEvent(this.gos,i,s,r,!1)){const l=i.key;if(t==="keydown")switch(l){case KeyCode.PAGE_HOME:case KeyCode.PAGE_END:case KeyCode.PAGE_UP:case KeyCode.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case KeyCode.UP:case KeyCode.DOWN:e.onKeyboardNavigate(i);break;case KeyCode.TAB:e.onTabKeyDown(i);break;default:}}if(t==="keydown"){const l=e.createRowEvent("cellKeyDown",i);this.eventService.dispatchEvent(l)}}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey||t||!this.mouseEventService.isEventFromThisGrid(e))return;const i=_normaliseQwertyAzerty(e);if(i===KeyCode.A)return this.onCtrlAndA(e);if(i===KeyCode.C)return this.onCtrlAndC(e);if(i===KeyCode.D)return this.onCtrlAndD(e);if(i===KeyCode.V)return this.onCtrlAndV(e);if(i===KeyCode.X)return this.onCtrlAndX(e);if(i===KeyCode.Y)return this.onCtrlAndY();if(i===KeyCode.Z)return this.onCtrlAndZ(e)}onCtrlAndA(e){const{pinnedRowModel:t,rowModel:i,rangeService:s}=this;if(s&&i.isRowsToRender()){const[o,r]=[t.isEmpty("top"),t.isEmpty("bottom")],n=o?null:"top";let l,a;r?(l=null,a=i.getRowCount()-1):(l="bottom",a=t.getPinnedBottomRowNodes().length-1);const d=this.visibleColsService.getAllCols();if(_missingOrEmpty(d))return;s.setCellRange({rowStartIndex:0,rowStartPinned:n,rowEndIndex:a,rowEndPinned:l,columnStart:d[0],columnEnd:_last(d)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gos.get("enableCellTextSelection")||this.gos.get("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);t?.isEditing()||i?.isEditing()||this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gos.get("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){!this.gos.get("undoRedoCellEditing")||!this.undoRedoService||(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService?.redo("ui")}},SetPinnedLeftWidthFeature=class extends BeanStub{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({leftPinnedWidthChanged:this.onPinnedLeftWidthChanged.bind(this)})}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;_setDisplayed(this.element,t),_setFixedWidth(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}},SetPinnedRightWidthFeature=class extends BeanStub{wireBeans(e){this.pinnedWidthService=e.pinnedWidthService}constructor(e){super(),this.element=e}postConstruct(){this.addManagedEventListeners({rightPinnedWidthChanged:this.onPinnedRightWidthChanged.bind(this)})}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;_setDisplayed(this.element,t),_setFixedWidth(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}},getTopRowCtrls=e=>e.getTopRowCtrls(),getStickyTopRowCtrls=e=>e.getStickyTopRowCtrls(),getStickyBottomRowCtrls=e=>e.getStickyBottomRowCtrls(),getBottomRowCtrls=e=>e.getBottomRowCtrls(),getCentreRowCtrls=e=>e.getCentreRowCtrls(),ContainerCssClasses={center:{type:"center",container:"ag-center-cols-container",viewport:"ag-center-cols-viewport",getRowCtrls:getCentreRowCtrls},left:{type:"left",container:"ag-pinned-left-cols-container",pinnedType:"left",getRowCtrls:getCentreRowCtrls},right:{type:"right",container:"ag-pinned-right-cols-container",pinnedType:"right",getRowCtrls:getCentreRowCtrls},fullWidth:{type:"fullWidth",container:"ag-full-width-container",fullWidth:!0,getRowCtrls:getCentreRowCtrls},topCenter:{type:"center",container:"ag-floating-top-container",viewport:"ag-floating-top-viewport",getRowCtrls:getTopRowCtrls},topLeft:{type:"left",container:"ag-pinned-left-floating-top",pinnedType:"left",getRowCtrls:getTopRowCtrls},topRight:{type:"right",container:"ag-pinned-right-floating-top",pinnedType:"right",getRowCtrls:getTopRowCtrls},topFullWidth:{type:"fullWidth",container:"ag-floating-top-full-width-container",fullWidth:!0,getRowCtrls:getTopRowCtrls},stickyTopCenter:{type:"center",container:"ag-sticky-top-container",viewport:"ag-sticky-top-viewport",getRowCtrls:getStickyTopRowCtrls},stickyTopLeft:{type:"left",container:"ag-pinned-left-sticky-top",pinnedType:"left",getRowCtrls:getStickyTopRowCtrls},stickyTopRight:{type:"right",container:"ag-pinned-right-sticky-top",pinnedType:"right",getRowCtrls:getStickyTopRowCtrls},stickyTopFullWidth:{type:"fullWidth",container:"ag-sticky-top-full-width-container",fullWidth:!0,getRowCtrls:getStickyTopRowCtrls},stickyBottomCenter:{type:"center",container:"ag-sticky-bottom-container",viewport:"ag-sticky-bottom-viewport",getRowCtrls:getStickyBottomRowCtrls},stickyBottomLeft:{type:"left",container:"ag-pinned-left-sticky-bottom",pinnedType:"left",getRowCtrls:getStickyBottomRowCtrls},stickyBottomRight:{type:"right",container:"ag-pinned-right-sticky-bottom",pinnedType:"right",getRowCtrls:getStickyBottomRowCtrls},stickyBottomFullWidth:{type:"fullWidth",container:"ag-sticky-bottom-full-width-container",fullWidth:!0,getRowCtrls:getStickyBottomRowCtrls},bottomCenter:{type:"center",container:"ag-floating-bottom-container",viewport:"ag-floating-bottom-viewport",getRowCtrls:getBottomRowCtrls},bottomLeft:{type:"left",container:"ag-pinned-left-floating-bottom",pinnedType:"left",getRowCtrls:getBottomRowCtrls},bottomRight:{type:"right",container:"ag-pinned-right-floating-bottom",pinnedType:"right",getRowCtrls:getBottomRowCtrls},bottomFullWidth:{type:"fullWidth",container:"ag-floating-bottom-full-width-container",fullWidth:!0,getRowCtrls:getBottomRowCtrls}};function _getRowContainerOptions(e){return ContainerCssClasses[e]}var allTopNoFW=["topCenter","topLeft","topRight"],allBottomNoFW=["bottomCenter","bottomLeft","bottomRight"],allMiddleNoFW=["center","left","right"],allMiddle=["center","left","right","fullWidth"],allCenter=["stickyTopCenter","stickyBottomCenter","center","topCenter","bottomCenter"],allLeft=["left","bottomLeft","topLeft","stickyTopLeft","stickyBottomLeft"],allRight=["right","bottomRight","topRight","stickyTopRight","stickyBottomRight"],allStickyTopNoFW=["stickyTopCenter","stickyTopLeft","stickyTopRight"],allStickyBottomNoFW=["stickyBottomCenter","stickyBottomLeft","stickyBottomRight"],allStickyContainers=[...allStickyTopNoFW,"stickyTopFullWidth",...allStickyBottomNoFW,"stickyBottomFullWidth"],allNoFW=[...allTopNoFW,...allBottomNoFW,...allMiddleNoFW,...allStickyTopNoFW,...allStickyBottomNoFW],RowContainerCtrl=class extends BeanStub{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.options=_getRowContainerOptions(e)}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService,this.columnViewportService=e.columnViewportService,this.resizeObserverService=e.resizeObserverService,this.rowRenderer=e.rowRenderer}postConstruct(){this.enableRtl=this.gos.get("enableRtl"),this.forContainers(["center"],()=>{this.viewportSizeFeature=this.createManagedBean(new ViewportSizeFeature(this)),this.addManagedEventListeners({stickyTopOffsetChanged:this.onStickyTopOffsetChanged.bind(this)})})}onStickyTopOffsetChanged(e){this.comp.setOffsetTop(`${e.offset}px`)}registerWithCtrlsService(){this.options.fullWidth||this.ctrlsService.register(this.name,this)}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,i){this.comp=e,this.eContainer=t,this.eViewport=i,this.createManagedBean(new RowContainerEventsFeature(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows(),this.forContainers(allLeft,()=>{this.pinnedWidthFeature=this.createManagedBean(new SetPinnedLeftWidthFeature(this.eContainer)),this.addManagedEventListeners({leftPinnedWidthChanged:()=>this.onPinnedWidthChanged()})}),this.forContainers(allRight,()=>{this.pinnedWidthFeature=this.createManagedBean(new SetPinnedRightWidthFeature(this.eContainer)),this.addManagedEventListeners({rightPinnedWidthChanged:()=>this.onPinnedWidthChanged()})}),this.forContainers(allMiddle,()=>this.createManagedBean(new SetHeightFeature(this.eContainer,this.name==="center"?i:void 0))),this.forContainers(allNoFW,()=>this.createManagedBean(new DragListenerFeature(this.eContainer))),this.forContainers(allCenter,()=>this.createManagedBean(new CenterWidthFeature(s=>this.comp.setContainerWidth(`${s}px`)))),this.addListeners(),this.registerWithCtrlsService()}addListeners(){this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this),displayedRowsChanged:e=>this.onDisplayedRowsChanged(e.afterScroll)}),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if(allStickyContainers.indexOf(this.name)>=0){this.comp.setDomOrder(!0);return}const t=()=>{const i=this.gos.get("ensureDomOrder"),s=this.gos.isDomLayout("print");this.comp.setDomOrder(i||s)};this.addManagedPropertyListener("domLayout",t),t()}stopHScrollOnPinnedRows(){this.forContainers(["topCenter","stickyTopCenter","bottomCenter","stickyBottomCenter"],()=>{const e=()=>this.eViewport.scrollLeft=0;this.addManagedElementListeners(this.eViewport,{scroll:e})})}onDisplayedColumnsChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers(["center"],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const e=t=>{this.dragService.isDragging()&&t.cancelable&&t.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",e))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnViewportService.setScrollPosition(t,i,e)}getCenterWidth(){return _getInnerWidth(this.eViewport)}getCenterViewportScrollLeft(){return _getScrollLeft(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportInTheDOMTree(){return _isInDOM(this.eViewport)}getViewportScrollLeft(){return _getScrollLeft(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gos.get("alwaysShowHorizontalScroll")||_isHorizontalScrollShowing(this.eViewport)}getViewportElement(){return this.eViewport}setContainerTranslateX(e){this.eContainer.style.transform=`translateX(${e}px)`}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){_setScrollLeft(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!(this.options.pinnedType!=null)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged())}onDisplayedRowsChanged(e=!1){const t=this.options.getRowCtrls(this.rowRenderer);if(!this.visible||t.length===0){this.comp.setRowCtrls({rowCtrls:this.EMPTY_CTRLS});return}const i=this.gos.isDomLayout("print"),o=this.gos.get("embedFullWidthRows")||i,r=t.filter(n=>{const l=n.isFullWidth();return this.options.fullWidth?!o&&l:o||!l});this.comp.setRowCtrls({rowCtrls:r,useFlushSync:e})}};function templateFactory(e){let t;return e.type==="center"?t=`<div class="${e.viewport}" data-ref="eViewport" role="presentation">
|
|
120
120
|
<div class="${e.container}" data-ref="eContainer"></div>
|
|
121
121
|
</div>`:t=`<div class="${e.container}" data-ref="eContainer"></div>`,t}var RowContainerComp=class extends Component{constructor(){super(),this.eViewport=RefPlaceholder,this.eContainer=RefPlaceholder,this.rowComps={},this.name=Component.elementGettingCreated.getAttribute("name"),this.options=_getRowContainerOptions(this.name),this.setTemplate(templateFactory(this.options))}wireBeans(e){this.beans=e}postConstruct(){const e={setViewportHeight:i=>this.eViewport.style.height=i,setRowCtrls:({rowCtrls:i})=>this.setRowCtrls(i),setDomOrder:i=>{this.domOrder=i},setContainerWidth:i=>this.eContainer.style.width=i,setOffsetTop:i=>this.eContainer.style.transform=`translateY(${i})`};this.createManagedBean(new RowContainerCtrl(this.name)).setComp(e,this.eContainer,this.eViewport)}destroy(){this.setRowCtrls([]),super.destroy()}setRowCtrls(e){const t={...this.rowComps};this.rowComps={},this.lastPlacedElement=null;const i=s=>{const o=s.getInstanceId(),r=t[o];if(r)this.rowComps[o]=r,delete t[o],this.ensureDomOrder(r.getGui());else{if(!s.getRowNode().displayed)return;const n=new RowComp(s,this.beans,this.options.type);this.rowComps[o]=n,this.appendRow(n.getGui())}};e.forEach(i),_getAllValuesInObject(t).forEach(s=>{this.eContainer.removeChild(s.getGui()),s.destroy()}),_setAriaRole(this.eContainer,"rowgroup")}appendRow(e){this.domOrder?_insertWithDomOrder(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(_ensureDomOrder(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}},RowContainerSelector={selector:"AG-ROW-CONTAINER",component:RowContainerComp};function makeRowContainers(e){return e.map(t=>`<ag-row-container name="${t}"></ag-row-container>`).join("")}var GRID_BODY_TEMPLATE=`<div class="ag-root ag-unselectable" role="treegrid">
|
|
122
122
|
<ag-header-root></ag-header-root>
|
|
@@ -140,7 +140,7 @@ For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG
|
|
|
140
140
|
</div>
|
|
141
141
|
<ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>
|
|
142
142
|
<ag-overlay-wrapper></ag-overlay-wrapper>
|
|
143
|
-
</div>`,GridBodyComp=class extends Component{constructor(){super(GRID_BODY_TEMPLATE,[OverlayWrapperSelector,FakeHScrollSelector,FakeVScrollSelector,GridHeaderSelector,RowContainerSelector]),this.eBodyViewport=RefPlaceholder,this.eStickyTop=RefPlaceholder,this.eStickyBottom=RefPlaceholder,this.eTop=RefPlaceholder,this.eBottom=RefPlaceholder,this.eBody=RefPlaceholder}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.rangeService=e.rangeService}postConstruct(){const e=(i,s)=>{const o=`${i}px`;s.style.minHeight=o,s.style.height=o},t={setRowAnimationCssOnBodyViewport:(i,s)=>this.setRowAnimationCssOnBodyViewport(i,s),setColumnCount:i=>_setAriaColCount(this.getGui(),i),setRowCount:i=>_setAriaRowCount(this.getGui(),i),setTopHeight:i=>e(i,this.eTop),setBottomHeight:i=>e(i,this.eBottom),setTopDisplay:i=>this.eTop.style.display=i,setBottomDisplay:i=>this.eBottom.style.display=i,setStickyTopHeight:i=>this.eStickyTop.style.height=i,setStickyTopTop:i=>this.eStickyTop.style.top=i,setStickyTopWidth:i=>this.eStickyTop.style.width=i,setStickyBottomHeight:i=>this.eStickyBottom.style.height=i,setStickyBottomBottom:i=>this.eStickyBottom.style.bottom=i,setStickyBottomWidth:i=>this.eStickyBottom.style.width=i,setColumnMovingCss:(i,s)=>this.addOrRemoveCssClass(i,s),updateLayoutClasses:(i,s)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach(r=>{r.toggle("ag-layout-auto-height",s.autoHeight),r.toggle("ag-layout-normal",s.normal),r.toggle("ag-layout-print",s.print)}),this.addOrRemoveCssClass("ag-layout-auto-height",s.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",s.normal),this.addOrRemoveCssClass("ag-layout-print",s.print)},setAlwaysVerticalScrollClass:(i,s)=>this.eBodyViewport.classList.toggle(CSS_CLASS_FORCE_VERTICAL_SCROLL,s),registerBodyViewportResizeListener:i=>{const s=this.resizeObserverService.observeResize(this.eBodyViewport,i);this.addDestroyFunc(()=>s())},setPinnedTopBottomOverflowY:i=>this.eTop.style.overflowY=this.eBottom.style.overflowY=i,setCellSelectableCss:(i,s)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach(o=>o.classList.toggle(i,s))},setBodyViewportWidth:i=>this.eBodyViewport.style.width=i};this.ctrl=this.createManagedBean(new GridBodyCtrl),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&this.gos.get("enableRangeSelection")||this.gos.get("rowSelection")==="multiple")&&_setAriaMultiSelectable(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle("ag-row-animation",t),i.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}},GridBodySelector={selector:"AG-GRID-BODY",component:GridBodyComp},ScrollVisibleService=class extends BeanStub{constructor(){super(...arguments),this.beanName="scrollVisibleService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnAnimationService=e.columnAnimationService}postConstruct(){this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)})}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn(()=>{this.columnAnimationService.executeLaterVMTurn(()=>this.updateImpl())}):this.updateImpl()}updateImpl(){const e=this.ctrlsService.get("center");if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t)}setScrollsVisible(e){if(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing){this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing;const i={type:"scrollVisibilityChanged"};this.eventService.dispatchEvent(i)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}},GRID_DOM_KEY="__ag_grid_instance",_MouseEventService=class V extends BeanStub{constructor(){super(...arguments),this.beanName="mouseEventService",this.gridInstanceId=V.gridInstanceSequence.next()}wireBeans(t){this.ctrlsService=t.ctrlsService}stampTopLevelGridCompWithGridInstance(t){t[GRID_DOM_KEY]=this.gridInstanceId}getRenderedCellForEvent(t){return _getCtrlForEventTarget(this.gos,t.target,CellCtrl.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(t){return this.isElementInThisGrid(t.target)}isElementInThisGrid(t){let i=t;for(;i;){const s=i[GRID_DOM_KEY];if(_exists(s))return s===this.gridInstanceId;i=i.parentElement}return!1}getCellPositionForEvent(t){const i=this.getRenderedCellForEvent(t);return i?i.getCellPosition():null}getNormalisedPosition(t){const i=this.gos.isDomLayout("normal"),s=t;let o,r;if(s.clientX!=null||s.clientY!=null?(o=s.clientX,r=s.clientY):(o=s.x,r=s.y),i){const n=this.ctrlsService.getGridBodyCtrl(),l=n.getScrollFeature().getVScrollPosition(),a=n.getScrollFeature().getHScrollPosition();o+=a.left,r+=l.top}return{x:o,y:r}}};_MouseEventService.gridInstanceSequence=new NumberSequence;var MouseEventService=_MouseEventService,NavigationService=class extends BeanStub{constructor(){super(),this.beanName="navigationService",this.onPageDown=_throttle(this.onPageDown,100),this.onPageUp=_throttle(this.onPageUp,100)}wireBeans(e){this.mouseEventService=e.mouseEventService,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.ctrlsService=e.ctrlsService,this.rowRenderer=e.rowRenderer,this.headerNavigationService=e.headerNavigationService,this.rowPositionUtils=e.rowPositionUtils,this.cellNavigationService=e.cellNavigationService,this.pinnedRowModel=e.pinnedRowModel,this.rangeService=e.rangeService}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const i=e.key,s=e.altKey,o=e.ctrlKey||e.metaKey,r=!!this.rangeService&&e.shiftKey,n=this.mouseEventService.getCellPositionForEvent(e);let l=!1;switch(i){case KeyCode.PAGE_HOME:case KeyCode.PAGE_END:!o&&!s&&(this.onHomeOrEndKey(i),l=!0);break;case KeyCode.LEFT:case KeyCode.RIGHT:case KeyCode.UP:case KeyCode.DOWN:if(!n)return!1;o&&!s&&!r&&(this.onCtrlUpDownLeftRight(i,n),l=!0);break;case KeyCode.PAGE_DOWN:case KeyCode.PAGE_UP:!o&&!s&&(l=this.handlePageUpDown(i,n,t));break}return l&&e.preventDefault(),l}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),t?(e===KeyCode.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0):!1}navigateTo(e){const{scrollIndex:t,scrollType:i,scrollColumn:s,focusIndex:o,focusColumn:r}=e;_exists(s)&&!s.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(s),_exists(t)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(t,i),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(o),this.focusService.setFocusedCell({rowIndex:o,column:r,rowPinned:null,forceBrowserFocus:!0}),this.rangeService?.setRangeToCell({rowIndex:o,rowPinned:null,column:r})}onPageDown(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.getViewportHeight(),o=this.pageBoundsService.getPixelOffset(),r=i.top+s,n=this.rowModel.getRowIndexAtPixel(r+o);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,n):this.navigateToNextPage(e,n)}onPageUp(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.pageBoundsService.getPixelOffset(),o=i.top,r=this.rowModel.getRowIndexAtPixel(o+s);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,r,!0):this.navigateToNextPage(e,r,!0)}navigateToNextPage(e,t,i=!1){const s=this.getViewportHeight(),o=this.pageBoundsService.getFirstRow(),r=this.pageBoundsService.getLastRow(),n=this.pageBoundsService.getPixelOffset(),l=this.rowModel.getRow(e.rowIndex),a=i?l?.rowHeight-s-n:s-n,d=l?.rowTop+a;let h=this.rowModel.getRowIndexAtPixel(d+n);if(h===e.rowIndex){const u=i?-1:1;t=h=e.rowIndex+u}let c;i?(c="bottom",h<o&&(h=o),t<o&&(t=o)):(c="top",h>r&&(h=r),t>r&&(t=r)),this.isRowTallerThanView(h)&&(t=h,c="top"),this.navigateTo({scrollIndex:t,scrollType:c,scrollColumn:null,focusIndex:h,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const s=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){const i=t?-1:1,s=this.getViewportHeight(),o=this.pageBoundsService.getLastRow();let r=0,n=e.rowIndex;for(;n>=0&&n<=o;){const l=this.rowModel.getRow(n);if(l){const a=l.rowHeight??0;if(r+a>s)break;r+=a}n+=i}return Math.max(0,Math.min(n,o))}getViewportHeight(){const{gridBodyCtrl:e,center:t}=this.ctrlsService.getParams(),i=e.getScrollFeature().getVScrollPosition(),s=this.gos.getScrollbarWidth();let o=i.bottom-i.top;return t.isHorizontalScrollShowing()&&(o-=s),o}isRowTallerThanView(e){const t=this.rowModel.getRow(e);if(!t)return!1;const i=t.rowHeight;return typeof i!="number"?!1:i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:s}=i,o=i.column;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:o,focusIndex:s,focusColumn:o})}onHomeOrEndKey(e){const t=e===KeyCode.PAGE_HOME,i=this.visibleColsService.getAllCols(),s=t?i[0]:_last(i),o=t?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow();this.navigateTo({scrollIndex:o,scrollType:null,scrollColumn:s,focusIndex:o,focusColumn:s})}onTabKeyDown(e,t){const i=t.shiftKey,s=this.tabToNextCellCommon(e,i,t);if(s!==!1){s&&t.preventDefault();return}if(i){const{rowIndex:o,rowPinned:r}=e.getRowPosition();(r?o===0:o===this.pageBoundsService.getFirstRow())&&(this.gos.get("headerHeight")===0||this.gos.get("suppressHeaderFocus")?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof CellCtrl&&e.focusCell(!0),this.focusService.focusNextGridCoreContainer(i)&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let s=this.getCellByPosition(i);return!s&&(s=this.rowRenderer.getRowByPosition(i),!s||!s.isFullWidth())?!1:!!this.tabToNextCellCommon(s,e,t)}tabToNextCellCommon(e,t,i){let s=e.isEditing();if(!s&&e instanceof CellCtrl){const n=e.getRowCtrl();n&&(s=n.isEditing())}let o;return s?this.gos.get("editType")==="fullRow"?o=this.moveToNextEditingRow(e,t,i):o=this.moveToNextEditingCell(e,t,i):o=this.moveToNextCellNotEditing(e,t),o===null?o:o||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const s=e.getCellPosition();e.getGui().focus(),e.stopEditing();const o=this.findNextCellToFocusOn(s,t,!0);return o===!1?null:o==null?!1:(o.startEditing(null,!0,i),o.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const s=e.getCellPosition(),o=this.findNextCellToFocusOn(s,t,!0);if(o===!1)return null;if(o==null)return!1;const r=o.getCellPosition(),n=this.isCellEditable(s),l=this.isCellEditable(r),a=r&&s.rowIndex===r.rowIndex&&s.rowPinned===r.rowPinned;return n&&e.setFocusOutOnEditor(),a||(e.getRowCtrl().stopEditing(),o.getRowCtrl().startRowEditing(void 0,void 0,i)),l?(o.setFocusInOnEditor(),o.focusCell()):o.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.visibleColsService.getAllCols();let s;e instanceof RowCtrl?s={...e.getRowPosition(),column:t?i[0]:_last(i)}:s=e.getCellPosition();const o=this.findNextCellToFocusOn(s,t,!1);if(o===!1)return null;if(o instanceof CellCtrl)o.focusCell(!0);else if(o)return this.tryToFocusFullWidthRow(o.getRowPosition(),t);return _exists(o)}findNextCellToFocusOn(e,t,i){let s=e;for(;;){e!==s&&(e=s),t||(s=this.getLastCellOfColSpan(s)),s=this.cellNavigationService.getNextTabbedCell(s,t);const o=this.gos.getCallback("tabToNextCell");if(_exists(o)){const a=o({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:s||null});if(a===!0||a===null)a===null&&_warnOnce("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),s=e;else{if(a===!1)return!1;s={rowIndex:a.rowIndex,column:a.column,rowPinned:a.rowPinned}}}if(!s)return null;if(s.rowIndex<0){const l=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l+s.rowIndex,column:s.column},fromCell:!0}),null}const r=this.gos.get("editType")==="fullRow";if(i&&!r&&!this.isCellEditable(s))continue;this.ensureCellVisible(s);const n=this.getCellByPosition(s);if(!n){const l=this.rowRenderer.getRowByPosition(s);if(!l||!l.isFullWidth()||i)continue;return l}if(!n.isSuppressNavigable())return this.rangeService?.setRangeToCell(s),n}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return t?e.column.isCellEditable(t):!1}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return e.rowPinned==="top"?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):e.rowPinned==="bottom"?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.rowModel.getRow(e.rowIndex)}navigateToNextCell(e,t,i,s){let o=i,r=!1;for(;o&&(o===i||!this.isValidNavigateCell(o));)this.gos.get("enableRtl")?t===KeyCode.LEFT&&(o=this.getLastCellOfColSpan(o)):t===KeyCode.RIGHT&&(o=this.getLastCellOfColSpan(o)),o=this.cellNavigationService.getNextCellToFocus(t,o),r=_missing(o);if(r&&e&&e.key===KeyCode.UP&&(o={rowIndex:-1,rowPinned:null,column:i.column}),s){const l=this.gos.getCallback("navigateToNextCell");if(_exists(l)){const d=l({key:t,previousCellPosition:i,nextCellPosition:o||null,event:e});_exists(d)?o={rowPinned:d.rowPinned,rowIndex:d.rowIndex,column:d.column}:o=null}}if(!o)return;if(o.rowIndex<0){const l=this.headerNavigationService.getHeaderRowCount();this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l+o.rowIndex,column:i.column},event:e||void 0,fromCell:!0});return}const n=this.getNormalisedPosition(o);n?this.focusPosition(n):this.tryToFocusFullWidthRow(o)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t=!1){const i=this.visibleColsService.getAllCols(),s=this.rowRenderer.getRowByPosition(e);if(!s||!s.isFullWidth())return!1;const o=this.focusService.getFocusedCell(),r={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?_last(i):i[0])};this.focusPosition(r);const n=o!=null?this.rowPositionUtils.before(r,o):!1,l={type:"fullWidthRowFocused",rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:r.column,isFullWidthCell:!0,fromBelow:n};return this.eventService.dispatchEvent(l),!0}focusPosition(e){this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),this.rangeService?.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const i=t.getColSpanningList();return i.length===1?e:{rowIndex:e.rowIndex,column:_last(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=this.gos.isGroupRowsSticky(),i=this.rowModel.getRow(e.rowIndex);!(t&&i?.sticky)&&_missing(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}},HorizontalResizeService=class extends BeanStub{constructor(){super(...arguments),this.beanName="horizontalResizeService"}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService}addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};return this.dragService.addDragSource(t),()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&t.shiftKey===!0;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e,t){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}},StandardMenuFactory=class extends BeanStub{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupService=e.popupService,this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.menuService=e.menuService}hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,i){this.showPopup(e,s=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:i,mouseEvent:t,ePopup:s})},i,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,i){let s=-1,o="left";const r=this.menuService.isLegacyMenuEnabled();!r&&this.gos.get("enableRtl")&&(s=1,o="right");const n=r?void 0:4*s,l=r?void 0:4;this.showPopup(e,a=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:a,nudgeX:n,nudgeY:l,alignSide:o,keepWithinBounds:!0,position:"under",column:e})},i,t,r)}showPopup(e,t,i,s,o){const r=e?this.createBean(new FilterWrapperComp(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!r?.hasFilter()||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const n=document.createElement("div");_setAriaRole(n,"presentation"),n.classList.add("ag-menu"),o||n.classList.add("ag-filter-menu"),[this.tabListener]=this.addManagedElementListeners(n,{keydown:p=>this.trapFocusWithin(p,n)}),n.appendChild(r?.getGui());let l;const a=()=>r?.afterGuiDetached(),d=this.menuService.isColumnMenuAnchoringEnabled()?s??this.ctrlsService.getGridBodyCtrl().getGui():void 0,h=p=>{e.setMenuVisible(!1,"contextMenu");const m=p instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),m&&s&&_isVisible(s)){const f=this.focusService.findTabbableParent(s);f&&f.focus()}a(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,i,e)},c=this.localeService.getLocaleTextFunc(),u=o&&i!=="columnFilter"?c("ariaLabelColumnMenu","Column Menu"):c("ariaLabelColumnFilter","Column Filter"),g=this.popupService.addPopup({modal:!0,eChild:n,closeOnEsc:!0,closedCallback:h,positionCallback:()=>t(n),anchorToElement:d,ariaLabel:u});g&&(this.hidePopup=l=g.hideFunc),r.afterInit().then(()=>{t(n),r.afterGuiAttached({container:i,hidePopup:l})}),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,i,e)}trapFocusWithin(e,t){e.key!==KeyCode.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,i){const s={type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:i??null};this.eventService.dispatchEvent(s)}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},DEBOUNCE_DELAY=50,ResizeObserverService=class extends BeanStub{constructor(){super(...arguments),this.beanName="resizeObserverService",this.polyfillFunctions=[]}observeResize(e,t){const i=this.gos.getWindow(),s=()=>{const l=new i.ResizeObserver(t);return l.observe(e),()=>l.disconnect()},o=()=>{let l=e?.clientWidth??0,a=e?.clientHeight??0,d=!0;const h=()=>{if(d){const c=e?.clientWidth??0,u=e?.clientHeight??0;(c!==l||u!==a)&&(l=c,a=u,t()),this.doNextPolyfillTurn(h)}};return h(),()=>d=!1},r=this.gos.get("suppressBrowserResizeObserver");return!!i.ResizeObserver&&!r?s():this.getFrameworkOverrides().wrapIncoming(()=>o(),"resize-observer")}doNextPolyfillTurn(e){this.polyfillFunctions.push(e),this.schedulePolyfill()}schedulePolyfill(){if(this.polyfillScheduled)return;const e=()=>{const t=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],t.forEach(i=>i())};this.polyfillScheduled=!0,window.setTimeout(e,DEBOUNCE_DELAY)}},AnimationFrameService=class extends BeanStub{constructor(){super(...arguments),this.beanName="animationFrameService",this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}setScrollTop(e){const t=this.gos.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&e===0){const i=this.paginationService?.getCurrentPage()??0;i!==this.lastPage&&(this.lastPage=i,this.scrollGoingDown=!0)}this.lastScrollTop=e}postConstruct(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){this.useAnimationFrame===!1&&_warnOnce(`AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const s={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],s),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort((i,s)=>i.index!==s.index?t*(s.index-i.index):s.createOrder-i.createOrder),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,s=this.createTasksP2,o=s.list,r=this.destroyTasks,n=new Date().getTime();let l=new Date().getTime()-n;const a=e<=0,d=this.ctrlsService.getGridBodyCtrl();for(;a||l<e;){if(!d.getScrollFeature().scrollGridIfNeeded()){let c;if(i.length)this.sortTaskList(t),c=i.pop().task;else if(o.length)this.sortTaskList(s),c=o.pop().task;else if(r.length)c=r.pop();else{this.cancelledTasks.clear();break}this.cancelledTasks.has(c)||c()}l=new Date().getTime()-n}i.length||o.length||r.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=this.gos.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{if(!this.isOn()){window.setTimeout(e,0);return}t||(t=!0,this.addDestroyTask(()=>{t=!1,e()}))}}},ClientSideRowModelSteps=(e=>(e.EVERYTHING="group",e.FILTER="filter",e.SORT="sort",e.MAP="map",e.AGGREGATE="aggregate",e.FILTER_AGGREGATES="filter_aggregates",e.PIVOT="pivot",e.NOTHING="nothing",e))(ClientSideRowModelSteps||{}),ExpansionService=class extends BeanStub{constructor(){super(...arguments),this.beanName="expansionService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.isClientSideRowModel=this.rowModel.getType()==="clientSide"}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode(i=>{i.id&&t.has(i.id)&&(i.expanded=!0)}),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode(({expanded:t,id:i})=>{t&&i&&e.push(i)}),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,i,s){e&&(i&&e.parent&&e.parent.level!==-1&&this.setRowNodeExpanded(e.parent,t,i,s),e.setExpanded(t,void 0,s))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}},MenuService=class extends BeanStub{constructor(){super(...arguments),this.beanName="menuService"}wireBeans(e){this.filterMenuFactory=e.filterMenuFactory,this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.filterManager=e.filterManager,this.rowRenderer=e.rowRenderer,this.columnChooserFactory=e.columnChooserFactory,this.contextMenuFactory=e.contextMenuFactory,this.enterpriseMenuFactory=e.enterpriseMenuFactory}postConstruct(){this.activeMenuFactory=this.enterpriseMenuFactory??this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,i){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,i)}getContextMenuPosition(e,t){const i=this.getRowCtrl(e),s=this.getCellGui(i,t);if(!s)return i?{x:0,y:i.getRowYPosition()}:{x:0,y:0};const o=s.getBoundingClientRect();return{x:o.x+o.width/2,y:o.y+o.height/2}}showContextMenu(e){const{rowNode:t}=e,i=e.column;let{anchorToElement:s,value:o}=e;t&&i&&o==null&&(o=t.getValueFromValueService(i)),s==null&&(s=this.getContextMenuAnchorElement(t,i)),this.contextMenuFactory?.onContextMenu(e.mouseEvent??null,e.touchEvent??null,t??null,i??null,o,s)}showColumnChooser(e){this.columnChooserFactory?.showColumnChooser(e)}hidePopupMenu(){this.contextMenuFactory?.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){this.columnChooserFactory?.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:i}=e.getColDef();return!(i??t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&!!this.filterManager?.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!e?.getColDef().suppressHeaderContextMenu&&this.getColumnMenuType()==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(_isIOSUserAgent()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return!!this.filterManager?.isFilterAllowed(e)&&!this.isLegacyMenuEnabled()&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return this.getColumnMenuType()==="new"}isLegacyMenuEnabled(){return this.getColumnMenuType()==="legacy"}isFloatingFilterButtonEnabled(e){const t=e.getColDef(),i=t.floatingFilterComponentParams?.suppressFilterButton;return i!=null&&_warnOnce("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),t.suppressFloatingFilterButton==null?!i:!t.suppressFloatingFilterButton}getColumnMenuType(){return this.gos.get("columnMenu")}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()?this.gos.exists("suppressMenuHide")?e:!1:e}showColumnMenuCommon(e,t,i,s){const{positionBy:o}=t,r=t.column;if(o==="button"){const{buttonElement:n}=t;e.showMenuAfterButtonClick(r,n,i,s)}else if(o==="mouse"){const{mouseEvent:n}=t;e.showMenuAfterMouseEvent(r,n,i,s)}else r&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(r,"auto"),this.animationFrameService.requestAnimationFrame(()=>{const n=this.ctrlsService.getHeaderRowContainerCtrl(r.getPinned()).getHeaderCtrlForColumn(r);e.showMenuAfterButtonClick(r,n.getAnchorElementForMenu(s),i,!0)}))}getRowCtrl(e){const{rowIndex:t,rowPinned:i}=e||{};if(t!=null)return this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:i})||void 0}getCellGui(e,t){return!e||!t?void 0:e.getCellCtrl(t)?.getGui()||void 0}getContextMenuAnchorElement(e,t){const i=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),s=this.getRowCtrl(e);if(!s)return i;const o=this.getCellGui(s,t);return o||(s.isFullWidth()?s.getFullWidthElement():i)}},AgInputTextArea=class extends AgAbstractInputField{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},AgInputTextAreaSelector={selector:"AG-INPUT-TEXT-AREA",component:AgInputTextArea},LargeTextCellEditor=class extends PopupComponent{constructor(){super(`<div class="ag-large-text">
|
|
143
|
+
</div>`,GridBodyComp=class extends Component{constructor(){super(GRID_BODY_TEMPLATE,[OverlayWrapperSelector,FakeHScrollSelector,FakeVScrollSelector,GridHeaderSelector,RowContainerSelector]),this.eBodyViewport=RefPlaceholder,this.eStickyTop=RefPlaceholder,this.eStickyBottom=RefPlaceholder,this.eTop=RefPlaceholder,this.eBottom=RefPlaceholder,this.eBody=RefPlaceholder}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.rangeService=e.rangeService}postConstruct(){const e=(i,s)=>{const o=`${i}px`;s.style.minHeight=o,s.style.height=o},t={setRowAnimationCssOnBodyViewport:(i,s)=>this.setRowAnimationCssOnBodyViewport(i,s),setColumnCount:i=>_setAriaColCount(this.getGui(),i),setRowCount:i=>_setAriaRowCount(this.getGui(),i),setTopHeight:i=>e(i,this.eTop),setBottomHeight:i=>e(i,this.eBottom),setTopDisplay:i=>this.eTop.style.display=i,setBottomDisplay:i=>this.eBottom.style.display=i,setStickyTopHeight:i=>this.eStickyTop.style.height=i,setStickyTopTop:i=>this.eStickyTop.style.top=i,setStickyTopWidth:i=>this.eStickyTop.style.width=i,setStickyBottomHeight:i=>this.eStickyBottom.style.height=i,setStickyBottomBottom:i=>this.eStickyBottom.style.bottom=i,setStickyBottomWidth:i=>this.eStickyBottom.style.width=i,setColumnMovingCss:(i,s)=>this.addOrRemoveCssClass(i,s),updateLayoutClasses:(i,s)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach(r=>{r.toggle("ag-layout-auto-height",s.autoHeight),r.toggle("ag-layout-normal",s.normal),r.toggle("ag-layout-print",s.print)}),this.addOrRemoveCssClass("ag-layout-auto-height",s.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",s.normal),this.addOrRemoveCssClass("ag-layout-print",s.print)},setAlwaysVerticalScrollClass:(i,s)=>this.eBodyViewport.classList.toggle(CSS_CLASS_FORCE_VERTICAL_SCROLL,s),registerBodyViewportResizeListener:i=>{const s=this.resizeObserverService.observeResize(this.eBodyViewport,i);this.addDestroyFunc(()=>s())},setPinnedTopBottomOverflowY:i=>this.eTop.style.overflowY=this.eBottom.style.overflowY=i,setCellSelectableCss:(i,s)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach(o=>o.classList.toggle(i,s))},setBodyViewportWidth:i=>this.eBodyViewport.style.width=i};this.ctrl=this.createManagedBean(new GridBodyCtrl),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop,this.eStickyBottom),(this.rangeService&&this.gos.get("enableRangeSelection")||this.gos.get("rowSelection")==="multiple")&&_setAriaMultiSelectable(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle("ag-row-animation",t),i.toggle("ag-row-no-animation",!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}},GridBodySelector={selector:"AG-GRID-BODY",component:GridBodyComp},ScrollVisibleService=class extends BeanStub{constructor(){super(...arguments),this.beanName="scrollVisibleService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnAnimationService=e.columnAnimationService}postConstruct(){this.addManagedEventListeners({displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),displayedColumnsWidthChanged:this.onDisplayedColumnsWidthChanged.bind(this)})}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.columnAnimationService.isActive()?this.columnAnimationService.executeLaterVMTurn(()=>{this.columnAnimationService.executeLaterVMTurn(()=>this.updateImpl())}):this.updateImpl()}updateImpl(){const e=this.ctrlsService.get("center");if(!e||this.columnAnimationService.isActive())return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t)}setScrollsVisible(e){if(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing){this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing;const i={type:"scrollVisibilityChanged"};this.eventService.dispatchEvent(i)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}},GRID_DOM_KEY="__ag_grid_instance",_MouseEventService=class V extends BeanStub{constructor(){super(...arguments),this.beanName="mouseEventService",this.gridInstanceId=V.gridInstanceSequence.next()}wireBeans(t){this.ctrlsService=t.ctrlsService}stampTopLevelGridCompWithGridInstance(t){t[GRID_DOM_KEY]=this.gridInstanceId}getRenderedCellForEvent(t){return _getCtrlForEventTarget(this.gos,t.target,CellCtrl.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(t){return this.isElementInThisGrid(t.target)}isElementInThisGrid(t){let i=t;for(;i;){const s=i[GRID_DOM_KEY];if(_exists(s))return s===this.gridInstanceId;i=i.parentElement}return!1}getCellPositionForEvent(t){const i=this.getRenderedCellForEvent(t);return i?i.getCellPosition():null}getNormalisedPosition(t){const i=this.gos.isDomLayout("normal"),s=t;let o,r;if(s.clientX!=null||s.clientY!=null?(o=s.clientX,r=s.clientY):(o=s.x,r=s.y),i){const n=this.ctrlsService.getGridBodyCtrl(),l=n.getScrollFeature().getVScrollPosition(),a=n.getScrollFeature().getHScrollPosition();o+=a.left,r+=l.top}return{x:o,y:r}}};_MouseEventService.gridInstanceSequence=new NumberSequence;var MouseEventService=_MouseEventService,NavigationService=class extends BeanStub{constructor(){super(),this.beanName="navigationService",this.onPageDown=_throttle(this.onPageDown,100),this.onPageUp=_throttle(this.onPageUp,100)}wireBeans(e){this.mouseEventService=e.mouseEventService,this.pageBoundsService=e.pageBoundsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.ctrlsService=e.ctrlsService,this.rowRenderer=e.rowRenderer,this.headerNavigationService=e.headerNavigationService,this.rowPositionUtils=e.rowPositionUtils,this.cellNavigationService=e.cellNavigationService,this.pinnedRowModel=e.pinnedRowModel,this.rangeService=e.rangeService}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const i=e.key,s=e.altKey,o=e.ctrlKey||e.metaKey,r=!!this.rangeService&&e.shiftKey,n=this.mouseEventService.getCellPositionForEvent(e);let l=!1;switch(i){case KeyCode.PAGE_HOME:case KeyCode.PAGE_END:!o&&!s&&(this.onHomeOrEndKey(i),l=!0);break;case KeyCode.LEFT:case KeyCode.RIGHT:case KeyCode.UP:case KeyCode.DOWN:if(!n)return!1;o&&!s&&!r&&(this.onCtrlUpDownLeftRight(i,n),l=!0);break;case KeyCode.PAGE_DOWN:case KeyCode.PAGE_UP:!o&&!s&&(l=this.handlePageUpDown(i,n,t));break}return l&&e.preventDefault(),l}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),t?(e===KeyCode.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0):!1}navigateTo(e){const{scrollIndex:t,scrollType:i,scrollColumn:s,focusIndex:o,focusColumn:r}=e;_exists(s)&&!s.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(s),_exists(t)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(t,i),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(o),this.focusService.setFocusedCell({rowIndex:o,column:r,rowPinned:null,forceBrowserFocus:!0}),this.rangeService?.setRangeToCell({rowIndex:o,rowPinned:null,column:r})}onPageDown(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.getViewportHeight(),o=this.pageBoundsService.getPixelOffset(),r=i.top+s,n=this.rowModel.getRowIndexAtPixel(r+o);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,n):this.navigateToNextPage(e,n)}onPageUp(e){const i=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),s=this.pageBoundsService.getPixelOffset(),o=i.top,r=this.rowModel.getRowIndexAtPixel(o+s);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,r,!0):this.navigateToNextPage(e,r,!0)}navigateToNextPage(e,t,i=!1){const s=this.getViewportHeight(),o=this.pageBoundsService.getFirstRow(),r=this.pageBoundsService.getLastRow(),n=this.pageBoundsService.getPixelOffset(),l=this.rowModel.getRow(e.rowIndex),a=i?l?.rowHeight-s-n:s-n,d=l?.rowTop+a;let h=this.rowModel.getRowIndexAtPixel(d+n);if(h===e.rowIndex){const u=i?-1:1;t=h=e.rowIndex+u}let c;i?(c="bottom",h<o&&(h=o),t<o&&(t=o)):(c="top",h>r&&(h=r),t>r&&(t=r)),this.isRowTallerThanView(h)&&(t=h,c="top"),this.navigateTo({scrollIndex:t,scrollType:c,scrollColumn:null,focusIndex:h,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const s=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){const i=t?-1:1,s=this.getViewportHeight(),o=this.pageBoundsService.getLastRow();let r=0,n=e.rowIndex;for(;n>=0&&n<=o;){const l=this.rowModel.getRow(n);if(l){const a=l.rowHeight??0;if(r+a>s)break;r+=a}n+=i}return Math.max(0,Math.min(n,o))}getViewportHeight(){const{gridBodyCtrl:e,center:t}=this.ctrlsService.getParams(),i=e.getScrollFeature().getVScrollPosition(),s=this.gos.getScrollbarWidth();let o=i.bottom-i.top;return t.isHorizontalScrollShowing()&&(o-=s),o}isRowTallerThanView(e){const t=this.rowModel.getRow(e);if(!t)return!1;const i=t.rowHeight;return typeof i!="number"?!1:i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:s}=i,o=i.column;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:o,focusIndex:s,focusColumn:o})}onHomeOrEndKey(e){const t=e===KeyCode.PAGE_HOME,i=this.visibleColsService.getAllCols(),s=t?i[0]:_last(i),o=t?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow();this.navigateTo({scrollIndex:o,scrollType:null,scrollColumn:s,focusIndex:o,focusColumn:s})}onTabKeyDown(e,t){const i=t.shiftKey,s=this.tabToNextCellCommon(e,i,t);if(s!==!1){s&&t.preventDefault();return}if(i){const{rowIndex:o,rowPinned:r}=e.getRowPosition();(r?o===0:o===this.pageBoundsService.getFirstRow())&&(this.gos.get("headerHeight")===0||this.gos.get("suppressHeaderFocus")?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof CellCtrl&&e.focusCell(!0),this.focusService.focusNextGridCoreContainer(i)&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let s=this.getCellByPosition(i);return!s&&(s=this.rowRenderer.getRowByPosition(i),!s||!s.isFullWidth())?!1:!!this.tabToNextCellCommon(s,e,t)}tabToNextCellCommon(e,t,i){let s=e.isEditing();if(!s&&e instanceof CellCtrl){const n=e.getRowCtrl();n&&(s=n.isEditing())}let o;return s?this.gos.get("editType")==="fullRow"?o=this.moveToNextEditingRow(e,t,i):o=this.moveToNextEditingCell(e,t,i):o=this.moveToNextCellNotEditing(e,t),o===null?o:o||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const s=e.getCellPosition();e.getGui().focus(),e.stopEditing();const o=this.findNextCellToFocusOn(s,t,!0);return o===!1?null:o==null?!1:(o.startEditing(null,!0,i),o.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const s=e.getCellPosition(),o=this.findNextCellToFocusOn(s,t,!0);if(o===!1)return null;if(o==null)return!1;const r=o.getCellPosition(),n=this.isCellEditable(s),l=this.isCellEditable(r),a=r&&s.rowIndex===r.rowIndex&&s.rowPinned===r.rowPinned;return n&&e.setFocusOutOnEditor(),a||(e.getRowCtrl().stopEditing(),o.getRowCtrl().startRowEditing(void 0,void 0,i)),l?(o.setFocusInOnEditor(),o.focusCell()):o.focusCell(!0),!0}moveToNextCellNotEditing(e,t){const i=this.visibleColsService.getAllCols();let s;e instanceof RowCtrl?s={...e.getRowPosition(),column:t?i[0]:_last(i)}:s=e.getCellPosition();const o=this.findNextCellToFocusOn(s,t,!1);if(o===!1)return null;if(o instanceof CellCtrl)o.focusCell(!0);else if(o)return this.tryToFocusFullWidthRow(o.getRowPosition(),t);return _exists(o)}findNextCellToFocusOn(e,t,i){let s=e;for(;;){e!==s&&(e=s),t||(s=this.getLastCellOfColSpan(s)),s=this.cellNavigationService.getNextTabbedCell(s,t);const o=this.gos.getCallback("tabToNextCell");if(_exists(o)){const a=o({backwards:t,editing:i,previousCellPosition:e,nextCellPosition:s||null});if(a===!0||a===null)a===null&&_warnOnce("Returning `null` from tabToNextCell is deprecated. Return `true` to stay on the current cell, or `false` to let the browser handle the tab behaviour."),s=e;else{if(a===!1)return!1;s={rowIndex:a.rowIndex,column:a.column,rowPinned:a.rowPinned}}}if(!s)return null;if(s.rowIndex<0){const l=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l+s.rowIndex,column:s.column},fromCell:!0}),null}const r=this.gos.get("editType")==="fullRow";if(i&&!r&&!this.isCellEditable(s))continue;this.ensureCellVisible(s);const n=this.getCellByPosition(s);if(!n){const l=this.rowRenderer.getRowByPosition(s);if(!l||!l.isFullWidth()||i)continue;return l}if(!n.isSuppressNavigable())return this.rangeService?.setRangeToCell(s),n}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return t?e.column.isCellEditable(t):!1}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return e.rowPinned==="top"?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):e.rowPinned==="bottom"?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.rowModel.getRow(e.rowIndex)}navigateToNextCell(e,t,i,s){let o=i,r=!1;for(;o&&(o===i||!this.isValidNavigateCell(o));)this.gos.get("enableRtl")?t===KeyCode.LEFT&&(o=this.getLastCellOfColSpan(o)):t===KeyCode.RIGHT&&(o=this.getLastCellOfColSpan(o)),o=this.cellNavigationService.getNextCellToFocus(t,o),r=_missing(o);if(r&&e&&e.key===KeyCode.UP&&(o={rowIndex:-1,rowPinned:null,column:i.column}),s){const l=this.gos.getCallback("navigateToNextCell");if(_exists(l)){const d=l({key:t,previousCellPosition:i,nextCellPosition:o||null,event:e});_exists(d)?o={rowPinned:d.rowPinned,rowIndex:d.rowIndex,column:d.column}:o=null}}if(!o)return;if(o.rowIndex<0){const l=this.headerNavigationService.getHeaderRowCount();this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l+o.rowIndex,column:i.column},event:e||void 0,fromCell:!0});return}const n=this.getNormalisedPosition(o);n?this.focusPosition(n):this.tryToFocusFullWidthRow(o)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t=!1){const i=this.visibleColsService.getAllCols(),s=this.rowRenderer.getRowByPosition(e);if(!s||!s.isFullWidth())return!1;const o=this.focusService.getFocusedCell(),r={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?_last(i):i[0])};this.focusPosition(r);const n=o!=null?this.rowPositionUtils.before(r,o):!1,l={type:"fullWidthRowFocused",rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:r.column,isFullWidthCell:!0,fromBelow:n};return this.eventService.dispatchEvent(l),!0}focusPosition(e){this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),this.rangeService?.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const i=t.getColSpanningList();return i.length===1?e:{rowIndex:e.rowIndex,column:_last(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=this.gos.isGroupRowsSticky(),i=this.rowModel.getRow(e.rowIndex);!(t&&i?.sticky)&&_missing(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}},HorizontalResizeService=class extends BeanStub{constructor(){super(...arguments),this.beanName="horizontalResizeService"}wireBeans(e){this.dragService=e.dragService,this.ctrlsService=e.ctrlsService}addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};return this.dragService.addDragSource(t),()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&t.shiftKey===!0;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e,t){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.get("gridCtrl");e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}},StandardMenuFactory=class extends BeanStub{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupService=e.popupService,this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.menuService=e.menuService}hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t,i){this.showPopup(e,s=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:i,mouseEvent:t,ePopup:s})},i,t.target,this.menuService.isLegacyMenuEnabled())}showMenuAfterButtonClick(e,t,i){let s=-1,o="left";const r=this.menuService.isLegacyMenuEnabled();!r&&this.gos.get("enableRtl")&&(s=1,o="right");const n=r?void 0:4*s,l=r?void 0:4;this.showPopup(e,a=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:a,nudgeX:n,nudgeY:l,alignSide:o,keepWithinBounds:!0,position:"under",column:e})},i,t,r)}showPopup(e,t,i,s,o){const r=e?this.createBean(new FilterWrapperComp(e,"COLUMN_MENU")):void 0;if(this.activeMenu=r,!r?.hasFilter()||!e)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const n=document.createElement("div");_setAriaRole(n,"presentation"),n.classList.add("ag-menu"),o||n.classList.add("ag-filter-menu"),[this.tabListener]=this.addManagedElementListeners(n,{keydown:p=>this.trapFocusWithin(p,n)}),n.appendChild(r?.getGui());let l;const a=()=>r?.afterGuiDetached(),d=this.menuService.isColumnMenuAnchoringEnabled()?s??this.ctrlsService.getGridBodyCtrl().getGui():void 0,h=p=>{e.setMenuVisible(!1,"contextMenu");const f=p instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),f&&s&&_isVisible(s)){const m=this.focusService.findTabbableParent(s);m&&m.focus()}a(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,i,e)},c=this.localeService.getLocaleTextFunc(),u=o&&i!=="columnFilter"?c("ariaLabelColumnMenu","Column Menu"):c("ariaLabelColumnFilter","Column Filter"),g=this.popupService.addPopup({modal:!0,eChild:n,closeOnEsc:!0,closedCallback:h,positionCallback:()=>t(n),anchorToElement:d,ariaLabel:u});g&&(this.hidePopup=l=g.hideFunc),r.afterInit().then(()=>{t(n),r.afterGuiAttached({container:i,hidePopup:l})}),e.setMenuVisible(!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,i,e)}trapFocusWithin(e,t){e.key!==KeyCode.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,i){const s={type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:i??null};this.eventService.dispatchEvent(s)}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},DEBOUNCE_DELAY=50,ResizeObserverService=class extends BeanStub{constructor(){super(...arguments),this.beanName="resizeObserverService",this.polyfillFunctions=[]}observeResize(e,t){const i=this.gos.getWindow(),s=()=>{const l=new i.ResizeObserver(t);return l.observe(e),()=>l.disconnect()},o=()=>{let l=e?.clientWidth??0,a=e?.clientHeight??0,d=!0;const h=()=>{if(d){const c=e?.clientWidth??0,u=e?.clientHeight??0;(c!==l||u!==a)&&(l=c,a=u,t()),this.doNextPolyfillTurn(h)}};return h(),()=>d=!1},r=this.gos.get("suppressBrowserResizeObserver");return!!i.ResizeObserver&&!r?s():this.getFrameworkOverrides().wrapIncoming(()=>o(),"resize-observer")}doNextPolyfillTurn(e){this.polyfillFunctions.push(e),this.schedulePolyfill()}schedulePolyfill(){if(this.polyfillScheduled)return;const e=()=>{const t=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],t.forEach(i=>i())};this.polyfillScheduled=!0,window.setTimeout(e,DEBOUNCE_DELAY)}},AnimationFrameService=class extends BeanStub{constructor(){super(...arguments),this.beanName="animationFrameService",this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}setScrollTop(e){const t=this.gos.get("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&e===0){const i=this.paginationService?.getCurrentPage()??0;i!==this.lastPage&&(this.lastPage=i,this.scrollGoingDown=!0)}this.lastScrollTop=e}postConstruct(){this.useAnimationFrame=!this.gos.get("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){this.useAnimationFrame===!1&&_warnOnce(`AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const s={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],s),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort((i,s)=>i.index!==s.index?t*(s.index-i.index):s.createOrder-i.createOrder),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,s=this.createTasksP2,o=s.list,r=this.destroyTasks,n=new Date().getTime();let l=new Date().getTime()-n;const a=e<=0,d=this.ctrlsService.getGridBodyCtrl();for(;a||l<e;){if(!d.getScrollFeature().scrollGridIfNeeded()){let c;if(i.length)this.sortTaskList(t),c=i.pop().task;else if(o.length)this.sortTaskList(s),c=o.pop().task;else if(r.length)c=r.pop();else{this.cancelledTasks.clear();break}this.cancelledTasks.has(c)||c()}l=new Date().getTime()-n}i.length||o.length||r.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=this.gos.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{if(!this.isOn()){window.setTimeout(e,0);return}t||(t=!0,this.addDestroyTask(()=>{t=!1,e()}))}}},ClientSideRowModelSteps=(e=>(e.EVERYTHING="group",e.FILTER="filter",e.SORT="sort",e.MAP="map",e.AGGREGATE="aggregate",e.FILTER_AGGREGATES="filter_aggregates",e.PIVOT="pivot",e.NOTHING="nothing",e))(ClientSideRowModelSteps||{}),ExpansionService=class extends BeanStub{constructor(){super(...arguments),this.beanName="expansionService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.isClientSideRowModel=this.rowModel.getType()==="clientSide"}expandRows(e){if(!this.isClientSideRowModel)return;const t=new Set(e);this.rowModel.forEachNode(i=>{i.id&&t.has(i.id)&&(i.expanded=!0)}),this.onGroupExpandedOrCollapsed()}getExpandedRows(){const e=[];return this.rowModel.forEachNode(({expanded:t,id:i})=>{t&&i&&e.push(i)}),e}expandAll(e){this.isClientSideRowModel&&this.rowModel.expandOrCollapseAll(e)}setRowNodeExpanded(e,t,i,s){e&&(i&&e.parent&&e.parent.level!==-1&&this.setRowNodeExpanded(e.parent,t,i,s),e.setExpanded(t,void 0,s))}onGroupExpandedOrCollapsed(){this.isClientSideRowModel&&this.rowModel.refreshModel({step:"map"})}},MenuService=class extends BeanStub{constructor(){super(...arguments),this.beanName="menuService"}wireBeans(e){this.filterMenuFactory=e.filterMenuFactory,this.ctrlsService=e.ctrlsService,this.animationFrameService=e.animationFrameService,this.filterManager=e.filterManager,this.rowRenderer=e.rowRenderer,this.columnChooserFactory=e.columnChooserFactory,this.contextMenuFactory=e.contextMenuFactory,this.enterpriseMenuFactory=e.enterpriseMenuFactory}postConstruct(){this.activeMenuFactory=this.enterpriseMenuFactory??this.filterMenuFactory}showColumnMenu(e){this.showColumnMenuCommon(this.activeMenuFactory,e,"columnMenu")}showFilterMenu(e){const t=this.enterpriseMenuFactory&&this.isLegacyMenuEnabled()?this.enterpriseMenuFactory:this.filterMenuFactory;this.showColumnMenuCommon(t,e,e.containerType,!0)}showHeaderContextMenu(e,t,i){this.activeMenuFactory.showMenuAfterContextMenuEvent(e,t,i)}getContextMenuPosition(e,t){const i=this.getRowCtrl(e),s=this.getCellGui(i,t);if(!s)return i?{x:0,y:i.getRowYPosition()}:{x:0,y:0};const o=s.getBoundingClientRect();return{x:o.x+o.width/2,y:o.y+o.height/2}}showContextMenu(e){const{rowNode:t}=e,i=e.column;let{anchorToElement:s,value:o}=e;t&&i&&o==null&&(o=t.getValueFromValueService(i)),s==null&&(s=this.getContextMenuAnchorElement(t,i)),this.contextMenuFactory?.onContextMenu(e.mouseEvent??null,e.touchEvent??null,t??null,i??null,o,s)}showColumnChooser(e){this.columnChooserFactory?.showColumnChooser(e)}hidePopupMenu(){this.contextMenuFactory?.hideActiveMenu(),this.activeMenuFactory.hideActiveMenu()}hideColumnChooser(){this.columnChooserFactory?.hideActiveColumnChooser()}isColumnMenuInHeaderEnabled(e){const{suppressMenu:t,suppressHeaderMenuButton:i}=e.getColDef();return!(i??t)&&this.activeMenuFactory.isMenuEnabled(e)&&(this.isLegacyMenuEnabled()||!!this.enterpriseMenuFactory)}isFilterMenuInHeaderEnabled(e){return!e.getColDef().suppressHeaderFilterButton&&!!this.filterManager?.isFilterAllowed(e)}isHeaderContextMenuEnabled(e){return!e?.getColDef().suppressHeaderContextMenu&&this.getColumnMenuType()==="new"}isHeaderMenuButtonAlwaysShowEnabled(){return this.isSuppressMenuHide()}isHeaderMenuButtonEnabled(){const e=!this.isSuppressMenuHide();return!(_isIOSUserAgent()&&e)}isHeaderFilterButtonEnabled(e){return this.isFilterMenuInHeaderEnabled(e)&&!this.isLegacyMenuEnabled()&&!this.isFloatingFilterButtonDisplayed(e)}isFilterMenuItemEnabled(e){return!!this.filterManager?.isFilterAllowed(e)&&!this.isLegacyMenuEnabled()&&!this.isFilterMenuInHeaderEnabled(e)&&!this.isFloatingFilterButtonDisplayed(e)}isColumnMenuAnchoringEnabled(){return!this.isLegacyMenuEnabled()}areAdditionalColumnMenuItemsEnabled(){return this.getColumnMenuType()==="new"}isLegacyMenuEnabled(){return this.getColumnMenuType()==="legacy"}isFloatingFilterButtonEnabled(e){const t=e.getColDef(),i=t.floatingFilterComponentParams?.suppressFilterButton;return i!=null&&_warnOnce("As of v31.1, 'colDef.floatingFilterComponentParams.suppressFilterButton' is deprecated. Use 'colDef.suppressFloatingFilterButton' instead."),t.suppressFloatingFilterButton==null?!i:!t.suppressFloatingFilterButton}getColumnMenuType(){return this.gos.get("columnMenu")}isFloatingFilterButtonDisplayed(e){return!!e.getColDef().floatingFilter&&this.isFloatingFilterButtonEnabled(e)}isSuppressMenuHide(){const e=this.gos.get("suppressMenuHide");return this.isLegacyMenuEnabled()?this.gos.exists("suppressMenuHide")?e:!1:e}showColumnMenuCommon(e,t,i,s){const{positionBy:o}=t,r=t.column;if(o==="button"){const{buttonElement:n}=t;e.showMenuAfterButtonClick(r,n,i,s)}else if(o==="mouse"){const{mouseEvent:n}=t;e.showMenuAfterMouseEvent(r,n,i,s)}else r&&(this.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(r,"auto"),this.animationFrameService.requestAnimationFrame(()=>{const n=this.ctrlsService.getHeaderRowContainerCtrl(r.getPinned()).getHeaderCtrlForColumn(r);e.showMenuAfterButtonClick(r,n.getAnchorElementForMenu(s),i,!0)}))}getRowCtrl(e){const{rowIndex:t,rowPinned:i}=e||{};if(t!=null)return this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:i})||void 0}getCellGui(e,t){return!e||!t?void 0:e.getCellCtrl(t)?.getGui()||void 0}getContextMenuAnchorElement(e,t){const i=this.ctrlsService.getGridBodyCtrl().getGridBodyElement(),s=this.getRowCtrl(e);if(!s)return i;const o=this.getCellGui(s,t);return o||(s.isFullWidth()?s.getFullWidthElement():i)}},AgInputTextArea=class extends AgAbstractInputField{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}},AgInputTextAreaSelector={selector:"AG-INPUT-TEXT-AREA",component:AgInputTextArea},LargeTextCellEditor=class extends PopupComponent{constructor(){super(`<div class="ag-large-text">
|
|
144
144
|
<ag-input-text-area data-ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>
|
|
145
145
|
</div>`,[AgInputTextAreaSelector]),this.eTextArea=RefPlaceholder}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),_exists(e.value,!0)&&this.eTextArea.setValue(e.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(e){const t=e.key;(t===KeyCode.LEFT||t===KeyCode.UP||t===KeyCode.RIGHT||t===KeyCode.DOWN||e.shiftKey&&t===KeyCode.ENTER)&&e.stopPropagation()}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(e("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const e=this.eTextArea.getValue();return!_exists(e)&&!_exists(this.params.value)?this.params.value:this.params.parseValue(e)}},PopupEditorWrapper=class extends PopupComponent{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){this.gos.setDomData(this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,i=s=>{_isUserSuppressingKeyboardEvent(this.gos,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedElementListeners(e,{keydown:i})}},SelectCellEditor=class extends PopupComponent{constructor(){super(`<div class="ag-cell-edit-wrapper">
|
|
146
146
|
<ag-select class="ag-cell-editor" data-ref="eSelect"></ag-select>
|
|
@@ -150,9 +150,9 @@ For more info see: https://www.ag-grid.com/javascript-grid/modules/`}else o=`AG
|
|
|
150
150
|
</div>`,e.getAgComponents()),this.cellEditorInput=e,this.eInput=RefPlaceholder}init(e){this.params=e;const t=this.eInput;this.cellEditorInput.init(t,e);let i;if(e.cellStartedEdit){this.focusAfterAttached=!0;const s=e.eventKey;s===KeyCode.BACKSPACE||e.eventKey===KeyCode.DELETE?i="":s&&s.length===1?i=s:(i=this.cellEditorInput.getStartValue(),s!==KeyCode.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,i=this.cellEditorInput.getStartValue();i!=null&&t.setStartValue(i),this.addManagedElementListeners(t.getGui(),{keydown:s=>{const{key:o}=s;(o===KeyCode.PAGE_UP||o===KeyCode.PAGE_DOWN)&&s.preventDefault()}})}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc(),t=this.eInput;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;_isBrowserSafari()||t.getFocusableElement().focus();const i=t.getInputElement();this.highlightAllOnFocus?i.select():this.cellEditorInput.setCaret?.()}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}},TextCellEditorInput=class{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" data-ref="eInput"></ag-input-text-field>'}getAgComponents(){return[AgInputTextFieldSelector]}init(e,t){this.eInput=e,this.params=t,t.maxLength!=null&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return!_exists(e)&&!_exists(this.params.value)?this.params.value:this.params.parseValue(e)}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),t=_exists(e)&&e.length||0;t&&this.eInput.getInputElement().setSelectionRange(t,t)}},TextCellEditor=class extends SimpleCellEditor{constructor(){super(new TextCellEditorInput)}},NumberCellEditorInput=class{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" data-ref="eInput"></ag-input-number-field>'}getAgComponents(){return[AgInputNumberFieldSelector]}init(e,t){this.eInput=e,this.params=t,t.max!=null&&e.setMax(t.max),t.min!=null&&e.setMin(t.min),t.precision!=null&&e.setPrecision(t.precision),t.step!=null&&e.setStep(t.step);const i=e.getInputElement();t.preventStepping?e.addManagedElementListeners(i,{keydown:this.preventStepping}):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}preventStepping(e){(e.key===KeyCode.UP||e.key===KeyCode.DOWN)&&e.preventDefault()}getValue(){const e=this.eInput.getValue();if(!_exists(e)&&!_exists(this.params.value))return this.params.value;let t=this.params.parseValue(e);if(t==null)return t;if(typeof t=="string"){if(t==="")return null;t=Number(t)}return isNaN(t)?null:t}getStartValue(){return this.params.value}},NumberCellEditor=class extends SimpleCellEditor{constructor(){super(new NumberCellEditorInput)}},AgInputDateField=class extends AgInputTextField{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct();const e=_isBrowserSafari();this.addManagedListeners(this.eInput,{wheel:this.onWheel.bind(this),mousedown:()=>{this.isDisabled()||e||this.eInput.focus()}}),this.eInput.step="any"}onWheel(e){this.gos.getActiveDomElement()===this.eInput&&e.preventDefault()}setMin(e){const t=e instanceof Date?_serialiseDate(e??null,!1)??void 0:e;return this.min===t?this:(this.min=t,_addOrRemoveAttribute(this.eInput,"min",t),this)}setMax(e){const t=e instanceof Date?_serialiseDate(e??null,!1)??void 0:e;return this.max===t?this:(this.max=t,_addOrRemoveAttribute(this.eInput,"max",t),this)}setStep(e){return this.step===e?this:(this.step=e,_addOrRemoveAttribute(this.eInput,"step",e),this)}getDate(){if(this.eInput.validity.valid)return _parseDateTimeFromString(this.getValue())??void 0}setDate(e,t){this.setValue(_serialiseDate(e??null,!1),t)}},AgInputDateFieldSelector={selector:"AG-INPUT-DATE-FIELD",component:AgInputDateField},DateCellEditorInput=class{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>'}getAgComponents(){return[AgInputDateFieldSelector]}init(e,t){this.eInput=e,this.params=t,t.min!=null&&e.setMin(t.min),t.max!=null&&e.setMax(t.max),t.step!=null&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return!_exists(e)&&!_exists(this.params.value)?this.params.value:e??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return _serialiseDate(e,!1)}},DateCellEditor=class extends SimpleCellEditor{constructor(){super(new DateCellEditorInput)}},DateStringCellEditorInput=class{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" data-ref="eInput"></ag-input-date-field>'}getAgComponents(){return[AgInputDateFieldSelector]}init(e,t){this.eInput=e,this.params=t,t.min!=null&&e.setMin(t.min),t.max!=null&&e.setMax(t.max),t.step!=null&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return!_exists(e)&&!_exists(this.params.value)?this.params.value:this.params.parseValue(e??"")}getStartValue(){return _serialiseDate(this.parseDate(this.params.value??void 0)??null,!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):_parseDateTimeFromString(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):_serialiseDate(e??null,!1)??void 0}},DateStringCellEditor=class extends SimpleCellEditor{wireBeans(e){this.dataTypeService=e.dataTypeService}constructor(){super(new DateStringCellEditorInput(()=>this.dataTypeService))}},CheckboxCellEditor=class extends PopupComponent{constructor(){super(`
|
|
151
151
|
<div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">
|
|
152
152
|
<ag-checkbox role="presentation" data-ref="eCheckbox"></ag-checkbox>
|
|
153
|
-
</div>`,[AgCheckboxSelector]),this.eCheckbox=RefPlaceholder}init(e){this.params=e;const t=e.value??void 0;this.eCheckbox.setValue(t),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(this.eCheckbox,{fieldValueChanged:s=>this.setAriaLabel(s.selected)})}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=_getAriaCheckboxStateName(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}},UndoRedoAction=class{constructor(e){this.cellValueChanges=e}},RangeUndoRedoAction=class extends UndoRedoAction{constructor(e,t,i,s){super(e),this.initialRange=t,this.finalRange=i,this.ranges=s}},DEFAULT_STACK_SIZE=10,UndoRedoStack=class{constructor(e){this.actionStack=[],this.maxStackSize=e||DEFAULT_STACK_SIZE,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}},UndoRedoService=class extends BeanStub{constructor(){super(...arguments),this.beanName="undoRedoService",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=this.activeCellEdit!==null&&this.cellPositionUtils.equals(this.activeCellEdit,t),s=this.activeRowEdit!==null&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:n,column:l,oldValue:a,value:d}=e,h={rowPinned:r,rowIndex:n,columnId:l.getColId(),newValue:d,oldValue:a};this.cellValueChanges.push(h)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}wireBeans(e){this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.cellPositionUtils=e.cellPositionUtils,this.rowPositionUtils=e.rowPositionUtils,this.columnModel=e.columnModel,this.rangeService=e.rangeService}postConstruct(){if(!this.gos.get("undoRedoCellEditing"))return;const e=this.gos.get("undoRedoCellEditingLimit");if(e<=0)return;this.undoStack=new UndoRedoStack(e),this.redoStack=new UndoRedoStack(e),this.addListeners();const t=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:i=>{i.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:t,newColumnsLoaded:t,columnGroupOpened:t,columnRowGroupChanged:t,columnMoved:t,columnPinned:t,columnVisible:t,rowDragEnd:t}),this.ctrlsService.whenReady(i=>{this.gridBodyCtrl=i.gridBodyCtrl})}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){const t={type:"undoStarted",source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo"),s={type:"undoEnded",source:e,operationPerformed:i};this.eventService.dispatchEvent(s)}redo(e){const t={type:"redoStarted",source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo"),s={type:"redoEnded",source:e,operationPerformed:i};this.eventService.dispatchEvent(s)}undoRedo(e,t,i,s,o){if(!e)return!1;const r=e.pop();return!r||!r.cellValueChanges?!1:(this.processAction(r,n=>n[s],o),r instanceof RangeUndoRedoAction?this.processRange(this.rangeService,r.ranges||[r[i]]):this.processCell(r.cellValueChanges),t.push(r),!0)}processAction(e,t,i){e.cellValueChanges.forEach(s=>{const{rowIndex:o,rowPinned:r,columnId:n}=s,l={rowIndex:o,rowPinned:r},a=this.rowPositionUtils.getRowNode(l);a.displayed&&a.setDataValue(n,t(s),i)})}processRange(e,t){let i;e.removeAllCellRanges(!0),t.forEach((s,o)=>{if(!s)return;const r=s.startRow,n=s.endRow;o===t.length-1&&(i={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(i));const l={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:n.rowIndex,rowEndPinned:n.rowPinned,columnStart:s.startColumn,columns:s.columns};e.addCellRange(l)})}processCell(e){const t=e[0],{rowIndex:i,rowPinned:s}=t,o={rowIndex:i,rowPinned:s},r=this.rowPositionUtils.getRowNode(o),n={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(n,this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:s,rowPinned:o}=e,r=this.gridBodyCtrl.getScrollFeature(),n=this.columnModel.getCol(s);if(!n)return;r.ensureIndexVisible(i),r.ensureColumnVisible(n);const l={rowIndex:i,column:n,rowPinned:o};this.focusService.setFocusedCell({...l,forceBrowserFocus:!0}),t?.setRangeToCell(l)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new UndoRedoAction(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const i=new UndoRedoAction(this.cellValueChanges);this.pushActionsToUndoStack(i)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new UndoRedoAction(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new RangeUndoRedoAction(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;this.rangeService&&this.gos.get("enableRangeSelection")?e=new RangeUndoRedoAction(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):e=new UndoRedoAction(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1}})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}};function getVerticalPixelRange(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition()}function getHorizontalPixelRange(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getHScrollPosition()}function ensureColumnVisible(e,t,i="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(t,i),"ensureVisible")}function ensureIndexVisible(e,t,i){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureIndexVisible(t,i),"ensureVisible")}function ensureNodeVisible(e,t,i=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureNodeVisible(t,i),"ensureVisible")}function undoCellEditing(e){e.undoRedoService?.undo("api")}function redoCellEditing(e){e.undoRedoService?.redo("api")}function getCellEditorInstances(e,t={}){return e.rowRenderer.getCellEditorInstances(t).map(_unwrapUserComp)}function getEditingCells(e){return e.rowRenderer.getEditingCells()}function stopEditing(e,t=!1){e.rowRenderer.stopEditing(t)}function startEditingCell(e,t){const i=e.columnModel.getCol(t.colKey);if(!i){_warnOnce(`no column found for ${t.colKey}`);return}const s={rowIndex:t.rowIndex,rowPinned:t.rowPinned||null,column:i};t.rowPinned==null&&ensureIndexVisible(e,t.rowIndex),ensureColumnVisible(e,t.colKey);const r=e.navigationService.getCellByPosition(s);r&&(e.focusService.isCellFocused(s)||e.focusService.setFocusedCell(s),r.startRowOrCellEdit(t.key))}function getCurrentUndoSize(e){return e.undoRedoService?.getCurrentUndoStackSize()??0}function getCurrentRedoSize(e){return e.undoRedoService?.getCurrentRedoStackSize()??0}var EditService=class extends BeanStub{constructor(){super(...arguments),this.beanName="editService"}wireBeans(e){this.navigationService=e.navigationService,this.userComponentFactory=e.userComponentFactory,this.valueService=e.valueService}startEditing(e,t=null,i=!1,s=null){const o=this.createCellEditorParams(e,t,i),r=e.getColumn().getColDef(),n=this.userComponentFactory.getCellEditorDetails(r,o),l=n?.popupFromSelector!=null?n.popupFromSelector:!!r.cellEditorPopup,a=n?.popupPositionFromSelector!=null?n.popupPositionFromSelector:r.cellEditorPopupPosition;e.setEditing(!0,n),e.getComp().setEditDetails(n,l,a,this.gos.get("reactiveCustomComponents"));const d=e.createEvent(s,"cellEditingStarted");this.eventService.dispatchEvent(d)}stopEditing(e,t){const i=e.getComp(),{newValue:s,newValueExists:o}=this.takeValueFromCellEditor(t,i),r=e.getRowNode(),n=e.getColumn(),l=r.getValueFromValueService(n);let a=!1;o&&(a=this.saveNewValue(e,l,s,r,n)),e.setEditing(!1,void 0),i.setEditDetails(),e.updateAndFormatValue(!1),e.refreshCell({forceRefresh:!0,suppressFlash:!0});const d={...e.createEvent(null,"cellEditingStopped"),oldValue:l,newValue:s,valueChanged:a};return this.eventService.dispatchEvent(d),a}handleColDefChanged(e){const t=e.getCellEditor();if(t?.refresh){const{eventKey:i,cellStartedEdit:s}=e.getEditCompDetails().params,o=this.createCellEditorParams(e,i,s),r=e.getColumn().getColDef(),n=this.userComponentFactory.getCellEditorDetails(r,o);t.refresh(n.params)}}setFocusOutOnEditor(e){const t=e.getComp().getCellEditor();t&&t.focusOut&&t.focusOut()}setFocusInOnEditor(e){const t=e.getComp().getCellEditor();t&&t.focusIn?t.focusIn():e.focusCell(!0)}stopEditingAndFocus(e,t=!1,i=!1){e.stopRowOrCellEdit(),e.focusCell(!0),t||this.navigateAfterEdit(i,e.getCellPosition())}createPopupEditorWrapper(e){return new PopupEditorWrapper(e)}takeValueFromCellEditor(e,t){const i={newValueExists:!1};if(e)return i;const s=t.getCellEditor();return!s||s.isCancelAfterEnd&&s.isCancelAfterEnd()?i:{newValue:s.getValue(),newValueExists:!0}}saveNewValue(e,t,i,s,o){if(i===t)return!1;e.setSuppressRefreshCell(!0);const r=s.setDataValue(o,i,"edit");return e.setSuppressRefreshCell(!1),r}createCellEditorParams(e,t,i){const s=e.getColumn(),o=e.getRowNode();return this.gos.addGridCommonParams({value:o.getValueFromValueService(s),eventKey:t,column:s,colDef:s.getColDef(),rowIndex:e.getCellPosition().rowIndex,node:o,data:o.data,cellStartedEdit:i,onKeyDown:e.onKeyDown.bind(e),stopEditing:e.stopEditingAndFocus.bind(e),eGridCell:e.getGui(),parseValue:r=>this.valueService.parseValue(s,o,r,e.getValue()),formatValue:e.formatValue.bind(e)})}navigateAfterEdit(e,t){if(this.gos.get("enterNavigatesVerticallyAfterEdit")){const s=e?KeyCode.UP:KeyCode.DOWN;this.navigationService.navigateToNextCell(null,s,t,!1)}}},RowEditService=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowEditService"}startEditing(e,t=null,i=null,s=null){e.getAllCellCtrls().reduce((r,n)=>{const l=n===i;return l?n.startEditing(t,l,s):n.startEditing(null,l,s),r?!0:n.isEditing()},!1)&&this.setEditing(e,!0)}stopEditing(e,t=!1){const i=e.getAllCellCtrls(),s=e.isEditing();e.setStoppingRowEdit(!0);let o=!1;for(const r of i){const n=r.stopEditing(t);s&&!t&&!o&&n&&(o=!0)}if(o){const r=e.createRowEvent("rowValueChanged");this.eventService.dispatchEvent(r)}s&&this.setEditing(e,!1),e.setStoppingRowEdit(!1)}setEditing(e,t){e.setEditingRow(t),e.forEachGui(void 0,s=>s.rowComp.addOrRemoveCssClass("ag-row-editing",t));const i=t?e.createRowEvent("rowEditingStarted"):e.createRowEvent("rowEditingStopped");this.eventService.dispatchEvent(i)}},EditCoreModule={version:VERSION,moduleName:"@ag-grid-community/edit-core",beans:[EditService]},EditApiModule={version:VERSION,moduleName:"@ag-grid-community/edit-api",apiFunctions:{undoCellEditing,redoCellEditing,getCellEditorInstances,getEditingCells,stopEditing,startEditingCell,getCurrentUndoSize,getCurrentRedoSize},dependantModules:[EditCoreModule]},UndoRedoEditModule={version:VERSION,moduleName:"@ag-grid-community/undo-redo-edit",beans:[UndoRedoService],dependantModules:[EditCoreModule]},FullRowEditModule={version:VERSION,moduleName:"@ag-grid-community/full-row-edit",beans:[RowEditService],dependantModules:[EditCoreModule]},DefaultEditorModule={version:VERSION,moduleName:"@ag-grid-community/default-editor",userComponents:[{name:"agCellEditor",classImp:TextCellEditor}],dependantModules:[EditCoreModule]},DataTypeEditorsModule={version:VERSION,moduleName:"@ag-grid-community/data-type-editors",userComponents:[{name:"agTextCellEditor",classImp:TextCellEditor},{name:"agNumberCellEditor",classImp:NumberCellEditor},{name:"agDateCellEditor",classImp:DateCellEditor},{name:"agDateStringCellEditor",classImp:DateStringCellEditor},{name:"agCheckboxCellEditor",classImp:CheckboxCellEditor}],dependantModules:[DefaultEditorModule]},SelectEditorModule={version:VERSION,moduleName:"@ag-grid-community/select-editor",userComponents:[{name:"agSelectCellEditor",classImp:SelectCellEditor}],dependantModules:[EditCoreModule]},LargeTextEditorModule={version:VERSION,moduleName:"@ag-grid-community/large-text-editor",userComponents:[{name:"agLargeTextCellEditor",classImp:LargeTextCellEditor}],dependantModules:[EditCoreModule]},AllCommunityEditorsModule={version:VERSION,moduleName:"@ag-grid-community/all-editors",dependantModules:[DefaultEditorModule,DataTypeEditorsModule,SelectEditorModule,LargeTextEditorModule]},EditModule={version:VERSION,moduleName:"@ag-grid-community/editing",dependantModules:[EditCoreModule,UndoRedoEditModule,FullRowEditModule,AllCommunityEditorsModule,EditApiModule]},AutoWidthCalculator=class extends BeanStub{constructor(){super(...arguments),this.beanName="autoWidthCalculator"}wireBeans(e){this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const s=this.rowRenderer.getAllCellsForColumn(e);return t||s.push(i),this.addElementsToContainerAndGetWidth(s)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach(r=>this.cloneItemIntoDummy(r,t)),i.appendChild(t);const s=t.offsetWidth;i.removeChild(t);const o=this.getAutoSizePadding();return s+o}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach(i=>{const s=i.getHtmlElementForColumnHeader(e);s!=null&&(t=s)}),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const s=document.createElement("div"),o=s.classList;["ag-header-cell","ag-header-group-cell"].some(l=>i.classList.contains(l))?(o.add("ag-header","ag-header-row"),s.style.position="static"):o.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some(a=>n.classList.contains(a))){for(let a=0;a<n.classList.length;a++){const d=n.classList[a];d!="ag-row-position-absolute"&&o.add(d)}break}n=n.parentElement}s.appendChild(i),t.appendChild(s)}},StickyRowFeature=class extends BeanStub{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.topContainerHeight=0,this.bottomContainerHeight=0,this.extraTopHeight=0,this.extraBottomHeight=0}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.isClientSide=this.rowModel.getType()==="clientSide",this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl})}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}setOffsetTop(e){if(this.extraTopHeight===e)return;this.extraTopHeight=e;const t={type:"stickyTopOffsetChanged",offset:e};this.eventService.dispatchEvent(t)}setOffsetBottom(e){this.extraBottomHeight!==e&&(this.extraBottomHeight=e)}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getExtraTopHeight(){return this.extraTopHeight}getExtraBottomHeight(){return this.extraBottomHeight}getLastPixelOfGroup(e){return this.isClientSide?this.getClientSideLastPixelOfGroup(e):this.getServerSideLastPixelOfGroup(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}getServerSideLastPixelOfGroup(e){if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(e.isExpandable()||e.footer){if(e.master)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let i=e.childStore?.getStoreBounds();return e.footer&&(i=e.sibling.childStore?.getStoreBounds()),(i?.heightPx??0)+(i?.topPx??0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(e){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(e.isExpandable()||e.footer){if(e.footer&&e.rowIndex===0)return Number.MAX_SAFE_INTEGER;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let s=e.footer?e.sibling:e;for(;s.isExpandable()&&s.expanded;)if(s.master)s=s.detailNode;else if(s.childrenAfterSort){if(s.childrenAfterSort.length===0)break;s=_last(s.childrenAfterSort)}return s.rowTop+s.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(e){const t=e==="top";let i=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,i);const s=t?this.rowRenderer.getFirstVisibleVerticalPixel()-this.extraTopHeight:this.rowRenderer.getLastVisibleVerticalPixel()-this.extraTopHeight,o=new Set,r=d=>{if(o.add(d),t){const h=this.getLastPixelOfGroup(d),c=s+i+d.rowHeight;h<c?d.stickyRowTop=i+(h-c):d.stickyRowTop=i}else{const h=this.getFirstPixelOfGroup(d),c=s-(i+d.rowHeight);h>c?d.stickyRowTop=i-(h-c):d.stickyRowTop=i}i=0,o.forEach(h=>{const c=h.stickyRowTop+h.rowHeight;i<c&&(i=c)})},n=this.areFooterRowsStickySuppressed(),l=this.gos.get("suppressGroupRowsSticky"),a=d=>d.displayed?d.footer?n===!0||n==="grand"&&d.level===-1||n==="group"&&d.level>-1?!1:!o.has(d):d.isExpandable()?l===!0?!1:!o.has(d)&&d.expanded:!1:!1;for(let d=0;d<100;d++){let h=s+i;t||(h=s-i);const c=this.rowModel.getRowIndexAtPixel(h),u=this.rowModel.getRow(c);if(u==null)break;const p=this.getStickyAncestors(u).find(f=>(t?f.rowIndex<c:f.rowIndex>c)&&a(f));if(p){r(p);continue}if((t?u.rowTop<h:u.rowTop+u.rowHeight>h)&&a(u)){r(u);continue}break}return t||o.forEach(d=>{d.stickyRowTop=i-(d.stickyRowTop+d.rowHeight)}),this.refreshNodesAndContainerHeight(e,o,i)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(e===!0)return!0;const t=!!this.gos.get("groupIncludeFooter")||e==="group",i=!!this.gos.get("groupIncludeTotalFooter")||e==="grand";return t&&i?!0:i?"grand":t?"group":!1}canRowsBeSticky(){const e=this.gos.isGroupRowsSticky(),t=this.areFooterRowsStickySuppressed(),i=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!i)}getStickyAncestors(e){const t=[];let i=e.footer?e.sibling:e.parent;for(;i;)i.sibling&&t.push(i.sibling),t.push(i),i=i.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some(i=>i.getRowNode()===e)){for(let i=0;i<this.stickyTopRowCtrls.length;i++){const s=this.stickyTopRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight)&&this.checkStickyRows();return}for(let i=0;i<this.stickyBottomRowCtrls.length;i++){const s=this.stickyBottomRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("bottom",t,this.bottomContainerHeight)&&this.checkStickyRows()}refreshNodesAndContainerHeight(e,t,i){const s=e==="top",o=s?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,r={},n=[];for(let u=0;u<o.length;u++){const g=o[u].getRowNode();if(!t.has(g)){r[g.id]=o[u],g.sticky=!1;continue}n.push(o[u])}const l=new Set;for(let u=0;u<n.length;u++)l.add(n[u].getRowNode());const a=[];t.forEach(u=>{l.has(u)||(u.sticky=!0,a.push(this.createRowCon(u,!1,!1)))});let d=!!a.length||n.length!==o.length;s?this.topContainerHeight!==i&&(this.topContainerHeight=i,this.gridBodyCtrl.setStickyTopHeight(i),d=!0):this.bottomContainerHeight!==i&&(this.bottomContainerHeight=i,this.gridBodyCtrl.setStickyBottomHeight(i),d=!0),this.destroyRowCtrls(r,!1);const h=[...n,...a];h.sort((u,g)=>g.getRowNode().rowIndex-u.getRowNode().rowIndex),s||h.reverse(),h.forEach(u=>u.setRowTop(u.getRowNode().stickyRowTop));let c=0;return s?(t.forEach(u=>{u.rowIndex<this.pageBoundsService.getFirstRow()&&(c+=u.rowHeight)}),c>this.topContainerHeight&&(c=this.topContainerHeight),this.setOffsetTop(c)):(t.forEach(u=>{u.rowIndex>this.pageBoundsService.getLastRow()&&(c+=u.rowHeight)}),c>this.bottomContainerHeight&&(c=this.bottomContainerHeight),this.setOffsetBottom(c)),d?(s?this.stickyTopRowCtrls=h:this.stickyBottomRowCtrls=h,!0):!1}ensureRowHeightsValid(){let e=!1;const t=i=>{const s=i.getRowNode();if(s.rowHeightEstimated){const o=this.gos.getRowHeightForNode(s);s.setRowHeight(o.height),e=!0}};return this.stickyTopRowCtrls.forEach(t),this.stickyBottomRowCtrls.forEach(t),e}},RowRenderer=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowRenderer",this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach(r=>r.onRangeSelectionChanged())},t=()=>{this.getAllCellCtrls().forEach(r=>r.updateRangeBordersIfRangeCount())},i=()=>{this.eventService.addEventListener("rangeSelectionChanged",e),this.eventService.addEventListener("columnMoved",t),this.eventService.addEventListener("columnPinned",t),this.eventService.addEventListener("columnVisible",t)},s=()=>{this.eventService.removeEventListener("rangeSelectionChanged",e),this.eventService.removeEventListener("columnMoved",t),this.eventService.removeEventListener("columnPinned",t),this.eventService.removeEventListener("columnVisible",t)};this.addDestroyFunc(()=>s()),this.addManagedPropertyListener("enableRangeSelection",r=>{r.currentValue?i():s()}),this.gos.get("enableRangeSelection")&&i()}}wireBeans(e){this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.pinnedRowModel=e.pinnedRowModel,this.rowModel=e.rowModel,this.focusService=e.focusService,this.beans=e,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()})}initialise(){if(this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),bodyScroll:this.onBodyScroll.bind(this),bodyHeightChanged:this.redraw.bind(this)}),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListeners(["suppressCellFocus","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.gos.isGroupRowsSticky()){const e=this.rowModel.getType();(e==="clientSide"||e==="serverSide")&&(this.stickyRowFeature=this.createManagedBean(new StickyRowFeature(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this))))}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=this.gos.isDomLayout("print"),this.embedFullWidthRows=this.printLayout||this.gos.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=e??3;this.cachedRowCtrls=new RowCtrlCache(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const e=_getAllValuesInObject(this.rowCtrlsByRowIndex),t=_getAllValuesInObject(this.zombieRowCtrls),i=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];t.length>0||i.length>0?this.allRowCtrls=[...e,...t,...i]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onCellFocused(e)),this.getFullWidthRowCtrls().forEach(t=>t.onFullWidthRowFocused(e))}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:e=>{this.onCellFocusChanged(e)},cellFocusCleared:()=>this.onCellFocusChanged(),flashCells:e=>{this.getAllCellCtrls().forEach(t=>t.onFlashCells(e))},columnHoverChanged:()=>{this.getAllCellCtrls().forEach(e=>e.onColumnHover())},displayedColumnsChanged:()=>{this.getAllCellCtrls().forEach(e=>e.onDisplayedColumnsChanged())},displayedColumnsWidthChanged:()=>{this.printLayout&&this.getAllCellCtrls().forEach(e=>e.onLeftChanged())}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:this.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(e=>e()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners(),this.columnModel.getCols().forEach(t=>{const i=a=>{this.getAllCellCtrls().forEach(d=>{d.getColumn()===t&&a(d)})},s=()=>{i(a=>a.onLeftChanged())},o=()=>{i(a=>a.onWidthChanged())},r=()=>{i(a=>a.onFirstRightPinnedChanged())},n=()=>{i(a=>a.onLastLeftPinnedChanged())},l=()=>{i(a=>a.onColDefChanged())};t.addEventListener("leftChanged",s),t.addEventListener("widthChanged",o),t.addEventListener("firstRightPinnedChanged",r),t.addEventListener("lastLeftPinnedChanged",n),t.addEventListener("colDefChanged",l),this.destroyFuncsForColumnListeners.push(()=>{t.removeEventListener("leftChanged",s),t.removeEventListener("widthChanged",o),t.removeEventListener("firstRightPinnedChanged",r),t.removeEventListener("lastLeftPinnedChanged",n),t.removeEventListener("colDefChanged",l)})})}onDomLayoutChanged(){const e=this.gos.isDomLayout("print"),t=e||this.gos.get("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach(i=>{const s=i.getCellElement(e);s&&t.push(s)}),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowNodes()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowNodes())}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){const i=Object.fromEntries(t.map(o=>[o.id,o])),s=Object.fromEntries(e.map(o=>[o.getRowNode().id,o]));for(let o=0;o<t.length;o++){const r=t[o],n=e[o];n&&i[n.getRowNode().id]===void 0&&(n.destroyFirstPass(),n.destroySecondPass()),r.id in s?(e[o]=s[r.id],delete s[r.id]):e[o]=new RowCtrl(r,this.beans,!1,!1,this.printLayout)}e.length=t.length}onPinnedRowDataChanged(){const e={recycleRows:!0};this.redrawAfterModelUpdate(e)}redrawRow(e,t=!1){if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else if(this.cachedRowCtrls?.has(e)){this.cachedRowCtrls.removeRow(e);return}else{const i=s=>{const o=s[e.rowIndex];o&&o.getRowNode()===e&&(o.destroyFirstPass(),o.destroySecondPass(),s[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":i(this.topRowCtrls);break;case"bottom":i(this.bottomRowCtrls);break;default:i(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(e!=null){e?.forEach(i=>this.redrawRow(i,!0)),this.dispatchDisplayedRowsChanged(!1);return}this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=e?.suppressKeepFocus?null:this.focusService.getFocusCellToUseAfterRefresh();if(t==null)return null;const i=this.gos.getActiveDomElement(),s=this.gos.getDomData(i,CellCtrl.DOM_DATA_KEY_CELL_CTRL),o=this.gos.getDomData(i,RowCtrl.DOM_DATA_KEY_ROW_CTRL);return s||o?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&this.gos.isAnimateRows(),o=i?this.getRowsToRecycle():null;if(i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature){this.stickyRowFeature.checkStickyRows();const r=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();r&&this.updateContainerHeights(r)}this.recycleRows(o,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),t!=null&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,i=this.gos.get("suppressScrollOnNewData");t&&!i&&(this.gridBodyCtrl.getScrollFeature().scrollToTop(),this.stickyRowFeature?.resetOffsets())}updateContainerHeights(e=0){if(this.printLayout){this.rowContainerHeightService.setModelHeight(null);return}let t=this.pageBoundsService.getCurrentPageHeight();t===0&&(t=1),this.rowContainerHeightService.setModelHeight(t+e)}getLockOnRefresh(){if(this.refreshInProgress){const e=this.frameworkOverrides.getLockOnRefreshError?.()??"";throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace."+e)}this.refreshInProgress=!0,this.frameworkOverrides.getLockOnRefresh?.()}releaseLockOnRefresh(){this.refreshInProgress=!1,this.frameworkOverrides.releaseLockOnRefresh?.()}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&setTimeout(()=>{this.focusService.setRestoreFocusedCell(e),this.onCellFocusChanged(this.gos.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"}))})}stopEditing(e=!1){this.getAllRowCtrls().forEach(t=>{t.stopEditing(e)})}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let s=0;s<i;s++){const o=t[s].getAllCellCtrls(),r=o.length;for(let n=0;n<r;n++)e.push(o[n])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],t=this.stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],i=[...this.topRowCtrls,...this.bottomRowCtrls,...e,...t];for(const s in this.rowCtrlsByRowIndex)i.push(this.rowCtrlsByRowIndex[s]);return i}addRenderedRowListener(e,t,i){const s=this.rowCtrlsByRowIndex[t];s&&s.addEventListener(e,i)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach(t=>t.flashCell(e))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};for(const i of this.getCellCtrls(e.rowNodes,e.columns))i.refreshOrDestroyCell(t);this.refreshFullWidth(e.rowNodes)}refreshFullWidth(e){if(!e)return;let t=null;this.stickyRowFeature&&_browserSupportsPreventScroll()&&(t=this.getCellToRestoreFocusToAfterRefresh()||null);for(const i of this.getRowCtrls(e)){if(!i.isFullWidth())continue;i.refreshFullWidth()||this.redrawRow(i.getRowNode(),!0)}this.dispatchDisplayedRowsChanged(!1),t&&this.restoreFocusedCell(t)}getCellRendererInstances(e){const t=this.getCellCtrls(e.rowNodes,e.columns).map(o=>o.getCellRenderer()).filter(o=>o!=null);if(e.columns?.length)return t;const i=[],s=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach(o=>{if(s&&!this.isRowInMap(o.getRowNode(),s)||!o.isFullWidth())return;const r=o.getFullWidthCellRenderers();for(let n=0;n<r.length;n++){const l=r[n];l!=null&&i.push(l)}}),[...i,...t]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach(i=>{const s=i.getCellEditor();s&&t.push(s)}),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach(t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}}),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach(i=>{const s=i.id;switch(i.rowPinned){case"top":t.top[s]=i;break;case"bottom":t.bottom[s]=i;break;default:t.normal[s]=i;break}}),t}isRowInMap(e,t){const i=e.id;switch(e.rowPinned){case"top":return t.top[i]!=null;case"bottom":return t.bottom[i]!=null;default:return t.normal[i]!=null}}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return!e||!t?i:i.filter(s=>{const o=s.getRowNode();return this.isRowInMap(o,t)})}getCellCtrls(e,t){let i;_exists(t)&&(i={},t.forEach(o=>{const r=this.columnModel.getCol(o);_exists(r)&&(i[r.getId()]=!0)}));const s=[];return this.getRowCtrls(e).forEach(o=>{o.getAllCellCtrls().forEach(r=>{const n=r.getColumn().getId();i&&!i[n]||s.push(r)})}),s}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const e=[];_iterateObject(this.rowCtrlsByRowIndex,(i,s)=>{s.getRowNode().id==null&&e.push(i)}),this.removeRowCtrls(e);const t={};return _iterateObject(this.rowCtrlsByRowIndex,(i,s)=>{const o=s.getRowNode();t[o.id]=s}),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach(i=>{const s=this.rowCtrlsByRowIndex[i];s&&(s.destroyFirstPass(t),s.destroySecondPass()),delete this.rowCtrlsByRowIndex[i]})}onBodyScroll(e){e.direction==="vertical"&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&_browserSupportsPreventScroll()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const s=this.firstRenderedRow,o=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let r=!1;if(this.stickyRowFeature){r=this.stickyRowFeature.checkStickyRows();const l=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();l&&this.updateContainerHeights(l)}const n=this.firstRenderedRow!==s||this.lastRenderedRow!==o;if(!(t&&!r&&!n)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!r),i!=null)){const l=this.getCellToRestoreFocusToAfterRefresh();i!=null&&l==null&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const i={};e.forEach(r=>i[r]=!0);const o=Object.keys(this.rowCtrlsByRowIndex).filter(r=>!i[r]);this.removeRowCtrls(o,t)}calculateIndexesToDraw(e){const t=_createArrayOfNumbers(this.firstRenderedRow,this.lastRenderedRow),i=(o,r)=>{const n=r.getRowNode().rowIndex;n!=null&&(n<this.firstRenderedRow||n>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(r)&&t.push(n)};_iterateObject(this.rowCtrlsByRowIndex,i),_iterateObject(e,i),t.sort((o,r)=>o-r);const s=[];for(let o=0;o<t.length;o++){const r=t[o],n=this.rowModel.getRow(r);n&&!n.sticky&&s.push(r)}return s}recycleRows(e,t=!1,i=!1){const s=this.calculateIndexesToDraw(e);(this.printLayout||i)&&(t=!1),this.removeRowCompsNotToDraw(s,!t);const o=[];s.forEach(r=>{const n=this.createOrUpdateRowCtrl(r,e,t,i);_exists(n)&&o.push(n)}),e&&(i&&!this.gos.get("suppressAnimationFrame")&&!this.printLayout?this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}):this.destroyRowCtrls(e,t)),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){const t={type:"displayedRowsChanged",afterScroll:e};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){const e=this.visibleColsService.isPinningLeft(),t=this.visibleColsService.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach(t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter(i=>{if(!i.isFullWidth())return!1;const s=i.getRowNode();return!(t!=null&&!this.isRowInMap(s,t))})}createOrUpdateRowCtrl(e,t,i,s){let o,r=this.rowCtrlsByRowIndex[e];if(r||(o=this.rowModel.getRow(e),_exists(o)&&_exists(t)&&t[o.id]&&o.alreadyRendered&&(r=t[o.id],t[o.id]=null)),!r)if(o||(o=this.rowModel.getRow(e)),_exists(o))r=this.createRowCon(o,i,s);else return;return o&&(o.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=r,r}destroyRowCtrls(e,t){const i=[];_iterateObject(e,(s,o)=>{if(o){if(this.cachedRowCtrls&&o.isCacheable()){this.cachedRowCtrls.addRow(o);return}o.destroyFirstPass(!t),t?(this.zombieRowCtrls[o.getInstanceId()]=o,i.push(()=>{o.destroySecondPass(),delete this.zombieRowCtrls[o.getInstanceId()]})):o.destroySecondPass()}}),t&&(i.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),_executeInAWhile(i))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){const e=this.getRowBuffer(),t=this.gos.getRowHeightAsNumber();return e*t}workOutFirstAndLastRowsToRender(){this.rowContainerHeightService.updateOffset();let e,t;if(!this.rowModel.isRowsToRender())e=0,t=-1;else if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.pageBoundsService.getFirstRow(),t=this.pageBoundsService.getLastRow();else{const l=this.getRowBufferInPixels(),a=this.ctrlsService.getGridBodyCtrl(),d=this.gos.get("suppressRowVirtualisation");let h=!1,c,u;do{const v=this.pageBoundsService.getPixelOffset(),{pageFirstPixel:C,pageLastPixel:w}=this.pageBoundsService.getCurrentPagePixelRange(),y=this.rowContainerHeightService.getDivStretchOffset(),F=a.getScrollFeature().getVScrollPosition(),S=F.top,R=F.bottom;d?(c=C+y,u=w+y):(c=Math.max(S+v-l,C)+y,u=Math.min(R+v+l,w)+y),this.firstVisibleVPixel=Math.max(S+v,C)+y,this.lastVisibleVPixel=Math.min(R+v,w)+y,h=this.ensureAllRowsInRangeHaveHeightsCalculated(c,u)}while(h);let g=this.rowModel.getRowIndexAtPixel(c),p=this.rowModel.getRowIndexAtPixel(u);const m=this.pageBoundsService.getFirstRow(),f=this.pageBoundsService.getLastRow();g<m&&(g=m),p>f&&(p=f),e=g,t=p}const i=this.gos.isDomLayout("normal"),s=this.gos.get("suppressMaxRenderedRowRestriction"),o=Math.max(this.getRowBuffer(),500);i&&!s&&t-e>o&&(t=e+o);const r=e!==this.firstRenderedRow,n=t!==this.lastRenderedRow;if(r||n){this.firstRenderedRow=e,this.lastRenderedRow=t;const l={type:"viewportChanged",firstRow:e,lastRow:t};this.eventService.dispatchEvent(l)}}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const e={type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent(e)})}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const i=this.pinnedRowModel?.ensureRowHeightsValid(),s=this.stickyRowFeature?.ensureRowHeightsValid(),o=this.rowModel.ensureRowHeightsValid(e,t,this.pageBoundsService.getFirstRow(),this.pageBoundsService.getLastRow());return(o||s)&&this.eventService.dispatchEvent({type:"recalculateRowBounds"}),s||o||i?(this.updateContainerHeights(),!0):!1}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const s=e.getRowNode(),o=this.focusService.isRowNodeFocused(s),r=e.isEditing(),n=s.detail;return o||r||n?!!this.isRowPresent(s):!1}isRowPresent(e){return this.rowModel.isRowPresent(e)?this.paginationService?this.paginationService.isRowPresent(e):!0:!1}createRowCon(e,t,i){const s=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(s)return s;const o=this.gos.get("suppressAnimationFrame"),r=i&&!o&&!this.printLayout;return new RowCtrl(e,this.beans,t,r,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.values(e).map(t=>t.getRowNode())}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find(s=>s.getRowNode().rowIndex===i)||null,t||(t=this.getStickyBottomRowCtrls().find(s=>s.getRowNode().rowIndex===i)||null));break}return t}isRangeInRenderedViewport(e,t){if(e==null||t==null)return!1;const s=e>this.lastRenderedRow;return!(t<this.firstRenderedRow)&&!s}},RowCtrlCache=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const t=this.entriesList[0];t.destroyFirstPass(),t.destroySecondPass(),this.removeFromCache(t)}}getRow(e){if(e==null||e.id==null)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.getRowNode()!=e?null:t):null}has(e){return this.entriesMap[e.id]!=null}removeRow(e){const t=e.id,i=this.entriesMap[t];delete this.entriesMap[t],_removeFromArray(this.entriesList,i)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],_removeFromArray(this.entriesList,e)}getEntries(){return this.entriesList}},PinnedRowModel=class extends BeanStub{constructor(){super(...arguments),this.beanName="pinnedRowModel"}wireBeans(e){this.beans=e}postConstruct(){this.setPinnedTopRowData(),this.setPinnedBottomRowData(),this.addManagedPropertyListener("pinnedTopRowData",()=>this.setPinnedTopRowData()),this.addManagedPropertyListener("pinnedBottomRowData",()=>this.setPinnedBottomRowData()),this.addManagedEventListeners({gridStylesChanged:this.onGridStylesChanges.bind(this)})}isEmpty(e){const t=e==="top"?this.pinnedTopRows:this.pinnedBottomRows;return _missingOrEmpty(t)}isRowsToRender(e){return!this.isEmpty(e)}getRowAtPixel(e,t){const i=t==="top"?this.pinnedTopRows:this.pinnedBottomRows;if(_missingOrEmpty(i))return 0;for(let s=0;s<i.length;s++){const o=i[s];if(o.rowTop+o.rowHeight-1>=e)return s}return i.length-1}onGridStylesChanges(e){if(e.rowHeightChanged){const t=i=>{i.setRowHeight(i.rowHeight,!0)};this.pinnedBottomRows.forEach(t),this.pinnedTopRows.forEach(t)}}ensureRowHeightsValid(){let e=!1,t=0;const i=o=>{if(o.rowHeightEstimated){const r=this.gos.getRowHeightForNode(o);o.setRowTop(t),o.setRowHeight(r.height),t+=r.height,e=!0}};this.pinnedBottomRows?.forEach(i),t=0,this.pinnedTopRows?.forEach(i);const s={type:"pinnedHeightChanged"};return this.eventService.dispatchEvent(s),e}setPinnedTopRowData(){const e=this.gos.get("pinnedTopRowData");this.pinnedTopRows=this.createNodesFromData(e,!0);const t={type:"pinnedRowDataChanged"};this.eventService.dispatchEvent(t)}setPinnedBottomRowData(){const e=this.gos.get("pinnedBottomRowData");this.pinnedBottomRows=this.createNodesFromData(e,!1);const t={type:"pinnedRowDataChanged"};this.eventService.dispatchEvent(t)}createNodesFromData(e,t){const i=[];if(e){const s=this.gos.getRowIdCallback(),o=t?RowNode.ID_PREFIX_TOP_PINNED:RowNode.ID_PREFIX_BOTTOM_PINNED;let r=0;e.forEach((n,l)=>{const a=new RowNode(this.beans);a.data=n,a.id=s?.({data:n,level:0})??o+l,a.rowPinned=t?"top":"bottom",a.setRowTop(r),a.setRowHeight(this.gos.getRowHeightForNode(a).height),a.setRowIndex(l),r+=a.rowHeight,i.push(a)})}return i}getPinnedTopRowNodes(){return this.pinnedTopRows}getPinnedBottomRowNodes(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(e){return this.pinnedTopRows[e]}getPinnedBottomRow(e){return this.pinnedBottomRows[e]}forEachPinnedTopRow(e){_missingOrEmpty(this.pinnedTopRows)||this.pinnedTopRows.forEach(e)}forEachPinnedBottomRow(e){_missingOrEmpty(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(e)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(e){if(!e||e.length===0)return 0;const t=_last(e);return t.rowTop+t.rowHeight}},ServerSideTransactionResultStatus=(e=>(e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled",e.StoreNotStarted="StoreNotStarted",e))(ServerSideTransactionResultStatus||{}),RowNodeBlock=class extends BeanStub{constructor(e){super(),this.state="needsLoading",this.version=0,this.id=e}getId(){return this.id}load(){this.state="loading",this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}getState(){return this.state}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed",this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,i){this.successCommon(e,{rowData:t,rowCount:i})}isRequestMostRecentAndLive(e){const t=e===this.version,i=this.isAlive();return t&&i}successCommon(e,t){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}dispatchLoadCompleted(e=!0){const t={type:"loadComplete",success:e,block:this};this.dispatchLocalEvent(t)}},RowNodeBlockLoader=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=_debounce(this.performCheckBlocksToLoad.bind(this),e))}getMaxConcurrentDatasourceRequests(){const e=this.gos.get("maxConcurrentDatasourceRequests");if(e==null)return 2;if(!(e<=0))return e}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){_removeFromArray(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchLocalEvent({type:"blockLoaded"}),this.activeBlockLoadsCount==0&&this.dispatchLocalEvent({type:"blockLoaderFinished"})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){this.gos.get("debug")&&_log("RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.getAvailableLoadingCount(),t=this.blocks.filter(i=>i.getState()==="needsLoading").slice(0,e);this.registerLoads(t.length),t.forEach(i=>i.load()),this.printCacheStatus()}getBlockState(){if(this.gos.isRowModelType("serverSide"))return this.rowModel.getBlockStates();const e={};return this.blocks.forEach(t=>{const{id:i,state:s}=t.getBlockStateJson();e[i]=s}),e}printCacheStatus(){this.gos.get("debug")&&_log(`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return this.maxConcurrentRequests!==void 0?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}},RowNodeBlockModule={version:VERSION,moduleName:"@ag-grid-community/row-node-block",beans:[RowNodeBlockLoader]},RowRangeSelectionContext=class{constructor(){this.root=null,this.end=null,this.cachedRange=[]}init(e){this.rowModel=e}reset(){this.root=null,this.end=null,this.cachedRange.length=0}setRoot(e){this.root=e,this.end=null,this.cachedRange.length=0}setEndRange(e){this.end=e,this.cachedRange.length=0}getRange(){if(this.cachedRange.length===0){const e=this.getRoot(),t=this.getEnd();if(e==null||t==null)return this.cachedRange;this.cachedRange=this.rowModel.getNodesInRangeForSelection(e,t)}return this.cachedRange}isInRange(e){return this.root===null?!1:this.getRange().some(t=>t.id===e.id)}getRoot(){return this.root&&this.root?.key===null&&(this.root=this.rowModel.getRowNode(this.root.id)??null),this.root}getEnd(){return this.end&&this.end?.key===null&&(this.end=this.rowModel.getRowNode(this.end.id)??null),this.end}truncate(e){const t=this.getRange();if(t.length===0)return{keep:[],discard:[]};const i=t[0].id===this.root.id,s=t.findIndex(o=>o.id===e.id);if(s>-1){const o=t.slice(0,s),r=t.slice(s+1);return this.setEndRange(e),i?{keep:o,discard:r}:{keep:r,discard:o}}else return{keep:t,discard:[]}}extend(e,t=!1){const i=this.getRoot();if(i==null){const o=this.getRange().slice();return t&&e.depthFirstSearch(r=>!r.group&&o.push(r)),o.push(e),this.setRoot(e),{keep:o,discard:[]}}if(this.rowModel.getNodesInRangeForSelection(i,e).find(o=>o.id===this.end?.id))return this.setEndRange(e),{keep:this.getRange(),discard:[]};{const o=this.getRange().slice();return this.setEndRange(e),{keep:this.getRange(),discard:o}}}},StylingService=class extends BeanStub{constructor(){super(...arguments),this.beanName="stylingService"}wireBeans(e){this.expressionService=e.expressionService}processAllCellClasses(e,t,i,s){this.processClassRules(void 0,e.cellClassRules,t,i,s),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,s,o){if(t==null&&e==null)return;const r={},n={},l=(a,d)=>{a.split(" ").forEach(h=>{h.trim()!=""&&d(h)})};if(t){const a=Object.keys(t);for(let d=0;d<a.length;d++){const h=a[d],c=t[h];let u;typeof c=="string"?u=this.expressionService.evaluate(c,i):typeof c=="function"&&(u=c(i)),l(h,g=>{u?r[g]=!0:n[g]=!0})}}e&&o&&Object.keys(e).forEach(a=>l(a,d=>{r[d]||(n[d]=!0)})),o&&Object.keys(n).forEach(o),Object.keys(r).forEach(s)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let s;return typeof i=="function"?s=i(t):s=i,typeof s=="string"&&(s=[s]),s||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach(o=>{i(o)})}},AgToggleButton=class extends AgCheckbox{constructor(e){super(e,"ag-toggle-button")}setValue(e,t){return super.setValue(e,t),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}},AgToggleButtonSelector={selector:"AG-TOGGLE-BUTTON",component:AgToggleButton},TabGuardClassNames=(e=>(e.TAB_GUARD="ag-tab-guard",e.TAB_GUARD_TOP="ag-tab-guard-top",e.TAB_GUARD_BOTTOM="ag-tab-guard-bottom",e))(TabGuardClassNames||{}),TabGuardCtrl=class extends BeanStub{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:t,eTopGuard:i,eBottomGuard:s,focusTrapActive:o,forceFocusOutWhenTabGuardsAreEmpty:r,isFocusableContainer:n,focusInnerElement:l,onFocusIn:a,onFocusOut:d,shouldStopEventPropagation:h,onTabKeyDown:c,handleKeyDown:u,eFocusableElement:g}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=s,this.providedFocusInnerElement=l,this.eFocusableElement=g,this.focusTrapActive=!!o,this.forceFocusOutWhenTabGuardsAreEmpty=!!r,this.isFocusableContainer=!!n,this.providedFocusIn=a,this.providedFocusOut=d,this.providedShouldStopEventPropagation=h,this.providedOnTabKeyDown=c,this.providedHandleKeyDown=u}wireBeans(e){this.focusService=e.focusService}postConstruct(){this.createManagedBean(new ManagedFocusFeature(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach(e=>this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)}))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return this.providedShouldStopEventPropagation?this.providedShouldStopEventPropagation():!1}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty&&this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length===0){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}findNextElementOutsideAndFocus(e){const t=this.gos.getDocument(),i=this.focusService.findFocusableElements(t.body,null,!0),s=i.indexOf(e?this.eTopGuard:this.eBottomGuard);if(s===-1)return;let o,r;e?(o=0,r=s):(o=s+1,r=i.length);const n=i.slice(o,r),l=this.gos.get("tabIndex");n.sort((a,d)=>{const h=parseInt(a.getAttribute("tabindex")||"0"),c=parseInt(d.getAttribute("tabindex")||"0");return c===l?1:h===l?-1:h===0?1:c===0?-1:h-c}),n[e?n.length-1:0].focus()}onFocusIn(e){this.focusTrapActive||this.forcingFocusOut||(this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(e);return}if(this.focusTrapActive||e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},TabGuardFeature=class extends BeanStub{constructor(e){super(),this.comp=e}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:i,eFocusableElement:s}=this,o=[t,i],r={setTabIndex:m=>{o.forEach(f=>m!=null?f.setAttribute("tabindex",m):f.removeAttribute("tabindex"))}};this.addTabGuards(t,i);const{focusTrapActive:n=!1,onFocusIn:l,onFocusOut:a,focusInnerElement:d,handleKeyDown:h,onTabKeyDown:c,shouldStopEventPropagation:u,forceFocusOutWhenTabGuardsAreEmpty:g,isFocusableContainer:p}=e;this.tabGuardCtrl=this.createManagedBean(new TabGuardCtrl({comp:r,focusTrapActive:n,eTopGuard:t,eBottomGuard:i,eFocusableElement:s,onFocusIn:l,onFocusOut:a,focusInnerElement:d,handleKeyDown:h,onTabKeyDown:c,shouldStopEventPropagation:u,forceFocusOutWhenTabGuardsAreEmpty:g,isFocusableContainer:p}))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=this.gos.getDocument().createElement("div"),i=e==="top"?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",i),_setAriaRole(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];_clearElement(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,i){_isNodeOrElement(t)||(t=t.getGui());const{eBottomGuard:s}=this;s?s.insertAdjacentElement("beforebegin",t):e(t,i)}},TabGuardComp=class extends Component{initialiseTabGuard(e){this.tabGuardFeature=this.createManagedBean(new TabGuardFeature(this)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},instanceIdSeq=0,WAIT_FOR_POPUP_CONTENT_RESIZE=200,PopupService=class extends BeanStub{constructor(){super(...arguments),this.beanName="popupService",this.popupList=[]}wireBeans(e){this.ctrlsService=e.ctrlsService,this.resizeObserverService=e.resizeObserverService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){const e=this.gos.get("popupParent");return e||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,s=this.getPopupIndex(i);if(s!==-1){const g=this.popupList[s];g.alignedToElement=t}const o=t.getBoundingClientRect(),r=this.getParentRect(),n=this.keepXYWithinBounds(i,o.top-r.top,0),l=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=`${l}px`;const d=r.right-r.left-l;let h;this.gos.get("enableRtl")?(h=u(),h<0&&(h=c(),this.setAlignedStyles(i,"left")),h>d&&(h=0,this.setAlignedStyles(i,"right"))):(h=c(),h>d&&(h=u(),this.setAlignedStyles(i,"right")),h<0&&(h=0,this.setAlignedStyles(i,"left"))),i.style.left=`${h}px`,i.style.top=`${n}px`;function c(){return o.right-r.left-2}function u(){return o.left-r.left-l}}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:s,skipObserver:o}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:!0,skipObserver:o,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,eventSource:r,alignSide:n="left",position:l="over",column:a,rowNode:d,type:h}=e,c=r.getBoundingClientRect(),u=this.getParentRect(),g=this.getPopupIndex(t);if(g!==-1){const m=this.popupList[g];m.alignedToElement=r}const p=()=>{let m=c.left-u.left;n==="right"&&(m-=t.offsetWidth-c.width);let f;return l==="over"?(f=c.top-u.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),this.shouldRenderUnderOrAbove(t,c,u,e.nudgeY||0)==="under"?f=c.top-u.top+c.height:f=c.top-t.offsetHeight-(s||0)*2-u.top),{x:m,y:f}};this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,updatePosition:p,postProcessCallback:()=>this.callPostProcessPopup(h,t,r,null,a,d)})}shouldRenderUnderOrAbove(e,t,i,s){const o=i.bottom-t.bottom,r=t.top-i.top,n=e.offsetHeight+s;return o>n?"under":r>n||r>o?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(i===-1)return;const s=this.popupList[i],{alignedToElement:o}=s;!o||(["right","left","over","above","under"].forEach(n=>{o.classList.remove(`ag-has-popup-positioned-${n}`),e.classList.remove(`ag-popup-positioned-${n}`)}),!t)||(o.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}callPostProcessPopup(e,t,i,s,o,r){const n=this.gos.getCallback("postProcessPopup");n&&n({column:o,rowNode:r,ePopup:t,type:e,eventSource:i,mouseEvent:s})}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:s,nudgeY:o,skipObserver:r,updatePosition:n}=e,l={width:0,height:0},a=(d=!1)=>{let{x:h,y:c}=n();d&&t.clientWidth===l.width&&t.clientHeight===l.height||(l.width=t.clientWidth,l.height=t.clientHeight,s&&(h+=s),o&&(c+=o),i&&(h=this.keepXYWithinBounds(t,h,1),c=this.keepXYWithinBounds(t,c,0)),t.style.left=`${h}px`,t.style.top=`${c}px`,e.postProcessCallback&&e.postProcessCallback())};if(a(),!r){const d=this.resizeObserverService.observeResize(t,()=>a(!0));setTimeout(()=>d(),WAIT_FOR_POPUP_CONTENT_RESIZE)}}getActivePopups(){return this.popupList.map(e=>e.element)}getPopupList(){return this.popupList}getParentRect(){const e=this.gos.getDocument();let t=this.getPopupParent();return t===e.body?t=e.documentElement:getComputedStyle(t).position==="static"&&(t=t.offsetParent),_getElementRectWithOffset(t)}keepXYWithinBounds(e,t,i){const s=i===0,o=s?"clientHeight":"clientWidth",r=s?"top":"left",n=s?"height":"width",l=s?"scrollTop":"scrollLeft",a=this.gos.getDocument(),d=a.documentElement,h=this.getPopupParent(),c=e.getBoundingClientRect(),u=h.getBoundingClientRect(),g=a.documentElement.getBoundingClientRect(),p=h===a.body,m=Math.ceil(c[n]);let v=p?(s?_getAbsoluteHeight:_getAbsoluteWidth)(d)+d[l]:h[o];p&&(v-=Math.abs(g[r]-u[r]));const C=v-m;return Math.min(Math.max(t,0),Math.abs(C))}addPopup(e){const t=this.gos.getDocument(),{eChild:i,ariaLabel:s,alwaysOnTop:o,positionCallback:r,anchorToElement:n}=e;if(!t)return _warnOnce("could not find the document, document is empty"),{hideFunc:()=>{}};const l=this.getPopupIndex(i);if(l!==-1)return{hideFunc:this.popupList[l].hideFunc};this.initialisePopupPosition(i);const a=this.createPopupWrapper(i,s,!!o),d=this.addEventListenersToPopup({...e,wrapperEl:a});return r&&r(),this.addPopupToPopupList(i,a,d,n),{hideFunc:d}}initialisePopupPosition(e){const i=this.getPopupParent().getBoundingClientRect();_exists(e.style.top)||(e.style.top=`${i.top*-1}px`),_exists(e.style.left)||(e.style.left=`${i.left*-1}px`)}createPopupWrapper(e,t,i){const s=this.getPopupParent(),o=document.createElement("div");return this.environment.applyThemeClasses(o),o.classList.add("ag-popup"),e.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||_setAriaRole(e,"dialog"),_setAriaLabel(e,t),o.appendChild(e),s.appendChild(o),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),o}handleThemeChange(e){if(e.themeChanged)for(const t of this.popupList)this.environment.applyThemeClasses(t.wrapper)}addEventListenersToPopup(e){const t=this.gos.getDocument(),i=this.getPopupParent(),{wrapperEl:s,eChild:o,closedCallback:r,afterGuiAttached:n,closeOnEsc:l,modal:a}=e;let d=!1;const h=p=>{if(!s.contains(this.gos.getActiveDomElement()))return;p.key===KeyCode.ESCAPE&&!_isStopPropagationForAgGrid(p)&&g({keyboardEvent:p})},c=p=>g({mouseEvent:p}),u=p=>g({touchEvent:p}),g=(p={})=>{const{mouseEvent:m,touchEvent:f,keyboardEvent:v,forceHide:C}=p;!C&&(this.isEventFromCurrentPopup({mouseEvent:m,touchEvent:f},o)||d)||(d=!0,i.removeChild(s),t.removeEventListener("keydown",h),t.removeEventListener("mousedown",c),t.removeEventListener("touchstart",u),t.removeEventListener("contextmenu",c),this.eventService.removeEventListener("dragStarted",c),r&&r(m||f||v),this.removePopupFromPopupList(o))};return n&&n({hidePopup:g}),window.setTimeout(()=>{l&&t.addEventListener("keydown",h),a&&(t.addEventListener("mousedown",c),this.eventService.addEventListener("dragStarted",c),t.addEventListener("touchstart",u),t.addEventListener("contextmenu",c))},0),g}addPopupToPopupList(e,t,i,s){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:instanceIdSeq++,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s)}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(i===-1)return;const s=this.popupList[i];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then(r=>r&&r()),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!t)return;const o=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:s.hideFunc});return s.stopAnchoringPromise=o,s.isAnchored=!0,o}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:s,ePopup:o}=e,r=s.getBoundingClientRect(),n=i.top-r.top,l=i.left-r.left;let a=n,d=l;const h=o.style.top,c=parseInt(h.substring(0,h.length-1),10),u=o.style.left,g=parseInt(u.substring(0,u.length-1),10),p=this.getFrameworkOverrides();return new AgPromise(m=>{p.wrapIncoming(()=>{p.setInterval(()=>{const f=t.getBoundingClientRect(),v=s.getBoundingClientRect();if(v.top==0&&v.left==0&&v.height==0&&v.width==0){e.hidePopup();return}const w=f.top-v.top;if(w!=a){const F=this.keepXYWithinBounds(o,c+n-w,0);o.style.top=`${F}px`}a=w;const y=f.left-v.left;if(y!=d){const F=this.keepXYWithinBounds(o,g+l-y,1);o.style.left=`${F}px`}d=y},200).then(f=>{m(()=>{f!=null&&window.clearInterval(f)})})},"popupPositioning")})}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:s}=e,o=i||s;if(!o)return!1;const r=this.getPopupIndex(t);if(r===-1)return!1;for(let n=r;n<this.popupList.length;n++){const l=this.popupList[n];if(_isElementInEventPath(l.element,o))return!0}return this.isElementWithinCustomPopup(o.target)}isElementWithinCustomPopup(e){const t=this.gos.getDocument();for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||e.parentElement===null)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),s=i.length,o=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),r=o.length,n=this.getWrapper(e);if(!n||s<=1||!t.contains(e))return!1;const l=i.indexOf(n),a=n.querySelectorAll("div"),d=[];a.forEach(c=>{c.scrollTop!==0&&d.push([c,c.scrollTop])});let h=!1;for(r?n.classList.contains("ag-always-on-top")?l!==s-1&&(_last(o).insertAdjacentElement("afterend",n),h=!0):l!==s-r-1&&(o[0].insertAdjacentElement("beforebegin",n),h=!0):l!==s-1&&(_last(i).insertAdjacentElement("afterend",n),h=!0);d.length;){const c=d.pop();c[0].scrollTop=c[1]}return h}},PASSIVE_EVENTS2=["touchstart","touchend","touchmove","touchcancel"],VanillaFrameworkOverrides=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=t=>t(),this.wrapOutgoing=t=>t()}setInterval(e,t){return new AgPromise(i=>{i(window.setInterval(e,t))})}addEventListener(e,t,i,s){const o=_includes(PASSIVE_EVENTS2,t);e.addEventListener(t,i,{capture:!!s,passive:o})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${this.frameworkName==="solid"?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}},CellNavigationService=class extends BeanStub{constructor(){super(...arguments),this.beanName="cellNavigationService"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.pinnedRowModel=e.pinnedRowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===KeyCode.UP,s=e===KeyCode.DOWN,o=e===KeyCode.LEFT;let r,n;if(i||s)n=i?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow(),r=t.column;else{const l=this.visibleColsService.getAllCols(),a=this.gos.get("enableRtl");n=t.rowIndex,r=o!==a?l[0]:_last(l)}return{rowIndex:n,rowPinned:null,column:r}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,s=!1;for(;!s;){switch(e){case KeyCode.UP:i=this.getCellAbove(i);break;case KeyCode.DOWN:i=this.getCellBelow(i);break;case KeyCode.RIGHT:this.gos.get("enableRtl")?i=this.getCellToLeft(i):i=this.getCellToRight(i);break;case KeyCode.LEFT:this.gos.get("enableRtl")?i=this.getCellToRight(i):i=this.getCellToLeft(i);break;default:i=null,_warnOnce("unknown key for navigation ",e);break}i?s=this.isCellGoodToFocusOn(i):s=!0}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex);break}return i?!t.isSuppressNavigable(i):!1}getCellToLeft(e){if(!e)return null;const t=this.visibleColsService.getColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.visibleColsService.getColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.pageBoundsService.getFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const s=this.rowModel.getRow(e.rowIndex),o=this.getNextStickyPosition(s);return o||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!this.gos.isGroupRowsSticky()||!e||!e.sticky)return;const i=this.rowRenderer.getStickyTopRowCtrls().some(l=>l.getRowNode().rowIndex===e.rowIndex);let s=[];i?s=[...this.rowRenderer.getStickyTopRowCtrls()].sort((l,a)=>l.getRowNode().rowIndex-a.getRowNode().rowIndex):s=[...this.rowRenderer.getStickyBottomRowCtrls()].sort((l,a)=>a.getRowNode().rowIndex-l.getRowNode().rowIndex);const o=t?-1:1,r=s.findIndex(l=>l.getRowNode().rowIndex===e.rowIndex),n=s[r+o];if(n)return{rowIndex:n.getRowNode().rowIndex,rowPinned:null}}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;return t==="top"?this.pinnedRowModel.getPinnedTopRowNodes().length-1<=i:t==="bottom"?this.pinnedRowModel.getPinnedBottomRowNodes().length-1<=i:this.pageBoundsService.getLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned;if(i?t===0:t===this.pageBoundsService.getFirstRow())return i==="top"?null:i?this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null:this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const o=this.rowModel.getRow(e.rowIndex),r=this.getNextStickyPosition(o,!0);return r||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.pageBoundsService.getLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowNodes().length-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const t=this.visibleColsService.getAllCols();let i=e.rowIndex,s=e.rowPinned,o=this.visibleColsService.getColAfter(e.column);if(!o){o=t[0];const r=this.getRowBelow(e);if(_missing(r)||!r.rowPinned&&!(this.paginationService?.isRowInPage(r)??!0))return null;i=r?r.rowIndex:null,s=r?r.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}getNextTabbedCellBackwards(e){const t=this.visibleColsService.getAllCols();let i=e.rowIndex,s=e.rowPinned,o=this.visibleColsService.getColBefore(e.column);if(!o){o=_last(t);const r=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(_missing(r)||!r.rowPinned&&!(this.paginationService?.isRowInPage(r)??!0))return null;i=r?r.rowIndex:null,s=r?r.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}};function dispatchEvent(e,t){e.eventService.dispatchEvent(t)}var ApiFunctionService=class extends BeanStub{constructor(){super(...arguments),this.beanName="apiFunctionService",this.functions={dispatchEvent},this.isDestroyed=!1}wireBeans(e){this.beans=e}postConstruct(){this.preDestroyLink=this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}callFunction(e,t){const i=this.functions[e];if(i)return i.apply(i,[this.beans,...t]);if(this.isDestroyed)return this.destroyedHandler(e);this.isFrameworkMethod(e)||this.beans.validationService?.warnMissingApiFunction(e)}addFunction(e,t){const{validationService:i}=this.beans;i&&(t=i.validateApiFunction(e,t)),this.functions[e]=t}destroy(){this.functions={},this.isDestroyed=!0,super.destroy()}destroyedHandler(e){if(e==="isDestroyed")return!0;e!=="destroy"&&_warnOnce(`Grid API function ${e}() cannot be called as the grid has been destroyed.
|
|
153
|
+
</div>`,[AgCheckboxSelector]),this.eCheckbox=RefPlaceholder}init(e){this.params=e;const t=e.value??void 0;this.eCheckbox.setValue(t),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(this.eCheckbox,{fieldValueChanged:s=>this.setAriaLabel(s.selected)})}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=_getAriaCheckboxStateName(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}},UndoRedoAction=class{constructor(e){this.cellValueChanges=e}},RangeUndoRedoAction=class extends UndoRedoAction{constructor(e,t,i,s){super(e),this.initialRange=t,this.finalRange=i,this.ranges=s}},DEFAULT_STACK_SIZE=10,UndoRedoStack=class{constructor(e){this.actionStack=[],this.maxStackSize=e||DEFAULT_STACK_SIZE,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}},UndoRedoService=class extends BeanStub{constructor(){super(...arguments),this.beanName="undoRedoService",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=this.activeCellEdit!==null&&this.cellPositionUtils.equals(this.activeCellEdit,t),s=this.activeRowEdit!==null&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:n,column:l,oldValue:a,value:d}=e,h={rowPinned:r,rowIndex:n,columnId:l.getColId(),newValue:d,oldValue:a};this.cellValueChanges.push(h)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}wireBeans(e){this.focusService=e.focusService,this.ctrlsService=e.ctrlsService,this.cellPositionUtils=e.cellPositionUtils,this.rowPositionUtils=e.rowPositionUtils,this.columnModel=e.columnModel,this.rangeService=e.rangeService}postConstruct(){if(!this.gos.get("undoRedoCellEditing"))return;const e=this.gos.get("undoRedoCellEditingLimit");if(e<=0)return;this.undoStack=new UndoRedoStack(e),this.redoStack=new UndoRedoStack(e),this.addListeners();const t=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:i=>{i.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:t,newColumnsLoaded:t,columnGroupOpened:t,columnRowGroupChanged:t,columnMoved:t,columnPinned:t,columnVisible:t,rowDragEnd:t}),this.ctrlsService.whenReady(i=>{this.gridBodyCtrl=i.gridBodyCtrl})}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){const t={type:"undoStarted",source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo"),s={type:"undoEnded",source:e,operationPerformed:i};this.eventService.dispatchEvent(s)}redo(e){const t={type:"redoStarted",source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo"),s={type:"redoEnded",source:e,operationPerformed:i};this.eventService.dispatchEvent(s)}undoRedo(e,t,i,s,o){if(!e)return!1;const r=e.pop();return!r||!r.cellValueChanges?!1:(this.processAction(r,n=>n[s],o),r instanceof RangeUndoRedoAction?this.processRange(this.rangeService,r.ranges||[r[i]]):this.processCell(r.cellValueChanges),t.push(r),!0)}processAction(e,t,i){e.cellValueChanges.forEach(s=>{const{rowIndex:o,rowPinned:r,columnId:n}=s,l={rowIndex:o,rowPinned:r},a=this.rowPositionUtils.getRowNode(l);a.displayed&&a.setDataValue(n,t(s),i)})}processRange(e,t){let i;e.removeAllCellRanges(!0),t.forEach((s,o)=>{if(!s)return;const r=s.startRow,n=s.endRow;o===t.length-1&&(i={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(i));const l={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:n.rowIndex,rowEndPinned:n.rowPinned,columnStart:s.startColumn,columns:s.columns};e.addCellRange(l)})}processCell(e){const t=e[0],{rowIndex:i,rowPinned:s}=t,o={rowIndex:i,rowPinned:s},r=this.rowPositionUtils.getRowNode(o),n={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(n,this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:s,rowPinned:o}=e,r=this.gridBodyCtrl.getScrollFeature(),n=this.columnModel.getCol(s);if(!n)return;r.ensureIndexVisible(i),r.ensureColumnVisible(n);const l={rowIndex:i,column:n,rowPinned:o};this.focusService.setFocusedCell({...l,forceBrowserFocus:!0}),t?.setRangeToCell(l)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new UndoRedoAction(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const i=new UndoRedoAction(this.cellValueChanges);this.pushActionsToUndoStack(i)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new UndoRedoAction(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new RangeUndoRedoAction(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;this.rangeService&&this.gos.get("enableRangeSelection")?e=new RangeUndoRedoAction(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):e=new UndoRedoAction(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1}})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}};function getVerticalPixelRange(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition()}function getHorizontalPixelRange(e){return e.ctrlsService.getGridBodyCtrl().getScrollFeature().getHScrollPosition()}function ensureColumnVisible(e,t,i="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureColumnVisible(t,i),"ensureVisible")}function ensureIndexVisible(e,t,i){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureIndexVisible(t,i),"ensureVisible")}function ensureNodeVisible(e,t,i=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getGridBodyCtrl().getScrollFeature().ensureNodeVisible(t,i),"ensureVisible")}function undoCellEditing(e){e.undoRedoService?.undo("api")}function redoCellEditing(e){e.undoRedoService?.redo("api")}function getCellEditorInstances(e,t={}){return e.rowRenderer.getCellEditorInstances(t).map(_unwrapUserComp)}function getEditingCells(e){return e.rowRenderer.getEditingCells()}function stopEditing(e,t=!1){e.rowRenderer.stopEditing(t)}function startEditingCell(e,t){const i=e.columnModel.getCol(t.colKey);if(!i){_warnOnce(`no column found for ${t.colKey}`);return}const s={rowIndex:t.rowIndex,rowPinned:t.rowPinned||null,column:i};t.rowPinned==null&&ensureIndexVisible(e,t.rowIndex),ensureColumnVisible(e,t.colKey);const r=e.navigationService.getCellByPosition(s);r&&(e.focusService.isCellFocused(s)||e.focusService.setFocusedCell(s),r.startRowOrCellEdit(t.key))}function getCurrentUndoSize(e){return e.undoRedoService?.getCurrentUndoStackSize()??0}function getCurrentRedoSize(e){return e.undoRedoService?.getCurrentRedoStackSize()??0}var EditService=class extends BeanStub{constructor(){super(...arguments),this.beanName="editService"}wireBeans(e){this.navigationService=e.navigationService,this.userComponentFactory=e.userComponentFactory,this.valueService=e.valueService}startEditing(e,t=null,i=!1,s=null){const o=this.createCellEditorParams(e,t,i),r=e.getColumn().getColDef(),n=this.userComponentFactory.getCellEditorDetails(r,o),l=n?.popupFromSelector!=null?n.popupFromSelector:!!r.cellEditorPopup,a=n?.popupPositionFromSelector!=null?n.popupPositionFromSelector:r.cellEditorPopupPosition;e.setEditing(!0,n),e.getComp().setEditDetails(n,l,a,this.gos.get("reactiveCustomComponents"));const d=e.createEvent(s,"cellEditingStarted");this.eventService.dispatchEvent(d)}stopEditing(e,t){const i=e.getComp(),{newValue:s,newValueExists:o}=this.takeValueFromCellEditor(t,i),r=e.getRowNode(),n=e.getColumn(),l=r.getValueFromValueService(n);let a=!1;o&&(a=this.saveNewValue(e,l,s,r,n)),e.setEditing(!1,void 0),i.setEditDetails(),e.updateAndFormatValue(!1),e.refreshCell({forceRefresh:!0,suppressFlash:!0});const d={...e.createEvent(null,"cellEditingStopped"),oldValue:l,newValue:s,valueChanged:a};return this.eventService.dispatchEvent(d),a}handleColDefChanged(e){const t=e.getCellEditor();if(t?.refresh){const{eventKey:i,cellStartedEdit:s}=e.getEditCompDetails().params,o=this.createCellEditorParams(e,i,s),r=e.getColumn().getColDef(),n=this.userComponentFactory.getCellEditorDetails(r,o);t.refresh(n.params)}}setFocusOutOnEditor(e){const t=e.getComp().getCellEditor();t&&t.focusOut&&t.focusOut()}setFocusInOnEditor(e){const t=e.getComp().getCellEditor();t&&t.focusIn?t.focusIn():e.focusCell(!0)}stopEditingAndFocus(e,t=!1,i=!1){e.stopRowOrCellEdit(),e.focusCell(!0),t||this.navigateAfterEdit(i,e.getCellPosition())}createPopupEditorWrapper(e){return new PopupEditorWrapper(e)}takeValueFromCellEditor(e,t){const i={newValueExists:!1};if(e)return i;const s=t.getCellEditor();return!s||s.isCancelAfterEnd&&s.isCancelAfterEnd()?i:{newValue:s.getValue(),newValueExists:!0}}saveNewValue(e,t,i,s,o){if(i===t)return!1;e.setSuppressRefreshCell(!0);const r=s.setDataValue(o,i,"edit");return e.setSuppressRefreshCell(!1),r}createCellEditorParams(e,t,i){const s=e.getColumn(),o=e.getRowNode();return this.gos.addGridCommonParams({value:o.getValueFromValueService(s),eventKey:t,column:s,colDef:s.getColDef(),rowIndex:e.getCellPosition().rowIndex,node:o,data:o.data,cellStartedEdit:i,onKeyDown:e.onKeyDown.bind(e),stopEditing:e.stopEditingAndFocus.bind(e),eGridCell:e.getGui(),parseValue:r=>this.valueService.parseValue(s,o,r,e.getValue()),formatValue:e.formatValue.bind(e)})}navigateAfterEdit(e,t){if(this.gos.get("enterNavigatesVerticallyAfterEdit")){const s=e?KeyCode.UP:KeyCode.DOWN;this.navigationService.navigateToNextCell(null,s,t,!1)}}},RowEditService=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowEditService"}startEditing(e,t=null,i=null,s=null){e.getAllCellCtrls().reduce((r,n)=>{const l=n===i;return l?n.startEditing(t,l,s):n.startEditing(null,l,s),r?!0:n.isEditing()},!1)&&this.setEditing(e,!0)}stopEditing(e,t=!1){const i=e.getAllCellCtrls(),s=e.isEditing();e.setStoppingRowEdit(!0);let o=!1;for(const r of i){const n=r.stopEditing(t);s&&!t&&!o&&n&&(o=!0)}if(o){const r=e.createRowEvent("rowValueChanged");this.eventService.dispatchEvent(r)}s&&this.setEditing(e,!1),e.setStoppingRowEdit(!1)}setEditing(e,t){e.setEditingRow(t),e.forEachGui(void 0,s=>s.rowComp.addOrRemoveCssClass("ag-row-editing",t));const i=t?e.createRowEvent("rowEditingStarted"):e.createRowEvent("rowEditingStopped");this.eventService.dispatchEvent(i)}},EditCoreModule={version:VERSION,moduleName:"@ag-grid-community/edit-core",beans:[EditService]},EditApiModule={version:VERSION,moduleName:"@ag-grid-community/edit-api",apiFunctions:{undoCellEditing,redoCellEditing,getCellEditorInstances,getEditingCells,stopEditing,startEditingCell,getCurrentUndoSize,getCurrentRedoSize},dependantModules:[EditCoreModule]},UndoRedoEditModule={version:VERSION,moduleName:"@ag-grid-community/undo-redo-edit",beans:[UndoRedoService],dependantModules:[EditCoreModule]},FullRowEditModule={version:VERSION,moduleName:"@ag-grid-community/full-row-edit",beans:[RowEditService],dependantModules:[EditCoreModule]},DefaultEditorModule={version:VERSION,moduleName:"@ag-grid-community/default-editor",userComponents:[{name:"agCellEditor",classImp:TextCellEditor}],dependantModules:[EditCoreModule]},DataTypeEditorsModule={version:VERSION,moduleName:"@ag-grid-community/data-type-editors",userComponents:[{name:"agTextCellEditor",classImp:TextCellEditor},{name:"agNumberCellEditor",classImp:NumberCellEditor},{name:"agDateCellEditor",classImp:DateCellEditor},{name:"agDateStringCellEditor",classImp:DateStringCellEditor},{name:"agCheckboxCellEditor",classImp:CheckboxCellEditor}],dependantModules:[DefaultEditorModule]},SelectEditorModule={version:VERSION,moduleName:"@ag-grid-community/select-editor",userComponents:[{name:"agSelectCellEditor",classImp:SelectCellEditor}],dependantModules:[EditCoreModule]},LargeTextEditorModule={version:VERSION,moduleName:"@ag-grid-community/large-text-editor",userComponents:[{name:"agLargeTextCellEditor",classImp:LargeTextCellEditor}],dependantModules:[EditCoreModule]},AllCommunityEditorsModule={version:VERSION,moduleName:"@ag-grid-community/all-editors",dependantModules:[DefaultEditorModule,DataTypeEditorsModule,SelectEditorModule,LargeTextEditorModule]},EditModule={version:VERSION,moduleName:"@ag-grid-community/editing",dependantModules:[EditCoreModule,UndoRedoEditModule,FullRowEditModule,AllCommunityEditorsModule,EditApiModule]},AutoWidthCalculator=class extends BeanStub{constructor(){super(...arguments),this.beanName="autoWidthCalculator"}wireBeans(e){this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowContainerCtrl=e.center})}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const s=this.rowRenderer.getAllCellsForColumn(e);return t||s.push(i),this.addElementsToContainerAndGetWidth(s)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach(r=>this.cloneItemIntoDummy(r,t)),i.appendChild(t);const s=t.offsetWidth;i.removeChild(t);const o=this.getAutoSizePadding();return s+o}getAutoSizePadding(){return this.gos.get("autoSizePadding")}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach(i=>{const s=i.getHtmlElementForColumnHeader(e);s!=null&&(t=s)}),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const s=document.createElement("div"),o=s.classList;["ag-header-cell","ag-header-group-cell"].some(l=>i.classList.contains(l))?(o.add("ag-header","ag-header-row"),s.style.position="static"):o.add("ag-row");let n=e.parentElement;for(;n;){if(["ag-header-row","ag-row"].some(a=>n.classList.contains(a))){for(let a=0;a<n.classList.length;a++){const d=n.classList[a];d!="ag-row-position-absolute"&&o.add(d)}break}n=n.parentElement}s.appendChild(i),t.appendChild(s)}},StickyRowFeature=class extends BeanStub{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyTopRowCtrls=[],this.stickyBottomRowCtrls=[],this.topContainerHeight=0,this.bottomContainerHeight=0,this.extraTopHeight=0,this.extraBottomHeight=0}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.ctrlsService=e.ctrlsService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.isClientSide=this.rowModel.getType()==="clientSide",this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl})}getStickyTopRowCtrls(){return this.stickyTopRowCtrls}getStickyBottomRowCtrls(){return this.stickyBottomRowCtrls}setOffsetTop(e){if(this.extraTopHeight===e)return;this.extraTopHeight=e;const t={type:"stickyTopOffsetChanged",offset:e};this.eventService.dispatchEvent(t)}setOffsetBottom(e){this.extraBottomHeight!==e&&(this.extraBottomHeight=e)}resetOffsets(){this.setOffsetBottom(0),this.setOffsetTop(0)}getExtraTopHeight(){return this.extraTopHeight}getExtraBottomHeight(){return this.extraBottomHeight}getLastPixelOfGroup(e){return this.isClientSide?this.getClientSideLastPixelOfGroup(e):this.getServerSideLastPixelOfGroup(e)}getFirstPixelOfGroup(e){return e.footer?e.sibling.rowTop+e.sibling.rowHeight-1:e.hasChildren()?e.rowTop-1:0}getServerSideLastPixelOfGroup(e){if(this.isClientSide)throw new Error("This func should only be called in server side row model.");if(e.isExpandable()||e.footer){if(e.master)return e.detailNode.rowTop+e.detailNode.rowHeight;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let i=e.childStore?.getStoreBounds();return e.footer&&(i=e.sibling.childStore?.getStoreBounds()),(i?.heightPx??0)+(i?.topPx??0)}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}getClientSideLastPixelOfGroup(e){if(!this.isClientSide)throw new Error("This func should only be called in client side row model.");if(e.isExpandable()||e.footer){if(e.footer&&e.rowIndex===0)return Number.MAX_SAFE_INTEGER;if(!e.sibling||Math.abs(e.sibling.rowIndex-e.rowIndex)===1){let s=e.footer?e.sibling:e;for(;s.isExpandable()&&s.expanded;)if(s.master)s=s.detailNode;else if(s.childrenAfterSort){if(s.childrenAfterSort.length===0)break;s=_last(s.childrenAfterSort)}return s.rowTop+s.rowHeight}return e.footer?e.rowTop+e.rowHeight:e.sibling.rowTop+e.sibling.rowHeight}return Number.MAX_SAFE_INTEGER}updateStickyRows(e){const t=e==="top";let i=0;if(!this.canRowsBeSticky())return this.refreshNodesAndContainerHeight(e,new Set,i);const s=t?this.rowRenderer.getFirstVisibleVerticalPixel()-this.extraTopHeight:this.rowRenderer.getLastVisibleVerticalPixel()-this.extraTopHeight,o=new Set,r=d=>{if(o.add(d),t){const h=this.getLastPixelOfGroup(d),c=s+i+d.rowHeight;h<c?d.stickyRowTop=i+(h-c):d.stickyRowTop=i}else{const h=this.getFirstPixelOfGroup(d),c=s-(i+d.rowHeight);h>c?d.stickyRowTop=i-(h-c):d.stickyRowTop=i}i=0,o.forEach(h=>{const c=h.stickyRowTop+h.rowHeight;i<c&&(i=c)})},n=this.areFooterRowsStickySuppressed(),l=this.gos.get("suppressGroupRowsSticky"),a=d=>d.displayed?d.footer?n===!0||n==="grand"&&d.level===-1||n==="group"&&d.level>-1?!1:!o.has(d):d.isExpandable()?l===!0?!1:!o.has(d)&&d.expanded:!1:!1;for(let d=0;d<100;d++){let h=s+i;t||(h=s-i);const c=this.rowModel.getRowIndexAtPixel(h),u=this.rowModel.getRow(c);if(u==null)break;const p=this.getStickyAncestors(u).find(m=>(t?m.rowIndex<c:m.rowIndex>c)&&a(m));if(p){r(p);continue}if((t?u.rowTop<h:u.rowTop+u.rowHeight>h)&&a(u)){r(u);continue}break}return t||o.forEach(d=>{d.stickyRowTop=i-(d.stickyRowTop+d.rowHeight)}),this.refreshNodesAndContainerHeight(e,o,i)}areFooterRowsStickySuppressed(){const e=this.gos.get("suppressStickyTotalRow");if(e===!0)return!0;const t=!!this.gos.get("groupIncludeFooter")||e==="group",i=!!this.gos.get("groupIncludeTotalFooter")||e==="grand";return t&&i?!0:i?"grand":t?"group":!1}canRowsBeSticky(){const e=this.gos.isGroupRowsSticky(),t=this.areFooterRowsStickySuppressed(),i=this.gos.get("suppressGroupRowsSticky");return e&&(!t||!i)}getStickyAncestors(e){const t=[];let i=e.footer?e.sibling:e.parent;for(;i;)i.sibling&&t.push(i.sibling),t.push(i),i=i.parent;return t.reverse()}checkStickyRows(){const e=this.updateStickyRows("top"),t=this.updateStickyRows("bottom");return e||t}destroyStickyCtrls(){this.refreshNodesAndContainerHeight("top",new Set,0),this.refreshNodesAndContainerHeight("bottom",new Set,0)}refreshStickyNode(e){const t=new Set;if(this.stickyTopRowCtrls.some(i=>i.getRowNode()===e)){for(let i=0;i<this.stickyTopRowCtrls.length;i++){const s=this.stickyTopRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("top",t,this.topContainerHeight)&&this.checkStickyRows();return}for(let i=0;i<this.stickyBottomRowCtrls.length;i++){const s=this.stickyBottomRowCtrls[i].getRowNode();s!==e&&t.add(s)}this.refreshNodesAndContainerHeight("bottom",t,this.bottomContainerHeight)&&this.checkStickyRows()}refreshNodesAndContainerHeight(e,t,i){const s=e==="top",o=s?this.stickyTopRowCtrls:this.stickyBottomRowCtrls,r={},n=[];for(let u=0;u<o.length;u++){const g=o[u].getRowNode();if(!t.has(g)){r[g.id]=o[u],g.sticky=!1;continue}n.push(o[u])}const l=new Set;for(let u=0;u<n.length;u++)l.add(n[u].getRowNode());const a=[];t.forEach(u=>{l.has(u)||(u.sticky=!0,a.push(this.createRowCon(u,!1,!1)))});let d=!!a.length||n.length!==o.length;s?this.topContainerHeight!==i&&(this.topContainerHeight=i,this.gridBodyCtrl.setStickyTopHeight(i),d=!0):this.bottomContainerHeight!==i&&(this.bottomContainerHeight=i,this.gridBodyCtrl.setStickyBottomHeight(i),d=!0),this.destroyRowCtrls(r,!1);const h=[...n,...a];h.sort((u,g)=>g.getRowNode().rowIndex-u.getRowNode().rowIndex),s||h.reverse(),h.forEach(u=>u.setRowTop(u.getRowNode().stickyRowTop));let c=0;return s?(t.forEach(u=>{u.rowIndex<this.pageBoundsService.getFirstRow()&&(c+=u.rowHeight)}),c>this.topContainerHeight&&(c=this.topContainerHeight),this.setOffsetTop(c)):(t.forEach(u=>{u.rowIndex>this.pageBoundsService.getLastRow()&&(c+=u.rowHeight)}),c>this.bottomContainerHeight&&(c=this.bottomContainerHeight),this.setOffsetBottom(c)),d?(s?this.stickyTopRowCtrls=h:this.stickyBottomRowCtrls=h,!0):!1}ensureRowHeightsValid(){let e=!1;const t=i=>{const s=i.getRowNode();if(s.rowHeightEstimated){const o=this.gos.getRowHeightForNode(s);s.setRowHeight(o.height),e=!0}};return this.stickyTopRowCtrls.forEach(t),this.stickyBottomRowCtrls.forEach(t),e}},RowRenderer=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowRenderer",this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1,this.setupRangeSelectionListeners=()=>{const e=()=>{this.getAllCellCtrls().forEach(r=>r.onRangeSelectionChanged())},t=()=>{this.getAllCellCtrls().forEach(r=>r.updateRangeBordersIfRangeCount())},i=()=>{this.eventService.addEventListener("rangeSelectionChanged",e),this.eventService.addEventListener("columnMoved",t),this.eventService.addEventListener("columnPinned",t),this.eventService.addEventListener("columnVisible",t)},s=()=>{this.eventService.removeEventListener("rangeSelectionChanged",e),this.eventService.removeEventListener("columnMoved",t),this.eventService.removeEventListener("columnPinned",t),this.eventService.removeEventListener("columnVisible",t)};this.addDestroyFunc(()=>s()),this.addManagedPropertyListener("enableRangeSelection",r=>{r.currentValue?i():s()}),this.gos.get("enableRangeSelection")&&i()}}wireBeans(e){this.animationFrameService=e.animationFrameService,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.pinnedRowModel=e.pinnedRowModel,this.rowModel=e.rowModel,this.focusService=e.focusService,this.beans=e,this.rowContainerHeightService=e.rowContainerHeightService,this.ctrlsService=e.ctrlsService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl,this.initialise()})}initialise(){if(this.addManagedEventListeners({paginationChanged:this.onPageLoaded.bind(this),pinnedRowDataChanged:this.onPinnedRowDataChanged.bind(this),displayedColumnsChanged:this.onDisplayedColumnsChanged.bind(this),bodyScroll:this.onBodyScroll.bind(this),bodyHeightChanged:this.redraw.bind(this)}),this.addManagedPropertyListeners(["domLayout","embedFullWidthRows"],()=>this.onDomLayoutChanged()),this.addManagedPropertyListeners(["suppressMaxRenderedRowRestriction","rowBuffer"],()=>this.redraw()),this.addManagedPropertyListeners(["suppressCellFocus","getBusinessKeyForNode","fullWidthCellRenderer","fullWidthCellRendererParams","rowStyle","getRowStyle","rowClass","getRowClass","rowClassRules","suppressStickyTotalRow","groupRowRenderer","groupRowRendererParams","loadingCellRenderer","loadingCellRendererParams","detailCellRenderer","detailCellRendererParams","enableRangeSelection","enableCellTextSelection"],()=>this.redrawRows()),this.gos.isGroupRowsSticky()){const e=this.rowModel.getType();(e==="clientSide"||e==="serverSide")&&(this.stickyRowFeature=this.createManagedBean(new StickyRowFeature(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this))))}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=this.gos.isDomLayout("print"),this.embedFullWidthRows=this.printLayout||this.gos.get("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gos.get("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=e??3;this.cachedRowCtrls=new RowCtrlCache(t)}}getKeepDetailRowsCount(){return this.gos.get("keepDetailRowsCount")}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyTopRowCtrls():[]}getStickyBottomRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyBottomRowCtrls():[]}updateAllRowCtrls(){const e=_getAllValuesInObject(this.rowCtrlsByRowIndex),t=_getAllValuesInObject(this.zombieRowCtrls),i=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];t.length>0||i.length>0?this.allRowCtrls=[...e,...t,...i]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onCellFocused(e)),this.getFullWidthRowCtrls().forEach(t=>t.onFullWidthRowFocused(e))}registerCellEventListeners(){this.addManagedEventListeners({cellFocused:e=>{this.onCellFocusChanged(e)},cellFocusCleared:()=>this.onCellFocusChanged(),flashCells:e=>{this.getAllCellCtrls().forEach(t=>t.onFlashCells(e))},columnHoverChanged:()=>{this.getAllCellCtrls().forEach(e=>e.onColumnHover())},displayedColumnsChanged:()=>{this.getAllCellCtrls().forEach(e=>e.onDisplayedColumnsChanged())},displayedColumnsWidthChanged:()=>{this.printLayout&&this.getAllCellCtrls().forEach(e=>e.onLeftChanged())}}),this.setupRangeSelectionListeners(),this.refreshListenersToColumnsForCellComps(),this.addManagedEventListeners({gridColumnsChanged:this.refreshListenersToColumnsForCellComps.bind(this)}),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(e=>e()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners(),this.columnModel.getCols().forEach(t=>{const i=a=>{this.getAllCellCtrls().forEach(d=>{d.getColumn()===t&&a(d)})},s=()=>{i(a=>a.onLeftChanged())},o=()=>{i(a=>a.onWidthChanged())},r=()=>{i(a=>a.onFirstRightPinnedChanged())},n=()=>{i(a=>a.onLastLeftPinnedChanged())},l=()=>{i(a=>a.onColDefChanged())};t.addEventListener("leftChanged",s),t.addEventListener("widthChanged",o),t.addEventListener("firstRightPinnedChanged",r),t.addEventListener("lastLeftPinnedChanged",n),t.addEventListener("colDefChanged",l),this.destroyFuncsForColumnListeners.push(()=>{t.removeEventListener("leftChanged",s),t.removeEventListener("widthChanged",o),t.removeEventListener("firstRightPinnedChanged",r),t.removeEventListener("lastLeftPinnedChanged",n),t.removeEventListener("colDefChanged",l)})})}onDomLayoutChanged(){const e=this.gos.isDomLayout("print"),t=e||this.gos.get("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach(i=>{const s=i.getCellElement(e);s&&t.push(s)}),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowNodes()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowNodes())}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){const i=Object.fromEntries(t.map(o=>[o.id,o])),s=Object.fromEntries(e.map(o=>[o.getRowNode().id,o]));for(let o=0;o<t.length;o++){const r=t[o],n=e[o];n&&i[n.getRowNode().id]===void 0&&(n.destroyFirstPass(),n.destroySecondPass()),r.id in s?(e[o]=s[r.id],delete s[r.id]):e[o]=new RowCtrl(r,this.beans,!1,!1,this.printLayout)}e.length=t.length}onPinnedRowDataChanged(){const e={recycleRows:!0};this.redrawAfterModelUpdate(e)}redrawRow(e,t=!1){if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else if(this.cachedRowCtrls?.has(e)){this.cachedRowCtrls.removeRow(e);return}else{const i=s=>{const o=s[e.rowIndex];o&&o.getRowNode()===e&&(o.destroyFirstPass(),o.destroySecondPass(),s[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":i(this.topRowCtrls);break;case"bottom":i(this.bottomRowCtrls);break;default:i(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(e!=null){e?.forEach(i=>this.redrawRow(i,!0)),this.dispatchDisplayedRowsChanged(!1);return}this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=e?.suppressKeepFocus?null:this.focusService.getFocusCellToUseAfterRefresh();if(t==null)return null;const i=this.gos.getActiveDomElement(),s=this.gos.getDomData(i,CellCtrl.DOM_DATA_KEY_CELL_CTRL),o=this.gos.getDomData(i,RowCtrl.DOM_DATA_KEY_ROW_CTRL);return s||o?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&this.gos.isAnimateRows(),o=i?this.getRowsToRecycle():null;if(i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature){this.stickyRowFeature.checkStickyRows();const r=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();r&&this.updateContainerHeights(r)}this.recycleRows(o,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),t!=null&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,i=this.gos.get("suppressScrollOnNewData");t&&!i&&(this.gridBodyCtrl.getScrollFeature().scrollToTop(),this.stickyRowFeature?.resetOffsets())}updateContainerHeights(e=0){if(this.printLayout){this.rowContainerHeightService.setModelHeight(null);return}let t=this.pageBoundsService.getCurrentPageHeight();t===0&&(t=1),this.rowContainerHeightService.setModelHeight(t+e)}getLockOnRefresh(){if(this.refreshInProgress){const e=this.frameworkOverrides.getLockOnRefreshError?.()??"";throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace."+e)}this.refreshInProgress=!0,this.frameworkOverrides.getLockOnRefresh?.()}releaseLockOnRefresh(){this.refreshInProgress=!1,this.frameworkOverrides.releaseLockOnRefresh?.()}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&setTimeout(()=>{this.focusService.setRestoreFocusedCell(e),this.onCellFocusChanged(this.gos.addGridCommonParams({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,type:"cellFocused"}))})}stopEditing(e=!1){this.getAllRowCtrls().forEach(t=>{t.stopEditing(e)})}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let s=0;s<i;s++){const o=t[s].getAllCellCtrls(),r=o.length;for(let n=0;n<r;n++)e.push(o[n])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyTopRowCtrls()||[],t=this.stickyRowFeature&&this.stickyRowFeature.getStickyBottomRowCtrls()||[],i=[...this.topRowCtrls,...this.bottomRowCtrls,...e,...t];for(const s in this.rowCtrlsByRowIndex)i.push(this.rowCtrlsByRowIndex[s]);return i}addRenderedRowListener(e,t,i){const s=this.rowCtrlsByRowIndex[t];s&&s.addEventListener(e,i)}flashCells(e={}){this.getCellCtrls(e.rowNodes,e.columns).forEach(t=>t.flashCell(e))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};for(const i of this.getCellCtrls(e.rowNodes,e.columns))i.refreshOrDestroyCell(t);this.refreshFullWidth(e.rowNodes)}refreshFullWidth(e){if(!e)return;let t=null;this.stickyRowFeature&&_browserSupportsPreventScroll()&&(t=this.getCellToRestoreFocusToAfterRefresh()||null);for(const i of this.getRowCtrls(e)){if(!i.isFullWidth())continue;i.refreshFullWidth()||this.redrawRow(i.getRowNode(),!0)}this.dispatchDisplayedRowsChanged(!1),t&&this.restoreFocusedCell(t)}getCellRendererInstances(e){const t=this.getCellCtrls(e.rowNodes,e.columns).map(o=>o.getCellRenderer()).filter(o=>o!=null);if(e.columns?.length)return t;const i=[],s=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach(o=>{if(s&&!this.isRowInMap(o.getRowNode(),s)||!o.isFullWidth())return;const r=o.getFullWidthCellRenderers();for(let n=0;n<r.length;n++){const l=r[n];l!=null&&i.push(l)}}),[...i,...t]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach(i=>{const s=i.getCellEditor();s&&t.push(s)}),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach(t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}}),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach(i=>{const s=i.id;switch(i.rowPinned){case"top":t.top[s]=i;break;case"bottom":t.bottom[s]=i;break;default:t.normal[s]=i;break}}),t}isRowInMap(e,t){const i=e.id;switch(e.rowPinned){case"top":return t.top[i]!=null;case"bottom":return t.bottom[i]!=null;default:return t.normal[i]!=null}}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return!e||!t?i:i.filter(s=>{const o=s.getRowNode();return this.isRowInMap(o,t)})}getCellCtrls(e,t){let i;_exists(t)&&(i={},t.forEach(o=>{const r=this.columnModel.getCol(o);_exists(r)&&(i[r.getId()]=!0)}));const s=[];return this.getRowCtrls(e).forEach(o=>{o.getAllCellCtrls().forEach(r=>{const n=r.getColumn().getId();i&&!i[n]||s.push(r)})}),s}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e),this.stickyRowFeature&&this.stickyRowFeature.destroyStickyCtrls()}getRowsToRecycle(){const e=[];_iterateObject(this.rowCtrlsByRowIndex,(i,s)=>{s.getRowNode().id==null&&e.push(i)}),this.removeRowCtrls(e);const t={};return _iterateObject(this.rowCtrlsByRowIndex,(i,s)=>{const o=s.getRowNode();t[o.id]=s}),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e,t=!1){e.forEach(i=>{const s=this.rowCtrlsByRowIndex[i];s&&(s.destroyFirstPass(t),s.destroySecondPass()),delete this.rowCtrlsByRowIndex[i]})}onBodyScroll(e){e.direction==="vertical"&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&_browserSupportsPreventScroll()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const s=this.firstRenderedRow,o=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let r=!1;if(this.stickyRowFeature){r=this.stickyRowFeature.checkStickyRows();const l=this.stickyRowFeature.getExtraTopHeight()+this.stickyRowFeature.getExtraBottomHeight();l&&this.updateContainerHeights(l)}const n=this.firstRenderedRow!==s||this.lastRenderedRow!==o;if(!(t&&!r&&!n)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t&&!r),i!=null)){const l=this.getCellToRestoreFocusToAfterRefresh();i!=null&&l==null&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e,t){const i={};e.forEach(r=>i[r]=!0);const o=Object.keys(this.rowCtrlsByRowIndex).filter(r=>!i[r]);this.removeRowCtrls(o,t)}calculateIndexesToDraw(e){const t=_createArrayOfNumbers(this.firstRenderedRow,this.lastRenderedRow),i=(o,r)=>{const n=r.getRowNode().rowIndex;n!=null&&(n<this.firstRenderedRow||n>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(r)&&t.push(n)};_iterateObject(this.rowCtrlsByRowIndex,i),_iterateObject(e,i),t.sort((o,r)=>o-r);const s=[];for(let o=0;o<t.length;o++){const r=t[o],n=this.rowModel.getRow(r);n&&!n.sticky&&s.push(r)}return s}recycleRows(e,t=!1,i=!1){const s=this.calculateIndexesToDraw(e);(this.printLayout||i)&&(t=!1),this.removeRowCompsNotToDraw(s,!t);const o=[];s.forEach(r=>{const n=this.createOrUpdateRowCtrl(r,e,t,i);_exists(n)&&o.push(n)}),e&&(i&&!this.gos.get("suppressAnimationFrame")&&!this.printLayout?this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}):this.destroyRowCtrls(e,t)),this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){const t={type:"displayedRowsChanged",afterScroll:e};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){const e=this.visibleColsService.isPinningLeft(),t=this.visibleColsService.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach(t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter(i=>{if(!i.isFullWidth())return!1;const s=i.getRowNode();return!(t!=null&&!this.isRowInMap(s,t))})}createOrUpdateRowCtrl(e,t,i,s){let o,r=this.rowCtrlsByRowIndex[e];if(r||(o=this.rowModel.getRow(e),_exists(o)&&_exists(t)&&t[o.id]&&o.alreadyRendered&&(r=t[o.id],t[o.id]=null)),!r)if(o||(o=this.rowModel.getRow(e)),_exists(o))r=this.createRowCon(o,i,s);else return;return o&&(o.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=r,r}destroyRowCtrls(e,t){const i=[];_iterateObject(e,(s,o)=>{if(o){if(this.cachedRowCtrls&&o.isCacheable()){this.cachedRowCtrls.addRow(o);return}o.destroyFirstPass(!t),t?(this.zombieRowCtrls[o.getInstanceId()]=o,i.push(()=>{o.destroySecondPass(),delete this.zombieRowCtrls[o.getInstanceId()]})):o.destroySecondPass()}}),t&&(i.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),_executeInAWhile(i))}getRowBuffer(){return this.gos.get("rowBuffer")}getRowBufferInPixels(){const e=this.getRowBuffer(),t=this.gos.getRowHeightAsNumber();return e*t}workOutFirstAndLastRowsToRender(){this.rowContainerHeightService.updateOffset();let e,t;if(!this.rowModel.isRowsToRender())e=0,t=-1;else if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.pageBoundsService.getFirstRow(),t=this.pageBoundsService.getLastRow();else{const l=this.getRowBufferInPixels(),a=this.ctrlsService.getGridBodyCtrl(),d=this.gos.get("suppressRowVirtualisation");let h=!1,c,u;do{const C=this.pageBoundsService.getPixelOffset(),{pageFirstPixel:v,pageLastPixel:w}=this.pageBoundsService.getCurrentPagePixelRange(),y=this.rowContainerHeightService.getDivStretchOffset(),F=a.getScrollFeature().getVScrollPosition(),S=F.top,R=F.bottom;d?(c=v+y,u=w+y):(c=Math.max(S+C-l,v)+y,u=Math.min(R+C+l,w)+y),this.firstVisibleVPixel=Math.max(S+C,v)+y,this.lastVisibleVPixel=Math.min(R+C,w)+y,h=this.ensureAllRowsInRangeHaveHeightsCalculated(c,u)}while(h);let g=this.rowModel.getRowIndexAtPixel(c),p=this.rowModel.getRowIndexAtPixel(u);const f=this.pageBoundsService.getFirstRow(),m=this.pageBoundsService.getLastRow();g<f&&(g=f),p>m&&(p=m),e=g,t=p}const i=this.gos.isDomLayout("normal"),s=this.gos.get("suppressMaxRenderedRowRestriction"),o=Math.max(this.getRowBuffer(),500);i&&!s&&t-e>o&&(t=e+o);const r=e!==this.firstRenderedRow,n=t!==this.lastRenderedRow;if(r||n){this.firstRenderedRow=e,this.lastRenderedRow=t;const l={type:"viewportChanged",firstRow:e,lastRow:t};this.eventService.dispatchEvent(l)}}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const e={type:"firstDataRendered",firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent(e)})}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const i=this.pinnedRowModel?.ensureRowHeightsValid(),s=this.stickyRowFeature?.ensureRowHeightsValid(),o=this.rowModel.ensureRowHeightsValid(e,t,this.pageBoundsService.getFirstRow(),this.pageBoundsService.getLastRow());return(o||s)&&this.eventService.dispatchEvent({type:"recalculateRowBounds"}),s||o||i?(this.updateContainerHeights(),!0):!1}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getLastVisibleVerticalPixel(){return this.lastVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const s=e.getRowNode(),o=this.focusService.isRowNodeFocused(s),r=e.isEditing(),n=s.detail;return o||r||n?!!this.isRowPresent(s):!1}isRowPresent(e){return this.rowModel.isRowPresent(e)?this.paginationService?this.paginationService.isRowPresent(e):!0:!1}createRowCon(e,t,i){const s=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(s)return s;const o=this.gos.get("suppressAnimationFrame"),r=i&&!o&&!this.printLayout;return new RowCtrl(e,this.beans,t,r,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.values(e).map(t=>t.getRowNode())}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find(s=>s.getRowNode().rowIndex===i)||null,t||(t=this.getStickyBottomRowCtrls().find(s=>s.getRowNode().rowIndex===i)||null));break}return t}isRangeInRenderedViewport(e,t){if(e==null||t==null)return!1;const s=e>this.lastRenderedRow;return!(t<this.firstRenderedRow)&&!s}},RowCtrlCache=class{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const t=this.entriesList[0];t.destroyFirstPass(),t.destroySecondPass(),this.removeFromCache(t)}}getRow(e){if(e==null||e.id==null)return null;const t=this.entriesMap[e.id];return t?(this.removeFromCache(t),t.setCached(!1),t.getRowNode()!=e?null:t):null}has(e){return this.entriesMap[e.id]!=null}removeRow(e){const t=e.id,i=this.entriesMap[t];delete this.entriesMap[t],_removeFromArray(this.entriesList,i)}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],_removeFromArray(this.entriesList,e)}getEntries(){return this.entriesList}},PinnedRowModel=class extends BeanStub{constructor(){super(...arguments),this.beanName="pinnedRowModel",this.nextId=0}wireBeans(e){this.beans=e}postConstruct(){this.setPinnedTopRowData(),this.setPinnedBottomRowData(),this.addManagedPropertyListener("pinnedTopRowData",()=>this.setPinnedTopRowData()),this.addManagedPropertyListener("pinnedBottomRowData",()=>this.setPinnedBottomRowData()),this.addManagedEventListeners({gridStylesChanged:this.onGridStylesChanges.bind(this)})}isEmpty(e){const t=e==="top"?this.pinnedTopRows:this.pinnedBottomRows;return _missingOrEmpty(t)}isRowsToRender(e){return!this.isEmpty(e)}getRowAtPixel(e,t){const i=t==="top"?this.pinnedTopRows:this.pinnedBottomRows;if(_missingOrEmpty(i))return 0;for(let s=0;s<i.length;s++){const o=i[s];if(o.rowTop+o.rowHeight-1>=e)return s}return i.length-1}onGridStylesChanges(e){if(e.rowHeightChanged){const t=i=>{i.setRowHeight(i.rowHeight,!0)};this.pinnedBottomRows.forEach(t),this.pinnedTopRows.forEach(t)}}ensureRowHeightsValid(){let e=!1,t=0;const i=o=>{if(o.rowHeightEstimated){const r=this.gos.getRowHeightForNode(o);o.setRowTop(t),o.setRowHeight(r.height),t+=r.height,e=!0}};this.pinnedBottomRows?.forEach(i),t=0,this.pinnedTopRows?.forEach(i);const s={type:"pinnedHeightChanged"};return this.eventService.dispatchEvent(s),e}setPinnedTopRowData(){const e=this.gos.get("pinnedTopRowData");this.pinnedTopRows=this.createNodesFromData(e,!0);const t={type:"pinnedRowDataChanged"};this.eventService.dispatchEvent(t)}setPinnedBottomRowData(){const e=this.gos.get("pinnedBottomRowData");this.pinnedBottomRows=this.createNodesFromData(e,!1);const t={type:"pinnedRowDataChanged"};this.eventService.dispatchEvent(t)}createNodesFromData(e,t){const i=[];if(e){const s=this.gos.getRowIdCallback(),o=t?RowNode.ID_PREFIX_TOP_PINNED:RowNode.ID_PREFIX_BOTTOM_PINNED;let r=0;const n=t?"top":"bottom";e.forEach((l,a)=>{const d=new RowNode(this.beans);d.data=l,d.id=s?.({data:l,level:0,rowPinned:n})??o+this.nextId++,d.rowPinned=n,d.setRowTop(r),d.setRowHeight(this.gos.getRowHeightForNode(d).height),d.setRowIndex(a),r+=d.rowHeight,i.push(d)})}return i}getPinnedTopRowNodes(){return this.pinnedTopRows}getPinnedBottomRowNodes(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(e){return this.pinnedTopRows[e]}getPinnedBottomRow(e){return this.pinnedBottomRows[e]}forEachPinnedTopRow(e){_missingOrEmpty(this.pinnedTopRows)||this.pinnedTopRows.forEach(e)}forEachPinnedBottomRow(e){_missingOrEmpty(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(e)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(e){if(!e||e.length===0)return 0;const t=_last(e);return t.rowTop+t.rowHeight}},ServerSideTransactionResultStatus=(e=>(e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled",e.StoreNotStarted="StoreNotStarted",e))(ServerSideTransactionResultStatus||{}),RowNodeBlock=class extends BeanStub{constructor(e){super(),this.state="needsLoading",this.version=0,this.id=e}getId(){return this.id}load(){this.state="loading",this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}getState(){return this.state}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed",this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,i){this.successCommon(e,{rowData:t,rowCount:i})}isRequestMostRecentAndLive(e){const t=e===this.version,i=this.isAlive();return t&&i}successCommon(e,t){this.dispatchLoadCompleted(),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}dispatchLoadCompleted(e=!0){const t={type:"loadComplete",success:e,block:this};this.dispatchLocalEvent(t)}},RowNodeBlockLoader=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=_debounce(this.performCheckBlocksToLoad.bind(this),e))}getMaxConcurrentDatasourceRequests(){const e=this.gos.get("maxConcurrentDatasourceRequests");if(e==null)return 2;if(!(e<=0))return e}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){_removeFromArray(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchLocalEvent({type:"blockLoaded"}),this.activeBlockLoadsCount==0&&this.dispatchLocalEvent({type:"blockLoaderFinished"})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){this.gos.get("debug")&&_log("RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.getAvailableLoadingCount(),t=this.blocks.filter(i=>i.getState()==="needsLoading").slice(0,e);this.registerLoads(t.length),t.forEach(i=>i.load()),this.printCacheStatus()}getBlockState(){if(this.gos.isRowModelType("serverSide"))return this.rowModel.getBlockStates();const e={};return this.blocks.forEach(t=>{const{id:i,state:s}=t.getBlockStateJson();e[i]=s}),e}printCacheStatus(){this.gos.get("debug")&&_log(`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return this.maxConcurrentRequests!==void 0?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}},RowNodeBlockModule={version:VERSION,moduleName:"@ag-grid-community/row-node-block",beans:[RowNodeBlockLoader]},RowRangeSelectionContext=class{constructor(){this.root=null,this.end=null,this.cachedRange=[]}init(e){this.rowModel=e}reset(){this.root=null,this.end=null,this.cachedRange.length=0}setRoot(e){this.root=e,this.end=null,this.cachedRange.length=0}setEndRange(e){this.end=e,this.cachedRange.length=0}getRange(){if(this.cachedRange.length===0){const e=this.getRoot(),t=this.getEnd();if(e==null||t==null)return this.cachedRange;this.cachedRange=this.rowModel.getNodesInRangeForSelection(e,t)}return this.cachedRange}isInRange(e){return this.root===null?!1:this.getRange().some(t=>t.id===e.id)}getRoot(){return this.root&&this.root?.key===null&&(this.root=this.rowModel.getRowNode(this.root.id)??null),this.root}getEnd(){return this.end&&this.end?.key===null&&(this.end=this.rowModel.getRowNode(this.end.id)??null),this.end}truncate(e){const t=this.getRange();if(t.length===0)return{keep:[],discard:[]};const i=t[0].id===this.root.id,s=t.findIndex(o=>o.id===e.id);if(s>-1){const o=t.slice(0,s),r=t.slice(s+1);return this.setEndRange(e),i?{keep:o,discard:r}:{keep:r,discard:o}}else return{keep:t,discard:[]}}extend(e,t=!1){const i=this.getRoot();if(i==null){const o=this.getRange().slice();return t&&e.depthFirstSearch(r=>!r.group&&o.push(r)),o.push(e),this.setRoot(e),{keep:o,discard:[]}}if(this.rowModel.getNodesInRangeForSelection(i,e).find(o=>o.id===this.end?.id))return this.setEndRange(e),{keep:this.getRange(),discard:[]};{const o=this.getRange().slice();return this.setEndRange(e),{keep:this.getRange(),discard:o}}}},StylingService=class extends BeanStub{constructor(){super(...arguments),this.beanName="stylingService"}wireBeans(e){this.expressionService=e.expressionService}processAllCellClasses(e,t,i,s){this.processClassRules(void 0,e.cellClassRules,t,i,s),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,s,o){if(t==null&&e==null)return;const r={},n={},l=(a,d)=>{a.split(" ").forEach(h=>{h.trim()!=""&&d(h)})};if(t){const a=Object.keys(t);for(let d=0;d<a.length;d++){const h=a[d],c=t[h];let u;typeof c=="string"?u=this.expressionService.evaluate(c,i):typeof c=="function"&&(u=c(i)),l(h,g=>{u?r[g]=!0:n[g]=!0})}}e&&o&&Object.keys(e).forEach(a=>l(a,d=>{r[d]||(n[d]=!0)})),o&&Object.keys(n).forEach(o),Object.keys(r).forEach(s)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let s;return typeof i=="function"?s=i(t):s=i,typeof s=="string"&&(s=[s]),s||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach(o=>{i(o)})}},AgToggleButton=class extends AgCheckbox{constructor(e){super(e,"ag-toggle-button")}setValue(e,t){return super.setValue(e,t),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}},AgToggleButtonSelector={selector:"AG-TOGGLE-BUTTON",component:AgToggleButton},TabGuardClassNames=(e=>(e.TAB_GUARD="ag-tab-guard",e.TAB_GUARD_TOP="ag-tab-guard-top",e.TAB_GUARD_BOTTOM="ag-tab-guard-bottom",e))(TabGuardClassNames||{}),TabGuardCtrl=class extends BeanStub{constructor(e){super(),this.skipTabGuardFocus=!1,this.forcingFocusOut=!1,this.allowFocus=!1;const{comp:t,eTopGuard:i,eBottomGuard:s,focusTrapActive:o,forceFocusOutWhenTabGuardsAreEmpty:r,isFocusableContainer:n,focusInnerElement:l,onFocusIn:a,onFocusOut:d,shouldStopEventPropagation:h,onTabKeyDown:c,handleKeyDown:u,eFocusableElement:g}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=s,this.providedFocusInnerElement=l,this.eFocusableElement=g,this.focusTrapActive=!!o,this.forceFocusOutWhenTabGuardsAreEmpty=!!r,this.isFocusableContainer=!!n,this.providedFocusIn=a,this.providedFocusOut=d,this.providedShouldStopEventPropagation=h,this.providedOnTabKeyDown=c,this.providedHandleKeyDown=u}wireBeans(e){this.focusService=e.focusService}postConstruct(){this.createManagedBean(new ManagedFocusFeature(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach(e=>this.addManagedElementListeners(e,{focus:this.onFocus.bind(this)}))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return this.providedShouldStopEventPropagation?this.providedShouldStopEventPropagation():!1}activateTabGuards(){if(this.forcingFocusOut)return;const e=this.gos.get("tabIndex");this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.isFocusableContainer&&!this.eFocusableElement.contains(e.relatedTarget)&&!this.allowFocus){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.skipTabGuardFocus){this.skipTabGuardFocus=!1;return}if(this.forceFocusOutWhenTabGuardsAreEmpty&&this.focusService.findFocusableElements(this.eFocusableElement,".ag-tab-guard").length===0){this.findNextElementOutsideAndFocus(e.target===this.eBottomGuard);return}if(this.isFocusableContainer&&this.eFocusableElement.contains(e.relatedTarget))return;const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}findNextElementOutsideAndFocus(e){const t=this.gos.getDocument(),i=this.focusService.findFocusableElements(t.body,null,!0),s=i.indexOf(e?this.eTopGuard:this.eBottomGuard);if(s===-1)return;let o,r;e?(o=0,r=s):(o=s+1,r=i.length);const n=i.slice(o,r),l=this.gos.get("tabIndex");n.sort((a,d)=>{const h=parseInt(a.getAttribute("tabindex")||"0"),c=parseInt(d.getAttribute("tabindex")||"0");return c===l?1:h===l?-1:h===0?1:c===0?-1:h-c}),n[e?n.length-1:0].focus()}onFocusIn(e){this.focusTrapActive||this.forcingFocusOut||(this.providedFocusIn&&this.providedFocusIn(e),this.isFocusableContainer||this.deactivateTabGuards())}onFocusOut(e){this.focusTrapActive||(this.providedFocusOut&&this.providedFocusOut(e),this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards())}onTabKeyDown(e){if(this.providedOnTabKeyDown){this.providedOnTabKeyDown(e);return}if(this.focusTrapActive||e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){if(this.forcingFocusOut)return;const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,this.forcingFocusOut=!0,t.focus(),window.setTimeout(()=>{this.forcingFocusOut=!1,this.activateTabGuards()})}isTabGuard(e,t){return e===this.eTopGuard&&!t||e===this.eBottomGuard&&(t??!0)}setAllowFocus(e){this.allowFocus=e}},TabGuardFeature=class extends BeanStub{constructor(e){super(),this.comp=e}initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.comp.getFocusableElement();const{eTopGuard:t,eBottomGuard:i,eFocusableElement:s}=this,o=[t,i],r={setTabIndex:f=>{o.forEach(m=>f!=null?m.setAttribute("tabindex",f):m.removeAttribute("tabindex"))}};this.addTabGuards(t,i);const{focusTrapActive:n=!1,onFocusIn:l,onFocusOut:a,focusInnerElement:d,handleKeyDown:h,onTabKeyDown:c,shouldStopEventPropagation:u,forceFocusOutWhenTabGuardsAreEmpty:g,isFocusableContainer:p}=e;this.tabGuardCtrl=this.createManagedBean(new TabGuardCtrl({comp:r,focusTrapActive:n,eTopGuard:t,eBottomGuard:i,eFocusableElement:s,onFocusIn:l,onFocusOut:a,focusInnerElement:d,handleKeyDown:h,onTabKeyDown:c,shouldStopEventPropagation:u,forceFocusOutWhenTabGuardsAreEmpty:g,isFocusableContainer:p}))}getTabGuardCtrl(){return this.tabGuardCtrl}createTabGuard(e){const t=this.gos.getDocument().createElement("div"),i=e==="top"?"ag-tab-guard-top":"ag-tab-guard-bottom";return t.classList.add("ag-tab-guard",i),_setAriaRole(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];_clearElement(this.comp.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t,i){_isNodeOrElement(t)||(t=t.getGui());const{eBottomGuard:s}=this;s?s.insertAdjacentElement("beforebegin",t):e(t,i)}},TabGuardComp=class extends Component{initialiseTabGuard(e){this.tabGuardFeature=this.createManagedBean(new TabGuardFeature(this)),this.tabGuardFeature.initialiseTabGuard(e)}forceFocusOutOfContainer(e=!1){this.tabGuardFeature.forceFocusOutOfContainer(e)}appendChild(e,t){this.tabGuardFeature.appendChild(super.appendChild.bind(this),e,t)}},instanceIdSeq=0,WAIT_FOR_POPUP_CONTENT_RESIZE=200,PopupService=class extends BeanStub{constructor(){super(...arguments),this.beanName="popupService",this.popupList=[]}wireBeans(e){this.ctrlsService=e.ctrlsService,this.resizeObserverService=e.resizeObserverService,this.environment=e.environment}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getPopupParent(){const e=this.gos.get("popupParent");return e||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,s=this.getPopupIndex(i);if(s!==-1){const g=this.popupList[s];g.alignedToElement=t}const o=t.getBoundingClientRect(),r=this.getParentRect(),n=this.keepXYWithinBounds(i,o.top-r.top,0),l=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=`${l}px`;const d=r.right-r.left-l;let h;this.gos.get("enableRtl")?(h=u(),h<0&&(h=c(),this.setAlignedStyles(i,"left")),h>d&&(h=0,this.setAlignedStyles(i,"right"))):(h=c(),h>d&&(h=u(),this.setAlignedStyles(i,"right")),h<0&&(h=0,this.setAlignedStyles(i,"left"))),i.style.left=`${h}px`,i.style.top=`${n}px`;function c(){return o.right-r.left-2}function u(){return o.left-r.left-l}}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:s,skipObserver:o}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:!0,skipObserver:o,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,eventSource:r,alignSide:n="left",position:l="over",column:a,rowNode:d,type:h}=e,c=r.getBoundingClientRect(),u=this.getParentRect(),g=this.getPopupIndex(t);if(g!==-1){const f=this.popupList[g];f.alignedToElement=r}const p=()=>{let f=c.left-u.left;n==="right"&&(f-=t.offsetWidth-c.width);let m;return l==="over"?(m=c.top-u.top,this.setAlignedStyles(t,"over")):(this.setAlignedStyles(t,"under"),this.shouldRenderUnderOrAbove(t,c,u,e.nudgeY||0)==="under"?m=c.top-u.top+c.height:m=c.top-t.offsetHeight-(s||0)*2-u.top),{x:f,y:m}};this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,updatePosition:p,postProcessCallback:()=>this.callPostProcessPopup(h,t,r,null,a,d)})}shouldRenderUnderOrAbove(e,t,i,s){const o=i.bottom-t.bottom,r=t.top-i.top,n=e.offsetHeight+s;return o>n?"under":r>n||r>o?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(i===-1)return;const s=this.popupList[i],{alignedToElement:o}=s;!o||(["right","left","over","above","under"].forEach(n=>{o.classList.remove(`ag-has-popup-positioned-${n}`),e.classList.remove(`ag-popup-positioned-${n}`)}),!t)||(o.classList.add(`ag-has-popup-positioned-${t}`),e.classList.add(`ag-popup-positioned-${t}`))}callPostProcessPopup(e,t,i,s,o,r){const n=this.gos.getCallback("postProcessPopup");n&&n({column:o,rowNode:r,ePopup:t,type:e,eventSource:i,mouseEvent:s})}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:s,nudgeY:o,skipObserver:r,updatePosition:n}=e,l={width:0,height:0},a=(d=!1)=>{let{x:h,y:c}=n();d&&t.clientWidth===l.width&&t.clientHeight===l.height||(l.width=t.clientWidth,l.height=t.clientHeight,s&&(h+=s),o&&(c+=o),i&&(h=this.keepXYWithinBounds(t,h,1),c=this.keepXYWithinBounds(t,c,0)),t.style.left=`${h}px`,t.style.top=`${c}px`,e.postProcessCallback&&e.postProcessCallback())};if(a(),!r){const d=this.resizeObserverService.observeResize(t,()=>a(!0));setTimeout(()=>d(),WAIT_FOR_POPUP_CONTENT_RESIZE)}}getActivePopups(){return this.popupList.map(e=>e.element)}getPopupList(){return this.popupList}getParentRect(){const e=this.gos.getDocument();let t=this.getPopupParent();return t===e.body?t=e.documentElement:getComputedStyle(t).position==="static"&&(t=t.offsetParent),_getElementRectWithOffset(t)}keepXYWithinBounds(e,t,i){const s=i===0,o=s?"clientHeight":"clientWidth",r=s?"top":"left",n=s?"height":"width",l=s?"scrollTop":"scrollLeft",a=this.gos.getDocument(),d=a.documentElement,h=this.getPopupParent(),c=e.getBoundingClientRect(),u=h.getBoundingClientRect(),g=a.documentElement.getBoundingClientRect(),p=h===a.body,f=Math.ceil(c[n]);let C=p?(s?_getAbsoluteHeight:_getAbsoluteWidth)(d)+d[l]:h[o];p&&(C-=Math.abs(g[r]-u[r]));const v=C-f;return Math.min(Math.max(t,0),Math.abs(v))}addPopup(e){const t=this.gos.getDocument(),{eChild:i,ariaLabel:s,alwaysOnTop:o,positionCallback:r,anchorToElement:n}=e;if(!t)return _warnOnce("could not find the document, document is empty"),{hideFunc:()=>{}};const l=this.getPopupIndex(i);if(l!==-1)return{hideFunc:this.popupList[l].hideFunc};this.initialisePopupPosition(i);const a=this.createPopupWrapper(i,s,!!o),d=this.addEventListenersToPopup({...e,wrapperEl:a});return r&&r(),this.addPopupToPopupList(i,a,d,n),{hideFunc:d}}initialisePopupPosition(e){const i=this.getPopupParent().getBoundingClientRect();_exists(e.style.top)||(e.style.top=`${i.top*-1}px`),_exists(e.style.left)||(e.style.left=`${i.left*-1}px`)}createPopupWrapper(e,t,i){const s=this.getPopupParent(),o=document.createElement("div");return this.environment.applyThemeClasses(o),o.classList.add("ag-popup"),e.classList.add(this.gos.get("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||_setAriaRole(e,"dialog"),_setAriaLabel(e,t),o.appendChild(e),s.appendChild(o),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),o}handleThemeChange(e){if(e.themeChanged)for(const t of this.popupList)this.environment.applyThemeClasses(t.wrapper)}addEventListenersToPopup(e){const t=this.gos.getDocument(),i=this.getPopupParent(),{wrapperEl:s,eChild:o,closedCallback:r,afterGuiAttached:n,closeOnEsc:l,modal:a}=e;let d=!1;const h=p=>{if(!s.contains(this.gos.getActiveDomElement()))return;p.key===KeyCode.ESCAPE&&!_isStopPropagationForAgGrid(p)&&g({keyboardEvent:p})},c=p=>g({mouseEvent:p}),u=p=>g({touchEvent:p}),g=(p={})=>{const{mouseEvent:f,touchEvent:m,keyboardEvent:C,forceHide:v}=p;!v&&(this.isEventFromCurrentPopup({mouseEvent:f,touchEvent:m},o)||d)||(d=!0,i.removeChild(s),t.removeEventListener("keydown",h),t.removeEventListener("mousedown",c),t.removeEventListener("touchstart",u),t.removeEventListener("contextmenu",c),this.eventService.removeEventListener("dragStarted",c),r&&r(f||m||C),this.removePopupFromPopupList(o))};return n&&n({hidePopup:g}),window.setTimeout(()=>{l&&t.addEventListener("keydown",h),a&&(t.addEventListener("mousedown",c),this.eventService.addEventListener("dragStarted",c),t.addEventListener("touchstart",u),t.addEventListener("contextmenu",c))},0),g}addPopupToPopupList(e,t,i,s){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:instanceIdSeq++,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s)}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(i===-1)return;const s=this.popupList[i];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then(r=>r&&r()),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!t)return;const o=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:s.hideFunc});return s.stopAnchoringPromise=o,s.isAnchored=!0,o}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:s,ePopup:o}=e,r=s.getBoundingClientRect(),n=i.top-r.top,l=i.left-r.left;let a=n,d=l;const h=o.style.top,c=parseInt(h.substring(0,h.length-1),10),u=o.style.left,g=parseInt(u.substring(0,u.length-1),10),p=this.getFrameworkOverrides();return new AgPromise(f=>{p.wrapIncoming(()=>{p.setInterval(()=>{const m=t.getBoundingClientRect(),C=s.getBoundingClientRect();if(C.top==0&&C.left==0&&C.height==0&&C.width==0){e.hidePopup();return}const w=m.top-C.top;if(w!=a){const F=this.keepXYWithinBounds(o,c+n-w,0);o.style.top=`${F}px`}a=w;const y=m.left-C.left;if(y!=d){const F=this.keepXYWithinBounds(o,g+l-y,1);o.style.left=`${F}px`}d=y},200).then(m=>{f(()=>{m!=null&&window.clearInterval(m)})})},"popupPositioning")})}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:s}=e,o=i||s;if(!o)return!1;const r=this.getPopupIndex(t);if(r===-1)return!1;for(let n=r;n<this.popupList.length;n++){const l=this.popupList[n];if(_isElementInEventPath(l.element,o))return!0}return this.isElementWithinCustomPopup(o.target)}isElementWithinCustomPopup(e){const t=this.gos.getDocument();for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||e.parentElement===null)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),s=i.length,o=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),r=o.length,n=this.getWrapper(e);if(!n||s<=1||!t.contains(e))return!1;const l=i.indexOf(n),a=n.querySelectorAll("div"),d=[];a.forEach(c=>{c.scrollTop!==0&&d.push([c,c.scrollTop])});let h=!1;for(r?n.classList.contains("ag-always-on-top")?l!==s-1&&(_last(o).insertAdjacentElement("afterend",n),h=!0):l!==s-r-1&&(o[0].insertAdjacentElement("beforebegin",n),h=!0):l!==s-1&&(_last(i).insertAdjacentElement("afterend",n),h=!0);d.length;){const c=d.pop();c[0].scrollTop=c[1]}return h}},PASSIVE_EVENTS2=["touchstart","touchend","touchmove","touchcancel"],VanillaFrameworkOverrides=class{constructor(e="javascript"){this.frameworkName=e,this.renderingEngine="vanilla",this.wrapIncoming=t=>t(),this.wrapOutgoing=t=>t()}setInterval(e,t){return new AgPromise(i=>{i(window.setInterval(e,t))})}addEventListener(e,t,i,s){const o=_includes(PASSIVE_EVENTS2,t);e.addEventListener(t,i,{capture:!!s,passive:o})}get shouldWrapOutgoing(){return!1}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}getDocLink(e){return`https://www.ag-grid.com/${this.frameworkName==="solid"?"react":this.frameworkName}-data-grid${e?`/${e}`:""}`}},CellNavigationService=class extends BeanStub{constructor(){super(...arguments),this.beanName="cellNavigationService"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer,this.pinnedRowModel=e.pinnedRowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===KeyCode.UP,s=e===KeyCode.DOWN,o=e===KeyCode.LEFT;let r,n;if(i||s)n=i?this.pageBoundsService.getFirstRow():this.pageBoundsService.getLastRow(),r=t.column;else{const l=this.visibleColsService.getAllCols(),a=this.gos.get("enableRtl");n=t.rowIndex,r=o!==a?l[0]:_last(l)}return{rowIndex:n,rowPinned:null,column:r}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,s=!1;for(;!s;){switch(e){case KeyCode.UP:i=this.getCellAbove(i);break;case KeyCode.DOWN:i=this.getCellBelow(i);break;case KeyCode.RIGHT:this.gos.get("enableRtl")?i=this.getCellToLeft(i):i=this.getCellToRight(i);break;case KeyCode.LEFT:this.gos.get("enableRtl")?i=this.getCellToRight(i):i=this.getCellToLeft(i);break;default:i=null,_warnOnce("unknown key for navigation ",e);break}i?s=this.isCellGoodToFocusOn(i):s=!0}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex);break}return i?!t.isSuppressNavigable(i):!1}getCellToLeft(e){if(!e)return null;const t=this.visibleColsService.getColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.visibleColsService.getColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.pageBoundsService.getFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const s=this.rowModel.getRow(e.rowIndex),o=this.getNextStickyPosition(s);return o||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!this.gos.isGroupRowsSticky()||!e||!e.sticky)return;const i=this.rowRenderer.getStickyTopRowCtrls().some(l=>l.getRowNode().rowIndex===e.rowIndex);let s=[];i?s=[...this.rowRenderer.getStickyTopRowCtrls()].sort((l,a)=>l.getRowNode().rowIndex-a.getRowNode().rowIndex):s=[...this.rowRenderer.getStickyBottomRowCtrls()].sort((l,a)=>a.getRowNode().rowIndex-l.getRowNode().rowIndex);const o=t?-1:1,r=s.findIndex(l=>l.getRowNode().rowIndex===e.rowIndex),n=s[r+o];if(n)return{rowIndex:n.getRowNode().rowIndex,rowPinned:null}}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;return t==="top"?this.pinnedRowModel.getPinnedTopRowNodes().length-1<=i:t==="bottom"?this.pinnedRowModel.getPinnedBottomRowNodes().length-1<=i:this.pageBoundsService.getLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned;if(i?t===0:t===this.pageBoundsService.getFirstRow())return i==="top"?null:i?this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null:this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const o=this.rowModel.getRow(e.rowIndex),r=this.getNextStickyPosition(o,!0);return r||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.pageBoundsService.getLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowNodes().length-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const t=this.visibleColsService.getAllCols();let i=e.rowIndex,s=e.rowPinned,o=this.visibleColsService.getColAfter(e.column);if(!o){o=t[0];const r=this.getRowBelow(e);if(_missing(r)||!r.rowPinned&&!(this.paginationService?.isRowInPage(r)??!0))return null;i=r?r.rowIndex:null,s=r?r.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}getNextTabbedCellBackwards(e){const t=this.visibleColsService.getAllCols();let i=e.rowIndex,s=e.rowPinned,o=this.visibleColsService.getColBefore(e.column);if(!o){o=_last(t);const r=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(_missing(r)||!r.rowPinned&&!(this.paginationService?.isRowInPage(r)??!0))return null;i=r?r.rowIndex:null,s=r?r.rowPinned:null}return{rowIndex:i,column:o,rowPinned:s}}};function dispatchEvent(e,t){e.eventService.dispatchEvent(t)}var ApiFunctionService=class extends BeanStub{constructor(){super(...arguments),this.beanName="apiFunctionService",this.functions={dispatchEvent},this.isDestroyed=!1}wireBeans(e){this.beans=e}postConstruct(){this.preDestroyLink=this.frameworkOverrides.getDocLink("grid-lifecycle/#grid-pre-destroyed")}callFunction(e,t){const i=this.functions[e];if(i)return i.apply(i,[this.beans,...t]);if(this.isDestroyed)return this.destroyedHandler(e);this.isFrameworkMethod(e)||this.beans.validationService?.warnMissingApiFunction(e)}addFunction(e,t){const{validationService:i}=this.beans;i&&(t=i.validateApiFunction(e,t)),this.functions[e]=t}destroy(){this.functions={},this.isDestroyed=!0,super.destroy()}destroyedHandler(e){if(e==="isDestroyed")return!0;e!=="destroy"&&_warnOnce(`Grid API function ${e}() cannot be called as the grid has been destroyed.
|
|
154
154
|
Either clear local references to the grid api, when it is destroyed, or check gridApi.isDestroyed() to avoid calling methods against a destroyed grid.
|
|
155
|
-
To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${this.preDestroyLink}`)}isFrameworkMethod(e){return["preWireBeans","wireBeans","preConstruct","postConstruct"].includes(e)}};function createApi(e){const t=e.getBean("apiFunctionService");return new Proxy(t,{get(i,s){return(...o)=>i.callFunction(s,o)}})}function createApiProxy(e){return{beanName:"gridApi",bean:createApi(e)}}var ColumnDefFactory=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnDefFactory"}buildColumnDefs(e,t,i){const s=[],o={};return e.forEach(r=>{const n=this.createDefFromColumn(r,t,i);let l=!0,a=n,d=r.getOriginalParent(),h=null;for(;d;){let c=null;if(d.isPadding()){d=d.getOriginalParent();continue}const u=o[d.getGroupId()];if(u){u.children.push(a),l=!1;break}if(c=this.createDefFromGroup(d),c&&(c.children=[a],o[c.groupId]=c,a=c,d=d.getOriginalParent()),d!=null&&h===d){l=!1;break}h=d}l&&s.push(a)}),s}createDefFromGroup(e){const t=_deepCloneDefinition(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const s=_deepCloneDefinition(e.getColDef());return s.colId=e.getColId(),s.width=e.getActualWidth(),s.rowGroup=e.isRowGroupActive(),s.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,s.pivot=e.isPivotActive(),s.pivotIndex=e.isPivotActive()?i.indexOf(e):null,s.aggFunc=e.isValueActive()?e.getAggFunc():null,s.hide=e.isVisible()?void 0:!0,s.pinned=e.isPinned()?e.getPinned():null,s.sort=e.getSort()?e.getSort():null,s.sortIndex=e.getSortIndex()!=null?e.getSortIndex():null,s}},ColumnEventDispatcher=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnEventDispatcher"}visibleCols(){const e={type:"displayedColumnsChanged"};this.eventService.dispatchEvent(e)}gridColumns(){const e={type:"gridColumnsChanged"};this.eventService.dispatchEvent(e)}headerHeight(e){const t={type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(t)}groupOpened(e){const t={type:"columnGroupOpened",columnGroup:e.length===1?e[0]:void 0,columnGroups:e};this.eventService.dispatchEvent(t)}rowGroupChanged(e,t){const i={type:"columnRowGroupChanged",columns:e,column:e.length===1?e[0]:null,source:t};this.eventService.dispatchEvent(i)}genericColumnEvent(e,t,i){const s={type:e,columns:t,column:t.length===1?t[0]:null,source:i};this.eventService.dispatchEvent(s)}pivotModeChanged(){const e={type:"columnPivotModeChanged"};this.eventService.dispatchEvent(e)}virtualColumnsChanged(e){const t={type:"virtualColumnsChanged",afterScroll:e};this.eventService.dispatchEvent(t)}newColumnsLoaded(e){const t={type:"newColumnsLoaded",source:e};this.eventService.dispatchEvent(t)}everythingChanged(e){const t={type:"columnEverythingChanged",source:e};this.eventService.dispatchEvent(t)}columnMoved(e){const{movedColumns:t,source:i,toIndex:s,finished:o}=e,r={type:"columnMoved",columns:t,column:t&&t.length===1?t[0]:null,toIndex:s,finished:o,source:i};this.eventService.dispatchEvent(r)}columnPinned(e,t){if(!e.length)return;const i=e.length===1?e[0]:null,s=this.getCommonValue(e,r=>r.getPinned()),o={type:"columnPinned",pinned:s??null,columns:e,column:i,source:t};this.eventService.dispatchEvent(o)}columnVisible(e,t){if(!e.length)return;const i=e.length===1?e[0]:null,o={type:"columnVisible",visible:this.getCommonValue(e,r=>r.isVisible()),columns:e,column:i,source:t};this.eventService.dispatchEvent(o)}getCommonValue(e,t){if(!e||e.length==0)return;const i=t(e[0]);for(let s=1;s<e.length;s++)if(i!==t(e[s]))return;return i}columnChanged(e,t,i){const s={type:e,columns:t,column:t&&t.length==1?t[0]:null,source:i};this.eventService.dispatchEvent(s)}columnResized(e,t,i,s=null){if(e&&e.length){const o={type:"columnResized",columns:e,column:e.length===1?e[0]:null,flexColumns:s,finished:t,source:i};this.eventService.dispatchEvent(o)}}},ColumnGetStateService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnGetStateService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService}getColumnState(){const e=this.columnModel.getColDefCols();if(_missing(e)||!this.columnModel.isAlive())return[];const i=this.columnModel.getAllCols().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(i),i}createStateItemFromColumn(e){const t=this.funcColsService.getRowGroupColumns(),i=this.funcColsService.getPivotColumns(),s=e.isRowGroupActive()?t.indexOf(e):null,o=e.isPivotActive()?i.indexOf(e):null,r=e.isValueActive()?e.getAggFunc():null,n=e.getSort()!=null?e.getSort():null,l=e.getSortIndex()!=null?e.getSortIndex():null,a=e.getFlex()!=null&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:n,sortIndex:l,aggFunc:r,rowGroup:e.isRowGroupActive(),rowGroupIndex:s,pivot:e.isPivotActive(),pivotIndex:o,flex:a}}orderColumnStateList(e){const t=this.columnModel.getCols(),i=new Map(t.map((s,o)=>[s.getColId(),o]));e.sort((s,o)=>{const r=i.has(s.colId)?i.get(s.colId):-1,n=i.has(o.colId)?i.get(o.colId):-1;return r-n})}},ColumnGroupStateService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnGroupStateService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService}getColumnGroupState(){const e=[],t=this.columnModel.getColTree();return depthFirstOriginalTreeSearch(null,t,i=>{isProvidedColumnGroup(i)&&e.push({groupId:i.getGroupId(),open:i.isExpanded()})}),e}resetColumnGroupState(e){const t=this.columnModel.getColDefColTree();if(!t)return;const i=[];depthFirstOriginalTreeSearch(null,t,s=>{if(isProvidedColumnGroup(s)){const o=s.getColGroupDef(),r={groupId:s.getGroupId(),open:o?o.openByDefault:void 0};i.push(r)}}),this.setColumnGroupState(i,e)}setColumnGroupState(e,t){if(!this.columnModel.getColTree())return;this.columnAnimationService.start();const s=[];e.forEach(o=>{const r=o.groupId,n=o.open,l=this.columnModel.getProvidedColGroup(r);l&&l.isExpanded()!==n&&(l.setExpanded(n),s.push(l))}),this.visibleColsService.refresh(t,!0),s.length&&this.eventDispatcher.groupOpened(s),this.columnAnimationService.finish()}},ColumnViewportService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnViewportService",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={}}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}setScrollPosition(e,t,i=!1){const s=this.visibleColsService.isBodyWidthDirty();if(!(e===this.scrollWidth&&t===this.scrollPosition&&!s)){if(this.scrollWidth=e,this.scrollPosition=t,this.visibleColsService.setBodyWidthDirty(),this.gos.get("enableRtl")){const r=this.visibleColsService.getBodyContainerWidth();this.viewportLeft=r-this.scrollPosition-this.scrollWidth,this.viewportRight=r-this.scrollPosition}else this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition;this.columnModel.isReady()&&this.checkViewportColumns(i)}}getHeadersToRender(e,t){let i;switch(e){case"left":i=this.rowsOfHeadersToRenderLeft[t];break;case"right":i=this.rowsOfHeadersToRenderRight[t];break;default:i=this.rowsOfHeadersToRenderCenter[t];break}return i||[]}extractViewportColumns(){const e=this.visibleColsService.getCenterCols();this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return e.isAutoHeaderHeight()?!0:this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),s=this.viewportLeft-200,o=this.viewportRight+200,r=t<s&&i<s,n=t>o&&i>o;return!r&&!n}getViewportColumns(){const e=this.visibleColsService.getLeftCols(),t=this.visibleColsService.getRightCols();return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.columnModel.isColSpanActive())return this.colsWithinViewport;const t=o=>{const r=o.getLeft();return _exists(r)&&r>this.viewportLeft},i=this.isColumnVirtualisationSuppressed()?null:this.isColumnInRowViewport.bind(this),s=this.visibleColsService.getColsCenter();return this.visibleColsService.getColsForRow(e,s,i,t)}checkViewportColumns(e=!1){this.extractViewport()&&this.eventDispatcher.virtualColumnsChanged(e)}calculateHeaderRows(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={};const e={},t=this.visibleColsService.getLeftCols(),i=this.visibleColsService.getRightCols();this.headerColsWithinViewport.concat(t).concat(i).forEach(r=>e[r.getId()]=!0);const o=(r,n,l)=>{let a=!1;for(let d=0;d<r.length;d++){const h=r[d];let c=!1;if(isColumn(h))c=e[h.getId()]===!0;else{const g=h.getDisplayedChildren();g&&(c=o(g,n,l+1))}c&&(a=!0,n[l]||(n[l]=[]),n[l].push(h))}return a};o(this.visibleColsService.getTreeLeft(),this.rowsOfHeadersToRenderLeft,0),o(this.visibleColsService.getTreeRight(),this.rowsOfHeadersToRenderRight,0),o(this.visibleColsService.getTreeCenter(),this.rowsOfHeadersToRenderCenter,0)}extractViewport(){const e=s=>`${s.getId()}-${s.getPinned()||"normal"}`;this.extractViewportColumns();const t=this.getViewportColumns().map(e).join("#"),i=this.colsWithinViewportHash!==t;return i&&(this.colsWithinViewportHash=t,this.calculateHeaderRows()),i}},AgComponentUtils=class extends BeanStub{constructor(){super(...arguments),this.beanName="agComponentUtils"}wireBeans(e){this.componentMetadataProvider=e.componentMetadataProvider}adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){class t{refresh(){return!1}getGui(){return this.eGui}init(s){const o=e(s),r=typeof o;if(r==="string"||r==="number"||r==="boolean"){this.eGui=_loadTemplate("<span>"+o+"</span>");return}if(o==null){this.eGui=_loadTemplate("<span></span>");return}this.eGui=o}}return t}doesImplementIComponent(e){return e?e.prototype&&"getGui"in e.prototype:!1}},ComponentMetadataProvider=class extends BeanStub{constructor(){super(...arguments),this.beanName="componentMetadataProvider"}wireBeans(e){this.agComponentUtils=e.agComponentUtils}postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","onParamsUpdated","refresh"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached","onParamsUpdated","refresh"]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["refresh"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","getState"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]},menuItem:{mandatoryMethodList:[],optionalMethodList:["setActive","select","setExpanded","configureDefaults"]}}}retrieve(e){return this.componentMetaData[e]}},orderedCoreBeans=["rowPositionUtils","cellPositionUtils","headerPositionUtils","paginationAutoPageSizeService","apiFunctionService","gridApi","userComponentRegistry","agComponentUtils","componentMetadataProvider","resizeObserverService","userComponentFactory","rowContainerHeightService","horizontalResizeService","localeService","validationService","pinnedRowModel","dragService","visibleColsService","eventService","gos","popupService","selectionService","columnFilterService","quickFilterService","filterManager","columnModel","headerNavigationService","pageBoundsService","paginationService","pageBoundsListener","rowRenderer","expressionService","columnFactory","alignedGridsService","navigationService","valueCache","valueService","loggerFactory","autoWidthCalculator","filterMenuFactory","dragAndDropService","focusService","mouseEventService","environment","cellNavigationService","stylingService","scrollVisibleService","sortController","columnHoverService","columnAnimationService","selectableService","autoColService","changeDetectionService","animationFrameService","undoRedoService","columnDefFactory","rowCssClassCalculator","rowNodeBlockLoader","rowNodeSorter","ctrlsService","pinnedWidthService","rowNodeEventThrottle","ctrlsFactory","dataTypeService","syncService","overlayService","stateService","expansionService","apiEventService","ariaAnnouncementService","menuService","columnApplyStateService","columnEventDispatcher","columnMoveService","columnAutosizeService","columnGetStateService","columnGroupStateService","columnSizeService","funcColsService","columnNameService","columnViewportService","pivotResultColsService","showRowGroupColsService"],beanNamePosition=Object.fromEntries(orderedCoreBeans.map((e,t)=>[e,t]));function gridBeanInitComparator(e,t){const i=(e.beanName?beanNamePosition[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER,s=(t.beanName?beanNamePosition[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return i-s}function gridBeanDestroyComparator(e,t){return e?.beanName==="gridDestroyService"?-1:0}var CtrlsFactory=class extends BeanStub{constructor(){super(...arguments),this.beanName="ctrlsFactory",this.registry={}}register(e){this.registry[e.name]=e.classImp}getInstance(e,...t){const i=this.registry[e];if(i!=null)return new i(...t)}},CtrlsService=class extends BeanStub{constructor(){super(...arguments),this.beanName="ctrlsService",this.params={},this.ready=!1,this.readyCallbacks=[]}checkReady(){const e=this.params;this.ready=e.gridCtrl!=null&&e.gridBodyCtrl!=null&&e.center!=null&&e.left!=null&&e.right!=null&&e.bottomCenter!=null&&e.bottomLeft!=null&&e.bottomRight!=null&&e.topCenter!=null&&e.topLeft!=null&&e.topRight!=null&&e.stickyTopCenter!=null&&e.stickyTopLeft!=null&&e.stickyTopRight!=null&&e.stickyBottomCenter!=null&&e.stickyBottomLeft!=null&&e.stickyBottomRight!=null&&e.centerHeader!=null&&e.leftHeader!=null&&e.rightHeader!=null&&e.fakeHScrollComp!=null&&e.fakeVScrollComp!=null&&e.gridHeaderCtrl!=null,this.ready&&(this.readyCallbacks.forEach(t=>t(e)),this.readyCallbacks.length=0)}whenReady(e){this.ready?e(this.params):this.readyCallbacks.push(e)}register(e,t){this.params[e]=t,this.checkReady()}registerHeaderContainer(e,t){const i=this.params;switch(t){case"left":i.leftHeader=e;break;case"right":i.rightHeader=e;break;default:i.centerHeader=e;break}this.checkReady()}get(e){return this.params[e]}getParams(){return this.params}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){const{leftHeader:e,centerHeader:t,rightHeader:i}=this.params;return[e,i,t]}getHeaderRowContainerCtrl(e){const t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}},CellPositionUtils=class extends BeanStub{constructor(){super(...arguments),this.beanName="cellPositionUtils"}createId(e){const{rowIndex:t,rowPinned:i,column:s}=e;return this.createIdFromValues({rowIndex:t,column:s,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:s}=e;return`${t}.${i??"null"}.${s.getId()}`}equals(e,t){const i=e.column===t.column,s=e.rowPinned===t.rowPinned,o=e.rowIndex===t.rowIndex;return i&&s&&o}},RowNodeEventThrottle=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowNodeEventThrottle",this.events=[]}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowModel=e.rowModel}postConstruct(){this.rowModel.getType()=="clientSide"&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e,t){if(this.clientSideRowModel==null){this.eventService.dispatchEvent(e);return}this.events.push(e);const i=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(s=>this.eventService.dispatchEvent(s)),this.events=[]};t?i():(this.dispatchExpandedDebounced==null&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(i)),this.dispatchExpandedDebounced())}},RowPositionUtils=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowPositionUtils"}wireBeans(e){this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.pageBoundsService=e.pageBoundsService}getFirstRow(){let e=0,t;return this.pinnedRowModel.getPinnedTopRowCount()?t="top":this.rowModel.getRowCount()?(t=null,e=this.pageBoundsService.getFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(t="bottom"),t===void 0?null:{rowIndex:e,rowPinned:t}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),s=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.pageBoundsService.getLastRow()):s&&(t="top",e=s-1),e===void 0?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowNodes()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowNodes()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t?!0:e&&!t||!e&&t?!1:e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}before(e,t){switch(e.rowPinned){case"top":if(t.rowPinned!=="top")return!0;break;case"bottom":if(t.rowPinned!=="bottom")return!1;break;default:if(_exists(t.rowPinned))return t.rowPinned!=="top";break}return e.rowIndex<t.rowIndex}},ROW_HEIGHT={cssName:"--ag-row-height",changeKey:"rowHeightChanged",defaultValue:42},HEADER_HEIGHT={cssName:"--ag-header-height",changeKey:"headerHeightChanged",defaultValue:48},LIST_ITEM_HEIGHT={cssName:"--ag-list-item-height",changeKey:"listItemHeightChanged",defaultValue:24},Environment=class extends BeanStub{constructor(){super(...arguments),this.beanName="environment",this.sizeEls=new Map,this.lastKnownValues=new Map,this.themeClasses=[],this.eThemeAncestor=null,this.eMeasurementContainer=null,this.sizesMeasured=!1}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.eGridDiv=e.eGridDiv}postConstruct(){this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.themeClasses=this.getAncestorThemeClasses(),this.setUpThemeClassObservers(),this.getSizeEl(ROW_HEIGHT),this.getSizeEl(HEADER_HEIGHT),this.getSizeEl(LIST_ITEM_HEIGHT)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(ROW_HEIGHT)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(HEADER_HEIGHT)}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(LIST_ITEM_HEIGHT)}hasMeasuredSizes(){return this.sizesMeasured}getThemeClasses(){return this.themeClasses}applyThemeClasses(e){for(const t of Array.from(e.classList))t.startsWith("ag-theme-")&&!this.themeClasses.includes(t)&&e.classList.remove(t);for(const t of this.themeClasses)e.classList.contains(t)||e.classList.add(t)}getThemeAncestorElement(){return this.eThemeAncestor}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gos.get("rowHeight");if(t==null||isNaN(t)||!isFinite(t))return e!==null&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const i=`${t}px`;return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):e!=""?parseFloat(e):-1}getCSSVariablePixelValue(e){const t=this.lastKnownValues.get(e);if(t!=null)return t;const i=this.measureSizeEl(e);return i==="detached"||i==="no-styles"?e.defaultValue:(this.lastKnownValues.set(e,i),i)}measureSizeEl(e){const t=this.getSizeEl(e);if(t.offsetParent==null)return"detached";const i=t.offsetWidth;return i===NO_VALUE_SENTINEL?"no-styles":(this.sizesMeasured=!0,i)}getSizeEl(e){let t=this.sizeEls.get(e);if(t)return t;let i=this.eMeasurementContainer;i||(i=this.eMeasurementContainer=document.createElement("div"),i.className="ag-measurement-container",this.eGridDiv.appendChild(i)),t=document.createElement("div"),t.style.width=`var(${e.cssName}, ${NO_VALUE_SENTINEL}px)`,i.appendChild(t),this.sizeEls.set(e,t);let s=this.measureSizeEl(e);s==="no-styles"&&_warnOnce(`no value for ${e.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${e.defaultValue} will be used and updated when styles load.`);const o=this.resizeObserverService.observeResize(t,()=>{const r=this.measureSizeEl(e);r==="detached"||r==="no-styles"||(this.lastKnownValues.set(e,r),r!==s&&(s=r,this.fireGridStylesChangedEvent(e.changeKey)))});return this.addDestroyFunc(()=>o()),t}fireGridStylesChangedEvent(e){const t={type:"gridStylesChanged",[e]:!0};this.eventService.dispatchEvent(t)}setUpThemeClassObservers(){const e=new MutationObserver(()=>{const i=this.getAncestorThemeClasses();arraysEqual(i,this.themeClasses)||(this.themeClasses=i,this.fireGridStylesChangedEvent("themeChanged"))});let t=this.eGridDiv;for(;t;)e.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]}),t=t.parentElement}getAncestorThemeClasses(){let e=this.eGridDiv;const t=[];for(this.eThemeAncestor=null;e;){const i=Array.from(e.classList).filter(s=>s.startsWith("ag-theme-"));for(const s of i)this.eThemeAncestor=e,t.includes(s)||t.unshift(s);e=e.parentElement}return Object.freeze(t)}},arraysEqual=(e,t)=>e.length===t.length&&e.findIndex((i,s)=>e[s]!==t[s])===-1,NO_VALUE_SENTINEL=15538,EventService=class extends BeanStub{constructor(){super(...arguments),this.beanName="eventService",this.globalEventService=new LocalEventService}wireBeans(e){this.globalEventListener=e.globalEventListener,this.globalSyncEventListener=e.globalSyncEventListener}postConstruct(){if(this.globalEventListener){const e=this.gos.useAsyncEvents();this.addGlobalListener(this.globalEventListener,e)}this.globalSyncEventListener&&this.addGlobalListener(this.globalSyncEventListener,!1)}addEventListener(e,t,i){this.globalEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.globalEventService.removeEventListener(e,t,i)}addGlobalListener(e,t=!1){this.globalEventService.addGlobalListener(e,t)}removeGlobalListener(e,t=!1){this.globalEventService.removeGlobalListener(e,t)}dispatchLocalEvent(){}dispatchEvent(e){this.globalEventService.dispatchEvent(this.gos.addGridCommonParams(e))}dispatchEventOnce(e){this.globalEventService.dispatchEventOnce(this.gos.addGridCommonParams(e))}},_FocusService=class D extends BeanStub{constructor(){super(...arguments),this.beanName="focusService"}wireBeans(t){this.eGridDiv=t.eGridDiv,this.columnModel=t.columnModel,this.visibleColsService=t.visibleColsService,this.headerNavigationService=t.headerNavigationService,this.headerPositionUtils=t.headerPositionUtils,this.rowRenderer=t.rowRenderer,this.rowPositionUtils=t.rowPositionUtils,this.cellPositionUtils=t.cellPositionUtils,this.navigationService=t.navigationService,this.ctrlsService=t.ctrlsService,this.filterManager=t.filterManager,this.rangeService=t.rangeService,this.advancedFilterService=t.advancedFilterService}static addKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",D.toggleKeyboardMode),t.addEventListener("mousedown",D.toggleKeyboardMode))}static removeKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",D.toggleKeyboardMode),t.addEventListener("mousedown",D.toggleKeyboardMode))}static toggleKeyboardMode(t){const i=D.keyboardModeActive,s=t.type==="keydown";s&&(t.ctrlKey||t.metaKey||t.altKey)||i!==s&&(D.keyboardModeActive=s)}static unregisterGridCompController(t){D.removeKeyboardModeEvents(t)}postConstruct(){const t=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:t,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:t,columnRowGroupChanged:t}),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady(i=>{this.gridCtrl=i.gridCtrl})}registerKeyboardFocusEvents(){const t=this.gos.getDocument();D.addKeyboardModeEvents(t),D.instanceCount++,this.addDestroyFunc(()=>{D.instanceCount--,D.unregisterGridCompController(t)})}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const t=this.focusedCellPosition.column,i=this.columnModel.getCol(t.getId());t!==i&&this.clearFocusedCell()}isKeyboardMode(){return D.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),RowCtrl.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),AbstractHeaderCellCtrl.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(t,i){let s=t;for(;s;){if(this.gos.getDomData(s,i))return!1;s=s.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(t){return this.isCellRestoreFocused(t)?(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0):!1}isCellRestoreFocused(t){return this.restoredFocusedCellPosition==null?!1:this.cellPositionUtils.equals(t,this.restoredFocusedCellPosition)}setRestoreFocusedCell(t){this.getFrameworkOverrides().renderingEngine==="react"&&(this.restoredFocusedCellPosition=t)}getFocusEventParams(){const{rowIndex:t,rowPinned:i,column:s}=this.focusedCellPosition,o={rowIndex:t,rowPinned:i,column:s,isFullWidthCell:!1},r=this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:i});return r&&(o.isFullWidthCell=r.isFullWidth()),o}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,this.focusedCellPosition==null)return;const t={type:"cellFocusCleared",...this.getFocusEventParams()};this.focusedCellPosition=null,this.eventService.dispatchEvent(t)}setFocusedCell(t){const{column:i,rowIndex:s,rowPinned:o,forceBrowserFocus:r=!1,preventScrollOnBrowserFocus:n=!1}=t,l=this.columnModel.getCol(i);if(!l){this.focusedCellPosition=null;return}this.focusedCellPosition=l?{rowIndex:s,rowPinned:_makeNull(o),column:l}:null;const a={type:"cellFocused",...this.getFocusEventParams(),forceBrowserFocus:r,preventScrollOnBrowserFocus:n};this.eventService.dispatchEvent(a)}isCellFocused(t){return this.focusedCellPosition==null?!1:this.cellPositionUtils.equals(t,this.focusedCellPosition)}isRowNodeFocused(t){return this.isRowFocused(t.rowIndex,t.rowPinned)}isHeaderWrapperFocused(t){if(this.focusedHeaderPosition==null)return!1;const i=t.getColumnGroupChild(),s=t.getRowIndex(),o=t.getPinned(),{column:r,headerRowIndex:n}=this.focusedHeaderPosition;return i===r&&s===n&&o==r.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(t,i){this.focusedHeaderPosition={headerRowIndex:t,column:i}}focusHeaderPosition(t){if(this.gos.get("suppressHeaderFocus"))return!1;const{direction:i,fromTab:s,allowUserOverride:o,event:r,fromCell:n,rowWithoutSpanValue:l}=t;let{headerPosition:a}=t;if(n&&this.filterManager?.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(a);if(o){const d=this.getFocusedHeader(),h=this.headerNavigationService.getHeaderRowCount();if(s){const c=this.gos.getCallback("tabToNextHeader");c&&(a=this.getHeaderPositionFromUserFunc({userFunc:c,direction:i,currentPosition:d,headerPosition:a,headerRowCount:h}))}else{const c=this.gos.getCallback("navigateToNextHeader");if(c&&r){const u={key:r.key,previousHeaderPosition:d,nextHeaderPosition:a,headerRowCount:h,event:r};a=c(u)}}}return a?this.focusProvidedHeaderPosition({headerPosition:a,direction:i,event:r,fromCell:n,rowWithoutSpanValue:l}):!1}focusHeaderPositionFromUserFunc(t){if(this.gos.get("suppressHeaderFocus"))return!1;const{userFunc:i,headerPosition:s,direction:o,event:r}=t,n=this.getFocusedHeader(),l=this.headerNavigationService.getHeaderRowCount(),a=this.getHeaderPositionFromUserFunc({userFunc:i,direction:o,currentPosition:n,headerPosition:s,headerRowCount:l});return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:o,event:r})}getHeaderPositionFromUserFunc(t){const{userFunc:i,direction:s,currentPosition:o,headerPosition:r,headerRowCount:n}=t,a=i({backwards:s==="Before",previousHeaderPosition:o,nextHeaderPosition:r,headerRowCount:n});return a===!0||a===null?(a===null&&_warnOnce("Since v31.3 Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),o):a===!1?null:a}focusProvidedHeaderPosition(t){const{headerPosition:i,direction:s,fromCell:o,rowWithoutSpanValue:r,event:n}=t,{column:l,headerRowIndex:a}=i;if(a===-1)return this.filterManager?.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(i):this.focusGridView(l);this.headerNavigationService.scrollToColumn(l,s);const h=this.ctrlsService.getHeaderRowContainerCtrl(l.getPinned()).focusHeader(i.headerRowIndex,l,n);return h&&(r!=null||o)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(r??-1),h}focusFirstHeader(){let t=this.visibleColsService.getAllCols()[0];if(!t)return!1;t.getParent()&&(t=this.visibleColsService.getColGroupAtLevel(t,0));const i=this.headerPositionUtils.getHeaderIndexToFocus(t,0);return this.focusHeaderPosition({headerPosition:i,rowWithoutSpanValue:0})}focusLastHeader(t){const i=this.headerNavigationService.getHeaderRowCount()-1,s=_last(this.visibleColsService.getAllCols());return this.focusHeaderPosition({headerPosition:{headerRowIndex:i,column:s},rowWithoutSpanValue:-1,event:t})}focusPreviousFromFirstCell(t){return this.filterManager?.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(t)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(t,i){return this.focusedCellPosition==null?!1:this.focusedCellPosition.rowIndex===t&&this.focusedCellPosition.rowPinned===_makeNull(i)}findFocusableElements(t,i,s=!1){const o=FOCUSABLE_SELECTOR;let r=FOCUSABLE_EXCLUDE;i&&(r+=", "+i),s&&(r+=', [tabindex="-1"]');const n=Array.prototype.slice.apply(t.querySelectorAll(o)).filter(d=>_isVisible(d)),l=Array.prototype.slice.apply(t.querySelectorAll(r));return l.length?((d,h)=>d.filter(c=>h.indexOf(c)===-1))(n,l):n}focusInto(t,i=!1,s=!1){const o=this.findFocusableElements(t,null,s),r=i?_last(o):o[0];return r?(r.focus({preventScroll:!0}),!0):!1}findFocusableElementBeforeTabGuard(t,i){if(!i)return null;const s=this.findFocusableElements(t),o=s.indexOf(i);if(o===-1)return null;let r=-1;for(let n=o-1;n>=0;n--)if(s[n].classList.contains("ag-tab-guard-top")){r=n;break}return r<=0?null:s[r-1]}findNextFocusableElement(t=this.eGridDiv,i,s){const o=this.findFocusableElements(t,i?':not([tabindex="-1"])':null),r=this.gos.getActiveDomElement();let n;i?n=o.findIndex(a=>a.contains(r)):n=o.indexOf(r);const l=n+(s?-1:1);return l<0||l>=o.length?null:o[l]}isTargetUnderManagedComponent(t,i){if(!i)return!1;const s=t.querySelectorAll(`.${ManagedFocusFeature.FOCUS_MANAGED_CLASS}`);if(!s.length)return!1;for(let o=0;o<s.length;o++)if(s[o].contains(i))return!0;return!1}findTabbableParent(t,i=5){let s=0;for(;t&&_getTabIndex(t)===null&&++s<=i;)t=t.parentElement;return _getTabIndex(t)===null?null:t}focusGridView(t,i){if(this.gos.get("suppressCellFocus"))return i?this.gos.get("suppressHeaderFocus")?this.focusNextGridCoreContainer(!0,!0):this.focusLastHeader():this.focusNextGridCoreContainer(!1);const s=i?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!s)return!1;const{rowIndex:o,rowPinned:r}=s,n=this.getFocusedHeader();return!t&&n&&(t=n.column),o==null||!t?!1:(this.navigationService.ensureCellVisible({rowIndex:o,column:t,rowPinned:r}),this.setFocusedCell({rowIndex:o,column:t,rowPinned:_makeNull(r),forceBrowserFocus:!0}),this.rangeService?.setRangeToCell({rowIndex:o,rowPinned:r,column:t}),!0)}focusNextGridCoreContainer(t,i=!1){return!i&&this.gridCtrl.focusNextInnerContainer(t)?!0:((i||!t&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(t),!1)}focusAdvancedFilter(t){return this.advancedFilterFocusColumn=t?.column,this.advancedFilterService?.getCtrl().focusHeaderComp()??!1}focusNextFromAdvancedFilter(t,i){const s=(i?void 0:this.advancedFilterFocusColumn)??this.visibleColsService.getAllCols()?.[0];return t?this.focusHeaderPosition({headerPosition:{column:s,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(s)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}addFocusableContainer(t){this.gridCtrl.addFocusableContainer(t)}removeFocusableContainer(t){this.gridCtrl.removeFocusableContainer(t)}focusGridInnerElement(t){return this.gridCtrl.focusInnerElement(t)}};_FocusService.keyboardModeActive=!1,_FocusService.instanceCount=0;var FocusService=_FocusService,PinnedWidthService=class extends BeanStub{constructor(){super(...arguments),this.beanName="pinnedWidthService"}wireBeans(e){this.visibleColsService=e.visibleColsService}postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=this.gos.isDomLayout("print"),t=e?0:this.visibleColsService.getColsLeftWidth(),i=e?0:this.visibleColsService.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:"leftPinnedWidthChanged"})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:"rightPinnedWidthChanged"}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}},GridCtrl=class extends BeanStub{constructor(){super(...arguments),this.additionalFocusableContainers=new Set}wireBeans(e){this.beans=e,this.focusService=e.focusService,this.visibleColsService=e.visibleColsService}setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.gridId);const{dragAndDropService:s,mouseEventService:o,ctrlsService:r,resizeObserverService:n}=this.beans;s.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:a=>a===1||a===0,getIconName:()=>"notAllowed"}),o.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new LayoutFeature(this.view)),this.addRtlSupport();const l=n.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>l()),r.register("gridCtrl",this)}isDetailGrid(){return this.focusService.findTabbableParent(this.getGui())?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){const e=this.beans;return{paginationSelector:e.paginationService?.getPaginationSelector(),gridHeaderDropZonesSelector:e.columnDropZonesService?.getDropZoneSelector(),sideBarSelector:e.sideBarService?.getSideBarSelector(),statusBarSelector:e.statusBarService?.getStatusPanelSelector(),watermarkSelector:e.licenseManager?.getWatermarkSelector()}}onGridSizeChanged(){const e={type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(e)}addRtlSupport(){const e=this.gos.get("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(e)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),i=this.gos.getActiveDomElement(),s=t.findIndex(r=>r.getGui().contains(i)),o=s+(e?-1:1);if(o<0||o>=t.length)return!1;if(o===0){if(s>0){const r=this.visibleColsService.getAllCols(),n=_last(r);if(this.focusService.focusGridView(n,!0))return!0}return!1}return this.focusContainer(t[o],e)}focusInnerElement(e){const t=this.getFocusableContainers(),i=this.visibleColsService.getAllCols(),s=this.gos.getCallback("focusGridInnerElement");if(s&&s({fromBottom:!!e}))return!0;if(e){if(t.length>1)return this.focusContainer(_last(t),!0);const o=_last(i);if(this.focusService.focusGridView(o,!0))return!0}if(this.gos.get("headerHeight")===0||this.gos.get("suppressHeaderFocus")){if(this.focusService.focusGridView(i[0]))return!0;for(let o=1;o<t.length;o++)if(this.focusService.focusInto(t[o].getGui()))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}addFocusableContainer(e){this.additionalFocusableContainers.add(e)}removeFocusableContainer(e){this.additionalFocusableContainers.delete(e)}focusContainer(e,t){e?.setAllowFocus?.(!0);const i=this.focusService.focusInto(e.getGui(),t);return e?.setAllowFocus?.(!1),i}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers.values()]}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},GridComp=class extends TabGuardComp{constructor(e){super(),this.gridBody=RefPlaceholder,this.sideBar=RefPlaceholder,this.pagination=RefPlaceholder,this.rootWrapperBody=RefPlaceholder,this.eGridDiv=e}postConstruct(){const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:r=>this.addCssClass(r),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:r=>{this.getGui().style.userSelect=r??"",this.getGui().style.webkitUserSelect=r??""},setCursor:r=>{this.getGui().style.cursor=r??""}},t=this.createManagedBean(new GridCtrl),i=t.getOptionalSelectors(),s=this.createTemplate(i),o=[GridBodySelector,...Object.values(i).filter(r=>!!r)];this.setTemplate(s,o),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>t.focusInnerElement(r),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{this.eGridDiv.removeChild(e),this.gos.get("debug")&&_log("Grid removed from DOM")})}updateLayoutClasses(e,t){const i=this.rootWrapperBody.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)}createTemplate(e){const t=e.gridHeaderDropZonesSelector?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":"",i=e.sideBarSelector?'<ag-side-bar data-ref="sideBar"></ag-side-bar>':"",s=e.statusBarSelector?"<ag-status-bar></ag-status-bar>":"",o=e.watermarkSelector?"<ag-watermark></ag-watermark>":"",r=e.paginationSelector?'<ag-pagination data-ref="pagination"></ag-pagination>':"";return`<div class="ag-root-wrapper" role="presentation">
|
|
155
|
+
To run logic when the grid is about to be destroyed use the gridPreDestroy event. See: ${this.preDestroyLink}`)}isFrameworkMethod(e){return["preWireBeans","wireBeans","preConstruct","postConstruct"].includes(e)}};function createApi(e){const t=e.getBean("apiFunctionService");return new Proxy(t,{get(i,s){if(s!=="then")return(...o)=>i.callFunction(s,o)}})}function createApiProxy(e){return{beanName:"gridApi",bean:createApi(e)}}var ColumnDefFactory=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnDefFactory"}buildColumnDefs(e,t,i){const s=[],o={};return e.forEach(r=>{const n=this.createDefFromColumn(r,t,i);let l=!0,a=n,d=r.getOriginalParent(),h=null;for(;d;){let c=null;if(d.isPadding()){d=d.getOriginalParent();continue}const u=o[d.getGroupId()];if(u){u.children.push(a),l=!1;break}if(c=this.createDefFromGroup(d),c&&(c.children=[a],o[c.groupId]=c,a=c,d=d.getOriginalParent()),d!=null&&h===d){l=!1;break}h=d}l&&s.push(a)}),s}createDefFromGroup(e){const t=_deepCloneDefinition(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const s=_deepCloneDefinition(e.getColDef());return s.colId=e.getColId(),s.width=e.getActualWidth(),s.rowGroup=e.isRowGroupActive(),s.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,s.pivot=e.isPivotActive(),s.pivotIndex=e.isPivotActive()?i.indexOf(e):null,s.aggFunc=e.isValueActive()?e.getAggFunc():null,s.hide=e.isVisible()?void 0:!0,s.pinned=e.isPinned()?e.getPinned():null,s.sort=e.getSort()?e.getSort():null,s.sortIndex=e.getSortIndex()!=null?e.getSortIndex():null,s}},ColumnEventDispatcher=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnEventDispatcher"}visibleCols(){const e={type:"displayedColumnsChanged"};this.eventService.dispatchEvent(e)}gridColumns(){const e={type:"gridColumnsChanged"};this.eventService.dispatchEvent(e)}headerHeight(e){const t={type:"columnHeaderHeightChanged",column:e,columns:[e],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(t)}groupOpened(e){const t={type:"columnGroupOpened",columnGroup:e.length===1?e[0]:void 0,columnGroups:e};this.eventService.dispatchEvent(t)}rowGroupChanged(e,t){const i={type:"columnRowGroupChanged",columns:e,column:e.length===1?e[0]:null,source:t};this.eventService.dispatchEvent(i)}genericColumnEvent(e,t,i){const s={type:e,columns:t,column:t.length===1?t[0]:null,source:i};this.eventService.dispatchEvent(s)}pivotModeChanged(){const e={type:"columnPivotModeChanged"};this.eventService.dispatchEvent(e)}virtualColumnsChanged(e){const t={type:"virtualColumnsChanged",afterScroll:e};this.eventService.dispatchEvent(t)}newColumnsLoaded(e){const t={type:"newColumnsLoaded",source:e};this.eventService.dispatchEvent(t)}everythingChanged(e){const t={type:"columnEverythingChanged",source:e};this.eventService.dispatchEvent(t)}columnMoved(e){const{movedColumns:t,source:i,toIndex:s,finished:o}=e,r={type:"columnMoved",columns:t,column:t&&t.length===1?t[0]:null,toIndex:s,finished:o,source:i};this.eventService.dispatchEvent(r)}columnPinned(e,t){if(!e.length)return;const i=e.length===1?e[0]:null,s=this.getCommonValue(e,r=>r.getPinned()),o={type:"columnPinned",pinned:s??null,columns:e,column:i,source:t};this.eventService.dispatchEvent(o)}columnVisible(e,t){if(!e.length)return;const i=e.length===1?e[0]:null,o={type:"columnVisible",visible:this.getCommonValue(e,r=>r.isVisible()),columns:e,column:i,source:t};this.eventService.dispatchEvent(o)}getCommonValue(e,t){if(!e||e.length==0)return;const i=t(e[0]);for(let s=1;s<e.length;s++)if(i!==t(e[s]))return;return i}columnChanged(e,t,i){const s={type:e,columns:t,column:t&&t.length==1?t[0]:null,source:i};this.eventService.dispatchEvent(s)}columnResized(e,t,i,s=null){if(e&&e.length){const o={type:"columnResized",columns:e,column:e.length===1?e[0]:null,flexColumns:s,finished:t,source:i};this.eventService.dispatchEvent(o)}}},ColumnGetStateService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnGetStateService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService}getColumnState(){const e=this.columnModel.getColDefCols();if(_missing(e)||!this.columnModel.isAlive())return[];const i=this.columnModel.getAllCols().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(i),i}createStateItemFromColumn(e){const t=this.funcColsService.getRowGroupColumns(),i=this.funcColsService.getPivotColumns(),s=e.isRowGroupActive()?t.indexOf(e):null,o=e.isPivotActive()?i.indexOf(e):null,r=e.isValueActive()?e.getAggFunc():null,n=e.getSort()!=null?e.getSort():null,l=e.getSortIndex()!=null?e.getSortIndex():null,a=e.getFlex()!=null&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:n,sortIndex:l,aggFunc:r,rowGroup:e.isRowGroupActive(),rowGroupIndex:s,pivot:e.isPivotActive(),pivotIndex:o,flex:a}}orderColumnStateList(e){const t=this.columnModel.getCols(),i=new Map(t.map((s,o)=>[s.getColId(),o]));e.sort((s,o)=>{const r=i.has(s.colId)?i.get(s.colId):-1,n=i.has(o.colId)?i.get(o.colId):-1;return r-n})}},ColumnGroupStateService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnGroupStateService"}wireBeans(e){this.columnModel=e.columnModel,this.columnAnimationService=e.columnAnimationService,this.eventDispatcher=e.columnEventDispatcher,this.visibleColsService=e.visibleColsService}getColumnGroupState(){const e=[],t=this.columnModel.getColTree();return depthFirstOriginalTreeSearch(null,t,i=>{isProvidedColumnGroup(i)&&e.push({groupId:i.getGroupId(),open:i.isExpanded()})}),e}resetColumnGroupState(e){const t=this.columnModel.getColDefColTree();if(!t)return;const i=[];depthFirstOriginalTreeSearch(null,t,s=>{if(isProvidedColumnGroup(s)){const o=s.getColGroupDef(),r={groupId:s.getGroupId(),open:o?o.openByDefault:void 0};i.push(r)}}),this.setColumnGroupState(i,e)}setColumnGroupState(e,t){if(!this.columnModel.getColTree())return;this.columnAnimationService.start();const s=[];e.forEach(o=>{const r=o.groupId,n=o.open,l=this.columnModel.getProvidedColGroup(r);l&&l.isExpanded()!==n&&(l.setExpanded(n),s.push(l))}),this.visibleColsService.refresh(t,!0),s.length&&this.eventDispatcher.groupOpened(s),this.columnAnimationService.finish()}},ColumnViewportService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnViewportService",this.colsWithinViewport=[],this.headerColsWithinViewport=[],this.colsWithinViewportHash="",this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={}}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.eventDispatcher=e.columnEventDispatcher}postConstruct(){this.suppressColumnVirtualisation=this.gos.get("suppressColumnVirtualisation")}setScrollPosition(e,t,i=!1){const s=this.visibleColsService.isBodyWidthDirty();if(!(e===this.scrollWidth&&t===this.scrollPosition&&!s)){if(this.scrollWidth=e,this.scrollPosition=t,this.visibleColsService.setBodyWidthDirty(),this.gos.get("enableRtl")){const r=this.visibleColsService.getBodyContainerWidth();this.viewportLeft=r-this.scrollPosition-this.scrollWidth,this.viewportRight=r-this.scrollPosition}else this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition;this.columnModel.isReady()&&this.checkViewportColumns(i)}}getHeadersToRender(e,t){let i;switch(e){case"left":i=this.rowsOfHeadersToRenderLeft[t];break;case"right":i=this.rowsOfHeadersToRenderRight[t];break;default:i=this.rowsOfHeadersToRenderCenter[t];break}return i||[]}extractViewportColumns(){const e=this.visibleColsService.getCenterCols();this.isColumnVirtualisationSuppressed()?(this.colsWithinViewport=e,this.headerColsWithinViewport=e):(this.colsWithinViewport=e.filter(this.isColumnInRowViewport.bind(this)),this.headerColsWithinViewport=e.filter(this.isColumnInHeaderViewport.bind(this)))}isColumnVirtualisationSuppressed(){return this.suppressColumnVirtualisation||this.viewportRight===0}clear(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={},this.colsWithinViewportHash=""}isColumnInHeaderViewport(e){return e.isAutoHeaderHeight()?!0:this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),s=this.viewportLeft-200,o=this.viewportRight+200,r=t<s&&i<s,n=t>o&&i>o;return!r&&!n}getViewportColumns(){const e=this.visibleColsService.getLeftCols(),t=this.visibleColsService.getRightCols();return this.colsWithinViewport.concat(e).concat(t)}getColsWithinViewport(e){if(!this.columnModel.isColSpanActive())return this.colsWithinViewport;const t=o=>{const r=o.getLeft();return _exists(r)&&r>this.viewportLeft},i=this.isColumnVirtualisationSuppressed()?null:this.isColumnInRowViewport.bind(this),s=this.visibleColsService.getColsCenter();return this.visibleColsService.getColsForRow(e,s,i,t)}checkViewportColumns(e=!1){this.extractViewport()&&this.eventDispatcher.virtualColumnsChanged(e)}calculateHeaderRows(){this.rowsOfHeadersToRenderLeft={},this.rowsOfHeadersToRenderRight={},this.rowsOfHeadersToRenderCenter={};const e={},t=this.visibleColsService.getLeftCols(),i=this.visibleColsService.getRightCols();this.headerColsWithinViewport.concat(t).concat(i).forEach(r=>e[r.getId()]=!0);const o=(r,n,l)=>{let a=!1;for(let d=0;d<r.length;d++){const h=r[d];let c=!1;if(isColumn(h))c=e[h.getId()]===!0;else{const g=h.getDisplayedChildren();g&&(c=o(g,n,l+1))}c&&(a=!0,n[l]||(n[l]=[]),n[l].push(h))}return a};o(this.visibleColsService.getTreeLeft(),this.rowsOfHeadersToRenderLeft,0),o(this.visibleColsService.getTreeRight(),this.rowsOfHeadersToRenderRight,0),o(this.visibleColsService.getTreeCenter(),this.rowsOfHeadersToRenderCenter,0)}extractViewport(){const e=s=>`${s.getId()}-${s.getPinned()||"normal"}`;this.extractViewportColumns();const t=this.getViewportColumns().map(e).join("#"),i=this.colsWithinViewportHash!==t;return i&&(this.colsWithinViewportHash=t,this.calculateHeaderRows()),i}},AgComponentUtils=class extends BeanStub{constructor(){super(...arguments),this.beanName="agComponentUtils"}wireBeans(e){this.componentMetadataProvider=e.componentMetadataProvider}adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){class t{refresh(){return!1}getGui(){return this.eGui}init(s){const o=e(s),r=typeof o;if(r==="string"||r==="number"||r==="boolean"){this.eGui=_loadTemplate("<span>"+o+"</span>");return}if(o==null){this.eGui=_loadTemplate("<span></span>");return}this.eGui=o}}return t}doesImplementIComponent(e){return e?e.prototype&&"getGui"in e.prototype:!1}},ComponentMetadataProvider=class extends BeanStub{constructor(){super(...arguments),this.beanName="componentMetadataProvider"}wireBeans(e){this.agComponentUtils=e.agComponentUtils}postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel","setDisabled","onParamsUpdated","refresh"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached","onParamsUpdated","refresh"]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached","refresh"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged","refresh"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["refresh"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","getState"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]},menuItem:{mandatoryMethodList:[],optionalMethodList:["setActive","select","setExpanded","configureDefaults"]}}}retrieve(e){return this.componentMetaData[e]}},orderedCoreBeans=["rowPositionUtils","cellPositionUtils","headerPositionUtils","paginationAutoPageSizeService","apiFunctionService","gridApi","userComponentRegistry","agComponentUtils","componentMetadataProvider","resizeObserverService","userComponentFactory","rowContainerHeightService","horizontalResizeService","localeService","validationService","pinnedRowModel","dragService","visibleColsService","eventService","gos","popupService","selectionService","columnFilterService","quickFilterService","filterManager","columnModel","headerNavigationService","pageBoundsService","paginationService","pageBoundsListener","rowRenderer","expressionService","columnFactory","alignedGridsService","navigationService","valueCache","valueService","loggerFactory","autoWidthCalculator","filterMenuFactory","dragAndDropService","focusService","mouseEventService","environment","cellNavigationService","stylingService","scrollVisibleService","sortController","columnHoverService","columnAnimationService","selectableService","autoColService","changeDetectionService","animationFrameService","undoRedoService","columnDefFactory","rowCssClassCalculator","rowNodeBlockLoader","rowNodeSorter","ctrlsService","pinnedWidthService","rowNodeEventThrottle","ctrlsFactory","dataTypeService","syncService","overlayService","stateService","expansionService","apiEventService","ariaAnnouncementService","menuService","columnApplyStateService","columnEventDispatcher","columnMoveService","columnAutosizeService","columnGetStateService","columnGroupStateService","columnSizeService","funcColsService","columnNameService","columnViewportService","pivotResultColsService","showRowGroupColsService"],beanNamePosition=Object.fromEntries(orderedCoreBeans.map((e,t)=>[e,t]));function gridBeanInitComparator(e,t){const i=(e.beanName?beanNamePosition[e.beanName]:void 0)??Number.MAX_SAFE_INTEGER,s=(t.beanName?beanNamePosition[t.beanName]:void 0)??Number.MAX_SAFE_INTEGER;return i-s}function gridBeanDestroyComparator(e,t){return e?.beanName==="gridDestroyService"?-1:0}var CtrlsFactory=class extends BeanStub{constructor(){super(...arguments),this.beanName="ctrlsFactory",this.registry={}}register(e){this.registry[e.name]=e.classImp}getInstance(e,...t){const i=this.registry[e];if(i!=null)return new i(...t)}},CtrlsService=class extends BeanStub{constructor(){super(...arguments),this.beanName="ctrlsService",this.params={},this.ready=!1,this.readyCallbacks=[]}checkReady(){const e=this.params;this.ready=e.gridCtrl!=null&&e.gridBodyCtrl!=null&&e.center!=null&&e.left!=null&&e.right!=null&&e.bottomCenter!=null&&e.bottomLeft!=null&&e.bottomRight!=null&&e.topCenter!=null&&e.topLeft!=null&&e.topRight!=null&&e.stickyTopCenter!=null&&e.stickyTopLeft!=null&&e.stickyTopRight!=null&&e.stickyBottomCenter!=null&&e.stickyBottomLeft!=null&&e.stickyBottomRight!=null&&e.centerHeader!=null&&e.leftHeader!=null&&e.rightHeader!=null&&e.fakeHScrollComp!=null&&e.fakeVScrollComp!=null&&e.gridHeaderCtrl!=null,this.ready&&(this.readyCallbacks.forEach(t=>t(e)),this.readyCallbacks.length=0)}whenReady(e){this.ready?e(this.params):this.readyCallbacks.push(e)}register(e,t){this.params[e]=t,this.checkReady()}registerHeaderContainer(e,t){const i=this.params;switch(t){case"left":i.leftHeader=e;break;case"right":i.rightHeader=e;break;default:i.centerHeader=e;break}this.checkReady()}get(e){return this.params[e]}getParams(){return this.params}getGridBodyCtrl(){return this.params.gridBodyCtrl}getHeaderRowContainerCtrls(){const{leftHeader:e,centerHeader:t,rightHeader:i}=this.params;return[e,i,t]}getHeaderRowContainerCtrl(e){const t=this.params;switch(e){case"left":return t.leftHeader;case"right":return t.rightHeader;default:return t.centerHeader}}},CellPositionUtils=class extends BeanStub{constructor(){super(...arguments),this.beanName="cellPositionUtils"}createId(e){const{rowIndex:t,rowPinned:i,column:s}=e;return this.createIdFromValues({rowIndex:t,column:s,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:s}=e;return`${t}.${i??"null"}.${s.getId()}`}equals(e,t){const i=e.column===t.column,s=e.rowPinned===t.rowPinned,o=e.rowIndex===t.rowIndex;return i&&s&&o}},RowNodeEventThrottle=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowNodeEventThrottle",this.events=[]}wireBeans(e){this.animationFrameService=e.animationFrameService,this.rowModel=e.rowModel}postConstruct(){this.rowModel.getType()=="clientSide"&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e,t){if(this.clientSideRowModel==null){this.eventService.dispatchEvent(e);return}this.events.push(e);const i=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(s=>this.eventService.dispatchEvent(s)),this.events=[]};t?i():(this.dispatchExpandedDebounced==null&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(i)),this.dispatchExpandedDebounced())}},RowPositionUtils=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowPositionUtils"}wireBeans(e){this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.pageBoundsService=e.pageBoundsService}getFirstRow(){let e=0,t;return this.pinnedRowModel.getPinnedTopRowCount()?t="top":this.rowModel.getRowCount()?(t=null,e=this.pageBoundsService.getFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(t="bottom"),t===void 0?null:{rowIndex:e,rowPinned:t}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),s=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.pageBoundsService.getLastRow()):s&&(t="top",e=s-1),e===void 0?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowNodes()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowNodes()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t?!0:e&&!t||!e&&t?!1:e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned}before(e,t){switch(e.rowPinned){case"top":if(t.rowPinned!=="top")return!0;break;case"bottom":if(t.rowPinned!=="bottom")return!1;break;default:if(_exists(t.rowPinned))return t.rowPinned!=="top";break}return e.rowIndex<t.rowIndex}},ROW_HEIGHT={cssName:"--ag-row-height",changeKey:"rowHeightChanged",defaultValue:42},HEADER_HEIGHT={cssName:"--ag-header-height",changeKey:"headerHeightChanged",defaultValue:48},LIST_ITEM_HEIGHT={cssName:"--ag-list-item-height",changeKey:"listItemHeightChanged",defaultValue:24},Environment=class extends BeanStub{constructor(){super(...arguments),this.beanName="environment",this.sizeEls=new Map,this.lastKnownValues=new Map,this.themeClasses=[],this.eThemeAncestor=null,this.eMeasurementContainer=null,this.sizesMeasured=!1}wireBeans(e){this.resizeObserverService=e.resizeObserverService,this.eGridDiv=e.eGridDiv}postConstruct(){this.addManagedPropertyListener("rowHeight",()=>this.refreshRowHeightVariable()),this.themeClasses=this.getAncestorThemeClasses(),this.setUpThemeClassObservers(),this.getSizeEl(ROW_HEIGHT),this.getSizeEl(HEADER_HEIGHT),this.getSizeEl(LIST_ITEM_HEIGHT)}getDefaultRowHeight(){return this.getCSSVariablePixelValue(ROW_HEIGHT)}getDefaultHeaderHeight(){return this.getCSSVariablePixelValue(HEADER_HEIGHT)}getDefaultListItemHeight(){return this.getCSSVariablePixelValue(LIST_ITEM_HEIGHT)}hasMeasuredSizes(){return this.sizesMeasured}getThemeClasses(){return this.themeClasses}applyThemeClasses(e){for(const t of Array.from(e.classList))t.startsWith("ag-theme-")&&!this.themeClasses.includes(t)&&e.classList.remove(t);for(const t of this.themeClasses)e.classList.contains(t)||e.classList.add(t)}getThemeAncestorElement(){return this.eThemeAncestor}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gos.get("rowHeight");if(t==null||isNaN(t)||!isFinite(t))return e!==null&&this.eGridDiv.style.setProperty("--ag-line-height",null),-1;const i=`${t}px`;return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):e!=""?parseFloat(e):-1}getCSSVariablePixelValue(e){const t=this.lastKnownValues.get(e);if(t!=null)return t;const i=this.measureSizeEl(e);return i==="detached"||i==="no-styles"?e.defaultValue:(this.lastKnownValues.set(e,i),i)}measureSizeEl(e){const t=this.getSizeEl(e);if(t.offsetParent==null)return"detached";const i=t.offsetWidth;return i===NO_VALUE_SENTINEL?"no-styles":(this.sizesMeasured=!0,i)}getSizeEl(e){let t=this.sizeEls.get(e);if(t)return t;let i=this.eMeasurementContainer;i||(i=this.eMeasurementContainer=document.createElement("div"),i.className="ag-measurement-container",this.eGridDiv.appendChild(i)),t=document.createElement("div"),t.style.width=`var(${e.cssName}, ${NO_VALUE_SENTINEL}px)`,i.appendChild(t),this.sizeEls.set(e,t);let s=this.measureSizeEl(e);s==="no-styles"&&_warnOnce(`no value for ${e.cssName}. This usually means that the grid has been initialised before styles have been loaded. The default value of ${e.defaultValue} will be used and updated when styles load.`);const o=this.resizeObserverService.observeResize(t,()=>{const r=this.measureSizeEl(e);r==="detached"||r==="no-styles"||(this.lastKnownValues.set(e,r),r!==s&&(s=r,this.fireGridStylesChangedEvent(e.changeKey)))});return this.addDestroyFunc(()=>o()),t}fireGridStylesChangedEvent(e){const t={type:"gridStylesChanged",[e]:!0};this.eventService.dispatchEvent(t)}setUpThemeClassObservers(){const e=new MutationObserver(()=>{const i=this.getAncestorThemeClasses();arraysEqual(i,this.themeClasses)||(this.themeClasses=i,this.fireGridStylesChangedEvent("themeChanged"))});let t=this.eGridDiv;for(;t;)e.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]}),t=t.parentElement}getAncestorThemeClasses(){let e=this.eGridDiv;const t=[];for(this.eThemeAncestor=null;e;){const i=Array.from(e.classList).filter(s=>s.startsWith("ag-theme-"));for(const s of i)this.eThemeAncestor=e,t.includes(s)||t.unshift(s);e=e.parentElement}return Object.freeze(t)}},arraysEqual=(e,t)=>e.length===t.length&&e.findIndex((i,s)=>e[s]!==t[s])===-1,NO_VALUE_SENTINEL=15538,EventService=class extends BeanStub{constructor(){super(...arguments),this.beanName="eventService",this.globalEventService=new LocalEventService}wireBeans(e){this.globalEventListener=e.globalEventListener,this.globalSyncEventListener=e.globalSyncEventListener}postConstruct(){if(this.globalEventListener){const e=this.gos.useAsyncEvents();this.addGlobalListener(this.globalEventListener,e)}this.globalSyncEventListener&&this.addGlobalListener(this.globalSyncEventListener,!1)}addEventListener(e,t,i){this.globalEventService.addEventListener(e,t,i)}removeEventListener(e,t,i){this.globalEventService.removeEventListener(e,t,i)}addGlobalListener(e,t=!1){this.globalEventService.addGlobalListener(e,t)}removeGlobalListener(e,t=!1){this.globalEventService.removeGlobalListener(e,t)}dispatchLocalEvent(){}dispatchEvent(e){this.globalEventService.dispatchEvent(this.gos.addGridCommonParams(e))}dispatchEventOnce(e){this.globalEventService.dispatchEventOnce(this.gos.addGridCommonParams(e))}},_FocusService=class D extends BeanStub{constructor(){super(...arguments),this.beanName="focusService"}wireBeans(t){this.eGridDiv=t.eGridDiv,this.columnModel=t.columnModel,this.visibleColsService=t.visibleColsService,this.headerNavigationService=t.headerNavigationService,this.headerPositionUtils=t.headerPositionUtils,this.rowRenderer=t.rowRenderer,this.rowPositionUtils=t.rowPositionUtils,this.cellPositionUtils=t.cellPositionUtils,this.navigationService=t.navigationService,this.ctrlsService=t.ctrlsService,this.filterManager=t.filterManager,this.rangeService=t.rangeService,this.advancedFilterService=t.advancedFilterService}static addKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",D.toggleKeyboardMode),t.addEventListener("mousedown",D.toggleKeyboardMode))}static removeKeyboardModeEvents(t){this.instanceCount>0||(t.addEventListener("keydown",D.toggleKeyboardMode),t.addEventListener("mousedown",D.toggleKeyboardMode))}static toggleKeyboardMode(t){const i=D.keyboardModeActive,s=t.type==="keydown";s&&(t.ctrlKey||t.metaKey||t.altKey)||i!==s&&(D.keyboardModeActive=s)}static unregisterGridCompController(t){D.removeKeyboardModeEvents(t)}postConstruct(){const t=this.clearFocusedCell.bind(this);this.addManagedEventListeners({columnPivotModeChanged:t,newColumnsLoaded:this.onColumnEverythingChanged.bind(this),columnGroupOpened:t,columnRowGroupChanged:t}),this.registerKeyboardFocusEvents(),this.ctrlsService.whenReady(i=>{this.gridCtrl=i.gridCtrl})}registerKeyboardFocusEvents(){const t=this.gos.getDocument();D.addKeyboardModeEvents(t),D.instanceCount++,this.addDestroyFunc(()=>{D.instanceCount--,D.unregisterGridCompController(t)})}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const t=this.focusedCellPosition.column,i=this.columnModel.getCol(t.getId());t!==i&&this.clearFocusedCell()}isKeyboardMode(){return D.keyboardModeActive}getFocusCellToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),RowCtrl.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){return this.gos.get("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(this.gos.getActiveDomElement(),AbstractHeaderCellCtrl.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(t,i){let s=t;for(;s;){if(this.gos.getDomData(s,i))return!1;s=s.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(t){return this.isCellRestoreFocused(t)?(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0):!1}isCellRestoreFocused(t){return this.restoredFocusedCellPosition==null?!1:this.cellPositionUtils.equals(t,this.restoredFocusedCellPosition)}setRestoreFocusedCell(t){this.getFrameworkOverrides().renderingEngine==="react"&&(this.restoredFocusedCellPosition=t)}getFocusEventParams(){const{rowIndex:t,rowPinned:i,column:s}=this.focusedCellPosition,o={rowIndex:t,rowPinned:i,column:s,isFullWidthCell:!1},r=this.rowRenderer.getRowByPosition({rowIndex:t,rowPinned:i});return r&&(o.isFullWidthCell=r.isFullWidth()),o}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,this.focusedCellPosition==null)return;const t={type:"cellFocusCleared",...this.getFocusEventParams()};this.focusedCellPosition=null,this.eventService.dispatchEvent(t)}setFocusedCell(t){const{column:i,rowIndex:s,rowPinned:o,forceBrowserFocus:r=!1,preventScrollOnBrowserFocus:n=!1}=t,l=this.columnModel.getCol(i);if(!l){this.focusedCellPosition=null;return}this.focusedCellPosition=l?{rowIndex:s,rowPinned:_makeNull(o),column:l}:null;const a={type:"cellFocused",...this.getFocusEventParams(),forceBrowserFocus:r,preventScrollOnBrowserFocus:n};this.eventService.dispatchEvent(a)}isCellFocused(t){return this.focusedCellPosition==null?!1:this.cellPositionUtils.equals(t,this.focusedCellPosition)}isRowNodeFocused(t){return this.isRowFocused(t.rowIndex,t.rowPinned)}isHeaderWrapperFocused(t){if(this.focusedHeaderPosition==null)return!1;const i=t.getColumnGroupChild(),s=t.getRowIndex(),o=t.getPinned(),{column:r,headerRowIndex:n}=this.focusedHeaderPosition;return i===r&&s===n&&o==r.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(t,i){this.focusedHeaderPosition={headerRowIndex:t,column:i}}focusHeaderPosition(t){if(this.gos.get("suppressHeaderFocus"))return!1;const{direction:i,fromTab:s,allowUserOverride:o,event:r,fromCell:n,rowWithoutSpanValue:l}=t;let{headerPosition:a}=t;if(n&&this.filterManager?.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(a);if(o){const d=this.getFocusedHeader(),h=this.headerNavigationService.getHeaderRowCount();if(s){const c=this.gos.getCallback("tabToNextHeader");c&&(a=this.getHeaderPositionFromUserFunc({userFunc:c,direction:i,currentPosition:d,headerPosition:a,headerRowCount:h}))}else{const c=this.gos.getCallback("navigateToNextHeader");if(c&&r){const u={key:r.key,previousHeaderPosition:d,nextHeaderPosition:a,headerRowCount:h,event:r};a=c(u)}}}return a?this.focusProvidedHeaderPosition({headerPosition:a,direction:i,event:r,fromCell:n,rowWithoutSpanValue:l}):!1}focusHeaderPositionFromUserFunc(t){if(this.gos.get("suppressHeaderFocus"))return!1;const{userFunc:i,headerPosition:s,direction:o,event:r}=t,n=this.getFocusedHeader(),l=this.headerNavigationService.getHeaderRowCount(),a=this.getHeaderPositionFromUserFunc({userFunc:i,direction:o,currentPosition:n,headerPosition:s,headerRowCount:l});return!!a&&this.focusProvidedHeaderPosition({headerPosition:a,direction:o,event:r})}getHeaderPositionFromUserFunc(t){const{userFunc:i,direction:s,currentPosition:o,headerPosition:r,headerRowCount:n}=t,a=i({backwards:s==="Before",previousHeaderPosition:o,nextHeaderPosition:r,headerRowCount:n});return a===!0||a===null?(a===null&&_warnOnce("Since v31.3 Returning `null` from tabToNextHeader is deprecated. Return `true` to stay on the current header, or `false` to let the browser handle the tab behaviour."),o):a===!1?null:a}focusProvidedHeaderPosition(t){const{headerPosition:i,direction:s,fromCell:o,rowWithoutSpanValue:r,event:n}=t,{column:l,headerRowIndex:a}=i;if(a===-1)return this.filterManager?.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(i):this.focusGridView(l);this.headerNavigationService.scrollToColumn(l,s);const h=this.ctrlsService.getHeaderRowContainerCtrl(l.getPinned()).focusHeader(i.headerRowIndex,l,n);return h&&(r!=null||o)&&this.headerNavigationService.setCurrentHeaderRowWithoutSpan(r??-1),h}focusFirstHeader(){let t=this.visibleColsService.getAllCols()[0];if(!t)return!1;t.getParent()&&(t=this.visibleColsService.getColGroupAtLevel(t,0));const i=this.headerPositionUtils.getHeaderIndexToFocus(t,0);return this.focusHeaderPosition({headerPosition:i,rowWithoutSpanValue:0})}focusLastHeader(t){const i=this.headerNavigationService.getHeaderRowCount()-1,s=_last(this.visibleColsService.getAllCols());return this.focusHeaderPosition({headerPosition:{headerRowIndex:i,column:s},rowWithoutSpanValue:-1,event:t})}focusPreviousFromFirstCell(t){return this.filterManager?.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(t)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(t,i){return this.focusedCellPosition==null?!1:this.focusedCellPosition.rowIndex===t&&this.focusedCellPosition.rowPinned===_makeNull(i)}findFocusableElements(t,i,s=!1){const o=FOCUSABLE_SELECTOR;let r=FOCUSABLE_EXCLUDE;i&&(r+=", "+i),s&&(r+=', [tabindex="-1"]');const n=Array.prototype.slice.apply(t.querySelectorAll(o)).filter(d=>_isVisible(d)),l=Array.prototype.slice.apply(t.querySelectorAll(r));return l.length?((d,h)=>d.filter(c=>h.indexOf(c)===-1))(n,l):n}focusInto(t,i=!1,s=!1){const o=this.findFocusableElements(t,null,s),r=i?_last(o):o[0];return r?(r.focus({preventScroll:!0}),!0):!1}findFocusableElementBeforeTabGuard(t,i){if(!i)return null;const s=this.findFocusableElements(t),o=s.indexOf(i);if(o===-1)return null;let r=-1;for(let n=o-1;n>=0;n--)if(s[n].classList.contains("ag-tab-guard-top")){r=n;break}return r<=0?null:s[r-1]}findNextFocusableElement(t=this.eGridDiv,i,s){const o=this.findFocusableElements(t,i?':not([tabindex="-1"])':null),r=this.gos.getActiveDomElement();let n;i?n=o.findIndex(a=>a.contains(r)):n=o.indexOf(r);const l=n+(s?-1:1);return l<0||l>=o.length?null:o[l]}isTargetUnderManagedComponent(t,i){if(!i)return!1;const s=t.querySelectorAll(`.${ManagedFocusFeature.FOCUS_MANAGED_CLASS}`);if(!s.length)return!1;for(let o=0;o<s.length;o++)if(s[o].contains(i))return!0;return!1}findTabbableParent(t,i=5){let s=0;for(;t&&_getTabIndex(t)===null&&++s<=i;)t=t.parentElement;return _getTabIndex(t)===null?null:t}focusGridView(t,i){if(this.gos.get("suppressCellFocus"))return i?this.gos.get("suppressHeaderFocus")?this.focusNextGridCoreContainer(!0,!0):this.focusLastHeader():this.focusNextGridCoreContainer(!1);const s=i?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!s)return!1;const{rowIndex:o,rowPinned:r}=s,n=this.getFocusedHeader();return!t&&n&&(t=n.column),o==null||!t?!1:(this.navigationService.ensureCellVisible({rowIndex:o,column:t,rowPinned:r}),this.setFocusedCell({rowIndex:o,column:t,rowPinned:_makeNull(r),forceBrowserFocus:!0}),this.rangeService?.setRangeToCell({rowIndex:o,rowPinned:r,column:t}),!0)}focusNextGridCoreContainer(t,i=!1){return!i&&this.gridCtrl.focusNextInnerContainer(t)?!0:((i||!t&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(t),!1)}focusAdvancedFilter(t){return this.advancedFilterFocusColumn=t?.column,this.advancedFilterService?.getCtrl().focusHeaderComp()??!1}focusNextFromAdvancedFilter(t,i){const s=(i?void 0:this.advancedFilterFocusColumn)??this.visibleColsService.getAllCols()?.[0];return t?this.focusHeaderPosition({headerPosition:{column:s,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(s)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}addFocusableContainer(t){this.gridCtrl.addFocusableContainer(t)}removeFocusableContainer(t){this.gridCtrl.removeFocusableContainer(t)}focusGridInnerElement(t){return this.gridCtrl.focusInnerElement(t)}};_FocusService.keyboardModeActive=!1,_FocusService.instanceCount=0;var FocusService=_FocusService,PinnedWidthService=class extends BeanStub{constructor(){super(...arguments),this.beanName="pinnedWidthService"}wireBeans(e){this.visibleColsService=e.visibleColsService}postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedEventListeners({displayedColumnsChanged:e,displayedColumnsWidthChanged:e}),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=this.gos.isDomLayout("print"),t=e?0:this.visibleColsService.getColsLeftWidth(),i=e?0:this.visibleColsService.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:"leftPinnedWidthChanged"})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:"rightPinnedWidthChanged"}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}},GridCtrl=class extends BeanStub{constructor(){super(...arguments),this.additionalFocusableContainers=new Set}wireBeans(e){this.beans=e,this.focusService=e.focusService,this.visibleColsService=e.visibleColsService}setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.gridId);const{dragAndDropService:s,mouseEventService:o,ctrlsService:r,resizeObserverService:n}=this.beans;s.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:a=>a===1||a===0,getIconName:()=>"notAllowed"}),o.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new LayoutFeature(this.view)),this.addRtlSupport();const l=n.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>l()),r.register("gridCtrl",this)}isDetailGrid(){return this.focusService.findTabbableParent(this.getGui())?.getAttribute("row-id")?.startsWith("detail")||!1}getOptionalSelectors(){const e=this.beans;return{paginationSelector:e.paginationService?.getPaginationSelector(),gridHeaderDropZonesSelector:e.columnDropZonesService?.getDropZoneSelector(),sideBarSelector:e.sideBarService?.getSideBarSelector(),statusBarSelector:e.statusBarService?.getStatusPanelSelector(),watermarkSelector:e.licenseManager?.getWatermarkSelector()}}onGridSizeChanged(){const e={type:"gridSizeChanged",clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(e)}addRtlSupport(){const e=this.gos.get("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(e)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.getFocusableContainers(),i=this.gos.getActiveDomElement(),s=t.findIndex(r=>r.getGui().contains(i)),o=s+(e?-1:1);if(o<0||o>=t.length)return!1;if(o===0){if(s>0){const r=this.visibleColsService.getAllCols(),n=_last(r);if(this.focusService.focusGridView(n,!0))return!0}return!1}return this.focusContainer(t[o],e)}focusInnerElement(e){const t=this.getFocusableContainers(),i=this.visibleColsService.getAllCols(),s=this.gos.getCallback("focusGridInnerElement");if(s&&s({fromBottom:!!e}))return!0;if(e){if(t.length>1)return this.focusContainer(_last(t),!0);const o=_last(i);if(this.focusService.focusGridView(o,!0))return!0}if(this.gos.get("headerHeight")===0||this.gos.get("suppressHeaderFocus")){if(this.focusService.focusGridView(i[0]))return!0;for(let o=1;o<t.length;o++)if(this.focusService.focusInto(t[o].getGui()))return!0;return!1}return this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}addFocusableContainer(e){this.additionalFocusableContainers.add(e)}removeFocusableContainer(e){this.additionalFocusableContainers.delete(e)}focusContainer(e,t){e?.setAllowFocus?.(!0);const i=this.focusService.focusInto(e.getGui(),t);return e?.setAllowFocus?.(!1),i}getFocusableContainers(){return[...this.view.getFocusableContainers(),...this.additionalFocusableContainers.values()]}destroy(){this.additionalFocusableContainers.clear(),super.destroy()}},GridComp=class extends TabGuardComp{constructor(e){super(),this.gridBody=RefPlaceholder,this.sideBar=RefPlaceholder,this.pagination=RefPlaceholder,this.rootWrapperBody=RefPlaceholder,this.eGridDiv=e}postConstruct(){const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:r=>this.addCssClass(r),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:r=>{this.getGui().style.userSelect=r??"",this.getGui().style.webkitUserSelect=r??""},setCursor:r=>{this.getGui().style.cursor=r??""}},t=this.createManagedBean(new GridCtrl),i=t.getOptionalSelectors(),s=this.createTemplate(i),o=[GridBodySelector,...Object.values(i).filter(r=>!!r)];this.setTemplate(s,o),t.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>t.focusInnerElement(r),forceFocusOutWhenTabGuardsAreEmpty:!0})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{this.eGridDiv.removeChild(e),this.gos.get("debug")&&_log("Grid removed from DOM")})}updateLayoutClasses(e,t){const i=this.rootWrapperBody.classList;i.toggle("ag-layout-auto-height",t.autoHeight),i.toggle("ag-layout-normal",t.normal),i.toggle("ag-layout-print",t.print),this.addOrRemoveCssClass("ag-layout-auto-height",t.autoHeight),this.addOrRemoveCssClass("ag-layout-normal",t.normal),this.addOrRemoveCssClass("ag-layout-print",t.print)}createTemplate(e){const t=e.gridHeaderDropZonesSelector?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":"",i=e.sideBarSelector?'<ag-side-bar data-ref="sideBar"></ag-side-bar>':"",s=e.statusBarSelector?"<ag-status-bar></ag-status-bar>":"",o=e.watermarkSelector?"<ag-watermark></ag-watermark>":"",r=e.paginationSelector?'<ag-pagination data-ref="pagination"></ag-pagination>':"";return`<div class="ag-root-wrapper" role="presentation">
|
|
156
156
|
${t}
|
|
157
157
|
<div class="ag-root-wrapper-body" data-ref="rootWrapperBody" role="presentation">
|
|
158
158
|
<ag-grid-body data-ref="gridBody"></ag-grid-body>
|
|
@@ -162,7 +162,7 @@ To run logic when the grid is about to be destroyed use the gridPreDestroy event
|
|
|
162
162
|
${r}
|
|
163
163
|
${o}
|
|
164
164
|
</div>`}getFocusableElement(){return this.rootWrapperBody}forceFocusOutOfContainer(e=!1){if(!e&&this.pagination?.isDisplayed()){this.pagination.forceFocusOutOfContainer(e);return}super.forceFocusOutOfContainer(e)}getFocusableContainers(){const e=[this.gridBody];return[this.sideBar,this.pagination].forEach(t=>{t&&e.push(t)}),e.filter(t=>_isVisible(t.getGui()))}},AlignedGridsService=class extends BeanStub{constructor(){super(...arguments),this.beanName="alignedGridsService",this.consuming=!1}wireBeans(e){this.columnModel=e.columnModel,this.columnSizeService=e.columnSizeService,this.ctrlsService=e.ctrlsService,this.columnApplyStateService=e.columnApplyStateService}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";typeof e=="function"&&(e=e());const i=()=>`See ${this.getFrameworkOverrides().getDocLink("aligned-grids")}`;return e.map(o=>{if(!o){_errorOnce("alignedGrids contains an undefined option."),t||_errorOnce(`You may want to configure via a callback to avoid setup race conditions:
|
|
165
|
-
"alignedGrids: () => [linkedGrid]"`),_errorOnce(i());return}if(this.isGridApi(o))return o;const r=o;return"current"in r?r.current?.api:(r.api||_errorOnce(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${i()}`),r.api)}).filter(o=>!!o&&!o.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach(t=>{t.isDestroyed()||t.dispatchEvent(e)})}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){const t={type:"alignedGridColumn",event:e};this.fireEvent(t)}fireScrollEvent(e){if(e.direction!=="horizontal")return;const t={type:"alignedGridScroll",event:e};this.fireEvent(t)}onScrollEvent(e){this.onEvent(()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}getMasterColumns(e){const t=[];return e.columns?e.columns.forEach(i=>{t.push(i)}):e.column&&t.push(e.column),t}getColumnIds(e){const t=[];return e.columns?e.columns.forEach(i=>{t.push(i.getColId())}):e.column&&t.push(e.column.getColId()),t}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{const t=e;this.processColumnEvent(t);break}case"columnGroupOpened":{const t=e;this.processGroupOpenedEvent(t);break}case"columnPivotChanged":_warnOnce("pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.");break}})}processGroupOpenedEvent(e){e.columnGroups.forEach(t=>{let i=null;if(t){const s=t.getGroupId();i=this.columnModel.getProvidedColGroup(s)}t&&!i||this.columnModel.setColumnGroupOpened(i,t.isExpanded(),"alignedGridChanged")})}processColumnEvent(e){const t=e.column;let i=null;if(t&&(i=this.columnModel.getColDefCol(t.getColId())),t&&!i)return;const s=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const l=e.api.getColumnState().map(a=>({colId:a.colId}));this.columnApplyStateService.applyColumnState({state:l,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const l=e.api.getColumnState().map(a=>({colId:a.colId,hide:a.hide}));this.columnApplyStateService.applyColumnState({state:l},"alignedGridChanged")}break;case"columnPinned":{const l=e.api.getColumnState().map(a=>({colId:a.colId,pinned:a.pinned}));this.columnApplyStateService.applyColumnState({state:l},"alignedGridChanged")}break;case"columnResized":{const n=e,l={};s.forEach(a=>{l[a.getId()]={key:a.getColId(),newWidth:a.getActualWidth()}}),n.flexColumns?.forEach(a=>{l[a.getId()]&&delete l[a.getId()]}),this.columnSizeService.setColumnWidths(Object.values(l),!1,n.finished,"alignedGridChanged");break}}const r=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach(n=>{n.setGridOption("alwaysShowVerticalScroll",r)})}},AlignedGridsModule={version:VERSION,moduleName:"@ag-grid-community/aligned-grid",beans:[AlignedGridsService]};function getColumnDef(e,t){const i=e.columnModel.getColDefCol(t);return i?i.getColDef():null}function getColumnDefs(e){return e.columnModel.getColumnDefs()}function sizeColumnsToFit(e,t){typeof t=="number"?e.columnSizeService.sizeColumnsToFit(t,"api"):e.ctrlsService.getGridBodyCtrl().sizeColumnsToFit(t)}function setColumnGroupOpened(e,t,i){e.columnModel.setColumnGroupOpened(t,i,"api")}function getColumnGroup(e,t,i){return e.visibleColsService.getColumnGroup(t,i)}function getProvidedColumnGroup(e,t){return e.columnModel.getProvidedColGroup(t)}function getDisplayNameForColumn(e,t,i){return e.columnNameService.getDisplayNameForColumn(t,i)||""}function getDisplayNameForColumnGroup(e,t,i){return e.columnNameService.getDisplayNameForColumnGroup(t,i)||""}function getColumn(e,t){return e.columnModel.getColDefCol(t)}function getColumns(e){return e.columnModel.getColDefCols()}function applyColumnState(e,t){return e.columnApplyStateService.applyColumnState(t,"api")}function getColumnState(e){return e.columnGetStateService.getColumnState()}function resetColumnState(e){e.columnApplyStateService.resetColumnState("api")}function getColumnGroupState(e){return e.columnGroupStateService.getColumnGroupState()}function setColumnGroupState(e,t){e.columnGroupStateService.setColumnGroupState(t,"api")}function resetColumnGroupState(e){e.columnGroupStateService.resetColumnGroupState("api")}function isPinning(e){return e.visibleColsService.isPinningLeft()||e.visibleColsService.isPinningRight()}function isPinningLeft(e){return e.visibleColsService.isPinningLeft()}function isPinningRight(e){return e.visibleColsService.isPinningRight()}function getDisplayedColAfter(e,t){return e.visibleColsService.getColAfter(t)}function getDisplayedColBefore(e,t){return e.visibleColsService.getColBefore(t)}function setColumnVisible(e,t,i){e.columnModel.setColsVisible([t],i,"api")}function setColumnsVisible(e,t,i){e.columnModel.setColsVisible(t,i,"api")}function setColumnPinned(e,t,i){e.columnModel.setColsPinned([t],i,"api")}function setColumnsPinned(e,t,i){e.columnModel.setColsPinned(t,i,"api")}function getAllGridColumns(e){return e.columnModel.getCols()}function getDisplayedLeftColumns(e){return e.visibleColsService.getLeftCols()}function getDisplayedCenterColumns(e){return e.visibleColsService.getCenterCols()}function getDisplayedRightColumns(e){return e.visibleColsService.getRightCols()}function getAllDisplayedColumns(e){return e.visibleColsService.getAllCols()}function getAllDisplayedVirtualColumns(e){return e.columnViewportService.getViewportColumns()}function moveColumn(e,t,i){e.columnMoveService.moveColumns([t],i,"api")}function moveColumnByIndex(e,t,i){e.columnMoveService.moveColumnByIndex(t,i,"api")}function moveColumns2(e,t,i){e.columnMoveService.moveColumns(t,i,"api")}function setColumnWidth(e,t,i,s=!0,o="api"){e.columnSizeService.setColumnWidths([{key:t,newWidth:i}],!1,s,o)}function setColumnWidths(e,t,i=!0,s="api"){e.columnSizeService.setColumnWidths(t,!1,i,s)}function getLeftDisplayedColumnGroups(e){return e.visibleColsService.getTreeLeft()}function getCenterDisplayedColumnGroups(e){return e.visibleColsService.getTreeCenter()}function getRightDisplayedColumnGroups(e){return e.visibleColsService.getTreeRight()}function getAllDisplayedColumnGroups(e){return e.visibleColsService.getAllTrees()}function autoSizeColumn(e,t,i){return e.columnAutosizeService.autoSizeCols({colKeys:[t],skipHeader:i,source:"api"})}function autoSizeColumns(e,t,i){e.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"api"})}function autoSizeAllColumns(e,t){e.columnAutosizeService.autoSizeAllColumns("api",t)}var MONTH_LOCALE_TEXT={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},MONTH_KEYS=["january","february","march","april","may","june","july","august","september","october","november","december"],DataTypeService=class extends BeanStub{constructor(){super(...arguments),this.beanName="dataTypeService",this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}wireBeans(e){this.rowModel=e.rowModel,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.columnApplyStateService=e.columnApplyStateService}postConstruct(){this.groupHideOpenParents=this.gos.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",()=>{this.groupHideOpenParents=this.gos.get("groupHideOpenParents")}),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(convertSourceType(e.source))})}processDataTypeDefinitions(){const e=this.getDefaultDataTypes();this.dataTypeDefinitions={},this.formatValueFuncs={};const t=s=>o=>{const{column:r,node:n,value:l}=o;let a=r.getColDef().valueFormatter;return a===s.groupSafeValueFormatter&&(a=s.valueFormatter),this.valueService.formatValue(r,n,l,a)};Object.entries(e).forEach(([s,o])=>{const r={...o,groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)};this.dataTypeDefinitions[s]=r,this.formatValueFuncs[s]=t(r)});const i=this.gos.get("dataTypeDefinitions")??{};this.dataTypeMatchers={},Object.entries(i).forEach(([s,o])=>{const r=this.processDataTypeDefinition(o,i,[s],e);r&&(this.dataTypeDefinitions[s]=r,o.dataTypeMatcher&&(this.dataTypeMatchers[s]=o.dataTypeMatcher),this.formatValueFuncs[s]=t(r))}),this.checkObjectValueHandlers(e),["dateString","text","number","boolean","date"].forEach(s=>{const o=this.dataTypeMatchers[s];o&&delete this.dataTypeMatchers[s],this.dataTypeMatchers[s]=o??e[s].dataTypeMatcher})}mergeDataTypeDefinitions(e,t){const i={...e,...t};return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...convertColumnTypes(e.columnTypes),...convertColumnTypes(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,s){let o;const r=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let n=s[r];const l=t[r];if(n&&l&&(n=l),!this.validateDataTypeDefinition(e,n,r))return;o=this.mergeDataTypeDefinitions(n,e)}else{if(i.includes(r)){_warnOnce('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');return}const n=t[r];if(!this.validateDataTypeDefinition(e,n,r))return;const l=this.processDataTypeDefinition(n,t,[...i,r],s);if(!l)return;o=this.mergeDataTypeDefinitions(l,e)}return{...o,groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)}}validateDataTypeDefinition(e,t,i){return t?t.baseDataType!==e.baseDataType?(_warnOnce('The "baseDataType" property of a data type definition must match that of its parent.'),!1):!0:(_warnOnce(`The data type definition ${i} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{if(t.node?.group){const i=t.column.getAggFunc();if(i){if(i==="first"||i==="last")return e.valueFormatter(t);if(e.baseDataType==="number"&&i!=="count"){if(typeof t.value=="number")return e.valueFormatter(t);if(typeof t.value=="object"){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter({...t,value:t.value.toNumber()});if("value"in t.value)return e.valueFormatter({...t,value:t.value.value})}}}if(!this.gos.get("suppressGroupMaintainValueType"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()){if(typeof t.value!="string"||e.dataTypeMatcher?.(t.value))return e.valueFormatter(t);if(!this.gos.get("suppressGroupMaintainValueType"))return}return e.valueFormatter(t)}}updateColDefAndGetColumnType(e,t,i){let{cellDataType:s}=t;const{field:o}=t;if(s===void 0&&(s=e.cellDataType),(s==null||s===!0)&&(s=this.canInferCellDataType(e,t)?this.inferCellDataType(o,i):!1),!s){e.cellDataType=!1;return}const r=this.dataTypeDefinitions[s];if(!r){_warnOnce(`Missing data type definition - "${s}"`);return}return e.cellDataType=s,r.groupSafeValueFormatter&&(e.valueFormatter=r.groupSafeValueFormatter),r.valueParser&&(e.valueParser=r.valueParser),r.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,s,r,i),r.columnTypes}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=s=>{t.add(s.key)};e.addEventListener("columnStateUpdated",i),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.removeEventListener("columnStateUpdated",i))}canInferCellDataType(e,t){if(this.rowModel.getType()!=="clientSide")return!1;const i={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,i))return!1;const s=t.type===null?e.type:t.type;if(s){const o=this.gos.get("columnTypes")??{};if(convertColumnTypes(s).some(n=>{const l=o[n.trim()];return l&&this.doColDefPropsPreventInference(l,i)}))return!1}return!this.doColDefPropsPreventInference(e,i)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([i,s])=>this.doesColDefPropPreventInference(e,t,i,s))}doesColDefPropPreventInference(e,t,i,s){if(!t[i])return!1;const o=e[i];return o===null?(t[i]=!1,!1):s===void 0?!!o:o===s}inferCellDataType(e,t){if(!e)return;let i;const s=this.getInitialData();if(s){const r=e.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");i=_getValueUsingField(s,e,r)}else this.initWaitForRowData(t);if(i==null)return;const[o]=Object.entries(this.dataTypeMatchers).find(([r,n])=>n(i))??["object"];return o}getInitialData(){const e=this.gos.get("rowData");if(e?.length)return e[0];if(this.initialData)return this.initialData;{const t=this.rowModel.getRootNode().allLeafChildren;if(t?.length)return t[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const[i]=this.addManagedEventListeners({rowDataUpdateStarted:s=>{const{firstRowData:o}=s;if(!o)return;i?.(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(o,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations();const r={type:"dataTypesInferred"};this.eventService.dispatchEvent(r)}})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.destroyColumnStateUpdateListeners();const s={},o={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([r,n])=>{const l=this.columnModel.getCol(r);if(!l)return;const a=l.getColDef();if(!this.columnModel.resetColDefIntoCol(l,"cellDataTypeInferred"))return;const d=l.getColDef();if(t&&d.type&&d.type!==a.type){const h=this.getUpdatedColumnState(l,n);h.rowGroup&&h.rowGroupIndex==null&&(s[r]=h),h.pivot&&h.pivotIndex==null&&(o[r]=h),i.push(h)}}),t&&i.push(...this.funcColsService.generateColumnStateForRowGroupAndPivotIndexes(s,o)),i.length&&this.columnApplyStateService.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnApplyStateService.getColumnStateFromColDef(e);return t.forEach(s=>{delete i[s],s==="rowGroup"?delete i.rowGroupIndex:s==="pivot"&&delete i.pivotIndex}),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}getDateStringTypeDefinition(e){return e?this.getDataTypeDefinition(e)??this.dataTypeDefinitions.dateString:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){return this.getDataTypeDefinition(e)?.baseDataType}checkType(e,t){if(t==null)return!0;const i=this.getDataTypeDefinition(e)?.dataTypeMatcher;return i?i(t):!0}validateColDef(e){e.cellDataType==="object"&&(e.valueFormatter===this.dataTypeDefinitions.object.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&_warnOnce('Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"'),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&_warnOnce('Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"'))}getFormatValue(e){return this.formatValueFuncs[e]}setColDefPropertiesForBaseDataType(e,t,i,s){const o=this.formatValueFuncs[t],r=ModuleRegistry.__isRegistered("@ag-grid-enterprise/set-filter",this.gridId),n=this.localeService.getLocaleTextFunc(),l=a=>{const{filterParams:d}=e;e.filterParams=typeof d=="object"?{...d,...a}:a};switch(i.baseDataType){case"number":{e.cellEditor="agNumberCellEditor",r&&l({comparator:(a,d)=>{const h=a==null?0:parseInt(a),c=d==null?0:parseInt(d);return h===c?0:h>c?1:-1}});break}case"boolean":{e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=a=>!!a.colDef.editable&&a.event.key===KeyCode.SPACE,l(r?{valueFormatter:a=>_exists(a.value)?n(String(a.value),a.value?"True":"False"):n("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(a,d)=>d,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(a,d)=>d===!1,numberOfInputs:0}]});break}case"date":{e.cellEditor="agDateCellEditor",e.keyCreator=o,r&&l({valueFormatter:a=>{const d=o(a);return _exists(d)?d:n("blanks","(Blanks)")},treeList:!0,treeListFormatter:(a,d)=>{if(d===1&&a!=null){const h=MONTH_KEYS[Number(a)-1];return n(h,MONTH_LOCALE_TEXT[h])}return a??n("blanks","(Blanks)")}});break}case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=o;const a=i.dateParser;l(r?{valueFormatter:d=>{const h=o(d);return _exists(h)?h:n("blanks","(Blanks)")},treeList:!0,treeListPathGetter:d=>{const h=a(d??void 0);return h?[String(h.getFullYear()),String(h.getMonth()+1),String(h.getDate())]:null},treeListFormatter:(d,h)=>{if(h===1&&d!=null){const c=MONTH_KEYS[Number(d)-1];return n(c,MONTH_LOCALE_TEXT[c])}return d??n("blanks","(Blanks)")}}:{comparator:(d,h)=>{const c=a(h);return h==null||c<d?-1:c>d?1:0}});break}case"object":{e.cellEditorParams={useFormatter:!0},e.comparator=(a,d)=>{const h=this.columnModel.getColDefCol(s),c=h?.getColDef();if(!h||!c)return 0;const u=a==null?"":o({column:h,node:null,value:a}),g=d==null?"":o({column:h,node:null,value:d});return u===g?0:u>g?1:-1},e.keyCreator=o,r?l({valueFormatter:a=>{const d=o(a);return _exists(d)?d:n("blanks","(Blanks)")}}):e.filterValueGetter=a=>o({column:a.column,node:a.node,value:this.valueService.getValue(a.column,a.node)});break}}}getDefaultDataTypes(){const e=i=>!!i.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:i=>i.newValue?.trim?.()===""?null:Number(i.newValue),valueFormatter:i=>i.value==null?"":typeof i.value!="number"||isNaN(i.value)?t("invalidNumber","Invalid Number"):String(i.value),dataTypeMatcher:i=>typeof i=="number"},text:{baseDataType:"text",valueParser:i=>i.newValue===""?null:_toStringOrNull(i.newValue),dataTypeMatcher:i=>typeof i=="string"},boolean:{baseDataType:"boolean",valueParser:i=>i.newValue==null?i.newValue:i.newValue?.trim?.()===""?null:String(i.newValue).toLowerCase()==="true",valueFormatter:i=>i.value==null?"":String(i.value),dataTypeMatcher:i=>typeof i=="boolean"},date:{baseDataType:"date",valueParser:i=>_parseDateTimeFromString(i.newValue==null?null:String(i.newValue)),valueFormatter:i=>i.value==null?"":!(i.value instanceof Date)||isNaN(i.value.getTime())?t("invalidDate","Invalid Date"):_serialiseDate(i.value,!1)??"",dataTypeMatcher:i=>i instanceof Date},dateString:{baseDataType:"dateString",dateParser:i=>_parseDateTimeFromString(i)??void 0,dateFormatter:i=>_serialiseDate(i??null,!1)??void 0,valueParser:i=>e(String(i.newValue))?i.newValue:null,valueFormatter:i=>e(String(i.value))?i.value:"",dataTypeMatcher:i=>typeof i=="string"&&e(i)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:i=>_toStringOrNull(i.value)??""}}}destroyColumnStateUpdateListeners(){this.columnStateUpdateListenerDestroyFuncs.forEach(e=>e()),this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}},DataTypeModule={version:VERSION,moduleName:"@ag-grid-community/data-type",beans:[DataTypeService]},ColumnApiModule={version:VERSION,moduleName:"@ag-grid-community/column-api",apiFunctions:{getColumnDef,getColumnDefs,sizeColumnsToFit,setColumnGroupOpened,getColumnGroup,getProvidedColumnGroup,getDisplayNameForColumn,getDisplayNameForColumnGroup,getColumn,getColumns,applyColumnState,getColumnState,resetColumnState,getColumnGroupState,setColumnGroupState,resetColumnGroupState,isPinning,isPinningLeft,isPinningRight,getDisplayedColAfter,getDisplayedColBefore,setColumnVisible,setColumnsVisible,setColumnPinned,setColumnsPinned,getAllGridColumns,getDisplayedLeftColumns,getDisplayedCenterColumns,getDisplayedRightColumns,getAllDisplayedColumns,getAllDisplayedVirtualColumns,moveColumn,moveColumnByIndex,moveColumns:moveColumns2,setColumnWidth,setColumnWidths,getLeftDisplayedColumnGroups,getCenterDisplayedColumnGroups,getRightDisplayedColumnGroups,getAllDisplayedColumnGroups,autoSizeColumn,autoSizeColumns,autoSizeAllColumns}};function addRowDropZone(e,t){e.ctrlsService.getGridBodyCtrl().getRowDragFeature().addRowDropZone(t)}function removeRowDropZone(e,t){const i=e.dragAndDropService.findExternalZone(t);i&&e.dragAndDropService.removeDropTarget(i)}function getRowDropZoneParams(e,t){return e.ctrlsService.getGridBodyCtrl().getRowDragFeature().getRowDropZone(t)}var DragApiModule={version:VERSION,moduleName:"@ag-grid-community/drag-api",apiFunctions:{addRowDropZone,removeRowDropZone,getRowDropZoneParams}};function getPinnedTopRowCount(e){return e.pinnedRowModel.getPinnedTopRowCount()}function getPinnedBottomRowCount(e){return e.pinnedRowModel.getPinnedBottomRowCount()}function getPinnedTopRow(e,t){return e.pinnedRowModel.getPinnedTopRow(t)}function getPinnedBottomRow(e,t){return e.pinnedRowModel.getPinnedBottomRow(t)}var PinnedRowApiModule={version:VERSION,moduleName:"@ag-grid-community/pinned-row-api",apiFunctions:{getPinnedTopRowCount,getPinnedBottomRowCount,getPinnedTopRow,getPinnedBottomRow}};function showLoadingOverlay(e){e.overlayService.showLoadingOverlay()}function showNoRowsOverlay(e){e.overlayService.showNoRowsOverlay()}function hideOverlay(e){e.overlayService.hideOverlay()}var OverlayApiModule={version:VERSION,moduleName:"@ag-grid-community/overlay-api",apiFunctions:{showLoadingOverlay,showNoRowsOverlay,hideOverlay}};function setGridAriaProperty(e,t,i){if(!t)return;const s=e.ctrlsService.getGridBodyCtrl().getGui(),o=`aria-${t}`;i===null?s.removeAttribute(o):s.setAttribute(o,i)}function refreshCells(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function flashCells(e,t={}){const i=s=>_warnOnce(`Since v31.1 api.flashCells parameter '${s}Delay' is deprecated. Please use '${s}Duration' instead.`);_exists(t.fadeDelay)&&i("fade"),_exists(t.flashDelay)&&i("flash"),e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.flashCells(t))}function refreshHeader(e){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getHeaderRowContainerCtrls().forEach(t=>t.refresh()))}function isAnimationFrameQueueEmpty(e){return e.animationFrameService.isQueueEmpty()}function flushAllAnimationFrames(e){e.animationFrameService.flushAllFrames()}function getSizesForCurrentTheme(e){return{rowHeight:e.gos.getRowHeightAsNumber(),headerHeight:e.columnModel.getHeaderHeight()}}function getCellRendererInstances(e,t={}){return e.rowRenderer.getCellRendererInstances(t).map(_unwrapUserComp)}var RenderApiModule={version:VERSION,moduleName:"@ag-grid-community/render-api",apiFunctions:{setGridAriaProperty,refreshCells,flashCells,refreshHeader,isAnimationFrameQueueEmpty,flushAllAnimationFrames,getSizesForCurrentTheme,getCellRendererInstances}};function expireValueCache(e){e.valueCache.expire()}function getValue(e,t,i){return getCellValue(e,{colKey:t,rowNode:i})}function getCellValue(e,t){const{colKey:i,rowNode:s,useFormatter:o}=t,r=e.columnModel.getColDefCol(i)??e.columnModel.getCol(i);if(_missing(r))return null;const n=e.valueService.getValue(r,s);return o?e.valueService.formatValue(r,s,n)??_escapeString(n,!0):n}function getGridId(e){return e.context.getGridId()}function destroy(e){e.gridDestroyService.destroy()}function isDestroyed(e){return e.gridDestroyService.isDestroyCalled()}function getGridOption(e,t){return e.gos.get(t)}function setGridOption(e,t,i){updateGridOptions(e,{[t]:i})}function updateGridOptions(e,t){e.gos.updateGridOptions({options:t})}function addEventListener(e,t,i){e.apiEventService.addEventListener(t,i)}function removeEventListener(e,t,i){e.apiEventService.removeEventListener(t,i)}function addGlobalListener(e,t){e.apiEventService.addGlobalListener(t)}function removeGlobalListener(e,t){e.apiEventService.removeGlobalListener(t)}function getFocusedCell(e){return e.focusService.getFocusedCell()}function clearFocusedCell(e){return e.focusService.clearFocusedCell()}function setFocusedCell(e,t,i,s){e.focusService.setFocusedCell({rowIndex:t,column:i,rowPinned:s,forceBrowserFocus:!0})}function tabToNextCell(e,t){return e.navigationService.tabToNextCell(!1,t)}function tabToPreviousCell(e,t){return e.navigationService.tabToNextCell(!0,t)}function setFocusedHeader(e,t,i=!1){const s=e.headerNavigationService.getHeaderPositionForColumn(t,i);s&&e.focusService.focusHeaderPosition({headerPosition:s})}function showColumnMenuAfterButtonClick(e,t,i){const s=e.columnModel.getCol(t);e.menuService.showColumnMenu({column:s,buttonElement:i,positionBy:"button"})}function showColumnMenuAfterMouseClick(e,t,i){let s=e.columnModel.getCol(t);if(s||(s=e.columnModel.getColDefCol(t)),!s){_errorOnce(`column '${t}' not found`);return}e.menuService.showColumnMenu({column:s,mouseEvent:i,positionBy:"mouse"})}function showColumnMenu(e,t){const i=e.columnModel.getCol(t);if(!i){_errorOnce(`column '${t}' not found`);return}e.menuService.showColumnMenu({column:i,positionBy:"auto"})}function hidePopupMenu(e){e.menuService.hidePopupMenu()}function redrawRows(e,t={}){const i=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(i))}function setRowNodeExpanded(e,t,i,s,o){e.expansionService.setRowNodeExpanded(t,i,s,o)}function getRowNode(e,t){return e.rowModel.getRowNode(t)}function addRenderedRowListener(e,t,i,s){e.rowRenderer.addRenderedRowListener(t,i,s)}function getRenderedNodes(e){return e.rowRenderer.getRenderedNodes()}function forEachNode(e,t,i){e.rowModel.forEachNode(t,i)}function getFirstDisplayedRow(e){return getFirstDisplayedRowIndex(e)}function getFirstDisplayedRowIndex(e){return e.rowRenderer.getFirstVirtualRenderedRow()}function getLastDisplayedRow(e){return getLastDisplayedRowIndex(e)}function getLastDisplayedRowIndex(e){return e.rowRenderer.getLastVirtualRenderedRow()}function getDisplayedRowAtIndex(e,t){return e.rowModel.getRow(t)}function getDisplayedRowCount(e){return e.rowModel.getRowCount()}function getModel(e){return e.rowModel}function setNodesSelected(e,t){if(!t.nodes.every(l=>l.rowPinned?(_warnOnce("cannot select pinned rows"),!1):l.id===void 0?(_warnOnce("cannot select node until id for node is known"),!1):!0))return;const{nodes:s,source:o,newValue:r}=t,n=s;e.selectionService.setNodesSelected({nodes:n,source:o??"api",newValue:r})}function selectAll(e,t="apiSelectAll"){e.selectionService.selectAllRowNodes({source:t})}function deselectAll(e,t="apiSelectAll"){e.selectionService.deselectAllRowNodes({source:t})}function selectAllFiltered(e,t="apiSelectAllFiltered"){e.selectionService.selectAllRowNodes({source:t,justFiltered:!0})}function deselectAllFiltered(e,t="apiSelectAllFiltered"){e.selectionService.deselectAllRowNodes({source:t,justFiltered:!0})}function selectAllOnCurrentPage(e,t="apiSelectAllCurrentPage"){e.selectionService.selectAllRowNodes({source:t,justCurrentPage:!0})}function deselectAllOnCurrentPage(e,t="apiSelectAllCurrentPage"){e.selectionService.deselectAllRowNodes({source:t,justCurrentPage:!0})}function getSelectedNodes(e){return e.selectionService.getSelectedNodes()}function getSelectedRows(e){return e.selectionService.getSelectedRows()}function onSortChanged(e){e.sortController.onSortChanged("api")}var CoreApiModule={version:VERSION,moduleName:"@ag-grid-community/core-api",apiFunctions:{getGridId,destroy,isDestroyed,getGridOption,setGridOption,updateGridOptions}},RowSelectionApiModule={version:VERSION,moduleName:"@ag-grid-community/row-selection-api",apiFunctions:{setNodesSelected,selectAll,deselectAll,selectAllFiltered,deselectAllFiltered,selectAllOnCurrentPage,deselectAllOnCurrentPage,getSelectedNodes,getSelectedRows}},RowApiModule={version:VERSION,moduleName:"@ag-grid-community/row-api",apiFunctions:{redrawRows,setRowNodeExpanded,getRowNode,addRenderedRowListener,getRenderedNodes,forEachNode,getFirstDisplayedRow,getFirstDisplayedRowIndex,getLastDisplayedRow,getLastDisplayedRowIndex,getDisplayedRowAtIndex,getDisplayedRowCount,getModel}},ScrollApiModule={version:VERSION,moduleName:"@ag-grid-community/scroll-api",apiFunctions:{getVerticalPixelRange,getHorizontalPixelRange,ensureColumnVisible,ensureIndexVisible,ensureNodeVisible}},KeyboardNavigationApiModule={version:VERSION,moduleName:"@ag-grid-community/keyboard-navigation-api",apiFunctions:{getFocusedCell,clearFocusedCell,setFocusedCell,setFocusedHeader,tabToNextCell,tabToPreviousCell}},EventApiModule={version:VERSION,moduleName:"@ag-grid-community/event-api",apiFunctions:{addEventListener,addGlobalListener,removeEventListener,removeGlobalListener}},CellApiModule={version:VERSION,moduleName:"@ag-grid-community/cell-api",apiFunctions:{expireValueCache,getValue,getCellValue}},CommunityMenuApiModule={version:VERSION,moduleName:"@ag-grid-community/menu-api",apiFunctions:{showColumnMenuAfterButtonClick,showColumnMenuAfterMouseClick,showColumnMenu,hidePopupMenu}},SortApiModule={version:VERSION,moduleName:"@ag-grid-community/sort-api",apiFunctions:{onSortChanged}},CommunityApiModule={version:VERSION,moduleName:"@ag-grid-community/api",dependantModules:[CoreApiModule,PinnedRowApiModule,RowSelectionApiModule,ColumnApiModule,RowApiModule,DragApiModule,ScrollApiModule,OverlayApiModule,KeyboardNavigationApiModule,EventApiModule,RenderApiModule,CellApiModule,CommunityMenuApiModule,SortApiModule]};function getState(e){return e.stateService?.getState()??{}}var StateService=class extends BeanStub{constructor(){super(...arguments),this.beanName="stateService",this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=_debounce(()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=_debounce(()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),0),this.onRowSelectedDebounced=_debounce(()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}wireBeans(e){this.filterManager=e.filterManager,this.ctrlsService=e.ctrlsService,this.pivotResultColsService=e.pivotResultColsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnGroupStateService=e.columnGroupStateService,this.columnGetStateService=e.columnGetStateService,this.paginationService=e.paginationService,this.rowModel=e.rowModel,this.selectionService=e.selectionService,this.expansionService=e.expansionService,this.columnAnimationService=e.columnAnimationService,this.columnApplyStateService=e.columnApplyStateService,this.sideBarService=e.sideBarService,this.rangeService=e.rangeService}postConstruct(){this.isClientSideRowModel=this.rowModel.getType()==="clientSide",this.cachedState=this.gos.get("initialState")??{},this.ctrlsService.whenReady(()=>this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnGridReady()));const[e,t,i]=this.addManagedEventListeners({newColumnsLoaded:({source:s})=>{s==="gridInitializing"&&(e(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnColumnsInitialised()))},rowCountReady:()=>{t?.(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnRowCountReady())},firstDataRendered:()=>{i?.(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnFirstDataRendered())}})}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState());const e=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:e,sideBarUpdated:e})}setupStateOnColumnsInitialised(){const e=this.gos.get("initialState")??{};this.setColumnState(e),this.setColumnGroupState(e),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.addManagedEventListeners({columnValueChanged:()=>this.updateColumnState(["aggregation"]),columnMoved:()=>this.updateColumnState(["columnOrder"]),columnPinned:()=>this.updateColumnState(["columnPinning"]),columnResized:()=>this.updateColumnState(["columnSizing"]),columnVisible:()=>this.updateColumnState(["columnVisibility"]),columnPivotChanged:()=>this.updateColumnState(["pivot"]),columnPivotModeChanged:()=>this.updateColumnState(["pivot"]),columnRowGroupChanged:()=>this.updateColumnState(["rowGroup"]),sortChanged:()=>this.updateColumnState(["sort"]),newColumnsLoaded:()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setupStateOnRowCountReady(){const{filter:e,rowGroupExpansion:t,rowSelection:i,pagination:s}=this.gos.get("initialState")??{},o=this.gos.get("advancedFilterModel");(e||o)&&this.setFilterState(e,o),t&&this.setRowGroupExpansionState(t),i&&this.setRowSelectionState(i),s&&this.setPaginationState(s),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState()),this.addManagedEventListeners({filterChanged:()=>this.updateCachedState("filter",this.getFilterState()),rowGroupOpened:()=>this.onRowGroupOpenedDebounced(),expandOrCollapseAll:()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())}})}setupStateOnFirstDataRendered(){const{scroll:e,rangeSelection:t,focusedCell:i,columnOrder:s}=this.gos.get("initialState")??{};i&&this.setFocusedCellState(i),t&&this.setRangeSelectionState(t),e&&this.setScrollState(e),this.setColumnPivotState(!!s?.orderedColIds),this.updateCachedState("sideBar",this.getSideBarState()),this.updateCachedState("focusedCell",this.getFocusedCellState()),this.updateCachedState("rangeSelection",this.getRangeSelectionState()),this.updateCachedState("scroll",this.getScrollState()),this.addManagedEventListeners({cellFocused:()=>this.updateCachedState("focusedCell",this.getFocusedCellState()),rangeSelectionChanged:o=>{o.finished&&this.updateCachedState("rangeSelection",this.getRangeSelectionState())},bodyScrollEnd:()=>this.updateCachedState("scroll",this.getScrollState())})}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],i=[],s=[],o=[],r=[],n=[],l=[],a=[],d=[],h=this.columnGetStateService.getColumnState();for(let c=0;c<h.length;c++){const{colId:u,sort:g,sortIndex:p,rowGroup:m,rowGroupIndex:f,aggFunc:v,pivot:C,pivotIndex:w,pinned:y,hide:F,width:S,flex:R}=h[c];d.push(u),g&&(t[p??0]={colId:u,sort:g}),m&&(i[f??0]=u),typeof v=="string"&&s.push({colId:u,aggFunc:v}),C&&(o[w??0]=u),y&&(y==="right"?n:r).push(u),F&&l.push(u),(R||S)&&a.push({colId:u,flex:R??void 0,width:S})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:i.length?{groupColIds:i}:void 0,aggregation:s.length?{aggregationModel:s}:void 0,pivot:o.length||e?{pivotMode:e,pivotColIds:o}:void 0,columnPinning:r.length||n.length?{leftColIds:r,rightColIds:n}:void 0,columnVisibility:l.length?{hiddenColIds:l}:void 0,columnSizing:a.length?{columnSizingModel:a}:void 0,columnOrder:d.length?{orderedColIds:d}:void 0}}setColumnState(e){const{sort:t,rowGroup:i,aggregation:s,pivot:o,columnPinning:r,columnVisibility:n,columnSizing:l,columnOrder:a}=e,d={},h=p=>{let m=d[p];return m||(m={colId:p},d[p]=m,m)};t&&t.sortModel.forEach(({colId:p,sort:m},f)=>{const v=h(p);v.sort=m,v.sortIndex=f}),i&&i.groupColIds.forEach((p,m)=>{const f=h(p);f.rowGroup=!0,f.rowGroupIndex=m}),s&&s.aggregationModel.forEach(({colId:p,aggFunc:m})=>{h(p).aggFunc=m}),o&&(o.pivotColIds.forEach((p,m)=>{const f=h(p);f.pivot=!0,f.pivotIndex=m}),this.gos.updateGridOptions({options:{pivotMode:o.pivotMode},source:"gridInitializing"})),r&&(r.leftColIds.forEach(p=>{h(p).pinned="left"}),r.rightColIds.forEach(p=>{h(p).pinned="right"})),n&&n.hiddenColIds.forEach(p=>{h(p).hide=!0}),l&&l.columnSizingModel.forEach(({colId:p,flex:m,width:f})=>{const v=h(p);v.flex=m??null,v.width=f});const c=a?.orderedColIds,u=!!c?.length,g=u?c.map(p=>h(p)):Object.values(d);if(g.length){this.columnStates=g;const p={sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null};this.columnApplyStateService.applyColumnState({state:g,applyOrder:u,defaultState:p},"gridInitializing")}}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;if(this.columnGroupStates=void 0,!!this.pivotResultColsService.isPivotResultColsPresent()){if(t){const s=[];for(const o of t)this.pivotResultColsService.getPivotResultCol(o.colId)&&s.push(o);this.columnApplyStateService.applyColumnState({state:s,applyOrder:e},"gridInitializing")}i&&this.columnGroupStateService.setColumnGroupState(i,"gridInitializing")}}getColumnGroupState(){const e=this.columnGroupStateService.getColumnGroupState(),t=[];return e.forEach(({groupId:i,open:s})=>{s&&t.push(i)}),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){if(!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const t=new Set(e.columnGroup?.openColumnGroupIds),s=this.columnGroupStateService.getColumnGroupState().map(({groupId:o})=>{const r=t.has(o);return r&&t.delete(o),{groupId:o,open:r}});t.forEach(o=>{s.push({groupId:o,open:!0})}),s.length&&(this.columnGroupStates=s),this.columnGroupStateService.setColumnGroupState(s,"gridInitializing")}getFilterState(){let e=this.filterManager?.getFilterModel();e&&Object.keys(e).length===0&&(e=void 0);const t=this.filterManager?.getAdvancedFilterModel()??void 0;return e||t?{filterModel:e,advancedFilterModel:t}:void 0}setFilterState(e,t){const{filterModel:i,advancedFilterModel:s}=e??{advancedFilterModel:t};i&&this.filterManager?.setFilterModel(i,"columnFilter"),s&&this.filterManager?.setAdvancedFilterModel(s)}getRangeSelectionState(){const e=this.rangeService?.getCellRanges().map(t=>{const{id:i,type:s,startRow:o,endRow:r,columns:n,startColumn:l}=t;return{id:i,type:s,startRow:o,endRow:r,colIds:n.map(a=>a.getColId()),startColId:l.getColId()}});return e?.length?{cellRanges:e}:void 0}setRangeSelectionState(e){if(!this.gos.get("enableRangeSelection")||!this.rangeService)return;const t=[];e.cellRanges.forEach(i=>{const s=[];if(i.colIds.forEach(r=>{const n=this.columnModel.getCol(r);n&&s.push(n)}),!s.length)return;let o=this.columnModel.getCol(i.startColId);if(!o){const r=this.visibleColsService.getAllCols(),n=new Set(s);o=r.find(l=>n.has(l))}t.push({...i,columns:s,startColumn:o})}),this.rangeService.setCellRanges(t)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.ctrlsService.getGridBodyCtrl()?.getScrollFeature(),{left:t}=e?.getHScrollPosition()??{left:0},{top:i}=e?.getVScrollPosition()??{top:0};return i||t?{top:i,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:i}=e;this.ctrlsService.getGridBodyCtrl()?.getScrollFeature().setScrollPosition(t,i)}getSideBarState(){return this.sideBarService?.getSideBarComp()?.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:i,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:i,rowPinned:s}=e;this.focusService.setFocusedCell({column:this.columnModel.getCol(t),rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){if(!this.paginationService)return;const e=this.paginationService.getCurrentPage(),t=this.gos.get("paginationAutoPageSize")?void 0:this.paginationService.getPageSize();if(!(!e&&!t))return{page:e,pageSize:t}}setPaginationState(e){this.paginationService&&(e.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationService.setPageSize(e.pageSize,"initialState"),typeof e.page=="number"&&this.paginationService.setPage(e.page))}getRowSelectionState(){const e=this.selectionService.getSelectionState();return!e||!Array.isArray(e)&&(e.selectAll===!1||e.selectAllChildren===!1)&&!e?.toggledNodes?.length?void 0:e}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let i=!1;Object.entries(t).forEach(([s,o])=>{_jsonEquals(o,this.cachedState[s])||(i=!0)}),this.cachedState={...this.cachedState,...t},i&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const i=this.cachedState[e];this.setCachedStateValue(e,t),_jsonEquals(t,i)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){this.staleStateKeys.forEach(e=>{switch(e){case"rowSelection":this.setCachedStateValue(e,this.getRowSelectionState());break}}),this.staleStateKeys.clear()}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach(t=>this.queuedUpdateSources.add(t)),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear();const t={type:"stateUpdated",sources:e,state:this.cachedState};this.eventService.dispatchEvent(t)}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))})}},StateCoreModule={version:VERSION,moduleName:"@ag-grid-community/state-core",beans:[StateService]},StateApiModule={version:VERSION,moduleName:"@ag-grid-community/state-api",apiFunctions:{getState},dependantModules:[StateCoreModule]},StateModule={version:VERSION,moduleName:"@ag-grid-community/state",dependantModules:[StateCoreModule,StateApiModule]};function paginationIsLastPageFound(e){return e.rowModel.isLastRowIndexKnown()}function paginationGetPageSize(e){return e.paginationService?.getPageSize()??100}function paginationGetCurrentPage(e){return e.paginationService?.getCurrentPage()??0}function paginationGetTotalPages(e){return e.paginationService?.getTotalPages()??1}function paginationGetRowCount(e){return e.paginationService?e.paginationService.getMasterRowCount():e.rowModel.getRowCount()}function paginationGoToNextPage(e){e.paginationService?.goToNextPage()}function paginationGoToPreviousPage(e){e.paginationService?.goToPreviousPage()}function paginationGoToFirstPage(e){e.paginationService?.goToFirstPage()}function paginationGoToLastPage(e){e.paginationService?.goToLastPage()}function paginationGoToPage(e,t){e.paginationService?.goToPage(t)}var PaginationAutoPageSizeService=class extends BeanStub{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.paginationService.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const i=Math.max(this.gos.getRowHeightAsNumber(),1),s=Math.floor(e/i);this.paginationService.setPageSize(s,"autoCalculated")};this.isBodyRendered?_debounce(()=>t(),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};function _addFocusableContainerListener(e,t,i){e.addManagedElementListeners(t,{keydown:s=>{if(!s.defaultPrevented&&s.key===KeyCode.TAB){const o=s.shiftKey;i.findNextFocusableElement(t,!1,o)||i.focusNextGridCoreContainer(o)&&s.preventDefault()}}})}var PageSizeSelectorComp=class extends Component{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationService.getPageSize()||(this.paginationService.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.paginationService=e.paginationService}postConstruct(){this.addManagedPropertyListener("paginationPageSizeSelector",()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!e?.newPageSize)return;const t=this.paginationService.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp&&this.appendChild(this.selectPageSizeComp))}reset(){_clearElement(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get("paginationPageSizeSelector")!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationService.getPageSize(),i=!t||!e.includes(t);i&&(e.unshift(""),_warnOnce(`The paginationPageSize grid option is set to a value that is not in the list of page size options.
|
|
165
|
+
"alignedGrids: () => [linkedGrid]"`),_errorOnce(i());return}if(this.isGridApi(o))return o;const r=o;return"current"in r?r.current?.api:(r.api||_errorOnce(`alignedGrids - No api found on the linked grid. If you are passing gridOptions to alignedGrids since v31 this is no longer valid. ${i()}`),r.api)}).filter(o=>!!o&&!o.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){this.consuming||this.getAlignedGridApis().forEach(t=>{t.isDestroyed()||t.dispatchEvent(e)})}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){const t={type:"alignedGridColumn",event:e};this.fireEvent(t)}fireScrollEvent(e){if(e.direction!=="horizontal")return;const t={type:"alignedGridScroll",event:e};this.fireEvent(t)}onScrollEvent(e){this.onEvent(()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}getMasterColumns(e){const t=[];return e.columns?e.columns.forEach(i=>{t.push(i)}):e.column&&t.push(e.column),t}getColumnIds(e){const t=[];return e.columns?e.columns.forEach(i=>{t.push(i.getColId())}):e.column&&t.push(e.column.getColId()),t}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{const t=e;this.processColumnEvent(t);break}case"columnGroupOpened":{const t=e;this.processGroupOpenedEvent(t);break}case"columnPivotChanged":_warnOnce("pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.");break}})}processGroupOpenedEvent(e){e.columnGroups.forEach(t=>{let i=null;if(t){const s=t.getGroupId();i=this.columnModel.getProvidedColGroup(s)}t&&!i||this.columnModel.setColumnGroupOpened(i,t.isExpanded(),"alignedGridChanged")})}processColumnEvent(e){const t=e.column;let i=null;if(t&&(i=this.columnModel.getColDefCol(t.getColId())),t&&!i)return;const s=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const l=e.api.getColumnState().map(a=>({colId:a.colId}));this.columnApplyStateService.applyColumnState({state:l,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const l=e.api.getColumnState().map(a=>({colId:a.colId,hide:a.hide}));this.columnApplyStateService.applyColumnState({state:l},"alignedGridChanged")}break;case"columnPinned":{const l=e.api.getColumnState().map(a=>({colId:a.colId,pinned:a.pinned}));this.columnApplyStateService.applyColumnState({state:l},"alignedGridChanged")}break;case"columnResized":{const n=e,l={};s.forEach(a=>{l[a.getId()]={key:a.getColId(),newWidth:a.getActualWidth()}}),n.flexColumns?.forEach(a=>{l[a.getId()]&&delete l[a.getId()]}),this.columnSizeService.setColumnWidths(Object.values(l),!1,n.finished,"alignedGridChanged");break}}const r=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing();this.getAlignedGridApis().forEach(n=>{n.setGridOption("alwaysShowVerticalScroll",r)})}},AlignedGridsModule={version:VERSION,moduleName:"@ag-grid-community/aligned-grid",beans:[AlignedGridsService]};function getColumnDef(e,t){const i=e.columnModel.getColDefCol(t);return i?i.getColDef():null}function getColumnDefs(e){return e.columnModel.getColumnDefs()}function sizeColumnsToFit(e,t){typeof t=="number"?e.columnSizeService.sizeColumnsToFit(t,"api"):e.ctrlsService.getGridBodyCtrl().sizeColumnsToFit(t)}function setColumnGroupOpened(e,t,i){e.columnModel.setColumnGroupOpened(t,i,"api")}function getColumnGroup(e,t,i){return e.visibleColsService.getColumnGroup(t,i)}function getProvidedColumnGroup(e,t){return e.columnModel.getProvidedColGroup(t)}function getDisplayNameForColumn(e,t,i){return e.columnNameService.getDisplayNameForColumn(t,i)||""}function getDisplayNameForColumnGroup(e,t,i){return e.columnNameService.getDisplayNameForColumnGroup(t,i)||""}function getColumn(e,t){return e.columnModel.getColDefCol(t)}function getColumns(e){return e.columnModel.getColDefCols()}function applyColumnState(e,t){return e.columnApplyStateService.applyColumnState(t,"api")}function getColumnState(e){return e.columnGetStateService.getColumnState()}function resetColumnState(e){e.columnApplyStateService.resetColumnState("api")}function getColumnGroupState(e){return e.columnGroupStateService.getColumnGroupState()}function setColumnGroupState(e,t){e.columnGroupStateService.setColumnGroupState(t,"api")}function resetColumnGroupState(e){e.columnGroupStateService.resetColumnGroupState("api")}function isPinning(e){return e.visibleColsService.isPinningLeft()||e.visibleColsService.isPinningRight()}function isPinningLeft(e){return e.visibleColsService.isPinningLeft()}function isPinningRight(e){return e.visibleColsService.isPinningRight()}function getDisplayedColAfter(e,t){return e.visibleColsService.getColAfter(t)}function getDisplayedColBefore(e,t){return e.visibleColsService.getColBefore(t)}function setColumnVisible(e,t,i){e.columnModel.setColsVisible([t],i,"api")}function setColumnsVisible(e,t,i){e.columnModel.setColsVisible(t,i,"api")}function setColumnPinned(e,t,i){e.columnModel.setColsPinned([t],i,"api")}function setColumnsPinned(e,t,i){e.columnModel.setColsPinned(t,i,"api")}function getAllGridColumns(e){return e.columnModel.getCols()}function getDisplayedLeftColumns(e){return e.visibleColsService.getLeftCols()}function getDisplayedCenterColumns(e){return e.visibleColsService.getCenterCols()}function getDisplayedRightColumns(e){return e.visibleColsService.getRightCols()}function getAllDisplayedColumns(e){return e.visibleColsService.getAllCols()}function getAllDisplayedVirtualColumns(e){return e.columnViewportService.getViewportColumns()}function moveColumn(e,t,i){e.columnMoveService.moveColumns([t],i,"api")}function moveColumnByIndex(e,t,i){e.columnMoveService.moveColumnByIndex(t,i,"api")}function moveColumns2(e,t,i){e.columnMoveService.moveColumns(t,i,"api")}function setColumnWidth(e,t,i,s=!0,o="api"){e.columnSizeService.setColumnWidths([{key:t,newWidth:i}],!1,s,o)}function setColumnWidths(e,t,i=!0,s="api"){e.columnSizeService.setColumnWidths(t,!1,i,s)}function getLeftDisplayedColumnGroups(e){return e.visibleColsService.getTreeLeft()}function getCenterDisplayedColumnGroups(e){return e.visibleColsService.getTreeCenter()}function getRightDisplayedColumnGroups(e){return e.visibleColsService.getTreeRight()}function getAllDisplayedColumnGroups(e){return e.visibleColsService.getAllTrees()}function autoSizeColumn(e,t,i){return e.columnAutosizeService.autoSizeCols({colKeys:[t],skipHeader:i,source:"api"})}function autoSizeColumns(e,t,i){e.columnAutosizeService.autoSizeCols({colKeys:t,skipHeader:i,source:"api"})}function autoSizeAllColumns(e,t){e.columnAutosizeService.autoSizeAllColumns("api",t)}var MONTH_LOCALE_TEXT={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},MONTH_KEYS=["january","february","march","april","may","june","july","august","september","october","november","december"],DataTypeService=class extends BeanStub{constructor(){super(...arguments),this.beanName="dataTypeService",this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}wireBeans(e){this.rowModel=e.rowModel,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.columnApplyStateService=e.columnApplyStateService}postConstruct(){this.groupHideOpenParents=this.gos.get("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",()=>{this.groupHideOpenParents=this.gos.get("groupHideOpenParents")}),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",e=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs(convertSourceType(e.source))})}processDataTypeDefinitions(){const e=this.getDefaultDataTypes();this.dataTypeDefinitions={},this.formatValueFuncs={};const t=s=>o=>{const{column:r,node:n,value:l}=o;let a=r.getColDef().valueFormatter;return a===s.groupSafeValueFormatter&&(a=s.valueFormatter),this.valueService.formatValue(r,n,l,a)};Object.entries(e).forEach(([s,o])=>{const r={...o,groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)};this.dataTypeDefinitions[s]=r,this.formatValueFuncs[s]=t(r)});const i=this.gos.get("dataTypeDefinitions")??{};this.dataTypeMatchers={},Object.entries(i).forEach(([s,o])=>{const r=this.processDataTypeDefinition(o,i,[s],e);r&&(this.dataTypeDefinitions[s]=r,o.dataTypeMatcher&&(this.dataTypeMatchers[s]=o.dataTypeMatcher),this.formatValueFuncs[s]=t(r))}),this.checkObjectValueHandlers(e),["dateString","text","number","boolean","date"].forEach(s=>{const o=this.dataTypeMatchers[s];o&&delete this.dataTypeMatchers[s],this.dataTypeMatchers[s]=o??e[s].dataTypeMatcher})}mergeDataTypeDefinitions(e,t){const i={...e,...t};return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...convertColumnTypes(e.columnTypes),...convertColumnTypes(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,s){let o;const r=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){let n=s[r];const l=t[r];if(n&&l&&(n=l),!this.validateDataTypeDefinition(e,n,r))return;o=this.mergeDataTypeDefinitions(n,e)}else{if(i.includes(r)){_warnOnce('Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.');return}const n=t[r];if(!this.validateDataTypeDefinition(e,n,r))return;const l=this.processDataTypeDefinition(n,t,[...i,r],s);if(!l)return;o=this.mergeDataTypeDefinitions(l,e)}return{...o,groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)}}validateDataTypeDefinition(e,t,i){return t?t.baseDataType!==e.baseDataType?(_warnOnce('The "baseDataType" property of a data type definition must match that of its parent.'),!1):!0:(_warnOnce(`The data type definition ${i} does not exist.`),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{if(t.node?.group){const i=t.column.getAggFunc();if(i){if(i==="first"||i==="last")return e.valueFormatter(t);if(e.baseDataType==="number"&&i!=="count"){if(typeof t.value=="number")return e.valueFormatter(t);if(typeof t.value=="object"){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter({...t,value:t.value.toNumber()});if("value"in t.value)return e.valueFormatter({...t,value:t.value.value})}}}if(!this.gos.get("suppressGroupMaintainValueType"))return}else if(this.groupHideOpenParents&&t.column.isRowGroupActive()){if(typeof t.value!="string"||e.dataTypeMatcher?.(t.value))return e.valueFormatter(t);if(!this.gos.get("suppressGroupMaintainValueType"))return}return e.valueFormatter(t)}}updateColDefAndGetColumnType(e,t,i){let{cellDataType:s}=t;const{field:o}=t;if(s===void 0&&(s=e.cellDataType),(s==null||s===!0)&&(s=this.canInferCellDataType(e,t)?this.inferCellDataType(o,i):!1),!s){e.cellDataType=!1;return}const r=this.dataTypeDefinitions[s];if(!r){_warnOnce(`Missing data type definition - "${s}"`);return}return e.cellDataType=s,r.groupSafeValueFormatter&&(e.valueFormatter=r.groupSafeValueFormatter),r.valueParser&&(e.valueParser=r.valueParser),r.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,s,r,i),r.columnTypes}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=s=>{t.add(s.key)};e.addEventListener("columnStateUpdated",i),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.removeEventListener("columnStateUpdated",i))}canInferCellDataType(e,t){if(this.rowModel.getType()!=="clientSide")return!1;const i={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,i))return!1;const s=t.type===null?e.type:t.type;if(s){const o=this.gos.get("columnTypes")??{};if(convertColumnTypes(s).some(n=>{const l=o[n.trim()];return l&&this.doColDefPropsPreventInference(l,i)}))return!1}return!this.doColDefPropsPreventInference(e,i)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([i,s])=>this.doesColDefPropPreventInference(e,t,i,s))}doesColDefPropPreventInference(e,t,i,s){if(!t[i])return!1;const o=e[i];return o===null?(t[i]=!1,!1):s===void 0?!!o:o===s}inferCellDataType(e,t){if(!e)return;let i;const s=this.getInitialData();if(s){const r=e.indexOf(".")>=0&&!this.gos.get("suppressFieldDotNotation");i=_getValueUsingField(s,e,r)}else this.initWaitForRowData(t);if(i==null)return;const[o]=Object.entries(this.dataTypeMatchers).find(([r,n])=>n(i))??["object"];return o}getInitialData(){const e=this.gos.get("rowData");if(e?.length)return e[0];if(this.initialData)return this.initialData;{const t=this.rowModel.getRootNode().allLeafChildren;if(t?.length)return t[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const[i]=this.addManagedEventListeners({rowDataUpdateStarted:s=>{const{firstRowData:o}=s;if(!o)return;i?.(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(o,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations();const r={type:"dataTypesInferred"};this.eventService.dispatchEvent(r)}})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.destroyColumnStateUpdateListeners();const s={},o={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([r,n])=>{const l=this.columnModel.getCol(r);if(!l)return;const a=l.getColDef();if(!this.columnModel.resetColDefIntoCol(l,"cellDataTypeInferred"))return;const d=l.getColDef();if(t&&d.type&&d.type!==a.type){const h=this.getUpdatedColumnState(l,n);h.rowGroup&&h.rowGroupIndex==null&&(s[r]=h),h.pivot&&h.pivotIndex==null&&(o[r]=h),i.push(h)}}),t&&i.push(...this.funcColsService.generateColumnStateForRowGroupAndPivotIndexes(s,o)),i.length&&this.columnApplyStateService.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnApplyStateService.getColumnStateFromColDef(e);return t.forEach(s=>{delete i[s],s==="rowGroup"?delete i.rowGroupIndex:s==="pivot"&&delete i.pivotIndex}),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}getDateStringTypeDefinition(e){return e?this.getDataTypeDefinition(e)??this.dataTypeDefinitions.dateString:this.dataTypeDefinitions.dateString}getDateParserFunction(e){return this.getDateStringTypeDefinition(e).dateParser}getDateFormatterFunction(e){return this.getDateStringTypeDefinition(e).dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){return this.getDataTypeDefinition(e)?.baseDataType}checkType(e,t){if(t==null)return!0;const i=this.getDataTypeDefinition(e)?.dataTypeMatcher;return i?i(t):!0}validateColDef(e){e.cellDataType==="object"&&(e.valueFormatter===this.dataTypeDefinitions.object.groupSafeValueFormatter&&!this.hasObjectValueFormatter&&_warnOnce('Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"'),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&_warnOnce('Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"'))}getFormatValue(e){return this.formatValueFuncs[e]}setColDefPropertiesForBaseDataType(e,t,i,s){const o=this.formatValueFuncs[t],r=ModuleRegistry.__isRegistered("@ag-grid-enterprise/set-filter",this.gridId),n=this.localeService.getLocaleTextFunc(),l=a=>{const{filterParams:d}=e;e.filterParams=typeof d=="object"?{...d,...a}:a};switch(i.baseDataType){case"number":{e.cellEditor="agNumberCellEditor",r&&l({comparator:(a,d)=>{const h=a==null?0:parseInt(a),c=d==null?0:parseInt(d);return h===c?0:h>c?1:-1}});break}case"boolean":{e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=a=>!!a.colDef.editable&&a.event.key===KeyCode.SPACE,l(r?{valueFormatter:a=>_exists(a.value)?n(String(a.value),a.value?"True":"False"):n("blanks","(Blanks)")}:{maxNumConditions:1,debounceMs:0,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(a,d)=>d,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(a,d)=>d===!1,numberOfInputs:0}]});break}case"date":{e.cellEditor="agDateCellEditor",e.keyCreator=o,r&&l({valueFormatter:a=>{const d=o(a);return _exists(d)?d:n("blanks","(Blanks)")},treeList:!0,treeListFormatter:(a,d)=>{if(d===1&&a!=null){const h=MONTH_KEYS[Number(a)-1];return n(h,MONTH_LOCALE_TEXT[h])}return a??n("blanks","(Blanks)")}});break}case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=o;const a=i.dateParser;l(r?{valueFormatter:d=>{const h=o(d);return _exists(h)?h:n("blanks","(Blanks)")},treeList:!0,treeListPathGetter:d=>{const h=a(d??void 0);return h?[String(h.getFullYear()),String(h.getMonth()+1),String(h.getDate())]:null},treeListFormatter:(d,h)=>{if(h===1&&d!=null){const c=MONTH_KEYS[Number(d)-1];return n(c,MONTH_LOCALE_TEXT[c])}return d??n("blanks","(Blanks)")}}:{comparator:(d,h)=>{const c=a(h);return h==null||c<d?-1:c>d?1:0}});break}case"object":{e.cellEditorParams={useFormatter:!0},e.comparator=(a,d)=>{const h=this.columnModel.getColDefCol(s),c=h?.getColDef();if(!h||!c)return 0;const u=a==null?"":o({column:h,node:null,value:a}),g=d==null?"":o({column:h,node:null,value:d});return u===g?0:u>g?1:-1},e.keyCreator=o,r?l({valueFormatter:a=>{const d=o(a);return _exists(d)?d:n("blanks","(Blanks)")}}):e.filterValueGetter=a=>o({column:a.column,node:a.node,value:this.valueService.getValue(a.column,a.node)});break}}}getDefaultDataTypes(){const e=i=>!!i.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:i=>i.newValue?.trim?.()===""?null:Number(i.newValue),valueFormatter:i=>i.value==null?"":typeof i.value!="number"||isNaN(i.value)?t("invalidNumber","Invalid Number"):String(i.value),dataTypeMatcher:i=>typeof i=="number"},text:{baseDataType:"text",valueParser:i=>i.newValue===""?null:_toStringOrNull(i.newValue),dataTypeMatcher:i=>typeof i=="string"},boolean:{baseDataType:"boolean",valueParser:i=>i.newValue==null?i.newValue:i.newValue?.trim?.()===""?null:String(i.newValue).toLowerCase()==="true",valueFormatter:i=>i.value==null?"":String(i.value),dataTypeMatcher:i=>typeof i=="boolean"},date:{baseDataType:"date",valueParser:i=>_parseDateTimeFromString(i.newValue==null?null:String(i.newValue)),valueFormatter:i=>i.value==null?"":!(i.value instanceof Date)||isNaN(i.value.getTime())?t("invalidDate","Invalid Date"):_serialiseDate(i.value,!1)??"",dataTypeMatcher:i=>i instanceof Date},dateString:{baseDataType:"dateString",dateParser:i=>_parseDateTimeFromString(i)??void 0,dateFormatter:i=>_serialiseDate(i??null,!1)??void 0,valueParser:i=>e(String(i.newValue))?i.newValue:null,valueFormatter:i=>e(String(i.value))?i.value:"",dataTypeMatcher:i=>typeof i=="string"&&e(i)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:i=>_toStringOrNull(i.value)??""}}}destroyColumnStateUpdateListeners(){this.columnStateUpdateListenerDestroyFuncs.forEach(e=>e()),this.columnStateUpdateListenerDestroyFuncs=[]}destroy(){this.dataTypeDefinitions={},this.dataTypeMatchers={},this.formatValueFuncs={},this.columnStateUpdatesPendingInference={},this.destroyColumnStateUpdateListeners(),super.destroy()}},DataTypeModule={version:VERSION,moduleName:"@ag-grid-community/data-type",beans:[DataTypeService]},ColumnApiModule={version:VERSION,moduleName:"@ag-grid-community/column-api",apiFunctions:{getColumnDef,getColumnDefs,sizeColumnsToFit,setColumnGroupOpened,getColumnGroup,getProvidedColumnGroup,getDisplayNameForColumn,getDisplayNameForColumnGroup,getColumn,getColumns,applyColumnState,getColumnState,resetColumnState,getColumnGroupState,setColumnGroupState,resetColumnGroupState,isPinning,isPinningLeft,isPinningRight,getDisplayedColAfter,getDisplayedColBefore,setColumnVisible,setColumnsVisible,setColumnPinned,setColumnsPinned,getAllGridColumns,getDisplayedLeftColumns,getDisplayedCenterColumns,getDisplayedRightColumns,getAllDisplayedColumns,getAllDisplayedVirtualColumns,moveColumn,moveColumnByIndex,moveColumns:moveColumns2,setColumnWidth,setColumnWidths,getLeftDisplayedColumnGroups,getCenterDisplayedColumnGroups,getRightDisplayedColumnGroups,getAllDisplayedColumnGroups,autoSizeColumn,autoSizeColumns,autoSizeAllColumns}};function addRowDropZone(e,t){e.ctrlsService.getGridBodyCtrl().getRowDragFeature().addRowDropZone(t)}function removeRowDropZone(e,t){const i=e.dragAndDropService.findExternalZone(t);i&&e.dragAndDropService.removeDropTarget(i)}function getRowDropZoneParams(e,t){return e.ctrlsService.getGridBodyCtrl().getRowDragFeature().getRowDropZone(t)}var DragApiModule={version:VERSION,moduleName:"@ag-grid-community/drag-api",apiFunctions:{addRowDropZone,removeRowDropZone,getRowDropZoneParams}};function getPinnedTopRowCount(e){return e.pinnedRowModel.getPinnedTopRowCount()}function getPinnedBottomRowCount(e){return e.pinnedRowModel.getPinnedBottomRowCount()}function getPinnedTopRow(e,t){return e.pinnedRowModel.getPinnedTopRow(t)}function getPinnedBottomRow(e,t){return e.pinnedRowModel.getPinnedBottomRow(t)}var PinnedRowApiModule={version:VERSION,moduleName:"@ag-grid-community/pinned-row-api",apiFunctions:{getPinnedTopRowCount,getPinnedBottomRowCount,getPinnedTopRow,getPinnedBottomRow}};function showLoadingOverlay(e){e.overlayService.showLoadingOverlay()}function showNoRowsOverlay(e){e.overlayService.showNoRowsOverlay()}function hideOverlay(e){e.overlayService.hideOverlay()}var OverlayApiModule={version:VERSION,moduleName:"@ag-grid-community/overlay-api",apiFunctions:{showLoadingOverlay,showNoRowsOverlay,hideOverlay}};function setGridAriaProperty(e,t,i){if(!t)return;const s=e.ctrlsService.getGridBodyCtrl().getGui(),o=`aria-${t}`;i===null?s.removeAttribute(o):s.setAttribute(o,i)}function refreshCells(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function flashCells(e,t={}){const i=s=>_warnOnce(`Since v31.1 api.flashCells parameter '${s}Delay' is deprecated. Please use '${s}Duration' instead.`);_exists(t.fadeDelay)&&i("fade"),_exists(t.flashDelay)&&i("flash"),e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.flashCells(t))}function refreshHeader(e){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsService.getHeaderRowContainerCtrls().forEach(t=>t.refresh()))}function isAnimationFrameQueueEmpty(e){return e.animationFrameService.isQueueEmpty()}function flushAllAnimationFrames(e){e.animationFrameService.flushAllFrames()}function getSizesForCurrentTheme(e){return{rowHeight:e.gos.getRowHeightAsNumber(),headerHeight:e.columnModel.getHeaderHeight()}}function getCellRendererInstances(e,t={}){return e.rowRenderer.getCellRendererInstances(t).map(_unwrapUserComp)}var RenderApiModule={version:VERSION,moduleName:"@ag-grid-community/render-api",apiFunctions:{setGridAriaProperty,refreshCells,flashCells,refreshHeader,isAnimationFrameQueueEmpty,flushAllAnimationFrames,getSizesForCurrentTheme,getCellRendererInstances}};function expireValueCache(e){e.valueCache.expire()}function getValue(e,t,i){return getCellValue(e,{colKey:t,rowNode:i})}function getCellValue(e,t){const{colKey:i,rowNode:s,useFormatter:o}=t,r=e.columnModel.getColDefCol(i)??e.columnModel.getCol(i);if(_missing(r))return null;const n=e.valueService.getValue(r,s);return o?e.valueService.formatValue(r,s,n)??_escapeString(n,!0):n}function getGridId(e){return e.context.getGridId()}function destroy(e){e.gridDestroyService.destroy()}function isDestroyed(e){return e.gridDestroyService.isDestroyCalled()}function getGridOption(e,t){return e.gos.get(t)}function setGridOption(e,t,i){updateGridOptions(e,{[t]:i})}function updateGridOptions(e,t){e.gos.updateGridOptions({options:t})}function addEventListener(e,t,i){e.apiEventService.addEventListener(t,i)}function removeEventListener(e,t,i){e.apiEventService.removeEventListener(t,i)}function addGlobalListener(e,t){e.apiEventService.addGlobalListener(t)}function removeGlobalListener(e,t){e.apiEventService.removeGlobalListener(t)}function getFocusedCell(e){return e.focusService.getFocusedCell()}function clearFocusedCell(e){return e.focusService.clearFocusedCell()}function setFocusedCell(e,t,i,s){e.focusService.setFocusedCell({rowIndex:t,column:i,rowPinned:s,forceBrowserFocus:!0})}function tabToNextCell(e,t){return e.navigationService.tabToNextCell(!1,t)}function tabToPreviousCell(e,t){return e.navigationService.tabToNextCell(!0,t)}function setFocusedHeader(e,t,i=!1){const s=e.headerNavigationService.getHeaderPositionForColumn(t,i);s&&e.focusService.focusHeaderPosition({headerPosition:s})}function showColumnMenuAfterButtonClick(e,t,i){const s=e.columnModel.getCol(t);e.menuService.showColumnMenu({column:s,buttonElement:i,positionBy:"button"})}function showColumnMenuAfterMouseClick(e,t,i){let s=e.columnModel.getCol(t);if(s||(s=e.columnModel.getColDefCol(t)),!s){_errorOnce(`column '${t}' not found`);return}e.menuService.showColumnMenu({column:s,mouseEvent:i,positionBy:"mouse"})}function showColumnMenu(e,t){const i=e.columnModel.getCol(t);if(!i){_errorOnce(`column '${t}' not found`);return}e.menuService.showColumnMenu({column:i,positionBy:"auto"})}function hidePopupMenu(e){e.menuService.hidePopupMenu()}function redrawRows(e,t={}){const i=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(i))}function setRowNodeExpanded(e,t,i,s,o){e.expansionService.setRowNodeExpanded(t,i,s,o)}function getRowNode(e,t){return e.rowModel.getRowNode(t)}function addRenderedRowListener(e,t,i,s){e.rowRenderer.addRenderedRowListener(t,i,s)}function getRenderedNodes(e){return e.rowRenderer.getRenderedNodes()}function forEachNode(e,t,i){e.rowModel.forEachNode(t,i)}function getFirstDisplayedRow(e){return getFirstDisplayedRowIndex(e)}function getFirstDisplayedRowIndex(e){return e.rowRenderer.getFirstVirtualRenderedRow()}function getLastDisplayedRow(e){return getLastDisplayedRowIndex(e)}function getLastDisplayedRowIndex(e){return e.rowRenderer.getLastVirtualRenderedRow()}function getDisplayedRowAtIndex(e,t){return e.rowModel.getRow(t)}function getDisplayedRowCount(e){return e.rowModel.getRowCount()}function getModel(e){return e.rowModel}function setNodesSelected(e,t){if(!t.nodes.every(l=>l.rowPinned?(_warnOnce("cannot select pinned rows"),!1):l.id===void 0?(_warnOnce("cannot select node until id for node is known"),!1):!0))return;const{nodes:s,source:o,newValue:r}=t,n=s;e.selectionService.setNodesSelected({nodes:n,source:o??"api",newValue:r})}function selectAll(e,t="apiSelectAll"){e.selectionService.selectAllRowNodes({source:t})}function deselectAll(e,t="apiSelectAll"){e.selectionService.deselectAllRowNodes({source:t})}function selectAllFiltered(e,t="apiSelectAllFiltered"){e.selectionService.selectAllRowNodes({source:t,justFiltered:!0})}function deselectAllFiltered(e,t="apiSelectAllFiltered"){e.selectionService.deselectAllRowNodes({source:t,justFiltered:!0})}function selectAllOnCurrentPage(e,t="apiSelectAllCurrentPage"){e.selectionService.selectAllRowNodes({source:t,justCurrentPage:!0})}function deselectAllOnCurrentPage(e,t="apiSelectAllCurrentPage"){e.selectionService.deselectAllRowNodes({source:t,justCurrentPage:!0})}function getSelectedNodes(e){return e.selectionService.getSelectedNodes()}function getSelectedRows(e){return e.selectionService.getSelectedRows()}function onSortChanged(e){e.sortController.onSortChanged("api")}var CoreApiModule={version:VERSION,moduleName:"@ag-grid-community/core-api",apiFunctions:{getGridId,destroy,isDestroyed,getGridOption,setGridOption,updateGridOptions}},RowSelectionApiModule={version:VERSION,moduleName:"@ag-grid-community/row-selection-api",apiFunctions:{setNodesSelected,selectAll,deselectAll,selectAllFiltered,deselectAllFiltered,selectAllOnCurrentPage,deselectAllOnCurrentPage,getSelectedNodes,getSelectedRows}},RowApiModule={version:VERSION,moduleName:"@ag-grid-community/row-api",apiFunctions:{redrawRows,setRowNodeExpanded,getRowNode,addRenderedRowListener,getRenderedNodes,forEachNode,getFirstDisplayedRow,getFirstDisplayedRowIndex,getLastDisplayedRow,getLastDisplayedRowIndex,getDisplayedRowAtIndex,getDisplayedRowCount,getModel}},ScrollApiModule={version:VERSION,moduleName:"@ag-grid-community/scroll-api",apiFunctions:{getVerticalPixelRange,getHorizontalPixelRange,ensureColumnVisible,ensureIndexVisible,ensureNodeVisible}},KeyboardNavigationApiModule={version:VERSION,moduleName:"@ag-grid-community/keyboard-navigation-api",apiFunctions:{getFocusedCell,clearFocusedCell,setFocusedCell,setFocusedHeader,tabToNextCell,tabToPreviousCell}},EventApiModule={version:VERSION,moduleName:"@ag-grid-community/event-api",apiFunctions:{addEventListener,addGlobalListener,removeEventListener,removeGlobalListener}},CellApiModule={version:VERSION,moduleName:"@ag-grid-community/cell-api",apiFunctions:{expireValueCache,getValue,getCellValue}},CommunityMenuApiModule={version:VERSION,moduleName:"@ag-grid-community/menu-api",apiFunctions:{showColumnMenuAfterButtonClick,showColumnMenuAfterMouseClick,showColumnMenu,hidePopupMenu}},SortApiModule={version:VERSION,moduleName:"@ag-grid-community/sort-api",apiFunctions:{onSortChanged}},CommunityApiModule={version:VERSION,moduleName:"@ag-grid-community/api",dependantModules:[CoreApiModule,PinnedRowApiModule,RowSelectionApiModule,ColumnApiModule,RowApiModule,DragApiModule,ScrollApiModule,OverlayApiModule,KeyboardNavigationApiModule,EventApiModule,RenderApiModule,CellApiModule,CommunityMenuApiModule,SortApiModule]};function getState(e){return e.stateService?.getState()??{}}var StateService=class extends BeanStub{constructor(){super(...arguments),this.beanName="stateService",this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=_debounce(()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=_debounce(()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),0),this.onRowSelectedDebounced=_debounce(()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}wireBeans(e){this.filterManager=e.filterManager,this.ctrlsService=e.ctrlsService,this.pivotResultColsService=e.pivotResultColsService,this.focusService=e.focusService,this.columnModel=e.columnModel,this.visibleColsService=e.visibleColsService,this.columnGroupStateService=e.columnGroupStateService,this.columnGetStateService=e.columnGetStateService,this.paginationService=e.paginationService,this.rowModel=e.rowModel,this.selectionService=e.selectionService,this.expansionService=e.expansionService,this.columnAnimationService=e.columnAnimationService,this.columnApplyStateService=e.columnApplyStateService,this.sideBarService=e.sideBarService,this.rangeService=e.rangeService}postConstruct(){this.isClientSideRowModel=this.rowModel.getType()==="clientSide",this.cachedState=this.gos.get("initialState")??{},this.ctrlsService.whenReady(()=>this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnGridReady()));const[e,t,i]=this.addManagedEventListeners({newColumnsLoaded:({source:s})=>{s==="gridInitializing"&&(e(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnColumnsInitialised()))},rowCountReady:()=>{t?.(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnRowCountReady())},firstDataRendered:()=>{i?.(),this.suppressEventsAndDispatchInitEvent(()=>this.setupStateOnFirstDataRendered())}})}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setupStateOnGridReady(){this.updateCachedState("sideBar",this.getSideBarState());const e=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:e,sideBarUpdated:e})}setupStateOnColumnsInitialised(){const e=this.gos.get("initialState")??{};this.setColumnState(e),this.setColumnGroupState(e),this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState()),this.addManagedEventListeners({columnValueChanged:()=>this.updateColumnState(["aggregation"]),columnMoved:()=>this.updateColumnState(["columnOrder"]),columnPinned:()=>this.updateColumnState(["columnPinning"]),columnResized:()=>this.updateColumnState(["columnSizing"]),columnVisible:()=>this.updateColumnState(["columnVisibility"]),columnPivotChanged:()=>this.updateColumnState(["pivot"]),columnPivotModeChanged:()=>this.updateColumnState(["pivot"]),columnRowGroupChanged:()=>this.updateColumnState(["rowGroup"]),sortChanged:()=>this.updateColumnState(["sort"]),newColumnsLoaded:()=>this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setupStateOnRowCountReady(){const{filter:e,rowGroupExpansion:t,rowSelection:i,pagination:s}=this.gos.get("initialState")??{},o=this.gos.get("advancedFilterModel");(e||o)&&this.setFilterState(e,o),t&&this.setRowGroupExpansionState(t),i&&this.setRowSelectionState(i),s&&this.setPaginationState(s),this.updateCachedState("filter",this.getFilterState()),this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowSelection",this.getRowSelectionState()),this.updateCachedState("pagination",this.getPaginationState()),this.addManagedEventListeners({filterChanged:()=>this.updateCachedState("filter",this.getFilterState()),rowGroupOpened:()=>this.onRowGroupOpenedDebounced(),expandOrCollapseAll:()=>this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:r=>{(r.newPage||r.newPageSize)&&this.updateCachedState("pagination",this.getPaginationState())}})}setupStateOnFirstDataRendered(){const{scroll:e,rangeSelection:t,focusedCell:i,columnOrder:s}=this.gos.get("initialState")??{};i&&this.setFocusedCellState(i),t&&this.setRangeSelectionState(t),e&&this.setScrollState(e),this.setColumnPivotState(!!s?.orderedColIds),this.updateCachedState("sideBar",this.getSideBarState()),this.updateCachedState("focusedCell",this.getFocusedCellState()),this.updateCachedState("rangeSelection",this.getRangeSelectionState()),this.updateCachedState("scroll",this.getScrollState()),this.addManagedEventListeners({cellFocused:()=>this.updateCachedState("focusedCell",this.getFocusedCellState()),rangeSelectionChanged:o=>{o.finished&&this.updateCachedState("rangeSelection",this.getRangeSelectionState())},bodyScrollEnd:()=>this.updateCachedState("scroll",this.getScrollState())})}getColumnState(){const e=this.columnModel.isPivotMode(),t=[],i=[],s=[],o=[],r=[],n=[],l=[],a=[],d=[],h=this.columnGetStateService.getColumnState();for(let c=0;c<h.length;c++){const{colId:u,sort:g,sortIndex:p,rowGroup:f,rowGroupIndex:m,aggFunc:C,pivot:v,pivotIndex:w,pinned:y,hide:F,width:S,flex:R}=h[c];d.push(u),g&&(t[p??0]={colId:u,sort:g}),f&&(i[m??0]=u),typeof C=="string"&&s.push({colId:u,aggFunc:C}),v&&(o[w??0]=u),y&&(y==="right"?n:r).push(u),F&&l.push(u),(R||S)&&a.push({colId:u,flex:R??void 0,width:S})}return{sort:t.length?{sortModel:t}:void 0,rowGroup:i.length?{groupColIds:i}:void 0,aggregation:s.length?{aggregationModel:s}:void 0,pivot:o.length||e?{pivotMode:e,pivotColIds:o}:void 0,columnPinning:r.length||n.length?{leftColIds:r,rightColIds:n}:void 0,columnVisibility:l.length?{hiddenColIds:l}:void 0,columnSizing:a.length?{columnSizingModel:a}:void 0,columnOrder:d.length?{orderedColIds:d}:void 0}}setColumnState(e){const{sort:t,rowGroup:i,aggregation:s,pivot:o,columnPinning:r,columnVisibility:n,columnSizing:l,columnOrder:a}=e,d={},h=p=>{let f=d[p];return f||(f={colId:p},d[p]=f,f)};t&&t.sortModel.forEach(({colId:p,sort:f},m)=>{const C=h(p);C.sort=f,C.sortIndex=m}),i&&i.groupColIds.forEach((p,f)=>{const m=h(p);m.rowGroup=!0,m.rowGroupIndex=f}),s&&s.aggregationModel.forEach(({colId:p,aggFunc:f})=>{h(p).aggFunc=f}),o&&(o.pivotColIds.forEach((p,f)=>{const m=h(p);m.pivot=!0,m.pivotIndex=f}),this.gos.updateGridOptions({options:{pivotMode:o.pivotMode},source:"gridInitializing"})),r&&(r.leftColIds.forEach(p=>{h(p).pinned="left"}),r.rightColIds.forEach(p=>{h(p).pinned="right"})),n&&n.hiddenColIds.forEach(p=>{h(p).hide=!0}),l&&l.columnSizingModel.forEach(({colId:p,flex:f,width:m})=>{const C=h(p);C.flex=f??null,C.width=m});const c=a?.orderedColIds,u=!!c?.length,g=u?c.map(p=>h(p)):Object.values(d);if(g.length){this.columnStates=g;const p={sort:null,sortIndex:null,rowGroup:null,rowGroupIndex:null,aggFunc:null,pivot:null,pivotIndex:null,pinned:null,hide:null,flex:null};this.columnApplyStateService.applyColumnState({state:g,applyOrder:u,defaultState:p},"gridInitializing")}}setColumnPivotState(e){const t=this.columnStates;this.columnStates=void 0;const i=this.columnGroupStates;if(this.columnGroupStates=void 0,!!this.pivotResultColsService.isPivotResultColsPresent()){if(t){const s=[];for(const o of t)this.pivotResultColsService.getPivotResultCol(o.colId)&&s.push(o);this.columnApplyStateService.applyColumnState({state:s,applyOrder:e},"gridInitializing")}i&&this.columnGroupStateService.setColumnGroupState(i,"gridInitializing")}}getColumnGroupState(){const e=this.columnGroupStateService.getColumnGroupState(),t=[];return e.forEach(({groupId:i,open:s})=>{s&&t.push(i)}),t.length?{openColumnGroupIds:t}:void 0}setColumnGroupState(e){if(!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const t=new Set(e.columnGroup?.openColumnGroupIds),s=this.columnGroupStateService.getColumnGroupState().map(({groupId:o})=>{const r=t.has(o);return r&&t.delete(o),{groupId:o,open:r}});t.forEach(o=>{s.push({groupId:o,open:!0})}),s.length&&(this.columnGroupStates=s),this.columnGroupStateService.setColumnGroupState(s,"gridInitializing")}getFilterState(){let e=this.filterManager?.getFilterModel();e&&Object.keys(e).length===0&&(e=void 0);const t=this.filterManager?.getAdvancedFilterModel()??void 0;return e||t?{filterModel:e,advancedFilterModel:t}:void 0}setFilterState(e,t){const{filterModel:i,advancedFilterModel:s}=e??{advancedFilterModel:t};i&&this.filterManager?.setFilterModel(i,"columnFilter"),s&&this.filterManager?.setAdvancedFilterModel(s)}getRangeSelectionState(){const e=this.rangeService?.getCellRanges().map(t=>{const{id:i,type:s,startRow:o,endRow:r,columns:n,startColumn:l}=t;return{id:i,type:s,startRow:o,endRow:r,colIds:n.map(a=>a.getColId()),startColId:l.getColId()}});return e?.length?{cellRanges:e}:void 0}setRangeSelectionState(e){if(!this.gos.get("enableRangeSelection")||!this.rangeService)return;const t=[];e.cellRanges.forEach(i=>{const s=[];if(i.colIds.forEach(r=>{const n=this.columnModel.getCol(r);n&&s.push(n)}),!s.length)return;let o=this.columnModel.getCol(i.startColId);if(!o){const r=this.visibleColsService.getAllCols(),n=new Set(s);o=r.find(l=>n.has(l))}t.push({...i,columns:s,startColumn:o})}),this.rangeService.setCellRanges(t)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.ctrlsService.getGridBodyCtrl()?.getScrollFeature(),{left:t}=e?.getHScrollPosition()??{left:0},{top:i}=e?.getVScrollPosition()??{top:0};return i||t?{top:i,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:i}=e;this.ctrlsService.getGridBodyCtrl()?.getScrollFeature().setScrollPosition(t,i)}getSideBarState(){return this.sideBarService?.getSideBarComp()?.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.focusService.getFocusedCell();if(e){const{column:t,rowIndex:i,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:i,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{colId:t,rowIndex:i,rowPinned:s}=e;this.focusService.setFocusedCell({column:this.columnModel.getCol(t),rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){if(!this.paginationService)return;const e=this.paginationService.getCurrentPage(),t=this.gos.get("paginationAutoPageSize")?void 0:this.paginationService.getPageSize();if(!(!e&&!t))return{page:e,pageSize:t}}setPaginationState(e){this.paginationService&&(e.pageSize&&!this.gos.get("paginationAutoPageSize")&&this.paginationService.setPageSize(e.pageSize,"initialState"),typeof e.page=="number"&&this.paginationService.setPage(e.page))}getRowSelectionState(){const e=this.selectionService.getSelectionState();return!e||!Array.isArray(e)&&(e.selectAll===!1||e.selectAllChildren===!1)&&!e?.toggledNodes?.length?void 0:e}setRowSelectionState(e){this.selectionService.setSelectionState(e,"gridInitializing")}getRowGroupExpansionState(){const e=this.expansionService.getExpandedRows();return e.length?{expandedRowGroupIds:e}:void 0}setRowGroupExpansionState(e){this.expansionService.expandRows(e.expandedRowGroupIds)}updateColumnState(e){const t=this.getColumnState();let i=!1;Object.entries(t).forEach(([s,o])=>{_jsonEquals(o,this.cachedState[s])||(i=!0)}),this.cachedState={...this.cachedState,...t},i&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const i=this.cachedState[e];this.setCachedStateValue(e,t),_jsonEquals(t,i)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){this.staleStateKeys.forEach(e=>{switch(e){case"rowSelection":this.setCachedStateValue(e,this.getRowSelectionState());break}}),this.staleStateKeys.clear()}dispatchStateUpdateEvent(e){this.suppressEvents||(e.forEach(t=>this.queuedUpdateSources.add(t)),this.dispatchStateUpdateEventDebounced())}dispatchQueuedStateUpdateEvents(){const e=Array.from(this.queuedUpdateSources);this.queuedUpdateSources.clear();const t={type:"stateUpdated",sources:e,state:this.cachedState};this.eventService.dispatchEvent(t)}suppressEventsAndDispatchInitEvent(e){this.suppressEvents=!0,this.columnAnimationService.setSuppressAnimation(!0),e(),setTimeout(()=>{this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&(this.columnAnimationService.setSuppressAnimation(!1),this.dispatchStateUpdateEvent(["gridInitializing"]))})}},StateCoreModule={version:VERSION,moduleName:"@ag-grid-community/state-core",beans:[StateService]},StateApiModule={version:VERSION,moduleName:"@ag-grid-community/state-api",apiFunctions:{getState},dependantModules:[StateCoreModule]},StateModule={version:VERSION,moduleName:"@ag-grid-community/state",dependantModules:[StateCoreModule,StateApiModule]};function paginationIsLastPageFound(e){return e.rowModel.isLastRowIndexKnown()}function paginationGetPageSize(e){return e.paginationService?.getPageSize()??100}function paginationGetCurrentPage(e){return e.paginationService?.getCurrentPage()??0}function paginationGetTotalPages(e){return e.paginationService?.getTotalPages()??1}function paginationGetRowCount(e){return e.paginationService?e.paginationService.getMasterRowCount():e.rowModel.getRowCount()}function paginationGoToNextPage(e){e.paginationService?.goToNextPage()}function paginationGoToPreviousPage(e){e.paginationService?.goToPreviousPage()}function paginationGoToFirstPage(e){e.paginationService?.goToFirstPage()}function paginationGoToLastPage(e){e.paginationService?.goToLastPage()}function paginationGoToPage(e,t){e.paginationService?.goToPage(t)}var PaginationAutoPageSizeService=class extends BeanStub{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeService"}wireBeans(e){this.ctrlsService=e.ctrlsService,this.paginationService=e.paginationService}postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.paginationService.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const i=Math.max(this.gos.getRowHeightAsNumber(),1),s=Math.floor(e/i);this.paginationService.setPageSize(s,"autoCalculated")};this.isBodyRendered?_debounce(()=>t(),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};function _addFocusableContainerListener(e,t,i){e.addManagedElementListeners(t,{keydown:s=>{if(!s.defaultPrevented&&s.key===KeyCode.TAB){const o=s.shiftKey;i.findNextFocusableElement(t,!1,o)||i.focusNextGridCoreContainer(o)&&s.preventDefault()}}})}var PageSizeSelectorComp=class extends Component{constructor(){super('<span class="ag-paging-page-size"></span>'),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.paginationService.getPageSize()||(this.paginationService.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.paginationService=e.paginationService}postConstruct(){this.addManagedPropertyListener("paginationPageSizeSelector",()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!e?.newPageSize)return;const t=this.paginationService.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp&&this.appendChild(this.selectPageSizeComp))}reset(){_clearElement(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get("paginationPageSizeSelector")!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.paginationService.getPageSize(),i=!t||!e.includes(t);i&&(e.unshift(""),_warnOnce(`The paginationPageSize grid option is set to a value that is not in the list of page size options.
|
|
166
166
|
Please make sure that the paginationPageSize grid option is set to one of the values in the
|
|
167
167
|
paginationPageSizeSelector array, or set the paginationPageSizeSelector to false to hide the page size selector.`)),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp));const s=this.localeService.getLocaleTextFunc(),o=s("pageSizeSelectorLabel","Page Size:"),r=e.map(l=>({value:String(l),text:String(l)})),n=s("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new AgSelect).addOptions(r).setValue(String(i?"":t)).setAriaLabel(n).setLabel(o).onValueChange(()=>this.handlePageSizeItemSelected()),this.hasEmptyOption=i}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get("paginationPageSizeSelector");return!Array.isArray(t)||!this.validateValues(t)?e:[...t].sort((i,s)=>i-s)}validateValues(e){if(!e.length)return _warnOnce(`The paginationPageSizeSelector grid option is an empty array. This is most likely a mistake.
|
|
168
168
|
If you want to hide the page size selector, please set the paginationPageSizeSelector to false.`),!1;for(let t=0;t<e.length;t++){const i=e[t],s=typeof i=="number",o=i>0;if(!s)return _warnOnce(`The paginationPageSizeSelector grid option contains a non-numeric value.
|
|
@@ -188,7 +188,7 @@ To run logic when the grid is about to be destroyed use the gridPreDestroy event
|
|
|
188
188
|
<div data-ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div>
|
|
189
189
|
<div data-ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${l}"></div>
|
|
190
190
|
</span>
|
|
191
|
-
</div>`}onBtNext(){this.nextButtonDisabled||this.paginationService.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationService.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationService.goToLastPage()}enableOrDisableButtons(){const e=this.paginationService.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),i=this.paginationService.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),o=e===i-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){_setAriaDisabled(e,t),e.classList.toggle("ag-disabled",t)}updateRowLabels(){const e=this.paginationService.getCurrentPage(),t=this.paginationService.getPageSize(),i=this.rowModel.isLastRowIndexKnown(),s=this.rowModel.isLastRowIndexKnown()?this.paginationService.getMasterRowCount():null;let o,r;if(this.isZeroPagesToDisplay()?o=r=0:(o=t*e+1,r=o+t-1,i&&r>s&&(r=s)),this.lbFirstRowOnPage.textContent=this.formatNumber(o),this.rowNodeBlockLoader?.isLoading()){const n=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=n("pageLastRowUnknown","?")}else this.lbLastRowOnPage.textContent=this.formatNumber(r)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages();return e&&t===0}setTotalLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages(),i=e?this.paginationService.getMasterRowCount():null;if(i===1){const s=this.rowModel.getRow(0);if(s&&s.group&&!(s.groupData||s.aggData)){this.setTotalLabelsToZero();return}}if(e)this.lbTotal.textContent=this.formatNumber(t),this.lbRecordCount.textContent=this.formatNumber(i);else{const s=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=s,this.lbRecordCount.innerHTML=s}}setTotalLabelsToZero(){this.lbFirstRowOnPage.textContent=this.formatNumber(0),this.lbCurrent.textContent=this.formatNumber(0),this.lbLastRowOnPage.textContent=this.formatNumber(0),this.lbTotal.textContent=this.formatNumber(0),this.lbRecordCount.textContent=this.formatNumber(0)}},PaginationSelector={selector:"AG-PAGINATION",component:PaginationComp},PaginationService=class extends BeanStub{constructor(){super(...arguments),this.beanName="paginationService",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.active=this.gos.get("pagination"),this.pageSizeFromGridOptions=this.gos.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return PaginationSelector}isPaginateChildRows(){return this.gos.get("groupRemoveSingleChildren")||this.gos.get("groupRemoveLowestSingleChildren")?!0:this.gos.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){!this.active||this.currentPage===e||typeof this.currentPage!="number"||(this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0}))}isRowPresent(e){return e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){return this.active?this.getPageForIndex(e.rowIndex)===this.currentPage:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return _exists(this.pageSizeAutoCalculated)?this.pageSizeAutoCalculated:_exists(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:_exists(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:_exists(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.pageBoundsService.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const i=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}i!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0){this.setZeroRows();return}const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const s=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=s-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),this.masterRowCount===0){this.setZeroRows();return}const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:i=!1,newPageSize:s=!1}=e,o={type:"paginationChanged",animate:!1,newData:!1,newPage:i,newPageSize:s,keepRenderedRows:t};this.eventService.dispatchEvent(o)}},PaginationCoreModule={version:VERSION,moduleName:"@ag-grid-community/pagination-core",beans:[PaginationService,PaginationAutoPageSizeService]},PaginationApiModule={version:VERSION,moduleName:"@ag-grid-community/pagination-api",dependantModules:[PaginationCoreModule],apiFunctions:{paginationIsLastPageFound,paginationGetPageSize,paginationGetCurrentPage,paginationGetTotalPages,paginationGetRowCount,paginationGoToNextPage,paginationGoToPreviousPage,paginationGoToFirstPage,paginationGoToLastPage,paginationGoToPage}},PaginationModule={version:VERSION,moduleName:"@ag-grid-community/pagination",dependantModules:[PaginationCoreModule,PaginationApiModule]},coreModule="@ag-grid-community/core",clientSideRowModelModule="@ag-grid-community/client-side-row-model",csvExportModule="@ag-grid-community/csv-export",infiniteRowModelModule="@ag-grid-community/infinite-row-model",advancedFilterModule="@ag-grid-enterprise/advanced-filter",gridChartsModule="@ag-grid-enterprise/charts",clipboardModule="@ag-grid-enterprise/clipboard",excelExportModule="@ag-grid-enterprise/excel-export",masterDetailModule="@ag-grid-enterprise/master-detail",menuModule="@ag-grid-enterprise/menu",rangeSelectionModule="@ag-grid-enterprise/range-selection",rowGroupingModule="@ag-grid-enterprise/row-grouping",serverSideRowModelModule="@ag-grid-enterprise/server-side-row-model",sideBarModule="@ag-grid-enterprise/side-bar",statusBarModule="@ag-grid-enterprise/status-bar",functionModules={dispatchEvent:coreModule,getState:coreModule,getGridId:coreModule,destroy:coreModule,isDestroyed:coreModule,getGridOption:coreModule,setGridOption:coreModule,updateGridOptions:coreModule,setNodesSelected:coreModule,selectAll:coreModule,deselectAll:coreModule,selectAllFiltered:coreModule,deselectAllFiltered:coreModule,selectAllOnCurrentPage:coreModule,deselectAllOnCurrentPage:coreModule,getSelectedNodes:coreModule,getSelectedRows:coreModule,redrawRows:coreModule,setRowNodeExpanded:coreModule,getRowNode:coreModule,addRenderedRowListener:coreModule,getRenderedNodes:coreModule,forEachNode:coreModule,getFirstDisplayedRow:coreModule,getFirstDisplayedRowIndex:coreModule,getLastDisplayedRow:coreModule,getLastDisplayedRowIndex:coreModule,getDisplayedRowAtIndex:coreModule,getDisplayedRowCount:coreModule,getModel:coreModule,getVerticalPixelRange:coreModule,getHorizontalPixelRange:coreModule,ensureColumnVisible:coreModule,ensureIndexVisible:coreModule,ensureNodeVisible:coreModule,getFocusedCell:coreModule,clearFocusedCell:coreModule,setFocusedCell:coreModule,tabToNextCell:coreModule,tabToPreviousCell:coreModule,setFocusedHeader:coreModule,addEventListener:coreModule,addGlobalListener:coreModule,removeEventListener:coreModule,removeGlobalListener:coreModule,expireValueCache:coreModule,getValue:coreModule,getCellValue:coreModule,showColumnMenuAfterButtonClick:coreModule,showColumnMenuAfterMouseClick:coreModule,showColumnMenu:coreModule,hidePopupMenu:coreModule,onSortChanged:coreModule,getPinnedTopRowCount:coreModule,getPinnedBottomRowCount:coreModule,getPinnedTopRow:coreModule,getPinnedBottomRow:coreModule,showLoadingOverlay:coreModule,showNoRowsOverlay:coreModule,hideOverlay:coreModule,setGridAriaProperty:coreModule,refreshCells:coreModule,flashCells:coreModule,refreshHeader:coreModule,isAnimationFrameQueueEmpty:coreModule,flushAllAnimationFrames:coreModule,getSizesForCurrentTheme:coreModule,getCellRendererInstances:coreModule,addRowDropZone:coreModule,removeRowDropZone:coreModule,getRowDropZoneParams:coreModule,getColumnDef:coreModule,getColumnDefs:coreModule,sizeColumnsToFit:coreModule,setColumnGroupOpened:coreModule,getColumnGroup:coreModule,getProvidedColumnGroup:coreModule,getDisplayNameForColumn:coreModule,getDisplayNameForColumnGroup:coreModule,getColumn:coreModule,getColumns:coreModule,applyColumnState:coreModule,getColumnState:coreModule,resetColumnState:coreModule,getColumnGroupState:coreModule,setColumnGroupState:coreModule,resetColumnGroupState:coreModule,isPinning:coreModule,isPinningLeft:coreModule,isPinningRight:coreModule,getDisplayedColAfter:coreModule,getDisplayedColBefore:coreModule,setColumnVisible:coreModule,setColumnsVisible:coreModule,setColumnPinned:coreModule,setColumnsPinned:coreModule,getAllGridColumns:coreModule,getDisplayedLeftColumns:coreModule,getDisplayedCenterColumns:coreModule,getDisplayedRightColumns:coreModule,getAllDisplayedColumns:coreModule,getAllDisplayedVirtualColumns:coreModule,moveColumn:coreModule,moveColumnByIndex:coreModule,moveColumns:coreModule,setColumnWidth:coreModule,setColumnWidths:coreModule,getLeftDisplayedColumnGroups:coreModule,getCenterDisplayedColumnGroups:coreModule,getRightDisplayedColumnGroups:coreModule,getAllDisplayedColumnGroups:coreModule,autoSizeColumn:coreModule,autoSizeColumns:coreModule,autoSizeAllColumns:coreModule,undoCellEditing:coreModule,redoCellEditing:coreModule,getCellEditorInstances:coreModule,getEditingCells:coreModule,stopEditing:coreModule,startEditingCell:coreModule,getCurrentUndoSize:coreModule,getCurrentRedoSize:coreModule,isAnyFilterPresent:coreModule,onFilterChanged:coreModule,isColumnFilterPresent:coreModule,getFilterInstance:coreModule,getColumnFilterInstance:coreModule,destroyFilter:coreModule,setFilterModel:coreModule,getFilterModel:coreModule,getColumnFilterModel:coreModule,setColumnFilterModel:coreModule,showColumnFilter:coreModule,isQuickFilterPresent:coreModule,getQuickFilter:coreModule,resetQuickFilter:coreModule,paginationIsLastPageFound:coreModule,paginationGetPageSize:coreModule,paginationGetCurrentPage:coreModule,paginationGetTotalPages:coreModule,paginationGetRowCount:coreModule,paginationGoToNextPage:coreModule,paginationGoToPreviousPage:coreModule,paginationGoToFirstPage:coreModule,paginationGoToLastPage:coreModule,paginationGoToPage:coreModule,expandAll:coreModule,collapseAll:coreModule,onRowHeightChanged:coreModule,setRowCount:coreModule,getCacheBlockState:coreModule,onGroupExpandedOrCollapsed:clientSideRowModelModule,refreshClientSideRowModel:clientSideRowModelModule,forEachLeafNode:clientSideRowModelModule,forEachNodeAfterFilter:clientSideRowModelModule,forEachNodeAfterFilterAndSort:clientSideRowModelModule,resetRowHeights:clientSideRowModelModule,applyTransaction:clientSideRowModelModule,applyTransactionAsync:clientSideRowModelModule,flushAsyncTransactions:clientSideRowModelModule,getBestCostNodeSelection:clientSideRowModelModule,getDataAsCsv:csvExportModule,exportDataAsCsv:csvExportModule,refreshInfiniteCache:infiniteRowModelModule,purgeInfiniteCache:infiniteRowModelModule,getInfiniteRowCount:infiniteRowModelModule,isLastRowIndexKnown:infiniteRowModelModule,getAdvancedFilterModel:advancedFilterModule,setAdvancedFilterModel:advancedFilterModule,showAdvancedFilterBuilder:advancedFilterModule,hideAdvancedFilterBuilder:advancedFilterModule,getChartModels:gridChartsModule,getChartRef:gridChartsModule,getChartImageDataURL:gridChartsModule,downloadChart:gridChartsModule,openChartToolPanel:gridChartsModule,closeChartToolPanel:gridChartsModule,createRangeChart:gridChartsModule,createPivotChart:gridChartsModule,createCrossFilterChart:gridChartsModule,updateChart:gridChartsModule,restoreChart:gridChartsModule,copyToClipboard:clipboardModule,cutToClipboard:clipboardModule,copySelectedRowsToClipboard:clipboardModule,copySelectedRangeToClipboard:clipboardModule,copySelectedRangeDown:clipboardModule,pasteFromClipboard:clipboardModule,getDataAsExcel:excelExportModule,exportDataAsExcel:excelExportModule,getSheetDataForExcel:excelExportModule,getMultipleSheetsAsExcel:excelExportModule,exportMultipleSheetsAsExcel:excelExportModule,addDetailGridInfo:masterDetailModule,removeDetailGridInfo:masterDetailModule,getDetailGridInfo:masterDetailModule,forEachDetailGridInfo:masterDetailModule,showContextMenu:menuModule,showColumnChooser:menuModule,hideColumnChooser:menuModule,getCellRanges:rangeSelectionModule,addCellRange:rangeSelectionModule,clearRangeSelection:rangeSelectionModule,addAggFunc:rowGroupingModule,addAggFuncs:rowGroupingModule,clearAggFuncs:rowGroupingModule,setColumnAggFunc:rowGroupingModule,isPivotMode:rowGroupingModule,getPivotResultColumn:rowGroupingModule,setValueColumns:rowGroupingModule,getValueColumns:rowGroupingModule,removeValueColumn:rowGroupingModule,removeValueColumns:rowGroupingModule,addValueColumn:rowGroupingModule,addValueColumns:rowGroupingModule,setRowGroupColumns:rowGroupingModule,removeRowGroupColumn:rowGroupingModule,removeRowGroupColumns:rowGroupingModule,addRowGroupColumn:rowGroupingModule,addRowGroupColumns:rowGroupingModule,getRowGroupColumns:rowGroupingModule,moveRowGroupColumn:rowGroupingModule,setPivotColumns:rowGroupingModule,removePivotColumn:rowGroupingModule,removePivotColumns:rowGroupingModule,addPivotColumn:rowGroupingModule,addPivotColumns:rowGroupingModule,getPivotColumns:rowGroupingModule,setPivotResultColumns:rowGroupingModule,getPivotResultColumns:rowGroupingModule,getServerSideSelectionState:serverSideRowModelModule,setServerSideSelectionState:serverSideRowModelModule,applyServerSideTransaction:serverSideRowModelModule,applyServerSideTransactionAsync:serverSideRowModelModule,applyServerSideRowData:serverSideRowModelModule,retryServerSideLoads:serverSideRowModelModule,flushServerSideAsyncTransactions:serverSideRowModelModule,refreshServerSide:serverSideRowModelModule,getServerSideGroupLevelState:serverSideRowModelModule,isSideBarVisible:sideBarModule,setSideBarVisible:sideBarModule,setSideBarPosition:sideBarModule,openToolPanel:sideBarModule,closeToolPanel:sideBarModule,getOpenedToolPanel:sideBarModule,refreshToolPanel:sideBarModule,isToolPanelShowing:sideBarModule,getToolPanelInstance:sideBarModule,getSideBar:sideBarModule,getStatusPanel:statusBarModule},clientSide="clientSide",serverSide="serverSide",infinite="infinite",functionRowModels={onGroupExpandedOrCollapsed:[clientSide],refreshClientSideRowModel:[clientSide],forEachLeafNode:[clientSide],forEachNodeAfterFilter:[clientSide],forEachNodeAfterFilterAndSort:[clientSide],resetRowHeights:[clientSide],applyTransaction:[clientSide],applyTransactionAsync:[clientSide],flushAsyncTransactions:[clientSide],getBestCostNodeSelection:[clientSide],getServerSideSelectionState:[serverSide],setServerSideSelectionState:[serverSide],applyServerSideTransaction:[serverSide],applyServerSideTransactionAsync:[serverSide],applyServerSideRowData:[serverSide],retryServerSideLoads:[serverSide],flushServerSideAsyncTransactions:[serverSide],refreshServerSide:[serverSide],getServerSideGroupLevelState:[serverSide],refreshInfiniteCache:[infinite],purgeInfiniteCache:[infinite],getInfiniteRowCount:[infinite],isLastRowIndexKnown:[infinite],expandAll:[clientSide,serverSide],collapseAll:[clientSide,serverSide],onRowHeightChanged:[clientSide,serverSide],setRowCount:[infinite,serverSide],getCacheBlockState:[infinite,serverSide]},deprecatedFunctions={getValue:{version:"v31.3",new:"getCellValue"},getFirstDisplayedRow:{version:"v31.1",new:"getFirstDisplayedRowIndex"},getLastDisplayedRow:{version:"v31.1",new:"getLastDisplayedRowIndex"},getModel:{version:"v31.1",message:"Please use the appropriate grid API methods instead."},setColumnVisible:{version:"v31.1",old:"setColumnVisible(key,visible)",new:"setColumnsVisible([key],visible)"},setColumnPinned:{version:"v31.1",old:"setColumnPinned(key,pinned)",new:"setColumnsPinned([key],pinned)"},moveColumn:{version:"v31.1",old:"moveColumn(key, toIndex)",new:"moveColumns([key], toIndex)"},setColumnWidth:{version:"v31.1",old:"setColumnWidth(col, width)",new:"setColumnWidths([{key: col, newWidth: width}])"},autoSizeColumn:{version:"v31.1",old:"autoSizeColumn(key, skipHeader)",new:"autoSizeColumns([key], skipHeader)"},addAggFunc:{version:"v31.1",old:"addAggFunc(key, func)",new:"addAggFuncs({ key: func })"},removeValueColumn:{version:"v31.1",old:"removeValueColumn(colKey)",new:"removeValueColumns([colKey])"},addValueColumn:{version:"v31.1",old:"addValueColumn(colKey)",new:"addValueColumns([colKey])"},removeRowGroupColumn:{version:"v31.1",old:"removeRowGroupColumn(colKey)",new:"removeRowGroupColumns([colKey])"},addRowGroupColumn:{version:"v31.1",old:"addRowGroupColumn(colKey)",new:"addRowGroupColumns([colKey])"},removePivotColumn:{version:"v31.1",old:"removePivotColumn(colKey)",new:"removePivotColumns([colKey])"},addPivotColumn:{version:"v31.1",old:"addPivotColumn(colKey)",new:"addPivotColumns([colKey])"},showColumnMenuAfterButtonClick:{version:"v31.1",message:"Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere."},showColumnMenuAfterMouseClick:{version:"v31.1",message:"Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere."},getFilterInstance:{version:"v31.1",message:"'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."},showLoadingOverlay:{version:"v32",message:'`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'}};function warnMissingApiFunction(e,t){const i=functionModules[e];i?ModuleRegistry.__assertRegistered(i,`api.${e}`,t)&&_warnOnce(`API function '${e}' not registered to module '${i}'`):_errorOnce(`Unknown API function: '${e}' on GridApi.`)}function validateApiFunction(e,t,i){const s=deprecatedFunctions[e];if(s){const{version:r,new:n,old:l,message:a}=s,d=l??e;return(...h)=>{const c=n?`Please use ${n} instead. `:"";return _warnOnce(`Since ${r} api.${d} is deprecated. ${c}${a??""}`),t.apply(t,h)}}const o=functionRowModels[e];return o?(...r)=>{const n=i.rowModel.getType();if(!o.includes(n)){_errorOnce(`api.${e} can only be called when gridOptions.rowModelType is ${o.join(" or ")}`);return}return t.apply(t,r)}:t}var COLUMN_DEFINITION_DEPRECATIONS={columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"}},CSRM_REQUIRES_ROW_GROUP_MODULE=(e,t)=>(t.rowModelType??"clientSide")==="clientSide"?{module:"@ag-grid-enterprise/row-grouping"}:null,COLUMN_DEFINITION_VALIDATIONS={enableRowGroup:CSRM_REQUIRES_ROW_GROUP_MODULE,rowGroup:CSRM_REQUIRES_ROW_GROUP_MODULE,rowGroupIndex:CSRM_REQUIRES_ROW_GROUP_MODULE,enablePivot:CSRM_REQUIRES_ROW_GROUP_MODULE,enableValue:CSRM_REQUIRES_ROW_GROUP_MODULE,pivot:CSRM_REQUIRES_ROW_GROUP_MODULE,pivotIndex:CSRM_REQUIRES_ROW_GROUP_MODULE,aggFunc:CSRM_REQUIRES_ROW_GROUP_MODULE,cellEditor:e=>e.cellEditor==="agRichSelect"||e.cellEditor==="agRichSelectCellEditor"?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:e=>{const t=["columnsMenuTab","generalMenuTab"];return e.menuTabs?.some(i=>t.includes(i))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],dependencies:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>COL_DEF_VALIDATORS},colDefPropertyMap={headerName:void 0,columnGroupShow:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnsMenuParams:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressCellFlash:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressMenu:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0,context:void 0},ALL_PROPERTIES=Object.keys(colDefPropertyMap),COL_DEF_VALIDATORS={objectName:"colDef",allProperties:ALL_PROPERTIES,docsUrl:"column-properties/",deprecations:COLUMN_DEFINITION_DEPRECATIONS,validations:COLUMN_DEFINITION_VALIDATIONS},GRID_OPTION_DEPRECATIONS=()=>({advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."},suppressLoadingOverlay:{version:"32",message:"Use `loading`=false instead."}}),GRID_OPTION_DEFAULTS={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressGroupMaintainValueType:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0},GRID_OPTION_VALIDATIONS=()=>({sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enterprise/row-grouping",dependencies:e=>{const t=e.rowModelType??"clientSide";switch(t){case"clientSide":{const i=`treeData requires 'getDataPath' in the ${t} row model.`;return e.getDataPath?null:i}case"serverSide":{const i=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${t} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:i}}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],dependencies:e=>{switch(e.rowModelType??"clientSide"){case"clientSide":return null;case"serverSide":return e.suppressServerSideInfiniteScroll?"groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll":null}return null}},groupHideOpenParents:{supportedRowModels:["clientSide"],dependencies:{groupTotalRow:[void 0,"bottom"]}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveLowestSingleChildren:[void 0,!1]}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveSingleChildren:[void 0,!1]}},groupSelectsChildren:{dependencies:{rowSelection:["multiple"]}},viewportDatasource:{supportedRowModels:["viewport"],module:"@ag-grid-enterprise/viewport-row-model"},serverSideDatasource:{supportedRowModels:["serverSide"],module:"@ag-grid-enterprise/server-side-row-model"},cacheBlockSize:{supportedRowModels:["serverSide","infinite"]},datasource:{supportedRowModels:["infinite"],module:"@ag-grid-community/infinite-row-model"},rowData:{supportedRowModels:["clientSide"],module:"@ag-grid-community/client-side-row-model"},columnDefs:()=>COL_DEF_VALIDATORS,defaultColDef:()=>COL_DEF_VALIDATORS,defaultColGroupDef:()=>COL_DEF_VALIDATORS,autoGroupColumnDef:()=>COL_DEF_VALIDATORS}),GRID_OPTIONS_VALIDATORS=()=>({objectName:"gridOptions",allProperties:[...PropertyKeys.ALL_PROPERTIES,...ComponentUtil.EVENT_CALLBACKS],propertyExceptions:["api"],docsUrl:"grid-options/",deprecations:GRID_OPTION_DEPRECATIONS(),validations:GRID_OPTION_VALIDATIONS()}),ValidationService=class extends BeanStub{constructor(){super(...arguments),this.beanName="validationService"}wireBeans(e){this.beans=e,this.gridOptions=e.gridOptions}postConstruct(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,GRID_OPTIONS_VALIDATORS())}processColumnDefs(e){this.processOptions(e,COL_DEF_VALIDATORS)}warnMissingApiFunction(e){warnMissingApiFunction(e,this.gridId)}validateApiFunction(e,t){return validateApiFunction(e,t,this.beans)}processOptions(e,t){const{validations:i,deprecations:s,allProperties:o,propertyExceptions:r,objectName:n,docsUrl:l}=t;o&&this.gridOptions.suppressPropertyNamesCheck!==!0&&this.checkProperties(e,[...r??[],...Object.keys(s)],o,n,l);const a=new Set;Object.keys(e).forEach(h=>{const c=s[h];if(c)if("renamed"in c){const{renamed:C,version:w}=c;a.add(`As of v${w}, ${String(h)} is deprecated. Please use ${String(C)} instead.`),e[C]=e[h]}else{const{message:C,version:w}=c;a.add(`As of v${w}, ${String(h)} is deprecated. ${C??""}`)}const u=e[h];if(u==null||u===!1)return;const g=i[h];let p;if(g)if(typeof g=="function"){const C=g(e,this.gridOptions);if(!C)return;if("objectName"in C){const w=e[h];if(Array.isArray(w)){w.forEach(y=>{this.processOptions(y,C)});return}this.processOptions(e[h],C);return}p=C}else p=g;else return;const{module:m,dependencies:f,supportedRowModels:v}=p;if(v){const C=this.gridOptions.rowModelType??"clientSide";if(!v.includes(C)){a.add(`${String(h)} is not supported with the '${C}' row model.`);return}}if(m){const C=Array.isArray(m)?m:[m];let w=!0;if(C.forEach(y=>{ModuleRegistry.__assertRegistered(y,String(h),this.gridId)||(w=!1,a.add(`${String(h)} is only available when ${y} is loaded.`))}),!w)return}if(f){const C=this.checkForWarning(h,f,e);if(C){a.add(C);return}}}),a.size>0&&a.forEach(h=>{_warnOnce(h)})}checkForWarning(e,t,i){if(typeof t=="function")return t(i,this.gridOptions);const o=Object.entries(t).find(([l,a])=>{const d=i[l];return!a.includes(d)});if(!o)return null;const[r,n]=o;return n.length>1?`'${String(e)}' requires '${r}' to be one of [${n.join(", ")}].`:`'${String(e)}' requires '${r}' to be ${n[0]}.`}checkProperties(e,t,i,s,o){const r=["__ob__","__v_skip","__metadata__"],n=_fuzzyCheckStrings(Object.getOwnPropertyNames(e),[...r,...t,...i],i);if(_iterateObject(n,(l,a)=>{let d=`invalid ${s} property '${l}' did you mean any of these: ${a.slice(0,8).join(", ")}.`;i.includes("context")&&(d+=`
|
|
192
|
-
If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),_warnOnce(d)}),Object.keys(n).length>0&&o){const l=this.getFrameworkOverrides().getDocLink(o);_warnOnce(`to see all the valid ${s} properties please check: ${l}`)}}},GridCoreModule={version:VERSION,moduleName:"@ag-grid-community/core"},ValidationsModule={version:VERSION,moduleName:"@ag-grid-community/core-validations",beans:[ValidationService]},CommunityFeaturesModule={version:VERSION,moduleName:"@ag-grid-community/core-community-features",dependantModules:[GridCoreModule,ValidationsModule,EditModule,FilterModule,StateModule,DataTypeModule,AlignedGridsModule,PaginationModule,CommunityApiModule]},GridDestroyService=class extends BeanStub{constructor(){super(...arguments),this.beanName="gridDestroyService",this.destroyCalled=!1}wireBeans(e){this.beans=e}destroy(){if(this.destroyCalled)return;const e={type:"gridPreDestroyed",state:this.beans.stateService?.getState()??{}};this.eventService.dispatchEvent(e),this.destroyCalled=!0,this.beans.ctrlsService.get("gridCtrl")?.destroyGridUi(),this.beans.context.destroy(),super.destroy()}isDestroyCalled(){return this.destroyCalled}},ALWAYS_SYNC_GLOBAL_EVENTS=new Set(["gridPreDestroyed","fillStart","pasteStart"]),isSelectionUIEvent=e=>e==="checkboxSelected"||e==="rowClicked"||e==="spaceKey"||e==="uiSelectAll"||e==="uiSelectAllCurrentPage"||e==="uiSelectAllFiltered",PROPERTY_COERCIONS=new Map([...PropertyKeys.BOOLEAN_PROPERTIES.map(e=>[e,toBoolean]),...PropertyKeys.NUMBER_PROPERTIES.map(e=>[e,toNumber]),["groupAggFiltering",e=>typeof e=="function"?e:toBoolean(e)],["pageSize",toConstrainedNum(1)],["autoSizePadding",toConstrainedNum(0)],["keepDetailRowsCount",toConstrainedNum(1)],["rowBuffer",toConstrainedNum(0)],["infiniteInitialRowCount",toConstrainedNum(1)],["cacheOverflowSize",toConstrainedNum(1)],["cacheBlockSize",toConstrainedNum(1)],["serverSideInitialRowCount",toConstrainedNum(1)],["viewportRowModelPageSize",toConstrainedNum(1)],["viewportRowModelBufferSize",toConstrainedNum(0)]]);function getCoercedValue(e,t){const i=PROPERTY_COERCIONS.get(e);return i?i(t):t}function getCoercedGridOptions(e){const t={};return Object.entries(e).forEach(([i,s])=>{const o=getCoercedValue(i,s);t[i]=o}),t}var _GridOptionsService=class W extends BeanStub{constructor(){super(...arguments),this.beanName="gos",this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new LocalEventService,this.globalEventHandlerFactory=t=>(i,s)=>{if(!this.isAlive())return;const o=ALWAYS_SYNC_GLOBAL_EVENTS.has(i);if(o&&!t||!o&&t)return;const r=ComponentUtil.getCallbackForEvent(i),n=this.gridOptions[r];typeof n=="function"&&this.frameworkOverrides.wrapOutgoing(()=>{n(s)})}}wireBeans(t){this.gridOptions=t.gridOptions,this.eGridDiv=t.eGridDiv,this.validationService=t.validationService,this.environment=t.environment,this.api=t.gridApi}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){const t=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),t),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.getScrollbarWidth(),this.addManagedEventListeners({gridOptionsChanged:({options:i})=>{this.updateGridOptions({options:i,force:!0,source:"gridOptionsUpdated"})}})}get(t){return this.gridOptions[t]??GRID_OPTION_DEFAULTS[t]}getCallback(t){return this.mergeGridCommonParams(this.gridOptions[t])}exists(t){return _exists(this.gridOptions[t])}mergeGridCommonParams(t){return t&&(s=>{const o=s;return o.api=this.api,o.context=this.gridOptionsContext,t(o)})}updateGridOptions({options:t,force:i,source:s="api"}){const o={id:W.changeSetId++,properties:[]},r=[];Object.entries(t).forEach(([n,l])=>{s==="api"&&INITIAL_GRID_OPTION_KEYS[n]&&_warnOnce(`${n} is an initial property and cannot be updated.`);const a=getCoercedValue(n,l),d=i||typeof a=="object"&&s==="api",h=this.gridOptions[n];if(d||h!==a){this.gridOptions[n]=a;const c={type:n,currentValue:a,previousValue:h,changeSet:o,source:s};r.push(c)}}),this.validationService?.processGridOptions(this.gridOptions),o.properties=r.map(n=>n.type),r.forEach(n=>{this.gridOptions.debug&&_log(`Updated property ${n.type} from`,n.previousValue," to ",n.currentValue),this.propertyEventService.dispatchEvent(n)})}addPropertyEventListener(t,i){this.propertyEventService.addEventListener(t,i)}removePropertyEventListener(t,i){this.propertyEventService.removeEventListener(t,i)}getScrollbarWidth(){if(this.scrollbarWidth==null){const i=typeof this.gridOptions.scrollbarWidth=="number"&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:_getScrollbarWidth();i!=null&&(this.scrollbarWidth=i,this.eventService.dispatchEvent({type:"scrollbarWidthChanged"}))}return this.scrollbarWidth}isRowModelType(t){return this.gridOptions.rowModelType===t||t==="clientSide"&&_missing(this.gridOptions.rowModelType)}isDomLayout(t){return(this.gridOptions.domLayout??"normal")===t}isRowSelection(){return this.gridOptions.rowSelection==="single"||this.gridOptions.rowSelection==="multiple"}useAsyncEvents(){return!this.get("suppressAsyncEvents")}isGetRowHeightFunction(){return typeof this.gridOptions.getRowHeight=="function"}getRowHeightForNode(t,i=!1,s){if(s==null&&(s=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(i)return{height:s,estimated:!0};const r={node:t,data:t.data},n=this.getCallback("getRowHeight")(r);if(this.isNumeric(n))return n===0&&_warnOnce("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,n),estimated:!1}}return t.detail&&this.get("masterDetail")?this.getMasterDetailRowHeight():{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:s,estimated:!1}}getMasterDetailRowHeight(){return this.get("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||_missing(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const t=this.environment.refreshRowHeightVariable();return t!==-1?t:(_warnOnce("row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(t){return!isNaN(t)&&typeof t=="number"&&isFinite(t)}getDomDataKey(){return this.domDataKey}getDomData(t,i){const s=t[this.getDomDataKey()];return s?s[i]:void 0}setDomData(t,i,s){const o=this.getDomDataKey();let r=t[o];_missing(r)&&(r={},t[o]=r),r[i]=s}getDocument(){let t=null;return this.gridOptions.getDocument&&_exists(this.gridOptions.getDocument)?t=this.gridOptions.getDocument():this.eGridDiv&&(t=this.eGridDiv.ownerDocument),t&&_exists(t)?t:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getActiveDomElement(){return this.getRootNode().activeElement}getAsyncTransactionWaitMillis(){return _exists(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return this.get("ensureDomOrder")?!1:this.get("animateRows")}isGroupRowsSticky(){return!(this.get("paginateChildRows")||this.get("groupHideOpenParents")||this.isDomLayout("print"))}isColumnsSortingCoupledToGroup(){return!this.gridOptions.autoGroupColumnDef?.comparator&&!this.get("treeData")}getGroupAggFiltering(){const t=this.gridOptions.groupAggFiltering;if(typeof t=="function")return this.getCallback("groupAggFiltering");if(t===!0)return()=>!0}getGrandTotalRow(){const t=this.gridOptions.grandTotalRow;if(t)return t;if(this.gridOptions.groupIncludeTotalFooter)return"bottom"}getGroupTotalRowCallback(){const t=this.get("groupTotalRow");if(typeof t=="function")return this.getCallback("groupTotalRow");if(t)return()=>t;const i=this.get("groupIncludeFooter");if(typeof i=="function"){const s=this.getCallback("groupIncludeFooter");return o=>s(o)?"bottom":void 0}return()=>i?"bottom":void 0}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?this.gridOptions.groupDisplayType==="multipleColumns":this.get("groupHideOpenParents")}isGroupUseEntireRow(t){return t?!1:this.gridOptions.groupDisplayType==="groupRows"}getGridCommonParams(){return{api:this.api,context:this.gridOptionsContext}}addGridCommonParams(t){const i=t;return i.api=this.api,i.context=this.gridOptionsContext,i}getRowIdCallback(){const t=this.getCallback("getRowId");return t===void 0?t:i=>{let s=t(i);return typeof s!="string"&&(_warnOnce(`The getRowId callback must return a string. The ID ${s} is being cast to a string.`),s=String(s)),s}}};_GridOptionsService.changeSetId=0;var GridOptionsService=_GridOptionsService,HeaderPositionUtils=class extends BeanStub{constructor(){super(...arguments),this.beanName="headerPositionUtils"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}findHeader(e,t){let i,s;if(isColumnGroup(e.column)?i=this.visibleColsService.getGroupAtDirection(e.column,t):(s=`getCol${t}`,i=this.visibleColsService[s](e.column)),!i)return;const{headerRowIndex:o}=e;if(this.getHeaderRowType(o)!=="filter"){const l=[i];for(;i.getParent();)i=i.getParent(),l.push(i);i=l[l.length-1-o]}const{column:r,headerRowIndex:n}=this.getHeaderIndexToFocus(i,o);return{column:r,headerRowIndex:n}}getHeaderIndexToFocus(e,t){let i;if(isColumnGroup(e)&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const s=e;i=s.getLeafColumns()[0];let o=i;for(;o!==s;)t++,o=o.getParent()}return{column:i||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return e?e.getLeafColumns().some(t=>t.isSpanHeaderHeight()):!1}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),s=i==="filter",o=i==="column";let r=s?e:e.getParent(),n=t-1,l=n;if(o&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;r&&r.isPadding();)r=r.getParent(),n--;l=n,n<0&&(r=e,n=t,l=void 0)}return{column:r,headerRowIndex:n,headerRowIndexWithoutSpan:l}}getColumnVisibleChild(e,t,i="After"){const s=this.getHeaderRowType(t);let o=e,r=t+1;const n=r;if(s==="group"){const l=e.getDisplayedLeafColumns(),a=i==="After"?l[0]:_last(l),d=[];let h=a;for(;h.getParent()!==e;)h=h.getParent(),d.push(h);if(o=a,a.isSpanHeaderHeight())for(let c=d.length-1;c>=0;c--){const u=d[c];if(!u.isPadding()){o=u;break}r++}else o=_last(d),o||(o=a)}return{column:o,headerRowIndex:r,headerRowIndexWithoutSpan:n}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.visibleColsService.getAllCols(),s=i[t==="start"?0:i.length-1];if(!s)return;const r=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()).getRowType(e);if(r=="group"){const n=this.visibleColsService.getColGroupAtLevel(s,e);return{headerRowIndex:e,column:n}}return{headerRowIndex:r==null?-1:e,column:s}}},LocaleService=class extends BeanStub{constructor(){super(...arguments),this.beanName="localeService"}getLocaleTextFunc(){const e=this.gos.getCallback("getLocaleText");if(e)return(i,s,o)=>e({key:i,defaultValue:s,variableValues:o});const t=this.gos.get("localeText");return(i,s,o)=>{let r=t&&t[i];if(r&&o&&o.length){let n=0;for(;!(n>=o.length||r.indexOf("${variable}")===-1);)r=r.replace("${variable}",o[n++])}return r??s}}},ApiEventService=class extends BeanStub{constructor(){super(...arguments),this.beanName="apiEventService",this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new FrameworkEventListenerService(this.getFrameworkOverrides())}addEventListener(e,t){const i=this.frameworkEventWrappingService.wrap(t),s=this.gos.useAsyncEvents()&&!ALWAYS_SYNC_GLOBAL_EVENTS.has(e),o=s?this.asyncEventListeners:this.syncEventListeners;o.has(e)||o.set(e,new Set),o.get(e).add(i),this.eventService.addEventListener(e,i,s)}removeEventListener(e,t){const i=this.frameworkEventWrappingService.unwrap(t),o=!!this.asyncEventListeners.get(e)?.delete(i);o||this.syncEventListeners.get(e)?.delete(i),this.eventService.removeEventListener(e,i,o)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e);if(this.gos.useAsyncEvents()){const s=(r,n)=>{ALWAYS_SYNC_GLOBAL_EVENTS.has(r)&&t(r,n)},o=(r,n)=>{ALWAYS_SYNC_GLOBAL_EVENTS.has(r)||t(r,n)};this.globalEventListenerPairs.set(e,{syncListener:s,asyncListener:o}),this.eventService.addGlobalListener(s,!1),this.eventService.addGlobalListener(o,!0)}else this.syncGlobalEventListeners.add(t),this.eventService.addGlobalListener(t,!1)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e);if(this.globalEventListenerPairs.has(t)){const{syncListener:s,asyncListener:o}=this.globalEventListenerPairs.get(t);this.eventService.removeGlobalListener(s,!1),this.eventService.removeGlobalListener(o,!0),this.globalEventListenerPairs.delete(e)}else this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,!1)}destroyEventListeners(e,t){e.forEach((i,s)=>{i.forEach(o=>this.eventService.removeEventListener(s,o,t)),i.clear()}),e.clear()}destroyGlobalListeners(e,t){e.forEach(i=>this.eventService.removeGlobalListener(i,t)),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach(({syncListener:e,asyncListener:t})=>{this.eventService.removeGlobalListener(e,!1),this.eventService.removeGlobalListener(t,!0)}),this.globalEventListenerPairs.clear()}},PageBoundsListener=class extends BeanStub{constructor(){super(...arguments),this.beanName="pageBoundsListener"}wireBeans(e){this.rowModel=e.rowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this),recalculateRowBounds:this.calculatePages.bind(this)}),this.onModelUpdated()}onModelUpdated(e){this.calculatePages();const t={type:"paginationChanged",animate:e?e.animate:!1,newData:e?e.newData:!1,newPage:e?e.newPage:!1,newPageSize:e?e.newPageSize:!1,keepRenderedRows:e?e.keepRenderedRows:!1};this.eventService.dispatchEvent(t)}calculatePages(){this.paginationService?this.paginationService.calculatePages():this.pageBoundsService.calculateBounds(0,this.rowModel.getRowCount()-1)}},PageBoundsService=class extends BeanStub{constructor(){super(...arguments),this.beanName="pageBoundsService",this.pixelOffset=0}wireBeans(e){this.rowModel=e.rowModel}getFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getCurrentPageHeight(){return _missing(this.topRowBounds)||_missing(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){const e=this.topRowBounds?this.topRowBounds.rowTop:0,t=this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0;return{pageFirstPixel:e,pageLastPixel:t}}calculateBounds(e,t){this.topRowBounds=this.rowModel.getRowBounds(e),this.topRowBounds&&(this.topRowBounds.rowIndex=e),this.bottomRowBounds=this.rowModel.getRowBounds(t),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=t),this.calculatePixelOffset()}getPixelOffset(){return this.pixelOffset}calculatePixelOffset(){const e=_exists(this.topRowBounds)?this.topRowBounds.rowTop:0;this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:"paginationPixelOffsetChanged"}))}},AriaAnnouncementService=class extends BeanStub{constructor(){super(),this.beanName="ariaAnnouncementService",this.descriptionContainer=null,this.announceValue=_debounce(this.announceValue.bind(this),200)}wireBeans(e){this.eGridDiv=e.eGridDiv}postConstruct(){const e=this.gos.getDocument(),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),_setAriaLive(t,"polite"),_setAriaRelevant(t,"additions text"),_setAriaAtomic(t,!0),this.eGridDiv.appendChild(t)}announceValue(e){this.descriptionContainer&&(this.descriptionContainer.textContent="",setTimeout(()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=e)},50))}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(_clearElement(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null}},ColumnAnimationService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnAnimationService",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.suppressAnimation=!1,this.animationThreadCount=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&this.flush(()=>{this.active=!1})}executeNextVMTurn(e){this.active?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(e){if(this.executeNextFuncs.length===0&&this.executeLaterFuncs.length===0){e();return}const t=i=>{for(;i.length;){const s=i.pop();s&&s()}};this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>t(this.executeNextFuncs),0),window.setTimeout(()=>{e(),t(this.executeLaterFuncs)},200)})}},ColumnHoverService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnHoverService"}setMouseOver(e){this.selectedColumns=e;const t={type:"columnHoverChanged"};this.eventService.dispatchEvent(t)}clearMouseOver(){this.selectedColumns=null;const e={type:"columnHoverChanged"};this.eventService.dispatchEvent(e)}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}},OverlayService=class extends BeanStub{constructor(){super(...arguments),this.beanName="overlayService",this.state=0,this.showInitialOverlay=!0}wireBeans(e){this.userComponentFactory=e.userComponentFactory,this.rowModel=e.rowModel,this.columnModel=e.columnModel}postConstruct(){const e=()=>this.updateOverlayVisibility();this.addManagedEventListeners({newColumnsLoaded:e,rowDataUpdated:e}),this.addManagedPropertyListener("loading",e)}registerOverlayWrapperComp(e){this.overlayWrapperComp=e,this.updateOverlayVisibility()}showLoadingOverlay(){this.showInitialOverlay=!1;const e=this.gos.get("loading");!e&&(e!==void 0||this.gos.get("suppressLoadingOverlay"))||this.doShowLoadingOverlay()}showNoRowsOverlay(){this.showInitialOverlay=!1,!(this.gos.get("loading")||this.gos.get("suppressNoRowsOverlay"))&&this.doShowNoRowsOverlay()}hideOverlay(){this.showInitialOverlay=!1,!this.gos.get("loading")&&this.doHideOverlay()}updateOverlayVisibility(){let e=this.gos.get("loading");this.showInitialOverlay&&e===void 0&&!this.gos.get("suppressLoadingOverlay")&&(e=!this.gos.get("columnDefs")||!this.columnModel.isReady()||!this.gos.get("rowData")&&this.gos.isRowModelType("clientSide")),e?this.state!==1&&this.doShowLoadingOverlay():(this.showInitialOverlay=!1,this.rowModel.isEmpty()&&!this.gos.get("suppressNoRowsOverlay")&&this.gos.isRowModelType("clientSide")?this.state!==2&&this.doShowNoRowsOverlay():this.state!==0&&this.doHideOverlay())}doShowLoadingOverlay(){this.state=1,this.showOverlay(this.userComponentFactory.getLoadingOverlayCompDetails({}),"ag-overlay-loading-wrapper","loadingOverlayComponentParams")}doShowNoRowsOverlay(){this.state=2,this.showOverlay(this.userComponentFactory.getNoRowsOverlayCompDetails({}),"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams")}doHideOverlay(){this.state=0,this.overlayWrapperComp.hideOverlay()}showOverlay(e,t,i){const s=e.newAgStackInstance();this.overlayWrapperComp.showOverlay(s,t,i)}},RowCssClassCalculator=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowCssClassCalculator"}wireBeans(e){this.stylingService=e.stylingService}getInitialRowClasses(e){const t=[];return _exists(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),_pushAll(t,this.processClassesFromGridOptions(e.rowNode)),_pushAll(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&(e.pinned==="left"&&t.push("ag-cell-last-left-pinned"),e.pinned==="right"&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],i=r=>{typeof r=="string"?t.push(r):Array.isArray(r)&&r.forEach(n=>t.push(n))},s=this.gos.get("rowClass");if(s){if(typeof s=="function")return _warnOnce("rowClass should not be a function, please use getRowClass instead"),[];i(s)}const o=this.gos.getCallback("getRowClass");if(o){const r={data:e.data,node:e,rowIndex:e.rowIndex},n=o(r);i(n)}return t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,i=>{t.push(i)},()=>{}),t}processRowClassRules(e,t,i){const s=this.gos.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),s,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}},RowContainerHeightService=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowContainerHeightService",this.scrollY=0,this.uiBodyHeight=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=_getMaxDivHeight(),this.gos.get("debug")&&_log("RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,i=this.getUiBodyHeight();(t!==this.scrollY||i!==this.uiBodyHeight)&&(this.scrollY=t,this.uiBodyHeight=i,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.gos.get("debug")&&_log(`RowContainerHeightService - Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:"rowContainerHeightChanged"}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t=typeof e=="number"?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:"heightScaleChanged"}))}setModelHeight(e){this.modelHeight=e,this.stretching=e!=null&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return t.bottom-t.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=this.modelHeight-this.getUiBodyHeight(),i=e/t;return this.maxScrollY*i}},RowNodeSorter=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowNodeSorter"}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.showRowGroupColsService=e.showRowGroupColsService}postConstruct(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",e=>this.isAccentedSort=e.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup())}doFullSort(e,t){const i=(o,r)=>({currentPos:r,rowNode:o}),s=e.map(i);return s.sort(this.compareRowNodes.bind(this,t)),s.map(o=>o.rowNode)}compareRowNodes(e,t,i){const s=t.rowNode,o=i.rowNode;for(let r=0,n=e.length;r<n;r++){const l=e[r],a=l.sort==="desc",d=this.getValue(s,l.column),h=this.getValue(o,l.column);let c;const u=this.getComparator(l,s);if(u?c=u(d,h,s,o,a):c=_defaultComparator(d,h,this.isAccentedSort),!isNaN(c)&&c!==0)return l.sort==="asc"?c:c*-1}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,s=i.getColDef().comparator;if(s!=null)return s;if(!i.getColDef().showRowGroup)return;const o=!t.group&&i.getColDef().field;if(!o)return;const r=this.columnModel.getColDefCol(o);if(r)return r.getColDef().comparator}getValue(e,t){if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(this.gos.isGroupUseEntireRow(this.columnModel.isPivotActive())){const r=e.allLeafChildren?.[0];return r?this.valueService.getValue(t,r,!1,!1):void 0}const o=this.showRowGroupColsService?.getShowRowGroupCol(t.getId());return o?e.groupData?.[o.getId()]:void 0}if(!(e.group&&t.getColDef().showRowGroup))return this.valueService.getValue(t,e,!1,!1)}},ChangedPath=class{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let s=0;s<e.childrenAfterGroup.length;s++){const o=e.childrenAfterGroup[s];o.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[s],t,i):i&&t(o)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];){const s={rowNode:t,children:null};this.mapToItems[t.id]=s,i++,t=t.parent}return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach(s=>this.nodeIdsToColumns[i.id][s.getId()]=!0),i=i.parent}linkPathItems(e,t){let i=e;for(let s=0;s<t;s++){const o=this.mapToItems[i.id],r=this.mapToItems[i.parent.id];r.children||(r.children=[]),r.children.push(o),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter(o=>i[o.getId()])}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter(o=>!i[o.getId()])}},SelectionService=class extends BeanStub{constructor(){super(...arguments),this.beanName="selectionService",this.selectedNodes=new Map,this.selectionCtx=new RowRangeSelectionContext}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.selectionCtx.init(this.rowModel),this.rowSelection=this.gos.get("rowSelection"),this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],()=>{this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.rowSelection=this.gos.get("rowSelection"),this.deselectAllRowNodes({source:"api"})}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes(),this.selectionCtx.reset()}isMultiselect(){return this.rowSelection==="multiple"}overrideSelectionValue(e,t){if(!isSelectionUIEvent(t))return e;const i=this.selectionCtx.getRoot();return i?i.isSelected()??!1:!0}setNodesSelected(e){const{newValue:t,clearSelection:i,suppressFinishActions:s,rangeSelect:o,nodes:r,event:n,source:l}=e;if(r.length===0)return 0;if(r.length>1&&!this.isMultiselect())return _warnOnce("cannot multi select while rowSelection='single'"),0;const a=this.groupSelectsChildren&&e.groupSelectsFiltered===!0,d=r.map(c=>c.footer?c.sibling:c);if(o){if(d.length>1)return _warnOnce("cannot range select while selecting multiple rows"),0;const c=d[0],u=this.overrideSelectionValue(t,l);if(this.isMultiselect()){if(this.selectionCtx.isInRange(c)){const g=this.selectionCtx.truncate(c);return u&&this.selectRange(g.discard,!1,l),this.selectRange(g.keep,u,l)}else if(this.selectionCtx.getRoot()!==c){const m=this.selectionCtx.extend(c,this.groupSelectsChildren);return u&&this.selectRange(m.discard,!1,l),this.selectRange(m.keep,u,l)}}}s||this.selectionCtx.setRoot(d[0]);let h=0;for(let c=0;c<d.length;c++){const u=d[c];a&&u.group||u.selectThisNode(t,n,l)&&h++,this.groupSelectsChildren&&u.childrenAfterGroup?.length&&(h+=this.selectChildren(u,t,a,l))}return s||(t&&(i||!this.isMultiselect())&&(h+=this.clearOtherNodes(d[0],l)),h>0&&(this.updateGroupsFromChildrenSelections(l),this.dispatchSelectionChanged(l))),h}selectRange(e,t,i){let s=0;return e.forEach(o=>{if(o.group&&this.groupSelectsChildren)return;o.selectThisNode(t,void 0,i)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(i),this.dispatchSelectionChanged(i)),s}selectChildren(e,t,i,s){const o=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return _missing(o)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:s,nodes:o})}getSelectedNodes(){const e=[];return this.selectedNodes.forEach(t=>{t&&e.push(t)}),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>{t&&t.data&&e.push(t.data)}),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((i,s)=>{i&&e(i)&&t.set(s,i)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren||this.rowModel.getType()!=="clientSide")return!1;const s=this.rowModel.getRootNode();t||(t=new ChangedPath(!0,s),t.setInactive());let o=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==s){const n=r.calculateSelectedFromChildren();o=r.selectThisNode(n===null?!1:n,void 0,e)||o}}),o}clearOtherNodes(e,t){const i=new Map;let s=0;return this.selectedNodes.forEach(o=>{if(o&&o.id!==e.id){const r=this.selectedNodes.get(o.id);s+=r.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&o.parent&&i.set(o.parent.id,o.parent)}}),i.forEach(o=>{const r=o.calculateSelectedFromChildren();o.selectThisNode(r===null?!1:r,void 0,t)}),s}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){if(_exists(t)&&e.id!==t.id&&t){const s=t.id;this.selectedNodes.get(s)==e&&this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes?.clear()}getBestCostNodeSelection(){if(this.rowModel.getType()!=="clientSide")return;const t=this.rowModel.getTopLevelNodes();if(t===null)return;const i=[];function s(o){for(let r=0,n=o.length;r<n;r++){const l=o[r];if(l.isSelected())i.push(l);else{const a=l;a.group&&a.children&&s(a.children)}}}return s(t),i}isEmpty(){let e=0;return this.selectedNodes.forEach(t=>{t&&e++}),e===0}deselectAllRowNodes(e){const t=n=>n.selectThisNode(!1,void 0,s),i=this.rowModel.getType()==="clientSide",{source:s,justFiltered:o,justCurrentPage:r}=e;if(r||o){if(!i){_errorOnce("selecting just filtered only works when gridOptions.rowModelType='clientSide'");return}this.getNodesToSelect(o,r).forEach(t)}else this.selectedNodes.forEach(n=>{n&&t(n)}),this.reset(s);this.selectionCtx.reset(),i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(s),this.dispatchSelectionChanged(s)}getSelectedCounts(e,t){let i=0,s=0;const o=r=>{this.groupSelectsChildren&&r.group||(r.isSelected()?i++:r.selectable&&s++)};return this.getNodesToSelect(e,t).forEach(o),{selectedCount:i,notSelectedCount:s}}getSelectAllState(e,t){const{selectedCount:i,notSelectedCount:s}=this.getSelectedCounts(e,t);return i===0&&s===0?!1:i>0&&s>0?null:i>0}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter(i=>i.selectable).length>0}getNodesToSelect(e=!1,t=!1){if(this.rowModel.getType()!=="clientSide")throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const i=[];if(t)return this.forEachNodeOnPage(o=>{if(!o.group){i.push(o);return}if(!o.expanded){const r=n=>{i.push(n),n.childrenAfterFilter?.length&&n.childrenAfterFilter.forEach(r)};r(o);return}this.groupSelectsChildren||i.push(o)}),i;const s=this.rowModel;return e?(s.forEachNodeAfterFilter(o=>{i.push(o)}),i):(s.forEachNode(o=>{i.push(o)}),i)}forEachNodeOnPage(e){const t=this.pageBoundsService.getFirstRow(),i=this.pageBoundsService.getLastRow();for(let s=t;s<=i;s++){const o=this.rowModel.getRow(s);o&&e(o)}}selectAllRowNodes(e){if(this.rowModel.getType()!=="clientSide")throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const{source:t,justFiltered:i,justCurrentPage:s}=e,o=this.getNodesToSelect(i,s);o.forEach(r=>r.selectThisNode(!0,void 0,t)),this.selectionCtx.setRoot(o[0]??null),this.selectionCtx.setEndRange(_last(o)??null),this.rowModel.getType()==="clientSide"&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t),this.dispatchSelectionChanged(t)}getSelectionState(){const e=[];return this.selectedNodes.forEach(t=>{t?.id&&e.push(t.id)}),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return;const i=new Set(e),s=[];this.rowModel.forEachNode(o=>{i.has(o.id)&&s.push(o)}),this.setNodesSelected({newValue:!0,nodes:s,source:t})}dispatchSelectionChanged(e){const t={type:"selectionChanged",source:e};this.eventService.dispatchEvent(t)}},SelectableService=class extends BeanStub{constructor(){super(...arguments),this.beanName="selectableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){this.addManagedPropertyListener("isRowSelectable",()=>this.updateSelectable())}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const t=!!this.gos.get("rowSelection"),i=this.gos.get("isRowSelectable");if(!t||!i)return;const s=this.gos.get("groupSelectsChildren"),o=this.rowModel.getType()==="clientSide"&&s,r=[],n=l=>{if(e&&!l.group)return;if(o&&l.group){const d=l.childrenAfterGroup.some(h=>h.selectable===!0);l.setRowSelectable(d,!0);return}const a=i?i(l):!0;l.setRowSelectable(a,!0),!a&&l.isSelected()&&r.push(l)};if(o){const l=this.rowModel;new ChangedPath(!1,l.getRootNode()).forEachChangedNodeDepthFirst(n,!0,!0)}else this.rowModel.forEachNode(n);r.length&&this.selectionService.setNodesSelected({nodes:r,newValue:!1,source:"selectableChanged"}),o&&this.selectionService instanceof SelectionService&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}},DEFAULT_SORTING_ORDER=["asc","desc",null],SortController=class extends BeanStub{constructor(){super(...arguments),this.beanName="sortController"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.showRowGroupColsService=e.showRowGroupColsService}progressSort(e,t,i){const s=this.getNextSortDirection(e);this.setSortForColumn(e,s,t,i)}setSortForColumn(e,t,i,s){t!=="asc"&&t!=="desc"&&(t=null);const o=this.gos.isColumnsSortingCoupledToGroup();let r=[e];if(o&&e.getColDef().showRowGroup){const d=this.funcColsService.getSourceColumnsForGroupColumn(e)?.filter(h=>h.isSortable());d&&(r=[e,...d])}r.forEach(a=>a.setSort(t,s));const n=(i||this.gos.get("alwaysMultiSort"))&&!this.gos.get("suppressMultiSort"),l=[];if(!n){const a=this.clearSortBarTheseColumns(r,s);l.push(...a)}this.updateSortIndex(e),l.push(...r),this.dispatchSortChangedEvents(s,l)}updateSortIndex(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=this.showRowGroupColsService?.getShowRowGroupCol(e.getId()),s=t&&i||e,o=this.getColumnsWithSortingOrdered();this.columnModel.getAllCols().forEach(l=>l.setSortIndex(null));const r=o.filter(l=>t&&l.getColDef().showRowGroup?!1:l!==s);(s.getSort()?[...r,s]:r).forEach((l,a)=>{l.setSortIndex(a)})}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const t=this.columnModel.getAllCols().filter(i=>!!i.getSort());return t&&t.length>0}dispatchSortChangedEvents(e,t){const i={type:"sortChanged",source:e};t&&(i.columns=t),this.eventService.dispatchEvent(i)}clearSortBarTheseColumns(e,t){const i=[];return this.columnModel.getAllCols().forEach(s=>{e.includes(s)||(s.getSort()&&i.push(s),s.setSort(void 0,t))}),i}getNextSortDirection(e){let t;if(e.getColDef().sortingOrder?t=e.getColDef().sortingOrder:this.gos.get("sortingOrder")?t=this.gos.get("sortingOrder"):t=DEFAULT_SORTING_ORDER,!Array.isArray(t)||t.length<=0)return _warnOnce(`sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort()),s=i<0,o=i==t.length-1;let r;return s||o?r=t[0]:r=t[i+1],DEFAULT_SORTING_ORDER.indexOf(r)<0?(_warnOnce("invalid sort type ",r),null):r}getIndexedSortMap(){let e=this.columnModel.getAllCols().filter(r=>!!r.getSort());if(this.columnModel.isPivotMode()){const r=this.gos.isColumnsSortingCoupledToGroup();e=e.filter(n=>{const l=!!n.getAggFunc(),a=!n.isPrimary(),d=r?this.showRowGroupColsService?.getShowRowGroupCol(n.getId()):n.getColDef().showRowGroup;return l||a||d})}const t=this.funcColsService.getRowGroupColumns().filter(r=>!!r.getSort()),i={};e.forEach((r,n)=>i[r.getId()]=n),e.sort((r,n)=>{const l=r.getSortIndex(),a=n.getSortIndex();if(l!=null&&a!=null)return l-a;if(l==null&&a==null){const d=i[r.getId()],h=i[n.getId()];return d>h?1:-1}else return a==null?-1:1});const s=this.gos.isColumnsSortingCoupledToGroup()&&!!t.length;s&&(e=[...new Set(e.map(r=>this.showRowGroupColsService?.getShowRowGroupCol(r.getId())??r))]);const o=new Map;return e.forEach((r,n)=>o.set(r,n)),s&&t.forEach(r=>{const n=this.showRowGroupColsService.getShowRowGroupCol(r.getId());o.set(r,o.get(n))}),o}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([e,t],[i,s])=>t-s).map(([e])=>e)}getSortModel(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),colId:e.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),column:e}))}canColumnDisplayMixedSort(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.funcColsService.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!t?.length)return e.getSort();const s=e.getColDef().field!=null||!!e.getColDef().valueGetter?[e,...t]:t,o=s[0].getSort();return s.every(n=>n.getSort()==o)?o:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}},SyncService=class extends BeanStub{constructor(){super(...arguments),this.beanName="syncService",this.waitingForColumns=!1}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.rowModel=e.rowModel}postConstruct(){this.addManagedPropertyListener("columnDefs",e=>this.setColumnDefs(e))}start(){this.ctrlsService.whenReady(()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(e){this.columnModel.setColumnDefs(e??[],"gridInitializing"),this.rowModel.start()}gridReady(){this.dispatchGridReadyEvent();const e=ModuleRegistry.__isRegistered("@ag-grid-enterprise/core",this.gridId);this.gos.get("debug")&&_log(`initialised successfully, enterprise = ${e}`)}dispatchGridReadyEvent(){const e={type:"gridReady"};this.eventService.dispatchEvent(e)}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t){if(this.waitingForColumns){this.waitingForColumns=!1,this.setColumnsAndData(t);return}this.columnModel.setColumnDefs(t,convertSourceType(e.source))}}},SOURCE_PASTE="paste",ChangeDetectionService=class extends BeanStub{constructor(){super(...arguments),this.beanName="changeDetectionService"}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer}postConstruct(){this.rowModel.getType()==="clientSide"&&(this.clientSideRowModel=this.rowModel),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}onCellValueChanged(e){e.source!==SOURCE_PASTE&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gos.get("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const s=this.gos.get("aggregateOnlyChangedColumns"),o=new ChangedPath(s,this.clientSideRowModel.getRootNode());o.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(o),o.forEachChangedNodeDepthFirst(r=>{i.push(r)})}this.rowRenderer.refreshCells({rowNodes:i})}},ExpressionService=class extends BeanStub{constructor(){super(...arguments),this.beanName="expressionService",this.expressionToFunctionCache={}}evaluate(e,t){if(typeof e=="string")return this.evaluateExpression(e,t);_errorOnce("value should be either a string or a function",e)}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.getValue,t.column,t.columnGroup)}catch(i){return _log("Processing of the expression failed"),_log("Expression = ",e),_log("Params = ",t),_log("Exception = ",i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}},ValueCache=class extends BeanStub{constructor(){super(...arguments),this.beanName="valueCache",this.cacheVersion=0}postConstruct(){this.active=this.gos.get("valueCache"),this.neverExpires=this.gos.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(!(!this.active||e.__cacheVersion!==this.cacheVersion))return e.__cacheData[t]}},ValueService=class extends BeanStub{constructor(){super(...arguments),this.beanName="valueService",this.initialised=!1,this.isSsrm=!1}wireBeans(e){this.expressionService=e.expressionService,this.columnModel=e.columnModel,this.valueCache=e.valueCache,this.dataTypeService=e.dataTypeService}postConstruct(){this.initialised||this.init()}init(){this.isSsrm=this.gos.isRowModelType("serverSide"),this.cellExpressions=this.gos.get("enableCellExpressions"),this.isTreeData=this.gos.get("treeData"),this.initialised=!0;const e=i=>this.callColumnCellValueChangedHandler(i),t=this.gos.useAsyncEvents();this.eventService.addEventListener("cellValueChanged",e,t),this.addDestroyFunc(()=>this.eventService.removeEventListener("cellValueChanged",e,t)),this.addManagedPropertyListener("treeData",i=>this.isTreeData=i.currentValue)}getValue(e,t,i=!1,s=!1){if(this.initialised||this.init(),!t)return;const o=e.getColDef(),r=o.field,n=e.getColId(),l=t.data;let a;const d=t.groupData&&t.groupData[n]!==void 0,h=!s&&t.aggData&&t.aggData[n]!==void 0,c=this.isSsrm&&s&&!!e.getColDef().aggFunc,u=this.isSsrm&&t.footer&&t.field&&(e.getColDef().showRowGroup===!0||e.getColDef().showRowGroup===t.field);if(i&&o.filterValueGetter?a=this.executeFilterValueGetter(o.filterValueGetter,l,e,t):this.isTreeData&&h?a=t.aggData[n]:this.isTreeData&&o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,e,t):this.isTreeData&&r&&l?a=_getValueUsingField(l,r,e.isFieldContainsDots()):d?a=t.groupData[n]:h?a=t.aggData[n]:o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,e,t):u?a=_getValueUsingField(l,t.field,e.isFieldContainsDots()):r&&l&&!c&&(a=_getValueUsingField(l,r,e.isFieldContainsDots())),this.cellExpressions&&typeof a=="string"&&a.indexOf("=")===0){const g=a.substring(1);a=this.executeValueGetter(g,l,e,t)}if(a==null){const g=this.getOpenedGroup(t,e);if(g!=null)return g}return a}parseValue(e,t,i,s){const o=e.getColDef(),r=this.gos.addGridCommonParams({node:t,data:t?.data,oldValue:s,newValue:i,colDef:o,column:e}),n=o.valueParser;return _exists(n)?typeof n=="function"?n(r):this.expressionService.evaluate(n,r):i}formatValue(e,t,i,s,o=!0){let r=null,n;const l=e.getColDef();if(s?n=s:o&&(n=l.valueFormatter),n){const a=this.gos.addGridCommonParams({value:i,node:t,data:t?t.data:null,colDef:l,column:e});typeof n=="function"?r=n(a):r=this.expressionService.evaluate(n,a)}else if(l.refData)return l.refData[i]||"";return r==null&&Array.isArray(i)&&(r=i.join(", ")),r}getOpenedGroup(e,t){if(!this.gos.get("showOpenedGroup")||!t.getColDef().showRowGroup)return;const s=t.getColDef().showRowGroup;let o=e.parent;for(;o!=null;){if(o.rowGroupColumn&&(s===!0||s===o.rowGroupColumn.getColId()))return o.key;o=o.parent}}setValue(e,t,i,s){const o=this.columnModel.getColDefCol(t);if(!e||!o)return!1;_missing(e.data)&&(e.data={});const{field:r,valueSetter:n}=o.getColDef();if(_missing(r)&&_missing(n))return _warnOnce("you need either field or valueSetter set on colDef for editing to work"),!1;if(this.dataTypeService&&!this.dataTypeService.checkType(o,i))return _warnOnce("Data type of the new value does not match the cell data type of the column"),!1;const l=this.gos.addGridCommonParams({node:e,data:e.data,oldValue:this.getValue(o,e),newValue:i,colDef:o.getColDef(),column:o});l.newValue=i;let a;if(_exists(n)?typeof n=="function"?a=n(l):a=this.expressionService.evaluate(n,l):a=this.setValueUsingField(e.data,r,i,o.isFieldContainsDots()),a===void 0&&(a=!0),!a)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),l.newValue=this.getValue(o,e);const d={type:"cellValueChanged",event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:l.column,api:l.api,colDef:l.colDef,context:l.context,data:e.data,node:e,oldValue:l.oldValue,newValue:l.newValue,value:l.newValue,source:s};return this.eventService.dispatchEvent(d),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;typeof t=="function"&&this.getFrameworkOverrides().wrapOutgoing(()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,context:e.context})})}setValueUsingField(e,t,i,s){if(!t)return!1;let o=!1;if(!s)o=e[t]===i,o||(e[t]=i);else{const r=t.split(".");let n=e;for(;r.length>0&&n;){const l=r.shift();r.length===0?(o=n[l]===i,o||(n[l]=i)):n=n[l]}}return!o}executeFilterValueGetter(e,t,i,s){const o=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});return typeof e=="function"?e(o):this.expressionService.evaluate(e,o)}executeValueGetter(e,t,i,s){const o=i.getColId(),r=this.valueCache.getValue(s,o);if(r!==void 0)return r;const n=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});let l;return typeof e=="function"?l=e(n):l=this.expressionService.evaluate(e,n),this.valueCache.setValue(s,o,l),l}getValueCallback(e,t){const i=this.columnModel.getColDefCol(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),s=e.getColDef().keyCreator;let o=i;if(s){const r=this.gos.addGridCommonParams({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data});o=s(r)}return typeof o=="string"||o==null||(o=String(o),o==="[object Object]"&&_warnOnce("a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")),o}},GlobalGridOptions=class{};GlobalGridOptions.gridOptions=void 0;function provideGlobalGridOptions(e){GlobalGridOptions.gridOptions=e}function createGrid(e,t,i){if(!t)return _errorOnce("No gridOptions provided to createGrid"),{};const s=new GridCoreCreator().create(e,t,o=>{const r=new GridComp(e);o.createBean(r)},void 0,i);if(!Object.isFrozen(t)&&!i?.frameworkOverrides){const o="https://ag-grid.com/javascript-data-grid/grid-interface/#grid-api";Object.defineProperty(t,"api",{get:()=>{_errorOnce(`gridOptions.api is no longer supported. See ${o}.`)},configurable:!0})}return s}var Grid=class{constructor(e,t,i){if(_warnOnce("Since v31 new Grid(...) is deprecated. Use createGrid instead: `const gridApi = createGrid(...)`. The grid api is returned from createGrid and will not be available on gridOptions."),!t){_errorOnce("No gridOptions provided to the grid");return}this.gridOptions=t;const s=new GridCoreCreator().create(e,t,o=>{const r=new GridComp(e);o.createBean(r).addDestroyFunc(()=>{this.destroy()})},void 0,i);this.gridOptions.api=s}destroy(){this.gridOptions&&(this.gridOptions.api?.destroy(),delete this.gridOptions.api)}},nextGridId=1,GridCoreCreator=class{create(e,t,i,s,o){let r={};GlobalGridOptions.gridOptions?(_mergeDeep(r,GlobalGridOptions.gridOptions,!0,!0),r={...r,...t}):r=t;const n=getCoercedGridOptions(r),l=n.gridId??String(nextGridId++),a=this.getRegisteredModules(o,l),d=this.createBeansList(n.rowModelType,a,l),h=this.createProvidedBeans(e,n,o);if(!d){_errorOnce("Failed to create grid.");return}const c={providedBeanInstances:h,beanClasses:d,gridId:l,beanInitComparator:gridBeanInitComparator,beanDestroyComparator:gridBeanDestroyComparator,derivedBeans:[createApiProxy]},u=new Context(c);return this.registerModuleUserComponents(u,a),this.registerControllers(u,a),this.registerModuleApiFunctions(u,a),i(u),u.getBean("syncService").start(),s&&s(u),u.getBean("gridApi")}registerControllers(e,t){const i=e.getBean("ctrlsFactory");t.forEach(s=>{s.controllers&&s.controllers.forEach(o=>i.register(o))})}getRegisteredModules(e,t){const i=e?e.modules:null,s=ModuleRegistry.__getRegisteredModules(t),o=[],r={},n=(l,a,d)=>{(c=>{r[c.moduleName]||(r[c.moduleName]=!0,o.push(c),ModuleRegistry.__register(c,l,d))})(a),a.dependantModules&&a.dependantModules.forEach(c=>n(l,c,d))};return n(!!i?.length||!ModuleRegistry.__isPackageBased(),CommunityFeaturesModule,void 0),i&&i.forEach(l=>n(!0,l,t)),s&&s.forEach(l=>n(!ModuleRegistry.__isPackageBased(),l,void 0)),o}registerModuleUserComponents(e,t){const i=this.extractModuleEntity(t,o=>o.userComponents?o.userComponents:[]),s=e.getBean("userComponentRegistry");i.forEach(o=>{s.registerDefaultComponent(o.name,o.classImp)})}registerModuleApiFunctions(e,t){const i=e.getBean("apiFunctionService");t.forEach(s=>{const o=s.apiFunctions??{};Object.keys(o).forEach(n=>{i?.addFunction(n,o[n])})})}createProvidedBeans(e,t,i){let s=i?i.frameworkOverrides:null;_missing(s)&&(s=new VanillaFrameworkOverrides);const o={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,globalSyncEventListener:i?i.globalSyncEventListener:null,frameworkOverrides:s};return i&&i.providedBeanInstances&&Object.assign(o,i.providedBeanInstances),o}createBeansList(e="clientSide",t,i){const s=t.filter(a=>!a.rowModel||a.rowModel===e),o={clientSide:"@ag-grid-community/client-side-row-model",infinite:"@ag-grid-community/infinite-row-model",serverSide:"@ag-grid-enterprise/server-side-row-model",viewport:"@ag-grid-enterprise/viewport-row-model"};if(!o[e]){_errorOnce("Could not find row model for rowModelType = ",e);return}if(!ModuleRegistry.__assertRegistered(o[e],`rowModelType = '${e}'`,i))return;const r=[RowPositionUtils,CellPositionUtils,HeaderPositionUtils,GridDestroyService,ApiFunctionService,UserComponentRegistry,AgComponentUtils,ComponentMetadataProvider,ResizeObserverService,UserComponentFactory,RowContainerHeightService,HorizontalResizeService,LocaleService,PinnedRowModel,DragService,VisibleColsService,EventService,GridOptionsService,PopupService,SelectionService,ColumnModel,HeaderNavigationService,PageBoundsService,PageBoundsListener,RowRenderer,ExpressionService,ColumnFactory,NavigationService,ValueCache,ValueService,AutoWidthCalculator,StandardMenuFactory,DragAndDropService,FocusService,MouseEventService,Environment,CellNavigationService,StylingService,ScrollVisibleService,SortController,ColumnHoverService,ColumnAnimationService,SelectableService,ChangeDetectionService,AnimationFrameService,ColumnDefFactory,RowCssClassCalculator,RowNodeSorter,CtrlsService,PinnedWidthService,RowNodeEventThrottle,CtrlsFactory,SyncService,OverlayService,ExpansionService,ApiEventService,AriaAnnouncementService,MenuService,ColumnApplyStateService,ColumnEventDispatcher,ColumnMoveService,ColumnAutosizeService,ColumnGetStateService,ColumnGroupStateService,ColumnSizeService,FuncColsService,ColumnNameService,ColumnViewportService,PivotResultColsService],n=this.extractModuleEntity(s,a=>a.beans?a.beans:[]);r.push(...n);const l=[];return r.forEach(a=>{l.indexOf(a)<0&&l.push(a)}),l}extractModuleEntity(e,t){return[].concat(...e.map(t))}},RowModelHelperService=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowModelHelperService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){const e=this.rowModel;switch(e.getType()){case"clientSide":this.clientSideRowModel=e;break;case"infinite":this.infiniteRowModel=e;break;case"serverSide":this.serverSideRowModel=e;break}}getClientSideRowModel(){return this.clientSideRowModel}getInfiniteRowModel(){return this.infiniteRowModel}getServerSideRowModel(){return this.serverSideRowModel}};function expandAll(e){e.expansionService.expandAll(!0)}function collapseAll(e){e.expansionService.expandAll(!1)}function onRowHeightChanged(e){const t=e.rowModelHelperService?.getClientSideRowModel(),i=e.rowModelHelperService?.getServerSideRowModel();t?t.onRowHeightChanged():i&&i.onRowHeightChanged()}function setRowCount(e,t,i){const s=e.rowModelHelperService?.getServerSideRowModel();if(s){if(e.funcColsService.isRowGroupEmpty()){s.setRowCount(t,i);return}_errorOnce("setRowCount cannot be used while using row grouping.");return}const o=e.rowModelHelperService?.getInfiniteRowModel();if(o){o.setRowCount(t,i);return}}function getCacheBlockState(e){return e.rowNodeBlockLoader?.getBlockState()??{}}var CsrmSsrmSharedApiModule={version:VERSION,moduleName:"@ag-grid-community/csrm-ssrm-shared-api",apiFunctions:{expandAll,collapseAll,onRowHeightChanged}},SsrmInfiniteSharedApiModule={version:VERSION,moduleName:"@ag-grid-community/ssrm-infinite-shared-api",apiFunctions:{setRowCount,getCacheBlockState}},BaseComponentWrapper=class{wrap(e,t,i=[],s){const o=this.createWrapper(e,s);return t.forEach(r=>{this.createMethod(o,r,!0)}),i.forEach(r=>{this.createMethod(o,r,!1)}),o}unwrap(e){return e}createMethod(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))}createMethodProxy(e,t,i){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(i&&_warnOnce("Framework component is missing the method "+t+"()"),null)}}};function _sortRowNodesByOrder(e,t){if(!e)return!1;const i=(n,l)=>{const a=t[n.id],d=t[l.id],h=a!==void 0,c=d!==void 0,u=h&&c,g=!h&&!c;return u?a-d:g?n.__objectId-l.__objectId:h?1:-1};let s,o,r=!1;for(let n=0;n<e.length-1;n++)if(s=e[n],o=e[n+1],i(s,o)>0){r=!0;break}return r?(e.sort(i),!0):!1}var ChartMappings=class{};ChartMappings.CHART_TYPE_TO_SERIES_TYPE={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall"},ChartMappings.COMBO_CHART_TYPES=["columnLineCombo","areaColumnCombo","customCombo"],ChartMappings.SERIES_GROUP_TYPES=["grouped","stacked","normalized"];var BarColumnLabelPlacement=(e=>(e.InsideBase="insideBase",e.InsideEnd="insideEnd",e.Center="center",e.OutsideEnd="outsideEnd",e))(BarColumnLabelPlacement||{}),globalObj=typeof global>"u"?{}:global;globalObj.HTMLElement=typeof HTMLElement>"u"?{}:HTMLElement,globalObj.HTMLButtonElement=typeof HTMLButtonElement>"u"?{}:HTMLButtonElement,globalObj.HTMLSelectElement=typeof HTMLSelectElement>"u"?{}:HTMLSelectElement,globalObj.HTMLInputElement=typeof HTMLInputElement>"u"?{}:HTMLInputElement,globalObj.Node=typeof Node>"u"?{}:Node,globalObj.MouseEvent=typeof MouseEvent>"u"?{}:MouseEvent;var ROOT_NODE_ID="ROOT_NODE_ID",TOP_LEVEL=0,ClientSideNodeManager=class{constructor(e,t,i,s,o,r){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=e,this.gos=t,this.eventService=i,this.funcColsService=s,this.beans=r,this.selectionService=o,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return _cloneObject(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(e){if(typeof e=="string"){_warnOnce("rowData must be an array.");return}this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e);const t=this.rootNode,i=this.rootNode.sibling;t.childrenAfterFilter=null,t.childrenAfterGroup=null,t.childrenAfterAggFilter=null,t.childrenAfterSort=null,t.childrenMapped=null,t.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?t.allLeafChildren=e.map(s=>this.createNode(s,this.rootNode,TOP_LEVEL)):(t.allLeafChildren=[],t.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=t.childrenAfterFilter,i.childrenAfterGroup=t.childrenAfterGroup,i.childrenAfterAggFilter=t.childrenAfterAggFilter,i.childrenAfterSort=t.childrenAfterSort,i.childrenMapped=t.childrenMapped,i.allLeafChildren=t.allLeafChildren)}updateRowData(e,t){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const i={remove:[],update:[],add:[]},s=[];return this.executeRemove(e,i,s),this.executeUpdate(e,i,s),this.executeAdd(e,i),this.updateSelection(s,"rowDataChanged"),t&&_sortRowNodesByOrder(this.rootNode.allLeafChildren,t),i}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){const t={type:"rowDataUpdateStarted",firstRowData:e?.length?e[0]:null};this.eventService.dispatchEvent(t)}updateSelection(e,t){const i=e.length>0;if(i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),i){const s={type:"selectionChanged",source:t};this.eventService.dispatchEvent(s)}}executeAdd(e,t){const{add:i,addIndex:s}=e;if(_missingOrEmpty(i))return;const o=i.map(n=>this.createNode(n,this.rootNode,TOP_LEVEL)),r=this.rootNode.allLeafChildren;if(typeof s=="number"&&s>=0){const n=r.length;let l=s;if(this.gos.get("treeData")&&s>0&&n>0){for(let c=0;c<n;c++)if(r[c]?.rowIndex==s-1){l=c+1;break}}const d=r.slice(0,l),h=r.slice(l,r.length);this.rootNode.allLeafChildren=[...d,...o,...h]}else this.rootNode.allLeafChildren=[...r,...o];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=r),t.add=o}executeRemove(e,t,i){const{remove:s}=e;if(_missingOrEmpty(s))return;const o={};s.forEach(r=>{const n=this.lookupRowNode(r);n&&(n.isSelected()&&i.push(n),n.clearRowTopAndRowIndex(),o[n.id]=!0,delete this.allNodesMap[n.id],t.remove.push(n))}),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren?.filter(r=>!o[r.id])??null,this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(e,t,i){const{update:s}=e;_missingOrEmpty(s)||s.forEach(o=>{const r=this.lookupRowNode(o);r&&(r.updateData(o),!r.selectable&&r.isSelected()&&i.push(r),this.setMasterForRow(r,o,TOP_LEVEL,!1),t.update.push(r))})}lookupRowNode(e){const t=this.gos.getRowIdCallback();let i;if(t){const s=t({data:e,level:0});if(i=this.allNodesMap[s],!i)return _errorOnce(`could not find row id=${s}, data item was not found for this id`),null}else if(i=this.rootNode.allLeafChildren?.find(s=>s.data===e),!i)return _errorOnce("could not find data item as object was not found",e),_errorOnce("Consider using getRowId to help the Grid find matching row data"),null;return i||null}createNode(e,t,i){const s=new RowNode(this.beans);return s.group=!1,this.setMasterForRow(s,e,i,!0),t&&(s.parent=t),s.level=i,s.setDataAndId(e,this.nextId.toString()),this.allNodesMap[s.id]&&_warnOnce(`duplicate node id '${s.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[s.id]=s,this.nextId++,s}setMasterForRow(e,t,i,s){if(this.gos.get("treeData"))e.setMaster(!1),s&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const n=this.gos.get("isRowMaster");n?e.setMaster(n(t)):e.setMaster(!0)}else e.setMaster(!1);if(s){const n=this.funcColsService.getRowGroupColumns(),l=n?n.length:0,a=i+l;e.expanded=e.master?this.isExpanded(a):!1}}}isExpanded(e){const t=this.gos.get("groupDefaultExpanded");return t===-1?!0:e<t}},ClientSideRowModel=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowModel",this.onRowHeightChanged_debounced=_debounce(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}wireBeans(e){this.beans=e,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.selectionService=e.selectionService,this.valueCache=e.valueCache,this.environment=e.environment,this.filterStage=e.filterStage,this.sortStage=e.sortStage,this.flattenStage=e.flattenStage,this.groupStage=e.groupStage,this.aggregationStage=e.aggregationStage,this.pivotStage=e.pivotStage,this.filterAggregatesStage=e.filterAggregatesStage}postConstruct(){const e=this.refreshModel.bind(this,{step:"group"}),t=!this.gos.get("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedEventListeners({newColumnsLoaded:i,columnRowGroupChanged:e,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:e,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this)}),this.addPropertyListeners(),this.rootNode=new RowNode(this.beans),this.nodeManager=new ClientSideNodeManager(this.rootNode,this.gos,this.eventService,this.funcColsService,this.selectionService,this.beans)}addPropertyListeners(){const e=new Set(["treeData","masterDetail"]),t=new Set(["groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),i=new Set(["excludeChildrenWhenTreeDataFiltering"]),s=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),o=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),r=new Set(["postSortRows","groupDisplayType","accentedSort"]),n=new Set([]),l=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),a=[...e,...t,...i,...s,...s,...o,...r,...n,...l];this.addManagedPropertyListeners(a,d=>{const h=d.changeSet?.properties;if(!h)return;const c=u=>h.some(g=>u.has(g));if(c(e)){this.setRowData(this.rootNode.allLeafChildren.map(u=>u.data));return}if(c(t)){this.refreshModel({step:"group"});return}if(c(i)){this.refreshModel({step:"filter"});return}if(c(s)){this.refreshModel({step:"pivot"});return}if(c(o)){this.refreshModel({step:"aggregate"});return}if(c(r)){this.refreshModel({step:"sort"});return}if(c(n)){this.refreshModel({step:"filter_aggregates"});return}c(l)&&this.refreshModel({step:"map"})}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const e=this.gos.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(e))}ensureRowHeightsValid(e,t,i,s){let o,r=!1;do{o=!1;const n=this.getRowIndexAtPixel(e),l=this.getRowIndexAtPixel(t),a=Math.max(n,i),d=Math.min(l,s);for(let h=a;h<=d;h++){const c=this.getRow(h);if(c.rowHeightEstimated){const u=this.gos.getRowHeightForNode(c);c.setRowHeight(u.height),o=!0,r=!0}}o&&this.setRowTopAndRowIndex()}while(o);return r}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,s=this.gos.isDomLayout("normal");for(let o=0;o<this.rowsToDisplay.length;o++){const r=this.rowsToDisplay[o];if(r.id!=null&&i.add(r.id),r.rowHeight==null){const n=this.gos.getRowHeightForNode(r,s,e);r.setRowHeight(n.height,n.estimated)}r.setRowTop(t),r.setRowIndex(o),t+=r.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),s=r=>{r&&r.id!=null&&!t.has(r.id)&&r.clearRowTopAndRowIndex()},o=r=>{if(s(r),s(r.detailNode),s(r.sibling),r.hasChildren()&&r.childrenAfterGroup){const n=r.level==-1;i&&!n&&!r.expanded||r.childrenAfterGroup.forEach(o)}};o(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const s=this.getRowIndexAtPixel(t),o=this.getRow(s),r=!this.gos.get("suppressAnimationFrame");return o===e[0]?!1:(e.forEach(n=>{_removeFromArray(this.rootNode.allLeafChildren,n)}),e.forEach((n,l)=>{_insertIntoArray(this.rootNode.allLeafChildren,n,Math.max(s+i,0)+l)}),this.refreshModel({step:"group",keepRenderedRows:!0,keepEditingRows:!0,animate:r}),!0)}highlightRowAtPixel(e,t){const i=t!=null?this.getRowIndexAtPixel(t):null,s=i!=null?this.getRow(i):null;if(!s||!e||s===e||t==null){this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null);return}const o=this.getHighlightPosition(t,s);this.lastHighlightedRow&&this.lastHighlightedRow!==s&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),s.setHighlighted(o),this.lastHighlightedRow=s}getHighlightPosition(e,t){if(!t){const o=this.getRowIndexAtPixel(e);if(t=this.getRow(o||0),!t)return 1}const{rowTop:i,rowHeight:s}=t;return e-i<s/2?0:1}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const t=this.rootNode.sibling?1:0,i=this.rootNode.childrenAfterAggFilter;return(i?i.length:0)+t}getTopLevelRowDisplayedIndex(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let i=e;if(this.rowsToDisplay[0].footer){if(e===0)return 0;i-=1}let s=this.rootNode.childrenAfterSort[i];if(this.gos.get("groupHideOpenParents"))for(;s.expanded&&s.childrenAfterSort&&s.childrenAfterSort.length>0;)s=s.childrenAfterSort[0];return s.rowIndex}getRowBounds(e){if(_missing(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=this.gos.isAnimateRows();this.refreshModel({step:"map",keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=this.gos.isAnimateRows(),s=e.columns.length===0||e.columns.some(o=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:s,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=this.gos.isAnimateRows();this.refreshModel({step:"sort",keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:"pivot"}):this.refreshModel({step:"aggregate"})}createChangePath(e){const t=_missingOrEmpty(e),i=new ChangedPath(!1,this.rootNode);return(t||this.gos.get("treeData"))&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction")||e.rowNodeTransactions==null)return!1;const t=e.rowNodeTransactions.filter(s=>s.add!=null&&s.add.length>0||s.remove!=null&&s.remove.length>0);return t==null||t.length==0}buildRefreshModelParams(e){let t="group";const i={everything:"group",group:"group",filter:"filter",map:"map",aggregate:"aggregate",sort:"sort",pivot:"pivot"};if(_exists(e)&&(t=i[e]),_missing(t)){_errorOnce(`invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`);return}const s=!this.gos.get("suppressAnimationFrame");return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s}}refreshModel(e){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.isChangeEventsDispatching())return;const t=typeof e=="object"&&"step"in e?e:this.buildRefreshModelParams(e);if(!t||this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(this.isRefreshingModel=!0,t.step){case"group":this.doRowGrouping(t.rowNodeTransactions,t.rowNodeOrder,i,!!t.afterColumnsChanged);case"filter":this.doFilter(i);case"pivot":this.doPivot(i);case"aggregate":this.doAggregate(i);case"filter_aggregates":this.doFilterAggregates(i);case"sort":this.doSort(t.rowNodeTransactions,i);case"map":this.doRowsToDisplay()}const s=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,s),this.isRefreshingModel=!1;const o={type:"modelUpdated",animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack};this.eventService.dispatchEvent(o)}isEmpty(){const e=_missing(this.rootNode.allLeafChildren)||this.rootNode.allLeafChildren.length===0;return _missing(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return _exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!1,s=!1;const o=[],r=this.gos.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort(n=>{if(s)return;if(i&&(n===t||n===e)&&(s=!0,n.group&&r)){o.push(...n.allLeafChildren);return}if(!i){if(n!==t&&n!==e)return;i=!0}if(!n.group||!r){o.push(n);return}}),o}setDatasource(e){_errorOnce("should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||this.rowsToDisplay.length===0)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if(_last(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let o=-1,r=-1;for(;;){const n=Math.floor((t+i)/2),l=this.rowsToDisplay[n];if(this.isRowInPixel(l,e)||(l.rowTop<e?t=n+1:l.rowTop>e&&(i=n-1),o===t&&r===i))return n;o=t,r=i}}isRowInPixel(e,t){const i=e.rowTop,s=e.rowTop+e.rowHeight;return i<=t&&s>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((t,i)=>e(t,i))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:e,recursionType:0,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:1,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:2,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:3,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){const{nodes:t,callback:i,recursionType:s,includeFooterNodes:o}=e;let{index:r}=e;const n=l=>{const a=t[0]?.parent;if(!a)return;const d=o&&this.gos.getGrandTotalRow(),h=this.gos.getGroupTotalRowCallback(),c=o&&h({node:a});if(a===this.rootNode){d===l&&(a.createFooter(),i(a.sibling,r++));return}c===l&&(a.createFooter(),i(a.sibling,r++))};n("top");for(let l=0;l<t.length;l++){const a=t[l];if(i(a,r++),a.hasChildren()&&!a.footer){let d=null;switch(s){case 0:d=a.childrenAfterGroup;break;case 1:d=a.childrenAfterAggFilter;break;case 2:d=a.childrenAfterSort;break;case 3:d=a.leafGroup?null:a.childrenAfterSort;break}d&&(r=this.recursivelyWalkNodesAndCallback({nodes:[...d],callback:i,recursionType:s,index:r,includeFooterNodes:o}))}}return n("bottom"),r}doAggregate(e){this.aggregationStage?.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gos.get("treeData"),i=this.columnModel.isPivotActive(),s=n=>{n&&n.forEach(l=>{const a=()=>{l.expanded=e,s(l.childrenAfterGroup)};if(t){_exists(l.childrenAfterGroup)&&a();return}if(i){!l.leafGroup&&a();return}l.group&&a()})};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:"map"});const r={type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"};this.eventService.dispatchEvent(r)}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,s){if(this.groupStage){if(e?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,rowNodeOrder:t,changedPath:i}):this.groupStage.execute({rowNode:this.rootNode,changedPath:i,afterColumnsChanged:s}),this.gos.get("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",i)){const r={type:"selectionChanged",source:"rowGroupChanged"};this.eventService.dispatchEvent(r)}}else this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren();this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){this.pivotStage?.execute({rowNode:this.rootNode,changedPath:e})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(e){if(typeof e=="string"&&e.indexOf(RowNode.ID_PREFIX_ROW_GROUP)==0){let i;return this.forEachNode(s=>{s.id===e&&(i=s)}),i}return this.nodeManager.getRowNode(e)}setRowData(e){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){const e={type:"rowDataUpdated"};this.eventService.dispatchEvent(e),this.refreshModel({step:"group",newData:!0})}batchUpdateRowData(e,t){if(this.applyAsyncTransactionsTimeout==null){this.rowDataTransactionBatch=[];const i=this.gos.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.executeBatchUpdateRowData()},i)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){this.applyAsyncTransactionsTimeout!=null&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const e=[],t=[];let i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach(s=>{const o=this.nodeManager.updateRowData(s.rowDataTransaction,void 0);t.push(o),s.callback&&e.push(s.callback.bind(null,o)),typeof s.rowDataTransaction.addIndex=="number"&&(i=!0)}),this.commonUpdateRowData(t,void 0,i),e.length>0&&window.setTimeout(()=>{e.forEach(s=>s())},0),t.length>0){const s={type:"asyncTransactionsFlushed",results:t};this.eventService.dispatchEvent(s)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e,t){this.valueCache.onDataChanged();const i=this.nodeManager.updateRowData(e,t),s=typeof e.addIndex=="number";return this.commonUpdateRowData([i],t,s),i}createRowNodeOrder(){if(this.gos.get("suppressMaintainUnsortedOrder"))return;const t={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let i=0;i<this.rootNode.allLeafChildren.length;i++){const s=this.rootNode.allLeafChildren[i];t[s.id]=i}return t}commonUpdateRowData(e,t,i){if(!this.hasStarted)return;const s=!this.gos.get("suppressAnimationFrame");i&&(t=this.createRowNodeOrder());const o={type:"rowDataUpdated"};this.eventService.dispatchEvent(o),this.refreshModel({step:"group",rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const i=t.detailNode;i&&i.setRowHeight(i.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){if(e.rowHeightChanged){if(this.columnModel.isAutoRowHeightActive())return;this.resetRowHeights()}}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}};function onGroupExpandedOrCollapsed(e){e.expansionService.onGroupExpandedOrCollapsed()}function refreshClientSideRowModel(e,t){e.rowModelHelperService?.getClientSideRowModel()?.refreshModel(t)}function forEachLeafNode(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachLeafNode(t)}function forEachNodeAfterFilter(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachNodeAfterFilter(t)}function forEachNodeAfterFilterAndSort(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachNodeAfterFilterAndSort(t)}function resetRowHeights(e){if(e.columnModel.isAutoRowHeightActive()){_warnOnce("calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");return}e.rowModelHelperService?.getClientSideRowModel()?.resetRowHeights()}function applyTransaction(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.rowModelHelperService?.getClientSideRowModel()?.updateRowData(t))}function applyTransactionAsync(e,t,i){e.frameworkOverrides.wrapIncoming(()=>e.rowModelHelperService?.getClientSideRowModel()?.batchUpdateRowData(t,i))}function flushAsyncTransactions(e){e.frameworkOverrides.wrapIncoming(()=>e.rowModelHelperService?.getClientSideRowModel()?.flushAsyncTransactions())}function getBestCostNodeSelection(e){return e.selectionService.getBestCostNodeSelection()}var FilterStage=class extends BeanStub{constructor(){super(...arguments),this.beanName="filterStage"}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){const t=!!this.filterManager?.isChildFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const i=(s,o)=>{s.hasChildren()&&e&&!o?s.childrenAfterFilter=s.childrenAfterGroup.filter(r=>{const n=r.childrenAfterFilter&&r.childrenAfterFilter.length>0,l=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return n||l}):s.childrenAfterFilter=s.childrenAfterGroup,s.sibling&&(s.sibling.childrenAfterFilter=s.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const s=(r,n)=>{if(r.childrenAfterGroup)for(let l=0;l<r.childrenAfterGroup.length;l++){const a=r.childrenAfterGroup[l],d=n||this.filterManager.doesRowPassFilter({rowNode:a});a.childrenAfterGroup?s(r.childrenAfterGroup[l],d):i(a,d)}i(r,n)},o=r=>s(r,!1);t.executeFromRootNode(o)}else{const s=o=>i(o,!1);t.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},FlattenStage=class extends BeanStub{constructor(){super(...arguments),this.beanName="flattenStage"}wireBeans(e){this.beans=e,this.columnModel=e.columnModel}execute(e){const t=e.rowNode,i=[],s=this.columnModel.isPivotMode(),o=s&&t.leafGroup,r=o?[t]:t.childrenAfterSort,n=this.getFlattenDetails();this.recursivelyAddToRowsToDisplay(n,r,i,s,0);const l=i.length>0;if(!o&&l&&n.grandTotalRow){t.createFooter();const d=n.grandTotalRow==="top";this.addRowNodeToRowsToDisplay(n,t.sibling,i,0,d)}return i}getFlattenDetails(){const e=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:this.gos.isGroupMultiAutoColumn(),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:this.gos.getGrandTotalRow(),groupTotalRow:this.gos.getGroupTotalRowCallback()}}recursivelyAddToRowsToDisplay(e,t,i,s,o){if(!_missingOrEmpty(t))for(let r=0;r<t.length;r++){const n=t[r],l=n.hasChildren(),a=s&&!l,d=e.groupRemoveSingleChildren&&l&&n.childrenAfterGroup.length===1,h=e.groupRemoveLowestSingleChildren&&l&&n.leafGroup&&n.childrenAfterGroup.length===1,c=s&&n.leafGroup,u=e.hideOpenParents&&n.expanded&&!n.master&&!c;if(!a&&!u&&!d&&!h&&this.addRowNodeToRowsToDisplay(e,n,i,o),!(s&&n.leafGroup)){if(l){const p=d||h;if(n.expanded||p){const m=e.groupTotalRow({node:n});m||n.destroyFooter();const f=p?o:o+1;m==="top"&&(n.createFooter(),this.addRowNodeToRowsToDisplay(e,n.sibling,i,f)),this.recursivelyAddToRowsToDisplay(e,n.childrenAfterSort,i,s,f),m==="bottom"&&(n.createFooter(),this.addRowNodeToRowsToDisplay(e,n.sibling,i,f))}}else if(n.master&&n.expanded){const p=this.createDetailNode(n);this.addRowNodeToRowsToDisplay(e,p,i,o)}}}}addRowNodeToRowsToDisplay(e,t,i,s,o){o?i.unshift(t):i.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:s)}createDetailNode(e){if(_exists(e.detailNode))return e.detailNode;const t=new RowNode(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,_exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}},ImmutableService=class extends BeanStub{constructor(){super(...arguments),this.beanName="immutableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){this.rowModel.getType()==="clientSide"&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",()=>this.onRowDataUpdated()))}isActive(){const e=this.gos.exists("getRowId");return this.gos.get("resetRowDataOnUpdate")?!1:e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const[i,s]=t;this.clientSideRowModel.updateRowData(i,s)}createTransactionForRowData(e){if(_missing(this.clientSideRowModel)){_errorOnce("ImmutableService only works with ClientSideRowModel");return}const t=this.gos.getRowIdCallback();if(t==null){_errorOnce("ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");return}const i={remove:[],update:[],add:[]},s=this.clientSideRowModel.getCopyOfNodesMap(),r=this.gos.get("suppressMaintainUnsortedOrder")?void 0:{};return _exists(e)&&e.forEach((n,l)=>{const a=t({data:n,level:0}),d=s[a];r&&(r[a]=l),d?(d.data!==n&&i.update.push(n),s[a]=void 0):i.add.push(n)}),_iterateObject(s,(n,l)=>{l&&i.remove.push(l.data)}),[i,r]}onRowDataUpdated(){const e=this.gos.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))}},SortService=class extends BeanStub{constructor(){super(...arguments),this.beanName="sortService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.rowNodeSorter=e.rowNodeSorter,this.showRowGroupColsService=e.showRowGroupColsService}sort(e,t,i,s,o,r){const n=this.gos.get("groupMaintainOrder"),l=this.columnModel.getCols().some(u=>u.isRowGroupActive());let a={};i&&s&&(a=this.calculateDirtyNodes(s));const d=this.columnModel.isPivotMode(),h=this.gos.getCallback("postSortRows"),c=u=>{this.pullDownGroupDataForHideOpenParents(u.childrenAfterAggFilter,!0);const g=d&&u.leafGroup;if(n&&l&&!u.leafGroup&&!r){const f=this.funcColsService.getRowGroupColumns()?.[u.level+1]?.getSort()===null,v=u.childrenAfterAggFilter.slice(0);if(u.childrenAfterSort&&!f){const C={};u.childrenAfterSort.forEach((w,y)=>{C[w.id]=y}),v.sort((w,y)=>(C[w.id]??0)-(C[y.id]??0))}u.childrenAfterSort=v}else!t||g?u.childrenAfterSort=u.childrenAfterAggFilter.slice(0):i?u.childrenAfterSort=this.doDeltaSort(u,a,o,e):u.childrenAfterSort=this.rowNodeSorter.doFullSort(u.childrenAfterAggFilter,e);if(u.sibling&&(u.sibling.childrenAfterSort=u.childrenAfterSort),this.updateChildIndexes(u),h){const m={nodes:u.childrenAfterSort};h(m)}};o&&o.forEachChangedNodeDepthFirst(c),this.updateGroupDataForHideOpenParents(o)}calculateDirtyNodes(e){const t={},i=s=>{s&&s.forEach(o=>t[o.id]=!0)};return e&&e.forEach(s=>{i(s.add),i(s.update),i(s.remove)}),t}doDeltaSort(e,t,i,s){const o=e.childrenAfterAggFilter,r=e.childrenAfterSort;if(!r)return this.rowNodeSorter.doFullSort(o,s);const n={},l=[];o.forEach(c=>{t[c.id]||!i.canSkip(c)?l.push(c):n[c.id]=!0});const a=r.filter(c=>n[c.id]),d=(c,u)=>({currentPos:u,rowNode:c}),h=l.map(d).sort((c,u)=>this.rowNodeSorter.compareRowNodes(s,c,u));return this.mergeSortedArrays(s,h,a.map(d)).map(({rowNode:c})=>c)}mergeSortedArrays(e,t,i){const s=[];let o=0,r=0;for(;o<t.length&&r<i.length;)this.rowNodeSorter.compareRowNodes(e,t[o],i[r])<0?s.push(t[o++]):s.push(i[r++]);for(;o<t.length;)s.push(t[o++]);for(;r<i.length;)s.push(i[r++]);return s}updateChildIndexes(e){if(_missing(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const s=t[i],o=i===0,r=i===e.childrenAfterSort.length-1;s.setFirstChild(o),s.setLastChild(r),s.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return _warnOnce("The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them."),!1;const t=i=>{this.pullDownGroupDataForHideOpenParents(i.childrenAfterSort,!1),i.childrenAfterSort.forEach(s=>{s.hasChildren()&&t(s)})};e&&e.executeFromRootNode(i=>t(i))}pullDownGroupDataForHideOpenParents(e,t){!this.gos.get("groupHideOpenParents")||_missing(e)||e.forEach(i=>{(this.showRowGroupColsService?.getShowRowGroupCols()??[]).forEach(o=>{const r=o.getColDef().showRowGroup;if(typeof r!="string"){_errorOnce("groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");return}const n=r,l=this.columnModel.getColDefCol(n);if(l!==i.rowGroupColumn)if(t)i.setGroupValue(o.getId(),void 0);else{const d=i.getFirstChildOfFirstChild(l);d&&i.setGroupValue(o.getId(),d.key)}})})}},SortStage=class extends BeanStub{constructor(){super(...arguments),this.beanName="sortStage"}wireBeans(e){this.sortService=e.sortService,this.sortController=e.sortController}execute(e){const t=this.sortController.getSortOptions(),i=_exists(t)&&t.length>0,s=i&&_exists(e.rowNodeTransactions)&&this.gos.get("deltaSort"),o=t.some(r=>this.gos.isColumnsSortingCoupledToGroup()?r.column.isPrimary()&&r.column.isRowGroupActive():!!r.column.getColDef().showRowGroup);this.sortService.sort(t,i,s,e.rowNodeTransactions,e.changedPath,o)}},VERSION2="32.0.0",ClientSideRowModelCoreModule={version:VERSION2,moduleName:"@ag-grid-community/client-side-row-model-core",rowModel:"clientSide",beans:[ClientSideRowModel,FilterStage,SortStage,FlattenStage,SortService,ImmutableService]},ClientSideRowModelApiModule={version:VERSION2,moduleName:"@ag-grid-community/client-side-row-model-api",beans:[RowModelHelperService],apiFunctions:{onGroupExpandedOrCollapsed,refreshClientSideRowModel,forEachLeafNode,forEachNodeAfterFilter,forEachNodeAfterFilterAndSort,resetRowHeights,applyTransaction,applyTransactionAsync,flushAsyncTransactions,getBestCostNodeSelection},dependantModules:[ClientSideRowModelCoreModule,CsrmSsrmSharedApiModule]},ClientSideRowModelModule={version:VERSION2,moduleName:"@ag-grid-community/client-side-row-model",dependantModules:[ClientSideRowModelCoreModule,ClientSideRowModelApiModule]},BaseCreator=class extends BeanStub{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return(e==null||!e.length)&&(e=this.getDefaultFileName()),e.indexOf(".")===-1?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},BaseGridSerializingSession=class{constructor(e){this.groupColumns=[];const{columnModel:t,funcColsService:i,columnNameService:s,valueService:o,gos:r,processCellCallback:n,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:d}=e;this.columnModel=t,this.funcColsService=i,this.columnNameService=s,this.valueService=o,this.gos=r,this.processCellCallback=n,this.processHeaderCallback=l,this.processGroupHeaderCallback=a,this.processRowGroupCallback=d}prepare(e){this.groupColumns=e.filter(t=>!!t.getColDef().showRowGroup)}extractHeaderValue(e){return this.getHeaderName(this.processHeaderCallback,e)??""}extractRowCellValue(e,t,i,s,o){const n=(!this.gos.get("groupHideOpenParents")||o.footer)&&this.shouldRenderGroupSummaryCell(o,e,t)?this.createValueForGroupNode(e,o):this.valueService.getValue(e,o);return this.processCell({accumulatedRowIndex:i,rowNode:o,column:e,value:n,processCellCallback:this.processCellCallback,type:s})}shouldRenderGroupSummaryCell(e,t,i){if(!(e&&e.group))return!1;if(this.groupColumns.indexOf(t)!==-1){if(e.groupData?.[t.getId()]!=null||this.gos.isRowModelType("serverSide")&&e.group)return!0;if(e.footer&&e.level===-1){const n=t.getColDef();return n==null||n.showRowGroup===!0||n.showRowGroup===this.funcColsService.getRowGroupColumns()[0].getId()}}const r=this.gos.isGroupUseEntireRow(this.columnModel.isPivotMode());return i===0&&r}getHeaderName(e,t){return e?e(this.gos.addGridCommonParams({column:t})):this.columnNameService.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:e,node:t}));const i=this.gos.get("treeData"),s=this.gos.get("suppressGroupMaintainValueType"),o=a=>{if(i||s)return a.key;const d=a.groupData?.[e.getId()];return!d||!a.rowGroupColumn||a.rowGroupColumn.getColDef().useValueFormatterForExport===!1?d:this.valueService.formatValue(a.rowGroupColumn,a,d)??d},r=t.footer,n=[o(t)];if(!this.gos.isGroupMultiAutoColumn())for(;t.parent;)t=t.parent,n.push(o(t));const l=n.reverse().join(" -> ");return r?`Total ${l}`:l}processCell(e){const{accumulatedRowIndex:t,rowNode:i,column:s,value:o,processCellCallback:r,type:n}=e;return r?{value:r(this.gos.addGridCommonParams({accumulatedRowIndex:t,column:s,node:i,value:o,type:n,parseValue:l=>this.valueService.parseValue(s,i,l,this.valueService.getValue(s,i)),formatValue:l=>this.valueService.formatValue(s,i,l)??l}))??""}:s.getColDef().useValueFormatterForExport!==!1?{value:o??"",valueFormatted:this.valueService.formatValue(s,i,o)}:{value:o??""}}},Downloader=class{static download(e,t){const i=document.defaultView||window;if(!i){_warnOnce("There is no `window` associated with the current `document`");return}const s=document.createElement("a"),o=i.URL.createObjectURL(t);s.setAttribute("href",o),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:i})),document.body.removeChild(s),i.setTimeout(()=>{i.URL.revokeObjectURL(o)},0)}},LINE_SEPARATOR=`\r
|
|
193
|
-
`,CsvSerializingSession=class extends BaseGridSerializingSession{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:i}=e;this.suppressQuotes=t,this.columnSeparator=i}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,LINE_SEPARATOR),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((i,s)=>{s!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(i.data.value||""),i.mergeAcross&&this.appendEmptyCells(i.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,i,s){i!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,i){t!=0&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(_warnOnce("unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=LINE_SEPARATOR),this.isFirstLine=!1}},CsvCreator=class extends BaseCreator{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.gridSerializer=e.gridSerializer}postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){_warnOnce("Export cancelled. Export is not allowed as per your configuration.");return}const t=this.getMergedParams(e),i=this.getData(t),s=new Blob(["\uFEFF",i],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(this.gos.getGridCommonParams()):t.fileName;Downloader.download(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,columnNameService:i,funcColsService:s,valueService:o,gos:r}=this,{processCellCallback:n,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:d,suppressQuotes:h,columnSeparator:c}=e;return new CsvSerializingSession({columnModel:t,columnNameService:i,funcColsService:s,valueService:o,gos:r,processCellCallback:n||void 0,processHeaderCallback:l||void 0,processGroupHeaderCallback:a||void 0,processRowGroupCallback:d||void 0,suppressQuotes:h||!1,columnSeparator:c||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function getDataAsCsv(e,t){return e.csvCreator?.getDataAsCsv(t)}function exportDataAsCsv(e,t){e.csvCreator?.exportDataAsCsv(t)}var RowType=(e=>(e[e.HEADER_GROUPING=0]="HEADER_GROUPING",e[e.HEADER=1]="HEADER",e[e.BODY=2]="BODY",e))(RowType||{}),GridSerializer=class extends BeanStub{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.selectionService=e.selectionService,this.rowNodeSorter=e.rowNodeSorter,this.sortController=e.sortController}serialize(e,t={}){const{allColumns:i,columnKeys:s,skipRowGroups:o}=t,r=this.getColumnsToExport(i,o,s);return _compose(this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t))(e).parse()}processRow(e,t,i,s){const o=t.shouldRowBeSkipped||(()=>!1),r=this.gos.get("groupRemoveSingleChildren"),n=this.gos.get("groupRemoveLowestSingleChildren"),a=t.rowPositions!=null||!!t.onlySelected,d=this.gos.get("groupHideOpenParents")&&!a,h=this.columnModel.isPivotMode()?s.leafGroup:!s.group,c=!!s.footer,u=n&&s.leafGroup,g=s.allChildrenCount===1&&s.childrenAfterGroup?.length===1&&(r||u);if(!h&&!c&&(t.skipRowGroups||g||d)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.level===-1&&!h&&!c||o(this.gos.addGridCommonParams({node:s})))return;const
|
|
194
|
-
`;function returnAttributeIfPopulated(e,t,i){if(!t&&t!==""&&t!==0)return"";let s=t;return typeof t=="boolean"&&i&&(s=i(t)),` ${e}="${s}"`}var XmlFactory=class{static createHeader(e={}){const t="<?",i="?>",s=["version"];e.version||(e.version="1.0"),e.encoding&&s.push("encoding"),e.standalone&&s.push("standalone");const o=s.map(r=>`${r}="${e[r]}"`).join(" ");return`${t}xml ${o} ${i}`}static createXml(e,t){let i="";e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach(o=>{Object.keys(o.map).forEach(r=>{i+=returnAttributeIfPopulated(o.prefix+r,o.map[r],t)})}),e.properties.rawMap&&Object.keys(e.properties.rawMap).forEach(o=>{i+=returnAttributeIfPopulated(o,e.properties.rawMap[o],t)}));let s="<"+e.name+i;return!e.children&&e.textNode==null?s+"/>"+LINE_SEPARATOR2:e.textNode!=null?s+">"+e.textNode+"</"+e.name+">"+LINE_SEPARATOR2:(s+=">"+LINE_SEPARATOR2,e.children&&e.children.forEach(o=>{s+=this.createXml(o,t)}),s+"</"+e.name+">"+LINE_SEPARATOR2)}},compressBlob=async e=>{let t=0;const i=[],s=new WritableStream({write:n=>{i.push(n),t+=n.length}}),o=new ReadableStream({start:n=>{const l=new FileReader;l.onload=a=>{a.target?.result&&n.enqueue(a.target.result),n.close()},l.readAsArrayBuffer(e)}}),r=new window.CompressionStream("deflate-raw");return await o.pipeThrough(r).pipeTo(s),{size:t,content:new Blob(i)}},deflateLocalFile=async e=>{const t=new Blob([e]),{size:i,content:s}=await compressBlob(t),o=new Uint8Array(await s.arrayBuffer());return{size:i,content:o}},convertTime=e=>{let t=e.getHours();return t<<=6,t=t|e.getMinutes(),t<<=5,t=t|e.getSeconds()/2,t},convertDate=e=>{let t=e.getFullYear()-1980;return t<<=4,t=t|e.getMonth()+1,t<<=5,t=t|e.getDate(),t};function convertDecToHex(e,t){let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(e&255),e>>>=8;return i}var getCrcFromCrc32TableAndByteArray=e=>{if(!e.length)return 0;let t=-1,i=0,s=0,o=0;for(let r=0;r<e.length;r++)i=e[r],s=(t^i)&255,o=crcTable[s],t=t>>>8^o;return t^-1},getCrcFromCrc32Table=e=>e.length?getCrcFromCrc32TableAndByteArray(typeof e=="string"?new TextEncoder().encode(e):e):0,crcTable=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),getHeaders=(e,t,i,s,o,r)=>{const{content:n,path:l,created:a}=e,d=convertTime(a),h=convertDate(a),c=getCrcFromCrc32Table(o),u=r!==void 0?r:s,g=_utf8_encode(l),p=g!==l;let m="";if(p){const w=convertDecToHex(1,1)+convertDecToHex(getCrcFromCrc32Table(g),4)+g;m="up"+convertDecToHex(w.length,2)+w}const f="\0"+(p?"\0\b":"\0\0")+convertDecToHex(t?8:0,2)+convertDecToHex(d,2)+convertDecToHex(h,2)+convertDecToHex(u?c:0,4)+convertDecToHex(r??s,4)+convertDecToHex(s,4)+convertDecToHex(g.length,2)+convertDecToHex(m.length,2),v="PK"+f+g+m,C="PK\0"+f+"\0\0\0\0\0\0"+(n?"\0\0\0\0":"\0\0\0")+convertDecToHex(i,4)+g+m;return{localFileHeader:Uint8Array.from(v,w=>w.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(C,w=>w.charCodeAt(0))}},getDecodedContent=e=>{let t;if(typeof e=="string"){const i=atob(e.split(";base64,")[1]);t=Uint8Array.from(i,s=>s.charCodeAt(0))}else t=e;return{size:t.length,content:t}},getDeflatedHeaderAndContent=async(e,t)=>{const{content:i}=e,{size:s,content:o}=i?getDecodedContent(i):{size:0,content:Uint8Array.from([])};let r,n,l=!1;if(e.type==="file"&&o&&s>0){const h=await deflateLocalFile(o);r=h.content,n=h.size,l=!0}return{...getHeaders(e,l,t,s,o,n),content:r||o,isCompressed:l}},getHeaderAndContent=(e,t)=>{const{content:i}=e,{content:s}=i?getDecodedContent(i):{content:Uint8Array.from([])};return{...getHeaders(e,!1,t,s.length,s,void 0),content:s,isCompressed:!1}},buildCentralDirectoryEnd=(e,t,i)=>{const s="PK\0\0\0\0"+convertDecToHex(e,2)+convertDecToHex(e,2)+convertDecToHex(t,4)+convertDecToHex(i,4)+"\0\0";return Uint8Array.from(s,o=>o.charCodeAt(0))},ZipContainer=class{static addFolders(e){e.forEach(this.addFolder.bind(this))}static addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}static addFile(e,t,i=!1){this.files.push({path:e,created:new Date,content:i?t:new TextEncoder().encode(t),isBase64:i,type:"file"})}static async getZipFile(e="application/zip"){const t=await this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})}static getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}static clearStream(){this.folders=[],this.files=[]}static packageFiles(e){let t=0,i=0;for(const d of e){const{localFileHeader:h,centralDirectoryHeader:c,content:u}=d;t+=h.length+u.length,i+=c.length}const s=new Uint8Array(t),o=new Uint8Array(i);let r=0,n=0;for(const d of e){const{localFileHeader:h,centralDirectoryHeader:c,content:u}=d;s.set(h,r),r+=h.length,s.set(u,r),r+=u.length,o.set(c,n),n+=c.length}const l=buildCentralDirectoryEnd(e.length,i,t),a=new Uint8Array(s.length+o.length+l.length);return a.set(s),a.set(o,s.length),a.set(l,s.length+o.length),a}static async buildCompressedFileStream(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const o=await getDeflatedHeaderAndContent(s,i),{localFileHeader:r,content:n}=o;t.push(o),i+=r.length+n.length}return this.packageFiles(t)}static buildFileStream(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const o=getHeaderAndContent(s,i),{localFileHeader:r,content:n}=o;t.push(o),i+=r.length+n.length}return this.packageFiles(t)}};ZipContainer.folders=[],ZipContainer.files=[];var InfiniteBlock=class extends RowNodeBlock{wireBeans(e){this.beans=e}constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){_exists(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(_missing(this.params.datasource.getRows)){_warnOnce("datasource is missing getRows method");return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gos.getGridCommonParams().context}}forEachNode(e,t,i){this.rowNodes.forEach((s,o)=>{this.startRow+o<i&&e(s,t.next())})}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const i=e-this.startRow;return this.rowNodes[i]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new RowNode(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach((i,s)=>{const o=e.rowData?e.rowData[s]:void 0;!i.id&&i.alreadyRendered&&o&&(this.rowNodes[s]=new RowNode(this.beans),this.rowNodes[s].setRowIndex(i.rowIndex),this.rowNodes[s].setRowTop(i.rowTop),this.rowNodes[s].setRowHeight(i.rowHeight),i.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[s],o,this.startRow+s)});const t=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroy(){this.rowNodes.forEach(e=>{e.clearRowTopAndRowIndex()}),super.destroy()}},MAX_EMPTY_BLOCKS_TO_KEEP=2,InfiniteCache=class extends BeanStub{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}wireBeans(e){this.rowRenderer=e.rowRenderer,this.focusService=e.focusService}getRow(e,t=!1){const i=Math.floor(e/this.params.blockSize);let s=this.blocks[i];if(!s){if(t)return;s=this.createBlock(i)}return s.getRow(e)}createBlock(e){const t=this.createBean(new InfiniteBlock(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){if(this.blockCount==0){this.purgeCache();return}this.getBlocksInOrder().forEach(t=>t.setStateWaitingToLoad()),this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){this.getBlocksInOrder().forEach(e=>this.destroyBlock(e)),super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.gos.get("debug")&&_log(`InfiniteCache - onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(n=>n!=e),i=(n,l)=>l.getLastAccessed()-n.getLastAccessed();t.sort(i);const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,r=MAX_EMPTY_BLOCKS_TO_KEEP-1;t.forEach((n,l)=>{const a=n.getState()==="needsLoading"&&l>=r,d=s?l>=o:!1;if(a||d){if(this.isBlockCurrentlyDisplayed(n)||this.isBlockFocused(n))return;this.removeBlockFromCache(n)}})}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const i=e.getStartRow(),s=e.getEndRow();return t.rowIndex>=i&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const s=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<s&&(this.rowCount=s)}}setRowCount(e,t){this.rowCount=e,_exists(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new NumberSequence;this.getBlocksInOrder().forEach(i=>i.forEachNode(e,t,this.rowCount))}getBlocksInOrder(){const e=(i,s)=>i.getId()-s.getId();return _getAllValuesInObject(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){if(this.isAlive()){this.destroyAllBlocksPastVirtualRowCount();const e={type:"storeUpdated"};this.eventService.dispatchEvent(e)}}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach(t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)}),e.length>0&&e.forEach(t=>this.destroyBlock(t))}purgeCache(){this.getBlocksInOrder().forEach(e=>this.removeBlockFromCache(e)),this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const i=[];let s=-1,o=!1;const r=new NumberSequence;let n=!1;return this.getBlocksInOrder().forEach(a=>{if(!n){if(o&&s+1!==a.getId()){n=!0;return}s=a.getId(),a.forEachNode(d=>{const h=d===e||d===t;(o||h)&&i.push(d),h&&(o=!o)},r,this.rowCount)}}),n||o?[]:i}},InfiniteRowModel=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowModel"}wireBeans(e){this.filterManager=e.filterManager,this.sortController=e.sortController,this.selectionService=e.selectionService,this.rowRenderer=e.rowRenderer,this.rowNodeBlockLoader=e.rowNodeBlockLoader}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){this.gos.isRowModelType("infinite")&&(this.rowHeight=this.gos.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache()),this.verifyProps())}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&_warnOnce("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy()}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.onCacheUpdated.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;this.cacheParams?e=this.isSortModelDifferent():e=!0,e&&this.reset()}isSortModelDifferent(){return!_jsonEquals(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){if(!this.datasource)return;this.gos.getRowIdCallback()!=null||this.selectionService.reset("rowDataChanged"),this.resetCache()}createModelUpdatedEvent(){return{type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1}}resetCache(){this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:this.filterManager?.getFilterModel()??{},sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.gos.get("infiniteInitialRowCount"),maxBlocksInCache:this.gos.get("maxBlocksInCache"),rowHeight:this.gos.getRowHeightAsNumber(),overflowSize:this.gos.get("cacheOverflowSize"),blockSize:this.gos.get("cacheBlockSize"),lastAccessedSequence:new NumberSequence},this.infiniteCache=this.createBean(new InfiniteCache(this.cacheParams)),this.eventService.dispatchEventOnce({type:"rowCountReady"});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}updateRowHeights(){this.forEachNode(t=>{t.setRowHeight(this.rowHeight),t.setRowTop(this.rowHeight*t.rowIndex)});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?this.infiniteCache.isLastRowIndexKnown():!1}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};function refreshInfiniteCache(e){e.rowModelHelperService?.getInfiniteRowModel()?.refreshCache()}function purgeInfiniteCache(e){e.rowModelHelperService?.getInfiniteRowModel()?.purgeCache()}function getInfiniteRowCount(e){return e.rowModelHelperService?.getInfiniteRowModel()?.getRowCount()}function isLastRowIndexKnown(e){return e.rowModelHelperService?.getInfiniteRowModel()?.isLastRowIndexKnown()}var VERSION4="32.0.0",InfiniteRowModelCoreModule={version:VERSION4,moduleName:"@ag-grid-community/infinite-row-model-core",rowModel:"infinite",beans:[InfiniteRowModel],dependantModules:[RowNodeBlockModule]},InfiniteRowModelApiModule={version:VERSION4,moduleName:"@ag-grid-community/infinite-row-model-api",beans:[RowModelHelperService],apiFunctions:{refreshInfiniteCache,purgeInfiniteCache,getInfiniteRowCount,isLastRowIndexKnown},dependantModules:[InfiniteRowModelCoreModule,SsrmInfiniteSharedApiModule]},InfiniteRowModelModule={version:VERSION4,moduleName:"@ag-grid-community/infinite-row-model",dependantModules:[InfiniteRowModelCoreModule,InfiniteRowModelApiModule]};ModuleRegistry.__registerModules([CommunityFeaturesModule,ClientSideRowModelModule,InfiniteRowModelModule,CsvExportModule],!1,void 0);
|
|
191
|
+
</div>`}onBtNext(){this.nextButtonDisabled||this.paginationService.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationService.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationService.goToLastPage()}enableOrDisableButtons(){const e=this.paginationService.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),i=this.paginationService.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),o=e===i-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){_setAriaDisabled(e,t),e.classList.toggle("ag-disabled",t)}updateRowLabels(){const e=this.paginationService.getCurrentPage(),t=this.paginationService.getPageSize(),i=this.rowModel.isLastRowIndexKnown(),s=this.rowModel.isLastRowIndexKnown()?this.paginationService.getMasterRowCount():null;let o,r;if(this.isZeroPagesToDisplay()?o=r=0:(o=t*e+1,r=o+t-1,i&&r>s&&(r=s)),this.lbFirstRowOnPage.textContent=this.formatNumber(o),this.rowNodeBlockLoader?.isLoading()){const n=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=n("pageLastRowUnknown","?")}else this.lbLastRowOnPage.textContent=this.formatNumber(r)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages();return e&&t===0}setTotalLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.paginationService.getTotalPages(),i=e?this.paginationService.getMasterRowCount():null;if(i===1){const s=this.rowModel.getRow(0);if(s&&s.group&&!(s.groupData||s.aggData)){this.setTotalLabelsToZero();return}}if(e)this.lbTotal.textContent=this.formatNumber(t),this.lbRecordCount.textContent=this.formatNumber(i);else{const s=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=s,this.lbRecordCount.innerHTML=s}}setTotalLabelsToZero(){this.lbFirstRowOnPage.textContent=this.formatNumber(0),this.lbCurrent.textContent=this.formatNumber(0),this.lbLastRowOnPage.textContent=this.formatNumber(0),this.lbTotal.textContent=this.formatNumber(0),this.lbRecordCount.textContent=this.formatNumber(0)}},PaginationSelector={selector:"AG-PAGINATION",component:PaginationComp},PaginationService=class extends BeanStub{constructor(){super(...arguments),this.beanName="paginationService",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.active=this.gos.get("pagination"),this.pageSizeFromGridOptions=this.gos.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return PaginationSelector}isPaginateChildRows(){return this.gos.get("groupRemoveSingleChildren")||this.gos.get("groupRemoveLowestSingleChildren")?!0:this.gos.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){!this.active||this.currentPage===e||typeof this.currentPage!="number"||(this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0}))}isRowPresent(e){return e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){return this.active?this.getPageForIndex(e.rowIndex)===this.currentPage:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return _exists(this.pageSizeAutoCalculated)?this.pageSizeAutoCalculated:_exists(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:_exists(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:_exists(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.pageBoundsService.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const i=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}i!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0){this.setZeroRows();return}const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const s=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=s-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),this.masterRowCount===0){this.setZeroRows();return}const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:i=!1,newPageSize:s=!1}=e,o={type:"paginationChanged",animate:!1,newData:!1,newPage:i,newPageSize:s,keepRenderedRows:t};this.eventService.dispatchEvent(o)}},PaginationCoreModule={version:VERSION,moduleName:"@ag-grid-community/pagination-core",beans:[PaginationService,PaginationAutoPageSizeService]},PaginationApiModule={version:VERSION,moduleName:"@ag-grid-community/pagination-api",dependantModules:[PaginationCoreModule],apiFunctions:{paginationIsLastPageFound,paginationGetPageSize,paginationGetCurrentPage,paginationGetTotalPages,paginationGetRowCount,paginationGoToNextPage,paginationGoToPreviousPage,paginationGoToFirstPage,paginationGoToLastPage,paginationGoToPage}},PaginationModule={version:VERSION,moduleName:"@ag-grid-community/pagination",dependantModules:[PaginationCoreModule,PaginationApiModule]},coreModule="@ag-grid-community/core",clientSideRowModelModule="@ag-grid-community/client-side-row-model",csvExportModule="@ag-grid-community/csv-export",infiniteRowModelModule="@ag-grid-community/infinite-row-model",advancedFilterModule="@ag-grid-enterprise/advanced-filter",gridChartsModule="@ag-grid-enterprise/charts",clipboardModule="@ag-grid-enterprise/clipboard",excelExportModule="@ag-grid-enterprise/excel-export",masterDetailModule="@ag-grid-enterprise/master-detail",menuModule="@ag-grid-enterprise/menu",rangeSelectionModule="@ag-grid-enterprise/range-selection",rowGroupingModule="@ag-grid-enterprise/row-grouping",serverSideRowModelModule="@ag-grid-enterprise/server-side-row-model",sideBarModule="@ag-grid-enterprise/side-bar",statusBarModule="@ag-grid-enterprise/status-bar",functionModules={dispatchEvent:coreModule,getState:coreModule,getGridId:coreModule,destroy:coreModule,isDestroyed:coreModule,getGridOption:coreModule,setGridOption:coreModule,updateGridOptions:coreModule,setNodesSelected:coreModule,selectAll:coreModule,deselectAll:coreModule,selectAllFiltered:coreModule,deselectAllFiltered:coreModule,selectAllOnCurrentPage:coreModule,deselectAllOnCurrentPage:coreModule,getSelectedNodes:coreModule,getSelectedRows:coreModule,redrawRows:coreModule,setRowNodeExpanded:coreModule,getRowNode:coreModule,addRenderedRowListener:coreModule,getRenderedNodes:coreModule,forEachNode:coreModule,getFirstDisplayedRow:coreModule,getFirstDisplayedRowIndex:coreModule,getLastDisplayedRow:coreModule,getLastDisplayedRowIndex:coreModule,getDisplayedRowAtIndex:coreModule,getDisplayedRowCount:coreModule,getModel:coreModule,getVerticalPixelRange:coreModule,getHorizontalPixelRange:coreModule,ensureColumnVisible:coreModule,ensureIndexVisible:coreModule,ensureNodeVisible:coreModule,getFocusedCell:coreModule,clearFocusedCell:coreModule,setFocusedCell:coreModule,tabToNextCell:coreModule,tabToPreviousCell:coreModule,setFocusedHeader:coreModule,addEventListener:coreModule,addGlobalListener:coreModule,removeEventListener:coreModule,removeGlobalListener:coreModule,expireValueCache:coreModule,getValue:coreModule,getCellValue:coreModule,showColumnMenuAfterButtonClick:coreModule,showColumnMenuAfterMouseClick:coreModule,showColumnMenu:coreModule,hidePopupMenu:coreModule,onSortChanged:coreModule,getPinnedTopRowCount:coreModule,getPinnedBottomRowCount:coreModule,getPinnedTopRow:coreModule,getPinnedBottomRow:coreModule,showLoadingOverlay:coreModule,showNoRowsOverlay:coreModule,hideOverlay:coreModule,setGridAriaProperty:coreModule,refreshCells:coreModule,flashCells:coreModule,refreshHeader:coreModule,isAnimationFrameQueueEmpty:coreModule,flushAllAnimationFrames:coreModule,getSizesForCurrentTheme:coreModule,getCellRendererInstances:coreModule,addRowDropZone:coreModule,removeRowDropZone:coreModule,getRowDropZoneParams:coreModule,getColumnDef:coreModule,getColumnDefs:coreModule,sizeColumnsToFit:coreModule,setColumnGroupOpened:coreModule,getColumnGroup:coreModule,getProvidedColumnGroup:coreModule,getDisplayNameForColumn:coreModule,getDisplayNameForColumnGroup:coreModule,getColumn:coreModule,getColumns:coreModule,applyColumnState:coreModule,getColumnState:coreModule,resetColumnState:coreModule,getColumnGroupState:coreModule,setColumnGroupState:coreModule,resetColumnGroupState:coreModule,isPinning:coreModule,isPinningLeft:coreModule,isPinningRight:coreModule,getDisplayedColAfter:coreModule,getDisplayedColBefore:coreModule,setColumnVisible:coreModule,setColumnsVisible:coreModule,setColumnPinned:coreModule,setColumnsPinned:coreModule,getAllGridColumns:coreModule,getDisplayedLeftColumns:coreModule,getDisplayedCenterColumns:coreModule,getDisplayedRightColumns:coreModule,getAllDisplayedColumns:coreModule,getAllDisplayedVirtualColumns:coreModule,moveColumn:coreModule,moveColumnByIndex:coreModule,moveColumns:coreModule,setColumnWidth:coreModule,setColumnWidths:coreModule,getLeftDisplayedColumnGroups:coreModule,getCenterDisplayedColumnGroups:coreModule,getRightDisplayedColumnGroups:coreModule,getAllDisplayedColumnGroups:coreModule,autoSizeColumn:coreModule,autoSizeColumns:coreModule,autoSizeAllColumns:coreModule,undoCellEditing:coreModule,redoCellEditing:coreModule,getCellEditorInstances:coreModule,getEditingCells:coreModule,stopEditing:coreModule,startEditingCell:coreModule,getCurrentUndoSize:coreModule,getCurrentRedoSize:coreModule,isAnyFilterPresent:coreModule,onFilterChanged:coreModule,isColumnFilterPresent:coreModule,getFilterInstance:coreModule,getColumnFilterInstance:coreModule,destroyFilter:coreModule,setFilterModel:coreModule,getFilterModel:coreModule,getColumnFilterModel:coreModule,setColumnFilterModel:coreModule,showColumnFilter:coreModule,isQuickFilterPresent:coreModule,getQuickFilter:coreModule,resetQuickFilter:coreModule,paginationIsLastPageFound:coreModule,paginationGetPageSize:coreModule,paginationGetCurrentPage:coreModule,paginationGetTotalPages:coreModule,paginationGetRowCount:coreModule,paginationGoToNextPage:coreModule,paginationGoToPreviousPage:coreModule,paginationGoToFirstPage:coreModule,paginationGoToLastPage:coreModule,paginationGoToPage:coreModule,expandAll:coreModule,collapseAll:coreModule,onRowHeightChanged:coreModule,setRowCount:coreModule,getCacheBlockState:coreModule,onGroupExpandedOrCollapsed:clientSideRowModelModule,refreshClientSideRowModel:clientSideRowModelModule,forEachLeafNode:clientSideRowModelModule,forEachNodeAfterFilter:clientSideRowModelModule,forEachNodeAfterFilterAndSort:clientSideRowModelModule,resetRowHeights:clientSideRowModelModule,applyTransaction:clientSideRowModelModule,applyTransactionAsync:clientSideRowModelModule,flushAsyncTransactions:clientSideRowModelModule,getBestCostNodeSelection:clientSideRowModelModule,getDataAsCsv:csvExportModule,exportDataAsCsv:csvExportModule,refreshInfiniteCache:infiniteRowModelModule,purgeInfiniteCache:infiniteRowModelModule,getInfiniteRowCount:infiniteRowModelModule,isLastRowIndexKnown:infiniteRowModelModule,getAdvancedFilterModel:advancedFilterModule,setAdvancedFilterModel:advancedFilterModule,showAdvancedFilterBuilder:advancedFilterModule,hideAdvancedFilterBuilder:advancedFilterModule,getChartModels:gridChartsModule,getChartRef:gridChartsModule,getChartImageDataURL:gridChartsModule,downloadChart:gridChartsModule,openChartToolPanel:gridChartsModule,closeChartToolPanel:gridChartsModule,createRangeChart:gridChartsModule,createPivotChart:gridChartsModule,createCrossFilterChart:gridChartsModule,updateChart:gridChartsModule,restoreChart:gridChartsModule,copyToClipboard:clipboardModule,cutToClipboard:clipboardModule,copySelectedRowsToClipboard:clipboardModule,copySelectedRangeToClipboard:clipboardModule,copySelectedRangeDown:clipboardModule,pasteFromClipboard:clipboardModule,getDataAsExcel:excelExportModule,exportDataAsExcel:excelExportModule,getSheetDataForExcel:excelExportModule,getMultipleSheetsAsExcel:excelExportModule,exportMultipleSheetsAsExcel:excelExportModule,addDetailGridInfo:masterDetailModule,removeDetailGridInfo:masterDetailModule,getDetailGridInfo:masterDetailModule,forEachDetailGridInfo:masterDetailModule,showContextMenu:menuModule,showColumnChooser:menuModule,hideColumnChooser:menuModule,getCellRanges:rangeSelectionModule,addCellRange:rangeSelectionModule,clearRangeSelection:rangeSelectionModule,addAggFunc:rowGroupingModule,addAggFuncs:rowGroupingModule,clearAggFuncs:rowGroupingModule,setColumnAggFunc:rowGroupingModule,isPivotMode:rowGroupingModule,getPivotResultColumn:rowGroupingModule,setValueColumns:rowGroupingModule,getValueColumns:rowGroupingModule,removeValueColumn:rowGroupingModule,removeValueColumns:rowGroupingModule,addValueColumn:rowGroupingModule,addValueColumns:rowGroupingModule,setRowGroupColumns:rowGroupingModule,removeRowGroupColumn:rowGroupingModule,removeRowGroupColumns:rowGroupingModule,addRowGroupColumn:rowGroupingModule,addRowGroupColumns:rowGroupingModule,getRowGroupColumns:rowGroupingModule,moveRowGroupColumn:rowGroupingModule,setPivotColumns:rowGroupingModule,removePivotColumn:rowGroupingModule,removePivotColumns:rowGroupingModule,addPivotColumn:rowGroupingModule,addPivotColumns:rowGroupingModule,getPivotColumns:rowGroupingModule,setPivotResultColumns:rowGroupingModule,getPivotResultColumns:rowGroupingModule,getServerSideSelectionState:serverSideRowModelModule,setServerSideSelectionState:serverSideRowModelModule,applyServerSideTransaction:serverSideRowModelModule,applyServerSideTransactionAsync:serverSideRowModelModule,applyServerSideRowData:serverSideRowModelModule,retryServerSideLoads:serverSideRowModelModule,flushServerSideAsyncTransactions:serverSideRowModelModule,refreshServerSide:serverSideRowModelModule,getServerSideGroupLevelState:serverSideRowModelModule,isSideBarVisible:sideBarModule,setSideBarVisible:sideBarModule,setSideBarPosition:sideBarModule,openToolPanel:sideBarModule,closeToolPanel:sideBarModule,getOpenedToolPanel:sideBarModule,refreshToolPanel:sideBarModule,isToolPanelShowing:sideBarModule,getToolPanelInstance:sideBarModule,getSideBar:sideBarModule,getStatusPanel:statusBarModule},clientSide="clientSide",serverSide="serverSide",infinite="infinite",functionRowModels={onGroupExpandedOrCollapsed:[clientSide],refreshClientSideRowModel:[clientSide],forEachLeafNode:[clientSide],forEachNodeAfterFilter:[clientSide],forEachNodeAfterFilterAndSort:[clientSide],resetRowHeights:[clientSide],applyTransaction:[clientSide],applyTransactionAsync:[clientSide],flushAsyncTransactions:[clientSide],getBestCostNodeSelection:[clientSide],getServerSideSelectionState:[serverSide],setServerSideSelectionState:[serverSide],applyServerSideTransaction:[serverSide],applyServerSideTransactionAsync:[serverSide],applyServerSideRowData:[serverSide],retryServerSideLoads:[serverSide],flushServerSideAsyncTransactions:[serverSide],refreshServerSide:[serverSide],getServerSideGroupLevelState:[serverSide],refreshInfiniteCache:[infinite],purgeInfiniteCache:[infinite],getInfiniteRowCount:[infinite],isLastRowIndexKnown:[infinite],expandAll:[clientSide,serverSide],collapseAll:[clientSide,serverSide],onRowHeightChanged:[clientSide,serverSide],setRowCount:[infinite,serverSide],getCacheBlockState:[infinite,serverSide]},deprecatedFunctions={getValue:{version:"v31.3",new:"getCellValue"},getFirstDisplayedRow:{version:"v31.1",new:"getFirstDisplayedRowIndex"},getLastDisplayedRow:{version:"v31.1",new:"getLastDisplayedRowIndex"},getModel:{version:"v31.1",message:"Please use the appropriate grid API methods instead."},setColumnVisible:{version:"v31.1",old:"setColumnVisible(key,visible)",new:"setColumnsVisible([key],visible)"},setColumnPinned:{version:"v31.1",old:"setColumnPinned(key,pinned)",new:"setColumnsPinned([key],pinned)"},moveColumn:{version:"v31.1",old:"moveColumn(key, toIndex)",new:"moveColumns([key], toIndex)"},setColumnWidth:{version:"v31.1",old:"setColumnWidth(col, width)",new:"setColumnWidths([{key: col, newWidth: width}])"},autoSizeColumn:{version:"v31.1",old:"autoSizeColumn(key, skipHeader)",new:"autoSizeColumns([key], skipHeader)"},addAggFunc:{version:"v31.1",old:"addAggFunc(key, func)",new:"addAggFuncs({ key: func })"},removeValueColumn:{version:"v31.1",old:"removeValueColumn(colKey)",new:"removeValueColumns([colKey])"},addValueColumn:{version:"v31.1",old:"addValueColumn(colKey)",new:"addValueColumns([colKey])"},removeRowGroupColumn:{version:"v31.1",old:"removeRowGroupColumn(colKey)",new:"removeRowGroupColumns([colKey])"},addRowGroupColumn:{version:"v31.1",old:"addRowGroupColumn(colKey)",new:"addRowGroupColumns([colKey])"},removePivotColumn:{version:"v31.1",old:"removePivotColumn(colKey)",new:"removePivotColumns([colKey])"},addPivotColumn:{version:"v31.1",old:"addPivotColumn(colKey)",new:"addPivotColumns([colKey])"},showColumnMenuAfterButtonClick:{version:"v31.1",message:"Use 'IHeaderParams.showColumnMenu' within a header component, or 'api.showColumnMenu' elsewhere."},showColumnMenuAfterMouseClick:{version:"v31.1",message:"Use 'IHeaderParams.showColumnMenuAfterMouseClick' within a header component, or 'api.showColumnMenu' elsewhere."},getFilterInstance:{version:"v31.1",message:"'getFilterInstance' is deprecated. To get/set individual filter models, use 'getColumnFilterModel' or 'setColumnFilterModel' instead. To get hold of the filter instance, use 'getColumnFilterInstance' which returns the instance asynchronously."},showLoadingOverlay:{version:"v32",message:'`showLoadingOverlay` is deprecated. Use the grid option "loading"=true instead or setGridOption("loading", true).'}};function warnMissingApiFunction(e,t){const i=functionModules[e];i?ModuleRegistry.__assertRegistered(i,`api.${e}`,t)&&_warnOnce(`API function '${e}' not registered to module '${i}'`):_errorOnce(`Unknown API function: '${e}' on GridApi.`)}function validateApiFunction(e,t,i){const s=deprecatedFunctions[e];if(s){const{version:r,new:n,old:l,message:a}=s,d=l??e;return(...h)=>{const c=n?`Please use ${n} instead. `:"";return _warnOnce(`Since ${r} api.${d} is deprecated. ${c}${a??""}`),t.apply(t,h)}}const o=functionRowModels[e];return o?(...r)=>{const n=i.rowModel.getType();if(!o.includes(n)){_errorOnce(`api.${e} can only be called when gridOptions.rowModelType is ${o.join(" or ")}`);return}return t.apply(t,r)}:t}var COLUMN_DEFINITION_DEPRECATIONS={columnsMenuParams:{version:"31.1",message:"Use `columnChooserParams` instead."},suppressMenu:{version:"31.1",message:"Use `suppressHeaderMenuButton` instead."},suppressCellFlash:{version:"31.2",message:"Use `enableCellChangeFlash={false}` in the ColDef"}},CSRM_REQUIRES_ROW_GROUP_MODULE=(e,t)=>(t.rowModelType??"clientSide")==="clientSide"?{module:"@ag-grid-enterprise/row-grouping"}:null,COLUMN_DEFINITION_VALIDATIONS={enableRowGroup:CSRM_REQUIRES_ROW_GROUP_MODULE,rowGroup:CSRM_REQUIRES_ROW_GROUP_MODULE,rowGroupIndex:CSRM_REQUIRES_ROW_GROUP_MODULE,enablePivot:CSRM_REQUIRES_ROW_GROUP_MODULE,enableValue:CSRM_REQUIRES_ROW_GROUP_MODULE,pivot:CSRM_REQUIRES_ROW_GROUP_MODULE,pivotIndex:CSRM_REQUIRES_ROW_GROUP_MODULE,aggFunc:CSRM_REQUIRES_ROW_GROUP_MODULE,cellEditor:e=>e.cellEditor==="agRichSelect"||e.cellEditor==="agRichSelectCellEditor"?{module:"@ag-grid-enterprise/rich-select"}:null,menuTabs:e=>{const t=["columnsMenuTab","generalMenuTab"];return e.menuTabs?.some(i=>t.includes(i))?{module:"@ag-grid-enterprise/menu"}:null},columnsMenuParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},columnChooserParams:{module:["@ag-grid-enterprise/menu","@ag-grid-enterprise/column-tool-panel"]},headerCheckboxSelection:{supportedRowModels:["clientSide","serverSide"],dependencies:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelection is only supported with rowSelection=multiple"},headerCheckboxSelectionFilteredOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelectionFilteredOnly is only supported with rowSelection=multiple"},headerCheckboxSelectionCurrentPageOnly:{supportedRowModels:["clientSide"],dependencies:(e,{rowSelection:t})=>t==="multiple"?null:"headerCheckboxSelectionCurrentPageOnly is only supported with rowSelection=multiple"},children:()=>COL_DEF_VALIDATORS},colDefPropertyMap={headerName:void 0,columnGroupShow:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellAriaRole:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnsMenuParams:void 0,columnChooserParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressCellFlash:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressMenu:void 0,suppressHeaderMenuButton:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0,mainMenuItems:void 0,contextMenuItems:void 0,suppressFloatingFilterButton:void 0,suppressHeaderFilterButton:void 0,suppressHeaderContextMenu:void 0,loadingCellRenderer:void 0,loadingCellRendererParams:void 0,loadingCellRendererSelector:void 0,context:void 0},ALL_PROPERTIES=Object.keys(colDefPropertyMap),COL_DEF_VALIDATORS={objectName:"colDef",allProperties:ALL_PROPERTIES,docsUrl:"column-properties/",deprecations:COLUMN_DEFINITION_DEPRECATIONS,validations:COLUMN_DEFINITION_VALIDATIONS},GRID_OPTION_DEPRECATIONS=()=>({advancedFilterModel:{version:"31",message:"Use `initialState.filter.advancedFilterModel` instead."},suppressAsyncEvents:{version:"31",message:"Events should be handled asynchronously."},cellFadeDelay:{version:"31.1",renamed:"cellFadeDuration"},cellFlashDelay:{version:"31.1",renamed:"cellFlashDuration"},suppressServerSideInfiniteScroll:{version:"31.1"},serverSideSortOnServer:{version:"31.1"},serverSideFilterOnServer:{version:"31.1"},enableCellChangeFlash:{version:"31.2",message:"Use `enableCellChangeFlash` in the `ColDef` or `defaultColDef` for all columns."},groupIncludeFooter:{version:"31.3",message:"Use `groupTotalRow` instead."},groupIncludeTotalFooter:{version:"31.3",message:"Use `grandTotalRow` instead."},suppressLoadingOverlay:{version:"32",message:"Use `loading`=false instead."}}),GRID_OPTION_DEFAULTS={suppressContextMenu:!1,preventDefaultOnContextMenu:!1,allowContextMenuWithControlKey:!1,suppressMenuHide:!0,enableBrowserTooltips:!1,tooltipTrigger:"hover",tooltipShowDelay:2e3,tooltipHideDelay:1e4,tooltipMouseTrack:!1,tooltipShowMode:"standard",tooltipInteraction:!1,copyHeadersToClipboard:!1,copyGroupHeadersToClipboard:!1,clipboardDelimiter:" ",suppressCopyRowsToClipboard:!1,suppressCopySingleCellRanges:!1,suppressLastEmptyLineOnPaste:!1,suppressClipboardPaste:!1,suppressClipboardApi:!1,suppressCutToClipboard:!1,maintainColumnOrder:!1,suppressFieldDotNotation:!1,allowDragFromColumnsToolPanel:!1,suppressMovableColumns:!1,suppressColumnMoveAnimation:!1,suppressDragLeaveHidesColumns:!1,suppressRowGroupHidesColumns:!1,suppressAutoSize:!1,autoSizePadding:20,skipHeaderOnAutoSize:!1,singleClickEdit:!1,suppressClickEdit:!1,readOnlyEdit:!1,stopEditingWhenCellsLoseFocus:!1,enterNavigatesVertically:!1,enterNavigatesVerticallyAfterEdit:!1,enableCellEditingOnBackspace:!1,undoRedoCellEditing:!1,undoRedoCellEditingLimit:10,suppressCsvExport:!1,suppressExcelExport:!1,cacheQuickFilter:!1,includeHiddenColumnsInQuickFilter:!1,excludeChildrenWhenTreeDataFiltering:!1,enableAdvancedFilter:!1,includeHiddenColumnsInAdvancedFilter:!1,enableCharts:!1,masterDetail:!1,keepDetailRows:!1,keepDetailRowsCount:10,detailRowAutoHeight:!1,tabIndex:0,rowBuffer:10,valueCache:!1,valueCacheNeverExpires:!1,enableCellExpressions:!1,suppressTouch:!1,suppressFocusAfterRefresh:!1,suppressAsyncEvents:!1,suppressBrowserResizeObserver:!1,suppressPropertyNamesCheck:!1,suppressChangeDetection:!1,debug:!1,suppressLoadingOverlay:!1,suppressNoRowsOverlay:!1,pagination:!1,paginationPageSize:100,paginationPageSizeSelector:!0,paginationAutoPageSize:!1,paginateChildRows:!1,suppressPaginationPanel:!1,pivotMode:!1,pivotPanelShow:"never",pivotDefaultExpanded:0,pivotSuppressAutoColumn:!1,suppressExpandablePivotGroups:!1,functionsReadOnly:!1,suppressAggFuncInHeader:!1,alwaysAggregateAtRootLevel:!1,aggregateOnlyChangedColumns:!1,suppressAggFilteredOnly:!1,removePivotHeaderRowWhenSingleValueColumn:!1,animateRows:!0,enableCellChangeFlash:!1,cellFlashDelay:500,cellFlashDuration:500,cellFadeDelay:1e3,cellFadeDuration:1e3,allowShowChangeAfterFilter:!1,domLayout:"normal",ensureDomOrder:!1,enableRtl:!1,suppressColumnVirtualisation:!1,suppressMaxRenderedRowRestriction:!1,suppressRowVirtualisation:!1,rowDragManaged:!1,suppressRowDrag:!1,suppressMoveWhenRowDragging:!1,rowDragEntireRow:!1,rowDragMultiRow:!1,embedFullWidthRows:!1,groupDisplayType:"singleColumn",groupDefaultExpanded:0,groupMaintainOrder:!1,groupSelectsChildren:!1,groupIncludeTotalFooter:!1,groupSuppressBlankHeader:!1,groupSelectsFiltered:!1,showOpenedGroup:!1,groupRemoveSingleChildren:!1,groupRemoveLowestSingleChildren:!1,groupHideOpenParents:!1,groupAllowUnbalanced:!1,rowGroupPanelShow:"never",suppressMakeColumnVisibleAfterUnGroup:!1,treeData:!1,rowGroupPanelSuppressSort:!1,suppressGroupRowsSticky:!1,rowModelType:"clientSide",asyncTransactionWaitMillis:50,suppressModelUpdateAfterUpdateTransaction:!1,cacheOverflowSize:1,infiniteInitialRowCount:1,serverSideInitialRowCount:1,suppressServerSideInfiniteScroll:!1,cacheBlockSize:100,maxBlocksInCache:-1,maxConcurrentDatasourceRequests:2,blockLoadDebounceMillis:0,purgeClosedRowNodes:!1,serverSideSortAllLevels:!1,serverSideOnlyRefreshFilteredGroups:!1,serverSideSortOnServer:!1,serverSideFilterOnServer:!1,serverSidePivotResultFieldSeparator:"_",viewportRowModelPageSize:5,viewportRowModelBufferSize:5,alwaysShowHorizontalScroll:!1,alwaysShowVerticalScroll:!1,debounceVerticalScrollbar:!1,suppressHorizontalScroll:!1,suppressScrollOnNewData:!1,suppressScrollWhenPopupsAreOpen:!1,suppressAnimationFrame:!1,suppressMiddleClickScrolls:!1,suppressPreventDefaultOnMouseWheel:!1,rowMultiSelectWithClick:!1,suppressRowDeselection:!1,suppressRowClickSelection:!1,suppressCellFocus:!1,suppressHeaderFocus:!1,suppressMultiRangeSelection:!1,enableCellTextSelection:!1,enableRangeSelection:!1,enableRangeHandle:!1,enableFillHandle:!1,fillHandleDirection:"xy",suppressClearOnFillReduction:!1,accentedSort:!1,unSortIcon:!1,suppressMultiSort:!1,alwaysMultiSort:!1,suppressMaintainUnsortedOrder:!1,suppressRowHoverHighlight:!1,suppressRowTransform:!1,columnHoverHighlight:!1,deltaSort:!1,enableGroupEdit:!1,suppressGroupMaintainValueType:!1,groupLockGroupColumns:0,serverSideEnableClientSideSort:!1,suppressServerSideFullWidthLoadingRow:!1,pivotMaxGeneratedColumns:-1,columnMenu:"new",reactiveCustomComponents:!0},GRID_OPTION_VALIDATIONS=()=>({sideBar:{module:"@ag-grid-enterprise/side-bar"},statusBar:{module:"@ag-grid-enterprise/status-bar"},enableCharts:{module:"@ag-grid-enterprise/charts"},getMainMenuItems:{module:"@ag-grid-enterprise/menu"},getContextMenuItems:{module:"@ag-grid-enterprise/menu"},allowContextMenuWithControlKey:{module:"@ag-grid-enterprise/menu"},enableAdvancedFilter:{module:"@ag-grid-enterprise/advanced-filter"},treeData:{supportedRowModels:["clientSide","serverSide"],module:"@ag-grid-enterprise/row-grouping",dependencies:e=>{const t=e.rowModelType??"clientSide";switch(t){case"clientSide":{const i=`treeData requires 'getDataPath' in the ${t} row model.`;return e.getDataPath?null:i}case"serverSide":{const i=`treeData requires 'isServerSideGroup' and 'getServerSideGroupKey' in the ${t} row model.`;return e.isServerSideGroup&&e.getServerSideGroupKey?null:i}}return null}},masterDetail:{module:"@ag-grid-enterprise/master-detail"},enableRangeSelection:{module:"@ag-grid-enterprise/range-selection"},enableRangeHandle:{dependencies:{enableRangeSelection:[!0]}},enableFillHandle:{dependencies:{enableRangeSelection:[!0]}},groupDefaultExpanded:{supportedRowModels:["clientSide"]},groupIncludeFooter:{supportedRowModels:["clientSide","serverSide"],dependencies:e=>{switch(e.rowModelType??"clientSide"){case"clientSide":return null;case"serverSide":return e.suppressServerSideInfiniteScroll?"groupIncludeFooter is not supported alongside suppressServerSideInfiniteScroll":null}return null}},groupHideOpenParents:{supportedRowModels:["clientSide"],dependencies:{groupTotalRow:[void 0,"bottom"]}},groupIncludeTotalFooter:{supportedRowModels:["clientSide"]},groupRemoveSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveLowestSingleChildren:[void 0,!1]}},groupRemoveLowestSingleChildren:{dependencies:{groupHideOpenParents:[void 0,!1],groupRemoveSingleChildren:[void 0,!1]}},groupSelectsChildren:{dependencies:{rowSelection:["multiple"]}},viewportDatasource:{supportedRowModels:["viewport"],module:"@ag-grid-enterprise/viewport-row-model"},serverSideDatasource:{supportedRowModels:["serverSide"],module:"@ag-grid-enterprise/server-side-row-model"},cacheBlockSize:{supportedRowModels:["serverSide","infinite"]},datasource:{supportedRowModels:["infinite"],module:"@ag-grid-community/infinite-row-model"},rowData:{supportedRowModels:["clientSide"],module:"@ag-grid-community/client-side-row-model"},columnDefs:()=>COL_DEF_VALIDATORS,defaultColDef:()=>COL_DEF_VALIDATORS,defaultColGroupDef:()=>COL_DEF_VALIDATORS,autoGroupColumnDef:()=>COL_DEF_VALIDATORS}),GRID_OPTIONS_VALIDATORS=()=>({objectName:"gridOptions",allProperties:[...PropertyKeys.ALL_PROPERTIES,...ComponentUtil.EVENT_CALLBACKS],propertyExceptions:["api"],docsUrl:"grid-options/",deprecations:GRID_OPTION_DEPRECATIONS(),validations:GRID_OPTION_VALIDATIONS()}),ValidationService=class extends BeanStub{constructor(){super(...arguments),this.beanName="validationService"}wireBeans(e){this.beans=e,this.gridOptions=e.gridOptions}postConstruct(){this.processGridOptions(this.gridOptions)}processGridOptions(e){this.processOptions(e,GRID_OPTIONS_VALIDATORS())}processColumnDefs(e){this.processOptions(e,COL_DEF_VALIDATORS)}warnMissingApiFunction(e){warnMissingApiFunction(e,this.gridId)}validateApiFunction(e,t){return validateApiFunction(e,t,this.beans)}processOptions(e,t){const{validations:i,deprecations:s,allProperties:o,propertyExceptions:r,objectName:n,docsUrl:l}=t;o&&this.gridOptions.suppressPropertyNamesCheck!==!0&&this.checkProperties(e,[...r??[],...Object.keys(s)],o,n,l);const a=new Set;Object.keys(e).forEach(h=>{const c=s[h];if(c)if("renamed"in c){const{renamed:v,version:w}=c;a.add(`As of v${w}, ${String(h)} is deprecated. Please use ${String(v)} instead.`),e[v]=e[h]}else{const{message:v,version:w}=c;a.add(`As of v${w}, ${String(h)} is deprecated. ${v??""}`)}const u=e[h];if(u==null||u===!1)return;const g=i[h];let p;if(g)if(typeof g=="function"){const v=g(e,this.gridOptions);if(!v)return;if("objectName"in v){const w=e[h];if(Array.isArray(w)){w.forEach(y=>{this.processOptions(y,v)});return}this.processOptions(e[h],v);return}p=v}else p=g;else return;const{module:f,dependencies:m,supportedRowModels:C}=p;if(C){const v=this.gridOptions.rowModelType??"clientSide";if(!C.includes(v)){a.add(`${String(h)} is not supported with the '${v}' row model.`);return}}if(f){const v=Array.isArray(f)?f:[f];let w=!0;if(v.forEach(y=>{ModuleRegistry.__assertRegistered(y,String(h),this.gridId)||(w=!1,a.add(`${String(h)} is only available when ${y} is loaded.`))}),!w)return}if(m){const v=this.checkForWarning(h,m,e);if(v){a.add(v);return}}}),a.size>0&&a.forEach(h=>{_warnOnce(h)})}checkForWarning(e,t,i){if(typeof t=="function")return t(i,this.gridOptions);const o=Object.entries(t).find(([l,a])=>{const d=i[l];return!a.includes(d)});if(!o)return null;const[r,n]=o;return n.length>1?`'${String(e)}' requires '${r}' to be one of [${n.join(", ")}].`:`'${String(e)}' requires '${r}' to be ${n[0]}.`}checkProperties(e,t,i,s,o){const r=["__ob__","__v_skip","__metadata__"],n=_fuzzyCheckStrings(Object.getOwnPropertyNames(e),[...r,...t,...i],i);if(_iterateObject(n,(l,a)=>{let d=`invalid ${s} property '${l}' did you mean any of these: ${a.slice(0,8).join(", ")}.`;i.includes("context")&&(d+=`
|
|
192
|
+
If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),_warnOnce(d)}),Object.keys(n).length>0&&o){const l=this.getFrameworkOverrides().getDocLink(o);_warnOnce(`to see all the valid ${s} properties please check: ${l}`)}}},GridCoreModule={version:VERSION,moduleName:"@ag-grid-community/core"},ValidationsModule={version:VERSION,moduleName:"@ag-grid-community/core-validations",beans:[ValidationService]},CommunityFeaturesModule={version:VERSION,moduleName:"@ag-grid-community/core-community-features",dependantModules:[GridCoreModule,ValidationsModule,EditModule,FilterModule,StateModule,DataTypeModule,AlignedGridsModule,PaginationModule,CommunityApiModule]},GridDestroyService=class extends BeanStub{constructor(){super(...arguments),this.beanName="gridDestroyService",this.destroyCalled=!1}wireBeans(e){this.beans=e}destroy(){if(this.destroyCalled)return;const e={type:"gridPreDestroyed",state:this.beans.stateService?.getState()??{}};this.eventService.dispatchEvent(e),this.destroyCalled=!0,this.beans.ctrlsService.get("gridCtrl")?.destroyGridUi(),this.beans.context.destroy(),super.destroy()}isDestroyCalled(){return this.destroyCalled}},ALWAYS_SYNC_GLOBAL_EVENTS=new Set(["gridPreDestroyed","fillStart","pasteStart"]),isSelectionUIEvent=e=>e==="checkboxSelected"||e==="rowClicked"||e==="spaceKey"||e==="uiSelectAll"||e==="uiSelectAllCurrentPage"||e==="uiSelectAllFiltered",PROPERTY_COERCIONS=new Map([...PropertyKeys.BOOLEAN_PROPERTIES.map(e=>[e,toBoolean]),...PropertyKeys.NUMBER_PROPERTIES.map(e=>[e,toNumber]),["groupAggFiltering",e=>typeof e=="function"?e:toBoolean(e)],["pageSize",toConstrainedNum(1)],["autoSizePadding",toConstrainedNum(0)],["keepDetailRowsCount",toConstrainedNum(1)],["rowBuffer",toConstrainedNum(0)],["infiniteInitialRowCount",toConstrainedNum(1)],["cacheOverflowSize",toConstrainedNum(1)],["cacheBlockSize",toConstrainedNum(1)],["serverSideInitialRowCount",toConstrainedNum(1)],["viewportRowModelPageSize",toConstrainedNum(1)],["viewportRowModelBufferSize",toConstrainedNum(0)]]);function getCoercedValue(e,t){const i=PROPERTY_COERCIONS.get(e);return i?i(t):t}function getCoercedGridOptions(e){const t={};return Object.entries(e).forEach(([i,s])=>{const o=getCoercedValue(i,s);t[i]=o}),t}var _GridOptionsService=class W extends BeanStub{constructor(){super(...arguments),this.beanName="gos",this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new LocalEventService,this.globalEventHandlerFactory=t=>(i,s)=>{if(!this.isAlive())return;const o=ALWAYS_SYNC_GLOBAL_EVENTS.has(i);if(o&&!t||!o&&t)return;const r=ComponentUtil.getCallbackForEvent(i),n=this.gridOptions[r];typeof n=="function"&&this.frameworkOverrides.wrapOutgoing(()=>{n(s)})}}wireBeans(t){this.gridOptions=t.gridOptions,this.eGridDiv=t.eGridDiv,this.validationService=t.validationService,this.environment=t.environment,this.api=t.gridApi}get gridOptionsContext(){return this.gridOptions.context}postConstruct(){const t=!this.get("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),t),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.propertyEventService.setFrameworkOverrides(this.frameworkOverrides),this.getScrollbarWidth(),this.addManagedEventListeners({gridOptionsChanged:({options:i})=>{this.updateGridOptions({options:i,force:!0,source:"gridOptionsUpdated"})}})}get(t){return this.gridOptions[t]??GRID_OPTION_DEFAULTS[t]}getCallback(t){return this.mergeGridCommonParams(this.gridOptions[t])}exists(t){return _exists(this.gridOptions[t])}mergeGridCommonParams(t){return t&&(s=>{const o=s;return o.api=this.api,o.context=this.gridOptionsContext,t(o)})}updateGridOptions({options:t,force:i,source:s="api"}){const o={id:W.changeSetId++,properties:[]},r=[];Object.entries(t).forEach(([n,l])=>{s==="api"&&INITIAL_GRID_OPTION_KEYS[n]&&_warnOnce(`${n} is an initial property and cannot be updated.`);const a=getCoercedValue(n,l),d=i||typeof a=="object"&&s==="api",h=this.gridOptions[n];if(d||h!==a){this.gridOptions[n]=a;const c={type:n,currentValue:a,previousValue:h,changeSet:o,source:s};r.push(c)}}),this.validationService?.processGridOptions(this.gridOptions),o.properties=r.map(n=>n.type),r.forEach(n=>{this.gridOptions.debug&&_log(`Updated property ${n.type} from`,n.previousValue," to ",n.currentValue),this.propertyEventService.dispatchEvent(n)})}addPropertyEventListener(t,i){this.propertyEventService.addEventListener(t,i)}removePropertyEventListener(t,i){this.propertyEventService.removeEventListener(t,i)}getScrollbarWidth(){if(this.scrollbarWidth==null){const i=typeof this.gridOptions.scrollbarWidth=="number"&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:_getScrollbarWidth();i!=null&&(this.scrollbarWidth=i,this.eventService.dispatchEvent({type:"scrollbarWidthChanged"}))}return this.scrollbarWidth}isRowModelType(t){return this.gridOptions.rowModelType===t||t==="clientSide"&&_missing(this.gridOptions.rowModelType)}isDomLayout(t){return(this.gridOptions.domLayout??"normal")===t}isRowSelection(){return this.gridOptions.rowSelection==="single"||this.gridOptions.rowSelection==="multiple"}useAsyncEvents(){return!this.get("suppressAsyncEvents")}isGetRowHeightFunction(){return typeof this.gridOptions.getRowHeight=="function"}getRowHeightForNode(t,i=!1,s){if(s==null&&(s=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(i)return{height:s,estimated:!0};const r={node:t,data:t.data},n=this.getCallback("getRowHeight")(r);if(this.isNumeric(n))return n===0&&_warnOnce("The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),{height:Math.max(1,n),estimated:!1}}return t.detail&&this.get("masterDetail")?this.getMasterDetailRowHeight():{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:s,estimated:!1}}getMasterDetailRowHeight(){return this.get("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||_missing(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const t=this.environment.refreshRowHeightVariable();return t!==-1?t:(_warnOnce("row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(t){return!isNaN(t)&&typeof t=="number"&&isFinite(t)}getDomDataKey(){return this.domDataKey}getDomData(t,i){const s=t[this.getDomDataKey()];return s?s[i]:void 0}setDomData(t,i,s){const o=this.getDomDataKey();let r=t[o];_missing(r)&&(r={},t[o]=r),r[i]=s}getDocument(){let t=null;return this.gridOptions.getDocument&&_exists(this.gridOptions.getDocument)?t=this.gridOptions.getDocument():this.eGridDiv&&(t=this.eGridDiv.ownerDocument),t&&_exists(t)?t:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getActiveDomElement(){return this.getRootNode().activeElement}getAsyncTransactionWaitMillis(){return _exists(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return this.get("ensureDomOrder")?!1:this.get("animateRows")}isGroupRowsSticky(){return!(this.get("paginateChildRows")||this.get("groupHideOpenParents")||this.isDomLayout("print"))}isColumnsSortingCoupledToGroup(){return!this.gridOptions.autoGroupColumnDef?.comparator&&!this.get("treeData")}getGroupAggFiltering(){const t=this.gridOptions.groupAggFiltering;if(typeof t=="function")return this.getCallback("groupAggFiltering");if(t===!0)return()=>!0}getGrandTotalRow(){const t=this.gridOptions.grandTotalRow;if(t)return t;if(this.gridOptions.groupIncludeTotalFooter)return"bottom"}getGroupTotalRowCallback(){const t=this.get("groupTotalRow");if(typeof t=="function")return this.getCallback("groupTotalRow");if(t)return()=>t;const i=this.get("groupIncludeFooter");if(typeof i=="function"){const s=this.getCallback("groupIncludeFooter");return o=>s(o)?"bottom":void 0}return()=>i?"bottom":void 0}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?this.gridOptions.groupDisplayType==="multipleColumns":this.get("groupHideOpenParents")}isGroupUseEntireRow(t){return t?!1:this.gridOptions.groupDisplayType==="groupRows"}getGridCommonParams(){return{api:this.api,context:this.gridOptionsContext}}addGridCommonParams(t){const i=t;return i.api=this.api,i.context=this.gridOptionsContext,i}getRowIdCallback(){const t=this.getCallback("getRowId");return t===void 0?t:i=>{let s=t(i);return typeof s!="string"&&(_warnOnce("The getRowId callback must return a string. The ID ",s," is being cast to a string."),s=String(s)),s}}};_GridOptionsService.changeSetId=0;var GridOptionsService=_GridOptionsService,HeaderPositionUtils=class extends BeanStub{constructor(){super(...arguments),this.beanName="headerPositionUtils"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.ctrlsService=e.ctrlsService}findHeader(e,t){let i,s;if(isColumnGroup(e.column)?i=this.visibleColsService.getGroupAtDirection(e.column,t):(s=`getCol${t}`,i=this.visibleColsService[s](e.column)),!i)return;const{headerRowIndex:o}=e;if(this.getHeaderRowType(o)!=="filter"){const l=[i];for(;i.getParent();)i=i.getParent(),l.push(i);i=l[l.length-1-o]}const{column:r,headerRowIndex:n}=this.getHeaderIndexToFocus(i,o);return{column:r,headerRowIndex:n}}getHeaderIndexToFocus(e,t){let i;if(isColumnGroup(e)&&this.isAnyChildSpanningHeaderHeight(e)&&e.isPadding()){const s=e;i=s.getLeafColumns()[0];let o=i;for(;o!==s;)t++,o=o.getParent()}return{column:i||e,headerRowIndex:t}}isAnyChildSpanningHeaderHeight(e){return e?e.getLeafColumns().some(t=>t.isSpanHeaderHeight()):!1}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),s=i==="filter",o=i==="column";let r=s?e:e.getParent(),n=t-1,l=n;if(o&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;r&&r.isPadding();)r=r.getParent(),n--;l=n,n<0&&(r=e,n=t,l=void 0)}return{column:r,headerRowIndex:n,headerRowIndexWithoutSpan:l}}getColumnVisibleChild(e,t,i="After"){const s=this.getHeaderRowType(t);let o=e,r=t+1;const n=r;if(s==="group"){const l=e.getDisplayedLeafColumns(),a=i==="After"?l[0]:_last(l),d=[];let h=a;for(;h.getParent()!==e;)h=h.getParent(),d.push(h);if(o=a,a.isSpanHeaderHeight())for(let c=d.length-1;c>=0;c--){const u=d[c];if(!u.isPadding()){o=u;break}r++}else o=_last(d),o||(o=a)}return{column:o,headerRowIndex:r,headerRowIndexWithoutSpan:n}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.visibleColsService.getAllCols(),s=i[t==="start"?0:i.length-1];if(!s)return;const r=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()).getRowType(e);if(r=="group"){const n=this.visibleColsService.getColGroupAtLevel(s,e);return{headerRowIndex:e,column:n}}return{headerRowIndex:r==null?-1:e,column:s}}},LocaleService=class extends BeanStub{constructor(){super(...arguments),this.beanName="localeService"}getLocaleTextFunc(){const e=this.gos.getCallback("getLocaleText");if(e)return(i,s,o)=>e({key:i,defaultValue:s,variableValues:o});const t=this.gos.get("localeText");return(i,s,o)=>{let r=t&&t[i];if(r&&o&&o.length){let n=0;for(;!(n>=o.length||r.indexOf("${variable}")===-1);)r=r.replace("${variable}",o[n++])}return r??s}}},ApiEventService=class extends BeanStub{constructor(){super(...arguments),this.beanName="apiEventService",this.syncEventListeners=new Map,this.asyncEventListeners=new Map,this.syncGlobalEventListeners=new Set,this.globalEventListenerPairs=new Map}postConstruct(){this.frameworkEventWrappingService=new FrameworkEventListenerService(this.getFrameworkOverrides())}addEventListener(e,t){const i=this.frameworkEventWrappingService.wrap(t),s=this.gos.useAsyncEvents()&&!ALWAYS_SYNC_GLOBAL_EVENTS.has(e),o=s?this.asyncEventListeners:this.syncEventListeners;o.has(e)||o.set(e,new Set),o.get(e).add(i),this.eventService.addEventListener(e,i,s)}removeEventListener(e,t){const i=this.frameworkEventWrappingService.unwrap(t),o=!!this.asyncEventListeners.get(e)?.delete(i);o||this.syncEventListeners.get(e)?.delete(i),this.eventService.removeEventListener(e,i,o)}addGlobalListener(e){const t=this.frameworkEventWrappingService.wrapGlobal(e);if(this.gos.useAsyncEvents()){const s=(r,n)=>{ALWAYS_SYNC_GLOBAL_EVENTS.has(r)&&t(r,n)},o=(r,n)=>{ALWAYS_SYNC_GLOBAL_EVENTS.has(r)||t(r,n)};this.globalEventListenerPairs.set(e,{syncListener:s,asyncListener:o}),this.eventService.addGlobalListener(s,!1),this.eventService.addGlobalListener(o,!0)}else this.syncGlobalEventListeners.add(t),this.eventService.addGlobalListener(t,!1)}removeGlobalListener(e){const t=this.frameworkEventWrappingService.unwrapGlobal(e);if(this.globalEventListenerPairs.has(t)){const{syncListener:s,asyncListener:o}=this.globalEventListenerPairs.get(t);this.eventService.removeGlobalListener(s,!1),this.eventService.removeGlobalListener(o,!0),this.globalEventListenerPairs.delete(e)}else this.syncGlobalEventListeners.delete(t),this.eventService.removeGlobalListener(t,!1)}destroyEventListeners(e,t){e.forEach((i,s)=>{i.forEach(o=>this.eventService.removeEventListener(s,o,t)),i.clear()}),e.clear()}destroyGlobalListeners(e,t){e.forEach(i=>this.eventService.removeGlobalListener(i,t)),e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncEventListeners,!1),this.destroyEventListeners(this.asyncEventListeners,!0),this.destroyGlobalListeners(this.syncGlobalEventListeners,!1),this.globalEventListenerPairs.forEach(({syncListener:e,asyncListener:t})=>{this.eventService.removeGlobalListener(e,!1),this.eventService.removeGlobalListener(t,!0)}),this.globalEventListenerPairs.clear()}},PageBoundsListener=class extends BeanStub{constructor(){super(...arguments),this.beanName="pageBoundsListener"}wireBeans(e){this.rowModel=e.rowModel,this.paginationService=e.paginationService,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.addManagedEventListeners({modelUpdated:this.onModelUpdated.bind(this),recalculateRowBounds:this.calculatePages.bind(this)}),this.onModelUpdated()}onModelUpdated(e){this.calculatePages();const t={type:"paginationChanged",animate:e?e.animate:!1,newData:e?e.newData:!1,newPage:e?e.newPage:!1,newPageSize:e?e.newPageSize:!1,keepRenderedRows:e?e.keepRenderedRows:!1};this.eventService.dispatchEvent(t)}calculatePages(){this.paginationService?this.paginationService.calculatePages():this.pageBoundsService.calculateBounds(0,this.rowModel.getRowCount()-1)}},PageBoundsService=class extends BeanStub{constructor(){super(...arguments),this.beanName="pageBoundsService",this.pixelOffset=0}wireBeans(e){this.rowModel=e.rowModel}getFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getCurrentPageHeight(){return _missing(this.topRowBounds)||_missing(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){const e=this.topRowBounds?this.topRowBounds.rowTop:0,t=this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0;return{pageFirstPixel:e,pageLastPixel:t}}calculateBounds(e,t){this.topRowBounds=this.rowModel.getRowBounds(e),this.topRowBounds&&(this.topRowBounds.rowIndex=e),this.bottomRowBounds=this.rowModel.getRowBounds(t),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=t),this.calculatePixelOffset()}getPixelOffset(){return this.pixelOffset}calculatePixelOffset(){const e=_exists(this.topRowBounds)?this.topRowBounds.rowTop:0;this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:"paginationPixelOffsetChanged"}))}},AriaAnnouncementService=class extends BeanStub{constructor(){super(),this.beanName="ariaAnnouncementService",this.descriptionContainer=null,this.announceValue=_debounce(this.announceValue.bind(this),200)}wireBeans(e){this.eGridDiv=e.eGridDiv}postConstruct(){const e=this.gos.getDocument(),t=this.descriptionContainer=e.createElement("div");t.classList.add("ag-aria-description-container"),_setAriaLive(t,"polite"),_setAriaRelevant(t,"additions text"),_setAriaAtomic(t,!0),this.eGridDiv.appendChild(t)}announceValue(e){this.descriptionContainer&&(this.descriptionContainer.textContent="",setTimeout(()=>{this.isAlive()&&this.descriptionContainer&&(this.descriptionContainer.textContent=e)},50))}destroy(){super.destroy();const{descriptionContainer:e}=this;e&&(_clearElement(e),e.parentElement&&e.parentElement.removeChild(e)),this.descriptionContainer=null,this.eGridDiv=null}},ColumnAnimationService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnAnimationService",this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.suppressAnimation=!1,this.animationThreadCount=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.ctrlsService.whenReady(e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active&&!this.suppressAnimation}setSuppressAnimation(e){this.suppressAnimation=e}start(){this.active||this.gos.get("suppressColumnMoveAnimation")||this.gos.get("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&this.flush(()=>{this.active=!1})}executeNextVMTurn(e){this.active?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(e){if(this.executeNextFuncs.length===0&&this.executeLaterFuncs.length===0){e();return}const t=i=>{for(;i.length;){const s=i.pop();s&&s()}};this.getFrameworkOverrides().wrapIncoming(()=>{window.setTimeout(()=>t(this.executeNextFuncs),0),window.setTimeout(()=>{e(),t(this.executeLaterFuncs)},200)})}},ColumnHoverService=class extends BeanStub{constructor(){super(...arguments),this.beanName="columnHoverService"}setMouseOver(e){this.selectedColumns=e;const t={type:"columnHoverChanged"};this.eventService.dispatchEvent(t)}clearMouseOver(){this.selectedColumns=null;const e={type:"columnHoverChanged"};this.eventService.dispatchEvent(e)}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}},OverlayService=class extends BeanStub{constructor(){super(...arguments),this.beanName="overlayService",this.state=0,this.showInitialOverlay=!0}wireBeans(e){this.userComponentFactory=e.userComponentFactory,this.rowModel=e.rowModel,this.columnModel=e.columnModel}postConstruct(){const e=()=>this.updateOverlayVisibility();this.addManagedEventListeners({newColumnsLoaded:e,rowDataUpdated:e}),this.addManagedPropertyListener("loading",e)}registerOverlayWrapperComp(e){this.overlayWrapperComp=e,this.updateOverlayVisibility()}showLoadingOverlay(){this.showInitialOverlay=!1;const e=this.gos.get("loading");!e&&(e!==void 0||this.gos.get("suppressLoadingOverlay"))||this.doShowLoadingOverlay()}showNoRowsOverlay(){this.showInitialOverlay=!1,!(this.gos.get("loading")||this.gos.get("suppressNoRowsOverlay"))&&this.doShowNoRowsOverlay()}hideOverlay(){this.showInitialOverlay=!1,!this.gos.get("loading")&&this.doHideOverlay()}updateOverlayVisibility(){let e=this.gos.get("loading");this.showInitialOverlay&&e===void 0&&!this.gos.get("suppressLoadingOverlay")&&(e=!this.gos.get("columnDefs")||!this.columnModel.isReady()||!this.gos.get("rowData")&&this.gos.isRowModelType("clientSide")),e?this.state!==1&&this.doShowLoadingOverlay():(this.showInitialOverlay=!1,this.rowModel.isEmpty()&&!this.gos.get("suppressNoRowsOverlay")&&this.gos.isRowModelType("clientSide")?this.state!==2&&this.doShowNoRowsOverlay():this.state!==0&&this.doHideOverlay())}doShowLoadingOverlay(){this.state=1,this.showOverlay(this.userComponentFactory.getLoadingOverlayCompDetails({}),"ag-overlay-loading-wrapper","loadingOverlayComponentParams")}doShowNoRowsOverlay(){this.state=2,this.showOverlay(this.userComponentFactory.getNoRowsOverlayCompDetails({}),"ag-overlay-no-rows-wrapper","noRowsOverlayComponentParams")}doHideOverlay(){this.state=0,this.overlayWrapperComp.hideOverlay()}showOverlay(e,t,i){const s=e.newAgStackInstance();this.overlayWrapperComp.showOverlay(s,t,i)}},RowCssClassCalculator=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowCssClassCalculator"}wireBeans(e){this.stylingService=e.stylingService}getInitialRowClasses(e){const t=[];return _exists(e.extraCssClass)&&t.push(e.extraCssClass),t.push("ag-row"),t.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&t.push("ag-opacity-zero"),t.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&t.push("ag-row-pinned"),e.rowNode.isSelected()&&t.push("ag-row-selected"),e.rowNode.footer&&t.push("ag-row-footer"),t.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&t.push("ag-row-loading"),e.fullWidthRow&&t.push("ag-full-width-row"),e.expandable&&(t.push("ag-row-group"),t.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&t.push("ag-row-dragging"),_pushAll(t,this.processClassesFromGridOptions(e.rowNode)),_pushAll(t,this.preProcessRowClassRules(e.rowNode)),t.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&t.push("ag-row-first"),e.lastRowOnPage&&t.push("ag-row-last"),e.fullWidthRow&&(e.pinned==="left"&&t.push("ag-cell-last-left-pinned"),e.pinned==="right"&&t.push("ag-cell-first-right-pinned")),t}processClassesFromGridOptions(e){const t=[],i=r=>{typeof r=="string"?t.push(r):Array.isArray(r)&&r.forEach(n=>t.push(n))},s=this.gos.get("rowClass");if(s){if(typeof s=="function")return _warnOnce("rowClass should not be a function, please use getRowClass instead"),[];i(s)}const o=this.gos.getCallback("getRowClass");if(o){const r={data:e.data,node:e,rowIndex:e.rowIndex},n=o(r);i(n)}return t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,i=>{t.push(i)},()=>{}),t}processRowClassRules(e,t,i){const s=this.gos.addGridCommonParams({data:e.data,node:e,rowIndex:e.rowIndex});this.stylingService.processClassRules(void 0,this.gos.get("rowClassRules"),s,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}},RowContainerHeightService=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowContainerHeightService",this.scrollY=0,this.uiBodyHeight=0}wireBeans(e){this.ctrlsService=e.ctrlsService}postConstruct(){this.addManagedEventListeners({bodyHeightChanged:this.updateOffset.bind(this)}),this.maxDivHeight=_getMaxDivHeight(),this.gos.get("debug")&&_log("RowContainerHeightService - maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,i=this.getUiBodyHeight();(t!==this.scrollY||i!==this.uiBodyHeight)&&(this.scrollY=t,this.uiBodyHeight=i,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.gos.get("debug")&&_log(`RowContainerHeightService - Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:"rowContainerHeightChanged"}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t=typeof e=="number"?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:"heightScaleChanged"}))}setModelHeight(e){this.modelHeight=e,this.stretching=e!=null&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return t.bottom-t.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=this.modelHeight-this.getUiBodyHeight(),i=e/t;return this.maxScrollY*i}},RowNodeSorter=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowNodeSorter"}wireBeans(e){this.valueService=e.valueService,this.columnModel=e.columnModel,this.showRowGroupColsService=e.showRowGroupColsService}postConstruct(){this.isAccentedSort=this.gos.get("accentedSort"),this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",e=>this.isAccentedSort=e.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=this.gos.isColumnsSortingCoupledToGroup())}doFullSort(e,t){const i=(o,r)=>({currentPos:r,rowNode:o}),s=e.map(i);return s.sort(this.compareRowNodes.bind(this,t)),s.map(o=>o.rowNode)}compareRowNodes(e,t,i){const s=t.rowNode,o=i.rowNode;for(let r=0,n=e.length;r<n;r++){const l=e[r],a=l.sort==="desc",d=this.getValue(s,l.column),h=this.getValue(o,l.column);let c;const u=this.getComparator(l,s);if(u?c=u(d,h,s,o,a):c=_defaultComparator(d,h,this.isAccentedSort),!isNaN(c)&&c!==0)return l.sort==="asc"?c:c*-1}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,s=i.getColDef().comparator;if(s!=null)return s;if(!i.getColDef().showRowGroup)return;const o=!t.group&&i.getColDef().field;if(!o)return;const r=this.columnModel.getColDefCol(o);if(r)return r.getColDef().comparator}getValue(e,t){if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(this.gos.isGroupUseEntireRow(this.columnModel.isPivotActive())){const r=e.allLeafChildren?.[0];return r?this.valueService.getValue(t,r,!1,!1):void 0}const o=this.showRowGroupColsService?.getShowRowGroupCol(t.getId());return o?e.groupData?.[o.getId()]:void 0}if(!(e.group&&t.getColDef().showRowGroup))return this.valueService.getValue(t,e,!1,!1)}},ChangedPath=class{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let s=0;s<e.childrenAfterGroup.length;s++){const o=e.childrenAfterGroup[s];o.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[s],t,i):i&&t(o)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];){const s={rowNode:t,children:null};this.mapToItems[t.id]=s,i++,t=t.parent}return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach(s=>this.nodeIdsToColumns[i.id][s.getId()]=!0),i=i.parent}linkPathItems(e,t){let i=e;for(let s=0;s<t;s++){const o=this.mapToItems[i.id],r=this.mapToItems[i.parent.id];r.children||(r.children=[]),r.children.push(o),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter(o=>i[o.getId()])}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter(o=>!i[o.getId()])}},SelectionService=class extends BeanStub{constructor(){super(...arguments),this.beanName="selectionService",this.selectedNodes=new Map,this.selectionCtx=new RowRangeSelectionContext}wireBeans(e){this.rowModel=e.rowModel,this.pageBoundsService=e.pageBoundsService}postConstruct(){this.selectionCtx.init(this.rowModel),this.rowSelection=this.gos.get("rowSelection"),this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.addManagedPropertyListeners(["groupSelectsChildren","rowSelection"],()=>{this.groupSelectsChildren=this.gos.get("groupSelectsChildren"),this.rowSelection=this.gos.get("rowSelection"),this.deselectAllRowNodes({source:"api"})}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes(),this.selectionCtx.reset()}isMultiselect(){return this.rowSelection==="multiple"}overrideSelectionValue(e,t){if(!isSelectionUIEvent(t))return e;const i=this.selectionCtx.getRoot();return i?i.isSelected()??!1:!0}setNodesSelected(e){const{newValue:t,clearSelection:i,suppressFinishActions:s,rangeSelect:o,nodes:r,event:n,source:l}=e;if(r.length===0)return 0;if(r.length>1&&!this.isMultiselect())return _warnOnce("cannot multi select while rowSelection='single'"),0;const a=this.groupSelectsChildren&&e.groupSelectsFiltered===!0,d=r.map(c=>c.footer?c.sibling:c);if(o){if(d.length>1)return _warnOnce("cannot range select while selecting multiple rows"),0;const c=d[0],u=this.overrideSelectionValue(t,l);if(this.isMultiselect()){if(this.selectionCtx.isInRange(c)){const g=this.selectionCtx.truncate(c);return u&&this.selectRange(g.discard,!1,l),this.selectRange(g.keep,u,l)}else if(this.selectionCtx.getRoot()!==c){const f=this.selectionCtx.extend(c,this.groupSelectsChildren);return u&&this.selectRange(f.discard,!1,l),this.selectRange(f.keep,u,l)}}}s||this.selectionCtx.setRoot(d[0]);let h=0;for(let c=0;c<d.length;c++){const u=d[c];a&&u.group||u.selectThisNode(t,n,l)&&h++,this.groupSelectsChildren&&u.childrenAfterGroup?.length&&(h+=this.selectChildren(u,t,a,l))}return s||(t&&(i||!this.isMultiselect())&&(h+=this.clearOtherNodes(d[0],l)),h>0&&(this.updateGroupsFromChildrenSelections(l),this.dispatchSelectionChanged(l))),h}selectRange(e,t,i){let s=0;return e.forEach(o=>{if(o.group&&this.groupSelectsChildren)return;o.selectThisNode(t,void 0,i)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(i),this.dispatchSelectionChanged(i)),s}selectChildren(e,t,i,s){const o=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return _missing(o)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:s,nodes:o})}getSelectedNodes(){const e=[];return this.selectedNodes.forEach(t=>{t&&e.push(t)}),e}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>{t&&t.data&&e.push(t.data)}),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((i,s)=>{i&&e(i)&&t.set(s,i)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren||this.rowModel.getType()!=="clientSide")return!1;const s=this.rowModel.getRootNode();t||(t=new ChangedPath(!0,s),t.setInactive());let o=!1;return t.forEachChangedNodeDepthFirst(r=>{if(r!==s){const n=r.calculateSelectedFromChildren();o=r.selectThisNode(n===null?!1:n,void 0,e)||o}}),o}clearOtherNodes(e,t){const i=new Map;let s=0;return this.selectedNodes.forEach(o=>{if(o&&o.id!==e.id){const r=this.selectedNodes.get(o.id);s+=r.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&o.parent&&i.set(o.parent.id,o.parent)}}),i.forEach(o=>{const r=o.calculateSelectedFromChildren();o.selectThisNode(r===null?!1:r,void 0,t)}),s}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,t){if(_exists(t)&&e.id!==t.id&&t){const s=t.id;this.selectedNodes.get(s)==e&&this.selectedNodes.set(t.id,t)}}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.setSelectedInitialValue(!0),this.selectedNodes.set(e.id,e)):e.setSelectedInitialValue(!1)}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes?.clear()}getBestCostNodeSelection(){if(this.rowModel.getType()!=="clientSide")return;const t=this.rowModel.getTopLevelNodes();if(t===null)return;const i=[];function s(o){for(let r=0,n=o.length;r<n;r++){const l=o[r];if(l.isSelected())i.push(l);else{const a=l;a.group&&a.children&&s(a.children)}}}return s(t),i}isEmpty(){let e=0;return this.selectedNodes.forEach(t=>{t&&e++}),e===0}deselectAllRowNodes(e){const t=n=>n.selectThisNode(!1,void 0,s),i=this.rowModel.getType()==="clientSide",{source:s,justFiltered:o,justCurrentPage:r}=e;if(r||o){if(!i){_errorOnce("selecting just filtered only works when gridOptions.rowModelType='clientSide'");return}this.getNodesToSelect(o,r).forEach(t)}else this.selectedNodes.forEach(n=>{n&&t(n)}),this.reset(s);this.selectionCtx.reset(),i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(s),this.dispatchSelectionChanged(s)}getSelectedCounts(e,t){let i=0,s=0;const o=r=>{this.groupSelectsChildren&&r.group||(r.isSelected()?i++:r.selectable&&s++)};return this.getNodesToSelect(e,t).forEach(o),{selectedCount:i,notSelectedCount:s}}getSelectAllState(e,t){const{selectedCount:i,notSelectedCount:s}=this.getSelectedCounts(e,t);return i===0&&s===0?!1:i>0&&s>0?null:i>0}hasNodesToSelect(e=!1,t=!1){return this.getNodesToSelect(e,t).filter(i=>i.selectable).length>0}getNodesToSelect(e=!1,t=!1){if(this.rowModel.getType()!=="clientSide")throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const i=[];if(t)return this.forEachNodeOnPage(o=>{if(!o.group){i.push(o);return}if(!o.expanded){const r=n=>{i.push(n),n.childrenAfterFilter?.length&&n.childrenAfterFilter.forEach(r)};r(o);return}this.groupSelectsChildren||i.push(o)}),i;const s=this.rowModel;return e?(s.forEachNodeAfterFilter(o=>{i.push(o)}),i):(s.forEachNode(o=>{i.push(o)}),i)}forEachNodeOnPage(e){const t=this.pageBoundsService.getFirstRow(),i=this.pageBoundsService.getLastRow();for(let s=t;s<=i;s++){const o=this.rowModel.getRow(s);o&&e(o)}}selectAllRowNodes(e){if(this.rowModel.getType()!=="clientSide")throw new Error(`selectAll only available when rowModelType='clientSide', ie not ${this.rowModel.getType()}`);const{source:t,justFiltered:i,justCurrentPage:s}=e,o=this.getNodesToSelect(i,s);o.forEach(r=>r.selectThisNode(!0,void 0,t)),this.selectionCtx.setRoot(o[0]??null),this.selectionCtx.setEndRange(_last(o)??null),this.rowModel.getType()==="clientSide"&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t),this.dispatchSelectionChanged(t)}getSelectionState(){const e=[];return this.selectedNodes.forEach(t=>{t?.id&&e.push(t.id)}),e.length?e:null}setSelectionState(e,t){if(!Array.isArray(e))return;const i=new Set(e),s=[];this.rowModel.forEachNode(o=>{i.has(o.id)&&s.push(o)}),this.setNodesSelected({newValue:!0,nodes:s,source:t})}dispatchSelectionChanged(e){const t={type:"selectionChanged",source:e};this.eventService.dispatchEvent(t)}},SelectableService=class extends BeanStub{constructor(){super(...arguments),this.beanName="selectableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){this.addManagedPropertyListener("isRowSelectable",()=>this.updateSelectable())}updateSelectableAfterGrouping(){this.updateSelectable(!0)}updateSelectable(e=!1){const t=!!this.gos.get("rowSelection"),i=this.gos.get("isRowSelectable");if(!t||!i)return;const s=this.gos.get("groupSelectsChildren"),o=this.rowModel.getType()==="clientSide"&&s,r=[],n=l=>{if(e&&!l.group)return;if(o&&l.group){const d=l.childrenAfterGroup.some(h=>h.selectable===!0);l.setRowSelectable(d,!0);return}const a=i?i(l):!0;l.setRowSelectable(a,!0),!a&&l.isSelected()&&r.push(l)};if(o){const l=this.rowModel;new ChangedPath(!1,l.getRootNode()).forEachChangedNodeDepthFirst(n,!0,!0)}else this.rowModel.forEachNode(n);r.length&&this.selectionService.setNodesSelected({nodes:r,newValue:!1,source:"selectableChanged"}),o&&this.selectionService instanceof SelectionService&&this.selectionService.updateGroupsFromChildrenSelections("selectableChanged")}},DEFAULT_SORTING_ORDER=["asc","desc",null],SortController=class extends BeanStub{constructor(){super(...arguments),this.beanName="sortController"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.showRowGroupColsService=e.showRowGroupColsService}progressSort(e,t,i){const s=this.getNextSortDirection(e);this.setSortForColumn(e,s,t,i)}setSortForColumn(e,t,i,s){t!=="asc"&&t!=="desc"&&(t=null);const o=this.gos.isColumnsSortingCoupledToGroup();let r=[e];if(o&&e.getColDef().showRowGroup){const d=this.funcColsService.getSourceColumnsForGroupColumn(e)?.filter(h=>h.isSortable());d&&(r=[e,...d])}r.forEach(a=>a.setSort(t,s));const n=(i||this.gos.get("alwaysMultiSort"))&&!this.gos.get("suppressMultiSort"),l=[];if(!n){const a=this.clearSortBarTheseColumns(r,s);l.push(...a)}this.updateSortIndex(e),l.push(...r),this.dispatchSortChangedEvents(s,l)}updateSortIndex(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=this.showRowGroupColsService?.getShowRowGroupCol(e.getId()),s=t&&i||e,o=this.getColumnsWithSortingOrdered();this.columnModel.getAllCols().forEach(l=>l.setSortIndex(null));const r=o.filter(l=>t&&l.getColDef().showRowGroup?!1:l!==s);(s.getSort()?[...r,s]:r).forEach((l,a)=>{l.setSortIndex(a)})}onSortChanged(e,t){this.dispatchSortChangedEvents(e,t)}isSortActive(){const t=this.columnModel.getAllCols().filter(i=>!!i.getSort());return t&&t.length>0}dispatchSortChangedEvents(e,t){const i={type:"sortChanged",source:e};t&&(i.columns=t),this.eventService.dispatchEvent(i)}clearSortBarTheseColumns(e,t){const i=[];return this.columnModel.getAllCols().forEach(s=>{e.includes(s)||(s.getSort()&&i.push(s),s.setSort(void 0,t))}),i}getNextSortDirection(e){let t;if(e.getColDef().sortingOrder?t=e.getColDef().sortingOrder:this.gos.get("sortingOrder")?t=this.gos.get("sortingOrder"):t=DEFAULT_SORTING_ORDER,!Array.isArray(t)||t.length<=0)return _warnOnce(`sortingOrder must be an array with at least one element, currently it's ${t}`),null;const i=t.indexOf(e.getSort()),s=i<0,o=i==t.length-1;let r;return s||o?r=t[0]:r=t[i+1],DEFAULT_SORTING_ORDER.indexOf(r)<0?(_warnOnce("invalid sort type ",r),null):r}getIndexedSortMap(){let e=this.columnModel.getAllCols().filter(r=>!!r.getSort());if(this.columnModel.isPivotMode()){const r=this.gos.isColumnsSortingCoupledToGroup();e=e.filter(n=>{const l=!!n.getAggFunc(),a=!n.isPrimary(),d=r?this.showRowGroupColsService?.getShowRowGroupCol(n.getId()):n.getColDef().showRowGroup;return l||a||d})}const t=this.funcColsService.getRowGroupColumns().filter(r=>!!r.getSort()),i={};e.forEach((r,n)=>i[r.getId()]=n),e.sort((r,n)=>{const l=r.getSortIndex(),a=n.getSortIndex();if(l!=null&&a!=null)return l-a;if(l==null&&a==null){const d=i[r.getId()],h=i[n.getId()];return d>h?1:-1}else return a==null?-1:1});const s=this.gos.isColumnsSortingCoupledToGroup()&&!!t.length;s&&(e=[...new Set(e.map(r=>this.showRowGroupColsService?.getShowRowGroupCol(r.getId())??r))]);const o=new Map;return e.forEach((r,n)=>o.set(r,n)),s&&t.forEach(r=>{const n=this.showRowGroupColsService.getShowRowGroupCol(r.getId());o.set(r,o.get(n))}),o}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([e,t],[i,s])=>t-s).map(([e])=>e)}getSortModel(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),colId:e.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),column:e}))}canColumnDisplayMixedSort(e){const t=this.gos.isColumnsSortingCoupledToGroup(),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.funcColsService.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!t?.length)return e.getSort();const s=e.getColDef().field!=null||!!e.getColDef().valueGetter?[e,...t]:t,o=s[0].getSort();return s.every(n=>n.getSort()==o)?o:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}},SyncService=class extends BeanStub{constructor(){super(...arguments),this.beanName="syncService",this.waitingForColumns=!1}wireBeans(e){this.ctrlsService=e.ctrlsService,this.columnModel=e.columnModel,this.rowModel=e.rowModel}postConstruct(){this.addManagedPropertyListener("columnDefs",e=>this.setColumnDefs(e))}start(){this.ctrlsService.whenReady(()=>{const e=this.gos.get("columnDefs");e?this.setColumnsAndData(e):this.waitingForColumns=!0,this.gridReady()})}setColumnsAndData(e){this.columnModel.setColumnDefs(e??[],"gridInitializing"),this.rowModel.start()}gridReady(){this.dispatchGridReadyEvent();const e=ModuleRegistry.__isRegistered("@ag-grid-enterprise/core",this.gridId);this.gos.get("debug")&&_log(`initialised successfully, enterprise = ${e}`)}dispatchGridReadyEvent(){const e={type:"gridReady"};this.eventService.dispatchEvent(e)}setColumnDefs(e){const t=this.gos.get("columnDefs");if(t){if(this.waitingForColumns){this.waitingForColumns=!1,this.setColumnsAndData(t);return}this.columnModel.setColumnDefs(t,convertSourceType(e.source))}}},SOURCE_PASTE="paste",ChangeDetectionService=class extends BeanStub{constructor(){super(...arguments),this.beanName="changeDetectionService"}wireBeans(e){this.rowModel=e.rowModel,this.rowRenderer=e.rowRenderer}postConstruct(){this.rowModel.getType()==="clientSide"&&(this.clientSideRowModel=this.rowModel),this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this)})}onCellValueChanged(e){e.source!==SOURCE_PASTE&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gos.get("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const s=this.gos.get("aggregateOnlyChangedColumns"),o=new ChangedPath(s,this.clientSideRowModel.getRootNode());o.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(o),o.forEachChangedNodeDepthFirst(r=>{i.push(r)})}this.rowRenderer.refreshCells({rowNodes:i})}},ExpressionService=class extends BeanStub{constructor(){super(...arguments),this.beanName="expressionService",this.expressionToFunctionCache={}}evaluate(e,t){if(typeof e=="string")return this.evaluateExpression(e,t);_errorOnce("value should be either a string or a function",e)}evaluateExpression(e,t){try{return this.createExpressionFunction(e)(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.getValue,t.column,t.columnGroup)}catch(i){return _log("Processing of the expression failed"),_log("Expression = ",e),_log("Params = ",t),_log("Exception = ",i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}},ValueCache=class extends BeanStub{constructor(){super(...arguments),this.beanName="valueCache",this.cacheVersion=0}postConstruct(){this.active=this.gos.get("valueCache"),this.neverExpires=this.gos.get("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(!(!this.active||e.__cacheVersion!==this.cacheVersion))return e.__cacheData[t]}},ValueService=class extends BeanStub{constructor(){super(...arguments),this.beanName="valueService",this.initialised=!1,this.isSsrm=!1}wireBeans(e){this.expressionService=e.expressionService,this.columnModel=e.columnModel,this.valueCache=e.valueCache,this.dataTypeService=e.dataTypeService}postConstruct(){this.initialised||this.init()}init(){this.isSsrm=this.gos.isRowModelType("serverSide"),this.cellExpressions=this.gos.get("enableCellExpressions"),this.isTreeData=this.gos.get("treeData"),this.initialised=!0;const e=i=>this.callColumnCellValueChangedHandler(i),t=this.gos.useAsyncEvents();this.eventService.addEventListener("cellValueChanged",e,t),this.addDestroyFunc(()=>this.eventService.removeEventListener("cellValueChanged",e,t)),this.addManagedPropertyListener("treeData",i=>this.isTreeData=i.currentValue)}getValue(e,t,i=!1,s=!1){if(this.initialised||this.init(),!t)return;const o=e.getColDef(),r=o.field,n=e.getColId(),l=t.data;let a;const d=t.groupData&&t.groupData[n]!==void 0,h=!s&&t.aggData&&t.aggData[n]!==void 0,c=this.isSsrm&&s&&!!e.getColDef().aggFunc,u=this.isSsrm&&t.footer&&t.field&&(e.getColDef().showRowGroup===!0||e.getColDef().showRowGroup===t.field);if(i&&o.filterValueGetter?a=this.executeFilterValueGetter(o.filterValueGetter,l,e,t):this.isTreeData&&h?a=t.aggData[n]:this.isTreeData&&o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,e,t):this.isTreeData&&r&&l?a=_getValueUsingField(l,r,e.isFieldContainsDots()):d?a=t.groupData[n]:h?a=t.aggData[n]:o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,e,t):u?a=_getValueUsingField(l,t.field,e.isFieldContainsDots()):r&&l&&!c&&(a=_getValueUsingField(l,r,e.isFieldContainsDots())),this.cellExpressions&&typeof a=="string"&&a.indexOf("=")===0){const g=a.substring(1);a=this.executeValueGetter(g,l,e,t)}if(a==null){const g=this.getOpenedGroup(t,e);if(g!=null)return g}return a}parseValue(e,t,i,s){const o=e.getColDef(),r=this.gos.addGridCommonParams({node:t,data:t?.data,oldValue:s,newValue:i,colDef:o,column:e}),n=o.valueParser;return _exists(n)?typeof n=="function"?n(r):this.expressionService.evaluate(n,r):i}formatValue(e,t,i,s,o=!0){let r=null,n;const l=e.getColDef();if(s?n=s:o&&(n=l.valueFormatter),n){const a=this.gos.addGridCommonParams({value:i,node:t,data:t?t.data:null,colDef:l,column:e});typeof n=="function"?r=n(a):r=this.expressionService.evaluate(n,a)}else if(l.refData)return l.refData[i]||"";return r==null&&Array.isArray(i)&&(r=i.join(", ")),r}getOpenedGroup(e,t){if(!this.gos.get("showOpenedGroup")||!t.getColDef().showRowGroup)return;const s=t.getColDef().showRowGroup;let o=e.parent;for(;o!=null;){if(o.rowGroupColumn&&(s===!0||s===o.rowGroupColumn.getColId()))return o.key;o=o.parent}}setValue(e,t,i,s){const o=this.columnModel.getColDefCol(t);if(!e||!o)return!1;_missing(e.data)&&(e.data={});const{field:r,valueSetter:n}=o.getColDef();if(_missing(r)&&_missing(n))return _warnOnce("you need either field or valueSetter set on colDef for editing to work"),!1;if(this.dataTypeService&&!this.dataTypeService.checkType(o,i))return _warnOnce("Data type of the new value does not match the cell data type of the column"),!1;const l=this.gos.addGridCommonParams({node:e,data:e.data,oldValue:this.getValue(o,e),newValue:i,colDef:o.getColDef(),column:o});l.newValue=i;let a;if(_exists(n)?typeof n=="function"?a=n(l):a=this.expressionService.evaluate(n,l):a=this.setValueUsingField(e.data,r,i,o.isFieldContainsDots()),a===void 0&&(a=!0),!a)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),l.newValue=this.getValue(o,e);const d={type:"cellValueChanged",event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:l.column,api:l.api,colDef:l.colDef,context:l.context,data:e.data,node:e,oldValue:l.oldValue,newValue:l.newValue,value:l.newValue,source:s};return this.eventService.dispatchEvent(d),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;typeof t=="function"&&this.getFrameworkOverrides().wrapOutgoing(()=>{t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,context:e.context})})}setValueUsingField(e,t,i,s){if(!t)return!1;let o=!1;if(!s)o=e[t]===i,o||(e[t]=i);else{const r=t.split(".");let n=e;for(;r.length>0&&n;){const l=r.shift();r.length===0?(o=n[l]===i,o||(n[l]=i)):n=n[l]}}return!o}executeFilterValueGetter(e,t,i,s){const o=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});return typeof e=="function"?e(o):this.expressionService.evaluate(e,o)}executeValueGetter(e,t,i,s){const o=i.getColId(),r=this.valueCache.getValue(s,o);if(r!==void 0)return r;const n=this.gos.addGridCommonParams({data:t,node:s,column:i,colDef:i.getColDef(),getValue:this.getValueCallback.bind(this,s)});let l;return typeof e=="function"?l=e(n):l=this.expressionService.evaluate(e,n),this.valueCache.setValue(s,o,l),l}getValueCallback(e,t){const i=this.columnModel.getColDefCol(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),s=e.getColDef().keyCreator;let o=i;if(s){const r=this.gos.addGridCommonParams({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data});o=s(r)}return typeof o=="string"||o==null||(o=String(o),o==="[object Object]"&&_warnOnce("a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")),o}},GlobalGridOptions=class{};GlobalGridOptions.gridOptions=void 0;function provideGlobalGridOptions(e){GlobalGridOptions.gridOptions=e}function createGrid(e,t,i){if(!t)return _errorOnce("No gridOptions provided to createGrid"),{};const s=new GridCoreCreator().create(e,t,o=>{const r=new GridComp(e);o.createBean(r)},void 0,i);if(!Object.isFrozen(t)&&!i?.frameworkOverrides){const o="https://ag-grid.com/javascript-data-grid/grid-interface/#grid-api";Object.defineProperty(t,"api",{get:()=>{_errorOnce(`gridOptions.api is no longer supported. See ${o}.`)},configurable:!0})}return s}var Grid=class{constructor(e,t,i){if(_warnOnce("Since v31 new Grid(...) is deprecated. Use createGrid instead: `const gridApi = createGrid(...)`. The grid api is returned from createGrid and will not be available on gridOptions."),!t){_errorOnce("No gridOptions provided to the grid");return}this.gridOptions=t;const s=new GridCoreCreator().create(e,t,o=>{const r=new GridComp(e);o.createBean(r).addDestroyFunc(()=>{this.destroy()})},void 0,i);this.gridOptions.api=s}destroy(){this.gridOptions&&(this.gridOptions.api?.destroy(),delete this.gridOptions.api)}},nextGridId=1,GridCoreCreator=class{create(e,t,i,s,o){let r={};GlobalGridOptions.gridOptions?(_mergeDeep(r,GlobalGridOptions.gridOptions,!0,!0),r={...r,...t}):r=t;const n=getCoercedGridOptions(r),l=n.gridId??String(nextGridId++),a=this.getRegisteredModules(o,l),d=this.createBeansList(n.rowModelType,a,l),h=this.createProvidedBeans(e,n,o);if(!d){_errorOnce("Failed to create grid.");return}const c={providedBeanInstances:h,beanClasses:d,gridId:l,beanInitComparator:gridBeanInitComparator,beanDestroyComparator:gridBeanDestroyComparator,derivedBeans:[createApiProxy]},u=new Context(c);return this.registerModuleUserComponents(u,a),this.registerControllers(u,a),this.registerModuleApiFunctions(u,a),i(u),u.getBean("syncService").start(),s&&s(u),u.getBean("gridApi")}registerControllers(e,t){const i=e.getBean("ctrlsFactory");t.forEach(s=>{s.controllers&&s.controllers.forEach(o=>i.register(o))})}getRegisteredModules(e,t){const i=e?e.modules:null,s=ModuleRegistry.__getRegisteredModules(t),o=[],r={},n=(l,a,d)=>{(c=>{r[c.moduleName]||(r[c.moduleName]=!0,o.push(c),ModuleRegistry.__register(c,l,d))})(a),a.dependantModules&&a.dependantModules.forEach(c=>n(l,c,d))};return n(!!i?.length||!ModuleRegistry.__isPackageBased(),CommunityFeaturesModule,void 0),i&&i.forEach(l=>n(!0,l,t)),s&&s.forEach(l=>n(!ModuleRegistry.__isPackageBased(),l,void 0)),o}registerModuleUserComponents(e,t){const i=this.extractModuleEntity(t,o=>o.userComponents?o.userComponents:[]),s=e.getBean("userComponentRegistry");i.forEach(o=>{s.registerDefaultComponent(o.name,o.classImp)})}registerModuleApiFunctions(e,t){const i=e.getBean("apiFunctionService");t.forEach(s=>{const o=s.apiFunctions??{};Object.keys(o).forEach(n=>{i?.addFunction(n,o[n])})})}createProvidedBeans(e,t,i){let s=i?i.frameworkOverrides:null;_missing(s)&&(s=new VanillaFrameworkOverrides);const o={gridOptions:t,eGridDiv:e,globalEventListener:i?i.globalEventListener:null,globalSyncEventListener:i?i.globalSyncEventListener:null,frameworkOverrides:s};return i&&i.providedBeanInstances&&Object.assign(o,i.providedBeanInstances),o}createBeansList(e="clientSide",t,i){const s=t.filter(a=>!a.rowModel||a.rowModel===e),o={clientSide:"@ag-grid-community/client-side-row-model",infinite:"@ag-grid-community/infinite-row-model",serverSide:"@ag-grid-enterprise/server-side-row-model",viewport:"@ag-grid-enterprise/viewport-row-model"};if(!o[e]){_errorOnce("Could not find row model for rowModelType = ",e);return}if(!ModuleRegistry.__assertRegistered(o[e],`rowModelType = '${e}'`,i))return;const r=[RowPositionUtils,CellPositionUtils,HeaderPositionUtils,GridDestroyService,ApiFunctionService,UserComponentRegistry,AgComponentUtils,ComponentMetadataProvider,ResizeObserverService,UserComponentFactory,RowContainerHeightService,HorizontalResizeService,LocaleService,PinnedRowModel,DragService,VisibleColsService,EventService,GridOptionsService,PopupService,SelectionService,ColumnModel,HeaderNavigationService,PageBoundsService,PageBoundsListener,RowRenderer,ExpressionService,ColumnFactory,NavigationService,ValueCache,ValueService,AutoWidthCalculator,StandardMenuFactory,DragAndDropService,FocusService,MouseEventService,Environment,CellNavigationService,StylingService,ScrollVisibleService,SortController,ColumnHoverService,ColumnAnimationService,SelectableService,ChangeDetectionService,AnimationFrameService,ColumnDefFactory,RowCssClassCalculator,RowNodeSorter,CtrlsService,PinnedWidthService,RowNodeEventThrottle,CtrlsFactory,SyncService,OverlayService,ExpansionService,ApiEventService,AriaAnnouncementService,MenuService,ColumnApplyStateService,ColumnEventDispatcher,ColumnMoveService,ColumnAutosizeService,ColumnGetStateService,ColumnGroupStateService,ColumnSizeService,FuncColsService,ColumnNameService,ColumnViewportService,PivotResultColsService],n=this.extractModuleEntity(s,a=>a.beans?a.beans:[]);r.push(...n);const l=[];return r.forEach(a=>{l.indexOf(a)<0&&l.push(a)}),l}extractModuleEntity(e,t){return[].concat(...e.map(t))}},RowModelHelperService=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowModelHelperService"}wireBeans(e){this.rowModel=e.rowModel}postConstruct(){const e=this.rowModel;switch(e.getType()){case"clientSide":this.clientSideRowModel=e;break;case"infinite":this.infiniteRowModel=e;break;case"serverSide":this.serverSideRowModel=e;break}}getClientSideRowModel(){return this.clientSideRowModel}getInfiniteRowModel(){return this.infiniteRowModel}getServerSideRowModel(){return this.serverSideRowModel}};function expandAll(e){e.expansionService.expandAll(!0)}function collapseAll(e){e.expansionService.expandAll(!1)}function onRowHeightChanged(e){const t=e.rowModelHelperService?.getClientSideRowModel(),i=e.rowModelHelperService?.getServerSideRowModel();t?t.onRowHeightChanged():i&&i.onRowHeightChanged()}function setRowCount(e,t,i){const s=e.rowModelHelperService?.getServerSideRowModel();if(s){if(e.funcColsService.isRowGroupEmpty()){s.setRowCount(t,i);return}_errorOnce("setRowCount cannot be used while using row grouping.");return}const o=e.rowModelHelperService?.getInfiniteRowModel();if(o){o.setRowCount(t,i);return}}function getCacheBlockState(e){return e.rowNodeBlockLoader?.getBlockState()??{}}var CsrmSsrmSharedApiModule={version:VERSION,moduleName:"@ag-grid-community/csrm-ssrm-shared-api",apiFunctions:{expandAll,collapseAll,onRowHeightChanged}},SsrmInfiniteSharedApiModule={version:VERSION,moduleName:"@ag-grid-community/ssrm-infinite-shared-api",apiFunctions:{setRowCount,getCacheBlockState}},BaseComponentWrapper=class{wrap(e,t,i=[],s){const o=this.createWrapper(e,s);return t.forEach(r=>{this.createMethod(o,r,!0)}),i.forEach(r=>{this.createMethod(o,r,!1)}),o}unwrap(e){return e}createMethod(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))}createMethodProxy(e,t,i){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(i&&_warnOnce("Framework component is missing the method "+t+"()"),null)}}};function _sortRowNodesByOrder(e,t){if(!e)return!1;const i=(n,l)=>{const a=t[n.id],d=t[l.id],h=a!==void 0,c=d!==void 0,u=h&&c,g=!h&&!c;return u?a-d:g?n.__objectId-l.__objectId:h?1:-1};let s,o,r=!1;for(let n=0;n<e.length-1;n++)if(s=e[n],o=e[n+1],i(s,o)>0){r=!0;break}return r?(e.sort(i),!0):!1}var ChartMappings=class{};ChartMappings.CHART_TYPE_TO_SERIES_TYPE={column:"bar",groupedColumn:"bar",stackedColumn:"bar",normalizedColumn:"bar",bar:"bar",groupedBar:"bar",stackedBar:"bar",normalizedBar:"bar",line:"line",scatter:"scatter",bubble:"bubble",pie:"pie",donut:"donut",doughnut:"donut",area:"area",stackedArea:"area",normalizedArea:"area",histogram:"histogram",radarLine:"radar-line",radarArea:"radar-area",nightingale:"nightingale",radialColumn:"radial-column",radialBar:"radial-bar",sunburst:"sunburst",rangeBar:"range-bar",rangeArea:"range-area",boxPlot:"box-plot",treemap:"treemap",heatmap:"heatmap",waterfall:"waterfall"},ChartMappings.COMBO_CHART_TYPES=["columnLineCombo","areaColumnCombo","customCombo"],ChartMappings.SERIES_GROUP_TYPES=["grouped","stacked","normalized"];var BarColumnLabelPlacement=(e=>(e.InsideBase="insideBase",e.InsideEnd="insideEnd",e.Center="center",e.OutsideEnd="outsideEnd",e))(BarColumnLabelPlacement||{}),globalObj=typeof global>"u"?{}:global;globalObj.HTMLElement=typeof HTMLElement>"u"?{}:HTMLElement,globalObj.HTMLButtonElement=typeof HTMLButtonElement>"u"?{}:HTMLButtonElement,globalObj.HTMLSelectElement=typeof HTMLSelectElement>"u"?{}:HTMLSelectElement,globalObj.HTMLInputElement=typeof HTMLInputElement>"u"?{}:HTMLInputElement,globalObj.Node=typeof Node>"u"?{}:Node,globalObj.MouseEvent=typeof MouseEvent>"u"?{}:MouseEvent;var ROOT_NODE_ID="ROOT_NODE_ID",TOP_LEVEL=0,ClientSideNodeManager=class{constructor(e,t,i,s,o,r){this.nextId=0,this.rowCountReady=!1,this.allNodesMap={},this.rootNode=e,this.gos=t,this.eventService=i,this.funcColsService=s,this.beans=r,this.selectionService=o,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[]}getCopyOfNodesMap(){return _cloneObject(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(e){if(typeof e=="string"){_warnOnce("rowData must be an array.");return}this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e);const t=this.rootNode,i=this.rootNode.sibling;t.childrenAfterFilter=null,t.childrenAfterGroup=null,t.childrenAfterAggFilter=null,t.childrenAfterSort=null,t.childrenMapped=null,t.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?t.allLeafChildren=e.map(s=>this.createNode(s,this.rootNode,TOP_LEVEL)):(t.allLeafChildren=[],t.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=t.childrenAfterFilter,i.childrenAfterGroup=t.childrenAfterGroup,i.childrenAfterAggFilter=t.childrenAfterAggFilter,i.childrenAfterSort=t.childrenAfterSort,i.childrenMapped=t.childrenMapped,i.allLeafChildren=t.allLeafChildren)}updateRowData(e,t){this.rowCountReady=!0,this.dispatchRowDataUpdateStartedEvent(e.add);const i={remove:[],update:[],add:[]},s=[];return this.executeRemove(e,i,s),this.executeUpdate(e,i,s),this.executeAdd(e,i),this.updateSelection(s,"rowDataChanged"),t&&_sortRowNodesByOrder(this.rootNode.allLeafChildren,t),i}isRowCountReady(){return this.rowCountReady}dispatchRowDataUpdateStartedEvent(e){const t={type:"rowDataUpdateStarted",firstRowData:e?.length?e[0]:null};this.eventService.dispatchEvent(t)}updateSelection(e,t){const i=e.length>0;if(i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),i){const s={type:"selectionChanged",source:t};this.eventService.dispatchEvent(s)}}executeAdd(e,t){const{add:i,addIndex:s}=e;if(_missingOrEmpty(i))return;const o=i.map(n=>this.createNode(n,this.rootNode,TOP_LEVEL)),r=this.rootNode.allLeafChildren;if(typeof s=="number"&&s>=0){const n=r.length;let l=s;if(this.gos.get("treeData")&&s>0&&n>0){for(let c=0;c<n;c++)if(r[c]?.rowIndex==s-1){l=c+1;break}}const d=r.slice(0,l),h=r.slice(l,r.length);this.rootNode.allLeafChildren=[...d,...o,...h]}else this.rootNode.allLeafChildren=[...r,...o];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=r),t.add=o}executeRemove(e,t,i){const{remove:s}=e;if(_missingOrEmpty(s))return;const o={};s.forEach(r=>{const n=this.lookupRowNode(r);n&&(n.isSelected()&&i.push(n),n.clearRowTopAndRowIndex(),o[n.id]=!0,delete this.allNodesMap[n.id],t.remove.push(n))}),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren?.filter(r=>!o[r.id])??null,this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(e,t,i){const{update:s}=e;_missingOrEmpty(s)||s.forEach(o=>{const r=this.lookupRowNode(o);r&&(r.updateData(o),!r.selectable&&r.isSelected()&&i.push(r),this.setMasterForRow(r,o,TOP_LEVEL,!1),t.update.push(r))})}lookupRowNode(e){const t=this.gos.getRowIdCallback();let i;if(t){const s=t({data:e,level:0});if(i=this.allNodesMap[s],!i)return _errorOnce(`could not find row id=${s}, data item was not found for this id`),null}else if(i=this.rootNode.allLeafChildren?.find(s=>s.data===e),!i)return _errorOnce("could not find data item as object was not found",e),_errorOnce("Consider using getRowId to help the Grid find matching row data"),null;return i||null}createNode(e,t,i){const s=new RowNode(this.beans);return s.group=!1,this.setMasterForRow(s,e,i,!0),t&&(s.parent=t),s.level=i,s.setDataAndId(e,this.nextId.toString()),this.allNodesMap[s.id]&&_warnOnce(`duplicate node id '${s.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[s.id]=s,this.nextId++,s}setMasterForRow(e,t,i,s){if(this.gos.get("treeData"))e.setMaster(!1),s&&(e.expanded=!1);else{if(this.gos.get("masterDetail")){const n=this.gos.get("isRowMaster");n?e.setMaster(n(t)):e.setMaster(!0)}else e.setMaster(!1);if(s){const n=this.funcColsService.getRowGroupColumns(),l=n?n.length:0,a=i+l;e.expanded=e.master?this.isExpanded(a):!1}}}isExpanded(e){const t=this.gos.get("groupDefaultExpanded");return t===-1?!0:e<t}},ClientSideRowModel=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowModel",this.onRowHeightChanged_debounced=_debounce(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[],this.hasStarted=!1,this.shouldSkipSettingDataOnStart=!1,this.isRefreshingModel=!1,this.rowCountReady=!1}wireBeans(e){this.beans=e,this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.selectionService=e.selectionService,this.valueCache=e.valueCache,this.environment=e.environment,this.filterStage=e.filterStage,this.sortStage=e.sortStage,this.flattenStage=e.flattenStage,this.groupStage=e.groupStage,this.aggregationStage=e.aggregationStage,this.pivotStage=e.pivotStage,this.filterAggregatesStage=e.filterAggregatesStage}postConstruct(){const e=this.refreshModel.bind(this,{step:"group"}),t=!this.gos.get("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedEventListeners({newColumnsLoaded:i,columnRowGroupChanged:e,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:e,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this)}),this.addPropertyListeners(),this.rootNode=new RowNode(this.beans),this.nodeManager=new ClientSideNodeManager(this.rootNode,this.gos,this.eventService,this.funcColsService,this.selectionService,this.beans)}addPropertyListeners(){const e=new Set(["treeData","masterDetail"]),t=new Set(["groupDefaultExpanded","groupAllowUnbalanced","initialGroupOrderComparator","groupHideOpenParents","groupDisplayType"]),i=new Set(["excludeChildrenWhenTreeDataFiltering"]),s=new Set(["removePivotHeaderRowWhenSingleValueColumn","pivotRowTotals","pivotColumnGroupTotals","suppressExpandablePivotGroups"]),o=new Set(["getGroupRowAgg","alwaysAggregateAtRootLevel","groupIncludeTotalFooter","suppressAggFilteredOnly","grandTotalRow"]),r=new Set(["postSortRows","groupDisplayType","accentedSort"]),n=new Set([]),l=new Set(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter","groupTotalRow"]),a=[...e,...t,...i,...s,...s,...o,...r,...n,...l];this.addManagedPropertyListeners(a,d=>{const h=d.changeSet?.properties;if(!h)return;const c=u=>h.some(g=>u.has(g));if(c(e)){this.setRowData(this.rootNode.allLeafChildren.map(u=>u.data));return}if(c(t)){this.refreshModel({step:"group"});return}if(c(i)){this.refreshModel({step:"filter"});return}if(c(s)){this.refreshModel({step:"pivot"});return}if(c(o)){this.refreshModel({step:"aggregate"});return}if(c(r)){this.refreshModel({step:"sort"});return}if(c(n)){this.refreshModel({step:"filter_aggregates"});return}c(l)&&this.refreshModel({step:"map"})}),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.hasStarted=!0,this.shouldSkipSettingDataOnStart?this.dispatchUpdateEventsAndRefresh():this.setInitialData()}setInitialData(){const e=this.gos.get("rowData");e&&(this.shouldSkipSettingDataOnStart=!0,this.setRowData(e))}ensureRowHeightsValid(e,t,i,s){let o,r=!1;do{o=!1;const n=this.getRowIndexAtPixel(e),l=this.getRowIndexAtPixel(t),a=Math.max(n,i),d=Math.min(l,s);for(let h=a;h<=d;h++){const c=this.getRow(h);if(c.rowHeightEstimated){const u=this.gos.getRowHeightForNode(c);c.setRowHeight(u.height),o=!0,r=!0}}o&&this.setRowTopAndRowIndex()}while(o);return r}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,s=this.gos.isDomLayout("normal");for(let o=0;o<this.rowsToDisplay.length;o++){const r=this.rowsToDisplay[o];if(r.id!=null&&i.add(r.id),r.rowHeight==null){const n=this.gos.getRowHeightForNode(r,s,e);r.setRowHeight(n.height,n.estimated)}r.setRowTop(t),r.setRowIndex(o),t+=r.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),s=r=>{r&&r.id!=null&&!t.has(r.id)&&r.clearRowTopAndRowIndex()},o=r=>{if(s(r),s(r.detailNode),s(r.sibling),r.hasChildren()&&r.childrenAfterGroup){const n=r.level==-1;i&&!n&&!r.expanded||r.childrenAfterGroup.forEach(o)}};o(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const s=this.getRowIndexAtPixel(t),o=this.getRow(s),r=!this.gos.get("suppressAnimationFrame");return o===e[0]?!1:(e.forEach(n=>{_removeFromArray(this.rootNode.allLeafChildren,n)}),e.forEach((n,l)=>{_insertIntoArray(this.rootNode.allLeafChildren,n,Math.max(s+i,0)+l)}),this.refreshModel({step:"group",keepRenderedRows:!0,keepEditingRows:!0,animate:r}),!0)}highlightRowAtPixel(e,t){const i=t!=null?this.getRowIndexAtPixel(t):null,s=i!=null?this.getRow(i):null;if(!s||!e||s===e||t==null){this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null);return}const o=this.getHighlightPosition(t,s);this.lastHighlightedRow&&this.lastHighlightedRow!==s&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),s.setHighlighted(o),this.lastHighlightedRow=s}getHighlightPosition(e,t){if(!t){const o=this.getRowIndexAtPixel(e);if(t=this.getRow(o||0),!t)return 1}const{rowTop:i,rowHeight:s}=t;return e-i<s/2?0:1}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const t=this.rootNode.sibling?1:0,i=this.rootNode.childrenAfterAggFilter;return(i?i.length:0)+t}getTopLevelRowDisplayedIndex(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let i=e;if(this.rowsToDisplay[0].footer){if(e===0)return 0;i-=1}let s=this.rootNode.childrenAfterSort[i];if(this.gos.get("groupHideOpenParents"))for(;s.expanded&&s.childrenAfterSort&&s.childrenAfterSort.length>0;)s=s.childrenAfterSort[0];return s.rowIndex}getRowBounds(e){if(_missing(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=this.gos.isAnimateRows();this.refreshModel({step:"map",keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=this.gos.isAnimateRows(),s=e.columns.length===0||e.columns.some(o=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:s,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=this.gos.isAnimateRows();this.refreshModel({step:"sort",keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:"pivot"}):this.refreshModel({step:"aggregate"})}createChangePath(e){const t=_missingOrEmpty(e),i=new ChangedPath(!1,this.rootNode);return(t||this.gos.get("treeData"))&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction")||e.rowNodeTransactions==null)return!1;const t=e.rowNodeTransactions.filter(s=>s.add!=null&&s.add.length>0||s.remove!=null&&s.remove.length>0);return t==null||t.length==0}buildRefreshModelParams(e){let t="group";const i={everything:"group",group:"group",filter:"filter",map:"map",aggregate:"aggregate",sort:"sort",pivot:"pivot"};if(_exists(e)&&(t=i[e]),_missing(t)){_errorOnce(`invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`);return}const s=!this.gos.get("suppressAnimationFrame");return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s}}refreshModel(e){if(!this.hasStarted||this.isRefreshingModel||this.columnModel.isChangeEventsDispatching())return;const t=typeof e=="object"&&"step"in e?e:this.buildRefreshModelParams(e);if(!t||this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(this.isRefreshingModel=!0,t.step){case"group":this.doRowGrouping(t.rowNodeTransactions,t.rowNodeOrder,i,!!t.afterColumnsChanged);case"filter":this.doFilter(i);case"pivot":this.doPivot(i);case"aggregate":this.doAggregate(i);case"filter_aggregates":this.doFilterAggregates(i);case"sort":this.doSort(t.rowNodeTransactions,i);case"map":this.doRowsToDisplay()}const s=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,s),this.isRefreshingModel=!1;const o={type:"modelUpdated",animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack};this.eventService.dispatchEvent(o)}isEmpty(){const e=_missing(this.rootNode.allLeafChildren)||this.rootNode.allLeafChildren.length===0;return _missing(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return _exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!1,s=!1;const o=[],r=this.gos.get("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort(n=>{if(s)return;if(i&&(n===t||n===e)&&(s=!0,n.group&&r)){o.push(...n.allLeafChildren);return}if(!i){if(n!==t&&n!==e)return;i=!0}if(!n.group||!r){o.push(n);return}}),o}setDatasource(e){_errorOnce("should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||this.rowsToDisplay.length===0)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if(_last(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let o=-1,r=-1;for(;;){const n=Math.floor((t+i)/2),l=this.rowsToDisplay[n];if(this.isRowInPixel(l,e)||(l.rowTop<e?t=n+1:l.rowTop>e&&(i=n-1),o===t&&r===i))return n;o=t,r=i}}isRowInPixel(e,t){const i=e.rowTop,s=e.rowTop+e.rowHeight;return i<=t&&s>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((t,i)=>e(t,i))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:e,recursionType:0,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:1,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:2,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:3,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){const{nodes:t,callback:i,recursionType:s,includeFooterNodes:o}=e;let{index:r}=e;const n=l=>{const a=t[0]?.parent;if(!a)return;const d=o&&this.gos.getGrandTotalRow(),h=this.gos.getGroupTotalRowCallback(),c=o&&h({node:a});if(a===this.rootNode){d===l&&(a.createFooter(),i(a.sibling,r++));return}c===l&&(a.createFooter(),i(a.sibling,r++))};n("top");for(let l=0;l<t.length;l++){const a=t[l];if(i(a,r++),a.hasChildren()&&!a.footer){let d=null;switch(s){case 0:d=a.childrenAfterGroup;break;case 1:d=a.childrenAfterAggFilter;break;case 2:d=a.childrenAfterSort;break;case 3:d=a.leafGroup?null:a.childrenAfterSort;break}d&&(r=this.recursivelyWalkNodesAndCallback({nodes:[...d],callback:i,recursionType:s,index:r,includeFooterNodes:o}))}}return n("bottom"),r}doAggregate(e){this.aggregationStage?.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gos.get("treeData"),i=this.columnModel.isPivotActive(),s=n=>{n&&n.forEach(l=>{const a=()=>{l.expanded=e,s(l.childrenAfterGroup)};if(t){_exists(l.childrenAfterGroup)&&a();return}if(i){!l.leafGroup&&a();return}l.group&&a()})};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:"map"});const r={type:"expandOrCollapseAll",source:e?"expandAll":"collapseAll"};this.eventService.dispatchEvent(r)}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,s){if(this.groupStage){if(e?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,rowNodeOrder:t,changedPath:i}):this.groupStage.execute({rowNode:this.rootNode,changedPath:i,afterColumnsChanged:s}),this.gos.get("groupSelectsChildren")&&this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",i)){const r={type:"selectionChanged",source:"rowGroupChanged"};this.eventService.dispatchEvent(r)}}else this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren();this.nodeManager.isRowCountReady()&&(this.rowCountReady=!0,this.eventService.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){this.pivotStage?.execute({rowNode:this.rootNode,changedPath:e})}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(e){if(typeof e=="string"&&e.indexOf(RowNode.ID_PREFIX_ROW_GROUP)==0){let i;return this.forEachNode(s=>{s.id===e&&(i=s)}),i}return this.nodeManager.getRowNode(e)}setRowData(e){this.selectionService.reset("rowDataChanged"),this.nodeManager.setRowData(e),this.hasStarted&&this.dispatchUpdateEventsAndRefresh()}dispatchUpdateEventsAndRefresh(){const e={type:"rowDataUpdated"};this.eventService.dispatchEvent(e),this.refreshModel({step:"group",newData:!0})}batchUpdateRowData(e,t){if(this.applyAsyncTransactionsTimeout==null){this.rowDataTransactionBatch=[];const i=this.gos.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.executeBatchUpdateRowData()},i)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){this.applyAsyncTransactionsTimeout!=null&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const e=[],t=[];let i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach(s=>{const o=this.nodeManager.updateRowData(s.rowDataTransaction,void 0);t.push(o),s.callback&&e.push(s.callback.bind(null,o)),typeof s.rowDataTransaction.addIndex=="number"&&(i=!0)}),this.commonUpdateRowData(t,void 0,i),e.length>0&&window.setTimeout(()=>{e.forEach(s=>s())},0),t.length>0){const s={type:"asyncTransactionsFlushed",results:t};this.eventService.dispatchEvent(s)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e,t){this.valueCache.onDataChanged();const i=this.nodeManager.updateRowData(e,t),s=typeof e.addIndex=="number";return this.commonUpdateRowData([i],t,s),i}createRowNodeOrder(){if(this.gos.get("suppressMaintainUnsortedOrder"))return;const t={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let i=0;i<this.rootNode.allLeafChildren.length;i++){const s=this.rootNode.allLeafChildren[i];t[s.id]=i}return t}commonUpdateRowData(e,t,i){if(!this.hasStarted)return;const s=!this.gos.get("suppressAnimationFrame");i&&(t=this.createRowNodeOrder());const o={type:"rowDataUpdated"};this.eventService.dispatchEvent(o),this.refreshModel({step:"group",rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s})}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const i=t.detailNode;i&&i.setRowHeight(i.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){if(e.rowHeightChanged){if(this.columnModel.isAutoRowHeightActive())return;this.resetRowHeights()}}onGridReady(){this.hasStarted||this.setInitialData()}isRowDataLoaded(){return this.rowCountReady}};function onGroupExpandedOrCollapsed(e){e.expansionService.onGroupExpandedOrCollapsed()}function refreshClientSideRowModel(e,t){e.rowModelHelperService?.getClientSideRowModel()?.refreshModel(t)}function forEachLeafNode(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachLeafNode(t)}function forEachNodeAfterFilter(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachNodeAfterFilter(t)}function forEachNodeAfterFilterAndSort(e,t){e.rowModelHelperService?.getClientSideRowModel()?.forEachNodeAfterFilterAndSort(t)}function resetRowHeights(e){if(e.columnModel.isAutoRowHeightActive()){_warnOnce("calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");return}e.rowModelHelperService?.getClientSideRowModel()?.resetRowHeights()}function applyTransaction(e,t){return e.frameworkOverrides.wrapIncoming(()=>e.rowModelHelperService?.getClientSideRowModel()?.updateRowData(t))}function applyTransactionAsync(e,t,i){e.frameworkOverrides.wrapIncoming(()=>e.rowModelHelperService?.getClientSideRowModel()?.batchUpdateRowData(t,i))}function flushAsyncTransactions(e){e.frameworkOverrides.wrapIncoming(()=>e.rowModelHelperService?.getClientSideRowModel()?.flushAsyncTransactions())}function getBestCostNodeSelection(e){return e.selectionService.getBestCostNodeSelection()}var FilterStage=class extends BeanStub{constructor(){super(...arguments),this.beanName="filterStage"}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){const t=!!this.filterManager?.isChildFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const i=(s,o)=>{s.hasChildren()&&e&&!o?s.childrenAfterFilter=s.childrenAfterGroup.filter(r=>{const n=r.childrenAfterFilter&&r.childrenAfterFilter.length>0,l=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return n||l}):s.childrenAfterFilter=s.childrenAfterGroup,s.sibling&&(s.sibling.childrenAfterFilter=s.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const s=(r,n)=>{if(r.childrenAfterGroup)for(let l=0;l<r.childrenAfterGroup.length;l++){const a=r.childrenAfterGroup[l],d=n||this.filterManager.doesRowPassFilter({rowNode:a});a.childrenAfterGroup?s(r.childrenAfterGroup[l],d):i(a,d)}i(r,n)},o=r=>s(r,!1);t.executeFromRootNode(o)}else{const s=o=>i(o,!1);t.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},FlattenStage=class extends BeanStub{constructor(){super(...arguments),this.beanName="flattenStage"}wireBeans(e){this.beans=e,this.columnModel=e.columnModel}execute(e){const t=e.rowNode,i=[],s=this.columnModel.isPivotMode(),o=s&&t.leafGroup,r=o?[t]:t.childrenAfterSort,n=this.getFlattenDetails();this.recursivelyAddToRowsToDisplay(n,r,i,s,0);const l=i.length>0;if(!o&&l&&n.grandTotalRow){t.createFooter();const d=n.grandTotalRow==="top";this.addRowNodeToRowsToDisplay(n,t.sibling,i,0,d)}return i}getFlattenDetails(){const e=this.gos.get("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gos.get("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:this.gos.isGroupMultiAutoColumn(),hideOpenParents:this.gos.get("groupHideOpenParents"),grandTotalRow:this.gos.getGrandTotalRow(),groupTotalRow:this.gos.getGroupTotalRowCallback()}}recursivelyAddToRowsToDisplay(e,t,i,s,o){if(!_missingOrEmpty(t))for(let r=0;r<t.length;r++){const n=t[r],l=n.hasChildren(),a=s&&!l,d=e.groupRemoveSingleChildren&&l&&n.childrenAfterGroup.length===1,h=e.groupRemoveLowestSingleChildren&&l&&n.leafGroup&&n.childrenAfterGroup.length===1,c=s&&n.leafGroup,u=e.hideOpenParents&&n.expanded&&!n.master&&!c;if(!a&&!u&&!d&&!h&&this.addRowNodeToRowsToDisplay(e,n,i,o),!(s&&n.leafGroup)){if(l){const p=d||h;if(n.expanded||p){const f=e.groupTotalRow({node:n});f||n.destroyFooter();const m=p?o:o+1;f==="top"&&(n.createFooter(),this.addRowNodeToRowsToDisplay(e,n.sibling,i,m)),this.recursivelyAddToRowsToDisplay(e,n.childrenAfterSort,i,s,m),f==="bottom"&&(n.createFooter(),this.addRowNodeToRowsToDisplay(e,n.sibling,i,m))}}else if(n.master&&n.expanded){const p=this.createDetailNode(n);this.addRowNodeToRowsToDisplay(e,p,i,o)}}}}addRowNodeToRowsToDisplay(e,t,i,s,o){o?i.unshift(t):i.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:s)}createDetailNode(e){if(_exists(e.detailNode))return e.detailNode;const t=new RowNode(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,_exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}},ImmutableService=class extends BeanStub{constructor(){super(...arguments),this.beanName="immutableService"}wireBeans(e){this.rowModel=e.rowModel,this.selectionService=e.selectionService}postConstruct(){this.rowModel.getType()==="clientSide"&&(this.clientSideRowModel=this.rowModel,this.addManagedPropertyListener("rowData",()=>this.onRowDataUpdated()))}isActive(){const e=this.gos.exists("getRowId");return this.gos.get("resetRowDataOnUpdate")?!1:e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const[i,s]=t;this.clientSideRowModel.updateRowData(i,s)}createTransactionForRowData(e){if(_missing(this.clientSideRowModel)){_errorOnce("ImmutableService only works with ClientSideRowModel");return}const t=this.gos.getRowIdCallback();if(t==null){_errorOnce("ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");return}const i={remove:[],update:[],add:[]},s=this.clientSideRowModel.getCopyOfNodesMap(),r=this.gos.get("suppressMaintainUnsortedOrder")?void 0:{};return _exists(e)&&e.forEach((n,l)=>{const a=t({data:n,level:0}),d=s[a];r&&(r[a]=l),d?(d.data!==n&&i.update.push(n),s[a]=void 0):i.add.push(n)}),_iterateObject(s,(n,l)=>{l&&i.remove.push(l.data)}),[i,r]}onRowDataUpdated(){const e=this.gos.get("rowData");e&&(this.isActive()?this.setRowData(e):(this.selectionService.reset("rowDataChanged"),this.clientSideRowModel.setRowData(e)))}},SortService=class extends BeanStub{constructor(){super(...arguments),this.beanName="sortService"}wireBeans(e){this.columnModel=e.columnModel,this.funcColsService=e.funcColsService,this.rowNodeSorter=e.rowNodeSorter,this.showRowGroupColsService=e.showRowGroupColsService}sort(e,t,i,s,o,r){const n=this.gos.get("groupMaintainOrder"),l=this.columnModel.getCols().some(u=>u.isRowGroupActive());let a={};i&&s&&(a=this.calculateDirtyNodes(s));const d=this.columnModel.isPivotMode(),h=this.gos.getCallback("postSortRows"),c=u=>{this.pullDownGroupDataForHideOpenParents(u.childrenAfterAggFilter,!0);const g=d&&u.leafGroup;if(n&&l&&!u.leafGroup&&!r){const m=this.funcColsService.getRowGroupColumns()?.[u.level+1]?.getSort()===null,C=u.childrenAfterAggFilter.slice(0);if(u.childrenAfterSort&&!m){const v={};u.childrenAfterSort.forEach((w,y)=>{v[w.id]=y}),C.sort((w,y)=>(v[w.id]??0)-(v[y.id]??0))}u.childrenAfterSort=C}else!t||g?u.childrenAfterSort=u.childrenAfterAggFilter.slice(0):i?u.childrenAfterSort=this.doDeltaSort(u,a,o,e):u.childrenAfterSort=this.rowNodeSorter.doFullSort(u.childrenAfterAggFilter,e);if(u.sibling&&(u.sibling.childrenAfterSort=u.childrenAfterSort),this.updateChildIndexes(u),h){const f={nodes:u.childrenAfterSort};h(f)}};o&&o.forEachChangedNodeDepthFirst(c),this.updateGroupDataForHideOpenParents(o)}calculateDirtyNodes(e){const t={},i=s=>{s&&s.forEach(o=>t[o.id]=!0)};return e&&e.forEach(s=>{i(s.add),i(s.update),i(s.remove)}),t}doDeltaSort(e,t,i,s){const o=e.childrenAfterAggFilter,r=e.childrenAfterSort;if(!r)return this.rowNodeSorter.doFullSort(o,s);const n={},l=[];o.forEach(c=>{t[c.id]||!i.canSkip(c)?l.push(c):n[c.id]=!0});const a=r.filter(c=>n[c.id]),d=(c,u)=>({currentPos:u,rowNode:c}),h=l.map(d).sort((c,u)=>this.rowNodeSorter.compareRowNodes(s,c,u));return this.mergeSortedArrays(s,h,a.map(d)).map(({rowNode:c})=>c)}mergeSortedArrays(e,t,i){const s=[];let o=0,r=0;for(;o<t.length&&r<i.length;)this.rowNodeSorter.compareRowNodes(e,t[o],i[r])<0?s.push(t[o++]):s.push(i[r++]);for(;o<t.length;)s.push(t[o++]);for(;r<i.length;)s.push(i[r++]);return s}updateChildIndexes(e){if(_missing(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const s=t[i],o=i===0,r=i===e.childrenAfterSort.length-1;s.setFirstChild(o),s.setLastChild(r),s.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gos.get("groupHideOpenParents"))return;if(this.gos.get("treeData"))return _warnOnce("The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them."),!1;const t=i=>{this.pullDownGroupDataForHideOpenParents(i.childrenAfterSort,!1),i.childrenAfterSort.forEach(s=>{s.hasChildren()&&t(s)})};e&&e.executeFromRootNode(i=>t(i))}pullDownGroupDataForHideOpenParents(e,t){!this.gos.get("groupHideOpenParents")||_missing(e)||e.forEach(i=>{(this.showRowGroupColsService?.getShowRowGroupCols()??[]).forEach(o=>{const r=o.getColDef().showRowGroup;if(typeof r!="string"){_errorOnce("groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");return}const n=r,l=this.columnModel.getColDefCol(n);if(l!==i.rowGroupColumn)if(t)i.setGroupValue(o.getId(),void 0);else{const d=i.getFirstChildOfFirstChild(l);d&&i.setGroupValue(o.getId(),d.key)}})})}},SortStage=class extends BeanStub{constructor(){super(...arguments),this.beanName="sortStage"}wireBeans(e){this.sortService=e.sortService,this.sortController=e.sortController}execute(e){const t=this.sortController.getSortOptions(),i=_exists(t)&&t.length>0,s=i&&_exists(e.rowNodeTransactions)&&this.gos.get("deltaSort"),o=t.some(r=>this.gos.isColumnsSortingCoupledToGroup()?r.column.isPrimary()&&r.column.isRowGroupActive():!!r.column.getColDef().showRowGroup);this.sortService.sort(t,i,s,e.rowNodeTransactions,e.changedPath,o)}},VERSION2="32.0.2",ClientSideRowModelCoreModule={version:VERSION2,moduleName:"@ag-grid-community/client-side-row-model-core",rowModel:"clientSide",beans:[ClientSideRowModel,FilterStage,SortStage,FlattenStage,SortService,ImmutableService]},ClientSideRowModelApiModule={version:VERSION2,moduleName:"@ag-grid-community/client-side-row-model-api",beans:[RowModelHelperService],apiFunctions:{onGroupExpandedOrCollapsed,refreshClientSideRowModel,forEachLeafNode,forEachNodeAfterFilter,forEachNodeAfterFilterAndSort,resetRowHeights,applyTransaction,applyTransactionAsync,flushAsyncTransactions,getBestCostNodeSelection},dependantModules:[ClientSideRowModelCoreModule,CsrmSsrmSharedApiModule]},ClientSideRowModelModule={version:VERSION2,moduleName:"@ag-grid-community/client-side-row-model",dependantModules:[ClientSideRowModelCoreModule,ClientSideRowModelApiModule]},BaseCreator=class extends BeanStub{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return(e==null||!e.length)&&(e=this.getDefaultFileName()),e.indexOf(".")===-1?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}getDefaultFileName(){return`export.${this.getDefaultFileExtension()}`}},BaseGridSerializingSession=class{constructor(e){this.groupColumns=[];const{columnModel:t,funcColsService:i,columnNameService:s,valueService:o,gos:r,processCellCallback:n,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:d}=e;this.columnModel=t,this.funcColsService=i,this.columnNameService=s,this.valueService=o,this.gos=r,this.processCellCallback=n,this.processHeaderCallback=l,this.processGroupHeaderCallback=a,this.processRowGroupCallback=d}prepare(e){this.groupColumns=e.filter(t=>!!t.getColDef().showRowGroup)}extractHeaderValue(e){return this.getHeaderName(this.processHeaderCallback,e)??""}extractRowCellValue(e,t,i,s,o){const n=(!this.gos.get("groupHideOpenParents")||o.footer)&&this.shouldRenderGroupSummaryCell(o,e,t)?this.createValueForGroupNode(e,o):this.valueService.getValue(e,o);return this.processCell({accumulatedRowIndex:i,rowNode:o,column:e,value:n,processCellCallback:this.processCellCallback,type:s})}shouldRenderGroupSummaryCell(e,t,i){if(!(e&&e.group))return!1;if(this.groupColumns.indexOf(t)!==-1){if(e.groupData?.[t.getId()]!=null||this.gos.isRowModelType("serverSide")&&e.group)return!0;if(e.footer&&e.level===-1){const n=t.getColDef();return n==null||n.showRowGroup===!0||n.showRowGroup===this.funcColsService.getRowGroupColumns()[0].getId()}}const r=this.gos.isGroupUseEntireRow(this.columnModel.isPivotMode());return i===0&&r}getHeaderName(e,t){return e?e(this.gos.addGridCommonParams({column:t})):this.columnNameService.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e,t){if(this.processRowGroupCallback)return this.processRowGroupCallback(this.gos.addGridCommonParams({column:e,node:t}));const i=this.gos.get("treeData"),s=this.gos.get("suppressGroupMaintainValueType"),o=a=>{if(i||s)return a.key;const d=a.groupData?.[e.getId()];return!d||!a.rowGroupColumn||a.rowGroupColumn.getColDef().useValueFormatterForExport===!1?d:this.valueService.formatValue(a.rowGroupColumn,a,d)??d},r=t.footer,n=[o(t)];if(!this.gos.isGroupMultiAutoColumn())for(;t.parent;)t=t.parent,n.push(o(t));const l=n.reverse().join(" -> ");return r?`Total ${l}`:l}processCell(e){const{accumulatedRowIndex:t,rowNode:i,column:s,value:o,processCellCallback:r,type:n}=e;return r?{value:r(this.gos.addGridCommonParams({accumulatedRowIndex:t,column:s,node:i,value:o,type:n,parseValue:l=>this.valueService.parseValue(s,i,l,this.valueService.getValue(s,i)),formatValue:l=>this.valueService.formatValue(s,i,l)??l}))??""}:s.getColDef().useValueFormatterForExport!==!1?{value:o??"",valueFormatted:this.valueService.formatValue(s,i,o)}:{value:o??""}}},Downloader=class{static download(e,t){const i=document.defaultView||window;if(!i){_warnOnce("There is no `window` associated with the current `document`");return}const s=document.createElement("a"),o=i.URL.createObjectURL(t);s.setAttribute("href",o),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:i})),document.body.removeChild(s),i.setTimeout(()=>{i.URL.revokeObjectURL(o)},0)}},LINE_SEPARATOR=`\r
|
|
193
|
+
`,CsvSerializingSession=class extends BaseGridSerializingSession{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:i}=e;this.suppressQuotes=t,this.columnSeparator=i}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,LINE_SEPARATOR),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((i,s)=>{s!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(i.data.value||""),i.mergeAcross&&this.appendEmptyCells(i.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,i,s){i!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,i){t!=0&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(_warnOnce("unknown value type during csv conversion"),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=LINE_SEPARATOR),this.isFirstLine=!1}},CsvCreator=class extends BaseCreator{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.funcColsService=e.funcColsService,this.valueService=e.valueService,this.gridSerializer=e.gridSerializer}postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gos:this.gos})}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){_warnOnce("Export cancelled. Export is not allowed as per your configuration.");return}const t=this.getMergedParams(e),i=this.getData(t),s=new Blob(["\uFEFF",i],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(this.gos.getGridCommonParams()):t.fileName;Downloader.download(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,columnNameService:i,funcColsService:s,valueService:o,gos:r}=this,{processCellCallback:n,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:d,suppressQuotes:h,columnSeparator:c}=e;return new CsvSerializingSession({columnModel:t,columnNameService:i,funcColsService:s,valueService:o,gos:r,processCellCallback:n||void 0,processHeaderCallback:l||void 0,processGroupHeaderCallback:a||void 0,processRowGroupCallback:d||void 0,suppressQuotes:h||!1,columnSeparator:c||","})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function getDataAsCsv(e,t){return e.csvCreator?.getDataAsCsv(t)}function exportDataAsCsv(e,t){e.csvCreator?.exportDataAsCsv(t)}var RowType=(e=>(e[e.HEADER_GROUPING=0]="HEADER_GROUPING",e[e.HEADER=1]="HEADER",e[e.BODY=2]="BODY",e))(RowType||{}),GridSerializer=class extends BeanStub{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleColsService=e.visibleColsService,this.columnModel=e.columnModel,this.columnNameService=e.columnNameService,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel,this.selectionService=e.selectionService,this.rowNodeSorter=e.rowNodeSorter,this.sortController=e.sortController}serialize(e,t={}){const{allColumns:i,columnKeys:s,skipRowGroups:o}=t,r=this.getColumnsToExport(i,o,s);return _compose(this.prepareSession(r),this.prependContent(t),this.exportColumnGroups(t,r),this.exportHeaders(t,r),this.processPinnedTopRows(t,r),this.processRows(t,r),this.processPinnedBottomRows(t,r),this.appendContent(t))(e).parse()}processRow(e,t,i,s){const o=t.shouldRowBeSkipped||(()=>!1),r=this.gos.get("groupRemoveSingleChildren"),n=this.gos.get("groupRemoveLowestSingleChildren"),a=t.rowPositions!=null||!!t.onlySelected,d=this.gos.get("groupHideOpenParents")&&!a,h=this.columnModel.isPivotMode()?s.leafGroup:!s.group,c=!!s.footer,u=n&&s.leafGroup,g=s.allChildrenCount===1&&s.childrenAfterGroup?.length===1&&(r||u);if(!h&&!c&&(t.skipRowGroups||g||d)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.level===-1&&!h&&!c||o(this.gos.addGridCommonParams({node:s})))return;const m=e.onNewBodyRow(s);if(i.forEach((C,v)=>{m.onColumn(C,v,s)}),t.getCustomContentBelowRow){const C=t.getCustomContentBelowRow(this.gos.addGridCommonParams({node:s}));C&&e.addCustomContent(C)}}appendContent(e){return t=>{const i=e.appendContent;return i&&t.addCustomContent(i),t}}prependContent(e){return t=>{const i=e.prependContent;return i&&t.addCustomContent(i),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return i=>{if(!e.skipColumnGroupHeaders){const s=new GroupInstanceIdCreator,o=this.visibleColsService.createGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0});this.recursivelyAddHeaderGroups(o,i,e.processGroupHeaderCallback)}return i}}exportHeaders(e,t){return i=>{if(!e.skipColumnHeaders){const s=i.onNewHeaderRow();t.forEach((o,r)=>{s.onColumn(o,r,void 0)})}return i}}processPinnedTopRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(o=>o.rowPinned==="top").sort((o,r)=>o.rowIndex-r.rowIndex).map(o=>this.pinnedRowModel.getPinnedTopRow(o.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedTopRow(s),i}}processRows(e,t){return i=>{const s=this.rowModel,o=s.getType(),r=o==="clientSide",n=o==="serverSide",l=!r&&e.onlySelected,a=this.processRow.bind(this,i,e,t),{exportedRows:d="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(h=>h.rowPinned==null).sort((h,c)=>h.rowIndex-c.rowIndex).map(h=>s.getRow(h.rowIndex)).forEach(a);else if(this.columnModel.isPivotMode())r?s.forEachPivotNode(a,!0):n?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||l){const h=this.selectionService.getSelectedNodes();this.replicateSortedOrder(h),h.forEach(a)}else d==="all"?s.forEachNode(a):r||n?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return i}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),i=(s,o)=>s.rowIndex!=null&&o.rowIndex!=null?s.rowIndex-o.rowIndex:s.level===o.level?s.parent?.id===o.parent?.id?this.rowNodeSorter.compareRowNodes(t,{rowNode:s,currentPos:s.rowIndex??-1},{rowNode:o,currentPos:o.rowIndex??-1}):i(s.parent,o.parent):s.level>o.level?i(s.parent,o):i(s,o.parent);e.sort(i)}processPinnedBottomRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(o=>o.rowPinned==="bottom").sort((o,r)=>o.rowIndex-r.rowIndex).map(o=>this.pinnedRowModel.getPinnedBottomRow(o.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedBottomRow(s),i}}getColumnsToExport(e=!1,t=!1,i){const s=this.columnModel.isPivotMode();if(i&&i.length)return this.columnModel.getColsForKeys(i);const o=this.gos.get("treeData");let r=[];return e&&!s?r=this.columnModel.getCols():r=this.visibleColsService.getAllCols(),t&&!o&&(r=r.filter(n=>n.getColId()!==GROUP_AUTO_COLUMN_ID)),r}recursivelyAddHeaderGroups(e,t,i){const s=[];e.forEach(o=>{const r=o;r.getChildren&&r.getChildren().forEach(n=>s.push(n))}),e.length>0&&isColumnGroup(e[0])&&this.doAddHeaderHeader(t,e,i),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,i)}doAddHeaderHeader(e,t,i){const s=e.onNewHeaderGroupingRow();let o=0;t.forEach(r=>{const n=r;let l;i?l=i(this.gos.addGridCommonParams({columnGroup:n})):l=this.columnNameService.getDisplayNameForColumnGroup(n,"header");const a=n.getLeafColumns().reduce((d,h,c,u)=>{let g=_last(d);return h.getColumnGroupShow()==="open"?(!g||g[1]!=null)&&(g=[c],d.push(g)):g&&g[1]==null&&(g[1]=c-1),c===u.length-1&&g&&g[1]==null&&(g[1]=c),d},[]);s.onColumn(n,l||"",o++,n.getLeafColumns().length-1,a)})}},VERSION3="32.0.2",CsvExportCoreModule={version:VERSION3,moduleName:"@ag-grid-community/csv-export-core",beans:[CsvCreator,GridSerializer]},CsvExportApiModule={version:VERSION3,moduleName:"@ag-grid-community/csv-export-api",apiFunctions:{getDataAsCsv,exportDataAsCsv},dependantModules:[CsvExportCoreModule]},CsvExportModule={version:VERSION3,moduleName:"@ag-grid-community/csv-export",dependantModules:[CsvExportCoreModule,CsvExportApiModule]},LINE_SEPARATOR2=`\r
|
|
194
|
+
`;function returnAttributeIfPopulated(e,t,i){if(!t&&t!==""&&t!==0)return"";let s=t;return typeof t=="boolean"&&i&&(s=i(t)),` ${e}="${s}"`}var XmlFactory=class{static createHeader(e={}){const t="<?",i="?>",s=["version"];e.version||(e.version="1.0"),e.encoding&&s.push("encoding"),e.standalone&&s.push("standalone");const o=s.map(r=>`${r}="${e[r]}"`).join(" ");return`${t}xml ${o} ${i}`}static createXml(e,t){let i="";e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach(o=>{Object.keys(o.map).forEach(r=>{i+=returnAttributeIfPopulated(o.prefix+r,o.map[r],t)})}),e.properties.rawMap&&Object.keys(e.properties.rawMap).forEach(o=>{i+=returnAttributeIfPopulated(o,e.properties.rawMap[o],t)}));let s="<"+e.name+i;return!e.children&&e.textNode==null?s+"/>"+LINE_SEPARATOR2:e.textNode!=null?s+">"+e.textNode+"</"+e.name+">"+LINE_SEPARATOR2:(s+=">"+LINE_SEPARATOR2,e.children&&e.children.forEach(o=>{s+=this.createXml(o,t)}),s+"</"+e.name+">"+LINE_SEPARATOR2)}},compressBlob=async e=>{let t=0;const i=[],s=new WritableStream({write:n=>{i.push(n),t+=n.length}}),o=new ReadableStream({start:n=>{const l=new FileReader;l.onload=a=>{a.target?.result&&n.enqueue(a.target.result),n.close()},l.readAsArrayBuffer(e)}}),r=new window.CompressionStream("deflate-raw");return await o.pipeThrough(r).pipeTo(s),{size:t,content:new Blob(i)}},deflateLocalFile=async e=>{const t=new Blob([e]),{size:i,content:s}=await compressBlob(t),o=new Uint8Array(await s.arrayBuffer());return{size:i,content:o}},convertTime=e=>{let t=e.getHours();return t<<=6,t=t|e.getMinutes(),t<<=5,t=t|e.getSeconds()/2,t},convertDate=e=>{let t=e.getFullYear()-1980;return t<<=4,t=t|e.getMonth()+1,t<<=5,t=t|e.getDate(),t};function convertDecToHex(e,t){let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(e&255),e>>>=8;return i}var getCrcFromCrc32TableAndByteArray=e=>{if(!e.length)return 0;let t=-1,i=0,s=0,o=0;for(let r=0;r<e.length;r++)i=e[r],s=(t^i)&255,o=crcTable[s],t=t>>>8^o;return t^-1},getCrcFromCrc32Table=e=>e.length?getCrcFromCrc32TableAndByteArray(typeof e=="string"?new TextEncoder().encode(e):e):0,crcTable=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]),getHeaders=(e,t,i,s,o,r)=>{const{content:n,path:l,created:a}=e,d=convertTime(a),h=convertDate(a),c=getCrcFromCrc32Table(o),u=r!==void 0?r:s,g=_utf8_encode(l),p=g!==l;let f="";if(p){const w=convertDecToHex(1,1)+convertDecToHex(getCrcFromCrc32Table(g),4)+g;f="up"+convertDecToHex(w.length,2)+w}const m="\0"+(p?"\0\b":"\0\0")+convertDecToHex(t?8:0,2)+convertDecToHex(d,2)+convertDecToHex(h,2)+convertDecToHex(u?c:0,4)+convertDecToHex(r??s,4)+convertDecToHex(s,4)+convertDecToHex(g.length,2)+convertDecToHex(f.length,2),C="PK"+m+g+f,v="PK\0"+m+"\0\0\0\0\0\0"+(n?"\0\0\0\0":"\0\0\0")+convertDecToHex(i,4)+g+f;return{localFileHeader:Uint8Array.from(C,w=>w.charCodeAt(0)),centralDirectoryHeader:Uint8Array.from(v,w=>w.charCodeAt(0))}},getDecodedContent=e=>{let t;if(typeof e=="string"){const i=atob(e.split(";base64,")[1]);t=Uint8Array.from(i,s=>s.charCodeAt(0))}else t=e;return{size:t.length,content:t}},getDeflatedHeaderAndContent=async(e,t)=>{const{content:i}=e,{size:s,content:o}=i?getDecodedContent(i):{size:0,content:Uint8Array.from([])};let r,n,l=!1;if(e.type==="file"&&o&&s>0){const h=await deflateLocalFile(o);r=h.content,n=h.size,l=!0}return{...getHeaders(e,l,t,s,o,n),content:r||o,isCompressed:l}},getHeaderAndContent=(e,t)=>{const{content:i}=e,{content:s}=i?getDecodedContent(i):{content:Uint8Array.from([])};return{...getHeaders(e,!1,t,s.length,s,void 0),content:s,isCompressed:!1}},buildCentralDirectoryEnd=(e,t,i)=>{const s="PK\0\0\0\0"+convertDecToHex(e,2)+convertDecToHex(e,2)+convertDecToHex(t,4)+convertDecToHex(i,4)+"\0\0";return Uint8Array.from(s,o=>o.charCodeAt(0))},ZipContainer=class{static addFolders(e){e.forEach(this.addFolder.bind(this))}static addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1,type:"folder"})}static addFile(e,t,i=!1){this.files.push({path:e,created:new Date,content:i?t:new TextEncoder().encode(t),isBase64:i,type:"file"})}static async getZipFile(e="application/zip"){const t=await this.buildCompressedFileStream();return this.clearStream(),new Blob([t],{type:e})}static getUncompressedZipFile(e="application/zip"){const t=this.buildFileStream();return this.clearStream(),new Blob([t],{type:e})}static clearStream(){this.folders=[],this.files=[]}static packageFiles(e){let t=0,i=0;for(const d of e){const{localFileHeader:h,centralDirectoryHeader:c,content:u}=d;t+=h.length+u.length,i+=c.length}const s=new Uint8Array(t),o=new Uint8Array(i);let r=0,n=0;for(const d of e){const{localFileHeader:h,centralDirectoryHeader:c,content:u}=d;s.set(h,r),r+=h.length,s.set(u,r),r+=u.length,o.set(c,n),n+=c.length}const l=buildCentralDirectoryEnd(e.length,i,t),a=new Uint8Array(s.length+o.length+l.length);return a.set(s),a.set(o,s.length),a.set(l,s.length+o.length),a}static async buildCompressedFileStream(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const o=await getDeflatedHeaderAndContent(s,i),{localFileHeader:r,content:n}=o;t.push(o),i+=r.length+n.length}return this.packageFiles(t)}static buildFileStream(){const e=[...this.folders,...this.files],t=[];let i=0;for(const s of e){const o=getHeaderAndContent(s,i),{localFileHeader:r,content:n}=o;t.push(o),i+=r.length+n.length}return this.packageFiles(t)}};ZipContainer.folders=[],ZipContainer.files=[];var InfiniteBlock=class extends RowNodeBlock{wireBeans(e){this.beans=e}constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){_exists(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(_missing(this.params.datasource.getRows)){_warnOnce("datasource is missing getRows method");return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gos.getGridCommonParams().context}}forEachNode(e,t,i){this.rowNodes.forEach((s,o)=>{this.startRow+o<i&&e(s,t.next())})}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const i=e-this.startRow;return this.rowNodes[i]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new RowNode(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach((i,s)=>{const o=e.rowData?e.rowData[s]:void 0;!i.id&&i.alreadyRendered&&o&&(this.rowNodes[s]=new RowNode(this.beans),this.rowNodes[s].setRowIndex(i.rowIndex),this.rowNodes[s].setRowTop(i.rowTop),this.rowNodes[s].setRowHeight(i.rowHeight),i.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[s],o,this.startRow+s)});const t=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroy(){this.rowNodes.forEach(e=>{e.clearRowTopAndRowIndex()}),super.destroy()}},MAX_EMPTY_BLOCKS_TO_KEEP=2,InfiniteCache=class extends BeanStub{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}wireBeans(e){this.rowRenderer=e.rowRenderer,this.focusService=e.focusService}getRow(e,t=!1){const i=Math.floor(e/this.params.blockSize);let s=this.blocks[i];if(!s){if(t)return;s=this.createBlock(i)}return s.getRow(e)}createBlock(e){const t=this.createBean(new InfiniteBlock(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){if(this.blockCount==0){this.purgeCache();return}this.getBlocksInOrder().forEach(t=>t.setStateWaitingToLoad()),this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){this.getBlocksInOrder().forEach(e=>this.destroyBlock(e)),super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.gos.get("debug")&&_log(`InfiniteCache - onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(n=>n!=e),i=(n,l)=>l.getLastAccessed()-n.getLastAccessed();t.sort(i);const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,r=MAX_EMPTY_BLOCKS_TO_KEEP-1;t.forEach((n,l)=>{const a=n.getState()==="needsLoading"&&l>=r,d=s?l>=o:!1;if(a||d){if(this.isBlockCurrentlyDisplayed(n)||this.isBlockFocused(n))return;this.removeBlockFromCache(n)}})}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const i=e.getStartRow(),s=e.getEndRow();return t.rowIndex>=i&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const s=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<s&&(this.rowCount=s)}}setRowCount(e,t){this.rowCount=e,_exists(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new NumberSequence;this.getBlocksInOrder().forEach(i=>i.forEachNode(e,t,this.rowCount))}getBlocksInOrder(){const e=(i,s)=>i.getId()-s.getId();return _getAllValuesInObject(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){if(this.isAlive()){this.destroyAllBlocksPastVirtualRowCount();const e={type:"storeUpdated"};this.eventService.dispatchEvent(e)}}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach(t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)}),e.length>0&&e.forEach(t=>this.destroyBlock(t))}purgeCache(){this.getBlocksInOrder().forEach(e=>this.removeBlockFromCache(e)),this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const i=[];let s=-1,o=!1;const r=new NumberSequence;let n=!1;return this.getBlocksInOrder().forEach(a=>{if(!n){if(o&&s+1!==a.getId()){n=!0;return}s=a.getId(),a.forEachNode(d=>{const h=d===e||d===t;(o||h)&&i.push(d),h&&(o=!o)},r,this.rowCount)}}),n||o?[]:i}},InfiniteRowModel=class extends BeanStub{constructor(){super(...arguments),this.beanName="rowModel"}wireBeans(e){this.filterManager=e.filterManager,this.sortController=e.sortController,this.selectionService=e.selectionService,this.rowRenderer=e.rowRenderer,this.rowNodeBlockLoader=e.rowNodeBlockLoader}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){this.gos.isRowModelType("infinite")&&(this.rowHeight=this.gos.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache()),this.verifyProps())}verifyProps(){this.gos.exists("initialGroupOrderComparator")&&_warnOnce("initialGroupOrderComparator cannot be used with Infinite Row Model as sorting is done on the server side")}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy()}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.onCacheUpdated.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=this.gos.getRowHeightAsNumber(),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;this.cacheParams?e=this.isSortModelDifferent():e=!0,e&&this.reset()}isSortModelDifferent(){return!_jsonEquals(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){if(!this.datasource)return;this.gos.getRowIdCallback()!=null||this.selectionService.reset("rowDataChanged"),this.resetCache()}createModelUpdatedEvent(){return{type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1}}resetCache(){this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:this.filterManager?.getFilterModel()??{},sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.gos.get("infiniteInitialRowCount"),maxBlocksInCache:this.gos.get("maxBlocksInCache"),rowHeight:this.gos.getRowHeightAsNumber(),overflowSize:this.gos.get("cacheOverflowSize"),blockSize:this.gos.get("cacheBlockSize"),lastAccessedSequence:new NumberSequence},this.infiniteCache=this.createBean(new InfiniteCache(this.cacheParams)),this.eventService.dispatchEventOnce({type:"rowCountReady"});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}updateRowHeights(){this.forEachNode(t=>{t.setRowHeight(this.rowHeight),t.setRowTop(this.rowHeight*t.rowIndex)});const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return this.infiniteCache?this.infiniteCache.isLastRowIndexKnown():!1}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};function refreshInfiniteCache(e){e.rowModelHelperService?.getInfiniteRowModel()?.refreshCache()}function purgeInfiniteCache(e){e.rowModelHelperService?.getInfiniteRowModel()?.purgeCache()}function getInfiniteRowCount(e){return e.rowModelHelperService?.getInfiniteRowModel()?.getRowCount()}function isLastRowIndexKnown(e){return e.rowModelHelperService?.getInfiniteRowModel()?.isLastRowIndexKnown()}var VERSION4="32.0.2",InfiniteRowModelCoreModule={version:VERSION4,moduleName:"@ag-grid-community/infinite-row-model-core",rowModel:"infinite",beans:[InfiniteRowModel],dependantModules:[RowNodeBlockModule]},InfiniteRowModelApiModule={version:VERSION4,moduleName:"@ag-grid-community/infinite-row-model-api",beans:[RowModelHelperService],apiFunctions:{refreshInfiniteCache,purgeInfiniteCache,getInfiniteRowCount,isLastRowIndexKnown},dependantModules:[InfiniteRowModelCoreModule,SsrmInfiniteSharedApiModule]},InfiniteRowModelModule={version:VERSION4,moduleName:"@ag-grid-community/infinite-row-model",dependantModules:[InfiniteRowModelCoreModule,InfiniteRowModelApiModule]};ModuleRegistry.__registerModules([CommunityFeaturesModule,ClientSideRowModelModule,InfiniteRowModelModule,CsvExportModule],!1,void 0);
|