UNPKG

ag-grid-enterprise

Version:

AG Grid Enterprise Features

11 lines 2.36 MB
/** * @ag-grid-enterprise/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.2.1 * @link https://www.ag-grid.com/ * @license Commercial */ /** * @ag-grid-enterprise/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.2.1 * @link https://www.ag-grid.com/ * @license Commercial */ function e(e){return null==e||""===e?null:e}function t(e,t=!1){return null!=e&&(""!==e||t)}function i(e){return!t(e)}function r(e){return null==e||0===e.length}function o(e){return null!=e&&"function"==typeof e.toString?e.toString():null}function n(e){if(void 0===e)return;if(null===e||""===e)return null;if("number"==typeof e)return isNaN(e)?void 0:e;const t=parseInt(e,10);return isNaN(t)?void 0:t}function s(e){if(void 0!==e)return null!==e&&""!==e&&("boolean"==typeof e?e:/true/i.test(e))}function a(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach(e=>t.push(e)),t}return Object.values(e)}var l=Object.freeze({__proto__:null,makeNull:e,exists:t,missing:i,missingOrEmpty:r,toStringOrNull:o,attrToNumber:n,attrToBoolean:s,attrToString:function(e){if(null!=e&&""!==e)return e},referenceCompare:function(e,t){return null==e&&null==t||(null!=e||null==t)&&((null==e||null!=t)&&e===t)},jsonEquals:function(e,t){return(e?JSON.stringify(e):null)===(t?JSON.stringify(t):null)},defaultComparator:function(e,t,i=!1){const r=null==e,o=null==t;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),r&&o)return 0;if(r)return-1;if(o)return 1;function n(e,t){return e>t?1:e<t?-1:0}if("string"!=typeof e)return n(e,t);if(!i)return n(e,t);try{return e.localeCompare(t)}catch(i){return n(e,t)}},values:a});class d{constructor(){this.existingKeys={}}addExistingKeys(e){for(let t=0;t<e.length;t++)this.existingKeys[e[t]]=!0}getUniqueKey(e,t){e=o(e);let i=0;for(;;){let r;if(e?(r=e,0!==i&&(r+="_"+i)):t?(r=t,0!==i&&(r+="_"+i)):r=i,!this.existingKeys[r])return this.existingKeys[r]=!0,String(r);i++}}}function c(e,t){if(null!=e)if(Array.isArray(e))for(let i=0;i<e.length;i++)t(i.toString(),e[i]);else for(const[i,r]of Object.entries(e))t(i,r)}function h(e){const t={},i=Object.keys(e);for(let r=0;r<i.length;r++){const o=i[r],n=e[o];t[o]=n}return t}function u(e,t){if(!e)return;const i=e,r={};return Object.keys(i).forEach(e=>{if(t&&t.indexOf(e)>=0)return;const o=i[e],n=w(o)&&o.constructor===Object;r[e]=n?u(o):o}),r}function p(e,t){return e[t]}function g(e,t,i){e[t]=i}function f(e,t,i,r){const o=p(e,i);void 0!==o&&g(t,i,r?r(o):o)}function v(e){const t={};return e.filter(e=>null!=e).forEach(e=>{Object.keys(e).forEach(e=>t[e]=null)}),Object.keys(t)}function m(e){if(!e)return[];const t=Object;if("function"==typeof t.values)return t.values(e);const i=[];for(const t in e)e.hasOwnProperty(t)&&e.propertyIsEnumerable(t)&&i.push(e[t]);return i}function y(e,i,r=!0,o=!1){t(i)&&c(i,(t,i)=>{let n=e[t];if(n!==i){if(o){if(null==n&&null!=i){"object"==typeof i&&i.constructor===Object&&(n={},e[t]=n)}}w(i)&&w(n)&&!Array.isArray(n)?y(n,i,r,o):(r||void 0!==i)&&(e[t]=i)}})}function C(e,t,i){if(!t||!e)return;if(!i)return e[t];const r=t.split(".");let o=e;for(let e=0;e<r.length;e++){if(null==o)return;o=o[r[e]]}return o}function S(e,t){Object.keys(e).forEach(t=>{"object"==typeof e[t]&&(e[t]=void 0)});const i=Object.getPrototypeOf(e),r={};Object.keys(i).forEach(e=>{if("function"==typeof i[e]){const i=()=>{console.warn(`AG Grid: ${t} function ${e}() cannot be called as the grid has been destroyed.\n Please don't call grid API functions on destroyed grids - as a matter of fact you shouldn't\n be keeping the API reference, your application has a memory leak! Remove the API reference\n when the grid is destroyed.`)};r[e]={value:i,writable:!0}}}),Object.defineProperties(e,r)}function w(e){return"object"==typeof e&&null!==e}var b=Object.freeze({__proto__:null,iterateObject:c,cloneObject:h,deepCloneObject:function(e){return JSON.parse(JSON.stringify(e))},deepCloneDefinition:u,getProperty:p,setProperty:g,copyPropertiesIfPresent:function(e,t,...i){i.forEach(i=>f(e,t,i))},copyPropertyIfPresent:f,getAllKeysInObjects:v,getAllValuesInObject:m,mergeDeep:y,missingOrEmptyObject:function(e){return i(e)||0===Object.keys(e).length},get:function(e,t,i){if(null==e)return i;const r=t.split(".");let o=e;for(;r.length>1;)if(o=o[r.shift()],null==o)return i;const n=o[r[0]];return null!=n?n:i},set:function(e,t,i){if(null==e)return;const r=t.split(".");let o=e;r.forEach((e,t)=>{o[e]||(o[e]={}),t<r.length-1&&(o=o[e])}),o[r[r.length-1]]=i},getValueUsingField:C,removeAllReferences:S,isNonNullObject:w});const E={};function x(e,t){E[t]||(e(),E[t]=!0)}function R(e){if(e.name)return e.name;const t=/function\s+([^\(]+)/.exec(e.toString());return t&&2===t.length?t[1].trim():null}function T(e){return!!(e&&e.constructor&&e.call&&e.apply)}function D(e){M(e,400)}const O=[];let P=!1;function A(e){O.push(e),P||(P=!0,window.setTimeout(()=>{const e=O.slice();O.length=0,P=!1,e.forEach(e=>e())},0))}function M(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(e=>e()),t)}function F(e,t){let i;return function(...r){const o=this;window.clearTimeout(i),i=window.setTimeout((function(){e.apply(o,r)}),t)}}function L(e,t){let i=0;return function(...r){const o=(new Date).getTime();o-i<t||(i=o,e.apply(this,r))}}function I(e,t,i=100,r){const o=(new Date).getTime();let n=null,s=!1;const a=()=>{const a=(new Date).getTime()-o>i;(e()||a)&&(t(),s=!0,null!=n&&(window.clearInterval(n),n=null),a&&r&&console.warn(r))};a(),s||(n=window.setInterval(a,10))}function N(e){e&&e()}var G,k=Object.freeze({__proto__:null,doOnce:x,getFunctionName:R,isFunction:T,executeInAWhile:D,executeNextVMTurn:A,executeAfter:M,debounce:F,throttle:L,waitUntil:I,compose:function(...e){return t=>e.reduce((e,t)=>t(e),t)},callIfPresent:N,noop:()=>{}});!function(e){e.CommunityCoreModule="@ag-grid-community/core",e.InfiniteRowModelModule="@ag-grid-community/infinite-row-model",e.ClientSideRowModelModule="@ag-grid-community/client-side-row-model",e.CsvExportModule="@ag-grid-community/csv-export",e.EnterpriseCoreModule="@ag-grid-enterprise/core",e.RowGroupingModule="@ag-grid-enterprise/row-grouping",e.ColumnsToolPanelModule="@ag-grid-enterprise/column-tool-panel",e.FiltersToolPanelModule="@ag-grid-enterprise/filter-tool-panel",e.MenuModule="@ag-grid-enterprise/menu",e.SetFilterModule="@ag-grid-enterprise/set-filter",e.MultiFilterModule="@ag-grid-enterprise/multi-filter",e.StatusBarModule="@ag-grid-enterprise/status-bar",e.SideBarModule="@ag-grid-enterprise/side-bar",e.RangeSelectionModule="@ag-grid-enterprise/range-selection",e.MasterDetailModule="@ag-grid-enterprise/master-detail",e.RichSelectModule="@ag-grid-enterprise/rich-select",e.GridChartsModule="@ag-grid-enterprise/charts",e.ViewportRowModelModule="@ag-grid-enterprise/viewport-row-model",e.ServerSideRowModelModule="@ag-grid-enterprise/server-side-row-model",e.ExcelExportModule="@ag-grid-enterprise/excel-export",e.ClipboardModule="@ag-grid-enterprise/clipboard",e.SparklinesModule="@ag-grid-enterprise/sparklines",e.AdvancedFilterModule="@ag-grid-enterprise/advanced-filter",e.AngularModule="@ag-grid-community/angular",e.ReactModule="@ag-grid-community/react",e.VueModule="@ag-grid-community/vue"}(G||(G={}));class _{static register(e){_.__register(e,!0,void 0)}static registerModules(e){_.__registerModules(e,!0,void 0)}static __register(e,t,i){_.runVersionChecks(e),void 0!==i?(_.areGridScopedModules=!0,void 0===_.gridModulesMap[i]&&(_.gridModulesMap[i]={}),_.gridModulesMap[i][e.moduleName]=e):_.globalModulesMap[e.moduleName]=e,_.setModuleBased(t)}static __unRegisterGridModules(e){delete _.gridModulesMap[e]}static __registerModules(e,t,i){_.setModuleBased(t),e&&e.forEach(e=>_.__register(e,t,i))}static isValidModuleVersion(e){const[t,i]=e.version.split(".")||[],[r,o]=_.currentModuleVersion.split(".")||[];return t===r&&i===o}static runVersionChecks(e){if(_.currentModuleVersion||(_.currentModuleVersion=e.version),e.version?_.isValidModuleVersion(e)||console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${e.moduleName}' is version ${e.version} but the other modules are version ${this.currentModuleVersion}. Please update all modules to the same version.`):console.error(`AG Grid: You are using incompatible versions of AG Grid modules. Major and minor versions should always match across modules. '${e.moduleName}' is incompatible. Please update all modules to the same version.`),e.validate){const t=e.validate();if(!t.isValid){const e=t;console.error("AG Grid: "+e.message)}}}static setModuleBased(e){void 0===_.moduleBased?_.moduleBased=e:_.moduleBased!==e&&x(()=>{console.warn("AG Grid: You are mixing modules (i.e. @ag-grid-community/core) and packages (ag-grid-community) - you can only use one or the other of these mechanisms."),console.warn("Please see https://www.ag-grid.com/javascript-grid/packages-modules/ for more information.")},"ModulePackageCheck")}static __setIsBundled(){_.isBundled=!0}static __assertRegistered(e,t,i){var r;if(this.__isRegistered(e,i))return!0;const o=t+e;let n;if(_.isBundled)n=`AG Grid: unable to use ${t} as 'ag-grid-enterprise' has not been loaded. Check you are using the Enterprise bundle:\n \n <script src="https://cdn.jsdelivr.net/npm/ag-grid-enterprise@AG_GRID_VERSION/dist/ag-grid-enterprise.min.js"><\/script>\n \nFor more info see: https://ag-grid.com/javascript-data-grid/getting-started/#getting-started-with-ag-grid-enterprise`;else if(_.moduleBased||void 0===_.moduleBased){let o=null===(r=Object.entries(G).find(([t,i])=>i===e))||void 0===r?void 0:r[0];n=`AG Grid: unable to use ${t} as the ${o} is not registered${_.areGridScopedModules?" for gridId: "+i:""}. Check if you have registered the module:\n \n import { ModuleRegistry } from '@ag-grid-community/core';\n import { ${o} } from '${e}';\n \n ModuleRegistry.registerModules([ ${o} ]);\n\nFor more info see: https://www.ag-grid.com/javascript-grid/modules/`}else n=`AG Grid: unable to use ${t} as package 'ag-grid-enterprise' has not been imported. Check that you have imported the package:\n \n import 'ag-grid-enterprise';\n \nFor more info see: https://www.ag-grid.com/javascript-grid/packages/`;return x(()=>{console.warn(n)},o),!1}static __isRegistered(e,t){var i;return!!_.globalModulesMap[e]||!!(null===(i=_.gridModulesMap[t])||void 0===i?void 0:i[e])}static __getRegisteredModules(e){return[...a(_.globalModulesMap),...a(_.gridModulesMap[e]||{})]}static __getGridRegisteredModules(e){var t;return a(null!==(t=_.gridModulesMap[e])&&void 0!==t?t:{})||[]}static __isPackageBased(){return!_.moduleBased}}_.globalModulesMap={},_.gridModulesMap={},_.areGridScopedModules=!1;class V{constructor(e,t){if(this.beanWrappers={},this.destroyed=!1,!e||!e.beanClasses)return;this.contextParams=e,this.logger=t,this.logger.log(">> creating ag-Application Context"),this.createBeans();const i=this.getBeanInstances();this.wireBeans(i),this.logger.log(">> ag-Application Context ready - component is alive")}getBeanInstances(){return a(this.beanWrappers).map(e=>e.beanInstance)}createBean(e,t){if(!e)throw Error("Can't wire to bean since it is null");return this.wireBeans([e],t),e}wireBeans(e,i){this.autoWireBeans(e),this.methodWireBeans(e),this.callLifeCycleMethods(e,"preConstructMethods"),t(i)&&e.forEach(i),this.callLifeCycleMethods(e,"postConstructMethods")}createBeans(){this.contextParams.beanClasses.forEach(this.createBeanWrapper.bind(this)),c(this.beanWrappers,(e,t)=>{let i;t.bean.__agBeanMetaData&&t.bean.__agBeanMetaData.autowireMethods&&t.bean.__agBeanMetaData.autowireMethods.agConstructor&&(i=t.bean.__agBeanMetaData.autowireMethods.agConstructor);const r=this.getBeansForParameters(i,t.bean.name),o=new(t.bean.bind.apply(t.bean,[null,...r]));t.beanInstance=o});const e=Object.keys(this.beanWrappers).join(", ");this.logger.log("created beans: "+e)}createBeanWrapper(e){const t=e.__agBeanMetaData;if(!t){let t;return t=e.prototype.constructor?R(e.prototype.constructor):""+e,void console.error(`Context item ${t} is not a bean`)}const i={bean:e,beanInstance:null,beanName:t.beanName};this.beanWrappers[t.beanName]=i}autoWireBeans(e){e.forEach(e=>{this.forEachMetaDataInHierarchy(e,(t,i)=>{const r=t.agClassAttributes;r&&r.forEach(t=>{const r=this.lookupBeanInstance(i,t.beanName,t.optional);e[t.attributeName]=r})})})}methodWireBeans(e){e.forEach(e=>{this.forEachMetaDataInHierarchy(e,(t,i)=>{c(t.autowireMethods,(t,r)=>{if("agConstructor"===t)return;const o=this.getBeansForParameters(r,i);e[t].apply(e,o)})})})}forEachMetaDataInHierarchy(e,t){let i=Object.getPrototypeOf(e);for(;null!=i;){const e=i.constructor;if(e.hasOwnProperty("__agBeanMetaData")){t(e.__agBeanMetaData,this.getBeanName(e))}i=Object.getPrototypeOf(i)}}getBeanName(e){if(e.__agBeanMetaData&&e.__agBeanMetaData.beanName)return e.__agBeanMetaData.beanName;const t=e.toString();return t.substring(9,t.indexOf("("))}getBeansForParameters(e,t){const i=[];return e&&c(e,(e,r)=>{const o=this.lookupBeanInstance(t,r);i[Number(e)]=o}),i}lookupBeanInstance(e,t,i=!1){if(this.destroyed)return this.logger.log(`AG Grid: bean reference ${t} is used after the grid is destroyed!`),null;if("context"===t)return this;if(this.contextParams.providedBeanInstances&&this.contextParams.providedBeanInstances.hasOwnProperty(t))return this.contextParams.providedBeanInstances[t];const r=this.beanWrappers[t];return r?r.beanInstance:(i||console.error(`AG Grid: unable to find bean reference ${t} while initialising ${e}`),null)}callLifeCycleMethods(e,t){e.forEach(e=>this.callLifeCycleMethodsOnBean(e,t))}callLifeCycleMethodsOnBean(e,t,i){const r={};this.forEachMetaDataInHierarchy(e,e=>{const o=e[t];o&&o.forEach(e=>{e!=i&&(r[e]=!0)})});Object.keys(r).forEach(t=>e[t]())}getBean(e){return this.lookupBeanInstance("getBean",e,!0)}destroy(){if(this.destroyed)return;this.destroyed=!0,this.logger.log(">> Shutting down ag-Application Context");const e=this.getBeanInstances();this.destroyBeans(e),this.contextParams.providedBeanInstances=null,_.__unRegisterGridModules(this.contextParams.gridId),this.logger.log(">> ag-Application Context shut down - component is dead")}destroyBean(e){e&&this.destroyBeans([e])}destroyBeans(e){return e?(e.forEach(e=>{this.callLifeCycleMethodsOnBean(e,"preDestroyMethods","destroy");const t=e;"function"==typeof t.destroy&&t.destroy()}),[]):[]}isDestroyed(){return this.destroyed}getGridId(){return this.contextParams.gridId}}function B(e,t,i){const r=X(e.constructor);r.preConstructMethods||(r.preConstructMethods=[]),r.preConstructMethods.push(t)}function H(e,t,i){const r=X(e.constructor);r.postConstructMethods||(r.postConstructMethods=[]),r.postConstructMethods.push(t)}function j(e,t,i){const r=X(e.constructor);r.preDestroyMethods||(r.preDestroyMethods=[]),r.preDestroyMethods.push(t)}function W(e){return t=>{X(t).beanName=e}}function U(e){return(t,i,r)=>{K(t,e,!1,t,i,null)}}function z(e){return(t,i,r)=>{K(t,e,!0,t,i,null)}}function K(e,t,i,r,o,n){if(null===t)return void console.error("AG Grid: Autowired name should not be null");if("number"==typeof n)return void console.error("AG Grid: Autowired should be on an attribute");const s=X(e.constructor);s.agClassAttributes||(s.agClassAttributes=[]),s.agClassAttributes.push({attributeName:o,beanName:t,optional:i})}function Y(e){return(t,i,r)=>{const o="function"==typeof t?t:t.constructor;let n;if("number"==typeof r){let t;i?(n=X(o),t=i):(n=X(o),t="agConstructor"),n.autowireMethods||(n.autowireMethods={}),n.autowireMethods[t]||(n.autowireMethods[t]={}),n.autowireMethods[t][r]=e}}}function X(e){return e.hasOwnProperty("__agBeanMetaData")||(e.__agBeanMetaData={}),e.__agBeanMetaData}var $=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s},q=function(e,t){return function(i,r){t(i,r,e)}};let Z=class{constructor(){this.allSyncListeners=new Map,this.allAsyncListeners=new Map,this.globalSyncListeners=new Set,this.globalAsyncListeners=new Set,this.asyncFunctionsQueue=[],this.scheduled=!1,this.firedEvents={}}setBeans(e,t,i,r=null,o=null){if(this.frameworkOverrides=i,this.gridOptionsService=t,r){const e=t.useAsyncEvents();this.addGlobalListener(r,e)}o&&this.addGlobalListener(o,!1)}getListeners(e,t,i){const r=t?this.allAsyncListeners:this.allSyncListeners;let o=r.get(e);return!o&&i&&(o=new Set,r.set(e,o)),o}noRegisteredListenersExist(){return 0===this.allSyncListeners.size&&0===this.allAsyncListeners.size&&0===this.globalSyncListeners.size&&0===this.globalAsyncListeners.size}addEventListener(e,t,i=!1){this.getListeners(e,i,!0).add(t)}removeEventListener(e,t,i=!1){const r=this.getListeners(e,i,!1);if(r&&(r.delete(t),0===r.size)){(i?this.allAsyncListeners:this.allSyncListeners).delete(e)}}addGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).add(e)}removeGlobalListener(e,t=!1){(t?this.globalAsyncListeners:this.globalSyncListeners).delete(e)}dispatchEvent(e){let t=e;if(this.gridOptionsService){const{api:e,columnApi:i,context:r}=this.gridOptionsService;t.api=e,t.columnApi=i,t.context=r}this.dispatchToListeners(t,!0),this.dispatchToListeners(t,!1),this.firedEvents[t.type]=!0}dispatchEventOnce(e){this.firedEvents[e.type]||this.dispatchEvent(e)}dispatchToListeners(e,t){const i=e.type;if(t&&"event"in e){const t=e.event;t instanceof Event&&(e.eventPath=t.composedPath())}const r=i=>i.forEach(i=>{t?this.dispatchAsync(()=>i(e)):i(e)}),o=new Set(this.getListeners(i,t,!1));o.size>0&&r(o);new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(r=>{t?this.dispatchAsync(()=>this.frameworkOverrides.dispatchEvent(i,()=>r(i,e),!0)):this.frameworkOverrides.dispatchEvent(i,()=>r(i,e),!0)})}dispatchAsync(e){this.asyncFunctionsQueue.push(e),this.scheduled||(window.setTimeout(this.flushAsyncQueue.bind(this),0),this.scheduled=!0)}flushAsyncQueue(){this.scheduled=!1;const e=this.asyncFunctionsQueue.slice();this.asyncFunctionsQueue=[],e.forEach(e=>e())}};$([q(0,Y("loggerFactory")),q(1,Y("gridOptionsService")),q(2,Y("frameworkOverrides")),q(3,Y("globalEventListener")),q(4,Y("globalSyncEventListener"))],Z.prototype,"setBeans",null),Z=$([W("eventService")],Z);var J=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};let Q=0;function ee(){return Q++}class te{constructor(e,t,i,r){this.instanceId=ee(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.eventService=new Z,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=r,this.setState(e)}getInstanceId(){return this.instanceId}setState(e){void 0!==e.sort?"asc"!==e.sort&&"desc"!==e.sort||(this.sort=e.sort):"asc"!==e.initialSort&&"desc"!==e.initialSort||(this.sort=e.initialSort);const t=n(e.sortIndex),i=n(e.initialSortIndex);void 0!==t?null!==t&&(this.sortIndex=t):null!==i&&(this.sortIndex=i);const r=s(e.hide),o=s(e.initialHide);this.visible=void 0!==r?!r:!o,void 0!==e.pinned?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const a=n(e.flex),l=n(e.initialFlex);void 0!==a?this.flex=a:void 0!==l&&(this.flex=l)}setColDef(e,t){this.colDef=e,this.userProvidedColDef=t,this.initMinAndMaxWidths(),this.initDotNotation(),this.eventService.dispatchEvent(this.createColumnEvent("colDefChanged","api"))}getUserProvidedColDef(){return this.userProvidedColDef}setParent(e){this.parent=e}getParent(){return this.parent}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}initialise(){this.initMinAndMaxWidths(),this.resetActualWidth("gridInitializing"),this.initDotNotation(),this.initTooltip(),this.validate()}initDotNotation(){const e=this.gridOptionsService.is("suppressFieldDotNotation");this.fieldContainsDots=t(this.colDef.field)&&this.colDef.field.indexOf(".")>=0&&!e,this.tooltipFieldContainsDots=t(this.colDef.tooltipField)&&this.colDef.tooltipField.indexOf(".")>=0&&!e}initMinAndMaxWidths(){const e=this.colDef;this.minWidth=this.columnUtils.calculateColMinWidth(e),this.maxWidth=this.columnUtils.calculateColMaxWidth(e)}initTooltip(){this.tooltipEnabled=t(this.colDef.tooltipField)||t(this.colDef.tooltipValueGetter)||t(this.colDef.tooltipComponent)}resetActualWidth(e="api"){const t=this.columnUtils.calculateColInitialWidth(this.colDef);this.setActualWidth(t,e,!0)}isEmptyGroup(){return!1}isRowGroupDisplayed(e){if(i(this.colDef)||i(this.colDef.showRowGroup))return!1;const t=!0===this.colDef.showRowGroup,r=this.colDef.showRowGroup===e;return t||r}isPrimary(){return this.primary}isFilterAllowed(){return!!this.colDef.filter}isFieldContainsDots(){return this.fieldContainsDots}isTooltipEnabled(){return this.tooltipEnabled}isTooltipFieldContainsDots(){return this.tooltipFieldContainsDots}validate(){const e=this.colDef;function i(e,t,i){x(()=>{i?console.warn(e,i):x(()=>console.warn(e),t)},t)}if(this.gridOptionsService.isRowModelType("clientSide")&&!_.__isRegistered(G.RowGroupingModule,this.gridOptionsService.getGridId())){const i=["enableRowGroup","rowGroup","rowGroupIndex","enablePivot","enableValue","pivot","pivotIndex","aggFunc"].filter(i=>t(e[i]));i.length>0&&_.__assertRegistered(G.RowGroupingModule,i.map(e=>"colDef."+e).join(", "),this.gridOptionsService.getGridId())}if("agRichSelect"!==this.colDef.cellEditor&&"agRichSelectCellEditor"!==this.colDef.cellEditor||_.__assertRegistered(G.RichSelectModule,this.colDef.cellEditor,this.gridOptionsService.getGridId()),this.gridOptionsService.is("treeData")){const r=["rowGroup","rowGroupIndex","pivot","pivotIndex"].filter(i=>t(e[i]));r.length>0&&i(`AG Grid: ${r.join()} is not possible when doing tree data, your column definition should not have ${r.join()}`,"TreeDataCannotRowGroup")}if(t(e.menuTabs))if(Array.isArray(e.menuTabs)){const t=["filterMenuTab"],r=["columnsMenuTab","generalMenuTab"],o=r.filter(t=>e.menuTabs.includes(t));o.length>0&&_.__assertRegistered(G.MenuModule,"menuTab(s): "+o.map(e=>`'${e}'`).join(),this.gridOptionsService.getGridId()),e.menuTabs.forEach(e=>{r.includes(e)||t.includes(e)||i(`AG Grid: '${e}' is not valid for 'colDef.menuTabs'. Valid values are: ${[...t,...r].map(e=>`'${e}'`).join()}.`,"wrongValue_menuTabs_"+e)})}else i("AG Grid: The typeof 'colDef.menuTabs' should be an array not:"+typeof e.menuTabs,"wrongType_menuTabs");t(e.columnsMenuParams)&&_.__assertRegistered(G.MenuModule,"columnsMenuParams",this.gridOptionsService.getGridId()),t(e.columnsMenuParams)&&_.__assertRegistered(G.ColumnsToolPanelModule,"columnsMenuParams",this.gridOptionsService.getGridId()),t(this.colDef.width)&&"number"!=typeof this.colDef.width&&i("AG Grid: colDef.width should be a number, not "+typeof this.colDef.width,"ColumnCheck"),t(e.columnGroupShow)&&"closed"!==e.columnGroupShow&&"open"!==e.columnGroupShow&&i(`AG Grid: '${e.columnGroupShow}' is not valid for columnGroupShow. Valid values are 'open', 'closed', undefined, null`,"columnGroupShow_invalid")}addEventListener(e,t){this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService.removeEventListener(e,t)}createColumnFunctionCallbackParams(e){return{node:e,data:e.data,column:this,colDef:this.colDef,context:this.gridOptionsService.context,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi}}isSuppressNavigable(e){if("boolean"==typeof this.colDef.suppressNavigable)return this.colDef.suppressNavigable;if("function"==typeof this.colDef.suppressNavigable){const t=this.createColumnFunctionCallbackParams(e);return(0,this.colDef.suppressNavigable)(t)}return!1}isCellEditable(e){return!(e.group&&!this.gridOptionsService.is("enableGroupEdit"))&&this.isColumnFunc(e,this.colDef.editable)}isSuppressFillHandle(){return!!s(this.colDef.suppressFillHandle)}isAutoHeight(){return!!s(this.colDef.autoHeight)}isAutoHeaderHeight(){return!!s(this.colDef.autoHeaderHeight)}isRowDrag(e){return this.isColumnFunc(e,this.colDef.rowDrag)}isDndSource(e){return this.isColumnFunc(e,this.colDef.dndSource)}isCellCheckboxSelection(e){return this.isColumnFunc(e,this.colDef.checkboxSelection)}isSuppressPaste(e){return this.isColumnFunc(e,this.colDef?this.colDef.suppressPaste:null)}isResizable(){return!!s(this.colDef.resizable)}isColumnFunc(e,t){if("boolean"==typeof t)return t;if("function"==typeof t){return t(this.createColumnFunctionCallbackParams(e))}return!1}setMoving(e,t="api"){this.moving=e,this.eventService.dispatchEvent(this.createColumnEvent("movingChanged",t))}createColumnEvent(e,t){return{type:e,column:this,columns:[this],source:t,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context}}isMoving(){return this.moving}getSort(){return this.sort}setSort(e,t="api"){this.sort!==e&&(this.sort=e,this.eventService.dispatchEvent(this.createColumnEvent("sortChanged",t))),this.dispatchStateUpdatedEvent("sort")}setMenuVisible(e,t="api"){this.menuVisible!==e&&(this.menuVisible=e,this.eventService.dispatchEvent(this.createColumnEvent("menuVisibleChanged",t)))}isMenuVisible(){return this.menuVisible}isSortAscending(){return"asc"===this.sort}isSortDescending(){return"desc"===this.sort}isSortNone(){return i(this.sort)}isSorting(){return t(this.sort)}getSortIndex(){return this.sortIndex}setSortIndex(e){this.sortIndex=e,this.dispatchStateUpdatedEvent("sortIndex")}setAggFunc(e){this.aggFunc=e,this.dispatchStateUpdatedEvent("aggFunc")}getAggFunc(){return this.aggFunc}getLeft(){return this.left}getOldLeft(){return this.oldLeft}getRight(){return this.left+this.actualWidth}setLeft(e,t="api"){this.oldLeft=this.left,this.left!==e&&(this.left=e,this.eventService.dispatchEvent(this.createColumnEvent("leftChanged",t)))}isFilterActive(){return this.filterActive}setFilterActive(e,t="api",i){this.filterActive!==e&&(this.filterActive=e,this.eventService.dispatchEvent(this.createColumnEvent("filterActiveChanged",t)));const r=this.createColumnEvent("filterChanged",t);i&&y(r,i),this.eventService.dispatchEvent(r)}isHovered(){return this.columnHoverService.isHovered(this)}setPinned(e){this.pinned=!0===e||"left"===e?"left":"right"===e?"right":null,this.dispatchStateUpdatedEvent("pinned")}setFirstRightPinned(e,t="api"){this.firstRightPinned!==e&&(this.firstRightPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("firstRightPinnedChanged",t)))}setLastLeftPinned(e,t="api"){this.lastLeftPinned!==e&&(this.lastLeftPinned=e,this.eventService.dispatchEvent(this.createColumnEvent("lastLeftPinnedChanged",t)))}isFirstRightPinned(){return this.firstRightPinned}isLastLeftPinned(){return this.lastLeftPinned}isPinned(){return"left"===this.pinned||"right"===this.pinned}isPinnedLeft(){return"left"===this.pinned}isPinnedRight(){return"right"===this.pinned}getPinned(){return this.pinned}setVisible(e,t="api"){const i=!0===e;this.visible!==i&&(this.visible=i,this.eventService.dispatchEvent(this.createColumnEvent("visibleChanged",t))),this.dispatchStateUpdatedEvent("hide")}isVisible(){return this.visible}isSpanHeaderHeight(){const e=this.getColDef();return!e.suppressSpanHeaderHeight&&!e.autoHeaderHeight}getColDef(){return this.colDef}getColumnGroupShow(){return this.colDef.columnGroupShow}getColId(){return this.colId}getId(){return this.colId}getUniqueId(){return this.colId}getDefinition(){return this.colDef}getActualWidth(){return this.actualWidth}getAutoHeaderHeight(){return this.autoHeaderHeight}setAutoHeaderHeight(e){const t=e!==this.autoHeaderHeight;return this.autoHeaderHeight=e,t}createBaseColDefParams(e){return{node:e,data:e.data,colDef:this.colDef,column:this,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context}}getColSpan(e){if(i(this.colDef.colSpan))return 1;const t=this.createBaseColDefParams(e),r=this.colDef.colSpan(t);return Math.max(r,1)}getRowSpan(e){if(i(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),r=this.colDef.rowSpan(t);return Math.max(r,1)}setActualWidth(e,t="api",i=!1){null!=this.minWidth&&(e=Math.max(e,this.minWidth)),null!=this.maxWidth&&(e=Math.min(e,this.maxWidth)),this.actualWidth!==e&&(this.actualWidth=e,this.flex&&"flex"!==t&&"gridInitializing"!==t&&(this.flex=null),i||this.fireColumnWidthChangedEvent(t)),this.dispatchStateUpdatedEvent("width")}fireColumnWidthChangedEvent(e){this.eventService.dispatchEvent(this.createColumnEvent("widthChanged",e))}isGreaterThanMax(e){return null!=this.maxWidth&&e>this.maxWidth}getMinWidth(){return this.minWidth}getMaxWidth(){return this.maxWidth}getFlex(){return this.flex||0}setFlex(e){this.flex!==e&&(this.flex=e),this.dispatchStateUpdatedEvent("flex")}setMinimum(e="api"){t(this.minWidth)&&this.setActualWidth(this.minWidth,e)}setRowGroupActive(e,t="api"){this.rowGroupActive!==e&&(this.rowGroupActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnRowGroupChanged",t))),this.dispatchStateUpdatedEvent("rowGroup")}isRowGroupActive(){return this.rowGroupActive}setPivotActive(e,t="api"){this.pivotActive!==e&&(this.pivotActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnPivotChanged",t))),this.dispatchStateUpdatedEvent("pivot")}isPivotActive(){return this.pivotActive}isAnyFunctionActive(){return this.isPivotActive()||this.isRowGroupActive()||this.isValueActive()}isAnyFunctionAllowed(){return this.isAllowPivot()||this.isAllowRowGroup()||this.isAllowValue()}setValueActive(e,t="api"){this.aggregationActive!==e&&(this.aggregationActive=e,this.eventService.dispatchEvent(this.createColumnEvent("columnValueChanged",t)))}isValueActive(){return this.aggregationActive}isAllowPivot(){return!0===this.colDef.enablePivot}isAllowValue(){return!0===this.colDef.enableValue}isAllowRowGroup(){return!0===this.colDef.enableRowGroup}getMenuTabs(e){let t=this.getColDef().menuTabs;return null==t&&(t=e),t}dispatchStateUpdatedEvent(e){this.eventService.dispatchEvent({type:te.EVENT_STATE_UPDATED,key:e})}}te.EVENT_MOVING_CHANGED="movingChanged",te.EVENT_LEFT_CHANGED="leftChanged",te.EVENT_WIDTH_CHANGED="widthChanged",te.EVENT_LAST_LEFT_PINNED_CHANGED="lastLeftPinnedChanged",te.EVENT_FIRST_RIGHT_PINNED_CHANGED="firstRightPinnedChanged",te.EVENT_VISIBLE_CHANGED="visibleChanged",te.EVENT_FILTER_CHANGED="filterChanged",te.EVENT_FILTER_ACTIVE_CHANGED="filterActiveChanged",te.EVENT_SORT_CHANGED="sortChanged",te.EVENT_COL_DEF_CHANGED="colDefChanged",te.EVENT_MENU_VISIBLE_CHANGED="menuVisibleChanged",te.EVENT_ROW_GROUP_CHANGED="columnRowGroupChanged",te.EVENT_PIVOT_CHANGED="columnPivotChanged",te.EVENT_VALUE_CHANGED="columnValueChanged",te.EVENT_STATE_UPDATED="columnStateUpdated",J([U("gridOptionsService")],te.prototype,"gridOptionsService",void 0),J([U("columnUtils")],te.prototype,"columnUtils",void 0),J([U("columnHoverService")],te.prototype,"columnHoverService",void 0),J([H],te.prototype,"initialise",null);var ie=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class re{constructor(e,t,i,r){this.localEventService=new Z,this.expandable=!1,this.instanceId=ee(),this.expandableListenerRemoveCallback=null,this.colGroupDef=e,this.groupId=t,this.expanded=!!e&&!!e.openByDefault,this.padding=i,this.level=r}destroy(){this.expandableListenerRemoveCallback&&this.reset(null,void 0)}reset(e,t){this.colGroupDef=e,this.level=t,this.originalParent=null,this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback(),this.children=void 0,this.expandable=void 0}getInstanceId(){return this.instanceId}setOriginalParent(e){this.originalParent=e}getOriginalParent(){return this.originalParent}getLevel(){return this.level}isVisible(){return!!this.children&&this.children.some(e=>e.isVisible())}isPadding(){return this.padding}setExpanded(e){this.expanded=void 0!==e&&e;const t={type:re.EVENT_EXPANDED_CHANGED};this.localEventService.dispatchEvent(t)}isExpandable(){return this.expandable}isExpanded(){return this.expanded}getGroupId(){return this.groupId}getId(){return this.getGroupId()}setChildren(e){this.children=e}getChildren(){return this.children}getColGroupDef(){return this.colGroupDef}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}addLeafColumns(e){this.children&&this.children.forEach(t=>{t instanceof te?e.push(t):t instanceof re&&t.addLeafColumns(e)})}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach(t=>t.addEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach(t=>t.removeEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,i=!1;const r=this.findChildrenRemovingPadding();for(let o=0,n=r.length;o<n;o++){const n=r[o];if(!n.isVisible())continue;const s=n.getColumnGroupShow();"open"===s?(e=!0,i=!0):"closed"===s?(t=!0,i=!0):(e=!0,t=!0)}const o=e&&t&&i;if(this.expandable!==o){this.expandable=o;const e={type:re.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(e)}}findChildrenRemovingPadding(){const e=[],t=i=>{i.forEach(i=>{i instanceof re&&i.isPadding()?t(i.children):e.push(i)})};return t(this.children),e}onColumnVisibilityChanged(){this.setExpandable()}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}}re.EVENT_EXPANDED_CHANGED="expandedChanged",re.EVENT_EXPANDABLE_CHANGED="expandableChanged",ie([j],re.prototype,"destroy",null);const oe={numericColumn:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"},rightAligned:{headerClass:"ag-right-aligned-header",cellClass:"ag-right-aligned-cell"}};function ne(...e){for(let i=0;i<e.length;i++){const r=e[i];if(t(r))return r}return null}function se(e){if(e&&e.length)return e[e.length-1]}function ae(e,t,i){return null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every((e,r)=>i?i(e,t[r]):t[r]===e)}function le(e){return e.sort((e,t)=>e-t)}function de(e,t){const i=e.indexOf(t);i>=0&&(e[i]=e[e.length-1],e.pop())}function ce(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function he(e,t){for(let i=0;i<t.length;i++)de(e,t[i])}function ue(e,t){for(let i=0;i<t.length;i++)ce(e,t[i])}function pe(e,t,i){e.splice(i,0,t)}function ge(e,t,i){ue(e,t),t.slice().reverse().forEach(t=>pe(e,t,i))}function fe(e,t){return e.indexOf(t)>-1}function ve(e){return[].concat.apply([],e)}function me(e,t){null!=t&&null!=e&&t.forEach(t=>e.push(t))}var ye=Object.freeze({__proto__:null,firstExistingValue:ne,existsAndNotEmpty:function(e){return null!=e&&e.length>0},last:se,areEqual:ae,shallowCompare:function(e,t){return ae(e,t)},sortNumerically:le,removeRepeatsFromArray:function(e,t){if(e)for(let i=e.length-2;i>=0;i--){const r=e[i]===t,o=e[i+1]===t;r&&o&&e.splice(i+1,1)}},removeFromUnorderedArray:de,removeFromArray:ce,removeAllFromUnorderedArray:he,removeAllFromArray:ue,insertIntoArray:pe,insertArrayIntoArray:function(e,t,i){if(null!=e&&null!=t)for(let r=t.length-1;r>=0;r--){pe(e,t[r],i)}},moveInArray:ge,includes:fe,flatten:ve,pushAll:me,toStrings:function(e){return e.map(o)},forEachReverse:function(e,t){if(null!=e)for(let i=e.length-1;i>=0;i--)t(e[i],i)}});const Ce=["touchstart","touchend","touchmove","touchcancel","scroll"],Se={};function we(e){e.__ag_Grid_Stop_Propagation=!0}function be(e){return!0===e.__ag_Grid_Stop_Propagation}const Ee=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if("boolean"==typeof Se[t])return Se[t];const i=document.createElement(e[t]||"div");return Se[t="on"+t]=t in i}})();function xe(e,t,i){let r=t;for(;r;){const t=e.getDomData(r,i);if(t)return t;r=r.parentElement}return null}function Re(e,t){return!(!t||!e)&&De(t).indexOf(e)>=0}function Te(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function De(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():Te(t)}function Oe(e,t,i,r){const o=fe(Ce,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,r,o)}var Pe=Object.freeze({__proto__:null,stopPropagationForAgGrid:we,isStopPropagationForAgGrid:be,isEventSupported:Ee,getCtrlForEventTarget:xe,isElementInEventPath:Re,createEventPath:Te,getEventPath:De,addSafePassiveEventListener:Oe}),Ae=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class Me{constructor(){this.destroyFunctions=[],this.destroyed=!1,this.__v_skip=!0,this.lastChangeSetIdLookup={},this.propertyListenerId=0,this.isAlive=()=>!this.destroyed}getFrameworkOverrides(){return this.frameworkOverrides}getContext(){return this.context}destroy(){this.destroyFunctions.forEach(e=>e()),this.destroyFunctions.length=0,this.destroyed=!0,this.dispatchEvent({type:Me.EVENT_DESTROYED})}addEventListener(e,t){this.localEventService||(this.localEventService=new Z),this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService&&this.localEventService.removeEventListener(e,t)}dispatchEventAsync(e){window.setTimeout(()=>this.dispatchEvent(e),0)}dispatchEvent(e){this.localEventService&&this.localEventService.dispatchEvent(e)}addManagedListener(e,t,i){if(this.destroyed)return;e instanceof HTMLElement?Oe(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const r=()=>(e.removeEventListener(t,i),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==r),null);return this.destroyFunctions.push(r),r}setupGridOptionListener(e,t){this.gridOptionsService.addEventListener(e,t);const i=()=>(this.gridOptionsService.removeEventListener(e,t),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==i),null);this.destroyFunctions.push(i)}addManagedPropertyListener(e,t){this.destroyed||this.setupGridOptionListener(e,t)}addManagedPropertyListeners(e,t){if(this.destroyed)return;const i=e.join("-")+this.propertyListenerId++,r=e=>{if(e.changeSet){if(e.changeSet&&e.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=e.changeSet.id}const r={type:"gridPropertyChanged",changeSet:e.changeSet};t(r)};e.forEach(e=>this.setupGridOptionListener(e,r))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.getContext()).createBean(e,i)}destroyBean(e,t){return(t||this.getContext()).destroyBean(e)}destroyBeans(e,t){return e&&e.forEach(e=>this.destroyBean(e,t)),[]}}Me.EVENT_DESTROYED="destroyed",Ae([U("frameworkOverrides")],Me.prototype,"frameworkOverrides",void 0),Ae([U("context")],Me.prototype,"context",void 0),Ae([U("eventService")],Me.prototype,"eventService",void 0),Ae([U("gridOptionsService")],Me.prototype,"gridOptionsService",void 0),Ae([U("localeService")],Me.prototype,"localeService",void 0),Ae([U("environment")],Me.prototype,"environment",void 0),Ae([j],Me.prototype,"destroy",null);var Fe=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s},Le=function(e,t){return function(i,r){t(i,r,e)}};let Ie=class extends Me{setBeans(e){this.logger=e.create("ColumnFactory")}createColumnTree(e,t,i){const r=new d,{existingCols:o,existingGroups:n,existingColKeys:s}=this.extractExistingTreeData(i);r.addExistingKeys(s);const a=this.recursivelyCreateColumns(e,0,t,o,r,n),l=this.findMaxDept(a,0);this.logger.log("Number of levels for grouped columns is "+l);const c=this.balanceColumnTree(a,0,l,r);return this.columnUtils.depthFirstOriginalTreeSearch(null,c,(e,t)=>{e instanceof re&&e.setupExpandable(),e.setOriginalParent(t)}),{columnTree:c,treeDept:l}}extractExistingTreeData(e){const t=[],i=[],r=[];return e&&this.columnUtils.depthFirstOriginalTreeSearch(null,e,e=>{if(e instanceof re){const t=e;i.push(t)}else{const i=e;r.push(i.getId()),t.push(i)}}),{existingCols:t,existingGroups:i,existingColKeys:r}}createForAutoGroups(e,t){return e.map(e=>this.createAutoGroupTreeItem(t,e))}createAutoGroupTreeItem(e,t){const i=this.findDepth(e);let r=t;for(let e=i-1;e>=0;e--){const i=new re(null,`FAKE_PATH_${t.getId()}}_${e}`,!0,e);this.createBean(i),i.setChildren([r]),r.setOriginalParent(i),r=i}return 0===i&&t.setOriginalParent(null),r}findDepth(e){let t=0,i=e;for(;i&&i[0]&&i[0]instanceof re;)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,r){const o=[];for(let n=0;n<e.length;n++){const s=e[n];if(s instanceof re){const e=s,n=this.balanceColumnTree(e.getChildren(),t+1,i,r);e.setChildren(n),o.push(e)}else{let n,a;for(let e=i-1;e>=t;e--){const e=r.getUniqueKey(null,null),i=this.createMergedColGroupDef(null),o=new re(i,e,!0,t);this.createBean(o),a&&a.setChildren([o]),a=o,n||(n=a)}if(n&&a){o.push(n);if(e.some(e=>e instanceof re)){a.setChildren([s]);continue}a.setChildren(e);break}o.push(s)}}return o}findMaxDept(e,t){let i=t;for(let r=0;r<e.length;r++){const o=e[r];if(o instanceof re){const e=o,r=this.findMaxDept(e.getChildren(),t+1);i<r&&(i=r)}}return i}recursivelyCreateColumns(e,t,i,r,o,n){if(!e)return[];const s=new Array(e.length);for(let a=0;a<s.length;a++){const l=e[a];this.isColumnGroup(l)?s[a]=this.createColumnGroup(i,l,t,r,o,n):s[a]=this.createColumn(i,l,r,o)}return s}createColumnGroup(e,t,i,r,o,n){const s=this.createMergedColGroupDef(t),a=o.getUniqueKey(s.groupId||null,null),l=new re(s,a,!1,i);this.createBean(l);const d=this.findExistingGroup(t,n);d&&n.splice(d.idx,1);let c=null==d?void 0:d.group;c&&l.setExpanded(c.isExpanded());const h=this.recursivelyCreateColumns(s.children,i+1,e,r,o,n);return l.setChildren(h),l}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gridOptionsService.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,r){const o=this.findExistingColumn(t,i);o&&(null==i||i.splice(o.idx,1));let n=null==o?void 0:o.column;if(n){const e=this.addColumnDefaultAndTypes(t,n.getColId());n.setColDef(e,t),this.applyColumnState(n,e)}else{const i=r.getUniqueKey(t.colId,t.field),o=this.addColumnDefaultAndTypes(t,i);n=new te(o,t,i,e),this.context.createBean(n)}return this.dataTypeService.addColumnListeners(n),n}applyColumnState(e,t){const i=n(t.flex);void 0!==i&&e.setFlex(i);if(e.getFlex()<=0){const i=n(t.width);if(null!=i)e.setActualWidth(i);else{const t=e.getActualWidth();e.setActualWidth(t)}}void 0!==t.sort&&("asc"==t.sort||"desc"==t.sort?e.setSort(t.sort):e.setSort(void 0));const r=n(t.sortIndex);void 0!==r&&e.setSortIndex(r);const o=s(t.hide);void 0!==o&&e.setVisible(!o),void 0!==t.pinned&&e.setPinned(t.pinned)}findExistingColumn(e,t){if(t)for(let i=0;i<t.length;i++){const r=t[i].getUserProvidedColDef();if(!r)continue;if(null!=e.colId){if(t[i].getId()===e.colId)return{idx:i,column:t[i]};continue}if(null!=e.field){if(r.field===e.field)return{idx:i,column:t[i]}}else if(r===e)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(null!=e.groupId)for(let i=0;i<t.length;i++){const r=t[i];if(r.getColGroupDef()&&r.getId()===e.groupId)return{idx:i,group:r}}}addColumnDefaultAndTypes(e,t){const i={};y(i,this.gridOptionsService.get("defaultColDef"),!1,!0);const r=this.dataTypeService.updateColDefAndGetColumnType(i,e,t);r&&this.assignColumnTypes(r,i),y(i,e,!1,!0);const o=this.gridOptionsService.get("autoGroupColumnDef"),n=this.gridOptionsService.isColumnsSortingCoupledToGroup();return e.rowGroup&&o&&n&&y(i,{sort:o.sort,initialSort:o.initialSort},!1,!0),this.dataTypeService.validateColDef(i),i}assignColumnTypes(e,t){if(!e.length)return;const i=Object.assign({},oe);c(this.gridOptionsService.get("columnTypes")||{},(e,t)=>{e in i?console.warn(`AG Grid: the column type '${e}' is a default column type and cannot be overridden.`):i[e]=t}),e.forEach(e=>{const r=i[e.trim()];r?y(t,r,!1,!0):console.warn("AG Grid: colDef.type '"+e+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return void 0!==e.children}};Fe([U("columnUtils")],Ie.prototype,"columnUtils",void 0),Fe([U("dataTypeService")],Ie.prototype,"dataTypeService",void 0),Fe([Le(0,Y("loggerFactory"))],Ie.prototype,"setBeans",null),Ie=Fe([W("columnFactory")],Ie);var Ne=function(e,t,i,r){var o,n=arguments.length,s=n<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,i):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)s=Reflect.decorate(e,t,i,r);else for(var a=e.length-1;a>=0;a--)(o=e[a])&&(s=(n<3?o(s):n>3?o(t,i,s):o(t,i))||s);return n>3&&s&&Object.defineProperty(t,i,s),s};class Ge{constructor(e,t,i,r){this.displayedChildren=[],this.localEventService=new Z,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=r}static createUniqueId(e,t){return e+"_"+t}reset(){this.parent=null,this.children=null,this.displayedChildren=null}getParent(){return this.parent}setParent(e){this.parent=e}getUniqueId(){return Ge.createUniqueId(this.groupId,this.partId)}isEmptyGroup(){return 0===this.displayedChildren.length}isMoving(){const e=this.getProvidedColumnGroup().getLeafColumns();return!(!e||0===e.length)&&e.every(e=>e.isMoving())}checkLeft(){if(this.displayedChildren.forEach(e=>{e instanceof Ge&&e.checkLeft()}),this.displayedChildren.length>0)if(this.gridOptionsService.is("enableRtl")){const e=se(this.displayedChildren).getLeft();this.setLeft(e)}else{const e=this.displayedChildren[0].getLeft();this.setLeft(e)}else this.setLeft(null)}getLeft(){return this.left}getOldLeft(){return this.oldLeft}setLeft(e){this.oldLeft=e,this.left!==e&&(this.left=e,this.localEventService.dispatchEvent(this.createAgEvent(Ge.EVENT_LEFT_CHANGED)))}getPinned(){return this.pinned}createAgEvent(e){return{type:e}}addEventListener(e,t){this.localEventService.addEventListener(e,t)}removeEventListener(e,t){this.localEventService.removeEventListener(e,t)}getGroupId(){return this.groupId}getPartId(){return this.partId}isChildInThisGroupDeepSearch(e){let t=!1;return this.children.forEach(i=>{e===i&&(t=!0),i instanceof Ge&&i.isChildInThisGroupDeepSearch(e)&&(t=!0)}),t}getActualWidth(){let e=0;return this.displayedChildren&&this.displayedChildren.forEach(t=>{e+=t.getActualWidth()}),e}isResizable(){if(!this.displayedChildren)return!1;let e=!1;return this.displayedChildren.forEach(t=>{t.isResizable()&&(e=!0)}),e}getMinWidth(){let e=0;return this.displayedChildren.forEach(t=>{e+=t.getMinWidth()||0}),e}addChild(e){this.children||(this.children=[]),this.children.push(e)}getDisplayedChildren(){return this.displayedChildren}getLeafColumns(){const e=[];return this.addLeafColumns(e),e}getDisplayedLeafColumns(){const e=[];return this.addDisplayedLeafColumns(e),e}getDefinition(){return this.providedColumnGroup.getColGroupDef()}getColGroupDef(){return this.providedColumnGroup.getColGroupDef()}isPadding(){return this.providedColumnGroup.isPadding()}isExpandable(){return this.providedColumnGroup.isExpandable()}isExpanded(){return this.providedColumnGroup.isExpanded()}setExpanded(e){this.providedColumnGroup.setExpanded(e)}addDisplayedLeafColumns(e){this.displayedChildren.forEach(t=>{t instanceof te?e.push(t):t instanceof Ge&&t.addDisplayedLeafColumns(e)})}addLeafColumns(e){this.children.forEach(t=>{t instanceof te?e.push(t):t instanceof Ge&&t.addLeafColumns(e)})}getChildren(){return this.children}getColumnGroupShow(){return this.providedColumnGroup.getColumnGroupShow()}getProvidedColumnGroup(){return this.providedColumnGroup}getPaddingLevel(){const e=this.getParent();return this.isPadding()&&e&&e.isPadding()?1+e.getPaddingLevel():0}calculateDisplayedColumns(){this.displayedChildren=[];let e=this;for(;null!=e&&e.isPadding();)e=e.getParent();if(!(!!e&&e.providedColumnGroup.isExpandable()))return this.displayedChildren=this.children,void this.localEventService.dispatchEvent(this.createAgEvent(Ge.EVENT_DISPLAYED_CHILDREN_CHANGED));this.children.forEach(t=>{if(t instanceof Ge&&(!t.displayedChildren||!t.displayedChildren.length))return;switch(t.getColumnGroupShow()){case"open":e.providedColumnGroup.isExpanded()&&this.displayedChildren.push(t);break;case"closed":e.providedColumnGroup.isExpanded()||this.displayedChildren.push(t);break;default:this.displayedChildren.push(t)}}),this.localEventService.dispatchEvent(this.createAgEvent(Ge.EVENT_DISPLAYED_CHILDREN_CHANGED))}}Ge.EVENT_LEFT_CHANGED="leftChanged",Ge.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged",Ne([U("gridOptionsService")],Ge.prototype,"gridOptionsService",void 0);class ke{}ke.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged",ke.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded",ke.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged",ke.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",ke.EVENT_EXPAND_COLLAPSE_ALL="expandOrCollapseAll",ke.EVENT_COLUMN_PIVOT_CHANGED="columnPiv