{"version":3,"file":"ag-grid-community-Bz-Rgibb.js","sources":["../../../node_modules/ag-grid-community/dist/package/main.esm.mjs"],"sourcesContent":["// community-modules/core/src/localEventService.ts\nvar LocalEventService = class {\n constructor() {\n this.allSyncListeners = /* @__PURE__ */ new Map();\n this.allAsyncListeners = /* @__PURE__ */ new Map();\n this.globalSyncListeners = /* @__PURE__ */ new Set();\n this.globalAsyncListeners = /* @__PURE__ */ new Set();\n this.asyncFunctionsQueue = [];\n this.scheduled = false;\n // using an object performs better than a Set for the number of different events we have\n this.firedEvents = {};\n }\n setFrameworkOverrides(frameworkOverrides) {\n this.frameworkOverrides = frameworkOverrides;\n }\n getListeners(eventType, async, autoCreateListenerCollection) {\n const listenerMap = async ? this.allAsyncListeners : this.allSyncListeners;\n let listeners = listenerMap.get(eventType);\n if (!listeners && autoCreateListenerCollection) {\n listeners = /* @__PURE__ */ new Set();\n listenerMap.set(eventType, listeners);\n }\n return listeners;\n }\n noRegisteredListenersExist() {\n return this.allSyncListeners.size === 0 && this.allAsyncListeners.size === 0 && this.globalSyncListeners.size === 0 && this.globalAsyncListeners.size === 0;\n }\n addEventListener(eventType, listener, async = false) {\n this.getListeners(eventType, async, true).add(listener);\n }\n removeEventListener(eventType, listener, async = false) {\n const listeners = this.getListeners(eventType, async, false);\n if (!listeners) {\n return;\n }\n listeners.delete(listener);\n if (listeners.size === 0) {\n const listenerMap = async ? this.allAsyncListeners : this.allSyncListeners;\n listenerMap.delete(eventType);\n }\n }\n addGlobalListener(listener, async = false) {\n (async ? this.globalAsyncListeners : this.globalSyncListeners).add(listener);\n }\n removeGlobalListener(listener, async = false) {\n (async ? this.globalAsyncListeners : this.globalSyncListeners).delete(listener);\n }\n dispatchEvent(event) {\n const agEvent = event;\n this.dispatchToListeners(agEvent, true);\n this.dispatchToListeners(agEvent, false);\n this.firedEvents[agEvent.type] = true;\n }\n dispatchEventOnce(event) {\n if (!this.firedEvents[event.type]) {\n this.dispatchEvent(event);\n }\n }\n dispatchToListeners(event, async) {\n const eventType = event.type;\n if (async && \"event\" in event) {\n const browserEvent = event.event;\n if (browserEvent instanceof Event) {\n event.eventPath = browserEvent.composedPath();\n }\n }\n const processEventListeners = (listeners2, originalListeners2) => listeners2.forEach((listener) => {\n if (!originalListeners2.has(listener)) {\n return;\n }\n const callback = this.frameworkOverrides ? () => this.frameworkOverrides.wrapIncoming(() => listener(event)) : () => listener(event);\n if (async) {\n this.dispatchAsync(callback);\n } else {\n callback();\n }\n });\n const originalListeners = this.getListeners(eventType, async, false) ?? /* @__PURE__ */ new Set();\n const listeners = new Set(originalListeners);\n if (listeners.size > 0) {\n processEventListeners(listeners, originalListeners);\n }\n const globalListeners = new Set(\n async ? this.globalAsyncListeners : this.globalSyncListeners\n );\n globalListeners.forEach((listener) => {\n const callback = this.frameworkOverrides ? () => this.frameworkOverrides.wrapIncoming(() => listener(eventType, event)) : () => listener(eventType, event);\n if (async) {\n this.dispatchAsync(callback);\n } else {\n callback();\n }\n });\n }\n // this gets called inside the grid's thread, for each event that it\n // wants to set async. the grid then batches the events into one setTimeout()\n // because setTimeout() is an expensive operation. ideally we would have\n // each event in it's own setTimeout(), but we batch for performance.\n dispatchAsync(func) {\n this.asyncFunctionsQueue.push(func);\n if (!this.scheduled) {\n const flush = () => {\n window.setTimeout(this.flushAsyncQueue.bind(this), 0);\n };\n this.frameworkOverrides ? this.frameworkOverrides.wrapIncoming(flush) : flush();\n this.scheduled = true;\n }\n }\n // this happens in the next VM turn only, and empties the queue of events\n flushAsyncQueue() {\n this.scheduled = false;\n const queueCopy = this.asyncFunctionsQueue.slice();\n this.asyncFunctionsQueue = [];\n queueCopy.forEach((func) => func());\n }\n};\n\n// community-modules/core/src/utils/array.ts\nfunction _existsAndNotEmpty(value) {\n return value != null && value.length > 0;\n}\nfunction _last(arr) {\n if (!arr || !arr.length) {\n return;\n }\n return arr[arr.length - 1];\n}\nfunction _areEqual(a, b, comparator) {\n if (a == null && b == null) {\n return true;\n }\n return a != null && b != null && a.length === b.length && a.every((value, index) => comparator ? comparator(value, b[index]) : b[index] === value);\n}\nfunction _shallowCompare(arr1, arr2) {\n return _areEqual(arr1, arr2);\n}\nfunction _sortNumerically(array) {\n return array.sort((a, b) => a - b);\n}\nfunction _removeRepeatsFromArray(array, object) {\n if (!array) {\n return;\n }\n for (let index = array.length - 2; index >= 0; index--) {\n const thisOneMatches = array[index] === object;\n const nextOneMatches = array[index + 1] === object;\n if (thisOneMatches && nextOneMatches) {\n array.splice(index + 1, 1);\n }\n }\n}\nfunction _removeFromUnorderedArray(array, object) {\n const index = array.indexOf(object);\n if (index >= 0) {\n array[index] = array[array.length - 1];\n array.pop();\n }\n}\nfunction _removeFromArray(array, object) {\n const index = array.indexOf(object);\n if (index >= 0) {\n array.splice(index, 1);\n }\n}\nfunction _removeAllFromUnorderedArray(array, toRemove) {\n for (let i = 0; i < toRemove.length; i++) {\n _removeFromUnorderedArray(array, toRemove[i]);\n }\n}\nfunction _removeAllFromArray(array, toRemove) {\n for (let i = 0; i < toRemove.length; i++) {\n _removeFromArray(array, toRemove[i]);\n }\n}\nfunction _insertIntoArray(array, object, toIndex) {\n array.splice(toIndex, 0, object);\n}\nfunction _insertArrayIntoArray(dest, src, toIndex) {\n if (dest == null || src == null) {\n return;\n }\n for (let i = src.length - 1; i >= 0; i--) {\n const item = src[i];\n _insertIntoArray(dest, item, toIndex);\n }\n}\nfunction _moveInArray(array, objectsToMove, toIndex) {\n _removeAllFromArray(array, objectsToMove);\n objectsToMove.slice().reverse().forEach((obj) => _insertIntoArray(array, obj, toIndex));\n}\nfunction _includes(array, value) {\n return array.indexOf(value) > -1;\n}\nfunction _flatten(arrayOfArrays) {\n return [].concat.apply([], arrayOfArrays);\n}\nfunction _pushAll(target, source) {\n if (source == null || target == null) {\n return;\n }\n source.forEach((value) => target.push(value));\n}\nfunction _forEachReverse(list, action) {\n if (list == null) {\n return;\n }\n for (let i = list.length - 1; i >= 0; i--) {\n action(list[i], i);\n }\n}\n\n// community-modules/core/src/utils/event.ts\nvar AG_GRID_STOP_PROPAGATION = \"__ag_Grid_Stop_Propagation\";\nvar PASSIVE_EVENTS = [\"touchstart\", \"touchend\", \"touchmove\", \"touchcancel\", \"scroll\"];\nvar supports = {};\nfunction _stopPropagationForAgGrid(event) {\n event[AG_GRID_STOP_PROPAGATION] = true;\n}\nfunction _isStopPropagationForAgGrid(event) {\n return event[AG_GRID_STOP_PROPAGATION] === true;\n}\nvar _isEventSupported = /* @__PURE__ */ (() => {\n const tags = {\n select: \"input\",\n change: \"input\",\n submit: \"form\",\n reset: \"form\",\n error: \"img\",\n load: \"img\",\n abort: \"img\"\n };\n const eventChecker = (eventName) => {\n if (typeof supports[eventName] === \"boolean\") {\n return supports[eventName];\n }\n const el = document.createElement(tags[eventName] || \"div\");\n eventName = \"on\" + eventName;\n return supports[eventName] = eventName in el;\n };\n return eventChecker;\n})();\nfunction _getCtrlForEventTarget(gos, eventTarget, type) {\n let sourceElement = eventTarget;\n while (sourceElement) {\n const renderedComp = gos.getDomData(sourceElement, type);\n if (renderedComp) {\n return renderedComp;\n }\n sourceElement = sourceElement.parentElement;\n }\n return null;\n}\nfunction _isElementInEventPath(element, event) {\n if (!event || !element) {\n return false;\n }\n return _getEventPath(event).indexOf(element) >= 0;\n}\nfunction _createEventPath(event) {\n const res = [];\n let pointer = event.target;\n while (pointer) {\n res.push(pointer);\n pointer = pointer.parentElement;\n }\n return res;\n}\nfunction _getEventPath(event) {\n const eventNoType = event;\n if (eventNoType.path) {\n return eventNoType.path;\n }\n if (eventNoType.composedPath) {\n return eventNoType.composedPath();\n }\n return _createEventPath(eventNoType);\n}\nfunction _addSafePassiveEventListener(frameworkOverrides, eElement, event, listener) {\n const isPassive = _includes(PASSIVE_EVENTS, event);\n const options = isPassive ? { passive: true } : void 0;\n if (frameworkOverrides && frameworkOverrides.addEventListener) {\n frameworkOverrides.addEventListener(eElement, event, listener, options);\n }\n}\n\n// community-modules/core/src/context/beanStub.ts\nvar BeanStub = class {\n constructor() {\n // not named context to allow children to use 'context' as a variable name\n this.destroyFunctions = [];\n this.destroyed = false;\n // for vue 3 - prevents Vue from trying to make this (and obviously any sub classes) from being reactive\n // prevents vue from creating proxies for created objects and prevents identity related issues\n this.__v_skip = true;\n this.propertyListenerId = 0;\n // Enable multiple grid properties to be updated together by the user but only trigger shared logic once.\n // Closely related to logic in ComponentUtil.ts\n this.lastChangeSetIdLookup = {};\n this.isAlive = () => !this.destroyed;\n }\n preWireBeans(beans) {\n this.gridId = beans.context.getGridId();\n this.frameworkOverrides = beans.frameworkOverrides;\n this.stubContext = beans.context;\n this.eventService = beans.eventService;\n this.gos = beans.gos;\n this.localeService = beans.localeService;\n }\n // this was a test constructor niall built, when active, it prints after 5 seconds all beans/components that are\n // not destroyed. to use, create a new grid, then api.destroy() before 5 seconds. then anything that gets printed\n // points to a bean or component that was not properly disposed of.\n // constructor() {\n // setTimeout(()=> {\n // if (this.isAlive()) {\n // let prototype: any = Object.getPrototypeOf(this);\n // const constructor: any = prototype.constructor;\n // const constructorString = constructor.toString();\n // const beanName = constructorString.substring(9, constructorString.indexOf(\"(\"));\n // console.log('is alive ' + beanName);\n // }\n // }, 5000);\n // }\n // CellComp and GridComp and override this because they get the FrameworkOverrides from the Beans bean\n getFrameworkOverrides() {\n return this.frameworkOverrides;\n }\n destroy() {\n for (let i = 0; i < this.destroyFunctions.length; i++) {\n this.destroyFunctions[i]();\n }\n this.destroyFunctions.length = 0;\n this.destroyed = true;\n this.dispatchLocalEvent({ type: \"destroyed\" });\n }\n // The typing of AgEventListener is not ideal, but it's the best we can do at the moment to enable\n // eventService to have the best typing at the expense of BeanStub local events\n /** Add a local event listener against this BeanStub */\n addEventListener(eventType, listener) {\n if (!this.localEventService) {\n this.localEventService = new LocalEventService();\n }\n this.localEventService.addEventListener(eventType, listener);\n }\n /** Remove a local event listener from this BeanStub */\n removeEventListener(eventType, listener) {\n if (this.localEventService) {\n this.localEventService.removeEventListener(eventType, listener);\n }\n }\n dispatchLocalEvent(event) {\n if (this.localEventService) {\n this.localEventService.dispatchEvent(event);\n }\n }\n addManagedElementListeners(object, handlers) {\n return this._setupListeners(object, handlers);\n }\n addManagedEventListeners(handlers) {\n return this._setupListeners(this.eventService, handlers);\n }\n addManagedListeners(object, handlers) {\n return this._setupListeners(object, handlers);\n }\n _setupListeners(object, handlers) {\n const destroyFuncs = [];\n for (const k in handlers) {\n const handler = handlers[k];\n if (handler) {\n destroyFuncs.push(this._setupListener(object, k, handler));\n }\n }\n return destroyFuncs;\n }\n _setupListener(object, event, listener) {\n if (this.destroyed) {\n return () => null;\n }\n if (object instanceof HTMLElement) {\n _addSafePassiveEventListener(this.getFrameworkOverrides(), object, event, listener);\n } else {\n object.addEventListener(event, listener);\n }\n const destroyFunc = () => {\n object.removeEventListener(event, listener);\n return null;\n };\n this.destroyFunctions.push(destroyFunc);\n return () => {\n destroyFunc();\n this.destroyFunctions = this.destroyFunctions.filter((fn) => fn !== destroyFunc);\n return null;\n };\n }\n /**\n * Setup a managed property listener for the given GridOption property.\n * However, stores the destroy function in the beanStub so that if this bean\n * is a component the destroy function will be called when the component is destroyed\n * as opposed to being cleaned up only when the GridOptionsService is destroyed.\n */\n setupGridOptionListener(event, listener) {\n this.gos.addPropertyEventListener(event, listener);\n const destroyFunc = () => {\n this.gos.removePropertyEventListener(event, listener);\n return null;\n };\n this.destroyFunctions.push(destroyFunc);\n return () => {\n destroyFunc();\n this.destroyFunctions = this.destroyFunctions.filter((fn) => fn !== destroyFunc);\n return null;\n };\n }\n /**\n * Setup a managed property listener for the given GridOption property.\n * @param event GridOption property to listen to changes for.\n * @param listener Listener to run when property value changes\n */\n addManagedPropertyListener(event, listener) {\n if (this.destroyed) {\n return () => null;\n }\n return this.setupGridOptionListener(event, listener);\n }\n /**\n * Setup managed property listeners for the given set of GridOption properties.\n * The listener will be run if any of the property changes but will only run once if\n * multiple of the properties change within the same framework lifecycle event.\n * Works on the basis that GridOptionsService updates all properties *before* any property change events are fired.\n * @param events Array of GridOption properties to listen for changes too.\n * @param listener Shared listener to run if any of the properties change\n */\n addManagedPropertyListeners(events, listener) {\n if (this.destroyed) {\n return;\n }\n const eventsKey = events.join(\"-\") + this.propertyListenerId++;\n const wrappedListener = (event) => {\n if (event.changeSet) {\n if (event.changeSet && event.changeSet.id === this.lastChangeSetIdLookup[eventsKey]) {\n return;\n }\n this.lastChangeSetIdLookup[eventsKey] = event.changeSet.id;\n }\n const propertiesChangeEvent = {\n type: \"gridPropertyChanged\",\n changeSet: event.changeSet,\n source: event.source\n };\n listener(propertiesChangeEvent);\n };\n events.forEach((event) => this.setupGridOptionListener(event, wrappedListener));\n }\n addDestroyFunc(func) {\n if (this.isAlive()) {\n this.destroyFunctions.push(func);\n } else {\n func();\n }\n }\n createManagedBean(bean, context) {\n const res = this.createBean(bean, context);\n this.addDestroyFunc(this.destroyBean.bind(this, bean, context));\n return res;\n }\n createBean(bean, context, afterPreCreateCallback) {\n return (context || this.stubContext).createBean(bean, afterPreCreateCallback);\n }\n /**\n * Destroys a bean and returns undefined to support destruction and clean up in a single line.\n * this.dateComp = this.context.destroyBean(this.dateComp);\n */\n destroyBean(bean, context) {\n return (context || this.stubContext).destroyBean(bean);\n }\n /**\n * Destroys an array of beans and returns an empty array to support destruction and clean up in a single line.\n * this.dateComps = this.context.destroyBeans(this.dateComps);\n */\n destroyBeans(beans, context) {\n return (context || this.stubContext).destroyBeans(beans);\n }\n};\n\n// community-modules/core/src/misc/frameworkEventListenerService.ts\nvar FrameworkEventListenerService = class {\n constructor(frameworkOverrides) {\n this.frameworkOverrides = frameworkOverrides;\n // Map from user listener to wrapped listener so we can remove listener provided by user\n this.wrappedListeners = /* @__PURE__ */ new Map();\n this.wrappedGlobalListeners = /* @__PURE__ */ new Map();\n }\n wrap(userListener) {\n let listener = userListener;\n if (this.frameworkOverrides.shouldWrapOutgoing) {\n listener = (event) => {\n this.frameworkOverrides.wrapOutgoing(() => userListener(event));\n };\n this.wrappedListeners.set(userListener, listener);\n }\n return listener;\n }\n wrapGlobal(userListener) {\n let listener = userListener;\n if (this.frameworkOverrides.shouldWrapOutgoing) {\n listener = (eventType, event) => {\n this.frameworkOverrides.wrapOutgoing(() => userListener(eventType, event));\n };\n this.wrappedGlobalListeners.set(userListener, listener);\n }\n return listener;\n }\n unwrap(userListener) {\n return this.wrappedListeners.get(userListener) ?? userListener;\n }\n unwrapGlobal(userListener) {\n return this.wrappedGlobalListeners.get(userListener) ?? userListener;\n }\n};\n\n// community-modules/core/src/utils/generic.ts\nfunction _makeNull(value) {\n if (value == null || value === \"\") {\n return null;\n }\n return value;\n}\nfunction _exists(value, allowEmptyString = false) {\n return value != null && (value !== \"\" || allowEmptyString);\n}\nfunction _missing(value) {\n return !_exists(value);\n}\nfunction _missingOrEmpty(value) {\n return value == null || value.length === 0;\n}\nfunction _toStringOrNull(value) {\n return value != null && typeof value.toString === \"function\" ? value.toString() : null;\n}\nfunction _attrToNumber(value) {\n if (value === void 0) {\n return;\n }\n if (value === null || value === \"\") {\n return null;\n }\n if (typeof value === \"number\") {\n return isNaN(value) ? void 0 : value;\n }\n const valueParsed = parseInt(value, 10);\n return isNaN(valueParsed) ? void 0 : valueParsed;\n}\nfunction _attrToBoolean(value) {\n if (value === void 0) {\n return;\n }\n if (value === null || value === \"\") {\n return false;\n }\n return toBoolean(value);\n}\nfunction toBoolean(value) {\n if (typeof value === \"boolean\") {\n return value;\n }\n if (typeof value === \"string\") {\n return value.toUpperCase() === \"TRUE\" || value == \"\";\n }\n return false;\n}\nfunction _jsonEquals(val1, val2) {\n const val1Json = val1 ? JSON.stringify(val1) : null;\n const val2Json = val2 ? JSON.stringify(val2) : null;\n return val1Json === val2Json;\n}\nfunction _defaultComparator(valueA, valueB, accentedCompare = false) {\n const valueAMissing = valueA == null;\n const valueBMissing = valueB == null;\n if (valueA && valueA.toNumber) {\n valueA = valueA.toNumber();\n }\n if (valueB && valueB.toNumber) {\n valueB = valueB.toNumber();\n }\n if (valueAMissing && valueBMissing) {\n return 0;\n }\n if (valueAMissing) {\n return -1;\n }\n if (valueBMissing) {\n return 1;\n }\n function doQuickCompare(a, b) {\n return a > b ? 1 : a < b ? -1 : 0;\n }\n if (typeof valueA !== \"string\") {\n return doQuickCompare(valueA, valueB);\n }\n if (!accentedCompare) {\n return doQuickCompare(valueA, valueB);\n }\n try {\n return valueA.localeCompare(valueB);\n } catch (e) {\n return doQuickCompare(valueA, valueB);\n }\n}\nfunction _values(object) {\n if (object instanceof Set || object instanceof Map) {\n const arr = [];\n object.forEach((value) => arr.push(value));\n return arr;\n }\n return Object.values(object);\n}\n\n// community-modules/core/src/utils/object.ts\nvar SKIP_JS_BUILTINS = /* @__PURE__ */ new Set([\"__proto__\", \"constructor\", \"prototype\"]);\nfunction _iterateObject(object, callback) {\n if (object == null) {\n return;\n }\n if (Array.isArray(object)) {\n for (let i = 0; i < object.length; i++) {\n callback(i.toString(), object[i]);\n }\n return;\n }\n for (const [key, value] of Object.entries(object)) {\n callback(key, value);\n }\n}\nfunction _cloneObject(object) {\n const copy = {};\n const keys = Object.keys(object);\n for (let i = 0; i < keys.length; i++) {\n if (SKIP_JS_BUILTINS.has(keys[i])) {\n continue;\n }\n const key = keys[i];\n const value = object[key];\n copy[key] = value;\n }\n return copy;\n}\nfunction _deepCloneDefinition(object, keysToSkip) {\n if (!object) {\n return;\n }\n const obj = object;\n const res = {};\n Object.keys(obj).forEach((key) => {\n if (keysToSkip && keysToSkip.indexOf(key) >= 0 || SKIP_JS_BUILTINS.has(key)) {\n return;\n }\n const value = obj[key];\n const sourceIsSimpleObject = _isNonNullObject(value) && value.constructor === Object;\n if (sourceIsSimpleObject) {\n res[key] = _deepCloneDefinition(value);\n } else {\n res[key] = value;\n }\n });\n return res;\n}\nfunction _getAllValuesInObject(obj) {\n if (!obj) {\n return [];\n }\n const anyObject = Object;\n if (typeof anyObject.values === \"function\") {\n return anyObject.values(obj);\n }\n const ret = [];\n for (const key in obj) {\n if (obj.hasOwnProperty(key) && obj.propertyIsEnumerable(key)) {\n ret.push(obj[key]);\n }\n }\n return ret;\n}\nfunction _mergeDeep(dest, source, copyUndefined = true, makeCopyOfSimpleObjects = false) {\n if (!_exists(source)) {\n return;\n }\n _iterateObject(source, (key, sourceValue) => {\n if (SKIP_JS_BUILTINS.has(key)) {\n return;\n }\n let destValue = dest[key];\n if (destValue === sourceValue) {\n return;\n }\n if (makeCopyOfSimpleObjects) {\n const objectIsDueToBeCopied = destValue == null && sourceValue != null;\n if (objectIsDueToBeCopied) {\n const sourceIsSimpleObject = typeof sourceValue === \"object\" && sourceValue.constructor === Object;\n const dontCopy = sourceIsSimpleObject;\n if (dontCopy) {\n destValue = {};\n dest[key] = destValue;\n }\n }\n }\n if (_isNonNullObject(sourceValue) && _isNonNullObject(destValue) && !Array.isArray(destValue)) {\n _mergeDeep(destValue, sourceValue, copyUndefined, makeCopyOfSimpleObjects);\n } else if (copyUndefined || sourceValue !== void 0) {\n dest[key] = sourceValue;\n }\n });\n}\nfunction _getValueUsingField(data, field, fieldContainsDots) {\n if (!field || !data) {\n return;\n }\n if (!fieldContainsDots) {\n return data[field];\n }\n const fields = field.split(\".\");\n let currentObject = data;\n for (let i = 0; i < fields.length; i++) {\n if (currentObject == null) {\n return void 0;\n }\n currentObject = currentObject[fields[i]];\n }\n return currentObject;\n}\nfunction _isNonNullObject(value) {\n return typeof value === \"object\" && value !== null;\n}\n\n// community-modules/core/src/entities/agColumn.ts\nvar COL_DEF_DEFAULTS = {\n resizable: true,\n sortable: true\n};\nvar instanceIdSequence = 0;\nfunction getNextColInstanceId() {\n return instanceIdSequence++;\n}\nfunction isColumn(col) {\n return col instanceof AgColumn;\n}\nvar DEFAULT_COLUMN_MIN_WIDTH = 20;\nvar AgColumn = class extends BeanStub {\n constructor(colDef, userProvidedColDef, colId, primary) {\n super();\n this.isColumn = true;\n // used by React (and possibly other frameworks) as key for rendering. also used to\n // identify old vs new columns for destroying cols when no longer used.\n this.instanceId = getNextColInstanceId();\n // The measured height of this column's header when autoHeaderHeight is enabled\n this.autoHeaderHeight = null;\n this.moving = false;\n this.menuVisible = false;\n this.lastLeftPinned = false;\n this.firstRightPinned = false;\n this.filterActive = false;\n this.columnEventService = new LocalEventService();\n this.tooltipEnabled = false;\n this.rowGroupActive = false;\n this.pivotActive = false;\n this.aggregationActive = false;\n this.colDef = colDef;\n this.userProvidedColDef = userProvidedColDef;\n this.colId = colId;\n this.primary = primary;\n this.setState(colDef);\n }\n wireBeans(beans) {\n this.columnHoverService = beans.columnHoverService;\n }\n getInstanceId() {\n return this.instanceId;\n }\n setState(colDef) {\n if (colDef.sort !== void 0) {\n if (colDef.sort === \"asc\" || colDef.sort === \"desc\") {\n this.sort = colDef.sort;\n }\n } else {\n if (colDef.initialSort === \"asc\" || colDef.initialSort === \"desc\") {\n this.sort = colDef.initialSort;\n }\n }\n const sortIndex = colDef.sortIndex;\n const initialSortIndex = colDef.initialSortIndex;\n if (sortIndex !== void 0) {\n if (sortIndex !== null) {\n this.sortIndex = sortIndex;\n }\n } else {\n if (initialSortIndex !== null) {\n this.sortIndex = initialSortIndex;\n }\n }\n const hide = colDef.hide;\n const initialHide = colDef.initialHide;\n if (hide !== void 0) {\n this.visible = !hide;\n } else {\n this.visible = !initialHide;\n }\n if (colDef.pinned !== void 0) {\n this.setPinned(colDef.pinned);\n } else {\n this.setPinned(colDef.initialPinned);\n }\n const flex = colDef.flex;\n const initialFlex = colDef.initialFlex;\n if (flex !== void 0) {\n this.flex = flex;\n } else if (initialFlex !== void 0) {\n this.flex = initialFlex;\n }\n }\n // gets called when user provides an alternative colDef, eg\n setColDef(colDef, userProvidedColDef, source) {\n this.colDef = colDef;\n this.userProvidedColDef = userProvidedColDef;\n this.initMinAndMaxWidths();\n this.initDotNotation();\n this.initTooltip();\n this.columnEventService.dispatchEvent(this.createColumnEvent(\"colDefChanged\", source));\n }\n getUserProvidedColDef() {\n return this.userProvidedColDef;\n }\n setParent(parent) {\n this.parent = parent;\n }\n getParent() {\n return this.parent;\n }\n setOriginalParent(originalParent) {\n this.originalParent = originalParent;\n }\n getOriginalParent() {\n return this.originalParent;\n }\n // this is done after constructor as it uses gridOptionsService\n postConstruct() {\n this.initMinAndMaxWidths();\n this.resetActualWidth(\"gridInitializing\");\n this.initDotNotation();\n this.initTooltip();\n }\n initDotNotation() {\n const suppressDotNotation = this.gos.get(\"suppressFieldDotNotation\");\n this.fieldContainsDots = _exists(this.colDef.field) && this.colDef.field.indexOf(\".\") >= 0 && !suppressDotNotation;\n this.tooltipFieldContainsDots = _exists(this.colDef.tooltipField) && this.colDef.tooltipField.indexOf(\".\") >= 0 && !suppressDotNotation;\n }\n initMinAndMaxWidths() {\n const colDef = this.colDef;\n this.minWidth = colDef.minWidth ?? DEFAULT_COLUMN_MIN_WIDTH;\n this.maxWidth = colDef.maxWidth ?? Number.MAX_SAFE_INTEGER;\n }\n initTooltip() {\n this.tooltipEnabled = _exists(this.colDef.tooltipField) || _exists(this.colDef.tooltipValueGetter) || _exists(this.colDef.tooltipComponent);\n }\n resetActualWidth(source) {\n const initialWidth = this.calculateColInitialWidth(this.colDef);\n this.setActualWidth(initialWidth, source, true);\n }\n calculateColInitialWidth(colDef) {\n let width;\n const colDefWidth = _attrToNumber(colDef.width);\n const colDefInitialWidth = _attrToNumber(colDef.initialWidth);\n if (colDefWidth != null) {\n width = colDefWidth;\n } else if (colDefInitialWidth != null) {\n width = colDefInitialWidth;\n } else {\n width = 200;\n }\n return Math.max(Math.min(width, this.maxWidth), this.minWidth);\n }\n isEmptyGroup() {\n return false;\n }\n isRowGroupDisplayed(colId) {\n if (_missing(this.colDef) || _missing(this.colDef.showRowGroup)) {\n return false;\n }\n const showingAllGroups = this.colDef.showRowGroup === true;\n const showingThisGroup = this.colDef.showRowGroup === colId;\n return showingAllGroups || showingThisGroup;\n }\n isPrimary() {\n return this.primary;\n }\n isFilterAllowed() {\n const filterDefined = !!this.colDef.filter;\n return filterDefined;\n }\n isFieldContainsDots() {\n return this.fieldContainsDots;\n }\n isTooltipEnabled() {\n return this.tooltipEnabled;\n }\n isTooltipFieldContainsDots() {\n return this.tooltipFieldContainsDots;\n }\n addEventListener(eventType, userListener) {\n if (this.frameworkOverrides.shouldWrapOutgoing && !this.frameworkEventListenerService) {\n this.columnEventService.setFrameworkOverrides(this.frameworkOverrides);\n this.frameworkEventListenerService = new FrameworkEventListenerService(this.frameworkOverrides);\n }\n const listener = this.frameworkEventListenerService?.wrap(userListener) ?? userListener;\n this.columnEventService.addEventListener(eventType, listener);\n }\n removeEventListener(eventType, userListener) {\n const listener = this.frameworkEventListenerService?.unwrap(userListener) ?? userListener;\n this.columnEventService.removeEventListener(eventType, listener);\n }\n createColumnFunctionCallbackParams(rowNode) {\n return this.gos.addGridCommonParams({\n node: rowNode,\n data: rowNode.data,\n column: this,\n colDef: this.colDef\n });\n }\n isSuppressNavigable(rowNode) {\n if (typeof this.colDef.suppressNavigable === \"boolean\") {\n return this.colDef.suppressNavigable;\n }\n if (typeof this.colDef.suppressNavigable === \"function\") {\n const params = this.createColumnFunctionCallbackParams(rowNode);\n const userFunc = this.colDef.suppressNavigable;\n return userFunc(params);\n }\n return false;\n }\n isCellEditable(rowNode) {\n if (rowNode.group && !this.gos.get(\"enableGroupEdit\")) {\n return false;\n }\n return this.isColumnFunc(rowNode, this.colDef.editable);\n }\n isSuppressFillHandle() {\n return !!this.colDef.suppressFillHandle;\n }\n isAutoHeight() {\n return !!this.colDef.autoHeight;\n }\n isAutoHeaderHeight() {\n return !!this.colDef.autoHeaderHeight;\n }\n isRowDrag(rowNode) {\n return this.isColumnFunc(rowNode, this.colDef.rowDrag);\n }\n isDndSource(rowNode) {\n return this.isColumnFunc(rowNode, this.colDef.dndSource);\n }\n isCellCheckboxSelection(rowNode) {\n return this.isColumnFunc(rowNode, this.colDef.checkboxSelection);\n }\n isSuppressPaste(rowNode) {\n return this.isColumnFunc(rowNode, this.colDef ? this.colDef.suppressPaste : null);\n }\n isResizable() {\n return !!this.getColDefValue(\"resizable\");\n }\n /** Get value from ColDef or default if it exists. */\n getColDefValue(key) {\n return this.colDef[key] ?? COL_DEF_DEFAULTS[key];\n }\n isColumnFunc(rowNode, value) {\n if (typeof value === \"boolean\") {\n return value;\n }\n if (typeof value === \"function\") {\n const params = this.createColumnFunctionCallbackParams(rowNode);\n const editableFunc = value;\n return editableFunc(params);\n }\n return false;\n }\n setMoving(moving, source) {\n this.moving = moving;\n this.columnEventService.dispatchEvent(this.createColumnEvent(\"movingChanged\", source));\n }\n createColumnEvent(type, source) {\n return this.gos.addGridCommonParams({\n type,\n column: this,\n columns: [this],\n source\n });\n }\n isMoving() {\n return this.moving;\n }\n getSort() {\n return this.sort;\n }\n setSort(sort, source) {\n if (this.sort !== sort) {\n this.sort = sort;\n this.columnEventService.dispatchEvent(this.createColumnEvent(\"sortChanged\", source));\n }\n this.dispatchStateUpdatedEvent(\"sort\");\n }\n isSortable() {\n return !!this.getColDefValue(\"sortable\");\n }\n /** @deprecated v32 use col.getSort() === 'asc */\n isSortAscending() {\n return this.sort === \"asc\";\n }\n /** @deprecated v32 use col.getSort() === 'desc */\n isSortDescending() {\n return this.sort === \"desc\";\n }\n /** @deprecated v32 use col.getSort() === undefined */\n isSortNone() {\n return _missing(this.sort);\n }\n /** @deprecated v32 use col.getSort() !== undefined */\n isSorting() {\n return _exists(this.sort);\n }\n getSortIndex() {\n return this.sortIndex;\n }\n setSortIndex(sortOrder) {\n this.sortIndex = sortOrder;\n this.dispatchStateUpdatedEvent(\"sortIndex\");\n }\n setMenuVisible(visible, source) {\n if (this.menuVisible !== visible) {\n this.menuVisible = visible;\n this.columnEventService.dispatchEvent(this.createColumnEvent(\"menuVisibleChanged\", source));\n }\n }\n isMenuVisible() {\n return this.menuVisible;\n }\n setAggFunc(aggFunc) {\n this.aggFunc = aggFunc;\n this.dispatchStateUpdatedEvent(\"aggFunc\");\n }\n getAggFunc() {\n return this.aggFunc;\n }\n getLeft() {\n return this.left;\n }\n getOldLeft() {\n return this.oldLeft;\n }\n getRight() {\n return this.left + this.actualWidth;\n }\n setLeft(left, source) {\n this.oldLeft = this.left;\n if (this.left !== left) {\n this.left = left;\n this.columnEventService.dispatchEvent(this.createColumnEvent(\"leftChanged\", source));\n }\n }\n isFilterActive() {\n return this.filterActive;\n }\n // additionalEventAttributes is used by provided simple floating filter, so it can add 'floatingFilter=true' to the event\n setFilterActive(active, source, additionalEventAttributes) {\n if (this.filterActive !== active) {\n this.filterActive = active;\n this.columnEventService.dispatchEvent(this.createColumnEvent(\"filterActiveChanged\", source));\n }\n const filterChangedEvent = this.createColumnEvent(\"filterChanged\", source);\n if (additionalEventAttributes) {\n _mergeDeep(filterChangedEvent, additionalEventAttributes);\n }\n this.columnEventService.dispatchEvent(filterChangedEvent);\n }\n isHovered() {\n return this.columnHoverService.isHovered(this);\n }\n setPinned(pinned) {\n if (pinned === true || pinned === \"left\") {\n this.pinned = \"left\";\n } else if (pinned === \"right\") {\n this.pinned = \"right\";\n } else {\n this.pinned = null;\n }\n this.dispatchStateUpdatedEvent(\"pinned\");\n }\n setFirstRightPinned(firstRightPinned, source) {\n if (this.firstRightPinned !== firstRightPinned) {\n this.firstRightPinned = firstRightPinned;\n this.columnEventService.dispatchEvent(this.createColumnEvent(\"firstRightPinnedChanged\", source));\n }\n }\n setLastLeftPinned(lastLeftPinned, source) {\n if (this.lastLeftPinned !== lastLeftPinned) {\n this.lastLeftPinned = lastLeftPinned;\n this.columnEventService.dispatchEvent(this.createColumnEvent(\"lastLeftPinnedChanged\", source));\n }\n }\n isFirstRightPinned() {\n return this.firstRightPinned;\n }\n isLastLeftPinned() {\n return this.lastLeftPinned;\n }\n isPinned() {\n return this.pinned === \"left\" || this.pinned === \"right\";\n }\n isPinnedLeft() {\n return this.pinned === \"left\";\n }\n isPinnedRight() {\n return this.pinned === \"right\";\n }\n getPinned() {\n return this.pinned;\n }\n setVisible(visible, source) {\n const newValue = visible === true;\n if (this.visible !== newValue) {\n this.visible = newValue;\n this.columnEventService.dispatchEvent(this.createColumnEvent(\"visibleChanged\", source));\n }\n this.dispatchStateUpdatedEvent(\"hide\");\n }\n isVisible() {\n return this.visible;\n }\n isSpanHeaderHeight() {\n const colDef = this.getColDef();\n return !colDef.suppressSpanHeaderHeight && !colDef.autoHeaderHeight;\n }\n getColumnGroupPaddingInfo() {\n let parent = this.getParent();\n if (!parent || !parent.isPadding()) {\n return { numberOfParents: 0, isSpanningTotal: false };\n }\n const numberOfParents = parent.getPaddingLevel() + 1;\n let isSpanningTotal = true;\n while (parent) {\n if (!parent.isPadding()) {\n isSpanningTotal = false;\n break;\n }\n parent = parent.getParent();\n }\n return { numberOfParents, isSpanningTotal };\n }\n getColDef() {\n return this.colDef;\n }\n getDefinition() {\n return this.colDef;\n }\n getColumnGroupShow() {\n return this.colDef.columnGroupShow;\n }\n getColId() {\n return this.colId;\n }\n getId() {\n return this.colId;\n }\n getUniqueId() {\n return this.colId;\n }\n getActualWidth() {\n return this.actualWidth;\n }\n getAutoHeaderHeight() {\n return this.autoHeaderHeight;\n }\n /** Returns true if the header height has changed */\n setAutoHeaderHeight(height) {\n const changed = height !== this.autoHeaderHeight;\n this.autoHeaderHeight = height;\n return changed;\n }\n createBaseColDefParams(rowNode) {\n const params = this.gos.addGridCommonParams({\n node: rowNode,\n data: rowNode.data,\n colDef: this.colDef,\n column: this\n });\n return params;\n }\n getColSpan(rowNode) {\n if (_missing(this.colDef.colSpan)) {\n return 1;\n }\n const params = this.createBaseColDefParams(rowNode);\n const colSpan = this.colDef.colSpan(params);\n return Math.max(colSpan, 1);\n }\n getRowSpan(rowNode) {\n if (_missing(this.colDef.rowSpan)) {\n return 1;\n }\n const params = this.createBaseColDefParams(rowNode);\n const rowSpan = this.colDef.rowSpan(params);\n return Math.max(rowSpan, 1);\n }\n setActualWidth(actualWidth, source, silent = false) {\n actualWidth = Math.max(actualWidth, this.minWidth);\n actualWidth = Math.min(actualWidth, this.maxWidth);\n if (this.actualWidth !== actualWidth) {\n this.actualWidth = actualWidth;\n if (this.flex && source !== \"flex\" && source !== \"gridInitializing\") {\n this.flex = null;\n }\n if (!silent) {\n this.fireColumnWidthChangedEvent(source);\n }\n }\n this.dispatchStateUpdatedEvent(\"width\");\n }\n fireColumnWidthChangedEvent(source) {\n this.columnEventService.dispatchEvent(this.createColumnEvent(\"widthChanged\", source));\n }\n isGreaterThanMax(width) {\n return width > this.maxWidth;\n }\n getMinWidth() {\n return this.minWidth;\n }\n getMaxWidth() {\n return this.maxWidth;\n }\n getFlex() {\n return this.flex || 0;\n }\n // this method should only be used by the columnModel to\n // change flex when required by the applyColumnState method.\n setFlex(flex) {\n if (this.flex !== flex) {\n this.flex = flex;\n }\n this.dispatchStateUpdatedEvent(\"flex\");\n }\n setMinimum(source) {\n this.setActualWidth(this.minWidth, source);\n }\n setRowGroupActive(rowGroup, source) {\n if (this.rowGroupActive !== rowGroup) {\n this.rowGroupActive = rowGroup;\n this.columnEventService.dispatchEvent(this.createColumnEvent(\"columnRowGroupChanged\", source));\n }\n this.dispatchStateUpdatedEvent(\"rowGroup\");\n }\n isRowGroupActive() {\n return this.rowGroupActive;\n }\n setPivotActive(pivot, source) {\n if (this.pivotActive !== pivot) {\n this.pivotActive = pivot;\n this.columnEventService.dispatchEvent(this.createColumnEvent(\"columnPivotChanged\", source));\n }\n this.dispatchStateUpdatedEvent(\"pivot\");\n }\n isPivotActive() {\n return this.pivotActive;\n }\n isAnyFunctionActive() {\n return this.isPivotActive() || this.isRowGroupActive() || this.isValueActive();\n }\n isAnyFunctionAllowed() {\n return this.isAllowPivot() || this.isAllowRowGroup() || this.isAllowValue();\n }\n setValueActive(value, source) {\n if (this.aggregationActive !== value) {\n this.aggregationActive = value;\n this.columnEventService.dispatchEvent(this.createColumnEvent(\"columnValueChanged\", source));\n }\n }\n isValueActive() {\n return this.aggregationActive;\n }\n isAllowPivot() {\n return this.colDef.enablePivot === true;\n }\n isAllowValue() {\n return this.colDef.enableValue === true;\n }\n isAllowRowGroup() {\n return this.colDef.enableRowGroup === true;\n }\n dispatchStateUpdatedEvent(key) {\n this.columnEventService.dispatchEvent({\n type: \"columnStateUpdated\",\n key\n });\n }\n};\n\n// community-modules/core/src/entities/agProvidedColumnGroup.ts\nfunction isProvidedColumnGroup(col) {\n return col instanceof AgProvidedColumnGroup;\n}\nvar AgProvidedColumnGroup = class extends BeanStub {\n constructor(colGroupDef, groupId, padding, level) {\n super();\n this.isColumn = false;\n this.expandable = false;\n // used by React (and possibly other frameworks) as key for rendering. also used to\n // identify old vs new columns for destroying cols when no longer used.\n this.instanceId = getNextColInstanceId();\n this.expandableListenerRemoveCallback = null;\n this.colGroupDef = colGroupDef;\n this.groupId = groupId;\n this.expanded = !!colGroupDef && !!colGroupDef.openByDefault;\n this.padding = padding;\n this.level = level;\n }\n destroy() {\n if (this.expandableListenerRemoveCallback) {\n this.reset(null, void 0);\n }\n super.destroy();\n }\n reset(colGroupDef, level) {\n this.colGroupDef = colGroupDef;\n this.level = level;\n this.originalParent = null;\n if (this.expandableListenerRemoveCallback) {\n this.expandableListenerRemoveCallback();\n }\n this.children = void 0;\n this.expandable = void 0;\n }\n getInstanceId() {\n return this.instanceId;\n }\n setOriginalParent(originalParent) {\n this.originalParent = originalParent;\n }\n getOriginalParent() {\n return this.originalParent;\n }\n getLevel() {\n return this.level;\n }\n isVisible() {\n if (this.children) {\n return this.children.some((child) => child.isVisible());\n }\n return false;\n }\n isPadding() {\n return this.padding;\n }\n setExpanded(expanded) {\n this.expanded = expanded === void 0 ? false : expanded;\n this.dispatchLocalEvent({ type: \"expandedChanged\" });\n }\n isExpandable() {\n return this.expandable;\n }\n isExpanded() {\n return this.expanded;\n }\n getGroupId() {\n return this.groupId;\n }\n getId() {\n return this.getGroupId();\n }\n setChildren(children) {\n this.children = children;\n }\n getChildren() {\n return this.children;\n }\n getColGroupDef() {\n return this.colGroupDef;\n }\n getLeafColumns() {\n const result = [];\n this.addLeafColumns(result);\n return result;\n }\n addLeafColumns(leafColumns) {\n if (!this.children) {\n return;\n }\n this.children.forEach((child) => {\n if (isColumn(child)) {\n leafColumns.push(child);\n } else if (isProvidedColumnGroup(child)) {\n child.addLeafColumns(leafColumns);\n }\n });\n }\n getColumnGroupShow() {\n const colGroupDef = this.colGroupDef;\n if (!colGroupDef) {\n return;\n }\n return colGroupDef.columnGroupShow;\n }\n // need to check that this group has at least one col showing when both expanded and contracted.\n // if not, then we don't allow expanding and contracting on this group\n setupExpandable() {\n this.setExpandable();\n if (this.expandableListenerRemoveCallback) {\n this.expandableListenerRemoveCallback();\n }\n const listener = this.onColumnVisibilityChanged.bind(this);\n this.getLeafColumns().forEach((col) => col.addEventListener(\"visibleChanged\", listener));\n this.expandableListenerRemoveCallback = () => {\n this.getLeafColumns().forEach((col) => col.removeEventListener(\"visibleChanged\", listener));\n this.expandableListenerRemoveCallback = null;\n };\n }\n setExpandable() {\n if (this.isPadding()) {\n return;\n }\n let atLeastOneShowingWhenOpen = false;\n let atLeastOneShowingWhenClosed = false;\n let atLeastOneChangeable = false;\n const children = this.findChildrenRemovingPadding();\n for (let i = 0, j = children.length; i < j; i++) {\n const abstractColumn = children[i];\n if (!abstractColumn.isVisible()) {\n continue;\n }\n const headerGroupShow = abstractColumn.getColumnGroupShow();\n if (headerGroupShow === \"open\") {\n atLeastOneShowingWhenOpen = true;\n atLeastOneChangeable = true;\n } else if (headerGroupShow === \"closed\") {\n atLeastOneShowingWhenClosed = true;\n atLeastOneChangeable = true;\n } else {\n atLeastOneShowingWhenOpen = true;\n atLeastOneShowingWhenClosed = true;\n }\n }\n const expandable = atLeastOneShowingWhenOpen && atLeastOneShowingWhenClosed && atLeastOneChangeable;\n if (this.expandable !== expandable) {\n this.expandable = expandable;\n this.dispatchLocalEvent({ type: \"expandableChanged\" });\n }\n }\n findChildrenRemovingPadding() {\n const res = [];\n const process = (items) => {\n items.forEach((item) => {\n const skipBecausePadding = isProvidedColumnGroup(item) && item.isPadding();\n if (skipBecausePadding) {\n process(item.children);\n } else {\n res.push(item);\n }\n });\n };\n process(this.children);\n return res;\n }\n onColumnVisibilityChanged() {\n this.setExpandable();\n }\n};\n\n// community-modules/core/src/entities/defaultColumnTypes.ts\nvar DefaultColumnTypes = {\n numericColumn: {\n headerClass: \"ag-right-aligned-header\",\n cellClass: \"ag-right-aligned-cell\"\n },\n rightAligned: {\n headerClass: \"ag-right-aligned-header\",\n cellClass: \"ag-right-aligned-cell\"\n }\n};\n\n// community-modules/core/src/utils/function.ts\nvar doOnceFlags = {};\nfunction _doOnce(func, key) {\n if (doOnceFlags[key]) {\n return;\n }\n func();\n doOnceFlags[key] = true;\n}\nfunction _log(message, ...args) {\n console.log(\"AG Grid: \" + message, ...args);\n}\nfunction _warnOnce(msg, ...args) {\n _doOnce(() => console.warn(\"AG Grid: \" + msg, ...args), msg + args?.join(\"\"));\n}\nfunction _errorOnce(msg, ...args) {\n _doOnce(() => console.error(\"AG Grid: \" + msg, ...args), msg + args?.join(\"\"));\n}\nfunction _isFunction(val) {\n return !!(val && val.constructor && val.call && val.apply);\n}\nfunction _executeInAWhile(funcs) {\n _executeAfter(funcs, 400);\n}\nvar executeNextVMTurnFuncs = [];\nvar executeNextVMTurnPending = false;\nfunction _executeNextVMTurn(func) {\n executeNextVMTurnFuncs.push(func);\n if (executeNextVMTurnPending) {\n return;\n }\n executeNextVMTurnPending = true;\n window.setTimeout(() => {\n const funcsCopy = executeNextVMTurnFuncs.slice();\n executeNextVMTurnFuncs.length = 0;\n executeNextVMTurnPending = false;\n funcsCopy.forEach((func2) => func2());\n }, 0);\n}\nfunction _executeAfter(funcs, milliseconds = 0) {\n if (funcs.length > 0) {\n window.setTimeout(() => funcs.forEach((func) => func()), milliseconds);\n }\n}\nfunction _debounce(func, delay) {\n let timeout;\n return function(...args) {\n const context = this;\n window.clearTimeout(timeout);\n timeout = window.setTimeout(function() {\n func.apply(context, args);\n }, delay);\n };\n}\nfunction _throttle(func, wait) {\n let previousCall = 0;\n return function(...args) {\n const context = this;\n const currentCall = (/* @__PURE__ */ new Date()).getTime();\n if (currentCall - previousCall < wait) {\n return;\n }\n previousCall = currentCall;\n func.apply(context, args);\n };\n}\nfunction _waitUntil(condition, callback, timeout = 100, timeoutMessage) {\n const timeStamp = (/* @__PURE__ */ new Date()).getTime();\n let interval = null;\n let executed = false;\n const internalCallback = () => {\n const reachedTimeout = (/* @__PURE__ */ new Date()).getTime() - timeStamp > timeout;\n if (condition() || reachedTimeout) {\n callback();\n executed = true;\n if (interval != null) {\n window.clearInterval(interval);\n interval = null;\n }\n if (reachedTimeout && timeoutMessage) {\n _warnOnce(timeoutMessage);\n }\n }\n };\n internalCallback();\n if (!executed) {\n interval = window.setInterval(internalCallback, 10);\n }\n}\nfunction _compose(...fns) {\n return (arg) => fns.reduce((composed, f) => f(composed), arg);\n}\n\n// community-modules/core/src/columns/columnKeyCreator.ts\nvar ColumnKeyCreator = class {\n constructor() {\n this.existingKeys = {};\n }\n addExistingKeys(keys) {\n for (let i = 0; i < keys.length; i++) {\n this.existingKeys[keys[i]] = true;\n }\n }\n getUniqueKey(colId, colField) {\n colId = _toStringOrNull(colId);\n let count = 0;\n while (true) {\n let idToTry;\n if (colId) {\n idToTry = colId;\n if (count !== 0) {\n idToTry += \"_\" + count;\n }\n } else if (colField) {\n idToTry = colField;\n if (count !== 0) {\n idToTry += \"_\" + count;\n }\n } else {\n idToTry = count;\n }\n if (!this.existingKeys[idToTry]) {\n this.existingKeys[idToTry] = true;\n return String(idToTry);\n }\n count++;\n }\n }\n};\n\n// community-modules/core/src/columns/columnUtils.ts\nvar GROUP_AUTO_COLUMN_ID = \"ag-Grid-AutoColumn\";\nfunction getColumnsFromTree(rootColumns) {\n const result = [];\n const recursiveFindColumns = (childColumns) => {\n for (let i = 0; i < childColumns.length; i++) {\n const child = childColumns[i];\n if (isColumn(child)) {\n result.push(child);\n } else if (isProvidedColumnGroup(child)) {\n recursiveFindColumns(child.getChildren());\n }\n }\n };\n recursiveFindColumns(rootColumns);\n return result;\n}\nfunction getWidthOfColsInList(columnList) {\n return columnList.reduce((width, col) => width + col.getActualWidth(), 0);\n}\nfunction destroyColumnTree(context, oldTree, newTree) {\n const oldObjectsById = {};\n if (!oldTree) {\n return;\n }\n depthFirstOriginalTreeSearch(null, oldTree, (child) => {\n oldObjectsById[child.getInstanceId()] = child;\n });\n if (newTree) {\n depthFirstOriginalTreeSearch(null, newTree, (child) => {\n oldObjectsById[child.getInstanceId()] = null;\n });\n }\n const colsToDestroy = Object.values(oldObjectsById).filter((item) => item != null);\n context.destroyBeans(colsToDestroy);\n}\nfunction isColumnGroupAutoCol(col) {\n const colId = col.getId();\n return colId.startsWith(GROUP_AUTO_COLUMN_ID);\n}\nfunction convertColumnTypes(type) {\n let typeKeys = [];\n if (type instanceof Array) {\n const invalidArray = type.some((a) => typeof a !== \"string\");\n if (invalidArray) {\n _warnOnce(\"if colDef.type is supplied an array it should be of type 'string[]'\");\n } else {\n typeKeys = type;\n }\n } else if (typeof type === \"string\") {\n typeKeys = type.split(\",\");\n } else {\n _warnOnce(\"colDef.type should be of type 'string' | 'string[]'\");\n }\n return typeKeys;\n}\n\n// community-modules/core/src/columns/columnFactory.ts\nvar ColumnFactory = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"columnFactory\";\n }\n wireBeans(beans) {\n this.dataTypeService = beans.dataTypeService;\n }\n createColumnTree(defs, primaryColumns, existingTree, source) {\n const columnKeyCreator = new ColumnKeyCreator();\n const { existingCols, existingGroups, existingColKeys } = this.extractExistingTreeData(existingTree);\n columnKeyCreator.addExistingKeys(existingColKeys);\n const unbalancedTree = this.recursivelyCreateColumns(\n defs,\n 0,\n primaryColumns,\n existingCols,\n columnKeyCreator,\n existingGroups,\n source\n );\n const treeDept = this.findMaxDept(unbalancedTree, 0);\n const columnTree = this.balanceColumnTree(unbalancedTree, 0, treeDept, columnKeyCreator);\n const deptFirstCallback = (child, parent) => {\n if (isProvidedColumnGroup(child)) {\n child.setupExpandable();\n }\n child.setOriginalParent(parent);\n };\n depthFirstOriginalTreeSearch(null, columnTree, deptFirstCallback);\n return {\n columnTree,\n treeDept\n };\n }\n extractExistingTreeData(existingTree) {\n const existingCols = [];\n const existingGroups = [];\n const existingColKeys = [];\n if (existingTree) {\n depthFirstOriginalTreeSearch(null, existingTree, (item) => {\n if (isProvidedColumnGroup(item)) {\n const group = item;\n existingGroups.push(group);\n } else {\n const col = item;\n existingColKeys.push(col.getId());\n existingCols.push(col);\n }\n });\n }\n return { existingCols, existingGroups, existingColKeys };\n }\n createForAutoGroups(autoGroupCols, liveTree) {\n const tree = [];\n const dept = this.findDepth(liveTree);\n autoGroupCols.forEach((col) => {\n let nextChild = col;\n for (let i = dept - 1; i >= 0; i--) {\n const autoGroup = new AgProvidedColumnGroup(null, `FAKE_PATH_${col.getId()}}_${i}`, true, i);\n this.createBean(autoGroup);\n autoGroup.setChildren([nextChild]);\n nextChild.setOriginalParent(autoGroup);\n nextChild = autoGroup;\n }\n if (dept === 0) {\n col.setOriginalParent(null);\n }\n tree.push(nextChild);\n });\n return [tree, dept];\n }\n findDepth(balancedColumnTree) {\n let dept = 0;\n let pointer = balancedColumnTree;\n while (pointer && pointer[0] && isProvidedColumnGroup(pointer[0])) {\n dept++;\n pointer = pointer[0].getChildren();\n }\n return dept;\n }\n balanceColumnTree(unbalancedTree, currentDept, columnDept, columnKeyCreator) {\n const result = [];\n for (let i = 0; i < unbalancedTree.length; i++) {\n const child = unbalancedTree[i];\n if (isProvidedColumnGroup(child)) {\n const originalGroup = child;\n const newChildren = this.balanceColumnTree(\n originalGroup.getChildren(),\n currentDept + 1,\n columnDept,\n columnKeyCreator\n );\n originalGroup.setChildren(newChildren);\n result.push(originalGroup);\n } else {\n let firstPaddedGroup;\n let currentPaddedGroup;\n for (let j = columnDept - 1; j >= currentDept; j--) {\n const newColId = columnKeyCreator.getUniqueKey(null, null);\n const colGroupDefMerged = this.createMergedColGroupDef(null);\n const paddedGroup = new AgProvidedColumnGroup(colGroupDefMerged, newColId, true, currentDept);\n this.createBean(paddedGroup);\n if (currentPaddedGroup) {\n currentPaddedGroup.setChildren([paddedGroup]);\n }\n currentPaddedGroup = paddedGroup;\n if (!firstPaddedGroup) {\n firstPaddedGroup = currentPaddedGroup;\n }\n }\n if (firstPaddedGroup && currentPaddedGroup) {\n result.push(firstPaddedGroup);\n const hasGroups = unbalancedTree.some((leaf) => isProvidedColumnGroup(leaf));\n if (hasGroups) {\n currentPaddedGroup.setChildren([child]);\n continue;\n } else {\n currentPaddedGroup.setChildren(unbalancedTree);\n break;\n }\n }\n result.push(child);\n }\n }\n return result;\n }\n findMaxDept(treeChildren, dept) {\n let maxDeptThisLevel = dept;\n for (let i = 0; i < treeChildren.length; i++) {\n const abstractColumn = treeChildren[i];\n if (isProvidedColumnGroup(abstractColumn)) {\n const originalGroup = abstractColumn;\n const newDept = this.findMaxDept(originalGroup.getChildren(), dept + 1);\n if (maxDeptThisLevel < newDept) {\n maxDeptThisLevel = newDept;\n }\n }\n }\n return maxDeptThisLevel;\n }\n recursivelyCreateColumns(defs, level, primaryColumns, existingColsCopy, columnKeyCreator, existingGroups, source) {\n if (!defs)\n return [];\n const result = new Array(defs.length);\n for (let i = 0; i < result.length; i++) {\n const def = defs[i];\n if (this.isColumnGroup(def)) {\n result[i] = this.createColumnGroup(\n primaryColumns,\n def,\n level,\n existingColsCopy,\n columnKeyCreator,\n existingGroups,\n source\n );\n } else {\n result[i] = this.createColumn(\n primaryColumns,\n def,\n existingColsCopy,\n columnKeyCreator,\n source\n );\n }\n }\n return result;\n }\n createColumnGroup(primaryColumns, colGroupDef, level, existingColumns, columnKeyCreator, existingGroups, source) {\n const colGroupDefMerged = this.createMergedColGroupDef(colGroupDef);\n const groupId = columnKeyCreator.getUniqueKey(colGroupDefMerged.groupId || null, null);\n const providedGroup = new AgProvidedColumnGroup(colGroupDefMerged, groupId, false, level);\n this.createBean(providedGroup);\n const existingGroupAndIndex = this.findExistingGroup(colGroupDef, existingGroups);\n if (existingGroupAndIndex) {\n existingGroups.splice(existingGroupAndIndex.idx, 1);\n }\n const existingGroup = existingGroupAndIndex?.group;\n if (existingGroup) {\n providedGroup.setExpanded(existingGroup.isExpanded());\n }\n const children = this.recursivelyCreateColumns(\n colGroupDefMerged.children,\n level + 1,\n primaryColumns,\n existingColumns,\n columnKeyCreator,\n existingGroups,\n source\n );\n providedGroup.setChildren(children);\n return providedGroup;\n }\n createMergedColGroupDef(colGroupDef) {\n const colGroupDefMerged = {};\n Object.assign(colGroupDefMerged, this.gos.get(\"defaultColGroupDef\"));\n Object.assign(colGroupDefMerged, colGroupDef);\n return colGroupDefMerged;\n }\n createColumn(primaryColumns, colDef, existingColsCopy, columnKeyCreator, source) {\n const existingColAndIndex = this.findExistingColumn(colDef, existingColsCopy);\n if (existingColAndIndex) {\n existingColsCopy?.splice(existingColAndIndex.idx, 1);\n }\n let column = existingColAndIndex?.column;\n if (!column) {\n const colId = columnKeyCreator.getUniqueKey(colDef.colId, colDef.field);\n const colDefMerged = this.addColumnDefaultAndTypes(colDef, colId);\n column = new AgColumn(colDefMerged, colDef, colId, primaryColumns);\n this.createBean(column);\n } else {\n const colDefMerged = this.addColumnDefaultAndTypes(colDef, column.getColId());\n column.setColDef(colDefMerged, colDef, source);\n this.applyColumnState(column, colDefMerged, source);\n }\n this.dataTypeService?.addColumnListeners(column);\n return column;\n }\n applyColumnState(column, colDef, source) {\n const flex = _attrToNumber(colDef.flex);\n if (flex !== void 0) {\n column.setFlex(flex);\n }\n const noFlexThisCol = column.getFlex() <= 0;\n if (noFlexThisCol) {\n const width = _attrToNumber(colDef.width);\n if (width != null) {\n column.setActualWidth(width, source);\n } else {\n const widthBeforeUpdate = column.getActualWidth();\n column.setActualWidth(widthBeforeUpdate, source);\n }\n }\n if (colDef.sort !== void 0) {\n if (colDef.sort == \"asc\" || colDef.sort == \"desc\") {\n column.setSort(colDef.sort, source);\n } else {\n column.setSort(void 0, source);\n }\n }\n const sortIndex = _attrToNumber(colDef.sortIndex);\n if (sortIndex !== void 0) {\n column.setSortIndex(sortIndex);\n }\n const hide = _attrToBoolean(colDef.hide);\n if (hide !== void 0) {\n column.setVisible(!hide, source);\n }\n if (colDef.pinned !== void 0) {\n column.setPinned(colDef.pinned);\n }\n }\n findExistingColumn(newColDef, existingColsCopy) {\n if (!existingColsCopy)\n return void 0;\n for (let i = 0; i < existingColsCopy.length; i++) {\n const def = existingColsCopy[i].getUserProvidedColDef();\n if (!def)\n continue;\n const newHasId = newColDef.colId != null;\n if (newHasId) {\n if (existingColsCopy[i].getId() === newColDef.colId) {\n return { idx: i, column: existingColsCopy[i] };\n }\n continue;\n }\n const newHasField = newColDef.field != null;\n if (newHasField) {\n if (def.field === newColDef.field) {\n return { idx: i, column: existingColsCopy[i] };\n }\n continue;\n }\n if (def === newColDef) {\n return { idx: i, column: existingColsCopy[i] };\n }\n }\n return void 0;\n }\n findExistingGroup(newGroupDef, existingGroups) {\n const newHasId = newGroupDef.groupId != null;\n if (!newHasId) {\n return void 0;\n }\n for (let i = 0; i < existingGroups.length; i++) {\n const existingGroup = existingGroups[i];\n const existingDef = existingGroup.getColGroupDef();\n if (!existingDef) {\n continue;\n }\n if (existingGroup.getId() === newGroupDef.groupId) {\n return { idx: i, group: existingGroup };\n }\n }\n return void 0;\n }\n addColumnDefaultAndTypes(colDef, colId) {\n const res = {};\n const defaultColDef = this.gos.get(\"defaultColDef\");\n _mergeDeep(res, defaultColDef, false, true);\n const columnType = this.updateColDefAndGetColumnType(res, colDef, colId);\n if (columnType) {\n this.assignColumnTypes(columnType, res);\n }\n _mergeDeep(res, colDef, false, true);\n const autoGroupColDef = this.gos.get(\"autoGroupColumnDef\");\n const isSortingCoupled = this.gos.isColumnsSortingCoupledToGroup();\n if (colDef.rowGroup && autoGroupColDef && isSortingCoupled) {\n _mergeDeep(\n res,\n { sort: autoGroupColDef.sort, initialSort: autoGroupColDef.initialSort },\n false,\n true\n );\n }\n this.dataTypeService?.validateColDef(res);\n return res;\n }\n updateColDefAndGetColumnType(colDef, userColDef, colId) {\n const dataTypeDefinitionColumnType = this.dataTypeService?.updateColDefAndGetColumnType(\n colDef,\n userColDef,\n colId\n );\n const columnTypes = userColDef.type ?? dataTypeDefinitionColumnType ?? colDef.type;\n colDef.type = columnTypes;\n return columnTypes ? convertColumnTypes(columnTypes) : void 0;\n }\n assignColumnTypes(typeKeys, colDefMerged) {\n if (!typeKeys.length) {\n return;\n }\n const allColumnTypes = Object.assign({}, DefaultColumnTypes);\n const userTypes = this.gos.get(\"columnTypes\") || {};\n _iterateObject(userTypes, (key, value) => {\n if (key in allColumnTypes) {\n _warnOnce(`the column type '${key}' is a default column type and cannot be overridden.`);\n } else {\n const colType = value;\n if (colType.type) {\n _warnOnce(\n `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.`\n );\n }\n allColumnTypes[key] = value;\n }\n });\n typeKeys.forEach((t) => {\n const typeColDef = allColumnTypes[t.trim()];\n if (typeColDef) {\n _mergeDeep(colDefMerged, typeColDef, false, true);\n } else {\n _warnOnce(\"colDef.type '\" + t + \"' does not correspond to defined gridOptions.columnTypes\");\n }\n });\n }\n // if object has children, we assume it's a group\n isColumnGroup(abstractColDef) {\n return abstractColDef.children !== void 0;\n }\n};\nfunction depthFirstOriginalTreeSearch(parent, tree, callback) {\n if (!tree) {\n return;\n }\n for (let i = 0; i < tree.length; i++) {\n const child = tree[i];\n if (isProvidedColumnGroup(child)) {\n depthFirstOriginalTreeSearch(child, child.getChildren(), callback);\n }\n callback(child, parent);\n }\n}\n\n// community-modules/core/src/columns/columnModel.ts\nvar ColumnModel = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"columnModel\";\n // if pivotMode is on, however pivot results are NOT shown if no pivot columns are set\n this.pivotMode = false;\n this.autoHeightActiveAtLeastOnce = false;\n this.ready = false;\n this.changeEventsDispatching = false;\n // when we're waiting for cell data types to be inferred, we need to defer column resizing\n this.shouldQueueResizeOperations = false;\n this.resizeOperationQueue = [];\n }\n wireBeans(beans) {\n this.context = beans.context;\n this.columnFactory = beans.columnFactory;\n this.columnSizeService = beans.columnSizeService;\n this.visibleColsService = beans.visibleColsService;\n this.columnViewportService = beans.columnViewportService;\n this.pivotResultColsService = beans.pivotResultColsService;\n this.columnAnimationService = beans.columnAnimationService;\n this.autoColService = beans.autoColService;\n this.valueCache = beans.valueCache;\n this.columnDefFactory = beans.columnDefFactory;\n this.columnApplyStateService = beans.columnApplyStateService;\n this.columnGroupStateService = beans.columnGroupStateService;\n this.eventDispatcher = beans.columnEventDispatcher;\n this.columnMoveService = beans.columnMoveService;\n this.columnAutosizeService = beans.columnAutosizeService;\n this.funcColsService = beans.funcColsService;\n this.quickFilterService = beans.quickFilterService;\n this.showRowGroupColsService = beans.showRowGroupColsService;\n this.environment = beans.environment;\n }\n postConstruct() {\n const pivotMode = this.gos.get(\"pivotMode\");\n if (this.isPivotSettingAllowed(pivotMode)) {\n this.pivotMode = pivotMode;\n }\n this.addManagedPropertyListeners(\n [\"groupDisplayType\", \"treeData\", \"treeDataDisplayType\", \"groupHideOpenParents\"],\n (event) => this.refreshAll(convertSourceType(event.source))\n );\n this.addManagedPropertyListener(\n \"autoGroupColumnDef\",\n (event) => this.onAutoGroupColumnDefChanged(convertSourceType(event.source))\n );\n this.addManagedPropertyListeners(\n [\"defaultColDef\", \"columnTypes\", \"suppressFieldDotNotation\"],\n (event) => this.recreateColumnDefs(convertSourceType(event.source))\n );\n this.addManagedPropertyListener(\n \"pivotMode\",\n (event) => this.setPivotMode(this.gos.get(\"pivotMode\"), convertSourceType(event.source))\n );\n this.addManagedEventListeners({ firstDataRendered: () => this.onFirstDataRendered() });\n }\n // called from SyncService, when grid has finished initialising\n createColsFromColDefs(colsPreviouslyExisted, source) {\n const dispatchEventsFunc = colsPreviouslyExisted ? this.columnApplyStateService.compareColumnStatesAndDispatchEvents(source) : void 0;\n this.valueCache.expire();\n const oldCols = this.colDefCols && this.colDefCols.list;\n const oldTree = this.colDefCols && this.colDefCols.tree;\n const newTree = this.columnFactory.createColumnTree(this.colDefs, true, oldTree, source);\n destroyColumnTree(this.context, this.colDefCols?.tree, newTree.columnTree);\n const tree = newTree.columnTree;\n const treeDepth = newTree.treeDept;\n const list = getColumnsFromTree(tree);\n const map = {};\n list.forEach((col) => map[col.getId()] = col);\n this.colDefCols = { tree, treeDepth, list, map };\n this.funcColsService.extractCols(source, oldCols);\n this.ready = true;\n this.refreshCols();\n const maintainColOrder = colsPreviouslyExisted && !this.showingPivotResult && !this.gos.get(\"maintainColumnOrder\");\n if (maintainColOrder) {\n this.orderColsLikeColDefCols();\n }\n this.visibleColsService.refresh(source);\n this.columnViewportService.checkViewportColumns();\n this.eventDispatcher.everythingChanged(source);\n if (dispatchEventsFunc) {\n this.changeEventsDispatching = true;\n dispatchEventsFunc();\n this.changeEventsDispatching = false;\n }\n this.eventDispatcher.newColumnsLoaded(source);\n if (source === \"gridInitializing\") {\n this.columnSizeService.applyAutosizeStrategy();\n }\n }\n // called from: buildAutoGroupColumns (events 'groupDisplayType', 'treeData', 'treeDataDisplayType', 'groupHideOpenParents')\n // createColsFromColDefs (recreateColumnDefs, setColumnsDefs),\n // setPivotMode, applyColumnState,\n // functionColsService.setPrimaryColList, functionColsService.updatePrimaryColList,\n // pivotResultColsService.setPivotResultCols\n refreshCols() {\n if (!this.colDefCols) {\n return;\n }\n const prevColTree = this.cols?.tree;\n this.saveColOrder();\n this.selectCols();\n this.createAutoCols();\n this.addAutoCols();\n this.restoreColOrder();\n this.positionLockedCols();\n this.showRowGroupColsService?.refresh();\n this.quickFilterService?.refreshQuickFilterCols();\n this.setColSpanActive();\n this.setAutoHeightActive();\n this.visibleColsService.clear();\n this.columnViewportService.clear();\n const dispatchChangedEvent = !_areEqual(prevColTree, this.cols.tree);\n if (dispatchChangedEvent) {\n this.eventDispatcher.gridColumns();\n }\n }\n selectCols() {\n const pivotResultCols = this.pivotResultColsService.getPivotResultCols();\n this.showingPivotResult = pivotResultCols != null;\n if (pivotResultCols) {\n const { map, list, tree, treeDepth } = pivotResultCols;\n this.cols = {\n list: list.slice(),\n map: { ...map },\n tree: tree.slice(),\n treeDepth\n };\n const hasSameColumns = pivotResultCols.list.some((col) => this.cols?.map[col.getColId()] !== void 0);\n if (!hasSameColumns) {\n this.lastPivotOrder = null;\n }\n } else {\n const { map, list, tree, treeDepth } = this.colDefCols;\n this.cols = {\n list: list.slice(),\n map: { ...map },\n tree: tree.slice(),\n treeDepth\n };\n }\n }\n getColsToShow() {\n const showAutoGroupAndValuesOnly = this.isPivotMode() && !this.isShowingPivotResult();\n const valueColumns = this.funcColsService.getValueColumns();\n const res = this.cols.list.filter((col) => {\n const isAutoGroupCol = isColumnGroupAutoCol(col);\n if (showAutoGroupAndValuesOnly) {\n const isValueCol = valueColumns && _includes(valueColumns, col);\n return isAutoGroupCol || isValueCol;\n } else {\n return isAutoGroupCol || col.isVisible();\n }\n });\n return res;\n }\n addAutoCols() {\n if (this.autoCols == null) {\n return;\n }\n this.cols.list = this.autoCols.list.concat(this.cols.list);\n this.cols.tree = this.autoCols.tree.concat(this.cols.tree);\n updateColsMap(this.cols);\n }\n createAutoCols() {\n const groupFullWidthRow = this.gos.isGroupUseEntireRow(this.pivotMode);\n const suppressAutoColumn = this.pivotMode ? this.gos.get(\"pivotSuppressAutoColumn\") : this.isSuppressAutoCol();\n const rowGroupCols = this.funcColsService.getRowGroupColumns();\n const groupingActive = rowGroupCols.length > 0 || this.gos.get(\"treeData\");\n const noAutoCols = !groupingActive || suppressAutoColumn || groupFullWidthRow;\n const destroyPrevious = () => {\n if (this.autoCols) {\n destroyColumnTree(this.context, this.autoCols.tree);\n this.autoCols = null;\n }\n };\n if (noAutoCols || !this.autoColService) {\n destroyPrevious();\n return;\n }\n const list = this.autoColService.createAutoCols(rowGroupCols) ?? [];\n const autoColsSame = areColIdsEqual(list, this.autoCols?.list || null);\n const newTreeDepth = this.cols.treeDepth;\n const oldTreeDepth = this.autoCols ? this.autoCols.treeDepth : -1;\n const treeDeptSame = oldTreeDepth == newTreeDepth;\n if (autoColsSame && treeDeptSame) {\n return;\n }\n destroyPrevious();\n const [tree, treeDepth] = this.columnFactory.createForAutoGroups(list, this.cols?.tree);\n this.autoCols = {\n list,\n tree,\n treeDepth,\n map: {}\n };\n const putAutocolsFirstInList = (cols) => {\n if (!cols) {\n return null;\n }\n const colsFiltered = cols.filter((col) => !isColumnGroupAutoCol(col));\n return [...list, ...colsFiltered];\n };\n this.lastOrder = putAutocolsFirstInList(this.lastOrder);\n this.lastPivotOrder = putAutocolsFirstInList(this.lastPivotOrder);\n }\n // on events 'groupDisplayType', 'treeData', 'treeDataDisplayType', 'groupHideOpenParents'\n refreshAll(source) {\n if (!this.isReady()) {\n return;\n }\n this.refreshCols();\n this.visibleColsService.refresh(source);\n }\n setColsVisible(keys, visible = false, source) {\n this.columnApplyStateService.applyColumnState(\n {\n state: keys.map((key) => ({\n colId: typeof key === \"string\" ? key : key.getColId(),\n hide: !visible\n }))\n },\n source\n );\n }\n setColsPinned(keys, pinned, source) {\n if (!this.cols) {\n return;\n }\n if (_missingOrEmpty(keys)) {\n return;\n }\n if (this.gos.isDomLayout(\"print\")) {\n _warnOnce(`Changing the column pinning status is not allowed with domLayout='print'`);\n return;\n }\n this.columnAnimationService.start();\n let actualPinned;\n if (pinned === true || pinned === \"left\") {\n actualPinned = \"left\";\n } else if (pinned === \"right\") {\n actualPinned = \"right\";\n } else {\n actualPinned = null;\n }\n const updatedCols = [];\n keys.forEach((key) => {\n if (!key) {\n return;\n }\n const column = this.getCol(key);\n if (!column) {\n return;\n }\n if (column.getPinned() !== actualPinned) {\n column.setPinned(actualPinned);\n updatedCols.push(column);\n }\n });\n if (updatedCols.length) {\n this.visibleColsService.refresh(source);\n this.eventDispatcher.columnPinned(updatedCols, source);\n }\n this.columnAnimationService.finish();\n }\n // called by headerRenderer - when a header is opened or closed\n setColumnGroupOpened(key, newValue, source) {\n let keyAsString;\n if (isProvidedColumnGroup(key)) {\n keyAsString = key.getId();\n } else {\n keyAsString = key || \"\";\n }\n this.columnGroupStateService.setColumnGroupState([{ groupId: keyAsString, open: newValue }], source);\n }\n getProvidedColGroup(key) {\n let res = null;\n depthFirstOriginalTreeSearch(null, this.cols?.tree, (node) => {\n if (isProvidedColumnGroup(node)) {\n if (node.getId() === key) {\n res = node;\n }\n }\n });\n return res;\n }\n isColGroupLocked(column) {\n const groupLockGroupColumns = this.gos.get(\"groupLockGroupColumns\");\n if (!column.isRowGroupActive() || groupLockGroupColumns === 0) {\n return false;\n }\n if (groupLockGroupColumns === -1) {\n return true;\n }\n const rowGroupCols = this.funcColsService.getRowGroupColumns();\n const colIndex = rowGroupCols.findIndex((groupCol) => groupCol.getColId() === column.getColId());\n return groupLockGroupColumns > colIndex;\n }\n isSuppressAutoCol() {\n const groupDisplayType = this.gos.get(\"groupDisplayType\");\n const isCustomRowGroups = groupDisplayType === \"custom\";\n if (isCustomRowGroups) {\n return true;\n }\n const treeDataDisplayType = this.gos.get(\"treeDataDisplayType\");\n return treeDataDisplayType === \"custom\";\n }\n setAutoHeightActive() {\n this.autoHeightActive = this.cols.list.some((col) => col.isAutoHeight());\n if (this.autoHeightActive) {\n this.autoHeightActiveAtLeastOnce = true;\n const supportedRowModel = this.gos.isRowModelType(\"clientSide\") || this.gos.isRowModelType(\"serverSide\");\n if (!supportedRowModel) {\n _warnOnce(\"autoHeight columns only work with Client Side Row Model and Server Side Row Model.\");\n }\n }\n }\n restoreColOrder() {\n const lastOrder = this.showingPivotResult ? this.lastPivotOrder : this.lastOrder;\n if (!lastOrder) {\n return;\n }\n const lastOrderMapped = new Map(lastOrder.map((col, index) => [col, index]));\n const noColsFound = !this.cols.list.some((col) => lastOrderMapped.has(col));\n if (noColsFound) {\n return;\n }\n const colsMap = new Map(this.cols.list.map((col) => [col, true]));\n const lastOrderFiltered = lastOrder.filter((col) => colsMap.has(col));\n const lastOrderFilteredMap = new Map(lastOrderFiltered.map((col) => [col, true]));\n const missingFromLastOrder = this.cols.list.filter((col) => !lastOrderFilteredMap.has(col));\n const res = lastOrderFiltered.slice();\n missingFromLastOrder.forEach((newCol) => {\n let parent = newCol.getOriginalParent();\n if (!parent) {\n res.push(newCol);\n return;\n }\n const siblings = [];\n while (!siblings.length && parent) {\n const leafCols = parent.getLeafColumns();\n leafCols.forEach((leafCol) => {\n const presentInNewCols = res.indexOf(leafCol) >= 0;\n const notYetInSiblings = siblings.indexOf(leafCol) < 0;\n if (presentInNewCols && notYetInSiblings) {\n siblings.push(leafCol);\n }\n });\n parent = parent.getOriginalParent();\n }\n if (!siblings.length) {\n res.push(newCol);\n return;\n }\n const indexes = siblings.map((col) => res.indexOf(col));\n const lastIndex = Math.max(...indexes);\n _insertIntoArray(res, newCol, lastIndex + 1);\n });\n this.cols.list = res;\n }\n orderColsLikeColDefCols() {\n if (!this.colDefCols || !this.cols) {\n return;\n }\n const colsOrdered = this.colDefCols.list.filter((col) => this.cols.list.indexOf(col) >= 0);\n const otherCols = this.cols.list.filter((col) => colsOrdered.indexOf(col) < 0);\n this.cols.list = [...otherCols, ...colsOrdered];\n this.cols.list = this.columnMoveService.placeLockedColumns(this.cols.list);\n }\n sortColsLikeKeys(colIds) {\n if (this.cols == null) {\n return;\n }\n let newOrder = [];\n const processedColIds = {};\n colIds.forEach((colId) => {\n if (processedColIds[colId]) {\n return;\n }\n const col = this.cols.map[colId];\n if (col) {\n newOrder.push(col);\n processedColIds[colId] = true;\n }\n });\n let autoGroupInsertIndex = 0;\n this.cols.list.forEach((col) => {\n const colId = col.getColId();\n const alreadyProcessed = processedColIds[colId] != null;\n if (alreadyProcessed) {\n return;\n }\n const isAutoGroupCol = colId.startsWith(GROUP_AUTO_COLUMN_ID);\n if (isAutoGroupCol) {\n _insertIntoArray(newOrder, col, autoGroupInsertIndex++);\n } else {\n newOrder.push(col);\n }\n });\n newOrder = this.columnMoveService.placeLockedColumns(newOrder);\n if (!this.columnMoveService.doesMovePassMarryChildren(newOrder)) {\n _warnOnce(\n \"Applying column order broke a group where columns should be married together. Applying new order has been discarded.\"\n );\n return;\n }\n this.cols.list = newOrder;\n }\n // returns the provided cols sorted in same order as they appear in this.cols, eg if this.cols\n // contains [a,b,c,d,e] and col passed is [e,a] then the passed cols are sorted into [a,e]\n sortColsLikeCols(cols) {\n if (!cols || cols.length <= 1) {\n return;\n }\n const notAllColsPresent = cols.filter((c) => this.cols.list.indexOf(c) < 0).length > 0;\n if (notAllColsPresent) {\n return;\n }\n cols.sort((a, b) => {\n const indexA = this.cols.list.indexOf(a);\n const indexB = this.cols.list.indexOf(b);\n return indexA - indexB;\n });\n }\n resetColDefIntoCol(column, source) {\n const userColDef = column.getUserProvidedColDef();\n if (!userColDef) {\n return false;\n }\n const newColDef = this.columnFactory.addColumnDefaultAndTypes(userColDef, column.getColId());\n column.setColDef(newColDef, userColDef, source);\n return true;\n }\n queueResizeOperations() {\n this.shouldQueueResizeOperations = true;\n }\n isShouldQueueResizeOperations() {\n return this.shouldQueueResizeOperations;\n }\n processResizeOperations() {\n this.shouldQueueResizeOperations = false;\n this.resizeOperationQueue.forEach((resizeOperation) => resizeOperation());\n this.resizeOperationQueue = [];\n }\n pushResizeOperation(func) {\n this.resizeOperationQueue.push(func);\n }\n moveInCols(movedColumns, toIndex, source) {\n _moveInArray(this.cols?.list, movedColumns, toIndex);\n this.visibleColsService.refresh(source);\n }\n positionLockedCols() {\n this.cols.list = this.columnMoveService.placeLockedColumns(this.cols.list);\n }\n saveColOrder() {\n if (this.showingPivotResult) {\n this.lastPivotOrder = this.cols?.list;\n } else {\n this.lastOrder = this.cols?.list;\n }\n }\n getColumnDefs() {\n if (!this.colDefCols) {\n return;\n }\n const cols = this.colDefCols.list.slice();\n if (this.showingPivotResult) {\n cols.sort((a, b) => this.lastOrder.indexOf(a) - this.lastOrder.indexOf(b));\n } else if (this.lastOrder) {\n cols.sort((a, b) => this.cols.list.indexOf(a) - this.cols.list.indexOf(b));\n }\n const rowGroupColumns = this.funcColsService.getRowGroupColumns();\n const pivotColumns = this.funcColsService.getPivotColumns();\n return this.columnDefFactory.buildColumnDefs(cols, rowGroupColumns, pivotColumns);\n }\n isShowingPivotResult() {\n return this.showingPivotResult;\n }\n // called by clientSideRowModel.refreshModel\n isChangeEventsDispatching() {\n return this.changeEventsDispatching;\n }\n isColSpanActive() {\n return this.colSpanActive;\n }\n // used by Column Tool Panel\n isProvidedColGroupsPresent() {\n return this.colDefCols?.treeDepth > 0;\n }\n setColSpanActive() {\n this.colSpanActive = this.cols.list.some((col) => col.getColDef().colSpan != null);\n }\n isAutoRowHeightActive() {\n return this.autoHeightActive;\n }\n wasAutoRowHeightEverActive() {\n return this.autoHeightActiveAtLeastOnce;\n }\n // + gridPanel -> for resizing the body and setting top margin\n getHeaderRowCount() {\n return this.cols ? this.cols.treeDepth + 1 : -1;\n }\n isReady() {\n return this.ready;\n }\n isPivotMode() {\n return this.pivotMode;\n }\n setPivotMode(pivotMode, source) {\n if (pivotMode === this.pivotMode || !this.isPivotSettingAllowed(this.pivotMode)) {\n return;\n }\n this.pivotMode = pivotMode;\n if (!this.ready) {\n return;\n }\n this.refreshCols();\n this.visibleColsService.refresh(source);\n this.eventDispatcher.pivotModeChanged();\n }\n isPivotSettingAllowed(pivot) {\n if (pivot && this.gos.get(\"treeData\")) {\n _warnOnce(\"Pivot mode not available with treeData.\");\n return false;\n }\n return true;\n }\n // + clientSideRowModel\n isPivotActive() {\n const pivotColumns = this.funcColsService.getPivotColumns();\n return this.pivotMode && !_missingOrEmpty(pivotColumns);\n }\n // called when dataTypes change\n recreateColumnDefs(source) {\n if (!this.cols) {\n return;\n }\n if (this.autoCols) {\n this.autoColService.updateAutoCols(this.autoCols.list, source);\n }\n this.createColsFromColDefs(true, source);\n }\n setColumnDefs(columnDefs, source) {\n const colsPreviouslyExisted = !!this.colDefs;\n this.colDefs = columnDefs;\n this.createColsFromColDefs(colsPreviouslyExisted, source);\n }\n destroy() {\n destroyColumnTree(this.context, this.colDefCols?.tree);\n destroyColumnTree(this.context, this.autoCols?.tree);\n super.destroy();\n }\n getColTree() {\n return this.cols.tree;\n }\n // + columnSelectPanel\n getColDefColTree() {\n return this.colDefCols.tree;\n }\n // + clientSideRowController -> sorting, building quick filter text\n // + headerRenderer -> sorting (clearing icon)\n getColDefCols() {\n return this.colDefCols?.list ? this.colDefCols.list : null;\n }\n // + moveColumnController\n getCols() {\n return this.cols?.list ?? [];\n }\n // returns colDefCols, pivotResultCols and autoCols\n getAllCols() {\n const pivotResultCols = this.pivotResultColsService.getPivotResultCols();\n const pivotResultColsList = pivotResultCols?.list;\n return [].concat(\n ...[this.colDefCols?.list || [], this.autoCols?.list || [], pivotResultColsList || []]\n );\n }\n getColsForKeys(keys) {\n if (!keys) {\n return [];\n }\n const res = keys.map((key) => this.getCol(key)).filter((col) => col != null);\n return res;\n }\n getColDefCol(key) {\n if (!this.colDefCols?.list) {\n return null;\n }\n return this.getColFromCollection(key, this.colDefCols);\n }\n getCol(key) {\n if (key == null) {\n return null;\n }\n return this.getColFromCollection(key, this.cols);\n }\n getColFromCollection(key, cols) {\n if (cols == null) {\n return null;\n }\n const { map, list } = cols;\n if (typeof key == \"string\" && map[key]) {\n return map[key];\n }\n for (let i = 0; i < list.length; i++) {\n if (columnsMatch(list[i], key)) {\n return list[i];\n }\n }\n return this.getAutoCol(key);\n }\n getAutoCol(key) {\n if (this.autoCols == null)\n return null;\n return this.autoCols.list.find((groupCol) => columnsMatch(groupCol, key)) || null;\n }\n getAutoCols() {\n return this.autoCols?.list || null;\n }\n setColHeaderHeight(col, height) {\n const changed = col.setAutoHeaderHeight(height);\n if (changed) {\n this.eventDispatcher.headerHeight(col);\n }\n }\n getColumnGroupHeaderRowHeight() {\n if (this.isPivotMode()) {\n return this.getPivotGroupHeaderHeight();\n }\n return this.getGroupHeaderHeight();\n }\n getColumnHeaderRowHeight() {\n const defaultHeight = this.isPivotMode() ? this.getPivotHeaderHeight() : this.getHeaderHeight();\n const allDisplayedCols = this.visibleColsService.getAllCols();\n const displayedHeights = allDisplayedCols.filter((col) => col.isAutoHeaderHeight()).map((col) => col.getAutoHeaderHeight() || 0);\n return Math.max(defaultHeight, ...displayedHeights);\n }\n getHeaderHeight() {\n return this.gos.get(\"headerHeight\") ?? this.environment.getDefaultHeaderHeight();\n }\n getFloatingFiltersHeight() {\n return this.gos.get(\"floatingFiltersHeight\") ?? this.getHeaderHeight();\n }\n getGroupHeaderHeight() {\n return this.gos.get(\"groupHeaderHeight\") ?? this.getHeaderHeight();\n }\n getPivotHeaderHeight() {\n return this.gos.get(\"pivotHeaderHeight\") ?? this.getHeaderHeight();\n }\n getPivotGroupHeaderHeight() {\n return this.gos.get(\"pivotGroupHeaderHeight\") ?? this.getGroupHeaderHeight();\n }\n onFirstDataRendered() {\n const autoSizeStrategy = this.gos.get(\"autoSizeStrategy\");\n if (autoSizeStrategy?.type !== \"fitCellContents\") {\n return;\n }\n const { colIds: columns, skipHeader } = autoSizeStrategy;\n setTimeout(() => {\n if (columns) {\n this.columnAutosizeService.autoSizeCols({\n colKeys: columns,\n skipHeader,\n source: \"autosizeColumns\"\n });\n } else {\n this.columnAutosizeService.autoSizeAllColumns(\"autosizeColumns\", skipHeader);\n }\n });\n }\n onAutoGroupColumnDefChanged(source) {\n if (this.autoCols) {\n this.autoColService.updateAutoCols(this.autoCols.list, source);\n }\n }\n};\nfunction convertSourceType(source) {\n return source === \"gridOptionsUpdated\" ? \"gridOptionsChanged\" : source;\n}\nfunction updateColsMap(cols) {\n cols.map = {};\n cols.list.forEach((col) => cols.map[col.getId()] = col);\n}\nfunction columnsMatch(column, key) {\n const columnMatches = column === key;\n const colDefMatches = column.getColDef() === key;\n const idMatches = column.getColId() == key;\n return columnMatches || colDefMatches || idMatches;\n}\nfunction areColIdsEqual(colsA, colsB) {\n return _areEqual(colsA, colsB, (a, b) => a.getColId() === b.getColId());\n}\n\n// community-modules/core/src/columns/columnAutosizeService.ts\nvar ColumnAutosizeService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"columnAutosizeService\";\n this.timesDelayed = 0;\n }\n wireBeans(beans) {\n this.columnModel = beans.columnModel;\n this.visibleColsService = beans.visibleColsService;\n this.animationFrameService = beans.animationFrameService;\n this.autoWidthCalculator = beans.autoWidthCalculator;\n this.eventDispatcher = beans.columnEventDispatcher;\n this.ctrlsService = beans.ctrlsService;\n this.renderStatusService = beans.renderStatusService;\n }\n autoSizeCols(params) {\n if (this.columnModel.isShouldQueueResizeOperations()) {\n this.columnModel.pushResizeOperation(() => this.autoSizeCols(params));\n return;\n }\n const { colKeys, skipHeader, skipHeaderGroups, stopAtGroup, source = \"api\" } = params;\n this.animationFrameService.flushAllFrames();\n if (this.timesDelayed < 5 && this.renderStatusService && !this.renderStatusService.areHeaderCellsRendered()) {\n this.timesDelayed++;\n setTimeout(() => this.autoSizeCols(params));\n return;\n }\n this.timesDelayed = 0;\n const columnsAutosized = [];\n let changesThisTimeAround = -1;\n const shouldSkipHeader = skipHeader != null ? skipHeader : this.gos.get(\"skipHeaderOnAutoSize\");\n const shouldSkipHeaderGroups = skipHeaderGroups != null ? skipHeaderGroups : shouldSkipHeader;\n while (changesThisTimeAround !== 0) {\n changesThisTimeAround = 0;\n const updatedColumns = [];\n colKeys.forEach((key) => {\n if (!key) {\n return;\n }\n const column = this.columnModel.getCol(key);\n if (!column) {\n return;\n }\n if (columnsAutosized.indexOf(column) >= 0) {\n return;\n }\n const preferredWidth = this.autoWidthCalculator.getPreferredWidthForColumn(column, shouldSkipHeader);\n if (preferredWidth > 0) {\n const newWidth = this.normaliseColumnWidth(column, preferredWidth);\n column.setActualWidth(newWidth, source);\n columnsAutosized.push(column);\n changesThisTimeAround++;\n }\n updatedColumns.push(column);\n });\n if (!updatedColumns.length) {\n continue;\n }\n this.visibleColsService.refresh(source);\n }\n if (!shouldSkipHeaderGroups) {\n this.autoSizeColumnGroupsByColumns(colKeys, source, stopAtGroup);\n }\n this.eventDispatcher.columnResized(columnsAutosized, true, \"autosizeColumns\");\n }\n autoSizeColumn(key, source, skipHeader) {\n if (key) {\n this.autoSizeCols({ colKeys: [key], skipHeader, skipHeaderGroups: true, source });\n }\n }\n autoSizeColumnGroupsByColumns(keys, source, stopAtGroup) {\n const columnGroups = /* @__PURE__ */ new Set();\n const columns = this.columnModel.getColsForKeys(keys);\n columns.forEach((col) => {\n let parent = col.getParent();\n while (parent && parent != stopAtGroup) {\n if (!parent.isPadding()) {\n columnGroups.add(parent);\n }\n parent = parent.getParent();\n }\n });\n let headerGroupCtrl;\n const resizedColumns = [];\n for (const columnGroup of columnGroups) {\n for (const headerContainerCtrl of this.ctrlsService.getHeaderRowContainerCtrls()) {\n headerGroupCtrl = headerContainerCtrl.getHeaderCtrlForColumn(columnGroup);\n if (headerGroupCtrl) {\n break;\n }\n }\n if (headerGroupCtrl) {\n headerGroupCtrl.resizeLeafColumnsToFit(source);\n }\n }\n return resizedColumns;\n }\n autoSizeAllColumns(source, skipHeader) {\n if (this.columnModel.isShouldQueueResizeOperations()) {\n this.columnModel.pushResizeOperation(() => this.autoSizeAllColumns(source, skipHeader));\n return;\n }\n const allDisplayedColumns = this.visibleColsService.getAllCols();\n this.autoSizeCols({ colKeys: allDisplayedColumns, skipHeader, source });\n }\n // returns the width we can set to this col, taking into consideration min and max widths\n normaliseColumnWidth(column, newWidth) {\n const minWidth = column.getMinWidth();\n if (newWidth < minWidth) {\n newWidth = minWidth;\n }\n const maxWidth = column.getMaxWidth();\n if (column.isGreaterThanMax(newWidth)) {\n newWidth = maxWidth;\n }\n return newWidth;\n }\n};\n\n// community-modules/core/src/columns/funcColsService.ts\nvar FuncColsService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"funcColsService\";\n this.rowGroupCols = [];\n this.valueCols = [];\n this.pivotCols = [];\n }\n wireBeans(beans) {\n this.columnModel = beans.columnModel;\n this.eventDispatcher = beans.columnEventDispatcher;\n this.aggFuncService = beans.aggFuncService;\n this.visibleColsService = beans.visibleColsService;\n }\n getModifyColumnsNoEventsCallbacks() {\n return {\n addGroupCol: (column) => this.rowGroupCols.push(column),\n removeGroupCol: (column) => _removeFromArray(this.rowGroupCols, column),\n addPivotCol: (column) => this.pivotCols.push(column),\n removePivotCol: (column) => _removeFromArray(this.pivotCols, column),\n addValueCol: (column) => this.valueCols.push(column),\n removeValueCol: (column) => _removeFromArray(this.valueCols, column)\n };\n }\n getSourceColumnsForGroupColumn(groupCol) {\n const sourceColumnId = groupCol.getColDef().showRowGroup;\n if (!sourceColumnId) {\n return null;\n }\n if (sourceColumnId === true) {\n return this.rowGroupCols.slice(0);\n }\n const column = this.columnModel.getColDefCol(sourceColumnId);\n return column ? [column] : null;\n }\n sortRowGroupColumns(compareFn) {\n this.rowGroupCols.sort(compareFn);\n }\n sortPivotColumns(compareFn) {\n this.pivotCols.sort(compareFn);\n }\n // + rowController\n getValueColumns() {\n return this.valueCols ? this.valueCols : [];\n }\n // + rowController\n getPivotColumns() {\n return this.pivotCols ? this.pivotCols : [];\n }\n // + toolPanel\n getRowGroupColumns() {\n return this.rowGroupCols ? this.rowGroupCols : [];\n }\n isRowGroupEmpty() {\n return _missingOrEmpty(this.rowGroupCols);\n }\n setColumnAggFunc(key, aggFunc, source) {\n if (!key) {\n return;\n }\n const column = this.columnModel.getColDefCol(key);\n if (!column) {\n return;\n }\n column.setAggFunc(aggFunc);\n this.eventDispatcher.columnChanged(\"columnValueChanged\", [column], source);\n }\n setRowGroupColumns(colKeys, source) {\n this.setColList(\n colKeys,\n this.rowGroupCols,\n \"columnRowGroupChanged\",\n true,\n true,\n (added, column) => this.setRowGroupActive(added, column, source),\n source\n );\n }\n setRowGroupActive(active, column, source) {\n if (active === column.isRowGroupActive()) {\n return;\n }\n column.setRowGroupActive(active, source);\n if (active && !this.gos.get(\"suppressRowGroupHidesColumns\")) {\n this.columnModel.setColsVisible([column], false, source);\n }\n if (!active && !this.gos.get(\"suppressMakeColumnVisibleAfterUnGroup\")) {\n this.columnModel.setColsVisible([column], true, source);\n }\n }\n addRowGroupColumns(keys, source) {\n this.updateColList(\n keys,\n this.rowGroupCols,\n true,\n true,\n (column) => this.setRowGroupActive(true, column, source),\n \"columnRowGroupChanged\",\n source\n );\n }\n removeRowGroupColumns(keys, source) {\n this.updateColList(\n keys,\n this.rowGroupCols,\n false,\n true,\n (column) => this.setRowGroupActive(false, column, source),\n \"columnRowGroupChanged\",\n source\n );\n }\n addPivotColumns(keys, source) {\n this.updateColList(\n keys,\n this.pivotCols,\n true,\n false,\n (column) => column.setPivotActive(true, source),\n \"columnPivotChanged\",\n source\n );\n }\n setPivotColumns(colKeys, source) {\n this.setColList(\n colKeys,\n this.pivotCols,\n \"columnPivotChanged\",\n true,\n false,\n (added, column) => {\n column.setPivotActive(added, source);\n },\n source\n );\n }\n removePivotColumns(keys, source) {\n this.updateColList(\n keys,\n this.pivotCols,\n false,\n false,\n (column) => column.setPivotActive(false, source),\n \"columnPivotChanged\",\n source\n );\n }\n setValueColumns(colKeys, source) {\n this.setColList(\n colKeys,\n this.valueCols,\n \"columnValueChanged\",\n false,\n false,\n (added, column) => this.setValueActive(added, column, source),\n source\n );\n }\n setValueActive(active, column, source) {\n if (active === column.isValueActive()) {\n return;\n }\n column.setValueActive(active, source);\n if (active && !column.getAggFunc() && this.aggFuncService) {\n const initialAggFunc = this.aggFuncService.getDefaultAggFunc(column);\n column.setAggFunc(initialAggFunc);\n }\n }\n addValueColumns(keys, source) {\n this.updateColList(\n keys,\n this.valueCols,\n true,\n false,\n (column) => this.setValueActive(true, column, source),\n \"columnValueChanged\",\n source\n );\n }\n removeValueColumns(keys, source) {\n this.updateColList(\n keys,\n this.valueCols,\n false,\n false,\n (column) => this.setValueActive(false, column, source),\n \"columnValueChanged\",\n source\n );\n }\n moveRowGroupColumn(fromIndex, toIndex, source) {\n if (this.isRowGroupEmpty()) {\n return;\n }\n const column = this.rowGroupCols[fromIndex];\n const impactedColumns = this.rowGroupCols.slice(fromIndex, toIndex);\n this.rowGroupCols.splice(fromIndex, 1);\n this.rowGroupCols.splice(toIndex, 0, column);\n this.eventDispatcher.rowGroupChanged(impactedColumns, source);\n }\n setColList(colKeys, masterList, eventName, detectOrderChange, autoGroupsNeedBuilding, columnCallback, source) {\n const gridColumns = this.columnModel.getCols();\n if (_missingOrEmpty(gridColumns)) {\n return;\n }\n const changes = /* @__PURE__ */ new Map();\n masterList.forEach((col, idx) => changes.set(col, idx));\n masterList.length = 0;\n if (_exists(colKeys)) {\n colKeys.forEach((key) => {\n const column = this.columnModel.getColDefCol(key);\n if (column) {\n masterList.push(column);\n }\n });\n }\n masterList.forEach((col, idx) => {\n const oldIndex = changes.get(col);\n if (oldIndex === void 0) {\n changes.set(col, 0);\n return;\n }\n if (detectOrderChange && oldIndex !== idx) {\n return;\n }\n changes.delete(col);\n });\n const primaryCols = this.columnModel.getColDefCols();\n (primaryCols || []).forEach((column) => {\n const added = masterList.indexOf(column) >= 0;\n columnCallback(added, column);\n });\n autoGroupsNeedBuilding && this.columnModel.refreshCols();\n this.visibleColsService.refresh(source);\n this.eventDispatcher.columnChanged(eventName, [...changes.keys()], source);\n }\n updateColList(keys, masterList, actionIsAdd, autoGroupsNeedBuilding, columnCallback, eventType, source) {\n if (!keys || _missingOrEmpty(keys)) {\n return;\n }\n let atLeastOne = false;\n keys.forEach((key) => {\n if (!key) {\n return;\n }\n const columnToAdd = this.columnModel.getColDefCol(key);\n if (!columnToAdd) {\n return;\n }\n if (actionIsAdd) {\n if (masterList.indexOf(columnToAdd) >= 0) {\n return;\n }\n masterList.push(columnToAdd);\n } else {\n if (masterList.indexOf(columnToAdd) < 0) {\n return;\n }\n _removeFromArray(masterList, columnToAdd);\n }\n columnCallback(columnToAdd);\n atLeastOne = true;\n });\n if (!atLeastOne) {\n return;\n }\n if (autoGroupsNeedBuilding) {\n this.columnModel.refreshCols();\n }\n this.visibleColsService.refresh(source);\n this.eventDispatcher.genericColumnEvent(eventType, masterList, source);\n }\n extractCols(source, oldProvidedCols) {\n this.extractRowGroupCols(source, oldProvidedCols);\n this.extractPivotCols(source, oldProvidedCols);\n this.extractValueCols(source, oldProvidedCols);\n }\n extractValueCols(source, oldProvidedCols) {\n this.valueCols = this.extractColsCommon(\n oldProvidedCols,\n this.valueCols,\n (col, flag) => col.setValueActive(flag, source),\n // aggFunc doesn't have index variant, cos order of value cols doesn't matter, so always return null\n () => void 0,\n () => void 0,\n // aggFunc is a string, so return it's existence\n (colDef) => {\n const aggFunc = colDef.aggFunc;\n if (aggFunc === null || aggFunc === \"\") {\n return null;\n }\n if (aggFunc === void 0) {\n return;\n }\n return !!aggFunc;\n },\n (colDef) => {\n return colDef.initialAggFunc != null && colDef.initialAggFunc != \"\";\n }\n );\n this.valueCols.forEach((col) => {\n const colDef = col.getColDef();\n if (colDef.aggFunc != null && colDef.aggFunc != \"\") {\n col.setAggFunc(colDef.aggFunc);\n } else {\n if (!col.getAggFunc()) {\n col.setAggFunc(colDef.initialAggFunc);\n }\n }\n });\n }\n extractRowGroupCols(source, oldProvidedCols) {\n this.rowGroupCols = this.extractColsCommon(\n oldProvidedCols,\n this.rowGroupCols,\n (col, flag) => col.setRowGroupActive(flag, source),\n (colDef) => colDef.rowGroupIndex,\n (colDef) => colDef.initialRowGroupIndex,\n (colDef) => colDef.rowGroup,\n (colDef) => colDef.initialRowGroup\n );\n }\n extractPivotCols(source, oldProvidedCols) {\n this.pivotCols = this.extractColsCommon(\n oldProvidedCols,\n this.pivotCols,\n (col, flag) => col.setPivotActive(flag, source),\n (colDef) => colDef.pivotIndex,\n (colDef) => colDef.initialPivotIndex,\n (colDef) => colDef.pivot,\n (colDef) => colDef.initialPivot\n );\n }\n extractColsCommon(oldProvidedCols = [], previousCols = [], setFlagFunc, getIndexFunc, getInitialIndexFunc, getValueFunc, getInitialValueFunc) {\n const colsWithIndex = [];\n const colsWithValue = [];\n const primaryCols = this.columnModel.getColDefCols() || [];\n primaryCols.forEach((col) => {\n const colIsNew = oldProvidedCols.indexOf(col) < 0;\n const colDef = col.getColDef();\n const value = _attrToBoolean(getValueFunc(colDef));\n const initialValue = _attrToBoolean(getInitialValueFunc(colDef));\n const index = _attrToNumber(getIndexFunc(colDef));\n const initialIndex = _attrToNumber(getInitialIndexFunc(colDef));\n let include;\n const valuePresent = value !== void 0;\n const indexPresent = index !== void 0;\n const initialValuePresent = initialValue !== void 0;\n const initialIndexPresent = initialIndex !== void 0;\n if (valuePresent) {\n include = value;\n } else if (indexPresent) {\n if (index === null) {\n include = false;\n } else {\n include = index >= 0;\n }\n } else {\n if (colIsNew) {\n if (initialValuePresent) {\n include = initialValue;\n } else if (initialIndexPresent) {\n include = initialIndex != null && initialIndex >= 0;\n } else {\n include = false;\n }\n } else {\n include = previousCols.indexOf(col) >= 0;\n }\n }\n if (include) {\n const useIndex = colIsNew ? index != null || initialIndex != null : index != null;\n useIndex ? colsWithIndex.push(col) : colsWithValue.push(col);\n }\n });\n const getIndexForCol = (col) => {\n const index = getIndexFunc(col.getColDef());\n const defaultIndex = getInitialIndexFunc(col.getColDef());\n return index != null ? index : defaultIndex;\n };\n colsWithIndex.sort((colA, colB) => {\n const indexA = getIndexForCol(colA);\n const indexB = getIndexForCol(colB);\n if (indexA === indexB) {\n return 0;\n }\n if (indexA < indexB) {\n return -1;\n }\n return 1;\n });\n const res = [].concat(colsWithIndex);\n previousCols.forEach((col) => {\n if (colsWithValue.indexOf(col) >= 0) {\n res.push(col);\n }\n });\n colsWithValue.forEach((col) => {\n if (res.indexOf(col) < 0) {\n res.push(col);\n }\n });\n previousCols.forEach((col) => {\n if (res.indexOf(col) < 0) {\n setFlagFunc(col, false);\n }\n });\n res.forEach((col) => {\n if (previousCols.indexOf(col) < 0) {\n setFlagFunc(col, true);\n }\n });\n return res;\n }\n generateColumnStateForRowGroupAndPivotIndexes(updatedRowGroupColumnState, updatedPivotColumnState) {\n const existingColumnStateUpdates = {};\n const orderColumns = (updatedColumnState, colList, enableProp, initialEnableProp, indexProp, initialIndexProp) => {\n const primaryCols = this.columnModel.getColDefCols();\n if (!colList.length || !primaryCols) {\n return [];\n }\n const updatedColIdArray = Object.keys(updatedColumnState);\n const updatedColIds = new Set(updatedColIdArray);\n const newColIds = new Set(updatedColIdArray);\n const allColIds = new Set(\n colList.map((column) => {\n const colId = column.getColId();\n newColIds.delete(colId);\n return colId;\n }).concat(updatedColIdArray)\n );\n const colIdsInOriginalOrder = [];\n const originalOrderMap = {};\n let orderIndex = 0;\n for (let i = 0; i < primaryCols.length; i++) {\n const colId = primaryCols[i].getColId();\n if (allColIds.has(colId)) {\n colIdsInOriginalOrder.push(colId);\n originalOrderMap[colId] = orderIndex++;\n }\n }\n let index = 1e3;\n let hasAddedNewCols = false;\n let lastIndex = 0;\n const processPrecedingNewCols = (colId) => {\n const originalOrderIndex = originalOrderMap[colId];\n for (let i = lastIndex; i < originalOrderIndex; i++) {\n const newColId = colIdsInOriginalOrder[i];\n if (newColIds.has(newColId)) {\n updatedColumnState[newColId][indexProp] = index++;\n newColIds.delete(newColId);\n }\n }\n lastIndex = originalOrderIndex;\n };\n colList.forEach((column) => {\n const colId = column.getColId();\n if (updatedColIds.has(colId)) {\n processPrecedingNewCols(colId);\n updatedColumnState[colId][indexProp] = index++;\n } else {\n const colDef = column.getColDef();\n const missingIndex = colDef[indexProp] === null || colDef[indexProp] === void 0 && colDef[initialIndexProp] == null;\n if (missingIndex) {\n if (!hasAddedNewCols) {\n const propEnabled = colDef[enableProp] || colDef[enableProp] === void 0 && colDef[initialEnableProp];\n if (propEnabled) {\n processPrecedingNewCols(colId);\n } else {\n newColIds.forEach((newColId) => {\n updatedColumnState[newColId][indexProp] = index + originalOrderMap[newColId];\n });\n index += colIdsInOriginalOrder.length;\n hasAddedNewCols = true;\n }\n }\n if (!existingColumnStateUpdates[colId]) {\n existingColumnStateUpdates[colId] = { colId };\n }\n existingColumnStateUpdates[colId][indexProp] = index++;\n }\n }\n });\n };\n orderColumns(\n updatedRowGroupColumnState,\n this.rowGroupCols,\n \"rowGroup\",\n \"initialRowGroup\",\n \"rowGroupIndex\",\n \"initialRowGroupIndex\"\n );\n orderColumns(\n updatedPivotColumnState,\n this.pivotCols,\n \"pivot\",\n \"initialPivot\",\n \"pivotIndex\",\n \"initialPivotIndex\"\n );\n return Object.values(existingColumnStateUpdates);\n }\n};\n\n// community-modules/core/src/columns/columnApplyStateService.ts\nvar ColumnApplyStateService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"columnApplyStateService\";\n }\n wireBeans(beans) {\n this.columnModel = beans.columnModel;\n this.eventDispatcher = beans.columnEventDispatcher;\n this.sortController = beans.sortController;\n this.columnGetStateService = beans.columnGetStateService;\n this.funcColsService = beans.funcColsService;\n this.visibleColsService = beans.visibleColsService;\n this.columnAnimationService = beans.columnAnimationService;\n this.pivotResultColsService = beans.pivotResultColsService;\n }\n applyColumnState(params, source) {\n const providedCols = this.columnModel.getColDefCols() || [];\n if (_missingOrEmpty(providedCols)) {\n return false;\n }\n if (params && params.state && !params.state.forEach) {\n _warnOnce(\n \"applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state.\"\n );\n return false;\n }\n const callbacks = this.funcColsService.getModifyColumnsNoEventsCallbacks();\n const applyStates = (states, existingColumns, getById) => {\n const dispatchEventsFunc = this.compareColumnStatesAndDispatchEvents(source);\n const columnsWithNoState = existingColumns.slice();\n const rowGroupIndexes = {};\n const pivotIndexes = {};\n const autoColStates = [];\n const unmatchedAndAutoStates2 = [];\n let unmatchedCount2 = 0;\n const previousRowGroupCols = this.funcColsService.getRowGroupColumns().slice();\n const previousPivotCols = this.funcColsService.getPivotColumns().slice();\n states.forEach((state) => {\n const colId = state.colId || \"\";\n const isAutoGroupColumn = colId.startsWith(GROUP_AUTO_COLUMN_ID);\n if (isAutoGroupColumn) {\n autoColStates.push(state);\n unmatchedAndAutoStates2.push(state);\n return;\n }\n const column = getById(colId);\n if (!column) {\n unmatchedAndAutoStates2.push(state);\n unmatchedCount2 += 1;\n } else {\n this.syncColumnWithStateItem(\n column,\n state,\n params.defaultState,\n rowGroupIndexes,\n pivotIndexes,\n false,\n source,\n callbacks\n );\n _removeFromArray(columnsWithNoState, column);\n }\n });\n const applyDefaultsFunc = (col) => this.syncColumnWithStateItem(\n col,\n null,\n params.defaultState,\n rowGroupIndexes,\n pivotIndexes,\n false,\n source,\n callbacks\n );\n columnsWithNoState.forEach(applyDefaultsFunc);\n this.funcColsService.sortRowGroupColumns(\n comparatorByIndex.bind(this, rowGroupIndexes, previousRowGroupCols)\n );\n this.funcColsService.sortPivotColumns(comparatorByIndex.bind(this, pivotIndexes, previousPivotCols));\n this.columnModel.refreshCols();\n const autoCols = this.columnModel.getAutoCols() || [];\n const autoColsCopy = autoCols.slice();\n autoColStates.forEach((stateItem) => {\n const autoCol = this.columnModel.getAutoCol(stateItem.colId);\n _removeFromArray(autoColsCopy, autoCol);\n this.syncColumnWithStateItem(\n autoCol,\n stateItem,\n params.defaultState,\n null,\n null,\n true,\n source,\n callbacks\n );\n });\n autoColsCopy.forEach(applyDefaultsFunc);\n this.orderLiveColsLikeState(params);\n this.visibleColsService.refresh(source);\n this.eventDispatcher.everythingChanged(source);\n dispatchEventsFunc();\n return { unmatchedAndAutoStates: unmatchedAndAutoStates2, unmatchedCount: unmatchedCount2 };\n };\n this.columnAnimationService.start();\n let { unmatchedAndAutoStates, unmatchedCount } = applyStates(\n params.state || [],\n providedCols,\n (id) => this.columnModel.getColDefCol(id)\n );\n if (unmatchedAndAutoStates.length > 0 || _exists(params.defaultState)) {\n const pivotResultCols = this.pivotResultColsService.getPivotResultCols();\n const pivotResultColsList = pivotResultCols?.list;\n unmatchedCount = applyStates(\n unmatchedAndAutoStates,\n pivotResultColsList || [],\n (id) => this.pivotResultColsService.getPivotResultCol(id)\n ).unmatchedCount;\n }\n this.columnAnimationService.finish();\n return unmatchedCount === 0;\n }\n resetColumnState(source) {\n const primaryCols = this.columnModel.getColDefCols();\n if (_missingOrEmpty(primaryCols)) {\n return;\n }\n const primaryColumnTree = this.columnModel.getColDefColTree();\n const primaryColumns = getColumnsFromTree(primaryColumnTree);\n const columnStates = [];\n let letRowGroupIndex = 1e3;\n let letPivotIndex = 1e3;\n let colsToProcess = [];\n const groupAutoCols = this.columnModel.getAutoCols();\n if (groupAutoCols) {\n colsToProcess = colsToProcess.concat(groupAutoCols);\n }\n if (primaryColumns) {\n colsToProcess = colsToProcess.concat(primaryColumns);\n }\n colsToProcess.forEach((column) => {\n const stateItem = this.getColumnStateFromColDef(column);\n if (_missing(stateItem.rowGroupIndex) && stateItem.rowGroup) {\n stateItem.rowGroupIndex = letRowGroupIndex++;\n }\n if (_missing(stateItem.pivotIndex) && stateItem.pivot) {\n stateItem.pivotIndex = letPivotIndex++;\n }\n columnStates.push(stateItem);\n });\n this.applyColumnState({ state: columnStates, applyOrder: true }, source);\n }\n getColumnStateFromColDef(column) {\n const getValueOrNull = (a, b) => a != null ? a : b != null ? b : null;\n const colDef = column.getColDef();\n const sort = getValueOrNull(colDef.sort, colDef.initialSort);\n const sortIndex = getValueOrNull(colDef.sortIndex, colDef.initialSortIndex);\n const hide = getValueOrNull(colDef.hide, colDef.initialHide);\n const pinned = getValueOrNull(colDef.pinned, colDef.initialPinned);\n const width = getValueOrNull(colDef.width, colDef.initialWidth);\n const flex = getValueOrNull(colDef.flex, colDef.initialFlex);\n let rowGroupIndex = getValueOrNull(\n colDef.rowGroupIndex,\n colDef.initialRowGroupIndex\n );\n let rowGroup = getValueOrNull(colDef.rowGroup, colDef.initialRowGroup);\n if (rowGroupIndex == null && (rowGroup == null || rowGroup == false)) {\n rowGroupIndex = null;\n rowGroup = null;\n }\n let pivotIndex = getValueOrNull(colDef.pivotIndex, colDef.initialPivotIndex);\n let pivot = getValueOrNull(colDef.pivot, colDef.initialPivot);\n if (pivotIndex == null && (pivot == null || pivot == false)) {\n pivotIndex = null;\n pivot = null;\n }\n const aggFunc = getValueOrNull(colDef.aggFunc, colDef.initialAggFunc);\n return {\n colId: column.getColId(),\n sort,\n sortIndex,\n hide,\n pinned,\n width,\n flex,\n rowGroup,\n rowGroupIndex,\n pivot,\n pivotIndex,\n aggFunc\n };\n }\n syncColumnWithStateItem(column, stateItem, defaultState, rowGroupIndexes, pivotIndexes, autoCol, source, callbacks) {\n if (!column) {\n return;\n }\n const getValue2 = (key1, key2) => {\n const obj = {\n value1: void 0,\n value2: void 0\n };\n let calculated = false;\n if (stateItem) {\n if (stateItem[key1] !== void 0) {\n obj.value1 = stateItem[key1];\n calculated = true;\n }\n if (_exists(key2) && stateItem[key2] !== void 0) {\n obj.value2 = stateItem[key2];\n calculated = true;\n }\n }\n if (!calculated && defaultState) {\n if (defaultState[key1] !== void 0) {\n obj.value1 = defaultState[key1];\n }\n if (_exists(key2) && defaultState[key2] !== void 0) {\n obj.value2 = defaultState[key2];\n }\n }\n return obj;\n };\n const hide = getValue2(\"hide\").value1;\n if (hide !== void 0) {\n column.setVisible(!hide, source);\n }\n const pinned = getValue2(\"pinned\").value1;\n if (pinned !== void 0) {\n column.setPinned(pinned);\n }\n const minColWidth = column.getColDef().minWidth ?? DEFAULT_COLUMN_MIN_WIDTH;\n const flex = getValue2(\"flex\").value1;\n if (flex !== void 0) {\n column.setFlex(flex);\n }\n if (flex == null) {\n const width = getValue2(\"width\").value1;\n if (width != null) {\n if (minColWidth != null && width >= minColWidth) {\n column.setActualWidth(width, source);\n }\n }\n }\n const sort = getValue2(\"sort\").value1;\n if (sort !== void 0) {\n if (sort === \"desc\" || sort === \"asc\") {\n column.setSort(sort, source);\n } else {\n column.setSort(void 0, source);\n }\n }\n const sortIndex = getValue2(\"sortIndex\").value1;\n if (sortIndex !== void 0) {\n column.setSortIndex(sortIndex);\n }\n if (autoCol || !column.isPrimary()) {\n return;\n }\n const aggFunc = getValue2(\"aggFunc\").value1;\n if (aggFunc !== void 0) {\n if (typeof aggFunc === \"string\") {\n column.setAggFunc(aggFunc);\n if (!column.isValueActive()) {\n column.setValueActive(true, source);\n callbacks.addValueCol(column);\n }\n } else {\n if (_exists(aggFunc)) {\n _warnOnce(\n \"stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON.\"\n );\n }\n if (column.isValueActive()) {\n column.setValueActive(false, source);\n callbacks.removeValueCol(column);\n }\n }\n }\n const { value1: rowGroup, value2: rowGroupIndex } = getValue2(\"rowGroup\", \"rowGroupIndex\");\n if (rowGroup !== void 0 || rowGroupIndex !== void 0) {\n if (typeof rowGroupIndex === \"number\" || rowGroup) {\n if (!column.isRowGroupActive()) {\n column.setRowGroupActive(true, source);\n callbacks.addGroupCol(column);\n }\n if (rowGroupIndexes && typeof rowGroupIndex === \"number\") {\n rowGroupIndexes[column.getId()] = rowGroupIndex;\n }\n } else {\n if (column.isRowGroupActive()) {\n column.setRowGroupActive(false, source);\n callbacks.removeGroupCol(column);\n }\n }\n }\n const { value1: pivot, value2: pivotIndex } = getValue2(\"pivot\", \"pivotIndex\");\n if (pivot !== void 0 || pivotIndex !== void 0) {\n if (typeof pivotIndex === \"number\" || pivot) {\n if (!column.isPivotActive()) {\n column.setPivotActive(true, source);\n callbacks.addPivotCol(column);\n }\n if (pivotIndexes && typeof pivotIndex === \"number\") {\n pivotIndexes[column.getId()] = pivotIndex;\n }\n } else {\n if (column.isPivotActive()) {\n column.setPivotActive(false, source);\n callbacks.removePivotCol(column);\n }\n }\n }\n }\n orderLiveColsLikeState(params) {\n if (!params.applyOrder || !params.state) {\n return;\n }\n const colIds = [];\n params.state.forEach((item) => {\n if (item.colId != null) {\n colIds.push(item.colId);\n }\n });\n this.columnModel.sortColsLikeKeys(colIds);\n }\n // calculates what events to fire between column state changes. gets used when:\n // a) apply column state\n // b) apply new column definitions (so changes from old cols)\n compareColumnStatesAndDispatchEvents(source) {\n const startState = {\n rowGroupColumns: this.funcColsService.getRowGroupColumns().slice(),\n pivotColumns: this.funcColsService.getPivotColumns().slice(),\n valueColumns: this.funcColsService.getValueColumns().slice()\n };\n const columnStateBefore = this.columnGetStateService.getColumnState();\n const columnStateBeforeMap = {};\n columnStateBefore.forEach((col) => {\n columnStateBeforeMap[col.colId] = col;\n });\n return () => {\n const colsForState = this.columnModel.getAllCols();\n const dispatchWhenListsDifferent = (eventType, colsBefore, colsAfter, idMapper) => {\n const beforeList = colsBefore.map(idMapper);\n const afterList = colsAfter.map(idMapper);\n const unchanged = _areEqual(beforeList, afterList);\n if (unchanged) {\n return;\n }\n const changes = new Set(colsBefore);\n colsAfter.forEach((id) => {\n if (!changes.delete(id)) {\n changes.add(id);\n }\n });\n const changesArr = [...changes];\n const event = {\n type: eventType,\n columns: changesArr,\n column: changesArr.length === 1 ? changesArr[0] : null,\n source\n };\n this.eventService.dispatchEvent(event);\n };\n const getChangedColumns = (changedPredicate) => {\n const changedColumns2 = [];\n colsForState.forEach((column) => {\n const colStateBefore = columnStateBeforeMap[column.getColId()];\n if (colStateBefore && changedPredicate(colStateBefore, column)) {\n changedColumns2.push(column);\n }\n });\n return changedColumns2;\n };\n const columnIdMapper = (c) => c.getColId();\n dispatchWhenListsDifferent(\n \"columnRowGroupChanged\",\n startState.rowGroupColumns,\n this.funcColsService.getRowGroupColumns(),\n columnIdMapper\n );\n dispatchWhenListsDifferent(\n \"columnPivotChanged\",\n startState.pivotColumns,\n this.funcColsService.getPivotColumns(),\n columnIdMapper\n );\n const valueChangePredicate = (cs, c) => {\n const oldActive = cs.aggFunc != null;\n const activeChanged = oldActive != c.isValueActive();\n const aggFuncChanged = oldActive && cs.aggFunc != c.getAggFunc();\n return activeChanged || aggFuncChanged;\n };\n const changedValues = getChangedColumns(valueChangePredicate);\n if (changedValues.length > 0) {\n this.eventDispatcher.columnChanged(\"columnValueChanged\", changedValues, source);\n }\n const resizeChangePredicate = (cs, c) => cs.width != c.getActualWidth();\n this.eventDispatcher.columnResized(getChangedColumns(resizeChangePredicate), true, source);\n const pinnedChangePredicate = (cs, c) => cs.pinned != c.getPinned();\n this.eventDispatcher.columnPinned(getChangedColumns(pinnedChangePredicate), source);\n const visibilityChangePredicate = (cs, c) => cs.hide == c.isVisible();\n this.eventDispatcher.columnVisible(getChangedColumns(visibilityChangePredicate), source);\n const sortChangePredicate = (cs, c) => cs.sort != c.getSort() || cs.sortIndex != c.getSortIndex();\n const changedColumns = getChangedColumns(sortChangePredicate);\n if (changedColumns.length > 0) {\n this.sortController.dispatchSortChangedEvents(source, changedColumns);\n }\n this.normaliseColumnMovedEventForColumnState(columnStateBefore, source);\n };\n }\n normaliseColumnMovedEventForColumnState(colStateBefore, source) {\n const colStateAfter = this.columnGetStateService.getColumnState();\n const colStateAfterMapped = {};\n colStateAfter.forEach((s) => colStateAfterMapped[s.colId] = s);\n const colsIntersectIds = {};\n colStateBefore.forEach((s) => {\n if (colStateAfterMapped[s.colId]) {\n colsIntersectIds[s.colId] = true;\n }\n });\n const beforeFiltered = colStateBefore.filter((c) => colsIntersectIds[c.colId]);\n const afterFiltered = colStateAfter.filter((c) => colsIntersectIds[c.colId]);\n const movedColumns = [];\n afterFiltered.forEach((csAfter, index) => {\n const csBefore = beforeFiltered && beforeFiltered[index];\n if (csBefore && csBefore.colId !== csAfter.colId) {\n const gridCol = this.columnModel.getCol(csBefore.colId);\n if (gridCol) {\n movedColumns.push(gridCol);\n }\n }\n });\n if (!movedColumns.length) {\n return;\n }\n this.eventDispatcher.columnMoved({ movedColumns, source, finished: true });\n }\n};\nvar comparatorByIndex = (indexes, oldList, colA, colB) => {\n const indexA = indexes[colA.getId()];\n const indexB = indexes[colB.getId()];\n const aHasIndex = indexA != null;\n const bHasIndex = indexB != null;\n if (aHasIndex && bHasIndex) {\n return indexA - indexB;\n }\n if (aHasIndex) {\n return -1;\n }\n if (bHasIndex) {\n return 1;\n }\n const oldIndexA = oldList.indexOf(colA);\n const oldIndexB = oldList.indexOf(colB);\n const aHasOldIndex = oldIndexA >= 0;\n const bHasOldIndex = oldIndexB >= 0;\n if (aHasOldIndex && bHasOldIndex) {\n return oldIndexA - oldIndexB;\n }\n if (aHasOldIndex) {\n return -1;\n }\n return 1;\n};\n\n// community-modules/core/src/columns/columnMoveService.ts\nvar ColumnMoveService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"columnMoveService\";\n }\n wireBeans(beans) {\n this.columnModel = beans.columnModel;\n this.columnAnimationService = beans.columnAnimationService;\n this.eventDispatcher = beans.columnEventDispatcher;\n }\n moveColumnByIndex(fromIndex, toIndex, source) {\n const gridColumns = this.columnModel.getCols();\n if (!gridColumns) {\n return;\n }\n const column = gridColumns[fromIndex];\n this.moveColumns([column], toIndex, source);\n }\n moveColumns(columnsToMoveKeys, toIndex, source, finished = true) {\n const gridColumns = this.columnModel.getCols();\n if (!gridColumns) {\n return;\n }\n this.columnAnimationService.start();\n if (toIndex > gridColumns.length - columnsToMoveKeys.length) {\n _warnOnce(\"tried to insert columns in invalid location, toIndex = \", toIndex);\n _warnOnce(\"remember that you should not count the moving columns when calculating the new index\");\n return;\n }\n const movedColumns = this.columnModel.getColsForKeys(columnsToMoveKeys);\n const failedRules = !this.doesMovePassRules(movedColumns, toIndex);\n if (failedRules) {\n return;\n }\n this.columnModel.moveInCols(movedColumns, toIndex, source);\n this.eventDispatcher.columnMoved({ movedColumns, source, toIndex, finished });\n this.columnAnimationService.finish();\n }\n doesMovePassRules(columnsToMove, toIndex) {\n const proposedColumnOrder = this.getProposedColumnOrder(columnsToMove, toIndex);\n return this.doesOrderPassRules(proposedColumnOrder);\n }\n doesOrderPassRules(gridOrder) {\n if (!this.doesMovePassMarryChildren(gridOrder)) {\n return false;\n }\n if (!this.doesMovePassLockedPositions(gridOrder)) {\n return false;\n }\n return true;\n }\n getProposedColumnOrder(columnsToMove, toIndex) {\n const gridColumns = this.columnModel.getCols();\n const proposedColumnOrder = gridColumns.slice();\n _moveInArray(proposedColumnOrder, columnsToMove, toIndex);\n return proposedColumnOrder;\n }\n doesMovePassLockedPositions(proposedColumnOrder) {\n const lockPositionToPlacement = (position) => {\n if (!position) {\n return 0 /* NONE */;\n }\n return position === \"left\" || position === true ? -1 /* LEFT */ : 1 /* RIGHT */;\n };\n const isRtl = this.gos.get(\"enableRtl\");\n let lastPlacement = isRtl ? 1 /* RIGHT */ : -1 /* LEFT */;\n let rulePassed = true;\n proposedColumnOrder.forEach((col) => {\n const placement = lockPositionToPlacement(col.getColDef().lockPosition);\n if (isRtl) {\n if (placement > lastPlacement) {\n rulePassed = false;\n }\n } else {\n if (placement < lastPlacement) {\n rulePassed = false;\n }\n }\n lastPlacement = placement;\n });\n return rulePassed;\n }\n doesMovePassMarryChildren(allColumnsCopy) {\n let rulePassed = true;\n const gridBalancedTree = this.columnModel.getColTree();\n depthFirstOriginalTreeSearch(null, gridBalancedTree, (child) => {\n if (!isProvidedColumnGroup(child)) {\n return;\n }\n const columnGroup = child;\n const colGroupDef = columnGroup.getColGroupDef();\n const marryChildren = colGroupDef && colGroupDef.marryChildren;\n if (!marryChildren) {\n return;\n }\n const newIndexes = [];\n columnGroup.getLeafColumns().forEach((col) => {\n const newColIndex = allColumnsCopy.indexOf(col);\n newIndexes.push(newColIndex);\n });\n const maxIndex = Math.max.apply(Math, newIndexes);\n const minIndex = Math.min.apply(Math, newIndexes);\n const spread = maxIndex - minIndex;\n const maxSpread = columnGroup.getLeafColumns().length - 1;\n if (spread > maxSpread) {\n rulePassed = false;\n }\n });\n return rulePassed;\n }\n placeLockedColumns(cols) {\n const left = [];\n const normal = [];\n const right = [];\n cols.forEach((col) => {\n const position = col.getColDef().lockPosition;\n if (position === \"right\") {\n right.push(col);\n } else if (position === \"left\" || position === true) {\n left.push(col);\n } else {\n normal.push(col);\n }\n });\n const isRtl = this.gos.get(\"enableRtl\");\n if (isRtl) {\n return [...right, ...normal, ...left];\n }\n return [...left, ...normal, ...right];\n }\n};\n\n// community-modules/core/src/utils/string.ts\nvar reUnescapedHtml = /[&<>\"']/g;\nvar HTML_ESCAPES = {\n \"&\": \"&\",\n \"<\": \"<\",\n \">\": \">\",\n '\"': \""\",\n \"'\": \"'\"\n};\nfunction _utf8_encode(s) {\n const stringFromCharCode = String.fromCharCode;\n function ucs2decode(string) {\n const output = [];\n if (!string) {\n return [];\n }\n const len = string.length;\n let counter = 0;\n let value;\n let extra;\n while (counter < len) {\n value = string.charCodeAt(counter++);\n if (value >= 55296 && value <= 56319 && counter < len) {\n extra = string.charCodeAt(counter++);\n if ((extra & 64512) == 56320) {\n output.push(((value & 1023) << 10) + (extra & 1023) + 65536);\n } else {\n output.push(value);\n counter--;\n }\n } else {\n output.push(value);\n }\n }\n return output;\n }\n function checkScalarValue(point) {\n if (point >= 55296 && point <= 57343) {\n throw Error(\"Lone surrogate U+\" + point.toString(16).toUpperCase() + \" is not a scalar value\");\n }\n }\n function createByte(point, shift) {\n return stringFromCharCode(point >> shift & 63 | 128);\n }\n function encodeCodePoint(point) {\n if ((point & 4294967168) == 0) {\n return stringFromCharCode(point);\n }\n let symbol = \"\";\n if ((point & 4294965248) == 0) {\n symbol = stringFromCharCode(point >> 6 & 31 | 192);\n } else if ((point & 4294901760) == 0) {\n checkScalarValue(point);\n symbol = stringFromCharCode(point >> 12 & 15 | 224);\n symbol += createByte(point, 6);\n } else if ((point & 4292870144) == 0) {\n symbol = stringFromCharCode(point >> 18 & 7 | 240);\n symbol += createByte(point, 12);\n symbol += createByte(point, 6);\n }\n symbol += stringFromCharCode(point & 63 | 128);\n return symbol;\n }\n const codePoints = ucs2decode(s);\n const length = codePoints.length;\n let index = -1;\n let codePoint;\n let byteString = \"\";\n while (++index < length) {\n codePoint = codePoints[index];\n byteString += encodeCodePoint(codePoint);\n }\n return byteString;\n}\nfunction _capitalise(str) {\n return str[0].toUpperCase() + str.substring(1).toLowerCase();\n}\nfunction _escapeString(toEscape, skipEscapingHtmlChars) {\n if (toEscape == null) {\n return null;\n }\n const stringResult = toEscape.toString().toString();\n if (skipEscapingHtmlChars) {\n return stringResult;\n }\n return stringResult.replace(reUnescapedHtml, (chr) => HTML_ESCAPES[chr]);\n}\nfunction _camelCaseToHumanText(camelCase) {\n if (!camelCase || camelCase == null) {\n return null;\n }\n const rex = /([a-z])([A-Z])/g;\n const rexCaps = /([A-Z]+)([A-Z])([a-z])/g;\n const words = camelCase.replace(rex, \"$1 $2\").replace(rexCaps, \"$1 $2$3\").replace(/\\./g, \" \").split(\" \");\n return words.map((word) => word.substring(0, 1).toUpperCase() + (word.length > 1 ? word.substring(1, word.length) : \"\")).join(\" \");\n}\nfunction _camelCaseToHyphenated(camelCase) {\n return camelCase.replace(/[A-Z]/g, (s) => `-${s.toLocaleLowerCase()}`);\n}\n\n// community-modules/core/src/columns/columnNameService.ts\nvar ColumnNameService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"columnNameService\";\n }\n wireBeans(beans) {\n this.expressionService = beans.expressionService;\n this.funcColsService = beans.funcColsService;\n this.columnModel = beans.columnModel;\n }\n getDisplayNameForColumn(column, location, includeAggFunc = false) {\n if (!column) {\n return null;\n }\n const headerName = this.getHeaderName(column.getColDef(), column, null, null, location);\n if (includeAggFunc) {\n return this.wrapHeaderNameWithAggFunc(column, headerName);\n }\n return headerName;\n }\n getDisplayNameForProvidedColumnGroup(columnGroup, providedColumnGroup, location) {\n const colGroupDef = providedColumnGroup ? providedColumnGroup.getColGroupDef() : null;\n if (colGroupDef) {\n return this.getHeaderName(colGroupDef, null, columnGroup, providedColumnGroup, location);\n }\n return null;\n }\n getDisplayNameForColumnGroup(columnGroup, location) {\n return this.getDisplayNameForProvidedColumnGroup(columnGroup, columnGroup.getProvidedColumnGroup(), location);\n }\n // location is where the column is going to appear, ie who is calling us\n getHeaderName(colDef, column, columnGroup, providedColumnGroup, location) {\n const headerValueGetter = colDef.headerValueGetter;\n if (headerValueGetter) {\n const params = this.gos.addGridCommonParams({\n colDef,\n column,\n columnGroup,\n providedColumnGroup,\n location\n });\n if (typeof headerValueGetter === \"function\") {\n return headerValueGetter(params);\n } else if (typeof headerValueGetter === \"string\") {\n return this.expressionService.evaluate(headerValueGetter, params);\n }\n _warnOnce(\"headerValueGetter must be a function or a string\");\n return \"\";\n } else if (colDef.headerName != null) {\n return colDef.headerName;\n } else if (colDef.field) {\n return _camelCaseToHumanText(colDef.field);\n }\n return \"\";\n }\n wrapHeaderNameWithAggFunc(column, headerName) {\n if (this.gos.get(\"suppressAggFuncInHeader\")) {\n return headerName;\n }\n const pivotValueColumn = column.getColDef().pivotValueColumn;\n const pivotActiveOnThisColumn = _exists(pivotValueColumn);\n let aggFunc = null;\n let aggFuncFound;\n if (pivotActiveOnThisColumn) {\n const valueColumns = this.funcColsService.getValueColumns();\n const isCollapsedHeaderEnabled = this.gos.get(\"removePivotHeaderRowWhenSingleValueColumn\") && valueColumns.length === 1;\n const isTotalColumn = column.getColDef().pivotTotalColumnIds !== void 0;\n if (isCollapsedHeaderEnabled && !isTotalColumn) {\n return headerName;\n }\n aggFunc = pivotValueColumn ? pivotValueColumn.getAggFunc() : null;\n aggFuncFound = true;\n } else {\n const measureActive = column.isValueActive();\n const aggregationPresent = this.columnModel.isPivotMode() || !this.funcColsService.isRowGroupEmpty();\n if (measureActive && aggregationPresent) {\n aggFunc = column.getAggFunc();\n aggFuncFound = true;\n } else {\n aggFuncFound = false;\n }\n }\n if (aggFuncFound) {\n const aggFuncString = typeof aggFunc === \"string\" ? aggFunc : \"func\";\n const localeTextFunc = this.localeService.getLocaleTextFunc();\n const aggFuncStringTranslated = localeTextFunc(aggFuncString, aggFuncString);\n return `${aggFuncStringTranslated}(${headerName})`;\n }\n return headerName;\n }\n};\n\n// community-modules/core/src/columns/pivotResultColsService.ts\nvar PivotResultColsService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"pivotResultColsService\";\n }\n wireBeans(beans) {\n this.context = beans.context;\n this.columnModel = beans.columnModel;\n this.columnFactory = beans.columnFactory;\n this.visibleColsService = beans.visibleColsService;\n }\n destroy() {\n destroyColumnTree(this.context, this.pivotResultCols?.tree);\n super.destroy();\n }\n isPivotResultColsPresent() {\n return this.pivotResultCols != null;\n }\n lookupPivotResultCol(pivotKeys, valueColKey) {\n if (this.pivotResultCols == null) {\n return null;\n }\n const valueColumnToFind = this.columnModel.getColDefCol(valueColKey);\n let foundColumn = null;\n this.pivotResultCols.list.forEach((column) => {\n const thisPivotKeys = column.getColDef().pivotKeys;\n const pivotValueColumn = column.getColDef().pivotValueColumn;\n const pivotKeyMatches = _areEqual(thisPivotKeys, pivotKeys);\n const pivotValueMatches = pivotValueColumn === valueColumnToFind;\n if (pivotKeyMatches && pivotValueMatches) {\n foundColumn = column;\n }\n });\n return foundColumn;\n }\n getPivotResultCols() {\n return this.pivotResultCols;\n }\n getPivotResultCol(key) {\n if (!this.pivotResultCols) {\n return null;\n }\n return this.columnModel.getColFromCollection(key, this.pivotResultCols);\n }\n setPivotResultCols(colDefs, source) {\n if (!this.columnModel.isReady()) {\n return;\n }\n if (colDefs == null && this.pivotResultCols == null) {\n return;\n }\n if (colDefs) {\n this.processPivotResultColDef(colDefs);\n const balancedTreeResult = this.columnFactory.createColumnTree(\n colDefs,\n false,\n this.pivotResultCols?.tree || this.previousPivotResultCols || void 0,\n source\n );\n destroyColumnTree(this.context, this.pivotResultCols?.tree, balancedTreeResult.columnTree);\n const tree = balancedTreeResult.columnTree;\n const treeDepth = balancedTreeResult.treeDept;\n const list = getColumnsFromTree(tree);\n const map = {};\n this.pivotResultCols = { tree, treeDepth, list, map };\n this.pivotResultCols.list.forEach((col) => this.pivotResultCols.map[col.getId()] = col);\n this.previousPivotResultCols = null;\n } else {\n this.previousPivotResultCols = this.pivotResultCols ? this.pivotResultCols.tree : null;\n this.pivotResultCols = null;\n }\n this.columnModel.refreshCols();\n this.visibleColsService.refresh(source);\n }\n processPivotResultColDef(colDefs) {\n const columnCallback = this.gos.get(\"processPivotResultColDef\");\n const groupCallback = this.gos.get(\"processPivotResultColGroupDef\");\n if (!columnCallback && !groupCallback) {\n return void 0;\n }\n const searchForColDefs = (colDefs2) => {\n colDefs2.forEach((abstractColDef) => {\n const isGroup = _exists(abstractColDef.children);\n if (isGroup) {\n const colGroupDef = abstractColDef;\n if (groupCallback) {\n groupCallback(colGroupDef);\n }\n searchForColDefs(colGroupDef.children);\n } else {\n const colDef = abstractColDef;\n if (columnCallback) {\n columnCallback(colDef);\n }\n }\n });\n };\n if (colDefs) {\n searchForColDefs(colDefs);\n }\n }\n};\n\n// community-modules/core/src/columns/columnSizeService.ts\nvar ColumnSizeService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"columnSizeService\";\n }\n wireBeans(beans) {\n this.columnModel = beans.columnModel;\n this.columnViewportService = beans.columnViewportService;\n this.eventDispatcher = beans.columnEventDispatcher;\n this.visibleColsService = beans.visibleColsService;\n this.ctrlsService = beans.ctrlsService;\n }\n setColumnWidths(columnWidths, shiftKey, finished, source) {\n const sets = [];\n columnWidths.forEach((columnWidth) => {\n const col = this.columnModel.getColDefCol(columnWidth.key) || this.columnModel.getCol(columnWidth.key);\n if (!col) {\n return;\n }\n sets.push({\n width: columnWidth.newWidth,\n ratios: [1],\n columns: [col]\n });\n const defaultIsShift = this.gos.get(\"colResizeDefault\") === \"shift\";\n if (defaultIsShift) {\n shiftKey = !shiftKey;\n }\n if (shiftKey) {\n const otherCol = this.visibleColsService.getColAfter(col);\n if (!otherCol) {\n return;\n }\n const widthDiff = col.getActualWidth() - columnWidth.newWidth;\n const otherColWidth = otherCol.getActualWidth() + widthDiff;\n sets.push({\n width: otherColWidth,\n ratios: [1],\n columns: [otherCol]\n });\n }\n });\n if (sets.length === 0) {\n return;\n }\n this.resizeColumnSets({\n resizeSets: sets,\n finished,\n source\n });\n }\n // method takes sets of columns and resizes them. either all sets will be resized, or nothing\n // be resized. this is used for example when user tries to resize a group and holds shift key,\n // then both the current group (grows), and the adjacent group (shrinks), will get resized,\n // so that's two sets for this method.\n resizeColumnSets(params) {\n const { resizeSets, finished, source } = params;\n const passMinMaxCheck = !resizeSets || resizeSets.every((columnResizeSet) => this.checkMinAndMaxWidthsForSet(columnResizeSet));\n if (!passMinMaxCheck) {\n if (finished) {\n const columns = resizeSets && resizeSets.length > 0 ? resizeSets[0].columns : null;\n this.eventDispatcher.columnResized(columns, finished, source);\n }\n return;\n }\n const changedCols = [];\n const allResizedCols = [];\n resizeSets.forEach((set) => {\n const { width, columns, ratios } = set;\n const newWidths = {};\n const finishedCols = {};\n columns.forEach((col) => allResizedCols.push(col));\n let finishedColsGrew = true;\n let loopCount = 0;\n while (finishedColsGrew) {\n loopCount++;\n if (loopCount > 1e3) {\n _errorOnce(\"infinite loop in resizeColumnSets\");\n break;\n }\n finishedColsGrew = false;\n const subsetCols = [];\n let subsetRatioTotal = 0;\n let pixelsToDistribute = width;\n columns.forEach((col, index) => {\n const thisColFinished = finishedCols[col.getId()];\n if (thisColFinished) {\n pixelsToDistribute -= newWidths[col.getId()];\n } else {\n subsetCols.push(col);\n const ratioThisCol = ratios[index];\n subsetRatioTotal += ratioThisCol;\n }\n });\n const ratioScale = 1 / subsetRatioTotal;\n subsetCols.forEach((col, index) => {\n const lastCol = index === subsetCols.length - 1;\n let colNewWidth;\n if (lastCol) {\n colNewWidth = pixelsToDistribute;\n } else {\n colNewWidth = Math.round(ratios[index] * width * ratioScale);\n pixelsToDistribute -= colNewWidth;\n }\n const minWidth = col.getMinWidth();\n const maxWidth = col.getMaxWidth();\n if (colNewWidth < minWidth) {\n colNewWidth = minWidth;\n finishedCols[col.getId()] = true;\n finishedColsGrew = true;\n } else if (maxWidth > 0 && colNewWidth > maxWidth) {\n colNewWidth = maxWidth;\n finishedCols[col.getId()] = true;\n finishedColsGrew = true;\n }\n newWidths[col.getId()] = colNewWidth;\n });\n }\n columns.forEach((col) => {\n const newWidth = newWidths[col.getId()];\n const actualWidth = col.getActualWidth();\n if (actualWidth !== newWidth) {\n col.setActualWidth(newWidth, source);\n changedCols.push(col);\n }\n });\n });\n const atLeastOneColChanged = changedCols.length > 0;\n let flexedCols = [];\n if (atLeastOneColChanged) {\n flexedCols = this.refreshFlexedColumns({ resizingCols: allResizedCols, skipSetLeft: true });\n this.visibleColsService.setLeftValues(source);\n this.visibleColsService.updateBodyWidths();\n this.columnViewportService.checkViewportColumns();\n }\n const colsForEvent = allResizedCols.concat(flexedCols);\n if (atLeastOneColChanged || finished) {\n this.eventDispatcher.columnResized(colsForEvent, finished, source, flexedCols);\n }\n }\n checkMinAndMaxWidthsForSet(columnResizeSet) {\n const { columns, width } = columnResizeSet;\n let minWidthAccumulated = 0;\n let maxWidthAccumulated = 0;\n let maxWidthActive = true;\n columns.forEach((col) => {\n const minWidth = col.getMinWidth();\n minWidthAccumulated += minWidth || 0;\n const maxWidth = col.getMaxWidth();\n if (maxWidth > 0) {\n maxWidthAccumulated += maxWidth;\n } else {\n maxWidthActive = false;\n }\n });\n const minWidthPasses = width >= minWidthAccumulated;\n const maxWidthPasses = !maxWidthActive || width <= maxWidthAccumulated;\n return minWidthPasses && maxWidthPasses;\n }\n refreshFlexedColumns(params = {}) {\n const source = params.source ? params.source : \"flex\";\n if (params.viewportWidth != null) {\n this.flexViewportWidth = params.viewportWidth;\n }\n if (!this.flexViewportWidth) {\n return [];\n }\n const displayedCenterCols = this.visibleColsService.getCenterCols();\n let flexAfterDisplayIndex = -1;\n if (params.resizingCols) {\n const allResizingCols = new Set(params.resizingCols);\n for (let i = displayedCenterCols.length - 1; i >= 0; i--) {\n if (allResizingCols.has(displayedCenterCols[i])) {\n flexAfterDisplayIndex = i;\n break;\n }\n }\n }\n let knownColumnsWidth = 0;\n let flexingColumns = [];\n let minimumFlexedWidth = 0;\n let totalFlex = 0;\n for (let i = 0; i < displayedCenterCols.length; i++) {\n const isFlex = displayedCenterCols[i].getFlex() && i > flexAfterDisplayIndex;\n if (isFlex) {\n flexingColumns.push(displayedCenterCols[i]);\n totalFlex += displayedCenterCols[i].getFlex();\n minimumFlexedWidth += displayedCenterCols[i].getMinWidth();\n } else {\n knownColumnsWidth += displayedCenterCols[i].getActualWidth();\n }\n }\n if (!flexingColumns.length) {\n return [];\n }\n let changedColumns = [];\n if (knownColumnsWidth + minimumFlexedWidth > this.flexViewportWidth) {\n flexingColumns.forEach((col) => col.setActualWidth(col.getMinWidth(), source));\n changedColumns = flexingColumns;\n flexingColumns = [];\n }\n const flexingColumnSizes = [];\n let spaceForFlexingColumns;\n outer:\n while (true) {\n spaceForFlexingColumns = this.flexViewportWidth - knownColumnsWidth;\n const spacePerFlex = spaceForFlexingColumns / totalFlex;\n for (let i = 0; i < flexingColumns.length; i++) {\n const col = flexingColumns[i];\n const widthByFlexRule = spacePerFlex * col.getFlex();\n let constrainedWidth = 0;\n const minWidth = col.getMinWidth();\n const maxWidth = col.getMaxWidth();\n if (widthByFlexRule < minWidth) {\n constrainedWidth = minWidth;\n } else if (widthByFlexRule > maxWidth) {\n constrainedWidth = maxWidth;\n }\n if (constrainedWidth) {\n col.setActualWidth(constrainedWidth, source);\n _removeFromUnorderedArray(flexingColumns, col);\n totalFlex -= col.getFlex();\n changedColumns.push(col);\n knownColumnsWidth += col.getActualWidth();\n continue outer;\n }\n flexingColumnSizes[i] = Math.round(widthByFlexRule);\n }\n break;\n }\n let remainingSpace = spaceForFlexingColumns;\n flexingColumns.forEach((col, i) => {\n col.setActualWidth(Math.min(flexingColumnSizes[i], remainingSpace), source);\n changedColumns.push(col);\n remainingSpace -= flexingColumnSizes[i];\n });\n if (!params.skipSetLeft) {\n this.visibleColsService.setLeftValues(source);\n }\n if (params.updateBodyWidths) {\n this.visibleColsService.updateBodyWidths();\n }\n if (params.fireResizedEvent) {\n this.eventDispatcher.columnResized(changedColumns, true, source, flexingColumns);\n }\n return flexingColumns;\n }\n // called from api\n sizeColumnsToFit(gridWidth, source = \"sizeColumnsToFit\", silent, params) {\n if (this.columnModel.isShouldQueueResizeOperations()) {\n this.columnModel.pushResizeOperation(() => this.sizeColumnsToFit(gridWidth, source, silent, params));\n return;\n }\n const limitsMap = {};\n if (params) {\n params?.columnLimits?.forEach(({ key, ...dimensions }) => {\n limitsMap[typeof key === \"string\" ? key : key.getColId()] = dimensions;\n });\n }\n const allDisplayedColumns = this.visibleColsService.getAllCols();\n const doColumnsAlreadyFit = gridWidth === getWidthOfColsInList(allDisplayedColumns);\n if (gridWidth <= 0 || !allDisplayedColumns.length || doColumnsAlreadyFit) {\n return;\n }\n const colsToSpread = [];\n const colsToNotSpread = [];\n allDisplayedColumns.forEach((column) => {\n if (column.getColDef().suppressSizeToFit === true) {\n colsToNotSpread.push(column);\n } else {\n colsToSpread.push(column);\n }\n });\n const colsToDispatchEventFor = colsToSpread.slice(0);\n let finishedResizing = false;\n const moveToNotSpread = (column) => {\n _removeFromArray(colsToSpread, column);\n colsToNotSpread.push(column);\n };\n colsToSpread.forEach((column) => {\n column.resetActualWidth(source);\n const widthOverride = limitsMap?.[column.getId()];\n const minOverride = widthOverride?.minWidth ?? params?.defaultMinWidth;\n const maxOverride = widthOverride?.maxWidth ?? params?.defaultMaxWidth;\n const colWidth = column.getActualWidth();\n if (typeof minOverride === \"number\" && colWidth < minOverride) {\n column.setActualWidth(minOverride, source, true);\n } else if (typeof maxOverride === \"number\" && colWidth > maxOverride) {\n column.setActualWidth(maxOverride, source, true);\n }\n });\n while (!finishedResizing) {\n finishedResizing = true;\n const availablePixels = gridWidth - getWidthOfColsInList(colsToNotSpread);\n if (availablePixels <= 0) {\n colsToSpread.forEach((column) => {\n const widthOverride = limitsMap?.[column.getId()]?.minWidth ?? params?.defaultMinWidth;\n if (typeof widthOverride === \"number\") {\n column.setActualWidth(widthOverride, source, true);\n return;\n }\n column.setMinimum(source);\n });\n } else {\n const scale = availablePixels / getWidthOfColsInList(colsToSpread);\n let pixelsForLastCol = availablePixels;\n for (let i = colsToSpread.length - 1; i >= 0; i--) {\n const column = colsToSpread[i];\n const widthOverride = limitsMap?.[column.getId()];\n const minOverride = widthOverride?.minWidth ?? params?.defaultMinWidth;\n const maxOverride = widthOverride?.maxWidth ?? params?.defaultMaxWidth;\n const colMinWidth = column.getMinWidth();\n const colMaxWidth = column.getMaxWidth();\n const minWidth = typeof minOverride === \"number\" && minOverride > colMinWidth ? minOverride : colMinWidth;\n const maxWidth = typeof maxOverride === \"number\" && maxOverride < colMaxWidth ? maxOverride : colMaxWidth;\n let newWidth = Math.round(column.getActualWidth() * scale);\n if (newWidth < minWidth) {\n newWidth = minWidth;\n moveToNotSpread(column);\n finishedResizing = false;\n } else if (newWidth > maxWidth) {\n newWidth = maxWidth;\n moveToNotSpread(column);\n finishedResizing = false;\n } else if (i === 0) {\n newWidth = pixelsForLastCol;\n }\n column.setActualWidth(newWidth, source, true);\n pixelsForLastCol -= newWidth;\n }\n }\n }\n colsToDispatchEventFor.forEach((col) => {\n col.fireColumnWidthChangedEvent(source);\n });\n this.visibleColsService.setLeftValues(source);\n this.visibleColsService.updateBodyWidths();\n if (silent) {\n return;\n }\n this.eventDispatcher.columnResized(colsToDispatchEventFor, true, source);\n }\n applyAutosizeStrategy() {\n const autoSizeStrategy = this.gos.get(\"autoSizeStrategy\");\n if (!autoSizeStrategy) {\n return;\n }\n const { type } = autoSizeStrategy;\n setTimeout(() => {\n if (type === \"fitGridWidth\") {\n const { columnLimits: propColumnLimits, defaultMinWidth, defaultMaxWidth } = autoSizeStrategy;\n const columnLimits = propColumnLimits?.map(({ colId: key, minWidth, maxWidth }) => ({\n key,\n minWidth,\n maxWidth\n }));\n this.ctrlsService.getGridBodyCtrl().sizeColumnsToFit({\n defaultMinWidth,\n defaultMaxWidth,\n columnLimits\n });\n } else if (type === \"fitProvidedWidth\") {\n this.sizeColumnsToFit(autoSizeStrategy.width, \"sizeColumnsToFit\");\n }\n });\n }\n};\n\n// community-modules/core/src/entities/agColumnGroup.ts\nfunction createUniqueColumnGroupId(groupId, instanceId) {\n return groupId + \"_\" + instanceId;\n}\nfunction isColumnGroup(col) {\n return col instanceof AgColumnGroup;\n}\nvar AgColumnGroup = class extends BeanStub {\n constructor(providedColumnGroup, groupId, partId, pinned) {\n super();\n this.isColumn = false;\n // depends on the open/closed state of the group, only displaying columns are stored here\n this.displayedChildren = [];\n this.parent = null;\n this.groupId = groupId;\n this.partId = partId;\n this.providedColumnGroup = providedColumnGroup;\n this.pinned = pinned;\n }\n // as the user is adding and removing columns, the groups are recalculated.\n // this reset clears out all children, ready for children to be added again\n reset() {\n this.parent = null;\n this.children = null;\n this.displayedChildren = null;\n }\n getParent() {\n return this.parent;\n }\n setParent(parent) {\n this.parent = parent;\n }\n getUniqueId() {\n return createUniqueColumnGroupId(this.groupId, this.partId);\n }\n isEmptyGroup() {\n return this.displayedChildren.length === 0;\n }\n isMoving() {\n const allLeafColumns = this.getProvidedColumnGroup().getLeafColumns();\n if (!allLeafColumns || allLeafColumns.length === 0) {\n return false;\n }\n return allLeafColumns.every((col) => col.isMoving());\n }\n checkLeft() {\n this.displayedChildren.forEach((child) => {\n if (isColumnGroup(child)) {\n child.checkLeft();\n }\n });\n if (this.displayedChildren.length > 0) {\n if (this.gos.get(\"enableRtl\")) {\n const lastChild = _last(this.displayedChildren);\n const lastChildLeft = lastChild.getLeft();\n this.setLeft(lastChildLeft);\n } else {\n const firstChildLeft = this.displayedChildren[0].getLeft();\n this.setLeft(firstChildLeft);\n }\n } else {\n this.setLeft(null);\n }\n }\n getLeft() {\n return this.left;\n }\n getOldLeft() {\n return this.oldLeft;\n }\n setLeft(left) {\n this.oldLeft = this.left;\n if (this.left !== left) {\n this.left = left;\n this.dispatchLocalEvent({ type: \"leftChanged\" });\n }\n }\n getPinned() {\n return this.pinned;\n }\n getGroupId() {\n return this.groupId;\n }\n getPartId() {\n return this.partId;\n }\n getActualWidth() {\n let groupActualWidth = 0;\n if (this.displayedChildren) {\n this.displayedChildren.forEach((child) => {\n groupActualWidth += child.getActualWidth();\n });\n }\n return groupActualWidth;\n }\n isResizable() {\n if (!this.displayedChildren) {\n return false;\n }\n let result = false;\n this.displayedChildren.forEach((child) => {\n if (child.isResizable()) {\n result = true;\n }\n });\n return result;\n }\n getMinWidth() {\n let result = 0;\n this.displayedChildren.forEach((groupChild) => {\n result += groupChild.getMinWidth();\n });\n return result;\n }\n addChild(child) {\n if (!this.children) {\n this.children = [];\n }\n this.children.push(child);\n }\n getDisplayedChildren() {\n return this.displayedChildren;\n }\n getLeafColumns() {\n const result = [];\n this.addLeafColumns(result);\n return result;\n }\n getDisplayedLeafColumns() {\n const result = [];\n this.addDisplayedLeafColumns(result);\n return result;\n }\n getDefinition() {\n return this.providedColumnGroup.getColGroupDef();\n }\n getColGroupDef() {\n return this.providedColumnGroup.getColGroupDef();\n }\n isPadding() {\n return this.providedColumnGroup.isPadding();\n }\n isExpandable() {\n return this.providedColumnGroup.isExpandable();\n }\n isExpanded() {\n return this.providedColumnGroup.isExpanded();\n }\n setExpanded(expanded) {\n this.providedColumnGroup.setExpanded(expanded);\n }\n addDisplayedLeafColumns(leafColumns) {\n this.displayedChildren.forEach((child) => {\n if (isColumn(child)) {\n leafColumns.push(child);\n } else if (isColumnGroup(child)) {\n child.addDisplayedLeafColumns(leafColumns);\n }\n });\n }\n addLeafColumns(leafColumns) {\n this.children.forEach((child) => {\n if (isColumn(child)) {\n leafColumns.push(child);\n } else if (isColumnGroup(child)) {\n child.addLeafColumns(leafColumns);\n }\n });\n }\n getChildren() {\n return this.children;\n }\n getColumnGroupShow() {\n return this.providedColumnGroup.getColumnGroupShow();\n }\n getProvidedColumnGroup() {\n return this.providedColumnGroup;\n }\n getPaddingLevel() {\n const parent = this.getParent();\n if (!this.isPadding() || !parent || !parent.isPadding()) {\n return 0;\n }\n return 1 + parent.getPaddingLevel();\n }\n calculateDisplayedColumns() {\n this.displayedChildren = [];\n let parentWithExpansion = this;\n while (parentWithExpansion != null && parentWithExpansion.isPadding()) {\n parentWithExpansion = parentWithExpansion.getParent();\n }\n const isExpandable = parentWithExpansion ? parentWithExpansion.getProvidedColumnGroup().isExpandable() : false;\n if (!isExpandable) {\n this.displayedChildren = this.children;\n this.dispatchLocalEvent({ type: \"displayedChildrenChanged\" });\n return;\n }\n this.children.forEach((child) => {\n const emptyGroup = isColumnGroup(child) && (!child.displayedChildren || !child.displayedChildren.length);\n if (emptyGroup) {\n return;\n }\n const headerGroupShow = child.getColumnGroupShow();\n switch (headerGroupShow) {\n case \"open\":\n if (parentWithExpansion.getProvidedColumnGroup().isExpanded()) {\n this.displayedChildren.push(child);\n }\n break;\n case \"closed\":\n if (!parentWithExpansion.getProvidedColumnGroup().isExpanded()) {\n this.displayedChildren.push(child);\n }\n break;\n default:\n this.displayedChildren.push(child);\n break;\n }\n });\n this.dispatchLocalEvent({ type: \"displayedChildrenChanged\" });\n }\n};\n\n// community-modules/core/src/columns/groupInstanceIdCreator.ts\nvar GroupInstanceIdCreator = class {\n constructor() {\n // this map contains keys to numbers, so we remember what the last call was\n this.existingIds = {};\n }\n getInstanceIdForKey(key) {\n const lastResult = this.existingIds[key];\n let result;\n if (typeof lastResult !== \"number\") {\n result = 0;\n } else {\n result = lastResult + 1;\n }\n this.existingIds[key] = result;\n return result;\n }\n};\n\n// community-modules/core/src/columns/visibleColsService.ts\nvar VisibleColsService = class extends BeanStub {\n constructor() {\n super(...arguments);\n this.beanName = \"visibleColsService\";\n // for fast lookup, to see if a column or group is still visible\n this.colsAndGroupsMap = {};\n // leave level columns of the displayed trees\n this.columnsLeft = [];\n this.columnsRight = [];\n this.columnsCenter = [];\n // all three lists above combined\n this.columns = [];\n this.bodyWidth = 0;\n this.leftWidth = 0;\n this.rightWidth = 0;\n this.bodyWidthDirty = true;\n }\n wireBeans(beans) {\n this.columnModel = beans.columnModel;\n this.columnSizeService = beans.columnSizeService;\n this.columnViewportService = beans.columnViewportService;\n this.eventDispatcher = beans.columnEventDispatcher;\n }\n refresh(source, skipTreeBuild = false) {\n if (!skipTreeBuild) {\n this.buildTrees();\n }\n this.updateOpenClosedVisibilityInColumnGroups();\n this.columnsLeft = pickDisplayedCols(this.treeLeft);\n this.columnsCenter = pickDisplayedCols(this.treeCenter);\n this.columnsRight = pickDisplayedCols(this.treeRight);\n this.joinColsAriaOrder();\n this.joinCols();\n this.setLeftValues(source);\n this.autoHeightCols = this.columns.filter((col) => col.isAutoHeight());\n this.columnSizeService.refreshFlexedColumns();\n this.updateBodyWidths();\n this.columnViewportService.checkViewportColumns(false);\n this.setFirstRightAndLastLeftPinned(source);\n this.eventDispatcher.visibleCols();\n }\n // after setColumnWidth or updateGroupsAndPresentedCols\n updateBodyWidths() {\n const newBodyWidth = getWidthOfColsInList(this.columnsCenter);\n const newLeftWidth = getWidthOfColsInList(this.columnsLeft);\n const newRightWidth = getWidthOfColsInList(this.columnsRight);\n this.bodyWidthDirty = this.bodyWidth !== newBodyWidth;\n const atLeastOneChanged = this.bodyWidth !== newBodyWidth || this.leftWidth !== newLeftWidth || this.rightWidth !== newRightWidth;\n if (atLeastOneChanged) {\n this.bodyWidth = newBodyWidth;\n this.leftWidth = newLeftWidth;\n this.rightWidth = newRightWidth;\n const evt = {\n type: \"columnContainerWidthChanged\"\n };\n this.eventService.dispatchEvent(evt);\n const event = {\n type: \"displayedColumnsWidthChanged\"\n };\n this.eventService.dispatchEvent(event);\n }\n }\n // sets the left pixel position of each column\n setLeftValues(source) {\n this.setLeftValuesOfCols(source);\n this.setLeftValuesOfGroups();\n }\n setFirstRightAndLastLeftPinned(source) {\n let lastLeft;\n let firstRight;\n if (this.gos.get(\"enableRtl\")) {\n lastLeft = this.columnsLeft ? this.columnsLeft[0] : null;\n firstRight = this.columnsRight ? _last(this.columnsRight) : null;\n } else {\n lastLeft = this.columnsLeft ? _last(this.columnsLeft) : null;\n firstRight = this.columnsRight ? this.columnsRight[0] : null;\n }\n this.columnModel.getCols().forEach((col) => {\n col.setLastLeftPinned(col === lastLeft, source);\n col.setFirstRightPinned(col === firstRight, source);\n });\n }\n buildTrees() {\n const cols = this.columnModel.getColsToShow();\n const leftCols = cols.filter((col) => col.getPinned() == \"left\");\n const rightCols = cols.filter((col) => col.getPinned() == \"right\");\n const centerCols = cols.filter((col) => col.getPinned() != \"left\" && col.getPinned() != \"right\");\n const idCreator = new GroupInstanceIdCreator();\n this.treeLeft = this.createGroups({\n columns: leftCols,\n idCreator,\n pinned: \"left\",\n oldDisplayedGroups: this.treeLeft\n });\n this.treeRight = this.createGroups({\n columns: rightCols,\n idCreator,\n pinned: \"right\",\n oldDisplayedGroups: this.treeRight\n });\n this.treeCenter = this.createGroups({\n columns: centerCols,\n idCreator,\n pinned: null,\n oldDisplayedGroups: this.treeCenter\n });\n this.updateColsAndGroupsMap();\n }\n clear() {\n this.columnsLeft = [];\n this.columnsRight = [];\n this.columnsCenter = [];\n this.columns = [];\n this.ariaOrderColumns = [];\n }\n joinColsAriaOrder() {\n const allColumns = this.columnModel.getCols();\n const pinnedLeft = [];\n const center = [];\n const pinnedRight = [];\n for (const col of allColumns) {\n const pinned = col.getPinned();\n if (!pinned) {\n center.push(col);\n } else if (pinned === true || pinned === \"left\") {\n pinnedLeft.push(col);\n } else {\n pinnedRight.push(col);\n }\n }\n this.ariaOrderColumns = pinnedLeft.concat(center).concat(pinnedRight);\n }\n getAriaColIndex(colOrGroup) {\n let col;\n if (isColumnGroup(colOrGroup)) {\n col = colOrGroup.getLeafColumns()[0];\n } else {\n col = colOrGroup;\n }\n return this.ariaOrderColumns.indexOf(col) + 1;\n }\n getAllAutoHeightCols() {\n return this.autoHeightCols;\n }\n setLeftValuesOfGroups() {\n [this.treeLeft, this.treeRight, this.treeCenter].forEach((columns) => {\n columns.forEach((column) => {\n if (isColumnGroup(column)) {\n const columnGroup = column;\n columnGroup.checkLeft();\n }\n });\n });\n }\n setLeftValuesOfCols(source) {\n const primaryCols = this.columnModel.getColDefCols();\n if (!primaryCols) {\n return;\n }\n const allColumns = this.columnModel.getCols().slice(0);\n const doingRtl = this.gos.get(\"enableRtl\");\n [this.columnsLeft, this.columnsRight, this.columnsCenter].forEach((columns) => {\n if (doingRtl) {\n let left = getWidthOfColsInList(columns);\n columns.forEach((column) => {\n left -= column.getActualWidth();\n column.setLeft(left, source);\n });\n } else {\n let left = 0;\n columns.forEach((column) => {\n column.setLeft(left, source);\n left += column.getActualWidth();\n });\n }\n _removeAllFromUnorderedArray(allColumns, columns);\n });\n allColumns.forEach((column) => {\n column.setLeft(null, source);\n });\n }\n joinCols() {\n if (this.gos.get(\"enableRtl\")) {\n this.columns = this.columnsRight.concat(this.columnsCenter).concat(this.columnsLeft);\n } else {\n this.columns = this.columnsLeft.concat(this.columnsCenter).concat(this.columnsRight);\n }\n }\n getColsCenter() {\n return this.columnsCenter;\n }\n getAllTrees() {\n if (this.treeLeft && this.treeRight && this.treeCenter) {\n return this.treeLeft.concat(this.treeCenter).concat(this.treeRight);\n }\n return null;\n }\n // + headerRenderer -> setting pinned body width\n getTreeLeft() {\n return this.treeLeft;\n }\n // + headerRenderer -> setting pinned body width\n getTreeRight() {\n return this.treeRight;\n }\n // + headerRenderer -> setting pinned body width\n getTreeCenter() {\n return this.treeCenter;\n }\n // + csvCreator\n getAllCols() {\n return this.columns;\n }\n // gridPanel -> ensureColumnVisible\n isColDisplayed(column) {\n return this.getAllCols().indexOf(column) >= 0;\n }\n getLeftColsForRow(rowNode) {\n const colSpanActive = this.columnModel.isColSpanActive();\n if (!colSpanActive) {\n return this.columnsLeft;\n }\n return this.getColsForRow(rowNode, this.columnsLeft);\n }\n getRightColsForRow(rowNode) {\n const colSpanActive = this.columnModel.isColSpanActive();\n if (!colSpanActive) {\n return this.columnsRight;\n }\n return this.getColsForRow(rowNode, this.columnsRight);\n }\n getColsForRow(rowNode, displayedColumns, filterCallback, emptySpaceBeforeColumn) {\n const result = [];\n let lastConsideredCol = null;\n for (let i = 0; i < displayedColumns.length; i++) {\n const col = displayedColumns[i];\n const maxAllowedColSpan = displayedColumns.length - i;\n const colSpan = Math.min(col.getColSpan(rowNode), maxAllowedColSpan);\n const columnsToCheckFilter = [col];\n if (colSpan > 1) {\n const colsToRemove = colSpan - 1;\n for (let j = 1; j <= colsToRemove; j++) {\n columnsToCheckFilter.push(displayedColumns[i + j]);\n }\n i += colsToRemove;\n }\n let filterPasses;\n if (filterCallback) {\n filterPasses = false;\n columnsToCheckFilter.forEach((colForFilter) => {\n if (filterCallback(colForFilter)) {\n filterPasses = true;\n }\n });\n } else {\n filterPasses = true;\n }\n if (filterPasses) {\n if (result.length === 0 && lastConsideredCol) {\n const gapBeforeColumn = emptySpaceBeforeColumn ? emptySpaceBeforeColumn(col) : false;\n if (gapBeforeColumn) {\n result.push(lastConsideredCol);\n }\n }\n result.push(col);\n }\n lastConsideredCol = col;\n }\n return result;\n }\n // used by:\n // + angularGrid -> for setting body width\n // + rowController -> setting main row widths (when inserting and resizing)\n // need to cache this\n getBodyContainerWidth() {\n return this.bodyWidth;\n }\n getContainerWidth(pinned) {\n switch (pinned) {\n case \"left\":\n return this.leftWidth;\n case \"right\":\n return this.rightWidth;\n default:\n return this.bodyWidth;\n }\n }\n // + rowController -> while inserting rows\n getCenterCols() {\n return this.columnsCenter;\n }\n // + rowController -> while inserting rows\n getLeftCols() {\n return this.columnsLeft;\n }\n getRightCols() {\n return this.columnsRight;\n }\n getColBefore(col) {\n const allDisplayedColumns = this.getAllCols();\n const oldIndex = allDisplayedColumns.indexOf(col);\n if (oldIndex > 0) {\n return allDisplayedColumns[oldIndex - 1];\n }\n return null;\n }\n getGroupAtDirection(columnGroup, direction) {\n const requiredLevel = columnGroup.getProvidedColumnGroup().getLevel() + columnGroup.getPaddingLevel();\n const colGroupLeafColumns = columnGroup.getDisplayedLeafColumns();\n const col = direction === \"After\" ? _last(colGroupLeafColumns) : colGroupLeafColumns[0];\n const getDisplayColMethod = `getCol${direction}`;\n while (true) {\n const column = this[getDisplayColMethod](col);\n if (!column) {\n return null;\n }\n const groupPointer = this.getColGroupAtLevel(column, requiredLevel);\n if (groupPointer !== columnGroup) {\n return groupPointer;\n }\n }\n }\n getColGroupAtLevel(column, level) {\n let groupPointer = column.getParent();\n let originalGroupLevel;\n let groupPointerLevel;\n while (true) {\n const groupPointerProvidedColumnGroup = groupPointer.getProvidedColumnGroup();\n originalGroupLevel = groupPointerProvidedColumnGroup.getLevel();\n groupPointerLevel = groupPointer.getPaddingLevel();\n if (originalGroupLevel + groupPointerLevel <= level) {\n break;\n }\n groupPointer = groupPointer.getParent();\n }\n return groupPointer;\n }\n isPinningLeft() {\n return this.columnsLeft.length > 0;\n }\n isPinningRight() {\n return this.columnsRight.length > 0;\n }\n updateColsAndGroupsMap() {\n this.colsAndGroupsMap = {};\n const func = (child) => {\n this.colsAndGroupsMap[child.getUniqueId()] = child;\n };\n depthFirstAllColumnTreeSearch(this.treeCenter, false, func);\n depthFirstAllColumnTreeSearch(this.treeLeft, false, func);\n depthFirstAllColumnTreeSearch(this.treeRight, false, func);\n }\n isVisible(item) {\n const fromMap = this.colsAndGroupsMap[item.getUniqueId()];\n return fromMap === item;\n }\n updateOpenClosedVisibilityInColumnGroups() {\n const allColumnGroups = this.getAllTrees();\n depthFirstAllColumnTreeSearch(allColumnGroups, false, (child) => {\n if (isColumnGroup(child)) {\n child.calculateDisplayedColumns();\n }\n });\n }\n getFirstColumn() {\n const isRtl = this.gos.get(\"enableRtl\");\n const queryOrder = [\n \"getLeftCols\",\n \"getCenterCols\",\n \"getRightCols\"\n ];\n if (isRtl) {\n queryOrder.reverse();\n }\n for (let i = 0; i < queryOrder.length; i++) {\n const container = this[queryOrder[i]]();\n if (container.length) {\n return isRtl ? _last(container) : container[0];\n }\n }\n return null;\n }\n // returns the group with matching colId and instanceId. If instanceId is missing,\n // matches only on the colId.\n getColumnGroup(colId, partId) {\n if (!colId) {\n return null;\n }\n if (isColumnGroup(colId)) {\n return colId;\n }\n const allColumnGroups = this.getAllTrees();\n const checkPartId = typeof partId === \"number\";\n let result = null;\n depthFirstAllColumnTreeSearch(allColumnGroups, false, (child) => {\n if (isColumnGroup(child)) {\n const columnGroup = child;\n let matched;\n if (checkPartId) {\n matched = colId === columnGroup.getGroupId() && partId === columnGroup.getPartId();\n } else {\n matched = colId === columnGroup.getGroupId();\n }\n if (matched) {\n result = columnGroup;\n }\n }\n });\n return result;\n }\n // used by:\n // + rowRenderer -> for navigation\n getColAfter(col) {\n const allDisplayedColumns = this.getAllCols();\n const oldIndex = allDisplayedColumns.indexOf(col);\n if (oldIndex < allDisplayedColumns.length - 1) {\n return allDisplayedColumns[oldIndex + 1];\n }\n return null;\n }\n isBodyWidthDirty() {\n return this.bodyWidthDirty;\n }\n setBodyWidthDirty() {\n this.bodyWidthDirty = true;\n }\n // used by:\n // + angularGrid -> setting pinned body width\n // note: this should be cached\n getColsLeftWidth() {\n return getWidthOfColsInList(this.columnsLeft);\n }\n // note: this should be cached\n getDisplayedColumnsRightWidth() {\n return getWidthOfColsInList(this.columnsRight);\n }\n isColAtEdge(col, edge) {\n const allColumns = this.getAllCols();\n if (!allColumns.length) {\n return false;\n }\n const isFirst = edge === \"first\";\n let columnToCompare;\n if (isColumnGroup(col)) {\n const leafColumns = col.getDisplayedLeafColumns();\n if (!leafColumns.length) {\n return false;\n }\n columnToCompare = isFirst ? leafColumns[0] : _last(leafColumns);\n } else {\n columnToCompare = col;\n }\n return (isFirst ? allColumns[0] : _last(allColumns)) === columnToCompare;\n }\n createGroups(params) {\n const { columns, idCreator, pinned, oldDisplayedGroups, isStandaloneStructure } = params;\n const oldColumnsMapped = this.mapOldGroupsById(oldDisplayedGroups);\n const topLevelResultCols = [];\n let groupsOrColsAtCurrentLevel = columns;\n while (groupsOrColsAtCurrentLevel.length) {\n const currentlyIterating = groupsOrColsAtCurrentLevel;\n groupsOrColsAtCurrentLevel = [];\n let lastGroupedColIdx = 0;\n const createGroupToIndex = (to) => {\n const from = lastGroupedColIdx;\n lastGroupedColIdx = to;\n const previousNode = currentlyIterating[from];\n const previousNodeProvided = isColumnGroup(previousNode) ? previousNode.getProvidedColumnGroup() : previousNode;\n const previousNodeParent = previousNodeProvided.getOriginalParent();\n if (previousNodeParent == null) {\n for (let i = from; i < to; i++) {\n topLevelResultCols.push(currentlyIterating[i]);\n }\n return;\n }\n const newGroup = this.createColGroup(\n previousNodeParent,\n idCreator,\n oldColumnsMapped,\n pinned,\n isStandaloneStructure\n );\n for (let i = from; i < to; i++) {\n newGroup.addChild(currentlyIterating[i]);\n }\n groupsOrColsAtCurrentLevel.push(newGroup);\n };\n for (let i = 1; i < currentlyIterating.length; i++) {\n const thisNode = currentlyIterating[i];\n const thisNodeProvided = isColumnGroup(thisNode) ? thisNode.getProvidedColumnGroup() : thisNode;\n const thisNodeParent = thisNodeProvided.getOriginalParent();\n const previousNode = currentlyIterating[lastGroupedColIdx];\n const previousNodeProvided = isColumnGroup(previousNode) ? previousNode.getProvidedColumnGroup() : previousNode;\n const previousNodeParent = previousNodeProvided.getOriginalParent();\n if (thisNodeParent !== previousNodeParent) {\n createGroupToIndex(i);\n }\n }\n if (lastGroupedColIdx < currentlyIterating.length) {\n createGroupToIndex(currentlyIterating.length);\n }\n }\n if (!isStandaloneStructure) {\n this.setupParentsIntoCols(topLevelResultCols, null);\n }\n return topLevelResultCols;\n }\n createColGroup(providedGroup, groupInstanceIdCreator, oldColumnsMapped, pinned, isStandaloneStructure) {\n const groupId = providedGroup.getGroupId();\n const instanceId = groupInstanceIdCreator.getInstanceIdForKey(groupId);\n const uniqueId = createUniqueColumnGroupId(groupId, instanceId);\n let columnGroup = oldColumnsMapped[uniqueId];\n if (columnGroup && columnGroup.getProvidedColumnGroup() !== providedGroup) {\n columnGroup = null;\n }\n if (_exists(columnGroup)) {\n columnGroup.reset();\n } else {\n columnGroup = new AgColumnGroup(providedGroup, groupId, instanceId, pinned);\n if (!isStandaloneStructure) {\n this.createBean(columnGroup);\n }\n }\n return columnGroup;\n }\n // returns back a 2d map of ColumnGroup as follows: groupId -> instanceId -> ColumnGroup\n mapOldGroupsById(displayedGroups) {\n const result = {};\n const recursive = (columnsOrGroups) => {\n columnsOrGroups.forEach((columnOrGroup) => {\n if (isColumnGroup(columnOrGroup)) {\n const columnGroup = columnOrGroup;\n result[columnOrGroup.getUniqueId()] = columnGroup;\n recursive(columnGroup.getChildren());\n }\n });\n };\n if (displayedGroups) {\n recursive(displayedGroups);\n }\n return result;\n }\n setupParentsIntoCols(columnsOrGroups, parent) {\n columnsOrGroups.forEach((columnsOrGroup) => {\n columnsOrGroup.setParent(parent);\n if (isColumnGroup(columnsOrGroup)) {\n const columnGroup = columnsOrGroup;\n this.setupParentsIntoCols(columnGroup.getChildren(), columnGroup);\n }\n });\n }\n};\nfunction depthFirstAllColumnTreeSearch(tree, useDisplayedChildren, callback) {\n if (!tree) {\n return;\n }\n for (let i = 0; i < tree.length; i++) {\n const child = tree[i];\n if (isColumnGroup(child)) {\n const childTree = useDisplayedChildren ? child.getDisplayedChildren() : child.getChildren();\n depthFirstAllColumnTreeSearch(childTree, useDisplayedChildren, callback);\n }\n callback(child);\n }\n}\nfunction pickDisplayedCols(tree) {\n const res = [];\n depthFirstAllColumnTreeSearch(tree, true, (child) => {\n if (isColumn(child)) {\n res.push(child);\n }\n });\n return res;\n}\n\n// community-modules/core/src/eventTypes.ts\nvar PUBLIC_EVENTS = [\n \"columnEverythingChanged\",\n \"newColumnsLoaded\",\n \"columnPivotModeChanged\",\n \"pivotMaxColumnsExceeded\",\n \"columnRowGroupChanged\",\n \"expandOrCollapseAll\",\n \"columnPivotChanged\",\n \"gridColumnsChanged\",\n \"columnValueChanged\",\n \"columnMoved\",\n \"columnVisible\",\n \"columnPinned\",\n \"columnGroupOpened\",\n \"columnResized\",\n \"displayedColumnsChanged\",\n \"virtualColumnsChanged\",\n \"columnHeaderMouseOver\",\n \"columnHeaderMouseLeave\",\n \"columnHeaderClicked\",\n \"columnHeaderContextMenu\",\n \"asyncTransactionsFlushed\",\n \"rowGroupOpened\",\n \"rowDataUpdated\",\n \"pinnedRowDataChanged\",\n \"rangeSelectionChanged\",\n \"chartCreated\",\n \"chartRangeSelectionChanged\",\n \"chartOptionsChanged\",\n \"chartDestroyed\",\n \"toolPanelVisibleChanged\",\n \"toolPanelSizeChanged\",\n \"modelUpdated\",\n \"cutStart\",\n \"cutEnd\",\n \"pasteStart\",\n \"pasteEnd\",\n \"fillStart\",\n \"fillEnd\",\n \"rangeDeleteStart\",\n \"rangeDeleteEnd\",\n \"undoStarted\",\n \"undoEnded\",\n \"redoStarted\",\n \"redoEnded\",\n \"cellClicked\",\n \"cellDoubleClicked\",\n \"cellMouseDown\",\n \"cellContextMenu\",\n \"cellValueChanged\",\n \"cellEditRequest\",\n \"rowValueChanged\",\n \"headerFocused\",\n \"cellFocused\",\n \"rowSelected\",\n \"selectionChanged\",\n \"tooltipShow\",\n \"tooltipHide\",\n \"cellKeyDown\",\n \"cellMouseOver\",\n \"cellMouseOut\",\n \"filterChanged\",\n \"filterModified\",\n \"filterOpened\",\n \"advancedFilterBuilderVisibleChanged\",\n \"sortChanged\",\n \"virtualRowRemoved\",\n \"rowClicked\",\n \"rowDoubleClicked\",\n \"gridReady\",\n \"gridPreDestroyed\",\n \"gridSizeChanged\",\n \"viewportChanged\",\n \"firstDataRendered\",\n \"dragStarted\",\n \"dragStopped\",\n \"rowEditingStarted\",\n \"rowEditingStopped\",\n \"cellEditingStarted\",\n \"cellEditingStopped\",\n \"bodyScroll\",\n \"bodyScrollEnd\",\n \"paginationChanged\",\n \"componentStateChanged\",\n \"storeRefreshed\",\n \"stateUpdated\",\n \"columnMenuVisibleChanged\",\n \"contextMenuVisibleChanged\",\n \"rowDragEnter\",\n \"rowDragMove\",\n \"rowDragLeave\",\n \"rowDragEnd\"\n];\nvar INTERNAL_EVENTS = [\n \"scrollbarWidthChanged\",\n \"keyShortcutChangedCellStart\",\n \"keyShortcutChangedCellEnd\",\n \"pinnedHeightChanged\",\n \"cellFocusCleared\",\n \"fullWidthRowFocused\",\n \"checkboxChanged\",\n \"heightScaleChanged\",\n \"suppressMovableColumns\",\n \"suppressMenuHide\",\n \"suppressFieldDotNotation\",\n \"columnPanelItemDragStart\",\n \"columnPanelItemDragEnd\",\n \"bodyHeightChanged\",\n \"columnContainerWidthChanged\",\n \"displayedColumnsWidthChanged\",\n \"scrollVisibilityChanged\",\n \"columnHoverChanged\",\n \"flashCells\",\n \"paginationPixelOffsetChanged\",\n \"displayedRowsChanged\",\n \"leftPinnedWidthChanged\",\n \"rightPinnedWidthChanged\",\n \"rowContainerHeightChanged\",\n \"headerHeightChanged\",\n \"columnHeaderHeightChanged\",\n \"gridStylesChanged\",\n \"storeUpdated\",\n \"filterDestroyed\",\n \"rowDataUpdateStarted\",\n \"rowCountReady\",\n \"advancedFilterEnabledChanged\",\n \"dataTypesInferred\",\n \"fieldValueChanged\",\n \"fieldPickerValueSelected\",\n \"richSelectListRowSelected\",\n \"sideBarUpdated\",\n \"alignedGridScroll\",\n \"alignedGridColumn\",\n \"gridOptionsChanged\",\n \"chartTitleEdit\",\n \"recalculateRowBounds\",\n \"stickyTopOffsetChanged\"\n];\nvar ALL_EVENTS = [...PUBLIC_EVENTS, ...INTERNAL_EVENTS];\n\n// community-modules/core/src/propertyKeys.ts\nvar INITIAL_GRID_OPTION_KEYS = {\n enableBrowserTooltips: true,\n tooltipTrigger: true,\n tooltipMouseTrack: true,\n tooltipShowMode: true,\n tooltipInteraction: true,\n defaultColGroupDef: true,\n suppressAutoSize: true,\n skipHeaderOnAutoSize: true,\n autoSizeStrategy: true,\n components: true,\n stopEditingWhenCellsLoseFocus: true,\n undoRedoCellEditing: true,\n undoRedoCellEditingLimit: true,\n excelStyles: true,\n cacheQuickFilter: true,\n advancedFilterModel: true,\n customChartThemes: true,\n chartThemeOverrides: true,\n chartToolPanelsDef: true,\n loadingCellRendererSelector: true,\n localeText: true,\n keepDetailRows: true,\n keepDetailRowsCount: true,\n detailRowHeight: true,\n detailRowAutoHeight: true,\n tabIndex: true,\n valueCache: true,\n valueCacheNeverExpires: true,\n enableCellExpressions: true,\n suppressTouch: true,\n suppressAsyncEvents: true,\n suppressBrowserResizeObserver: true,\n suppressPropertyNamesCheck: true,\n debug: true,\n loadingOverlayComponent: true,\n suppressLoadingOverlay: true,\n noRowsOverlayComponent: true,\n paginationPageSizeSelector: true,\n paginateChildRows: true,\n pivotPanelShow: true,\n pivotSuppressAutoColumn: true,\n suppressExpandablePivotGroups: true,\n aggFuncs: true,\n suppressAggFuncInHeader: true,\n removePivotHeaderRowWhenSingleValueColumn: true,\n allowShowChangeAfterFilter: true,\n ensureDomOrder: true,\n enableRtl: true,\n suppressColumnVirtualisation: true,\n suppressMaxRenderedRowRestriction: true,\n suppressRowVirtualisation: true,\n rowDragText: true,\n suppressGroupMaintainValueType: true,\n groupLockGroupColumns: true,\n rowGroupPanelSuppressSort: true,\n suppressGroupRowsSticky: true,\n rowModelType: true,\n cacheOverflowSize: true,\n infiniteInitialRowCount: true,\n serverSideInitialRowCount: true,\n suppressServerSideInfiniteScroll: true,\n maxBlocksInCache: true,\n maxConcurrentDatasourceRequests: true,\n blockLoadDebounceMillis: true,\n serverSideOnlyRefreshFilteredGroups: true,\n serverSidePivotResultFieldSeparator: true,\n viewportRowModelPageSize: true,\n viewportRowModelBufferSize: true,\n debounceVerticalScrollbar: true,\n suppressAnimationFrame: true,\n suppressPreventDefaultOnMouseWheel: true,\n scrollbarWidth: true,\n icons: true,\n suppressRowTransform: true,\n gridId: true,\n enableGroupEdit: true,\n initialState: true,\n processUnpinnedColumns: true,\n createChartContainer: true,\n getLocaleText: true,\n getRowId: true,\n reactiveCustomComponents: true,\n columnMenu: true\n};\nvar _PropertyKeys = class _PropertyKeys {\n};\n_PropertyKeys.STRING_PROPERTIES = [\n \"rowSelection\",\n \"overlayLoadingTemplate\",\n \"overlayNoRowsTemplate\",\n \"gridId\",\n \"quickFilterText\",\n \"rowModelType\",\n \"editType\",\n \"domLayout\",\n \"clipboardDelimiter\",\n \"rowGroupPanelShow\",\n \"multiSortKey\",\n \"pivotColumnGroupTotals\",\n \"pivotRowTotals\",\n \"pivotPanelShow\",\n \"fillHandleDirection\",\n \"groupDisplayType\",\n \"treeDataDisplayType\",\n \"colResizeDefault\",\n \"tooltipTrigger\",\n \"serverSidePivotResultFieldSeparator\",\n \"columnMenu\",\n \"tooltipShowMode\",\n \"grandTotalRow\"\n];\n_PropertyKeys.OBJECT_PROPERTIES = [\n \"components\",\n \"rowStyle\",\n \"context\",\n \"autoGroupColumnDef\",\n \"localeText\",\n \"icons\",\n \"datasource\",\n \"serverSideDatasource\",\n \"viewportDatasource\",\n \"groupRowRendererParams\",\n \"aggFuncs\",\n \"fullWidthCellRendererParams\",\n \"defaultColGroupDef\",\n \"defaultColDef\",\n \"defaultCsvExportParams\",\n \"defaultExcelExportParams\",\n \"columnTypes\",\n \"rowClassRules\",\n \"detailCellRendererParams\",\n \"loadingCellRendererParams\",\n \"loadingOverlayComponentParams\",\n \"noRowsOverlayComponentParams\",\n \"popupParent\",\n \"statusBar\",\n \"sideBar\",\n \"chartThemeOverrides\",\n \"customChartThemes\",\n \"chartToolPanelsDef\",\n \"dataTypeDefinitions\",\n \"advancedFilterModel\",\n \"advancedFilterParent\",\n \"advancedFilterBuilderParams\",\n \"initialState\",\n \"autoSizeStrategy\"\n];\n_PropertyKeys.ARRAY_PROPERTIES = [\n \"sortingOrder\",\n \"alignedGrids\",\n \"rowData\",\n \"columnDefs\",\n \"excelStyles\",\n \"pinnedTopRowData\",\n \"pinnedBottomRowData\",\n \"chartThemes\",\n \"rowClass\",\n \"paginationPageSizeSelector\"\n];\n// These properties are coerced at runtime, do not do union types\n_PropertyKeys.NUMBER_PROPERTIES = [\n \"rowHeight\",\n \"detailRowHeight\",\n \"rowBuffer\",\n \"headerHeight\",\n \"groupHeaderHeight\",\n \"groupLockGroupColumns\",\n \"floatingFiltersHeight\",\n \"pivotHeaderHeight\",\n \"pivotGroupHeaderHeight\",\n \"groupDefaultExpanded\",\n \"pivotDefaultExpanded\",\n \"viewportRowModelPageSize\",\n \"viewportRowModelBufferSize\",\n \"autoSizePadding\",\n \"maxBlocksInCache\",\n \"maxConcurrentDatasourceRequests\",\n \"tooltipShowDelay\",\n \"tooltipHideDelay\",\n \"cacheOverflowSize\",\n \"paginationPageSize\",\n \"cacheBlockSize\",\n \"infiniteInitialRowCount\",\n \"serverSideInitialRowCount\",\n \"scrollbarWidth\",\n \"asyncTransactionWaitMillis\",\n \"blockLoadDebounceMillis\",\n \"keepDetailRowsCount\",\n \"undoRedoCellEditingLimit\",\n \"cellFlashDelay\",\n \"cellFadeDelay\",\n \"cellFlashDuration\",\n \"cellFadeDuration\",\n \"tabIndex\",\n \"pivotMaxGeneratedColumns\"\n];\n// These properties are coerced at runtime, do not do union types\n_PropertyKeys.BOOLEAN_PROPERTIES = [\n \"suppressMakeColumnVisibleAfterUnGroup\",\n \"suppressRowClickSelection\",\n \"suppressCellFocus\",\n \"suppressHeaderFocus\",\n \"suppressHorizontalScroll\",\n \"groupSelectsChildren\",\n \"alwaysShowHorizontalScroll\",\n \"alwaysShowVerticalScroll\",\n \"debug\",\n \"enableBrowserTooltips\",\n \"enableCellExpressions\",\n \"groupIncludeTotalFooter\",\n \"groupSuppressBlankHeader\",\n \"suppressMenuHide\",\n \"suppressRowDeselection\",\n \"unSortIcon\",\n \"suppressMultiSort\",\n \"alwaysMultiSort\",\n \"singleClickEdit\",\n \"suppressLoadingOverlay\",\n \"suppressNoRowsOverlay\",\n \"suppressAutoSize\",\n \"skipHeaderOnAutoSize\",\n \"suppressColumnMoveAnimation\",\n \"suppressMovableColumns\",\n \"suppressFieldDotNotation\",\n \"enableRangeSelection\",\n \"enableRangeHandle\",\n \"enableFillHandle\",\n \"suppressClearOnFillReduction\",\n \"deltaSort\",\n \"suppressTouch\",\n \"suppressAsyncEvents\",\n \"allowContextMenuWithControlKey\",\n \"suppressContextMenu\",\n \"enableCellChangeFlash\",\n \"suppressDragLeaveHidesColumns\",\n \"suppressRowGroupHidesColumns\",\n \"suppressMiddleClickScrolls\",\n \"suppressPreventDefaultOnMouseWheel\",\n \"suppressCopyRowsToClipboard\",\n \"copyHeadersToClipboard\",\n \"copyGroupHeadersToClipboard\",\n \"pivotMode\",\n \"suppressAggFuncInHeader\",\n \"suppressColumnVirtualisation\",\n \"alwaysAggregateAtRootLevel\",\n \"suppressFocusAfterRefresh\",\n \"functionsReadOnly\",\n \"animateRows\",\n \"groupSelectsFiltered\",\n \"groupRemoveSingleChildren\",\n \"groupRemoveLowestSingleChildren\",\n \"enableRtl\",\n \"suppressClickEdit\",\n \"rowDragEntireRow\",\n \"rowDragManaged\",\n \"suppressRowDrag\",\n \"suppressMoveWhenRowDragging\",\n \"rowDragMultiRow\",\n \"enableGroupEdit\",\n \"embedFullWidthRows\",\n \"suppressPaginationPanel\",\n \"groupHideOpenParents\",\n \"groupAllowUnbalanced\",\n \"pagination\",\n \"paginationAutoPageSize\",\n \"suppressScrollOnNewData\",\n \"suppressScrollWhenPopupsAreOpen\",\n \"purgeClosedRowNodes\",\n \"cacheQuickFilter\",\n \"includeHiddenColumnsInQuickFilter\",\n \"ensureDomOrder\",\n \"accentedSort\",\n \"suppressChangeDetection\",\n \"valueCache\",\n \"valueCacheNeverExpires\",\n \"aggregateOnlyChangedColumns\",\n \"suppressAnimationFrame\",\n \"suppressExcelExport\",\n \"suppressCsvExport\",\n \"includeHiddenColumnsInAdvancedFilter\",\n \"suppressMultiRangeSelection\",\n \"enterNavigatesVerticallyAfterEdit\",\n \"enterNavigatesVertically\",\n \"suppressPropertyNamesCheck\",\n \"rowMultiSelectWithClick\",\n \"suppressRowHoverHighlight\",\n \"suppressRowTransform\",\n \"suppressClipboardPaste\",\n \"suppressLastEmptyLineOnPaste\",\n \"enableCharts\",\n \"suppressMaintainUnsortedOrder\",\n \"enableCellTextSelection\",\n \"suppressBrowserResizeObserver\",\n \"suppressMaxRenderedRowRestriction\",\n \"excludeChildrenWhenTreeDataFiltering\",\n \"tooltipMouseTrack\",\n \"tooltipInteraction\",\n \"keepDetailRows\",\n \"paginateChildRows\",\n \"preventDefaultOnContextMenu\",\n \"undoRedoCellEditing\",\n \"allowDragFromColumnsToolPanel\",\n \"pivotSuppressAutoColumn\",\n \"suppressExpandablePivotGroups\",\n \"debounceVerticalScrollbar\",\n \"detailRowAutoHeight\",\n \"serverSideSortAllLevels\",\n \"serverSideEnableClientSideSort\",\n \"serverSideOnlyRefreshFilteredGroups\",\n \"serverSideSortOnServer\",\n \"serverSideFilterOnServer\",\n \"suppressAggFilteredOnly\",\n \"showOpenedGroup\",\n \"suppressClipboardApi\",\n \"suppressModelUpdateAfterUpdateTransaction\",\n \"stopEditingWhenCellsLoseFocus\",\n \"maintainColumnOrder\",\n \"groupMaintainOrder\",\n \"columnHoverHighlight\",\n \"readOnlyEdit\",\n \"suppressRowVirtualisation\",\n \"enableCellEditingOnBackspace\",\n \"resetRowDataOnUpdate\",\n \"removePivotHeaderRowWhenSingleValueColumn\",\n \"suppressCopySingleCellRanges\",\n \"suppressGroupRowsSticky\",\n \"suppressCutToClipboard\",\n \"suppressServerSideInfiniteScroll\",\n \"rowGroupPanelSuppressSort\",\n \"allowShowChangeAfterFilter\",\n \"enableAdvancedFilter\",\n \"masterDetail\",\n \"treeData\",\n \"suppressGroupMaintainValueType\",\n \"reactiveCustomComponents\",\n \"applyQuickFilterBeforePivotOrAgg\",\n \"suppressServerSideFullWidthLoadingRow\",\n \"suppressAdvancedFilterEval\",\n \"loading\"\n];\n// If property does not fit above, i.e union that should not be coerced.\n_PropertyKeys.OTHER_PROPERTIES = [\"suppressStickyTotalRow\"];\n_PropertyKeys.FUNCTION_PROPERTIES = [\n \"doesExternalFilterPass\",\n \"processPivotResultColDef\",\n \"processPivotResultColGroupDef\",\n \"getBusinessKeyForNode\",\n \"isRowSelectable\",\n \"rowDragText\",\n \"groupRowRenderer\",\n \"fullWidthCellRenderer\",\n \"loadingCellRenderer\",\n \"loadingOverlayComponent\",\n \"noRowsOverlayComponent\",\n \"detailCellRenderer\",\n \"quickFilterParser\",\n \"quickFilterMatcher\",\n \"getLocaleText\",\n \"isExternalFilterPresent\",\n \"getRowHeight\",\n \"getRowClass\",\n \"getRowStyle\",\n \"getContextMenuItems\",\n \"getMainMenuItems\",\n \"processRowPostCreate\",\n \"processCellForClipboard\",\n \"getGroupRowAgg\",\n \"isFullWidthRow\",\n \"sendToClipboard\",\n \"focusGridInnerElement\",\n \"navigateToNextHeader\",\n \"tabToNextHeader\",\n \"navigateToNextCell\",\n \"tabToNextCell\",\n \"processCellFromClipboard\",\n \"getDocument\",\n \"postProcessPopup\",\n \"getChildCount\",\n \"getDataPath\",\n \"isRowMaster\",\n \"postSortRows\",\n \"processHeaderForClipboard\",\n \"processUnpinnedColumns\",\n \"processGroupHeaderForClipboard\",\n \"paginationNumberFormatter\",\n \"processDataFromClipboard\",\n \"getServerSideGroupKey\",\n \"isServerSideGroup\",\n \"createChartContainer\",\n \"getChartToolbarItems\",\n \"fillOperation\",\n \"isApplyServerSideTransaction\",\n \"getServerSideGroupLevelParams\",\n \"isServerSideGroupOpenByDefault\",\n \"isGroupOpenByDefault\",\n \"initialGroupOrderComparator\",\n \"groupIncludeFooter\",\n \"loadingCellRendererSelector\",\n \"getRowId\",\n \"groupAggFiltering\",\n \"chartMenuItems\",\n \"groupTotalRow\"\n];\n_PropertyKeys.ALL_PROPERTIES = [\n ..._PropertyKeys.ARRAY_PROPERTIES,\n ..._PropertyKeys.OBJECT_PROPERTIES,\n ..._PropertyKeys.STRING_PROPERTIES,\n ..._PropertyKeys.NUMBER_PROPERTIES,\n ..._PropertyKeys.FUNCTION_PROPERTIES,\n ..._PropertyKeys.BOOLEAN_PROPERTIES,\n ..._PropertyKeys.OTHER_PROPERTIES\n];\nvar PropertyKeys = _PropertyKeys;\n\n// community-modules/core/src/components/componentUtil.ts\nvar _ComponentUtil = class _ComponentUtil {\n static getCallbackForEvent(eventName) {\n if (!eventName || eventName.length < 2) {\n return eventName;\n }\n return \"on\" + eventName[0].toUpperCase() + eventName.substring(1);\n }\n};\n_ComponentUtil.VUE_OMITTED_PROPERTY = \"AG-VUE-OMITTED-PROPERTY\";\n_ComponentUtil.PUBLIC_EVENTS = PUBLIC_EVENTS;\n// onXXX methods, based on the above events\n_ComponentUtil.EVENT_CALLBACKS = ALL_EVENTS.map((event) => _ComponentUtil.getCallbackForEvent(event));\n_ComponentUtil.BOOLEAN_PROPERTIES = PropertyKeys.BOOLEAN_PROPERTIES;\n_ComponentUtil.ALL_PROPERTIES = PropertyKeys.ALL_PROPERTIES;\n_ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS = [..._ComponentUtil.ALL_PROPERTIES, ..._ComponentUtil.EVENT_CALLBACKS];\n_ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS_SET = new Set(_ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS);\nvar ComponentUtil = _ComponentUtil;\nfunction _combineAttributesAndGridOptions(gridOptions, component) {\n if (typeof gridOptions !== \"object\") {\n gridOptions = {};\n }\n const mergedOptions = { ...gridOptions };\n const keys = ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS;\n keys.forEach((key) => {\n const value = component[key];\n if (typeof value !== \"undefined\" && value !== ComponentUtil.VUE_OMITTED_PROPERTY) {\n mergedOptions[key] = value;\n }\n });\n return mergedOptions;\n}\nfunction _processOnChange(changes, api) {\n if (!changes) {\n return;\n }\n const gridChanges = {};\n let hasChanges = false;\n Object.keys(changes).filter((key) => ComponentUtil.ALL_PROPERTIES_AND_CALLBACKS_SET.has(key)).forEach((key) => {\n gridChanges[key] = changes[key];\n hasChanges = true;\n });\n if (!hasChanges) {\n return;\n }\n const internalUpdateEvent = {\n type: \"gridOptionsChanged\",\n options: gridChanges\n };\n api.dispatchEvent(internalUpdateEvent);\n const event = {\n type: \"componentStateChanged\"\n };\n _iterateObject(gridChanges, (key, value) => {\n event[key] = value;\n });\n api.dispatchEvent(event);\n}\n\n// community-modules/core/src/rendering/cssClassManager.ts\nvar CssClassManager = class {\n constructor(getGui) {\n // to minimise DOM hits, we only apply CSS classes if they have changed. as adding a CSS class that is already\n // there, or removing one that wasn't present, all takes CPU.\n this.cssClassStates = {};\n this.getGui = getGui;\n }\n addCssClass(className) {\n const list = (className || \"\").split(\" \");\n if (list.length > 1) {\n list.forEach((cls) => this.addCssClass(cls));\n return;\n }\n const updateNeeded = this.cssClassStates[className] !== true;\n if (updateNeeded && className.length) {\n const eGui = this.getGui();\n if (eGui) {\n eGui.classList.add(className);\n }\n this.cssClassStates[className] = true;\n }\n }\n removeCssClass(className) {\n const list = (className || \"\").split(\" \");\n if (list.length > 1) {\n list.forEach((cls) => this.removeCssClass(cls));\n return;\n }\n const updateNeeded = this.cssClassStates[className] !== false;\n if (updateNeeded && className.length) {\n const eGui = this.getGui();\n if (eGui) {\n eGui.classList.remove(className);\n }\n this.cssClassStates[className] = false;\n }\n }\n containsCssClass(className) {\n const eGui = this.getGui();\n if (!eGui) {\n return false;\n }\n return eGui.classList.contains(className);\n }\n addOrRemoveCssClass(className, addOrRemove) {\n if (!className) {\n return;\n }\n if (className.indexOf(\" \") >= 0) {\n const list = (className || \"\").split(\" \");\n if (list.length > 1) {\n list.forEach((cls) => this.addOrRemoveCssClass(cls, addOrRemove));\n return;\n }\n }\n const updateNeeded = this.cssClassStates[className] !== addOrRemove;\n if (updateNeeded && className.length) {\n const eGui = this.getGui();\n if (eGui) {\n eGui.classList.toggle(className, addOrRemove);\n }\n this.cssClassStates[className] = addOrRemove;\n }\n }\n};\n\n// community-modules/core/src/utils/aria.ts\nfunction _toggleAriaAttribute(element, attribute, value) {\n if (value == null || typeof value === \"string\" && value == \"\") {\n _removeAriaAttribute(element, attribute);\n } else {\n _setAriaAttribute(element, attribute, value);\n }\n}\nfunction _setAriaAttribute(element, attribute, value) {\n element.setAttribute(_ariaAttributeName(attribute), value.toString());\n}\nfunction _removeAriaAttribute(element, attribute) {\n element.removeAttribute(_ariaAttributeName(attribute));\n}\nfunction _ariaAttributeName(attribute) {\n return `aria-${attribute}`;\n}\nfunction _setAriaRole(element, role) {\n if (role) {\n element.setAttribute(\"role\", role);\n } else {\n element.removeAttribute(\"role\");\n }\n}\nfunction _getAriaSortState(sortDirection) {\n let sort;\n if (sortDirection === \"asc\") {\n sort = \"ascending\";\n } else if (sortDirection === \"desc\") {\n sort = \"descending\";\n } else if (sortDirection === \"mixed\") {\n sort = \"other\";\n } else {\n sort = \"none\";\n }\n return sort;\n}\nfunction _getAriaPosInSet(element) {\n return parseInt(element.getAttribute(\"aria-posinset\"), 10);\n}\nfunction _getAriaLabel(element) {\n return element.getAttribute(\"aria-label\");\n}\nfunction _setAriaLabel(element, label) {\n _toggleAriaAttribute(element, \"label\", label);\n}\nfunction _setAriaLabelledBy(element, labelledBy) {\n _toggleAriaAttribute(element, \"labelledby\", labelledBy);\n}\nfunction _setAriaDescribedBy(element, describedby) {\n _toggleAriaAttribute(element, \"describedby\", describedby);\n}\nfunction _setAriaLive(element, live) {\n _toggleAriaAttribute(element, \"live\", live);\n}\nfunction _setAriaAtomic(element, atomic) {\n _toggleAriaAttribute(element, \"atomic\", atomic);\n}\nfunction _setAriaRelevant(element, relevant) {\n _toggleAriaAttribute(element, \"relevant\", relevant);\n}\nfunction _setAriaLevel(element, level) {\n _toggleAriaAttribute(element, \"level\", level);\n}\nfunction _setAriaDisabled(element, disabled) {\n _toggleAriaAttribute(element, \"disabled\", disabled);\n}\nfunction _setAriaHidden(element, hidden) {\n _toggleAriaAttribute(element, \"hidden\", hidden);\n}\nfunction _setAriaActiveDescendant(element, descendantId) {\n _toggleAriaAttribute(element, \"activedescendant\", descendantId);\n}\nfunction _setAriaExpanded(element, expanded) {\n _setAriaAttribute(element, \"expanded\", expanded);\n}\nfunction _removeAriaExpanded(element) {\n _removeAriaAttribute(element, \"expanded\");\n}\nfunction _setAriaSetSize(element, setsize) {\n _setAriaAttribute(element, \"setsize\", setsize);\n}\nfunction _setAriaPosInSet(element, position) {\n _setAriaAttribute(element, \"posinset\", position);\n}\nfunction _setAriaMultiSelectable(element, multiSelectable) {\n _setAriaAttribute(element, \"multiselectable\", multiSelectable);\n}\nfunction _setAriaRowCount(element, rowCount) {\n _setAriaAttribute(element, \"rowcount\", rowCount);\n}\nfunction _setAriaRowIndex(element, rowIndex) {\n _setAriaAttribute(element, \"rowindex\", rowIndex);\n}\nfunction _setAriaColCount(element, colCount) {\n _setAriaAttribute(element, \"colcount\", colCount);\n}\nfunction _setAriaColIndex(element, colIndex) {\n _setAriaAttribute(element, \"colindex\", colIndex);\n}\nfunction _setAriaColSpan(element, colSpan) {\n _setAriaAttribute(element, \"colspan\", colSpan);\n}\nfunction _setAriaSort(element, sort) {\n _setAriaAttribute(element, \"sort\", sort);\n}\nfunction _removeAriaSort(element) {\n _removeAriaAttribute(element, \"sort\");\n}\nfunction _setAriaSelected(element, selected) {\n _toggleAriaAttribute(element, \"selected\", selected);\n}\nfunction _setAriaChecked(element, checked) {\n _setAriaAttribute(element, \"checked\", checked === void 0 ? \"mixed\" : checked);\n}\nfunction _setAriaControls(controllerElement, controlledElement) {\n _toggleAriaAttribute(controllerElement, \"controls\", controlledElement.id);\n _setAriaLabelledBy(controlledElement, controllerElement.id);\n}\nfunction _getAriaCheckboxStateName(translate, state) {\n return state === void 0 ? translate(\"ariaIndeterminate\", \"indeterminate\") : state === true ? translate(\"ariaChecked\", \"checked\") : translate(\"ariaUnchecked\", \"unchecked\");\n}\n\n// community-modules/core/src/utils/browser.ts\nvar isSafari;\nvar safariVersion;\nvar isChrome;\nvar isFirefox;\nvar isMacOs;\nvar isIOS;\nvar invisibleScrollbar;\nvar browserScrollbarWidth;\nfunction _isBrowserSafari() {\n if (isSafari === void 0) {\n isSafari = /^((?!chrome|android).)*safari/i.test(navigator.userAgent);\n }\n return isSafari;\n}\nfunction _getSafariVersion() {\n if (safariVersion === void 0) {\n if (_isBrowserSafari()) {\n const versionMatch = navigator.userAgent.match(/version\\/(\\d+)/i);\n if (versionMatch) {\n safariVersion = versionMatch[1] != null ? parseFloat(versionMatch[1]) : 0;\n }\n } else {\n safariVersion = 0;\n }\n }\n return safariVersion;\n}\nfunction _isBrowserChrome() {\n if (isChrome === void 0) {\n const win = window;\n isChrome = !!win.chrome && (!!win.chrome.webstore || !!win.chrome.runtime) || /Chrome/.test(navigator.userAgent) && /Google Inc/.test(navigator.vendor);\n }\n return isChrome;\n}\nfunction _isBrowserFirefox() {\n if (isFirefox === void 0) {\n isFirefox = /(firefox)/i.test(navigator.userAgent);\n }\n return isFirefox;\n}\nfunction _isMacOsUserAgent() {\n if (isMacOs === void 0) {\n isMacOs = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform);\n }\n return isMacOs;\n}\nfunction _isIOSUserAgent() {\n if (isIOS === void 0) {\n isIOS = /iPad|iPhone|iPod/.test(navigator.platform) || navigator.platform === \"MacIntel\" && navigator.maxTouchPoints > 1;\n }\n return isIOS;\n}\nfunction _browserSupportsPreventScroll() {\n return !_isBrowserSafari() || _getSafariVersion() >= 15;\n}\nfunction _getTabIndex(el) {\n if (!el) {\n return null;\n }\n const numberTabIndex = el.tabIndex;\n const tabIndex = el.getAttribute(\"tabIndex\");\n if (numberTabIndex === -1 && (tabIndex === null || tabIndex === \"\" && !_isBrowserFirefox())) {\n return null;\n }\n return numberTabIndex.toString();\n}\nfunction _getMaxDivHeight() {\n if (!document.body) {\n return -1;\n }\n let res = 1e6;\n const testUpTo = navigator.userAgent.toLowerCase().match(/firefox/) ? 6e6 : 1e9;\n const div = document.createElement(\"div\");\n document.body.appendChild(div);\n while (true) {\n const test = res * 2;\n div.style.height = test + \"px\";\n if (test > testUpTo || div.clientHeight !== test) {\n break;\n } else {\n res = test;\n }\n }\n document.body.removeChild(div);\n return res;\n}\nfunction _getBodyWidth() {\n return document.body?.clientWidth ?? (window.innerHeight || document.documentElement?.clientWidth || -1);\n}\nfunction _getBodyHeight() {\n return document.body?.clientHeight ?? (window.innerHeight || document.documentElement?.clientHeight || -1);\n}\nfunction _getScrollbarWidth() {\n if (browserScrollbarWidth == null) {\n initScrollbarWidthAndVisibility();\n }\n return browserScrollbarWidth;\n}\nfunction initScrollbarWidthAndVisibility() {\n const body = document.body;\n const div = document.createElement(\"div\");\n div.style.width = div.style.height = \"100px\";\n div.style.opacity = \"0\";\n div.style.overflow = \"scroll\";\n div.style.msOverflowStyle = \"scrollbar\";\n div.style.position = \"absolute\";\n body.appendChild(div);\n let width = div.offsetWidth - div.clientWidth;\n if (width === 0 && div.clientWidth === 0) {\n width = null;\n }\n if (div.parentNode) {\n div.parentNode.removeChild(div);\n }\n if (width != null) {\n browserScrollbarWidth = width;\n invisibleScrollbar = width === 0;\n }\n}\nfunction _isInvisibleScrollbar() {\n if (invisibleScrollbar == null) {\n initScrollbarWidthAndVisibility();\n }\n return invisibleScrollbar;\n}\n\n// community-modules/core/src/utils/dom.ts\nvar rtlNegativeScroll;\nfunction _radioCssClass(element, elementClass, otherElementClass) {\n const parent = element.parentElement;\n let sibling = parent && parent.firstChild;\n while (sibling) {\n if (elementClass) {\n sibling.classList.toggle(elementClass, sibling === element);\n }\n if (otherElementClass) {\n sibling.classList.toggle(otherElementClass, sibling !== element);\n }\n sibling = sibling.nextSibling;\n }\n}\nvar FOCUSABLE_SELECTOR = \"[tabindex], input, select, button, textarea, [href]\";\nvar FOCUSABLE_EXCLUDE = \"[disabled], .ag-disabled:not(.ag-button), .ag-disabled *\";\nfunction _isFocusableFormField(element) {\n const matches = Element.prototype.matches || Element.prototype.msMatchesSelector;\n const inputSelector = \"input, select, button, textarea\";\n const isFocusable = matches.call(element, inputSelector);\n const isNotFocusable = matches.call(element, FOCUSABLE_EXCLUDE);\n const isElementVisible = _isVisible(element);\n const focusable = isFocusable && !isNotFocusable && isElementVisible;\n return focusable;\n}\nfunction _setDisplayed(element, displayed, options = {}) {\n const { skipAriaHidden } = options;\n element.classList.toggle(\"ag-hidden\", !displayed);\n if (!skipAriaHidden) {\n _setAriaHidden(element, !displayed);\n }\n}\nfunction _setVisible(element, visible, options = {}) {\n const { skipAriaHidden } = options;\n element.classList.toggle(\"ag-invisible\", !visible);\n if (!skipAriaHidden) {\n _setAriaHidden(element, !visible);\n }\n}\nfunction _setDisabled(element, disabled) {\n const attributeName = \"disabled\";\n const addOrRemoveDisabledAttribute = disabled ? (e) => e.setAttribute(attributeName, \"\") : (e) => e.removeAttribute(attributeName);\n addOrRemoveDisabledAttribute(element);\n _nodeListForEach(element.querySelectorAll(\"input\"), (input) => addOrRemoveDisabledAttribute(input));\n}\nfunction _isElementChildOfClass(element, cls, maxNest) {\n let counter = 0;\n while (element) {\n if (element.classList.contains(cls)) {\n return true;\n }\n element = element.parentElement;\n if (typeof maxNest == \"number\") {\n if (++counter > maxNest) {\n break;\n }\n } else if (element === maxNest) {\n break;\n }\n }\n return false;\n}\nfunction _getElementSize(el) {\n const {\n height,\n width,\n borderTopWidth,\n borderRightWidth,\n borderBottomWidth,\n borderLeftWidth,\n paddingTop,\n paddingRight,\n paddingBottom,\n paddingLeft,\n marginTop,\n marginRight,\n marginBottom,\n marginLeft,\n boxSizing\n } = window.getComputedStyle(el);\n return {\n height: parseFloat(height || \"0\"),\n width: parseFloat(width || \"0\"),\n borderTopWidth: parseFloat(borderTopWidth || \"0\"),\n borderRightWidth: parseFloat(borderRightWidth || \"0\"),\n borderBottomWidth: parseFloat(borderBottomWidth || \"0\"),\n borderLeftWidth: parseFloat(borderLeftWidth || \"0\"),\n paddingTop: parseFloat(paddingTop || \"0\"),\n paddingRight: parseFloat(paddingRight || \"0\"),\n paddingBottom: parseFloat(paddingBottom || \"0\"),\n paddingLeft: parseFloat(paddingLeft || \"0\"),\n marginTop: parseFloat(marginTop || \"0\"),\n marginRight: parseFloat(marginRight || \"0\"),\n marginBottom: parseFloat(marginBottom || \"0\"),\n marginLeft: parseFloat(marginLeft || \"0\"),\n boxSizing\n };\n}\nfunction _getInnerHeight(el) {\n const size = _getElementSize(el);\n if (size.boxSizing === \"border-box\") {\n return size.height - size.paddingTop - size.paddingBottom;\n }\n return size.height;\n}\nfunction _getInnerWidth(el) {\n const size = _getElementSize(el);\n if (size.boxSizing === \"border-box\") {\n return size.width - size.paddingLeft - size.paddingRight;\n }\n return size.width;\n}\nfunction _getAbsoluteHeight(el) {\n const { height, marginBottom, marginTop } = _getElementSize(el);\n return Math.floor(height + marginBottom + marginTop);\n}\nfunction _getAbsoluteWidth(el) {\n const { width, marginLeft, marginRight } = _getElementSize(el);\n return Math.floor(width + marginLeft + marginRight);\n}\nfunction _getElementRectWithOffset(el) {\n const offsetElementRect = el.getBoundingClientRect();\n const { borderTopWidth, borderLeftWidth, borderRightWidth, borderBottomWidth } = _getElementSize(el);\n return {\n top: offsetElementRect.top + (borderTopWidth || 0),\n left: offsetElementRect.left + (borderLeftWidth || 0),\n right: offsetElementRect.right + (borderRightWidth || 0),\n bottom: offsetElementRect.bottom + (borderBottomWidth || 0)\n };\n}\nfunction _isRtlNegativeScroll() {\n if (typeof rtlNegativeScroll === \"boolean\") {\n return rtlNegativeScroll;\n }\n const template = document.createElement(\"div\");\n template.style.direction = \"rtl\";\n template.style.width = \"1px\";\n template.style.height = \"1px\";\n template.style.position = \"fixed\";\n template.style.top = \"0px\";\n template.style.overflow = \"hidden\";\n template.dir = \"rtl\";\n template.innerHTML = /* html */\n `
\n \n \n
`;\n document.body.appendChild(template);\n template.scrollLeft = 1;\n rtlNegativeScroll = Math.floor(template.scrollLeft) === 0;\n document.body.removeChild(template);\n return rtlNegativeScroll;\n}\nfunction _getScrollLeft(element, rtl) {\n let scrollLeft = element.scrollLeft;\n if (rtl) {\n scrollLeft = Math.abs(scrollLeft);\n if (_isBrowserChrome() && !_isRtlNegativeScroll()) {\n scrollLeft = element.scrollWidth - element.clientWidth - scrollLeft;\n }\n }\n return scrollLeft;\n}\nfunction _setScrollLeft(element, value, rtl) {\n if (rtl) {\n if (_isRtlNegativeScroll()) {\n value *= -1;\n } else if (_isBrowserSafari() || _isBrowserChrome()) {\n value = element.scrollWidth - element.clientWidth - value;\n }\n }\n element.scrollLeft = value;\n}\nfunction _clearElement(el) {\n while (el && el.firstChild) {\n el.removeChild(el.firstChild);\n }\n}\nfunction _removeFromParent(node) {\n if (node && node.parentNode) {\n node.parentNode.removeChild(node);\n }\n}\nfunction _isInDOM(element) {\n return !!element.offsetParent;\n}\nfunction _isVisible(element) {\n const el = element;\n if (el.checkVisibility) {\n return el.checkVisibility({ checkVisibilityCSS: true });\n }\n const isHidden = !_isInDOM(element) || window.getComputedStyle(element).visibility !== \"visible\";\n return !isHidden;\n}\nfunction _loadTemplate(template) {\n const tempDiv = document.createElement(\"div\");\n tempDiv.innerHTML = (template || \"\").trim();\n return tempDiv.firstChild;\n}\nfunction _ensureDomOrder(eContainer, eChild, eChildBefore) {\n if (eChildBefore && eChildBefore.nextSibling === eChild) {\n return;\n }\n if (eChildBefore) {\n if (eChildBefore.nextSibling) {\n eContainer.insertBefore(eChild, eChildBefore.nextSibling);\n } else {\n eContainer.appendChild(eChild);\n }\n } else {\n if (eContainer.firstChild && eContainer.firstChild !== eChild) {\n eContainer.insertAdjacentElement(\"afterbegin\", eChild);\n }\n }\n}\nfunction _setDomChildOrder(eContainer, orderedChildren) {\n for (let i = 0; i < orderedChildren.length; i++) {\n const correctCellAtIndex = orderedChildren[i];\n const actualCellAtIndex = eContainer.children[i];\n if (actualCellAtIndex !== correctCellAtIndex) {\n eContainer.insertBefore(correctCellAtIndex, actualCellAtIndex);\n }\n }\n}\nfunction _insertWithDomOrder(eContainer, eToInsert, eChildBefore) {\n if (eChildBefore) {\n eChildBefore.insertAdjacentElement(\"afterend\", eToInsert);\n } else {\n if (eContainer.firstChild) {\n eContainer.insertAdjacentElement(\"afterbegin\", eToInsert);\n } else {\n eContainer.appendChild(eToInsert);\n }\n }\n}\nfunction _addStylesToElement(eElement, styles) {\n if (!styles) {\n return;\n }\n for (const [key, value] of Object.entries(styles)) {\n if (!key || !key.length || value == null) {\n continue;\n }\n const parsedKey = _camelCaseToHyphenated(key);\n const valueAsString = value.toString();\n const parsedValue = valueAsString.replace(/\\s*!important/g, \"\");\n const priority = parsedValue.length != valueAsString.length ? \"important\" : void 0;\n eElement.style.setProperty(parsedKey, parsedValue, priority);\n }\n}\nfunction _isHorizontalScrollShowing(element) {\n return element.clientWidth < element.scrollWidth;\n}\nfunction _isVerticalScrollShowing(element) {\n return element.clientHeight < element.scrollHeight;\n}\nfunction _setElementWidth(element, width) {\n if (width === \"flex\") {\n element.style.removeProperty(\"width\");\n element.style.removeProperty(\"minWidth\");\n element.style.removeProperty(\"maxWidth\");\n element.style.flex = \"1 1 auto\";\n } else {\n _setFixedWidth(element, width);\n }\n}\nfunction _setFixedWidth(element, width) {\n width = _formatSize(width);\n element.style.width = width.toString();\n element.style.maxWidth = width.toString();\n element.style.minWidth = width.toString();\n}\nfunction _setFixedHeight(element, height) {\n height = _formatSize(height);\n element.style.height = height.toString();\n element.style.maxHeight = height.toString();\n element.style.minHeight = height.toString();\n}\nfunction _formatSize(size) {\n if (typeof size === \"number\") {\n return `${size}px`;\n }\n return size;\n}\nfunction _isNodeOrElement(o) {\n return o instanceof Node || o instanceof HTMLElement;\n}\nfunction _copyNodeList(nodeList) {\n if (nodeList == null) {\n return [];\n }\n const result = [];\n _nodeListForEach(nodeList, (node) => result.push(node));\n return result;\n}\nfunction _iterateNamedNodeMap(map, callback) {\n if (!map) {\n return;\n }\n for (let i = 0; i < map.length; i++) {\n const attr = map[i];\n callback(attr.name, attr.value);\n }\n}\nfunction _addOrRemoveAttribute(element, name, value) {\n if (value == null) {\n element.removeAttribute(name);\n } else {\n element.setAttribute(name, value.toString());\n }\n}\nfunction _nodeListForEach(nodeList, action) {\n if (nodeList == null) {\n return;\n }\n for (let i = 0; i < nodeList.length; i++) {\n action(nodeList[i]);\n }\n}\nfunction _bindCellRendererToHtmlElement(cellRendererPromise, eTarget) {\n cellRendererPromise.then((cellRenderer) => {\n const gui = cellRenderer.getGui();\n if (gui != null) {\n if (typeof gui === \"object\") {\n eTarget.appendChild(gui);\n } else {\n eTarget.innerHTML = gui;\n }\n }\n });\n}\n\n// community-modules/core/src/utils/numberSequence.ts\nvar NumberSequence = class {\n constructor(initValue = 0, step = 1) {\n this.nextValue = initValue;\n this.step = step;\n }\n next() {\n const valToReturn = this.nextValue;\n this.nextValue += this.step;\n return valToReturn;\n }\n peek() {\n return this.nextValue;\n }\n skip(count) {\n this.nextValue += count;\n }\n};\n\n// community-modules/core/src/widgets/tooltipStateManager.ts\nvar SHOW_QUICK_TOOLTIP_DIFF = 1e3;\nvar FADE_OUT_TOOLTIP_TIMEOUT = 1e3;\nvar INTERACTIVE_HIDE_DELAY = 100;\nvar _TooltipStateManager = class _TooltipStateManager extends BeanStub {\n constructor(parentComp, tooltipShowDelayOverride, tooltipHideDelayOverride, shouldDisplayTooltip) {\n super();\n this.parentComp = parentComp;\n this.tooltipShowDelayOverride = tooltipShowDelayOverride;\n this.tooltipHideDelayOverride = tooltipHideDelayOverride;\n this.shouldDisplayTooltip = shouldDisplayTooltip;\n this.interactionEnabled = false;\n this.isInteractingWithTooltip = false;\n this.state = 0 /* NOTHING */;\n // when showing the tooltip, we need to make sure it's the most recent instance we request, as due to\n // async we could request two tooltips before the first instance returns, in which case we should\n // disregard the second instance.\n this.tooltipInstanceCount = 0;\n this.tooltipMouseTrack = false;\n }\n wireBeans(beans) {\n this.popupService = beans.popupService;\n this.userComponentFactory = beans.userComponentFactory;\n }\n postConstruct() {\n if (this.gos.get(\"tooltipInteraction\")) {\n this.interactionEnabled = true;\n }\n this.tooltipTrigger = this.getTooltipTrigger();\n this.tooltipMouseTrack = this.gos.get(\"tooltipMouseTrack\");\n const el = this.parentComp.getGui();\n if (this.tooltipTrigger === 0 /* HOVER */) {\n this.addManagedListeners(el, {\n mouseenter: this.onMouseEnter.bind(this),\n mouseleave: this.onMouseLeave.bind(this)\n });\n }\n if (this.tooltipTrigger === 1 /* FOCUS */) {\n this.addManagedListeners(el, {\n focusin: this.onFocusIn.bind(this),\n focusout: this.onFocusOut.bind(this)\n });\n }\n this.addManagedListeners(el, { mousemove: this.onMouseMove.bind(this) });\n if (!this.interactionEnabled) {\n this.addManagedListeners(el, {\n mousedown: this.onMouseDown.bind(this),\n keydown: this.onKeyDown.bind(this)\n });\n }\n }\n getGridOptionsTooltipDelay(delayOption) {\n const delay = this.gos.get(delayOption);\n if (delay < 0) {\n _warnOnce(`${delayOption} should not be lower than 0`);\n }\n return Math.max(200, delay);\n }\n getTooltipDelay(type) {\n if (type === \"show\") {\n return this.tooltipShowDelayOverride ?? this.getGridOptionsTooltipDelay(\"tooltipShowDelay\");\n }\n return this.tooltipHideDelayOverride ?? this.getGridOptionsTooltipDelay(\"tooltipHideDelay\");\n }\n destroy() {\n this.setToDoNothing();\n super.destroy();\n }\n getTooltipTrigger() {\n const trigger = this.gos.get(\"tooltipTrigger\");\n if (!trigger || trigger === \"hover\") {\n return 0 /* HOVER */;\n }\n return 1 /* FOCUS */;\n }\n onMouseEnter(e) {\n if (this.interactionEnabled && this.interactiveTooltipTimeoutId) {\n this.unlockService();\n this.startHideTimeout();\n }\n if (_isIOSUserAgent()) {\n return;\n }\n if (_TooltipStateManager.isLocked) {\n this.showTooltipTimeoutId = window.setTimeout(() => {\n this.prepareToShowTooltip(e);\n }, INTERACTIVE_HIDE_DELAY);\n } else {\n this.prepareToShowTooltip(e);\n }\n }\n onMouseMove(e) {\n if (this.lastMouseEvent) {\n this.lastMouseEvent = e;\n }\n if (this.tooltipMouseTrack && this.state === 2 /* SHOWING */ && this.tooltipComp) {\n this.positionTooltip();\n }\n }\n onMouseDown() {\n this.setToDoNothing();\n }\n onMouseLeave() {\n if (this.interactionEnabled) {\n this.lockService();\n } else {\n this.setToDoNothing();\n }\n }\n onFocusIn() {\n this.prepareToShowTooltip();\n }\n onFocusOut(e) {\n const relatedTarget = e.relatedTarget;\n const parentCompGui = this.parentComp.getGui();\n const tooltipGui = this.tooltipComp?.getGui();\n if (this.isInteractingWithTooltip || parentCompGui.contains(relatedTarget) || this.interactionEnabled && tooltipGui?.contains(relatedTarget)) {\n return;\n }\n this.setToDoNothing();\n }\n onKeyDown() {\n this.setToDoNothing();\n }\n prepareToShowTooltip(mouseEvent) {\n if (this.state != 0 /* NOTHING */ || _TooltipStateManager.isLocked) {\n return;\n }\n let delay = 0;\n if (mouseEvent) {\n delay = this.isLastTooltipHiddenRecently() ? 200 : this.getTooltipDelay(\"show\");\n }\n this.lastMouseEvent = mouseEvent || null;\n this.showTooltipTimeoutId = window.setTimeout(this.showTooltip.bind(this), delay);\n this.state = 1 /* WAITING_TO_SHOW */;\n }\n isLastTooltipHiddenRecently() {\n const now = (/* @__PURE__ */ new Date()).getTime();\n const then = _TooltipStateManager.lastTooltipHideTime;\n return now - then < SHOW_QUICK_TOOLTIP_DIFF;\n }\n setToDoNothing() {\n if (this.state === 2 /* SHOWING */) {\n this.hideTooltip();\n }\n if (this.onBodyScrollEventCallback) {\n this.onBodyScrollEventCallback();\n this.onBodyScrollEventCallback = void 0;\n }\n if (this.onColumnMovedEventCallback) {\n this.onColumnMovedEventCallback();\n this.onColumnMovedEventCallback = void 0;\n }\n this.clearTimeouts();\n this.state = 0 /* NOTHING */;\n this.lastMouseEvent = null;\n }\n showTooltip() {\n const params = {\n ...this.parentComp.getTooltipParams()\n };\n if (!_exists(params.value) || this.shouldDisplayTooltip && !this.shouldDisplayTooltip()) {\n this.setToDoNothing();\n return;\n }\n this.state = 2 /* SHOWING */;\n this.tooltipInstanceCount++;\n const callback = this.newTooltipComponentCallback.bind(this, this.tooltipInstanceCount);\n const userDetails = this.userComponentFactory.getTooltipCompDetails(params);\n userDetails.newAgStackInstance().then(callback);\n }\n hideTooltip(forceHide) {\n if (!forceHide && this.isInteractingWithTooltip) {\n return;\n }\n if (this.tooltipComp) {\n this.destroyTooltipComp();\n _TooltipStateManager.lastTooltipHideTime = (/* @__PURE__ */ new Date()).getTime();\n }\n const event = {\n type: \"tooltipHide\",\n parentGui: this.parentComp.getGui()\n };\n this.eventService.dispatchEvent(event);\n if (forceHide) {\n this.isInteractingWithTooltip = false;\n }\n this.state = 0 /* NOTHING */;\n }\n newTooltipComponentCallback(tooltipInstanceCopy, tooltipComp) {\n const compNoLongerNeeded = this.state !== 2 /* SHOWING */ || this.tooltipInstanceCount !== tooltipInstanceCopy;\n if (compNoLongerNeeded) {\n this.destroyBean(tooltipComp);\n return;\n }\n const eGui = tooltipComp.getGui();\n this.tooltipComp = tooltipComp;\n if (!eGui.classList.contains(\"ag-tooltip\")) {\n eGui.classList.add(\"ag-tooltip-custom\");\n }\n if (this.tooltipTrigger === 0 /* HOVER */) {\n eGui.classList.add(\"ag-tooltip-animate\");\n }\n if (this.interactionEnabled) {\n eGui.classList.add(\"ag-tooltip-interactive\");\n }\n const translate = this.localeService.getLocaleTextFunc();\n const addPopupRes = this.popupService.addPopup({\n eChild: eGui,\n ariaLabel: translate(\"ariaLabelTooltip\", \"Tooltip\")\n });\n if (addPopupRes) {\n this.tooltipPopupDestroyFunc = addPopupRes.hideFunc;\n }\n this.positionTooltip();\n if (this.tooltipTrigger === 1 /* FOCUS */) {\n const listener = this.setToDoNothing.bind(this);\n [this.onBodyScrollEventCallback, this.onColumnMovedEventCallback] = this.addManagedEventListeners({\n bodyScroll: listener,\n columnMoved: listener\n });\n }\n if (this.interactionEnabled) {\n if (this.tooltipTrigger === 0 /* HOVER */) {\n [this.tooltipMouseEnterListener, this.tooltipMouseLeaveListener] = this.addManagedElementListeners(\n eGui,\n {\n mouseenter: this.onTooltipMouseEnter.bind(this),\n mouseleave: this.onTooltipMouseLeave.bind(this)\n }\n );\n } else {\n [this.tooltipFocusInListener, this.tooltipFocusOutListener] = this.addManagedElementListeners(eGui, {\n focusin: this.onTooltipFocusIn.bind(this),\n focusout: this.onTooltipFocusOut.bind(this)\n });\n }\n }\n const event = {\n type: \"tooltipShow\",\n tooltipGui: eGui,\n parentGui: this.parentComp.getGui()\n };\n this.eventService.dispatchEvent(event);\n this.startHideTimeout();\n }\n onTooltipMouseEnter() {\n this.isInteractingWithTooltip = true;\n this.unlockService();\n }\n onTooltipMouseLeave() {\n this.isInteractingWithTooltip = false;\n this.lockService();\n }\n onTooltipFocusIn() {\n this.isInteractingWithTooltip = true;\n }\n onTooltipFocusOut(e) {\n const parentGui = this.parentComp.getGui();\n const tooltipGui = this.tooltipComp?.getGui();\n const relatedTarget = e.relatedTarget;\n if (tooltipGui?.contains(relatedTarget)) {\n return;\n }\n this.isInteractingWithTooltip = false;\n if (parentGui.contains(relatedTarget)) {\n this.startHideTimeout();\n } else {\n this.hideTooltip();\n }\n }\n positionTooltip() {\n const params = {\n type: \"tooltip\",\n ePopup: this.tooltipComp.getGui(),\n nudgeY: 18,\n skipObserver: this.tooltipMouseTrack\n };\n if (this.lastMouseEvent) {\n this.popupService.positionPopupUnderMouseEvent({\n ...params,\n mouseEvent: this.lastMouseEvent\n });\n } else {\n this.popupService.positionPopupByComponent({\n ...params,\n eventSource: this.parentComp.getGui(),\n position: \"under\",\n keepWithinBounds: true,\n nudgeY: 5\n });\n }\n }\n destroyTooltipComp() {\n this.tooltipComp.getGui().classList.add(\"ag-tooltip-hiding\");\n const tooltipPopupDestroyFunc = this.tooltipPopupDestroyFunc;\n const tooltipComp = this.tooltipComp;\n const delay = this.tooltipTrigger === 0 /* HOVER */ ? FADE_OUT_TOOLTIP_TIMEOUT : 0;\n window.setTimeout(() => {\n tooltipPopupDestroyFunc();\n this.destroyBean(tooltipComp);\n }, delay);\n this.clearTooltipListeners();\n this.tooltipPopupDestroyFunc = void 0;\n this.tooltipComp = void 0;\n }\n clearTooltipListeners() {\n [\n this.tooltipMouseEnterListener,\n this.tooltipMouseLeaveListener,\n this.tooltipFocusInListener,\n this.tooltipFocusOutListener\n ].forEach((listener) => {\n if (listener) {\n listener();\n }\n });\n this.tooltipMouseEnterListener = this.tooltipMouseLeaveListener = this.tooltipFocusInListener = this.tooltipFocusOutListener = null;\n }\n lockService() {\n _TooltipStateManager.isLocked = true;\n this.interactiveTooltipTimeoutId = window.setTimeout(() => {\n this.unlockService();\n this.setToDoNothing();\n }, INTERACTIVE_HIDE_DELAY);\n }\n unlockService() {\n _TooltipStateManager.isLocked = false;\n this.clearInteractiveTimeout();\n }\n startHideTimeout() {\n this.clearHideTimeout();\n this.hideTooltipTimeoutId = window.setTimeout(this.hideTooltip.bind(this), this.getTooltipDelay(\"hide\"));\n }\n clearShowTimeout() {\n if (!this.showTooltipTimeoutId) {\n return;\n }\n window.clearTimeout(this.showTooltipTimeoutId);\n this.showTooltipTimeoutId = void 0;\n }\n clearHideTimeout() {\n if (!this.hideTooltipTimeoutId) {\n return;\n }\n window.clearTimeout(this.hideTooltipTimeoutId);\n this.hideTooltipTimeoutId = void 0;\n }\n clearInteractiveTimeout() {\n if (!this.interactiveTooltipTimeoutId) {\n return;\n }\n window.clearTimeout(this.interactiveTooltipTimeoutId);\n this.interactiveTooltipTimeoutId = void 0;\n }\n clearTimeouts() {\n this.clearShowTimeout();\n this.clearHideTimeout();\n this.clearInteractiveTimeout();\n }\n};\n_TooltipStateManager.isLocked = false;\nvar TooltipStateManager = _TooltipStateManager;\n\n// community-modules/core/src/widgets/tooltipFeature.ts\nvar TooltipFeature = class extends BeanStub {\n constructor(ctrl, beans) {\n super();\n this.ctrl = ctrl;\n if (beans) {\n this.beans = beans;\n }\n }\n wireBeans(beans) {\n this.beans = beans;\n }\n postConstruct() {\n this.refreshToolTip();\n }\n setBrowserTooltip(tooltip) {\n const name = \"title\";\n const eGui = this.ctrl.getGui();\n if (!eGui) {\n return;\n }\n if (tooltip != null && tooltip != \"\") {\n eGui.setAttribute(name, tooltip);\n } else {\n eGui.removeAttribute(name);\n }\n }\n updateTooltipText() {\n this.tooltip = this.ctrl.getTooltipValue();\n }\n createTooltipFeatureIfNeeded() {\n if (this.tooltipManager != null) {\n return;\n }\n const parent = {\n getTooltipParams: () => this.getTooltipParams(),\n getGui: () => this.ctrl.getGui()\n };\n this.tooltipManager = this.createBean(\n new TooltipStateManager(\n parent,\n this.ctrl.getTooltipShowDelayOverride?.(),\n this.ctrl.getTooltipHideDelayOverride?.(),\n this.ctrl.shouldDisplayTooltip\n ),\n this.beans.context\n );\n }\n refreshToolTip() {\n this.browserTooltips = this.beans.gos.get(\"enableBrowserTooltips\");\n this.updateTooltipText();\n if (this.browserTooltips) {\n this.setBrowserTooltip(this.tooltip);\n if (this.tooltipManager) {\n this.tooltipManager = this.destroyBean(this.tooltipManager, this.beans.context);\n }\n } else {\n this.setBrowserTooltip(null);\n this.createTooltipFeatureIfNeeded();\n }\n }\n getTooltipParams() {\n const ctrl = this.ctrl;\n const column = ctrl.getColumn ? ctrl.getColumn() : void 0;\n const colDef = ctrl.getColDef ? ctrl.getColDef() : void 0;\n const rowNode = ctrl.getRowNode ? ctrl.getRowNode() : void 0;\n return {\n location: ctrl.getLocation(),\n //'cell',\n colDef,\n column,\n rowIndex: ctrl.getRowIndex ? ctrl.getRowIndex() : void 0,\n node: rowNode,\n data: rowNode ? rowNode.data : void 0,\n value: this.getTooltipText(),\n valueFormatted: ctrl.getValueFormatted ? ctrl.getValueFormatted() : void 0,\n hideTooltipCallback: () => this.tooltipManager?.hideTooltip(true)\n };\n }\n getTooltipText() {\n return this.tooltip;\n }\n // overriding to make public, as we don't dispose this bean via context\n destroy() {\n if (this.tooltipManager) {\n this.tooltipManager = this.destroyBean(this.tooltipManager, this.beans.context);\n }\n super.destroy();\n }\n};\n\n// community-modules/core/src/widgets/component.ts\nvar compIdSequence = new NumberSequence();\nvar RefPlaceholder = null;\nvar Component = class _Component extends BeanStub {\n constructor(template, componentSelectors) {\n super();\n this.suppressDataRefValidation = false;\n // if false, then CSS class \"ag-hidden\" is applied, which sets \"display: none\"\n this.displayed = true;\n // if false, then CSS class \"ag-invisible\" is applied, which sets \"visibility: hidden\"\n this.visible = true;\n // unique id for this row component. this is used for getting a reference to the HTML dom.\n // we cannot use the RowNode id as this is not unique (due to animation, old rows can be lying\n // around as we create a new rowComp instance for the same row node).\n this.compId = compIdSequence.next();\n this.cssClassManager = new CssClassManager(() => this.eGui);\n this.componentSelectors = new Map((componentSelectors ?? []).map((comp) => [comp.selector, comp]));\n if (template) {\n this.setTemplate(template);\n }\n }\n preWireBeans(beans) {\n super.preWireBeans(beans);\n }\n preConstruct() {\n this.usingBrowserTooltips = this.gos.get(\"enableBrowserTooltips\");\n this.wireTemplate(this.getGui());\n }\n wireTemplate(element, paramsMap) {\n if (element && this.gos) {\n this.applyElementsToComponent(element);\n this.createChildComponentsFromTags(element, paramsMap);\n }\n }\n getCompId() {\n return this.compId;\n }\n getTooltipParams() {\n return {\n value: this.tooltipText,\n location: \"UNKNOWN\"\n };\n }\n setTooltip(params) {\n const { newTooltipText, showDelayOverride, hideDelayOverride, location, shouldDisplayTooltip } = params || {};\n if (this.tooltipFeature) {\n this.tooltipFeature = this.destroyBean(this.tooltipFeature);\n }\n if (this.tooltipText !== newTooltipText) {\n this.tooltipText = newTooltipText;\n }\n const getTooltipValue = () => this.tooltipText;\n if (newTooltipText != null) {\n this.tooltipFeature = this.createBean(\n new TooltipFeature({\n getTooltipValue,\n getGui: () => this.getGui(),\n getLocation: () => location ?? \"UNKNOWN\",\n getColDef: params?.getColDef,\n getColumn: params?.getColumn,\n getTooltipShowDelayOverride: showDelayOverride != null ? () => showDelayOverride : void 0,\n getTooltipHideDelayOverride: hideDelayOverride != null ? () => hideDelayOverride : void 0,\n shouldDisplayTooltip\n })\n );\n }\n }\n getDataRefAttribute(element) {\n if (element.getAttribute) {\n return element.getAttribute(\"data-ref\");\n }\n return null;\n }\n applyElementsToComponent(element, elementRef, paramsMap, newComponent = null) {\n if (elementRef === void 0) {\n elementRef = this.getDataRefAttribute(element);\n }\n if (elementRef) {\n const current = this[elementRef];\n if (current === RefPlaceholder) {\n this[elementRef] = newComponent ?? element;\n } else {\n const usedAsParamRef = paramsMap && paramsMap[elementRef];\n if (!this.suppressDataRefValidation && !usedAsParamRef) {\n _warnOnce(`Issue with data-ref: ${elementRef} on ${this.constructor.name} with ${current}`);\n }\n }\n }\n }\n // for registered components only, eg creates AgCheckbox instance from ag-checkbox HTML tag\n createChildComponentsFromTags(parentNode, paramsMap) {\n const childNodeList = _copyNodeList(parentNode.childNodes);\n childNodeList.forEach((childNode) => {\n if (!(childNode instanceof HTMLElement)) {\n return;\n }\n const childComp = this.createComponentFromElement(\n childNode,\n (childComp2) => {\n const childGui = childComp2.getGui();\n if (childGui) {\n this.copyAttributesFromNode(childNode, childComp2.getGui());\n }\n },\n paramsMap\n );\n if (childComp) {\n if (childComp.addItems && childNode.children.length) {\n this.createChildComponentsFromTags(childNode, paramsMap);\n const items = Array.prototype.slice.call(childNode.children);\n childComp.addItems(items);\n }\n this.swapComponentForNode(childComp, parentNode, childNode);\n } else if (childNode.childNodes) {\n this.createChildComponentsFromTags(childNode, paramsMap);\n }\n });\n }\n createComponentFromElement(element, afterPreCreateCallback, paramsMap) {\n const key = element.nodeName;\n const elementRef = this.getDataRefAttribute(element);\n const isAgGridComponent = key.indexOf(\"AG-\") === 0;\n const componentSelector = isAgGridComponent ? this.componentSelectors.get(key) : null;\n let newComponent = null;\n if (componentSelector) {\n _Component.elementGettingCreated = element;\n const componentParams = paramsMap && elementRef ? paramsMap[elementRef] : void 0;\n newComponent = new componentSelector.component(componentParams);\n newComponent.setParentComponent(this);\n this.createBean(newComponent, null, afterPreCreateCallback);\n } else if (isAgGridComponent) {\n _warnOnce(`Missing selector: ${key}`);\n }\n this.applyElementsToComponent(element, elementRef, paramsMap, newComponent);\n return newComponent;\n }\n copyAttributesFromNode(source, dest) {\n _iterateNamedNodeMap(source.attributes, (name, value) => dest.setAttribute(name, value));\n }\n swapComponentForNode(newComponent, parentNode, childNode) {\n const eComponent = newComponent.getGui();\n parentNode.replaceChild(eComponent, childNode);\n parentNode.insertBefore(document.createComment(childNode.nodeName), eComponent);\n this.addDestroyFunc(this.destroyBean.bind(this, newComponent));\n }\n activateTabIndex(elements) {\n const tabIndex = this.gos.get(\"tabIndex\");\n if (!elements) {\n elements = [];\n }\n if (!elements.length) {\n elements.push(this.getGui());\n }\n elements.forEach((el) => el.setAttribute(\"tabindex\", tabIndex.toString()));\n }\n setTemplate(template, componentSelectors, paramsMap) {\n const eGui = _loadTemplate(template);\n this.setTemplateFromElement(eGui, componentSelectors, paramsMap);\n }\n setTemplateFromElement(element, components, paramsMap, suppressDataRefValidation = false) {\n this.eGui = element;\n this.suppressDataRefValidation = suppressDataRefValidation;\n if (components) {\n for (let i = 0; i < components.length; i++) {\n const component = components[i];\n this.componentSelectors.set(component.selector, component);\n }\n }\n this.wireTemplate(element, paramsMap);\n }\n getGui() {\n return this.eGui;\n }\n getFocusableElement() {\n return this.eGui;\n }\n getAriaElement() {\n return this.getFocusableElement();\n }\n setParentComponent(component) {\n this.parentComponent = component;\n }\n getParentComponent() {\n return this.parentComponent;\n }\n // this method is for older code, that wants to provide the gui element,\n // it is not intended for this to be in ag-Stack\n setGui(eGui) {\n this.eGui = eGui;\n }\n queryForHtmlElement(cssSelector) {\n return this.eGui.querySelector(cssSelector);\n }\n getContainerAndElement(newChild, container) {\n let parent = container;\n if (newChild == null) {\n return null;\n }\n if (!parent) {\n parent = this.eGui;\n }\n if (_isNodeOrElement(newChild)) {\n return {\n element: newChild,\n parent\n };\n }\n return {\n element: newChild.getGui(),\n parent\n };\n }\n prependChild(newChild, container) {\n const { element, parent } = this.getContainerAndElement(newChild, container) || {};\n if (!element || !parent) {\n return;\n }\n parent.insertAdjacentElement(\"afterbegin\", element);\n }\n appendChild(newChild, container) {\n const { element, parent } = this.getContainerAndElement(newChild, container) || {};\n if (!element || !parent) {\n return;\n }\n parent.appendChild(element);\n }\n isDisplayed() {\n return this.displayed;\n }\n setVisible(visible, options = {}) {\n if (visible !== this.visible) {\n this.visible = visible;\n const { skipAriaHidden } = options;\n _setVisible(this.eGui, visible, { skipAriaHidden });\n }\n }\n setDisplayed(displayed, options = {}) {\n if (displayed !== this.displayed) {\n this.displayed = displayed;\n const { skipAriaHidden } = options;\n _setDisplayed(this.eGui, displayed, { skipAriaHidden });\n const event = {\n type: \"displayChanged\",\n visible: this.displayed\n };\n this.dispatchLocalEvent(event);\n }\n }\n destroy() {\n if (this.parentComponent) {\n this.parentComponent = void 0;\n }\n if (this.tooltipFeature) {\n this.tooltipFeature = this.destroyBean(this.tooltipFeature);\n }\n super.destroy();\n }\n addGuiEventListener(event, listener, options) {\n this.eGui.addEventListener(event, listener, options);\n this.addDestroyFunc(() => this.eGui.removeEventListener(event, listener));\n }\n addCssClass(className) {\n this.cssClassManager.addCssClass(className);\n }\n removeCssClass(className) {\n this.cssClassManager.removeCssClass(className);\n }\n containsCssClass(className) {\n return this.cssClassManager.containsCssClass(className);\n }\n addOrRemoveCssClass(className, addOrRemove) {\n this.cssClassManager.addOrRemoveCssClass(className, addOrRemove);\n }\n};\n\n// community-modules/core/src/utils/icon.ts\nvar iconNameClassMap = {\n // header column group shown when expanded (click to contract)\n columnGroupOpened: \"expanded\",\n // header column group shown when contracted (click to expand)\n columnGroupClosed: \"contracted\",\n // tool panel column group contracted (click to expand)\n columnSelectClosed: \"tree-closed\",\n // tool panel column group expanded (click to contract)\n columnSelectOpen: \"tree-open\",\n // column tool panel header expand/collapse all button, shown when some children are expanded and\n // others are collapsed\n columnSelectIndeterminate: \"tree-indeterminate\",\n // shown on ghost icon while dragging column to the side of the grid to pin\n columnMovePin: \"pin\",\n // shown on ghost icon while dragging over part of the page that is not a drop zone\n columnMoveHide: \"eye-slash\",\n // shown on ghost icon while dragging columns to reorder\n columnMoveMove: \"arrows\",\n // animating icon shown when dragging a column to the right of the grid causes horizontal scrolling\n columnMoveLeft: \"left\",\n // animating icon shown when dragging a column to the left of the grid causes horizontal scrolling\n columnMoveRight: \"right\",\n // shown on ghost icon while dragging over Row Groups drop zone\n columnMoveGroup: \"group\",\n // shown on ghost icon while dragging over Values drop zone\n columnMoveValue: \"aggregation\",\n // shown on ghost icon while dragging over pivot drop zone\n columnMovePivot: \"pivot\",\n // shown on ghost icon while dragging over drop zone that doesn't support it, e.g.\n // string column over aggregation drop zone\n dropNotAllowed: \"not-allowed\",\n // shown on row group when contracted (click to expand)\n groupContracted: \"tree-closed\",\n // shown on row group when expanded (click to contract)\n groupExpanded: \"tree-open\",\n // set filter tree list group contracted (click to expand)\n setFilterGroupClosed: \"tree-closed\",\n // set filter tree list group expanded (click to contract)\n setFilterGroupOpen: \"tree-open\",\n // set filter tree list expand/collapse all button, shown when some children are expanded and\n // others are collapsed\n setFilterGroupIndeterminate: \"tree-indeterminate\",\n // context menu chart item\n chart: \"chart\",\n // chart window title bar\n close: \"cross\",\n // X (remove) on column 'pill' after adding it to a drop zone list\n cancel: \"cancel\",\n // indicates the currently active pin state in the \"Pin column\" sub-menu of the column menu\n check: \"tick\",\n // \"go to first\" button in pagination controls\n first: \"first\",\n // \"go to previous\" button in pagination controls\n previous: \"previous\",\n // \"go to next\" button in pagination controls\n next: \"next\",\n // \"go to last\" button in pagination controls\n last: \"last\",\n // shown on top right of chart when chart is linked to range data (click to unlink)\n linked: \"linked\",\n // shown on top right of chart when chart is not linked to range data (click to link)\n unlinked: \"unlinked\",\n // \"Choose colour\" button on chart settings tab\n colorPicker: \"color-picker\",\n // rotating spinner shown by the loading cell renderer\n groupLoading: \"loading\",\n // button to launch enterprise column menu\n menu: \"menu\",\n menuAlt: \"menu-alt\",\n // filter tool panel tab\n filter: \"filter\",\n // column tool panel tab\n columns: \"columns\",\n // button in chart regular size window title bar (click to maximise)\n maximize: \"maximize\",\n // button in chart maximised window title bar (click to make regular size)\n minimize: \"minimize\",\n // \"Pin column\" item in column header menu\n menuPin: \"pin\",\n // \"Value aggregation\" column menu item (shown on numeric columns when grouping is active)\"\n menuValue: \"aggregation\",\n // \"Group by {column-name}\" item in column header menu\n menuAddRowGroup: \"group\",\n // \"Un-Group by {column-name}\" item in column header menu\n menuRemoveRowGroup: \"group\",\n // context menu copy item\n clipboardCopy: \"copy\",\n // context menu cut item\n clipboardCut: \"cut\",\n // context menu paste item\n clipboardPaste: \"paste\",\n // identifies the pivot drop zone\n pivotPanel: \"pivot\",\n // \"Row groups\" drop zone in column tool panel\n rowGroupPanel: \"group\",\n // columns tool panel Values drop zone\n valuePanel: \"aggregation\",\n // drag handle used to pick up draggable columns\n columnDrag: \"grip\",\n // drag handle used to pick up draggable rows\n rowDrag: \"grip\",\n // context menu export item\n save: \"save\",\n // csv export\n csvExport: \"csv\",\n // excel export,\n excelExport: \"excel\",\n // icon on dropdown editors\n smallDown: \"small-down\",\n // version of small-right used in RTL mode\n smallLeft: \"small-left\",\n // separater between column 'pills' when you add multiple columns to the header drop zone\n smallRight: \"small-right\",\n smallUp: \"small-up\",\n // show on column header when column is sorted ascending\n sortAscending: \"asc\",\n // show on column header when column is sorted descending\n sortDescending: \"desc\",\n // show on column header when column has no sort, only when enabled with gridOptions.unSortIcon=true\n sortUnSort: \"none\",\n // Builder button in Advanced Filter\n advancedFilterBuilder: \"group\",\n // drag handle used to pick up Advanced Filter Builder rows\n advancedFilterBuilderDrag: \"grip\",\n // Advanced Filter Builder row validation error\n advancedFilterBuilderInvalid: \"not-allowed\",\n // shown on Advanced Filter Builder rows to move them up\n advancedFilterBuilderMoveUp: \"up\",\n // shown on Advanced Filter Builder rows to move them down\n advancedFilterBuilderMoveDown: \"down\",\n // shown on Advanced Filter Builder rows to add new rows\n advancedFilterBuilderAdd: \"plus\",\n // shown on Advanced Filter Builder rows to remove row\n advancedFilterBuilderRemove: \"minus\",\n // Edit Chart menu item shown in Integrated Charts menu\n chartsMenuEdit: \"chart\",\n // Advanced Settings menu item shown in Integrated Charts menu\n chartsMenuAdvancedSettings: \"settings\",\n // shown in Integrated Charts menu add fields\n chartsMenuAdd: \"plus\",\n // checked checkbox\n checkboxChecked: \"checkbox-checked\",\n // indeterminate checkbox\n checkboxIndeterminate: \"checkbox-indeterminate\",\n // unchecked checkbox\n checkboxUnchecked: \"checkbox-unchecked\",\n // radio button on\n radioButtonOn: \"radio-button-on\",\n // radio button off\n radioButtonOff: \"radio-button-off\"\n};\nfunction _createIcon(iconName, gos, column) {\n const iconContents = _createIconNoSpan(iconName, gos, column);\n if (iconContents) {\n const { className } = iconContents;\n if (typeof className === \"string\" && className.indexOf(\"ag-icon\") > -1 || typeof className === \"object\" && className[\"ag-icon\"]) {\n return iconContents;\n }\n }\n const eResult = document.createElement(\"span\");\n eResult.appendChild(iconContents);\n return eResult;\n}\nfunction _createIconNoSpan(iconName, gos, column, forceCreate) {\n let userProvidedIcon = null;\n const icons = column && column.getColDef().icons;\n if (icons) {\n userProvidedIcon = icons[iconName];\n }\n if (gos && !userProvidedIcon) {\n const optionsIcons = gos.get(\"icons\");\n if (optionsIcons) {\n userProvidedIcon = optionsIcons[iconName];\n }\n }\n if (userProvidedIcon) {\n let rendererResult;\n if (typeof userProvidedIcon === \"function\") {\n rendererResult = userProvidedIcon();\n } else if (typeof userProvidedIcon === \"string\") {\n rendererResult = userProvidedIcon;\n } else {\n throw new Error(\"icon from grid options needs to be a string or a function\");\n }\n if (typeof rendererResult === \"string\") {\n return _loadTemplate(rendererResult);\n }\n if (_isNodeOrElement(rendererResult)) {\n return rendererResult;\n }\n _warnOnce(\"iconRenderer should return back a string or a dom object\");\n } else {\n const span = document.createElement(\"span\");\n let cssClass = iconNameClassMap[iconName];\n if (!cssClass) {\n if (!forceCreate) {\n _warnOnce(`Did not find icon ${iconName}`);\n cssClass = \"\";\n } else {\n cssClass = iconName;\n }\n }\n span.setAttribute(\"class\", `ag-icon ag-icon-${cssClass}`);\n span.setAttribute(\"unselectable\", \"on\");\n _setAriaRole(span, \"presentation\");\n return span;\n }\n}\n\n// community-modules/core/src/utils/mouse.ts\nfunction _areEventsNear(e1, e2, pixelCount) {\n if (pixelCount === 0) {\n return false;\n }\n const diffX = Math.abs(e1.clientX - e2.clientX);\n const diffY = Math.abs(e1.clientY - e2.clientY);\n return Math.max(diffX, diffY) <= pixelCount;\n}\n\n// community-modules/core/src/widgets/touchListener.ts\nvar TouchListener = class {\n constructor(eElement, preventMouseClick = false) {\n this.DOUBLE_TAP_MILLIS = 500;\n this.destroyFuncs = [];\n this.touching = false;\n this.localEventService = new LocalEventService();\n this.eElement = eElement;\n this.preventMouseClick = preventMouseClick;\n const startListener = this.onTouchStart.bind(this);\n const moveListener = this.onTouchMove.bind(this);\n const endListener = this.onTouchEnd.bind(this);\n this.eElement.addEventListener(\"touchstart\", startListener, { passive: true });\n this.eElement.addEventListener(\"touchmove\", moveListener, { passive: true });\n this.eElement.addEventListener(\"touchend\", endListener, { passive: false });\n this.destroyFuncs.push(() => {\n this.eElement.removeEventListener(\"touchstart\", startListener, { passive: true });\n this.eElement.removeEventListener(\"touchmove\", moveListener, { passive: true });\n this.eElement.removeEventListener(\"touchend\", endListener, { passive: false });\n });\n }\n getActiveTouch(touchList) {\n for (let i = 0; i < touchList.length; i++) {\n const matches = touchList[i].identifier === this.touchStart.identifier;\n if (matches) {\n return touchList[i];\n }\n }\n return null;\n }\n addEventListener(eventType, listener) {\n this.localEventService.addEventListener(eventType, listener);\n }\n removeEventListener(eventType, listener) {\n this.localEventService.removeEventListener(eventType, listener);\n }\n onTouchStart(touchEvent) {\n if (this.touching) {\n return;\n }\n this.touchStart = touchEvent.touches[0];\n this.touching = true;\n this.moved = false;\n const touchStartCopy = this.touchStart;\n window.setTimeout(() => {\n const touchesMatch = this.touchStart === touchStartCopy;\n if (this.touching && touchesMatch && !this.moved) {\n this.moved = true;\n const event = {\n type: \"longTap\",\n touchStart: this.touchStart,\n touchEvent\n };\n this.localEventService.dispatchEvent(event);\n }\n }, 500);\n }\n onTouchMove(touchEvent) {\n if (!this.touching) {\n return;\n }\n const touch = this.getActiveTouch(touchEvent.touches);\n if (!touch) {\n return;\n }\n const eventIsFarAway = !_areEventsNear(touch, this.touchStart, 4);\n if (eventIsFarAway) {\n this.moved = true;\n }\n }\n onTouchEnd(touchEvent) {\n if (!this.touching) {\n return;\n }\n if (!this.moved) {\n const event = {\n type: \"tap\",\n touchStart: this.touchStart\n };\n this.localEventService.dispatchEvent(event);\n this.checkForDoubleTap();\n }\n if (this.preventMouseClick && touchEvent.cancelable) {\n touchEvent.preventDefault();\n }\n this.touching = false;\n }\n checkForDoubleTap() {\n const now = (/* @__PURE__ */ new Date()).getTime();\n if (this.lastTapTime && this.lastTapTime > 0) {\n const interval = now - this.lastTapTime;\n if (interval > this.DOUBLE_TAP_MILLIS) {\n const event = {\n type: \"doubleTap\",\n touchStart: this.touchStart\n };\n this.localEventService.dispatchEvent(event);\n this.lastTapTime = null;\n } else {\n this.lastTapTime = now;\n }\n } else {\n this.lastTapTime = now;\n }\n }\n destroy() {\n this.destroyFuncs.forEach((func) => func());\n }\n};\n\n// community-modules/core/src/headerRendering/cells/column/sortIndicatorComp.ts\nvar SortIndicatorTemplate = (\n /* html */\n `\n \n \n \n \n \n `\n);\nvar SortIndicatorComp = class extends Component {\n constructor(skipTemplate) {\n super();\n this.eSortOrder = RefPlaceholder;\n this.eSortAsc = RefPlaceholder;\n this.eSortDesc = RefPlaceholder;\n this.eSortMixed = RefPlaceholder;\n this.eSortNone = RefPlaceholder;\n if (!skipTemplate) {\n this.setTemplate(SortIndicatorTemplate);\n }\n }\n wireBeans(beans) {\n this.sortController = beans.sortController;\n }\n attachCustomElements(eSortOrder, eSortAsc, eSortDesc, eSortMixed, eSortNone) {\n this.eSortOrder = eSortOrder;\n this.eSortAsc = eSortAsc;\n this.eSortDesc = eSortDesc;\n this.eSortMixed = eSortMixed;\n this.eSortNone = eSortNone;\n }\n setupSort(column, suppressOrder = false) {\n this.column = column;\n this.suppressOrder = suppressOrder;\n this.setupMultiSortIndicator();\n if (!this.column.isSortable() && !this.column.getColDef().showRowGroup) {\n return;\n }\n this.addInIcon(\"sortAscending\", this.eSortAsc, column);\n this.addInIcon(\"sortDescending\", this.eSortDesc, column);\n this.addInIcon(\"sortUnSort\", this.eSortNone, column);\n this.addManagedPropertyListener(\"unSortIcon\", () => this.updateIcons());\n this.addManagedEventListeners({\n newColumnsLoaded: this.updateIcons.bind(this),\n // Watch global events, as row group columns can effect their display column.\n sortChanged: this.onSortChanged.bind(this),\n // when grouping changes so can sort indexes and icons\n columnRowGroupChanged: this.onSortChanged.bind(this)\n });\n this.onSortChanged();\n }\n addInIcon(iconName, eParent, column) {\n if (eParent == null) {\n return;\n }\n const eIcon = _createIconNoSpan(iconName, this.gos, column);\n if (eIcon) {\n eParent.appendChild(eIcon);\n }\n }\n onSortChanged() {\n this.updateIcons();\n if (!this.suppressOrder) {\n this.updateSortOrder();\n }\n }\n updateIcons() {\n const sortDirection = this.sortController.getDisplaySortForColumn(this.column);\n if (this.eSortAsc) {\n const isAscending = sortDirection === \"asc\";\n _setDisplayed(this.eSortAsc, isAscending, { skipAriaHidden: true });\n }\n if (this.eSortDesc) {\n const isDescending = sortDirection === \"desc\";\n _setDisplayed(this.eSortDesc, isDescending, { skipAriaHidden: true });\n }\n if (this.eSortNone) {\n const alwaysHideNoSort = !this.column.getColDef().unSortIcon && !this.gos.get(\"unSortIcon\");\n const isNone = sortDirection === null || sortDirection === void 0;\n _setDisplayed(this.eSortNone, !alwaysHideNoSort && isNone, { skipAriaHidden: true });\n }\n }\n setupMultiSortIndicator() {\n this.addInIcon(\"sortUnSort\", this.eSortMixed, this.column);\n const isColumnShowingRowGroup = this.column.getColDef().showRowGroup;\n const areGroupsCoupled = this.gos.isColumnsSortingCoupledToGroup();\n if (areGroupsCoupled && isColumnShowingRowGroup) {\n this.addManagedEventListeners({\n // Watch global events, as row group columns can effect their display column.\n sortChanged: this.updateMultiSortIndicator.bind(this),\n // when grouping changes so can sort indexes and icons\n columnRowGroupChanged: this.updateMultiSortIndicator.bind(this)\n });\n this.updateMultiSortIndicator();\n }\n }\n updateMultiSortIndicator() {\n if (this.eSortMixed) {\n const isMixedSort = this.sortController.getDisplaySortForColumn(this.column) === \"mixed\";\n _setDisplayed(this.eSortMixed, isMixedSort, { skipAriaHidden: true });\n }\n }\n // we listen here for global sort events, NOT column sort events, as we want to do this\n // when sorting has been set on all column (if we listened just for our col (where we\n // set the asc / desc icons) then it's possible other cols are yet to get their sorting state.\n updateSortOrder() {\n if (!this.eSortOrder) {\n return;\n }\n const allColumnsWithSorting = this.sortController.getColumnsWithSortingOrdered();\n const indexThisCol = this.sortController.getDisplaySortIndexForColumn(this.column) ?? -1;\n const moreThanOneColSorting = allColumnsWithSorting.some(\n (col) => this.sortController.getDisplaySortIndexForColumn(col) ?? -1 >= 1\n );\n const showIndex = indexThisCol >= 0 && moreThanOneColSorting;\n _setDisplayed(this.eSortOrder, showIndex, { skipAriaHidden: true });\n if (indexThisCol >= 0) {\n this.eSortOrder.textContent = (indexThisCol + 1).toString();\n } else {\n _clearElement(this.eSortOrder);\n }\n }\n};\nvar SortIndicatorSelector = {\n selector: \"AG-SORT-INDICATOR\",\n component: SortIndicatorComp\n};\n\n// community-modules/core/src/headerRendering/cells/column/headerComp.ts\nvar HeaderCompTemplate = (\n /* html */\n `
\n \n \n
\n \n \n \n
\n
`\n);\nvar HeaderComp = class extends Component {\n constructor() {\n super(...arguments);\n this.eFilter = RefPlaceholder;\n this.eFilterButton = RefPlaceholder;\n this.eSortIndicator = RefPlaceholder;\n this.eMenu = RefPlaceholder;\n this.eLabel = RefPlaceholder;\n this.eText = RefPlaceholder;\n /**\n * Selectors for custom headers templates\n */\n this.eSortOrder = RefPlaceholder;\n this.eSortAsc = RefPlaceholder;\n this.eSortDesc = RefPlaceholder;\n this.eSortMixed = RefPlaceholder;\n this.eSortNone = RefPlaceholder;\n this.lastMovingChanged = 0;\n }\n wireBeans(beans) {\n this.sortController = beans.sortController;\n this.menuService = beans.menuService;\n this.funcColsService = beans.funcColsService;\n }\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n destroy() {\n super.destroy();\n }\n refresh(params) {\n const oldParams = this.params;\n this.params = params;\n if (this.workOutTemplate() != this.currentTemplate || this.workOutShowMenu() != this.currentShowMenu || this.workOutSort() != this.currentSort || this.shouldSuppressMenuHide() != this.currentSuppressMenuHide || oldParams.enableFilterButton != params.enableFilterButton || oldParams.enableFilterIcon != params.enableFilterIcon) {\n return false;\n }\n this.setDisplayName(params);\n return true;\n }\n workOutTemplate() {\n let template = this.params.template ?? HeaderCompTemplate;\n template = template && template.trim ? template.trim() : template;\n return template;\n }\n init(params) {\n this.params = params;\n this.currentTemplate = this.workOutTemplate();\n this.setTemplate(this.currentTemplate, [SortIndicatorSelector]);\n this.setupTap();\n this.setMenu();\n this.setupSort();\n this.setupFilterIcon();\n this.setupFilterButton();\n this.setDisplayName(params);\n }\n setDisplayName(params) {\n if (this.currentDisplayName != params.displayName) {\n this.currentDisplayName = params.displayName;\n const displayNameSanitised = _escapeString(this.currentDisplayName, true);\n if (this.eText) {\n this.eText.textContent = displayNameSanitised;\n }\n }\n }\n addInIcon(iconName, eParent, column) {\n if (eParent == null) {\n return;\n }\n const eIcon = _createIconNoSpan(iconName, this.gos, column);\n if (eIcon) {\n eParent.appendChild(eIcon);\n }\n }\n setupTap() {\n const { gos } = this;\n if (gos.get(\"suppressTouch\")) {\n return;\n }\n const touchListener = new TouchListener(this.getGui(), true);\n const suppressMenuHide = this.shouldSuppressMenuHide();\n const tapMenuButton = suppressMenuHide && _exists(this.eMenu);\n const menuTouchListener = tapMenuButton ? new TouchListener(this.eMenu, true) : touchListener;\n if (this.params.enableMenu) {\n const eventType = tapMenuButton ? \"tap\" : \"longTap\";\n const showMenuFn = (event) => this.params.showColumnMenuAfterMouseClick(event.touchStart);\n this.addManagedListeners(menuTouchListener, { [eventType]: showMenuFn });\n }\n if (this.params.enableSorting) {\n const tapListener = (event) => {\n const target = event.touchStart.target;\n if (suppressMenuHide && (this.eMenu?.contains(target) || this.eFilterButton?.contains(target))) {\n return;\n }\n this.sortController.progressSort(this.params.column, false, \"uiColumnSorted\");\n };\n this.addManagedListeners(touchListener, { tap: tapListener });\n }\n if (this.params.enableFilterButton) {\n const filterButtonTouchListener = new TouchListener(this.eFilterButton, true);\n this.addManagedListeners(filterButtonTouchListener, {\n tap: () => this.params.showFilter(this.eFilterButton)\n });\n this.addDestroyFunc(() => filterButtonTouchListener.destroy());\n }\n this.addDestroyFunc(() => touchListener.destroy());\n if (tapMenuButton) {\n this.addDestroyFunc(() => menuTouchListener.destroy());\n }\n }\n workOutShowMenu() {\n return this.params.enableMenu && this.menuService.isHeaderMenuButtonEnabled();\n }\n shouldSuppressMenuHide() {\n return this.menuService.isHeaderMenuButtonAlwaysShowEnabled();\n }\n setMenu() {\n if (!this.eMenu) {\n return;\n }\n this.currentShowMenu = this.workOutShowMenu();\n if (!this.currentShowMenu) {\n _removeFromParent(this.eMenu);\n this.eMenu = void 0;\n return;\n }\n const isLegacyMenu = this.menuService.isLegacyMenuEnabled();\n this.addInIcon(isLegacyMenu ? \"menu\" : \"menuAlt\", this.eMenu, this.params.column);\n this.eMenu.classList.toggle(\"ag-header-menu-icon\", !isLegacyMenu);\n this.currentSuppressMenuHide = this.shouldSuppressMenuHide();\n this.addManagedElementListeners(this.eMenu, { click: () => this.params.showColumnMenu(this.eMenu) });\n this.eMenu.classList.toggle(\"ag-header-menu-always-show\", this.currentSuppressMenuHide);\n }\n onMenuKeyboardShortcut(isFilterShortcut) {\n const column = this.params.column;\n const isLegacyMenuEnabled = this.menuService.isLegacyMenuEnabled();\n if (isFilterShortcut && !isLegacyMenuEnabled) {\n if (this.menuService.isFilterMenuInHeaderEnabled(column)) {\n this.params.showFilter(this.eFilterButton ?? this.eMenu ?? this.getGui());\n return true;\n }\n } else if (this.params.enableMenu) {\n this.params.showColumnMenu(this.eMenu ?? this.eFilterButton ?? this.getGui());\n return true;\n }\n return false;\n }\n workOutSort() {\n return this.params.enableSorting;\n }\n setupSort() {\n this.currentSort = this.params.enableSorting;\n if (!this.eSortIndicator) {\n this.eSortIndicator = this.createBean(new SortIndicatorComp(true));\n this.eSortIndicator.attachCustomElements(\n this.eSortOrder,\n this.eSortAsc,\n this.eSortDesc,\n this.eSortMixed,\n this.eSortNone\n );\n }\n this.eSortIndicator.setupSort(this.params.column);\n if (!this.currentSort) {\n return;\n }\n this.addManagedListeners(this.params.column, {\n movingChanged: () => {\n this.lastMovingChanged = (/* @__PURE__ */ new Date()).getTime();\n }\n });\n if (this.eLabel) {\n this.addManagedElementListeners(this.eLabel, {\n click: (event) => {\n const moving = this.params.column.isMoving();\n const nowTime = (/* @__PURE__ */ new Date()).getTime();\n const movedRecently = nowTime - this.lastMovingChanged < 50;\n const columnMoving = moving || movedRecently;\n if (!columnMoving) {\n const sortUsingCtrl = this.gos.get(\"multiSortKey\") === \"ctrl\";\n const multiSort = sortUsingCtrl ? event.ctrlKey || event.metaKey : event.shiftKey;\n this.params.progressSort(multiSort);\n }\n }\n });\n }\n const onSortingChanged = () => {\n const sort = this.params.column.getSort();\n this.addOrRemoveCssClass(\"ag-header-cell-sorted-asc\", sort === \"asc\");\n this.addOrRemoveCssClass(\"ag-header-cell-sorted-desc\", sort === \"desc\");\n this.addOrRemoveCssClass(\"ag-header-cell-sorted-none\", !sort);\n if (this.params.column.getColDef().showRowGroup) {\n const sourceColumns = this.funcColsService.getSourceColumnsForGroupColumn(\n this.params.column\n );\n const sortDirectionsMatch = sourceColumns?.every(\n (sourceCol) => this.params.column.getSort() == sourceCol.getSort()\n );\n const isMultiSorting = !sortDirectionsMatch;\n this.addOrRemoveCssClass(\"ag-header-cell-sorted-mixed\", isMultiSorting);\n }\n };\n this.addManagedEventListeners({\n sortChanged: onSortingChanged,\n columnRowGroupChanged: onSortingChanged\n });\n }\n setupFilterIcon() {\n if (!this.eFilter) {\n return;\n }\n this.configureFilter(this.params.enableFilterIcon, this.eFilter, this.onFilterChangedIcon.bind(this));\n }\n setupFilterButton() {\n if (!this.eFilterButton) {\n return;\n }\n const configured = this.configureFilter(\n this.params.enableFilterButton,\n this.eFilterButton,\n this.onFilterChangedButton.bind(this)\n );\n if (configured) {\n this.addManagedElementListeners(this.eFilterButton, {\n click: () => this.params.showFilter(this.eFilterButton)\n });\n } else {\n this.eFilterButton = void 0;\n }\n }\n configureFilter(enabled, element, filterChangedCallback) {\n if (!enabled) {\n _removeFromParent(element);\n return false;\n }\n const column = this.params.column;\n this.addInIcon(\"filter\", element, column);\n this.addManagedListeners(column, { filterChanged: filterChangedCallback });\n filterChangedCallback();\n return true;\n }\n onFilterChangedIcon() {\n const filterPresent = this.params.column.isFilterActive();\n _setDisplayed(this.eFilter, filterPresent, { skipAriaHidden: true });\n }\n onFilterChangedButton() {\n const filterPresent = this.params.column.isFilterActive();\n this.eFilterButton.classList.toggle(\"ag-filter-active\", filterPresent);\n }\n getAnchorElementForMenu(isFilter) {\n if (isFilter) {\n return this.eFilterButton ?? this.eMenu ?? this.getGui();\n }\n return this.eMenu ?? this.eFilterButton ?? this.getGui();\n }\n};\n\n// community-modules/core/src/headerRendering/cells/columnGroup/headerGroupComp.ts\nvar HeaderGroupComp = class extends Component {\n constructor() {\n super(\n /* html */\n `
\n \n \n \n
`\n );\n this.agOpened = RefPlaceholder;\n this.agClosed = RefPlaceholder;\n this.agLabel = RefPlaceholder;\n }\n wireBeans(beans) {\n this.columnModel = beans.columnModel;\n }\n // this is a user component, and IComponent has \"public destroy()\" as part of the interface.\n // so we need to override destroy() just to make the method public.\n destroy() {\n super.destroy();\n }\n init(params) {\n this.params = params;\n this.checkWarnings();\n this.setupLabel();\n this.addGroupExpandIcon();\n this.setupExpandIcons();\n }\n checkWarnings() {\n const paramsAny = this.params;\n if (paramsAny.template) {\n _warnOnce(\n `A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)`\n );\n }\n }\n setupExpandIcons() {\n this.addInIcon(\"columnGroupOpened\", this.agOpened);\n this.addInIcon(\"columnGroupClosed\", this.agClosed);\n const expandAction = (event) => {\n if (_isStopPropagationForAgGrid(event)) {\n return;\n }\n const newExpandedValue = !this.params.columnGroup.isExpanded();\n this.columnModel.setColumnGroupOpened(\n this.params.columnGroup.getProvidedColumnGroup(),\n newExpandedValue,\n \"uiColumnExpanded\"\n );\n };\n this.addTouchAndClickListeners(this.agClosed, expandAction);\n this.addTouchAndClickListeners(this.agOpened, expandAction);\n const stopPropagationAction = (event) => {\n _stopPropagationForAgGrid(event);\n };\n this.addManagedElementListeners(this.agClosed, { dblclick: stopPropagationAction });\n this.addManagedElementListeners(this.agOpened, { dblclick: stopPropagationAction });\n this.addManagedElementListeners(this.getGui(), { dblclick: expandAction });\n this.updateIconVisibility();\n const providedColumnGroup = this.params.columnGroup.getProvidedColumnGroup();\n const updateIcon = this.updateIconVisibility.bind(this);\n this.addManagedListeners(providedColumnGroup, {\n expandedChanged: updateIcon,\n expandableChanged: updateIcon\n });\n }\n addTouchAndClickListeners(eElement, action) {\n const touchListener = new TouchListener(eElement, true);\n this.addManagedListeners(touchListener, { tap: action });\n this.addDestroyFunc(() => touchListener.destroy());\n this.addManagedElementListeners(eElement, { click: action });\n }\n updateIconVisibility() {\n const columnGroup = this.params.columnGroup;\n if (columnGroup.isExpandable()) {\n const expanded = this.params.columnGroup.isExpanded();\n _setDisplayed(this.agOpened, expanded);\n _setDisplayed(this.agClosed, !expanded);\n } else {\n _setDisplayed(this.agOpened, false);\n _setDisplayed(this.agClosed, false);\n }\n }\n addInIcon(iconName, element) {\n const eIcon = _createIconNoSpan(iconName, this.gos, null);\n if (eIcon) {\n element.appendChild(eIcon);\n }\n }\n addGroupExpandIcon() {\n if (!this.params.columnGroup.isExpandable()) {\n _setDisplayed(this.agOpened, false);\n _setDisplayed(this.agClosed, false);\n return;\n }\n }\n setupLabel() {\n const { displayName, columnGroup } = this.params;\n if (_exists(displayName)) {\n const displayNameSanitised = _escapeString(displayName, true);\n this.agLabel.textContent = displayNameSanitised;\n }\n this.addOrRemoveCssClass(\"ag-sticky-label\", !columnGroup.getColGroupDef()?.suppressStickyLabel);\n }\n};\n\n// community-modules/core/src/modules/moduleNames.ts\nvar ModuleNames = /* @__PURE__ */ ((ModuleNames2) => {\n ModuleNames2[\"CommunityCoreModule\"] = \"@ag-grid-community/core\";\n ModuleNames2[\"InfiniteRowModelModule\"] = \"@ag-grid-community/infinite-row-model\";\n ModuleNames2[\"ClientSideRowModelModule\"] = \"@ag-grid-community/client-side-row-model\";\n ModuleNames2[\"CsvExportModule\"] = \"@ag-grid-community/csv-export\";\n ModuleNames2[\"EnterpriseCoreModule\"] = \"@ag-grid-enterprise/core\";\n ModuleNames2[\"RowGroupingModule\"] = \"@ag-grid-enterprise/row-grouping\";\n ModuleNames2[\"ColumnsToolPanelModule\"] = \"@ag-grid-enterprise/column-tool-panel\";\n ModuleNames2[\"FiltersToolPanelModule\"] = \"@ag-grid-enterprise/filter-tool-panel\";\n ModuleNames2[\"MenuModule\"] = \"@ag-grid-enterprise/menu\";\n ModuleNames2[\"SetFilterModule\"] = \"@ag-grid-enterprise/set-filter\";\n ModuleNames2[\"MultiFilterModule\"] = \"@ag-grid-enterprise/multi-filter\";\n ModuleNames2[\"StatusBarModule\"] = \"@ag-grid-enterprise/status-bar\";\n ModuleNames2[\"SideBarModule\"] = \"@ag-grid-enterprise/side-bar\";\n ModuleNames2[\"RangeSelectionModule\"] = \"@ag-grid-enterprise/range-selection\";\n ModuleNames2[\"MasterDetailModule\"] = \"@ag-grid-enterprise/master-detail\";\n ModuleNames2[\"RichSelectModule\"] = \"@ag-grid-enterprise/rich-select\";\n ModuleNames2[\"GridChartsModule\"] = \"@ag-grid-enterprise/charts\";\n ModuleNames2[\"ViewportRowModelModule\"] = \"@ag-grid-enterprise/viewport-row-model\";\n ModuleNames2[\"ServerSideRowModelModule\"] = \"@ag-grid-enterprise/server-side-row-model\";\n ModuleNames2[\"ExcelExportModule\"] = \"@ag-grid-enterprise/excel-export\";\n ModuleNames2[\"ClipboardModule\"] = \"@ag-grid-enterprise/clipboard\";\n ModuleNames2[\"SparklinesModule\"] = \"@ag-grid-enterprise/sparklines\";\n ModuleNames2[\"AdvancedFilterModule\"] = \"@ag-grid-enterprise/advanced-filter\";\n ModuleNames2[\"AngularModule\"] = \"@ag-grid-community/angular\";\n ModuleNames2[\"ReactModule\"] = \"@ag-grid-community/react\";\n ModuleNames2[\"VueModule\"] = \"@ag-grid-community/vue\";\n return ModuleNames2;\n})(ModuleNames || {});\n\n// community-modules/core/src/modules/moduleRegistry.ts\nvar _ModuleRegistry = class _ModuleRegistry {\n /**\n * Globally register the given module for all grids.\n * @param module - module to register\n */\n static register(module) {\n _ModuleRegistry.__register(module, true, void 0);\n }\n /**\n * Globally register the given modules for all grids.\n * @param modules - modules to register\n */\n static registerModules(modules) {\n _ModuleRegistry.__registerModules(modules, true, void 0);\n }\n /** AG GRID INTERNAL - Module registration helper. */\n static __register(module, moduleBased, gridId) {\n _ModuleRegistry.runVersionChecks(module);\n if (gridId !== void 0) {\n _ModuleRegistry.areGridScopedModules = true;\n if (_ModuleRegistry.gridModulesMap[gridId] === void 0) {\n _ModuleRegistry.gridModulesMap[gridId] = {};\n }\n _ModuleRegistry.gridModulesMap[gridId][module.moduleName] = module;\n } else {\n _ModuleRegistry.globalModulesMap[module.moduleName] = module;\n }\n _ModuleRegistry.setModuleBased(moduleBased);\n }\n /** AG GRID INTERNAL - Unregister grid scoped module. */\n static __unRegisterGridModules(gridId) {\n delete _ModuleRegistry.gridModulesMap[gridId];\n }\n /** AG GRID INTERNAL - Module registration helper. */\n static __registerModules(modules, moduleBased, gridId) {\n _ModuleRegistry.setModuleBased(moduleBased);\n if (!modules) {\n return;\n }\n modules.forEach((module) => _ModuleRegistry.__register(module, moduleBased, gridId));\n }\n static isValidModuleVersion(module) {\n const [moduleMajor, moduleMinor] = module.version.split(\".\") || [];\n const [currentModuleMajor, currentModuleMinor] = _ModuleRegistry.currentModuleVersion.split(\".\") || [];\n return moduleMajor === currentModuleMajor && moduleMinor === currentModuleMinor;\n }\n static runVersionChecks(module) {\n if (!_ModuleRegistry.currentModuleVersion) {\n _ModuleRegistry.currentModuleVersion = module.version;\n }\n const errorMsg = (details) => `You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. ${details} Please update all modules to the same version.`;\n if (!module.version) {\n _errorOnce(errorMsg(`'${module.moduleName}' is incompatible.`));\n } else if (!_ModuleRegistry.isValidModuleVersion(module)) {\n _errorOnce(\n errorMsg(\n `'${module.moduleName}' is version ${module.version} but the other modules are version ${_ModuleRegistry.currentModuleVersion}.`\n )\n );\n }\n if (module.validate) {\n const result = module.validate();\n if (!result.isValid) {\n const errorResult = result;\n _errorOnce(`${errorResult.message}`);\n }\n }\n }\n static setModuleBased(moduleBased) {\n if (_ModuleRegistry.moduleBased === void 0) {\n _ModuleRegistry.moduleBased = moduleBased;\n } else {\n if (_ModuleRegistry.moduleBased !== moduleBased) {\n _errorOnce(\n `AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms.`\n );\n _errorOnce(\"Please see https://www.ag-grid.com/javascript-grid/modules/ for more information.\");\n }\n }\n }\n /**\n * AG GRID INTERNAL - Set if files are being served from a single UMD bundle to provide accurate enterprise upgrade steps.\n */\n static __setIsBundled() {\n _ModuleRegistry.isBundled = true;\n }\n /** AG GRID INTERNAL - Assert a given module has been register, globally or individually with this grid. */\n static __assertRegistered(moduleName, reason, gridId) {\n if (this.__isRegistered(moduleName, gridId)) {\n return true;\n }\n let warningMessage;\n if (_ModuleRegistry.isBundled) {\n {\n warningMessage = `AG Grid: unable to use ${reason} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\n \n