@arbocollab/arbo-plugin-item-table 0.1.120 → 0.1.121

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -87904,7 +87904,7 @@ const KDe = {
87904
87904
  "beta-tag": "_beta-tag_1sow5_56"
87905
87905
  }, uTe = {
87906
87906
  $style: lTe
87907
- }, cTe = /* @__PURE__ */ _t(nTe, [["__cssModules", uTe]]), c$ = "0.1.120", dTe = { key: 0 }, hTe = /* @__PURE__ */ st({
87907
+ }, cTe = /* @__PURE__ */ _t(nTe, [["__cssModules", uTe]]), c$ = "0.1.121", dTe = { key: 0 }, hTe = /* @__PURE__ */ st({
87908
87908
  __name: "app",
87909
87909
  setup(e) {
87910
87910
  const t = q(() => n.id.length === 0 || n.workspaceId.length === 0), n = ys({
@@ -256,4 +256,4 @@ See ${KN(e,t)}`;return Array.isArray(s)?s.concat(r):[s,r]}var fge={1:"Charting A
256
256
  If you are trying to annotate ${s} with application data, use the '${s}.context' property instead.`),zf(u)}if(a.length>0&&o){const l=this.beans.frameworkOverrides.getDocLink(o);zf(`to see all the valid ${s} properties please check: ${l}`)}}};function Oge(e,t,n){const s={},o=e.filter(r=>!t.some(i=>i===r));if(o.length>0)for(const r of o)s[r]=e0({inputValue:r,allSuggestions:n}).values;return s}var Mge=new Set(["firstChildChanged","lastChildChanged","childIndexChanged"]),Nge={moduleName:"Validation",version:ct,beans:[kge]};function j2(e){const t=e.sibling;t&&(t.childrenAfterFilter=e.childrenAfterFilter)}var Lge=class extends We{constructor(){super(...arguments),this.beanName="filterStage",this.step="filter",this.refreshProps=["excludeChildrenWhenTreeDataFiltering"]}wireBeans(e){this.filterManager=e.filterManager}execute(e){const{changedPath:t}=e;this.filter(t)}filter(e){var n;const t=!!((n=this.filterManager)!=null&&n.isChildFilterPresent());this.filterNodes(t,e)}filterNodes(e,t){const n=(s,o)=>{s.hasChildren()&&e&&!o?s.childrenAfterFilter=s.childrenAfterGroup.filter(r=>{const i=r.childrenAfterFilter&&r.childrenAfterFilter.length>0,a=r.data&&this.filterManager.doesRowPassFilter({rowNode:r});return i||a}):s.childrenAfterFilter=s.childrenAfterGroup,j2(s)};if(this.doingTreeDataFiltering()){const s=(r,i)=>{if(r.childrenAfterGroup)for(let a=0;a<r.childrenAfterGroup.length;a++){const l=r.childrenAfterGroup[a],c=i||this.filterManager.doesRowPassFilter({rowNode:l});l.childrenAfterGroup?s(r.childrenAfterGroup[a],c):n(l,c)}n(r,i)},o=r=>s(r,!1);t.executeFromRootNode(o)}else{const s=o=>n(o,!1);t.forEachChangedNodeDepthFirst(s,!0)}}doingTreeDataFiltering(){return this.gos.get("treeData")&&!this.gos.get("excludeChildrenWhenTreeDataFiltering")}},Vge=class extends F0{constructor(){super(...arguments),this.iconCreated=!1}wireComp(e,t,n,s,o){this.comp=e;const r=Jf(this,this.beans.context,o);this.eButtonShowMainFilter=n,this.eFloatingFilterBody=s,this.setGui(t,r),this.setupActive(),this.refreshHeaderStyles(),this.setupWidth(r),this.setupLeft(r),this.setupHover(r),this.setupFocus(r),this.setupAria(),this.setupFilterButton(),this.setupUserComp(),this.setupSyncWithFilter(r),this.setupUi(),r.addManagedElementListeners(this.eButtonShowMainFilter,{click:this.showParentFilter.bind(this)}),this.setupFilterChangedListener(r);const i=()=>this.onColDefChanged(r);r.addManagedListeners(this.column,{colDefChanged:i}),r.addManagedEventListeners({filterSwitched:({column:a})=>{a===this.column&&i()}}),r.addDestroyFunc(()=>{this.eButtonShowMainFilter=null,this.eFloatingFilterBody=null,this.userCompDetails=null,this.clearComponent()})}resizeHeader(){}moveHeader(){}getHeaderClassParams(){const{column:e,beans:t}=this,n=e.colDef;return Ft(t.gos,{colDef:n,column:e,floatingFilter:!0})}setupActive(){const e=this.column.getColDef(),t=!!e.filter,n=!!e.floatingFilter;this.active=t&&n}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=hr("filter",this.beans,this.column);e&&(this.iconCreated=!0,this.eButtonShowMainFilter.appendChild(e))}setupFocus(e){e.createManagedBean(new Cd(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.getLocaleTextFunc();rd(this.eButtonShowMainFilter,e("ariaFilterMenuOpen","Open Filter Menu"))}onTabKeyDown(e){var i;const{beans:t}=this;if(Un(t)===this.eGui)return;const o=Sc(t,this.eGui,null,e.shiftKey);if(o){(i=t.headerNavigation)==null||i.scrollToColumn(this.column),e.preventDefault(),o.focus();return}const r=this.findNextColumnWithFloatingFilter(e.shiftKey);r&&t.focusSvc.focusHeaderPosition({headerPosition:{headerRowIndex:this.rowCtrl.rowIndex,column:r},event:e})&&e.preventDefault()}findNextColumnWithFloatingFilter(e){const t=this.beans.visibleCols;let n=this.column;do if(n=e?t.getColBefore(n):t.getColAfter(n),!n)break;while(!n.getColDef().filter||!n.getColDef().floatingFilter);return n}handleKeyDown(e){super.handleKeyDown(e);const t=this.getWrapperHasFocus();switch(e.key){case Oe.UP:case Oe.DOWN:case Oe.LEFT:case Oe.RIGHT:if(t)return;Rc(e);case Oe.ENTER:t&&bc(this.eGui)&&e.preventDefault();break;case Oe.ESCAPE:t||this.eGui.focus()}}onFocusIn(e){if(this.eGui.contains(e.relatedTarget))return;const n=!!e.relatedTarget&&!e.relatedTarget.classList.contains("ag-floating-filter"),s=!!e.relatedTarget&&pc(e.relatedTarget,"ag-floating-filter");if(n&&s&&e.target===this.eGui){const o=this.lastFocusEvent,r=!!(o&&o.key===Oe.TAB);if(o&&r){const i=o.shiftKey;bc(this.eGui,i)}}this.focusThis()}setupHover(e){var t;(t=this.beans.colHover)==null||t.addHeaderFilterColumnHoverListener(e,this.comp,this.column,this.eGui)}setupLeft(e){const t=new x0(this.column,this.eGui,this.beans);e.createManagedBean(t)}setupFilterButton(){var e;this.suppressFilterButton=!((e=this.beans.menuSvc)!=null&&e.isFloatingFilterButtonEnabled(this.column)),this.highlightFilterButtonWhenActive=!$o(this.gos)}setupUserComp(){var t;if(!this.active)return;const e=(t=this.beans.colFilter)==null?void 0:t.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter());e&&this.setCompDetails(e)}setCompDetails(e){this.userCompDetails=e,this.comp.setCompDetails(e)}showParentFilter(){var t;const e=this.suppressFilterButton?this.eFloatingFilterBody:this.eButtonShowMainFilter;(t=this.beans.menuSvc)==null||t.showFilterMenu({column:this.column,buttonElement:e,containerType:"floatingFilter",positionBy:"button"})}setupSyncWithFilter(e){if(!this.active)return;const{beans:{colFilter:t},column:n,gos:s}=this,o=r=>{if((r==null?void 0:r.source)==="filterDestroyed"&&(!this.isAlive()||!(t!=null&&t.isAlive())))return;const i=this.comp.getFloatingFilterComp();i&&i.then(a=>{if(a){if(s.get("enableFilterHandlers")){const u=r;let d="filter";u!=null&&u.afterFloatingFilter?d="ui":u!=null&&u.afterDataChange?d="dataChanged":(r==null?void 0:r.source)==="api"&&(d="api"),this.updateFloatingFilterParams(this.userCompDetails,d);return}const l=t==null?void 0:t.getCurrentFloatingFilterParentModel(n),c=r?{...r,columns:r.columns??[],source:r.source==="api"?"api":"columnFilter"}:null;a.onParentModelChanged(l,c)}})};[this.destroySyncListener]=e.addManagedListeners(n,{filterChanged:o}),t!=null&&t.isFilterActive(n)&&o(null)}setupWidth(e){const t=()=>{const n=`${this.column.getActualWidth()}px`;this.comp.setWidth(n)};e.addManagedListeners(this.column,{widthChanged:t}),t()}setupFilterChangedListener(e){this.active&&([this.destroyFilterChangedListener]=e.addManagedListeners(this.column,{filterChanged:this.updateFilterButton.bind(this)}),this.updateFilterButton())}updateFilterButton(){var e;if(!this.suppressFilterButton&&this.comp){const t=!!((e=this.beans.filterManager)!=null&&e.isFilterAllowed(this.column));this.comp.setButtonWrapperDisplayed(t),this.highlightFilterButtonWhenActive&&t&&this.eButtonShowMainFilter.classList.toggle("ag-filter-active",this.column.isFilterActive())}}onColDefChanged(e){const t=this.active;this.setupActive();const n=!t&&this.active;t&&!this.active&&(this.destroySyncListener(),this.destroyFilterChangedListener());const s=this.beans.colFilter,o=this.active?s==null?void 0:s.getFloatingFilterCompDetails(this.column,()=>this.showParentFilter()):null,r=this.comp.getFloatingFilterComp();!r||!o?this.updateCompDetails(e,o,n):r.then(i=>{!i||s!=null&&s.areFilterCompsDifferent(this.userCompDetails??null,o)?this.updateCompDetails(e,o,n):this.updateFloatingFilterParams(o,"colDef")})}updateCompDetails(e,t,n){this.isAlive()&&(this.setCompDetails(t),this.setupFilterButton(),this.setupUi(),n&&(this.setupSyncWithFilter(e),this.setupFilterChangedListener(e)))}updateFloatingFilterParams(e,t){var s;if(!e)return;let n=e.params;(s=this.comp.getFloatingFilterComp())==null||s.then(o=>{var r;typeof(o==null?void 0:o.refresh)=="function"&&(this.gos.get("enableFilterHandlers")&&(n={...n,model:Ts(((r=this.beans.colFilter)==null?void 0:r.model)??{},this.column.getColId()),source:t}),o.refresh(n))})}addResizeAndMoveKeyboardListeners(){}destroy(){super.destroy(),this.destroySyncListener=null,this.destroyFilterChangedListener=null}};function Bge(e,t){var s;const n=e.colModel.getCol(t);if(!n){En(12,{colKey:t});return}(s=e.menuSvc)==null||s.showColumnMenu({column:n,positionBy:"auto"})}function $ge(e){var t;(t=e.menuSvc)==null||t.hidePopupMenu()}var Hge={moduleName:"SharedMenu",version:ct,beans:[Jle],apiFunctions:{showColumnMenu:Bge,hidePopupMenu:$ge}},Gge=class extends wae{postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.gridCtrl=e.gridCtrl}),this.addManagedEventListeners({gridStylesChanged:this.handleThemeChange.bind(this)})}getDefaultPopupParent(){return this.gridCtrl.getGui()}positionPopupForMenu(e){const{eventSource:t,ePopup:n,event:s}=e,o=t.getBoundingClientRect(),r=this.getParentRect();this.setAlignedTo(t,n);let i=!1;const a=()=>{const l=this.keepXYWithinBounds(n,o.top-r.top,0),c=n.clientWidth>0?n.clientWidth:200;i||(n.style.minWidth=`${c}px`,i=!0);const d=r.right-r.left-c;let h;return this.gos.get("enableRtl")?(h=p(),h<0&&(h=f(),this.setAlignedStyles(n,"left")),h>d&&(h=0,this.setAlignedStyles(n,"right"))):(h=f(),h>d&&(h=p(),this.setAlignedStyles(n,"right")),h<0&&(h=0,this.setAlignedStyles(n,"left"))),{x:h,y:l};function f(){return o.right-r.left-2}function p(){return o.left-r.left-c}};this.positionPopup({ePopup:n,keepWithinBounds:!0,updatePosition:a,postProcessCallback:()=>this.callPostProcessPopup(e,"subMenu",n,t,s instanceof MouseEvent?s:void 0)})}callPostProcessPopup(e,t,n,s,o){const r=this.gos.getCallback("postProcessPopup");if(r){const{column:i,rowNode:a}=e;r({column:i,rowNode:a,ePopup:n,type:t,eventSource:s,mouseEvent:o})}}getActivePopups(){return this.popupList.map(e=>e.element)}handleThemeChange(e){if(e.themeChanged){const t=this.beans.environment;for(const n of this.popupList)t.applyThemeClasses(n.wrapper)}}hasAnchoredPopup(){return this.popupList.some(e=>e.isAnchored)}isStopPropagation(e){return ga(e)}},Ey={moduleName:"Popup",version:ct,beans:[Gge]},Uge=".ag-set-filter{--ag-indentation-level:0}.ag-set-filter-item{align-items:center;display:flex;height:100%}:where(.ag-ltr) .ag-set-filter-item{padding-left:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}:where(.ag-rtl) .ag-set-filter-item{padding-right:calc(var(--ag-widget-container-horizontal-padding) + var(--ag-indentation-level)*var(--ag-set-filter-indent-size))}.ag-set-filter-item-checkbox{display:flex;height:100%;width:100%}.ag-set-filter-group-icons{display:block;>*{cursor:pointer}}:where(.ag-ltr) .ag-set-filter-group-icons{margin-right:var(--ag-widget-container-horizontal-padding)}:where(.ag-rtl) .ag-set-filter-group-icons{margin-left:var(--ag-widget-container-horizontal-padding)}.ag-filter-body-wrapper{display:flex;flex-direction:column}:where(.ag-menu:not(.ag-tabs) .ag-filter) .ag-filter-body-wrapper,:where(.ag-menu:not(.ag-tabs) .ag-filter)>:not(.ag-filter-wrapper){min-width:180px}.ag-filter-filter{flex:1 1 0px}.ag-filter-condition{display:flex;justify-content:center}.ag-floating-filter-body{display:flex;flex:1 1 auto;height:100%;position:relative}.ag-floating-filter-full-body{align-items:center;display:flex;flex:1 1 auto;height:100%;overflow:hidden;width:100%}:where(.ag-floating-filter-full-body)>div{flex:1 1 auto}.ag-floating-filter-input{align-items:center;display:flex;width:100%;>*{flex:1 1 auto}:where(.ag-input-field-input[type=date]),:where(.ag-input-field-input[type=datetime-local]){width:1px}}.ag-floating-filter-button{display:flex;flex:none}.ag-date-floating-filter-wrapper{display:flex}.ag-set-floating-filter-input :where(input)[disabled]{pointer-events:none}.ag-floating-filter-button-button{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;height:var(--ag-icon-size);width:var(--ag-icon-size)}.ag-filter-loading{align-items:unset;background-color:var(--ag-chrome-background-color);height:100%;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;width:100%;z-index:1;:where(.ag-menu) &{background-color:var(--ag-menu-background-color)}}.ag-filter-separator{border-top:solid var(--ag-border-width) var(--menu-separator-color)}:where(.ag-filter-select) .ag-picker-field-wrapper{width:0}.ag-filter-condition-operator{height:17px}:where(.ag-ltr) .ag-filter-condition-operator-or{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-condition-operator-or{margin-right:calc(var(--ag-spacing)*2)}.ag-set-filter-select-all{padding-top:var(--ag-widget-container-vertical-padding)}.ag-filter-no-matches,.ag-set-filter-list{height:calc(var(--ag-list-item-height)*6)}.ag-filter-no-matches{padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}.ag-set-filter-tree-list{height:calc(var(--ag-list-item-height)*10)}.ag-set-filter-filter{margin-left:var(--ag-widget-container-horizontal-padding);margin-right:var(--ag-widget-container-horizontal-padding);margin-top:var(--ag-widget-container-vertical-padding)}.ag-filter-to{margin-top:var(--ag-widget-vertical-spacing)}.ag-mini-filter{margin:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}:where(.ag-ltr) .ag-set-filter-add-group-indent{margin-left:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-rtl) .ag-set-filter-add-group-indent{margin-right:calc(var(--ag-icon-size) + var(--ag-widget-container-horizontal-padding))}:where(.ag-filter-menu) .ag-set-filter-list{min-width:200px}.ag-filter-virtual-list-item:focus-visible{box-shadow:inset var(--ag-focus-shadow)}.ag-filter-apply-panel{display:flex;justify-content:flex-end;overflow:hidden;padding:var(--ag-widget-vertical-spacing) var(--ag-widget-container-horizontal-padding) var(--ag-widget-container-vertical-padding)}.ag-filter-apply-panel-button{line-height:1.5}:where(.ag-ltr) .ag-filter-apply-panel-button{margin-left:calc(var(--ag-spacing)*2)}:where(.ag-rtl) .ag-filter-apply-panel-button{margin-right:calc(var(--ag-spacing)*2)}.ag-simple-filter-body-wrapper{display:flex;flex-direction:column;min-height:calc(var(--ag-list-item-height) + var(--ag-widget-container-vertical-padding) + var(--ag-widget-vertical-spacing));overflow-y:auto;padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);padding-bottom:calc(var(--ag-widget-container-vertical-padding) - var(--ag-widget-vertical-spacing));&>*{margin-bottom:var(--ag-widget-vertical-spacing)}:where(.ag-resizer-wrapper){margin:0}}.ag-multi-filter-menu-item{margin:var(--ag-spacing) 0}.ag-multi-filter-group-title-bar{background-color:transparent;color:var(--ag-header-text-color);font-weight:500;padding:calc(var(--ag-spacing)*1.5) var(--ag-spacing)}.ag-group-filter-field-select-wrapper{display:flex;flex-direction:column;gap:var(--ag-widget-vertical-spacing);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding)}";function Wge(e){const t=e.filterManager;return!!(t!=null&&t.isColumnFilterPresent())||!!(t!=null&&t.isAggregateFilterPresent())}function zge(e,t){var n;return((n=e.filterManager)==null?void 0:n.getColumnFilterInstance(t))??Promise.resolve(void 0)}function jge(e,t){var s;const n=e.colModel.getColDefCol(t);if(n)return(s=e.colFilter)==null?void 0:s.destroyFilter(n,"api")}function Kge(e,t){e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=e.filterManager)==null?void 0:n.setFilterModel(t)})}function qge(e){var t;return((t=e.filterManager)==null?void 0:t.getFilterModel())??{}}function Yge(e,t,n){const{gos:s,colModel:o,colFilter:r}=e;n&&!s.get("enableFilterHandlers")&&(Je(288),n=!1);const i=o.getColDefCol(t);return i?(r==null?void 0:r.getModelForColumn(i,n))??null:null}function Zge(e,t,n){var s;return((s=e.filterManager)==null?void 0:s.setColumnFilterModel(t,n))??Promise.resolve()}function Xge(e,t){var s;const n=e.colModel.getCol(t);if(!n){En(12,{colKey:t});return}(s=e.menuSvc)==null||s.showFilterMenu({column:n,containerType:"columnFilter",positionBy:"auto"})}function Jge(e){var t;(t=e.menuSvc)==null||t.hideFilterMenu()}function Qge(e,t){var s;const n=e.colModel.getCol(t);if(!n){En(12,{colKey:t});return}return(s=e.colFilter)==null?void 0:s.getHandler(n,!0)}function eme(e,t){const{colModel:n,colFilter:s,gos:o}=e;if(!o.get("enableFilterHandlers")){Je(287);return}const{colId:r,action:i}=t;if(r){const a=n.getColById(r);a&&(s==null||s.updateModel(a,i))}else s==null||s.updateAllModels(i)}var tme={filterHandler:()=>({doesFilterPass:()=>!0})},nme=class extends We{constructor(){super(...arguments),this.beanName="colFilter",this.allColumnFilters=new Map,this.allColumnListeners=new Map,this.activeAggregateFilters=[],this.activeColumnFilters=[],this.processingFilterChange=!1,this.modelUpdates=[],this.columnModelUpdates=[],this.state=new Map,this.handlerMap={...sV},this.isGlobalButtons=!1,this.activeFilterComps=new Set}postConstruct(){var n,s;this.addManagedEventListeners({gridColumnsChanged:this.onColumnsChanged.bind(this),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)});const e=this.gos,t={...((s=(n=e.get("initialState"))==null?void 0:n.filter)==null?void 0:s.filterModel)??{}};this.initialModel=t,this.model={...t},e.get("enableFilterHandlers")||delete this.handlerMap.agMultiColumnFilter}refreshModel(){this.onNewRowsLoaded("rowDataUpdated")}setModel(e,t="api",n){const{colModel:s,dataTypeSvc:o,filterManager:r}=this.beans;if(o!=null&&o.isPendingInference){this.modelUpdates.push({model:e,source:t});return}const i=[],a=this.getModel(!0);if(e){const l=new Set(Object.keys(e));this.allColumnFilters.forEach((c,u)=>{const d=e[u];i.push(this.setModelOnFilterWrapper(c,d)),l.delete(u)}),l.forEach(c=>{const u=s.getColDefCol(c)||s.getCol(c);if(!u){Je(62,{colId:c});return}if(!u.isFilterAllowed()){Je(63,{colId:c});return}const d=this.getOrCreateFilterWrapper(u,!0);if(!d){Je(64,{colId:c});return}i.push(this.setModelOnFilterWrapper(d,e[c],!0))})}else this.model={},this.allColumnFilters.forEach(l=>{i.push(this.setModelOnFilterWrapper(l,null))});jn.all(i).then(()=>{const l=this.getModel(!0),c=[];this.allColumnFilters.forEach((u,d)=>{const h=a?a[d]:null,f=l?l[d]:null;Of(h,f)||c.push(u.column)}),c.length>0?r==null||r.onFilterChanged({columns:c,source:t}):n&&this.updateActive("filterChanged")})}getModel(e){var r;const t={},{allColumnFilters:n,initialModel:s,beans:{colModel:o}}=this;if(n.forEach((i,a)=>{const l=this.getModelFromFilterWrapper(i);dt(l)&&(t[a]=l)}),!e)for(const i of Object.keys(s)){const a=s[i];dt(a)&&!n.has(i)&&((r=o.getCol(i))!=null&&r.isFilterAllowed())&&(t[i]=a)}return t}setState(e,t,n="api"){if(this.state.clear(),t)for(const s of Object.keys(t)){const o=t[s];this.state.set(s,{model:Ts(this.model,s),state:o})}this.setModel(e,n,!0)}getState(){const e=this.state;if(!e.size)return;const t={};let n=!1;return e.forEach((s,o)=>{const r=s.state;r!=null&&(n=!0,t[o]=r)}),n?t:void 0}getModelFromFilterWrapper(e){const n=e.column.getColId();if(e.isHandler)return Ts(this.model,n);const s=e.filter;return s?typeof s.getModel!="function"?(Je(66),null):s.getModel():Ts(this.initialModel,n)}isFilterPresent(){return this.activeColumnFilters.length>0}isAggFilterPresent(){return!!this.activeAggregateFilters.length}disableFilters(){this.initialModel={};const{allColumnFilters:e}=this;return e.size?(e.forEach(t=>this.disposeFilterWrapper(t,"advancedFilterEnabled")),!0):!1}updateActiveFilters(){const e=c=>c?c.isFilterActive?c.isFilterActive():(Je(67),!1):!1,{colModel:t,gos:n}=this.beans,s=!!OE(n),o=c=>{if(!c.isPrimary())return!0;const d=!t.isPivotActive();return!c.isValueActive()||!d?!1:t.isPivotMode()?!0:s},r=[],i=[],a=(c,u,d)=>{u&&(o(c)?r.push(d):i.push(d))},l=[];return this.allColumnFilters.forEach(c=>{const u=c.column,d=u.getColId();if(c.isHandler)l.push(jn.resolve().then(()=>{a(u,this.isHandlerActive(u),{colId:d,isHandler:!0,handler:c.handler,handlerParams:c.handlerParams})}));else{const h=ul(c);h&&l.push(h.then(f=>{a(u,e(f),{colId:d,isHandler:!1,comp:f})}))}}),jn.all(l).then(()=>{this.activeAggregateFilters=r,this.activeColumnFilters=i})}updateFilterFlagInColumns(e,t){var s;const n=[];return this.allColumnFilters.forEach(o=>{const r=o.column;if(o.isHandler)n.push(jn.resolve().then(()=>{this.setColFilterActive(r,this.isHandlerActive(r),e,t)}));else{const i=ul(o);i&&n.push(i.then(a=>{this.setColFilterActive(r,a.isFilterActive(),e,t)}))}}),(s=this.beans.groupFilter)==null||s.updateFilterFlags(e,t),jn.all(n)}doFiltersPass(e,t,n){const{data:s,aggData:o}=e,r=n?this.activeAggregateFilters:this.activeColumnFilters,i=n?o:s,a=this.model;for(let l=0;l<r.length;l++){const c=r[l],{colId:u,isHandler:d}=c;if(u!==t)if(d){const{handler:h,handlerParams:f}=c;if(!h.doesFilterPass({node:e,data:i,model:Ts(a,u),handlerParams:f}))return!1}else{const h=c.comp;if(typeof h.doesFilterPass!="function"){En(91);continue}if(!h.doesFilterPass({node:e,data:i}))return!1}}return!0}getHandlerParams(e){const t=this.allColumnFilters.get(e.getColId());return t!=null&&t.isHandler?t.handlerParams:void 0}callOnFilterChangedOutsideRenderCycle(e){const{rowRenderer:t,filterManager:n}=this.beans,s=()=>{this.isAlive()&&(n==null||n.onFilterChanged(e))};t.isRefreshInProgress()?setTimeout(s,0):s()}updateBeforeFilterChanged(e={}){const{column:t,additionalEventAttributes:n}=e,s=t==null?void 0:t.getColId();return this.updateActiveFilters().then(()=>this.updateFilterFlagInColumns("filterChanged",n).then(()=>{this.allColumnFilters.forEach(o=>{var a,l,c;const{column:r,isHandler:i}=o;s!==r.getColId()&&(i&&((l=(a=o.handler).onAnyFilterChanged)==null||l.call(a)),(c=ul(o,i))==null||c.then(u=>{typeof(u==null?void 0:u.onAnyFilterChanged)=="function"&&u.onAnyFilterChanged()}))}),this.processingFilterChange=!0}))}updateAfterFilterChanged(){this.processingFilterChange=!1}isSuppressFlashingCellsBecauseFiltering(){return!(this.gos.get("allowShowChangeAfterFilter")??!1)&&this.processingFilterChange}onNewRowsLoaded(e){const t=[];this.allColumnFilters.forEach(n=>{var r,i;const s=n.isHandler;s&&((i=(r=n.handler).onNewRowsLoaded)==null||i.call(r));const o=ul(n,s);o&&t.push(o.then(a=>{var l;(l=a.onNewRowsLoaded)==null||l.call(a)}))}),jn.all(t).then(()=>this.updateActive(e,{afterDataChange:!0}))}updateActive(e,t){this.updateFilterFlagInColumns(e,t).then(()=>this.updateActiveFilters())}createGetValue(e,t){const{filterValueSvc:n,colModel:s}=this.beans;return(o,r)=>{const i=r?s.getCol(r):e;return i?n.getValue(i,o,t):void 0}}isFilterActive(e){const t=this.cachedFilter(e);if(t!=null&&t.isHandler)return this.isHandlerActive(e);const n=t==null?void 0:t.filter;return n?n.isFilterActive():Ts(this.initialModel,e.getColId())!=null}isHandlerActive(e){const t=dt(Ts(this.model,e.getColId()));if(t)return t;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterActive(e):!1}getOrCreateFilterUi(e){const t=this.getOrCreateFilterWrapper(e,!0);return t?ul(t):null}getFilterUiForDisplay(e){const t=this.getOrCreateFilterWrapper(e,!0);if(!t)return null;const n=ul(t);return n?n.then(s=>({comp:s,params:t.filterUi.filterParams,isHandler:t.isHandler})):null}getHandler(e,t){const n=this.getOrCreateFilterWrapper(e,t);return n!=null&&n.isHandler?n.handler:void 0}getOrCreateFilterWrapper(e,t){if(!e.isFilterAllowed())return;let n=this.cachedFilter(e);return!n&&t&&(n=this.createFilterWrapper(e),this.setColumnFilterWrapper(e,n)),n}cachedFilter(e){return this.allColumnFilters.get(e.getColId())}getDefaultFilter(e,t=!1){return this.getDefaultFilterFromDataType(()=>{var n;return(n=this.beans.dataTypeSvc)==null?void 0:n.getBaseDataType(e)},t)}getDefaultFilterFromDataType(e,t=!1){return tre(this.gos)?t?"agSetColumnFloatingFilter":"agSetColumnFilter":Uae(e(),t)}getDefaultFloatingFilter(e){return this.getDefaultFilter(e,!0)}createFilterComp(e,t,n,s,o,r){const i=()=>{const c=this.createFilterCompParams(e,o,r),u=s(c,o);return oie(this.beans.userCompFactory,t,u,n)},a=i();return a?{compDetails:a,createFilterUi:c=>(c?i():a).newAgStackInstance()}:null}createFilterInstance(e,t,n,s){var d,h;const o=this.beans.selectableFilter;o!=null&&o.isSelectable(t)&&(t=o.getFilterDef(e,t));const{handler:r,handlerParams:i,handlerGenerator:a}=this.createHandler(e,t,n)??{},l=this.createFilterComp(e,t,n,s,!!r,"init");if(!l)return{compDetails:null,createFilterUi:null,handler:r,handlerGenerator:a,handlerParams:i};const{compDetails:c,createFilterUi:u}=l;return this.isGlobalButtons&&((h=(d=c.params)==null?void 0:d.buttons)!=null&&h.length||Je(281,{colId:e.getColId()})),{compDetails:c,handler:r,handlerGenerator:a,handlerParams:i,createFilterUi:u}}createBaseFilterParams(e,t){const{filterManager:n,rowModel:s}=this.beans;return Ft(this.gos,{column:e,colDef:e.getColDef(),getValue:this.createGetValue(e),doesRowPassOtherFilter:t?()=>!0:o=>(n==null?void 0:n.doesRowPassOtherFilters(e.getColId(),o))??!0,rowModel:s})}createFilterCompParams(e,t,n,s){const o=this.filterChangedCallbackFactory(e),r=this.createBaseFilterParams(e,s);if(r.filterChangedCallback=o,r.filterModifiedCallback=s?()=>{}:i=>this.filterModified(e,i),t){const i=r,a=e.getColId(),l=Ts(this.model,a);i.model=l,i.state=this.state.get(a)??{model:l},i.onModelChange=(c,u)=>{this.updateStoredModel(a,c),this.refreshHandlerAndUi(e,c,"ui",!1,u).then(()=>{o({...u,source:"columnFilter"})})},i.onStateChange=c=>{this.updateState(e,c),this.updateOrRefreshFilterUi(e)},i.onAction=(c,u,d)=>{this.updateModel(e,c,u),this.dispatchLocalEvent({type:"filterAction",column:e,action:c,event:d})},i.getHandler=()=>this.getHandler(e,!0),i.onUiChange=c=>this.filterUiChanged(e,c),i.source=n}return r}createFilterUiForHandler(e,t){return t?{created:!1,create:t,filterParams:e.params,compDetails:e}:null}createFilterUiLegacy(e,t,n){const s=t(),o={created:!0,create:t,filterParams:e.params,compDetails:e,promise:s};return s.then(n),o}createFilterWrapper(e){var a;const{compDetails:t,handler:n,handlerGenerator:s,handlerParams:o,createFilterUi:r}=this.createFilterInstance(e,e.getColDef(),this.getDefaultFilter(e),l=>l),i=e.getColId();if(n)return delete this.initialModel[i],(a=n.init)==null||a.call(n,{...o,source:"init",model:Ts(this.model,i)}),{column:e,isHandler:!0,handler:n,handlerGenerator:s,handlerParams:o,filterUi:this.createFilterUiForHandler(t,r)};if(r){const l={column:e,filterUi:null,isHandler:!1};return l.filterUi=this.createFilterUiLegacy(t,r,c=>{l.filter=c??void 0}),l}return{column:e,filterUi:null,isHandler:!1}}createHandlerFunc(e,t,n){var f;const{gos:s,frameworkOverrides:o,registry:r}=this.beans;let i;const a=p=>{const g=p.filter;if(EL(g)){const v=g.handler;return v||(i=g.doesFilterPass,i?()=>({doesFilterPass:i}):void 0)}return typeof g=="string"?g:void 0},l=s.get("enableFilterHandlers"),c=l?a(t):void 0,u=p=>()=>this.createBean(r.createDynamicBean(p,!0));let d,h;if(typeof c=="string"){const p=(f=s.get("filterHandlers"))==null?void 0:f[c];p!=null?d=p:Pae.has(c)&&(d=u(c),h=c)}else d=c;if(!d){let p;const{compName:g,jsComp:v,fwComp:C}=IL(o,t);g?p=g:v==null&&C==null&&t.filter===!0&&(p=n),h=this.handlerMap[p],h&&(d=u(h))}return d?{filterHandler:d,handlerNameOrCallback:i??h}:l?(os(s)&&Je(277,{colId:e.getColId()}),tme):void 0}createHandler(e,t,n){const s=this.createHandlerFunc(e,t,n);if(!s)return;const o=$E(this.beans.userCompFactory,t,this.createFilterCompParams(e,!0,"init")),{handlerNameOrCallback:r,filterHandler:i}=s,{handler:a,handlerParams:l}=this.createHandlerFromFunc(e,i,o);return{handler:a,handlerParams:l,handlerGenerator:r??i}}createHandlerFromFunc(e,t,n){const s=e.getColDef(),o=t(Ft(this.gos,{column:e,colDef:s})),r=this.createHandlerParams(e,n);return{handler:o,handlerParams:r}}createHandlerParams(e,t){const n=e.getColDef(),s=e.getColId(),o=this.filterChangedCallbackFactory(e);return Ft(this.gos,{colDef:n,column:e,getValue:this.createGetValue(e),doesRowPassOtherFilter:r=>{var i;return((i=this.beans.filterManager)==null?void 0:i.doesRowPassOtherFilters(s,r))??!0},onModelChange:(r,i)=>{this.updateStoredModel(s,r),this.refreshHandlerAndUi(e,r,"handler",!1,i).then(()=>{o({...i,source:"columnFilter"})})},filterParams:t})}onColumnsChanged(){const e=[],{colModel:t,filterManager:n,groupFilter:s}=this.beans;this.allColumnFilters.forEach((r,i)=>{let a;r.column.isPrimary()?a=t.getColDefCol(i):a=t.getCol(i),!(a&&a===r.column)&&(e.push(r.column),this.disposeFilterWrapper(r,"columnChanged"),this.disposeColumnListener(i))});const o=s&&e.every(r=>s.isGroupFilter(r));e.length>0&&!o&&(n==null||n.onFilterChanged({columns:e,source:"api"}))}isFilterAllowed(e){if(!e.isFilterAllowed())return!1;const n=this.beans.groupFilter;return n!=null&&n.isGroupFilter(e)?n.isFilterAllowed(e):!0}getFloatingFilterCompDetails(e,t){const{userCompFactory:n,frameworkOverrides:s,selectableFilter:o}=this.beans,r=h=>{const f=this.getOrCreateFilterUi(e);f!=null&&f.then(p=>{h(ep(p))})},i=e.getColDef(),a=o!=null&&o.isSelectable(i)?o.getFilterDef(e,i):i,l=qae(s,a,()=>this.getDefaultFloatingFilter(e))??"agReadOnlyFloatingFilter",c=this.gos.get("enableFilterHandlers"),u=$E(n,a,this.createFilterCompParams(e,c,"init",!0)),d=Ft(this.gos,{column:e,filterParams:u,currentParentModel:()=>this.getCurrentFloatingFilterParentModel(e),parentFilterInstance:r,showParentFilter:t});if(c){const h=d,f=e.getColId(),p=this.filterChangedCallbackFactory(e);h.onUiChange=g=>this.floatingFilterUiChanged(e,g),h.model=Ts(this.model,f),h.onModelChange=(g,v)=>{this.updateStoredModel(f,g),this.refreshHandlerAndUi(e,g,"floating",!0,v).then(()=>{p({...v,source:"columnFilter"})})},h.getHandler=()=>this.getHandler(e,!0),h.source="init"}return cie(n,i,d,l)}getCurrentFloatingFilterParentModel(e){return this.getModelFromFilterWrapper(this.cachedFilter(e)??{column:e})}destroyFilterUi(e,t,n,s){const o="paramsUpdated";if(e.isHandler){const r=t.getColId();delete this.initialModel[r],this.state.delete(r);const i=e.filterUi,a=this.createFilterUiForHandler(n,s);e.filterUi=a;const l=this.eventSvc;i!=null&&i.created?i.promise.then(c=>{this.destroyBean(c),l.dispatchEvent({type:"filterDestroyed",source:o,column:t})}):l.dispatchEvent({type:"filterHandlerDestroyed",source:o,column:t})}else this.destroyFilter(t,o)}destroyFilter(e,t="api"){const n=e.getColId(),s=this.allColumnFilters.get(n);this.disposeColumnListener(n),delete this.initialModel[n],s&&this.disposeFilterWrapper(s,t).then(o=>{var r;o&&this.isAlive()&&((r=this.beans.filterManager)==null||r.onFilterChanged({columns:[e],source:"api"}))})}disposeColumnListener(e){const t=this.allColumnListeners.get(e);t&&(this.allColumnListeners.delete(e),t())}disposeFilterWrapper(e,t){let n=!1;const{column:s,isHandler:o,filterUi:r}=e,i=s.getColId();o&&(n=this.isHandlerActive(s),this.destroyBean(e.handler),delete this.model[i],this.state.delete(i));const a=()=>{this.setColFilterActive(s,!1,"filterDestroyed"),this.allColumnFilters.delete(i),this.eventSvc.dispatchEvent({type:"filterDestroyed",source:t,column:s})};if(r){if(r.created)return r.promise.then(l=>(n=o?n:!!(l!=null&&l.isFilterActive()),this.destroyBean(l),a(),n));a()}return jn.resolve(n)}filterChangedCallbackFactory(e){return t=>{this.callOnFilterChangedOutsideRenderCycle({additionalEventAttributes:t,columns:[e],column:e,source:(t==null?void 0:t.source)??"columnFilter"})}}filterParamsChanged(e,t="api"){var v,C,S,b,w,D;const n=this.allColumnFilters.get(e);if(!n)return;const s=this.beans,o=n.column,r=o.getColDef(),i=o.isFilterAllowed(),a=this.getDefaultFilter(o),l=s.selectableFilter,c=l!=null&&l.isSelectable(r)?l.getFilterDef(o,r):r,u=i?this.createHandlerFunc(o,c,this.getDefaultFilter(o)):void 0,d=!!u,h=n.isHandler;if(h!=d){this.destroyFilter(o,"paramsUpdated");return}const{compDetails:f,createFilterUi:p}=(i?this.createFilterComp(o,c,a,R=>R,d,"colDef"):null)??{compDetails:null,createFilterUi:null},g=(f==null?void 0:f.params)??$E(s.userCompFactory,c,this.createFilterCompParams(o,d,"colDef"));if(h){const R=(u==null?void 0:u.handlerNameOrCallback)??(u==null?void 0:u.filterHandler),T=Ts(this.model,e);if(n.handlerGenerator!=R){const I=n.handler,{handler:x,handlerParams:F}=this.createHandlerFromFunc(o,u.filterHandler,g);n.handler=x,n.handlerParams=F,n.handlerGenerator=R,delete this.model[e],(v=x.init)==null||v.call(x,{...F,source:"init",model:null}),this.destroyBean(I),T!=null&&((C=this.beans.filterManager)==null||C.onFilterChanged({columns:[o],source:t}))}else{const I=this.createHandlerParams(o,f==null?void 0:f.params);n.handlerParams=I,(b=(S=n.handler).refresh)==null||b.call(S,{...I,source:"colDef",model:T})}}if(this.areFilterCompsDifferent(((w=n.filterUi)==null?void 0:w.compDetails)??null,f)||!n.filterUi||!f){this.destroyFilterUi(n,o,f,p);return}n.filterUi.filterParams=g,(D=ul(n,h))==null||D.then(R=>{(R!=null&&R.refresh?R.refresh(g):!0)===!1?this.destroyFilterUi(n,o,f,p):this.dispatchLocalEvent({type:"filterParamsChanged",column:o,params:g})})}refreshHandlerAndUi(e,t,n,s,o){const r=this.cachedFilter(e);if(!r)return s&&this.getOrCreateFilterWrapper(e,!0),jn.resolve();if(!r.isHandler)return jn.resolve();const{filterUi:i,handler:a,handlerParams:l}=r;return Aae(()=>{if(i){const{created:c,filterParams:u}=i;if(c)return i.promise.then(d=>d?{filter:d,filterParams:u}:void 0);i.refreshed=!0}return jn.resolve(void 0)},a,l,t,this.state.get(e.getColId())??{model:t},n,o)}setColumnFilterWrapper(e,t){const n=e.getColId();this.allColumnFilters.set(n,t),this.allColumnListeners.set(n,this.addManagedListeners(e,{colDefChanged:()=>this.filterParamsChanged(n)})[0])}areFilterCompsDifferent(e,t){if(!t||!e)return!0;const{componentClass:n}=e,{componentClass:s}=t;return!(n===s||(n==null?void 0:n.render)&&(s==null?void 0:s.render)&&n.render===s.render)}hasFloatingFilters(){return this.beans.colModel.getCols().some(t=>t.getColDef().floatingFilter)}getFilterInstance(e){const t=this.beans.colModel.getColDefCol(e);if(!t)return Promise.resolve(void 0);const n=this.getOrCreateFilterUi(t);return n?new Promise(s=>{n.then(o=>{s(ep(o))})}):Promise.resolve(null)}processFilterModelUpdateQueue(){this.modelUpdates.forEach(({model:e,source:t})=>this.setModel(e,t)),this.modelUpdates=[],this.columnModelUpdates.forEach(({key:e,model:t,resolve:n})=>{this.setModelForColumn(e,t).then(()=>n())}),this.columnModelUpdates=[]}getModelForColumn(e,t){if(t){const{state:s,model:o}=this,r=e.getColId(),i=s.get(r);return i?i.model??null:Ts(o,r)}const n=this.cachedFilter(e);return n?this.getModelFromFilterWrapper(n):null}setModelForColumn(e,t){var n;if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){let s=()=>{};const o=new Promise(r=>{s=r});return this.columnModelUpdates.push({key:e,model:t,resolve:s}),o}return new Promise(s=>{this.setModelForColumnLegacy(e,t).then(o=>s(o))})}getStateForColumn(e){return this.state.get(e)??{model:Ts(this.model,e)}}setModelForColumnLegacy(e,t){const n=this.beans.colModel.getColDefCol(e),s=n?this.getOrCreateFilterWrapper(n,!0):null;return s?this.setModelOnFilterWrapper(s,t):jn.resolve()}setColDefPropsForDataType(e,t,n){var u;const s=e.filter,o=s===!0?this.getDefaultFilterFromDataType(()=>t.baseDataType):s;if(typeof o!="string")return;let r,i;const a=this.beans,{filterParams:l,filterValueGetter:c}=e;o==="agMultiColumnFilter"?{filterParams:r,filterValueGetter:i}=((u=a.multiFilter)==null?void 0:u.getParamsForDataType(l,c,t,n))??{}:{filterParams:r,filterValueGetter:i}=$ae(o,l,c,t,n,a,this.getLocaleTextFunc()),e.filterParams=r,i&&(e.filterValueGetter=i)}setColFilterActive(e,t,n,s){e.filterActive!==t&&(e.filterActive=t,e.dispatchColEvent("filterActiveChanged",n)),e.dispatchColEvent("filterChanged",n,s)}setModelOnFilterWrapper(e,t,n){return new jn(s=>{if(e.isHandler){const r=e.column,i=r.getColId(),a=this.model[i];if(this.updateStoredModel(i,t),n&&t===a){s();return}this.refreshHandlerAndUi(r,t,"api").then(()=>s());return}const o=ul(e);if(o){o.then(r=>{if(typeof(r==null?void 0:r.setModel)!="function"){Je(65),s();return}(r.setModel(t)||jn.resolve()).then(()=>s())});return}s()})}updateStoredModel(e,t){dt(t)?this.model[e]=t:delete this.model[e];const n=this.state.get(e),s={model:t,state:n==null?void 0:n.state};this.state.set(e,s)}filterModified(e,t){var n;(n=this.getOrCreateFilterUi(e))==null||n.then(s=>{this.eventSvc.dispatchEvent({type:"filterModified",column:e,filterInstance:s,...t})})}filterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"filterUiChanged",column:e,...t})}floatingFilterUiChanged(e,t){this.gos.get("enableFilterHandlers")&&this.eventSvc.dispatchEvent({type:"floatingFilterUiChanged",column:e,...t})}updateModel(e,t,n){var i;const s=e.getColId(),o=this.cachedFilter(e),r=()=>o==null?void 0:o.filterUi;iV(t,r,()=>Ts(this.model,s),()=>this.state.get(s),a=>this.updateState(e,a),a=>{var l,c;return(c=(l=r())==null?void 0:l.filterParams)==null?void 0:c.onModelChange(a,n)},o!=null&&o.isHandler?(i=o.handler.processModelToApply)==null?void 0:i.bind(o.handler):void 0)}updateAllModels(e,t){const n=[];this.allColumnFilters.forEach((s,o)=>{var i;const r=this.beans.colModel.getColDefCol(o);r&&iV(e,()=>s.filterUi,()=>Ts(this.model,o),()=>this.state.get(o),a=>this.updateState(r,a),a=>{this.updateStoredModel(o,a),this.dispatchLocalEvent({type:"filterAction",column:r,action:e}),n.push(this.refreshHandlerAndUi(r,a,"ui"))},s!=null&&s.isHandler?(i=s.handler.processModelToApply)==null?void 0:i.bind(s.handler):void 0)}),n.length&&jn.all(n).then(()=>{this.callOnFilterChangedOutsideRenderCycle({source:"columnFilter",additionalEventAttributes:t,columns:[]})})}updateOrRefreshFilterUi(e){const t=e.getColId();rV(()=>{var n;return(n=this.cachedFilter(e))==null?void 0:n.filterUi},()=>Ts(this.model,t),()=>this.state.get(t))}updateState(e,t){this.state.set(e.getColId(),t),this.dispatchLocalEvent({type:"filterStateChanged",column:e,state:t})}canApplyAll(){const{state:e,model:t,activeFilterComps:n}=this;for(const o of n)if(o.source==="COLUMN_MENU")return!1;let s=!1;for(const o of e.keys()){const r=e.get(o);if(r.valid===!1)return!1;(r.model??null)!==Ts(t,o)&&(s=!0)}return s}hasUnappliedModel(e){var s;const{model:t,state:n}=this;return(((s=n.get(e))==null?void 0:s.model)??null)!==Ts(t,e)}setGlobalButtons(e){this.isGlobalButtons=e,this.dispatchLocalEvent({type:"filterGlobalButtons",isGlobal:e})}shouldKeepStateOnDetach(e,t){if(t==="newFiltersToolPanel")return!0;const n=this.beans.filterPanelSvc;return n!=null&&n.isActive?!!n.getState(e.getColId()):!1}destroy(){super.destroy(),this.allColumnFilters.forEach(e=>this.disposeFilterWrapper(e,"gridDestroyed")),this.allColumnListeners.clear(),this.state.clear(),this.activeFilterComps.clear()}};function sme(e){var t;return!!((t=e.filterManager)!=null&&t.isAnyFilterPresent())}function ome(e,t="api"){var n;(n=e.filterManager)==null||n.onFilterChanged({source:t})}var rme=class extends We{constructor(){super(...arguments),this.beanName="filterManager",this.advFilterModelUpdateQueue=[]}wireBeans(e){this.quickFilter=e.quickFilter,this.advancedFilter=e.advancedFilter,this.colFilter=e.colFilter}postConstruct(){const e=this.refreshFiltersForAggregations.bind(this),t=this.updateAdvFilterColumns.bind(this);this.addManagedEventListeners({columnValueChanged:e,columnPivotChanged:e,columnPivotModeChanged:e,newColumnsLoaded:t,columnVisible:t,advancedFilterEnabledChanged:({enabled:s})=>this.onAdvFilterEnabledChanged(s),dataTypesInferred:this.processFilterModelUpdateQueue.bind(this)}),this.externalFilterPresent=this.isExternalFilterPresentCallback(),this.addManagedPropertyListeners(["isExternalFilterPresent","doesExternalFilterPass"],()=>{this.onFilterChanged({source:"api"})}),this.updateAggFiltering(),this.addManagedPropertyListener("groupAggFiltering",()=>{this.updateAggFiltering(),this.onFilterChanged()}),this.quickFilter&&this.addManagedListeners(this.quickFilter,{quickFilterChanged:()=>this.onFilterChanged({source:"quickFilter"})});const{gos:n}=this;this.alwaysPassFilter=n.get("alwaysPassFilter"),this.addManagedPropertyListener("alwaysPassFilter",()=>{this.alwaysPassFilter=n.get("alwaysPassFilter"),this.onFilterChanged({source:"api"})})}isExternalFilterPresentCallback(){const e=this.gos.getCallback("isExternalFilterPresent");return typeof e=="function"&&e({})}doesExternalFilterPass(e){const t=this.gos.get("doesExternalFilterPass");return typeof t=="function"&&t(e)}setFilterState(e,t,n="api"){var s;this.isAdvFilterEnabled()||(s=this.colFilter)==null||s.setState(e,t,n)}setFilterModel(e,t="api",n){var s;if(this.isAdvFilterEnabled()){n||this.warnAdvFilters();return}(s=this.colFilter)==null||s.setModel(e,t)}getFilterModel(){var e;return((e=this.colFilter)==null?void 0:e.getModel())??{}}getFilterState(){var e;return(e=this.colFilter)==null?void 0:e.getState()}isColumnFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isFilterPresent())}isAggregateFilterPresent(){var e;return!!((e=this.colFilter)!=null&&e.isAggFilterPresent())}isChildFilterPresent(){return this.isColumnFilterPresent()||this.isQuickFilterPresent()||this.externalFilterPresent||this.isAdvFilterPresent()}isAnyFilterPresent(){return this.isChildFilterPresent()||this.isAggregateFilterPresent()}isAdvFilterPresent(){return this.isAdvFilterEnabled()&&this.advancedFilter.isFilterPresent()}onAdvFilterEnabledChanged(e){var t,n;e?(t=this.colFilter)!=null&&t.disableFilters()&&this.onFilterChanged({source:"advancedFilter"}):(n=this.advancedFilter)!=null&&n.isFilterPresent()&&(this.advancedFilter.setModel(null),this.onFilterChanged({source:"advancedFilter"}))}isAdvFilterEnabled(){var e;return!!((e=this.advancedFilter)!=null&&e.isEnabled())}isAdvFilterHeaderActive(){return this.isAdvFilterEnabled()&&this.advancedFilter.isHeaderActive()}refreshFiltersForAggregations(){OE(this.gos)&&this.isAnyFilterPresent()&&this.onFilterChanged()}onFilterChanged(e={}){const{source:t,additionalEventAttributes:n,columns:s=[]}=e;this.externalFilterPresent=this.isExternalFilterPresentCallback(),(this.colFilter?this.colFilter.updateBeforeFilterChanged(e):jn.resolve()).then(()=>{var r;const o={source:t,type:"filterChanged",columns:s};n&&so(o,n),this.eventSvc.dispatchEvent(o),(r=this.colFilter)==null||r.updateAfterFilterChanged()})}isSuppressFlashingCellsBecauseFiltering(){var e;return!!((e=this.colFilter)!=null&&e.isSuppressFlashingCellsBecauseFiltering())}isQuickFilterPresent(){var e;return!!((e=this.quickFilter)!=null&&e.isFilterPresent())}updateAggFiltering(){this.aggFiltering=!!OE(this.gos)}isAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&this.shouldApplyQuickFilterAfterAgg()}isNonAggregateQuickFilterPresent(){return this.isQuickFilterPresent()&&!this.shouldApplyQuickFilterAfterAgg()}shouldApplyQuickFilterAfterAgg(){return(this.aggFiltering||this.beans.colModel.isPivotMode())&&!this.gos.get("applyQuickFilterBeforePivotOrAgg")}doesRowPassOtherFilters(e,t){return this.doesRowPassFilter({rowNode:t,colIdToSkip:e})}doesRowPassAggregateFilters(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.isAggregateFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip,!0))}doesRowPassFilter(e){var n;const{rowNode:t}=e;return(n=this.alwaysPassFilter)!=null&&n.call(this,t)?!0:!(this.isNonAggregateQuickFilterPresent()&&!this.quickFilter.doesRowPass(t)||this.externalFilterPresent&&!this.doesExternalFilterPass(t)||this.isColumnFilterPresent()&&!this.colFilter.doFiltersPass(t,e.colIdToSkip)||this.isAdvFilterPresent()&&!this.advancedFilter.doesFilterPass(t))}isFilterAllowed(e){var t;return this.isAdvFilterEnabled()?!1:!!((t=this.colFilter)!=null&&t.isFilterAllowed(e))}getAdvFilterModel(){return this.isAdvFilterEnabled()?this.advancedFilter.getModel():null}setAdvFilterModel(e,t="api"){var n;if(this.isAdvFilterEnabled()){if((n=this.beans.dataTypeSvc)!=null&&n.isPendingInference){this.advFilterModelUpdateQueue.push(e);return}this.advancedFilter.setModel(e??null),this.onFilterChanged({source:t})}}toggleAdvFilterBuilder(e,t){this.isAdvFilterEnabled()&&this.advancedFilter.getCtrl().toggleFilterBuilder({source:t,force:e})}updateAdvFilterColumns(){this.isAdvFilterEnabled()&&this.advancedFilter.updateValidity()&&this.onFilterChanged({source:"advancedFilter"})}hasFloatingFilters(){var e;return this.isAdvFilterEnabled()?!1:!!((e=this.colFilter)!=null&&e.hasFloatingFilters())}getColumnFilterInstance(e){var t;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve(void 0)):((t=this.colFilter)==null?void 0:t.getFilterInstance(e))??Promise.resolve(void 0)}warnAdvFilters(){Je(68)}setupAdvFilterHeaderComp(e){var t;(t=this.advancedFilter)==null||t.getCtrl().setupHeaderComp(e)}getHeaderRowCount(){return this.isAdvFilterHeaderActive()?1:0}getHeaderHeight(){return this.isAdvFilterHeaderActive()?this.advancedFilter.getCtrl().getHeaderHeight():0}processFilterModelUpdateQueue(){for(const e of this.advFilterModelUpdateQueue)this.setAdvFilterModel(e);this.advFilterModelUpdateQueue=[]}setColumnFilterModel(e,t){var n;return this.isAdvFilterEnabled()?(this.warnAdvFilters(),Promise.resolve()):((n=this.colFilter)==null?void 0:n.setModelForColumn(e,t))??Promise.resolve()}},ime=class extends We{constructor(){super(...arguments),this.beanName="filterMenuFactory"}wireBeans(e){this.popupSvc=e.popupSvc}hideActiveMenu(){var e;(e=this.hidePopup)==null||e.call(this)}showMenuAfterMouseEvent(e,t,n,s){e&&!e.isColumn||this.showPopup(e,o=>{var r;(r=this.popupSvc)==null||r.positionPopupUnderMouseEvent({column:e,type:n,mouseEvent:t,ePopup:o})},n,t.target,$o(this.gos),s)}showMenuAfterButtonClick(e,t,n,s){if(e&&!e.isColumn)return;let o=-1,r="left";const i=$o(this.gos);!i&&this.gos.get("enableRtl")&&(o=1,r="right");const a=i?void 0:4*o,l=i?void 0:4;this.showPopup(e,c=>{var u;(u=this.popupSvc)==null||u.positionPopupByComponent({type:n,eventSource:t,ePopup:c,nudgeX:a,nudgeY:l,alignSide:r,keepWithinBounds:!0,position:"under",column:e})},n,t,i,s)}showPopup(e,t,n,s,o,r){var g;const i=e?this.createBean(new Vae(e,"COLUMN_MENU")):void 0;if(this.activeMenu=i,!(i!=null&&i.hasFilter())||!e){En(57);return}const a=is({tag:"div",cls:`ag-menu${o?"":" ag-filter-menu"}`,role:"presentation"});[this.tabListener]=this.addManagedElementListeners(a,{keydown:v=>this.trapFocusWithin(v,a)}),a.appendChild(i==null?void 0:i.getGui());let l;const c=()=>i==null?void 0:i.afterGuiDetached(),u=nre(this.gos)?s??this.beans.ctrlsSvc.getGridBodyCtrl().eGridBody:void 0,d=v=>{FV(e,!1,"contextMenu");const C=v instanceof KeyboardEvent;if(this.tabListener&&(this.tabListener=this.tabListener()),C&&s&&vi(s)){const S=ML(s);S==null||S.focus({preventScroll:!0})}c(),this.destroyBean(this.activeMenu),this.dispatchVisibleChangedEvent(!1,n,e),r==null||r()},h=this.getLocaleTextFunc(),f=o&&n!=="columnFilter"?h("ariaLabelColumnMenu","Column Menu"):h("ariaLabelColumnFilter","Column Filter"),p=(g=this.popupSvc)==null?void 0:g.addPopup({modal:!0,eChild:a,closeOnEsc:!0,closedCallback:d,positionCallback:()=>t(a),anchorToElement:u,ariaLabel:f});p&&(this.hidePopup=l=p.hideFunc),i.afterInit().then(()=>{t(a),i.afterGuiAttached({container:n,hidePopup:l})}),FV(e,!0,"contextMenu"),this.dispatchVisibleChangedEvent(!0,n,e)}trapFocusWithin(e,t){e.key!==Oe.TAB||e.defaultPrevented||Sc(this.beans,t,!1,e.shiftKey)||(e.preventDefault(),bc(t,e.shiftKey))}dispatchVisibleChangedEvent(e,t,n){this.eventSvc.dispatchEvent({type:"columnMenuVisibleChanged",visible:e,switchingTab:!1,key:t,column:n??null,columnGroup:null})}isMenuEnabled(e){return e.isFilterAllowed()&&(e.getColDef().menuTabs??["filterMenuTab"]).includes("filterMenuTab")}showMenuAfterContextMenuEvent(){}destroy(){this.destroyBean(this.activeMenu),super.destroy()}},ame=class extends We{constructor(){super(...arguments),this.beanName="filterValueSvc"}getValue(e,t,n){if(!t)return;const s=e.getColDef(),{selectableFilter:o,valueSvc:r}=this.beans,i=n??(o==null?void 0:o.getFilterValueGetter(e.getColId()))??s.filterValueGetter;return i?this.executeFilterValueGetter(i,t.data,e,t,s):r.getValue(e,t)}executeFilterValueGetter(e,t,n,s,o){const{expressionSvc:r,valueSvc:i}=this.beans,a=Ft(this.gos,{data:t,node:s,column:n,colDef:o,getValue:i.getValueCallback.bind(i,s)});return typeof e=="function"?e(a):r==null?void 0:r.evaluate(e,a)}},lme={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eFloatingFilterText"}]},cme=class extends Cn{constructor(){super(lme,[Zv]),this.eFloatingFilterText=ut}init(e){this.params=e;const t=this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0);if(this.eFloatingFilterText.setDisabled(!0).setInputAriaLabel(`${t} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`),this.gos.get("enableFilterHandlers")){const n=e,s=n.getHandler();if(s.getModelAsString){const o=s.getModelAsString(n.model);this.eFloatingFilterText.setValue(o)}}}onParentModelChanged(e){if(e==null){this.eFloatingFilterText.setValue("");return}this.params.parentFilterInstance(t=>{if(t.getModelAsString){const n=t.getModelAsString(e);this.eFloatingFilterText.setValue(n)}})}refresh(e){this.init(e)}},a_=class{constructor(){this.customFilterOptions={}}init(e,t){this.filterOptions=e.filterOptions??t,this.mapCustomOptions(),this.defaultOption=this.getDefaultItem(e.defaultOption)}refresh(e,t){const n=e.filterOptions??t;this.filterOptions!==n&&(this.filterOptions=n,this.customFilterOptions={},this.mapCustomOptions()),this.defaultOption=this.getDefaultItem(e.defaultOption)}mapCustomOptions(){const{filterOptions:e}=this;if(e)for(const t of e){if(typeof t=="string")continue;const n=[["displayKey"],["displayName"],["predicate","test"]],s=o=>o.some(r=>t[r]!=null)?!0:(Je(72,{keys:o}),!1);if(!n.every(s)){this.filterOptions=e.filter(o=>o===t)||[];continue}this.customFilterOptions[t.displayKey]=t}}getDefaultItem(e){const{filterOptions:t}=this;if(e)return e;if(t.length>=1){const n=t[0];if(typeof n=="string")return n;if(n.displayKey)return n.displayKey;Je(73)}else Je(74)}getCustomOption(e){return this.customFilterOptions[e]}};function fp(e,t,n){return n==null?e.splice(t):e.splice(t,n)}function _y(e){return e==null||typeof e=="string"&&e.trim().length===0}function ume(e){return e==="AND"||e==="OR"?e:"AND"}function dme(e,t,n){if(e==null)return;const{predicate:s}=e;if(s!=null&&!t.some(o=>o==null))return s(t,n)}function hme(e,t){let n=e.length;return n>t&&(e.splice(t),Je(78),n=t),n}function pp(e,t){const n=t.getCustomOption(e);if(n){const{numberOfInputs:o}=n;return o??1}return e&&["empty","notBlank","blank"].indexOf(e)>=0?0:e==="inRange"?2:1}var l_=class extends Kae{constructor(e,t,n){super(e,"simple-filter"),this.mapValuesFromModel=t,this.defaultOptions=n,this.eTypes=[],this.eJoinPanels=[],this.eJoinAnds=[],this.eJoinOrs=[],this.eConditionBodies=[],this.listener=()=>this.onUiChanged(),this.lastUiCompletePosition=null,this.joinOperatorId=0}setParams(e){super.setParams(e);const t=new a_;this.optionsFactory=t,t.init(e,this.defaultOptions),this.commonUpdateSimpleParams(e),this.createOption(),this.createMissingConditionsAndOperators()}updateParams(e,t){this.optionsFactory.refresh(e,this.defaultOptions),super.updateParams(e,t),this.commonUpdateSimpleParams(e)}commonUpdateSimpleParams(e){this.setNumConditions(e),this.defaultJoinOperator=ume(e.defaultJoinOperator),this.filterPlaceholder=e.filterPlaceholder,this.createFilterListOptions();const t=this.getGui();this.isReadOnly()?t.setAttribute("tabindex","-1"):t.removeAttribute("tabindex")}onFloatingFilterChanged(e,t){this.setTypeFromFloatingFilter(e),this.setValueFromFloatingFilter(t),this.onUiChanged("immediately",!0)}setTypeFromFloatingFilter(e){this.eTypes.forEach((t,n)=>{const s=n===0?e:this.optionsFactory.defaultOption;t.setValue(s,!0)})}getModelFromUi(){const e=this.getUiCompleteConditions();return e.length===0?null:this.maxNumConditions>1&&e.length>1?{filterType:this.filterType,operator:this.getJoinOperator(),conditions:e}:e[0]}getConditionTypes(){return this.eTypes.map(e=>e.getValue())}getConditionType(e){return this.eTypes[e].getValue()}getJoinOperator(){const{eJoinOrs:e,defaultJoinOperator:t}=this;return e.length===0?t:e[0].getValue()===!0?"OR":"AND"}areNonNullModelsEqual(e,t){const n=!e.operator,s=!t.operator;if(!n&&s||n&&!s)return!1;let r;if(n){const i=e,a=t;r=this.areSimpleModelsEqual(i,a)}else{const i=e,a=t;r=i.operator===a.operator&&il(i.conditions,a.conditions,(l,c)=>this.areSimpleModelsEqual(l,c))}return r}setModelIntoUi(e,t){if(e==null)return this.resetUiToDefaults(t),jn.resolve();if(e.operator){const s=e;let o=s.conditions;o==null&&(o=[],Je(77));const r=hme(o,this.maxNumConditions),i=this.getNumConditions();if(r<i)this.removeConditionsAndOperators(r);else if(r>i)for(let l=i;l<r;l++)this.createJoinOperatorPanel(),this.createOption();const a=s.operator==="OR";this.eJoinAnds.forEach(l=>l.setValue(!a,!0)),this.eJoinOrs.forEach(l=>l.setValue(a,!0)),o.forEach((l,c)=>{this.eTypes[c].setValue(l.type,!0),this.setConditionIntoUi(l,c)})}else{const s=e;this.getNumConditions()>1&&this.removeConditionsAndOperators(1),this.eTypes[0].setValue(s.type,!0),this.setConditionIntoUi(s,0)}return this.lastUiCompletePosition=this.getNumConditions()-1,this.createMissingConditionsAndOperators(),this.updateUiVisibility(),t||this.params.onUiChange(this.getUiChangeEventParams()),jn.resolve()}setNumConditions(e){let t=e.maxNumConditions??2;t<1&&(Je(79),t=1),this.maxNumConditions=t;let n=e.numAlwaysVisibleConditions??1;n<1&&(Je(80),n=1),n>t&&(Je(81),n=t),this.numAlwaysVisibleConditions=n}createOption(){const e=this.getGui(),t=this.createManagedBean(new r0);this.eTypes.push(t),t.addCss("ag-filter-select"),e.appendChild(t.getGui());const n=this.createEValue();this.eConditionBodies.push(n),e.appendChild(n),this.putOptionsIntoDropdown(t),this.resetType(t);const s=this.getNumConditions()-1;this.forEachPositionInput(s,o=>this.resetInput(o)),this.addChangedListeners(t,s)}createJoinOperatorPanel(){const e=is({tag:"div",cls:"ag-filter-condition"});this.eJoinPanels.push(e);const t=this.createJoinOperator(this.eJoinAnds,e,"and"),n=this.createJoinOperator(this.eJoinOrs,e,"or");this.getGui().appendChild(e);const s=this.eJoinPanels.length-1,o=this.joinOperatorId++;this.resetJoinOperatorAnd(t,s,o),this.resetJoinOperatorOr(n,s,o),this.isReadOnly()||(t.onValueChange(this.listener),n.onValueChange(this.listener))}createJoinOperator(e,t,n){const s=this.createManagedBean(new _ie);e.push(s);const o="ag-filter-condition-operator";return s.addCss(o),s.addCss(`${o}-${n}`),t.appendChild(s.getGui()),s}createFilterListOptions(){this.filterListOptions=this.optionsFactory.filterOptions.map(e=>typeof e=="string"?this.createBoilerplateListOption(e):this.createCustomListOption(e))}putOptionsIntoDropdown(e){const{filterListOptions:t}=this;for(const n of t)e.addOption(n);e.setDisabled(t.length<=1)}createBoilerplateListOption(e){return{value:e,text:this.translate(e)}}createCustomListOption(e){const{displayKey:t}=e,n=this.optionsFactory.getCustomOption(e.displayKey);return{value:t,text:n?this.getLocaleTextFunc()(n.displayKey,n.displayName):this.translate(t)}}createBodyTemplate(){return null}getAgComponents(){return[]}updateUiVisibility(){const e=this.getJoinOperator();this.updateNumConditions(),this.updateConditionStatusesAndValues(this.lastUiCompletePosition,e)}updateNumConditions(){let e=-1,t=!0;for(let n=0;n<this.getNumConditions();n++)this.isConditionUiComplete(n)?e=n:t=!1;if(this.shouldAddNewConditionAtEnd(t))this.createJoinOperatorPanel(),this.createOption();else{const n=this.lastUiCompletePosition??this.getNumConditions()-2;if(e<n){this.removeConditionsAndOperators(n+1);const s=e+1,o=n-s;o>0&&this.removeConditionsAndOperators(s,o),this.createMissingConditionsAndOperators()}}this.lastUiCompletePosition=e}updateConditionStatusesAndValues(e,t){this.eTypes.forEach((s,o)=>{const r=this.isConditionDisabled(o,e);s.setDisabled(r||this.filterListOptions.length<=1),o===1&&(Vf(this.eJoinPanels[0],r),this.eJoinAnds[0].setDisabled(r),this.eJoinOrs[0].setDisabled(r))}),this.eConditionBodies.forEach((s,o)=>{Bn(s,this.isConditionBodyVisible(o))});const n=(t??this.getJoinOperator())==="OR";for(const s of this.eJoinAnds)s.setValue(!n,!0);for(const s of this.eJoinOrs)s.setValue(n,!0);this.forEachInput((s,o,r,i)=>{this.setElementDisplayed(s,o<i),this.setElementDisabled(s,this.isConditionDisabled(r,e))}),this.resetPlaceholder()}shouldAddNewConditionAtEnd(e){return e&&this.getNumConditions()<this.maxNumConditions&&!this.isReadOnly()}removeConditionsAndOperators(e,t){if(e>=this.getNumConditions())return;const{eTypes:n,eConditionBodies:s,eJoinPanels:o,eJoinAnds:r,eJoinOrs:i}=this;this.removeComponents(n,e,t),this.removeElements(s,e,t),this.removeEValues(e,t);const a=Math.max(e-1,0);this.removeElements(o,a,t),this.removeComponents(r,a,t),this.removeComponents(i,a,t)}removeElements(e,t,n){const s=fp(e,t,n);for(const o of s)Br(o)}removeComponents(e,t,n){const s=fp(e,t,n);for(const o of s)Br(o.getGui()),this.destroyBean(o)}afterGuiAttached(e){var t;if(super.afterGuiAttached(e),this.resetPlaceholder(),!(e!=null&&e.suppressFocus)){let n;if(!this.isReadOnly()){const s=this.getInputs(0)[0];s instanceof Ec&&this.isConditionBodyVisible(0)?n=s.getInputElement():n=(t=this.eTypes[0])==null?void 0:t.getFocusableElement()}(n??this.getGui()).focus({preventScroll:!0})}}afterGuiDetached(){var i;super.afterGuiDetached();const e=this.params;if((i=this.beans.colFilter)!=null&&i.shouldKeepStateOnDetach(e.column))return;e.onStateChange({model:e.model});let t=-1,n=-1,s=!1;const o=this.getJoinOperator();for(let a=this.getNumConditions()-1;a>=0;a--)if(this.isConditionUiComplete(a))t===-1&&(t=a,n=a);else{const l=a>=this.numAlwaysVisibleConditions&&!this.isConditionUiComplete(a-1),c=a<t;(l||c)&&(this.removeConditionsAndOperators(a,1),s=!0,c&&n--)}let r=!1;this.getNumConditions()<this.numAlwaysVisibleConditions&&(this.createMissingConditionsAndOperators(),r=!0),this.shouldAddNewConditionAtEnd(n===this.getNumConditions()-1)&&(this.createJoinOperatorPanel(),this.createOption(),r=!0),r&&this.updateConditionStatusesAndValues(n,o),s&&this.updateJoinOperatorsDisabled(),this.lastUiCompletePosition=n}getModelAsString(e){var t,n;return((n=(t=this.params.getHandler())==null?void 0:t.getModelAsString)==null?void 0:n.call(t,e))??""}getPlaceholderText(e,t){let n=this.translate(e);if(typeof this.filterPlaceholder=="function"){const s=this.eTypes[t].getValue(),o=this.translate(s);n=this.filterPlaceholder({filterOptionKey:s,filterOption:o,placeholder:n})}else typeof this.filterPlaceholder=="string"&&(n=this.filterPlaceholder);return n}resetPlaceholder(){const e=this.getLocaleTextFunc();this.forEachInput((t,n,s,o)=>{if(!(t instanceof Ec))return;const r=n===0&&o>1?"inRangeStart":n===0?"filterOoo":"inRangeEnd",i=n===0&&o>1?e("ariaFilterFromValue","Filter from value"):n===0?e("ariaFilterValue","Filter Value"):e("ariaFilterToValue","Filter to Value");t.setInputPlaceholder(this.getPlaceholderText(r,s)),t.setInputAriaLabel(i)})}setElementValue(e,t,n){e instanceof Ec&&e.setValue(t!=null?String(t):null,!0)}setElementDisplayed(e,t){bL(e)&&Bn(e.getGui(),t)}setElementDisabled(e,t){bL(e)&&Vf(e.getGui(),t)}attachElementOnChange(e,t){e instanceof Ec&&e.onValueChange(t)}forEachInput(e){this.getConditionTypes().forEach((t,n)=>{this.forEachPositionTypeInput(n,t,e)})}forEachPositionInput(e,t){const n=this.getConditionType(e);this.forEachPositionTypeInput(e,n,t)}forEachPositionTypeInput(e,t,n){const s=pp(t,this.optionsFactory),o=this.getInputs(e);for(let r=0;r<o.length;r++){const i=o[r];i!=null&&n(i,r,e,s)}}isConditionDisabled(e,t){return this.isReadOnly()?!0:e===0?!1:e>t+1}isConditionBodyVisible(e){const t=this.getConditionType(e);return pp(t,this.optionsFactory)>0}isConditionUiComplete(e){return!(e>=this.getNumConditions()||this.getConditionType(e)==="empty"||this.getValues(e).some(n=>n==null))}getNumConditions(){return this.eTypes.length}getUiCompleteConditions(){const e=[];for(let t=0;t<this.getNumConditions();t++)this.isConditionUiComplete(t)&&e.push(this.createCondition(t));return e}createMissingConditionsAndOperators(){if(!this.isReadOnly())for(let e=this.getNumConditions();e<this.numAlwaysVisibleConditions;e++)this.createJoinOperatorPanel(),this.createOption()}resetUiToDefaults(e){this.removeConditionsAndOperators(this.isReadOnly()?1:this.numAlwaysVisibleConditions),this.eTypes.forEach(t=>this.resetType(t)),this.eJoinAnds.forEach((t,n)=>this.resetJoinOperatorAnd(t,n,this.joinOperatorId+n)),this.eJoinOrs.forEach((t,n)=>this.resetJoinOperatorOr(t,n,this.joinOperatorId+n)),this.joinOperatorId++,this.forEachInput(t=>this.resetInput(t)),this.resetPlaceholder(),this.createMissingConditionsAndOperators(),this.lastUiCompletePosition=null,this.updateUiVisibility(),e||this.params.onUiChange(this.getUiChangeEventParams())}resetType(e){const n=this.getLocaleTextFunc()("ariaFilteringOperator","Filtering operator");e.setValue(this.optionsFactory.defaultOption,!0).setAriaLabel(n).setDisabled(this.isReadOnly()||this.filterListOptions.length<=1)}resetJoinOperatorAnd(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="AND",this.translate("andCondition"),n)}resetJoinOperatorOr(e,t,n){this.resetJoinOperator(e,t,this.defaultJoinOperator==="OR",this.translate("orCondition"),n)}resetJoinOperator(e,t,n,s,o){this.updateJoinOperatorDisabled(e.setValue(n,!0).setName(`ag-simple-filter-and-or-${this.getCompId()}-${o}`).setLabel(s),t)}updateJoinOperatorsDisabled(){const e=(t,n)=>this.updateJoinOperatorDisabled(t,n);this.eJoinAnds.forEach(e),this.eJoinOrs.forEach(e)}updateJoinOperatorDisabled(e,t){e.setDisabled(this.isReadOnly()||t>0)}resetInput(e){this.setElementValue(e,null),this.setElementDisabled(e,this.isReadOnly())}setConditionIntoUi(e,t){const n=this.mapValuesFromModel(e,this.optionsFactory);this.forEachInput((s,o,r)=>{r===t&&this.setElementValue(s,n[o]!=null?n[o]:null)})}setValueFromFloatingFilter(e){this.forEachInput((t,n,s)=>{this.setElementValue(t,n===0&&s===0?e:null,!0)})}addChangedListeners(e,t){this.isReadOnly()||(e.onValueChange(this.listener),this.forEachPositionInput(t,n=>{this.attachElementOnChange(n,this.listener)}))}hasInvalidInputs(){return!1}isReadOnly(){return!!this.params.readOnly}},K2=class{constructor(e,t,n,s,o,r){this.alive=!0,this.context=e,this.eParent=o;const i=rie(t,n,s);i&&i.newAgStackInstance().then(a=>{var u,d;if(!this.alive){e.destroyBean(a);return}if(this.dateComp=a,!a)return;o.appendChild(a.getGui()),(u=a==null?void 0:a.afterGuiAttached)==null||u.call(a);const{tempValue:l,disabled:c}=this;l&&a.setDate(l),c!=null&&((d=a.setDisabled)==null||d.call(a,c)),r==null||r(this)})}destroy(){this.alive=!1,this.dateComp=this.context.destroyBean(this.dateComp)}getDate(){return this.dateComp?this.dateComp.getDate():this.tempValue}setDate(e){const t=this.dateComp;t?t.setDate(e):this.tempValue=e}setDisabled(e){var n;const t=this.dateComp;t?(n=t.setDisabled)==null||n.call(t,e):this.disabled=e}setDisplayed(e){Bn(this.eParent,e)}setInputPlaceholder(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputPlaceholder)==null||n.call(t,e)}setInputAriaLabel(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.setInputAriaLabel)==null||n.call(t,e)}afterGuiAttached(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.afterGuiAttached)==null||n.call(t,e)}updateParams(e){var t,n;(n=(t=this.dateComp)==null?void 0:t.refresh)==null||n.call(t,e)}},c_=["equals","notEqual","lessThan","greaterThan","inRange","blank","notBlank"];function q2(e,t){const{dateFrom:n,dateTo:s,type:o}=e||{};return[n&&vo(n,void 0,!0)||null,s&&vo(s,void 0,!0)||null].slice(0,pp(o,t))}var Y2=1e3,Z2=1/0,fme=class extends l_{constructor(){super("dateFilter",q2,c_),this.eConditionPanelsFrom=[],this.eConditionPanelsTo=[],this.dateConditionFromComps=[],this.dateConditionToComps=[],this.minValidYear=Y2,this.maxValidYear=Z2,this.minValidDate=null,this.maxValidDate=null,this.filterType="date"}afterGuiAttached(e){super.afterGuiAttached(e),this.dateConditionFromComps[0].afterGuiAttached(e)}commonUpdateSimpleParams(e){super.commonUpdateSimpleParams(e);const t=(l,c)=>{const u=e[l];if(u!=null)if(isNaN(u))Je(82,{param:l});else return u==null?c:Number(u);return c},n=t("minValidYear",Y2),s=t("maxValidYear",Z2);this.minValidYear=n,this.maxValidYear=s,n>s&&Je(83);const{minValidDate:o,maxValidDate:r}=e,i=o instanceof Date?o:vo(o);this.minValidDate=i;const a=r instanceof Date?r:vo(r);this.maxValidDate=a,i&&a&&i>a&&Je(84)}createDateCompWrapper(e){const{beans:{userCompFactory:t,context:n,gos:s},params:o}=this,r=new K2(n,t,o.colDef,Ft(s,{onDateChanged:()=>this.onUiChanged(),filterParams:o,location:"filter"}),e);return this.addDestroyFunc(()=>r.destroy()),r}setElementValue(e,t){e.setDate(t)}setElementDisplayed(e,t){e.setDisplayed(t)}setElementDisabled(e,t){e.setDisabled(t)}createEValue(){const e=is({tag:"div",cls:"ag-filter-body"});return this.createFromToElement(e,this.eConditionPanelsFrom,this.dateConditionFromComps,"from"),this.createFromToElement(e,this.eConditionPanelsTo,this.dateConditionToComps,"to"),e}createFromToElement(e,t,n,s){const o=is({tag:"div",cls:`ag-filter-${s} ag-filter-date-${s}`});t.push(o),e.appendChild(o),n.push(this.createDateCompWrapper(o))}removeEValues(e,t){this.removeDateComps(this.dateConditionFromComps,e,t),this.removeDateComps(this.dateConditionToComps,e,t),fp(this.eConditionPanelsFrom,e,t),fp(this.eConditionPanelsTo,e,t)}removeDateComps(e,t,n){const s=fp(e,t,n);for(const o of s)o.destroy()}isValidDateValue(e){if(e===null)return!1;const{minValidDate:t,maxValidDate:n,minValidYear:s,maxValidYear:o}=this;if(t){if(e<t)return!1}else if(e.getUTCFullYear()<s)return!1;if(n){if(e>n)return!1}else if(e.getUTCFullYear()>o)return!1;return!0}isConditionUiComplete(e){if(!super.isConditionUiComplete(e))return!1;let t=!0;return this.forEachInput((n,s,o,r)=>{o!==e||!t||s>=r||(t=t&&this.isValidDateValue(n.getDate()))}),t}areSimpleModelsEqual(e,t){return e.dateFrom===t.dateFrom&&e.dateTo===t.dateTo&&e.type===t.type}createCondition(e){const t=this.getConditionType(e),n={},s=this.getValues(e),o=this.params.useIsoSeparator?"T":" ";return s.length>0&&(n.dateFrom=Ho(s[0],!0,o)),s.length>1&&(n.dateTo=Ho(s[1],!0,o)),{dateFrom:null,dateTo:null,filterType:this.filterType,type:t,...n}}resetPlaceholder(){const e=this.getLocaleTextFunc(),t=this.translate("dateFormatOoo"),n=e("ariaFilterValue","Filter Value");this.forEachInput(s=>{s.setInputPlaceholder(t),s.setInputAriaLabel(n)})}getInputs(e){const{dateConditionFromComps:t,dateConditionToComps:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,r)=>{s<r&&t.push(n.getDate())}),t}translate(e){return e==="lessThan"?super.translate("before"):e==="greaterThan"?super.translate("after"):super.translate(e)}},X2=class extends We{constructor(e,t){super(),this.mapValuesFromModel=e,this.defaultOptions=t}init(e){const t=e.filterParams,n=new a_;this.optionsFactory=n,n.init(t,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(n,t)),this.updateParams(e),this.validateModel(e)}refresh(e){if(e.source==="colDef"){const t=e.filterParams,n=this.optionsFactory;n.refresh(t,this.defaultOptions),this.filterModelFormatter.updateParams({optionsFactory:n,filterParams:t}),this.updateParams(e)}this.validateModel(e)}updateParams(e){this.params=e}doesFilterPass(e){const t=e.model;if(t==null)return!0;const{operator:n}=t,s=[];if(n){const i=t;s.push(...i.conditions??[])}else s.push(t);const o=n&&n==="OR"?"some":"every",r=this.params.getValue(e.node);return s[o](i=>this.individualConditionPasses(e,i,r))}getModelAsString(e,t){return this.filterModelFormatter.getModelAsString(e,t)??""}validateModel(e){const{model:t,filterParams:{filterOptions:n,maxNumConditions:s}}=e;if(t==null)return;let r=hV(t)?t.conditions:[t];const i=(n==null?void 0:n.map(u=>typeof u=="string"?u:u.displayKey))??this.defaultOptions;if(!(!r||r.every(u=>i.find(d=>d===u.type)!==void 0))){this.params={...e,model:null},e.onModelChange(null);return}let l=!1;const c=this.filterType;if((r&&!r.every(u=>u.filterType===c)||t.filterType!==c)&&(r=r.map(u=>({...u,filterType:c})),l=!0),typeof s=="number"&&r&&r.length>s&&(r=r.slice(0,s),l=!0),l){const u=r.length>1?{...t,filterType:c,conditions:r}:{...r[0],filterType:c};this.params={...e,model:u},e.onModelChange(u)}}individualConditionPasses(e,t,n){const s=this.optionsFactory,o=this.mapValuesFromModel(t,s),r=s.getCustomOption(t.type),i=dme(r,o,n);return i??(n==null?this.evaluateNullValue(t.type):this.evaluateNonNullValue(o,n,t,e))}},J2=class extends X2{evaluateNullValue(e){const{includeBlanksInEquals:t,includeBlanksInNotEqual:n,includeBlanksInGreaterThan:s,includeBlanksInLessThan:o,includeBlanksInRange:r}=this.params.filterParams;switch(e){case"equals":if(t)return!0;break;case"notEqual":if(n)return!0;break;case"greaterThan":case"greaterThanOrEqual":if(s)return!0;break;case"lessThan":case"lessThanOrEqual":if(o)return!0;break;case"inRange":if(r)return!0;break;case"blank":return!0;case"notBlank":return!1}return!1}evaluateNonNullValue(e,t,n){const s=n.type;if(!this.isValid(t))return s==="notEqual"||s==="notBlank";const o=this.comparator(),r=e[0]!=null?o(e[0],t):0;switch(s){case"equals":return r===0;case"notEqual":return r!==0;case"greaterThan":return r>0;case"greaterThanOrEqual":return r>=0;case"lessThan":return r<0;case"lessThanOrEqual":return r<=0;case"inRange":{const i=o(e[1],t);return this.params.filterParams.inRangeInclusive?r>=0&&i<=0:r>0&&i<0}case"blank":return _y(t);case"notBlank":return!_y(t);default:return Je(76,{filterModelType:s}),!0}}},Q2={equals:"Equals",notEqual:"NotEqual",greaterThan:"GreaterThan",greaterThanOrEqual:"GreaterThanOrEqual",lessThan:"LessThan",lessThanOrEqual:"LessThanOrEqual",inRange:"InRange"},pme={contains:"Contains",notContains:"NotContains",equals:"TextEquals",notEqual:"TextNotEqual",startsWith:"StartsWith",endsWith:"EndsWith",inRange:"InRange"},u_=class extends We{constructor(e,t,n){super(),this.optionsFactory=e,this.filterParams=t,this.valueFormatter=n}getModelAsString(e,t){const n=this.getLocaleTextFunc(),s=t==="filterToolPanel";if(!e)return s?dl(this,"filterSummaryInactive"):null;if(e.operator!=null){const r=e,a=(r.conditions??[]).map(c=>this.getModelAsString(c,t)),l=r.operator==="AND"?"andCondition":"orCondition";return a.join(` ${dl(this,l)} `)}else{if(e.type==="blank"||e.type==="notBlank")return s?dl(this,e.type==="blank"?"filterSummaryBlank":"filterSummaryNotBlank"):n(e.type,e.type);{const r=e,i=this.optionsFactory.getCustomOption(r.type),{displayKey:a,displayName:l,numberOfInputs:c}=i||{};return a&&l&&c===0?n(a,l):this.conditionToString(r,s,r.type==="inRange"||c===2,a,l)}}}updateParams(e){const{optionsFactory:t,filterParams:n}=e;this.optionsFactory=t,this.filterParams=n}conditionForToolPanel(e,t,n,s,o,r){let i;const a=this.getTypeKey(e);return a&&(i=dl(this,a)),o&&r&&(i=this.getLocaleTextFunc()(o,r)),i!=null?t?`${i} ${dl(this,"filterSummaryInRangeValues",[n(),s()])}`:`${i} ${n()}`:null}getTypeKey(e){const t=this.filterTypeKeys[e];return t?`filterSummary${t}`:null}formatValue(e){const t=this.valueFormatter;return t?t(e??null)??"":String(e)}},eB=class extends u_{constructor(e,t){super(e,t,n=>{const{dataTypeSvc:s,valueSvc:o}=this.beans,r=t.column,i=s==null?void 0:s.getDateFormatterFunction(r),a=i?i(n??void 0):n;return o.formatValue(r,null,a)}),this.filterTypeKeys=Q2}conditionToString(e,t,n,s,o){const{type:r}=e,i=vo(e.dateFrom),a=vo(e.dateTo),l=this.filterParams.inRangeFloatingFilterDateFormat,c=t?this.formatValue.bind(this):h=>QE(h,l),u=()=>i!==null?c(i):"null",d=()=>a!==null?c(a):"null";if(t){const h=this.conditionForToolPanel(r,n,u,d,s,o);if(h!=null)return h}return n?`${u()}-${d()}`:i!=null?c(i):`${r}`}};function gme(e,t){const n=t;return n<e?-1:n>e?1:0}var mme=class extends J2{constructor(){super(q2,c_),this.filterType="date",this.FilterModelFormatterClass=eB}comparator(){return this.params.filterParams.comparator??gme}isValid(e){const t=this.params.filterParams.isValidDate;return!t||t(e)}},tB=class extends Cn{constructor(){super(...arguments),this.defaultDebounceMs=0}setLastTypeFromModel(e){if(!e){this.lastType=this.optionsFactory.defaultOption;return}const t=e.operator;let n;t?n=e.conditions[0]:n=e,this.lastType=n.type}canWeEditAfterModelFromParentFilter(e){if(!e)return this.isTypeEditable(this.lastType);if(e.operator)return!1;const n=e;return this.isTypeEditable(n.type)}init(e){this.params=e;const t=this.gos.get("enableFilterHandlers");if(this.reactive=t,this.setParams(e),t){const n=e;this.onModelUpdated(n.model)}}setParams(e){const t=new a_;this.optionsFactory=t,t.init(e.filterParams,this.defaultOptions),this.filterModelFormatter=this.createManagedBean(new this.FilterModelFormatterClass(t,e.filterParams)),this.setSimpleParams(e,!1)}setSimpleParams(e,t=!0){const n=this.optionsFactory.defaultOption;t||(this.lastType=n),this.readOnly=!!e.filterParams.readOnly;const s=this.isTypeEditable(n);this.setEditable(s)}refresh(e){this.params=e;const t=e,n=this.reactive;if((!n||t.source==="colDef")&&this.updateParams(e),n){const{source:s,model:o}=t;if(s==="dataChanged"||s==="ui")return;this.onModelUpdated(o)}}updateParams(e){const t=this.optionsFactory;t.refresh(e.filterParams,this.defaultOptions),this.setSimpleParams(e),this.filterModelFormatter.updateParams({optionsFactory:t,filterParams:e.filterParams})}onParentModelChanged(e,t){t!=null&&t.afterFloatingFilter||t!=null&&t.afterDataChange||this.onModelUpdated(e)}hasSingleInput(e){var n;const t=(n=this.optionsFactory.getCustomOption(e))==null?void 0:n.numberOfInputs;return t==null||t==1}isTypeEditable(e){const t=["inRange","empty","blank","notBlank"];return!!e&&!this.readOnly&&this.hasSingleInput(e)&&t.indexOf(e)<0}getAriaLabel(e){return`${this.beans.colNames.getDisplayNameForColumn(e.column,"header",!0)} ${this.getLocaleTextFunc()("ariaFilterInput","Filter Input")}`}},vme={tag:"div",cls:"ag-floating-filter-input",role:"presentation",children:[{tag:"ag-input-text-field",ref:"eReadOnlyText"},{tag:"div",ref:"eDateWrapper",cls:"ag-date-floating-filter-wrapper"}]},yme=class extends tB{constructor(){super(vme,[Zv]),this.eReadOnlyText=ut,this.eDateWrapper=ut,this.FilterModelFormatterClass=eB,this.filterType="date",this.defaultOptions=c_}setParams(e){super.setParams(e),this.createDateComponent();const t=this.getLocaleTextFunc();this.eReadOnlyText.setDisabled(!0).setInputAriaLabel(t("ariaDateFilterInput","Date Filter Input"))}updateParams(e){super.updateParams(e),this.dateComp.updateParams(this.getDateComponentParams()),this.updateCompOnModelChange(e.currentParentModel())}updateCompOnModelChange(e){const t=!this.readOnly&&this.canWeEditAfterModelFromParentFilter(e);if(this.setEditable(t),t){const n=e?vo(e.dateFrom):null;this.dateComp.setDate(n),this.eReadOnlyText.setValue("")}else this.eReadOnlyText.setValue(this.filterModelFormatter.getModelAsString(e)),this.dateComp.setDate(null)}setEditable(e){Bn(this.eDateWrapper,e),Bn(this.eReadOnlyText.getGui(),!e)}onModelUpdated(e){super.setLastTypeFromModel(e),this.updateCompOnModelChange(e)}onDateChanged(){const e=this.dateComp.getDate();if(this.reactive){const t=this.params;t.onUiChange();const n=t.model,s=Ho(e),o=s==null?null:{...n??{filterType:this.filterType,type:this.lastType??this.optionsFactory.defaultOption},dateFrom:s};t.onModelChange(o,{afterFloatingFilter:!0})}else this.params.parentFilterInstance(t=>{t==null||t.onFloatingFilterChanged(this.lastType||null,e)})}getDateComponentParams(){const{filterParams:e}=this.params,t=p0(e,this.defaultDebounceMs);return Ft(this.gos,{onDateChanged:Os(this,this.onDateChanged.bind(this),t),filterParams:e,location:"floatingFilter"})}createDateComponent(){const{beans:{context:e,userCompFactory:t},eDateWrapper:n,params:s}=this;this.dateComp=new K2(e,t,s.column.getColDef(),this.getDateComponentParams(),n,o=>{o.setInputAriaLabel(this.getAriaLabel(s))}),this.addDestroyFunc(()=>this.dateComp.destroy())}},wme={tag:"div",cls:"ag-filter-filter",children:[{tag:"ag-input-text-field",ref:"eDateInput",cls:"ag-date-filter"}]},Cme=class extends Cn{constructor(){super(wme,[Zv]),this.eDateInput=ut,this.isApply=!1,this.applyOnFocusOut=!1}init(e){this.params=e,this.setParams(e);const t=this.eDateInput.getInputElement();this.addManagedListeners(t,{mouseDown:()=>{this.eDateInput.isDisabled()||this.usingSafariDatePicker||t.focus({preventScroll:!0})},input:this.handleInput.bind(this,!1),change:this.handleInput.bind(this,!0),focusout:this.handleFocusOut.bind(this)})}handleInput(e){if(!this.eDateInput.isDisabled()){if(this.isApply){this.applyOnFocusOut=!e,e&&this.params.onDateChanged();return}e||this.params.onDateChanged()}}handleFocusOut(){this.applyOnFocusOut&&(this.applyOnFocusOut=!1,this.params.onDateChanged())}setParams(e){var h;const t=this.eDateInput.getInputElement(),n=this.shouldUseBrowserDatePicker(e);this.usingSafariDatePicker=n&&al();const{minValidYear:s,maxValidYear:o,minValidDate:r,maxValidDate:i,buttons:a,includeTime:l,colDef:c}=e.filterParams||{},u=this.beans.dataTypeSvc,d=l??((h=u==null?void 0:u.getDateIncludesTimeFlag)==null?void 0:h.call(u,c.cellDataType))??!1;if(n?d?(t.type="datetime-local",t.step="1"):t.type="date":t.type="text",r&&s&&Je(85),i&&o&&Je(86),r&&i){const[f,p]=[r,i].map(g=>g instanceof Date?g:vo(g));f&&p&&f.getTime()>p.getTime()&&Je(87)}r?r instanceof Date?t.min=QE(r):t.min=r:s&&(t.min=`${s}-01-01`),i?i instanceof Date?t.max=QE(i):t.max=i:o&&(t.max=`${o}-12-31`),this.isApply=e.location==="floatingFilter"&&!!(a!=null&&a.includes("apply"))}refresh(e){this.params=e,this.setParams(e)}getDate(){return vo(this.eDateInput.getValue())}setDate(e){var s;const t=this.params.filterParams.colDef.cellDataType,n=((s=this.beans.dataTypeSvc)==null?void 0:s.getDateIncludesTimeFlag(t))??!1;this.eDateInput.setValue(Ho(e,n))}setInputPlaceholder(e){this.eDateInput.setInputPlaceholder(e)}setInputAriaLabel(e){this.eDateInput.setAriaLabel(e)}setDisabled(e){this.eDateInput.setDisabled(e)}afterGuiAttached(e){e!=null&&e.suppressFocus||this.eDateInput.getInputElement().focus({preventScroll:!0})}shouldUseBrowserDatePicker(e){var t;return((t=e==null?void 0:e.filterParams)==null?void 0:t.browserDatePicker)??!0}},d_=["equals","notEqual","greaterThan","greaterThanOrEqual","lessThan","lessThanOrEqual","inRange","blank","notBlank"];function h_(e){const{allowedCharPattern:t}=e??{};return t??null}function f_(e){return e==null||isNaN(e)?null:e}function nB(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[f_(n),f_(s)].slice(0,pp(o,t))}var bme=class extends l_{constructor(){super("numberFilter",nB,d_),this.eValuesFrom=[],this.eValuesTo=[],this.filterType="number",this.defaultDebounceMs=500}setElementValue(e,t,n){const{numberFormatter:s}=this.params,o=!n&&s?s(t??null):t;super.setElementValue(e,o)}createEValue(){const e=h_(this.params),t=is({tag:"div",cls:"ag-filter-body",role:"presentation"});return this.createFromToElement(t,this.eValuesFrom,"from",e),this.createFromToElement(t,this.eValuesTo,"to",e),t}createFromToElement(e,t,n,s){const o=this.createManagedBean(s?new _c({allowedCharPattern:s}):new o0);o.addCss(`ag-filter-${n}`),o.addCss("ag-filter-filter"),t.push(o),e.appendChild(o.getGui())}removeEValues(e,t){const n=s=>this.removeComponents(s,e,t);n(this.eValuesFrom),n(this.eValuesTo)}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,r)=>{s<r&&t.push(f_(this.stringToFloat(n.getValue())))}),t}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}stringToFloat(e){if(typeof e=="number")return e;let t=ia(e);t!=null&&t.trim()===""&&(t=null);const n=this.params.numberParser;return n?n(t):t==null||t.trim()==="-"?null:Number.parseFloat(t)}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}hasInvalidInputs(){let e=!1;return this.forEachInput(t=>{t.getInputElement().validity.valid||(e=!0)}),e}},sB=class extends u_{constructor(e,t){super(e,t,t.numberFormatter),this.filterTypeKeys=Q2}conditionToString(e,t,n,s,o){const{filter:r,filterTo:i,type:a}=e,l=this.formatValue.bind(this);if(t){const c=this.conditionForToolPanel(a,n,()=>l(r),()=>l(i),s,o);if(c!=null)return c}return n?`${l(r)}-${l(i)}`:r!=null?l(r):`${a}`}},Sme=class extends J2{constructor(){super(nB,d_),this.filterType="number",this.FilterModelFormatterClass=sB}comparator(){return(e,t)=>e===t?0:e<t?1:-1}isValid(e){return!isNaN(e)}},oB=class extends We{constructor(e){super(),this.params=e,this.eInput=ut,this.onValueChanged=()=>{}}setupGui(e){var s;this.eInput=this.createManagedBean(new _c((s=this.params)==null?void 0:s.config));const t=this.eInput.getGui();e.appendChild(t);const n=o=>this.onValueChanged(o);this.addManagedListeners(t,{input:n,keydown:n})}setEditable(e){this.eInput.setDisabled(!e)}getValue(){return this.eInput.getValue()}setValue(e,t){this.eInput.setValue(e,t)}setValueChangedListener(e){this.onValueChanged=e}setParams({ariaLabel:e,autoComplete:t}){const{eInput:n}=this;n.setInputAriaLabel(e),t!==void 0&&n.setAutoComplete(t)}};function p_(e){const t=e==null?void 0:e.trim();return t===""?e:t}function rB(e,t){const{filter:n,filterTo:s,type:o}=e||{};return[n||null,s||null].slice(0,pp(o,t))}var Eme={tag:"div",ref:"eFloatingFilterInputContainer",cls:"ag-floating-filter-input",role:"presentation"},iB=class extends tB{constructor(){super(...arguments),this.eFloatingFilterInputContainer=ut,this.defaultDebounceMs=500}postConstruct(){this.setTemplate(Eme)}onModelUpdated(e){this.setLastTypeFromModel(e),this.setEditable(this.canWeEditAfterModelFromParentFilter(e)),this.inputSvc.setValue(this.filterModelFormatter.getModelAsString(e))}setParams(e){this.setupFloatingFilterInputService(e),super.setParams(e),this.setTextInputParams(e)}setupFloatingFilterInputService(e){this.inputSvc=this.createFloatingFilterInputService(e),this.inputSvc.setupGui(this.eFloatingFilterInputContainer)}setTextInputParams(e){const t=e.browserAutoComplete??!1,{inputSvc:n,defaultDebounceMs:s,readOnly:o}=this;if(n.setParams({ariaLabel:this.getAriaLabel(e),autoComplete:t}),this.applyActive=ty(e.filterParams),!o){const r=p0(e.filterParams,s),i=Os(this,this.syncUpWithParentFilter.bind(this),r);n.setValueChangedListener(i)}}updateParams(e){super.updateParams(e),this.setTextInputParams(e)}recreateFloatingFilterInputService(e){const{inputSvc:t}=this,n=t.getValue();ks(this.eFloatingFilterInputContainer),this.destroyBean(t),this.setupFloatingFilterInputService(e),t.setValue(n,!0)}syncUpWithParentFilter(e){const t=e.key===Oe.ENTER,n=this.reactive;if(n&&this.params.onUiChange(),this.applyActive&&!t)return;const{inputSvc:s,params:o,lastType:r}=this;let i=s.getValue();if(o.filterParams.trimInput&&(i=p_(i),s.setValue(i,!0)),n){const a=o,l=a.model,c=this.convertValue(i),u=c==null?null:{...l??{filterType:this.filterType,type:r??this.optionsFactory.defaultOption},filter:c};a.onModelChange(u,{afterFloatingFilter:!0})}else o.parentFilterInstance(a=>{a==null||a.onFloatingFilterChanged(r||null,i||null)})}convertValue(e){return e||null}setEditable(e){this.inputSvc.setEditable(e)}},_me=class extends We{constructor(){super(...arguments),this.onValueChanged=()=>{},this.numberInputActive=!0}setupGui(e){this.eNumberInput=this.createManagedBean(new o0),this.eTextInput=this.createManagedBean(new _c),this.eTextInput.setDisabled(!0);const t=this.eNumberInput.getGui(),n=this.eTextInput.getGui();e.appendChild(t),e.appendChild(n),this.setupListeners(t,s=>this.onValueChanged(s)),this.setupListeners(n,s=>this.onValueChanged(s))}setEditable(e){this.numberInputActive=e,this.eNumberInput.setDisplayed(this.numberInputActive),this.eTextInput.setDisplayed(!this.numberInputActive)}setAutoComplete(e){this.eNumberInput.setAutoComplete(e),this.eTextInput.setAutoComplete(e)}getValue(){return this.getActiveInputElement().getValue()}setValue(e,t){this.getActiveInputElement().setValue(e,t)}getActiveInputElement(){return this.numberInputActive?this.eNumberInput:this.eTextInput}setValueChangedListener(e){this.onValueChanged=e}setupListeners(e,t){this.addManagedListeners(e,{input:t,keydown:t})}setParams(e){this.setAriaLabel(e.ariaLabel),e.autoComplete!==void 0&&this.setAutoComplete(e.autoComplete)}setAriaLabel(e){this.eNumberInput.setInputAriaLabel(e),this.eTextInput.setInputAriaLabel(e)}},Rme=class extends iB{constructor(){super(...arguments),this.FilterModelFormatterClass=sB,this.filterType="number",this.defaultOptions=d_}updateParams(e){h_(e.filterParams)!==this.allowedCharPattern&&this.recreateFloatingFilterInputService(e),super.updateParams(e)}createFloatingFilterInputService(e){return this.allowedCharPattern=h_(e.filterParams),this.allowedCharPattern?this.createManagedBean(new oB({config:{allowedCharPattern:this.allowedCharPattern}})):this.createManagedBean(new _me)}convertValue(e){return e?Number(e):null}},g_=["contains","notContains","equals","notEqual","startsWith","endsWith","blank","notBlank"],Dme=class extends l_{constructor(){super("textFilter",rB,g_),this.filterType="text",this.eValuesFrom=[],this.eValuesTo=[],this.defaultDebounceMs=500}createCondition(e){const t=this.getConditionType(e),n={filterType:this.filterType,type:t},s=this.getValues(e);return s.length>0&&(n.filter=s[0]),s.length>1&&(n.filterTo=s[1]),n}areSimpleModelsEqual(e,t){return e.filter===t.filter&&e.filterTo===t.filterTo&&e.type===t.type}getInputs(e){const{eValuesFrom:t,eValuesTo:n}=this;return e>=t.length?[null,null]:[t[e],n[e]]}getValues(e){const t=[];return this.forEachPositionInput(e,(n,s,o,r)=>{s<r&&t.push(ia(n.getValue()))}),t}createEValue(){const e=is({tag:"div",cls:"ag-filter-body",role:"presentation"}),{eValuesFrom:t,eValuesTo:n}=this;return this.createFromToElement(e,t,"from"),this.createFromToElement(e,n,"to"),e}createFromToElement(e,t,n){const s=this.createManagedBean(new _c);s.addCss(`ag-filter-${n}`),s.addCss("ag-filter-filter"),t.push(s),e.appendChild(s.getGui())}removeEValues(e,t){const n=r=>this.removeComponents(r,e,t),{eValuesFrom:s,eValuesTo:o}=this;n(s),n(o)}},aB=class extends u_{constructor(){super(...arguments),this.filterTypeKeys=pme}conditionToString(e,t,n,s,o){const{filter:r,filterTo:i,type:a}=e;if(t){const l=u=>()=>dl(this,"filterSummaryTextQuote",[u]),c=this.conditionForToolPanel(a,n,l(r),l(i),s,o);if(c!=null)return c}return n?`${r}-${i}`:r!=null?`${r}`:`${a}`}},Tme=({filterOption:e,value:t,filterText:n})=>{if(n==null)return!1;switch(e){case"contains":return t.includes(n);case"notContains":return!t.includes(n);case"equals":return t===n;case"notEqual":return t!=n;case"startsWith":return t.indexOf(n)===0;case"endsWith":{const s=t.lastIndexOf(n);return s>=0&&s===t.length-n.length}default:return!1}},Ime=e=>e,xme=e=>e==null?null:e.toString().toLowerCase(),Fme=class extends X2{constructor(){super(rB,g_),this.filterType="text",this.FilterModelFormatterClass=aB}updateParams(e){super.updateParams(e);const t=e.filterParams;this.matcher=t.textMatcher??Tme,this.formatter=t.textFormatter??(t.caseSensitive?Ime:xme)}evaluateNullValue(e){return e?["notEqual","notContains","blank"].indexOf(e)>=0:!1}evaluateNonNullValue(e,t,n,s){const o=e.map(h=>this.formatter(h))||[],r=this.formatter(t),{api:i,colDef:a,column:l,context:c,filterParams:{textFormatter:u}}=this.params;if(n.type==="blank")return _y(t);if(n.type==="notBlank")return!_y(t);const d={api:i,colDef:a,column:l,context:c,node:s.node,data:s.data,filterOption:n.type,value:r,textFormatter:u};return o.some(h=>this.matcher({...d,filterText:h}))}processModelToApply(e){if(e&&this.params.filterParams.trimInput){const t=n=>{const s={...n},{filter:o,filterTo:r}=n;return o&&(s.filter=p_(o)??null),r&&(s.filterTo=p_(r)??null),s};return hV(e)?{...e,conditions:e.conditions.map(t)}:t(e)}return e}},Pme=class extends iB{constructor(){super(...arguments),this.FilterModelFormatterClass=aB,this.filterType="text",this.defaultOptions=g_}createFloatingFilterInputService(){return this.createManagedBean(new oB)}};function Ame(e){var t;return!!((t=e.quickFilter)!=null&&t.isFilterPresent())}function kme(e){var t;return(t=e.quickFilter)==null?void 0:t.getText()}function Ome(e){var t;(t=e.quickFilter)==null||t.resetCache()}var Mme=class extends We{constructor(){super(...arguments),this.beanName="quickFilter",this.quickFilter=null,this.quickFilterParts=null}postConstruct(){const e=this.resetCache.bind(this),t=this.gos;this.addManagedEventListeners({columnPivotModeChanged:e,newColumnsLoaded:e,columnRowGroupChanged:e,columnVisible:()=>{t.get("includeHiddenColumnsInQuickFilter")||this.resetCache()}}),this.addManagedPropertyListener("quickFilterText",n=>this.setFilter(n.currentValue)),this.addManagedPropertyListeners(["includeHiddenColumnsInQuickFilter","applyQuickFilterBeforePivotOrAgg"],()=>this.onColumnConfigChanged()),this.quickFilter=this.parseFilter(t.get("quickFilterText")),this.parser=t.get("quickFilterParser"),this.matcher=t.get("quickFilterMatcher"),this.setFilterParts(),this.addManagedPropertyListeners(["quickFilterMatcher","quickFilterParser"],()=>this.setParserAndMatcher())}refreshCols(){var l;const{autoColSvc:e,colModel:t,gos:n,pivotResultCols:s}=this.beans,o=t.isPivotMode(),r=e==null?void 0:e.getColumns(),i=t.getColDefCols();let a=(o&&!n.get("applyQuickFilterBeforePivotOrAgg")?(l=s==null?void 0:s.getPivotResultCols())==null?void 0:l.list:i)??[];r&&(a=a.concat(r)),this.colsToUse=n.get("includeHiddenColumnsInQuickFilter")?a:a.filter(c=>c.isVisible()||c.isRowGroupActive())}isFilterPresent(){return this.quickFilter!==null}doesRowPass(e){const t=this.gos.get("cacheQuickFilter");return this.matcher?this.doesRowPassMatcher(t,e):this.quickFilterParts.every(n=>t?this.doesRowPassCache(e,n):this.doesRowPassNoCache(e,n))}resetCache(){this.beans.rowModel.forEachNode(e=>e.quickFilterAggregateText=null)}getText(){return this.gos.get("quickFilterText")}setFilterParts(){const{quickFilter:e,parser:t}=this;e?this.quickFilterParts=t?t(e):e.split(" "):this.quickFilterParts=null}parseFilter(e){return dt(e)?e.toUpperCase():null}setFilter(e){if(e!=null&&typeof e!="string"){Je(70,{newFilter:e});return}const t=this.parseFilter(e);this.quickFilter!==t&&(this.quickFilter=t,this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}setParserAndMatcher(){const e=this.gos.get("quickFilterParser"),t=this.gos.get("quickFilterMatcher"),n=e!==this.parser||t!==this.matcher;this.parser=e,this.matcher=t,n&&(this.setFilterParts(),this.dispatchLocalEvent({type:"quickFilterChanged"}))}onColumnConfigChanged(){this.refreshCols(),this.resetCache(),this.isFilterPresent()&&this.dispatchLocalEvent({type:"quickFilterChanged"})}doesRowPassNoCache(e,t){return this.colsToUse.some(n=>{const s=this.getTextForColumn(n,e);return dt(s)&&s.includes(t)})}doesRowPassCache(e,t){return this.checkGenerateAggText(e),e.quickFilterAggregateText.includes(t)}doesRowPassMatcher(e,t){let n;e?(this.checkGenerateAggText(t),n=t.quickFilterAggregateText):n=this.getAggText(t);const{quickFilterParts:s,matcher:o}=this;return o(s,n)}checkGenerateAggText(e){e.quickFilterAggregateText||(e.quickFilterAggregateText=this.getAggText(e))}getTextForColumn(e,t){let n=this.beans.filterValueSvc.getValue(e,t);const s=e.getColDef();if(s.getQuickFilterText){const o=Ft(this.gos,{value:n,node:t,data:t.data,column:e,colDef:s});n=s.getQuickFilterText(o)}return dt(n)?n.toString().toUpperCase():null}getAggText(e){const t=[];for(const n of this.colsToUse){const s=this.getTextForColumn(n,e);dt(s)&&t.push(s)}return t.join(`
257
257
  `)}},Nme={moduleName:"ClientSideRowModelFilter",version:ct,rowModels:["clientSide"],beans:[Lge]},m_={moduleName:"FilterCore",version:ct,beans:[rme],apiFunctions:{isAnyFilterPresent:sme,onFilterChanged:ome},css:[Uge],dependsOn:[Nme]},lB={moduleName:"FilterValue",version:ct,beans:[ame]},Ry={moduleName:"ColumnFilter",version:ct,beans:[nme,ime],dynamicBeans:{headerFilterCellCtrl:Vge},icons:{filter:"filter",filterActive:"filter"},apiFunctions:{isColumnFilterPresent:Wge,getColumnFilterInstance:zge,destroyFilter:jge,setFilterModel:Kge,getFilterModel:qge,getColumnFilterModel:Yge,setColumnFilterModel:Zge,showColumnFilter:Xge,hideColumnFilter:Jge,getColumnFilterHandler:Qge,doFilterAction:eme},dependsOn:[m_,Ey,lB,Hge]},Lme={moduleName:"CustomFilter",version:ct,userComponents:{agReadOnlyFloatingFilter:cme},dependsOn:[Ry]},Vme={moduleName:"TextFilter",version:ct,dependsOn:[Ry],userComponents:{agTextColumnFilter:{classImp:Dme,params:{useForm:!0}},agTextColumnFloatingFilter:Pme},dynamicBeans:{agTextColumnFilterHandler:Fme}},Bme={moduleName:"NumberFilter",version:ct,dependsOn:[Ry],userComponents:{agNumberColumnFilter:{classImp:bme,params:{useForm:!0}},agNumberColumnFloatingFilter:Rme},dynamicBeans:{agNumberColumnFilterHandler:Sme}},$me={moduleName:"DateFilter",version:ct,dependsOn:[Ry],userComponents:{agDateColumnFilter:{classImp:fme,params:{useForm:!0}},agDateInput:Cme,agDateColumnFloatingFilter:yme},dynamicBeans:{agDateColumnFilterHandler:mme}},Hme={moduleName:"QuickFilterCore",version:ct,rowModels:["clientSide"],beans:[Mme],dependsOn:[m_,lB]},Gme={moduleName:"QuickFilter",version:ct,apiFunctions:{isQuickFilterPresent:Ame,getQuickFilter:kme,resetQuickFilter:Ome},dependsOn:[Hme]},Ume={moduleName:"ExternalFilter",version:ct,dependsOn:[m_]},Wme=".ag-tooltip{background-color:var(--ag-tooltip-background-color);border:var(--ag-tooltip-border);border-radius:var(--ag-border-radius);color:var(--ag-tooltip-text-color);padding:var(--ag-widget-container-vertical-padding) var(--ag-widget-container-horizontal-padding);position:absolute;white-space:normal;z-index:99999;&:where(.ag-cell-editor-tooltip){background-color:var(--ag-tooltip-error-background-color);border:var(--ag-tooltip-error-border);color:var(--ag-tooltip-error-text-color);font-weight:500}}.ag-tooltip-custom{position:absolute;z-index:99999}.ag-tooltip-custom:where(:not(.ag-tooltip-interactive)),.ag-tooltip:where(:not(.ag-tooltip-interactive)){pointer-events:none}.ag-tooltip-animate{transition:opacity 1s;&:where(.ag-tooltip-hiding){opacity:0}}",v_=(e,t,n)=>{var a,l,c;const{editModelSvc:s}=e,o=(l=(a=s==null?void 0:s.getCellValidationModel())==null?void 0:a.getCellValidation(t))==null?void 0:l.errorMessages,r=(c=s==null?void 0:s.getRowValidationModel().getRowValidation(t))==null?void 0:c.errorMessages,i=o||r;return i!=null&&i.length?i.join(n("tooltipValidationErrorSeparator",". ")):void 0},zme=class extends We{constructor(){super(...arguments),this.beanName="tooltipSvc"}setupHeaderTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,r=i_(o),{column:i,eGui:a}=t,l=i.getColDef();!s&&r&&!l.headerComponent&&(s=Fv(()=>a.querySelector(".ag-header-cell-text")));const c="header",d=this.beans.colNames.getDisplayNameForColumn(i,"header",!0),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Ft(o,{location:c,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>({column:i,colDef:i.getColDef()})};let p=this.createTooltipFeature(f);return p&&(p=t.createBean(p),t.setRefreshFunction("tooltip",()=>p.refreshTooltip())),p}setupHeaderGroupTooltip(e,t,n,s){e&&t.destroyBean(e);const o=this.gos,r=i_(o),{column:i,eGui:a}=t,l=i.getColGroupDef();!s&&r&&!(l!=null&&l.headerGroupComponent)&&(s=Fv(()=>a.querySelector(".ag-header-group-text")));const c="headerGroup",d=this.beans.colNames.getDisplayNameForColumnGroup(i,"header"),h=n??d,f={getGui:()=>a,getLocation:()=>c,getTooltipValue:()=>{var g;return n??((g=l==null?void 0:l.headerTooltipValueGetter)==null?void 0:g.call(l,Ft(o,{location:c,colDef:l,column:i,value:h,valueFormatted:d})))??(l==null?void 0:l.headerTooltip)},shouldDisplayTooltip:s,getAdditionalParams:()=>{const g={column:i};return l&&(g.colDef=l),g}},p=this.createTooltipFeature(f);return p&&t.createBean(p)}enableCellTooltipFeature(e,t,n){const{beans:s}=this,{gos:o,editSvc:r}=s,{column:i,rowNode:a}=e;let l="cell";const c=()=>{const f=!!!(r!=null&&r.isEditing(e))&&v_(s,e,this.getLocaleTextFunc());if(f)return l="cellEditor",f;l="cell";const p=i.getColDef(),g=a.data;if(p.tooltipField&&dt(g))return cp(g,p.tooltipField,i.isTooltipFieldContainsDots());const v=p.tooltipValueGetter;return v?v(Ft(o,{location:"cell",colDef:i.getColDef(),column:i,rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,value:e.value,valueFormatted:e.valueFormatted})):null},u=i_(o);n||(u&&!e.isCellRenderer()?n=()=>{const h=!!(r!=null&&r.isEditing(e));if(!h&&v_(s,e,this.getLocaleTextFunc()))return!0;if(!i.isTooltipEnabled())return!1;const g=Fv(()=>{const v=e.eGui;return v.children.length===0?v:v.querySelector(".ag-cell-value")});return!h&&g()}:n=()=>!(r!=null&&r.isEditing(e)));const d={getGui:()=>e.eGui,getLocation:()=>l,getTooltipValue:t!=null?()=>t:c,shouldDisplayTooltip:n,getAdditionalParams:()=>({column:i,colDef:i.getColDef(),rowIndex:e.cellPosition.rowIndex,node:a,data:a.data,valueFormatted:e.valueFormatted})};return this.createTooltipFeature(d,s)}setupFullWidthRowTooltip(e,t,n,s){const o={getGui:()=>t.getFullWidthElement(),getTooltipValue:()=>n,getLocation:()=>"fullWidthRow",shouldDisplayTooltip:s},r=this.beans,i=r.context;e&&t.destroyBean(e,i);const a=this.createTooltipFeature(o,r);if(a)return t.createBean(a,i)}setupCellEditorTooltip(e,t){var a,l;const{beans:n}=this,{context:s}=n,o=((a=t.getValidationElement)==null?void 0:a.call(t,!0))||!((l=t.isPopup)!=null&&l.call(t))&&e.eGui;if(!o)return;const r={getGui:()=>o,getTooltipValue:()=>v_(n,e,this.getLocaleTextFunc()),getLocation:()=>"cellEditor",shouldDisplayTooltip:()=>{var p,g;const{editModelSvc:c}=n,u=(p=c==null?void 0:c.getRowValidationModel())==null?void 0:p.getRowValidationMap(),d=(g=c==null?void 0:c.getCellValidationModel())==null?void 0:g.getCellValidationMap(),h=!!u&&u.size>0,f=!!d&&d.size>0;return h||f}},i=this.createTooltipFeature(r,n);if(i)return e.createBean(i,s)}initCol(e){const{colDef:t}=e;e.tooltipEnabled=dt(t.tooltipField)||dt(t.tooltipValueGetter)||dt(t.tooltipComponent)}createTooltipFeature(e,t){return this.beans.registry.createDynamicBean("tooltipFeature",!1,e,t)}},jme=class extends mae{createTooltipComp(e,t){const n=lie(this.beans.userCompFactory,e);n==null||n.newAgStackInstance().then(t)}setEventHandlers(e){[this.onColumnMovedEventCallback]=this.addManagedEventListeners({columnMoved:e})}clearEventHandlers(){var e;(e=this.onColumnMovedEventCallback)==null||e.call(this),this.onColumnMovedEventCallback=void 0}},cB={moduleName:"Tooltip",version:ct,beans:[zme],dynamicBeans:{tooltipFeature:YL,highlightTooltipFeature:vae,tooltipStateManager:jme},userComponents:{agTooltipComponent:Cae},dependsOn:[Ey],css:[Wme]},Id=class{constructor(e){this.cellValueChanges=e}},y_=class extends Id{constructor(e,t,n,s){super(e),this.initialRange=t,this.finalRange=n,this.ranges=s}},Kme=10,uB=class{constructor(e){this.actionStack=[],this.maxStackSize=e||Kme,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}},qme=class extends We{constructor(){super(...arguments),this.beanName="undoRedo",this.cellValueChanges=[],this.activeCellEdit=null,this.activeRowEdit=null,this.isPasting=!1,this.isRangeInAction=!1,this.batchEditing=!1,this.bulkEditing=!1,this.onCellValueChanged=e=>{const t={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned},n=this.activeCellEdit!==null&&jV(this.activeCellEdit,t),s=this.activeRowEdit!==null&&vue(this.activeRowEdit,t);if(!(n||s||this.isPasting||this.isRangeInAction))return;const{rowPinned:r,rowIndex:i,column:a,oldValue:l,value:c}=e,u={rowPinned:r,rowIndex:i,columnId:a.getColId(),newValue:c,oldValue:l};this.cellValueChanges.push(u)},this.clearStacks=()=>{this.undoStack.clear(),this.redoStack.clear()}}postConstruct(){const{gos:e,ctrlsSvc:t}=this.beans;if(!e.get("undoRedoCellEditing"))return;const n=e.get("undoRedoCellEditingLimit");if(n<=0)return;this.undoStack=new uB(n),this.redoStack=new uB(n),this.addListeners();const s=this.clearStacks.bind(this);this.addManagedEventListeners({cellValueChanged:this.onCellValueChanged.bind(this),modelUpdated:o=>{o.keepUndoRedoStack||this.clearStacks()},columnPivotModeChanged:s,newColumnsLoaded:s,columnGroupOpened:s,columnRowGroupChanged:s,columnMoved:s,columnPinned:s,columnVisible:s,rowDragEnd:s}),t.whenReady(this,o=>{this.gridBodyCtrl=o.gridBodyCtrl})}getCurrentUndoStackSize(){var e;return((e=this.undoStack)==null?void 0:e.getCurrentStackSize())??0}getCurrentRedoStackSize(){var e;return((e=this.redoStack)==null?void 0:e.getCurrentStackSize())??0}undo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"undoStarted",source:e});const o=this.undoRedo(n,s,"initialRange","oldValue","undo");t.dispatchEvent({type:"undoEnded",source:e,operationPerformed:o})}redo(e){const{eventSvc:t,undoStack:n,redoStack:s}=this;t.dispatchEvent({type:"redoStarted",source:e});const o=this.undoRedo(s,n,"finalRange","newValue","redo");t.dispatchEvent({type:"redoEnded",source:e,operationPerformed:o})}undoRedo(e,t,n,s,o){if(!e)return!1;const r=e.pop();return r!=null&&r.cellValueChanges?(this.processAction(r,i=>i[s],o),r instanceof y_?this.processRange(r.ranges||[r[n]]):this.processCell(r.cellValueChanges),t.push(r),!0):!1}processAction(e,t,n){for(const s of e.cellValueChanges){const{rowIndex:o,rowPinned:r,columnId:i}=s,a={rowIndex:o,rowPinned:r},l=ma(this.beans,a);l.displayed&&l.setDataValue(i,t(s),n)}}processRange(e){let t;const n=this.beans.rangeSvc;n.removeAllCellRanges(!0),e.forEach((s,o)=>{if(!s)return;const r=s.startRow,i=s.endRow;o===e.length-1&&(t={rowPinned:r.rowPinned,rowIndex:r.rowIndex,columnId:s.startColumn.getColId()},this.setLastFocusedCell(t));const a={rowStartIndex:r.rowIndex,rowStartPinned:r.rowPinned,rowEndIndex:i.rowIndex,rowEndPinned:i.rowPinned,columnStart:s.startColumn,columns:s.columns};n.addCellRange(a)})}processCell(e){const t=e[0],{rowIndex:n,rowPinned:s}=t,o={rowIndex:n,rowPinned:s},r=ma(this.beans,o),i={rowPinned:t.rowPinned,rowIndex:r.rowIndex,columnId:t.columnId};this.setLastFocusedCell(i)}setLastFocusedCell(e){const{rowIndex:t,columnId:n,rowPinned:s}=e,{colModel:o,focusSvc:r,rangeSvc:i}=this.beans,a=o.getCol(n);if(!a)return;const{scrollFeature:l}=this.gridBodyCtrl;l.ensureIndexVisible(t),l.ensureColumnVisible(a);const c={rowIndex:t,column:a,rowPinned:s};r.setFocusedCell({...c,forceBrowserFocus:!0}),i==null||i.setRangeToCell(c)}addListeners(){this.addManagedEventListeners({rowEditingStarted:e=>{this.activeRowEdit={rowIndex:e.rowIndex,rowPinned:e.rowPinned}},rowEditingStopped:()=>{const e=new Id(this.cellValueChanges);this.pushActionsToUndoStack(e),this.activeRowEdit=null},cellEditingStarted:e=>{this.activeCellEdit={column:e.column,rowIndex:e.rowIndex,rowPinned:e.rowPinned}},cellEditingStopped:e=>{if(this.activeCellEdit=null,e.valueChanged&&!this.activeRowEdit&&!this.isPasting&&!this.isRangeInAction){const n=new Id(this.cellValueChanges);this.pushActionsToUndoStack(n)}},pasteStart:()=>{this.isPasting=!0},pasteEnd:()=>{const e=new Id(this.cellValueChanges);this.pushActionsToUndoStack(e),this.isPasting=!1},fillStart:()=>{this.isRangeInAction=!0},fillEnd:e=>{const t=new y_(this.cellValueChanges,e.initialRange,e.finalRange);this.pushActionsToUndoStack(t),this.isRangeInAction=!1},keyShortcutChangedCellStart:()=>{this.isRangeInAction=!0},keyShortcutChangedCellEnd:()=>{let e;const{rangeSvc:t,gos:n}=this.beans;t&&la(n)?e=new y_(this.cellValueChanges,void 0,void 0,[...t.getCellRanges()]):e=new Id(this.cellValueChanges),this.pushActionsToUndoStack(e),this.isRangeInAction=!1},batchEditingStarted:()=>this.startBigChange("batchEditing"),batchEditingStopped:({changes:e})=>this.stopBigChange("batchEditing",e),bulkEditingStarted:()=>this.startBigChange("bulkEditing"),bulkEditingStopped:({changes:e})=>this.stopBigChange("bulkEditing",e)})}startBigChange(e){this.updateBigChange(e,!0)}updateBigChange(e,t){e==="bulkEditing"?this.bulkEditing=t:this.batchEditing=t}stopBigChange(e,t){if(e==="bulkEditing"&&!this.bulkEditing||e==="batchEditing"&&!this.batchEditing||(this.updateBigChange(e,!1),(t==null?void 0:t.length)===0))return;const n=new Id(t??[]);this.pushActionsToUndoStack(n),this.cellValueChanges=[]}pushActionsToUndoStack(e){this.undoStack.push(e),this.cellValueChanges=[],this.redoStack.clear()}},Yme=".ag-cell-inline-editing{border:var(--ag-cell-editing-border)!important;border-radius:var(--ag-border-radius);box-shadow:var(--ag-cell-editing-shadow);padding:0;z-index:1;.ag-cell-edit-wrapper,.ag-cell-editor,.ag-cell-wrapper,:where(.ag-cell-editor) .ag-input-field-input,:where(.ag-cell-editor) .ag-wrapper{height:100%;line-height:normal;min-height:100%;width:100%}&.ag-cell-editing-error{border-color:var(--ag-invalid-color)!important}}:where(.ag-popup-editor) .ag-large-text{background-color:var(--ag-background-color);border-radius:var(--ag-border-radius);box-shadow:var(--ag-dropdown-shadow);padding:0}.ag-large-text-input{display:block;height:auto;padding:var(--ag-cell-horizontal-padding)}:where(.ag-rtl .ag-large-text-input) textarea{resize:none}:where(.ag-ltr) .ag-checkbox-edit{padding-left:var(--ag-cell-horizontal-padding)}:where(.ag-rtl) .ag-checkbox-edit{padding-right:var(--ag-cell-horizontal-padding)}:where(.ag-row.ag-row-editing-invalid .ag-cell-inline-editing){opacity:.8}.ag-popup-editor{position:absolute;-webkit-user-select:none;-moz-user-select:none;user-select:none}",Zme={tag:"div",cls:"ag-cell-wrapper ag-cell-edit-wrapper ag-checkbox-edit",children:[{tag:"ag-checkbox",ref:"eEditor",role:"presentation"}]},Xme=class extends hy{constructor(){super(Zme,[s0]),this.eEditor=ut}initialiseEditor(e){const t=e.value??void 0,n=this.eEditor;n.setValue(t),n.getInputElement().setAttribute("tabindex","-1"),this.setAriaLabel(t),this.addManagedListeners(n,{fieldValueChanged:o=>this.setAriaLabel(o.selected)})}getValue(){return this.eEditor.getValue()}focusIn(){this.eEditor.getFocusableElement().focus()}afterGuiAttached(){this.params.cellStartedEdit&&this.focusIn()}isPopup(){return!1}setAriaLabel(e){const t=this.getLocaleTextFunc(),n=Dv(t,e),s=t("ariaToggleCellValue","Press SPACE to toggle cell value");this.eEditor.setInputAriaLabel(`${s} (${n})`)}getValidationElement(e){return e?this.params.eGridCell:this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{getValidationErrors:t}=e,n=this.getValue();return t?t({value:n,internalErrors:null,cellEditorParams:e}):null}},Dy=class extends hy{constructor(e){super(),this.cellEditorInput=e,this.eEditor=ut}initialiseEditor(e){const{cellEditorInput:t}=this;this.setTemplate({tag:"div",cls:"ag-cell-edit-wrapper",children:[t.getTemplate()]},t.getAgComponents());const{eEditor:n}=this,{cellStartedEdit:s,eventKey:o,suppressPreventDefault:r}=e;n.getInputElement().setAttribute("title",""),t.init(n,e);let i,a=!0;s?(this.focusAfterAttached=!0,o===Oe.BACKSPACE||o===Oe.DELETE?i="":o&&o.length===1?r?a=!1:i=o:(i=t.getStartValue(),o!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,i=t.getStartValue()),a&&i!=null&&n.setStartValue(i),this.addGuiEventListener("keydown",l=>{const{key:c}=l;(c===Oe.PAGE_UP||c===Oe.PAGE_DOWN)&&l.preventDefault()})}afterGuiAttached(){var s,o;const e=this.getLocaleTextFunc(),t=this.eEditor;if(t.setInputAriaLabel(e("ariaInputEditor","Input Editor")),!this.focusAfterAttached)return;al()||t.getFocusableElement().focus();const n=t.getInputElement();this.highlightAllOnFocus?n.select():(o=(s=this.cellEditorInput).setCaret)==null||o.call(s)}focusIn(){const{eEditor:e}=this,t=e.getFocusableElement(),n=e.getInputElement();t.focus(),n.select()}getValue(){return this.cellEditorInput.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){return this.cellEditorInput.getValidationErrors()}},Jme={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},Qme=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return Jme}getAgComponents(){return[LL]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:r}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const t=this.eEditor.getInputElement().valueAsDate,{params:n}=this,{min:s,max:o,getValidationErrors:r}=n;let i=[];const a=this.getLocaleTextFunc();if(t instanceof Date&&!isNaN(t.getTime())){if(s){const l=s instanceof Date?s:new Date(s);if(t<l){const c=l.toLocaleDateString();i.push(a("minDateValidation",`Date must be after ${c}`,[c]))}}if(o){const l=o instanceof Date?o:new Date(o);if(t>l){const c=l.toLocaleDateString();i.push(a("maxDateValidation",`Date must be before ${c}`,[c]))}}}return i.length||(i=null),r?r({value:t,cellEditorParams:n,internalErrors:i}):i}getValue(){const{eEditor:e,params:t}=this,n=e.getDate();return!dt(n)&&!dt(t.value)?t.value:n??null}getStartValue(){const{value:e}=this.params;if(e instanceof Date)return Ho(e,this.includeTime??!1)}},eve=class extends Dy{constructor(){super(new Qme(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},tve={tag:"ag-input-date-field",ref:"eEditor",cls:"ag-cell-editor"},nve=class{constructor(e,t){this.getDataTypeService=e,this.getLocaleTextFunc=t}getTemplate(){return tve}getAgComponents(){return[LL]}init(e,t){var i,a;this.eEditor=e,this.params=t;const{min:n,max:s,step:o,colDef:r}=t;n!=null&&e.setMin(n),s!=null&&e.setMax(s),o!=null&&e.setStep(o),this.includeTime=t.includeTime??((a=(i=this.getDataTypeService())==null?void 0:i.getDateIncludesTimeFlag)==null?void 0:a.call(i,r.cellDataType)),this.includeTime!=null&&e.setIncludeTime(this.includeTime)}getValidationErrors(){const{eEditor:e,params:t}=this,n=e.getInputElement().value,s=this.formatDate(this.parseDate(n??void 0)),{min:o,max:r,getValidationErrors:i}=t;let a=[];if(s){const l=new Date(s),c=this.getLocaleTextFunc();if(o){const u=new Date(o);if(l<u){const d=u.toLocaleDateString();a.push(c("minDateValidation",`Date must be after ${d}`,[d]))}}if(r){const u=new Date(r);if(l>u){const d=u.toLocaleDateString();a.push(c("maxDateValidation",`Date must be before ${d}`,[d]))}}}return a.length||(a=null),i?i({value:this.getValue(),cellEditorParams:t,internalErrors:a}):a}getValue(){const{params:e,eEditor:t}=this,n=this.formatDate(t.getDate());return!dt(n)&&!dt(e.value)?e.value:e.parseValue(n??"")}getStartValue(){return Ho(this.parseDate(this.params.value??void 0)??null,this.includeTime??!1)}parseDate(e){const t=this.getDataTypeService();return t?t.getDateParserFunction(this.params.column)(e):vo(e)??void 0}formatDate(e){const t=this.getDataTypeService();return t?t.getDateFormatterFunction(this.params.column)(e):Ho(e??null,this.includeTime??!1)??void 0}},sve=class extends Dy{constructor(){super(new nve(()=>this.beans.dataTypeSvc,()=>this.getLocaleTextFunc()))}},ove={tag:"div",cls:"ag-large-text",children:[{tag:"ag-input-text-area",ref:"eEditor",cls:"ag-large-text-input"}]},rve=class extends hy{constructor(){super(ove,[Die]),this.eEditor=ut}initialiseEditor(e){const{eEditor:t}=this,{cellStartedEdit:n,eventKey:s,maxLength:o,cols:r,rows:i}=e;this.focusAfterAttached=n,t.getInputElement().setAttribute("title",""),t.setMaxLength(o||200).setCols(r||60).setRows(i||10);let a;n?(this.focusAfterAttached=!0,s===Oe.BACKSPACE||s===Oe.DELETE?a="":s&&s.length===1?a=s:(a=this.getStartValue(e),s!==Oe.F2&&(this.highlightAllOnFocus=!0))):(this.focusAfterAttached=!1,a=this.getStartValue(e)),a!=null&&t.setValue(a,!0),this.addGuiEventListener("keydown",this.onKeyDown.bind(this)),this.activateTabIndex()}getStartValue(e){const{value:t}=e;return(t==null?void 0:t.toString())??t}onKeyDown(e){const t=e.key;(t===Oe.LEFT||t===Oe.UP||t===Oe.RIGHT||t===Oe.DOWN||e.shiftKey&&t===Oe.ENTER)&&e.stopPropagation()}afterGuiAttached(){const{eEditor:e,focusAfterAttached:t,highlightAllOnFocus:n}=this,s=this.getLocaleTextFunc();e.setInputAriaLabel(s("ariaInputEditor","Input Editor")),t&&(e.getFocusableElement().focus(),n&&e.getInputElement().select())}getValue(){const{eEditor:e,params:t}=this,{value:n}=t,s=e.getValue();return!dt(s)&&!dt(n)?n:t.parseValue(s)}getValidationElement(){return this.eEditor.getInputElement()}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,s=this.getLocaleTextFunc(),o=this.getValue();let r=[];return typeof o=="string"&&t!=null&&o.length>t&&r.push(s("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:o,internalErrors:r,cellEditorParams:e}):r}},ive={tag:"ag-input-number-field",ref:"eEditor",cls:"ag-cell-editor"},ave=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return ive}getAgComponents(){return[Tie]}init(e,t){this.eEditor=e,this.params=t;const{max:n,min:s,precision:o,step:r}=t;n!=null&&e.setMax(n),s!=null&&e.setMin(s),o!=null&&e.setPrecision(o),r!=null&&e.setStep(r);const i=e.getInputElement();t.preventStepping?e.addManagedElementListeners(i,{keydown:this.preventStepping}):t.showStepperButtons&&i.classList.add("ag-number-field-input-stepper")}getValidationErrors(){const{params:e}=this,{min:t,max:n,getValidationErrors:s}=e,r=this.eEditor.getInputElement().valueAsNumber,i=this.getLocaleTextFunc();let a=[];return typeof r=="number"&&(t!=null&&r<t&&a.push(i("minValueValidation",`Must be greater than or equal to ${t}.`,[String(t)])),n!=null&&r>n&&a.push(i("maxValueValidation",`Must be less than or equal to ${n}.`,[String(n)]))),a.length||(a=null),s?s({value:r,cellEditorParams:e,internalErrors:a}):a}preventStepping(e){(e.key===Oe.UP||e.key===Oe.DOWN)&&e.preventDefault()}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();if(!dt(n)&&!dt(t.value))return t.value;let s=t.parseValue(n);if(s==null)return s;if(typeof s=="string"){if(s==="")return null;s=Number(s)}return isNaN(s)?null:s}getStartValue(){return this.params.value}setCaret(){al()&&this.eEditor.getInputElement().focus({preventScroll:!0})}},lve=class extends Dy{constructor(){super(new ave(()=>this.getLocaleTextFunc()))}},cve={tag:"div",cls:"ag-cell-edit-wrapper",children:[{tag:"ag-select",ref:"eEditor",cls:"ag-cell-editor"}]},uve=class extends hy{constructor(){super(cve,[Vie]),this.eEditor=ut,this.startedByEnter=!1}wireBeans(e){this.valueSvc=e.valueSvc}initialiseEditor(e){this.focusAfterAttached=e.cellStartedEdit;const{eEditor:t,valueSvc:n,gos:s}=this,{values:o,value:r,eventKey:i}=e;if(Vn(o)){Je(58);return}this.startedByEnter=i!=null?i===Oe.ENTER:!1;let a=!1;o.forEach(d=>{const h={value:d},f=n.formatValue(e.column,null,d),p=f!=null;h.text=p?f:d,t.addOption(h),a=a||r===d}),a?t.setValue(e.value,!0):e.values.length&&t.setValue(e.values[0],!0);const{valueListGap:l,valueListMaxWidth:c,valueListMaxHeight:u}=e;l!=null&&t.setPickerGap(l),u!=null&&t.setPickerMaxHeight(u),c!=null&&t.setPickerMaxWidth(c),s.get("editType")!=="fullRow"&&this.addManagedListeners(this.eEditor,{selectedItem:()=>e.stopEditing()})}afterGuiAttached(){this.focusAfterAttached&&this.eEditor.getFocusableElement().focus(),this.startedByEnter&&setTimeout(()=>{this.isAlive()&&this.eEditor.showPicker()})}focusIn(){this.eEditor.getFocusableElement().focus()}getValue(){return this.eEditor.getValue()}isPopup(){return!1}getValidationElement(){return this.eEditor.getAriaElement()}getValidationErrors(){const{params:e}=this,{values:t,getValidationErrors:n}=e,s=this.getValue();let o=[];if(t&&!t.includes(s)){const r=this.getLocaleTextFunc();o.push(r("invalidSelectionValidation","Invalid selection."))}else o=null;return n?n({value:s,internalErrors:o,cellEditorParams:e}):o}},dve={tag:"ag-input-text-field",ref:"eEditor",cls:"ag-cell-editor"},hve=class{constructor(e){this.getLocaleTextFunc=e}getTemplate(){return dve}getAgComponents(){return[Zv]}init(e,t){this.eEditor=e,this.params=t;const n=t.maxLength;n!=null&&e.setMaxLength(n)}getValidationErrors(){const{params:e}=this,{maxLength:t,getValidationErrors:n}=e,s=this.getValue(),o=this.getLocaleTextFunc();let r=[];return t!=null&&typeof s=="string"&&s.length>t&&r.push(o("maxLengthValidation",`Must be ${t} characters or fewer.`,[String(t)])),r.length||(r=null),n?n({value:s,cellEditorParams:e,internalErrors:r}):r}getValue(){const{eEditor:e,params:t}=this,n=e.getValue();return!dt(n)&&!dt(t.value)?t.value:t.parseValue(n)}getStartValue(){const e=this.params;return e.useFormatter||e.column.getColDef().refData?e.formatValue(e.value):e.value}setCaret(){al()&&this.eEditor.getInputElement().focus({preventScroll:!0});const e=this.eEditor,t=e.getValue(),n=dt(t)&&t.length||0;n&&e.getInputElement().setSelectionRange(n,n)}},dB=class extends Dy{constructor(){super(new hve(()=>this.getLocaleTextFunc()))}};function fve(e){return e.ctrlsSvc.getScrollFeature().getVScrollPosition()}function pve(e){return e.ctrlsSvc.getScrollFeature().getHScrollPosition()}function hB(e,t,n="auto"){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureColumnVisible(t,n),"ensureVisible")}function fB(e,t,n){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureIndexVisible(t,n),"ensureVisible")}function gve(e,t,n=null){e.frameworkOverrides.wrapIncoming(()=>e.ctrlsSvc.getScrollFeature().ensureNodeVisible(t,n),"ensureVisible")}function mve(e){var t;(t=e.undoRedo)==null||t.undo("api")}function vve(e){var t;(t=e.undoRedo)==null||t.redo("api")}function yve(e,t){var n;return(n=e.editModelSvc)==null?void 0:n.getEditRowDataValue(t,{checkSiblings:!0})}function wve(e){var s;const t=(s=e.editModelSvc)==null?void 0:s.getEditMap(),n=[];return t==null||t.forEach((o,r)=>{const{rowIndex:i,rowPinned:a}=r;o.forEach((l,c)=>{const{editorValue:u,pendingValue:d,sourceValue:h,state:f}=l,p=va(l);let g=u??d;g===pr&&(g=void 0);const v={newValue:g,oldValue:h,state:f,column:c,colId:c.getColId(),colKey:c.getColId(),rowIndex:i,rowPinned:a};(f==="editing"||f==="changed"&&p)&&n.push(v)})}),n}function Cve(e,t=!1){var s;const{editSvc:n}=e;if(n!=null&&n.isBatchEditing()){if(t)for(const o of((s=e.editModelSvc)==null?void 0:s.getEditPositions())??[])o.state==="editing"&&n.revertSingleCellEdit(o);else xc(e,{persist:!0});Rd(e,void 0,{cancel:t})}else n==null||n.stopEditing(void 0,{cancel:t,source:"edit",forceStop:!t,forceCancel:t})}function bve(e,t){var s;const n=Wn(e,t);return((s=e.editSvc)==null?void 0:s.isEditing(n))??!1}function Sve(e,t){const{key:n,colKey:s,rowIndex:o,rowPinned:r}=t,{editSvc:i,colModel:a}=e,l=a.getCol(s);if(!l){Je(12,{colKey:s});return}const u=ma(e,{rowIndex:o,rowPinned:r||null});if(!u){Je(290,{rowIndex:o,rowPinned:r});return}if(!l.isCellEditable(u))return;r==null&&fB(e,o),hB(e,s),i==null||i.startEditing({rowNode:u,column:l},{event:n?new KeyboardEvent("keydown",{key:n}):void 0,source:"api"})}function Eve(e){var t;return((t=e.editSvc)==null?void 0:t.validateEdit())||null}function _ve(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentUndoStackSize())??0}function Rve(e){var t;return((t=e.undoRedo)==null?void 0:t.getCurrentRedoStackSize())??0}var Dve={tag:"div",cls:"ag-popup-editor",attrs:{tabindex:"-1"}},Tve=class extends HE{constructor(e){super(Dve),this.params=e}postConstruct(){yc(this.gos,this.getGui(),"popupEditorWrapper",!0),this.addKeyDownListener()}addKeyDownListener(){const e=this.getGui(),t=this.params,n=s=>{S0(this.gos,s,t.node,t.column,!0)||t.onKeyDown(s)};this.addManagedElementListeners(e,{keydown:n})}};function Ive(e,{column:t},n,s,o="ui"){var c;if(n instanceof KeyboardEvent&&(n.key===Oe.TAB||n.key===Oe.ENTER||n.key===Oe.F2||n.key===Oe.BACKSPACE&&s))return!0;if((n==null?void 0:n.shiftKey)&&((c=e.rangeSvc)==null?void 0:c.getCellRanges().length)!=0)return!1;const i=t==null?void 0:t.getColDef(),a=xve(e.gos,i),l=n==null?void 0:n.type;return l==="click"&&(n==null?void 0:n.detail)===1&&a===1||l==="dblclick"&&(n==null?void 0:n.detail)===2&&a===2?!0:o==="api"?s??!1:!1}function xve(e,t){return e.get("suppressClickEdit")===!0?0:e.get("singleClickEdit")===!0||t!=null&&t.singleClickEdit?1:2}function w_(e,{rowNode:t,column:n},s="ui"){const o=n.getColDef().editable,r=e.editModelSvc;return n.isColumnFunc(t,o)||!!r&&r.hasEdits({rowNode:t,column:n},{withOpenEditor:!0})}function Fve(e,t,n="ui"){const s=w_(e,t,n);return s===!0||n==="ui"?s:e.colModel.getCols().some(r=>w_(e,{rowNode:t.rowNode,column:r},n))}var Ty=(e,t=!1)=>{if(e!==void 0)return va(e)||t&&e.state==="editing"};function pB(e,t,n=!1){var s;return Ty((s=e.editModelSvc)==null?void 0:s.getEdit(t),n)}var gB=(e,t,n)=>{if(e)for(let s=0,o=e.length;s<o;++s){const r=e[s];if(r.data&&(Ty(t==null?void 0:t.getEdit({rowNode:r,column:n}))||Ty(t==null?void 0:t.getEdit({rowNode:r.pinnedSibling,column:n})))||gB(r.childrenAfterGroup,t,n))return!0}};function mB(e,t){const{column:n,rowNode:s}=t;return e.gos.get("groupTotalRow")&&!(s!=null&&s.footer)?!1:gB(s==null?void 0:s.childrenAfterGroup,e.editModelSvc,n)}function vB(e,{rowNode:t,column:n}){var s;if(t=t.pinnedSibling,!!t)return Ty((s=e.editModelSvc)==null?void 0:s.getEdit({rowNode:t,column:n}))}var Pve=class extends We{constructor(e,t){super(),this.cellCtrl=e,this.beans=t,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}setComp(e){this.cellComp=e,this.applyCellStyles()}applyCellStyles(){var o;const{cellCtrl:e,editSvc:t,beans:n}=this;if(t!=null&&t.isBatchEditing()&&t.isEditing()){const r=pB(n,e)||mB(n,e)||vB(n,e);this.applyBatchingStyle(r)}else this.applyBatchingStyle(!1);const s=!!((o=this.editModelSvc)!=null&&o.getCellValidationModel().hasCellValidation(this.cellCtrl));this.cellComp.toggleCss("ag-cell-editing-error",s)}applyBatchingStyle(e){var t;this.cellComp.toggleCss("ag-cell-editing",e??!1),this.cellComp.toggleCss("ag-cell-batch-edit",(e&&((t=this.editSvc)==null?void 0:t.isBatchEditing()))??!1)}},Ave=class extends We{constructor(e,t){super(),this.rowCtrl=e,this.beans=t,this.gos=t.gos,this.editSvc=t.editSvc,this.editModelSvc=t.editModelSvc}applyRowStyles(){var i;const{rowCtrl:e,editModelSvc:t,beans:n}=this;let s=e.rowNode,o=t==null?void 0:t.getEditRow(s);const r=(i=this.editModelSvc)==null?void 0:i.getRowValidationModel().hasRowValidation({rowNode:s});if(!o&&s.pinnedSibling&&(s=s.pinnedSibling,o=t==null?void 0:t.getEditRow(s)),o){const a=Array.from(o.keys()).some(l=>{const c={rowNode:s,column:l};return pB(n,c,!0)||mB(n,c)||vB(n,c)});this.applyStyle(r,a);return}this.applyStyle(r)}applyStyle(e=!1,t=!1){var o,r;const n=((o=this.editSvc)==null?void 0:o.isBatchEditing())??!1,s=this.gos.get("editType")==="fullRow";(r=this.rowCtrl)==null||r.forEachGui(void 0,({rowComp:i})=>{i.toggleCss("ag-row-editing",s&&t),i.toggleCss("ag-row-batch-edit",s&&t&&n),i.toggleCss("ag-row-inline-editing",t),i.toggleCss("ag-row-not-inline-editing",!t),i.toggleCss("ag-row-editing-invalid",s&&t&&e)})}},kve=({rowModel:e,pinnedRowModel:t,editModelSvc:n},s)=>{const o=new Set;e.forEachNode(r=>s.has(r)&&o.add(r)),t==null||t.forEachPinnedRow("top",r=>s.has(r)&&o.add(r)),t==null||t.forEachPinnedRow("bottom",r=>s.has(r)&&o.add(r));for(const r of s)o.has(r)||n.removeEdits({rowNode:r});return o},Ove=({editModelSvc:e},t,n)=>{var s;for(const o of t)(s=e==null?void 0:e.getEditRow(o))==null||s.forEach((r,i)=>!n.has(i)&&e.removeEdits({rowNode:o,column:i}))},Mve=e=>()=>{const t=new Set(e.colModel.getCols()),n=e.editModelSvc.getEditMap(!0),s=new Set(n.keys());Ove(e,kve(e,s),t)},Nve=new Set(["undo","redo","paste","bulk","rangeSvc"]),Lve=new Set(["ui","api"]),yB={paste:"api",rangeSvc:"api",fillHandle:"api",cellClear:"api",bulk:"api"},Vve=new Set(Object.keys(yB)),Bve=new Set(["paste","rangeSvc","renderer","cellClear","redo","undo"]),Iy={cancel:!0,source:"api"},$ve={cancel:!1,source:"api"},xd={checkSiblings:!0},gp={force:!0,suppressFlash:!0},Hve=class extends We{constructor(){super(...arguments),this.beanName="editSvc",this.batch=!1,this.stopping=!1,this.committing=!1}postConstruct(){const{beans:e}=this;this.model=e.editModelSvc,this.valueSvc=e.valueSvc,this.rangeSvc=e.rangeSvc,this.addManagedPropertyListener("editType",({currentValue:s})=>{this.stopEditing(void 0,Iy),this.createStrategy(s)});const t=Mve(e),n=()=>{const s=this.model.getCellValidationModel().getCellValidationMap().size>0,o=this.model.getRowValidationModel().getRowValidationMap().size>0;return s||o?this.stopEditing(void 0,Iy):this.isEditing()&&(this.isBatchEditing()?Rd(e,this.model.getEditPositions()):this.stopEditing(void 0,$ve)),!1};this.addManagedEventListeners({columnPinned:t,columnVisible:t,columnRowGroupChanged:t,rowExpansionStateChanged:t,pinnedRowsChanged:t,displayedRowsChanged:t,sortChanged:n,filterChanged:n,cellFocused:this.onCellFocused.bind(this)})}isBatchEditing(){return this.batch}setBatchEditing(e){e?(this.batch=!0,this.stopEditing(void 0,Iy)):(this.stopEditing(void 0,Iy),this.batch=!1)}createStrategy(e){const{beans:t,gos:n,strategy:s}=this,o=wB(n,e);if(s){if(s.beanName===o)return s;this.destroyStrategy()}return this.strategy=this.createOptionalManagedBean(t.registry.createDynamicBean(o,!0))}destroyStrategy(){this.strategy&&(this.strategy.destroy(),this.strategy=this.destroyBean(this.strategy))}shouldStartEditing(e,t,n,s="ui"){const o=Ive(this.beans,e,t,n,s);return o&&(this.strategy??(this.strategy=this.createStrategy())),o}shouldStopEditing(e,t,n="ui"){var s;return((s=this.strategy)==null?void 0:s.shouldStop(e,t,n))??null}shouldCancelEditing(e,t,n="ui"){var s;return((s=this.strategy)==null?void 0:s.shouldCancel(e,t,n))??null}validateEdit(){return npe(this.beans)}isEditing(e,t){return this.model.hasEdits(e,t??xd)}isRowEditing(e,t){return(e&&this.model.hasRowEdits(e,t))??!1}startEditing(e,t){const{startedEdit:n=!0,event:s=null,source:o="ui",ignoreEventKey:r=!1,silent:i}=t;if(this.strategy??(this.strategy=this.createStrategy()),!this.isCellEditable(e,"api"))return;const a=Wn(this.beans,e);if(a&&!a.comp){a.onCompAttachedFuncs.push(()=>this.startEditing(e,t));return}const l=this.shouldStartEditing(e,s,n,o);if(l===!1&&o!=="api"){this.isEditing(e)&&this.stopEditing();return}!this.batch&&this.shouldStopEditing(e,void 0,o)&&!t.continueEditing&&this.stopEditing(void 0,{source:o}),l&&this.isBatchEditing()&&this.dispatchBatchEvent("batchEditingStarted",new Map),this.strategy.start({position:e,event:s,source:o,ignoreEventKey:r,startedEdit:n,silent:i})}stopEditing(e,t){var v,C,S;const{event:n,cancel:s,source:o="ui",forceCancel:r,forceStop:i}=t||{},{beans:a,model:l}=this;if(Vve.has(o)&&this.isBatchEditing())return this.bulkRefresh(e),!1;const c=this.committing?yB[o]:o;if(!(this.committing||this.isEditing(e)||this.isBatchEditing()&&l.hasEdits(e,xd))||!this.strategy||this.stopping)return!1;this.stopping=!0;const d=Wn(a,e);d&&(d.onEditorAttachedFuncs=[]);let h=l.getEditMap(!0),f=!1;const p=!s&&(!!this.shouldStopEditing(e,n,c)||this.committing&&!this.batch)||(i??!1),g=s&&!!this.shouldCancelEditing(e,n,c)||(r??!1);if(p||g){xc(a,{persist:!0,isCancelling:g||s,isStopping:p});const b=l.getEditMap(),w=this.processEdits(b,s,o);(v=this.strategy)==null||v.stop(s,n);for(const D of w)l.clearEditValue(D);this.bulkRefresh(void 0,h);for(const D of l.getEditPositions(b)){const R=Wn(a,D),T=va(D);R==null||R.refreshCell({force:!0,suppressFlash:!T})}h=b,f||(f=p)}else if(n instanceof KeyboardEvent&&this.batch&&((C=this.strategy)!=null&&C.midBatchInputsAllowed(e))&&this.isEditing(e,{withOpenEditor:!0})){const{key:b}=n,w=b===Oe.ENTER,D=b===Oe.ESCAPE,R=b===Oe.TAB;(w||R||D)&&(w||R?xc(a,{persist:!0}):D&&this.revertSingleCellEdit(d),this.isBatchEditing()?(S=this.strategy)==null||S.cleanupEditors():Rd(a,l.getEditPositions(),{event:n,cancel:D}),n.preventDefault(),this.bulkRefresh(e,h,{suppressFlash:!0}),h=l.getEditMap())}else xc(a,{persist:!0}),h=l.getEditMap();return f&&e&&this.model.removeEdits(e),this.navigateAfterEdit(t,d==null?void 0:d.cellPosition),J0(a),this.model.hasEdits()||(this.model.getCellValidationModel().clearCellValidationMap(),this.model.getRowValidationModel().clearRowValidationMap()),this.bulkRefresh(),g&&this.beans.rowRenderer.refreshRows({rowNodes:Array.from(h.keys())}),this.isBatchEditing()&&(this.beans.rowRenderer.refreshRows({suppressFlash:!0,force:!0}),f&&p&&this.dispatchBatchEvent("batchEditingStopped",h)),this.stopping=!1,f}navigateAfterEdit(e,t){var c;if(!e||!t)return;const{event:n,suppressNavigateAfterEdit:s}=e;if(!(n instanceof KeyboardEvent)||s)return;const{key:r,shiftKey:i}=n,a=this.gos.get("enterNavigatesVerticallyAfterEdit");if(r!==Oe.ENTER||!a)return;const l=i?Oe.UP:Oe.DOWN;(c=this.beans.navigation)==null||c.navigateToNextCell(null,l,t,!1)}processEdits(e,t=!1,n){const s=Array.from(e.keys()),o=this.model.getCellValidationModel().getCellValidationMap().size>0||this.model.getRowValidationModel().getRowValidationMap().size>0,r=[];for(const i of s){const a=e.get(i);for(const l of a.keys()){const c=a.get(l),u={rowNode:i,column:l},d=va(c);!t&&d&&!o&&(this.setNodeDataValue(i,l,c.pendingValue,void 0,n)||r.push(u))}}return r}setNodeDataValue(e,t,n,s,o="edit"){const{beans:r}=this,i=Wn(r,{rowNode:e,column:t}),a=Lve.has(o)?"edit":o;i&&(i.suppressRefreshCell=!0),this.commitNextEdit();const l=e.setDataValue(t,n,a);return i&&(i.suppressRefreshCell=!1),s&&(i==null||i.refreshCell(gp)),l}setEditMap(e,t){var s;this.strategy??(this.strategy=this.createStrategy()),(s=this.strategy)==null||s.setEditMap(e,t),this.bulkRefresh();let n=gp;t!=null&&t.forceRefreshOfEditCellsOnly&&(n={...Gve(e),...gp}),this.beans.rowRenderer.refreshCells(n)}dispatchEditValuesChanged({rowNode:e,column:t},n={}){if(!e||!t||!n)return;const{pendingValue:s,sourceValue:o}=n,{rowIndex:r,rowPinned:i,data:a}=e;this.beans.eventSvc.dispatchEvent({type:"cellEditValuesChanged",node:e,rowIndex:r,rowPinned:i,column:t,source:"api",data:a,newValue:s,oldValue:o,value:s,colDef:t.getColDef()})}bulkRefresh(e={},t,n={}){var a;const{beans:s,gos:o}=this,{editModelSvc:r,rowModel:i}=s;os(o)&&(e.rowNode&&e.column?this.refCell(e,this.model.getEdit(e),n):t&&((a=r==null?void 0:r.getEditMap(!1))==null||a.forEach((l,c)=>{for(const u of l.keys())this.refCell({rowNode:c,column:u},l.get(u),n)})))}refCell({rowNode:e,column:t},n,s={}){var d,h,f;const{beans:o,gos:r}=this,i=new Set([e]),a=new Set,l=e.pinnedSibling;l&&i.add(l);const c=e.sibling;c&&a.add(c);let u=e.parent;for(;u;)(d=u.sibling)!=null&&d.footer&&r.get("groupTotalRow")||!u.parent&&u.sibling&&r.get("grandTotalRow")?a.add(u.sibling):a.add(u),u=u.parent;for(const p of i)this.dispatchEditValuesChanged({rowNode:p,column:t},n);for(const p of i)(h=Wn(o,{rowNode:p,column:t}))==null||h.refreshCell(s);for(const p of a)(f=Wn(o,{rowNode:p,column:t}))==null||f.refreshCell(s)}stopAllEditing(e=!1,t="ui"){this.isEditing()&&this.stopEditing(void 0,{cancel:e,source:t})}isCellEditable(e,t="ui"){const{rowNode:n}=e,{gos:s,beans:o}=this;if(n.group){if(s.get("treeData")){if(!n.data&&!s.get("enableGroupEdit"))return!1}else if(!s.get("enableGroupEdit"))return!1}const r=wB(s)==="fullRow"?Fve(o,e,t):w_(o,e,t);return r&&(this.strategy??(this.strategy=this.createStrategy())),r}cellEditingInvalidCommitBlocks(){return this.gos.get("invalidEditValueMode")==="block"}checkNavWithValidation(e,t,n=!0){var s,o,r,i;if(this.hasValidationErrors(e)){const a=Wn(this.beans,e);return this.cellEditingInvalidCommitBlocks()?((s=t==null?void 0:t.preventDefault)==null||s.call(t),n&&(!(a!=null&&a.hasBrowserFocus())&&(a==null||a.focusCell()),(i=(r=(o=a==null?void 0:a.comp)==null?void 0:o.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)),"block-stop"):(a&&this.revertSingleCellEdit(a),"revert-continue")}return"continue"}revertSingleCellEdit(e,t=!1){var s,o,r,i;const n=Wn(this.beans,e);(s=n==null?void 0:n.comp)!=null&&s.getCellEditor()&&(Rd(this.beans,[e],{silent:!0}),this.model.clearEditValue(e),_d(this.beans,e,{silent:!0}),Fc(this.beans),n==null||n.refreshCell(gp),t&&(n==null||n.focusCell(),(i=(r=(o=n==null?void 0:n.comp)==null?void 0:o.getCellEditor())==null?void 0:r.focusIn)==null||i.call(r)))}hasValidationErrors(e){var s;Fc(this.beans);const t=Wn(this.beans,e);t&&(t.refreshCell(gp),(s=t.rowCtrl.rowEditStyleFeature)==null||s.applyRowStyles());let n=!1;return e!=null&&e.rowNode?(n||(n=this.model.getRowValidationModel().hasRowValidation({rowNode:e.rowNode})),e.column&&(n||(n=this.model.getCellValidationModel().hasCellValidation({rowNode:e.rowNode,column:e.column})))):(n||(n=this.model.getCellValidationModel().getCellValidationMap().size>0),n||(n=this.model.getRowValidationModel().getRowValidationMap().size>0)),n}moveToNextCell(e,t,n,s="ui"){var a;let o;const r=this.isEditing(),i=r&&this.checkNavWithValidation(void 0,n)==="block-stop";return e instanceof Dd&&r&&(o=(a=this.strategy)==null?void 0:a.moveToNextEditingCell(e,t,n,s,i)),o===null||(o=o||!!this.beans.focusSvc.focusedHeader,o===!1&&!i&&this.stopEditing()),o}getCellDataValue({rowNode:e,column:t},n=!0){if(!e||!t)return;let s=this.model.getEdit({rowNode:e,column:t});const o=e.pinnedSibling;if(o){const i=this.model.getEdit({rowNode:o,column:t});i&&(s=i)}const r=n?(s==null?void 0:s.editorValue)??(s==null?void 0:s.pendingValue):s==null?void 0:s.pendingValue;return r===pr||!s?(s==null?void 0:s.sourceValue)??this.valueSvc.getValue(t,e,!1,"api"):r}addStopEditingWhenGridLosesFocus(e){Zfe(this,this.beans,e)}createPopupEditorWrapper(e){return new Tve(e)}commitNextEdit(){this.committing=!0}setDataValue(e,t,n){var s;try{if((!this.isEditing()||this.committing)&&!Bve.has(n))return;const{beans:o}=this;this.strategy??(this.strategy=this.createStrategy());const r=this.isBatchEditing()?"ui":this.committing?n??"api":"api";if(!n||Nve.has(n))return wy(o,e,t,n,void 0,{persist:!0}),this.setNodeDataValue(e.rowNode,e.column,t,!0,n);const i=this.model.getEdit(e);if(i){if(i.pendingValue===t)return!1;if(i.sourceValue!==t)return wy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0;if(i.sourceValue===t)return(s=o.editModelSvc)==null||s.removeEdits(e),this.dispatchEditValuesChanged(e,{...i,pendingValue:t}),!0}return wy(o,e,t,n,void 0,{persist:!0}),this.stopEditing(e,{source:r,suppressNavigateAfterEdit:!0}),!0}finally{this.committing=!1}}handleColDefChanged(e){Qfe(this.beans,e)}destroy(){this.model.clear(),this.destroyStrategy(),super.destroy()}prepDetailsDuringBatch(e,t){if(!this.batch||!this.model.hasRowEdits(e.rowNode,xd))return;const{rowNode:s,column:o}=e,{compDetails:r,valueToDisplay:i}=t;if(r){const{params:l}=r;return l.data=this.model.getEditRowDataValue(s,xd),{compDetails:r}}const a=this.model.getEditRow(e.rowNode,xd);if(i!==void 0&&(a!=null&&a.has(o)))return{valueToDisplay:this.valueSvc.getValue(o,s)}}cleanupEditors(){var e;(e=this.strategy)==null||e.cleanupEditors()}dispatchCellEvent(e,t,n,s){var o;(o=this.strategy)==null||o.dispatchCellEvent(e,t,n,s)}dispatchBatchEvent(e,t){this.eventSvc.dispatchEvent(this.createBatchEditEvent(e,t))}createBatchEditEvent(e,t){return Ft(this.gos,{type:e,...e==="batchEditingStopped"?{changes:this.toEventChangeList(t)}:{}})}toEventChangeList(e){return this.model.getEditPositions(e).map(t=>({rowIndex:t.rowNode.rowIndex,rowPinned:t.rowNode.rowPinned,columnId:t.column.getColId(),newValue:t.pendingValue,oldValue:t.sourceValue}))}applyBulkEdit({rowNode:e,column:t},n){var c,u;if(!n||n.length===0)return;const{beans:s,rangeSvc:o,valueSvc:r}=this;xc(s,{persist:!0});const i=this.model.getEditMap(!0),a=(u=(c=i.get(e))==null?void 0:c.get(t))==null?void 0:u.pendingValue;this.batch||this.eventSvc.dispatchEvent({type:"bulkEditingStarted"}),n.forEach(d=>{if(o==null||o.forEachRowInRange(d,h=>{const f=ma(s,h);if(f===void 0)return;const p=i.get(f)??new Map;for(const g of d.columns)if(g&&this.isCellEditable({rowNode:f,column:g},"api")){const v=r.getValue(g,f,!0,"api");let C=r.parseValue(g,f??null,a,v);Number.isNaN(C)&&(C=null),p.set(g,{editorValue:void 0,pendingValue:C,sourceValue:v,state:"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}p.size>0&&i.set(f,p)}),this.setEditMap(i),this.batch){this.cleanupEditors(),J0(s),this.bulkRefresh();return}this.commitNextEdit(),this.stopEditing(void 0,{source:"bulk"}),this.eventSvc.dispatchEvent({type:"bulkEditingStopped",changes:this.toEventChangeList(i)})}),this.bulkRefresh();const l=Wn(s,{rowNode:e,column:t});l&&l.focusCell(!0)}createCellStyleFeature(e,t){return new Pve(e,t)}createRowStyleFeature(e,t){return new Ave(e,t)}setEditingCells(e,t){const{beans:n}=this,{colModel:s,valueSvc:o}=n,r=new Map;for(let{colId:i,column:a,colKey:l,rowIndex:c,rowPinned:u,newValue:d,state:h}of e){const f=i?s.getCol(i):l?s.getCol(l):a;if(!f)continue;const p=ma(n,{rowIndex:c,rowPinned:u});if(!p)continue;const g=o.getValue(f,p,!0,"api");if(!(t!=null&&t.forceRefreshOfEditCellsOnly)&&!va({pendingValue:d,sourceValue:g})&&h!=="editing")continue;let v=r.get(p);v||(v=new Map,r.set(p,v)),d===void 0&&(d=pr),v.set(f,{editorValue:void 0,pendingValue:d,sourceValue:g,state:h??"changed",editorState:{isCancelAfterEnd:void 0,isCancelBeforeStart:void 0}})}this.setEditMap(r,t)}onCellFocused(e){var r;const t=Wn(this.beans,e);if(!t||!this.isEditing(t,xd))return;const n=this.model.getEdit(t);if(!n||!va(n))return;const o=this.getLocaleTextFunc()("ariaPendingChange","Pending Change");(r=this.beans.ariaAnnounce)==null||r.announceValue(o,"pendingChange")}allowedFocusTargetOnValidation(e){return Wn(this.beans,e)}};function Gve(e){return{rowNodes:e?Array.from(e.keys()):void 0,columns:e?[...new Set(Array.from(e.values()).flatMap(t=>Array.from(t.keys())))]:void 0}}function wB(e,t){return t??e.get("editType")??"singleCell"}var CB=class extends We{postConstruct(){var e,t;this.model=this.beans.editModelSvc,this.editSvc=this.beans.editSvc,this.addManagedEventListeners({cellFocused:(e=this.onCellFocusChanged)==null?void 0:e.bind(this),cellFocusCleared:(t=this.onCellFocusChanged)==null?void 0:t.bind(this)})}clearEdits(e){this.model.clearEditValue(e)}onCellFocusChanged(e){let t;const n=e.previousParams,{editSvc:s,beans:o}=this,r=e.type==="cellFocused"?e.sourceEvent:null;n&&(t=Wn(o,n));const{gos:i,editModelSvc:a}=o,l=e.type==="cellFocusCleared";if(s.isEditing(void 0,{withOpenEditor:!0})){const{column:c,rowIndex:u,rowPinned:d}=e,h={column:c,rowNode:ma(o,{rowIndex:u,rowPinned:d})},f=i.get("invalidEditValueMode")==="block";if(f)return;const p=!f,g=!!(a!=null&&a.getCellValidationModel().hasCellValidation(h)),v=p&&g;(n||l?s.stopEditing(void 0,{cancel:v,source:l&&p?"api":void 0,event:r}):!0)||(s.isBatchEditing()?s.cleanupEditors():s.stopEditing(void 0,{source:"api"}))}t==null||t.refreshCell({suppressFlash:!0,force:!0})}stop(e,t){var o,r;const n=this.model.getEditPositions(),s={all:[],pass:[],fail:[]};for(const i of n){s.all.push(i);const a=this.model.getCellValidationModel().getCellValidation(i);if((((o=a==null?void 0:a.errorMessages)==null?void 0:o.length)??0)>0){s.fail.push(i);continue}s.pass.push(i)}if(e)for(const i of n)Cy(this.beans,i,{cancel:e}),this.model.stop(i);else{const i=this.processValidationResults(s);if(i.destroy.length>0)for(const a of i.destroy)Cy(this.beans,a,{event:t,cancel:e}),this.model.stop(a);if(i.keep.length>0)for(const a of i.keep){const l=Wn(this.beans,a);(r=this.editSvc)!=null&&r.cellEditingInvalidCommitBlocks()||l&&this.editSvc.revertSingleCellEdit(l)}}return!0}cleanupEditors({rowNode:e}={},t){xc(this.beans,{persist:!1});const n=this.model.getEditPositions(),s=[];if(e)for(const o of n)o.rowNode!==e&&s.push(o);else for(const o of n)s.push(o);Rd(this.beans,s),J0(this.beans,t)}setFocusOutOnEditor(e){var t,n,s;(s=(n=(t=e.comp)==null?void 0:t.getCellEditor())==null?void 0:n.focusOut)==null||s.call(n)}setFocusInOnEditor(e){const t=e.comp,n=t==null?void 0:t.getCellEditor();if(n!=null&&n.focusIn)n.focusIn();else{const s=this.beans.gos.get("editType")==="fullRow";e.focusCell(s),e.onEditorAttachedFuncs.push(()=>{var o,r;return(r=(o=t==null?void 0:t.getCellEditor())==null?void 0:o.focusIn)==null?void 0:r.call(o)})}}setupEditors(e){const{event:t,ignoreEventKey:n=!1,startedEdit:s,position:o,cells:r=this.model.getEditPositions()}=e,i=t instanceof KeyboardEvent&&!n&&t.key||void 0;Jfe(this.beans,r,o,i,t,s)}dispatchCellEvent(e,t,n,s){const o=Wn(this.beans,e);o&&this.eventSvc.dispatchEvent({...o.createEvent(t??null,n),...s})}dispatchRowEvent(e,t,n){if(n)return;const s=Z0(this.beans,e);s&&this.eventSvc.dispatchEvent(s.createRowEvent(t))}shouldStop(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return s&&n==="api"?!0:s&&(n==="ui"||n==="edit")?!1:n==="api"?!0:t instanceof KeyboardEvent&&!s?t.key===Oe.ENTER:null}shouldCancel(e,t,n="ui"){const s=this.editSvc.isBatchEditing();return!!(t instanceof KeyboardEvent&&!s&&t.key===Oe.ESCAPE||s&&n==="api"||n==="api")}setEditMap(e,t){var s;t!=null&&t.update||this.editSvc.stopEditing(void 0,{cancel:!0,source:"api"});const n=[];if(e.forEach((o,r)=>{o.forEach((i,a)=>{i.state==="editing"&&n.push({...i,rowNode:r,column:a})})}),t!=null&&t.update&&(e=new Map([...this.model.getEditMap(),...e])),(s=this.model)==null||s.setEditMap(e),n.length>0){const o=n.at(-1),r=o.pendingValue===pr?void 0:o.pendingValue;this.start({position:o,event:new KeyboardEvent("keydown",{key:r}),source:"api"});const i=Wn(this.beans,o);i&&this.setFocusInOnEditor(i)}}destroy(){this.cleanupEditors(),super.destroy()}},Uve=class extends CB{constructor(){super(...arguments),this.beanName="fullRow",this.startedRows=[]}shouldStop(e,t,n="ui"){const{rowNode:s}=e||{};if(!Z0(this.beans,{rowNode:this.rowNode}))return!0;const r=super.shouldStop({rowNode:this.rowNode},t,n);return r!==null?r:this.rowNode?s!==this.rowNode:!1}midBatchInputsAllowed({rowNode:e}){return e?this.model.hasEdits({rowNode:e}):!1}clearEdits(e){this.model.clearEditValue(e)}start(e){const{position:t,silent:n,startedEdit:s,event:o,ignoreEventKey:r}=e,{rowNode:i}=t;this.rowNode!==i&&super.cleanupEditors(t);const a=this.beans.visibleCols.allCols,l=[],c=[];for(const u of a)u.isCellEditable(i)&&c.push(u);if(c.length!=0){this.dispatchRowEvent({rowNode:i},"rowEditingStarted",n),this.startedRows.push(i);for(const u of c){const d={rowNode:i,column:u};l.push(d),this.model.hasEdits(d)||this.model.start(d)}this.rowNode=i,this.setupEditors({cells:l,position:t,startedEdit:s,event:o,ignoreEventKey:r})}}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){var o;const{rowNode:n}=this;if(n&&!this.model.hasRowEdits(n))return!1;const s=[];if(e||this.model.getEditMap().forEach((r,i)=>{if(!(!r||r.size===0)){for(const a of r.values())if(va(a)){s.push(i);break}}}),Fc(this.beans),!e&&((o=this.editSvc)==null?void 0:o.checkNavWithValidation({rowNode:n}))==="block-stop")return!1;super.stop(e,t);for(const r of s)this.dispatchRowEvent({rowNode:r},"rowValueChanged");return this.cleanupEditors({rowNode:n},!0),this.rowNode=void 0,!0}onCellFocusChanged(e){const{rowIndex:t}=e,n=e.previousParams;if((n==null?void 0:n.rowIndex)===t||e.sourceEvent instanceof KeyboardEvent)return;const s=Wn(this.beans,n);this.gos.get("invalidEditValueMode")==="block"&&s&&(this.model.getCellValidationModel().getCellValidation(s)||this.model.getRowValidationModel().getRowValidation(s))||super.onCellFocusChanged(e)}cleanupEditors(e={},t){super.cleanupEditors(e,t);for(const n of this.startedRows)this.dispatchRowEvent({rowNode:n},"rowEditingStopped");this.startedRows.length=0}moveToNextEditingCell(e,t,n,s="ui",o=!1){var h,f,p,g;const r=e.cellPosition;let i;this.model.suspend(!0);try{i=(h=this.beans.navigation)==null?void 0:h.findNextCellToFocusOn(r,{backwards:t,startEditing:!0,skipToNextEditableCell:!1})}finally{this.model.suspend(!1)}if(i===!1)return null;if(i==null)return!1;const a=i.cellPosition,l=e.isCellEditable(),c=i.isCellEditable(),u=a&&r.rowIndex===a.rowIndex&&r.rowPinned===a.rowPinned;l&&this.setFocusOutOnEditor(e),this.restoreEditors();const d=this.gos.get("suppressStartEditOnTab");return c&&!o?d?i.focusCell(!0,n):((f=i.comp)!=null&&f.getCellEditor()||_d(this.beans,i,{event:n,cellStartedEdit:!0}),this.setFocusInOnEditor(i),i.focusCell(!1,n)):(c&&o&&this.setFocusInOnEditor(i),i.focusCell(!0,n)),!u&&!o&&((p=this.editSvc)==null||p.stopEditing({rowNode:e.rowNode},{event:n}),this.cleanupEditors(i,!0),d?i.focusCell(!0,n):this.editSvc.startEditing(i,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),(g=e.rowCtrl)==null||g.refreshRow({suppressFlash:!0,force:!0}),!0}restoreEditors(){this.model.getEditMap().forEach((e,t)=>e.forEach(({state:n},s)=>{var r;if(n!=="editing")return;const o=Wn(this.beans,{rowNode:t,column:s});o&&!((r=o.comp)!=null&&r.getCellEditor())&&_d(this.beans,o,{silent:!0})}))}destroy(){super.destroy(),this.rowNode=void 0,this.startedRows.length=0}},Wve=class extends CB{constructor(){super(...arguments),this.beanName="singleCell"}shouldStop(e,t,n="ui"){const s=super.shouldStop(e,t,n);if(s!==null)return s;const{rowNode:o,column:r}=e||{};return(!this.rowNode||!this.column)&&o&&r?null:this.rowNode!==o||this.column!==r}midBatchInputsAllowed(e){return this.model.hasEdits(e)}start(e){const{position:t,startedEdit:n,event:s,ignoreEventKey:o}=e;(this.rowNode!==t.rowNode||this.column!==t.column)&&super.cleanupEditors(),this.rowNode=t.rowNode,this.column=t.column,this.model.start(t),this.setupEditors({cells:[t],position:t,startedEdit:n,event:s,ignoreEventKey:o})}dispatchRowEvent(e,t,n){}processValidationResults(e){return e.fail.length>0&&this.editSvc.cellEditingInvalidCommitBlocks()?{destroy:[],keep:e.all}:{destroy:e.all,keep:[]}}stop(e,t){return super.stop(e,t),this.rowNode=void 0,this.column=void 0,!0}onCellFocusChanged(e){const{colModel:t,editSvc:n}=this.beans,{rowIndex:s,column:o,rowPinned:r}=e,i=ma(this.beans,{rowIndex:s,rowPinned:r}),a=X0(o),l=t.getCol(a),c=e.previousParams;if(c){const u=X0(c.column);if((c==null?void 0:c.rowIndex)===s&&u===a&&(c==null?void 0:c.rowPinned)===r)return}n!=null&&n.isEditing({rowNode:i,column:l},{withOpenEditor:!0})&&e.type==="cellFocused"||super.onCellFocusChanged(e)}moveToNextEditingCell(e,t,n,s="ui",o=!1){var p,g,v,C,S,b;const r=this.beans.focusSvc.getFocusedCell();r&&(e=Sd(this.beans,r)??e);const i=e.cellPosition;let a;const l=this.beans.gos.get("editType")==="fullRow";l&&this.model.suspend(!0),o||(e.eGui.focus(),(g=this.editSvc)==null||g.stopEditing(e,{source:(p=this.editSvc)!=null&&p.isBatchEditing()?"ui":"api",event:n}));try{a=(v=this.beans.navigation)==null?void 0:v.findNextCellToFocusOn(i,{backwards:t,startEditing:!0})}finally{l&&this.model.suspend(!1)}if(a===!1)return null;if(a==null)return!1;const c=a.cellPosition,u=e.isCellEditable(),d=a.isCellEditable(),h=c&&i.rowIndex===c.rowIndex&&i.rowPinned===c.rowPinned;u&&!o&&this.setFocusOutOnEditor(e);const f=this.gos.get("suppressStartEditOnTab");if(!h&&!o&&(super.cleanupEditors(a,!0),f?a.focusCell(!0,n):this.editSvc.startEditing(a,{startedEdit:!0,event:n,source:s,ignoreEventKey:!0})),d&&!o){if(a.focusCell(!1,n),f)a.focusCell(!0,n);else if(!((C=a.comp)!=null&&C.getCellEditor())){const w=(S=this.editSvc)==null?void 0:S.isEditing(a,{withOpenEditor:!0});_d(this.beans,a,{event:n,cellStartedEdit:!0,silent:w}),this.setFocusInOnEditor(a),this.cleanupEditors(a)}}else d&&o&&this.setFocusInOnEditor(a),a.focusCell(!0,n);return(b=e.rowCtrl)==null||b.refreshRow({suppressFlash:!0,force:!0}),!0}destroy(){super.destroy(),this.rowNode=void 0,this.column=void 0}},gl={moduleName:"EditCore",version:ct,beans:[Yfe,Hve],apiFunctions:{getEditingCells:wve,getEditRowValues:yve,getCellEditorInstances:Xfe,startEditingCell:Sve,stopEditing:Cve,isEditing:bve,validateEdit:Eve},dynamicBeans:{singleCell:Wve,fullRow:Uve},dependsOn:[Ey,cB],css:[Yme]},zve={moduleName:"UndoRedoEdit",version:ct,beans:[qme],apiFunctions:{undoCellEditing:mve,redoCellEditing:vve,getCurrentUndoSize:_ve,getCurrentRedoSize:Rve},dependsOn:[gl]},jve={moduleName:"TextEditor",version:ct,userComponents:{agCellEditor:dB,agTextCellEditor:dB},dependsOn:[gl]},Kve={moduleName:"NumberEditor",version:ct,userComponents:{agNumberCellEditor:{classImp:lve}},dependsOn:[gl]},qve={moduleName:"DateEditor",version:ct,userComponents:{agDateCellEditor:eve,agDateStringCellEditor:sve},dependsOn:[gl]},Yve={moduleName:"CheckboxEditor",version:ct,userComponents:{agCheckboxCellEditor:Xme},dependsOn:[gl]},Zve={moduleName:"SelectEditor",version:ct,userComponents:{agSelectCellEditor:uve},dependsOn:[gl]},Xve={moduleName:"LargeTextEditor",version:ct,userComponents:{agLargeTextCellEditor:rve},dependsOn:[gl]},Jve={moduleName:"CustomEditor",version:ct,dependsOn:[gl]},Qve=class extends We{constructor(){super(...arguments),this.beanName="selectionColSvc"}postConstruct(){this.addManagedPropertyListener("rowSelection",e=>{this.onSelectionOptionsChanged(e.currentValue,e.previousValue,fd(e.source))}),this.addManagedPropertyListener("selectionColumnDef",this.updateColumns.bind(this))}addColumns(e){const t=this.columns;t!=null&&(e.list=t.list.concat(e.list),e.tree=t.tree.concat(e.tree),ure(e))}createColumns(e,t){var h,f;const n=()=>{var p;Uv(this.beans,(p=this.columns)==null?void 0:p.tree),this.columns=null},s=e.treeDepth,r=(((h=this.columns)==null?void 0:h.treeDepth)??-1)==s,i=this.generateSelectionCols();if(cre(i,((f=this.columns)==null?void 0:f.list)??[])&&r)return;n();const{colGroupSvc:l}=this.beans,c=(l==null?void 0:l.findDepth(e.tree))??0,u=(l==null?void 0:l.balanceTreeForAutoCols(i,c))??[];this.columns={list:i,tree:u,treeDepth:c,map:{}},t(p=>{if(!p)return null;const g=p.filter(v=>!ua(v));return[...i,...g]})}updateColumns(e){var n;const t=fd(e.source);for(const s of((n=this.columns)==null?void 0:n.list)??[]){const o=this.createSelectionColDef(e.currentValue);s.setColDef(o,null,t),Hr(this.beans,{state:[{...o,colId:s.getColId()}]},t)}}getColumn(e){var t;return((t=this.columns)==null?void 0:t.list.find(n=>Xf(n,e)))??null}getColumns(){var e;return((e=this.columns)==null?void 0:e.list)??null}isSelectionColumnEnabled(){var i,a;const{gos:e,beans:t}=this,n=e.get("rowSelection");if(typeof n!="object"||!mc(e))return!1;const s=(((a=(i=t.autoColSvc)==null?void 0:i.getColumns())==null?void 0:a.length)??0)>0;if(n.checkboxLocation==="autoGroupColumn"&&s)return!1;const o=!!hd(n),r=Lv(n);return o||r}createSelectionColDef(e){const{gos:t}=this,n=e??t.get("selectionColumnDef"),s=t.get("enableRtl"),{rowSpan:o,spanRows:r,...i}=n??{};return{width:50,resizable:!1,suppressHeaderMenuButton:!0,sortable:!1,suppressMovable:!0,lockPosition:s?"right":"left",comparator(a,l,c,u){const d=c.isSelected(),h=u.isSelected();return d===h?0:d?1:-1},editable:!1,suppressFillHandle:!0,pinned:null,...i,colId:lL,chartDataType:"excluded"}}generateSelectionCols(){if(!this.isSelectionColumnEnabled())return[];const e=this.createSelectionColDef(),t=e.colId;this.gos.validateColDef(e,t,!0);const n=new wc(e,null,t,!1);return this.createBean(n),[n]}onSelectionOptionsChanged(e,t,n){const s=t&&typeof t!="string"?hd(t):void 0,o=e&&typeof e!="string"?hd(e):void 0,r=s!==o,i=t&&typeof t!="string"?Lv(t):void 0,a=e&&typeof e!="string"?Lv(e):void 0,l=i!==a,c=Vv(e),u=Vv(t);(r||l||c!==u)&&this.beans.colModel.refreshAll(n)}destroy(){var e;Uv(this.beans,(e=this.columns)==null?void 0:e.tree),super.destroy()}refreshVisibility(e,t,n){var l,c;if(!((l=this.columns)!=null&&l.list.length))return;const s=e.length+t.length+n.length;if(s===0)return;const o=this.columns.list[0];if(!o.isVisible())return;const r=()=>{let u;switch(o.pinned){case"left":case!0:u=e;break;case"right":u=n;break;default:u=t}u&&$r(u,o)};(((c=this.beans.rowNumbersSvc)==null?void 0:c.getColumn(cL))?2:1)===s&&r()}};function eye(e,t){var i;if(!t.nodes.every(a=>a.rowPinned&&!ip(a)?(Je(59),!1):a.id===void 0?(Je(60),!1):!0))return;const{nodes:s,source:o,newValue:r}=t;(i=e.selectionSvc)==null||i.setNodesSelected({nodes:s,source:o??"api",newValue:r})}function tye(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.selectAllRowNodes({source:n,selectAll:t})}function nye(e,t,n="apiSelectAll"){var s;(s=e.selectionSvc)==null||s.deselectAllRowNodes({source:n,selectAll:t})}function sye(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"filtered"})}function oye(e,t="apiSelectAllFiltered"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"filtered"})}function rye(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.selectAllRowNodes({source:t,selectAll:"currentPage"})}function iye(e,t="apiSelectAllCurrentPage"){var n;(n=e.selectionSvc)==null||n.deselectAllRowNodes({source:t,selectAll:"currentPage"})}function aye(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedNodes())??[]}function lye(e){var t;return((t=e.selectionSvc)==null?void 0:t.getSelectedRows())??[]}var cye=class extends Sce{constructor(){super(...arguments),this.beanName="selectionSvc",this.selectedNodes=new Map,this.detailSelection=new Map,this.masterSelectsDetail=!1}postConstruct(){super.postConstruct();const{gos:e}=this;this.mode=Bv(e),this.groupSelectsDescendants=Yf(e),this.groupSelectsFiltered=$v(e)==="filteredDescendants",this.masterSelectsDetail=sL(e)==="detail",this.addManagedPropertyListeners(["groupSelectsChildren","groupSelectsFiltered","rowSelection"],()=>{const t=Yf(e),n=Bv(e),s=$v(e)==="filteredDescendants";this.masterSelectsDetail=sL(e)==="detail",(t!==this.groupSelectsDescendants||s!==this.groupSelectsFiltered||n!==this.mode)&&(this.deselectAllRowNodes({source:"api"}),this.groupSelectsDescendants=t,this.groupSelectsFiltered=s,this.mode=n)}),this.addManagedEventListeners({rowSelected:this.onRowSelected.bind(this)})}destroy(){super.destroy(),this.resetNodes()}handleSelectionEvent(e,t,n){if(this.isRowSelectionBlocked(t))return 0;const s=this.inferNodeSelections(t,e.shiftKey,e.metaKey||e.ctrlKey,n);if(s==null)return 0;if(this.selectionCtx.selectAll=!1,"select"in s)return s.reset?this.resetNodes():this.selectRange(s.deselect,!1,n),this.selectRange(s.select,!0,n);{const o=s.checkFilteredNodes?SB(s.node):s.newValue;return this.setNodesSelected({nodes:[s.node],newValue:o,clearSelection:s.clearSelection,keepDescendants:s.keepDescendants,event:e,source:n})}}setNodesSelected({newValue:e,clearSelection:t,suppressFinishActions:n,nodes:s,event:o,source:r,keepDescendants:i=!1}){var c;if(s.length===0)return 0;const{gos:a}=this;if(!mc(a)&&e)return Je(132),0;if(s.length>1&&!this.isMultiSelect())return Je(130),0;let l=0;for(let u=0;u<s.length;u++){const d=s[u],h=Fd(d);if(h.rowPinned&&!ip(h)){Je(59);continue}if(h.id===void 0){Je(60);continue}this.groupSelectsFiltered&&h.group&&!a.get("treeData")||this.selectRowNode(h,e,o,r)&&(this.detailSelection.delete(h.id),l++),this.groupSelectsDescendants&&((c=h.childrenAfterGroup)!=null&&c.length)&&(l+=this.selectChildren(h,e,r))}return n||(s.length===1&&r==="api"&&this.selectionCtx.setRoot(Fd(s[0])),e&&(t||!this.isMultiSelect())&&(l+=this.clearOtherNodes(Fd(s[0]),i,r)),l>0&&(this.updateGroupsFromChildrenSelections(r),this.dispatchSelectionChanged(r))),l}selectRange(e,t,n){let s=0;return e.forEach(o=>{const r=Fd(o);if(r.group&&this.groupSelectsDescendants)return;this.selectRowNode(r,t,void 0,n)&&s++}),s>0&&(this.updateGroupsFromChildrenSelections(n),this.dispatchSelectionChanged(n)),s}selectChildren(e,t,n){const s=this.groupSelectsFiltered?e.childrenAfterAggFilter:e.childrenAfterGroup;return s?this.setNodesSelected({newValue:t,clearSelection:!1,suppressFinishActions:!0,source:n,nodes:s}):0}getSelectedNodes(){return Array.from(this.selectedNodes.values())}getSelectedRows(){const e=[];return this.selectedNodes.forEach(t=>t.data&&e.push(t.data)),e}getSelectionCount(){return this.selectedNodes.size}filterFromSelection(e){const t=new Map;this.selectedNodes.forEach((n,s)=>{e(n)&&t.set(s,n)}),this.selectedNodes=t}updateGroupsFromChildrenSelections(e,t){if(!this.groupSelectsDescendants)return!1;const{gos:n,rowModel:s}=this.beans;if(!os(n))return!1;const o=s.rootNode;if(!o)return!1;t||(t=new lp(!0,o),t.active=!1);let r=!1;return t.forEachChangedNodeDepthFirst(i=>{if(i!==o){const a=this.calculateSelectedFromChildren(i);r=this.selectRowNode(i,a===null?!1:a,void 0,e)||r}}),r}clearOtherNodes(e,t,n){const s=new Map;let o=0;return this.selectedNodes.forEach(r=>{const i=r.id==e.id;if((t?!dye(e,r):!0)&&!i){const l=this.selectedNodes.get(r.id);o+=this.setNodesSelected({nodes:[l],newValue:!1,clearSelection:!1,suppressFinishActions:!0,source:n}),this.groupSelectsDescendants&&r.parent&&s.set(r.parent.id,r.parent)}}),s.forEach(r=>{const i=this.calculateSelectedFromChildren(r);this.selectRowNode(r,i===null?!1:i,void 0,n)}),o}onRowSelected(e){const t=e.node;this.groupSelectsDescendants&&t.group||(t.isSelected()?this.selectedNodes.set(t.id,t):this.selectedNodes.delete(t.id))}syncInRowNode(e,t){this.syncInOldRowNode(e,t),this.syncInNewRowNode(e)}createDaemonNode(e){if(!e.id)return;const t=new cl(this.beans);return t.id=e.id,t.data=e.data,t.__selected=e.__selected,t.level=e.level,t}syncInOldRowNode(e,t){t&&e.id!==t.id&&this.selectedNodes.get(t.id)==e&&this.selectedNodes.set(t.id,t)}syncInNewRowNode(e){this.selectedNodes.has(e.id)?(e.__selected=!0,this.selectedNodes.set(e.id,e)):e.__selected=!1}reset(e){const t=this.getSelectionCount();this.resetNodes(),t&&this.dispatchSelectionChanged(e)}resetNodes(){this.selectedNodes.forEach(e=>{this.selectRowNode(e,!1)}),this.selectedNodes.clear()}getBestCostNodeSelection(){const{gos:e,rowModel:t}=this.beans;if(!os(e))return;const n=t.getTopLevelNodes();if(n===null)return;const s=[];function o(r){for(let i=0,a=r.length;i<a;i++){const l=r[i];l.isSelected()?s.push(l):l.group&&l.childrenAfterGroup&&o(l.childrenAfterGroup)}}return o(n),s}isEmpty(){return this.getSelectionCount()===0}deselectAllRowNodes({source:e,selectAll:t}){const n=os(this.gos);let s=!1;const o=r=>{const i=this.selectRowNode(Fd(r),!1,void 0,e);s||(s=i)};if(t==="currentPage"||t==="filtered"){if(!n){En(102);return}this.getNodesToSelect(t).forEach(o)}else this.selectedNodes.forEach(o),this.reset(e);if(this.selectionCtx.selectAll=!1,n&&this.groupSelectsDescendants){const r=this.updateGroupsFromChildrenSelections(e);s||(s=r)}s&&this.dispatchSelectionChanged(e)}getSelectedCounts(e){let t=0,n=0;return this.getNodesToSelect(e).forEach(s=>{this.groupSelectsDescendants&&s.group||(s.isSelected()?t++:s.selectable&&n++)}),{selectedCount:t,notSelectedCount:n}}getSelectAllState(e){const{selectedCount:t,notSelectedCount:n}=this.getSelectedCounts(e);return bB(t,n)??null}hasNodesToSelect(e){return this.getNodesToSelect(e).filter(t=>t.selectable).length>0}getNodesToSelect(e){if(!this.canSelectAll())return[];const t=[],n=o=>t.push(o);if(e==="currentPage")return this.forEachNodeOnPage(o=>{if(!o.group){n(o);return}if(!o.expanded&&!o.footer){const r=i=>{var a;n(i),(a=i.childrenAfterFilter)==null||a.forEach(r)};r(o);return}this.groupSelectsDescendants||n(o)}),t;const s=this.beans.rowModel;return e==="filtered"?(s.forEachNodeAfterFilter(n),t):(s.forEachNode(n),t)}forEachNodeOnPage(e){const{pageBounds:t,rowModel:n}=this.beans,s=t.getFirstRow(),o=t.getLastRow();for(let r=s;r<=o;r++){const i=n.getRow(r);i&&e(i)}}selectAllRowNodes(e){const{gos:t,selectionCtx:n}=this;if(!mc(t)){Je(132);return}if(Zoe(t)&&!qf(t)){Je(130);return}if(!this.canSelectAll())return;const{source:s,selectAll:o}=e;let r=!1;if(this.getNodesToSelect(o).forEach(i=>{const a=this.selectRowNode(Fd(i),!0,void 0,s);r||(r=a)}),n.selectAll=!0,os(t)&&this.groupSelectsDescendants){const i=this.updateGroupsFromChildrenSelections(s);r||(r=i)}r&&this.dispatchSelectionChanged(s)}getSelectionState(){return this.isEmpty()?null:Array.from(this.selectedNodes.keys())}setSelectionState(e,t,n){if(e||(e=[]),!Array.isArray(e)){En(103);return}const s=new Set(e),o=[];this.beans.rowModel.forEachNode(r=>{s.has(r.id)&&o.push(r)}),n&&this.resetNodes(),this.setNodesSelected({newValue:!0,nodes:o,source:t})}canSelectAll(){return os(this.beans.gos)}updateSelectable(e){var l;const{gos:t,rowModel:n}=this.beans;if(!mc(t))return;const s="selectableChanged",o=e!==void 0,r=os(t)&&this.groupSelectsDescendants,i=[],a=c=>{var d;if(o&&!c.group)return;if(r&&c.group){const h=((d=c.childrenAfterGroup)==null?void 0:d.some(f=>f.selectable))??!1;this.setRowSelectable(c,h,!0);return}!this.updateRowSelectable(c,!0)&&c.isSelected()&&i.push(c)};if(r){if(e===void 0){const c=n.rootNode;e=c?new lp(!1,c):void 0}e==null||e.forEachChangedNodeDepthFirst(a,!o,!o)}else n.forEachNode(a);i.length&&this.setNodesSelected({nodes:i,newValue:!1,source:s}),!o&&r&&((l=this.updateGroupsFromChildrenSelections)==null||l.call(this,s))}updateSelectableAfterGrouping(e){var t;this.updateSelectable(e),this.groupSelectsDescendants&&((t=this.updateGroupsFromChildrenSelections)!=null&&t.call(this,"rowGroupChanged",e))&&this.dispatchSelectionChanged("rowGroupChanged")}refreshMasterNodeState(e,t){var r,i;if(!this.masterSelectsDetail)return;const n=(i=(r=e.detailNode)==null?void 0:r.detailGridInfo)==null?void 0:i.api;if(!n)return;const s=uye(n);if(e.isSelected()!==s&&this.selectRowNode(e,s,t,"masterDetail")&&this.dispatchSelectionChanged("masterDetail"),!s){const a=this.detailSelection.get(e.id)??new Set;for(const l of n.getSelectedNodes())a.add(l.id);this.detailSelection.set(e.id,a)}}setDetailSelectionState(e,t,n){if(this.masterSelectsDetail){if(!qf(t)){Je(269);return}switch(e.isSelected()){case!0:{n.selectAll();break}case!1:{n.deselectAll();break}case void 0:{const s=this.detailSelection.get(e.id);if(s){const o=[];for(const r of s){const i=n.getRowNode(r);i&&o.push(i)}n.setNodesSelected({nodes:o,newValue:!0,source:"masterDetail"})}break}}}}dispatchSelectionChanged(e){this.eventSvc.dispatchEvent({type:"selectionChanged",source:e,selectedNodes:this.getSelectedNodes(),serverSideState:null})}};function Fd(e){return ip(e)?e.pinnedSibling:e.footer?e.sibling:e}function uye(e){let t=0,n=0;return e.forEachNode(s=>{s.isSelected()?t++:s.selectable&&n++}),bB(t,n)}function bB(e,t){if(e===0&&t===0)return!1;if(!(e>0&&t>0))return e>0}function dye(e,t){let n=t.parent;for(;n;){if(n===e)return!0;n=n.parent}return!1}function SB(e){var s;const t=e.isSelected()===!1,n=((s=e.childrenAfterFilter)==null?void 0:s.some(SB))??!1;return t||n}var hye={moduleName:"SharedRowSelection",version:ct,beans:[Qve],apiFunctions:{setNodesSelected:eye,selectAll:tye,deselectAll:nye,selectAllFiltered:sye,deselectAllFiltered:oye,selectAllOnCurrentPage:rye,deselectAllOnCurrentPage:iye,getSelectedNodes:aye,getSelectedRows:lye}},fye={moduleName:"RowSelection",version:ct,rowModels:["clientSide","infinite","viewport"],beans:[cye],dependsOn:[hye]};function pye(e){var t;(t=e.expansionSvc)==null||t.expandAll(!0)}function gye(e){var t;(t=e.expansionSvc)==null||t.expandAll(!1)}function EB(e){var t;(t=e.rowModel)==null||t.onRowHeightChanged()}function _B(e){var t,n;if((t=e.rowAutoHeight)!=null&&t.active){Je(3);return}(n=e.rowModel)==null||n.resetRowHeights()}function mye(e,t,n){var o,r;const s=vge(e);if(s){if(((o=e.rowGroupColsSvc)==null?void 0:o.columns.length)===0){if(t<0){En(238);return}s.setRowCount(t,n);return}En(28);return}(r=Sy(e))==null||r.setRowCount(t,n)}function vye(e){var t;return cd(e.gos)?e.rowModel.getBlockStates():((t=e.rowNodeBlockLoader)==null?void 0:t.getBlockState())??{}}function yye(e){return e.rowModel.isLastRowIndexKnown()}var wye={moduleName:"CsrmSsrmSharedApi",version:ct,apiFunctions:{expandAll:pye,collapseAll:gye}},Cye={moduleName:"RowModelSharedApi",version:ct,apiFunctions:{onRowHeightChanged:EB,resetRowHeights:_B}},bye={moduleName:"SsrmInfiniteSharedApi",version:ct,apiFunctions:{setRowCount:mye,getCacheBlockState:vye,isLastRowIndexKnown:yye}},Sye=class extends We{constructor(){super(...arguments),this.beanName="alignedGridsSvc",this.consuming=!1}getAlignedGridApis(){let e=this.gos.get("alignedGrids")??[];const t=typeof e=="function";return typeof e=="function"&&(e=e()),e.map(s=>{var r;if(!s){En(18),t||En(20);return}if(this.isGridApi(s))return s;const o=s;return"current"in o?(r=o.current)==null?void 0:r.api:(o.api||En(19),o.api)}).filter(s=>!!s&&!s.isDestroyed())}isGridApi(e){return!!e&&!!e.dispatchEvent}postConstruct(){const e=this.fireColumnEvent.bind(this);this.addManagedEventListeners({columnMoved:e,columnVisible:e,columnPinned:e,columnGroupOpened:e,columnResized:e,bodyScroll:this.fireScrollEvent.bind(this),alignedGridColumn:({event:t})=>this.onColumnEvent(t),alignedGridScroll:({event:t})=>this.onScrollEvent(t)})}fireEvent(e){if(!this.consuming)for(const t of this.getAlignedGridApis())t.isDestroyed()||t.dispatchEvent(e)}onEvent(e){this.consuming=!0,e(),this.consuming=!1}fireColumnEvent(e){this.fireEvent({type:"alignedGridColumn",event:e})}fireScrollEvent(e){e.direction==="horizontal"&&this.fireEvent({type:"alignedGridScroll",event:e})}onScrollEvent(e){this.onEvent(()=>{this.beans.ctrlsSvc.getScrollFeature().setHorizontalScrollPosition(e.left,!0)})}extractDataFromEvent(e,t){const n=[];return e.columns?e.columns.forEach(s=>{n.push(t(s))}):e.column&&n.push(t(e.column)),n}getMasterColumns(e){return this.extractDataFromEvent(e,t=>t)}getColumnIds(e){return this.extractDataFromEvent(e,t=>t.getColId())}onColumnEvent(e){this.onEvent(()=>{switch(e.type){case"columnMoved":case"columnVisible":case"columnPinned":case"columnResized":{this.processColumnEvent(e);break}case"columnGroupOpened":{this.processGroupOpenedEvent(e);break}case"columnPivotChanged":Je(21);break}})}processGroupOpenedEvent(e){const{colGroupSvc:t}=this.beans;if(t)for(const n of e.columnGroups){let s=null;n&&(s=t.getProvidedColGroup(n.getGroupId())),!(n&&!s)&&t.setColumnGroupOpened(s,n.isExpanded(),"alignedGridChanged")}}processColumnEvent(e){const t=e.column;let n=null;const s=this.beans,{colResize:o,ctrlsSvc:r,colModel:i}=s;if(t&&(n=i.getColDefCol(t.getColId())),t&&!n)return;const a=this.getMasterColumns(e);switch(e.type){case"columnMoved":{const d=e.api.getColumnState().map(h=>({colId:h.colId}));Hr(s,{state:d,applyOrder:!0},"alignedGridChanged")}break;case"columnVisible":{const d=e.api.getColumnState().map(h=>({colId:h.colId,hide:h.hide}));Hr(s,{state:d},"alignedGridChanged")}break;case"columnPinned":{const d=e.api.getColumnState().map(h=>({colId:h.colId,pinned:h.pinned}));Hr(s,{state:d},"alignedGridChanged")}break;case"columnResized":{const u=e,d={};for(const h of a)d[h.getId()]={key:h.getColId(),newWidth:h.getActualWidth()};for(const h of u.flexColumns??[])d[h.getId()]&&delete d[h.getId()];o==null||o.setColumnWidths(Object.values(d),!1,u.finished,"alignedGridChanged");break}}const c=r.getGridBodyCtrl().isVerticalScrollShowing();for(const u of this.getAlignedGridApis())u.setGridOption("alwaysShowVerticalScroll",c)}},Eye={moduleName:"AlignedGrids",version:ct,beans:[Sye],dependsOn:[l2]},_ye=class extends We{constructor(e){super(),this.rootNode=e,this.nextId=0,this.allNodesMap={},RB(e)}getRowNode(e){return this.allNodesMap[e]}setNewRowData(e){const{selectionSvc:t,pinnedRowModel:n,groupStage:s}=this.beans;t==null||t.reset("rowDataChanged"),n!=null&&n.isManual()&&n.reset(),this.dispatchRowDataUpdateStarted(e),this.allNodesMap=Object.create(null),this.nextId=0;const o=RB(this.rootNode),r=new Array(e.length);o._leafs=r;let i=0;const a=s==null?void 0:s.getNestedDataGetter(),l=a?new Set:null,c=(u,d)=>{const h=u.level+1;for(let f=0,p=d.length;f<p;++f){const g=d[f];if(!g)continue;const v=this.createRowNode(g,h);if(v.sourceRowIndex=i,r[i++]=v,l&&!l.has(g)){l.add(g),v.treeParent=u;const C=a(g);C&&c(v,C)}}};c(o,e),r.length=i}setImmutableRowData(e,t){var C;const{rootNode:n,gos:s}=this;this.dispatchRowDataUpdateStarted(t);const o=dd(s),r=e.changedRowNodes,{adds:i,updates:a}=r,l=new Set,c=[],u=(C=this.beans.groupStage)==null?void 0:C.getNestedDataGetter();let d=s.get("suppressMaintainUnsortedOrder")?void 0:!1,h=-1,f=!1;const p=(S,b)=>{if(!d&&d!==void 0){const w=S.sourceRowIndex;d=w<=h,h=w}S.data!==b&&(S.updateData(b),i.has(S)||a.add(S),!S.selectable&&S.isSelected()&&c.push(S))},g=(S,b,w)=>{for(let D=0,R=b.length;D<R;++D){const T=b[D];if(!T)continue;let I=this.getRowNode(o({data:T,level:w}));if(I?(p(I,T),f||(f=!!u&&I.treeParent!==S)):(I=this.createRowNode(T,w),i.add(I)),!u||l.has(I)){l.add(I);continue}l.add(I),I.treeParent=S;const x=u(T);x&&g(I,x,w+1)}};g(n,t,0);const v=this.deleteUnusedNodes(l,r,c)||d||i.size>0;if(v){const S=n._leafs??(n._leafs=[]);d===void 0?xye(S,l,r):Iye(S,l)&&(r.reordered=!0)}(v||f||a.size)&&(e.rowDataUpdated=!0,this.deselect(c))}deleteUnusedNodes(e,{removals:t},n){const s=this.rootNode._leafs;for(let o=0,r=s.length;o<r;o++){const i=s[o];e.has(i)||(t.add(i),i.isSelected()&&n.push(i),this.deleteNode(i))}return t.size>0}updateRowData(e,t){var a;if(this.dispatchRowDataUpdateStarted(e.add),(a=this.beans.groupStage)!=null&&a.getNestedDataGetter())return Je(268),{remove:[],update:[],add:[]};const n=[],s=dd(this.gos),o=this.executeRemove(s,e,t,n),r=this.executeUpdate(s,e,t,n),i=this.executeAdd(e,t);return this.deselect(n),{remove:o,update:r,add:i}}executeRemove(e,{remove:t},{adds:n,updates:s,removals:o},r){const i=this.rootNode._leafs,a=i==null?void 0:i.length,l=t==null?void 0:t.length;if(!l||!a)return[];let c=0,u=a,d=0,h;const f=new Array(l);for(let p=0;p<l;++p){const g=this.lookupNode(e,t[p]);if(!g)continue;const v=g.sourceRowIndex;v<u&&(u=v),v>d&&(d=v),g.isSelected()&&r.push(g),this.deleteNode(g),n.delete(g)?(h??(h=new Set),h.add(g)):(s.delete(g),o.add(g)),f[c++]=g}return f.length=c,c&&Tye(i,u,d,o,h),f}executeUpdate(e,{update:t},{adds:n,updates:s},o){const r=t==null?void 0:t.length;if(!r)return[];const i=new Array(r);let a=0;for(let l=0;l<r;l++){const c=t[l],u=this.lookupNode(e,c);u&&(u.updateData(c),!u.selectable&&u.isSelected()&&o.push(u),i[a++]=u,n.has(u)||s.add(u))}return i.length=a,i}executeAdd(e,t){var n;const s=(n=this.rootNode)._leafs??(n._leafs=[]),o=s.length,r=e.add,i=r==null?void 0:r.length;if(!i)return[];const a=o+i;let l=this.sanitizeAddIndex(s,e.addIndex);if(l<o){for(let d=o-1,h=a-1;d>=l;--d){const f=s[d];f.sourceRowIndex=h,s[h--]=f}t.reordered=!0}s.length=a;const c=new Array(i),u=t.adds;for(let d=0;d<i;d++){const h=this.createRowNode(r[d],0);u.add(h),h.sourceRowIndex=l,s[l]=h,c[d]=h,l++}return c}dispatchRowDataUpdateStarted(e){this.eventSvc.dispatchEvent({type:"rowDataUpdateStarted",firstRowData:e!=null&&e.length?e[0]:null})}deselect(e){var s;const t="rowDataChanged",n=this.beans.selectionSvc;e.length&&(n==null||n.setNodesSelected({newValue:!1,nodes:e,suppressFinishActions:!0,source:t})),(s=n==null?void 0:n.updateGroupsFromChildrenSelections)==null||s.call(n,t),e.length&&this.eventSvc.dispatchEvent({type:"selectionChanged",source:t,selectedNodes:(n==null?void 0:n.getSelectedNodes())??null,serverSideState:null})}createRowNode(e,t){const n=new cl(this.beans);n.parent=this.rootNode,n.level=t,n.group=!1,n.expanded=!1,n.setDataAndId(e,String(this.nextId++));const s=n.id,o=this.allNodesMap;return o[s]&&Je(2,{nodeId:s}),o[s]=n,n}deleteNode(e){var o;e.clearRowTopAndRowIndex();const t=e.id,n=this.allNodesMap;n[t]===e&&delete n[t];const s=e.pinnedSibling;s&&((o=this.beans.pinnedRowModel)==null||o.pinRow(s,null))}lookupNode(e,t){if(!e)return Dye(this.rootNode._leafs,t);const n=e({data:t,level:0}),s=this.allNodesMap[n];return s||(En(4,{id:n}),null)}sanitizeAddIndex(e,t){const n=e.length;if(typeof t!="number"||t<0||t>=n||Number.isNaN(t))return n;t=Math.ceil(t);const s=this.gos;return t>0&&s.get("treeData")&&s.get("getDataPath")&&(t=Rye(e,t)),t}},Rye=(e,t)=>{for(let n=0,s=e.length;n<s;n++){const o=e[n];if((o==null?void 0:o.rowIndex)==t-1)return n+1}return t},RB=e=>{var i;e.group=!0,e.level=-1,e.id="ROOT_NODE_ID",((i=e._leafs)==null?void 0:i.length)!==0&&(e._leafs=[]);const t=[],n=[],s=[],o=[];e.childrenAfterGroup=t,e.childrenAfterSort=n,e.childrenAfterAggFilter=s,e.childrenAfterFilter=o;const r=e.sibling;return r&&(r.childrenAfterGroup=t,r.childrenAfterSort=n,r.childrenAfterAggFilter=s,r.childrenAfterFilter=o,r.childrenMapped=e.childrenMapped),e.updateHasChildren(),e},Dye=(e,t)=>{if(e)for(let n=0,s=e.length;n<s;n++){const o=e[n];if(o.data===t)return o}return En(5,{data:t}),null},Tye=(e,t,n,s,o)=>{t=Math.max(0,t);for(let r=t,i=e.length;r<i;++r){const a=e[r];r<=n&&(s.has(a)||o!=null&&o.has(a))||(a.sourceRowIndex=t,e[t++]=a)}e.length=t},Iye=(e,t)=>{const n=t.size;e.length=n;let s=0,o=!1,r=!1;for(const i of t){const a=i.sourceRowIndex;a===s?r||(r=o):(a>=0?r=!0:o=!0,i.sourceRowIndex=s,e[s]=i),++s}return r},xye=(e,t,{removals:n,adds:s})=>{const o=e.length;e.length=t.size;let r=0;for(let i=0;i<o;++i){const a=e[i];n.has(a)||(r!==i&&(a.sourceRowIndex=r,e[r]=a),++r)}for(const i of s)i.sourceRowIndex<0&&(i.sourceRowIndex=r,e[r++]=i);e.length=r},DB=e=>{const t=e.childrenAfterSort,n=e.sibling;if(n&&(n.childrenAfterSort=t),!!t)for(let s=0,o=t.length-1;s<=o;s++){const r=t[s],i=s===0,a=s===o;r.firstChild!==i&&(r.firstChild=i,r.dispatchRowEvent("firstChildChanged")),r.lastChild!==a&&(r.lastChild=a,r.dispatchRowEvent("lastChildChanged")),r.childIndex!==s&&(r.childIndex=s,r.dispatchRowEvent("childIndexChanged"))}},Fye=class extends We{constructor(){super(...arguments),this.beanName="sortStage",this.step="sort",this.refreshProps=["postSortRows","groupDisplayType","accentedSort"]}execute(e){const t=this.beans.sortSvc.getSortOptions(),n=t.length>0&&!!e.changedRowNodes&&this.gos.get("deltaSort");this.sort(t,n,e.changedRowNodes,e.changedPath)}sort(e,t,n,s){const{gos:o,colModel:r,rowGroupColsSvc:i,rowNodeSorter:a,rowRenderer:l,showRowGroupCols:c}=this.beans,u=o.get("groupMaintainOrder"),d=r.getCols().some(S=>S.isRowGroupActive()),h=i==null?void 0:i.columns,f=r.isPivotMode(),p=o.getCallback("postSortRows");let g=!1,v;const C=S=>{var R,T;const b=f&&S.leafGroup;let w=u&&d&&!S.leafGroup;w&&(v??(v=this.shouldSortContainsGroupCols(e)),w&&(w=!v));let D=null;if(w){let I=!1;if(h){const x=S.level+1;x<h.length&&(I=h[x].getSort()===null)}I||(D=kye(S))}else!e.length||b||(t&&n?D=Pye(a,S,n,s,e):D=a.doFullSort(S.childrenAfterAggFilter,e));if(D||(D=((R=S.childrenAfterAggFilter)==null?void 0:R.slice(0))??[]),g||(g=((T=S.childrenAfterSort)==null?void 0:T[0])!==D[0]),S.childrenAfterSort=D,DB(S),p){const I={nodes:S.childrenAfterSort};p(I)}};if(s==null||s.forEachChangedNodeDepthFirst(C),g&&o.get("groupHideOpenParents")){const S=c==null?void 0:c.getShowRowGroupCols();S!=null&&S.length&&l.refreshCells({columns:S,force:!0})}}shouldSortContainsGroupCols(e){const t=e.length;if(!t)return!1;if(bi(this.gos)){for(let n=0;n<t;++n){const s=e[n].column;if(s.isPrimary()&&s.isRowGroupActive())return!0}return!1}for(let n=0;n<t;++n)if(e[n].column.getColDef().showRowGroup)return!0;return!1}},Pye=(e,t,n,s,o)=>{const r=t.childrenAfterAggFilter,i=t.childrenAfterSort;if(!i)return e.doFullSort(r,o);const a=new Set,l=[],{updates:c,adds:u}=n;for(let h=0,f=r.length;h<f;++h){const p=r[h];c.has(p)||u.has(p)||s&&!s.canSkip(p)?l.push({currentPos:l.length,rowNode:p}):a.add(p)}const d=i.filter(h=>a.has(h)).map((h,f)=>({currentPos:f,rowNode:h}));return l.sort((h,f)=>e.compareRowNodes(o,h,f)),Aye(e,o,l,d)},Aye=(e,t,n,s)=>{let o=0,r=0;const i=n.length,a=s.length,l=new Array(i+a);let c=0;for(;o<i&&r<a;){const u=n[o],d=s[r];e.compareRowNodes(t,u,d)<0?(l[c++]=u.rowNode,++o):(l[c++]=d.rowNode,++r)}for(;o<i;)l[c++]=n[o++].rowNode;for(;r<a;)l[c++]=s[r++].rowNode;return l},kye=e=>{const t=e.childrenAfterSort,n=e.childrenAfterAggFilter,s=t==null?void 0:t.length,o=n==null?void 0:n.length;if(!s||!o)return null;const r=new Array(o),i=new Set;for(let l=0;l<o;++l)i.add(n[l]);let a=0;for(let l=0;l<s;++l){const c=t[l];i.delete(c)&&(r[a++]=c)}if(i.size===0&&a===s)return t;for(const l of i)r[a++]=l;return r.length=a,r},Oye=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null,this.rowCountReady=!1,this.nodeManager=void 0,this.rowsToDisplay=[],this.rowDataUpdatedPending=!1,this.asyncTransactions=null,this.asyncTransactionsTimer=0,this.started=!1,this.refreshingModel=!1,this.rowNodesCountReady=!1,this.stages=[],this.stagesRefreshProps=new Map,this.onRowHeightChanged_debounced=Os(this,this.onRowHeightChanged.bind(this),100)}postConstruct(){const e=this.beans,t=new cl(e);this.rootNode=t,this.nodeManager=this.createBean(new _ye(t));const n=this.refreshModel.bind(this,{step:"group"}),s=this.refreshModel.bind(this,{step:"group",afterColumnsChanged:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame")});this.addManagedEventListeners({newColumnsLoaded:s,columnRowGroupChanged:n,columnValueChanged:this.onValueChanged.bind(this),columnPivotChanged:this.refreshModel.bind(this,{step:"pivot"}),filterChanged:this.onFilterChanged.bind(this),sortChanged:this.onSortChanged.bind(this),columnPivotModeChanged:n,gridStylesChanged:this.onGridStylesChanges.bind(this),gridReady:this.onGridReady.bind(this),rowExpansionStateChanged:this.onRowGroupOpened.bind(this)}),this.addPropertyListeners()}addPropertyListeners(){const{beans:e,stagesRefreshProps:t}=this,n=[e.groupStage,e.filterStage,e.pivotStage,e.aggStage,e.sortStage,e.filterAggStage,e.flattenStage].filter(s=>!!s);this.stages=n;for(let s=n.length-1;s>=0;--s)for(const o of n[s].refreshProps)t.set(o,s);this.addManagedPropertyListeners([...t.keys()],s=>{var r;const o=(r=s.changeSet)==null?void 0:r.properties;o&&this.onPropChange(o)}),this.addManagedPropertyListener("rowData",()=>this.onPropChange(["rowData"])),this.addManagedPropertyListener("rowHeight",()=>this.resetRowHeights())}start(){this.started=!0,this.rowNodesCountReady?this.refreshModel({step:"group",rowDataUpdated:!0,newData:!0}):this.setInitialData()}setInitialData(){this.gos.get("rowData")&&this.onPropChange(["rowData"])}ensureRowHeightsValid(e,t,n,s){let o,r=!1;do{o=!1;const i=this.getRowIndexAtPixel(e),a=this.getRowIndexAtPixel(t),l=Math.max(i,n),c=Math.min(a,s);for(let u=l;u<=c;u++){const d=this.getRow(u);if(d.rowHeightEstimated){const h=ol(this.beans,d);d.setRowHeight(h.height),o=!0,r=!0}}o&&this.setRowTopAndRowIndex()}while(o);return r}onPropChange(e){const{nodeManager:t,gos:n,beans:s}=this,o=s.groupStage;if(!t)return;const r=new Set(e),i=o==null?void 0:o.onPropChange(r);let a;r.has("rowData")?a=n.get("rowData"):i&&(a=o==null?void 0:o.extractData()),a&&!Array.isArray(a)&&(a=null,Je(1));const l={step:"nothing",changedProps:r};a&&(!i&&!this.isEmpty()&&a.length>0&&n.exists("getRowId")&&!n.get("resetRowDataOnUpdate")?(l.keepRenderedRows=!0,l.animate=!n.get("suppressAnimationFrame"),l.changedRowNodes=new py,t.setImmutableRowData(l,a)):(l.rowDataUpdated=!0,l.newData=!0,t.setNewRowData(a),this.rowNodesCountReady=!0));const c=l.rowDataUpdated?"group":this.getRefreshedStage(e);c&&(l.step=c,this.refreshModel(l))}getRefreshedStage(e){const{stages:t,stagesRefreshProps:n}=this,s=t.length;let o=s;for(let r=0,i=e.length;r<i&&o;++r)o=Math.min(o,n.get(e[r])??o);return o<s?t[o].step:null}setRowTopAndRowIndex(e){const{beans:t,rowsToDisplay:n}=this,s=t.environment.getDefaultRowHeight();let o=0;const r=Ms(this.gos,"normal");for(let i=0,a=n.length;i<a;++i){const l=n[i],c=l.id;if(c!=null&&(e==null||e.add(c)),l.rowHeight==null){const u=ol(t,l,r,s);l.setRowHeight(u.height,u.estimated)}l.setRowTop(o),l.setRowIndex(i),o+=l.rowHeight}}clearRowTopAndRowIndex(e,t){const n=e.active,s=i=>{(i==null?void 0:i.id)!=null&&!t.has(i.id)&&i.clearRowTopAndRowIndex()},o=i=>{s(i),s(i.detailNode),s(i.sibling);const a=i.childrenAfterGroup;if(!i.hasChildren()||!a)return;const l=i.level==-1;if(!(n&&!l&&!i.expanded))for(let u=0,d=a.length;u<d;++u)o(a[u])},r=this.rootNode;r&&o(r)}isLastRowIndexKnown(){return!0}getRowCount(){return this.rowsToDisplay.length}getTopLevelRowCount(){var o,r;const{rootNode:e,rowsToDisplay:t}=this;if(!e||!t.length)return 0;if(t[0]===e)return 1;const s=(o=e.sibling)!=null&&o.displayed?1:0;return(((r=e.childrenAfterSort)==null?void 0:r.length)??0)+s}getTopLevelRowDisplayedIndex(e){const{beans:t,rootNode:n,rowsToDisplay:s}=this;if(!n||!s.length||s[0]===n)return e;const r=n.childrenAfterSort,i=l=>{let c=r[l];if(this.gos.get("groupHideOpenParents"))for(;c.expanded&&c.childrenAfterSort&&c.childrenAfterSort.length>0;)c=c.childrenAfterSort[0];return c.rowIndex},a=t.footerSvc;return a?a==null?void 0:a.getTopDisplayIndex(s,e,r,i):i(e)}getTopLevelIndexFromDisplayedIndex(e){var a;const{rootNode:t,rowsToDisplay:n}=this;if(!t||!n.length||n[0]===t)return e;let o=this.getRow(e);o.footer&&(o=o.sibling);let r=o.parent;for(;r&&r!==t;)o=r,r=o.parent;const i=((a=t.childrenAfterSort)==null?void 0:a.indexOf(o))??-1;return i>=0?i:e}getRowBounds(e){const t=this.rowsToDisplay[e];return t?{rowTop:t.rowTop,rowHeight:t.rowHeight}:null}onRowGroupOpened(){this.refreshModel({step:"map",keepRenderedRows:!0,animate:ud(this.gos)})}onFilterChanged({afterDataChange:e,columns:t}){if(!e){const s=t.length===0||t.some(o=>o.isPrimary())?"filter":"filter_aggregates";this.refreshModel({step:s,keepRenderedRows:!0,animate:ud(this.gos)})}}onSortChanged(){this.refreshModel({step:"sort",keepRenderedRows:!0,animate:ud(this.gos)})}getType(){return"clientSide"}onValueChanged(){this.refreshModel({step:this.beans.colModel.isPivotActive()?"pivot":"aggregate"})}createChangePath(e){const t=new lp(!1,this.rootNode);return t.active=e,t}isSuppressModelUpdateAfterUpdateTransaction(e){if(!this.gos.get("suppressModelUpdateAfterUpdateTransaction"))return!1;const{changedRowNodes:t,newData:n,rowDataUpdated:s}=e;return!(!t||n||!s||t.removals.size||t.adds.size)}refreshModel(e){var c,u;const{nodeManager:t,beans:n,eventSvc:s,started:o,refreshingModel:r}=this;if(!t)return;const i=!!e.rowDataUpdated,a=e.changedPath??(e.changedPath=this.createChangePath(!e.newData&&i));if(o&&i&&s.dispatchEvent({type:"rowDataUpdated"}),!o||r||n.colModel.changeEventsDispatching||this.isSuppressModelUpdateAfterUpdateTransaction(e)){this.rowDataUpdatedPending||(this.rowDataUpdatedPending=i);return}switch(this.rowDataUpdatedPending&&(this.rowDataUpdatedPending=!1,e.step="group"),this.refreshingModel=!0,(c=n.masterDetailSvc)==null||c.refreshModel(e),i&&e.step!=="group"&&((u=n.colFilter)==null||u.refreshModel()),e.step){case"group":this.doGrouping(e);case"filter":this.doFilter(a);case"pivot":this.doPivot(a);case"aggregate":this.doAggregate(a);case"filter_aggregates":this.doFilterAggregates(a);case"sort":this.doSort(e.changedRowNodes,a);case"map":this.doRowsToDisplay()}const l=new Set;this.setRowTopAndRowIndex(l),this.clearRowTopAndRowIndex(a,l),this.refreshingModel=!1,s.dispatchEvent({type:"modelUpdated",animate:e.animate,keepRenderedRows:e.keepRenderedRows,newData:e.newData,newPage:!1,keepUndoRedoStack:e.keepUndoRedoStack})}isEmpty(){var e,t,n;return!((t=(e=this.rootNode)==null?void 0:e._leafs)!=null&&t.length)||!((n=this.beans.colModel)!=null&&n.ready)}isRowsToRender(){return this.rowsToDisplay.length>0}getNodesInRangeForSelection(e,t){let n=!1,s=!1;const o=[],r=Yf(this.gos);return this.forEachNodeAfterFilterAndSort(i=>{if(s)return;if(n&&(i===t||i===e)&&(s=!0,r&&i.group)){TB(o,i);return}if(!n){if(i!==t&&i!==e)return;n=!0,t===e&&(s=!0)}(!i.group||!r)&&o.push(i)}),o}getTopLevelNodes(){var e;return((e=this.rootNode)==null?void 0:e.childrenAfterGroup)??null}getRow(e){return this.rowsToDisplay[e]}isRowPresent(e){return this.rowsToDisplay.indexOf(e)>=0}getRowIndexAtPixel(e){const t=this.rowsToDisplay,n=t.length;if(this.isEmpty()||n===0)return-1;let s=0,o=n-1;if(e<=0)return 0;if(t[o].rowTop<=e)return o;let i=-1,a=-1;for(;;){const l=Math.floor((s+o)/2),c=t[l];if(this.isRowInPixel(c,e)||(c.rowTop<e?s=l+1:c.rowTop>e&&(o=l-1),i===s&&a===o))return l;i=s,a=o}}isRowInPixel(e,t){const n=e.rowTop,s=n+e.rowHeight;return n<=t&&s>t}forEachLeafNode(e){var n;const t=(n=this.rootNode)==null?void 0:n._leafs;if(t)for(let s=0,o=t.length;s<o;++s)e(t[s],s)}forEachNode(e,t=!1){this.depthFirstSearchRowNodes(e,t)}forEachDisplayedNode(e){const t=this.rowsToDisplay;for(let n=0,s=t.length;n<s;++n)e(t[n],n)}forEachNodeAfterFilter(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterAggFilter)}forEachNodeAfterFilterAndSort(e,t=!1){this.depthFirstSearchRowNodes(e,t,n=>n.childrenAfterSort)}forEachPivotNode(e,t,n){const{colModel:s,rowGroupColsSvc:o}=this.beans;if(!s.isPivotMode())return;if(!(o!=null&&o.columns.length)){e(this.rootNode,0);return}const r=n?"childrenAfterSort":"childrenAfterGroup";this.depthFirstSearchRowNodes(e,t,i=>i.leafGroup?null:i[r])}depthFirstSearchRowNodes(e,t=!1,n=r=>r.childrenAfterGroup,s=this.rootNode,o=0){let r=o;if(!s)return r;const i=s===this.rootNode;if(i||e(s,r++),s.hasChildren()&&!s.footer){const a=n(s);if(a){const l=this.beans.footerSvc;r=(l==null?void 0:l.addTotalRows(r,s,e,t,i,"top"))??r;for(const c of a)r=this.depthFirstSearchRowNodes(e,t,n,c,r);return(l==null?void 0:l.addTotalRows(r,s,e,t,i,"bottom"))??r}}return r}doAggregate(e){var n;const t=this.rootNode;t&&((n=this.beans.aggStage)==null||n.execute({rowNode:t,changedPath:e}))}doFilterAggregates(e){const t=this.rootNode,n=this.beans.filterAggStage;if(n){n.execute({rowNode:t,changedPath:e});return}t.childrenAfterAggFilter=t.childrenAfterFilter}doSort(e,t){const n=this.beans.sortStage;if(n){n.execute({rowNode:this.rootNode,changedRowNodes:e,changedPath:t});return}t.forEachChangedNodeDepthFirst(s=>{s.childrenAfterSort=s.childrenAfterAggFilter.slice(0),DB(s)})}doGrouping(e){var o;const t=this.rootNode,n=this.beans.groupStage,s=n==null?void 0:n.execute({rowNode:t,changedRowNodes:e.changedRowNodes,changedPath:e.changedPath,afterColumnsChanged:!!e.afterColumnsChanged});if(s===void 0){const r=t._leafs;t.childrenAfterGroup=r,t.updateHasChildren();const i=t.sibling;i&&(i.childrenAfterGroup=r)}(s||e.rowDataUpdated)&&((o=this.beans.colFilter)==null||o.refreshModel()),!this.rowCountReady&&this.rowNodesCountReady&&(this.rowCountReady=!0,this.eventSvc.dispatchEventOnce({type:"rowCountReady"}))}doFilter(e){const t=this.beans.filterStage;if(t){t.execute({rowNode:this.rootNode,changedPath:e});return}e.forEachChangedNodeDepthFirst(n=>{n.childrenAfterFilter=n.childrenAfterGroup,j2(n)},!0)}doPivot(e){var t;(t=this.beans.pivotStage)==null||t.execute({rowNode:this.rootNode,changedPath:e})}getRowNode(e){var s,o;const t=(s=this.nodeManager)==null?void 0:s.getRowNode(e);return typeof t=="object"?t:typeof e=="string"&&e.indexOf(d0)===0?(o=this.beans.groupStage)==null?void 0:o.getNode(e):void 0}batchUpdateRowData(e,t){if(!this.asyncTransactionsTimer){this.asyncTransactions=[];const n=this.gos.get("asyncTransactionWaitMillis");this.asyncTransactionsTimer=setTimeout(()=>this.executeBatchUpdateRowData(),n)}this.asyncTransactions.push({rowDataTransaction:e,callback:t})}flushAsyncTransactions(){const e=this.asyncTransactionsTimer;e&&(clearTimeout(e),this.executeBatchUpdateRowData())}executeBatchUpdateRowData(){var a;const{nodeManager:e,beans:t,eventSvc:n,asyncTransactions:s}=this;if(!e)return;(a=t.valueCache)==null||a.onDataChanged();const o=[],r=[],i=new py;for(const{rowDataTransaction:l,callback:c}of s??[]){this.rowNodesCountReady=!0;const u=e.updateRowData(l,i);o.push(u),c&&r.push(c.bind(null,u))}this.commitTransactions(i),r.length>0&&setTimeout(()=>{for(let l=0,c=r.length;l<c;l++)r[l]()},0),o.length>0&&n.dispatchEvent({type:"asyncTransactionsFlushed",results:o}),this.asyncTransactionsTimer=0,this.asyncTransactions=null}updateRowData(e){var o;const t=this.nodeManager;if(!t)return null;(o=this.beans.valueCache)==null||o.onDataChanged(),this.rowNodesCountReady=!0;const n=new py,s=t.updateRowData(e,n);return this.commitTransactions(n),s}commitTransactions(e){this.refreshModel({step:"group",rowDataUpdated:!0,keepRenderedRows:!0,animate:!this.gos.get("suppressAnimationFrame"),changedRowNodes:e,changedPath:this.createChangePath(!0)})}doRowsToDisplay(){const{beans:e,rootNode:t}=this,n=e.flattenStage;if(n){this.rowsToDisplay=n.execute({rowNode:t});return}const s=this.rootNode.childrenAfterSort??[];for(const o of s)o.setUiLevel(0);this.rowsToDisplay=s}onRowHeightChanged(){this.refreshModel({step:"map",keepRenderedRows:!0,keepUndoRedoStack:!0})}resetRowHeights(){const e=this.rootNode;if(!e)return;const t=this.resetRowHeightsForAllRowNodes();e.setRowHeight(e.rowHeight,!0);const n=e.sibling;n==null||n.setRowHeight(n.rowHeight,!0),t&&this.onRowHeightChanged()}resetRowHeightsForAllRowNodes(){let e=!1;return this.forEachNode(t=>{t.setRowHeight(t.rowHeight,!0);const n=t.detailNode;n==null||n.setRowHeight(n.rowHeight,!0);const s=t.sibling;s==null||s.setRowHeight(s.rowHeight,!0),e=!0}),e}onGridStylesChanges(e){var t;e.rowHeightChanged&&!((t=this.beans.rowAutoHeight)!=null&&t.active)&&this.resetRowHeights()}onGridReady(){this.started||this.setInitialData()}destroy(){super.destroy(),this.nodeManager=this.destroyBean(this.nodeManager),this.started=!1,this.rootNode=null,this.rowsToDisplay=[],this.asyncTransactions=null,clearTimeout(this.asyncTransactionsTimer)}onRowHeightChangedDebounced(){this.onRowHeightChanged_debounced()}},TB=(e,t)=>{const n=t.childrenAfterGroup;if(n)for(let s=0,o=n.length;s<o;++s){const r=n[s];r.data&&e.push(r),r.group&&TB(e,r)}};function Mye(e){var t;(t=e.expansionSvc)==null||t.onGroupExpandedOrCollapsed()}function Nye(e,t){const n=pl(e);n&&((!t||t==="everything")&&(t="group"),n.refreshModel({step:t,keepRenderedRows:!0,animate:!e.gos.get("suppressAnimationFrame")}))}function Lye(e){var t;return((t=pl(e))==null?void 0:t.isEmpty())??!0}function Vye(e,t){var n;(n=pl(e))==null||n.forEachLeafNode(t)}function Bye(e,t){var n;(n=pl(e))==null||n.forEachNodeAfterFilter(t)}function $ye(e,t){var n;(n=pl(e))==null||n.forEachNodeAfterFilterAndSort(t)}function Hye(e,t){return e.frameworkOverrides.wrapIncoming(()=>{var n;return(n=pl(e))==null?void 0:n.updateRowData(t)})}function Gye(e,t,n){e.frameworkOverrides.wrapIncoming(()=>{var s;return(s=pl(e))==null?void 0:s.batchUpdateRowData(t,n)})}function Uye(e){e.frameworkOverrides.wrapIncoming(()=>{var t;return(t=pl(e))==null?void 0:t.flushAsyncTransactions()})}function Wye(e){var t;return(t=e.selectionSvc)==null?void 0:t.getBestCostNodeSelection()}var IB={moduleName:"ClientSideRowModel",version:ct,rowModels:["clientSide"],beans:[Oye,Fye],dependsOn:[L2]},zye={moduleName:"ClientSideRowModelApi",version:ct,apiFunctions:{onGroupExpandedOrCollapsed:Mye,refreshClientSideRowModel:Nye,isRowDataEmpty:Lye,forEachLeafNode:Vye,forEachNodeAfterFilter:Bye,forEachNodeAfterFilterAndSort:$ye,applyTransaction:Hye,applyTransactionAsync:Gye,flushAsyncTransactions:Uye,getBestCostNodeSelection:Wye,resetRowHeights:_B,onRowHeightChanged:EB},dependsOn:[wye,Cye]},jye=class extends We{constructor(){super(...arguments),this.beanName="gridSerializer"}wireBeans(e){this.visibleCols=e.visibleCols,this.colModel=e.colModel,this.rowModel=e.rowModel,this.pinnedRowModel=e.pinnedRowModel}serialize(e,t={}){const{allColumns:n,columnKeys:s,skipRowGroups:o,exportRowNumbers:r}=t,i=this.getColumnsToExport({allColumns:n,skipRowGroups:o,columnKeys:s,exportRowNumbers:r});return[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)].reduce((a,l)=>l(a),e).parse()}processRow(e,t,n,s){var p;const o=t.shouldRowBeSkipped||(()=>!1),i=t.rowPositions!=null||!!t.onlySelected,a=this.gos.get("groupHideOpenParents")&&!i,l=this.colModel.isPivotMode()?s.leafGroup:!s.group,c=!!s.footer,u=s.allChildrenCount===1&&((p=s.childrenAfterGroup)==null?void 0:p.length)===1&&qoe(this.gos,s);if(!l&&!c&&(t.skipRowGroups||u||a)||t.onlySelected&&!s.isSelected()||t.skipPinnedTop&&s.rowPinned==="top"||t.skipPinnedBottom&&s.rowPinned==="bottom"||s.stub||s.level===-1&&!l&&!c||o(Ft(this.gos,{node:s})))return;const f=e.onNewBodyRow(s);if(n.forEach((g,v)=>{f.onColumn(g,v,s)}),t.getCustomContentBelowRow){const g=t.getCustomContentBelowRow(Ft(this.gos,{node:s}));g&&e.addCustomContent(g)}}appendContent(e){return t=>{const n=e.appendContent;return n&&t.addCustomContent(n),t}}prependContent(e){return t=>{const n=e.prependContent;return n&&t.addCustomContent(n),t}}prepareSession(e){return t=>(t.prepare(e),t)}exportColumnGroups(e,t){return n=>{if(!e.skipColumnGroupHeaders){const s=new CL,{colGroupSvc:o}=this.beans,r=o?o.createColumnGroups({columns:t,idCreator:s,pinned:null,isStandaloneStructure:!0}):t;this.recursivelyAddHeaderGroups(r,n,e.processGroupHeaderCallback)}return n}}exportHeaders(e,t){return n=>{if(!e.skipColumnHeaders){const s=n.onNewHeaderRow();t.forEach((o,r)=>{s.onColumn(o,r,void 0)})}return n}}processPinnedTopRows(e,t){return n=>{var o,r;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="top").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedTopRow(i.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("top",s),n}}processRows(e,t){return n=>{var c;const s=this.rowModel,o=os(this.gos),r=cd(this.gos),i=!o&&e.onlySelected,a=this.processRow.bind(this,n,e,t),{exportedRows:l="filteredAndSorted"}=e;if(e.rowPositions)e.rowPositions.filter(u=>u.rowPinned==null).sort((u,d)=>u.rowIndex-d.rowIndex).map(u=>s.getRow(u.rowIndex)).forEach(a);else if(this.colModel.isPivotMode())o?s.forEachPivotNode(a,!0,l==="filteredAndSorted"):r?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);else if(e.onlySelectedAllPages||i){const u=((c=this.beans.selectionSvc)==null?void 0:c.getSelectedNodes())??[];this.replicateSortedOrder(u),u.forEach(a)}else l==="all"?s.forEachNode(a):o||r?s.forEachNodeAfterFilterAndSort(a,!0):s.forEachNode(a);return n}}replicateSortedOrder(e){const{sortSvc:t,rowNodeSorter:n}=this.beans;if(!t||!n)return;const s=t.getSortOptions(),o=(r,i)=>{var a,l;return r.rowIndex!=null&&i.rowIndex!=null?r.rowIndex-i.rowIndex:r.level===i.level?((a=r.parent)==null?void 0:a.id)===((l=i.parent)==null?void 0:l.id)?n.compareRowNodes(s,{rowNode:r,currentPos:r.rowIndex??-1},{rowNode:i,currentPos:i.rowIndex??-1}):o(r.parent,i.parent):r.level>i.level?o(r.parent,i):o(r,i.parent)};e.sort(o)}processPinnedBottomRows(e,t){return n=>{var o,r;const s=this.processRow.bind(this,n,e,t);return e.rowPositions?e.rowPositions.filter(i=>i.rowPinned==="bottom").sort((i,a)=>i.rowIndex-a.rowIndex).map(i=>{var a;return(a=this.pinnedRowModel)==null?void 0:a.getPinnedBottomRow(i.rowIndex)}).forEach(s):(o=this.pinnedRowModel)!=null&&o.isManual()||(r=this.pinnedRowModel)==null||r.forEachPinnedRow("bottom",s),n}}getColumnsToExport(e){const{allColumns:t=!1,skipRowGroups:n=!1,exportRowNumbers:s=!1,columnKeys:o}=e,{colModel:r,gos:i,visibleCols:a}=this,l=r.isPivotMode(),c=h=>ua(h)?!1:!da(h)||s;if(o!=null&&o.length)return r.getColsForKeys(o).filter(c);const u=i.get("treeData");let d=[];return t&&!l?d=r.getCols():d=a.allCols,d=d.filter(h=>c(h)&&(n&&!u?!LE(h):!0)),d}recursivelyAddHeaderGroups(e,t,n){const s=[];for(const o of e){const r=o;if(r.getChildren)for(const i of r.getChildren()??[])s.push(i)}e.length>0&&rs(e[0])&&this.doAddHeaderHeader(t,e,n),s&&s.length>0&&this.recursivelyAddHeaderGroups(s,t,n)}doAddHeaderHeader(e,t,n){const s=e.onNewHeaderGroupingRow();let o=0;for(const r of t){const i=r;let a;n?a=n(Ft(this.gos,{columnGroup:i})):a=this.beans.colNames.getDisplayNameForColumnGroup(i,"header");const c=(i.isExpandable()?i.getLeafColumns():[]).reduce((u,d,h,f)=>{let p=Tn(u);return d.getColumnGroupShow()==="open"?(!p||p[1]!=null)&&(p=[h],u.push(p)):p&&p[1]==null&&(p[1]=h-1),h===f.length-1&&p&&p[1]==null&&(p[1]=h),u},[]);s.onColumn(i,a||"",o++,i.getLeafColumns().length-1,c)}}},Kye={moduleName:"SharedExport",version:ct,beans:[jye]},xB=`\r
258
258
  `,qye=class extends Ege{constructor(e){super(e),this.config=e,this.isFirstLine=!0,this.result="";const{suppressQuotes:t,columnSeparator:n}=e;this.suppressQuotes=t,this.columnSeparator=n}addCustomContent(e){e&&(typeof e=="string"?(/^\s*\n/.test(e)||this.beginNewLine(),e=e.replace(/\r?\n/g,xB),this.result+=e):e.forEach(t=>{this.beginNewLine(),t.forEach((n,s)=>{s!==0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(n.data.value||""),n.mergeAcross&&this.appendEmptyCells(n.mergeAcross)})}))}onNewHeaderGroupingRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderGroupingRowColumn.bind(this)}}onNewHeaderGroupingRowColumn(e,t,n,s){n!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(t),this.appendEmptyCells(s)}appendEmptyCells(e){for(let t=1;t<=e;t++)this.result+=this.columnSeparator+this.putInQuotes("")}onNewHeaderRow(){return this.beginNewLine(),{onColumn:this.onNewHeaderRowColumn.bind(this)}}onNewHeaderRowColumn(e,t){t!=0&&(this.result+=this.columnSeparator),this.result+=this.putInQuotes(this.extractHeaderValue(e))}onNewBodyRow(){return this.beginNewLine(),{onColumn:this.onNewBodyRowColumn.bind(this)}}onNewBodyRowColumn(e,t,n){t!=0&&(this.result+=this.columnSeparator);const s=this.extractRowCellValue(e,t,t,"csv",n);this.result+=this.putInQuotes(s.valueFormatted??s.value)}putInQuotes(e){if(this.suppressQuotes)return e;if(e==null)return'""';let t;return typeof e=="string"?t=e:typeof e.toString=="function"?t=e.toString():(Je(53),t=""),'"'+t.replace(/"/g,'""')+'"'}parse(){return this.result}beginNewLine(){this.isFirstLine||(this.result+=xB),this.isFirstLine=!1}},Yye=class extends Sge{constructor(){super(...arguments),this.beanName="csvCreator"}wireBeans(e){this.colModel=e.colModel,this.colNames=e.colNames,this.rowGroupColsSvc=e.rowGroupColsSvc,this.valueSvc=e.valueSvc}getMergedParams(e){const t=this.gos.get("defaultCsvExportParams");return Object.assign({},t,e)}export(e){if(this.isExportSuppressed()){Je(51);return}const t=this.getMergedParams(e),n=this.getData(t),s=new Blob(["\uFEFF",n],{type:"text/plain"}),o=typeof t.fileName=="function"?t.fileName(Ft(this.gos,{})):t.fileName;_ge(this.getFileName(o),s)}exportDataAsCsv(e){this.export(e)}getDataAsCsv(e,t=!1){const n=t?Object.assign({},e):this.getMergedParams(e);return this.getData(n)}getDefaultFileExtension(){return"csv"}createSerializingSession(e){const{colModel:t,colNames:n,rowGroupColsSvc:s,valueSvc:o,gos:r}=this,{processCellCallback:i,processHeaderCallback:a,processGroupHeaderCallback:l,processRowGroupCallback:c,suppressQuotes:u,columnSeparator:d}=e;return new qye({colModel:t,colNames:n,valueSvc:o,gos:r,processCellCallback:i||void 0,processHeaderCallback:a||void 0,processGroupHeaderCallback:l||void 0,processRowGroupCallback:c||void 0,suppressQuotes:u||!1,columnSeparator:d||",",rowGroupColsSvc:s})}isExportSuppressed(){return this.gos.get("suppressCsvExport")}};function Zye(e,t){var n;return(n=e.csvCreator)==null?void 0:n.getDataAsCsv(t)}function Xye(e,t){var n;(n=e.csvCreator)==null||n.exportDataAsCsv(t)}var Jye={moduleName:"CsvExport",version:ct,beans:[Yye],apiFunctions:{getDataAsCsv:Zye,exportDataAsCsv:Xye},dependsOn:[Kye]},Qye=class extends We{constructor(e,t,n){super(),this.id=e,this.parentCache=t,this.params=n,this.state="needsLoading",this.version=0,this.startRow=e*n.blockSize,this.endRow=this.startRow+n.blockSize}load(){this.state="loading",this.loadFromDatasource()}setStateWaitingToLoad(){this.version++,this.state="needsLoading"}pageLoadFailed(e){this.isRequestMostRecentAndLive(e)&&(this.state="failed"),this.dispatchLocalEvent({type:"loadComplete"})}pageLoaded(e,t,n){this.successCommon(e,{rowData:t,rowCount:n})}isRequestMostRecentAndLive(e){const t=e===this.version,n=this.isAlive();return t&&n}successCommon(e,t){this.dispatchLocalEvent({type:"loadComplete"}),this.isRequestMostRecentAndLive(e)&&(this.state="loaded",this.processServerResult(t))}postConstruct(){this.rowNodes=[];const{params:{blockSize:e,rowHeight:t},startRow:n,beans:s,rowNodes:o}=this;for(let r=0;r<e;r++){const i=n+r,a=new cl(s);a.setRowHeight(t),a.uiLevel=0,a.setRowIndex(i),a.setRowTop(t*i),o.push(a)}}getBlockStateJson(){const{id:e,startRow:t,endRow:n,state:s}=this;return{id:""+e,state:{blockNumber:e,startRow:t,endRow:n,pageStatus:s}}}setDataAndId(e,t,n){dt(t)?e.setDataAndId(t,n.toString()):e.setDataAndId(void 0,void 0)}loadFromDatasource(){const e=this.createLoadParams();if(Vn(this.params.datasource.getRows)){Je(90);return}window.setTimeout(()=>{this.params.datasource.getRows(e)},0)}createLoadParams(){const{startRow:e,endRow:t,version:n,params:{sortModel:s,filterModel:o},gos:r}=this;return{startRow:e,endRow:t,successCallback:this.pageLoaded.bind(this,n),failCallback:this.pageLoadFailed.bind(this,n),sortModel:s,filterModel:o,context:Ft(r,{}).context}}forEachNode(e,t,n){this.rowNodes.forEach((s,o)=>{this.startRow+o<n&&e(s,t.value++)})}getRow(e,t=!1){t||(this.lastAccessed=this.params.lastAccessedSequence.value++);const n=e-this.startRow;return this.rowNodes[n]}processServerResult(e){const{rowNodes:t,beans:n}=this;t.forEach((o,r)=>{const i=e.rowData?e.rowData[r]:void 0;!o.id&&o.alreadyRendered&&i&&(t[r]=new cl(n),t[r].setRowIndex(o.rowIndex),t[r].setRowTop(o.rowTop),t[r].setRowHeight(o.rowHeight),o.clearRowTopAndRowIndex()),this.setDataAndId(t[r],i,this.startRow+r)});const s=e.rowCount!=null&&e.rowCount>=0?e.rowCount:void 0;this.parentCache.pageLoaded(this,s)}destroy(){for(const e of this.rowNodes)e.clearRowTopAndRowIndex();super.destroy()}},ewe=2,twe=class extends We{constructor(e){super(),this.params=e,this.lastRowIndexKnown=!1,this.blocks={},this.blockCount=0,this.rowCount=e.initialRowCount}getRow(e,t=!1){const n=Math.floor(e/this.params.blockSize);let s=this.blocks[n];if(!s){if(t)return;s=this.createBlock(n)}return s.getRow(e)}createBlock(e){const t=this.params,n=this.createBean(new Qye(e,this,t));return this.blocks[n.id]=n,this.blockCount++,this.purgeBlocksIfNeeded(n),t.rowNodeBlockLoader.addBlock(n),n}refreshCache(){if(this.blockCount==0){this.purgeCache();return}for(const t of this.getBlocksInOrder())t.setStateWaitingToLoad();this.params.rowNodeBlockLoader.checkBlockToLoad()}destroy(){for(const e of this.getBlocksInOrder())this.destroyBlock(e);super.destroy()}getRowCount(){return this.rowCount}isLastRowIndexKnown(){return this.lastRowIndexKnown}pageLoaded(e,t){this.isAlive()&&(sl(this.gos,`InfiniteCache - onPageLoaded: page = ${e.id}, lastRow = ${t}`),this.checkRowCount(e,t),this.onCacheUpdated())}purgeBlocksIfNeeded(e){const t=this.getBlocksInOrder().filter(i=>i!=e),n=(i,a)=>a.lastAccessed-i.lastAccessed;t.sort(n);const s=this.params.maxBlocksInCache>0,o=s?this.params.maxBlocksInCache-1:null,r=ewe-1;t.forEach((i,a)=>{const l=i.state==="needsLoading"&&a>=r,c=s?a>=o:!1;if(l||c){if(this.isBlockCurrentlyDisplayed(i)||this.isBlockFocused(i))return;this.removeBlockFromCache(i)}})}isBlockFocused(e){const t=this.beans.focusSvc.getFocusCellToUseAfterRefresh();if(!t||t.rowPinned!=null)return!1;const{startRow:n,endRow:s}=e;return t.rowIndex>=n&&t.rowIndex<s}isBlockCurrentlyDisplayed(e){const{startRow:t,endRow:n}=e;return this.beans.rowRenderer.isRangeInRenderedViewport(t,n-1)}removeBlockFromCache(e){e&&this.destroyBlock(e)}checkRowCount(e,t){if(typeof t=="number"&&t>=0)this.rowCount=t,this.lastRowIndexKnown=!0;else if(!this.lastRowIndexKnown){const{blockSize:n,overflowSize:s}=this.params,r=(e.id+1)*n+s;this.rowCount<r&&(this.rowCount=r)}}setRowCount(e,t){this.rowCount=e,dt(t)&&(this.lastRowIndexKnown=t),this.lastRowIndexKnown||this.rowCount%this.params.blockSize===0&&this.rowCount++,this.onCacheUpdated()}forEachNodeDeep(e){const t={value:0};for(const n of this.getBlocksInOrder())n.forEachNode(e,t,this.rowCount)}getBlocksInOrder(){const e=(n,s)=>n.id-s.id;return Object.values(this.blocks).sort(e)}destroyBlock(e){delete this.blocks[e.id],this.destroyBean(e),this.blockCount--,this.params.rowNodeBlockLoader.removeBlock(e)}onCacheUpdated(){this.isAlive()&&(this.destroyAllBlocksPastVirtualRowCount(),this.eventSvc.dispatchEvent({type:"storeUpdated"}))}destroyAllBlocksPastVirtualRowCount(){const e=[];for(const t of this.getBlocksInOrder())t.id*this.params.blockSize>=this.rowCount&&e.push(t);if(e.length>0)for(const t of e)this.destroyBlock(t)}purgeCache(){for(const e of this.getBlocksInOrder())this.removeBlockFromCache(e);this.lastRowIndexKnown=!1,this.rowCount===0&&(this.rowCount=this.params.initialRowCount),this.onCacheUpdated()}getRowNodesInRange(e,t){const n=[];let s=-1,o=!1;const r={value:0};let i=!1;for(const l of this.getBlocksInOrder())if(!i){if(o&&s+1!==l.id){i=!0;continue}s=l.id,l.forEachNode(c=>{const u=c===e||c===t;(o||u)&&n.push(c),u&&(o=!o)},r,this.rowCount)}return i||o?[]:n}},nwe=class extends We{constructor(){super(...arguments),this.beanName="rowModel",this.rootNode=null}getRowBounds(e){return{rowHeight:this.rowHeight,rowTop:this.rowHeight*e}}ensureRowHeightsValid(){return!1}postConstruct(){if(this.gos.get("rowModelType")!=="infinite")return;const e=this.beans,t=new cl(e);this.rootNode=t,t.level=-1,this.rowHeight=vc(e),this.addEventListeners(),this.addDestroyFunc(()=>this.destroyCache())}start(){this.setDatasource(this.gos.get("datasource"))}destroy(){this.destroyDatasource(),super.destroy(),this.rootNode=null}destroyDatasource(){this.datasource&&(this.destroyBean(this.datasource),this.beans.rowRenderer.datasourceChanged(),this.datasource=null)}addEventListeners(){this.addManagedEventListeners({filterChanged:this.reset.bind(this),sortChanged:this.reset.bind(this),newColumnsLoaded:this.onColumnEverything.bind(this),storeUpdated:this.dispatchModelUpdatedEvent.bind(this)}),this.addManagedPropertyListener("datasource",()=>this.setDatasource(this.gos.get("datasource"))),this.addManagedPropertyListener("cacheBlockSize",()=>this.resetCache()),this.addManagedPropertyListener("rowHeight",()=>{this.rowHeight=vc(this.beans),this.cacheParams.rowHeight=this.rowHeight,this.updateRowHeights()})}onColumnEverything(){var t;let e;this.cacheParams?e=!Of(this.cacheParams.sortModel,((t=this.beans.sortSvc)==null?void 0:t.getSortModel())??[]):e=!0,e&&this.reset()}getType(){return"infinite"}setDatasource(e){this.destroyDatasource(),this.datasource=e,e&&this.reset()}isEmpty(){return!this.infiniteCache}isRowsToRender(){return!!this.infiniteCache}getNodesInRangeForSelection(e,t){var n;return((n=this.infiniteCache)==null?void 0:n.getRowNodesInRange(e,t))??[]}reset(){var n;if(!this.datasource)return;dd(this.gos)!=null||(n=this.beans.selectionSvc)==null||n.reset("rowDataChanged"),this.resetCache()}dispatchModelUpdatedEvent(){this.eventSvc.dispatchEvent({type:"modelUpdated",newPage:!1,newPageSize:!1,newData:!1,keepRenderedRows:!0,animate:!1})}resetCache(){this.destroyCache();const e=this.beans,{filterManager:t,sortSvc:n,rowNodeBlockLoader:s,eventSvc:o,gos:r}=e;this.cacheParams={datasource:this.datasource,filterModel:(t==null?void 0:t.getFilterModel())??{},sortModel:(n==null?void 0:n.getSortModel())??[],rowNodeBlockLoader:s,initialRowCount:r.get("infiniteInitialRowCount"),maxBlocksInCache:r.get("maxBlocksInCache"),rowHeight:vc(e),overflowSize:r.get("cacheOverflowSize"),blockSize:r.get("cacheBlockSize"),lastAccessedSequence:{value:0}},this.infiniteCache=this.createBean(new twe(this.cacheParams)),o.dispatchEventOnce({type:"rowCountReady"}),this.dispatchModelUpdatedEvent()}updateRowHeights(){this.forEachNode(e=>{e.setRowHeight(this.rowHeight),e.setRowTop(this.rowHeight*e.rowIndex)}),this.dispatchModelUpdatedEvent()}destroyCache(){this.infiniteCache=this.destroyBean(this.infiniteCache)}getRow(e){const t=this.infiniteCache;if(t&&!(e>=t.getRowCount()))return t.getRow(e)}getRowNode(e){let t;return this.forEachNode(n=>{n.id===e&&(t=n)}),t}forEachNode(e){var t;(t=this.infiniteCache)==null||t.forEachNodeDeep(e)}getTopLevelRowCount(){return this.getRowCount()}getTopLevelRowDisplayedIndex(e){return e}getRowIndexAtPixel(e){if(this.rowHeight!==0){const t=Math.floor(e/this.rowHeight),n=this.getRowCount()-1;return t>n?n:t}return 0}getRowCount(){return this.infiniteCache?this.infiniteCache.getRowCount():0}isRowPresent(e){return!!this.getRowNode(e.id)}refreshCache(){var e;(e=this.infiniteCache)==null||e.refreshCache()}purgeCache(){var e;(e=this.infiniteCache)==null||e.purgeCache()}isLastRowIndexKnown(){var e;return((e=this.infiniteCache)==null?void 0:e.isLastRowIndexKnown())??!1}setRowCount(e,t){var n;(n=this.infiniteCache)==null||n.setRowCount(e,t)}resetRowHeights(){}onRowHeightChanged(){}};function swe(e){var t;(t=Sy(e))==null||t.refreshCache()}function owe(e){var t;(t=Sy(e))==null||t.purgeCache()}function rwe(e){var t;return(t=Sy(e))==null?void 0:t.getRowCount()}var iwe=class extends We{constructor(){super(...arguments),this.beanName="rowNodeBlockLoader",this.activeBlockLoadsCount=0,this.blocks=[],this.active=!0}postConstruct(){this.maxConcurrentRequests=Yoe(this.gos);const e=this.gos.get("blockLoadDebounceMillis");e&&e>0&&(this.checkBlockToLoadDebounce=Os(this,this.performCheckBlocksToLoad.bind(this),e))}addBlock(e){this.blocks.push(e),e.addEventListener("loadComplete",this.loadComplete.bind(this)),this.checkBlockToLoad()}removeBlock(e){$r(this.blocks,e)}destroy(){super.destroy(),this.active=!1}loadComplete(){this.activeBlockLoadsCount--,this.checkBlockToLoad()}checkBlockToLoad(){this.checkBlockToLoadDebounce?this.checkBlockToLoadDebounce():this.performCheckBlocksToLoad()}performCheckBlocksToLoad(){if(!this.active)return;if(this.printCacheStatus(),this.maxConcurrentRequests!=null&&this.activeBlockLoadsCount>=this.maxConcurrentRequests){sl(this.gos,"RowNodeBlockLoader - checkBlockToLoad: max loads exceeded");return}const e=this.maxConcurrentRequests!=null?this.maxConcurrentRequests-this.activeBlockLoadsCount:1,t=this.blocks.filter(n=>n.state==="needsLoading").slice(0,e);this.activeBlockLoadsCount+=t.length;for(const n of t)n.load();this.printCacheStatus()}getBlockState(){const e={};return this.blocks.forEach(t=>{const{id:n,state:s}=t.getBlockStateJson();e[n]=s}),e}printCacheStatus(){sl(this.gos,`RowNodeBlockLoader - printCacheStatus: activePageLoadsCount = ${this.activeBlockLoadsCount}, blocks = ${JSON.stringify(this.getBlockState())}`)}},awe={moduleName:"InfiniteRowModelCore",version:ct,rowModels:["infinite"],beans:[nwe,iwe]},lwe={moduleName:"InfiniteRowModel",version:ct,apiFunctions:{refreshInfiniteCache:swe,purgeInfiniteCache:owe,getInfiniteRowCount:rwe},dependsOn:[awe,bye]},cwe="↑",uwe="↓",dwe={tag:"span",children:[{tag:"span",ref:"eDelta",cls:"ag-value-change-delta"},{tag:"span",ref:"eValue",cls:"ag-value-change-value"}]},hwe=class extends Cn{constructor(){super(dwe),this.eValue=ut,this.eDelta=ut,this.refreshCount=0}init(e){this.refresh(e,!0)}showDelta(e,t){const n=Math.abs(t),s=e.formatValue(n),o=dt(s)?s:n,r=t>=0,i=this.eDelta;r?i.textContent=cwe+o:i.textContent=uwe+o,i.classList.toggle("ag-value-change-delta-up",r),i.classList.toggle("ag-value-change-delta-down",!r)}setTimerToRemoveDelta(){this.refreshCount++;const e=this.refreshCount;this.beans.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.hideDeltaValue()},2e3)})}hideDeltaValue(){this.eValue.classList.remove("ag-value-change-value-highlight"),ks(this.eDelta)}refresh(e,t=!1){var c;const{value:n,valueFormatted:s}=e,{eValue:o,lastValue:r,beans:i}=this;if(n===r||(dt(s)?o.textContent=s:dt(n)?o.textContent=n:ks(o),(c=i.filterManager)!=null&&c.isSuppressFlashingCellsBecauseFiltering()))return!1;const a=n&&typeof n=="object"&&"toNumber"in n?n.toNumber():n,l=r&&typeof r=="object"&&"toNumber"in r?r.toNumber():r;if(a===l)return!1;if(typeof a=="number"&&typeof l=="number"){const u=a-l;this.showDelta(e,u)}return r&&o.classList.add("ag-value-change-value-highlight"),t||this.setTimerToRemoveDelta(),this.lastValue=n,!0}},fwe=".ag-value-slide-out{opacity:1}:where(.ag-ltr) .ag-value-slide-out{margin-right:5px;transition:opacity 3s,margin-right 3s}:where(.ag-rtl) .ag-value-slide-out{margin-left:5px;transition:opacity 3s,margin-left 3s}:where(.ag-ltr,.ag-rtl) .ag-value-slide-out{transition-timing-function:linear}.ag-value-slide-out-end{opacity:0}:where(.ag-ltr) .ag-value-slide-out-end{margin-right:10px}:where(.ag-rtl) .ag-value-slide-out-end{margin-left:10px}",pwe={tag:"span",children:[{tag:"span",ref:"eCurrent",cls:"ag-value-slide-current"}]},gwe=class extends Cn{constructor(){super(pwe),this.eCurrent=ut,this.refreshCount=0,this.registerCSS(fwe)}init(e){this.refresh(e,!0)}addSlideAnimation(){var o;this.refreshCount++;const e=this.refreshCount;(o=this.ePrevious)==null||o.remove();const{beans:t,eCurrent:n}=this,s=is({tag:"span",cls:"ag-value-slide-previous ag-value-slide-out"});this.ePrevious=s,s.textContent=n.textContent,this.getGui().insertBefore(s,n),t.frameworkOverrides.wrapIncoming(()=>{window.setTimeout(()=>{e===this.refreshCount&&this.ePrevious.classList.add("ag-value-slide-out-end")},50),window.setTimeout(()=>{var r;e===this.refreshCount&&((r=this.ePrevious)==null||r.remove(),this.ePrevious=null)},3e3)})}refresh(e,t=!1){var o;let n=e.value;if(Vn(n)&&(n=""),n===this.lastValue||(o=this.beans.filterManager)!=null&&o.isSuppressFlashingCellsBecauseFiltering())return!1;t||this.addSlideAnimation(),this.lastValue=n;const s=this.eCurrent;return dt(e.valueFormatted)?s.textContent=e.valueFormatted:dt(e.value)?s.textContent=n:ks(s),!0}},mwe=class extends We{constructor(){super(...arguments),this.beanName="cellFlashSvc",this.nextAnimationTime=null,this.nextAnimationCycle=null,this.animations={highlight:new Map,"data-changed":new Map}}animateCell(e,t,n=this.beans.gos.get("cellFlashDuration"),s=this.beans.gos.get("cellFadeDuration")){const o=this.animations[t];o.delete(e);const r=Date.now(),i=r+n,a=r+n+s,l={phase:"flash",flashEndTime:i,fadeEndTime:a};o.set(e,l);const c=`ag-cell-${t}`,u=`${c}-animation`,{comp:d,eGui:{style:h}}=e;d.toggleCss(c,!0),d.toggleCss(u,!1),h.removeProperty("transition"),h.removeProperty("transition-delay"),this.nextAnimationTime&&i+15<this.nextAnimationTime&&(clearTimeout(this.nextAnimationCycle),this.nextAnimationCycle=null,this.nextAnimationTime=null),this.nextAnimationCycle||(this.beans.frameworkOverrides.wrapIncoming(()=>{this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),n)}),this.nextAnimationTime=i)}advanceAnimations(){const e=Date.now();let t=null;for(const n of Object.keys(this.animations)){const s=this.animations[n],o=`ag-cell-${n}`,r=`${o}-animation`;for(const[i,a]of s){if(!i.isAlive()||!i.comp){s.delete(i);continue}const{phase:l,flashEndTime:c,fadeEndTime:u}=a,d=l==="flash"?c:u;if(!(e+15>=d)){t=Math.min(d,t??1/0);continue}const{comp:f,eGui:{style:p}}=i;switch(l){case"flash":f.toggleCss(o,!1),f.toggleCss(r,!0),p.transition=`background-color ${u-c}ms`,p.transitionDelay=`${c-e}ms`,t=Math.min(u,t??1/0),a.phase="fade";break;case"fade":f.toggleCss(o,!1),f.toggleCss(r,!1),p.removeProperty("transition"),p.removeProperty("transition-delay"),s.delete(i);break}}}t==null?(this.nextAnimationTime=null,this.nextAnimationCycle=null):t&&(this.nextAnimationCycle=setTimeout(this.advanceAnimations.bind(this),t-e),this.nextAnimationTime=t)}onFlashCells(e,t){if(!e.comp)return;const n=gue(e.cellPosition);t.cells[n]&&this.animateCell(e,"highlight")}flashCell(e,t){this.animateCell(e,"data-changed",t==null?void 0:t.flashDuration,t==null?void 0:t.fadeDuration)}destroy(){for(const e of Object.keys(this.animations))this.animations[e].clear()}};function vwe(e,t={}){const{cellFlashSvc:n}=e;n&&e.frameworkOverrides.wrapIncoming(()=>{for(const s of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns))n.flashCell(s,t)})}var ywe={moduleName:"HighlightChanges",version:ct,beans:[mwe],userComponents:{agAnimateShowChangeCellRenderer:hwe,agAnimateSlideCellRenderer:gwe},apiFunctions:{flashCells:vwe}};function wwe(e){var t;return((t=e.stateSvc)==null?void 0:t.getState())??{}}function Cwe(e,t,n){var s;return(s=e.stateSvc)==null?void 0:s.setState(t,n)}function FB(e){return e={...e},e.version||(e.version="32.1.0"),e.version==="32.1.0"&&(e=bwe(e)),e.version=ct,e}function bwe(e){return e.cellSelection=Swe(e,"rangeSelection"),e}function Swe(e,t){if(e&&typeof e=="object")return e[t]}var Ewe=class extends We{constructor(){super(...arguments),this.beanName="stateSvc",this.updateRowGroupExpansionStateTimer=0,this.suppressEvents=!0,this.queuedUpdateSources=new Set,this.dispatchStateUpdateEventDebounced=Os(this,()=>this.dispatchQueuedStateUpdateEvents(),0),this.onRowGroupOpenedDebounced=Os(this,()=>{this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(this.updateCachedState("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("rowGroupExpansion",void 0)):(this.updateCachedState("rowGroupExpansion",this.getRowGroupExpansionState()),this.updateCachedState("ssrmRowGroupExpansion",void 0))},0),this.onRowSelectedDebounced=Os(this,()=>{this.staleStateKeys.delete("rowSelection"),this.updateCachedState("rowSelection",this.getRowSelectionState())},0),this.staleStateKeys=new Set}postConstruct(){const{gos:e,ctrlsSvc:t,colDelayRenderSvc:n}=this.beans;this.isClientSideRowModel=os(e);const s=FB(e.get("initialState")??{}),o=s.partialColumnState;delete s.partialColumnState,this.cachedState=s;const r=this.suppressEventsAndDispatchInitEvent.bind(this);t.whenReady(this,()=>r(()=>this.setupStateOnGridReady(s))),(s.columnOrder||s.columnVisibility||s.columnSizing||s.columnPinning||s.columnGroup)&&(n==null||n.hideColumns("columnState"));const[i,a,l]=this.addManagedEventListeners({newColumnsLoaded:({source:c})=>{c==="gridInitializing"&&(i(),r(()=>{this.setupStateOnColumnsInitialised(s,!!o),n==null||n.revealColumns("columnState")}))},rowCountReady:()=>{a==null||a(),r(()=>this.setupStateOnRowCountReady(s))},firstDataRendered:()=>{l==null||l(),r(()=>this.setupStateOnFirstDataRendered(s))}})}destroy(){super.destroy(),clearTimeout(this.updateRowGroupExpansionStateTimer),this.queuedUpdateSources.clear()}getState(){return this.staleStateKeys.size&&this.refreshStaleState(),this.cachedState}setState(e,t){const n=FB(e);delete n.partialColumnState,this.cachedState=n,this.startSuppressEvents();const s="api",o=t?new Set(t):void 0;this.setGridReadyState(n,s,o),this.setColumnsInitialisedState(n,s,!!o,o),this.setRowCountState(n,s,o),setTimeout(()=>{this.isAlive()&&this.setFirstDataRenderedState(n,s,o),this.stopSuppressEvents(s)})}setGridReadyState(e,t,n){var s,o;t==="api"&&!(n!=null&&n.has("sideBar"))&&((o=(s=this.beans.sideBar)==null?void 0:s.comp)==null||o.setState(e.sideBar)),this.updateCachedState("sideBar",this.getSideBarState())}setupStateOnGridReady(e){this.setGridReadyState(e,"gridInitializing");const t=()=>this.updateCachedState("sideBar",this.getSideBarState());this.addManagedEventListeners({toolPanelVisibleChanged:t,sideBarUpdated:t})}updateColumnAndGroupState(){this.updateColumnState(["aggregation","columnOrder","columnPinning","columnSizing","columnVisibility","pivot","rowGroup","sort"]),this.updateCachedState("columnGroup",this.getColumnGroupState())}setColumnsInitialisedState(e,t,n,s){this.setColumnState(e,t,n,s),this.setColumnGroupState(e,t,s),this.updateColumnAndGroupState()}setupStateOnColumnsInitialised(e,t){this.setColumnsInitialisedState(e,"gridInitializing",t);const n=s=>()=>this.updateColumnState([s]);this.addManagedEventListeners({columnValueChanged:n("aggregation"),columnMoved:n("columnOrder"),columnPinned:n("columnPinning"),columnResized:n("columnSizing"),columnVisible:n("columnVisibility"),columnPivotChanged:n("pivot"),columnPivotModeChanged:n("pivot"),columnRowGroupChanged:n("rowGroup"),sortChanged:n("sort"),newColumnsLoaded:this.updateColumnAndGroupState.bind(this),columnGroupOpened:()=>this.updateCachedState("columnGroup",this.getColumnGroupState())})}setRowCountState(e,t,n){const{filter:s,rowGroupExpansion:o,ssrmRowGroupExpansion:r,rowSelection:i,pagination:a}=e,l=(u,d)=>!(n!=null&&n.has(u))&&(d||t==="api");l("filter",s)&&this.setFilterState(s),l("rowGroupExpansion",o)&&this.setRowGroupExpansionState(r,o,t),l("rowSelection",i)&&this.setRowSelectionState(i,t),l("pagination",a)&&this.setPaginationState(a,t);const c=this.updateCachedState.bind(this);c("filter",this.getFilterState()),this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(c("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),c("rowGroupExpansion",void 0)):(c("rowGroupExpansion",this.getRowGroupExpansionState()),c("ssrmRowGroupExpansion",void 0)),c("rowSelection",this.getRowSelectionState()),c("pagination",this.getPaginationState())}setupStateOnRowCountReady(e){this.setRowCountState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>{this.updateRowGroupExpansionStateTimer=0,this.beans.gos.get("ssrmExpandAllAffectsAllRows")?(t("ssrmRowGroupExpansion",this.getRowGroupExpansionState()),t("rowGroupExpansion",void 0)):(t("rowGroupExpansion",this.getRowGroupExpansionState()),t("ssrmRowGroupExpansion",void 0))},s=()=>t("filter",this.getFilterState()),{gos:o,colFilter:r}=this.beans;this.addManagedEventListeners({filterChanged:s,rowExpansionStateChanged:this.onRowGroupOpenedDebounced,expandOrCollapseAll:n,columnRowGroupChanged:n,rowDataUpdated:()=>{(o.get("groupDefaultExpanded")!==0||o.get("isGroupOpenByDefault"))&&(this.updateRowGroupExpansionStateTimer||(this.updateRowGroupExpansionStateTimer=setTimeout(n)))},selectionChanged:()=>{this.staleStateKeys.add("rowSelection"),this.onRowSelectedDebounced()},paginationChanged:i=>{(i.newPage||i.newPageSize)&&t("pagination",this.getPaginationState())}}),r&&this.addManagedListeners(r,{filterStateChanged:s})}setFirstDataRenderedState(e,t,n){const{scroll:s,cellSelection:o,focusedCell:r,columnOrder:i,rowPinning:a}=e,l=(d,h)=>!(n!=null&&n.has(d))&&(h||t==="api");l("focusedCell",r)&&this.setFocusedCellState(r),l("cellSelection",o)&&this.setCellSelectionState(o),l("scroll",s)&&this.setScrollState(s),l("rowPinning",a)&&this.setRowPinningState(a),this.setColumnPivotState(!!(i!=null&&i.orderedColIds),t);const c=this.updateCachedState.bind(this);c("sideBar",this.getSideBarState()),c("focusedCell",this.getFocusedCellState());const u=this.getRangeSelectionState();c("rangeSelection",u),c("cellSelection",u),c("scroll",this.getScrollState())}setupStateOnFirstDataRendered(e){this.setFirstDataRenderedState(e,"gridInitializing");const t=this.updateCachedState.bind(this),n=()=>t("focusedCell",this.getFocusedCellState());this.addManagedEventListeners({cellFocused:n,cellFocusCleared:n,cellSelectionChanged:s=>{if(s.finished){const o=this.getRangeSelectionState();t("rangeSelection",o),t("cellSelection",o)}},bodyScrollEnd:()=>t("scroll",this.getScrollState()),pinnedRowsChanged:()=>t("rowPinning",this.getRowPinningState())})}getColumnState(){const e=this.beans;return wge(zv(e),e.colModel.isPivotMode())}setColumnState(e,t,n,s){const{sort:o,rowGroup:r,aggregation:i,pivot:a,columnPinning:l,columnVisibility:c,columnSizing:u,columnOrder:d}=e;let h=!1;const f=(E,A)=>{const k=!(s!=null&&s.has(E))&&!!(A||t==="api");return h||(h=k),k},p={},g=E=>{let A=p[E];return A||(A={colId:E},p[E]=A,A)},v={},C=f("sort",o);C&&(o==null||o.sortModel.forEach(({colId:E,sort:A},k)=>{const M=g(E);M.sort=A,M.sortIndex=k})),(C||!n)&&(v.sort=null,v.sortIndex=null);const S=f("rowGroup",r);S&&(r==null||r.groupColIds.forEach((E,A)=>{const k=g(E);k.rowGroup=!0,k.rowGroupIndex=A})),(S||!n)&&(v.rowGroup=null,v.rowGroupIndex=null);const b=f("aggregation",i);b&&(i==null||i.aggregationModel.forEach(({colId:E,aggFunc:A})=>{g(E).aggFunc=A})),(b||!n)&&(v.aggFunc=null);const w=f("pivot",a);w&&(a==null||a.pivotColIds.forEach((E,A)=>{const k=g(E);k.pivot=!0,k.pivotIndex=A}),this.gos.updateGridOptions({options:{pivotMode:!!(a!=null&&a.pivotMode)},source:t})),(w||!n)&&(v.pivot=null,v.pivotIndex=null);const D=f("columnPinning",l);if(D){for(const E of(l==null?void 0:l.leftColIds)??[])g(E).pinned="left";for(const E of(l==null?void 0:l.rightColIds)??[])g(E).pinned="right"}(D||!n)&&(v.pinned=null);const R=f("columnVisibility",c);if(R)for(const E of(c==null?void 0:c.hiddenColIds)??[])g(E).hide=!0;(R||!n)&&(v.hide=null);const T=f("columnSizing",u);if(T)for(const{colId:E,flex:A,width:k}of(u==null?void 0:u.columnSizingModel)??[]){const M=g(E);M.flex=A??null,M.width=k}(T||!n)&&(v.flex=null);const I=d==null?void 0:d.orderedColIds,x=!!(I!=null&&I.length)&&!(s!=null&&s.has("columnOrder")),F=x?I.map(E=>g(E)):Object.values(p);(F.length||h)&&(this.columnStates=F,Hr(this.beans,{state:F,applyOrder:x,defaultState:v},t))}setColumnPivotState(e,t){const n=this.columnStates;this.columnStates=void 0;const s=this.columnGroupStates;this.columnGroupStates=void 0;const o=this.beans,{pivotResultCols:r,colGroupSvc:i}=o;if(r!=null&&r.isPivotResultColsPresent()){if(n){const a=[];for(const l of n)r.getPivotResultCol(l.colId)&&a.push(l);Hr(o,{state:a,applyOrder:e},t)}s&&(i==null||i.setColumnGroupState(s,t))}}getColumnGroupState(){const e=this.beans.colGroupSvc;if(!e)return;const t=e.getColumnGroupState();return Cge(t)}setColumnGroupState(e,t,n){var a;const s=this.beans.colGroupSvc;if(!s||n!=null&&n.has("columnGroup")||t!=="api"&&!Object.prototype.hasOwnProperty.call(e,"columnGroup"))return;const o=new Set((a=e.columnGroup)==null?void 0:a.openColumnGroupIds),i=s.getColumnGroupState().map(({groupId:l})=>{const c=o.has(l);return c&&o.delete(l),{groupId:l,open:c}});for(const l of o)i.push({groupId:l,open:!0});i.length&&(this.columnGroupStates=i),s.setColumnGroupState(i,t)}getFilterState(){const e=this.beans.filterManager;let t=e==null?void 0:e.getFilterModel();t&&Object.keys(t).length===0&&(t=void 0);const n=e==null?void 0:e.getFilterState(),s=(e==null?void 0:e.getAdvFilterModel())??void 0;return t||s||n?{filterModel:t,columnFilterState:n,advancedFilterModel:s}:void 0}setFilterState(e){const t=this.beans.filterManager,{filterModel:n,columnFilterState:s,advancedFilterModel:o}=e??{filterModel:null,columnFilterState:null,advancedFilterModel:null};(n!==void 0||s!==void 0)&&(t==null||t.setFilterState(n??null,s??null,"columnFilter")),o!==void 0&&(t==null||t.setAdvFilterModel(o??null,"advancedFilter"))}getRangeSelectionState(){var t;const e=(t=this.beans.rangeSvc)==null?void 0:t.getCellRanges().map(n=>{const{id:s,type:o,startRow:r,endRow:i,columns:a,startColumn:l}=n;return{id:s,type:o,startRow:r,endRow:i,colIds:a.map(c=>c.getColId()),startColId:l.getColId()}});return e!=null&&e.length?{cellRanges:e}:void 0}setCellSelectionState(e){const{gos:t,rangeSvc:n,colModel:s,visibleCols:o}=this.beans;if(!la(t)||!n)return;const r=[];for(const i of(e==null?void 0:e.cellRanges)??[]){const a=[];for(const c of i.colIds){const u=s.getCol(c);u&&a.push(u)}if(!a.length)continue;let l=s.getCol(i.startColId);if(!l){const c=o.allCols,u=new Set(a);l=c.find(d=>u.has(d))}r.push({...i,columns:a,startColumn:l})}n.setCellRanges(r)}getScrollState(){if(!this.isClientSideRowModel)return;const e=this.beans.ctrlsSvc.getScrollFeature(),{left:t}=(e==null?void 0:e.getHScrollPosition())??{left:0},{top:n}=(e==null?void 0:e.getVScrollPosition())??{top:0};return n||t?{top:n,left:t}:void 0}setScrollState(e){if(!this.isClientSideRowModel)return;const{top:t,left:n}=e??{top:0,left:0},{frameworkOverrides:s,rowRenderer:o,animationFrameSvc:r,ctrlsSvc:i}=this.beans;s.wrapIncoming(()=>{var a;i.get("center").setCenterViewportScrollLeft(n),(a=i.getScrollFeature())==null||a.setVerticalScrollPosition(t),o.redraw({afterScroll:!0}),r==null||r.flushAllFrames()})}getSideBarState(){var e,t;return(t=(e=this.beans.sideBar)==null?void 0:e.comp)==null?void 0:t.getState()}getFocusedCellState(){if(!this.isClientSideRowModel)return;const e=this.beans.focusSvc.getFocusedCell();if(e){const{column:t,rowIndex:n,rowPinned:s}=e;return{colId:t.getColId(),rowIndex:n,rowPinned:s}}}setFocusedCellState(e){if(!this.isClientSideRowModel)return;const{focusSvc:t,colModel:n}=this.beans;if(!e){t.clearFocusedCell();return}const{colId:s,rowIndex:o,rowPinned:r}=e;t.setFocusedCell({column:n.getCol(s),rowIndex:o,rowPinned:r,forceBrowserFocus:!0,preventScrollOnBrowserFocus:!0})}getPaginationState(){const{pagination:e,gos:t}=this.beans;if(!e)return;const n=e.getCurrentPage(),s=t.get("paginationAutoPageSize")?void 0:e.getPageSize();if(!(!n&&!s))return{page:n,pageSize:s}}setPaginationState(e,t){const{pagination:n,gos:s}=this.beans;if(!n)return;const{pageSize:o,page:r}=e??{page:0,pageSize:s.get("paginationPageSize")},i=t==="gridInitializing";o&&!s.get("paginationAutoPageSize")&&n.setPageSize(o,i?"initialState":"pageSizeSelector"),typeof r=="number"&&(i?n.setPage(r):n.goToPage(r))}getRowSelectionState(){var s;const e=this.beans.selectionSvc;if(!e)return;const t=e.getSelectionState();return!t||!Array.isArray(t)&&(t.selectAll===!1||t.selectAllChildren===!1)&&!((s=t==null?void 0:t.toggledNodes)!=null&&s.length)?void 0:t}setRowSelectionState(e,t){var n;(n=this.beans.selectionSvc)==null||n.setSelectionState(e,t,t==="api")}getRowGroupExpansionState(){const{expansionSvc:e}=this.beans;if(e)return e.getExpansionState()}getRowPinningState(){var e;return(e=this.beans.pinnedRowModel)==null?void 0:e.getPinnedState()}setRowPinningState(e){const t=this.beans.pinnedRowModel;e?t==null||t.setPinnedState(e):t==null||t.reset()}setRowGroupExpansionState(e,t,n){const s=this.beans.expansionSvc;if(!s)return;const o=t??{expandedRowGroupIds:[],collapsedRowGroupIds:[]};s.setExpansionState(o,n)}updateColumnState(e){const t=this.getColumnState();let n=!1;const s=this.cachedState;for(const o of Object.keys(t)){const r=t[o];Of(r,s[o])||(n=!0)}this.cachedState={...s,...t},n&&this.dispatchStateUpdateEvent(e)}updateCachedState(e,t){const n=this.cachedState[e];this.setCachedStateValue(e,t),Of(t,n)||this.dispatchStateUpdateEvent([e])}setCachedStateValue(e,t){this.cachedState={...this.cachedState,[e]:t}}refreshStaleState(){const e=this.staleStateKeys;for(const t of e)t==="rowSelection"&&this.setCachedStateValue(t,this.getRowSelectionState());e.clear()}dispatchStateUpdateEvent(e){if(!this.suppressEvents){for(const t of e)this.queuedUpdateSources.add(t);this.dispatchStateUpdateEventDebounced()}}dispatchQueuedStateUpdateEvents(){const e=this.queuedUpdateSources,t=Array.from(e);e.clear(),this.eventSvc.dispatchEvent({type:"stateUpdated",sources:t,state:this.cachedState})}startSuppressEvents(){var e;this.suppressEvents=!0,(e=this.beans.colAnimation)==null||e.setSuppressAnimation(!0)}stopSuppressEvents(e){setTimeout(()=>{var t;this.suppressEvents=!1,this.queuedUpdateSources.clear(),this.isAlive()&&((t=this.beans.colAnimation)==null||t.setSuppressAnimation(!1),this.dispatchStateUpdateEvent([e]))})}suppressEventsAndDispatchInitEvent(e){this.startSuppressEvents(),e(),this.stopSuppressEvents("gridInitializing")}},_we={moduleName:"GridState",version:ct,beans:[Ewe],apiFunctions:{getState:wwe,setState:Cwe}};function Rwe(e){return e.rowModel.isLastRowIndexKnown()}function Dwe(e){var t;return((t=e.pagination)==null?void 0:t.getPageSize())??100}function Twe(e){var t;return((t=e.pagination)==null?void 0:t.getCurrentPage())??0}function Iwe(e){var t;return((t=e.pagination)==null?void 0:t.getTotalPages())??1}function xwe(e){return e.pagination?e.pagination.getMasterRowCount():e.rowModel.getRowCount()}function Fwe(e){var t;(t=e.pagination)==null||t.goToNextPage()}function Pwe(e){var t;(t=e.pagination)==null||t.goToPreviousPage()}function Awe(e){var t;(t=e.pagination)==null||t.goToFirstPage()}function kwe(e){var t;(t=e.pagination)==null||t.goToLastPage()}function Owe(e,t){var n;(n=e.pagination)==null||n.goToPage(t)}var Mwe=class extends We{constructor(){super(...arguments),this.beanName="paginationAutoPageSizeSvc"}postConstruct(){this.beans.ctrlsSvc.whenReady(this,e=>{this.centerRowsCtrl=e.center;const t=this.checkPageSize.bind(this);this.addManagedEventListeners({bodyHeightChanged:t,scrollVisibilityChanged:t}),this.addManagedPropertyListener("paginationAutoPageSize",this.onPaginationAutoSizeChanged.bind(this)),this.checkPageSize()})}notActive(){return!this.gos.get("paginationAutoPageSize")||this.centerRowsCtrl==null}onPaginationAutoSizeChanged(){this.notActive()?this.beans.pagination.unsetAutoCalculatedPageSize():this.checkPageSize()}checkPageSize(){if(this.notActive())return;const e=this.centerRowsCtrl.viewportSizeFeature.getBodyHeight();if(e>0){const t=this.beans,n=()=>{const s=Math.max(vc(t),1),o=Math.floor(e/s);t.pagination.setPageSize(o,"autoCalculated")};this.isBodyRendered?Os(this,n,50)():(n(),this.isBodyRendered=!0)}else this.isBodyRendered=!1}},mp="paginationPageSizeSelector",Nwe={tag:"span",cls:"ag-paging-page-size"},Lwe=class extends Cn{constructor(){super(Nwe),this.hasEmptyOption=!1,this.handlePageSizeItemSelected=()=>{if(!this.selectPageSizeComp)return;const e=this.selectPageSizeComp.getValue();if(!e)return;const t=Number(e);isNaN(t)||t<1||t===this.pagination.getPageSize()||(this.pagination.setPageSize(t,"pageSizeSelector"),this.hasEmptyOption&&this.toggleSelectDisplay(!0),this.selectPageSizeComp.getFocusableElement().focus())}}wireBeans(e){this.pagination=e.pagination}postConstruct(){this.addManagedPropertyListener(mp,()=>{this.onPageSizeSelectorValuesChange()}),this.addManagedEventListeners({paginationChanged:e=>this.handlePaginationChanged(e)})}handlePaginationChanged(e){if(!this.selectPageSizeComp||!(e!=null&&e.newPageSize))return;const t=this.pagination.getPageSize();this.getPageSizeSelectorValues().includes(t)?this.selectPageSizeComp.setValue(t.toString()):this.hasEmptyOption?this.selectPageSizeComp.setValue(""):this.toggleSelectDisplay(!0)}toggleSelectDisplay(e){this.selectPageSizeComp&&!e&&this.reset(),e&&(this.reloadPageSizesSelector(),this.selectPageSizeComp)}reset(){ks(this.getGui()),this.selectPageSizeComp&&(this.selectPageSizeComp=this.destroyBean(this.selectPageSizeComp))}onPageSizeSelectorValuesChange(){this.selectPageSizeComp&&this.shouldShowPageSizeSelector()&&this.reloadPageSizesSelector()}shouldShowPageSizeSelector(){return this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel")&&!this.gos.get("paginationAutoPageSize")&&this.gos.get(mp)!==!1}reloadPageSizesSelector(){const e=this.getPageSizeSelectorValues(),t=this.pagination.getPageSize(),n=!t||!e.includes(t);if(n){const o=this.gos.exists("paginationPageSize"),r=this.gos.get(mp)!==!0;Je(94,{pageSizeSet:o,pageSizesSet:r,pageSizeOptions:e,paginationPageSizeOption:t}),r||Je(95,{paginationPageSizeOption:t,paginationPageSizeSelector:mp}),e.unshift("")}const s=String(n?"":t);this.selectPageSizeComp?(il(this.pageSizeOptions,e)||(this.selectPageSizeComp.clearOptions().addOptions(this.createPageSizeSelectOptions(e)),this.pageSizeOptions=e),this.selectPageSizeComp.setValue(s,!0)):this.createPageSizeSelectorComp(e,s),this.hasEmptyOption=n}createPageSizeSelectOptions(e){return e.map(t=>({value:String(t)}))}createPageSizeSelectorComp(e,t){const n=this.getLocaleTextFunc(),s=n("pageSizeSelectorLabel","Page Size:"),o=n("ariaPageSizeSelectorLabel","Page Size");this.selectPageSizeComp=this.createManagedBean(new r0).addOptions(this.createPageSizeSelectOptions(e)).setValue(t).setAriaLabel(o).setLabel(s).onValueChange(()=>this.handlePageSizeItemSelected()),this.appendChild(this.selectPageSizeComp)}getPageSizeSelectorValues(){const e=[20,50,100],t=this.gos.get(mp);return!Array.isArray(t)||!(t!=null&&t.length)?e:[...t].sort((n,s)=>n-s)}destroy(){this.toggleSelectDisplay(!1),super.destroy()}},Vwe={selector:"AG-PAGE-SIZE-SELECTOR",component:Lwe},Bwe=".ag-paging-panel{align-items:center;border-top:var(--ag-footer-row-border);display:flex;gap:calc(var(--ag-spacing)*4);height:var(--ag-pagination-panel-height);justify-content:flex-end;padding:0 var(--ag-cell-horizontal-padding)}:where(.ag-paging-page-size) .ag-wrapper{min-width:50px}.ag-paging-page-summary-panel{align-items:center;display:flex;gap:var(--ag-cell-widget-spacing);.ag-disabled &{pointer-events:none}}.ag-paging-button{cursor:pointer;position:relative;&.ag-disabled{cursor:default;opacity:.5}}.ag-paging-number,.ag-paging-row-summary-panel-number{font-weight:500}",$we=class extends HV{constructor(){super(),this.btFirst=ut,this.btPrevious=ut,this.btNext=ut,this.btLast=ut,this.lbRecordCount=ut,this.lbFirstRowOnPage=ut,this.lbLastRowOnPage=ut,this.lbCurrent=ut,this.lbTotal=ut,this.pageSizeComp=ut,this.previousAndFirstButtonsDisabled=!1,this.nextButtonDisabled=!1,this.lastButtonDisabled=!1,this.areListenersSetup=!1,this.allowFocusInnerElement=!1,this.registerCSS(Bwe)}wireBeans(e){this.rowModel=e.rowModel,this.pagination=e.pagination,this.ariaAnnounce=e.ariaAnnounce}postConstruct(){const e=this.gos.get("enableRtl");this.setTemplate(this.getTemplate(),[Vwe]);const{btFirst:t,btPrevious:n,btNext:s,btLast:o}=this;this.activateTabIndex([t,n,s,o]),t.insertAdjacentElement("afterbegin",hr(e?"last":"first",this.beans)),n.insertAdjacentElement("afterbegin",hr(e?"next":"previous",this.beans)),s.insertAdjacentElement("afterbegin",hr(e?"previous":"next",this.beans)),o.insertAdjacentElement("afterbegin",hr(e?"first":"last",this.beans)),this.addManagedPropertyListener("pagination",this.onPaginationChanged.bind(this)),this.addManagedPropertyListener("suppressPaginationPanel",this.onPaginationChanged.bind(this)),this.addManagedPropertyListeners(["paginationPageSizeSelector","paginationAutoPageSize","suppressPaginationPanel"],()=>this.onPageSizeRelatedOptionsChange()),this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector()),this.initialiseTabGuard({onTabKeyDown:()=>{},focusInnerElement:r=>this.allowFocusInnerElement?this.tabGuardFeature.getTabGuardCtrl().focusInnerElement(r):Mle(this.beans,r),forceFocusOutWhenTabGuardsAreEmpty:!0}),this.onPaginationChanged()}setAllowFocus(e){this.allowFocusInnerElement=e}onPaginationChanged(){const t=this.gos.get("pagination")&&!this.gos.get("suppressPaginationPanel");this.setDisplayed(t),t&&(this.setupListeners(),this.enableOrDisableButtons(),this.updateLabels(),this.onPageSizeRelatedOptionsChange())}onPageSizeRelatedOptionsChange(){this.pageSizeComp.toggleSelectDisplay(this.pageSizeComp.shouldShowPageSizeSelector())}setupListeners(){if(!this.areListenersSetup){this.addManagedEventListeners({paginationChanged:this.onPaginationChanged.bind(this)});for(const e of[{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)}]){const{el:t,fn:n}=e;this.addManagedListeners(t,{click:n,keydown:s=>{(s.key===Oe.ENTER||s.key===Oe.SPACE)&&(s.preventDefault(),n())}})}Ole(this.beans,this,this.getGui()),this.areListenersSetup=!0}}onBtFirst(){this.previousAndFirstButtonsDisabled||this.pagination.goToFirstPage()}formatNumber(e){const t=this.gos.getCallback("paginationNumberFormatter");return t?t({value:e}):bge(e,this.getLocaleTextFunc.bind(this))}getTemplate(){const e=this.getLocaleTextFunc(),t=`ag-${this.getCompId()}`;return{tag:"div",cls:"ag-paging-panel ag-unselectable",attrs:{id:`${t}`},children:[{tag:"ag-page-size-selector",ref:"pageSizeComp"},{tag:"span",cls:"ag-paging-row-summary-panel",children:[{tag:"span",ref:"lbFirstRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-first-row`}},{tag:"span",attrs:{id:`${t}-to`},children:e("to","to")},{tag:"span",ref:"lbLastRowOnPage",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-last-row`}},{tag:"span",attrs:{id:`${t}-of`},children:e("of","of")},{tag:"span",ref:"lbRecordCount",cls:"ag-paging-row-summary-panel-number",attrs:{id:`${t}-row-count`}}]},{tag:"span",cls:"ag-paging-page-summary-panel",role:"presentation",children:[{tag:"div",ref:"btFirst",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("firstPage","First Page")}},{tag:"div",ref:"btPrevious",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("previousPage","Previous Page")}},{tag:"span",cls:"ag-paging-description",children:[{tag:"span",attrs:{id:`${t}-start-page`},children:e("page","Page")},{tag:"span",ref:"lbCurrent",cls:"ag-paging-number",attrs:{id:`${t}-start-page-number`}},{tag:"span",attrs:{id:`${t}-of-page`},children:e("of","of")},{tag:"span",ref:"lbTotal",cls:"ag-paging-number",attrs:{id:`${t}-of-page-number`}}]},{tag:"div",ref:"btNext",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("nextPage","Next Page")}},{tag:"div",ref:"btLast",cls:"ag-button ag-paging-button",role:"button",attrs:{"aria-label":e("lastPage","Last Page")}}]}]}}onBtNext(){this.nextButtonDisabled||this.pagination.goToNextPage()}onBtPrevious(){this.previousAndFirstButtonsDisabled||this.pagination.goToPreviousPage()}onBtLast(){this.lastButtonDisabled||this.pagination.goToLastPage()}enableOrDisableButtons(){const e=this.pagination.getCurrentPage(),t=this.rowModel.isLastRowIndexKnown(),n=this.pagination.getTotalPages();this.previousAndFirstButtonsDisabled=e===0,this.toggleButtonDisabled(this.btFirst,this.previousAndFirstButtonsDisabled),this.toggleButtonDisabled(this.btPrevious,this.previousAndFirstButtonsDisabled);const s=this.isZeroPagesToDisplay(),o=e===n-1;this.nextButtonDisabled=o||s,this.lastButtonDisabled=!t||s||e===n-1,this.toggleButtonDisabled(this.btNext,this.nextButtonDisabled),this.toggleButtonDisabled(this.btLast,this.lastButtonDisabled)}toggleButtonDisabled(e,t){Yse(e,t),e.classList.toggle("ag-disabled",t)}isZeroPagesToDisplay(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages();return e&&t===0}updateLabels(){const e=this.rowModel.isLastRowIndexKnown(),t=this.pagination.getTotalPages(),n=this.pagination.getMasterRowCount(),s=e?n:null,o=this.pagination.getCurrentPage(),r=this.pagination.getPageSize();let i,a;this.isZeroPagesToDisplay()?i=a=0:(i=r*o+1,a=i+r-1,e&&a>s&&(a=s));const l=i+r-1,c=!e&&n<l,u=this.formatNumber(i);this.lbFirstRowOnPage.textContent=u;let d;const h=this.getLocaleTextFunc();c?d=h("pageLastRowUnknown","?"):d=this.formatNumber(a),this.lbLastRowOnPage.textContent=d;const p=t>0?o+1:0,g=this.formatNumber(p);this.lbCurrent.textContent=g;let v,C;if(e)v=this.formatNumber(t),C=this.formatNumber(s);else{const S=h("more","more");v=S,C=S}this.lbTotal.textContent=v,this.lbRecordCount.textContent=C,this.announceAriaStatus(u,d,C,g,v)}announceAriaStatus(e,t,n,s,o){var d,h;const r=this.getLocaleTextFunc(),i=r("page","Page"),a=r("to","to"),l=r("of","of"),c=`${e} ${a} ${t} ${l} ${n}`,u=`${i} ${s} ${l} ${o}`;c!==this.ariaRowStatus&&(this.ariaRowStatus=c,(d=this.ariaAnnounce)==null||d.announceValue(c,"paginationRow")),u!==this.ariaPageStatus&&(this.ariaPageStatus=u,(h=this.ariaAnnounce)==null||h.announceValue(u,"paginationPage"))}},Hwe={selector:"AG-PAGINATION",component:$we},Gwe=class extends We{constructor(){super(...arguments),this.beanName="pagination",this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=0,this.masterRowCount=0}postConstruct(){const e=this.gos;this.active=e.get("pagination"),this.pageSizeFromGridOptions=e.get("paginationPageSize"),this.paginateChildRows=this.isPaginateChildRows(),this.addManagedPropertyListener("pagination",this.onPaginationGridOptionChanged.bind(this)),this.addManagedPropertyListener("paginationPageSize",this.onPageSizeGridOptionChanged.bind(this))}getPaginationSelector(){return Hwe}isPaginateChildRows(){const e=this.gos;return e.get("groupHideParentOfSingleChild")||e.get("groupRemoveSingleChildren")||e.get("groupRemoveLowestSingleChildren")?!0:e.get("paginateChildRows")}onPaginationGridOptionChanged(){this.active=this.gos.get("pagination"),this.calculatePages(),this.dispatchPaginationChangedEvent({keepRenderedRows:!0})}onPageSizeGridOptionChanged(){this.setPageSize(this.gos.get("paginationPageSize"),"gridOptions")}goToPage(e){const t=this.currentPage;if(!this.active||t===e||typeof t!="number")return;const{editSvc:n}=this.beans;n!=null&&n.isEditing()&&(n.isBatchEditing()?n.cleanupEditors():n.stopEditing(void 0,{source:"api"})),this.currentPage=e,this.calculatePages(),this.dispatchPaginationChangedEvent({newPage:!0})}goToPageWithIndex(e){var n,s;if(!this.active)return;let t=e;this.paginateChildRows||(t=((s=(n=this.beans.rowModel).getTopLevelIndexFromDisplayedIndex)==null?void 0:s.call(n,e))??e),this.goToPage(Math.floor(t/this.pageSize))}isRowInPage(e){return this.active?e>=this.topDisplayedRowIndex&&e<=this.bottomDisplayedRowIndex:!0}getCurrentPage(){return this.currentPage}goToNextPage(){this.goToPage(this.currentPage+1)}goToPreviousPage(){this.goToPage(this.currentPage-1)}goToFirstPage(){this.goToPage(0)}goToLastPage(){const e=this.beans.rowModel.getRowCount(),t=Math.floor(e/this.pageSize);this.goToPage(t)}getPageSize(){return this.pageSize}getTotalPages(){return this.totalPages}setPage(e){this.currentPage=e}get pageSize(){return dt(this.pageSizeAutoCalculated)&&this.gos.get("paginationAutoPageSize")?this.pageSizeAutoCalculated:dt(this.pageSizeFromPageSizeSelector)?this.pageSizeFromPageSizeSelector:dt(this.pageSizeFromInitialState)?this.pageSizeFromInitialState:dt(this.pageSizeFromGridOptions)?this.pageSizeFromGridOptions:this.defaultPageSize}calculatePages(){this.active?this.paginateChildRows?this.calculatePagesAllRows():this.calculatePagesMasterRowsOnly():this.calculatedPagesNotActive(),this.beans.pageBounds.calculateBounds(this.topDisplayedRowIndex,this.bottomDisplayedRowIndex)}unsetAutoCalculatedPageSize(){if(this.pageSizeAutoCalculated===void 0)return;const e=this.pageSizeAutoCalculated;this.pageSizeAutoCalculated=void 0,this.pageSize!==e&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0}))}setPageSize(e,t){const n=this.pageSize;switch(t){case"autoCalculated":this.pageSizeAutoCalculated=e;break;case"pageSizeSelector":this.pageSizeFromPageSizeSelector=e,this.currentPage!==0&&this.goToFirstPage();break;case"initialState":this.pageSizeFromInitialState=e;break;case"gridOptions":this.pageSizeFromGridOptions=e,this.pageSizeFromInitialState=void 0,this.pageSizeFromPageSizeSelector=void 0,this.currentPage!==0&&this.goToFirstPage();break}n!==this.pageSize&&(this.calculatePages(),this.dispatchPaginationChangedEvent({newPageSize:!0,keepRenderedRows:!0}))}setZeroRows(){this.masterRowCount=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=-1,this.currentPage=0,this.totalPages=0}adjustCurrentPageIfInvalid(){const e=this.totalPages;this.currentPage>=e&&(this.currentPage=e-1);const t=this.currentPage;(!isFinite(t)||isNaN(t)||t<0)&&(this.currentPage=0)}calculatePagesMasterRowsOnly(){const e=this.beans.rowModel,t=e.getTopLevelRowCount();if(this.masterRowCount=t,t<=0){this.setZeroRows();return}const n=this.pageSize,s=t-1;this.totalPages=Math.floor(s/n)+1,this.adjustCurrentPageIfInvalid();const o=this.currentPage,r=n*o;let i=n*(o+1)-1;if(i>s&&(i=s),this.topDisplayedRowIndex=e.getTopLevelRowDisplayedIndex(r),i===s)this.bottomDisplayedRowIndex=e.getRowCount()-1;else{const a=e.getTopLevelRowDisplayedIndex(i+1);this.bottomDisplayedRowIndex=a-1}}getMasterRowCount(){return this.masterRowCount}calculatePagesAllRows(){const e=this.beans.rowModel.getRowCount();if(this.masterRowCount=e,e===0){this.setZeroRows();return}const{pageSize:t,currentPage:n}=this,s=e-1;this.totalPages=Math.floor(s/t)+1,this.adjustCurrentPageIfInvalid(),this.topDisplayedRowIndex=t*n,this.bottomDisplayedRowIndex=t*(n+1)-1,this.bottomDisplayedRowIndex>s&&(this.bottomDisplayedRowIndex=s)}calculatedPagesNotActive(){this.setPageSize(void 0,"autoCalculated"),this.totalPages=1,this.currentPage=0,this.topDisplayedRowIndex=0,this.bottomDisplayedRowIndex=this.beans.rowModel.getRowCount()-1}dispatchPaginationChangedEvent(e){const{keepRenderedRows:t=!1,newPage:n=!1,newPageSize:s=!1}=e;this.eventSvc.dispatchEvent({type:"paginationChanged",animate:!1,newData:!1,newPage:n,newPageSize:s,keepRenderedRows:t})}},Uwe={moduleName:"Pagination",version:ct,beans:[Gwe,Mwe],icons:{first:"first",previous:"previous",next:"next",last:"last"},apiFunctions:{paginationIsLastPageFound:Rwe,paginationGetPageSize:Dwe,paginationGetCurrentPage:Twe,paginationGetTotalPages:Iwe,paginationGetRowCount:xwe,paginationGoToNextPage:Fwe,paginationGoToPreviousPage:Pwe,paginationGoToFirstPage:Awe,paginationGoToLastPage:kwe,paginationGoToPage:Owe},dependsOn:[Ey]};function Wwe(e,t={}){const n=t?t.rowNodes:void 0;e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.redrawRows(n))}function PB(e,t,n,s,o){t&&(s&&t.parent&&t.parent.level!==-1&&PB(e,t.parent,n,s,o),t.setExpanded(n,void 0,o))}function zwe(e,t){return e.rowModel.getRowNode(t)}function jwe(e,t,n,s){e.rowRenderer.addRenderedRowListener(t,n,s)}function Kwe(e){return e.rowRenderer.getRenderedNodes()}function qwe(e,t,n){e.rowModel.forEachNode(t,n)}function Ywe(e){return e.rowRenderer.firstRenderedRow}function Zwe(e){return e.rowRenderer.lastRenderedRow}function Xwe(e,t){return e.rowModel.getRow(t)}function Jwe(e){return e.rowModel.getRowCount()}var Qwe={moduleName:"RowApi",version:ct,apiFunctions:{redrawRows:Wwe,setRowNodeExpanded:PB,getRowNode:zwe,addRenderedRowListener:jwe,getRenderedNodes:Kwe,forEachNode:qwe,getFirstDisplayedRowIndex:Ywe,getLastDisplayedRowIndex:Zwe,getDisplayedRowAtIndex:Xwe,getDisplayedRowCount:Jwe}},eCe={moduleName:"ScrollApi",version:ct,apiFunctions:{getVerticalPixelRange:fve,getHorizontalPixelRange:pve,ensureColumnVisible:hB,ensureIndexVisible:fB,ensureNodeVisible:gve}};function tCe(e,t,n){if(!t)return;const s=e.ctrlsSvc.getGridBodyCtrl().eGridBody,o=`aria-${t}`;n===null?s.removeAttribute(o):s.setAttribute(o,n)}function nCe(e,t={}){e.frameworkOverrides.wrapIncoming(()=>e.rowRenderer.refreshCells(t))}function sCe(e){e.frameworkOverrides.wrapIncoming(()=>{for(const t of e.ctrlsSvc.getHeaderRowContainerCtrls())t.refresh()})}function oCe(e){var t;return((t=e.animationFrameSvc)==null?void 0:t.isQueueEmpty())??!0}function rCe(e){var t;(t=e.animationFrameSvc)==null||t.flushAllFrames()}function iCe(e){return{rowHeight:vc(e),headerHeight:sp(e)}}function aCe(e,t={}){var r;const n=[];for(const i of e.rowRenderer.getCellCtrls(t.rowNodes,t.columns)){const a=i.getCellRenderer();a!=null&&n.push(ep(a))}if((r=t.columns)!=null&&r.length)return n;const s=[],o=n_(t.rowNodes);for(const i of e.rowRenderer.getAllRowCtrls()){if(o&&!s_(i.rowNode,o)||!i.isFullWidth())continue;const a=i.getFullWidthCellRenderers();for(let l=0;l<a.length;l++){const c=a[l];c!=null&&s.push(ep(c))}}return[...s,...n]}var lCe={moduleName:"RenderApi",version:ct,apiFunctions:{setGridAriaProperty:tCe,refreshCells:nCe,refreshHeader:sCe,isAnimationFrameQueueEmpty:oCe,flushAllAnimationFrames:rCe,getSizesForCurrentTheme:iCe,getCellRendererInstances:aCe}};function cCe(e,t){var n,s;typeof t=="number"?(n=e.colAutosize)==null||n.sizeColumnsToFit(t,"api"):(s=e.colAutosize)==null||s.sizeColumnsToFitGridBody(t)}function AB({colAutosize:e,visibleCols:t},n,s){Array.isArray(n)?e==null||e.autoSizeCols({colKeys:n,skipHeader:s,source:"api"}):e==null||e.autoSizeCols({...n,colKeys:n.colIds??t.allCols,source:"api"})}function uCe(e,t){var n;t&&typeof t=="object"?AB(e,t):(n=e.colAutosize)==null||n.autoSizeAllColumns({source:"api",skipHeader:t})}var dCe=class extends We{constructor(){super(...arguments),this.beanName="colAutosize",this.timesDelayed=0,this.shouldQueueResizeOperations=!1,this.resizeOperationQueue=[]}postConstruct(){var n;const{gos:e}=this,t=e.get("autoSizeStrategy");if(t){let s=!1;const o=t.type;if(o==="fitGridWidth"||o==="fitProvidedWidth")s=!0;else if(o==="fitCellContents"){this.addManagedEventListeners({firstDataRendered:()=>this.onFirstDataRendered(t)});const r=e.get("rowData");s=r!=null&&r.length>0&&os(e)}s&&((n=this.beans.colDelayRenderSvc)==null||n.hideColumns(o))}}autoSizeCols(e){const{eventSvc:t,visibleCols:n}=this.beans;this.innerAutoSizeCols(e).then(s=>{var c;const o=u=>pd(t,Array.from(u),!0,"autosizeColumns");if(!e.scaleUpToFitGridWidth)return o(s);const r=kB(this.beans),i=u=>n.leftCols.some(d=>Xf(d,u)),a=u=>n.rightCols.some(d=>Xf(d,u)),l=e.colKeys.filter(u=>!ua(u)&&!da(u)&&!i(u)&&!a(u));this.sizeColumnsToFit(r,e.source,!0,{defaultMaxWidth:e.defaultMaxWidth,defaultMinWidth:e.defaultMinWidth,columnLimits:(c=e.columnLimits)==null?void 0:c.map(u=>({...u,key:u.colId})),colKeys:l,onlyScaleUp:!0}),o(s)})}innerAutoSizeCols(e){return new Promise((t,n)=>{if(this.shouldQueueResizeOperations)return this.pushResizeOperation(()=>this.innerAutoSizeCols(e).then(t,n));const{colKeys:s,skipHeader:o,skipHeaderGroups:r,stopAtGroup:i,defaultMaxWidth:a,defaultMinWidth:l,columnLimits:c=[],source:u="api"}=e,{animationFrameSvc:d,renderStatus:h,colModel:f,autoWidthCalc:p,visibleCols:g}=this.beans;if(d==null||d.flushAllFrames(),this.timesDelayed<5&&h&&(!h.areHeaderCellsRendered()||!h.areCellsRendered())){this.timesDelayed++,setTimeout(()=>{this.isAlive()&&this.innerAutoSizeCols(e).then(t,n)});return}this.timesDelayed=0;const v=new Set;let C=-1;const S=Object.fromEntries(c.map(({colId:D,...R})=>[D,R])),b=o??this.gos.get("skipHeaderOnAutoSize"),w=r??b;for(;C!==0;){C=0;const D=[];for(const R of s){if(!R||lre(R))continue;const T=f.getCol(R);if(!T||v.has(T))continue;const I=p.getPreferredWidthForColumn(T,b);if(I>0){const x=S[T.colId]??{};x.minWidth??(x.minWidth=l),x.maxWidth??(x.maxWidth=a);const F=hCe(T,I,x);T.setActualWidth(F,u),v.add(T),C++}D.push(T)}D.length&&g.refresh(u)}w||this.autoSizeColumnGroupsByColumns(s,u,i),t(v)})}autoSizeColumn(e,t,n){this.autoSizeCols({colKeys:[e],skipHeader:n,skipHeaderGroups:!0,source:t})}autoSizeColumnGroupsByColumns(e,t,n){const{colModel:s,ctrlsSvc:o}=this.beans,r=new Set,i=s.getColsForKeys(e);for(const l of i){let c=l.getParent();for(;c&&c!=n;)c.isPadding()||r.add(c),c=c.getParent()}let a;for(const l of r){for(const c of o.getHeaderRowContainerCtrls())if(a=c.getHeaderCtrlForColumn(l),a)break;a==null||a.resizeLeafColumnsToFit(t)}}autoSizeAllColumns(e){if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.autoSizeAllColumns(e));return}this.autoSizeCols({colKeys:this.beans.visibleCols.allCols,...e})}addColumnAutosizeListeners(e,t){const n=this.gos.get("skipHeaderOnAutoSize"),s=()=>{this.autoSizeColumn(t,"uiColumnResized",n)};e.addEventListener("dblclick",s);const o=new Tc(e);return o.addEventListener("doubleTap",s),()=>{e.removeEventListener("dblclick",s),o.destroy()}}addColumnGroupResize(e,t,n){const s=this.gos.get("skipHeaderOnAutoSize"),o=()=>{const r=[],i=t.getDisplayedLeafColumns();for(const a of i)a.getColDef().suppressAutoSize||r.push(a.getColId());r.length>0&&this.autoSizeCols({colKeys:r,skipHeader:s,stopAtGroup:t,source:"uiColumnResized"}),n()};return e.addEventListener("dblclick",o),()=>e.removeEventListener("dblclick",o)}sizeColumnsToFitGridBody(e,t){if(!this.isAlive())return;const n=kB(this.beans);if(n>0){this.sizeColumnsToFit(n,"sizeColumnsToFit",!1,e);return}t===void 0?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,100)},0):t===100?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,500)},100):t===500?window.setTimeout(()=>{this.sizeColumnsToFitGridBody(e,-1)},500):Je(29)}sizeColumnsToFit(e,t="sizeColumnsToFit",n,s){var p,g;if(this.shouldQueueResizeOperations){this.pushResizeOperation(()=>this.sizeColumnsToFit(e,t,n,s));return}const o={};for(const{key:v,...C}of(s==null?void 0:s.columnLimits)??[])o[typeof v=="string"?v:v.getColId()]=C;const r=this.beans.visibleCols.allCols;if(e<=0||!r.length)return;const i=ca(r);if(s!=null&&s.onlyScaleUp&&i>e||e===i&&r.every(C=>{if(C.colDef.suppressSizeToFit)return!0;const S=o==null?void 0:o[C.getId()],b=(S==null?void 0:S.minWidth)??(s==null?void 0:s.defaultMinWidth),w=(S==null?void 0:S.maxWidth)??(s==null?void 0:s.defaultMaxWidth),D=C.getActualWidth();return(b==null||D>=b)&&(w==null||D<=w)}))return;const l=[],c=[];for(const v of r){const C=((p=s==null?void 0:s.colKeys)==null?void 0:p.some(S=>Xf(v,S)))??!0;v.getColDef().suppressSizeToFit||!C?c.push(v):l.push(v)}const u=l.slice(0);let d=!1;const h=v=>{$r(l,v),c.push(v)};for(const v of l){v.resetActualWidth(t);const C=o==null?void 0:o[v.getId()],S=(C==null?void 0:C.minWidth)??(s==null?void 0:s.defaultMinWidth),b=(C==null?void 0:C.maxWidth)??(s==null?void 0:s.defaultMaxWidth),w=v.getActualWidth();typeof S=="number"&&w<S?v.setActualWidth(S,t,!0):typeof b=="number"&&w>b&&v.setActualWidth(b,t,!0)}for(;!d;){d=!0;const v=e-ca(c);if(v<=0)for(const C of l){const S=((g=o==null?void 0:o[C.getId()])==null?void 0:g.minWidth)??(s==null?void 0:s.defaultMinWidth)??C.minWidth;C.setActualWidth(S,t,!0)}else{const C=v/ca(l);let S=v;for(let b=l.length-1;b>=0;b--){const w=l[b],D=o==null?void 0:o[w.getId()],R=(D==null?void 0:D.minWidth)??(s==null?void 0:s.defaultMinWidth),T=(D==null?void 0:D.maxWidth)??(s==null?void 0:s.defaultMaxWidth),I=w.getMinWidth(),x=w.getMaxWidth(),F=typeof R=="number"&&R>I?R:I,E=typeof T=="number"&&T<x?T:x;let A=Math.round(w.getActualWidth()*C);A<F?(A=F,h(w),d=!1):A>E?(A=E,h(w),d=!1):b===0&&(A=S),w.setActualWidth(A,t,!0),S-=A}}}for(const v of u)v.fireColumnWidthChangedEvent(t);const f=this.beans.visibleCols;f.setLeftValues(t),f.updateBodyWidths(),!n&&pd(this.eventSvc,u,!0,t)}applyAutosizeStrategy(){const{gos:e,colDelayRenderSvc:t}=this.beans,n=e.get("autoSizeStrategy");(n==null?void 0:n.type)!=="fitGridWidth"&&(n==null?void 0:n.type)!=="fitProvidedWidth"||setTimeout(()=>{if(!this.isAlive())return;const s=n.type;if(s==="fitGridWidth"){const{columnLimits:o,defaultMinWidth:r,defaultMaxWidth:i}=n,a=o==null?void 0:o.map(({colId:l,minWidth:c,maxWidth:u})=>({key:l,minWidth:c,maxWidth:u}));this.sizeColumnsToFitGridBody({defaultMinWidth:r,defaultMaxWidth:i,columnLimits:a})}else s==="fitProvidedWidth"&&this.sizeColumnsToFit(n.width,"sizeColumnsToFit");t==null||t.revealColumns(s)})}onFirstDataRendered({colIds:e,...t}){setTimeout(()=>{var s;if(!this.isAlive())return;const n="autosizeColumns";e?this.autoSizeCols({...t,source:n,colKeys:e}):this.autoSizeAllColumns({...t,source:n}),(s=this.beans.colDelayRenderSvc)==null||s.revealColumns(t.type)})}processResizeOperations(){this.shouldQueueResizeOperations=!1;for(const e of this.resizeOperationQueue)e();this.resizeOperationQueue=[]}pushResizeOperation(e){this.resizeOperationQueue.push(e)}destroy(){this.resizeOperationQueue.length=0,super.destroy()}};function hCe(e,t,n={}){const s=n.minWidth??e.getMinWidth();t<s&&(t=s);const o=n.maxWidth??e.getMaxWidth();return t>o&&(t=o),t}function kB({ctrlsSvc:e,scrollVisibleSvc:t}){const n=e.getGridBodyCtrl(),o=n.isVerticalScrollShowing()?t.getScrollbarWidth():0;return Bf(n.eGridBody)-o}var fCe={moduleName:"ColumnAutoSize",version:ct,beans:[dCe],apiFunctions:{sizeColumnsToFit:cCe,autoSizeColumns:AB,autoSizeAllColumns:uCe},dependsOn:[o2]},pCe=".ag-row-pinned-source{background-color:var(--ag-pinned-source-row-background-color);color:var(--ag-pinned-source-row-text-color);font-weight:var(--ag-pinned-source-row-font-weight)}.ag-row-pinned-manual{background-color:var(--ag-pinned-row-background-color);color:var(--ag-pinned-row-text-color);font-weight:var(--ag-pinned-row-font-weight)}";function gCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedTopRowCount())??0}function mCe(e){var t;return((t=e.pinnedRowModel)==null?void 0:t.getPinnedBottomRowCount())??0}function vCe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedTopRow(t)}function yCe(e,t){var n;return(n=e.pinnedRowModel)==null?void 0:n.getPinnedBottomRow(t)}function wCe(e,t,n){var s;return(s=e.pinnedRowModel)==null?void 0:s.forEachPinnedRow(t,n)}var CCe={moduleName:"PinnedRow",version:ct,beans:[vce],css:[pCe],apiFunctions:{getPinnedTopRowCount:gCe,getPinnedBottomRowCount:mCe,getPinnedTopRow:vCe,getPinnedBottomRow:yCe,forEachPinnedRow:wCe},icons:{rowPin:"pin",rowPinTop:"pinned-top",rowPinBottom:"pinned-bottom",rowUnpin:"un-pin"}},bCe=class{constructor(e,t){this.col=e,this.firstNode=t,this.cellSpan=!0,this.spannedNodes=new Set,this.addSpannedNode(t)}reset(){this.spannedNodes.clear(),this.addSpannedNode(this.firstNode)}addSpannedNode(e){this.spannedNodes.add(e),this.lastNode=e}getLastNode(){return this.lastNode}getCellHeight(){return this.lastNode.rowTop+this.lastNode.rowHeight-this.firstNode.rowTop-1}doesSpanContain(e){return e.column!==this.col||e.rowPinned!=this.firstNode.rowPinned?!1:this.firstNode.rowIndex<=e.rowIndex&&e.rowIndex<=this.lastNode.rowIndex}getLastNodeAutoHeight(){var n;const e=(n=this.firstNode.__autoHeights)==null?void 0:n[this.col.getColId()];if(e==null)return;let t=0;for(const s of this.spannedNodes)s!==this.lastNode&&(t+=s.rowHeight);return e-t}},SCe=class extends We{constructor(e){super(),this.column=e}buildCache(e){var b;const{column:t,beans:{gos:n,pinnedRowModel:s,rowModel:o,valueSvc:r,pagination:i}}=this,{colDef:a}=t,l=this.getNodeMap(e),c=new Map,u=n.getCallback("isFullWidthRow"),d=a.equals,h=a.spanRows,f=typeof h=="function";let p=null,g=null,v;const C=(w,D)=>{p=w,g=null,v=D},S=w=>{const D=!w.isExpandable()&&!w.group&&!w.detail&&(u?!u({rowNode:w}):!0);if(w.rowIndex==null||!D){C(null,null);return}if(p==null||w.level!==p.level||w.footer||g&&w.rowIndex-1!==(g==null?void 0:g.getLastNode().rowIndex)){C(w,r.getValue(t,w));return}const R=r.getValue(t,w);if(f){const T=Ft(n,{valueA:v,nodeA:p,valueB:R,nodeB:w,column:t,colDef:a});if(!h(T)){C(w,R);return}}else if(d?!d(v,R):v!==R){C(w,R);return}if(!g){const T=l==null?void 0:l.get(p);(T==null?void 0:T.firstNode)===p?(T.reset(),g=T):g=new bCe(t,p),c.set(p,g)}g.addSpannedNode(w),c.set(w,g)};switch(e){case"center":(b=o.forEachDisplayedNode)==null||b.call(o,w=>{(!i||i.isRowInPage(w.rowIndex))&&S(w)}),this.centerValueNodeMap=c;break;case"top":s==null||s.forEachPinnedRow("top",S),this.topValueNodeMap=c;break;case"bottom":s==null||s.forEachPinnedRow("bottom",S),this.bottomValueNodeMap=c;break}}isCellSpanning(e){return!!this.getCellSpan(e)}getCellSpan(e){return this.getNodeMap(e.rowPinned).get(e)}getNodeMap(e){switch(e){case"top":return this.topValueNodeMap;case"bottom":return this.bottomValueNodeMap;default:return this.centerValueNodeMap}}},ECe=class extends We{constructor(){super(...arguments),this.beanName="rowSpanSvc",this.spanningColumns=new Map,this.debouncePinnedEvent=Os(this,this.dispatchCellsUpdatedEvent.bind(this,!0),0),this.debounceModelEvent=Os(this,this.dispatchCellsUpdatedEvent.bind(this,!1),0),this.pinnedTimeout=null,this.modelTimeout=null}postConstruct(){const e=this.onRowDataUpdated.bind(this),t=this.buildPinnedCaches.bind(this);this.addManagedEventListeners({paginationChanged:this.buildModelCaches.bind(this),pinnedRowDataChanged:t,pinnedRowsChanged:t,rowNodeDataChanged:e,cellValueChanged:e})}register(e){const{gos:t}=this.beans;if(!t.get("enableCellSpan")||this.spanningColumns.has(e))return;const n=this.createManagedBean(new SCe(e));this.spanningColumns.set(e,n),n.buildCache("top"),n.buildCache("bottom"),n.buildCache("center"),this.debouncePinnedEvent(),this.debounceModelEvent()}dispatchCellsUpdatedEvent(e){this.dispatchLocalEvent({type:"spannedCellsUpdated",pinned:e})}deregister(e){this.spanningColumns.delete(e)}onRowDataUpdated({node:e}){const{spannedRowRenderer:t}=this.beans;if(e.rowPinned){if(this.pinnedTimeout!=null)return;this.pinnedTimeout=window.setTimeout(()=>{this.pinnedTimeout=null,this.buildPinnedCaches(),t==null||t.createCtrls("top"),t==null||t.createCtrls("bottom")},0);return}this.modelTimeout==null&&(this.modelTimeout=window.setTimeout(()=>{this.modelTimeout=null,this.buildModelCaches(),t==null||t.createCtrls("center")},0))}buildModelCaches(){this.modelTimeout!=null&&clearTimeout(this.modelTimeout),this.spanningColumns.forEach(e=>e.buildCache("center")),this.debounceModelEvent()}buildPinnedCaches(){this.pinnedTimeout!=null&&clearTimeout(this.pinnedTimeout),this.spanningColumns.forEach(e=>{e.buildCache("top"),e.buildCache("bottom")}),this.debouncePinnedEvent()}isCellSpanning(e,t){const n=this.spanningColumns.get(e);return n?n.isCellSpanning(t):!1}getCellSpanByPosition(e){const{pinnedRowModel:t,rowModel:n}=this.beans,s=e.column,o=e.rowIndex,r=this.spanningColumns.get(s);if(!r)return;let i;switch(e.rowPinned){case"top":i=t==null?void 0:t.getPinnedTopRow(o);break;case"bottom":i=t==null?void 0:t.getPinnedBottomRow(o);break;default:i=n.getRow(o)}if(i)return r.getCellSpan(i)}getCellStart(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.firstNode.rowIndex}:e}getCellEnd(e){const t=this.getCellSpanByPosition(e);return t?{...e,rowIndex:t.getLastNode().rowIndex}:e}getCellSpan(e,t){const n=this.spanningColumns.get(e);if(n)return n.getCellSpan(t)}forEachSpannedColumn(e,t){for(const[n,s]of this.spanningColumns)if(s.isCellSpanning(e)){const o=s.getCellSpan(e);t(n,o)}}destroy(){super.destroy(),this.spanningColumns.clear()}},_Ce=class extends Dd{constructor(e,t,n){super(e.col,e.firstNode,n,t),this.cellSpan=e,this.SPANNED_CELL_CSS_CLASS="ag-spanned-cell"}setComp(e,t,n,s,o,r,i){this.eWrapper=n,super.setComp(e,t,n,s,o,r,i),this.setAriaRowSpan(),this.refreshAriaRowIndex()}isCellSpanning(){return!0}getCellSpan(){return this.cellSpan}refreshAriaRowIndex(){const{eGui:e,rowNode:t}=this;!e||t.rowIndex==null||Rv(e,t.rowIndex)}setAriaRowSpan(){eoe(this.eGui,this.cellSpan.spannedNodes.size)}setFocusedCellPosition(e){this.focusedCellPosition=e}getFocusedCellPosition(){return this.focusedCellPosition??this.cellPosition}checkCellFocused(){const e=this.beans.focusSvc.getFocusedCell();return!!e&&this.cellSpan.doesSpanContain(e)}applyStaticCssClasses(){super.applyStaticCssClasses(),this.comp.toggleCss(this.SPANNED_CELL_CSS_CLASS,!0)}onCellFocused(e){const{beans:t}=this;if(dy(t)){this.focusedCellPosition=void 0;return}const n=this.isCellFocused();n||(this.focusedCellPosition=void 0),e&&n&&(this.focusedCellPosition={rowIndex:e.rowIndex,rowPinned:e.rowPinned,column:e.column}),super.onCellFocused(e)}getRootElement(){return this.eWrapper}},RCe=class extends by{onRowIndexChanged(){super.onRowIndexChanged();for(const e of this.getAllCellCtrls())e.refreshAriaRowIndex()}getInitialRowClasses(e){return["ag-spanned-row"]}getNewCellCtrl(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e,this.rowNode);if(!(!t||t.firstNode!==this.rowNode))return new _Ce(t,this,this.beans)}isCorrectCtrlForSpan(e){var s;const t=(s=this.beans.rowSpanSvc)==null?void 0:s.getCellSpan(e.column,this.rowNode);return!t||t.firstNode!==this.rowNode?!1:e.getCellSpan()===t}onRowHeightChanged(){}refreshFirstAndLastRowStyles(){}addHoverFunctionality(){}resetHoveredStatus(){}},DCe=class extends We{constructor(){super(...arguments),this.beanName="spannedRowRenderer",this.topCtrls=new Map,this.bottomCtrls=new Map,this.centerCtrls=new Map}postConstruct(){this.addManagedEventListeners({displayedRowsChanged:this.createAllCtrls.bind(this)})}createAllCtrls(){this.createCtrls("top"),this.createCtrls("bottom"),this.createCtrls("center")}createCtrls(e){const{rowSpanSvc:t}=this.beans,n=this.getCtrlsMap(e),s=n.size,o=this.getAllRelevantRowControls(e),r=new Map;let i=!1;for(const l of o)l.isAlive()&&(t==null||t.forEachSpannedColumn(l.rowNode,(c,u)=>{if(r.has(u.firstNode))return;const d=n.get(u.firstNode);if(d){r.set(u.firstNode,d),n.delete(u.firstNode);return}i=!0;const h=new RCe(u.firstNode,this.beans,!1,!1,!1);r.set(u.firstNode,h)}));this.setCtrlsMap(e,r);const a=r.size===s;if(!(!i&&a)){for(const l of n.values())l.destroyFirstPass(!0),l.destroySecondPass();this.dispatchLocalEvent({type:"spannedRowsUpdated",ctrlsKey:e})}}getAllRelevantRowControls(e){const{rowRenderer:t}=this.beans;switch(e){case"top":return t.topRowCtrls;case"bottom":return t.bottomRowCtrls;case"center":return t.allRowCtrls}}getCellByPosition(e){const{rowSpanSvc:t}=this.beans,n=t==null?void 0:t.getCellSpanByPosition(e);if(!n)return;const s=this.getCtrlsMap(e.rowPinned).get(n.firstNode);if(s)return s.getAllCellCtrls().find(o=>o.column===e.column)}getCtrls(e){return[...this.getCtrlsMap(e).values()]}destroyRowCtrls(e){for(const t of this.getCtrlsMap(e).values())t.destroyFirstPass(!0),t.destroySecondPass();this.setCtrlsMap(e,new Map)}getCtrlsMap(e){switch(e){case"top":return this.topCtrls;case"bottom":return this.bottomCtrls;default:return this.centerCtrls}}setCtrlsMap(e,t){switch(e){case"top":this.topCtrls=t;break;case"bottom":this.bottomCtrls=t;break;default:this.centerCtrls=t;break}}destroy(){super.destroy(),this.destroyRowCtrls("top"),this.destroyRowCtrls("bottom"),this.destroyRowCtrls("center")}},TCe={moduleName:"CellSpan",version:ct,beans:[ECe,DCe]},ICe=class extends We{constructor(e,t){super(),this.cellCtrl=e,this.staticClasses=[],this.beans=t,this.column=e.column}setComp(e){this.cellComp=e,this.applyUserStyles(),this.applyCellClassRules(),this.applyClassesFromColDef()}applyCellClassRules(){const{column:e,cellComp:t}=this,n=e.colDef,s=n.cellClassRules,o=this.getCellClassParams(e,n);e_(this.beans.expressionSvc,s===this.cellClassRules?void 0:this.cellClassRules,s,o,r=>t.toggleCss(r,!0),r=>t.toggleCss(r,!1)),this.cellClassRules=s}applyUserStyles(){const e=this.column,t=e.colDef,n=t.cellStyle;if(!n)return;let s;if(typeof n=="function"){const o=this.getCellClassParams(e,t);s=n(o)}else s=n;s&&this.cellComp.setUserStyles(s)}applyClassesFromColDef(){const{column:e,cellComp:t}=this,n=e.colDef,s=this.getCellClassParams(e,n);for(const r of this.staticClasses)t.toggleCss(r,!1);const o=this.beans.cellStyles.getStaticCellClasses(n,s);this.staticClasses=o;for(const r of o)t.toggleCss(r,!0)}getCellClassParams(e,t){const{value:n,rowNode:s}=this.cellCtrl;return Ft(this.beans.gos,{value:n,data:s.data,node:s,colDef:t,column:e,rowIndex:s.rowIndex})}},xCe=class extends We{constructor(){super(...arguments),this.beanName="cellStyles"}processAllCellClasses(e,t,n,s){e_(this.beans.expressionSvc,void 0,e.cellClassRules,t,n,s),this.processStaticCellClasses(e,t,n)}getStaticCellClasses(e,t){const{cellClass:n}=e;if(!n)return[];let s;return typeof n=="function"?s=n(t):s=n,typeof s=="string"&&(s=[s]),s||[]}createCellCustomStyleFeature(e,t){return new ICe(e,t)}processStaticCellClasses(e,t,n){this.getStaticCellClasses(e,t).forEach(o=>{n(o)})}},FCe={moduleName:"CellStyle",version:ct,beans:[xCe]},PCe={moduleName:"RowStyle",version:ct,beans:[vpe]};function ACe(e,t){var n;return!!((n=e.colHover)!=null&&n.isHovered(t))}var kCe=class extends We{constructor(e,t){super(),this.columns=e,this.element=t,this.destroyManagedListeners=[],this.enableFeature=n=>{const{beans:s,gos:o,element:r,columns:i}=this,a=s.colHover;if(n??!!o.get("columnHoverHighlight"))this.destroyManagedListeners=this.addManagedElementListeners(r,{mouseover:a.setMouseOver.bind(a,i),mouseout:a.clearMouseOver.bind(a)});else{for(const c of this.destroyManagedListeners)c();this.destroyManagedListeners=[]}}}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{this.enableFeature(e)}),this.enableFeature()}destroy(){super.destroy(),this.destroyManagedListeners=null}},OCe="ag-column-hover",MCe=class extends We{constructor(){super(...arguments),this.beanName="colHover"}postConstruct(){this.addManagedPropertyListener("columnHoverHighlight",({currentValue:e})=>{e||this.clearMouseOver()})}setMouseOver(e){this.updateState(e)}clearMouseOver(){this.updateState(null)}isHovered(e){if(!this.gos.get("columnHoverHighlight"))return!1;const t=this.selectedColumns;return!!t&&t.indexOf(e)>=0}addHeaderColumnHoverListener(e,t,n){const s=()=>{const o=this.isHovered(n);t.toggleCss("ag-column-hover",o)};e.addManagedEventListeners({columnHoverChanged:s}),s()}onCellColumnHover(e,t){if(!t)return;const n=this.isHovered(e);t.toggleCss(OCe,n)}addHeaderFilterColumnHoverListener(e,t,n,s){this.createHoverFeature(e,[n],s);const o=()=>{const r=this.isHovered(n);t.toggleCss("ag-column-hover",r)};e.addManagedEventListeners({columnHoverChanged:o}),o()}createHoverFeature(e,t,n){e.createManagedBean(new kCe(t,n))}updateState(e){this.selectedColumns=e,this.eventSvc.dispatchEvent({type:"columnHoverChanged"})}},NCe={moduleName:"ColumnHover",version:ct,beans:[MCe],apiFunctions:{isColumnHovered:ACe}},LCe=class extends We{constructor(){super(...arguments),this.beanName="apiEventSvc",this.syncListeners=new Map,this.asyncListeners=new Map,this.syncGlobalListeners=new Set,this.globalListenerPairs=new Map}postConstruct(){var e,t;this.wrapSvc=(t=(e=this.beans.frameworkOverrides).createGlobalEventListenerWrapper)==null?void 0:t.call(e)}addListener(e,t){var r;const n=((r=this.wrapSvc)==null?void 0:r.wrap(e,t))??t,s=!yy.has(e),o=s?this.asyncListeners:this.syncListeners;o.has(e)||o.set(e,new Set),o.get(e).add(n),this.eventSvc.addListener(e,n,s)}removeListener(e,t){var r,i;const n=((r=this.wrapSvc)==null?void 0:r.unwrap(e,t))??t,s=this.asyncListeners.get(e),o=!!(s!=null&&s.delete(n));o||(i=this.syncListeners.get(e))==null||i.delete(n),this.eventSvc.removeListener(e,n,o)}addGlobalListener(e){var r;const t=((r=this.wrapSvc)==null?void 0:r.wrapGlobal(e))??e,n=(i,a)=>{yy.has(i)&&t(i,a)},s=(i,a)=>{yy.has(i)||t(i,a)};this.globalListenerPairs.set(e,{syncListener:n,asyncListener:s});const o=this.eventSvc;o.addGlobalListener(n,!1),o.addGlobalListener(s,!0)}removeGlobalListener(e){const{eventSvc:t,wrapSvc:n,globalListenerPairs:s}=this,o=(n==null?void 0:n.unwrapGlobal(e))??e;if(s.has(o)){const{syncListener:i,asyncListener:a}=s.get(o);t.removeGlobalListener(i,!1),t.removeGlobalListener(a,!0),s.delete(e)}else this.syncGlobalListeners.delete(o),t.removeGlobalListener(o,!1)}destroyEventListeners(e,t){e.forEach((n,s)=>{n.forEach(o=>this.eventSvc.removeListener(s,o,t)),n.clear()}),e.clear()}destroyGlobalListeners(e,t){for(const n of e)this.eventSvc.removeGlobalListener(n,t);e.clear()}destroy(){super.destroy(),this.destroyEventListeners(this.syncListeners,!1),this.destroyEventListeners(this.asyncListeners,!0),this.destroyGlobalListeners(this.syncGlobalListeners,!1);const{globalListenerPairs:e,eventSvc:t}=this;e.forEach(({syncListener:n,asyncListener:s})=>{t.removeGlobalListener(n,!1),t.removeGlobalListener(s,!0)}),e.clear()}};function VCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.addListener(t,n)}function BCe(e,t,n){var s;(s=e.apiEventSvc)==null||s.removeListener(t,n)}function $Ce(e,t){var n;(n=e.apiEventSvc)==null||n.addGlobalListener(t)}function HCe(e,t){var n;(n=e.apiEventSvc)==null||n.removeGlobalListener(t)}var GCe={moduleName:"EventApi",version:ct,apiFunctions:{addEventListener:VCe,addGlobalListener:$Ce,removeEventListener:BCe,removeGlobalListener:HCe},beans:[LCe]},UCe={moduleName:"Locale",version:ct,beans:[yge]},WCe=class extends We{constructor(){super(...arguments),this.beanName="rowAutoHeight",this.wasEverActive=!1,this._debouncedCalculateRowHeights=Os(this,this.calculateRowHeights.bind(this),1)}requestCheckAutoHeight(){this.wasEverActive&&this._debouncedCalculateRowHeights()}calculateRowHeights(){var a,l,c,u;const{visibleCols:e,rowModel:t,rowSpanSvc:n,pinnedRowModel:s}=this.beans,o=e.autoHeightCols;let r=!1;const i=d=>{var p;const h=d.__autoHeights;let f=ol(this.beans,d).height;for(const g of o){let v=h==null?void 0:h[g.getColId()];const C=n==null?void 0:n.getCellSpan(g,d);if(C){if(C.getLastNode()!==d)continue;if(v=(p=n==null?void 0:n.getCellSpan(g,d))==null?void 0:p.getLastNodeAutoHeight(),!v)return}if(v==null){if(this.colSpanSkipCell(g,d))continue;return}f=Math.max(v,f)}f!==d.rowHeight&&(d.setRowHeight(f),r=!0)};(a=s==null?void 0:s.forEachPinnedRow)==null||a.call(s,"top",i),(l=s==null?void 0:s.forEachPinnedRow)==null||l.call(s,"bottom",i),(c=t.forEachDisplayedNode)==null||c.call(t,i),r&&((u=t.onRowHeightChanged)==null||u.call(t))}setRowAutoHeight(e,t,n){if(e.__autoHeights??(e.__autoHeights={}),t==null){delete e.__autoHeights[n.getId()];return}const s=e.__autoHeights[n.getId()];e.__autoHeights[n.getId()]=t,s!==t&&this.requestCheckAutoHeight()}colSpanSkipCell(e,t){const{colModel:n,colViewport:s,visibleCols:o}=this.beans;if(!n.colSpanActive)return!1;let r=[];switch(e.getPinned()){case"left":r=o.getLeftColsForRow(t);break;case"right":r=o.getRightColsForRow(t);break;case null:r=s.getColsWithinViewport(t);break}return!r.includes(e)}setupCellAutoHeight(e,t,n){if(!e.column.isAutoHeight()||!t)return!1;this.wasEverActive=!0;const s=t.parentElement,{rowNode:o,column:r}=e,i=this.beans,a=u=>{var S;if((S=this.beans.editSvc)!=null&&S.isEditing(e)||!e.isAlive()||!n.isAlive())return;const{paddingTop:d,paddingBottom:h,borderBottomWidth:f,borderTopWidth:p}=gc(s),g=d+h+f+p,C=t.offsetHeight+g;if(u<5){const b=Ds(i),w=!(b!=null&&b.contains(t)),D=C==0;if(w||D){window.setTimeout(()=>a(u+1),0);return}}this.setRowAutoHeight(o,C,r)},l=()=>a(0);l();const c=tl(i,t,l);return n.addDestroyFunc(()=>{c(),this.setRowAutoHeight(o,void 0,r)}),!0}setAutoHeightActive(e){this.active=e.list.some(t=>t.isVisible()&&t.isAutoHeight())}areRowsMeasured(){if(!this.active)return!0;const e=this.beans.rowRenderer.getAllRowCtrls();let t=null;for(const{rowNode:n}of e)if((!t||this.beans.colModel.colSpanActive)&&(t=this.beans.colViewport.getColsWithinViewport(n).filter(o=>o.isAutoHeight())),t.length!==0){if(!n.__autoHeights)return!1;for(const s of t){const o=n.__autoHeights[s.getColId()];if(!o||n.rowHeight<o)return!1}}return!0}},zCe={moduleName:"RowAutoHeight",version:ct,beans:[WCe]},jCe={moduleName:"AllCommunity",version:ct,dependsOn:[IB,Jye,lwe,Nge,jve,Kve,qve,Yve,Zve,Xve,Jve,zve,Vme,Bme,$me,Lme,Gme,Ume,_we,Eye,Uwe,l2,Qwe,eCe,lCe,fCe,Pue,CCe,fye,Qpe,FCe,NCe,PCe,GCe,nge,ywe,cB,UCe,zCe,Fue,zye,TCe]};let OB=!1;OB||(Voe.registerModules([jCe,IB]),OB=!0);class KCe{constructor(t,n){Qn(this,"gridApi",null);Qn(this,"container");Qn(this,"config");Qn(this,"eventListeners",new Map);this.container=t,this.config=n}init(){if(this.gridApi)throw new Error("Grid already initialized");const{onGridReady:t,onCellClicked:n,onCellFocused:s,onRowSelected:o,...r}=this.config,i={...r,onGridReady:a=>{this.gridApi=a.api,t&&t(a)},onCellClicked:a=>{n&&n(a)},onCellFocused:a=>{s&&s(a)},onRowSelected:a=>{o&&o(a)}};return this.gridApi=pge(this.container,i),this.gridApi}updateRowData(t){this.gridApi&&this.gridApi.setGridOption("rowData",t)}updateColumnDefs(t){this.gridApi&&this.gridApi.setGridOption("columnDefs",t)}setColumnWidth(t){var n;this.gridApi&&((n=this.gridApi)==null||n.applyColumnState({state:t,applyOrder:!1}))}updateDatasource(t){this.gridApi&&this.gridApi.setGridOption("datasource",t)}refreshInfiniteCache(){this.gridApi&&this.gridApi.refreshInfiniteCache()}sizeColumnsToFit(){this.gridApi}deselectAll(){this.gridApi&&this.gridApi.deselectAll()}getSelectedRows(){var t;return((t=this.gridApi)==null?void 0:t.getSelectedRows())||[]}setQuickFilterText(t){this.gridApi&&this.gridApi.setGridOption("quickFilterText",t)}getColumnState(){var t;return(t=this.gridApi)==null?void 0:t.getColumnState()}addEventListener(t,n){if(!this.gridApi)throw new Error("Grid not initialized");this.eventListeners.has(t)||this.eventListeners.set(t,new Set),this.eventListeners.get(t).add(n),this.gridApi.addEventListener(t,n)}addRow(t,n="bottom"){if(this.gridApi){const s={add:[t],addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}addRows(t,n="bottom"){if(this.gridApi&&t.length>0){const s={add:t,addIndex:n==="bottom"?void 0:0};if(this.gridApi.applyTransaction(s),n==="bottom"){const o=this.gridApi.getDisplayedRowCount();o>0&&this.gridApi.ensureIndexVisible(o-1,"bottom")}}}destroy(){this.gridApi&&(this.eventListeners.forEach((t,n)=>{t.forEach(s=>{var o;(o=this.gridApi)==null||o.removeEventListener(n,s)})}),this.eventListeners.clear(),this.gridApi.destroy(),this.gridApi=null)}getApi(){return this.gridApi}switchTheme(t){document.body.dataset.agThemeMode=t==="dark"?"dark":"light"}}const qCe=p2.withParams({accentColor:"var(--primary-color)",backgroundColor:"#ffffff",borderColor:"#e5e7eb",borderRadius:4,browserColorScheme:"light",chromeBackgroundColor:"#f9fafb",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#111827",headerBackgroundColor:"#fff",headerFontSize:14,headerFontWeight:600,headerTextColor:"#374151",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"light").withParams({accentColor:"var(--primary-color)",backgroundColor:"#1f2937",borderColor:"#374151",borderRadius:4,browserColorScheme:"dark",chromeBackgroundColor:"#111827",columnBorder:!0,fontFamily:"inherit",fontSize:14,foregroundColor:"#f9fafb",headerBackgroundColor:"#374151",headerFontSize:14,headerFontWeight:600,headerTextColor:"#f9fafb",iconSize:16,rowBorder:!0,spacing:8,headerHeight:40,rowHeight:32,wrapperBorder:!0,wrapperBorderRadius:4},"dark"),YCe=ot({__name:"AgTable",props:{statusBar:{},sideBar:{type:[Object,String,Array,Boolean,null]},suppressContextMenu:{type:Boolean},preventDefaultOnContextMenu:{type:Boolean},allowContextMenuWithControlKey:{type:Boolean},columnMenu:{},suppressMenuHide:{type:Boolean},enableBrowserTooltips:{type:Boolean},tooltipTrigger:{},tooltipShowDelay:{},tooltipHideDelay:{},tooltipMouseTrack:{type:Boolean},tooltipShowMode:{},tooltipInteraction:{type:Boolean},popupParent:{},copyHeadersToClipboard:{type:Boolean},copyGroupHeadersToClipboard:{type:Boolean},clipboardDelimiter:{},suppressCopyRowsToClipboard:{type:Boolean},suppressCopySingleCellRanges:{type:Boolean},suppressLastEmptyLineOnPaste:{type:Boolean},suppressClipboardPaste:{type:Boolean},suppressClipboardApi:{type:Boolean},suppressCutToClipboard:{type:Boolean},columnDefs:{},defaultColDef:{},defaultColGroupDef:{},columnTypes:{},dataTypeDefinitions:{},maintainColumnOrder:{type:Boolean},enableStrictPivotColumnOrder:{type:Boolean},suppressFieldDotNotation:{type:Boolean},headerHeight:{},groupHeaderHeight:{},floatingFiltersHeight:{},pivotHeaderHeight:{},pivotGroupHeaderHeight:{},hidePaddedHeaderRows:{type:Boolean},allowDragFromColumnsToolPanel:{type:Boolean},suppressMovableColumns:{type:Boolean},suppressColumnMoveAnimation:{type:Boolean},suppressMoveWhenColumnDragging:{type:Boolean},suppressDragLeaveHidesColumns:{type:Boolean},suppressGroupChangesColumnVisibility:{type:[Boolean,String]},suppressMakeColumnVisibleAfterUnGroup:{type:Boolean},suppressRowGroupHidesColumns:{type:Boolean},colResizeDefault:{},suppressAutoSize:{type:Boolean},autoSizePadding:{},skipHeaderOnAutoSize:{type:Boolean},autoSizeStrategy:{},components:{},editType:{},suppressStartEditOnTab:{type:Boolean},getFullRowEditValidationErrors:{type:Function},invalidEditValueMode:{},singleClickEdit:{type:Boolean},suppressClickEdit:{type:Boolean},readOnlyEdit:{type:Boolean},stopEditingWhenCellsLoseFocus:{type:Boolean},enterNavigatesVertically:{type:Boolean},enterNavigatesVerticallyAfterEdit:{type:Boolean},enableCellEditingOnBackspace:{type:Boolean},undoRedoCellEditing:{type:Boolean},undoRedoCellEditingLimit:{},defaultCsvExportParams:{},suppressCsvExport:{type:Boolean},defaultExcelExportParams:{},suppressExcelExport:{type:Boolean},excelStyles:{},findSearchValue:{},findOptions:{},quickFilterText:{},cacheQuickFilter:{type:Boolean},includeHiddenColumnsInQuickFilter:{type:Boolean},quickFilterParser:{type:Function},quickFilterMatcher:{type:Function},applyQuickFilterBeforePivotOrAgg:{type:Boolean},excludeChildrenWhenTreeDataFiltering:{type:Boolean},enableAdvancedFilter:{type:Boolean},alwaysPassFilter:{type:Function},includeHiddenColumnsInAdvancedFilter:{type:Boolean},advancedFilterParent:{},advancedFilterBuilderParams:{},advancedFilterParams:{},suppressAdvancedFilterEval:{type:Boolean},suppressSetFilterByDefault:{type:Boolean},enableFilterHandlers:{type:Boolean},filterHandlers:{},enableCharts:{type:Boolean},chartThemes:{},customChartThemes:{},chartThemeOverrides:{},chartToolPanelsDef:{},chartMenuItems:{type:[Array,Function]},loadingCellRenderer:{},loadingCellRendererParams:{},loadingCellRendererSelector:{type:Function},localeText:{},masterDetail:{type:Boolean},keepDetailRows:{type:Boolean},keepDetailRowsCount:{},detailCellRenderer:{},detailCellRendererParams:{},detailRowHeight:{},detailRowAutoHeight:{type:Boolean},context:{},alignedGrids:{type:[Array,Function]},tabIndex:{},rowBuffer:{},valueCache:{type:Boolean},valueCacheNeverExpires:{type:Boolean},enableCellExpressions:{type:Boolean},suppressTouch:{type:Boolean},suppressFocusAfterRefresh:{type:Boolean},suppressBrowserResizeObserver:{type:Boolean},suppressPropertyNamesCheck:{type:Boolean},suppressChangeDetection:{type:Boolean},debug:{type:Boolean},loading:{type:Boolean},overlayLoadingTemplate:{},loadingOverlayComponent:{},loadingOverlayComponentParams:{},suppressLoadingOverlay:{type:Boolean},overlayNoRowsTemplate:{},noRowsOverlayComponent:{},noRowsOverlayComponentParams:{},suppressNoRowsOverlay:{type:Boolean},pagination:{type:Boolean},paginationPageSize:{},paginationPageSizeSelector:{type:[Array,Boolean]},paginationAutoPageSize:{type:Boolean},paginateChildRows:{type:Boolean},suppressPaginationPanel:{type:Boolean},pivotMode:{type:Boolean},pivotPanelShow:{},pivotMaxGeneratedColumns:{},pivotDefaultExpanded:{},pivotColumnGroupTotals:{},pivotRowTotals:{},pivotSuppressAutoColumn:{type:Boolean},suppressExpandablePivotGroups:{type:Boolean},functionsReadOnly:{type:Boolean},aggFuncs:{},suppressAggFuncInHeader:{type:Boolean},alwaysAggregateAtRootLevel:{type:Boolean},aggregateOnlyChangedColumns:{type:Boolean},suppressAggFilteredOnly:{type:Boolean},removePivotHeaderRowWhenSingleValueColumn:{type:Boolean},animateRows:{type:Boolean},cellFlashDuration:{},cellFadeDuration:{},allowShowChangeAfterFilter:{type:Boolean},domLayout:{},ensureDomOrder:{type:Boolean},enableCellSpan:{type:Boolean},enableRtl:{type:Boolean},suppressColumnVirtualisation:{type:Boolean},suppressMaxRenderedRowRestriction:{type:Boolean},suppressRowVirtualisation:{type:Boolean},rowDragManaged:{type:Boolean},rowDragInsertDelay:{},suppressRowDrag:{type:Boolean},suppressMoveWhenRowDragging:{type:Boolean},rowDragEntireRow:{type:Boolean},rowDragMultiRow:{type:Boolean},rowDragText:{type:Function},dragAndDropImageComponent:{},dragAndDropImageComponentParams:{},fullWidthCellRenderer:{},fullWidthCellRendererParams:{},embedFullWidthRows:{type:Boolean},groupDisplayType:{},groupDefaultExpanded:{},autoGroupColumnDef:{},groupMaintainOrder:{type:Boolean},groupSelectsChildren:{type:Boolean},groupLockGroupColumns:{},groupAggFiltering:{type:[Boolean,Function]},groupTotalRow:{type:[String,Function]},grandTotalRow:{},suppressStickyTotalRow:{type:[Boolean,String]},groupSuppressBlankHeader:{type:Boolean},groupSelectsFiltered:{type:Boolean},showOpenedGroup:{type:Boolean},groupHideParentOfSingleChild:{type:[Boolean,String]},groupRemoveSingleChildren:{type:Boolean},groupRemoveLowestSingleChildren:{type:Boolean},groupHideOpenParents:{type:Boolean},groupAllowUnbalanced:{type:Boolean},rowGroupPanelShow:{},groupRowRenderer:{},groupRowRendererParams:{},treeData:{type:Boolean},treeDataChildrenField:{},treeDataParentIdField:{},rowGroupPanelSuppressSort:{type:Boolean},suppressGroupRowsSticky:{type:Boolean},groupHierarchyConfig:{},pinnedTopRowData:{},pinnedBottomRowData:{},enableRowPinning:{type:[Boolean,String]},isRowPinnable:{type:Function},isRowPinned:{type:Function},rowModelType:{},rowData:{},asyncTransactionWaitMillis:{},suppressModelUpdateAfterUpdateTransaction:{type:Boolean},datasource:{},cacheOverflowSize:{},infiniteInitialRowCount:{},serverSideInitialRowCount:{},suppressServerSideFullWidthLoadingRow:{type:Boolean},cacheBlockSize:{},maxBlocksInCache:{},maxConcurrentDatasourceRequests:{},blockLoadDebounceMillis:{},purgeClosedRowNodes:{type:Boolean},serverSideDatasource:{},serverSideSortAllLevels:{type:Boolean},serverSideEnableClientSideSort:{type:Boolean},serverSideOnlyRefreshFilteredGroups:{type:Boolean},serverSidePivotResultFieldSeparator:{},viewportDatasource:{},viewportRowModelPageSize:{},viewportRowModelBufferSize:{},alwaysShowHorizontalScroll:{type:Boolean},alwaysShowVerticalScroll:{type:Boolean},debounceVerticalScrollbar:{type:Boolean},suppressHorizontalScroll:{type:Boolean},suppressScrollOnNewData:{type:Boolean},suppressScrollWhenPopupsAreOpen:{type:Boolean},suppressAnimationFrame:{type:Boolean},suppressMiddleClickScrolls:{type:Boolean},suppressPreventDefaultOnMouseWheel:{type:Boolean},scrollbarWidth:{},rowSelection:{},cellSelection:{type:[Boolean,Object]},rowMultiSelectWithClick:{type:Boolean},suppressRowDeselection:{type:Boolean},suppressRowClickSelection:{type:Boolean},suppressCellFocus:{type:Boolean},suppressHeaderFocus:{type:Boolean},selectionColumnDef:{},rowNumbers:{type:[Boolean,Object]},suppressMultiRangeSelection:{type:Boolean},enableCellTextSelection:{type:Boolean},enableRangeSelection:{type:Boolean},enableRangeHandle:{type:Boolean},enableFillHandle:{type:Boolean},fillHandleDirection:{},suppressClearOnFillReduction:{type:Boolean},sortingOrder:{},accentedSort:{type:Boolean},unSortIcon:{type:Boolean},suppressMultiSort:{type:Boolean},alwaysMultiSort:{type:Boolean},multiSortKey:{},suppressMaintainUnsortedOrder:{type:Boolean},icons:{},rowHeight:{},rowStyle:{},rowClass:{},rowClassRules:{},suppressRowHoverHighlight:{type:Boolean},suppressRowTransform:{type:Boolean},columnHoverHighlight:{type:Boolean},gridId:{},deltaSort:{type:Boolean},treeDataDisplayType:{},enableGroupEdit:{type:Boolean},initialState:{},reactiveCustomComponents:{type:Boolean},renderingMode:{},theme:{},loadThemeGoogleFonts:{type:Boolean},themeCssLayer:{},styleNonce:{},themeStyleContainer:{},getContextMenuItems:{type:Function},getMainMenuItems:{type:Function},postProcessPopup:{type:Function},processUnpinnedColumns:{type:Function},processCellForClipboard:{type:Function},processHeaderForClipboard:{type:Function},processGroupHeaderForClipboard:{type:Function},processCellFromClipboard:{type:Function},sendToClipboard:{type:Function},processDataFromClipboard:{type:Function},isExternalFilterPresent:{type:Function},doesExternalFilterPass:{type:Function},getChartToolbarItems:{type:Function},createChartContainer:{type:Function},focusGridInnerElement:{type:Function},navigateToNextHeader:{type:Function},tabToNextHeader:{type:Function},navigateToNextCell:{type:Function},tabToNextCell:{type:Function},getLocaleText:{type:Function},getDocument:{type:Function},paginationNumberFormatter:{type:Function},getGroupRowAgg:{type:Function},isGroupOpenByDefault:{type:Function},ssrmExpandAllAffectsAllRows:{type:Boolean},initialGroupOrderComparator:{type:Function},processPivotResultColDef:{type:Function},processPivotResultColGroupDef:{type:Function},getDataPath:{type:Function},getChildCount:{type:Function},getServerSideGroupLevelParams:{type:Function},isServerSideGroupOpenByDefault:{type:Function},isApplyServerSideTransaction:{type:Function},isServerSideGroup:{type:Function},getServerSideGroupKey:{type:Function},getBusinessKeyForNode:{type:Function},getRowId:{type:Function},resetRowDataOnUpdate:{type:Boolean},processRowPostCreate:{type:Function},isRowSelectable:{type:Function},isRowMaster:{type:Function},fillOperation:{type:Function},postSortRows:{type:Function},getRowStyle:{type:Function},getRowClass:{type:Function},getRowHeight:{type:Function},isFullWidthRow:{type:Function},onToolPanelVisibleChanged:{type:Function},onToolPanelSizeChanged:{type:Function},onColumnMenuVisibleChanged:{type:Function},onContextMenuVisibleChanged:{type:Function},onCutStart:{type:Function},onCutEnd:{type:Function},onPasteStart:{type:Function},onPasteEnd:{type:Function},onColumnVisible:{type:Function},onColumnPinned:{type:Function},onColumnResized:{type:Function},onColumnMoved:{type:Function},onColumnValueChanged:{type:Function},onColumnPivotModeChanged:{type:Function},onColumnPivotChanged:{type:Function},onColumnGroupOpened:{type:Function},onNewColumnsLoaded:{type:Function},onGridColumnsChanged:{type:Function},onDisplayedColumnsChanged:{type:Function},onVirtualColumnsChanged:{type:Function},onColumnEverythingChanged:{type:Function},onColumnsReset:{type:Function},onColumnHeaderMouseOver:{type:Function},onColumnHeaderMouseLeave:{type:Function},onColumnHeaderClicked:{type:Function},onColumnHeaderContextMenu:{type:Function},onComponentStateChanged:{type:Function},onCellValueChanged:{type:Function},onCellEditRequest:{type:Function},onRowValueChanged:{type:Function},onCellEditingStarted:{type:Function},onCellEditingStopped:{type:Function},onRowEditingStarted:{type:Function},onRowEditingStopped:{type:Function},onBulkEditingStarted:{type:Function},onBulkEditingStopped:{type:Function},onBatchEditingStarted:{type:Function},onBatchEditingStopped:{type:Function},onUndoStarted:{type:Function},onUndoEnded:{type:Function},onRedoStarted:{type:Function},onRedoEnded:{type:Function},onCellSelectionDeleteStart:{type:Function},onCellSelectionDeleteEnd:{type:Function},onRangeDeleteStart:{type:Function},onRangeDeleteEnd:{type:Function},onFillStart:{type:Function},onFillEnd:{type:Function},onFilterOpened:{type:Function},onFilterChanged:{type:Function},onFilterModified:{type:Function},onFilterUiChanged:{type:Function},onFloatingFilterUiChanged:{type:Function},onAdvancedFilterBuilderVisibleChanged:{type:Function},onFindChanged:{type:Function},onChartCreated:{type:Function},onChartRangeSelectionChanged:{type:Function},onChartOptionsChanged:{type:Function},onChartDestroyed:{type:Function},onCellKeyDown:{type:Function},onGridReady:{type:Function},onGridPreDestroyed:{type:Function},onFirstDataRendered:{type:Function},onGridSizeChanged:{type:Function},onModelUpdated:{type:Function},onVirtualRowRemoved:{type:Function},onViewportChanged:{type:Function},onBodyScroll:{type:Function},onBodyScrollEnd:{type:Function},onDragStarted:{type:Function},onDragStopped:{type:Function},onDragCancelled:{type:Function},onStateUpdated:{type:Function},onPaginationChanged:{type:Function},onRowDragEnter:{type:Function},onRowDragMove:{type:Function},onRowDragLeave:{type:Function},onRowDragEnd:{type:Function},onRowDragCancel:{type:Function},isRowValidDropPosition:{type:Function},onRowResizeStarted:{type:Function},onRowResizeEnded:{type:Function},onColumnRowGroupChanged:{type:Function},onRowGroupOpened:{type:Function},onExpandOrCollapseAll:{type:Function},onPivotMaxColumnsExceeded:{type:Function},onPinnedRowDataChanged:{type:Function},onPinnedRowsChanged:{type:Function},onRowDataUpdated:{type:Function},onAsyncTransactionsFlushed:{type:Function},onStoreRefreshed:{type:Function},onHeaderFocused:{type:Function},onCellClicked:{type:Function},onCellDoubleClicked:{type:Function},onCellFocused:{type:Function},onCellMouseOver:{type:Function},onCellMouseOut:{type:Function},onCellMouseDown:{type:Function},onRowClicked:{type:Function},onRowDoubleClicked:{type:Function},onRowSelected:{type:Function},onSelectionChanged:{type:Function},onCellContextMenu:{type:Function},onRangeSelectionChanged:{type:Function},onCellSelectionChanged:{type:Function},onTooltipShow:{type:Function},onTooltipHide:{type:Function},onSortChanged:{type:Function},height:{},isSorting:{type:Boolean}},emits:["onGridReady","row-clicked","cell-clicked","cell-focused","row-selected"],setup(e,{expose:t,emit:n}){const s=e,o=n,r=B(null);Qb(r,()=>{var v;const g=(v=i.value)==null?void 0:v.getApi();g==null||g.clearFocusedCell()});const i=B(null),a=q(()=>({width:"100%",height:s.height||"500px"})),l=q(()=>({...s,theme:qCe}));function c(){if(!r.value){console.warn("Grid container element not found");return}const g={...l.value,height:s.height};i.value=new KCe(r.value,g),i.value.init(),u()}function u(){var v;const g=((v=i.value)==null?void 0:v.getApi())??null;o("onGridReady",g)}function d(g){var C,S;if(!g)return;(C=i.value)==null||C.updateColumnDefs(g);const v=g.map(b=>b.field&&b.width&&!b.hide?{colId:b.field,width:b.width}:null).filter(b=>b!==null);(S=i.value)==null||S.setColumnWidth(v)}function h(){var g;(g=i.value)==null||g.destroy(),i.value=null}function f(){var g;return((g=i.value)==null?void 0:g.getApi())||void 0}function p(){return i.value||null}return et(()=>s.columnDefs,(g,v)=>{const C=g==null?void 0:g.filter(b=>!b.hide).map(b=>b.field).join(","),S=v==null?void 0:v.filter(b=>!b.hide).map(b=>b.field).join(",");C!==S&&d(g)},{deep:!0}),ms(()=>{h()}),t({gridApi:f,gridManager:p,syncColumnDefs:d}),rn(()=>{c()}),ms(()=>{h()}),(g,v)=>(z(),ce("div",{ref_key:"gridContainerRef",ref:r,style:hn(a.value),class:Q(["ag-theme-quartz",["ag-table-container",s.isSorting?"is-sorting":""]])},null,6))}});function Pd(e){return fN(e)}const ZCe=()=>[...[{headerName:"Name",field:"name",sortable:!1,filter:!1,pinned:"left",headerComponent:Pd(ac),suppressMovable:!0},{headerName:"Notes",field:"description",sortable:!1,filter:!1,suppressMovable:!0},{headerName:"Assignee",field:"assignees",sortable:!1,filter:!1,headerComponent:Pd(ac)},{headerName:"Status",field:"status",sortable:!1,filter:!1,headerComponent:Pd(ac)},{headerName:"Date Range",field:"dateRange",sortable:!1,filter:!1,headerComponent:Pd(ac)},{headerName:"Last Updated",field:"lastUpdated",sortable:!1,filter:!1,headerComponent:Pd(ac),cellRendererParams:n=>{var s,o,r;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.lastUpdated.value,tooltip:((r=(o=n==null?void 0:n.data)==null?void 0:o.lastUpdated)==null?void 0:r.tooltip)||void 0,readOnly:!0}}},{headerName:"Completed On",field:"completedOn",sortable:!1,filter:!1,headerComponent:Pd(ac),cellRendererParams:n=>{var s,o,r;return{...n,value:(s=n==null?void 0:n.data)==null?void 0:s.completedOn.value,tooltip:((r=(o=n==null?void 0:n.data)==null?void 0:o.completedOn)==null?void 0:r.tooltip)||void 0,readOnly:!0}}}].map(n=>kf.fromType(n))],xy={WIDTH:60,HEADER_CLASS:"ag-checkbox-header"},XCe={field:"blank",headerName:"",flex:1,editable:!1,sortable:!1,filter:!1,cellClass:"ag-cell-optimized",suppressMovable:!0,suppressNavigable:!0,suppressAutoSize:!1,suppressSizeToFit:!1},JCe=()=>({field:"__checkboxSelection",checkboxSelection:!0,headerCheckboxSelection:!0,pinned:"left",width:xy.WIDTH,minWidth:xy.WIDTH,maxWidth:xy.WIDTH,cellClass:"ag-checkbox-cell",headerClass:xy.HEADER_CLASS,headerComponent:_v(fJ),suppressMovable:!0}),QCe={headerName:"",field:"options",sortable:!1,filter:!1,editable:!0,pinned:"right",lockPosition:!0,suppressMovable:!0,resizable:!1},ebe=(e,t,n)=>{const{getCachedValue:s,setCachedValue:o}=Dh({dbName:"item_table_column_configs",storeName:"column_configs"}),r=async()=>{const u=await s(t);if(u&&typeof u=="string")try{return JSON.parse(u)}catch(d){return console.error("Failed to parse cached column config:",d),null}return null},i=B([]),a=JCe(),l=async u=>{const d=await r(),h=new Map;d==null||d.forEach(A=>{A.width&&h.set(A.field,A.width)});const f=ZCe(),p=kf.fromType(QCe),v=((u==null?void 0:u.map(A=>{var k;return{headerName:A.name,field:`metric_${A.id}`,editable:((k=A==null?void 0:A.auth_permission)==null?void 0:k.permission)==2,sortable:!0,filter:!1,flex:1,context:{...A},hide:!(A.is_primary||A.is_point_metric),cellClass:"ag-cell-optimized",headerComponent:_v(ac),headerComponentParams:M=>({headerType:A.metric_type.code=="number"||A.metric_type.code=="formula"?"number":"default"}),width:h.get(`metric_${A.id}`)}}))||[]).map(A=>kf.fromType(A)),C=[a,...f,...v,XCe,p],S=C.filter(A=>A.pinned==="left"),b=C.filter(A=>A.pinned==="right"||A.field==="blank"),w=C.filter(A=>!A.pinned&&A.field!=="blank");if(!d||d.length===0){i.value=C;return}const D=new Map(d.map(A=>[A.field,A])),R=new Map(w.map(A=>[A.field,A])),T=[];for(const A of d)if(A.field&&R.has(A.field)){const k=R.get(A.field);T.push({...k,hide:A.hide,width:A.width}),R.delete(A.field)}const I=Array.from(R.values()),x=[...T,...I],F=S.map(A=>{const k=D.get(A.field);return k!=null&&k.width?{...A,width:k.width}:A}),E=b.map(A=>{const k=D.get(A.field);return k!=null&&k.width?{...A,width:k.width}:A});i.value=[...F,...x,...E]};et(e,u=>l(u),{immediate:!0});const c=Tr((u,d)=>{var C,S;if(u.source!==void 0)if(["uiColumnResized","uiColumnMoved","api"].indexOf(u.source)===-1){console.warn("Skipping saveColumnConfig for source:",u.source);return}else console.warn("Executing saveColumnConfig for source:",u.source);else console.warn("Executing saveColumnConfig for source:",u);const h=(C=n==null?void 0:n.value)==null?void 0:C.getColumnDefs(),f=(S=n==null?void 0:n.value)==null?void 0:S.getColumnState().reduce((b,w)=>(b[w.colId]=Number(w.width),b),{}),p=new Map;Object.entries(f||{}).forEach(([b,w])=>{p.set(b,w)}),i.value=h||i.value;const g=h==null?void 0:h.filter(b=>!b.pinned&&b.field!=="blank"),v=(g==null?void 0:g.map(b=>({field:b.field,hide:b.hide,width:p.get(b.field)||b.width,pinned:b.pinned})))||[];d&&o(t,JSON.stringify(v))},ai);return{columnDefs:i,checkboxColumn:a,saveColumnConfig:c}},tbe=()=>{const e=un.getInstance().getItem("API_BASE_URL");return e!=null&&e.includes("v1")?e.slice(0,e.lastIndexOf("/v1")):String(e)},nbe=e=>{var A,k,M;const{showMessage:t,showErrorNetMessage:n}=gf(),s=es(),o={domainApi:tbe(),wsCode:un.getInstance().getItem("ws.code"),entityId:e.value.entityId},r=(M=(k=(A=s==null?void 0:s.appContext)==null?void 0:A.config)==null?void 0:k.globalProperties)==null?void 0:M.apiConfig;if(!r||o.domainApi===""||o.wsCode==="")throw new Error("API configuration is missing in useItems");const i=new Ok(r,o);i.on("call-api",O=>{O.success?t(O.apiCode,"success"):n(O)});const a=lo({}),l=B([]),c=B(!1),u=B(null),d=B(null),h=B(1),f=B(20);let p=Promise.resolve();const{setCachedUsers:g}=B9(),v=O=>({workspaceId:e.value.workspaceId,entityIds:[e.value.entityId],orderBy:"id-asc",include_permission:"{include_permission}",include_permission_names:!0,q:O}),C=50,S=async(O,U,X)=>{if(!O.length)return[];const J=J4(O,U);return(await Promise.all(J.map(X))).flat()},b=async O=>{try{return(await i.getPermissionForItems({workspaceId:e.value.workspaceId,itemIds:O})).data.map(X=>[X==null?void 0:X.id,X.permission])}catch(U){return console.error("Failed to fetch item permissions chunk:",U),[]}},w=async(O,U)=>{try{const X=await i.getMetricValues({workspaceId:e.value.workspaceId,item_ids:O,per_page:O.length*U.length,metric_ids:U}),J=X.data.map(ae=>{const ee=new Map(ae.item_metrics.map(H=>[H.metric_id,{value:H.value,auth_permission:H==null?void 0:H.auth_permission}])),V=Object.fromEntries(U.map(H=>[H,ee.get(H)??null]));return[ae==null?void 0:ae.id,V]}),ie=new Set(X.data.map(ae=>ae==null?void 0:ae.id));for(const ae of O)if(!ie.has(ae)){const ee=Object.fromEntries(U.map(V=>[V,{value:null,auth_permission:void 0}]));J.push([ae,ee])}return J}catch(X){return console.error("Failed to fetch a chunk of metric values:",X),O.map(ie=>[ie,Object.fromEntries(U.map(ae=>[ae,void 0]))])}},D=async O=>{try{const U=await i.getAssignedUser({workspaceId:e.value.workspaceId,item_ids:O,per_page:O.length}),X=U.data.flatMap(J=>J.assignees);return g(X),U.data.map(J=>[J==null?void 0:J.id,J==null?void 0:J.assignees])}catch(U){return console.error("Failed to fetch a chunk of assigned users:",U),[]}},R=async O=>{if(!O.length)return console.warn("getPermissionForItems: Empty itemIds"),{};try{const U=await S(O,C,b);return Object.fromEntries(U)}catch(U){return console.error("Failed to fetch item permissions:",U),{}}},T=async(O,U)=>!O.length||!U.length?{}:(p=p.then(async()=>{try{const ie=[];let ae=0;for(let V=0;V<U.length;V+=5){ae++;const H=U.slice(V,V+5),te=[];for(let ve=0;ve<H.length;ve++){const re=H[ve],oe=await S(O,C,K=>w(K,[re]));te.push(oe),await new Promise(K=>setTimeout(K,500))}ie.push(...te);const pe=V+5>=U.length}const ee={};for(const V of ie.flat()){const[H,te]=V;ee[H]||(ee[H]={}),Object.assign(ee[H],te)}return ee}catch(X){return console.error("Failed to fetch metric values:",X),{}}}),p),I=async O=>{if(!O.length)return console.warn("getAssignedUsers: Empty itemIds"),{};try{const U=await S(O,C,D);return Object.fromEntries(U)}catch(U){return console.error("Failed to fetch assigned users:",U),{}}};return{items:l,loading:c,error:u,pagination:d,currentPage:h,pageSize:f,cusorMap:a,fetchItems:async O=>{const{cursor:U,offset:X,size:J,searchQuery:ie}=O;let ae=[];c.value=!0,u.value=null;try{const ee=await i.getAllItem_cursor({...O,cursor:U||void 0,offset:X||void 0,pageSize:J||f.value,...v(ie),sortBy:O.sort_by});return l.value=ee.data,d.value=ee.meta,h.value=ee.meta.current_page||0,ae=ee.data.map(V=>V==null?void 0:V.id),ee}catch(ee){throw u.value=ee,console.error("Failed to fetch items (cursor):",ee),ee}finally{const ee=async()=>{try{const[V,H]=await Promise.all([I(ae),R(ae)]);e.value.updateItemData({assignees:V,permission:H},ae);const te=await T(ae,e.value.metricIds);e.value.setMetricValues(te,new Set(ae),e.value.metricIds)}catch(V){console.error("Post-fetch processing failed:",V)}};c.value=!1,setTimeout(ee)}},getAssignableStatus:async O=>{try{return await i.getAssignableStatus({workspaceId:e.value.workspaceId,itemIds:O})}catch(U){throw console.error("Failed to fetch assignable status:",U),U}},getMetricList:async O=>{try{return await i.getMetricList({workspaceId:e.value.workspaceId,entityId:O})}catch(U){throw console.error("Failed to fetch metric list:",U),U}},getMetricValues:T,getAssignedUsers:I}};function sbe(e){return{updateRowData:(s,o)=>{if(!e.value)return;const r=[],i=new Set,a=e.value.getColumnDefs();if(!a)return;const l=a.map(c=>{if(c.field&&c.field.startsWith("metric_")&&(c.hide===!1||c.hide===void 0))return c.field}).filter(Boolean);o.forEach(c=>{var d;const u=(d=e.value)==null?void 0:d.getRowNode(c);if(u){if(r.push(u),s.assignees){const h=R9((s.assignees[c]||[]).map(RF));u.data.assignees=h,i.add("assignees")}s.permission&&(u.data.permissions=s.permission[c]),l.forEach(h=>{u.data[h]=u.data[h]??null})}}),i.add("assignees"),i.add("status"),i.add("dateRange"),i.add("moreActions"),i.add("name"),i.add("description"),e.value.refreshCells({rowNodes:r,columns:Array.from(i),force:!0})},setMetricValues:(s,o,r)=>{const i=e.value;if(!i)return;const a=new Map(Array.from(o).map(c=>[c,new Map(r.map(u=>[u,{value:null,auth_permission:void 0}]))]));Object.entries(s).forEach(([c,u])=>{Object.entries(u).forEach(([d,h])=>{var f;(f=a.get(c))==null||f.set(d,{value:h==null?void 0:h.value,auth_permission:h==null?void 0:h.auth_permission})})});const l=Array.from(a.entries()).map(([c,u])=>{const d=i.getRowNode(c);return d!=null&&d.data?(u.forEach((h,f)=>{const p=`metric_${f}`;d.data[p]=(h==null?void 0:h.value)||null;const g=`metric_permission_${f}`;d.data[p]=(h==null?void 0:h.value)||null,d.data[g]=(h==null?void 0:h.auth_permission)||null}),d):null});l.length>0&&i.refreshCells({rowNodes:l,columns:Array.from(r).map(c=>`metric_${c}`),force:!0})}}}function obe(e,t,n,s,o){let r=!0;return{async getRows(i){try{s(!0),r&&(o(!0),r=!1);const a=Math.floor(i.startRow/t)+1,{rows:l,total:c}=await e({page:a,pageSize:t,filterText:n(),sort_by:i.sortModel});let u=-1;Number.isFinite(c)?u=c:l.length<t&&(u=i.startRow+l.length),i.context={pageSize:t,text:n()},i.successCallback(l,u),s(!1),o(!1)}catch(a){console.error("Datasource fetch error:",a),i.failCallback(),s(!1),o(!1)}}}}function rbe(e){const{selectRowData:t,isSidebarOpen:n,quickFilterText:s,gridApi:o,fetcher:r}=e,i=B(!0),a=B(!0),l=B(!1),c=()=>{n.value=!n.value},u=v=>{if(i.value=!1,o.value=v,!v)return null;const{addEventListener:C,setGridOption:S}=v;if(!r)return console.error("Fetcher function is undefined"),null;const b=obe(r,e.perPage,()=>s.value,w=>{i.value=w},w=>{a.value=w});return S==null||S("datasource",b),C==null||C("selectionChanged",()=>{t.value=v.getSelectedRows()}),v||null},d=v=>{var C,S;if((C=o.value)==null||C.hideOverlay(),v!==void 0&&(s.value=v),(S=o.value)==null||S.deselectAll(),t.value=[],i.value=!0,!o.value||!r){console.error("Grid API or fetcher is not available"),i.value=!1;return}l.value=!0,a.value=!0,o.value.purgeInfiniteCache(),o.value.ensureIndexVisible(0,"top"),setTimeout(()=>{i.value=!1,setTimeout(()=>{l.value=!1},100)},300)},h=()=>{var v;(v=o.value)==null||v.deselectAll(),t.value=[]},f=Tr(v=>{d(v)},ai),p=()=>{o.value},g=B(!1);return{isLoading:i,toggleSidebar:c,onGridReady:u,onSearch:f,handleUnSelect:h,firstLoad:a,cacheCleared:l,handleSelectAll:p,isSelectAll:g}}const ibe={changelog:{"1.0.1":{date:"2024-06-20",changes:["Fixed styling issues for archived and deleted rows."]},"1.0.0":{date:"2024-06-15",changes:["Initial release of the Item Table package."]},"0.0.1-alpha.8":{date:"2024-06-10",changes:["Improved performance of row updates.","Added support for custom cell renderers.","Add row hover effect for better UX.","Add loading skeleton for filter","Beta release with core functionalities implemented."]},"0.0.1-alpha.9":{date:"2024-06-05",changes:["Add row selection feature.","Fix bug with column resizing.","Optimize rendering for large datasets.","Implement getLog function to retrieve changelog entries based on version.","Display app version and changelog in the Item Table component tooltip.","Clean up unused autocomplete and memoized config composables.","Update styles for better consistency and readability."]},"0.0.1-alpha.11":{date:"2024-06-18",changes:["Add bulk process status display: items now show an hourglass icon and tooltip when being processed.","Update data model: added isProcessing and bulk_process properties to track item status.","Improve row focus: focused rows now flash for better visibility.","Set 'Last Updated' and 'Completed On' columns as read-only.","Fix: resolve visual fetching issue in useRemoteFiles composable.","Fix: use correct upload icon in PopupCreateScenes component.","Enhance data conversion to include processing status in item rows."]},"0.0.1-alpha.12":{date:"2024-06-12",changes:["feat: enhance Snackbar component and notification handling","Refactor Snackbar.vue for improved readability and styling, including color adjustments for icons and text.","Add showMessage function in notifications store to display messages based on API keys, improving notification management.","Introduce notificationMessage constant to centralize notification messages for various API actions, enhancing maintainability.","Remove unnecessary console logs from useRemoteFiles and improve logging in notification store for better debugging."]},"0.0.1-alpha.16":{date:"2024-06-20",changes:["Add onboarding tour feature and enhance UI components with new dependencies","Refactor UI components for improved styling and functionality","Updated RatingComponent.vue to streamline class bindings and improve accessibility attributes.","Enhanced SearchBox.vue by adding a clear event handler and simplifying icon rendering.","Modified AssigneeGroupEditor.vue and AssigneeGroupRenderer.vue to remove unnecessary size attributes from icons.","Adjusted DateRangeRenderer.vue to remove size attributes from icons for consistency.","Updated HeaderCheckbox.vue to set dropdown placement to 'bottom-start'.","Refined HeaderSorting.vue to simplify sort option labels and improve sorting logic.","Enhanced HeaderWrapper.vue to utilize reactive properties for sorting state.","Improved HyperLinkEditor.vue and HyperLinkInlineEditor.vue by removing size attributes from icons.","Updated PopupLayout.vue to use a CSS variable for box-shadow styling.","Refined Snackbar.vue to standardize icon colors and improve styling consistency.","Adjusted useTippy.ts to set default placement and arrow visibility for tooltips.","Modified notificationMessage.ts to remove error messages for list fetching.","Cleaned up notifications.ts by removing console logs for a cleaner codebase.","Updated sortStore.ts to comment out unnecessary console logs for better performance.","Enhanced styles.scss by defining new icon size variables and standardizing box-shadow styles."]},"0.0.99":{date:"2024-06-24",changes:["Fix: resolve issue with incorrect version display in Item Table component.","Update changelog retrieval logic to ensure accurate version matching.","Enhance tooltip display for app version and changelog in Item Table component."]}}},abe=e=>{var t;return(t=Object.entries(ibe.changelog).find(([n,s])=>n===e))==null?void 0:t[1].changes},lbe={key:1},cbe=Et(ot({__name:"PopupOverwriteScenes",props:{workspaceId:{},entityId:{}},emits:["import-success"],setup(e,{expose:t,emit:n}){const s=B(null),o=e,r=()=>{s.value&&s.value.show()},i=B(""),a=B("idle"),l=B({file:null,format:null}),{apiServices:c}=ts(!1,{}),u=B(!1),d=async()=>{u.value=!0;const T=o.workspaceId,I=o.entityId;if(!T||!I||!c.value){console.error("Workspace ID or Entity ID is missing");return}try{if(!await c.value.downloadExportedItemsFile(T,I))throw new Error("No response from downloadTemplate API")}catch(x){console.error("Error downloading template:",x)}u.value=!1},h=n,f=()=>{h("import-success"),S()},p=async T=>{var F,E,A;const I=new FormData,x=((F=T.name.split(".").pop())==null?void 0:F.toString())||"";if(I.append("file",T),I.append("format",x),I.append("entity_id",o.entityId||""),!c.value){console.error("API services not available");return}try{await c.value.overwriteScenesViaImportFile(o.workspaceId,o.entityId,I),g()}catch(k){throw console.error("Error uploading file:",k),v(((A=(E=k.response)==null?void 0:E.data)==null?void 0:A.message)||"An unknown error occurred during file upload."),k}},g=()=>{a.value="success"},v=T=>{i.value=T,a.value="error"},C=async()=>{!l.value||!l.value.file||await p(l.value.file)},S=()=>{var T;R(),(T=s.value)==null||T.hide()};t({close:S,open:r});const b=q(()=>({error:"Import failed",importing:"Import in progress",success:"Import successful",idle:"Update existing work"})[a.value]),w=q(()=>l.value.file?!1:(console.error("No file selected"),!0)),D=B(null),R=()=>{var T;(T=D.value)==null||T.clear(),i.value="",l.value={file:null,format:null},a.value="idle"};return(T,I)=>(z(),je(W(Gk),{"popup-name":b.value,"show-overlay":!0,"overlay-opacity":.5,"close-on-overlay-click":!0,"close-on-escape":!0,ref_key:"popupRef",ref:s,onHidden:R},sh({default:ge(()=>[a.value==="importing"||a.value==="error"||a.value==="success"?(z(),je(aN,{key:0,state:a.value,"error-message":i.value,overwrite:!0},null,8,["state","error-message"])):(z(),ce("div",lbe,[be("div",{class:Q(T.$style["step-section"])},[be("span",{class:Q(T.$style["step-title"])},"Step 1: Download current data",2),be("span",{class:Q(T.$style["step-description"])},[...I[1]||(I[1]=[st(" Download a file with all existing work and details. Edit it, then upload in Step 2. ",-1),be("br",null,null,-1),be("i",null,"Note: Empty cells and unchanged values will be skipped.",-1)])],2),fe(W(ht),{class:Q(T.$style["download-sample-btn"]),size:12,variant:"secondary",disabled:u.value,onHandleClick:d},{prefix:ge(()=>[fe(W(at),{src:"Download"})]),default:ge(()=>[I[2]||(I[2]=st(" Download file ",-1))]),_:1},8,["class","disabled"])],2),be("div",{class:Q(T.$style["step-section"])},[be("span",{class:Q(T.$style["step-title"])},"Step 2: Upload updated file (.xlsx, .xls, .csv)",2),fe(W(TO),{modelValue:l.value,"onUpdate:modelValue":I[0]||(I[0]=x=>l.value=x),ref_key:"filUploaderRef",ref:D},null,8,["modelValue"])],2),be("div",{class:Q(T.$style["step-section"]),style:{"padding-top":"0","padding-bottom":"0"}},[fe(lN)],2)]))]),_:2},[a.value==="idle"?{name:"footer",fn:ge(()=>[fe(W(ht),{style:{flex:"1"},variant:"secondary",onClick:S},{default:ge(()=>[...I[3]||(I[3]=[st(" Cancel ",-1)])]),_:1}),fe(W(ht),{disabled:w.value,style:{flex:"1"},variant:"primary",onClick:C},{default:ge(()=>[...I[4]||(I[4]=[st(" Import ",-1)])]),_:1},8,["disabled"])]),key:"0"}:a.value==="success"?{name:"footer",fn:ge(()=>[fe(W(ht),{style:{flex:"1"},variant:"primary",onClick:f},{default:ge(()=>[...I[5]||(I[5]=[st(" Close ",-1)])]),_:1})]),key:"1"}:{name:"footer",fn:ge(()=>[fe(W(ht),{style:{flex:"1"},variant:"primary",onClick:R},{default:ge(()=>[...I[6]||(I[6]=[st(" Try Again ",-1)])]),_:1})]),key:"2"}]),1032,["popup-name"]))}}),[["__cssModules",{$style:{"step-section":"_step-section_lw86z_1","step-title":"_step-title_lw86z_11","step-title-2":"_step-title-2_lw86z_17","step-description":"_step-description_lw86z_23","date-format-guide":"_date-format-guide_lw86z_28","import-error":"_import-error_lw86z_39","drop-area":"_drop-area_lw86z_49","is-dragging":"_is-dragging_lw86z_49","drop-area-content":"_drop-area-content_lw86z_52",browse:"_browse_lw86z_61","download-sample-btn":"_download-sample-btn_lw86z_65"}}]]),ube=Et(ot({__name:"item-table",props:{entityId:{},workspaceId:{}},setup(e,{expose:t}){const n=To,s=Yb(),{setUserPermissions:o,setEntityPermissions:r}=s,{entityPermissions:i}=Gs(s),a=qt,l=B(null),c={ROWS_PER_PAGE:50,ROW_HEIGHT:38,GRID_HEIGHT:"650px"},u=B(""),d=q(()=>{var Ye;const ke=((Ye=i.value)==null?void 0:Ye.has_create_item_permission)==1||!1;return[{label:"Create manually",value:"new_scene",icon:"Plus",type:"icon",id:"create_new_scene",hide:!ke},{label:"Import from CSV or Excel",value:"import_scenes",icon:"FileImport",type:"icon",hide:!ke,id:"import_scenes_option"},{label:"Update existing (CSV or Excel)",value:"overwrite_scenes",icon:"FilePen",type:"icon",hide:!ke,id:"overwrite_scenes_option"}]}),h=e;kf.initialize({wrapVueCellRenderer:_v,wrapVueCellEditor:fN});const f=Pu(),{switchInstanceFunc:p}=Gs(f);rn(()=>{const ke=es();p.value=ke==null?void 0:ke.appContext.config.globalProperties.switchInstance;const Ye=new BroadcastChannel("focusable_channel");vt(()=>{setTimeout(()=>{Ye.postMessage("Focusable elements updated")},7e3)})});const g=B(null),v=B([]),C=Wm(),{rowCount:S}=Gs(C),b=B(!1),w=B(""),D=B(),R=GA(),{metricList:T}=Gs(R),I=B(""),x=B(!1),F=B(new Set),E=B(new Map),{apiServices:A}=ts(!1,h),{columnDefs:k,checkboxColumn:M,saveColumnConfig:O}=ebe(T,h.entityId,g),U=B();et(()=>k,()=>{var ke;(ke=U.value)==null||ke.updateColumnDefs(k.value)},{deep:!0});const X=(ke,Ye)=>{O(ke,Ye)},{updateRowData:J,setMetricValues:ie}=sbe(g),ae=q(()=>({isSearching:w.value.length>0,isFiltering:!(Object.keys(Ae.value||{}).length==1&&Object.keys(Ae.value)[0]=="preflight_status")&&Object.keys(Ae.value||{}).length>0})),ee=q(um),V=q(()=>k.value.filter(ke=>{var Ye;return((Ye=ke.field)==null?void 0:Ye.startsWith("metric_"))&&!ke.hide}).map(ke=>{var Ye;return((Ye=ke.field)==null?void 0:Ye.replace("metric_",""))||""}));Xr("timezone",ee);const H=q(()=>({autoFetch:!1,workspaceId:h.workspaceId,entityId:h.entityId,metricIds:V.value,updateItemData:J,setMetricValues:ie})),{fetchItems:te,getMetricList:pe,cusorMap:ve,getMetricValues:re}=nbe(H),oe=q(()=>{if(!g.value)return!1;const ke=g.value.getSelectedRows().length;return ke>0&&ke>=S.value.total}),K=q(()=>{var ke;return((ke=l.value)==null?void 0:ke.name)||"Items"}),me=ke=>{setTimeout(()=>{vt(()=>{var Ye,Qt;g.value&&(ke?(Ye=g.value)==null||Ye.showNoRowsOverlay():(Qt=g.value)==null||Qt.hideOverlay())})},500)},se=(ke,Ye)=>{var Qt;S.value.total=ke.meta.total??0,(Qt=ke.meta.next)!=null&&Qt.cursor&&(ve[Ye+1]=ke.meta.next.cursor),I.value=ke.meta["X-Tsr-signature"]||"",ke.meta.total===0?me(!0):me(!1)},Se=DO(),G=B(null),{sortingAPIConfiguration:Z,isSortingRunning:de}=Gs(Se),Ae=B({preflight_status:"1"}),Fe=q(()=>({...Ae.value,search:w.value}));Xr("filterParams",Fe);const Le=B([]),ye=async({page:ke,pageSize:Ye,filterText:Qt})=>{var Go;(Go=g.value)==null||Go.hideOverlay();const Xt=ve[ke],Co=!Xt&&ke>1?(ke-1)*Ye:void 0,wa=Z.value;wa.length>0&&(de.value=!0);try{const Ca={cursor:Xt,size:Ye,searchQuery:Qt,offset:Co,sort_by:wa,...Ae.value},oo=await te(Ca);if(!oo)return{rows:[],total:0};const vp=(Kn=>{const Ai=Kn.data.map(bo=>TF(bo,ee.value));return Ai.forEach(bo=>{F.value.add(String(bo.id)),E.value.set(String(bo.id),{})}),Ai})(oo);return se(oo,ke),{rows:vp,total:S.value.total}}catch(Ca){return console.error("Failed to fetch items:",Ca),{rows:[],total:0}}finally{de.value=!1}},{isLoading:N,toggleSidebar:$,onGridReady:le,handleUnSelect:Ge,handleSelectAll:we,onSearch:ze,firstLoad:Ue}=rbe({selectRowData:B([]),isSidebarOpen:b,quickFilterText:w,gridApi:g,perPage:c.ROWS_PER_PAGE,fetcher:ye}),_e=B([]),Ve=()=>{var ke;_e.value=((ke=g.value)==null?void 0:ke.getSelectedRows())||[]},gt=lo({columnsDisplay:[],rowsDisplay:{fromIndex:0,toIndex:0}}),At=q(()=>({blockLoadDebounceMillis:1e3,columnDefs:k.value,rowModelType:"infinite",cacheBlockSize:c.ROWS_PER_PAGE,infiniteInitialRowCount:20,popupParent:document.getElementById("item-table-layout-id")||void 0,rowSelection:{mode:"multiRow",checkboxes:!1,enableClickSelection:!1,enableSelectionWithoutKeys:!1},pagination:!1,rowHeight:c.ROW_HEIGHT,suppressHorizontalScroll:!1,suppressColumnVirtualisation:!1,debounceVerticalScrollbar:!1,animateRows:!1,suppressAnimationFrame:!1,suppressScrollOnNewData:!0,suppressScrollWhenPopupsAreOpen:!1,rowBuffer:20,enableCellTextSelection:!1,suppressDragLeaveHidesColumns:!0,suppressMaxRenderedRowRestriction:!1,height:c.GRID_HEIGHT,stopEditingWhenCellsLoseFocus:!0,onModelUpdated:Ut,noRowsOverlayComponent:_v(JQ),noRowsOverlayComponentParams:()=>ae.value,defaultColDef:{editable:!1,filter:!1,sortable:!1,flex:1,minWidth:100,suppressNavigable:!1},getRowId:ke=>ke.data.id,getRowClass:ke=>{if(!ke.data)return["row-empty"];const Ye=["row-highlight"];return ke.data.id||Ye.push("row-inactive"),ke.data.isDeleted&&Ye.push("row-deleted"),ke.data.disabled&&Ye.push("row-deleted"),ke.data.isArchived&&Ye.push("row-archived"),ke.data.isLocked&&Ye.push("row-locked"),Ye},suppressRowTransform:!1,singleClickEdit:!0,context:{workspaceId:h.workspaceId,entityId:h.entityId,apiServices:A.value,sorting:de.value},onCellKeyDown:ke=>{var Ye,Qt,Xt;if(ke.data.isDeleted)return!1;if(((Ye=ke==null?void 0:ke.event)==null?void 0:Ye.key)==="Enter"){const{api:Co,node:wa,column:Go}=ke,Ca=Co.getCellRendererInstances({rowNodes:[wa],columns:[Go]});if(Ca.length>0){const oo=Ca[0];oo&&typeof((Qt=oo.componsenExposed)==null?void 0:Qt.focus)=="function"&&((Xt=oo.componsenExposed)==null||Xt.focus())}}},isRowSelectable:ke=>!ke.group,suppressKeyboardEvent:ke=>{var Xt;if((Xt=ke.data)!=null&&Xt.isDeleted)return!0;const Ye=ke.event.key,Qt=ke.editing;return Qt&&Ye==="Tab"?!0:Qt&&Ye==="Enter"?!1:Ye==="Enter"?(ke.event.preventDefault(),ke.event.stopPropagation(),!0):Ye==="ArrowUp"||Ye==="ArrowDown"||Ye==="ArrowLeft"||Ye==="ArrowRight"||Ye==="Tab"||Ye==="Enter"},navigateToNextCell:()=>null,onBodyScroll:ke=>{const Ye=ke.api.getFirstDisplayedRowIndex(),Qt=ke.api.getLastDisplayedRowIndex();gt.rowsDisplay.fromIndex=Ye,gt.rowsDisplay.toIndex=Qt,gt.columnsDisplay=ke.api.getAllDisplayedVirtualColumns().map(Xt=>Xt.getColId())},onViewportChanged:ke=>{gt.columnsDisplay=ke.api.getAllDisplayedVirtualColumns().map(Ye=>Ye.getColId())},suppressHeaderFocus:!0,onCellEditingStarted(ke){if(ke.data.isDeleted&&ke.api.stopEditing(),ke.colDef.field=="options"){const Ye=ke.api.getCellRendererInstances({rowNodes:[ke.node],columns:[ke.column]});Ye.length>0&&Ye[0].focusUi()}},tabToNextCell:ke=>{let Ye=ke.nextCellPosition;if(Ye&&Ye.column.getColId()==="ag-Grid-SelectionColumn"){const Qt=ke.api.getAllDisplayedColumns(),Xt=Qt.indexOf(Ye.column),Co=ke.backwards?-1:1,wa=Qt[Xt+Co];if(wa)return{rowIndex:Ye.rowIndex,column:wa,rowPinned:Ye.rowPinned}}return Ye}}));function Ut(){if(!g.value)return;let ke=0;g.value.forEachNode(Ye=>{Ye.data&&ke++}),S.value.loaded=Math.min(ke,S.value.total)}et(()=>Z,()=>{g.value&&(I.value="",F.value.clear(),g.value.deselectAll(),Object.keys(ve).forEach(ke=>delete ve[Number(ke)]),g.value.purgeInfiniteCache(),g.value.ensureIndexVisible(0))},{deep:!0});const en=B(),zt=B(),Ne=()=>{var ke;(ke=zt.value)==null||ke.open()},qe=()=>{var ke;(ke=en.value)==null||ke.open()},wt=async()=>{Ue.value=!0,g.value&&(I.value="",F.value.clear(),Object.keys(ve).forEach(ke=>delete ve[Number(ke)]),await g.value.deselectAll(),await g.value.ensureIndexVisible(0,"top"),await g.value.purgeInfiniteCache(),await g.value.refreshInfiniteCache())},Nt=q(()=>un.getInstance().getItem("ITEM_TABLE_APP_VERSION")||""),Wt=B();q(()=>{var ke;return(ke=abe(Nt.value))==null?void 0:ke.map(Ye=>`<div>• ${Ye}</div>`).join(`
259
- `)});function nt(ke){var Ye;ke==="new_scene"?(Ye=Wt.value)==null||Ye.show():ke==="import_scenes"?qe():ke==="overwrite_scenes"&&Ne()}const Is=ke=>{v.value=ke.api.getSelectedRows().map(Ye=>Ye.id)},Ur=ke=>{const Ye=le(ke);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",Xt=>X(Xt,!0)),Ye.addEventListener("columnResized",Xt=>X(Xt,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport")),Ye},xi=()=>{var ke;u.value=(((ke=document.getElementById("item-table-layout-id"))==null?void 0:ke.clientHeight)??0)-78+"px"};rn(()=>{vt(()=>{xi()}),window.addEventListener("resize",xi);function ke(){requestAnimationFrame(ke)}ke()}),ms(()=>{window.removeEventListener("resize",xi)});const gr=async({code:ke,name:Ye})=>{await ze(ke),setTimeout(()=>{var Qt;(Qt=D.value)==null||Qt.setValue(Ye)},300)},ya=ke=>{if(!g.value)return;const Ye=g.value.getRowNode(ke);Ye?(g.value.ensureIndexVisible(Number(Ye.rowIndex),"middle"),g.value.flashCells({rowNodes:[Ye],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(S.value.total-1,"bottom")},ml=ke=>ke.metric_type.code==="number"?"number":"default",Fi=async()=>{if(h.entityId)try{const ke=await pe(h.entityId);T.value=ke.data.map(Ye=>({...Ye,sortType:ml(Ye)}))}catch(ke){console.error("Failed to initialize metric list:",ke),T.value=[]}},Pi=async()=>{if(A.value)try{const ke=await A.value.getUserPermission(h.workspaceId);o(ke)}catch(ke){console.error("Failed to fetch user permissions:",ke)}},mr=async()=>{if(A.value)try{const ke=await A.value.getEntityDetail(h.workspaceId,h.entityId);r(ke.permission),l.value=ke}catch(ke){console.error("Failed to fetch entity details:",ke)}},Wr=hv(),{setUser:Ad}=Wr,kn=async()=>{if(A.value)try{const ke=await A.value.getMe();return Ad(ke),ke}catch(ke){console.error("Failed to fetch user details:",ke)}},fs=async()=>{var ke;if(A.value)try{const Ye=await A.value.getWorkspaces(h.workspaceId),Qt=(ke=Ye.data[0])==null?void 0:ke.ws_user_role_id;return Qt&&Wr.setUserRoleId(Qt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};et(()=>[h.entityId,h.workspaceId],async([ke,Ye])=>{!ke||!Ye||(kn(),fs(),Fi(),Pi(),mr())},{immediate:!0,deep:!0}),et(V,(ke,Ye)=>{const Qt=ke.filter(Xt=>!(Ye!=null&&Ye.includes(Xt)));Qt.length>0&&re(Array.from(F.value),Qt).then(Xt=>{ie(Xt,F.value,Qt)})},{immediate:!0,deep:!0}),et(I,(ke,Ye)=>{x.value=!!(Ye&&ke&&Ye!==ke)}),t({refreshTable:wt});const b_=ke=>{Ae.value=ke,wt()},kd=ke=>{Le.value=ke,wt()},Od=ke=>{k.value=ke||[],X({},!0)},Md=q(()=>{var Xt;const ke=un.getInstance().getItem("ws.terminology"),Ye=ke?JSON.parse(ke):null;return`New ${((Xt=Ye==null?void 0:Ye.find(Co=>Co.code==="scene"))==null?void 0:Xt.name)||"Scene"}`});return B('<p><br>Here is template notess..</p><p><strong>this is Bold</strong>,<i> this is Italic</i>,<u> this is underline</u><br>this is hightlight ,&nbsp;<br>1</p><p>1</p><ul class="todo-list"><li data-list-item-id="ed7bc572523bb0f35972903183a9d7346"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">1</span></li><li data-list-item-id="ef5b3e469bed2b79951b489fd3a25ffaa"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">2</span></li><li data-list-item-id="ed25bcd78b8b608ed432f01164608cb0d"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">3</span></li><li data-list-item-id="e05c8f5e183d4de144c2a6a8059691d5f"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">4</span></li></ul><p>This is list</p><ul><li data-list-item-id="ed6b9c0b0b97baf09030ee79ea57c40a9">1</li><li data-list-item-id="ef1fc34bceeb4a82abc8c61fe28972c9b">2</li><li data-list-item-id="e950cf66600b9cc40f130a396a6831a75">3</li><li data-list-item-id="e64b6e87f244f9268e45b32b785308a6e">4</li></ul><p>&nbsp;</p>'),(ke,Ye)=>{const Qt=Eo("focusable");return z(),je(W(lJ),{"is-sidebar-open":b.value,onCloseSidebar:W($),onSidebarClear:W($),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:W($)},{"header-left":ge(()=>{var Xt;return[((Xt=W(i))==null?void 0:Xt.has_create_item_permission)==1?(z(),je(W(pS),{key:0,variant:["primary"],options:d.value,onSelect:nt,onHandleClick:Ye[1]||(Ye[1]=Co=>nt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ge(()=>[Ke(fe(W(ht),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Co=>nt("new_scene")),label:Md.value},null,8,["label"]),[[Qt,1]])]),_:1},8,["options"])):Xe("",!0)]}),"header-actions":ge(()=>[fe(W(Mee),{"onUpdate:assignees":kd,onApplyFilter:b_,loading:W(Ue),entityId:h.entityId},null,8,["loading","entityId"]),Ke(fe(W(tS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=Xt=>w.value=Xt),onSearch:W(ze),class:Q(ke.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=Xt=>W(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:D},null,8,["modelValue","onSearch","class"]),[[W(n),{isLoading:W(Ue),fullwidth:!0}]]),Ke((z(),je(W(LA),{status:W(N)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:ge(()=>[Ke((z(),je(W(ht),{variant:["secondary","icon"],disabled:W(N),onClick:wt},{default:ge(()=>[fe(W(at),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[Qt,5],[W(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[W(n),{isLoading:W(Ue),fullwidth:!0}]]),Ke(fe(W(OQ),{"model-value":W(k),onChange:Ye[4]||(Ye[4]=Xt=>Od(Xt)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:U,"checkbox-column":W(M),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[W(n),{isLoading:W(Ue),fullwidth:!0}]])]),grid:ge(({availableHeight:Xt})=>[fe(W(YCe),Kt({id:"item_table_main",ref_key:"agGrid",ref:G},At.value,{height:Xt+"px",isSorting:W(de),onOnGridReady:Ur,onSelectionChanged:Is}),null,16,["height","isSorting"])]),footer:ge(()=>[be("div",{class:Q(ke.$style.tableFooter),id:"table_footer"},[be("span",null,[Ye[5]||(Ye[5]=st(" Showing ",-1)),be("b",null,Ct(W(S).loaded)+" of "+Ct(W(S).total),1)])],2)]),"new-row":ge(()=>[fe(W(dee),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:gr,onFocusOnId:ya},null,512)]),"bulk-update-actions":ge(()=>[!b.value&&v.value.length>0?Ke((z(),je(W(eJ),{key:0,selectRowData:_e.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:W(Ge),onSelectAll:W(we),"take-name":K.value,"selected-all":oe.value,"total-rows":W(S).total,"visible-rows":W(S).loaded,onUpdated:Ve,loading:W(N)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ko,!b.value&&v.value.length>0]]):Xe("",!0)]),snackbar:ge(()=>[fe(W(UJ))]),popup:ge(()=>[fe(Ise,{ref_key:"popupCreateSceneRef",ref:en,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"]),fe(cbe,{ref_key:"popupOverwriteScenesRef",ref:zt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"])}}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),MB="0.1.120",dbe={key:0},hbe=Et(ot({__name:"app",setup(e){const t=q(()=>n.id.length===0||n.workspaceId.length===0),n=lo({id:"",workspaceId:"",apiConfig:{}}),s=gf(),{showMessage:o,showErrorNetMessage:r}=s,i=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=B(null),c=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};th(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",MB);try{if(l.value=es(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||un.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:un.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Ok(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),ms(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=q(()=>n.id),d=q(()=>n.workspaceId);return Xr("workspaceId",d),Xr("entityId",u),(h,f)=>(z(),ce("div",{class:Q(h.$style.dashboardPluginWrapper)},[t.value?(z(),ce("span",dbe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(z(),je(W(ube),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),C_=async(e={},t={})=>{const n=bT(hbe),s=uY();n.use(s);const o=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,o.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${MB}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",qt),n.directive("focusable",Wi);const i=await Rse();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=C_),On.default=C_,On.initDashboard=C_,Object.defineProperties(On,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
259
+ `)});function nt(ke){var Ye;ke==="new_scene"?(Ye=Wt.value)==null||Ye.show():ke==="import_scenes"?qe():ke==="overwrite_scenes"&&Ne()}const Is=ke=>{v.value=ke.api.getSelectedRows().map(Ye=>Ye.id)},Ur=ke=>{const Ye=le(ke);return Ye&&(Ye.addEventListener("modelUpdated",Ut),Ye.addEventListener("bodyScroll",()=>Ye.stopEditing()),Ye.addEventListener("selectionChanged",Ve),Ye.addEventListener("columnMoved",Xt=>X(Xt,!0)),Ye.addEventListener("columnResized",Xt=>X(Xt,!0)),Ye.addEventListener("firstDataRendered",()=>{Ue.value=!1}),!document.querySelector(".ag-body-viewport")),Ye},xi=()=>{var ke;u.value=(((ke=document.getElementById("item-table-layout-id"))==null?void 0:ke.clientHeight)??0)-78+"px"};rn(()=>{vt(()=>{xi()}),window.addEventListener("resize",xi);function ke(){requestAnimationFrame(ke)}ke()}),ms(()=>{window.removeEventListener("resize",xi)});const gr=async({code:ke,name:Ye})=>{await ze(ke),setTimeout(()=>{var Qt;(Qt=D.value)==null||Qt.setValue(Ye)},300)},ya=ke=>{if(!g.value)return;const Ye=g.value.getRowNode(ke);Ye?(g.value.ensureIndexVisible(Number(Ye.rowIndex),"middle"),g.value.flashCells({rowNodes:[Ye],flashDuration:3e3,fadeDuration:1e3})):g.value.ensureIndexVisible(S.value.total-1,"bottom")},ml=ke=>ke.metric_type.code==="number"?"number":"default",Fi=async()=>{if(h.entityId)try{const ke=await pe(h.entityId);T.value=ke.data.map(Ye=>({...Ye,sortType:ml(Ye)}))}catch(ke){console.error("Failed to initialize metric list:",ke),T.value=[]}},Pi=async()=>{if(A.value)try{const ke=await A.value.getUserPermission(h.workspaceId);o(ke)}catch(ke){console.error("Failed to fetch user permissions:",ke)}},mr=async()=>{if(A.value)try{const ke=await A.value.getEntityDetail(h.workspaceId,h.entityId);r(ke.permission),l.value=ke}catch(ke){console.error("Failed to fetch entity details:",ke)}},Wr=hv(),{setUser:Ad}=Wr,kn=async()=>{if(A.value)try{const ke=await A.value.getMe();return Ad(ke),ke}catch(ke){console.error("Failed to fetch user details:",ke)}},fs=async()=>{var ke;if(A.value)try{const Ye=await A.value.getWorkspaces(h.workspaceId),Qt=(ke=Ye.data[0])==null?void 0:ke.ws_user_role_id;return Qt&&Wr.setUserRoleId(Qt),Ye}catch(Ye){console.error("Failed to fetch workspace details:",Ye)}};et(()=>[h.entityId,h.workspaceId],async([ke,Ye])=>{!ke||!Ye||(kn(),fs(),Fi(),Pi(),mr())},{immediate:!0,deep:!0}),et(V,(ke,Ye)=>{const Qt=ke.filter(Xt=>!(Ye!=null&&Ye.includes(Xt)));Qt.length>0&&re(Array.from(F.value),Qt).then(Xt=>{ie(Xt,F.value,Qt)})},{immediate:!0,deep:!0}),et(I,(ke,Ye)=>{x.value=!!(Ye&&ke&&Ye!==ke)}),t({refreshTable:wt});const b_=ke=>{Ae.value=ke,wt()},kd=ke=>{Le.value=ke,wt()},Od=ke=>{k.value=ke||[],X({},!0)},Md=q(()=>{var Xt;const ke=un.getInstance().getItem("ws.terminology"),Ye=ke?JSON.parse(ke):null;return`New ${((Xt=Ye==null?void 0:Ye.find(Co=>Co.code==="scene"))==null?void 0:Xt.name)||"Scene"}`});return B('<p><br>Here is template notess..</p><p><strong>this is Bold</strong>,<i> this is Italic</i>,<u> this is underline</u><br>this is hightlight ,&nbsp;<br>1</p><p>1</p><ul class="todo-list"><li data-list-item-id="ed7bc572523bb0f35972903183a9d7346"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">1</span></li><li data-list-item-id="ef5b3e469bed2b79951b489fd3a25ffaa"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">2</span></li><li data-list-item-id="ed25bcd78b8b608ed432f01164608cb0d"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">3</span></li><li data-list-item-id="e05c8f5e183d4de144c2a6a8059691d5f"><input type="checkbox" disabled="disabled"><span class="todo-list__label__description">4</span></li></ul><p>This is list</p><ul><li data-list-item-id="ed6b9c0b0b97baf09030ee79ea57c40a9">1</li><li data-list-item-id="ef1fc34bceeb4a82abc8c61fe28972c9b">2</li><li data-list-item-id="e950cf66600b9cc40f130a396a6831a75">3</li><li data-list-item-id="e64b6e87f244f9268e45b32b785308a6e">4</li></ul><p>&nbsp;</p>'),(ke,Ye)=>{const Qt=Eo("focusable");return z(),je(W(lJ),{"is-sidebar-open":b.value,onCloseSidebar:W($),onSidebarClear:W($),ref:"itemTableLayoutRef",id:"item-table-layout-id",onSidebarApply:W($)},{"header-left":ge(()=>{var Xt;return[((Xt=W(i))==null?void 0:Xt.has_create_item_permission)==1?(z(),je(W(pS),{key:0,variant:["primary"],options:d.value,onSelect:nt,onHandleClick:Ye[1]||(Ye[1]=Co=>nt("new_scene")),id:"create_scene_dropdown",tabIndex:2},{prefix:ge(()=>[Ke(fe(W(ht),{"data-focus-index":"1",id:"create_new_scene",variant:["primary"],onClick:Ye[0]||(Ye[0]=Co=>nt("new_scene")),label:Md.value},null,8,["label"]),[[Qt,1]])]),_:1},8,["options"])):Xe("",!0)]}),"header-actions":ge(()=>[fe(W(Mee),{"onUpdate:assignees":kd,onApplyFilter:b_,loading:W(Ue),entityId:h.entityId},null,8,["loading","entityId"]),Ke(fe(W(tS),{focusIndex:"4",modelValue:w.value,"onUpdate:modelValue":Ye[2]||(Ye[2]=Xt=>w.value=Xt),onSearch:W(ze),class:Q(ke.$style.itemSearchBox),onClear:Ye[3]||(Ye[3]=Xt=>W(ze)("")),id:"item_search_box",ref_key:"searchBoxRef",ref:D},null,8,["modelValue","onSearch","class"]),[[W(n),{isLoading:W(Ue),fullwidth:!0}]]),Ke((z(),je(W(LA),{status:W(N)?"busy":"active",size:10,id:"refresh_table","status-tooltip":"Data has changed, please refresh the table",color:"var(--warning-color)","show-badge":x.value},{default:ge(()=>[Ke((z(),je(W(ht),{variant:["secondary","icon"],disabled:W(N),onClick:wt},{default:ge(()=>[fe(W(at),{src:"ArrowsRotate"})]),_:1},8,["disabled"])),[[Qt,5],[W(a),"Refresh"]])]),_:1},8,["status","show-badge"])),[[W(n),{isLoading:W(Ue),fullwidth:!0}]]),Ke(fe(W(OQ),{"model-value":W(k),onChange:Ye[4]||(Ye[4]=Xt=>Od(Xt)),id:"table_customization",gridApi:g.value,ref_key:"tableCustomizationRef",ref:U,"checkbox-column":W(M),tableHeight:u.value},null,8,["model-value","gridApi","checkbox-column","tableHeight"]),[[W(n),{isLoading:W(Ue),fullwidth:!0}]])]),grid:ge(({availableHeight:Xt})=>[fe(W(YCe),Kt({id:"item_table_main",ref_key:"agGrid",ref:G},At.value,{height:Xt+"px",isSorting:W(de),onOnGridReady:Ur,onSelectionChanged:Is}),null,16,["height","isSorting"])]),footer:ge(()=>[be("div",{class:Q(ke.$style.tableFooter),id:"table_footer"},[be("span",null,[Ye[5]||(Ye[5]=st(" Showing ",-1)),be("b",null,Ct(W(S).loaded)+" of "+Ct(W(S).total),1)])],2)]),"new-row":ge(()=>[fe(W(dee),{ref_key:"createNewSceneRef",ref:Wt,onSearchForCode:gr,onFocusOnId:ya},null,512)]),"bulk-update-actions":ge(()=>[!b.value&&v.value.length>0?Ke((z(),je(W(eJ),{key:0,selectRowData:_e.value,"workspace-id":h.workspaceId,"entity-id":h.entityId,"grid-api":g.value,onUnselect:W(Ge),onSelectAll:W(we),"take-name":K.value,"selected-all":oe.value,"total-rows":W(S).total,"visible-rows":W(S).loaded,onUpdated:Ve,loading:W(N)},null,8,["selectRowData","workspace-id","entity-id","grid-api","onUnselect","onSelectAll","take-name","selected-all","total-rows","visible-rows","loading"])),[[Ko,!b.value&&v.value.length>0]]):Xe("",!0)]),snackbar:ge(()=>[fe(W(UJ))]),popup:ge(()=>[fe(Ise,{ref_key:"popupCreateSceneRef",ref:en,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"]),fe(cbe,{ref_key:"popupOverwriteScenesRef",ref:zt,"workspace-id":h.workspaceId,"entity-id":h.entityId,onImportSuccess:wt},null,8,["workspace-id","entity-id"])]),_:1},8,["is-sidebar-open","onCloseSidebar","onSidebarClear","onSidebarApply"])}}}),[["__cssModules",{$style:{tableTitle:"_tableTitle_1sow5_1",tableFooter:"_tableFooter_1sow5_7",footerStart:"_footerStart_1sow5_17",newRow:"_newRow_1sow5_25","warning-text":"_warning-text_1sow5_43","has-error":"_has-error_1sow5_48",itemSearchBox:"_itemSearchBox_1sow5_52","beta-tag":"_beta-tag_1sow5_56"}}]]),MB="0.1.121",dbe={key:0},hbe=Et(ot({__name:"app",setup(e){const t=q(()=>n.id.length===0||n.workspaceId.length===0),n=lo({id:"",workspaceId:"",apiConfig:{}}),s=gf(),{showMessage:o,showErrorNetMessage:r}=s,i=["basicInfor"],a=h=>{h.success?o(h.apiCode,"success"):i.includes(h.apiCode)||r(h)},l=B(null),c=()=>{const h=un.getInstance().getItem("API_BASE_URL");return h!=null&&h.includes("v1")?h.slice(0,h.lastIndexOf("/v1")):String(h)};th(()=>{var h,f,p;sessionStorage.setItem("ITEM_TABLE_APP_VERSION",MB);try{if(l.value=es(),!l.value)throw new Error("Current instance is null");n.id=((h=l.value)==null?void 0:h.appContext.config.globalProperties.id)||"",n.workspaceId=((f=l.value)==null?void 0:f.appContext.config.globalProperties.workspaceId)||un.getInstance().getItem("ws.code");const g={domainApi:c(),wsCode:un.getInstance().getItem("ws.code"),entityId:n.id};if(n.apiConfig=(p=l.value)==null?void 0:p.appContext.config.globalProperties.apiConfig,!g.entityId||!g.wsCode||!g.domainApi)throw new Error("API configuration is missing in dashboardConfig");const v=new Ok(n.apiConfig,g);v.on("call-api",a),l.value.appContext.config.globalProperties.apiServices=v}catch(g){console.error("Error getting current instance:",g)}}),ms(()=>{l.value.appContext.config.globalProperties.apiServices.off("call-api",a)});const u=q(()=>n.id),d=q(()=>n.workspaceId);return Xr("workspaceId",d),Xr("entityId",u),(h,f)=>(z(),ce("div",{class:Q(h.$style.dashboardPluginWrapper)},[t.value?(z(),ce("span",dbe," There is no workspaceId or entityIds provided in global properties. Please set them to see the Item Table. ")):u.value?(z(),je(W(ube),{key:1,entityId:u.value,workspaceId:d.value},null,8,["entityId","workspaceId"])):Xe("",!0)],2))}}),[["__cssModules",{$style:{dashboardPluginWrapper:"_dashboardPluginWrapper_1f1og_1"}}]]),C_=async(e={},t={})=>{const n=bT(hbe),s=uY();n.use(s);const o=["apiConfig","workspaceId","id"],r={};Object.entries(e).forEach(([a,l])=>{l!==void 0&&(n.config.globalProperties[a]=l,r[a]=l,o.includes(a)&&typeof l=="string"?sessionStorage.setItem(a,l):console.error(`[Config Error] Key "${a}" has an invalid value and will not be persisted.`))}),n.config.globalProperties.$arboConfig=r,Object.values(t).forEach(a=>{a&&typeof a.install=="function"&&n.use(a)}),n.config.errorHandler=(a,l,c)=>{console.error("[Vue Error]",a),c&&console.error("[Info]",c)},console.log(`%cArbo Dashboard Plugin v${MB}`,"color: #4CAF50; font-weight: bold;"),console.log(n.config.globalProperties),globalThis.window.$switchInstance=n.config.globalProperties.switchInstance,n.provide("switchInstance",n.config.globalProperties.switchInstance),n.directive("tooltip",qt),n.directive("focusable",Wi);const i=await Rse();return n.use(i),n};globalThis.window!==void 0&&(globalThis.window.arboDashboard=C_),On.default=C_,On.initDashboard=C_,Object.defineProperties(On,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arbocollab/arbo-plugin-item-table",
3
- "version": "0.1.120",
3
+ "version": "0.1.121",
4
4
  "type": "module",
5
5
  "main": "./lib/index.umd.js",
6
6
  "module": "./lib/index.es.js",