UNPKG

ag-grid-community

Version:

Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue

18 lines 977 kB
/**
          * @ag-grid-community/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.2.1
          * @link https://www.ag-grid.com/
          * @license MIT
          */
/**
          * @ag-grid-community/all-modules - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue * @version v30.2.1
          * @link https://www.ag-grid.com/
          * @license MIT
          */
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 s(e){return null==e||0===e.length}function o(e){return null!=e&&"function"==typeof e.toString?e.toString():null}function r(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 n(e){if(void 0!==e)return null!==e&&""!==e&&("boolean"==typeof e?e:/true/i.test(e))}function l(e){if(e instanceof Set||e instanceof Map){const t=[];return e.forEach(e=>t.push(e)),t}return Object.values(e)}var a=Object.freeze({__proto__:null,makeNull:e,exists:t,missing:i,missingOrEmpty:s,toStringOrNull:o,attrToNumber:r,attrToBoolean:n,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 s=null==e,o=null==t;if(e&&e.toNumber&&(e=e.toNumber()),t&&t.toNumber&&(t=t.toNumber()),s&&o)return 0;if(s)return-1;if(o)return 1;function r(e,t){return e>t?1:e<t?-1:0}if("string"!=typeof e)return r(e,t);if(!i)return r(e,t);try{return e.localeCompare(t)}catch(i){return r(e,t)}},values:l});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 s;if(e?(s=e,0!==i&&(s+="_"+i)):t?(s=t,0!==i&&(s+="_"+i)):s=i,!this.existingKeys[s])return this.existingKeys[s]=!0,String(s);i++}}}function h(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,s]of Object.entries(e))t(i,s)}function c(e){const t={},i=Object.keys(e);for(let s=0;s<i.length;s++){const o=i[s],r=e[o];t[o]=r}return t}function u(e,t){if(!e)return;const i=e,s={};return Object.keys(i).forEach(e=>{if(t&&t.indexOf(e)>=0)return;const o=i[e],r=S(o)&&o.constructor===Object;s[e]=r?u(o):o}),s}function p(e,t){return e[t]}function g(e,t,i){e[t]=i}function m(e,t,i,s){const o=p(e,i);void 0!==o&&g(t,i,s?s(o):o)}function C(e){const t={};return e.filter(e=>null!=e).forEach(e=>{Object.keys(e).forEach(e=>t[e]=null)}),Object.keys(t)}function v(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 f(e,i,s=!0,o=!1){t(i)&&h(i,(t,i)=>{let r=e[t];if(r!==i){if(o){if(null==r&&null!=i){"object"==typeof i&&i.constructor===Object&&(r={},e[t]=r)}}S(i)&&S(r)&&!Array.isArray(r)?f(r,i,s,o):(s||void 0!==i)&&(e[t]=i)}})}function w(e,t,i){if(!t||!e)return;if(!i)return e[t];const s=t.split(".");let o=e;for(let e=0;e<s.length;e++){if(null==o)return;o=o[s[e]]}return o}function y(e,t){Object.keys(e).forEach(t=>{"object"==typeof e[t]&&(e[t]=void 0)});const i=Object.getPrototypeOf(e),s={};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.`)};s[e]={value:i,writable:!0}}}),Object.defineProperties(e,s)}function S(e){return"object"==typeof e&&null!==e}var E=Object.freeze({__proto__:null,iterateObject:h,cloneObject:c,deepCloneObject:function(e){return JSON.parse(JSON.stringify(e))},deepCloneDefinition:u,getProperty:p,setProperty:g,copyPropertiesIfPresent:function(e,t,...i){i.forEach(i=>m(e,t,i))},copyPropertyIfPresent:m,getAllKeysInObjects:C,getAllValuesInObject:v,mergeDeep:f,missingOrEmptyObject:function(e){return i(e)||0===Object.keys(e).length},get:function(e,t,i){if(null==e)return i;const s=t.split(".");let o=e;for(;s.length>1;)if(o=o[s.shift()],null==o)return i;const r=o[s[0]];return null!=r?r:i},set:function(e,t,i){if(null==e)return;const s=t.split(".");let o=e;s.forEach((e,t)=>{o[e]||(o[e]={}),t<s.length-1&&(o=o[e])}),o[s[s.length-1]]=i},getValueUsingField:w,removeAllReferences:y,isNonNullObject:S});const R={};function T(e,t){R[t]||(e(),R[t]=!0)}function b(e){if(e.name)return e.name;const t=/function\s+([^\(]+)/.exec(e.toString());return t&&2===t.length?t[1].trim():null}function D(e){return!!(e&&e.constructor&&e.call&&e.apply)}function O(e){L(e,400)}const P=[];let A=!1;function F(e){P.push(e),A||(A=!0,window.setTimeout(()=>{const e=P.slice();P.length=0,A=!1,e.forEach(e=>e())},0))}function L(e,t=0){e.length>0&&window.setTimeout(()=>e.forEach(e=>e()),t)}function I(e,t){let i;return function(...s){const o=this;window.clearTimeout(i),i=window.setTimeout((function(){e.apply(o,s)}),t)}}function N(e,t){let i=0;return function(...s){const o=(new Date).getTime();o-i<t||(i=o,e.apply(this,s))}}function M(e,t,i=100,s){const o=(new Date).getTime();let r=null,n=!1;const l=()=>{const l=(new Date).getTime()-o>i;(e()||l)&&(t(),n=!0,null!=r&&(window.clearInterval(r),r=null),l&&s&&console.warn(s))};l(),n||(r=window.setInterval(l,10))}function G(e){e&&e()}var x,_=Object.freeze({__proto__:null,doOnce:T,getFunctionName:b,isFunction:D,executeInAWhile:O,executeNextVMTurn:F,executeAfter:L,debounce:I,throttle:N,waitUntil:M,compose:function(...e){return t=>e.reduce((e,t)=>t(e),t)},callIfPresent:G,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"}(x||(x={}));class V{static register(e){V.__register(e,!0,void 0)}static registerModules(e){V.__registerModules(e,!0,void 0)}static __register(e,t,i){V.runVersionChecks(e),void 0!==i?(V.areGridScopedModules=!0,void 0===V.gridModulesMap[i]&&(V.gridModulesMap[i]={}),V.gridModulesMap[i][e.moduleName]=e):V.globalModulesMap[e.moduleName]=e,V.setModuleBased(t)}static __unRegisterGridModules(e){delete V.gridModulesMap[e]}static __registerModules(e,t,i){V.setModuleBased(t),e&&e.forEach(e=>V.__register(e,t,i))}static isValidModuleVersion(e){const[t,i]=e.version.split(".")||[],[s,o]=V.currentModuleVersion.split(".")||[];return t===s&&i===o}static runVersionChecks(e){if(V.currentModuleVersion||(V.currentModuleVersion=e.version),e.version?V.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===V.moduleBased?V.moduleBased=e:V.moduleBased!==e&&T(()=>{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(){V.isBundled=!0}static __assertRegistered(e,t,i){var s;if(this.__isRegistered(e,i))return!0;const o=t+e;let r;if(V.isBundled)r=`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(V.moduleBased||void 0===V.moduleBased){let o=null===(s=Object.entries(x).find(([t,i])=>i===e))||void 0===s?void 0:s[0];r=`AG Grid: unable to use ${t} as the ${o} is not registered${V.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 r=`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 T(()=>{console.warn(r)},o),!1}static __isRegistered(e,t){var i;return!!V.globalModulesMap[e]||!!(null===(i=V.gridModulesMap[t])||void 0===i?void 0:i[e])}static __getRegisteredModules(e){return[...l(V.globalModulesMap),...l(V.gridModulesMap[e]||{})]}static __getGridRegisteredModules(e){var t;return l(null!==(t=V.gridModulesMap[e])&&void 0!==t?t:{})||[]}static __isPackageBased(){return!V.moduleBased}}V.globalModulesMap={},V.gridModulesMap={},V.areGridScopedModules=!1;class H{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 l(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)),h(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 s=this.getBeansForParameters(i,t.bean.name),o=new(t.bean.bind.apply(t.bean,[null,...s]));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?b(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 s=t.agClassAttributes;s&&s.forEach(t=>{const s=this.lookupBeanInstance(i,t.beanName,t.optional);e[t.attributeName]=s})})})}methodWireBeans(e){e.forEach(e=>{this.forEachMetaDataInHierarchy(e,(t,i)=>{h(t.autowireMethods,(t,s)=>{if("agConstructor"===t)return;const o=this.getBeansForParameters(s,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&&h(e,(e,s)=>{const o=this.lookupBeanInstance(t,s);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 s=this.beanWrappers[t];return s?s.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 s={};this.forEachMetaDataInHierarchy(e,e=>{const o=e[t];o&&o.forEach(e=>{e!=i&&(s[e]=!0)})});Object.keys(s).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,V.__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 k(e,t,i){const s=$(e.constructor);s.preConstructMethods||(s.preConstructMethods=[]),s.preConstructMethods.push(t)}function B(e,t,i){const s=$(e.constructor);s.postConstructMethods||(s.postConstructMethods=[]),s.postConstructMethods.push(t)}function W(e,t,i){const s=$(e.constructor);s.preDestroyMethods||(s.preDestroyMethods=[]),s.preDestroyMethods.push(t)}function U(e){return t=>{$(t).beanName=e}}function j(e){return(t,i,s)=>{K(t,e,!1,t,i,null)}}function z(e){return(t,i,s)=>{K(t,e,!0,t,i,null)}}function K(e,t,i,s,o,r){if(null===t)return void console.error("AG Grid: Autowired name should not be null");if("number"==typeof r)return void console.error("AG Grid: Autowired should be on an attribute");const n=$(e.constructor);n.agClassAttributes||(n.agClassAttributes=[]),n.agClassAttributes.push({attributeName:o,beanName:t,optional:i})}function Y(e){return(t,i,s)=>{const o="function"==typeof t?t:t.constructor;let r;if("number"==typeof s){let t;i?(r=$(o),t=i):(r=$(o),t="agConstructor"),r.autowireMethods||(r.autowireMethods={}),r.autowireMethods[t]||(r.autowireMethods[t]={}),r.autowireMethods[t][s]=e}}}function $(e){return e.hasOwnProperty("__agBeanMetaData")||(e.__agBeanMetaData={}),e.__agBeanMetaData}var q=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},Q=function(e,t){return function(i,s){t(i,s,e)}};let X=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,s=null,o=null){if(this.frameworkOverrides=i,this.gridOptionsService=t,s){const e=t.useAsyncEvents();this.addGlobalListener(s,e)}o&&this.addGlobalListener(o,!1)}getListeners(e,t,i){const s=t?this.allAsyncListeners:this.allSyncListeners;let o=s.get(e);return!o&&i&&(o=new Set,s.set(e,o)),o}noRegisteredListenersExist(){return 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 s=this.getListeners(e,i,!1);if(s&&(s.delete(t),0===s.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:s}=this.gridOptionsService;t.api=e,t.columnApi=i,t.context=s}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 s=i=>i.forEach(i=>{t?this.dispatchAsync(()=>i(e)):i(e)}),o=new Set(this.getListeners(i,t,!1));o.size>0&&s(o);new Set(t?this.globalAsyncListeners:this.globalSyncListeners).forEach(s=>{t?this.dispatchAsync(()=>this.frameworkOverrides.dispatchEvent(i,()=>s(i,e),!0)):this.frameworkOverrides.dispatchEvent(i,()=>s(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([Q(0,Y("loggerFactory")),Q(1,Y("gridOptionsService")),Q(2,Y("frameworkOverrides")),Q(3,Y("globalEventListener")),Q(4,Y("globalSyncEventListener"))],X.prototype,"setBeans",null),X=q([U("eventService")],X);var J=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Z=0;function ee(){return Z++}class te{constructor(e,t,i,s){this.instanceId=ee(),this.autoHeaderHeight=null,this.moving=!1,this.menuVisible=!1,this.lastLeftPinned=!1,this.firstRightPinned=!1,this.filterActive=!1,this.eventService=new X,this.tooltipEnabled=!1,this.rowGroupActive=!1,this.pivotActive=!1,this.aggregationActive=!1,this.colDef=e,this.userProvidedColDef=t,this.colId=i,this.primary=s,this.setState(e)}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=r(e.sortIndex),i=r(e.initialSortIndex);void 0!==t?null!==t&&(this.sortIndex=t):null!==i&&(this.sortIndex=i);const s=n(e.hide),o=n(e.initialHide);this.visible=void 0!==s?!s:!o,void 0!==e.pinned?this.setPinned(e.pinned):this.setPinned(e.initialPinned);const l=r(e.flex),a=r(e.initialFlex);void 0!==l?this.flex=l:void 0!==a&&(this.flex=a)}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,s=this.colDef.showRowGroup===e;return t||s}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){T(()=>{i?console.warn(e,i):T(()=>console.warn(e),t)},t)}if(this.gridOptionsService.isRowModelType("clientSide")&&!V.__isRegistered(x.RowGroupingModule,this.gridOptionsService.getGridId())){const i=["enableRowGroup","rowGroup","rowGroupIndex","enablePivot","enableValue","pivot","pivotIndex","aggFunc"].filter(i=>t(e[i]));i.length>0&&V.__assertRegistered(x.RowGroupingModule,i.map(e=>"colDef."+e).join(", "),this.gridOptionsService.getGridId())}if("agRichSelect"!==this.colDef.cellEditor&&"agRichSelectCellEditor"!==this.colDef.cellEditor||V.__assertRegistered(x.RichSelectModule,this.colDef.cellEditor,this.gridOptionsService.getGridId()),this.gridOptionsService.is("treeData")){const s=["rowGroup","rowGroupIndex","pivot","pivotIndex"].filter(i=>t(e[i]));s.length>0&&i(`AG Grid: ${s.join()} is not possible when doing tree data, your column definition should not have ${s.join()}`,"TreeDataCannotRowGroup")}if(t(e.menuTabs))if(Array.isArray(e.menuTabs)){const t=["filterMenuTab"],s=["columnsMenuTab","generalMenuTab"],o=s.filter(t=>e.menuTabs.includes(t));o.length>0&&V.__assertRegistered(x.MenuModule,"menuTab(s): "+o.map(e=>`'${e}'`).join(),this.gridOptionsService.getGridId()),e.menuTabs.forEach(e=>{s.includes(e)||t.includes(e)||i(`AG Grid: '${e}' is not valid for 'colDef.menuTabs'. Valid values are: ${[...t,...s].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)&&V.__assertRegistered(x.MenuModule,"columnsMenuParams",this.gridOptionsService.getGridId()),t(e.columnsMenuParams)&&V.__assertRegistered(x.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!!n(this.colDef.suppressFillHandle)}isAutoHeight(){return!!n(this.colDef.autoHeight)}isAutoHeaderHeight(){return!!n(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!!n(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 s=this.createColumnEvent("filterChanged",t);i&&f(s,i),this.eventService.dispatchEvent(s)}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),s=this.colDef.colSpan(t);return Math.max(s,1)}getRowSpan(e){if(i(this.colDef.rowSpan))return 1;const t=this.createBaseColDefParams(e),s=this.colDef.rowSpan(t);return Math.max(s,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([j("gridOptionsService")],te.prototype,"gridOptionsService",void 0),J([j("columnUtils")],te.prototype,"columnUtils",void 0),J([j("columnHoverService")],te.prototype,"columnHoverService",void 0),J([B],te.prototype,"initialise",null);var ie=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class se{constructor(e,t,i,s){this.localEventService=new X,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=s}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:se.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 se&&t.addLeafColumns(e)})}getColumnGroupShow(){const e=this.colGroupDef;if(e)return e.columnGroupShow}setupExpandable(){this.setExpandable(),this.expandableListenerRemoveCallback&&this.expandableListenerRemoveCallback();const e=this.onColumnVisibilityChanged.bind(this);this.getLeafColumns().forEach(t=>t.addEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=()=>{this.getLeafColumns().forEach(t=>t.removeEventListener("visibleChanged",e)),this.expandableListenerRemoveCallback=null}}setExpandable(){if(this.isPadding())return;let e=!1,t=!1,i=!1;const s=this.findChildrenRemovingPadding();for(let o=0,r=s.length;o<r;o++){const r=s[o];if(!r.isVisible())continue;const n=r.getColumnGroupShow();"open"===n?(e=!0,i=!0):"closed"===n?(t=!0,i=!0):(e=!0,t=!0)}const o=e&&t&&i;if(this.expandable!==o){this.expandable=o;const e={type:se.EVENT_EXPANDABLE_CHANGED};this.localEventService.dispatchEvent(e)}}findChildrenRemovingPadding(){const e=[],t=i=>{i.forEach(i=>{i instanceof se&&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)}}se.EVENT_EXPANDED_CHANGED="expandedChanged",se.EVENT_EXPANDABLE_CHANGED="expandableChanged",ie([W],se.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 re(...e){for(let i=0;i<e.length;i++){const s=e[i];if(t(s))return s}return null}function ne(e){if(e&&e.length)return e[e.length-1]}function le(e,t,i){return null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every((e,s)=>i?i(e,t[s]):t[s]===e)}function ae(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 he(e,t){const i=e.indexOf(t);i>=0&&e.splice(i,1)}function ce(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++)he(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 me(e,t){return e.indexOf(t)>-1}function Ce(e){return[].concat.apply([],e)}function ve(e,t){null!=t&&null!=e&&t.forEach(t=>e.push(t))}var fe=Object.freeze({__proto__:null,firstExistingValue:re,existsAndNotEmpty:function(e){return null!=e&&e.length>0},last:ne,areEqual:le,shallowCompare:function(e,t){return le(e,t)},sortNumerically:ae,removeRepeatsFromArray:function(e,t){if(e)for(let i=e.length-2;i>=0;i--){const s=e[i]===t,o=e[i+1]===t;s&&o&&e.splice(i+1,1)}},removeFromUnorderedArray:de,removeFromArray:he,removeAllFromUnorderedArray:ce,removeAllFromArray:ue,insertIntoArray:pe,insertArrayIntoArray:function(e,t,i){if(null!=e&&null!=t)for(let s=t.length-1;s>=0;s--){pe(e,t[s],i)}},moveInArray:ge,includes:me,flatten:Ce,pushAll:ve,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 we=["touchstart","touchend","touchmove","touchcancel","scroll"],ye={};function Se(e){e.__ag_Grid_Stop_Propagation=!0}function Ee(e){return!0===e.__ag_Grid_Stop_Propagation}const Re=(()=>{const e={select:"input",change:"input",submit:"form",reset:"form",error:"img",load:"img",abort:"img"};return t=>{if("boolean"==typeof ye[t])return ye[t];const i=document.createElement(e[t]||"div");return ye[t="on"+t]=t in i}})();function Te(e,t,i){let s=t;for(;s;){const t=e.getDomData(s,i);if(t)return t;s=s.parentElement}return null}function be(e,t){return!(!t||!e)&&Oe(t).indexOf(e)>=0}function De(e){const t=[];let i=e.target;for(;i;)t.push(i),i=i.parentElement;return t}function Oe(e){const t=e;return t.path?t.path:t.composedPath?t.composedPath():De(t)}function Pe(e,t,i,s){const o=me(we,i)?{passive:!0}:void 0;e&&e.addEventListener&&e.addEventListener(t,i,s,o)}var Ae=Object.freeze({__proto__:null,stopPropagationForAgGrid:Se,isStopPropagationForAgGrid:Ee,isEventSupported:Re,getCtrlForEventTarget:Te,isElementInEventPath:be,createEventPath:De,getEventPath:Oe,addSafePassiveEventListener:Pe}),Fe=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Le{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:Le.EVENT_DESTROYED})}addEventListener(e,t){this.localEventService||(this.localEventService=new X),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?Pe(this.getFrameworkOverrides(),e,t,i):e.addEventListener(t,i);const s=()=>(e.removeEventListener(t,i),this.destroyFunctions=this.destroyFunctions.filter(e=>e!==s),null);return this.destroyFunctions.push(s),s}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++,s=e=>{if(e.changeSet){if(e.changeSet&&e.changeSet.id===this.lastChangeSetIdLookup[i])return;this.lastChangeSetIdLookup[i]=e.changeSet.id}const s={type:"gridPropertyChanged",changeSet:e.changeSet};t(s)};e.forEach(e=>this.setupGridOptionListener(e,s))}addDestroyFunc(e){this.isAlive()?this.destroyFunctions.push(e):e()}createManagedBean(e,t){const i=this.createBean(e,t);return this.addDestroyFunc(this.destroyBean.bind(this,e,t)),i}createBean(e,t,i){return(t||this.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)),[]}}Le.EVENT_DESTROYED="destroyed",Fe([j("frameworkOverrides")],Le.prototype,"frameworkOverrides",void 0),Fe([j("context")],Le.prototype,"context",void 0),Fe([j("eventService")],Le.prototype,"eventService",void 0),Fe([j("gridOptionsService")],Le.prototype,"gridOptionsService",void 0),Fe([j("localeService")],Le.prototype,"localeService",void 0),Fe([j("environment")],Le.prototype,"environment",void 0),Fe([W],Le.prototype,"destroy",null);var Ie=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},Ne=function(e,t){return function(i,s){t(i,s,e)}};let Me=class extends Le{setBeans(e){this.logger=e.create("ColumnFactory")}createColumnTree(e,t,i){const s=new d,{existingCols:o,existingGroups:r,existingColKeys:n}=this.extractExistingTreeData(i);s.addExistingKeys(n);const l=this.recursivelyCreateColumns(e,0,t,o,s,r),a=this.findMaxDept(l,0);this.logger.log("Number of levels for grouped columns is "+a);const h=this.balanceColumnTree(l,0,a,s);return this.columnUtils.depthFirstOriginalTreeSearch(null,h,(e,t)=>{e instanceof se&&e.setupExpandable(),e.setOriginalParent(t)}),{columnTree:h,treeDept:a}}extractExistingTreeData(e){const t=[],i=[],s=[];return e&&this.columnUtils.depthFirstOriginalTreeSearch(null,e,e=>{if(e instanceof se){const t=e;i.push(t)}else{const i=e;s.push(i.getId()),t.push(i)}}),{existingCols:t,existingGroups:i,existingColKeys:s}}createForAutoGroups(e,t){return e.map(e=>this.createAutoGroupTreeItem(t,e))}createAutoGroupTreeItem(e,t){const i=this.findDepth(e);let s=t;for(let e=i-1;e>=0;e--){const i=new se(null,`FAKE_PATH_${t.getId()}}_${e}`,!0,e);this.createBean(i),i.setChildren([s]),s.setOriginalParent(i),s=i}return 0===i&&t.setOriginalParent(null),s}findDepth(e){let t=0,i=e;for(;i&&i[0]&&i[0]instanceof se;)t++,i=i[0].getChildren();return t}balanceColumnTree(e,t,i,s){const o=[];for(let r=0;r<e.length;r++){const n=e[r];if(n instanceof se){const e=n,r=this.balanceColumnTree(e.getChildren(),t+1,i,s);e.setChildren(r),o.push(e)}else{let r,l;for(let e=i-1;e>=t;e--){const e=s.getUniqueKey(null,null),i=this.createMergedColGroupDef(null),o=new se(i,e,!0,t);this.createBean(o),l&&l.setChildren([o]),l=o,r||(r=l)}if(r&&l){o.push(r);if(e.some(e=>e instanceof se)){l.setChildren([n]);continue}l.setChildren(e);break}o.push(n)}}return o}findMaxDept(e,t){let i=t;for(let s=0;s<e.length;s++){const o=e[s];if(o instanceof se){const e=o,s=this.findMaxDept(e.getChildren(),t+1);i<s&&(i=s)}}return i}recursivelyCreateColumns(e,t,i,s,o,r){if(!e)return[];const n=new Array(e.length);for(let l=0;l<n.length;l++){const a=e[l];this.isColumnGroup(a)?n[l]=this.createColumnGroup(i,a,t,s,o,r):n[l]=this.createColumn(i,a,s,o)}return n}createColumnGroup(e,t,i,s,o,r){const n=this.createMergedColGroupDef(t),l=o.getUniqueKey(n.groupId||null,null),a=new se(n,l,!1,i);this.createBean(a);const d=this.findExistingGroup(t,r);d&&r.splice(d.idx,1);let h=null==d?void 0:d.group;h&&a.setExpanded(h.isExpanded());const c=this.recursivelyCreateColumns(n.children,i+1,e,s,o,r);return a.setChildren(c),a}createMergedColGroupDef(e){const t={};return Object.assign(t,this.gridOptionsService.get("defaultColGroupDef")),Object.assign(t,e),t}createColumn(e,t,i,s){const o=this.findExistingColumn(t,i);o&&(null==i||i.splice(o.idx,1));let r=null==o?void 0:o.column;if(r){const e=this.addColumnDefaultAndTypes(t,r.getColId());r.setColDef(e,t),this.applyColumnState(r,e)}else{const i=s.getUniqueKey(t.colId,t.field),o=this.addColumnDefaultAndTypes(t,i);r=new te(o,t,i,e),this.context.createBean(r)}return this.dataTypeService.addColumnListeners(r),r}applyColumnState(e,t){const i=r(t.flex);void 0!==i&&e.setFlex(i);if(e.getFlex()<=0){const i=r(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 s=r(t.sortIndex);void 0!==s&&e.setSortIndex(s);const o=n(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 s=t[i].getUserProvidedColDef();if(!s)continue;if(null!=e.colId){if(t[i].getId()===e.colId)return{idx:i,column:t[i]};continue}if(null!=e.field){if(s.field===e.field)return{idx:i,column:t[i]}}else if(s===e)return{idx:i,column:t[i]}}}findExistingGroup(e,t){if(null!=e.groupId)for(let i=0;i<t.length;i++){const s=t[i];if(s.getColGroupDef()&&s.getId()===e.groupId)return{idx:i,group:s}}}addColumnDefaultAndTypes(e,t){const i={};f(i,this.gridOptionsService.get("defaultColDef"),!1,!0);const s=this.dataTypeService.updateColDefAndGetColumnType(i,e,t);s&&this.assignColumnTypes(s,i),f(i,e,!1,!0);const o=this.gridOptionsService.get("autoGroupColumnDef"),r=this.gridOptionsService.isColumnsSortingCoupledToGroup();return e.rowGroup&&o&&r&&f(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);h(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 s=i[e.trim()];s?f(t,s,!1,!0):console.warn("AG Grid: colDef.type '"+e+"' does not correspond to defined gridOptions.columnTypes")})}isColumnGroup(e){return void 0!==e.children}};Ie([j("columnUtils")],Me.prototype,"columnUtils",void 0),Ie([j("dataTypeService")],Me.prototype,"dataTypeService",void 0),Ie([Ne(0,Y("loggerFactory"))],Me.prototype,"setBeans",null),Me=Ie([U("columnFactory")],Me);var Ge=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class xe{constructor(e,t,i,s){this.displayedChildren=[],this.localEventService=new X,this.groupId=t,this.partId=i,this.providedColumnGroup=e,this.pinned=s}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 xe.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 xe&&e.checkLeft()}),this.displayedChildren.length>0)if(this.gridOptionsService.is("enableRtl")){const e=ne(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(xe.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 xe&&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 xe&&t.addDisplayedLeafColumns(e)})}addLeafColumns(e){this.children.forEach(t=>{t instanceof te?e.push(t):t instanceof xe&&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(xe.EVENT_DISPLAYED_CHILDREN_CHANGED));this.children.forEach(t=>{if(t instanceof xe&&(!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(xe.EVENT_DISPLAYED_CHILDREN_CHANGED))}}xe.EVENT_LEFT_CHANGED="leftChanged",xe.EVENT_DISPLAYED_CHILDREN_CHANGED="displayedChildrenChanged",Ge([j("gridOptionsService")],xe.prototype,"gridOptionsService",void 0);class _e{}_e.EVENT_COLUMN_EVERYTHING_CHANGED="columnEverythingChanged",_e.EVENT_NEW_COLUMNS_LOADED="newColumnsLoaded",_e.EVENT_COLUMN_PIVOT_MODE_CHANGED="columnPivotModeChanged",_e.EVENT_COLUMN_ROW_GROUP_CHANGED="columnRowGroupChanged",_e.EVENT_EXPAND_COLLAPSE_ALL="expandOrCollapseAll",_e.EVENT_COLUMN_PIVOT_CHANGED="columnPivotChanged",_e.EVENT_GRID_COLUMNS_CHANGED="gridColumnsChanged",_e.EVENT_COLUMN_VALUE_CHANGED="columnValueChanged",_e.EVENT_COLUMN_MOVED="columnMoved",_e.EVENT_COLUMN_VISIBLE="columnVisible",_e.EVENT_COLUMN_PINNED="columnPinned",_e.EVENT_COLUMN_GROUP_OPENED="columnGroupOpened",_e.EVENT_COLUMN_RESIZED="columnResized",_e.EVENT_DISPLAYED_COLUMNS_CHANGED="displayedColumnsChanged",_e.EVENT_VIRTUAL_COLUMNS_CHANGED="virtualColumnsChanged",_e.EVENT_ASYNC_TRANSACTIONS_FLUSHED="asyncTransactionsFlushed",_e.EVENT_ROW_GROUP_OPENED="rowGroupOpened",_e.EVENT_ROW_DATA_CHANGED="rowDataChanged",_e.EVENT_ROW_DATA_UPDATED="rowDataUpdated",_e.EVENT_PINNED_ROW_DATA_CHANGED="pinnedRowDataChanged",_e.EVENT_RANGE_SELECTION_CHANGED="rangeSelectionChanged",_e.EVENT_CHART_CREATED="chartCreated",_e.EVENT_CHART_RANGE_SELECTION_CHANGED="chartRangeSelectionChanged",_e.EVENT_CHART_OPTIONS_CHANGED="chartOptionsChanged",_e.EVENT_CHART_DESTROYED="chartDestroyed",_e.EVENT_TOOL_PANEL_VISIBLE_CHANGED="toolPanelVisibleChanged",_e.EVENT_TOOL_PANEL_SIZE_CHANGED="toolPanelSizeChanged",_e.EVENT_COLUMN_PANEL_ITEM_DRAG_START="columnPanelItemDragStart",_e.EVENT_COLUMN_PANEL_ITEM_DRAG_END="columnPanelItemDragEnd",_e.EVENT_MODEL_UPDATED="modelUpdated",_e.EVENT_CUT_START="cutStart",_e.EVENT_CUT_END="cutEnd",_e.EVENT_PASTE_START="pasteStart",_e.EVENT_PASTE_END="pasteEnd",_e.EVENT_FILL_START="fillStart",_e.EVENT_FILL_END="fillEnd",_e.EVENT_RANGE_DELETE_START="rangeDeleteStart",_e.EVENT_RANGE_DELETE_END="rangeDeleteEnd",_e.EVENT_UNDO_STARTED="undoStarted",_e.EVENT_UNDO_ENDED="undoEnded",_e.EVENT_REDO_STARTED="redoStarted",_e.EVENT_REDO_ENDED="redoEnded",_e.EVENT_KEY_SHORTCUT_CHANGED_CELL_START="keyShortcutChangedCellStart",_e.EVENT_KEY_SHORTCUT_CHANGED_CELL_END="keyShortcutChangedCellEnd",_e.EVENT_CELL_CLICKED="cellClicked",_e.EVENT_CELL_DOUBLE_CLICKED="cellDoubleClicked",_e.EVENT_CELL_MOUSE_DOWN="cellMouseDown",_e.EVENT_CELL_CONTEXT_MENU="cellContextMenu",_e.EVENT_CELL_VALUE_CHANGED="cellValueChanged",_e.EVENT_CELL_EDIT_REQUEST="cellEditRequest",_e.EVENT_ROW_VALUE_CHANGED="rowValueChanged",_e.EVENT_CELL_FOCUSED="cellFocused",_e.EVENT_CELL_FOCUS_CLEARED="cellFocusCleared",_e.EVENT_FULL_WIDTH_ROW_FOCUSED="fullWidthRowFocused",_e.EVENT_ROW_SELECTED="rowSelected",_e.EVENT_SELECTION_CHANGED="selectionChanged",_e.EVENT_TOOLTIP_SHOW="tooltipShow",_e.EVENT_TOOLTIP_HIDE="tooltipHide",_e.EVENT_CELL_KEY_DOWN="cellKeyDown",_e.EVENT_CELL_MOUSE_OVER="cellMouseOver",_e.EVENT_CELL_MOUSE_OUT="cellMouseOut",_e.EVENT_FILTER_CHANGED="filterChanged",_e.EVENT_FILTER_MODIFIED="filterModified",_e.EVENT_FILTER_OPENED="filterOpened",_e.EVENT_ADVANCED_FILTER_BUILDER_VISIBLE_CHANGED="advancedFilterBuilderVisibleChanged",_e.EVENT_SORT_CHANGED="sortChanged",_e.EVENT_VIRTUAL_ROW_REMOVED="virtualRowRemoved",_e.EVENT_ROW_CLICKED="rowClicked",_e.EVENT_ROW_DOUBLE_CLICKED="rowDoubleClicked",_e.EVENT_GRID_READY="gridReady",_e.EVENT_GRID_PRE_DESTROYED="gridPreDestroyed",_e.EVENT_GRID_SIZE_CHANGED="gridSizeChanged",_e.EVENT_VIEWPORT_CHANGED="viewportChanged",_e.EVENT_SCROLLBAR_WIDTH_CHANGED="scrollbarWidthChanged",_e.EVENT_FIRST_DATA_RENDERED="firstDataRendered",_e.EVENT_DRAG_STARTED="dragStarted",_e.EVENT_DRAG_STOPPED="dragStopped",_e.EVENT_CHECKBOX_CHANGED="checkboxChanged",_e.EVENT_ROW_EDITING_STARTED="rowEditingStarted",_e.EVENT_ROW_EDITING_STOPPED="rowEditingStopped",_e.EVENT_CELL_EDITING_STARTED="cellEditingStarted",_e.EVENT_CELL_EDITING_STOPPED="cellEditingStopped",_e.EVENT_BODY_SCROLL="bodyScroll",_e.EVENT_BODY_SCROLL_END="bodyScrollEnd",_e.EVENT_HEIGHT_SCALE_CHANGED="heightScaleChanged",_e.EVENT_PAGINATION_CHANGED="paginationChanged",_e.EVENT_COMPONENT_STATE_CHANGED="componentStateChanged",_e.EVENT_STORE_REFRESHED="storeRefreshed",_e.EVENT_BODY_HEIGHT_CHANGED="bodyHeightChanged",_e.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED="displayedColumnsWidthChanged",_e.EVENT_SCROLL_VISIBILITY_CHANGED="scrollVisibilityChanged",_e.EVENT_COLUMN_HOVER_CHANGED="columnHoverChanged",_e.EVENT_FLASH_CELLS="flashCells",_e.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED="paginationPixelOffsetChanged",_e.EVENT_DISPLAYED_ROWS_CHANGED="displayedRowsChanged",_e.EVENT_LEFT_PINNED_WIDTH_CHANGED="leftPinnedWidthChanged",_e.EVENT_RIGHT_PINNED_WIDTH_CHANGED="rightPinnedWidthChanged",_e.EVENT_ROW_CONTAINER_HEIGHT_CHANGED="rowContainerHeightChanged",_e.EVENT_HEADER_HEIGHT_CHANGED="headerHeightChanged",_e.EVENT_COLUMN_HEADER_HEIGHT_CHANGED="columnHeaderHeightChanged",_e.EVENT_ROW_DRAG_ENTER="rowDragEnter",_e.EVENT_ROW_DRAG_MOVE="rowDragMove",_e.EVENT_ROW_DRAG_LEAVE="rowDragLeave",_e.EVENT_ROW_DRAG_END="rowDragEnd",_e.EVENT_GRID_STYLES_CHANGED="gridStylesChanged",_e.EVENT_POPUP_TO_FRONT="popupToFront",_e.EVENT_COLUMN_ROW_GROUP_CHANGE_REQUEST="columnRowGroupChangeRequest",_e.EVENT_COLUMN_PIVOT_CHANGE_REQUEST="columnPivotChangeRequest",_e.EVENT_COLUMN_VALUE_CHANGE_REQUEST="columnValueChangeRequest",_e.EVENT_COLUMN_AGG_FUNC_CHANGE_REQUEST="columnAggFuncChangeRequest",_e.EVENT_KEYBOARD_FOCUS="keyboardFocus",_e.EVENT_MOUSE_FOCUS="mouseFocus",_e.EVENT_STORE_UPDATED="storeUpdated",_e.EVENT_FILTER_DESTROYED="filterDestroyed",_e.EVENT_ROW_DATA_UPDATE_STARTED="rowDataUpdateStarted",_e.EVENT_ADVANCED_FILTER_ENABLED_CHANGED="advancedFilterEnabledChanged",_e.EVENT_DATA_TYPES_INFERRED="dataTypesInferred",_e.EVENT_FIELD_VALUE_CHANGED="fieldValueChanged",_e.EVENT_FIELD_PICKER_VALUE_SELECTED="fieldPickerValueSelected";class Ve{constructor(){this.existingIds={}}getInstanceIdForKey(e){const t=this.existingIds[e];let i;return i="number"!=typeof t?0:t+1,this.existingIds[e]=i,i}}var He=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const ke="ag-Grid-AutoColumn";let Be=class extends Le{createAutoGroupColumns(e){const t=[],i=this.gridOptionsService.is("treeData");let s=this.gridOptionsService.isGroupMultiAutoColumn();return i&&s&&(console.warn('AG Grid: you cannot mix groupDisplayType = "multipleColumns" with treeData, only one column can be used to display groups when doing tree data'),s=!1),s?e.forEach((e,i)=>{t.push(this.createOneAutoGroupColumn(e,i))}):t.push(this.createOneAutoGroupColumn()),t}updateAutoGroupColumns(e){e.forEach((e,t)=>this.updateOneAutoGroupColumn(e,t))}createOneAutoGroupColumn(e,t){let i;i=e?"ag-Grid-AutoColumn-"+e.getId():"ag-Grid-AutoColumn";const s=this.createAutoGroupColDef(i,e,t);s.colId=i;const o=new te(s,null,i,!0);return this.context.createBean(o),o}updateOneAutoGroupColumn(e,t){const i=e.getColDef(),s="string"==typeof i.showRowGroup?i.showRowGroup:void 0,o=null!=s?this.columnModel.getPrimaryColumn(s):void 0,r=this.createAutoGroupColDef(e.getId(),null!=o?o:void 0,t);e.setColDef(r,null),this.columnFactory.applyColumnState(e,r)}createAutoGroupColDef(e,t,s){let o=this.createBaseColDef(t);if(f(o,this.gridOptionsService.get("autoGroupColumnDef")),o=this.columnFactory.addColumnDefaultAndTypes(o,e),!this.gridOptionsService.is("treeData")){i(o.field)&&i(o.valueGetter)&&i(o.filterValueGetter)&&"agGroupColumnFilter"!==o.filter&&(o.filter=!1)}s&&s>0&&(o.headerCheckboxSelection=!1);const r=this.gridOptionsService.isColumnsSortingCoupledToGroup(),n=o.valueGetter||null!=o.field;return r&&!n&&(o.sortIndex=void 0,o.initialSort=void 0),o}createBaseColDef(e){const t=this.gridOptionsService.get("autoGroupColumnDef"),i={headerName:this.localeService.getLocaleTextFunc()("group","Group")};if(t&&(t.cellRenderer||t.cellRendererSelector)||(i.cellRenderer="agGroupCellRenderer"),e){const t=e.getColDef();Object.assign(i,{headerName:this.columnModel.getDisplayNameForColumn(e,"header"),headerValueGetter:t.headerValueGetter}),t.cellRenderer&&Object.assign(i,{cellRendererParams:{innerRenderer:t.cellRenderer,innerRendererParams:t.cellRendererParams}}),i.showRowGroup=e.getColId()}else i.showRowGroup=!0;return i}};He([j("columnModel")],Be.prototype,"columnModel",void 0),He([j("columnFactory")],Be.prototype,"columnFactory",void 0),Be=He([U("autoGroupColService")],Be);const We=/[&<>"']/g,Ue={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function je(e,t){if(null==e)return null;const i=e.toString().toString();return t?i:i.replace(We,e=>Ue[e])}function ze(e){if(!e||null==e)return null;return e.replace(/([a-z])([A-Z])/g,"$1 $2").replace(/([A-Z]+)([A-Z])([a-z])/g,"$1 $2$3").replace(/\./g," ").split(" ").map(e=>e.substring(0,1).toUpperCase()+(e.length>1?e.substring(1,e.length):"")).join(" ")}function Ke(e){return e.replace(/[A-Z]/g,e=>"-"+e.toLocaleLowerCase())}var Ye=Object.freeze({__proto__:null,utf8_encode:function(e){const t=String.fromCharCode;function i(e,i){return t(e>>i&63|128)}function s(e){if(e>=0&&e<=31&&10!==e){return`_x${e.toString(16).toUpperCase().padStart(4,"0")}_`}if(0==(4294967168&e))return t(e);let s="";return 0==(4294965248&e)?s=t(e>>6&31|192):0==(4294901760&e)?(!function(e){if(e>=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}(e),s=t(e>>12&15|224),s+=i(e,6)):0==(4292870144&e)&&(s=t(e>>18&7|240),s+=i(e,12),s+=i(e,6)),s+=t(63&e|128),s}const o=function(e){const t=[];if(!e)return[];const i=e.length;let s,o,r=0;for(;r<i;)s=e.charCodeAt(r++),s>=55296&&s<=56319&&r<i?(o=e.charCodeAt(r++),56320==(64512&o)?t.push(((1023&s)<<10)+(1023&o)+65536):(t.push(s),r--)):t.push(s);return t}(e),r=o.length;let n,l=-1,a="";for(;++l<r;)n=o[l],a+=s(n);return a},capitalise:function(e){return e[0].toUpperCase()+e.substr(1).toLowerCase()},escapeString:je,camelCaseToHumanText:ze,camelCaseToHyphenated:Ke});function $e(e){const t=new Map;return e.forEach(e=>t.set(e[0],e[1])),t}var qe=Object.freeze({__proto__:null,convertToMap:$e,mapById:function(e,t){const i=new Map;return e.forEach(e=>i.set(t(e),e)),i},keys:function(e){const t=[];return e.forEach((e,i)=>t.push(i)),t}});class Qe{}Qe.ColDefPropertyMap={headerName:void 0,columnGroupShow:void 0,headerClass:void 0,toolPanelClass:void 0,headerValueGetter:void 0,pivotKeys:void 0,groupId:void 0,colId:void 0,sort:void 0,initialSort:void 0,field:void 0,type:void 0,cellDataType:void 0,tooltipComponent:void 0,tooltipField:void 0,headerTooltip:void 0,cellClass:void 0,showRowGroup:void 0,filter:void 0,initialAggFunc:void 0,defaultAggFunc:void 0,aggFunc:void 0,pinned:void 0,initialPinned:void 0,chartDataType:void 0,cellEditorPopupPosition:void 0,headerGroupComponent:void 0,headerGroupComponentParams:void 0,cellStyle:void 0,cellRenderer:void 0,cellRendererParams:void 0,cellEditor:void 0,cellEditorParams:void 0,filterParams:void 0,pivotValueColumn:void 0,headerComponent:void 0,headerComponentParams:void 0,floatingFilterComponent:void 0,floatingFilterComponentParams:void 0,tooltipComponentParams:void 0,refData:void 0,columnsMenuParams:void 0,children:void 0,sortingOrder:void 0,allowedAggFuncs:void 0,menuTabs:void 0,pivotTotalColumnIds:void 0,cellClassRules:void 0,icons:void 0,sortIndex:void 0,initialSortIndex:void 0,flex:void 0,initialFlex:void 0,width:void 0,initialWidth:void 0,minWidth:void 0,maxWidth:void 0,rowGroupIndex:void 0,initialRowGroupIndex:void 0,pivotIndex:void 0,initialPivotIndex:void 0,suppressCellFlash:void 0,suppressColumnsToolPanel:void 0,suppressFiltersToolPanel:void 0,openByDefault:void 0,marryChildren:void 0,suppressStickyLabel:void 0,hide:void 0,initialHide:void 0,rowGroup:void 0,initialRowGroup:void 0,pivot:void 0,initialPivot:void 0,checkboxSelection:void 0,showDisabledCheckboxes:void 0,headerCheckboxSelection:void 0,headerCheckboxSelectionFilteredOnly:void 0,headerCheckboxSelectionCurrentPageOnly:void 0,suppressMenu:void 0,suppressMovable:void 0,lockPosition:void 0,lockVisible:void 0,lockPinned:void 0,unSortIcon:void 0,suppressSizeToFit:void 0,suppressAutoSize:void 0,enableRowGroup:void 0,enablePivot:void 0,enableValue:void 0,editable:void 0,suppressPaste:void 0,suppressNavigable:void 0,enableCellChangeFlash:void 0,rowDrag:void 0,dndSource:void 0,autoHeight:void 0,wrapText:void 0,sortable:void 0,resizable:void 0,singleClickEdit:void 0,floatingFilter:void 0,cellEditorPopup:void 0,suppressFillHandle:void 0,wrapHeaderText:void 0,autoHeaderHeight:void 0,dndSourceOnRowDrag:void 0,valueGetter:void 0,valueSetter:void 0,filterValueGetter:void 0,keyCreator:void 0,valueFormatter:void 0,valueParser:void 0,comparator:void 0,equals:void 0,pivotComparator:void 0,suppressKeyboardEvent:void 0,suppressHeaderKeyboardEvent:void 0,colSpan:void 0,rowSpan:void 0,getQuickFilterText:void 0,onCellValueChanged:void 0,onCellClicked:void 0,onCellDoubleClicked:void 0,onCellContextMenu:void 0,rowDragText:void 0,tooltipValueGetter:void 0,cellRendererSelector:void 0,cellEditorSelector:void 0,suppressSpanHeaderHeight:void 0,useValueFormatterForExport:void 0,useValueParserForImport:void 0},Qe.ALL_PROPERTIES=Object.keys(Qe.ColDefPropertyMap);class Xe{}Xe.STRING_PROPERTIES=["rowSelection","overlayLoadingTemplate","overlayNoRowsTemplate","gridId","quickFilterText","rowModelType","editType","domLayout","clipboardDelimiter","rowGroupPanelShow","multiSortKey","pivotColumnGroupTotals","pivotRowTotals","pivotPanelShow","fillHandleDirection","serverSideStoreType","groupDisplayType","treeDataDisplayType","colResizeDefault","tooltipTrigger","serverSidePivotResultFieldSeparator"],Xe.OBJECT_PROPERTIES=["components","rowStyle","context","autoGroupColumnDef","localeText","icons","datasource","serverSideDatasource","viewportDatasource","groupRowRendererParams","aggFuncs","fullWidthCellRendererParams","defaultColGroupDef","defaultColDef","defaultCsvExportParams","defaultExcelExportParams","columnTypes","rowClassRules","detailCellRendererParams","loadingCellRendererParams","loadingOverlayComponentParams","noRowsOverlayComponentParams","popupParent","statusBar","sideBar","chartThemeOverrides","customChartThemes","chartToolPanelsDef","dataTypeDefinitions","advancedFilterModel","advancedFilterParent","advancedFilterBuilderParams"],Xe.ARRAY_PROPERTIES=["sortingOrder","alignedGrids","rowData","columnDefs","excelStyles","pinnedTopRowData","pinnedBottomRowData","chartThemes","rowClass"],Xe.NUMBER_PROPERTIES=["rowHeight","detailRowHeight","rowBuffer","headerHeight","groupHeaderHeight","floatingFiltersHeight","pivotHeaderHeight","pivotGroupHeaderHeight","groupDefaultExpanded","pivotDefaultExpanded","viewportRowModelPageSize","viewportRowModelBufferSize","autoSizePadding","maxBlocksInCache","maxConcurrentDatasourceRequests","tooltipShowDelay","tooltipHideDelay","cacheOverflowSize","paginationPageSize","cacheBlockSize","infiniteInitialRowCount","serverSideInitialRowCount","scrollbarWidth","asyncTransactionWaitMillis","blockLoadDebounceMillis","keepDetailRowsCount","undoRedoCellEditingLimit","cellFlashDelay","cellFadeDelay","tabIndex"],Xe.BOOLEAN_PROPERTIES=["suppressMakeColumnVisibleAfterUnGroup","suppressRowClickSelection","suppressCellFocus","suppressHorizontalScroll","alwaysShowHorizontalScroll","alwaysShowVerticalScroll","debug","enableBrowserTooltips","enableCellExpressions","groupSelectsChildren","groupIncludeTotalFooter","groupSuppressBlankHeader","suppressMenuHide","suppressRowDeselection","unSortIcon","suppressMultiSort","alwaysMultiSort","singleClickEdit","suppressLoadingOverlay","suppressNoRowsOverlay","suppressAutoSize","skipHeaderOnAutoSize","suppressParentsInRowNodes","suppressColumnMoveAnimation","suppressMovableColumns","suppressFieldDotNotation","enableRangeSelection","enableRangeHandle","enableFillHandle","suppressClearOnFillReduction","deltaSort","suppressTouch","suppressAsyncEvents","allowContextMenuWithControlKey","suppressContextMenu","rememberGroupStateWhenNewData","enableCellChangeFlash","suppressDragLeaveHidesColumns","suppressRowGroupHidesColumns","suppressMiddleClickScrolls","suppressPreventDefaultOnMouseWheel","suppressCopyRowsToClipboard","copyHeadersToClipboard","copyGroupHeadersToClipboard","pivotMode","suppressAggFuncInHeader","suppressColumnVirtualisation","alwaysAggregateAtRootLevel","suppressAggAtRootLevel","suppressFocusAfterRefresh","functionsPassive","functionsReadOnly","animateRows","groupSelectsFiltered","groupRemoveSingleChildren","groupRemoveLowestSingleChildren","enableRtl","suppressClickEdit","rowDragEntireRow","rowDragManaged","suppressRowDrag","suppressMoveWhenRowDragging","rowDragMultiRow","enableGroupEdit","embedFullWidthRows","suppressPaginationPanel","groupHideOpenParents","groupAllowUnbalanced","pagination","paginationAutoPageSize","suppressScrollOnNewData","suppressScrollWhenPopupsAreOpen","purgeClosedRowNodes","cacheQuickFilter","includeHiddenColumnsInQuickFilter","excludeHiddenColumnsFromQuickFilter","ensureDomOrder","accentedSort","suppressChangeDetection","valueCache","valueCacheNeverExpires","aggregateOnlyChangedColumns","suppressAnimationFrame","suppressExcelExport","suppressCsvExport","treeData","masterDetail","suppressMultiRangeSelection","enterMovesDown","enterMovesDownAfterEdit","enterNavigatesVerticallyAfterEdit","enterNavigatesVertically","suppressPropertyNamesCheck","rowMultiSelectWithClick","suppressRowHoverHighlight","suppressRowTransform","suppressClipboardPaste","suppressLastEmptyLineOnPaste","enableCharts","enableChartToolPanelsButton","suppressChartToolPanelsButton","suppressMaintainUnsortedOrder","enableCellTextSelection","suppressBrowserResizeObserver","suppressMaxRenderedRowRestriction","excludeChildrenWhenTreeDataFiltering","tooltipMouseTrack","tooltipInteraction","keepDetailRows","paginateChildRows","preventDefaultOnContextMenu","undoRedoCellEditing","allowDragFromColumnsToolPanel","pivotSuppressAutoColumn","suppressExpandablePivotGroups","debounceVerticalScrollbar","detailRowAutoHeight","serverSideFilteringAlwaysResets","serverSideFilterAllLevels","serverSideSortingAlwaysResets","serverSideSortAllLevels","serverSideOnlyRefreshFilteredGroups","serverSideSortOnServer","serverSideFilterOnServer","suppressAggFilteredOnly","showOpenedGroup","suppressClipboardApi","suppressModelUpdateAfterUpdateTransaction","stopEditingWhenCellsLoseFocus","maintainColumnOrder","groupMaintainOrder","columnHoverHighlight","suppressReactUi","readOnlyEdit","suppressRowVirtualisation","enableCellEditingOnBackspace","resetRowDataOnUpdate","removePivotHeaderRowWhenSingleValueColumn","suppressCopySingleCellRanges","suppressGroupRowsSticky","suppressServerSideInfiniteScroll","rowGroupPanelSuppressSort","allowShowChangeAfterFilter","suppressCutToClipboard","enableAdvancedFilter","includeHiddenColumnsInAdvancedFilter"],Xe.FUNCTIONAL_PROPERTIES=["doesExternalFilterPass","processSecondaryColDef","processSecondaryColGroupDef","processPivotResultColDef","processPivotResultColGroupDef","getBusinessKeyForNode","isRowSelectable","rowDragText","groupRowRenderer","fullWidthCellRenderer","loadingCellRenderer","loadingOverlayComponent","noRowsOverlayComponent","detailCellRenderer","quickFilterParser","quickFilterMatcher"],Xe.CALLBACK_PROPERTIES=["getLocaleText","isExternalFilterPresent","getRowHeight","getRowClass","getRowStyle","getContextMenuItems","getMainMenuItems","processRowPostCreate","processCellForClipboard","getGroupRowAgg","isFullWidthRow","sendToClipboard","navigateToNextHeader","tabToNextHeader","navigateToNextCell","tabToNextCell","processCellFromClipboard","getDocument","postProcessPopup","getChildCount","getDataPath","isRowMaster","postSortRows","processHeaderForClipboard","processGroupHeaderForClipboard","paginationNumberFormatter","processDataFromClipboard","getServerSideGroupKey","isServerSideGroup","createChartContainer","getChartToolbarItems","fillOperation","isApplyServerSideTransaction","getServerSideStoreParams","getServerSideGroupLevelParams","isServerSideGroupOpenByDefault","isGroupOpenByDefault","initialGroupOrderComparator","groupIncludeFooter","loadingCellRendererSelector","getRowId","groupAggFiltering"],Xe.FUNCTION_PROPERTIES=[...Xe.FUNCTIONAL_PROPERTIES,...Xe.CALLBACK_PROPERTIES],Xe.ALL_PROPERTIES=[...Xe.ARRAY_PROPERTIES,...Xe.OBJECT_PROPERTIES,...Xe.STRING_PROPERTIES,...Xe.NUMBER_PROPERTIES,...Xe.FUNCTION_PROPERTIES,...Xe.BOOLEAN_PROPERTIES];class Je{static getCallbackForEvent(e){return!e||e.length<2?e:"on"+e[0].toUpperCase()+e.substr(1)}static getCoercionLookup(){let e={};return[...Je.ARRAY_PROPERTIES,...Je.OBJECT_PROPERTIES,...Je.STRING_PROPERTIES,...Je.FUNCTION_PROPERTIES,...Je.EVENT_CALLBACKS].forEach(t=>e[t]="none"),Je.BOOLEAN_PROPERTIES.forEach(t=>e[t]="boolean"),Je.NUMBER_PROPERTIES.forEach(t=>e[t]="number"),e}static getValue(e,t){const i=Je.coercionLookup[e];if(i){let s=t;switch(i){case"number":s=Je.toNumber(t);break;case"boolean":s=Je.toBoolean(t);break;case"none":"groupAggFiltering"===e&&"function"!=typeof t&&(s=Je.toBoolean(t))}return s}}static getGridOptionKeys(e,t){return t?Object.keys(Je.coercionLookup):Object.keys(e)}static copyAttributesToGridOptions(e,t,i=!1){"object"!=typeof e&&(e={});const s=e;return Je.getGridOptionKeys(t,i).forEach(e=>{const i=t[e];if(void 0!==i){const t=Je.getValue(e,i);void 0!==t&&(s[e]=t)}}),e}static processOnChange(e,t){if(!e||0===Object.keys(e).length)return;this.changeSetId++;const i=Object.assign({},e);i.columnTypes&&(t.setColumnTypes(i.columnTypes.currentValue,"gridOptionsChanged"),delete i.columnTypes),i.autoGroupColumnDef&&(t.setAutoGroupColumnDef(i.autoGroupColumnDef.currentValue,"gridOptionsChanged"),delete i.autoGroupColumnDef),i.defaultColDef&&(t.setDefaultColDef(i.defaultColDef.currentValue,"gridOptionsChanged"),delete i.defaultColDef),i.columnDefs&&(t.setColumnDefs(i.columnDefs.currentValue,"gridOptionsChanged"),delete i.columnDefs);const s=Object.keys(i).map(e=>{const s=e,o=Je.getValue(s,i[s].currentValue);return{gridKey:s,coercedValue:o,isChanged:t.__setPropertyOnly(s,o)}}).filter(e=>e.isChanged),o=s.map(e=>e.gridKey);s.forEach(e=>t.__updateProperty(e.gridKey,e.coercedValue,e.isChanged,{id:this.changeSetId,properties:o}));const r={type:_e.EVENT_COMPONENT_STATE_CHANGED};h(e,(e,t)=>{r[e]=t}),t.dispatchEvent(r)}static toBoolean(e){return"boolean"==typeof e?e:"string"==typeof e&&("TRUE"===e.toUpperCase()||""==e)}static toNumber(e){return"number"==typeof e?e:"string"==typeof e?Number(e):void 0}}function Ze(e,t,i){const s={},o=e.filter(e=>!t.some(t=>t===e));return o.length>0&&o.forEach(e=>s[e]=et(e,i).values),s}function et(e,t,i,s){let o=t.map((t,i)=>({value:t,relevance:tt(e.toLowerCase(),t.toLocaleLowerCase()),idx:i}));if(o.sort((e,t)=>t.relevance-e.relevance),i&&(o=o.filter(e=>0!==e.relevance)),o.length>0&&s&&s>0){const e=o[0].relevance*s;o=o.filter(t=>e-t.relevance<0)}const r=[],n=[];for(const e of o)r.push(e.value),n.push(e.idx);return{values:r,indices:n}}function tt(e,t){const i=e.replace(/\s/g,""),s=t.replace(/\s/g,"");let o=0,r=-1;for(let e=0;e<i.length;e++){const t=s.indexOf(i[e],r+1);-1!==t&&(r=t,o+=100-100*r/1e4*100)}return o}Je.EVENTS=l(_e),Je.EXCLUDED_INTERNAL_EVENTS=[_e.EVENT_SCROLLBAR_WIDTH_CHANGED,_e.EVENT_CHECKBOX_CHANGED,_e.EVENT_HEIGHT_SCALE_CHANGED,_e.EVENT_BODY_HEIGHT_CHANGED,_e.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,_e.EVENT_SCROLL_VISIBILITY_CHANGED,_e.EVENT_COLUMN_HOVER_CHANGED,_e.EVENT_FLASH_CELLS,_e.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,_e.EVENT_DISPLAYED_ROWS_CHANGED,_e.EVENT_LEFT_PINNED_WIDTH_CHANGED,_e.EVENT_RIGHT_PINNED_WIDTH_CHANGED,_e.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,_e.EVENT_POPUP_TO_FRONT,_e.EVENT_KEYBOARD_FOCUS,_e.EVENT_MOUSE_FOCUS,_e.EVENT_STORE_UPDATED,_e.EVENT_COLUMN_PANEL_ITEM_DRAG_START,_e.EVENT_COLUMN_PANEL_ITEM_DRAG_END,_e.EVENT_FILL_START,_e.EVENT_FILL_END,_e.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,_e.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,_e.EVENT_FULL_WIDTH_ROW_FOCUSED,_e.EVENT_HEADER_HEIGHT_CHANGED,_e.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,_e.EVENT_CELL_FOCUS_CLEARED,_e.EVENT_GRID_STYLES_CHANGED,_e.EVENT_FILTER_DESTROYED,_e.EVENT_ROW_DATA_UPDATE_STARTED,_e.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,_e.EVENT_DATA_TYPES_INFERRED,_e.EVENT_FIELD_VALUE_CHANGED,_e.EVENT_FIELD_PICKER_VALUE_SELECTED],Je.PUBLIC_EVENTS=Je.EVENTS.filter(e=>!me(Je.EXCLUDED_INTERNAL_EVENTS,e)),Je.EVENT_CALLBACKS=Je.EVENTS.map(e=>Je.getCallbackForEvent(e)),Je.STRING_PROPERTIES=Xe.STRING_PROPERTIES,Je.OBJECT_PROPERTIES=Xe.OBJECT_PROPERTIES,Je.ARRAY_PROPERTIES=Xe.ARRAY_PROPERTIES,Je.NUMBER_PROPERTIES=Xe.NUMBER_PROPERTIES,Je.BOOLEAN_PROPERTIES=Xe.BOOLEAN_PROPERTIES,Je.FUNCTION_PROPERTIES=Xe.FUNCTION_PROPERTIES,Je.ALL_PROPERTIES=Xe.ALL_PROPERTIES,Je.ALL_PROPERTIES_SET=new Set(Xe.ALL_PROPERTIES),Je.changeSetId=0,Je.coercionLookup=Je.getCoercionLookup();var it=Object.freeze({__proto__:null,fuzzyCheckStrings:Ze,fuzzySuggestions:et}),st=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};function ot(e,t,i,s){const o=i?`Please use '${i}' instead. `:"";T(()=>console.warn(`AG Grid: since v${e}, '${t}' is deprecated. ${o}${null!=s?s:""}`),"Deprecated_"+t)}const rt=["__ob__","__v_skip","__metadata__"];let nt=class{constructor(){this.deprecatedProperties={rememberGroupStateWhenNewData:{version:"24",message:"Now that transaction updates are possible and they keep group state, this feature is no longer needed."},serverSideFilteringAlwaysResets:{version:"28.0",newProp:"serverSideOnlyRefreshFilteredGroups",copyToNewProp:!0},serverSideSortingAlwaysResets:{version:"28.0",newProp:"serverSideSortAllLevels",copyToNewProp:!0},suppressReactUi:{version:"28",message:"The legacy React rendering engine is deprecated and will be removed in the next major version of the grid."},processSecondaryColDef:{version:"28",newProp:"processPivotResultColDef",copyToNewProp:!0},processSecondaryColGroupDef:{version:"28",newProp:"processPivotResultColGroupDef",copyToNewProp:!0},getServerSideStoreParams:{version:"28",newProp:"getServerSideGroupLevelParams",copyToNewProp:!0},serverSideInfiniteScroll:{version:"29",message:"Infinite Scrolling is now the default behaviour. This can be suppressed with `suppressServerSideInfiniteScroll`."},enableChartToolPanelsButton:{version:"29",message:"The Chart Tool Panels button is now enabled by default. To hide the Chart Tool Panels button and display the hamburger button instead, set suppressChartToolPanelsButton=true."},functionsPassive:{version:"29.2"},onColumnRowGroupChangeRequest:{version:"29.2"},onColumnPivotChangeRequest:{version:"29.2"},onColumnValueChangeRequest:{version:"29.2"},onColumnAggFuncChangeRequest:{version:"29.2"},serverSideFilterAllLevels:{version:"30",message:"All server-side group levels are now filtered by default. This can be toggled using `serverSideOnlyRefreshFilteredGroups`."},suppressAggAtRootLevel:{version:"30",message:"The root level aggregation is now suppressed by default. This can be toggled using  `alwaysAggregateAtRootLevel`."},excludeHiddenColumnsFromQuickFilter:{version:"30",message:"Hidden columns are now excluded from the Quick Filter by default. This can be toggled using `includeHiddenColumnsInQuickFilter`."},enterMovesDown:{version:"30",newProp:"enterNavigatesVertically",copyToNewProp:!0},enterMovesDownAfterEdit:{version:"30",newProp:"enterNavigatesVerticallyAfterEdit",copyToNewProp:!0},suppressParentsInRowNodes:{version:"30.2",message:"Using suppressParentsInRowNodes is no longer recommended. To serialize nodes it is now recommended to instead remove the parent node reference before serialization."}}}pickOneWarning(e,t){console.warn(`AG Grid: ${e} and ${t} do not work with each other, you need to pick one.`)}init(){if(this.checkForDeprecated(),this.checkForViolations(),!0!==this.gridOptions.suppressPropertyNamesCheck&&(this.checkGridOptionsProperties(),this.checkColumnDefProperties()),this.checkColumnDefViolations(),this.gridOptionsService.is("groupSelectsChildren")&&this.gridOptionsService.is("suppressParentsInRowNodes")&&console.warn("AG Grid: 'groupSelectsChildren' does not work with 'suppressParentsInRowNodes', this selection method needs the part in rowNode to work"),this.gridOptionsService.is("groupSelectsChildren")&&"multiple"!==this.gridOptionsService.get("rowSelection")&&console.warn("AG Grid: rowSelection must be 'multiple' for groupSelectsChildren to make sense"),this.gridOptionsService.is("groupRemoveSingleChildren")&&this.gridOptionsService.is("groupHideOpenParents")&&this.pickOneWarning("groupRemoveSingleChildren","groupHideOpenParents"),this.gridOptionsService.isRowModelType("serverSide")){const e=(e,t)=>`AG Grid: '${e}' is not supported on the Server-Side Row Model.`+(t?` Please use ${t} instead.`:"");this.gridOptionsService.exists("groupDefaultExpanded")&&console.warn(e("groupDefaultExpanded","isServerSideGroupOpenByDefault callback")),this.gridOptionsService.exists("groupIncludeFooter")&&this.gridOptionsService.is("suppressServerSideInfiniteScroll")&&console.warn(e("groupIncludeFooter")),this.gridOptionsService.exists("groupIncludeTotalFooter")&&console.warn(e("groupIncludeTotalFooter"))}this.gridOptionsService.is("enableRangeSelection")?V.__assertRegistered(x.RangeSelectionModule,"enableRangeSelection",this.gridOptionsService.getGridId()):(this.gridOptionsService.is("enableRangeHandle")||this.gridOptionsService.is("enableFillHandle"))&&console.warn("AG Grid: 'enableRangeHandle' or 'enableFillHandle' will not work unless 'enableRangeSelection' is set to true");const e=(e,t)=>this.gridOptionsService.exists(e)&&V.__assertRegistered(t,e,this.gridOptionsService.getGridId());e("sideBar",x.SideBarModule),e("statusBar",x.StatusBarModule),e("enableCharts",x.GridChartsModule),e("getMainMenuItems",x.MenuModule),e("getContextMenuItems",x.MenuModule),e("allowContextMenuWithControlKey",x.MenuModule),e("enableAdvancedFilter",x.AdvancedFilterModule),e("treeData",x.RowGroupingModule),e("enableRangeSelection",x.RangeSelectionModule),e("masterDetail",x.MasterDetailModule)}checkColumnDefProperties(){if(null==this.gridOptions.columnDefs)return;const e=Qe.ALL_PROPERTIES,t=(i,s)=>{const o=Object.getOwnPropertyNames(i);this.checkProperties(o,[...e,...rt],e,s,"https://www.ag-grid.com/javascript-data-grid/column-properties/"),i.children&&i.children.forEach(e=>t(e,"columnDefs.children"))};this.gridOptions.columnDefs.forEach(e=>t(e,"columnDefs")),this.gridOptions.defaultColDef&&t(this.gridOptions.defaultColDef,"defaultColDef")}checkColumnDefViolations(){var e;const t=null!==(e=this.gridOptionsService.get("rowModelType"))&&void 0!==e?e:"clientSide",i={infinite:["headerCheckboxSelection","headerCheckboxSelectionFilteredOnly","headerCheckboxSelectionCurrentPageOnly"],viewport:["headerCheckboxSelection","headerCheckboxSelectionFilteredOnly","headerCheckboxSelectionCurrentPageOnly"],serverSide:["headerCheckboxSelectionFilteredOnly","headerCheckboxSelectionCurrentPageOnly"],clientSide:[]}[t];if(!i)return;const s="multiple"===this.gridOptionsService.get("rowSelection"),o=["headerCheckboxSelection","headerCheckboxSelectionFilteredOnly","headerCheckboxSelectionCurrentPageOnly"],r=e=>{s||o.forEach(t=>{t in e&&e[t]&&console.warn(`AG Grid: Column property ${t} is not supported unless rowSelection='multiple'.`)}),i.forEach(i=>{i in e&&e[i]&&console.warn(`AG Grid: Column property ${i} is not supported with the row model type ${t}.`)})};null!=this.gridOptions.columnDefs&&this.gridOptions.columnDefs.forEach(e=>r(e)),null!=this.gridOptions.autoGroupColumnDef&&r(this.gridOptions.autoGroupColumnDef),null!=this.gridOptions.defaultColDef&&r(this.gridOptions.defaultColDef)}checkGridOptionsProperties(){const e=Object.getOwnPropertyNames(this.gridOptions),t=[...Xe.ALL_PROPERTIES,...Je.EVENT_CALLBACKS],i=[...t,"api","columnApi",...rt,...Object.keys(this.deprecatedProperties)];this.checkProperties(e,i,t,"gridOptions","https://www.ag-grid.com/javascript-data-grid/grid-options/")}checkProperties(e,t,i,s,o){const r=Ze(e,t,i);h(r,(e,t)=>{T(()=>console.warn(`AG Grid: invalid ${s} property '${e}' did you mean any of these: ${t.slice(0,8).join(", ")}`),"invalidProperty"+s+e)}),Object.keys(r).length>0&&T(()=>console.warn(`AG Grid: to see all the valid ${s} properties please check: ${o}`),"invalidProperties"+s+o)}checkForDeprecated(){const e=this.gridOptions;Object.entries(this.deprecatedProperties).forEach(([t,i])=>{var s;const o=e[t];o&&(ot(i.version,t,i.newProp,i.message),i.copyToNewProp&&i.newProp&&null==e[i.newProp]&&(e[i.newProp]=null!==(s=i.newPropValue)&&void 0!==s?s:o))}),e.serverSideStoreType&&(console.warn("AG Grid: since v29.0, `serverSideStoreType` has been replaced by `suppressServerSideInfiniteScroll`. Set to false to use Partial Store, and true to use Full Store."),e.suppressServerSideInfiniteScroll="partial"!==e.serverSideStoreType)}checkForViolations(){this.gridOptionsService.is("treeData")&&this.treeDataViolations()}treeDataViolations(){this.gridOptionsService.isRowModelType("clientSide")&&(this.gridOptionsService.exists("getDataPath")||console.warn("AG Grid: property usingTreeData=true with rowModel=clientSide, but you did not provide getDataPath function, please provide getDataPath function if using tree data.")),this.gridOptionsService.isRowModelType("serverSide")&&(this.gridOptionsService.exists("isServerSideGroup")||console.warn("AG Grid: property usingTreeData=true with rowModel=serverSide, but you did not provide isServerSideGroup function, please provide isServerSideGroup function if using tree data."),this.gridOptionsService.exists("getServerSideGroupKey")||console.warn("AG Grid: property usingTreeData=true with rowModel=serverSide, but you did not provide getServerSideGroupKey function, please provide getServerSideGroupKey function if using tree data."))}};function lt(e,t){const i=["groupRows","multipleColumns","custom","singleColumn"];return i.indexOf(t)<0?(console.warn(`AG Grid: '${t}' is not a valid groupDisplayType value - possible values are: '${i.join("', '")}'`),!1):t===e}st([j("gridOptions")],nt.prototype,"gridOptions",void 0),st([j("gridOptionsService")],nt.prototype,"gridOptionsService",void 0),st([B],nt.prototype,"init",null),nt=st([U("gridOptionsValidator")],nt);var at=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},dt=function(e,t){return function(i,s){t(i,s,e)}},ht=function(e,t){var i={};for(var s in e)Object.prototype.hasOwnProperty.call(e,s)&&t.indexOf(s)<0&&(i[s]=e[s]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(s=Object.getOwnPropertySymbols(e);o<s.length;o++)t.indexOf(s[o])<0&&Object.prototype.propertyIsEnumerable.call(e,s[o])&&(i[s[o]]=e[s[o]])}return i};let ct=class extends Le{constructor(){super(...arguments),this.primaryHeaderRowCount=0,this.secondaryHeaderRowCount=0,this.gridHeaderRowCount=0,this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.displayedColumnsAndGroupsMap={},this.viewportColumns=[],this.viewportColumnsHash="",this.headerViewportColumns=[],this.viewportColumnsCenter=[],this.headerViewportColumnsCenter=[],this.autoHeightActiveAtLeastOnce=!1,this.rowGroupColumns=[],this.valueColumns=[],this.pivotColumns=[],this.ready=!1,this.autoGroupsNeedBuilding=!1,this.forceRecreateAutoGroups=!1,this.pivotMode=!1,this.bodyWidth=0,this.leftWidth=0,this.rightWidth=0,this.bodyWidthDirty=!0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}init(){this.suppressColumnVirtualisation=this.gridOptionsService.is("suppressColumnVirtualisation");const e=this.gridOptionsService.is("pivotMode");this.isPivotSettingAllowed(e)&&(this.pivotMode=e),this.addManagedPropertyListeners(["groupDisplayType","treeData"],()=>this.buildAutoGroupColumns()),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.onAutoGroupColumnDefChanged()),this.addManagedPropertyListener("defaultColDef",e=>this.onSharedColDefChanged(e.source)),this.addManagedPropertyListener("columnTypes",e=>this.onSharedColDefChanged(e.source))}buildAutoGroupColumns(){this.columnDefs&&(this.autoGroupsNeedBuilding=!0,this.forceRecreateAutoGroups=!0,this.updateGridColumns(),this.updateDisplayedColumns("gridOptionsChanged"))}onAutoGroupColumnDefChanged(){this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns)}onSharedColDefChanged(e="api"){this.groupAutoColumns&&this.autoGroupColService.updateAutoGroupColumns(this.groupAutoColumns),this.createColumnsFromColumnDefs(!0,e)}setColumnDefs(e,t="api"){const i=!!this.columnDefs;this.columnDefs=e,this.createColumnsFromColumnDefs(i,t)}recreateColumnDefs(e="api"){this.onSharedColDefChanged(e)}destroyOldColumns(e,t){const i={};if(!e)return;this.columnUtils.depthFirstOriginalTreeSearch(null,e,e=>{i[e.getInstanceId()]=e}),t&&this.columnUtils.depthFirstOriginalTreeSearch(null,t,e=>{i[e.getInstanceId()]=null});const s=Object.values(i).filter(e=>null!=e);this.destroyBeans(s)}destroyColumns(){this.destroyOldColumns(this.primaryColumnTree),this.destroyOldColumns(this.secondaryBalancedTree),this.destroyOldColumns(this.groupAutoColsBalancedTree)}createColumnsFromColumnDefs(e,t="api"){const i=e?this.compareColumnStatesAndDispatchEvents(t):void 0;this.valueCache.expire(),this.autoGroupsNeedBuilding=!0;const s=this.primaryColumns,o=this.primaryColumnTree,r=this.columnFactory.createColumnTree(this.columnDefs,!0,o);this.destroyOldColumns(this.primaryColumnTree,r.columnTree),this.primaryColumnTree=r.columnTree,this.primaryHeaderRowCount=r.treeDept+1,this.primaryColumns=this.getColumnsFromTree(this.primaryColumnTree),this.primaryColumnsMap={},this.primaryColumns.forEach(e=>this.primaryColumnsMap[e.getId()]=e),this.extractRowGroupColumns(t,s),this.extractPivotColumns(t,s),this.extractValueColumns(t,s),this.ready=!0;const n=void 0===this.gridColsArePrimary;(this.gridColsArePrimary||n||this.autoGroupsNeedBuilding)&&(this.updateGridColumns(),e&&this.gridColsArePrimary&&!this.gridOptionsService.is("maintainColumnOrder")&&this.orderGridColumnsLikePrimary(),this.updateDisplayedColumns(t),this.checkViewportColumns()),this.dispatchEverythingChanged(t),i&&i(),this.dispatchNewColumnsLoaded(t)}dispatchNewColumnsLoaded(e){const t={type:_e.EVENT_NEW_COLUMNS_LOADED,source:e};this.eventService.dispatchEvent(t)}dispatchEverythingChanged(e="api"){const t={type:_e.EVENT_COLUMN_EVERYTHING_CHANGED,source:e};this.eventService.dispatchEvent(t)}orderGridColumnsLikePrimary(){const e=this.primaryColumns;if(!e)return;const t=e.filter(e=>this.gridColumns.indexOf(e)>=0),i=this.gridColumns.filter(e=>t.indexOf(e)<0);this.gridColumns=[...i,...t],this.gridColumns=this.placeLockedColumns(this.gridColumns)}getAllDisplayedAutoHeightCols(){return this.displayedAutoHeightCols}setViewport(){this.gridOptionsService.is("enableRtl")?(this.viewportLeft=this.bodyWidth-this.scrollPosition-this.scrollWidth,this.viewportRight=this.bodyWidth-this.scrollPosition):(this.viewportLeft=this.scrollPosition,this.viewportRight=this.scrollWidth+this.scrollPosition)}getDisplayedColumnsStartingAt(e){let t=e;const i=[];for(;null!=t;)i.push(t),t=this.getDisplayedColAfter(t);return i}checkViewportColumns(e=!1){if(null==this.displayedColumnsCenter)return;if(!this.extractViewport())return;const t={type:_e.EVENT_VIRTUAL_COLUMNS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(t)}setViewportPosition(e,t,i=!1){(e!==this.scrollWidth||t!==this.scrollPosition||this.bodyWidthDirty)&&(this.scrollWidth=e,this.scrollPosition=t,this.bodyWidthDirty=!0,this.setViewport(),this.ready&&this.checkViewportColumns(i))}isPivotMode(){return this.pivotMode}isPivotSettingAllowed(e){return!e||!this.gridOptionsService.is("treeData")||(console.warn("AG Grid: Pivot mode not available in conjunction Tree Data i.e. 'gridOptions.treeData: true'"),!1)}setPivotMode(e,t="api"){if(e===this.pivotMode||!this.isPivotSettingAllowed(this.pivotMode))return;this.pivotMode=e,this.autoGroupsNeedBuilding=!0,this.updateGridColumns(),this.updateDisplayedColumns(t);const i={type:_e.EVENT_COLUMN_PIVOT_MODE_CHANGED};this.eventService.dispatchEvent(i)}getSecondaryPivotColumn(e,t){if(i(this.secondaryColumns))return null;const s=this.getPrimaryColumn(t);let o=null;return this.secondaryColumns.forEach(t=>{const i=t.getColDef().pivotKeys,r=t.getColDef().pivotValueColumn;le(i,e)&&r===s&&(o=t)}),o}setBeans(e){this.logger=e.create("columnModel")}setFirstRightAndLastLeftPinned(e){let t,i;this.gridOptionsService.is("enableRtl")?(t=this.displayedColumnsLeft?this.displayedColumnsLeft[0]:null,i=this.displayedColumnsRight?ne(this.displayedColumnsRight):null):(t=this.displayedColumnsLeft?ne(this.displayedColumnsLeft):null,i=this.displayedColumnsRight?this.displayedColumnsRight[0]:null),this.gridColumns.forEach(s=>{s.setLastLeftPinned(s===t,e),s.setFirstRightPinned(s===i,e)})}autoSizeColumns(e){if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.autoSizeColumns(e));const{columns:t,skipHeader:i,skipHeaderGroups:s,stopAtGroup:o,source:r="api"}=e;this.animationFrameService.flushAllFrames();const n=[];let l=-1;const a=null!=i?i:this.gridOptionsService.is("skipHeaderOnAutoSize"),d=null!=s?s:a;for(;0!==l;)l=0,this.actionOnGridColumns(t,e=>{if(n.indexOf(e)>=0)return!1;const t=this.autoWidthCalculator.getPreferredWidthForColumn(e,a);if(t>0){const i=this.normaliseColumnWidth(e,t);e.setActualWidth(i,r),n.push(e),l++}return!0},r);d||this.autoSizeColumnGroupsByColumns(t,r,o),this.dispatchColumnResizedEvent(n,!0,"autosizeColumns")}dispatchColumnResizedEvent(e,t,i,s=null){if(e&&e.length){const o={type:_e.EVENT_COLUMN_RESIZED,columns:e,column:1===e.length?e[0]:null,flexColumns:s,finished:t,source:i};this.eventService.dispatchEvent(o)}}dispatchColumnChangedEvent(e,t,i){const s={type:e,columns:t,column:t&&1==t.length?t[0]:null,source:i};this.eventService.dispatchEvent(s)}dispatchColumnMovedEvent(e){const{movedColumns:t,source:i,toIndex:s,finished:o}=e,r={type:_e.EVENT_COLUMN_MOVED,columns:t,column:t&&1===t.length?t[0]:null,toIndex:s,finished:o,source:i};this.eventService.dispatchEvent(r)}dispatchColumnPinnedEvent(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,s=this.getCommonValue(e,e=>e.getPinned()),o={type:_e.EVENT_COLUMN_PINNED,pinned:null!=s?s:null,columns:e,column:i,source:t};this.eventService.dispatchEvent(o)}dispatchColumnVisibleEvent(e,t){if(!e.length)return;const i=1===e.length?e[0]:null,s=this.getCommonValue(e,e=>e.isVisible()),o={type:_e.EVENT_COLUMN_VISIBLE,visible:s,columns:e,column:i,source:t};this.eventService.dispatchEvent(o)}autoSizeColumn(e,t,i="api"){e&&this.autoSizeColumns({columns:[e],skipHeader:t,skipHeaderGroups:!0,source:i})}autoSizeColumnGroupsByColumns(e,t,i){const s=new Set;let o;this.getGridColumns(e).forEach(e=>{let t=e.getParent();for(;t&&t!=i;)t.isPadding()||s.add(t),t=t.getParent()});for(const e of s){for(const t of this.ctrlsService.getHeaderRowContainerCtrls())if(o=t.getHeaderCtrlForColumn(e),o)break;o&&o.resizeLeafColumnsToFit(t)}return[]}autoSizeAllColumns(e,t="api"){if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.autoSizeAllColumns(e,t));const i=this.getAllDisplayedColumns();this.autoSizeColumns({columns:i,skipHeader:e,source:t})}getColumnsFromTree(e){const t=[],i=e=>{for(let s=0;s<e.length;s++){const o=e[s];o instanceof te?t.push(o):o instanceof se&&i(o.getChildren())}};return i(e),t}getAllDisplayedTrees(){return this.displayedTreeLeft&&this.displayedTreeRight&&this.displayedTreeCentre?this.displayedTreeLeft.concat(this.displayedTreeCentre).concat(this.displayedTreeRight):null}getPrimaryColumnTree(){return this.primaryColumnTree}getHeaderRowCount(){return this.gridHeaderRowCount}getDisplayedTreeLeft(){return this.displayedTreeLeft}getDisplayedTreeRight(){return this.displayedTreeRight}getDisplayedTreeCentre(){return this.displayedTreeCentre}isColumnDisplayed(e){return this.getAllDisplayedColumns().indexOf(e)>=0}getAllDisplayedColumns(){return this.displayedColumns}getViewportColumns(){return this.viewportColumns}getDisplayedLeftColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsLeft):this.displayedColumnsLeft}getDisplayedRightColumnsForRow(e){return this.colSpanActive?this.getDisplayedColumnsForRow(e,this.displayedColumnsRight):this.displayedColumnsRight}isColSpanActive(){return this.colSpanActive}getDisplayedColumnsForRow(e,t,i,s){const o=[];let r=null;for(let n=0;n<t.length;n++){const l=t[n],a=t.length-n,d=Math.min(l.getColSpan(e),a),h=[l];if(d>1){const e=d-1;for(let i=1;i<=e;i++)h.push(t[n+i]);n+=e}let c;if(i?(c=!1,h.forEach(e=>{i(e)&&(c=!0)})):c=!0,c){if(0===o.length&&r){!!s&&s(l)&&o.push(r)}o.push(l)}r=l}return o}getViewportCenterColumnsForRow(e){if(!this.colSpanActive)return this.viewportColumnsCenter;const i=this.suppressColumnVirtualisation?null:this.isColumnInRowViewport.bind(this);return this.getDisplayedColumnsForRow(e,this.displayedColumnsCenter,i,e=>{const i=e.getLeft();return t(i)&&i>this.viewportLeft})}getAriaColumnIndex(e){return this.getAllGridColumns().indexOf(e)+1}isColumnInHeaderViewport(e){return!!e.isAutoHeaderHeight()||this.isColumnInRowViewport(e)}isColumnInRowViewport(e){if(e.isAutoHeight())return!0;const t=e.getLeft()||0,i=t+e.getActualWidth(),s=this.viewportLeft-200,o=this.viewportRight+200;return!(t<s&&i<s)&&!(t>o&&i>o)}getDisplayedColumnsLeftWidth(){return this.getWidthOfColsInList(this.displayedColumnsLeft)}getDisplayedColumnsRightWidth(){return this.getWidthOfColsInList(this.displayedColumnsRight)}updatePrimaryColumnList(e,t,i,o,r,n="api"){if(!e||s(e))return;let l=!1;if(e.forEach(e=>{const s=this.getPrimaryColumn(e);if(s){if(i){if(t.indexOf(s)>=0)return;t.push(s)}else{if(t.indexOf(s)<0)return;he(t,s)}o(s),l=!0}}),!l)return;this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(n);const a={type:r,columns:t,column:1===t.length?t[0]:null,source:n};this.eventService.dispatchEvent(a)}setRowGroupColumns(e,t="api"){this.autoGroupsNeedBuilding=!0,this.setPrimaryColumnList(e,this.rowGroupColumns,_e.EVENT_COLUMN_ROW_GROUP_CHANGED,!0,this.setRowGroupActive.bind(this),t)}setRowGroupActive(e,t,i){e!==t.isRowGroupActive()&&(t.setRowGroupActive(e,i),e&&!this.gridOptionsService.is("suppressRowGroupHidesColumns")&&this.setColumnVisible(t,!1,i),e||this.gridOptionsService.is("suppressMakeColumnVisibleAfterUnGroup")||this.setColumnVisible(t,!0,i))}addRowGroupColumn(e,t="api"){e&&this.addRowGroupColumns([e],t)}addRowGroupColumns(e,t="api"){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!0,this.setRowGroupActive.bind(this,!0),_e.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}removeRowGroupColumns(e,t="api"){this.autoGroupsNeedBuilding=!0,this.updatePrimaryColumnList(e,this.rowGroupColumns,!1,this.setRowGroupActive.bind(this,!1),_e.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}removeRowGroupColumn(e,t="api"){e&&this.removeRowGroupColumns([e],t)}addPivotColumns(e,t="api"){this.updatePrimaryColumnList(e,this.pivotColumns,!0,e=>e.setPivotActive(!0,t),_e.EVENT_COLUMN_PIVOT_CHANGED,t)}setPivotColumns(e,t="api"){this.setPrimaryColumnList(e,this.pivotColumns,_e.EVENT_COLUMN_PIVOT_CHANGED,!0,(e,i)=>{i.setPivotActive(e,t)},t)}addPivotColumn(e,t="api"){this.addPivotColumns([e],t)}removePivotColumns(e,t="api"){this.updatePrimaryColumnList(e,this.pivotColumns,!1,e=>e.setPivotActive(!1,t),_e.EVENT_COLUMN_PIVOT_CHANGED,t)}removePivotColumn(e,t="api"){this.removePivotColumns([e],t)}setPrimaryColumnList(e,i,s,o,r,n){const l=new Map;i.forEach((e,t)=>l.set(e,t)),i.length=0,t(e)&&e.forEach(e=>{const t=this.getPrimaryColumn(e);t&&i.push(t)}),i.forEach((e,t)=>{const i=l.get(e);void 0!==i?o&&i!==t||l.delete(e):l.set(e,0)}),(this.primaryColumns||[]).forEach(e=>{const t=i.indexOf(e)>=0;r(t,e)}),this.autoGroupsNeedBuilding&&this.updateGridColumns(),this.updateDisplayedColumns(n),this.dispatchColumnChangedEvent(s,[...l.keys()],n)}setValueColumns(e,t="api"){this.setPrimaryColumnList(e,this.valueColumns,_e.EVENT_COLUMN_VALUE_CHANGED,!1,this.setValueActive.bind(this),t)}setValueActive(e,t,i){if(e!==t.isValueActive()&&(t.setValueActive(e,i),e&&!t.getAggFunc())){const e=this.aggFuncService.getDefaultAggFunc(t);t.setAggFunc(e)}}addValueColumns(e,t="api"){this.updatePrimaryColumnList(e,this.valueColumns,!0,this.setValueActive.bind(this,!0),_e.EVENT_COLUMN_VALUE_CHANGED,t)}addValueColumn(e,t="api"){e&&this.addValueColumns([e],t)}removeValueColumn(e,t="api"){this.removeValueColumns([e],t)}removeValueColumns(e,t="api"){this.updatePrimaryColumnList(e,this.valueColumns,!1,this.setValueActive.bind(this,!1),_e.EVENT_COLUMN_VALUE_CHANGED,t)}normaliseColumnWidth(e,i){const s=e.getMinWidth();t(s)&&i<s&&(i=s);const o=e.getMaxWidth();return t(o)&&e.isGreaterThanMax(i)&&(i=o),i}getPrimaryOrGridColumn(e){return this.getPrimaryColumn(e)||this.getGridColumn(e)}setColumnWidths(e,t,i,s="api"){const o=[];e.forEach(e=>{const i=this.getPrimaryOrGridColumn(e.key);if(!i)return;o.push({width:e.newWidth,ratios:[1],columns:[i]});if("shift"===this.gridOptionsService.get("colResizeDefault")&&(t=!t),t){const t=this.getDisplayedColAfter(i);if(!t)return;const s=i.getActualWidth()-e.newWidth,r=t.getActualWidth()+s;o.push({width:r,ratios:[1],columns:[t]})}}),0!==o.length&&this.resizeColumnSets({resizeSets:o,finished:i,source:s})}checkMinAndMaxWidthsForSet(e){const{columns:i,width:s}=e;let o=0,r=0,n=!0;i.forEach(e=>{const i=e.getMinWidth();o+=i||0;const s=e.getMaxWidth();t(s)&&s>0?r+=s:n=!1});return s>=o&&(!n||s<=r)}resizeColumnSets(e){const{resizeSets:i,finished:s,source:o}=e;if(!(!i||i.every(e=>this.checkMinAndMaxWidthsForSet(e)))){if(s){const e=i&&i.length>0?i[0].columns:null;this.dispatchColumnResizedEvent(e,s,o)}return}const r=[],n=[];i.forEach(e=>{const{width:i,columns:s,ratios:l}=e,a={},d={};s.forEach(e=>n.push(e));let h=!0,c=0;for(;h;){if(c++,c>1e3){console.error("AG Grid: infinite loop in resizeColumnSets");break}h=!1;const e=[];let o=0,r=i;s.forEach((t,i)=>{if(d[t.getId()])r-=a[t.getId()];else{e.push(t);const s=l[i];o+=s}});const n=1/o;e.forEach((s,o)=>{let c;o===e.length-1?c=r:(c=Math.round(l[o]*i*n),r-=c);const u=s.getMinWidth(),p=s.getMaxWidth();t(u)&&c<u?(c=u,d[s.getId()]=!0,h=!0):t(p)&&p>0&&c>p&&(c=p,d[s.getId()]=!0,h=!0),a[s.getId()]=c})}s.forEach(e=>{const t=a[e.getId()];e.getActualWidth()!==t&&(e.setActualWidth(t,o),r.push(e))})});const l=r.length>0;let a=[];l&&(a=this.refreshFlexedColumns({resizingCols:n,skipSetLeft:!0}),this.setLeftValues(o),this.updateBodyWidths(),this.checkViewportColumns());const d=n.concat(a);(l||s)&&this.dispatchColumnResizedEvent(d,s,o,a)}setColumnAggFunc(e,t,i="api"){if(!e)return;const s=this.getPrimaryColumn(e);s&&(s.setAggFunc(t),this.dispatchColumnChangedEvent(_e.EVENT_COLUMN_VALUE_CHANGED,[s],i))}moveRowGroupColumn(e,t,i="api"){const s=this.rowGroupColumns[e],o=this.rowGroupColumns.slice(e,t);this.rowGroupColumns.splice(e,1),this.rowGroupColumns.splice(t,0,s);const r={type:_e.EVENT_COLUMN_ROW_GROUP_CHANGED,columns:o,column:1===o.length?o[0]:null,source:i};this.eventService.dispatchEvent(r)}moveColumns(e,t,i="api",s=!0){if(this.columnAnimationService.start(),t>this.gridColumns.length-e.length)return console.warn("AG Grid: tried to insert columns in invalid location, toIndex = "+t),void console.warn("AG Grid: remember that you should not count the moving columns when calculating the new index");const o=this.getGridColumns(e);!this.doesMovePassRules(o,t)||(ge(this.gridColumns,o,t),this.updateDisplayedColumns(i),this.dispatchColumnMovedEvent({movedColumns:o,source:i,toIndex:t,finished:s}),this.columnAnimationService.finish())}doesMovePassRules(e,t){const i=this.getProposedColumnOrder(e,t);return this.doesOrderPassRules(i)}doesOrderPassRules(e){return!!this.doesMovePassMarryChildren(e)&&!!this.doesMovePassLockedPositions(e)}getProposedColumnOrder(e,t){const i=this.gridColumns.slice();return ge(i,e,t),i}sortColumnsLikeGridColumns(e){if(!e||e.length<=1)return;e.filter(e=>this.gridColumns.indexOf(e)<0).length>0||e.sort((e,t)=>this.gridColumns.indexOf(e)-this.gridColumns.indexOf(t))}doesMovePassLockedPositions(e){let t=0,i=!0;return e.forEach(e=>{const s=(o=e.getColDef().lockPosition)?!0===o||"left"===o?0:2:1;var o;s<t&&(i=!1),t=s}),i}doesMovePassMarryChildren(e){let t=!0;return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,i=>{if(!(i instanceof se))return;const s=i,o=s.getColGroupDef();if(!(o&&o.marryChildren))return;const r=[];s.getLeafColumns().forEach(t=>{const i=e.indexOf(t);r.push(i)});Math.max.apply(Math,r)-Math.min.apply(Math,r)>s.getLeafColumns().length-1&&(t=!1)}),t}moveColumn(e,t,i="api"){this.moveColumns([e],t,i)}moveColumnByIndex(e,t,i="api"){const s=this.gridColumns[e];this.moveColumn(s,t,i)}getColumnDefs(){if(!this.primaryColumns)return;const e=this.primaryColumns.slice();return this.gridColsArePrimary?e.sort((e,t)=>this.gridColumns.indexOf(e)-this.gridColumns.indexOf(t)):this.lastPrimaryOrder&&e.sort((e,t)=>this.lastPrimaryOrder.indexOf(e)-this.lastPrimaryOrder.indexOf(t)),this.columnDefFactory.buildColumnDefs(e,this.rowGroupColumns,this.pivotColumns)}getBodyContainerWidth(){return this.bodyWidth}getContainerWidth(e){switch(e){case"left":return this.leftWidth;case"right":return this.rightWidth;default:return this.bodyWidth}}updateBodyWidths(){const e=this.getWidthOfColsInList(this.displayedColumnsCenter),t=this.getWidthOfColsInList(this.displayedColumnsLeft),i=this.getWidthOfColsInList(this.displayedColumnsRight);this.bodyWidthDirty=this.bodyWidth!==e;if(this.bodyWidth!==e||this.leftWidth!==t||this.rightWidth!==i){this.bodyWidth=e,this.leftWidth=t,this.rightWidth=i;const s={type:_e.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED};this.eventService.dispatchEvent(s)}}getValueColumns(){return this.valueColumns?this.valueColumns:[]}getPivotColumns(){return this.pivotColumns?this.pivotColumns:[]}isPivotActive(){return this.pivotColumns&&this.pivotColumns.length>0&&this.pivotMode}getRowGroupColumns(){return this.rowGroupColumns?this.rowGroupColumns:[]}getDisplayedCenterColumns(){return this.displayedColumnsCenter}getDisplayedLeftColumns(){return this.displayedColumnsLeft}getDisplayedRightColumns(){return this.displayedColumnsRight}getDisplayedColumns(e){switch(e){case"left":return this.getDisplayedLeftColumns();case"right":return this.getDisplayedRightColumns();default:return this.getDisplayedCenterColumns()}}getAllPrimaryColumns(){return this.primaryColumns?this.primaryColumns.slice():null}getSecondaryColumns(){return this.secondaryColumns?this.secondaryColumns.slice():null}getAllColumnsForQuickFilter(){return this.columnsForQuickFilter}getAllGridColumns(){return this.gridColumns}isEmpty(){return s(this.gridColumns)}isRowGroupEmpty(){return s(this.rowGroupColumns)}setColumnVisible(e,t,i="api"){this.setColumnsVisible([e],t,i)}setColumnsVisible(e,t=!1,i="api"){this.applyColumnState({state:e.map(e=>({colId:"string"==typeof e?e:e.getColId(),hide:!t}))},i)}setColumnPinned(e,t,i="api"){e&&this.setColumnsPinned([e],t,i)}setColumnsPinned(e,t,i="api"){if(this.gridOptionsService.isDomLayout("print"))return void console.warn("AG Grid: Changing the column pinning status is not allowed with domLayout='print'");let s;this.columnAnimationService.start(),s=!0===t||"left"===t?"left":"right"===t?"right":null,this.actionOnGridColumns(e,e=>e.getPinned()!==s&&(e.setPinned(s),!0),i,()=>({type:_e.EVENT_COLUMN_PINNED,pinned:s,column:null,columns:null,source:i})),this.columnAnimationService.finish()}actionOnGridColumns(e,i,o,r){if(s(e))return;const n=[];if(e.forEach(e=>{const t=this.getGridColumn(e);if(!t)return;!1!==i(t)&&n.push(t)}),n.length&&(this.updateDisplayedColumns(o),t(r)&&r)){const e=r();e.columns=n,e.column=1===n.length?n[0]:null,this.eventService.dispatchEvent(e)}}getDisplayedColBefore(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i>0?t[i-1]:null}getDisplayedColAfter(e){const t=this.getAllDisplayedColumns(),i=t.indexOf(e);return i<t.length-1?t[i+1]:null}getDisplayedGroupAfter(e){return this.getDisplayedGroupAtDirection(e,"After")}getDisplayedGroupBefore(e){return this.getDisplayedGroupAtDirection(e,"Before")}getDisplayedGroupAtDirection(e,t){const i=e.getProvidedColumnGroup().getLevel()+e.getPaddingLevel(),s=e.getDisplayedLeafColumns(),o="After"===t?ne(s):s[0],r="getDisplayedCol"+t;for(;;){const t=this[r](o);if(!t)return null;const s=this.getColumnGroupAtLevel(t,i);if(s!==e)return s}}getColumnGroupAtLevel(e,t){let i,s,o=e.getParent();for(;;){if(i=o.getProvidedColumnGroup().getLevel(),s=o.getPaddingLevel(),i+s<=t)break;o=o.getParent()}return o}isPinningLeft(){return this.displayedColumnsLeft.length>0}isPinningRight(){return this.displayedColumnsRight.length>0}getPrimaryAndSecondaryAndAutoColumns(){return[].concat(this.primaryColumns||[],this.groupAutoColumns||[],this.secondaryColumns||[])}createStateItemFromColumn(e){const t=e.isRowGroupActive()?this.rowGroupColumns.indexOf(e):null,i=e.isPivotActive()?this.pivotColumns.indexOf(e):null,s=e.isValueActive()?e.getAggFunc():null,o=null!=e.getSort()?e.getSort():null,r=null!=e.getSortIndex()?e.getSortIndex():null,n=null!=e.getFlex()&&e.getFlex()>0?e.getFlex():null;return{colId:e.getColId(),width:e.getActualWidth(),hide:!e.isVisible(),pinned:e.getPinned(),sort:o,sortIndex:r,aggFunc:s,rowGroup:e.isRowGroupActive(),rowGroupIndex:t,pivot:e.isPivotActive(),pivotIndex:i,flex:n}}getColumnState(){if(i(this.primaryColumns)||!this.isAlive())return[];const e=this.getPrimaryAndSecondaryAndAutoColumns().map(this.createStateItemFromColumn.bind(this));return this.orderColumnStateList(e),e}orderColumnStateList(e){const t=$e(this.gridColumns.map((e,t)=>[e.getColId(),t]));e.sort((e,i)=>(t.has(e.colId)?t.get(e.colId):-1)-(t.has(i.colId)?t.get(i.colId):-1))}resetColumnState(e="api"){const t=this.getColumnsFromTree(this.primaryColumnTree),s=[];let o=1e3,r=1e3,n=[];this.groupAutoColumns&&(n=n.concat(this.groupAutoColumns)),t&&(n=n.concat(t)),n.forEach(e=>{const t=this.getColumnStateFromColDef(e);i(t.rowGroupIndex)&&t.rowGroup&&(t.rowGroupIndex=o++),i(t.pivotIndex)&&t.pivot&&(t.pivotIndex=r++),s.push(t)}),this.applyColumnState({state:s,applyOrder:!0},e)}getColumnStateFromColDef(e){const t=(e,t)=>null!=e?e:null!=t?t:null,i=e.getColDef(),s=t(i.sort,i.initialSort),o=t(i.sortIndex,i.initialSortIndex),r=t(i.hide,i.initialHide),n=t(i.pinned,i.initialPinned),l=t(i.width,i.initialWidth),a=t(i.flex,i.initialFlex);let d=t(i.rowGroupIndex,i.initialRowGroupIndex),h=t(i.rowGroup,i.initialRowGroup);null!=d||null!=h&&0!=h||(d=null,h=null);let c=t(i.pivotIndex,i.initialPivotIndex),u=t(i.pivot,i.initialPivot);null!=c||null!=u&&0!=u||(c=null,u=null);const p=t(i.aggFunc,i.initialAggFunc);return{colId:e.getColId(),sort:s,sortIndex:o,hide:r,pinned:n,width:l,flex:a,rowGroup:h,rowGroupIndex:d,pivot:u,pivotIndex:c,aggFunc:p}}applyColumnState(e,i){if(s(this.primaryColumns))return!1;if(e&&e.state&&!e.state.forEach)return console.warn("AG Grid: applyColumnState() - the state attribute should be an array, however an array was not found. Please provide an array of items (one for each col you want to change) for state."),!1;const o=(t,s,o)=>{const r=this.compareColumnStatesAndDispatchEvents(i);this.autoGroupsNeedBuilding=!0;const n=s.slice(),l={},a={},d=[],h=[];let c=0;const u=this.rowGroupColumns.slice(),p=this.pivotColumns.slice();t.forEach(t=>{const s=t.colId||"";if(s.startsWith("ag-Grid-AutoColumn"))return d.push(t),void h.push(t);const r=o(s);r?(this.syncColumnWithStateItem(r,t,e.defaultState,l,a,!1,i),he(n,r)):(h.push(t),c+=1)});const g=t=>this.syncColumnWithStateItem(t,null,e.defaultState,l,a,!1,i);n.forEach(g);const m=(e,t,i,s)=>{const o=e[i.getId()],r=e[s.getId()],n=null!=o,l=null!=r;if(n&&l)return o-r;if(n)return-1;if(l)return 1;const a=t.indexOf(i),d=t.indexOf(s),h=a>=0;return h&&d>=0?a-d:h?-1:1};this.rowGroupColumns.sort(m.bind(this,l,u)),this.pivotColumns.sort(m.bind(this,a,p)),this.updateGridColumns();const C=this.groupAutoColumns?this.groupAutoColumns.slice():[];return d.forEach(t=>{const s=this.getAutoColumn(t.colId);he(C,s),this.syncColumnWithStateItem(s,t,e.defaultState,null,null,!0,i)}),C.forEach(g),this.applyOrderAfterApplyState(e),this.updateDisplayedColumns(i),this.dispatchEverythingChanged(i),r(),{unmatchedAndAutoStates:h,unmatchedCount:c}};this.columnAnimationService.start();let{unmatchedAndAutoStates:r,unmatchedCount:n}=o(e.state||[],this.primaryColumns||[],e=>this.getPrimaryColumn(e));return(r.length>0||t(e.defaultState))&&(n=o(r,this.secondaryColumns||[],e=>this.getSecondaryColumn(e)).unmatchedCount),this.columnAnimationService.finish(),0===n}applyOrderAfterApplyState(e){if(!e.applyOrder||!e.state)return;let t=[];const i={};e.state.forEach(e=>{if(!e.colId||i[e.colId])return;const s=this.gridColumnsMap[e.colId];s&&(t.push(s),i[e.colId]=!0)});let s=0;this.gridColumns.forEach(e=>{const o=e.getColId();if(null!=i[o])return;o.startsWith("ag-Grid-AutoColumn")?pe(t,e,s++):t.push(e)}),t=this.placeLockedColumns(t),this.doesMovePassMarryChildren(t)?this.gridColumns=t:console.warn("AG Grid: Applying column order broke a group where columns should be married together. Applying new order has been discarded.")}compareColumnStatesAndDispatchEvents(e){const t={rowGroupColumns:this.rowGroupColumns.slice(),pivotColumns:this.pivotColumns.slice(),valueColumns:this.valueColumns.slice()},i=this.getColumnState(),s={};return i.forEach(e=>{s[e.colId]=e}),()=>{const o=this.getPrimaryAndSecondaryAndAutoColumns(),r=(t,i,s,o)=>{if(le(i.map(o),s.map(o)))return;const r=new Set(i);s.forEach(e=>{r.delete(e)||r.add(e)});const n=[...r],l={type:t,columns:n,column:1===n.length?n[0]:null,source:e};this.eventService.dispatchEvent(l)},n=e=>{const t=[];return o.forEach(i=>{const o=s[i.getColId()];o&&e(o,i)&&t.push(i)}),t},l=e=>e.getColId();r(_e.EVENT_COLUMN_ROW_GROUP_CHANGED,t.rowGroupColumns,this.rowGroupColumns,l),r(_e.EVENT_COLUMN_PIVOT_CHANGED,t.pivotColumns,this.pivotColumns,l);const a=n((e,t)=>{const i=null!=e.aggFunc,s=i!=t.isValueActive(),o=i&&e.aggFunc!=t.getAggFunc();return s||o});a.length>0&&this.dispatchColumnChangedEvent(_e.EVENT_COLUMN_VALUE_CHANGED,a,e);this.dispatchColumnResizedEvent(n((e,t)=>e.width!=t.getActualWidth()),!0,e);this.dispatchColumnPinnedEvent(n((e,t)=>e.pinned!=t.getPinned()),e);this.dispatchColumnVisibleEvent(n((e,t)=>e.hide==t.isVisible()),e);n((e,t)=>e.sort!=t.getSort()||e.sortIndex!=t.getSortIndex()).length>0&&this.sortController.dispatchSortChangedEvents(e),this.normaliseColumnMovedEventForColumnState(i,e)}}getCommonValue(e,t){if(!e||0==e.length)return;const i=t(e[0]);for(let s=1;s<e.length;s++)if(i!==t(e[s]))return;return i}normaliseColumnMovedEventForColumnState(e,t){const i=this.getColumnState(),s={};i.forEach(e=>s[e.colId]=e);const o={};e.forEach(e=>{s[e.colId]&&(o[e.colId]=!0)});const r=e.filter(e=>o[e.colId]),n=i.filter(e=>o[e.colId]),l=[];n.forEach((e,t)=>{const i=r&&r[t];if(i&&i.colId!==e.colId){const e=this.getGridColumn(i.colId);e&&l.push(e)}}),l.length&&this.dispatchColumnMovedEvent({movedColumns:l,source:t,finished:!0})}syncColumnWithStateItem(e,i,s,o,r,n,l){if(!e)return;const a=(e,o)=>{const r={value1:void 0,value2:void 0};let n=!1;return i&&(void 0!==i[e]&&(r.value1=i[e],n=!0),t(o)&&void 0!==i[o]&&(r.value2=i[o],n=!0)),!n&&s&&(void 0!==s[e]&&(r.value1=s[e]),t(o)&&void 0!==s[o]&&(r.value2=s[o])),r},d=a("hide").value1;void 0!==d&&e.setVisible(!d,l);const h=a("pinned").value1;void 0!==h&&e.setPinned(h);const c=this.columnUtils.calculateColMinWidth(e.getColDef()),u=a("flex").value1;void 0!==u&&e.setFlex(u);if(e.getFlex()<=0){const t=a("width").value1;null!=t&&null!=c&&t>=c&&e.setActualWidth(t,l)}const p=a("sort").value1;void 0!==p&&("desc"===p||"asc"===p?e.setSort(p,l):e.setSort(void 0,l));const g=a("sortIndex").value1;if(void 0!==g&&e.setSortIndex(g),n||!e.isPrimary())return;const m=a("aggFunc").value1;void 0!==m&&("string"==typeof m?(e.setAggFunc(m),e.isValueActive()||(e.setValueActive(!0,l),this.valueColumns.push(e))):(t(m)&&console.warn("AG Grid: stateItem.aggFunc must be a string. if using your own aggregation functions, register the functions first before using them in get/set state. This is because it is intended for the column state to be stored and retrieved as simple JSON."),e.isValueActive()&&(e.setValueActive(!1,l),he(this.valueColumns,e))));const{value1:C,value2:v}=a("rowGroup","rowGroupIndex");void 0===C&&void 0===v||("number"==typeof v||C?(e.isRowGroupActive()||(e.setRowGroupActive(!0,l),this.rowGroupColumns.push(e)),o&&"number"==typeof v&&(o[e.getId()]=v)):e.isRowGroupActive()&&(e.setRowGroupActive(!1,l),he(this.rowGroupColumns,e)));const{value1:f,value2:w}=a("pivot","pivotIndex");void 0===f&&void 0===w||("number"==typeof w||f?(e.isPivotActive()||(e.setPivotActive(!0,l),this.pivotColumns.push(e)),r&&"number"==typeof w&&(r[e.getId()]=w)):e.isPivotActive()&&(e.setPivotActive(!1,l),he(this.pivotColumns,e)))}getGridColumns(e){return this.getColumns(e,this.getGridColumn.bind(this))}getColumns(e,t){const i=[];return e&&e.forEach(e=>{const s=t(e);s&&i.push(s)}),i}getColumnWithValidation(e){if(null==e)return null;const t=this.getGridColumn(e);return t||console.warn("AG Grid: could not find column "+e),t}getPrimaryColumn(e){return this.primaryColumns?this.getColumn(e,this.primaryColumns,this.primaryColumnsMap):null}getGridColumn(e){return this.getColumn(e,this.gridColumns,this.gridColumnsMap)}lookupGridColumn(e){return this.gridColumnsMap[e]}getSecondaryColumn(e){return this.secondaryColumns?this.getColumn(e,this.secondaryColumns,this.secondaryColumnsMap):null}getColumn(e,t,i){if(!e)return null;if("string"==typeof e&&i[e])return i[e];for(let i=0;i<t.length;i++)if(this.columnsMatch(t[i],e))return t[i];return this.getAutoColumn(e)}getSourceColumnsForGroupColumn(e){const t=e.getColDef().showRowGroup;if(!t)return null;if(!0===t)return this.rowGroupColumns.slice(0);const i=this.getPrimaryColumn(t);return i?[i]:null}getAutoColumn(e){return this.groupAutoColumns&&t(this.groupAutoColumns)&&!i(this.groupAutoColumns)&&this.groupAutoColumns.find(t=>this.columnsMatch(t,e))||null}columnsMatch(e,t){const i=e===t,s=e.getColDef()===t,o=e.getColId()==t;return i||s||o}getDisplayNameForColumn(e,t,i=!1){if(!e)return null;const s=this.getHeaderName(e.getColDef(),e,null,null,t);return i?this.wrapHeaderNameWithAggFunc(e,s):s}getDisplayNameForProvidedColumnGroup(e,t,i){const s=t?t.getColGroupDef():null;return s?this.getHeaderName(s,null,e,t,i):null}getDisplayNameForColumnGroup(e,t){return this.getDisplayNameForProvidedColumnGroup(e,e.getProvidedColumnGroup(),t)}getHeaderName(e,t,i,s,o){const r=e.headerValueGetter;if(r){const n={colDef:e,column:t,columnGroup:i,providedColumnGroup:s,location:o,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context};return"function"==typeof r?r(n):"string"==typeof r?this.expressionService.evaluate(r,n):(console.warn("AG Grid: headerValueGetter must be a function or a string"),"")}return null!=e.headerName?e.headerName:e.field?ze(e.field):""}wrapHeaderNameWithAggFunc(e,i){if(this.gridOptionsService.is("suppressAggFuncInHeader"))return i;const s=e.getColDef().pivotValueColumn;let o,r=null;if(t(s)){const t=this.gridOptionsService.is("removePivotHeaderRowWhenSingleValueColumn")&&1===this.valueColumns.length,n=void 0!==e.getColDef().pivotTotalColumnIds;if(t&&!n)return i;r=s?s.getAggFunc():null,o=!0}else{const t=e.isValueActive(),i=this.pivotMode||!this.isRowGroupEmpty();t&&i?(r=e.getAggFunc(),o=!0):o=!1}if(o){const e="string"==typeof r?r:"func";return`${this.localeService.getLocaleTextFunc()(e,e)}(${i})`}return i}getColumnGroup(e,t){if(!e)return null;if(e instanceof xe)return e;const i=this.getAllDisplayedTrees(),s="number"==typeof t;let o=null;return this.columnUtils.depthFirstAllColumnTreeSearch(i,i=>{if(i instanceof xe){const r=i;let n;n=s?e===r.getGroupId()&&t===r.getPartId():e===r.getGroupId(),n&&(o=r)}}),o}isReady(){return this.ready}extractValueColumns(e,t){this.valueColumns=this.extractColumns(t,this.valueColumns,(t,i)=>t.setValueActive(i,e),()=>{},()=>{},e=>{const t=e.aggFunc;return null===t||""===t?null:void 0!==t?!!t:void 0},e=>null!=e.initialAggFunc&&""!=e.initialAggFunc),this.valueColumns.forEach(e=>{const t=e.getColDef();null!=t.aggFunc&&""!=t.aggFunc?e.setAggFunc(t.aggFunc):e.getAggFunc()||e.setAggFunc(t.initialAggFunc)})}extractRowGroupColumns(e,t){this.rowGroupColumns=this.extractColumns(t,this.rowGroupColumns,(t,i)=>t.setRowGroupActive(i,e),e=>e.rowGroupIndex,e=>e.initialRowGroupIndex,e=>e.rowGroup,e=>e.initialRowGroup)}extractColumns(e=[],t=[],i,s,o,l,a){const d=[],h=[];(this.primaryColumns||[]).forEach(i=>{const c=e.indexOf(i)<0,u=i.getColDef(),p=n(l(u)),g=n(a(u)),m=r(s(u)),C=r(o(u));let v;if(v=void 0!==p?p:void 0!==m?null!==m&&m>=0:c?void 0!==g?g:!!(void 0!==C)&&(null!=C&&C>=0):t.indexOf(i)>=0,v){(c?null!=m||null!=C:null!=m)?d.push(i):h.push(i)}});const c=e=>{const t=s(e.getColDef()),i=o(e.getColDef());return null!=t?t:i};d.sort((e,t)=>{const i=c(e),s=c(t);return i===s?0:i<s?-1:1});const u=[].concat(d);return t.forEach(e=>{h.indexOf(e)>=0&&u.push(e)}),h.forEach(e=>{u.indexOf(e)<0&&u.push(e)}),t.forEach(e=>{u.indexOf(e)<0&&i(e,!1)}),u.forEach(e=>{t.indexOf(e)<0&&i(e,!0)}),u}extractPivotColumns(e,t){this.pivotColumns=this.extractColumns(t,this.pivotColumns,(t,i)=>t.setPivotActive(i,e),e=>e.pivotIndex,e=>e.initialPivotIndex,e=>e.pivot,e=>e.initialPivot)}resetColumnGroupState(e="api"){const t=[];this.columnUtils.depthFirstOriginalTreeSearch(null,this.primaryColumnTree,e=>{if(e instanceof se){const i=e.getColGroupDef(),s={groupId:e.getGroupId(),open:i?i.openByDefault:void 0};t.push(s)}}),this.setColumnGroupState(t,e)}getColumnGroupState(){const e=[];return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,t=>{t instanceof se&&e.push({groupId:t.getGroupId(),open:t.isExpanded()})}),e}setColumnGroupState(e,t="api"){this.columnAnimationService.start();const i=[];e.forEach(e=>{const t=e.groupId,s=e.open,o=this.getProvidedColumnGroup(t);o&&o.isExpanded()!==s&&(this.logger.log("columnGroupOpened("+o.getGroupId()+","+s+")"),o.setExpanded(s),i.push(o))}),this.updateGroupsAndDisplayedColumns(t),this.setFirstRightAndLastLeftPinned(t),i.forEach(e=>{const t={type:_e.EVENT_COLUMN_GROUP_OPENED,columnGroup:e};this.eventService.dispatchEvent(t)}),this.columnAnimationService.finish()}setColumnGroupOpened(e,t,i="api"){let s;s=e instanceof se?e.getId():e||"",this.setColumnGroupState([{groupId:s,open:t}],i)}getProvidedColumnGroup(e){"string"!=typeof e&&console.error("AG Grid: group key must be a string");let t=null;return this.columnUtils.depthFirstOriginalTreeSearch(null,this.gridBalancedTree,i=>{i instanceof se&&i.getId()===e&&(t=i)}),t}calculateColumnsForDisplay(){let e;return e=this.pivotMode&&i(this.secondaryColumns)?this.gridColumns.filter(e=>{const t=this.groupAutoColumns&&me(this.groupAutoColumns,e),i=this.valueColumns&&me(this.valueColumns,e);return t||i}):this.gridColumns.filter(e=>this.groupAutoColumns&&me(this.groupAutoColumns,e)||e.isVisible()),e}checkColSpanActiveInCols(e){let i=!1;return e.forEach(e=>{t(e.getColDef().colSpan)&&(i=!0)}),i}calculateColumnsForGroupDisplay(){this.groupDisplayColumns=[],this.groupDisplayColumnsMap={};this.gridColumns.forEach(e=>{const i=e.getColDef(),s=i.showRowGroup;i&&t(s)&&(this.groupDisplayColumns.push(e),"string"==typeof s?this.groupDisplayColumnsMap[s]=e:!0===s&&this.getRowGroupColumns().forEach(t=>{this.groupDisplayColumnsMap[t.getId()]=e}))})}getGroupDisplayColumns(){return this.groupDisplayColumns}getGroupDisplayColumnForGroup(e){return this.groupDisplayColumnsMap[e]}updateDisplayedColumns(e){const t=this.calculateColumnsForDisplay();this.buildDisplayedTrees(t),this.updateGroupsAndDisplayedColumns(e),this.setFirstRightAndLastLeftPinned(e)}isSecondaryColumnsPresent(){return t(this.secondaryColumns)}setSecondaryColumns(e,t="api"){const s=e&&e.length>0;if(s||!i(this.secondaryColumns)){if(s){this.processSecondaryColumnDefinitions(e);const t=this.columnFactory.createColumnTree(e,!1,this.secondaryBalancedTree||this.previousSecondaryColumns||void 0);this.destroyOldColumns(this.secondaryBalancedTree,t.columnTree),this.secondaryBalancedTree=t.columnTree,this.secondaryHeaderRowCount=t.treeDept+1,this.secondaryColumns=this.getColumnsFromTree(this.secondaryBalancedTree),this.secondaryColumnsMap={},this.secondaryColumns.forEach(e=>this.secondaryColumnsMap[e.getId()]=e),this.previousSecondaryColumns=null}else this.previousSecondaryColumns=this.secondaryBalancedTree,this.secondaryBalancedTree=null,this.secondaryHeaderRowCount=-1,this.secondaryColumns=null,this.secondaryColumnsMap={};this.updateGridColumns(),this.updateDisplayedColumns(t)}}processSecondaryColumnDefinitions(e){const i=this.gridOptionsService.get("processPivotResultColDef")||this.gridOptionsService.get("processSecondaryColDef"),s=this.gridOptionsService.get("processPivotResultColGroupDef")||this.gridOptionsService.get("processSecondaryColGroupDef");if(!i&&!s)return;const o=e=>{e.forEach(e=>{if(t(e.children)){const t=e;s&&s(t),o(t.children)}else{const t=e;i&&i(t)}})};e&&o(e)}updateGridColumns(){const e=this.gridBalancedTree;let t;if(this.gridColsArePrimary?this.lastPrimaryOrder=this.gridColumns:this.lastSecondaryOrder=this.gridColumns,this.secondaryColumns&&this.secondaryBalancedTree){const e=this.secondaryColumns.every(e=>void 0!==this.gridColumnsMap[e.getColId()]);this.gridBalancedTree=this.secondaryBalancedTree.slice(),this.gridHeaderRowCount=this.secondaryHeaderRowCount,this.gridColumns=this.secondaryColumns.slice(),this.gridColsArePrimary=!1,e&&(t=this.lastSecondaryOrder)}else this.primaryColumns&&(this.gridBalancedTree=this.primaryColumnTree.slice(),this.gridHeaderRowCount=this.primaryHeaderRowCount,this.gridColumns=this.primaryColumns.slice(),this.gridColsArePrimary=!0,t=this.lastPrimaryOrder);if(this.createGroupAutoColumnsIfNeeded()&&t){const e=$e(this.groupAutoColumns.map(e=>[e,!0]));t=t.filter(t=>!e.has(t)),t=[...this.groupAutoColumns,...t]}if(this.addAutoGroupToGridColumns(),this.orderGridColsLike(t),this.gridColumns=this.placeLockedColumns(this.gridColumns),this.calculateColumnsForGroupDisplay(),this.refreshQuickFilterColumns(),this.clearDisplayedAndViewportColumns(),this.colSpanActive=this.checkColSpanActiveInCols(this.gridColumns),this.gridColumnsMap={},this.gridColumns.forEach(e=>this.gridColumnsMap[e.getId()]=e),this.setAutoHeightActive(),!le(e,this.gridBalancedTree)){const e={type:_e.EVENT_GRID_COLUMNS_CHANGED};this.eventService.dispatchEvent(e)}}setAutoHeightActive(){if(this.autoHeightActive=this.gridColumns.filter(e=>e.isAutoHeight()).length>0,this.autoHeightActive){this.autoHeightActiveAtLeastOnce=!0;if(!(this.gridOptionsService.isRowModelType("clientSide")||this.gridOptionsService.isRowModelType("serverSide"))){const e="AG Grid - autoHeight columns only work with Client Side Row Model and Server Side Row Model.";T(()=>console.warn(e),"autoHeightActive.wrongRowModel")}}}orderGridColsLike(e){if(i(e))return;const t=$e(e.map((e,t)=>[e,t]));let s=!0;if(this.gridColumns.forEach(e=>{t.has(e)&&(s=!1)}),s)return;const o=$e(this.gridColumns.map(e=>[e,!0])),r=e.filter(e=>o.has(e)),n=$e(r.map(e=>[e,!0])),l=this.gridColumns.filter(e=>!n.has(e)),a=r.slice();l.forEach(e=>{let t=e.getOriginalParent();if(!t)return void a.push(e);const i=[];for(;!i.length&&t;){t.getLeafColumns().forEach(e=>{const t=a.indexOf(e)>=0,s=i.indexOf(e)<0;t&&s&&i.push(e)}),t=t.getOriginalParent()}if(!i.length)return void a.push(e);const s=i.map(e=>a.indexOf(e)),o=Math.max(...s);pe(a,e,o+1)}),this.gridColumns=a}isPrimaryColumnGroupsPresent(){return this.primaryHeaderRowCount>1}refreshQuickFilterColumns(){var e;let t=null!==(e=this.isPivotMode()?this.secondaryColumns:this.primaryColumns)&&void 0!==e?e:[];this.groupAutoColumns&&(t=t.concat(this.groupAutoColumns)),this.columnsForQuickFilter=this.gridOptionsService.is("includeHiddenColumnsInQuickFilter")?t:t.filter(e=>e.isVisible()||e.isRowGroupActive())}placeLockedColumns(e){const t=[],i=[],s=[];return e.forEach(e=>{const o=e.getColDef().lockPosition;"right"===o?s.push(e):"left"===o||!0===o?t.push(e):i.push(e)}),[...t,...i,...s]}addAutoGroupToGridColumns(){if(i(this.groupAutoColumns))return this.destroyOldColumns(this.groupAutoColsBalancedTree),void(this.groupAutoColsBalancedTree=null);this.gridColumns=this.groupAutoColumns?this.groupAutoColumns.concat(this.gridColumns):this.gridColumns;const e=this.columnFactory.createForAutoGroups(this.groupAutoColumns,this.gridBalancedTree);this.destroyOldColumns(this.groupAutoColsBalancedTree,e),this.groupAutoColsBalancedTree=e,this.gridBalancedTree=e.concat(this.gridBalancedTree)}clearDisplayedAndViewportColumns(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={},this.displayedColumnsLeft=[],this.displayedColumnsRight=[],this.displayedColumnsCenter=[],this.displayedColumns=[],this.viewportColumns=[],this.headerViewportColumns=[],this.viewportColumnsHash=""}updateGroupsAndDisplayedColumns(e){this.updateOpenClosedVisibilityInColumnGroups(),this.deriveDisplayedColumns(e),this.refreshFlexedColumns(),this.extractViewport(),this.updateBodyWidths();const t={type:_e.EVENT_DISPLAYED_COLUMNS_CHANGED};this.eventService.dispatchEvent(t)}deriveDisplayedColumns(e){this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeLeft,this.displayedColumnsLeft),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeCentre,this.displayedColumnsCenter),this.derivedDisplayedColumnsFromDisplayedTree(this.displayedTreeRight,this.displayedColumnsRight),this.joinDisplayedColumns(),this.setLeftValues(e),this.displayedAutoHeightCols=this.displayedColumns.filter(e=>e.isAutoHeight())}isAutoRowHeightActive(){return this.autoHeightActive}wasAutoRowHeightEverActive(){return this.autoHeightActiveAtLeastOnce}joinDisplayedColumns(){this.gridOptionsService.is("enableRtl")?this.displayedColumns=this.displayedColumnsRight.concat(this.displayedColumnsCenter).concat(this.displayedColumnsLeft):this.displayedColumns=this.displayedColumnsLeft.concat(this.displayedColumnsCenter).concat(this.displayedColumnsRight)}setLeftValues(e){this.setLeftValuesOfColumns(e),this.setLeftValuesOfGroups()}setLeftValuesOfColumns(e){if(!this.primaryColumns)return;const t=this.primaryColumns.slice(0),i=this.gridOptionsService.is("enableRtl");[this.displayedColumnsLeft,this.displayedColumnsRight,this.displayedColumnsCenter].forEach(s=>{if(i){let t=this.getWidthOfColsInList(s);s.forEach(i=>{t-=i.getActualWidth(),i.setLeft(t,e)})}else{let t=0;s.forEach(i=>{i.setLeft(t,e),t+=i.getActualWidth()})}ce(t,s)}),t.forEach(t=>{t.setLeft(null,e)})}setLeftValuesOfGroups(){[this.displayedTreeLeft,this.displayedTreeRight,this.displayedTreeCentre].forEach(e=>{e.forEach(e=>{if(e instanceof xe){e.checkLeft()}})})}derivedDisplayedColumnsFromDisplayedTree(e,t){t.length=0,this.columnUtils.depthFirstDisplayedColumnTreeSearch(e,e=>{e instanceof te&&t.push(e)})}extractViewportColumns(){this.suppressColumnVirtualisation?(this.viewportColumnsCenter=this.displayedColumnsCenter,this.headerViewportColumnsCenter=this.displayedColumnsCenter):(this.viewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInRowViewport.bind(this)),this.headerViewportColumnsCenter=this.displayedColumnsCenter.filter(this.isColumnInHeaderViewport.bind(this))),this.viewportColumns=this.viewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight),this.headerViewportColumns=this.headerViewportColumnsCenter.concat(this.displayedColumnsLeft).concat(this.displayedColumnsRight)}getVirtualHeaderGroupRow(e,t){let s;switch(e){case"left":s=this.viewportRowLeft[t];break;case"right":s=this.viewportRowRight[t];break;default:s=this.viewportRowCenter[t]}return i(s)&&(s=[]),s}calculateHeaderRows(){this.viewportRowLeft={},this.viewportRowRight={},this.viewportRowCenter={};const e={};this.headerViewportColumns.forEach(t=>e[t.getId()]=!0);const t=(i,s,o)=>{let r=!1;for(let n=0;n<i.length;n++){const l=i[n];let a=!1;if(l instanceof te)a=!0===e[l.getId()];else{const e=l.getDisplayedChildren();e&&(a=t(e,s,o+1))}a&&(r=!0,s[o]||(s[o]=[]),s[o].push(l))}return r};t(this.displayedTreeLeft,this.viewportRowLeft,0),t(this.displayedTreeRight,this.viewportRowRight,0),t(this.displayedTreeCentre,this.viewportRowCenter,0)}extractViewport(){this.extractViewportColumns();const e=this.viewportColumns.map(e=>`${e.getId()}-${e.getPinned()||"normal"}`).join("#"),t=this.viewportColumnsHash!==e;return t&&(this.viewportColumnsHash=e,this.calculateHeaderRows()),t}refreshFlexedColumns(e={}){var i;const s=e.source?e.source:"flex";if(null!=e.viewportWidth&&(this.flexViewportWidth=e.viewportWidth),!this.flexViewportWidth)return[];let o=-1;if(e.resizingCols){const t=new Set(e.resizingCols);let i=this.displayedColumnsCenter;for(let e=i.length-1;e>=0;e--)if(t.has(i[e])){o=e;break}}let r=0,n=[],l=0,a=0;for(let e=0;e<this.displayedColumnsCenter.length;e++){this.displayedColumnsCenter[e].getFlex()&&e>o?(n.push(this.displayedColumnsCenter[e]),a+=this.displayedColumnsCenter[e].getFlex(),l+=null!==(i=this.displayedColumnsCenter[e].getMinWidth())&&void 0!==i?i:0):r+=this.displayedColumnsCenter[e].getActualWidth()}if(!n.length)return[];let d=[];r+l>this.flexViewportWidth&&(n.forEach(e=>{var t;return e.setActualWidth(null!==(t=e.getMinWidth())&&void 0!==t?t:0,s)}),d=n,n=[]);const h=[];let c;e:for(;;){c=this.flexViewportWidth-r;const e=c/a;for(let i=0;i<n.length;i++){const o=n[i],l=e*o.getFlex();let c=0;const u=o.getMinWidth(),p=o.getMaxWidth();if(t(u)&&l<u?c=u:t(p)&&l>p&&(c=p),c){o.setActualWidth(c,s),de(n,o),a-=o.getFlex(),d.push(o),r+=o.getActualWidth();continue e}h[i]=Math.round(l)}break}let u=c;return n.forEach((e,t)=>{e.setActualWidth(Math.min(h[t],u),s),d.push(e),u-=h[t]}),e.skipSetLeft||this.setLeftValues(s),e.updateBodyWidths&&this.updateBodyWidths(),e.fireResizedEvent&&this.dispatchColumnResizedEvent(d,!0,s,n),n}sizeColumnsToFit(e,i="sizeColumnsToFit",s,o){var r,n,l,a,d;if(this.shouldQueueResizeOperations)return void this.resizeOperationQueue.push(()=>this.sizeColumnsToFit(e,i,s,o));const h={};o&&(null===(r=null==o?void 0:o.columnLimits)||void 0===r||r.forEach(e=>{var{key:t}=e,i=ht(e,["key"]);h["string"==typeof t?t:t.getColId()]=i}));const c=this.getAllDisplayedColumns(),u=e===this.getWidthOfColsInList(c);if(e<=0||!c.length||u)return;const p=[],g=[];c.forEach(e=>{!0===e.getColDef().suppressSizeToFit?g.push(e):p.push(e)});const m=p.slice(0);let C=!1;const v=e=>{he(p,e),g.push(e)};for(p.forEach(e=>{var t,s;e.resetActualWidth(i);const r=null==h?void 0:h[e.getId()],n=null!==(t=null==r?void 0:r.minWidth)&&void 0!==t?t:null==o?void 0:o.defaultMinWidth,l=null!==(s=null==r?void 0:r.maxWidth)&&void 0!==s?s:null==o?void 0:o.defaultMaxWidth,a=e.getActualWidth();"number"==typeof n&&a<n?e.setActualWidth(n,i,!0):"number"==typeof l&&a>l&&e.setActualWidth(l,i,!0)});!C;){C=!0;const s=e-this.getWidthOfColsInList(g);if(s<=0)p.forEach(e=>{var t,s;const r=null!==(s=null===(t=null==h?void 0:h[e.getId()])||void 0===t?void 0:t.minWidth)&&void 0!==s?s:null==o?void 0:o.defaultMinWidth;"number"!=typeof r?e.setMinimum(i):e.setActualWidth(r,i,!0)});else{const e=s/this.getWidthOfColsInList(p);let r=s;for(let s=p.length-1;s>=0;s--){const c=p[s],u=null==h?void 0:h[c.getId()],g=null!==(n=null==u?void 0:u.minWidth)&&void 0!==n?n:null==o?void 0:o.defaultMinWidth,m=null!==(l=null==u?void 0:u.maxWidth)&&void 0!==l?l:null==o?void 0:o.defaultMaxWidth,f=null!==(a=c.getMinWidth())&&void 0!==a?a:0,w=null!==(d=c.getMaxWidth())&&void 0!==d?d:Number.MAX_VALUE,y="number"==typeof g&&g>f?g:c.getMinWidth(),S="number"==typeof m&&m<w?m:c.getMaxWidth();let E=Math.round(c.getActualWidth()*e);t(y)&&E<y?(E=y,v(c),C=!1):t(S)&&E>S?(E=S,v(c),C=!1):0===s&&(E=r),c.setActualWidth(E,i,!0),r-=E}}}m.forEach(e=>{e.fireColumnWidthChangedEvent(i)}),this.setLeftValues(i),this.updateBodyWidths(),s||this.dispatchColumnResizedEvent(m,!0,i)}buildDisplayedTrees(e){const t=[],i=[],s=[];e.forEach(e=>{switch(e.getPinned()){case"left":t.push(e);break;case"right":i.push(e);break;default:s.push(e)}});const o=new Ve;this.displayedTreeLeft=this.displayedGroupCreator.createDisplayedGroups(t,o,"left",this.displayedTreeLeft),this.displayedTreeRight=this.displayedGroupCreator.createDisplayedGroups(i,o,"right",this.displayedTreeRight),this.displayedTreeCentre=this.displayedGroupCreator.createDisplayedGroups(s,o,null,this.displayedTreeCentre),this.updateDisplayedMap()}updateDisplayedMap(){this.displayedColumnsAndGroupsMap={};const e=e=>{this.displayedColumnsAndGroupsMap[e.getUniqueId()]=e};this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeCentre,e),this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeLeft,e),this.columnUtils.depthFirstAllColumnTreeSearch(this.displayedTreeRight,e)}isDisplayed(e){return this.displayedColumnsAndGroupsMap[e.getUniqueId()]===e}updateOpenClosedVisibilityInColumnGroups(){const e=this.getAllDisplayedTrees();this.columnUtils.depthFirstAllColumnTreeSearch(e,e=>{e instanceof xe&&e.calculateDisplayedColumns()})}getGroupAutoColumns(){return this.groupAutoColumns}createGroupAutoColumnsIfNeeded(){const e=this.forceRecreateAutoGroups;if(this.forceRecreateAutoGroups=!1,!this.autoGroupsNeedBuilding)return!1;this.autoGroupsNeedBuilding=!1;const t=this.gridOptionsService.isGroupUseEntireRow(this.pivotMode),i=this.pivotMode?this.gridOptionsService.is("pivotSuppressAutoColumn"):this.isGroupSuppressAutoColumn();if((this.rowGroupColumns.length>0||this.gridOptionsService.is("treeData"))&&!i&&!t){const t=this.autoGroupColService.createAutoGroupColumns(this.rowGroupColumns);if(!this.autoColsEqual(t,this.groupAutoColumns)||e)return this.groupAutoColumns=t,!0}else this.groupAutoColumns=null;return!1}isGroupSuppressAutoColumn(){const e=this.gridOptionsService.get("groupDisplayType");if(!!e&&lt("custom",e))return!0;const t=this.gridOptionsService.get("treeDataDisplayType");return!!t&&function(e,t){const i=["auto","custom"];return i.indexOf(t)<0?(console.warn(`AG Grid: '${t}' is not a valid treeDataDisplayType value - possible values are: '${i.join("', '")}'`),!1):t===e}("custom",t)}autoColsEqual(e,t){return le(e,t,(e,t)=>e.getColId()===t.getColId())}getWidthOfColsInList(e){return e.reduce((e,t)=>e+t.getActualWidth(),0)}getGridBalancedTree(){return this.gridBalancedTree}getFirstDisplayedColumn(){const e=this.gridOptionsService.is("enableRtl"),t=["getDisplayedLeftColumns","getDisplayedCenterColumns","getDisplayedRightColumns"];e&&t.reverse();for(let i=0;i<t.length;i++){const s=this[t[i]]();if(s.length)return e?ne(s):s[0]}return null}setColumnHeaderHeight(e,t){if(e.setAutoHeaderHeight(t)){const t={type:_e.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,column:e,columns:[e],source:"autosizeColumnHeaderHeight"};this.eventService.dispatchEvent(t)}}getColumnGroupHeaderRowHeight(){return this.isPivotMode()?this.getPivotGroupHeaderHeight():this.getGroupHeaderHeight()}getColumnHeaderRowHeight(){const e=this.isPivotMode()?this.getPivotHeaderHeight():this.getHeaderHeight(),t=this.getAllDisplayedColumns().filter(e=>e.isAutoHeaderHeight()).map(e=>e.getAutoHeaderHeight()||0);return Math.max(e,...t)}getHeaderHeight(){var e;return null!==(e=this.gridOptionsService.getNum("headerHeight"))&&void 0!==e?e:this.environment.getFromTheme(25,"headerHeight")}getFloatingFiltersHeight(){var e;return null!==(e=this.gridOptionsService.getNum("floatingFiltersHeight"))&&void 0!==e?e:this.getHeaderHeight()}getGroupHeaderHeight(){var e;return null!==(e=this.gridOptionsService.getNum("groupHeaderHeight"))&&void 0!==e?e:this.getHeaderHeight()}getPivotHeaderHeight(){var e;return null!==(e=this.gridOptionsService.getNum("pivotHeaderHeight"))&&void 0!==e?e:this.getHeaderHeight()}getPivotGroupHeaderHeight(){var e;return null!==(e=this.gridOptionsService.getNum("pivotGroupHeaderHeight"))&&void 0!==e?e:this.getGroupHeaderHeight()}queueResizeOperations(){this.shouldQueueResizeOperations=!0}processResizeOperations(){this.shouldQueueResizeOperations=!1,this.resizeOperationQueue.forEach(e=>e()),this.resizeOperationQueue=[]}resetColumnDefIntoColumn(e){const t=e.getUserProvidedColDef();if(!t)return!1;const i=this.columnFactory.addColumnDefaultAndTypes(t,e.getColId());return e.setColDef(i,t),!0}generateColumnStateForRowGroupAndPivotIndexes(e,t){let i={};const s=(e,t,s,o,r,n)=>{if(!t.length||!this.primaryColumns)return[];const l=Object.keys(e),a=new Set(l),d=new Set(l),h=new Set(t.map(e=>{const t=e.getColId();return d.delete(t),t}).concat(l)),c=[],u={};let p=0;for(let e=0;e<this.primaryColumns.length;e++){const t=this.primaryColumns[e].getColId();h.has(t)&&(c.push(t),u[t]=p++)}let g=1e3,m=!1,C=0;const v=t=>{const i=u[t];for(let t=C;t<i;t++){const i=c[t];d.has(i)&&(e[i][r]=g++,d.delete(i))}C=i};t.forEach(t=>{const l=t.getColId();if(a.has(l))v(l),e[l][r]=g++;else{const a=t.getColDef();if(null===a[r]||void 0===a[r]&&null==a[n]){if(!m){a[s]||void 0===a[s]&&a[o]?v(l):(d.forEach(t=>{e[t][r]=g+u[t]}),g+=c.length,m=!0)}i[l]||(i[l]={colId:l}),i[l][r]=g++}}})};return s(e,this.rowGroupColumns,"rowGroup","initialRowGroup","rowGroupIndex","initialRowGroupIndex"),s(t,this.pivotColumns,"pivot","initialPivot","pivotIndex","initialPivotIndex"),Object.values(i)}};at([j("expressionService")],ct.prototype,"expressionService",void 0),at([j("columnFactory")],ct.prototype,"columnFactory",void 0),at([j("displayedGroupCreator")],ct.prototype,"displayedGroupCreator",void 0),at([j("ctrlsService")],ct.prototype,"ctrlsService",void 0),at([j("autoWidthCalculator")],ct.prototype,"autoWidthCalculator",void 0),at([j("columnUtils")],ct.prototype,"columnUtils",void 0),at([j("columnAnimationService")],ct.prototype,"columnAnimationService",void 0),at([j("autoGroupColService")],ct.prototype,"autoGroupColService",void 0),at([z("aggFuncService")],ct.prototype,"aggFuncService",void 0),at([z("valueCache")],ct.prototype,"valueCache",void 0),at([z("animationFrameService")],ct.prototype,"animationFrameService",void 0),at([j("sortController")],ct.prototype,"sortController",void 0),at([j("columnDefFactory")],ct.prototype,"columnDefFactory",void 0),at([B],ct.prototype,"init",null),at([W],ct.prototype,"destroyColumns",null),at([dt(0,Y("loggerFactory"))],ct.prototype,"setBeans",null),ct=at([U("columnModel")],ct);var ut=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let pt=class extends Le{calculateColMinWidth(e){return null!=e.minWidth?e.minWidth:this.environment.getMinColWidth()}calculateColMaxWidth(e){return null!=e.maxWidth?e.maxWidth:Number.MAX_SAFE_INTEGER}calculateColInitialWidth(e){const t=this.calculateColMinWidth(e),i=this.calculateColMaxWidth(e);let s;const o=r(e.width),n=r(e.initialWidth);return s=null!=o?o:null!=n?n:200,Math.max(Math.min(s,i),t)}getOriginalPathForColumn(e,t){const i=[];let s=!1;const o=(t,r)=>{for(let n=0;n<t.length;n++){if(s)return;const l=t[n];if(l instanceof se){o(l.getChildren(),r+1),i[r]=l}else l===e&&(s=!0)}};return o(t,0),s?i:null}depthFirstOriginalTreeSearch(e,t,i){t&&t.forEach(t=>{t instanceof se&&this.depthFirstOriginalTreeSearch(t,t.getChildren(),i),i(t,e)})}depthFirstAllColumnTreeSearch(e,t){e&&e.forEach(e=>{e instanceof xe&&this.depthFirstAllColumnTreeSearch(e.getChildren(),t),t(e)})}depthFirstDisplayedColumnTreeSearch(e,t){e&&e.forEach(e=>{e instanceof xe&&this.depthFirstDisplayedColumnTreeSearch(e.getDisplayedChildren(),t),t(e)})}};pt=ut([U("columnUtils")],pt);var gt=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let mt=class extends Le{createDisplayedGroups(e,t,i,s){const o=this.mapOldGroupsById(s),r=[];let n=e;for(;n.length;){const e=n;n=[];let s=0;const l=l=>{const a=s;s=l;const d=e[a],h=(d instanceof xe?d.getProvidedColumnGroup():d).getOriginalParent();if(null==h){for(let t=a;t<l;t++)r.push(e[t]);return}const c=this.createColumnGroup(h,t,o,i);for(let t=a;t<l;t++)c.addChild(e[t]);n.push(c)};for(let t=1;t<e.length;t++){const i=e[t],o=(i instanceof xe?i.getProvidedColumnGroup():i).getOriginalParent(),r=e[s];o!==(r instanceof xe?r.getProvidedColumnGroup():r).getOriginalParent()&&l(t)}s<e.length&&l(e.length)}return this.setupParentsIntoColumns(r,null),r}createColumnGroup(e,i,s,o){const r=e.getGroupId(),n=i.getInstanceIdForKey(r);let l=s[xe.createUniqueId(r,n)];return l&&l.getProvidedColumnGroup()!==e&&(l=null),t(l)?l.reset():(l=new xe(e,r,n,o),this.context.createBean(l)),l}mapOldGroupsById(e){const t={},i=e=>{e.forEach(e=>{if(e instanceof xe){const s=e;t[e.getUniqueId()]=s,i(s.getChildren())}})};return e&&i(e),t}setupParentsIntoColumns(e,t){e.forEach(e=>{if(e.setParent(t),e instanceof xe){const t=e;this.setupParentsIntoColumns(t.getChildren(),t)}})}};mt=gt([U("displayedGroupCreator")],mt);var Ct=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let vt=class extends Le{constructor(){super(...arguments),this.componentsMappedByName={}}setupComponents(e){e&&e.forEach(e=>this.addComponent(e))}addComponent(e){const t=e.componentName.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase().toUpperCase();this.componentsMappedByName[t]=e.componentClass}getComponentClass(e){return this.componentsMappedByName[e]}};function ft(e,t,i){null==i||""==i?yt(e,t):wt(e,t,i)}function wt(e,t,i){e.setAttribute(St(t),i.toString())}function yt(e,t){e.removeAttribute(St(t))}function St(e){return"aria-"+e}function Et(e,t){t?e.setAttribute("role",t):e.removeAttribute("role")}function Rt(e){let t;return t="asc"===e?"ascending":"desc"===e?"descending":"mixed"===e?"other":"none",t}function Tt(e){return parseInt(e.getAttribute("aria-level"),10)}function bt(e){return parseInt(e.getAttribute("aria-posinset"),10)}function Dt(e,t){ft(e,"label",t)}function Ot(e,t){ft(e,"labelledby",t)}function Pt(e,t){ft(e,"description",t)}function At(e,t){ft(e,"describedby",t)}function Ft(e,t){ft(e,"live",t)}function Lt(e,t){ft(e,"level",t)}function It(e,t){ft(e,"disabled",t)}function Nt(e,t){ft(e,"hidden",t)}function Mt(e,t){ft(e,"activedescendant",t)}function Gt(e,t){wt(e,"expanded",t)}function xt(e){yt(e,"expanded")}function _t(e,t){wt(e,"setsize",t)}function Vt(e,t){wt(e,"posinset",t)}function Ht(e,t){wt(e,"multiselectable",t)}function kt(e,t){wt(e,"rowcount",t)}function Bt(e,t){wt(e,"rowindex",t)}function Wt(e,t){wt(e,"colcount",t)}function Ut(e,t){wt(e,"colindex",t)}function jt(e,t){wt(e,"colspan",t)}function zt(e,t){wt(e,"sort",t)}function Kt(e){yt(e,"sort")}function Yt(e,t){ft(e,"selected",t)}function $t(e,t){wt(e,"checked",void 0===t?"mixed":t)}function qt(e,t){ft(e,"controls",t.id),Ot(t,e.id)}function Qt(e,t){return void 0===t?e("ariaIndeterminate","indeterminate"):!0===t?e("ariaChecked","checked"):e("ariaUnchecked","unchecked")}vt=Ct([U("agStackComponentsRegistry")],vt);var Xt=Object.freeze({__proto__:null,setAriaRole:Et,getAriaSortState:Rt,getAriaLevel:Tt,getAriaPosInSet:bt,getAriaDescribedBy:function(e){return e.getAttribute("aria-describedby")||""},setAriaLabel:Dt,setAriaLabelledBy:Ot,setAriaDescription:Pt,setAriaDescribedBy:At,setAriaLive:Ft,setAriaLevel:Lt,setAriaDisabled:It,setAriaHidden:Nt,setAriaActiveDescendant:Mt,setAriaExpanded:Gt,removeAriaExpanded:xt,setAriaSetSize:_t,setAriaPosInSet:Vt,setAriaMultiSelectable:Ht,setAriaRowCount:kt,setAriaRowIndex:Bt,setAriaColCount:Wt,setAriaColIndex:Ut,setAriaColSpan:jt,setAriaSort:zt,removeAriaSort:Kt,setAriaSelected:Yt,setAriaChecked:$t,setAriaControls:qt,getAriaCheckboxStateName:Qt});let Jt,Zt,ei,ti,ii,si,oi,ri;function ni(){return void 0===Jt&&(Jt=/^((?!chrome|android).)*safari/i.test(navigator.userAgent)),Jt}function li(){if(void 0===Zt)if(ni()){const e=navigator.userAgent.match(/version\/(\d+)/i);e&&(Zt=null!=e[1]?parseFloat(e[1]):0)}else Zt=0;return Zt}function ai(){if(void 0===ei){const e=window;ei=!!e.chrome&&(!!e.chrome.webstore||!!e.chrome.runtime)||/Chrome/.test(navigator.userAgent)&&/Google Inc/.test(navigator.vendor)}return ei}function di(){return void 0===ti&&(ti=/(firefox)/i.test(navigator.userAgent)),ti}function hi(){return void 0===ii&&(ii=/(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)),ii}function ci(){return void 0===si&&(si=/iPad|iPhone|iPod/.test(navigator.platform)||"MacIntel"===navigator.platform&&navigator.maxTouchPoints>1),si}function ui(){return!ni()||li()>=15}function pi(e){if(!e)return null;const t=e.tabIndex,i=e.getAttribute("tabIndex");return-1!==t||null!==i&&(""!==i||di())?t.toString():null}function gi(){if(!document.body)return-1;let e=1e6;const t=navigator.userAgent.toLowerCase().match(/firefox/)?6e6:1e9,i=document.createElement("div");for(document.body.appendChild(i);;){const s=2*e;if(i.style.height=s+"px",s>t||i.clientHeight!==s)break;e=s}return document.body.removeChild(i),e}function mi(){var e,t,i;return null!==(t=null===(e=document.body)||void 0===e?void 0:e.clientWidth)&&void 0!==t?t:window.innerHeight||(null===(i=document.documentElement)||void 0===i?void 0:i.clientWidth)||-1}function Ci(){var e,t,i;return null!==(t=null===(e=document.body)||void 0===e?void 0:e.clientHeight)&&void 0!==t?t:window.innerHeight||(null===(i=document.documentElement)||void 0===i?void 0:i.clientHeight)||-1}function vi(){return null==ri&&fi(),ri}function fi(){const e=document.body,t=document.createElement("div");t.style.width=t.style.height="100px",t.style.opacity="0",t.style.overflow="scroll",t.style.msOverflowStyle="scrollbar",t.style.position="absolute",e.appendChild(t);let i=t.offsetWidth-t.clientWidth;0===i&&0===t.clientWidth&&(i=null),t.parentNode&&t.parentNode.removeChild(t),null!=i&&(ri=i,oi=0===i)}function wi(){return null==oi&&fi(),oi}var yi=Object.freeze({__proto__:null,isBrowserSafari:ni,getSafariVersion:li,isBrowserChrome:ai,isBrowserFirefox:di,isMacOsUserAgent:hi,isIOSUserAgent:ci,browserSupportsPreventScroll:ui,getTabIndex:pi,getMaxDivHeight:gi,getBodyWidth:mi,getBodyHeight:Ci,getScrollbarWidth:vi,isInvisibleScrollbar:wi});function Si(e,t){return e.toString().padStart(t,"0")}function Ei(e,t){const i=[];for(let s=e;s<=t;s++)i.push(s);return i}function Ri(e,t,i){return"number"!=typeof e?"":e.toString().replace(".",i).replace(/(\d)(?=(\d{3})+(?!\d))/g,"$1"+t)}var Ti=Object.freeze({__proto__:null,padStartWidthZeros:Si,createArrayOfNumbers:Ei,cleanNumber:function(e){return"string"==typeof e&&(e=parseInt(e,10)),"number"==typeof e?Math.floor(e):null},decToHex:function(e,t){let i="";for(let s=0;s<t;s++)i+=String.fromCharCode(255&e),e>>>=8;return i},formatNumberTwoDecimalPlacesAndCommas:function(e,t,i){return"number"!=typeof e?"":Ri(Math.round(100*e)/100,t,i)},formatNumberCommas:Ri,sum:function(e){return null==e?null:e.reduce((e,t)=>e+t,0)},zeroOrGreater:function(e,t){return e>=0?e:t},oneOrGreater:function(e,t){const i=parseInt(e,10);return!isNaN(i)&&isFinite(i)&&i>0?i:t}});function bi(e,t=!0,i="-"){if(!e)return null;let s=[e.getFullYear(),e.getMonth()+1,e.getDate()].map(e=>Si(e,2)).join(i);return t&&(s+=" "+[e.getHours(),e.getMinutes(),e.getSeconds()].map(e=>Si(e,2)).join(":")),s}const Di=e=>{if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd"}return"th"};function Oi(e,t="YYYY-MM-DD"){const i=Si(e.getFullYear(),4),s=["January","February","March","April","May","June","July","August","September","October","November","December"],o=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],r={YYYY:()=>i.slice(i.length-4,i.length),YY:()=>i.slice(i.length-2,i.length),Y:()=>""+e.getFullYear(),MMMM:()=>s[e.getMonth()],MMM:()=>s[e.getMonth()].slice(0,3),MM:()=>Si(e.getMonth()+1,2),Mo:()=>`${e.getMonth()+1}${Di(e.getMonth()+1)}`,M:()=>""+(e.getMonth()+1),Do:()=>`${e.getDate()}${Di(e.getDate())}`,DD:()=>Si(e.getDate(),2),D:()=>""+e.getDate(),dddd:()=>o[e.getDay()],ddd:()=>o[e.getDay()].slice(0,3),dd:()=>o[e.getDay()].slice(0,2),do:()=>`${e.getDay()}${Di(e.getDay())}`,d:()=>""+e.getDay()},n=new RegExp(Object.keys(r).join("|"),"g");return t.replace(n,e=>e in r?r[e]():e)}function Pi(e){if(!e)return null;const[t,i]=e.split(" ");if(!t)return null;const s=t.split("-").map(e=>parseInt(e,10));if(3!==s.filter(e=>!isNaN(e)).length)return null;const[o,r,n]=s,l=new Date(o,r-1,n);if(l.getFullYear()!==o||l.getMonth()!==r-1||l.getDate()!==n)return null;if(!i||"00:00:00"===i)return l;const[a,d,h]=i.split(":").map(e=>parseInt(e,10));return a>=0&&a<24&&l.setHours(a),d>=0&&d<60&&l.setMinutes(d),h>=0&&h<60&&l.setSeconds(h),l}var Ai=Object.freeze({__proto__:null,serialiseDate:bi,dateToFormattedString:Oi,parseDateTimeFromString:Pi});let Fi;function Li(e,t,i){const s=e.parentElement;let o=s&&s.firstChild;for(;o;)t&&o.classList.toggle(t,o===e),i&&o.classList.toggle(i,o!==e),o=o.nextSibling}const Ii=".ag-hidden, .ag-hidden *, [disabled], .ag-disabled:not(.ag-button), .ag-disabled *.mjs";function Ni(e){const t=Element.prototype.matches||Element.prototype.msMatchesSelector,i=t.call(e,"input, select, button, textarea"),s=t.call(e,Ii),o=qi(e);return i&&!s&&o}function Mi(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-hidden",!t),s||Nt(e,!t)}function Gi(e,t,i={}){const{skipAriaHidden:s}=i;e.classList.toggle("ag-invisible",!t),s||Nt(e,!t)}function xi(e,t){const i=t?e=>e.setAttribute("disabled",""):e=>e.removeAttribute("disabled");i(e),ps(e.querySelectorAll("input"),e=>i(e))}function _i(e,t,i){let s=0;for(;e;){if(e.classList.contains(t))return!0;if(e=e.parentElement,"number"==typeof i){if(++s>i)break}else if(e===i)break}return!1}function Vi(e){const{height:t,width:i,borderTopWidth:s,borderRightWidth:o,borderBottomWidth:r,borderLeftWidth:n,paddingTop:l,paddingRight:a,paddingBottom:d,paddingLeft:h,marginTop:c,marginRight:u,marginBottom:p,marginLeft:g,boxSizing:m}=window.getComputedStyle(e);return{height:parseFloat(t),width:parseFloat(i),borderTopWidth:parseFloat(s),borderRightWidth:parseFloat(o),borderBottomWidth:parseFloat(r),borderLeftWidth:parseFloat(n),paddingTop:parseFloat(l),paddingRight:parseFloat(a),paddingBottom:parseFloat(d),paddingLeft:parseFloat(h),marginTop:parseFloat(c),marginRight:parseFloat(u),marginBottom:parseFloat(p),marginLeft:parseFloat(g),boxSizing:m}}function Hi(e){const t=Vi(e);return"border-box"===t.boxSizing?t.height-t.paddingTop-t.paddingBottom:t.height}function ki(e){const t=Vi(e);return"border-box"===t.boxSizing?t.width-t.paddingLeft-t.paddingRight:t.width}function Bi(e){const t=Vi(e),i=t.marginBottom+t.marginTop;return Math.ceil(e.offsetHeight+i)}function Wi(e){const t=Vi(e),i=t.marginLeft+t.marginRight;return Math.ceil(e.offsetWidth+i)}function Ui(e){const t=e.getBoundingClientRect(),{borderTopWidth:i,borderLeftWidth:s,borderRightWidth:o,borderBottomWidth:r}=Vi(e);return{top:t.top+(i||0),left:t.left+(s||0),right:t.right+(o||0),bottom:t.bottom+(r||0)}}function ji(){if("boolean"==typeof Fi)return Fi;const e=document.createElement("div");return e.style.direction="rtl",e.style.width="1px",e.style.height="1px",e.style.position="fixed",e.style.top="0px",e.style.overflow="hidden",e.dir="rtl",e.innerHTML='<div style="width: 2px">\n            <span style="display: inline-block; width: 1px"></span>\n            <span style="display: inline-block; width: 1px"></span>\n        </div>',document.body.appendChild(e),e.scrollLeft=1,Fi=0===Math.floor(e.scrollLeft),document.body.removeChild(e),Fi}function zi(e,t){let i=e.scrollLeft;return t&&(i=Math.abs(i),ai()&&!ji()&&(i=e.scrollWidth-e.clientWidth-i)),i}function Ki(e,t,i){i&&(ji()?t*=-1:(ni()||ai())&&(t=e.scrollWidth-e.clientWidth-t)),e.scrollLeft=t}function Yi(e){for(;e&&e.firstChild;)e.removeChild(e.firstChild)}function $i(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function qi(e){return null!==e.offsetParent}function Qi(e){const t=document.createElement("div");return t.innerHTML=(e||"").trim(),t.firstChild}function Xi(e){return e&&e.clientHeight?e.clientHeight:0}function Ji(e){return e&&e.clientWidth?e.clientWidth:0}function Zi(e,t,i){if(i&&i.nextSibling===t)return;const s=document.activeElement,o=t.contains(s);i?i.nextSibling?e.insertBefore(t,i.nextSibling):e.appendChild(t):e.firstChild&&e.firstChild!==t&&e.insertAdjacentElement("afterbegin",t),o&&s&&ui()&&s.focus({preventScroll:!0})}function es(e,t){for(let i=0;i<t.length;i++){const s=t[i],o=e.children[i];o!==s&&e.insertBefore(s,o)}}function ts(e,t,i){i?i.insertAdjacentElement("afterend",t):e.firstChild?e.insertAdjacentElement("afterbegin",t):e.appendChild(t)}function is(e,t){if(t)for(const[i,s]of Object.entries(t)){if(!i||!i.length||null==s)continue;const t=Ke(i),o=s.toString(),r=o.replace(/\s*!important/g,""),n=r.length!=o.length?"important":void 0;e.style.setProperty(t,r,n)}}function ss(e){return e.clientWidth<e.scrollWidth}function os(e){return e.clientHeight<e.scrollHeight}function rs(e,t){"flex"===t?(e.style.removeProperty("width"),e.style.removeProperty("minWidth"),e.style.removeProperty("maxWidth"),e.style.flex="1 1 auto"):ns(e,t)}function ns(e,t){t=as(t),e.style.width=t.toString(),e.style.maxWidth=t.toString(),e.style.minWidth=t.toString()}function ls(e,t){t=as(t),e.style.height=t.toString(),e.style.maxHeight=t.toString(),e.style.minHeight=t.toString()}function as(e){return"number"==typeof e?e+"px":e}function ds(e){return e instanceof Node||e instanceof HTMLElement}function hs(e){if(null==e)return[];const t=[];return ps(e,e=>t.push(e)),t}function cs(e,t){if(e)for(let i=0;i<e.length;i++){const s=e[i];t(s.name,s.value)}}function us(e,t,i){null==i?e.removeAttribute(t):e.setAttribute(t,i.toString())}function ps(e,t){if(null!=e)for(let i=0;i<e.length;i++)t(e[i])}function gs(e,t){e.then(e=>{const i=e.getGui();null!=i&&("object"==typeof i?t.appendChild(i):t.innerHTML=i)})}var ms=Object.freeze({__proto__:null,radioCssClass:Li,FOCUSABLE_SELECTOR:"[tabindex], input, select, button, textarea, [href]",FOCUSABLE_EXCLUDE:Ii,isFocusableFormField:Ni,setDisplayed:Mi,setVisible:Gi,setDisabled:xi,isElementChildOfClass:_i,getElementSize:Vi,getInnerHeight:Hi,getInnerWidth:ki,getAbsoluteHeight:Bi,getAbsoluteWidth:Wi,getElementRectWithOffset:Ui,isRtlNegativeScroll:ji,getScrollLeft:zi,setScrollLeft:Ki,clearElement:Yi,removeElement:function(e,t){$i(e.querySelector(t))},removeFromParent:$i,isVisible:qi,loadTemplate:Qi,appendHtml:function(e,t){e.lastChild?e.insertAdjacentHTML("afterbegin",t):e.innerHTML=t},getElementAttribute:function(e,t){if(e.attributes&&e.attributes[t]){return e.attributes[t].value}return null},offsetHeight:Xi,offsetWidth:Ji,ensureDomOrder:Zi,setDomChildOrder:es,insertWithDomOrder:ts,prependDC:function(e,i){t(e.firstChild)?e.insertBefore(i,e.firstChild):e.appendChild(i)},addStylesToElement:is,isHorizontalScrollShowing:ss,isVerticalScrollShowing:os,setElementWidth:rs,setFixedWidth:ns,setElementHeight:function(e,t){"flex"===t?(e.style.removeProperty("height"),e.style.removeProperty("minHeight"),e.style.removeProperty("maxHeight"),e.style.flex="1 1 auto"):ls(e,t)},setFixedHeight:ls,formatSize:as,isNodeOrElement:ds,copyNodeList:hs,iterateNamedNodeMap:cs,addOrRemoveAttribute:us,nodeListForEach:ps,bindCellRendererToHtmlElement:gs});const Cs={columnGroupOpened:"expanded",columnGroupClosed:"contracted",columnSelectClosed:"tree-closed",columnSelectOpen:"tree-open",columnSelectIndeterminate:"tree-indeterminate",columnMovePin:"pin",columnMoveHide:"eye-slash",columnMoveMove:"arrows",columnMoveLeft:"left",columnMoveRight:"right",columnMoveGroup:"group",columnMoveValue:"aggregation",columnMovePivot:"pivot",dropNotAllowed:"not-allowed",groupContracted:"tree-closed",groupExpanded:"tree-open",setFilterGroupClosed:"tree-closed",setFilterGroupOpen:"tree-open",setFilterGroupIndeterminate:"tree-indeterminate",chart:"chart",close:"cross",cancel:"cancel",check:"tick",first:"first",previous:"previous",next:"next",last:"last",linked:"linked",unlinked:"unlinked",colorPicker:"color-picker",groupLoading:"loading",menu:"menu",filter:"filter",columns:"columns",maximize:"maximize",minimize:"minimize",menuPin:"pin",menuValue:"aggregation",menuAddRowGroup:"group",menuRemoveRowGroup:"group",clipboardCopy:"copy",clipboardCut:"cut",clipboardPaste:"paste",pivotPanel:"pivot",rowGroupPanel:"group",valuePanel:"aggregation",columnDrag:"grip",rowDrag:"grip",save:"save",csvExport:"csv",excelExport:"excel",smallDown:"small-down",smallLeft:"small-left",smallRight:"small-right",smallUp:"small-up",sortAscending:"asc",sortDescending:"desc",sortUnSort:"none",advancedFilterBuilder:"group",advancedFilterBuilderDrag:"grip",advancedFilterBuilderInvalid:"not-allowed",advancedFilterBuilderMoveUp:"up",advancedFilterBuilderMoveDown:"down",advancedFilterBuilderAdd:"plus",advancedFilterBuilderRemove:"minus"};function vs(e,t,i){const s=fs(e,t,i);if(s){const{className:e}=s;if("string"==typeof e&&e.indexOf("ag-icon")>-1||"object"==typeof e&&e["ag-icon"])return s}const o=document.createElement("span");return o.appendChild(s),o}function fs(e,t,i,s){let o=null;const r=i&&i.getColDef().icons;if(r&&(o=r[e]),t&&!o){const i=t.get("icons");i&&(o=i[e])}if(!o){const t=document.createElement("span");let i=Cs[e];return i||(s?i=e:(console.warn("AG Grid: Did not find icon "+e),i="")),t.setAttribute("class","ag-icon ag-icon-"+i),t.setAttribute("unselectable","on"),Et(t,"presentation"),t}{let e;if("function"==typeof o)e=o();else{if("string"!=typeof o)throw new Error("icon from grid options needs to be a string or a function");e=o}if("string"==typeof e)return Qi(e);if(ds(e))return e;console.warn("AG Grid: iconRenderer should return back a string or a dom object")}}var ws=Object.freeze({__proto__:null,iconNameClassMap:Cs,createIcon:vs,createIconNoSpan:fs});class ys{}ys.BACKSPACE="Backspace",ys.TAB="Tab",ys.ENTER="Enter",ys.ESCAPE="Escape",ys.SPACE=" ",ys.LEFT="ArrowLeft",ys.UP="ArrowUp",ys.RIGHT="ArrowRight",ys.DOWN="ArrowDown",ys.DELETE="Delete",ys.F2="F2",ys.PAGE_UP="PageUp",ys.PAGE_DOWN="PageDown",ys.PAGE_HOME="Home",ys.PAGE_END="End",ys.A="KeyA",ys.C="KeyC",ys.D="KeyD",ys.V="KeyV",ys.X="KeyX",ys.Y="KeyY",ys.Z="KeyZ";function Ss(e){if(e.altKey||e.ctrlKey||e.metaKey)return!1;return 1===e.key.length}function Es(e,t,i,s,o){const r=s?s.getColDef().suppressKeyboardEvent:void 0;if(!r)return!1;const n={event:t,editing:o,column:s,api:e.api,node:i,data:i.data,colDef:s.getColDef(),context:e.context,columnApi:e.columnApi};if(r){if(r(n))return!0}return!1}function Rs(e,i,s,o){const r=o.getDefinition(),n=r&&r.suppressHeaderKeyboardEvent;if(!t(n))return!1;return!!n({api:e.api,columnApi:e.columnApi,context:e.context,colDef:r,column:o,headerRowIndex:s,event:i})}function Ts(e){const{keyCode:t}=e;let i;switch(t){case 65:i=ys.A;break;case 67:i=ys.C;break;case 86:i=ys.V;break;case 68:i=ys.D;break;case 90:i=ys.Z;break;case 89:i=ys.Y;break;default:i=e.code}return i}function bs(e,t=!1){return e===ys.DELETE||!t&&e===ys.BACKSPACE&&hi()}var Ds=Object.freeze({__proto__:null,isEventFromPrintableCharacter:Ss,isUserSuppressingKeyboardEvent:Es,isUserSuppressingHeaderKeyboardEvent:Rs,normaliseQwertyAzerty:Ts,isDeleteKey:bs});function Os(e,t,i){if(0===i)return!1;const s=Math.abs(e.clientX-t.clientX),o=Math.abs(e.clientY-t.clientY);return Math.max(s,o)<=i}var Ps=Object.freeze({__proto__:null,areEventsNear:Os});var As=Object.freeze({__proto__:null,sortRowNodesByOrder:function(e,t){if(!e)return!1;const i=(e,i)=>{const s=t[e.id],o=t[i.id],r=void 0!==s,n=void 0!==o;return r&&n?s-o:!r&&!n?e.__objectId-i.__objectId:r?1:-1};let s,o,r=!1;for(let t=0;t<e.length-1;t++)if(s=e[t],o=e[t+1],i(s,o)>0){r=!0;break}return!!r&&(e.sort(i),!0)},traverseNodesWithKey:function(e,t){const i=[];!function e(s){if(!s)return;s.forEach(s=>{if(s.group||s.hasChildren()){i.push(s.key);const o=i.join("|");t(s,o),e(s.childrenAfterGroup),i.pop()}})}(e)}});function Fs(e){const t=new Set;return e.forEach(e=>t.add(e)),t}var Ls=Object.freeze({__proto__:null,convertToSet:Fs});const Is=Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},Xt),fe),yi),Ai),ms),Ae),_),it),a),ws),Ds),qe),Ps),Ti),E),As),Ls),Ye);class Ns{constructor(e=0,t=1){this.nextValue=e,this.step=t}next(){const e=this.nextValue;return this.nextValue+=this.step,e}peek(){return this.nextValue}skip(e){this.nextValue+=e}}var Ms;!function(e){e[e.IN_PROGRESS=0]="IN_PROGRESS",e[e.RESOLVED=1]="RESOLVED"}(Ms||(Ms={}));class Gs{constructor(e){this.status=Ms.IN_PROGRESS,this.resolution=null,this.waiters=[],e(e=>this.onDone(e),e=>this.onReject(e))}static all(e){return new Gs(t=>{let i=e.length;const s=new Array(i);e.forEach((e,o)=>{e.then(e=>{s[o]=e,i--,0===i&&t(s)})})})}static resolve(e=null){return new Gs(t=>t(e))}then(e){return new Gs(t=>{this.status===Ms.RESOLVED?t(e(this.resolution)):this.waiters.push(i=>t(e(i)))})}resolveNow(e,t){return this.status===Ms.RESOLVED?t(this.resolution):e}onDone(e){this.status=Ms.RESOLVED,this.resolution=e,this.waiters.forEach(t=>t(e))}onReject(e){console.warn("TBI")}}class xs{constructor(){this.timestamp=(new Date).getTime()}print(e){const t=(new Date).getTime()-this.timestamp;console.info(`${e} = ${t}`),this.timestamp=(new Date).getTime()}}var _s,Vs,Hs=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};!function(e){e[e.NOTHING=0]="NOTHING",e[e.WAITING_TO_SHOW=1]="WAITING_TO_SHOW",e[e.SHOWING=2]="SHOWING"}(_s||(_s={})),function(e){e[e.HOVER=0]="HOVER",e[e.FOCUS=1]="FOCUS"}(Vs||(Vs={}));class ks extends Le{constructor(e,t,i){super(),this.parentComp=e,this.tooltipShowDelayOverride=t,this.tooltipHideDelayOverride=i,this.DEFAULT_SHOW_TOOLTIP_DELAY=2e3,this.DEFAULT_HIDE_TOOLTIP_DELAY=1e4,this.SHOW_QUICK_TOOLTIP_DIFF=1e3,this.FADE_OUT_TOOLTIP_TIMEOUT=1e3,this.INTERACTIVE_HIDE_DELAY=100,this.interactionEnabled=!1,this.isInteractingWithTooltip=!1,this.state=_s.NOTHING,this.tooltipInstanceCount=0,this.tooltipMouseTrack=!1}postConstruct(){this.gridOptionsService.is("tooltipInteraction")&&(this.interactionEnabled=!0),this.tooltipTrigger=this.getTooltipTrigger(),this.tooltipShowDelay=this.getTooltipDelay("show"),this.tooltipHideDelay=this.getTooltipDelay("hide"),this.tooltipMouseTrack=this.gridOptionsService.is("tooltipMouseTrack");const e=this.parentComp.getGui();this.tooltipTrigger===Vs.HOVER&&(this.addManagedListener(e,"mouseenter",this.onMouseEnter.bind(this)),this.addManagedListener(e,"mouseleave",this.onMouseLeave.bind(this))),this.tooltipTrigger===Vs.FOCUS&&(this.addManagedListener(e,"focusin",this.onFocusIn.bind(this)),this.addManagedListener(e,"focusout",this.onFocusOut.bind(this))),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.interactionEnabled||(this.addManagedListener(e,"mousedown",this.onMouseDown.bind(this)),this.addManagedListener(e,"keydown",this.onKeyDown.bind(this)))}getGridOptionsTooltipDelay(e){const i=this.gridOptionsService.getNum(e);if(t(i))return i<0&&T(()=>console.warn(`AG Grid: ${e} should not be lower than 0`),e+"Warn"),Math.max(200,i)}getTooltipDelay(e){var t,i,s,o;return"show"===e?null!==(i=null!==(t=this.getGridOptionsTooltipDelay("tooltipShowDelay"))&&void 0!==t?t:this.tooltipShowDelayOverride)&&void 0!==i?i:this.DEFAULT_SHOW_TOOLTIP_DELAY:null!==(o=null!==(s=this.getGridOptionsTooltipDelay("tooltipHideDelay"))&&void 0!==s?s:this.tooltipHideDelayOverride)&&void 0!==o?o:this.DEFAULT_HIDE_TOOLTIP_DELAY}destroy(){this.setToDoNothing(),super.destroy()}getTooltipTrigger(){const e=this.gridOptionsService.get("tooltipTrigger");return e&&"hover"!==e?Vs.FOCUS:Vs.HOVER}onMouseEnter(e){this.interactionEnabled&&this.interactiveTooltipTimeoutId&&(this.unlockService(),this.startHideTimeout()),ci()||(ks.isLocked?this.showTooltipTimeoutId=window.setTimeout(()=>{this.prepareToShowTooltip(e)},this.INTERACTIVE_HIDE_DELAY):this.prepareToShowTooltip(e))}onMouseMove(e){this.lastMouseEvent&&(this.lastMouseEvent=e),this.tooltipMouseTrack&&this.state===_s.SHOWING&&this.tooltipComp&&this.positionTooltip()}onMouseDown(){this.setToDoNothing()}onMouseLeave(){this.interactionEnabled?this.lockService():this.setToDoNothing()}onFocusIn(){this.prepareToShowTooltip()}onFocusOut(e){var t;const i=e.relatedTarget,s=this.parentComp.getGui(),o=null===(t=this.tooltipComp)||void 0===t?void 0:t.getGui();this.isInteractingWithTooltip||s.contains(i)||this.interactionEnabled&&(null==o?void 0:o.contains(i))||this.setToDoNothing()}onKeyDown(){this.setToDoNothing()}prepareToShowTooltip(e){if(this.state!=_s.NOTHING||ks.isLocked)return!1;let t=0;return e&&(t=this.isLastTooltipHiddenRecently()?200:this.tooltipShowDelay),this.lastMouseEvent=e||null,this.showTooltipTimeoutId=window.setTimeout(this.showTooltip.bind(this),t),this.state=_s.WAITING_TO_SHOW,!0}isLastTooltipHiddenRecently(){return(new Date).getTime()-ks.lastTooltipHideTime<this.SHOW_QUICK_TOOLTIP_DIFF}setToDoNothing(){this.state===_s.SHOWING&&this.hideTooltip(),this.onBodyScrollEventCallback&&(this.onBodyScrollEventCallback(),this.onBodyScrollEventCallback=void 0),this.onColumnMovedEventCallback&&(this.onColumnMovedEventCallback(),this.onColumnMovedEventCallback=void 0),this.clearTimeouts(),this.state=_s.NOTHING,this.lastMouseEvent=null}showTooltip(){const e=Object.assign({},this.parentComp.getTooltipParams());if(!t(e.value))return void this.setToDoNothing();this.state=_s.SHOWING,this.tooltipInstanceCount++;const i=this.newTooltipComponentCallback.bind(this,this.tooltipInstanceCount);this.userComponentFactory.getTooltipCompDetails(e).newAgStackInstance().then(i)}hideTooltip(e){if(!e&&this.isInteractingWithTooltip)return;this.tooltipComp&&(this.destroyTooltipComp(),ks.lastTooltipHideTime=(new Date).getTime());const t={type:_e.EVENT_TOOLTIP_HIDE,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(t),this.state=_s.NOTHING}newTooltipComponentCallback(e,t){if(this.state!==_s.SHOWING||this.tooltipInstanceCount!==e)return void this.getContext().destroyBean(t);const i=t.getGui();this.tooltipComp=t,i.classList.contains("ag-tooltip")||i.classList.add("ag-tooltip-custom"),this.tooltipTrigger===Vs.HOVER&&i.classList.add("ag-tooltip-animate"),this.interactionEnabled&&i.classList.add("ag-tooltip-interactive");const s=this.localeService.getLocaleTextFunc(),o=this.popupService.addPopup({eChild:i,ariaLabel:s("ariaLabelTooltip","Tooltip")});o&&(this.tooltipPopupDestroyFunc=o.hideFunc),this.positionTooltip(),this.tooltipTrigger===Vs.FOCUS&&(this.onBodyScrollEventCallback=this.addManagedListener(this.eventService,_e.EVENT_BODY_SCROLL,this.setToDoNothing.bind(this)),this.onColumnMovedEventCallback=this.addManagedListener(this.eventService,_e.EVENT_COLUMN_MOVED,this.setToDoNothing.bind(this))),this.interactionEnabled&&(this.tooltipTrigger===Vs.HOVER?(this.tooltipMouseEnterListener=this.addManagedListener(i,"mouseenter",this.onTooltipMouseEnter.bind(this))||null,this.tooltipMouseLeaveListener=this.addManagedListener(i,"mouseleave",this.onTooltipMouseLeave.bind(this))||null):(this.tooltipFocusInListener=this.addManagedListener(i,"focusin",this.onTooltipFocusIn.bind(this))||null,this.tooltipFocusOutListener=this.addManagedListener(i,"focusout",this.onTooltipFocusOut.bind(this))||null));const r={type:_e.EVENT_TOOLTIP_SHOW,tooltipGui:i,parentGui:this.parentComp.getGui()};this.eventService.dispatchEvent(r),this.startHideTimeout()}onTooltipMouseEnter(){this.isInteractingWithTooltip=!0,this.unlockService()}onTooltipMouseLeave(){this.isInteractingWithTooltip=!1,this.lockService()}onTooltipFocusIn(){this.isInteractingWithTooltip=!0}onTooltipFocusOut(e){var t;const i=this.parentComp.getGui(),s=null===(t=this.tooltipComp)||void 0===t?void 0:t.getGui(),o=e.relatedTarget;(null==s?void 0:s.contains(o))||(this.isInteractingWithTooltip=!1,i.contains(o)?this.startHideTimeout():this.hideTooltip())}positionTooltip(){const e={type:"tooltip",ePopup:this.tooltipComp.getGui(),nudgeY:18,skipObserver:this.tooltipMouseTrack};this.lastMouseEvent?this.popupService.positionPopupUnderMouseEvent(Object.assign(Object.assign({},e),{mouseEvent:this.lastMouseEvent})):this.popupService.positionPopupByComponent(Object.assign(Object.assign({},e),{eventSource:this.parentComp.getGui(),position:"under",keepWithinBounds:!0,nudgeY:5}))}destroyTooltipComp(){this.tooltipComp.getGui().classList.add("ag-tooltip-hiding");const e=this.tooltipPopupDestroyFunc,t=this.tooltipComp,i=this.tooltipTrigger===Vs.HOVER?this.FADE_OUT_TOOLTIP_TIMEOUT:0;window.setTimeout(()=>{e(),this.getContext().destroyBean(t)},i),this.clearTooltipListeners(),this.tooltipPopupDestroyFunc=void 0,this.tooltipComp=void 0}clearTooltipListeners(){[this.tooltipMouseEnterListener,this.tooltipMouseLeaveListener,this.tooltipFocusInListener,this.tooltipFocusOutListener].forEach(e=>{e&&e()}),this.tooltipMouseEnterListener=this.tooltipMouseLeaveListener=this.tooltipFocusInListener=this.tooltipFocusOutListener=null}lockService(){ks.isLocked=!0,this.interactiveTooltipTimeoutId=window.setTimeout(()=>{this.unlockService(),this.setToDoNothing()},this.INTERACTIVE_HIDE_DELAY)}unlockService(){ks.isLocked=!1,this.clearInteractiveTimeout()}startHideTimeout(){this.clearHideTimeout(),this.hideTooltipTimeoutId=window.setTimeout(this.hideTooltip.bind(this),this.tooltipHideDelay)}clearShowTimeout(){this.showTooltipTimeoutId&&(window.clearTimeout(this.showTooltipTimeoutId),this.showTooltipTimeoutId=void 0)}clearHideTimeout(){this.hideTooltipTimeoutId&&(window.clearTimeout(this.hideTooltipTimeoutId),this.hideTooltipTimeoutId=void 0)}clearInteractiveTimeout(){this.interactiveTooltipTimeoutId&&(window.clearTimeout(this.interactiveTooltipTimeoutId),this.interactiveTooltipTimeoutId=void 0)}clearTimeouts(){this.clearShowTimeout(),this.clearHideTimeout(),this.clearInteractiveTimeout()}}ks.isLocked=!1,Hs([j("popupService")],ks.prototype,"popupService",void 0),Hs([j("userComponentFactory")],ks.prototype,"userComponentFactory",void 0),Hs([B],ks.prototype,"postConstruct",null);class Bs{constructor(e){this.cssClassStates={},this.getGui=e}addCssClass(e){const t=(e||"").split(" ");if(t.length>1)return void t.forEach(e=>this.addCssClass(e));if(!0!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.add(e),this.cssClassStates[e]=!0}}removeCssClass(e){const t=(e||"").split(" ");if(t.length>1)return void t.forEach(e=>this.removeCssClass(e));if(!1!==this.cssClassStates[e]&&e.length){const t=this.getGui();t&&t.classList.remove(e),this.cssClassStates[e]=!1}}containsCssClass(e){const t=this.getGui();return!!t&&t.classList.contains(e)}addOrRemoveCssClass(e,t){if(!e)return;if(e.indexOf(" ")>=0){const i=(e||"").split(" ");if(i.length>1)return void i.forEach(e=>this.addOrRemoveCssClass(e,t))}if(this.cssClassStates[e]!==t&&e.length){const i=this.getGui();i&&i.classList.toggle(e,t),this.cssClassStates[e]=t}}}var Ws=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const Us=new Ns;class js extends Le{constructor(e){super(),this.displayed=!0,this.visible=!0,this.compId=Us.next(),this.cssClassManager=new Bs(()=>this.eGui),e&&this.setTemplate(e)}preConstructOnComponent(){this.usingBrowserTooltips=this.gridOptionsService.is("enableBrowserTooltips")}getCompId(){return this.compId}getTooltipParams(){return{value:this.tooltipText,location:"UNKNOWN"}}setTooltip(e,t,i){const s=()=>{this.usingBrowserTooltips?this.getGui().removeAttribute("title"):this.tooltipFeature=this.destroyBean(this.tooltipFeature)},o=()=>{this.usingBrowserTooltips?this.getGui().setAttribute("title",this.tooltipText):this.tooltipFeature=this.createBean(new ks(this,t,i))};this.tooltipText!=e&&(this.tooltipText&&s(),null!=e&&(this.tooltipText=e,this.tooltipText&&o()))}createChildComponentsFromTags(e,t){hs(e.childNodes).forEach(i=>{if(!(i instanceof HTMLElement))return;const s=this.createComponentFromElement(i,e=>{e.getGui()&&this.copyAttributesFromNode(i,e.getGui())},t);if(s){if(s.addItems&&i.children.length){this.createChildComponentsFromTags(i,t);const e=Array.prototype.slice.call(i.children);s.addItems(e)}this.swapComponentForNode(s,e,i)}else i.childNodes&&this.createChildComponentsFromTags(i,t)})}createComponentFromElement(e,t,i){const s=e.nodeName,o=i?i[e.getAttribute("ref")]:void 0,r=this.agStackComponentsRegistry.getComponentClass(s);if(r){js.elementGettingCreated=e;const i=new r(o);return i.setParentComponent(this),this.createBean(i,null,t),i}return null}copyAttributesFromNode(e,t){cs(e.attributes,(e,i)=>t.setAttribute(e,i))}swapComponentForNode(e,t,i){const s=e.getGui();t.replaceChild(s,i),t.insertBefore(document.createComment(i.nodeName),s),this.addDestroyFunc(this.destroyBean.bind(this,e)),this.swapInComponentForQuerySelectors(e,i)}swapInComponentForQuerySelectors(e,t){const i=this;this.iterateOverQuerySelectors(s=>{i[s.attributeName]===t&&(i[s.attributeName]=e)})}iterateOverQuerySelectors(e){let t=Object.getPrototypeOf(this);for(;null!=t;){const i=t.__agComponentMetaData,s=b(t.constructor);i&&i[s]&&i[s].querySelectors&&i[s].querySelectors.forEach(t=>e(t)),t=Object.getPrototypeOf(t)}}activateTabIndex(e){const t=this.gridOptionsService.getNum("tabIndex")||0;e||(e=[]),e.length||e.push(this.getGui()),e.forEach(e=>e.setAttribute("tabindex",t.toString()))}setTemplate(e,t){const i=Qi(e);this.setTemplateFromElement(i,t)}setTemplateFromElement(e,t){this.eGui=e,this.eGui.__agComponent=this,this.wireQuerySelectors(),this.getContext()&&this.createChildComponentsFromTags(this.getGui(),t)}createChildComponentsPreConstruct(){this.getGui()&&this.createChildComponentsFromTags(this.getGui())}wireQuerySelectors(){if(!this.eGui)return;const e=this;this.iterateOverQuerySelectors(t=>{const i=i=>e[t.attributeName]=i;if(t.refSelector&&this.getAttribute("ref")===t.refSelector)i(this.eGui);else{const e=this.eGui.querySelector(t.querySelector);e&&i(e.__agComponent||e)}})}getGui(){return this.eGui}getFocusableElement(){return this.eGui}getAriaElement(){return this.getFocusableElement()}setParentComponent(e){this.parentComponent=e}getParentComponent(){return this.parentComponent}setGui(e){this.eGui=e}queryForHtmlElement(e){return this.eGui.querySelector(e)}queryForHtmlInputElement(e){return this.eGui.querySelector(e)}appendChild(e,t){if(null!=e)if(t||(t=this.eGui),ds(e))t.appendChild(e);else{const i=e;t.appendChild(i.getGui())}}isDisplayed(){return this.displayed}setVisible(e,t={}){if(e!==this.visible){this.visible=e;const{skipAriaHidden:i}=t;Gi(this.eGui,e,{skipAriaHidden:i})}}setDisplayed(e,t={}){if(e!==this.displayed){this.displayed=e;const{skipAriaHidden:i}=t;Mi(this.eGui,e,{skipAriaHidden:i});const s={type:js.EVENT_DISPLAYED_CHANGED,visible:this.displayed};this.dispatchEvent(s)}}destroy(){this.tooltipFeature&&(this.tooltipFeature=this.destroyBean(this.tooltipFeature)),this.parentComponent&&(this.parentComponent=void 0);const e=this.eGui;e&&e.__agComponent&&(e.__agComponent=void 0),super.destroy()}addGuiEventListener(e,t,i){this.eGui.addEventListener(e,t,i),this.addDestroyFunc(()=>this.eGui.removeEventListener(e,t))}addCssClass(e){this.cssClassManager.addCssClass(e)}removeCssClass(e){this.cssClassManager.removeCssClass(e)}containsCssClass(e){return this.cssClassManager.containsCssClass(e)}addOrRemoveCssClass(e,t){this.cssClassManager.addOrRemoveCssClass(e,t)}getAttribute(e){const{eGui:t}=this;return t?t.getAttribute(e):null}getRefElement(e){return this.queryForHtmlElement(`[ref="${e}"]`)}}function zs(e){return Ys.bind(this,e,void 0)}function Ks(e){return Ys.bind(this,`[ref=${e}]`,e)}function Ys(e,t,i,s,o){null!==e?"number"!=typeof o?function(e,t,i){const s=function(e,t){e.__agComponentMetaData||(e.__agComponentMetaData={});e.__agComponentMetaData[t]||(e.__agComponentMetaData[t]={});return e.__agComponentMetaData[t]}(e,b(e.constructor));s[t]||(s[t]=[]);s[t].push(i)}(i,"querySelectors",{attributeName:s,querySelector:e,refSelector:t}):console.error("AG Grid: QuerySelector should be on an attribute"):console.error("AG Grid: QuerySelector selector should not be null")}js.EVENT_DISPLAYED_CHANGED="displayedChanged",Ws([j("agStackComponentsRegistry")],js.prototype,"agStackComponentsRegistry",void 0),Ws([k],js.prototype,"preConstructOnComponent",null),Ws([k],js.prototype,"createChildComponentsPreConstruct",null);var $s=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class qs extends js{constructor(){super('\n            <div class="ag-floating-filter-input" role="presentation">\n                <ag-input-text-field ref="eFloatingFilterText"></ag-input-text-field>\n            </div>')}destroy(){super.destroy()}init(e){this.params=e;const t=this.columnModel.getDisplayNameForColumn(e.column,"header",!0),i=this.localeService.getLocaleTextFunc();this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${i("ariaFilterInput","Filter Input")}`)}onParentModelChanged(e){e?this.params.parentFilterInstance(t=>{if(t.getModelAsString){const i=t.getModelAsString(e);this.eFloatingFilterText.setValue(i)}}):this.eFloatingFilterText.setValue("")}onParamsUpdated(e){this.init(e)}}$s([Ks("eFloatingFilterText")],qs.prototype,"eFloatingFilterText",void 0),$s([j("columnModel")],qs.prototype,"columnModel",void 0);class Qs{constructor(e,t,i,s){this.alive=!0,this.context=e,this.eParent=s;t.getDateCompDetails(i).newAgStackInstance().then(t=>{this.alive?(this.dateComp=t,t&&(s.appendChild(t.getGui()),t.afterGuiAttached&&t.afterGuiAttached(),this.tempValue&&t.setDate(this.tempValue),null!=this.disabled&&this.setDateCompDisabled(this.disabled))):e.destroyBean(t)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){this.dateComp?this.dateComp.setDate(e):this.tempValue=e}setDisabled(e){this.dateComp?this.setDateCompDisabled(e):this.disabled=e}setDisplayed(e){Mi(this.eParent,e)}setInputPlaceholder(e){this.dateComp&&this.dateComp.setInputPlaceholder&&this.dateComp.setInputPlaceholder(e)}setInputAriaLabel(e){this.dateComp&&this.dateComp.setInputAriaLabel&&this.dateComp.setInputAriaLabel(e)}afterGuiAttached(e){this.dateComp&&"function"==typeof this.dateComp.afterGuiAttached&&this.dateComp.afterGuiAttached(e)}updateParams(e){var t;(null===(t=this.dateComp)||void 0===t?void 0:t.onParamsUpdated)&&"function"==typeof this.dateComp.onParamsUpdated&&this.dateComp.onParamsUpdated(e)}setDateCompDisabled(e){null!=this.dateComp&&null!=this.dateComp.setDisabled&&this.dateComp.setDisabled(e)}}class Xs{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions||t,this.mapCustomOptions(),this.selectDefaultItem(e)}getFilterOptions(){return this.filterOptions}mapCustomOptions(){this.filterOptions&&this.filterOptions.forEach(e=>{if("string"==typeof e)return;[["displayKey"],["displayName"],["predicate","test"]].every(t=>!!t.some(t=>null!=e[t])||(console.warn(`AG Grid: ignoring FilterOptionDef as it doesn't contain one of '${t}'`),!1))?this.customFilterOptions[e.displayKey]=e:this.filterOptions=this.filterOptions.filter(t=>t===e)||[]})}selectDefaultItem(e){if(e.defaultOption)this.defaultOption=e.defaultOption;else if(this.filterOptions.length>=1){const e=this.filterOptions[0];"string"==typeof e?this.defaultOption=e:e.displayKey?this.defaultOption=e.displayKey:console.warn("AG Grid: invalid FilterOptionDef supplied as it doesn't contain a 'displayKey'")}else console.warn("AG Grid: no filter options for filter")}getDefaultOption(){return this.defaultOption}getCustomOption(e){return this.customFilterOptions[e]}}const Js={applyFilter:"Apply",clearFilter:"Clear",resetFilter:"Reset",cancelFilter:"Cancel",textFilter:"Text Filter",numberFilter:"Number Filter",dateFilter:"Date Filter",setFilter:"Set Filter",filterOoo:"Filter...",empty:"Choose One",equals:"Equals",notEqual:"Not equal",lessThan:"Less than",greaterThan:"Greater than",inRange:"In range",inRangeStart:"From",inRangeEnd:"To",lessThanOrEqual:"Less than or equals",greaterThanOrEqual:"Greater than or equals",contains:"Contains",notContains:"Not contains",startsWith:"Starts with",endsWith:"Ends with",blank:"Blank",notBlank:"Not blank",andCondition:"AND",orCondition:"OR",dateFormatOoo:"yyyy-mm-dd"};var Zs=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class eo extends Le{constructor(e,t={}){super(),this.eFocusableElement=e,this.callbacks=t,this.callbacks=Object.assign({shouldStopEventPropagation:()=>!1,onTabKeyDown:e=>{if(e.defaultPrevented)return;const t=this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e.shiftKey);t&&(t.focus(),e.preventDefault())}},t)}postConstruct(){this.eFocusableElement.classList.add(eo.FOCUS_MANAGED_CLASS),this.addKeyDownListeners(this.eFocusableElement),this.callbacks.onFocusIn&&this.addManagedListener(this.eFocusableElement,"focusin",this.callbacks.onFocusIn),this.callbacks.onFocusOut&&this.addManagedListener(this.eFocusableElement,"focusout",this.callbacks.onFocusOut)}addKeyDownListeners(e){this.addManagedListener(e,"keydown",e=>{e.defaultPrevented||Ee(e)||(this.callbacks.shouldStopEventPropagation(e)?Se(e):e.key===ys.TAB?this.callbacks.onTabKeyDown(e):this.callbacks.handleKeyDown&&this.callbacks.handleKeyDown(e))})}}eo.FOCUS_MANAGED_CLASS="ag-focus-managed",Zs([j("focusService")],eo.prototype,"focusService",void 0),Zs([B],eo.prototype,"postConstruct",null);var to=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class io extends Le{constructor(e,t){super(),this.element=e,this.dragStartPosition={x:0,y:0},this.position={x:0,y:0},this.lastSize={width:-1,height:-1},this.positioned=!1,this.resizersAdded=!1,this.resizeListeners=[],this.boundaryEl=null,this.isResizing=!1,this.isMoving=!1,this.resizable={},this.movable=!1,this.currentResizer=null,this.config=Object.assign({},{popup:!1},t)}center(){const{clientHeight:e,clientWidth:t}=this.offsetParent,i=t/2-this.getWidth()/2,s=e/2-this.getHeight()/2;this.offsetElement(i,s)}initialisePosition(){if(this.positioned)return;const{centered:e,forcePopupParentAsOffsetParent:t,minWidth:i,width:s,minHeight:o,height:r,x:n,y:l}=this.config;this.offsetParent||this.setOffsetParent();let a=0,d=0;const h=!!this.element.offsetParent;if(h){const e=this.findBoundaryElement(),t=window.getComputedStyle(e);if(null!=t.minWidth){const i=e.offsetWidth-this.element.offsetWidth;d=parseInt(t.minWidth,10)-i}if(null!=t.minHeight){const i=e.offsetHeight-this.element.offsetHeight;a=parseInt(t.minHeight,10)-i}}if(this.minHeight=o||a,this.minWidth=i||d,s&&this.setWidth(s),r&&this.setHeight(r),s&&r||this.refreshSize(),e)this.center();else if(n||l)this.offsetElement(n,l);else if(h&&t){let e=this.boundaryEl,t=!0;if(e||(e=this.findBoundaryElement(),t=!1),e){const i=parseFloat(e.style.top),s=parseFloat(e.style.left);t?this.offsetElement(isNaN(s)?0:s,isNaN(i)?0:i):this.setPosition(s,i)}}this.positioned=!!this.offsetParent}isPositioned(){return this.positioned}getPosition(){return this.position}setMovable(e,t){if(!this.config.popup||e===this.movable)return;this.movable=e;const i=this.moveElementDragListener||{eElement:t,onDragStart:this.onMoveStart.bind(this),onDragging:this.onMove.bind(this),onDragStop:this.onMoveEnd.bind(this)};e?(this.dragService.addDragSource(i),this.moveElementDragListener=i):(this.dragService.removeDragSource(i),this.moveElementDragListener=void 0)}setResizable(e){if(this.clearResizeListeners(),e?this.addResizers():this.removeResizers(),"boolean"==typeof e){if(!1===e)return;e={topLeft:e,top:e,topRight:e,right:e,bottomRight:e,bottom:e,bottomLeft:e,left:e}}Object.keys(e).forEach(t=>{const i=!!e[t],s=this.getResizerElement(t),o={dragStartPixels:0,eElement:s,onDragStart:e=>this.onResizeStart(e,t),onDragging:this.onResize.bind(this),onDragStop:e=>this.onResizeEnd(e,t)};(i||!this.isAlive()&&!i)&&(i?(this.dragService.addDragSource(o),this.resizeListeners.push(o),s.style.pointerEvents="all"):s.style.pointerEvents="none",this.resizable[t]=i)})}removeSizeFromEl(){this.element.style.removeProperty("height"),this.element.style.removeProperty("width"),this.element.style.removeProperty("flex")}restoreLastSize(){this.element.style.flex="0 0 auto";const{height:e,width:t}=this.lastSize;-1!==t&&(this.element.style.width=t+"px"),-1!==e&&(this.element.style.height=e+"px")}getHeight(){return this.element.offsetHeight}setHeight(e){const{popup:t}=this.config,i=this.element;let s=!1;if("string"==typeof e&&-1!==e.indexOf("%"))ls(i,e),e=Bi(i),s=!0;else if(e=Math.max(this.minHeight,e),this.positioned){const t=this.getAvailableHeight();t&&e>t&&(e=t)}this.getHeight()!==e&&(s?(i.style.maxHeight="unset",i.style.minHeight="unset"):t?ls(i,e):(i.style.height=e+"px",i.style.flex="0 0 auto",this.lastSize.height="number"==typeof e?e:parseFloat(e)))}getAvailableHeight(){const{popup:e,forcePopupParentAsOffsetParent:t}=this.config;this.positioned||this.initialisePosition();const{clientHeight:i}=this.offsetParent;if(!i)return null;const s=this.element.getBoundingClientRect(),o=this.offsetParent.getBoundingClientRect(),r=e?this.position.y:s.top,n=e?0:o.top;let l=0;if(t){const e=this.element.parentElement;if(e){const{bottom:t}=e.getBoundingClientRect();l=t-s.bottom}}return i+n-r-l}getWidth(){return this.element.offsetWidth}setWidth(e){const t=this.element,{popup:i}=this.config;let s=!1;if("string"==typeof e&&-1!==e.indexOf("%"))ns(t,e),e=Wi(t),s=!0;else if(this.positioned){e=Math.max(this.minWidth,e);const{clientWidth:t}=this.offsetParent,s=i?this.position.x:this.element.getBoundingClientRect().left;t&&e+s>t&&(e=t-s)}this.getWidth()!==e&&(s?(t.style.maxWidth="unset",t.style.minWidth="unset"):this.config.popup?ns(t,e):(t.style.width=e+"px",t.style.flex=" unset",this.lastSize.width="number"==typeof e?e:parseFloat(e)))}offsetElement(e=0,t=0){const{forcePopupParentAsOffsetParent:i}=this.config,s=i?this.boundaryEl:this.element;s&&(this.popupService.positionPopup({ePopup:s,keepWithinBounds:!0,skipObserver:this.movable||this.isResizable(),updatePosition:()=>({x:e,y:t})}),this.setPosition(parseFloat(s.style.left),parseFloat(s.style.top)))}constrainSizeToAvailableHeight(e){if(!this.config.forcePopupParentAsOffsetParent)return;const t=()=>{const e=this.getAvailableHeight();this.element.style.setProperty("max-height",e+"px")};e?this.resizeObserverSubscriber=this.resizeObserverService.observeResize(this.popupService.getPopupParent(),t):(this.element.style.removeProperty("max-height"),this.resizeObserverSubscriber&&(this.resizeObserverSubscriber(),this.resizeObserverSubscriber=void 0))}setPosition(e,t){this.position.x=e,this.position.y=t}updateDragStartPosition(e,t){this.dragStartPosition={x:e,y:t}}calculateMouseMovement(e){const{e:t,isLeft:i,isTop:s,anywhereWithin:o,topBuffer:r}=e,n=t.clientX-this.dragStartPosition.x,l=t.clientY-this.dragStartPosition.y;return{movementX:this.shouldSkipX(t,!!i,!!o,n)?0:n,movementY:this.shouldSkipY(t,!!s,r,l)?0:l}}shouldSkipX(e,t,i,s){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.x:o.left;let a=l<=0&&r.left>=e.clientX||r.right<=e.clientX&&r.right<=n.right;return!!a||(a=t?s<0&&e.clientX>l+r.left||s>0&&e.clientX<l+r.left:i?s<0&&e.clientX>n.right||s>0&&e.clientX<l+r.left:s<0&&e.clientX>n.right||s>0&&e.clientX<n.right,a)}shouldSkipY(e,t,i=0,s){const o=this.element.getBoundingClientRect(),r=this.offsetParent.getBoundingClientRect(),n=this.boundaryEl.getBoundingClientRect(),l=this.config.popup?this.position.y:o.top;let a=l<=0&&r.top>=e.clientY||r.bottom<=e.clientY&&r.bottom<=n.bottom;return!!a||(a=t?s<0&&e.clientY>l+r.top+i||s>0&&e.clientY<l+r.top:s<0&&e.clientY>n.bottom||s>0&&e.clientY<n.bottom,a)}createResizeMap(){const e=this.element;this.resizerMap={topLeft:{element:e.querySelector("[ref=eTopLeftResizer]")},top:{element:e.querySelector("[ref=eTopResizer]")},topRight:{element:e.querySelector("[ref=eTopRightResizer]")},right:{element:e.querySelector("[ref=eRightResizer]")},bottomRight:{element:e.querySelector("[ref=eBottomRightResizer]")},bottom:{element:e.querySelector("[ref=eBottomResizer]")},bottomLeft:{element:e.querySelector("[ref=eBottomLeftResizer]")},left:{element:e.querySelector("[ref=eLeftResizer]")}}}addResizers(){if(this.resizersAdded)return;const e=this.element;if(!e)return;const t=(new DOMParser).parseFromString('<div class="ag-resizer-wrapper">\n        <div ref="eTopLeftResizer" class="ag-resizer ag-resizer-topLeft"></div>\n        <div ref="eTopResizer" class="ag-resizer ag-resizer-top"></div>\n        <div ref="eTopRightResizer" class="ag-resizer ag-resizer-topRight"></div>\n        <div ref="eRightResizer" class="ag-resizer ag-resizer-right"></div>\n        <div ref="eBottomRightResizer" class="ag-resizer ag-resizer-bottomRight"></div>\n        <div ref="eBottomResizer" class="ag-resizer ag-resizer-bottom"></div>\n        <div ref="eBottomLeftResizer" class="ag-resizer ag-resizer-bottomLeft"></div>\n        <div ref="eLeftResizer" class="ag-resizer ag-resizer-left"></div>\n    </div>',"text/html").body;e.appendChild(t.firstChild),this.createResizeMap(),this.resizersAdded=!0}removeResizers(){this.resizerMap=void 0;const e=this.element.querySelector(".ag-resizer-wrapper");e&&this.element.removeChild(e),this.resizersAdded=!1}getResizerElement(e){return this.resizerMap[e].element}onResizeStart(e,t){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.currentResizer={isTop:!!t.match(/top/i),isRight:!!t.match(/right/i),isBottom:!!t.match(/bottom/i),isLeft:!!t.match(/left/i)},this.element.classList.add("ag-resizing"),this.resizerMap[t].element.classList.add("ag-active");const{popup:i,forcePopupParentAsOffsetParent:s}=this.config;i||s||this.applySizeToSiblings(this.currentResizer.isBottom||this.currentResizer.isTop),this.isResizing=!0,this.updateDragStartPosition(e.clientX,e.clientY)}getSiblings(){const e=this.element.parentElement;return e?Array.prototype.slice.call(e.children).filter(e=>!e.classList.contains("ag-hidden")):null}getMinSizeOfSiblings(){const e=this.getSiblings()||[];let t=0,i=0;for(let s=0;s<e.length;s++){const o=e[s],r=!!o.style.flex&&"0 0 auto"!==o.style.flex;if(o===this.element)continue;let n=this.minHeight||0,l=this.minWidth||0;if(r){const e=window.getComputedStyle(o);e.minHeight&&(n=parseInt(e.minHeight,10)),e.minWidth&&(l=parseInt(e.minWidth,10))}else n=o.offsetHeight,l=o.offsetWidth;t+=n,i+=l}return{height:t,width:i}}applySizeToSiblings(e){let t=null;const i=this.getSiblings();if(i){for(let s=0;s<i.length;s++){const o=i[s];o!==t&&(e?o.style.height=o.offsetHeight+"px":o.style.width=o.offsetWidth+"px",o.style.flex="0 0 auto",o===this.element&&(t=i[s+1]))}t&&(t.style.removeProperty("height"),t.style.removeProperty("min-height"),t.style.removeProperty("max-height"),t.style.flex="1 1 auto")}}isResizable(){return Object.values(this.resizable).some(e=>e)}onResize(e){if(!this.isResizing||!this.currentResizer)return;const{popup:t,forcePopupParentAsOffsetParent:i}=this.config,{isTop:s,isRight:o,isBottom:r,isLeft:n}=this.currentResizer,l=o||n,a=r||s,{movementX:d,movementY:h}=this.calculateMouseMovement({e:e,isLeft:n,isTop:s}),c=this.position.x,u=this.position.y;let p=0,g=0;if(l&&d){const e=n?-1:1,t=this.getWidth(),i=t+d*e;let s=!1;n&&(p=t-i,(c+p<=0||i<=this.minWidth)&&(s=!0,p=0)),s||this.setWidth(i)}if(a&&h){const e=s?-1:1,t=this.getHeight(),i=t+h*e;let o=!1;s?(g=t-i,(u+g<=0||i<=this.minHeight)&&(o=!0,g=0)):!this.config.popup&&!this.config.forcePopupParentAsOffsetParent&&t<i&&this.getMinSizeOfSiblings().height+i>this.element.parentElement.offsetHeight&&(o=!0),o||this.setHeight(i)}this.updateDragStartPosition(e.clientX,e.clientY),((t||i)&&p||g)&&this.offsetElement(c+p,u+g)}onResizeEnd(e,t){this.isResizing=!1,this.currentResizer=null,this.boundaryEl=null;const i={type:"resize",api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi};this.element.classList.remove("ag-resizing"),this.resizerMap[t].element.classList.remove("ag-active"),this.dispatchEvent(i)}refreshSize(){const e=this.element;this.config.popup&&(this.config.width||this.setWidth(e.offsetWidth),this.config.height||this.setHeight(e.offsetHeight))}onMoveStart(e){this.boundaryEl=this.findBoundaryElement(),this.positioned||this.initialisePosition(),this.isMoving=!0,this.element.classList.add("ag-moving"),this.updateDragStartPosition(e.clientX,e.clientY)}onMove(e){if(!this.isMoving)return;const{x:t,y:i}=this.position;let s;this.config.calculateTopBuffer&&(s=this.config.calculateTopBuffer());const{movementX:o,movementY:r}=this.calculateMouseMovement({e:e,isTop:!0,anywhereWithin:!0,topBuffer:s});this.offsetElement(t+o,i+r),this.updateDragStartPosition(e.clientX,e.clientY)}onMoveEnd(){this.isMoving=!1,this.boundaryEl=null,this.element.classList.remove("ag-moving")}setOffsetParent(){this.config.forcePopupParentAsOffsetParent?this.offsetParent=this.popupService.getPopupParent():this.offsetParent=this.element.offsetParent}findBoundaryElement(){let e=this.element;for(;e;){if("static"!==window.getComputedStyle(e).position)return e;e=e.parentElement}return this.element}clearResizeListeners(){for(;this.resizeListeners.length;){const e=this.resizeListeners.pop();this.dragService.removeDragSource(e)}}destroy(){super.destroy(),this.moveElementDragListener&&this.dragService.removeDragSource(this.moveElementDragListener),this.constrainSizeToAvailableHeight(!1),this.clearResizeListeners(),this.removeResizers()}}to([j("popupService")],io.prototype,"popupService",void 0),to([j("resizeObserverService")],io.prototype,"resizeObserverService",void 0),to([j("dragService")],io.prototype,"dragService",void 0);var so=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class oo extends js{constructor(e){super(),this.filterNameKey=e,this.applyActive=!1,this.hidePopup=null,this.debouncePending=!1,this.appliedModel=null}postConstruct(){this.resetTemplate(),this.createManagedBean(new eo(this.getFocusableElement(),{handleKeyDown:this.handleKeyDown.bind(this)})),this.positionableFeature=new io(this.getPositionableElement(),{forcePopupParentAsOffsetParent:!0}),this.createBean(this.positionableFeature)}handleKeyDown(e){}getFilterTitle(){return this.translate(this.filterNameKey)}isFilterActive(){return!!this.appliedModel}resetTemplate(e){let t=this.getGui();t&&t.removeEventListener("submit",this.onFormSubmit);const i=`\n            <form class="ag-filter-wrapper">\n                <div class="ag-filter-body-wrapper ag-${this.getCssIdentifier()}-body-wrapper" ref="eFilterBody">\n                    ${this.createBodyTemplate()}\n                </div>\n            </form>`;this.setTemplate(i,e),t=this.getGui(),t&&t.addEventListener("submit",this.onFormSubmit)}isReadOnly(){return!!this.providedFilterParams.readOnly}init(e){this.setParams(e),this.resetUiToDefaults(!0).then(()=>{this.updateUiVisibility(),this.setupOnBtApplyDebounce()})}setParams(e){this.providedFilterParams=e,this.applyActive=oo.isUseApplyButton(e),this.createButtonPanel()}createButtonPanel(){const{buttons:e}=this.providedFilterParams;if(!e||e.length<1||this.isReadOnly())return;const t=document.createElement("div");t.classList.add("ag-filter-apply-panel");const i=e=>{let i,s;switch(e){case"apply":i=this.translate("applyFilter"),s=e=>this.onBtApply(!1,!1,e);break;case"clear":i=this.translate("clearFilter"),s=()=>this.onBtClear();break;case"reset":i=this.translate("resetFilter"),s=()=>this.onBtReset();break;case"cancel":i=this.translate("cancelFilter"),s=e=>{this.onBtCancel(e)};break;default:return void console.warn("AG Grid: Unknown button type specified")}const o=Qi(`<button\n                    type="${"apply"===e?"submit":"button"}"\n                    ref="${e}FilterButton"\n                    class="ag-button ag-standard-button ag-filter-apply-panel-button"\n                >${i}\n                </button>`);t.appendChild(o),this.addManagedListener(o,"click",s)};Fs(e).forEach(e=>i(e)),this.getGui().appendChild(t)}getDefaultDebounceMs(){return 0}setupOnBtApplyDebounce(){const e=oo.getDebounceMs(this.providedFilterParams,this.getDefaultDebounceMs()),t=I(this.checkApplyDebounce.bind(this),e);this.onBtApplyDebounce=()=>{this.debouncePending=!0,t()}}checkApplyDebounce(){this.debouncePending&&(this.debouncePending=!1,this.onBtApply())}getModel(){return this.appliedModel?this.appliedModel:null}setModel(e){return(null!=e?this.setModelIntoUi(e):this.resetUiToDefaults()).then(()=>{this.updateUiVisibility(),this.applyModel("api")})}onBtCancel(e){this.resetUiToActiveModel(this.getModel(),()=>{this.handleCancelEnd(e)})}handleCancelEnd(e){this.providedFilterParams.closeOnApply&&this.close(e)}resetUiToActiveModel(e,t){const i=()=>{this.onUiChanged(!1,"prevent"),null==t||t()};null!=e?this.setModelIntoUi(e).then(i):this.resetUiToDefaults().then(i)}onBtClear(){this.resetUiToDefaults().then(()=>this.onUiChanged())}onBtReset(){this.onBtClear(),this.onBtApply()}applyModel(e="api"){const t=this.getModelFromUi();if(!this.isModelValid(t))return!1;const i=this.appliedModel;return this.appliedModel=t,!this.areModelsEqual(i,t)}isModelValid(e){return!0}onFormSubmit(e){e.preventDefault()}onBtApply(e=!1,t=!1,i){if(i&&i.preventDefault(),this.applyModel(t?"rowDataUpdated":"ui")){const i="columnFilter";this.providedFilterParams.filterChangedCallback({afterFloatingFilter:e,afterDataChange:t,source:i})}const{closeOnApply:s}=this.providedFilterParams;s&&this.applyActive&&!e&&!t&&this.close(i)}onNewRowsLoaded(){}close(e){if(!this.hidePopup)return;const t=e,i=t&&t.key;let s;"Enter"!==i&&"Space"!==i||(s={keyboardEvent:t}),this.hidePopup(s),this.hidePopup=null}onUiChanged(e=!1,t){if(this.updateUiVisibility(),this.providedFilterParams.filterModifiedCallback(),this.applyActive&&!this.isReadOnly()){const e=this.isModelValid(this.getModelFromUi());xi(this.getRefElement("applyFilterButton"),!e)}e&&!t||"immediately"===t?this.onBtApply(e):(this.applyActive||t)&&"debounce"!==t||this.onBtApplyDebounce()}afterGuiAttached(e){e&&(this.hidePopup=e.hidePopup),this.refreshFilterResizer(null==e?void 0:e.container)}refreshFilterResizer(e){if(!this.positionableFeature||"toolPanel"===e)return;const t="floatingFilter"===e,{positionableFeature:i,gridOptionsService:s}=this;t?(i.restoreLastSize(),i.setResizable(s.is("enableRtl")?{bottom:!0,bottomLeft:!0,left:!0}:{bottom:!0,bottomRight:!0,right:!0})):(this.positionableFeature.removeSizeFromEl(),this.positionableFeature.setResizable(!1)),this.positionableFeature.constrainSizeToAvailableHeight(!0)}afterGuiDetached(){this.checkApplyDebounce(),this.positionableFeature&&this.positionableFeature.constrainSizeToAvailableHeight(!1)}static getDebounceMs(e,t){return oo.isUseApplyButton(e)?(null!=e.debounceMs&&console.warn("AG Grid: debounceMs is ignored when apply button is present"),0):null!=e.debounceMs?e.debounceMs:t}static isUseApplyButton(e){return!!e.buttons&&e.buttons.indexOf("apply")>=0}destroy(){const e=this.getGui();e&&e.removeEventListener("submit",this.onFormSubmit),this.hidePopup=null,this.positionableFeature&&(this.positionableFeature=this.destroyBean(this.positionableFeature)),super.destroy()}translate(e){return this.localeService.getLocaleTextFunc()(e,Js[e])}getCellValue(e){const{api:t,colDef:i,column:s,columnApi:o,context:r}=this.providedFilterParams;return this.providedFilterParams.valueGetter({api:t,colDef:i,column:s,columnApi:o,context:r,data:e.data,getValue:t=>e.data[t],node:e})}getPositionableElement(){return this.eFilterBody}}so([j("rowModel")],oo.prototype,"rowModel",void 0),so([Ks("eFilterBody")],oo.prototype,"eFilterBody",void 0),so([B],oo.prototype,"postConstruct",null);var ro=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class no extends js{constructor(e,t){super(t),this.labelSeparator="",this.labelAlignment="left",this.disabled=!1,this.label="",this.config=e||{}}postConstruct(){this.addCssClass("ag-labeled"),this.eLabel.classList.add("ag-label");const{labelSeparator:e,label:t,labelWidth:i,labelAlignment:s}=this.config;null!=e&&this.setLabelSeparator(e),null!=t&&this.setLabel(t),null!=i&&this.setLabelWidth(i),this.setLabelAlignment(s||this.labelAlignment),this.refreshLabel()}refreshLabel(){Yi(this.eLabel),"string"==typeof this.label?this.eLabel.innerText=this.label+this.labelSeparator:this.label&&this.eLabel.appendChild(this.label),""===this.label?(Mi(this.eLabel,!1),Et(this.eLabel,"presentation")):(Mi(this.eLabel,!0),Et(this.eLabel,null))}setLabelSeparator(e){return this.labelSeparator===e||(this.labelSeparator=e,null!=this.label&&this.refreshLabel()),this}getLabelId(){return this.eLabel.id=this.eLabel.id||`ag-${this.getCompId()}-label`,this.eLabel.id}getLabel(){return this.label}setLabel(e){return this.label===e||(this.label=e,this.refreshLabel()),this}setLabelAlignment(e){const t=this.getGui().classList;return t.toggle("ag-label-align-left","left"===e),t.toggle("ag-label-align-right","right"===e),t.toggle("ag-label-align-top","top"===e),this}setLabelEllipsis(e){return this.eLabel.classList.toggle("ag-label-ellipsis",e),this}setLabelWidth(e){return null==this.label||rs(this.eLabel,e),this}setDisabled(e){e=!!e;const t=this.getGui();return xi(t,e),t.classList.toggle("ag-disabled",e),this.disabled=e,this}isDisabled(){return!!this.disabled}}ro([B],no.prototype,"postConstruct",null);class lo extends no{constructor(e,t,i){super(e,t),this.className=i}postConstruct(){super.postConstruct(),this.className&&this.addCssClass(this.className)}onValueChange(e){return this.addManagedListener(this,_e.EVENT_FIELD_VALUE_CHANGED,()=>e(this.getValue())),this}getWidth(){return this.getGui().clientWidth}setWidth(e){return ns(this.getGui(),e),this}getPreviousValue(){return this.previousValue}getValue(){return this.value}setValue(e,t){return this.value===e||(this.previousValue=this.value,this.value=e,t||this.dispatchEvent({type:_e.EVENT_FIELD_VALUE_CHANGED})),this}}var ao=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ho extends lo{constructor(e){if(super(e,(null==e?void 0:e.template)||'\n    <div class="ag-picker-field" role="presentation">\n        <div ref="eLabel"></div>\n            <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-picker-collapsed">\n            <div ref="eDisplayField" class="ag-picker-field-display"></div>\n            <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n        </div>\n    </div>',null==e?void 0:e.className),this.isPickerDisplayed=!1,this.skipClick=!1,this.pickerGap=4,this.hideCurrentPicker=null,this.ariaRole=null==e?void 0:e.ariaRole,this.onPickerFocusIn=this.onPickerFocusIn.bind(this),this.onPickerFocusOut=this.onPickerFocusOut.bind(this),!e)return;const{pickerGap:t,maxPickerHeight:i,variableWidth:s,minPickerWidth:o,maxPickerWidth:r}=e;null!=t&&(this.pickerGap=t),this.variableWidth=!!s,null!=i&&this.setPickerMaxHeight(i),null!=o&&this.setPickerMinWidth(o),null!=r&&this.setPickerMaxWidth(r)}postConstruct(){super.postConstruct(),this.setupAria();const e=`ag-${this.getCompId()}-display`;this.eDisplayField.setAttribute("id",e);const t=this.getAriaElement();At(t,e),this.addManagedListener(t,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(this.eLabel,"mousedown",this.onLabelOrWrapperMouseDown.bind(this)),this.addManagedListener(this.eWrapper,"mousedown",this.onLabelOrWrapperMouseDown.bind(this));const{pickerIcon:i}=this.config;if(i){const e=fs(i,this.gridOptionsService);e&&this.eIcon.appendChild(e)}}setupAria(){const e=this.getAriaElement();e.setAttribute("tabindex",(this.gridOptionsService.getNum("tabIndex")||0).toString()),Gt(e,!1),this.ariaRole&&Et(e,this.ariaRole)}refreshLabel(){var e;Ot(this.getAriaElement(),null!==(e=this.getLabelId())&&void 0!==e?e:""),super.refreshLabel()}onLabelOrWrapperMouseDown(e){e&&(e.preventDefault(),this.getFocusableElement().focus()),this.skipClick?this.skipClick=!1:this.isDisabled()||(this.isPickerDisplayed?this.hidePicker():this.showPicker())}onKeyDown(e){switch(e.key){case ys.UP:case ys.DOWN:case ys.ENTER:case ys.SPACE:e.preventDefault(),this.onLabelOrWrapperMouseDown();break;case ys.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),e.stopPropagation(),this.hideCurrentPicker&&this.hideCurrentPicker())}}showPicker(){this.isPickerDisplayed=!0,this.pickerComponent||(this.pickerComponent=this.createPickerComponent());const e=this.pickerComponent.getGui();e.addEventListener("focusin",this.onPickerFocusIn),e.addEventListener("focusout",this.onPickerFocusOut),this.hideCurrentPicker=this.renderAndPositionPicker(),this.toggleExpandedStyles(!0)}renderAndPositionPicker(){const e=this.gridOptionsService.getDocument(),t=this.pickerComponent.getGui();this.gridOptionsService.is("suppressScrollWhenPopupsAreOpen")||(this.destroyMouseWheelFunc=this.addManagedListener(e.body,"wheel",e=>{t.contains(e.target)||this.hidePicker()}));const i=this.localeService.getLocaleTextFunc(),{pickerType:s,pickerAriaLabelKey:o,pickerAriaLabelValue:r,modalPicker:n=!0}=this.config,l={modal:n,eChild:t,closeOnEsc:!0,closedCallback:()=>{const t=e.activeElement===e.body;this.beforeHidePicker(),t&&this.isAlive()&&this.getFocusableElement().focus()},ariaLabel:i(o,r)},a=this.popupService.addPopup(l),{maxPickerHeight:d,minPickerWidth:h,maxPickerWidth:c,pickerGap:u,variableWidth:p}=this;p?(h&&(t.style.minWidth=h),t.style.width=as(Wi(this.eWrapper)),c&&(t.style.maxWidth=c)):rs(t,null!=c?c:Wi(this.eWrapper));const g=null!=d?d:Hi(this.popupService.getPopupParent())+"px";t.style.setProperty("max-height",g),t.style.position="absolute";const m=this.gridOptionsService.is("enableRtl")?"right":"left";return this.popupService.positionPopupByComponent({type:s,eventSource:this.eWrapper,ePopup:t,position:"under",alignSide:m,keepWithinBounds:!0,nudgeY:u}),a.hideFunc}beforeHidePicker(){this.destroyMouseWheelFunc&&(this.destroyMouseWheelFunc(),this.destroyMouseWheelFunc=void 0),this.toggleExpandedStyles(!1);const e=this.pickerComponent.getGui();e.removeEventListener("focusin",this.onPickerFocusIn),e.removeEventListener("focusout",this.onPickerFocusOut),this.isPickerDisplayed=!1,this.pickerComponent=void 0,this.hideCurrentPicker=null}toggleExpandedStyles(e){if(!this.isAlive())return;Gt(this.getAriaElement(),e),this.eWrapper.classList.toggle("ag-picker-expanded",e),this.eWrapper.classList.toggle("ag-picker-collapsed",!e)}onPickerFocusIn(){this.togglePickerHasFocus(!0)}onPickerFocusOut(e){var t;(null===(t=this.pickerComponent)||void 0===t?void 0:t.getGui().contains(e.relatedTarget))||this.togglePickerHasFocus(!1)}togglePickerHasFocus(e){this.pickerComponent&&this.eWrapper.classList.toggle("ag-picker-has-focus",e)}hidePicker(){this.hideCurrentPicker&&this.hideCurrentPicker()}setAriaLabel(e){return Dt(this.getAriaElement(),e),this}setInputWidth(e){return rs(this.eWrapper,e),this}getFocusableElement(){return this.eWrapper}setPickerGap(e){return this.pickerGap=e,this}setPickerMinWidth(e){return"number"==typeof e&&(e+="px"),this.minPickerWidth=null==e?void 0:e,this}setPickerMaxWidth(e){return"number"==typeof e&&(e+="px"),this.maxPickerWidth=null==e?void 0:e,this}setPickerMaxHeight(e){return"number"==typeof e&&(e+="px"),this.maxPickerHeight=null==e?void 0:e,this}destroy(){this.hidePicker(),super.destroy()}}ao([j("popupService")],ho.prototype,"popupService",void 0),ao([Ks("eLabel")],ho.prototype,"eLabel",void 0),ao([Ks("eWrapper")],ho.prototype,"eWrapper",void 0),ao([Ks("eDisplayField")],ho.prototype,"eDisplayField",void 0),ao([Ks("eIcon")],ho.prototype,"eIcon",void 0);var co=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class uo extends js{constructor(e="default"){super(`<div class="ag-list ag-${e}-list" role="listbox"></div>`),this.cssIdentifier=e,this.options=[],this.itemEls=[]}init(){this.addManagedListener(this.getGui(),"keydown",this.handleKeyDown.bind(this))}handleKeyDown(e){const t=e.key;switch(t){case ys.ENTER:if(this.highlightedEl){const e=this.itemEls.indexOf(this.highlightedEl);this.setValueByIndex(e)}else this.setValue(this.getValue());break;case ys.DOWN:case ys.UP:const i=t===ys.DOWN;let s;if(e.preventDefault(),this.highlightedEl){let e=this.itemEls.indexOf(this.highlightedEl)+(i?1:-1);e=Math.min(Math.max(e,0),this.itemEls.length-1),s=this.itemEls[e]}else s=this.itemEls[i?0:this.itemEls.length-1];this.highlightItem(s)}}addOptions(e){return e.forEach(e=>this.addOption(e)),this}addOption(e){const{value:t,text:i}=e,s=je(i||t);return this.options.push({value:t,text:s}),this.renderOption(t,s),this.updateIndices(),this}updateIndices(){const e=this.getGui().querySelectorAll(".ag-list-item");e.forEach((t,i)=>{Vt(t,i+1),_t(t,e.length)})}renderOption(e,t){const i=document.createElement("div");Et(i,"option"),i.classList.add("ag-list-item",`ag-${this.cssIdentifier}-list-item`),i.innerHTML=`<span>${t}</span>`,i.tabIndex=-1,this.itemEls.push(i),this.addManagedListener(i,"mouseover",()=>this.highlightItem(i)),this.addManagedListener(i,"mouseleave",()=>this.clearHighlighted()),this.addManagedListener(i,"click",()=>this.setValue(e)),this.getGui().appendChild(i)}setValue(e,t){if(this.value===e)return this.fireItemSelected(),this;if(null==e)return this.reset(),this;const i=this.options.findIndex(t=>t.value===e);if(-1!==i){const e=this.options[i];this.value=e.value,this.displayValue=null!=e.text?e.text:e.value,this.highlightItem(this.itemEls[i]),t||this.fireChangeEvent()}return this}setValueByIndex(e){return this.setValue(this.options[e].value)}getValue(){return this.value}getDisplayValue(){return this.displayValue}refreshHighlighted(){this.clearHighlighted();const e=this.options.findIndex(e=>e.value===this.value);-1!==e&&this.highlightItem(this.itemEls[e])}reset(){this.value=null,this.displayValue=null,this.clearHighlighted(),this.fireChangeEvent()}highlightItem(e){e.offsetParent&&(this.clearHighlighted(),this.highlightedEl=e,this.highlightedEl.classList.add(uo.ACTIVE_CLASS),Yt(this.highlightedEl,!0),this.highlightedEl.focus())}clearHighlighted(){this.highlightedEl&&this.highlightedEl.offsetParent&&(this.highlightedEl.classList.remove(uo.ACTIVE_CLASS),Yt(this.highlightedEl,!1),this.highlightedEl=null)}fireChangeEvent(){this.dispatchEvent({type:_e.EVENT_FIELD_VALUE_CHANGED}),this.fireItemSelected()}fireItemSelected(){this.dispatchEvent({type:uo.EVENT_ITEM_SELECTED})}}uo.EVENT_ITEM_SELECTED="selectedItem",uo.ACTIVE_CLASS="ag-active-item",co([B],uo.prototype,"init",null);class po extends ho{constructor(e){super(Object.assign({pickerAriaLabelKey:"ariaLabelSelectField",pickerAriaLabelValue:"Select Field",pickerType:"ag-list",className:"ag-select",pickerIcon:"smallDown",ariaRole:"listbox"},e))}postConstruct(){var e;super.postConstruct(),this.createListComponent(),this.eWrapper.tabIndex=null!==(e=this.gridOptionsService.getNum("tabIndex"))&&void 0!==e?e:0}createListComponent(){this.listComponent=this.createBean(new uo("select")),this.listComponent.setParentComponent(this),this.listComponent.addGuiEventListener("keydown",e=>{e.key===ys.TAB&&(e.preventDefault(),e.stopImmediatePropagation(),this.getGui().dispatchEvent(new KeyboardEvent("keydown",{key:e.key,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,bubbles:!0})))}),this.listComponent.addManagedListener(this.listComponent,uo.EVENT_ITEM_SELECTED,()=>{this.hidePicker(),this.dispatchEvent({type:po.EVENT_ITEM_SELECTED})}),this.listComponent.addManagedListener(this.listComponent,_e.EVENT_FIELD_VALUE_CHANGED,()=>{this.listComponent&&(this.setValue(this.listComponent.getValue(),!1,!0),this.hidePicker())})}createPickerComponent(){return this.listComponent}showPicker(){this.listComponent&&(super.showPicker(),this.listComponent.refreshHighlighted())}addOptions(e){return e.forEach(e=>this.addOption(e)),this}addOption(e){return this.listComponent.addOption(e),this}setValue(e,t,i){if(this.value===e||!this.listComponent)return this;i||this.listComponent.setValue(e,!0);return this.listComponent.getValue()===this.getValue()?this:(this.eDisplayField.innerHTML=this.listComponent.getDisplayValue(),super.setValue(e,t))}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),super.destroy()}}po.EVENT_ITEM_SELECTED="selectedItem";var go=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class mo extends lo{constructor(e,t,i="text",s="input"){super(e,`\n            <div role="presentation">\n                <div ref="eLabel" class="ag-input-field-label"></div>\n                <div ref="eWrapper" class="ag-wrapper ag-input-wrapper" role="presentation">\n                    <${s} ref="eInput" class="ag-input-field-input"></${s}>\n                </div>\n            </div>`,t),this.inputType=i,this.displayFieldTag=s}postConstruct(){super.postConstruct(),this.setInputType(),this.eLabel.classList.add(this.className+"-label"),this.eWrapper.classList.add(this.className+"-input-wrapper"),this.eInput.classList.add(this.className+"-input"),this.addCssClass("ag-input-field"),this.eInput.id=this.eInput.id||`ag-${this.getCompId()}-input`;const{width:e,value:t}=this.config;null!=e&&this.setWidth(e),null!=t&&this.setValue(t),this.addInputListeners(),this.activateTabIndex([this.eInput])}refreshLabel(){t(this.getLabel())?Ot(this.eInput,this.getLabelId()):this.eInput.removeAttribute("aria-labelledby"),super.refreshLabel()}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>this.setValue(e.target.value))}setInputType(){"input"===this.displayFieldTag&&this.eInput.setAttribute("type",this.inputType)}getInputElement(){return this.eInput}setInputWidth(e){return rs(this.eWrapper,e),this}setInputName(e){return this.getInputElement().setAttribute("name",e),this}getFocusableElement(){return this.eInput}setMaxLength(e){return this.eInput.maxLength=e,this}setInputPlaceholder(e){return us(this.eInput,"placeholder",e),this}setInputAriaLabel(e){return Dt(this.eInput,e),this}setDisabled(e){return xi(this.eInput,e),super.setDisabled(e)}setAutoComplete(e){if(!0===e)us(this.eInput,"autocomplete",null);else{const t="string"==typeof e?e:"off";us(this.eInput,"autocomplete",t)}return this}}go([Ks("eLabel")],mo.prototype,"eLabel",void 0),go([Ks("eWrapper")],mo.prototype,"eWrapper",void 0),go([Ks("eInput")],mo.prototype,"eInput",void 0);class Co extends mo{constructor(e,t="ag-checkbox",i="checkbox"){super(e,t,i),this.labelAlignment="right",this.selected=!1,this.readOnly=!1,this.passive=!1}addInputListeners(){this.addManagedListener(this.eInput,"click",this.onCheckboxClick.bind(this)),this.addManagedListener(this.eLabel,"click",this.toggle.bind(this))}getNextValue(){return void 0===this.selected||!this.selected}setPassive(e){this.passive=e}isReadOnly(){return this.readOnly}setReadOnly(e){this.eWrapper.classList.toggle("ag-disabled",e),this.eInput.disabled=e,this.readOnly=e}setDisabled(e){return this.eWrapper.classList.toggle("ag-disabled",e),super.setDisabled(e)}toggle(){if(this.eInput.disabled)return;const e=this.isSelected(),t=this.getNextValue();this.passive?this.dispatchChange(t,e):this.setValue(t)}getValue(){return this.isSelected()}setValue(e,t){return this.refreshSelectedClass(e),this.setSelected(e,t),this}setName(e){return this.getInputElement().name=e,this}isSelected(){return this.selected}setSelected(e,t){this.isSelected()!==e&&(this.previousValue=this.isSelected(),e=this.selected="boolean"==typeof e?e:void 0,this.eInput.checked=e,this.eInput.indeterminate=void 0===e,t||this.dispatchChange(this.selected,this.previousValue))}dispatchChange(e,t,i){this.dispatchEvent({type:_e.EVENT_FIELD_VALUE_CHANGED,selected:e,previousValue:t,event:i});const s=this.getInputElement(),o={type:_e.EVENT_CHECKBOX_CHANGED,id:s.id,name:s.name,selected:e,previousValue:t};this.eventService.dispatchEvent(o)}onCheckboxClick(e){if(this.passive||this.eInput.disabled)return;const t=this.isSelected(),i=this.selected=e.target.checked;this.refreshSelectedClass(i),this.dispatchChange(i,t,e)}refreshSelectedClass(e){this.eWrapper.classList.toggle("ag-checked",!0===e),this.eWrapper.classList.toggle("ag-indeterminate",null==e)}}class vo extends Co{constructor(e){super(e,"ag-radio-button","radio")}isSelected(){return this.eInput.checked}toggle(){this.eInput.disabled||this.isSelected()||this.setValue(!0)}addInputListeners(){super.addInputListeners(),this.addManagedListener(this.eventService,_e.EVENT_CHECKBOX_CHANGED,this.onChange.bind(this))}onChange(e){e.selected&&e.name&&this.eInput.name&&this.eInput.name===e.name&&e.id&&this.eInput.id!==e.id&&this.setValue(!1,!0)}}class fo{constructor(e,t,i){this.localeService=e,this.optionsFactory=t,this.valueFormatter=i}getModelAsString(e){if(!e)return null;const t=null!=e.operator,i=this.localeService.getLocaleTextFunc();if(t){const t=e;let{conditions:s}=t;if(!s){const{condition1:e,condition2:i}=t;s=[e,i]}const o=s.map(e=>this.getModelAsString(e)),r="AND"===t.operator?"andCondition":"orCondition";return o.join(` ${i(r,Js[r])} `)}if(e.type===wo.BLANK||e.type===wo.NOT_BLANK)return i(e.type,e.type);{const t=e,s=this.optionsFactory.getCustomOption(t.type),{displayKey:o,displayName:r,numberOfInputs:n}=s||{};return o&&r&&0===n?(i(o,r),r):this.conditionToString(t,s)}}updateParams(e){this.optionsFactory=e.optionsFactory}formatValue(e){var t;return this.valueFormatter?null!==(t=this.valueFormatter(null!=e?e:null))&&void 0!==t?t:"":String(e)}}class wo extends oo{constructor(){super(...arguments),this.eTypes=[],this.eJoinOperatorPanels=[],this.eJoinOperatorsAnd=[],this.eJoinOperatorsOr=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}getNumberOfInputs(e){const t=this.optionsFactory.getCustomOption(e);if(t){const{numberOfInputs:e}=t;return null!=e?e:1}const i=[wo.EMPTY,wo.NOT_BLANK,wo.BLANK];return e&&i.indexOf(e)>=0?0:e===wo.IN_RANGE?2:1}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged(!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,i)=>{0===i?t.setValue(e,!0):t.setValue(this.optionsFactory.getDefaultOption(),!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return 0===e.length?null:this.maxNumConditions>1&&e.length>1?{filterType:this.getFilterType(),operator:this.getJoinOperator(),condition1:e[0],condition2:e[1],conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){return 0===this.eJoinOperatorsOr.length?this.defaultJoinOperator:!0===this.eJoinOperatorsOr[0].getValue()?"OR":"AND"}areModelsEqual(e,t){if(!e&&!t)return!0;if(!e&&t||e&&!t)return!1;const i=!e.operator,s=!t.operator;if(!i&&s||i&&!s)return!1;let o;if(i){const i=e,s=t;o=this.areSimpleModelsEqual(i,s)}else{const i=e,s=t;o=i.operator===s.operator&&le(i.conditions,s.conditions,(e,t)=>this.areSimpleModelsEqual(e,t))}return o}setModelIntoUi(e){if(e.operator){let t=e;t.conditions||(t.conditions=[t.condition1,t.condition2]);const i=this.validateAndUpdateConditions(t.conditions),s=this.getNumConditions();if(i<s)this.removeConditionsAndOperators(i);else if(i>s)for(let e=s;e<i;e++)this.createJoinOperatorPanel(),this.createOption();const o="OR"===t.operator;this.eJoinOperatorsAnd.forEach(e=>e.setValue(!o,!0)),this.eJoinOperatorsOr.forEach(e=>e.setValue(o,!0)),t.conditions.forEach((e,t)=>{this.eTypes[t].setValue(e.type,!0),this.setConditionIntoUi(e,t)})}else{const t=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(t.type,!0),this.setConditionIntoUi(t,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.onUiChanged(),Gs.resolve()}validateAndUpdateConditions(e){let t=e.length;return t>this.maxNumConditions&&(e.splice(this.maxNumConditions),T(()=>console.warn('AG Grid: Filter Model contains more conditions than "filterParams.maxNumConditions". Additional conditions have been ignored.'),"simpleFilterSetModelMaxNumConditions"),t=this.maxNumConditions),t}doesFilterPass(e){var t;const i=this.getModel();if(null==i)return!0;const{operator:s}=i,o=[];if(s){const e=i;o.push(...null!==(t=e.conditions)&&void 0!==t?t:[])}else o.push(i);return o[s&&"OR"===s?"some":"every"](t=>this.individualConditionPasses(e,t))}setParams(e){super.setParams(e),this.setNumConditions(e),this.defaultJoinOperator=this.getDefaultJoinOperator(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.optionsFactory=new Xs,this.optionsFactory.init(e,this.getDefaultFilterOptions()),this.createFilterListOptions(),this.createOption(),this.createMissingConditionsAndOperators(),this.isReadOnly()&&this.eFilterBody.setAttribute("tabindex","-1")}setNumConditions(e){var t,i;null!=e.suppressAndOrCondition&&T(()=>console.warn('AG Grid: Since v29.2 "filterParams.suppressAndOrCondition" is deprecated. Use "filterParams.maxNumConditions = 1" instead.'),"simpleFilterSuppressAndOrCondition"),null!=e.alwaysShowBothConditions&&T(()=>console.warn('AG Grid: Since v29.2 "filterParams.alwaysShowBothConditions" is deprecated. Use "filterParams.numAlwaysVisibleConditions = 2" instead.'),"simpleFilterAlwaysShowBothConditions"),this.maxNumConditions=null!==(t=e.maxNumConditions)&&void 0!==t?t:e.suppressAndOrCondition?1:2,this.maxNumConditions<1&&(T(()=>console.warn('AG Grid: "filterParams.maxNumConditions" must be greater than or equal to zero.'),"simpleFilterMaxNumConditions"),this.maxNumConditions=1),this.numAlwaysVisibleConditions=null!==(i=e.numAlwaysVisibleConditions)&&void 0!==i?i:e.alwaysShowBothConditions?2:1,this.numAlwaysVisibleConditions<1&&(T(()=>console.warn('AG Grid: "filterParams.numAlwaysVisibleConditions" must be greater than or equal to zero.'),"simpleFilterNumAlwaysVisibleConditions"),this.numAlwaysVisibleConditions=1),this.numAlwaysVisibleConditions>this.maxNumConditions&&(T(()=>console.warn('AG Grid: "filterParams.numAlwaysVisibleConditions" cannot be greater than "filterParams.maxNumConditions".'),"simpleFilterNumAlwaysVisibleGreaterThanMaxNumConditions"),this.numAlwaysVisibleConditions=this.maxNumConditions)}createOption(){const e=this.createManagedBean(new po);this.eTypes.push(e),e.addCssClass("ag-filter-select"),this.eFilterBody.appendChild(e.getGui());const t=this.createValueElement();this.eConditionBodies.push(t),this.eFilterBody.appendChild(t),this.putOptionsIntoDropdown(e),this.resetType(e);const i=this.getNumConditions()-1;this.forEachPositionInput(i,e=>this.resetInput(e)),this.addChangedListeners(e,i)}createJoinOperatorPanel(){const e=document.createElement("div");this.eJoinOperatorPanels.push(e),e.classList.add("ag-filter-condition");const t=this.createJoinOperator(this.eJoinOperatorsAnd,e,"and"),i=this.createJoinOperator(this.eJoinOperatorsOr,e,"or");this.eFilterBody.appendChild(e);const s=this.eJoinOperatorPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,o),this.resetJoinOperatorOr(i,s,o),this.isReadOnly()||(t.onValueChange(this.listener),i.onValueChange(this.listener))}createJoinOperator(e,t,i){const s=this.createManagedBean(new vo);return e.push(s),s.addCssClass("ag-filter-condition-operator"),s.addCssClass("ag-filter-condition-operator-"+i),t.appendChild(s.getGui()),s}getDefaultJoinOperator(e){return"AND"===e||"OR"===e?e:"AND"}createFilterListOptions(){const e=this.optionsFactory.getFilterOptions();this.filterListOptions=e.map(e=>"string"==typeof e?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){this.filterListOptions.forEach(t=>{e.addOption(t)}),e.setDisabled(this.filterListOptions.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,i=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:i?this.localeService.getLocaleTextFunc()(i.displayKey,i.displayName):this.translate(t)}}isAllowTwoConditions(){return this.maxNumConditions>=2}createBodyTemplate(){return""}getCssIdentifier(){return"simple-filter"}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){var e;let t=-1,i=!0;for(let e=0;e<this.getNumConditions();e++)this.isConditionUiComplete(e)?t=e:i=!1;if(this.shouldAddNewConditionAtEnd(i))this.createJoinOperatorPanel(),this.createOption();else{const i=null!==(e=this.lastUiCompletePosition)&&void 0!==e?e:this.getNumConditions()-2;if(t<i){this.removeConditionsAndOperators(i+1);const e=t+1,s=i-e;s>0&&this.removeConditionsAndOperators(e,s),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=t}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((t,i)=>{const s=this.isConditionDisabled(i,e);t.setDisabled(s||this.filterListOptions.length<=1),1===i&&(xi(this.eJoinOperatorPanels[0],s),this.eJoinOperatorsAnd[0].setDisabled(s),this.eJoinOperatorsOr[0].setDisabled(s))}),this.eConditionBodies.forEach((e,t)=>{Mi(e,this.isConditionBodyVisible(t))});const i="OR"===(null!=t?t:this.getJoinOperator());this.eJoinOperatorsAnd.forEach((e,t)=>{e.setValue(!i,!0)}),this.eJoinOperatorsOr.forEach((e,t)=>{e.setValue(i,!0)}),this.forEachInput((t,i,s,o)=>{this.setElementDisplayed(t,i<o),this.setElementDisabled(t,this.isConditionDisabled(s,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;this.removeComponents(this.eTypes,e,t),this.removeElements(this.eConditionBodies,e,t),this.removeValueElements(e,t);const i=Math.max(e-1,0);this.removeElements(this.eJoinOperatorPanels,i,t),this.removeComponents(this.eJoinOperatorsAnd,i,t),this.removeComponents(this.eJoinOperatorsOr,i,t)}removeElements(e,t,i){this.removeItems(e,t,i).forEach(e=>$i(e))}removeComponents(e,t,i){this.removeItems(e,t,i).forEach(e=>{$i(e.getGui()),this.destroyBean(e)})}removeItems(e,t,i){return null==i?e.splice(t):e.splice(t,i)}afterGuiAttached(e){if(super.afterGuiAttached(e),this.resetPlaceholder(),!(null==e?void 0:e.suppressFocus))if(this.isReadOnly())this.eFilterBody.focus();else{const e=this.getInputs(0)[0];if(!e)return;e instanceof mo&&e.getInputElement().focus()}}afterGuiDetached(){super.afterGuiDetached();const e=this.getModel();this.areModelsEqual(e,this.getModelFromUi())&&!this.hasInvalidInputs()||this.resetUiToActiveModel(e);let t=-1,i=-1,s=!1;const o=this.getJoinOperator();for(let e=this.getNumConditions()-1;e>=0;e--)if(this.isConditionUiComplete(e))-1===t&&(t=e,i=e);else{const o=e<t;(e>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(e-1)||o)&&(this.removeConditionsAndOperators(e,1),s=!0,o&&i--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(i===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(i,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=i}getPlaceholderText(e,t){let i=this.translate(e);if(D(this.filterPlaceholder)){const e=this.filterPlaceholder,s=this.eTypes[t].getValue();i=e({filterOptionKey:s,filterOption:this.translate(s),placeholder:i})}else"string"==typeof this.filterPlaceholder&&(i=this.filterPlaceholder);return i}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc();this.forEachInput((t,i,s,o)=>{if(!(t instanceof mo))return;const r=0===i&&o>1?"inRangeStart":0===i?"filterOoo":"inRangeEnd",n=0===i&&o>1?e("ariaFilterFromValue","Filter from value"):0===i?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,s)),t.setInputAriaLabel(n)})}setElementValue(e,t,i){e instanceof mo&&e.setValue(null!=t?String(t):null,!0)}setElementDisplayed(e,t){e instanceof js&&Mi(e.getGui(),t)}setElementDisabled(e,t){e instanceof js&&xi(e.getGui(),t)}attachElementOnChange(e,t){e instanceof mo&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,i)=>{this.forEachPositionTypeInput(i,t,e)})}forEachPositionInput(e,t){const i=this.getConditionType(e);this.forEachPositionTypeInput(e,i,t)}forEachPositionTypeInput(e,t,i){const s=this.getNumberOfInputs(t),o=this.getInputs(e);for(let t=0;t<o.length;t++){const r=o[t];null!=r&&i(r,t,e,s)}}isConditionDisabled(e,t){return!!this.isReadOnly()||0!==e&&e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return this.getNumberOfInputs(t)>0}isConditionUiComplete(e){if(e>=this.getNumConditions())return!1;return this.getConditionType(e)!==wo.EMPTY&&!this.getValues(e).some(e=>null==e)}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){return this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(e=>this.resetType(e)),this.eJoinOperatorsAnd.forEach((e,t)=>this.resetJoinOperatorAnd(e,t,this.joinOperatorId+t)),this.eJoinOperatorsOr.forEach((e,t)=>this.resetJoinOperatorOr(e,t,this.joinOperatorId+t)),this.joinOperatorId++,this.forEachInput(e=>this.resetInput(e)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,e||this.onUiChanged(),Gs.resolve()}resetType(e){const t=this.localeService.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.getDefaultOption(),!0).setAriaLabel(t).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("AND"),this.translate("andCondition"),i)}resetJoinOperatorOr(e,t,i){this.resetJoinOperator(e,t,this.isDefaultOperator("OR"),this.translate("orCondition"),i)}resetJoinOperator(e,t,i,s,o){this.updateJoinOperatorDisabled(e.setValue(i,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){this.eJoinOperatorsAnd.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t)),this.eJoinOperatorsOr.forEach((e,t)=>this.updateJoinOperatorDisabled(e,t))}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const i=this.mapValuesFromModel(e);this.forEachInput((e,s,o,r)=>{o===t&&this.setElementValue(e,null!=i[s]?i[s]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,i,s,o)=>{this.setElementValue(t,0===i&&0===s?e:null,!0)})}isDefaultOperator(e){return e===this.defaultJoinOperator}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,e=>{this.attachElementOnChange(e,this.listener)}))}individualConditionPasses(e,t){const i=this.getCellValue(e.node),s=this.mapValuesFromModel(t),o=this.optionsFactory.getCustomOption(t.type),r=this.evaluateCustomFilter(o,s,i);return null!=r?r:null==i?this.evaluateNullValue(t.type):this.evaluateNonNullValue(s,i,t,e)}evaluateCustomFilter(e,t,i){if(null==e)return;const{predicate:s}=e;return null==s||t.some(e=>null==e)?void 0:s(t,i)}isBlank(e){return null==e||"string"==typeof e&&0===e.trim().length}hasInvalidInputs(){return!1}}wo.EMPTY="empty",wo.BLANK="blank",wo.NOT_BLANK="notBlank",wo.EQUALS="equals",wo.NOT_EQUAL="notEqual",wo.LESS_THAN="lessThan",wo.LESS_THAN_OR_EQUAL="lessThanOrEqual",wo.GREATER_THAN="greaterThan",wo.GREATER_THAN_OR_EQUAL="greaterThanOrEqual",wo.IN_RANGE="inRange",wo.CONTAINS="contains",wo.NOT_CONTAINS="notContains",wo.STARTS_WITH="startsWith",wo.ENDS_WITH="endsWith";class yo extends wo{setParams(e){super.setParams(e),this.scalarFilterParams=e}evaluateNullValue(e){switch(e){case yo.EQUALS:case yo.NOT_EQUAL:if(this.scalarFilterParams.includeBlanksInEquals)return!0;break;case yo.GREATER_THAN:case yo.GREATER_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInGreaterThan)return!0;break;case yo.LESS_THAN:case yo.LESS_THAN_OR_EQUAL:if(this.scalarFilterParams.includeBlanksInLessThan)return!0;break;case yo.IN_RANGE:if(this.scalarFilterParams.includeBlanksInRange)return!0;break;case yo.BLANK:return!0;case yo.NOT_BLANK:return!1}return!1}evaluateNonNullValue(e,t,i){const s=this.comparator(),o=null!=e[0]?s(e[0],t):0;switch(i.type){case yo.EQUALS:return 0===o;case yo.NOT_EQUAL:return 0!==o;case yo.GREATER_THAN:return o>0;case yo.GREATER_THAN_OR_EQUAL:return o>=0;case yo.LESS_THAN:return o<0;case yo.LESS_THAN_OR_EQUAL:return o<=0;case yo.IN_RANGE:{const i=s(e[1],t);return this.scalarFilterParams.inRangeInclusive?o>=0&&i<=0:o>0&&i<0}case yo.BLANK:return this.isBlank(t);case yo.NOT_BLANK:return!this.isBlank(t);default:return console.warn('AG Grid: Unexpected type of filter "'+i.type+'", it looks like the filter was configured with incorrect Filter Options'),!0}}}var So=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Eo extends fo{constructor(e,t,i){super(t,i),this.dateFilterParams=e}conditionToString(e,t){const{type:i}=e,{numberOfInputs:s}=t||{},o=i==wo.IN_RANGE||2===s,r=Pi(e.dateFrom),n=Pi(e.dateTo),l=this.dateFilterParams.inRangeFloatingFilterDateFormat;if(o){return`${null!==r?Oi(r,l):"null"}-${null!==n?Oi(n,l):"null"}`}return null!=r?Oi(r,l):""+i}updateParams(e){super.updateParams(e),this.dateFilterParams=e.dateFilterParams}}class Ro extends yo{constructor(){super("dateFilter"),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=1e3,this.maxValidYear=1/0,this.minValidDate=null,this.maxValidDate=null}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}mapValuesFromModel(e){const{dateFrom:t,dateTo:i,type:s}=e||{};return[t&&Pi(t)||null,i&&Pi(i)||null].slice(0,this.getNumberOfInputs(s))}comparator(){return this.dateFilterParams.comparator?this.dateFilterParams.comparator:this.defaultComparator.bind(this)}defaultComparator(e,t){return null==t||t<e?-1:t>e?1:0}setParams(e){this.dateFilterParams=e,super.setParams(e);const t=(t,i)=>{if(null!=e[t]){if(!isNaN(e[t]))return null==e[t]?i:Number(e[t]);console.warn(`AG Grid: DateFilter ${t} is not a number`)}return i};this.minValidYear=t("minValidYear",1e3),this.maxValidYear=t("maxValidYear",1/0),this.minValidYear>this.maxValidYear&&console.warn("AG Grid: DateFilter minValidYear should be <= maxValidYear"),e.minValidDate?this.minValidDate=e.minValidDate instanceof Date?e.minValidDate:Pi(e.minValidDate):this.minValidDate=null,e.maxValidDate?this.maxValidDate=e.maxValidDate instanceof Date?e.maxValidDate:Pi(e.maxValidDate):this.maxValidDate=null,this.minValidDate&&this.maxValidDate&&this.minValidDate>this.maxValidDate&&console.warn("AG Grid: DateFilter minValidDate should be <= maxValidDate"),this.filterModelFormatter=new Eo(this.dateFilterParams,this.localeService,this.optionsFactory)}createDateCompWrapper(e){const t=new Qs(this.getContext(),this.userComponentFactory,{onDateChanged:()=>this.onUiChanged(),filterParams:this.dateFilterParams},e);return this.addDestroyFunc(()=>t.destroy()),t}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}getDefaultFilterOptions(){return Ro.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,i,s){const o=document.createElement("div");o.classList.add("ag-filter-"+s),o.classList.add("ag-filter-date-"+s),t.push(o),e.appendChild(o),i.push(this.createDateCompWrapper(o))}removeValueElements(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),this.removeItems(this.eConditionPanelsFrom,e,t),this.removeItems(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,i){this.removeItems(e,t,i).forEach(e=>e.destroy())}isValidDateValue(e){if(null===e)return!1;if(this.minValidDate){if(e<this.minValidDate)return!1}else if(e.getUTCFullYear()<this.minValidYear)return!1;if(this.maxValidDate){if(e>this.maxValidDate)return!1}else if(e.getUTCFullYear()>this.maxValidYear)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((i,s,o,r)=>{o!==e||!t||s>=r||(t=t&&this.isValidDateValue(i.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}getFilterType(){return"date"}createCondition(e){const t=this.getConditionType(e),i={},s=this.getValues(e);return s.length>0&&(i.dateFrom=bi(s[0])),s.length>1&&(i.dateTo=bi(s[1])),Object.assign({dateFrom:null,dateTo:null,filterType:this.getFilterType(),type:t},i)}resetPlaceholder(){const e=this.localeService.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),i=e("ariaFilterValue","Filter Value");this.forEachInput(e=>{e.setInputPlaceholder(t),e.setInputAriaLabel(i)})}getInputs(e){return e>=this.dateConditionFromComps.length?[null,null]:[this.dateConditionFromComps[e],this.dateConditionToComps[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(e,i,s,o)=>{i<o&&t.push(e.getDate())}),t}getModelAsString(e){var t;return null!==(t=this.filterModelFormatter.getModelAsString(e))&&void 0!==t?t:""}}Ro.DEFAULT_FILTER_OPTIONS=[yo.EQUALS,yo.GREATER_THAN,yo.LESS_THAN,yo.NOT_EQUAL,yo.IN_RANGE,yo.BLANK,yo.NOT_BLANK],So([j("userComponentFactory")],Ro.prototype,"userComponentFactory",void 0);class To extends js{getDefaultDebounceMs(){return 0}destroy(){super.destroy()}isEventFromFloatingFilter(e){return e&&e.afterFloatingFilter}isEventFromDataChange(e){return null==e?void 0:e.afterDataChange}getLastType(){return this.lastType}isReadOnly(){return this.readOnly}setLastTypeFromModel(e){if(!e)return void(this.lastType=this.optionsFactory.getDefaultOption());let t;if(e.operator){t=e.conditions[0]}else t=e;this.lastType=t.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const t=e;return this.isTypeEditable(t.type)}init(e){this.setSimpleParams(e)}setSimpleParams(e){this.optionsFactory=new Xs,this.optionsFactory.init(e.filterParams,this.getDefaultFilterOptions()),this.lastType=this.optionsFactory.getDefaultOption(),this.readOnly=!!e.filterParams.readOnly;const t=this.isTypeEditable(this.lastType);this.setEditable(t)}onParamsUpdated(e){this.setSimpleParams(e)}doesFilterHaveSingleInput(e){const t=this.optionsFactory.getCustomOption(e),{numberOfInputs:i}=t||{};return null==i||1==i}isTypeEditable(e){const t=[wo.IN_RANGE,wo.EMPTY,wo.BLANK,wo.NOT_BLANK];return!!e&&!this.isReadOnly()&&this.doesFilterHaveSingleInput(e)&&t.indexOf(e)<0}}var bo=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Do extends To{constructor(){super('\n            <div class="ag-floating-filter-input" role="presentation">\n                <ag-input-text-field ref="eReadOnlyText"></ag-input-text-field>\n                <div ref="eDateWrapper" style="display: flex;"></div>\n            </div>')}getDefaultFilterOptions(){return Ro.DEFAULT_FILTER_OPTIONS}init(e){super.init(e),this.params=e,this.filterParams=e.filterParams,this.createDateComponent(),this.filterModelFormatter=new Eo(this.filterParams,this.localeService,this.optionsFactory);const t=this.localeService.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}onParamsUpdated(e){super.onParamsUpdated(e),this.params=e,this.filterParams=e.filterParams,this.updateDateComponent(),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory,dateFilterParams:this.filterParams})}setEditable(e){Mi(this.eDateWrapper,e),Mi(this.eReadOnlyText.getGui(),!e)}onParentModelChanged(e,t){if(this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t))return;super.setLastTypeFromModel(e);const i=!this.isReadOnly()&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(i),i){if(e){const t=e;this.dateComp.setDate(Pi(t.dateFrom))}else this.dateComp.setDate(null);this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}onDateChanged(){const e=bi(this.dateComp.getDate());this.params.parentFilterInstance(t=>{if(t){const i=Pi(e);t.onFloatingFilterChanged(this.getLastType()||null,i)}})}getDateComponentParams(){const e=oo.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs());return{onDateChanged:I(this.onDateChanged.bind(this),e),filterParams:this.params.column.getColDef().filterParams}}createDateComponent(){this.dateComp=new Qs(this.getContext(),this.userComponentFactory,this.getDateComponentParams(),this.eDateWrapper),this.addDestroyFunc(()=>this.dateComp.destroy())}updateDateComponent(){const e=this.getDateComponentParams(),{api:t,columnApi:i,context:s}=this.gridOptionsService;e.api=t,e.columnApi=i,e.context=s,this.dateComp.updateParams(e)}getFilterModelFormatter(){return this.filterModelFormatter}}bo([j("userComponentFactory")],Do.prototype,"userComponentFactory",void 0),bo([Ks("eReadOnlyText")],Do.prototype,"eReadOnlyText",void 0),bo([Ks("eDateWrapper")],Do.prototype,"eDateWrapper",void 0);var Oo=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Po extends js{constructor(){super('\n            <div class="ag-filter-filter">\n                <ag-input-text-field class="ag-date-filter" ref="eDateInput"></ag-input-text-field>\n            </div>')}destroy(){super.destroy()}init(e){this.params=e,this.setParams(e);const t=this.gridOptionsService.getDocument(),i=this.eDateInput.getInputElement();this.addManagedListener(i,"mousedown",()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||i.focus()}),this.addManagedListener(i,"input",e=>{e.target===t.activeElement&&(this.eDateInput.isDisabled()||this.params.onDateChanged())})}setParams(e){const t=this.eDateInput.getInputElement(),i=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=i&&ni(),t.type=i?"date":"text";const{minValidYear:s,maxValidYear:o,minValidDate:r,maxValidDate:n}=e.filterParams||{};if(r&&s&&T(()=>console.warn("AG Grid: DateFilter should not have both minValidDate and minValidYear parameters set at the same time! minValidYear will be ignored."),"DateFilter.minValidDateAndMinValidYearWarning"),n&&o&&T(()=>console.warn("AG Grid: DateFilter should not have both maxValidDate and maxValidYear parameters set at the same time! maxValidYear will be ignored."),"DateFilter.maxValidDateAndMaxValidYearWarning"),r&&n){const[e,t]=[r,n].map(e=>e instanceof Date?e:Pi(e));e&&t&&e.getTime()>t.getTime()&&T(()=>console.warn("AG Grid: DateFilter parameter minValidDate should always be lower than or equal to parameter maxValidDate."),"DateFilter.minValidDateAndMaxValidDateWarning")}r?r instanceof Date?t.min=Oi(r):t.min=r:s&&(t.min=s+"-01-01"),n?n instanceof Date?t.max=Oi(n):t.max=n:o&&(t.max=o+"-12-31")}onParamsUpdated(e){this.params=e,this.setParams(e)}getDate(){return Pi(this.eDateInput.getValue())}setDate(e){this.eDateInput.setValue(bi(e,!1))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e&&e.suppressFocus||this.eDateInput.getInputElement().focus()}shouldUseBrowserDatePicker(e){return e.filterParams&&null!=e.filterParams.browserDatePicker?e.filterParams.browserDatePicker:ai()||di()||ni()&&li()>=14.1}}Oo([Ks("eDateInput")],Po.prototype,"eDateInput",void 0);class Ao extends mo{constructor(e,t="ag-text-field",i="text"){super(e,t,i)}postConstruct(){super.postConstruct(),this.config.allowedCharPattern&&this.preventDisallowedCharacters()}setValue(e,i){return this.eInput.value!==e&&(this.eInput.value=t(e)?e:""),super.setValue(e,i)}setStartValue(e){this.setValue(e,!0)}preventDisallowedCharacters(){const e=new RegExp(`[${this.config.allowedCharPattern}]`);this.addManagedListener(this.eInput,"keydown",t=>{Ss(t)&&t.key&&!e.test(t.key)&&t.preventDefault()}),this.addManagedListener(this.eInput,"paste",t=>{var i;const s=null===(i=t.clipboardData)||void 0===i?void 0:i.getData("text");s&&s.split("").some(t=>!e.test(t))&&t.preventDefault()})}}class Fo extends Ao{constructor(e){super(e,"ag-number-field","number")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"blur",()=>{const e=parseFloat(this.eInput.value),t=isNaN(e)?"":this.normalizeValue(e.toString());this.value!==t&&this.setValue(t)}),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this)),this.eInput.step="any"}onWheel(e){document.activeElement===this.eInput&&e.preventDefault()}normalizeValue(e){if(""===e)return"";null!=this.precision&&(e=this.adjustPrecision(e));const t=parseFloat(e);return null!=this.min&&t<this.min?e=this.min.toString():null!=this.max&&t>this.max&&(e=this.max.toString()),e}adjustPrecision(e,t){if(null==this.precision)return e;if(t){const t=parseFloat(e).toFixed(this.precision);return parseFloat(t).toString()}const i=String(e).split(".");if(i.length>1){if(i[1].length<=this.precision)return e;if(this.precision>0)return`${i[0]}.${i[1].slice(0,this.precision)}`}return i[0]}setMin(e){return this.min===e||(this.min=e,us(this.eInput,"min",e)),this}setMax(e){return this.max===e||(this.max=e,us(this.eInput,"max",e)),this}setPrecision(e){return this.precision=e,this}setStep(e){return this.step===e||(this.step=e,us(this.eInput,"step",e)),this}setValue(e,t){return this.setValueOrInputValue(e=>super.setValue(e,t),()=>this,e)}setStartValue(e){return this.setValueOrInputValue(e=>super.setValue(e,!0),e=>{this.eInput.value=e},e)}setValueOrInputValue(e,i,s){if(t(s)){let t=this.isScientificNotation(s);if(t&&this.eInput.validity.valid)return e(s);if(!t){t=(s=this.adjustPrecision(s))!=this.normalizeValue(s)}if(t)return i(s)}return e(s)}getValue(){if(!this.eInput.validity.valid)return;const e=this.eInput.value;return this.isScientificNotation(e)?this.adjustPrecision(e,!0):super.getValue()}isScientificNotation(e){return"string"==typeof e&&e.includes("e")}}class Lo extends fo{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==wo.IN_RANGE||2===i?`${this.formatValue(e.filter)}-${this.formatValue(e.filterTo)}`:null!=e.filter?this.formatValue(e.filter):""+e.type}}function Io(e){const{allowedCharPattern:t}=null!=e?e:{};return null!=t?t:null}class No extends yo{constructor(){super("numberFilter"),this.eValuesFrom=[],this.eValuesTo=[]}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[this.processValue(t),this.processValue(i)].slice(0,this.getNumberOfInputs(s))}getDefaultDebounceMs(){return 500}comparator(){return(e,t)=>e===t?0:e<t?1:-1}setParams(e){this.numberFilterParams=e,super.setParams(e),this.filterModelFormatter=new Lo(this.localeService,this.optionsFactory,this.numberFilterParams.numberFormatter)}getDefaultFilterOptions(){return No.DEFAULT_FILTER_OPTIONS}setElementValue(e,t,i){const s=!i&&this.numberFilterParams.numberFormatter?this.numberFilterParams.numberFormatter(null!=t?t:null):t;super.setElementValue(e,s)}createValueElement(){const e=Io(this.numberFilterParams),t=document.createElement("div");return t.classList.add("ag-filter-body"),Et(t,"presentation"),this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,i,s){const o=this.createManagedBean(s?new Ao({allowedCharPattern:s}):new Fo);o.addCssClass("ag-filter-"+i),o.addCssClass("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}getValues(e){const t=[];return this.forEachPositionInput(e,(e,i,s,o)=>{i<o&&t.push(this.processValue(this.stringToFloat(e.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getFilterType(){return"number"}processValue(e){return null==e||isNaN(e)?null:e}stringToFloat(t){if("number"==typeof t)return t;let i=e(t);return null!=i&&""===i.trim()&&(i=null),this.numberFilterParams.numberParser?this.numberFilterParams.numberParser(i):null==i||"-"===i.trim()?null:parseFloat(i)}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValues(e);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getModelAsString(e){var t;return null!==(t=this.filterModelFormatter.getModelAsString(e))&&void 0!==t?t:""}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}}No.DEFAULT_FILTER_OPTIONS=[yo.EQUALS,yo.NOT_EQUAL,yo.LESS_THAN,yo.LESS_THAN_OR_EQUAL,yo.GREATER_THAN,yo.GREATER_THAN_OR_EQUAL,yo.IN_RANGE,yo.BLANK,yo.NOT_BLANK];class Mo extends fo{conditionToString(e,t){const{numberOfInputs:i}=t||{};return e.type==wo.IN_RANGE||2===i?`${e.filter}-${e.filterTo}`:null!=e.filter?""+e.filter:""+e.type}}class Go extends wo{constructor(){super("textFilter"),this.eValuesFrom=[],this.eValuesTo=[]}static trimInput(e){const t=e&&e.trim();return""===t?e:t}getDefaultDebounceMs(){return 500}setParams(e){this.textFilterParams=e,super.setParams(e),this.matcher=this.getTextMatcher(),this.formatter=this.textFilterParams.textFormatter||(this.textFilterParams.caseSensitive?Go.DEFAULT_FORMATTER:Go.DEFAULT_LOWERCASE_FORMATTER),this.filterModelFormatter=new Mo(this.localeService,this.optionsFactory)}getTextMatcher(){const e=this.textFilterParams.textCustomComparator;return e?(Is.doOnce(()=>console.warn("AG Grid - textCustomComparator is deprecated, use textMatcher instead."),"textCustomComparator.deprecated"),({filterOption:t,value:i,filterText:s})=>e(t,i,s)):this.textFilterParams.textMatcher||Go.DEFAULT_MATCHER}createCondition(e){const t=this.getConditionType(e),i={filterType:this.getFilterType(),type:t},s=this.getValuesWithSideEffects(e,!0);return s.length>0&&(i.filter=s[0]),s.length>1&&(i.filterTo=s[1]),i}getFilterType(){return"text"}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){return e>=this.eValuesFrom.length?[null,null]:[this.eValuesFrom[e],this.eValuesTo[e]]}getValues(e){return this.getValuesWithSideEffects(e,!1)}getValuesWithSideEffects(t,i){const s=[];return this.forEachPositionInput(t,(t,o,r,n)=>{var l;if(o<n){let o=e(t.getValue());i&&this.textFilterParams.trimInput&&(o=null!==(l=Go.trimInput(o))&&void 0!==l?l:null,t.setValue(o,!0)),s.push(o)}}),s}getDefaultFilterOptions(){return Go.DEFAULT_FILTER_OPTIONS}createValueElement(){const e=document.createElement("div");return e.classList.add("ag-filter-body"),Et(e,"presentation"),this.createFromToElement(e,this.eValuesFrom,"from"),this.createFromToElement(e,this.eValuesTo,"to"),e}createFromToElement(e,t,i){const s=this.createManagedBean(new Ao);s.addCssClass("ag-filter-"+i),s.addCssClass("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeValueElements(e,t){this.removeComponents(this.eValuesFrom,e,t),this.removeComponents(this.eValuesTo,e,t)}mapValuesFromModel(e){const{filter:t,filterTo:i,type:s}=e||{};return[t||null,i||null].slice(0,this.getNumberOfInputs(s))}evaluateNullValue(e){const t=[wo.NOT_EQUAL,wo.NOT_CONTAINS,wo.BLANK];return!!e&&t.indexOf(e)>=0}evaluateNonNullValue(e,t,i,s){const o=e.map(e=>this.formatter(e))||[],r=this.formatter(t),{api:n,colDef:l,column:a,columnApi:d,context:h,textFormatter:c}=this.textFilterParams;if(i.type===wo.BLANK)return this.isBlank(t);if(i.type===wo.NOT_BLANK)return!this.isBlank(t);const u={api:n,colDef:l,column:a,columnApi:d,context:h,node:s.node,data:s.data,filterOption:i.type,value:r,textFormatter:c};return o.some(e=>this.matcher(Object.assign(Object.assign({},u),{filterText:e})))}getModelAsString(e){var t;return null!==(t=this.filterModelFormatter.getModelAsString(e))&&void 0!==t?t:""}}Go.DEFAULT_FILTER_OPTIONS=[wo.CONTAINS,wo.NOT_CONTAINS,wo.EQUALS,wo.NOT_EQUAL,wo.STARTS_WITH,wo.ENDS_WITH,wo.BLANK,wo.NOT_BLANK],Go.DEFAULT_FORMATTER=e=>e,Go.DEFAULT_LOWERCASE_FORMATTER=e=>null==e?null:e.toString().toLowerCase(),Go.DEFAULT_MATCHER=({filterOption:e,value:t,filterText:i})=>{if(null==i)return!1;switch(e){case Go.CONTAINS:return t.indexOf(i)>=0;case Go.NOT_CONTAINS:return t.indexOf(i)<0;case Go.EQUALS:return t===i;case Go.NOT_EQUAL:return t!=i;case Go.STARTS_WITH:return 0===t.indexOf(i);case Go.ENDS_WITH:const e=t.lastIndexOf(i);return e>=0&&e===t.length-i.length;default:return!1}};var xo=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class _o extends Le{constructor(e){super(),this.params=e,this.valueChangedListener=()=>{}}setupGui(e){var t;this.eFloatingFilterTextInput=this.createManagedBean(new Ao(null===(t=this.params)||void 0===t?void 0:t.config));const i=this.eFloatingFilterTextInput.getGui();e.appendChild(i),this.addManagedListener(i,"input",e=>this.valueChangedListener(e)),this.addManagedListener(i,"keydown",e=>this.valueChangedListener(e))}setEditable(e){this.eFloatingFilterTextInput.setDisabled(!e)}setAutoComplete(e){this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.eFloatingFilterTextInput.getValue()}setValue(e,t){this.eFloatingFilterTextInput.setValue(e,t)}setValueChangedListener(e){this.valueChangedListener=e}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterTextInput.setInputAriaLabel(e)}}class Vo extends To{postConstruct(){this.setTemplate('\n            <div class="ag-floating-filter-input" role="presentation" ref="eFloatingFilterInputContainer"></div>\n        ')}getDefaultDebounceMs(){return 500}onParentModelChanged(e,t){this.isEventFromFloatingFilter(t)||this.isEventFromDataChange(t)||(this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.floatingFilterInputService.setValue(this.getFilterModelFormatter().getModelAsString(e)))}init(e){this.setupFloatingFilterInputService(e),super.init(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.floatingFilterInputService=this.createFloatingFilterInputService(e),this.floatingFilterInputService.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){var t;this.params=e;const i=null!==(t=e.browserAutoComplete)&&void 0!==t&&t;if(this.floatingFilterInputService.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:i}),this.applyActive=oo.isUseApplyButton(this.params.filterParams),!this.isReadOnly()){const e=oo.getDebounceMs(this.params.filterParams,this.getDefaultDebounceMs()),t=I(this.syncUpWithParentFilter.bind(this),e);this.floatingFilterInputService.setValueChangedListener(t)}}onParamsUpdated(e){super.onParamsUpdated(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const t=this.floatingFilterInputService.getValue();Yi(this.eFloatingFilterInputContainer),this.destroyBean(this.floatingFilterInputService),this.setupFloatingFilterInputService(e),this.floatingFilterInputService.setValue(t,!0)}getAriaLabel(e){return`${this.columnModel.getDisplayNameForColumn(e.column,"header",!0)} ${this.localeService.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}syncUpWithParentFilter(e){const t=e.key===ys.ENTER;if(this.applyActive&&!t)return;let i=this.floatingFilterInputService.getValue();this.params.filterParams.trimInput&&(i=Go.trimInput(i),this.floatingFilterInputService.setValue(i,!0)),this.params.parentFilterInstance(e=>{e&&e.onFloatingFilterChanged(this.getLastType()||null,i||null)})}setEditable(e){this.floatingFilterInputService.setEditable(e)}}xo([j("columnModel")],Vo.prototype,"columnModel",void 0),xo([Ks("eFloatingFilterInputContainer")],Vo.prototype,"eFloatingFilterInputContainer",void 0),xo([B],Vo.prototype,"postConstruct",null);class Ho extends Le{constructor(){super(...arguments),this.valueChangedListener=()=>{},this.numberInputActive=!0}setupGui(e){this.eFloatingFilterNumberInput=this.createManagedBean(new Fo),this.eFloatingFilterTextInput=this.createManagedBean(new Ao),this.eFloatingFilterTextInput.setDisabled(!0);const t=this.eFloatingFilterNumberInput.getGui(),i=this.eFloatingFilterTextInput.getGui();e.appendChild(t),e.appendChild(i),this.setupListeners(t,e=>this.valueChangedListener(e)),this.setupListeners(i,e=>this.valueChangedListener(e))}setEditable(e){this.numberInputActive=e,this.eFloatingFilterNumberInput.setDisplayed(this.numberInputActive),this.eFloatingFilterTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eFloatingFilterNumberInput.setAutoComplete(e),this.eFloatingFilterTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eFloatingFilterNumberInput:this.eFloatingFilterTextInput}setValueChangedListener(e){this.valueChangedListener=e}setupListeners(e,t){this.addManagedListener(e,"input",t),this.addManagedListener(e,"keydown",t)}setParams(e){this.setAriaLabel(e.ariaLabel),void 0!==e.autoComplete&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eFloatingFilterNumberInput.setInputAriaLabel(e),this.eFloatingFilterTextInput.setInputAriaLabel(e)}}class ko extends Vo{init(e){var t;super.init(e),this.filterModelFormatter=new Lo(this.localeService,this.optionsFactory,null===(t=e.filterParams)||void 0===t?void 0:t.numberFormatter)}onParamsUpdated(e){Io(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.onParamsUpdated(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return No.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(e){return this.allowedCharPattern=Io(e.filterParams),this.allowedCharPattern?this.createManagedBean(new _o({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new Ho)}}class Bo extends Vo{init(e){super.init(e),this.filterModelFormatter=new Mo(this.localeService,this.optionsFactory)}onParamsUpdated(e){super.onParamsUpdated(e),this.filterModelFormatter.updateParams({optionsFactory:this.optionsFactory})}getDefaultFilterOptions(){return Go.DEFAULT_FILTER_OPTIONS}getFilterModelFormatter(){return this.filterModelFormatter}createFloatingFilterInputService(){return this.createManagedBean(new _o)}}class Wo{constructor(e,t=!1){this.destroyFuncs=[],this.touching=!1,this.eventService=new X,this.eElement=e,this.preventMouseClick=t;const i=this.onTouchStart.bind(this),s=this.onTouchMove.bind(this),o=this.onTouchEnd.bind(this);this.eElement.addEventListener("touchstart",i,{passive:!0}),this.eElement.addEventListener("touchmove",s,{passive:!0}),this.eElement.addEventListener("touchend",o,{passive:!1}),this.destroyFuncs.push(()=>{this.eElement.removeEventListener("touchstart",i,{passive:!0}),this.eElement.removeEventListener("touchmove",s,{passive:!0}),this.eElement.removeEventListener("touchend",o,{passive:!1})})}getActiveTouch(e){for(let t=0;t<e.length;t++){if(e[t].identifier===this.touchStart.identifier)return e[t]}return null}addEventListener(e,t){this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService.removeEventListener(e,t)}onTouchStart(e){if(this.touching)return;this.touchStart=e.touches[0],this.touching=!0,this.moved=!1;const t=this.touchStart;window.setTimeout(()=>{const i=this.touchStart===t;if(this.touching&&i&&!this.moved){this.moved=!0;const t={type:Wo.EVENT_LONG_TAP,touchStart:this.touchStart,touchEvent:e};this.eventService.dispatchEvent(t)}},500)}onTouchMove(e){if(!this.touching)return;const t=this.getActiveTouch(e.touches);if(!t)return;!Os(t,this.touchStart,4)&&(this.moved=!0)}onTouchEnd(e){if(this.touching){if(!this.moved){const e={type:Wo.EVENT_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(e),this.checkForDoubleTap()}this.preventMouseClick&&e.cancelable&&e.preventDefault(),this.touching=!1}}checkForDoubleTap(){const e=(new Date).getTime();if(this.lastTapTime&&this.lastTapTime>0){if(e-this.lastTapTime>Wo.DOUBLE_TAP_MILLIS){const e={type:Wo.EVENT_DOUBLE_TAP,touchStart:this.touchStart};this.eventService.dispatchEvent(e),this.lastTapTime=null}else this.lastTapTime=e}else this.lastTapTime=e}destroy(){this.destroyFuncs.forEach(e=>e())}}Wo.EVENT_TAP="tap",Wo.EVENT_DOUBLE_TAP="doubleTap",Wo.EVENT_LONG_TAP="longTap",Wo.DOUBLE_TAP_MILLIS=500;var Uo=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class jo extends js{constructor(e){super(),e||this.setTemplate(jo.TEMPLATE)}attachCustomElements(e,t,i,s,o){this.eSortOrder=e,this.eSortAsc=t,this.eSortDesc=i,this.eSortMixed=s,this.eSortNone=o}setupSort(e,t=!1){this.column=e,this.suppressOrder=t,this.setupMultiSortIndicator();!!this.column.getColDef().sortable&&(this.addInIcon("sortAscending",this.eSortAsc,e),this.addInIcon("sortDescending",this.eSortDesc,e),this.addInIcon("sortUnSort",this.eSortNone,e),this.addManagedListener(this.eventService,_e.EVENT_SORT_CHANGED,()=>this.onSortChanged()),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.onSortChanged()),this.onSortChanged())}addInIcon(e,t,i){if(null==t)return;const s=fs(e,this.gridOptionsService,i);s&&t.appendChild(s)}onSortChanged(){this.updateIcons(),this.suppressOrder||this.updateSortOrder()}updateIcons(){const e=this.sortController.getDisplaySortForColumn(this.column);if(this.eSortAsc){const t="asc"===e;Mi(this.eSortAsc,t,{skipAriaHidden:!0})}if(this.eSortDesc){const t="desc"===e;Mi(this.eSortDesc,t,{skipAriaHidden:!0})}if(this.eSortNone){const t=!this.column.getColDef().unSortIcon&&!this.gridOptionsService.is("unSortIcon"),i=null==e;Mi(this.eSortNone,!t&&i,{skipAriaHidden:!0})}}setupMultiSortIndicator(){this.addInIcon("sortUnSort",this.eSortMixed,this.column);const e=this.column.getColDef().showRowGroup;this.gridOptionsService.isColumnsSortingCoupledToGroup()&&e&&(this.addManagedListener(this.eventService,_e.EVENT_SORT_CHANGED,()=>this.updateMultiSortIndicator()),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.updateMultiSortIndicator()),this.updateMultiSortIndicator())}updateMultiSortIndicator(){if(this.eSortMixed){const e="mixed"===this.sortController.getDisplaySortForColumn(this.column);Mi(this.eSortMixed,e,{skipAriaHidden:!0})}}updateSortOrder(){var e;if(!this.eSortOrder)return;const t=this.sortController.getColumnsWithSortingOrdered(),i=null!==(e=this.sortController.getDisplaySortIndexForColumn(this.column))&&void 0!==e?e:-1,s=t.some(e=>{var t;return null!==(t=this.sortController.getDisplaySortIndexForColumn(e))&&void 0!==t&&t}),o=i>=0&&s;Mi(this.eSortOrder,o,{skipAriaHidden:!0}),i>=0?this.eSortOrder.innerHTML=(i+1).toString():Yi(this.eSortOrder)}}jo.TEMPLATE='<span class="ag-sort-indicator-container">\n            <span ref="eSortOrder" class="ag-sort-indicator-icon ag-sort-order ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortAsc" class="ag-sort-indicator-icon ag-sort-ascending-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortDesc" class="ag-sort-indicator-icon ag-sort-descending-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortMixed" class="ag-sort-indicator-icon ag-sort-mixed-icon ag-hidden" aria-hidden="true"></span>\n            <span ref="eSortNone" class="ag-sort-indicator-icon ag-sort-none-icon ag-hidden" aria-hidden="true"></span>\n        </span>',Uo([Ks("eSortOrder")],jo.prototype,"eSortOrder",void 0),Uo([Ks("eSortAsc")],jo.prototype,"eSortAsc",void 0),Uo([Ks("eSortDesc")],jo.prototype,"eSortDesc",void 0),Uo([Ks("eSortMixed")],jo.prototype,"eSortMixed",void 0),Uo([Ks("eSortNone")],jo.prototype,"eSortNone",void 0),Uo([j("columnModel")],jo.prototype,"columnModel",void 0),Uo([j("sortController")],jo.prototype,"sortController",void 0);var zo=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Ko extends js{constructor(){super(...arguments),this.lastMovingChanged=0}destroy(){super.destroy()}refresh(e){return this.params=e,this.workOutTemplate()==this.currentTemplate&&(this.workOutShowMenu()==this.currentShowMenu&&(this.workOutSort()==this.currentSort&&(this.setDisplayName(e),!0)))}workOutTemplate(){let e=re(this.params.template,Ko.TEMPLATE);return e=e&&e.trim?e.trim():e,e}init(e){this.params=e,this.currentTemplate=this.workOutTemplate(),this.setTemplate(this.currentTemplate),this.setupTap(),this.setupIcons(e.column),this.setMenu(),this.setupSort(),this.setupFilterIcon(),this.setDisplayName(e)}setDisplayName(e){if(this.currentDisplayName!=e.displayName){this.currentDisplayName=e.displayName;const t=je(this.currentDisplayName);this.eText&&(this.eText.innerHTML=t)}}setupIcons(e){this.addInIcon("menu",this.eMenu,e),this.addInIcon("filter",this.eFilter,e)}addInIcon(e,t,i){if(null==t)return;const s=fs(e,this.gridOptionsService,i);s&&t.appendChild(s)}setupTap(){const{gridOptionsService:e}=this;if(e.is("suppressTouch"))return;const i=new Wo(this.getGui(),!0),s=e.is("suppressMenuHide"),o=s&&t(this.eMenu),r=o?new Wo(this.eMenu,!0):i;if(this.params.enableMenu){const t=o?"EVENT_TAP":"EVENT_LONG_TAP",i=t=>{e.api.showColumnMenuAfterMouseClick(this.params.column,t.touchStart)};this.addManagedListener(r,Wo[t],i)}if(this.params.enableSorting){const e=e=>{const t=e.touchStart.target;s&&this.eMenu.contains(t)||this.sortController.progressSort(this.params.column,!1,"uiColumnSorted")};this.addManagedListener(i,Wo.EVENT_TAP,e)}this.addDestroyFunc(()=>i.destroy()),o&&this.addDestroyFunc(()=>r.destroy())}workOutShowMenu(){const e=!this.gridOptionsService.is("suppressMenuHide"),t=ci()&&e;return this.params.enableMenu&&!t}setMenu(){if(!this.eMenu)return;if(this.currentShowMenu=this.workOutShowMenu(),!this.currentShowMenu)return void $i(this.eMenu);const e=this.gridOptionsService.is("suppressMenuHide");this.addManagedListener(this.eMenu,"click",()=>this.showMenu(this.eMenu)),this.eMenu.classList.toggle("ag-header-menu-always-show",e)}showMenu(e){e||(e=this.eMenu),this.menuFactory.showMenuAfterButtonClick(this.params.column,e,"columnMenu")}workOutSort(){return this.params.enableSorting}setupSort(){if(this.currentSort=this.params.enableSorting,this.eSortIndicator||(this.eSortIndicator=this.context.createBean(new jo(!0)),this.eSortIndicator.attachCustomElements(this.eSortOrder,this.eSortAsc,this.eSortDesc,this.eSortMixed,this.eSortNone)),this.eSortIndicator.setupSort(this.params.column),!this.currentSort)return;const e="ctrl"===this.gridOptionsService.get("multiSortKey");this.addManagedListener(this.params.column,te.EVENT_MOVING_CHANGED,()=>{this.lastMovingChanged=(new Date).getTime()}),this.eLabel&&this.addManagedListener(this.eLabel,"click",t=>{const i=this.params.column.isMoving(),s=(new Date).getTime()-this.lastMovingChanged<50;if(!(i||s)){const i=e?t.ctrlKey||t.metaKey:t.shiftKey;this.params.progressSort(i)}});const t=()=>{if(this.addOrRemoveCssClass("ag-header-cell-sorted-asc",this.params.column.isSortAscending()),this.addOrRemoveCssClass("ag-header-cell-sorted-desc",this.params.column.isSortDescending()),this.addOrRemoveCssClass("ag-header-cell-sorted-none",this.params.column.isSortNone()),this.params.column.getColDef().showRowGroup){const e=this.columnModel.getSourceColumnsForGroupColumn(this.params.column),t=!(null==e?void 0:e.every(e=>this.params.column.getSort()==e.getSort()));this.addOrRemoveCssClass("ag-header-cell-sorted-mixed",t)}};this.addManagedListener(this.eventService,_e.EVENT_SORT_CHANGED,t),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_ROW_GROUP_CHANGED,t)}setupFilterIcon(){this.eFilter&&(this.addManagedListener(this.params.column,te.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.onFilterChanged())}onFilterChanged(){const e=this.params.column.isFilterActive();Mi(this.eFilter,e,{skipAriaHidden:!0})}}Ko.TEMPLATE='<div class="ag-cell-label-container" role="presentation">\n            <span ref="eMenu" class="ag-header-icon ag-header-cell-menu-button" aria-hidden="true"></span>\n            <div ref="eLabel" class="ag-header-cell-label" role="presentation">\n                <span ref="eText" class="ag-header-cell-text"></span>\n                <span ref="eFilter" class="ag-header-icon ag-header-label-icon ag-filter-icon" aria-hidden="true"></span>\n                <ag-sort-indicator ref="eSortIndicator"></ag-sort-indicator>\n            </div>\n        </div>',zo([j("sortController")],Ko.prototype,"sortController",void 0),zo([j("menuFactory")],Ko.prototype,"menuFactory",void 0),zo([j("columnModel")],Ko.prototype,"columnModel",void 0),zo([Ks("eFilter")],Ko.prototype,"eFilter",void 0),zo([Ks("eSortIndicator")],Ko.prototype,"eSortIndicator",void 0),zo([Ks("eMenu")],Ko.prototype,"eMenu",void 0),zo([Ks("eLabel")],Ko.prototype,"eLabel",void 0),zo([Ks("eText")],Ko.prototype,"eText",void 0),zo([Ks("eSortOrder")],Ko.prototype,"eSortOrder",void 0),zo([Ks("eSortAsc")],Ko.prototype,"eSortAsc",void 0),zo([Ks("eSortDesc")],Ko.prototype,"eSortDesc",void 0),zo([Ks("eSortMixed")],Ko.prototype,"eSortMixed",void 0),zo([Ks("eSortNone")],Ko.prototype,"eSortNone",void 0);var Yo=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class $o extends js{constructor(){super($o.TEMPLATE)}destroy(){super.destroy()}init(e){this.params=e,this.checkWarnings(),this.setupLabel(),this.addGroupExpandIcon(),this.setupExpandIcons()}checkWarnings(){if(this.params.template){const e="AG Grid: A template was provided for Header Group Comp - templates are only supported for Header Comps (not groups)";T(()=>console.warn(e),"HeaderGroupComp.templateNotSupported")}}setupExpandIcons(){this.addInIcon("columnGroupOpened","agOpened"),this.addInIcon("columnGroupClosed","agClosed");const e=e=>{if(Ee(e))return;const t=!this.params.columnGroup.isExpanded();this.columnModel.setColumnGroupOpened(this.params.columnGroup.getProvidedColumnGroup(),t,"uiColumnExpanded")};this.addTouchAndClickListeners(this.eCloseIcon,e),this.addTouchAndClickListeners(this.eOpenIcon,e);const t=e=>{Se(e)};this.addManagedListener(this.eCloseIcon,"dblclick",t),this.addManagedListener(this.eOpenIcon,"dblclick",t),this.addManagedListener(this.getGui(),"dblclick",e),this.updateIconVisibility();const i=this.params.columnGroup.getProvidedColumnGroup();this.addManagedListener(i,se.EVENT_EXPANDED_CHANGED,this.updateIconVisibility.bind(this)),this.addManagedListener(i,se.EVENT_EXPANDABLE_CHANGED,this.updateIconVisibility.bind(this))}addTouchAndClickListeners(e,t){const i=new Wo(e,!0);this.addManagedListener(i,Wo.EVENT_TAP,t),this.addDestroyFunc(()=>i.destroy()),this.addManagedListener(e,"click",t)}updateIconVisibility(){if(this.params.columnGroup.isExpandable()){const e=this.params.columnGroup.isExpanded();Mi(this.eOpenIcon,e),Mi(this.eCloseIcon,!e)}else Mi(this.eOpenIcon,!1),Mi(this.eCloseIcon,!1)}addInIcon(e,t){const i=fs(e,this.gridOptionsService,null);i&&this.getRefElement(t).appendChild(i)}addGroupExpandIcon(){if(!this.params.columnGroup.isExpandable())return Mi(this.eOpenIcon,!1),void Mi(this.eCloseIcon,!1)}setupLabel(){var e;const{displayName:i,columnGroup:s}=this.params;if(t(i)){const e=je(i);this.getRefElement("agLabel").innerHTML=e}this.addOrRemoveCssClass("ag-sticky-label",!(null===(e=s.getColGroupDef())||void 0===e?void 0:e.suppressStickyLabel))}}$o.TEMPLATE='<div class="ag-header-group-cell-label" ref="agContainer" role="presentation">\n            <span ref="agLabel" class="ag-header-group-text" role="presentation"></span>\n            <span ref="agOpened" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-expanded"></span>\n            <span ref="agClosed" class="ag-header-icon ag-header-expand-icon ag-header-expand-icon-collapsed"></span>\n        </div>',Yo([j("columnModel")],$o.prototype,"columnModel",void 0),Yo([Ks("agOpened")],$o.prototype,"eOpenIcon",void 0),Yo([Ks("agClosed")],$o.prototype,"eCloseIcon",void 0);class qo extends js{isPopup(){return!0}setParentComponent(e){e.addCssClass("ag-has-popup"),super.setParentComponent(e)}destroy(){const e=this.parentComponent;e&&e.isAlive()&&e.getGui().classList.remove("ag-has-popup"),super.destroy()}}var Qo=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Xo extends qo{constructor(){super(Xo.TEMPLATE)}init(e){this.params=e,this.focusAfterAttached=e.cellStartedEdit,this.eTextArea.setMaxLength(e.maxLength||200).setCols(e.cols||60).setRows(e.rows||10),t(e.value,!0)&&this.eTextArea.setValue(e.value.toString(),!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}onKeyDown(e){const t=e.key;(t===ys.LEFT||t===ys.UP||t===ys.RIGHT||t===ys.DOWN||e.shiftKey&&t===ys.ENTER)&&e.stopPropagation()}afterGuiAttached(){const e=this.localeService.getLocaleTextFunc();this.eTextArea.setInputAriaLabel(e("ariaInputEditor","Input Editor")),this.focusAfterAttached&&this.eTextArea.getFocusableElement().focus()}getValue(){const e=this.eTextArea.getValue();return t(e)||t(this.params.value)?this.params.parseValue(e):this.params.value}}Xo.TEMPLATE='<div class="ag-large-text">\n            <ag-input-text-area ref="eTextArea" class="ag-large-text-input"></ag-input-text-area>\n        </div>',Qo([Ks("eTextArea")],Xo.prototype,"eTextArea",void 0);var Jo=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Zo extends qo{constructor(){super('<div class="ag-cell-edit-wrapper">\n                <ag-select class="ag-cell-editor" ref="eSelect"></ag-select>\n            </div>'),this.startedByEnter=!1}init(e){this.focusAfterAttached=e.cellStartedEdit;const{eSelect:t,valueFormatterService:s,gridOptionsService:o}=this,{values:r,value:n,eventKey:l}=e;if(i(r))return void console.warn("AG Grid: no values found for select cellEditor");this.startedByEnter=null!=l&&l===ys.ENTER;let a=!1;r.forEach(i=>{const o={value:i},r=s.formatValue(e.column,null,i),l=null!=r;o.text=l?r:i,t.addOption(o),a=a||n===i}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:d,valueListMaxWidth:h,valueListMaxHeight:c}=e;null!=d&&t.setPickerGap(d),null!=c&&t.setPickerMaxHeight(c),null!=h&&t.setPickerMaxWidth(h),"fullRow"!==o.get("editType")&&this.addManagedListener(this.eSelect,po.EVENT_ITEM_SELECTED,()=>e.stopEditing())}afterGuiAttached(){this.focusAfterAttached&&this.eSelect.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eSelect.showPicker()})}focusIn(){this.eSelect.getFocusableElement().focus()}getValue(){return this.eSelect.getValue()}isPopup(){return!1}}Jo([j("valueFormatterService")],Zo.prototype,"valueFormatterService",void 0),Jo([Ks("eSelect")],Zo.prototype,"eSelect",void 0);var er=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class tr extends qo{constructor(e){super(`\n            <div class="ag-cell-edit-wrapper">\n                ${e.getTemplate()}\n            </div>`),this.cellEditorInput=e}init(e){this.params=e;const t=this.eInput;let i;if(this.cellEditorInput.init(t,e),e.cellStartedEdit){this.focusAfterAttached=!0;const t=e.eventKey;t===ys.BACKSPACE||e.eventKey===ys.DELETE?i="":t&&1===t.length?i=t:(i=this.cellEditorInput.getStartValue(),t!==ys.F2&&(this.highlightAllOnFocus=!0))}else this.focusAfterAttached=!1,i=this.cellEditorInput.getStartValue();null!=i&&t.setStartValue(i),this.addManagedListener(t.getGui(),"keydown",e=>{const{key:t}=e;t!==ys.PAGE_UP&&t!==ys.PAGE_DOWN||e.preventDefault()})}afterGuiAttached(){var e,t;const i=this.localeService.getLocaleTextFunc(),s=this.eInput;if(s.setInputAriaLabel(i("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;ni()||s.getFocusableElement().focus();const o=s.getInputElement();this.highlightAllOnFocus?o.select():null===(t=(e=this.cellEditorInput).setCaret)||void 0===t||t.call(e)}focusIn(){const e=this.eInput,t=e.getFocusableElement(),i=e.getInputElement();t.focus(),i.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}}er([Ks("eInput")],tr.prototype,"eInput",void 0);class ir{getTemplate(){return'<ag-input-text-field class="ag-cell-editor" ref="eInput"></ag-input-text-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.maxLength&&e.setMaxLength(t.maxLength)}getValue(){const e=this.eInput.getValue();return t(e)||t(this.params.value)?this.params.parseValue(e):this.params.value}getStartValue(){return this.params.useFormatter||this.params.column.getColDef().refData?this.params.formatValue(this.params.value):this.params.value}setCaret(){const e=this.eInput.getValue(),i=t(e)&&e.length||0;i&&this.eInput.getInputElement().setSelectionRange(i,i)}}class sr extends tr{constructor(){super(new ir)}}var or=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class rr extends js{constructor(){super(rr.TEMPLATE),this.refreshCount=0}init(e){this.eValue=this.queryForHtmlElement(".ag-value-change-value"),this.eDelta=this.queryForHtmlElement(".ag-value-change-delta"),this.refresh(e)}showDelta(e,i){const s=Math.abs(i),o=e.formatValue(s),r=t(o)?o:s,n=i>=0;this.eDelta.innerHTML=n?"\u2191"+r:"\u2193"+r,this.eDelta.classList.toggle("ag-value-change-delta-up",n),this.eDelta.classList.toggle("ag-value-change-delta-down",!n)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),Yi(this.eDelta)}refresh(e){const i=e.value;if(i===this.lastValue)return!1;if(t(e.valueFormatted)?this.eValue.innerHTML=e.valueFormatted:t(e.value)?this.eValue.innerHTML=i:Yi(this.eValue),this.filterManager.isSuppressFlashingCellsBecauseFiltering())return!1;if("number"==typeof i&&"number"==typeof this.lastValue){const t=i-this.lastValue;this.showDelta(e,t)}return this.lastValue&&this.eValue.classList.add("ag-value-change-value-highlight"),this.setTimerToRemoveDelta(),this.lastValue=i,!0}}rr.TEMPLATE='<span><span class="ag-value-change-delta"></span><span class="ag-value-change-value"></span></span>',or([j("filterManager")],rr.prototype,"filterManager",void 0);var nr=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class lr extends js{constructor(){super(lr.TEMPLATE),this.refreshCount=0,this.eCurrent=this.queryForHtmlElement(".ag-value-slide-current")}init(e){this.refresh(e)}addSlideAnimation(){this.refreshCount++;const e=this.refreshCount;this.ePrevious&&this.getGui().removeChild(this.ePrevious),this.ePrevious=Qi('<span class="ag-value-slide-previous ag-value-slide-out"></span>'),this.ePrevious.innerHTML=this.eCurrent.innerHTML,this.getGui().insertBefore(this.ePrevious,this.eCurrent),window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{e===this.refreshCount&&(this.getGui().removeChild(this.ePrevious),this.ePrevious=null)},3e3)}refresh(e){let s=e.value;return i(s)&&(s=""),s!==this.lastValue&&(!this.filterManager.isSuppressFlashingCellsBecauseFiltering()&&(this.addSlideAnimation(),this.lastValue=s,t(e.valueFormatted)?this.eCurrent.innerHTML=e.valueFormatted:t(e.value)?this.eCurrent.innerHTML=s:Yi(this.eCurrent),!0))}}lr.TEMPLATE='<span>\n            <span class="ag-value-slide-current"></span>\n        </span>',nr([j("filterManager")],lr.prototype,"filterManager",void 0);class ar{constructor(e){this.rowIndex=null,this.key=null,this.childrenMapped={},this.displayed=!1,this.rowTop=null,this.oldRowTop=null,this.selectable=!0,this.__objectId=ar.OBJECT_ID_SEQUENCE++,this.__autoHeights={},this.alreadyRendered=!1,this.highlighted=null,this.hovered=!1,this.selected=!1,this.beans=e}setData(e){this.setDataCommon(e,!1)}updateData(e){this.setDataCommon(e,!0)}setDataCommon(e,t){const i=this.data;this.data=e,this.beans.valueCache.onDataChanged(),this.updateDataOnDetailNode(),this.checkRowSelectable(),this.resetQuickFilterAggregateText();const s=this.createDataChangedEvent(e,i,t);this.dispatchLocalEvent(s)}updateDataOnDetailNode(){this.detailNode&&(this.detailNode.data=this.data)}createDataChangedEvent(e,t,i){return{type:ar.EVENT_DATA_CHANGED,node:this,oldData:t,newData:e,update:i}}createLocalRowEvent(e){return{type:e,node:this}}getRowIndexString(){return"top"===this.rowPinned?"t-"+this.rowIndex:"bottom"===this.rowPinned?"b-"+this.rowIndex:this.rowIndex.toString()}createDaemonNode(){const e=new ar(this.beans);return e.id=this.id,e.data=this.data,e.__daemon=!0,e.selected=this.selected,e.level=this.level,e}setDataAndId(e,i){const s=t(this.id)?this.createDaemonNode():null,o=this.data;this.data=e,this.updateDataOnDetailNode(),this.setId(i),this.checkRowSelectable(),this.beans.selectionService.syncInRowNode(this,s);const r=this.createDataChangedEvent(e,o,!1);this.dispatchLocalEvent(r)}checkRowSelectable(){const e=this.beans.gridOptionsService.get("isRowSelectable");this.setRowSelectable(!e||e(this))}setRowSelectable(e){if(this.selectable!==e){this.selectable=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_SELECTABLE_CHANGED));if(this.beans.gridOptionsService.is("groupSelectsChildren")){const e=this.calculateSelectedFromChildren();this.setSelectedParams({newValue:null!=e&&e,source:"selectableChanged"})}}}setId(e){const t=this.beans.gridOptionsService.getCallback("getRowId");if(t)if(this.data){const e=this.getGroupKeys(!0);this.id=t({data:this.data,parentKeys:e.length>0?e:void 0,level:this.level}),null!==this.id&&"string"==typeof this.id&&this.id.startsWith(ar.ID_PREFIX_ROW_GROUP)&&console.error(`AG Grid: Row IDs cannot start with ${ar.ID_PREFIX_ROW_GROUP}, this is a reserved prefix for AG Grid's row grouping feature.`),null!==this.id&&"string"!=typeof this.id&&(this.id=""+this.id)}else this.id=void 0;else this.id=e}getGroupKeys(e=!1){const t=[];let i=this;for(e&&(i=i.parent);i&&i.level>=0;)t.push(i.key),i=i.parent;return t.reverse(),t}isPixelInRange(e){return!(!t(this.rowTop)||!t(this.rowHeight))&&(e>=this.rowTop&&e<this.rowTop+this.rowHeight)}setFirstChild(e){this.firstChild!==e&&(this.firstChild=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_FIRST_CHILD_CHANGED)))}setLastChild(e){this.lastChild!==e&&(this.lastChild=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_LAST_CHILD_CHANGED)))}setChildIndex(e){this.childIndex!==e&&(this.childIndex=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_CHILD_INDEX_CHANGED)))}setRowTop(e){this.oldRowTop=this.rowTop,this.rowTop!==e&&(this.rowTop=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_TOP_CHANGED)),this.setDisplayed(null!==e))}clearRowTopAndRowIndex(){this.oldRowTop=null,this.setRowTop(null),this.setRowIndex(null)}setDisplayed(e){this.displayed!==e&&(this.displayed=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_DISPLAYED_CHANGED)))}setDragging(e){this.dragging!==e&&(this.dragging=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_DRAGGING_CHANGED)))}setHighlighted(e){e!==this.highlighted&&(this.highlighted=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_HIGHLIGHT_CHANGED)))}setHovered(e){this.hovered!==e&&(this.hovered=e)}isHovered(){return this.hovered}setAllChildrenCount(e){this.allChildrenCount!==e&&(this.allChildrenCount=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_ALL_CHILDREN_COUNT_CHANGED)))}setMaster(e){this.master!==e&&(this.master&&!e&&(this.expanded=!1),this.master=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_MASTER_CHANGED)))}setGroup(e){this.group!==e&&(this.group&&!e&&(this.expanded=!1),this.group=e,this.updateHasChildren(),this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_GROUP_CHANGED)))}setRowHeight(e,t=!1){this.rowHeight=e,this.rowHeightEstimated=t,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_HEIGHT_CHANGED))}setRowAutoHeight(e,t){this.__autoHeights||(this.__autoHeights={}),this.__autoHeights[t.getId()]=e,null!=e&&(null==this.checkAutoHeightsDebounced&&(this.checkAutoHeightsDebounced=I(this.checkAutoHeights.bind(this),1)),this.checkAutoHeightsDebounced())}checkAutoHeights(){let e=!1,t=!0,i=0;const s=this.__autoHeights;if(null==s)return;if(this.beans.columnModel.getAllDisplayedAutoHeightCols().forEach(o=>{let r=s[o.getId()];if(null==r){if(!this.beans.columnModel.isColSpanActive())return void(e=!0);{let t=[];switch(o.getPinned()){case"left":t=this.beans.columnModel.getDisplayedLeftColumnsForRow(this);break;case"right":t=this.beans.columnModel.getDisplayedRightColumnsForRow(this);break;case null:t=this.beans.columnModel.getViewportCenterColumnsForRow(this)}if(t.includes(o))return void(e=!0);r=-1}}else t=!1;r>i&&(i=r)}),e)return;if((t||i<10)&&(i=this.beans.gridOptionsService.getRowHeightForNode(this).height),i==this.rowHeight)return;this.setRowHeight(i);const o=this.beans.rowModel;o.onRowHeightChangedDebounced&&o.onRowHeightChangedDebounced()}setRowIndex(e){this.rowIndex!==e&&(this.rowIndex=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_ROW_INDEX_CHANGED)))}setUiLevel(e){this.uiLevel!==e&&(this.uiLevel=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_UI_LEVEL_CHANGED)))}setExpanded(e,t){if(this.expanded===e)return;this.expanded=e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_EXPANDED_CHANGED));const i=Object.assign({},this.createGlobalRowEvent(_e.EVENT_ROW_GROUP_OPENED),{expanded:e,event:t||null});this.beans.rowNodeEventThrottle.dispatchExpanded(i),this.sibling&&this.beans.rowRenderer.refreshCells({rowNodes:[this]})}createGlobalRowEvent(e){return{type:e,node:this,data:this.data,rowIndex:this.rowIndex,rowPinned:this.rowPinned,context:this.beans.gridOptionsService.context,api:this.beans.gridOptionsService.api,columnApi:this.beans.gridOptionsService.columnApi}}dispatchLocalEvent(e){this.eventService&&this.eventService.dispatchEvent(e)}setDataValue(e,t,i){const s=(()=>{var t;return"string"!=typeof e?e:null!==(t=this.beans.columnModel.getGridColumn(e))&&void 0!==t?t:this.beans.columnModel.getPrimaryColumn(e)})(),o=this.getValueFromValueService(s);if(this.beans.gridOptionsService.is("readOnlyEdit"))return this.dispatchEventForSaveValueReadOnly(s,o,t,i),!1;const r=this.beans.valueService.setValue(this,s,t,i);return this.dispatchCellChangedEvent(s,t,o),this.checkRowSelectable(),r}getValueFromValueService(e){const t=this.leafGroup&&this.beans.columnModel.isPivotMode(),i=this.group&&this.expanded&&!this.footer&&!t,s=this.beans.gridOptionsService.getGroupIncludeFooter()({node:this}),o=this.beans.gridOptionsService.is("groupSuppressBlankHeader"),r=i&&s&&!o;return this.beans.valueService.getValue(e,this,!1,r)}dispatchEventForSaveValueReadOnly(e,t,i,s){const o={type:_e.EVENT_CELL_EDIT_REQUEST,event:null,rowIndex:this.rowIndex,rowPinned:this.rowPinned,column:e,colDef:e.getColDef(),context:this.beans.gridOptionsService.context,api:this.beans.gridOptionsService.api,columnApi:this.beans.gridOptionsService.columnApi,data:this.data,node:this,oldValue:t,newValue:i,value:i,source:s};this.beans.eventService.dispatchEvent(o)}setGroupValue(e,t){const s=this.beans.columnModel.getGridColumn(e);i(this.groupData)&&(this.groupData={});const o=s.getColId(),r=this.groupData[o];r!==t&&(this.groupData[o]=t,this.dispatchCellChangedEvent(s,t,r))}setAggData(e){const t=C([this.aggData,e]),i=this.aggData;this.aggData=e,this.eventService&&t.forEach(e=>{const t=this.aggData?this.aggData[e]:void 0,s=i?i[e]:void 0;if(t===s)return;const o=this.beans.columnModel.lookupGridColumn(e);o&&this.dispatchCellChangedEvent(o,t,s)})}updateHasChildren(){let e=this.group&&!this.footer||this.childrenAfterGroup&&this.childrenAfterGroup.length>0;if(this.beans.gridOptionsService.isRowModelType("serverSide")){const t=this.beans.gridOptionsService.is("treeData"),i=this.beans.gridOptionsService.get("isServerSideGroup");e=!this.stub&&!this.footer&&(t?!!i&&i(this.data):!!this.group)}e!==this.__hasChildren&&(this.__hasChildren=!!e,this.eventService&&this.eventService.dispatchEvent(this.createLocalRowEvent(ar.EVENT_HAS_CHILDREN_CHANGED)))}hasChildren(){return null==this.__hasChildren&&this.updateHasChildren(),this.__hasChildren}isEmptyRowGroupNode(){return this.group&&s(this.childrenAfterGroup)}dispatchCellChangedEvent(e,t,i){const s={type:ar.EVENT_CELL_CHANGED,node:this,column:e,newValue:t,oldValue:i};this.dispatchLocalEvent(s)}resetQuickFilterAggregateText(){this.quickFilterAggregateText=null}isExpandable(){return!!(this.hasChildren()&&!this.footer||this.master)}isSelected(){return this.footer?this.sibling.isSelected():this.selected}depthFirstSearch(e){this.childrenAfterGroup&&this.childrenAfterGroup.forEach(t=>t.depthFirstSearch(e)),e(this)}calculateSelectedFromChildren(){var e;let t=!1,i=!1,s=!1;if(!(null===(e=this.childrenAfterGroup)||void 0===e?void 0:e.length))return this.selectable?this.selected:null;for(let e=0;e<this.childrenAfterGroup.length;e++){const o=this.childrenAfterGroup[e];let r=o.isSelected();if(!o.selectable){const e=o.calculateSelectedFromChildren();if(null===e)continue;r=e}switch(r){case!0:t=!0;break;case!1:i=!0;break;default:s=!0}}return s||t&&i?void 0:!!t||!i&&(this.selectable?this.selected:null)}setSelectedInitialValue(e){this.selected=e}selectThisNode(e,t,i="api"){const s=!this.selectable&&e,o=this.selected===e;if(s||o)return!1;if(this.selected=e,this.eventService){this.dispatchLocalEvent(this.createLocalRowEvent(ar.EVENT_ROW_SELECTED));const e=this.sibling;e&&e.footer&&e.dispatchLocalEvent(e.createLocalRowEvent(ar.EVENT_ROW_SELECTED))}const r=Object.assign(Object.assign({},this.createGlobalRowEvent(_e.EVENT_ROW_SELECTED)),{event:t||null,source:i});return this.beans.eventService.dispatchEvent(r),!0}setSelected(e,t=!1,i="api"){"boolean"!=typeof i?this.setSelectedParams({newValue:e,clearSelection:t,rangeSelect:!1,source:i}):console.warn("AG Grid: since version v30, rowNode.setSelected() property `suppressFinishActions` has been removed, please use `gridApi.setNodesSelected()` for bulk actions, and the event `source` property for ignoring events instead.")}setSelectedParams(e){return this.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),0):void 0===this.id?(console.warn("AG Grid: cannot select node until id for node is known"),0):this.beans.selectionService.setNodesSelected(Object.assign(Object.assign({},e),{nodes:[this.footer?this.sibling:this]}))}isRowPinned(){return"top"===this.rowPinned||"bottom"===this.rowPinned}isParentOfNode(e){let t=this.parent;for(;t;){if(t===e)return!0;t=t.parent}return!1}addEventListener(e,t){this.eventService||(this.eventService=new X),this.eventService.addEventListener(e,t)}removeEventListener(e,t){this.eventService&&(this.eventService.removeEventListener(e,t),this.eventService.noRegisteredListenersExist()&&(this.eventService=null))}onMouseEnter(){this.dispatchLocalEvent(this.createLocalRowEvent(ar.EVENT_MOUSE_ENTER))}onMouseLeave(){this.dispatchLocalEvent(this.createLocalRowEvent(ar.EVENT_MOUSE_LEAVE))}getFirstChildOfFirstChild(e){let i=this,s=!0,o=!1,r=null;for(;s&&!o;){const n=i.parent;t(n)&&i.firstChild?n.rowGroupColumn===e&&(o=!0,r=n):s=!1,i=n}return o?r:null}isFullWidthCell(){if(this.detail)return!0;const e=this.beans.gridOptionsService.getCallback("isFullWidthRow");return!!e&&e({rowNode:this})}getRoute(){if(null==this.key)return;const e=[];let t=this;for(;null!=t.key;)e.push(t.key),t=t.parent;return e.reverse()}createFooter(){if(this.sibling)return;const e=new Set(["eventService","__objectId","sticky"]),t=new ar(this.beans);Object.keys(this).forEach(i=>{e.has(i)||(t[i]=this[i])}),t.footer=!0,t.setRowTop(null),t.setRowIndex(null),t.oldRowTop=null,t.id="rowGroupFooter_"+this.id,t.sibling=this,this.sibling=t}destroyFooter(){this.sibling&&(this.sibling.setRowTop(null),this.sibling.setRowIndex(null),this.sibling=void 0)}}ar.ID_PREFIX_ROW_GROUP="row-group-",ar.ID_PREFIX_TOP_PINNED="t-",ar.ID_PREFIX_BOTTOM_PINNED="b-",ar.OBJECT_ID_SEQUENCE=0,ar.EVENT_ROW_SELECTED="rowSelected",ar.EVENT_DATA_CHANGED="dataChanged",ar.EVENT_CELL_CHANGED="cellChanged",ar.EVENT_ALL_CHILDREN_COUNT_CHANGED="allChildrenCountChanged",ar.EVENT_MASTER_CHANGED="masterChanged",ar.EVENT_GROUP_CHANGED="groupChanged",ar.EVENT_MOUSE_ENTER="mouseEnter",ar.EVENT_MOUSE_LEAVE="mouseLeave",ar.EVENT_HEIGHT_CHANGED="heightChanged",ar.EVENT_TOP_CHANGED="topChanged",ar.EVENT_DISPLAYED_CHANGED="displayedChanged",ar.EVENT_FIRST_CHILD_CHANGED="firstChildChanged",ar.EVENT_LAST_CHILD_CHANGED="lastChildChanged",ar.EVENT_CHILD_INDEX_CHANGED="childIndexChanged",ar.EVENT_ROW_INDEX_CHANGED="rowIndexChanged",ar.EVENT_EXPANDED_CHANGED="expandedChanged",ar.EVENT_HAS_CHILDREN_CHANGED="hasChildrenChanged",ar.EVENT_SELECTABLE_CHANGED="selectableChanged",ar.EVENT_UI_LEVEL_CHANGED="uiLevelChanged",ar.EVENT_HIGHLIGHT_CHANGED="rowHighlightChanged",ar.EVENT_DRAGGING_CHANGED="draggingChanged";var dr=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class hr extends js{constructor(){super('\n            <div class="ag-selection-checkbox" role="presentation">\n                <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n            </div>')}postConstruct(){this.eCheckbox.setPassive(!0),Ft(this.eCheckbox.getInputElement(),"polite")}getCheckboxId(){return this.eCheckbox.getInputElement().id}onDataChanged(){this.onSelectionChanged()}onSelectableChanged(){this.showOrHideSelect()}onSelectionChanged(){const e=this.localeService.getLocaleTextFunc(),t=this.rowNode.isSelected(),i=Qt(e,t),s=e("ariaRowToggleSelection","Press Space to toggle row selection");this.eCheckbox.setValue(t,!0),this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}onClicked(e,t,i){return this.rowNode.setSelectedParams({newValue:e,rangeSelect:i.shiftKey,groupSelectsFiltered:t,event:i,source:"checkboxSelected"})}init(e){this.rowNode=e.rowNode,this.column=e.column,this.overrides=e.overrides,this.onSelectionChanged(),this.addManagedListener(this.eCheckbox.getInputElement(),"dblclick",e=>{Se(e)}),this.addManagedListener(this.eCheckbox.getInputElement(),"click",e=>{Se(e);const t=this.gridOptionsService.is("groupSelectsFiltered"),i=this.eCheckbox.getValue();if(this.shouldHandleIndeterminateState(i,t)){0===this.onClicked(!0,t,e||{})&&this.onClicked(!1,t,e)}else i?this.onClicked(!1,t,e):this.onClicked(!0,t,e||{})}),this.addManagedListener(this.rowNode,ar.EVENT_ROW_SELECTED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_DATA_CHANGED,this.onDataChanged.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_SELECTABLE_CHANGED,this.onSelectableChanged.bind(this));if(this.gridOptionsService.get("isRowSelectable")||"function"==typeof this.getIsVisible()){const e=this.showOrHideSelect.bind(this);this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.rowNode,ar.EVENT_DATA_CHANGED,e),this.addManagedListener(this.rowNode,ar.EVENT_CELL_CHANGED,e),this.showOrHideSelect()}this.eCheckbox.getInputElement().setAttribute("tabindex","-1")}shouldHandleIndeterminateState(e,t){return t&&(void 0===this.eCheckbox.getPreviousValue()||void 0===e)&&this.gridOptionsService.isRowModelType("clientSide")}showOrHideSelect(){var e,t,i,s;let o=this.rowNode.selectable;const r=this.getIsVisible();if(o)if("function"==typeof r){const i=null===(e=this.overrides)||void 0===e?void 0:e.callbackParams,s=null===(t=this.column)||void 0===t?void 0:t.createColumnFunctionCallbackParams(this.rowNode);o=!!s&&r(Object.assign(Object.assign({},i),s))}else o=null!=r&&r;if(null===(i=this.column)||void 0===i?void 0:i.getColDef().showDisabledCheckboxes)return this.eCheckbox.setDisabled(!o),this.setVisible(!0),void this.setDisplayed(!0);(null===(s=this.overrides)||void 0===s?void 0:s.removeHidden)?this.setDisplayed(o):this.setVisible(o)}getIsVisible(){var e,t;return this.overrides?this.overrides.isVisible:null===(t=null===(e=this.column)||void 0===e?void 0:e.getColDef())||void 0===t?void 0:t.checkboxSelection}}dr([Ks("eCheckbox")],hr.prototype,"eCheckbox",void 0),dr([B],hr.prototype,"postConstruct",null);var cr,ur,pr,gr,mr=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};!function(e){e[e.ToolPanel=0]="ToolPanel",e[e.HeaderCell=1]="HeaderCell",e[e.RowDrag=2]="RowDrag",e[e.ChartPanel=3]="ChartPanel",e[e.AdvancedFilterBuilder=4]="AdvancedFilterBuilder"}(ur||(ur={})),function(e){e[e.Up=0]="Up",e[e.Down=1]="Down"}(pr||(pr={})),function(e){e[e.Left=0]="Left",e[e.Right=1]="Right"}(gr||(gr={}));let Cr=cr=class extends Le{constructor(){super(...arguments),this.dragSourceAndParamsList=[],this.dropTargets=[]}init(){this.ePinnedIcon=vs("columnMovePin",this.gridOptionsService,null),this.eHideIcon=vs("columnMoveHide",this.gridOptionsService,null),this.eMoveIcon=vs("columnMoveMove",this.gridOptionsService,null),this.eLeftIcon=vs("columnMoveLeft",this.gridOptionsService,null),this.eRightIcon=vs("columnMoveRight",this.gridOptionsService,null),this.eGroupIcon=vs("columnMoveGroup",this.gridOptionsService,null),this.eAggregateIcon=vs("columnMoveValue",this.gridOptionsService,null),this.ePivotIcon=vs("columnMovePivot",this.gridOptionsService,null),this.eDropNotAllowedIcon=vs("dropNotAllowed",this.gridOptionsService,null)}addDragSource(e,t=!1){const i={eElement:e.eElement,dragStartPixels:e.dragStartPixels,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this),onDragging:this.onDragging.bind(this),includeTouch:t};this.dragSourceAndParamsList.push({params:i,dragSource:e}),this.dragService.addDragSource(i)}removeDragSource(e){const t=this.dragSourceAndParamsList.find(t=>t.dragSource===e);t&&(this.dragService.removeDragSource(t.params),he(this.dragSourceAndParamsList,t))}clearDragSourceParamsList(){this.dragSourceAndParamsList.forEach(e=>this.dragService.removeDragSource(e.params)),this.dragSourceAndParamsList.length=0,this.dropTargets.length=0}nudge(){this.dragging&&this.onDragging(this.eventLastTime,!0)}onDragStart(e,t){this.dragging=!0,this.dragSource=e,this.eventLastTime=t,this.dragItem=this.dragSource.getDragItem(),this.lastDropTarget=this.dragSource.dragSourceDropTarget,this.dragSource.onDragStarted&&this.dragSource.onDragStarted(),this.createGhost()}onDragStop(e){if(this.eventLastTime=null,this.dragging=!1,this.dragSource.onDragStopped&&this.dragSource.onDragStopped(),this.lastDropTarget&&this.lastDropTarget.onDragStop){const t=this.createDropTargetEvent(this.lastDropTarget,e,null,null,!1);this.lastDropTarget.onDragStop(t)}this.lastDropTarget=null,this.dragItem=null,this.removeGhost()}onDragging(e,t){var i,s,o,r;const n=this.getHorizontalDirection(e),l=this.getVerticalDirection(e);this.eventLastTime=e,this.positionGhost(e);const a=this.dropTargets.filter(t=>this.isMouseOnDropTarget(e,t)),d=this.findCurrentDropTarget(e,a);if(d!==this.lastDropTarget)this.leaveLastTargetIfExists(e,n,l,t),null!==this.lastDropTarget&&null===d&&(null===(s=(i=this.dragSource).onGridExit)||void 0===s||s.call(i,this.dragItem)),null===this.lastDropTarget&&null!==d&&(null===(r=(o=this.dragSource).onGridEnter)||void 0===r||r.call(o,this.dragItem)),this.enterDragTargetIfExists(d,e,n,l,t),this.lastDropTarget=d;else if(d&&d.onDragging){const i=this.createDropTargetEvent(d,e,n,l,t);d.onDragging(i)}}getAllContainersFromDropTarget(e){const t=e.getSecondaryContainers?e.getSecondaryContainers():null,i=[[e.getContainer()]];return t?i.concat(t):i}allContainersIntersect(e,t){for(const i of t){const t=i.getBoundingClientRect();if(0===t.width||0===t.height)return!1;const s=e.clientX>=t.left&&e.clientX<t.right,o=e.clientY>=t.top&&e.clientY<t.bottom;if(!s||!o)return!1}return!0}isMouseOnDropTarget(e,t){const i=this.getAllContainersFromDropTarget(t);let s=!1;for(const t of i)if(this.allContainersIntersect(e,t)){s=!0;break}return!(t.targetContainsSource&&!t.getContainer().contains(this.dragSource.eElement))&&(s&&t.isInterestedIn(this.dragSource.type,this.dragSource.eElement))}findCurrentDropTarget(e,t){const i=t.length;if(0===i)return null;if(1===i)return t[0];const s=this.gridOptionsService.getRootNode().elementsFromPoint(e.clientX,e.clientY);for(const e of s)for(const i of t){if(-1!==Ce(this.getAllContainersFromDropTarget(i)).indexOf(e))return i}return null}enterDragTargetIfExists(e,t,i,s,o){if(e){if(e.onDragEnter){const r=this.createDropTargetEvent(e,t,i,s,o);e.onDragEnter(r)}this.setGhostIcon(e.getIconName?e.getIconName():null)}}leaveLastTargetIfExists(e,t,i,s){if(this.lastDropTarget){if(this.lastDropTarget.onDragLeave){const o=this.createDropTargetEvent(this.lastDropTarget,e,t,i,s);this.lastDropTarget.onDragLeave(o)}this.setGhostIcon(null)}}addDropTarget(e){this.dropTargets.push(e)}removeDropTarget(e){this.dropTargets=this.dropTargets.filter(t=>t.getContainer()!==e.getContainer())}hasExternalDropZones(){return this.dropTargets.some(e=>e.external)}findExternalZone(e){return this.dropTargets.filter(e=>e.external).find(t=>t.getContainer()===e.getContainer())||null}getHorizontalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientX,i=e.clientX;return t===i?null:t>i?gr.Left:gr.Right}getVerticalDirection(e){const t=this.eventLastTime&&this.eventLastTime.clientY,i=e.clientY;return t===i?null:t>i?pr.Up:pr.Down}createDropTargetEvent(e,t,i,s,o){const r=e.getContainer(),n=r.getBoundingClientRect(),{gridApi:l,columnApi:a,dragItem:d,dragSource:h}=this;return{event:t,x:t.clientX-n.left,y:t.clientY-n.top,vDirection:s,hDirection:i,dragSource:h,fromNudge:o,dragItem:d,api:l,columnApi:a,dropZoneTarget:r}}positionGhost(e){const t=this.eGhost;if(!t)return;const i=t.getBoundingClientRect().height,s=mi()-2,o=Ci()-2,r=Ui(t.offsetParent),{clientY:n,clientX:l}=e;let a=n-r.top-i/2,d=l-r.left-10;const h=this.gridOptionsService.getDocument(),c=h.defaultView||window,u=c.pageYOffset||h.documentElement.scrollTop,p=c.pageXOffset||h.documentElement.scrollLeft;s>0&&d+t.clientWidth>s+p&&(d=s+p-t.clientWidth),d<0&&(d=0),o>0&&a+t.clientHeight>o+u&&(a=o+u-t.clientHeight),a<0&&(a=0),t.style.left=d+"px",t.style.top=a+"px"}removeGhost(){this.eGhost&&this.eGhostParent&&this.eGhostParent.removeChild(this.eGhost),this.eGhost=null}createGhost(){this.eGhost=Qi(cr.GHOST_TEMPLATE),this.mouseEventService.stampTopLevelGridCompWithGridInstance(this.eGhost);const{theme:e}=this.environment.getTheme();e&&this.eGhost.classList.add(e),this.eGhostIcon=this.eGhost.querySelector(".ag-dnd-ghost-icon"),this.setGhostIcon(null);const t=this.eGhost.querySelector(".ag-dnd-ghost-label");let i=this.dragSource.dragItemName;D(i)&&(i=i()),t.innerHTML=je(i)||"",this.eGhost.style.height="25px",this.eGhost.style.top="20px",this.eGhost.style.left="20px";const s=this.gridOptionsService.getDocument();let o=null;try{o=s.fullscreenElement}catch(e){}finally{if(!o){const e=this.gridOptionsService.getRootNode(),t=e.querySelector("body");o=t||(e instanceof ShadowRoot?e:null==e?void 0:e.documentElement)}}this.eGhostParent=o,this.eGhostParent?this.eGhostParent.appendChild(this.eGhost):console.warn("AG Grid: could not find document body, it is needed for dragging columns")}setGhostIcon(e,t=!1){Yi(this.eGhostIcon);let i=null;switch(e||(e=this.dragSource.getDefaultIconName?this.dragSource.getDefaultIconName():cr.ICON_NOT_ALLOWED),e){case cr.ICON_PINNED:i=this.ePinnedIcon;break;case cr.ICON_MOVE:i=this.eMoveIcon;break;case cr.ICON_LEFT:i=this.eLeftIcon;break;case cr.ICON_RIGHT:i=this.eRightIcon;break;case cr.ICON_GROUP:i=this.eGroupIcon;break;case cr.ICON_AGGREGATE:i=this.eAggregateIcon;break;case cr.ICON_PIVOT:i=this.ePivotIcon;break;case cr.ICON_NOT_ALLOWED:i=this.eDropNotAllowedIcon;break;case cr.ICON_HIDE:i=this.eHideIcon}this.eGhostIcon.classList.toggle("ag-shake-left-to-right",t),i===this.eHideIcon&&this.gridOptionsService.is("suppressDragLeaveHidesColumns")||i&&this.eGhostIcon.appendChild(i)}};Cr.ICON_PINNED="pinned",Cr.ICON_MOVE="move",Cr.ICON_LEFT="left",Cr.ICON_RIGHT="right",Cr.ICON_GROUP="group",Cr.ICON_AGGREGATE="aggregate",Cr.ICON_PIVOT="pivot",Cr.ICON_NOT_ALLOWED="notAllowed",Cr.ICON_HIDE="hide",Cr.GHOST_TEMPLATE='<div class="ag-dnd-ghost ag-unselectable">\n            <span class="ag-dnd-ghost-icon ag-shake-left-to-right"></span>\n            <div class="ag-dnd-ghost-label"></div>\n        </div>',mr([j("dragService")],Cr.prototype,"dragService",void 0),mr([j("mouseEventService")],Cr.prototype,"mouseEventService",void 0),mr([j("columnApi")],Cr.prototype,"columnApi",void 0),mr([j("gridApi")],Cr.prototype,"gridApi",void 0),mr([B],Cr.prototype,"init",null),mr([W],Cr.prototype,"clearDragSourceParamsList",null),Cr=cr=mr([U("dragAndDropService")],Cr);var vr=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class fr extends js{constructor(e,t,i,s,o,r){super(),this.cellValueFn=e,this.rowNode=t,this.column=i,this.customGui=s,this.dragStartPixels=o,this.suppressVisibilityChange=r,this.dragSource=null}isCustomGui(){return null!=this.customGui}postConstruct(){if(this.customGui?this.setDragElement(this.customGui,this.dragStartPixels):(this.setTemplate('<div class="ag-drag-handle ag-row-drag" aria-hidden="true"></div>'),this.getGui().appendChild(fs("rowDrag",this.gridOptionsService,null)),this.addDragSource()),this.checkCompatibility(),!this.suppressVisibilityChange){const e=this.gridOptionsService.is("rowDragManaged")?new Sr(this,this.beans,this.rowNode,this.column):new yr(this,this.beans,this.rowNode,this.column);this.createManagedBean(e,this.beans.context)}}setDragElement(e,t){this.setTemplateFromElement(e),this.addDragSource(t)}getSelectedNodes(){if(!this.gridOptionsService.is("rowDragMultiRow"))return[this.rowNode];const e=this.beans.selectionService.getSelectedNodes();return-1!==e.indexOf(this.rowNode)?e:[this.rowNode]}checkCompatibility(){const e=this.gridOptionsService.is("rowDragManaged");this.gridOptionsService.is("treeData")&&e&&T(()=>console.warn("AG Grid: If using row drag with tree data, you cannot have rowDragManaged=true"),"RowDragComp.managedAndTreeData")}getDragItem(){return{rowNode:this.rowNode,rowNodes:this.getSelectedNodes(),columns:this.column?[this.column]:void 0,defaultTextValue:this.cellValueFn()}}getRowDragText(e){if(e){const t=e.getColDef();if(t.rowDragText)return t.rowDragText}return this.gridOptionsService.get("rowDragText")}addDragSource(e=4){this.dragSource&&this.removeDragSource();const t=this.getRowDragText(this.column),i=this.localeService.getLocaleTextFunc();this.dragSource={type:ur.RowDrag,eElement:this.getGui(),dragItemName:()=>{var e;const s=this.getDragItem(),o=(null===(e=s.rowNodes)||void 0===e?void 0:e.length)||1;return t?t(s,o):1===o?this.cellValueFn():`${o} ${i("rowDragRows","rows")}`},getDragItem:()=>this.getDragItem(),dragStartPixels:e,dragSourceDomDataKey:this.gridOptionsService.getDomDataKey()},this.beans.dragAndDropService.addDragSource(this.dragSource,!0)}removeDragSource(){this.dragSource&&this.beans.dragAndDropService.removeDragSource(this.dragSource),this.dragSource=null}}vr([j("beans")],fr.prototype,"beans",void 0),vr([B],fr.prototype,"postConstruct",null),vr([W],fr.prototype,"removeDragSource",null);class wr extends Le{constructor(e,t,i){super(),this.parent=e,this.rowNode=t,this.column=i}setDisplayedOrVisible(e){const t={skipAriaHidden:!0};if(e)this.parent.setDisplayed(!1,t);else{let e=!0,i=!1;this.column&&(e=this.column.isRowDrag(this.rowNode)||this.parent.isCustomGui(),i=D(this.column.getColDef().rowDrag)),i?(this.parent.setDisplayed(!0,t),this.parent.setVisible(e,t)):(this.parent.setDisplayed(e,t),this.parent.setVisible(!0,t))}}}class yr extends wr{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,_e.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.gridOptionsService.is("suppressRowDrag");this.setDisplayedOrVisible(e)}}vr([B],yr.prototype,"postConstruct",null);class Sr extends wr{constructor(e,t,i,s){super(e,i,s),this.beans=t}postConstruct(){this.addManagedListener(this.beans.eventService,_e.EVENT_SORT_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,_e.EVENT_FILTER_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,_e.EVENT_COLUMN_ROW_GROUP_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.beans.eventService,_e.EVENT_NEW_COLUMNS_LOADED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_DATA_CHANGED,this.workOutVisibility.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_CELL_CHANGED,this.workOutVisibility.bind(this)),this.addManagedPropertyListener("suppressRowDrag",this.onSuppressRowDrag.bind(this)),this.workOutVisibility()}onSuppressRowDrag(){this.workOutVisibility()}workOutVisibility(){const e=this.beans.ctrlsService.getGridBodyCtrl().getRowDragFeature(),t=e&&e.shouldPreventRowMove(),i=this.gridOptionsService.is("suppressRowDrag"),s=this.beans.dragAndDropService.hasExternalDropZones(),o=t&&!s||i;this.setDisplayedOrVisible(o)}}vr([B],Sr.prototype,"postConstruct",null);var Er=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Rr extends Le{init(e,t,i,s,o,r,n){this.params=n,this.eGui=t,this.eCheckbox=i,this.eExpanded=s,this.eContracted=o,this.comp=e,this.compClass=r;const{node:l,value:a,colDef:d}=n;if(!this.isTopLevelFooter()){if(this.isEmbeddedRowMismatch())return;const e=!0===(null==d?void 0:d.showRowGroup),t=null==a&&!l.master;if(!e&&t)return;if(l.footer&&this.gridOptionsService.is("groupHideOpenParents")){if((d&&d.showRowGroup)!==(l.rowGroupColumn&&l.rowGroupColumn.getColId()))return}}this.setupShowingValueForOpenedParent(),this.findDisplayedGroupNode(),this.addFullWidthRowDraggerIfNeeded(),this.addExpandAndContract(),this.addCheckboxIfNeeded(),this.addValueElement(),this.setupIndent(),this.refreshAriaExpanded()}destroy(){super.destroy(),this.expandListener=null}refreshAriaExpanded(){const{node:e,eParentOfValue:t}=this.params;if(this.expandListener&&(this.expandListener=this.expandListener()),!this.isExpandable())return void xt(t);const i=()=>{Gt(t,!!e.expanded)};this.expandListener=this.addManagedListener(e,ar.EVENT_EXPANDED_CHANGED,i)||null,i()}isTopLevelFooter(){if(!this.gridOptionsService.is("groupIncludeTotalFooter"))return!1;if(null!=this.params.value||-1!=this.params.node.level)return!1;const e=this.params.colDef;if(null==e)return!0;if(!0===e.showRowGroup)return!0;const t=this.columnModel.getRowGroupColumns();if(!t||0===t.length)return!0;return t[0].getId()===e.showRowGroup}isEmbeddedRowMismatch(){if(!this.params.fullWidth||!this.gridOptionsService.is("embedFullWidthRows"))return!1;const e="left"===this.params.pinned,t="right"===this.params.pinned,i=!e&&!t;return this.gridOptionsService.is("enableRtl")?this.columnModel.isPinningLeft()?!t:!i:this.columnModel.isPinningLeft()?!e:!i}findDisplayedGroupNode(){const e=this.params.column,t=this.params.node;if(this.showingValueForOpenedParent){let i=t.parent;for(;null!=i;){if(i.rowGroupColumn&&e.isRowGroupDisplayed(i.rowGroupColumn.getId())){this.displayedGroupNode=i;break}i=i.parent}}i(this.displayedGroupNode)&&(this.displayedGroupNode=t)}setupShowingValueForOpenedParent(){const e=this.params.node,t=this.params.column;if(!this.gridOptionsService.is("groupHideOpenParents"))return void(this.showingValueForOpenedParent=!1);if(!e.groupData)return void(this.showingValueForOpenedParent=!1);if(null!=e.rowGroupColumn){const i=e.rowGroupColumn.getId();if(t.isRowGroupDisplayed(i))return void(this.showingValueForOpenedParent=!1)}const i=null!=e.groupData[t.getId()];this.showingValueForOpenedParent=i}addValueElement(){this.displayedGroupNode.footer?this.addFooterValue():(this.addGroupValue(),this.addChildCount())}addGroupValue(){const e=this.adjustParamsWithDetailsFromRelatedColumn(),t=this.getInnerCompDetails(e),{valueFormatted:i,value:s}=e;let o=i;if(null==o)if(""===s&&this.params.node.group){o=this.localeService.getLocaleTextFunc()("blanks","(Blanks)")}else o=null!=s?s:null;this.comp.setInnerRenderer(t,o)}adjustParamsWithDetailsFromRelatedColumn(){const e=this.displayedGroupNode.rowGroupColumn,t=this.params.column;if(!e)return this.params;if(null!=t){if(!t.isRowGroupDisplayed(e.getId()))return this.params}const i=this.params,{value:s,node:o}=this.params,r=this.valueFormatterService.formatValue(e,o,s);return Object.assign(Object.assign({},i),{valueFormatted:r})}addFooterValue(){const e=this.params.footerValueGetter;let t="";if(e){const i=c(this.params);i.value=this.params.value,"function"==typeof e?t=e(i):"string"==typeof e?t=this.expressionService.evaluate(e,i):console.warn("AG Grid: footerValueGetter should be either a function or a string (expression)")}else t="Total "+(null!=this.params.value?this.params.value:"");const i=this.getInnerCompDetails(this.params);this.comp.setInnerRenderer(i,t)}getInnerCompDetails(e){if(e.fullWidth)return this.userComponentFactory.getFullWidthGroupRowInnerCellRenderer(this.gridOptionsService.get("groupRowRendererParams"),e);const t=this.userComponentFactory.getInnerRendererDetails(e,e),i=e=>e&&e.componentClass==this.compClass;if(t&&!i(t))return t;const s=this.displayedGroupNode.rowGroupColumn,o=s?s.getColDef():void 0;if(!o)return;const r=this.userComponentFactory.getCellRendererDetails(o,e);if(r&&!i(r))return r;if(i(r)&&o.cellRendererParams&&o.cellRendererParams.innerRenderer){return this.userComponentFactory.getInnerRendererDetails(o.cellRendererParams,e)}}addChildCount(){this.params.suppressCount||(this.addManagedListener(this.displayedGroupNode,ar.EVENT_ALL_CHILDREN_COUNT_CHANGED,this.updateChildCount.bind(this)),this.updateChildCount())}updateChildCount(){const e=this.displayedGroupNode.allChildrenCount,t=this.isShowRowGroupForThisRow()&&null!=e&&e>=0?`(${e})`:"";this.comp.setChildCount(t)}isShowRowGroupForThisRow(){if(this.gridOptionsService.is("treeData"))return!0;const e=this.displayedGroupNode.rowGroupColumn;if(!e)return!1;const t=this.params.column;return null==t||t.isRowGroupDisplayed(e.getId())}addExpandAndContract(){var e;const t=this.params,i=fs("groupExpanded",this.gridOptionsService,null),s=fs("groupContracted",this.gridOptionsService,null);i&&this.eExpanded.appendChild(i),s&&this.eContracted.appendChild(s);const o=t.eGridCell;(null===(e=this.params.column)||void 0===e?void 0:e.isCellEditable(t.node))&&this.gridOptionsService.is("enableGroupEdit")||!this.isExpandable()||t.suppressDoubleClickExpand||this.addManagedListener(o,"dblclick",this.onCellDblClicked.bind(this)),this.addManagedListener(this.eExpanded,"click",this.onExpandClicked.bind(this)),this.addManagedListener(this.eContracted,"click",this.onExpandClicked.bind(this)),this.addManagedListener(o,"keydown",this.onKeyDown.bind(this)),this.addManagedListener(t.node,ar.EVENT_EXPANDED_CHANGED,this.showExpandAndContractIcons.bind(this)),this.showExpandAndContractIcons();const r=this.onRowNodeIsExpandableChanged.bind(this);this.addManagedListener(this.displayedGroupNode,ar.EVENT_ALL_CHILDREN_COUNT_CHANGED,r),this.addManagedListener(this.displayedGroupNode,ar.EVENT_MASTER_CHANGED,r),this.addManagedListener(this.displayedGroupNode,ar.EVENT_GROUP_CHANGED,r),this.addManagedListener(this.displayedGroupNode,ar.EVENT_HAS_CHILDREN_CHANGED,r)}onExpandClicked(e){Ee(e)||(Se(e),this.onExpandOrContract(e))}onExpandOrContract(e){const t=this.displayedGroupNode,i=!t.expanded;!i&&t.sticky&&this.scrollToStickyNode(t),t.setExpanded(i,e)}scrollToStickyNode(e){this.ctrlsService.getGridBodyCtrl().getScrollFeature().setVerticalScrollPosition(e.rowTop-e.stickyRowTop)}isExpandable(){if(this.showingValueForOpenedParent)return!0;const e=this.displayedGroupNode,t=this.columnModel.isPivotMode()&&e.leafGroup;if(!(e.isExpandable()&&!e.footer&&!t))return!1;const i=this.params.column;if(null!=i&&"string"==typeof i.getColDef().showRowGroup){return this.isShowRowGroupForThisRow()}return!0}showExpandAndContractIcons(){const{params:e,displayedGroupNode:t,columnModel:i}=this,{node:s}=e,o=this.isExpandable();if(o){const e=!!this.showingValueForOpenedParent||s.expanded;this.comp.setExpandedDisplayed(e),this.comp.setContractedDisplayed(!e)}else this.comp.setExpandedDisplayed(!1),this.comp.setContractedDisplayed(!1);const r=i.isPivotMode(),n=r&&t.leafGroup,l=o&&!n,a=s.footer&&-1===s.level;this.comp.addOrRemoveCssClass("ag-cell-expandable",l),this.comp.addOrRemoveCssClass("ag-row-group",l),r?this.comp.addOrRemoveCssClass("ag-pivot-leaf-group",n):a||this.comp.addOrRemoveCssClass("ag-row-group-leaf-indent",!l)}onRowNodeIsExpandableChanged(){this.showExpandAndContractIcons(),this.setIndent(),this.refreshAriaExpanded()}setupIndent(){const e=this.params.node;this.params.suppressPadding||(this.addManagedListener(e,ar.EVENT_UI_LEVEL_CHANGED,this.setIndent.bind(this)),this.setIndent())}setIndent(){if(this.gridOptionsService.is("groupHideOpenParents"))return;const e=this.params,t=e.node,i=!!e.colDef,s=this.gridOptionsService.is("treeData"),o=!i||s||!0===e.colDef.showRowGroup?t.uiLevel:0;this.indentClass&&this.comp.addOrRemoveCssClass(this.indentClass,!1),this.indentClass="ag-row-group-indent-"+o,this.comp.addOrRemoveCssClass(this.indentClass,!0)}addFullWidthRowDraggerIfNeeded(){if(!this.params.fullWidth||!this.params.rowDrag)return;const e=new fr(()=>this.params.value,this.params.node);this.createManagedBean(e,this.context),this.eGui.insertAdjacentElement("afterbegin",e.getGui())}isUserWantsSelected(){const e=this.params.checkbox;return"function"==typeof e||!0===e}addCheckboxIfNeeded(){const e=this.displayedGroupNode,t=this.isUserWantsSelected()&&!e.footer&&!e.rowPinned&&!e.detail;if(t){const e=new hr;this.getContext().createBean(e),e.init({rowNode:this.params.node,column:this.params.column,overrides:{isVisible:this.params.checkbox,callbackParams:this.params,removeHidden:!0}}),this.eCheckbox.appendChild(e.getGui()),this.addDestroyFunc(()=>this.getContext().destroyBean(e))}this.comp.setCheckboxVisible(t)}onKeyDown(e){if(!(e.key===ys.ENTER)||this.params.suppressEnterExpand)return;this.params.column&&this.params.column.isCellEditable(this.params.node)||this.onExpandOrContract(e)}onCellDblClicked(e){if(Ee(e))return;be(this.eExpanded,e)||be(this.eContracted,e)||this.onExpandOrContract(e)}}Er([j("expressionService")],Rr.prototype,"expressionService",void 0),Er([j("valueFormatterService")],Rr.prototype,"valueFormatterService",void 0),Er([j("columnModel")],Rr.prototype,"columnModel",void 0),Er([j("userComponentFactory")],Rr.prototype,"userComponentFactory",void 0),Er([j("ctrlsService")],Rr.prototype,"ctrlsService",void 0);var Tr=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class br extends js{constructor(){super(br.TEMPLATE)}init(e){const t={setInnerRenderer:(e,t)=>this.setRenderDetails(e,t),setChildCount:e=>this.eChildCount.innerHTML=e,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setContractedDisplayed:e=>Mi(this.eContracted,e),setExpandedDisplayed:e=>Mi(this.eExpanded,e),setCheckboxVisible:e=>this.eCheckbox.classList.toggle("ag-invisible",!e)},i=this.createManagedBean(new Rr),s=!e.colDef,o=this.getGui();i.init(t,o,this.eCheckbox,this.eExpanded,this.eContracted,this.constructor,e),s&&Et(o,"gridcell")}setRenderDetails(e,t){if(e){const t=e.newAgStackInstance();if(!t)return;t.then(e=>{if(!e)return;const t=()=>this.context.destroyBean(e);this.isAlive()?(this.eValue.appendChild(e.getGui()),this.addDestroyFunc(t)):t()})}else this.eValue.innerText=t}destroy(){this.getContext().destroyBean(this.innerCellRenderer),super.destroy()}refresh(){return!1}}br.TEMPLATE='<span class="ag-cell-wrapper">\n            <span class="ag-group-expanded" ref="eExpanded"></span>\n            <span class="ag-group-contracted" ref="eContracted"></span>\n            <span class="ag-group-checkbox ag-invisible" ref="eCheckbox"></span>\n            <span class="ag-group-value" ref="eValue"></span>\n            <span class="ag-group-child-count" ref="eChildCount"></span>\n        </span>',Tr([Ks("eExpanded")],br.prototype,"eExpanded",void 0),Tr([Ks("eContracted")],br.prototype,"eContracted",void 0),Tr([Ks("eCheckbox")],br.prototype,"eCheckbox",void 0),Tr([Ks("eValue")],br.prototype,"eValue",void 0),Tr([Ks("eChildCount")],br.prototype,"eChildCount",void 0);var Dr=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Or extends js{constructor(){super(Or.TEMPLATE)}init(e){e.node.failedLoad?this.setupFailed():this.setupLoading()}setupFailed(){const e=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=e("loadingError","ERR")}setupLoading(){const e=fs("groupLoading",this.gridOptionsService,null);e&&this.eLoadingIcon.appendChild(e);const t=this.localeService.getLocaleTextFunc();this.eLoadingText.innerText=t("loadingOoo","Loading")}refresh(e){return!1}destroy(){super.destroy()}}Or.TEMPLATE='<div class="ag-loading">\n            <span class="ag-loading-icon" ref="eLoadingIcon"></span>\n            <span class="ag-loading-text" ref="eLoadingText"></span>\n        </div>',Dr([Ks("eLoadingIcon")],Or.prototype,"eLoadingIcon",void 0),Dr([Ks("eLoadingText")],Or.prototype,"eLoadingText",void 0);class Pr extends js{constructor(){super()}destroy(){super.destroy()}init(e){var t;const i=null!==(t=this.gridOptionsService.get("overlayLoadingTemplate"))&&void 0!==t?t:Pr.DEFAULT_LOADING_OVERLAY_TEMPLATE,s=this.localeService.getLocaleTextFunc(),o=i.replace("[LOADING...]",s("loadingOoo","Loading..."));this.setTemplate(o)}}Pr.DEFAULT_LOADING_OVERLAY_TEMPLATE='<span class="ag-overlay-loading-center">[LOADING...]</span>';class Ar extends js{constructor(){super()}destroy(){super.destroy()}init(e){var t;const i=null!==(t=this.gridOptionsService.get("overlayNoRowsTemplate"))&&void 0!==t?t:Ar.DEFAULT_NO_ROWS_TEMPLATE,s=this.localeService.getLocaleTextFunc(),o=i.replace("[NO_ROWS_TO_SHOW]",s("noRowsToShow","No Rows To Show"));this.setTemplate(o)}}Ar.DEFAULT_NO_ROWS_TEMPLATE='<span class="ag-overlay-no-rows-center">[NO_ROWS_TO_SHOW]</span>';class Fr extends qo{constructor(){super('<div class="ag-tooltip"></div>')}init(e){const{value:t}=e;this.getGui().innerHTML=je(t)}}class Lr{getTemplate(){return'<ag-input-number-field class="ag-cell-editor" ref="eInput"></ag-input-number-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.max&&e.setMax(t.max),null!=t.min&&e.setMin(t.min),null!=t.precision&&e.setPrecision(t.precision),null!=t.step&&e.setStep(t.step),t.showStepperButtons&&e.getInputElement().classList.add("ag-number-field-input-stepper")}getValue(){const e=this.eInput.getValue();if(!t(e)&&!t(this.params.value))return this.params.value;let i=this.params.parseValue(e);if(null==i)return i;if("string"==typeof i){if(""===i)return null;i=Number(i)}return isNaN(i)?null:i}getStartValue(){return this.params.value}}class Ir extends tr{constructor(){super(new Lr)}}class Nr{getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.eInput.getDate();return t(e)||t(this.params.value)?null!=e?e:null:this.params.value}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return bi(e,!1)}}class Mr extends tr{constructor(){super(new Nr)}}var Gr=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class xr{constructor(e){this.getDataTypeService=e}getTemplate(){return'<ag-input-date-field class="ag-cell-editor" ref="eInput"></ag-input-date-field>'}init(e,t){this.eInput=e,this.params=t,null!=t.min&&e.setMin(t.min),null!=t.max&&e.setMax(t.max),null!=t.step&&e.setStep(t.step)}getValue(){const e=this.formatDate(this.eInput.getDate());return t(e)||t(this.params.value)?this.params.parseValue(null!=e?e:""):this.params.value}getStartValue(){var e,t;return bi(null!==(t=this.parseDate(null!==(e=this.params.value)&&void 0!==e?e:void 0))&&void 0!==t?t:null,!1)}parseDate(e){return this.getDataTypeService().getDateParserFunction()(e)}formatDate(e){return this.getDataTypeService().getDateFormatterFunction()(e)}}class _r extends tr{constructor(){super(new xr(()=>this.dataTypeService))}}Gr([j("dataTypeService")],_r.prototype,"dataTypeService",void 0);var Vr=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Hr extends js{constructor(){super(Hr.TEMPLATE)}init(e){this.params=e,this.updateCheckbox(e),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.addManagedListener(this.eCheckbox.getInputElement(),"click",e=>{if(Se(e),this.eCheckbox.isDisabled())return;const t=this.eCheckbox.getValue();this.onCheckboxChanged(t)}),this.addManagedListener(this.eCheckbox.getInputElement(),"dblclick",e=>{Se(e)});const t=this.gridOptionsService.getDocument();this.addManagedListener(this.params.eGridCell,"keydown",e=>{if(e.key===ys.SPACE&&!this.eCheckbox.isDisabled()){this.params.eGridCell===t.activeElement&&this.eCheckbox.toggle();const i=this.eCheckbox.getValue();this.onCheckboxChanged(i),e.preventDefault()}})}refresh(e){return this.params=e,this.updateCheckbox(e),!0}updateCheckbox(e){var t,i,s;let o,r=!0;if(e.node.group&&e.column){const i=e.column.getColId();i.startsWith("ag-Grid-AutoColumn")?o=null==e.value||""===e.value?void 0:"true"===e.value:e.node.aggData&&void 0!==e.node.aggData[i]?o=null!==(t=e.value)&&void 0!==t?t:void 0:r=!1}else o=null!==(i=e.value)&&void 0!==i?i:void 0;if(!r)return void this.eCheckbox.setDisplayed(!1);this.eCheckbox.setValue(o);const n=null!=e.disabled?e.disabled:!(null===(s=e.column)||void 0===s?void 0:s.isCellEditable(e.node));this.eCheckbox.setDisabled(n);const l=this.localeService.getLocaleTextFunc(),a=Qt(l,o),d=n?a:`${l("ariaToggleCellValue","Press SPACE to toggle cell value")} (${a})`;this.eCheckbox.setInputAriaLabel(d)}onCheckboxChanged(e){const{column:t,node:i,rowIndex:s,value:o}=this.params,r={type:_e.EVENT_CELL_EDITING_STARTED,column:t,colDef:null==t?void 0:t.getColDef(),data:i.data,node:i,rowIndex:s,rowPinned:i.rowPinned,value:o};this.eventService.dispatchEvent(r);const n=this.params.node.setDataValue(this.params.column,e,"edit"),l={type:_e.EVENT_CELL_EDITING_STOPPED,column:t,colDef:null==t?void 0:t.getColDef(),data:i.data,node:i,rowIndex:s,rowPinned:i.rowPinned,value:o,oldValue:o,newValue:e,valueChanged:n};this.eventService.dispatchEvent(l)}}Hr.TEMPLATE='\n        <div class="ag-cell-wrapper ag-checkbox-cell" role="presentation">\n            <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n        </div>',Vr([Ks("eCheckbox")],Hr.prototype,"eCheckbox",void 0);var kr=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Br extends qo{constructor(){super('\n            <div class="ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit">\n                <ag-checkbox role="presentation" ref="eCheckbox"></ag-checkbox>\n            </div>')}init(e){var t;this.params=e;const i=null!==(t=e.value)&&void 0!==t?t:void 0;this.eCheckbox.setValue(i),this.eCheckbox.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(i),this.addManagedListener(this.eCheckbox,_e.EVENT_FIELD_VALUE_CHANGED,e=>this.setAriaLabel(e.selected))}getValue(){return this.eCheckbox.getValue()}focusIn(){this.eCheckbox.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.localeService.getLocaleTextFunc(),i=Qt(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eCheckbox.setInputAriaLabel(`${s} (${i})`)}}kr([Ks("eCheckbox")],Br.prototype,"eCheckbox",void 0);var Wr=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Ur=class extends Le{constructor(){super(...arguments),this.agGridDefaults={agDateInput:Po,agColumnHeader:Ko,agColumnGroupHeader:$o,agSortIndicator:jo,agTextColumnFloatingFilter:Bo,agNumberColumnFloatingFilter:ko,agDateColumnFloatingFilter:Do,agReadOnlyFloatingFilter:qs,agAnimateShowChangeCellRenderer:rr,agAnimateSlideCellRenderer:lr,agGroupCellRenderer:br,agGroupRowRenderer:br,agLoadingCellRenderer:Or,agCheckboxCellRenderer:Hr,agCellEditor:sr,agTextCellEditor:sr,agNumberCellEditor:Ir,agDateCellEditor:Mr,agDateStringCellEditor:_r,agSelectCellEditor:Zo,agLargeTextCellEditor:Xo,agCheckboxCellEditor:Br,agTextColumnFilter:Go,agNumberColumnFilter:No,agDateColumnFilter:Ro,agLoadingOverlay:Pr,agNoRowsOverlay:Ar,agTooltipComponent:Fr},this.enterpriseAgDefaultCompsModule={agSetColumnFilter:x.SetFilterModule,agSetColumnFloatingFilter:x.SetFilterModule,agMultiColumnFilter:x.MultiFilterModule,agMultiColumnFloatingFilter:x.MultiFilterModule,agGroupColumnFilter:x.RowGroupingModule,agGroupColumnFloatingFilter:x.RowGroupingModule,agRichSelect:x.RichSelectModule,agRichSelectCellEditor:x.RichSelectModule,agDetailCellRenderer:x.MasterDetailModule,agSparklineCellRenderer:x.SparklinesModule},this.jsComps={}}init(){null!=this.gridOptions.components&&h(this.gridOptions.components,(e,t)=>this.registerJsComponent(e,t))}registerDefaultComponent(e,t){this.agGridDefaults[e]?console.error("Trying to overwrite a default component. You should call registerComponent"):this.agGridDefaults[e]=t}registerJsComponent(e,t){this.jsComps[e]=t}retrieve(e,t){const i=(e,t)=>({componentFromFramework:t,component:e}),s=this.getFrameworkOverrides().frameworkComponent(t,this.gridOptions.components);if(null!=s)return i(s,!0);const o=this.jsComps[t];if(o){return i(o,this.getFrameworkOverrides().isFrameworkComponent(o))}const r=this.agGridDefaults[t];if(r)return i(r,!1);const n=this.enterpriseAgDefaultCompsModule[t];return n?V.__assertRegistered(n,`AG Grid '${e}' component: ${t}`,this.context.getGridId()):T(()=>{this.warnAboutMissingComponent(e,t)},"MissingComp"+t),null}warnAboutMissingComponent(e,t){const i=et(t,[...Object.keys(this.agGridDefaults).filter(e=>!["agCellEditor","agGroupRowRenderer","agSortIndicator"].includes(e)),...Object.keys(this.jsComps)],!0,.8).values;console.warn(`AG Grid: Could not find '${t}' component. It was configured as "${e}: '${t}'" but it wasn't found in the list of registered components.`),i.length>0&&console.warn(`         Did you mean: [${i.slice(0,3)}]?`),console.warn("If using a custom component check it has been registered as described in: https://ag-grid.com/javascript-data-grid/components/")}};Wr([j("gridOptions")],Ur.prototype,"gridOptions",void 0),Wr([B],Ur.prototype,"init",null),Ur=Wr([U("userComponentRegistry")],Ur);const jr={propertyName:"dateComponent",cellRenderer:!1},zr={propertyName:"headerComponent",cellRenderer:!1},Kr={propertyName:"headerGroupComponent",cellRenderer:!1},Yr={propertyName:"cellRenderer",cellRenderer:!0},$r={propertyName:"cellEditor",cellRenderer:!1},qr={propertyName:"innerRenderer",cellRenderer:!0},Qr={propertyName:"loadingOverlayComponent",cellRenderer:!1},Xr={propertyName:"noRowsOverlayComponent",cellRenderer:!1},Jr={propertyName:"tooltipComponent",cellRenderer:!1},Zr={propertyName:"filter",cellRenderer:!1},en={propertyName:"floatingFilterComponent",cellRenderer:!1},tn={propertyName:"toolPanel",cellRenderer:!1},sn={propertyName:"statusPanel",cellRenderer:!1},on={propertyName:"fullWidthCellRenderer",cellRenderer:!0},rn={propertyName:"loadingCellRenderer",cellRenderer:!0},nn={propertyName:"groupRowRenderer",cellRenderer:!0},ln={propertyName:"detailCellRenderer",cellRenderer:!0};class an{static getFloatingFilterType(e){return this.filterToFloatingFilterMapping[e]}}an.filterToFloatingFilterMapping={set:"agSetColumnFloatingFilter",agSetColumnFilter:"agSetColumnFloatingFilter",multi:"agMultiColumnFloatingFilter",agMultiColumnFilter:"agMultiColumnFloatingFilter",group:"agGroupColumnFloatingFilter",agGroupColumnFilter:"agGroupColumnFloatingFilter",number:"agNumberColumnFloatingFilter",agNumberColumnFilter:"agNumberColumnFloatingFilter",date:"agDateColumnFloatingFilter",agDateColumnFilter:"agDateColumnFloatingFilter",text:"agTextColumnFloatingFilter",agTextColumnFilter:"agTextColumnFloatingFilter"};var dn=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let hn=class extends Le{getHeaderCompDetails(e,t){return this.getCompDetails(e,zr,"agColumnHeader",t)}getHeaderGroupCompDetails(e){const t=e.columnGroup.getColGroupDef();return this.getCompDetails(t,Kr,"agColumnGroupHeader",e)}getFullWidthCellRendererDetails(e){return this.getCompDetails(this.gridOptions,on,null,e,!0)}getFullWidthLoadingCellRendererDetails(e){return this.getCompDetails(this.gridOptions,rn,"agLoadingCellRenderer",e,!0)}getFullWidthGroupCellRendererDetails(e){return this.getCompDetails(this.gridOptions,nn,"agGroupRowRenderer",e,!0)}getFullWidthDetailCellRendererDetails(e){return this.getCompDetails(this.gridOptions,ln,"agDetailCellRenderer",e,!0)}getInnerRendererDetails(e,t){return this.getCompDetails(e,qr,null,t)}getFullWidthGroupRowInnerCellRenderer(e,t){return this.getCompDetails(e,qr,null,t)}getCellRendererDetails(e,t){return this.getCompDetails(e,Yr,null,t)}getCellEditorDetails(e,t){return this.getCompDetails(e,$r,"agCellEditor",t,!0)}getFilterDetails(e,t,i){return this.getCompDetails(e,Zr,i,t,!0)}getDateCompDetails(e){return this.getCompDetails(this.gridOptions,jr,"agDateInput",e,!0)}getLoadingOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,Qr,"agLoadingOverlay",e,!0)}getNoRowsOverlayCompDetails(e){return this.getCompDetails(this.gridOptions,Xr,"agNoRowsOverlay",e,!0)}getTooltipCompDetails(e){return this.getCompDetails(e.colDef,Jr,"agTooltipComponent",e,!0)}getSetFilterCellRendererDetails(e,t){return this.getCompDetails(e,Yr,null,t)}getFloatingFilterCompDetails(e,t,i){return this.getCompDetails(e,en,i,t)}getToolPanelCompDetails(e,t){return this.getCompDetails(e,tn,null,t,!0)}getStatusPanelCompDetails(e,t){return this.getCompDetails(e,sn,null,t,!0)}getCompDetails(e,t,i,s,o=!1){const{propertyName:r,cellRenderer:n}=t;let{compName:l,jsComp:a,fwComp:d,paramsFromSelector:h,popupFromSelector:c,popupPositionFromSelector:u}=this.getCompKeys(e,t,s);const p=e=>{const t=this.userComponentRegistry.retrieve(r,e);t&&(a=t.componentFromFramework?void 0:t.component,d=t.componentFromFramework?t.component:void 0)};if(null!=l&&p(l),null==a&&null==d&&null!=i&&p(i),a&&n&&!this.agComponentUtils.doesImplementIComponent(a)&&(a=this.agComponentUtils.adaptFunction(r,a)),!a&&!d)return void(o&&console.error(`AG Grid: Could not find component ${l}, did you forget to configure this component?`));const g=this.mergeParamsWithApplicationProvidedParams(e,t,s,h),m=null==a,C=a||d;return{componentFromFramework:m,componentClass:C,params:g,type:t,popupFromSelector:c,popupPositionFromSelector:u,newAgStackInstance:()=>this.newAgStackInstance(C,m,g,t)}}getCompKeys(e,t,i){const{propertyName:s}=t;let o,r,n,l,a,d;if(e){const t=e,h=t[s+"Selector"],c=h?h(i):null,u=e=>{if("string"==typeof e)o=e;else if(null!=e&&!0!==e){this.getFrameworkOverrides().isFrameworkComponent(e)?n=e:r=e}};c?(u(c.component),l=c.params,a=c.popup,d=c.popupPosition):u(t[s])}return{compName:o,jsComp:r,fwComp:n,paramsFromSelector:l,popupFromSelector:a,popupPositionFromSelector:d}}newAgStackInstance(e,t,i,s){const o=s.propertyName;let r;if(!t)r=new e;else{const t=this.componentMetadataProvider.retrieve(o);r=this.frameworkComponentWrapper.wrap(e,t.mandatoryMethodList,t.optionalMethodList,s)}const n=this.initComponent(r,i);return null==n?Gs.resolve(r):n.then(()=>r)}mergeParamsWithApplicationProvidedParams(e,t,i,s=null){const o={context:this.gridOptionsService.context,columnApi:this.gridOptionsService.columnApi,api:this.gridOptionsService.api};f(o,i);const r=e&&e[t.propertyName+"Params"];if("function"==typeof r){f(o,r(i))}else"object"==typeof r&&f(o,r);return f(o,s),o}initComponent(e,t){if(this.context.createBean(e),null!=e.init)return e.init(t)}getDefaultFloatingFilterType(e,t){if(null==e)return null;let i=null,{compName:s,jsComp:o,fwComp:r}=this.getCompKeys(e,Zr);if(s)i=an.getFloatingFilterType(s);else{null==o&&null==r&&!0===e.filter&&(i=t())}return i}};var cn;dn([j("gridOptions")],hn.prototype,"gridOptions",void 0),dn([j("agComponentUtils")],hn.prototype,"agComponentUtils",void 0),dn([j("componentMetadataProvider")],hn.prototype,"componentMetadataProvider",void 0),dn([j("userComponentRegistry")],hn.prototype,"userComponentRegistry",void 0),dn([z("frameworkComponentWrapper")],hn.prototype,"frameworkComponentWrapper",void 0),hn=dn([U("userComponentFactory")],hn),function(e){e[e.SINGLE_SHEET=0]="SINGLE_SHEET",e[e.MULTI_SHEET=1]="MULTI_SHEET"}(cn||(cn={}));var un=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let pn=class extends Le{constructor(){super(...arguments),this.dragEndFunctions=[],this.dragSources=[]}removeAllListeners(){this.dragSources.forEach(this.removeListener.bind(this)),this.dragSources.length=0}removeListener(e){const t=e.dragSource.eElement,i=e.mouseDownListener;if(t.removeEventListener("mousedown",i),e.touchEnabled){const i=e.touchStartListener;t.removeEventListener("touchstart",i,{passive:!0})}}removeDragSource(e){const t=this.dragSources.find(t=>t.dragSource===e);t&&(this.removeListener(t),he(this.dragSources,t))}isDragging(){return this.dragging}addDragSource(e){const t=this.onMouseDown.bind(this,e),{eElement:i,includeTouch:s,stopPropagationForTouch:o}=e;i.addEventListener("mousedown",t);let r=null;const n=this.gridOptionsService.is("suppressTouch");s&&!n&&(r=t=>{Ni(t.target)||(t.cancelable&&(t.preventDefault(),o&&t.stopPropagation()),this.onTouchStart(e,t))},i.addEventListener("touchstart",r,{passive:!1})),this.dragSources.push({dragSource:e,mouseDownListener:t,touchStartListener:r,touchEnabled:!!s})}getStartTarget(){return this.startTarget}onTouchStart(e,t){this.currentDragParams=e,this.dragging=!1;const i=t.touches[0];this.touchLastTime=i,this.touchStart=i;const s=t=>this.onTouchUp(t,e.eElement),o=t.target,r=[{target:this.gridOptionsService.getRootNode(),type:"touchmove",listener:e=>{e.cancelable&&e.preventDefault()},options:{passive:!1}},{target:o,type:"touchmove",listener:t=>this.onTouchMove(t,e.eElement),options:{passive:!0}},{target:o,type:"touchend",listener:s,options:{passive:!0}},{target:o,type:"touchcancel",listener:s,options:{passive:!0}}];this.addTemporaryEvents(r),0===e.dragStartPixels&&this.onCommonMove(i,this.touchStart,e.eElement)}onMouseDown(e,t){const i=t;if(e.skipMouseEvent&&e.skipMouseEvent(t))return;if(i._alreadyProcessedByDragService)return;if(i._alreadyProcessedByDragService=!0,0!==t.button)return;this.shouldPreventMouseEvent(t)&&t.preventDefault(),this.currentDragParams=e,this.dragging=!1,this.mouseStartEvent=t,this.startTarget=t.target;const s=this.gridOptionsService.getRootNode(),o=[{target:s,type:"mousemove",listener:t=>this.onMouseMove(t,e.eElement)},{target:s,type:"mouseup",listener:t=>this.onMouseUp(t,e.eElement)},{target:s,type:"contextmenu",listener:e=>e.preventDefault()}];this.addTemporaryEvents(o),0===e.dragStartPixels&&this.onMouseMove(t,e.eElement)}addTemporaryEvents(e){e.forEach(e=>{const{target:t,type:i,listener:s,options:o}=e;t.addEventListener(i,s,o)}),this.dragEndFunctions.push(()=>{e.forEach(e=>{const{target:t,type:i,listener:s,options:o}=e;t.removeEventListener(i,s,o)})})}isEventNearStartEvent(e,i){const{dragStartPixels:s}=this.currentDragParams;return Os(e,i,t(s)?s:4)}getFirstActiveTouch(e){for(let t=0;t<e.length;t++)if(e[t].identifier===this.touchStart.identifier)return e[t];return null}onCommonMove(e,t,i){if(!this.dragging){if(!this.dragging&&this.isEventNearStartEvent(e,t))return;this.dragging=!0;const s={type:_e.EVENT_DRAG_STARTED,target:i};this.eventService.dispatchEvent(s),this.currentDragParams.onDragStart(t),this.currentDragParams.onDragging(t)}this.currentDragParams.onDragging(e)}onTouchMove(e,t){const i=this.getFirstActiveTouch(e.touches);i&&this.onCommonMove(i,this.touchStart,t)}onMouseMove(e,t){this.shouldPreventMouseEvent(e)&&e.preventDefault(),this.onCommonMove(e,this.mouseStartEvent,t)}shouldPreventMouseEvent(e){const t=this.gridOptionsService.is("enableCellTextSelection"),i=ni(),s="mousemove"===e.type;return(t&&s||i)&&e.cancelable&&this.mouseEventService.isEventFromThisGrid(e)&&!this.isOverFormFieldElement(e)}isOverFormFieldElement(e){const t=e.target,i=null==t?void 0:t.tagName.toLocaleLowerCase();return!!(null==i?void 0:i.match("^a$|textarea|input|select|button"))}onTouchUp(e,t){let i=this.getFirstActiveTouch(e.changedTouches);i||(i=this.touchLastTime),this.onUpCommon(i,t)}onMouseUp(e,t){this.onUpCommon(e,t)}onUpCommon(e,t){if(this.dragging){this.dragging=!1,this.currentDragParams.onDragStop(e);const i={type:_e.EVENT_DRAG_STOPPED,target:t};this.eventService.dispatchEvent(i)}this.mouseStartEvent=null,this.startTarget=null,this.touchStart=null,this.touchLastTime=null,this.currentDragParams=null,this.dragEndFunctions.forEach(e=>e()),this.dragEndFunctions.length=0}};un([j("mouseEventService")],pn.prototype,"mouseEventService",void 0),un([W],pn.prototype,"removeAllListeners",null),pn=un([U("dragService")],pn);class gn{constructor(e){this.tickingInterval=null,this.onScrollCallback=null,this.scrollContainer=e.scrollContainer,this.scrollHorizontally=-1!==e.scrollAxis.indexOf("x"),this.scrollVertically=-1!==e.scrollAxis.indexOf("y"),this.scrollByTick=null!=e.scrollByTick?e.scrollByTick:20,e.onScrollCallback&&(this.onScrollCallback=e.onScrollCallback),this.scrollVertically&&(this.getVerticalPosition=e.getVerticalPosition,this.setVerticalPosition=e.setVerticalPosition),this.scrollHorizontally&&(this.getHorizontalPosition=e.getHorizontalPosition,this.setHorizontalPosition=e.setHorizontalPosition),this.shouldSkipVerticalScroll=e.shouldSkipVerticalScroll||(()=>!1),this.shouldSkipHorizontalScroll=e.shouldSkipHorizontalScroll||(()=>!1)}check(e,t=!1){const i=t||this.shouldSkipVerticalScroll();if(i&&this.shouldSkipHorizontalScroll())return;const s=this.scrollContainer.getBoundingClientRect(),o=this.scrollByTick;this.tickLeft=e.clientX<s.left+o,this.tickRight=e.clientX>s.right-o,this.tickUp=e.clientY<s.top+o&&!i,this.tickDown=e.clientY>s.bottom-o&&!i,this.tickLeft||this.tickRight||this.tickUp||this.tickDown?this.ensureTickingStarted():this.ensureCleared()}ensureTickingStarted(){null===this.tickingInterval&&(this.tickingInterval=window.setInterval(this.doTick.bind(this),100),this.tickCount=0)}doTick(){let e;if(this.tickCount++,e=this.tickCount>20?200:this.tickCount>10?80:40,this.scrollVertically){const t=this.getVerticalPosition();this.tickUp&&this.setVerticalPosition(t-e),this.tickDown&&this.setVerticalPosition(t+e)}if(this.scrollHorizontally){const t=this.getHorizontalPosition();this.tickLeft&&this.setHorizontalPosition(t-e),this.tickRight&&this.setHorizontalPosition(t+e)}this.onScrollCallback&&this.onScrollCallback()}ensureCleared(){this.tickingInterval&&(window.clearInterval(this.tickingInterval),this.tickingInterval=null)}}var mn=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const Cn="ag-list-item-hovered";class vn extends Le{constructor(e,t,i){super(),this.comp=e,this.virtualList=t,this.params=i,this.currentDragValue=null,this.lastHoveredListItem=null}postConstruct(){this.addManagedListener(this.params.eventSource,this.params.listItemDragStartEvent,this.listItemDragStart.bind(this)),this.addManagedListener(this.params.eventSource,this.params.listItemDragEndEvent,this.listItemDragEnd.bind(this)),this.createDropTarget(),this.createAutoScrollService()}listItemDragStart(e){this.currentDragValue=this.params.getCurrentDragValue(e),this.moveBlocked=this.params.isMoveBlocked(this.currentDragValue)}listItemDragEnd(){window.setTimeout(()=>{this.currentDragValue=null,this.moveBlocked=!1},10)}createDropTarget(){const e={isInterestedIn:e=>e===this.params.dragSourceType,getIconName:()=>Cr[this.moveBlocked?"ICON_NOT_ALLOWED":"ICON_MOVE"],getContainer:()=>this.comp.getGui(),onDragging:e=>this.onDragging(e),onDragStop:()=>this.onDragStop(),onDragLeave:()=>this.onDragLeave()};this.dragAndDropService.addDropTarget(e)}createAutoScrollService(){const e=this.virtualList.getGui();this.autoScrollService=new gn({scrollContainer:e,scrollAxis:"y",getVerticalPosition:()=>e.scrollTop,setVerticalPosition:t=>e.scrollTop=t})}onDragging(e){if(!this.currentDragValue||this.moveBlocked)return;const t=this.getListDragItem(e),i=this.virtualList.getComponentAt(t.rowIndex);if(!i)return;const s=i.getGui().parentElement;this.lastHoveredListItem&&this.lastHoveredListItem.rowIndex===t.rowIndex&&this.lastHoveredListItem.position===t.position||(this.autoScrollService.check(e.event),this.clearHoveredItems(),this.lastHoveredListItem=t,Li(s,Cn),Li(s,"ag-item-highlight-"+t.position))}getListDragItem(e){const t=this.virtualList.getGui(),i=parseFloat(window.getComputedStyle(t).paddingTop),s=this.virtualList.getRowHeight(),o=this.virtualList.getScrollTop(),r=Math.max(0,(e.y-i+o)/s),n=this.params.getNumRows(this.comp)-1,l=0|Math.min(n,r);return{rowIndex:l,position:Math.round(r)>r||r>n?"bottom":"top",component:this.virtualList.getComponentAt(l)}}onDragStop(){this.moveBlocked||(this.params.moveItem(this.currentDragValue,this.lastHoveredListItem),this.clearHoveredItems(),this.autoScrollService.ensureCleared())}onDragLeave(){this.clearHoveredItems(),this.autoScrollService.ensureCleared()}clearHoveredItems(){this.virtualList.getGui().querySelectorAll("."+Cn).forEach(e=>{[Cn,"ag-item-highlight-top","ag-item-highlight-bottom"].forEach(t=>{e.classList.remove(t)})}),this.lastHoveredListItem=null}}var fn,wn;mn([j("dragAndDropService")],vn.prototype,"dragAndDropService",void 0),mn([B],vn.prototype,"postConstruct",null),function(e){e[e.Above=0]="Above",e[e.Below=1]="Below"}(fn||(fn={})),function(e){e.EVERYTHING="group",e.FILTER="filter",e.SORT="sort",e.MAP="map",e.AGGREGATE="aggregate",e.FILTER_AGGREGATES="filter_aggregates",e.PIVOT="pivot",e.NOTHING="nothing"}(wn||(wn={}));var yn=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};function Sn(e){const t=e;return null!=t&&null!=t.getFrameworkComponentInstance?t.getFrameworkComponentInstance():e}let En=class{constructor(){this.detailGridInfoMap={},this.destroyCalled=!1}registerOverlayWrapperComp(e){this.overlayWrapperComp=e}registerSideBarComp(e){this.sideBarComp=e}init(){switch(this.rowModel.getType()){case"clientSide":this.clientSideRowModel=this.rowModel;break;case"infinite":this.infiniteRowModel=this.rowModel;break;case"serverSide":this.serverSideRowModel=this.rowModel}this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl()})}__getAlignedGridService(){return this.alignedGridsService}__getContext(){return this.context}getSetterMethod(e){return`set${e.charAt(0).toUpperCase()}${e.substring(1)}`}__setPropertyOnly(e,t){return this.gos.__setPropertyOnly(e,t)}__updateProperty(e,t,i,s){this.gos.set(e,t,i,{},s);const o=this.getSetterMethod(e),r=this;r[o]&&r[o](t)}getGridId(){return this.context.getGridId()}addDetailGridInfo(e,t){this.detailGridInfoMap[e]=t}removeDetailGridInfo(e){this.detailGridInfoMap[e]=void 0}getDetailGridInfo(e){return this.detailGridInfoMap[e]}forEachDetailGridInfo(e){let i=0;h(this.detailGridInfoMap,(s,o)=>{t(o)&&(e(o,i),i++)})}getDataAsCsv(e){if(V.__assertRegistered(x.CsvExportModule,"api.getDataAsCsv",this.context.getGridId()))return this.csvCreator.getDataAsCsv(e)}exportDataAsCsv(e){V.__assertRegistered(x.CsvExportModule,"api.exportDataAsCSv",this.context.getGridId())&&this.csvCreator.exportDataAsCsv(e)}getExcelExportMode(e){const t=this.gos.get("defaultExcelExportParams");return Object.assign({exportMode:"xlsx"},t,e).exportMode}assertNotExcelMultiSheet(e,t){if(!V.__assertRegistered(x.ExcelExportModule,"api."+e,this.context.getGridId()))return!1;const i=this.getExcelExportMode(t);return this.excelCreator.getFactoryMode(i)!==cn.MULTI_SHEET||(console.warn("AG Grid: The Excel Exporter is currently on Multi Sheet mode. End that operation by calling 'api.getMultipleSheetAsExcel()' or 'api.exportMultipleSheetsAsExcel()'"),!1)}getDataAsExcel(e){if(this.assertNotExcelMultiSheet("getDataAsExcel",e))return this.excelCreator.getDataAsExcel(e)}exportDataAsExcel(e){this.assertNotExcelMultiSheet("exportDataAsExcel",e)&&this.excelCreator.exportDataAsExcel(e)}getSheetDataForExcel(e){if(!V.__assertRegistered(x.ExcelExportModule,"api.getSheetDataForExcel",this.context.getGridId()))return;const t=this.getExcelExportMode(e);return this.excelCreator.setFactoryMode(cn.MULTI_SHEET,t),this.excelCreator.getSheetDataForExcel(e)}getMultipleSheetsAsExcel(e){if(V.__assertRegistered(x.ExcelExportModule,"api.getMultipleSheetsAsExcel",this.context.getGridId()))return this.excelCreator.getMultipleSheetsAsExcel(e)}exportMultipleSheetsAsExcel(e){if(V.__assertRegistered(x.ExcelExportModule,"api.exportMultipleSheetsAsExcel",this.context.getGridId()))return this.excelCreator.exportMultipleSheetsAsExcel(e)}setTreeData(e){this.gos.set("treeData",e)}setGridAriaProperty(e,t){if(!e)return;const i=this.ctrlsService.getGridBodyCtrl().getGui(),s="aria-"+e;null===t?i.removeAttribute(s):i.setAttribute(s,t)}logMissingRowModel(e,...t){console.error(`AG Grid: api.${e} can only be called when gridOptions.rowModelType is ${t.join(" or ")}`)}setServerSideDatasource(e){this.serverSideRowModel?this.serverSideRowModel.setDatasource(e):this.logMissingRowModel("setServerSideDatasource","serverSide")}setCacheBlockSize(e){this.serverSideRowModel?(this.gos.set("cacheBlockSize",e),this.serverSideRowModel.resetRootStore()):this.logMissingRowModel("setCacheBlockSize","serverSide")}setDatasource(e){this.gos.isRowModelType("infinite")?this.rowModel.setDatasource(e):this.logMissingRowModel("setDatasource","infinite")}setViewportDatasource(e){this.gos.isRowModelType("viewport")?this.rowModel.setViewportDatasource(e):this.logMissingRowModel("setViewportDatasource","viewport")}setRowData(e){null==this.immutableService?this.logMissingRowModel("setRowData","clientSide"):this.immutableService.isActive()?this.immutableService.setRowData(e):(this.selectionService.reset(),this.clientSideRowModel.setRowData(e))}setPinnedTopRowData(e){this.pinnedRowModel.setPinnedTopRowData(e)}setPinnedBottomRowData(e){this.pinnedRowModel.setPinnedBottomRowData(e)}getPinnedTopRowCount(){return this.pinnedRowModel.getPinnedTopRowCount()}getPinnedBottomRowCount(){return this.pinnedRowModel.getPinnedBottomRowCount()}getPinnedTopRow(e){return this.pinnedRowModel.getPinnedTopRow(e)}getPinnedBottomRow(e){return this.pinnedRowModel.getPinnedBottomRow(e)}setColumnDefs(e,t="api"){this.columnModel.setColumnDefs(e,t),this.gos.set("columnDefs",e,!0,{source:t})}setAutoGroupColumnDef(e,t="api"){this.gos.set("autoGroupColumnDef",e,!0,{source:t})}setDefaultColDef(e,t="api"){this.gos.set("defaultColDef",e,!0,{source:t})}setColumnTypes(e,t="api"){this.gos.set("columnTypes",e,!0,{source:t})}expireValueCache(){this.valueCache.expire()}getVerticalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getVScrollPosition()}getHorizontalPixelRange(){return this.gridBodyCtrl.getScrollFeature().getHScrollPosition()}setAlwaysShowHorizontalScroll(e){this.gos.set("alwaysShowHorizontalScroll",e)}setAlwaysShowVerticalScroll(e){this.gos.set("alwaysShowVerticalScroll",e)}refreshCells(e={}){this.rowRenderer.refreshCells(e)}flashCells(e={}){this.rowRenderer.flashCells(e)}redrawRows(e={}){const t=e?e.rowNodes:void 0;this.rowRenderer.redrawRows(t)}setFunctionsReadOnly(e){this.gos.set("functionsReadOnly",e)}refreshHeader(){this.ctrlsService.getHeaderRowContainerCtrls().forEach(e=>e.refresh())}isAnyFilterPresent(){return this.filterManager.isAnyFilterPresent()}isColumnFilterPresent(){return this.filterManager.isColumnFilterPresent()||this.filterManager.isAggregateFilterPresent()}isQuickFilterPresent(){return this.filterManager.isQuickFilterPresent()}getModel(){return this.rowModel}setRowNodeExpanded(e,t,i){e&&(i&&e.parent&&-1!==e.parent.level&&this.setRowNodeExpanded(e.parent,t,i),e.setExpanded(t))}onGroupExpandedOrCollapsed(){i(this.clientSideRowModel)?this.logMissingRowModel("onGroupExpandedOrCollapsed","clientSide"):this.clientSideRowModel.refreshModel({step:wn.MAP})}refreshClientSideRowModel(e){i(this.clientSideRowModel)?this.logMissingRowModel("refreshClientSideRowModel","clientSide"):this.clientSideRowModel.refreshModel(e)}isAnimationFrameQueueEmpty(){return this.animationFrameService.isQueueEmpty()}flushAllAnimationFrames(){this.animationFrameService.flushAllFrames()}getRowNode(e){return this.rowModel.getRowNode(e)}getSizesForCurrentTheme(){return{rowHeight:this.gos.getRowHeightAsNumber(),headerHeight:this.columnModel.getHeaderHeight()}}expandAll(){this.clientSideRowModel?this.clientSideRowModel.expandOrCollapseAll(!0):this.serverSideRowModel?this.serverSideRowModel.expandAll(!0):this.logMissingRowModel("expandAll","clientSide","serverSide")}collapseAll(){this.clientSideRowModel?this.clientSideRowModel.expandOrCollapseAll(!1):this.serverSideRowModel?this.serverSideRowModel.expandAll(!1):this.logMissingRowModel("expandAll","clientSide","serverSide")}addRenderedRowListener(e,t,i){this.rowRenderer.addRenderedRowListener(e,t,i)}getQuickFilter(){return this.gos.get("quickFilterText")}setQuickFilter(e){this.gos.set("quickFilterText",e)}setExcludeHiddenColumnsFromQuickFilter(e){ot("30","setExcludeHiddenColumnsFromQuickFilter",void 0,"Hidden columns are now excluded from the Quick Filter by default. This can be toggled using `setIncludeHiddenColumnsInQuickFilter`"),this.setIncludeHiddenColumnsInQuickFilter(!e)}setIncludeHiddenColumnsInQuickFilter(e){this.gos.set("includeHiddenColumnsInQuickFilter",e)}setQuickFilterParser(e){this.gos.set("quickFilterParser",e)}setQuickFilterMatcher(e){this.gos.set("quickFilterMatcher",e)}getAdvancedFilterModel(){return V.__assertRegistered(x.AdvancedFilterModule,"api.getAdvancedFilterModel",this.context.getGridId())?this.filterManager.getAdvancedFilterModel():null}setAdvancedFilterModel(e){this.gos.set("advancedFilterModel",e)}setEnableAdvancedFilter(e){this.gos.set("enableAdvancedFilter",e)}setIncludeHiddenColumnsInAdvancedFilter(e){this.gos.set("includeHiddenColumnsInAdvancedFilter",e)}setAdvancedFilterParent(e){this.gos.set("advancedFilterParent",e)}setAdvancedFilterBuilderParams(e){this.gos.set("advancedFilterBuilderParams",e)}showAdvancedFilterBuilder(){V.__assertRegistered(x.AdvancedFilterModule,"api.setAdvancedFilterModel",this.context.getGridId())&&this.filterManager.showAdvancedFilterBuilder("api")}setNodesSelected(e){if(!e.nodes.every(e=>e.rowPinned?(console.warn("AG Grid: cannot select pinned rows"),!1):void 0!==e.id||(console.warn("AG Grid: cannot select node until id for node is known"),!1)))return;const{nodes:t,source:i,newValue:s}=e,o=t;this.selectionService.setNodesSelected({nodes:o,source:null!=i?i:"api",newValue:s})}selectAll(e="apiSelectAll"){this.selectionService.selectAllRowNodes({source:e})}deselectAll(e="apiSelectAll"){this.selectionService.deselectAllRowNodes({source:e})}selectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.selectAllRowNodes({source:e,justFiltered:!0})}deselectAllFiltered(e="apiSelectAllFiltered"){this.selectionService.deselectAllRowNodes({source:e,justFiltered:!0})}getServerSideSelectionState(){return i(this.serverSideRowModel)?(this.logMissingRowModel("getServerSideSelectionState","serverSide"),null):this.selectionService.getServerSideSelectionState()}setServerSideSelectionState(e){i(this.serverSideRowModel)?this.logMissingRowModel("setServerSideSelectionState","serverSide"):this.selectionService.setServerSideSelectionState(e)}selectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.selectAllRowNodes({source:e,justCurrentPage:!0})}deselectAllOnCurrentPage(e="apiSelectAllCurrentPage"){this.selectionService.deselectAllRowNodes({source:e,justCurrentPage:!0})}sizeColumnsToFit(e){this.gridBodyCtrl.sizeColumnsToFit(e)}showLoadingOverlay(){this.overlayWrapperComp.showLoadingOverlay()}showNoRowsOverlay(){this.overlayWrapperComp.showNoRowsOverlay()}hideOverlay(){this.overlayWrapperComp.hideOverlay()}getSelectedNodes(){return this.selectionService.getSelectedNodes()}getSelectedRows(){return this.selectionService.getSelectedRows()}getBestCostNodeSelection(){if(!i(this.clientSideRowModel))return this.selectionService.getBestCostNodeSelection();this.logMissingRowModel("getBestCostNodeSelection","clientSide")}getRenderedNodes(){return this.rowRenderer.getRenderedNodes()}ensureColumnVisible(e,t="auto"){this.gridBodyCtrl.getScrollFeature().ensureColumnVisible(e,t)}ensureIndexVisible(e,t){this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(e,t)}ensureNodeVisible(e,t=null){this.gridBodyCtrl.getScrollFeature().ensureNodeVisible(e,t)}forEachLeafNode(e){i(this.clientSideRowModel)?this.logMissingRowModel("forEachLeafNode","clientSide"):this.clientSideRowModel.forEachLeafNode(e)}forEachNode(e,t){this.rowModel.forEachNode(e,t)}forEachNodeAfterFilter(e){i(this.clientSideRowModel)?this.logMissingRowModel("forEachNodeAfterFilter","clientSide"):this.clientSideRowModel.forEachNodeAfterFilter(e)}forEachNodeAfterFilterAndSort(e){i(this.clientSideRowModel)?this.logMissingRowModel("forEachNodeAfterFilterAndSort","clientSide"):this.clientSideRowModel.forEachNodeAfterFilterAndSort(e)}getFilterInstance(e,t){return this.filterManager.getFilterInstance(e,t)}destroyFilter(e){const t=this.columnModel.getPrimaryColumn(e);if(t)return this.filterManager.destroyFilter(t,"api")}getStatusPanel(e){if(!V.__assertRegistered(x.StatusBarModule,"api.getStatusPanel",this.context.getGridId()))return;return Sn(this.statusBarService.getStatusPanel(e))}getColumnDef(e){const t=this.columnModel.getPrimaryColumn(e);return t?t.getColDef():null}getColumnDefs(){return this.columnModel.getColumnDefs()}onFilterChanged(e="api"){this.filterManager.onFilterChanged({source:e})}onSortChanged(){this.sortController.onSortChanged("api")}setFilterModel(e){this.filterManager.setFilterModel(e)}getFilterModel(){return this.filterManager.getFilterModel()}getFocusedCell(){return this.focusService.getFocusedCell()}clearFocusedCell(){return this.focusService.clearFocusedCell()}setFocusedCell(e,t,i){this.focusService.setFocusedCell({rowIndex:e,column:t,rowPinned:i,forceBrowserFocus:!0})}setSuppressRowDrag(e){this.gos.set("suppressRowDrag",e)}setSuppressMoveWhenRowDragging(e){this.gos.set("suppressMoveWhenRowDragging",e)}setSuppressRowClickSelection(e){this.gos.set("suppressRowClickSelection",e)}addRowDropZone(e){this.gridBodyCtrl.getRowDragFeature().addRowDropZone(e)}removeRowDropZone(e){const t=this.dragAndDropService.findExternalZone(e);t&&this.dragAndDropService.removeDropTarget(t)}getRowDropZoneParams(e){return this.gridBodyCtrl.getRowDragFeature().getRowDropZone(e)}setHeaderHeight(e){this.gos.set("headerHeight",e)}setDomLayout(e){this.gos.set("domLayout",e)}setEnableCellTextSelection(e){this.gridBodyCtrl.setCellTextSelection(e)}setFillHandleDirection(e){this.gos.set("fillHandleDirection",e)}setGroupHeaderHeight(e){this.gos.set("groupHeaderHeight",e)}setFloatingFiltersHeight(e){this.gos.set("floatingFiltersHeight",e)}setPivotHeaderHeight(e){this.gos.set("pivotHeaderHeight",e)}setPivotGroupHeaderHeight(e){this.gos.set("pivotGroupHeaderHeight",e)}setPivotMode(e){this.columnModel.setPivotMode(e)}setAnimateRows(e){this.gos.set("animateRows",e)}setIsExternalFilterPresent(e){this.gos.set("isExternalFilterPresent",e)}setDoesExternalFilterPass(e){this.gos.set("doesExternalFilterPass",e)}setNavigateToNextCell(e){this.gos.set("navigateToNextCell",e)}setTabToNextCell(e){this.gos.set("tabToNextCell",e)}setTabToNextHeader(e){this.gos.set("tabToNextHeader",e)}setNavigateToNextHeader(e){this.gos.set("navigateToNextHeader",e)}setRowGroupPanelShow(e){this.gos.set("rowGroupPanelShow",e)}setGetGroupRowAgg(e){this.gos.set("getGroupRowAgg",e)}setGetBusinessKeyForNode(e){this.gos.set("getBusinessKeyForNode",e)}setGetChildCount(e){this.gos.set("getChildCount",e)}setProcessRowPostCreate(e){this.gos.set("processRowPostCreate",e)}setGetRowId(e){this.gos.set("getRowId",e)}setGetRowClass(e){this.gos.set("getRowClass",e)}setIsFullWidthRow(e){this.gos.set("isFullWidthRow",e)}setIsRowSelectable(e){this.gos.set("isRowSelectable",e)}setIsRowMaster(e){this.gos.set("isRowMaster",e)}setPostSortRows(e){this.gos.set("postSortRows",e)}setGetDocument(e){this.gos.set("getDocument",e)}setGetContextMenuItems(e){this.gos.set("getContextMenuItems",e)}setGetMainMenuItems(e){this.gos.set("getMainMenuItems",e)}setProcessCellForClipboard(e){this.gos.set("processCellForClipboard",e)}setSendToClipboard(e){this.gos.set("sendToClipboard",e)}setProcessCellFromClipboard(e){this.gos.set("processCellFromClipboard",e)}setProcessSecondaryColDef(e){ot("28.0","setProcessSecondaryColDef","setProcessPivotResultColDef"),this.setProcessPivotResultColDef(e)}setProcessSecondaryColGroupDef(e){ot("28.0","setProcessSecondaryColGroupDef","setProcessPivotResultColGroupDef"),this.setProcessPivotResultColGroupDef(e)}setProcessPivotResultColDef(e){this.gos.set("processPivotResultColDef",e)}setProcessPivotResultColGroupDef(e){this.gos.set("processPivotResultColGroupDef",e)}setPostProcessPopup(e){this.gos.set("postProcessPopup",e)}setInitialGroupOrderComparator(e){this.gos.set("initialGroupOrderComparator",e)}setGetChartToolbarItems(e){this.gos.set("getChartToolbarItems",e)}setPaginationNumberFormatter(e){this.gos.set("paginationNumberFormatter",e)}setGetServerSideStoreParams(e){ot("28.0","setGetServerSideStoreParams","setGetServerSideGroupLevelParams"),this.setGetServerSideGroupLevelParams(e)}setGetServerSideGroupLevelParams(e){this.gos.set("getServerSideGroupLevelParams",e)}setIsServerSideGroupOpenByDefault(e){this.gos.set("isServerSideGroupOpenByDefault",e)}setIsApplyServerSideTransaction(e){this.gos.set("isApplyServerSideTransaction",e)}setIsServerSideGroup(e){this.gos.set("isServerSideGroup",e)}setGetServerSideGroupKey(e){this.gos.set("getServerSideGroupKey",e)}setGetRowStyle(e){this.gos.set("getRowStyle",e)}setGetRowHeight(e){this.gos.set("getRowHeight",e)}assertSideBarLoaded(e){return V.__assertRegistered(x.SideBarModule,"api."+e,this.context.getGridId())}isSideBarVisible(){return this.assertSideBarLoaded("isSideBarVisible")&&this.sideBarComp.isDisplayed()}setSideBarVisible(e){this.assertSideBarLoaded("setSideBarVisible")&&this.sideBarComp.setDisplayed(e)}setSideBarPosition(e){this.assertSideBarLoaded("setSideBarPosition")&&this.sideBarComp.setSideBarPosition(e)}openToolPanel(e){this.assertSideBarLoaded("openToolPanel")&&this.sideBarComp.openToolPanel(e,"api")}closeToolPanel(){this.assertSideBarLoaded("closeToolPanel")&&this.sideBarComp.close("api")}getOpenedToolPanel(){return this.assertSideBarLoaded("getOpenedToolPanel")?this.sideBarComp.openedItem():null}refreshToolPanel(){this.assertSideBarLoaded("refreshToolPanel")&&this.sideBarComp.refresh()}isToolPanelShowing(){return this.assertSideBarLoaded("isToolPanelShowing")&&this.sideBarComp.isToolPanelShowing()}getToolPanelInstance(e){if(this.assertSideBarLoaded("getToolPanelInstance")){return Sn(this.sideBarComp.getToolPanelInstance(e))}}getSideBar(){if(this.assertSideBarLoaded("getSideBar"))return this.sideBarComp.getDef()}setSideBar(e){this.gos.set("sideBar",e)}setSuppressClipboardPaste(e){this.gos.set("suppressClipboardPaste",e)}resetRowHeights(){if(t(this.clientSideRowModel)){if(this.columnModel.isAutoRowHeightActive())return void console.warn("AG Grid: calling gridApi.resetRowHeights() makes no sense when using Auto Row Height.");this.clientSideRowModel.resetRowHeights()}}setGroupRemoveSingleChildren(e){this.gos.set("groupRemoveSingleChildren",e)}setGroupRemoveLowestSingleChildren(e){this.gos.set("groupRemoveLowestSingleChildren",e)}setGroupDisplayType(e){this.gos.set("groupDisplayType",e)}setGroupIncludeFooter(e){this.gos.set("groupIncludeFooter",e)}setGroupIncludeTotalFooter(e){this.gos.set("groupIncludeTotalFooter",e)}setRowClass(e){this.gos.set("rowClass",e)}setDeltaSort(e){this.gos.set("deltaSort",e)}setRowCount(e,t){if(this.serverSideRowModel)return this.columnModel.isRowGroupEmpty()?void this.serverSideRowModel.setRowCount(e,t):void console.error("AG Grid: setRowCount cannot be used while using row grouping.");this.infiniteRowModel?this.infiniteRowModel.setRowCount(e,t):this.logMissingRowModel("setRowCount","infinite","serverSide")}onRowHeightChanged(){this.clientSideRowModel?this.clientSideRowModel.onRowHeightChanged():this.serverSideRowModel&&this.serverSideRowModel.onRowHeightChanged()}getValue(e,t){let s=this.columnModel.getPrimaryColumn(e);return i(s)&&(s=this.columnModel.getGridColumn(e)),i(s)?null:this.valueService.getValue(s,t)}addEventListener(e,t){const i=this.gos.useAsyncEvents();this.eventService.addEventListener(e,t,i)}addGlobalListener(e){const t=this.gos.useAsyncEvents();this.eventService.addGlobalListener(e,t)}removeEventListener(e,t){const i=this.gos.useAsyncEvents();this.eventService.removeEventListener(e,t,i)}removeGlobalListener(e){const t=this.gos.useAsyncEvents();this.eventService.removeGlobalListener(e,t)}dispatchEvent(e){this.eventService.dispatchEvent(e)}destroy(){if(this.destroyCalled)return;this.destroyCalled=!0,this.dispatchEvent({type:_e.EVENT_GRID_PRE_DESTROYED});const e=this.ctrlsService.getGridCtrl();e&&e.destroyGridUi(),this.context.destroy()}cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid(){setTimeout(y.bind(window,this,"Grid API"),100)}warnIfDestroyed(e){return this.destroyCalled&&console.warn(`AG Grid: Grid API method ${e} was called on a grid that was destroyed.`),this.destroyCalled}resetQuickFilter(){this.warnIfDestroyed("resetQuickFilter")||this.filterManager.resetQuickFilterCache()}getCellRanges(){return this.rangeService?this.rangeService.getCellRanges():(V.__assertRegistered(x.RangeSelectionModule,"api.getCellRanges",this.context.getGridId()),null)}addCellRange(e){this.rangeService?this.rangeService.addCellRange(e):V.__assertRegistered(x.RangeSelectionModule,"api.addCellRange",this.context.getGridId())}clearRangeSelection(){this.rangeService&&this.rangeService.removeAllCellRanges(),V.__assertRegistered(x.RangeSelectionModule,"gridApi.clearRangeSelection",this.context.getGridId())}undoCellEditing(){this.undoRedoService.undo("api")}redoCellEditing(){this.undoRedoService.redo("api")}getCurrentUndoSize(){return this.undoRedoService.getCurrentUndoStackSize()}getCurrentRedoSize(){return this.undoRedoService.getCurrentRedoStackSize()}getChartModels(){if(V.__assertRegistered(x.GridChartsModule,"api.getChartModels",this.context.getGridId()))return this.chartService.getChartModels()}getChartRef(e){if(V.__assertRegistered(x.GridChartsModule,"api.getChartRef",this.context.getGridId()))return this.chartService.getChartRef(e)}getChartImageDataURL(e){if(V.__assertRegistered(x.GridChartsModule,"api.getChartImageDataURL",this.context.getGridId()))return this.chartService.getChartImageDataURL(e)}downloadChart(e){if(V.__assertRegistered(x.GridChartsModule,"api.downloadChart",this.context.getGridId()))return this.chartService.downloadChart(e)}openChartToolPanel(e){if(V.__assertRegistered(x.GridChartsModule,"api.openChartToolPanel",this.context.getGridId()))return this.chartService.openChartToolPanel(e)}closeChartToolPanel(e){if(V.__assertRegistered(x.GridChartsModule,"api.closeChartToolPanel",this.context.getGridId()))return this.chartService.closeChartToolPanel(e.chartId)}createRangeChart(e){if(V.__assertRegistered(x.GridChartsModule,"api.createRangeChart",this.context.getGridId()))return this.chartService.createRangeChart(e)}createPivotChart(e){if(V.__assertRegistered(x.GridChartsModule,"api.createPivotChart",this.context.getGridId()))return this.chartService.createPivotChart(e)}createCrossFilterChart(e){if(V.__assertRegistered(x.GridChartsModule,"api.createCrossFilterChart",this.context.getGridId()))return this.chartService.createCrossFilterChart(e)}updateChart(e){V.__assertRegistered(x.GridChartsModule,"api.updateChart",this.context.getGridId())&&this.chartService.updateChart(e)}restoreChart(e,t){if(V.__assertRegistered(x.GridChartsModule,"api.restoreChart",this.context.getGridId()))return this.chartService.restoreChart(e,t)}copyToClipboard(e){V.__assertRegistered(x.ClipboardModule,"api.copyToClipboard",this.context.getGridId())&&this.clipboardService.copyToClipboard(e)}cutToClipboard(e){V.__assertRegistered(x.ClipboardModule,"api.cutToClipboard",this.context.getGridId())&&this.clipboardService.cutToClipboard(e,"api")}copySelectedRowsToClipboard(e){V.__assertRegistered(x.ClipboardModule,"api.copySelectedRowsToClipboard",this.context.getGridId())&&this.clipboardService.copySelectedRowsToClipboard(e)}copySelectedRangeToClipboard(e){V.__assertRegistered(x.ClipboardModule,"api.copySelectedRangeToClipboard",this.context.getGridId())&&this.clipboardService.copySelectedRangeToClipboard(e)}copySelectedRangeDown(){V.__assertRegistered(x.ClipboardModule,"api.copySelectedRangeDown",this.context.getGridId())&&this.clipboardService.copyRangeDown()}pasteFromClipboard(){V.__assertRegistered(x.ClipboardModule,"api.pasteFromClipboard",this.context.getGridId())&&this.clipboardService.pasteFromClipboard()}showColumnMenuAfterButtonClick(e,t){const i=this.columnModel.getGridColumn(e);this.menuFactory.showMenuAfterButtonClick(i,t,"columnMenu")}showColumnMenuAfterMouseClick(e,t){let i=this.columnModel.getGridColumn(e);i||(i=this.columnModel.getPrimaryColumn(e)),i?this.menuFactory.showMenuAfterMouseEvent(i,t):console.error(`AG Grid: column '${e}' not found`)}hidePopupMenu(){this.contextMenuFactory&&this.contextMenuFactory.hideActiveMenu(),this.menuFactory.hideActiveMenu()}setPopupParent(e){this.gos.set("popupParent",e)}tabToNextCell(e){return this.navigationService.tabToNextCell(!1,e)}tabToPreviousCell(e){return this.navigationService.tabToNextCell(!0,e)}getCellRendererInstances(e={}){return this.rowRenderer.getCellRendererInstances(e).map(Sn)}getCellEditorInstances(e={}){return this.rowRenderer.getCellEditorInstances(e).map(Sn)}getEditingCells(){return this.rowRenderer.getEditingCells()}stopEditing(e=!1){this.rowRenderer.stopEditing(e)}startEditingCell(e){const t=this.columnModel.getGridColumn(e.colKey);if(!t)return void console.warn("AG Grid: no column found for "+e.colKey);const i={rowIndex:e.rowIndex,rowPinned:e.rowPinned||null,column:t};null==e.rowPinned&&this.gridBodyCtrl.getScrollFeature().ensureIndexVisible(e.rowIndex);const s=this.navigationService.getCellByPosition(i);s&&(this.focusService.isCellFocused(i)||this.focusService.setFocusedCell(i),s.startRowOrCellEdit(e.key))}addAggFunc(e,t){this.aggFuncService&&this.aggFuncService.addAggFunc(e,t)}addAggFuncs(e){this.aggFuncService&&this.aggFuncService.addAggFuncs(e)}clearAggFuncs(){this.aggFuncService&&this.aggFuncService.clear()}applyServerSideTransaction(e){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransaction(e);this.logMissingRowModel("applyServerSideTransaction","serverSide")}applyServerSideTransactionAsync(e,t){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.applyTransactionAsync(e,t);this.logMissingRowModel("applyServerSideTransactionAsync","serverSide")}applyServerSideRowData(e){var t,i;const s=null!==(t=e.startRow)&&void 0!==t?t:0,o=null!==(i=e.route)&&void 0!==i?i:[];s<0?console.warn(`AG Grid: invalid value ${e.startRow} for startRow, the value should be >= 0`):this.serverSideRowModel?this.serverSideRowModel.applyRowData(e.successParams,s,o):this.logMissingRowModel("setServerSideDatasource","serverSide")}retryServerSideLoads(){this.serverSideRowModel?this.serverSideRowModel.retryLoads():this.logMissingRowModel("retryServerSideLoads","serverSide")}flushServerSideAsyncTransactions(){if(this.serverSideTransactionManager)return this.serverSideTransactionManager.flushAsyncTransactions();this.logMissingRowModel("flushServerSideAsyncTransactions","serverSide")}applyTransaction(e){if(this.clientSideRowModel)return this.clientSideRowModel.updateRowData(e);this.logMissingRowModel("applyTransaction","clientSide")}applyTransactionAsync(e,t){this.clientSideRowModel?this.clientSideRowModel.batchUpdateRowData(e,t):this.logMissingRowModel("applyTransactionAsync","clientSide")}flushAsyncTransactions(){this.clientSideRowModel?this.clientSideRowModel.flushAsyncTransactions():this.logMissingRowModel("flushAsyncTransactions","clientSide")}setSuppressModelUpdateAfterUpdateTransaction(e){this.gos.set("suppressModelUpdateAfterUpdateTransaction",e)}refreshInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.refreshCache():this.logMissingRowModel("refreshInfiniteCache","infinite")}purgeInfiniteCache(){this.infiniteRowModel?this.infiniteRowModel.purgeCache():this.logMissingRowModel("purgeInfiniteCache","infinite")}refreshServerSide(e){this.serverSideRowModel?this.serverSideRowModel.refreshStore(e):this.logMissingRowModel("refreshServerSide","serverSide")}refreshServerSideStore(e){return ot("28.0","refreshServerSideStore","refreshServerSide"),this.refreshServerSide(e)}getServerSideStoreState(){return ot("28.0","getServerSideStoreState","getServerSideGroupLevelState"),this.getServerSideGroupLevelState()}getServerSideGroupLevelState(){return this.serverSideRowModel?this.serverSideRowModel.getStoreState():(this.logMissingRowModel("getServerSideGroupLevelState","serverSide"),[])}getInfiniteRowCount(){if(this.infiniteRowModel)return this.infiniteRowModel.getRowCount();this.logMissingRowModel("getInfiniteRowCount","infinite")}isLastRowIndexKnown(){if(this.infiniteRowModel)return this.infiniteRowModel.isLastRowIndexKnown();this.logMissingRowModel("isLastRowIndexKnown","infinite")}getCacheBlockState(){return this.rowNodeBlockLoader.getBlockState()}getFirstDisplayedRow(){return this.rowRenderer.getFirstVirtualRenderedRow()}getLastDisplayedRow(){return this.rowRenderer.getLastVirtualRenderedRow()}getDisplayedRowAtIndex(e){return this.rowModel.getRow(e)}getDisplayedRowCount(){return this.rowModel.getRowCount()}setDataTypeDefinitions(e){this.gos.set("dataTypeDefinitions",e)}setPagination(e){this.gos.set("pagination",e)}paginationIsLastPageFound(){return this.paginationProxy.isLastPageFound()}paginationGetPageSize(){return this.paginationProxy.getPageSize()}paginationSetPageSize(e){this.gos.set("paginationPageSize",e)}paginationGetCurrentPage(){return this.paginationProxy.getCurrentPage()}paginationGetTotalPages(){return this.paginationProxy.getTotalPages()}paginationGetRowCount(){return this.paginationProxy.getMasterRowCount()}paginationGoToNextPage(){this.paginationProxy.goToNextPage()}paginationGoToPreviousPage(){this.paginationProxy.goToPreviousPage()}paginationGoToFirstPage(){this.paginationProxy.goToFirstPage()}paginationGoToLastPage(){this.paginationProxy.goToLastPage()}paginationGoToPage(e){this.paginationProxy.goToPage(e)}};yn([z("immutableService")],En.prototype,"immutableService",void 0),yn([z("csvCreator")],En.prototype,"csvCreator",void 0),yn([z("excelCreator")],En.prototype,"excelCreator",void 0),yn([j("rowRenderer")],En.prototype,"rowRenderer",void 0),yn([j("navigationService")],En.prototype,"navigationService",void 0),yn([j("filterManager")],En.prototype,"filterManager",void 0),yn([j("columnModel")],En.prototype,"columnModel",void 0),yn([j("selectionService")],En.prototype,"selectionService",void 0),yn([j("gridOptionsService")],En.prototype,"gos",void 0),yn([j("valueService")],En.prototype,"valueService",void 0),yn([j("alignedGridsService")],En.prototype,"alignedGridsService",void 0),yn([j("eventService")],En.prototype,"eventService",void 0),yn([j("pinnedRowModel")],En.prototype,"pinnedRowModel",void 0),yn([j("context")],En.prototype,"context",void 0),yn([j("rowModel")],En.prototype,"rowModel",void 0),yn([j("sortController")],En.prototype,"sortController",void 0),yn([j("paginationProxy")],En.prototype,"paginationProxy",void 0),yn([j("focusService")],En.prototype,"focusService",void 0),yn([j("dragAndDropService")],En.prototype,"dragAndDropService",void 0),yn([z("rangeService")],En.prototype,"rangeService",void 0),yn([z("clipboardService")],En.prototype,"clipboardService",void 0),yn([z("aggFuncService")],En.prototype,"aggFuncService",void 0),yn([j("menuFactory")],En.prototype,"menuFactory",void 0),yn([z("contextMenuFactory")],En.prototype,"contextMenuFactory",void 0),yn([j("valueCache")],En.prototype,"valueCache",void 0),yn([j("animationFrameService")],En.prototype,"animationFrameService",void 0),yn([z("statusBarService")],En.prototype,"statusBarService",void 0),yn([z("chartService")],En.prototype,"chartService",void 0),yn([z("undoRedoService")],En.prototype,"undoRedoService",void 0),yn([z("rowNodeBlockLoader")],En.prototype,"rowNodeBlockLoader",void 0),yn([z("ssrmTransactionManager")],En.prototype,"serverSideTransactionManager",void 0),yn([j("ctrlsService")],En.prototype,"ctrlsService",void 0),yn([B],En.prototype,"init",null),yn([W],En.prototype,"cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid",null),En=yn([U("gridApi")],En);var Rn,Tn=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let bn=Rn=class extends Le{constructor(){super(...arguments),this.quickFilter=null,this.quickFilterParts=null}postConstruct(){this.addManagedListener(this.eventService,_e.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,_e.EVENT_NEW_COLUMNS_LOADED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_ROW_GROUP_CHANGED,()=>this.resetQuickFilterCache()),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_VISIBLE,()=>{this.gridOptionsService.is("includeHiddenColumnsInQuickFilter")||this.resetQuickFilterCache()}),this.addManagedPropertyListener("quickFilterText",e=>this.setQuickFilter(e.currentValue)),this.addManagedPropertyListener("includeHiddenColumnsInQuickFilter",()=>this.onIncludeHiddenColumnsInQuickFilterChanged()),this.quickFilter=this.parseQuickFilter(this.gridOptionsService.get("quickFilterText")),this.parser=this.gridOptionsService.get("quickFilterParser"),this.matcher=this.gridOptionsService.get("quickFilterMatcher"),this.setQuickFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setQuickFilterParserAndMatcher())}isQuickFilterPresent(){return null!==this.quickFilter}doesRowPassQuickFilter(e){const t=this.gridOptionsService.is("cacheQuickFilter");return this.matcher?this.doesRowPassQuickFilterMatcher(t,e):this.quickFilterParts.every(i=>t?this.doesRowPassQuickFilterCache(e,i):this.doesRowPassQuickFilterNoCache(e,i))}resetQuickFilterCache(){this.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}setQuickFilterParts(){const{quickFilter:e,parser:t}=this;this.quickFilterParts=e?t?t(e):e.split(" "):null}parseQuickFilter(e){return t(e)?this.gridOptionsService.isRowModelType("clientSide")?e.toUpperCase():(console.warn("AG Grid - Quick filtering only works with the Client-Side Row Model"),null):null}setQuickFilter(e){if(null!=e&&"string"!=typeof e)return void console.warn("AG Grid - setQuickFilter() only supports string inputs, received: "+typeof e);const t=this.parseQuickFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setQuickFilterParts(),this.dispatchEvent({type:Rn.EVENT_QUICK_FILTER_CHANGED}))}setQuickFilterParserAndMatcher(){const e=this.gridOptionsService.get("quickFilterParser"),t=this.gridOptionsService.get("quickFilterMatcher"),i=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,i&&(this.setQuickFilterParts(),this.dispatchEvent({type:Rn.EVENT_QUICK_FILTER_CHANGED}))}onIncludeHiddenColumnsInQuickFilterChanged(){this.columnModel.refreshQuickFilterColumns(),this.resetQuickFilterCache(),this.isQuickFilterPresent()&&this.dispatchEvent({type:Rn.EVENT_QUICK_FILTER_CHANGED})}doesRowPassQuickFilterNoCache(e,i){return this.columnModel.getAllColumnsForQuickFilter().some(s=>{const o=this.getQuickFilterTextForColumn(s,e);return t(o)&&o.indexOf(i)>=0})}doesRowPassQuickFilterCache(e,t){return this.checkGenerateQuickFilterAggregateText(e),e.quickFilterAggregateText.indexOf(t)>=0}doesRowPassQuickFilterMatcher(e,t){let i;e?(this.checkGenerateQuickFilterAggregateText(t),i=t.quickFilterAggregateText):i=this.getQuickFilterAggregateText(t);const{quickFilterParts:s,matcher:o}=this;return o(s,i)}checkGenerateQuickFilterAggregateText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getQuickFilterAggregateText(e))}getQuickFilterTextForColumn(e,i){let s=this.valueService.getValue(e,i,!0);const o=e.getColDef();if(o.getQuickFilterText){const t={value:s,node:i,data:i.data,column:e,colDef:o,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context};s=o.getQuickFilterText(t)}return t(s)?s.toString().toUpperCase():null}getQuickFilterAggregateText(e){const i=[];return this.columnModel.getAllColumnsForQuickFilter().forEach(s=>{const o=this.getQuickFilterTextForColumn(s,e);t(o)&&i.push(o)}),i.join(Rn.QUICK_FILTER_SEPARATOR)}};bn.EVENT_QUICK_FILTER_CHANGED="quickFilterChanged",bn.QUICK_FILTER_SEPARATOR="\n",Tn([j("valueService")],bn.prototype,"valueService",void 0),Tn([j("columnModel")],bn.prototype,"columnModel",void 0),Tn([j("rowModel")],bn.prototype,"rowModel",void 0),Tn([B],bn.prototype,"postConstruct",null),bn=Rn=Tn([U("quickFilterService")],bn);var Dn=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let On=class extends Le{constructor(){super(...arguments),this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.filterModelUpdateQueue=[]}init(){this.addManagedListener(this.eventService,_e.EVENT_GRID_COLUMNS_CHANGED,()=>this.onColumnsChanged()),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_VALUE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_PIVOT_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_PIVOT_MODE_CHANGED,()=>this.refreshFiltersForAggregations()),this.addManagedListener(this.eventService,_e.EVENT_NEW_COLUMNS_LOADED,()=>this.updateAdvancedFilterColumns()),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_VISIBLE,()=>this.updateAdvancedFilterColumns()),this.allowShowChangeAfterFilter=this.gridOptionsService.is("allowShowChangeAfterFilter"),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>this.updateAggFiltering()),this.addManagedPropertyListener("advancedFilterModel",e=>this.setAdvancedFilterModel(e.currentValue)),this.addManagedListener(this.eventService,_e.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,({enabled:e})=>this.onAdvancedFilterEnabledChanged(e)),this.addManagedListener(this.eventService,_e.EVENT_DATA_TYPES_INFERRED,()=>this.processFilterModelUpdateQueue()),this.addManagedListener(this.quickFilterService,bn.EVENT_QUICK_FILTER_CHANGED,()=>this.onFilterChanged({source:"quickFilter"}))}isExternalFilterPresentCallback(){const e=this.gridOptionsService.getCallback("isExternalFilterPresent");return"function"==typeof e&&e({})}doesExternalFilterPass(e){const t=this.gridOptionsService.get("doesExternalFilterPass");return"function"==typeof t&&t(e)}setFilterModel(e){if(this.isAdvancedFilterEnabled())return void this.warnAdvancedFilters();if(this.dataTypeService.isPendingInference())return void this.filterModelUpdateQueue.push(e);const t=[],i=this.getFilterModel();if(e){const i=Fs(Object.keys(e));this.allColumnFilters.forEach((s,o)=>{const r=e[o];t.push(this.setModelOnFilterWrapper(s.filterPromise,r)),i.delete(o)}),i.forEach(i=>{const s=this.columnModel.getPrimaryColumn(i)||this.columnModel.getGridColumn(i);if(!s)return void console.warn("AG Grid: setFilterModel() - no column found for colId: "+i);if(!s.isFilterAllowed())return void console.warn("AG Grid: setFilterModel() - unable to fully apply model, filtering disabled for colId: "+i);const o=this.getOrCreateFilterWrapper(s,"NO_UI");o?t.push(this.setModelOnFilterWrapper(o.filterPromise,e[i])):console.warn("AG-Grid: setFilterModel() - unable to fully apply model, unable to create filter for colId: "+i)})}else this.allColumnFilters.forEach(e=>{t.push(this.setModelOnFilterWrapper(e.filterPromise,null))});Gs.all(t).then(()=>{const e=this.getFilterModel(),t=[];this.allColumnFilters.forEach((s,o)=>{const r=i?i[o]:null,n=e?e[o]:null;Is.jsonEquals(r,n)||t.push(s.column)}),t.length>0&&this.onFilterChanged({columns:t,source:"api"})})}setModelOnFilterWrapper(e,t){return new Gs(i=>{e.then(e=>{"function"!=typeof e.setModel&&(console.warn("AG Grid: filter missing setModel method, which is needed for setFilterModel"),i()),(e.setModel(t)||Gs.resolve()).then(()=>i())})})}getFilterModel(){const e={};return this.allColumnFilters.forEach((i,s)=>{const o=i.filterPromise.resolveNow(null,e=>e);if(null==o)return null;if("function"!=typeof o.getModel)return void console.warn("AG Grid: filter API missing getModel method, which is needed for getFilterModel");const r=o.getModel();t(r)&&(e[s]=r)}),e}isColumnFilterPresent(){return this.activeColumnFilters.length>0}isAggregateFilterPresent(){return!!this.activeAggregateFilters.length}isExternalFilterPresent(){return this.externalFilterPresent}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.isExternalFilterPresent()||this.isAdvancedFilterPresent()}isAdvancedFilterPresent(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isFilterPresent()}onAdvancedFilterEnabledChanged(e){var t;e?this.allColumnFilters.size&&(this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"advancedFilterEnabled")),this.onFilterChanged({source:"advancedFilter"})):(null===(t=this.advancedFilterService)||void 0===t?void 0:t.isFilterPresent())&&(this.advancedFilterService.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvancedFilterEnabled(){var e;return null===(e=this.advancedFilterService)||void 0===e?void 0:e.isEnabled()}isAdvancedFilterHeaderActive(){return this.isAdvancedFilterEnabled()&&this.advancedFilterService.isHeaderActive()}doAggregateFiltersPass(e,t){return this.doColumnFiltersPass(e,t,!0)}updateActiveFilters(){this.activeColumnFilters.length=0,this.activeAggregateFilters.length=0;const e=e=>!!e&&(e.isFilterActive?e.isFilterActive():(console.warn("AG Grid: Filter is missing isFilterActive() method"),!1)),t=!!this.gridOptionsService.getGroupAggFiltering(),i=e=>{if(!e.isPrimary())return!0;const i=!this.columnModel.isPivotActive();return!(!e.isValueActive()||!i)&&(!!this.columnModel.isPivotMode()||t)};this.allColumnFilters.forEach(t=>{if(t.filterPromise.resolveNow(!1,e)){const e=t.filterPromise.resolveNow(null,e=>e);i(t.column)?this.activeAggregateFilters.push(e):this.activeColumnFilters.push(e)}})}updateFilterFlagInColumns(e,t){this.allColumnFilters.forEach(i=>{const s=i.filterPromise.resolveNow(!1,e=>e.isFilterActive());i.column.setFilterActive(s,e,t)})}isAnyFilterPresent(){return this.isQuickFilterPresent()||this.isColumnFilterPresent()||this.isAggregateFilterPresent()||this.isExternalFilterPresent()}doColumnFiltersPass(e,t,i){const{data:s,aggData:o}=e,r=i?this.activeAggregateFilters:this.activeColumnFilters,n=i?o:s;for(let i=0;i<r.length;i++){const s=r[i];if(null!=s&&s!==t){if("function"!=typeof s.doesFilterPass)throw new Error("Filter is missing method doesFilterPass");if(!s.doesFilterPass({node:e,data:n}))return!1}}return!0}resetQuickFilterCache(){this.quickFilterService.resetQuickFilterCache()}refreshFiltersForAggregations(){this.gridOptionsService.getGroupAggFiltering()&&this.onFilterChanged()}callOnFilterChangedOutsideRenderCycle(e){const t=()=>this.onFilterChanged(e);this.rowRenderer.isRefreshInProgress()?setTimeout(t,0):t()}onFilterChanged(e={}){const{source:t,filterInstance:i,additionalEventAttributes:s,columns:o}=e;this.updateDependantFilters(),this.updateActiveFilters(),this.updateFilterFlagInColumns("filterChanged",s),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.allColumnFilters.forEach(e=>{e.filterPromise&&e.filterPromise.then(e=>{e&&e!==i&&e.onAnyFilterChanged&&e.onAnyFilterChanged()})});const r={source:t,type:_e.EVENT_FILTER_CHANGED,columns:o||[]};s&&f(r,s),this.processingFilterChange=!0,this.eventService.dispatchEvent(r),this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!this.allowShowChangeAfterFilter&&this.processingFilterChange}isQuickFilterPresent(){return this.quickFilterService.isQuickFilterPresent()}updateAggFiltering(){this.aggFiltering=!!this.gridOptionsService.getGroupAggFiltering()}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&(this.aggFiltering||this.columnModel.isPivotMode())}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!(this.aggFiltering||this.columnModel.isPivotMode())}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,filterInstanceToSkip:e})}doesRowPassAggregateFilters(e){return!(this.isAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode))&&!(this.isAggregateFilterPresent()&&!this.doAggregateFiltersPass(e.rowNode,e.filterInstanceToSkip))}doesRowPassFilter(e){return!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilterService.doesRowPassQuickFilter(e.rowNode))&&(!(this.isExternalFilterPresent()&&!this.doesExternalFilterPass(e.rowNode))&&(!(this.isColumnFilterPresent()&&!this.doColumnFiltersPass(e.rowNode,e.filterInstanceToSkip))&&!(this.isAdvancedFilterPresent()&&!this.advancedFilterService.doesFilterPass(e.rowNode))))}onNewRowsLoaded(e){this.allColumnFilters.forEach(e=>{e.filterPromise.then(e=>{e.onNewRowsLoaded&&e.onNewRowsLoaded()})}),this.updateFilterFlagInColumns(e,{afterDataChange:!0}),this.updateActiveFilters()}createValueGetter(e){return({node:t})=>this.valueService.getValue(e,t,!0)}getFilterComponent(e,t,i=!0){var s;if(i)return(null===(s=this.getOrCreateFilterWrapper(e,t))||void 0===s?void 0:s.filterPromise)||null;const o=this.cachedFilter(e);return o?o.filterPromise:null}isFilterActive(e){const t=this.cachedFilter(e);return!!t&&t.filterPromise.resolveNow(!1,e=>e.isFilterActive())}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return null;let i=this.cachedFilter(e);if(i)"NO_UI"!==t&&this.putIntoGui(i,t);else{i=this.createFilterWrapper(e,t);const s=e.getColId();this.allColumnFilters.set(s,i),this.allColumnListeners.set(s,this.addManagedListener(e,te.EVENT_COL_DEF_CHANGED,()=>this.checkDestroyFilter(s)))}return i}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e){let t;if(V.__isRegistered(x.SetFilterModule,this.context.getGridId()))t="agSetColumnFilter";else{const i=e.getColDef().cellDataType;t="number"===i?"agNumberColumnFilter":"date"===i||"dateString"===i?"agDateColumnFilter":"agTextColumnFilter"}return t}getDefaultFloatingFilter(e){let t;if(V.__isRegistered(x.SetFilterModule,this.context.getGridId()))t="agSetColumnFloatingFilter";else{const i=e.getColDef().cellDataType;t="number"===i?"agNumberColumnFloatingFilter":"date"===i||"dateString"===i?"agDateColumnFloatingFilter":"agTextColumnFloatingFilter"}return t}createFilterInstance(e){const t=this.getDefaultFilter(e),i=e.getColDef();let s;const o=Object.assign(Object.assign({},this.createFilterParams(e,i)),{filterModifiedCallback:()=>{const t={type:_e.EVENT_FILTER_MODIFIED,column:e,filterInstance:s};this.eventService.dispatchEvent(t)},filterChangedCallback:t=>{var i;const o=null!==(i=null==t?void 0:t.source)&&void 0!==i?i:"api",r={filterInstance:s,additionalEventAttributes:t,columns:[e],source:o};this.callOnFilterChangedOutsideRenderCycle(r)},doesRowPassOtherFilter:e=>this.doesRowPassOtherFilters(s,e)}),r=this.userComponentFactory.getFilterDetails(i,o,t);return r?{filterPromise:()=>{const e=r.newAgStackInstance();return e&&e.then(e=>s=e),e},compDetails:r}:{filterPromise:null,compDetails:null}}createFilterParams(e,t){return{column:e,colDef:c(t),rowModel:this.rowModel,filterChangedCallback:()=>{},filterModifiedCallback:()=>{},valueGetter:this.createValueGetter(e),doesRowPassOtherFilter:()=>!0,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context}}createFilterWrapper(e,t){var i;const s={column:e,filterPromise:null,compiledElement:null,guiPromise:Gs.resolve(null),compDetails:null},{filterPromise:o,compDetails:r}=this.createFilterInstance(e);return s.filterPromise=null!==(i=null==o?void 0:o())&&void 0!==i?i:null,s.compDetails=r,o&&this.putIntoGui(s,t),s}putIntoGui(e,i){const s=document.createElement("div");s.className="ag-filter",e.guiPromise=new Gs(o=>{e.filterPromise.then(r=>{let n=r.getGui();t(n)||console.warn(`AG Grid: getGui method from filter returned ${n}, it should be a DOM element or an HTML template string.`),"string"==typeof n&&(n=Qi(n)),s.appendChild(n),o(s);const l={type:_e.EVENT_FILTER_OPENED,column:e.column,source:i,eGui:s};this.eventService.dispatchEvent(l)})})}onColumnsChanged(){const e=[];this.allColumnFilters.forEach((t,i)=>{let s;s=t.column.isPrimary()?this.columnModel.getPrimaryColumn(i):this.columnModel.getGridColumn(i),s||(e.push(t.column),this.disposeFilterWrapper(t,"columnChanged"),this.disposeColumnListener(i))}),e.length>0?this.onFilterChanged({columns:e,source:"api"}):this.updateDependantFilters()}updateDependantFilters(){const e=this.columnModel.getGroupAutoColumns();null==e||e.forEach(e=>{"agGroupColumnFilter"===e.getColDef().filter&&this.getOrCreateFilterWrapper(e,"NO_UI")})}isFilterAllowed(e){var t,i;if(this.isAdvancedFilterEnabled())return!1;if(!e.isFilterAllowed())return!1;const s=this.allColumnFilters.get(e.getColId());return null===(i=null===(t=null==s?void 0:s.filterPromise)||void 0===t?void 0:t.resolveNow(!0,e=>{var t,i;return"function"!=typeof(null===(t=e)||void 0===t?void 0:t.isFilterAllowed)||(null===(i=e)||void 0===i?void 0:i.isFilterAllowed())}))||void 0===i||i}getFloatingFilterCompDetails(e,t){const i=e.getColDef(),s=this.createFilterParams(e,i),o=this.userComponentFactory.mergeParamsWithApplicationProvidedParams(i,Zr,s);let r=this.userComponentFactory.getDefaultFloatingFilterType(i,()=>this.getDefaultFloatingFilter(e));null==r&&(r="agReadOnlyFloatingFilter");const n={column:e,filterParams:o,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:t=>{const i=this.getFilterComponent(e,"NO_UI");null!=i&&i.then(e=>{t(Sn(e))})},showParentFilter:t,suppressFilterButton:!1};return this.userComponentFactory.getFloatingFilterCompDetails(i,n,r)}getCurrentFloatingFilterParentModel(e){const t=this.getFilterComponent(e,"NO_UI",!1);return t?t.resolveNow(null,e=>e&&e.getModel()):null}destroyFilter(e,t="api"){const i=e.getColId(),s=this.allColumnFilters.get(i);this.disposeColumnListener(i),s&&(this.disposeFilterWrapper(s,t),this.onFilterChanged({columns:[e],source:"api"}))}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){e.filterPromise.then(i=>{(i.setModel(null)||Gs.resolve()).then(()=>{this.getContext().destroyBean(i),e.column.setFilterActive(!1,"filterDestroyed"),this.allColumnFilters.delete(e.column.getColId());const s={type:_e.EVENT_FILTER_DESTROYED,source:t,column:e.column};this.eventService.dispatchEvent(s)})})}checkDestroyFilter(e){const t=this.allColumnFilters.get(e);if(!t)return;const i=t.column,{compDetails:s}=i.isFilterAllowed()?this.createFilterInstance(i):{compDetails:null};this.areFilterCompsDifferent(t.compDetails,s)&&this.destroyFilter(i,"columnChanged")}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:i}=e,{componentClass:s}=t;return!(i===s||(null==i?void 0:i.render)&&(null==s?void 0:s.render)&&i.render===s.render)}getAdvancedFilterModel(){return this.isAdvancedFilterEnabled()?this.advancedFilterService.getModel():null}setAdvancedFilterModel(e){this.isAdvancedFilterEnabled()&&(this.advancedFilterService.setModel(null!=e?e:null),this.onFilterChanged({source:"advancedFilter"}))}showAdvancedFilterBuilder(e){this.isAdvancedFilterEnabled()&&this.advancedFilterService.getCtrl().toggleFilterBuilder(e,!0)}updateAdvancedFilterColumns(){this.isAdvancedFilterEnabled()&&this.advancedFilterService.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){if(this.isAdvancedFilterEnabled())return!1;const e=this.columnModel.getAllGridColumns();return!!e&&e.some(e=>e.getColDef().floatingFilter)}getFilterInstance(e,t){if(this.isAdvancedFilterEnabled())return void this.warnAdvancedFilters();const i=this.getFilterInstanceImpl(e,e=>{if(!t)return;const i=Sn(e);t(i)});return Sn(i)}getFilterInstanceImpl(e,t){const i=this.columnModel.getPrimaryColumn(e);if(!i)return;const s=this.getFilterComponent(i,"NO_UI"),o=s&&s.resolveNow(null,e=>e);return o?setTimeout(t,0,o):s&&s.then(e=>{t(e)}),o}warnAdvancedFilters(){T(()=>{console.warn("AG Grid: Column Filter API methods have been disabled as Advanced Filters are enabled.")},"advancedFiltersCompatibility")}setupAdvancedFilterHeaderComp(e){var t;null===(t=this.advancedFilterService)||void 0===t||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvancedFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvancedFilterHeaderActive()?this.advancedFilterService.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){this.filterModelUpdateQueue.forEach(e=>this.setFilterModel(e)),this.filterModelUpdateQueue=[]}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear()}};Dn([j("valueService")],On.prototype,"valueService",void 0),Dn([j("columnModel")],On.prototype,"columnModel",void 0),Dn([j("rowModel")],On.prototype,"rowModel",void 0),Dn([j("userComponentFactory")],On.prototype,"userComponentFactory",void 0),Dn([j("rowRenderer")],On.prototype,"rowRenderer",void 0),Dn([j("dataTypeService")],On.prototype,"dataTypeService",void 0),Dn([j("quickFilterService")],On.prototype,"quickFilterService",void 0),Dn([z("advancedFilterService")],On.prototype,"advancedFilterService",void 0),Dn([B],On.prototype,"init",null),On=Dn([U("filterManager")],On);class Pn extends js{constructor(e,t){super(e),this.ctrl=t}getCtrl(){return this.ctrl}}var An=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Fn extends Pn{constructor(e){super(Fn.TEMPLATE,e)}postConstruct(){const e=this.getGui(),t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),addOrRemoveBodyCssClass:(e,t)=>this.eFloatingFilterBody.classList.toggle(e,t),setButtonWrapperDisplayed:e=>Mi(this.eButtonWrapper,e),setCompDetails:e=>this.setCompDetails(e),getFloatingFilterComp:()=>this.compPromise,setWidth:t=>e.style.width=t,setMenuIcon:e=>this.eButtonShowMainFilter.appendChild(e)};this.ctrl.setComp(t,e,this.eButtonShowMainFilter,this.eFloatingFilterBody)}setCompDetails(e){if(!e)return this.destroyFloatingFilterComp(),void(this.compPromise=null);this.compPromise=e.newAgStackInstance(),this.compPromise.then(e=>this.afterCompCreated(e))}destroyFloatingFilterComp(){this.floatingFilterComp&&(this.eFloatingFilterBody.removeChild(this.floatingFilterComp.getGui()),this.floatingFilterComp=this.destroyBean(this.floatingFilterComp))}afterCompCreated(e){e&&(this.isAlive()?(this.destroyFloatingFilterComp(),this.floatingFilterComp=e,this.eFloatingFilterBody.appendChild(e.getGui()),e.afterGuiAttached&&e.afterGuiAttached()):this.destroyBean(e))}}Fn.TEMPLATE='<div class="ag-header-cell ag-floating-filter" role="gridcell" tabindex="-1">\n            <div ref="eFloatingFilterBody" role="presentation"></div>\n            <div class="ag-floating-filter-button ag-hidden" ref="eButtonWrapper" role="presentation">\n                <button type="button" class="ag-button ag-floating-filter-button-button" ref="eButtonShowMainFilter" tabindex="-1"></button>\n            </div>\n        </div>',An([Ks("eFloatingFilterBody")],Fn.prototype,"eFloatingFilterBody",void 0),An([Ks("eButtonWrapper")],Fn.prototype,"eButtonWrapper",void 0),An([Ks("eButtonShowMainFilter")],Fn.prototype,"eButtonShowMainFilter",void 0),An([B],Fn.prototype,"postConstruct",null),An([W],Fn.prototype,"destroyFloatingFilterComp",null);var Ln,In=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};!function(e){e.AUTO_HEIGHT="ag-layout-auto-height",e.NORMAL="ag-layout-normal",e.PRINT="ag-layout-print"}(Ln||(Ln={}));class Nn extends Le{constructor(e){super(),this.view=e}postConstruct(){this.addManagedPropertyListener("domLayout",this.updateLayoutClasses.bind(this)),this.updateLayoutClasses()}updateLayoutClasses(){const e=this.getDomLayout(),t={autoHeight:"autoHeight"===e,normal:"normal"===e,print:"print"===e},i=t.autoHeight?Ln.AUTO_HEIGHT:t.print?Ln.PRINT:Ln.NORMAL;this.view.updateLayoutClasses(i,t)}getDomLayout(){var e;const t=null!==(e=this.gridOptionsService.get("domLayout"))&&void 0!==e?e:"normal";return-1===["normal","print","autoHeight"].indexOf(t)?(T(()=>console.warn(`AG Grid: ${t} is not valid for DOM Layout, valid values are 'normal', 'autoHeight', 'print'.`),"warn about dom layout values"),"normal"):t}}In([B],Nn.prototype,"postConstruct",null);var Mn,Gn,xn=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};!function(e){e[e.Vertical=0]="Vertical",e[e.Horizontal=1]="Horizontal"}(Mn||(Mn={})),function(e){e[e.Container=0]="Container",e[e.FakeContainer=1]="FakeContainer"}(Gn||(Gn={}));class _n extends Le{constructor(e){super(),this.lastScrollSource=[null,null],this.scrollLeft=-1,this.nextScrollTop=-1,this.scrollTop=-1,this.eBodyViewport=e,this.resetLastHScrollDebounced=I(()=>this.lastScrollSource[Mn.Horizontal]=null,500),this.resetLastVScrollDebounced=I(()=>this.lastScrollSource[Mn.Vertical]=null,500)}postConstruct(){this.enableRtl=this.gridOptionsService.is("enableRtl"),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this)),this.ctrlsService.whenReady(e=>{this.centerRowContainerCtrl=e.centerRowContainerCtrl,this.onDisplayedColumnsWidthChanged(),this.addScrollListener()})}addScrollListener(){const e=this.ctrlsService.getFakeHScrollComp(),t=this.ctrlsService.getFakeVScrollComp();this.addManagedListener(this.centerRowContainerCtrl.getViewportElement(),"scroll",this.onHScroll.bind(this)),e.onScrollCallback(this.onFakeHScroll.bind(this));const i=this.gridOptionsService.is("debounceVerticalScrollbar"),s=i?I(this.onVScroll.bind(this),100):this.onVScroll.bind(this),o=i?I(this.onFakeVScroll.bind(this),100):this.onFakeVScroll.bind(this);this.addManagedListener(this.eBodyViewport,"scroll",s),t.onScrollCallback(o)}onDisplayedColumnsWidthChanged(){this.enableRtl&&this.horizontallyScrollHeaderCenterAndFloatingCenter()}horizontallyScrollHeaderCenterAndFloatingCenter(e){if(null==this.centerRowContainerCtrl)return;void 0===e&&(e=this.centerRowContainerCtrl.getCenterViewportScrollLeft());const t=this.enableRtl?e:-e,i=this.ctrlsService.getTopCenterRowContainerCtrl(),s=this.ctrlsService.getStickyTopCenterRowContainerCtrl(),o=this.ctrlsService.getBottomCenterRowContainerCtrl(),r=this.ctrlsService.getFakeHScrollComp();this.ctrlsService.getHeaderRowContainerCtrl().setHorizontalScroll(-t),o.setContainerTranslateX(t),i.setContainerTranslateX(t),s.setContainerTranslateX(t);const n=this.centerRowContainerCtrl.getViewportElement(),l=this.lastScrollSource[Mn.Horizontal]===Gn.Container;e=Math.abs(e),l?r.setScrollPosition(e):Ki(n,e,this.enableRtl)}isControllingScroll(e,t){return null==this.lastScrollSource[t]?(this.lastScrollSource[t]=e,!0):this.lastScrollSource[t]===e}onFakeHScroll(){this.isControllingScroll(Gn.FakeContainer,Mn.Horizontal)&&this.onHScrollCommon(Gn.FakeContainer)}onHScroll(){this.isControllingScroll(Gn.Container,Mn.Horizontal)&&this.onHScrollCommon(Gn.Container)}onHScrollCommon(e){const t=this.centerRowContainerCtrl.getViewportElement(),{scrollLeft:i}=t;if(this.shouldBlockScrollUpdate(Mn.Horizontal,i,!0))return;let s;s=e===Gn.Container?zi(t,this.enableRtl):this.ctrlsService.getFakeHScrollComp().getScrollPosition(),this.doHorizontalScroll(Math.round(s)),this.resetLastHScrollDebounced()}onFakeVScroll(){this.isControllingScroll(Gn.FakeContainer,Mn.Vertical)&&this.onVScrollCommon(Gn.FakeContainer)}onVScroll(){this.isControllingScroll(Gn.Container,Mn.Vertical)&&this.onVScrollCommon(Gn.Container)}onVScrollCommon(e){let t;t=e===Gn.Container?this.eBodyViewport.scrollTop:this.ctrlsService.getFakeVScrollComp().getScrollPosition(),this.shouldBlockScrollUpdate(Mn.Vertical,t,!0)||(this.animationFrameService.setScrollTop(t),this.nextScrollTop=t,e===Gn.Container?this.ctrlsService.getFakeVScrollComp().setScrollPosition(t):this.eBodyViewport.scrollTop=t,this.gridOptionsService.is("suppressAnimationFrame")?this.scrollGridIfNeeded():this.animationFrameService.schedule(),this.resetLastVScrollDebounced())}doHorizontalScroll(e){const t=this.ctrlsService.getFakeHScrollComp().getScrollPosition();this.scrollLeft===e&&e===t||(this.scrollLeft=e,this.fireScrollEvent(Mn.Horizontal),this.horizontallyScrollHeaderCenterAndFloatingCenter(e),this.centerRowContainerCtrl.onHorizontalViewportChanged(!0))}fireScrollEvent(e){const t={type:_e.EVENT_BODY_SCROLL,direction:e===Mn.Horizontal?"horizontal":"vertical",left:this.scrollLeft,top:this.scrollTop};this.eventService.dispatchEvent(t),window.clearTimeout(this.scrollTimer),this.scrollTimer=void 0,this.scrollTimer=window.setTimeout(()=>{const e=Object.assign(Object.assign({},t),{type:_e.EVENT_BODY_SCROLL_END});this.eventService.dispatchEvent(e)},100)}shouldBlockScrollUpdate(e,t,i=!1){return!(i&&!ci())&&(e===Mn.Vertical?this.shouldBlockVerticalScroll(t):this.shouldBlockHorizontalScroll(t))}shouldBlockVerticalScroll(e){const t=Hi(this.eBodyViewport),{scrollHeight:i}=this.eBodyViewport;return e<0||e+t>i}shouldBlockHorizontalScroll(e){const t=this.centerRowContainerCtrl.getCenterWidth(),{scrollWidth:i}=this.centerRowContainerCtrl.getViewportElement();if(this.enableRtl&&ji()){if(e>0)return!0}else if(e<0)return!0;return Math.abs(e)+t>i}redrawRowsAfterScroll(){this.fireScrollEvent(Mn.Vertical)}checkScrollLeft(){this.scrollLeft!==this.centerRowContainerCtrl.getCenterViewportScrollLeft()&&this.onHScrollCommon(Gn.Container)}scrollGridIfNeeded(){const e=this.scrollTop!=this.nextScrollTop;return e&&(this.scrollTop=this.nextScrollTop,this.redrawRowsAfterScroll()),e}setHorizontalScrollPosition(e,t=!1){const i=this.centerRowContainerCtrl.getViewportElement().scrollWidth-this.centerRowContainerCtrl.getCenterWidth();!t&&this.shouldBlockScrollUpdate(Mn.Horizontal,e)&&(e=this.enableRtl&&ji()?e>0?0:i:Math.min(Math.max(e,0),i)),Ki(this.centerRowContainerCtrl.getViewportElement(),Math.abs(e),this.enableRtl),this.doHorizontalScroll(e)}setVerticalScrollPosition(e){this.eBodyViewport.scrollTop=e}getVScrollPosition(){return{top:this.eBodyViewport.scrollTop,bottom:this.eBodyViewport.scrollTop+this.eBodyViewport.offsetHeight}}getHScrollPosition(){return this.centerRowContainerCtrl.getHScrollPosition()}isHorizontalScrollShowing(){return this.centerRowContainerCtrl.isHorizontalScrollShowing()}scrollHorizontally(e){const t=this.centerRowContainerCtrl.getViewportElement().scrollLeft;return this.setHorizontalScrollPosition(t+e),this.centerRowContainerCtrl.getViewportElement().scrollLeft-t}scrollToTop(){this.eBodyViewport.scrollTop=0}ensureNodeVisible(e,t=null){const i=this.rowModel.getRowCount();let s=-1;for(let t=0;t<i;t++){const i=this.rowModel.getRow(t);if("function"==typeof e){const o=e;if(i&&o(i)){s=t;break}}else if(e===i||e===i.data){s=t;break}}s>=0&&this.ensureIndexVisible(s,t)}ensureIndexVisible(e,t){if(this.gridOptionsService.isDomLayout("print"))return;const i=this.paginationProxy.getRowCount();if("number"!=typeof e||e<0||e>=i)return void console.warn("AG Grid: Invalid row index for ensureIndexVisible: "+e);this.gridOptionsService.is("pagination")&&!this.gridOptionsService.is("suppressPaginationPanel")||this.paginationProxy.goToPageWithIndex(e);const s=this.ctrlsService.getGridBodyCtrl().getStickyTopHeight(),o=this.paginationProxy.getRow(e);let r;do{const e=o.rowTop,i=o.rowHeight,n=this.paginationProxy.getPixelOffset(),l=o.rowTop-n,a=l+o.rowHeight,d=this.getVScrollPosition(),h=this.heightScaler.getDivStretchOffset(),c=d.top+h,u=d.bottom+h,p=u-c,g=this.heightScaler.getScrollPositionForPixel(l),m=this.heightScaler.getScrollPositionForPixel(a-p),C=Math.min((g+m)/2,l),v=c+s>l,f=u<a;let w=null;"top"===t?w=g:"bottom"===t?w=m:"middle"===t?w=C:v?w=g-s:f&&(w=m),null!==w&&(this.setVerticalScrollPosition(w),this.rowRenderer.redraw({afterScroll:!0})),r=e!==o.rowTop||i!==o.rowHeight}while(r);this.animationFrameService.flushAllFrames()}ensureColumnVisible(e,t="auto"){const i=this.columnModel.getGridColumn(e);if(!i)return;if(i.isPinned())return;if(!this.columnModel.isColumnDisplayed(i))return;const s=this.getPositionedHorizontalScroll(i,t);null!==s&&this.centerRowContainerCtrl.setCenterViewportScrollLeft(s),this.centerRowContainerCtrl.onHorizontalViewportChanged(),this.animationFrameService.flushAllFrames()}getPositionedHorizontalScroll(e,t){const{columnBeforeStart:i,columnAfterEnd:s}=this.isColumnOutsideViewport(e),o=this.centerRowContainerCtrl.getCenterWidth()<e.getActualWidth(),r=this.centerRowContainerCtrl.getCenterWidth(),n=this.enableRtl;let l=(n?i:s)||o,a=n?s:i;"auto"!==t&&(l="start"===t,a="end"===t);const d="middle"===t;if(l||a||d){const{colLeft:t,colMiddle:i,colRight:s}=this.getColumnBounds(e);return d?i-r/2:l?n?s:t:n?t-r:s-r}return null}isColumnOutsideViewport(e){const{start:t,end:i}=this.getViewportBounds(),{colLeft:s,colRight:o}=this.getColumnBounds(e),r=this.enableRtl;return{columnBeforeStart:r?t>o:i<o,columnAfterEnd:r?i<s:t>s}}getColumnBounds(e){const t=this.enableRtl,i=this.columnModel.getBodyContainerWidth(),s=e.getActualWidth(),o=e.getLeft(),r=t?-1:1,n=t?i-o:o;return{colLeft:n,colMiddle:n+s/2*r,colRight:n+s*r}}getViewportBounds(){const e=this.centerRowContainerCtrl.getCenterWidth(),t=this.centerRowContainerCtrl.getCenterViewportScrollLeft();return{start:t,end:e+t,width:e}}}xn([j("ctrlsService")],_n.prototype,"ctrlsService",void 0),xn([j("animationFrameService")],_n.prototype,"animationFrameService",void 0),xn([j("paginationProxy")],_n.prototype,"paginationProxy",void 0),xn([j("rowModel")],_n.prototype,"rowModel",void 0),xn([j("rowContainerHeightService")],_n.prototype,"heightScaler",void 0),xn([j("rowRenderer")],_n.prototype,"rowRenderer",void 0),xn([j("columnModel")],_n.prototype,"columnModel",void 0),xn([B],_n.prototype,"postConstruct",null);var Vn=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Hn extends Le{constructor(e){super(),this.isMultiRowDrag=!1,this.isGridSorted=!1,this.isGridFiltered=!1,this.isRowGroupActive=!1,this.eContainer=e}postConstruct(){this.gridOptionsService.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel);const e=()=>{this.onSortChanged(),this.onFilterChanged(),this.onRowGroupChanged()};this.addManagedListener(this.eventService,_e.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_MODEL_UPDATED,()=>{e()}),e(),this.ctrlsService.whenReady(()=>{const e=this.ctrlsService.getGridBodyCtrl();this.autoScrollService=new gn({scrollContainer:e.getBodyViewportElement(),scrollAxis:"y",getVerticalPosition:()=>e.getScrollFeature().getVScrollPosition().top,setVerticalPosition:t=>e.getScrollFeature().setVerticalScrollPosition(t),onScrollCallback:()=>{this.onDragging(this.lastDraggingEvent)}})})}onSortChanged(){this.isGridSorted=this.sortController.isSortActive()}onFilterChanged(){this.isGridFiltered=this.filterManager.isAnyFilterPresent()}onRowGroupChanged(){const e=this.columnModel.getRowGroupColumns();this.isRowGroupActive=!s(e)}getContainer(){return this.eContainer}isInterestedIn(e){return e===ur.RowDrag}getIconName(){return this.gridOptionsService.is("rowDragManaged")&&this.shouldPreventRowMove()?Cr.ICON_NOT_ALLOWED:Cr.ICON_MOVE}shouldPreventRowMove(){return this.isGridSorted||this.isGridFiltered||this.isRowGroupActive}getRowNodes(e){if(!this.isFromThisGrid(e))return e.dragItem.rowNodes||[];const t=this.gridOptionsService.is("rowDragMultiRow"),i=[...this.selectionService.getSelectedNodes()].sort((e,t)=>null==e.rowIndex||null==t.rowIndex?0:this.getRowIndexNumber(e)-this.getRowIndexNumber(t)),s=e.dragItem.rowNode;return t&&-1!==i.indexOf(s)?(this.isMultiRowDrag=!0,i):(this.isMultiRowDrag=!1,[s])}onDragEnter(e){e.dragItem.rowNodes=this.getRowNodes(e),this.dispatchGridEvent(_e.EVENT_ROW_DRAG_ENTER,e),this.getRowNodes(e).forEach(e=>{e.setDragging(!0)}),this.onEnterOrDragging(e)}onDragging(e){this.onEnterOrDragging(e)}isFromThisGrid(e){const{dragSourceDomDataKey:t}=e.dragSource;return t===this.gridOptionsService.getDomDataKey()}isDropZoneWithinThisGrid(e){const t=this.ctrlsService.getGridBodyCtrl().getGui(),{dropZoneTarget:i}=e;return!t.contains(i)}onEnterOrDragging(e){this.dispatchGridEvent(_e.EVENT_ROW_DRAG_MOVE,e),this.lastDraggingEvent=e;const t=this.mouseEventService.getNormalisedPosition(e).y;this.gridOptionsService.is("rowDragManaged")&&this.doManagedDrag(e,t),this.autoScrollService.check(e.event)}doManagedDrag(e,t){const i=this.isFromThisGrid(e),s=this.gridOptionsService.is("rowDragManaged"),o=e.dragItem.rowNodes;s&&this.shouldPreventRowMove()||(this.gridOptionsService.is("suppressMoveWhenRowDragging")||!i?this.isDropZoneWithinThisGrid(e)||this.clientSideRowModel.highlightRowAtPixel(o[0],t):this.moveRows(o,t))}getRowIndexNumber(e){return parseInt(ne(e.getRowIndexString().split("-")),10)}moveRowAndClearHighlight(e){const t=this.clientSideRowModel.getLastHighlightedRowNode(),i=t&&t.highlighted===fn.Below,s=this.mouseEventService.getNormalisedPosition(e).y,o=e.dragItem.rowNodes;let r=i?1:0;if(this.isFromThisGrid(e))o.forEach(e=>{e.rowTop<s&&(r-=1)}),this.moveRows(o,s,r);else{const e=this.gridOptionsService.getCallback("getRowId");let t=this.clientSideRowModel.getRowIndexAtPixel(s)+1;this.clientSideRowModel.getHighlightPosition(s)===fn.Above&&t--,this.clientSideRowModel.updateRowData({add:o.map(e=>e.data).filter(t=>!this.clientSideRowModel.getRowNode(e?e({data:t,level:0}):t.id)),addIndex:t})}this.clearRowHighlight()}clearRowHighlight(){this.clientSideRowModel.highlightRowAtPixel(null)}moveRows(e,t,i=0){this.clientSideRowModel.ensureRowsAtPixel(e,t,i)&&(this.focusService.clearFocusedCell(),this.rangeService&&this.rangeService.removeAllCellRanges())}addRowDropZone(e){if(!e.getContainer())return void T(()=>console.warn("AG Grid: addRowDropZone - A container target needs to be provided"),"add-drop-zone-empty-target");if(this.dragAndDropService.findExternalZone(e))return void console.warn("AG Grid: addRowDropZone - target already exists in the list of DropZones. Use `removeRowDropZone` before adding it again.");let t={getContainer:e.getContainer};e.fromGrid?(e.fromGrid=void 0,t=e):(e.onDragEnter&&(t.onDragEnter=t=>{e.onDragEnter(this.draggingToRowDragEvent(_e.EVENT_ROW_DRAG_ENTER,t))}),e.onDragLeave&&(t.onDragLeave=t=>{e.onDragLeave(this.draggingToRowDragEvent(_e.EVENT_ROW_DRAG_LEAVE,t))}),e.onDragging&&(t.onDragging=t=>{e.onDragging(this.draggingToRowDragEvent(_e.EVENT_ROW_DRAG_MOVE,t))}),e.onDragStop&&(t.onDragStop=t=>{e.onDragStop(this.draggingToRowDragEvent(_e.EVENT_ROW_DRAG_END,t))})),this.dragAndDropService.addDropTarget(Object.assign({isInterestedIn:e=>e===ur.RowDrag,getIconName:()=>Cr.ICON_MOVE,external:!0},t))}getRowDropZone(e){const t=this.getContainer.bind(this),i=this.onDragEnter.bind(this),s=this.onDragLeave.bind(this),o=this.onDragging.bind(this),r=this.onDragStop.bind(this);return e?{getContainer:t,onDragEnter:e.onDragEnter?t=>{i(t),e.onDragEnter(this.draggingToRowDragEvent(_e.EVENT_ROW_DRAG_ENTER,t))}:i,onDragLeave:e.onDragLeave?t=>{s(t),e.onDragLeave(this.draggingToRowDragEvent(_e.EVENT_ROW_DRAG_LEAVE,t))}:s,onDragging:e.onDragging?t=>{o(t),e.onDragging(this.draggingToRowDragEvent(_e.EVENT_ROW_DRAG_MOVE,t))}:o,onDragStop:e.onDragStop?t=>{r(t),e.onDragStop(this.draggingToRowDragEvent(_e.EVENT_ROW_DRAG_END,t))}:r,fromGrid:!0}:{getContainer:t,onDragEnter:i,onDragLeave:s,onDragging:o,onDragStop:r,fromGrid:!0}}draggingToRowDragEvent(e,t){const i=this.mouseEventService.getNormalisedPosition(t).y;let s,o,r=-1;switch(i>this.paginationProxy.getCurrentPageHeight()||(r=this.rowModel.getRowIndexAtPixel(i),s=this.rowModel.getRow(r)),t.vDirection){case pr.Down:o="down";break;case pr.Up:o="up";break;default:o=null}return{type:e,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context,event:t.event,node:t.dragItem.rowNode,nodes:t.dragItem.rowNodes,overIndex:r,overNode:s,y:i,vDirection:o}}dispatchGridEvent(e,t){const i=this.draggingToRowDragEvent(e,t);this.eventService.dispatchEvent(i)}onDragLeave(e){this.dispatchGridEvent(_e.EVENT_ROW_DRAG_LEAVE,e),this.stopDragging(e),this.gridOptionsService.is("rowDragManaged")&&this.clearRowHighlight(),this.isFromThisGrid(e)&&(this.isMultiRowDrag=!1)}onDragStop(e){this.dispatchGridEvent(_e.EVENT_ROW_DRAG_END,e),this.stopDragging(e),!this.gridOptionsService.is("rowDragManaged")||!this.gridOptionsService.is("suppressMoveWhenRowDragging")&&this.isFromThisGrid(e)||this.isDropZoneWithinThisGrid(e)||this.moveRowAndClearHighlight(e)}stopDragging(e){this.autoScrollService.ensureCleared(),this.getRowNodes(e).forEach(e=>{e.setDragging(!1)})}}Vn([j("dragAndDropService")],Hn.prototype,"dragAndDropService",void 0),Vn([j("rowModel")],Hn.prototype,"rowModel",void 0),Vn([j("paginationProxy")],Hn.prototype,"paginationProxy",void 0),Vn([j("columnModel")],Hn.prototype,"columnModel",void 0),Vn([j("focusService")],Hn.prototype,"focusService",void 0),Vn([j("sortController")],Hn.prototype,"sortController",void 0),Vn([j("filterManager")],Hn.prototype,"filterManager",void 0),Vn([j("selectionService")],Hn.prototype,"selectionService",void 0),Vn([j("mouseEventService")],Hn.prototype,"mouseEventService",void 0),Vn([j("ctrlsService")],Hn.prototype,"ctrlsService",void 0),Vn([z("rangeService")],Hn.prototype,"rangeService",void 0),Vn([B],Hn.prototype,"postConstruct",null);var kn,Bn=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};!function(e){e.ANIMATION_ON="ag-row-animation",e.ANIMATION_OFF="ag-row-no-animation"}(kn||(kn={}));class Wn extends Le{constructor(){super(...arguments),this.stickyTopHeight=0}getScrollFeature(){return this.bodyScrollFeature}getBodyViewportElement(){return this.eBodyViewport}setComp(e,t,i,s,o,r){this.comp=e,this.eGridBody=t,this.eBodyViewport=i,this.eTop=s,this.eBottom=o,this.eStickyTop=r,this.setCellTextSelection(this.gridOptionsService.is("enableCellTextSelection")),this.createManagedBean(new Nn(this.comp)),this.bodyScrollFeature=this.createManagedBean(new _n(this.eBodyViewport)),this.addRowDragListener(),this.setupRowAnimationCssClass(),this.addEventListeners(),this.addFocusListeners([s,i,o,r]),this.onGridColumnsChanged(),this.addBodyViewportListener(),this.setFloatingHeights(),this.disableBrowserDragging(),this.addStopEditingWhenGridLosesFocus(),this.filterManager.setupAdvancedFilterHeaderComp(s),this.ctrlsService.registerGridBodyCtrl(this)}getComp(){return this.comp}addEventListeners(){this.addManagedListener(this.eventService,_e.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this))}addFocusListeners(e){e.forEach(e=>{this.addManagedListener(e,"focusin",t=>{const{target:i}=t,s=_i(i,"ag-root",e);e.classList.toggle("ag-has-focus",!s)}),this.addManagedListener(e,"focusout",t=>{const{target:i,relatedTarget:s}=t,o=e.contains(s),r=_i(s,"ag-root",e);_i(i,"ag-root",e)||o&&!r||e.classList.remove("ag-has-focus")})})}setColumnMovingCss(e){this.comp.setColumnMovingCss("ag-column-moving",e)}setCellTextSelection(e=!1){this.comp.setCellSelectableCss("ag-selectable",e)}onScrollVisibilityChanged(){const e=this.scrollVisibleService.isVerticalScrollShowing();this.setVerticalScrollPaddingVisible(e),this.setStickyTopWidth(e);const t=`calc(100% + ${(e&&this.gridOptionsService.getScrollbarWidth()||0)+(wi()?16:0)}px)`;this.animationFrameService.requestAnimationFrame(()=>this.comp.setBodyViewportWidth(t))}onGridColumnsChanged(){const e=this.columnModel.getAllGridColumns();this.comp.setColumnCount(e?e.length:0)}disableBrowserDragging(){this.addManagedListener(this.eGridBody,"dragstart",e=>{if(e.target instanceof HTMLImageElement)return e.preventDefault(),!1})}addStopEditingWhenGridLosesFocus(){if(!this.gridOptionsService.is("stopEditingWhenCellsLoseFocus"))return;const e=e=>{const i=e.relatedTarget;if(null===pi(i))return void this.rowRenderer.stopEditing();let s=t.some(e=>e.contains(i))&&this.mouseEventService.isElementInThisGrid(i);if(!s){const e=this.popupService;s=e.getActivePopups().some(e=>e.contains(i))||e.isElementWithinCustomPopup(i)}s||this.rowRenderer.stopEditing()},t=[this.eBodyViewport,this.eBottom,this.eTop,this.eStickyTop];t.forEach(t=>this.addManagedListener(t,"focusout",e))}updateRowCount(){const e=this.headerNavigationService.getHeaderRowCount()+this.filterManager.getHeaderRowCount(),t=this.rowModel.isLastRowIndexKnown()?this.rowModel.getRowCount():-1,i=-1===t?-1:e+t;this.comp.setRowCount(i)}registerBodyViewportResizeListener(e){this.comp.registerBodyViewportResizeListener(e)}setVerticalScrollPaddingVisible(e){const t=e?"scroll":"hidden";this.comp.setPinnedTopBottomOverflowY(t)}isVerticalScrollShowing(){const e=this.gridOptionsService.is("alwaysShowVerticalScroll"),t=e?"ag-force-vertical-scroll":null,i=this.gridOptionsService.isDomLayout("normal");return this.comp.setAlwaysVerticalScrollClass(t,e),e||i&&os(this.eBodyViewport)}setupRowAnimationCssClass(){const e=()=>{const e=this.gridOptionsService.isAnimateRows()&&!this.rowContainerHeightService.isStretching(),t=e?kn.ANIMATION_ON:kn.ANIMATION_OFF;this.comp.setRowAnimationCssOnBodyViewport(t,e)};e(),this.addManagedListener(this.eventService,_e.EVENT_HEIGHT_SCALE_CHANGED,e),this.addManagedPropertyListener("animateRows",e)}getGridBodyElement(){return this.eGridBody}addBodyViewportListener(){const e=this.onBodyViewportContextMenu.bind(this);this.addManagedListener(this.eBodyViewport,"contextmenu",e),this.mockContextMenuForIPad(e),this.addManagedListener(this.eBodyViewport,"wheel",this.onBodyViewportWheel.bind(this)),this.addManagedListener(this.eStickyTop,"wheel",this.onStickyTopWheel.bind(this)),this.addFullWidthContainerWheelListener()}addFullWidthContainerWheelListener(){const e=this.eBodyViewport.querySelector(".ag-full-width-container"),t=this.eBodyViewport.querySelector(".ag-center-cols-viewport");e&&t&&this.addManagedListener(e,"wheel",e=>this.onFullWidthContainerWheel(e,t))}onFullWidthContainerWheel(e,t){!e.deltaX||Math.abs(e.deltaY)>Math.abs(e.deltaX)||!this.mouseEventService.isEventFromThisGrid(e)||(e.preventDefault(),t.scrollBy({left:e.deltaX}))}onBodyViewportContextMenu(e,t,i){if(!e&&!i)return;if(this.gridOptionsService.is("preventDefaultOnContextMenu")){(e||i).preventDefault()}const{target:s}=e||t;if(s===this.eBodyViewport||s===this.ctrlsService.getCenterRowContainerCtrl().getViewportElement()){if(!this.contextMenuFactory)return;e?this.contextMenuFactory.onContextMenu(e,null,null,null,null,this.eGridBody):i&&this.contextMenuFactory.onContextMenu(null,i,null,null,null,this.eGridBody)}}mockContextMenuForIPad(e){if(!ci())return;const t=new Wo(this.eBodyViewport);this.addManagedListener(t,Wo.EVENT_LONG_TAP,t=>{e(void 0,t.touchStart,t.touchEvent)}),this.addDestroyFunc(()=>t.destroy())}onBodyViewportWheel(e){this.gridOptionsService.is("suppressScrollWhenPopupsAreOpen")&&this.popupService.hasAnchoredPopup()&&e.preventDefault()}onStickyTopWheel(e){e.preventDefault(),e.offsetY&&this.scrollVertically(e.deltaY)}getGui(){return this.eGridBody}scrollVertically(e){const t=this.eBodyViewport.scrollTop;return this.bodyScrollFeature.setVerticalScrollPosition(t+e),this.eBodyViewport.scrollTop-t}addRowDragListener(){this.rowDragFeature=this.createManagedBean(new Hn(this.eBodyViewport)),this.dragAndDropService.addDropTarget(this.rowDragFeature)}getRowDragFeature(){return this.rowDragFeature}onPinnedRowDataChanged(){this.setFloatingHeights()}setFloatingHeights(){const{pinnedRowModel:e}=this;let t=e.getPinnedTopTotalHeight();t&&(t+=1);let i=e.getPinnedBottomTotalHeight();i&&(i+=1),this.comp.setTopHeight(t),this.comp.setBottomHeight(i),this.comp.setTopDisplay(t?"inherit":"none"),this.comp.setBottomDisplay(i?"inherit":"none"),this.setStickyTopOffsetTop()}setStickyTopHeight(e=0){this.comp.setStickyTopHeight(e+"px"),this.stickyTopHeight=e}getStickyTopHeight(){return this.stickyTopHeight}setStickyTopWidth(e){if(e){const e=this.gridOptionsService.getScrollbarWidth();this.comp.setStickyTopWidth(`calc(100% - ${e}px)`)}else this.comp.setStickyTopWidth("100%")}onHeaderHeightChanged(){this.setStickyTopOffsetTop()}setStickyTopOffsetTop(){const e=this.ctrlsService.getGridHeaderCtrl().getHeaderHeight()+this.filterManager.getHeaderHeight(),t=this.pinnedRowModel.getPinnedTopTotalHeight();let i=0;e>0&&(i+=e+1),t>0&&(i+=t+1),this.comp.setStickyTopTop(i+"px")}sizeColumnsToFit(e,t){const i=this.isVerticalScrollShowing()?this.gridOptionsService.getScrollbarWidth():0,s=ki(this.eGridBody)-i;s>0?this.columnModel.sizeColumnsToFit(s,"sizeColumnsToFit",!1,e):void 0===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,100)},0):100===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,500)},100):500===t?window.setTimeout(()=>{this.sizeColumnsToFit(e,-1)},500):console.warn("AG Grid: tried to call sizeColumnsToFit() but the grid is coming back with zero width, maybe the grid is not visible yet on the screen?")}addScrollEventListener(e){this.eBodyViewport.addEventListener("scroll",e,{passive:!0})}removeScrollEventListener(e){this.eBodyViewport.removeEventListener("scroll",e)}}var Un,jn;Bn([j("animationFrameService")],Wn.prototype,"animationFrameService",void 0),Bn([j("rowContainerHeightService")],Wn.prototype,"rowContainerHeightService",void 0),Bn([j("ctrlsService")],Wn.prototype,"ctrlsService",void 0),Bn([j("columnModel")],Wn.prototype,"columnModel",void 0),Bn([j("scrollVisibleService")],Wn.prototype,"scrollVisibleService",void 0),Bn([z("contextMenuFactory")],Wn.prototype,"contextMenuFactory",void 0),Bn([j("headerNavigationService")],Wn.prototype,"headerNavigationService",void 0),Bn([j("dragAndDropService")],Wn.prototype,"dragAndDropService",void 0),Bn([j("pinnedRowModel")],Wn.prototype,"pinnedRowModel",void 0),Bn([j("rowRenderer")],Wn.prototype,"rowRenderer",void 0),Bn([j("popupService")],Wn.prototype,"popupService",void 0),Bn([j("mouseEventService")],Wn.prototype,"mouseEventService",void 0),Bn([j("rowModel")],Wn.prototype,"rowModel",void 0),Bn([j("filterManager")],Wn.prototype,"filterManager",void 0),function(e){e[e.FILL=0]="FILL",e[e.RANGE=1]="RANGE"}(Un||(Un={})),function(e){e[e.VALUE=0]="VALUE",e[e.DIMENSION=1]="DIMENSION"}(jn||(jn={}));class zn{constructor(e,t){this.beans=e,this.cellCtrl=t}setComp(e,t){this.cellComp=e,this.eGui=t,this.onRangeSelectionChanged()}onRangeSelectionChanged(){this.cellComp&&(this.rangeCount=this.beans.rangeService.getCellRangeCount(this.cellCtrl.getCellPosition()),this.hasChartRange=this.getHasChartRange(),this.cellComp.addOrRemoveCssClass("ag-cell-range-selected",0!==this.rangeCount),this.cellComp.addOrRemoveCssClass("ag-cell-range-selected-1",1===this.rangeCount),this.cellComp.addOrRemoveCssClass("ag-cell-range-selected-2",2===this.rangeCount),this.cellComp.addOrRemoveCssClass("ag-cell-range-selected-3",3===this.rangeCount),this.cellComp.addOrRemoveCssClass("ag-cell-range-selected-4",this.rangeCount>=4),this.cellComp.addOrRemoveCssClass("ag-cell-range-chart",this.hasChartRange),Yt(this.eGui,this.rangeCount>0||void 0),this.cellComp.addOrRemoveCssClass("ag-cell-range-single-cell",this.isSingleCell()),this.updateRangeBorders(),this.refreshHandle())}updateRangeBorders(){const e=this.getRangeBorders(),t=this.isSingleCell(),i=!t&&e.top,s=!t&&e.right,o=!t&&e.bottom,r=!t&&e.left;this.cellComp.addOrRemoveCssClass("ag-cell-range-top",i),this.cellComp.addOrRemoveCssClass("ag-cell-range-right",s),this.cellComp.addOrRemoveCssClass("ag-cell-range-bottom",o),this.cellComp.addOrRemoveCssClass("ag-cell-range-left",r)}isSingleCell(){const{rangeService:e}=this.beans;return 1===this.rangeCount&&e&&!e.isMoreThanOneCell()}getHasChartRange(){const{rangeService:e}=this.beans;if(!this.rangeCount||!e)return!1;const t=e.getCellRanges();return t.length>0&&t.every(e=>me([jn.DIMENSION,jn.VALUE],e.type))}updateRangeBordersIfRangeCount(){this.rangeCount>0&&(this.updateRangeBorders(),this.refreshHandle())}getRangeBorders(){const e=this.beans.gridOptionsService.is("enableRtl");let t=!1,i=!1,s=!1,o=!1;const r=this.cellCtrl.getCellPosition().column,{rangeService:n,columnModel:l}=this.beans;let a,d;e?(a=l.getDisplayedColAfter(r),d=l.getDisplayedColBefore(r)):(a=l.getDisplayedColBefore(r),d=l.getDisplayedColAfter(r));const h=n.getCellRanges().filter(e=>n.isCellInSpecificRange(this.cellCtrl.getCellPosition(),e));a||(o=!0),d||(i=!0);for(let e=0;e<h.length&&!(t&&i&&s&&o);e++){const r=h[e],l=n.getRangeStartRow(r),c=n.getRangeEndRow(r);!t&&this.beans.rowPositionUtils.sameRow(l,this.cellCtrl.getCellPosition())&&(t=!0),!s&&this.beans.rowPositionUtils.sameRow(c,this.cellCtrl.getCellPosition())&&(s=!0),!o&&a&&r.columns.indexOf(a)<0&&(o=!0),!i&&d&&r.columns.indexOf(d)<0&&(i=!0)}return{top:t,right:i,bottom:s,left:o}}refreshHandle(){if(!this.beans.rangeService)return;const e=this.shouldHaveSelectionHandle();this.selectionHandle&&!e&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),e&&this.addSelectionHandle(),this.cellComp.addOrRemoveCssClass("ag-cell-range-handle",!!this.selectionHandle)}shouldHaveSelectionHandle(){const{gridOptionsService:e,rangeService:t}=this.beans,i=t.getCellRanges(),s=i.length;if(this.rangeCount<1||s<1)return!1;const o=ne(i),r=this.cellCtrl.getCellPosition(),n=e.is("enableFillHandle")&&!this.cellCtrl.isSuppressFillHandle(),l=e.is("enableRangeHandle");let a=1===s&&!this.cellCtrl.isEditing()&&(n||l);if(this.hasChartRange){const e=i[0].type===jn.DIMENSION&&t.isCellInSpecificRange(r,i[0]);this.cellComp.addOrRemoveCssClass("ag-cell-range-chart-category",e),a=o.type===jn.VALUE}return a&&null!=o.endRow&&t.isContiguousRange(o)&&t.isBottomRightCell(o,r)}addSelectionHandle(){const{gridOptionsService:e,rangeService:t}=this.beans,s=ne(t.getCellRanges()).type,o=e.is("enableFillHandle")&&i(s)?Un.FILL:Un.RANGE;this.selectionHandle&&this.selectionHandle.getType()!==o&&(this.selectionHandle=this.beans.context.destroyBean(this.selectionHandle)),this.selectionHandle||(this.selectionHandle=this.beans.selectionHandleFactory.createSelectionHandle(o)),this.selectionHandle.refresh(this.cellCtrl)}destroy(){this.beans.context.destroyBean(this.selectionHandle)}}class Kn extends Le{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode(),this.setupColSpan(),this.setupRowSpan()}setupRowSpan(){this.rowSpan=this.column.getRowSpan(this.rowNode)}setComp(e){this.eGui=e,this.onLeftChanged(),this.onWidthChanged(),this.applyRowSpan()}onDisplayColumnsChanged(){const e=this.getColSpanningList();le(this.colsSpanning,e)||(this.colsSpanning=e,this.onWidthChanged(),this.onLeftChanged())}setupColSpan(){null!=this.column.getColDef().colSpan&&(this.colsSpanning=this.getColSpanningList(),this.addManagedListener(this.beans.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayColumnsChanged.bind(this)),this.addManagedListener(this.beans.eventService,_e.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onWidthChanged.bind(this)))}onWidthChanged(){if(!this.eGui)return;const e=this.getCellWidth();this.eGui.style.width=e+"px"}getCellWidth(){return this.colsSpanning?this.colsSpanning.reduce((e,t)=>e+t.getActualWidth(),0):this.column.getActualWidth()}getColSpanningList(){const e=this.column.getColSpan(this.rowNode),t=[];if(1===e)t.push(this.column);else{let s=this.column;const o=this.column.getPinned();for(let r=0;s&&r<e&&(t.push(s),s=this.beans.columnModel.getDisplayedColAfter(s),s&&!i(s))&&o===s.getPinned();r++);}return t}onLeftChanged(){if(!this.eGui)return;const e=this.modifyLeftForPrintLayout(this.getCellLeft());this.eGui.style.left=e+"px"}getCellLeft(){let e;return e=this.beans.gridOptionsService.is("enableRtl")&&this.colsSpanning?ne(this.colsSpanning):this.column,e.getLeft()}modifyLeftForPrintLayout(e){if(!this.cellCtrl.isPrintLayout()||"left"===this.column.getPinned())return e;const t=this.beans.columnModel.getDisplayedColumnsLeftWidth();if("right"===this.column.getPinned()){return t+this.beans.columnModel.getBodyContainerWidth()+(e||0)}return t+(e||0)}applyRowSpan(){if(1===this.rowSpan)return;const e=this.beans.gridOptionsService.getRowHeightAsNumber()*this.rowSpan;this.eGui.style.height=e+"px",this.eGui.style.zIndex="1"}destroy(){super.destroy()}}class Yn extends Le{constructor(e,t){super(),this.staticClasses=[],this.cellCtrl=e,this.beans=t,this.column=e.getColumn(),this.rowNode=e.getRowNode()}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const e=this.column.getColDef(),t={value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,colDef:e,column:this.column,rowIndex:this.rowNode.rowIndex,api:this.beans.gridOptionsService.api,columnApi:this.beans.gridOptionsService.columnApi,context:this.beans.gridOptionsService.context};this.beans.stylingService.processClassRules(e.cellClassRules,t,e=>this.cellComp.addOrRemoveCssClass(e,!0),e=>this.cellComp.addOrRemoveCssClass(e,!1))}applyUserStyles(){const e=this.column.getColDef();if(!e.cellStyle)return;let t;if("function"==typeof e.cellStyle){const i={column:this.column,value:this.cellCtrl.getValue(),colDef:e,data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex,api:this.beans.gridOptionsService.api,columnApi:this.beans.gridOptionsService.columnApi,context:this.beans.gridOptionsService.context};t=(0,e.cellStyle)(i)}else t=e.cellStyle;t&&this.cellComp.setUserStyles(t)}applyClassesFromColDef(){const e=this.column.getColDef(),t={value:this.cellCtrl.getValue(),data:this.rowNode.data,node:this.rowNode,column:this.column,colDef:e,rowIndex:this.rowNode.rowIndex,api:this.beans.gridOptionsService.api,columnApi:this.beans.gridOptionsService.columnApi,context:this.beans.gridOptionsService.context};this.staticClasses.length&&this.staticClasses.forEach(e=>this.cellComp.addOrRemoveCssClass(e,!1)),this.staticClasses=this.beans.stylingService.getStaticCellClasses(e,t),this.staticClasses.length&&this.staticClasses.forEach(e=>this.cellComp.addOrRemoveCssClass(e,!0))}destroy(){super.destroy()}}class $n extends Le{constructor(e,t){super(),this.ctrl=e,this.beans=t}setComp(e){this.eGui=e,this.setupTooltip()}setBrowserTooltip(e){null!=e&&""!=e?this.eGui.setAttribute("title",e):this.eGui.removeAttribute("title")}setupTooltip(){this.browserTooltips=this.beans.gridOptionsService.is("enableBrowserTooltips"),this.updateTooltipText(),this.browserTooltips?this.setBrowserTooltip(this.tooltip):this.createTooltipFeatureIfNeeded()}updateTooltipText(){this.tooltip=this.ctrl.getTooltipValue()}createTooltipFeatureIfNeeded(){var e,t,i,s;if(null!=this.genericTooltipFeature)return;const o={getTooltipParams:()=>this.getTooltipParams(),getGui:()=>this.ctrl.getGui()};this.genericTooltipFeature=this.createManagedBean(new ks(o,null===(t=(e=this.ctrl).getTooltipShowDelayOverride)||void 0===t?void 0:t.call(e),null===(s=(i=this.ctrl).getTooltipHideDelayOverride)||void 0===s?void 0:s.call(i)),this.beans.context)}refreshToolTip(){this.updateTooltipText(),this.browserTooltips&&this.setBrowserTooltip(this.tooltip)}getTooltipParams(){const e=this.ctrl,t=e.getColumn?e.getColumn():void 0,i=e.getColDef?e.getColDef():void 0,s=e.getRowNode?e.getRowNode():void 0;return{location:e.getLocation(),colDef:i,column:t,rowIndex:e.getRowIndex?e.getRowIndex():void 0,node:s,data:s?s.data:void 0,value:this.getTooltipText(),valueFormatted:e.getValueFormatted?e.getValueFormatted():void 0,hideTooltipCallback:()=>this.genericTooltipFeature.hideTooltip(!0)}}getTooltipText(){return this.tooltip}destroy(){super.destroy()}}var qn=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Qn=class{postConstruct(){this.doingMasterDetail=this.gridOptionsService.is("masterDetail"),this.gridOptionsService.isRowModelType("clientSide")&&(this.clientSideRowModel=this.rowModel),this.gridOptionsService.isRowModelType("serverSide")&&(this.serverSideRowModel=this.rowModel)}};qn([j("resizeObserverService")],Qn.prototype,"resizeObserverService",void 0),qn([j("paginationProxy")],Qn.prototype,"paginationProxy",void 0),qn([j("context")],Qn.prototype,"context",void 0),qn([j("columnApi")],Qn.prototype,"columnApi",void 0),qn([j("gridApi")],Qn.prototype,"gridApi",void 0),qn([j("gridOptionsService")],Qn.prototype,"gridOptionsService",void 0),qn([j("expressionService")],Qn.prototype,"expressionService",void 0),qn([j("environment")],Qn.prototype,"environment",void 0),qn([j("rowRenderer")],Qn.prototype,"rowRenderer",void 0),qn([j("templateService")],Qn.prototype,"templateService",void 0),qn([j("valueService")],Qn.prototype,"valueService",void 0),qn([j("eventService")],Qn.prototype,"eventService",void 0),qn([j("columnModel")],Qn.prototype,"columnModel",void 0),qn([j("headerNavigationService")],Qn.prototype,"headerNavigationService",void 0),qn([j("navigationService")],Qn.prototype,"navigationService",void 0),qn([j("columnAnimationService")],Qn.prototype,"columnAnimationService",void 0),qn([z("rangeService")],Qn.prototype,"rangeService",void 0),qn([j("focusService")],Qn.prototype,"focusService",void 0),qn([z("contextMenuFactory")],Qn.prototype,"contextMenuFactory",void 0),qn([j("popupService")],Qn.prototype,"popupService",void 0),qn([j("valueFormatterService")],Qn.prototype,"valueFormatterService",void 0),qn([j("stylingService")],Qn.prototype,"stylingService",void 0),qn([j("columnHoverService")],Qn.prototype,"columnHoverService",void 0),qn([j("userComponentFactory")],Qn.prototype,"userComponentFactory",void 0),qn([j("userComponentRegistry")],Qn.prototype,"userComponentRegistry",void 0),qn([j("animationFrameService")],Qn.prototype,"animationFrameService",void 0),qn([j("dragService")],Qn.prototype,"dragService",void 0),qn([j("dragAndDropService")],Qn.prototype,"dragAndDropService",void 0),qn([j("sortController")],Qn.prototype,"sortController",void 0),qn([j("filterManager")],Qn.prototype,"filterManager",void 0),qn([j("rowContainerHeightService")],Qn.prototype,"rowContainerHeightService",void 0),qn([j("frameworkOverrides")],Qn.prototype,"frameworkOverrides",void 0),qn([j("cellPositionUtils")],Qn.prototype,"cellPositionUtils",void 0),qn([j("rowPositionUtils")],Qn.prototype,"rowPositionUtils",void 0),qn([j("selectionService")],Qn.prototype,"selectionService",void 0),qn([z("selectionHandleFactory")],Qn.prototype,"selectionHandleFactory",void 0),qn([j("rowCssClassCalculator")],Qn.prototype,"rowCssClassCalculator",void 0),qn([j("rowModel")],Qn.prototype,"rowModel",void 0),qn([j("ctrlsService")],Qn.prototype,"ctrlsService",void 0),qn([j("ctrlsFactory")],Qn.prototype,"ctrlsFactory",void 0),qn([j("agStackComponentsRegistry")],Qn.prototype,"agStackComponentsRegistry",void 0),qn([j("valueCache")],Qn.prototype,"valueCache",void 0),qn([j("rowNodeEventThrottle")],Qn.prototype,"rowNodeEventThrottle",void 0),qn([j("localeService")],Qn.prototype,"localeService",void 0),qn([j("valueParserService")],Qn.prototype,"valueParserService",void 0),qn([B],Qn.prototype,"postConstruct",null),Qn=qn([U("beans")],Qn);class Xn extends Qn{constructor(e,t,i){super(),this.cellCtrl=e,this.beans=t,this.column=i}onMouseEvent(e,t){if(!Ee(t))switch(e){case"click":this.onCellClicked(t);break;case"mousedown":case"touchstart":this.onMouseDown(t);break;case"dblclick":this.onCellDoubleClicked(t);break;case"mouseout":this.onMouseOut(t);break;case"mouseover":this.onMouseOver(t)}}onCellClicked(e){if(this.isDoubleClickOnIPad())return this.onCellDoubleClicked(e),void e.preventDefault();const{eventService:t,rangeService:i,gridOptionsService:s}=this.beans,o=e.ctrlKey||e.metaKey;i&&o&&i.getCellRangeCount(this.cellCtrl.getCellPosition())>1&&i.intersectLastRange(!0);const r=this.cellCtrl.createEvent(e,_e.EVENT_CELL_CLICKED);t.dispatchEvent(r);const n=this.column.getColDef();n.onCellClicked&&window.setTimeout(()=>n.onCellClicked(r),0);!((s.is("singleClickEdit")||n.singleClickEdit)&&!s.is("suppressClickEdit"))||e.shiftKey&&0!=(null==i?void 0:i.getCellRanges().length)||this.cellCtrl.startRowOrCellEdit()}isDoubleClickOnIPad(){if(!ci()||Re("dblclick"))return!1;const e=(new Date).getTime(),t=e-this.lastIPadMouseClickEvent<200;return this.lastIPadMouseClickEvent=e,t}onCellDoubleClicked(e){const t=this.column.getColDef(),i=this.cellCtrl.createEvent(e,_e.EVENT_CELL_DOUBLE_CLICKED);this.beans.eventService.dispatchEvent(i),"function"==typeof t.onCellDoubleClicked&&window.setTimeout(()=>t.onCellDoubleClicked(i),0);!this.beans.gridOptionsService.is("singleClickEdit")&&!this.beans.gridOptionsService.is("suppressClickEdit")&&this.cellCtrl.startRowOrCellEdit(null,e)}onMouseDown(e){const{ctrlKey:t,metaKey:i,shiftKey:s}=e,o=e.target,{cellCtrl:r,beans:n}=this,{eventService:l,rangeService:a,focusService:d}=n;if(this.isRightClickInExistingRange(e))return;const h=a&&0!=a.getCellRanges().length;if(!s||!h){const e=ni()&&!r.isEditing()&&!Ni(o);r.focusCell(e)}if(s&&h&&!d.isCellFocused(r.getCellPosition())){e.preventDefault();const t=d.getFocusedCell();if(t){const{column:e,rowIndex:i,rowPinned:s}=t,o=n.rowRenderer.getRowByPosition({rowIndex:i,rowPinned:s}),r=null==o?void 0:o.getCellCtrl(e);(null==r?void 0:r.isEditing())&&r.stopEditing(),d.setFocusedCell({column:e,rowIndex:i,rowPinned:s,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}}if(!this.containsWidget(o)){if(a){const e=this.cellCtrl.getCellPosition();if(s)a.extendLatestRangeToCell(e);else{const s=t||i;a.setRangeToCell(e,s)}}l.dispatchEvent(this.cellCtrl.createEvent(e,_e.EVENT_CELL_MOUSE_DOWN))}}isRightClickInExistingRange(e){const{rangeService:t}=this.beans;if(t){const i=t.isCellInAnyRange(this.cellCtrl.getCellPosition()),s=2===e.button||e.ctrlKey&&this.beans.gridOptionsService.is("allowContextMenuWithControlKey");if(i&&s)return!0}return!1}containsWidget(e){return _i(e,"ag-selection-checkbox",3)}onMouseOut(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,_e.EVENT_CELL_MOUSE_OUT);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.clearMouseOver()}onMouseOver(e){if(this.mouseStayingInsideCell(e))return;const t=this.cellCtrl.createEvent(e,_e.EVENT_CELL_MOUSE_OVER);this.beans.eventService.dispatchEvent(t),this.beans.columnHoverService.setMouseOver([this.column])}mouseStayingInsideCell(e){if(!e.target||!e.relatedTarget)return!1;const t=this.cellCtrl.getGui(),i=t.contains(e.target),s=t.contains(e.relatedTarget);return i&&s}destroy(){}}class Jn extends Le{constructor(e,t,i,s,o){super(),this.cellCtrl=e,this.beans=t,this.rowNode=s,this.rowCtrl=o}setComp(e){this.eGui=e}onKeyDown(e){const t=e.key;switch(t){case ys.ENTER:this.onEnterKeyDown(e);break;case ys.F2:this.onF2KeyDown(e);break;case ys.ESCAPE:this.onEscapeKeyDown(e);break;case ys.TAB:this.onTabKeyDown(e);break;case ys.BACKSPACE:case ys.DELETE:this.onBackspaceOrDeleteKeyDown(t,e);break;case ys.DOWN:case ys.UP:case ys.RIGHT:case ys.LEFT:this.onNavigationKeyDown(e,t)}}onNavigationKeyDown(e,t){this.cellCtrl.isEditing()||(e.shiftKey&&this.cellCtrl.isRangeSelectionEnabled()?this.onShiftRangeSelect(e):this.beans.navigationService.navigateToNextCell(e,t,this.cellCtrl.getCellPosition(),!0),e.preventDefault())}onShiftRangeSelect(e){if(!this.beans.rangeService)return;const t=this.beans.rangeService.extendLatestRangeInDirection(e);t&&this.beans.navigationService.ensureCellVisible(t)}onTabKeyDown(e){this.beans.navigationService.onTabKeyDown(this.cellCtrl,e)}onBackspaceOrDeleteKeyDown(e,t){const{cellCtrl:i,beans:s,rowNode:o}=this,{gridOptionsService:r,rangeService:n,eventService:l}=s;i.isEditing()||(l.dispatchEvent({type:_e.EVENT_KEY_SHORTCUT_CHANGED_CELL_START}),bs(e,r.is("enableCellEditingOnBackspace"))?n&&r.is("enableRangeSelection")?n.clearCellRangeCellValues({dispatchWrapperEvents:!0,wrapperEventSource:"deleteKey"}):i.isCellEditable()&&o.setDataValue(i.getColumn(),null,"cellClear"):i.startRowOrCellEdit(e,t),l.dispatchEvent({type:_e.EVENT_KEY_SHORTCUT_CHANGED_CELL_END}))}onEnterKeyDown(e){if(this.cellCtrl.isEditing()||this.rowCtrl.isEditing())this.cellCtrl.stopEditingAndFocus(!1,e.shiftKey);else if(this.beans.gridOptionsService.is("enterNavigatesVertically")){const t=e.shiftKey?ys.UP:ys.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.cellCtrl.getCellPosition(),!1)}else this.cellCtrl.startRowOrCellEdit(ys.ENTER,e),this.cellCtrl.isEditing()&&e.preventDefault()}onF2KeyDown(e){this.cellCtrl.isEditing()||this.cellCtrl.startRowOrCellEdit(ys.F2,e)}onEscapeKeyDown(e){this.cellCtrl.isEditing()&&(this.cellCtrl.stopRowOrCellEdit(!0),this.cellCtrl.focusCell(!0))}processCharacter(e){if(e.target!==this.eGui||this.cellCtrl.isEditing())return;const t=e.key;" "===t?this.onSpaceKeyDown(e):(this.cellCtrl.startRowOrCellEdit(t,e),e.preventDefault())}onSpaceKeyDown(e){const{gridOptionsService:t}=this.beans;if(!this.cellCtrl.isEditing()&&t.isRowSelection()){const i=this.rowNode.isSelected(),s=!i;if(s||!t.is("suppressRowDeselection")){const t=this.beans.gridOptionsService.is("groupSelectsFiltered"),o=this.rowNode.setSelectedParams({newValue:s,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"});void 0===i&&0===o&&this.rowNode.setSelectedParams({newValue:!1,rangeSelect:e.shiftKey,groupSelectsFiltered:t,event:e,source:"spaceKey"})}}e.preventDefault()}destroy(){super.destroy()}}var Zn=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class el extends js{constructor(e,t,i){super('<div class="ag-drag-handle ag-row-drag" draggable="true"></div>'),this.rowNode=e,this.column=t,this.eCell=i}postConstruct(){this.getGui().appendChild(fs("rowDrag",this.gridOptionsService,null)),this.addGuiEventListener("mousedown",e=>{e.stopPropagation()}),this.addDragSource(),this.checkVisibility()}addDragSource(){this.addGuiEventListener("dragstart",this.onDragStart.bind(this))}onDragStart(e){const t=this.column.getColDef().dndSourceOnRowDrag;e.dataTransfer.setDragImage(this.eCell,0,0);const i=()=>{try{const t=JSON.stringify(this.rowNode.data);e.dataTransfer.setData("application/json",t),e.dataTransfer.setData("text/plain",t)}catch(e){}};if(t){t({rowNode:this.rowNode,dragEvent:e,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context})}else i()}checkVisibility(){const e=this.column.isDndSource(this.rowNode);this.setDisplayed(e)}}Zn([B],el.prototype,"postConstruct",null);let tl=0;class il extends Le{constructor(e,t,i,s){super(),this.cellRangeFeature=null,this.cellPositionFeature=null,this.cellCustomStyleFeature=null,this.tooltipFeature=null,this.cellMouseListenerFeature=null,this.cellKeyboardListenerFeature=null,this.suppressRefreshCell=!1,this.onCellCompAttachedFuncs=[],this.column=e,this.rowNode=t,this.beans=i,this.rowCtrl=s,this.instanceId=e.getId()+"-"+tl++;const o=this.column.getColDef();this.colIdSanitised=je(this.column.getId()),this.beans.gridOptionsService.is("suppressCellFocus")||(this.tabIndex=-1),this.isCellRenderer=null!=o.cellRenderer||null!=o.cellRendererSelector,this.createCellPosition(),this.addFeatures(),this.updateAndFormatValue(!0)}shouldRestoreFocus(){return this.beans.focusService.shouldRestoreFocus(this.cellPosition)}addFeatures(){this.cellPositionFeature=new Kn(this,this.beans),this.addDestroyFunc(()=>{var e;null===(e=this.cellPositionFeature)||void 0===e||e.destroy(),this.cellPositionFeature=null}),this.cellCustomStyleFeature=new Yn(this,this.beans),this.addDestroyFunc(()=>{var e;null===(e=this.cellCustomStyleFeature)||void 0===e||e.destroy(),this.cellCustomStyleFeature=null}),this.cellMouseListenerFeature=new Xn(this,this.beans,this.column),this.addDestroyFunc(()=>{var e;null===(e=this.cellMouseListenerFeature)||void 0===e||e.destroy(),this.cellMouseListenerFeature=null}),this.cellKeyboardListenerFeature=new Jn(this,this.beans,this.column,this.rowNode,this.rowCtrl),this.addDestroyFunc(()=>{var e;null===(e=this.cellKeyboardListenerFeature)||void 0===e||e.destroy(),this.cellKeyboardListenerFeature=null});this.beans.rangeService&&this.beans.gridOptionsService.is("enableRangeSelection")&&(this.cellRangeFeature=new zn(this.beans,this),this.addDestroyFunc(()=>{var e;null===(e=this.cellRangeFeature)||void 0===e||e.destroy(),this.cellRangeFeature=null})),this.column.isTooltipEnabled()&&this.addTooltipFeature()}addTooltipFeature(){const e={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getRowIndex:()=>this.cellPosition.rowIndex,getRowNode:()=>this.rowNode,getGui:()=>this.getGui(),getLocation:()=>"cell",getTooltipValue:()=>{const e=this.column.getColDef(),i=this.rowNode.data;if(e.tooltipField&&t(i))return w(i,e.tooltipField,this.column.isTooltipFieldContainsDots());const s=e.tooltipValueGetter;return s?s({location:"cell",api:this.beans.gridOptionsService.api,columnApi:this.beans.gridOptionsService.columnApi,context:this.beans.gridOptionsService.context,colDef:this.column.getColDef(),column:this.column,rowIndex:this.cellPosition.rowIndex,node:this.rowNode,data:this.rowNode.data,value:this.value,valueFormatted:this.valueFormatted}):null},getValueFormatted:()=>this.valueFormatted};this.tooltipFeature=new $n(e,this.beans),this.addDestroyFunc(()=>{var e;null===(e=this.tooltipFeature)||void 0===e||e.destroy(),this.tooltipFeature=null})}setComp(e,t,i,s,o){var r,n,l,a;this.cellComp=e,this.eGui=t,this.printLayout=s,this.addDomData(),this.onCellFocused(this.focusEventToRestore),this.applyStaticCssClasses(),this.setWrapText(),this.onFirstRightPinnedChanged(),this.onLastLeftPinnedChanged(),this.onColumnHover(),this.setupControlComps(),i&&this.setupAutoHeight(i),this.setAriaColIndex(),null===(r=this.cellPositionFeature)||void 0===r||r.setComp(t),null===(n=this.cellCustomStyleFeature)||void 0===n||n.setComp(e),null===(l=this.tooltipFeature)||void 0===l||l.setComp(t),null===(a=this.cellKeyboardListenerFeature)||void 0===a||a.setComp(this.eGui),this.cellRangeFeature&&this.cellRangeFeature.setComp(e,t),o&&this.isCellEditable()?this.startEditing():this.showValue(),this.onCellCompAttachedFuncs.length&&(this.onCellCompAttachedFuncs.forEach(e=>e()),this.onCellCompAttachedFuncs=[])}setupAutoHeight(e){if(!this.column.isAutoHeight())return;const t=e.parentElement,i=this.beans.gridOptionsService.getRowHeightForNode(this.rowNode).height,s=o=>{if(this.editing)return;if(!this.isAlive())return;const{paddingTop:r,paddingBottom:n,borderBottomWidth:l,borderTopWidth:a}=Vi(t),d=r+n+l+a,h=e.offsetHeight+d;if(o<5){const t=this.beans.gridOptionsService.getDocument(),i=0==h;if(!t||!t.contains(e)||i)return void this.beans.frameworkOverrides.setTimeout(()=>s(o+1),0)}const c=Math.max(h,i);this.rowNode.setRowAutoHeight(c,this.column)},o=()=>s(0);o();const r=this.beans.resizeObserverService.observeResize(e,o);this.addDestroyFunc(()=>{r(),this.rowNode.setRowAutoHeight(void 0,this.column)})}getInstanceId(){return this.instanceId}getIncludeSelection(){return this.includeSelection}getIncludeRowDrag(){return this.includeRowDrag}getIncludeDndSource(){return this.includeDndSource}getColumnIdSanitised(){return this.colIdSanitised}getTabIndex(){return this.tabIndex}getIsCellRenderer(){return this.isCellRenderer}getValueToDisplay(){return null!=this.valueFormatted?this.valueFormatted:this.value}showValue(e=!1){const t=this.getValueToDisplay();let i;if(this.isCellRenderer){const e=this.createCellRendererParams();i=this.beans.userComponentFactory.getCellRendererDetails(this.column.getColDef(),e)}this.cellComp.setRenderDetails(i,t,e),this.refreshHandle()}setupControlComps(){const e=this.column.getColDef();this.includeSelection=this.isIncludeControl(e.checkboxSelection),this.includeRowDrag=this.isIncludeControl(e.rowDrag),this.includeDndSource=this.isIncludeControl(e.dndSource),this.cellComp.setIncludeSelection(this.includeSelection),this.cellComp.setIncludeDndSource(this.includeDndSource),this.cellComp.setIncludeRowDrag(this.includeRowDrag)}isForceWrapper(){return this.beans.gridOptionsService.is("enableCellTextSelection")||this.column.isAutoHeight()}isIncludeControl(e){return!(null!=this.rowNode.rowPinned)&&("function"==typeof e||!0===e)}refreshShouldDestroy(){const e=this.column.getColDef(),t=this.includeSelection!=this.isIncludeControl(e.checkboxSelection),i=this.includeRowDrag!=this.isIncludeControl(e.rowDrag),s=this.includeDndSource!=this.isIncludeControl(e.dndSource);return t||i||s}startEditing(e=null,t=!1,i=null){if(!this.isCellEditable()||this.editing)return;if(!this.cellComp)return void this.onCellCompAttachedFuncs.push(()=>{this.startEditing(e,t,i)});const s=this.createCellEditorParams(e,t),o=this.column.getColDef(),r=this.beans.userComponentFactory.getCellEditorDetails(o,s),n=null!=(null==r?void 0:r.popupFromSelector)?r.popupFromSelector:!!o.cellEditorPopup,l=null!=(null==r?void 0:r.popupPositionFromSelector)?r.popupPositionFromSelector:o.cellEditorPopupPosition;this.setEditing(!0),this.cellComp.setEditDetails(r,n,l);const a=this.createEvent(i,_e.EVENT_CELL_EDITING_STARTED);this.beans.eventService.dispatchEvent(a)}setEditing(e){this.editing!==e&&(this.editing=e,this.refreshHandle())}stopRowOrCellEdit(e=!1){"fullRow"===this.beans.gridOptionsService.get("editType")?this.rowCtrl.stopRowEditing(e):this.stopEditing(e)}onPopupEditorClosed(){this.isEditing()&&this.stopEditingAndFocus()}takeValueFromCellEditor(e){const t={newValueExists:!1};if(e)return t;const i=this.cellComp.getCellEditor();if(!i)return t;if(i.isCancelAfterEnd&&i.isCancelAfterEnd())return t;return{newValue:i.getValue(),newValueExists:!0}}saveNewValue(e,t){if(t===e)return!1;this.suppressRefreshCell=!0;const i=this.rowNode.setDataValue(this.column,t,"edit");return this.suppressRefreshCell=!1,i}stopEditing(e=!1){if(!this.editing)return!1;const{newValue:t,newValueExists:i}=this.takeValueFromCellEditor(e),s=this.rowNode.getValueFromValueService(this.column);let o=!1;return i&&(o=this.saveNewValue(s,t)),this.setEditing(!1),this.cellComp.setEditDetails(),this.updateAndFormatValue(),this.refreshCell({forceRefresh:!0,suppressFlash:!0}),this.dispatchEditingStoppedEvent(s,t,!e&&!!o),o}dispatchEditingStoppedEvent(e,t,i){const s=Object.assign(Object.assign({},this.createEvent(null,_e.EVENT_CELL_EDITING_STOPPED)),{oldValue:e,newValue:t,valueChanged:i});this.beans.eventService.dispatchEvent(s)}createCellEditorParams(e,t){return{value:this.rowNode.getValueFromValueService(this.column),eventKey:e,column:this.column,colDef:this.column.getColDef(),rowIndex:this.getCellPosition().rowIndex,node:this.rowNode,data:this.rowNode.data,api:this.beans.gridOptionsService.api,cellStartedEdit:t,columnApi:this.beans.gridOptionsService.columnApi,context:this.beans.gridOptionsService.context,onKeyDown:this.onKeyDown.bind(this),stopEditing:this.stopEditingAndFocus.bind(this),eGridCell:this.getGui(),parseValue:this.parseValue.bind(this),formatValue:this.formatValue.bind(this)}}createCellRendererParams(){return{value:this.value,valueFormatted:this.valueFormatted,getValue:()=>this.rowNode.getValueFromValueService(this.column),setValue:e=>this.beans.valueService.setValue(this.rowNode,this.column,e),formatValue:this.formatValue.bind(this),data:this.rowNode.data,node:this.rowNode,pinned:this.column.getPinned(),colDef:this.column.getColDef(),column:this.column,rowIndex:this.getCellPosition().rowIndex,api:this.beans.gridOptionsService.api,columnApi:this.beans.gridOptionsService.columnApi,context:this.beans.gridOptionsService.context,refreshCell:this.refreshCell.bind(this),eGridCell:this.getGui(),eParentOfValue:this.cellComp.getParentOfValue(),registerRowDragger:(e,t,i,s)=>this.registerRowDragger(e,t,s)}}parseValue(e){return this.beans.valueParserService.parseValue(this.column,this.rowNode,e,this.getValue())}setFocusOutOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusOut&&e.focusOut()}setFocusInOnEditor(){if(!this.editing)return;const e=this.cellComp.getCellEditor();e&&e.focusIn?e.focusIn():this.focusCell(!0)}onCellChanged(e){if(!this.cellComp)return;e.column===this.column&&this.refreshCell({})}refreshCell(e){var t,i,s;if(this.suppressRefreshCell||this.editing)return;if(!this.cellComp)return;const o=this.column.getColDef(),r=null!=e&&!!e.newData,n=null!=e&&!!e.suppressFlash||!!o.suppressCellFlash,l=null==o.field&&null==o.valueGetter&&null==o.showRowGroup,a=e&&e.forceRefresh||l||r,d=this.updateAndFormatValue();if(a||d){this.showValue(r);const e=this.beans.filterManager.isSuppressFlashingCellsBecauseFiltering();!n&&!e&&(this.beans.gridOptionsService.is("enableCellChangeFlash")||o.enableCellChangeFlash)&&this.flashCell(),null===(t=this.cellCustomStyleFeature)||void 0===t||t.applyUserStyles(),null===(i=this.cellCustomStyleFeature)||void 0===i||i.applyClassesFromColDef()}this.refreshToolTip(),null===(s=this.cellCustomStyleFeature)||void 0===s||s.applyCellClassRules()}stopEditingAndFocus(e=!1,t=!1){this.stopRowOrCellEdit(),this.focusCell(!0),e||this.navigateAfterEdit(t)}navigateAfterEdit(e){if(this.beans.gridOptionsService.is("enterNavigatesVerticallyAfterEdit")){const t=e?ys.UP:ys.DOWN;this.beans.navigationService.navigateToNextCell(null,t,this.getCellPosition(),!1)}}flashCell(e){const t=e&&e.flashDelay,i=e&&e.fadeDelay;this.animateCell("data-changed",t,i)}animateCell(e,i,s){var o,r;if(!this.cellComp)return;const n="ag-cell-"+e,l=`ag-cell-${e}-animation`,{gridOptionsService:a}=this.beans;i||(i=null!==(o=a.getNum("cellFlashDelay"))&&void 0!==o?o:500),t(s)||(s=null!==(r=a.getNum("cellFadeDelay"))&&void 0!==r?r:1e3),this.cellComp.addOrRemoveCssClass(n,!0),this.cellComp.addOrRemoveCssClass(l,!1),window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(n,!1),this.cellComp.addOrRemoveCssClass(l,!0),this.eGui.style.transition=`background-color ${s}ms`,window.setTimeout(()=>{this.isAlive()&&(this.cellComp.addOrRemoveCssClass(l,!1),this.eGui.style.transition="")},s))},i)}onFlashCells(e){if(!this.cellComp)return;const t=this.beans.cellPositionUtils.createId(this.getCellPosition());e.cells[t]&&this.animateCell("highlight")}isCellEditable(){return this.column.isCellEditable(this.rowNode)}isSuppressFillHandle(){return this.column.isSuppressFillHandle()}formatValue(e){var t;return null!==(t=this.callValueFormatter(e))&&void 0!==t?t:e}callValueFormatter(e){return this.beans.valueFormatterService.formatValue(this.column,this.rowNode,e)}updateAndFormatValue(e=!1){const t=this.value,i=this.valueFormatted;this.value=this.rowNode.getValueFromValueService(this.column),this.valueFormatted=this.callValueFormatter(this.value);return!!e||(!this.valuesAreEqual(t,this.value)||this.valueFormatted!=i)}valuesAreEqual(e,t){const i=this.column.getColDef();return i.equals?i.equals(e,t):e===t}getComp(){return this.cellComp}getValue(){return this.value}getValueFormatted(){return this.valueFormatted}addDomData(){const e=this.getGui();this.beans.gridOptionsService.setDomData(e,il.DOM_DATA_KEY_CELL_CTRL,this),this.addDestroyFunc(()=>this.beans.gridOptionsService.setDomData(e,il.DOM_DATA_KEY_CELL_CTRL,null))}createEvent(e,t){return{type:t,node:this.rowNode,data:this.rowNode.data,value:this.value,column:this.column,colDef:this.column.getColDef(),context:this.beans.gridOptionsService.context,api:this.beans.gridApi,columnApi:this.beans.columnApi,rowPinned:this.rowNode.rowPinned,event:e,rowIndex:this.rowNode.rowIndex}}processCharacter(e){var t;null===(t=this.cellKeyboardListenerFeature)||void 0===t||t.processCharacter(e)}onKeyDown(e){var t;null===(t=this.cellKeyboardListenerFeature)||void 0===t||t.onKeyDown(e)}onMouseEvent(e,t){var i;null===(i=this.cellMouseListenerFeature)||void 0===i||i.onMouseEvent(e,t)}getGui(){return this.eGui}refreshToolTip(){var e;null===(e=this.tooltipFeature)||void 0===e||e.refreshToolTip()}getColSpanningList(){return this.cellPositionFeature.getColSpanningList()}onLeftChanged(){var e;this.cellComp&&(null===(e=this.cellPositionFeature)||void 0===e||e.onLeftChanged())}onDisplayedColumnsChanged(){this.eGui&&this.setAriaColIndex()}setAriaColIndex(){const e=this.beans.columnModel.getAriaColumnIndex(this.column);Ut(this.getGui(),e)}isSuppressNavigable(){return this.column.isSuppressNavigable(this.rowNode)}onWidthChanged(){var e;return null===(e=this.cellPositionFeature)||void 0===e?void 0:e.onWidthChanged()}getColumn(){return this.column}getRowNode(){return this.rowNode}getBeans(){return this.beans}isPrintLayout(){return this.printLayout}appendChild(e){this.eGui.appendChild(e)}refreshHandle(){this.cellRangeFeature&&this.cellRangeFeature.refreshHandle()}getCellPosition(){return this.cellPosition}isEditing(){return this.editing}startRowOrCellEdit(e,t=null){this.cellComp&&("fullRow"===this.beans.gridOptionsService.get("editType")?this.rowCtrl.startRowEditing(e,this):this.startEditing(e,!0,t))}getRowCtrl(){return this.rowCtrl}getRowPosition(){return{rowIndex:this.cellPosition.rowIndex,rowPinned:this.cellPosition.rowPinned}}updateRangeBordersIfRangeCount(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.updateRangeBordersIfRangeCount()}onRangeSelectionChanged(){this.cellComp&&this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}isRangeSelectionEnabled(){return null!=this.cellRangeFeature}focusCell(e=!1){this.beans.focusService.setFocusedCell({rowIndex:this.getCellPosition().rowIndex,column:this.column,rowPinned:this.rowNode.rowPinned,forceBrowserFocus:e})}onRowIndexChanged(){this.createCellPosition(),this.onCellFocused(),this.cellRangeFeature&&this.cellRangeFeature.onRangeSelectionChanged()}onFirstRightPinnedChanged(){if(!this.cellComp)return;const e=this.column.isFirstRightPinned();this.cellComp.addOrRemoveCssClass("ag-cell-first-right-pinned",e)}onLastLeftPinnedChanged(){if(!this.cellComp)return;const e=this.column.isLastLeftPinned();this.cellComp.addOrRemoveCssClass("ag-cell-last-left-pinned",e)}onCellFocused(e){if(this.beans.gridOptionsService.is("suppressCellFocus"))return;const t=this.beans.focusService.isCellFocused(this.cellPosition);if(!this.cellComp)return void(t&&(null==e?void 0:e.forceBrowserFocus)&&(this.focusEventToRestore=e));if(this.focusEventToRestore=void 0,this.cellComp.addOrRemoveCssClass("ag-cell-focus",t),t&&e&&e.forceBrowserFocus){this.cellComp.getFocusableElement().focus({preventScroll:!!e.preventScrollOnBrowserFocus})}const i="fullRow"===this.beans.gridOptionsService.get("editType");t||i||!this.editing||this.stopRowOrCellEdit()}createCellPosition(){this.cellPosition={rowIndex:this.rowNode.rowIndex,rowPinned:e(this.rowNode.rowPinned),column:this.column}}applyStaticCssClasses(){this.cellComp.addOrRemoveCssClass("ag-cell",!0),this.cellComp.addOrRemoveCssClass("ag-cell-not-inline-editing",!0);const e=1==this.column.isAutoHeight();this.cellComp.addOrRemoveCssClass("ag-cell-auto-height",e),this.cellComp.addOrRemoveCssClass("ag-cell-normal-height",!e)}onColumnHover(){if(!this.cellComp)return;if(!this.beans.gridOptionsService.is("columnHoverHighlight"))return;const e=this.beans.columnHoverService.isHovered(this.column);this.cellComp.addOrRemoveCssClass("ag-column-hover",e)}onColDefChanged(){this.cellComp&&(this.setWrapText(),this.editing||this.refreshCell({forceRefresh:!0,suppressFlash:!0}))}setWrapText(){const e=1==this.column.getColDef().wrapText;this.cellComp.addOrRemoveCssClass("ag-cell-wrap-text",e)}dispatchCellContextMenuEvent(e){const t=this.column.getColDef(),i=this.createEvent(e,_e.EVENT_CELL_CONTEXT_MENU);this.beans.eventService.dispatchEvent(i),t.onCellContextMenu&&window.setTimeout(()=>t.onCellContextMenu(i),0)}getCellRenderer(){return this.cellComp?this.cellComp.getCellRenderer():null}getCellEditor(){return this.cellComp?this.cellComp.getCellEditor():null}destroy(){this.onCellCompAttachedFuncs=[],super.destroy()}createSelectionCheckbox(){const e=new hr;return this.beans.context.createBean(e),e.init({rowNode:this.rowNode,column:this.column}),e}createDndSource(){const e=new el(this.rowNode,this.column,this.eGui);return this.beans.context.createBean(e),e}registerRowDragger(e,t,i){if(this.customRowDragComp)return void this.customRowDragComp.setDragElement(e,t);const s=this.createRowDragComp(e,t,i);s&&(this.customRowDragComp=s,this.addDestroyFunc(()=>{this.beans.context.destroyBean(s),this.customRowDragComp=null}))}createRowDragComp(e,t,i){const s=this.beans.gridOptionsService.is("pagination"),o=this.beans.gridOptionsService.is("rowDragManaged"),r=this.beans.gridOptionsService.isRowModelType("clientSide");if(o){if(!r)return void T(()=>console.warn("AG Grid: managed row dragging is only allowed in the Client Side Row Model"),"CellComp.addRowDragging");if(s)return void T(()=>console.warn("AG Grid: managed row dragging is not possible when doing pagination"),"CellComp.addRowDragging")}const n=new fr(()=>this.value,this.rowNode,this.column,e,t,i);return this.beans.context.createBean(n),n}}var sl;il.DOM_DATA_KEY_CELL_CTRL="cellCtrl",function(e){e.Normal="Normal",e.FullWidth="FullWidth",e.FullWidthLoading="FullWidthLoading",e.FullWidthGroup="FullWidthGroup",e.FullWidthDetail="FullWidthDetail"}(sl||(sl={}));let ol=0;class rl extends Le{constructor(e,t,i,s,o){super(),this.allRowGuis=[],this.active=!0,this.centerCellCtrls={list:[],map:{}},this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}},this.slideInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.fadeInAnimation={left:!1,center:!1,right:!1,fullWidth:!1},this.lastMouseDownOnDragger=!1,this.emptyStyle={},this.updateColumnListsPending=!1,this.rowId=null,this.businessKeySanitised=null,this.beans=t,this.gridOptionsService=t.gridOptionsService,this.rowNode=e,this.paginationPage=t.paginationProxy.getCurrentPage(),this.useAnimationFrameForCreate=s,this.printLayout=o,this.instanceId=e.id+"-"+ol++,this.rowId=je(e.id),this.initRowBusinessKey(),this.rowFocused=t.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned),this.rowLevel=t.rowCssClassCalculator.calculateRowLevel(this.rowNode),this.setRowType(),this.setAnimateFlags(i),this.rowStyles=this.processStylesFromGridOptions(),this.isFullWidth()&&!this.gridOptionsService.is("suppressCellFocus")&&(this.tabIndex=-1),this.addListeners()}initRowBusinessKey(){this.businessKeyForNodeFunc=this.gridOptionsService.get("getBusinessKeyForNode"),this.updateRowBusinessKey()}updateRowBusinessKey(){if("function"!=typeof this.businessKeyForNodeFunc)return;const e=this.businessKeyForNodeFunc(this.rowNode);this.businessKeySanitised=je(e)}getRowId(){return this.rowId}getRowStyles(){return this.rowStyles}getTabIndex(){return this.tabIndex}isSticky(){return this.rowNode.sticky}getBeans(){return this.beans}getInstanceId(){return this.instanceId}setComp(e,t,i){const s={rowComp:e,element:t,containerType:i};this.allRowGuis.push(s),i===Sl.LEFT?this.leftGui=s:i===Sl.RIGHT?this.rightGui=s:i===Sl.FULL_WIDTH?this.fullWidthGui=s:this.centerGui=s,this.initialiseRowComp(s),"FullWidthLoading"===this.rowType||this.rowNode.rowPinned||this.beans.rowRenderer.dispatchFirstDataRenderedEvent()}unsetComp(e){switch(this.allRowGuis=this.allRowGuis.filter(t=>t.containerType!==e),e){case Sl.LEFT:this.leftGui=void 0;break;case Sl.RIGHT:this.rightGui=void 0;break;case Sl.FULL_WIDTH:this.fullWidthGui=void 0;break;case Sl.CENTER:this.centerGui=void 0}}isCacheable(){return this.rowType===sl.FullWidthDetail&&this.gridOptionsService.is("keepDetailRows")}setCached(e){const t=e?"none":"";this.allRowGuis.forEach(e=>e.element.style.display=t)}initialiseRowComp(e){const t=this.gridOptionsService;this.listenOnDomOrder(e),this.onRowHeightChanged(e),this.updateRowIndexes(e),this.setFocusedClasses(e),this.setStylesFromGridOptions(!1,e),t.isRowSelection()&&this.rowNode.selectable&&this.onRowSelected(e),this.updateColumnLists(!this.useAnimationFrameForCreate);const i=e.rowComp;this.getInitialRowClasses(e.containerType).forEach(e=>i.addOrRemoveCssClass(e,!0)),this.executeSlideAndFadeAnimations(e),this.rowNode.group&&Gt(e.element,1==this.rowNode.expanded),this.setRowCompRowId(i),this.setRowCompRowBusinessKey(i),t.setDomData(e.element,rl.DOM_DATA_KEY_ROW_CTRL,this),this.addDestroyFunc(()=>t.setDomData(e.element,rl.DOM_DATA_KEY_ROW_CTRL,null)),this.useAnimationFrameForCreate?this.beans.animationFrameService.createTask(this.addHoverFunctionality.bind(this,e.element),this.rowNode.rowIndex,"createTasksP2"):this.addHoverFunctionality(e.element),this.isFullWidth()&&this.setupFullWidth(e),t.is("rowDragEntireRow")&&this.addRowDraggerToRow(e),this.useAnimationFrameForCreate&&this.beans.animationFrameService.addDestroyTask(()=>{this.isAlive()&&e.rowComp.addOrRemoveCssClass("ag-after-created",!0)}),this.executeProcessRowPostCreateFunc()}setRowCompRowBusinessKey(e){null!=this.businessKeySanitised&&e.setRowBusinessKey(this.businessKeySanitised)}getBusinessKey(){return this.businessKeySanitised}setRowCompRowId(e){this.rowId=je(this.rowNode.id),null!=this.rowId&&e.setRowId(this.rowId)}executeSlideAndFadeAnimations(e){const{containerType:t}=e;this.slideInAnimation[t]&&(F(()=>{this.onTopChanged()}),this.slideInAnimation[t]=!1);this.fadeInAnimation[t]&&(F(()=>{e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!1)}),this.fadeInAnimation[t]=!1)}addRowDraggerToRow(e){if(this.gridOptionsService.is("enableRangeSelection"))return void T(()=>{console.warn("AG Grid: Setting `rowDragEntireRow: true` in the gridOptions doesn't work with `enableRangeSelection: true`")},"rowDragAndRangeSelectionEnabled");const t=this.beans.localeService.getLocaleTextFunc(),i=new fr(()=>"1 "+t("rowDragRow","row"),this.rowNode,void 0,e.element,void 0,!0);this.createManagedBean(i,this.beans.context)}setupFullWidth(e){const t=this.getPinnedForContainer(e.containerType),i=this.createFullWidthParams(e.element,t);if(this.rowType==sl.FullWidthDetail&&!V.__assertRegistered(x.MasterDetailModule,"cell renderer 'agDetailCellRenderer' (for master detail)",this.beans.context.getGridId()))return;let s;switch(this.rowType){case sl.FullWidthDetail:s=this.beans.userComponentFactory.getFullWidthDetailCellRendererDetails(i);break;case sl.FullWidthGroup:s=this.beans.userComponentFactory.getFullWidthGroupCellRendererDetails(i);break;case sl.FullWidthLoading:s=this.beans.userComponentFactory.getFullWidthLoadingCellRendererDetails(i);break;default:s=this.beans.userComponentFactory.getFullWidthCellRendererDetails(i)}e.rowComp.showFullWidth(s)}isPrintLayout(){return this.printLayout}getFullWidthCellRenderer(){var e,t;return null===(t=null===(e=this.fullWidthGui)||void 0===e?void 0:e.rowComp)||void 0===t?void 0:t.getFullWidthCellRenderer()}getCellElement(e){const t=this.getCellCtrl(e);return t?t.getGui():null}executeProcessRowPostCreateFunc(){const e=this.gridOptionsService.getCallback("processRowPostCreate");if(!e||!this.areAllContainersReady())return;e({eRow:this.centerGui.element,ePinnedLeftRow:this.leftGui?this.leftGui.element:void 0,ePinnedRightRow:this.rightGui?this.rightGui.element:void 0,node:this.rowNode,rowIndex:this.rowNode.rowIndex,addRenderedRowListener:this.addEventListener.bind(this)})}areAllContainersReady(){const e=!!this.leftGui||!this.beans.columnModel.isPinningLeft(),t=!!this.centerGui,i=!!this.rightGui||!this.beans.columnModel.isPinningRight();return e&&t&&i}setRowType(){const e=this.rowNode.stub,t=this.rowNode.isFullWidthCell(),i=this.beans.doingMasterDetail&&this.rowNode.detail,s=this.beans.columnModel.isPivotMode(),o=!!this.rowNode.group&&!this.rowNode.footer&&this.gridOptionsService.isGroupUseEntireRow(s);this.rowType=e?sl.FullWidthLoading:i?sl.FullWidthDetail:t?sl.FullWidth:o?sl.FullWidthGroup:sl.Normal}updateColumnLists(e=!1,t=!1){if(this.isFullWidth())return;e||this.gridOptionsService.is("suppressAnimationFrame")||this.printLayout?this.updateColumnListsImpl(t):this.updateColumnListsPending||(this.beans.animationFrameService.createTask(()=>{this.active&&this.updateColumnListsImpl(!0)},this.rowNode.rowIndex,"createTasksP1"),this.updateColumnListsPending=!0)}createCellCtrls(e,t,i=null){const s={list:[],map:{}},o=(e,t)=>{s.list.push(t),s.map[e]=t};return t.forEach(t=>{const i=t.getInstanceId();let s=e.map[i];s||(s=new il(t,this.rowNode,this.beans,this)),o(i,s)}),e.list.forEach(e=>{if(null!=s.map[e.getColumn().getInstanceId()])return;this.isCellEligibleToBeRemoved(e,i)?e.destroy():o(e.getColumn().getInstanceId(),e)}),s}updateColumnListsImpl(e){this.updateColumnListsPending=!1,this.createAllCellCtrls(),this.setCellCtrls(e)}setCellCtrls(e){this.allRowGuis.forEach(t=>{const i=this.getCellCtrlsForContainer(t.containerType);t.rowComp.setCellCtrls(i,e)})}getCellCtrlsForContainer(e){switch(e){case Sl.LEFT:return this.leftCellCtrls.list;case Sl.RIGHT:return this.rightCellCtrls.list;case Sl.FULL_WIDTH:return[];case Sl.CENTER:return this.centerCellCtrls.list;default:throw new Error("Unhandled case: "+e)}}createAllCellCtrls(){const e=this.beans.columnModel;if(this.printLayout)this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,e.getAllDisplayedColumns()),this.leftCellCtrls={list:[],map:{}},this.rightCellCtrls={list:[],map:{}};else{const t=e.getViewportCenterColumnsForRow(this.rowNode);this.centerCellCtrls=this.createCellCtrls(this.centerCellCtrls,t);const i=e.getDisplayedLeftColumnsForRow(this.rowNode);this.leftCellCtrls=this.createCellCtrls(this.leftCellCtrls,i,"left");const s=e.getDisplayedRightColumnsForRow(this.rowNode);this.rightCellCtrls=this.createCellCtrls(this.rightCellCtrls,s,"right")}}isCellEligibleToBeRemoved(e,t){if(e.getColumn().getPinned()!=t)return!0;const i=e.isEditing(),s=this.beans.focusService.isCellFocused(e.getCellPosition());if(i||s){const t=e.getColumn();return!(this.beans.columnModel.getAllDisplayedColumns().indexOf(t)>=0)}return!0}getDomOrder(){return this.gridOptionsService.is("ensureDomOrder")||this.gridOptionsService.isDomLayout("print")}listenOnDomOrder(e){const t=()=>{e.rowComp.setDomOrder(this.getDomOrder())};this.addManagedPropertyListener("domLayout",t),this.addManagedPropertyListener("ensureDomOrder",t)}setAnimateFlags(e){if(this.isSticky()||!e)return;const i=t(this.rowNode.oldRowTop),s=this.beans.columnModel.isPinningLeft(),o=this.beans.columnModel.isPinningRight();if(i){if(this.isFullWidth()&&!this.gridOptionsService.is("embedFullWidthRows"))return void(this.slideInAnimation.fullWidth=!0);this.slideInAnimation.center=!0,this.slideInAnimation.left=s,this.slideInAnimation.right=o}else{if(this.isFullWidth()&&!this.gridOptionsService.is("embedFullWidthRows"))return void(this.fadeInAnimation.fullWidth=!0);this.fadeInAnimation.center=!0,this.fadeInAnimation.left=s,this.fadeInAnimation.right=o}}isEditing(){return this.editingRow}stopRowEditing(e){this.stopEditing(e)}isFullWidth(){return this.rowType!==sl.Normal}getRowType(){return this.rowType}refreshFullWidth(){const e=(e,t)=>{if(!e)return!0;const i=e.rowComp.getFullWidthCellRenderer();if(!i)return!1;if(!i.refresh)return!1;const s=this.createFullWidthParams(e.element,t);return i.refresh(s)},t=e(this.fullWidthGui,null),i=e(this.centerGui,null),s=e(this.leftGui,"left"),o=e(this.rightGui,"right");return t&&i&&s&&o}addListeners(){this.addManagedListener(this.rowNode,ar.EVENT_HEIGHT_CHANGED,()=>this.onRowHeightChanged()),this.addManagedListener(this.rowNode,ar.EVENT_ROW_SELECTED,()=>this.onRowSelected()),this.addManagedListener(this.rowNode,ar.EVENT_ROW_INDEX_CHANGED,this.onRowIndexChanged.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_TOP_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_EXPANDED_CHANGED,this.updateExpandedCss.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_HAS_CHILDREN_CHANGED,this.updateExpandedCss.bind(this)),this.rowNode.detail&&this.addManagedListener(this.rowNode.parent,ar.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_DATA_CHANGED,this.onRowNodeDataChanged.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_CELL_CHANGED,this.onRowNodeCellChanged.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_HIGHLIGHT_CHANGED,this.onRowNodeHighlightChanged.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_DRAGGING_CHANGED,this.onRowNodeDraggingChanged.bind(this)),this.addManagedListener(this.rowNode,ar.EVENT_UI_LEVEL_CHANGED,this.onUiLevelChanged.bind(this));const e=this.beans.eventService;this.addManagedListener(e,_e.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED,this.onPaginationPixelOffsetChanged.bind(this)),this.addManagedListener(e,_e.EVENT_HEIGHT_SCALE_CHANGED,this.onTopChanged.bind(this)),this.addManagedListener(e,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(e,_e.EVENT_VIRTUAL_COLUMNS_CHANGED,this.onVirtualColumnsChanged.bind(this)),this.addManagedListener(e,_e.EVENT_CELL_FOCUSED,this.onCellFocused.bind(this)),this.addManagedListener(e,_e.EVENT_CELL_FOCUS_CLEARED,this.onCellFocusCleared.bind(this)),this.addManagedListener(e,_e.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),this.addManagedListener(e,_e.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedListener(e,_e.EVENT_COLUMN_MOVED,this.onColumnMoved.bind(this)),this.addListenersForCellComps()}onColumnMoved(){this.updateColumnLists()}addListenersForCellComps(){this.addManagedListener(this.rowNode,ar.EVENT_ROW_INDEX_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onRowIndexChanged())}),this.addManagedListener(this.rowNode,ar.EVENT_CELL_CHANGED,e=>{this.getAllCellCtrls().forEach(t=>t.onCellChanged(e))})}onRowNodeDataChanged(e){if(this.isFullWidth()!==!!this.rowNode.isFullWidthCell())this.beans.rowRenderer.redrawRow(this.rowNode);else if(this.isFullWidth()){this.refreshFullWidth()||this.beans.rowRenderer.redrawRow(this.rowNode)}else this.getAllCellCtrls().forEach(t=>t.refreshCell({suppressFlash:!e.update,newData:!e.update})),this.allRowGuis.forEach(e=>{this.setRowCompRowId(e.rowComp),this.updateRowBusinessKey(),this.setRowCompRowBusinessKey(e.rowComp)}),this.onRowSelected(),this.postProcessCss()}onRowNodeCellChanged(){this.postProcessCss()}postProcessCss(){this.setStylesFromGridOptions(!0),this.postProcessClassesFromGridOptions(),this.postProcessRowClassRules(),this.postProcessRowDragging()}onRowNodeHighlightChanged(){const e=this.rowNode.highlighted;this.allRowGuis.forEach(t=>{const i=e===fn.Above,s=e===fn.Below;t.rowComp.addOrRemoveCssClass("ag-row-highlight-above",i),t.rowComp.addOrRemoveCssClass("ag-row-highlight-below",s)})}onRowNodeDraggingChanged(){this.postProcessRowDragging()}postProcessRowDragging(){const e=this.rowNode.dragging;this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-dragging",e))}updateExpandedCss(){const e=this.rowNode.isExpandable(),t=1==this.rowNode.expanded;this.allRowGuis.forEach(i=>{i.rowComp.addOrRemoveCssClass("ag-row-group",e),i.rowComp.addOrRemoveCssClass("ag-row-group-expanded",e&&t),i.rowComp.addOrRemoveCssClass("ag-row-group-contracted",e&&!t),Gt(i.element,e&&t)})}onDisplayedColumnsChanged(){this.updateColumnLists(!0),this.beans.columnModel.wasAutoRowHeightEverActive()&&this.rowNode.checkAutoHeights()}onVirtualColumnsChanged(){this.updateColumnLists(!1,!0)}getRowPosition(){return{rowPinned:e(this.rowNode.rowPinned),rowIndex:this.rowNode.rowIndex}}onKeyboardNavigate(e){const t=this.allRowGuis.find(t=>t.element.contains(e.target));if(!((t?t.element:null)===e.target))return;const i=this.rowNode,s=this.beans.focusService.getFocusedCell(),o={rowIndex:i.rowIndex,rowPinned:i.rowPinned,column:s&&s.column};this.beans.navigationService.navigateToNextCell(e,e.key,o,!0),e.preventDefault()}onTabKeyDown(e){if(e.defaultPrevented||Ee(e))return;const t=this.allRowGuis.find(t=>t.element.contains(e.target)),i=t?t.element:null,s=i===e.target;let o=null;s||(o=this.beans.focusService.findNextFocusableElement(i,!1,e.shiftKey)),(this.isFullWidth()&&s||!o)&&this.beans.navigationService.onTabKeyDown(this,e)}onFullWidthRowFocused(e){var t;const i=this.rowNode,s=!!e&&(this.isFullWidth()&&e.rowIndex===i.rowIndex&&e.rowPinned==i.rowPinned),o=this.fullWidthGui?this.fullWidthGui.element:null===(t=this.centerGui)||void 0===t?void 0:t.element;o&&(o.classList.toggle("ag-full-width-focus",s),s&&o.focus({preventScroll:!0}))}refreshCell(e){this.centerCellCtrls=this.removeCellCtrl(this.centerCellCtrls,e),this.leftCellCtrls=this.removeCellCtrl(this.leftCellCtrls,e),this.rightCellCtrls=this.removeCellCtrl(this.rightCellCtrls,e),this.updateColumnLists()}removeCellCtrl(e,t){const i={list:[],map:{}};return e.list.forEach(e=>{e!==t&&(i.list.push(e),i.map[e.getInstanceId()]=e)}),i}onMouseEvent(e,t){switch(e){case"dblclick":this.onRowDblClick(t);break;case"click":this.onRowClick(t);break;case"touchstart":case"mousedown":this.onRowMouseDown(t)}}createRowEvent(e,t){return{type:e,node:this.rowNode,data:this.rowNode.data,rowIndex:this.rowNode.rowIndex,rowPinned:this.rowNode.rowPinned,context:this.gridOptionsService.context,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,event:t}}createRowEventWithSource(e,t){const i=this.createRowEvent(e,t);return i.source=this,i}onRowDblClick(e){if(Ee(e))return;const t=this.createRowEventWithSource(_e.EVENT_ROW_DOUBLE_CLICKED,e);this.beans.eventService.dispatchEvent(t)}onRowMouseDown(e){if(this.lastMouseDownOnDragger=_i(e.target,"ag-row-drag",3),!this.isFullWidth())return;const t=this.rowNode,i=this.beans.columnModel;this.beans.rangeService&&this.beans.rangeService.removeAllCellRanges(),this.beans.focusService.setFocusedCell({rowIndex:t.rowIndex,column:i.getAllDisplayedColumns()[0],rowPinned:t.rowPinned,forceBrowserFocus:!0})}onRowClick(e){if(Ee(e)||this.lastMouseDownOnDragger)return;const t=this.createRowEventWithSource(_e.EVENT_ROW_CLICKED,e);this.beans.eventService.dispatchEvent(t);const i=e.ctrlKey||e.metaKey,s=e.shiftKey;if(this.gridOptionsService.is("groupSelectsChildren")&&this.rowNode.group||!this.rowNode.selectable||this.rowNode.rowPinned||!this.gridOptionsService.isRowSelection()||this.gridOptionsService.is("suppressRowClickSelection"))return;const o=this.gridOptionsService.is("rowMultiSelectWithClick"),r=!this.gridOptionsService.is("suppressRowDeselection"),n="rowClicked";if(this.rowNode.isSelected())o?this.rowNode.setSelectedParams({newValue:!1,event:e,source:n}):i?r&&this.rowNode.setSelectedParams({newValue:!1,event:e,source:n}):this.rowNode.setSelectedParams({newValue:!0,clearSelection:!s,rangeSelect:s,event:e,source:n});else{const t=!o&&!i;this.rowNode.setSelectedParams({newValue:!0,clearSelection:t,rangeSelect:s,event:e,source:n})}}setupDetailRowAutoHeight(e){if(this.rowType!==sl.FullWidthDetail)return;if(!this.gridOptionsService.is("detailRowAutoHeight"))return;const t=()=>{const t=e.clientHeight;if(null!=t&&t>0){const e=()=>{this.rowNode.setRowHeight(t),this.beans.clientSideRowModel?this.beans.clientSideRowModel.onRowHeightChanged():this.beans.serverSideRowModel&&this.beans.serverSideRowModel.onRowHeightChanged()};this.beans.frameworkOverrides.setTimeout(e,0)}},i=this.beans.resizeObserverService.observeResize(e,t);this.addDestroyFunc(i),t()}createFullWidthParams(e,t){return{fullWidth:!0,data:this.rowNode.data,node:this.rowNode,value:this.rowNode.key,valueFormatted:this.rowNode.key,rowIndex:this.rowNode.rowIndex,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context,eGridCell:e,eParentOfValue:e,pinned:t,addRenderedRowListener:this.addEventListener.bind(this),registerRowDragger:(e,t,i,s)=>this.addFullWidthRowDragging(e,t,i,s)}}addFullWidthRowDragging(e,t,i="",s){if(!this.isFullWidth())return;const o=new fr(()=>i,this.rowNode,void 0,e,t,s);this.createManagedBean(o,this.beans.context)}onUiLevelChanged(){const e=this.beans.rowCssClassCalculator.calculateRowLevel(this.rowNode);if(this.rowLevel!=e){const t="ag-row-level-"+e,i="ag-row-level-"+this.rowLevel;this.allRowGuis.forEach(e=>{e.rowComp.addOrRemoveCssClass(t,!0),e.rowComp.addOrRemoveCssClass(i,!1)})}this.rowLevel=e}isFirstRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageFirstRow()}isLastRowOnPage(){return this.rowNode.rowIndex===this.beans.paginationProxy.getPageLastRow()}onModelUpdated(){this.refreshFirstAndLastRowStyles()}refreshFirstAndLastRowStyles(){const e=this.isFirstRowOnPage(),t=this.isLastRowOnPage();this.firstRowOnPage!==e&&(this.firstRowOnPage=e,this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-first",e))),this.lastRowOnPage!==t&&(this.lastRowOnPage=t,this.allRowGuis.forEach(e=>e.rowComp.addOrRemoveCssClass("ag-row-last",t)))}stopEditing(e=!1){if(this.stoppingRowEdit)return;const t=this.getAllCellCtrls(),i=this.editingRow;this.stoppingRowEdit=!0;let s=!1;for(const o of t){const t=o.stopEditing(e);i&&!e&&!s&&t&&(s=!0)}if(s){const e=this.createRowEvent(_e.EVENT_ROW_VALUE_CHANGED);this.beans.eventService.dispatchEvent(e)}i&&this.setEditingRow(!1),this.stoppingRowEdit=!1}setInlineEditingCss(e){this.allRowGuis.forEach(t=>{t.rowComp.addOrRemoveCssClass("ag-row-inline-editing",e),t.rowComp.addOrRemoveCssClass("ag-row-not-inline-editing",!e)})}setEditingRow(e){this.editingRow=e,this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass("ag-row-editing",e));const t=e?this.createRowEvent(_e.EVENT_ROW_EDITING_STARTED):this.createRowEvent(_e.EVENT_ROW_EDITING_STOPPED);this.beans.eventService.dispatchEvent(t)}startRowEditing(e=null,t=null,i=null){if(this.editingRow)return;this.getAllCellCtrls().reduce((s,o)=>{const r=o===t;return r?o.startEditing(e,r,i):o.startEditing(null,r,i),!!s||o.isEditing()},!1)&&this.setEditingRow(!0)}getAllCellCtrls(){if(0===this.leftCellCtrls.list.length&&0===this.rightCellCtrls.list.length)return this.centerCellCtrls.list;return[...this.centerCellCtrls.list,...this.leftCellCtrls.list,...this.rightCellCtrls.list]}postProcessClassesFromGridOptions(){const e=this.beans.rowCssClassCalculator.processClassesFromGridOptions(this.rowNode);e&&e.length&&e.forEach(e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!0))})}postProcessRowClassRules(){this.beans.rowCssClassCalculator.processRowClassRules(this.rowNode,e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!0))},e=>{this.allRowGuis.forEach(t=>t.rowComp.addOrRemoveCssClass(e,!1))})}setStylesFromGridOptions(e,t){e&&(this.rowStyles=this.processStylesFromGridOptions()),this.forEachGui(t,e=>e.rowComp.setUserStyles(this.rowStyles))}getPinnedForContainer(e){return e===Sl.LEFT?"left":e===Sl.RIGHT?"right":null}getInitialRowClasses(e){const t=this.getPinnedForContainer(e),i={rowNode:this.rowNode,rowFocused:this.rowFocused,fadeRowIn:this.fadeInAnimation[e],rowIsEven:this.rowNode.rowIndex%2==0,rowLevel:this.rowLevel,fullWidthRow:this.isFullWidth(),firstRowOnPage:this.isFirstRowOnPage(),lastRowOnPage:this.isLastRowOnPage(),printLayout:this.printLayout,expandable:this.rowNode.isExpandable(),pinned:t};return this.beans.rowCssClassCalculator.getInitialRowClasses(i)}processStylesFromGridOptions(){const e=this.gridOptionsService.get("rowStyle");if(e&&"function"==typeof e)return void console.warn("AG Grid: rowStyle should be an object of key/value styles, not be a function, use getRowStyle() instead");const t=this.gridOptionsService.getCallback("getRowStyle");let i;if(t){i=t({data:this.rowNode.data,node:this.rowNode,rowIndex:this.rowNode.rowIndex})}return i||e?Object.assign({},e,i):this.emptyStyle}onRowSelected(e){const t=!!this.rowNode.isSelected();this.forEachGui(e,e=>{e.rowComp.addOrRemoveCssClass("ag-row-selected",t),Yt(e.element,!!t||void 0);const i=this.createAriaLabel();Dt(e.element,null==i?"":i)})}createAriaLabel(){const e=this.rowNode.isSelected();if(e&&this.gridOptionsService.is("suppressRowDeselection"))return;return this.beans.localeService.getLocaleTextFunc()(e?"ariaRowDeselect":"ariaRowSelect",`Press SPACE to ${e?"deselect":"select"} this row.`)}isUseAnimationFrameForCreate(){return this.useAnimationFrameForCreate}addHoverFunctionality(e){this.active&&(this.addManagedListener(e,"mouseenter",()=>this.rowNode.onMouseEnter()),this.addManagedListener(e,"mouseleave",()=>this.rowNode.onMouseLeave()),this.addManagedListener(this.rowNode,ar.EVENT_MOUSE_ENTER,()=>{this.beans.dragService.isDragging()||this.gridOptionsService.is("suppressRowHoverHighlight")||(e.classList.add("ag-row-hover"),this.rowNode.setHovered(!0))}),this.addManagedListener(this.rowNode,ar.EVENT_MOUSE_LEAVE,()=>{e.classList.remove("ag-row-hover"),this.rowNode.setHovered(!1)}))}roundRowTopToBounds(e){const t=this.beans.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.applyPaginationOffset(t.top,!0)-100,s=this.applyPaginationOffset(t.bottom,!0)+100;return Math.min(Math.max(i,e),s)}getFrameworkOverrides(){return this.beans.frameworkOverrides}forEachGui(e,t){e?t(e):this.allRowGuis.forEach(t)}onRowHeightChanged(e){if(null==this.rowNode.rowHeight)return;const t=this.rowNode.rowHeight,i=this.beans.environment.getDefaultRowHeight(),s=this.gridOptionsService.isGetRowHeightFunction()?this.gridOptionsService.getRowHeightForNode(this.rowNode).height:void 0,o=s?Math.min(i,s)-2+"px":void 0;this.forEachGui(e,e=>{e.element.style.height=t+"px",o&&e.element.style.setProperty("--ag-line-height",o)})}addEventListener(e,t){super.addEventListener(e,t)}removeEventListener(e,t){super.removeEventListener(e,t)}destroyFirstPass(){this.active=!1,this.gridOptionsService.isAnimateRows()&&this.setupRemoveAnimation(),this.rowNode.setHovered(!1);const e=this.createRowEvent(_e.EVENT_VIRTUAL_ROW_REMOVED);this.dispatchEvent(e),this.beans.eventService.dispatchEvent(e),super.destroy()}setupRemoveAnimation(){if(this.isSticky())return;if(null!=this.rowNode.rowTop){const e=this.roundRowTopToBounds(this.rowNode.rowTop);this.setRowTop(e)}else this.allRowGuis.forEach(e=>e.rowComp.addOrRemoveCssClass("ag-opacity-zero",!0))}destroySecondPass(){this.allRowGuis.length=0;const e=e=>(e.list.forEach(e=>e.destroy()),{list:[],map:{}});this.centerCellCtrls=e(this.centerCellCtrls),this.leftCellCtrls=e(this.leftCellCtrls),this.rightCellCtrls=e(this.rightCellCtrls)}setFocusedClasses(e){this.forEachGui(e,e=>{e.rowComp.addOrRemoveCssClass("ag-row-focus",this.rowFocused),e.rowComp.addOrRemoveCssClass("ag-row-no-focus",!this.rowFocused)})}onCellFocused(){this.onCellFocusChanged()}onCellFocusCleared(){this.onCellFocusChanged()}onCellFocusChanged(){const e=this.beans.focusService.isRowFocused(this.rowNode.rowIndex,this.rowNode.rowPinned);e!==this.rowFocused&&(this.rowFocused=e,this.setFocusedClasses()),!e&&this.editingRow&&this.stopEditing(!1)}onPaginationChanged(){const e=this.beans.paginationProxy.getCurrentPage();this.paginationPage!==e&&(this.paginationPage=e,this.onTopChanged()),this.refreshFirstAndLastRowStyles()}onTopChanged(){this.setRowTop(this.rowNode.rowTop)}onPaginationPixelOffsetChanged(){this.onTopChanged()}applyPaginationOffset(e,t=!1){if(this.rowNode.isRowPinned()||this.rowNode.sticky)return e;return e+this.beans.paginationProxy.getPixelOffset()*(t?1:-1)}setRowTop(e){if(!this.printLayout&&t(e)){const t=this.applyPaginationOffset(e),i=(this.rowNode.isRowPinned()||this.rowNode.sticky?t:this.beans.rowContainerHeightService.getRealPixelPosition(t))+"px";this.setRowTopStyle(i)}}getInitialRowTop(e){return this.gridOptionsService.is("suppressRowTransform")?this.getInitialRowTopShared(e):void 0}getInitialTransform(e){return this.gridOptionsService.is("suppressRowTransform")?void 0:`translateY(${this.getInitialRowTopShared(e)})`}getInitialRowTopShared(e){if(this.printLayout)return"";let t;if(this.isSticky())t=this.rowNode.stickyRowTop;else{const i=this.slideInAnimation[e]?this.roundRowTopToBounds(this.rowNode.oldRowTop):this.rowNode.rowTop,s=this.applyPaginationOffset(i);t=this.rowNode.isRowPinned()?s:this.beans.rowContainerHeightService.getRealPixelPosition(s)}return t+"px"}setRowTopStyle(e){const t=this.gridOptionsService.is("suppressRowTransform");this.allRowGuis.forEach(i=>t?i.rowComp.setTop(e):i.rowComp.setTransform(`translateY(${e})`))}getRowNode(){return this.rowNode}getCellCtrl(e){let t=null;return this.getAllCellCtrls().forEach(i=>{i.getColumn()==e&&(t=i)}),null!=t||this.getAllCellCtrls().forEach(i=>{i.getColSpanningList().indexOf(e)>=0&&(t=i)}),t}onRowIndexChanged(){null!=this.rowNode.rowIndex&&(this.onCellFocusChanged(),this.updateRowIndexes(),this.postProcessCss())}getRowIndex(){return this.rowNode.getRowIndexString()}updateRowIndexes(e){const t=this.rowNode.getRowIndexString(),i=this.beans.headerNavigationService.getHeaderRowCount()+this.beans.filterManager.getHeaderRowCount(),s=this.rowNode.rowIndex%2==0,o=i+this.rowNode.rowIndex+1;this.forEachGui(e,e=>{e.rowComp.setRowIndex(t),e.rowComp.addOrRemoveCssClass("ag-row-even",s),e.rowComp.addOrRemoveCssClass("ag-row-odd",!s),Bt(e.element,o)})}getPinnedLeftRowElement(){return this.leftGui?this.leftGui.element:void 0}getPinnedRightRowElement(){return this.rightGui?this.rightGui.element:void 0}getBodyRowElement(){return this.centerGui?this.centerGui.element:void 0}getFullWidthRowElement(){return this.fullWidthGui?this.fullWidthGui.element:void 0}}rl.DOM_DATA_KEY_ROW_CTRL="renderedRow";var nl=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ll extends Le{constructor(e){super(),this.element=e}postConstruct(){this.addKeyboardListeners(),this.addMouseListeners(),this.mockContextMenuForIPad()}addKeyboardListeners(){const e=this.processKeyboardEvent.bind(this,"keydown");this.addManagedListener(this.element,"keydown",e)}addMouseListeners(){["dblclick","contextmenu","mouseover","mouseout","click",Re("touchstart")?"touchstart":"mousedown"].forEach(e=>{const t=this.processMouseEvent.bind(this,e);this.addManagedListener(this.element,e,t)})}processMouseEvent(e,t){if(!this.mouseEventService.isEventFromThisGrid(t)||Ee(t))return;const i=this.getRowForEvent(t),s=this.mouseEventService.getRenderedCellForEvent(t);"contextmenu"===e?this.handleContextMenuMouseEvent(t,null,i,s):(s&&s.onMouseEvent(e,t),i&&i.onMouseEvent(e,t))}mockContextMenuForIPad(){if(!ci())return;const e=new Wo(this.element);this.addManagedListener(e,Wo.EVENT_LONG_TAP,e=>{const t=this.getRowForEvent(e.touchEvent),i=this.mouseEventService.getRenderedCellForEvent(e.touchEvent);this.handleContextMenuMouseEvent(null,e.touchEvent,t,i)}),this.addDestroyFunc(()=>e.destroy())}getRowForEvent(e){let t=e.target;for(;t;){const e=this.gridOptionsService.getDomData(t,rl.DOM_DATA_KEY_ROW_CTRL);if(e)return e;t=t.parentElement}return null}handleContextMenuMouseEvent(e,t,i,s){const o=i?i.getRowNode():null,r=s?s.getColumn():null;let n=null;if(r){const i=e||t;s.dispatchCellContextMenuEvent(i),n=this.valueService.getValue(r,o)}const l=this.ctrlsService.getGridBodyCtrl(),a=s?s.getGui():l.getGridBodyElement();this.contextMenuFactory&&this.contextMenuFactory.onContextMenu(e,t,o,r,n,a)}getControlsForEventTarget(e){return{cellCtrl:Te(this.gridOptionsService,e,il.DOM_DATA_KEY_CELL_CTRL),rowCtrl:Te(this.gridOptionsService,e,rl.DOM_DATA_KEY_ROW_CTRL)}}processKeyboardEvent(e,t){const{cellCtrl:i,rowCtrl:s}=this.getControlsForEventTarget(t.target);t.defaultPrevented||(i?this.processCellKeyboardEvent(i,e,t):s&&s.isFullWidth()&&this.processFullWidthRowKeyboardEvent(s,e,t))}processCellKeyboardEvent(e,t,i){const s=e.getRowNode(),o=e.getColumn(),r=e.isEditing();if(!Es(this.gridOptionsService,i,s,o,r)&&"keydown"===t){!r&&this.navigationService.handlePageScrollingKey(i)||e.onKeyDown(i),this.doGridOperations(i,e.isEditing()),Ss(i)&&e.processCharacter(i)}if("keydown"===t){const t=e.createEvent(i,_e.EVENT_CELL_KEY_DOWN);this.eventService.dispatchEvent(t)}}processFullWidthRowKeyboardEvent(e,t,i){const s=e.getRowNode(),o=this.focusService.getFocusedCell(),r=o&&o.column;if(!Es(this.gridOptionsService,i,s,r,!1)){const s=i.key;if("keydown"===t)switch(s){case ys.PAGE_HOME:case ys.PAGE_END:case ys.PAGE_UP:case ys.PAGE_DOWN:this.navigationService.handlePageScrollingKey(i,!0);break;case ys.UP:case ys.DOWN:e.onKeyboardNavigate(i);break;case ys.TAB:e.onTabKeyDown(i)}}if("keydown"===t){const t=e.createRowEvent(_e.EVENT_CELL_KEY_DOWN,i);this.eventService.dispatchEvent(t)}}doGridOperations(e,t){if(!e.ctrlKey&&!e.metaKey)return;if(t)return;if(!this.mouseEventService.isEventFromThisGrid(e))return;const i=Ts(e);return i===ys.A?this.onCtrlAndA(e):i===ys.C?this.onCtrlAndC(e):i===ys.D?this.onCtrlAndD(e):i===ys.V?this.onCtrlAndV(e):i===ys.X?this.onCtrlAndX(e):i===ys.Y?this.onCtrlAndY():i===ys.Z?this.onCtrlAndZ(e):void 0}onCtrlAndA(e){const{pinnedRowModel:t,paginationProxy:i,rangeService:o}=this;if(o&&i.isRowsToRender()){const[e,i]=[t.isEmpty("top"),t.isEmpty("bottom")],r=e?null:"top";let n,l;i?(n=null,l=this.paginationProxy.getRowCount()-1):(n="bottom",l=t.getPinnedBottomRowData().length-1);const a=this.columnModel.getAllDisplayedColumns();if(s(a))return;o.setCellRange({rowStartIndex:0,rowStartPinned:r,rowEndIndex:l,rowEndPinned:n,columnStart:a[0],columnEnd:ne(a)})}e.preventDefault()}onCtrlAndC(e){if(!this.clipboardService||this.gridOptionsService.is("enableCellTextSelection"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||(e.preventDefault(),this.clipboardService.copyToClipboard())}onCtrlAndX(e){if(!this.clipboardService||this.gridOptionsService.is("enableCellTextSelection")||this.gridOptionsService.is("suppressCutToClipboard"))return;const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||(e.preventDefault(),this.clipboardService.cutToClipboard(void 0,"ui"))}onCtrlAndV(e){const{cellCtrl:t,rowCtrl:i}=this.getControlsForEventTarget(e.target);(null==t?void 0:t.isEditing())||(null==i?void 0:i.isEditing())||this.clipboardService&&!this.gridOptionsService.is("suppressClipboardPaste")&&this.clipboardService.pasteFromClipboard()}onCtrlAndD(e){this.clipboardService&&!this.gridOptionsService.is("suppressClipboardPaste")&&this.clipboardService.copyRangeDown(),e.preventDefault()}onCtrlAndZ(e){this.gridOptionsService.is("undoRedoCellEditing")&&(e.preventDefault(),e.shiftKey?this.undoRedoService.redo("ui"):this.undoRedoService.undo("ui"))}onCtrlAndY(){this.undoRedoService.redo("ui")}}nl([j("mouseEventService")],ll.prototype,"mouseEventService",void 0),nl([j("valueService")],ll.prototype,"valueService",void 0),nl([z("contextMenuFactory")],ll.prototype,"contextMenuFactory",void 0),nl([j("ctrlsService")],ll.prototype,"ctrlsService",void 0),nl([j("navigationService")],ll.prototype,"navigationService",void 0),nl([j("focusService")],ll.prototype,"focusService",void 0),nl([j("undoRedoService")],ll.prototype,"undoRedoService",void 0),nl([j("columnModel")],ll.prototype,"columnModel",void 0),nl([j("paginationProxy")],ll.prototype,"paginationProxy",void 0),nl([j("pinnedRowModel")],ll.prototype,"pinnedRowModel",void 0),nl([z("rangeService")],ll.prototype,"rangeService",void 0),nl([z("clipboardService")],ll.prototype,"clipboardService",void 0),nl([B],ll.prototype,"postConstruct",null);var al=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class dl extends Le{constructor(e){super(),this.centerContainerCtrl=e}postConstruct(){this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl(),this.listenForResize()}),this.addManagedListener(this.eventService,_e.EVENT_SCROLLBAR_WIDTH_CHANGED,this.onScrollbarWidthChanged.bind(this))}listenForResize(){const e=()=>this.onCenterViewportResized();this.centerContainerCtrl.registerViewportResizeListener(e),this.gridBodyCtrl.registerBodyViewportResizeListener(e)}onScrollbarWidthChanged(){this.checkViewportAndScrolls()}onCenterViewportResized(){if(this.centerContainerCtrl.isViewportVisible()){this.checkViewportAndScrolls();const e=this.centerContainerCtrl.getCenterWidth();e!==this.centerWidth&&(this.centerWidth=e,this.columnModel.refreshFlexedColumns({viewportWidth:this.centerWidth,updateBodyWidths:!0,fireResizedEvent:!0}))}else this.bodyHeight=0}checkViewportAndScrolls(){this.updateScrollVisibleService(),this.checkBodyHeight(),this.onHorizontalViewportChanged(),this.gridBodyCtrl.getScrollFeature().checkScrollLeft()}getBodyHeight(){return this.bodyHeight}checkBodyHeight(){const e=Hi(this.gridBodyCtrl.getBodyViewportElement());if(this.bodyHeight!==e){this.bodyHeight=e;const t={type:_e.EVENT_BODY_HEIGHT_CHANGED};this.eventService.dispatchEvent(t)}}updateScrollVisibleService(){this.updateScrollVisibleServiceImpl(),setTimeout(this.updateScrollVisibleServiceImpl.bind(this),500)}updateScrollVisibleServiceImpl(){const e={horizontalScrollShowing:this.isHorizontalScrollShowing(),verticalScrollShowing:this.gridBodyCtrl.isVerticalScrollShowing()};this.scrollVisibleService.setScrollsVisible(e)}isHorizontalScrollShowing(){return this.centerContainerCtrl.isHorizontalScrollShowing()}onHorizontalViewportChanged(){const e=this.centerContainerCtrl.getCenterWidth(),t=this.centerContainerCtrl.getViewportScrollLeft();this.columnModel.setViewportPosition(e,t)}}al([j("ctrlsService")],dl.prototype,"ctrlsService",void 0),al([j("columnModel")],dl.prototype,"columnModel",void 0),al([j("scrollVisibleService")],dl.prototype,"scrollVisibleService",void 0),al([B],dl.prototype,"postConstruct",null);var hl=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class cl extends Le{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,_e.EVENT_LEFT_PINNED_WIDTH_CHANGED,this.onPinnedLeftWidthChanged.bind(this))}onPinnedLeftWidthChanged(){const e=this.pinnedWidthService.getPinnedLeftWidth(),t=e>0;Mi(this.element,t),ns(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedLeftWidth()}}hl([j("pinnedWidthService")],cl.prototype,"pinnedWidthService",void 0),hl([B],cl.prototype,"postConstruct",null);var ul=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class pl extends Le{constructor(e){super(),this.element=e}postConstruct(){this.addManagedListener(this.eventService,_e.EVENT_RIGHT_PINNED_WIDTH_CHANGED,this.onPinnedRightWidthChanged.bind(this))}onPinnedRightWidthChanged(){const e=this.pinnedWidthService.getPinnedRightWidth(),t=e>0;Mi(this.element,t),ns(this.element,e)}getWidth(){return this.pinnedWidthService.getPinnedRightWidth()}}ul([j("pinnedWidthService")],pl.prototype,"pinnedWidthService",void 0),ul([B],pl.prototype,"postConstruct",null);var gl=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ml extends Le{constructor(e,t){super(),this.eContainer=e,this.eViewport=t}postConstruct(){this.addManagedListener(this.eventService,_e.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onHeightChanged.bind(this))}onHeightChanged(){const e=this.maxDivHeightScaler.getUiContainerHeight(),t=null!=e?e+"px":"";this.eContainer.style.height=t,this.eViewport&&(this.eViewport.style.height=t)}}gl([j("rowContainerHeightService")],ml.prototype,"maxDivHeightScaler",void 0),gl([B],ml.prototype,"postConstruct",null);var Cl=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class vl extends Le{constructor(e){super(),this.eContainer=e}postConstruct(){if(!this.gridOptionsService.is("enableRangeSelection")||i(this.rangeService))return;const e={eElement:this.eContainer,onDragStart:this.rangeService.onDragStart.bind(this.rangeService),onDragStop:this.rangeService.onDragStop.bind(this.rangeService),onDragging:this.rangeService.onDragging.bind(this.rangeService)};this.dragService.addDragSource(e),this.addDestroyFunc(()=>this.dragService.removeDragSource(e))}}Cl([z("rangeService")],vl.prototype,"rangeService",void 0),Cl([j("dragService")],vl.prototype,"dragService",void 0),Cl([B],vl.prototype,"postConstruct",null);var fl=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class wl extends Le{constructor(e,t=!1){super(),this.callback=e,this.addSpacer=t}postConstruct(){const e=this.setWidth.bind(this);this.addManagedPropertyListener("domLayout",e),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,_e.EVENT_LEFT_PINNED_WIDTH_CHANGED,e),this.addSpacer&&(this.addManagedListener(this.eventService,_e.EVENT_RIGHT_PINNED_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,_e.EVENT_SCROLL_VISIBILITY_CHANGED,e),this.addManagedListener(this.eventService,_e.EVENT_SCROLLBAR_WIDTH_CHANGED,e)),this.setWidth()}setWidth(){const{columnModel:e}=this,t=this.gridOptionsService.isDomLayout("print"),i=e.getBodyContainerWidth(),s=e.getDisplayedColumnsLeftWidth(),o=e.getDisplayedColumnsRightWidth();let r;if(t)r=i+s+o;else if(r=i,this.addSpacer){0===(this.gridOptionsService.is("enableRtl")?s:o)&&this.scrollVisibleService.isVerticalScrollShowing()&&(r+=this.gridOptionsService.getScrollbarWidth())}this.callback(r)}}fl([j("columnModel")],wl.prototype,"columnModel",void 0),fl([j("scrollVisibleService")],wl.prototype,"scrollVisibleService",void 0),fl([B],wl.prototype,"postConstruct",null);var yl,Sl,El=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};function Rl(e){switch(e){case yl.CENTER:case yl.TOP_CENTER:case yl.STICKY_TOP_CENTER:case yl.BOTTOM_CENTER:return Sl.CENTER;case yl.LEFT:case yl.TOP_LEFT:case yl.STICKY_TOP_LEFT:case yl.BOTTOM_LEFT:return Sl.LEFT;case yl.RIGHT:case yl.TOP_RIGHT:case yl.STICKY_TOP_RIGHT:case yl.BOTTOM_RIGHT:return Sl.RIGHT;case yl.FULL_WIDTH:case yl.TOP_FULL_WIDTH:case yl.STICKY_TOP_FULL_WIDTH:case yl.BOTTOM_FULL_WIDTH:return Sl.FULL_WIDTH;default:throw Error("Invalid Row Container Type")}}!function(e){e.LEFT="left",e.RIGHT="right",e.CENTER="center",e.FULL_WIDTH="fullWidth",e.TOP_LEFT="topLeft",e.TOP_RIGHT="topRight",e.TOP_CENTER="topCenter",e.TOP_FULL_WIDTH="topFullWidth",e.STICKY_TOP_LEFT="stickyTopLeft",e.STICKY_TOP_RIGHT="stickyTopRight",e.STICKY_TOP_CENTER="stickyTopCenter",e.STICKY_TOP_FULL_WIDTH="stickyTopFullWidth",e.BOTTOM_LEFT="bottomLeft",e.BOTTOM_RIGHT="bottomRight",e.BOTTOM_CENTER="bottomCenter",e.BOTTOM_FULL_WIDTH="bottomFullWidth"}(yl||(yl={})),function(e){e.LEFT="left",e.RIGHT="right",e.CENTER="center",e.FULL_WIDTH="fullWidth"}(Sl||(Sl={}));const Tl=$e([[yl.CENTER,"ag-center-cols-container"],[yl.LEFT,"ag-pinned-left-cols-container"],[yl.RIGHT,"ag-pinned-right-cols-container"],[yl.FULL_WIDTH,"ag-full-width-container"],[yl.TOP_CENTER,"ag-floating-top-container"],[yl.TOP_LEFT,"ag-pinned-left-floating-top"],[yl.TOP_RIGHT,"ag-pinned-right-floating-top"],[yl.TOP_FULL_WIDTH,"ag-floating-top-full-width-container"],[yl.STICKY_TOP_CENTER,"ag-sticky-top-container"],[yl.STICKY_TOP_LEFT,"ag-pinned-left-sticky-top"],[yl.STICKY_TOP_RIGHT,"ag-pinned-right-sticky-top"],[yl.STICKY_TOP_FULL_WIDTH,"ag-sticky-top-full-width-container"],[yl.BOTTOM_CENTER,"ag-floating-bottom-container"],[yl.BOTTOM_LEFT,"ag-pinned-left-floating-bottom"],[yl.BOTTOM_RIGHT,"ag-pinned-right-floating-bottom"],[yl.BOTTOM_FULL_WIDTH,"ag-floating-bottom-full-width-container"]]),bl=$e([[yl.CENTER,"ag-center-cols-viewport"],[yl.TOP_CENTER,"ag-floating-top-viewport"],[yl.STICKY_TOP_CENTER,"ag-sticky-top-viewport"],[yl.BOTTOM_CENTER,"ag-floating-bottom-viewport"]]);class Dl extends Le{constructor(e){super(),this.visible=!0,this.EMPTY_CTRLS=[],this.name=e,this.isFullWithContainer=this.name===yl.TOP_FULL_WIDTH||this.name===yl.STICKY_TOP_FULL_WIDTH||this.name===yl.BOTTOM_FULL_WIDTH||this.name===yl.FULL_WIDTH}static getRowContainerCssClasses(e){return{container:Tl.get(e),viewport:bl.get(e)}}static getPinned(e){switch(e){case yl.BOTTOM_LEFT:case yl.TOP_LEFT:case yl.STICKY_TOP_LEFT:case yl.LEFT:return"left";case yl.BOTTOM_RIGHT:case yl.TOP_RIGHT:case yl.STICKY_TOP_RIGHT:case yl.RIGHT:return"right";default:return null}}postConstruct(){this.enableRtl=this.gridOptionsService.is("enableRtl"),this.embedFullWidthRows=this.gridOptionsService.is("embedFullWidthRows"),this.forContainers([yl.CENTER],()=>this.viewportSizeFeature=this.createManagedBean(new dl(this)))}registerWithCtrlsService(){switch(this.name){case yl.CENTER:this.ctrlsService.registerCenterRowContainerCtrl(this);break;case yl.LEFT:this.ctrlsService.registerLeftRowContainerCtrl(this);break;case yl.RIGHT:this.ctrlsService.registerRightRowContainerCtrl(this);break;case yl.TOP_CENTER:this.ctrlsService.registerTopCenterRowContainerCtrl(this);break;case yl.TOP_LEFT:this.ctrlsService.registerTopLeftRowContainerCon(this);break;case yl.TOP_RIGHT:this.ctrlsService.registerTopRightRowContainerCtrl(this);break;case yl.STICKY_TOP_CENTER:this.ctrlsService.registerStickyTopCenterRowContainerCtrl(this);break;case yl.STICKY_TOP_LEFT:this.ctrlsService.registerStickyTopLeftRowContainerCon(this);break;case yl.STICKY_TOP_RIGHT:this.ctrlsService.registerStickyTopRightRowContainerCtrl(this);break;case yl.BOTTOM_CENTER:this.ctrlsService.registerBottomCenterRowContainerCtrl(this);break;case yl.BOTTOM_LEFT:this.ctrlsService.registerBottomLeftRowContainerCtrl(this);break;case yl.BOTTOM_RIGHT:this.ctrlsService.registerBottomRightRowContainerCtrl(this)}}forContainers(e,t){e.indexOf(this.name)>=0&&t()}getContainerElement(){return this.eContainer}getViewportSizeFeature(){return this.viewportSizeFeature}setComp(e,t,i){this.comp=e,this.eContainer=t,this.eViewport=i,this.createManagedBean(new ll(this.eContainer)),this.addPreventScrollWhileDragging(),this.listenOnDomOrder(),this.stopHScrollOnPinnedRows();const s=[yl.TOP_CENTER,yl.TOP_LEFT,yl.TOP_RIGHT],o=[yl.STICKY_TOP_CENTER,yl.STICKY_TOP_LEFT,yl.STICKY_TOP_RIGHT],r=[...s,...[yl.BOTTOM_CENTER,yl.BOTTOM_LEFT,yl.BOTTOM_RIGHT],...[yl.CENTER,yl.LEFT,yl.RIGHT],...o],n=[yl.CENTER,yl.LEFT,yl.RIGHT,yl.FULL_WIDTH],l=[yl.CENTER,yl.TOP_CENTER,yl.STICKY_TOP_CENTER,yl.BOTTOM_CENTER],a=[yl.LEFT,yl.BOTTOM_LEFT,yl.TOP_LEFT,yl.STICKY_TOP_LEFT],d=[yl.RIGHT,yl.BOTTOM_RIGHT,yl.TOP_RIGHT,yl.STICKY_TOP_RIGHT];this.forContainers(a,()=>{this.pinnedWidthFeature=this.createManagedBean(new cl(this.eContainer)),this.addManagedListener(this.eventService,_e.EVENT_LEFT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(d,()=>{this.pinnedWidthFeature=this.createManagedBean(new pl(this.eContainer)),this.addManagedListener(this.eventService,_e.EVENT_RIGHT_PINNED_WIDTH_CHANGED,()=>this.onPinnedWidthChanged())}),this.forContainers(n,()=>this.createManagedBean(new ml(this.eContainer,this.name===yl.CENTER?i:void 0))),this.forContainers(r,()=>this.createManagedBean(new vl(this.eContainer))),this.forContainers(l,()=>this.createManagedBean(new wl(e=>this.comp.setContainerWidth(e+"px")))),wi()&&(this.forContainers([yl.CENTER],()=>{const e=this.enableRtl?_e.EVENT_LEFT_PINNED_WIDTH_CHANGED:_e.EVENT_RIGHT_PINNED_WIDTH_CHANGED;this.addManagedListener(this.eventService,e,()=>this.refreshPaddingForFakeScrollbar())}),this.refreshPaddingForFakeScrollbar()),this.addListeners(),this.registerWithCtrlsService()}refreshPaddingForFakeScrollbar(){const{enableRtl:e,columnModel:t,eContainer:i}=this,s=e?yl.LEFT:yl.RIGHT;this.forContainers([yl.CENTER,s],()=>{const o=t.getContainerWidth(s),r=e?"marginLeft":"marginRight";i.style[r]=o?"16px":"0px"})}addListeners(){this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>this.onDisplayedColumnsChanged()),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>this.onDisplayedColumnsWidthChanged()),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_ROWS_CHANGED,e=>this.onDisplayedRowsChanged(e.afterScroll)),this.onDisplayedColumnsChanged(),this.onDisplayedColumnsWidthChanged(),this.onDisplayedRowsChanged()}listenOnDomOrder(){if([yl.STICKY_TOP_CENTER,yl.STICKY_TOP_LEFT,yl.STICKY_TOP_RIGHT,yl.STICKY_TOP_FULL_WIDTH].indexOf(this.name)>=0)return void this.comp.setDomOrder(!0);const e=()=>{const e=this.gridOptionsService.is("ensureDomOrder"),t=this.gridOptionsService.isDomLayout("print");this.comp.setDomOrder(e||t)};this.addManagedPropertyListener("domLayout",e),e()}stopHScrollOnPinnedRows(){this.forContainers([yl.TOP_CENTER,yl.STICKY_TOP_CENTER,yl.BOTTOM_CENTER],()=>{this.addManagedListener(this.eViewport,"scroll",()=>this.eViewport.scrollLeft=0)})}onDisplayedColumnsChanged(){this.forContainers([yl.CENTER],()=>this.onHorizontalViewportChanged())}onDisplayedColumnsWidthChanged(){this.forContainers([yl.CENTER],()=>this.onHorizontalViewportChanged())}addPreventScrollWhileDragging(){const e=e=>{this.dragService.isDragging()&&e.cancelable&&e.preventDefault()};this.eContainer.addEventListener("touchmove",e,{passive:!1}),this.addDestroyFunc(()=>this.eContainer.removeEventListener("touchmove",e))}onHorizontalViewportChanged(e=!1){const t=this.getCenterWidth(),i=this.getCenterViewportScrollLeft();this.columnModel.setViewportPosition(t,i,e)}getCenterWidth(){return ki(this.eViewport)}getCenterViewportScrollLeft(){return zi(this.eViewport,this.enableRtl)}registerViewportResizeListener(e){const t=this.resizeObserverService.observeResize(this.eViewport,e);this.addDestroyFunc(()=>t())}isViewportVisible(){return qi(this.eViewport)}getViewportScrollLeft(){return zi(this.eViewport,this.enableRtl)}isHorizontalScrollShowing(){return this.gridOptionsService.is("alwaysShowHorizontalScroll")||ss(this.eViewport)}getViewportElement(){return this.eViewport}setContainerTranslateX(e){this.eContainer.style.transform=`translateX(${e}px)`}getHScrollPosition(){return{left:this.eViewport.scrollLeft,right:this.eViewport.scrollLeft+this.eViewport.offsetWidth}}setCenterViewportScrollLeft(e){Ki(this.eViewport,e,this.enableRtl)}isContainerVisible(){return!Dl.getPinned(this.name)||!!this.pinnedWidthFeature&&this.pinnedWidthFeature.getWidth()>0}onPinnedWidthChanged(){const e=this.isContainerVisible();this.visible!=e&&(this.visible=e,this.onDisplayedRowsChanged()),wi()&&this.refreshPaddingForFakeScrollbar()}onDisplayedRowsChanged(e=!1){if(this.visible){const t=this.gridOptionsService.isDomLayout("print"),i=e=>{const i=e.isFullWidth(),s=this.embedFullWidthRows||t;return this.isFullWithContainer?!s&&i:s||!i},s=this.getRowCtrls().filter(i);this.comp.setRowCtrls(s,e)}else this.comp.setRowCtrls(this.EMPTY_CTRLS,!1)}getRowCtrls(){switch(this.name){case yl.TOP_CENTER:case yl.TOP_LEFT:case yl.TOP_RIGHT:case yl.TOP_FULL_WIDTH:return this.rowRenderer.getTopRowCtrls();case yl.STICKY_TOP_CENTER:case yl.STICKY_TOP_LEFT:case yl.STICKY_TOP_RIGHT:case yl.STICKY_TOP_FULL_WIDTH:return this.rowRenderer.getStickyTopRowCtrls();case yl.BOTTOM_CENTER:case yl.BOTTOM_LEFT:case yl.BOTTOM_RIGHT:case yl.BOTTOM_FULL_WIDTH:return this.rowRenderer.getBottomRowCtrls();default:return this.rowRenderer.getCentreRowCtrls()}}}El([j("scrollVisibleService")],Dl.prototype,"scrollVisibleService",void 0),El([j("dragService")],Dl.prototype,"dragService",void 0),El([j("ctrlsService")],Dl.prototype,"ctrlsService",void 0),El([j("columnModel")],Dl.prototype,"columnModel",void 0),El([j("resizeObserverService")],Dl.prototype,"resizeObserverService",void 0),El([j("animationFrameService")],Dl.prototype,"animationFrameService",void 0),El([j("rowRenderer")],Dl.prototype,"rowRenderer",void 0),El([B],Dl.prototype,"postConstruct",null);var Ol=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const Pl=`<div class="ag-root ag-unselectable" role="treegrid">\n        <ag-header-root ref="gridHeader"></ag-header-root>\n        <div class="ag-floating-top" ref="eTop" role="presentation">\n            <ag-row-container ref="topLeftContainer" name="${yl.TOP_LEFT}"></ag-row-container>\n            <ag-row-container ref="topCenterContainer" name="${yl.TOP_CENTER}"></ag-row-container>\n            <ag-row-container ref="topRightContainer" name="${yl.TOP_RIGHT}"></ag-row-container>\n            <ag-row-container ref="topFullWidthContainer" name="${yl.TOP_FULL_WIDTH}"></ag-row-container>\n        </div>\n        <div class="ag-body" ref="eBody" role="presentation">\n            <div class="ag-body-viewport" ref="eBodyViewport" role="presentation">\n                <ag-row-container ref="leftContainer" name="${yl.LEFT}"></ag-row-container>\n                <ag-row-container ref="centerContainer" name="${yl.CENTER}"></ag-row-container>\n                <ag-row-container ref="rightContainer" name="${yl.RIGHT}"></ag-row-container>\n                <ag-row-container ref="fullWidthContainer" name="${yl.FULL_WIDTH}"></ag-row-container>\n            </div>\n            <ag-fake-vertical-scroll></ag-fake-vertical-scroll>\n        </div>\n        <div class="ag-sticky-top" ref="eStickyTop" role="presentation">\n            <ag-row-container ref="stickyTopLeftContainer" name="${yl.STICKY_TOP_LEFT}"></ag-row-container>\n            <ag-row-container ref="stickyTopCenterContainer" name="${yl.STICKY_TOP_CENTER}"></ag-row-container>\n            <ag-row-container ref="stickyTopRightContainer" name="${yl.STICKY_TOP_RIGHT}"></ag-row-container>\n            <ag-row-container ref="stickyTopFullWidthContainer" name="${yl.STICKY_TOP_FULL_WIDTH}"></ag-row-container>\n        </div>\n        <div class="ag-floating-bottom" ref="eBottom" role="presentation">\n            <ag-row-container ref="bottomLeftContainer" name="${yl.BOTTOM_LEFT}"></ag-row-container>\n            <ag-row-container ref="bottomCenterContainer" name="${yl.BOTTOM_CENTER}"></ag-row-container>\n            <ag-row-container ref="bottomRightContainer" name="${yl.BOTTOM_RIGHT}"></ag-row-container>\n            <ag-row-container ref="bottomFullWidthContainer" name="${yl.BOTTOM_FULL_WIDTH}"></ag-row-container>\n        </div>\n        <ag-fake-horizontal-scroll></ag-fake-horizontal-scroll>\n        <ag-overlay-wrapper></ag-overlay-wrapper>\n    </div>`;class Al extends js{constructor(){super(Pl)}init(){const e=(e,t)=>{const i=e+"px";t.style.minHeight=i,t.style.height=i},t={setRowAnimationCssOnBodyViewport:(e,t)=>this.setRowAnimationCssOnBodyViewport(e,t),setColumnCount:e=>Wt(this.getGui(),e),setRowCount:e=>kt(this.getGui(),e),setTopHeight:t=>e(t,this.eTop),setBottomHeight:t=>e(t,this.eBottom),setTopDisplay:e=>this.eTop.style.display=e,setBottomDisplay:e=>this.eBottom.style.display=e,setStickyTopHeight:e=>this.eStickyTop.style.height=e,setStickyTopTop:e=>this.eStickyTop.style.top=e,setStickyTopWidth:e=>this.eStickyTop.style.width=e,setColumnMovingCss:(e,t)=>this.addOrRemoveCssClass(e,t),updateLayoutClasses:(e,t)=>{[this.eBodyViewport.classList,this.eBody.classList].forEach(e=>{e.toggle(Ln.AUTO_HEIGHT,t.autoHeight),e.toggle(Ln.NORMAL,t.normal),e.toggle(Ln.PRINT,t.print)}),this.addOrRemoveCssClass(Ln.AUTO_HEIGHT,t.autoHeight),this.addOrRemoveCssClass(Ln.NORMAL,t.normal),this.addOrRemoveCssClass(Ln.PRINT,t.print)},setAlwaysVerticalScrollClass:(e,t)=>this.eBodyViewport.classList.toggle("ag-force-vertical-scroll",t),registerBodyViewportResizeListener:e=>{const t=this.resizeObserverService.observeResize(this.eBodyViewport,e);this.addDestroyFunc(()=>t())},setPinnedTopBottomOverflowY:e=>this.eTop.style.overflowY=this.eBottom.style.overflowY=e,setCellSelectableCss:(e,t)=>{[this.eTop,this.eBodyViewport,this.eBottom].forEach(i=>i.classList.toggle(e,t))},setBodyViewportWidth:e=>this.eBodyViewport.style.width=e};this.ctrl=this.createManagedBean(new Wn),this.ctrl.setComp(t,this.getGui(),this.eBodyViewport,this.eTop,this.eBottom,this.eStickyTop),(this.rangeService||"multiple"===this.gridOptionsService.get("rowSelection"))&&Ht(this.getGui(),!0)}setRowAnimationCssOnBodyViewport(e,t){const i=this.eBodyViewport.classList;i.toggle(kn.ANIMATION_ON,t),i.toggle(kn.ANIMATION_OFF,!t)}getFloatingTopBottom(){return[this.eTop,this.eBottom]}}Ol([j("resizeObserverService")],Al.prototype,"resizeObserverService",void 0),Ol([z("rangeService")],Al.prototype,"rangeService",void 0),Ol([Ks("eBodyViewport")],Al.prototype,"eBodyViewport",void 0),Ol([Ks("eStickyTop")],Al.prototype,"eStickyTop",void 0),Ol([Ks("eTop")],Al.prototype,"eTop",void 0),Ol([Ks("eBottom")],Al.prototype,"eBottom",void 0),Ol([Ks("gridHeader")],Al.prototype,"headerRootComp",void 0),Ol([Ks("eBody")],Al.prototype,"eBody",void 0),Ol([B],Al.prototype,"init",null);var Fl=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Ll=class extends Le{postConstruct(){this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onDisplayedColumnsWidthChanged.bind(this))}onDisplayedColumnsChanged(){this.update()}onDisplayedColumnsWidthChanged(){this.update()}update(){this.updateImpl(),setTimeout(this.updateImpl.bind(this),500)}updateImpl(){const e=this.ctrlsService.getCenterRowContainerCtrl();if(!e)return;const t={horizontalScrollShowing:e.isHorizontalScrollShowing(),verticalScrollShowing:this.isVerticalScrollShowing()};this.setScrollsVisible(t)}setScrollsVisible(e){if(this.horizontalScrollShowing!==e.horizontalScrollShowing||this.verticalScrollShowing!==e.verticalScrollShowing){this.horizontalScrollShowing=e.horizontalScrollShowing,this.verticalScrollShowing=e.verticalScrollShowing;const t={type:_e.EVENT_SCROLL_VISIBILITY_CHANGED};this.eventService.dispatchEvent(t)}}isHorizontalScrollShowing(){return this.horizontalScrollShowing}isVerticalScrollShowing(){return this.verticalScrollShowing}};Fl([j("ctrlsService")],Ll.prototype,"ctrlsService",void 0),Fl([B],Ll.prototype,"postConstruct",null),Ll=Fl([U("scrollVisibleService")],Ll);var Il,Nl=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Ml=Il=class extends Le{constructor(){super(...arguments),this.gridInstanceId=Il.gridInstanceSequence.next()}stampTopLevelGridCompWithGridInstance(e){e[Il.GRID_DOM_KEY]=this.gridInstanceId}getRenderedCellForEvent(e){return Te(this.gridOptionsService,e.target,il.DOM_DATA_KEY_CELL_CTRL)}isEventFromThisGrid(e){return this.isElementInThisGrid(e.target)}isElementInThisGrid(e){let i=e;for(;i;){const e=i[Il.GRID_DOM_KEY];if(t(e)){return e===this.gridInstanceId}i=i.parentElement}return!1}getCellPositionForEvent(e){const t=this.getRenderedCellForEvent(e);return t?t.getCellPosition():null}getNormalisedPosition(e){const t=this.gridOptionsService.isDomLayout("normal"),i=e;let s,o;if(null!=i.clientX||null!=i.clientY?(s=i.clientX,o=i.clientY):(s=i.x,o=i.y),t){const e=this.ctrlsService.getGridBodyCtrl(),t=e.getScrollFeature().getVScrollPosition();s+=e.getScrollFeature().getHScrollPosition().left,o+=t.top}return{x:s,y:o}}};Ml.gridInstanceSequence=new Ns,Ml.GRID_DOM_KEY="__ag_grid_instance",Nl([j("ctrlsService")],Ml.prototype,"ctrlsService",void 0),Ml=Il=Nl([U("mouseEventService")],Ml);var Gl=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let xl=class extends Le{constructor(){super(),this.onPageDown=N(this.onPageDown,100),this.onPageUp=N(this.onPageUp,100)}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}handlePageScrollingKey(e,t=!1){const i=e.key,s=e.altKey,o=e.ctrlKey||e.metaKey,r=!!this.rangeService&&e.shiftKey,n=this.mouseEventService.getCellPositionForEvent(e);let l=!1;switch(i){case ys.PAGE_HOME:case ys.PAGE_END:o||s||(this.onHomeOrEndKey(i),l=!0);break;case ys.LEFT:case ys.RIGHT:case ys.UP:case ys.DOWN:if(!n)return!1;!o||s||r||(this.onCtrlUpDownLeftRight(i,n),l=!0);break;case ys.PAGE_DOWN:case ys.PAGE_UP:o||s||(l=this.handlePageUpDown(i,n,t))}return l&&e.preventDefault(),l}handlePageUpDown(e,t,i){return i&&(t=this.focusService.getFocusedCell()),!!t&&(e===ys.PAGE_UP?this.onPageUp(t):this.onPageDown(t),!0)}navigateTo(e){const{scrollIndex:i,scrollType:s,scrollColumn:o,focusIndex:r,focusColumn:n}=e;if(t(o)&&!o.isPinned()&&this.gridBodyCon.getScrollFeature().ensureColumnVisible(o),t(i)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(i,s),e.isAsync||this.gridBodyCon.getScrollFeature().ensureIndexVisible(r),this.focusService.setFocusedCell({rowIndex:r,column:n,rowPinned:null,forceBrowserFocus:!0}),this.rangeService){const e={rowIndex:r,rowPinned:null,column:n};this.rangeService.setRangeToCell(e)}}onPageDown(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.getViewportHeight(),s=this.paginationProxy.getPixelOffset(),o=t.top+i,r=this.paginationProxy.getRowIndexAtPixel(o+s);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,r):this.navigateToNextPage(e,r)}onPageUp(e){const t=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),i=this.paginationProxy.getPixelOffset(),s=t.top,o=this.paginationProxy.getRowIndexAtPixel(s+i);this.columnModel.isAutoRowHeightActive()?this.navigateToNextPageWithAutoHeight(e,o,!0):this.navigateToNextPage(e,o,!0)}navigateToNextPage(e,t,i=!1){const s=this.getViewportHeight(),o=this.paginationProxy.getPageFirstRow(),r=this.paginationProxy.getPageLastRow(),n=this.paginationProxy.getPixelOffset(),l=this.paginationProxy.getRow(e.rowIndex),a=i?(null==l?void 0:l.rowHeight)-s-n:s-n,d=(null==l?void 0:l.rowTop)+a;let h,c=this.paginationProxy.getRowIndexAtPixel(d+n);if(c===e.rowIndex){const s=i?-1:1;t=c=e.rowIndex+s}i?(h="bottom",c<o&&(c=o),t<o&&(t=o)):(h="top",c>r&&(c=r),t>r&&(t=r)),this.isRowTallerThanView(c)&&(t=c,h="top"),this.navigateTo({scrollIndex:t,scrollType:h,scrollColumn:null,focusIndex:c,focusColumn:e.column})}navigateToNextPageWithAutoHeight(e,t,i=!1){this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:t,focusColumn:e.column}),setTimeout(()=>{const s=this.getNextFocusIndexForAutoHeight(e,i);this.navigateTo({scrollIndex:t,scrollType:i?"bottom":"top",scrollColumn:null,focusIndex:s,focusColumn:e.column,isAsync:!0})},50)}getNextFocusIndexForAutoHeight(e,t=!1){var i;const s=t?-1:1,o=this.getViewportHeight(),r=this.paginationProxy.getPageLastRow();let n=0,l=e.rowIndex;for(;l>=0&&l<=r;){const e=this.paginationProxy.getRow(l);if(e){const t=null!==(i=e.rowHeight)&&void 0!==i?i:0;if(n+t>o)break;n+=t}l+=s}return Math.max(0,Math.min(l,r))}getViewportHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition(),t=this.gridOptionsService.getScrollbarWidth();let i=e.bottom-e.top;return this.ctrlsService.getCenterRowContainerCtrl().isHorizontalScrollShowing()&&(i-=t),i}isRowTallerThanView(e){const t=this.paginationProxy.getRow(e);if(!t)return!1;const i=t.rowHeight;return"number"==typeof i&&i>this.getViewportHeight()}onCtrlUpDownLeftRight(e,t){const i=this.cellNavigationService.getNextCellToFocus(e,t,!0),{rowIndex:s,column:o}=i;this.navigateTo({scrollIndex:s,scrollType:null,scrollColumn:o,focusIndex:s,focusColumn:o})}onHomeOrEndKey(e){const t=e===ys.PAGE_HOME,i=this.columnModel.getAllDisplayedColumns(),s=t?i[0]:ne(i),o=t?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow();this.navigateTo({scrollIndex:o,scrollType:null,scrollColumn:s,focusIndex:o,focusColumn:s})}onTabKeyDown(e,t){const i=t.shiftKey;if(this.tabToNextCellCommon(e,i,t))t.preventDefault();else if(i){const{rowIndex:i,rowPinned:s}=e.getRowPosition();(s?0===i:i===this.paginationProxy.getPageFirstRow())&&(0===this.gridOptionsService.getNum("headerHeight")?this.focusService.focusNextGridCoreContainer(!0,!0):(t.preventDefault(),this.focusService.focusPreviousFromFirstCell(t)))}else e instanceof il&&e.focusCell(!0),this.focusService.focusNextGridCoreContainer(i)&&t.preventDefault()}tabToNextCell(e,t){const i=this.focusService.getFocusedCell();if(!i)return!1;let s=this.getCellByPosition(i);return!!(s||(s=this.rowRenderer.getRowByPosition(i),s&&s.isFullWidth()))&&this.tabToNextCellCommon(s,e,t)}tabToNextCellCommon(e,t,i){let s,o=e.isEditing();if(!o&&e instanceof il){const t=e.getRowCtrl();t&&(o=t.isEditing())}return s=o?"fullRow"===this.gridOptionsService.get("editType")?this.moveToNextEditingRow(e,t,i):this.moveToNextEditingCell(e,t,i):this.moveToNextCellNotEditing(e,t),s||!!this.focusService.getFocusedHeader()}moveToNextEditingCell(e,t,i=null){const s=e.getCellPosition();e.getGui().focus(),e.stopEditing();const o=this.findNextCellToFocusOn(s,t,!0);return null!=o&&(o.startEditing(null,!0,i),o.focusCell(!1),!0)}moveToNextEditingRow(e,t,i=null){const s=e.getCellPosition(),o=this.findNextCellToFocusOn(s,t,!0);if(null==o)return!1;const r=o.getCellPosition(),n=this.isCellEditable(s),l=this.isCellEditable(r),a=r&&s.rowIndex===r.rowIndex&&s.rowPinned===r.rowPinned;if(n&&e.setFocusOutOnEditor(),!a){e.getRowCtrl().stopEditing();o.getRowCtrl().startRowEditing(void 0,void 0,i)}return l?(o.setFocusInOnEditor(),o.focusCell()):o.focusCell(!0),!0}moveToNextCellNotEditing(e,i){const s=this.columnModel.getAllDisplayedColumns();let o;o=e instanceof rl?Object.assign(Object.assign({},e.getRowPosition()),{column:i?s[0]:ne(s)}):e.getCellPosition();const r=this.findNextCellToFocusOn(o,i,!1);if(r instanceof il)r.focusCell(!0);else if(r)return this.tryToFocusFullWidthRow(r.getRowPosition(),i);return t(r)}findNextCellToFocusOn(e,i,s){let o=e;for(;;){e!==o&&(e=o),i||(o=this.getLastCellOfColSpan(o)),o=this.cellNavigationService.getNextTabbedCell(o,i);const r=this.gridOptionsService.getCallback("tabToNextCell");if(t(r)){const n=r({backwards:i,editing:s,previousCellPosition:e,nextCellPosition:o||null});t(n)?(n.floating&&(T(()=>{console.warn("AG Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?")},"no floating in userCell"),n.rowPinned=n.floating),o={rowIndex:n.rowIndex,column:n.column,rowPinned:n.rowPinned}):o=null}if(!o)return null;if(o.rowIndex<0){const e=this.headerNavigationService.getHeaderRowCount();return this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:e+o.rowIndex,column:o.column},fromCell:!0}),null}const n="fullRow"===this.gridOptionsService.get("editType");if(s&&!n){if(!this.isCellEditable(o))continue}this.ensureCellVisible(o);const l=this.getCellByPosition(o);if(!l){const e=this.rowRenderer.getRowByPosition(o);if(!e||!e.isFullWidth()||s)continue;return e}if(!l.isSuppressNavigable())return this.rangeService&&this.rangeService.setRangeToCell(o),l}}isCellEditable(e){const t=this.lookupRowNodeForCell(e);return!!t&&e.column.isCellEditable(t)}getCellByPosition(e){const t=this.rowRenderer.getRowByPosition(e);return t?t.getCellCtrl(e.column):null}lookupRowNodeForCell(e){return"top"===e.rowPinned?this.pinnedRowModel.getPinnedTopRow(e.rowIndex):"bottom"===e.rowPinned?this.pinnedRowModel.getPinnedBottomRow(e.rowIndex):this.paginationProxy.getRow(e.rowIndex)}navigateToNextCell(e,s,o,r){let n=o,l=!1;for(;n&&(n===o||!this.isValidNavigateCell(n));)this.gridOptionsService.is("enableRtl")?s===ys.LEFT&&(n=this.getLastCellOfColSpan(n)):s===ys.RIGHT&&(n=this.getLastCellOfColSpan(n)),n=this.cellNavigationService.getNextCellToFocus(s,n),l=i(n);if(l&&e&&e.key===ys.UP&&(n={rowIndex:-1,rowPinned:null,column:o.column}),r){const i=this.gridOptionsService.getCallback("navigateToNextCell");if(t(i)){const r=i({key:s,previousCellPosition:o,nextCellPosition:n||null,event:e});t(r)?(r.floating&&(T(()=>{console.warn("AG Grid: tabToNextCellFunc return type should have attributes: rowIndex, rowPinned, column. However you had 'floating', maybe you meant 'rowPinned'?")},"no floating in userCell"),r.rowPinned=r.floating),n={rowPinned:r.rowPinned,rowIndex:r.rowIndex,column:r.column}):n=null}}if(!n)return;if(n.rowIndex<0){const t=this.headerNavigationService.getHeaderRowCount();return void this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:t+n.rowIndex,column:o.column},event:e||void 0,fromCell:!0})}const a=this.getNormalisedPosition(n);a?this.focusPosition(a):this.tryToFocusFullWidthRow(n)}getNormalisedPosition(e){this.ensureCellVisible(e);const t=this.getCellByPosition(e);return t?(e=t.getCellPosition(),this.ensureCellVisible(e),e):null}tryToFocusFullWidthRow(e,t=!1){const i=this.columnModel.getAllDisplayedColumns(),s=this.rowRenderer.getRowByPosition(e);if(!s||!s.isFullWidth())return!1;const o=this.focusService.getFocusedCell(),r={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column||(t?ne(i):i[0])};this.focusPosition(r);const n=null!=o&&this.rowPositionUtils.before(r,o),l={type:_e.EVENT_FULL_WIDTH_ROW_FOCUSED,rowIndex:r.rowIndex,rowPinned:r.rowPinned,column:r.column,isFullWidthCell:!0,floating:r.rowPinned,fromBelow:n};return this.eventService.dispatchEvent(l),!0}focusPosition(e){this.focusService.setFocusedCell({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0}),this.rangeService&&this.rangeService.setRangeToCell(e)}isValidNavigateCell(e){return!!this.rowPositionUtils.getRowNode(e)}getLastCellOfColSpan(e){const t=this.getCellByPosition(e);if(!t)return e;const i=t.getColSpanningList();return 1===i.length?e:{rowIndex:e.rowIndex,column:ne(i),rowPinned:e.rowPinned}}ensureCellVisible(e){const t=this.gridOptionsService.isGroupRowsSticky(),s=this.rowModel.getRow(e.rowIndex);!(t&&(null==s?void 0:s.sticky))&&i(e.rowPinned)&&this.gridBodyCon.getScrollFeature().ensureIndexVisible(e.rowIndex),e.column.isPinned()||this.gridBodyCon.getScrollFeature().ensureColumnVisible(e.column)}};Gl([j("mouseEventService")],xl.prototype,"mouseEventService",void 0),Gl([j("paginationProxy")],xl.prototype,"paginationProxy",void 0),Gl([j("focusService")],xl.prototype,"focusService",void 0),Gl([z("rangeService")],xl.prototype,"rangeService",void 0),Gl([j("columnModel")],xl.prototype,"columnModel",void 0),Gl([j("rowModel")],xl.prototype,"rowModel",void 0),Gl([j("ctrlsService")],xl.prototype,"ctrlsService",void 0),Gl([j("rowRenderer")],xl.prototype,"rowRenderer",void 0),Gl([j("headerNavigationService")],xl.prototype,"headerNavigationService",void 0),Gl([j("rowPositionUtils")],xl.prototype,"rowPositionUtils",void 0),Gl([j("cellNavigationService")],xl.prototype,"cellNavigationService",void 0),Gl([j("pinnedRowModel")],xl.prototype,"pinnedRowModel",void 0),Gl([B],xl.prototype,"postConstruct",null),xl=Gl([U("navigationService")],xl);var _l=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Vl extends qo{constructor(e){super('<div class="ag-popup-editor" tabindex="-1"/>'),this.params=e}postConstruct(){this.gridOptionsService.setDomData(this.getGui(),Vl.DOM_KEY_POPUP_EDITOR_WRAPPER,!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params;this.addManagedListener(e,"keydown",e=>{Es(this.gridOptionsService,e,t.node,t.column,!0)||t.onKeyDown(e)})}}Vl.DOM_KEY_POPUP_EDITOR_WRAPPER="popupEditorWrapper",_l([B],Vl.prototype,"postConstruct",null);class Hl extends js{constructor(e,t,i,s,o){super(),this.rendererVersion=0,this.editorVersion=0,this.beans=e,this.column=t.getColumn(),this.rowNode=t.getRowNode(),this.rowCtrl=t.getRowCtrl(),this.eRow=s,this.cellCtrl=t,this.setTemplate(`<div comp-id="${this.getCompId()}"/>`);const r=this.getGui();this.forceWrapper=t.isForceWrapper(),this.refreshWrapper(!1);const n=(e,t)=>{null!=t&&""!=t?r.setAttribute(e,t):r.removeAttribute(e)};Et(r,"gridcell"),n("col-id",t.getColumnIdSanitised());const l=t.getTabIndex();void 0!==l&&n("tabindex",l.toString());const a={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>is(r,e),getFocusableElement:()=>this.getFocusableElement(),setIncludeSelection:e=>this.includeSelection=e,setIncludeRowDrag:e=>this.includeRowDrag=e,setIncludeDndSource:e=>this.includeDndSource=e,setRenderDetails:(e,t,i)=>this.setRenderDetails(e,t,i),setEditDetails:(e,t,i)=>this.setEditDetails(e,t,i),getCellEditor:()=>this.cellEditor||null,getCellRenderer:()=>this.cellRenderer||null,getParentOfValue:()=>this.getParentOfValue()};t.setComp(a,this.getGui(),this.eCellWrapper,i,o)}getParentOfValue(){return this.eCellValue?this.eCellValue:this.eCellWrapper?this.eCellWrapper:this.getGui()}setRenderDetails(e,t,i){if(this.cellEditor&&!this.cellEditorPopupWrapper)return;this.firstRender=null==this.firstRender;const s=this.refreshWrapper(!1);if(this.refreshEditStyles(!1),e){!(i||s)&&this.refreshCellRenderer(e)||(this.destroyRenderer(),this.createCellRendererInstance(e))}else this.destroyRenderer(),this.insertValueWithoutCellRenderer(t)}setEditDetails(e,t,i){e?this.createCellEditorInstance(e,t,i):this.destroyEditor()}removeControls(){this.checkboxSelectionComp=this.beans.context.destroyBean(this.checkboxSelectionComp),this.dndSourceComp=this.beans.context.destroyBean(this.dndSourceComp),this.rowDraggingComp=this.beans.context.destroyBean(this.rowDraggingComp)}refreshWrapper(e){const t=this.includeRowDrag||this.includeDndSource||this.includeSelection,i=t||this.forceWrapper,s=i&&null==this.eCellWrapper;s&&(this.eCellWrapper=Qi('<div class="ag-cell-wrapper" role="presentation"></div>'),this.getGui().appendChild(this.eCellWrapper));const o=!i&&null!=this.eCellWrapper;o&&($i(this.eCellWrapper),this.eCellWrapper=void 0),this.addOrRemoveCssClass("ag-cell-value",!i);const r=!e&&i,n=r&&null==this.eCellValue;n&&(this.eCellValue=Qi('<span class="ag-cell-value" role="presentation"></span>'),this.eCellWrapper.appendChild(this.eCellValue));const l=!r&&null!=this.eCellValue;l&&($i(this.eCellValue),this.eCellValue=void 0);const a=s||o||n||l;return a&&this.removeControls(),e||t&&this.addControls(),a}addControls(){this.includeRowDrag&&null==this.rowDraggingComp&&(this.rowDraggingComp=this.cellCtrl.createRowDragComp(),this.rowDraggingComp&&this.eCellWrapper.insertBefore(this.rowDraggingComp.getGui(),this.eCellValue)),this.includeDndSource&&null==this.dndSourceComp&&(this.dndSourceComp=this.cellCtrl.createDndSource(),this.eCellWrapper.insertBefore(this.dndSourceComp.getGui(),this.eCellValue)),this.includeSelection&&null==this.checkboxSelectionComp&&(this.checkboxSelectionComp=this.cellCtrl.createSelectionCheckbox(),this.eCellWrapper.insertBefore(this.checkboxSelectionComp.getGui(),this.eCellValue))}createCellEditorInstance(e,t,s){const o=this.editorVersion,r=e.newAgStackInstance();if(!r)return;const{params:n}=e;r.then(e=>this.afterCellEditorCreated(o,e,n,t,s));i(this.cellEditor)&&n.cellStartedEdit&&this.cellCtrl.focusCell(!0)}insertValueWithoutCellRenderer(e){const t=this.getParentOfValue();Yi(t);const i=null!=e?je(e):null;null!=i&&(t.innerHTML=i)}destroyEditorAndRenderer(){this.destroyRenderer(),this.destroyEditor()}destroyRenderer(){const{context:e}=this.beans;this.cellRenderer=e.destroyBean(this.cellRenderer),$i(this.cellRendererGui),this.cellRendererGui=null,this.rendererVersion++}destroyEditor(){const{context:e}=this.beans;this.hideEditorPopup&&this.hideEditorPopup(),this.hideEditorPopup=void 0,this.cellEditor=e.destroyBean(this.cellEditor),this.cellEditorPopupWrapper=e.destroyBean(this.cellEditorPopupWrapper),$i(this.cellEditorGui),this.cellEditorGui=null,this.editorVersion++}refreshCellRenderer(e){if(null==this.cellRenderer||null==this.cellRenderer.refresh)return!1;if(this.cellRendererClass!==e.componentClass)return!1;const t=this.cellRenderer.refresh(e.params);return!0===t||void 0===t}createCellRendererInstance(e){const t=!this.beans.gridOptionsService.is("suppressAnimationFrame"),i=this.rendererVersion,{componentClass:s}=e,o=()=>{if(this.rendererVersion!==i||!this.isAlive())return;const t=e.newAgStackInstance(),o=this.afterCellRendererCreated.bind(this,i,s);t&&t.then(o)};t&&this.firstRender?this.beans.animationFrameService.createTask(o,this.rowNode.rowIndex,"createTasksP2"):o()}getCtrl(){return this.cellCtrl}getRowCtrl(){return this.rowCtrl}getCellRenderer(){return this.cellRenderer}getCellEditor(){return this.cellEditor}afterCellRendererCreated(e,t,i){if(!this.isAlive()||e!==this.rendererVersion)this.beans.context.destroyBean(i);else if(this.cellRenderer=i,this.cellRendererClass=t,this.cellRendererGui=this.cellRenderer.getGui(),null!=this.cellRendererGui){const e=this.getParentOfValue();Yi(e),e.appendChild(this.cellRendererGui)}}afterCellEditorCreated(e,t,i,s,o){if(e!==this.editorVersion)return void this.beans.context.destroyBean(t);if(t.isCancelBeforeStart&&t.isCancelBeforeStart())return this.beans.context.destroyBean(t),void this.cellCtrl.stopEditing(!0);if(!t.getGui)return console.warn(`AG Grid: cellEditor for column ${this.column.getId()} is missing getGui() method`),void this.beans.context.destroyBean(t);this.cellEditor=t,this.cellEditorGui=t.getGui();const r=s||void 0!==t.isPopup&&t.isPopup();r?this.addPopupCellEditor(i,o):this.addInCellEditor(),this.refreshEditStyles(!0,r),t.afterGuiAttached&&t.afterGuiAttached()}refreshEditStyles(e,t){var i;this.addOrRemoveCssClass("ag-cell-inline-editing",e&&!t),this.addOrRemoveCssClass("ag-cell-popup-editing",e&&!!t),this.addOrRemoveCssClass("ag-cell-not-inline-editing",!e||!!t),null===(i=this.rowCtrl)||void 0===i||i.setInlineEditingCss(e)}addInCellEditor(){const e=this.getGui(),t=this.beans.gridOptionsService.getDocument();if(e.contains(t.activeElement)&&e.focus(),this.destroyRenderer(),this.refreshWrapper(!0),this.clearParentOfValue(),this.cellEditorGui){this.getParentOfValue().appendChild(this.cellEditorGui)}}addPopupCellEditor(e,t){"fullRow"===this.beans.gridOptionsService.get("editType")&&console.warn("AG Grid: popup cellEditor does not work with fullRowEdit - you cannot use them both - either turn off fullRowEdit, or stop using popup editors.");const i=this.cellEditor;this.cellEditorPopupWrapper=this.beans.context.createBean(new Vl(e));const s=this.cellEditorPopupWrapper.getGui();this.cellEditorGui&&s.appendChild(this.cellEditorGui);const o=this.beans.popupService,r=this.beans.gridOptionsService.is("stopEditingWhenCellsLoseFocus"),n=null!=t?t:i.getPopupPosition?i.getPopupPosition():"over",l=this.beans.gridOptionsService.is("enableRtl"),a={ePopup:s,column:this.column,rowNode:this.rowNode,type:"popupCellEditor",eventSource:this.getGui(),position:n,alignSide:l?"right":"left",keepWithinBounds:!0},d=o.positionPopupByComponent.bind(o,a),h=this.beans.localeService.getLocaleTextFunc(),c=o.addPopup({modal:r,eChild:s,closeOnEsc:!0,closedCallback:()=>{this.cellCtrl.onPopupEditorClosed()},anchorToElement:this.getGui(),positionCallback:d,ariaLabel:h("ariaLabelCellEditor","Cell Editor")});c&&(this.hideEditorPopup=c.hideFunc)}detach(){this.eRow.removeChild(this.getGui())}destroy(){this.cellCtrl.stopEditing(),this.destroyEditorAndRenderer(),this.removeControls(),super.destroy()}clearParentOfValue(){const e=this.getGui(),t=this.beans.gridOptionsService.getDocument();e.contains(t.activeElement)&&ui()&&e.focus({preventScroll:!0}),Yi(this.getParentOfValue())}}class kl extends js{constructor(e,t,i){super(),this.cellComps={},this.beans=t,this.rowCtrl=e,this.setTemplate(`<div comp-id="${this.getCompId()}" style="${this.getInitialStyle(i)}"/>`);const s=this.getGui(),o=s.style;this.domOrder=this.rowCtrl.getDomOrder(),Et(s,"row");const r=this.rowCtrl.getTabIndex();null!=r&&s.setAttribute("tabindex",r.toString());const n={setDomOrder:e=>this.domOrder=e,setCellCtrls:e=>this.setCellCtrls(e),showFullWidth:e=>this.showFullWidth(e),getFullWidthCellRenderer:()=>this.getFullWidthCellRenderer(),addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setUserStyles:e=>is(s,e),setTop:e=>o.top=e,setTransform:e=>o.transform=e,setRowIndex:e=>s.setAttribute("row-index",e),setRowId:e=>s.setAttribute("row-id",e),setRowBusinessKey:e=>s.setAttribute("row-business-key",e)};e.setComp(n,this.getGui(),i),this.addDestroyFunc(()=>{e.unsetComp(i)})}getInitialStyle(e){const t=this.rowCtrl.getInitialTransform(e),i=this.rowCtrl.getInitialRowTop(e);return t?"transform: "+t:"top: "+i}showFullWidth(e){const t=e.newAgStackInstance();t&&t.then(e=>{if(this.isAlive()){const t=e.getGui();this.getGui().appendChild(t),this.rowCtrl.setupDetailRowAutoHeight(t),this.setFullWidthRowComp(e)}else this.beans.context.destroyBean(e)})}setCellCtrls(e){const t=Object.assign({},this.cellComps);e.forEach(e=>{const i=e.getInstanceId();null==this.cellComps[i]?this.newCellComp(e):t[i]=null});const i=v(t).filter(e=>null!=e);this.destroyCells(i),this.ensureDomOrder(e)}ensureDomOrder(e){if(!this.domOrder)return;const t=[];e.forEach(e=>{const i=this.cellComps[e.getInstanceId()];i&&t.push(i.getGui())}),es(this.getGui(),t)}newCellComp(e){const t=new Hl(this.beans,e,this.rowCtrl.isPrintLayout(),this.getGui(),this.rowCtrl.isEditing());this.cellComps[e.getInstanceId()]=t,this.getGui().appendChild(t.getGui())}destroy(){super.destroy(),this.destroyAllCells()}destroyAllCells(){const e=v(this.cellComps).filter(e=>null!=e);this.destroyCells(e)}setFullWidthRowComp(e){this.fullWidthCellRenderer&&console.error("AG Grid - should not be setting fullWidthRowComponent twice"),this.fullWidthCellRenderer=e,this.addDestroyFunc(()=>{this.fullWidthCellRenderer=this.beans.context.destroyBean(this.fullWidthCellRenderer)})}getFullWidthCellRenderer(){return this.fullWidthCellRenderer}destroyCells(e){e.forEach(e=>{if(!e)return;const t=e.getCtrl().getInstanceId();this.cellComps[t]===e&&(e.detach(),e.destroy(),this.cellComps[t]=null)})}}var Bl=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Wl extends js{constructor(){super(function(){const e=js.elementGettingCreated.getAttribute("name"),t=Dl.getRowContainerCssClasses(e);let i;return i=e===yl.CENTER||e===yl.TOP_CENTER||e===yl.STICKY_TOP_CENTER||e===yl.BOTTOM_CENTER?`<div class="${t.viewport}" ref="eViewport" role="presentation">\n                <div class="${t.container}" ref="eContainer"></div>\n            </div>`:`<div class="${t.container}" ref="eContainer"></div>`,i}()),this.rowComps={},this.name=js.elementGettingCreated.getAttribute("name"),this.type=Rl(this.name)}postConstruct(){const e={setViewportHeight:e=>this.eViewport.style.height=e,setRowCtrls:e=>this.setRowCtrls(e),setDomOrder:e=>{this.domOrder=e},setContainerWidth:e=>this.eContainer.style.width=e};this.createManagedBean(new Dl(this.name)).setComp(e,this.eContainer,this.eViewport)}preDestroy(){this.setRowCtrls([])}setRowCtrls(e){const t=Object.assign({},this.rowComps);this.rowComps={},this.lastPlacedElement=null;e.forEach(e=>{const i=e.getInstanceId(),s=t[i];if(s)this.rowComps[i]=s,delete t[i],this.ensureDomOrder(s.getGui());else{if(!e.getRowNode().displayed)return;const t=new kl(e,this.beans,this.type);this.rowComps[i]=t,this.appendRow(t.getGui())}}),v(t).forEach(e=>{this.eContainer.removeChild(e.getGui()),e.destroy()}),Et(this.eContainer,e.length?"rowgroup":"presentation")}appendRow(e){this.domOrder?ts(this.eContainer,e,this.lastPlacedElement):this.eContainer.appendChild(e),this.lastPlacedElement=e}ensureDomOrder(e){this.domOrder&&(Zi(this.eContainer,e,this.lastPlacedElement),this.lastPlacedElement=e)}}Bl([j("beans")],Wl.prototype,"beans",void 0),Bl([Ks("eViewport")],Wl.prototype,"eViewport",void 0),Bl([Ks("eContainer")],Wl.prototype,"eContainer",void 0),Bl([B],Wl.prototype,"postConstruct",null),Bl([W],Wl.prototype,"preDestroy",null);var Ul=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class jl{constructor(e){this.columnsToAggregate=[],this.columnsToGroup=[],this.columnsToPivot=[],this.pinned=e}onDragEnter(e){if(this.clearColumnsList(),this.gridOptionsService.is("functionsReadOnly"))return;const t=e.dragItem.columns;t&&t.forEach(e=>{e.isPrimary()&&(e.isAnyFunctionActive()||(e.isAllowValue()?this.columnsToAggregate.push(e):e.isAllowRowGroup()?this.columnsToGroup.push(e):e.isAllowPivot()&&this.columnsToPivot.push(e)))})}getIconName(){return this.columnsToAggregate.length+this.columnsToGroup.length+this.columnsToPivot.length>0?this.pinned?Cr.ICON_PINNED:Cr.ICON_MOVE:null}onDragLeave(e){this.clearColumnsList()}clearColumnsList(){this.columnsToAggregate.length=0,this.columnsToGroup.length=0,this.columnsToPivot.length=0}onDragging(e){}onDragStop(e){this.columnsToAggregate.length>0&&this.columnModel.addValueColumns(this.columnsToAggregate,"toolPanelDragAndDrop"),this.columnsToGroup.length>0&&this.columnModel.addRowGroupColumns(this.columnsToGroup,"toolPanelDragAndDrop"),this.columnsToPivot.length>0&&this.columnModel.addPivotColumns(this.columnsToPivot,"toolPanelDragAndDrop")}}Ul([j("columnModel")],jl.prototype,"columnModel",void 0),Ul([j("gridOptionsService")],jl.prototype,"gridOptionsService",void 0);var zl=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Kl{constructor(e,i){this.needToMoveLeft=!1,this.needToMoveRight=!1,this.lastMovedInfo=null,this.pinned=e,this.eContainer=i,this.centerContainer=!t(e)}init(){this.ctrlsService.whenReady(()=>{this.gridBodyCon=this.ctrlsService.getGridBodyCtrl()})}getIconName(){return this.pinned?Cr.ICON_PINNED:Cr.ICON_MOVE}onDragEnter(e){const t=e.dragItem.columns;if(e.dragSource.type===ur.ToolPanel)this.setColumnsVisible(t,!0,"uiColumnDragged");else{const i=e.dragItem.visibleState,s=(t||[]).filter(e=>i[e.getId()]);this.setColumnsVisible(s,!0,"uiColumnDragged")}this.setColumnsPinned(t,this.pinned,"uiColumnDragged"),this.onDragging(e,!0,!0)}onDragLeave(){this.ensureIntervalCleared(),this.lastMovedInfo=null}setColumnsVisible(e,t,i="api"){if(e){const s=e.filter(e=>!e.getColDef().lockVisible);this.columnModel.setColumnsVisible(s,t,i)}}setColumnsPinned(e,t,i="api"){if(e){const s=e.filter(e=>!e.getColDef().lockPinned);this.columnModel.setColumnsPinned(s,t,i)}}onDragStop(){this.onDragging(this.lastDraggingEvent,!1,!0,!0),this.ensureIntervalCleared(),this.lastMovedInfo=null}normaliseX(e){if(this.gridOptionsService.is("enableRtl")){e=this.eContainer.clientWidth-e}return this.centerContainer&&(e+=this.ctrlsService.getCenterRowContainerCtrl().getCenterViewportScrollLeft()),e}checkCenterForScrolling(e){if(this.centerContainer){const t=this.ctrlsService.getCenterRowContainerCtrl().getCenterViewportScrollLeft(),i=t+this.ctrlsService.getCenterRowContainerCtrl().getCenterWidth();this.gridOptionsService.is("enableRtl")?(this.needToMoveRight=e<t+50,this.needToMoveLeft=e>i-50):(this.needToMoveLeft=e<t+50,this.needToMoveRight=e>i-50),this.needToMoveLeft||this.needToMoveRight?this.ensureIntervalStarted():this.ensureIntervalCleared()}}onDragging(e=this.lastDraggingEvent,t=!1,s=!1,o=!1){var r;if(o){if(this.lastMovedInfo){const{columns:e,toIndex:t}=this.lastMovedInfo;this.moveColumns(e,t,"uiColumnMoved",!0)}return}if(this.lastDraggingEvent=e,i(e.hDirection))return;const n=this.normaliseX(e.x);t||this.checkCenterForScrolling(n);const l=this.normaliseDirection(e.hDirection),a=e.dragSource.type,d=(null===(r=e.dragSource.getDragItem().columns)||void 0===r?void 0:r.filter(e=>!e.getColDef().lockPinned||e.getPinned()==this.pinned))||[];this.attemptMoveColumns({dragSourceType:a,allMovingColumns:d,hDirection:l,mouseX:n,fromEnter:t,fakeEvent:s})}normaliseDirection(e){if(!this.gridOptionsService.is("enableRtl"))return e;switch(e){case gr.Left:return gr.Right;case gr.Right:return gr.Left;default:console.error("AG Grid: Unknown direction "+e)}}attemptMoveColumns(e){const{dragSourceType:t,hDirection:i,mouseX:s,fromEnter:o,fakeEvent:r}=e,n=i===gr.Left,l=i===gr.Right;let{allMovingColumns:a}=e;if(t===ur.HeaderCell){let e=[];a.forEach(t=>{var i;let s=null,o=t.getParent();for(;null!=o&&1===o.getDisplayedLeafColumns().length;)s=o,o=o.getParent();if(null!=s){(!!(null===(i=s.getColGroupDef())||void 0===i?void 0:i.marryChildren)?s.getProvidedColumnGroup().getLeafColumns():s.getLeafColumns()).forEach(t=>{e.includes(t)||e.push(t)})}else e.includes(t)||e.push(t)}),a=e}const d=a.slice();this.columnModel.sortColumnsLikeGridColumns(d);const h=this.calculateValidMoves(d,l,s),c=this.calculateOldIndex(d);if(0===h.length)return;const u=h[0];let p=null!==c&&!o;if(t==ur.HeaderCell&&(p=null!==c),p&&!r){if(n&&u>=c)return;if(l&&u<=c)return}const g=this.columnModel.getAllDisplayedColumns();let m=[],C=null;for(let e=0;e<h.length;e++){const t=h[e],i=this.columnModel.getProposedColumnOrder(d,t);if(!this.columnModel.doesOrderPassRules(i))continue;const s=i.filter(e=>g.includes(e));if(null===C)C=s;else if(!Is.areEqual(s,C))break;const o=this.groupFragCount(i);m.push({move:t,fragCount:o})}0!==m.length&&(m.sort((e,t)=>e.fragCount-t.fragCount),this.moveColumns(a,m[0].move,"uiColumnMoved",!1))}calculateOldIndex(e){const t=this.columnModel.getAllGridColumns(),i=ae(e.map(e=>t.indexOf(e))),s=i[0];return ne(i)-s!==i.length-1?null:s}moveColumns(e,t,i,s){this.columnModel.moveColumns(e,t,i,s),this.lastMovedInfo=s?null:{columns:e,toIndex:t}}groupFragCount(e){function t(e){let t=[],i=e.getOriginalParent();for(;null!=i;)t.push(i),i=i.getOriginalParent();return t}let i=0;for(let s=0;s<e.length-1;s++){let o=t(e[s]),r=t(e[s+1]);[o,r]=o.length>r.length?[o,r]:[r,o],o.forEach(e=>{-1===r.indexOf(e)&&i++})}return i}calculateValidMoves(e,t,i){if(this.gridOptionsService.is("suppressMovableColumns")||e.some(e=>e.getColDef().suppressMovable))return[];const s=this.columnModel.getDisplayedColumns(this.pinned),o=this.columnModel.getAllGridColumns(),r=s.filter(t=>me(e,t)),n=s.filter(t=>!me(e,t)),l=o.filter(t=>!me(e,t));let a,d=0,h=i;if(t){let e=0;r.forEach(t=>e+=t.getActualWidth()),h-=e}if(h>0){for(let e=0;e<n.length;e++){if(h-=n[e].getActualWidth(),h<0)break;d++}t&&d++}if(d>0){const e=n[d-1];a=l.indexOf(e)+1}else a=l.indexOf(n[0]),-1===a&&(a=0);const c=[a],u=(e,t)=>e-t;if(t){let e=a+1;const t=o.length-1;for(;e<=t;)c.push(e),e++;c.sort(u)}else{let e=a;const t=o.length-1;let i=o[e];for(;e<=t&&this.isColumnHidden(s,i);)e++,c.push(e),i=o[e];e=a-1;const r=0;for(;e>=r;)c.push(e),e--;c.sort(u).reverse()}return c}isColumnHidden(e,t){return e.indexOf(t)<0}ensureIntervalStarted(){this.movingIntervalId||(this.intervalCount=0,this.failedMoveAttempts=0,this.movingIntervalId=window.setInterval(this.moveInterval.bind(this),100),this.needToMoveLeft?this.dragAndDropService.setGhostIcon(Cr.ICON_LEFT,!0):this.dragAndDropService.setGhostIcon(Cr.ICON_RIGHT,!0))}ensureIntervalCleared(){this.movingIntervalId&&(window.clearInterval(this.movingIntervalId),this.movingIntervalId=null,this.dragAndDropService.setGhostIcon(Cr.ICON_MOVE))}moveInterval(){let e;this.intervalCount++,e=10+5*this.intervalCount,e>100&&(e=100);let t=null;const i=this.gridBodyCon.getScrollFeature();if(this.needToMoveLeft?t=i.scrollHorizontally(-e):this.needToMoveRight&&(t=i.scrollHorizontally(e)),0!==t)this.onDragging(this.lastDraggingEvent),this.failedMoveAttempts=0;else{this.failedMoveAttempts++;const e=this.lastDraggingEvent.dragItem.columns.filter(e=>!e.getColDef().lockPinned);if(e.length>0&&(this.dragAndDropService.setGhostIcon(Cr.ICON_PINNED),this.failedMoveAttempts>7)){const t=this.needToMoveLeft?"left":"right";this.setColumnsPinned(e,t,"uiColumnDragged"),this.dragAndDropService.nudge()}}}}zl([j("columnModel")],Kl.prototype,"columnModel",void 0),zl([j("dragAndDropService")],Kl.prototype,"dragAndDropService",void 0),zl([j("gridOptionsService")],Kl.prototype,"gridOptionsService",void 0),zl([j("ctrlsService")],Kl.prototype,"ctrlsService",void 0),zl([B],Kl.prototype,"init",null);var Yl=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class $l extends Le{constructor(e,t){super(),this.pinned=e,this.eContainer=t}postConstruct(){this.ctrlsService.whenReady(e=>{switch(this.pinned){case"left":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.leftRowContainerCtrl.getContainerElement()],[e.bottomLeftRowContainerCtrl.getContainerElement()],[e.topLeftRowContainerCtrl.getContainerElement()]];break;case"right":this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.rightRowContainerCtrl.getContainerElement()],[e.bottomRightRowContainerCtrl.getContainerElement()],[e.topRightRowContainerCtrl.getContainerElement()]];break;default:this.eSecondaryContainers=[[e.gridBodyCtrl.getBodyViewportElement(),e.centerRowContainerCtrl.getViewportElement()],[e.bottomCenterRowContainerCtrl.getViewportElement()],[e.topCenterRowContainerCtrl.getViewportElement()]]}})}isInterestedIn(e){return e===ur.HeaderCell||e===ur.ToolPanel&&this.gridOptionsService.is("allowDragFromColumnsToolPanel")}getSecondaryContainers(){return this.eSecondaryContainers}getContainer(){return this.eContainer}init(){this.moveColumnFeature=this.createManagedBean(new Kl(this.pinned,this.eContainer)),this.bodyDropPivotTarget=this.createManagedBean(new jl(this.pinned)),this.dragAndDropService.addDropTarget(this)}getIconName(){return this.currentDropListener.getIconName()}isDropColumnInPivotMode(e){return this.columnModel.isPivotMode()&&e.dragSource.type===ur.ToolPanel}onDragEnter(e){this.currentDropListener=this.isDropColumnInPivotMode(e)?this.bodyDropPivotTarget:this.moveColumnFeature,this.currentDropListener.onDragEnter(e)}onDragLeave(e){this.currentDropListener.onDragLeave(e)}onDragging(e){this.currentDropListener.onDragging(e)}onDragStop(e){this.currentDropListener.onDragStop(e)}}Yl([j("dragAndDropService")],$l.prototype,"dragAndDropService",void 0),Yl([j("columnModel")],$l.prototype,"columnModel",void 0),Yl([j("ctrlsService")],$l.prototype,"ctrlsService",void 0),Yl([B],$l.prototype,"postConstruct",null),Yl([B],$l.prototype,"init",null);class ql{static getHeaderClassesFromColDef(e,t,s,o){return i(e)?[]:this.getColumnClassesFromCollDef(e.headerClass,e,t,s,o)}static getToolPanelClassesFromColDef(e,t,s,o){return i(e)?[]:this.getColumnClassesFromCollDef(e.toolPanelClass,e,t,s,o)}static getClassParams(e,t,i,s){return{colDef:e,column:i,columnGroup:s,api:t.api,columnApi:t.columnApi,context:t.context}}static getColumnClassesFromCollDef(e,t,s,o,r){if(i(e))return[];let n;if("function"==typeof e){n=e(this.getClassParams(t,s,o,r))}else n=e;return"string"==typeof n?[n]:Array.isArray(n)?[...n]:[]}}var Ql=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Xl extends Pn{constructor(e){super(Xl.TEMPLATE,e),this.headerCompVersion=0,this.column=e.getColumnGroupChild(),this.pinned=e.getPinned()}postConstruct(){const e=this.getGui();var t,i;t="col-id",null!=(i=this.column.getColId())&&""!=i?e.setAttribute(t,i):e.removeAttribute(t);const s={setWidth:t=>e.style.width=t,addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setAriaDescription:t=>Pt(e,t),setAriaSort:t=>t?zt(e,t):Kt(e),setUserCompDetails:e=>this.setUserCompDetails(e),getUserCompInstance:()=>this.headerComp};this.ctrl.setComp(s,this.getGui(),this.eResize,this.eHeaderCompWrapper);const o=this.ctrl.getSelectAllGui();this.eResize.insertAdjacentElement("afterend",o)}destroyHeaderComp(){this.headerComp&&(this.eHeaderCompWrapper.removeChild(this.headerCompGui),this.headerComp=this.destroyBean(this.headerComp),this.headerCompGui=void 0)}setUserCompDetails(e){this.headerCompVersion++;const t=this.headerCompVersion;e.newAgStackInstance().then(e=>this.afterCompCreated(t,e))}afterCompCreated(e,t){e==this.headerCompVersion&&this.isAlive()?(this.destroyHeaderComp(),this.headerComp=t,this.headerCompGui=t.getGui(),this.eHeaderCompWrapper.appendChild(this.headerCompGui),this.ctrl.setDragSource(this.getGui())):this.destroyBean(t)}}Xl.TEMPLATE='<div class="ag-header-cell" role="columnheader" tabindex="-1">\n            <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n            <div ref="eHeaderCompWrapper" class="ag-header-cell-comp-wrapper" role="presentation"></div>\n        </div>',Ql([Ks("eResize")],Xl.prototype,"eResize",void 0),Ql([Ks("eHeaderCompWrapper")],Xl.prototype,"eHeaderCompWrapper",void 0),Ql([B],Xl.prototype,"postConstruct",null),Ql([W],Xl.prototype,"destroyHeaderComp",null);var Jl=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Zl extends Pn{constructor(e){super(Zl.TEMPLATE,e)}postConstruct(){const e=this.getGui();e.setAttribute("col-id",this.ctrl.getColId());const t={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setResizableDisplayed:e=>Mi(this.eResize,e),setWidth:t=>e.style.width=t,setAriaExpanded:t=>{return i="aria-expanded",null!=(s=t)?e.setAttribute(i,s):e.removeAttribute(i);var i,s},setUserCompDetails:e=>this.setUserCompDetails(e)};this.ctrl.setComp(t,e,this.eResize)}setUserCompDetails(e){e.newAgStackInstance().then(e=>this.afterHeaderCompCreated(e))}afterHeaderCompCreated(e){const t=()=>this.destroyBean(e);if(!this.isAlive())return void t();const i=this.getGui(),s=e.getGui();i.appendChild(s),this.addDestroyFunc(t),this.ctrl.setDragSource(i)}}Zl.TEMPLATE='<div class="ag-header-group-cell" role="columnheader" tabindex="-1">\n            <div ref="eResize" class="ag-header-cell-resize" role="presentation"></div>\n        </div>',Jl([j("userComponentFactory")],Zl.prototype,"userComponentFactory",void 0),Jl([Ks("eResize")],Zl.prototype,"eResize",void 0),Jl([B],Zl.prototype,"postConstruct",null);var ea,ta=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};!function(e){e.COLUMN_GROUP="group",e.COLUMN="column",e.FLOATING_FILTER="filter"}(ea||(ea={}));class ia extends js{constructor(e){super(),this.headerComps={},this.ctrl=e,this.setTemplate(`<div class="${this.ctrl.getHeaderRowClass()}" role="row"></div>`)}init(){this.getGui().style.transform=this.ctrl.getTransform(),Bt(this.getGui(),this.ctrl.getAriaRowIndex());const e={setHeight:e=>this.getGui().style.height=e,setTop:e=>this.getGui().style.top=e,setHeaderCtrls:(e,t)=>this.setHeaderCtrls(e,t),setWidth:e=>this.getGui().style.width=e};this.ctrl.setComp(e)}destroyHeaderCtrls(){this.setHeaderCtrls([],!1)}setHeaderCtrls(e,t){if(!this.isAlive())return;const i=this.headerComps;if(this.headerComps={},e.forEach(e=>{const t=e.getInstanceId();let s=i[t];delete i[t],null==s&&(s=this.createHeaderComp(e),this.getGui().appendChild(s.getGui())),this.headerComps[t]=s}),h(i,(e,t)=>{this.getGui().removeChild(t.getGui()),this.destroyBean(t)}),t){const e=v(this.headerComps);e.sort((e,t)=>e.getCtrl().getColumnGroupChild().getLeft()-t.getCtrl().getColumnGroupChild().getLeft());const t=e.map(e=>e.getGui());es(this.getGui(),t)}}createHeaderComp(e){let t;switch(this.ctrl.getType()){case ea.COLUMN_GROUP:t=new Zl(e);break;case ea.FLOATING_FILTER:t=new Fn(e);break;default:t=new Xl(e)}return this.createBean(t),t.setParentComponent(this),t}}ta([B],ia.prototype,"init",null),ta([W],ia.prototype,"destroyHeaderCtrls",null);var sa=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let oa=0;class ra extends Le{constructor(e,t){super(),this.lastFocusEvent=null,this.columnGroupChild=e,this.parentRowCtrl=t,this.instanceId=e.getUniqueId()+"-"+oa++}shouldStopEventPropagation(e){const{headerRowIndex:t,column:i}=this.focusService.getFocusedHeader();return Rs(this.gridOptionsService,e,t,i)}getWrapperHasFocus(){return this.gridOptionsService.getDocument().activeElement===this.eGui}setGui(e){this.eGui=e,this.addDomData()}handleKeyDown(e){const t=this.getWrapperHasFocus();switch(e.key){case ys.PAGE_DOWN:case ys.PAGE_UP:case ys.PAGE_HOME:case ys.PAGE_END:t&&e.preventDefault()}}addDomData(){const e=ra.DOM_DATA_KEY_HEADER_CTRL;this.gridOptionsService.setDomData(this.eGui,e,this),this.addDestroyFunc(()=>this.gridOptionsService.setDomData(this.eGui,e,null))}getGui(){return this.eGui}focus(e){return!!this.eGui&&(this.lastFocusEvent=e||null,this.eGui.focus(),!0)}getRowIndex(){return this.parentRowCtrl.getRowIndex()}getParentRowCtrl(){return this.parentRowCtrl}getPinned(){return this.parentRowCtrl.getPinned()}getInstanceId(){return this.instanceId}getColumnGroupChild(){return this.columnGroupChild}}ra.DOM_DATA_KEY_HEADER_CTRL="headerCtrl",sa([j("focusService")],ra.prototype,"focusService",void 0),sa([j("beans")],ra.prototype,"beans",void 0),sa([j("userComponentFactory")],ra.prototype,"userComponentFactory",void 0);var na=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class la extends Le{constructor(e,t,i,s){super(),this.columnOrGroup=e,this.eCell=t,this.ariaEl=this.eCell.querySelector("[role=columnheader]")||this.eCell,this.colsSpanning=s,this.beans=i}setColsSpanning(e){this.colsSpanning=e,this.onLeftChanged()}getColumnOrGroup(){return this.beans.gridOptionsService.is("enableRtl")&&this.colsSpanning?ne(this.colsSpanning):this.columnOrGroup}postConstruct(){this.addManagedListener(this.columnOrGroup,te.EVENT_LEFT_CHANGED,this.onLeftChanged.bind(this)),this.setLeftFirstTime(),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,this.onLeftChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onLeftChanged.bind(this))}setLeftFirstTime(){const e=this.beans.gridOptionsService.is("suppressColumnMoveAnimation"),i=t(this.columnOrGroup.getOldLeft());this.beans.columnAnimationService.isActive()&&i&&!e?this.animateInLeft():this.onLeftChanged()}animateInLeft(){const e=this.getColumnOrGroup(),t=e.getLeft(),i=e.getOldLeft(),s=this.modifyLeftForPrintLayout(e,i),o=this.modifyLeftForPrintLayout(e,t);this.setLeft(s),this.actualLeft=o,this.beans.columnAnimationService.executeNextVMTurn(()=>{this.actualLeft===o&&this.setLeft(o)})}onLeftChanged(){const e=this.getColumnOrGroup(),t=e.getLeft();this.actualLeft=this.modifyLeftForPrintLayout(e,t),this.setLeft(this.actualLeft)}modifyLeftForPrintLayout(e,t){if(!this.beans.gridOptionsService.isDomLayout("print"))return t;if("left"===e.getPinned())return t;const i=this.beans.columnModel.getDisplayedColumnsLeftWidth();if("right"===e.getPinned()){return i+this.beans.columnModel.getBodyContainerWidth()+t}return i+t}setLeft(e){let i;if(t(e)&&(this.eCell.style.left=e+"px"),this.columnOrGroup instanceof te)i=this.columnOrGroup;else{const e=this.columnOrGroup.getLeafColumns();if(!e.length)return;e.length>1&&jt(this.ariaEl,e.length),i=e[0]}const s=this.beans.columnModel.getAriaColumnIndex(i);Ut(this.ariaEl,s)}}na([B],la.prototype,"postConstruct",null);var aa=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class da extends Le{constructor(e,t){super(),this.columns=e,this.element=t}postConstruct(){this.gridOptionsService.is("columnHoverHighlight")&&this.addMouseHoverListeners()}addMouseHoverListeners(){this.addManagedListener(this.element,"mouseout",this.onMouseOut.bind(this)),this.addManagedListener(this.element,"mouseover",this.onMouseOver.bind(this))}onMouseOut(){this.columnHoverService.clearMouseOver()}onMouseOver(){this.columnHoverService.setMouseOver(this.columns)}}aa([j("columnHoverService")],da.prototype,"columnHoverService",void 0),aa([B],da.prototype,"postConstruct",null);var ha=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ca extends ra{constructor(e,t){super(e,t),this.iconCreated=!1,this.column=e}setComp(e,t,i,s){super.setGui(t),this.comp=e,this.eButtonShowMainFilter=i,this.eFloatingFilterBody=s,this.setupActive(),this.setupWidth(),this.setupLeft(),this.setupHover(),this.setupFocus(),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(),this.setupUi(),this.addManagedListener(this.eButtonShowMainFilter,"click",this.showParentFilter.bind(this)),this.setupFilterChangedListener(),this.addManagedListener(this.column,te.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this))}setupActive(){const e=this.column.getColDef(),t=!!e.filter,i=!!e.floatingFilter;this.active=t&&i}setupUi(){if(this.comp.setButtonWrapperDisplayed(!this.suppressFilterButton&&this.active),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-full-body",this.suppressFilterButton),this.comp.addOrRemoveBodyCssClass("ag-floating-filter-body",!this.suppressFilterButton),!this.active||this.iconCreated)return;const e=fs("filter",this.gridOptionsService,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(){this.createManagedBean(new eo(this.eGui,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}setupAria(){const e=this.localeService.getLocaleTextFunc();Dt(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){if(this.gridOptionsService.getDocument().activeElement===this.eGui)return;const t=this.focusService.findNextFocusableElement(this.eGui,null,e.shiftKey);if(t)return this.beans.headerNavigationService.scrollToColumn(this.column),e.preventDefault(),void t.focus();const i=this.findNextColumnWithFloatingFilter(e.shiftKey);i&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:this.getParentRowCtrl().getRowIndex(),column:i},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.columnModel;let i=this.column;do{if(i=e?t.getDisplayedColBefore(i):t.getDisplayedColAfter(i),!i)break}while(!i.getColDef().filter||!i.getColDef().floatingFilter);return i}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case ys.UP:case ys.DOWN:t||e.preventDefault();case ys.LEFT:case ys.RIGHT:if(t)return;e.stopPropagation();case ys.ENTER:t&&this.focusService.focusInto(this.eGui)&&e.preventDefault();break;case ys.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const t=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),i=!!e.relatedTarget&&_i(e.relatedTarget,"ag-floating-filter");if(t&&i&&e.target===this.eGui){const e=this.lastFocusEvent,t=!(!e||e.key!==ys.TAB);if(e&&t){const t=e.shiftKey;this.focusService.focusInto(this.eGui,t)}}const s=this.getRowIndex();this.beans.focusService.setFocusedHeader(s,this.column)}setupHover(){this.createManagedBean(new da([this.column],this.eGui));const e=()=>{if(!this.gridOptionsService.is("columnHoverHighlight"))return;const e=this.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedListener(this.eventService,_e.EVENT_COLUMN_HOVER_CHANGED,e),e()}setupLeft(){const e=new la(this.column,this.eGui,this.beans);this.createManagedBean(e)}setupFilterButton(){const e=this.column.getColDef();this.suppressFilterButton=!!e.floatingFilterComponentParams&&!!e.floatingFilterComponentParams.suppressFilterButton}setupUserComp(){if(!this.active)return;const e=this.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;this.menuFactory.showMenuAfterButtonClick(this.column,e,"floatingFilter","filterMenuTab",["filterMenuTab"])}setupSyncWithFilter(){if(!this.active)return;const e=e=>{const t=this.comp.getFloatingFilterComp();t&&t.then(t=>{if(t){const i=this.filterManager.getCurrentFloatingFilterParentModel(this.column);t.onParentModelChanged(i,e)}})};this.destroySyncListener=this.addManagedListener(this.column,te.EVENT_FILTER_CHANGED,e),this.filterManager.isFilterActive(this.column)&&e(null)}setupWidth(){const e=()=>{const e=this.column.getActualWidth()+"px";this.comp.setWidth(e)};this.addManagedListener(this.column,te.EVENT_WIDTH_CHANGED,e),e()}setupFilterChangedListener(){this.active&&(this.destroyFilterChangedListener=this.addManagedListener(this.column,te.EVENT_FILTER_CHANGED,this.updateFilterButton.bind(this)))}updateFilterButton(){!this.suppressFilterButton&&this.comp&&this.comp.setButtonWrapperDisplayed(this.filterManager.isFilterAllowed(this.column))}onColDefChanged(){var e,t;const i=this.active;this.setupActive();const s=!i&&this.active;i&&!this.active&&(null===(e=this.destroySyncListener)||void 0===e||e.call(this),null===(t=this.destroyFilterChangedListener)||void 0===t||t.call(this));const o=this.active?this.filterManager.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,r=this.comp.getFloatingFilterComp();r&&o?r.then(e=>{var t;!e||this.filterManager.areFilterCompsDifferent(null!==(t=this.userCompDetails)&&void 0!==t?t:null,o)?this.updateCompDetails(o,s):this.updateFloatingFilterParams(o)}):this.updateCompDetails(o,s)}updateCompDetails(e,t){this.setCompDetails(e),this.setupFilterButton(),this.setupUi(),t&&(this.setupSyncWithFilter(),this.setupFilterChangedListener())}updateFloatingFilterParams(e){var t;if(!e)return;const i=e.params;null===(t=this.comp.getFloatingFilterComp())||void 0===t||t.then(e=>{(null==e?void 0:e.onParamsUpdated)&&"function"==typeof e.onParamsUpdated&&e.onParamsUpdated(i)})}}ha([j("filterManager")],ca.prototype,"filterManager",void 0),ha([j("columnHoverService")],ca.prototype,"columnHoverService",void 0),ha([j("menuFactory")],ca.prototype,"menuFactory",void 0);var ua=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class pa extends Le{constructor(e,t,i,s,o){super(),this.pinned=e,this.column=t,this.eResize=i,this.comp=s,this.ctrl=o}postConstruct(){const e=this.column.getColDef(),t=[];let i,s;const o=()=>{if(Mi(this.eResize,i),!i)return;const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(t.push(e),s){const e=this.gridOptionsService.is("skipHeaderOnAutoSize"),t=()=>{this.columnModel.autoSizeColumn(this.column,e,"uiColumnResized")};this.eResize.addEventListener("dblclick",t);const i=new Wo(this.eResize);i.addEventListener(Wo.EVENT_DOUBLE_TAP,t),this.addDestroyFunc(()=>{this.eResize.removeEventListener("dblclick",t),i.removeEventListener(Wo.EVENT_DOUBLE_TAP,t),i.destroy()})}},r=()=>{t.forEach(e=>e()),t.length=0},n=()=>{const t=this.column.isResizable(),n=!this.gridOptionsService.is("suppressAutoSize")&&!e.suppressAutoSize;(t!==i||n!==s)&&(i=t,s=n,r(),o())};n(),this.addDestroyFunc(r),this.ctrl.addRefreshFunction(n)}onResizing(e,t){const i=this.normaliseResizeAmount(t),s=[{key:this.column,newWidth:this.resizeStartWidth+i}];this.columnModel.setColumnWidths(s,this.resizeWithShiftKey,e,"uiColumnResized"),e&&this.comp.addOrRemoveCssClass("ag-column-resizing",!1)}onResizeStart(e){this.resizeStartWidth=this.column.getActualWidth(),this.resizeWithShiftKey=e,this.comp.addOrRemoveCssClass("ag-column-resizing",!0)}normaliseResizeAmount(e){let t=e;const i="left"!==this.pinned,s="right"===this.pinned;return this.gridOptionsService.is("enableRtl")?i&&(t*=-1):s&&(t*=-1),t}}ua([j("horizontalResizeService")],pa.prototype,"horizontalResizeService",void 0),ua([j("columnModel")],pa.prototype,"columnModel",void 0),ua([B],pa.prototype,"postConstruct",null);var ga=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ma extends Le{constructor(e){super(),this.cbSelectAllVisible=!1,this.processingEventFromCheckbox=!1,this.column=e;const t=e.getColDef();this.filteredOnly=!!(null==t?void 0:t.headerCheckboxSelectionFilteredOnly),this.currentPageOnly=!!(null==t?void 0:t.headerCheckboxSelectionCurrentPageOnly)}onSpaceKeyDown(e){const t=this.cbSelectAll,i=this.gridOptionsService.getDocument();t.isDisplayed()&&!t.getGui().contains(i.activeElement)&&(e.preventDefault(),t.setValue(!t.getValue()))}getCheckboxGui(){return this.cbSelectAll.getGui()}setComp(e){this.headerCellCtrl=e,this.cbSelectAll=this.createManagedBean(new Co),this.cbSelectAll.addCssClass("ag-header-select-all"),Et(this.cbSelectAll.getGui(),"presentation"),this.showOrHideSelectAll(),this.addManagedListener(this.eventService,_e.EVENT_NEW_COLUMNS_LOADED,this.showOrHideSelectAll.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,this.showOrHideSelectAll.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_SELECTION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_PAGINATION_CHANGED,this.onSelectionChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_MODEL_UPDATED,this.onModelChanged.bind(this)),this.addManagedListener(this.cbSelectAll,_e.EVENT_FIELD_VALUE_CHANGED,this.onCbSelectAll.bind(this)),Nt(this.cbSelectAll.getGui(),!0),this.cbSelectAll.getInputElement().setAttribute("tabindex","-1"),this.refreshSelectAllLabel()}showOrHideSelectAll(){this.cbSelectAllVisible=this.isCheckboxSelection(),this.cbSelectAll.setDisplayed(this.cbSelectAllVisible,{skipAriaHidden:!0}),this.cbSelectAllVisible&&(this.checkRightRowModelType("selectAllCheckbox"),this.checkSelectionType("selectAllCheckbox"),this.updateStateOfCheckbox()),this.refreshSelectAllLabel()}onModelChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}onSelectionChanged(){this.cbSelectAllVisible&&this.updateStateOfCheckbox()}updateStateOfCheckbox(){if(this.processingEventFromCheckbox)return;this.processingEventFromCheckbox=!0;const e=this.selectionService.getSelectAllState(this.filteredOnly,this.currentPageOnly);this.cbSelectAll.setValue(e),this.refreshSelectAllLabel(),this.processingEventFromCheckbox=!1}refreshSelectAllLabel(){const e=this.localeService.getLocaleTextFunc(),t=this.cbSelectAll.getValue()?e("ariaChecked","checked"):e("ariaUnchecked","unchecked"),i=e("ariaRowSelectAll","Press Space to toggle all rows selection");this.cbSelectAllVisible?this.headerCellCtrl.setAriaDescriptionProperty("selectAll",`${i} (${t})`):this.headerCellCtrl.setAriaDescriptionProperty("selectAll",null),this.cbSelectAll.setInputAriaLabel(`${i} (${t})`),this.headerCellCtrl.refreshAriaDescription()}checkSelectionType(e){return!("multiple"!==this.gridOptionsService.get("rowSelection"))||(console.warn(`AG Grid: ${e} is only available if using 'multiple' rowSelection.`),!1)}checkRightRowModelType(e){const t=this.rowModel.getType();return!("clientSide"!==t&&"serverSide"!==t)||(console.warn(`AG Grid: ${e} is only available if using 'clientSide' or 'serverSide' rowModelType, you are using ${t}.`),!1)}onCbSelectAll(){if(this.processingEventFromCheckbox)return;if(!this.cbSelectAllVisible)return;const e=this.cbSelectAll.getValue();let t="uiSelectAll";this.currentPageOnly?t="uiSelectAllCurrentPage":this.filteredOnly&&(t="uiSelectAllFiltered");const i={source:t,justFiltered:this.filteredOnly,justCurrentPage:this.currentPageOnly};e?this.selectionService.selectAllRowNodes(i):this.selectionService.deselectAllRowNodes(i)}isCheckboxSelection(){let e=this.column.getColDef().headerCheckboxSelection;if("function"==typeof e){e=e({column:this.column,colDef:this.column.getColDef(),columnApi:this.columnApi,api:this.gridApi,context:this.gridOptionsService.context})}return!!e&&(this.checkRightRowModelType("headerCheckboxSelection")&&this.checkSelectionType("headerCheckboxSelection"))}}ga([j("gridApi")],ma.prototype,"gridApi",void 0),ga([j("columnApi")],ma.prototype,"columnApi",void 0),ga([j("rowModel")],ma.prototype,"rowModel",void 0),ga([j("selectionService")],ma.prototype,"selectionService",void 0);var Ca,va=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};!function(e){e.TAB_GUARD="ag-tab-guard",e.TAB_GUARD_TOP="ag-tab-guard-top",e.TAB_GUARD_BOTTOM="ag-tab-guard-bottom"}(Ca||(Ca={}));class fa extends Le{constructor(e){super(),this.skipTabGuardFocus=!1;const{comp:t,eTopGuard:i,eBottomGuard:s,focusInnerElement:o,onFocusIn:r,onFocusOut:n,shouldStopEventPropagation:l,onTabKeyDown:a,handleKeyDown:d,eFocusableElement:h}=e;this.comp=t,this.eTopGuard=i,this.eBottomGuard=s,this.providedFocusInnerElement=o,this.eFocusableElement=h,this.providedFocusIn=r,this.providedFocusOut=n,this.providedShouldStopEventPropagation=l,this.providedOnTabKeyDown=a,this.providedHandleKeyDown=d}postConstruct(){this.createManagedBean(new eo(this.eFocusableElement,{shouldStopEventPropagation:()=>this.shouldStopEventPropagation(),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e),onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e)})),this.activateTabGuards(),[this.eTopGuard,this.eBottomGuard].forEach(e=>this.addManagedListener(e,"focus",this.onFocus.bind(this)))}handleKeyDown(e){this.providedHandleKeyDown&&this.providedHandleKeyDown(e)}tabGuardsAreActive(){return!!this.eTopGuard&&this.eTopGuard.hasAttribute("tabIndex")}shouldStopEventPropagation(){return!!this.providedShouldStopEventPropagation&&this.providedShouldStopEventPropagation()}activateTabGuards(){const e=this.gridOptionsService.getNum("tabIndex")||0;this.comp.setTabIndex(e.toString())}deactivateTabGuards(){this.comp.setTabIndex()}onFocus(e){if(this.skipTabGuardFocus)return void(this.skipTabGuardFocus=!1);const t=e.target===this.eBottomGuard;this.providedFocusInnerElement?this.providedFocusInnerElement(t):this.focusInnerElement(t)}onFocusIn(e){this.providedFocusIn&&this.providedFocusIn(e)||this.deactivateTabGuards()}onFocusOut(e){this.providedFocusOut&&this.providedFocusOut(e)||this.eFocusableElement.contains(e.relatedTarget)||this.activateTabGuards()}onTabKeyDown(e){if(this.providedOnTabKeyDown)return void this.providedOnTabKeyDown(e);if(e.defaultPrevented)return;const t=this.tabGuardsAreActive();t&&this.deactivateTabGuards();const i=this.getNextFocusableElement(e.shiftKey);t&&setTimeout(()=>this.activateTabGuards(),0),i&&(i.focus(),e.preventDefault())}focusInnerElement(e=!1){const t=this.focusService.findFocusableElements(this.eFocusableElement);this.tabGuardsAreActive()&&(t.splice(0,1),t.splice(t.length-1,1)),t.length&&t[e?t.length-1:0].focus({preventScroll:!0})}getNextFocusableElement(e){return this.focusService.findNextFocusableElement(this.eFocusableElement,!1,e)}forceFocusOutOfContainer(e=!1){const t=e?this.eTopGuard:this.eBottomGuard;this.activateTabGuards(),this.skipTabGuardFocus=!0,t.focus()}}va([j("focusService")],fa.prototype,"focusService",void 0),va([B],fa.prototype,"postConstruct",null);var wa,ya=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Sa=wa=class extends Le{static addKeyboardModeEvents(e,t){const i=wa.instancesMonitored.get(e);i&&i.length>0?-1===i.indexOf(t)&&i.push(t):(wa.instancesMonitored.set(e,[t]),e.addEventListener("keydown",wa.toggleKeyboardMode),e.addEventListener("mousedown",wa.toggleKeyboardMode))}static removeKeyboardModeEvents(e,t){const i=wa.instancesMonitored.get(e);let s=[];i&&i.length&&(s=[...i].filter(e=>e!==t),wa.instancesMonitored.set(e,s)),0===s.length&&(e.removeEventListener("keydown",wa.toggleKeyboardMode),e.removeEventListener("mousedown",wa.toggleKeyboardMode))}static toggleKeyboardMode(e){const t=wa.keyboardModeActive,i="keydown"===e.type;if(i&&(e.ctrlKey||e.metaKey||e.altKey))return;if(t&&i||!t&&!i)return;wa.keyboardModeActive=i;const s=e.target.ownerDocument;if(!s)return;const o=wa.instancesMonitored.get(s);o&&o.forEach(e=>{e.dispatchEvent({type:i?_e.EVENT_KEYBOARD_FOCUS:_e.EVENT_MOUSE_FOCUS})})}init(){const e=this.clearFocusedCell.bind(this);this.addManagedListener(this.eventService,_e.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,_e.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverythingChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_GROUP_OPENED,e),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl;const t=this.gridOptionsService.getDocument();wa.addKeyboardModeEvents(t,this.gridCtrl),this.addDestroyFunc(()=>this.unregisterGridCompController(this.gridCtrl))})}unregisterGridCompController(e){const t=this.gridOptionsService.getDocument();wa.removeKeyboardModeEvents(t,e)}onColumnEverythingChanged(){if(!this.focusedCellPosition)return;const e=this.focusedCellPosition.column,t=this.columnModel.getGridColumn(e.getId());e!==t&&this.clearFocusedCell()}isKeyboardMode(){return wa.keyboardModeActive}getFocusCellToUseAfterRefresh(){const e=this.gridOptionsService.getDocument();return this.gridOptionsService.is("suppressFocusAfterRefresh")||!this.focusedCellPosition||this.isDomDataMissingInHierarchy(e.activeElement,rl.DOM_DATA_KEY_ROW_CTRL)?null:this.focusedCellPosition}getFocusHeaderToUseAfterRefresh(){const e=this.gridOptionsService.getDocument();return this.gridOptionsService.is("suppressFocusAfterRefresh")||!this.focusedHeaderPosition||this.isDomDataMissingInHierarchy(e.activeElement,ra.DOM_DATA_KEY_HEADER_CTRL)?null:this.focusedHeaderPosition}isDomDataMissingInHierarchy(e,t){let i=e;for(;i;){if(this.gridOptionsService.getDomData(i,t))return!1;i=i.parentNode}return!0}getFocusedCell(){return this.focusedCellPosition}shouldRestoreFocus(e){return!!this.isCellRestoreFocused(e)&&(setTimeout(()=>{this.restoredFocusedCellPosition=null},0),!0)}isCellRestoreFocused(e){return null!=this.restoredFocusedCellPosition&&this.cellPositionUtils.equals(e,this.restoredFocusedCellPosition)}setRestoreFocusedCell(e){"react"===this.getFrameworkOverrides().renderingEngine&&(this.restoredFocusedCellPosition=e)}getFocusEventParams(){const{rowIndex:e,rowPinned:t,column:i}=this.focusedCellPosition,s={rowIndex:e,rowPinned:t,column:i,isFullWidthCell:!1},o=this.rowRenderer.getRowByPosition({rowIndex:e,rowPinned:t});return o&&(s.isFullWidthCell=o.isFullWidth()),s}clearFocusedCell(){if(this.restoredFocusedCellPosition=null,null==this.focusedCellPosition)return;const e=Object.assign({type:_e.EVENT_CELL_FOCUS_CLEARED},this.getFocusEventParams());this.focusedCellPosition=null,this.eventService.dispatchEvent(e)}setFocusedCell(t){const{column:i,rowIndex:s,rowPinned:o,forceBrowserFocus:r=!1,preventScrollOnBrowserFocus:n=!1}=t,l=this.columnModel.getGridColumn(i);if(!l)return void(this.focusedCellPosition=null);this.focusedCellPosition=l?{rowIndex:s,rowPinned:e(o),column:l}:null;const a=Object.assign(Object.assign({type:_e.EVENT_CELL_FOCUSED},this.getFocusEventParams()),{forceBrowserFocus:r,preventScrollOnBrowserFocus:n,floating:null});this.eventService.dispatchEvent(a)}isCellFocused(e){return null!=this.focusedCellPosition&&this.cellPositionUtils.equals(e,this.focusedCellPosition)}isRowNodeFocused(e){return this.isRowFocused(e.rowIndex,e.rowPinned)}isHeaderWrapperFocused(e){if(null==this.focusedHeaderPosition)return!1;const t=e.getColumnGroupChild(),i=e.getRowIndex(),s=e.getPinned(),{column:o,headerRowIndex:r}=this.focusedHeaderPosition;return t===o&&i===r&&s==o.getPinned()}clearFocusedHeader(){this.focusedHeaderPosition=null}getFocusedHeader(){return this.focusedHeaderPosition}setFocusedHeader(e,t){this.focusedHeaderPosition={headerRowIndex:e,column:t}}focusHeaderPosition(e){const{direction:t,fromTab:i,allowUserOverride:s,event:o,fromCell:r}=e;let{headerPosition:n}=e;if(r&&this.filterManager.isAdvancedFilterHeaderActive())return this.focusAdvancedFilter(n);if(s){const e=this.getFocusedHeader(),s=this.headerNavigationService.getHeaderRowCount();if(i){const i=this.gridOptionsService.getCallback("tabToNextHeader");if(i){n=i({backwards:"Before"===t,previousHeaderPosition:e,nextHeaderPosition:n,headerRowCount:s})}}else{const t=this.gridOptionsService.getCallback("navigateToNextHeader");if(t&&o){n=t({key:o.key,previousHeaderPosition:e,nextHeaderPosition:n,headerRowCount:s,event:o})}}}if(!n)return!1;if(-1===n.headerRowIndex)return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(n):this.focusGridView(n.column);this.headerNavigationService.scrollToColumn(n.column,t);return this.ctrlsService.getHeaderRowContainerCtrl(n.column.getPinned()).focusHeader(n.headerRowIndex,n.column,o)}focusFirstHeader(){let e=this.columnModel.getAllDisplayedColumns()[0];return!!e&&(e.getParent()&&(e=this.columnModel.getColumnGroupAtLevel(e,0)),this.focusHeaderPosition({headerPosition:{headerRowIndex:0,column:e}}))}focusLastHeader(e){const t=this.headerNavigationService.getHeaderRowCount()-1,i=ne(this.columnModel.getAllDisplayedColumns());return this.focusHeaderPosition({headerPosition:{headerRowIndex:t,column:i},event:e})}focusPreviousFromFirstCell(e){return this.filterManager.isAdvancedFilterHeaderActive()?this.focusAdvancedFilter(null):this.focusLastHeader(e)}isAnyCellFocused(){return!!this.focusedCellPosition}isRowFocused(t,i){return null!=this.focusedCellPosition&&(this.focusedCellPosition.rowIndex===t&&this.focusedCellPosition.rowPinned===e(i))}findFocusableElements(e,t,i=!1){let s=Ii;t&&(s+=", "+t),i&&(s+=', [tabindex="-1"]');const o=Array.prototype.slice.apply(e.querySelectorAll("[tabindex], input, select, button, textarea, [href]")),r=Array.prototype.slice.apply(e.querySelectorAll(s));if(!r.length)return o;return n=r,o.filter(e=>-1===n.indexOf(e));var n}focusInto(e,t=!1,i=!1){const s=this.findFocusableElements(e,null,i),o=t?ne(s):s[0];return!!o&&(o.focus({preventScroll:!0}),!0)}findFocusableElementBeforeTabGuard(e,t){if(!t)return null;const i=this.findFocusableElements(e),s=i.indexOf(t);if(-1===s)return null;let o=-1;for(let e=s-1;e>=0;e--)if(i[e].classList.contains(Ca.TAB_GUARD_TOP)){o=e;break}return o<=0?null:i[o-1]}findNextFocusableElement(e=this.eGridDiv,t,i){const s=this.findFocusableElements(e,t?':not([tabindex="-1"])':null),o=this.gridOptionsService.getDocument().activeElement;let r;r=t?s.findIndex(e=>e.contains(o)):s.indexOf(o);const n=r+(i?-1:1);return n<0||n>=s.length?null:s[n]}isTargetUnderManagedComponent(e,t){if(!t)return!1;const i=e.querySelectorAll("."+eo.FOCUS_MANAGED_CLASS);if(!i.length)return!1;for(let e=0;e<i.length;e++)if(i[e].contains(t))return!0;return!1}findTabbableParent(e,t=5){let i=0;for(;e&&null===pi(e)&&++i<=t;)e=e.parentElement;return null===pi(e)?null:e}focusGridView(t,i){if(this.gridOptionsService.is("suppressCellFocus"))return i?this.focusLastHeader():this.focusNextGridCoreContainer(!1);const s=i?this.rowPositionUtils.getLastRow():this.rowPositionUtils.getFirstRow();if(!s)return!1;const{rowIndex:o,rowPinned:r}=s,n=this.getFocusedHeader();if(!t&&n&&(t=n.column),null==o||!t)return!1;if(this.navigationService.ensureCellVisible({rowIndex:o,column:t,rowPinned:r}),this.setFocusedCell({rowIndex:o,column:t,rowPinned:e(r),forceBrowserFocus:!0}),this.rangeService){const e={rowIndex:o,rowPinned:r,column:t};this.rangeService.setRangeToCell(e)}return!0}focusNextGridCoreContainer(e,t=!1){return!(t||!this.gridCtrl.focusNextInnerContainer(e))||((t||!e&&!this.gridCtrl.isDetailGrid())&&this.gridCtrl.forceFocusOutOfContainer(e),!1)}focusAdvancedFilter(e){return this.advancedFilterFocusColumn=null==e?void 0:e.column,this.advancedFilterService.getCtrl().focusHeaderComp()}focusNextFromAdvancedFilter(e,t){var i,s;const o=null!==(i=t?void 0:this.advancedFilterFocusColumn)&&void 0!==i?i:null===(s=this.columnModel.getAllDisplayedColumns())||void 0===s?void 0:s[0];return e?this.focusHeaderPosition({headerPosition:{column:o,headerRowIndex:this.headerNavigationService.getHeaderRowCount()-1}}):this.focusGridView(o)}clearAdvancedFilterColumn(){this.advancedFilterFocusColumn=void 0}};Sa.AG_KEYBOARD_FOCUS="ag-keyboard-focus",Sa.keyboardModeActive=!1,Sa.instancesMonitored=new Map,ya([j("eGridDiv")],Sa.prototype,"eGridDiv",void 0),ya([j("columnModel")],Sa.prototype,"columnModel",void 0),ya([j("headerNavigationService")],Sa.prototype,"headerNavigationService",void 0),ya([j("rowRenderer")],Sa.prototype,"rowRenderer",void 0),ya([j("rowPositionUtils")],Sa.prototype,"rowPositionUtils",void 0),ya([j("cellPositionUtils")],Sa.prototype,"cellPositionUtils",void 0),ya([z("rangeService")],Sa.prototype,"rangeService",void 0),ya([j("navigationService")],Sa.prototype,"navigationService",void 0),ya([j("ctrlsService")],Sa.prototype,"ctrlsService",void 0),ya([j("filterManager")],Sa.prototype,"filterManager",void 0),ya([z("advancedFilterService")],Sa.prototype,"advancedFilterService",void 0),ya([B],Sa.prototype,"init",null),Sa=wa=ya([U("focusService")],Sa);var Ea=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Ra extends ra{constructor(e,t){super(e,t),this.refreshFunctions=[],this.userHeaderClasses=new Set,this.ariaDescriptionProperties=new Map,this.column=e}setComp(e,t,i,s){super.setGui(t),this.comp=e,this.updateState(),this.setupWidth(),this.setupMovingCss(),this.setupMenuClass(),this.setupSortableClass(),this.setupWrapTextClass(),this.refreshSpanHeaderHeight(),this.setupAutoHeight(s),this.addColumnHoverListener(),this.setupFilterCss(),this.setupClassesFromColDef(),this.setupTooltip(),this.addActiveHeaderMouseListeners(),this.setupSelectAll(),this.setupUserComp(),this.refreshAria(),this.createManagedBean(new pa(this.getPinned(),this.column,i,e,this)),this.createManagedBean(new da([this.column],t)),this.createManagedBean(new la(this.column,t,this.beans)),this.createManagedBean(new eo(t,{shouldStopEventPropagation:e=>this.shouldStopEventPropagation(e),onTabKeyDown:()=>null,handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addMouseDownListenerIfNeeded(t),this.addManagedListener(this.column,te.EVENT_COL_DEF_CHANGED,this.onColDefChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_VALUE_CHANGED,this.onColumnValueChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_ROW_GROUP_CHANGED,this.onColumnRowGroupChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_PIVOT_CHANGED,this.onColumnPivotChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_HEADER_HEIGHT_CHANGED,this.onHeaderHeightChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onHeaderHeightChanged.bind(this))}addMouseDownListenerIfNeeded(e){if(!ni())return;const t=this.gridOptionsService.getDocument();["mousedown","touchstart"].forEach(i=>{this.addManagedListener(e,i,i=>{const s=t.activeElement;s===e||e.contains(s)||(e.focus(),Sa.toggleKeyboardMode(i))})})}setupUserComp(){const e=this.lookupUserCompDetails();this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setUserCompDetails(e)}lookupUserCompDetails(){const e=this.createParams(),t=this.column.getColDef();return this.userComponentFactory.getHeaderCompDetails(t,e)}createParams(){const e=this.column.getColDef();return{column:this.column,displayName:this.displayName,enableSorting:e.sortable,enableMenu:this.menuEnabled,showColumnMenu:e=>{this.gridApi.showColumnMenuAfterButtonClick(this.column,e)},progressSort:e=>{this.sortController.progressSort(this.column,!!e,"uiColumnSorted")},setSort:(e,t)=>{this.sortController.setSortForColumn(this.column,e,!!t,"uiColumnSorted")},api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsService.context,eGridHeader:this.getGui()}}setupSelectAll(){this.selectAllFeature=this.createManagedBean(new ma(this.column)),this.selectAllFeature.setComp(this)}getSelectAllGui(){return this.selectAllFeature.getCheckboxGui()}handleKeyDown(e){super.handleKeyDown(e),e.key===ys.SPACE&&this.selectAllFeature.onSpaceKeyDown(e),e.key===ys.ENTER&&this.onEnterKeyDown(e)}onEnterKeyDown(e){const t=this.comp.getUserCompInstance();if(t)if(e.ctrlKey||e.metaKey)this.menuEnabled&&t.showMenu&&(e.preventDefault(),t.showMenu());else if(this.sortable){const t=e.shiftKey;this.sortController.progressSort(this.column,t,"uiColumnSorted")}}isMenuEnabled(){return this.menuEnabled}onFocusIn(e){if(!this.getGui().contains(e.relatedTarget)){const e=this.getRowIndex();this.focusService.setFocusedHeader(e,this.column)}this.setActiveHeader(!0)}onFocusOut(e){this.getGui().contains(e.relatedTarget)||this.setActiveHeader(!1)}setupTooltip(){const e={getColumn:()=>this.column,getColDef:()=>this.column.getColDef(),getGui:()=>this.eGui,getLocation:()=>"header",getTooltipValue:()=>this.column.getColDef().headerTooltip},t=this.createManagedBean(new $n(e,this.beans));t.setComp(this.eGui),this.refreshFunctions.push(()=>t.refreshToolTip())}setupClassesFromColDef(){const e=()=>{const e=this.column.getColDef(),t=ql.getHeaderClassesFromColDef(e,this.gridOptionsService,this.column,null),i=this.userHeaderClasses;this.userHeaderClasses=new Set(t),t.forEach(e=>{i.has(e)?i.delete(e):this.comp.addOrRemoveCssClass(e,!0)}),i.forEach(e=>this.comp.addOrRemoveCssClass(e,!1))};this.refreshFunctions.push(e),e()}setDragSource(e){if(this.dragSourceElement=e,this.removeDragSource(),!e)return;if(!this.draggable)return;let t=!this.gridOptionsService.is("suppressDragLeaveHidesColumns");this.moveDragSource={type:ur.HeaderCell,eElement:e,getDefaultIconName:()=>t?Cr.ICON_HIDE:Cr.ICON_NOT_ALLOWED,getDragItem:()=>this.createDragItem(),dragItemName:this.displayName,onDragStarted:()=>{t=!this.gridOptionsService.is("suppressDragLeaveHidesColumns"),this.column.setMoving(!0,"uiColumnMoved")},onDragStopped:()=>this.column.setMoving(!1,"uiColumnMoved"),onGridEnter:e=>{var i;if(t){const t=(null===(i=null==e?void 0:e.columns)||void 0===i?void 0:i.filter(e=>!e.getColDef().lockVisible))||[];this.columnModel.setColumnsVisible(t,!0,"uiColumnMoved")}},onGridExit:e=>{var i;if(t){const t=(null===(i=null==e?void 0:e.columns)||void 0===i?void 0:i.filter(e=>!e.getColDef().lockVisible))||[];this.columnModel.setColumnsVisible(t,!1,"uiColumnMoved")}}},this.dragAndDropService.addDragSource(this.moveDragSource,!0)}createDragItem(){const e={};return e[this.column.getId()]=this.column.isVisible(),{columns:[this.column],visibleState:e}}removeDragSource(){this.moveDragSource&&(this.dragAndDropService.removeDragSource(this.moveDragSource),this.moveDragSource=void 0)}onColDefChanged(){this.refresh()}updateState(){const e=this.column.getColDef();this.menuEnabled=this.menuFactory.isMenuEnabled(this.column)&&!e.suppressMenu,this.sortable=e.sortable,this.displayName=this.calculateDisplayName(),this.draggable=this.workOutDraggable()}addRefreshFunction(e){this.refreshFunctions.push(e)}refresh(){this.updateState(),this.refreshHeaderComp(),this.refreshAria(),this.refreshFunctions.forEach(e=>e())}refreshHeaderComp(){const e=this.lookupUserCompDetails();!!(null!=this.comp.getUserCompInstance()&&this.userCompDetails.componentClass==e.componentClass)&&this.attemptHeaderCompRefresh(e.params)?this.setDragSource(this.dragSourceElement):this.setCompDetails(e)}attemptHeaderCompRefresh(e){const t=this.comp.getUserCompInstance();if(!t)return!1;if(!t.refresh)return!1;return t.refresh(e)}calculateDisplayName(){return this.columnModel.getDisplayNameForColumn(this.column,"header",!0)}checkDisplayName(){this.displayName!==this.calculateDisplayName()&&this.refresh()}workOutDraggable(){const e=this.column.getColDef();return!!(!this.gridOptionsService.is("suppressMovableColumns")&&!e.suppressMovable&&!e.lockPosition)||!!e.enableRowGroup||!!e.enablePivot}onColumnRowGroupChanged(){this.checkDisplayName()}onColumnPivotChanged(){this.checkDisplayName()}onColumnValueChanged(){this.checkDisplayName()}setupWidth(){const e=()=>{const e=this.column.getActualWidth();this.comp.setWidth(e+"px")};this.addManagedListener(this.column,te.EVENT_WIDTH_CHANGED,e),e()}setupMovingCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.column.isMoving())};this.addManagedListener(this.column,te.EVENT_MOVING_CHANGED,e),e()}setupMenuClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-column-menu-visible",this.column.isMenuVisible())};this.addManagedListener(this.column,te.EVENT_MENU_VISIBLE_CHANGED,e),e()}setupSortableClass(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-sortable",!!this.sortable)};e(),this.addRefreshFunction(e),this.addManagedListener(this.eventService,te.EVENT_SORT_CHANGED,this.refreshAriaSort.bind(this))}setupWrapTextClass(){const e=()=>{const e=!!this.column.getColDef().wrapHeaderText;this.comp.addOrRemoveCssClass("ag-header-cell-wrap-text",e)};e(),this.addRefreshFunction(e)}onHeaderHeightChanged(){this.refreshSpanHeaderHeight()}refreshSpanHeaderHeight(){const{eGui:e,column:t,comp:i,columnModel:s,gridOptionsService:o}=this;if(!t.isSpanHeaderHeight())return;const{numberOfParents:r,isSpanningTotal:n}=this.getColumnGroupPaddingInfo();i.addOrRemoveCssClass("ag-header-span-height",r>0);const l=s.getColumnHeaderRowHeight();if(0===r)return i.addOrRemoveCssClass("ag-header-span-total",!1),e.style.setProperty("top","0px"),void e.style.setProperty("height",l+"px");i.addOrRemoveCssClass("ag-header-span-total",n);const a=r*(o.is("pivotMode")?s.getPivotGroupHeaderHeight():s.getGroupHeaderHeight());e.style.setProperty("top",-a+"px"),e.style.setProperty("height",l+a+"px")}getColumnGroupPaddingInfo(){let e=this.column.getParent();if(!e||!e.isPadding())return{numberOfParents:0,isSpanningTotal:!1};const t=e.getPaddingLevel()+1;let i=!0;for(;e;){if(!e.isPadding()){i=!1;break}e=e.getParent()}return{numberOfParents:t,isSpanningTotal:i}}setupAutoHeight(e){const t=i=>{if(!this.isAlive())return;const{paddingTop:s,paddingBottom:o,borderBottomWidth:r,borderTopWidth:n}=Vi(this.getGui()),l=s+o+r+n,a=e.offsetHeight+l;if(i<5){const s=this.beans.gridOptionsService.getDocument(),o=0==a;if(!s||!s.contains(e)||o)return void this.beans.frameworkOverrides.setTimeout(()=>t(i+1),0)}this.columnModel.setColumnHeaderHeight(this.column,a)};let i,s=!1;const o=()=>{const e=this.column.isAutoHeaderHeight();e&&!s&&r(),!e&&s&&n()},r=()=>{s=!0,t(0),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!0),i=this.resizeObserverService.observeResize(e,()=>t(0))},n=()=>{s=!1,i&&i(),this.comp.addOrRemoveCssClass("ag-header-cell-auto-height",!1),i=void 0};o(),this.addDestroyFunc(()=>n()),this.addManagedListener(this.column,te.EVENT_WIDTH_CHANGED,()=>s&&t(0)),this.addManagedListener(this.eventService,te.EVENT_SORT_CHANGED,()=>{s&&this.beans.frameworkOverrides.setTimeout(()=>t(0))}),this.addRefreshFunction(o)}refreshAriaSort(){if(this.sortable){const e=this.localeService.getLocaleTextFunc(),t=this.sortController.getDisplaySortForColumn(this.column)||null;this.comp.setAriaSort(Rt(t)),this.setAriaDescriptionProperty("sort",e("ariaSortableColumn","Press ENTER to sort."))}else this.comp.setAriaSort(),this.setAriaDescriptionProperty("sort",null)}refreshAriaMenu(){if(this.menuEnabled){const e=this.localeService.getLocaleTextFunc();this.setAriaDescriptionProperty("menu",e("ariaMenuColumn","Press CTRL ENTER to open column menu."))}else this.setAriaDescriptionProperty("menu",null)}setAriaDescriptionProperty(e,t){null!=t?this.ariaDescriptionProperties.set(e,t):this.ariaDescriptionProperties.delete(e)}refreshAriaDescription(){const e=Array.from(this.ariaDescriptionProperties.values());this.comp.setAriaDescription(e.length?e.join(" "):void 0)}refreshAria(){this.refreshAriaSort(),this.refreshAriaMenu(),this.refreshAriaDescription()}addColumnHoverListener(){const e=()=>{if(!this.gridOptionsService.is("columnHoverHighlight"))return;const e=this.columnHoverService.isHovered(this.column);this.comp.addOrRemoveCssClass("ag-column-hover",e)};this.addManagedListener(this.eventService,_e.EVENT_COLUMN_HOVER_CHANGED,e),e()}setupFilterCss(){const e=()=>{this.comp.addOrRemoveCssClass("ag-header-cell-filtered",this.column.isFilterActive())};this.addManagedListener(this.column,te.EVENT_FILTER_ACTIVE_CHANGED,e),e()}getColId(){return this.column.getColId()}addActiveHeaderMouseListeners(){const e=e=>this.setActiveHeader("mouseenter"===e.type);this.addManagedListener(this.getGui(),"mouseenter",e),this.addManagedListener(this.getGui(),"mouseleave",e)}setActiveHeader(e){this.comp.addOrRemoveCssClass("ag-header-active",e)}}Ea([j("columnModel")],Ra.prototype,"columnModel",void 0),Ea([j("columnHoverService")],Ra.prototype,"columnHoverService",void 0),Ea([j("sortController")],Ra.prototype,"sortController",void 0),Ea([j("menuFactory")],Ra.prototype,"menuFactory",void 0),Ea([j("dragAndDropService")],Ra.prototype,"dragAndDropService",void 0),Ea([j("resizeObserverService")],Ra.prototype,"resizeObserverService",void 0),Ea([j("gridApi")],Ra.prototype,"gridApi",void 0),Ea([j("columnApi")],Ra.prototype,"columnApi",void 0),Ea([W],Ra.prototype,"removeDragSource",null);var Ta=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class ba extends Le{constructor(e,t,i,s){super(),this.eResize=t,this.comp=e,this.pinned=i,this.columnGroup=s}postConstruct(){if(!this.columnGroup.isResizable())return void this.comp.setResizableDisplayed(!1);const e=this.horizontalResizeService.addResizeBar({eResizeBar:this.eResize,onResizeStart:this.onResizeStart.bind(this),onResizing:this.onResizing.bind(this,!1),onResizeEnd:this.onResizing.bind(this,!0)});if(this.addDestroyFunc(e),!this.gridOptionsService.is("suppressAutoSize")){const e=this.gridOptionsService.is("skipHeaderOnAutoSize");this.eResize.addEventListener("dblclick",()=>{const t=[];this.columnGroup.getDisplayedLeafColumns().forEach(e=>{e.getColDef().suppressAutoSize||t.push(e.getColId())}),t.length>0&&this.columnModel.autoSizeColumns({columns:t,skipHeader:e,stopAtGroup:this.columnGroup,source:"uiColumnResized"}),this.resizeLeafColumnsToFit("uiColumnResized")})}}onResizeStart(e){this.calculateInitialValues();let t=null;if(e&&(t=this.columnModel.getDisplayedGroupAfter(this.columnGroup)),t){const e=t.getDisplayedLeafColumns();this.resizeTakeFromCols=e.filter(e=>e.isResizable()),this.resizeTakeFromStartWidth=0,this.resizeTakeFromCols.forEach(e=>this.resizeTakeFromStartWidth+=e.getActualWidth()),this.resizeTakeFromRatios=[],this.resizeTakeFromCols.forEach(e=>this.resizeTakeFromRatios.push(e.getActualWidth()/this.resizeTakeFromStartWidth))}else this.resizeTakeFromCols=null,this.resizeTakeFromStartWidth=null,this.resizeTakeFromRatios=null;this.comp.addOrRemoveCssClass("ag-column-resizing",!0)}onResizing(e,t,i="uiColumnResized"){const s=this.normaliseDragChange(t),o=this.resizeStartWidth+s;this.resizeColumns(o,i,e)}resizeLeafColumnsToFit(e){const t=this.autoWidthCalculator.getPreferredWidthForColumnGroup(this.columnGroup);this.calculateInitialValues(),t>this.resizeStartWidth&&this.resizeColumns(t,e,!0)}resizeColumns(e,t,i=!0){const s=[];if(s.push({columns:this.resizeCols,ratios:this.resizeRatios,width:e}),this.resizeTakeFromCols){const t=e-this.resizeStartWidth;s.push({columns:this.resizeTakeFromCols,ratios:this.resizeTakeFromRatios,width:this.resizeTakeFromStartWidth-t})}this.columnModel.resizeColumnSets({resizeSets:s,finished:i,source:t}),i&&this.comp.addOrRemoveCssClass("ag-column-resizing",!1)}calculateInitialValues(){const e=this.columnGroup.getDisplayedLeafColumns();this.resizeCols=e.filter(e=>e.isResizable()),this.resizeStartWidth=0,this.resizeCols.forEach(e=>this.resizeStartWidth+=e.getActualWidth()),this.resizeRatios=[],this.resizeCols.forEach(e=>this.resizeRatios.push(e.getActualWidth()/this.resizeStartWidth))}normaliseDragChange(e){let t=e;return this.gridOptionsService.is("enableRtl")?"left"!==this.pinned&&(t*=-1):"right"===this.pinned&&(t*=-1),t}}Ta([j("horizontalResizeService")],ba.prototype,"horizontalResizeService",void 0),Ta([j("autoWidthCalculator")],ba.prototype,"autoWidthCalculator",void 0),Ta([j("columnModel")],ba.prototype,"columnModel",void 0),Ta([B],ba.prototype,"postConstruct",null);var Da=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Oa extends Le{constructor(e,t){super(),this.removeChildListenersFuncs=[],this.columnGroup=t,this.comp=e}postConstruct(){this.addListenersToChildrenColumns(),this.addManagedListener(this.columnGroup,xe.EVENT_DISPLAYED_CHILDREN_CHANGED,this.onDisplayedChildrenChanged.bind(this)),this.onWidthChanged(),this.addDestroyFunc(this.removeListenersOnChildrenColumns.bind(this))}addListenersToChildrenColumns(){this.removeListenersOnChildrenColumns();const e=this.onWidthChanged.bind(this);this.columnGroup.getLeafColumns().forEach(t=>{t.addEventListener("widthChanged",e),t.addEventListener("visibleChanged",e),this.removeChildListenersFuncs.push(()=>{t.removeEventListener("widthChanged",e),t.removeEventListener("visibleChanged",e)})})}removeListenersOnChildrenColumns(){this.removeChildListenersFuncs.forEach(e=>e()),this.removeChildListenersFuncs=[]}onDisplayedChildrenChanged(){this.addListenersToChildrenColumns(),this.onWidthChanged()}onWidthChanged(){const e=this.columnGroup.getActualWidth();this.comp.setWidth(e+"px"),this.comp.addOrRemoveCssClass("ag-hidden",0===e)}}Da([B],Oa.prototype,"postConstruct",null);var Pa=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Aa extends ra{constructor(e,t){super(e,t),this.columnGroup=e}setComp(e,t,i){super.setGui(t),this.comp=e,this.displayName=this.columnModel.getDisplayNameForColumnGroup(this.columnGroup,"header"),this.addClasses(),this.setupMovingCss(),this.setupExpandable(),this.setupTooltip(),this.setupUserComp();const s=this.getParentRowCtrl().getPinned(),o=this.columnGroup.getProvidedColumnGroup().getLeafColumns();this.createManagedBean(new da(o,t)),this.createManagedBean(new la(this.columnGroup,t,this.beans)),this.createManagedBean(new Oa(e,this.columnGroup)),this.groupResizeFeature=this.createManagedBean(new ba(e,i,s,this.columnGroup)),this.createManagedBean(new eo(t,{shouldStopEventPropagation:this.shouldStopEventPropagation.bind(this),onTabKeyDown:()=>{},handleKeyDown:this.handleKeyDown.bind(this),onFocusIn:this.onFocusIn.bind(this)}))}resizeLeafColumnsToFit(e){this.groupResizeFeature&&this.groupResizeFeature.resizeLeafColumnsToFit(e)}setupUserComp(){let e=this.displayName;const t={displayName:this.displayName,columnGroup:this.columnGroup,setExpanded:e=>{this.columnModel.setColumnGroupOpened(this.columnGroup.getProvidedColumnGroup(),e,"gridInitializing")},api:this.gridApi,columnApi:this.columnApi,context:this.gridOptionsService.context};if(!e){let t=this.columnGroup;const i=t.getLeafColumns();for(;t.getParent()&&t.getParent().getLeafColumns().length===i.length;)t=t.getParent();const s=t.getColGroupDef();s&&(e=s.headerName),e||(e=i?this.columnModel.getDisplayNameForColumn(i[0],"header",!0):"")}const i=this.userComponentFactory.getHeaderGroupCompDetails(t);this.comp.setUserCompDetails(i)}setupTooltip(){const e=this.columnGroup.getColGroupDef(),t={getColumn:()=>this.columnGroup,getGui:()=>this.eGui,getLocation:()=>"headerGroup",getTooltipValue:()=>e&&e.headerTooltip};e&&(t.getColDef=()=>e);this.createManagedBean(new $n(t,this.beans)).setComp(this.eGui)}setupExpandable(){const e=this.columnGroup.getProvidedColumnGroup();this.refreshExpanded(),this.addManagedListener(e,se.EVENT_EXPANDABLE_CHANGED,this.refreshExpanded.bind(this)),this.addManagedListener(e,se.EVENT_EXPANDED_CHANGED,this.refreshExpanded.bind(this))}refreshExpanded(){const e=this.columnGroup;this.expandable=e.isExpandable();const t=e.isExpanded();this.expandable?this.comp.setAriaExpanded(t?"true":"false"):this.comp.setAriaExpanded(void 0)}getColId(){return this.columnGroup.getUniqueId()}addClasses(){const e=this.columnGroup.getColGroupDef(),t=ql.getHeaderClassesFromColDef(e,this.gridOptionsService,null,this.columnGroup);if(this.columnGroup.isPadding()){t.push("ag-header-group-cell-no-group");this.columnGroup.getLeafColumns().every(e=>e.isSpanHeaderHeight())&&t.push("ag-header-span-height")}else t.push("ag-header-group-cell-with-group");t.forEach(e=>this.comp.addOrRemoveCssClass(e,!0))}setupMovingCss(){const e=this.columnGroup.getProvidedColumnGroup().getLeafColumns(),t=()=>this.comp.addOrRemoveCssClass("ag-header-cell-moving",this.columnGroup.isMoving());e.forEach(e=>{this.addManagedListener(e,te.EVENT_MOVING_CHANGED,t)}),t()}onFocusIn(e){if(!this.eGui.contains(e.relatedTarget)){const e=this.getRowIndex();this.beans.focusService.setFocusedHeader(e,this.columnGroup)}}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();if(this.expandable&&t&&e.key===ys.ENTER){const e=this.columnGroup,t=!e.isExpanded();this.columnModel.setColumnGroupOpened(e.getProvidedColumnGroup(),t,"uiColumnExpanded")}}setDragSource(e){if(this.isSuppressMoving())return;const t=this.columnGroup.getProvidedColumnGroup().getLeafColumns();let i=!this.gridOptionsService.is("suppressDragLeaveHidesColumns");const s={type:ur.HeaderCell,eElement:e,getDefaultIconName:()=>i?Cr.ICON_HIDE:Cr.ICON_NOT_ALLOWED,dragItemName:this.displayName,getDragItem:this.getDragItemForGroup.bind(this),onDragStarted:()=>{i=!this.gridOptionsService.is("suppressDragLeaveHidesColumns"),t.forEach(e=>e.setMoving(!0,"uiColumnDragged"))},onDragStopped:()=>t.forEach(e=>e.setMoving(!1,"uiColumnDragged")),onGridEnter:e=>{var t;if(i){const i=(null===(t=null==e?void 0:e.columns)||void 0===t?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];this.columnModel.setColumnsVisible(i,!0,"uiColumnMoved")}},onGridExit:e=>{var t;if(i){const i=(null===(t=null==e?void 0:e.columns)||void 0===t?void 0:t.filter(e=>!e.getColDef().lockVisible))||[];this.columnModel.setColumnsVisible(i,!1,"uiColumnMoved")}}};this.dragAndDropService.addDragSource(s,!0),this.addDestroyFunc(()=>this.dragAndDropService.removeDragSource(s))}getDragItemForGroup(){const e=this.columnGroup.getProvidedColumnGroup().getLeafColumns(),t={};e.forEach(e=>t[e.getId()]=e.isVisible());const i=[];return this.columnModel.getAllDisplayedColumns().forEach(t=>{e.indexOf(t)>=0&&(i.push(t),he(e,t))}),e.forEach(e=>i.push(e)),{columns:i,visibleState:t}}isSuppressMoving(){let e=!1;this.columnGroup.getLeafColumns().forEach(t=>{(t.getColDef().suppressMovable||t.getColDef().lockPosition)&&(e=!0)});return e||this.gridOptionsService.is("suppressMovableColumns")}}Pa([j("columnModel")],Aa.prototype,"columnModel",void 0),Pa([j("dragAndDropService")],Aa.prototype,"dragAndDropService",void 0),Pa([j("gridApi")],Aa.prototype,"gridApi",void 0),Pa([j("columnApi")],Aa.prototype,"columnApi",void 0);var Fa=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let La=0;class Ia extends Le{constructor(e,t,i){super(),this.instanceId=La++,this.headerCellCtrls={},this.rowIndex=e,this.pinned=t,this.type=i;const s=i==ea.COLUMN_GROUP?"ag-header-row-column-group":i==ea.FLOATING_FILTER?"ag-header-row-column-filter":"ag-header-row-column";this.headerRowClass="ag-header-row "+s}postConstruct(){this.isPrintLayout=this.gridOptionsService.isDomLayout("print"),this.isEnsureDomOrder=this.gridOptionsService.is("ensureDomOrder")}getInstanceId(){return this.instanceId}setComp(e,t=!0){this.comp=e,t&&(this.onRowHeightChanged(),this.onVirtualColumnsChanged()),this.setWidth(),this.addEventListeners()}getHeaderRowClass(){return this.headerRowClass}getAriaRowIndex(){return this.rowIndex+1}getTransform(){if(ni())return"translateZ(0)"}addEventListeners(){this.addManagedListener(this.eventService,_e.EVENT_COLUMN_RESIZED,this.onColumnResized.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_VIRTUAL_COLUMNS_CHANGED,e=>this.onVirtualColumnsChanged(e.afterScroll)),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_GRID_STYLES_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("domLayout",this.onDisplayedColumnsChanged.bind(this)),this.addManagedPropertyListener("ensureDomOrder",e=>this.isEnsureDomOrder=e.currentValue),this.addManagedPropertyListener("headerHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("groupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("pivotGroupHeaderHeight",this.onRowHeightChanged.bind(this)),this.addManagedPropertyListener("floatingFiltersHeight",this.onRowHeightChanged.bind(this))}getHeaderCellCtrl(e){return l(this.headerCellCtrls).find(t=>t.getColumnGroupChild()===e)}onDisplayedColumnsChanged(){this.isPrintLayout=this.gridOptionsService.isDomLayout("print"),this.onVirtualColumnsChanged(),this.setWidth(),this.onRowHeightChanged()}getType(){return this.type}onColumnResized(){this.setWidth()}setWidth(){const e=this.getWidthForRow();this.comp.setWidth(e+"px")}getWidthForRow(){if(this.isPrintLayout){return null!=this.pinned?0:this.columnModel.getContainerWidth("right")+this.columnModel.getContainerWidth("left")+this.columnModel.getContainerWidth(null)}return this.columnModel.getContainerWidth(this.pinned)}onRowHeightChanged(){var{topOffset:e,rowHeight:t}=this.getTopAndHeight();this.comp.setTop(e+"px"),this.comp.setHeight(t+"px")}getTopAndHeight(){let e=this.columnModel.getHeaderRowCount();const t=[];let i=0;this.filterManager.hasFloatingFilters()&&(e++,i=1);const s=this.columnModel.getColumnGroupHeaderRowHeight(),o=this.columnModel.getColumnHeaderRowHeight(),r=e-(1+i);for(let e=0;e<r;e++)t.push(s);t.push(o);for(let e=0;e<i;e++)t.push(this.columnModel.getFloatingFiltersHeight());let n=0;for(let e=0;e<this.rowIndex;e++)n+=t[e];return{topOffset:n,rowHeight:t[this.rowIndex]}}getPinned(){return this.pinned}getRowIndex(){return this.rowIndex}onVirtualColumnsChanged(e=!1){const t=this.getHeaderCtrls(),i=this.isEnsureDomOrder||this.isPrintLayout;this.comp.setHeaderCtrls(t,i,e)}getHeaderCtrls(){const e=this.headerCellCtrls;this.headerCellCtrls={};this.getColumnsInViewport().forEach(t=>{if(t.isEmptyGroup())return;const i=t.getUniqueId();let s=e[i];delete e[i];if(s&&s.getColumnGroupChild()!=t&&(this.destroyBean(s),s=void 0),null==s)switch(this.type){case ea.FLOATING_FILTER:s=this.createBean(new ca(t,this));break;case ea.COLUMN_GROUP:s=this.createBean(new Aa(t,this));break;default:s=this.createBean(new Ra(t,this))}this.headerCellCtrls[i]=s});const t=e=>{if(!this.focusService.isHeaderWrapperFocused(e))return!1;return this.columnModel.isDisplayed(e.getColumnGroupChild())};h(e,(e,i)=>{t(i)?this.headerCellCtrls[e]=i:this.destroyBean(i)});return v(this.headerCellCtrls)}getColumnsInViewport(){return this.isPrintLayout?this.getColumnsInViewportPrintLayout():this.getColumnsInViewportNormalLayout()}getColumnsInViewportPrintLayout(){if(null!=this.pinned)return[];let e=[];const t=this.getActualDepth();return["left",null,"right"].forEach(i=>{const s=this.columnModel.getVirtualHeaderGroupRow(i,t);e=e.concat(s)}),e}getActualDepth(){return this.type==ea.FLOATING_FILTER?this.rowIndex-1:this.rowIndex}getColumnsInViewportNormalLayout(){return this.columnModel.getVirtualHeaderGroupRow(this.pinned,this.getActualDepth())}focusHeader(e,t){const i=v(this.headerCellCtrls).find(t=>t.getColumnGroupChild()==e);return!!i&&(i.focus(t),!0)}destroy(){h(this.headerCellCtrls,(e,t)=>{this.destroyBean(t)}),this.headerCellCtrls={},super.destroy()}}Fa([j("columnModel")],Ia.prototype,"columnModel",void 0),Fa([j("focusService")],Ia.prototype,"focusService",void 0),Fa([j("filterManager")],Ia.prototype,"filterManager",void 0),Fa([B],Ia.prototype,"postConstruct",null);var Na=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Ma extends Le{constructor(e){super(),this.hidden=!1,this.includeFloatingFilter=!1,this.groupsRowCtrls=[],this.pinned=e}setComp(e,t){this.comp=e,this.eViewport=t,this.setupCenterWidth(),this.setupPinnedWidth(),this.setupDragAndDrop(this.eViewport),this.addManagedListener(this.eventService,_e.EVENT_GRID_COLUMNS_CHANGED,this.onGridColumnsChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.ctrlsService.registerHeaderContainer(this,this.pinned),this.columnModel.isReady()&&this.refresh()}setupDragAndDrop(e){const t=new $l(this.pinned,e);this.createManagedBean(t)}refresh(e=!1){const t=new Ns,i=this.focusService.getFocusHeaderToUseAfterRefresh();(()=>{const e=this.columnModel.getHeaderRowCount()-1;this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls);for(let i=0;i<e;i++){const e=this.createBean(new Ia(t.next(),this.pinned,ea.COLUMN_GROUP));this.groupsRowCtrls.push(e)}})(),(()=>{const i=t.next(),s=!(this.hidden||null!=this.columnsRowCtrl&&e&&this.columnsRowCtrl.getRowIndex()===i);(s||this.hidden)&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),s&&(this.columnsRowCtrl=this.createBean(new Ia(i,this.pinned,ea.COLUMN)))})(),(()=>{this.includeFloatingFilter=this.filterManager.hasFloatingFilters()&&!this.hidden;const i=()=>{this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)};if(!this.includeFloatingFilter)return void i();const s=t.next();if(this.filtersRowCtrl){const t=this.filtersRowCtrl.getRowIndex()!==s;e&&!t||i()}this.filtersRowCtrl||(this.filtersRowCtrl=this.createBean(new Ia(s,this.pinned,ea.FLOATING_FILTER)))})();const s=this.getAllCtrls();this.comp.setCtrls(s),this.restoreFocusOnHeader(i)}restoreFocusOnHeader(e){null!=e&&e.column.getPinned()==this.pinned&&this.focusService.focusHeaderPosition({headerPosition:e})}getAllCtrls(){const e=[...this.groupsRowCtrls];return this.columnsRowCtrl&&e.push(this.columnsRowCtrl),this.filtersRowCtrl&&e.push(this.filtersRowCtrl),e}onGridColumnsChanged(){this.refresh(!0)}onDisplayedColumnsChanged(){const e=this.filterManager.hasFloatingFilters()&&!this.hidden;this.includeFloatingFilter!==e&&this.refresh(!0)}setupCenterWidth(){null==this.pinned&&this.createManagedBean(new wl(e=>this.comp.setCenterWidth(e+"px"),!0))}setHorizontalScroll(e){this.comp.setViewportScrollLeft(e)}setupPinnedWidth(){if(null==this.pinned)return;const e="left"===this.pinned,t="right"===this.pinned;this.hidden=!0;const i=()=>{const i=e?this.pinnedWidthService.getPinnedLeftWidth():this.pinnedWidthService.getPinnedRightWidth();if(null==i)return;const s=0==i,o=this.hidden!==s,r=this.gridOptionsService.is("enableRtl"),n=this.gridOptionsService.getScrollbarWidth(),l=this.scrollVisibleService.isVerticalScrollShowing()&&(r&&e||!r&&t)?i+n:i;this.comp.setPinnedContainerWidth(l+"px"),this.comp.setDisplayed(!s),o&&(this.hidden=s,this.refresh())};this.addManagedListener(this.eventService,_e.EVENT_LEFT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,_e.EVENT_RIGHT_PINNED_WIDTH_CHANGED,i),this.addManagedListener(this.eventService,_e.EVENT_SCROLL_VISIBILITY_CHANGED,i),this.addManagedListener(this.eventService,_e.EVENT_SCROLLBAR_WIDTH_CHANGED,i)}getHeaderCtrlForColumn(e){if(e instanceof te){if(!this.columnsRowCtrl)return;return this.columnsRowCtrl.getHeaderCellCtrl(e)}if(0!==this.groupsRowCtrls.length)for(let t=0;t<this.groupsRowCtrls.length;t++){const i=this.groupsRowCtrls[t].getHeaderCellCtrl(e);if(i)return i}}getHtmlElementForColumnHeader(e){const t=this.getHeaderCtrlForColumn(e);return t?t.getGui():null}getRowType(e){const t=this.getAllCtrls()[e];return t?t.getType():void 0}focusHeader(e,t,i){const s=this.getAllCtrls()[e];return!!s&&s.focusHeader(t,i)}getRowCount(){return this.groupsRowCtrls.length+(this.columnsRowCtrl?1:0)+(this.filtersRowCtrl?1:0)}destroy(){this.filtersRowCtrl&&(this.filtersRowCtrl=this.destroyBean(this.filtersRowCtrl)),this.columnsRowCtrl&&(this.columnsRowCtrl=this.destroyBean(this.columnsRowCtrl)),this.groupsRowCtrls&&this.groupsRowCtrls.length&&(this.groupsRowCtrls=this.destroyBeans(this.groupsRowCtrls)),super.destroy()}}Na([j("ctrlsService")],Ma.prototype,"ctrlsService",void 0),Na([j("scrollVisibleService")],Ma.prototype,"scrollVisibleService",void 0),Na([j("pinnedWidthService")],Ma.prototype,"pinnedWidthService",void 0),Na([j("columnModel")],Ma.prototype,"columnModel",void 0),Na([j("focusService")],Ma.prototype,"focusService",void 0),Na([j("filterManager")],Ma.prototype,"filterManager",void 0);var Ga=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class xa extends js{constructor(e){super(),this.headerRowComps={},this.rowCompsList=[],this.pinned=e}init(){this.selectAndSetTemplate();const e={setDisplayed:e=>this.setDisplayed(e),setCtrls:e=>this.setCtrls(e),setCenterWidth:e=>this.eCenterContainer.style.width=e,setViewportScrollLeft:e=>this.getGui().scrollLeft=e,setPinnedContainerWidth:e=>{const t=this.getGui();t.style.width=e,t.style.maxWidth=e,t.style.minWidth=e}};this.createManagedBean(new Ma(this.pinned)).setComp(e,this.getGui())}selectAndSetTemplate(){const e="left"==this.pinned,t="right"==this.pinned,i=e?xa.PINNED_LEFT_TEMPLATE:t?xa.PINNED_RIGHT_TEMPLATE:xa.CENTER_TEMPLATE;this.setTemplate(i),this.eRowContainer=this.eCenterContainer?this.eCenterContainer:this.getGui()}destroyRowComps(){this.setCtrls([])}destroyRowComp(e){this.destroyBean(e),this.eRowContainer.removeChild(e.getGui())}setCtrls(e){const t=this.headerRowComps;let i;this.headerRowComps={},this.rowCompsList=[];const s=e=>{const t=e.getGui();t.parentElement!=this.eRowContainer&&this.eRowContainer.appendChild(t),i&&Zi(this.eRowContainer,t,i),i=t};e.forEach(e=>{const i=e.getInstanceId(),o=t[i];delete t[i];const r=o||this.createBean(new ia(e));this.headerRowComps[i]=r,this.rowCompsList.push(r),s(r)}),v(t).forEach(e=>this.destroyRowComp(e))}}xa.PINNED_LEFT_TEMPLATE='<div class="ag-pinned-left-header" role="presentation"></div>',xa.PINNED_RIGHT_TEMPLATE='<div class="ag-pinned-right-header" role="presentation"></div>',xa.CENTER_TEMPLATE='<div class="ag-header-viewport" role="presentation">\n            <div class="ag-header-container" ref="eCenterContainer" role="rowgroup"></div>\n        </div>',Ga([Ks("eCenterContainer")],xa.prototype,"eCenterContainer",void 0),Ga([B],xa.prototype,"init",null),Ga([W],xa.prototype,"destroyRowComps",null);var _a,Va=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};!function(e){e[e.UP=0]="UP",e[e.DOWN=1]="DOWN",e[e.LEFT=2]="LEFT",e[e.RIGHT=3]="RIGHT"}(_a||(_a={}));let Ha=class extends Le{postConstruct(){this.ctrlsService.whenReady(e=>{this.gridBodyCon=e.gridBodyCtrl})}getHeaderRowCount(){const e=this.ctrlsService.getHeaderRowContainerCtrl();return e?e.getRowCount():0}navigateVertically(e,t,i){if(t||(t=this.focusService.getFocusedHeader()),!t)return!1;const{headerRowIndex:s,column:o}=t,r=this.getHeaderRowCount(),n=e===_a.UP;let{nextRow:l,nextFocusColumn:a}=n?this.headerPositionUtils.getColumnVisibleParent(o,s):this.headerPositionUtils.getColumnVisibleChild(o,s),d=!1;return l<0&&(l=0,a=o,d=!0),l>=r&&(l=-1),!(!d&&!a)&&this.focusService.focusHeaderPosition({headerPosition:{headerRowIndex:l,column:a},allowUserOverride:!0,event:i})}navigateHorizontally(e,t=!1,i){const s=this.focusService.getFocusedHeader();let o,r;return e===_a.LEFT!==this.gridOptionsService.is("enableRtl")?(r="Before",o=this.headerPositionUtils.findHeader(s,r)):(r="After",o=this.headerPositionUtils.findHeader(s,r)),o||!t?this.focusService.focusHeaderPosition({headerPosition:o,direction:r,fromTab:t,allowUserOverride:!0,event:i}):this.focusNextHeaderRow(s,r,i)}focusNextHeaderRow(e,t,i){const s=e.headerRowIndex;let o,r=null;return"Before"===t?s>0&&(o=s-1,r=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"end")):(o=s+1,r=this.headerPositionUtils.findColAtEdgeForHeaderRow(o,"start")),this.focusService.focusHeaderPosition({headerPosition:r,direction:t,fromTab:!0,allowUserOverride:!0,event:i})}scrollToColumn(e,t="After"){if(e.getPinned())return;let i;if(e instanceof xe){const s=e.getDisplayedLeafColumns();i="Before"===t?ne(s):s[0]}else i=e;this.gridBodyCon.getScrollFeature().ensureColumnVisible(i)}};Va([j("focusService")],Ha.prototype,"focusService",void 0),Va([j("headerPositionUtils")],Ha.prototype,"headerPositionUtils",void 0),Va([j("ctrlsService")],Ha.prototype,"ctrlsService",void 0),Va([B],Ha.prototype,"postConstruct",null),Ha=Va([U("headerNavigationService")],Ha);var ka=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Ba extends Le{setComp(e,t,i){this.comp=e,this.eGui=t,this.createManagedBean(new eo(i,{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this),onFocusOut:this.onFocusOut.bind(this)})),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.onPivotModeChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.onPivotModeChanged(),this.setupHeaderHeight(),this.ctrlsService.registerGridHeaderCtrl(this)}setupHeaderHeight(){const e=this.setHeaderHeight.bind(this);e(),this.addManagedPropertyListener("headerHeight",e),this.addManagedPropertyListener("pivotHeaderHeight",e),this.addManagedPropertyListener("groupHeaderHeight",e),this.addManagedPropertyListener("pivotGroupHeaderHeight",e),this.addManagedPropertyListener("floatingFiltersHeight",e),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_HEADER_HEIGHT_CHANGED,e),this.addManagedListener(this.eventService,_e.EVENT_GRID_STYLES_CHANGED,e),this.addManagedListener(this.eventService,_e.EVENT_ADVANCED_FILTER_ENABLED_CHANGED,e)}getHeaderHeight(){return this.headerHeight}setHeaderHeight(){const{columnModel:e}=this;let t,i=0,s=e.getHeaderRowCount();this.filterManager.hasFloatingFilters()&&(s++,i=1);const o=this.columnModel.getColumnGroupHeaderRowHeight(),r=this.columnModel.getColumnHeaderRowHeight(),n=s-(1+i);if(t=i*e.getFloatingFiltersHeight(),t+=n*o,t+=r,this.headerHeight===t)return;this.headerHeight=t;const l=t+1+"px";this.comp.setHeightAndMinHeight(l),this.eventService.dispatchEvent({type:_e.EVENT_HEADER_HEIGHT_CHANGED})}onPivotModeChanged(){const e=this.columnModel.isPivotMode();this.comp.addOrRemoveCssClass("ag-pivot-on",e),this.comp.addOrRemoveCssClass("ag-pivot-off",!e)}onDisplayedColumnsChanged(){const e=this.columnModel.getAllDisplayedColumns().some(e=>e.isSpanHeaderHeight());this.comp.addOrRemoveCssClass("ag-header-allow-overflow",e)}onTabKeyDown(e){const t=this.gridOptionsService.is("enableRtl"),i=e.shiftKey!==t?_a.LEFT:_a.RIGHT;(this.headerNavigationService.navigateHorizontally(i,!0,e)||this.focusService.focusNextGridCoreContainer(e.shiftKey))&&e.preventDefault()}handleKeyDown(e){let i=null;switch(e.key){case ys.LEFT:i=_a.LEFT;case ys.RIGHT:t(i)||(i=_a.RIGHT),this.headerNavigationService.navigateHorizontally(i,!1,e);break;case ys.UP:i=_a.UP;case ys.DOWN:t(i)||(i=_a.DOWN),this.headerNavigationService.navigateVertically(i,null,e)&&e.preventDefault();break;default:return}}onFocusOut(e){const t=this.gridOptionsService.getDocument(),{relatedTarget:i}=e;!i&&this.eGui.contains(t.activeElement)||this.eGui.contains(i)||this.focusService.clearFocusedHeader()}}ka([j("headerNavigationService")],Ba.prototype,"headerNavigationService",void 0),ka([j("focusService")],Ba.prototype,"focusService",void 0),ka([j("columnModel")],Ba.prototype,"columnModel",void 0),ka([j("ctrlsService")],Ba.prototype,"ctrlsService",void 0),ka([j("filterManager")],Ba.prototype,"filterManager",void 0);var Wa=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Ua extends js{constructor(){super(Ua.TEMPLATE)}postConstruct(){const e={addOrRemoveCssClass:(e,t)=>this.addOrRemoveCssClass(e,t),setHeightAndMinHeight:e=>{this.getGui().style.height=e,this.getGui().style.minHeight=e}};this.createManagedBean(new Ba).setComp(e,this.getGui(),this.getFocusableElement());const t=e=>{this.createManagedBean(e),this.appendChild(e)};t(new xa("left")),t(new xa(null)),t(new xa("right"))}}Ua.TEMPLATE='<div class="ag-header" role="presentation"/>',Wa([B],Ua.prototype,"postConstruct",null);var ja=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let za=class extends Le{addResizeBar(e){const t={dragStartPixels:e.dragStartPixels||0,eElement:e.eResizeBar,onDragStart:this.onDragStart.bind(this,e),onDragStop:this.onDragStop.bind(this,e),onDragging:this.onDragging.bind(this,e),includeTouch:!0,stopPropagationForTouch:!0};this.dragService.addDragSource(t);return()=>this.dragService.removeDragSource(t)}onDragStart(e,t){this.dragStartX=t.clientX,this.setResizeIcons();const i=t instanceof MouseEvent&&!0===t.shiftKey;e.onResizeStart(i)}setResizeIcons(){const e=this.ctrlsService.getGridCtrl();e.setResizeCursor(!0),e.disableUserSelect(!0)}onDragStop(e,t){e.onResizeEnd(this.resizeAmount),this.resetIcons()}resetIcons(){const e=this.ctrlsService.getGridCtrl();e.setResizeCursor(!1),e.disableUserSelect(!1)}onDragging(e,t){this.resizeAmount=t.clientX-this.dragStartX,e.onResizing(this.resizeAmount)}};ja([j("dragService")],za.prototype,"dragService",void 0),ja([j("ctrlsService")],za.prototype,"ctrlsService",void 0),za=ja([U("horizontalResizeService")],za);var Ka=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Ya=class extends Le{hideActiveMenu(){this.hidePopup&&this.hidePopup()}showMenuAfterMouseEvent(e,t){this.showPopup(e,i=>{this.popupService.positionPopupUnderMouseEvent({column:e,type:"columnMenu",mouseEvent:t,ePopup:i})},"columnMenu",t.target)}showMenuAfterButtonClick(e,t,i){this.showPopup(e,s=>{this.popupService.positionPopupByComponent({type:i,eventSource:t,ePopup:s,keepWithinBounds:!0,position:"under",column:e})},i,t)}showPopup(e,t,i,s){const o=this.filterManager.getOrCreateFilterWrapper(e,"COLUMN_MENU");if(!o)throw new Error("AG Grid - unable to show popup filter, filter instantiation failed");const r=document.createElement("div");let n;Et(r,"presentation"),r.classList.add("ag-menu"),this.tabListener=this.addManagedListener(r,"keydown",e=>this.trapFocusWithin(e,r)),o.guiPromise.then(e=>r.appendChild(e));const l=s||this.ctrlsService.getGridBodyCtrl().getGui(),a=this.localeService.getLocaleTextFunc(),d=this.popupService.addPopup({modal:!0,eChild:r,closeOnEsc:!0,closedCallback:t=>{e.setMenuVisible(!1,"contextMenu");const i=t instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),i&&s&&qi(s)){const e=this.focusService.findTabbableParent(s);e&&e.focus()}var r;null===(r=o.filterPromise)||void 0===r||r.then(e=>{var t;return null===(t=null==e?void 0:e.afterGuiDetached)||void 0===t?void 0:t.call(e)})},positionCallback:()=>t(r),anchorToElement:l,ariaLabel:a("ariaLabelColumnMenu","Column Menu")});d&&(this.hidePopup=n=d.hideFunc),o.filterPromise.then(e=>{t(r),e.afterGuiAttached&&e.afterGuiAttached({container:i,hidePopup:n})}),e.setMenuVisible(!0,"contextMenu")}trapFocusWithin(e,t){e.key!==ys.TAB||e.defaultPrevented||this.focusService.findNextFocusableElement(t,!1,e.shiftKey)||(e.preventDefault(),this.focusService.focusInto(t,e.shiftKey))}isMenuEnabled(e){return e.isFilterAllowed()&&e.getMenuTabs(["filterMenuTab"]).includes("filterMenuTab")}};Ka([j("filterManager")],Ya.prototype,"filterManager",void 0),Ka([j("popupService")],Ya.prototype,"popupService",void 0),Ka([j("focusService")],Ya.prototype,"focusService",void 0),Ka([j("ctrlsService")],Ya.prototype,"ctrlsService",void 0),Ya=Ka([U("menuFactory")],Ya);var $a=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class qa extends js{constructor(e){super(qa.getTemplate(e.cssClass)),this.items=[],this.tabbedItemScrollMap=new Map,this.params=e,e.items&&e.items.forEach(e=>this.addItem(e))}postConstruct(){this.createManagedBean(new eo(this.getFocusableElement(),{onTabKeyDown:this.onTabKeyDown.bind(this),handleKeyDown:this.handleKeyDown.bind(this)})),this.addDestroyFunc(()=>{var e,t,i;return null===(i=null===(t=null===(e=this.activeItem)||void 0===e?void 0:e.tabbedItem)||void 0===t?void 0:t.afterDetachedCallback)||void 0===i?void 0:i.call(t)})}static getTemplate(e){return`<div class="ag-tabs ${e}">\n            <div ref="eHeader" role="tablist" class="ag-tabs-header ${e?e+"-header":""}"></div>\n            <div ref="eBody" role="presentation" class="ag-tabs-body ${e?e+"-body":""}"></div>\n        </div>`}handleKeyDown(e){const t=this.gridOptionsService.getDocument();switch(e.key){case ys.RIGHT:case ys.LEFT:if(!this.eHeader.contains(t.activeElement))return;const i=e.key===ys.RIGHT,s=this.gridOptionsService.is("enableRtl"),o=this.items.indexOf(this.activeItem),r=i!==s?Math.min(o+1,this.items.length-1):Math.max(o-1,0);if(o===r)return;e.preventDefault();const n=this.items[r];this.showItemWrapper(n),n.eHeaderButton.focus();break;case ys.UP:case ys.DOWN:e.stopPropagation()}}onTabKeyDown(e){if(e.defaultPrevented)return;const{focusService:t,eHeader:i,eBody:s,activeItem:o}=this,r=this.gridOptionsService.getDocument().activeElement,n=e.target;if(e.preventDefault(),i.contains(r))return void t.focusInto(s,e.shiftKey);let l=null;t.isTargetUnderManagedComponent(s,n)&&(e.shiftKey&&(l=this.focusService.findFocusableElementBeforeTabGuard(s,n)),l||(l=o.eHeaderButton)),!l&&s.contains(r)&&(l=t.findNextFocusableElement(s,!1,e.shiftKey),l||(l=o.eHeaderButton)),l&&l.focus()}setAfterAttachedParams(e){this.afterAttachedParams=e}showFirstItem(){this.items.length>0&&this.showItemWrapper(this.items[0])}addItem(e){const t=document.createElement("span");Et(t,"tab"),t.setAttribute("tabindex","-1"),t.appendChild(e.title),t.classList.add("ag-tab"),this.eHeader.appendChild(t),Dt(t,e.titleLabel);const i={tabbedItem:e,eHeaderButton:t};this.items.push(i),t.addEventListener("click",this.showItemWrapper.bind(this,i))}showItem(e){const t=this.items.find(t=>t.tabbedItem===e);t&&this.showItemWrapper(t)}showItemWrapper(e){var t,i;const{tabbedItem:s,eHeaderButton:o}=e;this.params.onItemClicked&&this.params.onItemClicked({item:s}),this.activeItem!==e?(this.lastScrollListener&&(this.lastScrollListener=this.lastScrollListener()),Yi(this.eBody),s.bodyPromise.then(e=>{this.eBody.appendChild(e);const t=!this.focusService.isKeyboardMode();if(this.focusService.focusInto(this.eBody,!1,t),s.afterAttachedCallback&&s.afterAttachedCallback(this.afterAttachedParams),this.params.keepScrollPosition){const t=s.getScrollableContainer&&s.getScrollableContainer()||e;this.lastScrollListener=this.addManagedListener(t,"scroll",()=>{this.tabbedItemScrollMap.set(s.name,t.scrollTop)});const i=this.tabbedItemScrollMap.get(s.name);void 0!==i&&setTimeout(()=>{t.scrollTop=i},0)}}),this.activeItem&&(this.activeItem.eHeaderButton.classList.remove("ag-tab-selected"),null===(i=(t=this.activeItem.tabbedItem).afterDetachedCallback)||void 0===i||i.call(t)),o.classList.add("ag-tab-selected"),this.activeItem=e):G(this.params.onActiveItemClicked)}}function Qa(e){return T(()=>console.warn("AG Grid: Since v29 simpleHttpRequest has been deprecated as it was only meant for use in internal AG Grid documentation examples. Please use the browser fetch api directly."),"simpleHttpRequest"),new Gs(t=>{const i=new XMLHttpRequest;i.open("GET",e.url),i.send(),i.onreadystatechange=function(){4===i.readyState&&200===i.status&&t(JSON.parse(i.responseText))}})}$a([j("focusService")],qa.prototype,"focusService",void 0),$a([Ks("eHeader")],qa.prototype,"eHeader",void 0),$a([Ks("eBody")],qa.prototype,"eBody",void 0),$a([B],qa.prototype,"postConstruct",null);var Xa=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Ja=class extends Le{constructor(){super(...arguments),this.polyfillFunctions=[]}observeResize(e,t){const i=this.gridOptionsService.getWindow(),s=this.gridOptionsService.is("suppressBrowserResizeObserver");return!!i.ResizeObserver&&!s?(()=>{const s=new i.ResizeObserver(t);return s.observe(e),()=>s.disconnect()})():(()=>{let i=Ji(e),s=Xi(e),o=!0;const r=()=>{if(o){const o=Ji(e),n=Xi(e);(o!==i||n!==s)&&(i=o,s=n,t()),this.doNextPolyfillTurn(r)}};return r(),()=>o=!1})()}doNextPolyfillTurn(e){this.polyfillFunctions.push(e),this.schedulePolyfill()}schedulePolyfill(){if(this.polyfillScheduled)return;this.polyfillScheduled=!0,this.getFrameworkOverrides().setTimeout(()=>{const e=this.polyfillFunctions;this.polyfillScheduled=!1,this.polyfillFunctions=[],e.forEach(e=>e())},50)}};Ja=Xa([U("resizeObserverService")],Ja);var Za=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let ed=class extends Le{constructor(){super(...arguments),this.createTasksP1={list:[],sorted:!1},this.createTasksP2={list:[],sorted:!1},this.destroyTasks=[],this.ticking=!1,this.scrollGoingDown=!0,this.lastPage=0,this.lastScrollTop=0,this.taskCount=0,this.cancelledTasks=new Set}setScrollTop(e){const t=this.gridOptionsService.is("pagination");if(this.scrollGoingDown=e>=this.lastScrollTop,t&&0===e){const e=this.paginationProxy.getCurrentPage();e!==this.lastPage&&(this.lastPage=e,this.scrollGoingDown=!0)}this.lastScrollTop=e}init(){this.useAnimationFrame=!this.gridOptionsService.is("suppressAnimationFrame")}isOn(){return this.useAnimationFrame}verifyAnimationFrameOn(e){!1===this.useAnimationFrame&&console.warn(`AG Grid: AnimationFrameService.${e} called but animation frames are off`)}createTask(e,t,i){this.verifyAnimationFrameOn(i);const s={task:e,index:t,createOrder:++this.taskCount};this.addTaskToList(this[i],s),this.schedule()}cancelTask(e){this.cancelledTasks.add(e)}addTaskToList(e,t){e.list.push(t),e.sorted=!1}sortTaskList(e){if(e.sorted)return;const t=this.scrollGoingDown?1:-1;e.list.sort((e,i)=>e.index!==i.index?t*(i.index-e.index):i.createOrder-e.createOrder),e.sorted=!0}addDestroyTask(e){this.verifyAnimationFrameOn("createTasksP3"),this.destroyTasks.push(e),this.schedule()}executeFrame(e){this.verifyAnimationFrameOn("executeFrame");const t=this.createTasksP1,i=t.list,s=this.createTasksP2,o=s.list,r=this.destroyTasks,n=(new Date).getTime();let l=(new Date).getTime()-n;const a=e<=0,d=this.ctrlsService.getGridBodyCtrl();for(;a||l<e;){if(!d.getScrollFeature().scrollGridIfNeeded()){let e;if(i.length)this.sortTaskList(t),e=i.pop().task;else if(o.length)this.sortTaskList(s),e=o.pop().task;else{if(!r.length){this.cancelledTasks.clear();break}e=r.pop()}this.cancelledTasks.has(e)||e()}l=(new Date).getTime()-n}i.length||o.length||r.length?this.requestFrame():this.stopTicking()}stopTicking(){this.ticking=!1}flushAllFrames(){this.useAnimationFrame&&this.executeFrame(-1)}schedule(){this.useAnimationFrame&&(this.ticking||(this.ticking=!0,this.requestFrame()))}requestFrame(){const e=this.executeFrame.bind(this,60);this.requestAnimationFrame(e)}requestAnimationFrame(e){const t=this.gridOptionsService.getWindow();t.requestAnimationFrame?t.requestAnimationFrame(e):t.webkitRequestAnimationFrame?t.webkitRequestAnimationFrame(e):t.setTimeout(e,0)}isQueueEmpty(){return!this.ticking}debounce(e){let t=!1;return()=>{this.isOn()?t||(t=!0,this.addDestroyTask(()=>{t=!1,e()})):this.getFrameworkOverrides().setTimeout(e,0)}}};Za([j("ctrlsService")],ed.prototype,"ctrlsService",void 0),Za([j("paginationProxy")],ed.prototype,"paginationProxy",void 0),Za([B],ed.prototype,"init",null),ed=Za([U("animationFrameService")],ed);var td=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let id=class extends Le{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowContainerCtrl=e.centerRowContainerCtrl})}getPreferredWidthForColumn(e,t){const i=this.getHeaderCellForColumn(e);if(!i)return-1;const s=this.rowRenderer.getAllCellsForColumn(e);return t||s.push(i),this.addElementsToContainerAndGetWidth(s)}getPreferredWidthForColumnGroup(e){const t=this.getHeaderCellForColumn(e);return t?this.addElementsToContainerAndGetWidth([t]):-1}addElementsToContainerAndGetWidth(e){const t=document.createElement("form");t.style.position="fixed";const i=this.centerRowContainerCtrl.getContainerElement();e.forEach(e=>this.cloneItemIntoDummy(e,t)),i.appendChild(t);const s=t.offsetWidth;i.removeChild(t);return s+this.getAutoSizePadding()}getAutoSizePadding(){const e=this.gridOptionsService.getNum("autoSizePadding");return null!=e&&e>=0?e:20}getHeaderCellForColumn(e){let t=null;return this.ctrlsService.getHeaderRowContainerCtrls().forEach(i=>{const s=i.getHtmlElementForColumnHeader(e);null!=s&&(t=s)}),t}cloneItemIntoDummy(e,t){const i=e.cloneNode(!0);i.style.width="",i.style.position="static",i.style.left="";const s=document.createElement("div"),o=s.classList;["ag-header-cell","ag-header-group-cell"].some(e=>i.classList.contains(e))?(o.add("ag-header","ag-header-row"),s.style.position="static"):o.add("ag-row");let r=e.parentElement;for(;r;){if(["ag-header-row","ag-row"].some(e=>r.classList.contains(e))){for(let e=0;e<r.classList.length;e++){const t=r.classList[e];"ag-row-position-absolute"!=t&&o.add(t)}break}r=r.parentElement}s.appendChild(i),t.appendChild(s)}};td([j("rowRenderer")],id.prototype,"rowRenderer",void 0),td([j("ctrlsService")],id.prototype,"ctrlsService",void 0),td([j("rowCssClassCalculator")],id.prototype,"rowCssClassCalculator",void 0),td([B],id.prototype,"postConstruct",null),id=td([U("autoWidthCalculator")],id);var sd=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class od extends Le{constructor(e,t){super(),this.createRowCon=e,this.destroyRowCtrls=t,this.stickyRowCtrls=[],this.containerHeight=0}postConstruct(){this.isClientSide="clientSide"===this.rowModel.getType(),this.ctrlsService.whenReady(e=>{this.gridBodyCtrl=e.gridBodyCtrl})}getStickyRowCtrls(){return this.stickyRowCtrls}checkStickyRows(){let e=0;if(!this.gridOptionsService.isGroupRowsSticky())return this.refreshNodesAndContainerHeight([],e);const t=[],i=this.rowRenderer.getFirstVisibleVerticalPixel(),s=s=>{var o,r,n;let l;if(t.push(s),this.isClientSide){let e=s;for(;e.expanded;)if(e.master)e=e.detailNode;else if(e.childrenAfterSort){if(0===e.childrenAfterSort.length)break;e=ne(e.childrenAfterSort)}l=e.rowTop+e.rowHeight}else if(s.master)l=s.detailNode.rowTop+s.detailNode.rowHeight;else{const e=null===(o=s.childStore)||void 0===o?void 0:o.getStoreBounds();l=(null!==(r=null==e?void 0:e.heightPx)&&void 0!==r?r:0)+(null!==(n=null==e?void 0:e.topPx)&&void 0!==n?n:0)}const a=i+e+s.rowHeight;s.stickyRowTop=l<a?e+(l-a):e,e=0,t.forEach(t=>{const i=t.stickyRowTop+t.rowHeight;e<i&&(e=i)})};for(;;){const o=i+e,r=this.rowModel.getRowIndexAtPixel(o),n=this.rowModel.getRow(r);if(null==n)break;if(n.level<0)break;const l=[];let a=n.parent;for(;a.level>=0;)l.push(a),a=a.parent;const d=l.reverse().find(e=>t.indexOf(e)<0&&e.displayed);if(d)s(d);else{if(!(n.isExpandable()&&n.expanded&&n.rowTop<o))break;s(n)}}return this.refreshNodesAndContainerHeight(t,e)}refreshStickyNode(e){const t=[];for(let i=0;i<this.stickyRowCtrls.length;i++){const s=this.stickyRowCtrls[i].getRowNode();s!==e&&t.push(s)}this.refreshNodesAndContainerHeight(t,this.containerHeight)&&this.checkStickyRows()}refreshNodesAndContainerHeight(e,t){let i=!1;const s=this.stickyRowCtrls.filter(t=>-1===e.indexOf(t.getRowNode())),o=e.filter(e=>-1===this.stickyRowCtrls.findIndex(t=>t.getRowNode()===e));(s.length||o.length)&&(i=!0);const r={};s.forEach(e=>{r[e.getRowNode().id]=e,this.stickyRowCtrls=this.stickyRowCtrls.filter(t=>t!==e)});for(const e of Object.values(r))e.getRowNode().sticky=!1;this.destroyRowCtrls(r,!1);const n=o.map(e=>(e.sticky=!0,this.createRowCon(e,!1,!1)));return this.stickyRowCtrls.push(...n),this.stickyRowCtrls.forEach(e=>e.setRowTop(e.getRowNode().stickyRowTop)),this.stickyRowCtrls.sort((e,t)=>t.getRowNode().rowIndex-e.getRowNode().rowIndex),this.containerHeight!==t&&(this.containerHeight=t,this.gridBodyCtrl.setStickyTopHeight(t),i=!0),i}}sd([j("rowModel")],od.prototype,"rowModel",void 0),sd([j("rowRenderer")],od.prototype,"rowRenderer",void 0),sd([j("ctrlsService")],od.prototype,"ctrlsService",void 0),sd([B],od.prototype,"postConstruct",null);var rd=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let nd=class extends Le{constructor(){super(...arguments),this.destroyFuncsForColumnListeners=[],this.rowCtrlsByRowIndex={},this.zombieRowCtrls={},this.allRowCtrls=[],this.topRowCtrls=[],this.bottomRowCtrls=[],this.refreshInProgress=!1,this.dataFirstRenderedFired=!1}postConstruct(){this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl(),this.initialise()})}initialise(){if(this.addManagedListener(this.eventService,_e.EVENT_PAGINATION_CHANGED,this.onPageLoaded.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,this.onDisplayedColumnsChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_BODY_SCROLL,this.onBodyScroll.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_BODY_HEIGHT_CHANGED,this.redraw.bind(this)),this.addManagedPropertyListener("domLayout",this.onDomLayoutChanged.bind(this)),this.addManagedPropertyListener("rowClass",this.redrawRows.bind(this)),this.gridOptionsService.isGroupRowsSticky()){const e=this.rowModel.getType();"clientSide"!==e&&"serverSide"!==e||(this.stickyRowFeature=this.createManagedBean(new od(this.createRowCon.bind(this),this.destroyRowCtrls.bind(this))))}this.registerCellEventListeners(),this.initialiseCache(),this.printLayout=this.gridOptionsService.isDomLayout("print"),this.embedFullWidthRows=this.printLayout||this.gridOptionsService.is("embedFullWidthRows"),this.redrawAfterModelUpdate()}initialiseCache(){if(this.gridOptionsService.is("keepDetailRows")){const e=this.getKeepDetailRowsCount(),t=null!=e?e:3;this.cachedRowCtrls=new ld(t)}}getKeepDetailRowsCount(){const e=this.gridOptionsService.getNum("keepDetailRowsCount");return t(e)&&e>0?e:10}getStickyTopRowCtrls(){return this.stickyRowFeature?this.stickyRowFeature.getStickyRowCtrls():[]}updateAllRowCtrls(){const e=v(this.rowCtrlsByRowIndex),t=this.gridOptionsService.is("ensureDomOrder"),i=this.gridOptionsService.isDomLayout("print");(t||i)&&e.sort((e,t)=>e.getRowNode().rowIndex-t.getRowNode.rowIndex);const s=v(this.zombieRowCtrls),o=this.cachedRowCtrls?this.cachedRowCtrls.getEntries():[];s.length>0||o.length>0?this.allRowCtrls=[...e,...s,...o]:this.allRowCtrls=e}onCellFocusChanged(e){this.getAllCellCtrls().forEach(t=>t.onCellFocused(e)),this.getFullWidthRowCtrls().forEach(t=>t.onFullWidthRowFocused(e))}registerCellEventListeners(){this.addManagedListener(this.eventService,_e.EVENT_CELL_FOCUSED,e=>{this.onCellFocusChanged(e)}),this.addManagedListener(this.eventService,_e.EVENT_CELL_FOCUS_CLEARED,()=>{this.onCellFocusChanged()}),this.addManagedListener(this.eventService,_e.EVENT_FLASH_CELLS,e=>{this.getAllCellCtrls().forEach(t=>t.onFlashCells(e))}),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_HOVER_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onColumnHover())}),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onDisplayedColumnsChanged())}),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,()=>{this.printLayout&&this.getAllCellCtrls().forEach(e=>e.onLeftChanged())});this.gridOptionsService.is("enableRangeSelection")&&(this.addManagedListener(this.eventService,_e.EVENT_RANGE_SELECTION_CHANGED,()=>{this.getAllCellCtrls().forEach(e=>e.onRangeSelectionChanged())}),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_MOVED,()=>{this.getAllCellCtrls().forEach(e=>e.updateRangeBordersIfRangeCount())}),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_PINNED,()=>{this.getAllCellCtrls().forEach(e=>e.updateRangeBordersIfRangeCount())}),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_VISIBLE,()=>{this.getAllCellCtrls().forEach(e=>e.updateRangeBordersIfRangeCount())})),this.refreshListenersToColumnsForCellComps(),this.addManagedListener(this.eventService,_e.EVENT_GRID_COLUMNS_CHANGED,this.refreshListenersToColumnsForCellComps.bind(this)),this.addDestroyFunc(this.removeGridColumnListeners.bind(this))}removeGridColumnListeners(){this.destroyFuncsForColumnListeners.forEach(e=>e()),this.destroyFuncsForColumnListeners.length=0}refreshListenersToColumnsForCellComps(){this.removeGridColumnListeners();const e=this.columnModel.getAllGridColumns();e&&e.forEach(e=>{const t=t=>{this.getAllCellCtrls().forEach(i=>{i.getColumn()===e&&t(i)})},i=()=>{t(e=>e.onLeftChanged())},s=()=>{t(e=>e.onWidthChanged())},o=()=>{t(e=>e.onFirstRightPinnedChanged())},r=()=>{t(e=>e.onLastLeftPinnedChanged())},n=()=>{t(e=>e.onColDefChanged())};e.addEventListener("leftChanged",i),e.addEventListener("widthChanged",s),e.addEventListener("firstRightPinnedChanged",o),e.addEventListener("lastLeftPinnedChanged",r),e.addEventListener("colDefChanged",n),this.destroyFuncsForColumnListeners.push(()=>{e.removeEventListener("leftChanged",i),e.removeEventListener("widthChanged",s),e.removeEventListener("firstRightPinnedChanged",o),e.removeEventListener("lastLeftPinnedChanged",r),e.removeEventListener("colDefChanged",n)})})}onDomLayoutChanged(){const e=this.gridOptionsService.isDomLayout("print"),t=e||this.gridOptionsService.is("embedFullWidthRows"),i=t!==this.embedFullWidthRows||this.printLayout!==e;this.printLayout=e,this.embedFullWidthRows=t,i&&this.redrawAfterModelUpdate({domLayoutChanged:!0})}datasourceChanged(){this.firstRenderedRow=0,this.lastRenderedRow=-1;const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}onPageLoaded(e){const t={recycleRows:e.keepRenderedRows,animate:e.animate,newData:e.newData,newPage:e.newPage,onlyBody:!0};this.redrawAfterModelUpdate(t)}getAllCellsForColumn(e){const t=[];return this.getAllRowCtrls().forEach(i=>{const s=i.getCellElement(e);s&&t.push(s)}),t}refreshFloatingRowComps(){this.refreshFloatingRows(this.topRowCtrls,this.pinnedRowModel.getPinnedTopRowData()),this.refreshFloatingRows(this.bottomRowCtrls,this.pinnedRowModel.getPinnedBottomRowData())}getTopRowCtrls(){return this.topRowCtrls}getCentreRowCtrls(){return this.allRowCtrls}getBottomRowCtrls(){return this.bottomRowCtrls}refreshFloatingRows(e,t){e.forEach(e=>{e.destroyFirstPass(),e.destroySecondPass()}),e.length=0,t&&t.forEach(t=>{const i=new rl(t,this.beans,!1,!1,this.printLayout);e.push(i)})}onPinnedRowDataChanged(){this.redrawAfterModelUpdate({recycleRows:!0})}redrawRow(e,t=!1){if(e.sticky)this.stickyRowFeature.refreshStickyNode(e);else{const t=t=>{const i=t[e.rowIndex];i&&i.getRowNode()===e&&(i.destroyFirstPass(),i.destroySecondPass(),t[e.rowIndex]=this.createRowCon(e,!1,!1))};switch(e.rowPinned){case"top":t(this.topRowCtrls);case"bottom":t(this.bottomRowCtrls);default:t(this.rowCtrlsByRowIndex),this.updateAllRowCtrls()}}t||this.dispatchDisplayedRowsChanged(!1)}redrawRows(e){if(null!=e)return null==e||e.forEach(e=>this.redrawRow(e,!0)),void this.dispatchDisplayedRowsChanged(!1);this.redrawAfterModelUpdate()}getCellToRestoreFocusToAfterRefresh(e){const t=(null==e?void 0:e.suppressKeepFocus)?null:this.focusService.getFocusCellToUseAfterRefresh();if(null==t)return null;const i=this.gridOptionsService.getDocument().activeElement,s=this.gridOptionsService.getDomData(i,il.DOM_DATA_KEY_CELL_CTRL),o=this.gridOptionsService.getDomData(i,rl.DOM_DATA_KEY_ROW_CTRL);return s||o?t:null}redrawAfterModelUpdate(e={}){this.getLockOnRefresh();const t=this.getCellToRestoreFocusToAfterRefresh(e);this.updateContainerHeights(),this.scrollToTopIfNewData(e);const i=!e.domLayoutChanged&&!!e.recycleRows,s=e.animate&&this.gridOptionsService.isAnimateRows(),o=i?this.getRowsToRecycle():null;i||this.removeAllRowComps(),this.workOutFirstAndLastRowsToRender(),this.stickyRowFeature&&this.stickyRowFeature.checkStickyRows(),this.recycleRows(o,s),this.gridBodyCtrl.updateRowCount(),e.onlyBody||this.refreshFloatingRowComps(),this.dispatchDisplayedRowsChanged(),null!=t&&this.restoreFocusedCell(t),this.releaseLockOnRefresh()}scrollToTopIfNewData(e){const t=e.newData||e.newPage,i=this.gridOptionsService.is("suppressScrollOnNewData");t&&!i&&this.gridBodyCtrl.getScrollFeature().scrollToTop()}updateContainerHeights(){if(this.printLayout)return void this.rowContainerHeightService.setModelHeight(null);let e=this.paginationProxy.getCurrentPageHeight();0===e&&(e=1),this.rowContainerHeightService.setModelHeight(e)}getLockOnRefresh(){if(this.refreshInProgress)throw new Error("AG Grid: cannot get grid to draw rows when it is in the middle of drawing rows. Your code probably called a grid API method while the grid was in the render stage. To overcome this, put the API call into a timeout, e.g. instead of api.redrawRows(), call setTimeout(function() { api.redrawRows(); }, 0). To see what part of your code that caused the refresh check this stacktrace.");this.refreshInProgress=!0}releaseLockOnRefresh(){this.refreshInProgress=!1}isRefreshInProgress(){return this.refreshInProgress}restoreFocusedCell(e){e&&(this.focusService.setRestoreFocusedCell(e),this.onCellFocusChanged({rowIndex:e.rowIndex,column:e.column,rowPinned:e.rowPinned,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0,api:this.beans.gridApi,columnApi:this.beans.columnApi,context:this.beans.gridOptionsService.context,type:"mock"}))}stopEditing(e=!1){this.getAllRowCtrls().forEach(t=>{t.stopEditing(e)})}getAllCellCtrls(){const e=[],t=this.getAllRowCtrls(),i=t.length;for(let s=0;s<i;s++){const i=t[s].getAllCellCtrls(),o=i.length;for(let t=0;t<o;t++)e.push(i[t])}return e}getAllRowCtrls(){const e=this.stickyRowFeature&&this.stickyRowFeature.getStickyRowCtrls()||[],t=[...this.topRowCtrls,...this.bottomRowCtrls,...e];for(const e of Object.keys(this.rowCtrlsByRowIndex))t.push(this.rowCtrlsByRowIndex[e]);return t}addRenderedRowListener(e,t,i){const s=this.rowCtrlsByRowIndex[t];s&&s.addEventListener(e,i)}flashCells(e={}){const{flashDelay:t,fadeDelay:i}=e;this.getCellCtrls(e.rowNodes,e.columns).forEach(e=>e.flashCell({flashDelay:t,fadeDelay:i}))}refreshCells(e={}){const t={forceRefresh:e.force,newData:!1,suppressFlash:e.suppressFlash};this.getCellCtrls(e.rowNodes,e.columns).forEach(e=>{if(e.refreshShouldDestroy()){const t=e.getRowCtrl();t&&t.refreshCell(e)}else e.refreshCell(t)}),e.rowNodes&&(this.getRowCtrls(e.rowNodes).forEach(e=>{if(!e.isFullWidth())return;e.refreshFullWidth()||this.redrawRow(e.getRowNode(),!0)}),this.dispatchDisplayedRowsChanged(!1))}getCellRendererInstances(e){var t;const i=this.getCellCtrls(e.rowNodes,e.columns).map(e=>e.getCellRenderer()).filter(e=>null!=e);if(null===(t=e.columns)||void 0===t?void 0:t.length)return i;const s=[],o=this.mapRowNodes(e.rowNodes);return this.getAllRowCtrls().forEach(e=>{if(o&&!this.isRowInMap(e.getRowNode(),o))return;if(!e.isFullWidth())return;const t=e.getFullWidthCellRenderer();t&&s.push(t)}),[...s,...i]}getCellEditorInstances(e){const t=[];return this.getCellCtrls(e.rowNodes,e.columns).forEach(e=>{const i=e.getCellEditor();i&&t.push(i)}),t}getEditingCells(){const e=[];return this.getAllCellCtrls().forEach(t=>{if(t.isEditing()){const i=t.getCellPosition();e.push(i)}}),e}mapRowNodes(e){if(!e)return;const t={top:{},bottom:{},normal:{}};return e.forEach(e=>{const i=e.id;"top"===e.rowPinned?t.top[i]=e:"bottom"===e.rowPinned?t.bottom[i]=e:t.normal[i]=e}),t}isRowInMap(e,t){const i=e.id,s=e.rowPinned;return"bottom"===s?null!=t.bottom[i]:"top"===s?null!=t.top[i]:null!=t.normal[i]}getRowCtrls(e){const t=this.mapRowNodes(e),i=this.getAllRowCtrls();return e&&t?i.filter(e=>{const i=e.getRowNode();return this.isRowInMap(i,t)}):i}getCellCtrls(e,i){let s;t(i)&&(s={},i.forEach(e=>{const i=this.columnModel.getGridColumn(e);t(i)&&(s[i.getId()]=!0)}));const o=[];return this.getRowCtrls(e).forEach(e=>{e.getAllCellCtrls().forEach(e=>{const t=e.getColumn().getId();s&&!s[t]||o.push(e)})}),o}destroy(){this.removeAllRowComps(),super.destroy()}removeAllRowComps(){const e=Object.keys(this.rowCtrlsByRowIndex);this.removeRowCtrls(e)}getRowsToRecycle(){const e=[];h(this.rowCtrlsByRowIndex,(t,i)=>{null==i.getRowNode().id&&e.push(t)}),this.removeRowCtrls(e);const t={};return h(this.rowCtrlsByRowIndex,(e,i)=>{const s=i.getRowNode();t[s.id]=i}),this.rowCtrlsByRowIndex={},t}removeRowCtrls(e){e.forEach(e=>{const t=this.rowCtrlsByRowIndex[e];t&&(t.destroyFirstPass(),t.destroySecondPass()),delete this.rowCtrlsByRowIndex[e]})}onBodyScroll(e){"vertical"===e.direction&&this.redraw({afterScroll:!0})}redraw(e={}){const{afterScroll:t}=e;let i;this.stickyRowFeature&&ui()&&(i=this.getCellToRestoreFocusToAfterRefresh()||void 0);const s=this.firstRenderedRow,o=this.lastRenderedRow;this.workOutFirstAndLastRowsToRender();let r=!1;this.stickyRowFeature&&(r=this.stickyRowFeature.checkStickyRows());const n=this.firstRenderedRow!==s||this.lastRenderedRow!==o;if((!t||r||n)&&(this.getLockOnRefresh(),this.recycleRows(null,!1,t),this.releaseLockOnRefresh(),this.dispatchDisplayedRowsChanged(t),null!=i)){const e=this.getCellToRestoreFocusToAfterRefresh();null!=i&&null==e&&(this.animationFrameService.flushAllFrames(),this.restoreFocusedCell(i))}}removeRowCompsNotToDraw(e){const t={};e.forEach(e=>t[e]=!0);const i=Object.keys(this.rowCtrlsByRowIndex).filter(e=>!t[e]);this.removeRowCtrls(i)}calculateIndexesToDraw(e){let t=Ei(this.firstRenderedRow,this.lastRenderedRow);const i=(e,i)=>{const s=i.getRowNode().rowIndex;null!=s&&(s<this.firstRenderedRow||s>this.lastRenderedRow)&&this.doNotUnVirtualiseRow(i)&&t.push(s)};h(this.rowCtrlsByRowIndex,i),h(e,i),t.sort((e,t)=>e-t);const s=[];for(let e=0;e<t.length;e++){const i=t[e],o=this.paginationProxy.getRow(i);o&&!o.sticky&&s.push(i)}return s}recycleRows(e,t=!1,i=!1){const s=this.calculateIndexesToDraw(e);if(this.removeRowCompsNotToDraw(s),this.printLayout&&(t=!1),s.forEach(s=>{this.createOrUpdateRowCtrl(s,e,t,i)}),e){i&&!this.gridOptionsService.is("suppressAnimationFrame")&&!this.printLayout?this.beans.animationFrameService.addDestroyTask(()=>{this.destroyRowCtrls(e,t),this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}):this.destroyRowCtrls(e,t)}this.updateAllRowCtrls()}dispatchDisplayedRowsChanged(e=!1){const t={type:_e.EVENT_DISPLAYED_ROWS_CHANGED,afterScroll:e};this.eventService.dispatchEvent(t)}onDisplayedColumnsChanged(){const e=this.columnModel.isPinningLeft(),t=this.columnModel.isPinningRight();(this.pinningLeft!==e||t!==this.pinningRight)&&(this.pinningLeft=e,this.pinningRight=t,this.embedFullWidthRows&&this.redrawFullWidthEmbeddedRows())}redrawFullWidthEmbeddedRows(){const e=[];this.getFullWidthRowCtrls().forEach(t=>{const i=t.getRowNode().rowIndex;e.push(i.toString())}),this.refreshFloatingRowComps(),this.removeRowCtrls(e),this.redraw({afterScroll:!0})}getFullWidthRowCtrls(e){const t=this.mapRowNodes(e);return this.getAllRowCtrls().filter(e=>{if(!e.isFullWidth())return!1;const i=e.getRowNode();return!(null!=t&&!this.isRowInMap(i,t))})}createOrUpdateRowCtrl(e,i,s,o){let r,n=this.rowCtrlsByRowIndex[e];n||(r=this.paginationProxy.getRow(e),t(r)&&t(i)&&i[r.id]&&r.alreadyRendered&&(n=i[r.id],i[r.id]=null));if(!n){if(r||(r=this.paginationProxy.getRow(e)),!t(r))return;n=this.createRowCon(r,s,o)}return r&&(r.alreadyRendered=!0),this.rowCtrlsByRowIndex[e]=n,n}destroyRowCtrls(e,t){const i=[];h(e,(e,s)=>{s&&(this.cachedRowCtrls&&s.isCacheable()?this.cachedRowCtrls.addRow(s):(s.destroyFirstPass(),t?(this.zombieRowCtrls[s.getInstanceId()]=s,i.push(()=>{s.destroySecondPass(),delete this.zombieRowCtrls[s.getInstanceId()]})):s.destroySecondPass()))}),t&&(i.push(()=>{this.updateAllRowCtrls(),this.dispatchDisplayedRowsChanged()}),O(i))}getRowBuffer(){let e=this.gridOptionsService.getNum("rowBuffer");return"number"==typeof e?e<0&&(T(()=>console.warn("AG Grid: rowBuffer should not be negative"),"warn rowBuffer negative"),e=0,this.gridOptionsService.set("rowBuffer",0)):e=10,e}getRowBufferInPixels(){return this.getRowBuffer()*this.gridOptionsService.getRowHeightAsNumber()}workOutFirstAndLastRowsToRender(){let e,t;if(this.rowContainerHeightService.updateOffset(),this.paginationProxy.isRowsToRender())if(this.printLayout)this.environment.refreshRowHeightVariable(),e=this.paginationProxy.getPageFirstRow(),t=this.paginationProxy.getPageLastRow();else{const i=this.getRowBufferInPixels(),s=this.ctrlsService.getGridBodyCtrl(),o=this.gridOptionsService.is("suppressRowVirtualisation");let r,n,l=!1;do{const e=this.paginationProxy.getPixelOffset(),{pageFirstPixel:t,pageLastPixel:a}=this.paginationProxy.getCurrentPagePixelRange(),d=this.rowContainerHeightService.getDivStretchOffset(),h=s.getScrollFeature().getVScrollPosition(),c=h.top,u=h.bottom;o?(r=t+d,n=a+d):(r=Math.max(c+e-i,t)+d,n=Math.min(u+e+i,a)+d),this.firstVisibleVPixel=Math.max(c+e,t)+d,l=this.ensureAllRowsInRangeHaveHeightsCalculated(r,n)}while(l);let a=this.paginationProxy.getRowIndexAtPixel(r),d=this.paginationProxy.getRowIndexAtPixel(n);const h=this.paginationProxy.getPageFirstRow(),c=this.paginationProxy.getPageLastRow();a<h&&(a=h),d>c&&(d=c),e=a,t=d}else e=0,t=-1;const i=this.gridOptionsService.isDomLayout("normal"),s=this.gridOptionsService.is("suppressMaxRenderedRowRestriction"),o=Math.max(this.getRowBuffer(),500);i&&!s&&t-e>o&&(t=e+o);const r=e!==this.firstRenderedRow,n=t!==this.lastRenderedRow;if(r||n){this.firstRenderedRow=e,this.lastRenderedRow=t;const i={type:_e.EVENT_VIEWPORT_CHANGED,firstRow:e,lastRow:t};this.eventService.dispatchEvent(i)}}dispatchFirstDataRenderedEvent(){if(this.dataFirstRenderedFired)return;this.dataFirstRenderedFired=!0;const e={type:_e.EVENT_FIRST_DATA_RENDERED,firstRow:this.firstRenderedRow,lastRow:this.lastRenderedRow};window.requestAnimationFrame(()=>{this.beans.eventService.dispatchEvent(e)})}ensureAllRowsInRangeHaveHeightsCalculated(e,t){const i=this.paginationProxy.ensureRowHeightsValid(e,t,-1,-1);return i&&this.updateContainerHeights(),i}getFirstVisibleVerticalPixel(){return this.firstVisibleVPixel}getFirstVirtualRenderedRow(){return this.firstRenderedRow}getLastVirtualRenderedRow(){return this.lastRenderedRow}doNotUnVirtualiseRow(e){const t=e.getRowNode(),i=this.focusService.isRowNodeFocused(t),s=e.isEditing(),o=t.detail;if(!(i||s||o))return!1;return!!this.paginationProxy.isRowPresent(t)}createRowCon(e,t,i){const s=this.cachedRowCtrls?this.cachedRowCtrls.getRow(e):null;if(s)return s;const o=this.gridOptionsService.is("suppressAnimationFrame"),r=i&&!o&&!this.printLayout;return new rl(e,this.beans,t,r,this.printLayout)}getRenderedNodes(){const e=this.rowCtrlsByRowIndex;return Object.keys(e).map(t=>e[t].getRowNode())}getRowByPosition(e){let t;const{rowIndex:i}=e;switch(e.rowPinned){case"top":t=this.topRowCtrls[i];break;case"bottom":t=this.bottomRowCtrls[i];break;default:t=this.rowCtrlsByRowIndex[i],t||(t=this.getStickyTopRowCtrls().find(e=>e.getRowNode().rowIndex===i)||null)}return t}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}isRangeInRenderedViewport(e,t){if(null==e||null==t)return!1;const i=e>this.lastRenderedRow;return!(t<this.firstRenderedRow)&&!i}};rd([j("animationFrameService")],nd.prototype,"animationFrameService",void 0),rd([j("paginationProxy")],nd.prototype,"paginationProxy",void 0),rd([j("columnModel")],nd.prototype,"columnModel",void 0),rd([j("pinnedRowModel")],nd.prototype,"pinnedRowModel",void 0),rd([j("rowModel")],nd.prototype,"rowModel",void 0),rd([j("focusService")],nd.prototype,"focusService",void 0),rd([j("beans")],nd.prototype,"beans",void 0),rd([j("rowContainerHeightService")],nd.prototype,"rowContainerHeightService",void 0),rd([j("ctrlsService")],nd.prototype,"ctrlsService",void 0),rd([B],nd.prototype,"postConstruct",null),nd=rd([U("rowRenderer")],nd);class ld{constructor(e){this.entriesMap={},this.entriesList=[],this.maxCount=e}addRow(e){if(this.entriesMap[e.getRowNode().id]=e,this.entriesList.push(e),e.setCached(!0),this.entriesList.length>this.maxCount){const e=this.entriesList[0];e.destroyFirstPass(),e.destroySecondPass(),this.removeFromCache(e)}}getRow(e){if(null==e||null==e.id)return null;const t=this.entriesMap[e.id];if(!t)return null;this.removeFromCache(t),t.setCached(!1);return t.getRowNode()!=e?null:t}removeFromCache(e){const t=e.getRowNode().id;delete this.entriesMap[t],he(this.entriesList,e)}getEntries(){return this.entriesList}}var ad=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let dd=class extends Le{formatValue(e,t,i,s,o=!0){let r,n=null;const l=e.getColDef();if(s?r=s:o&&(r=l.valueFormatter),r){const s={value:i,node:t,data:t?t.data:null,colDef:l,column:e,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context};n="function"==typeof r?r(s):this.expressionService.evaluate(r,s)}else if(l.refData)return l.refData[i]||"";return null==n&&Array.isArray(i)&&(n=i.join(", ")),n}};ad([j("expressionService")],dd.prototype,"expressionService",void 0),dd=ad([U("valueFormatterService")],dd);var hd=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let cd=class extends Le{init(){this.setPinnedTopRowData(this.gridOptionsService.get("pinnedTopRowData")),this.setPinnedBottomRowData(this.gridOptionsService.get("pinnedBottomRowData"))}isEmpty(e){return s("top"===e?this.pinnedTopRows:this.pinnedBottomRows)}isRowsToRender(e){return!this.isEmpty(e)}getRowAtPixel(e,t){const i="top"===t?this.pinnedTopRows:this.pinnedBottomRows;if(s(i))return 0;for(let t=0;t<i.length;t++){const s=i[t];if(s.rowTop+s.rowHeight-1>=e)return t}return i.length-1}setPinnedTopRowData(e){this.pinnedTopRows=this.createNodesFromData(e,!0);const t={type:_e.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}setPinnedBottomRowData(e){this.pinnedBottomRows=this.createNodesFromData(e,!1);const t={type:_e.EVENT_PINNED_ROW_DATA_CHANGED};this.eventService.dispatchEvent(t)}createNodesFromData(e,t){const i=[];if(e){let s=0;e.forEach((e,o)=>{const r=new ar(this.beans);r.data=e;const n=t?ar.ID_PREFIX_TOP_PINNED:ar.ID_PREFIX_BOTTOM_PINNED;r.id=n+o,r.rowPinned=t?"top":"bottom",r.setRowTop(s),r.setRowHeight(this.gridOptionsService.getRowHeightForNode(r).height),r.setRowIndex(o),s+=r.rowHeight,i.push(r)})}return i}getPinnedTopRowData(){return this.pinnedTopRows}getPinnedBottomRowData(){return this.pinnedBottomRows}getPinnedTopTotalHeight(){return this.getTotalHeight(this.pinnedTopRows)}getPinnedTopRowCount(){return this.pinnedTopRows?this.pinnedTopRows.length:0}getPinnedBottomRowCount(){return this.pinnedBottomRows?this.pinnedBottomRows.length:0}getPinnedTopRow(e){return this.pinnedTopRows[e]}getPinnedBottomRow(e){return this.pinnedBottomRows[e]}forEachPinnedTopRow(e){s(this.pinnedTopRows)||this.pinnedTopRows.forEach(e)}forEachPinnedBottomRow(e){s(this.pinnedBottomRows)||this.pinnedBottomRows.forEach(e)}getPinnedBottomTotalHeight(){return this.getTotalHeight(this.pinnedBottomRows)}getTotalHeight(e){if(!e||0===e.length)return 0;const t=ne(e);return t.rowTop+t.rowHeight}};var ud;hd([j("beans")],cd.prototype,"beans",void 0),hd([B],cd.prototype,"init",null),cd=hd([U("pinnedRowModel")],cd),function(e){e.Applied="Applied",e.StoreNotFound="StoreNotFound",e.StoreLoading="StoreLoading",e.StoreWaitingToLoad="StoreWaitingToLoad",e.StoreLoadingFailed="StoreLoadingFailed",e.StoreWrongType="StoreWrongType",e.Cancelled="Cancelled"}(ud||(ud={}));class pd{constructor(e,t){this.active=!0,this.nodeIdsToColumns={},this.mapToItems={},this.keepingColumns=e,this.pathRoot={rowNode:t,children:null},this.mapToItems[t.id]=this.pathRoot}setInactive(){this.active=!1}isActive(){return this.active}depthFirstSearchChangedPath(e,t){if(e.children)for(let i=0;i<e.children.length;i++)this.depthFirstSearchChangedPath(e.children[i],t);t(e.rowNode)}depthFirstSearchEverything(e,t,i){if(e.childrenAfterGroup)for(let s=0;s<e.childrenAfterGroup.length;s++){const o=e.childrenAfterGroup[s];o.childrenAfterGroup?this.depthFirstSearchEverything(e.childrenAfterGroup[s],t,i):i&&t(o)}t(e)}forEachChangedNodeDepthFirst(e,t=!1,i=!1){this.active&&!i?this.depthFirstSearchChangedPath(this.pathRoot,e):this.depthFirstSearchEverything(this.pathRoot.rowNode,e,t)}executeFromRootNode(e){e(this.pathRoot.rowNode)}createPathItems(e){let t=e,i=0;for(;!this.mapToItems[t.id];){const e={rowNode:t,children:null};this.mapToItems[t.id]=e,i++,t=t.parent}return i}populateColumnsMap(e,t){if(!this.keepingColumns||!t)return;let i=e;for(;i;)this.nodeIdsToColumns[i.id]||(this.nodeIdsToColumns[i.id]={}),t.forEach(e=>this.nodeIdsToColumns[i.id][e.getId()]=!0),i=i.parent}linkPathItems(e,t){let i=e;for(let e=0;e<t;e++){const e=this.mapToItems[i.id],t=this.mapToItems[i.parent.id];t.children||(t.children=[]),t.children.push(e),i=i.parent}}addParentNode(e,t){if(!e||e.isRowPinned())return;const i=this.createPathItems(e);this.linkPathItems(e,i),this.populateColumnsMap(e,t)}canSkip(e){return this.active&&!this.mapToItems[e.id]}getValueColumnsForNode(e,t){if(!this.keepingColumns)return t;const i=this.nodeIdsToColumns[e.id];return t.filter(e=>i[e.getId()])}getNotValueColumnsForNode(e,t){if(!this.keepingColumns)return null;const i=this.nodeIdsToColumns[e.id];return t.filter(e=>!i[e.getId()])}}class gd extends Le{constructor(e){super(),this.state=gd.STATE_WAITING_TO_LOAD,this.version=0,this.id=e}getId(){return this.id}load(){this.state=gd.STATE_LOADING,this.loadFromDatasource()}getVersion(){return this.version}setStateWaitingToLoad(){this.version++,this.state=gd.STATE_WAITING_TO_LOAD}getState(){return this.state}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state=gd.STATE_FAILED,this.processServerFail()),this.dispatchLoadCompleted(!1)}success(e,t){this.successCommon(e,t)}pageLoaded(e,t,i){this.successCommon(e,{rowData:t,rowCount:i})}isRequestMostRecentAndLive(e){const t=e===this.version,i=this.isAlive();return t&&i}successCommon(e,t){this.dispatchLoadCompleted();this.isRequestMostRecentAndLive(e)&&(this.state=gd.STATE_LOADED,this.processServerResult(t))}dispatchLoadCompleted(e=!0){const t={type:gd.EVENT_LOAD_COMPLETE,success:e,block:this};this.dispatchEvent(t)}}gd.EVENT_LOAD_COMPLETE="loadComplete",gd.STATE_WAITING_TO_LOAD="needsLoading",gd.STATE_LOADING="loading",gd.STATE_LOADED="loaded",gd.STATE_FAILED="failed";var md,Cd=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},vd=function(e,t){return function(i,s){t(i,s,e)}};let fd=md=class extends Le{constructor(){super(...arguments),this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=this.getMaxConcurrentDatasourceRequests();const e=this.gridOptionsService.getNum("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Is.debounce(this.performCheckBlocksToLoad.bind(this),e))}setBeans(e){this.logger=e.create("RowNodeBlockLoader")}getMaxConcurrentDatasourceRequests(){const e=this.gridOptionsService.getNum("maxConcurrentDatasourceRequests");return null==e?2:e<=0?void 0:e}addBlock(e){this.blocks.push(e),e.addEventListener(gd.EVENT_LOAD_COMPLETE,this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){Is.removeFromArray(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad(),this.dispatchEvent({type:md.BLOCK_LOADED_EVENT}),0==this.activeBlockLoadsCount&&this.dispatchEvent({type:md.BLOCK_LOADER_FINISHED_EVENT})}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),null!=this.maxConcurrentRequests&&this.activeBlockLoadsCount>=this.maxConcurrentRequests)return void this.logger.log("checkBlockToLoad: max loads exceeded");const e=this.getAvailableLoadingCount(),t=this.blocks.filter(e=>e.getState()===gd.STATE_WAITING_TO_LOAD).slice(0,e);this.registerLoads(t.length),t.forEach(e=>e.load()),this.printCacheStatus()}getBlockState(){if(this.gridOptionsService.isRowModelType("serverSide")){return this.rowModel.getBlockStates()}const e={};return this.blocks.forEach(t=>{const{id:i,state:s}=t.getBlockStateJson();e[i]=s}),e}printCacheStatus(){this.logger.isLogging()&&this.logger.log(`printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = `+JSON.stringify(this.getBlockState()))}isLoading(){return this.activeBlockLoadsCount>0}registerLoads(e){this.activeBlockLoadsCount+=e}getAvailableLoadingCount(){return void 0!==this.maxConcurrentRequests?this.maxConcurrentRequests-this.activeBlockLoadsCount:void 0}};fd.BLOCK_LOADED_EVENT="blockLoaded",fd.BLOCK_LOADER_FINISHED_EVENT="blockLoaderFinished",Cd([j("rowModel")],fd.prototype,"rowModel",void 0),Cd([B],fd.prototype,"postConstruct",null),Cd([vd(0,Y("loggerFactory"))],fd.prototype,"setBeans",null),fd=md=Cd([U("rowNodeBlockLoader")],fd);var wd=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let yd=class extends Le{constructor(){super(...arguments),this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.pixelOffset=0,this.masterRowCount=0}postConstruct(){this.active=this.gridOptionsService.is("pagination"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedListener(this.eventService,_e.EVENT_MODEL_UPDATED,this.onModelUpdated.bind(this)),this.addManagedPropertyListener("pagination",this.onPaginationPageSizeChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPaginationPageSizeChanged.bind(this)),this.onModelUpdated()}ensureRowHeightsValid(e,t,i,s){const o=this.rowModel.ensureRowHeightsValid(e,t,this.getPageFirstRow(),this.getPageLastRow());return o&&this.calculatePages(),o}isPaginateChildRows(){return!(!this.gridOptionsService.is("groupRemoveSingleChildren")&&!this.gridOptionsService.is("groupRemoveLowestSingleChildren"))||this.gridOptionsService.is("paginateChildRows")}onModelUpdated(e){this.calculatePages();const t={type:_e.EVENT_PAGINATION_CHANGED,animate:!!e&&e.animate,newData:!!e&&e.newData,newPage:!!e&&e.newPage,keepRenderedRows:!!e&&e.keepRenderedRows};this.eventService.dispatchEvent(t)}onPaginationPageSizeChanged(){this.active=this.gridOptionsService.is("pagination"),this.calculatePages();const e={type:_e.EVENT_PAGINATION_CHANGED,animate:!1,newData:!1,newPage:!1,keepRenderedRows:!0};this.eventService.dispatchEvent(e)}goToPage(e){if(!this.active||this.currentPage===e||"number"!=typeof this.currentPage)return;this.currentPage=e;const t={type:_e.EVENT_MODEL_UPDATED,animate:!1,keepRenderedRows:!1,newData:!1,newPage:!0};this.onModelUpdated(t)}getPixelOffset(){return this.pixelOffset}getRow(e){return this.rowModel.getRow(e)}getRowNode(e){return this.rowModel.getRowNode(e)}getRowIndexAtPixel(e){return this.rowModel.getRowIndexAtPixel(e)}getCurrentPageHeight(){return i(this.topRowBounds)||i(this.bottomRowBounds)?0:Math.max(this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight-this.topRowBounds.rowTop,0)}getCurrentPagePixelRange(){return{pageFirstPixel:this.topRowBounds?this.topRowBounds.rowTop:0,pageLastPixel:this.bottomRowBounds?this.bottomRowBounds.rowTop+this.bottomRowBounds.rowHeight:0}}isRowPresent(e){if(!this.rowModel.isRowPresent(e))return!1;return e.rowIndex>=this.topDisplayedRowIndex&&e.rowIndex<=this.bottomDisplayedRowIndex}isEmpty(){return this.rowModel.isEmpty()}isRowsToRender(){return this.rowModel.isRowsToRender()}forEachNode(e){return this.rowModel.forEachNode(e)}forEachNodeOnPage(e){const t=this.getPageFirstRow(),i=this.getPageLastRow();for(let s=t;s<=i;s++){const t=this.getRow(s);t&&e(t)}}getType(){return this.rowModel.getType()}getRowBounds(e){const t=this.rowModel.getRowBounds(e);return t.rowIndex=e,t}getPageFirstRow(){return this.topRowBounds?this.topRowBounds.rowIndex:-1}getPageLastRow(){return this.bottomRowBounds?this.bottomRowBounds.rowIndex:-1}getRowCount(){return this.rowModel.getRowCount()}getPageForIndex(e){return Math.floor(e/this.pageSize)}goToPageWithIndex(e){if(!this.active)return;const t=this.getPageForIndex(e);this.goToPage(t)}isRowInPage(e){if(!this.active)return!0;return this.getPageForIndex(e.rowIndex)===this.currentPage}isLastPageFound(){return this.rowModel.isLastRowIndexKnown()}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPageSize(){this.pageSize=this.gridOptionsService.getNum("paginationPageSize"),(null==this.pageSize||this.pageSize<1)&&(this.pageSize=100)}calculatePages(){this.active?(this.setPageSize(),this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly()):this.calculatedPagesNotActive(),this.topRowBounds=this.rowModel.getRowBounds(this.topDisplayedRowIndex),this.topRowBounds&&(this.topRowBounds.rowIndex=this.topDisplayedRowIndex),this.bottomRowBounds=this.rowModel.getRowBounds(this.bottomDisplayedRowIndex),this.bottomRowBounds&&(this.bottomRowBounds.rowIndex=this.bottomDisplayedRowIndex),this.setPixelOffset(t(this.topRowBounds)?this.topRowBounds.rowTop:0)}setPixelOffset(e){this.pixelOffset!==e&&(this.pixelOffset=e,this.eventService.dispatchEvent({type:_e.EVENT_PAGINATION_PIXEL_OFFSET_CHANGED}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){this.currentPage>=this.totalPages&&(this.currentPage=this.totalPages-1),(!isFinite(this.currentPage)||isNaN(this.currentPage)||this.currentPage<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){if(this.masterRowCount=this.rowModel.getTopLevelRowCount(),this.masterRowCount<=0)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid();const t=this.pageSize*this.currentPage;let i=this.pageSize*(this.currentPage+1)-1;if(i>e&&(i=e),this.topDisplayedRowIndex=this.rowModel.getTopLevelRowDisplayedIndex(t),i===e)this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1;else{const e=this.rowModel.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=e-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){if(this.masterRowCount=this.rowModel.getRowCount(),0===this.masterRowCount)return void this.setZeroRows();const e=this.masterRowCount-1;this.totalPages=Math.floor(e/this.pageSize)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=this.pageSize*this.currentPage,this.bottomDisplayedRowIndex=this.pageSize*(this.currentPage+1)-1,this.bottomDisplayedRowIndex>e&&(this.bottomDisplayedRowIndex=e)}calculatedPagesNotActive(){this.pageSize=this.rowModel.getRowCount(),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.rowModel.getRowCount()-1}};wd([j("rowModel")],yd.prototype,"rowModel",void 0),wd([B],yd.prototype,"postConstruct",null),yd=wd([U("paginationProxy")],yd);var Sd=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Ed=class extends Le{processAllCellClasses(e,t,i,s){this.processClassRules(e.cellClassRules,t,i,s),this.processStaticCellClasses(e,t,i)}processClassRules(e,t,i,s){if(null==e)return;const o=Object.keys(e),r={},n={};for(let i=0;i<o.length;i++){const s=o[i],l=e[s];let a;"string"==typeof l?a=this.expressionService.evaluate(l,t):"function"==typeof l&&(a=l(t)),s.split(" ").forEach(e=>{null!=e&&""!=e.trim()&&(a?r[e]=!0:n[e]=!0)})}s&&Object.keys(n).forEach(s),Object.keys(r).forEach(i)}getStaticCellClasses(e,t){const{cellClass:i}=e;if(!i)return[];let s;if("function"==typeof i){s=i(t)}else s=i;return"string"==typeof s&&(s=[s]),s||[]}processStaticCellClasses(e,t,i){this.getStaticCellClasses(e,t).forEach(e=>{i(e)})}};Sd([j("expressionService")],Ed.prototype,"expressionService",void 0),Ed=Sd([U("stylingService")],Ed);class Rd extends Co{constructor(e){super(e,"ag-toggle-button")}setValue(e,t){return super.setValue(e,t),this.addOrRemoveCssClass("ag-selected",this.getValue()),this}}class Td extends mo{constructor(e){super(e,"ag-text-area",null,"textarea")}setValue(e,t){const i=super.setValue(e,t);return this.eInput.value=e,i}setCols(e){return this.eInput.cols=e,this}setRows(e){return this.eInput.rows=e,this}}class bd extends Ao{constructor(e){super(e,"ag-date-field","date")}postConstruct(){super.postConstruct(),this.addManagedListener(this.eInput,"wheel",this.onWheel.bind(this));const e=ni();this.addManagedListener(this.eInput,"mousedown",()=>{this.isDisabled()||e||this.eInput.focus()}),this.eInput.step="any"}onWheel(e){document.activeElement===this.eInput&&e.preventDefault()}setMin(e){var t;const i=e instanceof Date?null!==(t=bi(null!=e?e:null,!1))&&void 0!==t?t:void 0:e;return this.min===i||(this.min=i,us(this.eInput,"min",i)),this}setMax(e){var t;const i=e instanceof Date?null!==(t=bi(null!=e?e:null,!1))&&void 0!==t?t:void 0:e;return this.max===i||(this.max=i,us(this.eInput,"max",i)),this}setStep(e){return this.step===e||(this.step=e,us(this.eInput,"step",e)),this}getDate(){var e;if(this.eInput.validity.valid)return null!==(e=Pi(this.getValue()))&&void 0!==e?e:void 0}setDate(e,t){this.setValue(bi(null!=e?e:null,!1),t)}}class Dd extends mo{constructor(e){super(e,"ag-range-field","range")}postConstruct(){super.postConstruct();const{min:e,max:t,step:i}=this.config;null!=e&&this.setMinValue(e),null!=t&&this.setMaxValue(t),this.setStep(i||1)}addInputListeners(){this.addManagedListener(this.eInput,"input",e=>{const t=e.target.value;this.setValue(t)})}setMinValue(e){return this.min=e,this.eInput.setAttribute("min",e.toString()),this}setMaxValue(e){return this.max=e,this.eInput.setAttribute("max",e.toString()),this}setStep(e){return this.eInput.setAttribute("step",e.toString()),this}setValue(e,t){null!=this.min&&(e=Math.max(parseFloat(e),this.min).toString()),null!=this.max&&(e=Math.min(parseFloat(e),this.max).toString());const i=super.setValue(e,t);return this.eInput.value=e,i}}var Od=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Pd extends js{constructor(e,t){super('<div class="ag-rich-select-row" role="presentation"></div>'),this.params=e,this.wrapperEl=t}postConstruct(){this.addManagedListener(this.getGui(),"mouseup",this.onMouseUp.bind(this))}setState(e){let t="";this.params.valueFormatter&&(t=this.params.valueFormatter(e));this.populateWithRenderer(e,t)||this.populateWithoutRenderer(e,t),this.value=e}highlightString(e){const{parsedValue:i}=this;if(!this.params.cellRenderer&&t(i))if(t(e)){const t=null==i?void 0:i.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(t>=0){const s=t+e.length,o=je(i.slice(0,t),!0),r=je(i.slice(t,s),!0),n=je(i.slice(s));this.renderValueWithoutRenderer(`${o}<span class="ag-rich-select-row-text-highlight">${r}</span>${n}`)}}else this.renderValueWithoutRenderer(i)}updateHighlighted(e){var t;const i=this.getGui(),s="ag-rich-select-row-"+this.getCompId();if(null===(t=i.parentElement)||void 0===t||t.setAttribute("id",s),e){Mt(this.getParentComponent().getAriaElement(),s),this.wrapperEl.setAttribute("data-active-option",s)}Yt(i.parentElement,e),this.addOrRemoveCssClass("ag-rich-select-row-selected",e)}populateWithoutRenderer(e,i){const s=this.gridOptionsService.getDocument(),o=this.getGui(),r=s.createElement("span");r.style.overflow="hidden",r.style.textOverflow="ellipsis";const n=je(t(i)?i:e,!0);this.parsedValue=t(n)?n:null,o.appendChild(r),this.renderValueWithoutRenderer(n)}renderValueWithoutRenderer(e){const i=this.getGui().querySelector("span");i&&(i.innerHTML=t(e)?e:"&nbsp;")}populateWithRenderer(e,t){let i,s;return this.params.cellRenderer&&(s=this.userComponentFactory.getCellRendererDetails(this.params,{value:e,valueFormatted:t,api:this.gridOptionsService.api})),s&&(i=s.newAgStackInstance()),i&&gs(i,this.getGui()),!!i&&(i.then(e=>{this.addDestroyFunc(()=>{this.getContext().destroyBean(e)})}),!0)}onMouseUp(){const e=this.getParentComponent(),t={type:_e.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:!1,value:this.value};null==e||e.dispatchEvent(t)}}Od([j("userComponentFactory")],Pd.prototype,"userComponentFactory",void 0),Od([B],Pd.prototype,"postConstruct",null);class Ad extends js{initialiseTabGuard(e){this.eTopGuard=this.createTabGuard("top"),this.eBottomGuard=this.createTabGuard("bottom"),this.eFocusableElement=this.getFocusableElement();const t=[this.eTopGuard,this.eBottomGuard],i={setTabIndex:e=>{t.forEach(t=>null!=e?t.setAttribute("tabindex",e):t.removeAttribute("tabindex"))}};this.addTabGuards(this.eTopGuard,this.eBottomGuard),this.tabGuardCtrl=this.createManagedBean(new fa({comp:i,eTopGuard:this.eTopGuard,eBottomGuard:this.eBottomGuard,eFocusableElement:this.eFocusableElement,onFocusIn:e.onFocusIn,onFocusOut:e.onFocusOut,focusInnerElement:e.focusInnerElement,handleKeyDown:e.handleKeyDown,onTabKeyDown:e.onTabKeyDown,shouldStopEventPropagation:e.shouldStopEventPropagation}))}createTabGuard(e){const t=document.createElement("div"),i="top"===e?Ca.TAB_GUARD_TOP:Ca.TAB_GUARD_BOTTOM;return t.classList.add(Ca.TAB_GUARD,i),Et(t,"presentation"),t}addTabGuards(e,t){this.eFocusableElement.insertAdjacentElement("afterbegin",e),this.eFocusableElement.insertAdjacentElement("beforeend",t)}removeAllChildrenExceptTabGuards(){const e=[this.eTopGuard,this.eBottomGuard];Yi(this.getFocusableElement()),this.addTabGuards(...e)}forceFocusOutOfContainer(e=!1){this.tabGuardCtrl.forceFocusOutOfContainer(e)}appendChild(e,t){ds(e)||(e=e.getGui());const{eBottomGuard:i}=this;i?i.insertAdjacentElement("beforebegin",e):super.appendChild(e,t)}}var Fd=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Ld extends Ad{constructor(e){super(Ld.getTemplate((null==e?void 0:e.cssIdentifier)||"default")),this.renderedRows=new Map,this.rowHeight=20;const{cssIdentifier:t="default",ariaRole:i="listbox",listName:s}=e||{};this.cssIdentifier=t,this.ariaRole=i,this.listName=s}postConstruct(){this.addScrollListener(),this.rowHeight=this.getItemHeight(),this.addResizeObserver(),this.initialiseTabGuard({onFocusIn:e=>this.onFocusIn(e),onFocusOut:e=>this.onFocusOut(e),focusInnerElement:e=>this.focusInnerElement(e),onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)}),this.setAriaProperties(),this.addManagedListener(this.eventService,_e.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanged.bind(this))}onGridStylesChanged(){this.rowHeight=this.getItemHeight(),this.refresh()}setAriaProperties(){const e=this.localeService.getLocaleTextFunc()("ariaDefaultListName",this.listName||"List"),t=this.eContainer;Et(t,this.ariaRole),Dt(t,e)}addResizeObserver(){const e=this.resizeObserverService.observeResize(this.getGui(),()=>this.animationFrameService.requestAnimationFrame(()=>this.drawVirtualRows()));this.addDestroyFunc(e)}focusInnerElement(e){this.focusRow(e?this.model.getRowCount()-1:0)}onFocusIn(e){const t=e.target;return t.classList.contains("ag-virtual-list-item")&&(this.lastFocusedRowIndex=bt(t)-1),!1}onFocusOut(e){return this.getFocusableElement().contains(e.relatedTarget)||(this.lastFocusedRowIndex=null),!1}handleKeyDown(e){switch(e.key){case ys.UP:case ys.DOWN:this.navigate(e.key===ys.UP)&&e.preventDefault()}}onTabKeyDown(e){this.navigate(e.shiftKey)?e.preventDefault():(Se(e),this.forceFocusOutOfContainer(e.shiftKey))}navigate(e){if(null==this.lastFocusedRowIndex)return!1;const t=this.lastFocusedRowIndex+(e?-1:1);return!(t<0||t>=this.model.getRowCount())&&(this.focusRow(t),!0)}getLastFocusedRow(){return this.lastFocusedRowIndex}focusRow(e){this.ensureIndexVisible(e),window.setTimeout(()=>{if(!this.isAlive())return;const t=this.renderedRows.get(e);t&&t.eDiv.focus()},10)}getComponentAt(e){const t=this.renderedRows.get(e);return t&&t.rowComponent}forEachRenderedRow(e){this.renderedRows.forEach((t,i)=>e(t.rowComponent,i))}static getTemplate(e){return`<div class="ag-virtual-list-viewport ag-${e}-virtual-list-viewport" role="presentation">\n                <div class="ag-virtual-list-container ag-${e}-virtual-list-container" ref="eContainer"></div>\n            </div>`}getItemHeight(){return this.environment.getListItemHeight()}ensureIndexVisible(e,t=!0){const i=this.model.getRowCount();if("number"!=typeof e||e<0||e>=i)return console.warn("AG Grid: invalid row index for ensureIndexVisible: "+e),!1;const s=e*this.rowHeight,o=s+this.rowHeight,r=this.getGui(),n=r.scrollTop,l=r.offsetHeight,a=n+l,d=t?0:this.rowHeight,h=a<o-d;if(n>s+d)return r.scrollTop=s,!0;if(h){const e=o-l;return r.scrollTop=e,!0}return!1}setComponentCreator(e){this.componentCreator=e}setComponentUpdater(e){this.componentUpdater=e}getRowHeight(){return this.rowHeight}getScrollTop(){return this.getGui().scrollTop}setRowHeight(e){this.rowHeight=e,this.refresh()}refresh(e){if(null==this.model||!this.isAlive())return;const t=this.model.getRowCount();this.eContainer.style.height=t*this.rowHeight+"px",M(()=>this.eContainer.clientHeight>=t*this.rowHeight,()=>{this.isAlive()&&(this.canSoftRefresh(e)?this.drawVirtualRows(!0):(this.clearVirtualRows(),this.drawVirtualRows()))})}canSoftRefresh(e){return!!(e&&this.renderedRows.size&&"function"==typeof this.model.areRowsEqual&&this.componentUpdater)}clearVirtualRows(){this.renderedRows.forEach((e,t)=>this.removeRow(t))}drawVirtualRows(e){if(!this.isAlive()||!this.model)return;const t=this.getGui(),i=t.scrollTop,s=i+t.offsetHeight,o=Math.floor(i/this.rowHeight),r=Math.floor(s/this.rowHeight);this.ensureRowsRendered(o,r,e)}ensureRowsRendered(e,t,i){this.renderedRows.forEach((i,s)=>{(s<e||s>t)&&s!==this.lastFocusedRowIndex&&this.removeRow(s)}),i&&this.refreshRows();for(let i=e;i<=t;i++)this.renderedRows.has(i)||i<this.model.getRowCount()&&this.insertRow(i)}insertRow(e){const t=this.model.getRow(e),i=document.createElement("div");if(i.classList.add("ag-virtual-list-item",`ag-${this.cssIdentifier}-virtual-list-item`),Et(i,"tree"===this.ariaRole?"treeitem":"option"),_t(i,this.model.getRowCount()),Vt(i,e+1),i.setAttribute("tabindex","-1"),"function"==typeof this.model.isRowSelected){const t=this.model.isRowSelected(e);Yt(i,!!t),$t(i,t)}i.style.height=this.rowHeight+"px",i.style.top=this.rowHeight*e+"px";const s=this.componentCreator(t,i);s.addGuiEventListener("focusin",()=>this.lastFocusedRowIndex=e),i.appendChild(s.getGui()),this.renderedRows.has(e-1)?this.renderedRows.get(e-1).eDiv.insertAdjacentElement("afterend",i):this.renderedRows.has(e+1)?this.renderedRows.get(e+1).eDiv.insertAdjacentElement("beforebegin",i):this.eContainer.appendChild(i),this.renderedRows.set(e,{rowComponent:s,eDiv:i,value:t})}removeRow(e){const t=this.renderedRows.get(e);this.eContainer.removeChild(t.eDiv),this.destroyBean(t.rowComponent),this.renderedRows.delete(e)}refreshRows(){const e=this.model.getRowCount();this.renderedRows.forEach((t,i)=>{var s,o;if(i>=e)this.removeRow(i);else{const e=this.model.getRow(i);(null===(o=(s=this.model).areRowsEqual)||void 0===o?void 0:o.call(s,t.value,e))?this.componentUpdater(e,t.rowComponent):this.removeRow(i)}})}addScrollListener(){this.addGuiEventListener("scroll",()=>this.drawVirtualRows(),{passive:!0})}setModel(e){this.model=e}getAriaElement(){return this.eContainer}destroy(){this.isAlive()&&(this.clearVirtualRows(),super.destroy())}}Fd([j("resizeObserverService")],Ld.prototype,"resizeObserverService",void 0),Fd([j("animationFrameService")],Ld.prototype,"animationFrameService",void 0),Fd([Ks("eContainer")],Ld.prototype,"eContainer",void 0),Fd([B],Ld.prototype,"postConstruct",null);var Id=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Nd extends ho{constructor(e){var t,i;super(Object.assign(Object.assign({pickerAriaLabelKey:"ariaLabelRichSelectField",pickerAriaLabelValue:"Rich Select Field",pickerType:"ag-list",className:"ag-rich-select",pickerIcon:"smallDown",ariaRole:"combobox",template:null!==(t=null==e?void 0:e.template)&&void 0!==t?t:'\n    <div class="ag-picker-field" role="presentation">\n        <div ref="eLabel"></div>\n            <div ref="eWrapper" class="ag-wrapper ag-picker-field-wrapper ag-rich-select-value ag-picker-collapsed">\n            <div ref="eDisplayField" class="ag-picker-field-display"></div>\n            <ag-input-text-field ref="eInput" class="ag-rich-select-field-input"></ag-input-text-field>\n            <div ref="eIcon" class="ag-picker-field-icon" aria-hidden="true"></div>\n        </div>\n    </div>',modalPicker:!1},e),{maxPickerHeight:null!==(i=null==e?void 0:e.maxPickerHeight)&&void 0!==i?i:"calc(var(--ag-row-height) * 6.5)"})),this.searchString="",this.highlightedItem=-1,this.lastRowHovered=-1,this.searchStringCreator=null;const{cellRowHeight:s,value:o,valueList:r,searchStringCreator:n}=e||{};null!=s&&(this.cellRowHeight=s),void 0!==o&&(this.value=o),null!=r&&(this.values=r),n&&(this.searchStringCreator=n)}postConstruct(){var e;super.postConstruct(),this.createLoadingElement(),this.createListComponent();const{allowTyping:t,placeholder:i}=this.config;t?(this.eInput.setAutoComplete(!1).setInputPlaceholder(i),this.eDisplayField.classList.add("ag-hidden")):this.eInput.setDisplayed(!1),this.eWrapper.tabIndex=null!==(e=this.gridOptionsService.getNum("tabIndex"))&&void 0!==e?e:0;const{searchDebounceDelay:s=300}=this.config;this.clearSearchString=I(this.clearSearchString,s),this.renderSelectedValue(),t&&(this.eInput.onValueChange(e=>this.searchTextFromString(e)),this.addManagedListener(this.eWrapper,"focus",this.onWrapperFocus.bind(this))),this.addManagedListener(this.eWrapper,"focusout",this.onWrapperFocusOut.bind(this))}createLoadingElement(){const e=this.gridOptionsService.getDocument(),t=this.localeService.getLocaleTextFunc(),i=e.createElement("div");i.classList.add("ag-loading-text"),i.innerText=t("loadingOoo","Loading..."),this.eLoading=i}createListComponent(){this.listComponent=this.createBean(new Ld({cssIdentifier:"rich-select"})),this.listComponent.setComponentCreator(this.createRowComponent.bind(this)),this.listComponent.setParentComponent(this),this.addManagedListener(this.listComponent,_e.EVENT_FIELD_PICKER_VALUE_SELECTED,e=>{this.onListValueSelected(e.value,e.fromEnterKey)});const{cellRowHeight:e}=this;e&&this.listComponent.setRowHeight(e);const t=this.listComponent.getGui(),i=this.listComponent.getAriaElement();this.addManagedListener(t,"mousemove",this.onPickerMouseMove.bind(this)),this.addManagedListener(t,"mousedown",e=>e.preventDefault()),t.classList.add("ag-rich-select-list");const s="ag-rich-select-list-"+this.listComponent.getCompId();i.setAttribute("id",s);Dt(i,this.localeService.getLocaleTextFunc()(this.config.pickerAriaLabelKey,this.config.pickerAriaLabelValue)),qt(this.eWrapper,i)}renderSelectedValue(){const{value:e,eDisplayField:i,config:s}=this,o=this.config.valueFormatter?this.config.valueFormatter(e):e;if(s.allowTyping)return void this.eInput.setValue(o);let r,n;if(s.cellRenderer&&(r=this.userComponentFactory.getCellRendererDetails(this.config,{value:e,valueFormatted:o,api:this.gridOptionsService.api})),r&&(n=r.newAgStackInstance()),n)Yi(i),gs(n,i),n.then(e=>{this.addDestroyFunc(()=>this.getContext().destroyBean(e))});else if(t(this.value))i.innerText=o,i.classList.remove("ag-display-as-placeholder");else{const{placeholder:e}=s;t(e)?(i.innerHTML=""+je(e),i.classList.add("ag-display-as-placeholder")):Yi(i)}}getCurrentValueIndex(){const{currentList:e,value:t}=this;if(null==t)return-1;for(let i=0;i<e.length;i++)if(e[i]===t)return i;return-1}highlightFilterMatch(){var e;null===(e=this.listComponent)||void 0===e||e.forEachRenderedRow((e,t)=>{e.highlightString(this.searchString)})}highlightSelectedValue(e){var t;null==e&&(e=this.getCurrentValueIndex()),this.highlightedItem=e,null===(t=this.listComponent)||void 0===t||t.forEachRenderedRow((t,i)=>{const s=-1!==e&&this.highlightedItem===i;t.updateHighlighted(s)})}setRowHeight(e){e!==this.cellRowHeight&&(this.cellRowHeight=e),this.listComponent&&this.listComponent.setRowHeight(e)}createPickerComponent(){const{values:e}=this;return e&&this.setValueList({valueList:e}),this.listComponent}setSearchStringCreator(e){this.searchStringCreator=e}setValueList(e){const{valueList:t,refresh:i}=e;this.listComponent&&this.currentList!==t&&(this.currentList=t,this.listComponent.setModel({getRowCount:()=>t.length,getRow:e=>t[e]}),i&&(this.values?this.listComponent.refresh():(this.values=t,this.isPickerDisplayed&&this.showCurrentValueInPicker())))}showPicker(){super.showPicker(),this.showCurrentValueInPicker()}showCurrentValueInPicker(){var e,t;if(!this.listComponent)return;if(!this.currentList)return void(this.isPickerDisplayed&&this.eLoading&&this.listComponent.appendChild(this.eLoading));(null===(e=this.eLoading)||void 0===e?void 0:e.offsetParent)&&(null===(t=this.eLoading.parentElement)||void 0===t||t.removeChild(this.eLoading));const i=this.getCurrentValueIndex();-1!==i?(this.listComponent.refresh(),this.listComponent.ensureIndexVisible(i),this.listComponent.refresh(!0),this.highlightSelectedValue(i)):this.listComponent.refresh()}beforeHidePicker(){this.highlightedItem=-1,super.beforeHidePicker()}onWrapperFocus(e){this.eInput&&this.eInput.getFocusableElement().focus()}onWrapperFocusOut(e){this.eWrapper.contains(e.relatedTarget)||this.hidePicker()}buildSearchStringFromKeyboardEvent(e){let{key:t}=e;if(t===ys.BACKSPACE)this.searchString=this.searchString.slice(0,-1),t="";else if(!Ss(e))return;e.preventDefault(),this.searchTextFromCharacter(t)}searchTextFromCharacter(e){this.searchString+=e,this.runSearch(),this.clearSearchString()}searchTextFromString(e){null==e&&(e=""),this.searchString=e,this.runSearch()}buildSearchStrings(e){const{valueFormatter:t=(e=>e)}=this.config;let i;return"number"==typeof e[0]||"string"==typeof e[0]?i=e.map(e=>t(e)):"object"==typeof e[0]&&this.searchStringCreator&&(i=this.searchStringCreator(e)),i}getSuggestionsAndFilteredValues(e,t){let i=[],s=[];if(!e.length)return{suggestions:i,filteredValues:s};const{allowTyping:o,searchType:r="fuzzy",filterList:n}=this.config,l=n&&o;if("fuzzy"===r){const e=et(this.searchString,t,!0);i=e.values;const o=e.indices;if(l&&o.length)for(let e=0;e<o.length;e++)s.push(this.values[o[e]])}else i=t.filter((e,t)=>{const i=e.toLocaleLowerCase(),o=this.searchString.toLocaleLowerCase(),n="match"===r?i.startsWith(o):-1!==i.indexOf(o);return l&&n&&s.push(this.values[t]),n});return{suggestions:i,filteredValues:s}}filterListModel(e){const{allowTyping:t,filterList:i}=this.config;t&&i&&this.setValueList({valueList:e,refresh:!0})}runSearch(){var e,t,i;const{values:s}=this,o=this.buildSearchStrings(s);if(!o)return void this.highlightSelectedValue(-1);const{suggestions:r,filteredValues:n}=this.getSuggestionsAndFilteredValues(this.searchString,o),{allowTyping:l,filterList:a,highlightMatch:d,searchType:h="fuzzy"}=this.config,c=n.length,u=!(!l||!a||""===this.searchString);if(u&&this.filterListModel(u?n:s),r.length){const e=u?0:o.indexOf(r[0]);this.selectListItem(e),d&&"fuzzy"!==h&&this.highlightFilterMatch()}else if(this.highlightSelectedValue(-1),!u||c)null===(e=this.listComponent)||void 0===e||e.ensureIndexVisible(0);else if(u){this.getAriaElement().removeAttribute("data-active-option");const e=null===(t=this.listComponent)||void 0===t?void 0:t.getAriaElement();e&&Mt(e,null)}const p=null===(i=this.listComponent)||void 0===i?void 0:i.getGui();null==p||p.classList.toggle("ag-hidden",u&&!c)}clearSearchString(){this.searchString=""}selectListItem(e,t,i){if(!this.isPickerDisplayed||!this.listComponent||e<0||e>=this.currentList.length)return;this.listComponent.ensureIndexVisible(e,!t)&&!i&&this.listComponent.refresh(!0),this.highlightSelectedValue(e)}setValue(e,t,i){const s=this.currentList.indexOf(e);return-1===s?this:(this.value=e,i||this.selectListItem(s),this.renderSelectedValue(),super.setValue(e,t))}createRowComponent(e){const t=new Pd(this.config,this.eWrapper);t.setParentComponent(this.listComponent),this.getContext().createBean(t),t.setState(e);const{highlightMatch:i,searchType:s="fuzzy"}=this.config;return i&&"fuzzy"!==s&&t.highlightString(this.searchString),t}getRowForMouseEvent(e){const{listComponent:t}=this;if(!t)return-1;const i=(null==t?void 0:t.getGui()).getBoundingClientRect(),s=t.getScrollTop(),o=e.clientY-i.top+s;return Math.floor(o/t.getRowHeight())}onPickerMouseMove(e){if(!this.listComponent)return;const t=this.getRowForMouseEvent(e);-1!==t&&t!=this.lastRowHovered&&(this.lastRowHovered=t,this.selectListItem(t,!0,!0))}onNavigationKeyDown(e,t){e.preventDefault();const i=t===ys.DOWN;if(!this.isPickerDisplayed&&i)return void this.showPicker();const s=this.highlightedItem,o=-1===s?0:s+(i?1:-1);this.selectListItem(o,!1,!0)}onEnterKeyDown(e){this.isPickerDisplayed&&(e.preventDefault(),this.onListValueSelected(this.currentList[this.highlightedItem],!0))}onTabKeyDown(){this.isPickerDisplayed&&this.setValue(this.currentList[this.highlightedItem],!1,!0)}onListValueSelected(e,t){this.setValue(e,!1,!0),this.dispatchPickerEvent(e,t),this.hidePicker()}dispatchPickerEvent(e,t){const i={type:_e.EVENT_FIELD_PICKER_VALUE_SELECTED,fromEnterKey:t,value:e};this.dispatchEvent(i)}getFocusableElement(){const{allowTyping:e}=this.config;return e?this.eInput.getFocusableElement():super.getFocusableElement()}onKeyDown(e){const t=e.key,{allowTyping:i}=this.config;switch(t){case ys.LEFT:case ys.RIGHT:case ys.PAGE_HOME:case ys.PAGE_END:i||e.preventDefault();break;case ys.PAGE_UP:case ys.PAGE_DOWN:e.preventDefault();break;case ys.DOWN:case ys.UP:this.onNavigationKeyDown(e,t);break;case ys.ESCAPE:this.isPickerDisplayed&&(e.preventDefault(),Se(e),this.hidePicker());break;case ys.ENTER:this.onEnterKeyDown(e);break;case ys.TAB:this.onTabKeyDown();break;default:i||this.buildSearchStringFromKeyboardEvent(e)}}destroy(){this.listComponent&&(this.destroyBean(this.listComponent),this.listComponent=void 0),this.eLoading=void 0,super.destroy()}}Id([j("userComponentFactory")],Nd.prototype,"userComponentFactory",void 0),Id([Ks("eInput")],Nd.prototype,"eInput",void 0);var Md=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Gd extends no{constructor(e){super(e,Gd.TEMPLATE),this.labelAlignment="top"}init(){this.eSlider.addCssClass("ag-slider-field")}onValueChange(e){const t=_e.EVENT_FIELD_VALUE_CHANGED;return this.addManagedListener(this.eText,t,()=>{const t=parseFloat(this.eText.getValue());this.eSlider.setValue(t.toString(),!0),e(t||0)}),this.addManagedListener(this.eSlider,t,()=>{const t=this.eSlider.getValue();this.eText.setValue(t,!0),e(parseFloat(t))}),this}setSliderWidth(e){return this.eSlider.setWidth(e),this}setTextFieldWidth(e){return this.eText.setWidth(e),this}setMinValue(e){return this.eSlider.setMinValue(e),this.eText.setMin(e),this}setMaxValue(e){return this.eSlider.setMaxValue(e),this.eText.setMax(e),this}getValue(){return this.eText.getValue()}setValue(e){return this.getValue()===e||(this.eText.setValue(e,!0),this.eSlider.setValue(e,!0),this.dispatchEvent({type:_e.EVENT_FIELD_VALUE_CHANGED})),this}setStep(e){return this.eSlider.setStep(e),this.eText.setStep(e),this}}Gd.TEMPLATE='<div class="ag-slider">\n            <label ref="eLabel"></label>\n            <div class="ag-wrapper ag-slider-wrapper">\n                <ag-input-range ref="eSlider"></ag-input-range>\n                <ag-input-number-field ref="eText"></ag-input-number-field>\n            </div>\n        </div>',Md([Ks("eLabel")],Gd.prototype,"eLabel",void 0),Md([Ks("eSlider")],Gd.prototype,"eSlider",void 0),Md([Ks("eText")],Gd.prototype,"eText",void 0),Md([B],Gd.prototype,"init",null);var xd=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class _d extends js{constructor(e={}){super(_d.getTemplate(e)),this.suppressEnabledCheckbox=!0,this.suppressOpenCloseIcons=!1;const{title:t,enabled:i,items:s,suppressEnabledCheckbox:o,suppressOpenCloseIcons:r}=e;this.title=t,this.cssIdentifier=e.cssIdentifier||"default",this.enabled=null==i||i,this.items=s||[],this.alignItems=e.alignItems||"center",null!=o&&(this.suppressEnabledCheckbox=o),null!=r&&(this.suppressOpenCloseIcons=r)}static getTemplate(e){const t=e.cssIdentifier||"default";return`<div class="ag-group ag-${t}-group" role="presentation">\n            <div class="ag-group-title-bar ag-${t}-group-title-bar ag-unselectable" ref="eTitleBar" role="button">\n                <span class="ag-group-title-bar-icon ag-${t}-group-title-bar-icon" ref="eGroupOpenedIcon" role="presentation"></span>\n                <span class="ag-group-title-bar-icon ag-${t}-group-title-bar-icon" ref="eGroupClosedIcon" role="presentation"></span>\n                <span ref="eTitle" class="ag-group-title ag-${t}-group-title"></span>\n            </div>\n            <div ref="eToolbar" class="ag-group-toolbar ag-${t}-group-toolbar">\n                <ag-checkbox ref="cbGroupEnabled"></ag-checkbox>\n            </div>\n            <div ref="eContainer" class="ag-group-container ag-group-container-${e.direction||"vertical"} ag-${t}-group-container"></div>\n        </div>`}postConstruct(){if(this.items.length){const e=this.items;this.items=[],this.addItems(e)}const e=this.localeService.getLocaleTextFunc();this.cbGroupEnabled.setLabel(e("enabled","Enabled")),this.title&&this.setTitle(this.title),this.enabled&&this.setEnabled(this.enabled),this.setAlignItems(this.alignItems),this.hideEnabledCheckbox(this.suppressEnabledCheckbox),this.hideOpenCloseIcons(this.suppressOpenCloseIcons),this.setupExpandContract(),this.refreshAriaStatus(),this.refreshChildDisplay()}setupExpandContract(){this.eGroupClosedIcon.appendChild(vs("columnSelectClosed",this.gridOptionsService,null)),this.eGroupOpenedIcon.appendChild(vs("columnSelectOpen",this.gridOptionsService,null)),this.addManagedListener(this.eTitleBar,"click",()=>this.toggleGroupExpand()),this.addManagedListener(this.eTitleBar,"keydown",e=>{switch(e.key){case ys.ENTER:case ys.SPACE:e.preventDefault(),this.toggleGroupExpand();break;case ys.RIGHT:case ys.LEFT:e.preventDefault(),this.toggleGroupExpand(e.key===ys.RIGHT)}})}refreshAriaStatus(){this.suppressOpenCloseIcons||Gt(this.eTitleBar,this.expanded)}refreshChildDisplay(){const e=!this.suppressOpenCloseIcons;Mi(this.eToolbar,this.expanded&&!this.suppressEnabledCheckbox),Mi(this.eGroupOpenedIcon,e&&this.expanded),Mi(this.eGroupClosedIcon,e&&!this.expanded)}isExpanded(){return this.expanded}setAlignItems(e){this.alignItems!==e&&this.removeCssClass("ag-group-item-alignment-"+this.alignItems),this.alignItems=e;const t="ag-group-item-alignment-"+this.alignItems;return this.addCssClass(t),this}toggleGroupExpand(e){return this.suppressOpenCloseIcons?(this.expanded=!0,this.refreshChildDisplay(),Mi(this.eContainer,!0),this):(e=null!=e?e:!this.expanded,this.expanded===e||(this.expanded=e,this.refreshAriaStatus(),this.refreshChildDisplay(),Mi(this.eContainer,e),this.dispatchEvent({type:this.expanded?_d.EVENT_EXPANDED:_d.EVENT_COLLAPSED})),this)}addItems(e){e.forEach(e=>this.addItem(e))}addItem(e){const t=this.eContainer,i=e instanceof js?e.getGui():e;i.classList.add("ag-group-item",`ag-${this.cssIdentifier}-group-item`),t.appendChild(i),this.items.push(i)}hideItem(e,t){Mi(this.items[t],!e)}setTitle(e){return this.eTitle.innerText=e,this}addCssClassToTitleBar(e){this.eTitleBar.classList.add(e)}setEnabled(e,t){return this.enabled=e,this.refreshDisabledStyles(),this.toggleGroupExpand(e),t||this.cbGroupEnabled.setValue(e),this}isEnabled(){return this.enabled}onEnableChange(e){return this.cbGroupEnabled.onValueChange(t=>{this.setEnabled(t,!0),e(t)}),this}hideEnabledCheckbox(e){return this.suppressEnabledCheckbox=e,this.refreshChildDisplay(),this.refreshDisabledStyles(),this}hideOpenCloseIcons(e){return this.suppressOpenCloseIcons=e,e&&this.toggleGroupExpand(!0),this}refreshDisabledStyles(){this.addOrRemoveCssClass("ag-disabled",!this.enabled),this.suppressEnabledCheckbox&&!this.enabled?(this.eTitleBar.classList.add("ag-disabled-group-title-bar"),this.eTitleBar.removeAttribute("tabindex")):(this.eTitleBar.classList.remove("ag-disabled-group-title-bar"),this.eTitleBar.setAttribute("tabindex","0")),this.eContainer.classList.toggle("ag-disabled-group-container",!this.enabled)}}_d.EVENT_EXPANDED="expanded",_d.EVENT_COLLAPSED="collapsed",xd([Ks("eTitleBar")],_d.prototype,"eTitleBar",void 0),xd([Ks("eGroupOpenedIcon")],_d.prototype,"eGroupOpenedIcon",void 0),xd([Ks("eGroupClosedIcon")],_d.prototype,"eGroupClosedIcon",void 0),xd([Ks("eToolbar")],_d.prototype,"eToolbar",void 0),xd([Ks("cbGroupEnabled")],_d.prototype,"cbGroupEnabled",void 0),xd([Ks("eTitle")],_d.prototype,"eTitle",void 0),xd([Ks("eContainer")],_d.prototype,"eContainer",void 0),xd([B],_d.prototype,"postConstruct",null);var Vd=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Hd extends Ad{constructor(e=1){super('<div class="ag-menu-list" role="tree"></div>'),this.level=e,this.menuItems=[]}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}onTabKeyDown(e){const t=this.getParentComponent(),i=t&&t.getGui();i&&i.classList.contains("ag-focus-managed")||e.preventDefault(),e.shiftKey&&this.closeIfIsChild(e)}handleKeyDown(e){switch(e.key){case ys.UP:case ys.RIGHT:case ys.DOWN:case ys.LEFT:e.preventDefault(),this.handleNavKey(e.key);break;case ys.ESCAPE:const t=this.findTopMenu();t&&this.focusService.focusInto(t.getGui())}}clearActiveItem(){this.activeMenuItem&&(this.activeMenuItem.deactivate(),this.activeMenuItem=null)}addMenuItems(e){null!=e&&e.forEach(e=>{"separator"===e?this.addSeparator():"string"==typeof e?console.warn("AG Grid: unrecognised menu item "+e):this.addItem(e)})}addItem(e){const t=this.createManagedBean(new Ud(Object.assign(Object.assign({},e),{isAnotherSubMenuOpen:()=>this.menuItems.some(e=>e.isSubMenuOpen())})));t.setParentComponent(this),Lt(t.getGui(),this.level),this.menuItems.push(t),this.appendChild(t.getGui()),this.addManagedListener(t,Ud.EVENT_MENU_ITEM_SELECTED,e=>{this.dispatchEvent(e)}),this.addManagedListener(t,Ud.EVENT_MENU_ITEM_ACTIVATED,e=>{this.activeMenuItem&&this.activeMenuItem!==e.menuItem&&this.activeMenuItem.deactivate(),this.activeMenuItem=e.menuItem})}activateFirstItem(){const e=this.menuItems.filter(e=>!e.isDisabled())[0];e&&e.activate()}addSeparator(){this.appendChild(Qi('\n            <div class="ag-menu-separator" aria-hidden="true">\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n                <div class="ag-menu-separator-part"></div>\n            </div>'))}findTopMenu(){let e=this.getParentComponent();if(!e&&this instanceof Hd)return this;for(;;){const t=e&&e.getParentComponent&&e.getParentComponent();if(!t||!(t instanceof Hd||t instanceof Ud))break;e=t}return e instanceof Hd?e:void 0}handleNavKey(e){switch(e){case ys.UP:case ys.DOWN:const t=this.findNextItem(e===ys.UP);return void(t&&t!==this.activeMenuItem&&t.activate())}e===(this.gridOptionsService.is("enableRtl")?ys.RIGHT:ys.LEFT)?this.closeIfIsChild():this.openChild()}closeIfIsChild(e){const t=this.getParentComponent();t&&t instanceof Ud&&(e&&e.preventDefault(),t.closeSubMenu(),t.getGui().focus())}openChild(){this.activeMenuItem&&this.activeMenuItem.openSubMenu(!0)}findNextItem(e){const t=this.menuItems.filter(e=>!e.isDisabled());if(!t.length)return;if(!this.activeMenuItem)return e?ne(t):t[0];let i;e&&t.reverse();let s=!1;for(let e=0;e<t.length;e++){const o=t[e];if(s){i=o;break}o===this.activeMenuItem&&(s=!0)}return i||this.activeMenuItem}destroy(){this.clearActiveItem(),super.destroy()}}Vd([j("focusService")],Hd.prototype,"focusService",void 0),Vd([B],Hd.prototype,"postConstruct",null);var kd=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Bd extends Ad{constructor(e){super(),this.wrappedComponent=e,this.setTemplateFromElement(e.getGui())}postConstruct(){this.initialiseTabGuard({onTabKeyDown:e=>this.onTabKeyDown(e),handleKeyDown:e=>this.handleKeyDown(e)})}handleKeyDown(e){e.key===ys.ESCAPE&&this.closePanel()}onTabKeyDown(e){e.defaultPrevented||(this.closePanel(),e.preventDefault())}closePanel(){const e=this.parentComponent;e.closeSubMenu(),setTimeout(()=>e.getGui().focus(),0)}}kd([B],Bd.prototype,"postConstruct",null);var Wd=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Ud extends js{constructor(e){super(),this.params=e,this.isActive=!1,this.subMenuIsOpen=!1,this.setTemplate(`<div class="${this.getClassName()}" tabindex="-1" role="treeitem"></div>`)}init(){this.addIcon(),this.addName(),this.addShortcut(),this.addSubMenu(),this.addTooltip();const e=this.getGui();this.params.disabled?(this.addCssClass(this.getClassName("disabled")),It(e,!0)):(this.addGuiEventListener("click",e=>this.onItemSelected(e)),this.addGuiEventListener("keydown",e=>{e.key!==ys.ENTER&&e.key!==ys.SPACE||(e.preventDefault(),this.onItemSelected(e))}),this.addGuiEventListener("mousedown",e=>{e.stopPropagation(),e.preventDefault()}),this.addGuiEventListener("mouseenter",()=>this.onMouseEnter()),this.addGuiEventListener("mouseleave",()=>this.onMouseLeave())),this.params.cssClasses&&this.params.cssClasses.forEach(e=>this.addCssClass(e))}isDisabled(){return!!this.params.disabled}openSubMenu(e=!1){if(this.closeSubMenu(),!this.params.subMenu)return;const t=Qi('<div class="ag-menu" role="presentation"></div>');let i;if(this.params.subMenu instanceof Array){const s=Tt(this.getGui()),o=isNaN(s)?1:s+1,r=this.createBean(new Hd(o));r.setParentComponent(this),r.addMenuItems(this.params.subMenu),t.appendChild(r.getGui()),this.addManagedListener(r,Ud.EVENT_MENU_ITEM_SELECTED,e=>this.dispatchEvent(e)),r.addGuiEventListener("mouseenter",()=>this.cancelDeactivate()),i=()=>this.destroyBean(r),e&&setTimeout(()=>r.activateFirstItem(),0)}else{const{subMenu:e}=this.params,s=this.createBean(new Bd(e));s.setParentComponent(this);const o=s.getGui(),r="mouseenter",n=()=>this.cancelDeactivate();o.addEventListener(r,n),i=()=>o.removeEventListener(r,n),t.appendChild(o),e.afterGuiAttached&&setTimeout(()=>e.afterGuiAttached(),0)}const s=this.getGui(),o=this.popupService.positionPopupForMenu.bind(this.popupService,{eventSource:s,ePopup:t}),r=this.localeService.getLocaleTextFunc(),n=this.popupService.addPopup({modal:!0,eChild:t,positionCallback:o,anchorToElement:s,ariaLabel:r("ariaLabelSubMenu","SubMenu")});this.subMenuIsOpen=!0,Gt(s,!0),this.hideSubMenu=()=>{n&&n.hideFunc(),this.subMenuIsOpen=!1,Gt(s,!1),i()}}closeSubMenu(){this.hideSubMenu&&(this.hideSubMenu(),this.hideSubMenu=null,Gt(this.getGui(),!1))}isSubMenuOpen(){return this.subMenuIsOpen}activate(e){this.cancelActivate(),this.params.disabled||(this.isActive=!0,this.addCssClass(this.getClassName("active")),this.getGui().focus(),e&&this.params.subMenu&&window.setTimeout(()=>{this.isAlive()&&this.isActive&&this.openSubMenu()},300),this.onItemActivated())}deactivate(){this.cancelDeactivate(),this.removeCssClass(this.getClassName("active")),this.isActive=!1,this.subMenuIsOpen&&this.hideSubMenu()}addIcon(){if(!this.params.checked&&!this.params.icon&&this.params.isCompact)return;const e=Qi(`<span ref="eIcon" class="${this.getClassName("part")} ${this.getClassName("icon")}" role="presentation"></span>`);this.params.checked?e.appendChild(fs("check",this.gridOptionsService)):this.params.icon&&(ds(this.params.icon)?e.appendChild(this.params.icon):"string"==typeof this.params.icon?e.innerHTML=this.params.icon:console.warn("AG Grid: menu item icon must be DOM node or string")),this.getGui().appendChild(e)}addName(){if(!this.params.name&&this.params.isCompact)return;const e=Qi(`<span ref="eName" class="${this.getClassName("part")} ${this.getClassName("text")}">${this.params.name||""}</span>`);this.getGui().appendChild(e)}addTooltip(){this.params.tooltip&&(this.tooltip=this.params.tooltip,this.gridOptionsService.is("enableBrowserTooltips")?this.getGui().setAttribute("title",this.tooltip):this.createManagedBean(new ks(this)))}getTooltipParams(){return{location:"menu",value:this.tooltip}}addShortcut(){if(!this.params.shortcut&&this.params.isCompact)return;const e=Qi(`<span ref="eShortcut" class="${this.getClassName("part")} ${this.getClassName("shortcut")}">${this.params.shortcut||""}</span>`);this.getGui().appendChild(e)}addSubMenu(){if(!this.params.subMenu&&this.params.isCompact)return;const e=Qi(`<span ref="ePopupPointer" class="${this.getClassName("part")} ${this.getClassName("popup-pointer")}"></span>`),t=this.getGui();if(this.params.subMenu){const i=this.gridOptionsService.is("enableRtl")?"smallLeft":"smallRight";Gt(t,!1),e.appendChild(fs(i,this.gridOptionsService))}t.appendChild(e)}onItemSelected(e){if(this.params.action?this.params.action():this.openSubMenu(e&&"keydown"===e.type),this.params.subMenu&&!this.params.action)return;const t={type:Ud.EVENT_MENU_ITEM_SELECTED,action:this.params.action,checked:this.params.checked,cssClasses:this.params.cssClasses,disabled:this.params.disabled,icon:this.params.icon,name:this.params.name,shortcut:this.params.shortcut,subMenu:this.params.subMenu,tooltip:this.params.tooltip,event:e};this.dispatchEvent(t)}onItemActivated(){const e={type:Ud.EVENT_MENU_ITEM_ACTIVATED,menuItem:this};this.dispatchEvent(e)}cancelActivate(){this.activateTimeoutId&&(window.clearTimeout(this.activateTimeoutId),this.activateTimeoutId=0)}cancelDeactivate(){this.deactivateTimeoutId&&(window.clearTimeout(this.deactivateTimeoutId),this.deactivateTimeoutId=0)}onMouseEnter(){this.cancelDeactivate(),this.params.isAnotherSubMenuOpen()?this.activateTimeoutId=window.setTimeout(()=>this.activate(!0),Ud.ACTIVATION_DELAY):this.activate(!0)}onMouseLeave(){this.cancelActivate(),this.isSubMenuOpen()?this.deactivateTimeoutId=window.setTimeout(()=>this.deactivate(),Ud.ACTIVATION_DELAY):this.deactivate()}getClassName(e){const t=this.params.isCompact?"ag-compact-menu-option":"ag-menu-option";return e?`${t}-${e}`:t}}Ud.EVENT_MENU_ITEM_SELECTED="menuItemSelected",Ud.EVENT_MENU_ITEM_ACTIVATED="menuItemActivated",Ud.ACTIVATION_DELAY=80,Wd([j("popupService")],Ud.prototype,"popupService",void 0),Wd([B],Ud.prototype,"init",null);var jd=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class zd extends js{constructor(e){super(zd.getTemplate(e)),this.closable=!0,this.config=e}static getTemplate(e){const t=e&&e.cssIdentifier||"default";return`<div class="ag-panel ag-${t}-panel" tabindex="-1">\n            <div ref="eTitleBar" class="ag-panel-title-bar ag-${t}-panel-title-bar ag-unselectable">\n                <span ref="eTitle" class="ag-panel-title-bar-title ag-${t}-panel-title-bar-title"></span>\n                <div ref="eTitleBarButtons" class="ag-panel-title-bar-buttons ag-${t}-panel-title-bar-buttons"></div>\n            </div>\n            <div ref="eContentWrapper" class="ag-panel-content-wrapper ag-${t}-panel-content-wrapper"></div>\n        </div>`}postConstruct(){const{component:e,closable:t,hideTitleBar:i,title:s,minWidth:o=250,width:r,minHeight:n=250,height:l,centered:a,popup:d,x:h,y:c}=this.config;this.positionableFeature=new io(this.getGui(),{minWidth:o,width:r,minHeight:n,height:l,centered:a,x:h,y:c,popup:d,calculateTopBuffer:()=>this.positionableFeature.getHeight()-this.getBodyHeight()}),this.createManagedBean(this.positionableFeature);const u=this.getGui();e&&this.setBodyComponent(e),i?Mi(this.eTitleBar,!1):(s&&this.setTitle(s),this.setClosable(null!=t?t:this.closable)),this.addManagedListener(this.eTitleBar,"mousedown",e=>{const t=this.gridOptionsService.getDocument();if(u.contains(e.relatedTarget)||u.contains(t.activeElement)||this.eTitleBarButtons.contains(e.target))return void e.preventDefault();const i=this.eContentWrapper.querySelector("button, [href], input, select, textarea, [tabindex]");i&&i.focus()}),d&&this.positionableFeature.isPositioned()||(this.renderComponent&&this.renderComponent(),this.positionableFeature.initialisePosition(),this.eContentWrapper.style.height="0")}renderComponent(){const e=this.getGui();e.focus(),this.close=()=>{e.parentElement.removeChild(e),this.destroy()}}getHeight(){return this.positionableFeature.getHeight()}setHeight(e){this.positionableFeature.setHeight(e)}getWidth(){return this.positionableFeature.getWidth()}setWidth(e){this.positionableFeature.setWidth(e)}setClosable(e){if(e!==this.closable&&(this.closable=e),e){const e=this.closeButtonComp=new js(zd.CLOSE_BTN_TEMPLATE);this.getContext().createBean(e);const t=e.getGui(),i=fs("close",this.gridOptionsService);i.classList.add("ag-panel-title-bar-button-icon"),t.appendChild(i),this.addTitleBarButton(e),e.addManagedListener(t,"click",this.onBtClose.bind(this))}else if(this.closeButtonComp){const e=this.closeButtonComp.getGui();e.parentElement.removeChild(e),this.closeButtonComp=this.destroyBean(this.closeButtonComp)}}setBodyComponent(e){e.setParentComponent(this),this.eContentWrapper.appendChild(e.getGui())}addTitleBarButton(e,t){const i=this.eTitleBarButtons,s=i.children,o=s.length;null==t&&(t=o),t=Math.max(0,Math.min(t,o)),e.addCssClass("ag-panel-title-bar-button");const r=e.getGui();0===t?i.insertAdjacentElement("afterbegin",r):t===o?i.insertAdjacentElement("beforeend",r):s[t-1].insertAdjacentElement("afterend",r),e.setParentComponent(this)}getBodyHeight(){return Hi(this.eContentWrapper)}getBodyWidth(){return ki(this.eContentWrapper)}setTitle(e){this.eTitle.innerText=e}onBtClose(){this.close()}destroy(){this.closeButtonComp&&(this.closeButtonComp=this.destroyBean(this.closeButtonComp));const e=this.getGui();e&&e.offsetParent&&this.close(),super.destroy()}}zd.CLOSE_BTN_TEMPLATE='<div class="ag-button"></div>',jd([Ks("eContentWrapper")],zd.prototype,"eContentWrapper",void 0),jd([Ks("eTitleBar")],zd.prototype,"eTitleBar",void 0),jd([Ks("eTitleBarButtons")],zd.prototype,"eTitleBarButtons",void 0),jd([Ks("eTitle")],zd.prototype,"eTitle",void 0),jd([B],zd.prototype,"postConstruct",null);var Kd=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Yd extends zd{constructor(e){super(Object.assign(Object.assign({},e),{popup:!0})),this.isMaximizable=!1,this.isMaximized=!1,this.maximizeListeners=[],this.resizeListenerDestroy=null,this.lastPosition={x:0,y:0,width:0,height:0}}postConstruct(){const e=this.getGui(),{movable:t,resizable:i,maximizable:s}=this.config;this.addCssClass("ag-dialog"),super.postConstruct(),this.addManagedListener(e,"focusin",t=>{e.contains(t.relatedTarget)||this.popupService.bringPopupToFront(e)}),t&&this.setMovable(t),s&&this.setMaximizable(s),i&&this.setResizable(i)}renderComponent(){const e=this.getGui(),{alwaysOnTop:t,modal:i,title:s,afterGuiAttached:o}=this.config,r=this.localeService.getLocaleTextFunc(),n=this.popupService.addPopup({modal:i,eChild:e,closeOnEsc:!0,closedCallback:this.destroy.bind(this),alwaysOnTop:t,ariaLabel:s||r("ariaLabelDialog","Dialog"),afterGuiAttached:o});n&&(this.close=n.hideFunc)}toggleMaximize(){const e=this.positionableFeature.getPosition();if(this.isMaximized){const{x:e,y:t,width:i,height:s}=this.lastPosition;this.setWidth(i),this.setHeight(s),this.positionableFeature.offsetElement(e,t)}else this.lastPosition.width=this.getWidth(),this.lastPosition.height=this.getHeight(),this.lastPosition.x=e.x,this.lastPosition.y=e.y,this.positionableFeature.offsetElement(0,0),this.setHeight("100%"),this.setWidth("100%");this.isMaximized=!this.isMaximized,this.refreshMaximizeIcon()}refreshMaximizeIcon(){Mi(this.maximizeIcon,!this.isMaximized),Mi(this.minimizeIcon,this.isMaximized)}clearMaximizebleListeners(){this.maximizeListeners.length&&(this.maximizeListeners.forEach(e=>e()),this.maximizeListeners.length=0),this.resizeListenerDestroy&&(this.resizeListenerDestroy(),this.resizeListenerDestroy=null)}destroy(){this.maximizeButtonComp=this.destroyBean(this.maximizeButtonComp),this.clearMaximizebleListeners(),super.destroy()}setResizable(e){this.positionableFeature.setResizable(e)}setMovable(e){this.positionableFeature.setMovable(e,this.eTitleBar)}setMaximizable(e){if(!e)return this.clearMaximizebleListeners(),void(this.maximizeButtonComp&&(this.destroyBean(this.maximizeButtonComp),this.maximizeButtonComp=this.maximizeIcon=this.minimizeIcon=void 0));const t=this.eTitleBar;if(!t||e===this.isMaximizable)return;const i=this.buildMaximizeAndMinimizeElements();this.refreshMaximizeIcon(),i.addManagedListener(i.getGui(),"click",this.toggleMaximize.bind(this)),this.addTitleBarButton(i,0),this.maximizeListeners.push(this.addManagedListener(t,"dblclick",this.toggleMaximize.bind(this))),this.resizeListenerDestroy=this.addManagedListener(this,"resize",()=>{this.isMaximized=!1,this.refreshMaximizeIcon()})}buildMaximizeAndMinimizeElements(){const e=this.maximizeButtonComp=this.createBean(new js('<div class="ag-dialog-button"></span>')),t=e.getGui();return this.maximizeIcon=fs("maximize",this.gridOptionsService),t.appendChild(this.maximizeIcon),this.maximizeIcon.classList.add("ag-panel-title-bar-button-icon"),this.minimizeIcon=fs("minimize",this.gridOptionsService),t.appendChild(this.minimizeIcon),this.minimizeIcon.classList.add("ag-panel-title-bar-button-icon"),e}}Kd([j("popupService")],Yd.prototype,"popupService",void 0);var $d,qd,Qd=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};!function(e){e[e.vertical=0]="vertical",e[e.horizontal=1]="horizontal"}(qd||(qd={}));let Xd=0,Jd=$d=class extends Le{constructor(){super(...arguments),this.popupList=[]}postConstruct(){this.ctrlsService.whenReady(e=>{this.gridCtrl=e.gridCtrl,this.addManagedListener(this.gridCtrl,_e.EVENT_KEYBOARD_FOCUS,()=>{this.popupList.forEach(e=>e.element.classList.add(Sa.AG_KEYBOARD_FOCUS))}),this.addManagedListener(this.gridCtrl,_e.EVENT_MOUSE_FOCUS,()=>{this.popupList.forEach(e=>e.element.classList.remove(Sa.AG_KEYBOARD_FOCUS))})})}getPopupParent(){const e=this.gridOptionsService.get("popupParent");return e||this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:i}=e,s=this.getPopupIndex(i);if(-1!==s){this.popupList[s].alignedToElement=t}const o=t.getBoundingClientRect(),r=this.getParentRect(),n=this.keepXYWithinBounds(i,o.top-r.top,qd.vertical),l=i.clientWidth>0?i.clientWidth:200;i.style.minWidth=l+"px";const a=r.right-r.left-l;let d;function h(){return o.right-r.left-2}function c(){return o.left-r.left-l}this.gridOptionsService.is("enableRtl")?(d=c(),d<0&&(d=h(),this.setAlignedStyles(i,"left")),d>a&&(d=0,this.setAlignedStyles(i,"right"))):(d=h(),d>a&&(d=c(),this.setAlignedStyles(i,"right")),d<0&&(d=0,this.setAlignedStyles(i,"left"))),i.style.left=d+"px",i.style.top=n+"px"}positionPopupUnderMouseEvent(e){const{ePopup:t,nudgeX:i,nudgeY:s,skipObserver:o}=e;this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:!0,skipObserver:o,updatePosition:()=>this.calculatePointerAlign(e.mouseEvent),postProcessCallback:()=>this.callPostProcessPopup(e.type,e.ePopup,null,e.mouseEvent,e.column,e.rowNode)})}calculatePointerAlign(e){const t=this.getParentRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}positionPopupByComponent(e){const{ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,eventSource:r,alignSide:n="left",position:l="over",column:a,rowNode:d,type:h}=e,c=r.getBoundingClientRect(),u=this.getParentRect(),p=this.getPopupIndex(t);if(-1!==p){this.popupList[p].alignedToElement=r}this.positionPopup({ePopup:t,nudgeX:i,nudgeY:s,keepWithinBounds:o,updatePosition:()=>{let i,o=c.left-u.left;if("right"===n&&(o-=t.offsetWidth-c.width),"over"===l)i=c.top-u.top,this.setAlignedStyles(t,"over");else{this.setAlignedStyles(t,"under");i="under"===this.shouldRenderUnderOrAbove(t,c,u,e.nudgeY||0)?c.top-u.top+c.height:c.top-t.offsetHeight-2*(s||0)-u.top}return{x:o,y:i}},postProcessCallback:()=>this.callPostProcessPopup(h,t,r,null,a,d)})}shouldRenderUnderOrAbove(e,t,i,s){const o=i.bottom-t.bottom,r=t.top-i.top,n=e.offsetHeight+s;return o>n?"under":r>n||r>o?"above":"under"}setAlignedStyles(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const s=this.popupList[i],{alignedToElement:o}=s;if(!o)return;["right","left","over","above","under"].forEach(t=>{o.classList.remove("ag-has-popup-positioned-"+t),e.classList.remove("ag-popup-positioned-"+t)}),t&&(o.classList.add("ag-has-popup-positioned-"+t),e.classList.add("ag-popup-positioned-"+t))}callPostProcessPopup(e,t,i,s,o,r){const n=this.gridOptionsService.getCallback("postProcessPopup");if(n){n({column:o,rowNode:r,ePopup:t,type:e,eventSource:i,mouseEvent:s})}}positionPopup(e){const{ePopup:t,keepWithinBounds:i,nudgeX:s,nudgeY:o,skipObserver:r,updatePosition:n}=e,l={width:0,height:0},a=(r=!1)=>{let{x:a,y:d}=n();r&&t.clientWidth===l.width&&t.clientHeight===l.height||(l.width=t.clientWidth,l.height=t.clientHeight,s&&(a+=s),o&&(d+=o),i&&(a=this.keepXYWithinBounds(t,a,qd.horizontal),d=this.keepXYWithinBounds(t,d,qd.vertical)),t.style.left=a+"px",t.style.top=d+"px",e.postProcessCallback&&e.postProcessCallback())};if(a(),!r){const e=this.resizeObserverService.observeResize(t,()=>a(!0));setTimeout(()=>e(),$d.WAIT_FOR_POPUP_CONTENT_RESIZE)}}getActivePopups(){return this.popupList.map(e=>e.element)}getPopupList(){return this.popupList}getParentRect(){const e=this.gridOptionsService.getDocument();let t=this.getPopupParent();return t===e.body?t=e.documentElement:"static"===getComputedStyle(t).position&&(t=t.offsetParent),Ui(t)}keepXYWithinBounds(e,t,i){const s=i===qd.vertical,o=s?"clientHeight":"clientWidth",r=s?"top":"left",n=s?"offsetHeight":"offsetWidth",l=s?"scrollTop":"scrollLeft",a=this.gridOptionsService.getDocument(),d=a.documentElement,h=this.getPopupParent(),c=h.getBoundingClientRect(),u=a.documentElement.getBoundingClientRect(),p=h===a.body,g=e[n];let m=p?(s?Bi:Wi)(d)+d[l]:h[o];p&&(m-=Math.abs(u[r]-c[r]));const C=m-g;return Math.min(Math.max(t,0),Math.abs(C))}addPopup(e){const t=this.gridOptionsService.getDocument(),{eChild:i,ariaLabel:s,alwaysOnTop:o,positionCallback:r,anchorToElement:n}=e;if(!t)return console.warn("AG Grid: could not find the document, document is empty"),{hideFunc:()=>{}};const l=this.getPopupIndex(i);if(-1!==l){return{hideFunc:this.popupList[l].hideFunc}}this.initialisePopupPosition(i);const a=this.createPopupWrapper(i,s,!!o),d=this.addEventListenersToPopup(Object.assign(Object.assign({},e),{wrapperEl:a}));return r&&r(),this.addPopupToPopupList(i,a,d,n),{hideFunc:d}}initialisePopupPosition(e){const i=this.getPopupParent().getBoundingClientRect();t(e.style.top)||(e.style.top=-1*i.top+"px"),t(e.style.left)||(e.style.left=-1*i.left+"px")}createPopupWrapper(e,t,i){const s=this.getPopupParent(),o=document.createElement("div"),{allThemes:r}=this.environment.getTheme();return r.length&&o.classList.add(...r),o.classList.add("ag-popup"),e.classList.add(this.gridOptionsService.is("enableRtl")?"ag-rtl":"ag-ltr","ag-popup-child"),e.hasAttribute("role")||Et(e,"dialog"),Dt(e,t),this.focusService.isKeyboardMode()&&e.classList.add(Sa.AG_KEYBOARD_FOCUS),o.appendChild(e),s.appendChild(o),i?this.setAlwaysOnTop(e,!0):this.bringPopupToFront(e),o}addEventListenersToPopup(e){const t=this.gridOptionsService.getDocument(),i=this.getPopupParent(),{wrapperEl:s,eChild:o,click:r,closedCallback:n,afterGuiAttached:l,closeOnEsc:a,modal:d}=e;let h=!1;const c=e=>{if(!s.contains(t.activeElement))return;e.key!==ys.ESCAPE||Ee(e)||g({keyboardEvent:e})},u=e=>g({mouseEvent:e}),p=e=>g({touchEvent:e}),g=(e={})=>{const{mouseEvent:r,touchEvent:l,keyboardEvent:a}=e;this.isEventFromCurrentPopup({mouseEvent:r,touchEvent:l},o)||h||(h=!0,i.removeChild(s),t.removeEventListener("keydown",c),t.removeEventListener("mousedown",u),t.removeEventListener("touchstart",p),t.removeEventListener("contextmenu",u),this.eventService.removeEventListener(_e.EVENT_DRAG_STARTED,u),n&&n(r||l||a),this.removePopupFromPopupList(o))};return l&&l({hidePopup:g}),window.setTimeout(()=>{a&&t.addEventListener("keydown",c),d&&(t.addEventListener("mousedown",u),this.eventService.addEventListener(_e.EVENT_DRAG_STARTED,u),t.addEventListener("touchstart",p),t.addEventListener("contextmenu",u))},0),g}addPopupToPopupList(e,t,i,s){this.popupList.push({element:e,wrapper:t,hideFunc:i,instanceId:Xd++,isAnchored:!!s}),s&&this.setPopupPositionRelatedToElement(e,s)}getPopupIndex(e){return this.popupList.findIndex(t=>t.element===e)}setPopupPositionRelatedToElement(e,t){const i=this.getPopupIndex(e);if(-1===i)return;const s=this.popupList[i];if(s.stopAnchoringPromise&&s.stopAnchoringPromise.then(e=>e&&e()),s.stopAnchoringPromise=void 0,s.isAnchored=!1,!t)return;const o=this.keepPopupPositionedRelativeTo({element:t,ePopup:e,hidePopup:s.hideFunc});return s.stopAnchoringPromise=o,s.isAnchored=!0,o}removePopupFromPopupList(e){this.setAlignedStyles(e,null),this.setPopupPositionRelatedToElement(e,null),this.popupList=this.popupList.filter(t=>t.element!==e)}keepPopupPositionedRelativeTo(e){const t=this.getPopupParent(),i=t.getBoundingClientRect(),{element:s,ePopup:o}=e,r=s.getBoundingClientRect(),n=i.top-r.top,l=i.left-r.left;let a=n,d=l;const h=o.style.top,c=parseInt(h.substring(0,h.length-1),10),u=o.style.left,p=parseInt(u.substring(0,u.length-1),10);return new Gs(i=>{this.getFrameworkOverrides().setInterval(()=>{const i=t.getBoundingClientRect(),r=s.getBoundingClientRect();if(0==r.top&&0==r.left&&0==r.height&&0==r.width)return void e.hidePopup();const h=i.top-r.top;if(h!=a){const e=this.keepXYWithinBounds(o,c+n-h,qd.vertical);o.style.top=e+"px"}a=h;const u=i.left-r.left;if(u!=d){const e=this.keepXYWithinBounds(o,p+l-u,qd.horizontal);o.style.left=e+"px"}d=u},200).then(e=>{i(()=>{null!=e&&window.clearInterval(e)})})})}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isEventFromCurrentPopup(e,t){const{mouseEvent:i,touchEvent:s}=e,o=i||s;if(!o)return!1;const r=this.getPopupIndex(t);if(-1===r)return!1;for(let e=r;e<this.popupList.length;e++){if(be(this.popupList[e].element,o))return!0}return this.isElementWithinCustomPopup(o.target)}isElementWithinCustomPopup(e){const t=this.gridOptionsService.getDocument();for(;e&&e!==t.body;){if(e.classList.contains("ag-custom-component-popup")||null===e.parentElement)return!0;e=e.parentElement}return!1}getWrapper(e){for(;!e.classList.contains("ag-popup")&&e.parentElement;)e=e.parentElement;return e.classList.contains("ag-popup")?e:null}setAlwaysOnTop(e,t){const i=this.getWrapper(e);i&&(i.classList.toggle("ag-always-on-top",!!t),t&&this.bringPopupToFront(i))}bringPopupToFront(e){const t=this.getPopupParent(),i=Array.prototype.slice.call(t.querySelectorAll(".ag-popup")),s=i.length,o=Array.prototype.slice.call(t.querySelectorAll(".ag-popup.ag-always-on-top")),r=o.length,n=this.getWrapper(e);if(!n||s<=1||!t.contains(e))return;const l=i.indexOf(n),a=n.querySelectorAll("div"),d=[];if(a.forEach(e=>{0!==e.scrollTop&&d.push([e,e.scrollTop])}),r){n.classList.contains("ag-always-on-top")?l!==s-1&&ne(o).insertAdjacentElement("afterend",n):l!==s-r-1&&o[0].insertAdjacentElement("beforebegin",n)}else l!==s-1&&ne(i).insertAdjacentElement("afterend",n);for(;d.length;){const e=d.pop();e[0].scrollTop=e[1]}const h={type:"popupToFront",api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,eWrapper:n};this.eventService.dispatchEvent(h)}};Jd.WAIT_FOR_POPUP_CONTENT_RESIZE=200,Qd([j("focusService")],Jd.prototype,"focusService",void 0),Qd([j("ctrlsService")],Jd.prototype,"ctrlsService",void 0),Qd([j("resizeObserverService")],Jd.prototype,"resizeObserverService",void 0),Qd([B],Jd.prototype,"postConstruct",null),Jd=$d=Qd([U("popupService")],Jd);class Zd extends js{constructor(){super('\n        <div class="ag-autocomplete-row" role="presentation">\n            <div class="ag-autocomplete-row-label"></div>\n        </div>'),this.hasHighlighting=!1}setState(e,t){this.value=e,this.render(),this.updateSelected(t)}updateSelected(e){this.addOrRemoveCssClass("ag-autocomplete-row-selected",e)}setSearchString(e){var i;let s=!1;if(t(e)){const t=null===(i=this.value)||void 0===i?void 0:i.toLocaleLowerCase().indexOf(e.toLocaleLowerCase());if(t>=0){s=!0,this.hasHighlighting=!0;const i=t+e.length,o=je(this.value.slice(0,t)),r=je(this.value.slice(t,i)),n=je(this.value.slice(i));this.getGui().lastElementChild.innerHTML=`${o}<b>${r}</b>${n}`}}!s&&this.hasHighlighting&&(this.hasHighlighting=!1,this.render())}render(){var e;this.getGui().lastElementChild.innerHTML=null!==(e=je(this.value))&&void 0!==e?e:"&nbsp;"}}var eh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class th extends qo{constructor(e){super(th.TEMPLATE),this.params=e,this.searchString=""}destroy(){super.destroy()}init(){this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList=this.createManagedBean(new Ld({cssIdentifier:"autocomplete"})),this.virtualList.setComponentCreator(this.createRowComponent.bind(this)),this.eList.appendChild(this.virtualList.getGui()),this.virtualList.setModel({getRowCount:()=>this.autocompleteEntries.length,getRow:e=>this.autocompleteEntries[e]});const e=this.virtualList.getGui();this.addManagedListener(e,"click",()=>this.params.onConfirmed()),this.addManagedListener(e,"mousemove",this.onMouseMove.bind(this)),this.addManagedListener(e,"mousedown",e=>e.preventDefault()),this.setSelectedValue(0)}onNavigationKeyDown(e,t){e.preventDefault();const i=this.autocompleteEntries.indexOf(this.selectedValue),s=t===ys.UP?i-1:i+1;this.checkSetSelectedValue(s)}setSearch(e){this.searchString=e,t(e)?this.runSearch():(this.autocompleteEntries=this.params.autocompleteEntries,this.virtualList.refresh(),this.checkSetSelectedValue(0)),this.updateSearchInList()}runContainsSearch(e,t){let i,s=!1;const o=e.toLocaleLowerCase(),r=t.filter(e=>{const t=e.toLocaleLowerCase().indexOf(o),r=0===t,n=t>=0;return n&&(!i||!s&&r||s===r&&e.length<i.length)&&(i=e,s=r),n});return!i&&r.length&&(i=r[0]),{topMatch:i,allMatches:r}}runSearch(){var e,t;const{autocompleteEntries:i}=this.params,s=i.map(e=>{var t;return null!==(t=e.displayValue)&&void 0!==t?t:e.key});let o,r;if(this.params.useFuzzySearch)o=et(this.searchString,s,!0).values,r=o.length?o[0]:void 0;else{const e=this.runContainsSearch(this.searchString,s);o=e.allMatches,r=e.topMatch}let n=i.filter(({key:e,displayValue:t})=>o.includes(null!=t?t:e));if(!n.length&&this.selectedValue&&(null===(t=null===(e=this.params)||void 0===e?void 0:e.forceLastSelection)||void 0===t?void 0:t.call(e,this.selectedValue,this.searchString))&&(n=[this.selectedValue]),this.autocompleteEntries=n,this.virtualList.refresh(),!r)return;const l=o.indexOf(r);this.checkSetSelectedValue(l)}updateSearchInList(){this.virtualList.forEachRenderedRow(e=>e.setSearchString(this.searchString))}checkSetSelectedValue(e){e>=0&&e<this.autocompleteEntries.length&&this.setSelectedValue(e)}setSelectedValue(e){const t=this.autocompleteEntries[e];this.selectedValue!==t&&(this.selectedValue=t,this.virtualList.ensureIndexVisible(e),this.virtualList.forEachRenderedRow((t,i)=>{t.updateSelected(e===i)}))}createRowComponent(e){var t;const i=new Zd;return this.getContext().createBean(i),i.setState(null!==(t=e.displayValue)&&void 0!==t?t:e.key,e===this.selectedValue),i}onMouseMove(e){const t=this.virtualList.getGui().getBoundingClientRect(),i=this.virtualList.getScrollTop(),s=e.clientY-t.top+i,o=Math.floor(s/this.virtualList.getRowHeight());this.checkSetSelectedValue(o)}afterGuiAttached(){this.virtualList.refresh()}getSelectedValue(){var e;return this.autocompleteEntries.length&&null!==(e=this.selectedValue)&&void 0!==e?e:null}}th.TEMPLATE='<div class="ag-autocomplete-list-popup">\n            <div ref="eList" class="ag-autocomplete-list"></div>\n        <div>',eh([Ks("eList")],th.prototype,"eList",void 0),eh([B],th.prototype,"init",null);var ih=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class sh extends js{constructor(){super('\n            <div class="ag-autocomplete" role="presentation">\n                <ag-input-text-field ref="eAutocompleteInput"></ag-input-text-field>\n            </div>'),this.isListOpen=!1,this.lastPosition=0,this.valid=!0}postConstruct(){this.eAutocompleteInput.onValueChange(e=>this.onValueChanged(e)),this.eAutocompleteInput.getInputElement().setAttribute("autocomplete","off"),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.addGuiEventListener("click",this.updatePositionAndList.bind(this)),this.addDestroyFunc(()=>{this.destroyBean(this.autocompleteList)}),this.addGuiEventListener("focusout",()=>this.onFocusOut())}onValueChanged(t){const i=e(t);this.updateValue(i),this.updateAutocompleteList(i)}updateValue(e){this.updateLastPosition(),this.dispatchEvent({type:sh.EVENT_VALUE_CHANGED,value:e}),this.validate(e)}updateAutocompleteList(e){var t,i,s,o;const r=null!==(i=null===(t=this.listGenerator)||void 0===t?void 0:t.call(this,e,this.lastPosition))&&void 0!==i?i:{enabled:!1};if(r.type&&r.type===(null===(s=this.autocompleteListParams)||void 0===s?void 0:s.type)||this.isListOpen&&this.closeList(),this.autocompleteListParams=r,null===(o=this.autocompleteListParams)||void 0===o?void 0:o.enabled){this.isListOpen||this.openList();const{searchString:e}=this.autocompleteListParams;this.autocompleteList.setSearch(null!=e?e:"")}else this.isListOpen&&this.closeList()}onKeyDown(e){const t=e.key;switch(this.updateLastPosition(),t){case ys.ENTER:this.onEnterKeyDown(e);break;case ys.TAB:this.onTabKeyDown(e);break;case ys.DOWN:case ys.UP:this.onUpDownKeyDown(e,t);break;case ys.LEFT:case ys.RIGHT:case ys.PAGE_HOME:case ys.PAGE_END:setTimeout(()=>{this.updatePositionAndList()});break;case ys.ESCAPE:this.onEscapeKeyDown(e);break;case ys.SPACE:e.ctrlKey&&!this.isListOpen&&(e.preventDefault(),this.forceOpenList())}}confirmSelection(){var e;const t=null===(e=this.autocompleteList)||void 0===e?void 0:e.getSelectedValue();t&&(this.closeList(),this.dispatchEvent({type:sh.EVENT_OPTION_SELECTED,value:this.getValue(),position:this.lastPosition,updateEntry:t,autocompleteType:this.autocompleteListParams.type}))}onTabKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.confirmSelection())}onEnterKeyDown(e){e.preventDefault(),this.isListOpen?this.confirmSelection():this.onCompleted()}onUpDownKeyDown(e,t){var i;e.preventDefault(),this.isListOpen?null===(i=this.autocompleteList)||void 0===i||i.onNavigationKeyDown(e,t):this.forceOpenList()}onEscapeKeyDown(e){this.isListOpen&&(e.preventDefault(),e.stopPropagation(),this.closeList(),this.setCaret(this.lastPosition,!0))}onFocusOut(){this.isListOpen&&this.closeList()}updatePositionAndList(){var e;this.updateLastPosition(),this.updateAutocompleteList(null!==(e=this.eAutocompleteInput.getValue())&&void 0!==e?e:null)}setCaret(e,t){const i=this.gridOptionsService.getDocument();t&&i.activeElement===i.body&&this.eAutocompleteInput.getFocusableElement().focus(),this.eAutocompleteInput.getInputElement().setSelectionRange(e,e)}forceOpenList(){this.onValueChanged(this.eAutocompleteInput.getValue())}updateLastPosition(){var e;this.lastPosition=null!==(e=this.eAutocompleteInput.getInputElement().selectionStart)&&void 0!==e?e:0}validate(e){var t;this.validator&&(this.validationMessage=this.validator(e),this.eAutocompleteInput.getInputElement().setCustomValidity(null!==(t=this.validationMessage)&&void 0!==t?t:""),this.valid=!this.validationMessage,this.dispatchEvent({type:sh.EVENT_VALID_CHANGED,isValid:this.valid,validationMessage:this.validationMessage}))}openList(){this.isListOpen=!0,this.autocompleteList=this.createBean(new th({autocompleteEntries:this.autocompleteListParams.entries,onConfirmed:()=>this.confirmSelection(),forceLastSelection:this.forceLastSelection}));const e=this.autocompleteList.getGui(),t={ePopup:e,type:"autocomplete",eventSource:this.getGui(),position:"under",alignSide:this.gridOptionsService.is("enableRtl")?"right":"left",keepWithinBounds:!0},i=this.popupService.addPopup({eChild:e,anchorToElement:this.getGui(),positionCallback:()=>this.popupService.positionPopupByComponent(t),ariaLabel:this.listAriaLabel});this.hidePopup=i.hideFunc,this.autocompleteList.afterGuiAttached()}closeList(){this.isListOpen=!1,this.hidePopup(),this.destroyBean(this.autocompleteList),this.autocompleteList=null}onCompleted(){this.isListOpen&&this.closeList(),this.dispatchEvent({type:sh.EVENT_VALUE_CONFIRMED,value:this.getValue(),isValid:this.isValid()})}getValue(){return e(this.eAutocompleteInput.getValue())}setInputPlaceholder(e){return this.eAutocompleteInput.setInputPlaceholder(e),this}setInputAriaLabel(e){return this.eAutocompleteInput.setInputAriaLabel(e),this}setListAriaLabel(e){return this.listAriaLabel=e,this}setListGenerator(e){return this.listGenerator=e,this}setValidator(e){return this.validator=e,this}isValid(){return this.valid}setValue(e){const{value:t,position:i,silent:s,updateListOnlyIfOpen:o,restoreFocus:r}=e;this.eAutocompleteInput.setValue(t,!0),this.setCaret(null!=i?i:this.lastPosition,r),s||this.updateValue(t),o&&!this.isListOpen||this.updateAutocompleteList(t)}setForceLastSelection(e){return this.forceLastSelection=e,this}setInputDisabled(e){return this.eAutocompleteInput.setDisabled(e),this}}sh.EVENT_VALUE_CHANGED="eventValueChanged",sh.EVENT_VALUE_CONFIRMED="eventValueConfirmed",sh.EVENT_OPTION_SELECTED="eventOptionSelected",sh.EVENT_VALID_CHANGED="eventValidChanged",ih([j("popupService")],sh.prototype,"popupService",void 0),ih([Ks("eAutocompleteInput")],sh.prototype,"eAutocompleteInput",void 0),ih([B],sh.prototype,"postConstruct",null);const oh=["mouseover","mouseout","mouseenter","mouseleave","mousemove"],rh=["touchstart","touchend","touchmove","touchcancel"];class nh{constructor(){this.renderingEngine="vanilla",this.isOutsideAngular=e=>me(oh,e)}setTimeout(e,t){window.setTimeout(e,t)}setInterval(e,t){return new Gs(i=>{i(window.setInterval(e,t))})}addEventListener(e,t,i,s){const o=me(rh,t);e.addEventListener(t,i,{capture:!!s,passive:o})}dispatchEvent(e,t,i=!1){t()}frameworkComponent(e){return null}isFrameworkComponent(e){return!1}}var lh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let ah=class extends Le{getNextCellToFocus(e,t,i=!1){return i?this.getNextCellToFocusWithCtrlPressed(e,t):this.getNextCellToFocusWithoutCtrlPressed(e,t)}getNextCellToFocusWithCtrlPressed(e,t){const i=e===ys.UP,s=e===ys.DOWN,o=e===ys.LEFT;let r,n;if(i||s)n=i?this.paginationProxy.getPageFirstRow():this.paginationProxy.getPageLastRow(),r=t.column;else{const e=this.columnModel.getAllDisplayedColumns(),i=this.gridOptionsService.is("enableRtl");n=t.rowIndex,r=o!==i?e[0]:ne(e)}return{rowIndex:n,rowPinned:null,column:r}}getNextCellToFocusWithoutCtrlPressed(e,t){let i=t,s=!1;for(;!s;){switch(e){case ys.UP:i=this.getCellAbove(i);break;case ys.DOWN:i=this.getCellBelow(i);break;case ys.RIGHT:i=this.gridOptionsService.is("enableRtl")?this.getCellToLeft(i):this.getCellToRight(i);break;case ys.LEFT:i=this.gridOptionsService.is("enableRtl")?this.getCellToRight(i):this.getCellToLeft(i);break;default:i=null,console.warn("AG Grid: unknown key for navigation "+e)}s=!i||this.isCellGoodToFocusOn(i)}return i}isCellGoodToFocusOn(e){const t=e.column;let i;switch(e.rowPinned){case"top":i=this.pinnedRowModel.getPinnedTopRow(e.rowIndex);break;case"bottom":i=this.pinnedRowModel.getPinnedBottomRow(e.rowIndex);break;default:i=this.rowModel.getRow(e.rowIndex)}if(!i)return!1;return!t.isSuppressNavigable(i)}getCellToLeft(e){if(!e)return null;const t=this.columnModel.getDisplayedColBefore(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getCellToRight(e){if(!e)return null;const t=this.columnModel.getDisplayedColAfter(e.column);return t?{rowIndex:e.rowIndex,column:t,rowPinned:e.rowPinned}:null}getRowBelow(e){const t=e.rowIndex,i=e.rowPinned;if(this.isLastRowInContainer(e))switch(i){case"bottom":return null;case"top":return this.rowModel.isRowsToRender()?{rowIndex:this.paginationProxy.getPageFirstRow(),rowPinned:null}:this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null;default:return this.pinnedRowModel.isRowsToRender("bottom")?{rowIndex:0,rowPinned:"bottom"}:null}const s=this.rowModel.getRow(e.rowIndex),o=this.getNextStickyPosition(s);return o||{rowIndex:t+1,rowPinned:i}}getNextStickyPosition(e,t){if(!this.gridOptionsService.isGroupRowsSticky()||!e||!e.sticky)return;const i=[...this.rowRenderer.getStickyTopRowCtrls()].sort((e,t)=>e.getRowNode().rowIndex-t.getRowNode().rowIndex),s=t?-1:1,o=i.findIndex(t=>t.getRowNode().rowIndex===e.rowIndex),r=i[o+s];return r?{rowIndex:r.getRowNode().rowIndex,rowPinned:null}:void 0}getCellBelow(e){if(!e)return null;const t=this.getRowBelow(e);return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}isLastRowInContainer(e){const t=e.rowPinned,i=e.rowIndex;if("top"===t){return this.pinnedRowModel.getPinnedTopRowData().length-1<=i}if("bottom"===t){return this.pinnedRowModel.getPinnedBottomRowData().length-1<=i}return this.paginationProxy.getPageLastRow()<=i}getRowAbove(e){const t=e.rowIndex,i=e.rowPinned;if(i?0===t:t===this.paginationProxy.getPageFirstRow())return"top"===i?null:i&&this.rowModel.isRowsToRender()?this.getLastBodyCell():this.pinnedRowModel.isRowsToRender("top")?this.getLastFloatingTopRow():null;const s=this.rowModel.getRow(e.rowIndex),o=this.getNextStickyPosition(s,!0);return o||{rowIndex:t-1,rowPinned:i}}getCellAbove(e){if(!e)return null;const t=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});return t?{rowIndex:t.rowIndex,column:e.column,rowPinned:t.rowPinned}:null}getLastBodyCell(){return{rowIndex:this.paginationProxy.getPageLastRow(),rowPinned:null}}getLastFloatingTopRow(){return{rowIndex:this.pinnedRowModel.getPinnedTopRowData().length-1,rowPinned:"top"}}getNextTabbedCell(e,t){return t?this.getNextTabbedCellBackwards(e):this.getNextTabbedCellForwards(e)}getNextTabbedCellForwards(e){const t=this.columnModel.getAllDisplayedColumns();let s=e.rowIndex,o=e.rowPinned,r=this.columnModel.getDisplayedColAfter(e.column);if(!r){r=t[0];const n=this.getRowBelow(e);if(i(n))return null;if(!n.rowPinned&&!this.paginationProxy.isRowInPage(n))return null;s=n?n.rowIndex:null,o=n?n.rowPinned:null}return{rowIndex:s,column:r,rowPinned:o}}getNextTabbedCellBackwards(e){const t=this.columnModel.getAllDisplayedColumns();let s=e.rowIndex,o=e.rowPinned,r=this.columnModel.getDisplayedColBefore(e.column);if(!r){r=ne(t);const n=this.getRowAbove({rowIndex:e.rowIndex,rowPinned:e.rowPinned});if(i(n))return null;if(!n.rowPinned&&!this.paginationProxy.isRowInPage(n))return null;s=n?n.rowIndex:null,o=n?n.rowPinned:null}return{rowIndex:s,column:r,rowPinned:o}}};lh([j("columnModel")],ah.prototype,"columnModel",void 0),lh([j("rowModel")],ah.prototype,"rowModel",void 0),lh([j("rowRenderer")],ah.prototype,"rowRenderer",void 0),lh([j("pinnedRowModel")],ah.prototype,"pinnedRowModel",void 0),lh([j("paginationProxy")],ah.prototype,"paginationProxy",void 0),ah=lh([U("cellNavigationService")],ah);var dh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},hh=function(e,t){return function(i,s){t(i,s,e)}};let ch=class extends Le{constructor(){super(...arguments),this.consuming=!1}setBeans(e){this.logger=e.create("AlignedGridsService")}init(){this.addManagedListener(this.eventService,_e.EVENT_COLUMN_MOVED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_VISIBLE,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_PINNED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_GROUP_OPENED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_RESIZED,this.fireColumnEvent.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_BODY_SCROLL,this.fireScrollEvent.bind(this))}fireEvent(e){if(this.consuming)return;const t=this.gridOptionsService.get("alignedGrids");t&&t.forEach(t=>{if(t.api){const i=t.api.__getAlignedGridService();e(i)}})}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent(t=>{t.onColumnEvent(e)})}fireScrollEvent(e){"horizontal"===e.direction&&this.fireEvent(t=>{t.onScrollEvent(e)})}onScrollEvent(e){this.onEvent(()=>{this.ctrlsService.getGridBodyCtrl().getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}getMasterColumns(e){const t=[];return e.columns?e.columns.forEach(e=>{t.push(e)}):e.column&&t.push(e.column),t}getColumnIds(e){const t=[];return e.columns?e.columns.forEach(e=>{t.push(e.getColId())}):e.column&&t.push(e.column.getColId()),t}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case _e.EVENT_COLUMN_MOVED:case _e.EVENT_COLUMN_VISIBLE:case _e.EVENT_COLUMN_PINNED:case _e.EVENT_COLUMN_RESIZED:const t=e;this.processColumnEvent(t);break;case _e.EVENT_COLUMN_GROUP_OPENED:const i=e;this.processGroupOpenedEvent(i);break;case _e.EVENT_COLUMN_PIVOT_CHANGED:console.warn("AG Grid: pivoting is not supported with aligned grids. You can only use one of these features at a time in a grid.")}})}processGroupOpenedEvent(e){const t=e.columnGroup;let i=null;if(t){const e=t.getGroupId();i=this.columnModel.getProvidedColumnGroup(e)}t&&!i||(this.logger.log("onColumnEvent-> processing "+e+" expanded = "+t.isExpanded()),this.columnModel.setColumnGroupOpened(i,t.isExpanded(),"alignedGridChanged"))}processColumnEvent(e){var t;const i=e.column;let s=null;if(i&&(s=this.columnModel.getPrimaryColumn(i.getColId())),i&&!s)return;const o=this.getMasterColumns(e);switch(e.type){case _e.EVENT_COLUMN_MOVED:{const t=e,i=e.columnApi.getColumnState().map(e=>({colId:e.colId}));this.columnModel.applyColumnState({state:i,applyOrder:!0},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} toIndex = ${t.toIndex}`)}break;case _e.EVENT_COLUMN_VISIBLE:{const t=e,i=e.columnApi.getColumnState().map(e=>({colId:e.colId,hide:e.hide}));this.columnModel.applyColumnState({state:i},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} visible = ${t.visible}`)}break;case _e.EVENT_COLUMN_PINNED:{const t=e,i=e.columnApi.getColumnState().map(e=>({colId:e.colId,pinned:e.pinned}));this.columnModel.applyColumnState({state:i},"alignedGridChanged"),this.logger.log(`onColumnEvent-> processing ${e.type} pinned = ${t.pinned}`)}break;case _e.EVENT_COLUMN_RESIZED:const i=e,s={};o.forEach(t=>{this.logger.log(`onColumnEvent-> processing ${e.type} actualWidth = ${t.getActualWidth()}`),s[t.getId()]={key:t.getColId(),newWidth:t.getActualWidth()}}),null===(t=i.flexColumns)||void 0===t||t.forEach(e=>{s[e.getId()]&&delete s[e.getId()]}),this.columnModel.setColumnWidths(Object.values(s),!1,i.finished,"alignedGridChanged")}const r=this.ctrlsService.getGridBodyCtrl().isVerticalScrollShowing(),n=this.gridOptionsService.get("alignedGrids");n&&n.forEach(e=>{e.api&&e.api.setAlwaysShowVerticalScroll(r)})}};dh([j("columnModel")],ch.prototype,"columnModel",void 0),dh([j("ctrlsService")],ch.prototype,"ctrlsService",void 0),dh([hh(0,Y("loggerFactory"))],ch.prototype,"setBeans",null),dh([B],ch.prototype,"init",null),ch=dh([U("alignedGridsService")],ch);var uh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},ph=function(e,t){return function(i,s){t(i,s,e)}};let gh=class extends Le{setBeans(e){this.logger=e.create("selectionService"),this.reset()}init(){this.groupSelectsChildren=this.gridOptionsService.is("groupSelectsChildren"),this.addManagedPropertyListener("groupSelectsChildren",e=>this.groupSelectsChildren=e.currentValue),this.rowSelection=this.gridOptionsService.get("rowSelection"),this.addManagedPropertyListener("rowSelection",e=>this.rowSelection=e.currentValue),this.addManagedListener(this.eventService,_e.EVENT_ROW_SELECTED,this.onRowSelected.bind(this))}isMultiselect(){return"multiple"===this.rowSelection}setNodesSelected(e){var t;if(0===e.nodes.length)return 0;const{newValue:i,clearSelection:s,suppressFinishActions:o,rangeSelect:r,event:n,source:l="api"}=e;if(e.nodes.length>1&&!this.isMultiselect())return console.warn("AG Grid: cannot multi select while rowSelection='single'"),0;const a=this.groupSelectsChildren&&!0===e.groupSelectsFiltered,d=e.nodes.map(e=>e.footer?e.sibling:e);if(r){if(e.nodes.length>1)return console.warn("AG Grid: cannot range select while selecting multiple rows"),0;const t=this.getLastSelectedNode();if(t){const i=d[0];if(t!==i&&this.isMultiselect()){const s=this.selectRange(i,t,e.newValue,l);return this.setLastSelectedNode(i),s}}}let h=0;for(let s=0;s<d.length;s++){const o=d[s];if(!(a&&o.group)){o.selectThisNode(i,e.event,l)&&h++}this.groupSelectsChildren&&(null===(t=o.childrenAfterGroup)||void 0===t?void 0:t.length)&&(h+=this.selectChildren(o,i,a,l))}if(!o){if(i&&(s||!this.isMultiselect())&&(h+=this.clearOtherNodes(d[0],l)),h>0){this.updateGroupsFromChildrenSelections(l);const e={type:_e.EVENT_SELECTION_CHANGED,source:l};this.eventService.dispatchEvent(e)}i&&this.setLastSelectedNode(d[d.length-1])}return h}selectRange(e,t,i=!0,s){const o=this.rowModel.getNodesInRangeForSelection(e,t);let r=0;o.forEach(t=>{if(t.group&&this.groupSelectsChildren||!1===i&&e===t)return;t.selectThisNode(i,void 0,s)&&r++}),this.updateGroupsFromChildrenSelections(s);const n={type:_e.EVENT_SELECTION_CHANGED,source:s};return this.eventService.dispatchEvent(n),r}selectChildren(e,t,i,s){const o=i?e.childrenAfterAggFilter:e.childrenAfterGroup;return Is.missing(o)?0:this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,groupSelectsFiltered:i,source:s,nodes:o})}setLastSelectedNode(e){this.lastSelectedNode=e}getLastSelectedNode(){return this.lastSelectedNode}getSelectedNodes(){const e=[];return h(this.selectedNodes,(t,i)=>{i&&e.push(i)}),e}getSelectedRows(){const e=[];return h(this.selectedNodes,(t,i)=>{i&&i.data&&e.push(i.data)}),e}getSelectionCount(){return Object.values(this.selectedNodes).length}filterFromSelection(e){const t={};Object.entries(this.selectedNodes).forEach(([i,s])=>{s&&e(s)&&(t[i]=s)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsChildren)return!1;if("clientSide"!==this.rowModel.getType())return!1;const i=this.rowModel.getRootNode();t||(t=new pd(!0,i)).setInactive();let s=!1;return t.forEachChangedNodeDepthFirst(t=>{if(t!==i){const i=t.calculateSelectedFromChildren();s=t.selectThisNode(null!==i&&i,void 0,e)||s}}),s}clearOtherNodes(e,t){const i={};let s=0;return h(this.selectedNodes,(o,r)=>{if(r&&r.id!==e.id){const e=this.selectedNodes[r.id];s+=e.setSelectedParams({newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:t}),this.groupSelectsChildren&&r.parent&&(i[r.parent.id]=r.parent)}}),h(i,(e,i)=>{const s=i.calculateSelectedFromChildren();i.selectThisNode(null!==s&&s,void 0,t)}),s}onRowSelected(e){const t=e.node;this.groupSelectsChildren&&t.group||(t.isSelected()?this.selectedNodes[t.id]=t:delete this.selectedNodes[t.id])}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}syncInOldRowNode(e,i){if(t(i)&&e.id!==i.id&&i){const t=i.id;this.selectedNodes[t]==e&&(this.selectedNodes[i.id]=i)}}syncInNewRowNode(e){t(this.selectedNodes[e.id])?(e.setSelectedInitialValue(!0),this.selectedNodes[e.id]=e):e.setSelectedInitialValue(!1)}reset(){this.logger.log("reset"),this.selectedNodes={},this.lastSelectedNode=null}getBestCostNodeSelection(){if("clientSide"!==this.rowModel.getType())return;const e=this.rowModel.getTopLevelNodes();if(null===e)return;const t=[];return function e(i){for(let s=0,o=i.length;s<o;s++){const o=i[s];if(o.isSelected())t.push(o);else{const t=o;t.group&&t.children&&e(t.children)}}}(e),t}isEmpty(){let e=0;return h(this.selectedNodes,(t,i)=>{i&&e++}),0===e}deselectAllRowNodes(e){const t=e=>e.selectThisNode(!1,void 0,s),i="clientSide"===this.rowModel.getType(),{source:s,justFiltered:o,justCurrentPage:r}=e;if(r||o){if(!i)return void console.error("AG Grid: selecting just filtered only works when gridOptions.rowModelType='clientSide'");this.getNodesToSelect(o,r).forEach(t)}else h(this.selectedNodes,(e,i)=>{i&&t(i)}),this.reset();i&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(s);const n={type:_e.EVENT_SELECTION_CHANGED,source:s};this.eventService.dispatchEvent(n)}getSelectAllState(e,t){let i=0,s=0;return this.getNodesToSelect(e,t).forEach(e=>{this.groupSelectsChildren&&e.group||(e.isSelected()?i++:e.selectable&&s++)}),(0!==i||0!==s)&&(i>0&&s>0?null:i>0)}getNodesToSelect(e=!1,t=!1){if("clientSide"!==this.rowModel.getType())throw new Error("selectAll only available when rowModelType='clientSide', ie not "+this.rowModel.getType());const i=[];if(t)return this.paginationProxy.forEachNodeOnPage(e=>{if(e.group)if(e.expanded)this.groupSelectsChildren||i.push(e);else{const t=e=>{var s;i.push(e),(null===(s=e.childrenAfterFilter)||void 0===s?void 0:s.length)&&e.childrenAfterFilter.forEach(t)};t(e)}else i.push(e)}),i;const s=this.rowModel;return e?(s.forEachNodeAfterFilter(e=>{i.push(e)}),i):(s.forEachNode(e=>{i.push(e)}),i)}selectAllRowNodes(e){if("clientSide"!==this.rowModel.getType())throw new Error("selectAll only available when rowModelType='clientSide', ie not "+this.rowModel.getType());const{source:t,justFiltered:i,justCurrentPage:s}=e;this.getNodesToSelect(i,s).forEach(e=>e.selectThisNode(!0,void 0,t)),"clientSide"===this.rowModel.getType()&&this.groupSelectsChildren&&this.updateGroupsFromChildrenSelections(t);const o={type:_e.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(o)}getServerSideSelectionState(){return null}setServerSideSelectionState(e){}};uh([j("rowModel")],gh.prototype,"rowModel",void 0),uh([j("paginationProxy")],gh.prototype,"paginationProxy",void 0),uh([ph(0,Y("loggerFactory"))],gh.prototype,"setBeans",null),uh([B],gh.prototype,"init",null),gh=uh([U("selectionService")],gh);var mh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Ch=class{sizeColumnsToFit(e){void 0===e&&console.error("AG Grid: missing parameter to columnApi.sizeColumnsToFit(gridWidth)"),this.columnModel.sizeColumnsToFit(e,"api")}setColumnGroupOpened(e,t){this.columnModel.setColumnGroupOpened(e,t,"api")}getColumnGroup(e,t){return this.columnModel.getColumnGroup(e,t)}getProvidedColumnGroup(e){return this.columnModel.getProvidedColumnGroup(e)}getDisplayNameForColumn(e,t){return this.columnModel.getDisplayNameForColumn(e,t)||""}getDisplayNameForColumnGroup(e,t){return this.columnModel.getDisplayNameForColumnGroup(e,t)||""}getColumn(e){return this.columnModel.getPrimaryColumn(e)}getColumns(){return this.columnModel.getAllPrimaryColumns()}applyColumnState(e){return this.columnModel.applyColumnState(e,"api")}getColumnState(){return this.columnModel.getColumnState()}resetColumnState(){this.columnModel.resetColumnState("api")}getColumnGroupState(){return this.columnModel.getColumnGroupState()}setColumnGroupState(e){this.columnModel.setColumnGroupState(e,"api")}resetColumnGroupState(){this.columnModel.resetColumnGroupState("api")}isPinning(){return this.columnModel.isPinningLeft()||this.columnModel.isPinningRight()}isPinningLeft(){return this.columnModel.isPinningLeft()}isPinningRight(){return this.columnModel.isPinningRight()}getDisplayedColAfter(e){return this.columnModel.getDisplayedColAfter(e)}getDisplayedColBefore(e){return this.columnModel.getDisplayedColBefore(e)}setColumnVisible(e,t){this.columnModel.setColumnVisible(e,t,"api")}setColumnsVisible(e,t){this.columnModel.setColumnsVisible(e,t,"api")}setColumnPinned(e,t){this.columnModel.setColumnPinned(e,t,"api")}setColumnsPinned(e,t){this.columnModel.setColumnsPinned(e,t,"api")}getAllGridColumns(){return this.columnModel.getAllGridColumns()}getDisplayedLeftColumns(){return this.columnModel.getDisplayedLeftColumns()}getDisplayedCenterColumns(){return this.columnModel.getDisplayedCenterColumns()}getDisplayedRightColumns(){return this.columnModel.getDisplayedRightColumns()}getAllDisplayedColumns(){return this.columnModel.getAllDisplayedColumns()}getAllDisplayedVirtualColumns(){return this.columnModel.getViewportColumns()}moveColumn(e,t){this.columnModel.moveColumn(e,t,"api")}moveColumnByIndex(e,t){this.columnModel.moveColumnByIndex(e,t,"api")}moveColumns(e,t){this.columnModel.moveColumns(e,t,"api")}moveRowGroupColumn(e,t){this.columnModel.moveRowGroupColumn(e,t)}setColumnAggFunc(e,t){this.columnModel.setColumnAggFunc(e,t)}setColumnWidth(e,t,i=!0,s){this.columnModel.setColumnWidths([{key:e,newWidth:t}],!1,i,s)}setColumnWidths(e,t=!0,i){this.columnModel.setColumnWidths(e,!1,t,i)}setPivotMode(e){this.columnModel.setPivotMode(e)}isPivotMode(){return this.columnModel.isPivotMode()}getPivotResultColumn(e,t){return this.columnModel.getSecondaryPivotColumn(e,t)}setValueColumns(e){this.columnModel.setValueColumns(e,"api")}getValueColumns(){return this.columnModel.getValueColumns()}removeValueColumn(e){this.columnModel.removeValueColumn(e,"api")}removeValueColumns(e){this.columnModel.removeValueColumns(e,"api")}addValueColumn(e){this.columnModel.addValueColumn(e,"api")}addValueColumns(e){this.columnModel.addValueColumns(e,"api")}setRowGroupColumns(e){this.columnModel.setRowGroupColumns(e,"api")}removeRowGroupColumn(e){this.columnModel.removeRowGroupColumn(e,"api")}removeRowGroupColumns(e){this.columnModel.removeRowGroupColumns(e,"api")}addRowGroupColumn(e){this.columnModel.addRowGroupColumn(e,"api")}addRowGroupColumns(e){this.columnModel.addRowGroupColumns(e,"api")}getRowGroupColumns(){return this.columnModel.getRowGroupColumns()}setPivotColumns(e){this.columnModel.setPivotColumns(e,"api")}removePivotColumn(e){this.columnModel.removePivotColumn(e,"api")}removePivotColumns(e){this.columnModel.removePivotColumns(e,"api")}addPivotColumn(e){this.columnModel.addPivotColumn(e,"api")}addPivotColumns(e){this.columnModel.addPivotColumns(e,"api")}getPivotColumns(){return this.columnModel.getPivotColumns()}getLeftDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeLeft()}getCenterDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeCentre()}getRightDisplayedColumnGroups(){return this.columnModel.getDisplayedTreeRight()}getAllDisplayedColumnGroups(){return this.columnModel.getAllDisplayedTrees()}autoSizeColumn(e,t){return this.columnModel.autoSizeColumn(e,t,"api")}autoSizeColumns(e,t){this.columnModel.autoSizeColumns({columns:e,skipHeader:t})}autoSizeAllColumns(e){this.columnModel.autoSizeAllColumns(e,"api")}setPivotResultColumns(e){this.columnModel.setSecondaryColumns(e,"api")}getPivotResultColumns(){return this.columnModel.getSecondaryColumns()}cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid(){setTimeout(Is.removeAllReferences.bind(window,this,"Column API"),100)}getAllColumns(){return ot("28.0","getAllColumns","getColumns"),this.getColumns()}getPrimaryColumns(){return ot("28.0","getPrimaryColumns","getColumns"),this.getColumns()}getSecondaryColumns(){return ot("28.0","getSecondaryColumns","getPivotResultColumns"),this.getPivotResultColumns()}setSecondaryColumns(e){ot("28.0","setSecondaryColumns","setPivotResultColumns"),this.setPivotResultColumns(e)}getSecondaryPivotColumn(e,t){return ot("28.0","getSecondaryPivotColumn","getPivotResultColumn"),this.getPivotResultColumn(e,t)}};mh([j("columnModel")],Ch.prototype,"columnModel",void 0),mh([W],Ch.prototype,"cleanDownReferencesToAvoidMemoryLeakInCaseApplicationIsKeepingReferenceToDestroyedGrid",null),Ch=mh([U("columnApi")],Ch);var vh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let fh=class extends Le{constructor(){super(...arguments),this.initialised=!1,this.isSsrm=!1}init(){this.isSsrm=this.gridOptionsService.isRowModelType("serverSide"),this.cellExpressions=this.gridOptionsService.is("enableCellExpressions"),this.isTreeData=this.gridOptionsService.is("treeData"),this.initialised=!0,this.eventService.addEventListener(_e.EVENT_CELL_VALUE_CHANGED,e=>this.callColumnCellValueChangedHandler(e),this.gridOptionsService.useAsyncEvents()),this.addManagedPropertyListener("treeData",e=>this.isTreeData=e.currentValue)}getValue(e,t,i=!1,s=!1){if(this.initialised||this.init(),!t)return;const o=e.getColDef(),r=o.field,n=e.getColId(),l=t.data;let a;const d=t.groupData&&void 0!==t.groupData[n],h=!s&&t.aggData&&void 0!==t.aggData[n],c=this.isSsrm&&s&&!!e.getColDef().aggFunc,u=this.isSsrm&&t.footer&&t.field&&(!0===e.getColDef().showRowGroup||e.getColDef().showRowGroup===t.field);if(i&&o.filterValueGetter?a=this.executeFilterValueGetter(o.filterValueGetter,l,e,t):this.isTreeData&&h?a=t.aggData[n]:this.isTreeData&&o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,e,t):this.isTreeData&&r&&l?a=w(l,r,e.isFieldContainsDots()):d?a=t.groupData[n]:h?a=t.aggData[n]:o.valueGetter?a=this.executeValueGetter(o.valueGetter,l,e,t):u?a=w(l,t.field,e.isFieldContainsDots()):r&&l&&!c&&(a=w(l,r,e.isFieldContainsDots())),this.cellExpressions&&"string"==typeof a&&0===a.indexOf("=")){const i=a.substring(1);a=this.executeValueGetter(i,l,e,t)}if(null==a){const i=this.getOpenedGroup(t,e);if(null!=i)return i}return a}getOpenedGroup(e,t){if(!this.gridOptionsService.is("showOpenedGroup"))return;if(!t.getColDef().showRowGroup)return;const i=t.getColDef().showRowGroup;let s=e.parent;for(;null!=s;){if(s.rowGroupColumn&&(!0===i||i===s.rowGroupColumn.getColId()))return s.key;s=s.parent}}setValue(e,s,o,r){const n=this.columnModel.getPrimaryColumn(s);if(!e||!n)return!1;i(e.data)&&(e.data={});const{field:l,valueSetter:a}=n.getColDef();if(i(l)&&i(a))return console.warn("AG Grid: you need either field or valueSetter set on colDef for editing to work"),!1;if(!this.dataTypeService.checkType(n,o))return console.warn("AG Grid: Data type of the new value does not match the cell data type of the column"),!1;const d={node:e,data:e.data,oldValue:this.getValue(n,e),newValue:o,colDef:n.getColDef(),column:n,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context};let h;if(d.newValue=o,h=t(a)?"function"==typeof a?a(d):this.expressionService.evaluate(a,d):this.setValueUsingField(e.data,l,o,n.isFieldContainsDots()),void 0===h&&(h=!0),!h)return!1;e.resetQuickFilterAggregateText(),this.valueCache.onDataChanged(),d.newValue=this.getValue(n,e);const c={type:_e.EVENT_CELL_VALUE_CHANGED,event:null,rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:d.column,api:d.api,columnApi:d.columnApi,colDef:d.colDef,context:d.context,data:e.data,node:e,oldValue:d.oldValue,newValue:d.newValue,value:d.newValue,source:r};return this.eventService.dispatchEvent(c),!0}callColumnCellValueChangedHandler(e){const t=e.colDef.onCellValueChanged;"function"==typeof t&&t({node:e.node,data:e.data,oldValue:e.oldValue,newValue:e.newValue,colDef:e.colDef,column:e.column,api:e.api,columnApi:e.columnApi,context:e.context})}setValueUsingField(e,t,i,s){if(!t)return!1;let o=!1;if(s){const s=t.split(".");let r=e;for(;s.length>0&&r;){const e=s.shift();0===s.length?(o=r[e]===i,o||(r[e]=i)):r=r[e]}}else o=e[t]===i,o||(e[t]=i);return!o}executeFilterValueGetter(e,t,i,s){const o={data:t,node:s,column:i,colDef:i.getColDef(),api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context,getValue:this.getValueCallback.bind(this,s)};return"function"==typeof e?e(o):this.expressionService.evaluate(e,o)}executeValueGetter(e,t,i,s){const o=i.getColId(),r=this.valueCache.getValue(s,o);if(void 0!==r)return r;const n={data:t,node:s,column:i,colDef:i.getColDef(),api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context,getValue:this.getValueCallback.bind(this,s)};let l;return l="function"==typeof e?e(n):this.expressionService.evaluate(e,n),this.valueCache.setValue(s,o,l),l}getValueCallback(e,t){const i=this.columnModel.getPrimaryColumn(t);return i?this.getValue(i,e):null}getKeyForNode(e,t){const i=this.getValue(e,t),s=e.getColDef().keyCreator;let o=i;if(s){o=s({value:i,colDef:e.getColDef(),column:e,node:t,data:t.data,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context})}return"string"==typeof o||null==o||(o=String(o),"[object Object]"===o&&T(()=>{console.warn("AG Grid: a column you are grouping or pivoting by has objects as values. If you want to group by complex objects then either a) use a colDef.keyCreator (se AG Grid docs) or b) to toString() on the object to return a key")},"getKeyForNode - warn about [object,object]")),o}};vh([j("expressionService")],fh.prototype,"expressionService",void 0),vh([j("columnModel")],fh.prototype,"columnModel",void 0),vh([j("valueCache")],fh.prototype,"valueCache",void 0),vh([j("dataTypeService")],fh.prototype,"dataTypeService",void 0),vh([B],fh.prototype,"init",null),fh=vh([U("valueService")],fh);var wh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},yh=function(e,t){return function(i,s){t(i,s,e)}};let Sh=class extends Le{constructor(){super(...arguments),this.expressionToFunctionCache={}}setBeans(e){this.logger=e.create("ExpressionService")}evaluate(e,t){if("string"==typeof e)return this.evaluateExpression(e,t);console.error("AG Grid: value should be either a string or a function",e)}evaluateExpression(e,t){try{const i=this.createExpressionFunction(e);return i(t.value,t.context,t.oldValue,t.newValue,t.value,t.node,t.data,t.colDef,t.rowIndex,t.api,t.columnApi,t.getValue,t.column,t.columnGroup)}catch(i){return console.log("Processing of the expression failed"),console.log("Expression = "+e),console.log("Params =",t),console.log("Exception = "+i),null}}createExpressionFunction(e){if(this.expressionToFunctionCache[e])return this.expressionToFunctionCache[e];const t=this.createFunctionBody(e),i=new Function("x, ctx, oldValue, newValue, value, node, data, colDef, rowIndex, api, columnApi, getValue, column, columnGroup",t);return this.expressionToFunctionCache[e]=i,i}createFunctionBody(e){return e.indexOf("return")>=0?e:"return "+e+";"}};wh([yh(0,Y("loggerFactory"))],Sh.prototype,"setBeans",null),Sh=wh([U("expressionService")],Sh);var Eh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Rh=class extends Le{constructor(){super(...arguments),this.templateCache={},this.waitingCallbacks={}}getTemplate(e,t){const i=this.templateCache[e];if(i)return i;let s=this.waitingCallbacks[e];const o=this;if(!s){s=[],this.waitingCallbacks[e]=s;const t=new XMLHttpRequest;t.onload=function(){o.handleHttpResult(this,e)},t.open("GET",e),t.send()}return t&&s.push(t),null}handleHttpResult(e,t){if(200!==e.status||null===e.response)return void console.warn(`AG Grid: Unable to get template error ${e.status} - ${t}`);this.templateCache[t]=e.response||e.responseText;const i=this.waitingCallbacks[t];for(let e=0;e<i.length;e++){(0,i[e])()}}};Rh=Eh([U("templateService")],Rh);var Th=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},bh=function(e,t){return function(i,s){t(i,s,e)}};let Dh=class extends Le{setBeans(e){this.logging=e.is("debug")}create(e){return new Oh(e,this.isLogging.bind(this))}isLogging(){return this.logging}};Th([bh(0,Y("gridOptionsService"))],Dh.prototype,"setBeans",null),Dh=Th([U("loggerFactory")],Dh);class Oh{constructor(e,t){this.name=e,this.isLoggingFunc=t}isLogging(){return this.isLoggingFunc()}log(e){this.isLoggingFunc()&&console.log("AG Grid."+this.name+": "+e)}}var Ph=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Ah extends Le{setComp(e,t,i){this.view=e,this.eGridHostDiv=t,this.eGui=i,this.eGui.setAttribute("grid-id",this.context.getGridId()),this.dragAndDropService.addDropTarget({getContainer:()=>this.eGui,isInterestedIn:e=>e===ur.HeaderCell||e===ur.ToolPanel,getIconName:()=>Cr.ICON_NOT_ALLOWED}),this.mouseEventService.stampTopLevelGridCompWithGridInstance(t),this.createManagedBean(new Nn(this.view)),this.addRtlSupport(),this.addManagedListener(this,_e.EVENT_KEYBOARD_FOCUS,()=>{this.view.addOrRemoveKeyboardFocusClass(!0)}),this.addManagedListener(this,_e.EVENT_MOUSE_FOCUS,()=>{this.view.addOrRemoveKeyboardFocusClass(!1)});const s=this.resizeObserverService.observeResize(this.eGridHostDiv,this.onGridSizeChanged.bind(this));this.addDestroyFunc(()=>s()),this.ctrlsService.registerGridCtrl(this)}isDetailGrid(){var e;const t=this.focusService.findTabbableParent(this.getGui());return(null===(e=null==t?void 0:t.getAttribute("row-id"))||void 0===e?void 0:e.startsWith("detail"))||!1}showDropZones(){return V.__isRegistered(x.RowGroupingModule,this.context.getGridId())}showSideBar(){return V.__isRegistered(x.SideBarModule,this.context.getGridId())}showStatusBar(){return V.__isRegistered(x.StatusBarModule,this.context.getGridId())}showWatermark(){return V.__isRegistered(x.EnterpriseCoreModule,this.context.getGridId())}onGridSizeChanged(){const e={type:_e.EVENT_GRID_SIZE_CHANGED,clientWidth:this.eGridHostDiv.clientWidth,clientHeight:this.eGridHostDiv.clientHeight};this.eventService.dispatchEvent(e)}addRtlSupport(){const e=this.gridOptionsService.is("enableRtl")?"ag-rtl":"ag-ltr";this.view.setRtlClass(e)}destroyGridUi(){this.view.destroyGridUi()}getGui(){return this.eGui}setResizeCursor(e){this.view.setCursor(e?"ew-resize":null)}disableUserSelect(e){this.view.setUserSelect(e?"none":null)}focusNextInnerContainer(e){const t=this.gridOptionsService.getDocument(),i=this.view.getFocusableContainers(),s=i.findIndex(e=>e.contains(t.activeElement))+(e?-1:1);return!(s<=0||s>=i.length)&&this.focusService.focusInto(i[s])}focusInnerElement(e){const t=this.view.getFocusableContainers(),i=this.columnModel.getAllDisplayedColumns();if(e){if(t.length>1)return this.focusService.focusInto(ne(t),!0);const e=ne(i);if(this.focusService.focusGridView(e,!0))return!0}return 0===this.gridOptionsService.getNum("headerHeight")?this.focusService.focusGridView(i[0]):this.focusService.focusFirstHeader()}forceFocusOutOfContainer(e=!1){this.view.forceFocusOutOfContainer(e)}}Ph([j("focusService")],Ah.prototype,"focusService",void 0),Ph([j("resizeObserverService")],Ah.prototype,"resizeObserverService",void 0),Ph([j("columnModel")],Ah.prototype,"columnModel",void 0),Ph([j("ctrlsService")],Ah.prototype,"ctrlsService",void 0),Ph([j("mouseEventService")],Ah.prototype,"mouseEventService",void 0),Ph([j("dragAndDropService")],Ah.prototype,"dragAndDropService",void 0);var Fh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Lh extends Ad{constructor(e){super(),this.eGridDiv=e}postConstruct(){this.logger=this.loggerFactory.create("GridComp");const e={destroyGridUi:()=>this.destroyBean(this),setRtlClass:e=>this.addCssClass(e),addOrRemoveKeyboardFocusClass:e=>this.addOrRemoveCssClass(Sa.AG_KEYBOARD_FOCUS,e),forceFocusOutOfContainer:this.forceFocusOutOfContainer.bind(this),updateLayoutClasses:this.updateLayoutClasses.bind(this),getFocusableContainers:this.getFocusableContainers.bind(this),setUserSelect:e=>{this.getGui().style.userSelect=null!=e?e:"",this.getGui().style.webkitUserSelect=null!=e?e:""},setCursor:e=>{this.getGui().style.cursor=null!=e?e:""}};this.ctrl=this.createManagedBean(new Ah);const t=this.createTemplate();this.setTemplate(t),this.ctrl.setComp(e,this.eGridDiv,this.getGui()),this.insertGridIntoDom(),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:e=>this.ctrl.focusInnerElement(e)})}insertGridIntoDom(){const e=this.getGui();this.eGridDiv.appendChild(e),this.addDestroyFunc(()=>{this.eGridDiv.removeChild(e),this.logger.log("Grid removed from DOM")})}updateLayoutClasses(e,t){const i=this.eRootWrapperBody.classList;i.toggle(Ln.AUTO_HEIGHT,t.autoHeight),i.toggle(Ln.NORMAL,t.normal),i.toggle(Ln.PRINT,t.print),this.addOrRemoveCssClass(Ln.AUTO_HEIGHT,t.autoHeight),this.addOrRemoveCssClass(Ln.NORMAL,t.normal),this.addOrRemoveCssClass(Ln.PRINT,t.print)}createTemplate(){return`<div class="ag-root-wrapper" role="presentation">\n                ${this.ctrl.showDropZones()?"<ag-grid-header-drop-zones></ag-grid-header-drop-zones>":""}\n                <div class="ag-root-wrapper-body" ref="rootWrapperBody" role="presentation">\n                    <ag-grid-body ref="gridBody"></ag-grid-body>\n                    ${this.ctrl.showSideBar()?'<ag-side-bar ref="sideBar"></ag-side-bar>':""}\n                </div>\n                ${this.ctrl.showStatusBar()?'<ag-status-bar ref="statusBar"></ag-status-bar>':""}\n                <ag-pagination></ag-pagination>\n                ${this.ctrl.showWatermark()?"<ag-watermark></ag-watermark>":""}\n            </div>`}getFocusableElement(){return this.eRootWrapperBody}getFocusableContainers(){const e=[this.gridBodyComp.getGui()];return this.sideBarComp&&e.push(this.sideBarComp.getGui()),e.filter(e=>qi(e))}}Fh([j("loggerFactory")],Lh.prototype,"loggerFactory",void 0),Fh([Ks("gridBody")],Lh.prototype,"gridBodyComp",void 0),Fh([Ks("sideBar")],Lh.prototype,"sideBarComp",void 0),Fh([Ks("rootWrapperBody")],Lh.prototype,"eRootWrapperBody",void 0),Fh([B],Lh.prototype,"postConstruct",null);var Ih,Nh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Mh=Ih=class extends Le{progressSort(e,t,i){const s=this.getNextSortDirection(e);this.setSortForColumn(e,s,t,i)}setSortForColumn(e,t,i,s){"asc"!==t&&"desc"!==t&&(t=null);let o=[e];if(this.gridOptionsService.isColumnsSortingCoupledToGroup()&&e.getColDef().showRowGroup){const t=this.columnModel.getSourceColumnsForGroupColumn(e),i=null==t?void 0:t.filter(e=>e.getColDef().sortable);i&&(o=[e,...i])}o.forEach(e=>e.setSort(t,s));(i||this.gridOptionsService.is("alwaysMultiSort"))&&!this.gridOptionsService.is("suppressMultiSort")||this.clearSortBarTheseColumns(o,s),this.updateSortIndex(e),this.dispatchSortChangedEvents(s)}updateSortIndex(e){const t=this.gridOptionsService.isColumnsSortingCoupledToGroup(),i=this.columnModel.getGroupDisplayColumnForGroup(e.getId()),s=t&&i||e,o=this.getColumnsWithSortingOrdered();this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(e=>e.setSortIndex(null));const r=o.filter(e=>e!==s);(s.getSort()?[...r,s]:r).forEach((e,t)=>e.setSortIndex(t))}onSortChanged(e){this.dispatchSortChangedEvents(e)}isSortActive(){const e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(e=>!!e.getSort());return e&&e.length>0}dispatchSortChangedEvents(e){const t={type:_e.EVENT_SORT_CHANGED,source:e};this.eventService.dispatchEvent(t)}clearSortBarTheseColumns(e,t){this.columnModel.getPrimaryAndSecondaryAndAutoColumns().forEach(i=>{e.includes(i)||i.setSort(void 0,t)})}getNextSortDirection(e){let t;if(t=e.getColDef().sortingOrder?e.getColDef().sortingOrder:this.gridOptionsService.get("sortingOrder")?this.gridOptionsService.get("sortingOrder"):Ih.DEFAULT_SORTING_ORDER,!Array.isArray(t)||t.length<=0)return console.warn("AG Grid: sortingOrder must be an array with at least one element, currently it's "+t),null;const i=t.indexOf(e.getSort()),s=i<0,o=i==t.length-1;let r;return r=s||o?t[0]:t[i+1],Ih.DEFAULT_SORTING_ORDER.indexOf(r)<0?(console.warn("AG Grid: invalid sort type "+r),null):r}getIndexedSortMap(){let e=this.columnModel.getPrimaryAndSecondaryAndAutoColumns().filter(e=>!!e.getSort());if(this.columnModel.isPivotMode()){const t=this.gridOptionsService.isColumnsSortingCoupledToGroup();e=e.filter(e=>{const i=!!e.getAggFunc(),s=!e.isPrimary(),o=t?this.columnModel.getGroupDisplayColumnForGroup(e.getId()):e.getColDef().showRowGroup;return i||s||o})}const t=this.columnModel.getRowGroupColumns().filter(e=>!!e.getSort()),i=this.gridOptionsService.isColumnsSortingCoupledToGroup()&&!!t.length;i&&(e=[...new Set(e.map(e=>{var t;return null!==(t=this.columnModel.getGroupDisplayColumnForGroup(e.getId()))&&void 0!==t?t:e}))]);const s={};e.forEach((e,t)=>s[e.getId()]=t),e.sort((e,t)=>{const i=e.getSortIndex(),o=t.getSortIndex();if(null!=i&&null!=o)return i-o;if(null==i&&null==o){return s[e.getId()]>s[t.getId()]?1:-1}return null==o?-1:1});const o=new Map;return e.forEach((e,t)=>o.set(e,t)),i&&t.forEach(e=>{const t=this.columnModel.getGroupDisplayColumnForGroup(e.getId());o.set(e,o.get(t))}),o}getColumnsWithSortingOrdered(){return[...this.getIndexedSortMap().entries()].sort(([e,t],[i,s])=>t-s).map(([e])=>e)}getSortModel(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),colId:e.getId()}))}getSortOptions(){return this.getColumnsWithSortingOrdered().filter(e=>e.getSort()).map(e=>({sort:e.getSort(),column:e}))}canColumnDisplayMixedSort(e){const t=this.gridOptionsService.isColumnsSortingCoupledToGroup(),i=!!e.getColDef().showRowGroup;return t&&i}getDisplaySortForColumn(e){const t=this.columnModel.getSourceColumnsForGroupColumn(e);if(!this.canColumnDisplayMixedSort(e)||!(null==t?void 0:t.length))return e.getSort();const i=null!=e.getColDef().field||!!e.getColDef().valueGetter?[e,...t]:t,s=i[0].getSort();return i.every(e=>e.getSort()==s)?s:"mixed"}getDisplaySortIndexForColumn(e){return this.getIndexedSortMap().get(e)}};Mh.DEFAULT_SORTING_ORDER=["asc","desc",null],Nh([j("columnModel")],Mh.prototype,"columnModel",void 0),Mh=Ih=Nh([U("sortController")],Mh);var Gh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let xh=class extends Le{setMouseOver(e){this.selectedColumns=e;const t={type:_e.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(t)}clearMouseOver(){this.selectedColumns=null;const e={type:_e.EVENT_COLUMN_HOVER_CHANGED};this.eventService.dispatchEvent(e)}isHovered(e){return!!this.selectedColumns&&this.selectedColumns.indexOf(e)>=0}};xh=Gh([U("columnHoverService")],xh);var _h=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Vh=class extends Le{constructor(){super(...arguments),this.executeNextFuncs=[],this.executeLaterFuncs=[],this.active=!1,this.animationThreadCount=0}postConstruct(){this.ctrlsService.whenReady(e=>this.gridBodyCtrl=e.gridBodyCtrl)}isActive(){return this.active}start(){this.active||this.gridOptionsService.is("suppressColumnMoveAnimation")||this.gridOptionsService.is("enableRtl")||(this.ensureAnimationCssClassPresent(),this.active=!0)}finish(){this.active&&(this.flush(),this.active=!1)}executeNextVMTurn(e){this.active?this.executeNextFuncs.push(e):e()}executeLaterVMTurn(e){this.active?this.executeLaterFuncs.push(e):e()}ensureAnimationCssClassPresent(){this.animationThreadCount++;const e=this.animationThreadCount;this.gridBodyCtrl.setColumnMovingCss(!0),this.executeLaterFuncs.push(()=>{this.animationThreadCount===e&&this.gridBodyCtrl.setColumnMovingCss(!1)})}flush(){const e=this.executeNextFuncs;this.executeNextFuncs=[];const t=this.executeLaterFuncs;this.executeLaterFuncs=[],0===e.length&&0===t.length||(window.setTimeout(()=>e.forEach(e=>e()),0),window.setTimeout(()=>t.forEach(e=>e()),300))}};_h([j("ctrlsService")],Vh.prototype,"ctrlsService",void 0),_h([B],Vh.prototype,"postConstruct",null),Vh=_h([U("columnAnimationService")],Vh);var Hh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let kh=class extends Le{postConstruct(){this.ctrlsService.whenReady(e=>{this.centerRowContainerCon=e.centerRowContainerCtrl,this.addManagedListener(this.eventService,_e.EVENT_BODY_HEIGHT_CHANGED,this.checkPageSize.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_SCROLL_VISIBILITY_CHANGED,this.checkPageSize.bind(this)),this.checkPageSize()})}notActive(){return!this.gridOptionsService.is("paginationAutoPageSize")||null==this.centerRowContainerCon}checkPageSize(){if(this.notActive())return;const e=this.centerRowContainerCon.getViewportSizeFeature().getBodyHeight();if(e>0){const t=()=>{const t=this.gridOptionsService.getRowHeightAsNumber(),i=Math.floor(e/t);this.gridOptionsService.set("paginationPageSize",i)};this.isBodyRendered?I(()=>t(),50)():(t(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}};Hh([j("ctrlsService")],kh.prototype,"ctrlsService",void 0),Hh([B],kh.prototype,"postConstruct",null),kh=Hh([U("paginationAutoPageSizeService")],kh);var Bh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Wh=class extends Le{constructor(){super(...arguments),this.cacheVersion=0}init(){this.active=this.gridOptionsService.is("valueCache"),this.neverExpires=this.gridOptionsService.is("valueCacheNeverExpires")}onDataChanged(){this.neverExpires||this.expire()}expire(){this.cacheVersion++}setValue(e,t,i){this.active&&(e.__cacheVersion!==this.cacheVersion&&(e.__cacheVersion=this.cacheVersion,e.__cacheData={}),e.__cacheData[t]=i)}getValue(e,t){if(this.active&&e.__cacheVersion===this.cacheVersion)return e.__cacheData[t]}};Bh([B],Wh.prototype,"init",null),Wh=Bh([U("valueCache")],Wh);var Uh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let jh=class extends Le{init(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel),this.addManagedListener(this.eventService,_e.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged.bind(this))}onCellValueChanged(e){"paste"!==e.source&&this.doChangeDetection(e.node,e.column)}doChangeDetection(e,t){if(this.gridOptionsService.is("suppressChangeDetection"))return;const i=[e];if(this.clientSideRowModel&&!e.isRowPinned()){const s=this.gridOptionsService.is("aggregateOnlyChangedColumns"),o=new pd(s,this.clientSideRowModel.getRootNode());o.addParentNode(e.parent,[t]),this.clientSideRowModel.doAggregate(o),o.forEachChangedNodeDepthFirst(e=>{i.push(e)})}this.rowRenderer.refreshCells({rowNodes:i})}};Uh([j("rowModel")],jh.prototype,"rowModel",void 0),Uh([j("rowRenderer")],jh.prototype,"rowRenderer",void 0),Uh([B],jh.prototype,"init",null),jh=Uh([U("changeDetectionService")],jh);var zh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Kh=class extends Le{adaptFunction(e,t){const i=this.componentMetadataProvider.retrieve(e);return i&&i.functionAdapter?i.functionAdapter(t):null}adaptCellRendererFunction(e){return class{refresh(e){return!1}getGui(){return this.eGui}init(t){const i=e(t),s=typeof i;this.eGui="string"!==s&&"number"!==s&&"boolean"!==s?null!=i?i:Qi("<span></span>"):Qi("<span>"+i+"</span>")}}}doesImplementIComponent(e){return!!e&&(e.prototype&&"getGui"in e.prototype)}};zh([j("componentMetadataProvider")],Kh.prototype,"componentMetadataProvider",void 0),Kh=zh([U("agComponentUtils")],Kh);var Yh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let $h=class extends Le{postConstruct(){this.componentMetaData={dateComponent:{mandatoryMethodList:["getDate","setDate"],optionalMethodList:["afterGuiAttached","setInputPlaceholder","setInputAriaLabel"]},detailCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},headerComponent:{mandatoryMethodList:[],optionalMethodList:["refresh"]},headerGroupComponent:{mandatoryMethodList:[],optionalMethodList:[]},loadingCellRenderer:{mandatoryMethodList:[],optionalMethodList:[]},loadingOverlayComponent:{mandatoryMethodList:[],optionalMethodList:[]},noRowsOverlayComponent:{mandatoryMethodList:[],optionalMethodList:[]},floatingFilterComponent:{mandatoryMethodList:["onParentModelChanged"],optionalMethodList:["afterGuiAttached"]},floatingFilterWrapperComponent:{mandatoryMethodList:[],optionalMethodList:[]},cellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},cellEditor:{mandatoryMethodList:["getValue"],optionalMethodList:["isPopup","isCancelBeforeStart","isCancelAfterEnd","getPopupPosition","focusIn","focusOut","afterGuiAttached"]},innerRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},fullWidthCellRenderer:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},groupRowRenderer:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"],functionAdapter:this.agComponentUtils.adaptCellRendererFunction.bind(this.agComponentUtils)},filter:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged"]},filterComponent:{mandatoryMethodList:["isFilterActive","doesFilterPass","getModel","setModel"],optionalMethodList:["afterGuiAttached","afterGuiDetached","onNewRowsLoaded","getModelAsString","onFloatingFilterChanged","onAnyFilterChanged"]},statusPanel:{mandatoryMethodList:[],optionalMethodList:["afterGuiAttached"]},toolPanel:{mandatoryMethodList:[],optionalMethodList:["refresh","afterGuiAttached"]},tooltipComponent:{mandatoryMethodList:[],optionalMethodList:[]}}}retrieve(e){return this.componentMetaData[e]}};Yh([j("agComponentUtils")],$h.prototype,"agComponentUtils",void 0),Yh([B],$h.prototype,"postConstruct",null),$h=Yh([U("componentMetadataProvider")],$h);var qh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const Qh={"ag-theme-custom":{headerHeight:25,headerCellMinWidth:24,listItemHeight:20,rowHeight:25,chartMenuPanelWidth:220},"ag-theme-material":{headerHeight:56,headerCellMinWidth:48,listItemHeight:32,rowHeight:48,chartMenuPanelWidth:240},"ag-theme-balham":{headerHeight:32,headerCellMinWidth:24,listItemHeight:24,rowHeight:28,chartMenuPanelWidth:220},"ag-theme-alpine":{headerHeight:48,headerCellMinWidth:36,listItemHeight:24,rowHeight:42,chartMenuPanelWidth:240}},Xh={headerHeight:["ag-header-row"],headerCellMinWidth:["ag-header-cell"],listItemHeight:["ag-virtual-list-item"],rowHeight:["ag-row"],chartMenuPanelWidth:["ag-chart-docked-container"]};let Jh=class extends Le{constructor(){super(...arguments),this.calculatedSizes={}}postConstruct(){var e;const t=null!==(e=this.getTheme().el)&&void 0!==e?e:this.eGridDiv;this.mutationObserver=new MutationObserver(()=>{this.calculatedSizes={},this.fireGridStylesChangedEvent()}),this.mutationObserver.observe(t||this.eGridDiv,{attributes:!0,attributeFilter:["class"]})}fireGridStylesChangedEvent(){const e={type:_e.EVENT_GRID_STYLES_CHANGED};this.eventService.dispatchEvent(e)}getSassVariable(e){const{themeFamily:t,el:i}=this.getTheme();if(!t||0!==t.indexOf("ag-theme"))return;this.calculatedSizes||(this.calculatedSizes={}),this.calculatedSizes[t]||(this.calculatedSizes[t]={});const s=this.calculatedSizes[t][e];return null!=s?s:(this.calculatedSizes[t][e]=this.calculateValueForSassProperty(e,t,i),this.calculatedSizes[t][e])}calculateValueForSassProperty(e,t,i){const s="ag-theme-"+(t.match("material")?"material":t.match("balham")?"balham":t.match("alpine")?"alpine":"custom"),o=Qh[s][e],r=this.gridOptionsService.getDocument();if(i||(i=this.eGridDiv),!Xh[e])return o;const n=Xh[e],l=r.createElement("div"),a=Array.from(i.classList);l.classList.add(t,...a),l.style.position="absolute";const d=n.reduce((e,t)=>{const i=r.createElement("div");return i.style.position="static",i.classList.add(t),e.appendChild(i),i},l);let h=0;if(r.body){r.body.appendChild(l);const t=-1!==e.toLowerCase().indexOf("height")?"height":"width";h=parseInt(window.getComputedStyle(d)[t],10),r.body.removeChild(l)}return h||o}isThemeDark(){const{theme:e}=this.getTheme();return!!e&&e.indexOf("dark")>=0}chartMenuPanelWidth(){return this.getSassVariable("chartMenuPanelWidth")}getTheme(){const e=/\bag-(material|(?:theme-([\w\-]*)))\b/g;let t=this.eGridDiv,i=null,s=[];for(;t;){if(i=e.exec(t.className),i){const i=t.className.match(e);i&&(s=i);break}t=t.parentElement||void 0}if(!i)return{allThemes:s};const o=i[0];return{theme:o,el:t,themeFamily:o.replace(/-dark$/,""),allThemes:s}}getFromTheme(e,t){var i;return null!==(i=this.getSassVariable(t))&&void 0!==i?i:e}getDefaultRowHeight(){return this.getFromTheme(25,"rowHeight")}getListItemHeight(){return this.getFromTheme(20,"listItemHeight")}refreshRowHeightVariable(){const e=this.eGridDiv.style.getPropertyValue("--ag-line-height").trim(),t=this.gridOptionsService.getNum("rowHeight");if(null==t||isNaN(t)||!isFinite(t))return-1;const i=t+"px";return e!=i?(this.eGridDiv.style.setProperty("--ag-line-height",i),t):""!=e?parseFloat(e):-1}getMinColWidth(){const e=this.getFromTheme(null,"headerCellMinWidth");return t(e)?Math.max(e,10):10}destroy(){this.calculatedSizes=null,this.mutationObserver&&this.mutationObserver.disconnect(),super.destroy()}};qh([j("eGridDiv")],Jh.prototype,"eGridDiv",void 0),qh([B],Jh.prototype,"postConstruct",null),Jh=qh([U("environment")],Jh);var Zh=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},ec=function(e,t){return function(i,s){t(i,s,e)}};let tc=class extends Le{constructor(){super(...arguments),this.scrollY=0,this.uiBodyHeight=0}agWire(e){this.logger=e.create("RowContainerHeightService")}postConstruct(){this.addManagedListener(this.eventService,_e.EVENT_BODY_HEIGHT_CHANGED,this.updateOffset.bind(this)),this.maxDivHeight=gi(),this.logger.log("maxDivHeight = "+this.maxDivHeight)}isStretching(){return this.stretching}getDivStretchOffset(){return this.divStretchOffset}updateOffset(){if(!this.stretching)return;const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition().top,t=this.getUiBodyHeight();(e!==this.scrollY||t!==this.uiBodyHeight)&&(this.scrollY=e,this.uiBodyHeight=t,this.calculateOffset())}calculateOffset(){this.setUiContainerHeight(this.maxDivHeight),this.pixelsToShave=this.modelHeight-this.uiContainerHeight,this.maxScrollY=this.uiContainerHeight-this.uiBodyHeight;const e=this.scrollY/this.maxScrollY,t=e*this.pixelsToShave;this.logger.log(`Div Stretch Offset = ${t} (${this.pixelsToShave} * ${e})`),this.setDivStretchOffset(t)}setUiContainerHeight(e){e!==this.uiContainerHeight&&(this.uiContainerHeight=e,this.eventService.dispatchEvent({type:_e.EVENT_ROW_CONTAINER_HEIGHT_CHANGED}))}clearOffset(){this.setUiContainerHeight(this.modelHeight),this.pixelsToShave=0,this.setDivStretchOffset(0)}setDivStretchOffset(e){const t="number"==typeof e?Math.floor(e):null;this.divStretchOffset!==t&&(this.divStretchOffset=t,this.eventService.dispatchEvent({type:_e.EVENT_HEIGHT_SCALE_CHANGED}))}setModelHeight(e){this.modelHeight=e,this.stretching=null!=e&&this.maxDivHeight>0&&e>this.maxDivHeight,this.stretching?this.calculateOffset():this.clearOffset()}getUiContainerHeight(){return this.uiContainerHeight}getRealPixelPosition(e){return e-this.divStretchOffset}getUiBodyHeight(){const e=this.ctrlsService.getGridBodyCtrl().getScrollFeature().getVScrollPosition();return e.bottom-e.top}getScrollPositionForPixel(e){if(this.pixelsToShave<=0)return e;const t=e/(this.modelHeight-this.getUiBodyHeight());return this.maxScrollY*t}};Zh([j("ctrlsService")],tc.prototype,"ctrlsService",void 0),Zh([ec(0,Y("loggerFactory"))],tc.prototype,"agWire",null),Zh([B],tc.prototype,"postConstruct",null),tc=Zh([U("rowContainerHeightService")],tc);var ic=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let sc=class extends Le{init(){this.groupSelectsChildren=this.gridOptionsService.is("groupSelectsChildren"),this.isRowSelectableFunc=this.gridOptionsService.get("isRowSelectable")}updateSelectableAfterGrouping(e){if(this.isRowSelectableFunc){const t=e=>e.childrenAfterGroup;this.recurseDown(e.childrenAfterGroup,t)}}recurseDown(e,i){e&&e.forEach(e=>{if(!e.group)return;let s;if(e.hasChildren()&&this.recurseDown(i(e),i),this.groupSelectsChildren){s=t((i(e)||[]).find(e=>!0===e.selectable))}else s=!!this.isRowSelectableFunc&&this.isRowSelectableFunc(e);e.setRowSelectable(s)})}};ic([B],sc.prototype,"init",null),sc=ic([U("selectableService")],sc);var oc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class rc extends js{constructor(){super(),this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1}postConstruct(){const e=this.gridOptionsService.is("enableRtl");this.setTemplate(this.getTemplate());const{btFirst:t,btPrevious:i,btNext:s,btLast:o}=this;this.activateTabIndex([t,i,s,o]),t.insertAdjacentElement("afterbegin",fs(e?"last":"first",this.gridOptionsService)),i.insertAdjacentElement("afterbegin",fs(e?"next":"previous",this.gridOptionsService)),s.insertAdjacentElement("afterbegin",fs(e?"previous":"next",this.gridOptionsService)),o.insertAdjacentElement("afterbegin",fs(e?"first":"last",this.gridOptionsService)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.onPaginationChanged()}onPaginationChanged(){const e=this.gridOptionsService.is("pagination")&&!this.gridOptionsService.is("suppressPaginationPanel");this.setDisplayed(e),e&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateRowLabels(),this.setCurrentPageLabel(),this.setTotalLabels())}setupListeners(){this.areListenersSetup||(this.addManagedListener(this.eventService,_e.EVENT_PAGINATION_CHANGED,this.onPaginationChanged.bind(this)),[{el:this.btFirst,fn:this.onBtFirst.bind(this)},{el:this.btPrevious,fn:this.onBtPrevious.bind(this)},{el:this.btNext,fn:this.onBtNext.bind(this)},{el:this.btLast,fn:this.onBtLast.bind(this)}].forEach(e=>{const{el:t,fn:i}=e;this.addManagedListener(t,"click",i),this.addManagedListener(t,"keydown",e=>{e.key!==ys.ENTER&&e.key!==ys.SPACE||(e.preventDefault(),i())})}),this.areListenersSetup=!0)}onBtFirst(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToFirstPage()}setCurrentPageLabel(){const e=this.paginationProxy.getTotalPages()>0,t=this.paginationProxy.getCurrentPage(),i=e?t+1:0;this.lbCurrent.innerHTML=this.formatNumber(i)}formatNumber(e){const t=this.gridOptionsService.getCallback("paginationNumberFormatter");if(t){return t({value:e})}const i=this.localeService.getLocaleTextFunc();return Ri(e,i("thousandSeparator",","),i("decimalSeparator","."))}getTemplate(){const e=this.localeService.getLocaleTextFunc(),t=e("page","Page"),i=e("to","to"),s=e("of","of"),o=e("firstPage","First Page"),r=e("previousPage","Previous Page"),n=e("nextPage","Next Page"),l=e("lastPage","Last Page"),a=this.getCompId();return`<div class="ag-paging-panel ag-unselectable" id="ag-${a}">\n                <span class="ag-paging-row-summary-panel" role="status">\n                    <span id="ag-${a}-first-row" ref="lbFirstRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n                    <span id="ag-${a}-to">${i}</span>\n                    <span id="ag-${a}-last-row" ref="lbLastRowOnPage" class="ag-paging-row-summary-panel-number"></span>\n                    <span id="ag-${a}-of">${s}</span>\n                    <span id="ag-${a}-row-count" ref="lbRecordCount" class="ag-paging-row-summary-panel-number"></span>\n                </span>\n                <span class="ag-paging-page-summary-panel" role="presentation">\n                    <div ref="btFirst" class="ag-button ag-paging-button" role="button" aria-label="${o}"></div>\n                    <div ref="btPrevious" class="ag-button ag-paging-button" role="button" aria-label="${r}"></div>\n                    <span class="ag-paging-description" role="status">\n                        <span id="ag-${a}-start-page">${t}</span>\n                        <span id="ag-${a}-start-page-number" ref="lbCurrent" class="ag-paging-number"></span>\n                        <span id="ag-${a}-of-page">${s}</span>\n                        <span id="ag-${a}-of-page-number" ref="lbTotal" class="ag-paging-number"></span>\n                    </span>\n                    <div ref="btNext" class="ag-button ag-paging-button" role="button" aria-label="${n}"></div>\n                    <div ref="btLast" class="ag-button ag-paging-button" role="button" aria-label="${l}"></div>\n                </span>\n            </div>`}onBtNext(){this.nextButtonDisabled||this.paginationProxy.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.paginationProxy.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.paginationProxy.goToLastPage()}enableOrDisableButtons(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.isLastPageFound(),i=this.paginationProxy.getTotalPages();this.previousAndFirstButtonsDisabled=0===e,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),o=t&&e===i-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===i-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){It(e,t),e.classList.toggle("ag-disabled",t)}updateRowLabels(){const e=this.paginationProxy.getCurrentPage(),t=this.paginationProxy.getPageSize(),i=this.paginationProxy.isLastPageFound(),s=this.paginationProxy.isLastPageFound()?this.paginationProxy.getMasterRowCount():null;let o,r;if(this.isZeroPagesToDisplay()?o=r=0:(o=t*e+1,r=o+t-1,i&&r>s&&(r=s)),this.lbFirstRowOnPage.innerHTML=this.formatNumber(o),this.rowNodeBlockLoader.isLoading()){const e=this.localeService.getLocaleTextFunc();this.lbLastRowOnPage.innerHTML=e("pageLastRowUnknown","?")}else this.lbLastRowOnPage.innerHTML=this.formatNumber(r)}isZeroPagesToDisplay(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages();return e&&0===t}setTotalLabels(){const e=this.paginationProxy.isLastPageFound(),t=this.paginationProxy.getTotalPages(),i=e?this.paginationProxy.getMasterRowCount():null;if(1===i){const e=this.paginationProxy.getRow(0);if(e&&e.group&&!(e.groupData||e.aggData))return void this.setTotalLabelsToZero()}if(e)this.lbTotal.innerHTML=this.formatNumber(t),this.lbRecordCount.innerHTML=this.formatNumber(i);else{const e=this.localeService.getLocaleTextFunc()("more","more");this.lbTotal.innerHTML=e,this.lbRecordCount.innerHTML=e}}setTotalLabelsToZero(){this.lbFirstRowOnPage.innerHTML=this.formatNumber(0),this.lbCurrent.innerHTML=this.formatNumber(0),this.lbLastRowOnPage.innerHTML=this.formatNumber(0),this.lbTotal.innerHTML=this.formatNumber(0),this.lbRecordCount.innerHTML=this.formatNumber(0)}}oc([j("paginationProxy")],rc.prototype,"paginationProxy",void 0),oc([j("rowNodeBlockLoader")],rc.prototype,"rowNodeBlockLoader",void 0),oc([Ks("btFirst")],rc.prototype,"btFirst",void 0),oc([Ks("btPrevious")],rc.prototype,"btPrevious",void 0),oc([Ks("btNext")],rc.prototype,"btNext",void 0),oc([Ks("btLast")],rc.prototype,"btLast",void 0),oc([Ks("lbRecordCount")],rc.prototype,"lbRecordCount",void 0),oc([Ks("lbFirstRowOnPage")],rc.prototype,"lbFirstRowOnPage",void 0),oc([Ks("lbLastRowOnPage")],rc.prototype,"lbLastRowOnPage",void 0),oc([Ks("lbCurrent")],rc.prototype,"lbCurrent",void 0),oc([Ks("lbTotal")],rc.prototype,"lbTotal",void 0),oc([B],rc.prototype,"postConstruct",null);var nc,lc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};!function(e){e[e.Loading=0]="Loading",e[e.NoRows=1]="NoRows"}(nc||(nc={}));class ac extends js{constructor(){super(ac.TEMPLATE),this.inProgress=!1,this.destroyRequested=!1,this.manuallyDisplayed=!1}updateLayoutClasses(e,t){const i=this.eOverlayWrapper.classList;i.toggle(Ln.AUTO_HEIGHT,t.autoHeight),i.toggle(Ln.NORMAL,t.normal),i.toggle(Ln.PRINT,t.print)}postConstruct(){this.createManagedBean(new Nn(this)),this.setDisplayed(!1,{skipAriaHidden:!0}),this.addManagedListener(this.eventService,_e.EVENT_ROW_DATA_UPDATED,this.onRowDataUpdated.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_NEW_COLUMNS_LOADED,this.onNewColumnsLoaded.bind(this)),this.gridOptionsService.isRowModelType("clientSide")&&!this.gridOptionsService.get("rowData")&&this.showLoadingOverlay(),this.gridApi.registerOverlayWrapperComp(this)}setWrapperTypeClass(e){const t=this.eOverlayWrapper.classList;t.toggle("ag-overlay-loading-wrapper",e===nc.Loading),t.toggle("ag-overlay-no-rows-wrapper",e===nc.NoRows)}showLoadingOverlay(){if(this.gridOptionsService.is("suppressLoadingOverlay"))return;const e=this.userComponentFactory.getLoadingOverlayCompDetails({}).newAgStackInstance();this.showOverlay(e,nc.Loading)}showNoRowsOverlay(){if(this.gridOptionsService.is("suppressNoRowsOverlay"))return;const e=this.userComponentFactory.getNoRowsOverlayCompDetails({}).newAgStackInstance();this.showOverlay(e,nc.NoRows)}showOverlay(e,t){this.inProgress||(this.setWrapperTypeClass(t),this.destroyActiveOverlay(),this.inProgress=!0,e&&e.then(e=>{this.inProgress=!1,this.eOverlayWrapper.appendChild(e.getGui()),this.activeOverlay=e,this.destroyRequested&&(this.destroyRequested=!1,this.destroyActiveOverlay())}),this.manuallyDisplayed=this.columnModel.isReady()&&!this.paginationProxy.isEmpty(),this.setDisplayed(!0,{skipAriaHidden:!0}))}destroyActiveOverlay(){this.inProgress?this.destroyRequested=!0:this.activeOverlay&&(this.activeOverlay=this.getContext().destroyBean(this.activeOverlay),Yi(this.eOverlayWrapper))}hideOverlay(){this.manuallyDisplayed=!1,this.destroyActiveOverlay(),this.setDisplayed(!1,{skipAriaHidden:!0})}destroy(){this.destroyActiveOverlay(),super.destroy()}showOrHideOverlay(){const e=this.paginationProxy.isEmpty(),t=this.gridOptionsService.is("suppressNoRowsOverlay");e&&!t?this.showNoRowsOverlay():this.hideOverlay()}onRowDataUpdated(){this.showOrHideOverlay()}onNewColumnsLoaded(){!this.columnModel.isReady()||this.paginationProxy.isEmpty()||this.manuallyDisplayed||this.hideOverlay()}}ac.TEMPLATE='\n        <div class="ag-overlay" aria-hidden="true">\n            <div class="ag-overlay-panel">\n                <div class="ag-overlay-wrapper" ref="eOverlayWrapper"></div>\n            </div>\n        </div>',lc([j("userComponentFactory")],ac.prototype,"userComponentFactory",void 0),lc([j("paginationProxy")],ac.prototype,"paginationProxy",void 0),lc([j("gridApi")],ac.prototype,"gridApi",void 0),lc([j("columnModel")],ac.prototype,"columnModel",void 0),lc([Ks("eOverlayWrapper")],ac.prototype,"eOverlayWrapper",void 0),lc([B],ac.prototype,"postConstruct",null);var dc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let hc=class extends Le{getFirstRow(){let e,t=0;return this.pinnedRowModel.getPinnedTopRowCount()?e="top":this.rowModel.getRowCount()?(e=null,t=this.paginationProxy.getPageFirstRow()):this.pinnedRowModel.getPinnedBottomRowCount()&&(e="bottom"),void 0===e?null:{rowIndex:t,rowPinned:e}}getLastRow(){let e,t=null;const i=this.pinnedRowModel.getPinnedBottomRowCount(),s=this.pinnedRowModel.getPinnedTopRowCount();return i?(t="bottom",e=i-1):this.rowModel.getRowCount()?(t=null,e=this.paginationProxy.getPageLastRow()):s&&(t="top",e=s-1),void 0===e?null:{rowIndex:e,rowPinned:t}}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}sameRow(e,t){return!e&&!t||!(e&&!t||!e&&t)&&(e.rowIndex===t.rowIndex&&e.rowPinned==t.rowPinned)}before(e,i){switch(e.rowPinned){case"top":if("top"!==i.rowPinned)return!0;break;case"bottom":if("bottom"!==i.rowPinned)return!1;break;default:if(t(i.rowPinned))return"top"!==i.rowPinned}return e.rowIndex<i.rowIndex}rowMax(e){let t;return e.forEach(e=>{(void 0===t||this.before(t,e))&&(t=e)}),t}rowMin(e){let t;return e.forEach(e=>{(void 0===t||this.before(e,t))&&(t=e)}),t}};dc([j("rowModel")],hc.prototype,"rowModel",void 0),dc([j("pinnedRowModel")],hc.prototype,"pinnedRowModel",void 0),dc([j("paginationProxy")],hc.prototype,"paginationProxy",void 0),hc=dc([U("rowPositionUtils")],hc);var cc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let uc=class extends Le{createId(e){const{rowIndex:t,rowPinned:i,column:s}=e;return this.createIdFromValues({rowIndex:t,column:s,rowPinned:i})}createIdFromValues(e){const{rowIndex:t,rowPinned:i,column:s}=e;return`${t}.${null==i?"null":i}.${s.getId()}`}equals(e,t){const i=e.column===t.column,s=e.rowPinned===t.rowPinned,o=e.rowIndex===t.rowIndex;return i&&s&&o}};uc=cc([U("cellPositionUtils")],uc);class pc{constructor(e){this.cellValueChanges=e}}class gc extends pc{constructor(e,t,i,s){super(e),this.initialRange=t,this.finalRange=i,this.ranges=s}}class mc{constructor(e){this.actionStack=[],this.maxStackSize=e||mc.DEFAULT_STACK_SIZE,this.actionStack=new Array(this.maxStackSize)}pop(){return this.actionStack.pop()}push(e){e.cellValueChanges&&e.cellValueChanges.length>0&&(this.actionStack.length===this.maxStackSize&&this.actionStack.shift(),this.actionStack.push(e))}clear(){this.actionStack=[]}getCurrentStackSize(){return this.actionStack.length}}mc.DEFAULT_STACK_SIZE=10;var Cc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let vc=class extends Le{constructor(){super(...arguments),this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},i=null!==this.activeCellEdit&&this.cellPositionUtils.equals(this.activeCellEdit,t),s=null!==this.activeRowEdit&&this.rowPositionUtils.sameRow(this.activeRowEdit,t);if(!(i||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:o,rowIndex:r,column:n,oldValue:l,value:a}=e,d={rowPinned:o,rowIndex:r,columnId:n.getColId(),newValue:a,oldValue:l};this.cellValueChanges.push(d)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}init(){if(!this.gridOptionsService.is("undoRedoCellEditing"))return;const e=this.gridOptionsService.getNum("undoRedoCellEditingLimit");e<=0||(this.undoStack=new mc(e),this.redoStack=new mc(e),this.addRowEditingListeners(),this.addCellEditingListeners(),this.addPasteListeners(),this.addFillListeners(),this.addCellKeyListeners(),this.addManagedListener(this.eventService,_e.EVENT_CELL_VALUE_CHANGED,this.onCellValueChanged),this.addManagedListener(this.eventService,_e.EVENT_MODEL_UPDATED,e=>{e.keepUndoRedoStack||this.clearStacks()}),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_PIVOT_MODE_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,_e.EVENT_NEW_COLUMNS_LOADED,this.clearStacks),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_GROUP_OPENED,this.clearStacks),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_ROW_GROUP_CHANGED,this.clearStacks),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_MOVED,this.clearStacks),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_PINNED,this.clearStacks),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_VISIBLE,this.clearStacks),this.addManagedListener(this.eventService,_e.EVENT_ROW_DRAG_END,this.clearStacks),this.ctrlsService.whenReady(()=>{this.gridBodyCtrl=this.ctrlsService.getGridBodyCtrl()}))}getCurrentUndoStackSize(){return this.undoStack?this.undoStack.getCurrentStackSize():0}getCurrentRedoStackSize(){return this.redoStack?this.redoStack.getCurrentStackSize():0}undo(e){const t={type:_e.EVENT_UNDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.undoStack,this.redoStack,"initialRange","oldValue","undo"),s={type:_e.EVENT_UNDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(s)}redo(e){const t={type:_e.EVENT_REDO_STARTED,source:e};this.eventService.dispatchEvent(t);const i=this.undoRedo(this.redoStack,this.undoStack,"finalRange","newValue","redo"),s={type:_e.EVENT_REDO_ENDED,source:e,operationPerformed:i};this.eventService.dispatchEvent(s)}undoRedo(e,t,i,s,o){if(!e)return!1;const r=e.pop();return!(!r||!r.cellValueChanges)&&(this.processAction(r,e=>e[s],o),r instanceof gc?this.processRange(r.ranges||[r[i]]):this.processCell(r.cellValueChanges),t.push(r),!0)}processAction(e,t,i){e.cellValueChanges.forEach(e=>{const{rowIndex:s,rowPinned:o,columnId:r}=e,n={rowIndex:s,rowPinned:o},l=this.getRowNode(n);l.displayed&&l.setDataValue(r,t(e),i)})}processRange(e){let t;this.rangeService.removeAllCellRanges(!0),e.forEach((i,s)=>{if(!i)return;const o=i.startRow,r=i.endRow;s===e.length-1&&(t={rowPinned:o.rowPinned,rowIndex:o.rowIndex,columnId:i.startColumn.getColId()},this.setLastFocusedCell(t));const n={rowStartIndex:o.rowIndex,rowStartPinned:o.rowPinned,rowEndIndex:r.rowIndex,rowEndPinned:r.rowPinned,columnStart:i.startColumn,columns:i.columns};this.rangeService.addCellRange(n)})}processCell(e){const t=e[0],{rowIndex:i,rowPinned:s}=t,o={rowIndex:i,rowPinned:s},r=this.getRowNode(o),n={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(n,!!this.rangeService)}setLastFocusedCell(e,t){const{rowIndex:i,columnId:s,rowPinned:o}=e,r=this.gridBodyCtrl.getScrollFeature(),n=this.columnModel.getGridColumn(s);if(!n)return;r.ensureIndexVisible(i),r.ensureColumnVisible(n);const l={rowIndex:i,column:n,rowPinned:o};this.focusService.setFocusedCell(Object.assign(Object.assign({},l),{forceBrowserFocus:!0})),t&&this.rangeService.setRangeToCell(l)}addRowEditingListeners(){this.addManagedListener(this.eventService,_e.EVENT_ROW_EDITING_STARTED,e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,_e.EVENT_ROW_EDITING_STOPPED,()=>{const e=new pc(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null})}addCellEditingListeners(){this.addManagedListener(this.eventService,_e.EVENT_CELL_EDITING_STARTED,e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}}),this.addManagedListener(this.eventService,_e.EVENT_CELL_EDITING_STOPPED,e=>{this.activeCellEdit=null;if(e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const e=new pc(this.cellValueChanges);this.pushActionsToUndoStack(e)}})}addPasteListeners(){this.addManagedListener(this.eventService,_e.EVENT_PASTE_START,()=>{this.isPasting=!0}),this.addManagedListener(this.eventService,_e.EVENT_PASTE_END,()=>{const e=new pc(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1})}addFillListeners(){this.addManagedListener(this.eventService,_e.EVENT_FILL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,_e.EVENT_FILL_END,e=>{const t=new gc(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1})}addCellKeyListeners(){this.addManagedListener(this.eventService,_e.EVENT_KEY_SHORTCUT_CHANGED_CELL_START,()=>{this.isRangeInAction=!0}),this.addManagedListener(this.eventService,_e.EVENT_KEY_SHORTCUT_CHANGED_CELL_END,()=>{let e;e=this.rangeService&&this.gridOptionsService.is("enableRangeSelection")?new gc(this.cellValueChanges,void 0,void 0,[...this.rangeService.getCellRanges()]):new pc(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1})}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}getRowNode(e){switch(e.rowPinned){case"top":return this.pinnedRowModel.getPinnedTopRowData()[e.rowIndex];case"bottom":return this.pinnedRowModel.getPinnedBottomRowData()[e.rowIndex];default:return this.rowModel.getRow(e.rowIndex)}}};Cc([j("focusService")],vc.prototype,"focusService",void 0),Cc([j("ctrlsService")],vc.prototype,"ctrlsService",void 0),Cc([j("rowModel")],vc.prototype,"rowModel",void 0),Cc([j("pinnedRowModel")],vc.prototype,"pinnedRowModel",void 0),Cc([j("cellPositionUtils")],vc.prototype,"cellPositionUtils",void 0),Cc([j("rowPositionUtils")],vc.prototype,"rowPositionUtils",void 0),Cc([j("columnModel")],vc.prototype,"columnModel",void 0),Cc([z("rangeService")],vc.prototype,"rangeService",void 0),Cc([B],vc.prototype,"init",null),vc=Cc([U("undoRedoService")],vc);var fc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let wc=class extends Le{findHeader(e,t){let i,s,o;if(e.column instanceof xe?(s="getDisplayedGroup"+t,i=this.columnModel[s](e.column)):(o="getDisplayedCol"+t,i=this.columnModel[o](e.column)),!i)return;let{headerRowIndex:r}=e;if(this.getHeaderRowType(r)===ea.COLUMN_GROUP){const e=i;if(e.isPadding()&&this.isAnyChildSpanningHeaderHeight(e)){const{nextFocusColumn:s,nextRow:o}=this.getColumnVisibleChild(e,r,t);s&&(i=s,r=o)}}return{column:i,headerRowIndex:r}}isAnyChildSpanningHeaderHeight(e){return!!e&&e.getLeafColumns().some(e=>e.isSpanHeaderHeight())}getColumnVisibleParent(e,t){const i=this.getHeaderRowType(t),s=i===ea.FLOATING_FILTER,o=i===ea.COLUMN;let r=s?e:e.getParent(),n=t-1;if(o&&this.isAnyChildSpanningHeaderHeight(e.getParent())){for(;r&&r.isPadding();)r=r.getParent(),n--;n<0&&(r=e,n=t)}return{nextFocusColumn:r,nextRow:n}}getColumnVisibleChild(e,t,i="After"){let s=e,o=t+1;if(this.getHeaderRowType(t)===ea.COLUMN_GROUP){const t=e.getLeafColumns(),r="After"===i?t[0]:ne(t);if(this.isAnyChildSpanningHeaderHeight(r.getParent())){s=r;let t=r.getParent();for(;t&&t!==e;)t=t.getParent(),o++}else s=e.getDisplayedChildren()[0]}return{nextFocusColumn:s,nextRow:o}}getHeaderRowType(e){const t=this.ctrlsService.getHeaderRowContainerCtrl();if(t)return t.getRowType(e)}findColAtEdgeForHeaderRow(e,t){const i=this.columnModel.getAllDisplayedColumns(),s=i["start"===t?0:i.length-1];if(!s)return;const o=this.ctrlsService.getHeaderRowContainerCtrl(s.getPinned()).getRowType(e);if(o==ea.COLUMN_GROUP){return{headerRowIndex:e,column:this.columnModel.getColumnGroupAtLevel(s,e)}}return{headerRowIndex:null==o?-1:e,column:s}}};fc([j("columnModel")],wc.prototype,"columnModel",void 0),fc([j("ctrlsService")],wc.prototype,"ctrlsService",void 0),wc=fc([U("headerPositionUtils")],wc);var yc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Sc=class{buildColumnDefs(e,t,i){const s=[],o={};return e.forEach(e=>{let r=!0,n=this.createDefFromColumn(e,t,i),l=e.getOriginalParent(),a=null;for(;l;){let e=null;if(l.isPadding()){l=l.getOriginalParent();continue}const t=o[l.getGroupId()];if(t){t.children.push(n),r=!1;break}if(e=this.createDefFromGroup(l),e&&(e.children=[n],o[e.groupId]=e,n=e,l=l.getOriginalParent()),null!=l&&a===l){r=!1;break}a=l}r&&s.push(n)}),s}createDefFromGroup(e){const t=u(e.getColGroupDef(),["children"]);return t&&(t.groupId=e.getGroupId()),t}createDefFromColumn(e,t,i){const s=u(e.getColDef());return s.colId=e.getColId(),s.width=e.getActualWidth(),s.rowGroup=e.isRowGroupActive(),s.rowGroupIndex=e.isRowGroupActive()?t.indexOf(e):null,s.pivot=e.isPivotActive(),s.pivotIndex=e.isPivotActive()?i.indexOf(e):null,s.aggFunc=e.isValueActive()?e.getAggFunc():null,s.hide=!e.isVisible()||void 0,s.pinned=e.isPinned()?e.getPinned():null,s.sort=e.getSort()?e.getSort():null,s.sortIndex=null!=e.getSortIndex()?e.getSortIndex():null,s}};Sc=yc([U("columnDefFactory")],Sc);var Ec=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Rc=class{getInitialRowClasses(e){const i=[];return t(e.extraCssClass)&&i.push(e.extraCssClass),i.push("ag-row"),i.push(e.rowFocused?"ag-row-focus":"ag-row-no-focus"),e.fadeRowIn&&i.push("ag-opacity-zero"),i.push(e.rowIsEven?"ag-row-even":"ag-row-odd"),e.rowNode.isRowPinned()&&i.push("ag-row-pinned"),e.rowNode.isSelected()&&i.push("ag-row-selected"),e.rowNode.footer&&i.push("ag-row-footer"),i.push("ag-row-level-"+e.rowLevel),e.rowNode.stub&&i.push("ag-row-loading"),e.fullWidthRow&&i.push("ag-full-width-row"),e.expandable&&(i.push("ag-row-group"),i.push(e.rowNode.expanded?"ag-row-group-expanded":"ag-row-group-contracted")),e.rowNode.dragging&&i.push("ag-row-dragging"),ve(i,this.processClassesFromGridOptions(e.rowNode)),ve(i,this.preProcessRowClassRules(e.rowNode)),i.push(e.printLayout?"ag-row-position-relative":"ag-row-position-absolute"),e.firstRowOnPage&&i.push("ag-row-first"),e.lastRowOnPage&&i.push("ag-row-last"),e.fullWidthRow&&("left"===e.pinned&&i.push("ag-cell-last-left-pinned"),"right"===e.pinned&&i.push("ag-cell-first-right-pinned")),i}processClassesFromGridOptions(e){const t=[],i=e=>{"string"==typeof e?t.push(e):Array.isArray(e)&&e.forEach(e=>t.push(e))},s=this.gridOptionsService.get("rowClass");if(s){if("function"==typeof s)return console.warn("AG Grid: rowClass should not be a function, please use getRowClass instead"),[];i(s)}const o=this.gridOptionsService.getCallback("getRowClass");if(o){i(o({data:e.data,node:e,rowIndex:e.rowIndex}))}return t}preProcessRowClassRules(e){const t=[];return this.processRowClassRules(e,e=>{t.push(e)},e=>{}),t}processRowClassRules(e,t,i){const s={data:e.data,node:e,rowIndex:e.rowIndex,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context};this.stylingService.processClassRules(this.gridOptionsService.get("rowClassRules"),s,t,i)}calculateRowLevel(e){return e.group?e.level:e.parent?e.parent.level+1:0}};Ec([j("stylingService")],Rc.prototype,"stylingService",void 0),Ec([j("gridOptionsService")],Rc.prototype,"gridOptionsService",void 0),Rc=Ec([U("rowCssClassCalculator")],Rc);var Tc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let bc=class extends Le{init(){this.isAccentedSort=this.gridOptionsService.is("accentedSort"),this.primaryColumnsSortGroups=this.gridOptionsService.isColumnsSortingCoupledToGroup(),this.addManagedPropertyListener("accentedSort",e=>this.isAccentedSort=e.currentValue),this.addManagedPropertyListener("autoGroupColumnDef",()=>this.primaryColumnsSortGroups=this.gridOptionsService.isColumnsSortingCoupledToGroup())}doFullSort(e,t){const i=e.map((e,t)=>({currentPos:t,rowNode:e}));return i.sort(this.compareRowNodes.bind(this,t)),i.map(e=>e.rowNode)}compareRowNodes(e,t,i){const s=t.rowNode,o=i.rowNode;for(let t=0,i=e.length;t<i;t++){const i=e[t],r="desc"===i.sort,n=this.getValue(s,i.column),l=this.getValue(o,i.column);let a;const d=this.getComparator(i,s);a=d?d(n,l,s,o,r):Is.defaultComparator(n,l,this.isAccentedSort);if(!isNaN(a)&&0!==a)return"asc"===i.sort?a:-1*a}return t.currentPos-i.currentPos}getComparator(e,t){const i=e.column,s=i.getColDef().comparator;if(null!=s)return s;if(!i.getColDef().showRowGroup)return;const o=!t.group&&i.getColDef().field;if(!o)return;const r=this.columnModel.getPrimaryColumn(o);return r?r.getColDef().comparator:void 0}getValue(e,t){var i,s;if(!this.primaryColumnsSortGroups)return this.valueService.getValue(t,e,!1,!1);if(e.rowGroupColumn===t){if(this.gridOptionsService.isGroupUseEntireRow(this.columnModel.isPivotActive())){if(t.getColDef().keyCreator)return e.key;const s=null===(i=e.allLeafChildren)||void 0===i?void 0:i[0];return s?this.valueService.getValue(t,s,!1,!1):void 0}const o=this.columnModel.getGroupDisplayColumnForGroup(t.getId());if(!o)return;return null===(s=e.groupData)||void 0===s?void 0:s[o.getId()]}return e.group&&t.getColDef().showRowGroup?void 0:this.valueService.getValue(t,e,!1,!1)}};Tc([j("valueService")],bc.prototype,"valueService",void 0),Tc([j("columnModel")],bc.prototype,"columnModel",void 0),Tc([B],bc.prototype,"init",null),bc=Tc([U("rowNodeSorter")],bc);var Dc,Oc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Pc=Dc=class extends Le{constructor(){super(...arguments),this.ready=!1,this.readyCallbacks=[]}checkReady(){if(this.ready=null!=this.gridCtrl&&null!=this.gridBodyCtrl&&null!=this.centerRowContainerCtrl&&null!=this.leftRowContainerCtrl&&null!=this.rightRowContainerCtrl&&null!=this.bottomCenterRowContainerCtrl&&null!=this.bottomLeftRowContainerCtrl&&null!=this.bottomRightRowContainerCtrl&&null!=this.topCenterRowContainerCtrl&&null!=this.topLeftRowContainerCtrl&&null!=this.topRightRowContainerCtrl&&null!=this.stickyTopCenterRowContainerCtrl&&null!=this.stickyTopLeftRowContainerCtrl&&null!=this.stickyTopRightRowContainerCtrl&&null!=this.centerHeaderRowContainerCtrl&&null!=this.leftHeaderRowContainerCtrl&&null!=this.rightHeaderRowContainerCtrl&&null!=this.fakeHScrollComp&&null!=this.fakeVScrollComp&&null!=this.gridHeaderCtrl,this.ready){const e=this.createReadyParams();this.readyCallbacks.forEach(t=>t(e)),this.readyCallbacks.length=0}}whenReady(e){this.ready?e(this.createReadyParams()):this.readyCallbacks.push(e)}createReadyParams(){return{centerRowContainerCtrl:this.centerRowContainerCtrl,leftRowContainerCtrl:this.leftRowContainerCtrl,rightRowContainerCtrl:this.rightRowContainerCtrl,bottomCenterRowContainerCtrl:this.bottomCenterRowContainerCtrl,bottomLeftRowContainerCtrl:this.bottomLeftRowContainerCtrl,bottomRightRowContainerCtrl:this.bottomRightRowContainerCtrl,topCenterRowContainerCtrl:this.topCenterRowContainerCtrl,topLeftRowContainerCtrl:this.topLeftRowContainerCtrl,topRightRowContainerCtrl:this.topRightRowContainerCtrl,stickyTopCenterRowContainerCtrl:this.stickyTopCenterRowContainerCtrl,stickyTopLeftRowContainerCtrl:this.stickyTopLeftRowContainerCtrl,stickyTopRightRowContainerCtrl:this.stickyTopRightRowContainerCtrl,centerHeaderRowContainerCtrl:this.centerHeaderRowContainerCtrl,leftHeaderRowContainerCtrl:this.leftHeaderRowContainerCtrl,rightHeaderRowContainerCtrl:this.rightHeaderRowContainerCtrl,fakeHScrollComp:this.fakeHScrollComp,fakeVScrollComp:this.fakeVScrollComp,gridBodyCtrl:this.gridBodyCtrl,gridCtrl:this.gridCtrl,gridHeaderCtrl:this.gridHeaderCtrl}}registerFakeHScrollComp(e){this.fakeHScrollComp=e,this.checkReady()}registerFakeVScrollComp(e){this.fakeVScrollComp=e,this.checkReady()}registerGridHeaderCtrl(e){this.gridHeaderCtrl=e,this.checkReady()}registerCenterRowContainerCtrl(e){this.centerRowContainerCtrl=e,this.checkReady()}registerLeftRowContainerCtrl(e){this.leftRowContainerCtrl=e,this.checkReady()}registerRightRowContainerCtrl(e){this.rightRowContainerCtrl=e,this.checkReady()}registerTopCenterRowContainerCtrl(e){this.topCenterRowContainerCtrl=e,this.checkReady()}registerTopLeftRowContainerCon(e){this.topLeftRowContainerCtrl=e,this.checkReady()}registerTopRightRowContainerCtrl(e){this.topRightRowContainerCtrl=e,this.checkReady()}registerStickyTopCenterRowContainerCtrl(e){this.stickyTopCenterRowContainerCtrl=e,this.checkReady()}registerStickyTopLeftRowContainerCon(e){this.stickyTopLeftRowContainerCtrl=e,this.checkReady()}registerStickyTopRightRowContainerCtrl(e){this.stickyTopRightRowContainerCtrl=e,this.checkReady()}registerBottomCenterRowContainerCtrl(e){this.bottomCenterRowContainerCtrl=e,this.checkReady()}registerBottomLeftRowContainerCtrl(e){this.bottomLeftRowContainerCtrl=e,this.checkReady()}registerBottomRightRowContainerCtrl(e){this.bottomRightRowContainerCtrl=e,this.checkReady()}registerHeaderContainer(e,t){switch(t){case"left":this.leftHeaderRowContainerCtrl=e;break;case"right":this.rightHeaderRowContainerCtrl=e;break;default:this.centerHeaderRowContainerCtrl=e}this.checkReady()}registerGridBodyCtrl(e){this.gridBodyCtrl=e,this.checkReady()}registerGridCtrl(e){this.gridCtrl=e,this.checkReady()}getFakeHScrollComp(){return this.fakeHScrollComp}getFakeVScrollComp(){return this.fakeVScrollComp}getGridHeaderCtrl(){return this.gridHeaderCtrl}getGridCtrl(){return this.gridCtrl}getCenterRowContainerCtrl(){return this.centerRowContainerCtrl}getTopCenterRowContainerCtrl(){return this.topCenterRowContainerCtrl}getBottomCenterRowContainerCtrl(){return this.bottomCenterRowContainerCtrl}getStickyTopCenterRowContainerCtrl(){return this.stickyTopCenterRowContainerCtrl}getGridBodyCtrl(){return this.gridBodyCtrl}getHeaderRowContainerCtrls(){return[this.leftHeaderRowContainerCtrl,this.rightHeaderRowContainerCtrl,this.centerHeaderRowContainerCtrl]}getHeaderRowContainerCtrl(e){switch(e){case"left":return this.leftHeaderRowContainerCtrl;case"right":return this.rightHeaderRowContainerCtrl;default:return this.centerHeaderRowContainerCtrl}}};Pc.NAME="ctrlsService",Pc=Dc=Oc([U(Dc.NAME)],Pc);var Ac=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Fc=class extends Le{constructor(){super(...arguments),this.registry={}}register(e){this.registry[e.controllerName]=e.controllerClass}getInstance(e){const t=this.registry[e];if(null!=t)return new t}};Fc=Ac([U("ctrlsFactory")],Fc);var Lc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Ic extends js{constructor(e,t){super(e),this.direction=t,this.hideTimeout=null}postConstruct(){this.addManagedListener(this.eventService,_e.EVENT_SCROLL_VISIBILITY_CHANGED,this.onScrollVisibilityChanged.bind(this)),this.onScrollVisibilityChanged(),this.addOrRemoveCssClass("ag-apple-scrollbar",hi()||ci())}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.invisibleScrollbar=wi(),this.invisibleScrollbar&&(this.hideAndShowInvisibleScrollAsNeeded(),this.addActiveListenerToggles()))}addActiveListenerToggles(){const e=this.getGui();["mouseenter","mousedown","touchstart"].forEach(t=>this.addManagedListener(e,t,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!0))),["mouseleave","touchend"].forEach(t=>this.addManagedListener(e,t,()=>this.addOrRemoveCssClass("ag-scrollbar-active",!1)))}onScrollVisibilityChanged(){void 0===this.invisibleScrollbar&&this.initialiseInvisibleScrollbar(),this.animationFrameService.requestAnimationFrame(()=>this.setScrollVisible())}hideAndShowInvisibleScrollAsNeeded(){this.addManagedListener(this.eventService,_e.EVENT_BODY_SCROLL,e=>{e.direction===this.direction&&(null!==this.hideTimeout&&(window.clearTimeout(this.hideTimeout),this.hideTimeout=null),this.addOrRemoveCssClass("ag-scrollbar-scrolling",!0))}),this.addManagedListener(this.eventService,_e.EVENT_BODY_SCROLL_END,()=>{this.hideTimeout=window.setTimeout(()=>{this.addOrRemoveCssClass("ag-scrollbar-scrolling",!1),this.hideTimeout=null},400)})}attemptSettingScrollPosition(e){const t=this.getViewport();M(()=>qi(t),()=>this.setScrollPosition(e),100)}getViewport(){return this.eViewport}getContainer(){return this.eContainer}onScrollCallback(e){this.addManagedListener(this.getViewport(),"scroll",e)}}Lc([Ks("eViewport")],Ic.prototype,"eViewport",void 0),Lc([Ks("eContainer")],Ic.prototype,"eContainer",void 0),Lc([j("scrollVisibleService")],Ic.prototype,"scrollVisibleService",void 0),Lc([j("ctrlsService")],Ic.prototype,"ctrlsService",void 0),Lc([j("animationFrameService")],Ic.prototype,"animationFrameService",void 0);var Nc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Mc extends Ic{constructor(){super(Mc.TEMPLATE,"horizontal")}postConstruct(){super.postConstruct();const e=this.setFakeHScrollSpacerWidths.bind(this);this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedListener(this.eventService,_e.EVENT_PINNED_ROW_DATA_CHANGED,this.onPinnedRowDataChanged.bind(this)),this.addManagedPropertyListener("domLayout",e),this.ctrlsService.registerFakeHScrollComp(this),this.createManagedBean(new wl(e=>this.eContainer.style.width=e+"px"))}initialiseInvisibleScrollbar(){void 0===this.invisibleScrollbar&&(this.enableRtl=this.gridOptionsService.is("enableRtl"),super.initialiseInvisibleScrollbar(),this.invisibleScrollbar&&this.refreshCompBottom())}onPinnedRowDataChanged(){this.refreshCompBottom()}refreshCompBottom(){if(!this.invisibleScrollbar)return;const e=this.pinnedRowModel.getPinnedBottomTotalHeight();this.getGui().style.bottom=e+"px"}onScrollVisibilityChanged(){super.onScrollVisibilityChanged(),this.setFakeHScrollSpacerWidths()}setFakeHScrollSpacerWidths(){const e=this.scrollVisibleService.isVerticalScrollShowing();let t=this.columnModel.getDisplayedColumnsRightWidth();const i=!this.enableRtl&&e,s=this.gridOptionsService.getScrollbarWidth();i&&(t+=s),ns(this.eRightSpacer,t),this.eRightSpacer.classList.toggle("ag-scroller-corner",t<=s);let o=this.columnModel.getDisplayedColumnsLeftWidth();this.enableRtl&&e&&(o+=s),ns(this.eLeftSpacer,o),this.eLeftSpacer.classList.toggle("ag-scroller-corner",o<=s)}setScrollVisible(){const e=this.scrollVisibleService.isHorizontalScrollShowing(),t=this.invisibleScrollbar,i=this.gridOptionsService.is("suppressHorizontalScroll"),s=e&&this.gridOptionsService.getScrollbarWidth()||0,o=i?0:0===s&&t?16:s;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),ls(this.getGui(),o),ls(this.eViewport,o),ls(this.eContainer,o),this.setDisplayed(e,{skipAriaHidden:!0})}getScrollPosition(){return zi(this.getViewport(),this.enableRtl)}setScrollPosition(e){qi(this.getViewport())||this.attemptSettingScrollPosition(e),Ki(this.getViewport(),e,this.enableRtl)}}Mc.TEMPLATE='<div class="ag-body-horizontal-scroll" aria-hidden="true">\n            <div class="ag-horizontal-left-spacer" ref="eLeftSpacer"></div>\n            <div class="ag-body-horizontal-scroll-viewport" ref="eViewport">\n                <div class="ag-body-horizontal-scroll-container" ref="eContainer"></div>\n            </div>\n            <div class="ag-horizontal-right-spacer" ref="eRightSpacer"></div>\n        </div>',Nc([Ks("eLeftSpacer")],Mc.prototype,"eLeftSpacer",void 0),Nc([Ks("eRightSpacer")],Mc.prototype,"eRightSpacer",void 0),Nc([j("columnModel")],Mc.prototype,"columnModel",void 0),Nc([j("pinnedRowModel")],Mc.prototype,"pinnedRowModel",void 0),Nc([B],Mc.prototype,"postConstruct",null);var Gc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let xc=class extends Le{postConstruct(){const e=this.checkContainerWidths.bind(this);this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_CHANGED,e),this.addManagedListener(this.eventService,_e.EVENT_DISPLAYED_COLUMNS_WIDTH_CHANGED,e),this.addManagedPropertyListener("domLayout",e)}checkContainerWidths(){const e=this.gridOptionsService.isDomLayout("print"),t=e?0:this.columnModel.getDisplayedColumnsLeftWidth(),i=e?0:this.columnModel.getDisplayedColumnsRightWidth();t!=this.leftWidth&&(this.leftWidth=t,this.eventService.dispatchEvent({type:_e.EVENT_LEFT_PINNED_WIDTH_CHANGED})),i!=this.rightWidth&&(this.rightWidth=i,this.eventService.dispatchEvent({type:_e.EVENT_RIGHT_PINNED_WIDTH_CHANGED}))}getPinnedRightWidth(){return this.rightWidth}getPinnedLeftWidth(){return this.leftWidth}};Gc([j("columnModel")],xc.prototype,"columnModel",void 0),Gc([B],xc.prototype,"postConstruct",null),xc=Gc([U("pinnedWidthService")],xc);var _c=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Vc=class extends Le{constructor(){super(...arguments),this.events=[]}postConstruct(){"clientSide"==this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel)}dispatchExpanded(e){if(null==this.clientSideRowModel)return void this.eventService.dispatchEvent(e);this.events.push(e);const t=()=>{this.clientSideRowModel&&this.clientSideRowModel.onRowGroupOpened(),this.events.forEach(e=>this.eventService.dispatchEvent(e)),this.events=[]};null==this.dispatchExpandedDebounced&&(this.dispatchExpandedDebounced=this.animationFrameService.debounce(t)),this.dispatchExpandedDebounced()}};_c([j("animationFrameService")],Vc.prototype,"animationFrameService",void 0),_c([j("rowModel")],Vc.prototype,"rowModel",void 0),_c([B],Vc.prototype,"postConstruct",null),Vc=_c([U("rowNodeEventThrottle")],Vc);var Hc,kc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},Bc=function(e,t){return function(i,s){t(i,s,e)}};function Wc(e){return!0===e||"true"===e}let Uc=Hc=class{constructor(){this.destroyed=!1,this.domDataKey="__AG_"+Math.random().toString(),this.propertyEventService=new X,this.globalEventHandlerFactory=e=>(t,i)=>{if(this.destroyed)return;const s=Hc.alwaysSyncGlobalEvents.has(t);if(s&&!e||!s&&e)return;const o=Je.getCallbackForEvent(t);"function"==typeof this.gridOptions[o]&&this.gridOptions[o](i)}}get context(){return this.gridOptions.context}agWire(e,t){this.gridOptions.api=e,this.gridOptions.columnApi=t,this.api=e,this.columnApi=t}init(){this.gridOptionLookup=new Set([...Je.ALL_PROPERTIES,...Je.EVENT_CALLBACKS]);const e=!this.is("suppressAsyncEvents");this.eventService.addGlobalListener(this.globalEventHandlerFactory().bind(this),e),this.eventService.addGlobalListener(this.globalEventHandlerFactory(!0).bind(this),!1),this.getScrollbarWidth()}destroy(){this.gridOptions.api=null,this.gridOptions.columnApi=null,this.destroyed=!0}is(e){return Wc(this.gridOptions[e])}get(e){return this.gridOptions[e]}getNum(e){return"number"==typeof(t=this.gridOptions[e])?t:"string"==typeof t?parseInt(t,10):void 0;var t}getCallback(e){return this.mergeGridCommonParams(this.gridOptions[e])}exists(e){return t(this.gridOptions[e])}mergeGridCommonParams(e){if(e){return t=>{const i=t;return i.api=this.api,i.columnApi=this.columnApi,i.context=this.context,e(i)}}return e}__setPropertyOnly(e,t){const i=this.gridOptions[e];return this.gridOptionLookup.has(e)&&(this.gridOptions[e]=t),i!==t}set(e,t,i=!1,s={},o){if(this.gridOptionLookup.has(e)){const r=this.gridOptions[e];if(i||r!==t){this.gridOptions[e]=t;const i=Object.assign({type:e,currentValue:t,previousValue:r,changeSet:o},s);this.propertyEventService.dispatchEvent(i)}}}addEventListener(e,t){this.propertyEventService.addEventListener(e,t)}removeEventListener(e,t){this.propertyEventService.removeEventListener(e,t)}getGridId(){return this.api.getGridId()}getScrollbarWidth(){if(null==this.scrollbarWidth){const e="number"==typeof this.gridOptions.scrollbarWidth&&this.gridOptions.scrollbarWidth>=0?this.gridOptions.scrollbarWidth:vi();null!=e&&(this.scrollbarWidth=e,this.eventService.dispatchEvent({type:_e.EVENT_SCROLLBAR_WIDTH_CHANGED}))}return this.scrollbarWidth}isRowModelType(e){return this.gridOptions.rowModelType===e||"clientSide"===e&&i(this.gridOptions.rowModelType)}isDomLayout(e){var t;return(null!==(t=this.gridOptions.domLayout)&&void 0!==t?t:"normal")===e}isRowSelection(){return"single"===this.gridOptions.rowSelection||"multiple"===this.gridOptions.rowSelection}useAsyncEvents(){return!this.is("suppressAsyncEvents")}isGetRowHeightFunction(){return"function"==typeof this.gridOptions.getRowHeight}getRowHeightForNode(e,t=!1,i){if(null==i&&(i=this.environment.getDefaultRowHeight()),this.isGetRowHeightFunction()){if(t)return{height:i,estimated:!0};const s={node:e,data:e.data},o=this.getCallback("getRowHeight")(s);if(this.isNumeric(o))return 0===o&&T(()=>console.warn("AG Grid: The return of `getRowHeight` cannot be zero. If the intention is to hide rows, use a filter instead."),"invalidRowHeight"),{height:Math.max(1,o),estimated:!1}}if(e.detail&&this.is("masterDetail"))return this.getMasterDetailRowHeight();return{height:this.gridOptions.rowHeight&&this.isNumeric(this.gridOptions.rowHeight)?this.gridOptions.rowHeight:i,estimated:!1}}getMasterDetailRowHeight(){return this.is("detailRowAutoHeight")?{height:1,estimated:!1}:this.isNumeric(this.gridOptions.detailRowHeight)?{height:this.gridOptions.detailRowHeight,estimated:!1}:{height:300,estimated:!1}}getRowHeightAsNumber(){if(!this.gridOptions.rowHeight||i(this.gridOptions.rowHeight))return this.environment.getDefaultRowHeight();const e=this.environment.refreshRowHeightVariable();return-1!==e?e:(console.warn("AG Grid row height must be a number if not using standard row model"),this.environment.getDefaultRowHeight())}isNumeric(e){return!isNaN(e)&&"number"==typeof e&&isFinite(e)}getDomDataKey(){return this.domDataKey}getDomData(e,t){const i=e[this.getDomDataKey()];return i?i[t]:void 0}setDomData(e,t,s){const o=this.getDomDataKey();let r=e[o];i(r)&&(r={},e[o]=r),r[t]=s}getDocument(){let e=null;return this.gridOptions.getDocument&&t(this.gridOptions.getDocument)?e=this.gridOptions.getDocument():this.eGridDiv&&(e=this.eGridDiv.ownerDocument),e&&t(e)?e:document}getWindow(){return this.getDocument().defaultView||window}getRootNode(){return this.eGridDiv.getRootNode()}getAsyncTransactionWaitMillis(){return t(this.gridOptions.asyncTransactionWaitMillis)?this.gridOptions.asyncTransactionWaitMillis:50}isAnimateRows(){return!this.is("ensureDomOrder")&&this.is("animateRows")}isGroupRowsSticky(){return!(this.is("suppressGroupRowsSticky")||this.is("paginateChildRows")||this.is("groupHideOpenParents"))}isColumnsSortingCoupledToGroup(){const e=this.gridOptions.autoGroupColumnDef;return this.isRowModelType("clientSide")&&!(null==e?void 0:e.comparator)&&!this.is("treeData")}getGroupAggFiltering(){const e=this.gridOptions.groupAggFiltering;return"function"==typeof e?this.getCallback("groupAggFiltering"):Wc(e)?()=>!0:void 0}isGroupIncludeFooterTrueOrCallback(){const e=this.gridOptions.groupIncludeFooter;return Wc(e)||"function"==typeof e}getGroupIncludeFooter(){const e=this.gridOptions.groupIncludeFooter;return"function"==typeof e?this.getCallback("groupIncludeFooter"):Wc(e)?()=>!0:()=>!1}isGroupMultiAutoColumn(){return this.gridOptions.groupDisplayType?lt("multipleColumns",this.gridOptions.groupDisplayType):this.is("groupHideOpenParents")}isGroupUseEntireRow(e){return!e&&(!!this.gridOptions.groupDisplayType&&lt("groupRows",this.gridOptions.groupDisplayType))}};Uc.alwaysSyncGlobalEvents=new Set([_e.EVENT_GRID_PRE_DESTROYED]),kc([j("gridOptions")],Uc.prototype,"gridOptions",void 0),kc([j("eventService")],Uc.prototype,"eventService",void 0),kc([j("environment")],Uc.prototype,"environment",void 0),kc([j("eGridDiv")],Uc.prototype,"eGridDiv",void 0),kc([Bc(0,Y("gridApi")),Bc(1,Y("columnApi"))],Uc.prototype,"agWire",null),kc([B],Uc.prototype,"init",null),kc([W],Uc.prototype,"destroy",null),Uc=Hc=kc([U("gridOptionsService")],Uc);var jc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let zc=class extends Le{getLocaleTextFunc(){const e=this.gridOptionsService.getCallback("getLocaleText");if(e)return(t,i,s)=>e({key:t,defaultValue:i,variableValues:s});const t=this.gridOptionsService.get("localeText");return(e,i,s)=>{let o=t&&t[e];if(o&&s&&s.length){let e=0;for(;!(e>=s.length);){if(-1===o.indexOf("${variable}"))break;o=o.replace("${variable}",s[e++])}}return null!=o?o:i}}};zc=jc([U("localeService")],zc);var Kc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Yc extends Ic{constructor(){super(Yc.TEMPLATE,"vertical")}postConstruct(){super.postConstruct(),this.createManagedBean(new ml(this.eContainer)),this.ctrlsService.registerFakeVScrollComp(this),this.addManagedListener(this.eventService,_e.EVENT_ROW_CONTAINER_HEIGHT_CHANGED,this.onRowContainerHeightChanged.bind(this))}setScrollVisible(){const e=this.scrollVisibleService.isVerticalScrollShowing(),t=this.invisibleScrollbar,i=e&&this.gridOptionsService.getScrollbarWidth()||0,s=0===i&&t?16:i;this.addOrRemoveCssClass("ag-scrollbar-invisible",t),ns(this.getGui(),s),ns(this.eViewport,s),ns(this.eContainer,s),this.setDisplayed(e,{skipAriaHidden:!0})}onRowContainerHeightChanged(){const e=this.ctrlsService.getGridBodyCtrl().getBodyViewportElement();this.eViewport.scrollTop!=e.scrollTop&&(this.eViewport.scrollTop=e.scrollTop)}getScrollPosition(){return this.getViewport().scrollTop}setScrollPosition(e){qi(this.getViewport())||this.attemptSettingScrollPosition(e),this.getViewport().scrollTop=e}}Yc.TEMPLATE='<div class="ag-body-vertical-scroll" aria-hidden="true">\n            <div class="ag-body-vertical-scroll-viewport" ref="eViewport">\n                <div class="ag-body-vertical-scroll-container" ref="eContainer"></div>\n            </div>\n        </div>',Kc([B],Yc.prototype,"postConstruct",null);var $c=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};const qc={january:"January",february:"February",march:"March",april:"April",may:"May",june:"June",july:"July",august:"August",september:"September",october:"October",november:"November",december:"December"},Qc=["january","february","march","april","may","june","july","august","september","october","november","december"];let Xc=class extends Le{constructor(){super(...arguments),this.dataTypeDefinitions={},this.isWaitingForRowData=!1,this.isColumnTypeOverrideInDataTypeDefinitions=!1,this.columnStateUpdatesPendingInference={},this.columnStateUpdateListenerDestroyFuncs=[]}init(){this.groupHideOpenParents=this.gridOptionsService.is("groupHideOpenParents"),this.addManagedPropertyListener("groupHideOpenParents",()=>{this.groupHideOpenParents=this.gridOptionsService.is("groupHideOpenParents")}),this.processDataTypeDefinitions(),this.addManagedPropertyListener("dataTypeDefinitions",()=>{this.processDataTypeDefinitions(),this.columnModel.recreateColumnDefs("gridOptionsChanged")})}processDataTypeDefinitions(){var e;const t=this.getDefaultDataTypes();this.dataTypeDefinitions={},Object.entries(t).forEach(([e,t])=>{this.dataTypeDefinitions[e]=Object.assign(Object.assign({},t),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(t)})});const i=null!==(e=this.gridOptionsService.get("dataTypeDefinitions"))&&void 0!==e?e:{};this.dataTypeMatchers={},Object.entries(i).forEach(([e,s])=>{const o=this.processDataTypeDefinition(s,i,[e],t);o&&(this.dataTypeDefinitions[e]=o,s.dataTypeMatcher&&(this.dataTypeMatchers[e]=s.dataTypeMatcher))}),this.checkObjectValueHandlers(t),["dateString","text","number","boolean","date"].forEach(e=>{const i=this.dataTypeMatchers[e];i&&delete this.dataTypeMatchers[e],this.dataTypeMatchers[e]=null!=i?i:t[e].dataTypeMatcher})}mergeDataTypeDefinitions(e,t){const i=Object.assign(Object.assign({},e),t);return e.columnTypes&&t.columnTypes&&t.appendColumnTypes&&(i.columnTypes=[...this.convertColumnTypes(e.columnTypes),...this.convertColumnTypes(t.columnTypes)]),i}processDataTypeDefinition(e,t,i,s){let o;const r=e.extendsDataType;if(e.columnTypes&&(this.isColumnTypeOverrideInDataTypeDefinitions=!0),e.extendsDataType===e.baseDataType){const t=s[r];if(!this.validateDataTypeDefinition(e,t,r))return;o=this.mergeDataTypeDefinitions(t,e)}else{if(i.includes(r))return void T(()=>console.warn('AG Grid: Data type definition hierarchies (via the "extendsDataType" property) cannot contain circular references.'),"dataTypeExtendsCircularRef");const n=t[r];if(!this.validateDataTypeDefinition(e,n,r))return;const l=this.processDataTypeDefinition(n,t,[...i,r],s);if(!l)return;o=this.mergeDataTypeDefinitions(l,e)}return Object.assign(Object.assign({},o),{groupSafeValueFormatter:this.createGroupSafeValueFormatter(o)})}validateDataTypeDefinition(e,t,i){return t?t.baseDataType===e.baseDataType||(T(()=>console.warn('AG Grid: The "baseDataType" property of a data type definition must match that of its parent.'),"dataTypeBaseTypesMatch"),!1):(T(()=>console.warn(`AG Grid: The data type definition ${i} does not exist.`),"dataTypeDefMissing"+i),!1)}createGroupSafeValueFormatter(e){if(e.valueFormatter)return t=>{var i,s;if(!(null===(i=t.node)||void 0===i?void 0:i.group))return this.groupHideOpenParents&&t.column.isRowGroupActive()?"string"!=typeof t.value||(null===(s=e.dataTypeMatcher)||void 0===s?void 0:s.call(e,t.value))?e.valueFormatter(t):void 0:e.valueFormatter(t);{const i=t.column.getAggFunc();if(i){if("first"===i||"last"===i)return e.valueFormatter(t);if("number"===e.baseDataType&&"count"!==i){if("number"==typeof t.value)return e.valueFormatter(t);if("object"==typeof t.value){if(!t.value)return;if("toNumber"in t.value)return e.valueFormatter(Object.assign(Object.assign({},t),{value:t.value.toNumber()}));if("value"in t.value)return e.valueFormatter(Object.assign(Object.assign({},t),{value:t.value.value}))}}}}}}updateColDefAndGetDataTypeDefinitionColumnType(e,t,i){let{cellDataType:s}=t;const{field:o}=t;if(void 0===s&&(s=e.cellDataType),null!=s&&!0!==s||(s=!!this.canInferCellDataType(e,t)&&this.inferCellDataType(o,i)),!s)return void(e.cellDataType=!1);const r=this.dataTypeDefinitions[s];if(r)return e.cellDataType=s,r.groupSafeValueFormatter&&(e.valueFormatter=r.groupSafeValueFormatter),r.valueParser&&(e.valueParser=r.valueParser),r.suppressDefaultProperties||this.setColDefPropertiesForBaseDataType(e,r,i),r.columnTypes;T(()=>console.warn(`AG Grid: Missing data type definition - "${s}"`),"dataTypeMissing"+s)}updateColDefAndGetColumnType(e,t,i){var s,o;const r=this.updateColDefAndGetDataTypeDefinitionColumnType(e,t,i),n=null!==(o=null!==(s=t.type)&&void 0!==s?s:r)&&void 0!==o?o:e.type;return e.type=n,n?this.convertColumnTypes(n):void 0}addColumnListeners(e){if(!this.isWaitingForRowData)return;const t=this.columnStateUpdatesPendingInference[e.getColId()];if(!t)return;const i=e=>{t.add(e.key)};e.addEventListener(te.EVENT_STATE_UPDATED,i),this.columnStateUpdateListenerDestroyFuncs.push(()=>e.removeEventListener(te.EVENT_STATE_UPDATED,i))}canInferCellDataType(e,t){var i;if("clientSide"!==this.rowModel.getType())return!1;const s={cellRenderer:!0,valueGetter:!0,valueParser:!0,refData:!0};if(this.doColDefPropsPreventInference(t,s))return!1;const o=null===t.type?e.type:t.type;if(o){const e=null!==(i=this.gridOptionsService.get("columnTypes"))&&void 0!==i?i:{};if(this.convertColumnTypes(o).some(t=>{const i=e[t.trim()];return i&&this.doColDefPropsPreventInference(i,s)}))return!1}return!this.doColDefPropsPreventInference(e,s)}doColDefPropsPreventInference(e,t){return[["cellRenderer","agSparklineCellRenderer"],["valueGetter",void 0],["valueParser",void 0],["refData",void 0]].some(([i,s])=>this.doesColDefPropPreventInference(e,t,i,s))}doesColDefPropPreventInference(e,t,i,s){if(!t[i])return!1;const o=e[i];return null===o?(t[i]=!1,!1):void 0===s?!!o:o===s}inferCellDataType(e,t){var i;if(!e)return;let s;const o=this.getInitialData();if(o){const t=e.indexOf(".")>=0&&!this.gridOptionsService.is("suppressFieldDotNotation");s=w(o,e,t)}else this.initWaitForRowData(t);if(null==s)return;const[r]=null!==(i=Object.entries(this.dataTypeMatchers).find(([e,t])=>t(s)))&&void 0!==i?i:["object"];return r}getInitialData(){const e=this.gridOptionsService.get("rowData");if(null==e?void 0:e.length)return e[0];if(this.initialData)return this.initialData;{const e=this.rowModel.getRootNode().allLeafChildren;if(null==e?void 0:e.length)return e[0].data}return null}initWaitForRowData(e){if(this.columnStateUpdatesPendingInference[e]=new Set,this.isWaitingForRowData)return;this.isWaitingForRowData=!0;const t=this.isColumnTypeOverrideInDataTypeDefinitions;t&&this.columnModel.queueResizeOperations();const i=this.addManagedListener(this.eventService,_e.EVENT_ROW_DATA_UPDATE_STARTED,e=>{const{firstRowData:s}=e;if(!s)return;null==i||i(),this.isWaitingForRowData=!1,this.processColumnsPendingInference(s,t),this.columnStateUpdatesPendingInference={},t&&this.columnModel.processResizeOperations();const o={type:_e.EVENT_DATA_TYPES_INFERRED};this.eventService.dispatchEvent(o)})}isPendingInference(){return this.isWaitingForRowData}processColumnsPendingInference(e,t){this.initialData=e;const i=[];this.columnStateUpdateListenerDestroyFuncs.forEach(e=>e()),this.columnStateUpdateListenerDestroyFuncs=[];const s={},o={};Object.entries(this.columnStateUpdatesPendingInference).forEach(([e,r])=>{const n=this.columnModel.getGridColumn(e);if(!n)return;const l=n.getColDef();if(!this.columnModel.resetColumnDefIntoColumn(n))return;const a=n.getColDef();if(t&&a.type&&a.type!==l.type){const t=this.getUpdatedColumnState(n,r);t.rowGroup&&null==t.rowGroupIndex&&(s[e]=t),t.pivot&&null==t.pivotIndex&&(o[e]=t),i.push(t)}}),t&&i.push(...this.columnModel.generateColumnStateForRowGroupAndPivotIndexes(s,o)),i.length&&this.columnModel.applyColumnState({state:i},"cellDataTypeInferred"),this.initialData=null}getUpdatedColumnState(e,t){const i=this.columnModel.getColumnStateFromColDef(e);return t.forEach(e=>{delete i[e],"rowGroup"===e?delete i.rowGroupIndex:"pivot"===e&&delete i.pivotIndex}),i}checkObjectValueHandlers(e){const t=this.dataTypeDefinitions.object,i=e.object;this.hasObjectValueParser=t.valueParser!==i.valueParser,this.hasObjectValueFormatter=t.valueFormatter!==i.valueFormatter}convertColumnTypes(e){let t=[];if(e instanceof Array){e.some(e=>"string"!=typeof e)?console.warn("AG Grid: if colDef.type is supplied an array it should be of type 'string[]'"):t=e}else"string"==typeof e?t=e.split(","):console.warn("AG Grid: colDef.type should be of type 'string' | 'string[]'");return t}getDateStringTypeDefinition(){return this.dataTypeDefinitions.dateString}getDateParserFunction(){return this.getDateStringTypeDefinition().dateParser}getDateFormatterFunction(){return this.getDateStringTypeDefinition().dateFormatter}getDataTypeDefinition(e){const t=e.getColDef();if(t.cellDataType)return this.dataTypeDefinitions[t.cellDataType]}getBaseDataType(e){var t;return null===(t=this.getDataTypeDefinition(e))||void 0===t?void 0:t.baseDataType}checkType(e,t){var i;if(null==t)return!0;const s=null===(i=this.getDataTypeDefinition(e))||void 0===i?void 0:i.dataTypeMatcher;return!s||s(t)}validateColDef(e){"object"===e.cellDataType&&(e.valueFormatter!==this.dataTypeDefinitions.object.groupSafeValueFormatter||this.hasObjectValueFormatter||T(()=>console.warn('AG Grid: Cell data type is "object" but no value formatter has been provided. Please either provide an object data type definition with a value formatter, or set "colDef.valueFormatter"'),"dataTypeObjectValueFormatter"),e.editable&&e.valueParser===this.dataTypeDefinitions.object.valueParser&&!this.hasObjectValueParser&&T(()=>console.warn('AG Grid: Cell data type is "object" but no value parser has been provided. Please either provide an object data type definition with a value parser, or set "colDef.valueParser"'),"dataTypeObjectValueParser"))}setColDefPropertiesForBaseDataType(e,i,s){const o=(e,t,s)=>{let o=e.getColDef().valueFormatter;return o===i.groupSafeValueFormatter&&(o=i.valueFormatter),this.valueFormatterService.formatValue(e,t,s,o)},r=V.__isRegistered(x.SetFilterModule,this.context.getGridId()),n=this.localeService.getLocaleTextFunc(),l=t=>{const{filterParams:i}=e;e.filterParams="object"==typeof i?Object.assign(Object.assign({},i),t):t};switch(e.useValueFormatterForExport=!0,e.useValueParserForImport=!0,i.baseDataType){case"number":e.cellEditor="agNumberCellEditor",r&&l({comparator:(e,t)=>{const i=null==e?0:parseInt(e),s=null==t?0:parseInt(t);return i===s?0:i>s?1:-1}});break;case"boolean":e.cellEditor="agCheckboxCellEditor",e.cellRenderer="agCheckboxCellRenderer",e.suppressKeyboardEvent=e=>!!e.colDef.editable&&e.event.key===ys.SPACE,l(r?{valueFormatter:e=>t(e.value)?n(String(e.value),e.value?"True":"False"):n("blanks","(Blanks)")}:{maxNumConditions:1,filterOptions:["empty",{displayKey:"true",displayName:"True",predicate:(e,t)=>t,numberOfInputs:0},{displayKey:"false",displayName:"False",predicate:(e,t)=>!1===t,numberOfInputs:0}]});break;case"date":e.cellEditor="agDateCellEditor",e.keyCreator=e=>o(e.column,e.node,e.value),r&&l({valueFormatter:e=>{const i=o(e.column,e.node,e.value);return t(i)?i:n("blanks","(Blanks)")},treeList:!0,treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=Qc[Number(e)-1];return n(t,qc[t])}return null!=e?e:n("blanks","(Blanks)")}});break;case"dateString":{e.cellEditor="agDateStringCellEditor",e.keyCreator=e=>o(e.column,e.node,e.value);const i=this.getDateParserFunction();l(r?{valueFormatter:e=>{const i=o(e.column,e.node,e.value);return t(i)?i:n("blanks","(Blanks)")},treeList:!0,treeListPathGetter:e=>{const t=i(null!=e?e:void 0);return t?[String(t.getFullYear()),String(t.getMonth()+1),String(t.getDate())]:null},treeListFormatter:(e,t)=>{if(1===t&&null!=e){const t=Qc[Number(e)-1];return n(t,qc[t])}return null!=e?e:n("blanks","(Blanks)")}}:{comparator:(e,t)=>{const s=i(t);return null==t||s<e?-1:s>e?1:0}});break}case"object":e.cellEditorParams={useFormatter:!0},e.comparator=(e,t)=>{const i=this.columnModel.getPrimaryColumn(s),r=null==i?void 0:i.getColDef();if(!i||!r)return 0;const n=null==e?"":o(i,null,e),l=null==t?"":o(i,null,t);return n===l?0:n>l?1:-1},e.keyCreator=e=>o(e.column,e.node,e.value),r?l({valueFormatter:e=>{const i=o(e.column,e.node,e.value);return t(i)?i:n("blanks","(Blanks)")}}):e.filterValueGetter=e=>o(e.column,e.node,this.valueService.getValue(e.column,e.node))}}getDefaultDataTypes(){const e=e=>!!e.match("^\\d{4}-\\d{2}-\\d{2}$"),t=this.localeService.getLocaleTextFunc();return{number:{baseDataType:"number",valueParser:e=>""===e.newValue?null:Number(e.newValue),valueFormatter:e=>null==e.value?"":"number"!=typeof e.value||isNaN(e.value)?t("invalidNumber","Invalid Number"):String(e.value),dataTypeMatcher:e=>"number"==typeof e},text:{baseDataType:"text",valueParser:e=>""===e.newValue?null:o(e.newValue),dataTypeMatcher:e=>"string"==typeof e},boolean:{baseDataType:"boolean",valueParser:e=>""===e.newValue?null:"true"===String(e.newValue).toLowerCase(),valueFormatter:e=>null==e.value?"":String(e.value),dataTypeMatcher:e=>"boolean"==typeof e},date:{baseDataType:"date",valueParser:e=>Pi(null==e.newValue?null:String(e.newValue)),valueFormatter:e=>{var i;return null==e.value?"":e.value instanceof Date&&!isNaN(e.value.getTime())?null!==(i=bi(e.value,!1))&&void 0!==i?i:"":t("invalidDate","Invalid Date")},dataTypeMatcher:e=>e instanceof Date},dateString:{baseDataType:"dateString",dateParser:e=>{var t;return null!==(t=Pi(e))&&void 0!==t?t:void 0},dateFormatter:e=>{var t;return null!==(t=bi(null!=e?e:null,!1))&&void 0!==t?t:void 0},valueParser:t=>e(String(t.newValue))?t.newValue:null,valueFormatter:t=>e(String(t.value))?t.value:"",dataTypeMatcher:t=>"string"==typeof t&&e(t)},object:{baseDataType:"object",valueParser:()=>null,valueFormatter:e=>{var t;return null!==(t=o(e.value))&&void 0!==t?t:""}}}}};$c([j("rowModel")],Xc.prototype,"rowModel",void 0),$c([j("columnModel")],Xc.prototype,"columnModel",void 0),$c([j("columnUtils")],Xc.prototype,"columnUtils",void 0),$c([j("valueService")],Xc.prototype,"valueService",void 0),$c([j("valueFormatterService")],Xc.prototype,"valueFormatterService",void 0),$c([B],Xc.prototype,"init",null),Xc=$c([U("dataTypeService")],Xc);var Jc=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Zc=class extends Le{parseValue(e,i,s,o){const r=e.getColDef(),n={node:i,data:null==i?void 0:i.data,oldValue:o,newValue:s,colDef:r,column:e,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context},l=r.valueParser;return t(l)?"function"==typeof l?l(n):this.expressionService.evaluate(l,n):s}};Jc([j("expressionService")],Zc.prototype,"expressionService",void 0),Zc=Jc([U("valueParserService")],Zc);class eu{constructor(e,t,i){t?(this.gridOptions=t,(new iu).create(e,t,t=>{const i=new Lh(e);t.createBean(i)},void 0,i)):console.error("AG Grid: no gridOptions provided to the grid")}destroy(){this.gridOptions&&this.gridOptions.api&&this.gridOptions.api.destroy()}}let tu=1;class iu{create(e,t,i,s,o){var r;const n=!!t.debug,l=null!==(r=t.gridId)&&void 0!==r?r:String(tu++),a=this.getRegisteredModules(o,l),d=this.createBeansList(t.rowModelType,a,l),h=this.createProvidedBeans(e,t,o);if(!d)return;const c={providedBeanInstances:h,beanClasses:d,debug:n,gridId:l},u=new Oh("AG Grid",()=>t.debug),p=new Oh("Context",()=>c.debug),g=new H(c,p),m=g.getBean("beans");this.registerModuleUserComponents(m,a),this.registerStackComponents(m,a),this.registerControllers(m,a),i(g),m.ctrlsService.whenReady(()=>{this.setColumnsAndData(m),this.dispatchGridReadyEvent(m);const e=V.__isRegistered(x.EnterpriseCoreModule,l);u.log("initialised successfully, enterprise = "+e)}),s&&s(g)}registerControllers(e,t){t.forEach(t=>{t.controllers&&t.controllers.forEach(t=>e.ctrlsFactory.register(t))})}registerStackComponents(e,t){const i=this.createAgStackComponentsList(t);e.agStackComponentsRegistry.setupComponents(i)}getRegisteredModules(e,t){const i=e?e.modules:null,s=V.__getRegisteredModules(t),o=[],r={},n=(e,t,i)=>{var s;r[(s=t).moduleName]||(r[s.moduleName]=!0,o.push(s),V.__register(s,e,i)),t.dependantModules&&t.dependantModules.forEach(t=>n(e,t,i))};return i&&i.forEach(e=>n(!0,e,t)),s&&s.forEach(e=>n(!V.__isPackageBased(),e,void 0)),o}registerModuleUserComponents(e,t){this.extractModuleEntity(t,e=>e.userComponents?e.userComponents:[]).forEach(t=>{e.userComponentRegistry.registerDefaultComponent(t.componentName,t.componentClass)})}createProvidedBeans(e,t,s){let o=s?s.frameworkOverrides:null;i(o)&&(o=new nh);const r={gridOptions:t,eGridDiv:e,globalEventListener:s?s.globalEventListener:null,globalSyncEventListener:s?s.globalSyncEventListener:null,frameworkOverrides:o};return s&&s.providedBeanInstances&&Object.assign(r,s.providedBeanInstances),r}createAgStackComponentsList(e){let t=[{componentName:"AgCheckbox",componentClass:Co},{componentName:"AgRadioButton",componentClass:vo},{componentName:"AgToggleButton",componentClass:Rd},{componentName:"AgInputTextField",componentClass:Ao},{componentName:"AgInputTextArea",componentClass:Td},{componentName:"AgInputNumberField",componentClass:Fo},{componentName:"AgInputDateField",componentClass:bd},{componentName:"AgInputRange",componentClass:Dd},{componentName:"AgRichSelect",componentClass:Nd},{componentName:"AgSelect",componentClass:po},{componentName:"AgSlider",componentClass:Gd},{componentName:"AgGridBody",componentClass:Al},{componentName:"AgHeaderRoot",componentClass:Ua},{componentName:"AgSortIndicator",componentClass:jo},{componentName:"AgPagination",componentClass:rc},{componentName:"AgOverlayWrapper",componentClass:ac},{componentName:"AgGroupComponent",componentClass:_d},{componentName:"AgPanel",componentClass:zd},{componentName:"AgDialog",componentClass:Yd},{componentName:"AgRowContainer",componentClass:Wl},{componentName:"AgFakeHorizontalScroll",componentClass:Mc},{componentName:"AgFakeVerticalScroll",componentClass:Yc},{componentName:"AgAutocomplete",componentClass:sh}];const i=this.extractModuleEntity(e,e=>e.agStackComponents?e.agStackComponents:[]);return t=t.concat(i),t}createBeansList(e="clientSide",t,i){const s=t.filter(t=>!t.rowModel||t.rowModel===e),o={clientSide:x.ClientSideRowModelModule,infinite:x.InfiniteRowModelModule,serverSide:x.ServerSideRowModelModule,viewport:x.ViewportRowModelModule};if(!o[e])return void console.error("AG Grid: could not find row model for rowModelType = "+e);if(!V.__assertRegistered(o[e],`rowModelType = '${e}'`,i))return;const r=[Qn,hc,uc,wc,kh,En,Ur,Kh,$h,Ja,hn,tc,za,zc,nt,cd,pn,mt,X,Uc,Jd,gh,On,ct,Ha,yd,nd,Sh,Me,Rh,ch,xl,Wh,fh,Dh,pt,id,Ya,Cr,Ch,Sa,Ml,Jh,ah,dd,Ed,Ll,Mh,xh,Vh,sc,Be,jh,ed,vc,vt,Sc,Rc,fd,bc,Pc,xc,Vc,Fc,Xc,Zc,bn],n=this.extractModuleEntity(s,e=>e.beans?e.beans:[]);r.push(...n);const l=[];return r.forEach(e=>{l.indexOf(e)<0&&l.push(e)}),l}extractModuleEntity(e,t){return[].concat(...e.map(t))}setColumnsAndData(e){const t=e.gridOptionsService.get("columnDefs");e.columnModel.setColumnDefs(t||[],"gridInitializing"),e.rowModel.start()}dispatchGridReadyEvent(e){const t={type:_e.EVENT_GRID_READY};e.eventService.dispatchEvent(t)}}class su{wrap(e,t,i=[],s){const o=this.createWrapper(e,s);return t.forEach(e=>{this.createMethod(o,e,!0)}),i.forEach(e=>{this.createMethod(o,e,!1)}),o}unwrap(e){return e}createMethod(e,t,i){e.addMethod(t,this.createMethodProxy(e,t,i))}createMethodProxy(e,t,i){return function(){return e.hasMethod(t)?e.callMethod(t,arguments):(i&&console.warn("AG Grid: Framework component is missing the method "+t+"()"),null)}}}const ou={columnGroup:["column","stackedColumn","normalizedColumn"],barGroup:["bar","stackedBar","normalizedBar"],pieGroup:["pie","doughnut"],lineGroup:["line"],scatterGroup:["scatter","bubble"],areaGroup:["area","stackedArea","normalizedArea"],histogramGroup:["histogram"],combinationGroup:["columnLineCombo","areaColumnCombo","customCombo"]},ru=["chartSettings","chartData","chartFormat"],nu=["chartUnlink","chartLink","chartDownload"],lu={settings:"chartSettings",data:"chartData",format:"chartFormat"},au=0;var du;!function(e){e.InsideBase="insideBase",e.InsideEnd="insideEnd",e.Center="center",e.OutsideEnd="outsideEnd"}(du||(du={}));
/**
 * @ag-grid-community/core - Advanced Data Grid / Data Table supporting Javascript / Typescript / React / Angular / Vue
 * @version v30.2.1
 * @link https://www.ag-grid.com/
 * @license MIT
 */
const hu="undefined"==typeof global?{}:global;hu.HTMLElement="undefined"==typeof HTMLElement?{}:HTMLElement,hu.HTMLButtonElement="undefined"==typeof HTMLButtonElement?{}:HTMLButtonElement,hu.HTMLSelectElement="undefined"==typeof HTMLSelectElement?{}:HTMLSelectElement,hu.HTMLInputElement="undefined"==typeof HTMLInputElement?{}:HTMLInputElement,hu.Node="undefined"==typeof Node?{}:Node,hu.MouseEvent="undefined"==typeof MouseEvent?{}:MouseEvent;class cu{constructor(e,t,i,s,o,r){this.nextId=0,this.allNodesMap={},this.rootNode=e,this.gridOptionsService=t,this.eventService=i,this.columnModel=s,this.beans=r,this.selectionService=o,this.rootNode.group=!0,this.rootNode.level=-1,this.rootNode.id=cu.ROOT_NODE_ID,this.rootNode.allLeafChildren=[],this.rootNode.childrenAfterGroup=[],this.rootNode.childrenAfterSort=[],this.rootNode.childrenAfterAggFilter=[],this.rootNode.childrenAfterFilter=[],this.postConstruct()}postConstruct(){this.suppressParentsInRowNodes=this.gridOptionsService.is("suppressParentsInRowNodes"),this.isRowMasterFunc=this.gridOptionsService.get("isRowMaster"),this.doingMasterDetail=this.gridOptionsService.is("masterDetail")}getCopyOfNodesMap(){return Is.cloneObject(this.allNodesMap)}getRowNode(e){return this.allNodesMap[e]}setRowData(e){if("string"==typeof e)return void console.warn("AG Grid: rowData must be an array, however you passed in a string. If you are loading JSON, make sure you convert the JSON string to JavaScript objects first");this.dispatchRowDataUpdateStartedEvent(e);const t=this.rootNode,i=this.rootNode.sibling;t.childrenAfterFilter=null,t.childrenAfterGroup=null,t.childrenAfterAggFilter=null,t.childrenAfterSort=null,t.childrenMapped=null,t.updateHasChildren(),this.nextId=0,this.allNodesMap={},e?t.allLeafChildren=e.map(e=>this.createNode(e,this.rootNode,cu.TOP_LEVEL)):(t.allLeafChildren=[],t.childrenAfterGroup=[]),i&&(i.childrenAfterFilter=t.childrenAfterFilter,i.childrenAfterGroup=t.childrenAfterGroup,i.childrenAfterAggFilter=t.childrenAfterAggFilter,i.childrenAfterSort=t.childrenAfterSort,i.childrenMapped=t.childrenMapped,i.allLeafChildren=t.allLeafChildren)}updateRowData(e,t){this.dispatchRowDataUpdateStartedEvent(e.add);const i={remove:[],update:[],add:[]},s=[];return this.executeRemove(e,i,s),this.executeUpdate(e,i,s),this.executeAdd(e,i),this.updateSelection(s,"rowDataChanged"),t&&Is.sortRowNodesByOrder(this.rootNode.allLeafChildren,t),i}dispatchRowDataUpdateStartedEvent(e){const t={type:_e.EVENT_ROW_DATA_UPDATE_STARTED,firstRowData:(null==e?void 0:e.length)?e[0]:null};this.eventService.dispatchEvent(t)}updateSelection(e,t){const i=e.length>0;if(i&&this.selectionService.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t}),this.selectionService.updateGroupsFromChildrenSelections(t),i){const e={type:_e.EVENT_SELECTION_CHANGED,source:t};this.eventService.dispatchEvent(e)}}executeAdd(e,t){var i;const{add:s,addIndex:o}=e;if(Is.missingOrEmpty(s))return;const r=s.map(e=>this.createNode(e,this.rootNode,cu.TOP_LEVEL));if("number"==typeof o&&o>=0){const{allLeafChildren:e}=this.rootNode,t=e.length;let s=o;if(this.gridOptionsService.is("treeData")&&o>0&&t>0)for(let r=0;r<t;r++)if((null===(i=e[r])||void 0===i?void 0:i.rowIndex)==o-1){s=r+1;break}const n=e.slice(0,s),l=e.slice(s,e.length);this.rootNode.allLeafChildren=[...n,...r,...l]}else this.rootNode.allLeafChildren=[...this.rootNode.allLeafChildren,...r];this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren),t.add=r}executeRemove(e,t,i){const{remove:s}=e;if(Is.missingOrEmpty(s))return;const o={};s.forEach(e=>{const s=this.lookupRowNode(e);s&&(s.isSelected()&&i.push(s),s.clearRowTopAndRowIndex(),o[s.id]=!0,delete this.allNodesMap[s.id],t.remove.push(s))}),this.rootNode.allLeafChildren=this.rootNode.allLeafChildren.filter(e=>!o[e.id]),this.rootNode.sibling&&(this.rootNode.sibling.allLeafChildren=this.rootNode.allLeafChildren)}executeUpdate(e,t,i){const{update:s}=e;Is.missingOrEmpty(s)||s.forEach(e=>{const s=this.lookupRowNode(e);s&&(s.updateData(e),!s.selectable&&s.isSelected()&&i.push(s),this.setMasterForRow(s,e,cu.TOP_LEVEL,!1),t.update.push(s))})}lookupRowNode(e){const t=this.gridOptionsService.getCallback("getRowId");let i;if(t){const s=t({data:e,level:0});if(i=this.allNodesMap[s],!i)return console.error(`AG Grid: could not find row id=${s}, data item was not found for this id`),null}else if(i=this.rootNode.allLeafChildren.find(t=>t.data===e),!i)return console.error("AG Grid: could not find data item as object was not found",e),console.error("Consider using getRowId to help the Grid find matching row data"),null;return i||null}createNode(e,t,i){const s=new ar(this.beans);return s.group=!1,this.setMasterForRow(s,e,i,!0),t&&!this.suppressParentsInRowNodes&&(s.parent=t),s.level=i,s.setDataAndId(e,this.nextId.toString()),this.allNodesMap[s.id]&&console.warn(`AG Grid: duplicate node id '${s.id}' detected from getRowId callback, this could cause issues in your grid.`),this.allNodesMap[s.id]=s,this.nextId++,s}setMasterForRow(e,t,i,s){if(this.gridOptionsService.is("treeData"))e.setMaster(!1),s&&(e.expanded=!1);else if(this.doingMasterDetail?this.isRowMasterFunc?e.setMaster(this.isRowMasterFunc(t)):e.setMaster(!0):e.setMaster(!1),s){const t=this.columnModel.getRowGroupColumns(),s=i+(t?t.length:0);e.expanded=!!e.master&&this.isExpanded(s)}}isExpanded(e){const t=this.gridOptionsService.getNum("groupDefaultExpanded");return-1===t||e<t}}cu.TOP_LEVEL=0,cu.ROOT_NODE_ID="ROOT_NODE_ID";var uu,pu=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};!function(e){e[e.Normal=0]="Normal",e[e.AfterFilter=1]="AfterFilter",e[e.AfterFilterAndSort=2]="AfterFilterAndSort",e[e.PivotNodes=3]="PivotNodes"}(uu||(uu={}));let gu=class extends Le{constructor(){super(...arguments),this.onRowHeightChanged_debounced=Is.debounce(this.onRowHeightChanged.bind(this),100),this.rowsToDisplay=[]}init(){const e=this.refreshModel.bind(this,{step:wn.EVERYTHING}),t=!this.gridOptionsService.is("suppressAnimationFrame"),i=this.refreshModel.bind(this,{step:wn.EVERYTHING,afterColumnsChanged:!0,keepRenderedRows:!0,animate:t});this.addManagedListener(this.eventService,_e.EVENT_NEW_COLUMNS_LOADED,i),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_ROW_GROUP_CHANGED,e),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_VALUE_CHANGED,this.onValueChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_PIVOT_CHANGED,this.refreshModel.bind(this,{step:wn.PIVOT})),this.addManagedListener(this.eventService,_e.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_COLUMN_PIVOT_MODE_CHANGED,e),this.addManagedListener(this.eventService,_e.EVENT_GRID_STYLES_CHANGED,this.onGridStylesChanges.bind(this));const s=this.refreshModel.bind(this,{step:wn.MAP,keepRenderedRows:!0,animate:t});this.addManagedPropertyListeners(["groupRemoveSingleChildren","groupRemoveLowestSingleChildren","groupIncludeFooter"],s);const o=this.refreshModel.bind(this,{step:wn.AGGREGATE,keepRenderedRows:!0,animate:t});this.addManagedPropertyListeners(["groupIncludeTotalFooter"],o),this.rootNode=new ar(this.beans),this.nodeManager=new cu(this.rootNode,this.gridOptionsService,this.eventService,this.columnModel,this.selectionService,this.beans),this.addManagedPropertyListener("treeData",()=>{this.setRowData(this.rootNode.allLeafChildren.map(e=>e.data))})}start(){const e=this.gridOptionsService.get("rowData");e&&this.setRowData(e)}ensureRowHeightsValid(e,t,i,s){let o,r=!1;do{o=!1;const n=this.getRowIndexAtPixel(e),l=this.getRowIndexAtPixel(t),a=Math.max(n,i),d=Math.min(l,s);for(let e=a;e<=d;e++){const t=this.getRow(e);if(t.rowHeightEstimated){const e=this.gridOptionsService.getRowHeightForNode(t);t.setRowHeight(e.height),o=!0,r=!0}}o&&this.setRowTopAndRowIndex()}while(o);return r}setRowTopAndRowIndex(){const e=this.environment.getDefaultRowHeight();let t=0;const i=new Set,s=this.gridOptionsService.isDomLayout("normal");for(let o=0;o<this.rowsToDisplay.length;o++){const r=this.rowsToDisplay[o];if(null!=r.id&&i.add(r.id),null==r.rowHeight){const t=this.gridOptionsService.getRowHeightForNode(r,s,e);r.setRowHeight(t.height,t.estimated)}r.setRowTop(t),r.setRowIndex(o),t+=r.rowHeight}return i}clearRowTopAndRowIndex(e,t){const i=e.isActive(),s=e=>{e&&null!=e.id&&!t.has(e.id)&&e.clearRowTopAndRowIndex()},o=e=>{if(s(e),s(e.detailNode),s(e.sibling),e.hasChildren()&&e.childrenAfterGroup){const t=-1==e.level;i&&!t&&!e.expanded||e.childrenAfterGroup.forEach(o)}};o(this.rootNode)}ensureRowsAtPixel(e,t,i=0){const s=this.getRowIndexAtPixel(t),o=this.getRow(s),r=!this.gridOptionsService.is("suppressAnimationFrame");return o!==e[0]&&(e.forEach(e=>{Is.removeFromArray(this.rootNode.allLeafChildren,e)}),e.forEach((e,t)=>{Is.insertIntoArray(this.rootNode.allLeafChildren,e,Math.max(s+i,0)+t)}),this.refreshModel({step:wn.EVERYTHING,keepRenderedRows:!0,keepEditingRows:!0,animate:r}),!0)}highlightRowAtPixel(e,t){const i=null!=t?this.getRowIndexAtPixel(t):null,s=null!=i?this.getRow(i):null;if(!s||!e||s===e||null==t)return void(this.lastHighlightedRow&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null));const o=this.getHighlightPosition(t,s);this.lastHighlightedRow&&this.lastHighlightedRow!==s&&(this.lastHighlightedRow.setHighlighted(null),this.lastHighlightedRow=null),s.setHighlighted(o),this.lastHighlightedRow=s}getHighlightPosition(e,t){if(!t){const i=this.getRowIndexAtPixel(e);if(!(t=this.getRow(i||0)))return fn.Below}const{rowTop:i,rowHeight:s}=t;return e-i<s/2?fn.Above:fn.Below}getLastHighlightedRowNode(){return this.lastHighlightedRow}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay?this.rowsToDisplay.length:0}getTopLevelRowCount(){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return 1;const e=this.rootNode.childrenAfterAggFilter;return e?e.length:0}getTopLevelRowDisplayedIndex(e){if(this.rowsToDisplay&&this.rowsToDisplay[0]===this.rootNode)return e;let t=this.rootNode.childrenAfterSort[e];if(this.gridOptionsService.is("groupHideOpenParents"))for(;t.expanded&&t.childrenAfterSort&&t.childrenAfterSort.length>0;)t=t.childrenAfterSort[0];return t.rowIndex}getRowBounds(e){if(Is.missing(this.rowsToDisplay))return null;const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){const e=this.gridOptionsService.isAnimateRows();this.refreshModel({step:wn.MAP,keepRenderedRows:!0,animate:e})}onFilterChanged(e){if(e.afterDataChange)return;const t=this.gridOptionsService.isAnimateRows(),i=0===e.columns.length||e.columns.some(e=>e.isPrimary())?wn.FILTER:wn.FILTER_AGGREGATES;this.refreshModel({step:i,keepRenderedRows:!0,animate:t})}onSortChanged(){const e=this.gridOptionsService.isAnimateRows();this.refreshModel({step:wn.SORT,keepRenderedRows:!0,animate:e,keepEditingRows:!0})}getType(){return"clientSide"}onValueChanged(){this.columnModel.isPivotActive()?this.refreshModel({step:wn.PIVOT}):this.refreshModel({step:wn.AGGREGATE})}createChangePath(e){const t=Is.missingOrEmpty(e),i=new pd(!1,this.rootNode);return(t||this.gridOptionsService.is("treeData"))&&i.setInactive(),i}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gridOptionsService.is("suppressModelUpdateAfterUpdateTransaction"))return!1;if(null==e.rowNodeTransactions)return!1;const t=e.rowNodeTransactions.filter(e=>null!=e.add&&e.add.length>0||null!=e.remove&&e.remove.length>0);return null==t||0==t.length}buildRefreshModelParams(e){let t=wn.EVERYTHING;const i={everything:wn.EVERYTHING,group:wn.EVERYTHING,filter:wn.FILTER,map:wn.MAP,aggregate:wn.AGGREGATE,sort:wn.SORT,pivot:wn.PIVOT};if(Is.exists(e)&&(t=i[e]),Is.missing(t))return void console.error(`AG Grid: invalid step ${e}, available steps are ${Object.keys(i).join(", ")}`);return{step:t,keepRenderedRows:!0,keepEditingRows:!0,animate:!this.gridOptionsService.is("suppressAnimationFrame")}}refreshModel(e){let t="object"==typeof e&&"step"in e?e:this.buildRefreshModelParams(e);if(!t)return;if(this.isSuppressModelUpdateAfterUpdateTransaction(t))return;const i=this.createChangePath(t.rowNodeTransactions);switch(t.step){case wn.EVERYTHING:this.doRowGrouping(t.groupState,t.rowNodeTransactions,t.rowNodeOrder,i,!!t.afterColumnsChanged);case wn.FILTER:this.doFilter(i);case wn.PIVOT:this.doPivot(i);case wn.AGGREGATE:this.doAggregate(i);case wn.FILTER_AGGREGATES:this.doFilterAggregates(i);case wn.SORT:this.doSort(t.rowNodeTransactions,i);case wn.MAP:this.doRowsToDisplay()}const s=this.setRowTopAndRowIndex();this.clearRowTopAndRowIndex(i,s);const o={type:_e.EVENT_MODEL_UPDATED,animate:t.animate,keepRenderedRows:t.keepRenderedRows,newData:t.newData,newPage:!1,keepUndoRedoStack:t.keepUndoRedoStack};this.eventService.dispatchEvent(o)}isEmpty(){const e=Is.missing(this.rootNode.allLeafChildren)||0===this.rootNode.allLeafChildren.length;return Is.missing(this.rootNode)||e||!this.columnModel.isReady()}isRowsToRender(){return Is.exists(this.rowsToDisplay)&&this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let i=!t,s=!1;const o=[],r=this.gridOptionsService.is("groupSelectsChildren");return this.forEachNodeAfterFilterAndSort(n=>{if(s)return;if(i&&(n===t||n===e)&&(s=!0,n.group&&r))return void o.push(...n.allLeafChildren);if(!i){if(n!==t&&n!==e)return;i=!0}(!n.group||!r)&&o.push(n)}),o}setDatasource(e){console.error("AG Grid: should never call setDatasource on clientSideRowController")}getTopLevelNodes(){return this.rootNode?this.rootNode.childrenAfterGroup:null}getRootNode(){return this.rootNode}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){if(this.isEmpty()||0===this.rowsToDisplay.length)return-1;let t=0,i=this.rowsToDisplay.length-1;if(e<=0)return 0;if(Is.last(this.rowsToDisplay).rowTop<=e)return this.rowsToDisplay.length-1;let s=-1,o=-1;for(;;){const r=Math.floor((t+i)/2),n=this.rowsToDisplay[r];if(this.isRowInPixel(n,e))return r;n.rowTop<e?t=r+1:n.rowTop>e&&(i=r-1);if(s===t&&o===i)return r;s=t,o=i}}isRowInPixel(e,t){const i=e.rowTop,s=e.rowTop+e.rowHeight;return i<=t&&s>t}forEachLeafNode(e){this.rootNode.allLeafChildren&&this.rootNode.allLeafChildren.forEach((t,i)=>e(t,i))}forEachNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterGroup||[]],callback:e,recursionType:uu.Normal,index:0,includeFooterNodes:t})}forEachNodeAfterFilter(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterAggFilter||[]],callback:e,recursionType:uu.AfterFilter,index:0,includeFooterNodes:t})}forEachNodeAfterFilterAndSort(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[...this.rootNode.childrenAfterSort||[]],callback:e,recursionType:uu.AfterFilterAndSort,index:0,includeFooterNodes:t})}forEachPivotNode(e,t=!1){this.recursivelyWalkNodesAndCallback({nodes:[this.rootNode],callback:e,recursionType:uu.PivotNodes,index:0,includeFooterNodes:t})}recursivelyWalkNodesAndCallback(e){var t;const{nodes:i,callback:s,recursionType:o,includeFooterNodes:r}=e;let{index:n}=e;for(let e=0;e<i.length;e++){const t=i[e];if(s(t,n++),t.hasChildren()&&!t.footer){let e=null;switch(o){case uu.Normal:e=t.childrenAfterGroup;break;case uu.AfterFilter:e=t.childrenAfterAggFilter;break;case uu.AfterFilterAndSort:e=t.childrenAfterSort;break;case uu.PivotNodes:e=t.leafGroup?null:t.childrenAfterSort}e&&(n=this.recursivelyWalkNodesAndCallback({nodes:[...e],callback:s,recursionType:o,index:n,includeFooterNodes:r}))}}const l=null===(t=i[0])||void 0===t?void 0:t.parent;if(!r||!l)return n;if(l===this.rootNode){if(!this.gridOptionsService.is("groupIncludeTotalFooter"))return n}else{if(!this.gridOptionsService.getGroupIncludeFooter()({node:l}))return n}return l.createFooter(),s(l.sibling,n++),n}doAggregate(e){this.aggregationStage&&this.aggregationStage.execute({rowNode:this.rootNode,changedPath:e})}doFilterAggregates(e){this.filterAggregatesStage?this.filterAggregatesStage.execute({rowNode:this.rootNode,changedPath:e}):this.rootNode.childrenAfterAggFilter=this.rootNode.childrenAfterFilter}expandOrCollapseAll(e){const t=this.gridOptionsService.is("treeData"),i=this.columnModel.isPivotActive(),s=o=>{o&&o.forEach(o=>{const r=()=>{o.expanded=e,s(o.childrenAfterGroup)};if(t){return void(Is.exists(o.childrenAfterGroup)&&r())}if(i){return void(!o.leafGroup&&r())}o.group&&r()})};this.rootNode&&s(this.rootNode.childrenAfterGroup),this.refreshModel({step:wn.MAP});const o=e?"expandAll":"collapseAll",r={type:_e.EVENT_EXPAND_COLLAPSE_ALL,source:o};this.eventService.dispatchEvent(r)}doSort(e,t){this.sortStage.execute({rowNode:this.rootNode,rowNodeTransactions:e,changedPath:t})}doRowGrouping(e,t,i,s,o){if(this.groupStage){if(t?this.groupStage.execute({rowNode:this.rootNode,rowNodeTransactions:t,rowNodeOrder:i,changedPath:s}):(this.groupStage.execute({rowNode:this.rootNode,changedPath:s,afterColumnsChanged:o}),this.restoreGroupState(e)),this.gridOptionsService.is("groupSelectsChildren")){if(this.selectionService.updateGroupsFromChildrenSelections("rowGroupChanged",s)){const e={type:_e.EVENT_SELECTION_CHANGED,source:"rowGroupChanged"};this.eventService.dispatchEvent(e)}}}else this.rootNode.childrenAfterGroup=this.rootNode.allLeafChildren,this.rootNode.sibling&&(this.rootNode.sibling.childrenAfterGroup=this.rootNode.childrenAfterGroup),this.rootNode.updateHasChildren()}restoreGroupState(e){e&&Is.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(t,i)=>{"boolean"==typeof e[i]&&(t.expanded=e[i])})}doFilter(e){this.filterStage.execute({rowNode:this.rootNode,changedPath:e})}doPivot(e){this.pivotStage&&this.pivotStage.execute({rowNode:this.rootNode,changedPath:e})}getGroupState(){if(!this.rootNode.childrenAfterGroup||!this.gridOptionsService.is("rememberGroupStateWhenNewData"))return null;const e={};return Is.traverseNodesWithKey(this.rootNode.childrenAfterGroup,(t,i)=>e[i]=t.expanded),e}getCopyOfNodesMap(){return this.nodeManager.getCopyOfNodesMap()}getRowNode(e){if("string"==typeof e&&0==e.indexOf(ar.ID_PREFIX_ROW_GROUP)){let t=void 0;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}return this.nodeManager.getRowNode(e)}setRowData(e){const t=this.getGroupState();this.nodeManager.setRowData(e),this.selectionService.reset(),this.filterManager.onNewRowsLoaded("rowDataUpdated");const i={type:_e.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(i),this.refreshModel({step:wn.EVERYTHING,groupState:t,newData:!0})}batchUpdateRowData(e,t){if(null==this.applyAsyncTransactionsTimeout){this.rowDataTransactionBatch=[];const e=this.gridOptionsService.getAsyncTransactionWaitMillis();this.applyAsyncTransactionsTimeout=window.setTimeout(()=>{this.executeBatchUpdateRowData()},e)}this.rowDataTransactionBatch.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){null!=this.applyAsyncTransactionsTimeout&&(clearTimeout(this.applyAsyncTransactionsTimeout),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){this.valueCache.onDataChanged();const e=[],t=[];let i=!1;if(this.rowDataTransactionBatch&&this.rowDataTransactionBatch.forEach(s=>{const o=this.nodeManager.updateRowData(s.rowDataTransaction,void 0);t.push(o),s.callback&&e.push(s.callback.bind(null,o)),"number"==typeof s.rowDataTransaction.addIndex&&(i=!0)}),this.commonUpdateRowData(t,void 0,i),e.length>0&&window.setTimeout(()=>{e.forEach(e=>e())},0),t.length>0){const e={type:_e.EVENT_ASYNC_TRANSACTIONS_FLUSHED,results:t};this.eventService.dispatchEvent(e)}this.rowDataTransactionBatch=null,this.applyAsyncTransactionsTimeout=void 0}updateRowData(e,t){this.valueCache.onDataChanged();const i=this.nodeManager.updateRowData(e,t),s="number"==typeof e.addIndex;return this.commonUpdateRowData([i],t,s),i}createRowNodeOrder(){if(this.gridOptionsService.is("suppressMaintainUnsortedOrder"))return;const e={};if(this.rootNode&&this.rootNode.allLeafChildren)for(let t=0;t<this.rootNode.allLeafChildren.length;t++){e[this.rootNode.allLeafChildren[t].id]=t}return e}commonUpdateRowData(e,t,i){const s=!this.gridOptionsService.is("suppressAnimationFrame");i&&(t=this.createRowNodeOrder()),this.refreshModel({step:wn.EVERYTHING,rowNodeTransactions:e,rowNodeOrder:t,keepRenderedRows:!0,keepEditingRows:!0,animate:s}),this.filterManager.onNewRowsLoaded("rowDataUpdated");const o={type:_e.EVENT_ROW_DATA_UPDATED};this.eventService.dispatchEvent(o)}doRowsToDisplay(){this.rowsToDisplay=this.flattenStage.execute({rowNode:this.rootNode})}onRowHeightChanged(){this.refreshModel({step:wn.MAP,keepRenderedRows:!0,keepEditingRows:!0,keepUndoRedoStack:!0})}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}resetRowHeights(){const e=this.resetRowHeightsForAllRowNodes();this.rootNode.setRowHeight(this.rootNode.rowHeight,!0),this.rootNode.sibling&&this.rootNode.sibling.setRowHeight(this.rootNode.sibling.rowHeight,!0),e&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const i=t.detailNode;i&&i.setRowHeight(i.rowHeight,!0),t.sibling&&t.sibling.setRowHeight(t.sibling.rowHeight,!0),e=!0}),e}onGridStylesChanges(){this.columnModel.isAutoRowHeightActive()||this.resetRowHeights()}};pu([j("columnModel")],gu.prototype,"columnModel",void 0),pu([j("selectionService")],gu.prototype,"selectionService",void 0),pu([j("filterManager")],gu.prototype,"filterManager",void 0),pu([j("valueCache")],gu.prototype,"valueCache",void 0),pu([j("beans")],gu.prototype,"beans",void 0),pu([j("filterStage")],gu.prototype,"filterStage",void 0),pu([j("sortStage")],gu.prototype,"sortStage",void 0),pu([j("flattenStage")],gu.prototype,"flattenStage",void 0),pu([z("groupStage")],gu.prototype,"groupStage",void 0),pu([z("aggregationStage")],gu.prototype,"aggregationStage",void 0),pu([z("pivotStage")],gu.prototype,"pivotStage",void 0),pu([z("filterAggregatesStage")],gu.prototype,"filterAggregatesStage",void 0),pu([B],gu.prototype,"init",null),gu=pu([U("rowModel")],gu);var mu=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Cu=class extends Le{execute(e){const{changedPath:t}=e;this.filterService.filter(t)}};mu([j("filterService")],Cu.prototype,"filterService",void 0),Cu=mu([U("filterStage")],Cu);var vu=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let fu=class extends Le{execute(e){const t=this.sortController.getSortOptions(),i=Is.exists(t)&&t.length>0,s=i&&Is.exists(e.rowNodeTransactions)&&this.gridOptionsService.is("deltaSort"),o=t.some(e=>this.gridOptionsService.isColumnsSortingCoupledToGroup()?e.column.isPrimary()&&e.column.isRowGroupActive():!!e.column.getColDef().showRowGroup);this.sortService.sort(t,i,s,e.rowNodeTransactions,e.changedPath,o)}};vu([j("sortService")],fu.prototype,"sortService",void 0),vu([j("sortController")],fu.prototype,"sortController",void 0),vu([j("columnModel")],fu.prototype,"columnModel",void 0),fu=vu([U("sortStage")],fu);var wu=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let yu=class extends Le{execute(e){const t=e.rowNode,i=[],s=this.columnModel.isPivotMode(),o=s&&t.leafGroup,r=o?[t]:t.childrenAfterSort,n=this.getFlattenDetails();this.recursivelyAddToRowsToDisplay(n,r,i,s,0);return!o&&i.length>0&&n.groupIncludeTotalFooter&&(t.createFooter(),this.addRowNodeToRowsToDisplay(n,t.sibling,i,0)),i}getFlattenDetails(){const e=this.gridOptionsService.is("groupRemoveSingleChildren");return{groupRemoveLowestSingleChildren:!e&&this.gridOptionsService.is("groupRemoveLowestSingleChildren"),groupRemoveSingleChildren:e,isGroupMultiAutoColumn:this.gridOptionsService.isGroupMultiAutoColumn(),hideOpenParents:this.gridOptionsService.is("groupHideOpenParents"),groupIncludeTotalFooter:this.gridOptionsService.is("groupIncludeTotalFooter"),getGroupIncludeFooter:this.gridOptionsService.getGroupIncludeFooter()}}recursivelyAddToRowsToDisplay(e,t,i,s,o){if(!Is.missingOrEmpty(t))for(let r=0;r<t.length;r++){const n=t[r],l=n.hasChildren(),a=s&&!l,d=e.groupRemoveSingleChildren&&l&&1===n.childrenAfterGroup.length,h=e.groupRemoveLowestSingleChildren&&l&&n.leafGroup&&1===n.childrenAfterGroup.length,c=s&&n.leafGroup,u=e.hideOpenParents&&n.expanded&&!n.master&&!c;if(!(a||u||d||h)&&this.addRowNodeToRowsToDisplay(e,n,i,o),!s||!n.leafGroup)if(l){const t=d||h;if(n.expanded||t){const r=t?o:o+1;this.recursivelyAddToRowsToDisplay(e,n.childrenAfterSort,i,s,r);e.getGroupIncludeFooter({node:n})?(n.createFooter(),this.addRowNodeToRowsToDisplay(e,n.sibling,i,r)):n.destroyFooter()}}else if(n.master&&n.expanded){const t=this.createDetailNode(n);this.addRowNodeToRowsToDisplay(e,t,i,o)}}}addRowNodeToRowsToDisplay(e,t,i,s){i.push(t),t.setUiLevel(e.isGroupMultiAutoColumn?0:s)}createDetailNode(e){if(Is.exists(e.detailNode))return e.detailNode;const t=new ar(this.beans);return t.detail=!0,t.selectable=!1,t.parent=e,Is.exists(e.id)&&(t.id="detail_"+e.id),t.data=e.data,t.level=e.level+1,e.detailNode=t,t}};wu([j("columnModel")],yu.prototype,"columnModel",void 0),wu([j("beans")],yu.prototype,"beans",void 0),yu=wu([U("flattenStage")],yu);var Su=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Eu=class extends Le{init(){this.postSortFunc=this.gridOptionsService.getCallback("postSortRows")}sort(e,t,i,s,o,r){const n=this.gridOptionsService.is("groupMaintainOrder"),l=this.columnModel.getAllGridColumns().some(e=>e.isRowGroupActive());let a={};i&&s&&(a=this.calculateDirtyNodes(s));const d=this.columnModel.isPivotMode(),h=s=>{this.pullDownGroupDataForHideOpenParents(s.childrenAfterAggFilter,!0);const h=d&&s.leafGroup;if(n&&l&&!s.leafGroup&&!r){const e=s.childrenAfterAggFilter.slice(0);if(s.childrenAfterSort){const t={};s.childrenAfterSort.forEach((e,i)=>{t[e.id]=i}),e.sort((e,i)=>{var s,o;return(null!==(s=t[e.id])&&void 0!==s?s:0)-(null!==(o=t[i.id])&&void 0!==o?o:0)})}s.childrenAfterSort=e}else s.childrenAfterSort=!t||h?s.childrenAfterAggFilter.slice(0):i?this.doDeltaSort(s,a,o,e):this.rowNodeSorter.doFullSort(s.childrenAfterAggFilter,e);if(s.sibling&&(s.sibling.childrenAfterSort=s.childrenAfterSort),this.updateChildIndexes(s),this.postSortFunc){const e={nodes:s.childrenAfterSort};this.postSortFunc(e)}};o&&o.forEachChangedNodeDepthFirst(h),this.updateGroupDataForHideOpenParents(o)}calculateDirtyNodes(e){const t={},i=e=>{e&&e.forEach(e=>t[e.id]=!0)};return e&&e.forEach(e=>{i(e.add),i(e.update),i(e.remove)}),t}doDeltaSort(e,t,i,s){const o=e.childrenAfterAggFilter,r=e.childrenAfterSort;if(!r)return this.rowNodeSorter.doFullSort(o,s);const n={},l=[];o.forEach(e=>{t[e.id]||!i.canSkip(e)?l.push(e):n[e.id]=!0});const a=r.filter(e=>n[e.id]),d=(e,t)=>({currentPos:t,rowNode:e}),h=l.map(d).sort((e,t)=>this.rowNodeSorter.compareRowNodes(s,e,t));return this.mergeSortedArrays(s,h,a.map(d)).map(({rowNode:e})=>e)}mergeSortedArrays(e,t,i){const s=[];let o=0,r=0;for(;o<t.length&&r<i.length;){this.rowNodeSorter.compareRowNodes(e,t[o],i[r])<0?s.push(t[o++]):s.push(i[r++])}for(;o<t.length;)s.push(t[o++]);for(;r<i.length;)s.push(i[r++]);return s}updateChildIndexes(e){if(Is.missing(e.childrenAfterSort))return;const t=e.childrenAfterSort;for(let i=0;i<t.length;i++){const s=t[i],o=0===i,r=i===e.childrenAfterSort.length-1;s.setFirstChild(o),s.setLastChild(r),s.setChildIndex(i)}}updateGroupDataForHideOpenParents(e){if(!this.gridOptionsService.is("groupHideOpenParents"))return;if(this.gridOptionsService.is("treeData")){const e="AG Grid: The property hideOpenParents dose not work with Tree Data. This is because Tree Data has values at the group level, it doesn't make sense to hide them (as opposed to Row Grouping, which only has Aggregated Values at the group level).";return Is.doOnce(()=>console.warn(e),"sortService.hideOpenParentsWithTreeData"),!1}const t=e=>{this.pullDownGroupDataForHideOpenParents(e.childrenAfterSort,!1),e.childrenAfterSort.forEach(e=>{e.hasChildren()&&t(e)})};e&&e.executeFromRootNode(e=>t(e))}pullDownGroupDataForHideOpenParents(e,t){this.gridOptionsService.is("groupHideOpenParents")&&!Is.missing(e)&&e.forEach(e=>{this.columnModel.getGroupDisplayColumns().forEach(i=>{const s=i.getColDef().showRowGroup;if("string"!=typeof s)return void console.error("AG Grid: groupHideOpenParents only works when specifying specific columns for colDef.showRowGroup");const o=s,r=this.columnModel.getPrimaryColumn(o);if(!(r===e.rowGroupColumn))if(t)e.setGroupValue(i.getId(),void 0);else{const t=e.getFirstChildOfFirstChild(r);t&&e.setGroupValue(i.getId(),t.key)}})})}};Su([j("columnModel")],Eu.prototype,"columnModel",void 0),Su([j("rowNodeSorter")],Eu.prototype,"rowNodeSorter",void 0),Su([B],Eu.prototype,"init",null),Eu=Su([U("sortService")],Eu);var Ru=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Tu=class extends Le{filter(e){const t=this.filterManager.isChildFilterPresent();this.filterNodes(t,e)}filterNodes(e,t){const i=(t,i)=>{t.hasChildren()?t.childrenAfterFilter=e&&!i?t.childrenAfterGroup.filter(e=>{const t=e.childrenAfterFilter&&e.childrenAfterFilter.length>0,i=e.data&&this.filterManager.doesRowPassFilter({rowNode:e});return t||i}):t.childrenAfterGroup:t.childrenAfterFilter=t.childrenAfterGroup,t.sibling&&(t.sibling.childrenAfterFilter=t.childrenAfterFilter)};if(this.doingTreeDataFiltering()){const e=(t,s)=>{if(t.childrenAfterGroup)for(let o=0;o<t.childrenAfterGroup.length;o++){const r=t.childrenAfterGroup[o],n=s||this.filterManager.doesRowPassFilter({rowNode:r});r.childrenAfterGroup?e(t.childrenAfterGroup[o],n):i(r,n)}i(t,s)},s=t=>e(t,!1);t.executeFromRootNode(s)}else{const e=e=>i(e,!1);t.forEachChangedNodeDepthFirst(e,!0)}}doingTreeDataFiltering(){return this.gridOptionsService.is("treeData")&&!this.gridOptionsService.is("excludeChildrenWhenTreeDataFiltering")}};Ru([j("filterManager")],Tu.prototype,"filterManager",void 0),Tu=Ru([U("filterService")],Tu);var bu=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Du=class extends Le{postConstruct(){"clientSide"===this.rowModel.getType()&&(this.clientSideRowModel=this.rowModel)}isActive(){const e=this.gridOptionsService.exists("getRowId");return!this.gridOptionsService.is("resetRowDataOnUpdate")&&e}setRowData(e){const t=this.createTransactionForRowData(e);if(!t)return;const[i,s]=t;this.clientSideRowModel.updateRowData(i,s)}createTransactionForRowData(e){if(Is.missing(this.clientSideRowModel))return void console.error("AG Grid: ImmutableService only works with ClientSideRowModel");const t=this.gridOptionsService.getCallback("getRowId");if(null==t)return void console.error("AG Grid: ImmutableService requires getRowId() callback to be implemented, your row data needs IDs!");const i={remove:[],update:[],add:[]},s=this.clientSideRowModel.getCopyOfNodesMap(),o=this.gridOptionsService.is("suppressMaintainUnsortedOrder")?void 0:{};return Is.exists(e)&&e.forEach((e,r)=>{const n=t({data:e,level:0}),l=s[n];if(o&&(o[n]=r),l){l.data!==e&&i.update.push(e),s[n]=void 0}else i.add.push(e)}),Is.iterateObject(s,(e,t)=>{t&&i.remove.push(t.data)}),[i,o]}};bu([j("rowModel")],Du.prototype,"rowModel",void 0),bu([j("rowRenderer")],Du.prototype,"rowRenderer",void 0),bu([B],Du.prototype,"postConstruct",null),Du=bu([U("immutableService")],Du);const Ou={version:"30.2.1",moduleName:x.ClientSideRowModelModule,rowModel:"clientSide",beans:[gu,Cu,fu,yu,Eu,Tu,Du]};var Pu=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};class Au extends gd{constructor(e,t,i){super(e),this.parentCache=t,this.params=i,this.startRow=e*i.blockSize,this.endRow=this.startRow+i.blockSize}postConstruct(){this.createRowNodes()}getBlockStateJson(){return{id:""+this.getId(),state:{blockNumber:this.getId(),startRow:this.getStartRow(),endRow:this.getEndRow(),pageStatus:this.getState()}}}setDataAndId(e,t,i){Is.exists(t)?e.setDataAndId(t,i.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();Is.missing(this.params.datasource.getRows)?console.warn("AG Grid: datasource is missing getRows method"):window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}processServerFail(){}createLoadParams(){return{startRow:this.getStartRow(),endRow:this.getEndRow(),successCallback:this.pageLoaded.bind(this,this.getVersion()),failCallback:this.pageLoadFailed.bind(this,this.getVersion()),sortModel:this.params.sortModel,filterModel:this.params.filterModel,context:this.gridOptionsService.context}}forEachNode(e,t,i){this.rowNodes.forEach((s,o)=>{this.startRow+o<i&&e(s,t.next())})}getLastAccessed(){return this.lastAccessed}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.next());const i=e-this.startRow;return this.rowNodes[i]}getStartRow(){return this.startRow}getEndRow(){return this.endRow}createRowNodes(){this.rowNodes=[];for(let e=0;e<this.params.blockSize;e++){const t=this.startRow+e,i=new ar(this.beans);i.setRowHeight(this.params.rowHeight),i.uiLevel=0,i.setRowIndex(t),i.setRowTop(this.params.rowHeight*t),this.rowNodes.push(i)}}processServerResult(e){this.rowNodes.forEach((t,i)=>{const s=e.rowData?e.rowData[i]:void 0;!t.id&&t.alreadyRendered&&s&&(this.rowNodes[i]=new ar(this.beans),this.rowNodes[i].setRowIndex(t.rowIndex),this.rowNodes[i].setRowTop(t.rowTop),this.rowNodes[i].setRowHeight(t.rowHeight),t.clearRowTopAndRowIndex()),this.setDataAndId(this.rowNodes[i],s,this.startRow+i)});const t=null!=e.rowCount&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,t)}destroyRowNodes(){this.rowNodes.forEach(e=>{e.clearRowTopAndRowIndex()})}}Pu([j("beans")],Au.prototype,"beans",void 0),Pu([B],Au.prototype,"postConstruct",null),Pu([W],Au.prototype,"destroyRowNodes",null);var Fu=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n},Lu=function(e,t){return function(i,s){t(i,s,e)}};class Iu extends Le{constructor(e){super(),this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount,this.params=e}setBeans(e){this.logger=e.create("InfiniteCache")}getRow(e,t=!1){const i=Math.floor(e/this.params.blockSize);let s=this.blocks[i];if(!s){if(t)return;s=this.createBlock(i)}return s.getRow(e)}createBlock(e){const t=this.createBean(new Au(e,this,this.params));return this.blocks[t.getId()]=t,this.blockCount++,this.purgeBlocksIfNeeded(t),this.params.rowNodeBlockLoader.addBlock(t),t}refreshCache(){0==this.blockCount?this.purgeCache():(this.getBlocksInOrder().forEach(e=>e.setStateWaitingToLoad()),this.params.rowNodeBlockLoader.checkBlockToLoad())}destroyAllBlocks(){this.getBlocksInOrder().forEach(e=>this.destroyBlock(e))}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(this.logger.log(`onPageLoaded: page = ${e.getId()}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(t=>t!=e);t.sort((e,t)=>t.getLastAccessed()-e.getLastAccessed());const i=this.params.maxBlocksInCache>0,s=i?this.params.maxBlocksInCache-1:null,o=Iu.MAX_EMPTY_BLOCKS_TO_KEEP-1;t.forEach((e,t)=>{if(e.getState()===Au.STATE_WAITING_TO_LOAD&&t>=o||!!i&&t>=s){if(this.isBlockCurrentlyDisplayed(e))return;if(this.isBlockFocused(e))return;this.removeBlockFromCache(e)}})}isBlockFocused(e){const t=this.focusService.getFocusCellToUseAfterRefresh();if(!t)return!1;if(null!=t.rowPinned)return!1;const i=e.getStartRow(),s=e.getEndRow();return t.rowIndex>=i&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const t=e.getStartRow(),i=e.getEndRow()-1;return this.rowRenderer.isRangeInRenderedViewport(t,i)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if("number"==typeof t&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const t=(e.getId()+1)*this.params.blockSize+this.params.overflowSize;this.rowCount<t&&(this.rowCount=t)}}setRowCount(e,t){this.rowCount=e,Is.exists(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize==0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t=new Ns;this.getBlocksInOrder().forEach(i=>i.forEachNode(e,t,this.rowCount))}getBlocksInOrder(){return Is.getAllValuesInObject(this.blocks).sort((e,t)=>e.getId()-t.getId())}destroyBlock(e){delete this.blocks[e.getId()],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){if(this.isAlive()){this.destroyAllBlocksPastVirtualRowCount();const e={type:_e.EVENT_STORE_UPDATED};this.eventService.dispatchEvent(e)}}destroyAllBlocksPastVirtualRowCount(){const e=[];this.getBlocksInOrder().forEach(t=>{t.getId()*this.params.blockSize>=this.rowCount&&e.push(t)}),e.length>0&&e.forEach(e=>this.destroyBlock(e))}purgeCache(){this.getBlocksInOrder().forEach(e=>this.removeBlockFromCache(e)),this.lastRowIndexKnown=!1,0===this.rowCount&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const i=[];let s=-1,o=!1;const r=new Ns;Is.missing(e)&&(o=!0);let n=!1;this.getBlocksInOrder().forEach(l=>{n||(o&&s+1!==l.getId()?n=!0:(s=l.getId(),l.forEachNode(s=>{const r=s===e||s===t;(o||r)&&i.push(s),r&&(o=!o)},r,this.rowCount)))});return n||o?[]:i}}Iu.MAX_EMPTY_BLOCKS_TO_KEEP=2,Fu([j("rowRenderer")],Iu.prototype,"rowRenderer",void 0),Fu([j("focusService")],Iu.prototype,"focusService",void 0),Fu([Lu(0,Y("loggerFactory"))],Iu.prototype,"setBeans",null),Fu([W],Iu.prototype,"destroyAllBlocks",null);var Nu=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Mu=class extends Le{getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(e,t,i,s){return!1}init(){this.gridOptionsService.isRowModelType("infinite")&&(this.rowHeight=this.gridOptionsService.getRowHeightAsNumber(),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache()),this.verifyProps())}verifyProps(){if(this.gridOptionsService.exists("initialGroupOrderComparator")){const e="AG Grid: initialGroupOrderComparator cannot be used with Infinite Row Model. If using Infinite Row Model, then sorting is done on the server side, nothing to do with the client.";Is.doOnce(()=>console.warn(e),"IRM.InitialGroupOrderComparator")}}start(){this.setDatasource(this.gridOptionsService.get("datasource"))}destroyDatasource(){this.datasource&&(this.getContext().destroyBean(this.datasource),this.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedListener(this.eventService,_e.EVENT_FILTER_CHANGED,this.onFilterChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_SORT_CHANGED,this.onSortChanged.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_NEW_COLUMNS_LOADED,this.onColumnEverything.bind(this)),this.addManagedListener(this.eventService,_e.EVENT_STORE_UPDATED,this.onCacheUpdated.bind(this))}onFilterChanged(){this.reset()}onSortChanged(){this.reset()}onColumnEverything(){let e;e=!this.cacheParams||this.isSortModelDifferent(),e&&this.reset()}isSortModelDifferent(){return!Is.jsonEquals(this.cacheParams.sortModel,this.sortController.getSortModel())}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){return this.infiniteCache?this.infiniteCache.getRowNodesInRange(e,t):[]}reset(){if(!this.datasource)return;null!=this.gridOptionsService.getCallback("getRowId")||this.selectionService.reset(),this.resetCache();const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}createModelUpdatedEvent(){return{type:_e.EVENT_MODEL_UPDATED,newPage:!1,newData:!1,keepRenderedRows:!0,animate:!1}}resetCache(){this.destroyCache(),this.cacheParams={datasource:this.datasource,filterModel:this.filterManager.getFilterModel(),sortModel:this.sortController.getSortModel(),rowNodeBlockLoader:this.rowNodeBlockLoader,initialRowCount:this.defaultIfInvalid(this.gridOptionsService.getNum("infiniteInitialRowCount"),1),maxBlocksInCache:this.gridOptionsService.getNum("maxBlocksInCache"),rowHeight:this.gridOptionsService.getRowHeightAsNumber(),overflowSize:this.defaultIfInvalid(this.gridOptionsService.getNum("cacheOverflowSize"),1),blockSize:this.defaultIfInvalid(this.gridOptionsService.getNum("cacheBlockSize"),100),lastAccessedSequence:new Ns},this.infiniteCache=this.createBean(new Iu(this.cacheParams))}defaultIfInvalid(e,t){return e>0?e:t}destroyCache(){this.infiniteCache&&(this.infiniteCache=this.destroyBean(this.infiniteCache))}onCacheUpdated(){const e=this.createModelUpdatedEvent();this.eventService.dispatchEvent(e)}getRow(e){if(this.infiniteCache&&!(e>=this.infiniteCache.getRowCount()))return this.infiniteCache.getRow(e)}getRowNode(e){let t;return this.forEachNode(i=>{i.id===e&&(t=i)}),t}forEachNode(e){this.infiniteCache&&this.infiniteCache.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(0!==this.rowHeight){const t=Math.floor(e/this.rowHeight),i=this.getRowCount()-1;return t>i?i:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){this.infiniteCache&&this.infiniteCache.refreshCache()}purgeCache(){this.infiniteCache&&this.infiniteCache.purgeCache()}isLastRowIndexKnown(){return!!this.infiniteCache&&this.infiniteCache.isLastRowIndexKnown()}setRowCount(e,t){this.infiniteCache&&this.infiniteCache.setRowCount(e,t)}};Nu([j("filterManager")],Mu.prototype,"filterManager",void 0),Nu([j("sortController")],Mu.prototype,"sortController",void 0),Nu([j("selectionService")],Mu.prototype,"selectionService",void 0),Nu([j("rowRenderer")],Mu.prototype,"rowRenderer",void 0),Nu([j("rowNodeBlockLoader")],Mu.prototype,"rowNodeBlockLoader",void 0),Nu([B],Mu.prototype,"init",null),Nu([W],Mu.prototype,"destroyDatasource",null),Mu=Nu([U("rowModel")],Mu);const Gu={version:"30.2.1",moduleName:x.InfiniteRowModelModule,rowModel:"infinite",beans:[Mu]};class xu{setBeans(e){this.beans=e}getFileName(e){const t=this.getDefaultFileExtension();return null!=e&&e.length||(e=this.getDefaultFileName()),-1===e.indexOf(".")?`${e}.${t}`:e}getData(e){const t=this.createSerializingSession(e);return this.beans.gridSerializer.serialize(t,e)}}class _u{constructor(e){this.groupColumns=[];const{columnModel:t,valueService:i,gridOptionsService:s,valueFormatterService:o,valueParserService:r,processCellCallback:n,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:d}=e;this.columnModel=t,this.valueService=i,this.gridOptionsService=s,this.valueFormatterService=o,this.valueParserService=r,this.processCellCallback=n,this.processHeaderCallback=l,this.processGroupHeaderCallback=a,this.processRowGroupCallback=d}prepare(e){this.groupColumns=e.filter(e=>!!e.getColDef().showRowGroup)}extractHeaderValue(e){const t=this.getHeaderName(this.processHeaderCallback,e);return null!=t?t:""}extractRowCellValue(e,t,i,s,o){const r=this.gridOptionsService.is("groupHideOpenParents")&&!o.footer||!this.shouldRenderGroupSummaryCell(o,e,t)?this.valueService.getValue(e,o):this.createValueForGroupNode(o);return this.processCell({accumulatedRowIndex:i,rowNode:o,column:e,value:r,processCellCallback:this.processCellCallback,type:s})}shouldRenderGroupSummaryCell(e,t,i){var s;if(!(e&&e.group))return!1;if(-1!==this.groupColumns.indexOf(t)){if(null!=(null===(s=e.groupData)||void 0===s?void 0:s[t.getId()]))return!0;if(this.gridOptionsService.isRowModelType("serverSide")&&e.group)return!0;if(e.footer&&-1===e.level){const e=t.getColDef();return null==e||!0===e.showRowGroup||e.showRowGroup===this.columnModel.getRowGroupColumns()[0].getId()}}const o=this.gridOptionsService.isGroupUseEntireRow(this.columnModel.isPivotMode());return 0===i&&o}getHeaderName(e,t){return e?e({column:t,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context}):this.columnModel.getDisplayNameForColumn(t,"csv",!0)}createValueForGroupNode(e){if(this.processRowGroupCallback)return this.processRowGroupCallback({node:e,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context});const t=e.footer,i=[e.key];if(!this.gridOptionsService.isGroupMultiAutoColumn())for(;e.parent;)e=e.parent,i.push(e.key);const s=i.reverse().join(" -> ");return t?"Total "+s:s}processCell(e){var t;const{accumulatedRowIndex:i,rowNode:s,column:o,value:r,processCellCallback:n,type:l}=e;return n?{value:null!==(t=n({accumulatedRowIndex:i,column:o,node:s,value:r,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context,type:l,parseValue:e=>this.valueParserService.parseValue(o,s,e,this.valueService.getValue(o,s)),formatValue:e=>{var t;return null!==(t=this.valueFormatterService.formatValue(o,s,e))&&void 0!==t?t:e}}))&&void 0!==t?t:""}:o.getColDef().useValueFormatterForExport?{value:null!=r?r:"",valueFormatted:this.valueFormatterService.formatValue(o,s,r)}:{value:null!=r?r:""}}}class Vu{static download(e,t){const i=document.defaultView||window;if(!i)return void console.warn("AG Grid: There is no `window` associated with the current `document`");const s=document.createElement("a"),o=i.URL.createObjectURL(t);s.setAttribute("href",o),s.setAttribute("download",e),s.style.display="none",document.body.appendChild(s),s.dispatchEvent(new MouseEvent("click",{bubbles:!1,cancelable:!0,view:i})),document.body.removeChild(s),i.setTimeout(()=>{i.URL.revokeObjectURL(o)},0)}}class Hu extends _u{constructor(e){super(e),this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:i}=e;this.suppressQuotes=t,this.columnSeparator=i}addCustomContent(e){e&&("string"==typeof e?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,"\r\n"),this.result+=e):e.forEach(e=>{this.beginNewLine(),e.forEach((e,t)=>{0!==t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(e.data.value||""),e.mergeAcross&&this.appendEmptyCells(e.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,i,s){0!=i&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){0!=t&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,i){var s;0!=t&&(this.result+=this.columnSeparator);const o=this.extractRowCellValue(e,t,t,"csv",i);this.result+=this.putInQuotes(null!==(s=o.valueFormatted)&&void 0!==s?s:o.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(null==e)return'""';let t;"string"==typeof e?t=e:"function"==typeof e.toString?t=e.toString():(console.warn("AG Grid: unknown value type during csv conversion"),t="");return'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+="\r\n"),this.isFirstLine=!1}}var ku=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};let Bu=class extends xu{postConstruct(){this.setBeans({gridSerializer:this.gridSerializer,gridOptionsService:this.gridOptionsService})}getMergedParams(e){const t=this.gridOptionsService.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed())return console.warn("AG Grid: Export cancelled. Export is not allowed as per your configuration."),"";const t=this.getMergedParams(e),i=this.getData(t),s=new Blob(["\ufeff",i],{type:"text/plain"});return Vu.download(this.getFileName(t.fileName),s),i}exportDataAsCsv(e){return this.export(e)}getDataAsCsv(e,t=!1){const i=t?Object.assign({},e):this.getMergedParams(e);return this.getData(i)}getDefaultFileName(){return"export.csv"}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{columnModel:t,valueService:i,gridOptionsService:s,valueFormatterService:o,valueParserService:r}=this,{processCellCallback:n,processHeaderCallback:l,processGroupHeaderCallback:a,processRowGroupCallback:d,suppressQuotes:h,columnSeparator:c}=e;return new Hu({columnModel:t,valueService:i,gridOptionsService:s,valueFormatterService:o,valueParserService:r,processCellCallback:n||void 0,processHeaderCallback:l||void 0,processGroupHeaderCallback:a||void 0,processRowGroupCallback:d||void 0,suppressQuotes:h||!1,columnSeparator:c||","})}isExportSuppressed(){return this.gridOptionsService.is("suppressCsvExport")}};ku([j("columnModel")],Bu.prototype,"columnModel",void 0),ku([j("valueService")],Bu.prototype,"valueService",void 0),ku([j("gridSerializer")],Bu.prototype,"gridSerializer",void 0),ku([j("gridOptionsService")],Bu.prototype,"gridOptionsService",void 0),ku([j("valueFormatterService")],Bu.prototype,"valueFormatterService",void 0),ku([j("valueParserService")],Bu.prototype,"valueParserService",void 0),ku([B],Bu.prototype,"postConstruct",null),Bu=ku([U("csvCreator")],Bu);var Wu,Uu=function(e,t,i,s){var o,r=arguments.length,n=r<3?t:null===s?s=Object.getOwnPropertyDescriptor(t,i):s;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)n=Reflect.decorate(e,t,i,s);else for(var l=e.length-1;l>=0;l--)(o=e[l])&&(n=(r<3?o(n):r>3?o(t,i,n):o(t,i))||n);return r>3&&n&&Object.defineProperty(t,i,n),n};!function(e){e[e.HEADER_GROUPING=0]="HEADER_GROUPING",e[e.HEADER=1]="HEADER",e[e.BODY=2]="BODY"}(Wu||(Wu={}));let ju=class extends Le{serialize(e,t={}){const i=this.getColumnsToExport(t.allColumns,t.columnKeys);return Is.compose(this.prepareSession(i),this.prependContent(t),this.exportColumnGroups(t,i),this.exportHeaders(t,i),this.processPinnedTopRows(t,i),this.processRows(t,i),this.processPinnedBottomRows(t,i),this.appendContent(t))(e).parse()}processRow(e,t,i,s){const o=t.shouldRowBeSkipped||(()=>!1),r=this.gridOptionsService.context,n=this.gridOptionsService.api,l=this.gridOptionsService.columnApi,a=this.gridOptionsService.is("groupRemoveSingleChildren"),d=this.gridOptionsService.is("groupRemoveLowestSingleChildren"),h=null!=t.rowPositions||!!t.onlySelected,c=this.gridOptionsService.is("groupHideOpenParents")&&!h,u=this.columnModel.isPivotMode()?s.leafGroup:!s.group,p=!!s.footer,g=t.skipGroups||t.skipRowGroups,m=d&&s.leafGroup,C=1===s.allChildrenCount&&(a||m);if(g&&t.skipGroups&&Is.doOnce(()=>console.warn("AG Grid: Since v25.2 `skipGroups` has been renamed to `skipRowGroups`."),"gridSerializer-skipGroups"),!u&&!p&&(t.skipRowGroups||C||c)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&"top"===s.rowPinned||t.skipPinnedBottom&&"bottom"===s.rowPinned)return;if(-1===s.level&&!u&&!p)return;if(o({node:s,api:n,columnApi:l,context:r}))return;const v=e.onNewBodyRow(s);if(i.forEach((e,t)=>{v.onColumn(e,t,s)}),t.getCustomContentBelowRow){const i=t.getCustomContentBelowRow({node:s,api:n,columnApi:l,context:r});i&&e.addCustomContent(i)}}appendContent(e){return t=>{const i=e.customFooter||e.appendContent;return i&&(e.customFooter&&Is.doOnce(()=>console.warn("AG Grid: Since version 25.2.0 the `customFooter` param has been deprecated. Use `appendContent` instead."),"gridSerializer-customFooter"),t.addCustomContent(i)),t}}prependContent(e){return t=>{const i=e.customHeader||e.prependContent;return i&&(e.customHeader&&Is.doOnce(()=>console.warn("AG Grid: Since version 25.2.0 the `customHeader` param has been deprecated. Use `prependContent` instead."),"gridSerializer-customHeader"),t.addCustomContent(i)),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return i=>{if(e.skipColumnGroupHeaders)e.columnGroups&&Is.doOnce(()=>console.warn("AG Grid: Since v25.2 the `columnGroups` param has deprecated, and groups are exported by default."),"gridSerializer-columnGroups");else{const s=new Ve,o=this.displayedGroupCreator.createDisplayedGroups(t,s,null);this.recursivelyAddHeaderGroups(o,i,e.processGroupHeaderCallback)}return i}}exportHeaders(e,t){return i=>{if(e.skipHeader||e.skipColumnHeaders)e.skipHeader&&Is.doOnce(()=>console.warn("AG Grid: Since v25.2 the `skipHeader` param has been renamed to `skipColumnHeaders`."),"gridSerializer-skipHeader");else{const e=i.onNewHeaderRow();t.forEach((t,i)=>{e.onColumn(t,i,void 0)})}return i}}processPinnedTopRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(e=>"top"===e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>this.pinnedRowModel.getPinnedTopRow(e.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedTopRow(s),i}}processRows(e,t){return i=>{const s=this.rowModel,o=s.getType(),r="clientSide"===o,n="serverSide"===o,l=!r&&e.onlySelected,a=this.processRow.bind(this,i,e,t),{exportedRows:d="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(e=>null==e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>s.getRow(e.rowIndex)).forEach(a);else if(this.columnModel.isPivotMode())r?s.forEachPivotNode(a,!0):n?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||l){const e=this.selectionService.getSelectedNodes();this.replicateSortedOrder(e),e.forEach(a)}else"all"===d?s.forEachNode(a):r||n?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return i}}replicateSortedOrder(e){const t=this.sortController.getSortOptions(),i=(e,s)=>{var o,r,n,l;return null!=e.rowIndex&&null!=s.rowIndex?e.rowIndex-s.rowIndex:e.level===s.level?(null===(o=e.parent)||void 0===o?void 0:o.id)===(null===(r=s.parent)||void 0===r?void 0:r.id)?this.rowNodeSorter.compareRowNodes(t,{rowNode:e,currentPos:null!==(n=e.rowIndex)&&void 0!==n?n:-1},{rowNode:s,currentPos:null!==(l=s.rowIndex)&&void 0!==l?l:-1}):i(e.parent,s.parent):e.level>s.level?i(e.parent,s):i(e,s.parent)};e.sort(i)}processPinnedBottomRows(e,t){return i=>{const s=this.processRow.bind(this,i,e,t);return e.rowPositions?e.rowPositions.filter(e=>"bottom"===e.rowPinned).sort((e,t)=>e.rowIndex-t.rowIndex).map(e=>this.pinnedRowModel.getPinnedBottomRow(e.rowIndex)).forEach(s):this.pinnedRowModel.forEachPinnedBottomRow(s),i}}getColumnsToExport(e=!1,t){const i=this.columnModel.isPivotMode();if(t&&t.length)return this.columnModel.getGridColumns(t);if(e&&!i){return(this.gridOptionsService.is("treeData")?this.columnModel.getGridColumns(["ag-Grid-AutoColumn"]):[]).concat(this.columnModel.getAllGridColumns()||[])}return this.columnModel.getAllDisplayedColumns()}recursivelyAddHeaderGroups(e,t,i){const s=[];e.forEach(e=>{const t=e;t.getChildren&&t.getChildren().forEach(e=>s.push(e))}),e.length>0&&e[0]instanceof xe&&this.doAddHeaderHeader(t,e,i),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,i)}doAddHeaderHeader(e,t,i){const s=e.onNewHeaderGroupingRow();let o=0;t.forEach(e=>{const t=e;let r;r=i?i({columnGroup:t,api:this.gridOptionsService.api,columnApi:this.gridOptionsService.columnApi,context:this.gridOptionsService.context}):this.columnModel.getDisplayNameForColumnGroup(t,"header");const n=t.getLeafColumns().reduce((e,t,i,s)=>{let o=Is.last(e);return"open"===t.getColumnGroupShow()?o&&null==o[1]||(o=[i],e.push(o)):o&&null==o[1]&&(o[1]=i-1),i===s.length-1&&o&&null==o[1]&&(o[1]=i),e},[]);s.onColumn(t,r||"",o++,t.getLeafColumns().length-1,n)})}};Uu([j("displayedGroupCreator")],ju.prototype,"displayedGroupCreator",void 0),Uu([j("columnModel")],ju.prototype,"columnModel",void 0),Uu([j("rowModel")],ju.prototype,"rowModel",void 0),Uu([j("pinnedRowModel")],ju.prototype,"pinnedRowModel",void 0),Uu([j("selectionService")],ju.prototype,"selectionService",void 0),Uu([j("rowNodeSorter")],ju.prototype,"rowNodeSorter",void 0),Uu([j("sortController")],ju.prototype,"sortController",void 0),ju=Uu([U("gridSerializer")],ju);const zu={version:"30.2.1",moduleName:x.CsvExportModule,beans:[Bu,ju]};class Ku{static createHeader(e={}){const t=["version"];e.version||(e.version="1.0"),e.encoding&&t.push("encoding"),e.standalone&&t.push("standalone");return`<?xml ${t.map(t=>`${t}="${e[t]}"`).join(" ")} ?>`}static createXml(e,t){let i="";e.properties&&(e.properties.prefixedAttributes&&e.properties.prefixedAttributes.forEach(e=>{Object.keys(e.map).forEach(s=>{i+=this.returnAttributeIfPopulated(e.prefix+s,e.map[s],t)})}),e.properties.rawMap&&Object.keys(e.properties.rawMap).forEach(s=>{i+=this.returnAttributeIfPopulated(s,e.properties.rawMap[s],t)}));let s="<"+e.name+i;return e.children||null!=e.textNode?null!=e.textNode?s+">"+e.textNode+"</"+e.name+">\r\n":(s+=">\r\n",e.children&&e.children.forEach(e=>{s+=this.createXml(e,t)}),s+"</"+e.name+">\r\n"):s+"/>\r\n"}static returnAttributeIfPopulated(e,t,i){if(!t&&""!==t&&0!==t)return"";let s=t;return"boolean"==typeof t&&i&&(s=i(t)),` ${e}="${s}"`}}const Yu=new Uint32Array([0,1996959894,3993919788,2567524794,124634137,1886057615,3915621685,2657392035,249268274,2044508324,3772115230,2547177864,162941995,2125561021,3887607047,2428444049,498536548,1789927666,4089016648,2227061214,450548861,1843258603,4107580753,2211677639,325883990,1684777152,4251122042,2321926636,335633487,1661365465,4195302755,2366115317,997073096,1281953886,3579855332,2724688242,1006888145,1258607687,3524101629,2768942443,901097722,1119000684,3686517206,2898065728,853044451,1172266101,3705015759,2882616665,651767980,1373503546,3369554304,3218104598,565507253,1454621731,3485111705,3099436303,671266974,1594198024,3322730930,2970347812,795835527,1483230225,3244367275,3060149565,1994146192,31158534,2563907772,4023717930,1907459465,112637215,2680153253,3904427059,2013776290,251722036,2517215374,3775830040,2137656763,141376813,2439277719,3865271297,1802195444,476864866,2238001368,4066508878,1812370925,453092731,2181625025,4111451223,1706088902,314042704,2344532202,4240017532,1658658271,366619977,2362670323,4224994405,1303535960,984961486,2747007092,3569037538,1256170817,1037604311,2765210733,3554079995,1131014506,879679996,2909243462,3663771856,1141124467,855842277,2852801631,3708648649,1342533948,654459306,3188396048,3373015174,1466479909,544179635,3110523913,3462522015,1591671054,702138776,2966460450,3352799412,1504918807,783551873,3082640443,3233442989,3988292384,2596254646,62317068,1957810842,3939845945,2647816111,81470997,1943803523,3814918930,2489596804,225274430,2053790376,3826175755,2466906013,167816743,2097651377,4027552580,2265490386,503444072,1762050814,4150417245,2154129355,426522225,1852507879,4275313526,2312317920,282753626,1742555852,4189708143,2394877945,397917763,1622183637,3604390888,2714866558,953729732,1340076626,3518719985,2797360999,1068828381,1219638859,3624741850,2936675148,906185462,1090812512,3747672003,2825379669,829329135,1181335161,3412177804,3160834842,628085408,1382605366,3423369109,3138078467,570562233,1426400815,3317316542,2998733608,733239954,1555261956,3268935591,3050360625,752459403,1541320221,2607071920,3965973030,1969922972,40735498,2617837225,3943577151,1913087877,83908371,2512341634,3803740692,2075208622,213261112,2463272603,3855990285,2094854071,198958881,2262029012,4057260610,1759359992,534414190,2176718541,4139329115,1873836001,414664567,2282248934,4279200368,1711684554,285281116,2405801727,4167216745,1634467795,376229701,2685067896,3608007406,1308918612,956543938,2808555105,3495958263,1231636301,1047427035,2932959818,3654703836,1088359270,936918e3,2847714899,3736837829,1202900863,817233897,3183342108,3401237130,1404277552,615818150,3134207493,3453421203,1423857449,601450431,3009837614,3294710456,1567103746,711928724,3020668471,3272380065,1510334235,755167117]);class $u{static addFolders(e){e.forEach(this.addFolder.bind(this))}static addFolder(e){this.folders.push({path:e,created:new Date,isBase64:!1})}static addFile(e,t,i=!1){this.files.push({path:e,created:new Date,content:t,isBase64:i})}static getContent(e="application/zip"){const t=this.buildFileStream(),i=this.buildUint8Array(t);return this.clearStream(),new Blob([i],{type:e})}static clearStream(){this.folders=[],this.files=[]}static buildFileStream(e=""){const t=this.folders.concat(this.files),i=t.length;let s="",o=0,r=0;for(const i of t){const{fileHeader:t,folderHeader:n,content:l}=this.getHeader(i,o);o+=t.length+l.length,r+=n.length,e+=t+l,s+=n}return e+s+this.buildFolderEnd(i,r,o)}static getHeader(e,t){const{content:i,path:s,created:o,isBase64:r}=e,{utf8_encode:n,decToHex:l}=Is,a=n(s),d=a!==s,h=this.convertTime(o),c=this.convertDate(o);let u="";if(d){const e=l(1,1)+l(this.getFromCrc32Table(a),4)+a;u="up"+l(e.length,2)+e}const{size:p,content:g}=i?this.getConvertedContent(i,r):{size:0,content:""},m="\n\0"+(d?"\0\b":"\0\0")+"\0\0"+l(h,2)+l(c,2)+l(p?this.getFromCrc32Table(g):0,4)+l(p,4)+l(p,4)+l(a.length,2)+l(u.length,2);return{fileHeader:"PK\x03\x04"+m+a+u,folderHeader:"PK\x01\x02\x14\0"+m+"\0\0\0\0\0\0"+(i?"\0\0\0\0":"\x10\0\0\0")+l(t,4)+a+u,content:g||""}}static getConvertedContent(e,t=!1){return t&&(e=e.split(";base64,")[1]),{size:(e=t?atob(e):e).length,content:e}}static buildFolderEnd(e,t,i){const{decToHex:s}=Is;return"PK\x05\x06\0\0\0\0"+s(e,2)+s(e,2)+s(t,4)+s(i,4)+"\0\0"}static buildUint8Array(e){const t=new Uint8Array(e.length);for(let i=0;i<t.length;i++)t[i]=e.charCodeAt(i);return t}static getFromCrc32Table(e){if(!e.length)return 0;const t=e.length,i=new Uint8Array(t);for(let s=0;s<t;s++)i[s]=e.charCodeAt(s);let s=-1,o=0,r=0,n=0;for(let e=0;e<t;e++)o=i[e],r=255&(s^o),n=Yu[r],s=s>>>8^n;return-1^s}static convertTime(e){let t=e.getHours();return t<<=6,t|=e.getMinutes(),t<<=5,t|=e.getSeconds()/2,t}static convertDate(e){let t=e.getFullYear()-1980;return t<<=4,t|=e.getMonth()+1,t<<=5,t|=e.getDate(),t}}$u.folders=[],$u.files=[];const qu=[Ou,Gu,zu];V.registerModules(qu);export{ra as AbstractHeaderCellCtrl,lo as AgAbstractField,no as AgAbstractLabel,sh as AgAutocomplete,Co as AgCheckbox,Yd as AgDialog,_d as AgGroupComponent,bd as AgInputDateField,Fo as AgInputNumberField,Dd as AgInputRange,Td as AgInputTextArea,Ao as AgInputTextField,Ud as AgMenuItemComponent,Hd as AgMenuList,Bd as AgMenuPanel,zd as AgPanel,ho as AgPickerField,Gs as AgPromise,Ms as AgPromiseStatus,vo as AgRadioButton,Nd as AgRichSelect,po as AgSelect,Gd as AgSlider,vt as AgStackComponentsRegistry,Rd as AgToggleButton,ch as AlignedGridsService,qu as AllCommunityModules,rr as AnimateShowChangeCellRenderer,lr as AnimateSlideCellRenderer,ed as AnimationFrameService,gn as AutoScrollService,id as AutoWidthCalculator,j as Autowired,du as BarColumnLabelPlacement,su as BaseComponentWrapper,xu as BaseCreator,_u as BaseGridSerializingSession,U as Bean,Le as BeanStub,Qn as Beans,jl as BodyDropPivotTarget,$l as BodyDropTarget,nu as CHART_TOOLBAR_ALLOW_LIST,ru as CHART_TOOL_PANEL_ALLOW_LIST,lu as CHART_TOOL_PANEL_MENU_OPTIONS,Hl as CellComp,il as CellCtrl,ah as CellNavigationService,uc as CellPositionUtils,jn as CellRangeType,pd as ChangedPath,Br as CheckboxCellEditor,Hr as CheckboxCellRenderer,hr as CheckboxSelectionComponent,Ou as ClientSideRowModelModule,wn as ClientSideRowModelSteps,Qe as ColDefUtil,te as Column,Ch as ColumnApi,Me as ColumnFactory,xe as ColumnGroup,d as ColumnKeyCreator,ct as ColumnModel,pt as ColumnUtils,js as Component,Je as ComponentUtil,H as Context,ql as CssClassApplier,Bs as CssClassManager,Bu as CsvCreator,zu as CsvExportModule,Pc as CtrlsService,ks as CustomTooltipFeature,ou as DEFAULT_CHART_GROUPS,Xc as DataTypeService,Mr as DateCellEditor,Ro as DateFilter,_r as DateStringCellEditor,mt as DisplayedGroupCreator,Vu as Downloader,Cr as DragAndDropService,pn as DragService,ur as DragSourceType,Jh as Environment,X as EventService,_e as Events,cn as ExcelFactoryMode,Sh as ExpressionService,On as FilterManager,an as FloatingFilterMapper,Sa as FocusService,ke as GROUP_AUTO_COLUMN_ID,eu as Grid,En as GridApi,Al as GridBodyComp,Wn as GridBodyCtrl,Lh as GridComp,iu as GridCoreCreator,Ah as GridCtrl,Ua as GridHeaderComp,Ba as GridHeaderCtrl,Uc as GridOptionsService,ju as GridSerializer,br as GroupCellRenderer,Rr as GroupCellRendererCtrl,Ve as GroupInstanceIdCreator,Ra as HeaderCellCtrl,Fn as HeaderFilterCellComp,ca as HeaderFilterCellCtrl,Aa as HeaderGroupCellCtrl,_a as HeaderNavigationDirection,Ha as HeaderNavigationService,wc as HeaderPositionUtils,ia as HeaderRowComp,xa as HeaderRowContainerComp,Ma as HeaderRowContainerCtrl,Ia as HeaderRowCtrl,ea as HeaderRowType,gr as HorizontalDirection,za as HorizontalResizeService,Gu as InfiniteRowModelModule,ys as KeyCode,Xo as LargeTextCellEditor,Ln as LayoutCssClasses,zc as LocaleService,Oh as Logger,Dh as LoggerFactory,eo as ManagedFocusFeature,x as ModuleNames,V as ModuleRegistry,Ml as MouseEventService,Kl as MoveColumnFeature,xl as NavigationService,Ir as NumberCellEditor,No as NumberFilter,Ns as NumberSequence,z as Optional,yd as PaginationProxy,cd as PinnedRowModel,qo as PopupComponent,Vl as PopupEditorWrapper,Jd as PopupService,io as PositionableFeature,B as PostConstruct,k as PreConstruct,W as PreDestroy,Xe as PropertyKeys,se as ProvidedColumnGroup,oo as ProvidedFilter,Y as Qualifier,zs as QuerySelector,Ks as RefSelector,Ja as ResizeObserverService,kn as RowAnimationCssClasses,Wl as RowContainerComp,Dl as RowContainerCtrl,yl as RowContainerName,Sl as RowContainerType,rl as RowCtrl,fn as RowHighlightPosition,ar as RowNode,gd as RowNodeBlock,fd as RowNodeBlockLoader,bc as RowNodeSorter,hc as RowPositionUtils,nd as RowRenderer,Wu as RowType,yo as ScalarFilter,Ll as ScrollVisibleService,Zo as SelectCellEditor,sc as SelectableService,Un as SelectionHandleType,ud as ServerSideTransactionResultStatus,la as SetLeftFeature,wo as SimpleFilter,Mh as SortController,jo as SortIndicatorComp,Ya as StandardMenuFactory,Ed as StylingService,Ca as TabGuardClassNames,Ad as TabGuardComp,fa as TabGuardCtrl,qa as TabbedLayout,Rh as TemplateService,sr as TextCellEditor,Go as TextFilter,Bo as TextFloatingFilter,xs as Timer,$n as TooltipFeature,Wo as TouchListener,hn as UserComponentFactory,Ur as UserComponentRegistry,Wh as ValueCache,dd as ValueFormatterService,Zc as ValueParserService,fh as ValueService,nh as VanillaFrameworkOverrides,pr as VerticalDirection,Ld as VirtualList,vn as VirtualListDragFeature,Ku as XmlFactory,$u as ZipContainer,Is as _,au as __FORCE_MODULE_DETECTION,Rl as getRowContainerTypeForName,Qa as simpleHttpRequest};